eve 0.59.0 → 0.60.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/CHANGELOG.md +41 -0
- package/dist/src/approval/definition.d.ts +2 -0
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +9 -9
- package/dist/src/compiled/@ai-sdk/anthropic/index.d.ts +133 -7
- package/dist/src/compiled/@ai-sdk/anthropic/index.js +2 -2
- package/dist/src/compiled/@ai-sdk/google/index.d.ts +46 -5
- package/dist/src/compiled/@ai-sdk/google/index.js +9 -9
- package/dist/src/compiled/@ai-sdk/mcp/index.js +1 -1
- package/dist/src/compiled/@ai-sdk/openai/index.d.ts +186 -37
- package/dist/src/compiled/@ai-sdk/openai/index.js +4 -4
- package/dist/src/compiled/@ai-sdk/otel/index.js +3 -3
- package/dist/src/compiled/@ai-sdk/provider/index.d.ts +2186 -1889
- package/dist/src/compiled/@ai-sdk/provider/index.js +3 -3
- package/dist/src/compiled/@ai-sdk/provider-utils/index.d.ts +35 -1
- package/dist/src/compiled/@chat-adapter/slack/index.js +28 -28
- package/dist/src/compiled/@chat-adapter/twilio/index.js +1 -1
- package/dist/src/compiled/@linqapp/chat-sdk-adapter/index.js +2 -2
- package/dist/src/compiled/@modelcontextprotocol/server/index.js +2 -2
- package/dist/src/compiled/@opentelemetry/otlp-transformer/index.js +1 -1
- package/dist/src/compiled/@photon-ai/chat-adapter-imessage/index.js +61 -60
- package/dist/src/compiled/@vercel/blob/index.js +11 -11
- package/dist/src/compiled/@vercel/oidc/index.js +2 -2
- package/dist/src/compiled/@vercel/sandbox/index.js +2 -2
- package/dist/src/compiled/@workflow/core/index.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime/helpers.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime.js +3 -3
- package/dist/src/compiled/@workflow/core/serialization.js +1 -1
- package/dist/src/compiled/@workflow/core/workflow.js +1 -1
- package/dist/src/compiled/@workflow/world-local/index.js +3 -3
- package/dist/src/compiled/@workflow/world-vercel/index.js +13 -13
- package/dist/src/compiled/_chunks/node/{dist-CyWgAg5-.js → dist-CweJdVFE.js} +1 -1
- package/dist/src/compiled/_chunks/node/{dist-PazOnsjy.js → dist-Da54NuK8.js} +27 -28
- package/dist/src/compiled/_chunks/node/undici-h5GH4RBM.js +95 -0
- package/dist/src/compiled/_chunks/workflow/{attribute-changes-DTFAjP0J.js → attribute-changes-3SKHZsSX.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/coerce-D0oqvQ_w.js +1 -0
- package/dist/src/compiled/_chunks/workflow/dist-C3919PVU.js +25 -0
- package/dist/src/compiled/_chunks/workflow/dist-DearXsdS.js +2 -0
- package/dist/src/compiled/_chunks/workflow/experimental-evaluation-D8_K_Pe9.js +5 -0
- package/dist/src/compiled/_chunks/workflow/{frames-DJw9L4rO.js → frames-Bm_yZi8X.js} +2 -2
- package/dist/src/compiled/_chunks/workflow/{functions-wMCGZAVk.js → functions-C06vHfWP.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{helpers-ClCA9Lmc.js → helpers-K7otPd_U.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{logger-D6vwIEf9.js → logger-CxBCNokg.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{resume-hook-_baK8jaT.js → resume-hook-B7_MC7FC.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{run-CRdL17z4.js → run-jGFog1uQ.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{schemas-DR7NTzNe.js → schemas-4CmFgxN_.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{serialization-CWYPL4Eq.js → serialization-VRHEKI6l.js} +2 -2
- package/dist/src/compiled/_chunks/workflow/{signal-exit-Dsy-TT0V.js → signal-exit-B9U6kH7R.js} +2 -2
- package/dist/src/compiled/_chunks/workflow/sleep-60eDbac6.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{token-D8tWQnPx.js → token-U5XEWlVM.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{token-util-B0OPd7oj.js → token-util-pP4KRRl0.js} +2 -2
- package/dist/src/compiled/_chunks/workflow/{wait-until-DyIt9lEx.js → wait-until-DDJySKt-.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{ws-transport-Dl5FG4Sw.js → ws-transport-CEFNBXPC.js} +1 -1
- package/dist/src/compiled/chat/index.js +1 -1
- package/dist/src/compiled/chokidar/index.js +1 -1
- package/dist/src/compiled/env-runner/node-worker.js +3 -3
- package/dist/src/compiled/gray-matter/index.js +13 -13
- package/dist/src/compiled/shadcn-registry/index.js +2625 -444
- package/dist/src/compiler/default-tool-policy.d.ts +3 -1
- package/dist/src/compiler/default-tool-policy.js +1 -1
- package/dist/src/compiler/extension-compatibility.d.ts +16 -8
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.d.ts +8 -2
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-manifest-helpers.js +1 -1
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/compiler/normalize-subagent.d.ts +1 -0
- package/dist/src/compiler/normalize-subagent.js +1 -1
- package/dist/src/compiler/remote-agent-node.d.ts +1 -0
- package/dist/src/compiler/remote-agent-node.js +1 -1
- package/dist/src/compiler/source-graph.d.ts +1 -0
- package/dist/src/compiler/source-graph.js +1 -1
- package/dist/src/context/dynamic-subagent-lifecycle.js +1 -1
- package/dist/src/evals/autoevals-client.js +1 -1
- package/dist/src/evals/expect/index.js +1 -1
- package/dist/src/evals/judge.js +1 -1
- package/dist/src/execution/dynamic-workflow/tool.js +1 -1
- package/dist/src/execution/session/turn-step.js +1 -1
- package/dist/src/execution/tools/sleep-workflow.js +1 -1
- package/dist/src/framework/sources/registry.js +1 -1
- package/dist/src/harness/compaction.js +1 -1
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/harness/tools.d.ts +1 -1
- package/dist/src/harness/tools.js +1 -1
- package/dist/src/instrumentation/ai-sdk-telemetry.js +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/core.js +1 -1
- package/dist/src/internal/model-auth/transport.js +1 -1
- package/dist/src/internal/nitro/host/extension-capability-requirements.js +1 -1
- package/dist/src/{experimental/evaluate/auto-model.d.ts → models/auto.d.ts} +3 -3
- package/dist/src/models/auto.js +2 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/index.js +1 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/uri.js +1 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/ref.js +1 -1
- package/dist/src/node_modules/.pnpm/{autoevals@0.0.132_ws@8.21.3_bufferutil@4.1.0_ → autoevals@0.0.132_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0_}/node_modules/autoevals/jsdist/index.js +1 -1
- package/dist/src/node_modules/.pnpm/fast-uri@3.1.8/node_modules/fast-uri/index.js +1 -0
- package/dist/src/node_modules/.pnpm/fast-uri@3.1.8/node_modules/fast-uri/lib/schemes.js +1 -0
- package/dist/src/node_modules/.pnpm/fast-uri@3.1.8/node_modules/fast-uri/lib/utils.js +1 -0
- package/dist/src/node_modules/.pnpm/js-yaml@4.3.2/node_modules/js-yaml/dist/js-yaml.js +34 -0
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/auth/workload-identity-auth.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/azure.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/bedrock.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/client.js +11 -0
- package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/core/streaming.js +1 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/core/uploads.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/index.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/headers.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/provider.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/uploads.js +2 -0
- package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/log.js +1 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/AbstractChatCompletionRunner.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/AssistantStream.js +1 -0
- package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/ChatCompletionRunner.js +1 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/ChatCompletionStream.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/ChatCompletionStreamingRunner.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/EventStream.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/ResponsesParser.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/responses/ResponseAccumulator.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/responses/ResponseStream.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/organization.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/projects/projects.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/projects/service-accounts/api-keys.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/projects/service-accounts/service-accounts.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/projects/spend-alerts.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/projects/spend-limit.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/spend-alerts.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/spend-limit.js +1 -0
- package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/audio/speech.js +1 -1
- package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/assistants.js +1 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/beta/beta.js +1 -0
- package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/chatkit/sessions.js +1 -1
- package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/chatkit/threads.js +1 -1
- package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/realtime/sessions.js +1 -1
- package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/realtime/transcription-sessions.js +1 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/beta/responses/input-items.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/beta/responses/input-tokens.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/beta/responses/responses.js +1 -0
- package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/threads/messages.js +1 -1
- package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/threads/runs/runs.js +1 -1
- package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/threads/runs/steps.js +1 -1
- package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/threads/threads.js +1 -1
- package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/containers/containers.js +1 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/containers/files/content.js +1 -0
- package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/containers/files/files.js +1 -1
- package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/files.js +1 -1
- package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/realtime/calls.js +1 -1
- package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/responses/responses.js +1 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/skills/content.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/skills/versions/content.js +1 -0
- package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/vector-stores/file-batches.js +1 -1
- package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/vector-stores/files.js +1 -1
- package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/vector-stores/vector-stores.js +1 -1
- package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/videos.js +1 -1
- package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/webhooks/webhooks.js +1 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/version.js +1 -0
- package/dist/src/public/ai/index.d.ts +1 -0
- package/dist/src/public/ai/index.js +1 -0
- package/dist/src/public/definitions/connections/mcp.d.ts +1 -0
- package/dist/src/public/definitions/connections/openapi.d.ts +1 -0
- package/dist/src/public/definitions/remote-agent.d.ts +5 -0
- package/dist/src/public/definitions/workspace-agent.d.ts +5 -0
- package/dist/src/public/definitions/workspace-agent.js +1 -1
- package/dist/src/public/instrumentation/otel.d.ts +1 -1
- package/dist/src/public/instrumentation/otel.js +1 -1
- package/dist/src/public/models/index.d.ts +1 -0
- package/dist/src/public/models/index.js +1 -0
- package/dist/src/public/models/openai/index.js +1 -1
- package/dist/src/public/tools/approval/index.d.ts +2 -1
- package/dist/src/public/tools/approval/index.js +1 -1
- package/dist/src/react/use-eve-agent.d.ts +11 -2
- package/dist/src/react/use-eve-agent.js +1 -1
- package/dist/src/runtime/agent/resolve-model.js +1 -1
- package/dist/src/runtime/connections/openapi-client.js +1 -1
- package/dist/src/runtime/resolve-agent-graph.js +1 -1
- package/dist/src/runtime/resolve-agent.js +1 -1
- package/dist/src/runtime/subagents/dynamic-agent-config.d.ts +1 -0
- package/dist/src/runtime/subagents/dynamic-agent-config.js +1 -1
- package/dist/src/runtime/subagents/dynamic-remote-agent-config.d.ts +1 -0
- package/dist/src/runtime/subagents/dynamic-remote-agent-config.js +1 -1
- package/dist/src/runtime/subagents/registry.d.ts +5 -2
- package/dist/src/runtime/subagents/registry.js +1 -1
- package/dist/src/runtime/types.d.ts +2 -0
- package/dist/src/setup/flows/model-login-connection.js +1 -1
- package/dist/src/setup/flows/model-login.js +1 -1
- package/dist/src/setup/primitives/pm/bun.d.ts +1 -1
- package/dist/src/setup/primitives/pm/bun.js +1 -1
- package/dist/src/setup/primitives/pm/npm.js +1 -1
- package/dist/src/setup/primitives/pm/pnpm.js +1 -1
- package/dist/src/setup/primitives/pm/run.d.ts +1 -1
- package/dist/src/setup/primitives/pm/run.js +1 -1
- package/dist/src/setup/primitives/pm/types.d.ts +4 -0
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/setup/validate-gateway-key.js +1 -1
- package/dist/src/shared/agent-definition.d.ts +9 -0
- package/dist/src/tools/approval/policies.d.ts +18 -0
- package/dist/src/tools/approval/policies.js +1 -1
- package/dist/src/tools/definition.d.ts +4 -3
- package/dist/src/tools/durable-schema.js +1 -1
- package/dist/src/tools/schema.js +1 -1
- package/dist/src/tracing/agent-channel-delivery-instrumentation.d.ts +2 -3
- package/dist/src/tracing/agent-channel-delivery-instrumentation.js +1 -1
- package/dist/src/tracing/agent-otel-provider.js +2 -2
- package/dist/src/tracing/agent-otel-runtime-context.js +1 -1
- package/dist/src/tracing/agent-otel-session-context.js +1 -1
- package/dist/src/tracing/agent-trace-context-codec.js +1 -1
- package/dist/src/tracing/agent-trace-state.d.ts +1 -0
- package/dist/src/tracing/content-span-processor.d.ts +1 -1
- package/dist/src/tracing/content-span-processor.js +1 -1
- package/dist/src/tracing/local-instrumentation-runtime.js +1 -1
- package/dist/src/tracing/local-traces.d.ts +3 -8
- package/dist/src/tracing/local-traces.js +1 -1
- package/dist/src/tracing/otel-declaration.d.ts +7 -21
- package/dist/src/tracing/otel-declaration.js +1 -1
- package/dist/src/tracing/span-export-policy.d.ts +15 -20
- package/dist/src/tracing/span-export-policy.js +1 -1
- package/docs/agent-config.md +2 -1
- package/docs/connections/mcp.mdx +2 -2
- package/docs/connections/overview.mdx +1 -1
- package/docs/guides/evaluate.md +43 -19
- package/docs/guides/frontend/overview.mdx +44 -8
- package/docs/guides/instrumentation/otel.mdx +26 -22
- package/docs/guides/remote-agents.md +2 -1
- package/docs/reference/typescript-api.md +3 -2
- package/docs/subagents/index.mdx +25 -8
- package/docs/tools/human-in-the-loop.md +27 -5
- package/docs/tools/overview.mdx +4 -2
- package/docs/tools/workflows.mdx +2 -3
- package/package.json +11 -6
- package/dist/src/compiled/_chunks/node/undici-CI8l4LBf.js +0 -95
- package/dist/src/compiled/_chunks/workflow/coerce-ro2dOxbr.js +0 -1
- package/dist/src/compiled/_chunks/workflow/dist-C5KCXSdI.js +0 -2
- package/dist/src/compiled/_chunks/workflow/dist-DsNhwdzf.js +0 -1
- package/dist/src/compiled/_chunks/workflow/dist-KPieTJHT.js +0 -25
- package/dist/src/compiled/_chunks/workflow/sleep-BL0kgJnT.js +0 -1
- package/dist/src/experimental/evaluate/auto-model.js +0 -2
- package/dist/src/node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/index.js +0 -1
- package/dist/src/node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/schemes.js +0 -1
- package/dist/src/node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/utils.js +0 -1
- package/dist/src/node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/dist/js-yaml.js +0 -32
- package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/auth/workload-identity-auth.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/azure.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/client.js +0 -11
- package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/core/uploads.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/index.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/headers.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/uploads.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/AbstractChatCompletionRunner.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/AssistantStream.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/ChatCompletionStream.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/ChatCompletionStreamingRunner.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/EventStream.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/ResponsesParser.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/responses/ResponseStream.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/organization.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/projects/projects.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/projects/service-accounts.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/projects/spend-alerts.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/spend-alerts.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/beta/beta.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/containers/files/content.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/skills/content.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/skills/versions/content.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/version.js +0 -1
- package/dist/src/public/experimental/evaluate/index.d.ts +0 -2
- package/dist/src/public/experimental/evaluate/index.js +0 -1
- /package/dist/src/{experimental/evaluate → ai}/evaluate.d.ts +0 -0
- /package/dist/src/{experimental/evaluate → ai}/evaluate.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/_vendor/partial-json-parser/parser.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/core/api-promise.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/core/error.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/core/pagination.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/core/resource.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/error.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/decoders/line.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/detect-platform.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/errors.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/parse.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/qs/formats.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/qs/stringify.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/qs/utils.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/request-options.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/shims.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/to-file.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/tslib.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/base64.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/bytes.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/env.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/path.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/query.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/sleep.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/uuid.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/values.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/RunnableFunction.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/Util.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/chatCompletionUtils.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/parser.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/admin.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/admin-api-keys.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/audit-logs.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/certificates.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/data-retention.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/groups/groups.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/groups/roles.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/groups/users.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/invites.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/api-keys.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/certificates.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/data-retention.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/groups/groups.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/groups/roles.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/hosted-tool-permissions.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/model-permissions.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/rate-limits.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/roles.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/users/roles.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/users/users.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/roles.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/usage.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/users/roles.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/users/users.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/audio/audio.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/audio/transcriptions.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/audio/translations.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/batches.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/chatkit/chatkit.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/realtime/realtime.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/chat/chat.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/chat/completions/completions.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/chat/completions/index.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/chat/completions/messages.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/chat/index.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/completions.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/conversations/conversations.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/conversations/items.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/embeddings.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/evals/evals.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/evals/runs/output-items.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/evals/runs/runs.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/alpha/alpha.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/alpha/graders.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/checkpoints/checkpoints.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/checkpoints/permissions.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/fine-tuning.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/jobs/checkpoints.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/jobs/jobs.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/methods.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/graders/grader-models.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/graders/graders.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/images.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/index.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/models.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/moderations.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/realtime/client-secrets.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/realtime/realtime.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/responses/input-items.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/responses/input-tokens.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/shared.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/skills/skills.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/skills/versions/versions.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/uploads/parts.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/uploads/uploads.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/webhooks/index.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/webhooks.js +0 -0
- /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/streaming.js +0 -0
package/dist/src/compiled/_chunks/workflow/{signal-exit-Dsy-TT0V.js → signal-exit-B9U6kH7R.js}
RENAMED
|
@@ -2,12 +2,12 @@ import{i as e,t}from"./rolldown-runtime-DPpTSio4.js";import{Buffer as n}from"nod
|
|
|
2
2
|
`)||e.includes(`\r`)||e.includes(`\0`))===!1}function M(e){let t=(e.headersList.get(`referrer-policy`,!0)??``).split(`,`),n=``;if(t.length)for(let e=t.length;e!==0;e--){let r=t[e-1].trim();if(o.has(r)){n=r;break}}return n}function N(e,t){let n=M(t);n!==``&&(e.referrerPolicy=n)}function P(){return`allowed`}function F(){return`success`}function I(){return`success`}function ee(e){let t=null;t=e.mode,e.headersList.set(`sec-fetch-mode`,t,!0)}function z(e){let t=e.origin;if(t!==`client`&&t!==void 0){if(e.responseTainting===`cors`||e.mode===`websocket`)e.headersList.append(`origin`,t,!0);else if(e.method!==`GET`&&e.method!==`HEAD`){switch(e.referrerPolicy){case`no-referrer`:t=null;break;case`no-referrer-when-downgrade`:case`strict-origin`:case`strict-origin-when-cross-origin`:e.origin&&$(e.origin)&&!$(E(e))&&(t=null);break;case`same-origin`:Y(e,E(e))||(t=null)}e.headersList.append(`origin`,t,!0)}}}function H(e,t){return e}function W(e,t,n){return!e?.startTime||e.startTime<t?{domainLookupStartTime:t,domainLookupEndTime:t,connectionStartTime:t,connectionEndTime:t,secureConnectionStartTime:t,ALPNNegotiatedProtocol:e?.ALPNNegotiatedProtocol}:{domainLookupStartTime:H(e.domainLookupStartTime,n),domainLookupEndTime:H(e.domainLookupEndTime,n),connectionStartTime:H(e.connectionStartTime,n),connectionEndTime:H(e.connectionEndTime,n),secureConnectionStartTime:H(e.secureConnectionStartTime,n),ALPNNegotiatedProtocol:e.ALPNNegotiatedProtocol}}function te(e){return H(d.now(),e)}function ne(e){return{startTime:e.startTime??0,redirectStartTime:0,redirectEndTime:0,postRedirectStartTime:e.startTime??0,finalServiceWorkerStartTime:0,finalNetworkResponseStartTime:0,finalNetworkRequestStartTime:0,endTime:0,encodedBodySize:0,decodedBodySize:0,finalConnectionTimingInfo:null}}function re(){return{referrerPolicy:`strict-origin-when-cross-origin`}}function ie(e){return{referrerPolicy:e.referrerPolicy}}function G(e){let t=e.referrerPolicy;h(t);let n=null;if(e.referrer===`client`){let e=c();if(!e||e.origin===`null`)return`no-referrer`;n=new URL(e)}else _.is.URL(e.referrer)&&(n=e.referrer);let r=ae(n),i=ae(n,!0);switch(r.toString().length>4096&&(r=i),t){case`no-referrer`:return`no-referrer`;case`origin`:return i??ae(n,!0);case`unsafe-url`:return r;case`strict-origin`:{let t=E(e);return q(r)&&!q(t)?`no-referrer`:i}case`strict-origin-when-cross-origin`:{let t=E(e);return Y(r,t)?r:q(r)&&!q(t)?`no-referrer`:i}case`same-origin`:return Y(e,r)?r:`no-referrer`;case`origin-when-cross-origin`:return Y(e,r)?r:i;case`no-referrer-when-downgrade`:{let t=E(e);return q(r)&&!q(t)?`no-referrer`:r}}}function ae(e,t=!1){return h(_.is.URL(e)),e=new URL(e),he(e)?`no-referrer`:(e.username=``,e.password=``,e.hash=``,t===!0&&(e.pathname=``,e.search=``),e)}let K=RegExp.prototype.test.bind(/^127\.(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)\.){2}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)$/),oe=RegExp.prototype.test.bind(/^(?:(?:0{1,4}:){7}|(?:0{1,4}:){1,6}:|::)0{0,3}1$/);function se(e){return e.includes(`:`)?(e[0]===`[`&&e[e.length-1]===`]`&&(e=e.slice(1,-1)),oe(e)):K(e)}function ce(e){return e==null||e===`null`?!1:(e=new URL(e),!!(e.protocol===`https:`||e.protocol===`wss:`||se(e.hostname)||e.hostname===`localhost`||e.hostname===`localhost.`||e.hostname.endsWith(`.localhost`)||e.hostname.endsWith(`.localhost.`)||e.protocol===`file:`))}function q(e){return _.is.URL(e)?e.href===`about:blank`||e.href===`about:srcdoc`||e.protocol===`data:`||e.protocol===`blob:`||ce(e.origin):!1}function J(e){}function Y(e,t){return e.origin===t.origin&&e.origin===`null`||e.protocol===t.protocol&&e.hostname===t.hostname&&e.port===t.port}function X(e){return e.controller.state===`aborted`}function Z(e){return e.controller.state===`aborted`||e.controller.state===`terminated`}function le(e){return m[e.toLowerCase()]??e}let ue=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function de(e,t,n=0,r=1){class i{#e;#t;#n;constructor(e,t){this.#e=e,this.#t=t,this.#n=0}next(){if(typeof this!=`object`||this===null||!(#e in this))throw TypeError(`'next' called on an object that does not implement interface ${e} Iterator.`);let i=this.#n,a=t(this.#e);if(i>=a.length)return{value:void 0,done:!0};let{[n]:o,[r]:s}=a[i];this.#n=i+1;let c;switch(this.#t){case`key`:c=o;break;case`value`:c=s;break;case`key+value`:c=[o,s]}return{value:c,done:!1}}}return delete i.prototype.constructor,Object.setPrototypeOf(i.prototype,ue),Object.defineProperties(i.prototype,{[Symbol.toStringTag]:{writable:!1,enumerable:!1,configurable:!0,value:`${e} Iterator`},next:{writable:!0,enumerable:!0,configurable:!0}}),function(e,t){return new i(e,t)}}function Q(e,t,n,r=0,i=1){let a=de(e,n,r,i),o={keys:{writable:!0,enumerable:!0,configurable:!0,value:function(){return _.brandCheck(this,t),a(this,`key`)}},values:{writable:!0,enumerable:!0,configurable:!0,value:function(){return _.brandCheck(this,t),a(this,`value`)}},entries:{writable:!0,enumerable:!0,configurable:!0,value:function(){return _.brandCheck(this,t),a(this,`key+value`)}},forEach:{writable:!0,enumerable:!0,configurable:!0,value:function(n,r=globalThis){if(_.brandCheck(this,t),_.argumentLengthCheck(arguments,1,`${e}.forEach`),typeof n!=`function`)throw TypeError(`Failed to execute 'forEach' on '${e}': parameter 1 is not of type 'Function'.`);for(let{0:e,1:t}of a(this,`key+value`))n.call(r,t,e,this)}}};return Object.defineProperties(t.prototype,{...o,[Symbol.iterator]:{writable:!0,enumerable:!1,configurable:!0,value:o.entries.value}})}function fe(e,t,n){let r=t,i=n;try{me(e.stream.getReader(),r,i)}catch(e){i(e)}}function pe(e){try{e.close(),e.byobRequest?.respond(0)}catch(e){if(!e.message.includes(`Controller is already closed`)&&!e.message.includes(`ReadableStream is already closed`))throw e}}async function me(e,t,n){try{let r=[],i=0;do{let{done:a,value:o}=await e.read();if(a){t(Buffer.concat(r,i));return}if(!g(o)){n(TypeError(`Received non-Uint8Array chunk`));return}r.push(o),i+=o.length}while(1)}catch(e){n(e)}}function he(e){h(`protocol`in e);let t=e.protocol;return t===`about:`||t===`blob:`||t===`data:`}function $(e){return typeof e==`string`&&e[5]===`:`&&e[0]===`h`&&e[1]===`t`&&e[2]===`t`&&e[3]===`p`&&e[4]===`s`||e.protocol===`https:`}function ge(e){h(`protocol`in e);let t=e.protocol;return t===`http:`||t===`https:`}function _e(e,t){let n=e;if(!n.startsWith(`bytes`))return`failure`;let r={position:5};if(t&&y(e=>e===` `||e===` `,n,r),n.charCodeAt(r.position)!==61)return`failure`;r.position++,t&&y(e=>e===` `||e===` `,n,r);let i=y(e=>{let t=e.charCodeAt(0);return t>=48&&t<=57},n,r),a=i.length?Number(i):null;if(t&&y(e=>e===` `||e===` `,n,r),n.charCodeAt(r.position)!==45)return`failure`;r.position++,t&&y(e=>e===` `||e===` `,n,r);let o=y(e=>{let t=e.charCodeAt(0);return t>=48&&t<=57},n,r),s=o.length?Number(o):null;return r.position<n.length||s===null&&a===null||a>s?`failure`:{rangeStartValue:a,rangeEndValue:s}}function ve(e,t,n){let r=`bytes `;return r+=v(`${e}`),r+=`-`,r+=v(`${t}`),r+=`/`,r+=v(`${n}`),r}var ye=class extends r{#e;constructor(e){super(),this.#e=e}_transform(e,t,n){if(!this._inflateStream){if(e.length===0){n();return}this._inflateStream=(e[0]&15)==8?i.createInflate(this.#e):i.createInflateRaw(this.#e),this._inflateStream.on(`data`,this.push.bind(this)),this._inflateStream.on(`end`,()=>this.push(null)),this._inflateStream.on(`error`,e=>this.destroy(e))}this._inflateStream.write(e,t,n)}_final(e){this._inflateStream&&=(this._inflateStream.end(),null),e()}};function be(e){return new ye(e)}function xe(e){let t=null,n=null,r=null,i=Ce(`content-type`,e);if(i===null)return`failure`;for(let e of i){let i=u(e);i!==`failure`&&i.essence!==`*/*`&&(r=i,r.essence===n?!r.parameters.has(`charset`)&&t!==null&&r.parameters.set(`charset`,t):(t=null,r.parameters.has(`charset`)&&(t=r.parameters.get(`charset`)),n=r.essence))}return r??`failure`}function Se(e){let t=e,n={position:0},r=[],i=``;for(;n.position<t.length;){if(i+=y(e=>e!==`"`&&e!==`,`,t,n),n.position<t.length){if(t.charCodeAt(n.position)===34){if(i+=l(t,n),n.position<t.length)continue}else h(t.charCodeAt(n.position)===44),n.position++}i=b(i,!0,!0,e=>e===9||e===32),r.push(i),i=``}return r}function Ce(e,t){let n=t.get(e,!0);return n===null?null:Se(n)}function we(e){return!1}function Te(e){return!!(e.username||e.password)}function Ee(e){return e!=null&&e!==`client`&&e!==`no-traversable`}var De=class{get baseUrl(){return c()}get origin(){return this.baseUrl?.origin}policyContainer=re()};n.exports={isAborted:X,isCancelled:Z,isValidEncodedURL:C,ReadableStreamFrom:f,tryUpgradeRequestToAPotentiallyTrustworthyURL:J,clampAndCoarsenConnectionTimingInfo:W,coarsenedSharedCurrentTime:te,determineRequestsReferrer:G,makePolicyContainer:re,clonePolicyContainer:ie,appendFetchMetadata:ee,appendRequestOriginHeader:z,TAOCheck:I,corsCheck:F,crossOriginResourcePolicyCheck:P,createOpaqueTimingInfo:ne,setRequestReferrerPolicyOnRedirect:N,isValidHTTPToken:p,requestBadPort:D,requestCurrentURL:E,responseURL:x,responseLocationURL:S,isURLPotentiallyTrustworthy:q,isValidReasonPhrase:k,sameOrigin:Y,normalizeMethod:le,iteratorMixin:Q,createIterator:de,isValidHeaderName:A,isValidHeaderValue:j,isErrorLike:O,fullyReadBody:fe,readableStreamClose:pe,urlIsLocal:he,urlHasHttpsScheme:$,urlIsHttpHttpsScheme:ge,readAllBytes:me,simpleRangeHeaderValue:_e,buildContentRange:ve,createInflate:be,extractMimeType:xe,getDecodeSplit:Ce,environmentSettingsObject:new class{settingsObject=new De},isOriginIPPotentiallyTrustworthy:se,hasAuthenticationEntry:we,includesCredentials:Te,isTraversableNavigable:Ee}})),te=t(((t,n)=>{let{iteratorMixin:r}=W(),{kEnumerableProperty:i}=T(),{webidl:a}=U(),o=e(`node:util`);var s=class e{#e=[];constructor(e=void 0){if(a.util.markAsUncloneable(this),e!==void 0)throw a.errors.conversionFailed({prefix:`FormData constructor`,argument:`Argument 1`,types:[`undefined`]})}append(t,n,r=void 0){a.brandCheck(this,e);let i=`FormData.append`;a.argumentLengthCheck(arguments,2,i),t=a.converters.USVString(t),arguments.length===3||a.is.Blob(n)?(n=a.converters.Blob(n,i,`value`),r!==void 0&&(r=a.converters.USVString(r))):n=a.converters.USVString(n);let o=u(t,n,r);this.#e.push(o)}delete(t){a.brandCheck(this,e),a.argumentLengthCheck(arguments,1,`FormData.delete`),t=a.converters.USVString(t),this.#e=this.#e.filter(e=>e.name!==t)}get(t){a.brandCheck(this,e),a.argumentLengthCheck(arguments,1,`FormData.get`),t=a.converters.USVString(t);let n=this.#e.findIndex(e=>e.name===t);return n===-1?null:this.#e[n].value}getAll(t){return a.brandCheck(this,e),a.argumentLengthCheck(arguments,1,`FormData.getAll`),t=a.converters.USVString(t),this.#e.filter(e=>e.name===t).map(e=>e.value)}has(t){return a.brandCheck(this,e),a.argumentLengthCheck(arguments,1,`FormData.has`),t=a.converters.USVString(t),this.#e.findIndex(e=>e.name===t)!==-1}set(t,n,r=void 0){a.brandCheck(this,e);let i=`FormData.set`;a.argumentLengthCheck(arguments,2,i),t=a.converters.USVString(t),arguments.length===3||a.is.Blob(n)?(n=a.converters.Blob(n,i,`value`),r!==void 0&&(r=a.converters.USVString(r))):n=a.converters.USVString(n);let o=u(t,n,r),s=this.#e.findIndex(e=>e.name===t);s===-1?this.#e.push(o):this.#e=[...this.#e.slice(0,s),o,...this.#e.slice(s+1).filter(e=>e.name!==t)]}[o.inspect.custom](e,t){let n=this.#e.reduce((e,t)=>(e[t.name]?Array.isArray(e[t.name])?e[t.name].push(t.value):e[t.name]=[e[t.name],t.value]:e[t.name]=t.value,e),{__proto__:null});t.depth??=e,t.colors??=!0;let r=o.formatWithOptions(t,n);return`FormData ${r.slice(r.indexOf(`]`)+2)}`}static getFormDataState(e){return e.#e}static setFormDataState(e,t){e.#e=t}};let{getFormDataState:c,setFormDataState:l}=s;Reflect.deleteProperty(s,`getFormDataState`),Reflect.deleteProperty(s,`setFormDataState`),r(`FormData`,s,c,`name`,`value`),Object.defineProperties(s.prototype,{append:i,delete:i,get:i,getAll:i,has:i,set:i,[Symbol.toStringTag]:{value:`FormData`,configurable:!0}});function u(e,t,n){if(typeof t!=`string`&&(a.is.File(t)||(t=new File([t],`blob`,{type:t.type})),n!==void 0)){let e={type:t.type,lastModified:t.lastModified};t=new File([t],n,e)}return{name:e,value:t}}a.is.FormData=a.util.MakeTypeAssertion(s),n.exports={FormData:s,makeEntry:u,setFormDataState:l}})),ne=t(((t,n)=>{let{bufferToLowerCasedHeaderName:r}=T(),{HTTP_TOKEN_CODEPOINTS:i}=V(),{makeEntry:a}=te(),{webidl:o}=U(),s=e(`node:assert`),{isomorphicDecode:c}=B(),l=Buffer.from(`--`),u=new TextDecoder,d=new TextDecoder(`utf-8`,{ignoreBOM:!0});function f(e){for(let t=0;t<e.length;++t)if(e.charCodeAt(t)&-128)return!1;return!0}function p(e){let t=e.length;if(t<27||t>70)return!1;for(let n=0;n<t;++n){let t=e.charCodeAt(n);if(!(t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===39||t===45||t===95))return!1}return!0}function m(e,t){s(t!==`failure`&&t.essence===`multipart/form-data`);let n=t.parameters.get(`boundary`);if(n===void 0)throw b(`missing boundary in content-type header`);let r=Buffer.from(`--${n}`,`utf8`),i=[],c={position:0},u=e.indexOf(r);if(u===-1)throw b(`no boundary found in multipart body`);for(c.position=u;;){if(e.subarray(c.position,c.position+r.length).equals(r))c.position+=r.length;else throw b(`expected a value starting with -- and the boundary`);if(y(e,l,c))return i;if(e[c.position]!==13||e[c.position+1]!==10)throw b(`expected CRLF`);c.position+=2;let{name:t,filename:n,contentType:u,encoding:p}=g(e,c);c.position+=2;let m;{let t=e.indexOf(r.subarray(2),c.position);if(t===-1)throw b(`expected boundary after body`);m=e.subarray(c.position,t-4),c.position+=m.length,p===`base64`&&(m=Buffer.from(m.toString(),`base64`))}if(e[c.position]!==13||e[c.position+1]!==10)throw b(`expected CRLF`);c.position+=2;let h;n===null?h=d.decode(Buffer.from(m)):(u??=`text/plain`,f(u)||(u=``),h=new File([m],n,{type:u})),s(o.is.USVString(t)),s(typeof h==`string`&&o.is.USVString(h)||o.is.File(h)),i.push(a(t,h,n))}}function h(e,t){e[t.position]===59&&t.position++,_(e=>e===32||e===9,e,t);let n=_(e=>C(e)&&e!==61&&e!==42,e,t);if(n.length===0)return null;let r=n.toString(`ascii`).toLowerCase(),i=e[t.position]===42;if(i&&t.position++,e[t.position]!==61)return null;t.position++,_(e=>e===32||e===9,e,t);let a;if(i){let n=_(e=>e!==32&&e!==13&&e!==10&&e!==59,e,t);if(n[0]!==117&&n[0]!==85||n[1]!==116&&n[1]!==84||n[2]!==102&&n[2]!==70||n[3]!==45||n[4]!==56)throw b(`unknown encoding, expected utf-8''`);a=decodeURIComponent(u.decode(n.subarray(7)))}else if(e[t.position]===34){t.position++;let n=_(e=>e!==10&&e!==13&&e!==34,e,t);if(e[t.position]!==34)throw b(`Closing quote not found`);t.position++,a=u.decode(n).replace(/%0A/gi,`
|
|
3
3
|
`).replace(/%0D/gi,`\r`).replace(/%22/g,`"`)}else{let n=_(e=>C(e)&&e!==59,e,t);a=u.decode(n)}return{name:r,value:a,extended:i}}function g(e,t){let n=null,a=null,o=null,s=null;for(;;){if(e[t.position]===13&&e[t.position+1]===10){if(n===null)throw b(`header name is null`);return{name:n,filename:a,contentType:o,encoding:s}}let l=_(e=>e!==10&&e!==13&&e!==58,e,t);if(l=v(l,!0,!0,e=>e===9||e===32),!i.test(l.toString()))throw b(`header name does not match the field-name token production`);if(e[t.position]!==58)throw b(`expected :`);switch(t.position++,_(e=>e===32||e===9,e,t),r(l)){case`content-disposition`:{n=a=null;let r=!1;if(_(e=>C(e),e,t).toString(`ascii`).toLowerCase()!==`form-data`)throw b(`expected form-data for content-disposition header`);for(;t.position<e.length&&(e[t.position]!==13||e[t.position+1]!==10);){let i=h(e,t);if(!i)break;i.name===`name`?n=i.value:i.name===`filename`&&(i.extended?(a=i.value,r=!0):r||(a=i.value))}if(n===null)throw b(`name attribute is required in content-disposition header`);break}case`content-type`:{let n=_(e=>e!==10&&e!==13,e,t);n=v(n,!1,!0,e=>e===9||e===32),o=c(n);break}case`content-transfer-encoding`:{let n=_(e=>e!==10&&e!==13,e,t);n=v(n,!1,!0,e=>e===9||e===32),s=c(n);break}default:_(e=>e!==10&&e!==13,e,t)}if(e[t.position]!==13||e[t.position+1]!==10)throw b(`expected CRLF`);t.position+=2}}function _(e,t,n){let r=n.position;for(;r<t.length&&e(t[r]);)++r;return t.subarray(n.position,n.position=r)}function v(e,t,n,r){let i=0,a=e.length-1;if(t)for(;i<e.length&&r(e[i]);)i++;if(n)for(;a>0&&r(e[a]);)a--;return i===0&&a===e.length-1?e:e.subarray(i,a+1)}function y(e,t,n){if(e.length<t.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[n.position+r])return!1;return!0}function b(e){return TypeError(`Failed to parse body as FormData.`,{cause:TypeError(e)})}function x(e){return e<=31||e===127}function S(e){return e===40||e===41||e===60||e===62||e===64||e===44||e===59||e===58||e===92||e===34||e===47||e===91||e===93||e===63||e===61}function C(e){return e<=127&&e!==32&&e!==9&&!x(e)&&!S(e)}n.exports={multipartFormDataParser:m,validateBoundary:p}})),re=t(((e,t)=>{function n(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}t.exports={createDeferredPromise:n}})),ie=t(((t,n)=>{let r=T(),{ReadableStreamFrom:i,readableStreamClose:a,fullyReadBody:o,extractMimeType:s}=W(),{FormData:c,setFormDataState:l}=te(),{webidl:u}=U(),d=e(`node:assert`),{isErrored:f,isDisturbed:p}=e(`node:stream`),{isUint8Array:m}=e(`node:util/types`),{serializeAMimeType:h}=V(),{multipartFormDataParser:g}=ne(),{createDeferredPromise:_}=re(),{parseJSONFromBytes:v}=B(),{utf8DecodeBytes:y}=z(),{runtimeFeatures:b}=H(),x=b.has(`crypto`)?e(`node:crypto`).randomInt:e=>Math.floor(Math.random()*e),S=new TextEncoder;function C(){}let w=new FinalizationRegistry(e=>{let t=e.deref();t&&!t.locked&&!p(t)&&!f(t)&&t.cancel(`Response object has been garbage collected`).catch(C)});function E(e,t=!1){let n=null,o=null;n=u.is.ReadableStream(e)?e:u.is.Blob(e)?e.stream():new ReadableStream({pull(){},start(e){o=e},cancel(){},type:`bytes`}),d(u.is.ReadableStream(n));let s=null,c=null,l=null,p=null;if(typeof e==`string`)c=e,p=`text/plain;charset=UTF-8`;else if(u.is.URLSearchParams(e))c=e.toString(),p=`application/x-www-form-urlencoded;charset=UTF-8`;else if(u.is.BufferSource(e))c=u.util.getCopyOfBytesHeldByBufferSource(e);else if(u.is.FormData(e)){let t=`----formdata-undici-0${`${x(1e11)}`.padStart(11,`0`)}`,n=`--${t}\r\nContent-Disposition: form-data`,r=e=>e.replace(/\n/g,`%0A`).replace(/\r/g,`%0D`).replace(/"/g,`%22`),i=e=>e.replace(/\r?\n|\r/g,`\r
|
|
4
4
|
`),a=[],o=new Uint8Array([13,10]);l=0;let u=!1;for(let[t,s]of e)if(typeof s==`string`){let e=S.encode(n+`; name="${r(i(t))}"\r\n\r\n${i(s)}\r\n`);a.push(e),l+=e.byteLength}else{let e=S.encode(`${n}; name="${r(i(t))}"`+(s.name?`; filename="${r(s.name)}"`:``)+`\r
|
|
5
|
-
Content-Type: ${s.type||`application/octet-stream`}\r\n\r\n`);a.push(e,s,o),typeof s.size==`number`?l+=e.byteLength+s.size+o.byteLength:u=!0}let d=S.encode(`--${t}--\r\n`);a.push(d),l+=d.byteLength,u&&(l=null),c=e,s=async function*(){for(let e of a)e.stream?yield*e.stream():yield e},p=`multipart/form-data; boundary=${t}`}else if(u.is.Blob(e))c=e,l=e.size,e.type&&(p=e.type);else if(typeof e[Symbol.asyncIterator]==`function`){if(t)throw TypeError(`keepalive`);if(r.isDisturbed(e)||e.locked)throw TypeError(`Response body object should not be disturbed or locked`);n=u.is.ReadableStream(e)?e:i(e)}return(typeof c==`string`||m(c))&&(s=()=>(l=typeof c==`string`?Buffer.byteLength(c):c.length,c)),s!=null&&(async()=>{let e=s(),t=e?.[Symbol.asyncIterator]?.();if(t)for await(let e of t){if(f(n))break;e.length&&o.enqueue(new Uint8Array(e))}else e?.length&&!f(n)&&o.enqueue(typeof e==`string`?S.encode(e):new Uint8Array(e));queueMicrotask(()=>a(o))})(),[{stream:n,source:c,length:l},p]}function D(e,t=!1){return u.is.ReadableStream(e)&&(d(!r.isDisturbed(e),`The body has already been consumed.`),d(!e.locked,`The stream is locked.`)),E(e,t)}function O(e){let{0:t,1:n}=e.stream.tee();return e.stream=t,{stream:n,length:e.length,source:e.source}}function k(e,t){return{blob(){return j(this,e=>{let n=N(t(this));return n===null?n=``:n&&=h(n),new Blob([e],{type:n})},e,t)},arrayBuffer(){return j(this,e=>new Uint8Array(e).buffer,e,t)},text(){return j(this,y,e,t)},json(){return j(this,v,e,t)},formData(){return j(this,e=>{let n=N(t(this));if(n!==null)switch(n.essence){case`multipart/form-data`:{let t=g(e,n),r=new c;return l(r,t),r}case`application/x-www-form-urlencoded`:{let t=new URLSearchParams(e.toString()),n=new c;for(let[e,r]of t)n.append(e,r);return n}}throw TypeError(`Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".`)},e,t)},bytes(){return j(this,e=>new Uint8Array(e),e,t)}}}function A(e,t){Object.assign(e.prototype,k(e,t))}function j(e,t,n,r){try{u.brandCheck(e,n)}catch(e){return Promise.reject(e)}if(e=r(e),M(e))return Promise.reject(TypeError(`Body is unusable: Body has already been read`));let i=_(),a=i.reject,s=e=>{try{i.resolve(t(e))}catch(e){a(e)}};return e.body==null?(s(Buffer.allocUnsafe(0)),i.promise):(o(e.body,s,a),i.promise)}function M(e){let t=e.body;return t!=null&&(t.stream.locked||r.isDisturbed(t.stream))}function N(e){let t=e.headersList,n=s(t);return n===`failure`?null:n}n.exports={extractBody:E,safelyExtractBody:D,cloneBody:O,mixinBody:A,streamRegistry:w,bodyUnusable:M}})),G=t(((t,n)=>{let r=e(`node:assert`),i=T(),{channels:a}=D(),o=x(),{RequestContentLengthMismatchError:s,ResponseContentLengthMismatchError:c,RequestAbortedError:l,InvalidArgumentError:u,HeadersTimeoutError:d,HeadersOverflowError:f,SocketError:p,InformationalError:m,BodyTimeoutError:h,HTTPParserError:g,ResponseExceededMaxSizeError:_}=S(),{kUrl:v,kReset:y,kClient:C,kParser:w,kBlocking:E,kRunning:O,kPending:k,kSize:A,kWriting:j,kQueue:M,kNoRef:N,kKeepAliveDefaultTimeout:P,kHostHeader:L,kPendingIdx:R,kRunningIdx:z,kError:B,kPipelining:V,kSocket:H,kKeepAliveTimeoutValue:U,kMaxHeadersSize:W,kKeepAliveMaxTimeout:te,kKeepAliveTimeoutThreshold:ne,kHeadersTimeout:re,kBodyTimeout:G,kStrictContentLength:ae,kMaxRequests:K,kCounter:oe,kMaxResponseSize:se,kOnError:ce,kResume:q,kHTTPContext:J,kClosed:Y}=b(),X=F(),Z=Buffer.alloc(0),le=Buffer[Symbol.species],ue=i.removeAllListeners,de=Symbol(`kIdleSocketValidation`),Q=Symbol(`kIdleSocketValidationTimeout`),fe=Symbol(`kSocketUsed`),pe;function me(){let e=process.env.JEST_WORKER_ID?I():void 0,t,n=process.arch!==`ppc64`;if(process.env.UNDICI_NO_WASM_SIMD===`1`?n=!1:process.env.UNDICI_NO_WASM_SIMD===`0`&&(n=!0),n)try{t=new WebAssembly.Module(ee())}catch{}return t||=new WebAssembly.Module(e||I()),new WebAssembly.Instance(t,{env:{wasm_on_url:(e,t,n)=>0,wasm_on_status:(e,t,n)=>{r($.ptr===e);let i=t-ve+ge.byteOffset;return $.onStatus(new le(ge.buffer,i,n))},wasm_on_message_begin:e=>(r($.ptr===e),$.onMessageBegin()),wasm_on_header_field:(e,t,n)=>{r($.ptr===e);let i=t-ve+ge.byteOffset;return $.onHeaderField(new le(ge.buffer,i,n))},wasm_on_header_value:(e,t,n)=>{r($.ptr===e);let i=t-ve+ge.byteOffset;return $.onHeaderValue(new le(ge.buffer,i,n))},wasm_on_headers_complete:(e,t,n,i)=>(r($.ptr===e),$.onHeadersComplete(t,n===1,i===1)),wasm_on_body:(e,t,n)=>{r($.ptr===e);let i=t-ve+ge.byteOffset;return $.onBody(new le(ge.buffer,i,n))},wasm_on_message_complete:e=>(r($.ptr===e),$.onMessageComplete())}})}let he=null,$=null,ge=null,_e=0,ve=null;var ye=class{constructor(e,t,{exports:n}){this.llhttp=n,this.ptr=this.llhttp.llhttp_alloc(X.TYPE.RESPONSE),this.client=e,this.socket=t,this.timeout=null,this.timeoutWeakRef=new WeakRef(this),this.timeoutValue=null,this.timeoutType=null,this.statusCode=0,this.statusText=``,this.upgrade=!1,this.headers=[],this.headersSize=0,this.headersMaxSize=e[W],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive=``,this.contentLength=``,this.connection=``,this.maxResponseSize=e[se]}setTimeout(e,t){e!==this.timeoutValue||t&1^this.timeoutType&1?(this.timeout&&=(o.clearTimeout(this.timeout),null),e&&(t&1?this.timeout=o.setFastTimeout(be,e,this.timeoutWeakRef):(this.timeout=setTimeout(be,e,this.timeoutWeakRef),this.timeout?.unref())),this.timeoutValue=e):this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.timeoutType=t}resume(){!this.socket.destroyed&&this.paused&&(r(this.ptr!=null),r($===null),this.llhttp.llhttp_resume(this.ptr),r(this.timeoutType===5),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||Z),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let e=this.socket.read();if(e===null)break;this.execute(e)}}execute(e){r($===null),r(this.ptr!=null),r(!this.paused);let{socket:t,llhttp:n}=this;e.length>_e&&(ve&&n.free(ve),_e=Math.ceil(e.length/4096)*4096,ve=n.malloc(_e)),new Uint8Array(n.memory.buffer,ve,_e).set(e);try{let r;try{ge=e,$=this,r=n.llhttp_execute(this.ptr,ve,e.length)}finally{$=null,ge=null}if(r!==X.ERROR.OK){let i=e.subarray(n.llhttp_get_error_pos(this.ptr)-ve);if(r===X.ERROR.PAUSED_UPGRADE)this.onUpgrade(i);else if(r===X.ERROR.PAUSED)this.paused=!0,t.unshift(i);else throw this.createError(r,i)}}catch(e){i.destroy(t,e)}}finish(){r($===null),r(this.ptr!=null),r(!this.paused);let{llhttp:e}=this,t;try{$=this,t=e.llhttp_finish(this.ptr)}finally{$=null}return t===X.ERROR.OK?null:t===X.ERROR.PAUSED||t===X.ERROR.PAUSED_UPGRADE?(this.paused=!0,null):this.createError(t,Z)}createError(e,t){let{llhttp:n,contentLength:r,bytesRead:i}=this;if(r&&i!==parseInt(r,10))return new c;let a=n.llhttp_get_error_reason(this.ptr),o=``;if(a){let e=new Uint8Array(n.memory.buffer,a).indexOf(0);o=`Response does not match the HTTP/1.1 protocol (`+Buffer.from(n.memory.buffer,a,e).toString()+`)`}return new g(o,X.ERROR[e],t)}destroy(){r($===null),r(this.ptr!=null),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&o.clearTimeout(this.timeout),this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.paused=!1}onStatus(e){return this.statusText=e.toString(),0}onMessageBegin(){let{socket:e,client:t}=this;if(e.destroyed)return-1;if(t[O]===0)return i.destroy(e,new p(`bad response`,i.getSocketInfo(e))),-1;let n=t[M][t[z]];return n?(n.onResponseStarted(),0):-1}onHeaderField(e){let t=this.headers.length;return t&1?this.headers[t-1]=Buffer.concat([this.headers[t-1],e]):this.headers.push(e),this.trackHeader(e.length),0}onHeaderValue(e){let t=this.headers.length;(t&1)==1?(this.headers.push(e),t+=1):this.headers[t-1]=Buffer.concat([this.headers[t-1],e]);let n=this.headers[t-2];if(n.length===10){let t=i.bufferToLowerCasedHeaderName(n);t===`keep-alive`?this.keepAlive+=e.toString():t===`connection`&&(this.connection+=e.toString())}else n.length===14&&i.bufferToLowerCasedHeaderName(n)===`content-length`&&(this.contentLength+=e.toString());return this.trackHeader(e.length),0}trackHeader(e){this.headersSize+=e,this.headersSize>=this.headersMaxSize&&i.destroy(this.socket,new f)}onUpgrade(e){let{upgrade:t,client:n,socket:a,headers:o,statusCode:s}=this;r(t),r(n[H]===a),r(!a.destroyed),r(!this.paused),r(!(o.length&1));let c=n[M][n[z]];r(c),r(c.upgrade||c.method===`CONNECT`),this.statusCode=0,this.statusText=``,this.shouldKeepAlive=!1,this.headers=[],this.headersSize=0,a.unshift(e),a[w].destroy(),a[w]=null,a[C]=null,a[B]=null,ue(a),n[H]=null,n[J]=null,n[M][n[z]++]=null,n.emit(`disconnect`,n[v],[n],new m(`upgrade`));try{c.onUpgrade(s,o,a)}catch(e){i.destroy(a,e)}n[q]()}onHeadersComplete(e,t,n){let{client:a,socket:o,headers:s,statusText:c}=this;if(o.destroyed)return-1;if(a[O]===0)return i.destroy(o,new p(`bad response`,i.getSocketInfo(o))),-1;let l=a[M][a[z]];if(!l)return-1;if(r(!this.upgrade),r(this.statusCode<200),e===100)return i.destroy(o,new p(`bad response`,i.getSocketInfo(o))),-1;if(t&&!l.upgrade)return i.destroy(o,new p(`bad upgrade`,i.getSocketInfo(o))),-1;if(r(this.timeoutType===3),this.statusCode=e,this.shouldKeepAlive=n||l.method===`HEAD`&&!o[y]&&this.connection.toLowerCase()===`keep-alive`,this.statusCode>=200){let e=l.bodyTimeout==null?a[G]:l.bodyTimeout;this.setTimeout(e,5)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if(l.method===`CONNECT`||t)return r(a[O]===1),this.upgrade=!0,2;if(r(!(this.headers.length&1)),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&a[V]){let e=this.keepAlive?i.parseKeepAliveTimeout(this.keepAlive):null;if(e!=null){let t=Math.min(e-a[ne],a[te]);t<=0?o[y]=!0:a[U]=t}else a[U]=a[P]}else o[y]=!0;let u=l.onHeaders(e,s,this.resume,c)===!1;return l.aborted?-1:l.method===`HEAD`||e<200?1:(o[E]&&(o[E]=!1,a[q]()),u?X.ERROR.PAUSED:0)}onBody(e){let{client:t,socket:n,statusCode:a,maxResponseSize:o}=this;if(n.destroyed)return-1;let s=t[M][t[z]];return r(s),r(this.timeoutType===5),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),r(a>=200),o>-1&&this.bytesRead+e.length>o?(i.destroy(n,new _),-1):(this.bytesRead+=e.length,s.onData(e)===!1?X.ERROR.PAUSED:0)}onMessageComplete(){let{client:e,socket:t,statusCode:n,upgrade:a,headers:o,contentLength:s,bytesRead:l,shouldKeepAlive:u}=this;if(t.destroyed&&(!n||u))return-1;if(a)return 0;r(n>=100),r(!(this.headers.length&1));let d=e[M][e[z]];return r(d),this.statusCode=0,this.statusText=``,this.bytesRead=0,this.contentLength=``,this.keepAlive=``,this.connection=``,this.headers=[],this.headersSize=0,n<200?0:d.method!==`HEAD`&&s&&l!==parseInt(s,10)?(i.destroy(t,new c),-1):(d.onComplete(o),e[M][e[z]++]=null,t[fe]=e[k]===0,t[j]?(r(e[O]===0),i.destroy(t,new m(`reset`)),X.ERROR.PAUSED):u?t[y]&&e[O]===0?(i.destroy(t,new m(`reset`)),X.ERROR.PAUSED):(e[V]==null||e[V]===1?setImmediate(e[q]):e[q](),0):(i.destroy(t,new m(`reset`)),X.ERROR.PAUSED))}};function be(e){let t=e.deref();if(!t)return;let{socket:n,timeoutType:a,client:o,paused:s}=t;a===3?(!n[j]||n.writableNeedDrain||o[O]>1)&&(r(!s,`cannot be paused while waiting for headers`),i.destroy(n,new d)):a===5?s||i.destroy(n,new h):a===8&&(r(o[O]===0&&o[U]),i.destroy(n,new m(`socket idle timeout`)))}function xe(e,t){if(e[H]=t,he||=me(),t.errored)throw t.errored;if(t.destroyed)throw new p(`destroyed`);return t[N]=!1,t[j]=!1,t[y]=!1,t[E]=!1,t[de]=0,t[Q]=null,t[fe]=!1,t[w]=new ye(e,t,he),i.addListener(t,`error`,Se),i.addListener(t,`readable`,Ce),i.addListener(t,`end`,we),i.addListener(t,`close`,Te),t[Y]=!1,t.on(`close`,Ee),{version:`h1`,defaultPipelining:1,write(t){return je(e,t)},resume(){ke(e)},destroy(e,n){t[Y]?queueMicrotask(n):(t.on(`close`,n),t.destroy(e))},get destroyed(){return t.destroyed},busy(n){return!!(t[j]||t[y]||t[E]||t[de]===1||n&&(e[O]>0&&!n.idempotent||e[O]>0&&(n.upgrade||n.method===`CONNECT`)||e[O]>0&&i.bodyLength(n.body)!==0&&(i.isStream(n.body)||i.isAsyncIterable(n.body)||i.isFormDataLike(n.body))))}}}function Se(e){r(e.code!==`ERR_TLS_CERT_ALTNAME_INVALID`);let t=this[w];if(e.code===`ECONNRESET`&&t.statusCode&&!t.shouldKeepAlive){let e=t.finish();e&&(this[B]=e,this[C][ce](e));return}this[B]=e,this[C][ce](e)}function Ce(){this[w]?.readMore()}function we(){let e=this[w];if(e.statusCode&&!e.shouldKeepAlive){let t=e.finish();t&&i.destroy(this,t);return}i.destroy(this,new p(`other side closed`,i.getSocketInfo(this)))}function Te(){let e=this[w];De(this),e&&(!this[B]&&e.statusCode&&!e.shouldKeepAlive&&(this[B]=e.finish()||this[B]),this[w].destroy(),this[w]=null);let t=this[B]||new p(`closed`,i.getSocketInfo(this)),n=this[C];if(n[H]=null,n[J]=null,n.destroyed){r(n[k]===0);let e=n[M].splice(n[z]);for(let r=0;r<e.length;r++){let a=e[r];i.errorRequest(n,a,t)}}else if(n[O]>0&&t.code!==`UND_ERR_INFO`){let e=n[M][n[z]];n[M][n[z]++]=null,i.errorRequest(n,e,t)}n[R]=n[z],r(n[O]===0),n.emit(`disconnect`,n[v],[n],t),n[q]()}function Ee(){this[Y]=!0}function De(e){e[Q]&&(clearTimeout(e[Q]),e[Q]=null),e[de]=0}function Oe(e,t){t[de]=1,t[Q]=setTimeout(()=>{t[Q]=null,t[de]=2,e[H]===t&&!t.destroyed&&e[q]()},0),t[Q].unref?.()}function ke(e){let t=e[H];if(t&&!t.destroyed){if(e[A]===0?!t[N]&&t.unref&&(t.unref(),t[N]=!0):t[N]&&t.ref&&(t.ref(),t[N]=!1),e[O]===0&&e[k]>0&&t[fe]){if(t[de]===0)return Oe(e,t),t[w].readMore(),t.destroyed,void 0;if(t[de]===1)return t[w].readMore(),t.destroyed,void 0}if(e[O]===0&&(t[w].readMore(),t.destroyed))return;if(e[A]===0)t[w].timeoutType!==8&&t[w].setTimeout(e[U],8);else if(e[O]>0&&t[w].statusCode<200&&t[w].timeoutType!==3){let n=e[M][e[z]],r=n.headersTimeout==null?e[re]:n.headersTimeout;t[w].setTimeout(r,3)}}}function Ae(e){return e!==`GET`&&e!==`HEAD`&&e!==`OPTIONS`&&e!==`TRACE`&&e!==`CONNECT`}function je(e,t){let{method:n,path:o,host:c,upgrade:d,blocking:f,reset:p}=t,{body:h,headers:g,contentLength:_}=t,v=n===`PUT`||n===`POST`||n===`PATCH`||n===`QUERY`||n===`PROPFIND`||n===`PROPPATCH`;if(i.isFormDataLike(h)){pe||=ie().extractBody;let[e,n]=pe(h);t.contentType??g.push(`content-type`,n),h=e.stream,_=e.length}else if(i.isBlobLike(h)&&t.contentType==null){let n=h.type;if(n){let r=`${n}`;if(!i.isValidHeaderValue(r))return i.errorRequest(e,t,new u(`invalid content-type header`)),!1;g.push(`content-type`,r)}}h&&typeof h.read==`function`&&h.read(0);let b=i.bodyLength(h);if(_=b??_,_===null&&(_=t.contentLength),_===0&&!v&&(_=null),Ae(n)&&_>0&&t.contentLength!==null&&t.contentLength!==_){if(e[ae])return i.errorRequest(e,t,new s),!1;process.emitWarning(new s)}let x=e[H];De(x);let S=n=>{t.aborted||t.completed||(i.errorRequest(e,t,n||new l),i.destroy(h),i.destroy(x,new m(`aborted`)))};try{t.onConnect(S)}catch(n){i.errorRequest(e,t,n)}if(t.aborted)return!1;n===`HEAD`&&(x[y]=!0),(d||n===`CONNECT`)&&(x[y]=!0),p!=null&&(x[y]=p),e[K]&&x[oe]++>=e[K]&&(x[y]=!0),f&&(x[E]=!0),x.setTypeOfService&&x.setTypeOfService(t.typeOfService);let C=`${n} ${o} HTTP/1.1\r\n`;if(C+=typeof c==`string`?`host: ${c}\r\n`:e[L],d?C+=`connection: upgrade\r\nupgrade: ${d}\r\n`:e[V]&&!x[y]?C+=`connection: keep-alive\r
|
|
5
|
+
Content-Type: ${s.type||`application/octet-stream`}\r\n\r\n`);a.push(e,s,o),typeof s.size==`number`?l+=e.byteLength+s.size+o.byteLength:u=!0}let d=S.encode(`--${t}--\r\n`);a.push(d),l+=d.byteLength,u&&(l=null),c=e,s=async function*(){for(let e of a)e.stream?yield*e.stream():yield e},p=`multipart/form-data; boundary=${t}`}else if(u.is.Blob(e))c=e,l=e.size,e.type&&(p=e.type);else if(typeof e[Symbol.asyncIterator]==`function`){if(t)throw TypeError(`keepalive`);if(r.isDisturbed(e)||e.locked)throw TypeError(`Response body object should not be disturbed or locked`);n=u.is.ReadableStream(e)?e:i(e)}return(typeof c==`string`||m(c))&&(s=()=>(l=typeof c==`string`?Buffer.byteLength(c):c.length,c)),s!=null&&(async()=>{let e=s(),t=e?.[Symbol.asyncIterator]?.();if(t)for await(let e of t){if(f(n))break;e.length&&o.enqueue(new Uint8Array(e))}else e?.length&&!f(n)&&o.enqueue(typeof e==`string`?S.encode(e):new Uint8Array(e));queueMicrotask(()=>a(o))})(),[{stream:n,source:c,length:l},p]}function D(e,t=!1){return u.is.ReadableStream(e)&&(d(!r.isDisturbed(e),`The body has already been consumed.`),d(!e.locked,`The stream is locked.`)),E(e,t)}function O(e){let{0:t,1:n}=e.stream.tee();return e.stream=t,{stream:n,length:e.length,source:e.source}}function k(e,t){return{blob(){return j(this,e=>{let n=N(t(this));return n===null?n=``:n&&=h(n),new Blob([e],{type:n})},e,t)},arrayBuffer(){return j(this,e=>new Uint8Array(e).buffer,e,t)},text(){return j(this,y,e,t)},json(){return j(this,v,e,t)},formData(){return j(this,e=>{let n=N(t(this));if(n!==null)switch(n.essence){case`multipart/form-data`:{let t=g(e,n),r=new c;return l(r,t),r}case`application/x-www-form-urlencoded`:{let t=new URLSearchParams(e.toString()),n=new c;for(let[e,r]of t)n.append(e,r);return n}}throw TypeError(`Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".`)},e,t)},bytes(){return j(this,e=>new Uint8Array(e),e,t)}}}function A(e,t){Object.assign(e.prototype,k(e,t))}function j(e,t,n,r){try{u.brandCheck(e,n)}catch(e){return Promise.reject(e)}if(e=r(e),M(e))return Promise.reject(TypeError(`Body is unusable: Body has already been read`));let i=_(),a=i.reject,s=e=>{try{i.resolve(t(e))}catch(e){a(e)}};return e.body==null?(s(Buffer.allocUnsafe(0)),i.promise):(o(e.body,s,a),i.promise)}function M(e){let t=e.body;return t!=null&&(t.stream.locked||r.isDisturbed(t.stream))}function N(e){let t=e.headersList,n=s(t);return n===`failure`?null:n}n.exports={extractBody:E,safelyExtractBody:D,cloneBody:O,mixinBody:A,streamRegistry:w,bodyUnusable:M}})),G=t(((t,n)=>{let r=e(`node:assert`),i=T(),{channels:a}=D(),o=x(),{RequestContentLengthMismatchError:s,ResponseContentLengthMismatchError:c,RequestAbortedError:l,InvalidArgumentError:u,HeadersTimeoutError:d,HeadersOverflowError:f,SocketError:p,InformationalError:m,BodyTimeoutError:h,HTTPParserError:g,ResponseExceededMaxSizeError:_}=S(),{kUrl:v,kReset:y,kClient:C,kParser:w,kBlocking:E,kRunning:O,kPending:k,kSize:A,kWriting:j,kQueue:M,kNoRef:N,kKeepAliveDefaultTimeout:P,kHostHeader:L,kPendingIdx:R,kRunningIdx:z,kError:B,kPipelining:V,kSocket:H,kKeepAliveTimeoutValue:U,kMaxHeadersSize:W,kKeepAliveMaxTimeout:te,kKeepAliveTimeoutThreshold:ne,kHeadersTimeout:re,kBodyTimeout:G,kStrictContentLength:ae,kMaxRequests:K,kCounter:oe,kMaxResponseSize:se,kOnError:ce,kResume:q,kHTTPContext:J,kClosed:Y}=b(),X=F(),Z=Buffer.alloc(0),le=Buffer[Symbol.species],ue=i.removeAllListeners,de=Symbol(`kIdleSocketValidation`),Q=Symbol(`kIdleSocketValidationTimeout`),fe=Symbol(`kSocketUsed`),pe;function me(){let e=process.env.JEST_WORKER_ID?I():void 0,t,n=process.arch!==`ppc64`;if(process.env.UNDICI_NO_WASM_SIMD===`1`?n=!1:process.env.UNDICI_NO_WASM_SIMD===`0`&&(n=!0),n)try{t=new WebAssembly.Module(ee())}catch{}return t||=new WebAssembly.Module(e||I()),new WebAssembly.Instance(t,{env:{wasm_on_url:(e,t,n)=>0,wasm_on_status:(e,t,n)=>{r($.ptr===e);let i=t-ve+ge.byteOffset;return $.onStatus(new le(ge.buffer,i,n))},wasm_on_message_begin:e=>(r($.ptr===e),$.onMessageBegin()),wasm_on_header_field:(e,t,n)=>{r($.ptr===e);let i=t-ve+ge.byteOffset;return $.onHeaderField(new le(ge.buffer,i,n))},wasm_on_header_value:(e,t,n)=>{r($.ptr===e);let i=t-ve+ge.byteOffset;return $.onHeaderValue(new le(ge.buffer,i,n))},wasm_on_headers_complete:(e,t,n,i)=>(r($.ptr===e),$.onHeadersComplete(t,n===1,i===1)),wasm_on_body:(e,t,n)=>{r($.ptr===e);let i=t-ve+ge.byteOffset;return $.onBody(new le(ge.buffer,i,n))},wasm_on_message_complete:e=>(r($.ptr===e),$.onMessageComplete())}})}let he=null,$=null,ge=null,_e=0,ve=null;var ye=class{constructor(e,t,{exports:n}){this.llhttp=n,this.ptr=this.llhttp.llhttp_alloc(X.TYPE.RESPONSE),this.client=e,this.socket=t,this.timeout=null,this.timeoutWeakRef=new WeakRef(this),this.timeoutValue=null,this.timeoutType=null,this.statusCode=0,this.statusText=``,this.upgrade=!1,this.headers=[],this.headersSize=0,this.headersMaxSize=e[W],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive=``,this.contentLength=``,this.connection=``,this.maxResponseSize=e[se]}setTimeout(e,t){e!==this.timeoutValue||t&1^this.timeoutType&1?(this.timeout&&=(o.clearTimeout(this.timeout),null),e&&(t&1?this.timeout=o.setFastTimeout(be,e,this.timeoutWeakRef):(this.timeout=setTimeout(be,e,this.timeoutWeakRef),this.timeout?.unref())),this.timeoutValue=e):this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.timeoutType=t}resume(){!this.socket.destroyed&&this.paused&&(r(this.ptr!=null),r($===null),this.llhttp.llhttp_resume(this.ptr),r(this.timeoutType===5),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||Z),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let e=this.socket.read();if(e===null)break;this.execute(e)}}execute(e){r($===null),r(this.ptr!=null),r(!this.paused);let{socket:t,llhttp:n}=this;e.length>_e&&(ve&&n.free(ve),_e=Math.ceil(e.length/4096)*4096,ve=n.malloc(_e)),new Uint8Array(n.memory.buffer,ve,_e).set(e);try{let r;try{ge=e,$=this,r=n.llhttp_execute(this.ptr,ve,e.length)}finally{$=null,ge=null}if(r!==X.ERROR.OK){let i=e.subarray(n.llhttp_get_error_pos(this.ptr)-ve);if(r===X.ERROR.PAUSED_UPGRADE)this.onUpgrade(i);else if(r===X.ERROR.PAUSED)this.paused=!0,t.unshift(i);else throw this.createError(r,i)}}catch(e){i.destroy(t,e)}}finish(){r($===null),r(this.ptr!=null),r(!this.paused);let{llhttp:e}=this,t;try{$=this,t=e.llhttp_finish(this.ptr)}finally{$=null}return t===X.ERROR.OK?null:t===X.ERROR.PAUSED||t===X.ERROR.PAUSED_UPGRADE?(this.paused=!0,null):this.createError(t,Z)}createError(e,t){let{llhttp:n,contentLength:r,bytesRead:i}=this;if(r&&i!==parseInt(r,10))return new c;let a=n.llhttp_get_error_reason(this.ptr),o=``;if(a){let e=new Uint8Array(n.memory.buffer,a).indexOf(0);o=`Response does not match the HTTP/1.1 protocol (`+Buffer.from(n.memory.buffer,a,e).toString()+`)`}return new g(o,X.ERROR[e],t)}destroy(){r($===null),r(this.ptr!=null),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&o.clearTimeout(this.timeout),this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.paused=!1}onStatus(e){return this.statusText=e.toString(),0}onMessageBegin(){let{socket:e,client:t}=this;if(e.destroyed)return-1;if(t[O]===0)return i.destroy(e,new p(`bad response`,i.getSocketInfo(e))),-1;let n=t[M][t[z]];return n?(n.onResponseStarted(),0):-1}onHeaderField(e){let t=this.headers.length;return t&1?this.headers[t-1]=Buffer.concat([this.headers[t-1],e]):this.headers.push(e),this.trackHeader(e.length),0}onHeaderValue(e){let t=this.headers.length;(t&1)==1?(this.headers.push(e),t+=1):this.headers[t-1]=Buffer.concat([this.headers[t-1],e]);let n=this.headers[t-2];if(n.length===10){let t=i.bufferToLowerCasedHeaderName(n);t===`keep-alive`?this.keepAlive+=e.toString():t===`connection`&&(this.connection+=e.toString())}else n.length===14&&i.bufferToLowerCasedHeaderName(n)===`content-length`&&(this.contentLength+=e.toString());return this.trackHeader(e.length),0}trackHeader(e){this.headersSize+=e,this.headersSize>=this.headersMaxSize&&i.destroy(this.socket,new f)}onUpgrade(e){let{upgrade:t,client:n,socket:a,headers:o,statusCode:s}=this;r(t),r(n[H]===a),r(!a.destroyed),r(!this.paused),r(!(o.length&1));let c=n[M][n[z]];r(c),r(c.upgrade||c.method===`CONNECT`),this.statusCode=0,this.statusText=``,this.shouldKeepAlive=!1,this.headers=[],this.headersSize=0,a.unshift(e),a[w].destroy(),a[w]=null,a[C]=null,a[B]=null,ue(a),n[H]=null,n[J]=null,n[M][n[z]++]=null,n.emit(`disconnect`,n[v],[n],new m(`upgrade`));try{c.onUpgrade(s,o,a)}catch(e){i.destroy(a,e)}n[q]()}onHeadersComplete(e,t,n){let{client:a,socket:o,headers:s,statusText:c}=this;if(o.destroyed)return-1;if(a[O]===0)return i.destroy(o,new p(`bad response`,i.getSocketInfo(o))),-1;let l=a[M][a[z]];if(!l)return-1;if(r(!this.upgrade),r(this.statusCode<200),e===100)return i.destroy(o,new p(`bad response`,i.getSocketInfo(o))),-1;if(t&&!l.upgrade)return i.destroy(o,new p(`bad upgrade`,i.getSocketInfo(o))),-1;if(r(this.timeoutType===3),this.statusCode=e,this.shouldKeepAlive=n||l.method===`HEAD`&&!o[y]&&this.connection.toLowerCase()===`keep-alive`,this.statusCode>=200){let e=l.bodyTimeout==null?a[G]:l.bodyTimeout;this.setTimeout(e,5)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if(l.method===`CONNECT`||t)return r(a[O]===1),this.upgrade=!0,2;if(r(!(this.headers.length&1)),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&a[V]){let e=this.keepAlive?i.parseKeepAliveTimeout(this.keepAlive):null;if(e!=null){let t=Math.min(e-a[ne],a[te]);t<=0?o[y]=!0:a[U]=t}else a[U]=a[P]}else o[y]=!0;let u=l.onHeaders(e,s,this.resume,c)===!1;return l.aborted?-1:l.method===`HEAD`||e<200?1:(o[E]&&(o[E]=!1,a[q]()),u?X.ERROR.PAUSED:0)}onBody(e){let{client:t,socket:n,statusCode:a,maxResponseSize:o}=this;if(n.destroyed)return-1;let s=t[M][t[z]];return r(s),r(this.timeoutType===5),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),r(a>=200),o>-1&&this.bytesRead+e.length>o?(i.destroy(n,new _),-1):(this.bytesRead+=e.length,s.onData(e)===!1?X.ERROR.PAUSED:0)}onMessageComplete(){let{client:e,socket:t,statusCode:n,upgrade:a,headers:o,contentLength:s,bytesRead:l,shouldKeepAlive:u}=this;if(t.destroyed&&(!n||u))return-1;if(a)return 0;r(n>=100),r(!(this.headers.length&1));let d=e[M][e[z]];return r(d),this.statusCode=0,this.statusText=``,this.bytesRead=0,this.contentLength=``,this.keepAlive=``,this.connection=``,this.headers=[],this.headersSize=0,n<200?0:d.method!==`HEAD`&&s&&l!==parseInt(s,10)?(i.destroy(t,new c),-1):(d.onComplete(o),e[M][e[z]++]=null,t[fe]=e[k]===0,t[j]?(r(e[O]===0),i.destroy(t,new m(`reset`)),X.ERROR.PAUSED):!u||t[y]&&e[O]===0?(i.destroy(t,new m(`reset`)),X.ERROR.PAUSED):(e[V]==null||e[V]===1?setImmediate(e[q]):e[q](),0))}};function be(e){let t=e.deref();if(!t)return;let{socket:n,timeoutType:a,client:o,paused:s}=t;a===3?(!n[j]||n.writableNeedDrain||o[O]>1)&&(r(!s,`cannot be paused while waiting for headers`),i.destroy(n,new d)):a===5?s||i.destroy(n,new h):a===8&&(r(o[O]===0&&o[U]),i.destroy(n,new m(`socket idle timeout`)))}function xe(e,t){if(e[H]=t,he||=me(),t.errored)throw t.errored;if(t.destroyed)throw new p(`destroyed`);return t[N]=!1,t[j]=!1,t[y]=!1,t[E]=!1,t[de]=0,t[Q]=null,t[fe]=!1,t[w]=new ye(e,t,he),i.addListener(t,`error`,Se),i.addListener(t,`readable`,Ce),i.addListener(t,`end`,we),i.addListener(t,`close`,Te),t[Y]=!1,t.on(`close`,Ee),{version:`h1`,defaultPipelining:1,write(t){return je(e,t)},resume(){ke(e)},destroy(e,n){t[Y]?queueMicrotask(n):(t.on(`close`,n),t.destroy(e))},get destroyed(){return t.destroyed},busy(n){return!!(t[j]||t[y]||t[E]||t[de]===1||n&&(e[O]>0&&!n.idempotent||e[O]>0&&(n.upgrade||n.method===`CONNECT`)||e[O]>0&&i.bodyLength(n.body)!==0&&(i.isStream(n.body)||i.isAsyncIterable(n.body)||i.isFormDataLike(n.body))))}}}function Se(e){r(e.code!==`ERR_TLS_CERT_ALTNAME_INVALID`);let t=this[w];if(e.code===`ECONNRESET`&&t.statusCode&&!t.shouldKeepAlive){let e=t.finish();e&&(this[B]=e,this[C][ce](e));return}this[B]=e,this[C][ce](e)}function Ce(){this[w]?.readMore()}function we(){let e=this[w];if(e.statusCode&&!e.shouldKeepAlive){let t=e.finish();t&&i.destroy(this,t);return}i.destroy(this,new p(`other side closed`,i.getSocketInfo(this)))}function Te(){let e=this[w];De(this),e&&(!this[B]&&e.statusCode&&!e.shouldKeepAlive&&(this[B]=e.finish()||this[B]),this[w].destroy(),this[w]=null);let t=this[B]||new p(`closed`,i.getSocketInfo(this)),n=this[C];if(n[H]=null,n[J]=null,n.destroyed){r(n[k]===0);let e=n[M].splice(n[z]);for(let r=0;r<e.length;r++){let a=e[r];i.errorRequest(n,a,t)}}else if(n[O]>0&&t.code!==`UND_ERR_INFO`){let e=n[M][n[z]];n[M][n[z]++]=null,i.errorRequest(n,e,t)}n[R]=n[z],r(n[O]===0),n.emit(`disconnect`,n[v],[n],t),n[q]()}function Ee(){this[Y]=!0}function De(e){e[Q]&&(clearTimeout(e[Q]),e[Q]=null),e[de]=0}function Oe(e,t){t[de]=1,t[Q]=setTimeout(()=>{t[Q]=null,t[de]=2,e[H]===t&&!t.destroyed&&e[q]()},0),t[Q].unref?.()}function ke(e){let t=e[H];if(t&&!t.destroyed){if(e[A]===0?!t[N]&&t.unref&&(t.unref(),t[N]=!0):t[N]&&t.ref&&(t.ref(),t[N]=!1),e[O]===0&&e[k]>0&&t[fe]){if(t[de]===0){Oe(e,t),t[w].readMore(),t.destroyed;return}if(t[de]===1){t[w].readMore(),t.destroyed;return}}if(e[O]===0&&(t[w].readMore(),t.destroyed))return;if(e[A]===0)t[w].timeoutType!==8&&t[w].setTimeout(e[U],8);else if(e[O]>0&&t[w].statusCode<200&&t[w].timeoutType!==3){let n=e[M][e[z]],r=n.headersTimeout==null?e[re]:n.headersTimeout;t[w].setTimeout(r,3)}}}function Ae(e){return e!==`GET`&&e!==`HEAD`&&e!==`OPTIONS`&&e!==`TRACE`&&e!==`CONNECT`}function je(e,t){let{method:n,path:o,host:c,upgrade:d,blocking:f,reset:p}=t,{body:h,headers:g,contentLength:_}=t,v=n===`PUT`||n===`POST`||n===`PATCH`||n===`QUERY`||n===`PROPFIND`||n===`PROPPATCH`;if(i.isFormDataLike(h)){pe||=ie().extractBody;let[e,n]=pe(h);t.contentType??g.push(`content-type`,n),h=e.stream,_=e.length}else if(i.isBlobLike(h)&&t.contentType==null){let n=h.type;if(n){let r=`${n}`;if(!i.isValidHeaderValue(r))return i.errorRequest(e,t,new u(`invalid content-type header`)),!1;g.push(`content-type`,r)}}h&&typeof h.read==`function`&&h.read(0);let b=i.bodyLength(h);if(_=b??_,_===null&&(_=t.contentLength),_===0&&!v&&(_=null),Ae(n)&&_>0&&t.contentLength!==null&&t.contentLength!==_){if(e[ae])return i.errorRequest(e,t,new s),!1;process.emitWarning(new s)}let x=e[H];De(x);let S=n=>{t.aborted||t.completed||(i.errorRequest(e,t,n||new l),i.destroy(h),i.destroy(x,new m(`aborted`)))};try{t.onConnect(S)}catch(n){i.errorRequest(e,t,n)}if(t.aborted)return!1;n===`HEAD`&&(x[y]=!0),(d||n===`CONNECT`)&&(x[y]=!0),p!=null&&(x[y]=p),e[K]&&x[oe]++>=e[K]&&(x[y]=!0),f&&(x[E]=!0),x.setTypeOfService&&x.setTypeOfService(t.typeOfService);let C=`${n} ${o} HTTP/1.1\r\n`;if(C+=typeof c==`string`?`host: ${c}\r\n`:e[L],d?C+=`connection: upgrade\r\nupgrade: ${d}\r\n`:e[V]&&!x[y]?C+=`connection: keep-alive\r
|
|
6
6
|
`:C+=`connection: close\r
|
|
7
7
|
`,Array.isArray(g))for(let e=0;e<g.length;e+=2){let t=g[e+0],n=g[e+1];if(Array.isArray(n))for(let e=0;e<n.length;e++)C+=`${t}: ${n[e]}\r\n`;else C+=`${t}: ${n}\r\n`}return a.sendHeaders.hasSubscribers&&a.sendHeaders.publish({request:t,headers:C,socket:x}),!h||b===0?Ne(S,null,e,t,x,_,C,v):i.isBuffer(h)?Ne(S,h,e,t,x,_,C,v):i.isBlobLike(h)?typeof h.stream==`function`?Fe(S,h.stream(),e,t,x,_,C,v):Pe(S,h,e,t,x,_,C,v):i.isStream(h)?Me(S,h,e,t,x,_,C,v):i.isIterable(h)?Fe(S,h,e,t,x,_,C,v):r(!1),!0}function Me(e,t,n,a,o,s,c,u){r(s!==0||n[O]===0,`stream body cannot be pipelined`);let d=!1,f=new Ie({abort:e,socket:o,request:a,contentLength:s,client:n,expectsPayload:u,header:c}),p=function(e){if(!d)try{!f.write(e)&&this.pause&&this.pause()}catch(e){i.destroy(this,e)}},m=function(){d||t.resume&&t.resume()},h=function(){if(queueMicrotask(()=>{t.removeListener(`error`,g)}),!d){let e=new l;queueMicrotask(()=>g(e))}},g=function(e){if(!d){if(d=!0,r(o.destroyed||o[j]&&n[O]<=1),o.off(`drain`,m).off(`error`,g),t.removeListener(`data`,p).removeListener(`end`,g).removeListener(`close`,h),!e)try{f.end()}catch(t){e=t}f.destroy(e),e&&(e.code!==`UND_ERR_INFO`||e.message!==`reset`)?i.destroy(t,e):i.destroy(t)}};t.on(`data`,p).on(`end`,g).on(`error`,g).on(`close`,h),t.resume&&t.resume(),o.on(`drain`,m).on(`error`,g),t.errorEmitted??t.errored?setImmediate(g,t.errored):(t.endEmitted??t.readableEnded)&&setImmediate(g,null),(t.closeEmitted??t.closed)&&setImmediate(h)}function Ne(e,t,n,a,o,s,c,l){try{t?i.isBuffer(t)&&(r(s===t.byteLength,`buffer body must have content length`),o.cork(),o.write(`${c}content-length: ${s}\r\n\r\n`,`latin1`),o.write(t),o.uncork(),a.onBodySent(t),!l&&a.reset!==!1&&(o[y]=!0)):s===0?o.write(`${c}content-length: 0\r\n\r\n`,`latin1`):(r(s===null,`no body must not have content length`),o.write(`${c}\r\n`,`latin1`)),a.onRequestSent(),n[q]()}catch(t){e(t)}}async function Pe(e,t,n,i,a,o,c,l){r(o===t.size,`blob body must have content length`);try{if(o!=null&&o!==t.size)throw new s;let e=Buffer.from(await t.arrayBuffer());a.cork(),a.write(`${c}content-length: ${o}\r\n\r\n`,`latin1`),a.write(e),a.uncork(),i.onBodySent(e),i.onRequestSent(),!l&&i.reset!==!1&&(a[y]=!0),n[q]()}catch(t){e(t)}}async function Fe(e,t,n,i,a,o,s,c){r(o!==0||n[O]===0,`iterator body cannot be pipelined`);let l=null;function u(){if(l){let e=l;l=null,e()}}let d=()=>new Promise((e,t)=>{r(l===null),a[B]?t(a[B]):l=e});a.on(`close`,u).on(`drain`,u);let f=new Ie({abort:e,socket:a,request:i,contentLength:o,client:n,expectsPayload:c,header:s});try{for await(let e of t){if(a[B])throw a[B];f.write(e)||await d()}f.end()}catch(e){f.destroy(e)}finally{a.off(`close`,u).off(`drain`,u)}}var Ie=class{constructor({abort:e,socket:t,request:n,contentLength:r,client:i,expectsPayload:a,header:o}){this.socket=t,this.request=n,this.contentLength=r,this.client=i,this.bytesWritten=0,this.expectsPayload=a,this.header=o,this.abort=e,t[j]=!0}write(e){let{socket:t,request:n,contentLength:r,client:i,bytesWritten:a,expectsPayload:o,header:c}=this;if(t[B])throw t[B];if(t.destroyed)return!1;let l=Buffer.byteLength(e);if(!l)return!0;if(r!==null&&a+l>r){if(i[ae])throw new s;process.emitWarning(new s)}t.cork(),a===0&&(!o&&n.reset!==!1&&(t[y]=!0),r===null?t.write(`${c}transfer-encoding: chunked\r\n`,`latin1`):t.write(`${c}content-length: ${r}\r\n\r\n`,`latin1`)),r===null&&t.write(`\r\n${l.toString(16)}\r\n`,`latin1`),this.bytesWritten+=l;let u=t.write(e);return t.uncork(),n.onBodySent(e),u||t[w].timeout&&t[w].timeoutType===3&&t[w].timeout.refresh&&t[w].timeout.refresh(),u}end(){let{socket:e,contentLength:t,client:n,bytesWritten:r,expectsPayload:i,header:a,request:o}=this;if(o.onRequestSent(),e[j]=!1,e[B])throw e[B];if(!e.destroyed){if(r===0?i?e.write(`${a}content-length: 0\r\n\r\n`,`latin1`):e.write(`${a}\r\n`,`latin1`):t===null&&e.write(`\r
|
|
8
8
|
0\r
|
|
9
9
|
\r
|
|
10
|
-
`,`latin1`),t!==null&&r!==t){if(n[ae])throw new s;process.emitWarning(new s)}e[w].timeout&&e[w].timeoutType===3&&e[w].timeout.refresh&&e[w].timeout.refresh(),n[q]()}}destroy(e){let{socket:t,client:n,abort:i}=this;t[j]=!1,e&&(r(n[O]<=1,`pipeline should only contain this request`),i(e))}};n.exports=xe})),ae=t(((t,n)=>{let r=e(`node:assert`),{pipeline:i}=e(`node:stream`),a=T(),{RequestContentLengthMismatchError:o,RequestAbortedError:s,SocketError:c,InformationalError:l,InvalidArgumentError:u}=S(),{kUrl:d,kReset:f,kClient:p,kRunning:m,kPending:h,kQueue:g,kPendingIdx:_,kRunningIdx:v,kError:y,kSocket:x,kStrictContentLength:C,kOnError:w,kMaxConcurrentStreams:E,kPingInterval:O,kHTTP2Session:k,kHTTP2InitialWindowSize:A,kHTTP2ConnectionWindowSize:j,kResume:M,kSize:N,kHTTPContext:P,kClosed:F,kBodyTimeout:I,kEnableConnectProtocol:ee,kRemoteSettings:L,kHTTP2Stream:R,kHTTP2SessionState:z}=b(),{channels:B}=D(),V=Symbol(`open streams`),H,U;try{U=e(`node:http2`)}catch{U={constants:{}}}let{constants:{HTTP2_HEADER_AUTHORITY:W,HTTP2_HEADER_METHOD:te,HTTP2_HEADER_PATH:ne,HTTP2_HEADER_SCHEME:re,HTTP2_HEADER_CONTENT_LENGTH:G,HTTP2_HEADER_EXPECT:ae,HTTP2_HEADER_STATUS:K,HTTP2_HEADER_PROTOCOL:oe,NGHTTP2_REFUSED_STREAM:se,NGHTTP2_CANCEL:ce}}=U;function q(e){let t=[];for(let[n,r]of Object.entries(e))if(Array.isArray(r))for(let e of r)t.push(Buffer.from(n),Buffer.from(e));else t.push(Buffer.from(n),Buffer.from(r));return t}function J(e,t){e[x]=t;let n=e[A],r=e[j],i=U.connect(e[d],{createConnection:()=>t,peerMaxConcurrentStreams:e[E],settings:{enablePush:!1,...n==null?null:{initialWindowSize:n}}});return e[x]=t,i[V]=0,i[p]=e,i[x]=t,i[z]={ping:{interval:e[O]===0?null:setInterval(le,e[O],i).unref()}},i[ee]=!1,i[L]=!1,r&&a.addListener(i,`connect`,X.bind(i,r)),a.addListener(i,`error`,ue),a.addListener(i,`frameError`,de),a.addListener(i,`end`,Q),a.addListener(i,`goaway`,fe),a.addListener(i,`close`,pe),a.addListener(i,`remoteSettings`,Z),i.unref(),e[k]=i,t[k]=i,a.addListener(t,`error`,he),a.addListener(t,`end`,$),a.addListener(t,`close`,me),t[F]=!1,t.on(`close`,ge),{version:`h2`,defaultPipelining:1/0,write(t){return ve(e,t)},resume(){Y(e)},destroy(e,n){t[F]?queueMicrotask(n):t.destroy(e).on(`close`,n)},get destroyed(){return t.destroyed},busy(t){if(t!=null){if(e[m]>0){if(t.idempotent===!1||(t.upgrade===`websocket`||t.method===`CONNECT`)&&i[L]===!1||a.bodyLength(t.body)!==0&&(a.isStream(t.body)||a.isAsyncIterable(t.body)||a.isFormDataLike(t.body)))return!0}else return(t.upgrade===`websocket`||t.method===`CONNECT`)&&i[L]===!1}return!1}}}function Y(e){let t=e[x];t?.destroyed===!1&&(e[N]===0||e[E]===0?(t.unref(),e[k].unref()):(t.ref(),e[k].ref()))}function X(e){try{typeof this.setLocalWindowSize==`function`&&this.setLocalWindowSize(e)}catch{}}function Z(e){if(this[p][E]=e.maxConcurrentStreams??this[p][E],this[L]===!0&&this[ee]===!0&&e.enableConnectProtocol===!1){let e=new l(`HTTP/2: Server disabled extended CONNECT protocol against RFC-8441`);this[x][y]=e,this[p][w](e);return}this[ee]=e.enableConnectProtocol??this[ee],this[L]=!0,this[p][M]()}function le(e){let t=e[z];if((e.closed||e.destroyed)&&t.ping.interval!=null){clearInterval(t.ping.interval),t.ping.interval=null;return}e.ping(n.bind(e));function n(e,t){let n=this[p],r=this[p];if(e!=null){let t=new l(`HTTP/2: "PING" errored - type ${e.message}`);r[y]=t,n[w](t)}else n.emit(`ping`,t)}}function ue(e){r(e.code!==`ERR_TLS_CERT_ALTNAME_INVALID`),this[x][y]=e,this[p][w](e)}function de(e,t,n){if(n===0){let n=new l(`HTTP/2: "frameError" received - type ${e}, code ${t}`);this[x][y]=n,this[p][w](n)}}function Q(){let e=new c(`other side closed`,a.getSocketInfo(this[x]));this.destroy(e),a.destroy(this[x],e)}function fe(e){let t=this[y]||new c(`HTTP/2: "GOAWAY" frame received with code ${e}`,a.getSocketInfo(this[x])),n=this[p];if(n[x]=null,n[P]=null,this.close(),this[k]=null,a.destroy(this[x],t),n[v]<n[g].length){let e=n[g][n[v]];n[g][n[v]++]=null,a.errorRequest(n,e,t),n[_]=n[v]}r(n[m]===0),n.emit(`disconnect`,n[d],[n],t),n.emit(`connectionError`,n[d],[n],t),n[M]()}function pe(){let{[p]:e,[z]:t}=this,{[x]:n}=e,i=this[x][y]||this[y]||new c(`closed`,a.getSocketInfo(n));if(e[x]=null,e[P]=null,t.ping.interval!=null&&(clearInterval(t.ping.interval),t.ping.interval=null),e.destroyed){r(e[h]===0);let t=e[g].splice(e[v]);for(let n=0;n<t.length;n++){let r=t[n];a.errorRequest(e,r,i)}}}function me(){let e=this[y]||new c(`closed`,a.getSocketInfo(this)),t=this[k][p];t[x]=null,t[P]=null,this[k]!==null&&this[k].destroy(e),t[_]=t[v],r(t[m]===0),t.emit(`disconnect`,t[d],[t],e),t[M]()}function he(e){r(e.code!==`ERR_TLS_CERT_ALTNAME_INVALID`),this[y]=e,this[p][w](e)}function $(){a.destroy(this,new c(`other side closed`,a.getSocketInfo(this)))}function ge(){this[F]=!0}function _e(e){return e!==`GET`&&e!==`HEAD`&&e!==`OPTIONS`&&e!==`TRACE`&&e!==`CONNECT`}function ve(e,t){let n=t.bodyTimeout??e[I],i=e[k],{method:c,path:f,host:p,upgrade:m,expectContinue:h,signal:y,protocol:b,headers:S}=t,{body:T}=t;if(m!=null&&m!==`websocket`)return a.errorRequest(e,t,new u(`Custom upgrade "${m}" not supported over HTTP/2`)),!1;let E={};for(let e=0;e<S.length;e+=2){let t=S[e+0],n=S[e+1];if(t===`cookie`){E[t]=E[t]==null?n:Array.isArray(E[t])?(E[t].push(n),E[t]):[E[t],n];continue}if(Array.isArray(n))for(let e=0;e<n.length;e++)E[t]?E[t]+=`, ${n[e]}`:E[t]=n[e];else E[t]?E[t]+=`, ${n}`:E[t]=n}let D=null,{hostname:O,port:A}=e[d];E[W]=p||`${O}${A?`:${A}`:``}`,E[te]=c;let j=n=>{t.aborted||t.completed||(n||=new s,a.errorRequest(e,t,n),D!=null&&(D.removeAllListeners(`data`),D.close(),e[w](n),e[M]()),a.destroy(T,n))};try{t.onConnect(j)}catch(n){a.errorRequest(e,t,n)}if(t.aborted)return!1;if(m||c===`CONNECT`)return i.ref(),m===`websocket`?i[ee]===!1?(a.errorRequest(e,t,new l(`HTTP/2: Extended CONNECT protocol not supported by server`)),i.unref(),!1):(E[te]=`CONNECT`,E[oe]=`websocket`,E[ne]=f,b===`ws:`||b===`wss:`?E[re]=b===`ws:`?`http`:`https`:E[re]=b===`http:`?`http`:`https`,D=i.request(E,{endStream:!1,signal:y}),D[R]=!0,D.once(`response`,(n,r)=>{let{[K]:a,...o}=n;t.onUpgrade(a,q(o),D),++i[V],e[g][e[v]++]=null}),D.on(`error`,()=>{(D.rstCode===se||D.rstCode===ce)&&j(new l(`HTTP/2: "stream error" received - code ${D.rstCode}`))}),D.once(`close`,()=>{--i[V],i[V]===0&&i.unref()}),D.setTimeout(n),!0):(D=i.request(E,{endStream:!1,signal:y}),D[R]=!0,D.on(`response`,n=>{let{[K]:r,...a}=n;t.onUpgrade(r,q(a),D),++i[V],e[g][e[v]++]=null}),D.once(`close`,()=>{--i[V],i[V]===0&&i.unref()}),D.setTimeout(n),!0);E[ne]=f,E[re]=b===`http:`?`http`:`https`;let N=c===`PUT`||c===`POST`||c===`PATCH`;T&&typeof T.read==`function`&&T.read(0);let P=a.bodyLength(T);if(a.isFormDataLike(T)){H??=ie().extractBody;let[e,t]=H(T);E[`content-type`]=t,T=e.stream,P=e.length}if(P??=t.contentLength,N||(P=null),_e(c)&&P>0&&t.contentLength!=null&&t.contentLength!==P){if(e[C])return a.errorRequest(e,t,new o),!1;process.emitWarning(new o)}if(P!=null&&(r(T||P===0,`no body must not have content length`),E[G]=`${P}`),i.ref(),B.sendHeaders.hasSubscribers){let e=``;for(let t in E)e+=`${t}: ${E[t]}\r\n`;B.sendHeaders.publish({request:t,headers:e,socket:i[x]})}let F=c===`GET`||c===`HEAD`||T===null;h?(E[ae]=`100-continue`,D=i.request(E,{endStream:F,signal:y}),D[R]=!0,D.once(`continue`,z)):(D=i.request(E,{endStream:F,signal:y}),D[R]=!0,z()),++i[V],D.setTimeout(n);let L=!1;return D.once(`response`,e=>{let{[K]:n,...r}=e;if(t.onResponseStarted(),L=!0,t.aborted){D.removeAllListeners(`data`);return}t.onHeaders(Number(n),q(r),D.resume.bind(D),``)===!1&&D.pause(),D.on(`data`,e=>{t.aborted||t.completed||t.onData(e)===!1&&D.pause()})}),D.once(`end`,()=>{D.removeAllListeners(`data`),L?(!t.aborted&&!t.completed&&t.onComplete({}),e[g][e[v]++]=null,e[M]()):(j(new l(`HTTP/2: stream half-closed (remote)`)),e[g][e[v]++]=null,e[_]=e[v],e[M]())}),D.once(`close`,()=>{D.removeAllListeners(`data`),--i[V],i[V]===0&&i.unref()}),D.once(`error`,function(e){D.removeAllListeners(`data`),j(e)}),D.once(`frameError`,(e,t)=>{D.removeAllListeners(`data`),j(new l(`HTTP/2: "frameError" received - type ${e}, code ${t}`))}),D.on(`aborted`,()=>{D.removeAllListeners(`data`)}),D.on(`timeout`,()=>{let e=new l(`HTTP/2: "stream timeout after ${n}"`);D.removeAllListeners(`data`),--i[V],i[V]===0&&i.unref(),j(e)}),D.once(`trailers`,e=>{t.aborted||t.completed||(D.removeAllListeners(`data`),t.onComplete(e))}),!0;function z(){!T||P===0?ye(j,D,null,e,t,e[x],P,N):a.isBuffer(T)?ye(j,D,T,e,t,e[x],P,N):a.isBlobLike(T)?typeof T.stream==`function`?Se(j,D,T.stream(),e,t,e[x],P,N):xe(j,D,T,e,t,e[x],P,N):a.isStream(T)?be(j,e[x],N,D,T,e,t,P):a.isIterable(T)?Se(j,D,T,e,t,e[x],P,N):r(!1)}}function ye(e,t,n,i,o,s,c,l){try{n!=null&&a.isBuffer(n)&&(r(c===n.byteLength,`buffer body must have content length`),t.cork(),t.write(n),t.uncork(),t.end(),o.onBodySent(n)),l||(s[f]=!0),o.onRequestSent(),i[M]()}catch(t){e(t)}}function be(e,t,n,o,s,c,l,u){r(u!==0||c[m]===0,`stream body cannot be pipelined`);let d=i(s,o,r=>{r?(a.destroy(d,r),e(r)):(a.removeAllListeners(d),l.onRequestSent(),n||(t[f]=!0),c[M]())});a.addListener(d,`data`,p);function p(e){l.onBodySent(e)}}async function xe(e,t,n,i,a,s,c,l){r(c===n.size,`blob body must have content length`);try{if(c!=null&&c!==n.size)throw new o;let e=Buffer.from(await n.arrayBuffer());t.cork(),t.write(e),t.uncork(),t.end(),a.onBodySent(e),a.onRequestSent(),l||(s[f]=!0),i[M]()}catch(t){e(t)}}async function Se(e,t,n,i,a,o,s,c){r(s!==0||i[m]===0,`iterator body cannot be pipelined`);let l=null;function u(){if(l){let e=l;l=null,e()}}let d=()=>new Promise((e,t)=>{r(l===null),o[y]?t(o[y]):l=e});t.on(`close`,u).on(`drain`,u);try{for await(let e of n){if(o[y])throw o[y];let n=t.write(e);a.onBodySent(e),n||await d()}t.end(),a.onRequestSent(),c||(o[f]=!0),i[M]()}catch(t){e(t)}finally{t.off(`close`,u).off(`drain`,u)}}n.exports=J})),K=t(((t,n)=>{let r=e(`node:assert`),i=e(`node:net`),a=e(`node:http`),o=T(),{ClientStats:s}=E(),{channels:c}=D(),l=O(),u=M(),{InvalidArgumentError:d,InformationalError:f,ClientDestroyedError:p}=S(),m=N(),{kUrl:h,kServerName:g,kClient:_,kBusy:v,kConnect:y,kResuming:x,kRunning:C,kPending:w,kSize:k,kQueue:A,kConnected:j,kConnecting:P,kNeedDrain:F,kKeepAliveDefaultTimeout:I,kHostHeader:ee,kPendingIdx:L,kRunningIdx:R,kError:z,kPipelining:B,kKeepAliveTimeoutValue:V,kMaxHeadersSize:H,kKeepAliveMaxTimeout:U,kKeepAliveTimeoutThreshold:W,kHeadersTimeout:te,kBodyTimeout:ne,kStrictContentLength:re,kConnector:ie,kMaxRequests:K,kCounter:oe,kClose:se,kDestroy:ce,kDispatch:q,kLocalAddress:J,kMaxResponseSize:Y,kOnError:X,kHTTPContext:Z,kMaxConcurrentStreams:le,kHTTP2InitialWindowSize:ue,kHTTP2ConnectionWindowSize:de,kResume:Q,kPingInterval:fe}=b(),pe=G(),me=ae(),he=Symbol(`kClosedResolve`),$=a&&a.maxHeaderSize&&Number.isInteger(a.maxHeaderSize)&&a.maxHeaderSize>0?()=>a.maxHeaderSize:()=>{throw new d(`http module not available or http.maxHeaderSize invalid`)},ge=()=>{};function _e(e){return e[B]??e[Z]?.defaultPipelining??1}var ve=class extends u{constructor(e,{maxHeaderSize:t,headersTimeout:n,socketTimeout:r,requestTimeout:a,connectTimeout:s,bodyTimeout:c,idleTimeout:l,keepAlive:u,keepAliveTimeout:f,maxKeepAliveTimeout:p,keepAliveMaxTimeout:_,keepAliveTimeoutThreshold:v,socketPath:y,pipelining:b,tls:S,strictContentLength:C,maxCachedSessions:w,connect:T,maxRequestsPerClient:E,localAddress:D,maxResponseSize:O,autoSelectFamily:k,autoSelectFamilyAttemptTimeout:j,maxConcurrentStreams:M,allowH2:N,useH2c:P,initialWindowSize:z,connectionWindowSize:G,pingInterval:ae,webSocket:oe}={}){if(u!==void 0)throw new d(`unsupported keepAlive, use pipelining=0 instead`);if(r!==void 0)throw new d(`unsupported socketTimeout, use headersTimeout & bodyTimeout instead`);if(a!==void 0)throw new d(`unsupported requestTimeout, use headersTimeout & bodyTimeout instead`);if(l!==void 0)throw new d(`unsupported idleTimeout, use keepAliveTimeout instead`);if(p!==void 0)throw new d(`unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead`);if(t!=null){if(!Number.isInteger(t)||t<1)throw new d(`invalid maxHeaderSize`)}else t=$();if(y!=null&&typeof y!=`string`)throw new d(`invalid socketPath`);if(s!=null&&(!Number.isFinite(s)||s<0))throw new d(`invalid connectTimeout`);if(f!=null&&(!Number.isFinite(f)||f<=0))throw new d(`invalid keepAliveTimeout`);if(_!=null&&(!Number.isFinite(_)||_<=0))throw new d(`invalid keepAliveMaxTimeout`);if(v!=null&&!Number.isFinite(v))throw new d(`invalid keepAliveTimeoutThreshold`);if(n!=null&&(!Number.isInteger(n)||n<0))throw new d(`headersTimeout must be a positive integer or zero`);if(c!=null&&(!Number.isInteger(c)||c<0))throw new d(`bodyTimeout must be a positive integer or zero`);if(T!=null&&typeof T!=`function`&&typeof T!=`object`)throw new d(`connect must be a function or an object`);if(E!=null&&(!Number.isInteger(E)||E<0))throw new d(`maxRequestsPerClient must be a positive number`);if(D!=null&&(typeof D!=`string`||i.isIP(D)===0))throw new d(`localAddress must be valid string IP address`);if(O!=null&&(!Number.isInteger(O)||O<-1))throw new d(`maxResponseSize must be a positive number`);if(j!=null&&(!Number.isInteger(j)||j<-1))throw new d(`autoSelectFamilyAttemptTimeout must be a positive number`);if(N!=null&&typeof N!=`boolean`)throw new d(`allowH2 must be a valid boolean value`);if(M!=null&&(typeof M!=`number`||M<1))throw new d(`maxConcurrentStreams must be a positive integer, greater than 0`);if(P!=null&&typeof P!=`boolean`)throw new d(`useH2c must be a valid boolean value`);if(z!=null&&(!Number.isInteger(z)||z<1))throw new d(`initialWindowSize must be a positive integer, greater than 0`);if(G!=null&&(!Number.isInteger(G)||G<1))throw new d(`connectionWindowSize must be a positive integer, greater than 0`);if(ae!=null&&(typeof ae!=`number`||!Number.isInteger(ae)||ae<0))throw new d(`pingInterval must be a positive integer, greater or equal to 0`);if(super({webSocket:oe}),typeof T!=`function`)T=m({...S,maxCachedSessions:w,allowH2:N,useH2c:P,socketPath:y,timeout:s,...typeof k==`boolean`?{autoSelectFamily:k,autoSelectFamilyAttemptTimeout:j}:void 0,...T});else{let e=T;T=(t,n)=>e({...t,...y==null?null:{socketPath:y},...N==null?null:{allowH2:N}},n)}this[h]=o.parseOrigin(e),this[ie]=T,this[B]=b??1,this[H]=t,this[I]=f??4e3,this[U]=_??6e5,this[W]=v??2e3,this[V]=this[I],this[g]=null,this[J]=D??null,this[x]=0,this[F]=0,this[ee]=`host: ${this[h].hostname}${this[h].port?`:${this[h].port}`:``}\r\n`,this[ne]=c??3e5,this[te]=n??3e5,this[re]=C??!0,this[K]=E,this[he]=null,this[Y]=O>-1?O:-1,this[Z]=null,this[le]=M??100,this[ue]=z??262144,this[de]=G??524288,this[fe]=ae??6e4,this[A]=[],this[R]=0,this[L]=0,this[Q]=e=>Ce(this,e),this[X]=e=>ye(this,e)}get pipelining(){return this[B]}set pipelining(e){this[B]=e,this[Q](!0)}get stats(){return new s(this)}get[w](){return this[A].length-this[L]}get[C](){return this[L]-this[R]}get[k](){return this[A].length-this[R]}get[j](){return!!this[Z]&&!this[P]&&!this[Z].destroyed}get[v](){return!!(this[Z]?.busy(null)||this[k]>=(_e(this)||1)||this[w]>0)}[y](e){be(this),this.once(`connect`,e)}[q](e,t){let n=new l(this[h].origin,e,t);return this[A].push(n),this[x]||(o.bodyLength(n.body)==null&&o.isIterable(n.body)?(this[x]=1,queueMicrotask(()=>Ce(this))):this[Q](!0)),this[x]&&this[F]!==2&&this[v]&&(this[F]=2),this[F]<2}[se](){return new Promise(e=>{this[k]?this[he]=e:e(null)})}[ce](e){return new Promise(t=>{let n=this[A].splice(this[L]);for(let t=0;t<n.length;t++){let r=n[t];o.errorRequest(this,r,e)}let r=()=>{this[he]&&(this[he](),this[he]=null),t(null)};this[Z]?(this[Z].destroy(e,r),this[Z]=null):queueMicrotask(r),this[Q]()})}};function ye(e,t){if(e[C]===0&&t.code!==`UND_ERR_INFO`&&t.code!==`UND_ERR_SOCKET`){r(e[L]===e[R]);let n=e[A].splice(e[R]);for(let r=0;r<n.length;r++){let i=n[r];o.errorRequest(e,i,t)}r(e[k]===0)}}function be(e){r(!e[P]),r(!e[Z]);let{host:t,hostname:n,protocol:a,port:s}=e[h];if(n[0]===`[`){let e=n.indexOf(`]`);r(e!==-1);let t=n.substring(1,e);r(i.isIPv6(t)),n=t}e[P]=!0,c.beforeConnect.hasSubscribers&&c.beforeConnect.publish({connectParams:{host:t,hostname:n,protocol:a,port:s,version:e[Z]?.version,servername:e[g],localAddress:e[J]},connector:e[ie]});try{e[ie]({host:t,hostname:n,protocol:a,port:s,servername:e[g],localAddress:e[J]},(i,l)=>{if(i){xe(e,i,{host:t,hostname:n,protocol:a,port:s}),e[Q]();return}if(e.destroyed){o.destroy(l.on(`error`,ge),new p),e[Q]();return}r(l);try{e[Z]=l.alpnProtocol===`h2`?me(e,l):pe(e,l)}catch(r){l.destroy().on(`error`,ge),xe(e,r,{host:t,hostname:n,protocol:a,port:s}),e[Q]();return}e[P]=!1,l[oe]=0,l[K]=e[K],l[_]=e,l[z]=null,c.connected.hasSubscribers&&c.connected.publish({connectParams:{host:t,hostname:n,protocol:a,port:s,version:e[Z]?.version,servername:e[g],localAddress:e[J]},connector:e[ie],socket:l}),e.emit(`connect`,e[h],[e]),e[Q]()})}catch(r){xe(e,r,{host:t,hostname:n,protocol:a,port:s}),e[Q]()}}function xe(e,t,{host:n,hostname:i,protocol:a,port:s}){if(!e.destroyed){if(e[P]=!1,c.connectError.hasSubscribers&&c.connectError.publish({connectParams:{host:n,hostname:i,protocol:a,port:s,version:e[Z]?.version,servername:e[g],localAddress:e[J]},connector:e[ie],error:t}),t.code===`ERR_TLS_CERT_ALTNAME_INVALID`)for(r(e[C]===0);e[w]>0&&e[A][e[L]].servername===e[g];){let n=e[A][e[L]++];o.errorRequest(e,n,t)}else ye(e,t);e.emit(`connectionError`,e[h],[e],t)}}function Se(e){e[F]=0,e.emit(`drain`,e[h],[e])}function Ce(e,t){e[x]!==2&&(e[x]=2,we(e,t),e[x]=0,e[R]>256&&(e[A].splice(0,e[R]),e[L]-=e[R],e[R]=0))}function we(e,t){for(;;){if(e.destroyed){r(e[w]===0);return}if(e[he]&&!e[k]){e[he](),e[he]=null;return}if(e[Z]&&e[Z].resume(),e[v])e[F]=2;else if(e[F]===2){t?(e[F]=1,queueMicrotask(()=>Se(e))):Se(e);continue}if(e[w]===0||e[C]>=(_e(e)||1))return;let n=e[A][e[L]];if(n===null)return;if(e[h].protocol===`https:`&&e[g]!==n.servername){if(e[C]>0)return;e[g]=n.servername,e[Z]?.destroy(new f(`servername changed`),()=>{e[Z]=null,Ce(e)})}if(e[P])return;if(!e[Z]){be(e);return}if(e[Z].destroyed||e[Z].busy(n))return;!n.aborted&&e[Z].write(n)?e[L]++:e[A].splice(e[L],1)}}n.exports=ve})),oe=t(((e,t)=>{let n=2047;var r=class{bottom=0;top=0;list=Array(2048).fill(void 0);next=null;isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&n)===this.bottom}push(e){this.list[this.top]=e,this.top=this.top+1&n}shift(){let e=this.list[this.bottom];return e===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&n,e)}};t.exports=class{constructor(){this.head=this.tail=new r}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new r),this.head.push(e)}shift(){let e=this.tail,t=e.shift();return e.isEmpty()&&e.next!==null&&(this.tail=e.next,e.next=null),t}}})),se=t(((e,t)=>{let{PoolStats:n}=E(),r=M(),i=oe(),{kConnected:a,kSize:o,kRunning:s,kPending:c,kQueued:l,kBusy:u,kFree:d,kUrl:f,kClose:p,kDestroy:m,kDispatch:h}=b(),g=Symbol(`clients`),_=Symbol(`needDrain`),v=Symbol(`queue`),y=Symbol(`closed resolve`),x=Symbol(`onDrain`),S=Symbol(`onConnect`),C=Symbol(`onDisconnect`),w=Symbol(`onConnectionError`),T=Symbol(`get dispatcher`),D=Symbol(`add client`),O=Symbol(`remove client`);t.exports={PoolBase:class extends r{[v]=new i;[l]=0;[g]=[];[_]=!1;[x](e,t,n){let r=this[v],i=!1;for(;!i;){let t=r.shift();if(!t)break;this[l]--,i=!e.dispatch(t.opts,t.handler)}if(e[_]=i,!i&&this[_]&&(this[_]=!1,this.emit(`drain`,t,[this,...n])),this[y]&&r.isEmpty()){let e=[];for(let t=0;t<this[g].length;t++){let n=this[g][t];n.destroyed||e.push(n.close())}return Promise.all(e).then(this[y])}}[S]=(e,t)=>{this.emit(`connect`,e,[this,...t])};[C]=(e,t,n)=>{this.emit(`disconnect`,e,[this,...t],n)};[w]=(e,t,n)=>{this.emit(`connectionError`,e,[this,...t],n)};get[u](){return this[_]}get[a](){let e=0;for(let{[a]:t}of this[g])e+=t;return e}get[d](){let e=0;for(let{[a]:t,[_]:n}of this[g])e+=t&&!n;return e}get[c](){let e=this[l];for(let{[c]:t}of this[g])e+=t;return e}get[s](){let e=0;for(let{[s]:t}of this[g])e+=t;return e}get[o](){let e=this[l];for(let{[o]:t}of this[g])e+=t;return e}get stats(){return new n(this)}[p](){if(this[v].isEmpty()){let e=[];for(let t=0;t<this[g].length;t++){let n=this[g][t];n.destroyed||e.push(n.close())}return Promise.all(e)}return new Promise(e=>{this[y]=e})}[m](e){for(;;){let t=this[v].shift();if(!t)break;t.handler.onError(e)}let t=Array(this[g].length);for(let n=0;n<this[g].length;n++)t[n]=this[g][n].destroy(e);return Promise.all(t)}[h](e,t){let n=this[T]();return n?n.dispatch(e,t)||(n[_]=!0,this[_]=!this[T]()):(this[_]=!0,this[v].push({opts:e,handler:t}),this[l]++),!this[_]}[D](e){return e.on(`drain`,this[x].bind(this,e)).on(`connect`,this[S]).on(`disconnect`,this[C]).on(`connectionError`,this[w]),this[g].push(e),this[_]&&queueMicrotask(()=>{this[_]&&this[x](e,e[f],[e,this])}),this}[O](e){e.close(()=>{let t=this[g].indexOf(e);t!==-1&&this[g].splice(t,1)}),this[_]=this[g].some(e=>!e[_]&&e.closed!==!0&&e.destroyed!==!0)}},kClients:g,kNeedDrain:_,kAddClient:D,kRemoveClient:O,kGetDispatcher:T}})),ce=t(((e,t)=>{let{PoolBase:n,kClients:r,kNeedDrain:i,kAddClient:a,kGetDispatcher:o,kRemoveClient:s}=se(),c=K(),{InvalidArgumentError:l}=S(),u=T(),{kUrl:d}=b(),f=N(),p=Symbol(`options`),m=Symbol(`connections`),h=Symbol(`factory`);function g(e,t){return new c(e,t)}t.exports=class extends n{constructor(e,{connections:t,factory:n=g,connect:i,connectTimeout:a,tls:o,maxCachedSessions:s,socketPath:c,autoSelectFamily:_,autoSelectFamilyAttemptTimeout:v,allowH2:y,clientTtl:b,...x}={}){if(t!=null&&(!Number.isFinite(t)||t<0))throw new l(`invalid connections`);if(typeof n!=`function`)throw new l(`factory must be a function.`);if(i!=null&&typeof i!=`function`&&typeof i!=`object`)throw new l(`connect must be a function or an object`);typeof i!=`function`&&(i=f({...o,maxCachedSessions:s,allowH2:y,socketPath:c,timeout:a,...typeof _==`boolean`?{autoSelectFamily:_,autoSelectFamilyAttemptTimeout:v}:void 0,...i})),super(x),this[m]=t||null,this[d]=u.parseOrigin(e),this[p]={...u.deepClone(x),connect:i,allowH2:y,clientTtl:b,socketPath:c},this[p].interceptors=x.interceptors?{...x.interceptors}:void 0,this[h]=n,this.on(`connect`,(e,t)=>{if(b!=null&&b>0)for(let e of t)Object.assign(e,{ttl:Date.now()})}),this.on(`connectionError`,(e,t,n)=>{for(let e of t){let t=this[r].indexOf(e);t!==-1&&this[r].splice(t,1)}})}[o](){let e=this[p].clientTtl;for(let t of this[r])if(e!=null&&e>0&&t.ttl&&Date.now()-t.ttl>e)this[s](t);else if(!t[i])return t;if(!this[m]||this[r].length<this[m]){let e=this[h](this[d],this[p]);return this[a](e),e}}}})),q=t(((e,t)=>{let{BalancedPoolMissingUpstreamError:n,InvalidArgumentError:r}=S(),{PoolBase:i,kClients:a,kNeedDrain:o,kAddClient:s,kRemoveClient:c,kGetDispatcher:l}=se(),u=ce(),{kUrl:d}=b(),f=T(),p=Symbol(`factory`),m=Symbol(`options`),h=Symbol(`kGreatestCommonDivisor`),g=Symbol(`kCurrentWeight`),_=Symbol(`kIndex`),v=Symbol(`kWeight`),y=Symbol(`kMaxWeightPerServer`),x=Symbol(`kErrorPenalty`);function C(e,t){if(e===0)return t;for(;t!==0;){let n=t;t=e%t,e=n}return e}function w(e,t){return new u(e,t)}t.exports=class extends i{constructor(e=[],{factory:t=w,...n}={}){if(typeof t!=`function`)throw new r(`factory must be a function.`);super(n),this[m]={...f.deepClone(n)},this[m].interceptors=n.interceptors?{...n.interceptors}:void 0,this[_]=-1,this[g]=0,this[y]=this[m].maxWeightPerServer||100,this[x]=this[m].errorPenalty||15,Array.isArray(e)||(e=[e]),this[p]=t;for(let t of e)this.addUpstream(t);this._updateBalancedPoolStats()}addUpstream(e){let t=f.parseOrigin(e).origin;if(this[a].find(e=>e[d].origin===t&&e.closed!==!0&&e.destroyed!==!0))return this;let n=this[p](t,this[m]);this[s](n),n.on(`connect`,()=>{n[v]=Math.min(this[y],n[v]+this[x])}),n.on(`connectionError`,()=>{n[v]=Math.max(1,n[v]-this[x]),this._updateBalancedPoolStats()}),n.on(`disconnect`,(...e)=>{let t=e[2];t&&t.code===`UND_ERR_SOCKET`&&(n[v]=Math.max(1,n[v]-this[x]),this._updateBalancedPoolStats())});for(let e of this[a])e[v]=this[y];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let t=0;t<this[a].length;t++)e=C(this[a][t][v],e);this[h]=e}removeUpstream(e){let t=f.parseOrigin(e).origin,n=this[a].find(e=>e[d].origin===t&&e.closed!==!0&&e.destroyed!==!0);return n&&this[c](n),this}getUpstream(e){let t=f.parseOrigin(e).origin;return this[a].find(e=>e[d].origin===t&&e.closed!==!0&&e.destroyed!==!0)}get upstreams(){return this[a].filter(e=>e.closed!==!0&&e.destroyed!==!0).map(e=>e[d].origin)}[l](){if(this[a].length===0)throw new n;if(!this[a].find(e=>!e[o]&&e.closed!==!0&&e.destroyed!==!0)||this[a].map(e=>e[o]).reduce((e,t)=>e&&t,!0))return;let e=0,t=this[a].findIndex(e=>!e[o]);for(;e++<this[a].length;){this[_]=(this[_]+1)%this[a].length;let e=this[a][this[_]];if(e[v]>this[a][t][v]&&!e[o]&&(t=this[_]),this[_]===0&&(this[g]=this[g]-this[h],this[g]<=0&&(this[g]=this[y])),e[v]>=this[g]&&!e[o])return e}return this[g]=this[a][t][v],this[_]=t,this[a][t]}}})),J=t(((e,t)=>{let{PoolBase:n,kClients:r,kNeedDrain:i,kAddClient:a,kGetDispatcher:o,kRemoveClient:s}=se(),c=K(),{InvalidArgumentError:l}=S(),u=T(),{kUrl:d}=b(),f=N(),p=Symbol(`options`),m=Symbol(`connections`),h=Symbol(`factory`),g=Symbol(`index`);function _(e,t){return new c(e,t)}t.exports=class extends n{constructor(e,{connections:t,factory:n=_,connect:i,connectTimeout:a,tls:o,maxCachedSessions:s,socketPath:c,autoSelectFamily:v,autoSelectFamilyAttemptTimeout:y,allowH2:b,clientTtl:x,...S}={}){if(t!=null&&(!Number.isFinite(t)||t<0))throw new l(`invalid connections`);if(typeof n!=`function`)throw new l(`factory must be a function.`);if(i!=null&&typeof i!=`function`&&typeof i!=`object`)throw new l(`connect must be a function or an object`);typeof i!=`function`&&(i=f({...o,maxCachedSessions:s,allowH2:b,socketPath:c,timeout:a,...typeof v==`boolean`?{autoSelectFamily:v,autoSelectFamilyAttemptTimeout:y}:void 0,...i})),super(),this[m]=t||null,this[d]=u.parseOrigin(e),this[p]={...u.deepClone(S),connect:i,allowH2:b,clientTtl:x,socketPath:c},this[p].interceptors=S.interceptors?{...S.interceptors}:void 0,this[h]=n,this[g]=-1,this.on(`connect`,(e,t)=>{if(x!=null&&x>0)for(let e of t)Object.assign(e,{ttl:Date.now()})}),this.on(`connectionError`,(e,t,n)=>{for(let e of t){let t=this[r].indexOf(e);t!==-1&&this[r].splice(t,1)}})}[o](){let e=this[p].clientTtl,t=this[r].length;if(t===0){let e=this[h](this[d],this[p]);return this[a](e),e}let n=0;for(;n<t;){this[g]=(this[g]+1)%t;let a=this[r][this[g]];if(e!=null&&e>0&&a.ttl&&Date.now()-a.ttl>e){this[s](a),n++;continue}if(!a[i])return a;n++}if(!this[m]||t<this[m]){let e=this[h](this[d],this[p]);return this[a](e),e}}}})),Y=t(((e,t)=>{let{InvalidArgumentError:n,MaxOriginsReachedError:r}=S(),{kClients:i,kRunning:a,kClose:o,kDestroy:s,kDispatch:c,kUrl:l}=b(),u=M(),d=ce(),f=K(),p=T(),m=Symbol(`onConnect`),h=Symbol(`onDisconnect`),g=Symbol(`onConnectionError`),_=Symbol(`onDrain`),v=Symbol(`factory`),y=Symbol(`options`),x=Symbol(`origins`);function C(e,t){return t&&t.connections===1?new f(e,t):new d(e,t)}t.exports=class extends u{constructor({factory:e=C,maxOrigins:t=1/0,connect:r,...a}={}){if(typeof e!=`function`)throw new n(`factory must be a function.`);if(r!=null&&typeof r!=`function`&&typeof r!=`object`)throw new n(`connect must be a function or an object`);if(typeof t!=`number`||Number.isNaN(t)||t<=0)throw new n(`maxOrigins must be a number greater than 0`);super(a),r&&typeof r!=`function`&&(r={...r}),this[y]={...p.deepClone(a),maxOrigins:t,connect:r},this[v]=e,this[i]=new Map,this[x]=new Set,this[_]=(e,t)=>{this.emit(`drain`,e,[this,...t])},this[m]=(e,t)=>{this.emit(`connect`,e,[this,...t])},this[h]=(e,t,n)=>{this.emit(`disconnect`,e,[this,...t],n)},this[g]=(e,t,n)=>{this.emit(`connectionError`,e,[this,...t],n)}}get[a](){let e=0;for(let{dispatcher:t}of this[i].values())e+=t[a];return e}[c](e,t){let a;if(e.origin&&(typeof e.origin==`string`||e.origin instanceof URL))a=String(e.origin);else throw new n(`opts.origin must be a non-empty string or URL.`);if(this[x].size>=this[y].maxOrigins&&!this[x].has(a))throw new r;let o=this[i].get(a),s=o&&o.dispatcher;if(!s){let t=e=>{let t=this[i].get(a);t&&(e&&--t.count,t.count<=0&&(this[i].delete(a),t.dispatcher.destroyed||t.dispatcher.close()),this[x].delete(a))};s=this[v](e.origin,this[y]).on(`drain`,this[_]).on(`connect`,(e,t)=>{let n=this[i].get(a);n&&(n.count+=1),this[m](e,t)}).on(`disconnect`,(e,n,r)=>{t(!0),this[h](e,n,r)}).on(`connectionError`,(e,n,r)=>{t(!1),this[g](e,n,r)}),this[i].set(a,{count:0,dispatcher:s}),this[x].add(a)}return s.dispatch(e,t)}[o](){let e=[];for(let{dispatcher:t}of this[i].values())e.push(t.close());return this[i].clear(),Promise.all(e)}[s](e){let t=[];for(let{dispatcher:n}of this[i].values())t.push(n.destroy(e));return this[i].clear(),Promise.all(t)}get stats(){let e={};for(let{dispatcher:t}of this[i].values())t.stats&&(e[t[l].origin]=t.stats);return e}}})),X=t(((t,n)=>{let{Buffer:r}=e(`node:buffer`),i=e(`node:net`),{InvalidArgumentError:a}=S();function o(e){if(i.isIPv4(e)){let t=e.split(`.`).map(Number);return{type:1,buffer:r.from(t)}}if(i.isIPv6(e))return{type:4,buffer:s(e)};let t=r.from(e,`utf8`);if(t.length>255)throw new a(`Domain name too long (max 255 bytes)`);return{type:3,buffer:r.concat([r.from([t.length]),t])}}function s(e){let t=r.alloc(16),n=e;if(e.includes(`.`)){let t=e.lastIndexOf(`:`),r=e.slice(t+1);if(i.isIPv4(r)){let i=r.split(`.`).map(Number),a=(i[0]<<8|i[1]).toString(16),o=(i[2]<<8|i[3]).toString(16);n=`${e.slice(0,t)}:${a}:${o}`}}let a=n.indexOf(`::`);if(a!==-1){let e=n.slice(0,a),r=n.slice(a+2),i=e===``?[]:e.split(`:`),o=r===``?[]:r.split(`:`),s=0;for(let e of i)t.writeUInt16BE(parseInt(e,16),s),s+=2;s=16-o.length*2;for(let e of o)t.writeUInt16BE(parseInt(e,16),s),s+=2}else{let e=n.split(`:`);for(let n=0;n<e.length;n++)t.writeUInt16BE(parseInt(e[n],16),n*2)}return t}function c(e,t,n){let i=r.allocUnsafe(2);return i.writeUInt16BE(n,0),r.concat([r.from([e]),t,i])}function l(e,t=0){if(e.length<t+1)throw new a(`Buffer too small to contain address type`);let n=e[t],r,i=t+1;switch(n){case 1:if(e.length<i+6)throw new a(`Buffer too small for IPv4 address`);r=Array.from(e.subarray(i,i+4)).join(`.`),i+=4;break;case 3:{if(e.length<i+1)throw new a(`Buffer too small for domain length`);let t=e[i];if(i+=1,e.length<i+t+2)throw new a(`Buffer too small for domain address`);r=e.subarray(i,i+t).toString(`utf8`),i+=t;break}case 4:{if(e.length<i+18)throw new a(`Buffer too small for IPv6 address`);let t=[];for(let n=0;n<8;n++){let r=e.readUInt16BE(i+n*2);t.push(r.toString(16))}r=t.join(`:`),i+=16;break}default:throw new a(`Invalid address type: ${n}`)}if(e.length<i+2)throw new a(`Buffer too small for port`);let o=e.readUInt16BE(i);return i+=2,{address:r,port:o,bytesRead:i-t}}function u(e){let t={1:`General SOCKS server failure`,2:`Connection not allowed by ruleset`,3:`Network unreachable`,4:`Host unreachable`,5:`Connection refused`,6:`TTL expired`,7:`Command not supported`,8:`Address type not supported`}[e]||`Unknown SOCKS5 error code: ${e}`,n=Error(t);return n.code=`SOCKS5_${e}`,n}n.exports={parseAddress:o,parseIPv6:s,buildAddressBuffer:c,parseResponseAddress:l,createReplyError:u}})),Z=t(((t,n)=>{let{EventEmitter:r}=e(`node:events`),{Buffer:i}=e(`node:buffer`),{InvalidArgumentError:a,Socks5ProxyError:o}=S(),{debuglog:s}=e(`node:util`),{parseAddress:c}=X(),l=s(`undici:socks5`),u=i.alloc(0),d={NO_AUTH:0,GSSAPI:1,USERNAME_PASSWORD:2,NO_ACCEPTABLE:255},f={CONNECT:1,BIND:2,UDP_ASSOCIATE:3},p={IPV4:1,DOMAIN:3,IPV6:4},m={SUCCEEDED:0,GENERAL_FAILURE:1,CONNECTION_NOT_ALLOWED:2,NETWORK_UNREACHABLE:3,HOST_UNREACHABLE:4,CONNECTION_REFUSED:5,TTL_EXPIRED:6,COMMAND_NOT_SUPPORTED:7,ADDRESS_TYPE_NOT_SUPPORTED:8},h={INITIAL:`initial`,HANDSHAKING:`handshaking`,AUTHENTICATING:`authenticating`,AUTHENTICATED:`authenticated`,CONNECTING:`connecting`,CONNECTED:`connected`,ERROR:`error`,CLOSED:`closed`};n.exports={Socks5Client:class extends r{constructor(e,t={}){if(super(),!e)throw new a(`socket is required`);this.socket=e,this.options=t,this.state=h.INITIAL,this.buffer=u,this.onSocketData=this.onData.bind(this),this.onSocketError=this.onError.bind(this),this.onSocketClose=this.onClose.bind(this),this.authMethods=[],t.username&&t.password&&this.authMethods.push(d.USERNAME_PASSWORD),this.authMethods.push(d.NO_AUTH),this.socket.on(`data`,this.onSocketData),this.socket.on(`error`,this.onSocketError),this.socket.on(`close`,this.onSocketClose)}onData(e){l(`received data`,e.length,`bytes in state`,this.state),this.buffer=i.concat([this.buffer,e]);try{switch(this.state){case h.HANDSHAKING:this.handleHandshakeResponse();break;case h.AUTHENTICATING:this.handleAuthResponse();break;case h.CONNECTING:this.handleConnectResponse()}}catch(e){this.onError(e)}}onError(e){l(`socket error`,e),this.state=h.ERROR,this.emit(`error`,e),this.destroy()}onClose(){l(`socket closed`),this.state=h.CLOSED,this.emit(`close`)}destroy(){this.socket&&!this.socket.destroyed&&this.socket.destroy()}markAuthenticated(){this.state=h.AUTHENTICATED,this.emit(`authenticated`)}handshake(){if(this.state!==h.INITIAL)throw new a(`Handshake already started`);l(`starting handshake with`,this.authMethods.length,`auth methods`),this.state=h.HANDSHAKING;let e=i.alloc(2+this.authMethods.length);e[0]=5,e[1]=this.authMethods.length,this.authMethods.forEach((t,n)=>{e[2+n]=t}),this.socket.write(e)}handleHandshakeResponse(){if(this.buffer.length<2)return;let e=this.buffer[0],t=this.buffer[1];if(e!==5)throw new o(`Invalid SOCKS version: ${e}`,`UND_ERR_SOCKS5_VERSION`);if(t===d.NO_ACCEPTABLE)throw new o(`No acceptable authentication method`,`UND_ERR_SOCKS5_AUTH_REJECTED`);if(this.buffer=this.buffer.subarray(2),l(`server selected auth method`,t),t===d.NO_AUTH)this.markAuthenticated();else if(t===d.USERNAME_PASSWORD)this.state=h.AUTHENTICATING,this.sendAuthRequest();else throw new o(`Unsupported authentication method: ${t}`,`UND_ERR_SOCKS5_AUTH_METHOD`)}sendAuthRequest(){let{username:e,password:t}=this.options;if(!e||!t)throw new a(`Username and password required for authentication`);l(`sending username/password auth`);let n=i.from(e),r=i.from(t);if(n.length>255||r.length>255)throw new a(`Username or password too long`);let o=i.alloc(3+n.length+r.length);o[0]=1,o[1]=n.length,n.copy(o,2),o[2+n.length]=r.length,r.copy(o,3+n.length),this.socket.write(o)}handleAuthResponse(){if(this.buffer.length<2)return;let e=this.buffer[0],t=this.buffer[1];if(e!==1)throw new o(`Invalid auth sub-negotiation version: ${e}`,`UND_ERR_SOCKS5_AUTH_VERSION`);if(t!==0)throw new o(`Authentication failed`,`UND_ERR_SOCKS5_AUTH_FAILED`);this.buffer=this.buffer.subarray(2),l(`authentication successful`),this.markAuthenticated()}connect(e,t){if(this.state===h.CONNECTING||this.state===h.CONNECTED)throw new a(`Connection already in progress`);if(this.state!==h.AUTHENTICATED)throw new a(`Client must be authenticated before CONNECT`);l(`connecting to`,e,t),this.state=h.CONNECTING;let n=this.buildConnectRequest(f.CONNECT,e,t);this.socket.write(n)}buildConnectRequest(e,t,n){let{type:r,buffer:a}=c(t),o=i.alloc(4+a.length+2);return o[0]=5,o[1]=e,o[2]=0,o[3]=r,a.copy(o,4),o.writeUInt16BE(n,4+a.length),o}handleConnectResponse(){if(this.buffer.length<4)return;let e=this.buffer[0],t=this.buffer[1],n=this.buffer[3];if(e!==5)throw new o(`Invalid SOCKS version in reply: ${e}`,`UND_ERR_SOCKS5_REPLY_VERSION`);let r=4;if(n===p.IPV4)r+=6;else if(n===p.DOMAIN){if(this.buffer.length<5)return;r+=1+this.buffer[4]+2}else if(n===p.IPV6)r+=18;else throw new o(`Invalid address type in reply: ${n}`,`UND_ERR_SOCKS5_ADDR_TYPE`);if(this.buffer.length<r)return;if(t!==m.SUCCEEDED){let e=this.getReplyErrorMessage(t);throw new o(`SOCKS5 connection failed: ${e}`,`UND_ERR_SOCKS5_REPLY_${t}`)}let i,a=4;if(n===p.IPV4)i=Array.from(this.buffer.subarray(a,a+4)).join(`.`),a+=4;else if(n===p.DOMAIN){let e=this.buffer[a];a+=1,i=this.buffer.subarray(a,a+e).toString(),a+=e}else if(n===p.IPV6){let e=[];for(let t=0;t<8;t++){let n=this.buffer.readUInt16BE(a+t*2);e.push(n.toString(16))}i=e.join(`:`),a+=16}let s=this.buffer.readUInt16BE(a);this.buffer=u,this.state=h.CONNECTED,this.socket.removeListener(`data`,this.onSocketData),l(`connected, bound address:`,i,`port:`,s),this.emit(`connected`,{address:i,port:s})}getReplyErrorMessage(e){switch(e){case m.GENERAL_FAILURE:return`General SOCKS server failure`;case m.CONNECTION_NOT_ALLOWED:return`Connection not allowed by ruleset`;case m.NETWORK_UNREACHABLE:return`Network unreachable`;case m.HOST_UNREACHABLE:return`Host unreachable`;case m.CONNECTION_REFUSED:return`Connection refused`;case m.TTL_EXPIRED:return`TTL expired`;case m.COMMAND_NOT_SUPPORTED:return`Command not supported`;case m.ADDRESS_TYPE_NOT_SUPPORTED:return`Address type not supported`;default:return`Unknown error code: ${e}`}}},AUTH_METHODS:d,COMMANDS:f,ADDRESS_TYPES:p,REPLY_CODES:m,STATES:h}})),le=t(((t,n)=>{let{URL:r}=e(`node:url`),i,a=M(),{InvalidArgumentError:o}=S(),{Socks5Client:s,STATES:c}=Z(),{kDispatch:l,kClose:u,kDestroy:d}=b(),f=ce(),p=N(),{debuglog:m}=e(`node:util`),h=m(`undici:socks5-proxy`),g=Symbol(`proxy url`),_=Symbol(`proxy headers`),v=Symbol(`proxy auth`),y=Symbol(`proxy protocol`),x=Symbol(`pools`),C=Symbol(`connector`),w=Symbol(`request tls settings`),T=!1;n.exports=class extends a{constructor(e,t={}){if(super(),T||=(process.emitWarning(`SOCKS5 proxy support is experimental and subject to change`,`ExperimentalWarning`),!0),!e)throw new o(`Proxy URL is mandatory`);let n=typeof e==`string`?new r(e):e;if(n.protocol!==`socks5:`&&n.protocol!==`socks:`)throw new o(`Proxy URL must use socks5:// or socks:// protocol`);this[g]=n,this[_]=t.headers||{},this[y]=t.proxyTls?`https:`:`http:`,this[w]=t.requestTls,this[v]={username:t.username||(n.username?decodeURIComponent(n.username):null),password:t.password||(n.password?decodeURIComponent(n.password):null)},this[C]=t.connect||p({...t.proxyTls,servername:t.proxyTls?.servername||n.hostname}),this[x]=new Map}async createSocks5Connection(e,t){let n=this[g].hostname,r=parseInt(this[g].port)||1080;h(`creating SOCKS5 connection to`,n,r);let i=await new Promise((e,t)=>{this[C]({hostname:n,host:n,port:r,protocol:this[y]},(n,r)=>{n?t(n):e(r)})}),a=new s(i,this[v]);return a.on(`error`,e=>{h(`SOCKS5 error:`,e),i.destroy()}),await a.handshake(),await new Promise((e,t)=>{let n=setTimeout(()=>{t(Error(`SOCKS5 authentication timeout`))},5e3),r=()=>{clearTimeout(n),a.removeListener(`error`,i),e()},i=e=>{clearTimeout(n),a.removeListener(`authenticated`,r),t(e)};a.state===c.AUTHENTICATED?(clearTimeout(n),e()):(a.once(`authenticated`,r),a.once(`error`,i))}),await a.connect(e,t),await new Promise((n,r)=>{let i=setTimeout(()=>{r(Error(`SOCKS5 connection timeout`))},5e3),o=r=>{h(`SOCKS5 tunnel established to`,e,t,`via`,r),clearTimeout(i),a.removeListener(`error`,s),n()},s=e=>{clearTimeout(i),a.removeListener(`connected`,o),r(e)};a.once(`connected`,o),a.once(`error`,s)}),i}[l](t,n){let{origin:a}=t;h(`dispatching request to`,a,`via SOCKS5`);try{let o=String(a),s=this[x].get(o);return(!s||s.destroyed||s.closed)&&(s=new f(a,{pipelining:t.pipelining,connections:t.connections,connect:async(t,n)=>{try{let t=new r(a),o=t.hostname,s=parseInt(t.port)||(t.protocol===`https:`?443:80);h(`establishing SOCKS5 connection to`,o,s);let c=await this.createSocks5Connection(o,s),l=c;t.protocol===`https:`&&(i||=e(`node:tls`),h(`upgrading to TLS`),l=i.connect({...this[w],socket:c,servername:this[w]?.servername||o}),await new Promise((e,t)=>{l.once(`secureConnect`,e),l.once(`error`,t)})),n(null,l)}catch(e){h(`SOCKS5 connection error:`,e),n(e)}}}),this[x].set(o,s)),s[l](t,n)}catch(e){if(h(`dispatch error:`,e),typeof n.onResponseError==`function`)return n.onResponseError(null,e),!1;if(typeof n.onError==`function`)return n.onError(e),!1;throw e}}async[u](){let e=[];for(let t of this[x].values())e.push(t.close());this[x].clear(),await Promise.all(e)}async[d](e){let t=[];for(let n of this[x].values())t.push(n.destroy(e));this[x].clear(),await Promise.all(t)}}})),ue=t(((e,t)=>{let{kProxy:n,kClose:r,kDestroy:i,kDispatch:a}=b(),o=Y(),s=ce(),c=M(),{InvalidArgumentError:l,RequestAbortedError:u,SecureProxyConnectionError:d}=S(),f=N(),p=K(),{channels:m}=D(),h=le(),g=Symbol(`proxy agent`),_=Symbol(`proxy client`),v=Symbol(`proxy headers`),y=Symbol(`request tls settings`),x=Symbol(`proxy tls settings`),C=Symbol(`connect endpoint function`),w=Symbol(`tunnel proxy`);function T(e){return e===`https:`?443:80}function E(e,t){return new s(e,t)}let O=()=>{};function k(e,t){return t.connections===1?new p(e,t):new s(e,t)}var A=class extends c{#e;constructor(e,{headers:t={},connect:n,factory:r}){if(!e)throw new l(`Proxy URL is mandatory`);super(),this[v]=t,this.#e=r?r(e,{connect:n}):new p(e,{connect:n})}[a](e,t){let n=t.onHeaders;t.onHeaders=function(e,r,i){if(e===407){typeof t.onError==`function`&&t.onError(new l(`Proxy Authentication Required (407)`));return}n&&n.call(this,e,r,i)};let{origin:r,path:i=`/`,headers:o={}}=e;if(e.path=r+i,!(`host`in o)&&!(`Host`in o)){let{host:e}=new URL(r);o.host=e}return e.headers={...this[v],...o},this.#e[a](e,t)}[r](){return this.#e.close()}[i](e){return this.#e.destroy(e)}},j=class extends c{constructor(e){if(!e||typeof e==`object`&&!(e instanceof URL)&&!e.uri)throw new l(`Proxy uri is mandatory`);let{clientFactory:t=E}=e;if(typeof t!=`function`)throw new l(`Proxy opts.clientFactory must be a function.`);let{proxyTunnel:r=!0}=e;super();let i=this.#e(e),{href:a,origin:s,port:c,protocol:p,username:b,password:S,hostname:D}=i;if(this[n]={uri:a,protocol:p},this[y]=e.requestTls,this[x]=e.proxyTls,this[v]=e.headers||{},this[w]=r,e.auth&&e.token)throw new l(`opts.auth cannot be used in combination with opts.token`);e.auth?this[v][`proxy-authorization`]=`Basic ${e.auth}`:e.token?this[v][`proxy-authorization`]=e.token:b&&S&&(this[v][`proxy-authorization`]=`Basic ${Buffer.from(`${decodeURIComponent(b)}:${decodeURIComponent(S)}`).toString(`base64`)}`);let j=f({...e.proxyTls});this[C]=f({...e.requestTls});let M=e.factory||k,N=(t,r)=>{let{protocol:i}=new URL(t);return this[n].protocol===`socks5:`||this[n].protocol===`socks:`?new h(this[n].uri,{headers:this[v],connect:j,factory:M,username:e.username||b,password:e.password||S,proxyTls:e.proxyTls,requestTls:e.requestTls}):!this[w]&&i===`http:`&&this[n].protocol===`http:`?new A(this[n].uri,{headers:this[v],connect:j,factory:M}):M(t,r)};p===`socks5:`||p===`socks:`?this[_]=null:this[_]=t(i,{connect:j}),this[g]=new o({...e,factory:N,connect:async(e,t)=>{if(!this[_]){t(new l(`Cannot establish tunnel connection without a proxy client`));return}let n=e.host;e.port||(n+=`:${T(e.protocol)}`);try{let r={origin:s,port:c,path:n,signal:e.signal,headers:{...this[v],host:e.host,...e.connections==null||e.connections>0?{"proxy-connection":`keep-alive`}:{}},servername:this[x]?.servername||D},{socket:i,statusCode:a}=await this[_].connect(r);if(a!==200){i.on(`error`,O).destroy(),t(new u(`Proxy response (${a}) !== 200 when HTTP Tunneling`));return}if(m.proxyConnected.hasSubscribers&&m.proxyConnected.publish({socket:i,connectParams:r}),e.protocol!==`https:`){t(null,i);return}let o;o=this[y]?this[y].servername:e.servername,this[C]({...e,servername:o,httpSocket:i},t)}catch(e){e.code===`ERR_TLS_CERT_ALTNAME_INVALID`?t(new d(e)):t(e)}}})}dispatch(e,t){let n=P(e.headers);if(F(n),n&&!(`host`in n)&&!(`Host`in n)){let{host:t}=new URL(e.origin);n.host=t}return this[g].dispatch({...e,headers:n},t)}#e(e){return typeof e==`string`?new URL(e):e instanceof URL?e:new URL(e.uri)}[r](){let e=[this[g].close()];return this[_]&&e.push(this[_].close()),Promise.all(e)}[i](){let e=[this[g].destroy()];return this[_]&&e.push(this[_].destroy()),Promise.all(e)}};function P(e){if(Array.isArray(e)){let t={};for(let n=0;n<e.length;n+=2)t[e[n]]=e[n+1];return t}return e}function F(e){if(e&&Object.keys(e).find(e=>e.toLowerCase()===`proxy-authorization`))throw new l(`Proxy-Authorization should be sent in ProxyAgent constructor`)}t.exports=j})),de=t(((e,t)=>{let n=M(),{kClose:r,kDestroy:i,kClosed:a,kDestroyed:o,kDispatch:s,kNoProxyAgent:c,kHttpProxyAgent:l,kHttpsProxyAgent:u}=b(),d=ue(),f=Y(),p={"http:":80,"https:":443};t.exports=class extends n{#e=null;#t=null;#n=null;constructor(e={}){super(),this.#n=e;let{httpProxy:t,httpsProxy:n,noProxy:r,...i}=e;this[c]=new f(i);let a=t??process.env.http_proxy??process.env.HTTP_PROXY;a?this[l]=new d({...i,uri:a}):this[l]=this[c];let o=n??process.env.https_proxy??process.env.HTTPS_PROXY;o?this[u]=new d({...i,uri:o}):this[u]=this[l],this.#a()}[s](e,t){let n=new URL(e.origin);return this.#r(n).dispatch(e,t)}[r](){return Promise.all([this[c].close(),!this[l][a]&&this[l].close(),!this[u][a]&&this[u].close()])}[i](e){return Promise.all([this[c].destroy(e),!this[l][o]&&this[l].destroy(e),!this[u][o]&&this[u].destroy(e)])}#r(e){let{protocol:t,host:n,port:r}=e;return n=n.replace(/:\d*$/,``).toLowerCase(),r=Number.parseInt(r,10)||p[t]||0,this.#i(n,r)?t===`https:`?this[u]:this[l]:this[c]}#i(e,t){if(this.#o&&this.#a(),this.#t.length===0)return!0;if(this.#e===`*`)return!1;for(let n=0;n<this.#t.length;n++){let r=this.#t[n];if(!(r.port&&r.port!==t)&&(e===r.hostname||e.slice(-(r.hostname.length+1))===`.${r.hostname}`))return!1}return!0}#a(){let e=this.#n.noProxy??this.#s,t=e.split(/[,\s]/),n=[];for(let e=0;e<t.length;e++){let r=t[e];if(!r)continue;let i=r.match(/^(.+):(\d+)$/);n.push({hostname:(i?i[1]:r).replace(/^\*?\./,``).toLowerCase(),port:i?Number.parseInt(i[2],10):0})}this.#e=e,this.#t=n}get#o(){return this.#n.noProxy===void 0&&this.#e!==this.#s}get#s(){return process.env.no_proxy??process.env.NO_PROXY??``}}})),Q=t(((t,n)=>{let r=e(`node:assert`),{kRetryHandlerDefaultRetry:i}=b(),{RequestRetryError:a}=S(),o=k(),{isDisturbed:s,parseRangeHeader:c,wrapRequestBody:l}=T();function u(e){let t=new Date(e).getTime();return isNaN(t)?0:t-Date.now()}function d(e,t,n,r){let i=e[`content-length`];if(i==null||!Number.isFinite(t.start)||!Number.isFinite(t.end))return;let o=Number(i),s=t.end-t.start+1;if(!Number.isFinite(o)||o!==s)throw new a(`Content-Length mismatch`,n,{headers:e,data:{count:r}})}n.exports=class e{constructor(t,{dispatch:n,handler:r}){let{retryOptions:a,...s}=t,{retry:c,maxRetries:u,maxTimeout:d,minTimeout:f,timeoutFactor:p,methods:m,errorCodes:h,retryAfter:g,statusCodes:_,throwOnError:v}=a??{};this.error=null,this.dispatch=n,this.handler=o.wrap(r),this.opts={...s,body:l(t.body)},this.retryOpts={throwOnError:v??!0,retry:c??e[i],retryAfter:g??!0,maxTimeout:d??3e4,minTimeout:f??500,timeoutFactor:p??2,maxRetries:u??5,methods:m??[`GET`,`HEAD`,`OPTIONS`,`PUT`,`DELETE`,`TRACE`],statusCodes:_??[500,502,503,504,429],errorCodes:h??[`ECONNRESET`,`ECONNREFUSED`,`ENOTFOUND`,`ENETDOWN`,`ENETUNREACH`,`EHOSTDOWN`,`EHOSTUNREACH`,`EPIPE`,`UND_ERR_SOCKET`]},this.retryCount=0,this.retryCountCheckpoint=0,this.headersSent=!1,this.start=0,this.end=null,this.etag=null}onResponseStartWithRetry(e,t,n,r,i){if(this.retryOpts.throwOnError){this.retryOpts.statusCodes.includes(t)===!1?(this.headersSent=!0,this.handler.onResponseStart?.(e,t,n,r)):this.error=i;return}if(s(this.opts.body)){this.headersSent=!0,this.handler.onResponseStart?.(e,t,n,r);return}function a(a){if(a){this.headersSent=!0,this.handler.onResponseStart?.(e,t,n,r),e.resume();return}this.error=i,e.resume()}e.pause(),this.retryOpts.retry(i,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},a.bind(this))}onRequestStart(e,t){this.headersSent||this.handler.onRequestStart?.(e,t)}onRequestUpgrade(e,t,n,r){this.handler.onRequestUpgrade?.(e,t,n,r)}static[i](e,{state:t,opts:n},r){let{statusCode:i,code:a,headers:o}=e,{method:s,retryOptions:c}=n,{maxRetries:l,minTimeout:d,maxTimeout:f,timeoutFactor:p,statusCodes:m,errorCodes:h,methods:g}=c,{counter:_}=t;if(a&&a!==`UND_ERR_REQ_RETRY`&&!h.includes(a)){r(e);return}if(Array.isArray(g)&&!g.includes(s)){r(e);return}if(i!=null&&Array.isArray(m)&&!m.includes(i)){r(e);return}if(_>l){r(e);return}let v=o?.[`retry-after`];v&&=(v=Number(v),Number.isNaN(v)?u(o[`retry-after`]):v*1e3);let y=Math.min(v>0?v:d*p**(_-1),f);setTimeout(()=>r(null),y)}onResponseStart(e,t,n,i){if(this.error=null,this.retryCount+=1,t>=300){let r=new a(`Request failed`,t,{headers:n,data:{count:this.retryCount}});this.onResponseStartWithRetry(e,t,n,i,r);return}if(this.headersSent){if(t!==206&&(this.start>0||t!==200))throw new a(`server does not support the range header and the payload was partially consumed`,t,{headers:n,data:{count:this.retryCount}});let e=c(n[`content-range`]);if(!e)throw new a(`Content-Range mismatch`,t,{headers:n,data:{count:this.retryCount}});if(this.etag!=null&&this.etag!==n.etag)throw new a(`ETag mismatch`,t,{headers:n,data:{count:this.retryCount}});d(n,e,t,this.retryCount);let{start:i,size:o,end:s=o?o-1:null}=e;r(this.start===i,`content-range mismatch`),r(this.end==null||this.end===s,`content-range mismatch`);return}if(this.end==null){if(t===206){let a=c(n[`content-range`]);if(a==null){this.headersSent=!0,this.handler.onResponseStart?.(e,t,n,i);return}d(n,a,t,this.retryCount);let{start:o,size:s,end:l=s?s-1:null}=a;r(o!=null&&Number.isFinite(o),`content-range mismatch`),r(l!=null&&Number.isFinite(l),`invalid content-length`),this.start=o,this.end=l}if(this.end==null){let e=n[`content-length`];this.end=e==null?null:Number(e)-1}r(Number.isFinite(this.start)),r(this.end==null||Number.isFinite(this.end),`invalid content-length`),this.resume=!0,this.etag=n.etag==null?null:n.etag,this.etag!=null&&this.etag[0]===`W`&&this.etag[1]===`/`&&(this.etag=null),this.headersSent=!0,this.handler.onResponseStart?.(e,t,n,i)}else throw new a(`Request failed`,t,{headers:n,data:{count:this.retryCount}})}onResponseData(e,t){this.error||(this.start+=t.length,this.handler.onResponseData?.(e,t))}onResponseEnd(e,t){if(this.error&&this.retryOpts.throwOnError)throw this.error;if(!this.error)return this.retryCount=0,this.handler.onResponseEnd?.(e,t);this.retry(e)}retry(e){if(this.start!==0){let e={range:`bytes=${this.start}-${this.end??``}`};this.etag!=null&&(e[`if-match`]=this.etag),this.opts={...this.opts,headers:{...this.opts.headers,...e}}}try{this.retryCountCheckpoint=this.retryCount,this.dispatch(this.opts,this)}catch(t){this.handler.onResponseError?.(e,t)}}onResponseError(e,t){if(e?.aborted||s(this.opts.body)){this.handler.onResponseError?.(e,t);return}function n(t){if(!t){this.retry(e);return}this.handler?.onResponseError?.(e,t)}this.retryCount-this.retryCountCheckpoint>0?this.retryCount=this.retryCountCheckpoint+(this.retryCount-this.retryCountCheckpoint):this.retryCount+=1,this.retryOpts.retry(t,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},n.bind(this))}}})),fe=t(((e,t)=>{let n=A(),r=Q();t.exports=class extends n{#e=null;#t=null;constructor(e,t={}){super(t),this.#e=e,this.#t=t}dispatch(e,t){let n=new r({...e,retryOptions:this.#t},{dispatch:this.#e.dispatch.bind(this.#e),handler:t});return this.#e.dispatch(e,n)}close(){return this.#e.close()}destroy(){return this.#e.destroy()}}})),pe=t(((e,t)=>{let{InvalidArgumentError:n}=S(),r=K();t.exports=class extends r{constructor(e,t){if(typeof e==`string`&&(e=new URL(e)),e.protocol!==`http:`)throw new n(`h2c-client: Only h2c protocol is supported`);let{maxConcurrentStreams:r,pipelining:i,...a}=t??{},o=100,s=100;if(r!=null&&Number.isInteger(r)&&r>0&&(o=r),i!=null&&Number.isInteger(i)&&i>0&&(s=i),s>o)throw new n(`h2c-client: pipelining cannot be greater than maxConcurrentStreams`);super(e,{...a,maxConcurrentStreams:o,pipelining:s,allowH2:!0,useH2c:!0})}}})),me=t(((t,n)=>{let r=e(`node:assert`),{Readable:i}=e(`node:stream`),{RequestAbortedError:a,NotSupportedError:o,InvalidArgumentError:s,AbortError:c}=S(),l=T(),{ReadableStreamFrom:u}=T(),d=Symbol(`kConsume`),f=Symbol(`kReading`),p=Symbol(`kBody`),m=Symbol(`kAbort`),h=Symbol(`kContentType`),g=Symbol(`kContentLength`),_=Symbol(`kUsed`),v=Symbol(`kBytesRead`),y=()=>{};var b=class extends i{constructor({resume:e,abort:t,contentType:n=``,contentLength:r,highWaterMark:i=65536}){super({autoDestroy:!0,read:e,highWaterMark:i}),this._readableState.dataEmitted=!1,this[m]=t,this[d]=null,this[v]=0,this[p]=null,this[_]=!1,this[h]=n,this[g]=Number.isFinite(r)?r:null,this[f]=!1}_destroy(e,t){!e&&!this._readableState.endEmitted&&(e=new a),e&&this[m](),this[_]?t(e):setImmediate(t,e)}on(e,t){return(e===`data`||e===`readable`)&&(this[f]=!0,this[_]=!0),super.on(e,t)}addListener(e,t){return this.on(e,t)}off(e,t){let n=super.off(e,t);return(e===`data`||e===`readable`)&&(this[f]=this.listenerCount(`data`)>0||this.listenerCount(`readable`)>0),n}removeListener(e,t){return this.off(e,t)}push(e){return e&&(this[v]+=e.length,this[d])?(A(this[d],e),!this[f]||super.push(e)):super.push(e)}text(){return w(this,`text`)}json(){return w(this,`json`)}blob(){return w(this,`blob`)}bytes(){return w(this,`bytes`)}arrayBuffer(){return w(this,`arrayBuffer`)}async formData(){throw new o}get bodyUsed(){return l.isDisturbed(this)}get body(){return this[p]||(this[p]=u(this),this[d]&&(this[p].getReader(),r(this[p].locked))),this[p]}dump(e){let t=e?.signal;if(t!=null&&(typeof t!=`object`||!(`aborted`in t)))return Promise.reject(new s(`signal must be an AbortSignal`));let n=e?.limit&&Number.isFinite(e.limit)?e.limit:131072;return t?.aborted?Promise.reject(t.reason??new c):this._readableState.closeEmitted?Promise.resolve(null):new Promise((e,r)=>{if((this[g]&&this[g]>n||this[v]>n)&&this.destroy(new c),t){let n=()=>{this.destroy(t.reason??new c)};t.addEventListener(`abort`,n),this.on(`close`,function(){t.removeEventListener(`abort`,n),t.aborted?r(t.reason??new c):e(null)})}else this.on(`close`,e);this.on(`error`,y).on(`data`,()=>{this[v]>n&&this.destroy()}).resume()})}setEncoding(e){return Buffer.isEncoding(e)&&(this._readableState.encoding=e),this}};function x(e){return e[p]?.locked===!0||e[d]!==null}function C(e){return l.isDisturbed(e)||x(e)}function w(e,t){return r(!e[d]),new Promise((n,r)=>{if(C(e)){let t=e._readableState;t.destroyed&&t.closeEmitted===!1?e.on(`error`,r).on(`close`,()=>{r(TypeError(`unusable`))}):r(t.errored??TypeError(`unusable`))}else queueMicrotask(()=>{e[d]={type:t,stream:e,resolve:n,reject:r,length:0,body:[]},e.on(`error`,function(e){j(this[d],e)}).on(`close`,function(){this[d].body!==null&&j(this[d],new a)}),E(e[d])})})}function E(e){if(e.body===null)return;let{_readableState:t}=e.stream;if(t.bufferIndex){let n=t.bufferIndex,r=t.buffer.length;for(let i=n;i<r;i++)A(e,t.buffer[i])}else for(let n of t.buffer)A(e,n);for(t.endEmitted?k(this[d],this._readableState.encoding):e.stream.on(`end`,function(){k(this[d],this._readableState.encoding)}),e.stream.resume();e.stream.read()!=null;);}function D(e,t,n){if(e.length===0||t===0)return``;let r=e.length===1?e[0]:Buffer.concat(e,t),i=r.length,a=i>2&&r[0]===239&&r[1]===187&&r[2]===191?3:0;return!n||n===`utf8`||n===`utf-8`?r.utf8Slice(a,i):r.subarray(a,i).toString(n)}function O(e,t){if(e.length===0||t===0)return new Uint8Array;if(e.length===1)return new Uint8Array(e[0]);let n=new Uint8Array(Buffer.allocUnsafeSlow(t).buffer),r=0;for(let t=0;t<e.length;++t){let i=e[t];n.set(i,r),r+=i.length}return n}function k(e,t){let{type:n,body:r,resolve:i,stream:a,length:o}=e;try{n===`text`?i(D(r,o,t)):n===`json`?i(JSON.parse(D(r,o,t))):n===`arrayBuffer`?i(O(r,o).buffer):n===`blob`?i(new Blob(r,{type:a[h]})):n===`bytes`&&i(O(r,o)),j(e)}catch(e){a.destroy(e)}}function A(e,t){e.length+=t.length,e.body.push(t)}function j(e,t){e.body!==null&&(t?e.reject(t):e.resolve(),e.type=null,e.stream=null,e.resolve=null,e.reject=null,e.length=0,e.body=null)}n.exports={Readable:b,chunksDecode:D}})),he=t(((t,n)=>{let r=e(`node:assert`),{AsyncResource:i}=e(`node:async_hooks`),{Readable:a}=me(),{InvalidArgumentError:o,RequestAbortedError:s}=S(),c=T();function l(){}var u=class extends i{constructor(e,t){if(!e||typeof e!=`object`)throw new o(`invalid opts`);let{signal:n,method:r,opaque:i,body:a,onInfo:u,responseHeaders:d,highWaterMark:f}=e;try{if(typeof t!=`function`)throw new o(`invalid callback`);if(f!=null&&(!Number.isFinite(f)||f<0))throw new o(`invalid highWaterMark`);if(n&&typeof n.on!=`function`&&typeof n.addEventListener!=`function`)throw new o(`signal must be an EventEmitter or EventTarget`);if(r===`CONNECT`)throw new o(`invalid method`);if(u&&typeof u!=`function`)throw new o(`invalid onInfo callback`);super(`UNDICI_REQUEST`)}catch(e){throw c.isStream(a)&&c.destroy(a.on(`error`,l),e),e}this.method=r,this.responseHeaders=d||null,this.opaque=i||null,this.callback=t,this.res=null,this.abort=null,this.body=a,this.trailers={},this.context=null,this.onInfo=u||null,this.highWaterMark=f,this.reason=null,this.removeAbortListener=null,n?.aborted?this.reason=n.reason??new s:n&&(this.removeAbortListener=c.addAbortListener(n,()=>{this.reason=n.reason??new s,this.res?c.destroy(this.res.on(`error`,l),this.reason):this.abort&&this.abort(this.reason)}))}onConnect(e,t){if(this.reason){e(this.reason);return}r(this.callback),this.abort=e,this.context=t}onHeaders(e,t,n,r){let{callback:i,opaque:o,abort:s,context:u,responseHeaders:d,highWaterMark:f}=this,p=d===`raw`?c.parseRawHeaders(t):c.parseHeaders(t);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:p});return}let m=d===`raw`?c.parseHeaders(t):p,h=m[`content-type`],g=m[`content-length`],_=new a({resume:n,abort:s,contentType:h,contentLength:this.method!==`HEAD`&&g?Number(g):null,highWaterMark:f});if(this.removeAbortListener&&=(_.on(`close`,this.removeAbortListener),null),this.callback=null,this.res=_,i!==null)try{this.runInAsyncScope(i,null,null,{statusCode:e,statusText:r,headers:p,trailers:this.trailers,opaque:o,body:_,context:u})}catch(e){this.res=null,c.destroy(_.on(`error`,l),e),queueMicrotask(()=>{throw e})}}onData(e){return this.res.push(e)}onComplete(e){c.parseHeaders(e,this.trailers),this.res.push(null)}onError(e){let{res:t,callback:n,body:r,opaque:i}=this;n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:i})})),t&&(this.res=null,queueMicrotask(()=>{c.destroy(t.on(`error`,l),e)})),r&&(this.body=null,c.isStream(r)&&(r.on(`error`,l),c.destroy(r,e))),this.removeAbortListener&&=(this.removeAbortListener(),null)}};function d(e,t){if(t===void 0)return new Promise((t,n)=>{d.call(this,e,(e,r)=>e?n(e):t(r))});try{let n=new u(e,t);this.dispatch(e,n)}catch(n){if(typeof t!=`function`)throw n;let r=e?.opaque;queueMicrotask(()=>t(n,{opaque:r}))}}n.exports=d,n.exports.RequestHandler=u})),$=t(((e,t)=>{let{addAbortListener:n}=T(),{RequestAbortedError:r}=S(),i=Symbol(`kListener`),a=Symbol(`kSignal`);function o(e){e.abort?e.abort(e[a]?.reason):e.reason=e[a]?.reason??new r,c(e)}function s(e,t){if(e.reason=null,e[a]=null,e[i]=null,t){if(t.aborted){o(e);return}e[a]=t,e[i]=()=>{o(e)},n(e[a],e[i])}}function c(e){e[a]&&(`removeEventListener`in e[a]?e[a].removeEventListener(`abort`,e[i]):e[a].removeListener(`abort`,e[i]),e[a]=null,e[i]=null)}t.exports={addSignal:s,removeSignal:c}})),ge=t(((t,n)=>{let r=e(`node:assert`),{finished:i}=e(`node:stream`),{AsyncResource:a}=e(`node:async_hooks`),{InvalidArgumentError:o,InvalidReturnValueError:s}=S(),c=T(),{addSignal:l,removeSignal:u}=$();function d(){}var f=class extends a{constructor(e,t,n){if(!e||typeof e!=`object`)throw new o(`invalid opts`);let{signal:r,method:i,opaque:a,body:s,onInfo:u,responseHeaders:f}=e;try{if(typeof n!=`function`)throw new o(`invalid callback`);if(typeof t!=`function`)throw new o(`invalid factory`);if(r&&typeof r.on!=`function`&&typeof r.addEventListener!=`function`)throw new o(`signal must be an EventEmitter or EventTarget`);if(i===`CONNECT`)throw new o(`invalid method`);if(u&&typeof u!=`function`)throw new o(`invalid onInfo callback`);super(`UNDICI_STREAM`)}catch(e){throw c.isStream(s)&&c.destroy(s.on(`error`,d),e),e}this.responseHeaders=f||null,this.opaque=a||null,this.factory=t,this.callback=n,this.res=null,this.abort=null,this.context=null,this.trailers=null,this.body=s,this.onInfo=u||null,c.isStream(s)&&s.on(`error`,e=>{this.onError(e)}),l(this,r)}onConnect(e,t){if(this.reason){e(this.reason);return}r(this.callback),this.abort=e,this.context=t}onHeaders(e,t,n,r){let{factory:a,opaque:o,context:l,responseHeaders:u}=this,d=u===`raw`?c.parseRawHeaders(t):c.parseHeaders(t);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:d});return}if(this.factory=null,a===null)return;let f=this.runInAsyncScope(a,null,{statusCode:e,headers:d,opaque:o,context:l});if(!f||typeof f.write!=`function`||typeof f.end!=`function`||typeof f.on!=`function`)throw new s(`expected Writable`);return i(f,{readable:!1},e=>{let{callback:t,res:n,opaque:r,trailers:i,abort:a}=this;this.res=null,(e||!n?.readable)&&c.destroy(n,e),this.callback=null,this.runInAsyncScope(t,null,e||null,{opaque:r,trailers:i}),e&&a()}),f.on(`drain`,n),this.res=f,(f.writableNeedDrain===void 0?f._writableState?.needDrain:f.writableNeedDrain)!==!0}onData(e){let{res:t}=this;return!t||t.write(e)}onComplete(e){let{res:t}=this;u(this),t&&(this.trailers=c.parseHeaders(e),t.end())}onError(e){let{res:t,callback:n,opaque:r,body:i}=this;u(this),this.factory=null,t?(this.res=null,c.destroy(t,e)):n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:r})})),i&&(this.body=null,c.destroy(i,e))}};function p(e,t,n){if(n===void 0)return new Promise((n,r)=>{p.call(this,e,t,(e,t)=>e?r(e):n(t))});try{let r=new f(e,t,n);this.dispatch(e,r)}catch(t){if(typeof n!=`function`)throw t;let r=e?.opaque;queueMicrotask(()=>n(t,{opaque:r}))}}n.exports=p})),_e=t(((t,n)=>{let{Readable:r,Duplex:i,PassThrough:a}=e(`node:stream`),o=e(`node:assert`),{AsyncResource:s}=e(`node:async_hooks`),{InvalidArgumentError:c,InvalidReturnValueError:l,RequestAbortedError:u}=S(),d=T(),{addSignal:f,removeSignal:p}=$();function m(){}let h=Symbol(`resume`);var g=class extends r{constructor(){super({autoDestroy:!0}),this[h]=null}_read(){let{[h]:e}=this;e&&(this[h]=null,e())}_destroy(e,t){this._read(),t(e)}},_=class extends r{constructor(e){super({autoDestroy:!0}),this[h]=e}_read(){this[h]()}_destroy(e,t){!e&&!this._readableState.endEmitted&&(e=new u),t(e)}},v=class extends s{constructor(e,t){if(!e||typeof e!=`object`)throw new c(`invalid opts`);if(typeof t!=`function`)throw new c(`invalid handler`);let{signal:n,method:r,opaque:a,onInfo:o,responseHeaders:s}=e;if(n&&typeof n.on!=`function`&&typeof n.addEventListener!=`function`)throw new c(`signal must be an EventEmitter or EventTarget`);if(r===`CONNECT`)throw new c(`invalid method`);if(o&&typeof o!=`function`)throw new c(`invalid onInfo callback`);super(`UNDICI_PIPELINE`),this.opaque=a||null,this.responseHeaders=s||null,this.handler=t,this.abort=null,this.context=null,this.onInfo=o||null,this.req=new g().on(`error`,m),this.ret=new i({readableObjectMode:e.objectMode,autoDestroy:!0,read:()=>{let{body:e}=this;e?.resume&&e.resume()},write:(e,t,n)=>{let{req:r}=this;r.push(e,t)||r._readableState.destroyed?n():r[h]=n},destroy:(e,t)=>{let{body:n,req:r,res:i,ret:a,abort:o}=this;!e&&!a._readableState.endEmitted&&(e=new u),o&&e&&o(),d.destroy(n,e),d.destroy(r,e),d.destroy(i,e),p(this),t(e)}}).on(`prefinish`,()=>{let{req:e}=this;e.push(null)}),this.res=null,f(this,n)}onConnect(e,t){let{res:n}=this;if(this.reason){e(this.reason);return}o(!n,`pipeline cannot be retried`),this.abort=e,this.context=t}onHeaders(e,t,n){let{opaque:r,handler:i,context:a}=this;if(e<200){if(this.onInfo){let n=this.responseHeaders===`raw`?d.parseRawHeaders(t):d.parseHeaders(t);this.onInfo({statusCode:e,headers:n})}return}this.res=new _(n);let o;try{this.handler=null;let n=this.responseHeaders===`raw`?d.parseRawHeaders(t):d.parseHeaders(t);o=this.runInAsyncScope(i,null,{statusCode:e,headers:n,opaque:r,body:this.res,context:a})}catch(e){throw this.res.on(`error`,m),e}if(!o||typeof o.on!=`function`)throw new l(`expected Readable`);o.on(`data`,e=>{let{ret:t,body:n}=this;!t.push(e)&&n.pause&&n.pause()}).on(`error`,e=>{let{ret:t}=this;d.destroy(t,e)}).on(`end`,()=>{let{ret:e}=this;e.push(null)}).on(`close`,()=>{let{ret:e}=this;e._readableState.ended||d.destroy(e,new u)}),this.body=o}onData(e){let{res:t}=this;return t.push(e)}onComplete(e){let{res:t}=this;t.push(null)}onError(e){let{ret:t}=this;this.handler=null,d.destroy(t,e)}};function y(e,t){try{let n=new v(e,t);return this.dispatch({...e,body:n.req},n),n.ret}catch(e){return new a().destroy(e)}}n.exports=y})),ve=t(((t,n)=>{let{InvalidArgumentError:r,SocketError:i}=S(),{AsyncResource:a}=e(`node:async_hooks`),o=e(`node:assert`),s=T(),{kHTTP2Stream:c}=b(),{addSignal:l,removeSignal:u}=$();var d=class extends a{constructor(e,t){if(!e||typeof e!=`object`)throw new r(`invalid opts`);if(typeof t!=`function`)throw new r(`invalid callback`);let{signal:n,opaque:i,responseHeaders:a}=e;if(n&&typeof n.on!=`function`&&typeof n.addEventListener!=`function`)throw new r(`signal must be an EventEmitter or EventTarget`);super(`UNDICI_UPGRADE`),this.responseHeaders=a||null,this.opaque=i||null,this.callback=t,this.abort=null,this.context=null,l(this,n)}onConnect(e,t){if(this.reason){e(this.reason);return}o(this.callback),this.abort=e,this.context=null}onHeaders(){throw new i(`bad upgrade`,null)}onUpgrade(e,t,n){o(n[c]===!0?e===200:e===101);let{callback:r,opaque:i,context:a}=this;u(this),this.callback=null;let l=this.responseHeaders===`raw`?s.parseRawHeaders(t):s.parseHeaders(t);this.runInAsyncScope(r,null,null,{headers:l,socket:n,opaque:i,context:a})}onError(e){let{callback:t,opaque:n}=this;u(this),t&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(t,null,e,{opaque:n})}))}};function f(e,t){if(t===void 0)return new Promise((t,n)=>{f.call(this,e,(e,r)=>e?n(e):t(r))});try{let n=new d(e,t),r={...e,method:e.method||`GET`,upgrade:e.protocol||`Websocket`};this.dispatch(r,n)}catch(n){if(typeof t!=`function`)throw n;let r=e?.opaque;queueMicrotask(()=>t(n,{opaque:r}))}}n.exports=f})),ye=t(((t,n)=>{let r=e(`node:assert`),{AsyncResource:i}=e(`node:async_hooks`),{InvalidArgumentError:a,SocketError:o}=S(),s=T(),{addSignal:c,removeSignal:l}=$();var u=class extends i{constructor(e,t){if(!e||typeof e!=`object`)throw new a(`invalid opts`);if(typeof t!=`function`)throw new a(`invalid callback`);let{signal:n,opaque:r,responseHeaders:i}=e;if(n&&typeof n.on!=`function`&&typeof n.addEventListener!=`function`)throw new a(`signal must be an EventEmitter or EventTarget`);super(`UNDICI_CONNECT`),this.opaque=r||null,this.responseHeaders=i||null,this.callback=t,this.abort=null,c(this,n)}onConnect(e,t){if(this.reason){e(this.reason);return}r(this.callback),this.abort=e,this.context=t}onHeaders(){throw new o(`bad connect`,null)}onUpgrade(e,t,n){let{callback:r,opaque:i,context:a}=this;l(this),this.callback=null;let o=t;o!=null&&(o=this.responseHeaders===`raw`?s.parseRawHeaders(t):s.parseHeaders(t)),this.runInAsyncScope(r,null,null,{statusCode:e,headers:o,socket:n,opaque:i,context:a})}onError(e){let{callback:t,opaque:n}=this;l(this),t&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(t,null,e,{opaque:n})}))}};function d(e,t){if(t===void 0)return new Promise((t,n)=>{d.call(this,e,(e,r)=>e?n(e):t(r))});try{let n=new u(e,t),r={...e,method:`CONNECT`};this.dispatch(r,n)}catch(n){if(typeof t!=`function`)throw n;let r=e?.opaque;queueMicrotask(()=>t(n,{opaque:r}))}}n.exports=d})),be=t(((e,t)=>{t.exports.request=he(),t.exports.stream=ge(),t.exports.pipeline=_e(),t.exports.upgrade=ve(),t.exports.connect=ye()})),xe=t(((e,t)=>{let{UndiciError:n}=S(),r=Symbol.for(`undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED`);t.exports={MockNotMatchedError:class extends n{constructor(e){super(e),this.name=`MockNotMatchedError`,this.message=e||`The request does not match any registered mock dispatches`,this.code=`UND_MOCK_ERR_MOCK_NOT_MATCHED`}static[Symbol.hasInstance](e){return e&&e[r]===!0}get[r](){return!0}}}})),Se=t(((e,t)=>{t.exports={kAgent:Symbol(`agent`),kOptions:Symbol(`options`),kFactory:Symbol(`factory`),kDispatches:Symbol(`dispatches`),kDispatchKey:Symbol(`dispatch key`),kDefaultHeaders:Symbol(`default headers`),kDefaultTrailers:Symbol(`default trailers`),kContentLength:Symbol(`content length`),kMockAgent:Symbol(`mock agent`),kMockAgentSet:Symbol(`mock agent set`),kMockAgentGet:Symbol(`mock agent get`),kMockDispatch:Symbol(`mock dispatch`),kClose:Symbol(`close`),kOriginalClose:Symbol(`original agent close`),kOriginalDispatch:Symbol(`original dispatch`),kOrigin:Symbol(`origin`),kIsMockActive:Symbol(`is mock active`),kNetConnect:Symbol(`net connect`),kGetNetConnect:Symbol(`get net connect`),kConnected:Symbol(`connected`),kIgnoreTrailingSlash:Symbol(`ignore trailing slash`),kMockAgentMockCallHistoryInstance:Symbol(`mock agent mock call history name`),kMockAgentRegisterCallHistory:Symbol(`mock agent register mock call history`),kMockAgentAddCallHistoryLog:Symbol(`mock agent add call history log`),kMockAgentIsCallHistoryEnabled:Symbol(`mock agent is call history enabled`),kMockAgentAcceptsNonStandardSearchParameters:Symbol(`mock agent accepts non standard search parameters`),kMockCallHistoryAddLog:Symbol(`mock call history add log`),kTotalDispatchCount:Symbol(`total dispatch count`)}})),Ce=t(((t,n)=>{let{MockNotMatchedError:r}=xe(),{kDispatches:i,kMockAgent:a,kOriginalDispatch:o,kOrigin:s,kGetNetConnect:c,kTotalDispatchCount:l}=Se(),{serializePathWithQuery:u}=T(),{STATUS_CODES:d}=e(`node:http`),{types:{isPromise:f}}=e(`node:util`),{InvalidArgumentError:p}=S();function m(e,t){return typeof e==`string`?e===t:e instanceof RegExp?e.test(t):typeof e==`function`&&e(t)===!0}function h(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e.toLocaleLowerCase(),t]))}function g(e,t){if(Array.isArray(e)){for(let n=0;n<e.length;n+=2)if(e[n].toLocaleLowerCase()===t.toLocaleLowerCase())return e[n+1];return}return typeof e.get==`function`?e.get(t):h(e)[t.toLocaleLowerCase()]}function _(e){let t=e.slice(),n=[];for(let e=0;e<t.length;e+=2)n.push([t[e],t[e+1]]);return Object.fromEntries(n)}function v(e,t){if(typeof e.headers==`function`)return Array.isArray(t)&&(t=_(t)),e.headers(t?h(t):{});if(e.headers===void 0)return!0;if(typeof t!=`object`||typeof e.headers!=`object`)return!1;for(let[n,r]of Object.entries(e.headers))if(!m(r,g(t,n)))return!1;return!0}function y(e){if(typeof e!=`string`)return e;let t=new URLSearchParams(e),n=new URLSearchParams;for(let[e,r]of t.entries()){if(e=e.replace(`[]`,``),/^(['"]).*\1$/.test(r)){n.append(e,r);continue}if(r.includes(`,`)){let t=r.split(`,`);for(let r of t)n.append(e,r);continue}n.append(e,r)}return n}function b(e){if(typeof e!=`string`)return e;let t=e.split(`?`,3);if(t.length!==2)return e;let n=new URLSearchParams(t.pop());return n.sort(),[...t,n.toString()].join(`?`)}function x(e,{path:t,method:n,body:r,headers:i}){let a=m(e.path,t),o=m(e.method,n),s=e.body===void 0||m(e.body,r),c=v(e,i);return a&&o&&s&&c}function C(e){return Buffer.isBuffer(e)||e instanceof Uint8Array||e instanceof ArrayBuffer?e:typeof e==`object`?JSON.stringify(e):e?e.toString():``}function w(e,t){let n=t.query?u(t.path,t.query):t.path,i=typeof n==`string`?b(n):n,a=O(i),o=e.filter(({consumed:e})=>!e).filter(({path:e,ignoreTrailingSlash:t})=>t?m(O(b(e)),a):m(b(e),i));if(o.length===0)throw new r(`Mock dispatch not matched for path '${i}'`);if(o=o.filter(({method:e})=>m(e,t.method)),o.length===0)throw new r(`Mock dispatch not matched for method '${t.method}' on path '${i}'`);if(o=o.filter(({body:e})=>e===void 0||m(e,t.body)),o.length===0)throw new r(`Mock dispatch not matched for body '${t.body}' on path '${i}'`);if(o=o.filter(e=>v(e,t.headers)),o.length===0){let e=typeof t.headers==`object`?JSON.stringify(t.headers):t.headers;throw new r(`Mock dispatch not matched for headers '${e}' on path '${i}'`)}return o[0]}function E(e,t,n,r){let i={timesInvoked:0,times:1,persist:!1,consumed:!1,...r},a=typeof n==`function`?{callback:n}:{...n},o={...i,...t,pending:!0,data:{error:null,...a}};return e.push(o),e[l]=(e[l]||0)+1,o}function D(e,t){let n=e.findIndex(e=>e.consumed?x(e,t):!1);n!==-1&&e.splice(n,1)}function O(e){for(;e.endsWith(`/`);)e=e.slice(0,-1);return e.length===0&&(e=`/`),e}function k(e){let{path:t,method:n,body:r,headers:i,query:a}=e;return{path:t,method:n,body:r,headers:i,query:a}}function A(e){let t=Object.keys(e),n=[];for(let r=0;r<t.length;++r){let i=t[r],a=e[i],o=Buffer.from(`${i}`);if(Array.isArray(a))for(let e=0;e<a.length;++e)n.push(o,Buffer.from(`${a[e]}`));else n.push(o,Buffer.from(`${a}`))}return n}function j(e){return d[e]||`unknown`}async function M(e){let t=[];for await(let n of e)t.push(n);return Buffer.concat(t).toString(`utf8`)}function N(e,t){let n=k(e),r=w(this[i],n);r.timesInvoked++,r.data.callback&&(r.data={...r.data,...r.data.callback(e)});let{data:{statusCode:a,data:o,headers:s,trailers:c,error:l},delay:u,persist:d}=r,{timesInvoked:p,times:m}=r;if(r.consumed=!d&&p>=m,r.pending=p<m,l!==null)return D(this[i],n),t.onError(l),!0;let h=!1,g=null;function v(e){h||(h=!0,g!==null&&(clearTimeout(g),g=null),t.onError(e))}t.onConnect?.(v,null),typeof u==`number`&&u>0?g=setTimeout(()=>{g=null,y(this[i])},u):y(this[i]);function y(r,i=o){if(h)return;let l=Array.isArray(e.headers)?_(e.headers):e.headers,u=typeof i==`function`?i({...e,headers:l}):i;if(f(u))return u.then(e=>y(r,e));if(h)return;let d=C(u),p=A(s),m=A(c);t.onHeaders?.(a,p,b,j(a)),t.onData?.(Buffer.from(d)),t.onComplete?.(m),D(r,n)}function b(){}return!0}function P(){let e=this[a],t=this[s],n=this[o];return function(a,o){if(e.isMockActive)try{N.call(this,a,o)}catch(s){if(s.code===`UND_MOCK_ERR_MOCK_NOT_MATCHED`){let u=e[c](),d=this[i][l]||this[i].length,f=`, ${this[i].filter(({consumed:e})=>!e).length} interceptor(s) remaining out of ${d} defined`;if(u===!1)throw new r(`${s.message}: subsequent request to origin ${t} was not allowed (net.connect disabled)${f}`);if(F(u,t))n.call(this,a,o);else throw new r(`${s.message}: subsequent request to origin ${t} was not allowed (net.connect is not enabled for this origin)${f}`)}else throw s}else n.call(this,a,o)}}function F(e,t){let n=new URL(t);return e===!0||!!(Array.isArray(e)&&e.some(e=>m(e,n.host)))}function I(e){return typeof e!=`string`&&!(e instanceof URL)?e:e instanceof URL?e.origin:e.toLowerCase()}function ee(e){let{agent:t,...n}=e;if(`enableCallHistory`in n&&typeof n.enableCallHistory!=`boolean`)throw new p(`options.enableCallHistory must to be a boolean`);if(`acceptNonStandardSearchParameters`in n&&typeof n.acceptNonStandardSearchParameters!=`boolean`)throw new p(`options.acceptNonStandardSearchParameters must to be a boolean`);if(`ignoreTrailingSlash`in n&&typeof n.ignoreTrailingSlash!=`boolean`)throw new p(`options.ignoreTrailingSlash must to be a boolean`);return n}n.exports={getResponseData:C,getMockDispatch:w,addMockDispatch:E,deleteMockDispatch:D,buildKey:k,generateKeyValues:A,matchValue:m,getResponse:M,getStatusText:j,mockDispatch:N,buildMockDispatch:P,checkNetConnect:F,buildAndValidateMockOptions:ee,getHeaderByName:g,buildHeadersFromArray:_,normalizeSearchParams:y,normalizeOrigin:I}})),we=t(((e,t)=>{let{getResponseData:n,buildKey:r,addMockDispatch:i}=Ce(),{kDispatches:a,kDispatchKey:o,kDefaultHeaders:s,kDefaultTrailers:c,kContentLength:l,kMockDispatch:u,kIgnoreTrailingSlash:d}=Se(),{InvalidArgumentError:f}=S(),{serializePathWithQuery:p}=T();var m=class{constructor(e){this[u]=e}delay(e){if(typeof e!=`number`||!Number.isInteger(e)||e<=0)throw new f(`waitInMs must be a valid integer > 0`);return this[u].delay=e,this}persist(){return this[u].persist=!0,this}times(e){if(typeof e!=`number`||!Number.isInteger(e)||e<=0)throw new f(`repeatTimes must be a valid integer > 0`);return this[u].times=e,this}},h=class{constructor(e,t){if(typeof e!=`object`)throw new f(`opts must be an object`);if(e.path===void 0)throw new f(`opts.path must be defined`);if(e.method===void 0&&(e.method=`GET`),typeof e.path==`string`){if(e.query)e.path=p(e.path,e.query);else{let t=new URL(e.path,`data://`);e.path=t.pathname+t.search}}typeof e.method==`string`&&(e.method=e.method.toUpperCase()),this[o]=r(e),this[a]=t,this[d]=e.ignoreTrailingSlash??!1,this[s]={},this[c]={},this[l]=!1}createMockScopeDispatchData({statusCode:e,data:t,responseOptions:r}){let i=n(t),a=this[l]?{"content-length":i.length}:{};return{statusCode:e,data:t,headers:{...this[s],...a,...r.headers},trailers:{...this[c],...r.trailers}}}validateReplyParameters(e){if(e.statusCode===void 0)throw new f(`statusCode must be defined`);if(typeof e.responseOptions!=`object`||e.responseOptions===null)throw new f(`responseOptions must be an object`)}reply(e){if(typeof e==`function`)return new m(i(this[a],this[o],t=>{let n=e(t);if(typeof n!=`object`||!n)throw new f(`reply options callback must return an object`);let r={data:``,responseOptions:{},...n};return this.validateReplyParameters(r),{...this.createMockScopeDispatchData(r)}},{ignoreTrailingSlash:this[d]}));let t={statusCode:e,data:arguments[1]===void 0?``:arguments[1],responseOptions:arguments[2]===void 0?{}:arguments[2]};this.validateReplyParameters(t);let n=this.createMockScopeDispatchData(t);return new m(i(this[a],this[o],n,{ignoreTrailingSlash:this[d]}))}replyWithError(e){if(e===void 0)throw new f(`error must be defined`);return new m(i(this[a],this[o],{error:e},{ignoreTrailingSlash:this[d]}))}defaultReplyHeaders(e){if(e===void 0)throw new f(`headers must be defined`);return this[s]=e,this}defaultReplyTrailers(e){if(e===void 0)throw new f(`trailers must be defined`);return this[c]=e,this}replyContentLength(){return this[l]=!0,this}};t.exports.MockInterceptor=h,t.exports.MockScope=m})),Te=t(((t,n)=>{let{promisify:r}=e(`node:util`),i=K(),{buildMockDispatch:a}=Ce(),{kDispatches:o,kMockAgent:s,kClose:c,kOriginalClose:l,kOrigin:u,kOriginalDispatch:d,kConnected:f,kIgnoreTrailingSlash:p}=Se(),{MockInterceptor:m}=we(),h=b(),{InvalidArgumentError:g}=S();n.exports=class extends i{constructor(e,t){if(!t||!t.agent||typeof t.agent.dispatch!=`function`)throw new g(`Argument opts.agent must implement Agent`);super(e,t),this[s]=t.agent,this[u]=e,this[p]=t.ignoreTrailingSlash??!1,this[o]=[],this[f]=1,this[d]=this.dispatch,this[l]=this.close.bind(this),this.dispatch=a.call(this),this.close=this[c]}get[h.kConnected](){return this[f]}intercept(e){return new m(e&&{ignoreTrailingSlash:this[p],...e},this[o])}cleanMocks(){this[o]=[]}async[c](){await r(this[l])(),this[f]=0,this[s][h.kClients].delete(this[u])}}})),Ee=t(((e,t)=>{let{kMockCallHistoryAddLog:n}=Se(),{InvalidArgumentError:r}=S();function i(e,t,n,i,a){switch(t.operator){case`OR`:return i.push(...n(e,a)),i;case`AND`:return n(e,i);default:throw new r(`options.operator must to be a case insensitive string equal to 'OR' or 'AND'`)}}function a(e={}){let t={};if(`operator`in e){if(typeof e.operator!=`string`||e.operator.toUpperCase()!==`OR`&&e.operator.toUpperCase()!==`AND`)throw new r(`options.operator must to be a case insensitive string equal to 'OR' or 'AND'`);return{...t,operator:e.operator.toUpperCase()}}return t}function o(e){return(t,n)=>{if(typeof t==`string`||t==null)return n.filter(n=>n[e]===t);if(t instanceof RegExp)return n.filter(n=>t.test(n[e]));throw new r(`${e} parameter should be one of string, regexp, undefined or null`)}}function s(e){try{let t=new URL(e.path,e.origin);return t.search.length===0&&(t.search=new URLSearchParams(e.query).toString()),t}catch(e){throw new r(`An error occurred when computing MockCallHistoryLog.url`,{cause:e})}}var c=class{constructor(e={}){this.body=e.body,this.headers=e.headers,this.method=e.method;let t=s(e);this.fullUrl=t.toString(),this.origin=t.origin,this.path=t.pathname,this.searchParams=Object.fromEntries(t.searchParams),this.protocol=t.protocol,this.host=t.host,this.port=t.port,this.hash=t.hash}toMap(){return new Map([[`protocol`,this.protocol],[`host`,this.host],[`port`,this.port],[`origin`,this.origin],[`path`,this.path],[`hash`,this.hash],[`searchParams`,this.searchParams],[`fullUrl`,this.fullUrl],[`method`,this.method],[`body`,this.body],[`headers`,this.headers]])}toString(){let e={betweenKeyValueSeparator:`->`,betweenPairSeparator:`|`},t=``;return this.toMap().forEach((n,r)=>{(typeof n==`string`||n==null)&&(t=`${t}${r}${e.betweenKeyValueSeparator}${n}${e.betweenPairSeparator}`),(typeof n==`object`&&n||Array.isArray(n))&&(t=`${t}${r}${e.betweenKeyValueSeparator}${JSON.stringify(n)}${e.betweenPairSeparator}`)}),t.slice(0,-1)}},l=class{logs=[];calls(){return this.logs}firstCall(){return this.logs.at(0)}lastCall(){return this.logs.at(-1)}nthCall(e){if(typeof e!=`number`)throw new r(`nthCall must be called with a number`);if(!Number.isInteger(e))throw new r(`nthCall must be called with an integer`);if(Math.sign(e)!==1)throw new r(`nthCall must be called with a positive value. use firstCall or lastCall instead`);return this.logs.at(e-1)}filterCalls(e,t){if(this.logs.length===0)return this.logs;if(typeof e==`function`)return this.logs.filter(e);if(e instanceof RegExp)return this.logs.filter(t=>e.test(t.toString()));if(typeof e==`object`&&e){if(Object.keys(e).length===0)return this.logs;let n={operator:`OR`,...a(t)},r=n.operator===`AND`?this.logs:[];return`protocol`in e&&(r=i(e.protocol,n,this.filterCallsByProtocol,r,this.logs)),`host`in e&&(r=i(e.host,n,this.filterCallsByHost,r,this.logs)),`port`in e&&(r=i(e.port,n,this.filterCallsByPort,r,this.logs)),`origin`in e&&(r=i(e.origin,n,this.filterCallsByOrigin,r,this.logs)),`path`in e&&(r=i(e.path,n,this.filterCallsByPath,r,this.logs)),`hash`in e&&(r=i(e.hash,n,this.filterCallsByHash,r,this.logs)),`fullUrl`in e&&(r=i(e.fullUrl,n,this.filterCallsByFullUrl,r,this.logs)),`method`in e&&(r=i(e.method,n,this.filterCallsByMethod,r,this.logs)),[...new Set(r)]}throw new r(`criteria parameter should be one of function, regexp, or object`)}filterCallsByProtocol=o.call(this,`protocol`);filterCallsByHost=o.call(this,`host`);filterCallsByPort=o.call(this,`port`);filterCallsByOrigin=o.call(this,`origin`);filterCallsByPath=o.call(this,`path`);filterCallsByHash=o.call(this,`hash`);filterCallsByFullUrl=o.call(this,`fullUrl`);filterCallsByMethod=o.call(this,`method`);clear(){this.logs=[]}[n](e){let t=new c(e);return this.logs.push(t),t}*[Symbol.iterator](){for(let e of this.calls())yield e}};t.exports.MockCallHistory=l,t.exports.MockCallHistoryLog=c})),De=t(((t,n)=>{let{promisify:r}=e(`node:util`),i=ce(),{buildMockDispatch:a}=Ce(),{kDispatches:o,kMockAgent:s,kClose:c,kOriginalClose:l,kOrigin:u,kOriginalDispatch:d,kConnected:f,kIgnoreTrailingSlash:p}=Se(),{MockInterceptor:m}=we(),h=b(),{InvalidArgumentError:g}=S();n.exports=class extends i{constructor(e,t){if(!t||!t.agent||typeof t.agent.dispatch!=`function`)throw new g(`Argument opts.agent must implement Agent`);super(e,t),this[s]=t.agent,this[u]=e,this[p]=t.ignoreTrailingSlash??!1,this[o]=[],this[f]=1,this[d]=this.dispatch,this[l]=this.close.bind(this),this.dispatch=a.call(this),this.close=this[c]}get[h.kConnected](){return this[f]}intercept(e){return new m(e&&{ignoreTrailingSlash:this[p],...e},this[o])}cleanMocks(){this[o]=[]}async[c](){await r(this[l])(),this[f]=0,this[s][h.kClients].delete(this[u])}}})),Oe=t(((t,n)=>{let{Transform:r}=e(`node:stream`),{Console:i}=e(`node:console`),a=process.versions.icu?`✅`:`Y `,o=process.versions.icu?`❌`:`N `;n.exports=class{constructor({disableColors:e}={}){this.transform=new r({transform(e,t,n){n(null,e)}}),this.logger=new i({stdout:this.transform,inspectOptions:{colors:!e&&!process.env.CI}})}format(e){let t=e.map(({method:e,path:t,data:{statusCode:n},persist:r,times:i,timesInvoked:s,origin:c})=>({Method:e,Origin:c,Path:t,"Status code":n,Persistent:r?a:o,Invocations:s,Remaining:r?1/0:i-s}));return this.logger.table(t),this.transform.read().toString()}}})),ke=t(((e,t)=>{let{kClients:n}=b(),r=Y(),{kAgent:i,kMockAgentSet:a,kMockAgentGet:o,kDispatches:s,kIsMockActive:c,kNetConnect:l,kGetNetConnect:u,kOptions:d,kFactory:f,kMockAgentRegisterCallHistory:p,kMockAgentIsCallHistoryEnabled:m,kMockAgentAddCallHistoryLog:h,kMockAgentMockCallHistoryInstance:g,kMockAgentAcceptsNonStandardSearchParameters:_,kMockCallHistoryAddLog:v,kIgnoreTrailingSlash:y}=Se(),x=Te(),C=De(),{matchValue:w,normalizeSearchParams:T,buildAndValidateMockOptions:E,normalizeOrigin:D}=Ce(),{InvalidArgumentError:O,UndiciError:k}=S(),j=A(),M=Oe(),{MockCallHistory:N}=Ee();t.exports=class extends j{constructor(e={}){super(e);let t=E(e);if(this[l]=!0,this[c]=!0,this[m]=t.enableCallHistory??!1,this[_]=t.acceptNonStandardSearchParameters??!1,this[y]=t.ignoreTrailingSlash??!1,e?.agent&&typeof e.agent.dispatch!=`function`)throw new O(`Argument opts.agent must implement Agent`);let a=e?.agent?e.agent:new r(e);this[i]=a,this[n]=a[n],this[d]=t,this[m]&&this[p]()}get(e){let t=D(e),n=this[y]?t.replace(/\/$/,``):t,r=this[o](n);return r||(r=this[f](n),this[a](n,r)),r}dispatch(e,t){e.origin=D(e.origin),this.get(e.origin),this[h](e);let n=this[_],r={...e};if(n&&r.path){let[e,t]=r.path.split(`?`);r.path=`${e}?${T(t,n)}`}return this[i].dispatch(r,t)}async close(){this.clearCallHistory(),await this[i].close(),this[n].clear()}deactivate(){this[c]=!1}activate(){this[c]=!0}enableNetConnect(e){if(typeof e==`string`||typeof e==`function`||e instanceof RegExp)Array.isArray(this[l])?this[l].push(e):this[l]=[e];else if(e===void 0)this[l]=!0;else throw new O(`Unsupported matcher. Must be one of String|Function|RegExp.`)}disableNetConnect(){this[l]=!1}enableCallHistory(){return this[m]=!0,this}disableCallHistory(){return this[m]=!1,this}getCallHistory(){return this[g]}clearCallHistory(){this[g]!==void 0&&this[g].clear()}get isMockActive(){return this[c]}[p](){this[g]===void 0&&(this[g]=new N)}[h](e){this[m]&&(this[p](),this[g][v](e))}[a](e,t){this[n].set(e,{count:0,dispatcher:t})}[f](e){let t=Object.assign({agent:this},this[d]);return this[d]&&this[d].connections===1?new x(e,t):new C(e,t)}[o](e){let t=this[n].get(e);if(t?.dispatcher)return t.dispatcher;if(typeof e!=`string`){let t=this[f](`http://localhost:9999`);return this[a](e,t),t}for(let[t,r]of Array.from(this[n]))if(r&&typeof t!=`string`&&w(t,e)){let t=this[f](e);return this[a](e,t),t[s]=r.dispatcher[s],t}}[u](){return this[l]}pendingInterceptors(){let e=this[n];return Array.from(e.entries()).flatMap(([e,t])=>t.dispatcher[s].map(t=>({...t,origin:e}))).filter(({pending:e})=>e)}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new M}={}){let t=this.pendingInterceptors();if(t.length!==0)throw new k(t.length===1?`1 interceptor is pending:\n\n${e.format(t)}`.trim():`${t.length} interceptors are pending:\n\n${e.format(t)}`.trim())}}})),Ae=t(((t,n)=>{let{InvalidArgumentError:r}=S(),{runtimeFeatures:i}=H();function a(e={}){let{ignoreHeaders:t=[],excludeHeaders:n=[],matchHeaders:r=[],caseSensitive:i=!1}=e;return{ignore:new Set(t.map(e=>i?e:e.toLowerCase())),exclude:new Set(n.map(e=>i?e:e.toLowerCase())),match:new Set(r.map(e=>i?e:e.toLowerCase()))}}let o=i.has(`crypto`)?e(`node:crypto`):null,s=o?.hash?e=>o.hash(`sha256`,e,`base64url`):e=>Buffer.from(e).toString(`base64url`);function c(e){return Array.isArray(e)&&!(e.length&1)}function l(e=[]){return e.length===0?()=>!1:function(t){let n;for(let r of e)if(typeof r==`string`){if(n||=t.toLowerCase(),n.includes(r.toLowerCase()))return!0}else if(r instanceof RegExp&&r.test(t))return!0;return!1}}function u(e){let t={};if(!e)return t;if(c(e)){for(let n=0;n<e.length;n+=2){let r=e[n],i=e[n+1];if(r&&i!==void 0){let e=Buffer.isBuffer(r)?r.toString():r,n=Buffer.isBuffer(i)?i.toString():i;t[e.toLowerCase()]=n}}return t}if(e&&typeof e==`object`)for(let[n,r]of Object.entries(e))n&&typeof n==`string`&&(t[n.toLowerCase()]=Array.isArray(r)?r.join(`, `):String(r));return t}let d=[`record`,`playback`,`update`];function f(e){if(!d.includes(e))throw new r(`Invalid snapshot mode: ${e}. Must be one of: ${d.join(`, `)}`)}n.exports={createHeaderFilters:a,hashId:s,isUndiciHeaders:c,normalizeHeaders:u,isUrlExcludedFactory:l,validateSnapshotMode:f}})),je=t(((t,n)=>{let{writeFile:r,readFile:i,mkdir:a}=e(`node:fs/promises`),{dirname:o,resolve:s}=e(`node:path`),{setTimeout:c,clearTimeout:l}=e(`node:timers`),{InvalidArgumentError:u,UndiciError:d}=S(),{hashId:f,isUrlExcludedFactory:p,normalizeHeaders:m,createHeaderFilters:h}=Ae();function g(e,t,n={}){let r=new URL(e.path,e.origin),i=e._normalizedHeaders||m(e.headers);return e._normalizedHeaders||=i,{method:e.method||`GET`,url:n.matchQuery===!1?`${r.origin}${r.pathname}`:r.toString(),headers:_(i,t,n),body:n.matchBody!==!1&&e.body?String(e.body):``}}function _(e,t,n={}){if(!e||typeof e!=`object`)return{};let{caseSensitive:r=!1}=n,i={},{ignore:a,exclude:o,match:s}=t;for(let[t,n]of Object.entries(e)){let e=r?t:t.toLowerCase();o.has(e)||a.has(e)||(s.size===0||s.has(e))&&(i[e]=n)}return i}function v(e,t,n={}){if(!e||typeof e!=`object`)return{};let{caseSensitive:r=!1}=n,i={},{exclude:a}=t;for(let[t,n]of Object.entries(e)){let e=r?t:t.toLowerCase();a.has(e)||(i[e]=n)}return i}function y(e){let t=[e.method,e.url];if(e.headers&&typeof e.headers==`object`){let n=Object.keys(e.headers).sort();for(let r of n){let n=Array.isArray(e.headers[r])?e.headers[r]:[e.headers[r]];t.push(r);for(let e of n.sort())t.push(String(e))}}t.push(e.body);let n=t.join(`|`);return f(n)}n.exports={SnapshotRecorder:class{#e;#t;#n=new Map;#r;#i=1/0;#a=!1;#o;constructor(e={}){this.#r=e.snapshotPath,this.#i=e.maxSnapshots||1/0,this.#a=e.autoFlush||!1,this.flushInterval=e.flushInterval||3e4,this._flushTimer=null,this.matchOptions={matchHeaders:e.matchHeaders||[],ignoreHeaders:e.ignoreHeaders||[],excludeHeaders:e.excludeHeaders||[],matchBody:e.matchBody!==!1,matchQuery:e.matchQuery!==!1,caseSensitive:e.caseSensitive||!1},this.#o=h(this.matchOptions),this.shouldRecord=e.shouldRecord||(()=>!0),this.shouldPlayback=e.shouldPlayback||(()=>!0),this.#t=p(e.excludeUrls),this.#a&&this.#r&&this.#s()}async record(e,t){if(!this.shouldRecord(e)||this.isUrlExcluded(e))return;let n=g(e,this.#o,this.matchOptions),r=y(n),i=m(t.headers),a={statusCode:t.statusCode,headers:v(i,this.#o,this.matchOptions),body:Buffer.isBuffer(t.body)?t.body.toString(`base64`):Buffer.from(String(t.body||``)).toString(`base64`),trailers:t.trailers};if(this.#n.size>=this.#i&&!this.#n.has(r)){let e=this.#n.keys().next().value;this.#n.delete(e)}let o=this.#n.get(r);o&&o.responses?(o.responses.push(a),o.timestamp=new Date().toISOString()):this.#n.set(r,{request:n,responses:[a],callCount:0,timestamp:new Date().toISOString()}),this.#a&&this.#r&&this.#l()}isUrlExcluded(e){let t=new URL(e.path,e.origin).toString();return this.#t(t)}findSnapshot(e){if(!this.shouldPlayback(e)||this.isUrlExcluded(e))return;let t=y(g(e,this.#o,this.matchOptions)),n=this.#n.get(t);if(!n)return;let r=n.callCount||0,i=Math.min(r,n.responses.length-1);return n.callCount=r+1,{...n,response:n.responses[i]}}async loadSnapshots(e){let t=e||this.#r;if(!t)throw new u(`Snapshot path is required`);try{let e=await i(s(t),`utf8`),n=JSON.parse(e);if(Array.isArray(n)){this.#n.clear();for(let{hash:e,snapshot:t}of n)this.#n.set(e,t)}else this.#n=new Map(Object.entries(n))}catch(e){if(e.code===`ENOENT`)this.#n.clear();else throw new d(`Failed to load snapshots from ${t}`,{cause:e})}}async saveSnapshots(e){let t=e||this.#r;if(!t)throw new u(`Snapshot path is required`);let n=s(t);await a(o(n),{recursive:!0});let i=Array.from(this.#n.entries()).map(([e,t])=>({hash:e,snapshot:t}));await r(n,JSON.stringify(i,null,2),{flush:!0})}clear(){this.#n.clear()}getSnapshots(){return Array.from(this.#n.values())}size(){return this.#n.size}resetCallCounts(){for(let e of this.#n.values())e.callCount=0}deleteSnapshot(e){let t=y(g(e,this.#o,this.matchOptions));return this.#n.delete(t)}getSnapshotInfo(e){let t=y(g(e,this.#o,this.matchOptions)),n=this.#n.get(t);return n?{hash:t,request:n.request,responseCount:n.responses?n.responses.length:+!!n.response,callCount:n.callCount||0,timestamp:n.timestamp}:null}replaceSnapshots(e){if(this.#n.clear(),Array.isArray(e))for(let{hash:t,snapshot:n}of e)this.#n.set(t,n);else e&&typeof e==`object`&&(this.#n=new Map(Object.entries(e)))}#s(){return this.#l()}#c(){this.#e&&=(l(this.#e),this.saveSnapshots().catch(()=>{}),null)}#l(){this.#e=c(()=>{this.saveSnapshots().catch(()=>{}),this.#a?this.#e?.refresh():this.#e=null},1e3)}destroy(){this.#c(),this.#e&&=(l(this.#e),null)}async close(){this.#r&&this.#n.size!==0&&await this.saveSnapshots(),this.destroy()}},formatRequestKey:g,createRequestHash:y,filterHeadersForMatching:_,filterHeadersForStorage:v,createHeaderFilters:h}})),Me=t(((e,t)=>{let n=Y(),r=ke(),{SnapshotRecorder:i}=je(),a=k(),{InvalidArgumentError:o,UndiciError:s}=S(),{validateSnapshotMode:c}=Ae(),l=Symbol(`kSnapshotRecorder`),u=Symbol(`kSnapshotMode`),d=Symbol(`kSnapshotPath`),f=Symbol(`kSnapshotLoaded`),p=Symbol(`kRealAgent`),m=!1;t.exports=class extends r{constructor(e={}){m||=(process.emitWarning(`SnapshotAgent is experimental and subject to change`,`ExperimentalWarning`),!0);let{mode:t=`record`,snapshotPath:r=null,...a}=e;if(super(a),c(t),(t===`playback`||t===`update`)&&!r)throw new o(`snapshotPath is required when mode is '${t}'`);this[u]=t,this[d]=r,this[l]=new i({snapshotPath:this[d],mode:this[u],maxSnapshots:e.maxSnapshots,autoFlush:e.autoFlush,flushInterval:e.flushInterval,matchHeaders:e.matchHeaders,ignoreHeaders:e.ignoreHeaders,excludeHeaders:e.excludeHeaders,matchBody:e.matchBody,matchQuery:e.matchQuery,caseSensitive:e.caseSensitive,shouldRecord:e.shouldRecord,shouldPlayback:e.shouldPlayback,excludeUrls:e.excludeUrls}),this[f]=!1,(this[u]===`record`||this[u]===`update`||this[u]===`playback`&&e.excludeUrls&&e.excludeUrls.length>0)&&(this[p]=new n(e)),(this[u]===`playback`||this[u]===`update`)&&this[d]&&this.loadSnapshots().catch(()=>{})}dispatch(e,t){t=a.wrap(t);let n=this[u];if(this[l].isUrlExcluded(e))return this[p].dispatch(e,t);if(n===`playback`||n===`update`){if(!this[f])return this.#e(e,t);let r=this[l].findSnapshot(e);if(r)return this.#n(r,t);if(n===`update`)return this.#t(e,t);{let n=new s(`No snapshot found for ${e.method||`GET`} ${e.path}`);if(t.onError){t.onError(n);return}throw n}}if(n===`record`)return this.#t(e,t)}async#e(e,t){return await this.loadSnapshots(),this.dispatch(e,t)}#t(e,t){let n={statusCode:null,headers:{},trailers:{},body:[]},r=this;return this[p].dispatch(e,{onRequestStart(e,n){return t.onRequestStart(e,{...n,history:this.history})},onRequestUpgrade(e,n,r,i){return t.onRequestUpgrade(e,n,r,i)},onResponseStart(e,r,i,a){return n.statusCode=r,n.headers=i,t.onResponseStart(e,r,i,a)},onResponseData(e,r){return n.body.push(r),t.onResponseData(e,r)},onResponseEnd(i,a){n.trailers=a;let o=Buffer.concat(n.body);r[l].record(e,{statusCode:n.statusCode,headers:n.headers,body:o,trailers:n.trailers}).then(()=>t.onResponseEnd(i,a)).catch(e=>t.onResponseError(i,e))}})}#n(e,t){try{let{response:n}=e,r={pause(){},resume(){},abort(e){this.aborted=!0,this.reason=e},aborted:!1,paused:!1};t.onRequestStart(r),t.onResponseStart(r,n.statusCode,n.headers);let i=Buffer.from(n.body,`base64`);t.onResponseData(r,i),t.onResponseEnd(r,n.trailers)}catch(e){t.onError?.(e)}}async loadSnapshots(e){await this[l].loadSnapshots(e||this[d]),this[f]=!0,this[u]===`playback`&&this.#r()}async saveSnapshots(e){return this[l].saveSnapshots(e||this[d])}#r(){for(let e of this[l].getSnapshots()){let{request:t,responses:n,response:r}=e,i=new URL(t.url),a=this.get(i.origin),o=n?n[0]:r;o&&a.intercept({path:i.pathname+i.search,method:t.method,headers:t.headers,body:t.body}).reply(o.statusCode,o.body,{headers:o.headers,trailers:o.trailers}).persist()}}getRecorder(){return this[l]}getMode(){return this[u]}clearSnapshots(){this[l].clear()}resetCallCounts(){this[l].resetCallCounts()}deleteSnapshot(e){return this[l].deleteSnapshot(e)}getSnapshotInfo(e){return this[l].getSnapshotInfo(e)}replaceSnapshots(e){this[l].replaceSnapshots(e)}async close(){await this[l].close(),await this[p]?.close(),await super.close()}}})),Ne=t(((e,t)=>{let n=Symbol.for(`undici.globalDispatcher.2`),r=Symbol.for(`undici.globalDispatcher.1`),{InvalidArgumentError:i}=S(),a=Y();s()===void 0&&o(new a);function o(e){if(!e||typeof e.dispatch!=`function`)throw new i(`Argument agent must implement Agent`);Object.defineProperty(globalThis,n,{value:e,writable:!0,enumerable:!1,configurable:!1}),Object.defineProperty(globalThis,r,{value:e,writable:!0,enumerable:!1,configurable:!1})}function s(){return globalThis[r]}t.exports={setGlobalDispatcher:o,getGlobalDispatcher:s,installedExports:[`fetch`,`Headers`,`Response`,`Request`,`FormData`,`WebSocket`,`CloseEvent`,`ErrorEvent`,`MessageEvent`,`EventSource`]}})),Pe=t(((t,n)=>{let r=e(`node:assert`),i=k();n.exports=class{#e;#t=!1;#n=!1;#r=!1;constructor(e){if(typeof e!=`object`||!e)throw TypeError(`handler must be an object`);this.#e=i.wrap(e)}onRequestStart(...e){this.#e.onRequestStart?.(...e)}onRequestUpgrade(...e){return r(!this.#t),r(!this.#n),this.#e.onRequestUpgrade?.(...e)}onResponseStart(...e){return r(!this.#t),r(!this.#n),r(!this.#r),this.#r=!0,this.#e.onResponseStart?.(...e)}onResponseData(...e){return r(!this.#t),r(!this.#n),this.#e.onResponseData?.(...e)}onResponseEnd(...e){return r(!this.#t),r(!this.#n),this.#t=!0,this.#e.onResponseEnd?.(...e)}onResponseError(...e){return this.#n=!0,this.#e.onResponseError?.(...e)}onBodySent(){}}})),Fe=t(((t,n)=>{let r=T(),{kBodyUsed:i}=b(),a=e(`node:assert`),{InvalidArgumentError:o}=S(),s=e(`node:events`),c=[300,301,302,303,307,308],l=Symbol(`body`),u=()=>{};var d=class{constructor(e){this[l]=e,this[i]=!1}async*[Symbol.asyncIterator](){a(!this[i],`disturbed`),this[i]=!0,yield*this[l]}},f=class e{static buildDispatch(t,n){if(n!=null&&(!Number.isInteger(n)||n<0))throw new o(`maxRedirections must be a positive number`);let r=t.dispatch.bind(t);return(t,i)=>r(t,new e(r,n,t,i))}constructor(e,t,n,c){if(t!=null&&(!Number.isInteger(t)||t<0))throw new o(`maxRedirections must be a positive number`);this.dispatch=e,this.location=null;let{maxRedirections:l,...u}=n;this.opts=u,this.maxRedirections=t,this.handler=c,this.history=[],r.isStream(this.opts.body)?(r.bodyLength(this.opts.body)===0&&this.opts.body.on(`data`,function(){a(!1)}),typeof this.opts.body.readableDidRead!=`boolean`&&(this.opts.body[i]=!1,s.prototype.on.call(this.opts.body,`data`,function(){this[i]=!0}))):(this.opts.body&&typeof this.opts.body.pipeTo==`function`||this.opts.body&&typeof this.opts.body!=`string`&&!ArrayBuffer.isView(this.opts.body)&&r.isIterable(this.opts.body)&&!r.isFormDataLike(this.opts.body))&&(this.opts.body=new d(this.opts.body))}onRequestStart(e,t){this.handler.onRequestStart?.(e,{...t,history:this.history})}onRequestUpgrade(e,t,n,r){this.handler.onRequestUpgrade?.(e,t,n,r)}onResponseStart(e,t,n,i){if(this.opts.throwOnMaxRedirect&&this.history.length>=this.maxRedirections)throw Error(`max redirects`);if((t===301||t===302)&&this.opts.method===`POST`&&(this.opts.method=`GET`,r.isStream(this.opts.body)&&r.destroy(this.opts.body.on(`error`,u)),this.opts.body=null),t===303&&this.opts.method!==`HEAD`&&(this.opts.method=`GET`,r.isStream(this.opts.body)&&r.destroy(this.opts.body.on(`error`,u)),this.opts.body=null),this.location=this.history.length>=this.maxRedirections||r.isDisturbed(this.opts.body)||c.indexOf(t)===-1?null:n.location,this.opts.origin&&this.history.push(new URL(this.opts.path,this.opts.origin)),!this.location){this.handler.onResponseStart?.(e,t,n,i);return}let{origin:a,pathname:s,search:l}=r.parseURL(new URL(this.location,this.opts.origin&&new URL(this.opts.path,this.opts.origin))),d=l?`${s}${l}`:s,f=`${a}${d}`;for(let e of this.history)if(e.toString()===f)throw new o(`Redirect loop detected. Cannot redirect to ${a}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`);this.opts.headers=m(this.opts.headers,t===303,this.opts.origin!==a),this.opts.path=d,this.opts.origin=a,this.opts.query=null}onResponseData(e,t){this.location||this.handler.onResponseData?.(e,t)}onResponseEnd(e,t){this.location?this.dispatch(this.opts,this):this.handler.onResponseEnd(e,t)}onResponseError(e,t){this.handler.onResponseError?.(e,t)}};function p(e,t,n){if(e.length===4)return r.headerNameToString(e)===`host`;if(t&&r.headerNameToString(e).startsWith(`content-`))return!0;if(n&&(e.length===13||e.length===6||e.length===19)){let t=r.headerNameToString(e);return t===`authorization`||t===`cookie`||t===`proxy-authorization`}return!1}function m(e,t,n){let i=[];if(Array.isArray(e))for(let r=0;r<e.length;r+=2)p(e[r],t,n)||i.push(e[r],e[r+1]);else if(e&&typeof e==`object`){let a=r.hasSafeIterator(e)?e:Object.entries(e);for(let[e,r]of a)p(e,t,n)||i.push(e,r)}else a(e==null,`headers must be an object or an array`);return i}n.exports=f})),Ie=t(((e,t)=>{let n=Fe();function r({maxRedirections:e}={}){return t=>function(r,i){let{maxRedirections:a=e,...o}=r;if(a==null||a===0)return t(r,i);let s={...o};return t(s,new n(t,a,s,i))}}t.exports=r})),Le=t(((e,t)=>{let n=Pe(),{ResponseError:r}=S();var i=class extends n{#e;#t;#n;#r;#i;constructor(e,{handler:t}){super(t)}#a(e){return(this.#t??``).indexOf(e)===0}onRequestStart(e,t){return this.#e=0,this.#t=null,this.#n=null,this.#r=null,this.#i=``,super.onRequestStart(e,t)}onResponseStart(e,t,n,r){if(this.#e=t,this.#r=n,this.#t=n[`content-type`],this.#e<400)return super.onResponseStart(e,t,n,r);(this.#a(`application/json`)||this.#a(`text/plain`))&&(this.#n=new TextDecoder(`utf-8`))}onResponseData(e,t){if(this.#e<400)return super.onResponseData(e,t);this.#i+=this.#n?.decode(t,{stream:!0})??``}onResponseEnd(e,t){if(this.#e>=400){if(this.#i+=this.#n?.decode(void 0,{stream:!1})??``,this.#a(`application/json`))try{this.#i=JSON.parse(this.#i)}catch{}let t,n=Error.stackTraceLimit;Error.stackTraceLimit=0;try{t=new r(`Response Error`,this.#e,{body:this.#i,headers:this.#r})}finally{Error.stackTraceLimit=n}super.onResponseError(e,t)}else super.onResponseEnd(e,t)}onResponseError(e,t){super.onResponseError(e,t)}};t.exports=()=>e=>function(t,n){return e(t,new i(t,{handler:n}))}})),Re=t(((e,t)=>{let n=Q();t.exports=e=>t=>function(r,i){return t(r,new n({...r,retryOptions:{...e,...r.retryOptions}},{handler:i,dispatch:t}))}})),ze=t(((e,t)=>{let{InvalidArgumentError:n,RequestAbortedError:r}=S(),i=Pe();var a=class extends i{#e=1048576;#t=!1;#n=0;#r=null;aborted=!1;reason=!1;constructor({maxSize:e,signal:t},r){if(e!=null&&(!Number.isFinite(e)||e<1))throw new n(`maxSize must be a number greater than 0`);super(r),this.#e=e??this.#e}#i(e){this.aborted=!0,this.reason=e}onRequestStart(e,t){return e.abort=this.#i.bind(this),this.#r=e,super.onRequestStart(e,t)}onResponseStart(e,t,n,i){let a=n[`content-length`];if(a!=null&&a>this.#e)throw new r(`Response size (${a}) larger than maxSize (${this.#e})`);return this.aborted===!0||super.onResponseStart(e,t,n,i)}onResponseError(e,t){this.#t||(t=this.#r?.reason??t,super.onResponseError(e,t))}onResponseData(e,t){return this.#n+=t.length,this.#n>=this.#e&&(this.#t=!0,this.aborted===!0?super.onResponseError(e,this.reason):super.onResponseEnd(e,{})),!0}onResponseEnd(e,t){if(!this.#t){if(this.#r.aborted===!0){super.onResponseError(e,this.reason);return}super.onResponseEnd(e,t)}}};function o({maxSize:e}={maxSize:1048576}){return t=>function(n,r){let{dumpMaxSize:i=e}=n;return t(n,new a({maxSize:i,signal:n.signal},r))}}t.exports=o})),Be=t(((t,n)=>{let{isIP:r}=e(`node:net`),{lookup:i}=e(`node:dns`),a=Pe(),{InvalidArgumentError:o,InformationalError:s}=S(),c=2**31-1;function l(e){let t=Object.getPrototypeOf(e);return Object.prototype.hasOwnProperty.call(e,Symbol.iterator)||t!=null&&t!==Object.prototype&&typeof e[Symbol.iterator]==`function`}function u(e){return typeof e==`string`&&e.toLowerCase()===`host`}function d(e){if(e==null)return null;if(Array.isArray(e)){if(e.length===0||!Array.isArray(e[0]))return e;let t=[];for(let n of e)Array.isArray(n)&&n.length===2?t.push(n[0],n[1]):t.push(n);return t}if(typeof e==`object`&&l(e)){let t=[];for(let n of e)Array.isArray(n)&&n.length===2?t.push(n[0],n[1]):t.push(n);return t}return e}function f(e){if(e==null)return!1;if(Array.isArray(e)){if(e.length===0)return!1;for(let t=0;t<e.length;t+=2)if(u(e[t]))return!0;return!1}if(typeof e==`object`){for(let t in e)if(u(t))return!0}return!1}function p(e,t){let n=d(t);return f(n)?n:Array.isArray(n)?[`host`,e,...n]:n&&typeof n==`object`?{host:e,...n}:{host:e}}var m=class{#e=0;#t=new Map;constructor(e){this.#e=e.maxItems}get size(){return this.#t.size}get(e){return this.#t.get(e)??null}set(e,t){this.#t.set(e,t)}delete(e){this.#t.delete(e)}full(){return this.size>=this.#e}},h=class{#e=0;#t=0;dualStack=!0;affinity=null;lookup=null;pick=null;storage=null;constructor(e){this.#e=e.maxTTL,this.#t=e.maxItems,this.dualStack=e.dualStack,this.affinity=e.affinity,this.lookup=e.lookup??this.#n,this.pick=e.pick??this.#r,this.storage=e.storage??new m(e)}runLookup(e,t,n){let r=this.storage.get(e.hostname);if(r==null&&this.storage.full()){n(null,e);return}let i={affinity:this.affinity,dualStack:this.dualStack,lookup:this.lookup,pick:this.pick,...t.dns,maxTTL:this.#e,maxItems:this.#t};if(r==null)this.lookup(e,i,(t,r)=>{if(t||r==null||r.length===0){n(t??new s(`No DNS entries found`));return}this.setRecords(e,r);let a=this.storage.get(e.hostname),o=this.pick(e,a,i.affinity),c;c=typeof o.port==`number`?`:${o.port}`:e.port===``?``:`:${e.port}`,n(null,new URL(`${e.protocol}//${o.family===6?`[${o.address}]`:o.address}${c}`))});else{let a=this.pick(e,r,i.affinity);if(a==null){this.storage.delete(e.hostname),this.runLookup(e,t,n);return}let o;o=typeof a.port==`number`?`:${a.port}`:e.port===``?``:`:${e.port}`,n(null,new URL(`${e.protocol}//${a.family===6?`[${a.address}]`:a.address}${o}`))}}#n(e,t,n){i(e.hostname,{all:!0,family:this.dualStack===!1?this.affinity:0,order:`ipv4first`},(e,t)=>{if(e)return n(e);let r=new Map;for(let e of t)r.set(`${e.address}:${e.family}`,e);n(null,r.values())})}#r(e,t,n){let r=null,{records:i,offset:a}=t,o;if(this.dualStack?(n??(a==null||a===c?(t.offset=0,n=4):(t.offset++,n=(t.offset&1)==1?6:4)),o=i[n]!=null&&i[n].ips.length>0?i[n]:i[n===4?6:4]):o=i[n],o==null||o.ips.length===0)return r;o.offset==null||o.offset===c?o.offset=0:o.offset++;let s=o.offset%o.ips.length;return r=o.ips[s]??null,r==null?r:Date.now()-r.timestamp>r.ttl?(o.ips.splice(s,1),this.pick(e,t,n)):r}pickFamily(e,t){let n=this.storage.get(e.hostname)?.records;if(!n)return null;let r=n[t];if(!r)return null;r.offset==null||r.offset===c?r.offset=0:r.offset++;let i=r.offset%r.ips.length,a=r.ips[i]??null;return a==null||Date.now()-a.timestamp>a.ttl&&r.ips.splice(i,1),a}setRecords(e,t){let n=Date.now(),r={records:{4:null,6:null}},i=this.#e;for(let e of t){e.timestamp=n,typeof e.ttl==`number`?(e.ttl=Math.min(e.ttl,this.#e),i=Math.min(i,e.ttl)):e.ttl=this.#e;let t=r.records[e.family]??{ips:[]};t.ips.push(e),r.records[e.family]=t}this.storage.set(e.hostname,r,{ttl:i})}deleteRecords(e){this.storage.delete(e.hostname)}getHandler(e,t){return new g(this,e,t)}},g=class extends a{#e=null;#t=null;#n=null;#r=null;#i=null;#a=!0;constructor(e,{origin:t,handler:n,dispatch:r,newOrigin:i},a){super(n),this.#r=t,this.#i=i,this.#t={...a},this.#e=e,this.#n=r}onResponseError(e,t){switch(t.code){case`ETIMEDOUT`:case`ECONNREFUSED`:if(this.#e.dualStack){if(!this.#a){super.onResponseError(e,t);return}this.#a=!1;let n=this.#i.hostname[0]===`[`?4:6,r=this.#e.pickFamily(this.#r,n);if(r==null){super.onResponseError(e,t);return}let i;i=typeof r.port==`number`?`:${r.port}`:this.#r.port===``?``:`:${this.#r.port}`;let a={...this.#t,origin:`${this.#r.protocol}//${r.family===6?`[${r.address}]`:r.address}${i}`,headers:p(this.#r.host,this.#t.headers)};this.#n(a,this);return}super.onResponseError(e,t);break;case`ENOTFOUND`:this.#e.deleteRecords(this.#r),super.onResponseError(e,t);break;default:super.onResponseError(e,t)}}};n.exports=e=>{if(e?.maxTTL!=null&&(typeof e?.maxTTL!=`number`||e?.maxTTL<0))throw new o(`Invalid maxTTL. Must be a positive number`);if(e?.maxItems!=null&&(typeof e?.maxItems!=`number`||e?.maxItems<1))throw new o(`Invalid maxItems. Must be a positive number and greater than zero`);if(e?.affinity!=null&&e?.affinity!==4&&e?.affinity!==6)throw new o(`Invalid affinity. Must be either 4 or 6`);if(e?.dualStack!=null&&typeof e?.dualStack!=`boolean`)throw new o(`Invalid dualStack. Must be a boolean`);if(e?.lookup!=null&&typeof e?.lookup!=`function`)throw new o(`Invalid lookup. Must be a function`);if(e?.pick!=null&&typeof e?.pick!=`function`)throw new o(`Invalid pick. Must be a function`);if(e?.storage!=null&&(typeof e?.storage?.get!=`function`||typeof e?.storage?.set!=`function`||typeof e?.storage?.full!=`function`||typeof e?.storage?.delete!=`function`))throw new o(`Invalid storage. Must be a object with methods: { get, set, full, delete }`);let t=e?.dualStack??!0,n;n=t?e?.affinity??null:e?.affinity??4;let i=new h({maxTTL:e?.maxTTL??1e4,lookup:e?.lookup??null,pick:e?.pick??null,dualStack:t,affinity:n,maxItems:e?.maxItems??1/0,storage:e?.storage});return e=>function(t,n){let a=t.origin.constructor===URL?t.origin:new URL(t.origin);return r(a.hostname)===0?(i.runLookup(a,t,(r,o)=>{if(r)return n.onResponseError(null,r);e({...t,servername:a.hostname,origin:o.origin,headers:p(a.host,t.headers)},i.getHandler({origin:a,dispatch:e,handler:n,newOrigin:o},t))}),!0):e(t,n)}}})),Ve=t(((e,t)=>{let{safeHTTPMethods:n,pathHasQueryOrFragment:r,hasSafeIterator:i,isValidHTTPToken:a}=T(),{serializePathWithQuery:o}=T(),s=[`no-store`,`private`,`no-cache`],c=Symbol(`invalid cache-control directives`);function l(e){return e.replace(/^[\t ]+|[\t ]+$/g,``)}function u(e,t){for(let n=0;n<e.length;n++)if(e[n]===t)return!0;return!1}function d(e){return e.replace(/^[\t ]+/,``)}function f(e){return e.replace(/[\t ]+$/,``)}function p(e,t){let n=!1;for(let r=t;r<e.length;r++)if(n)n=!1;else if(e[r]===`\\`)n=!0;else if(e[r]===`"`)return r;return-1}function m(e){let t=[],n=0,r=-1,i=!1,a=!1;for(let o=0;o<e.length;o++)i?a?a=!1:e[o]===`\\`?a=!0:e[o]===`"`&&(i=!1,r=-1):e[o]===`"`?(i=!0,r=o):e[o]===`,`&&(t.push({value:e.substring(n,o),fromMalformedQuote:!1}),n=o+1);if(!i)return t.push({value:e.substring(n),fromMalformedQuote:!1}),t;let o=e.substring(n),s=r-n,c=0;for(let e=0;e<o.length;e++)o[e]===`,`&&(t.push({value:o.substring(c,e),fromMalformedQuote:c>s}),c=e+1);return t.push({value:o.substring(c),fromMalformedQuote:c>s}),t}function h(e,t){let n=e[c];n===void 0&&(n=new Set,Object.defineProperty(e,c,{value:n})),n.add(t)}function g(e,t){return e[c]?.has(t)===!0}function _(e){for(let t of s)if(e.startsWith(t)&&e.length>t.length&&!a(e[t.length]))return t;let t=``,n=!1;for(let r=0;r<e.length;r++)a(e[r])?t+=e[r]:n=!0;if(n&&u(s,t))return t}function v(e){if(!e.origin)throw Error(`opts.origin is undefined`);let t=e.path||`/`;return e.query&&!r(t)&&(t=o(t,e.query)),{origin:e.origin.toString(),method:e.method,path:t,headers:e.headers}}function y(e,t,n){let r=t.toLowerCase(),i=e[r],a=Array.isArray(n)?n:[n];i===void 0?e[r]=Array.isArray(n)?n.slice():n:Array.isArray(i)?i.push(...a):e[r]=[i,...a]}function b(e){let t;if(e.headers==null)t={};else if(typeof e.headers==`object`){if(t={},i(e.headers))for(let n of e.headers){if(!Array.isArray(n))throw Error(`opts.headers is not a valid header map`);let[e,r]=n;if(typeof e!=`string`||typeof r!=`string`)throw Error(`opts.headers is not a valid header map`);y(t,e,r)}else for(let n of Object.keys(e.headers))y(t,n,e.headers[n])}else throw Error(`opts.headers is not an object`);return t}function x(e){if(typeof e!=`object`)throw TypeError(`expected key to be object, got ${typeof e}`);for(let t of[`origin`,`method`,`path`])if(typeof e[t]!=`string`)throw TypeError(`expected key.${t} to be string, got ${typeof e[t]}`);if(e.headers!==void 0&&typeof e.headers!=`object`)throw TypeError(`expected headers to be object, got ${typeof e}`)}function S(e){if(typeof e!=`object`)throw TypeError(`expected value to be object, got ${typeof e}`);for(let t of[`statusCode`,`cachedAt`,`staleAt`,`deleteAt`])if(typeof e[t]!=`number`)throw TypeError(`expected value.${t} to be number, got ${typeof e[t]}`);if(typeof e.statusMessage!=`string`)throw TypeError(`expected value.statusMessage to be string, got ${typeof e.statusMessage}`);if(e.headers!=null&&typeof e.headers!=`object`)throw TypeError(`expected value.rawHeaders to be object, got ${typeof e.headers}`);if(e.vary!==void 0&&typeof e.vary!=`object`)throw TypeError(`expected value.vary to be object, got ${typeof e.vary}`);if(e.etag!==void 0&&typeof e.etag!=`string`)throw TypeError(`expected value.etag to be string, got ${typeof e.etag}`)}function C(e){let t={},n=new Set,r=new Set,i=m(Array.isArray(e)?e.join(`,`):e);for(let e=0;e<i.length;e++){let o=i[e],s=o.value.toLowerCase(),c=o.fromMalformedQuote,u=s.indexOf(`=`),m,g,v=!1,y=!1;if(u!==-1){let e=s.substring(0,u),t=s.substring(u+1);v=f(e)!==e,y=d(t)!==t,m=l(e),g=d(t)}else m=l(s);let b=_(m);if(b!==void 0){t[b]=!0;continue}switch(m){case`min-fresh`:case`max-stale`:case`max-age`:case`s-maxage`:case`stale-while-revalidate`:case`stale-if-error`:{if(c||n.has(m))continue;if(g===void 0||v||y){delete t[m],n.add(m),h(t,m);continue}if(g.length>=2&&g[0]===`"`&&g[g.length-1]===`"`&&(g=g.substring(1,g.length-1)),!/^[0-9]+$/.test(g)){delete t[m],n.add(m),h(t,m);continue}let e=Math.min(parseInt(g,10),2147483647);m===`min-fresh`?(!(m in t)||t[m]<e)&&(t[m]=e):(!(m in t)||t[m]>e)&&(t[m]=e);break}case`private`:case`no-cache`:if(c){t[m]=!0;break}if(g!==void 0&&g.length===0){t[m]=!0;break}if(g){if(g[0]===`"`){g=f(g);let n=``,r=e,o=!1,s=p(g,1);if(s!==-1)n=g.substring(1,s),o=!0;else{let t=[g.substring(1)];for(let n=e+1;n<i.length;n++){let e=l(i[n].value),a=p(e,0);if(r=n,a!==-1){t.push(e.substring(0,a)),o=!0;break}t.push(e)}n=t.join(`,`)}if(!o){t[m]=!0;break}e=r;let c=n.split(`,`),u=!0;for(let e=0;e<c.length;e++)c[e]=l(c[e]),a(c[e])||(u=!1);u?t[m]!==!0&&(m in t?t[m]=t[m].concat(c):t[m]=c):t[m]=!0}else{let e=l(g);a(e)?t[m]!==!0&&(m in t?t[m]=t[m].concat(e):t[m]=[e]):t[m]=!0}break}case`public`:case`must-revalidate`:case`proxy-revalidate`:case`immutable`:case`no-transform`:case`must-understand`:case`only-if-cached`:if(c||r.has(m))continue;if(g!==void 0){delete t[m],r.add(m);continue}t[m]=!0;break;case`no-store`:t[m]=!0;break;default:continue}}return t}function w(e){let t=Array.isArray(e)?e:[e],n=[];for(let e=0;e<t.length;e++){let r=t[e].split(`,`);for(let e=0;e<r.length;e++)n.push(r[e])}return n}function E(e){let t=w(e);for(let e=0;e<t.length;e++)if(l(t[e]).indexOf(`*`)!==-1)return!0;return!1}function D(e,t){if(E(e))return t;let n={},r=w(e);for(let e of r){let r=l(e).toLowerCase();if(r.length===0)continue;if(!a(r))return;let i=t[r];n[r]=Array.isArray(i)?i.slice():i??null}return n}function O(e){return E(e)||D(e,{})===void 0}function k(e){return e.length<=2?!1:e[0]===`"`&&e[e.length-1]===`"`?!(e[1]===`"`||e.startsWith(`"W/`)):e.startsWith(`W/"`)&&e[e.length-1]===`"`?e.length!==4:!1}function A(e,t=`CacheStore`){if(typeof e!=`object`||!e)throw TypeError(`expected type of ${t} to be a CacheStore, got ${e===null?`null`:typeof e}`);for(let n of[`get`,`createWriteStream`,`delete`])if(typeof e[n]!=`function`)throw TypeError(`${t} needs to have a \`${n}()\` function`)}function j(e,t=`CacheMethods`){if(!Array.isArray(e))throw TypeError(`expected type of ${t} needs to be an array, got ${e===null?`null`:typeof e}`);if(e.length===0)throw TypeError(`${t} needs to have at least one method`);for(let r of e)if(!u(n,r))throw TypeError(`element of ${t}-array needs to be one of following values: ${n.join(`, `)}, got ${r}`)}function M(e,t){let n={};if(e.headers){let r=Object.keys(e.headers).sort();for(let i of r)t?.has(i.toLowerCase())||(n[i]=e.headers[i])}return JSON.stringify([e.origin,e.method,e.path,n])}t.exports={makeCacheKey:v,normalizeHeaders:b,assertCacheKey:x,assertCacheValue:S,parseCacheControlHeader:C,hasInvalidCacheControlDirective:g,parseVaryHeader:D,hasVaryStar:E,isInvalidOrWildcardVaryHeader:O,isEtagUsable:k,assertCacheMethods:j,assertCacheStore:A,makeDeduplicationKey:M}})),He=t(((e,t)=>{function n(e){switch(e[3]){case`,`:return i(e);case` `:return a(e);default:return o(e)}}function r(e,t,n,r,i,a,o){let s=new Date(Date.UTC(e,t,n,r,i,a));return e>=0&&e<=99&&s.setUTCFullYear(e),s.getUTCFullYear()===e&&s.getUTCMonth()===t&&s.getUTCDate()===n&&s.getUTCHours()===r&&s.getUTCMinutes()===i&&s.getUTCSeconds()===a&&s.getUTCDay()===o?s:void 0}function i(e){if(e.length!==29||e[4]!==` `||e[7]!==` `||e[11]!==` `||e[16]!==` `||e[19]!==`:`||e[22]!==`:`||e[25]!==` `||e[26]!==`G`||e[27]!==`M`||e[28]!==`T`)return;let t=-1;if(e[0]===`S`&&e[1]===`u`&&e[2]===`n`)t=0;else if(e[0]===`M`&&e[1]===`o`&&e[2]===`n`)t=1;else if(e[0]===`T`&&e[1]===`u`&&e[2]===`e`)t=2;else if(e[0]===`W`&&e[1]===`e`&&e[2]===`d`)t=3;else if(e[0]===`T`&&e[1]===`h`&&e[2]===`u`)t=4;else if(e[0]===`F`&&e[1]===`r`&&e[2]===`i`)t=5;else if(e[0]===`S`&&e[1]===`a`&&e[2]===`t`)t=6;else return;let n=0;if(e[5]===`0`){let t=e.charCodeAt(6);if(t<49||t>57)return;n=t-48}else{let t=e.charCodeAt(5);if(t<49||t>51)return;let r=e.charCodeAt(6);if(r<48||r>57)return;n=(t-48)*10+(r-48)}let i=-1;if(e[8]===`J`&&e[9]===`a`&&e[10]===`n`)i=0;else if(e[8]===`F`&&e[9]===`e`&&e[10]===`b`)i=1;else if(e[8]===`M`&&e[9]===`a`){if(e[10]===`r`)i=2;else if(e[10]===`y`)i=4;else return}else if(e[8]===`J`){if(e[9]===`a`&&e[10]===`n`)i=0;else if(e[9]===`u`){if(e[10]===`n`)i=5;else if(e[10]===`l`)i=6;else return}else return}else if(e[8]===`A`){if(e[9]===`p`&&e[10]===`r`)i=3;else if(e[9]===`u`&&e[10]===`g`)i=7;else return}else if(e[8]===`S`&&e[9]===`e`&&e[10]===`p`)i=8;else if(e[8]===`O`&&e[9]===`c`&&e[10]===`t`)i=9;else if(e[8]===`N`&&e[9]===`o`&&e[10]===`v`)i=10;else if(e[8]===`D`&&e[9]===`e`&&e[10]===`c`)i=11;else return;let a=e.charCodeAt(12);if(a<48||a>57)return;let o=e.charCodeAt(13);if(o<48||o>57)return;let s=e.charCodeAt(14);if(s<48||s>57)return;let c=e.charCodeAt(15);if(c<48||c>57)return;let l=(a-48)*1e3+(o-48)*100+(s-48)*10+(c-48),u=0;if(e[17]===`0`){let t=e.charCodeAt(18);if(t<48||t>57)return;u=t-48}else{let t=e.charCodeAt(17);if(t<48||t>50)return;let n=e.charCodeAt(18);if(n<48||n>57||t===50&&n>51)return;u=(t-48)*10+(n-48)}let d=0;if(e[20]===`0`){let t=e.charCodeAt(21);if(t<48||t>57)return;d=t-48}else{let t=e.charCodeAt(20);if(t<48||t>53)return;let n=e.charCodeAt(21);if(n<48||n>57)return;d=(t-48)*10+(n-48)}let f=0;if(e[23]===`0`){let t=e.charCodeAt(24);if(t<48||t>57)return;f=t-48}else{let t=e.charCodeAt(23);if(t<48||t>53)return;let n=e.charCodeAt(24);if(n<48||n>57)return;f=(t-48)*10+(n-48)}return r(l,i,n,u,d,f,t)}function a(e){if(e.length!==24||e[7]!==` `||e[10]!==` `||e[19]!==` `)return;let t=-1;if(e[0]===`S`&&e[1]===`u`&&e[2]===`n`)t=0;else if(e[0]===`M`&&e[1]===`o`&&e[2]===`n`)t=1;else if(e[0]===`T`&&e[1]===`u`&&e[2]===`e`)t=2;else if(e[0]===`W`&&e[1]===`e`&&e[2]===`d`)t=3;else if(e[0]===`T`&&e[1]===`h`&&e[2]===`u`)t=4;else if(e[0]===`F`&&e[1]===`r`&&e[2]===`i`)t=5;else if(e[0]===`S`&&e[1]===`a`&&e[2]===`t`)t=6;else return;let n=-1;if(e[4]===`J`&&e[5]===`a`&&e[6]===`n`)n=0;else if(e[4]===`F`&&e[5]===`e`&&e[6]===`b`)n=1;else if(e[4]===`M`&&e[5]===`a`){if(e[6]===`r`)n=2;else if(e[6]===`y`)n=4;else return}else if(e[4]===`J`){if(e[5]===`a`&&e[6]===`n`)n=0;else if(e[5]===`u`){if(e[6]===`n`)n=5;else if(e[6]===`l`)n=6;else return}else return}else if(e[4]===`A`){if(e[5]===`p`&&e[6]===`r`)n=3;else if(e[5]===`u`&&e[6]===`g`)n=7;else return}else if(e[4]===`S`&&e[5]===`e`&&e[6]===`p`)n=8;else if(e[4]===`O`&&e[5]===`c`&&e[6]===`t`)n=9;else if(e[4]===`N`&&e[5]===`o`&&e[6]===`v`)n=10;else if(e[4]===`D`&&e[5]===`e`&&e[6]===`c`)n=11;else return;let i=0;if(e[8]===` `){let t=e.charCodeAt(9);if(t<49||t>57)return;i=t-48}else{let t=e.charCodeAt(8);if(t<49||t>51)return;let n=e.charCodeAt(9);if(n<48||n>57)return;i=(t-48)*10+(n-48)}let a=0;if(e[11]===`0`){let t=e.charCodeAt(12);if(t<48||t>57)return;a=t-48}else{let t=e.charCodeAt(11);if(t<48||t>50)return;let n=e.charCodeAt(12);if(n<48||n>57||t===50&&n>51)return;a=(t-48)*10+(n-48)}let o=0;if(e[14]===`0`){let t=e.charCodeAt(15);if(t<48||t>57)return;o=t-48}else{let t=e.charCodeAt(14);if(t<48||t>53)return;let n=e.charCodeAt(15);if(n<48||n>57)return;o=(t-48)*10+(n-48)}let s=0;if(e[17]===`0`){let t=e.charCodeAt(18);if(t<48||t>57)return;s=t-48}else{let t=e.charCodeAt(17);if(t<48||t>53)return;let n=e.charCodeAt(18);if(n<48||n>57)return;s=(t-48)*10+(n-48)}let c=e.charCodeAt(20);if(c<48||c>57)return;let l=e.charCodeAt(21);if(l<48||l>57)return;let u=e.charCodeAt(22);if(u<48||u>57)return;let d=e.charCodeAt(23);if(!(d<48||d>57))return r((c-48)*1e3+(l-48)*100+(u-48)*10+(d-48),n,i,a,o,s,t)}function o(e){let t=-1,n=-1;if(e[0]===`S`)e[1]===`u`&&e[2]===`n`&&e[3]===`d`&&e[4]===`a`&&e[5]===`y`?(n=0,t=6):e[1]===`a`&&e[2]===`t`&&e[3]===`u`&&e[4]===`r`&&e[5]===`d`&&e[6]===`a`&&e[7]===`y`&&(n=6,t=8);else if(e[0]===`M`&&e[1]===`o`&&e[2]===`n`&&e[3]===`d`&&e[4]===`a`&&e[5]===`y`)n=1,t=6;else if(e[0]===`T`)e[1]===`u`&&e[2]===`e`&&e[3]===`s`&&e[4]===`d`&&e[5]===`a`&&e[6]===`y`?(n=2,t=7):e[1]===`h`&&e[2]===`u`&&e[3]===`r`&&e[4]===`s`&&e[5]===`d`&&e[6]===`a`&&e[7]===`y`&&(n=4,t=8);else if(e[0]===`W`&&e[1]===`e`&&e[2]===`d`&&e[3]===`n`&&e[4]===`e`&&e[5]===`s`&&e[6]===`d`&&e[7]===`a`&&e[8]===`y`)n=3,t=9;else if(e[0]===`F`&&e[1]===`r`&&e[2]===`i`&&e[3]===`d`&&e[4]===`a`&&e[5]===`y`)n=5,t=6;else return;if(e[t]!==`,`||e.length-t-1!=23||e[t+1]!==` `||e[t+4]!==`-`||e[t+8]!==`-`||e[t+11]!==` `||e[t+14]!==`:`||e[t+17]!==`:`||e[t+20]!==` `||e[t+21]!==`G`||e[t+22]!==`M`||e[t+23]!==`T`)return;let i=0;if(e[t+2]===`0`){let n=e.charCodeAt(t+3);if(n<49||n>57)return;i=n-48}else{let n=e.charCodeAt(t+2);if(n<49||n>51)return;let r=e.charCodeAt(t+3);if(r<48||r>57)return;i=(n-48)*10+(r-48)}let a=-1;if(e[t+5]===`J`&&e[t+6]===`a`&&e[t+7]===`n`)a=0;else if(e[t+5]===`F`&&e[t+6]===`e`&&e[t+7]===`b`)a=1;else if(e[t+5]===`M`&&e[t+6]===`a`&&e[t+7]===`r`)a=2;else if(e[t+5]===`A`&&e[t+6]===`p`&&e[t+7]===`r`)a=3;else if(e[t+5]===`M`&&e[t+6]===`a`&&e[t+7]===`y`)a=4;else if(e[t+5]===`J`&&e[t+6]===`u`&&e[t+7]===`n`)a=5;else if(e[t+5]===`J`&&e[t+6]===`u`&&e[t+7]===`l`)a=6;else if(e[t+5]===`A`&&e[t+6]===`u`&&e[t+7]===`g`)a=7;else if(e[t+5]===`S`&&e[t+6]===`e`&&e[t+7]===`p`)a=8;else if(e[t+5]===`O`&&e[t+6]===`c`&&e[t+7]===`t`)a=9;else if(e[t+5]===`N`&&e[t+6]===`o`&&e[t+7]===`v`)a=10;else if(e[t+5]===`D`&&e[t+6]===`e`&&e[t+7]===`c`)a=11;else return;let o=e.charCodeAt(t+9);if(o<48||o>57)return;let s=e.charCodeAt(t+10);if(s<48||s>57)return;let c=(o-48)*10+(s-48);c+=c<70?2e3:1900;let l=0;if(e[t+12]===`0`){let n=e.charCodeAt(t+13);if(n<48||n>57)return;l=n-48}else{let n=e.charCodeAt(t+12);if(n<48||n>50)return;let r=e.charCodeAt(t+13);if(r<48||r>57||n===50&&r>51)return;l=(n-48)*10+(r-48)}let u=0;if(e[t+15]===`0`){let n=e.charCodeAt(t+16);if(n<48||n>57)return;u=n-48}else{let n=e.charCodeAt(t+15);if(n<48||n>53)return;let r=e.charCodeAt(t+16);if(r<48||r>57)return;u=(n-48)*10+(r-48)}let d=0;if(e[t+18]===`0`){let n=e.charCodeAt(t+19);if(n<48||n>57)return;d=n-48}else{let n=e.charCodeAt(t+18);if(n<48||n>53)return;let r=e.charCodeAt(t+19);if(r<48||r>57)return;d=(n-48)*10+(r-48)}return r(c,a,i,l,u,d,n)}t.exports={parseHttpDate:n}})),Ue=t(((e,t)=>{let n=T(),{parseCacheControlHeader:r,hasInvalidCacheControlDirective:i,parseVaryHeader:a,hasVaryStar:o,isInvalidOrWildcardVaryHeader:s,isEtagUsable:c}=Ve(),{parseHttpDate:l}=He();function u(){}let d=[200,203,204,206,300,301,308,404,405,410,414,501],f=[206],p=2147483647e3;function m(e){return e.replace(/^[\t ]+|[\t ]+$/g,``)}function h(e,t){for(let n=0;n<e.length;n++)if(e[n]===t)return!0;return!1}function g(e,t){let n=Array.isArray(t)?t:[t];for(let t=0;t<n.length;t++){let r=n[t].split(`,`);for(let t=0;t<r.length;t++)e.push(m(r[t]).toLowerCase())}}function _(e,t){if(typeof t!=`string`)return;let n,r,i;try{n=new URL(e.origin),r=new URL(e.path,n),i=new URL(t,r)}catch{return}if(i.origin===n.origin)return i.pathname+i.search}function v(e,t,r){S(e,{...t,path:r});for(let i=0;i<n.safeHTTPMethods.length;i++){let a=n.safeHTTPMethods[i];a!==t.method&&S(e,{...t,method:a,path:r})}}function y(e,t,n){if(n===void 0)return;let r=Array.isArray(n)?n:[n];for(let n=0;n<r.length;n++){let i=_(t,r[n]);i!==void 0&&v(e,t,i)}}function b(e,t,n){v(e,t,t.path),y(e,t,n.location),y(e,t,n[`content-location`])}var x=class{#e;#t;#n;#r;#i;#a;constructor({store:e,type:t,cacheByDefault:n},r,i){this.#r=e,this.#t=t,this.#n=n,this.#e=r,this.#i=i}onRequestStart(e,t){this.#a?.destroy(),this.#a=void 0,this.#i.onRequestStart?.(e,t)}onRequestUpgrade(e,t,n,r){this.#i.onRequestUpgrade?.(e,t,n,r)}onResponseStart(e,t,i,o){let l=()=>this.#i.onResponseStart?.(e,t,i,o),u=this;if(!h(n.safeHTTPMethods,this.#e.method)&&t>=200&&t<=399)return b(this.#r,this.#e,i),l();let f=i[`cache-control`],m=i[`last-modified`]&&h(d,t);if(!f&&!i.expires&&!m&&!this.#n)return t===304&&i.vary&&s(i.vary)&&S(this.#r,this.#e),l();let g=f?r(f):{};if(!E(this.#t,t,i,g,this.#e.headers))return t===304&&(f||w(this.#t,i,g))&&S(this.#r,this.#e),l();let _=Date.now(),v=Object.hasOwn(i,`age`)?O(i.age):void 0;if(v!==void 0&&v>=p)return C(t,this.#r,this.#e),l();let y=Object.hasOwn(i,`date`)?D(i.date):void 0;if(y===null)return C(t,this.#r,this.#e),l();let x=y?Math.max(0,_-y.getTime()):0,T=Math.max(x,v??0),M=k(this.#t,_,v,i,y,g)??this.#n;if(M===void 0||T>=M)return(f||M!==void 0)&&C(t,this.#r,this.#e),l();let N=_-T,P=M+N;if(_>=P)return C(t,this.#r,this.#e),l();let F;if(this.#e.headers&&i.vary&&(F=a(i.vary,this.#e.headers),!F))return l();let I=N,ee=A(N,_,g,P),L=j(i,g),R={statusCode:t,statusMessage:o,headers:L,vary:F,cacheControlDirectives:g,cachedAt:I,staleAt:P,deleteAt:ee};if(t===304){let t=t=>{if(!t)return l();if(R.statusCode=t.statusCode,R.statusMessage=t.statusMessage,R.etag=t.etag,R.vary=F??t.vary,R.headers={...t.headers,...L},l(),this.#a=this.#r.createWriteStream(this.#e,R),this.#a&&t?.body){if(typeof t.body.values==`function`){let n=t.body.values(),r=()=>{for(let t of n){let n=this.#a.write(t)===!1;if(this.#i.onResponseData?.(e,t),n)break}};this.#a.on(`error`,function(){u.#a=void 0,u.#r.delete(u.#e)}).on(`drain`,()=>{r()}).on(`close`,function(){u.#a===this&&(u.#a=void 0)}),r()}else typeof t.body.on==`function`&&(t.body.on(`data`,t=>{this.#a.write(t),this.#i.onResponseData?.(e,t)}).on(`end`,()=>{this.#a.end()}).on(`error`,()=>{this.#a=void 0,this.#r.delete(this.#e)}),this.#a.on(`error`,function(){u.#a=void 0,u.#r.delete(u.#e)}).on(`close`,function(){u.#a===this&&(u.#a=void 0)}))}},n=this.#r.get(this.#e);n&&typeof n.then==`function`?n.then(t):t(n)}else{if(typeof i.etag==`string`&&c(i.etag)&&(R.etag=i.etag),this.#a=this.#r.createWriteStream(this.#e,R),!this.#a)return l();this.#a.on(`drain`,()=>e.resume()).on(`error`,function(){u.#a=void 0,u.#r.delete(u.#e)}).on(`close`,function(){u.#a===this&&(u.#a=void 0),e.resume()}),l()}}onResponseData(e,t){this.#a?.write(t)===!1&&e.pause(),this.#i.onResponseData?.(e,t)}onResponseEnd(e,t){this.#a?.end(),this.#i.onResponseEnd?.(e,t)}onResponseError(e,t){this.#a?.destroy(t),this.#a=void 0,this.#i.onResponseError?.(e,t)}};function S(e,t){try{e.delete(t)?.catch?.(u)}catch{}}function C(e,t,n){e===304&&S(t,n)}function w(e,t,n){return n[`no-store`]===!0||e===`shared`&&n.private===!0||(t.vary?s(t.vary):!1)}function E(e,t,n,r,i){return!(t<200||h(f,t)||!h(d,t)&&!n.expires&&!r.public&&r[`max-age`]===void 0&&!(r.private&&e===`private`)&&(r[`s-maxage`]===void 0||e!==`shared`)||r[`no-store`]||e===`shared`&&r.private===!0||n.vary&&o(n.vary)||i!=null&&Object.hasOwn(i,`authorization`)&&(!r.public&&!r[`s-maxage`]&&!r[`must-revalidate`]||typeof i.authorization!=`string`||Array.isArray(r[`no-cache`])&&h(r[`no-cache`],`authorization`)||Array.isArray(r.private)&&h(r.private,`authorization`)))}function D(e){let t=e;if(Array.isArray(t)){if(t.length!==1)return null;t=t[0]}return typeof t==`string`?l(t):null}function O(e){let t=e;if(Array.isArray(t)){if(t.length!==1)return p;t=t[0]}if(typeof t!=`string`||!/^[\t ]*[0-9]+[\t ]*$/.test(t))return p;let n=BigInt(t.replace(/^[\t ]+|[\t ]+$/g,``));return n>=BigInt(p/1e3)?p:Number(n)*1e3}function k(e,t,n,r,a,o){if(e===`shared`){if(i(o,`s-maxage`))return 0;let e=o[`s-maxage`];if(e!==void 0)return e*1e3}if(i(o,`max-age`))return 0;let s=o[`max-age`];if(s!==void 0)return s*1e3;if(Object.hasOwn(r,`expires`)){if(typeof r.expires!=`string`)return 0;let e=l(r.expires);if(!e||t>=e.getTime())return 0;if(a){if(a>=e)return 0;let t=e.getTime()-a.getTime();return n!==void 0&&n>=t?0:t}return e.getTime()-t}if(typeof r[`last-modified`]==`string`){let e=l(r[`last-modified`]);if(e)return e.getTime()>=t?void 0:(t-e.getTime())*.1}if(o.immutable)return 31536e6}function A(e,t,n,r){let i=-1/0,a=-1/0,o=-1/0;if(n[`stale-while-revalidate`]&&(i=r+n[`stale-while-revalidate`]*1e3),n[`stale-if-error`]&&(a=r+n[`stale-if-error`]*1e3),n.immutable&&i===-1/0&&a===-1/0&&(o=t+31536e6),i===-1/0&&a===-1/0&&o===-1/0){let n=r-e,i=Math.min(Math.max(t-e,0),1e3);return r+n+i}return Math.max(r,i,a,o)}function j(e,t){let n=[`connection`,`proxy-authenticate`,`proxy-authentication-info`,`proxy-authorization`,`proxy-connection`,`te`,`transfer-encoding`,`upgrade`,`age`];e.connection&&g(n,e.connection),Array.isArray(t[`no-cache`])&&n.push(...t[`no-cache`]),Array.isArray(t.private)&&n.push(...t.private);let r;for(let t of n)Object.hasOwn(e,t)&&(r??={...e},delete r[t]);return r??e}t.exports=x})),We=t(((t,n)=>{let{Writable:r}=e(`node:stream`),{EventEmitter:i}=e(`node:events`),{assertCacheKey:a,assertCacheValue:o}=Ve();var s=class extends i{#e=1024;#t=104857600;#n=5242880;#r=0;#i=0;#a=new Map;#o=!1;constructor(e){if(super(),e){if(typeof e!=`object`)throw TypeError(`MemoryCacheStore options must be an object`);if(e.maxCount!==void 0){if(typeof e.maxCount!=`number`||!Number.isInteger(e.maxCount)||e.maxCount<0)throw TypeError(`MemoryCacheStore options.maxCount must be a non-negative integer`);this.#e=e.maxCount}if(e.maxSize!==void 0){if(typeof e.maxSize!=`number`||!Number.isInteger(e.maxSize)||e.maxSize<0)throw TypeError(`MemoryCacheStore options.maxSize must be a non-negative integer`);this.#t=e.maxSize}if(e.maxEntrySize!==void 0){if(typeof e.maxEntrySize!=`number`||!Number.isInteger(e.maxEntrySize)||e.maxEntrySize<0)throw TypeError(`MemoryCacheStore options.maxEntrySize must be a non-negative integer`);this.#n=e.maxEntrySize}}}get size(){return this.#r}isFull(){return this.#r>=this.#t||this.#i>=this.#e}get(e){a(e);let t=`${e.origin}:${e.path}`,n=Date.now(),r=this.#a.get(t),i=r?c(e,r,n):null;return i==null?void 0:{statusMessage:i.statusMessage,statusCode:i.statusCode,headers:i.headers,body:i.body,vary:i.vary?i.vary:void 0,etag:i.etag,cacheControlDirectives:i.cacheControlDirectives,cachedAt:i.cachedAt,staleAt:i.staleAt,deleteAt:i.deleteAt}}createWriteStream(e,t){a(e),o(t);let n=`${e.origin}:${e.path}`,i=this,s={...e,...t,body:[],size:0};return new r({write(e,t,n){typeof e==`string`&&(e=Buffer.from(e,t)),s.size+=e.byteLength,s.size>=i.#n?this.destroy():s.body.push(e),n(null)},final(t){let r=i.#a.get(n);r||(r=[],i.#a.set(n,r));let a=c(e,r,Date.now());if(a){let e=r.indexOf(a);r.splice(e,1,s),i.#r-=a.size}else r.push(s),i.#i+=1;if(i.#r+=s.size,i.#r>i.#t||i.#i>i.#e){i.#o||=(i.emit(`maxSizeExceeded`,{size:i.#r,maxSize:i.#t,count:i.#i,maxCount:i.#e}),!0);for(let[e,t]of i.#a){for(let e of t.splice(0,t.length/2))i.#r-=e.size,--i.#i;t.length===0&&i.#a.delete(e)}i.#r<i.#t&&i.#i<i.#e&&(i.#o=!1)}t(null)}})}delete(e){if(typeof e!=`object`)throw TypeError(`expected key to be object, got ${typeof e}`);let t=`${e.origin}:${e.path}`;for(let e of this.#a.get(t)??[])this.#r-=e.size,--this.#i;this.#a.delete(t)}};function c(e,t,n){for(let r=0;r<t.length;r++){let i=t[r];if(i.deleteAt>n&&i.method===e.method&&l(e,i))return i}}function l(e,t){if(t.vary==null)return!0;for(let n in t.vary)if(Object.hasOwn(t.vary,n)&&!u(e.headers?.[n],t.vary[n]))return!1;return!0}function u(e,t){if(e==null&&t==null)return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}n.exports=s})),Ge=t(((t,n)=>{let r=e(`node:assert`);n.exports=class{#e=!1;#t;#n;#r;#i;constructor(e,t,n){if(typeof e!=`function`)throw TypeError(`callback must be a function`);this.#t=e,this.#n=t,this.#i=n}onRequestStart(e,t){this.#e=!1,this.#r=t}onRequestUpgrade(e,t,n,r){this.#n.onRequestUpgrade?.(e,t,n,r)}onResponseStart(e,t,n,i){if(r(this.#t!=null),this.#e=t===304||this.#i&&t>=500&&t<=504,this.#t(this.#e,this.#r,t,n),this.#t=null,this.#e)return!0;this.#n.onRequestStart?.(e,this.#r),this.#n.onResponseStart?.(e,t,n,i)}onResponseData(e,t){if(!this.#e)return this.#n.onResponseData?.(e,t)}onResponseEnd(e,t){this.#e||this.#n.onResponseEnd?.(e,t)}onResponseError(e,t){if(!this.#e){if(this.#t&&=(this.#t(!1),null),typeof this.#n.onResponseError==`function`)this.#n.onResponseError(e,t);else throw t}}}})),Ke=t(((t,n)=>{let r=e(`node:assert`),{Readable:i}=e(`node:stream`),a=T(),o=Ue(),s=We(),c=Ge(),{assertCacheStore:l,assertCacheMethods:u,makeCacheKey:d,normalizeHeaders:f,parseCacheControlHeader:p,isInvalidOrWildcardVaryHeader:m}=Ve(),{AbortError:h}=S(),{parseHttpDate:g}=He();function _(e,t){if(e!==void 0){if(!Array.isArray(e))throw TypeError(`expected ${t} to be an array or undefined, got ${typeof e}`);for(let n=0;n<e.length;n++){let r=e[n];if(typeof r!=`string`&&!(r instanceof RegExp))throw TypeError(`expected ${t}[${n}] to be a string or RegExp, got ${typeof r}`)}}}let v=()=>{};function y(e){return e.replace(/^[\t ]+|[\t ]+$/g,``)}function b(e,t){for(let n=0;n<e.length;n++)if(e[n]===t)return!0;return!1}function x(e){let t=e?.pragma;if(!t)return!1;let n=Array.isArray(t)?t:[t];for(let e=0;e<n.length;e++){let t=n[e];if(typeof t!=`string`)continue;let r=t.split(`,`);for(let e=0;e<r.length;e++)if(y(r[e]).toLowerCase()===`no-cache`)return!0}return!1}function C(e,t,{headers:n={}}){return!!(t?.[`no-cache`]||e.cacheControlDirectives?.[`no-cache`]&&!Array.isArray(e.cacheControlDirectives[`no-cache`])||n[`if-modified-since`]||n[`if-none-match`])}function w(e,t){return e.cacheControlDirectives?.[`must-revalidate`]===!0||t===`shared`&&(e.cacheControlDirectives?.[`proxy-revalidate`]===!0||e.cacheControlDirectives?.[`s-maxage`]!==void 0)}function E(e,t){if(t.vary&&m(t.vary))return!0;let n=t[`cache-control`];if(!n)return!1;let r=p(n);return r[`no-store`]===!0||e===`shared`&&r.private===!0}function D(e){return e[`cache-control`]!==void 0}function O(e,t){try{e.delete(t)?.catch?.(v)}catch{}}function k(e){let t=e?.[`last-modified`];if(typeof t==`string`&&g(t))return t}function A(e,t){let n={...e.headers,"if-modified-since":k(t.headers)??new Date(t.cachedAt).toUTCString()};if(t.etag&&(n[`if-none-match`]=t.etag),t.vary)for(let e in t.vary)t.vary[e]!=null&&(n[e]=t.vary[e]);return n}function j(e,t,n){let r=Date.now();return r>e.staleAt?!w(e,n)&&t?.[`max-stale`]?r>e.staleAt+t[`max-stale`]*1e3:!0:t?.[`min-fresh`]?e.staleAt-r<=t[`min-fresh`]*1e3:!1}function M(e,t){let n=e.cacheControlDirectives?.[`stale-while-revalidate`];return!n||w(e,t)?!1:Date.now()<=e.staleAt+n*1e3}function N(e,t,n,r,i,a){if(a?.[`only-if-cached`]){let e=!1;try{if(typeof r.onConnect==`function`&&(r.onConnect(()=>{e=!0}),e)||typeof r.onHeaders==`function`&&(r.onHeaders(504,[],v,`Gateway Timeout`),e))return;typeof r.onComplete==`function`&&r.onComplete([])}catch(e){typeof r.onError==`function`&&r.onError(e)}return!0}return e(i,new o(t,n,r))}function P(e,t,n,o,s,c){let l=a.isStream(n.body)?n.body:i.from(n.body??[]);r(!l.destroyed,`stream should not be destroyed`),r(!l.readableDidRead,`stream should not be readableDidRead`);let u={resume(){l.resume()},pause(){l.pause()},get paused(){return l.isPaused()},get aborted(){return l.destroyed},get reason(){return l.errored},abort(e){l.destroy(e??new h)}};if(l.on(`error`,function(t){if(!this.readableEnded){if(typeof e.onResponseError==`function`)e.onResponseError(u,t);else throw t}}).on(`close`,function(){this.errored||e.onResponseEnd?.(u,{})}),e.onRequestStart?.(u,s),l.destroyed)return;let d={...n.headers,age:String(o)};c&&(d.warning=`110 - "response is stale"`),e.onResponseStart?.(u,n.statusCode,d,n.statusMessage),t.method===`HEAD`?l.destroy():l.on(`data`,function(t){e.onResponseData?.(u,t)})}function F(e,t,n,r,i,s,l){if(!l)return N(e,t,n,r,i,s);let u=Date.now();if(u>l.deleteAt)return e(i,new o(t,n,r));let d=Math.round((u-l.cachedAt)/1e3),f=s?.[`max-age`]!==void 0&&d>=s[`max-age`],p=f||j(l,s,t.type),m=f||C(l,s,i);if(p||m){if(a.isStream(i.body)&&a.bodyLength(i.body)!==0)return e(i,new o(t,n,r));if(!m&&M(l,t.type))return P(r,i,l,d,null,!0),queueMicrotask(()=>{let r=A(i,l);e({...i,headers:r},new o(t,n,{onRequestStart(){},onRequestUpgrade(){},onResponseStart(){},onResponseData(){},onResponseEnd(){},onResponseError(){}}))}),!0;let f=!1;if(!w(l,t.type)){let e=l.cacheControlDirectives[`stale-if-error`]??s?.[`stale-if-error`];e&&(f=u<l.staleAt+e*1e3)}let h=A(i,l);return e({...i,headers:h},new c((s,c,u,f)=>{if(s){if(u===304){if(E(t.type,f))return a.isStream(l.body)&&l.body.on(`error`,v).destroy(),O(t.store,n),e(i,new o(t,n,r));D(f)&&O(t.store,n)}P(r,i,l,d,c,p)}else a.isStream(l.body)&&l.body.on(`error`,v).destroy()},new o(t,n,r),f))}a.isStream(i.body)&&i.body.on(`error`,v).destroy(),P(r,i,l,d,null,!1)}n.exports=(e={})=>{let{store:t=new s,methods:n=[`GET`],cacheByDefault:r=void 0,type:i=`shared`,origins:o=void 0}=e;if(typeof e!=`object`||!e)throw TypeError(`expected type of opts to be an Object, got ${e===null?`null`:typeof e}`);if(l(t,`opts.store`),u(n,`opts.methods`),_(o,`opts.origins`),r!==void 0&&typeof r!=`number`)throw TypeError(`expected opts.cacheByDefault to be number or undefined, got ${typeof r}`);if(i!==void 0&&i!==`shared`&&i!==`private`)throw TypeError(`expected opts.type to be shared, private, or undefined, got ${typeof i}`);let c={store:t,methods:n,cacheByDefault:r,type:i},m=[];for(let e=0;e<a.safeHTTPMethods.length;e++){let t=a.safeHTTPMethods[e];b(n,t)||m.push(t)}return e=>(n,r)=>{if(!n.origin||b(m,n.method))return e(n,r);if(o!==void 0){let t=n.origin.toString().toLowerCase(),i=!1;for(let e=0;e<o.length;e++){let n=o[e];if(typeof n==`string`){if(n.toLowerCase()===t){i=!0;break}}else if(n.test(t)){i=!0;break}}if(!i)return e(n,r)}n={...n,headers:f(n)};let i=n.headers?.[`cache-control`]?p(n.headers[`cache-control`]):x(n.headers)?{"no-cache":!0}:void 0;if(i?.[`no-store`])return e(n,r);let a=d(n),s=t.get(a);return s&&typeof s.then==`function`?s.then(t=>F(e,c,a,r,n,i,t)):F(e,c,a,r,n,i,s)}}})),qe=t(((t,n)=>{let{createInflate:r,createGunzip:i,createBrotliDecompress:a,createZstdDecompress:o}=e(`node:zlib`),{pipeline:s}=e(`node:stream`),c=Pe(),{runtimeFeatures:l}=H(),u={gzip:i,"x-gzip":i,br:a,deflate:r,compress:r,"x-compress":r,...l.has(`zstd`)?{zstd:o}:{}},d=[204,304],f=!1;var p=class extends c{#e=[];#t;#n;constructor(e,{skipStatusCodes:t=d,skipErrorResponses:n=!0}={}){super(e),this.#t=t,this.#n=n}#r(e,t){return!!(!e||t<200||this.#t.includes(t)||this.#n&&t>=400)}#i(e){let t=e.split(`,`);if(t.length>5)throw Error(`too many content-encodings in response: ${t.length}, maximum allowed is 5`);let n=[];for(let e=t.length-1;e>=0;e--){let r=t[e].trim();if(r){if(!u[r])return n.length=0,n;n.push(u[r]())}}return n}#a(e,t){e.on(`readable`,()=>{let n;for(;(n=e.read())!==null&&super.onResponseData(t,n)!==!1;);}),e.on(`error`,e=>{super.onResponseError(t,e)})}#o(e){let t=this.#e[0];this.#a(t,e),t.on(`end`,()=>{super.onResponseEnd(e,{})})}#s(e){let t=this.#e[this.#e.length-1];this.#a(t,e),s(this.#e,t=>{if(t){super.onResponseError(e,t);return}super.onResponseEnd(e,{})})}#c(){this.#e.length=0}onResponseStart(e,t,n,r){let i=n[`content-encoding`];if(this.#r(i,t))return super.onResponseStart(e,t,n,r);let a=this.#i(i.toLowerCase());if(a.length===0)return this.#c(),super.onResponseStart(e,t,n,r);this.#e=a;let{"content-encoding":o,"content-length":s,...c}=n;return this.#e.length===1?this.#o(e):this.#s(e),super.onResponseStart(e,t,c,r)}onResponseData(e,t){if(this.#e.length>0){this.#e[0].write(t);return}super.onResponseData(e,t)}onResponseEnd(e,t){if(this.#e.length>0){this.#e[0].end(),this.#c();return}super.onResponseEnd(e,t)}onResponseError(e,t){if(this.#e.length>0){for(let e of this.#e)e.destroy(t);this.#c()}super.onResponseError(e,t)}};function m(e={}){return f||=(process.emitWarning(`DecompressInterceptor is experimental and subject to change`,`ExperimentalWarning`),!0),t=>(n,r)=>t(n,new p(r,e))}n.exports=m})),Je=t(((e,t)=>{let{RequestAbortedError:n}=S(),r=5242880;t.exports=class{#e;#t=[];#n=r;#r=0;#i={};#a=``;#o=!1;#s=!1;#c=!1;#l=!1;#u=null;#d=null;constructor(e,t,n=r){this.#e=e,this.#d=t,this.#n=n}addWaitingHandler(e){if(this.#l||this.#c)return!1;let t=this.#f(e),n=t.controller;try{if(e.onRequestStart?.(n,null),n.aborted)return t.done=!0,!0;this.#s&&e.onResponseStart?.(n,this.#r,this.#i,this.#a)}catch{return t.done=!0,!0}return n.aborted||this.#t.push(t),!0}onRequestStart(e,t){this.#u=e,this.#e.onRequestStart?.(e,t)}onRequestUpgrade(e,t,n,r){this.#e.onRequestUpgrade?.(e,t,n,r)}onResponseStart(e,t,n,r){this.#s=!0,this.#r=t,this.#i=n,this.#a=r,this.#e.onResponseStart?.(e,t,n,r);for(let e of this.#t){let{handler:i,controller:a}=e;if(e.done||a.aborted){e.done=!0;continue}try{i.onResponseStart?.(a,t,n,r)}catch{}a.aborted&&(e.done=!0)}this.#g()}onResponseData(e,t){if(!(this.#o||this.#l)){this.#c=!0,this.#e.onResponseData?.(e,t);for(let e of this.#t){let{handler:n,controller:r}=e;if(e.done||r.aborted){e.done=!0;continue}if(r.paused){this.#p(e,t);continue}try{n.onResponseData?.(r,t)}catch{}r.aborted&&(e.done=!0,e.bufferedChunks=[],e.bufferedBytes=0)}this.#g()}}onResponseEnd(e,t){if(!(this.#o||this.#l)){this.#l=!0,this.#e.onResponseEnd?.(e,t);for(let e of this.#t){if(e.done||e.controller.aborted){e.done=!0;continue}if(this.#m(e),e.done||e.controller.aborted){e.done=!0;continue}if(e.controller.paused&&e.bufferedChunks.length>0){e.pendingTrailers=t;continue}try{e.handler.onResponseEnd?.(e.controller,t)}catch{}e.done=!0}this.#g(),this.#d?.()}}onResponseError(e,t){if(!this.#l){this.#o=!0,this.#l=!0,this.#e.onResponseError?.(e,t);for(let e of this.#t)this.#h(e,t);this.#t=[],this.#d?.()}}#f(e){let t={handler:e,controller:null,bufferedChunks:[],bufferedBytes:0,pendingTrailers:null,done:!1},n={aborted:!1,paused:!1,reason:null};return t.controller={resume:()=>{if(!n.aborted){if(n.paused=!1,this.#m(t),this.#l&&t.pendingTrailers&&t.bufferedChunks.length===0&&!n.paused&&!n.aborted){try{t.handler.onResponseEnd?.(t.controller,t.pendingTrailers)}catch{}t.pendingTrailers=null,t.done=!0}this.#g()}},pause:()=>{n.aborted||(n.paused=!0)},get paused(){return n.paused},get aborted(){return n.aborted},get reason(){return n.reason},abort:e=>{n.aborted=!0,n.reason=e??null,t.done=!0,t.pendingTrailers=null,t.bufferedChunks=[],t.bufferedBytes=0}},t}#p(e,t){if(e.done||e.controller.aborted){e.done=!0,e.bufferedChunks=[],e.bufferedBytes=0;return}let r=Buffer.from(t);if(e.bufferedChunks.push(r),e.bufferedBytes+=r.length,e.bufferedBytes>this.#n){let t=new n(`Deduplicated waiting handler exceeded maxBufferSize (${this.#n} bytes) while paused`);this.#h(e,t)}}#m(e){let{handler:t,controller:n}=e;for(;!e.done&&!n.aborted&&!n.paused&&e.bufferedChunks.length>0;){let r=e.bufferedChunks.shift();e.bufferedBytes-=r.length;try{t.onResponseData?.(n,r)}catch{}if(n.aborted){e.done=!0,e.pendingTrailers=null,e.bufferedChunks=[],e.bufferedBytes=0;break}}}#h(e,t){if(!e.done){e.done=!0,e.pendingTrailers=null,e.bufferedChunks=[],e.bufferedBytes=0;try{e.controller.abort(t),e.handler.onResponseError?.(e.controller,t)}catch{}}}#g(){this.#t=this.#t.filter(e=>e.done===!1)}}})),Ye=t(((t,n)=>{let r=e(`node:diagnostics_channel`),i=T(),a=Je(),{normalizeHeaders:o,makeCacheKey:s,makeDeduplicationKey:c}=Ve(),l=r.channel(`undici:request:pending-requests`);n.exports=(e={})=>{let{methods:t=[`GET`],skipHeaderNames:n=[],excludeHeaderNames:r=[],maxBufferSize:u=5242880}=e;if(typeof e!=`object`||!e)throw TypeError(`expected type of opts to be an Object, got ${e===null?`null`:typeof e}`);if(!Array.isArray(t))throw TypeError(`expected opts.methods to be an array, got ${typeof t}`);for(let e of t)if(!i.safeHTTPMethods.includes(e))throw TypeError(`expected opts.methods to only contain safe HTTP methods, got ${e}`);if(!Array.isArray(n))throw TypeError(`expected opts.skipHeaderNames to be an array, got ${typeof n}`);if(!Array.isArray(r))throw TypeError(`expected opts.excludeHeaderNames to be an array, got ${typeof r}`);if(!Number.isFinite(u)||u<=0)throw TypeError(`expected opts.maxBufferSize to be a positive finite number, got ${u}`);let d=new Set(n.map(e=>e.toLowerCase())),f=new Set(r.map(e=>e.toLowerCase())),p=new Map;return e=>(n,r)=>{if(!n.origin||t.includes(n.method)===!1)return e(n,r);if(n={...n,headers:o(n)},d.size>0){for(let t of Object.keys(n.headers))if(d.has(t.toLowerCase()))return e(n,r)}let i=s(n),m=c(i,f),h=p.get(m);if(h)return h.addWaitingHandler(r)?!0:e(n,r);let g=new a(r,()=>{p.delete(m),l.hasSubscribers&&l.publish({size:p.size,key:m,type:`removed`})},u);return p.set(m,g),l.hasSubscribers&&l.publish({size:p.size,key:m,type:`added`}),e(n,g)}}})),Xe=t(((t,n)=>{let{Writable:r}=e(`node:stream`),{assertCacheKey:i,assertCacheValue:a}=Ve(),o,s=2e9;n.exports=class{#e=s;#t=1/0;#n;#r;#i;#a;#o;#s;#c;#l;constructor(t){if(t){if(typeof t!=`object`)throw TypeError(`SqliteCacheStore options must be an object`);if(t.maxEntrySize!==void 0){if(typeof t.maxEntrySize!=`number`||!Number.isInteger(t.maxEntrySize)||t.maxEntrySize<0)throw TypeError(`SqliteCacheStore options.maxEntrySize must be a non-negative integer`);if(t.maxEntrySize>s)throw TypeError(`SqliteCacheStore options.maxEntrySize must be less than 2gb`);this.#e=t.maxEntrySize}if(t.maxCount!==void 0){if(typeof t.maxCount!=`number`||!Number.isInteger(t.maxCount)||t.maxCount<0)throw TypeError(`SqliteCacheStore options.maxCount must be a non-negative integer`);this.#t=t.maxCount}}o||=e(`node:sqlite`).DatabaseSync,this.#n=new o(t?.location??`:memory:`),this.#n.exec(`
|
|
10
|
+
`,`latin1`),t!==null&&r!==t){if(n[ae])throw new s;process.emitWarning(new s)}e[w].timeout&&e[w].timeoutType===3&&e[w].timeout.refresh&&e[w].timeout.refresh(),n[q]()}}destroy(e){let{socket:t,client:n,abort:i}=this;t[j]=!1,e&&(r(n[O]<=1,`pipeline should only contain this request`),i(e))}};n.exports=xe})),ae=t(((t,n)=>{let r=e(`node:assert`),{pipeline:i}=e(`node:stream`),a=T(),{RequestContentLengthMismatchError:o,RequestAbortedError:s,SocketError:c,InformationalError:l,InvalidArgumentError:u}=S(),{kUrl:d,kReset:f,kClient:p,kRunning:m,kPending:h,kQueue:g,kPendingIdx:_,kRunningIdx:v,kError:y,kSocket:x,kStrictContentLength:C,kOnError:w,kMaxConcurrentStreams:E,kPingInterval:O,kHTTP2Session:k,kHTTP2InitialWindowSize:A,kHTTP2ConnectionWindowSize:j,kResume:M,kSize:N,kHTTPContext:P,kClosed:F,kBodyTimeout:I,kEnableConnectProtocol:ee,kRemoteSettings:L,kHTTP2Stream:R,kHTTP2SessionState:z}=b(),{channels:B}=D(),V=Symbol(`open streams`),H,U;try{U=e(`node:http2`)}catch{U={constants:{}}}let{constants:{HTTP2_HEADER_AUTHORITY:W,HTTP2_HEADER_METHOD:te,HTTP2_HEADER_PATH:ne,HTTP2_HEADER_SCHEME:re,HTTP2_HEADER_CONTENT_LENGTH:G,HTTP2_HEADER_EXPECT:ae,HTTP2_HEADER_STATUS:K,HTTP2_HEADER_PROTOCOL:oe,NGHTTP2_REFUSED_STREAM:se,NGHTTP2_CANCEL:ce}}=U;function q(e){let t=[];for(let[n,r]of Object.entries(e))if(Array.isArray(r))for(let e of r)t.push(Buffer.from(n),Buffer.from(e));else t.push(Buffer.from(n),Buffer.from(r));return t}function J(e,t){e[x]=t;let n=e[A],r=e[j],i=U.connect(e[d],{createConnection:()=>t,peerMaxConcurrentStreams:e[E],settings:{enablePush:!1,...n==null?null:{initialWindowSize:n}}});return e[x]=t,i[V]=0,i[p]=e,i[x]=t,i[z]={ping:{interval:e[O]===0?null:setInterval(le,e[O],i).unref()}},i[ee]=!1,i[L]=!1,r&&a.addListener(i,`connect`,X.bind(i,r)),a.addListener(i,`error`,ue),a.addListener(i,`frameError`,de),a.addListener(i,`end`,Q),a.addListener(i,`goaway`,fe),a.addListener(i,`close`,pe),a.addListener(i,`remoteSettings`,Z),i.unref(),e[k]=i,t[k]=i,a.addListener(t,`error`,he),a.addListener(t,`end`,$),a.addListener(t,`close`,me),t[F]=!1,t.on(`close`,ge),{version:`h2`,defaultPipelining:1/0,write(t){return ve(e,t)},resume(){Y(e)},destroy(e,n){t[F]?queueMicrotask(n):t.destroy(e).on(`close`,n)},get destroyed(){return t.destroyed},busy(t){if(t!=null){if(e[m]>0){if(t.idempotent===!1||(t.upgrade===`websocket`||t.method===`CONNECT`)&&i[L]===!1||a.bodyLength(t.body)!==0&&(a.isStream(t.body)||a.isAsyncIterable(t.body)||a.isFormDataLike(t.body)))return!0}else return(t.upgrade===`websocket`||t.method===`CONNECT`)&&i[L]===!1}return!1}}}function Y(e){let t=e[x];t?.destroyed===!1&&(e[N]===0||e[E]===0?(t.unref(),e[k].unref()):(t.ref(),e[k].ref()))}function X(e){try{typeof this.setLocalWindowSize==`function`&&this.setLocalWindowSize(e)}catch{}}function Z(e){if(this[p][E]=e.maxConcurrentStreams??this[p][E],this[L]===!0&&this[ee]===!0&&e.enableConnectProtocol===!1){let e=new l(`HTTP/2: Server disabled extended CONNECT protocol against RFC-8441`);this[x][y]=e,this[p][w](e);return}this[ee]=e.enableConnectProtocol??this[ee],this[L]=!0,this[p][M]()}function le(e){let t=e[z];if((e.closed||e.destroyed)&&t.ping.interval!=null){clearInterval(t.ping.interval),t.ping.interval=null;return}e.ping(n.bind(e));function n(e,t){let n=this[p],r=this[p];if(e!=null){let t=new l(`HTTP/2: "PING" errored - type ${e.message}`);r[y]=t,n[w](t)}else n.emit(`ping`,t)}}function ue(e){r(e.code!==`ERR_TLS_CERT_ALTNAME_INVALID`),this[x][y]=e,this[p][w](e)}function de(e,t,n){if(n===0){let n=new l(`HTTP/2: "frameError" received - type ${e}, code ${t}`);this[x][y]=n,this[p][w](n)}}function Q(){let e=new c(`other side closed`,a.getSocketInfo(this[x]));this.destroy(e),a.destroy(this[x],e)}function fe(e){let t=this[y]||new c(`HTTP/2: "GOAWAY" frame received with code ${e}`,a.getSocketInfo(this[x])),n=this[p];if(n[x]=null,n[P]=null,this.close(),this[k]=null,a.destroy(this[x],t),n[v]<n[g].length){let e=n[g][n[v]];n[g][n[v]++]=null,a.errorRequest(n,e,t),n[_]=n[v]}r(n[m]===0),n.emit(`disconnect`,n[d],[n],t),n.emit(`connectionError`,n[d],[n],t),n[M]()}function pe(){let{[p]:e,[z]:t}=this,{[x]:n}=e,i=this[x][y]||this[y]||new c(`closed`,a.getSocketInfo(n));if(e[x]=null,e[P]=null,t.ping.interval!=null&&(clearInterval(t.ping.interval),t.ping.interval=null),e.destroyed){r(e[h]===0);let t=e[g].splice(e[v]);for(let n=0;n<t.length;n++){let r=t[n];a.errorRequest(e,r,i)}}}function me(){let e=this[y]||new c(`closed`,a.getSocketInfo(this)),t=this[k][p];t[x]=null,t[P]=null,this[k]!==null&&this[k].destroy(e),t[_]=t[v],r(t[m]===0),t.emit(`disconnect`,t[d],[t],e),t[M]()}function he(e){r(e.code!==`ERR_TLS_CERT_ALTNAME_INVALID`),this[y]=e,this[p][w](e)}function $(){a.destroy(this,new c(`other side closed`,a.getSocketInfo(this)))}function ge(){this[F]=!0}function _e(e){return e!==`GET`&&e!==`HEAD`&&e!==`OPTIONS`&&e!==`TRACE`&&e!==`CONNECT`}function ve(e,t){let n=t.bodyTimeout??e[I],i=e[k],{method:c,path:f,host:p,upgrade:m,expectContinue:h,signal:y,protocol:b,headers:S}=t,{body:T}=t;if(m!=null&&m!==`websocket`)return a.errorRequest(e,t,new u(`Custom upgrade "${m}" not supported over HTTP/2`)),!1;let E={};for(let e=0;e<S.length;e+=2){let t=S[e+0],n=S[e+1];if(t===`cookie`){E[t]=E[t]==null?n:Array.isArray(E[t])?(E[t].push(n),E[t]):[E[t],n];continue}if(Array.isArray(n))for(let e=0;e<n.length;e++)E[t]?E[t]+=`, ${n[e]}`:E[t]=n[e];else E[t]?E[t]+=`, ${n}`:E[t]=n}let D=null,{hostname:O,port:A}=e[d];E[W]=p||`${O}${A?`:${A}`:``}`,E[te]=c;let j=n=>{t.aborted||t.completed||(n||=new s,a.errorRequest(e,t,n),D!=null&&(D.removeAllListeners(`data`),D.close(),e[w](n),e[M]()),a.destroy(T,n))};try{t.onConnect(j)}catch(n){a.errorRequest(e,t,n)}if(t.aborted)return!1;if(m||c===`CONNECT`)return i.ref(),m===`websocket`?i[ee]===!1?(a.errorRequest(e,t,new l(`HTTP/2: Extended CONNECT protocol not supported by server`)),i.unref(),!1):(E[te]=`CONNECT`,E[oe]=`websocket`,E[ne]=f,b===`ws:`||b===`wss:`?E[re]=b===`ws:`?`http`:`https`:E[re]=b===`http:`?`http`:`https`,D=i.request(E,{endStream:!1,signal:y}),D[R]=!0,D.once(`response`,(n,r)=>{let{[K]:a,...o}=n;t.onUpgrade(a,q(o),D),++i[V],e[g][e[v]++]=null}),D.on(`error`,()=>{(D.rstCode===se||D.rstCode===ce)&&j(new l(`HTTP/2: "stream error" received - code ${D.rstCode}`))}),D.once(`close`,()=>{--i[V],i[V]===0&&i.unref()}),D.setTimeout(n),!0):(D=i.request(E,{endStream:!1,signal:y}),D[R]=!0,D.on(`response`,n=>{let{[K]:r,...a}=n;t.onUpgrade(r,q(a),D),++i[V],e[g][e[v]++]=null}),D.once(`close`,()=>{--i[V],i[V]===0&&i.unref()}),D.setTimeout(n),!0);E[ne]=f,E[re]=b===`http:`?`http`:`https`;let N=c===`PUT`||c===`POST`||c===`PATCH`;T&&typeof T.read==`function`&&T.read(0);let P=a.bodyLength(T);if(a.isFormDataLike(T)){H??=ie().extractBody;let[e,t]=H(T);E[`content-type`]=t,T=e.stream,P=e.length}if(P??=t.contentLength,N||(P=null),_e(c)&&P>0&&t.contentLength!=null&&t.contentLength!==P){if(e[C])return a.errorRequest(e,t,new o),!1;process.emitWarning(new o)}if(P!=null&&(r(T||P===0,`no body must not have content length`),E[G]=`${P}`),i.ref(),B.sendHeaders.hasSubscribers){let e=``;for(let t in E)e+=`${t}: ${E[t]}\r\n`;B.sendHeaders.publish({request:t,headers:e,socket:i[x]})}let F=c===`GET`||c===`HEAD`||T===null;h?(E[ae]=`100-continue`,D=i.request(E,{endStream:F,signal:y}),D[R]=!0,D.once(`continue`,z)):(D=i.request(E,{endStream:F,signal:y}),D[R]=!0,z()),++i[V],D.setTimeout(n);let L=!1;return D.once(`response`,e=>{let{[K]:n,...r}=e;if(t.onResponseStarted(),L=!0,t.aborted){D.removeAllListeners(`data`);return}t.onHeaders(Number(n),q(r),D.resume.bind(D),``)===!1&&D.pause(),D.on(`data`,e=>{t.aborted||t.completed||t.onData(e)===!1&&D.pause()})}),D.once(`end`,()=>{D.removeAllListeners(`data`),L?(!t.aborted&&!t.completed&&t.onComplete({}),e[g][e[v]++]=null,e[M]()):(j(new l(`HTTP/2: stream half-closed (remote)`)),e[g][e[v]++]=null,e[_]=e[v],e[M]())}),D.once(`close`,()=>{D.removeAllListeners(`data`),--i[V],i[V]===0&&i.unref()}),D.once(`error`,function(e){D.removeAllListeners(`data`),j(e)}),D.once(`frameError`,(e,t)=>{D.removeAllListeners(`data`),j(new l(`HTTP/2: "frameError" received - type ${e}, code ${t}`))}),D.on(`aborted`,()=>{D.removeAllListeners(`data`)}),D.on(`timeout`,()=>{let e=new l(`HTTP/2: "stream timeout after ${n}"`);D.removeAllListeners(`data`),--i[V],i[V]===0&&i.unref(),j(e)}),D.once(`trailers`,e=>{t.aborted||t.completed||(D.removeAllListeners(`data`),t.onComplete(e))}),!0;function z(){!T||P===0?ye(j,D,null,e,t,e[x],P,N):a.isBuffer(T)?ye(j,D,T,e,t,e[x],P,N):a.isBlobLike(T)?typeof T.stream==`function`?Se(j,D,T.stream(),e,t,e[x],P,N):xe(j,D,T,e,t,e[x],P,N):a.isStream(T)?be(j,e[x],N,D,T,e,t,P):a.isIterable(T)?Se(j,D,T,e,t,e[x],P,N):r(!1)}}function ye(e,t,n,i,o,s,c,l){try{n!=null&&a.isBuffer(n)&&(r(c===n.byteLength,`buffer body must have content length`),t.cork(),t.write(n),t.uncork(),t.end(),o.onBodySent(n)),l||(s[f]=!0),o.onRequestSent(),i[M]()}catch(t){e(t)}}function be(e,t,n,o,s,c,l,u){r(u!==0||c[m]===0,`stream body cannot be pipelined`);let d=i(s,o,r=>{r?(a.destroy(d,r),e(r)):(a.removeAllListeners(d),l.onRequestSent(),n||(t[f]=!0),c[M]())});a.addListener(d,`data`,p);function p(e){l.onBodySent(e)}}async function xe(e,t,n,i,a,s,c,l){r(c===n.size,`blob body must have content length`);try{if(c!=null&&c!==n.size)throw new o;let e=Buffer.from(await n.arrayBuffer());t.cork(),t.write(e),t.uncork(),t.end(),a.onBodySent(e),a.onRequestSent(),l||(s[f]=!0),i[M]()}catch(t){e(t)}}async function Se(e,t,n,i,a,o,s,c){r(s!==0||i[m]===0,`iterator body cannot be pipelined`);let l=null;function u(){if(l){let e=l;l=null,e()}}let d=()=>new Promise((e,t)=>{r(l===null),o[y]?t(o[y]):l=e});t.on(`close`,u).on(`drain`,u);try{for await(let e of n){if(o[y])throw o[y];let n=t.write(e);a.onBodySent(e),n||await d()}t.end(),a.onRequestSent(),c||(o[f]=!0),i[M]()}catch(t){e(t)}finally{t.off(`close`,u).off(`drain`,u)}}n.exports=J})),K=t(((t,n)=>{let r=e(`node:assert`),i=e(`node:net`),a=e(`node:http`),o=T(),{ClientStats:s}=E(),{channels:c}=D(),l=O(),u=M(),{InvalidArgumentError:d,InformationalError:f,ClientDestroyedError:p}=S(),m=N(),{kUrl:h,kServerName:g,kClient:_,kBusy:v,kConnect:y,kResuming:x,kRunning:C,kPending:w,kSize:k,kQueue:A,kConnected:j,kConnecting:P,kNeedDrain:F,kKeepAliveDefaultTimeout:I,kHostHeader:ee,kPendingIdx:L,kRunningIdx:R,kError:z,kPipelining:B,kKeepAliveTimeoutValue:V,kMaxHeadersSize:H,kKeepAliveMaxTimeout:U,kKeepAliveTimeoutThreshold:W,kHeadersTimeout:te,kBodyTimeout:ne,kStrictContentLength:re,kConnector:ie,kMaxRequests:K,kCounter:oe,kClose:se,kDestroy:ce,kDispatch:q,kLocalAddress:J,kMaxResponseSize:Y,kOnError:X,kHTTPContext:Z,kMaxConcurrentStreams:le,kHTTP2InitialWindowSize:ue,kHTTP2ConnectionWindowSize:de,kResume:Q,kPingInterval:fe}=b(),pe=G(),me=ae(),he=Symbol(`kClosedResolve`),$=a&&a.maxHeaderSize&&Number.isInteger(a.maxHeaderSize)&&a.maxHeaderSize>0?()=>a.maxHeaderSize:()=>{throw new d(`http module not available or http.maxHeaderSize invalid`)},ge=()=>{};function _e(e){return e[B]??e[Z]?.defaultPipelining??1}var ve=class extends u{constructor(e,{maxHeaderSize:t,headersTimeout:n,socketTimeout:r,requestTimeout:a,connectTimeout:s,bodyTimeout:c,idleTimeout:l,keepAlive:u,keepAliveTimeout:f,maxKeepAliveTimeout:p,keepAliveMaxTimeout:_,keepAliveTimeoutThreshold:v,socketPath:y,pipelining:b,tls:S,strictContentLength:C,maxCachedSessions:w,connect:T,maxRequestsPerClient:E,localAddress:D,maxResponseSize:O,autoSelectFamily:k,autoSelectFamilyAttemptTimeout:j,maxConcurrentStreams:M,allowH2:N,useH2c:P,initialWindowSize:z,connectionWindowSize:G,pingInterval:ae,webSocket:oe}={}){if(u!==void 0)throw new d(`unsupported keepAlive, use pipelining=0 instead`);if(r!==void 0)throw new d(`unsupported socketTimeout, use headersTimeout & bodyTimeout instead`);if(a!==void 0)throw new d(`unsupported requestTimeout, use headersTimeout & bodyTimeout instead`);if(l!==void 0)throw new d(`unsupported idleTimeout, use keepAliveTimeout instead`);if(p!==void 0)throw new d(`unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead`);if(t!=null){if(!Number.isInteger(t)||t<1)throw new d(`invalid maxHeaderSize`)}else t=$();if(y!=null&&typeof y!=`string`)throw new d(`invalid socketPath`);if(s!=null&&(!Number.isFinite(s)||s<0))throw new d(`invalid connectTimeout`);if(f!=null&&(!Number.isFinite(f)||f<=0))throw new d(`invalid keepAliveTimeout`);if(_!=null&&(!Number.isFinite(_)||_<=0))throw new d(`invalid keepAliveMaxTimeout`);if(v!=null&&!Number.isFinite(v))throw new d(`invalid keepAliveTimeoutThreshold`);if(n!=null&&(!Number.isInteger(n)||n<0))throw new d(`headersTimeout must be a positive integer or zero`);if(c!=null&&(!Number.isInteger(c)||c<0))throw new d(`bodyTimeout must be a positive integer or zero`);if(T!=null&&typeof T!=`function`&&typeof T!=`object`)throw new d(`connect must be a function or an object`);if(E!=null&&(!Number.isInteger(E)||E<0))throw new d(`maxRequestsPerClient must be a positive number`);if(D!=null&&(typeof D!=`string`||i.isIP(D)===0))throw new d(`localAddress must be valid string IP address`);if(O!=null&&(!Number.isInteger(O)||O<-1))throw new d(`maxResponseSize must be a positive number`);if(j!=null&&(!Number.isInteger(j)||j<-1))throw new d(`autoSelectFamilyAttemptTimeout must be a positive number`);if(N!=null&&typeof N!=`boolean`)throw new d(`allowH2 must be a valid boolean value`);if(M!=null&&(typeof M!=`number`||M<1))throw new d(`maxConcurrentStreams must be a positive integer, greater than 0`);if(P!=null&&typeof P!=`boolean`)throw new d(`useH2c must be a valid boolean value`);if(z!=null&&(!Number.isInteger(z)||z<1))throw new d(`initialWindowSize must be a positive integer, greater than 0`);if(G!=null&&(!Number.isInteger(G)||G<1))throw new d(`connectionWindowSize must be a positive integer, greater than 0`);if(ae!=null&&(typeof ae!=`number`||!Number.isInteger(ae)||ae<0))throw new d(`pingInterval must be a positive integer, greater or equal to 0`);if(super({webSocket:oe}),typeof T!=`function`)T=m({...S,maxCachedSessions:w,allowH2:N,useH2c:P,socketPath:y,timeout:s,...typeof k==`boolean`?{autoSelectFamily:k,autoSelectFamilyAttemptTimeout:j}:void 0,...T});else{let e=T;T=(t,n)=>e({...t,...y==null?null:{socketPath:y},...N==null?null:{allowH2:N}},n)}this[h]=o.parseOrigin(e),this[ie]=T,this[B]=b??1,this[H]=t,this[I]=f??4e3,this[U]=_??6e5,this[W]=v??2e3,this[V]=this[I],this[g]=null,this[J]=D??null,this[x]=0,this[F]=0,this[ee]=`host: ${this[h].hostname}${this[h].port?`:${this[h].port}`:``}\r\n`,this[ne]=c??3e5,this[te]=n??3e5,this[re]=C??!0,this[K]=E,this[he]=null,this[Y]=O>-1?O:-1,this[Z]=null,this[le]=M??100,this[ue]=z??262144,this[de]=G??524288,this[fe]=ae??6e4,this[A]=[],this[R]=0,this[L]=0,this[Q]=e=>Ce(this,e),this[X]=e=>ye(this,e)}get pipelining(){return this[B]}set pipelining(e){this[B]=e,this[Q](!0)}get stats(){return new s(this)}get[w](){return this[A].length-this[L]}get[C](){return this[L]-this[R]}get[k](){return this[A].length-this[R]}get[j](){return!!this[Z]&&!this[P]&&!this[Z].destroyed}get[v](){return!!(this[Z]?.busy(null)||this[k]>=(_e(this)||1)||this[w]>0)}[y](e){be(this),this.once(`connect`,e)}[q](e,t){let n=new l(this[h].origin,e,t);return this[A].push(n),this[x]||(o.bodyLength(n.body)==null&&o.isIterable(n.body)?(this[x]=1,queueMicrotask(()=>Ce(this))):this[Q](!0)),this[x]&&this[F]!==2&&this[v]&&(this[F]=2),this[F]<2}[se](){return new Promise(e=>{this[k]?this[he]=e:e(null)})}[ce](e){return new Promise(t=>{let n=this[A].splice(this[L]);for(let t=0;t<n.length;t++){let r=n[t];o.errorRequest(this,r,e)}let r=()=>{this[he]&&(this[he](),this[he]=null),t(null)};this[Z]?(this[Z].destroy(e,r),this[Z]=null):queueMicrotask(r),this[Q]()})}};function ye(e,t){if(e[C]===0&&t.code!==`UND_ERR_INFO`&&t.code!==`UND_ERR_SOCKET`){r(e[L]===e[R]);let n=e[A].splice(e[R]);for(let r=0;r<n.length;r++){let i=n[r];o.errorRequest(e,i,t)}r(e[k]===0)}}function be(e){r(!e[P]),r(!e[Z]);let{host:t,hostname:n,protocol:a,port:s}=e[h];if(n[0]===`[`){let e=n.indexOf(`]`);r(e!==-1);let t=n.substring(1,e);r(i.isIPv6(t)),n=t}e[P]=!0,c.beforeConnect.hasSubscribers&&c.beforeConnect.publish({connectParams:{host:t,hostname:n,protocol:a,port:s,version:e[Z]?.version,servername:e[g],localAddress:e[J]},connector:e[ie]});try{e[ie]({host:t,hostname:n,protocol:a,port:s,servername:e[g],localAddress:e[J]},(i,l)=>{if(i){xe(e,i,{host:t,hostname:n,protocol:a,port:s}),e[Q]();return}if(e.destroyed){o.destroy(l.on(`error`,ge),new p),e[Q]();return}r(l);try{e[Z]=l.alpnProtocol===`h2`?me(e,l):pe(e,l)}catch(r){l.destroy().on(`error`,ge),xe(e,r,{host:t,hostname:n,protocol:a,port:s}),e[Q]();return}e[P]=!1,l[oe]=0,l[K]=e[K],l[_]=e,l[z]=null,c.connected.hasSubscribers&&c.connected.publish({connectParams:{host:t,hostname:n,protocol:a,port:s,version:e[Z]?.version,servername:e[g],localAddress:e[J]},connector:e[ie],socket:l}),e.emit(`connect`,e[h],[e]),e[Q]()})}catch(r){xe(e,r,{host:t,hostname:n,protocol:a,port:s}),e[Q]()}}function xe(e,t,{host:n,hostname:i,protocol:a,port:s}){if(!e.destroyed){if(e[P]=!1,c.connectError.hasSubscribers&&c.connectError.publish({connectParams:{host:n,hostname:i,protocol:a,port:s,version:e[Z]?.version,servername:e[g],localAddress:e[J]},connector:e[ie],error:t}),t.code===`ERR_TLS_CERT_ALTNAME_INVALID`)for(r(e[C]===0);e[w]>0&&e[A][e[L]].servername===e[g];){let n=e[A][e[L]++];o.errorRequest(e,n,t)}else ye(e,t);e.emit(`connectionError`,e[h],[e],t)}}function Se(e){e[F]=0,e.emit(`drain`,e[h],[e])}function Ce(e,t){e[x]!==2&&(e[x]=2,we(e,t),e[x]=0,e[R]>256&&(e[A].splice(0,e[R]),e[L]-=e[R],e[R]=0))}function we(e,t){for(;;){if(e.destroyed){r(e[w]===0);return}if(e[he]&&!e[k]){e[he](),e[he]=null;return}if(e[Z]&&e[Z].resume(),e[v])e[F]=2;else if(e[F]===2){t?(e[F]=1,queueMicrotask(()=>Se(e))):Se(e);continue}if(e[w]===0||e[C]>=(_e(e)||1))return;let n=e[A][e[L]];if(n===null)return;if(e[h].protocol===`https:`&&e[g]!==n.servername){if(e[C]>0)return;e[g]=n.servername,e[Z]?.destroy(new f(`servername changed`),()=>{e[Z]=null,Ce(e)})}if(e[P])return;if(!e[Z]){be(e);return}if(e[Z].destroyed||e[Z].busy(n))return;!n.aborted&&e[Z].write(n)?e[L]++:e[A].splice(e[L],1)}}n.exports=ve})),oe=t(((e,t)=>{let n=2047;var r=class{bottom=0;top=0;list=Array(2048).fill(void 0);next=null;isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&n)===this.bottom}push(e){this.list[this.top]=e,this.top=this.top+1&n}shift(){let e=this.list[this.bottom];return e===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&n,e)}};t.exports=class{constructor(){this.head=this.tail=new r}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new r),this.head.push(e)}shift(){let e=this.tail,t=e.shift();return e.isEmpty()&&e.next!==null&&(this.tail=e.next,e.next=null),t}}})),se=t(((e,t)=>{let{PoolStats:n}=E(),r=M(),i=oe(),{kConnected:a,kSize:o,kRunning:s,kPending:c,kQueued:l,kBusy:u,kFree:d,kUrl:f,kClose:p,kDestroy:m,kDispatch:h}=b(),g=Symbol(`clients`),_=Symbol(`needDrain`),v=Symbol(`queue`),y=Symbol(`closed resolve`),x=Symbol(`onDrain`),S=Symbol(`onConnect`),C=Symbol(`onDisconnect`),w=Symbol(`onConnectionError`),T=Symbol(`get dispatcher`),D=Symbol(`add client`),O=Symbol(`remove client`);t.exports={PoolBase:class extends r{[v]=new i;[l]=0;[g]=[];[_]=!1;[x](e,t,n){let r=this[v],i=!1;for(;!i;){let t=r.shift();if(!t)break;this[l]--,i=!e.dispatch(t.opts,t.handler)}if(e[_]=i,!i&&this[_]&&(this[_]=!1,this.emit(`drain`,t,[this,...n])),this[y]&&r.isEmpty()){let e=[];for(let t=0;t<this[g].length;t++){let n=this[g][t];n.destroyed||e.push(n.close())}return Promise.all(e).then(this[y])}}[S]=(e,t)=>{this.emit(`connect`,e,[this,...t])};[C]=(e,t,n)=>{this.emit(`disconnect`,e,[this,...t],n)};[w]=(e,t,n)=>{this.emit(`connectionError`,e,[this,...t],n)};get[u](){return this[_]}get[a](){let e=0;for(let{[a]:t}of this[g])e+=t;return e}get[d](){let e=0;for(let{[a]:t,[_]:n}of this[g])e+=t&&!n;return e}get[c](){let e=this[l];for(let{[c]:t}of this[g])e+=t;return e}get[s](){let e=0;for(let{[s]:t}of this[g])e+=t;return e}get[o](){let e=this[l];for(let{[o]:t}of this[g])e+=t;return e}get stats(){return new n(this)}[p](){if(this[v].isEmpty()){let e=[];for(let t=0;t<this[g].length;t++){let n=this[g][t];n.destroyed||e.push(n.close())}return Promise.all(e)}return new Promise(e=>{this[y]=e})}[m](e){for(;;){let t=this[v].shift();if(!t)break;t.handler.onError(e)}let t=Array(this[g].length);for(let n=0;n<this[g].length;n++)t[n]=this[g][n].destroy(e);return Promise.all(t)}[h](e,t){let n=this[T]();return n?n.dispatch(e,t)||(n[_]=!0,this[_]=!this[T]()):(this[_]=!0,this[v].push({opts:e,handler:t}),this[l]++),!this[_]}[D](e){return e.on(`drain`,this[x].bind(this,e)).on(`connect`,this[S]).on(`disconnect`,this[C]).on(`connectionError`,this[w]),this[g].push(e),this[_]&&queueMicrotask(()=>{this[_]&&this[x](e,e[f],[e,this])}),this}[O](e){e.close(()=>{let t=this[g].indexOf(e);t!==-1&&this[g].splice(t,1)}),this[_]=this[g].some(e=>!e[_]&&e.closed!==!0&&e.destroyed!==!0)}},kClients:g,kNeedDrain:_,kAddClient:D,kRemoveClient:O,kGetDispatcher:T}})),ce=t(((e,t)=>{let{PoolBase:n,kClients:r,kNeedDrain:i,kAddClient:a,kGetDispatcher:o,kRemoveClient:s}=se(),c=K(),{InvalidArgumentError:l}=S(),u=T(),{kUrl:d}=b(),f=N(),p=Symbol(`options`),m=Symbol(`connections`),h=Symbol(`factory`);function g(e,t){return new c(e,t)}t.exports=class extends n{constructor(e,{connections:t,factory:n=g,connect:i,connectTimeout:a,tls:o,maxCachedSessions:s,socketPath:c,autoSelectFamily:_,autoSelectFamilyAttemptTimeout:v,allowH2:y,clientTtl:b,...x}={}){if(t!=null&&(!Number.isFinite(t)||t<0))throw new l(`invalid connections`);if(typeof n!=`function`)throw new l(`factory must be a function.`);if(i!=null&&typeof i!=`function`&&typeof i!=`object`)throw new l(`connect must be a function or an object`);typeof i!=`function`&&(i=f({...o,maxCachedSessions:s,allowH2:y,socketPath:c,timeout:a,...typeof _==`boolean`?{autoSelectFamily:_,autoSelectFamilyAttemptTimeout:v}:void 0,...i})),super(x),this[m]=t||null,this[d]=u.parseOrigin(e),this[p]={...u.deepClone(x),connect:i,allowH2:y,clientTtl:b,socketPath:c},this[p].interceptors=x.interceptors?{...x.interceptors}:void 0,this[h]=n,this.on(`connect`,(e,t)=>{if(b!=null&&b>0)for(let e of t)Object.assign(e,{ttl:Date.now()})}),this.on(`connectionError`,(e,t,n)=>{for(let e of t){let t=this[r].indexOf(e);t!==-1&&this[r].splice(t,1)}})}[o](){let e=this[p].clientTtl;for(let t of this[r])if(e!=null&&e>0&&t.ttl&&Date.now()-t.ttl>e)this[s](t);else if(!t[i])return t;if(!this[m]||this[r].length<this[m]){let e=this[h](this[d],this[p]);return this[a](e),e}}}})),q=t(((e,t)=>{let{BalancedPoolMissingUpstreamError:n,InvalidArgumentError:r}=S(),{PoolBase:i,kClients:a,kNeedDrain:o,kAddClient:s,kRemoveClient:c,kGetDispatcher:l}=se(),u=ce(),{kUrl:d}=b(),f=T(),p=Symbol(`factory`),m=Symbol(`options`),h=Symbol(`kGreatestCommonDivisor`),g=Symbol(`kCurrentWeight`),_=Symbol(`kIndex`),v=Symbol(`kWeight`),y=Symbol(`kMaxWeightPerServer`),x=Symbol(`kErrorPenalty`);function C(e,t){if(e===0)return t;for(;t!==0;){let n=t;t=e%t,e=n}return e}function w(e,t){return new u(e,t)}t.exports=class extends i{constructor(e=[],{factory:t=w,...n}={}){if(typeof t!=`function`)throw new r(`factory must be a function.`);super(n),this[m]={...f.deepClone(n)},this[m].interceptors=n.interceptors?{...n.interceptors}:void 0,this[_]=-1,this[g]=0,this[y]=this[m].maxWeightPerServer||100,this[x]=this[m].errorPenalty||15,Array.isArray(e)||(e=[e]),this[p]=t;for(let t of e)this.addUpstream(t);this._updateBalancedPoolStats()}addUpstream(e){let t=f.parseOrigin(e).origin;if(this[a].find(e=>e[d].origin===t&&e.closed!==!0&&e.destroyed!==!0))return this;let n=this[p](t,this[m]);this[s](n),n.on(`connect`,()=>{n[v]=Math.min(this[y],n[v]+this[x])}),n.on(`connectionError`,()=>{n[v]=Math.max(1,n[v]-this[x]),this._updateBalancedPoolStats()}),n.on(`disconnect`,(...e)=>{let t=e[2];t&&t.code===`UND_ERR_SOCKET`&&(n[v]=Math.max(1,n[v]-this[x]),this._updateBalancedPoolStats())});for(let e of this[a])e[v]=this[y];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let t=0;t<this[a].length;t++)e=C(this[a][t][v],e);this[h]=e}removeUpstream(e){let t=f.parseOrigin(e).origin,n=this[a].find(e=>e[d].origin===t&&e.closed!==!0&&e.destroyed!==!0);return n&&this[c](n),this}getUpstream(e){let t=f.parseOrigin(e).origin;return this[a].find(e=>e[d].origin===t&&e.closed!==!0&&e.destroyed!==!0)}get upstreams(){return this[a].filter(e=>e.closed!==!0&&e.destroyed!==!0).map(e=>e[d].origin)}[l](){if(this[a].length===0)throw new n;if(!this[a].find(e=>!e[o]&&e.closed!==!0&&e.destroyed!==!0)||this[a].map(e=>e[o]).reduce((e,t)=>e&&t,!0))return;let e=0,t=this[a].findIndex(e=>!e[o]);for(;e++<this[a].length;){this[_]=(this[_]+1)%this[a].length;let e=this[a][this[_]];if(e[v]>this[a][t][v]&&!e[o]&&(t=this[_]),this[_]===0&&(this[g]=this[g]-this[h],this[g]<=0&&(this[g]=this[y])),e[v]>=this[g]&&!e[o])return e}return this[g]=this[a][t][v],this[_]=t,this[a][t]}}})),J=t(((e,t)=>{let{PoolBase:n,kClients:r,kNeedDrain:i,kAddClient:a,kGetDispatcher:o,kRemoveClient:s}=se(),c=K(),{InvalidArgumentError:l}=S(),u=T(),{kUrl:d}=b(),f=N(),p=Symbol(`options`),m=Symbol(`connections`),h=Symbol(`factory`),g=Symbol(`index`);function _(e,t){return new c(e,t)}t.exports=class extends n{constructor(e,{connections:t,factory:n=_,connect:i,connectTimeout:a,tls:o,maxCachedSessions:s,socketPath:c,autoSelectFamily:v,autoSelectFamilyAttemptTimeout:y,allowH2:b,clientTtl:x,...S}={}){if(t!=null&&(!Number.isFinite(t)||t<0))throw new l(`invalid connections`);if(typeof n!=`function`)throw new l(`factory must be a function.`);if(i!=null&&typeof i!=`function`&&typeof i!=`object`)throw new l(`connect must be a function or an object`);typeof i!=`function`&&(i=f({...o,maxCachedSessions:s,allowH2:b,socketPath:c,timeout:a,...typeof v==`boolean`?{autoSelectFamily:v,autoSelectFamilyAttemptTimeout:y}:void 0,...i})),super(),this[m]=t||null,this[d]=u.parseOrigin(e),this[p]={...u.deepClone(S),connect:i,allowH2:b,clientTtl:x,socketPath:c},this[p].interceptors=S.interceptors?{...S.interceptors}:void 0,this[h]=n,this[g]=-1,this.on(`connect`,(e,t)=>{if(x!=null&&x>0)for(let e of t)Object.assign(e,{ttl:Date.now()})}),this.on(`connectionError`,(e,t,n)=>{for(let e of t){let t=this[r].indexOf(e);t!==-1&&this[r].splice(t,1)}})}[o](){let e=this[p].clientTtl,t=this[r].length;if(t===0){let e=this[h](this[d],this[p]);return this[a](e),e}let n=0;for(;n<t;){this[g]=(this[g]+1)%t;let a=this[r][this[g]];if(e!=null&&e>0&&a.ttl&&Date.now()-a.ttl>e){this[s](a),n++;continue}if(!a[i])return a;n++}if(!this[m]||t<this[m]){let e=this[h](this[d],this[p]);return this[a](e),e}}}})),Y=t(((e,t)=>{let{InvalidArgumentError:n,MaxOriginsReachedError:r}=S(),{kClients:i,kRunning:a,kClose:o,kDestroy:s,kDispatch:c,kUrl:l}=b(),u=M(),d=ce(),f=K(),p=T(),m=Symbol(`onConnect`),h=Symbol(`onDisconnect`),g=Symbol(`onConnectionError`),_=Symbol(`onDrain`),v=Symbol(`factory`),y=Symbol(`options`),x=Symbol(`origins`);function C(e,t){return t&&t.connections===1?new f(e,t):new d(e,t)}t.exports=class extends u{constructor({factory:e=C,maxOrigins:t=1/0,connect:r,...a}={}){if(typeof e!=`function`)throw new n(`factory must be a function.`);if(r!=null&&typeof r!=`function`&&typeof r!=`object`)throw new n(`connect must be a function or an object`);if(typeof t!=`number`||Number.isNaN(t)||t<=0)throw new n(`maxOrigins must be a number greater than 0`);super(a),r&&typeof r!=`function`&&(r={...r}),this[y]={...p.deepClone(a),maxOrigins:t,connect:r},this[v]=e,this[i]=new Map,this[x]=new Set,this[_]=(e,t)=>{this.emit(`drain`,e,[this,...t])},this[m]=(e,t)=>{this.emit(`connect`,e,[this,...t])},this[h]=(e,t,n)=>{this.emit(`disconnect`,e,[this,...t],n)},this[g]=(e,t,n)=>{this.emit(`connectionError`,e,[this,...t],n)}}get[a](){let e=0;for(let{dispatcher:t}of this[i].values())e+=t[a];return e}[c](e,t){let a;if(e.origin&&(typeof e.origin==`string`||e.origin instanceof URL))a=String(e.origin);else throw new n(`opts.origin must be a non-empty string or URL.`);if(this[x].size>=this[y].maxOrigins&&!this[x].has(a))throw new r;let o=this[i].get(a),s=o&&o.dispatcher;if(!s){let t=e=>{let t=this[i].get(a);t&&(e&&--t.count,t.count<=0&&(this[i].delete(a),t.dispatcher.destroyed||t.dispatcher.close()),this[x].delete(a))};s=this[v](e.origin,this[y]).on(`drain`,this[_]).on(`connect`,(e,t)=>{let n=this[i].get(a);n&&(n.count+=1),this[m](e,t)}).on(`disconnect`,(e,n,r)=>{t(!0),this[h](e,n,r)}).on(`connectionError`,(e,n,r)=>{t(!1),this[g](e,n,r)}),this[i].set(a,{count:0,dispatcher:s}),this[x].add(a)}return s.dispatch(e,t)}[o](){let e=[];for(let{dispatcher:t}of this[i].values())e.push(t.close());return this[i].clear(),Promise.all(e)}[s](e){let t=[];for(let{dispatcher:n}of this[i].values())t.push(n.destroy(e));return this[i].clear(),Promise.all(t)}get stats(){let e={};for(let{dispatcher:t}of this[i].values())t.stats&&(e[t[l].origin]=t.stats);return e}}})),X=t(((t,n)=>{let{Buffer:r}=e(`node:buffer`),i=e(`node:net`),{InvalidArgumentError:a}=S();function o(e){if(i.isIPv4(e)){let t=e.split(`.`).map(Number);return{type:1,buffer:r.from(t)}}if(i.isIPv6(e))return{type:4,buffer:s(e)};let t=r.from(e,`utf8`);if(t.length>255)throw new a(`Domain name too long (max 255 bytes)`);return{type:3,buffer:r.concat([r.from([t.length]),t])}}function s(e){let t=r.alloc(16),n=e;if(e.includes(`.`)){let t=e.lastIndexOf(`:`),r=e.slice(t+1);if(i.isIPv4(r)){let i=r.split(`.`).map(Number),a=(i[0]<<8|i[1]).toString(16),o=(i[2]<<8|i[3]).toString(16);n=`${e.slice(0,t)}:${a}:${o}`}}let a=n.indexOf(`::`);if(a!==-1){let e=n.slice(0,a),r=n.slice(a+2),i=e===``?[]:e.split(`:`),o=r===``?[]:r.split(`:`),s=0;for(let e of i)t.writeUInt16BE(parseInt(e,16),s),s+=2;s=16-o.length*2;for(let e of o)t.writeUInt16BE(parseInt(e,16),s),s+=2}else{let e=n.split(`:`);for(let n=0;n<e.length;n++)t.writeUInt16BE(parseInt(e[n],16),n*2)}return t}function c(e,t,n){let i=r.allocUnsafe(2);return i.writeUInt16BE(n,0),r.concat([r.from([e]),t,i])}function l(e,t=0){if(e.length<t+1)throw new a(`Buffer too small to contain address type`);let n=e[t],r,i=t+1;switch(n){case 1:if(e.length<i+6)throw new a(`Buffer too small for IPv4 address`);r=Array.from(e.subarray(i,i+4)).join(`.`),i+=4;break;case 3:{if(e.length<i+1)throw new a(`Buffer too small for domain length`);let t=e[i];if(i+=1,e.length<i+t+2)throw new a(`Buffer too small for domain address`);r=e.subarray(i,i+t).toString(`utf8`),i+=t;break}case 4:{if(e.length<i+18)throw new a(`Buffer too small for IPv6 address`);let t=[];for(let n=0;n<8;n++){let r=e.readUInt16BE(i+n*2);t.push(r.toString(16))}r=t.join(`:`),i+=16;break}default:throw new a(`Invalid address type: ${n}`)}if(e.length<i+2)throw new a(`Buffer too small for port`);let o=e.readUInt16BE(i);return i+=2,{address:r,port:o,bytesRead:i-t}}function u(e){let t={1:`General SOCKS server failure`,2:`Connection not allowed by ruleset`,3:`Network unreachable`,4:`Host unreachable`,5:`Connection refused`,6:`TTL expired`,7:`Command not supported`,8:`Address type not supported`}[e]||`Unknown SOCKS5 error code: ${e}`,n=Error(t);return n.code=`SOCKS5_${e}`,n}n.exports={parseAddress:o,parseIPv6:s,buildAddressBuffer:c,parseResponseAddress:l,createReplyError:u}})),Z=t(((t,n)=>{let{EventEmitter:r}=e(`node:events`),{Buffer:i}=e(`node:buffer`),{InvalidArgumentError:a,Socks5ProxyError:o}=S(),{debuglog:s}=e(`node:util`),{parseAddress:c}=X(),l=s(`undici:socks5`),u=i.alloc(0),d={NO_AUTH:0,GSSAPI:1,USERNAME_PASSWORD:2,NO_ACCEPTABLE:255},f={CONNECT:1,BIND:2,UDP_ASSOCIATE:3},p={IPV4:1,DOMAIN:3,IPV6:4},m={SUCCEEDED:0,GENERAL_FAILURE:1,CONNECTION_NOT_ALLOWED:2,NETWORK_UNREACHABLE:3,HOST_UNREACHABLE:4,CONNECTION_REFUSED:5,TTL_EXPIRED:6,COMMAND_NOT_SUPPORTED:7,ADDRESS_TYPE_NOT_SUPPORTED:8},h={INITIAL:`initial`,HANDSHAKING:`handshaking`,AUTHENTICATING:`authenticating`,AUTHENTICATED:`authenticated`,CONNECTING:`connecting`,CONNECTED:`connected`,ERROR:`error`,CLOSED:`closed`};n.exports={Socks5Client:class extends r{constructor(e,t={}){if(super(),!e)throw new a(`socket is required`);this.socket=e,this.options=t,this.state=h.INITIAL,this.buffer=u,this.onSocketData=this.onData.bind(this),this.onSocketError=this.onError.bind(this),this.onSocketClose=this.onClose.bind(this),this.authMethods=[],t.username&&t.password&&this.authMethods.push(d.USERNAME_PASSWORD),this.authMethods.push(d.NO_AUTH),this.socket.on(`data`,this.onSocketData),this.socket.on(`error`,this.onSocketError),this.socket.on(`close`,this.onSocketClose)}onData(e){l(`received data`,e.length,`bytes in state`,this.state),this.buffer=i.concat([this.buffer,e]);try{switch(this.state){case h.HANDSHAKING:this.handleHandshakeResponse();break;case h.AUTHENTICATING:this.handleAuthResponse();break;case h.CONNECTING:this.handleConnectResponse()}}catch(e){this.onError(e)}}onError(e){l(`socket error`,e),this.state=h.ERROR,this.emit(`error`,e),this.destroy()}onClose(){l(`socket closed`),this.state=h.CLOSED,this.emit(`close`)}destroy(){this.socket&&!this.socket.destroyed&&this.socket.destroy()}markAuthenticated(){this.state=h.AUTHENTICATED,this.emit(`authenticated`)}handshake(){if(this.state!==h.INITIAL)throw new a(`Handshake already started`);l(`starting handshake with`,this.authMethods.length,`auth methods`),this.state=h.HANDSHAKING;let e=i.alloc(2+this.authMethods.length);e[0]=5,e[1]=this.authMethods.length,this.authMethods.forEach((t,n)=>{e[2+n]=t}),this.socket.write(e)}handleHandshakeResponse(){if(this.buffer.length<2)return;let e=this.buffer[0],t=this.buffer[1];if(e!==5)throw new o(`Invalid SOCKS version: ${e}`,`UND_ERR_SOCKS5_VERSION`);if(t===d.NO_ACCEPTABLE)throw new o(`No acceptable authentication method`,`UND_ERR_SOCKS5_AUTH_REJECTED`);if(this.buffer=this.buffer.subarray(2),l(`server selected auth method`,t),t===d.NO_AUTH)this.markAuthenticated();else if(t===d.USERNAME_PASSWORD)this.state=h.AUTHENTICATING,this.sendAuthRequest();else throw new o(`Unsupported authentication method: ${t}`,`UND_ERR_SOCKS5_AUTH_METHOD`)}sendAuthRequest(){let{username:e,password:t}=this.options;if(!e||!t)throw new a(`Username and password required for authentication`);l(`sending username/password auth`);let n=i.from(e),r=i.from(t);if(n.length>255||r.length>255)throw new a(`Username or password too long`);let o=i.alloc(3+n.length+r.length);o[0]=1,o[1]=n.length,n.copy(o,2),o[2+n.length]=r.length,r.copy(o,3+n.length),this.socket.write(o)}handleAuthResponse(){if(this.buffer.length<2)return;let e=this.buffer[0],t=this.buffer[1];if(e!==1)throw new o(`Invalid auth sub-negotiation version: ${e}`,`UND_ERR_SOCKS5_AUTH_VERSION`);if(t!==0)throw new o(`Authentication failed`,`UND_ERR_SOCKS5_AUTH_FAILED`);this.buffer=this.buffer.subarray(2),l(`authentication successful`),this.markAuthenticated()}connect(e,t){if(this.state===h.CONNECTING||this.state===h.CONNECTED)throw new a(`Connection already in progress`);if(this.state!==h.AUTHENTICATED)throw new a(`Client must be authenticated before CONNECT`);l(`connecting to`,e,t),this.state=h.CONNECTING;let n=this.buildConnectRequest(f.CONNECT,e,t);this.socket.write(n)}buildConnectRequest(e,t,n){let{type:r,buffer:a}=c(t),o=i.alloc(4+a.length+2);return o[0]=5,o[1]=e,o[2]=0,o[3]=r,a.copy(o,4),o.writeUInt16BE(n,4+a.length),o}handleConnectResponse(){if(this.buffer.length<4)return;let e=this.buffer[0],t=this.buffer[1],n=this.buffer[3];if(e!==5)throw new o(`Invalid SOCKS version in reply: ${e}`,`UND_ERR_SOCKS5_REPLY_VERSION`);let r=4;if(n===p.IPV4)r+=6;else if(n===p.DOMAIN){if(this.buffer.length<5)return;r+=1+this.buffer[4]+2}else if(n===p.IPV6)r+=18;else throw new o(`Invalid address type in reply: ${n}`,`UND_ERR_SOCKS5_ADDR_TYPE`);if(this.buffer.length<r)return;if(t!==m.SUCCEEDED){let e=this.getReplyErrorMessage(t);throw new o(`SOCKS5 connection failed: ${e}`,`UND_ERR_SOCKS5_REPLY_${t}`)}let i,a=4;if(n===p.IPV4)i=Array.from(this.buffer.subarray(a,a+4)).join(`.`),a+=4;else if(n===p.DOMAIN){let e=this.buffer[a];a+=1,i=this.buffer.subarray(a,a+e).toString(),a+=e}else if(n===p.IPV6){let e=[];for(let t=0;t<8;t++){let n=this.buffer.readUInt16BE(a+t*2);e.push(n.toString(16))}i=e.join(`:`),a+=16}let s=this.buffer.readUInt16BE(a);this.buffer=u,this.state=h.CONNECTED,this.socket.removeListener(`data`,this.onSocketData),l(`connected, bound address:`,i,`port:`,s),this.emit(`connected`,{address:i,port:s})}getReplyErrorMessage(e){switch(e){case m.GENERAL_FAILURE:return`General SOCKS server failure`;case m.CONNECTION_NOT_ALLOWED:return`Connection not allowed by ruleset`;case m.NETWORK_UNREACHABLE:return`Network unreachable`;case m.HOST_UNREACHABLE:return`Host unreachable`;case m.CONNECTION_REFUSED:return`Connection refused`;case m.TTL_EXPIRED:return`TTL expired`;case m.COMMAND_NOT_SUPPORTED:return`Command not supported`;case m.ADDRESS_TYPE_NOT_SUPPORTED:return`Address type not supported`;default:return`Unknown error code: ${e}`}}},AUTH_METHODS:d,COMMANDS:f,ADDRESS_TYPES:p,REPLY_CODES:m,STATES:h}})),le=t(((t,n)=>{let{URL:r}=e(`node:url`),i,a=M(),{InvalidArgumentError:o}=S(),{Socks5Client:s,STATES:c}=Z(),{kDispatch:l,kClose:u,kDestroy:d}=b(),f=ce(),p=N(),{debuglog:m}=e(`node:util`),h=m(`undici:socks5-proxy`),g=Symbol(`proxy url`),_=Symbol(`proxy headers`),v=Symbol(`proxy auth`),y=Symbol(`proxy protocol`),x=Symbol(`pools`),C=Symbol(`connector`),w=Symbol(`request tls settings`),T=!1;n.exports=class extends a{constructor(e,t={}){if(super(),T||=(process.emitWarning(`SOCKS5 proxy support is experimental and subject to change`,`ExperimentalWarning`),!0),!e)throw new o(`Proxy URL is mandatory`);let n=typeof e==`string`?new r(e):e;if(n.protocol!==`socks5:`&&n.protocol!==`socks:`)throw new o(`Proxy URL must use socks5:// or socks:// protocol`);this[g]=n,this[_]=t.headers||{},this[y]=t.proxyTls?`https:`:`http:`,this[w]=t.requestTls,this[v]={username:t.username||(n.username?decodeURIComponent(n.username):null),password:t.password||(n.password?decodeURIComponent(n.password):null)},this[C]=t.connect||p({...t.proxyTls,servername:t.proxyTls?.servername||n.hostname}),this[x]=new Map}async createSocks5Connection(e,t){let n=this[g].hostname,r=parseInt(this[g].port)||1080;h(`creating SOCKS5 connection to`,n,r);let i=await new Promise((e,t)=>{this[C]({hostname:n,host:n,port:r,protocol:this[y]},(n,r)=>{n?t(n):e(r)})}),a=new s(i,this[v]);return a.on(`error`,e=>{h(`SOCKS5 error:`,e),i.destroy()}),await a.handshake(),await new Promise((e,t)=>{let n=setTimeout(()=>{t(Error(`SOCKS5 authentication timeout`))},5e3),r=()=>{clearTimeout(n),a.removeListener(`error`,i),e()},i=e=>{clearTimeout(n),a.removeListener(`authenticated`,r),t(e)};a.state===c.AUTHENTICATED?(clearTimeout(n),e()):(a.once(`authenticated`,r),a.once(`error`,i))}),await a.connect(e,t),await new Promise((n,r)=>{let i=setTimeout(()=>{r(Error(`SOCKS5 connection timeout`))},5e3),o=r=>{h(`SOCKS5 tunnel established to`,e,t,`via`,r),clearTimeout(i),a.removeListener(`error`,s),n()},s=e=>{clearTimeout(i),a.removeListener(`connected`,o),r(e)};a.once(`connected`,o),a.once(`error`,s)}),i}[l](t,n){let{origin:a}=t;h(`dispatching request to`,a,`via SOCKS5`);try{let o=String(a),s=this[x].get(o);return(!s||s.destroyed||s.closed)&&(s=new f(a,{pipelining:t.pipelining,connections:t.connections,connect:async(t,n)=>{try{let t=new r(a),o=t.hostname,s=parseInt(t.port)||(t.protocol===`https:`?443:80);h(`establishing SOCKS5 connection to`,o,s);let c=await this.createSocks5Connection(o,s),l=c;t.protocol===`https:`&&(i||=e(`node:tls`),h(`upgrading to TLS`),l=i.connect({...this[w],socket:c,servername:this[w]?.servername||o}),await new Promise((e,t)=>{l.once(`secureConnect`,e),l.once(`error`,t)})),n(null,l)}catch(e){h(`SOCKS5 connection error:`,e),n(e)}}}),this[x].set(o,s)),s[l](t,n)}catch(e){if(h(`dispatch error:`,e),typeof n.onResponseError==`function`)return n.onResponseError(null,e),!1;if(typeof n.onError==`function`)return n.onError(e),!1;throw e}}async[u](){let e=[];for(let t of this[x].values())e.push(t.close());this[x].clear(),await Promise.all(e)}async[d](e){let t=[];for(let n of this[x].values())t.push(n.destroy(e));this[x].clear(),await Promise.all(t)}}})),ue=t(((e,t)=>{let{kProxy:n,kClose:r,kDestroy:i,kDispatch:a}=b(),o=Y(),s=ce(),c=M(),{InvalidArgumentError:l,RequestAbortedError:u,SecureProxyConnectionError:d}=S(),f=N(),p=K(),{channels:m}=D(),h=le(),g=Symbol(`proxy agent`),_=Symbol(`proxy client`),v=Symbol(`proxy headers`),y=Symbol(`request tls settings`),x=Symbol(`proxy tls settings`),C=Symbol(`connect endpoint function`),w=Symbol(`tunnel proxy`);function T(e){return e===`https:`?443:80}function E(e,t){return new s(e,t)}let O=()=>{};function k(e,t){return t.connections===1?new p(e,t):new s(e,t)}var A=class extends c{#e;constructor(e,{headers:t={},connect:n,factory:r}){if(!e)throw new l(`Proxy URL is mandatory`);super(),this[v]=t,this.#e=r?r(e,{connect:n}):new p(e,{connect:n})}[a](e,t){let n=t.onHeaders;t.onHeaders=function(e,r,i){if(e===407){typeof t.onError==`function`&&t.onError(new l(`Proxy Authentication Required (407)`));return}n&&n.call(this,e,r,i)};let{origin:r,path:i=`/`,headers:o={}}=e;if(e.path=r+i,!(`host`in o)&&!(`Host`in o)){let{host:e}=new URL(r);o.host=e}return e.headers={...this[v],...o},this.#e[a](e,t)}[r](){return this.#e.close()}[i](e){return this.#e.destroy(e)}},j=class extends c{constructor(e){if(!e||typeof e==`object`&&!(e instanceof URL)&&!e.uri)throw new l(`Proxy uri is mandatory`);let{clientFactory:t=E}=e;if(typeof t!=`function`)throw new l(`Proxy opts.clientFactory must be a function.`);let{proxyTunnel:r=!0}=e;super();let i=this.#e(e),{href:a,origin:s,port:c,protocol:p,username:b,password:S,hostname:D}=i;if(this[n]={uri:a,protocol:p},this[y]=e.requestTls,this[x]=e.proxyTls,this[v]=e.headers||{},this[w]=r,e.auth&&e.token)throw new l(`opts.auth cannot be used in combination with opts.token`);e.auth?this[v][`proxy-authorization`]=`Basic ${e.auth}`:e.token?this[v][`proxy-authorization`]=e.token:b&&S&&(this[v][`proxy-authorization`]=`Basic ${Buffer.from(`${decodeURIComponent(b)}:${decodeURIComponent(S)}`).toString(`base64`)}`);let j=f({...e.proxyTls});this[C]=f({...e.requestTls});let M=e.factory||k,N=(t,r)=>{let{protocol:i}=new URL(t);return this[n].protocol===`socks5:`||this[n].protocol===`socks:`?new h(this[n].uri,{headers:this[v],connect:j,factory:M,username:e.username||b,password:e.password||S,proxyTls:e.proxyTls,requestTls:e.requestTls}):!this[w]&&i===`http:`&&this[n].protocol===`http:`?new A(this[n].uri,{headers:this[v],connect:j,factory:M}):M(t,r)};p===`socks5:`||p===`socks:`?this[_]=null:this[_]=t(i,{connect:j}),this[g]=new o({...e,factory:N,connect:async(e,t)=>{if(!this[_]){t(new l(`Cannot establish tunnel connection without a proxy client`));return}let n=e.host;e.port||(n+=`:${T(e.protocol)}`);try{let r={origin:s,port:c,path:n,signal:e.signal,headers:{...this[v],host:e.host,...e.connections==null||e.connections>0?{"proxy-connection":`keep-alive`}:{}},servername:this[x]?.servername||D},{socket:i,statusCode:a}=await this[_].connect(r);if(a!==200){i.on(`error`,O).destroy(),t(new u(`Proxy response (${a}) !== 200 when HTTP Tunneling`));return}if(m.proxyConnected.hasSubscribers&&m.proxyConnected.publish({socket:i,connectParams:r}),e.protocol!==`https:`){t(null,i);return}let o;o=this[y]?this[y].servername:e.servername,this[C]({...e,servername:o,httpSocket:i},t)}catch(e){e.code===`ERR_TLS_CERT_ALTNAME_INVALID`?t(new d(e)):t(e)}}})}dispatch(e,t){let n=P(e.headers);if(F(n),n&&!(`host`in n)&&!(`Host`in n)){let{host:t}=new URL(e.origin);n.host=t}return this[g].dispatch({...e,headers:n},t)}#e(e){return typeof e==`string`?new URL(e):e instanceof URL?e:new URL(e.uri)}[r](){let e=[this[g].close()];return this[_]&&e.push(this[_].close()),Promise.all(e)}[i](){let e=[this[g].destroy()];return this[_]&&e.push(this[_].destroy()),Promise.all(e)}};function P(e){if(Array.isArray(e)){let t={};for(let n=0;n<e.length;n+=2)t[e[n]]=e[n+1];return t}return e}function F(e){if(e&&Object.keys(e).find(e=>e.toLowerCase()===`proxy-authorization`))throw new l(`Proxy-Authorization should be sent in ProxyAgent constructor`)}t.exports=j})),de=t(((e,t)=>{let n=M(),{kClose:r,kDestroy:i,kClosed:a,kDestroyed:o,kDispatch:s,kNoProxyAgent:c,kHttpProxyAgent:l,kHttpsProxyAgent:u}=b(),d=ue(),f=Y(),p={"http:":80,"https:":443};t.exports=class extends n{#e=null;#t=null;#n=null;constructor(e={}){super(),this.#n=e;let{httpProxy:t,httpsProxy:n,noProxy:r,...i}=e;this[c]=new f(i);let a=t??process.env.http_proxy??process.env.HTTP_PROXY;a?this[l]=new d({...i,uri:a}):this[l]=this[c];let o=n??process.env.https_proxy??process.env.HTTPS_PROXY;o?this[u]=new d({...i,uri:o}):this[u]=this[l],this.#a()}[s](e,t){let n=new URL(e.origin);return this.#r(n).dispatch(e,t)}[r](){return Promise.all([this[c].close(),!this[l][a]&&this[l].close(),!this[u][a]&&this[u].close()])}[i](e){return Promise.all([this[c].destroy(e),!this[l][o]&&this[l].destroy(e),!this[u][o]&&this[u].destroy(e)])}#r(e){let{protocol:t,host:n,port:r}=e;return n=n.replace(/:\d*$/,``).toLowerCase(),r=Number.parseInt(r,10)||p[t]||0,this.#i(n,r)?t===`https:`?this[u]:this[l]:this[c]}#i(e,t){if(this.#o&&this.#a(),this.#t.length===0)return!0;if(this.#e===`*`)return!1;for(let n=0;n<this.#t.length;n++){let r=this.#t[n];if(!(r.port&&r.port!==t)&&(e===r.hostname||e.slice(-(r.hostname.length+1))===`.${r.hostname}`))return!1}return!0}#a(){let e=this.#n.noProxy??this.#s,t=e.split(/[,\s]/),n=[];for(let e=0;e<t.length;e++){let r=t[e];if(!r)continue;let i=r.match(/^(.+):(\d+)$/);n.push({hostname:(i?i[1]:r).replace(/^\*?\./,``).toLowerCase(),port:i?Number.parseInt(i[2],10):0})}this.#e=e,this.#t=n}get#o(){return this.#n.noProxy===void 0&&this.#e!==this.#s}get#s(){return process.env.no_proxy??process.env.NO_PROXY??``}}})),Q=t(((t,n)=>{let r=e(`node:assert`),{kRetryHandlerDefaultRetry:i}=b(),{RequestRetryError:a}=S(),o=k(),{isDisturbed:s,parseRangeHeader:c,wrapRequestBody:l}=T();function u(e){let t=new Date(e).getTime();return isNaN(t)?0:t-Date.now()}function d(e,t,n,r){let i=e[`content-length`];if(i==null||!Number.isFinite(t.start)||!Number.isFinite(t.end))return;let o=Number(i),s=t.end-t.start+1;if(!Number.isFinite(o)||o!==s)throw new a(`Content-Length mismatch`,n,{headers:e,data:{count:r}})}n.exports=class e{constructor(t,{dispatch:n,handler:r}){let{retryOptions:a,...s}=t,{retry:c,maxRetries:u,maxTimeout:d,minTimeout:f,timeoutFactor:p,methods:m,errorCodes:h,retryAfter:g,statusCodes:_,throwOnError:v}=a??{};this.error=null,this.dispatch=n,this.handler=o.wrap(r),this.opts={...s,body:l(t.body)},this.retryOpts={throwOnError:v??!0,retry:c??e[i],retryAfter:g??!0,maxTimeout:d??3e4,minTimeout:f??500,timeoutFactor:p??2,maxRetries:u??5,methods:m??[`GET`,`HEAD`,`OPTIONS`,`PUT`,`DELETE`,`TRACE`],statusCodes:_??[500,502,503,504,429],errorCodes:h??[`ECONNRESET`,`ECONNREFUSED`,`ENOTFOUND`,`ENETDOWN`,`ENETUNREACH`,`EHOSTDOWN`,`EHOSTUNREACH`,`EPIPE`,`UND_ERR_SOCKET`]},this.retryCount=0,this.retryCountCheckpoint=0,this.headersSent=!1,this.start=0,this.end=null,this.etag=null}onResponseStartWithRetry(e,t,n,r,i){if(this.retryOpts.throwOnError){this.retryOpts.statusCodes.includes(t)===!1?(this.headersSent=!0,this.handler.onResponseStart?.(e,t,n,r)):this.error=i;return}if(s(this.opts.body)){this.headersSent=!0,this.handler.onResponseStart?.(e,t,n,r);return}function a(a){if(a){this.headersSent=!0,this.handler.onResponseStart?.(e,t,n,r),e.resume();return}this.error=i,e.resume()}e.pause(),this.retryOpts.retry(i,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},a.bind(this))}onRequestStart(e,t){this.headersSent||this.handler.onRequestStart?.(e,t)}onRequestUpgrade(e,t,n,r){this.handler.onRequestUpgrade?.(e,t,n,r)}static[i](e,{state:t,opts:n},r){let{statusCode:i,code:a,headers:o}=e,{method:s,retryOptions:c}=n,{maxRetries:l,minTimeout:d,maxTimeout:f,timeoutFactor:p,statusCodes:m,errorCodes:h,methods:g}=c,{counter:_}=t;if(a&&a!==`UND_ERR_REQ_RETRY`&&!h.includes(a)){r(e);return}if(Array.isArray(g)&&!g.includes(s)){r(e);return}if(i!=null&&Array.isArray(m)&&!m.includes(i)){r(e);return}if(_>l){r(e);return}let v=o?.[`retry-after`];v&&=(v=Number(v),Number.isNaN(v)?u(o[`retry-after`]):v*1e3);let y=Math.min(v>0?v:d*p**(_-1),f);setTimeout(()=>r(null),y)}onResponseStart(e,t,n,i){if(this.error=null,this.retryCount+=1,t>=300){let r=new a(`Request failed`,t,{headers:n,data:{count:this.retryCount}});this.onResponseStartWithRetry(e,t,n,i,r);return}if(this.headersSent){if(t!==206&&(this.start>0||t!==200))throw new a(`server does not support the range header and the payload was partially consumed`,t,{headers:n,data:{count:this.retryCount}});let e=c(n[`content-range`]);if(!e)throw new a(`Content-Range mismatch`,t,{headers:n,data:{count:this.retryCount}});if(this.etag!=null&&this.etag!==n.etag)throw new a(`ETag mismatch`,t,{headers:n,data:{count:this.retryCount}});d(n,e,t,this.retryCount);let{start:i,size:o,end:s=o?o-1:null}=e;r(this.start===i,`content-range mismatch`),r(this.end==null||this.end===s,`content-range mismatch`);return}if(this.end==null){if(t===206){let a=c(n[`content-range`]);if(a==null){this.headersSent=!0,this.handler.onResponseStart?.(e,t,n,i);return}d(n,a,t,this.retryCount);let{start:o,size:s,end:l=s?s-1:null}=a;r(o!=null&&Number.isFinite(o),`content-range mismatch`),r(l!=null&&Number.isFinite(l),`invalid content-length`),this.start=o,this.end=l}if(this.end==null){let e=n[`content-length`];this.end=e==null?null:Number(e)-1}r(Number.isFinite(this.start)),r(this.end==null||Number.isFinite(this.end),`invalid content-length`),this.resume=!0,this.etag=n.etag==null?null:n.etag,this.etag!=null&&this.etag[0]===`W`&&this.etag[1]===`/`&&(this.etag=null),this.headersSent=!0,this.handler.onResponseStart?.(e,t,n,i)}else throw new a(`Request failed`,t,{headers:n,data:{count:this.retryCount}})}onResponseData(e,t){this.error||(this.start+=t.length,this.handler.onResponseData?.(e,t))}onResponseEnd(e,t){if(this.error&&this.retryOpts.throwOnError)throw this.error;if(!this.error)return this.retryCount=0,this.handler.onResponseEnd?.(e,t);this.retry(e)}retry(e){if(this.start!==0){let e={range:`bytes=${this.start}-${this.end??``}`};this.etag!=null&&(e[`if-match`]=this.etag),this.opts={...this.opts,headers:{...this.opts.headers,...e}}}try{this.retryCountCheckpoint=this.retryCount,this.dispatch(this.opts,this)}catch(t){this.handler.onResponseError?.(e,t)}}onResponseError(e,t){if(e?.aborted||s(this.opts.body)){this.handler.onResponseError?.(e,t);return}function n(t){if(!t){this.retry(e);return}this.handler?.onResponseError?.(e,t)}this.retryCount-this.retryCountCheckpoint>0?this.retryCount=this.retryCountCheckpoint+(this.retryCount-this.retryCountCheckpoint):this.retryCount+=1,this.retryOpts.retry(t,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},n.bind(this))}}})),fe=t(((e,t)=>{let n=A(),r=Q();t.exports=class extends n{#e=null;#t=null;constructor(e,t={}){super(t),this.#e=e,this.#t=t}dispatch(e,t){let n=new r({...e,retryOptions:this.#t},{dispatch:this.#e.dispatch.bind(this.#e),handler:t});return this.#e.dispatch(e,n)}close(){return this.#e.close()}destroy(){return this.#e.destroy()}}})),pe=t(((e,t)=>{let{InvalidArgumentError:n}=S(),r=K();t.exports=class extends r{constructor(e,t){if(typeof e==`string`&&(e=new URL(e)),e.protocol!==`http:`)throw new n(`h2c-client: Only h2c protocol is supported`);let{maxConcurrentStreams:r,pipelining:i,...a}=t??{},o=100,s=100;if(r!=null&&Number.isInteger(r)&&r>0&&(o=r),i!=null&&Number.isInteger(i)&&i>0&&(s=i),s>o)throw new n(`h2c-client: pipelining cannot be greater than maxConcurrentStreams`);super(e,{...a,maxConcurrentStreams:o,pipelining:s,allowH2:!0,useH2c:!0})}}})),me=t(((t,n)=>{let r=e(`node:assert`),{Readable:i}=e(`node:stream`),{RequestAbortedError:a,NotSupportedError:o,InvalidArgumentError:s,AbortError:c}=S(),l=T(),{ReadableStreamFrom:u}=T(),d=Symbol(`kConsume`),f=Symbol(`kReading`),p=Symbol(`kBody`),m=Symbol(`kAbort`),h=Symbol(`kContentType`),g=Symbol(`kContentLength`),_=Symbol(`kUsed`),v=Symbol(`kBytesRead`),y=()=>{};var b=class extends i{constructor({resume:e,abort:t,contentType:n=``,contentLength:r,highWaterMark:i=65536}){super({autoDestroy:!0,read:e,highWaterMark:i}),this._readableState.dataEmitted=!1,this[m]=t,this[d]=null,this[v]=0,this[p]=null,this[_]=!1,this[h]=n,this[g]=Number.isFinite(r)?r:null,this[f]=!1}_destroy(e,t){!e&&!this._readableState.endEmitted&&(e=new a),e&&this[m](),this[_]?t(e):setImmediate(t,e)}on(e,t){return(e===`data`||e===`readable`)&&(this[f]=!0,this[_]=!0),super.on(e,t)}addListener(e,t){return this.on(e,t)}off(e,t){let n=super.off(e,t);return(e===`data`||e===`readable`)&&(this[f]=this.listenerCount(`data`)>0||this.listenerCount(`readable`)>0),n}removeListener(e,t){return this.off(e,t)}push(e){return e&&(this[v]+=e.length,this[d])?(A(this[d],e),!this[f]||super.push(e)):super.push(e)}text(){return w(this,`text`)}json(){return w(this,`json`)}blob(){return w(this,`blob`)}bytes(){return w(this,`bytes`)}arrayBuffer(){return w(this,`arrayBuffer`)}async formData(){throw new o}get bodyUsed(){return l.isDisturbed(this)}get body(){return this[p]||(this[p]=u(this),this[d]&&(this[p].getReader(),r(this[p].locked))),this[p]}dump(e){let t=e?.signal;if(t!=null&&(typeof t!=`object`||!(`aborted`in t)))return Promise.reject(new s(`signal must be an AbortSignal`));let n=e?.limit&&Number.isFinite(e.limit)?e.limit:131072;return t?.aborted?Promise.reject(t.reason??new c):this._readableState.closeEmitted?Promise.resolve(null):new Promise((e,r)=>{if((this[g]&&this[g]>n||this[v]>n)&&this.destroy(new c),t){let n=()=>{this.destroy(t.reason??new c)};t.addEventListener(`abort`,n),this.on(`close`,function(){t.removeEventListener(`abort`,n),t.aborted?r(t.reason??new c):e(null)})}else this.on(`close`,e);this.on(`error`,y).on(`data`,()=>{this[v]>n&&this.destroy()}).resume()})}setEncoding(e){return Buffer.isEncoding(e)&&(this._readableState.encoding=e),this}};function x(e){return e[p]?.locked===!0||e[d]!==null}function C(e){return l.isDisturbed(e)||x(e)}function w(e,t){return r(!e[d]),new Promise((n,r)=>{if(C(e)){let t=e._readableState;t.destroyed&&t.closeEmitted===!1?e.on(`error`,r).on(`close`,()=>{r(TypeError(`unusable`))}):r(t.errored??TypeError(`unusable`))}else queueMicrotask(()=>{e[d]={type:t,stream:e,resolve:n,reject:r,length:0,body:[]},e.on(`error`,function(e){j(this[d],e)}).on(`close`,function(){this[d].body!==null&&j(this[d],new a)}),E(e[d])})})}function E(e){if(e.body===null)return;let{_readableState:t}=e.stream;if(t.bufferIndex){let n=t.bufferIndex,r=t.buffer.length;for(let i=n;i<r;i++)A(e,t.buffer[i])}else for(let n of t.buffer)A(e,n);for(t.endEmitted?k(this[d],this._readableState.encoding):e.stream.on(`end`,function(){k(this[d],this._readableState.encoding)}),e.stream.resume();e.stream.read()!=null;);}function D(e,t,n){if(e.length===0||t===0)return``;let r=e.length===1?e[0]:Buffer.concat(e,t),i=r.length,a=i>2&&r[0]===239&&r[1]===187&&r[2]===191?3:0;return!n||n===`utf8`||n===`utf-8`?r.utf8Slice(a,i):r.subarray(a,i).toString(n)}function O(e,t){if(e.length===0||t===0)return new Uint8Array;if(e.length===1)return new Uint8Array(e[0]);let n=new Uint8Array(Buffer.allocUnsafeSlow(t).buffer),r=0;for(let t=0;t<e.length;++t){let i=e[t];n.set(i,r),r+=i.length}return n}function k(e,t){let{type:n,body:r,resolve:i,stream:a,length:o}=e;try{n===`text`?i(D(r,o,t)):n===`json`?i(JSON.parse(D(r,o,t))):n===`arrayBuffer`?i(O(r,o).buffer):n===`blob`?i(new Blob(r,{type:a[h]})):n===`bytes`&&i(O(r,o)),j(e)}catch(e){a.destroy(e)}}function A(e,t){e.length+=t.length,e.body.push(t)}function j(e,t){e.body!==null&&(t?e.reject(t):e.resolve(),e.type=null,e.stream=null,e.resolve=null,e.reject=null,e.length=0,e.body=null)}n.exports={Readable:b,chunksDecode:D}})),he=t(((t,n)=>{let r=e(`node:assert`),{AsyncResource:i}=e(`node:async_hooks`),{Readable:a}=me(),{InvalidArgumentError:o,RequestAbortedError:s}=S(),c=T();function l(){}var u=class extends i{constructor(e,t){if(!e||typeof e!=`object`)throw new o(`invalid opts`);let{signal:n,method:r,opaque:i,body:a,onInfo:u,responseHeaders:d,highWaterMark:f}=e;try{if(typeof t!=`function`)throw new o(`invalid callback`);if(f!=null&&(!Number.isFinite(f)||f<0))throw new o(`invalid highWaterMark`);if(n&&typeof n.on!=`function`&&typeof n.addEventListener!=`function`)throw new o(`signal must be an EventEmitter or EventTarget`);if(r===`CONNECT`)throw new o(`invalid method`);if(u&&typeof u!=`function`)throw new o(`invalid onInfo callback`);super(`UNDICI_REQUEST`)}catch(e){throw c.isStream(a)&&c.destroy(a.on(`error`,l),e),e}this.method=r,this.responseHeaders=d||null,this.opaque=i||null,this.callback=t,this.res=null,this.abort=null,this.body=a,this.trailers={},this.context=null,this.onInfo=u||null,this.highWaterMark=f,this.reason=null,this.removeAbortListener=null,n?.aborted?this.reason=n.reason??new s:n&&(this.removeAbortListener=c.addAbortListener(n,()=>{this.reason=n.reason??new s,this.res?c.destroy(this.res.on(`error`,l),this.reason):this.abort&&this.abort(this.reason)}))}onConnect(e,t){if(this.reason){e(this.reason);return}r(this.callback),this.abort=e,this.context=t}onHeaders(e,t,n,r){let{callback:i,opaque:o,abort:s,context:u,responseHeaders:d,highWaterMark:f}=this,p=d===`raw`?c.parseRawHeaders(t):c.parseHeaders(t);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:p});return}let m=d===`raw`?c.parseHeaders(t):p,h=m[`content-type`],g=m[`content-length`],_=new a({resume:n,abort:s,contentType:h,contentLength:this.method!==`HEAD`&&g?Number(g):null,highWaterMark:f});if(this.removeAbortListener&&=(_.on(`close`,this.removeAbortListener),null),this.callback=null,this.res=_,i!==null)try{this.runInAsyncScope(i,null,null,{statusCode:e,statusText:r,headers:p,trailers:this.trailers,opaque:o,body:_,context:u})}catch(e){this.res=null,c.destroy(_.on(`error`,l),e),queueMicrotask(()=>{throw e})}}onData(e){return this.res.push(e)}onComplete(e){c.parseHeaders(e,this.trailers),this.res.push(null)}onError(e){let{res:t,callback:n,body:r,opaque:i}=this;n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:i})})),t&&(this.res=null,queueMicrotask(()=>{c.destroy(t.on(`error`,l),e)})),r&&(this.body=null,c.isStream(r)&&(r.on(`error`,l),c.destroy(r,e))),this.removeAbortListener&&=(this.removeAbortListener(),null)}};function d(e,t){if(t===void 0)return new Promise((t,n)=>{d.call(this,e,(e,r)=>e?n(e):t(r))});try{let n=new u(e,t);this.dispatch(e,n)}catch(n){if(typeof t!=`function`)throw n;let r=e?.opaque;queueMicrotask(()=>t(n,{opaque:r}))}}n.exports=d,n.exports.RequestHandler=u})),$=t(((e,t)=>{let{addAbortListener:n}=T(),{RequestAbortedError:r}=S(),i=Symbol(`kListener`),a=Symbol(`kSignal`);function o(e){e.abort?e.abort(e[a]?.reason):e.reason=e[a]?.reason??new r,c(e)}function s(e,t){if(e.reason=null,e[a]=null,e[i]=null,t){if(t.aborted){o(e);return}e[a]=t,e[i]=()=>{o(e)},n(e[a],e[i])}}function c(e){e[a]&&(`removeEventListener`in e[a]?e[a].removeEventListener(`abort`,e[i]):e[a].removeListener(`abort`,e[i]),e[a]=null,e[i]=null)}t.exports={addSignal:s,removeSignal:c}})),ge=t(((t,n)=>{let r=e(`node:assert`),{finished:i}=e(`node:stream`),{AsyncResource:a}=e(`node:async_hooks`),{InvalidArgumentError:o,InvalidReturnValueError:s}=S(),c=T(),{addSignal:l,removeSignal:u}=$();function d(){}var f=class extends a{constructor(e,t,n){if(!e||typeof e!=`object`)throw new o(`invalid opts`);let{signal:r,method:i,opaque:a,body:s,onInfo:u,responseHeaders:f}=e;try{if(typeof n!=`function`)throw new o(`invalid callback`);if(typeof t!=`function`)throw new o(`invalid factory`);if(r&&typeof r.on!=`function`&&typeof r.addEventListener!=`function`)throw new o(`signal must be an EventEmitter or EventTarget`);if(i===`CONNECT`)throw new o(`invalid method`);if(u&&typeof u!=`function`)throw new o(`invalid onInfo callback`);super(`UNDICI_STREAM`)}catch(e){throw c.isStream(s)&&c.destroy(s.on(`error`,d),e),e}this.responseHeaders=f||null,this.opaque=a||null,this.factory=t,this.callback=n,this.res=null,this.abort=null,this.context=null,this.trailers=null,this.body=s,this.onInfo=u||null,c.isStream(s)&&s.on(`error`,e=>{this.onError(e)}),l(this,r)}onConnect(e,t){if(this.reason){e(this.reason);return}r(this.callback),this.abort=e,this.context=t}onHeaders(e,t,n,r){let{factory:a,opaque:o,context:l,responseHeaders:u}=this,d=u===`raw`?c.parseRawHeaders(t):c.parseHeaders(t);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:d});return}if(this.factory=null,a===null)return;let f=this.runInAsyncScope(a,null,{statusCode:e,headers:d,opaque:o,context:l});if(!f||typeof f.write!=`function`||typeof f.end!=`function`||typeof f.on!=`function`)throw new s(`expected Writable`);return i(f,{readable:!1},e=>{let{callback:t,res:n,opaque:r,trailers:i,abort:a}=this;this.res=null,(e||!n?.readable)&&c.destroy(n,e),this.callback=null,this.runInAsyncScope(t,null,e||null,{opaque:r,trailers:i}),e&&a()}),f.on(`drain`,n),this.res=f,(f.writableNeedDrain===void 0?f._writableState?.needDrain:f.writableNeedDrain)!==!0}onData(e){let{res:t}=this;return!t||t.write(e)}onComplete(e){let{res:t}=this;u(this),t&&(this.trailers=c.parseHeaders(e),t.end())}onError(e){let{res:t,callback:n,opaque:r,body:i}=this;u(this),this.factory=null,t?(this.res=null,c.destroy(t,e)):n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:r})})),i&&(this.body=null,c.destroy(i,e))}};function p(e,t,n){if(n===void 0)return new Promise((n,r)=>{p.call(this,e,t,(e,t)=>e?r(e):n(t))});try{let r=new f(e,t,n);this.dispatch(e,r)}catch(t){if(typeof n!=`function`)throw t;let r=e?.opaque;queueMicrotask(()=>n(t,{opaque:r}))}}n.exports=p})),_e=t(((t,n)=>{let{Readable:r,Duplex:i,PassThrough:a}=e(`node:stream`),o=e(`node:assert`),{AsyncResource:s}=e(`node:async_hooks`),{InvalidArgumentError:c,InvalidReturnValueError:l,RequestAbortedError:u}=S(),d=T(),{addSignal:f,removeSignal:p}=$();function m(){}let h=Symbol(`resume`);var g=class extends r{constructor(){super({autoDestroy:!0}),this[h]=null}_read(){let{[h]:e}=this;e&&(this[h]=null,e())}_destroy(e,t){this._read(),t(e)}},_=class extends r{constructor(e){super({autoDestroy:!0}),this[h]=e}_read(){this[h]()}_destroy(e,t){!e&&!this._readableState.endEmitted&&(e=new u),t(e)}},v=class extends s{constructor(e,t){if(!e||typeof e!=`object`)throw new c(`invalid opts`);if(typeof t!=`function`)throw new c(`invalid handler`);let{signal:n,method:r,opaque:a,onInfo:o,responseHeaders:s}=e;if(n&&typeof n.on!=`function`&&typeof n.addEventListener!=`function`)throw new c(`signal must be an EventEmitter or EventTarget`);if(r===`CONNECT`)throw new c(`invalid method`);if(o&&typeof o!=`function`)throw new c(`invalid onInfo callback`);super(`UNDICI_PIPELINE`),this.opaque=a||null,this.responseHeaders=s||null,this.handler=t,this.abort=null,this.context=null,this.onInfo=o||null,this.req=new g().on(`error`,m),this.ret=new i({readableObjectMode:e.objectMode,autoDestroy:!0,read:()=>{let{body:e}=this;e?.resume&&e.resume()},write:(e,t,n)=>{let{req:r}=this;r.push(e,t)||r._readableState.destroyed?n():r[h]=n},destroy:(e,t)=>{let{body:n,req:r,res:i,ret:a,abort:o}=this;!e&&!a._readableState.endEmitted&&(e=new u),o&&e&&o(),d.destroy(n,e),d.destroy(r,e),d.destroy(i,e),p(this),t(e)}}).on(`prefinish`,()=>{let{req:e}=this;e.push(null)}),this.res=null,f(this,n)}onConnect(e,t){let{res:n}=this;if(this.reason){e(this.reason);return}o(!n,`pipeline cannot be retried`),this.abort=e,this.context=t}onHeaders(e,t,n){let{opaque:r,handler:i,context:a}=this;if(e<200){if(this.onInfo){let n=this.responseHeaders===`raw`?d.parseRawHeaders(t):d.parseHeaders(t);this.onInfo({statusCode:e,headers:n})}return}this.res=new _(n);let o;try{this.handler=null;let n=this.responseHeaders===`raw`?d.parseRawHeaders(t):d.parseHeaders(t);o=this.runInAsyncScope(i,null,{statusCode:e,headers:n,opaque:r,body:this.res,context:a})}catch(e){throw this.res.on(`error`,m),e}if(!o||typeof o.on!=`function`)throw new l(`expected Readable`);o.on(`data`,e=>{let{ret:t,body:n}=this;!t.push(e)&&n.pause&&n.pause()}).on(`error`,e=>{let{ret:t}=this;d.destroy(t,e)}).on(`end`,()=>{let{ret:e}=this;e.push(null)}).on(`close`,()=>{let{ret:e}=this;e._readableState.ended||d.destroy(e,new u)}),this.body=o}onData(e){let{res:t}=this;return t.push(e)}onComplete(e){let{res:t}=this;t.push(null)}onError(e){let{ret:t}=this;this.handler=null,d.destroy(t,e)}};function y(e,t){try{let n=new v(e,t);return this.dispatch({...e,body:n.req},n),n.ret}catch(e){return new a().destroy(e)}}n.exports=y})),ve=t(((t,n)=>{let{InvalidArgumentError:r,SocketError:i}=S(),{AsyncResource:a}=e(`node:async_hooks`),o=e(`node:assert`),s=T(),{kHTTP2Stream:c}=b(),{addSignal:l,removeSignal:u}=$();var d=class extends a{constructor(e,t){if(!e||typeof e!=`object`)throw new r(`invalid opts`);if(typeof t!=`function`)throw new r(`invalid callback`);let{signal:n,opaque:i,responseHeaders:a}=e;if(n&&typeof n.on!=`function`&&typeof n.addEventListener!=`function`)throw new r(`signal must be an EventEmitter or EventTarget`);super(`UNDICI_UPGRADE`),this.responseHeaders=a||null,this.opaque=i||null,this.callback=t,this.abort=null,this.context=null,l(this,n)}onConnect(e,t){if(this.reason){e(this.reason);return}o(this.callback),this.abort=e,this.context=null}onHeaders(){throw new i(`bad upgrade`,null)}onUpgrade(e,t,n){o(n[c]===!0?e===200:e===101);let{callback:r,opaque:i,context:a}=this;u(this),this.callback=null;let l=this.responseHeaders===`raw`?s.parseRawHeaders(t):s.parseHeaders(t);this.runInAsyncScope(r,null,null,{headers:l,socket:n,opaque:i,context:a})}onError(e){let{callback:t,opaque:n}=this;u(this),t&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(t,null,e,{opaque:n})}))}};function f(e,t){if(t===void 0)return new Promise((t,n)=>{f.call(this,e,(e,r)=>e?n(e):t(r))});try{let n=new d(e,t),r={...e,method:e.method||`GET`,upgrade:e.protocol||`Websocket`};this.dispatch(r,n)}catch(n){if(typeof t!=`function`)throw n;let r=e?.opaque;queueMicrotask(()=>t(n,{opaque:r}))}}n.exports=f})),ye=t(((t,n)=>{let r=e(`node:assert`),{AsyncResource:i}=e(`node:async_hooks`),{InvalidArgumentError:a,SocketError:o}=S(),s=T(),{addSignal:c,removeSignal:l}=$();var u=class extends i{constructor(e,t){if(!e||typeof e!=`object`)throw new a(`invalid opts`);if(typeof t!=`function`)throw new a(`invalid callback`);let{signal:n,opaque:r,responseHeaders:i}=e;if(n&&typeof n.on!=`function`&&typeof n.addEventListener!=`function`)throw new a(`signal must be an EventEmitter or EventTarget`);super(`UNDICI_CONNECT`),this.opaque=r||null,this.responseHeaders=i||null,this.callback=t,this.abort=null,c(this,n)}onConnect(e,t){if(this.reason){e(this.reason);return}r(this.callback),this.abort=e,this.context=t}onHeaders(){throw new o(`bad connect`,null)}onUpgrade(e,t,n){let{callback:r,opaque:i,context:a}=this;l(this),this.callback=null;let o=t;o!=null&&(o=this.responseHeaders===`raw`?s.parseRawHeaders(t):s.parseHeaders(t)),this.runInAsyncScope(r,null,null,{statusCode:e,headers:o,socket:n,opaque:i,context:a})}onError(e){let{callback:t,opaque:n}=this;l(this),t&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(t,null,e,{opaque:n})}))}};function d(e,t){if(t===void 0)return new Promise((t,n)=>{d.call(this,e,(e,r)=>e?n(e):t(r))});try{let n=new u(e,t),r={...e,method:`CONNECT`};this.dispatch(r,n)}catch(n){if(typeof t!=`function`)throw n;let r=e?.opaque;queueMicrotask(()=>t(n,{opaque:r}))}}n.exports=d})),be=t(((e,t)=>{t.exports.request=he(),t.exports.stream=ge(),t.exports.pipeline=_e(),t.exports.upgrade=ve(),t.exports.connect=ye()})),xe=t(((e,t)=>{let{UndiciError:n}=S(),r=Symbol.for(`undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED`);t.exports={MockNotMatchedError:class extends n{constructor(e){super(e),this.name=`MockNotMatchedError`,this.message=e||`The request does not match any registered mock dispatches`,this.code=`UND_MOCK_ERR_MOCK_NOT_MATCHED`}static[Symbol.hasInstance](e){return e&&e[r]===!0}get[r](){return!0}}}})),Se=t(((e,t)=>{t.exports={kAgent:Symbol(`agent`),kOptions:Symbol(`options`),kFactory:Symbol(`factory`),kDispatches:Symbol(`dispatches`),kDispatchKey:Symbol(`dispatch key`),kDefaultHeaders:Symbol(`default headers`),kDefaultTrailers:Symbol(`default trailers`),kContentLength:Symbol(`content length`),kMockAgent:Symbol(`mock agent`),kMockAgentSet:Symbol(`mock agent set`),kMockAgentGet:Symbol(`mock agent get`),kMockDispatch:Symbol(`mock dispatch`),kClose:Symbol(`close`),kOriginalClose:Symbol(`original agent close`),kOriginalDispatch:Symbol(`original dispatch`),kOrigin:Symbol(`origin`),kIsMockActive:Symbol(`is mock active`),kNetConnect:Symbol(`net connect`),kGetNetConnect:Symbol(`get net connect`),kConnected:Symbol(`connected`),kIgnoreTrailingSlash:Symbol(`ignore trailing slash`),kMockAgentMockCallHistoryInstance:Symbol(`mock agent mock call history name`),kMockAgentRegisterCallHistory:Symbol(`mock agent register mock call history`),kMockAgentAddCallHistoryLog:Symbol(`mock agent add call history log`),kMockAgentIsCallHistoryEnabled:Symbol(`mock agent is call history enabled`),kMockAgentAcceptsNonStandardSearchParameters:Symbol(`mock agent accepts non standard search parameters`),kMockCallHistoryAddLog:Symbol(`mock call history add log`),kTotalDispatchCount:Symbol(`total dispatch count`)}})),Ce=t(((t,n)=>{let{MockNotMatchedError:r}=xe(),{kDispatches:i,kMockAgent:a,kOriginalDispatch:o,kOrigin:s,kGetNetConnect:c,kTotalDispatchCount:l}=Se(),{serializePathWithQuery:u}=T(),{STATUS_CODES:d}=e(`node:http`),{types:{isPromise:f}}=e(`node:util`),{InvalidArgumentError:p}=S();function m(e,t){return typeof e==`string`?e===t:e instanceof RegExp?e.test(t):typeof e==`function`&&e(t)===!0}function h(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e.toLocaleLowerCase(),t]))}function g(e,t){if(Array.isArray(e)){for(let n=0;n<e.length;n+=2)if(e[n].toLocaleLowerCase()===t.toLocaleLowerCase())return e[n+1];return}return typeof e.get==`function`?e.get(t):h(e)[t.toLocaleLowerCase()]}function _(e){let t=e.slice(),n=[];for(let e=0;e<t.length;e+=2)n.push([t[e],t[e+1]]);return Object.fromEntries(n)}function v(e,t){if(typeof e.headers==`function`)return Array.isArray(t)&&(t=_(t)),e.headers(t?h(t):{});if(e.headers===void 0)return!0;if(typeof t!=`object`||typeof e.headers!=`object`)return!1;for(let[n,r]of Object.entries(e.headers))if(!m(r,g(t,n)))return!1;return!0}function y(e){if(typeof e!=`string`)return e;let t=new URLSearchParams(e),n=new URLSearchParams;for(let[e,r]of t.entries()){if(e=e.replace(`[]`,``),/^(['"]).*\1$/.test(r)){n.append(e,r);continue}if(r.includes(`,`)){let t=r.split(`,`);for(let r of t)n.append(e,r);continue}n.append(e,r)}return n}function b(e){if(typeof e!=`string`)return e;let t=e.split(`?`,3);if(t.length!==2)return e;let n=new URLSearchParams(t.pop());return n.sort(),[...t,n.toString()].join(`?`)}function x(e,{path:t,method:n,body:r,headers:i}){let a=m(e.path,t),o=m(e.method,n),s=e.body===void 0||m(e.body,r),c=v(e,i);return a&&o&&s&&c}function C(e){return Buffer.isBuffer(e)||e instanceof Uint8Array||e instanceof ArrayBuffer?e:typeof e==`object`?JSON.stringify(e):e?e.toString():``}function w(e,t){let n=t.query?u(t.path,t.query):t.path,i=typeof n==`string`?b(n):n,a=O(i),o=e.filter(({consumed:e})=>!e).filter(({path:e,ignoreTrailingSlash:t})=>t?m(O(b(e)),a):m(b(e),i));if(o.length===0)throw new r(`Mock dispatch not matched for path '${i}'`);if(o=o.filter(({method:e})=>m(e,t.method)),o.length===0)throw new r(`Mock dispatch not matched for method '${t.method}' on path '${i}'`);if(o=o.filter(({body:e})=>e===void 0||m(e,t.body)),o.length===0)throw new r(`Mock dispatch not matched for body '${t.body}' on path '${i}'`);if(o=o.filter(e=>v(e,t.headers)),o.length===0){let e=typeof t.headers==`object`?JSON.stringify(t.headers):t.headers;throw new r(`Mock dispatch not matched for headers '${e}' on path '${i}'`)}return o[0]}function E(e,t,n,r){let i={timesInvoked:0,times:1,persist:!1,consumed:!1,...r},a=typeof n==`function`?{callback:n}:{...n},o={...i,...t,pending:!0,data:{error:null,...a}};return e.push(o),e[l]=(e[l]||0)+1,o}function D(e,t){let n=e.findIndex(e=>e.consumed?x(e,t):!1);n!==-1&&e.splice(n,1)}function O(e){for(;e.endsWith(`/`);)e=e.slice(0,-1);return e.length===0&&(e=`/`),e}function k(e){let{path:t,method:n,body:r,headers:i,query:a}=e;return{path:t,method:n,body:r,headers:i,query:a}}function A(e){let t=Object.keys(e),n=[];for(let r=0;r<t.length;++r){let i=t[r],a=e[i],o=Buffer.from(`${i}`);if(Array.isArray(a))for(let e=0;e<a.length;++e)n.push(o,Buffer.from(`${a[e]}`));else n.push(o,Buffer.from(`${a}`))}return n}function j(e){return d[e]||`unknown`}async function M(e){let t=[];for await(let n of e)t.push(n);return Buffer.concat(t).toString(`utf8`)}function N(e,t){let n=k(e),r=w(this[i],n);r.timesInvoked++,r.data.callback&&(r.data={...r.data,...r.data.callback(e)});let{data:{statusCode:a,data:o,headers:s,trailers:c,error:l},delay:u,persist:d}=r,{timesInvoked:p,times:m}=r;if(r.consumed=!d&&p>=m,r.pending=p<m,l!==null)return D(this[i],n),t.onError(l),!0;let h=!1,g=null;function v(e){h||(h=!0,g!==null&&(clearTimeout(g),g=null),t.onError(e))}t.onConnect?.(v,null),typeof u==`number`&&u>0?g=setTimeout(()=>{g=null,y(this[i])},u):y(this[i]);function y(r,i=o){if(h)return;let l=Array.isArray(e.headers)?_(e.headers):e.headers,u=typeof i==`function`?i({...e,headers:l}):i;if(f(u))return u.then(e=>y(r,e));if(h)return;let d=C(u),p=A(s),m=A(c);t.onHeaders?.(a,p,b,j(a)),t.onData?.(Buffer.from(d)),t.onComplete?.(m),D(r,n)}function b(){}return!0}function P(){let e=this[a],t=this[s],n=this[o];return function(a,o){if(e.isMockActive)try{N.call(this,a,o)}catch(s){if(s.code===`UND_MOCK_ERR_MOCK_NOT_MATCHED`){let u=e[c](),d=this[i][l]||this[i].length,f=`, ${this[i].filter(({consumed:e})=>!e).length} interceptor(s) remaining out of ${d} defined`;if(u===!1)throw new r(`${s.message}: subsequent request to origin ${t} was not allowed (net.connect disabled)${f}`);if(F(u,t))n.call(this,a,o);else throw new r(`${s.message}: subsequent request to origin ${t} was not allowed (net.connect is not enabled for this origin)${f}`)}else throw s}else n.call(this,a,o)}}function F(e,t){let n=new URL(t);return!!(e===!0||Array.isArray(e)&&e.some(e=>m(e,n.host)))}function I(e){return typeof e!=`string`&&!(e instanceof URL)?e:e instanceof URL?e.origin:e.toLowerCase()}function ee(e){let{agent:t,...n}=e;if(`enableCallHistory`in n&&typeof n.enableCallHistory!=`boolean`)throw new p(`options.enableCallHistory must to be a boolean`);if(`acceptNonStandardSearchParameters`in n&&typeof n.acceptNonStandardSearchParameters!=`boolean`)throw new p(`options.acceptNonStandardSearchParameters must to be a boolean`);if(`ignoreTrailingSlash`in n&&typeof n.ignoreTrailingSlash!=`boolean`)throw new p(`options.ignoreTrailingSlash must to be a boolean`);return n}n.exports={getResponseData:C,getMockDispatch:w,addMockDispatch:E,deleteMockDispatch:D,buildKey:k,generateKeyValues:A,matchValue:m,getResponse:M,getStatusText:j,mockDispatch:N,buildMockDispatch:P,checkNetConnect:F,buildAndValidateMockOptions:ee,getHeaderByName:g,buildHeadersFromArray:_,normalizeSearchParams:y,normalizeOrigin:I}})),we=t(((e,t)=>{let{getResponseData:n,buildKey:r,addMockDispatch:i}=Ce(),{kDispatches:a,kDispatchKey:o,kDefaultHeaders:s,kDefaultTrailers:c,kContentLength:l,kMockDispatch:u,kIgnoreTrailingSlash:d}=Se(),{InvalidArgumentError:f}=S(),{serializePathWithQuery:p}=T();var m=class{constructor(e){this[u]=e}delay(e){if(typeof e!=`number`||!Number.isInteger(e)||e<=0)throw new f(`waitInMs must be a valid integer > 0`);return this[u].delay=e,this}persist(){return this[u].persist=!0,this}times(e){if(typeof e!=`number`||!Number.isInteger(e)||e<=0)throw new f(`repeatTimes must be a valid integer > 0`);return this[u].times=e,this}},h=class{constructor(e,t){if(typeof e!=`object`)throw new f(`opts must be an object`);if(e.path===void 0)throw new f(`opts.path must be defined`);if(e.method===void 0&&(e.method=`GET`),typeof e.path==`string`){if(e.query)e.path=p(e.path,e.query);else{let t=new URL(e.path,`data://`);e.path=t.pathname+t.search}}typeof e.method==`string`&&(e.method=e.method.toUpperCase()),this[o]=r(e),this[a]=t,this[d]=e.ignoreTrailingSlash??!1,this[s]={},this[c]={},this[l]=!1}createMockScopeDispatchData({statusCode:e,data:t,responseOptions:r}){let i=n(t),a=this[l]?{"content-length":i.length}:{};return{statusCode:e,data:t,headers:{...this[s],...a,...r.headers},trailers:{...this[c],...r.trailers}}}validateReplyParameters(e){if(e.statusCode===void 0)throw new f(`statusCode must be defined`);if(typeof e.responseOptions!=`object`||e.responseOptions===null)throw new f(`responseOptions must be an object`)}reply(e){if(typeof e==`function`)return new m(i(this[a],this[o],t=>{let n=e(t);if(typeof n!=`object`||!n)throw new f(`reply options callback must return an object`);let r={data:``,responseOptions:{},...n};return this.validateReplyParameters(r),{...this.createMockScopeDispatchData(r)}},{ignoreTrailingSlash:this[d]}));let t={statusCode:e,data:arguments[1]===void 0?``:arguments[1],responseOptions:arguments[2]===void 0?{}:arguments[2]};this.validateReplyParameters(t);let n=this.createMockScopeDispatchData(t);return new m(i(this[a],this[o],n,{ignoreTrailingSlash:this[d]}))}replyWithError(e){if(e===void 0)throw new f(`error must be defined`);return new m(i(this[a],this[o],{error:e},{ignoreTrailingSlash:this[d]}))}defaultReplyHeaders(e){if(e===void 0)throw new f(`headers must be defined`);return this[s]=e,this}defaultReplyTrailers(e){if(e===void 0)throw new f(`trailers must be defined`);return this[c]=e,this}replyContentLength(){return this[l]=!0,this}};t.exports.MockInterceptor=h,t.exports.MockScope=m})),Te=t(((t,n)=>{let{promisify:r}=e(`node:util`),i=K(),{buildMockDispatch:a}=Ce(),{kDispatches:o,kMockAgent:s,kClose:c,kOriginalClose:l,kOrigin:u,kOriginalDispatch:d,kConnected:f,kIgnoreTrailingSlash:p}=Se(),{MockInterceptor:m}=we(),h=b(),{InvalidArgumentError:g}=S();n.exports=class extends i{constructor(e,t){if(!t||!t.agent||typeof t.agent.dispatch!=`function`)throw new g(`Argument opts.agent must implement Agent`);super(e,t),this[s]=t.agent,this[u]=e,this[p]=t.ignoreTrailingSlash??!1,this[o]=[],this[f]=1,this[d]=this.dispatch,this[l]=this.close.bind(this),this.dispatch=a.call(this),this.close=this[c]}get[h.kConnected](){return this[f]}intercept(e){return new m(e&&{ignoreTrailingSlash:this[p],...e},this[o])}cleanMocks(){this[o]=[]}async[c](){await r(this[l])(),this[f]=0,this[s][h.kClients].delete(this[u])}}})),Ee=t(((e,t)=>{let{kMockCallHistoryAddLog:n}=Se(),{InvalidArgumentError:r}=S();function i(e,t,n,i,a){switch(t.operator){case`OR`:return i.push(...n(e,a)),i;case`AND`:return n(e,i);default:throw new r(`options.operator must to be a case insensitive string equal to 'OR' or 'AND'`)}}function a(e={}){let t={};if(`operator`in e){if(typeof e.operator!=`string`||e.operator.toUpperCase()!==`OR`&&e.operator.toUpperCase()!==`AND`)throw new r(`options.operator must to be a case insensitive string equal to 'OR' or 'AND'`);return{...t,operator:e.operator.toUpperCase()}}return t}function o(e){return(t,n)=>{if(typeof t==`string`||t==null)return n.filter(n=>n[e]===t);if(t instanceof RegExp)return n.filter(n=>t.test(n[e]));throw new r(`${e} parameter should be one of string, regexp, undefined or null`)}}function s(e){try{let t=new URL(e.path,e.origin);return t.search.length===0&&(t.search=new URLSearchParams(e.query).toString()),t}catch(e){throw new r(`An error occurred when computing MockCallHistoryLog.url`,{cause:e})}}var c=class{constructor(e={}){this.body=e.body,this.headers=e.headers,this.method=e.method;let t=s(e);this.fullUrl=t.toString(),this.origin=t.origin,this.path=t.pathname,this.searchParams=Object.fromEntries(t.searchParams),this.protocol=t.protocol,this.host=t.host,this.port=t.port,this.hash=t.hash}toMap(){return new Map([[`protocol`,this.protocol],[`host`,this.host],[`port`,this.port],[`origin`,this.origin],[`path`,this.path],[`hash`,this.hash],[`searchParams`,this.searchParams],[`fullUrl`,this.fullUrl],[`method`,this.method],[`body`,this.body],[`headers`,this.headers]])}toString(){let e={betweenKeyValueSeparator:`->`,betweenPairSeparator:`|`},t=``;return this.toMap().forEach((n,r)=>{(typeof n==`string`||n==null)&&(t=`${t}${r}${e.betweenKeyValueSeparator}${n}${e.betweenPairSeparator}`),(typeof n==`object`&&n||Array.isArray(n))&&(t=`${t}${r}${e.betweenKeyValueSeparator}${JSON.stringify(n)}${e.betweenPairSeparator}`)}),t.slice(0,-1)}},l=class{logs=[];calls(){return this.logs}firstCall(){return this.logs.at(0)}lastCall(){return this.logs.at(-1)}nthCall(e){if(typeof e!=`number`)throw new r(`nthCall must be called with a number`);if(!Number.isInteger(e))throw new r(`nthCall must be called with an integer`);if(Math.sign(e)!==1)throw new r(`nthCall must be called with a positive value. use firstCall or lastCall instead`);return this.logs.at(e-1)}filterCalls(e,t){if(this.logs.length===0)return this.logs;if(typeof e==`function`)return this.logs.filter(e);if(e instanceof RegExp)return this.logs.filter(t=>e.test(t.toString()));if(typeof e==`object`&&e){if(Object.keys(e).length===0)return this.logs;let n={operator:`OR`,...a(t)},r=n.operator===`AND`?this.logs:[];return`protocol`in e&&(r=i(e.protocol,n,this.filterCallsByProtocol,r,this.logs)),`host`in e&&(r=i(e.host,n,this.filterCallsByHost,r,this.logs)),`port`in e&&(r=i(e.port,n,this.filterCallsByPort,r,this.logs)),`origin`in e&&(r=i(e.origin,n,this.filterCallsByOrigin,r,this.logs)),`path`in e&&(r=i(e.path,n,this.filterCallsByPath,r,this.logs)),`hash`in e&&(r=i(e.hash,n,this.filterCallsByHash,r,this.logs)),`fullUrl`in e&&(r=i(e.fullUrl,n,this.filterCallsByFullUrl,r,this.logs)),`method`in e&&(r=i(e.method,n,this.filterCallsByMethod,r,this.logs)),[...new Set(r)]}throw new r(`criteria parameter should be one of function, regexp, or object`)}filterCallsByProtocol=o.call(this,`protocol`);filterCallsByHost=o.call(this,`host`);filterCallsByPort=o.call(this,`port`);filterCallsByOrigin=o.call(this,`origin`);filterCallsByPath=o.call(this,`path`);filterCallsByHash=o.call(this,`hash`);filterCallsByFullUrl=o.call(this,`fullUrl`);filterCallsByMethod=o.call(this,`method`);clear(){this.logs=[]}[n](e){let t=new c(e);return this.logs.push(t),t}*[Symbol.iterator](){for(let e of this.calls())yield e}};t.exports.MockCallHistory=l,t.exports.MockCallHistoryLog=c})),De=t(((t,n)=>{let{promisify:r}=e(`node:util`),i=ce(),{buildMockDispatch:a}=Ce(),{kDispatches:o,kMockAgent:s,kClose:c,kOriginalClose:l,kOrigin:u,kOriginalDispatch:d,kConnected:f,kIgnoreTrailingSlash:p}=Se(),{MockInterceptor:m}=we(),h=b(),{InvalidArgumentError:g}=S();n.exports=class extends i{constructor(e,t){if(!t||!t.agent||typeof t.agent.dispatch!=`function`)throw new g(`Argument opts.agent must implement Agent`);super(e,t),this[s]=t.agent,this[u]=e,this[p]=t.ignoreTrailingSlash??!1,this[o]=[],this[f]=1,this[d]=this.dispatch,this[l]=this.close.bind(this),this.dispatch=a.call(this),this.close=this[c]}get[h.kConnected](){return this[f]}intercept(e){return new m(e&&{ignoreTrailingSlash:this[p],...e},this[o])}cleanMocks(){this[o]=[]}async[c](){await r(this[l])(),this[f]=0,this[s][h.kClients].delete(this[u])}}})),Oe=t(((t,n)=>{let{Transform:r}=e(`node:stream`),{Console:i}=e(`node:console`),a=process.versions.icu?`✅`:`Y `,o=process.versions.icu?`❌`:`N `;n.exports=class{constructor({disableColors:e}={}){this.transform=new r({transform(e,t,n){n(null,e)}}),this.logger=new i({stdout:this.transform,inspectOptions:{colors:!e&&!process.env.CI}})}format(e){let t=e.map(({method:e,path:t,data:{statusCode:n},persist:r,times:i,timesInvoked:s,origin:c})=>({Method:e,Origin:c,Path:t,"Status code":n,Persistent:r?a:o,Invocations:s,Remaining:r?1/0:i-s}));return this.logger.table(t),this.transform.read().toString()}}})),ke=t(((e,t)=>{let{kClients:n}=b(),r=Y(),{kAgent:i,kMockAgentSet:a,kMockAgentGet:o,kDispatches:s,kIsMockActive:c,kNetConnect:l,kGetNetConnect:u,kOptions:d,kFactory:f,kMockAgentRegisterCallHistory:p,kMockAgentIsCallHistoryEnabled:m,kMockAgentAddCallHistoryLog:h,kMockAgentMockCallHistoryInstance:g,kMockAgentAcceptsNonStandardSearchParameters:_,kMockCallHistoryAddLog:v,kIgnoreTrailingSlash:y}=Se(),x=Te(),C=De(),{matchValue:w,normalizeSearchParams:T,buildAndValidateMockOptions:E,normalizeOrigin:D}=Ce(),{InvalidArgumentError:O,UndiciError:k}=S(),j=A(),M=Oe(),{MockCallHistory:N}=Ee();t.exports=class extends j{constructor(e={}){super(e);let t=E(e);if(this[l]=!0,this[c]=!0,this[m]=t.enableCallHistory??!1,this[_]=t.acceptNonStandardSearchParameters??!1,this[y]=t.ignoreTrailingSlash??!1,e?.agent&&typeof e.agent.dispatch!=`function`)throw new O(`Argument opts.agent must implement Agent`);let a=e?.agent?e.agent:new r(e);this[i]=a,this[n]=a[n],this[d]=t,this[m]&&this[p]()}get(e){let t=D(e),n=this[y]?t.replace(/\/$/,``):t,r=this[o](n);return r||(r=this[f](n),this[a](n,r)),r}dispatch(e,t){e.origin=D(e.origin),this.get(e.origin),this[h](e);let n=this[_],r={...e};if(n&&r.path){let[e,t]=r.path.split(`?`);r.path=`${e}?${T(t,n)}`}return this[i].dispatch(r,t)}async close(){this.clearCallHistory(),await this[i].close(),this[n].clear()}deactivate(){this[c]=!1}activate(){this[c]=!0}enableNetConnect(e){if(typeof e==`string`||typeof e==`function`||e instanceof RegExp)Array.isArray(this[l])?this[l].push(e):this[l]=[e];else if(e===void 0)this[l]=!0;else throw new O(`Unsupported matcher. Must be one of String|Function|RegExp.`)}disableNetConnect(){this[l]=!1}enableCallHistory(){return this[m]=!0,this}disableCallHistory(){return this[m]=!1,this}getCallHistory(){return this[g]}clearCallHistory(){this[g]!==void 0&&this[g].clear()}get isMockActive(){return this[c]}[p](){this[g]===void 0&&(this[g]=new N)}[h](e){this[m]&&(this[p](),this[g][v](e))}[a](e,t){this[n].set(e,{count:0,dispatcher:t})}[f](e){let t=Object.assign({agent:this},this[d]);return this[d]&&this[d].connections===1?new x(e,t):new C(e,t)}[o](e){let t=this[n].get(e);if(t?.dispatcher)return t.dispatcher;if(typeof e!=`string`){let t=this[f](`http://localhost:9999`);return this[a](e,t),t}for(let[t,r]of Array.from(this[n]))if(r&&typeof t!=`string`&&w(t,e)){let t=this[f](e);return this[a](e,t),t[s]=r.dispatcher[s],t}}[u](){return this[l]}pendingInterceptors(){let e=this[n];return Array.from(e.entries()).flatMap(([e,t])=>t.dispatcher[s].map(t=>({...t,origin:e}))).filter(({pending:e})=>e)}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new M}={}){let t=this.pendingInterceptors();if(t.length!==0)throw new k(t.length===1?`1 interceptor is pending:\n\n${e.format(t)}`.trim():`${t.length} interceptors are pending:\n\n${e.format(t)}`.trim())}}})),Ae=t(((t,n)=>{let{InvalidArgumentError:r}=S(),{runtimeFeatures:i}=H();function a(e={}){let{ignoreHeaders:t=[],excludeHeaders:n=[],matchHeaders:r=[],caseSensitive:i=!1}=e;return{ignore:new Set(t.map(e=>i?e:e.toLowerCase())),exclude:new Set(n.map(e=>i?e:e.toLowerCase())),match:new Set(r.map(e=>i?e:e.toLowerCase()))}}let o=i.has(`crypto`)?e(`node:crypto`):null,s=o?.hash?e=>o.hash(`sha256`,e,`base64url`):e=>Buffer.from(e).toString(`base64url`);function c(e){return Array.isArray(e)&&!(e.length&1)}function l(e=[]){return e.length===0?()=>!1:function(t){let n;for(let r of e)if(typeof r==`string`){if(n||=t.toLowerCase(),n.includes(r.toLowerCase()))return!0}else if(r instanceof RegExp&&r.test(t))return!0;return!1}}function u(e){let t={};if(!e)return t;if(c(e)){for(let n=0;n<e.length;n+=2){let r=e[n],i=e[n+1];if(r&&i!==void 0){let e=Buffer.isBuffer(r)?r.toString():r,n=Buffer.isBuffer(i)?i.toString():i;t[e.toLowerCase()]=n}}return t}if(e&&typeof e==`object`)for(let[n,r]of Object.entries(e))n&&typeof n==`string`&&(t[n.toLowerCase()]=Array.isArray(r)?r.join(`, `):String(r));return t}let d=[`record`,`playback`,`update`];function f(e){if(!d.includes(e))throw new r(`Invalid snapshot mode: ${e}. Must be one of: ${d.join(`, `)}`)}n.exports={createHeaderFilters:a,hashId:s,isUndiciHeaders:c,normalizeHeaders:u,isUrlExcludedFactory:l,validateSnapshotMode:f}})),je=t(((t,n)=>{let{writeFile:r,readFile:i,mkdir:a}=e(`node:fs/promises`),{dirname:o,resolve:s}=e(`node:path`),{setTimeout:c,clearTimeout:l}=e(`node:timers`),{InvalidArgumentError:u,UndiciError:d}=S(),{hashId:f,isUrlExcludedFactory:p,normalizeHeaders:m,createHeaderFilters:h}=Ae();function g(e,t,n={}){let r=new URL(e.path,e.origin),i=e._normalizedHeaders||m(e.headers);return e._normalizedHeaders||=i,{method:e.method||`GET`,url:n.matchQuery===!1?`${r.origin}${r.pathname}`:r.toString(),headers:_(i,t,n),body:n.matchBody!==!1&&e.body?String(e.body):``}}function _(e,t,n={}){if(!e||typeof e!=`object`)return{};let{caseSensitive:r=!1}=n,i={},{ignore:a,exclude:o,match:s}=t;for(let[t,n]of Object.entries(e)){let e=r?t:t.toLowerCase();o.has(e)||a.has(e)||(s.size===0||s.has(e))&&(i[e]=n)}return i}function v(e,t,n={}){if(!e||typeof e!=`object`)return{};let{caseSensitive:r=!1}=n,i={},{exclude:a}=t;for(let[t,n]of Object.entries(e)){let e=r?t:t.toLowerCase();a.has(e)||(i[e]=n)}return i}function y(e){let t=[e.method,e.url];if(e.headers&&typeof e.headers==`object`){let n=Object.keys(e.headers).sort();for(let r of n){let n=Array.isArray(e.headers[r])?e.headers[r]:[e.headers[r]];t.push(r);for(let e of n.sort())t.push(String(e))}}t.push(e.body);let n=t.join(`|`);return f(n)}n.exports={SnapshotRecorder:class{#e;#t;#n=new Map;#r;#i=1/0;#a=!1;#o;constructor(e={}){this.#r=e.snapshotPath,this.#i=e.maxSnapshots||1/0,this.#a=e.autoFlush||!1,this.flushInterval=e.flushInterval||3e4,this._flushTimer=null,this.matchOptions={matchHeaders:e.matchHeaders||[],ignoreHeaders:e.ignoreHeaders||[],excludeHeaders:e.excludeHeaders||[],matchBody:e.matchBody!==!1,matchQuery:e.matchQuery!==!1,caseSensitive:e.caseSensitive||!1},this.#o=h(this.matchOptions),this.shouldRecord=e.shouldRecord||(()=>!0),this.shouldPlayback=e.shouldPlayback||(()=>!0),this.#t=p(e.excludeUrls),this.#a&&this.#r&&this.#s()}async record(e,t){if(!this.shouldRecord(e)||this.isUrlExcluded(e))return;let n=g(e,this.#o,this.matchOptions),r=y(n),i=m(t.headers),a={statusCode:t.statusCode,headers:v(i,this.#o,this.matchOptions),body:Buffer.isBuffer(t.body)?t.body.toString(`base64`):Buffer.from(String(t.body||``)).toString(`base64`),trailers:t.trailers};if(this.#n.size>=this.#i&&!this.#n.has(r)){let e=this.#n.keys().next().value;this.#n.delete(e)}let o=this.#n.get(r);o&&o.responses?(o.responses.push(a),o.timestamp=new Date().toISOString()):this.#n.set(r,{request:n,responses:[a],callCount:0,timestamp:new Date().toISOString()}),this.#a&&this.#r&&this.#l()}isUrlExcluded(e){let t=new URL(e.path,e.origin).toString();return this.#t(t)}findSnapshot(e){if(!this.shouldPlayback(e)||this.isUrlExcluded(e))return;let t=y(g(e,this.#o,this.matchOptions)),n=this.#n.get(t);if(!n)return;let r=n.callCount||0,i=Math.min(r,n.responses.length-1);return n.callCount=r+1,{...n,response:n.responses[i]}}async loadSnapshots(e){let t=e||this.#r;if(!t)throw new u(`Snapshot path is required`);try{let e=await i(s(t),`utf8`),n=JSON.parse(e);if(Array.isArray(n)){this.#n.clear();for(let{hash:e,snapshot:t}of n)this.#n.set(e,t)}else this.#n=new Map(Object.entries(n))}catch(e){if(e.code===`ENOENT`)this.#n.clear();else throw new d(`Failed to load snapshots from ${t}`,{cause:e})}}async saveSnapshots(e){let t=e||this.#r;if(!t)throw new u(`Snapshot path is required`);let n=s(t);await a(o(n),{recursive:!0});let i=Array.from(this.#n.entries()).map(([e,t])=>({hash:e,snapshot:t}));await r(n,JSON.stringify(i,null,2),{flush:!0})}clear(){this.#n.clear()}getSnapshots(){return Array.from(this.#n.values())}size(){return this.#n.size}resetCallCounts(){for(let e of this.#n.values())e.callCount=0}deleteSnapshot(e){let t=y(g(e,this.#o,this.matchOptions));return this.#n.delete(t)}getSnapshotInfo(e){let t=y(g(e,this.#o,this.matchOptions)),n=this.#n.get(t);return n?{hash:t,request:n.request,responseCount:n.responses?n.responses.length:+!!n.response,callCount:n.callCount||0,timestamp:n.timestamp}:null}replaceSnapshots(e){if(this.#n.clear(),Array.isArray(e))for(let{hash:t,snapshot:n}of e)this.#n.set(t,n);else e&&typeof e==`object`&&(this.#n=new Map(Object.entries(e)))}#s(){return this.#l()}#c(){this.#e&&=(l(this.#e),this.saveSnapshots().catch(()=>{}),null)}#l(){this.#e=c(()=>{this.saveSnapshots().catch(()=>{}),this.#a?this.#e?.refresh():this.#e=null},1e3)}destroy(){this.#c(),this.#e&&=(l(this.#e),null)}async close(){this.#r&&this.#n.size!==0&&await this.saveSnapshots(),this.destroy()}},formatRequestKey:g,createRequestHash:y,filterHeadersForMatching:_,filterHeadersForStorage:v,createHeaderFilters:h}})),Me=t(((e,t)=>{let n=Y(),r=ke(),{SnapshotRecorder:i}=je(),a=k(),{InvalidArgumentError:o,UndiciError:s}=S(),{validateSnapshotMode:c}=Ae(),l=Symbol(`kSnapshotRecorder`),u=Symbol(`kSnapshotMode`),d=Symbol(`kSnapshotPath`),f=Symbol(`kSnapshotLoaded`),p=Symbol(`kRealAgent`),m=!1;t.exports=class extends r{constructor(e={}){m||=(process.emitWarning(`SnapshotAgent is experimental and subject to change`,`ExperimentalWarning`),!0);let{mode:t=`record`,snapshotPath:r=null,...a}=e;if(super(a),c(t),(t===`playback`||t===`update`)&&!r)throw new o(`snapshotPath is required when mode is '${t}'`);this[u]=t,this[d]=r,this[l]=new i({snapshotPath:this[d],mode:this[u],maxSnapshots:e.maxSnapshots,autoFlush:e.autoFlush,flushInterval:e.flushInterval,matchHeaders:e.matchHeaders,ignoreHeaders:e.ignoreHeaders,excludeHeaders:e.excludeHeaders,matchBody:e.matchBody,matchQuery:e.matchQuery,caseSensitive:e.caseSensitive,shouldRecord:e.shouldRecord,shouldPlayback:e.shouldPlayback,excludeUrls:e.excludeUrls}),this[f]=!1,(this[u]===`record`||this[u]===`update`||this[u]===`playback`&&e.excludeUrls&&e.excludeUrls.length>0)&&(this[p]=new n(e)),(this[u]===`playback`||this[u]===`update`)&&this[d]&&this.loadSnapshots().catch(()=>{})}dispatch(e,t){t=a.wrap(t);let n=this[u];if(this[l].isUrlExcluded(e))return this[p].dispatch(e,t);if(n===`playback`||n===`update`){if(!this[f])return this.#e(e,t);let r=this[l].findSnapshot(e);if(r)return this.#n(r,t);if(n===`update`)return this.#t(e,t);{let n=new s(`No snapshot found for ${e.method||`GET`} ${e.path}`);if(t.onError){t.onError(n);return}throw n}}if(n===`record`)return this.#t(e,t)}async#e(e,t){return await this.loadSnapshots(),this.dispatch(e,t)}#t(e,t){let n={statusCode:null,headers:{},trailers:{},body:[]},r=this;return this[p].dispatch(e,{onRequestStart(e,n){return t.onRequestStart(e,{...n,history:this.history})},onRequestUpgrade(e,n,r,i){return t.onRequestUpgrade(e,n,r,i)},onResponseStart(e,r,i,a){return n.statusCode=r,n.headers=i,t.onResponseStart(e,r,i,a)},onResponseData(e,r){return n.body.push(r),t.onResponseData(e,r)},onResponseEnd(i,a){n.trailers=a;let o=Buffer.concat(n.body);r[l].record(e,{statusCode:n.statusCode,headers:n.headers,body:o,trailers:n.trailers}).then(()=>t.onResponseEnd(i,a)).catch(e=>t.onResponseError(i,e))}})}#n(e,t){try{let{response:n}=e,r={pause(){},resume(){},abort(e){this.aborted=!0,this.reason=e},aborted:!1,paused:!1};t.onRequestStart(r),t.onResponseStart(r,n.statusCode,n.headers);let i=Buffer.from(n.body,`base64`);t.onResponseData(r,i),t.onResponseEnd(r,n.trailers)}catch(e){t.onError?.(e)}}async loadSnapshots(e){await this[l].loadSnapshots(e||this[d]),this[f]=!0,this[u]===`playback`&&this.#r()}async saveSnapshots(e){return this[l].saveSnapshots(e||this[d])}#r(){for(let e of this[l].getSnapshots()){let{request:t,responses:n,response:r}=e,i=new URL(t.url),a=this.get(i.origin),o=n?n[0]:r;o&&a.intercept({path:i.pathname+i.search,method:t.method,headers:t.headers,body:t.body}).reply(o.statusCode,o.body,{headers:o.headers,trailers:o.trailers}).persist()}}getRecorder(){return this[l]}getMode(){return this[u]}clearSnapshots(){this[l].clear()}resetCallCounts(){this[l].resetCallCounts()}deleteSnapshot(e){return this[l].deleteSnapshot(e)}getSnapshotInfo(e){return this[l].getSnapshotInfo(e)}replaceSnapshots(e){this[l].replaceSnapshots(e)}async close(){await this[l].close(),await this[p]?.close(),await super.close()}}})),Ne=t(((e,t)=>{let n=Symbol.for(`undici.globalDispatcher.2`),r=Symbol.for(`undici.globalDispatcher.1`),{InvalidArgumentError:i}=S(),a=Y();s()===void 0&&o(new a);function o(e){if(!e||typeof e.dispatch!=`function`)throw new i(`Argument agent must implement Agent`);Object.defineProperty(globalThis,n,{value:e,writable:!0,enumerable:!1,configurable:!1}),Object.defineProperty(globalThis,r,{value:e,writable:!0,enumerable:!1,configurable:!1})}function s(){return globalThis[r]}t.exports={setGlobalDispatcher:o,getGlobalDispatcher:s,installedExports:[`fetch`,`Headers`,`Response`,`Request`,`FormData`,`WebSocket`,`CloseEvent`,`ErrorEvent`,`MessageEvent`,`EventSource`]}})),Pe=t(((t,n)=>{let r=e(`node:assert`),i=k();n.exports=class{#e;#t=!1;#n=!1;#r=!1;constructor(e){if(typeof e!=`object`||!e)throw TypeError(`handler must be an object`);this.#e=i.wrap(e)}onRequestStart(...e){this.#e.onRequestStart?.(...e)}onRequestUpgrade(...e){return r(!this.#t),r(!this.#n),this.#e.onRequestUpgrade?.(...e)}onResponseStart(...e){return r(!this.#t),r(!this.#n),r(!this.#r),this.#r=!0,this.#e.onResponseStart?.(...e)}onResponseData(...e){return r(!this.#t),r(!this.#n),this.#e.onResponseData?.(...e)}onResponseEnd(...e){return r(!this.#t),r(!this.#n),this.#t=!0,this.#e.onResponseEnd?.(...e)}onResponseError(...e){return this.#n=!0,this.#e.onResponseError?.(...e)}onBodySent(){}}})),Fe=t(((t,n)=>{let r=T(),{kBodyUsed:i}=b(),a=e(`node:assert`),{InvalidArgumentError:o}=S(),s=e(`node:events`),c=[300,301,302,303,307,308],l=Symbol(`body`),u=()=>{};var d=class{constructor(e){this[l]=e,this[i]=!1}async*[Symbol.asyncIterator](){a(!this[i],`disturbed`),this[i]=!0,yield*this[l]}},f=class e{static buildDispatch(t,n){if(n!=null&&(!Number.isInteger(n)||n<0))throw new o(`maxRedirections must be a positive number`);let r=t.dispatch.bind(t);return(t,i)=>r(t,new e(r,n,t,i))}constructor(e,t,n,c){if(t!=null&&(!Number.isInteger(t)||t<0))throw new o(`maxRedirections must be a positive number`);this.dispatch=e,this.location=null;let{maxRedirections:l,...u}=n;this.opts=u,this.maxRedirections=t,this.handler=c,this.history=[],r.isStream(this.opts.body)?(r.bodyLength(this.opts.body)===0&&this.opts.body.on(`data`,function(){a(!1)}),typeof this.opts.body.readableDidRead!=`boolean`&&(this.opts.body[i]=!1,s.prototype.on.call(this.opts.body,`data`,function(){this[i]=!0}))):(this.opts.body&&typeof this.opts.body.pipeTo==`function`||this.opts.body&&typeof this.opts.body!=`string`&&!ArrayBuffer.isView(this.opts.body)&&r.isIterable(this.opts.body)&&!r.isFormDataLike(this.opts.body))&&(this.opts.body=new d(this.opts.body))}onRequestStart(e,t){this.handler.onRequestStart?.(e,{...t,history:this.history})}onRequestUpgrade(e,t,n,r){this.handler.onRequestUpgrade?.(e,t,n,r)}onResponseStart(e,t,n,i){if(this.opts.throwOnMaxRedirect&&this.history.length>=this.maxRedirections)throw Error(`max redirects`);if((t===301||t===302)&&this.opts.method===`POST`&&(this.opts.method=`GET`,r.isStream(this.opts.body)&&r.destroy(this.opts.body.on(`error`,u)),this.opts.body=null),t===303&&this.opts.method!==`HEAD`&&(this.opts.method=`GET`,r.isStream(this.opts.body)&&r.destroy(this.opts.body.on(`error`,u)),this.opts.body=null),this.location=this.history.length>=this.maxRedirections||r.isDisturbed(this.opts.body)||c.indexOf(t)===-1?null:n.location,this.opts.origin&&this.history.push(new URL(this.opts.path,this.opts.origin)),!this.location){this.handler.onResponseStart?.(e,t,n,i);return}let{origin:a,pathname:s,search:l}=r.parseURL(new URL(this.location,this.opts.origin&&new URL(this.opts.path,this.opts.origin))),d=l?`${s}${l}`:s,f=`${a}${d}`;for(let e of this.history)if(e.toString()===f)throw new o(`Redirect loop detected. Cannot redirect to ${a}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`);this.opts.headers=m(this.opts.headers,t===303,this.opts.origin!==a),this.opts.path=d,this.opts.origin=a,this.opts.query=null}onResponseData(e,t){this.location||this.handler.onResponseData?.(e,t)}onResponseEnd(e,t){this.location?this.dispatch(this.opts,this):this.handler.onResponseEnd(e,t)}onResponseError(e,t){this.handler.onResponseError?.(e,t)}};function p(e,t,n){if(e.length===4)return r.headerNameToString(e)===`host`;if(t&&r.headerNameToString(e).startsWith(`content-`))return!0;if(n&&(e.length===13||e.length===6||e.length===19)){let t=r.headerNameToString(e);return t===`authorization`||t===`cookie`||t===`proxy-authorization`}return!1}function m(e,t,n){let i=[];if(Array.isArray(e))for(let r=0;r<e.length;r+=2)p(e[r],t,n)||i.push(e[r],e[r+1]);else if(e&&typeof e==`object`){let a=r.hasSafeIterator(e)?e:Object.entries(e);for(let[e,r]of a)p(e,t,n)||i.push(e,r)}else a(e==null,`headers must be an object or an array`);return i}n.exports=f})),Ie=t(((e,t)=>{let n=Fe();function r({maxRedirections:e}={}){return t=>function(r,i){let{maxRedirections:a=e,...o}=r;if(a==null||a===0)return t(r,i);let s={...o};return t(s,new n(t,a,s,i))}}t.exports=r})),Le=t(((e,t)=>{let n=Pe(),{ResponseError:r}=S();var i=class extends n{#e;#t;#n;#r;#i;constructor(e,{handler:t}){super(t)}#a(e){return(this.#t??``).indexOf(e)===0}onRequestStart(e,t){return this.#e=0,this.#t=null,this.#n=null,this.#r=null,this.#i=``,super.onRequestStart(e,t)}onResponseStart(e,t,n,r){if(this.#e=t,this.#r=n,this.#t=n[`content-type`],this.#e<400)return super.onResponseStart(e,t,n,r);(this.#a(`application/json`)||this.#a(`text/plain`))&&(this.#n=new TextDecoder(`utf-8`))}onResponseData(e,t){if(this.#e<400)return super.onResponseData(e,t);this.#i+=this.#n?.decode(t,{stream:!0})??``}onResponseEnd(e,t){if(this.#e>=400){if(this.#i+=this.#n?.decode(void 0,{stream:!1})??``,this.#a(`application/json`))try{this.#i=JSON.parse(this.#i)}catch{}let t,n=Error.stackTraceLimit;Error.stackTraceLimit=0;try{t=new r(`Response Error`,this.#e,{body:this.#i,headers:this.#r})}finally{Error.stackTraceLimit=n}super.onResponseError(e,t)}else super.onResponseEnd(e,t)}onResponseError(e,t){super.onResponseError(e,t)}};t.exports=()=>e=>function(t,n){return e(t,new i(t,{handler:n}))}})),Re=t(((e,t)=>{let n=Q();t.exports=e=>t=>function(r,i){return t(r,new n({...r,retryOptions:{...e,...r.retryOptions}},{handler:i,dispatch:t}))}})),ze=t(((e,t)=>{let{InvalidArgumentError:n,RequestAbortedError:r}=S(),i=Pe();var a=class extends i{#e=1048576;#t=!1;#n=0;#r=null;aborted=!1;reason=!1;constructor({maxSize:e,signal:t},r){if(e!=null&&(!Number.isFinite(e)||e<1))throw new n(`maxSize must be a number greater than 0`);super(r),this.#e=e??this.#e}#i(e){this.aborted=!0,this.reason=e}onRequestStart(e,t){return e.abort=this.#i.bind(this),this.#r=e,super.onRequestStart(e,t)}onResponseStart(e,t,n,i){let a=n[`content-length`];if(a!=null&&a>this.#e)throw new r(`Response size (${a}) larger than maxSize (${this.#e})`);return this.aborted===!0||super.onResponseStart(e,t,n,i)}onResponseError(e,t){this.#t||(t=this.#r?.reason??t,super.onResponseError(e,t))}onResponseData(e,t){return this.#n+=t.length,this.#n>=this.#e&&(this.#t=!0,this.aborted===!0?super.onResponseError(e,this.reason):super.onResponseEnd(e,{})),!0}onResponseEnd(e,t){if(!this.#t){if(this.#r.aborted===!0){super.onResponseError(e,this.reason);return}super.onResponseEnd(e,t)}}};function o({maxSize:e}={maxSize:1048576}){return t=>function(n,r){let{dumpMaxSize:i=e}=n;return t(n,new a({maxSize:i,signal:n.signal},r))}}t.exports=o})),Be=t(((t,n)=>{let{isIP:r}=e(`node:net`),{lookup:i}=e(`node:dns`),a=Pe(),{InvalidArgumentError:o,InformationalError:s}=S(),c=2**31-1;function l(e){let t=Object.getPrototypeOf(e);return Object.prototype.hasOwnProperty.call(e,Symbol.iterator)||t!=null&&t!==Object.prototype&&typeof e[Symbol.iterator]==`function`}function u(e){return typeof e==`string`&&e.toLowerCase()===`host`}function d(e){if(e==null)return null;if(Array.isArray(e)){if(e.length===0||!Array.isArray(e[0]))return e;let t=[];for(let n of e)Array.isArray(n)&&n.length===2?t.push(n[0],n[1]):t.push(n);return t}if(typeof e==`object`&&l(e)){let t=[];for(let n of e)Array.isArray(n)&&n.length===2?t.push(n[0],n[1]):t.push(n);return t}return e}function f(e){if(e==null)return!1;if(Array.isArray(e)){if(e.length===0)return!1;for(let t=0;t<e.length;t+=2)if(u(e[t]))return!0;return!1}if(typeof e==`object`){for(let t in e)if(u(t))return!0}return!1}function p(e,t){let n=d(t);return f(n)?n:Array.isArray(n)?[`host`,e,...n]:n&&typeof n==`object`?{host:e,...n}:{host:e}}var m=class{#e=0;#t=new Map;constructor(e){this.#e=e.maxItems}get size(){return this.#t.size}get(e){return this.#t.get(e)??null}set(e,t){this.#t.set(e,t)}delete(e){this.#t.delete(e)}full(){return this.size>=this.#e}},h=class{#e=0;#t=0;dualStack=!0;affinity=null;lookup=null;pick=null;storage=null;constructor(e){this.#e=e.maxTTL,this.#t=e.maxItems,this.dualStack=e.dualStack,this.affinity=e.affinity,this.lookup=e.lookup??this.#n,this.pick=e.pick??this.#r,this.storage=e.storage??new m(e)}runLookup(e,t,n){let r=this.storage.get(e.hostname);if(r==null&&this.storage.full()){n(null,e);return}let i={affinity:this.affinity,dualStack:this.dualStack,lookup:this.lookup,pick:this.pick,...t.dns,maxTTL:this.#e,maxItems:this.#t};if(r==null)this.lookup(e,i,(t,r)=>{if(t||r==null||r.length===0){n(t??new s(`No DNS entries found`));return}this.setRecords(e,r);let a=this.storage.get(e.hostname),o=this.pick(e,a,i.affinity),c;c=typeof o.port==`number`?`:${o.port}`:e.port===``?``:`:${e.port}`,n(null,new URL(`${e.protocol}//${o.family===6?`[${o.address}]`:o.address}${c}`))});else{let a=this.pick(e,r,i.affinity);if(a==null){this.storage.delete(e.hostname),this.runLookup(e,t,n);return}let o;o=typeof a.port==`number`?`:${a.port}`:e.port===``?``:`:${e.port}`,n(null,new URL(`${e.protocol}//${a.family===6?`[${a.address}]`:a.address}${o}`))}}#n(e,t,n){i(e.hostname,{all:!0,family:this.dualStack===!1?this.affinity:0,order:`ipv4first`},(e,t)=>{if(e)return n(e);let r=new Map;for(let e of t)r.set(`${e.address}:${e.family}`,e);n(null,r.values())})}#r(e,t,n){let r=null,{records:i,offset:a}=t,o;if(this.dualStack?(n??(a==null||a===c?(t.offset=0,n=4):(t.offset++,n=(t.offset&1)==1?6:4)),o=i[n]!=null&&i[n].ips.length>0?i[n]:i[n===4?6:4]):o=i[n],o==null||o.ips.length===0)return r;o.offset==null||o.offset===c?o.offset=0:o.offset++;let s=o.offset%o.ips.length;return r=o.ips[s]??null,r==null?r:Date.now()-r.timestamp>r.ttl?(o.ips.splice(s,1),this.pick(e,t,n)):r}pickFamily(e,t){let n=this.storage.get(e.hostname)?.records;if(!n)return null;let r=n[t];if(!r)return null;r.offset==null||r.offset===c?r.offset=0:r.offset++;let i=r.offset%r.ips.length,a=r.ips[i]??null;return a==null||Date.now()-a.timestamp>a.ttl&&r.ips.splice(i,1),a}setRecords(e,t){let n=Date.now(),r={records:{4:null,6:null}},i=this.#e;for(let e of t){e.timestamp=n,typeof e.ttl==`number`?(e.ttl=Math.min(e.ttl,this.#e),i=Math.min(i,e.ttl)):e.ttl=this.#e;let t=r.records[e.family]??{ips:[]};t.ips.push(e),r.records[e.family]=t}this.storage.set(e.hostname,r,{ttl:i})}deleteRecords(e){this.storage.delete(e.hostname)}getHandler(e,t){return new g(this,e,t)}},g=class extends a{#e=null;#t=null;#n=null;#r=null;#i=null;#a=!0;constructor(e,{origin:t,handler:n,dispatch:r,newOrigin:i},a){super(n),this.#r=t,this.#i=i,this.#t={...a},this.#e=e,this.#n=r}onResponseError(e,t){switch(t.code){case`ETIMEDOUT`:case`ECONNREFUSED`:if(this.#e.dualStack){if(!this.#a){super.onResponseError(e,t);return}this.#a=!1;let n=this.#i.hostname[0]===`[`?4:6,r=this.#e.pickFamily(this.#r,n);if(r==null){super.onResponseError(e,t);return}let i;i=typeof r.port==`number`?`:${r.port}`:this.#r.port===``?``:`:${this.#r.port}`;let a={...this.#t,origin:`${this.#r.protocol}//${r.family===6?`[${r.address}]`:r.address}${i}`,headers:p(this.#r.host,this.#t.headers)};this.#n(a,this);return}super.onResponseError(e,t);break;case`ENOTFOUND`:this.#e.deleteRecords(this.#r),super.onResponseError(e,t);break;default:super.onResponseError(e,t)}}};n.exports=e=>{if(e?.maxTTL!=null&&(typeof e?.maxTTL!=`number`||e?.maxTTL<0))throw new o(`Invalid maxTTL. Must be a positive number`);if(e?.maxItems!=null&&(typeof e?.maxItems!=`number`||e?.maxItems<1))throw new o(`Invalid maxItems. Must be a positive number and greater than zero`);if(e?.affinity!=null&&e?.affinity!==4&&e?.affinity!==6)throw new o(`Invalid affinity. Must be either 4 or 6`);if(e?.dualStack!=null&&typeof e?.dualStack!=`boolean`)throw new o(`Invalid dualStack. Must be a boolean`);if(e?.lookup!=null&&typeof e?.lookup!=`function`)throw new o(`Invalid lookup. Must be a function`);if(e?.pick!=null&&typeof e?.pick!=`function`)throw new o(`Invalid pick. Must be a function`);if(e?.storage!=null&&(typeof e?.storage?.get!=`function`||typeof e?.storage?.set!=`function`||typeof e?.storage?.full!=`function`||typeof e?.storage?.delete!=`function`))throw new o(`Invalid storage. Must be a object with methods: { get, set, full, delete }`);let t=e?.dualStack??!0,n;n=t?e?.affinity??null:e?.affinity??4;let i=new h({maxTTL:e?.maxTTL??1e4,lookup:e?.lookup??null,pick:e?.pick??null,dualStack:t,affinity:n,maxItems:e?.maxItems??1/0,storage:e?.storage});return e=>function(t,n){let a=t.origin.constructor===URL?t.origin:new URL(t.origin);return r(a.hostname)===0?(i.runLookup(a,t,(r,o)=>{if(r)return n.onResponseError(null,r);e({...t,servername:a.hostname,origin:o.origin,headers:p(a.host,t.headers)},i.getHandler({origin:a,dispatch:e,handler:n,newOrigin:o},t))}),!0):e(t,n)}}})),Ve=t(((e,t)=>{let{safeHTTPMethods:n,pathHasQueryOrFragment:r,hasSafeIterator:i,isValidHTTPToken:a}=T(),{serializePathWithQuery:o}=T(),s=[`no-store`,`private`,`no-cache`],c=Symbol(`invalid cache-control directives`);function l(e){return e.replace(/^[\t ]+|[\t ]+$/g,``)}function u(e,t){for(let n=0;n<e.length;n++)if(e[n]===t)return!0;return!1}function d(e){return e.replace(/^[\t ]+/,``)}function f(e){return e.replace(/[\t ]+$/,``)}function p(e,t){let n=!1;for(let r=t;r<e.length;r++)if(n)n=!1;else if(e[r]===`\\`)n=!0;else if(e[r]===`"`)return r;return-1}function m(e){let t=[],n=0,r=-1,i=!1,a=!1;for(let o=0;o<e.length;o++)i?a?a=!1:e[o]===`\\`?a=!0:e[o]===`"`&&(i=!1,r=-1):e[o]===`"`?(i=!0,r=o):e[o]===`,`&&(t.push({value:e.substring(n,o),fromMalformedQuote:!1}),n=o+1);if(!i)return t.push({value:e.substring(n),fromMalformedQuote:!1}),t;let o=e.substring(n),s=r-n,c=0;for(let e=0;e<o.length;e++)o[e]===`,`&&(t.push({value:o.substring(c,e),fromMalformedQuote:c>s}),c=e+1);return t.push({value:o.substring(c),fromMalformedQuote:c>s}),t}function h(e,t){let n=e[c];n===void 0&&(n=new Set,Object.defineProperty(e,c,{value:n})),n.add(t)}function g(e,t){return e[c]?.has(t)===!0}function _(e){for(let t of s)if(e.startsWith(t)&&e.length>t.length&&!a(e[t.length]))return t;let t=``,n=!1;for(let r=0;r<e.length;r++)a(e[r])?t+=e[r]:n=!0;if(n&&u(s,t))return t}function v(e){if(!e.origin)throw Error(`opts.origin is undefined`);let t=e.path||`/`;return e.query&&!r(t)&&(t=o(t,e.query)),{origin:e.origin.toString(),method:e.method,path:t,headers:e.headers}}function y(e,t,n){let r=t.toLowerCase(),i=e[r],a=Array.isArray(n)?n:[n];i===void 0?e[r]=Array.isArray(n)?n.slice():n:Array.isArray(i)?i.push(...a):e[r]=[i,...a]}function b(e){let t;if(e.headers==null)t={};else if(typeof e.headers==`object`){if(t={},i(e.headers))for(let n of e.headers){if(!Array.isArray(n))throw Error(`opts.headers is not a valid header map`);let[e,r]=n;if(typeof e!=`string`||typeof r!=`string`)throw Error(`opts.headers is not a valid header map`);y(t,e,r)}else for(let n of Object.keys(e.headers))y(t,n,e.headers[n])}else throw Error(`opts.headers is not an object`);return t}function x(e){if(typeof e!=`object`)throw TypeError(`expected key to be object, got ${typeof e}`);for(let t of[`origin`,`method`,`path`])if(typeof e[t]!=`string`)throw TypeError(`expected key.${t} to be string, got ${typeof e[t]}`);if(e.headers!==void 0&&typeof e.headers!=`object`)throw TypeError(`expected headers to be object, got ${typeof e}`)}function S(e){if(typeof e!=`object`)throw TypeError(`expected value to be object, got ${typeof e}`);for(let t of[`statusCode`,`cachedAt`,`staleAt`,`deleteAt`])if(typeof e[t]!=`number`)throw TypeError(`expected value.${t} to be number, got ${typeof e[t]}`);if(typeof e.statusMessage!=`string`)throw TypeError(`expected value.statusMessage to be string, got ${typeof e.statusMessage}`);if(e.headers!=null&&typeof e.headers!=`object`)throw TypeError(`expected value.rawHeaders to be object, got ${typeof e.headers}`);if(e.vary!==void 0&&typeof e.vary!=`object`)throw TypeError(`expected value.vary to be object, got ${typeof e.vary}`);if(e.etag!==void 0&&typeof e.etag!=`string`)throw TypeError(`expected value.etag to be string, got ${typeof e.etag}`)}function C(e){let t={},n=new Set,r=new Set,i=m(Array.isArray(e)?e.join(`,`):e);for(let e=0;e<i.length;e++){let o=i[e],s=o.value.toLowerCase(),c=o.fromMalformedQuote,u=s.indexOf(`=`),m,g,v=!1,y=!1;if(u!==-1){let e=s.substring(0,u),t=s.substring(u+1);v=f(e)!==e,y=d(t)!==t,m=l(e),g=d(t)}else m=l(s);let b=_(m);if(b!==void 0){t[b]=!0;continue}switch(m){case`min-fresh`:case`max-stale`:case`max-age`:case`s-maxage`:case`stale-while-revalidate`:case`stale-if-error`:{if(c||n.has(m))continue;if(g===void 0||v||y){delete t[m],n.add(m),h(t,m);continue}if(g.length>=2&&g[0]===`"`&&g[g.length-1]===`"`&&(g=g.substring(1,g.length-1)),!/^[0-9]+$/.test(g)){delete t[m],n.add(m),h(t,m);continue}let e=Math.min(parseInt(g,10),2147483647);m===`min-fresh`?(!(m in t)||t[m]<e)&&(t[m]=e):(!(m in t)||t[m]>e)&&(t[m]=e);break}case`private`:case`no-cache`:if(c){t[m]=!0;break}if(g!==void 0&&g.length===0){t[m]=!0;break}if(g){if(g[0]===`"`){g=f(g);let n=``,r=e,o=!1,s=p(g,1);if(s!==-1)n=g.substring(1,s),o=!0;else{let t=[g.substring(1)];for(let n=e+1;n<i.length;n++){let e=l(i[n].value),a=p(e,0);if(r=n,a!==-1){t.push(e.substring(0,a)),o=!0;break}t.push(e)}n=t.join(`,`)}if(!o){t[m]=!0;break}e=r;let c=n.split(`,`),u=!0;for(let e=0;e<c.length;e++)c[e]=l(c[e]),a(c[e])||(u=!1);u?t[m]!==!0&&(m in t?t[m]=t[m].concat(c):t[m]=c):t[m]=!0}else{let e=l(g);a(e)?t[m]!==!0&&(m in t?t[m]=t[m].concat(e):t[m]=[e]):t[m]=!0}break}case`public`:case`must-revalidate`:case`proxy-revalidate`:case`immutable`:case`no-transform`:case`must-understand`:case`only-if-cached`:if(c||r.has(m))continue;if(g!==void 0){delete t[m],r.add(m);continue}t[m]=!0;break;case`no-store`:t[m]=!0;break;default:continue}}return t}function w(e){let t=Array.isArray(e)?e:[e],n=[];for(let e=0;e<t.length;e++){let r=t[e].split(`,`);for(let e=0;e<r.length;e++)n.push(r[e])}return n}function E(e){let t=w(e);for(let e=0;e<t.length;e++)if(l(t[e]).indexOf(`*`)!==-1)return!0;return!1}function D(e,t){if(E(e))return t;let n={},r=w(e);for(let e of r){let r=l(e).toLowerCase();if(r.length===0)continue;if(!a(r))return;let i=t[r];n[r]=Array.isArray(i)?i.slice():i??null}return n}function O(e){return E(e)||D(e,{})===void 0}function k(e){return e.length<=2?!1:e[0]===`"`&&e[e.length-1]===`"`?!(e[1]===`"`||e.startsWith(`"W/`)):e.startsWith(`W/"`)&&e[e.length-1]===`"`?e.length!==4:!1}function A(e,t=`CacheStore`){if(typeof e!=`object`||!e)throw TypeError(`expected type of ${t} to be a CacheStore, got ${e===null?`null`:typeof e}`);for(let n of[`get`,`createWriteStream`,`delete`])if(typeof e[n]!=`function`)throw TypeError(`${t} needs to have a \`${n}()\` function`)}function j(e,t=`CacheMethods`){if(!Array.isArray(e))throw TypeError(`expected type of ${t} needs to be an array, got ${e===null?`null`:typeof e}`);if(e.length===0)throw TypeError(`${t} needs to have at least one method`);for(let r of e)if(!u(n,r))throw TypeError(`element of ${t}-array needs to be one of following values: ${n.join(`, `)}, got ${r}`)}function M(e,t){let n={};if(e.headers){let r=Object.keys(e.headers).sort();for(let i of r)t?.has(i.toLowerCase())||(n[i]=e.headers[i])}return JSON.stringify([e.origin,e.method,e.path,n])}t.exports={makeCacheKey:v,normalizeHeaders:b,assertCacheKey:x,assertCacheValue:S,parseCacheControlHeader:C,hasInvalidCacheControlDirective:g,parseVaryHeader:D,hasVaryStar:E,isInvalidOrWildcardVaryHeader:O,isEtagUsable:k,assertCacheMethods:j,assertCacheStore:A,makeDeduplicationKey:M}})),He=t(((e,t)=>{function n(e){switch(e[3]){case`,`:return i(e);case` `:return a(e);default:return o(e)}}function r(e,t,n,r,i,a,o){let s=new Date(Date.UTC(e,t,n,r,i,a));return e>=0&&e<=99&&s.setUTCFullYear(e),s.getUTCFullYear()===e&&s.getUTCMonth()===t&&s.getUTCDate()===n&&s.getUTCHours()===r&&s.getUTCMinutes()===i&&s.getUTCSeconds()===a&&s.getUTCDay()===o?s:void 0}function i(e){if(e.length!==29||e[4]!==` `||e[7]!==` `||e[11]!==` `||e[16]!==` `||e[19]!==`:`||e[22]!==`:`||e[25]!==` `||e[26]!==`G`||e[27]!==`M`||e[28]!==`T`)return;let t=-1;if(e[0]===`S`&&e[1]===`u`&&e[2]===`n`)t=0;else if(e[0]===`M`&&e[1]===`o`&&e[2]===`n`)t=1;else if(e[0]===`T`&&e[1]===`u`&&e[2]===`e`)t=2;else if(e[0]===`W`&&e[1]===`e`&&e[2]===`d`)t=3;else if(e[0]===`T`&&e[1]===`h`&&e[2]===`u`)t=4;else if(e[0]===`F`&&e[1]===`r`&&e[2]===`i`)t=5;else if(e[0]===`S`&&e[1]===`a`&&e[2]===`t`)t=6;else return;let n=0;if(e[5]===`0`){let t=e.charCodeAt(6);if(t<49||t>57)return;n=t-48}else{let t=e.charCodeAt(5);if(t<49||t>51)return;let r=e.charCodeAt(6);if(r<48||r>57)return;n=(t-48)*10+(r-48)}let i=-1;if(e[8]===`J`&&e[9]===`a`&&e[10]===`n`)i=0;else if(e[8]===`F`&&e[9]===`e`&&e[10]===`b`)i=1;else if(e[8]===`M`&&e[9]===`a`){if(e[10]===`r`)i=2;else if(e[10]===`y`)i=4;else return}else if(e[8]===`J`){if(e[9]===`a`&&e[10]===`n`)i=0;else if(e[9]===`u`){if(e[10]===`n`)i=5;else if(e[10]===`l`)i=6;else return}else return}else if(e[8]===`A`){if(e[9]===`p`&&e[10]===`r`)i=3;else if(e[9]===`u`&&e[10]===`g`)i=7;else return}else if(e[8]===`S`&&e[9]===`e`&&e[10]===`p`)i=8;else if(e[8]===`O`&&e[9]===`c`&&e[10]===`t`)i=9;else if(e[8]===`N`&&e[9]===`o`&&e[10]===`v`)i=10;else if(e[8]===`D`&&e[9]===`e`&&e[10]===`c`)i=11;else return;let a=e.charCodeAt(12);if(a<48||a>57)return;let o=e.charCodeAt(13);if(o<48||o>57)return;let s=e.charCodeAt(14);if(s<48||s>57)return;let c=e.charCodeAt(15);if(c<48||c>57)return;let l=(a-48)*1e3+(o-48)*100+(s-48)*10+(c-48),u=0;if(e[17]===`0`){let t=e.charCodeAt(18);if(t<48||t>57)return;u=t-48}else{let t=e.charCodeAt(17);if(t<48||t>50)return;let n=e.charCodeAt(18);if(n<48||n>57||t===50&&n>51)return;u=(t-48)*10+(n-48)}let d=0;if(e[20]===`0`){let t=e.charCodeAt(21);if(t<48||t>57)return;d=t-48}else{let t=e.charCodeAt(20);if(t<48||t>53)return;let n=e.charCodeAt(21);if(n<48||n>57)return;d=(t-48)*10+(n-48)}let f=0;if(e[23]===`0`){let t=e.charCodeAt(24);if(t<48||t>57)return;f=t-48}else{let t=e.charCodeAt(23);if(t<48||t>53)return;let n=e.charCodeAt(24);if(n<48||n>57)return;f=(t-48)*10+(n-48)}return r(l,i,n,u,d,f,t)}function a(e){if(e.length!==24||e[7]!==` `||e[10]!==` `||e[19]!==` `)return;let t=-1;if(e[0]===`S`&&e[1]===`u`&&e[2]===`n`)t=0;else if(e[0]===`M`&&e[1]===`o`&&e[2]===`n`)t=1;else if(e[0]===`T`&&e[1]===`u`&&e[2]===`e`)t=2;else if(e[0]===`W`&&e[1]===`e`&&e[2]===`d`)t=3;else if(e[0]===`T`&&e[1]===`h`&&e[2]===`u`)t=4;else if(e[0]===`F`&&e[1]===`r`&&e[2]===`i`)t=5;else if(e[0]===`S`&&e[1]===`a`&&e[2]===`t`)t=6;else return;let n=-1;if(e[4]===`J`&&e[5]===`a`&&e[6]===`n`)n=0;else if(e[4]===`F`&&e[5]===`e`&&e[6]===`b`)n=1;else if(e[4]===`M`&&e[5]===`a`){if(e[6]===`r`)n=2;else if(e[6]===`y`)n=4;else return}else if(e[4]===`J`){if(e[5]===`a`&&e[6]===`n`)n=0;else if(e[5]===`u`){if(e[6]===`n`)n=5;else if(e[6]===`l`)n=6;else return}else return}else if(e[4]===`A`){if(e[5]===`p`&&e[6]===`r`)n=3;else if(e[5]===`u`&&e[6]===`g`)n=7;else return}else if(e[4]===`S`&&e[5]===`e`&&e[6]===`p`)n=8;else if(e[4]===`O`&&e[5]===`c`&&e[6]===`t`)n=9;else if(e[4]===`N`&&e[5]===`o`&&e[6]===`v`)n=10;else if(e[4]===`D`&&e[5]===`e`&&e[6]===`c`)n=11;else return;let i=0;if(e[8]===` `){let t=e.charCodeAt(9);if(t<49||t>57)return;i=t-48}else{let t=e.charCodeAt(8);if(t<49||t>51)return;let n=e.charCodeAt(9);if(n<48||n>57)return;i=(t-48)*10+(n-48)}let a=0;if(e[11]===`0`){let t=e.charCodeAt(12);if(t<48||t>57)return;a=t-48}else{let t=e.charCodeAt(11);if(t<48||t>50)return;let n=e.charCodeAt(12);if(n<48||n>57||t===50&&n>51)return;a=(t-48)*10+(n-48)}let o=0;if(e[14]===`0`){let t=e.charCodeAt(15);if(t<48||t>57)return;o=t-48}else{let t=e.charCodeAt(14);if(t<48||t>53)return;let n=e.charCodeAt(15);if(n<48||n>57)return;o=(t-48)*10+(n-48)}let s=0;if(e[17]===`0`){let t=e.charCodeAt(18);if(t<48||t>57)return;s=t-48}else{let t=e.charCodeAt(17);if(t<48||t>53)return;let n=e.charCodeAt(18);if(n<48||n>57)return;s=(t-48)*10+(n-48)}let c=e.charCodeAt(20);if(c<48||c>57)return;let l=e.charCodeAt(21);if(l<48||l>57)return;let u=e.charCodeAt(22);if(u<48||u>57)return;let d=e.charCodeAt(23);if(!(d<48||d>57))return r((c-48)*1e3+(l-48)*100+(u-48)*10+(d-48),n,i,a,o,s,t)}function o(e){let t=-1,n=-1;if(e[0]===`S`)e[1]===`u`&&e[2]===`n`&&e[3]===`d`&&e[4]===`a`&&e[5]===`y`?(n=0,t=6):e[1]===`a`&&e[2]===`t`&&e[3]===`u`&&e[4]===`r`&&e[5]===`d`&&e[6]===`a`&&e[7]===`y`&&(n=6,t=8);else if(e[0]===`M`&&e[1]===`o`&&e[2]===`n`&&e[3]===`d`&&e[4]===`a`&&e[5]===`y`)n=1,t=6;else if(e[0]===`T`)e[1]===`u`&&e[2]===`e`&&e[3]===`s`&&e[4]===`d`&&e[5]===`a`&&e[6]===`y`?(n=2,t=7):e[1]===`h`&&e[2]===`u`&&e[3]===`r`&&e[4]===`s`&&e[5]===`d`&&e[6]===`a`&&e[7]===`y`&&(n=4,t=8);else if(e[0]===`W`&&e[1]===`e`&&e[2]===`d`&&e[3]===`n`&&e[4]===`e`&&e[5]===`s`&&e[6]===`d`&&e[7]===`a`&&e[8]===`y`)n=3,t=9;else if(e[0]===`F`&&e[1]===`r`&&e[2]===`i`&&e[3]===`d`&&e[4]===`a`&&e[5]===`y`)n=5,t=6;else return;if(e[t]!==`,`||e.length-t-1!=23||e[t+1]!==` `||e[t+4]!==`-`||e[t+8]!==`-`||e[t+11]!==` `||e[t+14]!==`:`||e[t+17]!==`:`||e[t+20]!==` `||e[t+21]!==`G`||e[t+22]!==`M`||e[t+23]!==`T`)return;let i=0;if(e[t+2]===`0`){let n=e.charCodeAt(t+3);if(n<49||n>57)return;i=n-48}else{let n=e.charCodeAt(t+2);if(n<49||n>51)return;let r=e.charCodeAt(t+3);if(r<48||r>57)return;i=(n-48)*10+(r-48)}let a=-1;if(e[t+5]===`J`&&e[t+6]===`a`&&e[t+7]===`n`)a=0;else if(e[t+5]===`F`&&e[t+6]===`e`&&e[t+7]===`b`)a=1;else if(e[t+5]===`M`&&e[t+6]===`a`&&e[t+7]===`r`)a=2;else if(e[t+5]===`A`&&e[t+6]===`p`&&e[t+7]===`r`)a=3;else if(e[t+5]===`M`&&e[t+6]===`a`&&e[t+7]===`y`)a=4;else if(e[t+5]===`J`&&e[t+6]===`u`&&e[t+7]===`n`)a=5;else if(e[t+5]===`J`&&e[t+6]===`u`&&e[t+7]===`l`)a=6;else if(e[t+5]===`A`&&e[t+6]===`u`&&e[t+7]===`g`)a=7;else if(e[t+5]===`S`&&e[t+6]===`e`&&e[t+7]===`p`)a=8;else if(e[t+5]===`O`&&e[t+6]===`c`&&e[t+7]===`t`)a=9;else if(e[t+5]===`N`&&e[t+6]===`o`&&e[t+7]===`v`)a=10;else if(e[t+5]===`D`&&e[t+6]===`e`&&e[t+7]===`c`)a=11;else return;let o=e.charCodeAt(t+9);if(o<48||o>57)return;let s=e.charCodeAt(t+10);if(s<48||s>57)return;let c=(o-48)*10+(s-48);c+=c<70?2e3:1900;let l=0;if(e[t+12]===`0`){let n=e.charCodeAt(t+13);if(n<48||n>57)return;l=n-48}else{let n=e.charCodeAt(t+12);if(n<48||n>50)return;let r=e.charCodeAt(t+13);if(r<48||r>57||n===50&&r>51)return;l=(n-48)*10+(r-48)}let u=0;if(e[t+15]===`0`){let n=e.charCodeAt(t+16);if(n<48||n>57)return;u=n-48}else{let n=e.charCodeAt(t+15);if(n<48||n>53)return;let r=e.charCodeAt(t+16);if(r<48||r>57)return;u=(n-48)*10+(r-48)}let d=0;if(e[t+18]===`0`){let n=e.charCodeAt(t+19);if(n<48||n>57)return;d=n-48}else{let n=e.charCodeAt(t+18);if(n<48||n>53)return;let r=e.charCodeAt(t+19);if(r<48||r>57)return;d=(n-48)*10+(r-48)}return r(c,a,i,l,u,d,n)}t.exports={parseHttpDate:n}})),Ue=t(((e,t)=>{let n=T(),{parseCacheControlHeader:r,hasInvalidCacheControlDirective:i,parseVaryHeader:a,hasVaryStar:o,isInvalidOrWildcardVaryHeader:s,isEtagUsable:c}=Ve(),{parseHttpDate:l}=He();function u(){}let d=[200,203,204,206,300,301,308,404,405,410,414,501],f=[206],p=2147483647e3;function m(e){return e.replace(/^[\t ]+|[\t ]+$/g,``)}function h(e,t){for(let n=0;n<e.length;n++)if(e[n]===t)return!0;return!1}function g(e,t){let n=Array.isArray(t)?t:[t];for(let t=0;t<n.length;t++){let r=n[t].split(`,`);for(let t=0;t<r.length;t++)e.push(m(r[t]).toLowerCase())}}function _(e,t){if(typeof t!=`string`)return;let n,r,i;try{n=new URL(e.origin),r=new URL(e.path,n),i=new URL(t,r)}catch{return}if(i.origin===n.origin)return i.pathname+i.search}function v(e,t,r){S(e,{...t,path:r});for(let i=0;i<n.safeHTTPMethods.length;i++){let a=n.safeHTTPMethods[i];a!==t.method&&S(e,{...t,method:a,path:r})}}function y(e,t,n){if(n===void 0)return;let r=Array.isArray(n)?n:[n];for(let n=0;n<r.length;n++){let i=_(t,r[n]);i!==void 0&&v(e,t,i)}}function b(e,t,n){v(e,t,t.path),y(e,t,n.location),y(e,t,n[`content-location`])}var x=class{#e;#t;#n;#r;#i;#a;constructor({store:e,type:t,cacheByDefault:n},r,i){this.#r=e,this.#t=t,this.#n=n,this.#e=r,this.#i=i}onRequestStart(e,t){this.#a?.destroy(),this.#a=void 0,this.#i.onRequestStart?.(e,t)}onRequestUpgrade(e,t,n,r){this.#i.onRequestUpgrade?.(e,t,n,r)}onResponseStart(e,t,i,o){let l=()=>this.#i.onResponseStart?.(e,t,i,o),u=this;if(!h(n.safeHTTPMethods,this.#e.method)&&t>=200&&t<=399)return b(this.#r,this.#e,i),l();let f=i[`cache-control`],m=i[`last-modified`]&&h(d,t);if(!f&&!i.expires&&!m&&!this.#n)return t===304&&i.vary&&s(i.vary)&&S(this.#r,this.#e),l();let g=f?r(f):{};if(!E(this.#t,t,i,g,this.#e.headers))return t===304&&(f||w(this.#t,i,g))&&S(this.#r,this.#e),l();let _=Date.now(),v=Object.hasOwn(i,`age`)?O(i.age):void 0;if(v!==void 0&&v>=p)return C(t,this.#r,this.#e),l();let y=Object.hasOwn(i,`date`)?D(i.date):void 0;if(y===null)return C(t,this.#r,this.#e),l();let x=y?Math.max(0,_-y.getTime()):0,T=Math.max(x,v??0),M=k(this.#t,_,v,i,y,g)??this.#n;if(M===void 0||T>=M)return(f||M!==void 0)&&C(t,this.#r,this.#e),l();let N=_-T,P=M+N;if(_>=P)return C(t,this.#r,this.#e),l();let F;if(this.#e.headers&&i.vary&&(F=a(i.vary,this.#e.headers),!F))return l();let I=N,ee=A(N,_,g,P),L=j(i,g),R={statusCode:t,statusMessage:o,headers:L,vary:F,cacheControlDirectives:g,cachedAt:I,staleAt:P,deleteAt:ee};if(t===304){let t=t=>{if(!t)return l();if(R.statusCode=t.statusCode,R.statusMessage=t.statusMessage,R.etag=t.etag,R.vary=F??t.vary,R.headers={...t.headers,...L},l(),this.#a=this.#r.createWriteStream(this.#e,R),this.#a&&t?.body){if(typeof t.body.values==`function`){let n=t.body.values(),r=()=>{for(let t of n){let n=this.#a.write(t)===!1;if(this.#i.onResponseData?.(e,t),n)break}};this.#a.on(`error`,function(){u.#a=void 0,u.#r.delete(u.#e)}).on(`drain`,()=>{r()}).on(`close`,function(){u.#a===this&&(u.#a=void 0)}),r()}else typeof t.body.on==`function`&&(t.body.on(`data`,t=>{this.#a.write(t),this.#i.onResponseData?.(e,t)}).on(`end`,()=>{this.#a.end()}).on(`error`,()=>{this.#a=void 0,this.#r.delete(this.#e)}),this.#a.on(`error`,function(){u.#a=void 0,u.#r.delete(u.#e)}).on(`close`,function(){u.#a===this&&(u.#a=void 0)}))}},n=this.#r.get(this.#e);n&&typeof n.then==`function`?n.then(t):t(n)}else{if(typeof i.etag==`string`&&c(i.etag)&&(R.etag=i.etag),this.#a=this.#r.createWriteStream(this.#e,R),!this.#a)return l();this.#a.on(`drain`,()=>e.resume()).on(`error`,function(){u.#a=void 0,u.#r.delete(u.#e)}).on(`close`,function(){u.#a===this&&(u.#a=void 0),e.resume()}),l()}}onResponseData(e,t){this.#a?.write(t)===!1&&e.pause(),this.#i.onResponseData?.(e,t)}onResponseEnd(e,t){this.#a?.end(),this.#i.onResponseEnd?.(e,t)}onResponseError(e,t){this.#a?.destroy(t),this.#a=void 0,this.#i.onResponseError?.(e,t)}};function S(e,t){try{e.delete(t)?.catch?.(u)}catch{}}function C(e,t,n){e===304&&S(t,n)}function w(e,t,n){return n[`no-store`]===!0||e===`shared`&&n.private===!0||(t.vary?s(t.vary):!1)}function E(e,t,n,r,i){return!(t<200||h(f,t)||!h(d,t)&&!n.expires&&!r.public&&r[`max-age`]===void 0&&!(r.private&&e===`private`)&&(r[`s-maxage`]===void 0||e!==`shared`)||r[`no-store`]||e===`shared`&&r.private===!0||n.vary&&o(n.vary)||i!=null&&Object.hasOwn(i,`authorization`)&&(!r.public&&!r[`s-maxage`]&&!r[`must-revalidate`]||typeof i.authorization!=`string`||Array.isArray(r[`no-cache`])&&h(r[`no-cache`],`authorization`)||Array.isArray(r.private)&&h(r.private,`authorization`)))}function D(e){let t=e;if(Array.isArray(t)){if(t.length!==1)return null;t=t[0]}return typeof t==`string`?l(t):null}function O(e){let t=e;if(Array.isArray(t)){if(t.length!==1)return p;t=t[0]}if(typeof t!=`string`||!/^[\t ]*[0-9]+[\t ]*$/.test(t))return p;let n=BigInt(t.replace(/^[\t ]+|[\t ]+$/g,``));return n>=BigInt(p/1e3)?p:Number(n)*1e3}function k(e,t,n,r,a,o){if(e===`shared`){if(i(o,`s-maxage`))return 0;let e=o[`s-maxage`];if(e!==void 0)return e*1e3}if(i(o,`max-age`))return 0;let s=o[`max-age`];if(s!==void 0)return s*1e3;if(Object.hasOwn(r,`expires`)){if(typeof r.expires!=`string`)return 0;let e=l(r.expires);if(!e||t>=e.getTime())return 0;if(a){if(a>=e)return 0;let t=e.getTime()-a.getTime();return n!==void 0&&n>=t?0:t}return e.getTime()-t}if(typeof r[`last-modified`]==`string`){let e=l(r[`last-modified`]);if(e)return e.getTime()>=t?void 0:(t-e.getTime())*.1}if(o.immutable)return 31536e6}function A(e,t,n,r){let i=-1/0,a=-1/0,o=-1/0;if(n[`stale-while-revalidate`]&&(i=r+n[`stale-while-revalidate`]*1e3),n[`stale-if-error`]&&(a=r+n[`stale-if-error`]*1e3),n.immutable&&i===-1/0&&a===-1/0&&(o=t+31536e6),i===-1/0&&a===-1/0&&o===-1/0){let n=r-e,i=Math.min(Math.max(t-e,0),1e3);return r+n+i}return Math.max(r,i,a,o)}function j(e,t){let n=[`connection`,`proxy-authenticate`,`proxy-authentication-info`,`proxy-authorization`,`proxy-connection`,`te`,`transfer-encoding`,`upgrade`,`age`];e.connection&&g(n,e.connection),Array.isArray(t[`no-cache`])&&n.push(...t[`no-cache`]),Array.isArray(t.private)&&n.push(...t.private);let r;for(let t of n)Object.hasOwn(e,t)&&(r??={...e},delete r[t]);return r??e}t.exports=x})),We=t(((t,n)=>{let{Writable:r}=e(`node:stream`),{EventEmitter:i}=e(`node:events`),{assertCacheKey:a,assertCacheValue:o}=Ve();var s=class extends i{#e=1024;#t=104857600;#n=5242880;#r=0;#i=0;#a=new Map;#o=!1;constructor(e){if(super(),e){if(typeof e!=`object`)throw TypeError(`MemoryCacheStore options must be an object`);if(e.maxCount!==void 0){if(typeof e.maxCount!=`number`||!Number.isInteger(e.maxCount)||e.maxCount<0)throw TypeError(`MemoryCacheStore options.maxCount must be a non-negative integer`);this.#e=e.maxCount}if(e.maxSize!==void 0){if(typeof e.maxSize!=`number`||!Number.isInteger(e.maxSize)||e.maxSize<0)throw TypeError(`MemoryCacheStore options.maxSize must be a non-negative integer`);this.#t=e.maxSize}if(e.maxEntrySize!==void 0){if(typeof e.maxEntrySize!=`number`||!Number.isInteger(e.maxEntrySize)||e.maxEntrySize<0)throw TypeError(`MemoryCacheStore options.maxEntrySize must be a non-negative integer`);this.#n=e.maxEntrySize}}}get size(){return this.#r}isFull(){return this.#r>=this.#t||this.#i>=this.#e}get(e){a(e);let t=`${e.origin}:${e.path}`,n=Date.now(),r=this.#a.get(t),i=r?c(e,r,n):null;return i==null?void 0:{statusMessage:i.statusMessage,statusCode:i.statusCode,headers:i.headers,body:i.body,vary:i.vary?i.vary:void 0,etag:i.etag,cacheControlDirectives:i.cacheControlDirectives,cachedAt:i.cachedAt,staleAt:i.staleAt,deleteAt:i.deleteAt}}createWriteStream(e,t){a(e),o(t);let n=`${e.origin}:${e.path}`,i=this,s={...e,...t,body:[],size:0};return new r({write(e,t,n){typeof e==`string`&&(e=Buffer.from(e,t)),s.size+=e.byteLength,s.size>=i.#n?this.destroy():s.body.push(e),n(null)},final(t){let r=i.#a.get(n);r||(r=[],i.#a.set(n,r));let a=c(e,r,Date.now());if(a){let e=r.indexOf(a);r.splice(e,1,s),i.#r-=a.size}else r.push(s),i.#i+=1;if(i.#r+=s.size,i.#r>i.#t||i.#i>i.#e){i.#o||=(i.emit(`maxSizeExceeded`,{size:i.#r,maxSize:i.#t,count:i.#i,maxCount:i.#e}),!0);for(let[e,t]of i.#a){for(let e of t.splice(0,t.length/2))i.#r-=e.size,--i.#i;t.length===0&&i.#a.delete(e)}i.#r<i.#t&&i.#i<i.#e&&(i.#o=!1)}t(null)}})}delete(e){if(typeof e!=`object`)throw TypeError(`expected key to be object, got ${typeof e}`);let t=`${e.origin}:${e.path}`;for(let e of this.#a.get(t)??[])this.#r-=e.size,--this.#i;this.#a.delete(t)}};function c(e,t,n){for(let r=0;r<t.length;r++){let i=t[r];if(i.deleteAt>n&&i.method===e.method&&l(e,i))return i}}function l(e,t){if(t.vary==null)return!0;for(let n in t.vary)if(Object.hasOwn(t.vary,n)&&!u(e.headers?.[n],t.vary[n]))return!1;return!0}function u(e,t){if(e==null&&t==null)return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}n.exports=s})),Ge=t(((t,n)=>{let r=e(`node:assert`);n.exports=class{#e=!1;#t;#n;#r;#i;constructor(e,t,n){if(typeof e!=`function`)throw TypeError(`callback must be a function`);this.#t=e,this.#n=t,this.#i=n}onRequestStart(e,t){this.#e=!1,this.#r=t}onRequestUpgrade(e,t,n,r){this.#n.onRequestUpgrade?.(e,t,n,r)}onResponseStart(e,t,n,i){if(r(this.#t!=null),this.#e=t===304||this.#i&&t>=500&&t<=504,this.#t(this.#e,this.#r,t,n),this.#t=null,this.#e)return!0;this.#n.onRequestStart?.(e,this.#r),this.#n.onResponseStart?.(e,t,n,i)}onResponseData(e,t){if(!this.#e)return this.#n.onResponseData?.(e,t)}onResponseEnd(e,t){this.#e||this.#n.onResponseEnd?.(e,t)}onResponseError(e,t){if(!this.#e){if(this.#t&&=(this.#t(!1),null),typeof this.#n.onResponseError==`function`)this.#n.onResponseError(e,t);else throw t}}}})),Ke=t(((t,n)=>{let r=e(`node:assert`),{Readable:i}=e(`node:stream`),a=T(),o=Ue(),s=We(),c=Ge(),{assertCacheStore:l,assertCacheMethods:u,makeCacheKey:d,normalizeHeaders:f,parseCacheControlHeader:p,isInvalidOrWildcardVaryHeader:m}=Ve(),{AbortError:h}=S(),{parseHttpDate:g}=He();function _(e,t){if(e!==void 0){if(!Array.isArray(e))throw TypeError(`expected ${t} to be an array or undefined, got ${typeof e}`);for(let n=0;n<e.length;n++){let r=e[n];if(typeof r!=`string`&&!(r instanceof RegExp))throw TypeError(`expected ${t}[${n}] to be a string or RegExp, got ${typeof r}`)}}}let v=()=>{};function y(e){return e.replace(/^[\t ]+|[\t ]+$/g,``)}function b(e,t){for(let n=0;n<e.length;n++)if(e[n]===t)return!0;return!1}function x(e){let t=e?.pragma;if(!t)return!1;let n=Array.isArray(t)?t:[t];for(let e=0;e<n.length;e++){let t=n[e];if(typeof t!=`string`)continue;let r=t.split(`,`);for(let e=0;e<r.length;e++)if(y(r[e]).toLowerCase()===`no-cache`)return!0}return!1}function C(e,t,{headers:n={}}){return!!(t?.[`no-cache`]||e.cacheControlDirectives?.[`no-cache`]&&!Array.isArray(e.cacheControlDirectives[`no-cache`])||n[`if-modified-since`]||n[`if-none-match`])}function w(e,t){return e.cacheControlDirectives?.[`must-revalidate`]===!0||t===`shared`&&(e.cacheControlDirectives?.[`proxy-revalidate`]===!0||e.cacheControlDirectives?.[`s-maxage`]!==void 0)}function E(e,t){if(t.vary&&m(t.vary))return!0;let n=t[`cache-control`];if(!n)return!1;let r=p(n);return r[`no-store`]===!0||e===`shared`&&r.private===!0}function D(e){return e[`cache-control`]!==void 0}function O(e,t){try{e.delete(t)?.catch?.(v)}catch{}}function k(e){let t=e?.[`last-modified`];if(typeof t==`string`&&g(t))return t}function A(e,t){let n={...e.headers,"if-modified-since":k(t.headers)??new Date(t.cachedAt).toUTCString()};if(t.etag&&(n[`if-none-match`]=t.etag),t.vary)for(let e in t.vary)t.vary[e]!=null&&(n[e]=t.vary[e]);return n}function j(e,t,n){let r=Date.now();return r>e.staleAt?!w(e,n)&&t?.[`max-stale`]?r>e.staleAt+t[`max-stale`]*1e3:!0:t?.[`min-fresh`]?e.staleAt-r<=t[`min-fresh`]*1e3:!1}function M(e,t){let n=e.cacheControlDirectives?.[`stale-while-revalidate`];return!n||w(e,t)?!1:Date.now()<=e.staleAt+n*1e3}function N(e,t,n,r,i,a){if(a?.[`only-if-cached`]){let e=!1;try{if(typeof r.onConnect==`function`&&(r.onConnect(()=>{e=!0}),e)||typeof r.onHeaders==`function`&&(r.onHeaders(504,[],v,`Gateway Timeout`),e))return;typeof r.onComplete==`function`&&r.onComplete([])}catch(e){typeof r.onError==`function`&&r.onError(e)}return!0}return e(i,new o(t,n,r))}function P(e,t,n,o,s,c){let l=a.isStream(n.body)?n.body:i.from(n.body??[]);r(!l.destroyed,`stream should not be destroyed`),r(!l.readableDidRead,`stream should not be readableDidRead`);let u={resume(){l.resume()},pause(){l.pause()},get paused(){return l.isPaused()},get aborted(){return l.destroyed},get reason(){return l.errored},abort(e){l.destroy(e??new h)}};if(l.on(`error`,function(t){if(!this.readableEnded){if(typeof e.onResponseError==`function`)e.onResponseError(u,t);else throw t}}).on(`close`,function(){this.errored||e.onResponseEnd?.(u,{})}),e.onRequestStart?.(u,s),l.destroyed)return;let d={...n.headers,age:String(o)};c&&(d.warning=`110 - "response is stale"`),e.onResponseStart?.(u,n.statusCode,d,n.statusMessage),t.method===`HEAD`?l.destroy():l.on(`data`,function(t){e.onResponseData?.(u,t)})}function F(e,t,n,r,i,s,l){if(!l)return N(e,t,n,r,i,s);let u=Date.now();if(u>l.deleteAt)return e(i,new o(t,n,r));let d=Math.round((u-l.cachedAt)/1e3),f=s?.[`max-age`]!==void 0&&d>=s[`max-age`],p=f||j(l,s,t.type),m=f||C(l,s,i);if(p||m){if(a.isStream(i.body)&&a.bodyLength(i.body)!==0)return e(i,new o(t,n,r));if(!m&&M(l,t.type))return P(r,i,l,d,null,!0),queueMicrotask(()=>{let r=A(i,l);e({...i,headers:r},new o(t,n,{onRequestStart(){},onRequestUpgrade(){},onResponseStart(){},onResponseData(){},onResponseEnd(){},onResponseError(){}}))}),!0;let f=!1;if(!w(l,t.type)){let e=l.cacheControlDirectives[`stale-if-error`]??s?.[`stale-if-error`];e&&(f=u<l.staleAt+e*1e3)}let h=A(i,l);return e({...i,headers:h},new c((s,c,u,f)=>{if(s){if(u===304){if(E(t.type,f))return a.isStream(l.body)&&l.body.on(`error`,v).destroy(),O(t.store,n),e(i,new o(t,n,r));D(f)&&O(t.store,n)}P(r,i,l,d,c,p)}else a.isStream(l.body)&&l.body.on(`error`,v).destroy()},new o(t,n,r),f))}a.isStream(i.body)&&i.body.on(`error`,v).destroy(),P(r,i,l,d,null,!1)}n.exports=(e={})=>{let{store:t=new s,methods:n=[`GET`],cacheByDefault:r=void 0,type:i=`shared`,origins:o=void 0}=e;if(typeof e!=`object`||!e)throw TypeError(`expected type of opts to be an Object, got ${e===null?`null`:typeof e}`);if(l(t,`opts.store`),u(n,`opts.methods`),_(o,`opts.origins`),r!==void 0&&typeof r!=`number`)throw TypeError(`expected opts.cacheByDefault to be number or undefined, got ${typeof r}`);if(i!==void 0&&i!==`shared`&&i!==`private`)throw TypeError(`expected opts.type to be shared, private, or undefined, got ${typeof i}`);let c={store:t,methods:n,cacheByDefault:r,type:i},m=[];for(let e=0;e<a.safeHTTPMethods.length;e++){let t=a.safeHTTPMethods[e];b(n,t)||m.push(t)}return e=>(n,r)=>{if(!n.origin||b(m,n.method))return e(n,r);if(o!==void 0){let t=n.origin.toString().toLowerCase(),i=!1;for(let e=0;e<o.length;e++){let n=o[e];if(typeof n==`string`){if(n.toLowerCase()===t){i=!0;break}}else if(n.test(t)){i=!0;break}}if(!i)return e(n,r)}n={...n,headers:f(n)};let i=n.headers?.[`cache-control`]?p(n.headers[`cache-control`]):x(n.headers)?{"no-cache":!0}:void 0;if(i?.[`no-store`])return e(n,r);let a=d(n),s=t.get(a);return s&&typeof s.then==`function`?s.then(t=>F(e,c,a,r,n,i,t)):F(e,c,a,r,n,i,s)}}})),qe=t(((t,n)=>{let{createInflate:r,createGunzip:i,createBrotliDecompress:a,createZstdDecompress:o}=e(`node:zlib`),{pipeline:s}=e(`node:stream`),c=Pe(),{runtimeFeatures:l}=H(),u={gzip:i,"x-gzip":i,br:a,deflate:r,compress:r,"x-compress":r,...l.has(`zstd`)?{zstd:o}:{}},d=[204,304],f=!1;var p=class extends c{#e=[];#t;#n;constructor(e,{skipStatusCodes:t=d,skipErrorResponses:n=!0}={}){super(e),this.#t=t,this.#n=n}#r(e,t){return!!(!e||t<200||this.#t.includes(t)||this.#n&&t>=400)}#i(e){let t=e.split(`,`);if(t.length>5)throw Error(`too many content-encodings in response: ${t.length}, maximum allowed is 5`);let n=[];for(let e=t.length-1;e>=0;e--){let r=t[e].trim();if(r){if(!u[r])return n.length=0,n;n.push(u[r]())}}return n}#a(e,t){e.on(`readable`,()=>{let n;for(;(n=e.read())!==null&&super.onResponseData(t,n)!==!1;);}),e.on(`error`,e=>{super.onResponseError(t,e)})}#o(e){let t=this.#e[0];this.#a(t,e),t.on(`end`,()=>{super.onResponseEnd(e,{})})}#s(e){let t=this.#e[this.#e.length-1];this.#a(t,e),s(this.#e,t=>{if(t){super.onResponseError(e,t);return}super.onResponseEnd(e,{})})}#c(){this.#e.length=0}onResponseStart(e,t,n,r){let i=n[`content-encoding`];if(this.#r(i,t))return super.onResponseStart(e,t,n,r);let a=this.#i(i.toLowerCase());if(a.length===0)return this.#c(),super.onResponseStart(e,t,n,r);this.#e=a;let{"content-encoding":o,"content-length":s,...c}=n;return this.#e.length===1?this.#o(e):this.#s(e),super.onResponseStart(e,t,c,r)}onResponseData(e,t){if(this.#e.length>0){this.#e[0].write(t);return}super.onResponseData(e,t)}onResponseEnd(e,t){if(this.#e.length>0){this.#e[0].end(),this.#c();return}super.onResponseEnd(e,t)}onResponseError(e,t){if(this.#e.length>0){for(let e of this.#e)e.destroy(t);this.#c()}super.onResponseError(e,t)}};function m(e={}){return f||=(process.emitWarning(`DecompressInterceptor is experimental and subject to change`,`ExperimentalWarning`),!0),t=>(n,r)=>t(n,new p(r,e))}n.exports=m})),Je=t(((e,t)=>{let{RequestAbortedError:n}=S(),r=5242880;t.exports=class{#e;#t=[];#n=r;#r=0;#i={};#a=``;#o=!1;#s=!1;#c=!1;#l=!1;#u=null;#d=null;constructor(e,t,n=r){this.#e=e,this.#d=t,this.#n=n}addWaitingHandler(e){if(this.#l||this.#c)return!1;let t=this.#f(e),n=t.controller;try{if(e.onRequestStart?.(n,null),n.aborted)return t.done=!0,!0;this.#s&&e.onResponseStart?.(n,this.#r,this.#i,this.#a)}catch{return t.done=!0,!0}return n.aborted||this.#t.push(t),!0}onRequestStart(e,t){this.#u=e,this.#e.onRequestStart?.(e,t)}onRequestUpgrade(e,t,n,r){this.#e.onRequestUpgrade?.(e,t,n,r)}onResponseStart(e,t,n,r){this.#s=!0,this.#r=t,this.#i=n,this.#a=r,this.#e.onResponseStart?.(e,t,n,r);for(let e of this.#t){let{handler:i,controller:a}=e;if(e.done||a.aborted){e.done=!0;continue}try{i.onResponseStart?.(a,t,n,r)}catch{}a.aborted&&(e.done=!0)}this.#g()}onResponseData(e,t){if(!(this.#o||this.#l)){this.#c=!0,this.#e.onResponseData?.(e,t);for(let e of this.#t){let{handler:n,controller:r}=e;if(e.done||r.aborted){e.done=!0;continue}if(r.paused){this.#p(e,t);continue}try{n.onResponseData?.(r,t)}catch{}r.aborted&&(e.done=!0,e.bufferedChunks=[],e.bufferedBytes=0)}this.#g()}}onResponseEnd(e,t){if(!(this.#o||this.#l)){this.#l=!0,this.#e.onResponseEnd?.(e,t);for(let e of this.#t){if(e.done||e.controller.aborted){e.done=!0;continue}if(this.#m(e),e.done||e.controller.aborted){e.done=!0;continue}if(e.controller.paused&&e.bufferedChunks.length>0){e.pendingTrailers=t;continue}try{e.handler.onResponseEnd?.(e.controller,t)}catch{}e.done=!0}this.#g(),this.#d?.()}}onResponseError(e,t){if(!this.#l){this.#o=!0,this.#l=!0,this.#e.onResponseError?.(e,t);for(let e of this.#t)this.#h(e,t);this.#t=[],this.#d?.()}}#f(e){let t={handler:e,controller:null,bufferedChunks:[],bufferedBytes:0,pendingTrailers:null,done:!1},n={aborted:!1,paused:!1,reason:null};return t.controller={resume:()=>{if(!n.aborted){if(n.paused=!1,this.#m(t),this.#l&&t.pendingTrailers&&t.bufferedChunks.length===0&&!n.paused&&!n.aborted){try{t.handler.onResponseEnd?.(t.controller,t.pendingTrailers)}catch{}t.pendingTrailers=null,t.done=!0}this.#g()}},pause:()=>{n.aborted||(n.paused=!0)},get paused(){return n.paused},get aborted(){return n.aborted},get reason(){return n.reason},abort:e=>{n.aborted=!0,n.reason=e??null,t.done=!0,t.pendingTrailers=null,t.bufferedChunks=[],t.bufferedBytes=0}},t}#p(e,t){if(e.done||e.controller.aborted){e.done=!0,e.bufferedChunks=[],e.bufferedBytes=0;return}let r=Buffer.from(t);if(e.bufferedChunks.push(r),e.bufferedBytes+=r.length,e.bufferedBytes>this.#n){let t=new n(`Deduplicated waiting handler exceeded maxBufferSize (${this.#n} bytes) while paused`);this.#h(e,t)}}#m(e){let{handler:t,controller:n}=e;for(;!e.done&&!n.aborted&&!n.paused&&e.bufferedChunks.length>0;){let r=e.bufferedChunks.shift();e.bufferedBytes-=r.length;try{t.onResponseData?.(n,r)}catch{}if(n.aborted){e.done=!0,e.pendingTrailers=null,e.bufferedChunks=[],e.bufferedBytes=0;break}}}#h(e,t){if(!e.done){e.done=!0,e.pendingTrailers=null,e.bufferedChunks=[],e.bufferedBytes=0;try{e.controller.abort(t),e.handler.onResponseError?.(e.controller,t)}catch{}}}#g(){this.#t=this.#t.filter(e=>e.done===!1)}}})),Ye=t(((t,n)=>{let r=e(`node:diagnostics_channel`),i=T(),a=Je(),{normalizeHeaders:o,makeCacheKey:s,makeDeduplicationKey:c}=Ve(),l=r.channel(`undici:request:pending-requests`);n.exports=(e={})=>{let{methods:t=[`GET`],skipHeaderNames:n=[],excludeHeaderNames:r=[],maxBufferSize:u=5242880}=e;if(typeof e!=`object`||!e)throw TypeError(`expected type of opts to be an Object, got ${e===null?`null`:typeof e}`);if(!Array.isArray(t))throw TypeError(`expected opts.methods to be an array, got ${typeof t}`);for(let e of t)if(!i.safeHTTPMethods.includes(e))throw TypeError(`expected opts.methods to only contain safe HTTP methods, got ${e}`);if(!Array.isArray(n))throw TypeError(`expected opts.skipHeaderNames to be an array, got ${typeof n}`);if(!Array.isArray(r))throw TypeError(`expected opts.excludeHeaderNames to be an array, got ${typeof r}`);if(!Number.isFinite(u)||u<=0)throw TypeError(`expected opts.maxBufferSize to be a positive finite number, got ${u}`);let d=new Set(n.map(e=>e.toLowerCase())),f=new Set(r.map(e=>e.toLowerCase())),p=new Map;return e=>(n,r)=>{if(!n.origin||t.includes(n.method)===!1)return e(n,r);if(n={...n,headers:o(n)},d.size>0){for(let t of Object.keys(n.headers))if(d.has(t.toLowerCase()))return e(n,r)}let i=s(n),m=c(i,f),h=p.get(m);if(h)return h.addWaitingHandler(r)?!0:e(n,r);let g=new a(r,()=>{p.delete(m),l.hasSubscribers&&l.publish({size:p.size,key:m,type:`removed`})},u);return p.set(m,g),l.hasSubscribers&&l.publish({size:p.size,key:m,type:`added`}),e(n,g)}}})),Xe=t(((t,n)=>{let{Writable:r}=e(`node:stream`),{assertCacheKey:i,assertCacheValue:a}=Ve(),o,s=2e9;n.exports=class{#e=s;#t=1/0;#n;#r;#i;#a;#o;#s;#c;#l;constructor(t){if(t){if(typeof t!=`object`)throw TypeError(`SqliteCacheStore options must be an object`);if(t.maxEntrySize!==void 0){if(typeof t.maxEntrySize!=`number`||!Number.isInteger(t.maxEntrySize)||t.maxEntrySize<0)throw TypeError(`SqliteCacheStore options.maxEntrySize must be a non-negative integer`);if(t.maxEntrySize>s)throw TypeError(`SqliteCacheStore options.maxEntrySize must be less than 2gb`);this.#e=t.maxEntrySize}if(t.maxCount!==void 0){if(typeof t.maxCount!=`number`||!Number.isInteger(t.maxCount)||t.maxCount<0)throw TypeError(`SqliteCacheStore options.maxCount must be a non-negative integer`);this.#t=t.maxCount}}o||=e(`node:sqlite`).DatabaseSync,this.#n=new o(t?.location??`:memory:`),this.#n.exec(`
|
|
11
11
|
PRAGMA journal_mode = WAL;
|
|
12
12
|
PRAGMA synchronous = NORMAL;
|
|
13
13
|
PRAGMA temp_store = memory;
|