eve 0.51.0 → 0.52.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 +46 -0
- package/dist/src/channel/session.d.ts +2 -1
- package/dist/src/channel/session.js +1 -1
- package/dist/src/channel/types.d.ts +4 -1
- package/dist/src/chunks/{use-eve-agent-C3vUG5g2.js → use-eve-agent-3DZuvuWE.js} +17 -6
- package/dist/src/chunks/{use-eve-agent-B4xN7-fK.js → use-eve-agent-D7apPojZ.js} +17 -6
- package/dist/src/cli/agent-command.js +1 -1
- package/dist/src/cli/commands/agent-instructions.d.ts +3 -1
- package/dist/src/cli/commands/agent-instructions.js +1 -1
- package/dist/src/cli/commands/build.js +1 -1
- package/dist/src/cli/commands/deploy.js +1 -1
- package/dist/src/cli/commands/init-agent-workspace.js +1 -1
- package/dist/src/cli/commands/init-repl.js +1 -1
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/integration-connect.js +1 -1
- package/dist/src/cli/commands/link.js +1 -1
- package/dist/src/cli/commands/preconditions.js +1 -1
- package/dist/src/cli/commands/register-project-commands.d.ts +1 -1
- package/dist/src/cli/commands/register-project-commands.js +1 -1
- package/dist/src/cli/commands/registry.js +1 -1
- package/dist/src/cli/dev/boot-progress.d.ts +3 -0
- package/dist/src/cli/dev/boot-progress.js +1 -0
- package/dist/src/cli/dev/environment.js +1 -1
- package/dist/src/cli/dev/run-interactive-ui.js +1 -1
- package/dist/src/cli/dev/tui/prompt-command-handler.js +1 -1
- package/dist/src/cli/dev/tui/setup-commands.d.ts +3 -1
- package/dist/src/cli/dev/tui/setup-commands.js +1 -1
- package/dist/src/cli/run.d.ts +4 -0
- package/dist/src/cli/run.js +3 -3
- package/dist/src/cli/telemetry/command.d.ts +9 -0
- package/dist/src/cli/telemetry/command.js +1 -0
- package/dist/src/cli/telemetry/flush.d.ts +2 -0
- package/dist/src/cli/telemetry/flush.js +1 -0
- package/dist/src/cli/telemetry/identity.d.ts +13 -0
- package/dist/src/cli/telemetry/identity.js +1 -0
- package/dist/src/cli/telemetry/index.d.ts +25 -0
- package/dist/src/cli/telemetry/index.js +3 -0
- package/dist/src/cli/telemetry/preference.d.ts +9 -0
- package/dist/src/cli/telemetry/preference.js +1 -0
- package/dist/src/client/open-stream.js +1 -1
- package/dist/src/client/session-controls.d.ts +3 -0
- package/dist/src/client/session-controls.js +1 -1
- package/dist/src/client/session.d.ts +4 -1
- package/dist/src/client/types.d.ts +3 -2
- package/dist/src/compiled/.vendor-stamp.json +11 -11
- package/dist/src/compiled/@clack/core/LICENSE +9 -0
- package/dist/src/compiled/@clack/core/index.d.ts +363 -0
- package/dist/src/compiled/@clack/core/index.js +20 -0
- package/dist/src/compiled/@eve/catalog/index.js +1 -1
- package/dist/src/compiled/@modelcontextprotocol/server/index.d.ts +1 -0
- package/dist/src/compiled/@vercel/sandbox/api-client/api-client.d.ts +34 -92
- package/dist/src/compiled/@vercel/sandbox/api-client/base-client.d.ts +1 -1
- package/dist/src/compiled/@vercel/sandbox/api-client/index.d.ts +1 -1
- package/dist/src/compiled/@vercel/sandbox/api-client/validators.d.ts +13 -29
- package/dist/src/compiled/@vercel/sandbox/constants.d.ts +11 -1
- package/dist/src/compiled/@vercel/sandbox/index.d.ts +3 -3
- package/dist/src/compiled/@vercel/sandbox/index.js +9 -9
- package/dist/src/compiled/@vercel/sandbox/sandbox-user.d.ts +5 -6
- package/dist/src/compiled/@vercel/sandbox/sandbox.d.ts +79 -67
- package/dist/src/compiled/@vercel/sandbox/session.d.ts +5 -3
- package/dist/src/compiled/@vercel/sandbox/snapshot.d.ts +9 -0
- package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/api-client/api-client.d.ts +86 -1
- package/dist/src/compiled/@vercel/sandbox-drives/api-client/index.d.ts +2 -0
- package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/api-client/validators.d.ts +26 -1
- package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/constants.d.ts +2 -2
- package/dist/src/compiled/@vercel/{sandbox → sandbox-drives}/drive.d.ts +10 -0
- package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/index.d.ts +3 -2
- package/dist/src/compiled/@vercel/sandbox-drives/index.js +9 -0
- package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/sandbox.d.ts +35 -6
- package/dist/src/compiled/@workflow/core/index.js +1 -1
- package/dist/src/compiled/@workflow/core/private.d.ts +2 -4
- package/dist/src/compiled/@workflow/core/private.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime/constants.d.ts +9 -7
- package/dist/src/compiled/@workflow/core/runtime/helpers.d.ts +13 -0
- package/dist/src/compiled/@workflow/core/runtime/suspension-handler.d.ts +54 -1
- package/dist/src/compiled/@workflow/core/runtime.js +3 -3
- package/dist/src/compiled/@workflow/core/serialization/types.d.ts +7 -0
- package/dist/src/compiled/@workflow/core/serialization.d.ts +24 -2
- package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/workflow.js +1 -1
- package/dist/src/compiled/@workflow/errors/error-codes.d.ts +2 -0
- package/dist/src/compiled/@workflow/errors/index.d.ts +19 -0
- package/dist/src/compiled/@workflow/errors/index.js +1 -1
- package/dist/src/compiled/@workflow/world/analytics.d.ts +46 -2
- package/dist/src/compiled/@workflow/world/events.d.ts +26 -1
- package/dist/src/compiled/@workflow/world/index.d.ts +1 -1
- package/dist/src/compiled/@workflow/world/runs.d.ts +2 -2
- package/dist/src/compiled/@workflow/world-local/index.js +3 -3
- package/dist/src/compiled/@workflow/world-vercel/index.js +12 -12
- package/dist/src/compiled/_chunks/node/{auth-BSKyPAEP.js → auth-Bx1Aoyfo.js} +1 -1
- package/dist/src/compiled/_chunks/node/{auth-YpKlwhP1.js → auth-CA8ZMfB8.js} +1 -1
- package/dist/src/compiled/_chunks/node/esm-CE0tAvRh.js +7 -0
- package/dist/src/compiled/_chunks/node/version-BC6t2Txc.js +1 -0
- package/dist/src/compiled/_chunks/node/version-DSQqVZ5T.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{attribute-changes-BwAadFfB.js → attribute-changes-03lzo29R.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/dist-BIdMK5N8.js +40 -0
- package/dist/src/compiled/_chunks/workflow/dist-DMQ3CtWt.js +3 -0
- package/dist/src/compiled/_chunks/workflow/frames-Boesh7kU.js +3 -0
- package/dist/src/compiled/_chunks/workflow/{private-CZFMABEf.js → private-CKx3PkSS.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{resume-hook-BToMtPbH.js → resume-hook-C6eL-S_T.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/run-BV0S6Zc2.js +1 -0
- package/dist/src/compiled/_chunks/workflow/sleep-Bh3jP9ii.js +1 -0
- package/dist/src/compiled/_chunks/workflow/wait-until-l-cwfJvm.js +15 -0
- package/dist/src/compiled/_chunks/workflow/{ws-transport-PnVVxT0R.js → ws-transport-BagXNxCE.js} +1 -1
- package/dist/src/compiler/compile-from-memory.d.ts +1 -0
- package/dist/src/compiler/extension-compatibility.d.ts +38 -20
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.d.ts +2 -2
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-channel.js +1 -1
- package/dist/src/compiler/normalize-schedule.js +1 -1
- package/dist/src/compiler/normalize-tool.js +1 -1
- package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
- package/dist/src/discover/extensions.d.ts +2 -0
- package/dist/src/discover/extensions.js +1 -1
- package/dist/src/discover/filesystem.d.ts +1 -0
- package/dist/src/discover/filesystem.js +1 -1
- package/dist/src/discover/project.js +1 -1
- package/dist/src/evals/runner/execute-task.js +1 -1
- package/dist/src/evals/session-cleanup.d.ts +7 -0
- package/dist/src/evals/session-cleanup.js +1 -0
- package/dist/src/evals/session.d.ts +4 -0
- package/dist/src/evals/session.js +1 -1
- package/dist/src/eve-channel/index.js +1 -1
- package/dist/src/eve-channel/request.d.ts +1 -0
- package/dist/src/eve-channel/request.js +1 -1
- package/dist/src/execution/activity-collector.js +1 -1
- package/dist/src/execution/activity-work.d.ts +8 -0
- package/dist/src/execution/activity-work.js +1 -1
- package/dist/src/execution/cancel-indexed-session-tasks-step.d.ts +6 -0
- package/dist/src/execution/cancel-indexed-session-tasks-step.js +1 -0
- package/dist/src/execution/continuation-conflict-step.js +1 -1
- package/dist/src/execution/coordination-dispatch-shared.d.ts +2 -2
- package/dist/src/execution/coordination-dispatch-shared.js +1 -1
- package/dist/src/execution/coordination-dispatch-step.js +1 -1
- package/dist/src/execution/create-session-step.js +1 -1
- package/dist/src/execution/durable-session-migrations/turn-workflow.d.ts +1 -1
- package/dist/src/execution/inline-turn.d.ts +4 -2
- package/dist/src/execution/inline-turn.js +1 -1
- package/dist/src/execution/next-driver-action.d.ts +0 -3
- package/dist/src/execution/parked-delivery-wait.js +1 -1
- package/dist/src/execution/proxied-deliver-step.js +1 -1
- package/dist/src/execution/run-session-limits.d.ts +5 -5
- package/dist/src/execution/sandbox/bindings/vercel-create-sdk.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel-sdk-types.d.ts +4 -4
- package/dist/src/execution/sandbox/bindings/vercel.js +1 -1
- package/dist/src/execution/session-activity-projection.js +1 -1
- package/dist/src/execution/session-activity.js +1 -1
- package/dist/src/execution/session-timeout-workflow.js +1 -1
- package/dist/src/execution/session.d.ts +1 -0
- package/dist/src/execution/session.js +1 -1
- package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
- package/dist/src/execution/tasks/child/steps.d.ts +19 -1
- package/dist/src/execution/tasks/child/steps.js +1 -1
- package/dist/src/execution/tasks/child/workflow.d.ts +2 -0
- package/dist/src/execution/tasks/child/workflow.js +1 -1
- package/dist/src/execution/tasks/parent/control-shared.js +1 -1
- package/dist/src/execution/tasks/parent/delegate.d.ts +2 -0
- package/dist/src/execution/tasks/parent/delegate.js +1 -1
- package/dist/src/execution/tasks/parent/hitl-proxy-steps.js +1 -1
- package/dist/src/execution/tasks/parent/subagent-task-projection.d.ts +26 -0
- package/dist/src/execution/tasks/parent/subagent-task-projection.js +1 -0
- package/dist/src/execution/tasks/parent/tool-execution.js +1 -1
- package/dist/src/execution/terminate-child-sessions-step.js +1 -1
- package/dist/src/execution/tools/sleep-workflow.d.ts +3 -0
- package/dist/src/execution/tools/sleep-workflow.js +1 -0
- package/dist/src/execution/tools/sleep.d.ts +1 -5
- package/dist/src/execution/tools/sleep.js +1 -1
- package/dist/src/execution/tools/subagent/accept-event-step.js +1 -1
- package/dist/src/execution/tools/subagent/invoke-agent.d.ts +1 -7
- package/dist/src/execution/tools/subagent/invoke-agent.js +1 -1
- package/dist/src/execution/tools/subagent/invoke-step.js +1 -1
- package/dist/src/execution/tools/workflow/ask.d.ts +1 -2
- package/dist/src/execution/tools/workflow/ask.js +1 -1
- package/dist/src/execution/tools/workflow/body.d.ts +6 -1
- package/dist/src/execution/tools/workflow/body.js +1 -1
- package/dist/src/execution/tools/workflow/cancel.js +1 -1
- package/dist/src/execution/tools/workflow/messages.d.ts +9 -8
- package/dist/src/execution/tools/workflow/messages.js +1 -1
- package/dist/src/execution/tools/workflow/owner-inbox.d.ts +2 -2
- package/dist/src/execution/tools/workflow/owner-inbox.js +1 -1
- package/dist/src/execution/tools/workflow/owner.d.ts +5 -11
- package/dist/src/execution/tools/workflow/owner.js +1 -1
- package/dist/src/execution/tools/workflow/run-control.d.ts +0 -4
- package/dist/src/execution/tools/workflow/run-control.js +1 -1
- package/dist/src/execution/tools/workflow/start.d.ts +5 -14
- package/dist/src/execution/tools/workflow/start.js +1 -1
- package/dist/src/execution/tools/workflow/workflow.d.ts +1 -1
- package/dist/src/execution/tools/workflow/workflow.js +1 -1
- package/dist/src/execution/turn-cancellation-control.d.ts +1 -0
- package/dist/src/execution/turn-cancellation-control.js +1 -1
- package/dist/src/execution/turn-cancellation-token.d.ts +1 -0
- package/dist/src/execution/turn-control-receiver.d.ts +3 -0
- package/dist/src/execution/turn-control-receiver.js +1 -1
- package/dist/src/execution/turn-dispatch.d.ts +2 -0
- package/dist/src/execution/turn-dispatch.js +1 -1
- package/dist/src/execution/turn-workflow-tool-run.d.ts +2 -8
- package/dist/src/execution/turn-workflow-tool-run.js +1 -1
- package/dist/src/execution/turn-workflow.d.ts +1 -0
- package/dist/src/execution/turn-workflow.js +1 -1
- package/dist/src/execution/wire/session-inbox-contract.d.ts +2 -2
- package/dist/src/execution/wire/session-inbox-contract.js +1 -1
- package/dist/src/execution/wire/session-inbox-encoder.d.ts +10 -2
- package/dist/src/execution/wire/session-inbox-encoder.js +1 -1
- package/dist/src/execution/wire/session-inbox-resume.js +1 -1
- package/dist/src/execution/wire/session-inbox-wire.js +1 -1
- package/dist/src/execution/wire/session-inbox-wire.v5.d.ts +341 -0
- package/dist/src/execution/wire/session-inbox-wire.v5.js +1 -0
- package/dist/src/execution/wire/session-inbox-wire.v5.migration.d.ts +3 -0
- package/dist/src/execution/wire/session-inbox-wire.v5.migration.js +1 -0
- package/dist/src/execution/wire/session-inbox-wire.v6.d.ts +341 -0
- package/dist/src/execution/wire/session-inbox-wire.v6.js +1 -0
- package/dist/src/execution/workflow-entry.js +1 -1
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/execution/workflow-steps.js +1 -1
- package/dist/src/harness/emission-state.js +1 -1
- package/dist/src/harness/session-limit-continuation.d.ts +5 -5
- package/dist/src/harness/session-limit-continuation.js +1 -1
- package/dist/src/harness/session-limit-enforcement.d.ts +4 -4
- package/dist/src/harness/session-limit-enforcement.js +1 -1
- package/dist/src/harness/session-usage-limits.d.ts +48 -0
- package/dist/src/harness/session-usage-limits.js +1 -0
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/harness/turn-client-context.d.ts +9 -0
- package/dist/src/harness/turn-client-context.js +1 -0
- package/dist/src/harness/turn-tag-state.d.ts +17 -20
- package/dist/src/harness/turn-tag-state.js +1 -1
- package/dist/src/harness/types.d.ts +5 -0
- package/dist/src/harness/workflow-tool-runs.d.ts +0 -1
- package/dist/src/harness/workflow-tool-runs.js +1 -1
- package/dist/src/internal/application/build-output-environment.d.ts +1 -0
- package/dist/src/internal/application/build-output-environment.js +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/application/paths.js +1 -1
- package/dist/src/internal/authored-definition/core.js +1 -1
- package/dist/src/internal/authored-definition/schema-backed.js +1 -1
- package/dist/src/internal/eve-project-root.d.ts +8 -0
- package/dist/src/internal/eve-project-root.js +1 -0
- package/dist/src/internal/invocation/workflow-execution.js +1 -1
- package/dist/src/internal/mcp/streamable-http-server.d.ts +29 -1
- package/dist/src/internal/mcp/streamable-http-server.js +1 -1
- package/dist/src/internal/nitro/host/build-application.js +1 -1
- package/dist/src/internal/nitro/host/create-application-nitro.d.ts +1 -0
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/types.d.ts +2 -0
- package/dist/src/internal/nitro/host/vercel-build-output-config.d.ts +1 -0
- package/dist/src/internal/nitro/host/vercel-build-output-config.js +1 -1
- package/dist/src/internal/project-context.d.ts +13 -8
- package/dist/src/internal/project-context.js +1 -1
- package/dist/src/internal/vercel/build-agent-workspace.d.ts +1 -1
- package/dist/src/internal/vercel/build-agent-workspace.js +1 -1
- package/dist/src/internal/vercel/eve-service-contribution.d.ts +1 -0
- package/dist/src/internal/vercel/eve-service-contribution.js +1 -1
- package/dist/src/internal/workflow/reference.d.ts +2 -0
- package/dist/src/internal/workflow/reference.js +1 -0
- package/dist/src/internal/workflow/runtime.d.ts +6 -0
- package/dist/src/internal/workflow/runtime.js +1 -1
- package/dist/src/internal/workflow-bundle/authored-workflow-directives.d.ts +1 -3
- package/dist/src/internal/workflow-bundle/authored-workflow-directives.js +1 -1
- package/dist/src/internal/workflow-bundle/authored-workflow-modules.d.ts +1 -11
- package/dist/src/internal/workflow-bundle/authored-workflow-modules.js +1 -1
- package/dist/src/internal/workflow-bundle/builder.js +1 -1
- package/dist/src/internal/workflow-bundle/dynamic-tool-transform.js +1 -1
- package/dist/src/internal/workflow-bundle/workflow-builders.d.ts +1 -3
- package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -1
- package/dist/src/internal/workflow-bundle/workflow-transformer.d.ts +1 -1
- package/dist/src/internal/workflow-bundle/workflow-transformer.js +2 -2
- package/dist/src/protocol/message.d.ts +3 -2
- package/dist/src/public/channels/mcp.js +1 -1
- package/dist/src/public/channels/slack/activity-plan.d.ts +4 -0
- package/dist/src/public/channels/slack/activity-plan.js +1 -0
- package/dist/src/public/channels/slack/activity.d.ts +45 -2
- package/dist/src/public/channels/slack/activity.js +2 -1
- package/dist/src/public/channels/slack/index.d.ts +1 -1
- package/dist/src/public/channels/slack/index.js +1 -1
- package/dist/src/public/channels/slack/slackChannel.js +1 -1
- package/dist/src/public/memory/index.js +1 -1
- package/dist/src/public/models/openai/chatgpt/model.js +2 -2
- package/dist/src/public/models/openai/chatgpt/transport.js +1 -1
- package/dist/src/public/nuxt/index.js +1 -1
- package/dist/src/public/nuxt/module.d.ts +3 -2
- package/dist/src/public/nuxt/module.js +1 -1
- package/dist/src/public/sandbox/vercel-sandbox.d.ts +9 -5
- package/dist/src/public/sandbox/vercel.d.ts +1 -1
- package/dist/src/public/sandbox/vercel.js +1 -1
- package/dist/src/public/tools/index.d.ts +3 -1
- package/dist/src/public/tools/index.js +1 -1
- package/dist/src/runtime/resolve-agent.js +1 -1
- package/dist/src/runtime/subagents/workflow.js +1 -1
- package/dist/src/self-modification/agent.d.ts +22 -0
- package/dist/src/self-modification/agent.js +1 -0
- package/dist/src/self-modification/extension/classify-registry-item.d.ts +19 -0
- package/dist/src/self-modification/extension/classify-registry-item.js +1 -0
- package/dist/src/self-modification/extension/eve-add.d.ts +56 -0
- package/dist/src/self-modification/extension/eve-add.js +2 -0
- package/dist/src/self-modification/extension/extension.d.ts +2 -0
- package/dist/src/self-modification/extension/extension.js +1 -0
- package/dist/src/self-modification/extension/instructions.d.ts +4 -0
- package/dist/src/self-modification/extension/instructions.js +23 -0
- package/dist/src/self-modification/extension/source-lock.d.ts +2 -0
- package/dist/src/self-modification/extension/source-lock.js +1 -0
- package/dist/src/self-modification/extension/tools/edit_file.d.ts +16 -0
- package/dist/src/self-modification/extension/tools/edit_file.js +1 -0
- package/dist/src/self-modification/extension/tools/registry_add.d.ts +52 -0
- package/dist/src/self-modification/extension/tools/registry_add.js +1 -0
- package/dist/src/self-modification/extension/tools/search_models.d.ts +22 -0
- package/dist/src/self-modification/extension/tools/search_models.js +1 -0
- package/dist/src/self-modification/extension/tools/search_registry.d.ts +103 -0
- package/dist/src/self-modification/extension/tools/search_registry.js +1 -0
- package/dist/src/self-modification/filesystem.d.ts +6 -0
- package/dist/src/self-modification/filesystem.js +1 -0
- package/dist/src/self-modification/sandbox.d.ts +2 -0
- package/dist/src/self-modification/sandbox.js +1 -0
- package/dist/src/services/dev-client/target.d.ts +3 -1
- package/dist/src/setup/boxes/select-model.d.ts +3 -21
- package/dist/src/setup/boxes/select-model.js +1 -1
- package/dist/src/setup/cli/prompt-ui.js +4 -4
- package/dist/src/setup/cli/select-component.d.ts +1 -1
- package/dist/src/setup/cli/select-component.js +1 -1
- package/dist/src/setup/flows/model.d.ts +3 -0
- package/dist/src/setup/flows/model.js +1 -1
- package/dist/src/setup/prompter.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/setup/scaffold/update/web-options.js +1 -1
- package/dist/src/shared/action-types.d.ts +35 -22
- package/dist/src/shared/action-types.js +1 -1
- package/dist/src/shared/agent-definition.d.ts +13 -0
- package/dist/src/shared/agent-turn-outcome.d.ts +2 -0
- package/dist/src/shared/agent-turn-outcome.js +1 -1
- package/dist/src/shared/extension-package-contract.d.ts +2 -0
- package/dist/src/shared/extension-package-contract.js +1 -1
- package/dist/src/shared/gateway-model-catalog.d.ts +21 -0
- package/dist/src/shared/gateway-model-catalog.js +1 -0
- package/dist/src/shared/sandbox-network-policy.d.ts +1 -1
- package/dist/src/shared/token-usage.d.ts +11 -15
- package/dist/src/shared/token-usage.js +1 -1
- package/dist/src/shared/workflow-tool-context.d.ts +2 -0
- package/dist/src/shared/workflow-tool-context.js +1 -0
- package/dist/src/subagents/callback-route.js +1 -1
- package/dist/src/subagents/event-proxy-step.js +1 -1
- package/dist/src/subagents/start-remote.js +1 -1
- package/dist/src/subagents/token-budget.js +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tasks/types.d.ts +18 -1
- package/dist/src/tasks/types.js +1 -1
- package/dist/src/tools/behavior.d.ts +5 -0
- package/dist/src/tools/definition.d.ts +16 -12
- package/dist/src/tools/definition.js +1 -1
- package/dist/src/tools/dynamic.d.ts +2 -2
- package/dist/src/tools/provided/sleep.d.ts +4 -4
- package/dist/src/tools/provided/sleep.js +1 -1
- package/dist/src/tools/task.d.ts +28 -80
- package/dist/src/tools/task.js +1 -1
- package/dist/src/tools/workflow-definition.d.ts +60 -0
- package/dist/src/tools/workflow-definition.js +1 -0
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/agent-config.md +24 -19
- package/docs/channels/eve.mdx +1 -1
- package/docs/channels/mcp.mdx +25 -3
- package/docs/concepts/built-in-tools.md +1 -1
- package/docs/concepts/execution-model-and-durability.mdx +13 -2
- package/docs/concepts/sessions-runs-and-streaming.md +9 -1
- package/docs/guides/client/messages.mdx +1 -1
- package/docs/guides/client/streaming.mdx +1 -1
- package/docs/guides/deployment/vercel.mdx +3 -1
- package/docs/guides/frontend/overview.mdx +1 -1
- package/docs/memory/overview.mdx +41 -12
- package/docs/reference/cli.md +31 -33
- package/docs/reference/meta.json +1 -4
- package/docs/reference/telemetry.md +56 -0
- package/docs/reference/typescript-api.md +38 -35
- package/docs/sandbox.mdx +1 -1
- package/docs/tools/overview.mdx +59 -18
- package/docs/tools/workflows.mdx +146 -70
- package/package.json +38 -19
- package/dist/src/compiled/@vercel/sandbox-delete/api-client/index.d.ts +0 -2
- package/dist/src/compiled/@vercel/sandbox-delete/index.js +0 -9
- package/dist/src/compiled/@vercel/sandbox-stable/LICENSE +0 -201
- package/dist/src/compiled/@vercel/sandbox-stable/_async-retry.d.ts +0 -8
- package/dist/src/compiled/@vercel/sandbox-stable/_workflow-serde.d.ts +0 -5
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/api-client.d.ts +0 -1456
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/api-error.d.ts +0 -29
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/base-client.d.ts +0 -39
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/file-writer.d.ts +0 -66
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/index.d.ts +0 -2
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/validators.d.ts +0 -899
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/with-retry.d.ts +0 -10
- package/dist/src/compiled/@vercel/sandbox-stable/auth/error.d.ts +0 -15
- package/dist/src/compiled/@vercel/sandbox-stable/auth/file.d.ts +0 -18
- package/dist/src/compiled/@vercel/sandbox-stable/auth/index.d.ts +0 -6
- package/dist/src/compiled/@vercel/sandbox-stable/auth/oauth.d.ts +0 -111
- package/dist/src/compiled/@vercel/sandbox-stable/auth/poll-for-token.d.ts +0 -28
- package/dist/src/compiled/@vercel/sandbox-stable/auth/project.d.ts +0 -40
- package/dist/src/compiled/@vercel/sandbox-stable/command.d.ts +0 -292
- package/dist/src/compiled/@vercel/sandbox-stable/constants.d.ts +0 -5
- package/dist/src/compiled/@vercel/sandbox-stable/execution-context.d.ts +0 -116
- package/dist/src/compiled/@vercel/sandbox-stable/filesystem.d.ts +0 -258
- package/dist/src/compiled/@vercel/sandbox-stable/index.d.ts +0 -12
- package/dist/src/compiled/@vercel/sandbox-stable/index.js +0 -1
- package/dist/src/compiled/@vercel/sandbox-stable/network-policy.d.ts +0 -169
- package/dist/src/compiled/@vercel/sandbox-stable/proxy.d.ts +0 -55
- package/dist/src/compiled/@vercel/sandbox-stable/sandbox-user.d.ts +0 -212
- package/dist/src/compiled/@vercel/sandbox-stable/sandbox.d.ts +0 -1216
- package/dist/src/compiled/@vercel/sandbox-stable/session.d.ts +0 -433
- package/dist/src/compiled/@vercel/sandbox-stable/snapshot.d.ts +0 -229
- package/dist/src/compiled/@vercel/sandbox-stable/utils/get-credentials.d.ts +0 -21
- package/dist/src/compiled/@vercel/sandbox-stable/utils/paginator.d.ts +0 -16
- package/dist/src/compiled/@vercel/sandbox-stable/utils/resolveSignal.d.ts +0 -15
- package/dist/src/compiled/@vercel/sandbox-stable/utils/sandbox-snapshot.d.ts +0 -11
- package/dist/src/compiled/@vercel/sandbox-stable/utils/types.d.ts +0 -11
- package/dist/src/compiled/_chunks/node/decode_jwt-Col8JOnf.js +0 -7
- package/dist/src/compiled/_chunks/node/version-BYHw-SDY.js +0 -1
- package/dist/src/compiled/_chunks/node/version-DH6yRy-M.js +0 -1
- package/dist/src/compiled/_chunks/workflow/dist-CgbVZs5l.js +0 -40
- package/dist/src/compiled/_chunks/workflow/dist-DjojkP5e.js +0 -3
- package/dist/src/compiled/_chunks/workflow/frames-CZ9eHShe.js +0 -3
- package/dist/src/compiled/_chunks/workflow/run-DzyAoGh4.js +0 -1
- package/dist/src/compiled/_chunks/workflow/sleep-3_A5uOp-.js +0 -1
- package/dist/src/compiled/_chunks/workflow/wait-until-BtySPYD0.js +0 -15
- package/dist/src/harness/session-token-limits.d.ts +0 -41
- package/dist/src/harness/session-token-limits.js +0 -1
- package/dist/src/harness/turn-sleep.d.ts +0 -12
- package/dist/src/harness/turn-sleep.js +0 -1
- package/dist/src/internal/agent-workspace.d.ts +0 -15
- package/dist/src/internal/agent-workspace.js +0 -1
- package/dist/src/node_modules/.pnpm/@clack_core@1.3.1/node_modules/@clack/core/dist/index.js +0 -16
- package/dist/src/node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js +0 -1
- package/dist/src/node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js +0 -1
- package/dist/src/node_modules/.pnpm/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js +0 -1
- package/dist/src/node_modules/.pnpm/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js +0 -5
- package/dist/src/node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js +0 -1
- package/dist/src/public/workflow/index.d.ts +0 -5
- package/dist/src/public/workflow/index.js +0 -1
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/LICENSE +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/_async-retry.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/_workflow-serde.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/api-client/api-error.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/api-client/base-client.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/api-client/file-writer.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/api-client/with-retry.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/auth/error.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/auth/file.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/auth/index.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/auth/oauth.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/auth/poll-for-token.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/auth/project.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/command.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/execution-context.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/filesystem.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/network-policy.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/proxy.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/sandbox-user.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/session.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/snapshot.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/utils/get-credentials.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/utils/paginator.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/utils/resolveSignal.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/utils/sandbox-snapshot.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/utils/types.d.ts +0 -0
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
//#region src/utils/resolveSignal.d.ts
|
|
2
|
-
declare const linuxSignalMapping: {
|
|
3
|
-
readonly SIGHUP: 1;
|
|
4
|
-
readonly SIGINT: 2;
|
|
5
|
-
readonly SIGQUIT: 3;
|
|
6
|
-
readonly SIGKILL: 9;
|
|
7
|
-
readonly SIGTERM: 15;
|
|
8
|
-
readonly SIGCONT: 18;
|
|
9
|
-
readonly SIGSTOP: 19;
|
|
10
|
-
};
|
|
11
|
-
type CommonLinuxSignals = keyof typeof linuxSignalMapping;
|
|
12
|
-
type Signal = CommonLinuxSignals | number;
|
|
13
|
-
//#endregion
|
|
14
|
-
export { Signal };
|
|
15
|
-
//# sourceMappingURL=resolveSignal.d.ts.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { SessionMetaData } from "../api-client/validators.js";
|
|
2
|
-
import { NetworkPolicy } from "../network-policy.js";
|
|
3
|
-
import "../api-client/index.js";
|
|
4
|
-
|
|
5
|
-
//#region src/utils/sandbox-snapshot.d.ts
|
|
6
|
-
type SandboxSnapshot = Omit<SessionMetaData, "networkPolicy"> & {
|
|
7
|
-
networkPolicy?: NetworkPolicy;
|
|
8
|
-
};
|
|
9
|
-
//#endregion
|
|
10
|
-
export { SandboxSnapshot };
|
|
11
|
-
//# sourceMappingURL=sandbox-snapshot.d.ts.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
//#region src/utils/types.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Utility type that extends a type to accept private parameters.
|
|
4
|
-
*
|
|
5
|
-
* The private parameters can then be extracted out of the object using
|
|
6
|
-
* `getPrivateParams`.
|
|
7
|
-
*/
|
|
8
|
-
type WithPrivate<T> = T & { [K in `__${string}`]?: unknown };
|
|
9
|
-
//#endregion
|
|
10
|
-
export { WithPrivate };
|
|
11
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{i as e,o as t,t as n}from"./rolldown-runtime-DaDcL9Zw.js";import{t as r}from"./retry-qwFNGj4P.js";import{n as i,r as a,t as o}from"./token-util-Ldar52H7.js";var s=n(((e,t)=>{var n=r();function i(e,t){function r(r,i){var a=t||{},o;`randomize`in a||(a.randomize=!0),o=n.operation(a);function s(e){i(e||Error(`Aborted`))}function c(e,t){if(e.bail){s(e);return}o.retry(e)?a.onRetry&&a.onRetry(e,t):i(o.mainError())}function l(t){var n;try{n=e(s,t)}catch(e){c(e,t);return}Promise.resolve(n).then(r).catch(function(e){c(e,t)})}o.attempt(l)}return new Promise(r)}t.exports=i})),c=n(((t,n)=>{n.exports=e(`events`)})),l=n(((e,t)=>{t.exports=class{constructor(e){if(!(e>0)||e-1&e)throw Error(`Max size for a FixedFIFO should be a power of two`);this.buffer=Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}clear(){this.top=this.btm=0,this.next=null,this.buffer.fill(void 0)}push(e){return this.buffer[this.top]===void 0?(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0):!1}shift(){let e=this.buffer[this.btm];if(e!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}peek(){return this.buffer[this.btm]}isEmpty(){return this.buffer[this.btm]===void 0}}})),u=n(((e,t)=>{let n=l();t.exports=class{constructor(e){this.hwm=e||16,this.head=new n(this.hwm),this.tail=this.head,this.length=0}clear(){this.head=this.tail,this.head.clear(),this.length=0}push(e){if(this.length++,!this.head.push(e)){let t=this.head;this.head=t.next=new n(2*this.head.buffer.length),this.head.push(e)}}shift(){this.length!==0&&this.length--;let e=this.tail.shift();if(e===void 0&&this.tail.next){let e=this.tail.next;return this.tail.next=null,this.tail=e,this.tail.shift()}return e}peek(){let e=this.tail.peek();return e===void 0&&this.tail.next?this.tail.next.peek():e}isEmpty(){return this.length===0}}})),d=n(((e,t)=>{function n(e){return Buffer.isBuffer(e)||e instanceof Uint8Array}function r(e){return Buffer.isEncoding(e)}function i(e,t,n){return Buffer.alloc(e,t,n)}function a(e){return Buffer.allocUnsafe(e)}function o(e){return Buffer.allocUnsafeSlow(e)}function s(e,t){return Buffer.byteLength(e,t)}function c(e,t){return Buffer.compare(e,t)}function l(e,t){return Buffer.concat(e,t)}function u(e,t,n,r,i){return b(e).copy(t,n,r,i)}function d(e,t){return b(e).equals(t)}function f(e,t,n,r,i){return b(e).fill(t,n,r,i)}function p(e,t,n){return Buffer.from(e,t,n)}function m(e,t,n,r){return b(e).includes(t,n,r)}function h(e,t,n,r){return b(e).indexOf(t,n,r)}function g(e,t,n,r){return b(e).lastIndexOf(t,n,r)}function _(e){return b(e).swap16()}function v(e){return b(e).swap32()}function y(e){return b(e).swap64()}function b(e){return Buffer.isBuffer(e)?e:Buffer.from(e.buffer,e.byteOffset,e.byteLength)}function x(e,t,n,r){return b(e).toString(t,n,r)}function S(e,t,n,r,i){return b(e).write(t,n,r,i)}function C(e,t){return b(e).readDoubleBE(t)}function w(e,t){return b(e).readDoubleLE(t)}function T(e,t){return b(e).readFloatBE(t)}function E(e,t){return b(e).readFloatLE(t)}function D(e,t){return b(e).readInt32BE(t)}function ee(e,t){return b(e).readInt32LE(t)}function O(e,t){return b(e).readUInt32BE(t)}function k(e,t){return b(e).readUInt32LE(t)}function A(e,t,n){return b(e).writeDoubleBE(t,n)}function j(e,t,n){return b(e).writeDoubleLE(t,n)}function te(e,t,n){return b(e).writeFloatBE(t,n)}function M(e,t,n){return b(e).writeFloatLE(t,n)}function N(e,t,n){return b(e).writeInt32BE(t,n)}function P(e,t,n){return b(e).writeInt32LE(t,n)}function F(e,t,n){return b(e).writeUInt32BE(t,n)}function I(e,t,n){return b(e).writeUInt32LE(t,n)}t.exports={isBuffer:n,isEncoding:r,alloc:i,allocUnsafe:a,allocUnsafeSlow:o,byteLength:s,compare:c,concat:l,copy:u,equals:d,fill:f,from:p,includes:m,indexOf:h,lastIndexOf:g,swap16:_,swap32:v,swap64:y,toBuffer:b,toString:x,write:S,readDoubleBE:C,readDoubleLE:w,readFloatBE:T,readFloatLE:E,readInt32BE:D,readInt32LE:ee,readUInt32BE:O,readUInt32LE:k,writeDoubleBE:A,writeDoubleLE:j,writeFloatBE:te,writeFloatLE:M,writeInt32BE:N,writeInt32LE:P,writeUInt32BE:F,writeUInt32LE:I}})),f=n(((e,t)=>{let n=d();t.exports=class{constructor(e){this.encoding=e}get remaining(){return 0}decode(e){return n.toString(e,this.encoding)}flush(){return``}}})),p=n(((e,t)=>{let n=d();t.exports=class{constructor(){this._reset()}get remaining(){return this.bytesSeen}decode(e){if(e.byteLength===0)return``;if(this.bytesNeeded===0&&r(e,0)===0)return this.bytesSeen=i(e),n.toString(e,`utf8`);let t=``,a=0;if(this.bytesNeeded>0){for(;a<e.byteLength;){let n=e[a];if(n<this.lowerBoundary||n>this.upperBoundary){t+=`�`,this._reset();break}if(this.lowerBoundary=128,this.upperBoundary=191,this.codePoint=this.codePoint<<6|n&63,this.bytesSeen++,a++,this.bytesSeen===this.bytesNeeded){t+=String.fromCodePoint(this.codePoint),this._reset();break}}if(this.bytesNeeded>0)return t}let o=r(e,a),s=e.byteLength-o;s>a&&(t+=n.toString(e,`utf8`,a,s));for(let n=s;n<e.byteLength;n++){let r=e[n];if(this.bytesNeeded===0){r<=127?(this.bytesSeen=0,t+=String.fromCharCode(r)):r>=194&&r<=223?(this.bytesNeeded=2,this.bytesSeen=1,this.codePoint=r&31):r>=224&&r<=239?(r===224?this.lowerBoundary=160:r===237&&(this.upperBoundary=159),this.bytesNeeded=3,this.bytesSeen=1,this.codePoint=r&15):r>=240&&r<=244?(r===240?this.lowerBoundary=144:r===244&&(this.upperBoundary=143),this.bytesNeeded=4,this.bytesSeen=1,this.codePoint=r&7):(this.bytesSeen=1,t+=`�`);continue}if(r<this.lowerBoundary||r>this.upperBoundary){t+=`�`,n--,this._reset();continue}this.lowerBoundary=128,this.upperBoundary=191,this.codePoint=this.codePoint<<6|r&63,this.bytesSeen++,this.bytesSeen===this.bytesNeeded&&(t+=String.fromCodePoint(this.codePoint),this._reset())}return t}flush(){let e=this.bytesNeeded>0?`�`:``;return this._reset(),e}_reset(){this.codePoint=0,this.bytesNeeded=0,this.bytesSeen=0,this.lowerBoundary=128,this.upperBoundary=191}};function r(e,t){let n=e.byteLength;if(n<=t)return 0;let r=Math.max(t,n-4),i=n-1;for(;i>r&&(e[i]&192)==128;)i--;if(i<t)return 0;let a=e[i],o;if(a<=127)return 0;if(a>=194&&a<=223)o=2;else if(a>=224&&a<=239)o=3;else if(a>=240&&a<=244)o=4;else return 0;let s=n-i;return s<o?s:0}function i(e){let t=e.byteLength;if(t===0)return 0;let n=e[t-1];if(n<=127)return 0;if((n&192)!=128)return 1;let r=Math.max(0,t-4),i=t-2;for(;i>=r&&(e[i]&192)==128;)i--;if(i<0)return 1;let a=e[i],o;if(a>=194&&a<=223)o=2;else if(a>=224&&a<=239)o=3;else if(a>=240&&a<=244)o=4;else return 1;if(t-i!==o)return 1;if(o>=3){let t=e[i+1];if(a===224&&t<160||a===237&&t>159||a===240&&t<144||a===244&&t>143)return 1}return 0}})),m=n(((e,t)=>{let n=f(),r=p();t.exports=class{constructor(e=`utf8`){switch(this.encoding=i(e),this.encoding){case`utf8`:this.decoder=new r;break;case`utf16le`:case`base64`:throw Error(`Unsupported encoding: `+this.encoding);default:this.decoder=new n(this.encoding)}}get remaining(){return this.decoder.remaining}push(e){return typeof e==`string`?e:this.decoder.decode(e)}write(e){return this.push(e)}end(e){let t=``;return e&&(t=this.push(e)),t+=this.decoder.flush(),t}};function i(e){switch(e=e.toLowerCase(),e){case`utf8`:case`utf-8`:return`utf8`;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return`utf16le`;case`latin1`:case`binary`:return`latin1`;case`base64`:case`ascii`:case`hex`:return e;default:throw Error(`Unknown encoding: `+e)}}})),h=n(((e,t)=>{t.exports=class e extends Error{constructor(t,n,r=e){super(t),this.code=n,Error.captureStackTrace&&Error.captureStackTrace(this,r)}static isStreamDestroyed(e){return e&&e.code===`STREAM_DESTROYED`}static isPrematureClose(e){return e&&e.code===`PREMATURE_CLOSE`}static isAborted(e){return e&&e.code===`ABORTED`}static isBadArgument(e){return e&&e.code===`BAD_ARGUMENT`}get name(){return`StreamError`}static STREAM_DESTROYED(){return new e(`Stream was destroyed`,`STREAM_DESTROYED`,e.STREAM_DESTROYED)}static PREMATURE_CLOSE(t=`Premature close`){return new e(t,`PREMATURE_CLOSE`,e.PREMATURE_CLOSE)}static ABORTED(){return new e(`Stream aborted`,`ABORTED`,e.ABORTED)}static BAD_ARGUMENT(t=`Bad argument`){return new e(t,`BAD_ARGUMENT`,e.BAD_ARGUMENT)}}})),g=n(((e,t)=>{let{EventEmitter:n}=c(),r=u(),i=m(),a=h(),o=typeof queueMicrotask>`u`?e=>global.process.nextTick(e):queueMicrotask,s=536870910,l=1024,d=2048,f=16384,p=32768,g=131072,_=536805375,v=536870143,y=536838143,b=536739839,x=2<<18,S=4<<18,C=8<<18,w=32<<18,T=64<<18,E=128<<18,D=512<<18,ee=1024<<18,O=503316479,k=268435455,A=262160,j=8404992,te=8405006,M=33587200,N=33587215,P=16527,F=270794767,I=Symbol.asyncIterator||Symbol(`asyncIterator`);var ne=class{constructor(e,{highWaterMark:t=16384,map:n=null,mapWritable:i,byteLength:a,byteLengthWritable:o}={}){this.stream=e,this.queue=new r,this.highWaterMark=t,this.buffered=0,this.error=null,this.pipeline=null,this.drains=null,this.byteLength=o||a||X,this.map=i||n,this.afterWrite=R.bind(this),this.afterUpdateNextTick=z.bind(this)}get ending(){return(this.stream._duplexState&D)!=0}get ended(){return(this.stream._duplexState&w)!=0}push(e){return this.stream._duplexState&142606350?!1:(this.map!==null&&(e=this.map(e)),this.buffered+=this.byteLength(e),this.queue.push(e),this.buffered<this.highWaterMark?(this.stream._duplexState|=C,!0):(this.stream._duplexState|=6291456,!1))}shift(){let e=this.queue.shift();return this.buffered-=this.byteLength(e),this.buffered===0&&(this.stream._duplexState&=534773759),e}end(e){typeof e==`function`?this.stream.once(`finish`,e):e!=null&&this.push(e),this.stream._duplexState=(this.stream._duplexState|D)&535822335}autoBatch(e,t){let n=[],r=this.stream;for(n.push(e);(r._duplexState&F)==2359296;)n.push(r._writableState.shift());if(r._duplexState&15)return t(null);r._writev(n,t)}update(){let e=this.stream;e._duplexState|=x;do{for(;(e._duplexState&F)==C;){let t=this.shift();e._duplexState|=67371008,e._write(t,this.afterWrite)}e._duplexState&1310720||this.updateNonPrimary()}while(this.continueUpdate()===!0);e._duplexState&=536346623}updateNonPrimary(){let e=this.stream;if((e._duplexState&144965647)==D){e._duplexState|=262144,e._final(se.bind(this));return}if((e._duplexState&14)==4){e._duplexState&M||(e._duplexState|=A,e._destroy(L.bind(this)));return}(e._duplexState&N)==1&&(e._duplexState=(e._duplexState|A)&s,e._open(V.bind(this)))}continueUpdate(){return this.stream._duplexState&E?(this.stream._duplexState&=O,!0):!1}updateCallback(){(this.stream._duplexState&35127311)==S?this.update():this.updateNextTick()}updateNextTick(){this.stream._duplexState&E||(this.stream._duplexState|=E,this.stream._duplexState&x||o(this.afterUpdateNextTick))}},re=class{constructor(e,{highWaterMark:t=16384,map:n=null,mapReadable:i,byteLength:a,byteLengthReadable:o}={}){this.stream=e,this.queue=new r,this.highWaterMark=t===0?1:t,this.buffered=0,this.readAhead=t>0,this.error=null,this.pipeline=null,this.byteLength=o||a||X,this.map=i||n,this.pipeTo=null,this.afterRead=ce.bind(this),this.afterUpdateNextTick=le.bind(this)}get ending(){return(this.stream._duplexState&l)!=0}get ended(){return(this.stream._duplexState&f)!=0}pipe(e,t){if(this.pipeTo!==null)throw a.BAD_ARGUMENT(`Can only pipe to one destination`);if(typeof t!=`function`&&(t=null),this.stream._duplexState|=512,this.pipeTo=e,this.pipeline=new ae(this.stream,e,t),t&&this.stream.on(`error`,Z),J(e))e._writableState.pipeline=this.pipeline,t&&e.on(`error`,Z),e.on(`finish`,this.pipeline.finished.bind(this.pipeline));else{let t=this.pipeline.done.bind(this.pipeline,e),n=this.pipeline.done.bind(this.pipeline,e,null);e.on(`error`,t),e.on(`close`,n),e.on(`finish`,this.pipeline.finished.bind(this.pipeline))}e.on(`drain`,oe.bind(this)),this.stream.emit(`piping`,e),e.emit(`pipe`,this.stream)}push(e){let t=this.stream;return e===null?(this.highWaterMark=0,t._duplexState=(t._duplexState|l)&536805311,!1):this.map!==null&&(e=this.map(e),e===null)?(t._duplexState&=_,this.buffered<this.highWaterMark):(this.buffered+=this.byteLength(e),this.queue.push(e),t._duplexState=(t._duplexState|128)&_,this.buffered<this.highWaterMark)}shift(){let e=this.queue.shift();return this.buffered-=this.byteLength(e),this.buffered===0&&(this.stream._duplexState&=536862591),e}unshift(e){let t=[this.map===null?e:this.map(e)];for(;this.buffered>0;)t.push(this.shift());for(let e=0;e<t.length-1;e++){let n=t[e];this.buffered+=this.byteLength(n),this.queue.push(n)}this.push(t[t.length-1])}read(){let e=this.stream;if((e._duplexState&P)==128){let t=this.shift();return this.pipeTo!==null&&this.pipeTo.write(t)===!1&&(e._duplexState&=v),e._duplexState&d&&e.emit(`data`,t),t}return this.readAhead===!1&&(e._duplexState|=g,this.updateNextTick()),null}drain(){let e=this.stream;for(;(e._duplexState&P)==128&&e._duplexState&768;){let t=this.shift();this.pipeTo!==null&&this.pipeTo.write(t)===!1&&(e._duplexState&=v),e._duplexState&d&&e.emit(`data`,t)}}update(){let e=this.stream;e._duplexState|=32;do{for(this.drain();this.buffered<this.highWaterMark&&(e._duplexState&214047)==g;)e._duplexState|=65552,e._read(this.afterRead),this.drain();(e._duplexState&12431)==4224&&(e._duplexState|=8192,e.emit(`readable`)),e._duplexState&80||this.updateNonPrimary()}while(this.continueUpdate()===!0);e._duplexState&=536870879}updateNonPrimary(){let e=this.stream;if((e._duplexState&1167)==l&&(e._duplexState=(e._duplexState|f)&536869887,e.emit(`end`),(e._duplexState&te)==j&&(e._duplexState|=4),this.pipeTo!==null&&this.pipeTo.end()),(e._duplexState&14)==4){e._duplexState&M||(e._duplexState|=A,e._destroy(L.bind(this)));return}(e._duplexState&N)==1&&(e._duplexState=(e._duplexState|A)&s,e._open(V.bind(this)))}continueUpdate(){return this.stream._duplexState&p?(this.stream._duplexState&=y,!0):!1}updateCallback(){(this.stream._duplexState&32879)==64?this.update():this.updateNextTick()}updateNextTickIfOpen(){this.stream._duplexState&32769||(this.stream._duplexState|=p,this.stream._duplexState&32||o(this.afterUpdateNextTick))}updateNextTick(){this.stream._duplexState&p||(this.stream._duplexState|=p,this.stream._duplexState&32||o(this.afterUpdateNextTick))}},ie=class{constructor(e){this.data=null,this.afterTransform=ue.bind(e),this.afterFinal=null}},ae=class{constructor(e,t,n){this.from=e,this.to=t,this.afterPipe=n,this.error=null,this.pipeToFinished=!1}finished(){this.pipeToFinished=!0}done(e,t){if(t&&(this.error=t),e===this.to&&(this.to=null,this.from!==null)){(!(this.from._duplexState&f)||!this.pipeToFinished)&&this.from.destroy(this.error||a.PREMATURE_CLOSE(`Writable stream closed`));return}if(e===this.from&&(this.from=null,this.to!==null)){e._duplexState&f||this.to.destroy(this.error||a.PREMATURE_CLOSE(`Readable stream closed`));return}this.afterPipe!==null&&this.afterPipe(this.error),this.to=this.from=this.afterPipe=null}};function oe(){this.stream._duplexState|=512,this.updateCallback()}function se(e){let t=this.stream;e&&t.destroy(e),t._duplexState&14||(t._duplexState|=w,t.emit(`finish`)),(t._duplexState&te)==j&&(t._duplexState|=4),t._duplexState&=402391039,t._duplexState&x?this.updateNextTick():this.update()}function L(e){let t=this.stream;!e&&!a.isStreamDestroyed(this.error)&&(e=this.error),e&&t.emit(`error`,e),t._duplexState|=8,t.emit(`close`);let n=t._readableState,r=t._writableState;if(n!==null&&n.pipeline!==null&&n.pipeline.done(t,e),r!==null){for(;r.drains!==null&&r.drains.length>0;)r.drains.shift().resolve(!1);r.pipeline!==null&&r.pipeline.done(t,e)}}function R(e){let t=this.stream;e&&t.destroy(e),t._duplexState&=469499903,this.drains!==null&&B(this.drains),(t._duplexState&6553615)==4194304&&(t._duplexState&=532676607,(t._duplexState&T)==T&&t.emit(`drain`)),this.updateCallback()}function ce(e){e&&this.stream.destroy(e),this.stream._duplexState&=536870895,this.readAhead===!1&&!(this.stream._duplexState&256)&&(this.stream._duplexState&=b),this.updateCallback()}function le(){this.stream._duplexState&32||(this.stream._duplexState&=y,this.update())}function z(){this.stream._duplexState&x||(this.stream._duplexState&=O,this.update())}function B(e){for(let t=0;t<e.length;t++)--e[t].writes===0&&(e.shift().resolve(!0),t--)}function V(e){let t=this.stream;e&&t.destroy(e),t._duplexState&4||(t._duplexState&17423||(t._duplexState|=64),t._duplexState&142606351||(t._duplexState|=S),t.emit(`open`)),t._duplexState&=536608751,t._writableState!==null&&t._writableState.updateCallback(),t._readableState!==null&&t._readableState.updateCallback()}function ue(e,t){t!=null&&this.push(t),this._writableState.afterWrite(e)}function de(e){this._readableState!==null&&(e===`data`&&(this._duplexState|=133376,this._readableState.updateNextTick()),e===`readable`&&(this._duplexState|=4096,this._readableState.updateNextTick())),this._writableState!==null&&e===`drain`&&(this._duplexState|=T,this._writableState.updateNextTick())}var H=class extends n{constructor(e){super(),this._duplexState=0,this._readableState=null,this._writableState=null,e&&(e.open&&(this._open=e.open),e.destroy&&(this._destroy=e.destroy),e.predestroy&&(this._predestroy=e.predestroy),e.signal&&e.signal.addEventListener(`abort`,Q.bind(this))),this.on(`newListener`,de)}_open(e){e(null)}_destroy(e){e(null)}_predestroy(){}get readable(){return this._readableState!==null||void 0}get writable(){return this._writableState!==null||void 0}get destroyed(){return(this._duplexState&8)!=0}get destroying(){return(this._duplexState&14)!=0}destroy(e){this._duplexState&14||(e||=a.STREAM_DESTROYED(),this._duplexState=(this._duplexState|4)&535822271,this._readableState!==null&&(this._readableState.highWaterMark=0,this._readableState.error=e),this._writableState!==null&&(this._writableState.highWaterMark=0,this._writableState.error=e),this._duplexState|=2,this._predestroy(),this._duplexState&=536870909,this._readableState!==null&&this._readableState.updateNextTick(),this._writableState!==null&&this._writableState.updateNextTick())}},fe=class e extends H{constructor(e){super(e),this._duplexState|=8519681,this._readableState=new re(this,e),e&&(this._readableState.readAhead===!1&&(this._duplexState&=b),e.read&&(this._read=e.read),e.eagerOpen&&this._readableState.updateNextTick(),e.encoding&&this.setEncoding(e.encoding))}static deferred(e,t){let n=new G(t);return e().then(e=>{if(e===null)return n.end();n.destroying||K(e,n,Z)}).catch(e=>n.destroy(e)),n}setEncoding(e){let t=new i(e),n=this._readableState.map||ge;return this._readableState.map=r,this;function r(e){let r=t.push(e);return r===``&&(e.byteLength!==0||t.remaining>0)?null:n(r)}}_read(e){e(null)}pipe(e,t){return this._readableState.updateNextTick(),this._readableState.pipe(e,t),e}read(){return this._readableState.updateNextTick(),this._readableState.read()}push(e){return this._readableState.updateNextTickIfOpen(),this._readableState.push(e)}unshift(e){return this._readableState.updateNextTickIfOpen(),this._readableState.unshift(e)}resume(){return this._duplexState|=131328,this._readableState.updateNextTick(),this}pause(){return this._duplexState&=this._readableState.readAhead===!1?536739583:536870655,this}static _fromAsyncIterator(t,n){let r,i=new e({...n,read(e){t.next().then(a).then(e.bind(null,null)).catch(e)},predestroy(){r=t.return()},destroy(e){if(!r)return e(null);r.then(e.bind(null,null)).catch(e)}});return i;function a(e){e.done?i.push(null):i.push(e.value)}}static from(t,n){if(Se(t))return t;if(t[I])return this._fromAsyncIterator(t[I](),n);Array.isArray(t)||(t=t===void 0?[]:[t]);let r=0;return new e({...n,read(e){this.push(r===t.length?null:t[r++]),e(null)}})}static isBackpressured(e){return(e._duplexState&17422)!=0||e._readableState.buffered>=e._readableState.highWaterMark}static isPaused(e){return(e._duplexState&256)==0}[I](){let e=this,t=null,n=null,r=null;return this.on(`error`,e=>{t=e}),this.on(`readable`,i),this.on(`close`,o),{[I](){return this},next(){return new Promise(function(t,i){n=t,r=i;let a=e.read();a===null?e._duplexState&8&&s(null):s(a)})},return(){return c(null)},throw(e){return c(e)}};function i(){n!==null&&s(e.read())}function o(){n!==null&&s(null)}function s(i){r!==null&&(t?r(t):i===null&&!(e._duplexState&f)?r(a.STREAM_DESTROYED()):n({value:i,done:i===null}),r=n=null)}function c(t){return e.destroy(t),new Promise((n,r)=>{if(e._duplexState&8)return n({value:void 0,done:!0});e.once(`close`,function(){t?r(t):n({value:void 0,done:!0})})})}}},pe=class extends H{constructor(e){super(e),this._duplexState|=16385,this._writableState=new ne(this,e),e&&(e.writev&&(this._writev=e.writev),e.write&&(this._write=e.write),e.final&&(this._final=e.final),e.eagerOpen&&this._writableState.updateNextTick())}cork(){this._duplexState|=ee}uncork(){this._duplexState&=k,this._writableState.updateNextTick()}_writev(e,t){t(null)}_write(e,t){this._writableState.autoBatch(e,t)}_final(e){e(null)}static isBackpressured(e){return(e._duplexState&146800654)!=0}static drained(e){if(e.destroyed)return Promise.resolve(!1);let t=e._writableState,n=(we(e)?Math.min(1,t.queue.length):t.queue.length)+(e._duplexState&67108864?1:0);return n===0?Promise.resolve(!0):(t.drains===null&&(t.drains=[]),new Promise(e=>{t.drains.push({writes:n,resolve:e})}))}write(e){return this._writableState.updateNextTick(),this._writableState.push(e)}end(e){return this._writableState.updateNextTick(),this._writableState.end(e),this}},U=class extends fe{constructor(e){super(e),this._duplexState=1|this._duplexState&g,this._writableState=new ne(this,e),e&&(e.writev&&(this._writev=e.writev),e.write&&(this._write=e.write),e.final&&(this._final=e.final))}cork(){this._duplexState|=ee}uncork(){this._duplexState&=k,this._writableState.updateNextTick()}_writev(e,t){t(null)}_write(e,t){this._writableState.autoBatch(e,t)}_final(e){e(null)}write(e){return this._writableState.updateNextTick(),this._writableState.push(e)}end(e){return this._writableState.updateNextTick(),this._writableState.end(e),this}},W=class extends U{constructor(e){super(e),this._transformState=new ie(this),e&&(e.transform&&(this._transform=e.transform),e.flush&&(this._flush=e.flush))}_write(e,t){this._readableState.buffered>=this._readableState.highWaterMark?this._transformState.data=e:this._transform(e,this._transformState.afterTransform)}_read(e){if(this._transformState.data!==null){let t=this._transformState.data;this._transformState.data=null,e(null),this._transform(t,this._transformState.afterTransform)}else e(null)}destroy(e){super.destroy(e),this._transformState.data!==null&&(this._transformState.data=null,this._transformState.afterTransform())}_transform(e,t){t(null,e)}_flush(e){e(null)}_final(e){this._transformState.afterFinal=e,this._flush(me.bind(this))}},G=class extends W{};function me(e,t){let n=this._transformState.afterFinal;if(e)return n(e);t!=null&&this.push(t),this.push(null),n(null)}function he(...e){return new Promise((t,n)=>K(...e,e=>{if(e)return n(e);t()}))}function K(e,...t){let n=Array.isArray(e)?[...e,...t]:[e,...t],r=n.length&&typeof n[n.length-1]==`function`?n.pop():null;if(n.length<2)throw a.BAD_ARGUMENT(`Pipeline requires at least 2 streams`);let i=n[0],o=null,s=null;for(let e=1;e<n.length;e++)o=n[e],J(i)?i.pipe(o,l):(c(i,!0,e>1,l),i.pipe(o)),i=o;if(r){let e=!1,t=J(o)||!!(o._writableState&&o._writableState.autoDestroy);o.on(`error`,e=>{s===null&&(s=e)}),o.on(`finish`,()=>{e=!0,t||r(s)}),t&&o.on(`close`,()=>r(s||(e?null:a.PREMATURE_CLOSE())))}return o;function c(e,t,n,r){e.on(`error`,r),e.on(`close`,i);function i(){if(t&&e._readableState&&!e._readableState.ended||n&&e._writableState&&!e._writableState.ended)return r(a.PREMATURE_CLOSE())}}function l(e){if(!(!e||s)){s=e;for(let t of n)t.destroy(e)}}}function ge(e){return e}function q(e){return!!e._readableState||!!e._writableState}function J(e){return typeof e._duplexState==`number`&&q(e)}function _e(e){return!!e._readableState&&e._readableState.ending}function ve(e){return!!e._readableState&&e._readableState.ended}function ye(e){return!!e._writableState&&e._writableState.ending}function be(e){return!!e._writableState&&e._writableState.ended}function xe(e,t={}){let n=e._readableState&&e._readableState.error||e._writableState&&e._writableState.error;return!t.all&&a.isStreamDestroyed(n)?null:n}function Se(e){return J(e)&&e.readable}function Y(e){return(e._duplexState&1)!=1||(e._duplexState&4)==4||(e._duplexState&M)!=0}function Ce(e){return typeof e==`object`&&!!e&&typeof e.byteLength==`number`}function X(e){return Ce(e)?e.byteLength:1024}function Z(){}function Q(){this.destroy(a.ABORTED())}function we(e){return e._writev!==pe.prototype._writev&&e._writev!==U.prototype._writev}t.exports={pipeline:K,pipelinePromise:he,isStream:q,isStreamx:J,isEnding:_e,isEnded:ve,isFinishing:ye,isFinished:be,isDisturbed:Y,getStreamError:xe,Stream:H,Writable:pe,Readable:fe,Duplex:U,Transform:W,PassThrough:G}})),_=n((e=>{let t=d(),n=t.from([117,115,116,97,114,0]),r=t.from([48,48]),i=t.from([117,115,116,97,114,32]),a=t.from([32,0]);e.decodeLongPath=function(e,t){return y(e,0,e.length,t)},e.encodePax=function(e){let n=``;e.name&&(n+=b(` path=`+e.name+`
|
|
2
|
-
`)),e.linkname&&(n+=b(` linkpath=`+e.linkname+`
|
|
3
|
-
`));let r=e.pax;if(r)for(let e in r)n+=b(` `+e+`=`+r[e]+`
|
|
4
|
-
`);return t.from(n)},e.decodePax=function(e){let n={};for(;e.length;){let r=0;for(;r<e.length&&e[r]!==32;)r++;let i=parseInt(t.toString(e.subarray(0,r)),10);if(!i)return n;let a=t.toString(e.subarray(r+1,i-1)),o=a.indexOf(`=`);if(o===-1)return n;n[a.slice(0,o)]=a.slice(o+1),e=e.subarray(i)}return n},e.encode=function(e){let i=t.alloc(512),a=e.name,o=``;if(e.typeflag===5&&a[a.length-1]!==`/`&&(a+=`/`),t.byteLength(a)!==a.length)return null;for(;t.byteLength(a)>100;){let e=a.indexOf(`/`);if(e===-1)return null;o+=o?`/`+a.slice(0,e):a.slice(0,e),a=a.slice(e+1)}return t.byteLength(a)>100||t.byteLength(o)>155||e.linkname&&t.byteLength(e.linkname)>100?null:(t.write(i,a),t.write(i,m(e.mode&4095,6),100),t.write(i,m(e.uid,6),108),t.write(i,m(e.gid,6),116),g(e.size,i,124),t.write(i,m(e.mtime.getTime()/1e3|0,11),136),i[156]=48+u(e.type),e.linkname&&t.write(i,e.linkname,157),t.copy(n,i,257),t.copy(r,i,263),e.uname&&t.write(i,e.uname,265),e.gname&&t.write(i,e.gname,297),t.write(i,m(e.devmajor||0,6),329),t.write(i,m(e.devminor||0,6),337),o&&t.write(i,o,345),t.write(i,m(p(i),6),148),i)},e.decode=function(e,t,n){let r=e[156]===0?0:e[156]-48,i=y(e,0,100,t),a=v(e,100,8),c=v(e,108,8),u=v(e,116,8),d=v(e,124,12),f=v(e,136,12),m=l(r),h=e[157]===0?null:y(e,157,100,t),g=y(e,265,32),_=y(e,297,32),b=v(e,329,8),x=v(e,337,8),S=p(e);if(S===256)return null;if(S!==v(e,148,8))throw Error(`Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?`);if(o(e))e[345]&&(i=y(e,345,155,t)+`/`+i);else if(!s(e)&&!n)throw Error(`Invalid tar header: unknown format.`);return r===0&&i&&i[i.length-1]===`/`&&(r=5),{name:i,mode:a,uid:c,gid:u,size:d,mtime:new Date(1e3*f),type:m,linkname:h,uname:g,gname:_,devmajor:b,devminor:x,pax:null}};function o(e){return t.equals(n,e.subarray(257,263))}function s(e){return t.equals(i,e.subarray(257,263))&&t.equals(a,e.subarray(263,265))}function c(e,t,n){return typeof e==`number`?(e=~~e,e>=t?t:e>=0||(e+=t,e>=0)?e:0):n}function l(e){switch(e){case 0:return`file`;case 1:return`link`;case 2:return`symlink`;case 3:return`character-device`;case 4:return`block-device`;case 5:return`directory`;case 6:return`fifo`;case 7:return`contiguous-file`;case 72:return`pax-header`;case 55:return`pax-global-header`;case 27:return`gnu-long-link-path`;case 28:case 30:return`gnu-long-path`}return null}function u(e){switch(e){case`file`:return 0;case`link`:return 1;case`symlink`:return 2;case`character-device`:return 3;case`block-device`:return 4;case`directory`:return 5;case`fifo`:return 6;case`contiguous-file`:return 7;case`pax-header`:return 72}return 0}function f(e,t,n,r){for(;n<r;n++)if(e[n]===t)return n;return r}function p(e){let t=256;for(let n=0;n<148;n++)t+=e[n];for(let n=156;n<512;n++)t+=e[n];return t}function m(e,t){return e=e.toString(8),e.length>t?`7777777777777777777`.slice(0,t)+` `:`0000000000000000000`.slice(0,t-e.length)+e+` `}function h(e,t,n){t[n]=128;for(let r=11;r>0;r--)t[n+r]=e&255,e=Math.floor(e/256)}function g(e,n,r){e.toString(8).length>11?h(e,n,r):t.write(n,m(e,11),r)}function _(e){let t;if(e[0]===128)t=!0;else if(e[0]===255)t=!1;else return null;let n=[],r;for(r=e.length-1;r>0;r--){let i=e[r];t?n.push(i):n.push(255-i)}let i=0,a=n.length;for(r=0;r<a;r++)i+=n[r]*256**r;return t?i:-1*i}function v(e,n,r){if(e=e.subarray(n,n+r),n=0,e[n]&128)return _(e);{for(;n<e.length&&e[n]===32;)n++;let r=c(f(e,32,n,e.length),e.length,e.length);for(;n<r&&e[n]===0;)n++;return r===n?0:parseInt(t.toString(e.subarray(n,r)),8)}}function y(e,n,r,i){return t.toString(e.subarray(n,f(e,0,n,n+r)),i)}function b(e){let n=t.byteLength(e),r=Math.floor(Math.log(n)/Math.log(10))+1;return n+r>=10**r&&r++,n+r+e}})),v=n(((e,t)=>{let{Writable:n,Readable:r,getStreamError:i}=g(),a=u(),o=d(),s=_(),c=o.alloc(0);var l=class{constructor(){this.buffered=0,this.shifted=0,this.queue=new a,this._offset=0}push(e){this.buffered+=e.byteLength,this.queue.push(e)}shiftFirst(e){return this._buffered===0?null:this._next(e)}shift(e){if(e>this.buffered)return null;if(e===0)return c;let t=this._next(e);if(e===t.byteLength)return t;let n=[t];for(;(e-=t.byteLength)>0;)t=this._next(e),n.push(t);return o.concat(n)}_next(e){let t=this.queue.peek(),n=t.byteLength-this._offset;if(e>=n){let e=this._offset?t.subarray(this._offset,t.byteLength):t;return this.queue.shift(),this._offset=0,this.buffered-=n,this.shifted+=n,e}return this.buffered-=e,this.shifted+=e,t.subarray(this._offset,this._offset+=e)}},f=class extends r{constructor(e,t,n){super(),this.header=t,this.offset=n,this._parent=e}_read(e){this.header.size===0&&this.push(null),this._parent._stream===this&&this._parent._update(),e(null)}_predestroy(){this._parent.destroy(i(this))}_detach(){this._parent._stream===this&&(this._parent._stream=null,this._parent._missing=h(this.header.size),this._parent._update())}_destroy(e){this._detach(),e(null)}},p=class extends n{constructor(e){super(e),e||={},this._buffer=new l,this._offset=0,this._header=null,this._stream=null,this._missing=0,this._longHeader=!1,this._callback=m,this._locked=!1,this._finished=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null,this._filenameEncoding=e.filenameEncoding||`utf-8`,this._allowUnknownFormat=!!e.allowUnknownFormat,this._unlockBound=this._unlock.bind(this)}_unlock(e){if(this._locked=!1,e){this.destroy(e),this._continueWrite(e);return}this._update()}_consumeHeader(){if(this._locked)return!1;this._offset=this._buffer.shifted;try{this._header=s.decode(this._buffer.shift(512),this._filenameEncoding,this._allowUnknownFormat)}catch(e){return this._continueWrite(e),!1}if(!this._header)return!0;switch(this._header.type){case`gnu-long-path`:case`gnu-long-link-path`:case`pax-global-header`:case`pax-header`:return this._longHeader=!0,this._missing=this._header.size,!0}return this._locked=!0,this._applyLongHeaders(),this._header.size===0||this._header.type===`directory`?(this.emit(`entry`,this._header,this._createStream(),this._unlockBound),!0):(this._stream=this._createStream(),this._missing=this._header.size,this.emit(`entry`,this._header,this._stream,this._unlockBound),!0)}_applyLongHeaders(){this._gnuLongPath&&=(this._header.name=this._gnuLongPath,null),this._gnuLongLinkPath&&=(this._header.linkname=this._gnuLongLinkPath,null),this._pax&&=(this._pax.path&&(this._header.name=this._pax.path),this._pax.linkpath&&(this._header.linkname=this._pax.linkpath),this._pax.size&&(this._header.size=parseInt(this._pax.size,10)),this._header.pax=this._pax,null)}_decodeLongHeader(e){switch(this._header.type){case`gnu-long-path`:this._gnuLongPath=s.decodeLongPath(e,this._filenameEncoding);break;case`gnu-long-link-path`:this._gnuLongLinkPath=s.decodeLongPath(e,this._filenameEncoding);break;case`pax-global-header`:this._paxGlobal=s.decodePax(e);break;case`pax-header`:this._pax=this._paxGlobal===null?s.decodePax(e):Object.assign({},this._paxGlobal,s.decodePax(e));break}}_consumeLongHeader(){this._longHeader=!1,this._missing=h(this._header.size);let e=this._buffer.shift(this._header.size);try{this._decodeLongHeader(e)}catch(e){return this._continueWrite(e),!1}return!0}_consumeStream(){let e=this._buffer.shiftFirst(this._missing);if(e===null)return!1;this._missing-=e.byteLength;let t=this._stream.push(e);return this._missing===0?(this._stream.push(null),t&&this._stream._detach(),t&&this._locked===!1):t}_createStream(){return new f(this,this._header,this._offset)}_update(){for(;this._buffer.buffered>0&&!this.destroying;){if(this._missing>0){if(this._stream!==null){if(this._consumeStream()===!1)return;continue}if(this._longHeader===!0){if(this._missing>this._buffer.buffered)break;if(this._consumeLongHeader()===!1)return!1;continue}let e=this._buffer.shiftFirst(this._missing);e!==null&&(this._missing-=e.byteLength);continue}if(this._buffer.buffered<512)break;if(this._stream!==null||this._consumeHeader()===!1)return}this._continueWrite(null)}_continueWrite(e){let t=this._callback;this._callback=m,t(e)}_write(e,t){this._callback=t,this._buffer.push(e),this._update()}_final(e){this._finished=this._missing===0&&this._buffer.buffered===0,e(this._finished?null:Error(`Unexpected end of data`))}_predestroy(){this._continueWrite(null)}_destroy(e){this._stream&&this._stream.destroy(i(this)),e(null)}[Symbol.asyncIterator](){let e=null,t=null,n=null,r=null,i=null,a=this;return this.on(`entry`,c),this.on(`error`,t=>{e=t}),this.on(`close`,l),{[Symbol.asyncIterator](){return this},next(){return new Promise(s)},return(){return u(null)},throw(e){return u(e)}};function o(e){if(!i)return;let t=i;i=null,t(e)}function s(i,s){if(e)return s(e);if(r){i({value:r,done:!1}),r=null;return}t=i,n=s,o(null),a._finished&&t&&(t({value:void 0,done:!0}),t=n=null)}function c(e,a,o){i=o,a.on(`error`,m),t?(t({value:a,done:!1}),t=n=null):r=a}function l(){o(e),t&&=(e?n(e):t({value:void 0,done:!0}),n=null)}function u(e){return a.destroy(e),o(e),new Promise((t,n)=>{if(a.destroyed)return t({value:void 0,done:!0});a.once(`close`,function(){e?n(e):t({value:void 0,done:!0})})})}}};t.exports=function(e){return new p(e)};function m(){}function h(e){return e&=511,e&&512-e}})),y=n(((t,n)=>{let r={S_IFMT:61440,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960};try{n.exports=e(`fs`).constants||r}catch{n.exports=r}})),b=n(((e,t)=>{let{Readable:n,Writable:r,getStreamError:i}=g(),a=d(),o=y(),s=_(),c=a.alloc(1024);var l=class extends r{constructor(e,t,n){super({mapWritable:h,eagerOpen:!0}),this.written=0,this.header=t,this._callback=n,this._linkname=null,this._isLinkname=t.type===`symlink`&&!t.linkname,this._isVoid=t.type!==`file`&&t.type!==`contiguous-file`,this._finished=!1,this._pack=e,this._openCallback=null,this._pack._stream===null?this._pack._stream=this:this._pack._pending.push(this)}_open(e){this._openCallback=e,this._pack._stream===this&&this._continueOpen()}_continuePack(e){if(this._callback===null)return;let t=this._callback;this._callback=null,t(e)}_continueOpen(){this._pack._stream===null&&(this._pack._stream=this);let e=this._openCallback;if(this._openCallback=null,e!==null){if(this._pack.destroying)return e(Error(`pack stream destroyed`));if(this._pack._finalized)return e(Error(`pack stream is already finalized`));this._pack._stream=this,this._isLinkname||this._pack._encode(this.header),this._isVoid&&(this._finish(),this._continuePack(null)),e(null)}}_write(e,t){if(this._isLinkname)return this._linkname=this._linkname?a.concat([this._linkname,e]):e,t(null);if(this._isVoid)return e.byteLength>0?t(Error(`No body allowed for this entry`)):t();if(this.written+=e.byteLength,this._pack.push(e))return t();this._pack._drain=t}_finish(){this._finished||(this._finished=!0,this._isLinkname&&(this.header.linkname=this._linkname?a.toString(this._linkname,`utf-8`):``,this._pack._encode(this.header)),m(this._pack,this.header.size),this._pack._done(this))}_final(e){if(this.written!==this.header.size)return e(Error(`Size mismatch`));this._finish(),e(null)}_getError(){return i(this)||Error(`tar entry destroyed`)}_predestroy(){this._pack.destroy(this._getError())}_destroy(e){this._pack._done(this),this._continuePack(this._finished?null:this._getError()),e()}},u=class extends n{constructor(e){super(e),this._drain=p,this._finalized=!1,this._finalizing=!1,this._pending=[],this._stream=null}entry(e,t,n){if(this._finalized||this.destroying)throw Error(`already finalized or destroyed`);typeof t==`function`&&(n=t,t=null),n||=p,(!e.size||e.type===`symlink`)&&(e.size=0),e.type||=f(e.mode),e.mode||=e.type===`directory`?493:420,e.uid||=0,e.gid||=0,e.mtime||=new Date,typeof t==`string`&&(t=a.from(t));let r=new l(this,e,n);return a.isBuffer(t)?(e.size=t.byteLength,r.write(t),r.end(),r):(r._isVoid,r)}finalize(){if(this._stream||this._pending.length>0){this._finalizing=!0;return}this._finalized||(this._finalized=!0,this.push(c),this.push(null))}_done(e){e===this._stream&&(this._stream=null,this._finalizing&&this.finalize(),this._pending.length&&this._pending.shift()._continueOpen())}_encode(e){if(!e.pax){let t=s.encode(e);if(t){this.push(t);return}}this._encodePax(e)}_encodePax(e){let t=s.encodePax({name:e.name,linkname:e.linkname,pax:e.pax}),n={name:`PaxHeader`,mode:e.mode,uid:e.uid,gid:e.gid,size:t.byteLength,mtime:e.mtime,type:`pax-header`,linkname:e.linkname&&`PaxHeader`,uname:e.uname,gname:e.gname,devmajor:e.devmajor,devminor:e.devminor};this.push(s.encode(n)),this.push(t),m(this,t.byteLength),n.size=e.size,n.type=e.type,this.push(s.encode(n))}_doDrain(){let e=this._drain;this._drain=p,e()}_predestroy(){let e=i(this);for(this._stream&&this._stream.destroy(e);this._pending.length;){let t=this._pending.shift();t.destroy(e),t._continueOpen()}this._doDrain()}_read(e){this._doDrain(),e()}};t.exports=function(e){return new u(e)};function f(e){switch(e&o.S_IFMT){case o.S_IFBLK:return`block-device`;case o.S_IFCHR:return`character-device`;case o.S_IFDIR:return`directory`;case o.S_IFIFO:return`fifo`;case o.S_IFLNK:return`symlink`}return`file`}function p(){}function m(e,t){t&=511,t&&e.push(c.subarray(0,512-t))}function h(e){return a.isBuffer(e)?e:a.from(e)}})),x=n((e=>{e.extract=v(),e.pack=b()})),S=n(((t,n)=>{var r=e(`stream`).Transform;function i(e){if(!(this instanceof i))throw TypeError(`Cannot call a class as a function`);e||={},r.call(this,{objectMode:!0}),this._memory=``,this._emitInvalidLines=e.emitInvalidLines||!1}i.prototype=Object.create(r.prototype),i.prototype._handleLines=function(e,t){for(var n=0;n<e.length;n++)if(e[n]!==``){var r=null,i=null;try{i=JSON.parse(e[n])}catch(t){t.source=e[n],r=t}if(r)if(this._emitInvalidLines)this.emit(`invalid-line`,r);else return t(r);else this.push(i)}t(null)},i.prototype._transform=function(e,t,n){var r=(this._memory+e.toString()).split(`
|
|
5
|
-
`);this._memory=r.pop(),this._handleLines(r,n)},i.prototype._flush=function(e){if(!this._memory)return e(null);var t=this._memory;this._memory=``,this._handleLines([t],e)},n.exports=i})),C=n(((t,n)=>{var r=e(`stream`).Transform;function i(){if(!(this instanceof i))throw TypeError(`Cannot call a class as a function`);r.call(this,{objectMode:!0})}i.prototype=Object.create(r.prototype),i.prototype._transform=function(e,t,n){var r;try{r=JSON.stringify(e)}catch(t){return t.source=e,n(t)}n(null,r+`
|
|
6
|
-
`)},n.exports=i})),w=n((e=>{var t=S();C(),e.parse=function(e){return new t(e)}})),T=n(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{SYMBOL_FOR_REQ_CONTEXT:()=>u,getContext:()=>d}),t.exports=c(l);let u=Symbol.for(`@vercel/request-context`);function d(){return globalThis[u]?.get?.()??{}}0&&(t.exports={SYMBOL_FOR_REQ_CONTEXT:u,getContext:d})})),E=n(((e,n)=>{var r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,c=(e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})},l=(e,t,n,a)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of o(t))!s.call(e,c)&&c!==n&&r(e,c,{get:()=>t[c],enumerable:!(a=i(t,c))||a.enumerable});return e},u=e=>l(r({},`__esModule`,{value:!0}),e),d={};c(d,{getVercelOidcToken:()=>m,getVercelOidcTokenSync:()=>h}),n.exports=u(d);var f=T(),p=a();async function m(e){let n=``,r;try{n=h()}catch(e){r=e}try{let[{getTokenPayload:r,isExpired:i},{refreshToken:a}]=await Promise.all([await import(`./token-util-ivUGWb31.js`).then(e=>t(e.default)),await import(`./token-DHD-q-fS.js`).then(e=>t(e.default))]);(!n||i(r(n),e?.expirationBufferMs))&&(await a(e),n=h())}catch(e){let t=r instanceof Error?r.message:``;throw e instanceof Error&&(t=`${t}
|
|
7
|
-
${e.message}`),t?new p.VercelOidcTokenError(t):e}return n}function h(){let e=(0,f.getContext)().headers?.[`x-vercel-oidc-token`]??process.env.VERCEL_OIDC_TOKEN;if(!e)throw Error(`The 'x-vercel-oidc-token' header is missing from the request. Do you have the OIDC option enabled in the Vercel project settings?`);return e}0&&(n.exports={getVercelOidcToken:m,getVercelOidcTokenSync:h})})),D=n(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,c=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},l=(e,t,i,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!s.call(e,c)&&c!==i&&n(e,c,{get:()=>t[c],enumerable:!(o=r(t,c))||o.enumerable});return e},u=e=>l(n({},`__esModule`,{value:!0}),e),d={};c(d,{AccessTokenMissingError:()=>m.AccessTokenMissingError,RefreshAccessTokenFailedError:()=>m.RefreshAccessTokenFailedError,getContext:()=>p.getContext,getVercelOidcToken:()=>f.getVercelOidcToken,getVercelOidcTokenSync:()=>f.getVercelOidcTokenSync,getVercelToken:()=>h.getVercelToken}),t.exports=u(d);var f=E(),p=T(),m=i(),h=o();0&&(t.exports={AccessTokenMissingError,RefreshAccessTokenFailedError,getContext,getVercelOidcToken,getVercelOidcTokenSync,getVercelToken})})),ee=n(((e,t)=>{let n=process||{},r=n.argv||[],i=n.env||{},a=!(i.NO_COLOR||r.includes(`--no-color`))&&(!!i.FORCE_COLOR||r.includes(`--color`)||n.platform===`win32`||(n.stdout||{}).isTTY&&i.TERM!==`dumb`||!!i.CI),o=(e,t,n=e)=>r=>{let i=``+r,a=i.indexOf(t,e.length);return~a?e+s(i,t,n,a)+t:e+i+t},s=(e,t,n,r)=>{let i=``,a=0;do i+=e.substring(a,r)+n,a=r+t.length,r=e.indexOf(t,a);while(~r);return i+e.substring(a)},c=(e=a)=>{let t=e?o:()=>String;return{isColorSupported:e,reset:t(`\x1B[0m`,`\x1B[0m`),bold:t(`\x1B[1m`,`\x1B[22m`,`\x1B[22m\x1B[1m`),dim:t(`\x1B[2m`,`\x1B[22m`,`\x1B[22m\x1B[2m`),italic:t(`\x1B[3m`,`\x1B[23m`),underline:t(`\x1B[4m`,`\x1B[24m`),inverse:t(`\x1B[7m`,`\x1B[27m`),hidden:t(`\x1B[8m`,`\x1B[28m`),strikethrough:t(`\x1B[9m`,`\x1B[29m`),black:t(`\x1B[30m`,`\x1B[39m`),red:t(`\x1B[31m`,`\x1B[39m`),green:t(`\x1B[32m`,`\x1B[39m`),yellow:t(`\x1B[33m`,`\x1B[39m`),blue:t(`\x1B[34m`,`\x1B[39m`),magenta:t(`\x1B[35m`,`\x1B[39m`),cyan:t(`\x1B[36m`,`\x1B[39m`),white:t(`\x1B[37m`,`\x1B[39m`),gray:t(`\x1B[90m`,`\x1B[39m`),bgBlack:t(`\x1B[40m`,`\x1B[49m`),bgRed:t(`\x1B[41m`,`\x1B[49m`),bgGreen:t(`\x1B[42m`,`\x1B[49m`),bgYellow:t(`\x1B[43m`,`\x1B[49m`),bgBlue:t(`\x1B[44m`,`\x1B[49m`),bgMagenta:t(`\x1B[45m`,`\x1B[49m`),bgCyan:t(`\x1B[46m`,`\x1B[49m`),bgWhite:t(`\x1B[47m`,`\x1B[49m`),blackBright:t(`\x1B[90m`,`\x1B[39m`),redBright:t(`\x1B[91m`,`\x1B[39m`),greenBright:t(`\x1B[92m`,`\x1B[39m`),yellowBright:t(`\x1B[93m`,`\x1B[39m`),blueBright:t(`\x1B[94m`,`\x1B[39m`),magentaBright:t(`\x1B[95m`,`\x1B[39m`),cyanBright:t(`\x1B[96m`,`\x1B[39m`),whiteBright:t(`\x1B[97m`,`\x1B[39m`),bgBlackBright:t(`\x1B[100m`,`\x1B[49m`),bgRedBright:t(`\x1B[101m`,`\x1B[49m`),bgGreenBright:t(`\x1B[102m`,`\x1B[49m`),bgYellowBright:t(`\x1B[103m`,`\x1B[49m`),bgBlueBright:t(`\x1B[104m`,`\x1B[49m`),bgMagentaBright:t(`\x1B[105m`,`\x1B[49m`),bgCyanBright:t(`\x1B[106m`,`\x1B[49m`),bgWhiteBright:t(`\x1B[107m`,`\x1B[49m`)}};t.exports=c(),t.exports.createColors=c}));const O=new TextEncoder,k=new TextDecoder;function A(...e){let t=e.reduce((e,{length:t})=>e+t,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function j(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r>127)throw TypeError(`non-ASCII string encountered in encode()`);t[n]=r}return t}function te(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function M(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(typeof e==`string`?e:k.decode(e),{alphabet:`base64url`});let t=e;t instanceof Uint8Array&&(t=k.decode(t)),t=t.replace(/-/g,`+`).replace(/_/g,`/`);try{return te(t)}catch{throw TypeError(`The input to be decoded is not correctly encoded.`)}}const N=(e,t=`algorithm.name`)=>TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`),P=(e,t)=>e.name===t;function F(e){return parseInt(e.name.slice(4),10)}function I(e,t){if(F(e.hash)!==t)throw N(`SHA-${t}`,`algorithm.hash`)}function ne(e){switch(e){case`ES256`:return`P-256`;case`ES384`:return`P-384`;case`ES512`:return`P-521`;default:throw Error(`unreachable`)}}function re(e,t){if(t&&!e.usages.includes(t))throw TypeError(`CryptoKey does not support this operation, its usages must include ${t}.`)}function ie(e,t,n){switch(t){case`HS256`:case`HS384`:case`HS512`:if(!P(e.algorithm,`HMAC`))throw N(`HMAC`);I(e.algorithm,parseInt(t.slice(2),10));break;case`RS256`:case`RS384`:case`RS512`:if(!P(e.algorithm,`RSASSA-PKCS1-v1_5`))throw N(`RSASSA-PKCS1-v1_5`);I(e.algorithm,parseInt(t.slice(2),10));break;case`PS256`:case`PS384`:case`PS512`:if(!P(e.algorithm,`RSA-PSS`))throw N(`RSA-PSS`);I(e.algorithm,parseInt(t.slice(2),10));break;case`Ed25519`:case`EdDSA`:if(!P(e.algorithm,`Ed25519`))throw N(`Ed25519`);break;case`ML-DSA-44`:case`ML-DSA-65`:case`ML-DSA-87`:if(!P(e.algorithm,t))throw N(t);break;case`ES256`:case`ES384`:case`ES512`:{if(!P(e.algorithm,`ECDSA`))throw N(`ECDSA`);let n=ne(t);if(e.algorithm.namedCurve!==n)throw N(n,`algorithm.namedCurve`);break}default:throw TypeError(`CryptoKey does not support this operation`)}re(e,n)}function ae(e,t,...n){if(n=n.filter(Boolean),n.length>2){let t=n.pop();e+=`one of type ${n.join(`, `)}, or ${t}.`}else n.length===2?e+=`one of type ${n[0]} or ${n[1]}.`:e+=`of type ${n[0]}.`;return t==null?e+=` Received ${t}`:typeof t==`function`&&t.name?e+=` Received function ${t.name}`:typeof t==`object`&&t&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}const oe=(e,...t)=>ae(`Key must be `,e,...t),se=(e,t,...n)=>ae(`Key for the ${e} algorithm must be `,t,...n);var L=class extends Error{static code=`ERR_JOSE_GENERIC`;code=`ERR_JOSE_GENERIC`;constructor(e,t){super(e,t),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},R=class extends L{static code=`ERR_JWT_CLAIM_VALIDATION_FAILED`;code=`ERR_JWT_CLAIM_VALIDATION_FAILED`;claim;reason;payload;constructor(e,t,n=`unspecified`,r=`unspecified`){super(e,{cause:{claim:n,reason:r,payload:t}}),this.claim=n,this.reason=r,this.payload=t}},ce=class extends L{static code=`ERR_JWT_EXPIRED`;code=`ERR_JWT_EXPIRED`;claim;reason;payload;constructor(e,t,n=`unspecified`,r=`unspecified`){super(e,{cause:{claim:n,reason:r,payload:t}}),this.claim=n,this.reason=r,this.payload=t}},le=class extends L{static code=`ERR_JOSE_ALG_NOT_ALLOWED`;code=`ERR_JOSE_ALG_NOT_ALLOWED`},z=class extends L{static code=`ERR_JOSE_NOT_SUPPORTED`;code=`ERR_JOSE_NOT_SUPPORTED`},B=class extends L{static code=`ERR_JWS_INVALID`;code=`ERR_JWS_INVALID`},V=class extends L{static code=`ERR_JWT_INVALID`;code=`ERR_JWT_INVALID`},ue=class extends L{static code=`ERR_JWKS_INVALID`;code=`ERR_JWKS_INVALID`},de=class extends L{static code=`ERR_JWKS_NO_MATCHING_KEY`;code=`ERR_JWKS_NO_MATCHING_KEY`;constructor(e=`no applicable key found in the JSON Web Key Set`,t){super(e,t)}},H=class extends L{[Symbol.asyncIterator];static code=`ERR_JWKS_MULTIPLE_MATCHING_KEYS`;code=`ERR_JWKS_MULTIPLE_MATCHING_KEYS`;constructor(e=`multiple matching keys found in the JSON Web Key Set`,t){super(e,t)}},fe=class extends L{static code=`ERR_JWKS_TIMEOUT`;code=`ERR_JWKS_TIMEOUT`;constructor(e=`request timed out`,t){super(e,t)}},pe=class extends L{static code=`ERR_JWS_SIGNATURE_VERIFICATION_FAILED`;code=`ERR_JWS_SIGNATURE_VERIFICATION_FAILED`;constructor(e=`signature verification failed`,t){super(e,t)}};const U=e=>{if(e?.[Symbol.toStringTag]===`CryptoKey`)return!0;try{return e instanceof CryptoKey}catch{return!1}},W=e=>e?.[Symbol.toStringTag]===`KeyObject`,G=e=>U(e)||W(e);function me(e,t,n){try{return M(e)}catch{throw new n(`Failed to base64url decode the ${t}`)}}const he=e=>typeof e==`object`&&!!e;function K(e){if(!he(e)||Object.prototype.toString.call(e)!==`[object Object]`)return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function ge(...e){let t=e.filter(Boolean);if(t.length===0||t.length===1)return!0;let n;for(let e of t){let t=Object.keys(e);if(!n||n.size===0){n=new Set(t);continue}for(let e of t){if(n.has(e))return!1;n.add(e)}}return!0}const q=e=>K(e)&&typeof e.kty==`string`,J=e=>e.kty!==`oct`&&(e.kty===`AKP`&&typeof e.priv==`string`||typeof e.d==`string`),_e=e=>e.kty!==`oct`&&e.d===void 0&&e.priv===void 0,ve=e=>e.kty===`oct`&&typeof e.k==`string`;function ye(e,t){if(e.startsWith(`RS`)||e.startsWith(`PS`)){let{modulusLength:n}=t.algorithm;if(typeof n!=`number`||n<2048)throw TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}}function be(e,t){let n=`SHA-${e.slice(-3)}`;switch(e){case`HS256`:case`HS384`:case`HS512`:return{hash:n,name:`HMAC`};case`PS256`:case`PS384`:case`PS512`:return{hash:n,name:`RSA-PSS`,saltLength:parseInt(e.slice(-3),10)>>3};case`RS256`:case`RS384`:case`RS512`:return{hash:n,name:`RSASSA-PKCS1-v1_5`};case`ES256`:case`ES384`:case`ES512`:return{hash:n,name:`ECDSA`,namedCurve:t.namedCurve};case`Ed25519`:case`EdDSA`:return{name:`Ed25519`};case`ML-DSA-44`:case`ML-DSA-65`:case`ML-DSA-87`:return{name:e};default:throw new z(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}async function xe(e,t,n){if(t instanceof Uint8Array){if(!e.startsWith(`HS`))throw TypeError(oe(t,`CryptoKey`,`KeyObject`,`JSON Web Key`));return crypto.subtle.importKey(`raw`,t,{hash:`SHA-${e.slice(-3)}`,name:`HMAC`},!1,[n])}return ie(t,e,n),t}async function Se(e,t,n,r){let i=await xe(e,t,`verify`);ye(e,i);let a=be(e,i.algorithm);try{return await crypto.subtle.verify(a,i,n,r)}catch{return!1}}const Y=`Invalid or unsupported JWK "alg" (Algorithm) Parameter value`;function Ce(e){let t,n;switch(e.kty){case`AKP`:switch(e.alg){case`ML-DSA-44`:case`ML-DSA-65`:case`ML-DSA-87`:t={name:e.alg},n=e.priv?[`sign`]:[`verify`];break;default:throw new z(Y)}break;case`RSA`:switch(e.alg){case`PS256`:case`PS384`:case`PS512`:t={name:`RSA-PSS`,hash:`SHA-${e.alg.slice(-3)}`},n=e.d?[`sign`]:[`verify`];break;case`RS256`:case`RS384`:case`RS512`:t={name:`RSASSA-PKCS1-v1_5`,hash:`SHA-${e.alg.slice(-3)}`},n=e.d?[`sign`]:[`verify`];break;case`RSA-OAEP`:case`RSA-OAEP-256`:case`RSA-OAEP-384`:case`RSA-OAEP-512`:t={name:`RSA-OAEP`,hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},n=e.d?[`decrypt`,`unwrapKey`]:[`encrypt`,`wrapKey`];break;default:throw new z(Y)}break;case`EC`:switch(e.alg){case`ES256`:case`ES384`:case`ES512`:t={name:`ECDSA`,namedCurve:{ES256:`P-256`,ES384:`P-384`,ES512:`P-521`}[e.alg]},n=e.d?[`sign`]:[`verify`];break;case`ECDH-ES`:case`ECDH-ES+A128KW`:case`ECDH-ES+A192KW`:case`ECDH-ES+A256KW`:t={name:`ECDH`,namedCurve:e.crv},n=e.d?[`deriveBits`]:[];break;default:throw new z(Y)}break;case`OKP`:switch(e.alg){case`Ed25519`:case`EdDSA`:t={name:`Ed25519`},n=e.d?[`sign`]:[`verify`];break;case`ECDH-ES`:case`ECDH-ES+A128KW`:case`ECDH-ES+A192KW`:case`ECDH-ES+A256KW`:t={name:e.crv},n=e.d?[`deriveBits`]:[];break;default:throw new z(Y)}break;default:throw new z(`Invalid or unsupported JWK "kty" (Key Type) Parameter value`)}return{algorithm:t,keyUsages:n}}async function X(e){if(!e.alg)throw TypeError(`"alg" argument is required when "jwk.alg" is not present`);let{algorithm:t,keyUsages:n}=Ce(e),r={...e};return r.kty!==`AKP`&&delete r.alg,delete r.use,crypto.subtle.importKey(`jwk`,r,t,e.ext??!(e.d||e.priv),e.key_ops??n)}const Z=`given KeyObject instance cannot be used for this algorithm`;let Q;const we=async(e,t,n,r=!1)=>{Q||=new WeakMap;let i=Q.get(e);if(i?.[n])return i[n];let a=await X({...t,alg:n});return r&&Object.freeze(e),i?i[n]=a:Q.set(e,{[n]:a}),a},Te=(e,t)=>{Q||=new WeakMap;let n=Q.get(e);if(n?.[t])return n[t];let r=e.type===`public`,i=!!r,a;if(e.asymmetricKeyType===`x25519`){switch(t){case`ECDH-ES`:case`ECDH-ES+A128KW`:case`ECDH-ES+A192KW`:case`ECDH-ES+A256KW`:break;default:throw TypeError(Z)}a=e.toCryptoKey(e.asymmetricKeyType,i,r?[]:[`deriveBits`])}if(e.asymmetricKeyType===`ed25519`){if(t!==`EdDSA`&&t!==`Ed25519`)throw TypeError(Z);a=e.toCryptoKey(e.asymmetricKeyType,i,[r?`verify`:`sign`])}switch(e.asymmetricKeyType){case`ml-dsa-44`:case`ml-dsa-65`:case`ml-dsa-87`:if(t!==e.asymmetricKeyType.toUpperCase())throw TypeError(Z);a=e.toCryptoKey(e.asymmetricKeyType,i,[r?`verify`:`sign`])}if(e.asymmetricKeyType===`rsa`){let n;switch(t){case`RSA-OAEP`:n=`SHA-1`;break;case`RS256`:case`PS256`:case`RSA-OAEP-256`:n=`SHA-256`;break;case`RS384`:case`PS384`:case`RSA-OAEP-384`:n=`SHA-384`;break;case`RS512`:case`PS512`:case`RSA-OAEP-512`:n=`SHA-512`;break;default:throw TypeError(Z)}if(t.startsWith(`RSA-OAEP`))return e.toCryptoKey({name:`RSA-OAEP`,hash:n},i,r?[`encrypt`]:[`decrypt`]);a=e.toCryptoKey({name:t.startsWith(`PS`)?`RSA-PSS`:`RSASSA-PKCS1-v1_5`,hash:n},i,[r?`verify`:`sign`])}if(e.asymmetricKeyType===`ec`){let n=new Map([[`prime256v1`,`P-256`],[`secp384r1`,`P-384`],[`secp521r1`,`P-521`]]).get(e.asymmetricKeyDetails?.namedCurve);if(!n)throw TypeError(Z);let o={ES256:`P-256`,ES384:`P-384`,ES512:`P-521`};o[t]&&n===o[t]&&(a=e.toCryptoKey({name:`ECDSA`,namedCurve:n},i,[r?`verify`:`sign`])),t.startsWith(`ECDH-ES`)&&(a=e.toCryptoKey({name:`ECDH`,namedCurve:n},i,r?[]:[`deriveBits`]))}if(!a)throw TypeError(Z);return n?n[t]=a:Q.set(e,{[t]:a}),a};async function Ee(e,t){if(e instanceof Uint8Array||U(e))return e;if(W(e)){if(e.type===`secret`)return e.export();if(`toCryptoKey`in e&&typeof e.toCryptoKey==`function`)try{return Te(e,t)}catch(e){if(e instanceof TypeError)throw e}let n=e.export({format:`jwk`});return we(e,n,t)}if(q(e))return e.k?M(e.k):we(e,e,t,!0);throw Error(`unreachable`)}async function De(e,t,n){if(!K(e))throw TypeError(`JWK must be an object`);let r;switch(t??=e.alg,r??=n?.extractable??e.ext,e.kty){case`oct`:if(typeof e.k!=`string`||!e.k)throw TypeError(`missing "k" (Key Value) Parameter value`);return M(e.k);case`RSA`:if(`oth`in e&&e.oth!==void 0)throw new z(`RSA JWK "oth" (Other Primes Info) Parameter value is not supported`);return X({...e,alg:t,ext:r});case`AKP`:if(typeof e.alg!=`string`||!e.alg)throw TypeError(`missing "alg" (Algorithm) Parameter value`);if(t!==void 0&&t!==e.alg)throw TypeError(`JWK alg and alg option value mismatch`);return X({...e,ext:r});case`EC`:case`OKP`:return X({...e,alg:t,ext:r});default:throw new z(`Unsupported "kty" (Key Type) Parameter value`)}}function Oe(e,t,n,r,i){if(i.crit!==void 0&&r?.crit===void 0)throw new e(`"crit" (Critical) Header Parameter MUST be integrity protected`);if(!r||r.crit===void 0)return new Set;if(!Array.isArray(r.crit)||r.crit.length===0||r.crit.some(e=>typeof e!=`string`||e.length===0))throw new e(`"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present`);let a;a=n===void 0?t:new Map([...Object.entries(n),...t.entries()]);for(let t of r.crit){if(!a.has(t))throw new z(`Extension Header Parameter "${t}" is not recognized`);if(i[t]===void 0)throw new e(`Extension Header Parameter "${t}" is missing`);if(a.get(t)&&r[t]===void 0)throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(r.crit)}function ke(e,t){if(t!==void 0&&(!Array.isArray(t)||t.some(e=>typeof e!=`string`)))throw TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)}const $=e=>e?.[Symbol.toStringTag],Ae=(e,t,n)=>{if(t.use!==void 0){let e;switch(n){case`sign`:case`verify`:e=`sig`;break;case`encrypt`:case`decrypt`:e=`enc`;break}if(t.use!==e)throw TypeError(`Invalid key for this operation, its "use" must be "${e}" when present`)}if(t.alg!==void 0&&t.alg!==e)throw TypeError(`Invalid key for this operation, its "alg" must be "${e}" when present`);if(Array.isArray(t.key_ops)){let r;switch(!0){case n===`sign`||n===`verify`:case e===`dir`:case e.includes(`CBC-HS`):r=n;break;case e.startsWith(`PBES2`):r=`deriveBits`;break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(e):r=!e.includes(`GCM`)&&e.endsWith(`KW`)?n===`encrypt`?`wrapKey`:`unwrapKey`:n;break;case n===`encrypt`&&e.startsWith(`RSA`):r=`wrapKey`;break;case n===`decrypt`:r=e.startsWith(`RSA`)?`unwrapKey`:`deriveBits`;break}if(r&&t.key_ops?.includes?.(r)===!1)throw TypeError(`Invalid key for this operation, its "key_ops" must include "${r}" when present`)}return!0},je=(e,t,n)=>{if(!(t instanceof Uint8Array)){if(q(t)){if(ve(t)&&Ae(e,t,n))return;throw TypeError(`JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present`)}if(!G(t))throw TypeError(se(e,t,`CryptoKey`,`KeyObject`,`JSON Web Key`,`Uint8Array`));if(t.type!==`secret`)throw TypeError(`${$(t)} instances for symmetric algorithms must be of type "secret"`)}},Me=(e,t,n)=>{if(q(t))switch(n){case`decrypt`:case`sign`:if(J(t)&&Ae(e,t,n))return;throw TypeError(`JSON Web Key for this operation must be a private JWK`);case`encrypt`:case`verify`:if(_e(t)&&Ae(e,t,n))return;throw TypeError(`JSON Web Key for this operation must be a public JWK`)}if(!G(t))throw TypeError(se(e,t,`CryptoKey`,`KeyObject`,`JSON Web Key`));if(t.type===`secret`)throw TypeError(`${$(t)} instances for asymmetric algorithms must not be of type "secret"`);if(t.type===`public`)switch(n){case`sign`:throw TypeError(`${$(t)} instances for asymmetric algorithm signing must be of type "private"`);case`decrypt`:throw TypeError(`${$(t)} instances for asymmetric algorithm decryption must be of type "private"`)}if(t.type===`private`)switch(n){case`verify`:throw TypeError(`${$(t)} instances for asymmetric algorithm verifying must be of type "public"`);case`encrypt`:throw TypeError(`${$(t)} instances for asymmetric algorithm encryption must be of type "public"`)}};function Ne(e,t,n){switch(e.substring(0,2)){case`A1`:case`A2`:case`di`:case`HS`:case`PB`:je(e,t,n);break;default:Me(e,t,n)}}async function Pe(e,t,n){if(!K(e))throw new B(`Flattened JWS must be an object`);if(e.protected===void 0&&e.header===void 0)throw new B(`Flattened JWS must have either of the "protected" or "header" members`);if(e.protected!==void 0&&typeof e.protected!=`string`)throw new B(`JWS Protected Header incorrect type`);if(e.payload===void 0)throw new B(`JWS Payload missing`);if(typeof e.signature!=`string`)throw new B(`JWS Signature missing or incorrect type`);if(e.header!==void 0&&!K(e.header))throw new B(`JWS Unprotected Header incorrect type`);let r={};if(e.protected)try{let t=M(e.protected);r=JSON.parse(k.decode(t))}catch{throw new B(`JWS Protected Header is invalid`)}if(!ge(r,e.header))throw new B(`JWS Protected and JWS Unprotected Header Parameter names must be disjoint`);let i={...r,...e.header},a=Oe(B,new Map([[`b64`,!0]]),n?.crit,r,i),o=!0;if(a.has(`b64`)&&(o=r.b64,typeof o!=`boolean`))throw new B(`The "b64" (base64url-encode payload) Header Parameter must be a boolean`);let{alg:s}=i;if(typeof s!=`string`||!s)throw new B(`JWS "alg" (Algorithm) Header Parameter missing or invalid`);let c=n&&ke(`algorithms`,n.algorithms);if(c&&!c.has(s))throw new le(`"alg" (Algorithm) Header Parameter value not allowed`);if(o){if(typeof e.payload!=`string`)throw new B(`JWS Payload must be a string`)}else if(typeof e.payload!=`string`&&!(e.payload instanceof Uint8Array))throw new B(`JWS Payload must be a string or an Uint8Array instance`);let l=!1;typeof t==`function`&&(t=await t(r,e),l=!0),Ne(s,t,`verify`);let u=A(e.protected===void 0?new Uint8Array:j(e.protected),j(`.`),typeof e.payload==`string`?o?j(e.payload):O.encode(e.payload):e.payload),d=me(e.signature,`signature`,B),f=await Ee(t,s);if(!await Se(s,f,d,u))throw new pe;let p;p=o?me(e.payload,`payload`,B):typeof e.payload==`string`?O.encode(e.payload):e.payload;let m={payload:p};return e.protected!==void 0&&(m.protectedHeader=r),e.header!==void 0&&(m.unprotectedHeader=e.header),l?{...m,key:f}:m}async function Fe(e,t,n){if(e instanceof Uint8Array&&(e=k.decode(e)),typeof e!=`string`)throw new B(`Compact JWS must be a string or Uint8Array`);let{0:r,1:i,2:a,length:o}=e.split(`.`);if(o!==3)throw new B(`Invalid Compact JWS`);let s=await Pe({payload:i,protected:r,signature:a},t,n),c={payload:s.payload,protectedHeader:s.protectedHeader};return typeof t==`function`?{...c,key:s.key}:c}const Ie=e=>Math.floor(e.getTime()/1e3),Le=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function Re(e){let t=Le.exec(e);if(!t||t[4]&&t[1])throw TypeError(`Invalid time period format`);let n=parseFloat(t[2]),r=t[3].toLowerCase(),i;switch(r){case`sec`:case`secs`:case`second`:case`seconds`:case`s`:i=Math.round(n);break;case`minute`:case`minutes`:case`min`:case`mins`:case`m`:i=Math.round(n*60);break;case`hour`:case`hours`:case`hr`:case`hrs`:case`h`:i=Math.round(n*3600);break;case`day`:case`days`:case`d`:i=Math.round(n*86400);break;case`week`:case`weeks`:case`w`:i=Math.round(n*604800);break;default:i=Math.round(n*31557600);break}return t[1]===`-`||t[4]===`ago`?-i:i}const ze=e=>e.includes(`/`)?e.toLowerCase():`application/${e.toLowerCase()}`,Be=(e,t)=>typeof e==`string`?t.includes(e):Array.isArray(e)?t.some(Set.prototype.has.bind(new Set(e))):!1;function Ve(e,t,n={}){let r;try{r=JSON.parse(k.decode(t))}catch{}if(!K(r))throw new V(`JWT Claims Set must be a top-level JSON object`);let{typ:i}=n;if(i&&(typeof e.typ!=`string`||ze(e.typ)!==ze(i)))throw new R(`unexpected "typ" JWT header value`,r,`typ`,`check_failed`);let{requiredClaims:a=[],issuer:o,subject:s,audience:c,maxTokenAge:l}=n,u=[...a];l!==void 0&&u.push(`iat`),c!==void 0&&u.push(`aud`),s!==void 0&&u.push(`sub`),o!==void 0&&u.push(`iss`);for(let e of new Set(u.reverse()))if(!(e in r))throw new R(`missing required "${e}" claim`,r,e,`missing`);if(o&&!(Array.isArray(o)?o:[o]).includes(r.iss))throw new R(`unexpected "iss" claim value`,r,`iss`,`check_failed`);if(s&&r.sub!==s)throw new R(`unexpected "sub" claim value`,r,`sub`,`check_failed`);if(c&&!Be(r.aud,typeof c==`string`?[c]:c))throw new R(`unexpected "aud" claim value`,r,`aud`,`check_failed`);let d;switch(typeof n.clockTolerance){case`string`:d=Re(n.clockTolerance);break;case`number`:d=n.clockTolerance;break;case`undefined`:d=0;break;default:throw TypeError(`Invalid clockTolerance option type`)}let{currentDate:f}=n,p=Ie(f||new Date);if((r.iat!==void 0||l)&&typeof r.iat!=`number`)throw new R(`"iat" claim must be a number`,r,`iat`,`invalid`);if(r.nbf!==void 0){if(typeof r.nbf!=`number`)throw new R(`"nbf" claim must be a number`,r,`nbf`,`invalid`);if(r.nbf>p+d)throw new R(`"nbf" claim timestamp check failed`,r,`nbf`,`check_failed`)}if(r.exp!==void 0){if(typeof r.exp!=`number`)throw new R(`"exp" claim must be a number`,r,`exp`,`invalid`);if(r.exp<=p-d)throw new ce(`"exp" claim timestamp check failed`,r,`exp`,`check_failed`)}if(l){let e=p-r.iat,t=typeof l==`number`?l:Re(l);if(e-d>t)throw new ce(`"iat" claim timestamp check failed (too far in the past)`,r,`iat`,`check_failed`);if(e<0-d)throw new R(`"iat" claim timestamp check failed (it should be in the past)`,r,`iat`,`check_failed`)}return r}async function He(e,t,n){let r=await Fe(e,t,n);if(r.protectedHeader.crit?.includes(`b64`)&&r.protectedHeader.b64===!1)throw new V(`JWTs MUST NOT use unencoded payload`);let i={payload:Ve(r.protectedHeader,r.payload,n),protectedHeader:r.protectedHeader};return typeof t==`function`?{...i,key:r.key}:i}function Ue(e){switch(typeof e==`string`&&e.slice(0,2)){case`RS`:case`PS`:return`RSA`;case`ES`:return`EC`;case`Ed`:return`OKP`;case`ML`:return`AKP`;default:throw new z(`Unsupported "alg" value for a JSON Web Key Set`)}}function We(e){return e&&typeof e==`object`&&Array.isArray(e.keys)&&e.keys.every(Ge)}function Ge(e){return K(e)}var Ke=class{#e;#t=new WeakMap;constructor(e){if(!We(e))throw new ue(`JSON Web Key Set malformed`);this.#e=structuredClone(e)}jwks(){return this.#e}async getKey(e,t){let{alg:n,kid:r}={...e,...t?.header},i=Ue(n),a=this.#e.keys.filter(e=>{let t=i===e.kty;if(t&&typeof r==`string`&&(t=r===e.kid),t&&(typeof e.alg==`string`||i===`AKP`)&&(t=n===e.alg),t&&typeof e.use==`string`&&(t=e.use===`sig`),t&&Array.isArray(e.key_ops)&&(t=e.key_ops.includes(`verify`)),t)switch(n){case`ES256`:t=e.crv===`P-256`;break;case`ES384`:t=e.crv===`P-384`;break;case`ES512`:t=e.crv===`P-521`;break;case`Ed25519`:case`EdDSA`:t=e.crv===`Ed25519`;break}return t}),{0:o,length:s}=a;if(s===0)throw new de;if(s!==1){let e=new H,t=this.#t;throw e[Symbol.asyncIterator]=async function*(){for(let e of a)try{yield await qe(t,e,n)}catch{}},e}return qe(this.#t,o,n)}};async function qe(e,t,n){let r=e.get(t)||e.set(t,{}).get(t);if(r[n]===void 0){let e=await De({...t,ext:!0},n);if(e instanceof Uint8Array||e.type!==`public`)throw new ue(`JSON Web Key Set members must be public keys`);r[n]=e}return r[n]}function Je(e){let t=new Ke(e),n=async(e,n)=>t.getKey(e,n);return Object.defineProperties(n,{jwks:{value:()=>structuredClone(t.jwks()),enumerable:!1,configurable:!1,writable:!1}}),n}function Ye(){return typeof WebSocketPair<`u`||typeof navigator<`u`&&navigator.userAgent===`Cloudflare-Workers`||typeof EdgeRuntime<`u`&&EdgeRuntime===`vercel`}let Xe;(typeof navigator>`u`||!navigator.userAgent?.startsWith?.(`Mozilla/5.0 `))&&(Xe=`jose/v6.2.3`);const Ze=Symbol();async function Qe(e,t,n,r=fetch){let i=await r(e,{method:`GET`,signal:n,redirect:`manual`,headers:t}).catch(e=>{throw e.name===`TimeoutError`?new fe:e});if(i.status!==200)throw new L(`Expected 200 OK from the JSON Web Key Set HTTP response`);try{return await i.json()}catch{throw new L(`Failed to parse the JSON Web Key Set HTTP response as JSON`)}}const $e=Symbol();function et(e,t){return!(typeof e!=`object`||!e||!(`uat`in e)||typeof e.uat!=`number`||Date.now()-e.uat>=t||!(`jwks`in e)||!K(e.jwks)||!Array.isArray(e.jwks.keys)||!Array.prototype.every.call(e.jwks.keys,K))}var tt=class{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;constructor(e,t){if(!(e instanceof URL))throw TypeError(`url must be an instance of URL`);this.#e=new URL(e.href),this.#t=typeof t?.timeoutDuration==`number`?t?.timeoutDuration:5e3,this.#n=typeof t?.cooldownDuration==`number`?t?.cooldownDuration:3e4,this.#r=typeof t?.cacheMaxAge==`number`?t?.cacheMaxAge:6e5,this.#o=new Headers(t?.headers),Xe&&!this.#o.has(`User-Agent`)&&this.#o.set(`User-Agent`,Xe),this.#o.has(`accept`)||(this.#o.set(`accept`,`application/json`),this.#o.append(`accept`,`application/jwk-set+json`)),this.#s=t?.[Ze],t?.[$e]!==void 0&&(this.#l=t?.[$e],et(t?.[$e],this.#r)&&(this.#i=this.#l.uat,this.#c=Je(this.#l.jwks)))}pendingFetch(){return!!this.#a}coolingDown(){return typeof this.#i==`number`&&Date.now()<this.#i+this.#n}fresh(){return typeof this.#i==`number`&&Date.now()<this.#i+this.#r}jwks(){return this.#c?.jwks()}async getKey(e,t){(!this.#c||!this.fresh())&&await this.reload();try{return await this.#c(e,t)}catch(n){if(n instanceof de&&this.coolingDown()===!1)return await this.reload(),this.#c(e,t);throw n}}async reload(){this.#a&&Ye()&&(this.#a=void 0),this.#a||=Qe(this.#e.href,this.#o,AbortSignal.timeout(this.#t),this.#s).then(e=>{this.#c=Je(e),this.#l&&(this.#l.uat=Date.now(),this.#l.jwks=e),this.#i=Date.now(),this.#a=void 0}).catch(e=>{throw this.#a=void 0,e}),await this.#a}};function nt(e,t){let n=new tt(e,t),r=async(e,t)=>n.getKey(e,t);return Object.defineProperties(r,{coolingDown:{get:()=>n.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>n.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>n.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>n.pendingFetch(),enumerable:!0,configurable:!1},jwks:{value:()=>n.jwks(),enumerable:!0,configurable:!1,writable:!1}}),r}function rt(e){if(typeof e!=`string`)throw new V(`JWTs must use Compact JWS serialization, JWT must be a string`);let{1:t,length:n}=e.split(`.`);if(n===5)throw new V(`Only JWTs using Compact JWS serialization can be decoded`);if(n!==3)throw new V(`Invalid JWT`);if(!t)throw new V(`JWTs must contain a payload`);let r;try{r=M(t)}catch{throw new V(`Failed to base64url decode the payload`)}let i;try{i=JSON.parse(k.decode(r))}catch{throw new V(`Failed to parse the decoded payload as JSON`)}if(!K(i))throw new V(`Invalid JWT Claims Set`);return i}export{D as a,s as c,ee as i,nt as n,w as o,He as r,x as s,rt as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=`2.10.0-beta.0`;export{e as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=`3.2.0`;export{e as t};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-8V8biNmG.js";import t from"node:crypto";const n=Object.freeze({status:`aborted`});function r(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}const i=Symbol(`zod_brand`);var a=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},o=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};const s={};function c(e){return e&&Object.assign(s,e),s}var l=e({BIGINT_FORMAT_RANGES:()=>je,Class:()=>Qe,NUMBER_FORMAT_RANGES:()=>Ae,aborted:()=>ze,allowsEval:()=>xe,assert:()=>re,assertEqual:()=>u,assertIs:()=>te,assertNever:()=>ne,assertNotEqual:()=>ee,assignProp:()=>f,base64ToUint8Array:()=>Ke,base64urlToUint8Array:()=>Je,cached:()=>se,captureStackTrace:()=>ye,cleanEnum:()=>Ge,cleanRegex:()=>le,clone:()=>g,cloneDef:()=>pe,createTransparentProxy:()=>De,defineLazy:()=>d,esc:()=>_e,escapeRegex:()=>h,extend:()=>Pe,finalizeIssue:()=>y,floatSafeRemainder:()=>ue,getElementAtPath:()=>me,getEnumValues:()=>ie,getLengthableOrigin:()=>He,getParsedType:()=>we,getSizableOrigin:()=>Ve,hexToUint8Array:()=>Xe,isObject:()=>be,isPlainObject:()=>m,issue:()=>We,joinValues:()=>ae,jsonStringifyReplacer:()=>oe,merge:()=>Ie,mergeDefs:()=>p,normalizeParams:()=>_,nullish:()=>ce,numKeys:()=>Ce,objectClone:()=>fe,omit:()=>Ne,optionalKeys:()=>ke,parsedType:()=>Ue,partial:()=>Le,pick:()=>Me,prefixIssues:()=>v,primitiveTypes:()=>Ee,promiseAllObject:()=>he,propertyKeyTypes:()=>Te,randomString:()=>ge,required:()=>Re,safeExtend:()=>Fe,shallowClone:()=>Se,slugify:()=>ve,stringifyPrimitive:()=>Oe,uint8ArrayToBase64:()=>qe,uint8ArrayToBase64url:()=>Ye,uint8ArrayToHex:()=>Ze,unwrapMessage:()=>Be});function u(e){return e}function ee(e){return e}function te(e){}function ne(e){throw Error(`Unexpected value in exhaustive check`)}function re(e){}function ie(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function ae(e,t=`|`){return e.map(e=>Oe(e)).join(t)}function oe(e,t){return typeof t==`bigint`?t.toString():t}function se(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function ce(e){return e==null}function le(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function ue(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}const de=Symbol(`evaluating`);function d(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==de)return r===void 0&&(r=de,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function fe(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function f(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function p(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function pe(e){return p(e._zod.def)}function me(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function he(e){let t=Object.keys(e),n=t.map(t=>e[t]);return Promise.all(n).then(e=>{let n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n})}function ge(e=10){let t=``;for(let n=0;n<e;n++)t+=`abcdefghijklmnopqrstuvwxyz`[Math.floor(Math.random()*26)];return t}function _e(e){return JSON.stringify(e)}function ve(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const ye=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function be(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const xe=se(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function m(e){if(be(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(be(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function Se(e){return m(e)?{...e}:Array.isArray(e)?[...e]:e}function Ce(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}const we=e=>{let t=typeof e;switch(t){case`undefined`:return`undefined`;case`string`:return`string`;case`number`:return Number.isNaN(e)?`nan`:`number`;case`boolean`:return`boolean`;case`function`:return`function`;case`bigint`:return`bigint`;case`symbol`:return`symbol`;case`object`:return Array.isArray(e)?`array`:e===null?`null`:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?`promise`:typeof Map<`u`&&e instanceof Map?`map`:typeof Set<`u`&&e instanceof Set?`set`:typeof Date<`u`&&e instanceof Date?`date`:typeof File<`u`&&e instanceof File?`file`:`object`;default:throw Error(`Unknown data type: ${t}`)}},Te=new Set([`string`,`number`,`symbol`]),Ee=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]);function h(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function g(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function _(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function De(e){let t;return new Proxy({},{get(n,r,i){return t??=e(),Reflect.get(t,r,i)},set(n,r,i,a){return t??=e(),Reflect.set(t,r,i,a)},has(n,r){return t??=e(),Reflect.has(t,r)},deleteProperty(n,r){return t??=e(),Reflect.deleteProperty(t,r)},ownKeys(n){return t??=e(),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??=e(),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??=e(),Reflect.defineProperty(t,r,i)}})}function Oe(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function ke(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}const Ae={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},je={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function Me(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return g(e,p(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return f(this,`shape`,e),e},checks:[]}))}function Ne(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return g(e,p(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return f(this,`shape`,r),r},checks:[]}))}function Pe(e,t){if(!m(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return g(e,p(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return f(this,`shape`,n),n}}))}function Fe(e,t){if(!m(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return g(e,p(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return f(this,`shape`,n),n}}))}function Ie(e,t){return g(e,p(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return f(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function Le(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return g(t,p(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return f(this,`shape`,i),i},checks:[]}))}function Re(e,t,n){return g(t,p(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return f(this,`shape`,i),i}}))}function ze(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function v(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Be(e){return typeof e==`string`?e:e?.message}function y(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=Be(e.inst?._zod.def?.error?.(e))??Be(t?.error?.(e))??Be(n.customError?.(e))??Be(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Ve(e){return e instanceof Set?`set`:e instanceof Map?`map`:e instanceof File?`file`:`unknown`}function He(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Ue(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function We(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Ge(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function Ke(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function qe(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function Je(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);return Ke(t+`=`.repeat((4-t.length%4)%4))}function Ye(e){return qe(e).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function Xe(e){let t=e.replace(/^0x/,``);if(t.length%2!=0)throw Error(`Invalid hex string length`);let n=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)n[e/2]=Number.parseInt(t.slice(e,e+2),16);return n}function Ze(e){return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}var Qe=class{constructor(...e){}};const $e=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,oe,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},et=r(`$ZodError`,$e),b=r(`$ZodError`,$e,{Parent:Error});function tt(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function nt(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}function rt(e,t=e=>e.message){let n={errors:[]},r=(e,i=[])=>{var a,o;for(let s of e.issues)if(s.code===`invalid_union`&&s.errors.length)s.errors.map(e=>r({issues:e},s.path));else if(s.code===`invalid_key`)r({issues:s.issues},s.path);else if(s.code===`invalid_element`)r({issues:s.issues},s.path);else{let e=[...i,...s.path];if(e.length===0){n.errors.push(t(s));continue}let r=n,c=0;for(;c<e.length;){let n=e[c],i=c===e.length-1;typeof n==`string`?(r.properties??={},(a=r.properties)[n]??(a[n]={errors:[]}),r=r.properties[n]):(r.items??=[],(o=r.items)[n]??(o[n]={errors:[]}),r=r.items[n]),i&&r.errors.push(t(s)),c++}}};return r(e),n}function it(e){let t=[],n=e.map(e=>typeof e==`object`?e.key:e);for(let e of n)typeof e==`number`?t.push(`[${e}]`):typeof e==`symbol`?t.push(`[${JSON.stringify(String(e))}]`):/[^\w$]/.test(e)?t.push(`[${JSON.stringify(e)}]`):(t.length&&t.push(`.`),t.push(e));return t.join(``)}function at(e){let t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${it(e.path)}`);return t.join(`
|
|
2
|
-
`)}const ot=e=>(t,n,r,i)=>{let o=r?Object.assign(r,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new a;if(s.issues.length){let t=new((i?.Err)??e)(s.issues.map(e=>y(e,o,c())));throw ye(t,i?.callee),t}return s.value},st=ot(b),ct=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>y(e,a,c())));throw ye(t,i?.callee),t}return o.value},lt=ct(b),ut=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new a;return o.issues.length?{success:!1,error:new(e??et)(o.issues.map(e=>y(e,i,c())))}:{success:!0,data:o.value}},dt=ut(b),ft=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>y(e,i,c())))}:{success:!0,data:a.value}},pt=ft(b),mt=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return ot(e)(t,n,i)},ht=mt(b),gt=e=>(t,n,r)=>ot(e)(t,n,r),_t=gt(b),vt=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return ct(e)(t,n,i)},yt=vt(b),bt=e=>async(t,n,r)=>ct(e)(t,n,r),xt=bt(b),St=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return ut(e)(t,n,i)},Ct=St(b),wt=e=>(t,n,r)=>ut(e)(t,n,r),Tt=wt(b),Et=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return ft(e)(t,n,i)},Dt=Et(b),Ot=e=>async(t,n,r)=>ft(e)(t,n,r),kt=Ot(b);var At=e({base64:()=>nn,base64url:()=>rn,bigint:()=>mn,boolean:()=>_n,browserEmail:()=>Yt,cidrv4:()=>en,cidrv6:()=>tn,cuid:()=>jt,cuid2:()=>Mt,date:()=>ln,datetime:()=>fn,domain:()=>on,duration:()=>Lt,e164:()=>sn,email:()=>Wt,emoji:()=>Xt,extendedDuration:()=>Rt,guid:()=>zt,hex:()=>Sn,hostname:()=>an,html5Email:()=>Gt,idnEmail:()=>Jt,integer:()=>hn,ipv4:()=>Zt,ipv6:()=>Qt,ksuid:()=>Ft,lowercase:()=>bn,mac:()=>$t,md5_base64:()=>En,md5_base64url:()=>Dn,md5_hex:()=>Tn,nanoid:()=>It,null:()=>vn,number:()=>gn,rfc5322Email:()=>Kt,sha1_base64:()=>kn,sha1_base64url:()=>An,sha1_hex:()=>On,sha256_base64:()=>Mn,sha256_base64url:()=>Nn,sha256_hex:()=>jn,sha384_base64:()=>Fn,sha384_base64url:()=>In,sha384_hex:()=>Pn,sha512_base64:()=>Rn,sha512_base64url:()=>zn,sha512_hex:()=>Ln,string:()=>pn,time:()=>dn,ulid:()=>Nt,undefined:()=>yn,unicodeEmail:()=>qt,uppercase:()=>xn,uuid:()=>Bt,uuid4:()=>Vt,uuid6:()=>Ht,uuid7:()=>Ut,xid:()=>Pt});const jt=/^[cC][^\s-]{8,}$/,Mt=/^[0-9a-z]+$/,Nt=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Pt=/^[0-9a-vA-V]{20}$/,Ft=/^[A-Za-z0-9]{27}$/,It=/^[a-zA-Z0-9_-]{21}$/,Lt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Rt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,zt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Bt=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Vt=Bt(4),Ht=Bt(6),Ut=Bt(7),Wt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Gt=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Kt=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,qt=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Jt=qt,Yt=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;function Xt(){return RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)}const Zt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Qt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,$t=e=>{let t=h(e??`:`);return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},en=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,tn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,nn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,rn=/^[A-Za-z0-9_-]*$/,an=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,on=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,sn=/^\+[1-9]\d{6,14}$/,cn=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,ln=RegExp(`^${cn}$`);function un(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function dn(e){return RegExp(`^${un(e)}$`)}function fn(e){let t=un({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${cn}T(?:${r})$`)}const pn=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},mn=/^-?\d+n?$/,hn=/^-?\d+$/,gn=/^-?\d+(?:\.\d+)?$/,_n=/^(?:true|false)$/i,vn=/^null$/i,yn=/^undefined$/i,bn=/^[^A-Z]*$/,xn=/^[^a-z]*$/,Sn=/^[0-9a-fA-F]*$/;function Cn(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function wn(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}const Tn=/^[0-9a-fA-F]{32}$/,En=Cn(22,`==`),Dn=wn(22),On=/^[0-9a-fA-F]{40}$/,kn=Cn(27,`=`),An=wn(27),jn=/^[0-9a-fA-F]{64}$/,Mn=Cn(43,`=`),Nn=wn(43),Pn=/^[0-9a-fA-F]{96}$/,Fn=Cn(64,``),In=wn(64),Ln=/^[0-9a-fA-F]{128}$/,Rn=Cn(86,`==`),zn=wn(86),x=r(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Bn={number:`number`,bigint:`bigint`,object:`date`},Vn=r(`$ZodCheckLessThan`,(e,t)=>{x.init(e,t);let n=Bn[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Hn=r(`$ZodCheckGreaterThan`,(e,t)=>{x.init(e,t);let n=Bn[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Un=r(`$ZodCheckMultipleOf`,(e,t)=>{x.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):ue(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Wn=r(`$ZodCheckNumberFormat`,(e,t)=>{x.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Ae[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=hn)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Gn=r(`$ZodCheckBigIntFormat`,(e,t)=>{x.init(e,t);let[n,r]=je[t.format];e._zod.onattach.push(e=>{let i=e._zod.bag;i.format=t.format,i.minimum=n,i.maximum=r}),e._zod.check=i=>{let a=i.value;a<n&&i.issues.push({origin:`bigint`,input:a,code:`too_small`,minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>r&&i.issues.push({origin:`bigint`,input:a,code:`too_big`,maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),Kn=r(`$ZodCheckMaxSize`,(e,t)=>{var n;x.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ce(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;r.size<=t.maximum||n.issues.push({origin:Ve(r),code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),qn=r(`$ZodCheckMinSize`,(e,t)=>{var n;x.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ce(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;r.size>=t.minimum||n.issues.push({origin:Ve(r),code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Jn=r(`$ZodCheckSizeEquals`,(e,t)=>{var n;x.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ce(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=n=>{let r=n.value,i=r.size;if(i===t.size)return;let a=i>t.size;n.issues.push({origin:Ve(r),...a?{code:`too_big`,maximum:t.size}:{code:`too_small`,minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Yn=r(`$ZodCheckMaxLength`,(e,t)=>{var n;x.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ce(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=He(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Xn=r(`$ZodCheckMinLength`,(e,t)=>{var n;x.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ce(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=He(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Zn=r(`$ZodCheckLengthEquals`,(e,t)=>{var n;x.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ce(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=He(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Qn=r(`$ZodCheckStringFormat`,(e,t)=>{var n,r;x.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),$n=r(`$ZodCheckRegex`,(e,t)=>{Qn.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),er=r(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=bn,Qn.init(e,t)}),tr=r(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=xn,Qn.init(e,t)}),nr=r(`$ZodCheckIncludes`,(e,t)=>{x.init(e,t);let n=h(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),rr=r(`$ZodCheckStartsWith`,(e,t)=>{x.init(e,t);let n=RegExp(`^${h(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),ir=r(`$ZodCheckEndsWith`,(e,t)=>{x.init(e,t);let n=RegExp(`.*${h(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function ar(e,t,n){e.issues.length&&t.issues.push(...v(n,e.issues))}const or=r(`$ZodCheckProperty`,(e,t)=>{x.init(e,t),e._zod.check=e=>{let n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(n=>ar(n,e,t.property));ar(n,e,t.property)}}),sr=r(`$ZodCheckMimeType`,(e,t)=>{x.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:`invalid_value`,values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),cr=r(`$ZodCheckOverwrite`,(e,t)=>{x.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var lr=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
3
|
-
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
4
|
-
`))}};const ur={major:4,minor:3,patch:6},S=r(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ur;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=ze(e),i;for(let o of t){if(o._zod.def.when){if(!o._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,s=o._zod.check(e);if(s instanceof Promise&&n?.async===!1)throw new a;if(i||s instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await s,e.issues.length!==t&&(r||=ze(e,t))});else{if(e.issues.length===t)continue;r||=ze(e,t)}}return i?i.then(()=>e):e},n=(n,i,o)=>{if(ze(n))return n.aborted=!0,n;let s=t(i,r,o);if(s instanceof Promise){if(o.async===!1)throw new a;return s.then(t=>e._zod.parse(t,o))}return e._zod.parse(s,o)};e._zod.run=(i,o)=>{if(o.skipChecks)return e._zod.parse(i,o);if(o.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...o,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,o)):n(t,i,o)}let s=e._zod.parse(i,o);if(s instanceof Promise){if(o.async===!1)throw new a;return s.then(e=>t(e,r,o))}return t(s,r,o)}}d(e,`~standard`,()=>({validate:t=>{try{let n=dt(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return pt(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),dr=r(`$ZodString`,(e,t)=>{S.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??pn(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),C=r(`$ZodStringFormat`,(e,t)=>{Qn.init(e,t),dr.init(e,t)}),fr=r(`$ZodGUID`,(e,t)=>{t.pattern??=zt,C.init(e,t)}),pr=r(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Bt(e)}else t.pattern??=Bt();C.init(e,t)}),mr=r(`$ZodEmail`,(e,t)=>{t.pattern??=Wt,C.init(e,t)}),hr=r(`$ZodURL`,(e,t)=>{C.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),gr=r(`$ZodEmoji`,(e,t)=>{t.pattern??=Xt(),C.init(e,t)}),_r=r(`$ZodNanoID`,(e,t)=>{t.pattern??=It,C.init(e,t)}),vr=r(`$ZodCUID`,(e,t)=>{t.pattern??=jt,C.init(e,t)}),yr=r(`$ZodCUID2`,(e,t)=>{t.pattern??=Mt,C.init(e,t)}),br=r(`$ZodULID`,(e,t)=>{t.pattern??=Nt,C.init(e,t)}),xr=r(`$ZodXID`,(e,t)=>{t.pattern??=Pt,C.init(e,t)}),Sr=r(`$ZodKSUID`,(e,t)=>{t.pattern??=Ft,C.init(e,t)}),Cr=r(`$ZodISODateTime`,(e,t)=>{t.pattern??=fn(t),C.init(e,t)}),wr=r(`$ZodISODate`,(e,t)=>{t.pattern??=ln,C.init(e,t)}),Tr=r(`$ZodISOTime`,(e,t)=>{t.pattern??=dn(t),C.init(e,t)}),Er=r(`$ZodISODuration`,(e,t)=>{t.pattern??=Lt,C.init(e,t)}),Dr=r(`$ZodIPv4`,(e,t)=>{t.pattern??=Zt,C.init(e,t),e._zod.bag.format=`ipv4`}),Or=r(`$ZodIPv6`,(e,t)=>{t.pattern??=Qt,C.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),kr=r(`$ZodMAC`,(e,t)=>{t.pattern??=$t(t.delimiter),C.init(e,t),e._zod.bag.format=`mac`}),Ar=r(`$ZodCIDRv4`,(e,t)=>{t.pattern??=en,C.init(e,t)}),jr=r(`$ZodCIDRv6`,(e,t)=>{t.pattern??=tn,C.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function Mr(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Nr=r(`$ZodBase64`,(e,t)=>{t.pattern??=nn,C.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{Mr(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function Pr(e){if(!rn.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Mr(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const Fr=r(`$ZodBase64URL`,(e,t)=>{t.pattern??=rn,C.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{Pr(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Ir=r(`$ZodE164`,(e,t)=>{t.pattern??=sn,C.init(e,t)});function Lr(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}const Rr=r(`$ZodJWT`,(e,t)=>{C.init(e,t),e._zod.check=n=>{Lr(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),zr=r(`$ZodCustomStringFormat`,(e,t)=>{C.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:`invalid_format`,format:t.format,input:n.value,inst:e,continue:!t.abort})}}),Br=r(`$ZodNumber`,(e,t)=>{S.init(e,t),e._zod.pattern=e._zod.bag.pattern??gn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Vr=r(`$ZodNumberFormat`,(e,t)=>{Wn.init(e,t),Br.init(e,t)}),Hr=r(`$ZodBoolean`,(e,t)=>{S.init(e,t),e._zod.pattern=_n,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Ur=r(`$ZodBigInt`,(e,t)=>{S.init(e,t),e._zod.pattern=mn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value==`bigint`||n.issues.push({expected:`bigint`,code:`invalid_type`,input:n.value,inst:e}),n}}),Wr=r(`$ZodBigIntFormat`,(e,t)=>{Gn.init(e,t),Ur.init(e,t)}),Gr=r(`$ZodSymbol`,(e,t)=>{S.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return typeof r==`symbol`||t.issues.push({expected:`symbol`,code:`invalid_type`,input:r,inst:e}),t}}),Kr=r(`$ZodUndefined`,(e,t)=>{S.init(e,t),e._zod.pattern=yn,e._zod.values=new Set([void 0]),e._zod.optin=`optional`,e._zod.optout=`optional`,e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),qr=r(`$ZodNull`,(e,t)=>{S.init(e,t),e._zod.pattern=vn,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),Jr=r(`$ZodAny`,(e,t)=>{S.init(e,t),e._zod.parse=e=>e}),Yr=r(`$ZodUnknown`,(e,t)=>{S.init(e,t),e._zod.parse=e=>e}),Xr=r(`$ZodNever`,(e,t)=>{S.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),Zr=r(`$ZodVoid`,(e,t)=>{S.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`void`,code:`invalid_type`,input:r,inst:e}),t}}),Qr=r(`$ZodDate`,(e,t)=>{S.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let i=n.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||n.issues.push({expected:`date`,code:`invalid_type`,input:i,...a?{received:`Invalid Date`}:{},inst:e}),n}});function $r(e,t,n){e.issues.length&&t.issues.push(...v(n,e.issues)),t.value[n]=e.value}const ei=r(`$ZodArray`,(e,t)=>{S.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>$r(t,n,e))):$r(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function ti(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...v(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function ni(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=ke(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function ri(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>ti(e,n,i,t,u))):ti(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const ii=r(`$ZodObject`,(e,t)=>{if(S.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=se(()=>ni(t));d(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=be,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optout===`optional`,i=n._zod.run({value:s[e],issues:[]},o);i instanceof Promise?c.push(i.then(n=>ti(n,t,e,s,r))):ti(i,t,e,s,r)}return i?ri(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),ai=r(`$ZodObjectJIT`,(e,t)=>{ii.init(e,t);let n=e._zod.parse,r=se(()=>ni(t)),i=e=>{let t=new lr([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=_e(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=_e(r),s=e[r]?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),s?t.write(`
|
|
5
|
-
if (${n}.issues.length) {
|
|
6
|
-
if (${o} in input) {
|
|
7
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
8
|
-
...iss,
|
|
9
|
-
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
10
|
-
})));
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
if (${n}.value === undefined) {
|
|
15
|
-
if (${o} in input) {
|
|
16
|
-
newResult[${o}] = undefined;
|
|
17
|
-
}
|
|
18
|
-
} else {
|
|
19
|
-
newResult[${o}] = ${n}.value;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
`):t.write(`
|
|
23
|
-
if (${n}.issues.length) {
|
|
24
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
25
|
-
...iss,
|
|
26
|
-
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
27
|
-
})));
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (${n}.value === undefined) {
|
|
31
|
-
if (${o} in input) {
|
|
32
|
-
newResult[${o}] = undefined;
|
|
33
|
-
}
|
|
34
|
-
} else {
|
|
35
|
-
newResult[${o}] = ${n}.value;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=be,c=!s.jitless,l=c&&xe.value,u=t.catchall,ee;e._zod.parse=(s,te)=>{ee??=r.value;let ne=s.value;return o(ne)?c&&l&&te?.async===!1&&te.jitless!==!0?(a||=i(t.shape),s=a(s,te),u?ri([],ne,s,te,ee,e):s):n(s,te):(s.issues.push({expected:`object`,code:`invalid_type`,input:ne,inst:e}),s)}});function oi(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!ze(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>y(e,r,c())))}),t)}const si=r(`$ZodUnion`,(e,t)=>{S.init(e,t),d(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),d(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),d(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),d(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>le(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>oi(t,i,e,a)):oi(s,i,e,a)}});function ci(e,t,n,r){let i=e.filter(e=>e.issues.length===0);return i.length===1?(t.value=i[0].value,t):(i.length===0?t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>y(e,r,c())))}):t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:[],inclusive:!1}),t)}const li=r(`$ZodXor`,(e,t)=>{si.init(e,t),t.inclusive=!1;let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);t instanceof Promise?(s.push(t),o=!0):s.push(t)}return o?Promise.all(s).then(t=>ci(t,i,e,a)):ci(s,i,e,a)}}),ui=r(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,si.init(e,t);let n=e._zod.parse;d(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=se(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!be(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),di=r(`$ZodIntersection`,(e,t)=>{S.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>pi(e,t,n)):pi(e,i,a)}});function fi(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(m(e)&&m(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=fi(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=fi(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function pi(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),ze(e))return e;let o=fi(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const mi=r(`$ZodTuple`,(e,t)=>{S.init(e,t);let n=t.items;e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({input:a,inst:e,expected:`tuple`,code:`invalid_type`}),r;r.value=[];let o=[],s=[...n].reverse().findIndex(e=>e._zod.optin!==`optional`),c=s===-1?0:n.length-s;if(!t.rest){let t=a.length>n.length,i=a.length<c-1;if(t||i)return r.issues.push({...t?{code:`too_big`,maximum:n.length,inclusive:!0}:{code:`too_small`,minimum:n.length},input:a,inst:e,origin:`array`}),r}let l=-1;for(let e of n){if(l++,l>=a.length&&l>=c)continue;let t=e._zod.run({value:a[l],issues:[]},i);t instanceof Promise?o.push(t.then(e=>hi(e,r,l))):hi(t,r,l)}if(t.rest){let e=a.slice(n.length);for(let n of e){l++;let e=t.rest._zod.run({value:n,issues:[]},i);e instanceof Promise?o.push(e.then(e=>hi(e,r,l))):hi(e,r,l)}}return o.length?Promise.all(o).then(()=>r):r}});function hi(e,t,n){e.issues.length&&t.issues.push(...v(n,e.issues)),t.value[n]=e.value}const gi=r(`$ZodRecord`,(e,t)=>{S.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!m(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){s.add(typeof e==`number`?e.toString():e);let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...v(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...v(e,o.issues)),n.value[e]=o.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&gn.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>y(e,r,c())),input:o,path:[o],inst:e});continue}let l=t.valueType._zod.run({value:i[o],issues:[]},r);l instanceof Promise?a.push(l.then(e=>{e.issues.length&&n.issues.push(...v(o,e.issues)),n.value[s.value]=e.value})):(l.issues.length&&n.issues.push(...v(o,l.issues)),n.value[s.value]=l.value)}}return a.length?Promise.all(a).then(()=>n):n}}),_i=r(`$ZodMap`,(e,t)=>{S.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Map))return n.issues.push({expected:`map`,code:`invalid_type`,input:i,inst:e}),n;let a=[];n.value=new Map;for(let[o,s]of i){let c=t.keyType._zod.run({value:o,issues:[]},r),l=t.valueType._zod.run({value:s,issues:[]},r);c instanceof Promise||l instanceof Promise?a.push(Promise.all([c,l]).then(([t,a])=>{vi(t,a,n,o,i,e,r)})):vi(c,l,n,o,i,e,r)}return a.length?Promise.all(a).then(()=>n):n}});function vi(e,t,n,r,i,a,o){e.issues.length&&(Te.has(typeof r)?n.issues.push(...v(r,e.issues)):n.issues.push({code:`invalid_key`,origin:`map`,input:i,inst:a,issues:e.issues.map(e=>y(e,o,c()))})),t.issues.length&&(Te.has(typeof r)?n.issues.push(...v(r,t.issues)):n.issues.push({origin:`map`,code:`invalid_element`,input:i,inst:a,key:r,issues:t.issues.map(e=>y(e,o,c()))})),n.value.set(e.value,t.value)}const yi=r(`$ZodSet`,(e,t)=>{S.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Set))return n.issues.push({input:i,inst:e,expected:`set`,code:`invalid_type`}),n;let a=[];n.value=new Set;for(let e of i){let i=t.valueType._zod.run({value:e,issues:[]},r);i instanceof Promise?a.push(i.then(e=>bi(e,n))):bi(i,n)}return a.length?Promise.all(a).then(()=>n):n}});function bi(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}const xi=r(`$ZodEnum`,(e,t)=>{S.init(e,t);let n=ie(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>Te.has(typeof e)).map(e=>typeof e==`string`?h(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Si=r(`$ZodLiteral`,(e,t)=>{if(S.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?h(e):e?h(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Ci=r(`$ZodFile`,(e,t)=>{S.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r instanceof File||t.issues.push({expected:`file`,code:`invalid_type`,input:r,inst:e}),t}}),wi=r(`$ZodTransform`,(e,t)=>{S.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new o(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new a;return n.value=i,n}});function Ti(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Ei=r(`$ZodOptional`,(e,t)=>{S.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,d(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),d(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${le(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>Ti(t,e.value)):Ti(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Di=r(`$ZodExactOptional`,(e,t)=>{Ei.init(e,t),d(e._zod,`values`,()=>t.innerType._zod.values),d(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Oi=r(`$ZodNullable`,(e,t)=>{S.init(e,t),d(e._zod,`optin`,()=>t.innerType._zod.optin),d(e._zod,`optout`,()=>t.innerType._zod.optout),d(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${le(e.source)}|null)$`):void 0}),d(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),ki=r(`$ZodDefault`,(e,t)=>{S.init(e,t),e._zod.optin=`optional`,d(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Ai(e,t)):Ai(r,t)}});function Ai(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const ji=r(`$ZodPrefault`,(e,t)=>{S.init(e,t),e._zod.optin=`optional`,d(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Mi=r(`$ZodNonOptional`,(e,t)=>{S.init(e,t),d(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Ni(t,e)):Ni(i,e)}});function Ni(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}const Pi=r(`$ZodSuccess`,(e,t)=>{S.init(e,t),e._zod.parse=(e,n)=>{if(n.direction===`backward`)throw new o(`ZodSuccess`);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>(e.value=t.issues.length===0,e)):(e.value=r.issues.length===0,e)}}),Fi=r(`$ZodCatch`,(e,t)=>{S.init(e,t),d(e._zod,`optin`,()=>t.innerType._zod.optin),d(e._zod,`optout`,()=>t.innerType._zod.optout),d(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>y(e,n,c()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>y(e,n,c()))},input:e.value}),e.issues=[]),e)}}),Ii=r(`$ZodNaN`,(e,t)=>{S.init(e,t),e._zod.parse=(t,n)=>((typeof t.value!=`number`||!Number.isNaN(t.value))&&t.issues.push({input:t.value,inst:e,expected:`nan`,code:`invalid_type`}),t)}),Li=r(`$ZodPipe`,(e,t)=>{S.init(e,t),d(e._zod,`values`,()=>t.in._zod.values),d(e._zod,`optin`,()=>t.in._zod.optin),d(e._zod,`optout`,()=>t.out._zod.optout),d(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Ri(e,t.in,n)):Ri(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Ri(e,t.out,n)):Ri(r,t.out,n)}});function Ri(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const zi=r(`$ZodCodec`,(e,t)=>{S.init(e,t),d(e._zod,`values`,()=>t.in._zod.values),d(e._zod,`optin`,()=>t.in._zod.optin),d(e._zod,`optout`,()=>t.out._zod.optout),d(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if((n.direction||`forward`)===`forward`){let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Bi(e,t,n)):Bi(r,t,n)}else{let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Bi(e,t,n)):Bi(r,t,n)}}});function Bi(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||`forward`)===`forward`){let r=t.transform(e.value,e);return r instanceof Promise?r.then(r=>Vi(e,r,t.out,n)):Vi(e,r,t.out,n)}else{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(r=>Vi(e,r,t.in,n)):Vi(e,r,t.in,n)}}function Vi(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}const Hi=r(`$ZodReadonly`,(e,t)=>{S.init(e,t),d(e._zod,`propValues`,()=>t.innerType._zod.propValues),d(e._zod,`values`,()=>t.innerType._zod.values),d(e._zod,`optin`,()=>t.innerType?._zod?.optin),d(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Ui):Ui(r)}});function Ui(e){return e.value=Object.freeze(e.value),e}const Wi=r(`$ZodTemplateLiteral`,(e,t)=>{S.init(e,t);let n=[];for(let e of t.parts)if(typeof e==`object`&&e){if(!e._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);let t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw Error(`Invalid template literal part: ${e._zod.traits}`);let r=+!!t.startsWith(`^`),i=t.endsWith(`$`)?t.length-1:t.length;n.push(t.slice(r,i))}else if(e===null||Ee.has(typeof e))n.push(h(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${n.join(``)}$`),e._zod.parse=(n,r)=>typeof n.value==`string`?(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:`invalid_format`,format:t.format??`template_literal`,pattern:e._zod.pattern.source}),n):(n.issues.push({input:n.value,inst:e,expected:`string`,code:`invalid_type`}),n)}),Gi=r(`$ZodFunction`,(e,t)=>(S.init(e,t),e._def=t,e._zod.def=t,e.implement=t=>{if(typeof t!=`function`)throw Error(`implement() must be called with a function`);return function(...n){let r=e._def.input?st(e._def.input,n):n,i=Reflect.apply(t,this,r);return e._def.output?st(e._def.output,i):i}},e.implementAsync=t=>{if(typeof t!=`function`)throw Error(`implementAsync() must be called with a function`);return async function(...n){let r=e._def.input?await lt(e._def.input,n):n,i=await Reflect.apply(t,this,r);return e._def.output?await lt(e._def.output,i):i}},e._zod.parse=(t,n)=>typeof t.value==`function`?(e._def.output&&e._def.output._zod.def.type===`promise`?t.value=e.implementAsync(t.value):t.value=e.implement(t.value),t):(t.issues.push({code:`invalid_type`,expected:`function`,input:t.value,inst:e}),t),e.input=(...t)=>{let n=e.constructor;return Array.isArray(t[0])?new n({type:`function`,input:new mi({type:`tuple`,items:t[0],rest:t[1]}),output:e._def.output}):new n({type:`function`,input:t[0],output:e._def.output})},e.output=t=>{let n=e.constructor;return new n({type:`function`,input:e._def.input,output:t})},e)),Ki=r(`$ZodPromise`,(e,t)=>{S.init(e,t),e._zod.parse=(e,n)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},n))}),qi=r(`$ZodLazy`,(e,t)=>{S.init(e,t),d(e._zod,`innerType`,()=>t.getter()),d(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),d(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),d(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),d(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Ji=r(`$ZodCustom`,(e,t)=>{x.init(e,t),S.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Yi(t,n,r,e));Yi(i,n,r,e)}});function Yi(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(We(e))}}var Xi;const Zi=Symbol(`ZodOutput`),Qi=Symbol(`ZodInput`);var $i=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function ea(){return new $i}(Xi=globalThis).__zod_globalRegistry??(Xi.__zod_globalRegistry=ea());const w=globalThis.__zod_globalRegistry;function ta(e,t){return new e({type:`string`,..._(t)})}function na(e,t){return new e({type:`string`,coerce:!0,..._(t)})}function ra(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,..._(t)})}function ia(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,..._(t)})}function aa(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,..._(t)})}function oa(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,..._(t)})}function sa(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,..._(t)})}function ca(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,..._(t)})}function la(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,..._(t)})}function ua(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,..._(t)})}function da(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,..._(t)})}function fa(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,..._(t)})}function pa(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,..._(t)})}function ma(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,..._(t)})}function ha(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,..._(t)})}function ga(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,..._(t)})}function _a(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,..._(t)})}function va(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,..._(t)})}function ya(e,t){return new e({type:`string`,format:`mac`,check:`string_format`,abort:!1,..._(t)})}function ba(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,..._(t)})}function xa(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,..._(t)})}function Sa(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,..._(t)})}function Ca(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,..._(t)})}function wa(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,..._(t)})}function Ta(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,..._(t)})}const Ea={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Da(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,..._(t)})}function Oa(e,t){return new e({type:`string`,format:`date`,check:`string_format`,..._(t)})}function ka(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,..._(t)})}function Aa(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,..._(t)})}function ja(e,t){return new e({type:`number`,checks:[],..._(t)})}function Ma(e,t){return new e({type:`number`,coerce:!0,checks:[],..._(t)})}function Na(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,..._(t)})}function Pa(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float32`,..._(t)})}function Fa(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float64`,..._(t)})}function Ia(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`int32`,..._(t)})}function La(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`uint32`,..._(t)})}function Ra(e,t){return new e({type:`boolean`,..._(t)})}function za(e,t){return new e({type:`boolean`,coerce:!0,..._(t)})}function Ba(e,t){return new e({type:`bigint`,..._(t)})}function Va(e,t){return new e({type:`bigint`,coerce:!0,..._(t)})}function Ha(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`int64`,..._(t)})}function Ua(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`uint64`,..._(t)})}function Wa(e,t){return new e({type:`symbol`,..._(t)})}function Ga(e,t){return new e({type:`undefined`,..._(t)})}function Ka(e,t){return new e({type:`null`,..._(t)})}function qa(e){return new e({type:`any`})}function Ja(e){return new e({type:`unknown`})}function Ya(e,t){return new e({type:`never`,..._(t)})}function Xa(e,t){return new e({type:`void`,..._(t)})}function Za(e,t){return new e({type:`date`,..._(t)})}function Qa(e,t){return new e({type:`date`,coerce:!0,..._(t)})}function $a(e,t){return new e({type:`nan`,..._(t)})}function eo(e,t){return new Vn({check:`less_than`,..._(t),value:e,inclusive:!1})}function T(e,t){return new Vn({check:`less_than`,..._(t),value:e,inclusive:!0})}function to(e,t){return new Hn({check:`greater_than`,..._(t),value:e,inclusive:!1})}function E(e,t){return new Hn({check:`greater_than`,..._(t),value:e,inclusive:!0})}function no(e){return to(0,e)}function ro(e){return eo(0,e)}function io(e){return T(0,e)}function ao(e){return E(0,e)}function oo(e,t){return new Un({check:`multiple_of`,..._(t),value:e})}function so(e,t){return new Kn({check:`max_size`,..._(t),maximum:e})}function co(e,t){return new qn({check:`min_size`,..._(t),minimum:e})}function lo(e,t){return new Jn({check:`size_equals`,..._(t),size:e})}function uo(e,t){return new Yn({check:`max_length`,..._(t),maximum:e})}function fo(e,t){return new Xn({check:`min_length`,..._(t),minimum:e})}function po(e,t){return new Zn({check:`length_equals`,..._(t),length:e})}function mo(e,t){return new $n({check:`string_format`,format:`regex`,..._(t),pattern:e})}function ho(e){return new er({check:`string_format`,format:`lowercase`,..._(e)})}function go(e){return new tr({check:`string_format`,format:`uppercase`,..._(e)})}function _o(e,t){return new nr({check:`string_format`,format:`includes`,..._(t),includes:e})}function vo(e,t){return new rr({check:`string_format`,format:`starts_with`,..._(t),prefix:e})}function yo(e,t){return new ir({check:`string_format`,format:`ends_with`,..._(t),suffix:e})}function bo(e,t,n){return new or({check:`property`,property:e,schema:t,..._(n)})}function xo(e,t){return new sr({check:`mime_type`,mime:e,..._(t)})}function So(e){return new cr({check:`overwrite`,tx:e})}function Co(e){return So(t=>t.normalize(e))}function wo(){return So(e=>e.trim())}function To(){return So(e=>e.toLowerCase())}function Eo(){return So(e=>e.toUpperCase())}function Do(){return So(e=>ve(e))}function Oo(e,t,n){return new e({type:`array`,element:t,..._(n)})}function ko(e,t,n){return new e({type:`union`,options:t,..._(n)})}function Ao(e,t,n){return new e({type:`union`,options:t,inclusive:!1,..._(n)})}function jo(e,t,n,r){return new e({type:`union`,options:n,discriminator:t,..._(r)})}function Mo(e,t,n){return new e({type:`intersection`,left:t,right:n})}function No(e,t,n,r){let i=n instanceof S;return new e({type:`tuple`,items:t,rest:i?n:null,..._(i?r:n)})}function Po(e,t,n,r){return new e({type:`record`,keyType:t,valueType:n,..._(r)})}function Fo(e,t,n,r){return new e({type:`map`,keyType:t,valueType:n,..._(r)})}function Io(e,t,n){return new e({type:`set`,valueType:t,..._(n)})}function Lo(e,t,n){return new e({type:`enum`,entries:Array.isArray(t)?Object.fromEntries(t.map(e=>[e,e])):t,..._(n)})}function Ro(e,t,n){return new e({type:`enum`,entries:t,..._(n)})}function zo(e,t,n){return new e({type:`literal`,values:Array.isArray(t)?t:[t],..._(n)})}function Bo(e,t){return new e({type:`file`,..._(t)})}function Vo(e,t){return new e({type:`transform`,transform:t})}function Ho(e,t){return new e({type:`optional`,innerType:t})}function Uo(e,t){return new e({type:`nullable`,innerType:t})}function Wo(e,t,n){return new e({type:`default`,innerType:t,get defaultValue(){return typeof n==`function`?n():Se(n)}})}function Go(e,t,n){return new e({type:`nonoptional`,innerType:t,..._(n)})}function Ko(e,t){return new e({type:`success`,innerType:t})}function qo(e,t,n){return new e({type:`catch`,innerType:t,catchValue:typeof n==`function`?n:()=>n})}function Jo(e,t,n){return new e({type:`pipe`,in:t,out:n})}function Yo(e,t){return new e({type:`readonly`,innerType:t})}function Xo(e,t,n){return new e({type:`template_literal`,parts:t,..._(n)})}function Zo(e,t){return new e({type:`lazy`,getter:t})}function Qo(e,t){return new e({type:`promise`,innerType:t})}function $o(e,t,n){let r=_(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function es(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,..._(n)})}function ts(e){let t=ns(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(We(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(We(r))}},e(n.value,n)));return t}function ns(e,t){let n=new x({check:`custom`,..._(t)});return n._zod.check=e,n}function rs(e){let t=new x({check:`describe`});return t._zod.onattach=[t=>{let n=w.get(t)??{};w.add(t,{...n,description:e})}],t._zod.check=()=>{},t}function is(e){let t=new x({check:`meta`});return t._zod.onattach=[t=>{let n=w.get(t)??{};w.add(t,{...n,...e})}],t._zod.check=()=>{},t}function as(e,t){let n=_(t),r=n.truthy??[`true`,`1`,`yes`,`on`,`y`,`enabled`],i=n.falsy??[`false`,`0`,`no`,`off`,`n`,`disabled`];n.case!==`sensitive`&&(r=r.map(e=>typeof e==`string`?e.toLowerCase():e),i=i.map(e=>typeof e==`string`?e.toLowerCase():e));let a=new Set(r),o=new Set(i),s=e.Codec??zi,c=e.Boolean??Hr,l=new s({type:`pipe`,in:new(e.String??dr)({type:`string`,error:n.error}),out:new c({type:`boolean`,error:n.error}),transform:((e,t)=>{let r=e;return n.case!==`sensitive`&&(r=r.toLowerCase()),a.has(r)?!0:o.has(r)?!1:(t.issues.push({code:`invalid_value`,expected:`stringbool`,values:[...a,...o],input:t.value,inst:l,continue:!1}),{})}),reverseTransform:((e,t)=>e===!0?r[0]||`true`:i[0]||`false`),error:n.error});return l}function os(e,t,n,r={}){let i=_(r),a={..._(r),check:`string_format`,type:`string`,format:t,fn:typeof n==`function`?n:e=>n.test(e),...i};return n instanceof RegExp&&(a.pattern=n),new e(a)}function ss(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??w,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function D(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,D(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&O(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function cs(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
39
|
-
|
|
40
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function ls(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:ds(t,`input`,e.processors),output:ds(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function O(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return O(r.element,n);if(r.type===`set`)return O(r.valueType,n);if(r.type===`lazy`)return O(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return O(r.innerType,n);if(r.type===`intersection`)return O(r.left,n)||O(r.right,n);if(r.type===`record`||r.type===`map`)return O(r.keyType,n)||O(r.valueType,n);if(r.type===`pipe`)return O(r.in,n)||O(r.out,n);if(r.type===`object`){for(let e in r.shape)if(O(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(O(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(O(e,n))return!0;return!!(r.rest&&O(r.rest,n))}return!1}const us=(e,t={})=>n=>{let r=ss({...n,processors:t});return D(e,r),cs(r,e),ls(r,e)},ds=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=ss({...i??{},target:a,io:t,processors:n});return D(e,o),cs(o,e),ls(o,e)},fs={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ps=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=fs[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},ms=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},hs=(e,t,n,r)=>{n.type=`boolean`},gs=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`)},_s=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`)},vs=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},ys=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`)},bs=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},xs=(e,t,n,r)=>{n.not={}},Ss=(e,t,n,r)=>{},Cs=(e,t,n,r)=>{},ws=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},Ts=(e,t,n,r)=>{let i=e._zod.def,a=ie(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Es=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},Ds=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`)},Os=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},ks=(e,t,n,r)=>{let i=n,a={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:o,maximum:s,mime:c}=e._zod.bag;o!==void 0&&(a.minLength=o),s!==void 0&&(a.maxLength=s),c?c.length===1?(a.contentMediaType=c[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=c.map(e=>({contentMediaType:e}))):Object.assign(i,a)},As=(e,t,n,r)=>{n.type=`boolean`},js=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Ms=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},Ns=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Ps=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`)},Fs=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`)},Is=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=D(a.element,t,{...r,path:[...r.path,`items`]})},Ls=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=D(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=D(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Rs=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>D(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},zs=(e,t,n,r)=>{let i=e._zod.def,a=D(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=D(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Bs=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>D(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?D(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:ee}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof ee==`number`&&(i.maxItems=ee)},Vs=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=D(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=D(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=D(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Hs=(e,t,n,r)=>{let i=e._zod.def,a=D(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Us=(e,t,n,r)=>{let i=e._zod.def;D(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ws=(e,t,n,r)=>{let i=e._zod.def;D(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Gs=(e,t,n,r)=>{let i=e._zod.def;D(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Ks=(e,t,n,r)=>{let i=e._zod.def;D(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},qs=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;D(a,t,r);let o=t.seen.get(e);o.ref=a},Js=(e,t,n,r)=>{let i=e._zod.def;D(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Ys=(e,t,n,r)=>{let i=e._zod.def;D(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Xs=(e,t,n,r)=>{let i=e._zod.def;D(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Zs=(e,t,n,r)=>{let i=e._zod.innerType;D(i,t,r);let a=t.seen.get(e);a.ref=i},Qs={string:ps,number:ms,boolean:hs,bigint:gs,symbol:_s,null:vs,undefined:ys,void:bs,never:xs,any:Ss,unknown:Cs,date:ws,enum:Ts,literal:Es,nan:Ds,template_literal:Os,file:ks,success:As,custom:js,function:Ms,transform:Ns,map:Ps,set:Fs,array:Is,object:Ls,union:Rs,intersection:zs,tuple:Bs,record:Vs,nullable:Hs,nonoptional:Us,default:Ws,prefault:Gs,catch:Ks,pipe:qs,readonly:Js,promise:Ys,optional:Xs,lazy:Zs};function $s(e,t){if(`_idmap`in e){let n=e,r=ss({...t,processors:Qs}),i={};for(let e of n._idmap.entries()){let[t,n]=e;D(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;cs(r,n),a[t]=ls(r,n)}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=ss({...t,processors:Qs});return D(e,n),cs(n,e),ls(n,e)}var ec=e({ZodISODate:()=>rc,ZodISODateTime:()=>tc,ZodISODuration:()=>sc,ZodISOTime:()=>ac,date:()=>ic,datetime:()=>nc,duration:()=>cc,time:()=>oc});const tc=r(`ZodISODateTime`,(e,t)=>{Cr.init(e,t),M.init(e,t)});function nc(e){return Da(tc,e)}const rc=r(`ZodISODate`,(e,t)=>{wr.init(e,t),M.init(e,t)});function ic(e){return Oa(rc,e)}const ac=r(`ZodISOTime`,(e,t)=>{Tr.init(e,t),M.init(e,t)});function oc(e){return ka(ac,e)}const sc=r(`ZodISODuration`,(e,t)=>{Er.init(e,t),M.init(e,t)});function cc(e){return Aa(sc,e)}const lc=(e,t)=>{et.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>nt(e,t)},flatten:{value:t=>tt(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,oe,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,oe,2)}},isEmpty:{get(){return e.issues.length===0}}})},uc=r(`ZodError`,lc),k=r(`ZodError`,lc,{Parent:Error}),dc=ot(k),fc=ct(k),pc=ut(k),mc=ft(k),hc=mt(k),gc=gt(k),_c=vt(k),vc=bt(k),yc=St(k),bc=wt(k),xc=Et(k),Sc=Ot(k);var Cc=e({ZodAny:()=>Rl,ZodArray:()=>ql,ZodBase64:()=>sl,ZodBase64URL:()=>ll,ZodBigInt:()=>Ol,ZodBigIntFormat:()=>Al,ZodBoolean:()=>Dl,ZodCIDRv4:()=>rl,ZodCIDRv6:()=>al,ZodCUID:()=>Vc,ZodCUID2:()=>Uc,ZodCatch:()=>Lu,ZodCodec:()=>Uu,ZodCustom:()=>td,ZodCustomStringFormat:()=>hl,ZodDate:()=>Gl,ZodDefault:()=>ku,ZodDiscriminatedUnion:()=>nu,ZodE164:()=>dl,ZodEmail:()=>Ec,ZodEmoji:()=>Lc,ZodEnum:()=>hu,ZodExactOptional:()=>wu,ZodFile:()=>vu,ZodFunction:()=>$u,ZodGUID:()=>Oc,ZodIPv4:()=>Zc,ZodIPv6:()=>tl,ZodIntersection:()=>iu,ZodJWT:()=>pl,ZodKSUID:()=>Yc,ZodLazy:()=>Yu,ZodLiteral:()=>_u,ZodMAC:()=>$c,ZodMap:()=>du,ZodNaN:()=>zu,ZodNanoID:()=>zc,ZodNever:()=>Vl,ZodNonOptional:()=>Nu,ZodNull:()=>Il,ZodNullable:()=>Eu,ZodNumber:()=>bl,ZodNumberFormat:()=>xl,ZodObject:()=>Yl,ZodOptional:()=>Su,ZodPipe:()=>Vu,ZodPrefault:()=>ju,ZodPromise:()=>Zu,ZodReadonly:()=>Gu,ZodRecord:()=>cu,ZodSet:()=>pu,ZodString:()=>Tc,ZodStringFormat:()=>M,ZodSuccess:()=>Fu,ZodSymbol:()=>Nl,ZodTemplateLiteral:()=>qu,ZodTransform:()=>bu,ZodTuple:()=>ou,ZodType:()=>A,ZodULID:()=>Gc,ZodURL:()=>Pc,ZodUUID:()=>N,ZodUndefined:()=>Fl,ZodUnion:()=>Ql,ZodUnknown:()=>Bl,ZodVoid:()=>Ul,ZodXID:()=>qc,ZodXor:()=>eu,_ZodString:()=>wc,_default:()=>Au,_function:()=>ed,any:()=>zl,array:()=>R,base64:()=>cl,base64url:()=>ul,bigint:()=>kl,boolean:()=>F,catch:()=>Ru,check:()=>nd,cidrv4:()=>il,cidrv6:()=>ol,codec:()=>Wu,cuid:()=>Hc,cuid2:()=>Wc,custom:()=>rd,date:()=>Kl,describe:()=>od,discriminatedUnion:()=>ru,e164:()=>fl,email:()=>Dc,emoji:()=>Rc,enum:()=>V,exactOptional:()=>Tu,file:()=>yu,float32:()=>Cl,float64:()=>wl,function:()=>ed,guid:()=>kc,hash:()=>yl,hex:()=>vl,hostname:()=>_l,httpUrl:()=>Ic,instanceof:()=>cd,int:()=>Sl,int32:()=>Tl,int64:()=>jl,intersection:()=>au,ipv4:()=>Qc,ipv6:()=>nl,json:()=>ud,jwt:()=>ml,keyof:()=>Jl,ksuid:()=>Xc,lazy:()=>Xu,literal:()=>H,looseObject:()=>Zl,looseRecord:()=>uu,mac:()=>el,map:()=>fu,meta:()=>sd,nan:()=>Bu,nanoid:()=>Bc,nativeEnum:()=>gu,never:()=>Hl,nonoptional:()=>Pu,null:()=>Ll,nullable:()=>Du,nullish:()=>Ou,number:()=>P,object:()=>z,optional:()=>Cu,partialRecord:()=>lu,pipe:()=>Hu,prefault:()=>Mu,preprocess:()=>dd,promise:()=>Qu,readonly:()=>Ku,record:()=>B,refine:()=>id,set:()=>mu,strictObject:()=>Xl,string:()=>j,stringFormat:()=>gl,stringbool:()=>ld,success:()=>Iu,superRefine:()=>ad,symbol:()=>Pl,templateLiteral:()=>Ju,transform:()=>xu,tuple:()=>su,uint32:()=>El,uint64:()=>Ml,ulid:()=>Kc,undefined:()=>I,union:()=>$l,unknown:()=>L,url:()=>Fc,uuid:()=>Ac,uuidv4:()=>jc,uuidv6:()=>Mc,uuidv7:()=>Nc,void:()=>Wl,xid:()=>Jc,xor:()=>tu});const A=r(`ZodType`,(e,t)=>(S.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:ds(e,`input`),output:ds(e,`output`)}}),e.toJSONSchema=us(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(p(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>g(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>dc(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>pc(e,t,n),e.parseAsync=async(t,n)=>fc(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>mc(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>hc(e,t,n),e.decode=(t,n)=>gc(e,t,n),e.encodeAsync=async(t,n)=>_c(e,t,n),e.decodeAsync=async(t,n)=>vc(e,t,n),e.safeEncode=(t,n)=>yc(e,t,n),e.safeDecode=(t,n)=>bc(e,t,n),e.safeEncodeAsync=async(t,n)=>xc(e,t,n),e.safeDecodeAsync=async(t,n)=>Sc(e,t,n),e.refine=(t,n)=>e.check(id(t,n)),e.superRefine=t=>e.check(ad(t)),e.overwrite=t=>e.check(So(t)),e.optional=()=>Cu(e),e.exactOptional=()=>Tu(e),e.nullable=()=>Du(e),e.nullish=()=>Cu(Du(e)),e.nonoptional=t=>Pu(e,t),e.array=()=>R(e),e.or=t=>$l([e,t]),e.and=t=>au(e,t),e.transform=t=>Hu(e,xu(t)),e.default=t=>Au(e,t),e.prefault=t=>Mu(e,t),e.catch=t=>Ru(e,t),e.pipe=t=>Hu(e,t),e.readonly=()=>Ku(e),e.describe=t=>{let n=e.clone();return w.add(n,{description:t}),n},Object.defineProperty(e,"description",{get(){return w.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return w.get(e);let n=e.clone();return w.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),wc=r(`_ZodString`,(e,t)=>{dr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ps(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(mo(...t)),e.includes=(...t)=>e.check(_o(...t)),e.startsWith=(...t)=>e.check(vo(...t)),e.endsWith=(...t)=>e.check(yo(...t)),e.min=(...t)=>e.check(fo(...t)),e.max=(...t)=>e.check(uo(...t)),e.length=(...t)=>e.check(po(...t)),e.nonempty=(...t)=>e.check(fo(1,...t)),e.lowercase=t=>e.check(ho(t)),e.uppercase=t=>e.check(go(t)),e.trim=()=>e.check(wo()),e.normalize=(...t)=>e.check(Co(...t)),e.toLowerCase=()=>e.check(To()),e.toUpperCase=()=>e.check(Eo()),e.slugify=()=>e.check(Do())}),Tc=r(`ZodString`,(e,t)=>{dr.init(e,t),wc.init(e,t),e.email=t=>e.check(ra(Ec,t)),e.url=t=>e.check(la(Pc,t)),e.jwt=t=>e.check(Ta(pl,t)),e.emoji=t=>e.check(ua(Lc,t)),e.guid=t=>e.check(ia(Oc,t)),e.uuid=t=>e.check(aa(N,t)),e.uuidv4=t=>e.check(oa(N,t)),e.uuidv6=t=>e.check(sa(N,t)),e.uuidv7=t=>e.check(ca(N,t)),e.nanoid=t=>e.check(da(zc,t)),e.guid=t=>e.check(ia(Oc,t)),e.cuid=t=>e.check(fa(Vc,t)),e.cuid2=t=>e.check(pa(Uc,t)),e.ulid=t=>e.check(ma(Gc,t)),e.base64=t=>e.check(Sa(sl,t)),e.base64url=t=>e.check(Ca(ll,t)),e.xid=t=>e.check(ha(qc,t)),e.ksuid=t=>e.check(ga(Yc,t)),e.ipv4=t=>e.check(_a(Zc,t)),e.ipv6=t=>e.check(va(tl,t)),e.cidrv4=t=>e.check(ba(rl,t)),e.cidrv6=t=>e.check(xa(al,t)),e.e164=t=>e.check(wa(dl,t)),e.datetime=t=>e.check(nc(t)),e.date=t=>e.check(ic(t)),e.time=t=>e.check(oc(t)),e.duration=t=>e.check(cc(t))});function j(e){return ta(Tc,e)}const M=r(`ZodStringFormat`,(e,t)=>{C.init(e,t),wc.init(e,t)}),Ec=r(`ZodEmail`,(e,t)=>{mr.init(e,t),M.init(e,t)});function Dc(e){return ra(Ec,e)}const Oc=r(`ZodGUID`,(e,t)=>{fr.init(e,t),M.init(e,t)});function kc(e){return ia(Oc,e)}const N=r(`ZodUUID`,(e,t)=>{pr.init(e,t),M.init(e,t)});function Ac(e){return aa(N,e)}function jc(e){return oa(N,e)}function Mc(e){return sa(N,e)}function Nc(e){return ca(N,e)}const Pc=r(`ZodURL`,(e,t)=>{hr.init(e,t),M.init(e,t)});function Fc(e){return la(Pc,e)}function Ic(e){return la(Pc,{protocol:/^https?$/,hostname:on,..._(e)})}const Lc=r(`ZodEmoji`,(e,t)=>{gr.init(e,t),M.init(e,t)});function Rc(e){return ua(Lc,e)}const zc=r(`ZodNanoID`,(e,t)=>{_r.init(e,t),M.init(e,t)});function Bc(e){return da(zc,e)}const Vc=r(`ZodCUID`,(e,t)=>{vr.init(e,t),M.init(e,t)});function Hc(e){return fa(Vc,e)}const Uc=r(`ZodCUID2`,(e,t)=>{yr.init(e,t),M.init(e,t)});function Wc(e){return pa(Uc,e)}const Gc=r(`ZodULID`,(e,t)=>{br.init(e,t),M.init(e,t)});function Kc(e){return ma(Gc,e)}const qc=r(`ZodXID`,(e,t)=>{xr.init(e,t),M.init(e,t)});function Jc(e){return ha(qc,e)}const Yc=r(`ZodKSUID`,(e,t)=>{Sr.init(e,t),M.init(e,t)});function Xc(e){return ga(Yc,e)}const Zc=r(`ZodIPv4`,(e,t)=>{Dr.init(e,t),M.init(e,t)});function Qc(e){return _a(Zc,e)}const $c=r(`ZodMAC`,(e,t)=>{kr.init(e,t),M.init(e,t)});function el(e){return ya($c,e)}const tl=r(`ZodIPv6`,(e,t)=>{Or.init(e,t),M.init(e,t)});function nl(e){return va(tl,e)}const rl=r(`ZodCIDRv4`,(e,t)=>{Ar.init(e,t),M.init(e,t)});function il(e){return ba(rl,e)}const al=r(`ZodCIDRv6`,(e,t)=>{jr.init(e,t),M.init(e,t)});function ol(e){return xa(al,e)}const sl=r(`ZodBase64`,(e,t)=>{Nr.init(e,t),M.init(e,t)});function cl(e){return Sa(sl,e)}const ll=r(`ZodBase64URL`,(e,t)=>{Fr.init(e,t),M.init(e,t)});function ul(e){return Ca(ll,e)}const dl=r(`ZodE164`,(e,t)=>{Ir.init(e,t),M.init(e,t)});function fl(e){return wa(dl,e)}const pl=r(`ZodJWT`,(e,t)=>{Rr.init(e,t),M.init(e,t)});function ml(e){return Ta(pl,e)}const hl=r(`ZodCustomStringFormat`,(e,t)=>{zr.init(e,t),M.init(e,t)});function gl(e,t,n={}){return os(hl,e,t,n)}function _l(e){return os(hl,`hostname`,an,e)}function vl(e){return os(hl,`hex`,Sn,e)}function yl(e,t){let n=`${e}_${t?.enc??`hex`}`,r=At[n];if(!r)throw Error(`Unrecognized hash format: ${n}`);return os(hl,n,r,t)}const bl=r(`ZodNumber`,(e,t)=>{Br.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ms(e,t,n,r),e.gt=(t,n)=>e.check(to(t,n)),e.gte=(t,n)=>e.check(E(t,n)),e.min=(t,n)=>e.check(E(t,n)),e.lt=(t,n)=>e.check(eo(t,n)),e.lte=(t,n)=>e.check(T(t,n)),e.max=(t,n)=>e.check(T(t,n)),e.int=t=>e.check(Sl(t)),e.safe=t=>e.check(Sl(t)),e.positive=t=>e.check(to(0,t)),e.nonnegative=t=>e.check(E(0,t)),e.negative=t=>e.check(eo(0,t)),e.nonpositive=t=>e.check(T(0,t)),e.multipleOf=(t,n)=>e.check(oo(t,n)),e.step=(t,n)=>e.check(oo(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function P(e){return ja(bl,e)}const xl=r(`ZodNumberFormat`,(e,t)=>{Vr.init(e,t),bl.init(e,t)});function Sl(e){return Na(xl,e)}function Cl(e){return Pa(xl,e)}function wl(e){return Fa(xl,e)}function Tl(e){return Ia(xl,e)}function El(e){return La(xl,e)}const Dl=r(`ZodBoolean`,(e,t)=>{Hr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hs(e,t,n,r)});function F(e){return Ra(Dl,e)}const Ol=r(`ZodBigInt`,(e,t)=>{Ur.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gs(e,t,n,r),e.gte=(t,n)=>e.check(E(t,n)),e.min=(t,n)=>e.check(E(t,n)),e.gt=(t,n)=>e.check(to(t,n)),e.gte=(t,n)=>e.check(E(t,n)),e.min=(t,n)=>e.check(E(t,n)),e.lt=(t,n)=>e.check(eo(t,n)),e.lte=(t,n)=>e.check(T(t,n)),e.max=(t,n)=>e.check(T(t,n)),e.positive=t=>e.check(to(BigInt(0),t)),e.negative=t=>e.check(eo(BigInt(0),t)),e.nonpositive=t=>e.check(T(BigInt(0),t)),e.nonnegative=t=>e.check(E(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(oo(t,n));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function kl(e){return Ba(Ol,e)}const Al=r(`ZodBigIntFormat`,(e,t)=>{Wr.init(e,t),Ol.init(e,t)});function jl(e){return Ha(Al,e)}function Ml(e){return Ua(Al,e)}const Nl=r(`ZodSymbol`,(e,t)=>{Gr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_s(e,t,n,r)});function Pl(e){return Wa(Nl,e)}const Fl=r(`ZodUndefined`,(e,t)=>{Kr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ys(e,t,n,r)});function I(e){return Ga(Fl,e)}const Il=r(`ZodNull`,(e,t)=>{qr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vs(e,t,n,r)});function Ll(e){return Ka(Il,e)}const Rl=r(`ZodAny`,(e,t)=>{Jr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function zl(){return qa(Rl)}const Bl=r(`ZodUnknown`,(e,t)=>{Yr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function L(){return Ja(Bl)}const Vl=r(`ZodNever`,(e,t)=>{Xr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xs(e,t,n,r)});function Hl(e){return Ya(Vl,e)}const Ul=r(`ZodVoid`,(e,t)=>{Zr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bs(e,t,n,r)});function Wl(e){return Xa(Ul,e)}const Gl=r(`ZodDate`,(e,t)=>{Qr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ws(e,t,n,r),e.min=(t,n)=>e.check(E(t,n)),e.max=(t,n)=>e.check(T(t,n));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function Kl(e){return Za(Gl,e)}const ql=r(`ZodArray`,(e,t)=>{ei.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Is(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(fo(t,n)),e.nonempty=t=>e.check(fo(1,t)),e.max=(t,n)=>e.check(uo(t,n)),e.length=(t,n)=>e.check(po(t,n)),e.unwrap=()=>e.element});function R(e,t){return Oo(ql,e,t)}function Jl(e){let t=e._zod.def.shape;return V(Object.keys(t))}const Yl=r(`ZodObject`,(e,t)=>{ai.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ls(e,t,n,r),d(e,`shape`,()=>t.shape),e.keyof=()=>V(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:L()}),e.loose=()=>e.clone({...e._zod.def,catchall:L()}),e.strict=()=>e.clone({...e._zod.def,catchall:Hl()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>Pe(e,t),e.safeExtend=t=>Fe(e,t),e.merge=t=>Ie(e,t),e.pick=t=>Me(e,t),e.omit=t=>Ne(e,t),e.partial=(...t)=>Le(Su,e,t[0]),e.required=(...t)=>Re(Nu,e,t[0])});function z(e,t){let n={type:`object`,shape:e??{},..._(t)};return new Yl(n)}function Xl(e,t){return new Yl({type:`object`,shape:e,catchall:Hl(),..._(t)})}function Zl(e,t){return new Yl({type:`object`,shape:e,catchall:L(),..._(t)})}const Ql=r(`ZodUnion`,(e,t)=>{si.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rs(e,t,n,r),e.options=t.options});function $l(e,t){return new Ql({type:`union`,options:e,..._(t)})}const eu=r(`ZodXor`,(e,t)=>{Ql.init(e,t),li.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rs(e,t,n,r),e.options=t.options});function tu(e,t){return new eu({type:`union`,options:e,inclusive:!1,..._(t)})}const nu=r(`ZodDiscriminatedUnion`,(e,t)=>{Ql.init(e,t),ui.init(e,t)});function ru(e,t,n){return new nu({type:`union`,options:t,discriminator:e,..._(n)})}const iu=r(`ZodIntersection`,(e,t)=>{di.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zs(e,t,n,r)});function au(e,t){return new iu({type:`intersection`,left:e,right:t})}const ou=r(`ZodTuple`,(e,t)=>{mi.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bs(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function su(e,t,n){let r=t instanceof S;return new ou({type:`tuple`,items:e,rest:r?t:null,..._(r?n:t)})}const cu=r(`ZodRecord`,(e,t)=>{gi.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vs(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function B(e,t,n){return new cu({type:`record`,keyType:e,valueType:t,..._(n)})}function lu(e,t,n){let r=g(e);return r._zod.values=void 0,new cu({type:`record`,keyType:r,valueType:t,..._(n)})}function uu(e,t,n){return new cu({type:`record`,keyType:e,valueType:t,mode:`loose`,..._(n)})}const du=r(`ZodMap`,(e,t)=>{_i.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ps(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...t)=>e.check(co(...t)),e.nonempty=t=>e.check(co(1,t)),e.max=(...t)=>e.check(so(...t)),e.size=(...t)=>e.check(lo(...t))});function fu(e,t,n){return new du({type:`map`,keyType:e,valueType:t,..._(n)})}const pu=r(`ZodSet`,(e,t)=>{yi.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fs(e,t,n,r),e.min=(...t)=>e.check(co(...t)),e.nonempty=t=>e.check(co(1,t)),e.max=(...t)=>e.check(so(...t)),e.size=(...t)=>e.check(lo(...t))});function mu(e,t){return new pu({type:`set`,valueType:e,..._(t)})}const hu=r(`ZodEnum`,(e,t)=>{xi.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ts(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new hu({...t,checks:[],..._(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new hu({...t,checks:[],..._(r),entries:i})}});function V(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new hu({type:`enum`,entries:n,..._(t)})}function gu(e,t){return new hu({type:`enum`,entries:e,..._(t)})}const _u=r(`ZodLiteral`,(e,t)=>{Si.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Es(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function H(e,t){return new _u({type:`literal`,values:Array.isArray(e)?e:[e],..._(t)})}const vu=r(`ZodFile`,(e,t)=>{Ci.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ks(e,t,n,r),e.min=(t,n)=>e.check(co(t,n)),e.max=(t,n)=>e.check(so(t,n)),e.mime=(t,n)=>e.check(xo(Array.isArray(t)?t:[t],n))});function yu(e){return Bo(vu,e)}const bu=r(`ZodTransform`,(e,t)=>{wi.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ns(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new o(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(We(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(We(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function xu(e){return new bu({type:`transform`,transform:e})}const Su=r(`ZodOptional`,(e,t)=>{Ei.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Cu(e){return new Su({type:`optional`,innerType:e})}const wu=r(`ZodExactOptional`,(e,t)=>{Di.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Tu(e){return new wu({type:`optional`,innerType:e})}const Eu=r(`ZodNullable`,(e,t)=>{Oi.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Du(e){return new Eu({type:`nullable`,innerType:e})}function Ou(e){return Cu(Du(e))}const ku=r(`ZodDefault`,(e,t)=>{ki.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ws(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Au(e,t){return new ku({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Se(t)}})}const ju=r(`ZodPrefault`,(e,t)=>{ji.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Mu(e,t){return new ju({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Se(t)}})}const Nu=r(`ZodNonOptional`,(e,t)=>{Mi.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Us(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Pu(e,t){return new Nu({type:`nonoptional`,innerType:e,..._(t)})}const Fu=r(`ZodSuccess`,(e,t)=>{Pi.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>As(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Iu(e){return new Fu({type:`success`,innerType:e})}const Lu=r(`ZodCatch`,(e,t)=>{Fi.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ks(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ru(e,t){return new Lu({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}const zu=r(`ZodNaN`,(e,t)=>{Ii.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ds(e,t,n,r)});function Bu(e){return $a(zu,e)}const Vu=r(`ZodPipe`,(e,t)=>{Li.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qs(e,t,n,r),e.in=t.in,e.out=t.out});function Hu(e,t){return new Vu({type:`pipe`,in:e,out:t})}const Uu=r(`ZodCodec`,(e,t)=>{Vu.init(e,t),zi.init(e,t)});function Wu(e,t,n){return new Uu({type:`pipe`,in:e,out:t,transform:n.decode,reverseTransform:n.encode})}const Gu=r(`ZodReadonly`,(e,t)=>{Hi.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Js(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ku(e){return new Gu({type:`readonly`,innerType:e})}const qu=r(`ZodTemplateLiteral`,(e,t)=>{Wi.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Os(e,t,n,r)});function Ju(e,t){return new qu({type:`template_literal`,parts:e,..._(t)})}const Yu=r(`ZodLazy`,(e,t)=>{qi.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zs(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Xu(e){return new Yu({type:`lazy`,getter:e})}const Zu=r(`ZodPromise`,(e,t)=>{Ki.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ys(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Qu(e){return new Zu({type:`promise`,innerType:e})}const $u=r(`ZodFunction`,(e,t)=>{Gi.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ms(e,t,n,r)});function ed(e){return new $u({type:`function`,input:Array.isArray(e?.input)?su(e?.input):e?.input??R(L()),output:e?.output??L()})}const td=r(`ZodCustom`,(e,t)=>{Ji.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>js(e,t,n,r)});function nd(e){let t=new x({check:`custom`});return t._zod.check=e,t}function rd(e,t){return $o(td,e??(()=>!0),t)}function id(e,t={}){return es(td,e,t)}function ad(e){return ts(e)}const od=rs,sd=is;function cd(e,t={}){let n=new td({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,..._(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:`invalid_type`,expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}const ld=(...e)=>as({Codec:Uu,Boolean:Dl,String:Tc},...e);function ud(e){let t=Xu(()=>$l([j(e),P(),F(),Ll(),R(t),B(j(),t)]));return t}function dd(e,t){return Hu(xu(e),t)}var fd=e({bigint:()=>gd,boolean:()=>hd,date:()=>U,number:()=>md,string:()=>pd});function pd(e){return na(Tc,e)}function md(e){return Ma(bl,e)}function hd(e){return za(Dl,e)}function gd(e){return Va(Ol,e)}function U(e){return Qa(Gl,e)}const _d=`$rootRunId`,vd=`$parentRunId`,yd=new TextEncoder;var W=class extends Error{constructor(e){super(e),this.name=`AttributeValidationError`}};function bd(e,t){if(typeof e!=`string`)throw new W(`Attribute key must be a string, got ${typeof e}`);if(e.length===0)throw new W(`Attribute key must not be empty`);if(e.length>256)throw new W(`Attribute key length ${e.length} exceeds limit 256: ${JSON.stringify(e.slice(0,32))}…`);if(!t&&e.startsWith(`$`))throw new W(`Attribute key ${JSON.stringify(e)} starts with reserved prefix "\$" — that namespace is reserved for framework/library code. Set { allowReservedAttributes: true } only if your caller is framework-level.`)}function xd(e){if(e!==null&&typeof e!=`string`)throw new W(`Attribute value must be a string or null, got ${typeof e}`);if(e===null)return;let t=yd.encode(e).length;if(t>256)throw new W(`Attribute value byte length ${t} exceeds limit 256`)}function Sd(e,t,n){return t===null?n?.has(e)?-1:0:+(n===void 0||!n.has(e))}function Cd(e,t={}){let n=new Set,r=t.existingKeys===void 0?void 0:t.existingKeys instanceof Set?t.existingKeys:new Set(t.existingKeys),i=r?.size??0;for(let{key:t,value:a}of e){if(n.has(t))throw new W(`Attribute key ${JSON.stringify(t)} appears more than once in the same batch`);n.add(t),i+=Sd(t,a,r)}if(i>64)throw new W(`Run attribute count would exceed limit 64 (post-merge ${i})`)}function wd(e,t={}){for(let{key:n,value:r}of e)bd(n,t.allowReservedAttributes===!0),xd(r);Cd(e,t)}function Td(e,t){let n={...e??{}};for(let{key:e,value:r}of t)r===null?delete n[e]:n[e]=r;return n}const Ed=new TextEncoder,Dd=R(z({key:j().min(1,{error:`Attribute key must not be empty`}).max(256,{error:`Attribute key exceeds limit 256`}),value:j().refine(e=>Ed.encode(e).length<=256,{error:`Attribute value exceeds limit 256 UTF-8 bytes`}).nullable()})).superRefine((e,t)=>{try{Cd(e)}catch(n){if(!(n instanceof W))throw n;t.addIssue({code:`custom`,message:n.message,input:e})}});function Od(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function kd(e){return e.eventType===`noop`}const Ad={attr_set:`attr_set`,step_created:`step_created`,step_started:`step_started`,step_retrying:`step_retrying`,step_completed:`step_terminal`,step_failed:`step_terminal`,wait_created:`wait_created`,wait_completed:`wait_completed`,hook_created:`hook_created`,hook_disposed:`hook_disposed`,run_started:`run_started`};function jd(e){return Od(Ad,e)}function Md(e){let t=jd(e.eventType);if(t!==void 0)return t===`run_started`?{eventClass:t,entity:``}:e.correlationId?{eventClass:t,entity:e.correlationId}:void 0}const Nd={run_created:[`input`],run_started:[`input`],run_completed:[`output`],run_failed:[`error`],step_created:[`input`],step_started:[`input`],step_completed:[`result`],step_failed:[`error`],step_retrying:[`error`],hook_created:[`metadata`],hook_received:[`payload`]},Pd=[];function Fd(e){return Od(Nd,e)??Pd}function Id(e){return Fd(e)[0]}const G=$l([cd(Uint8Array),zl()]),K=V([`run_created`,`run_started`,`run_completed`,`run_failed`,`run_cancelled`,`attr_set`,`step_created`,`step_completed`,`step_failed`,`step_retrying`,`step_started`,`hook_created`,`hook_received`,`hook_disposed`,`hook_conflict`,`wait_created`,`wait_completed`,`noop`]);K.extract([`run_created`,`run_started`,`run_completed`,`run_failed`,`run_cancelled`]).options;const Ld=K.extract([`run_completed`,`run_failed`,`run_cancelled`]).options;function Rd(e){return Ld.includes(e)}const zd=K.extract([`step_created`,`step_completed`,`step_failed`,`step_retrying`,`step_started`]).options;function Bd(e){return zd.includes(e)}K.extract([`step_completed`,`step_failed`]).options;const Vd=K.extract([`hook_created`,`hook_received`,`hook_disposed`]).options;function Hd(e){return Vd.includes(e)}const Ud=K.extract([`hook_disposed`,`hook_received`]).options;function Wd(e){return Ud.includes(e)}K.extract([`wait_created`,`wait_completed`]).options;const Gd=K.extract([`step_created`,`hook_created`,`wait_created`]).options;function Kd(e){return Gd.includes(e)}function qd(e,t){if(t!==`none`||!(`eventData`in e))return e;let n=e.eventData;if(!n||typeof n!=`object`){let{eventData:t,...n}=e;return n}let r=Fd(e.eventType);if(r.length===0)return e;let i={...n};for(let e of r)delete i[e];let{eventData:a,...o}=e;return{...o,...Object.keys(i).length>0?{eventData:i}:{}}}const q=z({eventType:K,correlationId:j().optional(),specVersion:P().optional()}),Jd={ttfs:P().optional(),stso:P().optional(),stepCount:P().int().positive().optional(),eventCount:P().int().positive().optional(),rsfs:P().optional(),finalSchedulingReplay:P().optional(),optimizations:R(j()).optional()},Yd=q.extend({eventType:H(`step_completed`),correlationId:j(),eventData:z({stepName:j().optional(),workflowName:j().optional(),result:G,...Jd})}),Xd=q.extend({eventType:H(`step_failed`),correlationId:j(),eventData:z({stepName:j().optional(),error:G,...Jd})}),Zd=q.extend({eventType:H(`step_retrying`),correlationId:j(),eventData:z({stepName:j().optional(),error:G,retryAfter:U().optional()})}),Qd=q.extend({eventType:H(`step_started`),correlationId:j(),eventData:z({stepName:j().optional(),attempt:P().optional(),workflowName:j().optional(),input:G.optional(),ownerMessageId:j().optional()}).optional()}),$d=q.extend({eventType:H(`step_created`),correlationId:j(),eventData:z({stepName:j(),workflowName:j().optional(),input:G})}),ef=q.extend({eventType:H(`hook_created`),correlationId:j(),eventData:z({token:j(),tokenRetentionUntil:U().optional(),metadata:G.optional(),isWebhook:F().optional(),isSystem:F().optional()})}),tf=q.extend({eventType:H(`hook_received`),correlationId:j(),eventData:z({token:j().optional(),payload:G})}),nf=q.extend({eventType:H(`hook_disposed`),correlationId:j(),eventData:z({token:j().optional()}).optional()}),rf=q.extend({eventType:H(`hook_conflict`),correlationId:j(),eventData:z({token:j(),conflictingRunId:j().optional()})}),af=q.extend({eventType:H(`noop`),eventData:z({sealed:F().optional()}).passthrough().optional()}),of=q.extend({eventType:H(`wait_created`),correlationId:j(),eventData:z({resumeAt:U()})}),sf=q.extend({eventType:H(`wait_completed`),correlationId:j(),eventData:z({resumeAt:U().optional()}).optional()}),cf=ru(`type`,[z({type:H(`workflow`)}),z({type:H(`step`),stepId:j(),attempt:P()})]),lf=q.extend({eventType:H(`attr_set`),correlationId:j().optional(),eventData:z({changes:Dd,writer:cf,allowReservedAttributes:H(!0).optional()})}),uf=q.extend({eventType:H(`run_created`),eventData:z({deploymentId:j(),workflowName:j(),input:G,executionContext:B(j(),zl()).optional(),attributes:B(j(),j()).optional(),allowReservedAttributes:H(!0).optional(),encryptionPublicKey:j().optional()})}),df=q.extend({eventType:H(`run_started`),eventData:z({input:G.optional(),deploymentId:j().optional(),workflowName:j().optional(),executionContext:B(j(),zl()).optional(),attributes:B(j(),j()).optional(),allowReservedAttributes:H(!0).optional(),encryptionPublicKey:j().optional()}).optional()}),ff=q.extend({eventType:H(`run_completed`),eventData:z({output:G.optional()})}),pf=q.extend({eventType:H(`run_failed`),eventData:z({error:G,errorCode:j().optional()})}),mf=q.extend({eventType:H(`run_cancelled`),eventData:z({cancelReason:j().max(512).optional()}).optional()});ru(`eventType`,[uf,df,ff,pf,mf,lf,$d,Yd,Xd,Zd,Qd,ef,tf,nf,of,sf]);const hf=ru(`eventType`,[uf,df,ff,pf,mf,lf,$d,Yd,Xd,Zd,Qd,ef,tf,nf,rf,of,sf,af]).and(z({runId:j(),eventId:j(),createdAt:U(),occurredAt:U().optional(),specVersion:P().optional(),resumeId:j().optional()}));function gf(e){return Kd(e.eventType)?!0:e.eventType===`step_started`&&typeof e.eventData?.stepName==`string`&&e.eventData.input!==void 0}const _f=V([`pending`,`running`,`completed`,`failed`,`cancelled`]),vf=_f.extract([`completed`,`failed`,`cancelled`]).options;function yf(e){return vf.includes(e)}const bf=z({runId:j(),status:_f,deploymentId:j(),workflowName:j(),specVersion:P().optional(),executionContext:B(j(),zl()).optional(),input:G.optional(),output:G.optional(),error:G.optional(),errorCode:j().optional(),attributes:B(j(),j()).default({}),encryptionPublicKey:j().optional(),expiredAt:U().optional(),startedAt:U().optional(),completedAt:U().optional(),createdAt:U(),updatedAt:U()}),xf=ru(`status`,[bf.extend({status:V([`pending`,`running`]),output:I().optional(),error:I().optional(),completedAt:I().optional()}),bf.extend({status:H(`cancelled`),output:I().optional(),error:I().optional(),completedAt:U()}),bf.extend({status:H(`completed`),output:G,error:I().optional(),completedAt:U()}),bf.extend({status:H(`failed`),output:I().optional(),error:G,completedAt:U()})]),Sf=z({runIds:R(j()).min(1).max(500).refine(e=>new Set(e).size===e.length,{message:`runIds must not contain duplicates`}),cancelReason:j().max(512).optional()}),Cf=ru(`outcome`,[z({runId:j(),outcome:H(`cancelled`)}),z({runId:j(),outcome:H(`already_cancelled`)}),z({runId:j(),outcome:H(`not_cancellable`),status:j()}),z({runId:j(),outcome:H(`not_found`)}),z({runId:j(),outcome:H(`failed`),code:j(),retryable:F()})]),wf=z({summary:z({requested:P(),cancelled:P(),alreadyCancelled:P(),notCancellable:P(),notFound:P(),failed:P()}),results:R(Cf)}),Tf=V([`pending`,`running`,`completed`,`failed`,`cancelled`]),Ef=z({runId:j(),stepId:j(),stepName:j(),status:Tf,input:G.optional(),output:G.optional(),error:G.optional(),attempt:P(),startedAt:U().optional(),completedAt:U().optional(),createdAt:U(),updatedAt:U(),retryAfter:U().optional(),specVersion:P().optional()}),Df=Tf.extract([`completed`,`failed`,`cancelled`]).options;function Of(e){return Df.includes(e)}const kf=V([`waiting`,`completed`]),Af=z({waitId:j(),runId:j(),status:kf,resumeAt:U().optional(),completedAt:U().optional(),createdAt:U(),updatedAt:U(),specVersion:P().optional()}),jf=/^\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}:\d{2}(?:\.\d+)?$/,J=dd(e=>typeof e==`string`&&jf.test(e)?`${e.replace(` `,`T`)}Z`:e,U()),Y=J.nullable().optional(),X=j().nullable().optional(),Z=F().nullable().optional(),Mf=z({runId:j(),status:_f,deploymentId:j(),workflowName:j(),specVersion:md().optional(),attributes:B(j(),j()).default({}),createdAt:J,updatedAt:J,startedAt:Y,completedAt:Y,errorCode:X,workflowCoreVersion:X,workflowEncryptionEnabled:Z}),Nf=z({runId:j(),stepId:j(),stepName:X,status:Tf,attempt:P().optional(),createdAt:J,updatedAt:J,startedAt:Y,completedAt:Y,retryAfter:Y,errorCode:X,workflowCoreVersion:X,workflowEncryptionEnabled:Z,computeInstanceId:X}),Pf=z({runId:j(),eventId:j(),eventType:K,correlationId:X,entityId:X,stepName:X,workflowName:j(),deploymentId:j(),specVersion:md().optional(),runCreatedAt:J,createdAt:J,region:X,vercelId:X,requestId:X,computeInstanceId:X,resumeAt:Y,retryAfter:Y,errorCode:X,workflowCoreVersion:X,isWebhook:Z,isSystem:Z,workflowEncryptionEnabled:Z}),Ff=z({runId:j(),hookId:j(),status:V([`created`,`received`,`disposed`,`conflict`]),createdAt:J,updatedAt:J,receivedAt:Y,disposedAt:Y,isWebhook:Z,isSystem:Z,workflowCoreVersion:X,workflowEncryptionEnabled:Z}),If=z({runId:j(),waitId:j(),status:kf,resumeAt:Y,createdAt:J,updatedAt:J,completedAt:Y,workflowCoreVersion:X,workflowEncryptionEnabled:Z}),Lf=z({key:j(),runCount:md(),firstSeenAt:U(),lastSeenAt:U()}),Rf=Symbol.for(`@workflow/world//warnedEnvValues/v1`),zf=globalThis,Bf=zf[Rf]??=new Set;function Vf(e,t){Bf.has(e)||(Bf.add(e),console.warn(`[workflow] ${t}`))}function Hf(e,t,n={}){let r=process.env[e];if(r===void 0||r===``)return t;let{min:i=0,max:a,integer:o=!1}=n,s=Number(r);return!Number.isFinite(s)||o&&!Number.isInteger(s)?(Vf(`${e}=${r}`,`Ignoring ${e}: not a ${o?`finite integer`:`finite number`}; using default ${t}`),t):s<i?(Vf(`${e}=${r}`,`${e} below minimum ${i}; clamped`),i):a!==void 0&&s>a?(Vf(`${e}=${r}`,`${e} above maximum ${a}; clamped`),a):s}function Uf(e,t,n=process.env){let r=n[e];if(r===void 0||r===``)return t;let i=r.toLowerCase();return i===`0`||i===`false`?!1:i===`1`||i===`true`?!0:(Vf(`${e}=${r}`,`Ignoring ${e}: expected 0/1/true/false; using default ${t}`),t)}const Wf=25e3;function Gf(){let e=Hf(`WORKFLOW_MAX_EVENTS`,Wf,{integer:!0});return e>0?e:Wf}const Kf=j().regex(/^__(?:[a-z][a-z0-9]*_)?wkf_workflow_$/,`Must match __wkf_workflow_ or __{namespace}_wkf_workflow_`),qf=j().regex(/^__(?:[a-z][a-z0-9]*_)?wkf_workflow_.+$/,`Must be a valid queue name with a recognized prefix`),Jf=j().regex(/^[a-z][a-z0-9]*$/,`Must be lowercase alphanumeric, starting with a letter`);function Yf(e){return e??process.env.WORKFLOW_QUEUE_NAMESPACE??void 0}function Xf(e,t){if(e!==`workflow`)throw Error(`Unsupported queue kind: ${e}`);return t===void 0?`__wkf_workflow_`:(Jf.parse(t),`__${t}_wkf_workflow_`)}function Zf(e){let t=e.match(/^(__(?:[a-z][a-z0-9]*_)?wkf_workflow_)(.+)$/);if(!t)throw Error(`Invalid queue name: ${e}`);return{prefix:Kf.parse(t[1]),id:t[2]}}const Qf=j().brand().describe(`A stored queue message ID`),$f=B(j(),j()),ep=z({input:L(),deploymentId:j(),workflowName:j(),specVersion:P(),executionContext:B(j(),zl()).optional(),attributes:B(j(),j()).optional(),allowReservedAttributes:H(!0).optional(),environment:j().optional()}),tp=z({input:rd(e=>e instanceof Uint8Array,{message:`stepInput.input must be a Uint8Array`})}),np=z({resumeId:j(),hookId:j(),token:j(),payload:L(),payloadDigest:j(),deploymentId:j().optional()}),rp=z({resumeRequestedAtMs:P(),queuePublishRequestedAtMs:P(),strategy:j().optional(),consumerStartedAtMs:P().optional(),replayStartedAtMs:P().optional(),nextStepEncounteredAtMs:P().optional(),setupSource:j().optional()}),ip=z({runId:j(),traceCarrier:$f.optional(),requestedAt:U().optional(),replayDivergence:z({eventId:j(),count:P().int().positive()}).optional(),preconditionReinvocations:P().int().positive().optional(),serverErrorRetryCount:P().int().optional(),deploymentMismatchRetryCount:P().int().nonnegative().optional(),waitContinuation:z({correlationId:j(),attempt:P().int().nonnegative()}).optional().catch(void 0),stepId:j().optional(),stepName:j().optional(),runInput:ep.optional(),hookInput:np.optional(),stepInput:tp.optional(),hookResumeTiming:rp.optional().catch(void 0)}),ap=z({__healthCheck:H(!0),correlationId:j(),runId:j().optional()}),op=$l([ap,ip]),sp=z({deploymentId:j(),workflowName:j(),runSpecVersion:P().optional(),workflowCoreVersion:j().optional(),traceCarrier:$f.optional(),encryptionPublicKey:j().optional(),hookResumeInputVersion:P().optional()}),cp=z({hookResumeDedupVersion:P()}),lp=z({runId:j(),hookId:j(),token:j(),ownerId:j(),projectId:j(),environment:j(),metadata:G.optional(),createdAt:U(),specVersion:P().optional(),isWebhook:F().optional(),isSystem:F().optional(),tokenRetentionUntil:U().optional(),resumeContext:sp.optional(),resumeCapabilities:cp.optional()}),up=`WORKFLOW_NODE_HTTP`;function dp(e=process.env){return Uf(up,!1,e)}async function fp(e,t,n,r){let i=Xf(`workflow`,Yf(r)),a=0;for(let r of[`pending`,`running`]){let o,s=!0;for(;s;){let c=await e.list({status:r,resolveData:`none`,pagination:{cursor:o}});for(let e of c.data)try{await t(`${i}${e.workflowName}`,{runId:e.runId}),a++}catch(t){console.warn(`[${n}] Failed to re-enqueue run ${e.runId}: ${t}`)}s=c.hasMore,o=c.cursor??void 0}}a>0&&pp()&&console.debug(`[${n}] Re-enqueued ${a} active run(s) on startup`)}function pp(){let e=typeof process<`u`?process.env.DEBUG:void 0;return typeof e==`string`?e.includes(`workflow:`)||e===`*`:!1}const mp=Xu(()=>$l([j(),P(),F(),Ll(),R(mp),B(j(),mp)])),hp=z({currentLookbackDays:P(),maxLookbackDays:P(),currentWindowStart:U(),maxWindowStart:U(),upgradeAvailable:F()}),gp=e=>z({data:R(e),cursor:j().nullable(),hasMore:F(),pageInfo:hp.optional()}),_p=z({message:j(),stack:j().optional(),code:j().optional()}),vp=`evnt_`;function yp(e){if(e.length!==26)return!1;for(let t=0;t<10;t++)if(e[t]!==`0`)return!1;for(let t=10;t<26;t++){let n=e.charCodeAt(t);if(n<48||n>57)return!1}return!0}function bp(e){let t=e.indexOf(`_`);return t===-1?e:e.slice(t+1)}function xp(e){return yp(bp(e))}function Sp(e){if(!Number.isSafeInteger(e)||e<1)throw RangeError(`Invalid event slot: ${e}`);return`${vp}${String(e).padStart(26,`0`)}`}function Cp(e){let t=bp(e);if(!yp(t))return null;let n=Number(t);return Number.isSafeInteger(n)&&n>=1?n:null}function wp(e){let t=Cp(e);if(t===null)throw Error(`Event id is not slot-numbered: ${e}. This World allocates event positions the runtime cannot read.`);return t}function Tp(e=process.env){return Uf(`WORKFLOW_SEALED_LOG`,!0,e)?7:6}function Ep(e){return e==null||e<=1}function Dp(e){return e!=null&&e>7}const Op=`0123456789ABCDEFGHJKMNPQRSTVWXYZ`;var Q;(function(e){e.Base32IncorrectEncoding=`B32_ENC_INVALID`,e.DecodeTimeInvalidCharacter=`DEC_TIME_CHAR`,e.DecodeTimeValueMalformed=`DEC_TIME_MALFORMED`,e.EncodeTimeNegative=`ENC_TIME_NEG`,e.EncodeTimeSizeExceeded=`ENC_TIME_SIZE_EXCEED`,e.EncodeTimeValueMalformed=`ENC_TIME_MALFORMED`,e.PRNGDetectFailure=`PRNG_DETECT`,e.ULIDInvalid=`ULID_INVALID`,e.Unexpected=`UNEXPECTED`,e.UUIDInvalid=`UUID_INVALID`})(Q||={});var $=class extends Error{constructor(e,t){super(`${t} (${e})`),this.name=`ULIDError`,this.code=e}};function kp(e){let t=Math.floor(e()*32)%32;return Op.charAt(t)}function Ap(e,t,n){return t>e.length-1?e:e.substr(0,t)+n+e.substr(t+1)}function jp(e){let t,n=e.length,r,i,a=e;for(;!t&&n-->=0;){if(r=a[n],i=Op.indexOf(r),i===-1)throw new $(Q.Base32IncorrectEncoding,`Incorrectly encoded string`);if(i===31){a=Ap(a,n,Op[0]);continue}t=Ap(a,n,Op[i+1])}if(typeof t==`string`)return t;throw new $(Q.Base32IncorrectEncoding,`Failed incrementing string`)}function Mp(e){if(e.length!==26)throw new $(Q.DecodeTimeValueMalformed,`Malformed ULID`);let t=e.substr(0,10).toUpperCase().split(``).reverse().reduce((e,t,n)=>{let r=Op.indexOf(t);if(r===-1)throw new $(Q.DecodeTimeInvalidCharacter,`Time decode error: Invalid character: ${t}`);return e+=r*32**n},0);if(t>0xffffffffffff)throw new $(Q.DecodeTimeValueMalformed,`Malformed ULID: timestamp too large: ${t}`);return t}function Np(e){let n=Pp(),r=n&&(n.crypto||n.msCrypto)||(t===void 0?null:t);if(typeof r?.getRandomValues==`function`)return()=>{let e=new Uint8Array(1);return r.getRandomValues(e),e[0]/256};if(typeof r?.randomBytes==`function`)return()=>r.randomBytes(1).readUInt8()/256;if(t?.randomBytes)return()=>t.randomBytes(1).readUInt8()/256;throw new $(Q.PRNGDetectFailure,`Failed to find a reliable PRNG`)}function Pp(){return Lp()?self:typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:null}function Fp(e,t){let n=``;for(;e>0;e--)n=kp(t)+n;return n}function Ip(e,t=10){if(isNaN(e))throw new $(Q.EncodeTimeValueMalformed,`Time must be a number: ${e}`);if(e>0xffffffffffff)throw new $(Q.EncodeTimeSizeExceeded,`Cannot encode a time larger than 281474976710655: ${e}`);if(e<0)throw new $(Q.EncodeTimeNegative,`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new $(Q.EncodeTimeValueMalformed,`Time must be an integer: ${e}`);let n,r=``;for(let i=t;i>0;i--)n=e%32,r=Op.charAt(n)+r,e=(e-n)/32;return r}function Lp(){return typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope}function Rp(e){let t=e||Np(),n=0,r;return function(e){let i=!e||isNaN(e)?Date.now():e;if(i<=n){let e=r=jp(r);return Ip(n,10)+e}n=i;let a=r=Fp(16,t);return Ip(i,10)+a}}function zp(e,t){let n=t||Np();return Ip(!e||isNaN(e)?Date.now():e,10)+Fp(16,n)}const Bp=j().ulid(),Vp=Ju([`wrun_`,Kc()]),Hp=1440*60*1e3,Up=300*1e3;function Wp(e){if(yp(e))return null;let t=Bp.safeParse(e);return t.success?new Date(Mp(t.data)):null}function Gp(e,t,n=Hp,r=Up){let i=Wp(e.startsWith(t)?e.slice(t.length):e);if(!i)return`Invalid runId: "${e}" is not a valid ULID`;let a=new Date().getTime()-i.getTime();return a>0&&a<=n||a<=0&&-a<=r?null:`Invalid runId timestamp: embedded timestamp is ${Math.round(Math.abs(a)/1e3)}s in the ${a>0?`past`:`future`} (threshold: ${Math.round((a>0?n:r)/1e3)}s)`}var Kp=e({ANALYTICS_EVENTS_GET_MANY_LIMIT:()=>100,ATTRIBUTE_KEY_MAX_LENGTH:()=>256,ATTRIBUTE_MAX_PER_RUN:()=>64,ATTRIBUTE_VALUE_MAX_BYTES:()=>256,BULK_CANCEL_MAX_RUN_IDS:()=>500,DEFAULT_TIMESTAMP_THRESHOLD_FUTURE_MS:()=>Up,DEFAULT_TIMESTAMP_THRESHOLD_MS:()=>DEFAULT_TIMESTAMP_THRESHOLD_MS,DEFAULT_TIMESTAMP_THRESHOLD_PAST_MS:()=>Hp,EVENT_ID_BODY_LENGTH:()=>26,EVENT_ID_PREFIX:()=>vp,FIRST_EVENT_SLOT:()=>1,HOOK_RESUME_DEDUP_VERSION:()=>1,HOOK_RESUME_INPUT_VERSION:()=>1,HookSchema:()=>lp,NODE_HTTP_DEFAULT:()=>!1,NODE_HTTP_ENV_VAR:()=>up,RESERVED_ATTRIBUTE_KEY_PREFIX:()=>`$`,RUN_ENTITY_KEY:()=>``,SEALED_LOG_ENV_VAR:()=>`WORKFLOW_SEALED_LOG`,SPEC_VERSION_CURRENT:()=>7,SPEC_VERSION_LEGACY:()=>1,SPEC_VERSION_MAX_SUPPORTED:()=>7,SPEC_VERSION_SUPPORTS_ATTRIBUTES:()=>4,SPEC_VERSION_SUPPORTS_CBOR_QUEUE_TRANSPORT:()=>3,SPEC_VERSION_SUPPORTS_COMPRESSION:()=>5,SPEC_VERSION_SUPPORTS_EVENT_SOURCING:()=>2,SPEC_VERSION_SUPPORTS_SEALED_LOG:()=>7,SPEC_VERSION_SUPPORTS_SLOT_IDENTITY:()=>6});export{Md as $,Co as $a,Et as $c,Ma as $i,yu as $n,Nr as $o,su as $r,dr as $s,Yl as $t,Lf as A,ga as Aa,Kn as Ac,ec as Ai,n as Al,Ll as An,Ua as Ao,Ou as Ar,Rr as As,Lc as At,wf as B,so as Ba,rr as Bc,qa as Bi,il as Bn,ca as Bo,B as Br,qr as Bs,Yc as Bt,qf as C,_a as Ca,ir as Cc,mc as Ci,Ue as Cl,eu as Cn,Xo as Co,sd as Cr,Dr as Cs,td as Ct,Yf as D,Aa as Da,Vn as Dc,tc as Di,o as Dl,V as Dn,wo as Do,Hl as Dr,Er as Ds,nu as Dt,Zf as E,Da as Ea,Zn as Ec,rc as Ei,a as El,Au as En,Vo as Eo,gu as Er,Cr as Es,ku as Et,If as F,eo as Fa,Wn as Fc,cs as Fi,cl as Fn,go as Fo,Hu as Fr,_i as Fs,Oc as Ft,K as G,$a as Ga,bt as Gc,Ra as Gi,rd as Gn,is as Go,j as Gr,ai as Gs,zu as Gt,xf as H,fo as Ha,tr as Hc,Sa as Hi,Wu as Hn,ha as Ho,Cc as Hr,Br as Hs,_u as Ht,Af as I,T as Ia,cr as Ic,ls as Ii,ul as In,la as Io,Mu as Ir,Ii as Is,Zc as It,Hd as J,ro as Ja,ot as Jc,ba as Ji,ru as Jn,Zi as Jo,Iu as Jr,ji as Js,Nu as Jt,gf as K,da as Ka,mt as Kc,qo as Ki,Kl as Kn,$i as Ko,gl as Kr,Ei as Ks,zc as Kt,Ef as L,ya as La,or as Lc,ss as Li,kl as Ln,aa as Lo,dd as Lr,_r as Ls,tl as Lt,Ff as M,po as Ma,Xn as Mc,$s as Mi,s as Ml,Wl as Mn,Ga as Mo,z as Mr,qi as Ms,wu as Mt,Mf as N,zo as Na,qn as Nc,ds as Ni,zl as Nn,ko as No,Cu as Nr,Si as Ns,vu as Nt,Hf as O,ka as Oa,er as Oc,sc as Oi,i as Ol,ed as On,No as Oo,Pu as Or,Tr as Os,dl as Ot,Nf as P,ho as Pa,Un as Pc,us as Pi,R as Pn,Ja as Po,lu as Pr,kr as Ps,$u as Pt,G as Q,io as Qa,St as Qc,Qa as Qi,Tu as Qn,ei as Qo,xu as Qr,yi as Qs,xl as Qt,Of as R,Fo as Ra,$n as Rc,D as Ri,F as Rn,oa as Ro,Qu as Rr,Xr as Rs,iu as Rt,op as S,Mo as Sa,Gn as Sc,pc as Si,ae as Sl,qc as Sn,Wa as So,fu as Sr,fr as Ss,Uu as St,Xf as T,Oa as Ta,nr as Tc,k as Ti,l as Tl,Ru as Tn,Eo as To,Bc as Tr,wr as Ts,Gl as Tt,yf as U,co as Ua,At as Uc,Ca as Ui,Hc as Un,Ao as Uo,mu as Ur,Vr as Us,$c as Ut,bf as V,xo as Va,Qn as Vc,Oo as Vi,ol as Vn,Xa as Vo,id as Vr,Oi as Vs,Yu as Vt,hf as W,oo as Wa,gt as Wc,Ba as Wi,Wc as Wn,rs as Wo,Xl as Wr,ii as Ws,du as Wt,Rd as X,ao as Xa,wt as Xc,Va as Xi,Dc as Xn,ea as Xo,Pl as Xr,Hi as Xs,Eu as Xt,Bd as Y,Ya,ct as Yc,xa as Yi,fl as Yn,w as Yo,ad as Yr,Ki as Ys,Il as Yt,qd as Z,Go as Za,Ot as Zc,za as Zi,Rc as Zn,Jr as Zo,Ju as Zr,gi as Zs,bl as Zt,fp as _,ia as _a,Pr as _c,fc as _i,nt as _l,N as _n,ta as _o,Xu as _r,gr as _s,rl as _t,Mp as a,Wo as aa,mi as ac,Fc as ai,yt as al,cu as an,Jo as ao,_l as ar,jr as as,Td as at,ap as b,Ia as ba,lr as bc,yc as bi,rt as bl,Bl as bn,Ko as bo,uu as br,Ci as bs,Uc as bt,Ep as c,ra as ca,hr as cc,Mc as ci,Tt as cl,M as cn,bo as co,Tl as cr,Fi as cs,U as ct,Cp as d,Lo as da,si as dc,tu as di,Dt as dl,qu as dn,es as do,Qc as dr,zr as ds,ql as dt,na as ea,C as ec,El as ei,ut as el,Su as en,Ka as eo,Cl as er,Fr as es,Id as et,xp as f,Bo as fa,Yr as fc,gc as fi,dt as fl,bu as fn,mo as fo,nl as fr,Qr as fs,sl as ft,_p as g,E as ga,Mr as gc,dc as gi,tt as gl,Pc as gn,vo as go,Xc as gr,mr as gs,Dl as gt,gp as h,to as ha,li as hc,_c as hi,b as hl,Gc as hn,Do as ho,Jl as hr,Ir as hs,Al as ht,Vp as i,Za as ia,wi as ic,L as ii,ht as il,Gu as in,So as io,vl as ir,Ar as is,_d as it,Pf as j,Zo as ja,sr as jc,Qs as ji,c as jl,I as jn,ma as jo,P as jr,Sr as js,hu as jt,Gf as k,Ta as ka,Yn as kc,ac as ki,r as kl,cd as kn,La as ko,Du as kr,di as ks,Ec as kt,Tp as l,ua as la,pr as lc,Nc as li,kt as ll,Fu as ln,Yo as lo,jl as lr,zi as ls,md as lt,Sp as m,Fa as ma,xr as mc,hc as mi,et as ml,A as mn,lo as mo,ml as mr,ui as ms,Ol as mt,Wp as n,pa as na,Gr as nc,Kc as ni,_t as nl,ju as nn,ja as no,kc as nr,Wr as ns,W as nt,Rp as o,jo as oa,S as oc,Ac as oi,st as ol,pu as on,no as oo,Ic as or,vr as os,wd as ot,wp as p,Pa as pa,Zr as pc,vc as pi,pt as pl,ou as pn,Io as po,ud as pr,ki as ps,ll as pt,Wd as q,Ro as qa,vt as qc,ns as qi,od as qn,Qi as qo,ld as qr,Li as qs,Vl as qt,Gp as r,$o as ra,Wi as rc,$l as ri,xt as rl,Zu as rn,Ho as ro,yl as rr,Hr as rs,vd as rt,zp as s,wa as sa,br as sc,jc as si,lt as sl,Tc as sn,Qo as so,Sl as sr,yr as ss,fd as st,Kp as t,fa as ta,Pi as tc,Ml as ti,ft as tl,Vu as tn,Uo as to,wl as tr,Ur as ts,kd as tt,Dp as u,yo as ua,Kr as uc,Jc as ui,Ct as ul,Nl as un,Po as uo,au as ur,Ji as us,Rl as ut,dp as v,_o as va,Lr as vc,bc as vi,at as vl,Fl as vn,os as vo,H as vr,xi as vs,al as vt,ip as w,va as wa,Hn as wc,uc as wi,Oe as wl,wc as wn,To as wo,Bu as wr,Or as ws,hl as wt,Qf as x,Ha as xa,x as xc,xc as xi,g as xl,Ul as xn,ts as xo,el as xr,Gi as xs,Lu as xt,lp as y,Na as ya,ur as yc,Sc as yi,it as yl,Ql as yn,as as yo,Zl as yr,Di as ys,Vc as yt,Sf as z,uo as za,Jn as zc,Ea as zi,nd as zn,sa as zo,Ku as zr,Mi as zs,pl as zt};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as e,t}from"./rolldown-runtime-8V8biNmG.js";function n(e,t,n){return n===1?e:t}var r=t(((e,t)=>{var n=1e3,r=n*60,i=r*60,a=i*24,o=a*7,s=a*365.25;t.exports=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return c(e);if(n===`number`&&isFinite(e))return t.long?u(e):l(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function c(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var c=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return c*s;case`weeks`:case`week`:case`w`:return c*o;case`days`:case`day`:case`d`:return c*a;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return c*i;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return c*r;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return c*n;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return c;default:return}}}}function l(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+`d`:t>=i?Math.round(e/i)+`h`:t>=r?Math.round(e/r)+`m`:t>=n?Math.round(e/n)+`s`:e+`ms`}function u(e){var t=Math.abs(e);return t>=a?d(e,t,a,`day`):t>=i?d(e,t,i,`hour`):t>=r?d(e,t,r,`minute`):t>=n?d(e,t,n,`second`):e+` ms`}function d(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+` `+r+(i?`s`:``)}})),i=e(r(),1);function a(e){if(typeof e==`string`){let t=(0,i.default)(e);if(typeof t!=`number`||t<0)throw Error(`Invalid duration: "${e}". Expected a valid duration string like "1s", "1m", "1h", etc.`);return new Date(Date.now()+t)}else if(typeof e==`number`){if(e<0||!Number.isFinite(e))throw Error(`Invalid duration: ${e}. Expected a non-negative finite number of milliseconds.`);return new Date(Date.now()+e)}else if(e instanceof Date||e&&typeof e==`object`&&typeof e.getTime==`function`)return e instanceof Date?e:new Date(e.getTime());else throw Error(`Invalid duration parameter. Expected a duration string, number (milliseconds), or Date object.`)}const o={USER_ERROR:`USER_ERROR`,RUNTIME_ERROR:`RUNTIME_ERROR`,CORRUPTED_EVENT_LOG:`CORRUPTED_EVENT_LOG`,REPLAY_DIVERGENCE:`REPLAY_DIVERGENCE`,MAX_DELIVERIES_EXCEEDED:`MAX_DELIVERIES_EXCEEDED`,MAX_EVENTS_EXCEEDED:`MAX_EVENTS_EXCEEDED`,REPLAY_TIMEOUT:`REPLAY_TIMEOUT`,WORLD_CONTRACT_ERROR:`WORLD_CONTRACT_ERROR`,DEPLOYMENT_MISMATCH:`DEPLOYMENT_MISMATCH`};function s(e){return typeof e==`object`&&!!e&&`name`in e&&`message`in e}function c(e,t){if(t.length===0)return e;let n=[e];return t.forEach((e,r)=>{let i=r===t.length-1,a=i?`╰▶ `:`├▶ `,o=i?` `:`│ `;`${e.label}: ${e.value}`.split(`
|
|
2
|
-
`).forEach((e,t)=>{n.push(`${t===0?a:o}${e}`)})}),n.join(`
|
|
3
|
-
`)}function l(e,t){let n=[];return e&&n.push({label:`hint`,value:e}),t&&n.push({label:`docs`,value:`https://workflow-sdk.dev/err/${t}`}),n}const u={NODE_JS_MODULE_IN_WORKFLOW:`node-js-module-in-workflow`,START_INVALID_WORKFLOW_FUNCTION:`start-invalid-workflow-function`,SERIALIZATION_FAILED:`serialization-failed`,WEBHOOK_INVALID_RESPOND_WITH_VALUE:`webhook-invalid-respond-with-value`,WEBHOOK_RESPONSE_NOT_SENT:`webhook-response-not-sent`,FETCH_IN_WORKFLOW_FUNCTION:`fetch-in-workflow`,TIMEOUT_FUNCTIONS_IN_WORKFLOW:`timeout-in-workflow`,HOOK_CONFLICT:`hook-conflict`,CORRUPTED_EVENT_LOG:`corrupted-event-log`,REPLAY_DIVERGENCE:`replay-divergence`,STEP_NOT_REGISTERED:`step-not-registered`,WORKFLOW_NOT_REGISTERED:`workflow-not-registered`,RUNTIME_DECRYPTION_FAILED:`runtime-decryption-failed`,DEPLOYMENT_MISMATCH:`deployment-mismatch`};var d=class extends Error{cause;constructor(e,t){let n=c(e,l(void 0,t?.slug));super(n,{cause:t?.cause}),t?.cause!==void 0&&(this.cause=t.cause),t?.cause instanceof Error&&(this.stack=`${this.stack}\nCaused by: ${t.cause.stack}`)}static is(e){return s(e)&&e.name===`WorkflowError`}},f=class extends d{status;code;url;retryAfter;constructor(e,t){super(e,{cause:t?.cause}),this.name=`WorkflowWorldError`,this.status=t?.status,this.code=t?.code,this.url=t?.url,this.retryAfter=t?.retryAfter}static is(e){return s(e)&&e.name===`WorkflowWorldError`}},p=class extends d{runId;errorCode;constructor(e,t,n={}){let r=t instanceof Error?t.message:typeof t==`string`?t:t&&typeof t==`object`&&`message`in t?String(t.message):`Unknown error`;super(`Workflow run "${e}" failed: ${r}`,{cause:t}),this.name=`WorkflowRunFailedError`,this.runId=e,n.errorCode!==void 0&&(this.errorCode=n.errorCode)}static is(e){return s(e)&&e.name===`WorkflowRunFailedError`}},m=class extends d{runId;status;constructor(e,t){super(`Workflow run "${e}" has not completed`,{}),this.name=`WorkflowRunNotCompletedError`,this.runId=e,this.status=t}static is(e){return s(e)&&e.name===`WorkflowRunNotCompletedError`}},h=class extends d{constructor(e,t){super(e,{...t}),this.name=`WorkflowRuntimeError`}static is(e){return s(e)&&e.name===`WorkflowRuntimeError`}},g=class extends h{constructor(e,t){super(e,{...t,slug:u.CORRUPTED_EVENT_LOG}),this.name=`CorruptedEventLogError`}static is(e){return s(e)&&e.name===`CorruptedEventLogError`}},_=class extends h{eventId;constructor(e,t){super(e,{...t,slug:u.REPLAY_DIVERGENCE}),this.name=`ReplayDivergenceError`,this.eventId=t.eventId}static is(e){return s(e)&&e.name===`ReplayDivergenceError`&&typeof e.eventId==`string`}},v=class extends d{eventCount;limit;constructor(e,t,n){super(`Workflow exceeded the maximum of ${t} events per run`,n),this.name=`MaxEventsExceededError`,this.eventCount=e,this.limit=t}static is(e){return s(e)&&e.name===`MaxEventsExceededError`}},y=class extends h{constructor(e,t){super(e,{cause:t?.cause,slug:u.RUNTIME_DECRYPTION_FAILED}),this.name=`RuntimeDecryptionError`,t?.context!==void 0&&(this.context=t.context)}static is(e){return s(e)&&e.name===`RuntimeDecryptionError`}},b=class extends d{hint;constructor(e,t){let n=c(e,l(t?.hint,void 0));super(n,{cause:t?.cause}),this.name=`WorkflowBuildError`,this.hint=t?.hint}static is(e){return s(e)&&e.name===`WorkflowBuildError`}},x=class extends d{hint;fatal=!0;constructor(e,t){let n=c(e,l(t?.hint,void 0));super(n,{cause:t?.cause}),this.name=`SerializationError`,this.hint=t?.hint}static is(e){return s(e)&&e.name===`SerializationError`}},S=class extends h{stepName;constructor(e){super(`Step "${e}" is not registered in the current deployment. This usually indicates a build or bundling issue that caused the step to not be included in the deployment.`,{slug:u.STEP_NOT_REGISTERED}),this.name=`StepNotRegisteredError`,this.stepName=e}static is(e){return s(e)&&e.name===`StepNotRegisteredError`}},C=class extends h{workflowName;constructor(e){super(`Workflow "${e}" is not registered in the current deployment. This usually means a run was started against a deployment that does not have this workflow, or there was a build/bundling issue.`,{slug:u.WORKFLOW_NOT_REGISTERED}),this.name=`WorkflowNotRegisteredError`,this.workflowName=e}static is(e){return s(e)&&e.name===`WorkflowNotRegisteredError`}},w=class extends h{runId;expectedDeploymentId;actualDeploymentId;recoveryAttempts;constructor(e,t,r,i){let a=i?.recoveryAttempts??0,o=a>0?` The runtime re-routed the message to "${t}" ${a} ${n(`time`,`times`,a)} and it kept arriving elsewhere, so the run was stopped to protect against code-skew errors.`:` The run was stopped to protect against code-skew errors.`;super(`Workflow run "${e}" is pinned to deployment "${t}", but was received by deployment "${r}".${o} Verify that the run's deployment is still available and that queue callbacks are routed to it.`,{slug:u.DEPLOYMENT_MISMATCH,cause:i?.cause}),this.name=`WorkflowDeploymentMismatchError`,this.runId=e,this.expectedDeploymentId=t,this.actualDeploymentId=r,this.recoveryAttempts=a}static is(e){return s(e)&&e.name===`WorkflowDeploymentMismatchError`}},T=class extends d{runId;constructor(e){super(`Workflow run "${e}" not found`,{}),this.name=`WorkflowRunNotFoundError`,this.runId=e}static is(e){return s(e)&&e.name===`WorkflowRunNotFoundError`}},E=class extends d{token;conflictingRunId;constructor(e,t){super(`Hook token "${e}" is already in use by another workflow${t?` (run "${t}")`:``}`,{slug:u.HOOK_CONFLICT}),this.name=`HookConflictError`,this.token=e,t!==void 0&&(this.conflictingRunId=t)}static is(e){return s(e)&&e.name===`HookConflictError`}},D=class extends d{token;constructor(e){super(`Hook not found`,{}),this.name=`HookNotFoundError`,this.token=e}static is(e){return s(e)&&e.name===`HookNotFoundError`}},O=class extends f{constructor(e){super(e),this.name=`EntityConflictError`}static is(e){return s(e)&&e.name===`EntityConflictError`}},k=class extends f{constructor(e){super(e),this.name=`RunExpiredError`}static is(e){return s(e)&&e.name===`RunExpiredError`}},A=class extends f{runId;streamId;expiredAt;constructor(e,t,n,r){super(e,{status:410,code:`stream-expired`}),this.runId=t,this.streamId=n,this.expiredAt=r,this.name=`StreamExpiredError`}static is(e){return s(e)&&e.name===`StreamExpiredError`}},j=class extends f{constructor(e,t){super(e,{retryAfter:t?.retryAfter}),this.name=`TooEarlyError`}static is(e){return s(e)&&e.name===`TooEarlyError`}},M=class extends f{retryAfter;constructor(e,t){super(e),this.name=`ThrottleError`,this.retryAfter=t?.retryAfter}static is(e){return s(e)&&e.name===`ThrottleError`}},N=class extends f{details;constructor(e,t){super(e,{status:412,retryAfter:t?.retryAfter}),this.name=`PreconditionFailedError`,this.details=t?.details}static is(e){return s(e)&&e.name===`PreconditionFailedError`}},P=class extends d{runId;constructor(e){super(`Workflow run "${e}" cancelled`,{}),this.name=`WorkflowRunCancelledError`,this.runId=e}static is(e){return s(e)&&e.name===`WorkflowRunCancelledError`}},F=class extends d{runSpecVersion;worldSpecVersion;constructor(e,t){super(`Run requires spec version ${e}, but world supports version ${t}. Please upgrade 'workflow' package.`),this.name=`RunNotSupportedError`,this.runSpecVersion=e,this.worldSpecVersion=t}static is(e){return s(e)&&e.name===`RunNotSupportedError`}},I=class extends Error{fatal=!0;constructor(e){super(e),this.name=`FatalError`}static is(e){return s(e)?e.name===`FatalError`||e.fatal===!0:!1}},L=class extends Error{retryAfter;constructor(e,t={}){super(e),this.name=`RetryableError`,t.retryAfter===void 0?this.retryAfter=new Date(Date.now()+1e3):this.retryAfter=a(t.retryAfter)}static is(e){return s(e)&&e.name===`RetryableError`}};const R="Your current vercel account does not have access to this resource. Use `vercel login` or `vercel switch` to ensure you are linked to the right account.",z=Symbol.for(`@workflow/errors//FatalError`),B=Symbol.for(`@workflow/errors//RetryableError`),V=Symbol.for(`@workflow/errors//HookConflictError`),H=Symbol.for(`@workflow/errors//RuntimeDecryptionError`);typeof globalThis<`u`&&(Object.hasOwn(globalThis,z)||Object.defineProperty(globalThis,z,{value:I,writable:!1,enumerable:!1,configurable:!1}),Object.hasOwn(globalThis,B)||Object.defineProperty(globalThis,B,{value:L,writable:!1,enumerable:!1,configurable:!1}),Object.hasOwn(globalThis,V)||Object.defineProperty(globalThis,V,{value:E,writable:!1,enumerable:!1,configurable:!1}),Object.hasOwn(globalThis,H)||Object.defineProperty(globalThis,H,{value:y,writable:!1,enumerable:!1,configurable:!1}));export{o as A,C,T as D,m as E,r as M,n as N,h as O,d as S,p as T,M as _,E as a,b,N as c,k as d,F as f,A as g,S as h,I as i,a as j,f as k,_ as l,x as m,u as n,D as o,y as p,O as r,v as s,g as t,L as u,j as v,P as w,w as x,R as y};
|