From 6fbff21fca80de3333d871f0d4d0622d94a80e4f Mon Sep 17 00:00:00 2001 From: David Blass Date: Wed, 4 Feb 2026 22:29:45 +0000 Subject: [PATCH] add agent and debug macros, improve activity timeouts, migrate claude and codex to cli (#224) --- agents/claude.ts | 167 +- agents/codex.ts | 214 +- agents/cursor.ts | 2 + agents/gemini.ts | 2 + agents/opencode.ts | 6 +- entry | 25738 ++++++------------------------ external.ts | 2 + lint/sdk-type-only-imports.grit | 16 + main.ts | 7 + modes.ts | 20 +- test/adhoc/nobashcreative.ts | 3 +- test/agnostic/timeout.ts | 4 +- test/crossagent/mcpmerge.ts | 86 + test/crossagent/nobash.ts | 2 +- test/crossagent/restricted.ts | 2 +- test/crossagent/smoke.ts | 2 +- test/run.ts | 252 +- test/utils.ts | 24 +- utils/activity.ts | 28 +- utils/payload.ts | 6 +- 20 files changed, 5030 insertions(+), 21553 deletions(-) create mode 100644 lint/sdk-type-only-imports.grit create mode 100644 test/crossagent/mcpmerge.ts diff --git a/agents/claude.ts b/agents/claude.ts index 59a47e7..10a2f14 100644 --- a/agents/claude.ts +++ b/agents/claude.ts @@ -1,12 +1,16 @@ // changes to effort level configuration should be reflected in wiki/effort.md and docs/effort.mdx // changes to tool permissions should be reflected in wiki/granular-tools.md // changes to web search configuration should be reflected in wiki/websearch.md -import { type Options, query, type SDKMessage } from "@anthropic-ai/claude-agent-sdk"; +import { mkdirSync, writeFileSync } from "node:fs"; +import { join } from "node:path"; +import type { SDKMessage } from "@anthropic-ai/claude-agent-sdk"; import type { Effort } from "../external.ts"; import { ghPullfrogMcpName } from "../external.ts"; import packageJson from "../package.json" with { type: "json" }; +import { markActivity } from "../utils/activity.ts"; import { log } from "../utils/cli.ts"; import { installFromNpmTarball } from "../utils/install.ts"; +import { spawn } from "../utils/subprocess.ts"; import { type AgentRunContext, agent } from "./shared.ts"; // Model selection based on effort level @@ -38,6 +42,26 @@ function buildDisallowedTools(ctx: AgentRunContext): string[] { return disallowed; } +/** + * Write MCP config file for Claude CLI. + * Returns the path to the config file. + */ +function writeMcpConfig(ctx: AgentRunContext): string { + const configDir = join(ctx.tmpdir, ".claude"); + mkdirSync(configDir, { recursive: true }); + const configPath = join(configDir, "mcp.json"); + + const mcpConfig = { + mcpServers: { + [ghPullfrogMcpName]: { type: "http", url: ctx.mcpServerUrl }, + }, + }; + + writeFileSync(configPath, JSON.stringify(mcpConfig, null, 2), "utf-8"); + log.info(`» MCP config written to ${configPath}`); + return configPath; +} + async function installClaude(): Promise { const versionRange = packageJson.dependencies["@anthropic-ai/claude-agent-sdk"] || "latest"; return await installFromNpmTarball({ @@ -64,32 +88,100 @@ export const claude = agent({ log.info(`» disallowed tools: ${disallowedTools.join(", ")}`); } - const queryOptions: Options = { - permissionMode: "bypassPermissions" as const, - disallowedTools, - mcpServers: { - [ghPullfrogMcpName]: { type: "http", url: ctx.mcpServerUrl }, - }, - model, - pathToClaudeCodeExecutable: cliPath, - env: process.env, - }; + // write MCP config file + const mcpConfigPath = writeMcpConfig(ctx); - const queryInstance = query({ - prompt: ctx.instructions.full, - options: queryOptions, + // build CLI args + // claude -p "prompt" --dangerously-skip-permissions --mcp-config ./mcp.json --model opus --output-format stream-json --verbose + const args: string[] = [ + cliPath, + "-p", + ctx.instructions.full, + "--dangerously-skip-permissions", + "--mcp-config", + mcpConfigPath, + "--model", + model, + "--output-format", + "stream-json", + "--verbose", + ]; + + // add disallowed tools if any + if (disallowedTools.length > 0) { + args.push("--disallowedTools"); + args.push(...disallowedTools); + } + + log.info("» running Claude CLI..."); + + let stdoutBuffer = ""; + let finalOutput = ""; + + // Track bash tool IDs to identify when bash tool results come back + const bashToolIds = new Set(); + + const result = await spawn({ + cmd: "node", + args, + cwd: process.cwd(), + env: process.env, + stdio: ["ignore", "pipe", "pipe"], + onStdout: async (chunk) => { + finalOutput += chunk; + + // buffer incomplete lines across chunks (NDJSON format) + stdoutBuffer += chunk; + const lines = stdoutBuffer.split("\n"); + + // keep the last element (may be incomplete) in the buffer + stdoutBuffer = lines.pop() || ""; + + for (const line of lines) { + const trimmed = line.trim(); + if (!trimmed) continue; + + try { + const message = JSON.parse(trimmed) as SDKMessage; + markActivity(); // reset activity timeout on every event + log.debug(JSON.stringify(message, null, 2)); + + const handler = messageHandlers[message.type]; + if (handler) { + await handler(message as never, bashToolIds); + } + } catch { + // ignore parse errors - might be non-JSON output + log.debug(`[claude] non-JSON stdout line: ${trimmed.substring(0, 200)}`); + } + } + }, + onStderr: (chunk) => { + const trimmed = chunk.trim(); + if (trimmed) { + log.debug(`[claude stderr] ${trimmed}`); + log.warning(trimmed); + finalOutput += trimmed + "\n"; + } + }, }); - // Stream the results - for await (const message of queryInstance) { - log.debug(JSON.stringify(message, null, 2)); - const handler = messageHandlers[message.type]; - await handler(message as never); + if (result.exitCode !== 0) { + const errorMessage = + result.stderr || finalOutput || result.stdout || "Unknown error - no output from Claude CLI"; + log.error(`Claude CLI exited with code ${result.exitCode}: ${errorMessage}`); + return { + success: false, + error: errorMessage, + output: finalOutput || result.stdout || "", + }; } + log.info("» Claude CLI completed successfully"); + return { success: true, - output: "", + output: finalOutput || result.stdout || "", }; }, }); @@ -97,18 +189,16 @@ export const claude = agent({ type SDKMessageType = SDKMessage["type"]; type SDKMessageHandler = ( - data: Extract + data: Extract, + bashToolIds: Set ) => void | Promise; type SDKMessageHandlers = { [type in SDKMessageType]: SDKMessageHandler; }; -// Track bash tool IDs to identify when bash tool results come back -const bashToolIds = new Set(); - const messageHandlers: SDKMessageHandlers = { - assistant: (data) => { + assistant: (data, bashToolIds) => { if (data.message?.content) { for (const content of data.message.content) { if (content.type === "text" && content.text?.trim()) { @@ -127,24 +217,24 @@ const messageHandlers: SDKMessageHandlers = { } } }, - user: (data) => { + user: (data, bashToolIds) => { if (data.message?.content) { for (const content of data.message.content) { if (content.type === "tool_result") { const toolUseId = (content as any).tool_use_id; const isBashTool = toolUseId && bashToolIds.has(toolUseId); + const outputContent = + typeof content.content === "string" + ? content.content + : Array.isArray(content.content) + ? content.content + .map((c: any) => (typeof c === "string" ? c : c.text || JSON.stringify(c))) + .join("\n") + : String(content.content); + if (isBashTool) { // Log bash output in a collapsed group - const outputContent = - typeof content.content === "string" - ? content.content - : Array.isArray(content.content) - ? content.content - .map((c: any) => (typeof c === "string" ? c : c.text || JSON.stringify(c))) - .join("\n") - : String(content.content); - log.startGroup(`bash output`); if (content.is_error) { log.warning(outputContent); @@ -155,9 +245,10 @@ const messageHandlers: SDKMessageHandlers = { // Clean up the tracked ID bashToolIds.delete(toolUseId); } else if (content.is_error) { - const errorContent = - typeof content.content === "string" ? content.content : String(content.content); - log.warning(`Tool error: ${errorContent}`); + log.warning(`Tool error: ${outputContent}`); + } else { + // log successful non-bash tool result at debug level + log.debug(`tool output: ${outputContent}`); } } } diff --git a/agents/codex.ts b/agents/codex.ts index 605899a..bb77eb1 100644 --- a/agents/codex.ts +++ b/agents/codex.ts @@ -3,34 +3,24 @@ // changes to web search configuration should be reflected in wiki/websearch.md import { mkdirSync, writeFileSync } from "node:fs"; import { join } from "node:path"; -import { - Codex, - type CodexOptions, - type ModelReasoningEffort, - type ThreadEvent, - type ThreadOptions, -} from "@openai/codex-sdk"; +import type { ThreadEvent } from "@openai/codex-sdk"; import type { Effort } from "../external.ts"; import { ghPullfrogMcpName } from "../external.ts"; +import { markActivity } from "../utils/activity.ts"; import { log } from "../utils/cli.ts"; import { installFromNpmTarball } from "../utils/install.ts"; +import { spawn } from "../utils/subprocess.ts"; import { type AgentRunContext, agent } from "./shared.ts"; -// model configuration based on effort level -const codexModel: Record = { - mini: "gpt-5.1-codex-mini", - // https://developers.openai.com/codex/models/ - // gpt-5.2-codex is not yet available via api key (even through codex cli) - auto: "gpt-5.1-codex", - max: "gpt-5.1-codex-max", -} as const; - -// reasoning effort configuration based on effort level -// uses modelReasoningEffort parameter from ThreadOptions -const codexReasoningEffort: Record = { - mini: "low", - auto: undefined, // use default - max: "high", +// configuration based on effort level +// https://developers.openai.com/codex/models/ +// gpt-5.2-codex is not yet available via api key (even through codex cli) +type ModelReasoningEffort = "minimal" | "low" | "medium" | "high" | "xhigh"; +type CodexEffortConfig = { model: string; reasoningEffort?: ModelReasoningEffort }; +const codexEffortConfig: Record = { + mini: { model: "gpt-5.1-codex-mini", reasoningEffort: "low" }, + auto: { model: "gpt-5.1-codex" }, + max: { model: "gpt-5.1-codex-max", reasoningEffort: "high" }, }; function writeCodexConfig(ctx: AgentRunContext): string { @@ -81,96 +71,142 @@ export const codex = agent({ name: "codex", install: installCodex, run: async (ctx) => { - // install CLI at start of run - const cliPath = await installCodex(); - - // create config directory for codex before setting HOME - const configDir = join(ctx.tmpdir, ".config", "codex"); - mkdirSync(configDir, { recursive: true }); - - const codexDir = writeCodexConfig(ctx); - - process.env.HOME = ctx.tmpdir; - process.env.CODEX_HOME = codexDir; - - // get model and reasoning effort based on effort level - const model = codexModel[ctx.payload.effort]; - const modelReasoningEffort = codexReasoningEffort[ctx.payload.effort]; - log.info(`» using model: ${model}`); - if (modelReasoningEffort) { - log.info(`» using modelReasoningEffort: ${modelReasoningEffort}`); - } - - // Configure Codex + // validate API key first const apiKey = process.env.OPENAI_API_KEY; if (!apiKey) { throw new Error("OPENAI_API_KEY is required for codex agent"); } - const codexOptions: CodexOptions = { - apiKey, - codexPathOverride: cliPath, - }; + // install CLI at start of run + const cliPath = await installCodex(); - const codex = new Codex(codexOptions); + // write config file (creates ~/.codex/config.toml) + const codexDir = writeCodexConfig(ctx); - // build thread options based on tool permissions - const threadOptions: ThreadOptions = { - model, - approvalPolicy: "never" as const, - // write: "disabled" → read-only sandbox, otherwise full access for git ops - sandboxMode: ctx.payload.write === "disabled" ? "read-only" : "danger-full-access", - // web: controls network access - networkAccessEnabled: ctx.payload.web !== "disabled", - // search: controls web search - webSearchEnabled: ctx.payload.search !== "disabled", - ...(modelReasoningEffort && { modelReasoningEffort }), - }; + // get model and reasoning effort based on effort level + const effortConfig = codexEffortConfig[ctx.payload.effort]; + log.info(`» using model: ${effortConfig.model} (effort: ${ctx.payload.effort})`); + if (effortConfig.reasoningEffort) { + log.info(`» using modelReasoningEffort: ${effortConfig.reasoningEffort}`); + } + + // determine sandbox mode based on write permission + // write: "disabled" → read-only sandbox, otherwise full access for git ops + const sandboxMode = ctx.payload.write === "disabled" ? "read-only" : "danger-full-access"; + + // determine network and search permissions + // web: "disabled" → no network access, otherwise enabled + const networkAccessEnabled = ctx.payload.web !== "disabled"; + // search: "disabled" → no web search, otherwise enabled + const webSearchEnabled = ctx.payload.search !== "disabled"; + + const args: string[] = [ + cliPath, + "exec", + ctx.instructions.full, + "--dangerously-bypass-approvals-and-sandbox", + "--model", + effortConfig.model, + "--sandbox", + sandboxMode, + "--json", + "--config", + `sandbox_workspace_write.network_access=${networkAccessEnabled}`, + "--config", + `features.web_search_request=${webSearchEnabled}`, + ]; + + if (effortConfig.reasoningEffort) { + args.push("--config", `model_reasoning_effort="${effortConfig.reasoningEffort}"`); + } log.info( - `» Codex options: sandboxMode=${threadOptions.sandboxMode}, networkAccessEnabled=${threadOptions.networkAccessEnabled}, webSearchEnabled=${threadOptions.webSearchEnabled}` + `» Codex options: sandboxMode=${sandboxMode}, networkAccess=${networkAccessEnabled}, webSearch=${webSearchEnabled}` ); + log.info("» running Codex CLI..."); - const thread = codex.startThread(threadOptions); + let stdoutBuffer = ""; + let finalOutput = ""; - try { - const streamedTurn = await thread.runStreamed(ctx.instructions.full); + // Track command execution IDs to identify when command results come back + const commandExecutionIds = new Set(); - let finalOutput = ""; - for await (const event of streamedTurn.events) { - const handler = messageHandlers[event.type]; - log.debug(JSON.stringify(event, null, 2)); - if (handler) { - handler(event as never); + const env: NodeJS.ProcessEnv = { + ...process.env, + HOME: ctx.tmpdir, + CODEX_HOME: codexDir, + CODEX_API_KEY: apiKey, + }; + + const result = await spawn({ + cmd: "node", + args, + cwd: process.cwd(), + env, + stdio: ["ignore", "pipe", "pipe"], + onStdout: async (chunk) => { + finalOutput += chunk; + + // buffer incomplete lines across chunks (NDJSON format) + stdoutBuffer += chunk; + const lines = stdoutBuffer.split("\n"); + + // keep the last element (may be incomplete) in the buffer + stdoutBuffer = lines.pop() || ""; + + for (const line of lines) { + const trimmed = line.trim(); + if (!trimmed) continue; + + try { + const event = JSON.parse(trimmed) as ThreadEvent; + markActivity(); // reset activity timeout on every event + log.debug(JSON.stringify(event, null, 2)); + + const handler = messageHandlers[event.type as keyof typeof messageHandlers]; + if (handler) { + await handler(event as never, commandExecutionIds); + } + } catch { + // ignore parse errors - might be non-JSON output + log.debug(`[codex] non-JSON stdout line: ${trimmed.substring(0, 200)}`); + } } - - if (event.type === "item.completed" && event.item.type === "agent_message") { - finalOutput = event.item.text; + }, + onStderr: (chunk) => { + const trimmed = chunk.trim(); + if (trimmed) { + log.debug(`[codex stderr] ${trimmed}`); + log.warning(trimmed); + finalOutput += trimmed + "\n"; } - } + }, + }); - return { - success: true, - output: finalOutput, - }; - } catch (error) { - const errorMessage = error instanceof Error ? error.message : String(error); - log.error(`Codex execution failed: ${errorMessage}`); + if (result.exitCode !== 0) { + const errorMessage = + result.stderr || finalOutput || result.stdout || "Unknown error - no output from Codex CLI"; + log.error(`Codex CLI exited with code ${result.exitCode}: ${errorMessage}`); return { success: false, error: errorMessage, - output: "", + output: finalOutput || result.stdout || "", }; } + + log.info("» Codex CLI completed successfully"); + + return { + success: true, + output: finalOutput || result.stdout || "", + }; }, }); -// Track command execution IDs to identify when command results come back -const commandExecutionIds = new Set(); - type ThreadEventHandler = ( - event: Extract -) => void; + event: Extract, + commandExecutionIds: Set +) => void | Promise; const messageHandlers: { [type in ThreadEvent["type"]]: ThreadEventHandler; @@ -198,7 +234,7 @@ const messageHandlers: { "turn.failed": (event) => { log.error(`Turn failed: ${event.error.message}`); }, - "item.started": (event) => { + "item.started": (event, commandExecutionIds) => { const item = event.item; if (item.type === "command_execution") { commandExecutionIds.add(item.id); @@ -227,7 +263,7 @@ const messageHandlers: { } } }, - "item.completed": (event) => { + "item.completed": (event, commandExecutionIds) => { const item = event.item; if (item.type === "agent_message") { log.box(item.text.trim(), { title: "Codex" }); diff --git a/agents/cursor.ts b/agents/cursor.ts index e15ff8e..66e1841 100644 --- a/agents/cursor.ts +++ b/agents/cursor.ts @@ -7,6 +7,7 @@ import { homedir } from "node:os"; import { join } from "node:path"; import type { Effort } from "../external.ts"; import { ghPullfrogMcpName } from "../external.ts"; +import { markActivity } from "../utils/activity.ts"; import { log } from "../utils/cli.ts"; import { installFromCurl } from "../utils/install.ts"; import { type AgentRunContext, agent } from "./shared.ts"; @@ -271,6 +272,7 @@ export const cursor = agent({ try { const event = JSON.parse(text) as CursorEvent; + markActivity(); // reset activity timeout on every event log.debug(JSON.stringify(event, null, 2)); // skip empty thinking deltas diff --git a/agents/gemini.ts b/agents/gemini.ts index f0015da..15114b2 100644 --- a/agents/gemini.ts +++ b/agents/gemini.ts @@ -6,6 +6,7 @@ import { homedir } from "node:os"; import { join } from "node:path"; import type { Effort } from "../external.ts"; import { ghPullfrogMcpName } from "../external.ts"; +import { markActivity } from "../utils/activity.ts"; import { log } from "../utils/cli.ts"; import { installFromGithub } from "../utils/install.ts"; import { spawn } from "../utils/subprocess.ts"; @@ -226,6 +227,7 @@ export const gemini = agent({ try { const event = JSON.parse(trimmed) as GeminiEvent; + markActivity(); // reset activity timeout on every event const handler = messageHandlers[event.type as keyof typeof messageHandlers]; if (handler) { await handler(event as never); diff --git a/agents/opencode.ts b/agents/opencode.ts index 114b32e..569c608 100644 --- a/agents/opencode.ts +++ b/agents/opencode.ts @@ -4,6 +4,7 @@ import { mkdirSync, writeFileSync } from "node:fs"; import { join } from "node:path"; import { ghPullfrogMcpName } from "../external.ts"; +import { getIdleMs, markActivity } from "../utils/activity.ts"; import { log } from "../utils/cli.ts"; import { installFromNpmTarball } from "../utils/install.ts"; import { spawn } from "../utils/subprocess.ts"; @@ -59,7 +60,6 @@ export const opencode = agent({ log.debug(`» XDG_CONFIG_HOME: ${env.XDG_CONFIG_HOME}`); const startTime = Date.now(); - let lastActivityTime = startTime; let eventCount = 0; let output = ""; @@ -95,7 +95,7 @@ export const opencode = agent({ // debug log all events to diagnose ordering and missing MCP/bash tool calls log.debug(JSON.stringify(event, null, 2)); - const timeSinceLastActivity = Date.now() - lastActivityTime; + const timeSinceLastActivity = getIdleMs(); if (timeSinceLastActivity > 10000) { const activeToolCalls = toolCallTimings.size; const toolCallInfo = @@ -106,7 +106,7 @@ export const opencode = agent({ `» no activity for ${(timeSinceLastActivity / 1000).toFixed(1)}s${toolCallInfo} (${eventCount} events processed so far)` ); } - lastActivityTime = Date.now(); + markActivity(); // reset activity timeout on every event const handler = messageHandlers[event.type as keyof typeof messageHandlers]; if (handler) { await handler(event as never); diff --git a/entry b/entry index a7b9497..508ae71 100755 --- a/entry +++ b/entry @@ -64,11 +64,11 @@ var __using = (stack, value2, async) => { } return value2; }; -var __callDispose = (stack, error50, hasError) => { +var __callDispose = (stack, error49, hasError) => { var E = typeof SuppressedError === "function" ? SuppressedError : function(e, s, m, _) { return _ = Error(m), _.name = "SuppressedError", _.error = e, _.suppressed = s, _; }; - var fail = (e) => error50 = hasError ? new E(e, error50, "An error was suppressed during disposal") : (hasError = true, e); + var fail = (e) => error49 = hasError ? new E(e, error49, "An error was suppressed during disposal") : (hasError = true, e); var next2 = (it) => { while (it = stack.pop()) { try { @@ -78,7 +78,7 @@ var __callDispose = (stack, error50, hasError) => { fail(e); } } - if (hasError) throw error50; + if (hasError) throw error49; }; return next2(); }; @@ -148,17 +148,17 @@ var require_command = __commonJS({ }; Object.defineProperty(exports, "__esModule", { value: true }); exports.issue = exports.issueCommand = void 0; - var os2 = __importStar(__require("os")); + var os = __importStar(__require("os")); var utils_1 = require_utils(); function issueCommand(command, properties, message) { const cmd = new Command(command, properties, message); - process.stdout.write(cmd.toString() + os2.EOL); + process.stdout.write(cmd.toString() + os.EOL); } exports.issueCommand = issueCommand; - function issue4(name, message = "") { + function issue3(name, message = "") { issueCommand(name, {}, message); } - exports.issue = issue4; + exports.issue = issue3; var CMD_STRING = "::"; var Command = class { constructor(command, properties, message) { @@ -235,18 +235,18 @@ var require_file_command = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.prepareKeyValueMessage = exports.issueFileCommand = void 0; var crypto2 = __importStar(__require("crypto")); - var fs5 = __importStar(__require("fs")); - var os2 = __importStar(__require("os")); + var fs3 = __importStar(__require("fs")); + var os = __importStar(__require("os")); var utils_1 = require_utils(); function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; if (!filePath) { throw new Error(`Unable to find environment variable for file command ${command}`); } - if (!fs5.existsSync(filePath)) { + if (!fs3.existsSync(filePath)) { throw new Error(`Missing file at path: ${filePath}`); } - fs5.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os2.EOL}`, { + fs3.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os.EOL}`, { encoding: "utf8" }); } @@ -260,7 +260,7 @@ var require_file_command = __commonJS({ if (convertedValue.includes(delimiter)) { throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); } - return `${key}<<${delimiter}${os2.EOL}${convertedValue}${os2.EOL}${delimiter}`; + return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`; } exports.prepareKeyValueMessage = prepareKeyValueMessage; } @@ -357,8 +357,8 @@ var require_tunnel = __commonJS({ var http2 = __require("http"); var https = __require("https"); var events = __require("events"); - var assert4 = __require("assert"); - var util3 = __require("util"); + var assert3 = __require("assert"); + var util2 = __require("util"); exports.httpOverHttp = httpOverHttp; exports.httpsOverHttp = httpsOverHttp; exports.httpOverHttps = httpOverHttps; @@ -408,7 +408,7 @@ var require_tunnel = __commonJS({ self2.removeSocket(socket); }); } - util3.inherits(TunnelingAgent, events.EventEmitter); + util2.inherits(TunnelingAgent, events.EventEmitter); TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) { var self2 = this; var options = mergeOptions({ request: req }, self2.options, toOptions(host, port, localAddress)); @@ -476,18 +476,18 @@ var require_tunnel = __commonJS({ res.statusCode ); socket.destroy(); - var error50 = new Error("tunneling socket could not be established, statusCode=" + res.statusCode); - error50.code = "ECONNRESET"; - options.request.emit("error", error50); + var error49 = new Error("tunneling socket could not be established, statusCode=" + res.statusCode); + error49.code = "ECONNRESET"; + options.request.emit("error", error49); self2.removeSocket(placeholder); return; } if (head.length > 0) { debug2("got illegal response body from proxy"); socket.destroy(); - var error50 = new Error("got illegal response body from proxy"); - error50.code = "ECONNRESET"; - options.request.emit("error", error50); + var error49 = new Error("got illegal response body from proxy"); + error49.code = "ECONNRESET"; + options.request.emit("error", error49); self2.removeSocket(placeholder); return; } @@ -502,9 +502,9 @@ var require_tunnel = __commonJS({ cause.message, cause.stack ); - var error50 = new Error("tunneling socket could not be established, cause=" + cause.message); - error50.code = "ECONNRESET"; - options.request.emit("error", error50); + var error49 = new Error("tunneling socket could not be established, cause=" + cause.message); + error49.code = "ECONNRESET"; + options.request.emit("error", error49); self2.removeSocket(placeholder); } }; @@ -988,7 +988,7 @@ var require_constants = __commonJS({ var require_util = __commonJS({ "node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/core/util.js"(exports, module) { "use strict"; - var assert4 = __require("assert"); + var assert3 = __require("assert"); var { kDestroyed, kBodyUsed } = require_symbols(); var { IncomingMessage } = __require("http"); var stream = __require("stream"); @@ -1049,14 +1049,14 @@ var require_util = __commonJS({ } const port = url4.port != null ? url4.port : url4.protocol === "https:" ? 443 : 80; let origin = url4.origin != null ? url4.origin : `${url4.protocol}//${url4.hostname}:${port}`; - let path4 = url4.path != null ? url4.path : `${url4.pathname || ""}${url4.search || ""}`; + let path3 = url4.path != null ? url4.path : `${url4.pathname || ""}${url4.search || ""}`; if (origin.endsWith("/")) { origin = origin.substring(0, origin.length - 1); } - if (path4 && !path4.startsWith("/")) { - path4 = `/${path4}`; + if (path3 && !path3.startsWith("/")) { + path3 = `/${path3}`; } - url4 = new URL(origin + path4); + url4 = new URL(origin + path3); } return url4; } @@ -1070,7 +1070,7 @@ var require_util = __commonJS({ function getHostname(host) { if (host[0] === "[") { const idx2 = host.indexOf("]"); - assert4(idx2 !== -1); + assert3(idx2 !== -1); return host.substring(1, idx2); } const idx = host.indexOf(":"); @@ -1081,7 +1081,7 @@ var require_util = __commonJS({ if (!host) { return null; } - assert4.strictEqual(typeof host, "string"); + assert3.strictEqual(typeof host, "string"); const servername = getHostname(host); if (net.isIP(servername)) { return ""; @@ -2670,20 +2670,20 @@ var require_parseParams = __commonJS({ var require_basename = __commonJS({ "node_modules/.pnpm/@fastify+busboy@2.1.1/node_modules/@fastify/busboy/lib/utils/basename.js"(exports, module) { "use strict"; - module.exports = function basename2(path4) { - if (typeof path4 !== "string") { + module.exports = function basename2(path3) { + if (typeof path3 !== "string") { return ""; } - for (var i = path4.length - 1; i >= 0; --i) { - switch (path4.charCodeAt(i)) { + for (var i = path3.length - 1; i >= 0; --i) { + switch (path3.charCodeAt(i)) { case 47: // '/' case 92: - path4 = path4.slice(i + 1); - return path4 === ".." || path4 === "." ? "" : path4; + path3 = path3.slice(i + 1); + return path3 === ".." || path3 === "." ? "" : path3; } } - return path4 === ".." || path4 === "." ? "" : path4; + return path3 === ".." || path3 === "." ? "" : path3; }; } }); @@ -3684,7 +3684,7 @@ var require_util2 = __commonJS({ var { getGlobalOrigin } = require_global(); var { performance: performance2 } = __require("perf_hooks"); var { isBlobLike, toUSVString, ReadableStreamFrom } = require_util(); - var assert4 = __require("assert"); + var assert3 = __require("assert"); var { isUint8Array } = __require("util/types"); var supportedHashes = []; var crypto2; @@ -3874,7 +3874,7 @@ var require_util2 = __commonJS({ } function determineRequestsReferrer(request2) { const policy = request2.referrerPolicy; - assert4(policy); + assert3(policy); let referrerSource = null; if (request2.referrer === "client") { const globalOrigin = getGlobalOrigin(); @@ -3932,7 +3932,7 @@ var require_util2 = __commonJS({ } } function stripURLForReferrer(url4, originOnly) { - assert4(url4 instanceof URL); + assert3(url4 instanceof URL); if (url4.protocol === "file:" || url4.protocol === "about:" || url4.protocol === "blank:") { return "no-referrer"; } @@ -4082,7 +4082,7 @@ var require_util2 = __commonJS({ }); return { promise: promise2, resolve: res, reject: rej }; } - function isAborted3(fetchParams) { + function isAborted2(fetchParams) { return fetchParams.controller.state === "aborted"; } function isCancelled(fetchParams) { @@ -4111,7 +4111,7 @@ var require_util2 = __commonJS({ if (result === void 0) { throw new TypeError("Value is not JSON serializable"); } - assert4(typeof result === "string"); + assert3(typeof result === "string"); return result; } var esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())); @@ -4205,7 +4205,7 @@ var require_util2 = __commonJS({ } function isomorphicEncode(input) { for (let i = 0; i < input.length; i++) { - assert4(input.charCodeAt(i) <= 255); + assert3(input.charCodeAt(i) <= 255); } return input; } @@ -4225,7 +4225,7 @@ var require_util2 = __commonJS({ } } function urlIsLocal(url4) { - assert4("protocol" in url4); + assert3("protocol" in url4); const protocol = url4.protocol; return protocol === "about:" || protocol === "blob:" || protocol === "data:"; } @@ -4236,13 +4236,13 @@ var require_util2 = __commonJS({ return url4.protocol === "https:"; } function urlIsHttpHttpsScheme(url4) { - assert4("protocol" in url4); + assert3("protocol" in url4); const protocol = url4.protocol; return protocol === "http:" || protocol === "https:"; } var hasOwn2 = Object.hasOwn || ((dict, key) => Object.prototype.hasOwnProperty.call(dict, key)); module.exports = { - isAborted: isAborted3, + isAborted: isAborted2, isCancelled, createDeferredPromise, ReadableStreamFrom, @@ -4520,8 +4520,8 @@ var require_webidl = __commonJS({ }); } for (const options of converters) { - const { key, defaultValue, required: required4, converter } = options; - if (required4 === true) { + const { key, defaultValue, required: required3, converter } = options; + if (required3 === true) { if (!hasOwn2(dictionary, key)) { throw webidl.errors.exception({ header: "Dictionary", @@ -4534,7 +4534,7 @@ var require_webidl = __commonJS({ if (hasDefault && value2 !== null) { value2 = value2 ?? defaultValue; } - if (required4 || hasDefault || value2 !== void 0) { + if (required3 || hasDefault || value2 !== void 0) { value2 = converter(value2); if (options.allowedValues && !options.allowedValues.includes(value2)) { throw webidl.errors.exception({ @@ -4678,7 +4678,7 @@ var require_webidl = __commonJS({ // node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/dataURL.js var require_dataURL = __commonJS({ "node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/dataURL.js"(exports, module) { - var assert4 = __require("assert"); + var assert3 = __require("assert"); var { atob: atob2 } = __require("buffer"); var { isomorphicDecode } = require_util2(); var encoder = new TextEncoder(); @@ -4686,7 +4686,7 @@ var require_dataURL = __commonJS({ var HTTP_WHITESPACE_REGEX = /(\u000A|\u000D|\u0009|\u0020)/; var HTTP_QUOTED_STRING_TOKENS = /[\u0009|\u0020-\u007E|\u0080-\u00FF]/; function dataURLProcessor(dataURL) { - assert4(dataURL.protocol === "data:"); + assert3(dataURL.protocol === "data:"); let input = URLSerializer(dataURL, true); input = input.slice(5); const position = { position: 0 }; @@ -4872,7 +4872,7 @@ var require_dataURL = __commonJS({ function collectAnHTTPQuotedString(input, position, extractValue) { const positionStart = position.position; let value2 = ""; - assert4(input[position.position] === '"'); + assert3(input[position.position] === '"'); position.position++; while (true) { value2 += collectASequenceOfCodePoints( @@ -4893,7 +4893,7 @@ var require_dataURL = __commonJS({ value2 += input[position.position]; position.position++; } else { - assert4(quoteOrBackslash === '"'); + assert3(quoteOrBackslash === '"'); break; } } @@ -4903,7 +4903,7 @@ var require_dataURL = __commonJS({ return input.slice(positionStart, position.position); } function serializeAMimeType(mimeType) { - assert4(mimeType !== "failure"); + assert3(mimeType !== "failure"); const { parameters, essence } = mimeType; let serialization = essence; for (let [name, value2] of parameters.entries()) { @@ -5307,7 +5307,7 @@ var require_body = __commonJS({ "node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/body.js"(exports, module) { "use strict"; var Busboy = require_main(); - var util3 = require_util(); + var util2 = require_util(); var { ReadableStreamFrom, isBlobLike, @@ -5322,7 +5322,7 @@ var require_body = __commonJS({ var { DOMException: DOMException2, structuredClone } = require_constants2(); var { Blob: Blob2, File: NativeFile } = __require("buffer"); var { kBodyUsed } = require_symbols(); - var assert4 = __require("assert"); + var assert3 = __require("assert"); var { isErrored } = require_util(); var { isUint8Array, isArrayBuffer } = __require("util/types"); var { File: UndiciFile } = require_file(); @@ -5360,7 +5360,7 @@ var require_body = __commonJS({ type: void 0 }); } - assert4(isReadableStreamLike(stream)); + assert3(isReadableStreamLike(stream)); let action = null; let source = null; let length = null; @@ -5375,7 +5375,7 @@ var require_body = __commonJS({ source = new Uint8Array(object5.slice()); } else if (ArrayBuffer.isView(object5)) { source = new Uint8Array(object5.buffer.slice(object5.byteOffset, object5.byteOffset + object5.byteLength)); - } else if (util3.isFormDataLike(object5)) { + } else if (util2.isFormDataLike(object5)) { const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, "0")}`; const prefix = `--${boundary}\r Content-Disposition: form-data`; @@ -5433,14 +5433,14 @@ Content-Type: ${value2.type || "application/octet-stream"}\r if (keepalive) { throw new TypeError("keepalive"); } - if (util3.isDisturbed(object5) || object5.locked) { + if (util2.isDisturbed(object5) || object5.locked) { throw new TypeError( "Response body object should not be disturbed or locked" ); } stream = object5 instanceof ReadableStream2 ? object5 : ReadableStreamFrom(object5); } - if (typeof source === "string" || util3.isBuffer(source)) { + if (typeof source === "string" || util2.isBuffer(source)) { length = Buffer.byteLength(source); } if (action != null) { @@ -5476,8 +5476,8 @@ Content-Type: ${value2.type || "application/octet-stream"}\r ReadableStream2 = __require("stream/web").ReadableStream; } if (object5 instanceof ReadableStream2) { - assert4(!util3.isDisturbed(object5), "The body has already been consumed."); - assert4(!object5.locked, "The stream is locked."); + assert3(!util2.isDisturbed(object5), "The body has already been consumed."); + assert3(!object5.locked, "The stream is locked."); } return extractBody(object5, keepalive); } @@ -5498,7 +5498,7 @@ Content-Type: ${value2.type || "application/octet-stream"}\r yield body; } else { const stream = body.stream; - if (util3.isDisturbed(stream)) { + if (util2.isDisturbed(stream)) { throw new TypeError("The body has already been consumed."); } if (stream.locked) { @@ -5632,7 +5632,7 @@ Content-Type: ${value2.type || "application/octet-stream"}\r throw new TypeError("Body is unusable"); } const promise2 = createDeferredPromise(); - const errorSteps = (error50) => promise2.reject(error50); + const errorSteps = (error49) => promise2.reject(error49); const successSteps = (data) => { try { promise2.resolve(convertBytesToJSValue(data)); @@ -5648,7 +5648,7 @@ Content-Type: ${value2.type || "application/octet-stream"}\r return promise2.promise; } function bodyUnusable(body) { - return body != null && (body.stream.locked || util3.isDisturbed(body.stream)); + return body != null && (body.stream.locked || util2.isDisturbed(body.stream)); } function utf8DecodeBytes(buffer) { if (buffer.length === 0) { @@ -5688,9 +5688,9 @@ var require_request = __commonJS({ InvalidArgumentError, NotSupportedError } = require_errors(); - var assert4 = __require("assert"); + var assert3 = __require("assert"); var { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = require_symbols(); - var util3 = require_util(); + var util2 = require_util(); var tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/; var headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/; var invalidPathRegex = /[^\u0021-\u00ff]/; @@ -5713,11 +5713,11 @@ var require_request = __commonJS({ } var Request2 = class _Request { constructor(origin, { - path: path4, + path: path3, method, body, headers, - query: query2, + query, idempotent, blocking, upgrade, @@ -5727,11 +5727,11 @@ var require_request = __commonJS({ throwOnError, expectContinue }, handler2) { - if (typeof path4 !== "string") { + if (typeof path3 !== "string") { throw new InvalidArgumentError("path must be a string"); - } else if (path4[0] !== "/" && !(path4.startsWith("http://") || path4.startsWith("https://")) && method !== "CONNECT") { + } else if (path3[0] !== "/" && !(path3.startsWith("http://") || path3.startsWith("https://")) && method !== "CONNECT") { throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); - } else if (invalidPathRegex.exec(path4) !== null) { + } else if (invalidPathRegex.exec(path3) !== null) { throw new InvalidArgumentError("invalid request path"); } if (typeof method !== "string") { @@ -5761,12 +5761,12 @@ var require_request = __commonJS({ this.abort = null; if (body == null) { this.body = null; - } else if (util3.isStream(body)) { + } else if (util2.isStream(body)) { this.body = body; const rState = this.body._readableState; if (!rState || !rState.autoDestroy) { this.endHandler = function autoDestroy() { - util3.destroy(this); + util2.destroy(this); }; this.body.on("end", this.endHandler); } @@ -5778,7 +5778,7 @@ var require_request = __commonJS({ } }; this.body.on("error", this.errorHandler); - } else if (util3.isBuffer(body)) { + } else if (util2.isBuffer(body)) { this.body = body.byteLength ? body : null; } else if (ArrayBuffer.isView(body)) { this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null; @@ -5786,7 +5786,7 @@ var require_request = __commonJS({ this.body = body.byteLength ? Buffer.from(body) : null; } else if (typeof body === "string") { this.body = body.length ? Buffer.from(body) : null; - } else if (util3.isFormDataLike(body) || util3.isIterable(body) || util3.isBlobLike(body)) { + } else if (util2.isFormDataLike(body) || util2.isIterable(body) || util2.isBlobLike(body)) { this.body = body; } else { throw new InvalidArgumentError("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable"); @@ -5794,7 +5794,7 @@ var require_request = __commonJS({ this.completed = false; this.aborted = false; this.upgrade = upgrade || null; - this.path = query2 ? util3.buildURL(path4, query2) : path4; + this.path = query ? util2.buildURL(path3, query) : path3; this.origin = origin; this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; this.blocking = blocking == null ? false : blocking; @@ -5820,8 +5820,8 @@ var require_request = __commonJS({ } else if (headers != null) { throw new InvalidArgumentError("headers must be an object or an array"); } - if (util3.isFormDataLike(this.body)) { - if (util3.nodeMajor < 16 || util3.nodeMajor === 16 && util3.nodeMinor < 8) { + if (util2.isFormDataLike(this.body)) { + if (util2.nodeMajor < 16 || util2.nodeMajor === 16 && util2.nodeMinor < 8) { throw new InvalidArgumentError("Form-Data bodies are only supported in node v16.8 and newer."); } if (!extractBody) { @@ -5835,13 +5835,13 @@ var require_request = __commonJS({ } this.body = bodyStream.stream; this.contentLength = bodyStream.length; - } else if (util3.isBlobLike(body) && this.contentType == null && body.type) { + } else if (util2.isBlobLike(body) && this.contentType == null && body.type) { this.contentType = body.type; this.headers += `content-type: ${body.type}\r `; } - util3.validateHandler(handler2, method, upgrade); - this.servername = util3.getServerName(this.host); + util2.validateHandler(handler2, method, upgrade); + this.servername = util2.getServerName(this.host); this[kHandler] = handler2; if (channels.create.hasSubscribers) { channels.create.publish({ request: this }); @@ -5869,8 +5869,8 @@ var require_request = __commonJS({ } } onConnect(abort) { - assert4(!this.aborted); - assert4(!this.completed); + assert3(!this.aborted); + assert3(!this.completed); if (this.error) { abort(this.error); } else { @@ -5879,8 +5879,8 @@ var require_request = __commonJS({ } } onHeaders(statusCode, headers, resume, statusText) { - assert4(!this.aborted); - assert4(!this.completed); + assert3(!this.aborted); + assert3(!this.completed); if (channels.headers.hasSubscribers) { channels.headers.publish({ request: this, response: { statusCode, headers, statusText } }); } @@ -5891,8 +5891,8 @@ var require_request = __commonJS({ } } onData(chunk) { - assert4(!this.aborted); - assert4(!this.completed); + assert3(!this.aborted); + assert3(!this.completed); try { return this[kHandler].onData(chunk); } catch (err) { @@ -5901,13 +5901,13 @@ var require_request = __commonJS({ } } onUpgrade(statusCode, headers, socket) { - assert4(!this.aborted); - assert4(!this.completed); + assert3(!this.aborted); + assert3(!this.completed); return this[kHandler].onUpgrade(statusCode, headers, socket); } onComplete(trailers) { this.onFinally(); - assert4(!this.aborted); + assert3(!this.aborted); this.completed = true; if (channels.trailers.hasSubscribers) { channels.trailers.publish({ request: this, trailers }); @@ -5918,16 +5918,16 @@ var require_request = __commonJS({ this.onError(err); } } - onError(error50) { + onError(error49) { this.onFinally(); if (channels.error.hasSubscribers) { - channels.error.publish({ request: this, error: error50 }); + channels.error.publish({ request: this, error: error49 }); } if (this.aborted) { return; } this.aborted = true; - return this[kHandler].onError(error50); + return this[kHandler].onError(error49); } onFinally() { if (this.errorHandler) { @@ -6238,8 +6238,8 @@ var require_connect = __commonJS({ "node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/core/connect.js"(exports, module) { "use strict"; var net = __require("net"); - var assert4 = __require("assert"); - var util3 = require_util(); + var assert3 = __require("assert"); + var util2 = require_util(); var { InvalidArgumentError, ConnectTimeoutError } = require_errors(); var tls; var SessionCache; @@ -6299,16 +6299,16 @@ var require_connect = __commonJS({ const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions); timeout = timeout == null ? 1e4 : timeout; allowH2 = allowH2 != null ? allowH2 : false; - return function connect({ hostname: hostname5, host, protocol, port, servername, localAddress, httpSocket }, callback) { + return function connect({ hostname: hostname4, host, protocol, port, servername, localAddress, httpSocket }, callback) { let socket; if (protocol === "https:") { if (!tls) { tls = __require("tls"); } - servername = servername || options.servername || util3.getServerName(host) || null; - const sessionKey = servername || hostname5; + servername = servername || options.servername || util2.getServerName(host) || null; + const sessionKey = servername || hostname4; const session = sessionCache.get(sessionKey) || null; - assert4(sessionKey); + assert3(sessionKey); socket = tls.connect({ highWaterMark: 16384, // TLS in node can't have bigger HWM anyway... @@ -6321,20 +6321,20 @@ var require_connect = __commonJS({ socket: httpSocket, // upgrade socket connection port: port || 443, - host: hostname5 + host: hostname4 }); socket.on("session", function(session2) { sessionCache.set(sessionKey, session2); }); } else { - assert4(!httpSocket, "httpSocket can only be sent on TLS update"); + assert3(!httpSocket, "httpSocket can only be sent on TLS update"); socket = net.connect({ highWaterMark: 64 * 1024, // Same as nodejs fs streams. ...options, localAddress, port: port || 80, - host: hostname5 + host: hostname4 }); } if (options.keepAlive == null || options.keepAlive) { @@ -6383,7 +6383,7 @@ var require_connect = __commonJS({ }; } function onConnectTimeout(socket) { - util3.destroy(socket, new ConnectTimeoutError()); + util2.destroy(socket, new ConnectTimeoutError()); } module.exports = buildConnector; } @@ -6734,9 +6734,9 @@ var require_constants3 = __commonJS({ var require_RedirectHandler = __commonJS({ "node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/handler/RedirectHandler.js"(exports, module) { "use strict"; - var util3 = require_util(); + var util2 = require_util(); var { kBodyUsed } = require_symbols(); - var assert4 = __require("assert"); + var assert3 = __require("assert"); var { InvalidArgumentError } = require_errors(); var EE = __require("events"); var redirectableStatusCodes = [300, 301, 302, 303, 307, 308]; @@ -6747,7 +6747,7 @@ var require_RedirectHandler = __commonJS({ this[kBodyUsed] = false; } async *[Symbol.asyncIterator]() { - assert4(!this[kBodyUsed], "disturbed"); + assert3(!this[kBodyUsed], "disturbed"); this[kBodyUsed] = true; yield* this[kBody]; } @@ -6757,7 +6757,7 @@ var require_RedirectHandler = __commonJS({ if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { throw new InvalidArgumentError("maxRedirections must be a positive number"); } - util3.validateHandler(handler2, opts.method, opts.upgrade); + util2.validateHandler(handler2, opts.method, opts.upgrade); this.dispatch = dispatch; this.location = null; this.abort = null; @@ -6765,10 +6765,10 @@ var require_RedirectHandler = __commonJS({ this.maxRedirections = maxRedirections; this.handler = handler2; this.history = []; - if (util3.isStream(this.opts.body)) { - if (util3.bodyLength(this.opts.body) === 0) { + if (util2.isStream(this.opts.body)) { + if (util2.bodyLength(this.opts.body) === 0) { this.opts.body.on("data", function() { - assert4(false); + assert3(false); }); } if (typeof this.opts.body.readableDidRead !== "boolean") { @@ -6779,7 +6779,7 @@ var require_RedirectHandler = __commonJS({ } } else if (this.opts.body && typeof this.opts.body.pipeTo === "function") { this.opts.body = new BodyAsyncIterable(this.opts.body); - } else if (this.opts.body && typeof this.opts.body !== "string" && !ArrayBuffer.isView(this.opts.body) && util3.isIterable(this.opts.body)) { + } else if (this.opts.body && typeof this.opts.body !== "string" && !ArrayBuffer.isView(this.opts.body) && util2.isIterable(this.opts.body)) { this.opts.body = new BodyAsyncIterable(this.opts.body); } } @@ -6790,21 +6790,21 @@ var require_RedirectHandler = __commonJS({ onUpgrade(statusCode, headers, socket) { this.handler.onUpgrade(statusCode, headers, socket); } - onError(error50) { - this.handler.onError(error50); + onError(error49) { + this.handler.onError(error49); } onHeaders(statusCode, headers, resume, statusText) { - this.location = this.history.length >= this.maxRedirections || util3.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers); + this.location = this.history.length >= this.maxRedirections || util2.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers); if (this.opts.origin) { this.history.push(new URL(this.opts.path, this.opts.origin)); } if (!this.location) { return this.handler.onHeaders(statusCode, headers, resume, statusText); } - const { origin, pathname, search: search2 } = util3.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); - const path4 = search2 ? `${pathname}${search2}` : pathname; + const { origin, pathname, search: search2 } = util2.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); + const path3 = search2 ? `${pathname}${search2}` : pathname; this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); - this.opts.path = path4; + this.opts.path = path3; this.opts.origin = origin; this.opts.maxRedirections = 0; this.opts.query = null; @@ -6846,13 +6846,13 @@ var require_RedirectHandler = __commonJS({ } function shouldRemoveHeader(header, removeContent, unknownOrigin) { if (header.length === 4) { - return util3.headerNameToString(header) === "host"; + return util2.headerNameToString(header) === "host"; } - if (removeContent && util3.headerNameToString(header).startsWith("content-")) { + if (removeContent && util2.headerNameToString(header).startsWith("content-")) { return true; } if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) { - const name = util3.headerNameToString(header); + const name = util2.headerNameToString(header); return name === "authorization" || name === "cookie" || name === "proxy-authorization"; } return false; @@ -6872,7 +6872,7 @@ var require_RedirectHandler = __commonJS({ } } } else { - assert4(headers == null, "headers must be an object or an array"); + assert3(headers == null, "headers must be an object or an array"); } return ret; } @@ -6920,11 +6920,11 @@ var require_llhttp_simd_wasm = __commonJS({ var require_client = __commonJS({ "node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/client.js"(exports, module) { "use strict"; - var assert4 = __require("assert"); + var assert3 = __require("assert"); var net = __require("net"); var http2 = __require("http"); var { pipeline: pipeline2 } = __require("stream"); - var util3 = require_util(); + var util2 = require_util(); var timers = require_timers(); var Request2 = require_request(); var DispatcherBase = require_dispatcher_base(); @@ -7135,12 +7135,12 @@ var require_client = __commonJS({ allowH2, socketPath, timeout: connectTimeout, - ...util3.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0, + ...util2.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0, ...connect2 }); } this[kInterceptors] = interceptors && interceptors.Client && Array.isArray(interceptors.Client) ? interceptors.Client : [createRedirectInterceptor({ maxRedirections })]; - this[kUrl] = util3.parseOrigin(url4); + this[kUrl] = util2.parseOrigin(url4); this[kConnector] = connect2; this[kSocket] = null; this[kPipelining] = pipelining != null ? pipelining : 1; @@ -7209,7 +7209,7 @@ var require_client = __commonJS({ const request2 = this[kHTTPConnVersion] === "h2" ? Request2[kHTTP2BuildRequest](origin, opts, handler2) : Request2[kHTTP1BuildRequest](origin, opts, handler2); this[kQueue].push(request2); if (this[kResuming]) { - } else if (util3.bodyLength(request2.body) == null && util3.isIterable(request2.body)) { + } else if (util2.bodyLength(request2.body) == null && util2.isIterable(request2.body)) { this[kResuming] = 1; process.nextTick(resume, this); } else { @@ -7244,21 +7244,21 @@ var require_client = __commonJS({ resolve2(); }; if (this[kHTTP2Session] != null) { - util3.destroy(this[kHTTP2Session], err); + util2.destroy(this[kHTTP2Session], err); this[kHTTP2Session] = null; this[kHTTP2SessionState] = null; } if (!this[kSocket]) { queueMicrotask(callback); } else { - util3.destroy(this[kSocket].on("close", callback), err); + util2.destroy(this[kSocket].on("close", callback), err); } resume(this); }); } }; function onHttp2SessionError(err) { - assert4(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); + assert3(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); this[kSocket][kError] = err; onError(this[kClient], err); } @@ -7270,8 +7270,8 @@ var require_client = __commonJS({ } } function onHttp2SessionEnd() { - util3.destroy(this, new SocketError("other side closed")); - util3.destroy(this[kSocket], new SocketError("other side closed")); + util2.destroy(this, new SocketError("other side closed")); + util2.destroy(this[kSocket], new SocketError("other side closed")); } function onHTTP2GoAway(code) { const client = this[kClient]; @@ -7279,7 +7279,7 @@ var require_client = __commonJS({ client[kSocket] = null; client[kHTTP2Session] = null; if (client.destroyed) { - assert4(this[kPending] === 0); + assert3(this[kPending] === 0); const requests = client[kQueue].splice(client[kRunningIdx]); for (let i = 0; i < requests.length; i++) { const request2 = requests[i]; @@ -7291,7 +7291,7 @@ var require_client = __commonJS({ errorRequest(client, request2, err); } client[kPendingIdx] = client[kRunningIdx]; - assert4(client[kRunning] === 0); + assert3(client[kRunning] === 0); client.emit( "disconnect", client[kUrl], @@ -7318,35 +7318,35 @@ var require_client = __commonJS({ return 0; }, wasm_on_status: (p, at, len) => { - assert4.strictEqual(currentParser.ptr, p); + assert3.strictEqual(currentParser.ptr, p); const start = at - currentBufferPtr + currentBufferRef.byteOffset; return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; }, wasm_on_message_begin: (p) => { - assert4.strictEqual(currentParser.ptr, p); + assert3.strictEqual(currentParser.ptr, p); return currentParser.onMessageBegin() || 0; }, wasm_on_header_field: (p, at, len) => { - assert4.strictEqual(currentParser.ptr, p); + assert3.strictEqual(currentParser.ptr, p); const start = at - currentBufferPtr + currentBufferRef.byteOffset; return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; }, wasm_on_header_value: (p, at, len) => { - assert4.strictEqual(currentParser.ptr, p); + assert3.strictEqual(currentParser.ptr, p); const start = at - currentBufferPtr + currentBufferRef.byteOffset; return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; }, wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => { - assert4.strictEqual(currentParser.ptr, p); + assert3.strictEqual(currentParser.ptr, p); return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0; }, wasm_on_body: (p, at, len) => { - assert4.strictEqual(currentParser.ptr, p); + assert3.strictEqual(currentParser.ptr, p); const start = at - currentBufferPtr + currentBufferRef.byteOffset; return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; }, wasm_on_message_complete: (p) => { - assert4.strictEqual(currentParser.ptr, p); + assert3.strictEqual(currentParser.ptr, p); return currentParser.onMessageComplete() || 0; } /* eslint-enable camelcase */ @@ -7365,7 +7365,7 @@ var require_client = __commonJS({ var TIMEOUT_IDLE = 3; var Parser = class { constructor(client, socket, { exports: exports2 }) { - assert4(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0); + assert3(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0); this.llhttp = exports2; this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE); this.client = client; @@ -7411,10 +7411,10 @@ var require_client = __commonJS({ if (this.socket.destroyed || !this.paused) { return; } - assert4(this.ptr != null); - assert4(currentParser == null); + assert3(this.ptr != null); + assert3(currentParser == null); this.llhttp.llhttp_resume(this.ptr); - assert4(this.timeoutType === TIMEOUT_BODY); + assert3(this.timeoutType === TIMEOUT_BODY); if (this.timeout) { if (this.timeout.refresh) { this.timeout.refresh(); @@ -7434,9 +7434,9 @@ var require_client = __commonJS({ } } execute(data) { - assert4(this.ptr != null); - assert4(currentParser == null); - assert4(!this.paused); + assert3(this.ptr != null); + assert3(currentParser == null); + assert3(!this.paused); const { socket, llhttp } = this; if (data.length > currentBufferSize) { if (currentBufferPtr) { @@ -7474,12 +7474,12 @@ var require_client = __commonJS({ throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset)); } } catch (err) { - util3.destroy(socket, err); + util2.destroy(socket, err); } } destroy() { - assert4(this.ptr != null); - assert4(currentParser == null); + assert3(this.ptr != null); + assert3(currentParser == null); this.llhttp.llhttp_free(this.ptr); this.ptr = null; timers.clearTimeout(this.timeout); @@ -7531,22 +7531,22 @@ var require_client = __commonJS({ trackHeader(len) { this.headersSize += len; if (this.headersSize >= this.headersMaxSize) { - util3.destroy(this.socket, new HeadersOverflowError()); + util2.destroy(this.socket, new HeadersOverflowError()); } } onUpgrade(head) { const { upgrade, client, socket, headers, statusCode } = this; - assert4(upgrade); + assert3(upgrade); const request2 = client[kQueue][client[kRunningIdx]]; - assert4(request2); - assert4(!socket.destroyed); - assert4(socket === client[kSocket]); - assert4(!this.paused); - assert4(request2.upgrade || request2.method === "CONNECT"); + assert3(request2); + assert3(!socket.destroyed); + assert3(socket === client[kSocket]); + assert3(!this.paused); + assert3(request2.upgrade || request2.method === "CONNECT"); this.statusCode = null; this.statusText = ""; this.shouldKeepAlive = null; - assert4(this.headers.length % 2 === 0); + assert3(this.headers.length % 2 === 0); this.headers = []; this.headersSize = 0; socket.unshift(head); @@ -7561,7 +7561,7 @@ var require_client = __commonJS({ try { request2.onUpgrade(statusCode, headers, socket); } catch (err) { - util3.destroy(socket, err); + util2.destroy(socket, err); } resume(client); } @@ -7574,17 +7574,17 @@ var require_client = __commonJS({ if (!request2) { return -1; } - assert4(!this.upgrade); - assert4(this.statusCode < 200); + assert3(!this.upgrade); + assert3(this.statusCode < 200); if (statusCode === 100) { - util3.destroy(socket, new SocketError("bad response", util3.getSocketInfo(socket))); + util2.destroy(socket, new SocketError("bad response", util2.getSocketInfo(socket))); return -1; } if (upgrade && !request2.upgrade) { - util3.destroy(socket, new SocketError("bad upgrade", util3.getSocketInfo(socket))); + util2.destroy(socket, new SocketError("bad upgrade", util2.getSocketInfo(socket))); return -1; } - assert4.strictEqual(this.timeoutType, TIMEOUT_HEADERS); + assert3.strictEqual(this.timeoutType, TIMEOUT_HEADERS); this.statusCode = statusCode; this.shouldKeepAlive = shouldKeepAlive || // Override llhttp value which does not allow keepAlive for HEAD. request2.method === "HEAD" && !socket[kReset] && this.connection.toLowerCase() === "keep-alive"; @@ -7597,20 +7597,20 @@ var require_client = __commonJS({ } } if (request2.method === "CONNECT") { - assert4(client[kRunning] === 1); + assert3(client[kRunning] === 1); this.upgrade = true; return 2; } if (upgrade) { - assert4(client[kRunning] === 1); + assert3(client[kRunning] === 1); this.upgrade = true; return 2; } - assert4(this.headers.length % 2 === 0); + assert3(this.headers.length % 2 === 0); this.headers = []; this.headersSize = 0; if (this.shouldKeepAlive && client[kPipelining]) { - const keepAliveTimeout = this.keepAlive ? util3.parseKeepAliveTimeout(this.keepAlive) : null; + const keepAliveTimeout = this.keepAlive ? util2.parseKeepAliveTimeout(this.keepAlive) : null; if (keepAliveTimeout != null) { const timeout = Math.min( keepAliveTimeout - client[kKeepAliveTimeoutThreshold], @@ -7649,16 +7649,16 @@ var require_client = __commonJS({ return -1; } const request2 = client[kQueue][client[kRunningIdx]]; - assert4(request2); - assert4.strictEqual(this.timeoutType, TIMEOUT_BODY); + assert3(request2); + assert3.strictEqual(this.timeoutType, TIMEOUT_BODY); if (this.timeout) { if (this.timeout.refresh) { this.timeout.refresh(); } } - assert4(statusCode >= 200); + assert3(statusCode >= 200); if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) { - util3.destroy(socket, new ResponseExceededMaxSizeError()); + util2.destroy(socket, new ResponseExceededMaxSizeError()); return -1; } this.bytesRead += buf.length; @@ -7675,35 +7675,35 @@ var require_client = __commonJS({ return; } const request2 = client[kQueue][client[kRunningIdx]]; - assert4(request2); - assert4(statusCode >= 100); + assert3(request2); + assert3(statusCode >= 100); this.statusCode = null; this.statusText = ""; this.bytesRead = 0; this.contentLength = ""; this.keepAlive = ""; this.connection = ""; - assert4(this.headers.length % 2 === 0); + assert3(this.headers.length % 2 === 0); this.headers = []; this.headersSize = 0; if (statusCode < 200) { return; } if (request2.method !== "HEAD" && contentLength && bytesRead !== parseInt(contentLength, 10)) { - util3.destroy(socket, new ResponseContentLengthMismatchError()); + util2.destroy(socket, new ResponseContentLengthMismatchError()); return -1; } request2.onComplete(headers); client[kQueue][client[kRunningIdx]++] = null; if (socket[kWriting]) { - assert4.strictEqual(client[kRunning], 0); - util3.destroy(socket, new InformationalError("reset")); + assert3.strictEqual(client[kRunning], 0); + util2.destroy(socket, new InformationalError("reset")); return constants.ERROR.PAUSED; } else if (!shouldKeepAlive) { - util3.destroy(socket, new InformationalError("reset")); + util2.destroy(socket, new InformationalError("reset")); return constants.ERROR.PAUSED; } else if (socket[kReset] && client[kRunning] === 0) { - util3.destroy(socket, new InformationalError("reset")); + util2.destroy(socket, new InformationalError("reset")); return constants.ERROR.PAUSED; } else if (client[kPipelining] === 1) { setImmediate(resume, client); @@ -7716,16 +7716,16 @@ var require_client = __commonJS({ const { socket, timeoutType, client } = parser; if (timeoutType === TIMEOUT_HEADERS) { if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) { - assert4(!parser.paused, "cannot be paused while waiting for headers"); - util3.destroy(socket, new HeadersTimeoutError()); + assert3(!parser.paused, "cannot be paused while waiting for headers"); + util2.destroy(socket, new HeadersTimeoutError()); } } else if (timeoutType === TIMEOUT_BODY) { if (!parser.paused) { - util3.destroy(socket, new BodyTimeoutError()); + util2.destroy(socket, new BodyTimeoutError()); } } else if (timeoutType === TIMEOUT_IDLE) { - assert4(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]); - util3.destroy(socket, new InformationalError("socket idle timeout")); + assert3(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]); + util2.destroy(socket, new InformationalError("socket idle timeout")); } } function onSocketReadable() { @@ -7736,7 +7736,7 @@ var require_client = __commonJS({ } function onSocketError(err) { const { [kClient]: client, [kParser]: parser } = this; - assert4(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); + assert3(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); if (client[kHTTPConnVersion] !== "h2") { if (err.code === "ECONNRESET" && parser.statusCode && !parser.shouldKeepAlive) { parser.onMessageComplete(); @@ -7748,13 +7748,13 @@ var require_client = __commonJS({ } function onError(client, err) { if (client[kRunning] === 0 && err.code !== "UND_ERR_INFO" && err.code !== "UND_ERR_SOCKET") { - assert4(client[kPendingIdx] === client[kRunningIdx]); + assert3(client[kPendingIdx] === client[kRunningIdx]); const requests = client[kQueue].splice(client[kRunningIdx]); for (let i = 0; i < requests.length; i++) { const request2 = requests[i]; errorRequest(client, request2, err); } - assert4(client[kSize] === 0); + assert3(client[kSize] === 0); } } function onSocketEnd() { @@ -7765,7 +7765,7 @@ var require_client = __commonJS({ return; } } - util3.destroy(this, new SocketError("other side closed", util3.getSocketInfo(this))); + util2.destroy(this, new SocketError("other side closed", util2.getSocketInfo(this))); } function onSocketClose() { const { [kClient]: client, [kParser]: parser } = this; @@ -7776,10 +7776,10 @@ var require_client = __commonJS({ this[kParser].destroy(); this[kParser] = null; } - const err = this[kError] || new SocketError("closed", util3.getSocketInfo(this)); + const err = this[kError] || new SocketError("closed", util2.getSocketInfo(this)); client[kSocket] = null; if (client.destroyed) { - assert4(client[kPending] === 0); + assert3(client[kPending] === 0); const requests = client[kQueue].splice(client[kRunningIdx]); for (let i = 0; i < requests.length; i++) { const request2 = requests[i]; @@ -7791,27 +7791,27 @@ var require_client = __commonJS({ errorRequest(client, request2, err); } client[kPendingIdx] = client[kRunningIdx]; - assert4(client[kRunning] === 0); + assert3(client[kRunning] === 0); client.emit("disconnect", client[kUrl], [client], err); resume(client); } async function connect(client) { - assert4(!client[kConnecting]); - assert4(!client[kSocket]); - let { host, hostname: hostname5, protocol, port } = client[kUrl]; - if (hostname5[0] === "[") { - const idx = hostname5.indexOf("]"); - assert4(idx !== -1); - const ip2 = hostname5.substring(1, idx); - assert4(net.isIP(ip2)); - hostname5 = ip2; + assert3(!client[kConnecting]); + assert3(!client[kSocket]); + let { host, hostname: hostname4, protocol, port } = client[kUrl]; + if (hostname4[0] === "[") { + const idx = hostname4.indexOf("]"); + assert3(idx !== -1); + const ip2 = hostname4.substring(1, idx); + assert3(net.isIP(ip2)); + hostname4 = ip2; } client[kConnecting] = true; if (channels.beforeConnect.hasSubscribers) { channels.beforeConnect.publish({ connectParams: { host, - hostname: hostname5, + hostname: hostname4, protocol, port, servername: client[kServerName], @@ -7824,7 +7824,7 @@ var require_client = __commonJS({ const socket = await new Promise((resolve2, reject) => { client[kConnector]({ host, - hostname: hostname5, + hostname: hostname4, protocol, port, servername: client[kServerName], @@ -7838,12 +7838,12 @@ var require_client = __commonJS({ }); }); if (client.destroyed) { - util3.destroy(socket.on("error", () => { + util2.destroy(socket.on("error", () => { }), new ClientDestroyedError()); return; } client[kConnecting] = false; - assert4(socket); + assert3(socket); const isH2 = socket.alpnProtocol === "h2"; if (isH2) { if (!h2ExperimentalWarned) { @@ -7888,7 +7888,7 @@ var require_client = __commonJS({ channels.connected.publish({ connectParams: { host, - hostname: hostname5, + hostname: hostname4, protocol, port, servername: client[kServerName], @@ -7908,7 +7908,7 @@ var require_client = __commonJS({ channels.connectError.publish({ connectParams: { host, - hostname: hostname5, + hostname: hostname4, protocol, port, servername: client[kServerName], @@ -7919,7 +7919,7 @@ var require_client = __commonJS({ }); } if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") { - assert4(client[kRunning] === 0); + assert3(client[kRunning] === 0); while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) { const request2 = client[kQueue][client[kPendingIdx]++]; errorRequest(client, request2, err); @@ -7951,7 +7951,7 @@ var require_client = __commonJS({ function _resume(client, sync) { while (true) { if (client.destroyed) { - assert4(client[kPending] === 0); + assert3(client[kPending] === 0); return; } if (client[kClosedResolve] && !client[kSize]) { @@ -8006,7 +8006,7 @@ var require_client = __commonJS({ } client[kServerName] = request2.servername; if (socket && socket.servername !== request2.servername) { - util3.destroy(socket, new InformationalError("servername changed")); + util2.destroy(socket, new InformationalError("servername changed")); return; } } @@ -8026,7 +8026,7 @@ var require_client = __commonJS({ if (client[kRunning] > 0 && (request2.upgrade || request2.method === "CONNECT")) { return; } - if (client[kRunning] > 0 && util3.bodyLength(request2.body) !== 0 && (util3.isStream(request2.body) || util3.isAsyncIterable(request2.body))) { + if (client[kRunning] > 0 && util2.bodyLength(request2.body) !== 0 && (util2.isStream(request2.body) || util2.isAsyncIterable(request2.body))) { return; } if (!request2.aborted && write2(client, request2)) { @@ -8044,12 +8044,12 @@ var require_client = __commonJS({ writeH2(client, client[kHTTP2Session], request2); return; } - const { body, method, path: path4, host, upgrade, headers, blocking, reset } = request2; + const { body, method, path: path3, host, upgrade, headers, blocking, reset } = request2; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { body.read(0); } - const bodyLength = util3.bodyLength(body); + const bodyLength = util2.bodyLength(body); let contentLength = bodyLength; if (contentLength === null) { contentLength = request2.contentLength; @@ -8071,7 +8071,7 @@ var require_client = __commonJS({ return; } errorRequest(client, request2, err || new RequestAbortedError()); - util3.destroy(socket, new InformationalError("aborted")); + util2.destroy(socket, new InformationalError("aborted")); }); } catch (err) { errorRequest(client, request2, err); @@ -8094,7 +8094,7 @@ var require_client = __commonJS({ if (blocking) { socket[kBlocking] = true; } - let header = `${method} ${path4} HTTP/1.1\r + let header = `${method} ${path3} HTTP/1.1\r `; if (typeof host === "string") { header += `host: ${host}\r @@ -8123,13 +8123,13 @@ upgrade: ${upgrade}\r \r `, "latin1"); } else { - assert4(contentLength === null, "no body must not have content length"); + assert3(contentLength === null, "no body must not have content length"); socket.write(`${header}\r `, "latin1"); } request2.onRequestSent(); - } else if (util3.isBuffer(body)) { - assert4(contentLength === body.byteLength, "buffer body must have content length"); + } else if (util2.isBuffer(body)) { + assert3(contentLength === body.byteLength, "buffer body must have content length"); socket.cork(); socket.write(`${header}content-length: ${contentLength}\r \r @@ -8141,23 +8141,23 @@ upgrade: ${upgrade}\r if (!expectsPayload) { socket[kReset] = true; } - } else if (util3.isBlobLike(body)) { + } else if (util2.isBlobLike(body)) { if (typeof body.stream === "function") { writeIterable({ body: body.stream(), client, request: request2, socket, contentLength, header, expectsPayload }); } else { writeBlob({ body, client, request: request2, socket, contentLength, header, expectsPayload }); } - } else if (util3.isStream(body)) { + } else if (util2.isStream(body)) { writeStream({ body, client, request: request2, socket, contentLength, header, expectsPayload }); - } else if (util3.isIterable(body)) { + } else if (util2.isIterable(body)) { writeIterable({ body, client, request: request2, socket, contentLength, header, expectsPayload }); } else { - assert4(false); + assert3(false); } return true; } function writeH2(client, session, request2) { - const { body, method, path: path4, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; + const { body, method, path: path3, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; let headers; if (typeof reqHeaders === "string") headers = Request2[kHTTP2CopyHeaders](reqHeaders.trim()); else headers = reqHeaders; @@ -8200,13 +8200,13 @@ upgrade: ${upgrade}\r }); return true; } - headers[HTTP2_HEADER_PATH] = path4; + headers[HTTP2_HEADER_PATH] = path3; headers[HTTP2_HEADER_SCHEME] = "https"; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { body.read(0); } - let contentLength = util3.bodyLength(body); + let contentLength = util2.bodyLength(body); if (contentLength == null) { contentLength = request2.contentLength; } @@ -8221,7 +8221,7 @@ upgrade: ${upgrade}\r process.emitWarning(new RequestContentLengthMismatchError()); } if (contentLength != null) { - assert4(body, "no body must not have content length"); + assert3(body, "no body must not have content length"); headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`; } session.ref(); @@ -8261,7 +8261,7 @@ upgrade: ${upgrade}\r stream.once("error", function(err) { if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) { h2State.streams -= 1; - util3.destroy(stream, err); + util2.destroy(stream, err); } }); stream.once("frameError", (type2, code) => { @@ -8269,22 +8269,22 @@ upgrade: ${upgrade}\r errorRequest(client, request2, err); if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) { h2State.streams -= 1; - util3.destroy(stream, err); + util2.destroy(stream, err); } }); return true; function writeBodyH2() { if (!body) { request2.onRequestSent(); - } else if (util3.isBuffer(body)) { - assert4(contentLength === body.byteLength, "buffer body must have content length"); + } else if (util2.isBuffer(body)) { + assert3(contentLength === body.byteLength, "buffer body must have content length"); stream.cork(); stream.write(body); stream.uncork(); stream.end(); request2.onBodySent(body); request2.onRequestSent(); - } else if (util3.isBlobLike(body)) { + } else if (util2.isBlobLike(body)) { if (typeof body.stream === "function") { writeIterable({ client, @@ -8308,7 +8308,7 @@ upgrade: ${upgrade}\r socket: client[kSocket] }); } - } else if (util3.isStream(body)) { + } else if (util2.isStream(body)) { writeStream({ body, client, @@ -8319,7 +8319,7 @@ upgrade: ${upgrade}\r h2stream: stream, header: "" }); - } else if (util3.isIterable(body)) { + } else if (util2.isIterable(body)) { writeIterable({ body, client, @@ -8331,32 +8331,32 @@ upgrade: ${upgrade}\r socket: client[kSocket] }); } else { - assert4(false); + assert3(false); } } } function writeStream({ h2stream, body, client, request: request2, socket, contentLength, header, expectsPayload }) { - assert4(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined"); + assert3(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined"); if (client[kHTTPConnVersion] === "h2") { let onPipeData = function(chunk) { request2.onBodySent(chunk); }; - const pipe4 = pipeline2( + const pipe3 = pipeline2( body, h2stream, (err) => { if (err) { - util3.destroy(body, err); - util3.destroy(h2stream, err); + util2.destroy(body, err); + util2.destroy(h2stream, err); } else { request2.onRequestSent(); } } ); - pipe4.on("data", onPipeData); - pipe4.once("end", () => { - pipe4.removeListener("data", onPipeData); - util3.destroy(pipe4); + pipe3.on("data", onPipeData); + pipe3.once("end", () => { + pipe3.removeListener("data", onPipeData); + util2.destroy(pipe3); }); return; } @@ -8371,7 +8371,7 @@ upgrade: ${upgrade}\r this.pause(); } } catch (err) { - util3.destroy(this, err); + util2.destroy(this, err); } }; const onDrain = function() { @@ -8394,7 +8394,7 @@ upgrade: ${upgrade}\r return; } finished = true; - assert4(socket.destroyed || socket[kWriting] && client[kRunning] <= 1); + assert3(socket.destroyed || socket[kWriting] && client[kRunning] <= 1); socket.off("drain", onDrain).off("error", onFinished); body.removeListener("data", onData).removeListener("end", onFinished).removeListener("error", onFinished).removeListener("close", onAbort); if (!err) { @@ -8406,9 +8406,9 @@ upgrade: ${upgrade}\r } writer.destroy(err); if (err && (err.code !== "UND_ERR_INFO" || err.message !== "reset")) { - util3.destroy(body, err); + util2.destroy(body, err); } else { - util3.destroy(body); + util2.destroy(body); } }; body.on("data", onData).on("end", onFinished).on("error", onFinished).on("close", onAbort); @@ -8418,7 +8418,7 @@ upgrade: ${upgrade}\r socket.on("drain", onDrain).on("error", onFinished); } async function writeBlob({ h2stream, body, client, request: request2, socket, contentLength, header, expectsPayload }) { - assert4(contentLength === body.size, "blob body must have content length"); + assert3(contentLength === body.size, "blob body must have content length"); const isH2 = client[kHTTPConnVersion] === "h2"; try { if (contentLength != null && contentLength !== body.size) { @@ -8444,11 +8444,11 @@ upgrade: ${upgrade}\r } resume(client); } catch (err) { - util3.destroy(isH2 ? h2stream : socket, err); + util2.destroy(isH2 ? h2stream : socket, err); } } async function writeIterable({ h2stream, body, client, request: request2, socket, contentLength, header, expectsPayload }) { - assert4(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined"); + assert3(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined"); let callback = null; function onDrain() { if (callback) { @@ -8458,7 +8458,7 @@ upgrade: ${upgrade}\r } } const waitForDrain = () => new Promise((resolve2, reject) => { - assert4(callback === null); + assert3(callback === null); if (socket[kError]) { reject(socket[kError]); } else { @@ -8606,15 +8606,15 @@ ${len.toString(16)}\r const { socket, client } = this; socket[kWriting] = false; if (err) { - assert4(client[kRunning] <= 1, "pipeline should only contain this request"); - util3.destroy(socket, err); + assert3(client[kRunning] <= 1, "pipeline should only contain this request"); + util2.destroy(socket, err); } } }; function errorRequest(client, request2, err) { try { request2.onError(err); - assert4(request2.aborted); + assert3(request2.aborted); } catch (err2) { client.emit("error", err2); } @@ -8882,7 +8882,7 @@ var require_pool = __commonJS({ var { InvalidArgumentError } = require_errors(); - var util3 = require_util(); + var util2 = require_util(); var { kUrl, kInterceptors } = require_symbols(); var buildConnector = require_connect(); var kOptions = Symbol("options"); @@ -8922,17 +8922,17 @@ var require_pool = __commonJS({ allowH2, socketPath, timeout: connectTimeout, - ...util3.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0, + ...util2.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0, ...connect }); } this[kInterceptors] = options.interceptors && options.interceptors.Pool && Array.isArray(options.interceptors.Pool) ? options.interceptors.Pool : []; this[kConnections] = connections || null; - this[kUrl] = util3.parseOrigin(origin); - this[kOptions] = { ...util3.deepClone(options), connect, allowH2 }; + this[kUrl] = util2.parseOrigin(origin); + this[kOptions] = { ...util2.deepClone(options), connect, allowH2 }; this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; this[kFactory] = factory; - this.on("connectionError", (origin2, targets, error50) => { + this.on("connectionError", (origin2, targets, error49) => { for (const target of targets) { const idx = this[kClients].indexOf(target); if (idx !== -1) { @@ -9143,7 +9143,7 @@ var require_agent = __commonJS({ var DispatcherBase = require_dispatcher_base(); var Pool = require_pool(); var Client2 = require_client(); - var util3 = require_util(); + var util2 = require_util(); var createRedirectInterceptor = require_redirectInterceptor(); var { WeakRef: WeakRef2, FinalizationRegistry: FinalizationRegistry2 } = require_dispatcher_weakref()(); var kOnConnect = Symbol("onConnect"); @@ -9173,7 +9173,7 @@ var require_agent = __commonJS({ connect = { ...connect }; } this[kInterceptors] = options.interceptors && options.interceptors.Agent && Array.isArray(options.interceptors.Agent) ? options.interceptors.Agent : [createRedirectInterceptor({ maxRedirections })]; - this[kOptions] = { ...util3.deepClone(options), connect }; + this[kOptions] = { ...util2.deepClone(options), connect }; this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; this[kMaxRedirections] = maxRedirections; this[kFactory] = factory; @@ -9256,10 +9256,10 @@ var require_agent = __commonJS({ var require_readable = __commonJS({ "node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/api/readable.js"(exports, module) { "use strict"; - var assert4 = __require("assert"); + var assert3 = __require("assert"); var { Readable } = __require("stream"); var { RequestAbortedError, NotSupportedError, InvalidArgumentError } = require_errors(); - var util3 = require_util(); + var util2 = require_util(); var { ReadableStreamFrom, toUSVString } = require_util(); var Blob2; var kConsume = Symbol("kConsume"); @@ -9357,7 +9357,7 @@ var require_readable = __commonJS({ } // https://fetch.spec.whatwg.org/#dom-body-bodyused get bodyUsed() { - return util3.isDisturbed(this); + return util2.isDisturbed(this); } // https://fetch.spec.whatwg.org/#dom-body-body get body() { @@ -9365,7 +9365,7 @@ var require_readable = __commonJS({ this[kBody] = ReadableStreamFrom(this); if (this[kConsume]) { this[kBody].getReader(); - assert4(this[kBody].locked); + assert3(this[kBody].locked); } } return this[kBody]; @@ -9378,7 +9378,7 @@ var require_readable = __commonJS({ if (typeof signal !== "object" || !("aborted" in signal)) { throw new InvalidArgumentError("signal must be an AbortSignal"); } - util3.throwIfAborted(signal); + util2.throwIfAborted(signal); } catch (err) { return Promise.reject(err); } @@ -9387,7 +9387,7 @@ var require_readable = __commonJS({ return Promise.resolve(null); } return new Promise((resolve2, reject) => { - const signalListenerCleanup = signal ? util3.addAbortListener(signal, () => { + const signalListenerCleanup = signal ? util2.addAbortListener(signal, () => { this.destroy(); }) : noop4; this.on("close", function() { @@ -9410,13 +9410,13 @@ var require_readable = __commonJS({ return self2[kBody] && self2[kBody].locked === true || self2[kConsume]; } function isUnusable(self2) { - return util3.isDisturbed(self2) || isLocked(self2); + return util2.isDisturbed(self2) || isLocked(self2); } async function consume(stream, type2) { if (isUnusable(stream)) { throw new TypeError("unusable"); } - assert4(!stream[kConsume]); + assert3(!stream[kConsume]); return new Promise((resolve2, reject) => { stream[kConsume] = { type: type2, @@ -9507,13 +9507,13 @@ var require_readable = __commonJS({ // node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/api/util.js var require_util3 = __commonJS({ "node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/api/util.js"(exports, module) { - var assert4 = __require("assert"); + var assert3 = __require("assert"); var { ResponseStatusCodeError } = require_errors(); var { toUSVString } = require_util(); async function getResolveErrorBodyCallback({ callback, body, contentType, statusCode, statusMessage, headers }) { - assert4(body); + assert3(body); let chunks = []; let limit = 0; for await (const chunk of body) { @@ -9605,7 +9605,7 @@ var require_api_request = __commonJS({ InvalidArgumentError, RequestAbortedError } = require_errors(); - var util3 = require_util(); + var util2 = require_util(); var { getResolveErrorBodyCallback } = require_util3(); var { AsyncResource } = __require("async_hooks"); var { addSignal, removeSignal } = require_abort_signal(); @@ -9633,8 +9633,8 @@ var require_api_request = __commonJS({ } super("UNDICI_REQUEST"); } catch (err) { - if (util3.isStream(body)) { - util3.destroy(body.on("error", util3.nop), err); + if (util2.isStream(body)) { + util2.destroy(body.on("error", util2.nop), err); } throw err; } @@ -9649,7 +9649,7 @@ var require_api_request = __commonJS({ this.onInfo = onInfo || null; this.throwOnError = throwOnError; this.highWaterMark = highWaterMark; - if (util3.isStream(body)) { + if (util2.isStream(body)) { body.on("error", (err) => { this.onError(err); }); @@ -9665,14 +9665,14 @@ var require_api_request = __commonJS({ } onHeaders(statusCode, rawHeaders, resume, statusMessage) { const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this; - const headers = responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders); + const headers = responseHeaders === "raw" ? util2.parseRawHeaders(rawHeaders) : util2.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { this.onInfo({ statusCode, headers }); } return; } - const parsedHeaders = responseHeaders === "raw" ? util3.parseHeaders(rawHeaders) : headers; + const parsedHeaders = responseHeaders === "raw" ? util2.parseHeaders(rawHeaders) : headers; const contentType = parsedHeaders["content-type"]; const body = new Readable({ resume, abort, contentType, highWaterMark }); this.callback = null; @@ -9703,7 +9703,7 @@ var require_api_request = __commonJS({ onComplete(trailers) { const { res } = this; removeSignal(this); - util3.parseHeaders(trailers, this.trailers); + util2.parseHeaders(trailers, this.trailers); res.push(null); } onError(err) { @@ -9718,12 +9718,12 @@ var require_api_request = __commonJS({ if (res) { this.res = null; queueMicrotask(() => { - util3.destroy(res, err); + util2.destroy(res, err); }); } if (body) { this.body = null; - util3.destroy(body, err); + util2.destroy(body, err); } } }; @@ -9760,7 +9760,7 @@ var require_api_stream = __commonJS({ InvalidReturnValueError, RequestAbortedError } = require_errors(); - var util3 = require_util(); + var util2 = require_util(); var { getResolveErrorBodyCallback } = require_util3(); var { AsyncResource } = __require("async_hooks"); var { addSignal, removeSignal } = require_abort_signal(); @@ -9788,8 +9788,8 @@ var require_api_stream = __commonJS({ } super("UNDICI_STREAM"); } catch (err) { - if (util3.isStream(body)) { - util3.destroy(body.on("error", util3.nop), err); + if (util2.isStream(body)) { + util2.destroy(body.on("error", util2.nop), err); } throw err; } @@ -9804,7 +9804,7 @@ var require_api_stream = __commonJS({ this.body = body; this.onInfo = onInfo || null; this.throwOnError = throwOnError || false; - if (util3.isStream(body)) { + if (util2.isStream(body)) { body.on("error", (err) => { this.onError(err); }); @@ -9820,7 +9820,7 @@ var require_api_stream = __commonJS({ } onHeaders(statusCode, rawHeaders, resume, statusMessage) { const { factory, opaque, context, callback, responseHeaders } = this; - const headers = responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders); + const headers = responseHeaders === "raw" ? util2.parseRawHeaders(rawHeaders) : util2.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { this.onInfo({ statusCode, headers }); @@ -9830,7 +9830,7 @@ var require_api_stream = __commonJS({ this.factory = null; let res; if (this.throwOnError && statusCode >= 400) { - const parsedHeaders = responseHeaders === "raw" ? util3.parseHeaders(rawHeaders) : headers; + const parsedHeaders = responseHeaders === "raw" ? util2.parseHeaders(rawHeaders) : headers; const contentType = parsedHeaders["content-type"]; res = new PassThrough(); this.callback = null; @@ -9856,7 +9856,7 @@ var require_api_stream = __commonJS({ const { callback: callback2, res: res2, opaque: opaque2, trailers, abort } = this; this.res = null; if (err || !res2.readable) { - util3.destroy(res2, err); + util2.destroy(res2, err); } this.callback = null; this.runInAsyncScope(callback2, null, err || null, { opaque: opaque2, trailers }); @@ -9880,7 +9880,7 @@ var require_api_stream = __commonJS({ if (!res) { return; } - this.trailers = util3.parseHeaders(trailers); + this.trailers = util2.parseHeaders(trailers); res.end(); } onError(err) { @@ -9889,7 +9889,7 @@ var require_api_stream = __commonJS({ this.factory = null; if (res) { this.res = null; - util3.destroy(res, err); + util2.destroy(res, err); } else if (callback) { this.callback = null; queueMicrotask(() => { @@ -9898,7 +9898,7 @@ var require_api_stream = __commonJS({ } if (body) { this.body = null; - util3.destroy(body, err); + util2.destroy(body, err); } } }; @@ -9938,10 +9938,10 @@ var require_api_pipeline = __commonJS({ InvalidReturnValueError, RequestAbortedError } = require_errors(); - var util3 = require_util(); + var util2 = require_util(); var { AsyncResource } = __require("async_hooks"); var { addSignal, removeSignal } = require_abort_signal(); - var assert4 = __require("assert"); + var assert3 = __require("assert"); var kResume = Symbol("resume"); var PipelineRequest = class extends Readable { constructor() { @@ -10000,7 +10000,7 @@ var require_api_pipeline = __commonJS({ this.abort = null; this.context = null; this.onInfo = onInfo || null; - this.req = new PipelineRequest().on("error", util3.nop); + this.req = new PipelineRequest().on("error", util2.nop); this.ret = new Duplex({ readableObjectMode: opts.objectMode, autoDestroy: true, @@ -10026,9 +10026,9 @@ var require_api_pipeline = __commonJS({ if (abort && err) { abort(); } - util3.destroy(body, err); - util3.destroy(req, err); - util3.destroy(res, err); + util2.destroy(body, err); + util2.destroy(req, err); + util2.destroy(res, err); removeSignal(this); callback(err); } @@ -10041,7 +10041,7 @@ var require_api_pipeline = __commonJS({ } onConnect(abort, context) { const { ret, res } = this; - assert4(!res, "pipeline cannot be retried"); + assert3(!res, "pipeline cannot be retried"); if (ret.destroyed) { throw new RequestAbortedError(); } @@ -10052,7 +10052,7 @@ var require_api_pipeline = __commonJS({ const { opaque, handler: handler2, context } = this; if (statusCode < 200) { if (this.onInfo) { - const headers = this.responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders); + const headers = this.responseHeaders === "raw" ? util2.parseRawHeaders(rawHeaders) : util2.parseHeaders(rawHeaders); this.onInfo({ statusCode, headers }); } return; @@ -10061,7 +10061,7 @@ var require_api_pipeline = __commonJS({ let body; try { this.handler = null; - const headers = this.responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders); + const headers = this.responseHeaders === "raw" ? util2.parseRawHeaders(rawHeaders) : util2.parseHeaders(rawHeaders); body = this.runInAsyncScope(handler2, null, { statusCode, headers, @@ -10070,7 +10070,7 @@ var require_api_pipeline = __commonJS({ context }); } catch (err) { - this.res.on("error", util3.nop); + this.res.on("error", util2.nop); throw err; } if (!body || typeof body.on !== "function") { @@ -10083,14 +10083,14 @@ var require_api_pipeline = __commonJS({ } }).on("error", (err) => { const { ret } = this; - util3.destroy(ret, err); + util2.destroy(ret, err); }).on("end", () => { const { ret } = this; ret.push(null); }).on("close", () => { const { ret } = this; if (!ret._readableState.ended) { - util3.destroy(ret, new RequestAbortedError()); + util2.destroy(ret, new RequestAbortedError()); } }); this.body = body; @@ -10106,7 +10106,7 @@ var require_api_pipeline = __commonJS({ onError(err) { const { ret } = this; this.handler = null; - util3.destroy(ret, err); + util2.destroy(ret, err); } }; function pipeline2(opts, handler2) { @@ -10128,9 +10128,9 @@ var require_api_upgrade = __commonJS({ "use strict"; var { InvalidArgumentError, RequestAbortedError, SocketError } = require_errors(); var { AsyncResource } = __require("async_hooks"); - var util3 = require_util(); + var util2 = require_util(); var { addSignal, removeSignal } = require_abort_signal(); - var assert4 = __require("assert"); + var assert3 = __require("assert"); var UpgradeHandler = class extends AsyncResource { constructor(opts, callback) { if (!opts || typeof opts !== "object") { @@ -10163,10 +10163,10 @@ var require_api_upgrade = __commonJS({ } onUpgrade(statusCode, rawHeaders, socket) { const { callback, opaque, context } = this; - assert4.strictEqual(statusCode, 101); + assert3.strictEqual(statusCode, 101); removeSignal(this); this.callback = null; - const headers = this.responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders); + const headers = this.responseHeaders === "raw" ? util2.parseRawHeaders(rawHeaders) : util2.parseHeaders(rawHeaders); this.runInAsyncScope(callback, null, null, { headers, socket, @@ -10218,7 +10218,7 @@ var require_api_connect = __commonJS({ "use strict"; var { AsyncResource } = __require("async_hooks"); var { InvalidArgumentError, RequestAbortedError, SocketError } = require_errors(); - var util3 = require_util(); + var util2 = require_util(); var { addSignal, removeSignal } = require_abort_signal(); var ConnectHandler = class extends AsyncResource { constructor(opts, callback) { @@ -10255,7 +10255,7 @@ var require_api_connect = __commonJS({ this.callback = null; let headers = rawHeaders; if (headers != null) { - headers = this.responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders); + headers = this.responseHeaders === "raw" ? util2.parseRawHeaders(rawHeaders) : util2.parseHeaders(rawHeaders); } this.runInAsyncScope(callback, null, null, { statusCode, @@ -10412,10 +10412,10 @@ var require_mock_utils = __commonJS({ } } function buildHeadersFromArray(headers) { - const clone4 = headers.slice(); + const clone3 = headers.slice(); const entries = []; - for (let index = 0; index < clone4.length; index += 2) { - entries.push([clone4[index], clone4[index + 1]]); + for (let index = 0; index < clone3.length; index += 2) { + entries.push([clone3[index], clone3[index + 1]]); } return Object.fromEntries(entries); } @@ -10440,20 +10440,20 @@ var require_mock_utils = __commonJS({ } return true; } - function safeUrl(path4) { - if (typeof path4 !== "string") { - return path4; + function safeUrl(path3) { + if (typeof path3 !== "string") { + return path3; } - const pathSegments = path4.split("?"); + const pathSegments = path3.split("?"); if (pathSegments.length !== 2) { - return path4; + return path3; } const qp = new URLSearchParams(pathSegments.pop()); qp.sort(); return [...pathSegments, qp.toString()].join("?"); } - function matchKey(mockDispatch2, { path: path4, method, body, headers }) { - const pathMatch = matchValue(mockDispatch2.path, path4); + function matchKey(mockDispatch2, { path: path3, method, body, headers }) { + const pathMatch = matchValue(mockDispatch2.path, path3); const methodMatch = matchValue(mockDispatch2.method, method); const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true; const headersMatch = matchHeaders(mockDispatch2, headers); @@ -10471,7 +10471,7 @@ var require_mock_utils = __commonJS({ function getMockDispatch(mockDispatches, key) { const basePath = key.query ? buildURL(key.path, key.query) : key.path; const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath; - let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path4 }) => matchValue(safeUrl(path4), resolvedPath)); + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path3 }) => matchValue(safeUrl(path3), resolvedPath)); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); } @@ -10508,13 +10508,13 @@ var require_mock_utils = __commonJS({ } } function buildKey(opts) { - const { path: path4, method, body, headers, query: query2 } = opts; + const { path: path3, method, body, headers, query } = opts; return { - path: path4, + path: path3, method, body, headers, - query: query2 + query }; } function generateKeyValues(data) { @@ -10541,13 +10541,13 @@ var require_mock_utils = __commonJS({ if (mockDispatch2.data.callback) { mockDispatch2.data = { ...mockDispatch2.data, ...mockDispatch2.data.callback(opts) }; } - const { data: { statusCode, data, headers, trailers, error: error50 }, delay: delay2, persist } = mockDispatch2; + const { data: { statusCode, data, headers, trailers, error: error49 }, delay: delay2, persist } = mockDispatch2; const { timesInvoked, times } = mockDispatch2; mockDispatch2.consumed = !persist && timesInvoked >= times; mockDispatch2.pending = timesInvoked < times; - if (error50 !== null) { + if (error49 !== null) { deleteMockDispatch(this[kDispatches], key); - handler2.onError(error50); + handler2.onError(error49); return true; } if (typeof delay2 === "number" && delay2 > 0) { @@ -10585,19 +10585,19 @@ var require_mock_utils = __commonJS({ if (agent2.isMockActive) { try { mockDispatch.call(this, opts, handler2); - } catch (error50) { - if (error50 instanceof MockNotMatchedError) { + } catch (error49) { + if (error49 instanceof MockNotMatchedError) { const netConnect = agent2[kGetNetConnect](); if (netConnect === false) { - throw new MockNotMatchedError(`${error50.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); + throw new MockNotMatchedError(`${error49.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); } if (checkNetConnect(netConnect, origin)) { originalDispatch.call(this, opts, handler2); } else { - throw new MockNotMatchedError(`${error50.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); + throw new MockNotMatchedError(`${error49.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); } } else { - throw error50; + throw error49; } } } else { @@ -10760,11 +10760,11 @@ var require_mock_interceptor = __commonJS({ /** * Mock an undici request with a defined error. */ - replyWithError(error50) { - if (typeof error50 === "undefined") { + replyWithError(error49) { + if (typeof error49 === "undefined") { throw new InvalidArgumentError("error must be defined"); } - const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error50 }); + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error49 }); return new MockScope(newMockDispatch); } /** @@ -10959,10 +10959,10 @@ var require_pending_interceptors_formatter = __commonJS({ } format(pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( - ({ method, path: path4, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + ({ method, path: path3, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, - Path: path4, + Path: path3, "Status code": statusCode, Persistent: persist ? "\u2705" : "\u274C", Invocations: timesInvoked, @@ -11270,7 +11270,7 @@ var require_proxy_agent = __commonJS({ // node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/handler/RetryHandler.js var require_RetryHandler = __commonJS({ "node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/handler/RetryHandler.js"(exports, module) { - var assert4 = __require("assert"); + var assert3 = __require("assert"); var { kRetryHandlerDefaultRetry } = require_symbols(); var { RequestRetryError } = require_errors(); var { isDisturbed, parseHeaders, parseRangeHeader } = require_util(); @@ -11435,8 +11435,8 @@ var require_RetryHandler = __commonJS({ return false; } const { start, size, end = size } = contentRange; - assert4(this.start === start, "content-range mismatch"); - assert4(this.end == null || this.end === end, "content-range mismatch"); + assert3(this.start === start, "content-range mismatch"); + assert3(this.end == null || this.end === end, "content-range mismatch"); this.resume = resume; return true; } @@ -11452,12 +11452,12 @@ var require_RetryHandler = __commonJS({ ); } const { start, size, end = size } = range2; - assert4( + assert3( start != null && Number.isFinite(start) && this.start !== start, "content-range mismatch" ); - assert4(Number.isFinite(start)); - assert4( + assert3(Number.isFinite(start)); + assert3( end != null && Number.isFinite(end) && this.end !== end, "invalid content-length" ); @@ -11468,8 +11468,8 @@ var require_RetryHandler = __commonJS({ const contentLength = headers["content-length"]; this.end = contentLength != null ? Number(contentLength) : null; } - assert4(Number.isFinite(this.start)); - assert4( + assert3(Number.isFinite(this.start)); + assert3( this.end == null || Number.isFinite(this.end), "invalid content-length" ); @@ -11610,9 +11610,9 @@ var require_headers = __commonJS({ isValidHeaderName, isValidHeaderValue } = require_util2(); - var util3 = __require("util"); + var util2 = __require("util"); var { webidl } = require_webidl(); - var assert4 = __require("assert"); + var assert3 = __require("assert"); var kHeadersMap = Symbol("headers map"); var kHeadersSortedMap = Symbol("headers map sorted"); function isHTTPWhiteSpaceCharCode(code) { @@ -11870,7 +11870,7 @@ var require_headers = __commonJS({ headers.push([name, cookies[j]]); } } else { - assert4(value2 !== null); + assert3(value2 !== null); headers.push([name, value2]); } } @@ -11963,7 +11963,7 @@ var require_headers = __commonJS({ value: "Headers", configurable: true }, - [util3.inspect.custom]: { + [util2.inspect.custom]: { enumerable: false } }); @@ -11994,12 +11994,12 @@ var require_response = __commonJS({ "use strict"; var { Headers: Headers2, HeadersList, fill } = require_headers(); var { extractBody, cloneBody, mixinBody } = require_body(); - var util3 = require_util(); - var { kEnumerableProperty } = util3; + var util2 = require_util(); + var { kEnumerableProperty } = util2; var { isValidReasonPhrase, isCancelled, - isAborted: isAborted3, + isAborted: isAborted2, isBlobLike, serializeJavascriptValueToJSONString, isErrorLike, @@ -12016,7 +12016,7 @@ var require_response = __commonJS({ var { getGlobalOrigin } = require_global(); var { URLSerializer } = require_dataURL(); var { kHeadersList, kConstruct } = require_symbols(); - var assert4 = __require("assert"); + var assert3 = __require("assert"); var { types } = __require("util"); var ReadableStream2 = globalThis.ReadableStream || __require("stream/web").ReadableStream; var textEncoder = new TextEncoder("utf-8"); @@ -12141,7 +12141,7 @@ var require_response = __commonJS({ } get bodyUsed() { webidl.brandCheck(this, _Response); - return !!this[kState].body && util3.isDisturbed(this[kState].body.stream); + return !!this[kState].body && util2.isDisturbed(this[kState].body.stream); } // Returns a clone of response. clone() { @@ -12232,7 +12232,7 @@ var require_response = __commonJS({ return p in state ? state[p] : target[p]; }, set(target, p, value2) { - assert4(!(p in state)); + assert3(!(p in state)); target[p] = value2; return true; } @@ -12266,12 +12266,12 @@ var require_response = __commonJS({ body: null }); } else { - assert4(false); + assert3(false); } } function makeAppropriateNetworkError(fetchParams, err = null) { - assert4(isCancelled(fetchParams)); - return isAborted3(fetchParams) ? makeNetworkError(Object.assign(new DOMException2("The operation was aborted.", "AbortError"), { cause: err })) : makeNetworkError(Object.assign(new DOMException2("Request was cancelled."), { cause: err })); + assert3(isCancelled(fetchParams)); + return isAborted2(fetchParams) ? makeNetworkError(Object.assign(new DOMException2("The operation was aborted.", "AbortError"), { cause: err })) : makeNetworkError(Object.assign(new DOMException2("Request was cancelled."), { cause: err })); } function initializeResponse(response, init, body) { if (init.status !== null && (init.status < 200 || init.status > 599)) { @@ -12323,7 +12323,7 @@ var require_response = __commonJS({ if (types.isArrayBuffer(V) || types.isTypedArray(V) || types.isDataView(V)) { return webidl.converters.BufferSource(V); } - if (util3.isFormDataLike(V)) { + if (util2.isFormDataLike(V)) { return webidl.converters.FormData(V, { strict: false }); } if (V instanceof URLSearchParams) { @@ -12374,7 +12374,7 @@ var require_request2 = __commonJS({ var { extractBody, mixinBody, cloneBody } = require_body(); var { Headers: Headers2, fill: fillHeaders, HeadersList } = require_headers(); var { FinalizationRegistry: FinalizationRegistry2 } = require_dispatcher_weakref()(); - var util3 = require_util(); + var util2 = require_util(); var { isValidHTTPToken, sameOrigin, @@ -12392,14 +12392,14 @@ var require_request2 = __commonJS({ requestCache, requestDuplex } = require_constants2(); - var { kEnumerableProperty } = util3; + var { kEnumerableProperty } = util2; var { kHeaders, kSignal, kState, kGuard, kRealm } = require_symbols2(); var { webidl } = require_webidl(); var { getGlobalOrigin } = require_global(); var { URLSerializer } = require_dataURL(); var { kHeadersList, kConstruct } = require_symbols(); - var assert4 = __require("assert"); - var { getMaxListeners, setMaxListeners: setMaxListeners2, getEventListeners, defaultMaxListeners } = __require("events"); + var assert3 = __require("assert"); + var { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __require("events"); var TransformStream2 = globalThis.TransformStream; var kAbortController = Symbol("abortController"); var requestFinalizer = new FinalizationRegistry2(({ signal, abort }) => { @@ -12442,7 +12442,7 @@ var require_request2 = __commonJS({ request2 = makeRequest({ urlList: [parsedURL] }); fallbackMode = "cors"; } else { - assert4(input instanceof _Request); + assert3(input instanceof _Request); request2 = input[kState]; signal = input[kSignal]; } @@ -12606,13 +12606,13 @@ var require_request2 = __commonJS({ }; try { if (typeof getMaxListeners === "function" && getMaxListeners(signal) === defaultMaxListeners) { - setMaxListeners2(100, signal); + setMaxListeners(100, signal); } else if (getEventListeners(signal, "abort").length >= defaultMaxListeners) { - setMaxListeners2(100, signal); + setMaxListeners(100, signal); } } catch { } - util3.addAbortListener(signal, abort); + util2.addAbortListener(signal, abort); requestFinalizer.register(ac, { signal, abort }); } } @@ -12670,7 +12670,7 @@ var require_request2 = __commonJS({ } let finalBody = inputOrInitBody; if (initBody == null && inputBody != null) { - if (util3.isDisturbed(inputBody.stream) || inputBody.stream.locked) { + if (util2.isDisturbed(inputBody.stream) || inputBody.stream.locked) { throw new TypeError( "Cannot construct a Request with a Request object that has already been used." ); @@ -12799,7 +12799,7 @@ var require_request2 = __commonJS({ } get bodyUsed() { webidl.brandCheck(this, _Request); - return !!this[kState].body && util3.isDisturbed(this[kState].body.stream); + return !!this[kState].body && util2.isDisturbed(this[kState].body.stream); } get duplex() { webidl.brandCheck(this, _Request); @@ -12823,7 +12823,7 @@ var require_request2 = __commonJS({ if (this.signal.aborted) { ac.abort(this.signal.reason); } else { - util3.addAbortListener( + util2.addAbortListener( this.signal, () => { ac.abort(this.signal.reason); @@ -13041,7 +13041,7 @@ var require_fetch = __commonJS({ isBlobLike, sameOrigin, isCancelled, - isAborted: isAborted3, + isAborted: isAborted2, isErrorLike, fullyReadBody, readableStreamClose, @@ -13051,7 +13051,7 @@ var require_fetch = __commonJS({ urlHasHttpsScheme } = require_util2(); var { kState, kHeaders, kGuard, kRealm } = require_symbols2(); - var assert4 = __require("assert"); + var assert3 = __require("assert"); var { safelyExtractBody } = require_body(); var { redirectStatusSet, @@ -13091,17 +13091,17 @@ var require_fetch = __commonJS({ this.emit("terminated", reason); } // https://fetch.spec.whatwg.org/#fetch-controller-abort - abort(error50) { + abort(error49) { if (this.state !== "ongoing") { return; } this.state = "aborted"; - if (!error50) { - error50 = new DOMException2("The operation was aborted.", "AbortError"); + if (!error49) { + error49 = new DOMException2("The operation was aborted.", "AbortError"); } - this.serializedAbortReason = error50; - this.connection?.destroy(error50); - this.emit("terminated", error50); + this.serializedAbortReason = error49; + this.connection?.destroy(error49); + this.emit("terminated", error49); } }; function fetch3(input, init = {}) { @@ -13131,7 +13131,7 @@ var require_fetch = __commonJS({ requestObject.signal, () => { locallyAborted = true; - assert4(controller != null); + assert3(controller != null); controller.abort(requestObject.signal.reason); abortFetch(p, request2, responseObject, requestObject.signal.reason); } @@ -13205,13 +13205,13 @@ var require_fetch = __commonJS({ performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis2, cacheState); } } - function abortFetch(p, request2, responseObject, error50) { - if (!error50) { - error50 = new DOMException2("The operation was aborted.", "AbortError"); + function abortFetch(p, request2, responseObject, error49) { + if (!error49) { + error49 = new DOMException2("The operation was aborted.", "AbortError"); } - p.reject(error50); + p.reject(error49); if (request2.body != null && isReadable(request2.body?.stream)) { - request2.body.stream.cancel(error50).catch((err) => { + request2.body.stream.cancel(error49).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -13223,7 +13223,7 @@ var require_fetch = __commonJS({ } const response = responseObject[kState]; if (response.body != null && isReadable(response.body?.stream)) { - response.body.stream.cancel(error50).catch((err) => { + response.body.stream.cancel(error49).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -13264,7 +13264,7 @@ var require_fetch = __commonJS({ taskDestination, crossOriginIsolatedCapability }; - assert4(!request2.body || request2.body.stream); + assert3(!request2.body || request2.body.stream); if (request2.window === "client") { request2.window = request2.client?.globalObject?.constructor?.name === "Window" ? request2.client : "no-window"; } @@ -13357,7 +13357,7 @@ var require_fetch = __commonJS({ } else if (request2.responseTainting === "opaque") { response = filterResponse(response, "opaque"); } else { - assert4(false); + assert3(false); } } let internalResponse = response.status === 0 ? response : response.internalResponse; @@ -13549,7 +13549,7 @@ var require_fetch = __commonJS({ } else if (request2.redirect === "follow") { response = await httpRedirectFetch(fetchParams, response); } else { - assert4(false); + assert3(false); } } response.timingInfo = timingInfo; @@ -13602,7 +13602,7 @@ var require_fetch = __commonJS({ request2.headersList.delete("host"); } if (request2.body != null) { - assert4(request2.body.source != null); + assert3(request2.body.source != null); request2.body = safelyExtractBody(request2.body.source)[0]; } const timingInfo = fetchParams.timingInfo; @@ -13735,7 +13735,7 @@ var require_fetch = __commonJS({ return response; } async function httpNetworkFetch(fetchParams, includeCredentials = false, forceNewConnection = false) { - assert4(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed); + assert3(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed); fetchParams.controller.connection = { abort: null, destroyed: false, @@ -13849,7 +13849,7 @@ var require_fetch = __commonJS({ let isFailure; try { const { done, value: value2 } = await fetchParams.controller.next(); - if (isAborted3(fetchParams)) { + if (isAborted2(fetchParams)) { break; } bytes = done ? void 0 : value2; @@ -13882,7 +13882,7 @@ var require_fetch = __commonJS({ } }; function onAborted(reason) { - if (isAborted3(fetchParams)) { + if (isAborted2(fetchParams)) { response.aborted = true; if (isReadable(stream)) { fetchParams.controller.controller.error( @@ -14003,13 +14003,13 @@ var require_fetch = __commonJS({ fetchParams.controller.ended = true; this.body.push(null); }, - onError(error50) { + onError(error49) { if (this.abort) { fetchParams.controller.off("terminated", this.abort); } - this.body?.destroy(error50); - fetchParams.controller.terminate(error50); - reject(error50); + this.body?.destroy(error49); + fetchParams.controller.terminate(error49); + reject(error49); }, onUpgrade(status, headersList, socket) { if (status !== 101) { @@ -14475,8 +14475,8 @@ var require_util4 = __commonJS({ } fr[kResult] = result; fireAProgressEvent("load", fr); - } catch (error50) { - fr[kError] = error50; + } catch (error49) { + fr[kError] = error49; fireAProgressEvent("error", fr); } if (fr[kState] !== "loading") { @@ -14485,13 +14485,13 @@ var require_util4 = __commonJS({ }); break; } - } catch (error50) { + } catch (error49) { if (fr[kAborted]) { return; } queueMicrotask(() => { fr[kState] = "done"; - fr[kError] = error50; + fr[kError] = error49; fireAProgressEvent("error", fr); if (fr[kState] !== "loading") { fireAProgressEvent("loadend", fr); @@ -14870,7 +14870,7 @@ var require_symbols4 = __commonJS({ var require_util5 = __commonJS({ "node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/cache/util.js"(exports, module) { "use strict"; - var assert4 = __require("assert"); + var assert3 = __require("assert"); var { URLSerializer } = require_dataURL(); var { isValidHeaderName } = require_util2(); function urlEquals(A, B, excludeFragment = false) { @@ -14879,7 +14879,7 @@ var require_util5 = __commonJS({ return serializedA === serializedB; } function fieldValues(header) { - assert4(header !== null); + assert3(header !== null); const values = []; for (let value2 of header.split(",")) { value2 = value2.trim(); @@ -14913,7 +14913,7 @@ var require_cache = __commonJS({ var { kState, kHeaders, kGuard, kRealm } = require_symbols2(); var { fetching } = require_fetch(); var { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = require_util2(); - var assert4 = __require("assert"); + var assert3 = __require("assert"); var { getGlobalDispatcher } = require_global2(); var Cache = class _Cache { /** @@ -15174,7 +15174,7 @@ var require_cache = __commonJS({ return false; } } else { - assert4(typeof request2 === "string"); + assert3(typeof request2 === "string"); r = new Request2(request2)[kState]; } const operations = []; @@ -15283,7 +15283,7 @@ var require_cache = __commonJS({ } for (const requestResponse of requestResponses) { const idx = cache.indexOf(requestResponse); - assert4(idx !== -1); + assert3(idx !== -1); cache.splice(idx, 1); } } else if (operation.type === "put") { @@ -15315,7 +15315,7 @@ var require_cache = __commonJS({ requestResponses = this.#queryCache(operation.request); for (const requestResponse of requestResponses) { const idx = cache.indexOf(requestResponse); - assert4(idx !== -1); + assert3(idx !== -1); cache.splice(idx, 1); } cache.push([operation.request, operation.response]); @@ -15582,8 +15582,8 @@ var require_util6 = __commonJS({ } } } - function validateCookiePath(path4) { - for (const char of path4) { + function validateCookiePath(path3) { + for (const char of path3) { const code = char.charCodeAt(0); if (code < 33 || char === ";") { throw new Error("Invalid cookie path"); @@ -15595,9 +15595,9 @@ var require_util6 = __commonJS({ throw new Error("Invalid cookie domain"); } } - function toIMFDate(date6) { - if (typeof date6 === "number") { - date6 = new Date(date6); + function toIMFDate(date5) { + if (typeof date5 === "number") { + date5 = new Date(date5); } const days = [ "Sun", @@ -15622,13 +15622,13 @@ var require_util6 = __commonJS({ "Nov", "Dec" ]; - const dayName = days[date6.getUTCDay()]; - const day = date6.getUTCDate().toString().padStart(2, "0"); - const month = months2[date6.getUTCMonth()]; - const year = date6.getUTCFullYear(); - const hour = date6.getUTCHours().toString().padStart(2, "0"); - const minute = date6.getUTCMinutes().toString().padStart(2, "0"); - const second = date6.getUTCSeconds().toString().padStart(2, "0"); + const dayName = days[date5.getUTCDay()]; + const day = date5.getUTCDate().toString().padStart(2, "0"); + const month = months2[date5.getUTCMonth()]; + const year = date5.getUTCFullYear(); + const hour = date5.getUTCHours().toString().padStart(2, "0"); + const minute = date5.getUTCMinutes().toString().padStart(2, "0"); + const second = date5.getUTCSeconds().toString().padStart(2, "0"); return `${dayName}, ${day} ${month} ${year} ${hour}:${minute}:${second} GMT`; } function validateCookieMaxAge(maxAge) { @@ -15702,7 +15702,7 @@ var require_parse = __commonJS({ var { maxNameValuePairSize, maxAttributeValueSize } = require_constants4(); var { isCTLExcludingHtab } = require_util6(); var { collectASequenceOfCodePointsFast } = require_dataURL(); - var assert4 = __require("assert"); + var assert3 = __require("assert"); function parseSetCookie(header) { if (isCTLExcludingHtab(header)) { return null; @@ -15744,7 +15744,7 @@ var require_parse = __commonJS({ if (unparsedAttributes.length === 0) { return cookieAttributeList; } - assert4(unparsedAttributes[0] === ";"); + assert3(unparsedAttributes[0] === ";"); unparsedAttributes = unparsedAttributes.slice(1); let cookieAv = ""; if (unparsedAttributes.includes(";")) { @@ -16491,11 +16491,11 @@ var require_connection = __commonJS({ }); } } - function onSocketError(error50) { + function onSocketError(error49) { const { ws } = this; ws[kReadyState] = states.CLOSING; if (channels.socketError.hasSubscribers) { - channels.socketError.publish(error50); + channels.socketError.publish(error49); } this.destroy(); } @@ -17213,7 +17213,7 @@ var require_undici = __commonJS({ var Pool = require_pool(); var BalancedPool = require_balanced_pool(); var Agent = require_agent(); - var util3 = require_util(); + var util2 = require_util(); var { InvalidArgumentError } = errors; var api = require_api(); var buildConnector = require_connect(); @@ -17263,16 +17263,16 @@ var require_undici = __commonJS({ if (typeof opts.path !== "string") { throw new InvalidArgumentError("invalid opts.path"); } - let path4 = opts.path; + let path3 = opts.path; if (!opts.path.startsWith("/")) { - path4 = `/${path4}`; + path3 = `/${path3}`; } - url4 = new URL(util3.parseOrigin(url4).origin + path4); + url4 = new URL(util2.parseOrigin(url4).origin + path3); } else { if (!opts) { opts = typeof url4 === "object" ? url4 : {}; } - url4 = util3.parseURL(url4); + url4 = util2.parseURL(url4); } const { agent: agent2, dispatcher = getGlobalDispatcher() } = opts; if (agent2) { @@ -17288,7 +17288,7 @@ var require_undici = __commonJS({ } module.exports.setGlobalDispatcher = setGlobalDispatcher; module.exports.getGlobalDispatcher = getGlobalDispatcher; - if (util3.nodeMajor > 16 || util3.nodeMajor === 16 && util3.nodeMinor >= 8) { + if (util2.nodeMajor > 16 || util2.nodeMajor === 16 && util2.nodeMinor >= 8) { let fetchImpl = null; module.exports.fetch = async function fetch3(resource) { if (!fetchImpl) { @@ -17316,7 +17316,7 @@ var require_undici = __commonJS({ const { kConstruct } = require_symbols4(); module.exports.caches = new CacheStorage(kConstruct); } - if (util3.nodeMajor >= 16) { + if (util2.nodeMajor >= 16) { const { deleteCookie, getCookies, getSetCookies, setCookie } = require_cookies(); module.exports.deleteCookie = deleteCookie; module.exports.getCookies = getCookies; @@ -17326,7 +17326,7 @@ var require_undici = __commonJS({ module.exports.parseMIMEType = parseMIMEType; module.exports.serializeAMimeType = serializeAMimeType; } - if (util3.nodeMajor >= 18 && hasCrypto) { + if (util2.nodeMajor >= 18 && hasCrypto) { const { WebSocket } = require_websocket(); module.exports.WebSocket = WebSocket; } @@ -17737,7 +17737,7 @@ var require_lib = __commonJS({ info2.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); } let callbackCalled = false; - function handleResult3(err, res) { + function handleResult2(err, res) { if (!callbackCalled) { callbackCalled = true; onResult(err, res); @@ -17745,7 +17745,7 @@ var require_lib = __commonJS({ } const req = info2.httpModule.request(info2.options, (msg) => { const res = new HttpClientResponse(msg); - handleResult3(void 0, res); + handleResult2(void 0, res); }); let socket; req.on("socket", (sock) => { @@ -17755,10 +17755,10 @@ var require_lib = __commonJS({ if (socket) { socket.end(); } - handleResult3(new Error(`Request timeout: ${info2.options.path}`)); + handleResult2(new Error(`Request timeout: ${info2.options.path}`)); }); req.on("error", function(err) { - handleResult3(err); + handleResult2(err); }); if (data && typeof data === "string") { req.write(data, "utf8"); @@ -17819,12 +17819,12 @@ var require_lib = __commonJS({ } return lowercaseKeys2(headers || {}); } - _getExistingOrDefaultHeader(additionalHeaders, header, _default5) { + _getExistingOrDefaultHeader(additionalHeaders, header, _default4) { let clientHeader; if (this.requestOptions && this.requestOptions.headers) { clientHeader = lowercaseKeys2(this.requestOptions.headers)[header]; } - return additionalHeaders[header] || clientHeader || _default5; + return additionalHeaders[header] || clientHeader || _default4; } _getAgent(parsedUrl) { let agent2; @@ -18127,12 +18127,12 @@ var require_oidc_utils = __commonJS({ var _a2; return __awaiter(this, void 0, void 0, function* () { const httpclient = _OidcClient.createHttpClient(); - const res = yield httpclient.getJson(id_token_url).catch((error50) => { + const res = yield httpclient.getJson(id_token_url).catch((error49) => { throw new Error(`Failed to get ID Token. - Error Code : ${error50.statusCode} + Error Code : ${error49.statusCode} - Error Message: ${error50.message}`); + Error Message: ${error49.message}`); }); const id_token = (_a2 = res.result) === null || _a2 === void 0 ? void 0 : _a2.value; if (!id_token) { @@ -18153,8 +18153,8 @@ var require_oidc_utils = __commonJS({ const id_token = yield _OidcClient.getCall(id_token_url); (0, core_1.setSecret)(id_token); return id_token; - } catch (error50) { - throw new Error(`Error message: ${error50.message}`); + } catch (error49) { + throw new Error(`Error message: ${error49.message}`); } }); } @@ -18490,7 +18490,7 @@ var require_path_utils = __commonJS({ }; Object.defineProperty(exports, "__esModule", { value: true }); exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0; - var path4 = __importStar(__require("path")); + var path3 = __importStar(__require("path")); function toPosixPath(pth) { return pth.replace(/[\\]/g, "/"); } @@ -18500,7 +18500,7 @@ var require_path_utils = __commonJS({ } exports.toWin32Path = toWin32Path; function toPlatformPath(pth) { - return pth.replace(/[/\\]/g, path4.sep); + return pth.replace(/[/\\]/g, path3.sep); } exports.toPlatformPath = toPlatformPath; } @@ -18563,12 +18563,12 @@ var require_io_util = __commonJS({ var _a2; Object.defineProperty(exports, "__esModule", { value: true }); exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.READONLY = exports.UV_FS_O_EXLOCK = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rm = exports.rename = exports.readlink = exports.readdir = exports.open = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0; - var fs5 = __importStar(__require("fs")); - var path4 = __importStar(__require("path")); - _a2 = fs5.promises, exports.chmod = _a2.chmod, exports.copyFile = _a2.copyFile, exports.lstat = _a2.lstat, exports.mkdir = _a2.mkdir, exports.open = _a2.open, exports.readdir = _a2.readdir, exports.readlink = _a2.readlink, exports.rename = _a2.rename, exports.rm = _a2.rm, exports.rmdir = _a2.rmdir, exports.stat = _a2.stat, exports.symlink = _a2.symlink, exports.unlink = _a2.unlink; + var fs3 = __importStar(__require("fs")); + var path3 = __importStar(__require("path")); + _a2 = fs3.promises, exports.chmod = _a2.chmod, exports.copyFile = _a2.copyFile, exports.lstat = _a2.lstat, exports.mkdir = _a2.mkdir, exports.open = _a2.open, exports.readdir = _a2.readdir, exports.readlink = _a2.readlink, exports.rename = _a2.rename, exports.rm = _a2.rm, exports.rmdir = _a2.rmdir, exports.stat = _a2.stat, exports.symlink = _a2.symlink, exports.unlink = _a2.unlink; exports.IS_WINDOWS = process.platform === "win32"; exports.UV_FS_O_EXLOCK = 268435456; - exports.READONLY = fs5.constants.O_RDONLY; + exports.READONLY = fs3.constants.O_RDONLY; function exists(fsPath) { return __awaiter(this, void 0, void 0, function* () { try { @@ -18613,7 +18613,7 @@ var require_io_util = __commonJS({ } if (stats && stats.isFile()) { if (exports.IS_WINDOWS) { - const upperExt = path4.extname(filePath).toUpperCase(); + const upperExt = path3.extname(filePath).toUpperCase(); if (extensions2.some((validExt) => validExt.toUpperCase() === upperExt)) { return filePath; } @@ -18637,11 +18637,11 @@ var require_io_util = __commonJS({ if (stats && stats.isFile()) { if (exports.IS_WINDOWS) { try { - const directory = path4.dirname(filePath); - const upperName = path4.basename(filePath).toUpperCase(); + const directory = path3.dirname(filePath); + const upperName = path3.basename(filePath).toUpperCase(); for (const actualName of yield exports.readdir(directory)) { if (upperName === actualName.toUpperCase()) { - filePath = path4.join(directory, actualName); + filePath = path3.join(directory, actualName); break; } } @@ -18736,7 +18736,7 @@ var require_io = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0; var assert_1 = __require("assert"); - var path4 = __importStar(__require("path")); + var path3 = __importStar(__require("path")); var ioUtil = __importStar(require_io_util()); function cp(source, dest, options = {}) { return __awaiter(this, void 0, void 0, function* () { @@ -18745,7 +18745,7 @@ var require_io = __commonJS({ if (destStat && destStat.isFile() && !force) { return; } - const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path4.join(dest, path4.basename(source)) : dest; + const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path3.join(dest, path3.basename(source)) : dest; if (!(yield ioUtil.exists(source))) { throw new Error(`no such file or directory: ${source}`); } @@ -18757,7 +18757,7 @@ var require_io = __commonJS({ yield cpDirRecursive(source, newDest, 0, force); } } else { - if (path4.relative(source, newDest) === "") { + if (path3.relative(source, newDest) === "") { throw new Error(`'${newDest}' and '${source}' are the same file`); } yield copyFile(source, newDest, force); @@ -18770,7 +18770,7 @@ var require_io = __commonJS({ if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { - dest = path4.join(dest, path4.basename(source)); + dest = path3.join(dest, path3.basename(source)); destExists = yield ioUtil.exists(dest); } if (destExists) { @@ -18781,7 +18781,7 @@ var require_io = __commonJS({ } } } - yield mkdirP(path4.dirname(dest)); + yield mkdirP(path3.dirname(dest)); yield ioUtil.rename(source, dest); }); } @@ -18813,12 +18813,12 @@ var require_io = __commonJS({ }); } exports.mkdirP = mkdirP; - function which(tool2, check4) { + function which(tool2, check3) { return __awaiter(this, void 0, void 0, function* () { if (!tool2) { throw new Error("parameter 'tool' is required"); } - if (check4) { + if (check3) { const result = yield which(tool2, false); if (!result) { if (ioUtil.IS_WINDOWS) { @@ -18844,7 +18844,7 @@ var require_io = __commonJS({ } const extensions2 = []; if (ioUtil.IS_WINDOWS && process.env["PATHEXT"]) { - for (const extension of process.env["PATHEXT"].split(path4.delimiter)) { + for (const extension of process.env["PATHEXT"].split(path3.delimiter)) { if (extension) { extensions2.push(extension); } @@ -18857,12 +18857,12 @@ var require_io = __commonJS({ } return []; } - if (tool2.includes(path4.sep)) { + if (tool2.includes(path3.sep)) { return []; } const directories = []; if (process.env.PATH) { - for (const p of process.env.PATH.split(path4.delimiter)) { + for (const p of process.env.PATH.split(path3.delimiter)) { if (p) { directories.push(p); } @@ -18870,7 +18870,7 @@ var require_io = __commonJS({ } const matches = []; for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path4.join(directory, tool2), extensions2); + const filePath = yield ioUtil.tryGetExecutablePath(path3.join(directory, tool2), extensions2); if (filePath) { matches.push(filePath); } @@ -18983,10 +18983,10 @@ var require_toolrunner = __commonJS({ }; Object.defineProperty(exports, "__esModule", { value: true }); exports.argStringToArray = exports.ToolRunner = void 0; - var os2 = __importStar(__require("os")); + var os = __importStar(__require("os")); var events = __importStar(__require("events")); var child = __importStar(__require("child_process")); - var path4 = __importStar(__require("path")); + var path3 = __importStar(__require("path")); var io = __importStar(require_io()); var ioUtil = __importStar(require_io_util()); var timers_1 = __require("timers"); @@ -19038,12 +19038,12 @@ var require_toolrunner = __commonJS({ _processLineBuffer(data, strBuffer, onLine) { try { let s = strBuffer + data.toString(); - let n = s.indexOf(os2.EOL); + let n = s.indexOf(os.EOL); while (n > -1) { const line = s.substring(0, n); onLine(line); - s = s.substring(n + os2.EOL.length); - n = s.indexOf(os2.EOL); + s = s.substring(n + os.EOL.length); + n = s.indexOf(os.EOL); } return s; } catch (err) { @@ -19201,7 +19201,7 @@ var require_toolrunner = __commonJS({ exec() { return __awaiter(this, void 0, void 0, function* () { if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { - this.toolPath = path4.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + this.toolPath = path3.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } this.toolPath = yield io.which(this.toolPath, true); return new Promise((resolve2, reject) => __awaiter(this, void 0, void 0, function* () { @@ -19212,7 +19212,7 @@ var require_toolrunner = __commonJS({ } const optionsNonNull = this._cloneExecOptions(this.options); if (!optionsNonNull.silent && optionsNonNull.outStream) { - optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os2.EOL); + optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL); } const state = new ExecState(optionsNonNull, this.toolPath); state.on("debug", (message) => { @@ -19276,7 +19276,7 @@ var require_toolrunner = __commonJS({ this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); state.CheckComplete(); }); - state.on("done", (error50, exitCode) => { + state.on("done", (error49, exitCode) => { if (stdbuffer.length > 0) { this.emit("stdline", stdbuffer); } @@ -19284,8 +19284,8 @@ var require_toolrunner = __commonJS({ this.emit("errline", errbuffer); } cp.removeAllListeners(); - if (error50) { - reject(error50); + if (error49) { + reject(error49); } else { resolve2(exitCode); } @@ -19380,14 +19380,14 @@ var require_toolrunner = __commonJS({ this.emit("debug", message); } _setResult() { - let error50; + let error49; if (this.processExited) { if (this.processError) { - error50 = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`); + error49 = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`); } else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) { - error50 = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); + error49 = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); } else if (this.processStderr && this.options.failOnStdErr) { - error50 = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); + error49 = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); } } if (this.timeout) { @@ -19395,7 +19395,7 @@ var require_toolrunner = __commonJS({ this.timeout = null; } this.done = true; - this.emit("done", error50, this.processExitCode); + this.emit("done", error49, this.processExitCode); } static HandleTimeout(state) { if (state.done) { @@ -19584,7 +19584,7 @@ var require_platform = __commonJS({ var os_1 = __importDefault(__require("os")); var exec = __importStar(require_exec()); var getWindowsInfo = () => __awaiter(void 0, void 0, void 0, function* () { - const { stdout: version4 } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + const { stdout: version3 } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { silent: true }); const { stdout: name } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { @@ -19592,7 +19592,7 @@ var require_platform = __commonJS({ }); return { name: name.trim(), - version: version4.trim() + version: version3.trim() }; }); var getMacOsInfo = () => __awaiter(void 0, void 0, void 0, function* () { @@ -19600,21 +19600,21 @@ var require_platform = __commonJS({ const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { silent: true }); - const version4 = (_b = (_a2 = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a2 === void 0 ? void 0 : _a2[1]) !== null && _b !== void 0 ? _b : ""; + const version3 = (_b = (_a2 = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a2 === void 0 ? void 0 : _a2[1]) !== null && _b !== void 0 ? _b : ""; const name = (_d = (_c = stdout.match(/ProductName:\s*(.+)/)) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : ""; return { name, - version: version4 + version: version3 }; }); var getLinuxInfo = () => __awaiter(void 0, void 0, void 0, function* () { const { stdout } = yield exec.getExecOutput("lsb_release", ["-i", "-r", "-s"], { silent: true }); - const [name, version4] = stdout.trim().split("\n"); + const [name, version3] = stdout.trim().split("\n"); return { name, - version: version4 + version: version3 }; }); exports.platform = os_1.default.platform(); @@ -19700,8 +19700,8 @@ var require_core = __commonJS({ var command_1 = require_command(); var file_command_1 = require_file_command(); var utils_1 = require_utils(); - var os2 = __importStar(__require("os")); - var path4 = __importStar(__require("path")); + var os = __importStar(__require("os")); + var path3 = __importStar(__require("path")); var oidc_utils_1 = require_oidc_utils(); var ExitCode; (function(ExitCode2) { @@ -19729,7 +19729,7 @@ var require_core = __commonJS({ } else { (0, command_1.issueCommand)("add-path", {}, inputPath); } - process.env["PATH"] = `${inputPath}${path4.delimiter}${process.env["PATH"]}`; + process.env["PATH"] = `${inputPath}${path3.delimiter}${process.env["PATH"]}`; } exports.addPath = addPath; function getInput3(name, options) { @@ -19768,7 +19768,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); if (filePath) { return (0, file_command_1.issueFileCommand)("OUTPUT", (0, file_command_1.prepareKeyValueMessage)(name, value2)); } - process.stdout.write(os2.EOL); + process.stdout.write(os.EOL); (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value2)); } exports.setOutput = setOutput2; @@ -19778,7 +19778,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); exports.setCommandEcho = setCommandEcho; function setFailed2(message) { process.exitCode = ExitCode.Failure; - error50(message); + error49(message); } exports.setFailed = setFailed2; function isDebug2() { @@ -19789,10 +19789,10 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); (0, command_1.issueCommand)("debug", {}, message); } exports.debug = debug2; - function error50(message, properties = {}) { + function error49(message, properties = {}) { (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports.error = error50; + exports.error = error49; function warning2(message, properties = {}) { (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } @@ -19802,7 +19802,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); } exports.notice = notice; function info2(message) { - process.stdout.write(message + os2.EOL); + process.stdout.write(message + os.EOL); } exports.info = info2; function startGroup3(name) { @@ -19870,37 +19870,37 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); var util, objectUtil, ZodParsedType, getParsedType; var init_util = __esm({ "node_modules/.pnpm/zod@4.3.5/node_modules/zod/v3/helpers/util.js"() { - (function(util3) { - util3.assertEqual = (_) => { + (function(util2) { + util2.assertEqual = (_) => { }; - function assertIs3(_arg) { + function assertIs2(_arg) { } - util3.assertIs = assertIs3; - function assertNever3(_x) { + util2.assertIs = assertIs2; + function assertNever2(_x) { throw new Error(); } - util3.assertNever = assertNever3; - util3.arrayToEnum = (items) => { + util2.assertNever = assertNever2; + util2.arrayToEnum = (items) => { const obj = {}; for (const item of items) { obj[item] = item; } return obj; }; - util3.getValidEnumValues = (obj) => { - const validKeys = util3.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number"); + util2.getValidEnumValues = (obj) => { + const validKeys = util2.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number"); const filtered = {}; for (const k of validKeys) { filtered[k] = obj[k]; } - return util3.objectValues(filtered); + return util2.objectValues(filtered); }; - util3.objectValues = (obj) => { - return util3.objectKeys(obj).map(function(e) { + util2.objectValues = (obj) => { + return util2.objectKeys(obj).map(function(e) { return obj[e]; }); }; - util3.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object5) => { + util2.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object5) => { const keys = []; for (const key in object5) { if (Object.prototype.hasOwnProperty.call(object5, key)) { @@ -19909,27 +19909,27 @@ var init_util = __esm({ } return keys; }; - util3.find = (arr, checker) => { + util2.find = (arr, checker) => { for (const item of arr) { if (checker(item)) return item; } return void 0; }; - util3.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val; - function joinValues3(array4, separator2 = " | ") { - return array4.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator2); + util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val; + function joinValues2(array3, separator2 = " | ") { + return array3.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator2); } - util3.joinValues = joinValues3; - util3.jsonStringifyReplacer = (_, value2) => { + util2.joinValues = joinValues2; + util2.jsonStringifyReplacer = (_, value2) => { if (typeof value2 === "bigint") { return value2.toString(); } return value2; }; })(util || (util = {})); - (function(objectUtil3) { - objectUtil3.mergeShapes = (first, second) => { + (function(objectUtil2) { + objectUtil2.mergeShapes = (first, second) => { return { ...first, ...second @@ -20049,31 +20049,31 @@ var init_ZodError = __esm({ this.issues = issues; } format(_mapper) { - const mapper = _mapper || function(issue4) { - return issue4.message; + const mapper = _mapper || function(issue3) { + return issue3.message; }; const fieldErrors = { _errors: [] }; - const processError = (error50) => { - for (const issue4 of error50.issues) { - if (issue4.code === "invalid_union") { - issue4.unionErrors.map(processError); - } else if (issue4.code === "invalid_return_type") { - processError(issue4.returnTypeError); - } else if (issue4.code === "invalid_arguments") { - processError(issue4.argumentsError); - } else if (issue4.path.length === 0) { - fieldErrors._errors.push(mapper(issue4)); + const processError = (error49) => { + for (const issue3 of error49.issues) { + if (issue3.code === "invalid_union") { + issue3.unionErrors.map(processError); + } else if (issue3.code === "invalid_return_type") { + processError(issue3.returnTypeError); + } else if (issue3.code === "invalid_arguments") { + processError(issue3.argumentsError); + } else if (issue3.path.length === 0) { + fieldErrors._errors.push(mapper(issue3)); } else { let curr = fieldErrors; let i = 0; - while (i < issue4.path.length) { - const el = issue4.path[i]; - const terminal = i === issue4.path.length - 1; + while (i < issue3.path.length) { + const el = issue3.path[i]; + const terminal = i === issue3.path.length - 1; if (!terminal) { curr[el] = curr[el] || { _errors: [] }; } else { curr[el] = curr[el] || { _errors: [] }; - curr[el]._errors.push(mapper(issue4)); + curr[el]._errors.push(mapper(issue3)); } curr = curr[el]; i++; @@ -20098,7 +20098,7 @@ var init_ZodError = __esm({ get isEmpty() { return this.issues.length === 0; } - flatten(mapper = (issue4) => issue4.message) { + flatten(mapper = (issue3) => issue3.message) { const fieldErrors = /* @__PURE__ */ Object.create(null); const formErrors = []; for (const sub of this.issues) { @@ -20117,8 +20117,8 @@ var init_ZodError = __esm({ } }; ZodError.create = (issues) => { - const error50 = new ZodError(issues); - return error50; + const error49 = new ZodError(issues); + return error49; }; } }); @@ -20129,30 +20129,30 @@ var init_en = __esm({ "node_modules/.pnpm/zod@4.3.5/node_modules/zod/v3/locales/en.js"() { init_ZodError(); init_util(); - errorMap = (issue4, _ctx) => { + errorMap = (issue3, _ctx) => { let message; - switch (issue4.code) { + switch (issue3.code) { case ZodIssueCode.invalid_type: - if (issue4.received === ZodParsedType.undefined) { + if (issue3.received === ZodParsedType.undefined) { message = "Required"; } else { - message = `Expected ${issue4.expected}, received ${issue4.received}`; + message = `Expected ${issue3.expected}, received ${issue3.received}`; } break; case ZodIssueCode.invalid_literal: - message = `Invalid literal value, expected ${JSON.stringify(issue4.expected, util.jsonStringifyReplacer)}`; + message = `Invalid literal value, expected ${JSON.stringify(issue3.expected, util.jsonStringifyReplacer)}`; break; case ZodIssueCode.unrecognized_keys: - message = `Unrecognized key(s) in object: ${util.joinValues(issue4.keys, ", ")}`; + message = `Unrecognized key(s) in object: ${util.joinValues(issue3.keys, ", ")}`; break; case ZodIssueCode.invalid_union: message = `Invalid input`; break; case ZodIssueCode.invalid_union_discriminator: - message = `Invalid discriminator value. Expected ${util.joinValues(issue4.options)}`; + message = `Invalid discriminator value. Expected ${util.joinValues(issue3.options)}`; break; case ZodIssueCode.invalid_enum_value: - message = `Invalid enum value. Expected ${util.joinValues(issue4.options)}, received '${issue4.received}'`; + message = `Invalid enum value. Expected ${util.joinValues(issue3.options)}, received '${issue3.received}'`; break; case ZodIssueCode.invalid_arguments: message = `Invalid function arguments`; @@ -20164,50 +20164,50 @@ var init_en = __esm({ message = `Invalid date`; break; case ZodIssueCode.invalid_string: - if (typeof issue4.validation === "object") { - if ("includes" in issue4.validation) { - message = `Invalid input: must include "${issue4.validation.includes}"`; - if (typeof issue4.validation.position === "number") { - message = `${message} at one or more positions greater than or equal to ${issue4.validation.position}`; + if (typeof issue3.validation === "object") { + if ("includes" in issue3.validation) { + message = `Invalid input: must include "${issue3.validation.includes}"`; + if (typeof issue3.validation.position === "number") { + message = `${message} at one or more positions greater than or equal to ${issue3.validation.position}`; } - } else if ("startsWith" in issue4.validation) { - message = `Invalid input: must start with "${issue4.validation.startsWith}"`; - } else if ("endsWith" in issue4.validation) { - message = `Invalid input: must end with "${issue4.validation.endsWith}"`; + } else if ("startsWith" in issue3.validation) { + message = `Invalid input: must start with "${issue3.validation.startsWith}"`; + } else if ("endsWith" in issue3.validation) { + message = `Invalid input: must end with "${issue3.validation.endsWith}"`; } else { - util.assertNever(issue4.validation); + util.assertNever(issue3.validation); } - } else if (issue4.validation !== "regex") { - message = `Invalid ${issue4.validation}`; + } else if (issue3.validation !== "regex") { + message = `Invalid ${issue3.validation}`; } else { message = "Invalid"; } break; case ZodIssueCode.too_small: - if (issue4.type === "array") - message = `Array must contain ${issue4.exact ? "exactly" : issue4.inclusive ? `at least` : `more than`} ${issue4.minimum} element(s)`; - else if (issue4.type === "string") - message = `String must contain ${issue4.exact ? "exactly" : issue4.inclusive ? `at least` : `over`} ${issue4.minimum} character(s)`; - else if (issue4.type === "number") - message = `Number must be ${issue4.exact ? `exactly equal to ` : issue4.inclusive ? `greater than or equal to ` : `greater than `}${issue4.minimum}`; - else if (issue4.type === "bigint") - message = `Number must be ${issue4.exact ? `exactly equal to ` : issue4.inclusive ? `greater than or equal to ` : `greater than `}${issue4.minimum}`; - else if (issue4.type === "date") - message = `Date must be ${issue4.exact ? `exactly equal to ` : issue4.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue4.minimum))}`; + if (issue3.type === "array") + message = `Array must contain ${issue3.exact ? "exactly" : issue3.inclusive ? `at least` : `more than`} ${issue3.minimum} element(s)`; + else if (issue3.type === "string") + message = `String must contain ${issue3.exact ? "exactly" : issue3.inclusive ? `at least` : `over`} ${issue3.minimum} character(s)`; + else if (issue3.type === "number") + message = `Number must be ${issue3.exact ? `exactly equal to ` : issue3.inclusive ? `greater than or equal to ` : `greater than `}${issue3.minimum}`; + else if (issue3.type === "bigint") + message = `Number must be ${issue3.exact ? `exactly equal to ` : issue3.inclusive ? `greater than or equal to ` : `greater than `}${issue3.minimum}`; + else if (issue3.type === "date") + message = `Date must be ${issue3.exact ? `exactly equal to ` : issue3.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue3.minimum))}`; else message = "Invalid input"; break; case ZodIssueCode.too_big: - if (issue4.type === "array") - message = `Array must contain ${issue4.exact ? `exactly` : issue4.inclusive ? `at most` : `less than`} ${issue4.maximum} element(s)`; - else if (issue4.type === "string") - message = `String must contain ${issue4.exact ? `exactly` : issue4.inclusive ? `at most` : `under`} ${issue4.maximum} character(s)`; - else if (issue4.type === "number") - message = `Number must be ${issue4.exact ? `exactly` : issue4.inclusive ? `less than or equal to` : `less than`} ${issue4.maximum}`; - else if (issue4.type === "bigint") - message = `BigInt must be ${issue4.exact ? `exactly` : issue4.inclusive ? `less than or equal to` : `less than`} ${issue4.maximum}`; - else if (issue4.type === "date") - message = `Date must be ${issue4.exact ? `exactly` : issue4.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue4.maximum))}`; + if (issue3.type === "array") + message = `Array must contain ${issue3.exact ? `exactly` : issue3.inclusive ? `at most` : `less than`} ${issue3.maximum} element(s)`; + else if (issue3.type === "string") + message = `String must contain ${issue3.exact ? `exactly` : issue3.inclusive ? `at most` : `under`} ${issue3.maximum} character(s)`; + else if (issue3.type === "number") + message = `Number must be ${issue3.exact ? `exactly` : issue3.inclusive ? `less than or equal to` : `less than`} ${issue3.maximum}`; + else if (issue3.type === "bigint") + message = `BigInt must be ${issue3.exact ? `exactly` : issue3.inclusive ? `less than or equal to` : `less than`} ${issue3.maximum}`; + else if (issue3.type === "date") + message = `Date must be ${issue3.exact ? `exactly` : issue3.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue3.maximum))}`; else message = "Invalid input"; break; @@ -20218,14 +20218,14 @@ var init_en = __esm({ message = `Intersection results could not be merged`; break; case ZodIssueCode.not_multiple_of: - message = `Number must be a multiple of ${issue4.multipleOf}`; + message = `Number must be a multiple of ${issue3.multipleOf}`; break; case ZodIssueCode.not_finite: message = "Number must be finite"; break; default: message = _ctx.defaultError; - util.assertNever(issue4); + util.assertNever(issue3); } return { message }; }; @@ -20248,7 +20248,7 @@ var init_errors = __esm({ // node_modules/.pnpm/zod@4.3.5/node_modules/zod/v3/helpers/parseUtil.js function addIssueToContext(ctx, issueData) { const overrideMap = getErrorMap(); - const issue4 = makeIssue({ + const issue3 = makeIssue({ issueData, data: ctx.data, path: ctx.path, @@ -20263,7 +20263,7 @@ function addIssueToContext(ctx, issueData) { // then global default map ].filter((x) => !!x) }); - ctx.common.issues.push(issue4); + ctx.common.issues.push(issue3); } var makeIssue, ParseStatus, INVALID, DIRTY, OK, isAborted, isDirty, isValid, isAsync; var init_parseUtil = __esm({ @@ -20271,8 +20271,8 @@ var init_parseUtil = __esm({ init_errors(); init_en(); makeIssue = (params) => { - const { data, path: path4, errorMaps, issueData } = params; - const fullPath = [...path4, ...issueData.path || []]; + const { data, path: path3, errorMaps, issueData } = params; + const fullPath = [...path3, ...issueData.path || []]; const fullIssue = { ...issueData, path: fullPath @@ -20371,9 +20371,9 @@ var init_typeAliases = __esm({ var errorUtil; var init_errorUtil = __esm({ "node_modules/.pnpm/zod@4.3.5/node_modules/zod/v3/helpers/errorUtil.js"() { - (function(errorUtil3) { - errorUtil3.errToObj = (message) => typeof message === "string" ? { message } : message || {}; - errorUtil3.toString = (message) => typeof message === "string" ? message : message?.message; + (function(errorUtil2) { + errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {}; + errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message; })(errorUtil || (errorUtil = {})); } }); @@ -20382,12 +20382,12 @@ var init_errorUtil = __esm({ function processCreateParams(params) { if (!params) return {}; - const { errorMap: errorMap3, invalid_type_error, required_error, description } = params; - if (errorMap3 && (invalid_type_error || required_error)) { + const { errorMap: errorMap2, invalid_type_error, required_error, description } = params; + if (errorMap2 && (invalid_type_error || required_error)) { throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`); } - if (errorMap3) - return { errorMap: errorMap3, description }; + if (errorMap2) + return { errorMap: errorMap2, description }; const customMap = (iss, ctx) => { const { message } = params; if (iss.code === "invalid_enum_value") { @@ -20424,11 +20424,11 @@ function datetimeRegex(args3) { regex4 = `${regex4}(${opts.join("|")})`; return new RegExp(`^${regex4}$`); } -function isValidIP(ip2, version4) { - if ((version4 === "v4" || !version4) && ipv4Regex.test(ip2)) { +function isValidIP(ip2, version3) { + if ((version3 === "v4" || !version3) && ipv4Regex.test(ip2)) { return true; } - if ((version4 === "v6" || !version4) && ipv6Regex.test(ip2)) { + if ((version3 === "v6" || !version3) && ipv6Regex.test(ip2)) { return true; } return false; @@ -20440,8 +20440,8 @@ function isValidJWT(jwt2, alg) { const [header] = jwt2.split("."); if (!header) return false; - const base646 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "="); - const decoded = JSON.parse(atob(base646)); + const base645 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "="); + const decoded = JSON.parse(atob(base645)); if (typeof decoded !== "object" || decoded === null) return false; if ("typ" in decoded && decoded?.typ !== "JWT") @@ -20455,11 +20455,11 @@ function isValidJWT(jwt2, alg) { return false; } } -function isValidCidr(ip2, version4) { - if ((version4 === "v4" || !version4) && ipv4CidrRegex.test(ip2)) { +function isValidCidr(ip2, version3) { + if ((version3 === "v4" || !version3) && ipv4CidrRegex.test(ip2)) { return true; } - if ((version4 === "v6" || !version4) && ipv6CidrRegex.test(ip2)) { + if ((version3 === "v6" || !version3) && ipv6CidrRegex.test(ip2)) { return true; } return false; @@ -20552,11 +20552,11 @@ var init_types = __esm({ init_parseUtil(); init_util(); ParseInputLazyPath = class { - constructor(parent, value2, path4, key) { + constructor(parent, value2, path3, key) { this._cachedPath = []; this.parent = parent; this.data = value2; - this._path = path4; + this._path = path3; this._key = key; } get path() { @@ -20582,8 +20582,8 @@ var init_types = __esm({ get error() { if (this._error) return this._error; - const error50 = new ZodError(ctx.common.issues); - this._error = error50; + const error49 = new ZodError(ctx.common.issues); + this._error = error49; return this._error; } }; @@ -20711,7 +20711,7 @@ var init_types = __esm({ const result = await (isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult)); return handleResult(ctx, result); } - refine(check4, message) { + refine(check3, message) { const getIssueProperties = (val) => { if (typeof message === "string" || typeof message === "undefined") { return { message }; @@ -20722,7 +20722,7 @@ var init_types = __esm({ } }; return this._refinement((val, ctx) => { - const result = check4(val); + const result = check3(val); const setError = () => ctx.addIssue({ code: ZodIssueCode.custom, ...getIssueProperties(val) @@ -20745,9 +20745,9 @@ var init_types = __esm({ } }); } - refinement(check4, refinementData) { + refinement(check3, refinementData) { return this._refinement((val, ctx) => { - if (!check4(val)) { + if (!check3(val)) { ctx.addIssue(typeof refinementData === "function" ? refinementData(val, ctx) : refinementData); return false; } else { @@ -20819,12 +20819,12 @@ var init_types = __esm({ and(incoming) { return ZodIntersection.create(this, incoming, this._def); } - transform(transform4) { + transform(transform3) { return new ZodEffects({ ...processCreateParams(this._def), schema: this, typeName: ZodFirstPartyTypeKind.ZodEffects, - effect: { type: "transform", transform: transform4 } + effect: { type: "transform", transform: transform3 } }); } default(def) { @@ -20889,13 +20889,13 @@ var init_types = __esm({ base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/; dateRegexSource = `((\\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])))`; dateRegex = new RegExp(`^${dateRegexSource}$`); - ZodString = class _ZodString4 extends ZodType { + ZodString = class _ZodString3 extends ZodType { _parse(input) { if (this._def.coerce) { input.data = String(input.data); } - const parsedType3 = this._getType(input); - if (parsedType3 !== ZodParsedType.string) { + const parsedType2 = this._getType(input); + if (parsedType2 !== ZodParsedType.string) { const ctx2 = this._getOrReturnCtx(input); addIssueToContext(ctx2, { code: ZodIssueCode.invalid_type, @@ -20906,70 +20906,70 @@ var init_types = __esm({ } const status = new ParseStatus(); let ctx = void 0; - for (const check4 of this._def.checks) { - if (check4.kind === "min") { - if (input.data.length < check4.value) { + for (const check3 of this._def.checks) { + if (check3.kind === "min") { + if (input.data.length < check3.value) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.too_small, - minimum: check4.value, + minimum: check3.value, type: "string", inclusive: true, exact: false, - message: check4.message + message: check3.message }); status.dirty(); } - } else if (check4.kind === "max") { - if (input.data.length > check4.value) { + } else if (check3.kind === "max") { + if (input.data.length > check3.value) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.too_big, - maximum: check4.value, + maximum: check3.value, type: "string", inclusive: true, exact: false, - message: check4.message + message: check3.message }); status.dirty(); } - } else if (check4.kind === "length") { - const tooBig = input.data.length > check4.value; - const tooSmall = input.data.length < check4.value; + } else if (check3.kind === "length") { + const tooBig = input.data.length > check3.value; + const tooSmall = input.data.length < check3.value; if (tooBig || tooSmall) { ctx = this._getOrReturnCtx(input, ctx); if (tooBig) { addIssueToContext(ctx, { code: ZodIssueCode.too_big, - maximum: check4.value, + maximum: check3.value, type: "string", inclusive: true, exact: true, - message: check4.message + message: check3.message }); } else if (tooSmall) { addIssueToContext(ctx, { code: ZodIssueCode.too_small, - minimum: check4.value, + minimum: check3.value, type: "string", inclusive: true, exact: true, - message: check4.message + message: check3.message }); } status.dirty(); } - } else if (check4.kind === "email") { + } else if (check3.kind === "email") { if (!emailRegex.test(input.data)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "email", code: ZodIssueCode.invalid_string, - message: check4.message + message: check3.message }); status.dirty(); } - } else if (check4.kind === "emoji") { + } else if (check3.kind === "emoji") { if (!emojiRegex) { emojiRegex = new RegExp(_emojiRegex, "u"); } @@ -20978,61 +20978,61 @@ var init_types = __esm({ addIssueToContext(ctx, { validation: "emoji", code: ZodIssueCode.invalid_string, - message: check4.message + message: check3.message }); status.dirty(); } - } else if (check4.kind === "uuid") { + } else if (check3.kind === "uuid") { if (!uuidRegex.test(input.data)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "uuid", code: ZodIssueCode.invalid_string, - message: check4.message + message: check3.message }); status.dirty(); } - } else if (check4.kind === "nanoid") { + } else if (check3.kind === "nanoid") { if (!nanoidRegex.test(input.data)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "nanoid", code: ZodIssueCode.invalid_string, - message: check4.message + message: check3.message }); status.dirty(); } - } else if (check4.kind === "cuid") { + } else if (check3.kind === "cuid") { if (!cuidRegex.test(input.data)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "cuid", code: ZodIssueCode.invalid_string, - message: check4.message + message: check3.message }); status.dirty(); } - } else if (check4.kind === "cuid2") { + } else if (check3.kind === "cuid2") { if (!cuid2Regex.test(input.data)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "cuid2", code: ZodIssueCode.invalid_string, - message: check4.message + message: check3.message }); status.dirty(); } - } else if (check4.kind === "ulid") { + } else if (check3.kind === "ulid") { if (!ulidRegex.test(input.data)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "ulid", code: ZodIssueCode.invalid_string, - message: check4.message + message: check3.message }); status.dirty(); } - } else if (check4.kind === "url") { + } else if (check3.kind === "url") { try { new URL(input.data); } catch { @@ -21040,153 +21040,153 @@ var init_types = __esm({ addIssueToContext(ctx, { validation: "url", code: ZodIssueCode.invalid_string, - message: check4.message + message: check3.message }); status.dirty(); } - } else if (check4.kind === "regex") { - check4.regex.lastIndex = 0; - const testResult = check4.regex.test(input.data); + } else if (check3.kind === "regex") { + check3.regex.lastIndex = 0; + const testResult = check3.regex.test(input.data); if (!testResult) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "regex", code: ZodIssueCode.invalid_string, - message: check4.message + message: check3.message }); status.dirty(); } - } else if (check4.kind === "trim") { + } else if (check3.kind === "trim") { input.data = input.data.trim(); - } else if (check4.kind === "includes") { - if (!input.data.includes(check4.value, check4.position)) { + } else if (check3.kind === "includes") { + if (!input.data.includes(check3.value, check3.position)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.invalid_string, - validation: { includes: check4.value, position: check4.position }, - message: check4.message + validation: { includes: check3.value, position: check3.position }, + message: check3.message }); status.dirty(); } - } else if (check4.kind === "toLowerCase") { + } else if (check3.kind === "toLowerCase") { input.data = input.data.toLowerCase(); - } else if (check4.kind === "toUpperCase") { + } else if (check3.kind === "toUpperCase") { input.data = input.data.toUpperCase(); - } else if (check4.kind === "startsWith") { - if (!input.data.startsWith(check4.value)) { + } else if (check3.kind === "startsWith") { + if (!input.data.startsWith(check3.value)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.invalid_string, - validation: { startsWith: check4.value }, - message: check4.message + validation: { startsWith: check3.value }, + message: check3.message }); status.dirty(); } - } else if (check4.kind === "endsWith") { - if (!input.data.endsWith(check4.value)) { + } else if (check3.kind === "endsWith") { + if (!input.data.endsWith(check3.value)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.invalid_string, - validation: { endsWith: check4.value }, - message: check4.message + validation: { endsWith: check3.value }, + message: check3.message }); status.dirty(); } - } else if (check4.kind === "datetime") { - const regex4 = datetimeRegex(check4); + } else if (check3.kind === "datetime") { + const regex4 = datetimeRegex(check3); if (!regex4.test(input.data)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.invalid_string, validation: "datetime", - message: check4.message + message: check3.message }); status.dirty(); } - } else if (check4.kind === "date") { + } else if (check3.kind === "date") { const regex4 = dateRegex; if (!regex4.test(input.data)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.invalid_string, validation: "date", - message: check4.message + message: check3.message }); status.dirty(); } - } else if (check4.kind === "time") { - const regex4 = timeRegex(check4); + } else if (check3.kind === "time") { + const regex4 = timeRegex(check3); if (!regex4.test(input.data)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.invalid_string, validation: "time", - message: check4.message + message: check3.message }); status.dirty(); } - } else if (check4.kind === "duration") { + } else if (check3.kind === "duration") { if (!durationRegex.test(input.data)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "duration", code: ZodIssueCode.invalid_string, - message: check4.message + message: check3.message }); status.dirty(); } - } else if (check4.kind === "ip") { - if (!isValidIP(input.data, check4.version)) { + } else if (check3.kind === "ip") { + if (!isValidIP(input.data, check3.version)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "ip", code: ZodIssueCode.invalid_string, - message: check4.message + message: check3.message }); status.dirty(); } - } else if (check4.kind === "jwt") { - if (!isValidJWT(input.data, check4.alg)) { + } else if (check3.kind === "jwt") { + if (!isValidJWT(input.data, check3.alg)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "jwt", code: ZodIssueCode.invalid_string, - message: check4.message + message: check3.message }); status.dirty(); } - } else if (check4.kind === "cidr") { - if (!isValidCidr(input.data, check4.version)) { + } else if (check3.kind === "cidr") { + if (!isValidCidr(input.data, check3.version)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "cidr", code: ZodIssueCode.invalid_string, - message: check4.message + message: check3.message }); status.dirty(); } - } else if (check4.kind === "base64") { + } else if (check3.kind === "base64") { if (!base64Regex.test(input.data)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "base64", code: ZodIssueCode.invalid_string, - message: check4.message + message: check3.message }); status.dirty(); } - } else if (check4.kind === "base64url") { + } else if (check3.kind === "base64url") { if (!base64urlRegex.test(input.data)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "base64url", code: ZodIssueCode.invalid_string, - message: check4.message + message: check3.message }); status.dirty(); } } else { - util.assertNever(check4); + util.assertNever(check3); } } return { status: status.value, value: input.data }; @@ -21198,10 +21198,10 @@ var init_types = __esm({ ...errorUtil.errToObj(message) }); } - _addCheck(check4) { - return new _ZodString4({ + _addCheck(check3) { + return new _ZodString3({ ...this._def, - checks: [...this._def.checks, check4] + checks: [...this._def.checks, check3] }); } email(message) { @@ -21341,19 +21341,19 @@ var init_types = __esm({ return this.min(1, errorUtil.errToObj(message)); } trim() { - return new _ZodString4({ + return new _ZodString3({ ...this._def, checks: [...this._def.checks, { kind: "trim" }] }); } toLowerCase() { - return new _ZodString4({ + return new _ZodString3({ ...this._def, checks: [...this._def.checks, { kind: "toLowerCase" }] }); } toUpperCase() { - return new _ZodString4({ + return new _ZodString3({ ...this._def, checks: [...this._def.checks, { kind: "toUpperCase" }] }); @@ -21446,8 +21446,8 @@ var init_types = __esm({ if (this._def.coerce) { input.data = Number(input.data); } - const parsedType3 = this._getType(input); - if (parsedType3 !== ZodParsedType.number) { + const parsedType2 = this._getType(input); + if (parsedType2 !== ZodParsedType.number) { const ctx2 = this._getOrReturnCtx(input); addIssueToContext(ctx2, { code: ZodIssueCode.invalid_type, @@ -21458,67 +21458,67 @@ var init_types = __esm({ } let ctx = void 0; const status = new ParseStatus(); - for (const check4 of this._def.checks) { - if (check4.kind === "int") { + for (const check3 of this._def.checks) { + if (check3.kind === "int") { if (!util.isInteger(input.data)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.invalid_type, expected: "integer", received: "float", - message: check4.message + message: check3.message }); status.dirty(); } - } else if (check4.kind === "min") { - const tooSmall = check4.inclusive ? input.data < check4.value : input.data <= check4.value; + } else if (check3.kind === "min") { + const tooSmall = check3.inclusive ? input.data < check3.value : input.data <= check3.value; if (tooSmall) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.too_small, - minimum: check4.value, + minimum: check3.value, type: "number", - inclusive: check4.inclusive, + inclusive: check3.inclusive, exact: false, - message: check4.message + message: check3.message }); status.dirty(); } - } else if (check4.kind === "max") { - const tooBig = check4.inclusive ? input.data > check4.value : input.data >= check4.value; + } else if (check3.kind === "max") { + const tooBig = check3.inclusive ? input.data > check3.value : input.data >= check3.value; if (tooBig) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.too_big, - maximum: check4.value, + maximum: check3.value, type: "number", - inclusive: check4.inclusive, + inclusive: check3.inclusive, exact: false, - message: check4.message + message: check3.message }); status.dirty(); } - } else if (check4.kind === "multipleOf") { - if (floatSafeRemainder(input.data, check4.value) !== 0) { + } else if (check3.kind === "multipleOf") { + if (floatSafeRemainder(input.data, check3.value) !== 0) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.not_multiple_of, - multipleOf: check4.value, - message: check4.message + multipleOf: check3.value, + message: check3.message }); status.dirty(); } - } else if (check4.kind === "finite") { + } else if (check3.kind === "finite") { if (!Number.isFinite(input.data)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.not_finite, - message: check4.message + message: check3.message }); status.dirty(); } } else { - util.assertNever(check4); + util.assertNever(check3); } } return { status: status.value, value: input.data }; @@ -21549,10 +21549,10 @@ var init_types = __esm({ ] }); } - _addCheck(check4) { + _addCheck(check3) { return new _ZodNumber({ ...this._def, - checks: [...this._def.checks, check4] + checks: [...this._def.checks, check3] }); } int(message) { @@ -21681,51 +21681,51 @@ var init_types = __esm({ return this._getInvalidInput(input); } } - const parsedType3 = this._getType(input); - if (parsedType3 !== ZodParsedType.bigint) { + const parsedType2 = this._getType(input); + if (parsedType2 !== ZodParsedType.bigint) { return this._getInvalidInput(input); } let ctx = void 0; const status = new ParseStatus(); - for (const check4 of this._def.checks) { - if (check4.kind === "min") { - const tooSmall = check4.inclusive ? input.data < check4.value : input.data <= check4.value; + for (const check3 of this._def.checks) { + if (check3.kind === "min") { + const tooSmall = check3.inclusive ? input.data < check3.value : input.data <= check3.value; if (tooSmall) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.too_small, type: "bigint", - minimum: check4.value, - inclusive: check4.inclusive, - message: check4.message + minimum: check3.value, + inclusive: check3.inclusive, + message: check3.message }); status.dirty(); } - } else if (check4.kind === "max") { - const tooBig = check4.inclusive ? input.data > check4.value : input.data >= check4.value; + } else if (check3.kind === "max") { + const tooBig = check3.inclusive ? input.data > check3.value : input.data >= check3.value; if (tooBig) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.too_big, type: "bigint", - maximum: check4.value, - inclusive: check4.inclusive, - message: check4.message + maximum: check3.value, + inclusive: check3.inclusive, + message: check3.message }); status.dirty(); } - } else if (check4.kind === "multipleOf") { - if (input.data % check4.value !== BigInt(0)) { + } else if (check3.kind === "multipleOf") { + if (input.data % check3.value !== BigInt(0)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.not_multiple_of, - multipleOf: check4.value, - message: check4.message + multipleOf: check3.value, + message: check3.message }); status.dirty(); } } else { - util.assertNever(check4); + util.assertNever(check3); } } return { status: status.value, value: input.data }; @@ -21765,10 +21765,10 @@ var init_types = __esm({ ] }); } - _addCheck(check4) { + _addCheck(check3) { return new _ZodBigInt({ ...this._def, - checks: [...this._def.checks, check4] + checks: [...this._def.checks, check3] }); } positive(message) { @@ -21844,8 +21844,8 @@ var init_types = __esm({ if (this._def.coerce) { input.data = Boolean(input.data); } - const parsedType3 = this._getType(input); - if (parsedType3 !== ZodParsedType.boolean) { + const parsedType2 = this._getType(input); + if (parsedType2 !== ZodParsedType.boolean) { const ctx = this._getOrReturnCtx(input); addIssueToContext(ctx, { code: ZodIssueCode.invalid_type, @@ -21869,8 +21869,8 @@ var init_types = __esm({ if (this._def.coerce) { input.data = new Date(input.data); } - const parsedType3 = this._getType(input); - if (parsedType3 !== ZodParsedType.date) { + const parsedType2 = this._getType(input); + if (parsedType2 !== ZodParsedType.date) { const ctx2 = this._getOrReturnCtx(input); addIssueToContext(ctx2, { code: ZodIssueCode.invalid_type, @@ -21888,35 +21888,35 @@ var init_types = __esm({ } const status = new ParseStatus(); let ctx = void 0; - for (const check4 of this._def.checks) { - if (check4.kind === "min") { - if (input.data.getTime() < check4.value) { + for (const check3 of this._def.checks) { + if (check3.kind === "min") { + if (input.data.getTime() < check3.value) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.too_small, - message: check4.message, + message: check3.message, inclusive: true, exact: false, - minimum: check4.value, + minimum: check3.value, type: "date" }); status.dirty(); } - } else if (check4.kind === "max") { - if (input.data.getTime() > check4.value) { + } else if (check3.kind === "max") { + if (input.data.getTime() > check3.value) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.too_big, - message: check4.message, + message: check3.message, inclusive: true, exact: false, - maximum: check4.value, + maximum: check3.value, type: "date" }); status.dirty(); } } else { - util.assertNever(check4); + util.assertNever(check3); } } return { @@ -21924,10 +21924,10 @@ var init_types = __esm({ value: new Date(input.data.getTime()) }; } - _addCheck(check4) { + _addCheck(check3) { return new _ZodDate({ ...this._def, - checks: [...this._def.checks, check4] + checks: [...this._def.checks, check3] }); } min(minDate, message) { @@ -21975,8 +21975,8 @@ var init_types = __esm({ }; ZodSymbol = class extends ZodType { _parse(input) { - const parsedType3 = this._getType(input); - if (parsedType3 !== ZodParsedType.symbol) { + const parsedType2 = this._getType(input); + if (parsedType2 !== ZodParsedType.symbol) { const ctx = this._getOrReturnCtx(input); addIssueToContext(ctx, { code: ZodIssueCode.invalid_type, @@ -21996,8 +21996,8 @@ var init_types = __esm({ }; ZodUndefined = class extends ZodType { _parse(input) { - const parsedType3 = this._getType(input); - if (parsedType3 !== ZodParsedType.undefined) { + const parsedType2 = this._getType(input); + if (parsedType2 !== ZodParsedType.undefined) { const ctx = this._getOrReturnCtx(input); addIssueToContext(ctx, { code: ZodIssueCode.invalid_type, @@ -22017,8 +22017,8 @@ var init_types = __esm({ }; ZodNull = class extends ZodType { _parse(input) { - const parsedType3 = this._getType(input); - if (parsedType3 !== ZodParsedType.null) { + const parsedType2 = this._getType(input); + if (parsedType2 !== ZodParsedType.null) { const ctx = this._getOrReturnCtx(input); addIssueToContext(ctx, { code: ZodIssueCode.invalid_type, @@ -22085,8 +22085,8 @@ var init_types = __esm({ }; ZodVoid = class extends ZodType { _parse(input) { - const parsedType3 = this._getType(input); - if (parsedType3 !== ZodParsedType.undefined) { + const parsedType2 = this._getType(input); + if (parsedType2 !== ZodParsedType.undefined) { const ctx = this._getOrReturnCtx(input); addIssueToContext(ctx, { code: ZodIssueCode.invalid_type, @@ -22221,8 +22221,8 @@ var init_types = __esm({ return this._cached; } _parse(input) { - const parsedType3 = this._getType(input); - if (parsedType3 !== ZodParsedType.object) { + const parsedType2 = this._getType(input); + if (parsedType2 !== ZodParsedType.object) { const ctx2 = this._getOrReturnCtx(input); addIssueToContext(ctx2, { code: ZodIssueCode.invalid_type, @@ -22315,9 +22315,9 @@ var init_types = __esm({ ...this._def, unknownKeys: "strict", ...message !== void 0 ? { - errorMap: (issue4, ctx) => { - const defaultError = this._def.errorMap?.(issue4, ctx).message ?? ctx.defaultError; - if (issue4.code === "unrecognized_keys") + errorMap: (issue3, ctx) => { + const defaultError = this._def.errorMap?.(issue3, ctx).message ?? ctx.defaultError; + if (issue3.code === "unrecognized_keys") return { message: errorUtil.errToObj(message).message ?? defaultError }; @@ -23080,25 +23080,25 @@ var init_types = __esm({ }); return INVALID; } - function makeArgsIssue(args3, error50) { + function makeArgsIssue(args3, error49) { return makeIssue({ data: args3, path: ctx.path, errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x), issueData: { code: ZodIssueCode.invalid_arguments, - argumentsError: error50 + argumentsError: error49 } }); } - function makeReturnsIssue(returns, error50) { + function makeReturnsIssue(returns, error49) { return makeIssue({ data: returns, path: ctx.path, errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x), issueData: { code: ZodIssueCode.invalid_return_type, - returnTypeError: error50 + returnTypeError: error49 } }); } @@ -23107,15 +23107,15 @@ var init_types = __esm({ if (this._def.returns instanceof ZodPromise) { const me = this; return OK(async function(...args3) { - const error50 = new ZodError([]); + const error49 = new ZodError([]); const parsedArgs = await me._def.args.parseAsync(args3, params).catch((e) => { - error50.addIssue(makeArgsIssue(args3, e)); - throw error50; + error49.addIssue(makeArgsIssue(args3, e)); + throw error49; }); const result = await Reflect.apply(fn2, this, parsedArgs); const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e) => { - error50.addIssue(makeReturnsIssue(result, e)); - throw error50; + error49.addIssue(makeReturnsIssue(result, e)); + throw error49; }); return parsedReturns; }); @@ -23475,18 +23475,18 @@ var init_types = __esm({ ...processCreateParams(params) }); }; - ZodEffects.createWithPreprocess = (preprocess4, schema2, params) => { + ZodEffects.createWithPreprocess = (preprocess3, schema2, params) => { return new ZodEffects({ schema: schema2, - effect: { type: "preprocess", transform: preprocess4 }, + effect: { type: "preprocess", transform: preprocess3 }, typeName: ZodFirstPartyTypeKind.ZodEffects, ...processCreateParams(params) }); }; ZodOptional = class extends ZodType { _parse(input) { - const parsedType3 = this._getType(input); - if (parsedType3 === ZodParsedType.undefined) { + const parsedType2 = this._getType(input); + if (parsedType2 === ZodParsedType.undefined) { return OK(void 0); } return this._def.innerType._parse(input); @@ -23504,8 +23504,8 @@ var init_types = __esm({ }; ZodNullable = class extends ZodType { _parse(input) { - const parsedType3 = this._getType(input); - if (parsedType3 === ZodParsedType.null) { + const parsedType2 = this._getType(input); + if (parsedType2 === ZodParsedType.null) { return OK(null); } return this._def.innerType._parse(input); @@ -23601,8 +23601,8 @@ var init_types = __esm({ }; ZodNaN = class extends ZodType { _parse(input) { - const parsedType3 = this._getType(input); - if (parsedType3 !== ZodParsedType.nan) { + const parsedType2 = this._getType(input); + if (parsedType2 !== ZodParsedType.nan) { const ctx = this._getOrReturnCtx(input); addIssueToContext(ctx, { code: ZodIssueCode.invalid_type, @@ -23715,43 +23715,43 @@ var init_types = __esm({ late = { object: ZodObject.lazycreate }; - (function(ZodFirstPartyTypeKind4) { - ZodFirstPartyTypeKind4["ZodString"] = "ZodString"; - ZodFirstPartyTypeKind4["ZodNumber"] = "ZodNumber"; - ZodFirstPartyTypeKind4["ZodNaN"] = "ZodNaN"; - ZodFirstPartyTypeKind4["ZodBigInt"] = "ZodBigInt"; - ZodFirstPartyTypeKind4["ZodBoolean"] = "ZodBoolean"; - ZodFirstPartyTypeKind4["ZodDate"] = "ZodDate"; - ZodFirstPartyTypeKind4["ZodSymbol"] = "ZodSymbol"; - ZodFirstPartyTypeKind4["ZodUndefined"] = "ZodUndefined"; - ZodFirstPartyTypeKind4["ZodNull"] = "ZodNull"; - ZodFirstPartyTypeKind4["ZodAny"] = "ZodAny"; - ZodFirstPartyTypeKind4["ZodUnknown"] = "ZodUnknown"; - ZodFirstPartyTypeKind4["ZodNever"] = "ZodNever"; - ZodFirstPartyTypeKind4["ZodVoid"] = "ZodVoid"; - ZodFirstPartyTypeKind4["ZodArray"] = "ZodArray"; - ZodFirstPartyTypeKind4["ZodObject"] = "ZodObject"; - ZodFirstPartyTypeKind4["ZodUnion"] = "ZodUnion"; - ZodFirstPartyTypeKind4["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion"; - ZodFirstPartyTypeKind4["ZodIntersection"] = "ZodIntersection"; - ZodFirstPartyTypeKind4["ZodTuple"] = "ZodTuple"; - ZodFirstPartyTypeKind4["ZodRecord"] = "ZodRecord"; - ZodFirstPartyTypeKind4["ZodMap"] = "ZodMap"; - ZodFirstPartyTypeKind4["ZodSet"] = "ZodSet"; - ZodFirstPartyTypeKind4["ZodFunction"] = "ZodFunction"; - ZodFirstPartyTypeKind4["ZodLazy"] = "ZodLazy"; - ZodFirstPartyTypeKind4["ZodLiteral"] = "ZodLiteral"; - ZodFirstPartyTypeKind4["ZodEnum"] = "ZodEnum"; - ZodFirstPartyTypeKind4["ZodEffects"] = "ZodEffects"; - ZodFirstPartyTypeKind4["ZodNativeEnum"] = "ZodNativeEnum"; - ZodFirstPartyTypeKind4["ZodOptional"] = "ZodOptional"; - ZodFirstPartyTypeKind4["ZodNullable"] = "ZodNullable"; - ZodFirstPartyTypeKind4["ZodDefault"] = "ZodDefault"; - ZodFirstPartyTypeKind4["ZodCatch"] = "ZodCatch"; - ZodFirstPartyTypeKind4["ZodPromise"] = "ZodPromise"; - ZodFirstPartyTypeKind4["ZodBranded"] = "ZodBranded"; - ZodFirstPartyTypeKind4["ZodPipeline"] = "ZodPipeline"; - ZodFirstPartyTypeKind4["ZodReadonly"] = "ZodReadonly"; + (function(ZodFirstPartyTypeKind3) { + ZodFirstPartyTypeKind3["ZodString"] = "ZodString"; + ZodFirstPartyTypeKind3["ZodNumber"] = "ZodNumber"; + ZodFirstPartyTypeKind3["ZodNaN"] = "ZodNaN"; + ZodFirstPartyTypeKind3["ZodBigInt"] = "ZodBigInt"; + ZodFirstPartyTypeKind3["ZodBoolean"] = "ZodBoolean"; + ZodFirstPartyTypeKind3["ZodDate"] = "ZodDate"; + ZodFirstPartyTypeKind3["ZodSymbol"] = "ZodSymbol"; + ZodFirstPartyTypeKind3["ZodUndefined"] = "ZodUndefined"; + ZodFirstPartyTypeKind3["ZodNull"] = "ZodNull"; + ZodFirstPartyTypeKind3["ZodAny"] = "ZodAny"; + ZodFirstPartyTypeKind3["ZodUnknown"] = "ZodUnknown"; + ZodFirstPartyTypeKind3["ZodNever"] = "ZodNever"; + ZodFirstPartyTypeKind3["ZodVoid"] = "ZodVoid"; + ZodFirstPartyTypeKind3["ZodArray"] = "ZodArray"; + ZodFirstPartyTypeKind3["ZodObject"] = "ZodObject"; + ZodFirstPartyTypeKind3["ZodUnion"] = "ZodUnion"; + ZodFirstPartyTypeKind3["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion"; + ZodFirstPartyTypeKind3["ZodIntersection"] = "ZodIntersection"; + ZodFirstPartyTypeKind3["ZodTuple"] = "ZodTuple"; + ZodFirstPartyTypeKind3["ZodRecord"] = "ZodRecord"; + ZodFirstPartyTypeKind3["ZodMap"] = "ZodMap"; + ZodFirstPartyTypeKind3["ZodSet"] = "ZodSet"; + ZodFirstPartyTypeKind3["ZodFunction"] = "ZodFunction"; + ZodFirstPartyTypeKind3["ZodLazy"] = "ZodLazy"; + ZodFirstPartyTypeKind3["ZodLiteral"] = "ZodLiteral"; + ZodFirstPartyTypeKind3["ZodEnum"] = "ZodEnum"; + ZodFirstPartyTypeKind3["ZodEffects"] = "ZodEffects"; + ZodFirstPartyTypeKind3["ZodNativeEnum"] = "ZodNativeEnum"; + ZodFirstPartyTypeKind3["ZodOptional"] = "ZodOptional"; + ZodFirstPartyTypeKind3["ZodNullable"] = "ZodNullable"; + ZodFirstPartyTypeKind3["ZodDefault"] = "ZodDefault"; + ZodFirstPartyTypeKind3["ZodCatch"] = "ZodCatch"; + ZodFirstPartyTypeKind3["ZodPromise"] = "ZodPromise"; + ZodFirstPartyTypeKind3["ZodBranded"] = "ZodBranded"; + ZodFirstPartyTypeKind3["ZodPipeline"] = "ZodPipeline"; + ZodFirstPartyTypeKind3["ZodReadonly"] = "ZodReadonly"; })(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {})); stringType = ZodString.create; numberType = ZodNumber.create; @@ -23812,7 +23812,7 @@ var init_v3 = __esm({ // node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/core.js // @__NO_SIDE_EFFECTS__ -function $constructor(name, initializer5, params) { +function $constructor(name, initializer4, params) { function init(inst, def) { if (!inst._zod) { Object.defineProperty(inst, "_zod", { @@ -23828,7 +23828,7 @@ function $constructor(name, initializer5, params) { return; } inst._zod.traits.add(name); - initializer5(inst, def); + initializer4(inst, def); const proto = _.prototype; const keys = Object.keys(proto); for (let i = 0; i < keys.length; i++) { @@ -23974,8 +23974,8 @@ function getEnumValues(entries) { const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v); return values; } -function joinValues(array4, separator2 = "|") { - return array4.map((val) => stringifyPrimitive(val)).join(separator2); +function joinValues(array3, separator2 = "|") { + return array3.map((val) => stringifyPrimitive(val)).join(separator2); } function jsonStringifyReplacer(_, value2) { if (typeof value2 === "bigint") @@ -24062,10 +24062,10 @@ function mergeDefs(...defs) { function cloneDef(schema2) { return mergeDefs(schema2._zod.def); } -function getElementAtPath(obj, path4) { - if (!path4) +function getElementAtPath(obj, path3) { + if (!path3) return obj; - return path4.reduce((acc, key) => acc?.[key], obj); + return path3.reduce((acc, key) => acc?.[key], obj); } function promiseAllObject(promisesObj) { const keys = Object.keys(promisesObj); @@ -24298,7 +24298,7 @@ function merge(a, b) { }); return clone(a, def); } -function partial(Class3, schema2, mask) { +function partial(Class2, schema2, mask) { const currDef = schema2._zod.def; const checks = currDef.checks; const hasChecks = checks && checks.length > 0; @@ -24316,14 +24316,14 @@ function partial(Class3, schema2, mask) { } if (!mask[key]) continue; - shape[key] = Class3 ? new Class3({ + shape[key] = Class2 ? new Class2({ type: "optional", innerType: oldShape[key] }) : oldShape[key]; } } else { for (const key in oldShape) { - shape[key] = Class3 ? new Class3({ + shape[key] = Class2 ? new Class2({ type: "optional", innerType: oldShape[key] }) : oldShape[key]; @@ -24336,7 +24336,7 @@ function partial(Class3, schema2, mask) { }); return clone(schema2, def); } -function required(Class3, schema2, mask) { +function required(Class2, schema2, mask) { const def = mergeDefs(schema2._zod.def, { get shape() { const oldShape = schema2._zod.def.shape; @@ -24348,14 +24348,14 @@ function required(Class3, schema2, mask) { } if (!mask[key]) continue; - shape[key] = new Class3({ + shape[key] = new Class2({ type: "nonoptional", innerType: oldShape[key] }); } } else { for (const key in oldShape) { - shape[key] = new Class3({ + shape[key] = new Class2({ type: "nonoptional", innerType: oldShape[key] }); @@ -24377,21 +24377,21 @@ function aborted(x, startIndex = 0) { } return false; } -function prefixIssues(path4, issues) { +function prefixIssues(path3, issues) { return issues.map((iss) => { var _a2; (_a2 = iss).path ?? (_a2.path = []); - iss.path.unshift(path4); + iss.path.unshift(path3); return iss; }); } function unwrapMessage(message) { return typeof message === "string" ? message : message?.message; } -function finalizeIssue(iss, ctx, config4) { +function finalizeIssue(iss, ctx, config3) { const full = { ...iss, path: iss.path ?? [] }; if (!iss.message) { - const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config4.customError?.(iss)) ?? unwrapMessage(config4.localeError?.(iss)) ?? "Invalid input"; + const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config3.customError?.(iss)) ?? unwrapMessage(config3.localeError?.(iss)) ?? "Invalid input"; full.message = message; } delete full.inst; @@ -24455,8 +24455,8 @@ function cleanEnum(obj) { return Number.isNaN(Number.parseInt(k, 10)); }).map((el) => el[1]); } -function base64ToUint8Array(base646) { - const binaryString = atob(base646); +function base64ToUint8Array(base645) { + const binaryString = atob(base645); const bytes = new Uint8Array(binaryString.length); for (let i = 0; i < binaryString.length; i++) { bytes[i] = binaryString.charCodeAt(i); @@ -24470,10 +24470,10 @@ function uint8ArrayToBase64(bytes) { } return btoa(binaryString); } -function base64urlToUint8Array(base64url5) { - const base646 = base64url5.replace(/-/g, "+").replace(/_/g, "/"); - const padding = "=".repeat((4 - base646.length % 4) % 4); - return base64ToUint8Array(base646 + padding); +function base64urlToUint8Array(base64url4) { + const base645 = base64url4.replace(/-/g, "+").replace(/_/g, "/"); + const padding = "=".repeat((4 - base645.length % 4) % 4); + return base64ToUint8Array(base645 + padding); } function uint8ArrayToBase64url(bytes) { return uint8ArrayToBase64(bytes).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, ""); @@ -24575,10 +24575,10 @@ var init_util2 = __esm({ }); // node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/errors.js -function flattenError(error50, mapper = (issue4) => issue4.message) { +function flattenError(error49, mapper = (issue3) => issue3.message) { const fieldErrors = {}; const formErrors = []; - for (const sub of error50.issues) { + for (const sub of error49.issues) { if (sub.path.length > 0) { fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || []; fieldErrors[sub.path[0]].push(mapper(sub)); @@ -24588,29 +24588,29 @@ function flattenError(error50, mapper = (issue4) => issue4.message) { } return { formErrors, fieldErrors }; } -function formatError(error50, mapper = (issue4) => issue4.message) { +function formatError(error49, mapper = (issue3) => issue3.message) { const fieldErrors = { _errors: [] }; - const processError = (error51) => { - for (const issue4 of error51.issues) { - if (issue4.code === "invalid_union" && issue4.errors.length) { - issue4.errors.map((issues) => processError({ issues })); - } else if (issue4.code === "invalid_key") { - processError({ issues: issue4.issues }); - } else if (issue4.code === "invalid_element") { - processError({ issues: issue4.issues }); - } else if (issue4.path.length === 0) { - fieldErrors._errors.push(mapper(issue4)); + const processError = (error50) => { + for (const issue3 of error50.issues) { + if (issue3.code === "invalid_union" && issue3.errors.length) { + issue3.errors.map((issues) => processError({ issues })); + } else if (issue3.code === "invalid_key") { + processError({ issues: issue3.issues }); + } else if (issue3.code === "invalid_element") { + processError({ issues: issue3.issues }); + } else if (issue3.path.length === 0) { + fieldErrors._errors.push(mapper(issue3)); } else { let curr = fieldErrors; let i = 0; - while (i < issue4.path.length) { - const el = issue4.path[i]; - const terminal = i === issue4.path.length - 1; + while (i < issue3.path.length) { + const el = issue3.path[i]; + const terminal = i === issue3.path.length - 1; if (!terminal) { curr[el] = curr[el] || { _errors: [] }; } else { curr[el] = curr[el] || { _errors: [] }; - curr[el]._errors.push(mapper(issue4)); + curr[el]._errors.push(mapper(issue3)); } curr = curr[el]; i++; @@ -24618,24 +24618,24 @@ function formatError(error50, mapper = (issue4) => issue4.message) { } } }; - processError(error50); + processError(error49); return fieldErrors; } -function treeifyError(error50, mapper = (issue4) => issue4.message) { +function treeifyError(error49, mapper = (issue3) => issue3.message) { const result = { errors: [] }; - const processError = (error51, path4 = []) => { + const processError = (error50, path3 = []) => { var _a2, _b; - for (const issue4 of error51.issues) { - if (issue4.code === "invalid_union" && issue4.errors.length) { - issue4.errors.map((issues) => processError({ issues }, issue4.path)); - } else if (issue4.code === "invalid_key") { - processError({ issues: issue4.issues }, issue4.path); - } else if (issue4.code === "invalid_element") { - processError({ issues: issue4.issues }, issue4.path); + for (const issue3 of error50.issues) { + if (issue3.code === "invalid_union" && issue3.errors.length) { + issue3.errors.map((issues) => processError({ issues }, issue3.path)); + } else if (issue3.code === "invalid_key") { + processError({ issues: issue3.issues }, issue3.path); + } else if (issue3.code === "invalid_element") { + processError({ issues: issue3.issues }, issue3.path); } else { - const fullpath = [...path4, ...issue4.path]; + const fullpath = [...path3, ...issue3.path]; if (fullpath.length === 0) { - result.errors.push(mapper(issue4)); + result.errors.push(mapper(issue3)); continue; } let curr = result; @@ -24653,20 +24653,20 @@ function treeifyError(error50, mapper = (issue4) => issue4.message) { curr = curr.items[el]; } if (terminal) { - curr.errors.push(mapper(issue4)); + curr.errors.push(mapper(issue3)); } i++; } } } }; - processError(error50); + processError(error49); return result; } function toDotPath(_path) { const segs = []; - const path4 = _path.map((seg) => typeof seg === "object" ? seg.key : seg); - for (const seg of path4) { + const path3 = _path.map((seg) => typeof seg === "object" ? seg.key : seg); + for (const seg of path3) { if (typeof seg === "number") segs.push(`[${seg}]`); else if (typeof seg === "symbol") @@ -24681,13 +24681,13 @@ function toDotPath(_path) { } return segs.join(""); } -function prettifyError(error50) { +function prettifyError(error49) { const lines = []; - const issues = [...error50.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length); - for (const issue4 of issues) { - lines.push(`\u2716 ${issue4.message}`); - if (issue4.path?.length) - lines.push(` \u2192 at ${toDotPath(issue4.path)}`); + const issues = [...error49.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length); + for (const issue3 of issues) { + lines.push(`\u2716 ${issue3.message}`); + if (issue3.path?.length) + lines.push(` \u2192 at ${toDotPath(issue3.path)}`); } return lines.join("\n"); } @@ -24887,14 +24887,14 @@ function time(args3) { return new RegExp(`^${timeSource(args3)}$`); } function datetime(args3) { - const time5 = timeSource({ precision: args3.precision }); + const time4 = timeSource({ precision: args3.precision }); const opts = ["Z"]; if (args3.local) opts.push(""); if (args3.offset) opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`); - const timeRegex3 = `${time5}(?:${opts.join("|")})`; - return new RegExp(`^${dateSource}T(?:${timeRegex3})$`); + const timeRegex2 = `${time4}(?:${opts.join("|")})`; + return new RegExp(`^${dateSource}T(?:${timeRegex2})$`); } function fixedBase64(bodyLength, padding) { return new RegExp(`^[A-Za-z0-9+/]{${bodyLength}}${padding}$`); @@ -24915,10 +24915,10 @@ var init_regexes = __esm({ duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/; extendedDuration = /^[-+]?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)?)??$/; guid = /^([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})$/; - uuid = (version4) => { - if (!version4) + uuid = (version3) => { + if (!version3) return /^([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)$/; - return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version4}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`); + return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version3}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`); }; uuid4 = /* @__PURE__ */ uuid(4); uuid6 = /* @__PURE__ */ uuid(6); @@ -25601,8 +25601,8 @@ function isValidBase64(data) { function isValidBase64URL(data) { if (!base64url.test(data)) return false; - const base646 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/"); - const padded = base646.padEnd(Math.ceil(base646.length / 4) * 4, "="); + const base645 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/"); + const padded = base645.padEnd(Math.ceil(base645.length / 4) * 4, "="); return isValidBase64(padded); } function isValidJWT2(token, algorithm = null) { @@ -25976,14 +25976,14 @@ var init_schemas = __esm({ }); } else { const runChecks = (payload, checks2, ctx) => { - let isAborted3 = aborted(payload); + let isAborted2 = aborted(payload); let asyncResult; for (const ch of checks2) { if (ch._zod.def.when) { const shouldRun = ch._zod.def.when(payload); if (!shouldRun) continue; - } else if (isAborted3) { + } else if (isAborted2) { continue; } const currLen = payload.issues.length; @@ -25997,15 +25997,15 @@ var init_schemas = __esm({ const nextLen = payload.issues.length; if (nextLen === currLen) return; - if (!isAborted3) - isAborted3 = aborted(payload, currLen); + if (!isAborted2) + isAborted2 = aborted(payload, currLen); }); } else { const nextLen = payload.issues.length; if (nextLen === currLen) continue; - if (!isAborted3) - isAborted3 = aborted(payload, currLen); + if (!isAborted2) + isAborted2 = aborted(payload, currLen); } } if (asyncResult) { @@ -26579,13 +26579,13 @@ var init_schemas = __esm({ } return propValues; }); - const isObject5 = isObject; + const isObject4 = isObject; const catchall = def.catchall; let value2; inst._zod.parse = (payload, ctx) => { value2 ?? (value2 = _normalized.value); const input = payload.value; - if (!isObject5(input)) { + if (!isObject4(input)) { payload.issues.push({ expected: "object", code: "invalid_type", @@ -26683,16 +26683,16 @@ var init_schemas = __esm({ return (payload, ctx) => fn2(shape, payload, ctx); }; let fastpass; - const isObject5 = isObject; + const isObject4 = isObject; const jit = !globalConfig.jitless; - const allowsEval4 = allowsEval; - const fastEnabled = jit && allowsEval4.value; + const allowsEval3 = allowsEval; + const fastEnabled = jit && allowsEval3.value; const catchall = def.catchall; let value2; inst._zod.parse = (payload, ctx) => { value2 ?? (value2 = _normalized.value); const input = payload.value; - if (!isObject5(input)) { + if (!isObject4(input)) { payload.issues.push({ expected: "object", code: "invalid_type", @@ -27622,58 +27622,58 @@ var init_ar = __esm({ const TypeDictionary = { nan: "NaN" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${issue4.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${issue3.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${received}`; } return `\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${stringifyPrimitive(issue4.values[0])}`; - return `\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${stringifyPrimitive(issue3.values[0])}`; + return `\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) - return ` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${issue4.origin ?? "\u0627\u0644\u0642\u064A\u0645\u0629"} ${adj} ${issue4.maximum.toString()} ${sizing.unit ?? "\u0639\u0646\u0635\u0631"}`; - return `\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${issue4.origin ?? "\u0627\u0644\u0642\u064A\u0645\u0629"} ${adj} ${issue4.maximum.toString()}`; + return ` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${issue3.origin ?? "\u0627\u0644\u0642\u064A\u0645\u0629"} ${adj} ${issue3.maximum.toString()} ${sizing.unit ?? "\u0639\u0646\u0635\u0631"}`; + return `\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${issue3.origin ?? "\u0627\u0644\u0642\u064A\u0645\u0629"} ${adj} ${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${issue4.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${adj} ${issue4.minimum.toString()} ${sizing.unit}`; + return `\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${issue3.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${adj} ${issue3.minimum.toString()} ${sizing.unit}`; } - return `\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${issue4.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${adj} ${issue4.minimum.toString()}`; + return `\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${issue3.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${adj} ${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") - return `\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${issue4.prefix}"`; + return `\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${issue3.prefix}"`; if (_issue.format === "ends_with") return `\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${_issue.suffix}"`; if (_issue.format === "includes") return `\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${_issue.includes}"`; if (_issue.format === "regex") return `\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${_issue.pattern}`; - return `${FormatDictionary[_issue.format] ?? issue4.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`; + return `${FormatDictionary[_issue.format] ?? issue3.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`; } case "not_multiple_of": - return `\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${issue4.divisor}`; + return `\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${issue3.divisor}`; case "unrecognized_keys": - return `\u0645\u0639\u0631\u0641${issue4.keys.length > 1 ? "\u0627\u062A" : ""} \u063A\u0631\u064A\u0628${issue4.keys.length > 1 ? "\u0629" : ""}: ${joinValues(issue4.keys, "\u060C ")}`; + return `\u0645\u0639\u0631\u0641${issue3.keys.length > 1 ? "\u0627\u062A" : ""} \u063A\u0631\u064A\u0628${issue3.keys.length > 1 ? "\u0629" : ""}: ${joinValues(issue3.keys, "\u060C ")}`; case "invalid_key": - return `\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${issue4.origin}`; + return `\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${issue3.origin}`; case "invalid_union": return "\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"; case "invalid_element": - return `\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${issue4.origin}`; + return `\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${issue3.origin}`; default: return "\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"; } @@ -27735,37 +27735,37 @@ var init_az = __esm({ const TypeDictionary = { nan: "NaN" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${issue4.expected}, daxil olan ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${issue3.expected}, daxil olan ${received}`; } return `Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${expected}, daxil olan ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${stringifyPrimitive(issue4.values[0])}`; - return `Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${stringifyPrimitive(issue3.values[0])}`; + return `Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) - return `\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${issue4.origin ?? "d\u0259y\u0259r"} ${adj}${issue4.maximum.toString()} ${sizing.unit ?? "element"}`; - return `\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${issue4.origin ?? "d\u0259y\u0259r"} ${adj}${issue4.maximum.toString()}`; + return `\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${issue3.origin ?? "d\u0259y\u0259r"} ${adj}${issue3.maximum.toString()} ${sizing.unit ?? "element"}`; + return `\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${issue3.origin ?? "d\u0259y\u0259r"} ${adj}${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) - return `\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${issue4.origin} ${adj}${issue4.minimum.toString()} ${sizing.unit}`; - return `\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${issue4.origin} ${adj}${issue4.minimum.toString()}`; + return `\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${issue3.origin} ${adj}${issue3.minimum.toString()} ${sizing.unit}`; + return `\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${issue3.origin} ${adj}${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") return `Yanl\u0131\u015F m\u0259tn: "${_issue.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`; if (_issue.format === "ends_with") @@ -27774,18 +27774,18 @@ var init_az = __esm({ return `Yanl\u0131\u015F m\u0259tn: "${_issue.includes}" daxil olmal\u0131d\u0131r`; if (_issue.format === "regex") return `Yanl\u0131\u015F m\u0259tn: ${_issue.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`; - return `Yanl\u0131\u015F ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `Yanl\u0131\u015F ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `Yanl\u0131\u015F \u0259d\u0259d: ${issue4.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`; + return `Yanl\u0131\u015F \u0259d\u0259d: ${issue3.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`; case "unrecognized_keys": - return `Tan\u0131nmayan a\xE7ar${issue4.keys.length > 1 ? "lar" : ""}: ${joinValues(issue4.keys, ", ")}`; + return `Tan\u0131nmayan a\xE7ar${issue3.keys.length > 1 ? "lar" : ""}: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `${issue4.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`; + return `${issue3.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`; case "invalid_union": return "Yanl\u0131\u015F d\u0259y\u0259r"; case "invalid_element": - return `${issue4.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`; + return `${issue3.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`; default: return `Yanl\u0131\u015F d\u0259y\u0259r`; } @@ -27892,43 +27892,43 @@ var init_be = __esm({ number: "\u043B\u0456\u043A", array: "\u043C\u0430\u0441\u0456\u045E" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${issue4.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${issue3.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${received}`; } return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${stringifyPrimitive(issue4.values[0])}`; - return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${stringifyPrimitive(issue3.values[0])}`; + return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) { - const maxValue = Number(issue4.maximum); + const maxValue = Number(issue3.maximum); const unit = getBelarusianPlural(maxValue, sizing.unit.one, sizing.unit.few, sizing.unit.many); - return `\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${issue4.origin ?? "\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${sizing.verb} ${adj}${issue4.maximum.toString()} ${unit}`; + return `\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${issue3.origin ?? "\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${sizing.verb} ${adj}${issue3.maximum.toString()} ${unit}`; } - return `\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${issue4.origin ?? "\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${adj}${issue4.maximum.toString()}`; + return `\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${issue3.origin ?? "\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${adj}${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - const minValue = Number(issue4.minimum); + const minValue = Number(issue3.minimum); const unit = getBelarusianPlural(minValue, sizing.unit.one, sizing.unit.few, sizing.unit.many); - return `\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${issue4.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${sizing.verb} ${adj}${issue4.minimum.toString()} ${unit}`; + return `\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${issue3.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${sizing.verb} ${adj}${issue3.minimum.toString()} ${unit}`; } - return `\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${issue4.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${adj}${issue4.minimum.toString()}`; + return `\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${issue3.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${adj}${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${_issue.prefix}"`; if (_issue.format === "ends_with") @@ -27937,18 +27937,18 @@ var init_be = __esm({ return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${_issue.includes}"`; if (_issue.format === "regex") return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${_issue.pattern}`; - return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${issue4.divisor}`; + return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${issue3.divisor}`; case "unrecognized_keys": - return `\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${issue4.keys.length > 1 ? "\u043A\u043B\u044E\u0447\u044B" : "\u043A\u043B\u044E\u0447"}: ${joinValues(issue4.keys, ", ")}`; + return `\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${issue3.keys.length > 1 ? "\u043A\u043B\u044E\u0447\u044B" : "\u043A\u043B\u044E\u0447"}: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${issue4.origin}`; + return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${issue3.origin}`; case "invalid_union": return "\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"; case "invalid_element": - return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${issue4.origin}`; + return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${issue3.origin}`; default: return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434`; } @@ -28012,38 +28012,38 @@ var init_bg = __esm({ number: "\u0447\u0438\u0441\u043B\u043E", array: "\u043C\u0430\u0441\u0438\u0432" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${issue4.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${issue3.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${received}`; } return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${stringifyPrimitive(issue4.values[0])}`; - return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${stringifyPrimitive(issue3.values[0])}`; + return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) - return `\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${issue4.origin ?? "\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${adj}${issue4.maximum.toString()} ${sizing.unit ?? "\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`; - return `\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${issue4.origin ?? "\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${adj}${issue4.maximum.toString()}`; + return `\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${issue3.origin ?? "\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${adj}${issue3.maximum.toString()} ${sizing.unit ?? "\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`; + return `\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${issue3.origin ?? "\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${adj}${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${issue4.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${adj}${issue4.minimum.toString()} ${sizing.unit}`; + return `\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${issue3.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${adj}${issue3.minimum.toString()} ${sizing.unit}`; } - return `\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${issue4.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${adj}${issue4.minimum.toString()}`; + return `\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${issue3.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${adj}${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") { return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${_issue.prefix}"`; } @@ -28064,18 +28064,18 @@ var init_bg = __esm({ invalid_adj = "\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"; if (_issue.format === "duration") invalid_adj = "\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"; - return `${invalid_adj} ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `${invalid_adj} ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${issue4.divisor}`; + return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${issue3.divisor}`; case "unrecognized_keys": - return `\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${issue4.keys.length > 1 ? "\u0438" : ""} \u043A\u043B\u044E\u0447${issue4.keys.length > 1 ? "\u043E\u0432\u0435" : ""}: ${joinValues(issue4.keys, ", ")}`; + return `\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${issue3.keys.length > 1 ? "\u0438" : ""} \u043A\u043B\u044E\u0447${issue3.keys.length > 1 ? "\u043E\u0432\u0435" : ""}: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${issue4.origin}`; + return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${issue3.origin}`; case "invalid_union": return "\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"; case "invalid_element": - return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${issue4.origin}`; + return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${issue3.origin}`; default: return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434`; } @@ -28137,38 +28137,38 @@ var init_ca = __esm({ const TypeDictionary = { nan: "NaN" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `Tipus inv\xE0lid: s'esperava instanceof ${issue4.expected}, s'ha rebut ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `Tipus inv\xE0lid: s'esperava instanceof ${issue3.expected}, s'ha rebut ${received}`; } return `Tipus inv\xE0lid: s'esperava ${expected}, s'ha rebut ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `Valor inv\xE0lid: s'esperava ${stringifyPrimitive(issue4.values[0])}`; - return `Opci\xF3 inv\xE0lida: s'esperava una de ${joinValues(issue4.values, " o ")}`; + if (issue3.values.length === 1) + return `Valor inv\xE0lid: s'esperava ${stringifyPrimitive(issue3.values[0])}`; + return `Opci\xF3 inv\xE0lida: s'esperava una de ${joinValues(issue3.values, " o ")}`; case "too_big": { - const adj = issue4.inclusive ? "com a m\xE0xim" : "menys de"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "com a m\xE0xim" : "menys de"; + const sizing = getSizing(issue3.origin); if (sizing) - return `Massa gran: s'esperava que ${issue4.origin ?? "el valor"} contingu\xE9s ${adj} ${issue4.maximum.toString()} ${sizing.unit ?? "elements"}`; - return `Massa gran: s'esperava que ${issue4.origin ?? "el valor"} fos ${adj} ${issue4.maximum.toString()}`; + return `Massa gran: s'esperava que ${issue3.origin ?? "el valor"} contingu\xE9s ${adj} ${issue3.maximum.toString()} ${sizing.unit ?? "elements"}`; + return `Massa gran: s'esperava que ${issue3.origin ?? "el valor"} fos ${adj} ${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? "com a m\xEDnim" : "m\xE9s de"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "com a m\xEDnim" : "m\xE9s de"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `Massa petit: s'esperava que ${issue4.origin} contingu\xE9s ${adj} ${issue4.minimum.toString()} ${sizing.unit}`; + return `Massa petit: s'esperava que ${issue3.origin} contingu\xE9s ${adj} ${issue3.minimum.toString()} ${sizing.unit}`; } - return `Massa petit: s'esperava que ${issue4.origin} fos ${adj} ${issue4.minimum.toString()}`; + return `Massa petit: s'esperava que ${issue3.origin} fos ${adj} ${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") { return `Format inv\xE0lid: ha de comen\xE7ar amb "${_issue.prefix}"`; } @@ -28178,19 +28178,19 @@ var init_ca = __esm({ return `Format inv\xE0lid: ha d'incloure "${_issue.includes}"`; if (_issue.format === "regex") return `Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${_issue.pattern}`; - return `Format inv\xE0lid per a ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `Format inv\xE0lid per a ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${issue4.divisor}`; + return `N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${issue3.divisor}`; case "unrecognized_keys": - return `Clau${issue4.keys.length > 1 ? "s" : ""} no reconeguda${issue4.keys.length > 1 ? "s" : ""}: ${joinValues(issue4.keys, ", ")}`; + return `Clau${issue3.keys.length > 1 ? "s" : ""} no reconeguda${issue3.keys.length > 1 ? "s" : ""}: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `Clau inv\xE0lida a ${issue4.origin}`; + return `Clau inv\xE0lida a ${issue3.origin}`; case "invalid_union": return "Entrada inv\xE0lida"; // Could also be "Tipus d'unió invàlid" but "Entrada invàlida" is more general case "invalid_element": - return `Element inv\xE0lid a ${issue4.origin}`; + return `Element inv\xE0lid a ${issue3.origin}`; default: return `Entrada inv\xE0lida`; } @@ -28256,39 +28256,39 @@ var init_cs = __esm({ function: "funkce", array: "pole" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${issue4.expected}, obdr\u017Eeno ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${issue3.expected}, obdr\u017Eeno ${received}`; } return `Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${expected}, obdr\u017Eeno ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${stringifyPrimitive(issue4.values[0])}`; - return `Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${stringifyPrimitive(issue3.values[0])}`; + return `Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${issue4.origin ?? "hodnota"} mus\xED m\xEDt ${adj}${issue4.maximum.toString()} ${sizing.unit ?? "prvk\u016F"}`; + return `Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${issue3.origin ?? "hodnota"} mus\xED m\xEDt ${adj}${issue3.maximum.toString()} ${sizing.unit ?? "prvk\u016F"}`; } - return `Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${issue4.origin ?? "hodnota"} mus\xED b\xFDt ${adj}${issue4.maximum.toString()}`; + return `Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${issue3.origin ?? "hodnota"} mus\xED b\xFDt ${adj}${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${issue4.origin ?? "hodnota"} mus\xED m\xEDt ${adj}${issue4.minimum.toString()} ${sizing.unit ?? "prvk\u016F"}`; + return `Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${issue3.origin ?? "hodnota"} mus\xED m\xEDt ${adj}${issue3.minimum.toString()} ${sizing.unit ?? "prvk\u016F"}`; } - return `Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${issue4.origin ?? "hodnota"} mus\xED b\xFDt ${adj}${issue4.minimum.toString()}`; + return `Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${issue3.origin ?? "hodnota"} mus\xED b\xFDt ${adj}${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") return `Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${_issue.prefix}"`; if (_issue.format === "ends_with") @@ -28297,18 +28297,18 @@ var init_cs = __esm({ return `Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${_issue.includes}"`; if (_issue.format === "regex") return `Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${_issue.pattern}`; - return `Neplatn\xFD form\xE1t ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `Neplatn\xFD form\xE1t ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${issue4.divisor}`; + return `Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${issue3.divisor}`; case "unrecognized_keys": - return `Nezn\xE1m\xE9 kl\xED\u010De: ${joinValues(issue4.keys, ", ")}`; + return `Nezn\xE1m\xE9 kl\xED\u010De: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `Neplatn\xFD kl\xED\u010D v ${issue4.origin}`; + return `Neplatn\xFD kl\xED\u010D v ${issue3.origin}`; case "invalid_union": return "Neplatn\xFD vstup"; case "invalid_element": - return `Neplatn\xE1 hodnota v ${issue4.origin}`; + return `Neplatn\xE1 hodnota v ${issue3.origin}`; default: return `Neplatn\xFD vstup`; } @@ -28377,40 +28377,40 @@ var init_da = __esm({ set: "s\xE6t", file: "fil" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `Ugyldigt input: forventede instanceof ${issue4.expected}, fik ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `Ugyldigt input: forventede instanceof ${issue3.expected}, fik ${received}`; } return `Ugyldigt input: forventede ${expected}, fik ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `Ugyldig v\xE6rdi: forventede ${stringifyPrimitive(issue4.values[0])}`; - return `Ugyldigt valg: forventede en af f\xF8lgende ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `Ugyldig v\xE6rdi: forventede ${stringifyPrimitive(issue3.values[0])}`; + return `Ugyldigt valg: forventede en af f\xF8lgende ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); - const origin = TypeDictionary[issue4.origin] ?? issue4.origin; + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); + const origin = TypeDictionary[issue3.origin] ?? issue3.origin; if (sizing) - return `For stor: forventede ${origin ?? "value"} ${sizing.verb} ${adj} ${issue4.maximum.toString()} ${sizing.unit ?? "elementer"}`; - return `For stor: forventede ${origin ?? "value"} havde ${adj} ${issue4.maximum.toString()}`; + return `For stor: forventede ${origin ?? "value"} ${sizing.verb} ${adj} ${issue3.maximum.toString()} ${sizing.unit ?? "elementer"}`; + return `For stor: forventede ${origin ?? "value"} havde ${adj} ${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); - const origin = TypeDictionary[issue4.origin] ?? issue4.origin; + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); + const origin = TypeDictionary[issue3.origin] ?? issue3.origin; if (sizing) { - return `For lille: forventede ${origin} ${sizing.verb} ${adj} ${issue4.minimum.toString()} ${sizing.unit}`; + return `For lille: forventede ${origin} ${sizing.verb} ${adj} ${issue3.minimum.toString()} ${sizing.unit}`; } - return `For lille: forventede ${origin} havde ${adj} ${issue4.minimum.toString()}`; + return `For lille: forventede ${origin} havde ${adj} ${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") return `Ugyldig streng: skal starte med "${_issue.prefix}"`; if (_issue.format === "ends_with") @@ -28419,18 +28419,18 @@ var init_da = __esm({ return `Ugyldig streng: skal indeholde "${_issue.includes}"`; if (_issue.format === "regex") return `Ugyldig streng: skal matche m\xF8nsteret ${_issue.pattern}`; - return `Ugyldig ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `Ugyldig ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `Ugyldigt tal: skal v\xE6re deleligt med ${issue4.divisor}`; + return `Ugyldigt tal: skal v\xE6re deleligt med ${issue3.divisor}`; case "unrecognized_keys": - return `${issue4.keys.length > 1 ? "Ukendte n\xF8gler" : "Ukendt n\xF8gle"}: ${joinValues(issue4.keys, ", ")}`; + return `${issue3.keys.length > 1 ? "Ukendte n\xF8gler" : "Ukendt n\xF8gle"}: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `Ugyldig n\xF8gle i ${issue4.origin}`; + return `Ugyldig n\xF8gle i ${issue3.origin}`; case "invalid_union": return "Ugyldigt input: matcher ingen af de tilladte typer"; case "invalid_element": - return `Ugyldig v\xE6rdi i ${issue4.origin}`; + return `Ugyldig v\xE6rdi i ${issue3.origin}`; default: return `Ugyldigt input`; } @@ -28494,38 +28494,38 @@ var init_de = __esm({ number: "Zahl", array: "Array" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `Ung\xFCltige Eingabe: erwartet instanceof ${issue4.expected}, erhalten ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `Ung\xFCltige Eingabe: erwartet instanceof ${issue3.expected}, erhalten ${received}`; } return `Ung\xFCltige Eingabe: erwartet ${expected}, erhalten ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `Ung\xFCltige Eingabe: erwartet ${stringifyPrimitive(issue4.values[0])}`; - return `Ung\xFCltige Option: erwartet eine von ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `Ung\xFCltige Eingabe: erwartet ${stringifyPrimitive(issue3.values[0])}`; + return `Ung\xFCltige Option: erwartet eine von ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) - return `Zu gro\xDF: erwartet, dass ${issue4.origin ?? "Wert"} ${adj}${issue4.maximum.toString()} ${sizing.unit ?? "Elemente"} hat`; - return `Zu gro\xDF: erwartet, dass ${issue4.origin ?? "Wert"} ${adj}${issue4.maximum.toString()} ist`; + return `Zu gro\xDF: erwartet, dass ${issue3.origin ?? "Wert"} ${adj}${issue3.maximum.toString()} ${sizing.unit ?? "Elemente"} hat`; + return `Zu gro\xDF: erwartet, dass ${issue3.origin ?? "Wert"} ${adj}${issue3.maximum.toString()} ist`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `Zu klein: erwartet, dass ${issue4.origin} ${adj}${issue4.minimum.toString()} ${sizing.unit} hat`; + return `Zu klein: erwartet, dass ${issue3.origin} ${adj}${issue3.minimum.toString()} ${sizing.unit} hat`; } - return `Zu klein: erwartet, dass ${issue4.origin} ${adj}${issue4.minimum.toString()} ist`; + return `Zu klein: erwartet, dass ${issue3.origin} ${adj}${issue3.minimum.toString()} ist`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") return `Ung\xFCltiger String: muss mit "${_issue.prefix}" beginnen`; if (_issue.format === "ends_with") @@ -28534,18 +28534,18 @@ var init_de = __esm({ return `Ung\xFCltiger String: muss "${_issue.includes}" enthalten`; if (_issue.format === "regex") return `Ung\xFCltiger String: muss dem Muster ${_issue.pattern} entsprechen`; - return `Ung\xFCltig: ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `Ung\xFCltig: ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `Ung\xFCltige Zahl: muss ein Vielfaches von ${issue4.divisor} sein`; + return `Ung\xFCltige Zahl: muss ein Vielfaches von ${issue3.divisor} sein`; case "unrecognized_keys": - return `${issue4.keys.length > 1 ? "Unbekannte Schl\xFCssel" : "Unbekannter Schl\xFCssel"}: ${joinValues(issue4.keys, ", ")}`; + return `${issue3.keys.length > 1 ? "Unbekannte Schl\xFCssel" : "Unbekannter Schl\xFCssel"}: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `Ung\xFCltiger Schl\xFCssel in ${issue4.origin}`; + return `Ung\xFCltiger Schl\xFCssel in ${issue3.origin}`; case "invalid_union": return "Ung\xFCltige Eingabe"; case "invalid_element": - return `Ung\xFCltiger Wert in ${issue4.origin}`; + return `Ung\xFCltiger Wert in ${issue3.origin}`; default: return `Ung\xFCltige Eingabe`; } @@ -28611,35 +28611,35 @@ var init_en2 = __esm({ nan: "NaN" // All other type names omitted - they fall back to raw values via ?? operator }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; return `Invalid input: expected ${expected}, received ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `Invalid input: expected ${stringifyPrimitive(issue4.values[0])}`; - return `Invalid option: expected one of ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `Invalid input: expected ${stringifyPrimitive(issue3.values[0])}`; + return `Invalid option: expected one of ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) - return `Too big: expected ${issue4.origin ?? "value"} to have ${adj}${issue4.maximum.toString()} ${sizing.unit ?? "elements"}`; - return `Too big: expected ${issue4.origin ?? "value"} to be ${adj}${issue4.maximum.toString()}`; + return `Too big: expected ${issue3.origin ?? "value"} to have ${adj}${issue3.maximum.toString()} ${sizing.unit ?? "elements"}`; + return `Too big: expected ${issue3.origin ?? "value"} to be ${adj}${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `Too small: expected ${issue4.origin} to have ${adj}${issue4.minimum.toString()} ${sizing.unit}`; + return `Too small: expected ${issue3.origin} to have ${adj}${issue3.minimum.toString()} ${sizing.unit}`; } - return `Too small: expected ${issue4.origin} to be ${adj}${issue4.minimum.toString()}`; + return `Too small: expected ${issue3.origin} to be ${adj}${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") { return `Invalid string: must start with "${_issue.prefix}"`; } @@ -28649,18 +28649,18 @@ var init_en2 = __esm({ return `Invalid string: must include "${_issue.includes}"`; if (_issue.format === "regex") return `Invalid string: must match pattern ${_issue.pattern}`; - return `Invalid ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `Invalid ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `Invalid number: must be a multiple of ${issue4.divisor}`; + return `Invalid number: must be a multiple of ${issue3.divisor}`; case "unrecognized_keys": - return `Unrecognized key${issue4.keys.length > 1 ? "s" : ""}: ${joinValues(issue4.keys, ", ")}`; + return `Unrecognized key${issue3.keys.length > 1 ? "s" : ""}: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `Invalid key in ${issue4.origin}`; + return `Invalid key in ${issue3.origin}`; case "invalid_union": return "Invalid input"; case "invalid_element": - return `Invalid value in ${issue4.origin}`; + return `Invalid value in ${issue3.origin}`; default: return `Invalid input`; } @@ -28725,38 +28725,38 @@ var init_eo = __esm({ array: "tabelo", null: "senvalora" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `Nevalida enigo: atendi\u011Dis instanceof ${issue4.expected}, ricevi\u011Dis ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `Nevalida enigo: atendi\u011Dis instanceof ${issue3.expected}, ricevi\u011Dis ${received}`; } return `Nevalida enigo: atendi\u011Dis ${expected}, ricevi\u011Dis ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `Nevalida enigo: atendi\u011Dis ${stringifyPrimitive(issue4.values[0])}`; - return `Nevalida opcio: atendi\u011Dis unu el ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `Nevalida enigo: atendi\u011Dis ${stringifyPrimitive(issue3.values[0])}`; + return `Nevalida opcio: atendi\u011Dis unu el ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) - return `Tro granda: atendi\u011Dis ke ${issue4.origin ?? "valoro"} havu ${adj}${issue4.maximum.toString()} ${sizing.unit ?? "elementojn"}`; - return `Tro granda: atendi\u011Dis ke ${issue4.origin ?? "valoro"} havu ${adj}${issue4.maximum.toString()}`; + return `Tro granda: atendi\u011Dis ke ${issue3.origin ?? "valoro"} havu ${adj}${issue3.maximum.toString()} ${sizing.unit ?? "elementojn"}`; + return `Tro granda: atendi\u011Dis ke ${issue3.origin ?? "valoro"} havu ${adj}${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `Tro malgranda: atendi\u011Dis ke ${issue4.origin} havu ${adj}${issue4.minimum.toString()} ${sizing.unit}`; + return `Tro malgranda: atendi\u011Dis ke ${issue3.origin} havu ${adj}${issue3.minimum.toString()} ${sizing.unit}`; } - return `Tro malgranda: atendi\u011Dis ke ${issue4.origin} estu ${adj}${issue4.minimum.toString()}`; + return `Tro malgranda: atendi\u011Dis ke ${issue3.origin} estu ${adj}${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") return `Nevalida karaktraro: devas komenci\u011Di per "${_issue.prefix}"`; if (_issue.format === "ends_with") @@ -28765,18 +28765,18 @@ var init_eo = __esm({ return `Nevalida karaktraro: devas inkluzivi "${_issue.includes}"`; if (_issue.format === "regex") return `Nevalida karaktraro: devas kongrui kun la modelo ${_issue.pattern}`; - return `Nevalida ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `Nevalida ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `Nevalida nombro: devas esti oblo de ${issue4.divisor}`; + return `Nevalida nombro: devas esti oblo de ${issue3.divisor}`; case "unrecognized_keys": - return `Nekonata${issue4.keys.length > 1 ? "j" : ""} \u015Dlosilo${issue4.keys.length > 1 ? "j" : ""}: ${joinValues(issue4.keys, ", ")}`; + return `Nekonata${issue3.keys.length > 1 ? "j" : ""} \u015Dlosilo${issue3.keys.length > 1 ? "j" : ""}: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `Nevalida \u015Dlosilo en ${issue4.origin}`; + return `Nevalida \u015Dlosilo en ${issue3.origin}`; case "invalid_union": return "Nevalida enigo"; case "invalid_element": - return `Nevalida valoro en ${issue4.origin}`; + return `Nevalida valoro en ${issue3.origin}`; default: return `Nevalida enigo`; } @@ -28862,40 +28862,40 @@ var init_es = __esm({ unknown: "desconocido", any: "cualquiera" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `Entrada inv\xE1lida: se esperaba instanceof ${issue4.expected}, recibido ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `Entrada inv\xE1lida: se esperaba instanceof ${issue3.expected}, recibido ${received}`; } return `Entrada inv\xE1lida: se esperaba ${expected}, recibido ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `Entrada inv\xE1lida: se esperaba ${stringifyPrimitive(issue4.values[0])}`; - return `Opci\xF3n inv\xE1lida: se esperaba una de ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `Entrada inv\xE1lida: se esperaba ${stringifyPrimitive(issue3.values[0])}`; + return `Opci\xF3n inv\xE1lida: se esperaba una de ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); - const origin = TypeDictionary[issue4.origin] ?? issue4.origin; + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); + const origin = TypeDictionary[issue3.origin] ?? issue3.origin; if (sizing) - return `Demasiado grande: se esperaba que ${origin ?? "valor"} tuviera ${adj}${issue4.maximum.toString()} ${sizing.unit ?? "elementos"}`; - return `Demasiado grande: se esperaba que ${origin ?? "valor"} fuera ${adj}${issue4.maximum.toString()}`; + return `Demasiado grande: se esperaba que ${origin ?? "valor"} tuviera ${adj}${issue3.maximum.toString()} ${sizing.unit ?? "elementos"}`; + return `Demasiado grande: se esperaba que ${origin ?? "valor"} fuera ${adj}${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); - const origin = TypeDictionary[issue4.origin] ?? issue4.origin; + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); + const origin = TypeDictionary[issue3.origin] ?? issue3.origin; if (sizing) { - return `Demasiado peque\xF1o: se esperaba que ${origin} tuviera ${adj}${issue4.minimum.toString()} ${sizing.unit}`; + return `Demasiado peque\xF1o: se esperaba que ${origin} tuviera ${adj}${issue3.minimum.toString()} ${sizing.unit}`; } - return `Demasiado peque\xF1o: se esperaba que ${origin} fuera ${adj}${issue4.minimum.toString()}`; + return `Demasiado peque\xF1o: se esperaba que ${origin} fuera ${adj}${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") return `Cadena inv\xE1lida: debe comenzar con "${_issue.prefix}"`; if (_issue.format === "ends_with") @@ -28904,18 +28904,18 @@ var init_es = __esm({ return `Cadena inv\xE1lida: debe incluir "${_issue.includes}"`; if (_issue.format === "regex") return `Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${_issue.pattern}`; - return `Inv\xE1lido ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `Inv\xE1lido ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${issue4.divisor}`; + return `N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${issue3.divisor}`; case "unrecognized_keys": - return `Llave${issue4.keys.length > 1 ? "s" : ""} desconocida${issue4.keys.length > 1 ? "s" : ""}: ${joinValues(issue4.keys, ", ")}`; + return `Llave${issue3.keys.length > 1 ? "s" : ""} desconocida${issue3.keys.length > 1 ? "s" : ""}: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `Llave inv\xE1lida en ${TypeDictionary[issue4.origin] ?? issue4.origin}`; + return `Llave inv\xE1lida en ${TypeDictionary[issue3.origin] ?? issue3.origin}`; case "invalid_union": return "Entrada inv\xE1lida"; case "invalid_element": - return `Valor inv\xE1lido en ${TypeDictionary[issue4.origin] ?? issue4.origin}`; + return `Valor inv\xE1lido en ${TypeDictionary[issue3.origin] ?? issue3.origin}`; default: return `Entrada inv\xE1lida`; } @@ -28979,40 +28979,40 @@ var init_fa = __esm({ number: "\u0639\u062F\u062F", array: "\u0622\u0631\u0627\u06CC\u0647" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${issue4.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${received} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`; + if (/^[A-Z]/.test(issue3.expected)) { + return `\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${issue3.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${received} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`; } return `\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${received} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`; } case "invalid_value": - if (issue4.values.length === 1) { - return `\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${stringifyPrimitive(issue4.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`; + if (issue3.values.length === 1) { + return `\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${stringifyPrimitive(issue3.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`; } - return `\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${joinValues(issue4.values, "|")} \u0645\u06CC\u200C\u0628\u0648\u062F`; + return `\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${joinValues(issue3.values, "|")} \u0645\u06CC\u200C\u0628\u0648\u062F`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${issue4.origin ?? "\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${adj}${issue4.maximum.toString()} ${sizing.unit ?? "\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`; + return `\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${issue3.origin ?? "\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${adj}${issue3.maximum.toString()} ${sizing.unit ?? "\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`; } - return `\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${issue4.origin ?? "\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${adj}${issue4.maximum.toString()} \u0628\u0627\u0634\u062F`; + return `\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${issue3.origin ?? "\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${adj}${issue3.maximum.toString()} \u0628\u0627\u0634\u062F`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${issue4.origin} \u0628\u0627\u06CC\u062F ${adj}${issue4.minimum.toString()} ${sizing.unit} \u0628\u0627\u0634\u062F`; + return `\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${issue3.origin} \u0628\u0627\u06CC\u062F ${adj}${issue3.minimum.toString()} ${sizing.unit} \u0628\u0627\u0634\u062F`; } - return `\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${issue4.origin} \u0628\u0627\u06CC\u062F ${adj}${issue4.minimum.toString()} \u0628\u0627\u0634\u062F`; + return `\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${issue3.origin} \u0628\u0627\u06CC\u062F ${adj}${issue3.minimum.toString()} \u0628\u0627\u0634\u062F`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") { return `\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${_issue.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`; } @@ -29025,18 +29025,18 @@ var init_fa = __esm({ if (_issue.format === "regex") { return `\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${_issue.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`; } - return `${FormatDictionary[_issue.format] ?? issue4.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`; + return `${FormatDictionary[_issue.format] ?? issue3.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`; } case "not_multiple_of": - return `\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${issue4.divisor} \u0628\u0627\u0634\u062F`; + return `\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${issue3.divisor} \u0628\u0627\u0634\u062F`; case "unrecognized_keys": - return `\u06A9\u0644\u06CC\u062F${issue4.keys.length > 1 ? "\u0647\u0627\u06CC" : ""} \u0646\u0627\u0634\u0646\u0627\u0633: ${joinValues(issue4.keys, ", ")}`; + return `\u06A9\u0644\u06CC\u062F${issue3.keys.length > 1 ? "\u0647\u0627\u06CC" : ""} \u0646\u0627\u0634\u0646\u0627\u0633: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${issue4.origin}`; + return `\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${issue3.origin}`; case "invalid_union": return `\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631`; case "invalid_element": - return `\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${issue4.origin}`; + return `\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${issue3.origin}`; default: return `\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631`; } @@ -29102,39 +29102,39 @@ var init_fi = __esm({ const TypeDictionary = { nan: "NaN" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `Virheellinen tyyppi: odotettiin instanceof ${issue4.expected}, oli ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `Virheellinen tyyppi: odotettiin instanceof ${issue3.expected}, oli ${received}`; } return `Virheellinen tyyppi: odotettiin ${expected}, oli ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `Virheellinen sy\xF6te: t\xE4ytyy olla ${stringifyPrimitive(issue4.values[0])}`; - return `Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `Virheellinen sy\xF6te: t\xE4ytyy olla ${stringifyPrimitive(issue3.values[0])}`; + return `Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `Liian suuri: ${sizing.subject} t\xE4ytyy olla ${adj}${issue4.maximum.toString()} ${sizing.unit}`.trim(); + return `Liian suuri: ${sizing.subject} t\xE4ytyy olla ${adj}${issue3.maximum.toString()} ${sizing.unit}`.trim(); } - return `Liian suuri: arvon t\xE4ytyy olla ${adj}${issue4.maximum.toString()}`; + return `Liian suuri: arvon t\xE4ytyy olla ${adj}${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `Liian pieni: ${sizing.subject} t\xE4ytyy olla ${adj}${issue4.minimum.toString()} ${sizing.unit}`.trim(); + return `Liian pieni: ${sizing.subject} t\xE4ytyy olla ${adj}${issue3.minimum.toString()} ${sizing.unit}`.trim(); } - return `Liian pieni: arvon t\xE4ytyy olla ${adj}${issue4.minimum.toString()}`; + return `Liian pieni: arvon t\xE4ytyy olla ${adj}${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") return `Virheellinen sy\xF6te: t\xE4ytyy alkaa "${_issue.prefix}"`; if (_issue.format === "ends_with") @@ -29144,12 +29144,12 @@ var init_fi = __esm({ if (_issue.format === "regex") { return `Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${_issue.pattern}`; } - return `Virheellinen ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `Virheellinen ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `Virheellinen luku: t\xE4ytyy olla luvun ${issue4.divisor} monikerta`; + return `Virheellinen luku: t\xE4ytyy olla luvun ${issue3.divisor} monikerta`; case "unrecognized_keys": - return `${issue4.keys.length > 1 ? "Tuntemattomat avaimet" : "Tuntematon avain"}: ${joinValues(issue4.keys, ", ")}`; + return `${issue3.keys.length > 1 ? "Tuntemattomat avaimet" : "Tuntematon avain"}: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": return "Virheellinen avain tietueessa"; case "invalid_union": @@ -29219,38 +29219,38 @@ var init_fr = __esm({ number: "nombre", array: "tableau" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `Entr\xE9e invalide : instanceof ${issue4.expected} attendu, ${received} re\xE7u`; + if (/^[A-Z]/.test(issue3.expected)) { + return `Entr\xE9e invalide : instanceof ${issue3.expected} attendu, ${received} re\xE7u`; } return `Entr\xE9e invalide : ${expected} attendu, ${received} re\xE7u`; } case "invalid_value": - if (issue4.values.length === 1) - return `Entr\xE9e invalide : ${stringifyPrimitive(issue4.values[0])} attendu`; - return `Option invalide : une valeur parmi ${joinValues(issue4.values, "|")} attendue`; + if (issue3.values.length === 1) + return `Entr\xE9e invalide : ${stringifyPrimitive(issue3.values[0])} attendu`; + return `Option invalide : une valeur parmi ${joinValues(issue3.values, "|")} attendue`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) - return `Trop grand : ${issue4.origin ?? "valeur"} doit ${sizing.verb} ${adj}${issue4.maximum.toString()} ${sizing.unit ?? "\xE9l\xE9ment(s)"}`; - return `Trop grand : ${issue4.origin ?? "valeur"} doit \xEAtre ${adj}${issue4.maximum.toString()}`; + return `Trop grand : ${issue3.origin ?? "valeur"} doit ${sizing.verb} ${adj}${issue3.maximum.toString()} ${sizing.unit ?? "\xE9l\xE9ment(s)"}`; + return `Trop grand : ${issue3.origin ?? "valeur"} doit \xEAtre ${adj}${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `Trop petit : ${issue4.origin} doit ${sizing.verb} ${adj}${issue4.minimum.toString()} ${sizing.unit}`; + return `Trop petit : ${issue3.origin} doit ${sizing.verb} ${adj}${issue3.minimum.toString()} ${sizing.unit}`; } - return `Trop petit : ${issue4.origin} doit \xEAtre ${adj}${issue4.minimum.toString()}`; + return `Trop petit : ${issue3.origin} doit \xEAtre ${adj}${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") return `Cha\xEEne invalide : doit commencer par "${_issue.prefix}"`; if (_issue.format === "ends_with") @@ -29259,18 +29259,18 @@ var init_fr = __esm({ return `Cha\xEEne invalide : doit inclure "${_issue.includes}"`; if (_issue.format === "regex") return `Cha\xEEne invalide : doit correspondre au mod\xE8le ${_issue.pattern}`; - return `${FormatDictionary[_issue.format] ?? issue4.format} invalide`; + return `${FormatDictionary[_issue.format] ?? issue3.format} invalide`; } case "not_multiple_of": - return `Nombre invalide : doit \xEAtre un multiple de ${issue4.divisor}`; + return `Nombre invalide : doit \xEAtre un multiple de ${issue3.divisor}`; case "unrecognized_keys": - return `Cl\xE9${issue4.keys.length > 1 ? "s" : ""} non reconnue${issue4.keys.length > 1 ? "s" : ""} : ${joinValues(issue4.keys, ", ")}`; + return `Cl\xE9${issue3.keys.length > 1 ? "s" : ""} non reconnue${issue3.keys.length > 1 ? "s" : ""} : ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `Cl\xE9 invalide dans ${issue4.origin}`; + return `Cl\xE9 invalide dans ${issue3.origin}`; case "invalid_union": return "Entr\xE9e invalide"; case "invalid_element": - return `Valeur invalide dans ${issue4.origin}`; + return `Valeur invalide dans ${issue3.origin}`; default: return `Entr\xE9e invalide`; } @@ -29332,38 +29332,38 @@ var init_fr_CA = __esm({ const TypeDictionary = { nan: "NaN" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `Entr\xE9e invalide : attendu instanceof ${issue4.expected}, re\xE7u ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `Entr\xE9e invalide : attendu instanceof ${issue3.expected}, re\xE7u ${received}`; } return `Entr\xE9e invalide : attendu ${expected}, re\xE7u ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `Entr\xE9e invalide : attendu ${stringifyPrimitive(issue4.values[0])}`; - return `Option invalide : attendu l'une des valeurs suivantes ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `Entr\xE9e invalide : attendu ${stringifyPrimitive(issue3.values[0])}`; + return `Option invalide : attendu l'une des valeurs suivantes ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "\u2264" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "\u2264" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) - return `Trop grand : attendu que ${issue4.origin ?? "la valeur"} ait ${adj}${issue4.maximum.toString()} ${sizing.unit}`; - return `Trop grand : attendu que ${issue4.origin ?? "la valeur"} soit ${adj}${issue4.maximum.toString()}`; + return `Trop grand : attendu que ${issue3.origin ?? "la valeur"} ait ${adj}${issue3.maximum.toString()} ${sizing.unit}`; + return `Trop grand : attendu que ${issue3.origin ?? "la valeur"} soit ${adj}${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? "\u2265" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "\u2265" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `Trop petit : attendu que ${issue4.origin} ait ${adj}${issue4.minimum.toString()} ${sizing.unit}`; + return `Trop petit : attendu que ${issue3.origin} ait ${adj}${issue3.minimum.toString()} ${sizing.unit}`; } - return `Trop petit : attendu que ${issue4.origin} soit ${adj}${issue4.minimum.toString()}`; + return `Trop petit : attendu que ${issue3.origin} soit ${adj}${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") { return `Cha\xEEne invalide : doit commencer par "${_issue.prefix}"`; } @@ -29373,18 +29373,18 @@ var init_fr_CA = __esm({ return `Cha\xEEne invalide : doit inclure "${_issue.includes}"`; if (_issue.format === "regex") return `Cha\xEEne invalide : doit correspondre au motif ${_issue.pattern}`; - return `${FormatDictionary[_issue.format] ?? issue4.format} invalide`; + return `${FormatDictionary[_issue.format] ?? issue3.format} invalide`; } case "not_multiple_of": - return `Nombre invalide : doit \xEAtre un multiple de ${issue4.divisor}`; + return `Nombre invalide : doit \xEAtre un multiple de ${issue3.divisor}`; case "unrecognized_keys": - return `Cl\xE9${issue4.keys.length > 1 ? "s" : ""} non reconnue${issue4.keys.length > 1 ? "s" : ""} : ${joinValues(issue4.keys, ", ")}`; + return `Cl\xE9${issue3.keys.length > 1 ? "s" : ""} non reconnue${issue3.keys.length > 1 ? "s" : ""} : ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `Cl\xE9 invalide dans ${issue4.origin}`; + return `Cl\xE9 invalide dans ${issue3.origin}`; case "invalid_union": return "Entr\xE9e invalide"; case "invalid_element": - return `Valeur invalide dans ${issue4.origin}`; + return `Valeur invalide dans ${issue3.origin}`; default: return `Entr\xE9e invalide`; } @@ -29485,24 +29485,24 @@ var init_he = __esm({ const TypeDictionary = { nan: "NaN" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expectedKey = issue4.expected; + const expectedKey = issue3.expected; const expected = TypeDictionary[expectedKey ?? ""] ?? typeLabel(expectedKey); - const receivedType = parsedType(issue4.input); + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? TypeNames[receivedType]?.label ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${issue4.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${issue3.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${received}`; } return `\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${received}`; } case "invalid_value": { - if (issue4.values.length === 1) { - return `\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${stringifyPrimitive(issue4.values[0])}`; + if (issue3.values.length === 1) { + return `\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${stringifyPrimitive(issue3.values[0])}`; } - const stringified = issue4.values.map((v) => stringifyPrimitive(v)); - if (issue4.values.length === 2) { + const stringified = issue3.values.map((v) => stringifyPrimitive(v)); + if (issue3.values.length === 2) { return `\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${stringified[0]} \u05D0\u05D5 ${stringified[1]}`; } const lastValue = stringified[stringified.length - 1]; @@ -29510,55 +29510,55 @@ var init_he = __esm({ return `\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${restValues} \u05D0\u05D5 ${lastValue}`; } case "too_big": { - const sizing = getSizing(issue4.origin); - const subject = withDefinite(issue4.origin ?? "value"); - if (issue4.origin === "string") { - return `${sizing?.longLabel ?? "\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${subject} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${issue4.maximum.toString()} ${sizing?.unit ?? ""} ${issue4.inclusive ? "\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA" : "\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim(); + const sizing = getSizing(issue3.origin); + const subject = withDefinite(issue3.origin ?? "value"); + if (issue3.origin === "string") { + return `${sizing?.longLabel ?? "\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${subject} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${issue3.maximum.toString()} ${sizing?.unit ?? ""} ${issue3.inclusive ? "\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA" : "\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim(); } - if (issue4.origin === "number") { - const comparison = issue4.inclusive ? `\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${issue4.maximum}` : `\u05E7\u05D8\u05DF \u05DE-${issue4.maximum}`; + if (issue3.origin === "number") { + const comparison = issue3.inclusive ? `\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${issue3.maximum}` : `\u05E7\u05D8\u05DF \u05DE-${issue3.maximum}`; return `\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${subject} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${comparison}`; } - if (issue4.origin === "array" || issue4.origin === "set") { - const verb = issue4.origin === "set" ? "\u05E6\u05E8\u05D9\u05DB\u05D4" : "\u05E6\u05E8\u05D9\u05DA"; - const comparison = issue4.inclusive ? `${issue4.maximum} ${sizing?.unit ?? ""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA` : `\u05E4\u05D7\u05D5\u05EA \u05DE-${issue4.maximum} ${sizing?.unit ?? ""}`; + if (issue3.origin === "array" || issue3.origin === "set") { + const verb = issue3.origin === "set" ? "\u05E6\u05E8\u05D9\u05DB\u05D4" : "\u05E6\u05E8\u05D9\u05DA"; + const comparison = issue3.inclusive ? `${issue3.maximum} ${sizing?.unit ?? ""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA` : `\u05E4\u05D7\u05D5\u05EA \u05DE-${issue3.maximum} ${sizing?.unit ?? ""}`; return `\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${subject} ${verb} \u05DC\u05D4\u05DB\u05D9\u05DC ${comparison}`.trim(); } - const adj = issue4.inclusive ? "<=" : "<"; - const be = verbFor(issue4.origin ?? "value"); + const adj = issue3.inclusive ? "<=" : "<"; + const be = verbFor(issue3.origin ?? "value"); if (sizing?.unit) { - return `${sizing.longLabel} \u05DE\u05D3\u05D9: ${subject} ${be} ${adj}${issue4.maximum.toString()} ${sizing.unit}`; + return `${sizing.longLabel} \u05DE\u05D3\u05D9: ${subject} ${be} ${adj}${issue3.maximum.toString()} ${sizing.unit}`; } - return `${sizing?.longLabel ?? "\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${subject} ${be} ${adj}${issue4.maximum.toString()}`; + return `${sizing?.longLabel ?? "\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${subject} ${be} ${adj}${issue3.maximum.toString()}`; } case "too_small": { - const sizing = getSizing(issue4.origin); - const subject = withDefinite(issue4.origin ?? "value"); - if (issue4.origin === "string") { - return `${sizing?.shortLabel ?? "\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${subject} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${issue4.minimum.toString()} ${sizing?.unit ?? ""} ${issue4.inclusive ? "\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8" : "\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim(); + const sizing = getSizing(issue3.origin); + const subject = withDefinite(issue3.origin ?? "value"); + if (issue3.origin === "string") { + return `${sizing?.shortLabel ?? "\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${subject} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${issue3.minimum.toString()} ${sizing?.unit ?? ""} ${issue3.inclusive ? "\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8" : "\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim(); } - if (issue4.origin === "number") { - const comparison = issue4.inclusive ? `\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${issue4.minimum}` : `\u05D2\u05D3\u05D5\u05DC \u05DE-${issue4.minimum}`; + if (issue3.origin === "number") { + const comparison = issue3.inclusive ? `\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${issue3.minimum}` : `\u05D2\u05D3\u05D5\u05DC \u05DE-${issue3.minimum}`; return `\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${subject} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${comparison}`; } - if (issue4.origin === "array" || issue4.origin === "set") { - const verb = issue4.origin === "set" ? "\u05E6\u05E8\u05D9\u05DB\u05D4" : "\u05E6\u05E8\u05D9\u05DA"; - if (issue4.minimum === 1 && issue4.inclusive) { - const singularPhrase = issue4.origin === "set" ? "\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3" : "\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3"; + if (issue3.origin === "array" || issue3.origin === "set") { + const verb = issue3.origin === "set" ? "\u05E6\u05E8\u05D9\u05DB\u05D4" : "\u05E6\u05E8\u05D9\u05DA"; + if (issue3.minimum === 1 && issue3.inclusive) { + const singularPhrase = issue3.origin === "set" ? "\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3" : "\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3"; return `\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${subject} ${verb} \u05DC\u05D4\u05DB\u05D9\u05DC ${singularPhrase}`; } - const comparison = issue4.inclusive ? `${issue4.minimum} ${sizing?.unit ?? ""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8` : `\u05D9\u05D5\u05EA\u05E8 \u05DE-${issue4.minimum} ${sizing?.unit ?? ""}`; + const comparison = issue3.inclusive ? `${issue3.minimum} ${sizing?.unit ?? ""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8` : `\u05D9\u05D5\u05EA\u05E8 \u05DE-${issue3.minimum} ${sizing?.unit ?? ""}`; return `\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${subject} ${verb} \u05DC\u05D4\u05DB\u05D9\u05DC ${comparison}`.trim(); } - const adj = issue4.inclusive ? ">=" : ">"; - const be = verbFor(issue4.origin ?? "value"); + const adj = issue3.inclusive ? ">=" : ">"; + const be = verbFor(issue3.origin ?? "value"); if (sizing?.unit) { - return `${sizing.shortLabel} \u05DE\u05D3\u05D9: ${subject} ${be} ${adj}${issue4.minimum.toString()} ${sizing.unit}`; + return `${sizing.shortLabel} \u05DE\u05D3\u05D9: ${subject} ${be} ${adj}${issue3.minimum.toString()} ${sizing.unit}`; } - return `${sizing?.shortLabel ?? "\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${subject} ${be} ${adj}${issue4.minimum.toString()}`; + return `${sizing?.shortLabel ?? "\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${subject} ${be} ${adj}${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") return `\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${_issue.prefix}"`; if (_issue.format === "ends_with") @@ -29574,16 +29574,16 @@ var init_he = __esm({ return `${noun} \u05DC\u05D0 ${adjective}`; } case "not_multiple_of": - return `\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${issue4.divisor}`; + return `\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${issue3.divisor}`; case "unrecognized_keys": - return `\u05DE\u05E4\u05EA\u05D7${issue4.keys.length > 1 ? "\u05D5\u05EA" : ""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${issue4.keys.length > 1 ? "\u05D9\u05DD" : "\u05D4"}: ${joinValues(issue4.keys, ", ")}`; + return `\u05DE\u05E4\u05EA\u05D7${issue3.keys.length > 1 ? "\u05D5\u05EA" : ""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${issue3.keys.length > 1 ? "\u05D9\u05DD" : "\u05D4"}: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": { return `\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8`; } case "invalid_union": return "\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"; case "invalid_element": { - const place = withDefinite(issue4.origin ?? "array"); + const place = withDefinite(issue3.origin ?? "array"); return `\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${place}`; } default: @@ -29649,38 +29649,38 @@ var init_hu = __esm({ number: "sz\xE1m", array: "t\xF6mb" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${issue4.expected}, a kapott \xE9rt\xE9k ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${issue3.expected}, a kapott \xE9rt\xE9k ${received}`; } return `\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${expected}, a kapott \xE9rt\xE9k ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${stringifyPrimitive(issue4.values[0])}`; - return `\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${stringifyPrimitive(issue3.values[0])}`; + return `\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) - return `T\xFAl nagy: ${issue4.origin ?? "\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${adj}${issue4.maximum.toString()} ${sizing.unit ?? "elem"}`; - return `T\xFAl nagy: a bemeneti \xE9rt\xE9k ${issue4.origin ?? "\xE9rt\xE9k"} t\xFAl nagy: ${adj}${issue4.maximum.toString()}`; + return `T\xFAl nagy: ${issue3.origin ?? "\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${adj}${issue3.maximum.toString()} ${sizing.unit ?? "elem"}`; + return `T\xFAl nagy: a bemeneti \xE9rt\xE9k ${issue3.origin ?? "\xE9rt\xE9k"} t\xFAl nagy: ${adj}${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${issue4.origin} m\xE9rete t\xFAl kicsi ${adj}${issue4.minimum.toString()} ${sizing.unit}`; + return `T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${issue3.origin} m\xE9rete t\xFAl kicsi ${adj}${issue3.minimum.toString()} ${sizing.unit}`; } - return `T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${issue4.origin} t\xFAl kicsi ${adj}${issue4.minimum.toString()}`; + return `T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${issue3.origin} t\xFAl kicsi ${adj}${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") return `\xC9rv\xE9nytelen string: "${_issue.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`; if (_issue.format === "ends_with") @@ -29689,18 +29689,18 @@ var init_hu = __esm({ return `\xC9rv\xE9nytelen string: "${_issue.includes}" \xE9rt\xE9ket kell tartalmaznia`; if (_issue.format === "regex") return `\xC9rv\xE9nytelen string: ${_issue.pattern} mint\xE1nak kell megfelelnie`; - return `\xC9rv\xE9nytelen ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `\xC9rv\xE9nytelen ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `\xC9rv\xE9nytelen sz\xE1m: ${issue4.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`; + return `\xC9rv\xE9nytelen sz\xE1m: ${issue3.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`; case "unrecognized_keys": - return `Ismeretlen kulcs${issue4.keys.length > 1 ? "s" : ""}: ${joinValues(issue4.keys, ", ")}`; + return `Ismeretlen kulcs${issue3.keys.length > 1 ? "s" : ""}: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `\xC9rv\xE9nytelen kulcs ${issue4.origin}`; + return `\xC9rv\xE9nytelen kulcs ${issue3.origin}`; case "invalid_union": return "\xC9rv\xE9nytelen bemenet"; case "invalid_element": - return `\xC9rv\xE9nytelen \xE9rt\xE9k: ${issue4.origin}`; + return `\xC9rv\xE9nytelen \xE9rt\xE9k: ${issue3.origin}`; default: return `\xC9rv\xE9nytelen bemenet`; } @@ -29798,43 +29798,43 @@ var init_hy = __esm({ number: "\u0569\u056B\u057E", array: "\u0566\u0561\u0576\u0563\u057E\u0561\u056E" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${issue4.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${issue3.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${received}`; } return `\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${stringifyPrimitive(issue4.values[1])}`; - return `\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${stringifyPrimitive(issue3.values[1])}`; + return `\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) { - const maxValue = Number(issue4.maximum); + const maxValue = Number(issue3.maximum); const unit = getArmenianPlural(maxValue, sizing.unit.one, sizing.unit.many); - return `\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${withDefiniteArticle(issue4.origin ?? "\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${adj}${issue4.maximum.toString()} ${unit}`; + return `\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${withDefiniteArticle(issue3.origin ?? "\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${adj}${issue3.maximum.toString()} ${unit}`; } - return `\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${withDefiniteArticle(issue4.origin ?? "\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${adj}${issue4.maximum.toString()}`; + return `\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${withDefiniteArticle(issue3.origin ?? "\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${adj}${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - const minValue = Number(issue4.minimum); + const minValue = Number(issue3.minimum); const unit = getArmenianPlural(minValue, sizing.unit.one, sizing.unit.many); - return `\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${withDefiniteArticle(issue4.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${adj}${issue4.minimum.toString()} ${unit}`; + return `\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${withDefiniteArticle(issue3.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${adj}${issue3.minimum.toString()} ${unit}`; } - return `\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${withDefiniteArticle(issue4.origin)} \u056C\u056B\u0576\u056B ${adj}${issue4.minimum.toString()}`; + return `\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${withDefiniteArticle(issue3.origin)} \u056C\u056B\u0576\u056B ${adj}${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") return `\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${_issue.prefix}"-\u0578\u057E`; if (_issue.format === "ends_with") @@ -29843,18 +29843,18 @@ var init_hy = __esm({ return `\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${_issue.includes}"`; if (_issue.format === "regex") return `\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${_issue.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`; - return `\u054D\u056D\u0561\u056C ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `\u054D\u056D\u0561\u056C ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${issue4.divisor}-\u056B`; + return `\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${issue3.divisor}-\u056B`; case "unrecognized_keys": - return `\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${issue4.keys.length > 1 ? "\u0576\u0565\u0580" : ""}. ${joinValues(issue4.keys, ", ")}`; + return `\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${issue3.keys.length > 1 ? "\u0576\u0565\u0580" : ""}. ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${withDefiniteArticle(issue4.origin)}-\u0578\u0582\u0574`; + return `\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${withDefiniteArticle(issue3.origin)}-\u0578\u0582\u0574`; case "invalid_union": return "\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"; case "invalid_element": - return `\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${withDefiniteArticle(issue4.origin)}-\u0578\u0582\u0574`; + return `\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${withDefiniteArticle(issue3.origin)}-\u0578\u0582\u0574`; default: return `\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574`; } @@ -29916,38 +29916,38 @@ var init_id = __esm({ const TypeDictionary = { nan: "NaN" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `Input tidak valid: diharapkan instanceof ${issue4.expected}, diterima ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `Input tidak valid: diharapkan instanceof ${issue3.expected}, diterima ${received}`; } return `Input tidak valid: diharapkan ${expected}, diterima ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `Input tidak valid: diharapkan ${stringifyPrimitive(issue4.values[0])}`; - return `Pilihan tidak valid: diharapkan salah satu dari ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `Input tidak valid: diharapkan ${stringifyPrimitive(issue3.values[0])}`; + return `Pilihan tidak valid: diharapkan salah satu dari ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) - return `Terlalu besar: diharapkan ${issue4.origin ?? "value"} memiliki ${adj}${issue4.maximum.toString()} ${sizing.unit ?? "elemen"}`; - return `Terlalu besar: diharapkan ${issue4.origin ?? "value"} menjadi ${adj}${issue4.maximum.toString()}`; + return `Terlalu besar: diharapkan ${issue3.origin ?? "value"} memiliki ${adj}${issue3.maximum.toString()} ${sizing.unit ?? "elemen"}`; + return `Terlalu besar: diharapkan ${issue3.origin ?? "value"} menjadi ${adj}${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `Terlalu kecil: diharapkan ${issue4.origin} memiliki ${adj}${issue4.minimum.toString()} ${sizing.unit}`; + return `Terlalu kecil: diharapkan ${issue3.origin} memiliki ${adj}${issue3.minimum.toString()} ${sizing.unit}`; } - return `Terlalu kecil: diharapkan ${issue4.origin} menjadi ${adj}${issue4.minimum.toString()}`; + return `Terlalu kecil: diharapkan ${issue3.origin} menjadi ${adj}${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") return `String tidak valid: harus dimulai dengan "${_issue.prefix}"`; if (_issue.format === "ends_with") @@ -29956,18 +29956,18 @@ var init_id = __esm({ return `String tidak valid: harus menyertakan "${_issue.includes}"`; if (_issue.format === "regex") return `String tidak valid: harus sesuai pola ${_issue.pattern}`; - return `${FormatDictionary[_issue.format] ?? issue4.format} tidak valid`; + return `${FormatDictionary[_issue.format] ?? issue3.format} tidak valid`; } case "not_multiple_of": - return `Angka tidak valid: harus kelipatan dari ${issue4.divisor}`; + return `Angka tidak valid: harus kelipatan dari ${issue3.divisor}`; case "unrecognized_keys": - return `Kunci tidak dikenali ${issue4.keys.length > 1 ? "s" : ""}: ${joinValues(issue4.keys, ", ")}`; + return `Kunci tidak dikenali ${issue3.keys.length > 1 ? "s" : ""}: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `Kunci tidak valid di ${issue4.origin}`; + return `Kunci tidak valid di ${issue3.origin}`; case "invalid_union": return "Input tidak valid"; case "invalid_element": - return `Nilai tidak valid di ${issue4.origin}`; + return `Nilai tidak valid di ${issue3.origin}`; default: return `Input tidak valid`; } @@ -30031,38 +30031,38 @@ var init_is = __esm({ number: "n\xFAmer", array: "fylki" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `Rangt gildi: \xDE\xFA sl\xF3st inn ${received} \xFEar sem \xE1 a\xF0 vera instanceof ${issue4.expected}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `Rangt gildi: \xDE\xFA sl\xF3st inn ${received} \xFEar sem \xE1 a\xF0 vera instanceof ${issue3.expected}`; } return `Rangt gildi: \xDE\xFA sl\xF3st inn ${received} \xFEar sem \xE1 a\xF0 vera ${expected}`; } case "invalid_value": - if (issue4.values.length === 1) - return `Rangt gildi: gert r\xE1\xF0 fyrir ${stringifyPrimitive(issue4.values[0])}`; - return `\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `Rangt gildi: gert r\xE1\xF0 fyrir ${stringifyPrimitive(issue3.values[0])}`; + return `\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) - return `Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${issue4.origin ?? "gildi"} hafi ${adj}${issue4.maximum.toString()} ${sizing.unit ?? "hluti"}`; - return `Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${issue4.origin ?? "gildi"} s\xE9 ${adj}${issue4.maximum.toString()}`; + return `Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${issue3.origin ?? "gildi"} hafi ${adj}${issue3.maximum.toString()} ${sizing.unit ?? "hluti"}`; + return `Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${issue3.origin ?? "gildi"} s\xE9 ${adj}${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${issue4.origin} hafi ${adj}${issue4.minimum.toString()} ${sizing.unit}`; + return `Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${issue3.origin} hafi ${adj}${issue3.minimum.toString()} ${sizing.unit}`; } - return `Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${issue4.origin} s\xE9 ${adj}${issue4.minimum.toString()}`; + return `Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${issue3.origin} s\xE9 ${adj}${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") { return `\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${_issue.prefix}"`; } @@ -30072,18 +30072,18 @@ var init_is = __esm({ return `\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${_issue.includes}"`; if (_issue.format === "regex") return `\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${_issue.pattern}`; - return `Rangt ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `Rangt ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${issue4.divisor}`; + return `R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${issue3.divisor}`; case "unrecognized_keys": - return `\xD3\xFEekkt ${issue4.keys.length > 1 ? "ir lyklar" : "ur lykill"}: ${joinValues(issue4.keys, ", ")}`; + return `\xD3\xFEekkt ${issue3.keys.length > 1 ? "ir lyklar" : "ur lykill"}: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `Rangur lykill \xED ${issue4.origin}`; + return `Rangur lykill \xED ${issue3.origin}`; case "invalid_union": return "Rangt gildi"; case "invalid_element": - return `Rangt gildi \xED ${issue4.origin}`; + return `Rangt gildi \xED ${issue3.origin}`; default: return `Rangt gildi`; } @@ -30147,38 +30147,38 @@ var init_it = __esm({ number: "numero", array: "vettore" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `Input non valido: atteso instanceof ${issue4.expected}, ricevuto ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `Input non valido: atteso instanceof ${issue3.expected}, ricevuto ${received}`; } return `Input non valido: atteso ${expected}, ricevuto ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `Input non valido: atteso ${stringifyPrimitive(issue4.values[0])}`; - return `Opzione non valida: atteso uno tra ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `Input non valido: atteso ${stringifyPrimitive(issue3.values[0])}`; + return `Opzione non valida: atteso uno tra ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) - return `Troppo grande: ${issue4.origin ?? "valore"} deve avere ${adj}${issue4.maximum.toString()} ${sizing.unit ?? "elementi"}`; - return `Troppo grande: ${issue4.origin ?? "valore"} deve essere ${adj}${issue4.maximum.toString()}`; + return `Troppo grande: ${issue3.origin ?? "valore"} deve avere ${adj}${issue3.maximum.toString()} ${sizing.unit ?? "elementi"}`; + return `Troppo grande: ${issue3.origin ?? "valore"} deve essere ${adj}${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `Troppo piccolo: ${issue4.origin} deve avere ${adj}${issue4.minimum.toString()} ${sizing.unit}`; + return `Troppo piccolo: ${issue3.origin} deve avere ${adj}${issue3.minimum.toString()} ${sizing.unit}`; } - return `Troppo piccolo: ${issue4.origin} deve essere ${adj}${issue4.minimum.toString()}`; + return `Troppo piccolo: ${issue3.origin} deve essere ${adj}${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") return `Stringa non valida: deve iniziare con "${_issue.prefix}"`; if (_issue.format === "ends_with") @@ -30187,18 +30187,18 @@ var init_it = __esm({ return `Stringa non valida: deve includere "${_issue.includes}"`; if (_issue.format === "regex") return `Stringa non valida: deve corrispondere al pattern ${_issue.pattern}`; - return `Invalid ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `Invalid ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `Numero non valido: deve essere un multiplo di ${issue4.divisor}`; + return `Numero non valido: deve essere un multiplo di ${issue3.divisor}`; case "unrecognized_keys": - return `Chiav${issue4.keys.length > 1 ? "i" : "e"} non riconosciut${issue4.keys.length > 1 ? "e" : "a"}: ${joinValues(issue4.keys, ", ")}`; + return `Chiav${issue3.keys.length > 1 ? "i" : "e"} non riconosciut${issue3.keys.length > 1 ? "e" : "a"}: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `Chiave non valida in ${issue4.origin}`; + return `Chiave non valida in ${issue3.origin}`; case "invalid_union": return "Input non valido"; case "invalid_element": - return `Valore non valido in ${issue4.origin}`; + return `Valore non valido in ${issue3.origin}`; default: return `Input non valido`; } @@ -30262,37 +30262,37 @@ var init_ja = __esm({ number: "\u6570\u5024", array: "\u914D\u5217" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `\u7121\u52B9\u306A\u5165\u529B: instanceof ${issue4.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${received}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`; + if (/^[A-Z]/.test(issue3.expected)) { + return `\u7121\u52B9\u306A\u5165\u529B: instanceof ${issue3.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${received}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`; } return `\u7121\u52B9\u306A\u5165\u529B: ${expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${received}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`; } case "invalid_value": - if (issue4.values.length === 1) - return `\u7121\u52B9\u306A\u5165\u529B: ${stringifyPrimitive(issue4.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`; - return `\u7121\u52B9\u306A\u9078\u629E: ${joinValues(issue4.values, "\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`; + if (issue3.values.length === 1) + return `\u7121\u52B9\u306A\u5165\u529B: ${stringifyPrimitive(issue3.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`; + return `\u7121\u52B9\u306A\u9078\u629E: ${joinValues(issue3.values, "\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`; case "too_big": { - const adj = issue4.inclusive ? "\u4EE5\u4E0B\u3067\u3042\u308B" : "\u3088\u308A\u5C0F\u3055\u3044"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "\u4EE5\u4E0B\u3067\u3042\u308B" : "\u3088\u308A\u5C0F\u3055\u3044"; + const sizing = getSizing(issue3.origin); if (sizing) - return `\u5927\u304D\u3059\u304E\u308B\u5024: ${issue4.origin ?? "\u5024"}\u306F${issue4.maximum.toString()}${sizing.unit ?? "\u8981\u7D20"}${adj}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`; - return `\u5927\u304D\u3059\u304E\u308B\u5024: ${issue4.origin ?? "\u5024"}\u306F${issue4.maximum.toString()}${adj}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`; + return `\u5927\u304D\u3059\u304E\u308B\u5024: ${issue3.origin ?? "\u5024"}\u306F${issue3.maximum.toString()}${sizing.unit ?? "\u8981\u7D20"}${adj}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`; + return `\u5927\u304D\u3059\u304E\u308B\u5024: ${issue3.origin ?? "\u5024"}\u306F${issue3.maximum.toString()}${adj}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`; } case "too_small": { - const adj = issue4.inclusive ? "\u4EE5\u4E0A\u3067\u3042\u308B" : "\u3088\u308A\u5927\u304D\u3044"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "\u4EE5\u4E0A\u3067\u3042\u308B" : "\u3088\u308A\u5927\u304D\u3044"; + const sizing = getSizing(issue3.origin); if (sizing) - return `\u5C0F\u3055\u3059\u304E\u308B\u5024: ${issue4.origin}\u306F${issue4.minimum.toString()}${sizing.unit}${adj}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`; - return `\u5C0F\u3055\u3059\u304E\u308B\u5024: ${issue4.origin}\u306F${issue4.minimum.toString()}${adj}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`; + return `\u5C0F\u3055\u3059\u304E\u308B\u5024: ${issue3.origin}\u306F${issue3.minimum.toString()}${sizing.unit}${adj}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`; + return `\u5C0F\u3055\u3059\u304E\u308B\u5024: ${issue3.origin}\u306F${issue3.minimum.toString()}${adj}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") return `\u7121\u52B9\u306A\u6587\u5B57\u5217: "${_issue.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`; if (_issue.format === "ends_with") @@ -30301,18 +30301,18 @@ var init_ja = __esm({ return `\u7121\u52B9\u306A\u6587\u5B57\u5217: "${_issue.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`; if (_issue.format === "regex") return `\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${_issue.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`; - return `\u7121\u52B9\u306A${FormatDictionary[_issue.format] ?? issue4.format}`; + return `\u7121\u52B9\u306A${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `\u7121\u52B9\u306A\u6570\u5024: ${issue4.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`; + return `\u7121\u52B9\u306A\u6570\u5024: ${issue3.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`; case "unrecognized_keys": - return `\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${issue4.keys.length > 1 ? "\u7FA4" : ""}: ${joinValues(issue4.keys, "\u3001")}`; + return `\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${issue3.keys.length > 1 ? "\u7FA4" : ""}: ${joinValues(issue3.keys, "\u3001")}`; case "invalid_key": - return `${issue4.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`; + return `${issue3.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`; case "invalid_union": return "\u7121\u52B9\u306A\u5165\u529B"; case "invalid_element": - return `${issue4.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`; + return `${issue3.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`; default: return `\u7121\u52B9\u306A\u5165\u529B`; } @@ -30379,38 +30379,38 @@ var init_ka = __esm({ function: "\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0", array: "\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${issue4.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${issue3.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${received}`; } return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${stringifyPrimitive(issue4.values[0])}`; - return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${joinValues(issue4.values, "|")}-\u10D3\u10D0\u10DC`; + if (issue3.values.length === 1) + return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${stringifyPrimitive(issue3.values[0])}`; + return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${joinValues(issue3.values, "|")}-\u10D3\u10D0\u10DC`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) - return `\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${issue4.origin ?? "\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${sizing.verb} ${adj}${issue4.maximum.toString()} ${sizing.unit}`; - return `\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${issue4.origin ?? "\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${adj}${issue4.maximum.toString()}`; + return `\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${issue3.origin ?? "\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${sizing.verb} ${adj}${issue3.maximum.toString()} ${sizing.unit}`; + return `\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${issue3.origin ?? "\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${adj}${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${issue4.origin} ${sizing.verb} ${adj}${issue4.minimum.toString()} ${sizing.unit}`; + return `\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${issue3.origin} ${sizing.verb} ${adj}${issue3.minimum.toString()} ${sizing.unit}`; } - return `\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${issue4.origin} \u10D8\u10E7\u10DD\u10E1 ${adj}${issue4.minimum.toString()}`; + return `\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${issue3.origin} \u10D8\u10E7\u10DD\u10E1 ${adj}${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") { return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${_issue.prefix}"-\u10D8\u10D7`; } @@ -30420,18 +30420,18 @@ var init_ka = __esm({ return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${_issue.includes}"-\u10E1`; if (_issue.format === "regex") return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${_issue.pattern}`; - return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${issue4.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`; + return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${issue3.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`; case "unrecognized_keys": - return `\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${issue4.keys.length > 1 ? "\u10D4\u10D1\u10D8" : "\u10D8"}: ${joinValues(issue4.keys, ", ")}`; + return `\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${issue3.keys.length > 1 ? "\u10D4\u10D1\u10D8" : "\u10D8"}: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${issue4.origin}-\u10E8\u10D8`; + return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${issue3.origin}-\u10E8\u10D8`; case "invalid_union": return "\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"; case "invalid_element": - return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${issue4.origin}-\u10E8\u10D8`; + return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${issue3.origin}-\u10E8\u10D8`; default: return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0`; } @@ -30496,38 +30496,38 @@ var init_km = __esm({ array: "\u17A2\u17B6\u179A\u17C1 (Array)", null: "\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${issue4.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${issue3.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${received}`; } return `\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${stringifyPrimitive(issue4.values[0])}`; - return `\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${stringifyPrimitive(issue3.values[0])}`; + return `\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) - return `\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${issue4.origin ?? "\u178F\u1798\u17D2\u179B\u17C3"} ${adj} ${issue4.maximum.toString()} ${sizing.unit ?? "\u1792\u17B6\u178F\u17BB"}`; - return `\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${issue4.origin ?? "\u178F\u1798\u17D2\u179B\u17C3"} ${adj} ${issue4.maximum.toString()}`; + return `\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${issue3.origin ?? "\u178F\u1798\u17D2\u179B\u17C3"} ${adj} ${issue3.maximum.toString()} ${sizing.unit ?? "\u1792\u17B6\u178F\u17BB"}`; + return `\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${issue3.origin ?? "\u178F\u1798\u17D2\u179B\u17C3"} ${adj} ${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${issue4.origin} ${adj} ${issue4.minimum.toString()} ${sizing.unit}`; + return `\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${issue3.origin} ${adj} ${issue3.minimum.toString()} ${sizing.unit}`; } - return `\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${issue4.origin} ${adj} ${issue4.minimum.toString()}`; + return `\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${issue3.origin} ${adj} ${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") { return `\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${_issue.prefix}"`; } @@ -30537,18 +30537,18 @@ var init_km = __esm({ return `\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${_issue.includes}"`; if (_issue.format === "regex") return `\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${_issue.pattern}`; - return `\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${issue4.divisor}`; + return `\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${issue3.divisor}`; case "unrecognized_keys": - return `\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${joinValues(issue4.keys, ", ")}`; + return `\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${issue4.origin}`; + return `\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${issue3.origin}`; case "invalid_union": return `\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C`; case "invalid_element": - return `\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${issue4.origin}`; + return `\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${issue3.origin}`; default: return `\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C`; } @@ -30620,42 +30620,42 @@ var init_ko = __esm({ const TypeDictionary = { nan: "NaN" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${issue4.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${received}\uC785\uB2C8\uB2E4`; + if (/^[A-Z]/.test(issue3.expected)) { + return `\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${issue3.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${received}\uC785\uB2C8\uB2E4`; } return `\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${received}\uC785\uB2C8\uB2E4`; } case "invalid_value": - if (issue4.values.length === 1) - return `\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${stringifyPrimitive(issue4.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`; - return `\uC798\uBABB\uB41C \uC635\uC158: ${joinValues(issue4.values, "\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`; + if (issue3.values.length === 1) + return `\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${stringifyPrimitive(issue3.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`; + return `\uC798\uBABB\uB41C \uC635\uC158: ${joinValues(issue3.values, "\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`; case "too_big": { - const adj = issue4.inclusive ? "\uC774\uD558" : "\uBBF8\uB9CC"; + const adj = issue3.inclusive ? "\uC774\uD558" : "\uBBF8\uB9CC"; const suffix2 = adj === "\uBBF8\uB9CC" ? "\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4" : "\uC5EC\uC57C \uD569\uB2C8\uB2E4"; - const sizing = getSizing(issue4.origin); + const sizing = getSizing(issue3.origin); const unit = sizing?.unit ?? "\uC694\uC18C"; if (sizing) - return `${issue4.origin ?? "\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${issue4.maximum.toString()}${unit} ${adj}${suffix2}`; - return `${issue4.origin ?? "\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${issue4.maximum.toString()} ${adj}${suffix2}`; + return `${issue3.origin ?? "\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${issue3.maximum.toString()}${unit} ${adj}${suffix2}`; + return `${issue3.origin ?? "\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${issue3.maximum.toString()} ${adj}${suffix2}`; } case "too_small": { - const adj = issue4.inclusive ? "\uC774\uC0C1" : "\uCD08\uACFC"; + const adj = issue3.inclusive ? "\uC774\uC0C1" : "\uCD08\uACFC"; const suffix2 = adj === "\uC774\uC0C1" ? "\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4" : "\uC5EC\uC57C \uD569\uB2C8\uB2E4"; - const sizing = getSizing(issue4.origin); + const sizing = getSizing(issue3.origin); const unit = sizing?.unit ?? "\uC694\uC18C"; if (sizing) { - return `${issue4.origin ?? "\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${issue4.minimum.toString()}${unit} ${adj}${suffix2}`; + return `${issue3.origin ?? "\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${issue3.minimum.toString()}${unit} ${adj}${suffix2}`; } - return `${issue4.origin ?? "\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${issue4.minimum.toString()} ${adj}${suffix2}`; + return `${issue3.origin ?? "\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${issue3.minimum.toString()} ${adj}${suffix2}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") { return `\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${_issue.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`; } @@ -30665,18 +30665,18 @@ var init_ko = __esm({ return `\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${_issue.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`; if (_issue.format === "regex") return `\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${_issue.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`; - return `\uC798\uBABB\uB41C ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `\uC798\uBABB\uB41C ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `\uC798\uBABB\uB41C \uC22B\uC790: ${issue4.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`; + return `\uC798\uBABB\uB41C \uC22B\uC790: ${issue3.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`; case "unrecognized_keys": - return `\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${joinValues(issue4.keys, ", ")}`; + return `\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `\uC798\uBABB\uB41C \uD0A4: ${issue4.origin}`; + return `\uC798\uBABB\uB41C \uD0A4: ${issue3.origin}`; case "invalid_union": return `\uC798\uBABB\uB41C \uC785\uB825`; case "invalid_element": - return `\uC798\uBABB\uB41C \uAC12: ${issue4.origin}`; + return `\uC798\uBABB\uB41C \uAC12: ${issue3.origin}`; default: return `\uC798\uBABB\uB41C \uC785\uB825`; } @@ -30686,8 +30686,8 @@ var init_ko = __esm({ }); // node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/locales/lt.js -function getUnitTypeFromNumber(number8) { - const abs = Math.abs(number8); +function getUnitTypeFromNumber(number7) { + const abs = Math.abs(number7); const last = abs % 10; const last2 = abs % 100; if (last2 >= 11 && last2 <= 19 || last === 0) @@ -30831,39 +30831,39 @@ var init_lt = __esm({ object: "objektas", null: "nulin\u0117 reik\u0161m\u0117" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `Gautas tipas ${received}, o tik\u0117tasi - instanceof ${issue4.expected}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `Gautas tipas ${received}, o tik\u0117tasi - instanceof ${issue3.expected}`; } return `Gautas tipas ${received}, o tik\u0117tasi - ${expected}`; } case "invalid_value": - if (issue4.values.length === 1) - return `Privalo b\u016Bti ${stringifyPrimitive(issue4.values[0])}`; - return `Privalo b\u016Bti vienas i\u0161 ${joinValues(issue4.values, "|")} pasirinkim\u0173`; + if (issue3.values.length === 1) + return `Privalo b\u016Bti ${stringifyPrimitive(issue3.values[0])}`; + return `Privalo b\u016Bti vienas i\u0161 ${joinValues(issue3.values, "|")} pasirinkim\u0173`; case "too_big": { - const origin = TypeDictionary[issue4.origin] ?? issue4.origin; - const sizing = getSizing(issue4.origin, getUnitTypeFromNumber(Number(issue4.maximum)), issue4.inclusive ?? false, "smaller"); + const origin = TypeDictionary[issue3.origin] ?? issue3.origin; + const sizing = getSizing(issue3.origin, getUnitTypeFromNumber(Number(issue3.maximum)), issue3.inclusive ?? false, "smaller"); if (sizing?.verb) - return `${capitalizeFirstCharacter(origin ?? issue4.origin ?? "reik\u0161m\u0117")} ${sizing.verb} ${issue4.maximum.toString()} ${sizing.unit ?? "element\u0173"}`; - const adj = issue4.inclusive ? "ne didesnis kaip" : "ma\u017Eesnis kaip"; - return `${capitalizeFirstCharacter(origin ?? issue4.origin ?? "reik\u0161m\u0117")} turi b\u016Bti ${adj} ${issue4.maximum.toString()} ${sizing?.unit}`; + return `${capitalizeFirstCharacter(origin ?? issue3.origin ?? "reik\u0161m\u0117")} ${sizing.verb} ${issue3.maximum.toString()} ${sizing.unit ?? "element\u0173"}`; + const adj = issue3.inclusive ? "ne didesnis kaip" : "ma\u017Eesnis kaip"; + return `${capitalizeFirstCharacter(origin ?? issue3.origin ?? "reik\u0161m\u0117")} turi b\u016Bti ${adj} ${issue3.maximum.toString()} ${sizing?.unit}`; } case "too_small": { - const origin = TypeDictionary[issue4.origin] ?? issue4.origin; - const sizing = getSizing(issue4.origin, getUnitTypeFromNumber(Number(issue4.minimum)), issue4.inclusive ?? false, "bigger"); + const origin = TypeDictionary[issue3.origin] ?? issue3.origin; + const sizing = getSizing(issue3.origin, getUnitTypeFromNumber(Number(issue3.minimum)), issue3.inclusive ?? false, "bigger"); if (sizing?.verb) - return `${capitalizeFirstCharacter(origin ?? issue4.origin ?? "reik\u0161m\u0117")} ${sizing.verb} ${issue4.minimum.toString()} ${sizing.unit ?? "element\u0173"}`; - const adj = issue4.inclusive ? "ne ma\u017Eesnis kaip" : "didesnis kaip"; - return `${capitalizeFirstCharacter(origin ?? issue4.origin ?? "reik\u0161m\u0117")} turi b\u016Bti ${adj} ${issue4.minimum.toString()} ${sizing?.unit}`; + return `${capitalizeFirstCharacter(origin ?? issue3.origin ?? "reik\u0161m\u0117")} ${sizing.verb} ${issue3.minimum.toString()} ${sizing.unit ?? "element\u0173"}`; + const adj = issue3.inclusive ? "ne ma\u017Eesnis kaip" : "didesnis kaip"; + return `${capitalizeFirstCharacter(origin ?? issue3.origin ?? "reik\u0161m\u0117")} turi b\u016Bti ${adj} ${issue3.minimum.toString()} ${sizing?.unit}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") { return `Eilut\u0117 privalo prasid\u0117ti "${_issue.prefix}"`; } @@ -30873,19 +30873,19 @@ var init_lt = __esm({ return `Eilut\u0117 privalo \u012Ftraukti "${_issue.includes}"`; if (_issue.format === "regex") return `Eilut\u0117 privalo atitikti ${_issue.pattern}`; - return `Neteisingas ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `Neteisingas ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `Skai\u010Dius privalo b\u016Bti ${issue4.divisor} kartotinis.`; + return `Skai\u010Dius privalo b\u016Bti ${issue3.divisor} kartotinis.`; case "unrecognized_keys": - return `Neatpa\u017Eint${issue4.keys.length > 1 ? "i" : "as"} rakt${issue4.keys.length > 1 ? "ai" : "as"}: ${joinValues(issue4.keys, ", ")}`; + return `Neatpa\u017Eint${issue3.keys.length > 1 ? "i" : "as"} rakt${issue3.keys.length > 1 ? "ai" : "as"}: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": return "Rastas klaidingas raktas"; case "invalid_union": return "Klaidinga \u012Fvestis"; case "invalid_element": { - const origin = TypeDictionary[issue4.origin] ?? issue4.origin; - return `${capitalizeFirstCharacter(origin ?? issue4.origin ?? "reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`; + const origin = TypeDictionary[issue3.origin] ?? issue3.origin; + return `${capitalizeFirstCharacter(origin ?? issue3.origin ?? "reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`; } default: return "Klaidinga \u012Fvestis"; @@ -30950,38 +30950,38 @@ var init_mk = __esm({ number: "\u0431\u0440\u043E\u0458", array: "\u043D\u0438\u0437\u0430" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${issue4.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${issue3.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${received}`; } return `\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `Invalid input: expected ${stringifyPrimitive(issue4.values[0])}`; - return `\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `Invalid input: expected ${stringifyPrimitive(issue3.values[0])}`; + return `\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) - return `\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${issue4.origin ?? "\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${adj}${issue4.maximum.toString()} ${sizing.unit ?? "\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`; - return `\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${issue4.origin ?? "\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${adj}${issue4.maximum.toString()}`; + return `\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${issue3.origin ?? "\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${adj}${issue3.maximum.toString()} ${sizing.unit ?? "\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`; + return `\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${issue3.origin ?? "\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${adj}${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${issue4.origin} \u0434\u0430 \u0438\u043C\u0430 ${adj}${issue4.minimum.toString()} ${sizing.unit}`; + return `\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${issue3.origin} \u0434\u0430 \u0438\u043C\u0430 ${adj}${issue3.minimum.toString()} ${sizing.unit}`; } - return `\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${issue4.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${adj}${issue4.minimum.toString()}`; + return `\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${issue3.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${adj}${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") { return `\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${_issue.prefix}"`; } @@ -30991,18 +30991,18 @@ var init_mk = __esm({ return `\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${_issue.includes}"`; if (_issue.format === "regex") return `\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${_issue.pattern}`; - return `Invalid ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `Invalid ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${issue4.divisor}`; + return `\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${issue3.divisor}`; case "unrecognized_keys": - return `${issue4.keys.length > 1 ? "\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438" : "\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${joinValues(issue4.keys, ", ")}`; + return `${issue3.keys.length > 1 ? "\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438" : "\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${issue4.origin}`; + return `\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${issue3.origin}`; case "invalid_union": return "\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"; case "invalid_element": - return `\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${issue4.origin}`; + return `\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${issue3.origin}`; default: return `\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441`; } @@ -31065,38 +31065,38 @@ var init_ms = __esm({ nan: "NaN", number: "nombor" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `Input tidak sah: dijangka instanceof ${issue4.expected}, diterima ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `Input tidak sah: dijangka instanceof ${issue3.expected}, diterima ${received}`; } return `Input tidak sah: dijangka ${expected}, diterima ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `Input tidak sah: dijangka ${stringifyPrimitive(issue4.values[0])}`; - return `Pilihan tidak sah: dijangka salah satu daripada ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `Input tidak sah: dijangka ${stringifyPrimitive(issue3.values[0])}`; + return `Pilihan tidak sah: dijangka salah satu daripada ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) - return `Terlalu besar: dijangka ${issue4.origin ?? "nilai"} ${sizing.verb} ${adj}${issue4.maximum.toString()} ${sizing.unit ?? "elemen"}`; - return `Terlalu besar: dijangka ${issue4.origin ?? "nilai"} adalah ${adj}${issue4.maximum.toString()}`; + return `Terlalu besar: dijangka ${issue3.origin ?? "nilai"} ${sizing.verb} ${adj}${issue3.maximum.toString()} ${sizing.unit ?? "elemen"}`; + return `Terlalu besar: dijangka ${issue3.origin ?? "nilai"} adalah ${adj}${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `Terlalu kecil: dijangka ${issue4.origin} ${sizing.verb} ${adj}${issue4.minimum.toString()} ${sizing.unit}`; + return `Terlalu kecil: dijangka ${issue3.origin} ${sizing.verb} ${adj}${issue3.minimum.toString()} ${sizing.unit}`; } - return `Terlalu kecil: dijangka ${issue4.origin} adalah ${adj}${issue4.minimum.toString()}`; + return `Terlalu kecil: dijangka ${issue3.origin} adalah ${adj}${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") return `String tidak sah: mesti bermula dengan "${_issue.prefix}"`; if (_issue.format === "ends_with") @@ -31105,18 +31105,18 @@ var init_ms = __esm({ return `String tidak sah: mesti mengandungi "${_issue.includes}"`; if (_issue.format === "regex") return `String tidak sah: mesti sepadan dengan corak ${_issue.pattern}`; - return `${FormatDictionary[_issue.format] ?? issue4.format} tidak sah`; + return `${FormatDictionary[_issue.format] ?? issue3.format} tidak sah`; } case "not_multiple_of": - return `Nombor tidak sah: perlu gandaan ${issue4.divisor}`; + return `Nombor tidak sah: perlu gandaan ${issue3.divisor}`; case "unrecognized_keys": - return `Kunci tidak dikenali: ${joinValues(issue4.keys, ", ")}`; + return `Kunci tidak dikenali: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `Kunci tidak sah dalam ${issue4.origin}`; + return `Kunci tidak sah dalam ${issue3.origin}`; case "invalid_union": return "Input tidak sah"; case "invalid_element": - return `Nilai tidak sah dalam ${issue4.origin}`; + return `Nilai tidak sah dalam ${issue3.origin}`; default: return `Input tidak sah`; } @@ -31179,40 +31179,40 @@ var init_nl = __esm({ nan: "NaN", number: "getal" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `Ongeldige invoer: verwacht instanceof ${issue4.expected}, ontving ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `Ongeldige invoer: verwacht instanceof ${issue3.expected}, ontving ${received}`; } return `Ongeldige invoer: verwacht ${expected}, ontving ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `Ongeldige invoer: verwacht ${stringifyPrimitive(issue4.values[0])}`; - return `Ongeldige optie: verwacht \xE9\xE9n van ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `Ongeldige invoer: verwacht ${stringifyPrimitive(issue3.values[0])}`; + return `Ongeldige optie: verwacht \xE9\xE9n van ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); - const longName = issue4.origin === "date" ? "laat" : issue4.origin === "string" ? "lang" : "groot"; + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); + const longName = issue3.origin === "date" ? "laat" : issue3.origin === "string" ? "lang" : "groot"; if (sizing) - return `Te ${longName}: verwacht dat ${issue4.origin ?? "waarde"} ${adj}${issue4.maximum.toString()} ${sizing.unit ?? "elementen"} ${sizing.verb}`; - return `Te ${longName}: verwacht dat ${issue4.origin ?? "waarde"} ${adj}${issue4.maximum.toString()} is`; + return `Te ${longName}: verwacht dat ${issue3.origin ?? "waarde"} ${adj}${issue3.maximum.toString()} ${sizing.unit ?? "elementen"} ${sizing.verb}`; + return `Te ${longName}: verwacht dat ${issue3.origin ?? "waarde"} ${adj}${issue3.maximum.toString()} is`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); - const shortName = issue4.origin === "date" ? "vroeg" : issue4.origin === "string" ? "kort" : "klein"; + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); + const shortName = issue3.origin === "date" ? "vroeg" : issue3.origin === "string" ? "kort" : "klein"; if (sizing) { - return `Te ${shortName}: verwacht dat ${issue4.origin} ${adj}${issue4.minimum.toString()} ${sizing.unit} ${sizing.verb}`; + return `Te ${shortName}: verwacht dat ${issue3.origin} ${adj}${issue3.minimum.toString()} ${sizing.unit} ${sizing.verb}`; } - return `Te ${shortName}: verwacht dat ${issue4.origin} ${adj}${issue4.minimum.toString()} is`; + return `Te ${shortName}: verwacht dat ${issue3.origin} ${adj}${issue3.minimum.toString()} is`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") { return `Ongeldige tekst: moet met "${_issue.prefix}" beginnen`; } @@ -31222,18 +31222,18 @@ var init_nl = __esm({ return `Ongeldige tekst: moet "${_issue.includes}" bevatten`; if (_issue.format === "regex") return `Ongeldige tekst: moet overeenkomen met patroon ${_issue.pattern}`; - return `Ongeldig: ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `Ongeldig: ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `Ongeldig getal: moet een veelvoud van ${issue4.divisor} zijn`; + return `Ongeldig getal: moet een veelvoud van ${issue3.divisor} zijn`; case "unrecognized_keys": - return `Onbekende key${issue4.keys.length > 1 ? "s" : ""}: ${joinValues(issue4.keys, ", ")}`; + return `Onbekende key${issue3.keys.length > 1 ? "s" : ""}: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `Ongeldige key in ${issue4.origin}`; + return `Ongeldige key in ${issue3.origin}`; case "invalid_union": return "Ongeldige invoer"; case "invalid_element": - return `Ongeldige waarde in ${issue4.origin}`; + return `Ongeldige waarde in ${issue3.origin}`; default: return `Ongeldige invoer`; } @@ -31297,38 +31297,38 @@ var init_no = __esm({ number: "tall", array: "liste" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `Ugyldig input: forventet instanceof ${issue4.expected}, fikk ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `Ugyldig input: forventet instanceof ${issue3.expected}, fikk ${received}`; } return `Ugyldig input: forventet ${expected}, fikk ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `Ugyldig verdi: forventet ${stringifyPrimitive(issue4.values[0])}`; - return `Ugyldig valg: forventet en av ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `Ugyldig verdi: forventet ${stringifyPrimitive(issue3.values[0])}`; + return `Ugyldig valg: forventet en av ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) - return `For stor(t): forventet ${issue4.origin ?? "value"} til \xE5 ha ${adj}${issue4.maximum.toString()} ${sizing.unit ?? "elementer"}`; - return `For stor(t): forventet ${issue4.origin ?? "value"} til \xE5 ha ${adj}${issue4.maximum.toString()}`; + return `For stor(t): forventet ${issue3.origin ?? "value"} til \xE5 ha ${adj}${issue3.maximum.toString()} ${sizing.unit ?? "elementer"}`; + return `For stor(t): forventet ${issue3.origin ?? "value"} til \xE5 ha ${adj}${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `For lite(n): forventet ${issue4.origin} til \xE5 ha ${adj}${issue4.minimum.toString()} ${sizing.unit}`; + return `For lite(n): forventet ${issue3.origin} til \xE5 ha ${adj}${issue3.minimum.toString()} ${sizing.unit}`; } - return `For lite(n): forventet ${issue4.origin} til \xE5 ha ${adj}${issue4.minimum.toString()}`; + return `For lite(n): forventet ${issue3.origin} til \xE5 ha ${adj}${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") return `Ugyldig streng: m\xE5 starte med "${_issue.prefix}"`; if (_issue.format === "ends_with") @@ -31337,18 +31337,18 @@ var init_no = __esm({ return `Ugyldig streng: m\xE5 inneholde "${_issue.includes}"`; if (_issue.format === "regex") return `Ugyldig streng: m\xE5 matche m\xF8nsteret ${_issue.pattern}`; - return `Ugyldig ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `Ugyldig ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `Ugyldig tall: m\xE5 v\xE6re et multiplum av ${issue4.divisor}`; + return `Ugyldig tall: m\xE5 v\xE6re et multiplum av ${issue3.divisor}`; case "unrecognized_keys": - return `${issue4.keys.length > 1 ? "Ukjente n\xF8kler" : "Ukjent n\xF8kkel"}: ${joinValues(issue4.keys, ", ")}`; + return `${issue3.keys.length > 1 ? "Ukjente n\xF8kler" : "Ukjent n\xF8kkel"}: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `Ugyldig n\xF8kkel i ${issue4.origin}`; + return `Ugyldig n\xF8kkel i ${issue3.origin}`; case "invalid_union": return "Ugyldig input"; case "invalid_element": - return `Ugyldig verdi i ${issue4.origin}`; + return `Ugyldig verdi i ${issue3.origin}`; default: return `Ugyldig input`; } @@ -31413,38 +31413,38 @@ var init_ota = __esm({ array: "saf", null: "gayb" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `F\xE2sit giren: umulan instanceof ${issue4.expected}, al\u0131nan ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `F\xE2sit giren: umulan instanceof ${issue3.expected}, al\u0131nan ${received}`; } return `F\xE2sit giren: umulan ${expected}, al\u0131nan ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `F\xE2sit giren: umulan ${stringifyPrimitive(issue4.values[0])}`; - return `F\xE2sit tercih: m\xFBteberler ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `F\xE2sit giren: umulan ${stringifyPrimitive(issue3.values[0])}`; + return `F\xE2sit tercih: m\xFBteberler ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) - return `Fazla b\xFCy\xFCk: ${issue4.origin ?? "value"}, ${adj}${issue4.maximum.toString()} ${sizing.unit ?? "elements"} sahip olmal\u0131yd\u0131.`; - return `Fazla b\xFCy\xFCk: ${issue4.origin ?? "value"}, ${adj}${issue4.maximum.toString()} olmal\u0131yd\u0131.`; + return `Fazla b\xFCy\xFCk: ${issue3.origin ?? "value"}, ${adj}${issue3.maximum.toString()} ${sizing.unit ?? "elements"} sahip olmal\u0131yd\u0131.`; + return `Fazla b\xFCy\xFCk: ${issue3.origin ?? "value"}, ${adj}${issue3.maximum.toString()} olmal\u0131yd\u0131.`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `Fazla k\xFC\xE7\xFCk: ${issue4.origin}, ${adj}${issue4.minimum.toString()} ${sizing.unit} sahip olmal\u0131yd\u0131.`; + return `Fazla k\xFC\xE7\xFCk: ${issue3.origin}, ${adj}${issue3.minimum.toString()} ${sizing.unit} sahip olmal\u0131yd\u0131.`; } - return `Fazla k\xFC\xE7\xFCk: ${issue4.origin}, ${adj}${issue4.minimum.toString()} olmal\u0131yd\u0131.`; + return `Fazla k\xFC\xE7\xFCk: ${issue3.origin}, ${adj}${issue3.minimum.toString()} olmal\u0131yd\u0131.`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") return `F\xE2sit metin: "${_issue.prefix}" ile ba\u015Flamal\u0131.`; if (_issue.format === "ends_with") @@ -31453,18 +31453,18 @@ var init_ota = __esm({ return `F\xE2sit metin: "${_issue.includes}" ihtiv\xE2 etmeli.`; if (_issue.format === "regex") return `F\xE2sit metin: ${_issue.pattern} nak\u015F\u0131na uymal\u0131.`; - return `F\xE2sit ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `F\xE2sit ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `F\xE2sit say\u0131: ${issue4.divisor} kat\u0131 olmal\u0131yd\u0131.`; + return `F\xE2sit say\u0131: ${issue3.divisor} kat\u0131 olmal\u0131yd\u0131.`; case "unrecognized_keys": - return `Tan\u0131nmayan anahtar ${issue4.keys.length > 1 ? "s" : ""}: ${joinValues(issue4.keys, ", ")}`; + return `Tan\u0131nmayan anahtar ${issue3.keys.length > 1 ? "s" : ""}: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `${issue4.origin} i\xE7in tan\u0131nmayan anahtar var.`; + return `${issue3.origin} i\xE7in tan\u0131nmayan anahtar var.`; case "invalid_union": return "Giren tan\u0131namad\u0131."; case "invalid_element": - return `${issue4.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`; + return `${issue3.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`; default: return `K\u0131ymet tan\u0131namad\u0131.`; } @@ -31528,40 +31528,40 @@ var init_ps = __esm({ number: "\u0639\u062F\u062F", array: "\u0627\u0631\u06D0" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${issue4.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${received} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`; + if (/^[A-Z]/.test(issue3.expected)) { + return `\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${issue3.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${received} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`; } return `\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${received} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`; } case "invalid_value": - if (issue4.values.length === 1) { - return `\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${stringifyPrimitive(issue4.values[0])} \u0648\u0627\u06CC`; + if (issue3.values.length === 1) { + return `\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${stringifyPrimitive(issue3.values[0])} \u0648\u0627\u06CC`; } - return `\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${joinValues(issue4.values, "|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`; + return `\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${joinValues(issue3.values, "|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${issue4.origin ?? "\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${adj}${issue4.maximum.toString()} ${sizing.unit ?? "\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`; + return `\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${issue3.origin ?? "\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${adj}${issue3.maximum.toString()} ${sizing.unit ?? "\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`; } - return `\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${issue4.origin ?? "\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${adj}${issue4.maximum.toString()} \u0648\u064A`; + return `\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${issue3.origin ?? "\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${adj}${issue3.maximum.toString()} \u0648\u064A`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${issue4.origin} \u0628\u0627\u06CC\u062F ${adj}${issue4.minimum.toString()} ${sizing.unit} \u0648\u0644\u0631\u064A`; + return `\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${issue3.origin} \u0628\u0627\u06CC\u062F ${adj}${issue3.minimum.toString()} ${sizing.unit} \u0648\u0644\u0631\u064A`; } - return `\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${issue4.origin} \u0628\u0627\u06CC\u062F ${adj}${issue4.minimum.toString()} \u0648\u064A`; + return `\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${issue3.origin} \u0628\u0627\u06CC\u062F ${adj}${issue3.minimum.toString()} \u0648\u064A`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") { return `\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${_issue.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`; } @@ -31574,18 +31574,18 @@ var init_ps = __esm({ if (_issue.format === "regex") { return `\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${_issue.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`; } - return `${FormatDictionary[_issue.format] ?? issue4.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`; + return `${FormatDictionary[_issue.format] ?? issue3.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`; } case "not_multiple_of": - return `\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${issue4.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`; + return `\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${issue3.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`; case "unrecognized_keys": - return `\u0646\u0627\u0633\u0645 ${issue4.keys.length > 1 ? "\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647" : "\u06A9\u0644\u06CC\u0689"}: ${joinValues(issue4.keys, ", ")}`; + return `\u0646\u0627\u0633\u0645 ${issue3.keys.length > 1 ? "\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647" : "\u06A9\u0644\u06CC\u0689"}: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${issue4.origin} \u06A9\u06D0`; + return `\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${issue3.origin} \u06A9\u06D0`; case "invalid_union": return `\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A`; case "invalid_element": - return `\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${issue4.origin} \u06A9\u06D0`; + return `\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${issue3.origin} \u06A9\u06D0`; default: return `\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A`; } @@ -31649,39 +31649,39 @@ var init_pl = __esm({ number: "liczba", array: "tablica" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${issue4.expected}, otrzymano ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${issue3.expected}, otrzymano ${received}`; } return `Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${expected}, otrzymano ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${stringifyPrimitive(issue4.values[0])}`; - return `Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${stringifyPrimitive(issue3.values[0])}`; + return `Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${issue4.origin ?? "warto\u015B\u0107"} b\u0119dzie mie\u0107 ${adj}${issue4.maximum.toString()} ${sizing.unit ?? "element\xF3w"}`; + return `Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${issue3.origin ?? "warto\u015B\u0107"} b\u0119dzie mie\u0107 ${adj}${issue3.maximum.toString()} ${sizing.unit ?? "element\xF3w"}`; } - return `Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${issue4.origin ?? "warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${adj}${issue4.maximum.toString()}`; + return `Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${issue3.origin ?? "warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${adj}${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${issue4.origin ?? "warto\u015B\u0107"} b\u0119dzie mie\u0107 ${adj}${issue4.minimum.toString()} ${sizing.unit ?? "element\xF3w"}`; + return `Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${issue3.origin ?? "warto\u015B\u0107"} b\u0119dzie mie\u0107 ${adj}${issue3.minimum.toString()} ${sizing.unit ?? "element\xF3w"}`; } - return `Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${issue4.origin ?? "warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${adj}${issue4.minimum.toString()}`; + return `Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${issue3.origin ?? "warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${adj}${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") return `Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${_issue.prefix}"`; if (_issue.format === "ends_with") @@ -31690,18 +31690,18 @@ var init_pl = __esm({ return `Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${_issue.includes}"`; if (_issue.format === "regex") return `Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${_issue.pattern}`; - return `Nieprawid\u0142ow(y/a/e) ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `Nieprawid\u0142ow(y/a/e) ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${issue4.divisor}`; + return `Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${issue3.divisor}`; case "unrecognized_keys": - return `Nierozpoznane klucze${issue4.keys.length > 1 ? "s" : ""}: ${joinValues(issue4.keys, ", ")}`; + return `Nierozpoznane klucze${issue3.keys.length > 1 ? "s" : ""}: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `Nieprawid\u0142owy klucz w ${issue4.origin}`; + return `Nieprawid\u0142owy klucz w ${issue3.origin}`; case "invalid_union": return "Nieprawid\u0142owe dane wej\u015Bciowe"; case "invalid_element": - return `Nieprawid\u0142owa warto\u015B\u0107 w ${issue4.origin}`; + return `Nieprawid\u0142owa warto\u015B\u0107 w ${issue3.origin}`; default: return `Nieprawid\u0142owe dane wej\u015Bciowe`; } @@ -31765,38 +31765,38 @@ var init_pt = __esm({ number: "n\xFAmero", null: "nulo" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `Tipo inv\xE1lido: esperado instanceof ${issue4.expected}, recebido ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `Tipo inv\xE1lido: esperado instanceof ${issue3.expected}, recebido ${received}`; } return `Tipo inv\xE1lido: esperado ${expected}, recebido ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `Entrada inv\xE1lida: esperado ${stringifyPrimitive(issue4.values[0])}`; - return `Op\xE7\xE3o inv\xE1lida: esperada uma das ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `Entrada inv\xE1lida: esperado ${stringifyPrimitive(issue3.values[0])}`; + return `Op\xE7\xE3o inv\xE1lida: esperada uma das ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) - return `Muito grande: esperado que ${issue4.origin ?? "valor"} tivesse ${adj}${issue4.maximum.toString()} ${sizing.unit ?? "elementos"}`; - return `Muito grande: esperado que ${issue4.origin ?? "valor"} fosse ${adj}${issue4.maximum.toString()}`; + return `Muito grande: esperado que ${issue3.origin ?? "valor"} tivesse ${adj}${issue3.maximum.toString()} ${sizing.unit ?? "elementos"}`; + return `Muito grande: esperado que ${issue3.origin ?? "valor"} fosse ${adj}${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `Muito pequeno: esperado que ${issue4.origin} tivesse ${adj}${issue4.minimum.toString()} ${sizing.unit}`; + return `Muito pequeno: esperado que ${issue3.origin} tivesse ${adj}${issue3.minimum.toString()} ${sizing.unit}`; } - return `Muito pequeno: esperado que ${issue4.origin} fosse ${adj}${issue4.minimum.toString()}`; + return `Muito pequeno: esperado que ${issue3.origin} fosse ${adj}${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") return `Texto inv\xE1lido: deve come\xE7ar com "${_issue.prefix}"`; if (_issue.format === "ends_with") @@ -31805,18 +31805,18 @@ var init_pt = __esm({ return `Texto inv\xE1lido: deve incluir "${_issue.includes}"`; if (_issue.format === "regex") return `Texto inv\xE1lido: deve corresponder ao padr\xE3o ${_issue.pattern}`; - return `${FormatDictionary[_issue.format] ?? issue4.format} inv\xE1lido`; + return `${FormatDictionary[_issue.format] ?? issue3.format} inv\xE1lido`; } case "not_multiple_of": - return `N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${issue4.divisor}`; + return `N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${issue3.divisor}`; case "unrecognized_keys": - return `Chave${issue4.keys.length > 1 ? "s" : ""} desconhecida${issue4.keys.length > 1 ? "s" : ""}: ${joinValues(issue4.keys, ", ")}`; + return `Chave${issue3.keys.length > 1 ? "s" : ""} desconhecida${issue3.keys.length > 1 ? "s" : ""}: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `Chave inv\xE1lida em ${issue4.origin}`; + return `Chave inv\xE1lida em ${issue3.origin}`; case "invalid_union": return "Entrada inv\xE1lida"; case "invalid_element": - return `Valor inv\xE1lido em ${issue4.origin}`; + return `Valor inv\xE1lido em ${issue3.origin}`; default: return `Campo inv\xE1lido`; } @@ -31923,43 +31923,43 @@ var init_ru = __esm({ number: "\u0447\u0438\u0441\u043B\u043E", array: "\u043C\u0430\u0441\u0441\u0438\u0432" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${issue4.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${issue3.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${received}`; } return `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${stringifyPrimitive(issue4.values[0])}`; - return `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${stringifyPrimitive(issue3.values[0])}`; + return `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) { - const maxValue = Number(issue4.maximum); + const maxValue = Number(issue3.maximum); const unit = getRussianPlural(maxValue, sizing.unit.one, sizing.unit.few, sizing.unit.many); - return `\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${issue4.origin ?? "\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${adj}${issue4.maximum.toString()} ${unit}`; + return `\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${issue3.origin ?? "\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${adj}${issue3.maximum.toString()} ${unit}`; } - return `\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${issue4.origin ?? "\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${adj}${issue4.maximum.toString()}`; + return `\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${issue3.origin ?? "\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${adj}${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - const minValue = Number(issue4.minimum); + const minValue = Number(issue3.minimum); const unit = getRussianPlural(minValue, sizing.unit.one, sizing.unit.few, sizing.unit.many); - return `\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${issue4.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${adj}${issue4.minimum.toString()} ${unit}`; + return `\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${issue3.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${adj}${issue3.minimum.toString()} ${unit}`; } - return `\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${issue4.origin} \u0431\u0443\u0434\u0435\u0442 ${adj}${issue4.minimum.toString()}`; + return `\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${issue3.origin} \u0431\u0443\u0434\u0435\u0442 ${adj}${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") return `\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${_issue.prefix}"`; if (_issue.format === "ends_with") @@ -31968,18 +31968,18 @@ var init_ru = __esm({ return `\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${_issue.includes}"`; if (_issue.format === "regex") return `\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${_issue.pattern}`; - return `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${issue4.divisor}`; + return `\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${issue3.divisor}`; case "unrecognized_keys": - return `\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${issue4.keys.length > 1 ? "\u044B\u0435" : "\u044B\u0439"} \u043A\u043B\u044E\u0447${issue4.keys.length > 1 ? "\u0438" : ""}: ${joinValues(issue4.keys, ", ")}`; + return `\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${issue3.keys.length > 1 ? "\u044B\u0435" : "\u044B\u0439"} \u043A\u043B\u044E\u0447${issue3.keys.length > 1 ? "\u0438" : ""}: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${issue4.origin}`; + return `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${issue3.origin}`; case "invalid_union": return "\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"; case "invalid_element": - return `\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${issue4.origin}`; + return `\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${issue3.origin}`; default: return `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435`; } @@ -32043,38 +32043,38 @@ var init_sl = __esm({ number: "\u0161tevilo", array: "tabela" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `Neveljaven vnos: pri\u010Dakovano instanceof ${issue4.expected}, prejeto ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `Neveljaven vnos: pri\u010Dakovano instanceof ${issue3.expected}, prejeto ${received}`; } return `Neveljaven vnos: pri\u010Dakovano ${expected}, prejeto ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `Neveljaven vnos: pri\u010Dakovano ${stringifyPrimitive(issue4.values[0])}`; - return `Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `Neveljaven vnos: pri\u010Dakovano ${stringifyPrimitive(issue3.values[0])}`; + return `Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) - return `Preveliko: pri\u010Dakovano, da bo ${issue4.origin ?? "vrednost"} imelo ${adj}${issue4.maximum.toString()} ${sizing.unit ?? "elementov"}`; - return `Preveliko: pri\u010Dakovano, da bo ${issue4.origin ?? "vrednost"} ${adj}${issue4.maximum.toString()}`; + return `Preveliko: pri\u010Dakovano, da bo ${issue3.origin ?? "vrednost"} imelo ${adj}${issue3.maximum.toString()} ${sizing.unit ?? "elementov"}`; + return `Preveliko: pri\u010Dakovano, da bo ${issue3.origin ?? "vrednost"} ${adj}${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `Premajhno: pri\u010Dakovano, da bo ${issue4.origin} imelo ${adj}${issue4.minimum.toString()} ${sizing.unit}`; + return `Premajhno: pri\u010Dakovano, da bo ${issue3.origin} imelo ${adj}${issue3.minimum.toString()} ${sizing.unit}`; } - return `Premajhno: pri\u010Dakovano, da bo ${issue4.origin} ${adj}${issue4.minimum.toString()}`; + return `Premajhno: pri\u010Dakovano, da bo ${issue3.origin} ${adj}${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") { return `Neveljaven niz: mora se za\u010Deti z "${_issue.prefix}"`; } @@ -32084,18 +32084,18 @@ var init_sl = __esm({ return `Neveljaven niz: mora vsebovati "${_issue.includes}"`; if (_issue.format === "regex") return `Neveljaven niz: mora ustrezati vzorcu ${_issue.pattern}`; - return `Neveljaven ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `Neveljaven ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${issue4.divisor}`; + return `Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${issue3.divisor}`; case "unrecognized_keys": - return `Neprepoznan${issue4.keys.length > 1 ? "i klju\u010Di" : " klju\u010D"}: ${joinValues(issue4.keys, ", ")}`; + return `Neprepoznan${issue3.keys.length > 1 ? "i klju\u010Di" : " klju\u010D"}: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `Neveljaven klju\u010D v ${issue4.origin}`; + return `Neveljaven klju\u010D v ${issue3.origin}`; case "invalid_union": return "Neveljaven vnos"; case "invalid_element": - return `Neveljavna vrednost v ${issue4.origin}`; + return `Neveljavna vrednost v ${issue3.origin}`; default: return "Neveljaven vnos"; } @@ -32159,39 +32159,39 @@ var init_sv = __esm({ number: "antal", array: "lista" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${issue4.expected}, fick ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${issue3.expected}, fick ${received}`; } return `Ogiltig inmatning: f\xF6rv\xE4ntat ${expected}, fick ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `Ogiltig inmatning: f\xF6rv\xE4ntat ${stringifyPrimitive(issue4.values[0])}`; - return `Ogiltigt val: f\xF6rv\xE4ntade en av ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `Ogiltig inmatning: f\xF6rv\xE4ntat ${stringifyPrimitive(issue3.values[0])}`; + return `Ogiltigt val: f\xF6rv\xE4ntade en av ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `F\xF6r stor(t): f\xF6rv\xE4ntade ${issue4.origin ?? "v\xE4rdet"} att ha ${adj}${issue4.maximum.toString()} ${sizing.unit ?? "element"}`; + return `F\xF6r stor(t): f\xF6rv\xE4ntade ${issue3.origin ?? "v\xE4rdet"} att ha ${adj}${issue3.maximum.toString()} ${sizing.unit ?? "element"}`; } - return `F\xF6r stor(t): f\xF6rv\xE4ntat ${issue4.origin ?? "v\xE4rdet"} att ha ${adj}${issue4.maximum.toString()}`; + return `F\xF6r stor(t): f\xF6rv\xE4ntat ${issue3.origin ?? "v\xE4rdet"} att ha ${adj}${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `F\xF6r lite(t): f\xF6rv\xE4ntade ${issue4.origin ?? "v\xE4rdet"} att ha ${adj}${issue4.minimum.toString()} ${sizing.unit}`; + return `F\xF6r lite(t): f\xF6rv\xE4ntade ${issue3.origin ?? "v\xE4rdet"} att ha ${adj}${issue3.minimum.toString()} ${sizing.unit}`; } - return `F\xF6r lite(t): f\xF6rv\xE4ntade ${issue4.origin ?? "v\xE4rdet"} att ha ${adj}${issue4.minimum.toString()}`; + return `F\xF6r lite(t): f\xF6rv\xE4ntade ${issue3.origin ?? "v\xE4rdet"} att ha ${adj}${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") { return `Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${_issue.prefix}"`; } @@ -32201,18 +32201,18 @@ var init_sv = __esm({ return `Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${_issue.includes}"`; if (_issue.format === "regex") return `Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${_issue.pattern}"`; - return `Ogiltig(t) ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `Ogiltig(t) ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `Ogiltigt tal: m\xE5ste vara en multipel av ${issue4.divisor}`; + return `Ogiltigt tal: m\xE5ste vara en multipel av ${issue3.divisor}`; case "unrecognized_keys": - return `${issue4.keys.length > 1 ? "Ok\xE4nda nycklar" : "Ok\xE4nd nyckel"}: ${joinValues(issue4.keys, ", ")}`; + return `${issue3.keys.length > 1 ? "Ok\xE4nda nycklar" : "Ok\xE4nd nyckel"}: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `Ogiltig nyckel i ${issue4.origin ?? "v\xE4rdet"}`; + return `Ogiltig nyckel i ${issue3.origin ?? "v\xE4rdet"}`; case "invalid_union": return "Ogiltig input"; case "invalid_element": - return `Ogiltigt v\xE4rde i ${issue4.origin ?? "v\xE4rdet"}`; + return `Ogiltigt v\xE4rde i ${issue3.origin ?? "v\xE4rdet"}`; default: return `Ogiltig input`; } @@ -32277,39 +32277,39 @@ var init_ta = __esm({ array: "\u0B85\u0BA3\u0BBF", null: "\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${issue4.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${issue3.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${received}`; } return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${stringifyPrimitive(issue4.values[0])}`; - return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${joinValues(issue4.values, "|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`; + if (issue3.values.length === 1) + return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${stringifyPrimitive(issue3.values[0])}`; + return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${joinValues(issue3.values, "|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${issue4.origin ?? "\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${adj}${issue4.maximum.toString()} ${sizing.unit ?? "\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`; + return `\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${issue3.origin ?? "\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${adj}${issue3.maximum.toString()} ${sizing.unit ?? "\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`; } - return `\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${issue4.origin ?? "\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${adj}${issue4.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`; + return `\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${issue3.origin ?? "\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${adj}${issue3.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${issue4.origin} ${adj}${issue4.minimum.toString()} ${sizing.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`; + return `\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${issue3.origin} ${adj}${issue3.minimum.toString()} ${sizing.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`; } - return `\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${issue4.origin} ${adj}${issue4.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`; + return `\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${issue3.origin} ${adj}${issue3.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${_issue.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`; if (_issue.format === "ends_with") @@ -32318,18 +32318,18 @@ var init_ta = __esm({ return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${_issue.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`; if (_issue.format === "regex") return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${_issue.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`; - return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${issue4.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`; + return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${issue3.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`; case "unrecognized_keys": - return `\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${issue4.keys.length > 1 ? "\u0B95\u0BB3\u0BCD" : ""}: ${joinValues(issue4.keys, ", ")}`; + return `\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${issue3.keys.length > 1 ? "\u0B95\u0BB3\u0BCD" : ""}: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `${issue4.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`; + return `${issue3.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`; case "invalid_union": return "\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"; case "invalid_element": - return `${issue4.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`; + return `${issue3.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`; default: return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1`; } @@ -32394,38 +32394,38 @@ var init_th = __esm({ array: "\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)", null: "\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${issue4.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${issue3.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${received}`; } return `\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${stringifyPrimitive(issue4.values[0])}`; - return `\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${stringifyPrimitive(issue3.values[0])}`; + return `\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19" : "\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19" : "\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32"; + const sizing = getSizing(issue3.origin); if (sizing) - return `\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${issue4.origin ?? "\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${adj} ${issue4.maximum.toString()} ${sizing.unit ?? "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`; - return `\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${issue4.origin ?? "\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${adj} ${issue4.maximum.toString()}`; + return `\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${issue3.origin ?? "\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${adj} ${issue3.maximum.toString()} ${sizing.unit ?? "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`; + return `\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${issue3.origin ?? "\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${adj} ${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? "\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22" : "\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22" : "\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${issue4.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${adj} ${issue4.minimum.toString()} ${sizing.unit}`; + return `\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${issue3.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${adj} ${issue3.minimum.toString()} ${sizing.unit}`; } - return `\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${issue4.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${adj} ${issue4.minimum.toString()}`; + return `\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${issue3.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${adj} ${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") { return `\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${_issue.prefix}"`; } @@ -32435,18 +32435,18 @@ var init_th = __esm({ return `\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${_issue.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`; if (_issue.format === "regex") return `\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${_issue.pattern}`; - return `\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${issue4.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`; + return `\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${issue3.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`; case "unrecognized_keys": - return `\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${joinValues(issue4.keys, ", ")}`; + return `\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${issue4.origin}`; + return `\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${issue3.origin}`; case "invalid_union": return "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49"; case "invalid_element": - return `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${issue4.origin}`; + return `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${issue3.origin}`; default: return `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07`; } @@ -32508,37 +32508,37 @@ var init_tr = __esm({ const TypeDictionary = { nan: "NaN" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `Ge\xE7ersiz de\u011Fer: beklenen instanceof ${issue4.expected}, al\u0131nan ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `Ge\xE7ersiz de\u011Fer: beklenen instanceof ${issue3.expected}, al\u0131nan ${received}`; } return `Ge\xE7ersiz de\u011Fer: beklenen ${expected}, al\u0131nan ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `Ge\xE7ersiz de\u011Fer: beklenen ${stringifyPrimitive(issue4.values[0])}`; - return `Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `Ge\xE7ersiz de\u011Fer: beklenen ${stringifyPrimitive(issue3.values[0])}`; + return `Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) - return `\xC7ok b\xFCy\xFCk: beklenen ${issue4.origin ?? "de\u011Fer"} ${adj}${issue4.maximum.toString()} ${sizing.unit ?? "\xF6\u011Fe"}`; - return `\xC7ok b\xFCy\xFCk: beklenen ${issue4.origin ?? "de\u011Fer"} ${adj}${issue4.maximum.toString()}`; + return `\xC7ok b\xFCy\xFCk: beklenen ${issue3.origin ?? "de\u011Fer"} ${adj}${issue3.maximum.toString()} ${sizing.unit ?? "\xF6\u011Fe"}`; + return `\xC7ok b\xFCy\xFCk: beklenen ${issue3.origin ?? "de\u011Fer"} ${adj}${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) - return `\xC7ok k\xFC\xE7\xFCk: beklenen ${issue4.origin} ${adj}${issue4.minimum.toString()} ${sizing.unit}`; - return `\xC7ok k\xFC\xE7\xFCk: beklenen ${issue4.origin} ${adj}${issue4.minimum.toString()}`; + return `\xC7ok k\xFC\xE7\xFCk: beklenen ${issue3.origin} ${adj}${issue3.minimum.toString()} ${sizing.unit}`; + return `\xC7ok k\xFC\xE7\xFCk: beklenen ${issue3.origin} ${adj}${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") return `Ge\xE7ersiz metin: "${_issue.prefix}" ile ba\u015Flamal\u0131`; if (_issue.format === "ends_with") @@ -32547,18 +32547,18 @@ var init_tr = __esm({ return `Ge\xE7ersiz metin: "${_issue.includes}" i\xE7ermeli`; if (_issue.format === "regex") return `Ge\xE7ersiz metin: ${_issue.pattern} desenine uymal\u0131`; - return `Ge\xE7ersiz ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `Ge\xE7ersiz ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `Ge\xE7ersiz say\u0131: ${issue4.divisor} ile tam b\xF6l\xFCnebilmeli`; + return `Ge\xE7ersiz say\u0131: ${issue3.divisor} ile tam b\xF6l\xFCnebilmeli`; case "unrecognized_keys": - return `Tan\u0131nmayan anahtar${issue4.keys.length > 1 ? "lar" : ""}: ${joinValues(issue4.keys, ", ")}`; + return `Tan\u0131nmayan anahtar${issue3.keys.length > 1 ? "lar" : ""}: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `${issue4.origin} i\xE7inde ge\xE7ersiz anahtar`; + return `${issue3.origin} i\xE7inde ge\xE7ersiz anahtar`; case "invalid_union": return "Ge\xE7ersiz de\u011Fer"; case "invalid_element": - return `${issue4.origin} i\xE7inde ge\xE7ersiz de\u011Fer`; + return `${issue3.origin} i\xE7inde ge\xE7ersiz de\u011Fer`; default: return `Ge\xE7ersiz de\u011Fer`; } @@ -32622,38 +32622,38 @@ var init_uk = __esm({ number: "\u0447\u0438\u0441\u043B\u043E", array: "\u043C\u0430\u0441\u0438\u0432" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${issue4.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${issue3.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${received}`; } return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${stringifyPrimitive(issue4.values[0])}`; - return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${stringifyPrimitive(issue3.values[0])}`; + return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) - return `\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${issue4.origin ?? "\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${sizing.verb} ${adj}${issue4.maximum.toString()} ${sizing.unit ?? "\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`; - return `\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${issue4.origin ?? "\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${adj}${issue4.maximum.toString()}`; + return `\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${issue3.origin ?? "\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${sizing.verb} ${adj}${issue3.maximum.toString()} ${sizing.unit ?? "\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`; + return `\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${issue3.origin ?? "\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${adj}${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${issue4.origin} ${sizing.verb} ${adj}${issue4.minimum.toString()} ${sizing.unit}`; + return `\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${issue3.origin} ${sizing.verb} ${adj}${issue3.minimum.toString()} ${sizing.unit}`; } - return `\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${issue4.origin} \u0431\u0443\u0434\u0435 ${adj}${issue4.minimum.toString()}`; + return `\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${issue3.origin} \u0431\u0443\u0434\u0435 ${adj}${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${_issue.prefix}"`; if (_issue.format === "ends_with") @@ -32662,18 +32662,18 @@ var init_uk = __esm({ return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${_issue.includes}"`; if (_issue.format === "regex") return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${_issue.pattern}`; - return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${issue4.divisor}`; + return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${issue3.divisor}`; case "unrecognized_keys": - return `\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${issue4.keys.length > 1 ? "\u0456" : ""}: ${joinValues(issue4.keys, ", ")}`; + return `\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${issue3.keys.length > 1 ? "\u0456" : ""}: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${issue4.origin}`; + return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${issue3.origin}`; case "invalid_union": return "\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"; case "invalid_element": - return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${issue4.origin}`; + return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${issue3.origin}`; default: return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456`; } @@ -32748,38 +32748,38 @@ var init_ur = __esm({ array: "\u0622\u0631\u06D2", null: "\u0646\u0644" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${issue4.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${received} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`; + if (/^[A-Z]/.test(issue3.expected)) { + return `\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${issue3.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${received} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`; } return `\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${received} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`; } case "invalid_value": - if (issue4.values.length === 1) - return `\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${stringifyPrimitive(issue4.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`; - return `\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${joinValues(issue4.values, "|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`; + if (issue3.values.length === 1) + return `\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${stringifyPrimitive(issue3.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`; + return `\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${joinValues(issue3.values, "|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) - return `\u0628\u06C1\u062A \u0628\u0691\u0627: ${issue4.origin ?? "\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${adj}${issue4.maximum.toString()} ${sizing.unit ?? "\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`; - return `\u0628\u06C1\u062A \u0628\u0691\u0627: ${issue4.origin ?? "\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${adj}${issue4.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`; + return `\u0628\u06C1\u062A \u0628\u0691\u0627: ${issue3.origin ?? "\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${adj}${issue3.maximum.toString()} ${sizing.unit ?? "\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`; + return `\u0628\u06C1\u062A \u0628\u0691\u0627: ${issue3.origin ?? "\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${adj}${issue3.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${issue4.origin} \u06A9\u06D2 ${adj}${issue4.minimum.toString()} ${sizing.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`; + return `\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${issue3.origin} \u06A9\u06D2 ${adj}${issue3.minimum.toString()} ${sizing.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`; } - return `\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${issue4.origin} \u06A9\u0627 ${adj}${issue4.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`; + return `\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${issue3.origin} \u06A9\u0627 ${adj}${issue3.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") { return `\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${_issue.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`; } @@ -32789,18 +32789,18 @@ var init_ur = __esm({ return `\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${_issue.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`; if (_issue.format === "regex") return `\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${_issue.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`; - return `\u063A\u0644\u0637 ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `\u063A\u0644\u0637 ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${issue4.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`; + return `\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${issue3.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`; case "unrecognized_keys": - return `\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${issue4.keys.length > 1 ? "\u0632" : ""}: ${joinValues(issue4.keys, "\u060C ")}`; + return `\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${issue3.keys.length > 1 ? "\u0632" : ""}: ${joinValues(issue3.keys, "\u060C ")}`; case "invalid_key": - return `${issue4.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`; + return `${issue3.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`; case "invalid_union": return "\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"; case "invalid_element": - return `${issue4.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`; + return `${issue3.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`; default: return `\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679`; } @@ -32865,38 +32865,38 @@ var init_uz = __esm({ number: "raqam", array: "massiv" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `Noto\u2018g\u2018ri kirish: kutilgan instanceof ${issue4.expected}, qabul qilingan ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `Noto\u2018g\u2018ri kirish: kutilgan instanceof ${issue3.expected}, qabul qilingan ${received}`; } return `Noto\u2018g\u2018ri kirish: kutilgan ${expected}, qabul qilingan ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `Noto\u2018g\u2018ri kirish: kutilgan ${stringifyPrimitive(issue4.values[0])}`; - return `Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `Noto\u2018g\u2018ri kirish: kutilgan ${stringifyPrimitive(issue3.values[0])}`; + return `Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) - return `Juda katta: kutilgan ${issue4.origin ?? "qiymat"} ${adj}${issue4.maximum.toString()} ${sizing.unit} ${sizing.verb}`; - return `Juda katta: kutilgan ${issue4.origin ?? "qiymat"} ${adj}${issue4.maximum.toString()}`; + return `Juda katta: kutilgan ${issue3.origin ?? "qiymat"} ${adj}${issue3.maximum.toString()} ${sizing.unit} ${sizing.verb}`; + return `Juda katta: kutilgan ${issue3.origin ?? "qiymat"} ${adj}${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `Juda kichik: kutilgan ${issue4.origin} ${adj}${issue4.minimum.toString()} ${sizing.unit} ${sizing.verb}`; + return `Juda kichik: kutilgan ${issue3.origin} ${adj}${issue3.minimum.toString()} ${sizing.unit} ${sizing.verb}`; } - return `Juda kichik: kutilgan ${issue4.origin} ${adj}${issue4.minimum.toString()}`; + return `Juda kichik: kutilgan ${issue3.origin} ${adj}${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") return `Noto\u2018g\u2018ri satr: "${_issue.prefix}" bilan boshlanishi kerak`; if (_issue.format === "ends_with") @@ -32905,18 +32905,18 @@ var init_uz = __esm({ return `Noto\u2018g\u2018ri satr: "${_issue.includes}" ni o\u2018z ichiga olishi kerak`; if (_issue.format === "regex") return `Noto\u2018g\u2018ri satr: ${_issue.pattern} shabloniga mos kelishi kerak`; - return `Noto\u2018g\u2018ri ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `Noto\u2018g\u2018ri ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `Noto\u2018g\u2018ri raqam: ${issue4.divisor} ning karralisi bo\u2018lishi kerak`; + return `Noto\u2018g\u2018ri raqam: ${issue3.divisor} ning karralisi bo\u2018lishi kerak`; case "unrecognized_keys": - return `Noma\u2019lum kalit${issue4.keys.length > 1 ? "lar" : ""}: ${joinValues(issue4.keys, ", ")}`; + return `Noma\u2019lum kalit${issue3.keys.length > 1 ? "lar" : ""}: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `${issue4.origin} dagi kalit noto\u2018g\u2018ri`; + return `${issue3.origin} dagi kalit noto\u2018g\u2018ri`; case "invalid_union": return "Noto\u2018g\u2018ri kirish"; case "invalid_element": - return `${issue4.origin} da noto\u2018g\u2018ri qiymat`; + return `${issue3.origin} da noto\u2018g\u2018ri qiymat`; default: return `Noto\u2018g\u2018ri kirish`; } @@ -32980,38 +32980,38 @@ var init_vi = __esm({ number: "s\u1ED1", array: "m\u1EA3ng" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${issue4.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${issue3.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${received}`; } return `\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${stringifyPrimitive(issue4.values[0])}`; - return `T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${stringifyPrimitive(issue3.values[0])}`; + return `T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) - return `Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${issue4.origin ?? "gi\xE1 tr\u1ECB"} ${sizing.verb} ${adj}${issue4.maximum.toString()} ${sizing.unit ?? "ph\u1EA7n t\u1EED"}`; - return `Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${issue4.origin ?? "gi\xE1 tr\u1ECB"} ${adj}${issue4.maximum.toString()}`; + return `Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${issue3.origin ?? "gi\xE1 tr\u1ECB"} ${sizing.verb} ${adj}${issue3.maximum.toString()} ${sizing.unit ?? "ph\u1EA7n t\u1EED"}`; + return `Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${issue3.origin ?? "gi\xE1 tr\u1ECB"} ${adj}${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${issue4.origin} ${sizing.verb} ${adj}${issue4.minimum.toString()} ${sizing.unit}`; + return `Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${issue3.origin} ${sizing.verb} ${adj}${issue3.minimum.toString()} ${sizing.unit}`; } - return `Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${issue4.origin} ${adj}${issue4.minimum.toString()}`; + return `Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${issue3.origin} ${adj}${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") return `Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${_issue.prefix}"`; if (_issue.format === "ends_with") @@ -33020,18 +33020,18 @@ var init_vi = __esm({ return `Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${_issue.includes}"`; if (_issue.format === "regex") return `Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${_issue.pattern}`; - return `${FormatDictionary[_issue.format] ?? issue4.format} kh\xF4ng h\u1EE3p l\u1EC7`; + return `${FormatDictionary[_issue.format] ?? issue3.format} kh\xF4ng h\u1EE3p l\u1EC7`; } case "not_multiple_of": - return `S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${issue4.divisor}`; + return `S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${issue3.divisor}`; case "unrecognized_keys": - return `Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${joinValues(issue4.keys, ", ")}`; + return `Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${issue4.origin}`; + return `Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${issue3.origin}`; case "invalid_union": return "\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"; case "invalid_element": - return `Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${issue4.origin}`; + return `Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${issue3.origin}`; default: return `\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7`; } @@ -33096,38 +33096,38 @@ var init_zh_CN = __esm({ array: "\u6570\u7EC4", null: "\u7A7A\u503C(null)" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${issue4.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${issue3.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${received}`; } return `\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${stringifyPrimitive(issue4.values[0])}`; - return `\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${stringifyPrimitive(issue3.values[0])}`; + return `\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) - return `\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${issue4.origin ?? "\u503C"} ${adj}${issue4.maximum.toString()} ${sizing.unit ?? "\u4E2A\u5143\u7D20"}`; - return `\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${issue4.origin ?? "\u503C"} ${adj}${issue4.maximum.toString()}`; + return `\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${issue3.origin ?? "\u503C"} ${adj}${issue3.maximum.toString()} ${sizing.unit ?? "\u4E2A\u5143\u7D20"}`; + return `\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${issue3.origin ?? "\u503C"} ${adj}${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${issue4.origin} ${adj}${issue4.minimum.toString()} ${sizing.unit}`; + return `\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${issue3.origin} ${adj}${issue3.minimum.toString()} ${sizing.unit}`; } - return `\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${issue4.origin} ${adj}${issue4.minimum.toString()}`; + return `\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${issue3.origin} ${adj}${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") return `\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${_issue.prefix}" \u5F00\u5934`; if (_issue.format === "ends_with") @@ -33136,18 +33136,18 @@ var init_zh_CN = __esm({ return `\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${_issue.includes}"`; if (_issue.format === "regex") return `\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${_issue.pattern}`; - return `\u65E0\u6548${FormatDictionary[_issue.format] ?? issue4.format}`; + return `\u65E0\u6548${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${issue4.divisor} \u7684\u500D\u6570`; + return `\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${issue3.divisor} \u7684\u500D\u6570`; case "unrecognized_keys": - return `\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${joinValues(issue4.keys, ", ")}`; + return `\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `${issue4.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`; + return `${issue3.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`; case "invalid_union": return "\u65E0\u6548\u8F93\u5165"; case "invalid_element": - return `${issue4.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`; + return `${issue3.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`; default: return `\u65E0\u6548\u8F93\u5165`; } @@ -33209,38 +33209,38 @@ var init_zh_TW = __esm({ const TypeDictionary = { nan: "NaN" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${issue4.expected}\uFF0C\u4F46\u6536\u5230 ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${issue3.expected}\uFF0C\u4F46\u6536\u5230 ${received}`; } return `\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${expected}\uFF0C\u4F46\u6536\u5230 ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${stringifyPrimitive(issue4.values[0])}`; - return `\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${stringifyPrimitive(issue3.values[0])}`; + return `\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) - return `\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${issue4.origin ?? "\u503C"} \u61C9\u70BA ${adj}${issue4.maximum.toString()} ${sizing.unit ?? "\u500B\u5143\u7D20"}`; - return `\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${issue4.origin ?? "\u503C"} \u61C9\u70BA ${adj}${issue4.maximum.toString()}`; + return `\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${issue3.origin ?? "\u503C"} \u61C9\u70BA ${adj}${issue3.maximum.toString()} ${sizing.unit ?? "\u500B\u5143\u7D20"}`; + return `\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${issue3.origin ?? "\u503C"} \u61C9\u70BA ${adj}${issue3.maximum.toString()}`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) { - return `\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${issue4.origin} \u61C9\u70BA ${adj}${issue4.minimum.toString()} ${sizing.unit}`; + return `\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${issue3.origin} \u61C9\u70BA ${adj}${issue3.minimum.toString()} ${sizing.unit}`; } - return `\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${issue4.origin} \u61C9\u70BA ${adj}${issue4.minimum.toString()}`; + return `\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${issue3.origin} \u61C9\u70BA ${adj}${issue3.minimum.toString()}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") { return `\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${_issue.prefix}" \u958B\u982D`; } @@ -33250,18 +33250,18 @@ var init_zh_TW = __esm({ return `\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${_issue.includes}"`; if (_issue.format === "regex") return `\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${_issue.pattern}`; - return `\u7121\u6548\u7684 ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `\u7121\u6548\u7684 ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${issue4.divisor} \u7684\u500D\u6578`; + return `\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${issue3.divisor} \u7684\u500D\u6578`; case "unrecognized_keys": - return `\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${issue4.keys.length > 1 ? "\u5011" : ""}\uFF1A${joinValues(issue4.keys, "\u3001")}`; + return `\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${issue3.keys.length > 1 ? "\u5011" : ""}\uFF1A${joinValues(issue3.keys, "\u3001")}`; case "invalid_key": - return `${issue4.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`; + return `${issue3.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`; case "invalid_union": return "\u7121\u6548\u7684\u8F38\u5165\u503C"; case "invalid_element": - return `${issue4.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`; + return `${issue3.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`; default: return `\u7121\u6548\u7684\u8F38\u5165\u503C`; } @@ -33325,37 +33325,37 @@ var init_yo = __esm({ number: "n\u1ECD\u0301mb\xE0", array: "akop\u1ECD" }; - return (issue4) => { - switch (issue4.code) { + return (issue3) => { + switch (issue3.code) { case "invalid_type": { - const expected = TypeDictionary[issue4.expected] ?? issue4.expected; - const receivedType = parsedType(issue4.input); + const expected = TypeDictionary[issue3.expected] ?? issue3.expected; + const receivedType = parsedType(issue3.input); const received = TypeDictionary[receivedType] ?? receivedType; - if (/^[A-Z]/.test(issue4.expected)) { - return `\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${issue4.expected}, \xE0m\u1ECD\u0300 a r\xED ${received}`; + if (/^[A-Z]/.test(issue3.expected)) { + return `\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${issue3.expected}, \xE0m\u1ECD\u0300 a r\xED ${received}`; } return `\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${expected}, \xE0m\u1ECD\u0300 a r\xED ${received}`; } case "invalid_value": - if (issue4.values.length === 1) - return `\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${stringifyPrimitive(issue4.values[0])}`; - return `\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${joinValues(issue4.values, "|")}`; + if (issue3.values.length === 1) + return `\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${stringifyPrimitive(issue3.values[0])}`; + return `\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${joinValues(issue3.values, "|")}`; case "too_big": { - const adj = issue4.inclusive ? "<=" : "<"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? "<=" : "<"; + const sizing = getSizing(issue3.origin); if (sizing) - return `T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${issue4.origin ?? "iye"} ${sizing.verb} ${adj}${issue4.maximum} ${sizing.unit}`; - return `T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${adj}${issue4.maximum}`; + return `T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${issue3.origin ?? "iye"} ${sizing.verb} ${adj}${issue3.maximum} ${sizing.unit}`; + return `T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${adj}${issue3.maximum}`; } case "too_small": { - const adj = issue4.inclusive ? ">=" : ">"; - const sizing = getSizing(issue4.origin); + const adj = issue3.inclusive ? ">=" : ">"; + const sizing = getSizing(issue3.origin); if (sizing) - return `K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${issue4.origin} ${sizing.verb} ${adj}${issue4.minimum} ${sizing.unit}`; - return `K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${adj}${issue4.minimum}`; + return `K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${issue3.origin} ${sizing.verb} ${adj}${issue3.minimum} ${sizing.unit}`; + return `K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${adj}${issue3.minimum}`; } case "invalid_format": { - const _issue = issue4; + const _issue = issue3; if (_issue.format === "starts_with") return `\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${_issue.prefix}"`; if (_issue.format === "ends_with") @@ -33364,18 +33364,18 @@ var init_yo = __esm({ return `\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${_issue.includes}"`; if (_issue.format === "regex") return `\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${_issue.pattern}`; - return `A\u1E63\xEC\u1E63e: ${FormatDictionary[_issue.format] ?? issue4.format}`; + return `A\u1E63\xEC\u1E63e: ${FormatDictionary[_issue.format] ?? issue3.format}`; } case "not_multiple_of": - return `N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${issue4.divisor}`; + return `N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${issue3.divisor}`; case "unrecognized_keys": - return `B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${joinValues(issue4.keys, ", ")}`; + return `B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${joinValues(issue3.keys, ", ")}`; case "invalid_key": - return `B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${issue4.origin}`; + return `B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${issue3.origin}`; case "invalid_union": return "\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"; case "invalid_element": - return `Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${issue4.origin}`; + return `Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${issue3.origin}`; default: return "\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"; } @@ -33547,23 +33547,23 @@ var init_registries = __esm({ // node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/api.js // @__NO_SIDE_EFFECTS__ -function _string(Class3, params) { - return new Class3({ +function _string(Class2, params) { + return new Class2({ type: "string", ...normalizeParams(params) }); } // @__NO_SIDE_EFFECTS__ -function _coercedString(Class3, params) { - return new Class3({ +function _coercedString(Class2, params) { + return new Class2({ type: "string", coerce: true, ...normalizeParams(params) }); } // @__NO_SIDE_EFFECTS__ -function _email(Class3, params) { - return new Class3({ +function _email(Class2, params) { + return new Class2({ type: "string", format: "email", check: "string_format", @@ -33572,8 +33572,8 @@ function _email(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _guid(Class3, params) { - return new Class3({ +function _guid(Class2, params) { + return new Class2({ type: "string", format: "guid", check: "string_format", @@ -33582,8 +33582,8 @@ function _guid(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _uuid(Class3, params) { - return new Class3({ +function _uuid(Class2, params) { + return new Class2({ type: "string", format: "uuid", check: "string_format", @@ -33592,8 +33592,8 @@ function _uuid(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _uuidv4(Class3, params) { - return new Class3({ +function _uuidv4(Class2, params) { + return new Class2({ type: "string", format: "uuid", check: "string_format", @@ -33603,8 +33603,8 @@ function _uuidv4(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _uuidv6(Class3, params) { - return new Class3({ +function _uuidv6(Class2, params) { + return new Class2({ type: "string", format: "uuid", check: "string_format", @@ -33614,8 +33614,8 @@ function _uuidv6(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _uuidv7(Class3, params) { - return new Class3({ +function _uuidv7(Class2, params) { + return new Class2({ type: "string", format: "uuid", check: "string_format", @@ -33625,8 +33625,8 @@ function _uuidv7(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _url(Class3, params) { - return new Class3({ +function _url(Class2, params) { + return new Class2({ type: "string", format: "url", check: "string_format", @@ -33635,8 +33635,8 @@ function _url(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _emoji2(Class3, params) { - return new Class3({ +function _emoji2(Class2, params) { + return new Class2({ type: "string", format: "emoji", check: "string_format", @@ -33645,8 +33645,8 @@ function _emoji2(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _nanoid(Class3, params) { - return new Class3({ +function _nanoid(Class2, params) { + return new Class2({ type: "string", format: "nanoid", check: "string_format", @@ -33655,8 +33655,8 @@ function _nanoid(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _cuid(Class3, params) { - return new Class3({ +function _cuid(Class2, params) { + return new Class2({ type: "string", format: "cuid", check: "string_format", @@ -33665,8 +33665,8 @@ function _cuid(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _cuid2(Class3, params) { - return new Class3({ +function _cuid2(Class2, params) { + return new Class2({ type: "string", format: "cuid2", check: "string_format", @@ -33675,8 +33675,8 @@ function _cuid2(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _ulid(Class3, params) { - return new Class3({ +function _ulid(Class2, params) { + return new Class2({ type: "string", format: "ulid", check: "string_format", @@ -33685,8 +33685,8 @@ function _ulid(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _xid(Class3, params) { - return new Class3({ +function _xid(Class2, params) { + return new Class2({ type: "string", format: "xid", check: "string_format", @@ -33695,8 +33695,8 @@ function _xid(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _ksuid(Class3, params) { - return new Class3({ +function _ksuid(Class2, params) { + return new Class2({ type: "string", format: "ksuid", check: "string_format", @@ -33705,8 +33705,8 @@ function _ksuid(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _ipv4(Class3, params) { - return new Class3({ +function _ipv4(Class2, params) { + return new Class2({ type: "string", format: "ipv4", check: "string_format", @@ -33715,8 +33715,8 @@ function _ipv4(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _ipv6(Class3, params) { - return new Class3({ +function _ipv6(Class2, params) { + return new Class2({ type: "string", format: "ipv6", check: "string_format", @@ -33725,8 +33725,8 @@ function _ipv6(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _mac(Class3, params) { - return new Class3({ +function _mac(Class2, params) { + return new Class2({ type: "string", format: "mac", check: "string_format", @@ -33735,8 +33735,8 @@ function _mac(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _cidrv4(Class3, params) { - return new Class3({ +function _cidrv4(Class2, params) { + return new Class2({ type: "string", format: "cidrv4", check: "string_format", @@ -33745,8 +33745,8 @@ function _cidrv4(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _cidrv6(Class3, params) { - return new Class3({ +function _cidrv6(Class2, params) { + return new Class2({ type: "string", format: "cidrv6", check: "string_format", @@ -33755,8 +33755,8 @@ function _cidrv6(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _base64(Class3, params) { - return new Class3({ +function _base64(Class2, params) { + return new Class2({ type: "string", format: "base64", check: "string_format", @@ -33765,8 +33765,8 @@ function _base64(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _base64url(Class3, params) { - return new Class3({ +function _base64url(Class2, params) { + return new Class2({ type: "string", format: "base64url", check: "string_format", @@ -33775,8 +33775,8 @@ function _base64url(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _e164(Class3, params) { - return new Class3({ +function _e164(Class2, params) { + return new Class2({ type: "string", format: "e164", check: "string_format", @@ -33785,8 +33785,8 @@ function _e164(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _jwt(Class3, params) { - return new Class3({ +function _jwt(Class2, params) { + return new Class2({ type: "string", format: "jwt", check: "string_format", @@ -33795,8 +33795,8 @@ function _jwt(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _isoDateTime(Class3, params) { - return new Class3({ +function _isoDateTime(Class2, params) { + return new Class2({ type: "string", format: "datetime", check: "string_format", @@ -33807,8 +33807,8 @@ function _isoDateTime(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _isoDate(Class3, params) { - return new Class3({ +function _isoDate(Class2, params) { + return new Class2({ type: "string", format: "date", check: "string_format", @@ -33816,8 +33816,8 @@ function _isoDate(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _isoTime(Class3, params) { - return new Class3({ +function _isoTime(Class2, params) { + return new Class2({ type: "string", format: "time", check: "string_format", @@ -33826,8 +33826,8 @@ function _isoTime(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _isoDuration(Class3, params) { - return new Class3({ +function _isoDuration(Class2, params) { + return new Class2({ type: "string", format: "duration", check: "string_format", @@ -33835,16 +33835,16 @@ function _isoDuration(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _number(Class3, params) { - return new Class3({ +function _number(Class2, params) { + return new Class2({ type: "number", checks: [], ...normalizeParams(params) }); } // @__NO_SIDE_EFFECTS__ -function _coercedNumber(Class3, params) { - return new Class3({ +function _coercedNumber(Class2, params) { + return new Class2({ type: "number", coerce: true, checks: [], @@ -33852,8 +33852,8 @@ function _coercedNumber(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _int(Class3, params) { - return new Class3({ +function _int(Class2, params) { + return new Class2({ type: "number", check: "number_format", abort: false, @@ -33862,8 +33862,8 @@ function _int(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _float32(Class3, params) { - return new Class3({ +function _float32(Class2, params) { + return new Class2({ type: "number", check: "number_format", abort: false, @@ -33872,8 +33872,8 @@ function _float32(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _float64(Class3, params) { - return new Class3({ +function _float64(Class2, params) { + return new Class2({ type: "number", check: "number_format", abort: false, @@ -33882,8 +33882,8 @@ function _float64(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _int32(Class3, params) { - return new Class3({ +function _int32(Class2, params) { + return new Class2({ type: "number", check: "number_format", abort: false, @@ -33892,8 +33892,8 @@ function _int32(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _uint32(Class3, params) { - return new Class3({ +function _uint32(Class2, params) { + return new Class2({ type: "number", check: "number_format", abort: false, @@ -33902,38 +33902,38 @@ function _uint32(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _boolean(Class3, params) { - return new Class3({ +function _boolean(Class2, params) { + return new Class2({ type: "boolean", ...normalizeParams(params) }); } // @__NO_SIDE_EFFECTS__ -function _coercedBoolean(Class3, params) { - return new Class3({ +function _coercedBoolean(Class2, params) { + return new Class2({ type: "boolean", coerce: true, ...normalizeParams(params) }); } // @__NO_SIDE_EFFECTS__ -function _bigint(Class3, params) { - return new Class3({ +function _bigint(Class2, params) { + return new Class2({ type: "bigint", ...normalizeParams(params) }); } // @__NO_SIDE_EFFECTS__ -function _coercedBigint(Class3, params) { - return new Class3({ +function _coercedBigint(Class2, params) { + return new Class2({ type: "bigint", coerce: true, ...normalizeParams(params) }); } // @__NO_SIDE_EFFECTS__ -function _int64(Class3, params) { - return new Class3({ +function _int64(Class2, params) { + return new Class2({ type: "bigint", check: "bigint_format", abort: false, @@ -33942,8 +33942,8 @@ function _int64(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _uint64(Class3, params) { - return new Class3({ +function _uint64(Class2, params) { + return new Class2({ type: "bigint", check: "bigint_format", abort: false, @@ -33952,70 +33952,70 @@ function _uint64(Class3, params) { }); } // @__NO_SIDE_EFFECTS__ -function _symbol(Class3, params) { - return new Class3({ +function _symbol(Class2, params) { + return new Class2({ type: "symbol", ...normalizeParams(params) }); } // @__NO_SIDE_EFFECTS__ -function _undefined2(Class3, params) { - return new Class3({ +function _undefined2(Class2, params) { + return new Class2({ type: "undefined", ...normalizeParams(params) }); } // @__NO_SIDE_EFFECTS__ -function _null2(Class3, params) { - return new Class3({ +function _null2(Class2, params) { + return new Class2({ type: "null", ...normalizeParams(params) }); } // @__NO_SIDE_EFFECTS__ -function _any(Class3) { - return new Class3({ +function _any(Class2) { + return new Class2({ type: "any" }); } // @__NO_SIDE_EFFECTS__ -function _unknown(Class3) { - return new Class3({ +function _unknown(Class2) { + return new Class2({ type: "unknown" }); } // @__NO_SIDE_EFFECTS__ -function _never(Class3, params) { - return new Class3({ +function _never(Class2, params) { + return new Class2({ type: "never", ...normalizeParams(params) }); } // @__NO_SIDE_EFFECTS__ -function _void(Class3, params) { - return new Class3({ +function _void(Class2, params) { + return new Class2({ type: "void", ...normalizeParams(params) }); } // @__NO_SIDE_EFFECTS__ -function _date(Class3, params) { - return new Class3({ +function _date(Class2, params) { + return new Class2({ type: "date", ...normalizeParams(params) }); } // @__NO_SIDE_EFFECTS__ -function _coercedDate(Class3, params) { - return new Class3({ +function _coercedDate(Class2, params) { + return new Class2({ type: "date", coerce: true, ...normalizeParams(params) }); } // @__NO_SIDE_EFFECTS__ -function _nan(Class3, params) { - return new Class3({ +function _nan(Class2, params) { + return new Class2({ type: "nan", ...normalizeParams(params) }); @@ -34226,8 +34226,8 @@ function _slugify() { return /* @__PURE__ */ _overwrite((input) => slugify(input)); } // @__NO_SIDE_EFFECTS__ -function _array(Class3, element, params) { - return new Class3({ +function _array(Class2, element, params) { + return new Class2({ type: "array", element, // get element() { @@ -34237,15 +34237,15 @@ function _array(Class3, element, params) { }); } // @__NO_SIDE_EFFECTS__ -function _union(Class3, options, params) { - return new Class3({ +function _union(Class2, options, params) { + return new Class2({ type: "union", options, ...normalizeParams(params) }); } -function _xor(Class3, options, params) { - return new Class3({ +function _xor(Class2, options, params) { + return new Class2({ type: "union", options, inclusive: false, @@ -34253,8 +34253,8 @@ function _xor(Class3, options, params) { }); } // @__NO_SIDE_EFFECTS__ -function _discriminatedUnion(Class3, discriminator, options, params) { - return new Class3({ +function _discriminatedUnion(Class2, discriminator, options, params) { + return new Class2({ type: "union", options, discriminator, @@ -34262,19 +34262,19 @@ function _discriminatedUnion(Class3, discriminator, options, params) { }); } // @__NO_SIDE_EFFECTS__ -function _intersection(Class3, left, right) { - return new Class3({ +function _intersection(Class2, left, right) { + return new Class2({ type: "intersection", left, right }); } // @__NO_SIDE_EFFECTS__ -function _tuple(Class3, items, _paramsOrRest, _params) { +function _tuple(Class2, items, _paramsOrRest, _params) { const hasRest = _paramsOrRest instanceof $ZodType; const params = hasRest ? _params : _paramsOrRest; const rest = hasRest ? _paramsOrRest : null; - return new Class3({ + return new Class2({ type: "tuple", items, rest, @@ -34282,8 +34282,8 @@ function _tuple(Class3, items, _paramsOrRest, _params) { }); } // @__NO_SIDE_EFFECTS__ -function _record(Class3, keyType, valueType, params) { - return new Class3({ +function _record(Class2, keyType, valueType, params) { + return new Class2({ type: "record", keyType, valueType, @@ -34291,8 +34291,8 @@ function _record(Class3, keyType, valueType, params) { }); } // @__NO_SIDE_EFFECTS__ -function _map(Class3, keyType, valueType, params) { - return new Class3({ +function _map(Class2, keyType, valueType, params) { + return new Class2({ type: "map", keyType, valueType, @@ -34300,69 +34300,69 @@ function _map(Class3, keyType, valueType, params) { }); } // @__NO_SIDE_EFFECTS__ -function _set(Class3, valueType, params) { - return new Class3({ +function _set(Class2, valueType, params) { + return new Class2({ type: "set", valueType, ...normalizeParams(params) }); } // @__NO_SIDE_EFFECTS__ -function _enum(Class3, values, params) { +function _enum(Class2, values, params) { const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values; - return new Class3({ + return new Class2({ type: "enum", entries, ...normalizeParams(params) }); } // @__NO_SIDE_EFFECTS__ -function _nativeEnum(Class3, entries, params) { - return new Class3({ +function _nativeEnum(Class2, entries, params) { + return new Class2({ type: "enum", entries, ...normalizeParams(params) }); } // @__NO_SIDE_EFFECTS__ -function _literal(Class3, value2, params) { - return new Class3({ +function _literal(Class2, value2, params) { + return new Class2({ type: "literal", values: Array.isArray(value2) ? value2 : [value2], ...normalizeParams(params) }); } // @__NO_SIDE_EFFECTS__ -function _file(Class3, params) { - return new Class3({ +function _file(Class2, params) { + return new Class2({ type: "file", ...normalizeParams(params) }); } // @__NO_SIDE_EFFECTS__ -function _transform(Class3, fn2) { - return new Class3({ +function _transform(Class2, fn2) { + return new Class2({ type: "transform", transform: fn2 }); } // @__NO_SIDE_EFFECTS__ -function _optional(Class3, innerType) { - return new Class3({ +function _optional(Class2, innerType) { + return new Class2({ type: "optional", innerType }); } // @__NO_SIDE_EFFECTS__ -function _nullable(Class3, innerType) { - return new Class3({ +function _nullable(Class2, innerType) { + return new Class2({ type: "nullable", innerType }); } // @__NO_SIDE_EFFECTS__ -function _default(Class3, innerType, defaultValue) { - return new Class3({ +function _default(Class2, innerType, defaultValue) { + return new Class2({ type: "default", innerType, get defaultValue() { @@ -34371,70 +34371,70 @@ function _default(Class3, innerType, defaultValue) { }); } // @__NO_SIDE_EFFECTS__ -function _nonoptional(Class3, innerType, params) { - return new Class3({ +function _nonoptional(Class2, innerType, params) { + return new Class2({ type: "nonoptional", innerType, ...normalizeParams(params) }); } // @__NO_SIDE_EFFECTS__ -function _success(Class3, innerType) { - return new Class3({ +function _success(Class2, innerType) { + return new Class2({ type: "success", innerType }); } // @__NO_SIDE_EFFECTS__ -function _catch(Class3, innerType, catchValue) { - return new Class3({ +function _catch(Class2, innerType, catchValue) { + return new Class2({ type: "catch", innerType, catchValue: typeof catchValue === "function" ? catchValue : () => catchValue }); } // @__NO_SIDE_EFFECTS__ -function _pipe(Class3, in_, out) { - return new Class3({ +function _pipe(Class2, in_, out) { + return new Class2({ type: "pipe", in: in_, out }); } // @__NO_SIDE_EFFECTS__ -function _readonly(Class3, innerType) { - return new Class3({ +function _readonly(Class2, innerType) { + return new Class2({ type: "readonly", innerType }); } // @__NO_SIDE_EFFECTS__ -function _templateLiteral(Class3, parts, params) { - return new Class3({ +function _templateLiteral(Class2, parts, params) { + return new Class2({ type: "template_literal", parts, ...normalizeParams(params) }); } // @__NO_SIDE_EFFECTS__ -function _lazy(Class3, getter) { - return new Class3({ +function _lazy(Class2, getter) { + return new Class2({ type: "lazy", getter }); } // @__NO_SIDE_EFFECTS__ -function _promise(Class3, innerType) { - return new Class3({ +function _promise(Class2, innerType) { + return new Class2({ type: "promise", innerType }); } // @__NO_SIDE_EFFECTS__ -function _custom(Class3, fn2, _params) { +function _custom(Class2, fn2, _params) { const norm2 = normalizeParams(_params); norm2.abort ?? (norm2.abort = true); - const schema2 = new Class3({ + const schema2 = new Class2({ type: "custom", check: "custom", fn: fn2, @@ -34443,8 +34443,8 @@ function _custom(Class3, fn2, _params) { return schema2; } // @__NO_SIDE_EFFECTS__ -function _refine(Class3, fn2, _params) { - const schema2 = new Class3({ +function _refine(Class2, fn2, _params) { + const schema2 = new Class2({ type: "custom", check: "custom", fn: fn2, @@ -34455,11 +34455,11 @@ function _refine(Class3, fn2, _params) { // @__NO_SIDE_EFFECTS__ function _superRefine(fn2) { const ch = /* @__PURE__ */ _check((payload) => { - payload.addIssue = (issue4) => { - if (typeof issue4 === "string") { - payload.issues.push(issue(issue4, payload.value, ch._zod.def)); + payload.addIssue = (issue3) => { + if (typeof issue3 === "string") { + payload.issues.push(issue(issue3, payload.value, ch._zod.def)); } else { - const _issue = issue4; + const _issue = issue3; if (_issue.fatal) _issue.continue = false; _issue.code ?? (_issue.code = "custom"); @@ -34560,7 +34560,7 @@ function _stringbool(Classes, _params) { return codec2; } // @__NO_SIDE_EFFECTS__ -function _stringFormat(Class3, format2, fnOrRegex, _params = {}) { +function _stringFormat(Class2, format2, fnOrRegex, _params = {}) { const params = normalizeParams(_params); const def = { ...normalizeParams(_params), @@ -34573,7 +34573,7 @@ function _stringFormat(Class3, format2, fnOrRegex, _params = {}) { if (fnOrRegex instanceof RegExp) { def.pattern = fnOrRegex; } - const inst = new Class3(def); + const inst = new Class2(def); return inst; } var TimePrecision; @@ -34670,8 +34670,8 @@ function process2(schema2, ctx, _params = { path: [], schemaPath: [] }) { return _result.schema; } function extractDefs(ctx, schema2) { - const root2 = ctx.seen.get(schema2); - if (!root2) + const root = ctx.seen.get(schema2); + if (!root) throw new Error("Unprocessed schema. This is a bug in Zod."); const idToSchema = /* @__PURE__ */ new Map(); for (const entry of ctx.seen.entries()) { @@ -34696,7 +34696,7 @@ function extractDefs(ctx, schema2) { entry[1].defId = id; return { defId: id, ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}` }; } - if (entry[1] === root2) { + if (entry[1] === root) { return { ref: "#" }; } const uriPrefix = `#`; @@ -34760,8 +34760,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs. } } function finalize(ctx, schema2) { - const root2 = ctx.seen.get(schema2); - if (!root2) + const root = ctx.seen.get(schema2); + if (!root) throw new Error("Unprocessed schema. This is a bug in Zod."); const flattenRef = (zodSchema) => { const seen = ctx.seen.get(zodSchema); @@ -34844,7 +34844,7 @@ function finalize(ctx, schema2) { throw new Error("Schema is missing an `id` property"); result.$id = ctx.external.uri(id); } - Object.assign(result, root2.def ?? root2.schema); + Object.assign(result, root.def ?? root.schema); const defs = ctx.external?.defs ?? {}; for (const entry of ctx.seen.entries()) { const seen = entry[1]; @@ -34954,21 +34954,21 @@ var init_to_json_schema = __esm({ // node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/json-schema-processors.js function toJSONSchema(input, params) { if ("_idmap" in input) { - const registry5 = input; + const registry4 = input; const ctx2 = initializeContext({ ...params, processors: allProcessors }); const defs = {}; - for (const entry of registry5._idmap.entries()) { + for (const entry of registry4._idmap.entries()) { const [_, schema2] = entry; process2(schema2, ctx2); } const schemas = {}; const external = { - registry: registry5, + registry: registry4, uri: params?.uri, defs }; ctx2.external = external; - for (const entry of registry5._idmap.entries()) { + for (const entry of registry4._idmap.entries()) { const [key, schema2] = entry; extractDefs(ctx2, schema2); schemas[key] = finalize(ctx2, schema2); @@ -36069,38 +36069,38 @@ function parseBigintDef(def, refs) { }; if (!def.checks) return res; - for (const check4 of def.checks) { - switch (check4.kind) { + for (const check3 of def.checks) { + switch (check3.kind) { case "min": if (refs.target === "jsonSchema7") { - if (check4.inclusive) { - setResponseValueAndErrors(res, "minimum", check4.value, check4.message, refs); + if (check3.inclusive) { + setResponseValueAndErrors(res, "minimum", check3.value, check3.message, refs); } else { - setResponseValueAndErrors(res, "exclusiveMinimum", check4.value, check4.message, refs); + setResponseValueAndErrors(res, "exclusiveMinimum", check3.value, check3.message, refs); } } else { - if (!check4.inclusive) { + if (!check3.inclusive) { res.exclusiveMinimum = true; } - setResponseValueAndErrors(res, "minimum", check4.value, check4.message, refs); + setResponseValueAndErrors(res, "minimum", check3.value, check3.message, refs); } break; case "max": if (refs.target === "jsonSchema7") { - if (check4.inclusive) { - setResponseValueAndErrors(res, "maximum", check4.value, check4.message, refs); + if (check3.inclusive) { + setResponseValueAndErrors(res, "maximum", check3.value, check3.message, refs); } else { - setResponseValueAndErrors(res, "exclusiveMaximum", check4.value, check4.message, refs); + setResponseValueAndErrors(res, "exclusiveMaximum", check3.value, check3.message, refs); } } else { - if (!check4.inclusive) { + if (!check3.inclusive) { res.exclusiveMaximum = true; } - setResponseValueAndErrors(res, "maximum", check4.value, check4.message, refs); + setResponseValueAndErrors(res, "maximum", check3.value, check3.message, refs); } break; case "multipleOf": - setResponseValueAndErrors(res, "multipleOf", check4.value, check4.message, refs); + setResponseValueAndErrors(res, "multipleOf", check3.value, check3.message, refs); break; } } @@ -36180,15 +36180,15 @@ var init_date = __esm({ if (refs.target === "openApi3") { return res; } - for (const check4 of def.checks) { - switch (check4.kind) { + for (const check3 of def.checks) { + switch (check3.kind) { case "min": setResponseValueAndErrors( res, "minimum", - check4.value, + check3.value, // This is in milliseconds - check4.message, + check3.message, refs ); break; @@ -36196,9 +36196,9 @@ var init_date = __esm({ setResponseValueAndErrors( res, "maximum", - check4.value, + check3.value, // This is in milliseconds - check4.message, + check3.message, refs ); break; @@ -36295,20 +36295,20 @@ var init_intersection = __esm({ // node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.5/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js function parseLiteralDef(def, refs) { - const parsedType3 = typeof def.value; - if (parsedType3 !== "bigint" && parsedType3 !== "number" && parsedType3 !== "boolean" && parsedType3 !== "string") { + const parsedType2 = typeof def.value; + if (parsedType2 !== "bigint" && parsedType2 !== "number" && parsedType2 !== "boolean" && parsedType2 !== "string") { return { type: Array.isArray(def.value) ? "array" : "object" }; } if (refs.target === "openApi3") { return { - type: parsedType3 === "bigint" ? "integer" : parsedType3, + type: parsedType2 === "bigint" ? "integer" : parsedType2, enum: [def.value] }; } return { - type: parsedType3 === "bigint" ? "integer" : parsedType3, + type: parsedType2 === "bigint" ? "integer" : parsedType2, const: def.value }; } @@ -36323,118 +36323,118 @@ function parseStringDef(def, refs) { type: "string" }; if (def.checks) { - for (const check4 of def.checks) { - switch (check4.kind) { + for (const check3 of def.checks) { + switch (check3.kind) { case "min": - setResponseValueAndErrors(res, "minLength", typeof res.minLength === "number" ? Math.max(res.minLength, check4.value) : check4.value, check4.message, refs); + setResponseValueAndErrors(res, "minLength", typeof res.minLength === "number" ? Math.max(res.minLength, check3.value) : check3.value, check3.message, refs); break; case "max": - setResponseValueAndErrors(res, "maxLength", typeof res.maxLength === "number" ? Math.min(res.maxLength, check4.value) : check4.value, check4.message, refs); + setResponseValueAndErrors(res, "maxLength", typeof res.maxLength === "number" ? Math.min(res.maxLength, check3.value) : check3.value, check3.message, refs); break; case "email": switch (refs.emailStrategy) { case "format:email": - addFormat(res, "email", check4.message, refs); + addFormat(res, "email", check3.message, refs); break; case "format:idn-email": - addFormat(res, "idn-email", check4.message, refs); + addFormat(res, "idn-email", check3.message, refs); break; case "pattern:zod": - addPattern(res, zodPatterns.email, check4.message, refs); + addPattern(res, zodPatterns.email, check3.message, refs); break; } break; case "url": - addFormat(res, "uri", check4.message, refs); + addFormat(res, "uri", check3.message, refs); break; case "uuid": - addFormat(res, "uuid", check4.message, refs); + addFormat(res, "uuid", check3.message, refs); break; case "regex": - addPattern(res, check4.regex, check4.message, refs); + addPattern(res, check3.regex, check3.message, refs); break; case "cuid": - addPattern(res, zodPatterns.cuid, check4.message, refs); + addPattern(res, zodPatterns.cuid, check3.message, refs); break; case "cuid2": - addPattern(res, zodPatterns.cuid2, check4.message, refs); + addPattern(res, zodPatterns.cuid2, check3.message, refs); break; case "startsWith": - addPattern(res, RegExp(`^${escapeLiteralCheckValue(check4.value, refs)}`), check4.message, refs); + addPattern(res, RegExp(`^${escapeLiteralCheckValue(check3.value, refs)}`), check3.message, refs); break; case "endsWith": - addPattern(res, RegExp(`${escapeLiteralCheckValue(check4.value, refs)}$`), check4.message, refs); + addPattern(res, RegExp(`${escapeLiteralCheckValue(check3.value, refs)}$`), check3.message, refs); break; case "datetime": - addFormat(res, "date-time", check4.message, refs); + addFormat(res, "date-time", check3.message, refs); break; case "date": - addFormat(res, "date", check4.message, refs); + addFormat(res, "date", check3.message, refs); break; case "time": - addFormat(res, "time", check4.message, refs); + addFormat(res, "time", check3.message, refs); break; case "duration": - addFormat(res, "duration", check4.message, refs); + addFormat(res, "duration", check3.message, refs); break; case "length": - setResponseValueAndErrors(res, "minLength", typeof res.minLength === "number" ? Math.max(res.minLength, check4.value) : check4.value, check4.message, refs); - setResponseValueAndErrors(res, "maxLength", typeof res.maxLength === "number" ? Math.min(res.maxLength, check4.value) : check4.value, check4.message, refs); + setResponseValueAndErrors(res, "minLength", typeof res.minLength === "number" ? Math.max(res.minLength, check3.value) : check3.value, check3.message, refs); + setResponseValueAndErrors(res, "maxLength", typeof res.maxLength === "number" ? Math.min(res.maxLength, check3.value) : check3.value, check3.message, refs); break; case "includes": { - addPattern(res, RegExp(escapeLiteralCheckValue(check4.value, refs)), check4.message, refs); + addPattern(res, RegExp(escapeLiteralCheckValue(check3.value, refs)), check3.message, refs); break; } case "ip": { - if (check4.version !== "v6") { - addFormat(res, "ipv4", check4.message, refs); + if (check3.version !== "v6") { + addFormat(res, "ipv4", check3.message, refs); } - if (check4.version !== "v4") { - addFormat(res, "ipv6", check4.message, refs); + if (check3.version !== "v4") { + addFormat(res, "ipv6", check3.message, refs); } break; } case "base64url": - addPattern(res, zodPatterns.base64url, check4.message, refs); + addPattern(res, zodPatterns.base64url, check3.message, refs); break; case "jwt": - addPattern(res, zodPatterns.jwt, check4.message, refs); + addPattern(res, zodPatterns.jwt, check3.message, refs); break; case "cidr": { - if (check4.version !== "v6") { - addPattern(res, zodPatterns.ipv4Cidr, check4.message, refs); + if (check3.version !== "v6") { + addPattern(res, zodPatterns.ipv4Cidr, check3.message, refs); } - if (check4.version !== "v4") { - addPattern(res, zodPatterns.ipv6Cidr, check4.message, refs); + if (check3.version !== "v4") { + addPattern(res, zodPatterns.ipv6Cidr, check3.message, refs); } break; } case "emoji": - addPattern(res, zodPatterns.emoji(), check4.message, refs); + addPattern(res, zodPatterns.emoji(), check3.message, refs); break; case "ulid": { - addPattern(res, zodPatterns.ulid, check4.message, refs); + addPattern(res, zodPatterns.ulid, check3.message, refs); break; } case "base64": { switch (refs.base64Strategy) { case "format:binary": { - addFormat(res, "binary", check4.message, refs); + addFormat(res, "binary", check3.message, refs); break; } case "contentEncoding:base64": { - setResponseValueAndErrors(res, "contentEncoding", "base64", check4.message, refs); + setResponseValueAndErrors(res, "contentEncoding", "base64", check3.message, refs); break; } case "pattern:zod": { - addPattern(res, zodPatterns.base64, check4.message, refs); + addPattern(res, zodPatterns.base64, check3.message, refs); break; } } break; } case "nanoid": { - addPattern(res, zodPatterns.nanoid, check4.message, refs); + addPattern(res, zodPatterns.nanoid, check3.message, refs); } case "toLowerCase": case "toUpperCase": @@ -36442,14 +36442,14 @@ function parseStringDef(def, refs) { break; default: /* @__PURE__ */ ((_) => { - })(check4); + })(check3); } } } return res; } -function escapeLiteralCheckValue(literal4, refs) { - return refs.patternStrategy === "escape" ? escapeNonAlphaNumeric(literal4) : literal4; +function escapeLiteralCheckValue(literal3, refs) { + return refs.patternStrategy === "escape" ? escapeNonAlphaNumeric(literal3) : literal3; } function escapeNonAlphaNumeric(source) { let result = ""; @@ -36907,42 +36907,42 @@ function parseNumberDef(def, refs) { }; if (!def.checks) return res; - for (const check4 of def.checks) { - switch (check4.kind) { + for (const check3 of def.checks) { + switch (check3.kind) { case "int": res.type = "integer"; - addErrorMessage(res, "type", check4.message, refs); + addErrorMessage(res, "type", check3.message, refs); break; case "min": if (refs.target === "jsonSchema7") { - if (check4.inclusive) { - setResponseValueAndErrors(res, "minimum", check4.value, check4.message, refs); + if (check3.inclusive) { + setResponseValueAndErrors(res, "minimum", check3.value, check3.message, refs); } else { - setResponseValueAndErrors(res, "exclusiveMinimum", check4.value, check4.message, refs); + setResponseValueAndErrors(res, "exclusiveMinimum", check3.value, check3.message, refs); } } else { - if (!check4.inclusive) { + if (!check3.inclusive) { res.exclusiveMinimum = true; } - setResponseValueAndErrors(res, "minimum", check4.value, check4.message, refs); + setResponseValueAndErrors(res, "minimum", check3.value, check3.message, refs); } break; case "max": if (refs.target === "jsonSchema7") { - if (check4.inclusive) { - setResponseValueAndErrors(res, "maximum", check4.value, check4.message, refs); + if (check3.inclusive) { + setResponseValueAndErrors(res, "maximum", check3.value, check3.message, refs); } else { - setResponseValueAndErrors(res, "exclusiveMaximum", check4.value, check4.message, refs); + setResponseValueAndErrors(res, "exclusiveMaximum", check3.value, check3.message, refs); } } else { - if (!check4.inclusive) { + if (!check3.inclusive) { res.exclusiveMaximum = true; } - setResponseValueAndErrors(res, "maximum", check4.value, check4.message, refs); + setResponseValueAndErrors(res, "maximum", check3.value, check3.message, refs); } break; case "multipleOf": - setResponseValueAndErrors(res, "multipleOf", check4.value, check4.message, refs); + setResponseValueAndErrors(res, "multipleOf", check3.value, check3.message, refs); break; } } @@ -36961,7 +36961,7 @@ function parseObjectDef(def, refs) { type: "object", properties: {} }; - const required4 = []; + const required3 = []; const shape = def.shape(); for (const propName in shape) { let propDef = shape[propName]; @@ -36988,11 +36988,11 @@ function parseObjectDef(def, refs) { } result.properties[propName] = parsedDef; if (!propOptional) { - required4.push(propName); + required3.push(propName); } } - if (required4.length) { - result.required = required4; + if (required3.length) { + result.required = required3; } const additionalProperties = decideAdditionalProperties(def, refs); if (additionalProperties !== void 0) { @@ -37970,9 +37970,9 @@ var require_codegen = __commonJS({ } }; var Throw = class extends Node { - constructor(error50) { + constructor(error49) { super(); - this.error = error50; + this.error = error49; } render({ _n }) { return `throw ${this.error};` + _n; @@ -38209,9 +38209,9 @@ var require_codegen = __commonJS({ } }; var Catch = class extends BlockNode { - constructor(error50) { + constructor(error49) { super(); - this.error = error50; + this.error = error49; } render(opts) { return `catch(${this.error})` + super.render(opts); @@ -38402,9 +38402,9 @@ var require_codegen = __commonJS({ this._blockNode(node2); this.code(tryBody); if (catchCode) { - const error50 = this.name("e"); - this._currNode = node2.catch = new Catch(error50); - catchCode(error50); + const error49 = this.name("e"); + this._currNode = node2.catch = new Catch(error49); + catchCode(error49); } if (finallyCode) { this._currNode = node2.finally = new Finally(); @@ -38413,8 +38413,8 @@ var require_codegen = __commonJS({ return this._endBlockNode(Catch, Finally); } // `throw` statement - throw(error50) { - return this._leafNode(new Throw(error50)); + throw(error49) { + return this._leafNode(new Throw(error49)); } // start self-balancing block block(body, nodeCount) { @@ -38641,9 +38641,9 @@ var require_util8 = __commonJS({ } } exports.eachItem = eachItem; - function makeMergeEvaluated({ mergeNames, mergeToName, mergeValues: mergeValues5, resultToName }) { + function makeMergeEvaluated({ mergeNames, mergeToName, mergeValues: mergeValues4, resultToName }) { return (gen, from, to, toName) => { - const res = to === void 0 ? from : to instanceof codegen_1.Name ? (from instanceof codegen_1.Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to) : from instanceof codegen_1.Name ? (mergeToName(gen, to, from), from) : mergeValues5(from, to); + const res = to === void 0 ? from : to instanceof codegen_1.Name ? (from instanceof codegen_1.Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to) : from instanceof codegen_1.Name ? (mergeToName(gen, to, from), from) : mergeValues4(from, to); return toName === codegen_1.Name && !(res instanceof codegen_1.Name) ? resultToName(gen, res) : res; }; } @@ -38770,10 +38770,10 @@ var require_errors2 = __commonJS({ exports.keyword$DataError = { message: ({ keyword, schemaType }) => schemaType ? (0, codegen_1.str)`"${keyword}" keyword must be ${schemaType} ($data)` : (0, codegen_1.str)`"${keyword}" keyword is invalid ($data)` }; - function reportError(cxt, error50 = exports.keywordError, errorPaths, overrideAllErrors) { + function reportError(cxt, error49 = exports.keywordError, errorPaths, overrideAllErrors) { const { it } = cxt; const { gen, compositeRule, allErrors } = it; - const errObj = errorObjectCode(cxt, error50, errorPaths); + const errObj = errorObjectCode(cxt, error49, errorPaths); if (overrideAllErrors !== null && overrideAllErrors !== void 0 ? overrideAllErrors : compositeRule || allErrors) { addError(gen, errObj); } else { @@ -38781,10 +38781,10 @@ var require_errors2 = __commonJS({ } } exports.reportError = reportError; - function reportExtraError(cxt, error50 = exports.keywordError, errorPaths) { + function reportExtraError(cxt, error49 = exports.keywordError, errorPaths) { const { it } = cxt; const { gen, compositeRule, allErrors } = it; - const errObj = errorObjectCode(cxt, error50, errorPaths); + const errObj = errorObjectCode(cxt, error49, errorPaths); addError(gen, errObj); if (!(compositeRule || allErrors)) { returnErrors(it, names_1.default.vErrors); @@ -38835,19 +38835,19 @@ var require_errors2 = __commonJS({ schema: new codegen_1.Name("schema"), parentSchema: new codegen_1.Name("parentSchema") }; - function errorObjectCode(cxt, error50, errorPaths) { + function errorObjectCode(cxt, error49, errorPaths) { const { createErrors } = cxt.it; if (createErrors === false) return (0, codegen_1._)`{}`; - return errorObject(cxt, error50, errorPaths); + return errorObject(cxt, error49, errorPaths); } - function errorObject(cxt, error50, errorPaths = {}) { + function errorObject(cxt, error49, errorPaths = {}) { const { gen, it } = cxt; const keyValues = [ errorInstancePath(it, errorPaths), errorSchemaPath(cxt, errorPaths) ]; - extraErrorProps(cxt, error50, keyValues); + extraErrorProps(cxt, error49, keyValues); return gen.object(...keyValues); } function errorInstancePath({ errorPath }, { instancePath }) { @@ -40475,22 +40475,22 @@ var require_compile = __commonJS({ } } exports.compileSchema = compileSchema; - function resolveRef2(root2, baseId, ref) { + function resolveRef2(root, baseId, ref) { var _a2; ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref); - const schOrFunc = root2.refs[ref]; + const schOrFunc = root.refs[ref]; if (schOrFunc) return schOrFunc; - let _sch = resolve2.call(this, root2, ref); + let _sch = resolve2.call(this, root, ref); if (_sch === void 0) { - const schema2 = (_a2 = root2.localRefs) === null || _a2 === void 0 ? void 0 : _a2[ref]; + const schema2 = (_a2 = root.localRefs) === null || _a2 === void 0 ? void 0 : _a2[ref]; const { schemaId } = this.opts; if (schema2) - _sch = new SchemaEnv({ schema: schema2, schemaId, root: root2, baseId }); + _sch = new SchemaEnv({ schema: schema2, schemaId, root, baseId }); } if (_sch === void 0) return; - return root2.refs[ref] = inlineOrCompile.call(this, _sch); + return root.refs[ref] = inlineOrCompile.call(this, _sch); } exports.resolveRef = resolveRef2; function inlineOrCompile(sch) { @@ -40508,23 +40508,23 @@ var require_compile = __commonJS({ function sameSchemaEnv(s1, s2) { return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId; } - function resolve2(root2, ref) { + function resolve2(root, ref) { let sch; while (typeof (sch = this.refs[ref]) == "string") ref = sch; - return sch || this.schemas[ref] || resolveSchema.call(this, root2, ref); + return sch || this.schemas[ref] || resolveSchema.call(this, root, ref); } - function resolveSchema(root2, ref) { + function resolveSchema(root, ref) { const p = this.opts.uriResolver.parse(ref); const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p); - let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root2.baseId, void 0); - if (Object.keys(root2.schema).length > 0 && refPath === baseId) { - return getJsonPointer.call(this, p, root2); + let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root.baseId, void 0); + if (Object.keys(root.schema).length > 0 && refPath === baseId) { + return getJsonPointer.call(this, p, root); } const id = (0, resolve_1.normalizeId)(refPath); const schOrRef = this.refs[id] || this.schemas[id]; if (typeof schOrRef == "string") { - const sch = resolveSchema.call(this, root2, schOrRef); + const sch = resolveSchema.call(this, root, schOrRef); if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object") return; return getJsonPointer.call(this, p, sch); @@ -40539,7 +40539,7 @@ var require_compile = __commonJS({ const schId = schema2[schemaId]; if (schId) baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId); - return new SchemaEnv({ schema: schema2, schemaId, root: root2, baseId }); + return new SchemaEnv({ schema: schema2, schemaId, root, baseId }); } return getJsonPointer.call(this, p, schOrRef); } @@ -40551,7 +40551,7 @@ var require_compile = __commonJS({ "dependencies", "definitions" ]); - function getJsonPointer(parsedRef, { baseId, schema: schema2, root: root2 }) { + function getJsonPointer(parsedRef, { baseId, schema: schema2, root }) { var _a2; if (((_a2 = parsedRef.fragment) === null || _a2 === void 0 ? void 0 : _a2[0]) !== "/") return; @@ -40570,10 +40570,10 @@ var require_compile = __commonJS({ let env3; if (typeof schema2 != "boolean" && schema2.$ref && !(0, util_1.schemaHasRulesButRef)(schema2, this.RULES)) { const $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schema2.$ref); - env3 = resolveSchema.call(this, root2, $ref); + env3 = resolveSchema.call(this, root, $ref); } const { schemaId } = this.opts; - env3 = env3 || new SchemaEnv({ schema: schema2, schemaId, root: root2, baseId }); + env3 = env3 || new SchemaEnv({ schema: schema2, schemaId, root, baseId }); if (env3.schema !== env3.root.schema) return env3; return void 0; @@ -40703,13 +40703,13 @@ var require_utils3 = __commonJS({ if (findToken(host, ":") < 2) { return { host, isIPV6: false }; } - const ipv65 = getIPV6(host); - if (!ipv65.error) { - let newHost = ipv65.address; - let escapedHost = ipv65.address; - if (ipv65.zone) { - newHost += "%" + ipv65.zone; - escapedHost += "%25" + ipv65.zone; + const ipv64 = getIPV6(host); + if (!ipv64.error) { + let newHost = ipv64.address; + let escapedHost = ipv64.address; + if (ipv64.zone) { + newHost += "%" + ipv64.zone; + escapedHost += "%25" + ipv64.zone; } return { host: newHost, isIPV6: true, escapedHost }; } else { @@ -40723,8 +40723,8 @@ var require_utils3 = __commonJS({ } return ind; } - function removeDotSegments(path4) { - let input = path4; + function removeDotSegments(path3) { + let input = path3; const output = []; let nextSlash = -1; let len = 0; @@ -40798,8 +40798,8 @@ var require_utils3 = __commonJS({ } return output.join(""); } - function normalizeComponentEncoding(component, esc4) { - const func = esc4 !== true ? escape : unescape; + function normalizeComponentEncoding(component, esc3) { + const func = esc3 !== true ? escape : unescape; if (component.scheme !== void 0) { component.scheme = func(component.scheme); } @@ -40923,9 +40923,9 @@ var require_schemes = __commonJS({ wsComponent.secure = void 0; } if (wsComponent.resourceName) { - const [path4, query2] = wsComponent.resourceName.split("?"); - wsComponent.path = path4 && path4 !== "/" ? path4 : void 0; - wsComponent.query = query2; + const [path3, query] = wsComponent.resourceName.split("?"); + wsComponent.path = path3 && path3 !== "/" ? path3 : void 0; + wsComponent.query = query; wsComponent.resourceName = void 0; } wsComponent.fragment = void 0; @@ -41615,8 +41615,8 @@ var require_core2 = __commonJS({ keyRef = sch; if (sch === void 0) { const { schemaId } = this.opts; - const root2 = new compile_1.SchemaEnv({ schema: {}, schemaId }); - sch = compile_1.resolveSchema.call(this, root2, keyRef); + const root = new compile_1.SchemaEnv({ schema: {}, schemaId }); + sch = compile_1.resolveSchema.call(this, root, keyRef); if (!sch) return; this.refs[keyRef] = sch; @@ -41977,20 +41977,20 @@ var require_ref = __commonJS({ code(cxt) { const { gen, schema: $ref, it } = cxt; const { baseId, schemaEnv: env3, validateName, opts, self: self2 } = it; - const { root: root2 } = env3; - if (($ref === "#" || $ref === "#/") && baseId === root2.baseId) + const { root } = env3; + if (($ref === "#" || $ref === "#/") && baseId === root.baseId) return callRootRef(); - const schOrEnv = compile_1.resolveRef.call(self2, root2, baseId, $ref); + const schOrEnv = compile_1.resolveRef.call(self2, root, baseId, $ref); if (schOrEnv === void 0) throw new ref_error_1.default(it.opts.uriResolver, baseId, $ref); if (schOrEnv instanceof compile_1.SchemaEnv) return callValidate(schOrEnv); return inlineRefSchema(schOrEnv); function callRootRef() { - if (env3 === root2) + if (env3 === root) return callRef(cxt, validateName, env3, env3.$async); - const rootName = gen.scopeValue("root", { ref: root2 }); - return callRef(cxt, (0, codegen_1._)`${rootName}.validate`, root2, root2.$async); + const rootName = gen.scopeValue("root", { ref: root }); + return callRef(cxt, (0, codegen_1._)`${rootName}.validate`, root, root.$async); } function callValidate(sch) { const v = getValidate(cxt, sch); @@ -42115,7 +42115,7 @@ var require_limitNumber = __commonJS({ exclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE }, exclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE } }; - var error50 = { + var error49 = { message: ({ keyword, schemaCode }) => (0, codegen_1.str)`must be ${KWDs[keyword].okStr} ${schemaCode}`, params: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}` }; @@ -42124,7 +42124,7 @@ var require_limitNumber = __commonJS({ type: "number", schemaType: "number", $data: true, - error: error50, + error: error49, code(cxt) { const { keyword, data, schemaCode } = cxt; cxt.fail$data((0, codegen_1._)`${data} ${KWDs[keyword].fail} ${schemaCode} || isNaN(${data})`); @@ -42140,7 +42140,7 @@ var require_multipleOf = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); - var error50 = { + var error49 = { message: ({ schemaCode }) => (0, codegen_1.str)`must be multiple of ${schemaCode}`, params: ({ schemaCode }) => (0, codegen_1._)`{multipleOf: ${schemaCode}}` }; @@ -42149,7 +42149,7 @@ var require_multipleOf = __commonJS({ type: "number", schemaType: "number", $data: true, - error: error50, + error: error49, code(cxt) { const { gen, data, schemaCode, it } = cxt; const prec = it.opts.multipleOfPrecision; @@ -42196,7 +42196,7 @@ var require_limitLength = __commonJS({ var codegen_1 = require_codegen(); var util_1 = require_util8(); var ucs2length_1 = require_ucs2length(); - var error50 = { + var error49 = { message({ keyword, schemaCode }) { const comp = keyword === "maxLength" ? "more" : "fewer"; return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} characters`; @@ -42208,7 +42208,7 @@ var require_limitLength = __commonJS({ type: "string", schemaType: "number", $data: true, - error: error50, + error: error49, code(cxt) { const { keyword, data, schemaCode, it } = cxt; const op = keyword === "maxLength" ? codegen_1.operators.GT : codegen_1.operators.LT; @@ -42227,7 +42227,7 @@ var require_pattern = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); var code_1 = require_code2(); var codegen_1 = require_codegen(); - var error50 = { + var error49 = { message: ({ schemaCode }) => (0, codegen_1.str)`must match pattern "${schemaCode}"`, params: ({ schemaCode }) => (0, codegen_1._)`{pattern: ${schemaCode}}` }; @@ -42236,7 +42236,7 @@ var require_pattern = __commonJS({ type: "string", schemaType: "string", $data: true, - error: error50, + error: error49, code(cxt) { const { data, $data, schema: schema2, schemaCode, it } = cxt; const u = it.opts.unicodeRegExp ? "u" : ""; @@ -42254,7 +42254,7 @@ var require_limitProperties = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); - var error50 = { + var error49 = { message({ keyword, schemaCode }) { const comp = keyword === "maxProperties" ? "more" : "fewer"; return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} properties`; @@ -42266,7 +42266,7 @@ var require_limitProperties = __commonJS({ type: "object", schemaType: "number", $data: true, - error: error50, + error: error49, code(cxt) { const { keyword, data, schemaCode } = cxt; const op = keyword === "maxProperties" ? codegen_1.operators.GT : codegen_1.operators.LT; @@ -42285,7 +42285,7 @@ var require_required = __commonJS({ var code_1 = require_code2(); var codegen_1 = require_codegen(); var util_1 = require_util8(); - var error50 = { + var error49 = { message: ({ params: { missingProperty } }) => (0, codegen_1.str)`must have required property '${missingProperty}'`, params: ({ params: { missingProperty } }) => (0, codegen_1._)`{missingProperty: ${missingProperty}}` }; @@ -42294,7 +42294,7 @@ var require_required = __commonJS({ type: "object", schemaType: "array", $data: true, - error: error50, + error: error49, code(cxt) { const { gen, schema: schema2, schemaCode, data, $data, it } = cxt; const { opts } = it; @@ -42365,7 +42365,7 @@ var require_limitItems = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); - var error50 = { + var error49 = { message({ keyword, schemaCode }) { const comp = keyword === "maxItems" ? "more" : "fewer"; return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} items`; @@ -42377,7 +42377,7 @@ var require_limitItems = __commonJS({ type: "array", schemaType: "number", $data: true, - error: error50, + error: error49, code(cxt) { const { keyword, data, schemaCode } = cxt; const op = keyword === "maxItems" ? codegen_1.operators.GT : codegen_1.operators.LT; @@ -42408,7 +42408,7 @@ var require_uniqueItems = __commonJS({ var codegen_1 = require_codegen(); var util_1 = require_util8(); var equal_1 = require_equal(); - var error50 = { + var error49 = { message: ({ params: { i, j } }) => (0, codegen_1.str)`must NOT have duplicate items (items ## ${j} and ${i} are identical)`, params: ({ params: { i, j } }) => (0, codegen_1._)`{i: ${i}, j: ${j}}` }; @@ -42417,7 +42417,7 @@ var require_uniqueItems = __commonJS({ type: "array", schemaType: "boolean", $data: true, - error: error50, + error: error49, code(cxt) { const { gen, data, $data, schema: schema2, parentSchema, schemaCode, it } = cxt; if (!$data && !schema2) @@ -42474,14 +42474,14 @@ var require_const = __commonJS({ var codegen_1 = require_codegen(); var util_1 = require_util8(); var equal_1 = require_equal(); - var error50 = { + var error49 = { message: "must be equal to constant", params: ({ schemaCode }) => (0, codegen_1._)`{allowedValue: ${schemaCode}}` }; var def = { keyword: "const", $data: true, - error: error50, + error: error49, code(cxt) { const { gen, data, $data, schemaCode, schema: schema2 } = cxt; if ($data || schema2 && typeof schema2 == "object") { @@ -42503,7 +42503,7 @@ var require_enum = __commonJS({ var codegen_1 = require_codegen(); var util_1 = require_util8(); var equal_1 = require_equal(); - var error50 = { + var error49 = { message: "must be equal to one of the allowed values", params: ({ schemaCode }) => (0, codegen_1._)`{allowedValues: ${schemaCode}}` }; @@ -42511,7 +42511,7 @@ var require_enum = __commonJS({ keyword: "enum", schemaType: "array", $data: true, - error: error50, + error: error49, code(cxt) { const { gen, data, $data, schema: schema2, schemaCode, it } = cxt; if (!$data && schema2.length === 0) @@ -42590,7 +42590,7 @@ var require_additionalItems = __commonJS({ exports.validateAdditionalItems = void 0; var codegen_1 = require_codegen(); var util_1 = require_util8(); - var error50 = { + var error49 = { message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`, params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}` }; @@ -42599,7 +42599,7 @@ var require_additionalItems = __commonJS({ type: "array", schemaType: ["boolean", "object"], before: "uniqueItems", - error: error50, + error: error49, code(cxt) { const { parentSchema, it } = cxt; const { items } = parentSchema; @@ -42718,7 +42718,7 @@ var require_items2020 = __commonJS({ var util_1 = require_util8(); var code_1 = require_code2(); var additionalItems_1 = require_additionalItems(); - var error50 = { + var error49 = { message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`, params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}` }; @@ -42727,7 +42727,7 @@ var require_items2020 = __commonJS({ type: "array", schemaType: ["object", "boolean"], before: "uniqueItems", - error: error50, + error: error49, code(cxt) { const { schema: schema2, parentSchema, it } = cxt; const { prefixItems } = parentSchema; @@ -42751,7 +42751,7 @@ var require_contains = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); var util_1 = require_util8(); - var error50 = { + var error49 = { message: ({ params: { min, max } }) => max === void 0 ? (0, codegen_1.str)`must contain at least ${min} valid item(s)` : (0, codegen_1.str)`must contain at least ${min} and no more than ${max} valid item(s)`, params: ({ params: { min, max } }) => max === void 0 ? (0, codegen_1._)`{minContains: ${min}}` : (0, codegen_1._)`{minContains: ${min}, maxContains: ${max}}` }; @@ -42761,7 +42761,7 @@ var require_contains = __commonJS({ schemaType: ["object", "boolean"], before: "uniqueItems", trackErrors: true, - error: error50, + error: error49, code(cxt) { const { gen, schema: schema2, parentSchema, data, it } = cxt; let min; @@ -42939,7 +42939,7 @@ var require_propertyNames = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); var util_1 = require_util8(); - var error50 = { + var error49 = { message: "property name must be valid", params: ({ params }) => (0, codegen_1._)`{propertyName: ${params.propertyName}}` }; @@ -42947,7 +42947,7 @@ var require_propertyNames = __commonJS({ keyword: "propertyNames", type: "object", schemaType: ["object", "boolean"], - error: error50, + error: error49, code(cxt) { const { gen, schema: schema2, data, it } = cxt; if ((0, util_1.alwaysValidSchema)(it, schema2)) @@ -42984,7 +42984,7 @@ var require_additionalProperties = __commonJS({ var codegen_1 = require_codegen(); var names_1 = require_names(); var util_1 = require_util8(); - var error50 = { + var error49 = { message: "must NOT have additional properties", params: ({ params }) => (0, codegen_1._)`{additionalProperty: ${params.additionalProperty}}` }; @@ -42994,7 +42994,7 @@ var require_additionalProperties = __commonJS({ schemaType: ["boolean", "object"], allowUndefined: true, trackErrors: true, - error: error50, + error: error49, code(cxt) { const { gen, schema: schema2, parentSchema, data, errsCount, it } = cxt; if (!errsCount) @@ -43268,7 +43268,7 @@ var require_oneOf = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); var util_1 = require_util8(); - var error50 = { + var error49 = { message: "must match exactly one schema in oneOf", params: ({ params }) => (0, codegen_1._)`{passingSchemas: ${params.passing}}` }; @@ -43276,7 +43276,7 @@ var require_oneOf = __commonJS({ keyword: "oneOf", schemaType: "array", trackErrors: true, - error: error50, + error: error49, code(cxt) { const { gen, schema: schema2, parentSchema, it } = cxt; if (!Array.isArray(schema2)) @@ -43353,7 +43353,7 @@ var require_if = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); var util_1 = require_util8(); - var error50 = { + var error49 = { message: ({ params }) => (0, codegen_1.str)`must match "${params.ifClause}" schema`, params: ({ params }) => (0, codegen_1._)`{failingKeyword: ${params.ifClause}}` }; @@ -43361,7 +43361,7 @@ var require_if = __commonJS({ keyword: "if", schemaType: ["object", "boolean"], trackErrors: true, - error: error50, + error: error49, code(cxt) { const { gen, parentSchema, it } = cxt; if (parentSchema.then === void 0 && parentSchema.else === void 0) { @@ -43487,7 +43487,7 @@ var require_format = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); - var error50 = { + var error49 = { message: ({ schemaCode }) => (0, codegen_1.str)`must match format "${schemaCode}"`, params: ({ schemaCode }) => (0, codegen_1._)`{format: ${schemaCode}}` }; @@ -43496,7 +43496,7 @@ var require_format = __commonJS({ type: ["number", "string"], schemaType: "string", $data: true, - error: error50, + error: error49, code(cxt, ruleType) { const { gen, data, $data, schema: schema2, schemaCode, it } = cxt; const { opts, errSchemaPath, schemaEnv, self: self2 } = it; @@ -43651,7 +43651,7 @@ var require_discriminator = __commonJS({ var compile_1 = require_compile(); var ref_error_1 = require_ref_error(); var util_1 = require_util8(); - var error50 = { + var error49 = { message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag ? `tag "${tagName}" must be string` : `value of tag "${tagName}" must be in oneOf`, params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._)`{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}` }; @@ -43659,7 +43659,7 @@ var require_discriminator = __commonJS({ keyword: "discriminator", type: "object", schemaType: "object", - error: error50, + error: error49, code(cxt) { const { gen, data, schema: schema2, parentSchema, it } = cxt; const { oneOf } = parentSchema; @@ -43719,8 +43719,8 @@ var require_discriminator = __commonJS({ if (!tagRequired) throw new Error(`discriminator: "${tagName}" must be required`); return oneOfMapping; - function hasRequired({ required: required4 }) { - return Array.isArray(required4) && required4.includes(tagName); + function hasRequired({ required: required3 }) { + return Array.isArray(required3) && required3.includes(tagName); } function addMappings(sch, i) { if (sch.const) { @@ -43984,7 +43984,7 @@ var require_formats = __commonJS({ } exports.fullFormats = { // date: http://tools.ietf.org/html/rfc3339#section-5.6 - date: fmtDef(date6, compareDate), + date: fmtDef(date5, compareDate), // date-time: http://tools.ietf.org/html/rfc3339#section-5.6 time: fmtDef(getTime(true), compareTime), "date-time": fmtDef(getDateTime(true), compareDateTime), @@ -44050,7 +44050,7 @@ var require_formats = __commonJS({ } var DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/; var DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; - function date6(str) { + function date5(str) { const matches = DATE.exec(str); if (!matches) return false; @@ -44070,7 +44070,7 @@ var require_formats = __commonJS({ } var TIME = /^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i; function getTime(strictTimeZone) { - return function time5(str) { + return function time4(str) { const matches = TIME.exec(str); if (!matches) return false; @@ -44116,10 +44116,10 @@ var require_formats = __commonJS({ } var DATE_TIME_SEPARATOR = /t|\s/i; function getDateTime(strictTimeZone) { - const time5 = getTime(strictTimeZone); + const time4 = getTime(strictTimeZone); return function date_time(str) { const dateTime = str.split(DATE_TIME_SEPARATOR); - return dateTime.length === 2 && date6(dateTime[0]) && time5(dateTime[1]); + return dateTime.length === 2 && date5(dateTime[0]) && time4(dateTime[1]); }; } function compareDateTime(dt1, dt2) { @@ -44191,7 +44191,7 @@ var require_limit = __commonJS({ formatExclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE }, formatExclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE } }; - var error50 = { + var error49 = { message: ({ keyword, schemaCode }) => (0, codegen_1.str)`should be ${KWDs[keyword].okStr} ${schemaCode}`, params: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}` }; @@ -44200,7 +44200,7 @@ var require_limit = __commonJS({ type: "string", schemaType: "string", $data: true, - error: error50, + error: error49, code(cxt) { const { gen, data, schemaCode, keyword, it } = cxt; const { opts, self: self2 } = it; @@ -44277,12 +44277,12 @@ var require_dist = __commonJS({ throw new Error(`Unknown format "${name}"`); return f; }; - function addFormats(ajv, list, fs5, exportName) { + function addFormats(ajv, list, fs3, exportName) { var _a2; var _b; (_a2 = (_b = ajv.opts.code).formats) !== null && _a2 !== void 0 ? _a2 : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`; for (const f of list) - ajv.addFormat(f, fs5[f]); + ajv.addFormat(f, fs3[f]); } module.exports = exports = formatsPlugin; Object.defineProperty(exports, "__esModule", { value: true }); @@ -44701,7 +44701,7 @@ var require_errors4 = __commonJS({ } }; var kAbortError = Symbol.for("undici.error.UND_ERR_ABORT"); - var AbortError3 = class extends UndiciError { + var AbortError2 = class extends UndiciError { constructor(message) { super(message); this.name = "AbortError"; @@ -44716,7 +44716,7 @@ var require_errors4 = __commonJS({ } }; var kRequestAbortedError = Symbol.for("undici.error.UND_ERR_ABORTED"); - var RequestAbortedError = class extends AbortError3 { + var RequestAbortedError = class extends AbortError2 { constructor(message) { super(message); this.name = "AbortError"; @@ -44949,7 +44949,7 @@ var require_errors4 = __commonJS({ } }; module.exports = { - AbortError: AbortError3, + AbortError: AbortError2, HTTPParserError, UndiciError, HeadersTimeoutError, @@ -45250,7 +45250,7 @@ var require_tree = __commonJS({ var require_util10 = __commonJS({ "node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/core/util.js"(exports, module) { "use strict"; - var assert4 = __require("node:assert"); + var assert3 = __require("node:assert"); var { kDestroyed, kBodyUsed, kListeners, kBody } = require_symbols6(); var { IncomingMessage } = __require("node:http"); var stream = __require("node:stream"); @@ -45268,7 +45268,7 @@ var require_util10 = __commonJS({ this[kBodyUsed] = false; } async *[Symbol.asyncIterator]() { - assert4(!this[kBodyUsed], "disturbed"); + assert3(!this[kBodyUsed], "disturbed"); this[kBodyUsed] = true; yield* this[kBody]; } @@ -45279,7 +45279,7 @@ var require_util10 = __commonJS({ if (isStream(body)) { if (bodyLength(body) === 0) { body.on("data", function() { - assert4(false); + assert3(false); }); } if (typeof body.readableDidRead !== "boolean") { @@ -45364,14 +45364,14 @@ var require_util10 = __commonJS({ } const port = url4.port != null ? url4.port : url4.protocol === "https:" ? 443 : 80; let origin = url4.origin != null ? url4.origin : `${url4.protocol || ""}//${url4.hostname || ""}:${port}`; - let path4 = url4.path != null ? url4.path : `${url4.pathname || ""}${url4.search || ""}`; + let path3 = url4.path != null ? url4.path : `${url4.pathname || ""}${url4.search || ""}`; if (origin[origin.length - 1] === "/") { origin = origin.slice(0, origin.length - 1); } - if (path4 && path4[0] !== "/") { - path4 = `/${path4}`; + if (path3 && path3[0] !== "/") { + path3 = `/${path3}`; } - return new URL(`${origin}${path4}`); + return new URL(`${origin}${path3}`); } if (!isHttpOrHttpsPrefixed(url4.origin || url4.protocol)) { throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); @@ -45388,7 +45388,7 @@ var require_util10 = __commonJS({ function getHostname(host) { if (host[0] === "[") { const idx2 = host.indexOf("]"); - assert4(idx2 !== -1); + assert3(idx2 !== -1); return host.substring(1, idx2); } const idx = host.indexOf(":"); @@ -45399,7 +45399,7 @@ var require_util10 = __commonJS({ if (!host) { return null; } - assert4(typeof host === "string"); + assert3(typeof host === "string"); const servername = getHostname(host); if (net.isIP(servername)) { return ""; @@ -45677,7 +45677,7 @@ var require_util10 = __commonJS({ function errorRequest(client, request2, err) { try { request2.onError(err); - assert4(request2.aborted); + assert3(request2.aborted); } catch (err2) { client.emit("error", err2); } @@ -45850,10 +45850,10 @@ var require_diagnostics = __commonJS({ "node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/core/diagnostics.js"(exports, module) { "use strict"; var diagnosticsChannel = __require("node:diagnostics_channel"); - var util3 = __require("node:util"); - var undiciDebugLog = util3.debuglog("undici"); - var fetchDebuglog = util3.debuglog("fetch"); - var websocketDebuglog = util3.debuglog("websocket"); + var util2 = __require("node:util"); + var undiciDebugLog = util2.debuglog("undici"); + var fetchDebuglog = util2.debuglog("fetch"); + var websocketDebuglog = util2.debuglog("websocket"); var channels = { // Client beforeConnect: diagnosticsChannel.channel("undici:client:beforeConnect"), @@ -45885,14 +45885,14 @@ var require_diagnostics = __commonJS({ "undici:client:beforeConnect", (evt) => { const { - connectParams: { version: version4, protocol, port, host } + connectParams: { version: version3, protocol, port, host } } = evt; debugLog( "connecting to %s%s using %s%s", host, port ? `:${port}` : "", protocol, - version4 + version3 ); } ); @@ -45900,14 +45900,14 @@ var require_diagnostics = __commonJS({ "undici:client:connected", (evt) => { const { - connectParams: { version: version4, protocol, port, host } + connectParams: { version: version3, protocol, port, host } } = evt; debugLog( "connected to %s%s using %s%s", host, port ? `:${port}` : "", protocol, - version4 + version3 ); } ); @@ -45915,16 +45915,16 @@ var require_diagnostics = __commonJS({ "undici:client:connectError", (evt) => { const { - connectParams: { version: version4, protocol, port, host }, - error: error50 + connectParams: { version: version3, protocol, port, host }, + error: error49 } = evt; debugLog( "connection to %s%s using %s%s errored - %s", host, port ? `:${port}` : "", protocol, - version4, - error50.message + version3, + error49.message ); } ); @@ -45932,9 +45932,9 @@ var require_diagnostics = __commonJS({ "undici:client:sendHeaders", (evt) => { const { - request: { method, path: path4, origin } + request: { method, path: path3, origin } } = evt; - debugLog("sending request to %s %s%s", method, origin, path4); + debugLog("sending request to %s %s%s", method, origin, path3); } ); } @@ -45948,14 +45948,14 @@ var require_diagnostics = __commonJS({ "undici:request:headers", (evt) => { const { - request: { method, path: path4, origin }, + request: { method, path: path3, origin }, response: { statusCode } } = evt; debugLog( "received response to %s %s%s - HTTP %d", method, origin, - path4, + path3, statusCode ); } @@ -45964,24 +45964,24 @@ var require_diagnostics = __commonJS({ "undici:request:trailers", (evt) => { const { - request: { method, path: path4, origin } + request: { method, path: path3, origin } } = evt; - debugLog("trailers received from %s %s%s", method, origin, path4); + debugLog("trailers received from %s %s%s", method, origin, path3); } ); diagnosticsChannel.subscribe( "undici:request:error", (evt) => { const { - request: { method, path: path4, origin }, - error: error50 + request: { method, path: path3, origin }, + error: error49 } = evt; debugLog( "request to %s %s%s errored - %s", method, origin, - path4, - error50.message + path3, + error49.message ); } ); @@ -46054,7 +46054,7 @@ var require_request3 = __commonJS({ InvalidArgumentError, NotSupportedError } = require_errors4(); - var assert4 = __require("node:assert"); + var assert3 = __require("node:assert"); var { isValidHTTPToken, isValidHeaderValue, @@ -46076,11 +46076,11 @@ var require_request3 = __commonJS({ var kHandler = Symbol("handler"); var Request2 = class { constructor(origin, { - path: path4, + path: path3, method, body, headers, - query: query2, + query, idempotent, blocking, upgrade, @@ -46092,11 +46092,11 @@ var require_request3 = __commonJS({ throwOnError, maxRedirections }, handler2) { - if (typeof path4 !== "string") { + if (typeof path3 !== "string") { throw new InvalidArgumentError("path must be a string"); - } else if (path4[0] !== "/" && !(path4.startsWith("http://") || path4.startsWith("https://")) && method !== "CONNECT") { + } else if (path3[0] !== "/" && !(path3.startsWith("http://") || path3.startsWith("https://")) && method !== "CONNECT") { throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); - } else if (invalidPathRegex.test(path4)) { + } else if (invalidPathRegex.test(path3)) { throw new InvalidArgumentError("invalid request path"); } if (typeof method !== "string") { @@ -46164,7 +46164,7 @@ var require_request3 = __commonJS({ this.completed = false; this.aborted = false; this.upgrade = upgrade || null; - this.path = query2 ? serializePathWithQuery(path4, query2) : path4; + this.path = query ? serializePathWithQuery(path3, query) : path3; this.origin = origin; this.protocol = getProtocolFromUrlString(origin); this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; @@ -46231,8 +46231,8 @@ var require_request3 = __commonJS({ } } onConnect(abort) { - assert4(!this.aborted); - assert4(!this.completed); + assert3(!this.aborted); + assert3(!this.completed); if (this.error) { abort(this.error); } else { @@ -46244,8 +46244,8 @@ var require_request3 = __commonJS({ return this[kHandler].onResponseStarted?.(); } onHeaders(statusCode, headers, resume, statusText) { - assert4(!this.aborted); - assert4(!this.completed); + assert3(!this.aborted); + assert3(!this.completed); if (channels.headers.hasSubscribers) { channels.headers.publish({ request: this, response: { statusCode, headers, statusText } }); } @@ -46256,8 +46256,8 @@ var require_request3 = __commonJS({ } } onData(chunk) { - assert4(!this.aborted); - assert4(!this.completed); + assert3(!this.aborted); + assert3(!this.completed); if (channels.bodyChunkReceived.hasSubscribers) { channels.bodyChunkReceived.publish({ request: this, chunk }); } @@ -46269,14 +46269,14 @@ var require_request3 = __commonJS({ } } onUpgrade(statusCode, headers, socket) { - assert4(!this.aborted); - assert4(!this.completed); + assert3(!this.aborted); + assert3(!this.completed); return this[kHandler].onUpgrade(statusCode, headers, socket); } onComplete(trailers) { this.onFinally(); - assert4(!this.aborted); - assert4(!this.completed); + assert3(!this.aborted); + assert3(!this.completed); this.completed = true; if (channels.trailers.hasSubscribers) { channels.trailers.publish({ request: this, trailers }); @@ -46287,16 +46287,16 @@ var require_request3 = __commonJS({ this.onError(err); } } - onError(error50) { + onError(error49) { this.onFinally(); if (channels.error.hasSubscribers) { - channels.error.publish({ request: this, error: error50 }); + channels.error.publish({ request: this, error: error49 }); } if (this.aborted) { return; } this.aborted = true; - return this[kHandler].onError(error50); + return this[kHandler].onError(error49); } onFinally() { if (this.errorHandler) { @@ -46728,8 +46728,8 @@ var require_connect2 = __commonJS({ "node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/core/connect.js"(exports, module) { "use strict"; var net = __require("node:net"); - var assert4 = __require("node:assert"); - var util3 = require_util10(); + var assert3 = __require("node:assert"); + var util2 = require_util10(); var { InvalidArgumentError } = require_errors4(); var tls; var SessionCache = class WeakSessionCache { @@ -46766,15 +46766,15 @@ var require_connect2 = __commonJS({ const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions); timeout = timeout == null ? 1e4 : timeout; allowH2 = allowH2 != null ? allowH2 : false; - return function connect({ hostname: hostname5, host, protocol, port, servername, localAddress, httpSocket }, callback) { + return function connect({ hostname: hostname4, host, protocol, port, servername, localAddress, httpSocket }, callback) { let socket; if (protocol === "https:") { if (!tls) { tls = __require("node:tls"); } - servername = servername || options.servername || util3.getServerName(host) || null; - const sessionKey = servername || hostname5; - assert4(sessionKey); + servername = servername || options.servername || util2.getServerName(host) || null; + const sessionKey = servername || hostname4; + assert3(sessionKey); const session = customSession || sessionCache.get(sessionKey) || null; port = port || 443; socket = tls.connect({ @@ -46788,13 +46788,13 @@ var require_connect2 = __commonJS({ socket: httpSocket, // upgrade socket connection port, - host: hostname5 + host: hostname4 }); socket.on("session", function(session2) { sessionCache.set(sessionKey, session2); }); } else { - assert4(!httpSocket, "httpSocket can only be sent on TLS update"); + assert3(!httpSocket, "httpSocket can only be sent on TLS update"); port = port || 80; socket = net.connect({ highWaterMark: 64 * 1024, @@ -46802,14 +46802,14 @@ var require_connect2 = __commonJS({ ...options, localAddress, port, - host: hostname5 + host: hostname4 }); } if (options.keepAlive == null || options.keepAlive) { const keepAliveInitialDelay = options.keepAliveInitialDelay === void 0 ? 6e4 : options.keepAliveInitialDelay; socket.setKeepAlive(true, keepAliveInitialDelay); } - const clearConnectTimeout = util3.setupConnectTimeout(new WeakRef(socket), { timeout, hostname: hostname5, port }); + const clearConnectTimeout = util2.setupConnectTimeout(new WeakRef(socket), { timeout, hostname: hostname4, port }); socket.setNoDelay(true).once(protocol === "https:" ? "secureConnect" : "connect", function() { queueMicrotask(clearConnectTimeout); if (callback) { @@ -47765,14 +47765,14 @@ var require_global3 = __commonJS({ var require_data_url = __commonJS({ "node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/web/fetch/data-url.js"(exports, module) { "use strict"; - var assert4 = __require("node:assert"); + var assert3 = __require("node:assert"); var encoder = new TextEncoder(); var HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+\-.^_|~A-Za-z0-9]+$/; var HTTP_WHITESPACE_REGEX = /[\u000A\u000D\u0009\u0020]/; var ASCII_WHITESPACE_REPLACE_REGEX = /[\u0009\u000A\u000C\u000D\u0020]/g; var HTTP_QUOTED_STRING_TOKENS = /^[\u0009\u0020-\u007E\u0080-\u00FF]+$/; function dataURLProcessor(dataURL) { - assert4(dataURL.protocol === "data:"); + assert3(dataURL.protocol === "data:"); let input = URLSerializer(dataURL, true); input = input.slice(5); const position = { position: 0 }; @@ -47973,7 +47973,7 @@ var require_data_url = __commonJS({ function collectAnHTTPQuotedString(input, position, extractValue = false) { const positionStart = position.position; let value2 = ""; - assert4(input[position.position] === '"'); + assert3(input[position.position] === '"'); position.position++; while (true) { value2 += collectASequenceOfCodePoints( @@ -47994,7 +47994,7 @@ var require_data_url = __commonJS({ value2 += input[position.position]; position.position++; } else { - assert4(quoteOrBackslash === '"'); + assert3(quoteOrBackslash === '"'); break; } } @@ -48004,7 +48004,7 @@ var require_data_url = __commonJS({ return input.slice(positionStart, position.position); } function serializeAMimeType(mimeType) { - assert4(mimeType !== "failure"); + assert3(mimeType !== "failure"); const { parameters, essence } = mimeType; let serialization = essence; for (let [name, value2] of parameters.entries()) { @@ -48412,8 +48412,8 @@ var require_webidl2 = __commonJS({ }); } for (const options of converters) { - const { key, defaultValue, required: required4, converter } = options; - if (required4 === true) { + const { key, defaultValue, required: required3, converter } = options; + if (required3 === true) { if (dictionary == null || !Object.hasOwn(dictionary, key)) { throw webidl.errors.exception({ header: prefix, @@ -48426,7 +48426,7 @@ var require_webidl2 = __commonJS({ if (hasDefault && value2 === void 0) { value2 = defaultValue(); } - if (required4 || hasDefault || value2 !== void 0) { + if (required3 || hasDefault || value2 !== void 0) { value2 = converter(value2, prefix, `${argument}.${key}`); if (options.allowedValues && !options.allowedValues.includes(value2)) { throw webidl.errors.exception({ @@ -48703,7 +48703,7 @@ var require_util11 = __commonJS({ var { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = require_data_url(); var { performance: performance2 } = __require("node:perf_hooks"); var { ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require_util10(); - var assert4 = __require("node:assert"); + var assert3 = __require("node:assert"); var { isUint8Array } = __require("node:util/types"); var { webidl } = require_webidl2(); function responseURL(response) { @@ -48884,7 +48884,7 @@ var require_util11 = __commonJS({ } function determineRequestsReferrer(request2) { const policy = request2.referrerPolicy; - assert4(policy); + assert3(policy); let referrerSource = null; if (request2.referrer === "client") { const globalOrigin = getGlobalOrigin(); @@ -48947,7 +48947,7 @@ var require_util11 = __commonJS({ } } function stripURLForReferrer(url4, originOnly = false) { - assert4(webidl.is.URL(url4)); + assert3(webidl.is.URL(url4)); url4 = new URL(url4); if (urlIsLocal(url4)) { return "no-referrer"; @@ -49016,7 +49016,7 @@ var require_util11 = __commonJS({ } return false; } - function isAborted3(fetchParams) { + function isAborted2(fetchParams) { return fetchParams.controller.state === "aborted"; } function isCancelled(fetchParams) { @@ -49030,7 +49030,7 @@ var require_util11 = __commonJS({ if (result === void 0) { throw new TypeError("Value is not JSON serializable"); } - assert4(typeof result === "string"); + assert3(typeof result === "string"); return result; } var esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())); @@ -49182,7 +49182,7 @@ var require_util11 = __commonJS({ } var invalidIsomorphicEncodeValueRegex = /[^\x00-\xFF]/; function isomorphicEncode(input) { - assert4(!invalidIsomorphicEncodeValueRegex.test(input)); + assert3(!invalidIsomorphicEncodeValueRegex.test(input)); return input; } async function readAllBytes(reader, successSteps, failureSteps) { @@ -49207,7 +49207,7 @@ var require_util11 = __commonJS({ } } function urlIsLocal(url4) { - assert4("protocol" in url4); + assert3("protocol" in url4); const protocol = url4.protocol; return protocol === "about:" || protocol === "blob:" || protocol === "data:"; } @@ -49215,7 +49215,7 @@ var require_util11 = __commonJS({ return typeof url4 === "string" && url4[5] === ":" && url4[0] === "h" && url4[1] === "t" && url4[2] === "t" && url4[3] === "p" && url4[4] === "s" || url4.protocol === "https:"; } function urlIsHttpHttpsScheme(url4) { - assert4("protocol" in url4); + assert3("protocol" in url4); const protocol = url4.protocol; return protocol === "http:" || protocol === "https:"; } @@ -49380,7 +49380,7 @@ var require_util11 = __commonJS({ continue; } } else { - assert4(input.charCodeAt(position.position) === 44); + assert3(input.charCodeAt(position.position) === 44); position.position++; } } @@ -49422,7 +49422,7 @@ var require_util11 = __commonJS({ }; var environmentSettingsObject = new EnvironmentSettingsObject(); module.exports = { - isAborted: isAborted3, + isAborted: isAborted2, isCancelled, isValidEncodedURL, ReadableStreamFrom, @@ -49644,7 +49644,7 @@ var require_formdata_parser = __commonJS({ var { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = require_data_url(); var { makeEntry } = require_formdata2(); var { webidl } = require_webidl2(); - var assert4 = __require("node:assert"); + var assert3 = __require("node:assert"); var formDataNameBuffer = Buffer.from('form-data; name="'); var filenameBuffer = Buffer.from("filename"); var dd = Buffer.from("--"); @@ -49671,7 +49671,7 @@ var require_formdata_parser = __commonJS({ return true; } function multipartFormDataParser(input, mimeType) { - assert4(mimeType !== "failure" && mimeType.essence === "multipart/form-data"); + assert3(mimeType !== "failure" && mimeType.essence === "multipart/form-data"); const boundaryString = mimeType.parameters.get("boundary"); if (boundaryString === void 0) { throw parsingError("missing boundary in content-type header"); @@ -49732,8 +49732,8 @@ var require_formdata_parser = __commonJS({ } else { value2 = utf8DecodeBytes(Buffer.from(body)); } - assert4(webidl.is.USVString(name)); - assert4(typeof value2 === "string" && webidl.is.USVString(value2) || webidl.is.File(value2)); + assert3(webidl.is.USVString(name)); + assert3(typeof value2 === "string" && webidl.is.USVString(value2) || webidl.is.File(value2)); entryList.push(makeEntry(name, value2, filename)); } } @@ -49850,7 +49850,7 @@ var require_formdata_parser = __commonJS({ } } function parseMultipartFormDataName(input, position) { - assert4(input[position.position - 1] === 34); + assert3(input[position.position - 1] === 34); let name = collectASequenceOfBytes( (char) => char !== 10 && char !== 13 && char !== 34, input, @@ -49926,7 +49926,7 @@ var require_promise = __commonJS({ var require_body2 = __commonJS({ "node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/web/fetch/body.js"(exports, module) { "use strict"; - var util3 = require_util10(); + var util2 = require_util10(); var { ReadableStreamFrom, readableStreamClose, @@ -49936,7 +49936,7 @@ var require_body2 = __commonJS({ } = require_util11(); var { FormData: FormData2, setFormDataState } = require_formdata2(); var { webidl } = require_webidl2(); - var assert4 = __require("node:assert"); + var assert3 = __require("node:assert"); var { isErrored, isDisturbed } = __require("node:stream"); var { isArrayBuffer } = __require("node:util/types"); var { serializeAMimeType } = require_data_url(); @@ -49978,7 +49978,7 @@ var require_body2 = __commonJS({ type: "bytes" }); } - assert4(webidl.is.ReadableStream(stream)); + assert3(webidl.is.ReadableStream(stream)); let action = null; let source = null; let length = null; @@ -50050,14 +50050,14 @@ Content-Type: ${value2.type || "application/octet-stream"}\r if (keepalive) { throw new TypeError("keepalive"); } - if (util3.isDisturbed(object5) || object5.locked) { + if (util2.isDisturbed(object5) || object5.locked) { throw new TypeError( "Response body object should not be disturbed or locked" ); } stream = webidl.is.ReadableStream(object5) ? object5 : ReadableStreamFrom(object5); } - if (typeof source === "string" || util3.isBuffer(source)) { + if (typeof source === "string" || util2.isBuffer(source)) { length = Buffer.byteLength(source); } if (action != null) { @@ -50094,8 +50094,8 @@ Content-Type: ${value2.type || "application/octet-stream"}\r } function safelyExtractBody(object5, keepalive = false) { if (webidl.is.ReadableStream(object5)) { - assert4(!util3.isDisturbed(object5), "The body has already been consumed."); - assert4(!object5.locked, "The stream is locked."); + assert3(!util2.isDisturbed(object5), "The body has already been consumed."); + assert3(!object5.locked, "The stream is locked."); } return extractBody(object5, keepalive); } @@ -50200,7 +50200,7 @@ Content-Type: ${value2.type || "application/octet-stream"}\r } function bodyUnusable(object5) { const body = object5.body; - return body != null && (body.stream.locked || util3.isDisturbed(body.stream)); + return body != null && (body.stream.locked || util2.isDisturbed(body.stream)); } function parseJSONFromBytes(bytes) { return JSON.parse(utf8DecodeBytes(bytes)); @@ -50228,8 +50228,8 @@ Content-Type: ${value2.type || "application/octet-stream"}\r var require_client_h1 = __commonJS({ "node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/dispatcher/client-h1.js"(exports, module) { "use strict"; - var assert4 = __require("node:assert"); - var util3 = require_util10(); + var assert3 = __require("node:assert"); + var util2 = require_util10(); var { channels } = require_diagnostics(); var timers = require_timers2(); var { @@ -50281,7 +50281,7 @@ var require_client_h1 = __commonJS({ var constants = require_constants7(); var EMPTY_BUF = Buffer.alloc(0); var FastBuffer = Buffer[Symbol.species]; - var removeAllListeners = util3.removeAllListeners; + var removeAllListeners = util2.removeAllListeners; var extractBody; function lazyllhttp() { const llhttpWasmData = process.env.JEST_WORKER_ID ? require_llhttp_wasm2() : void 0; @@ -50319,7 +50319,7 @@ var require_client_h1 = __commonJS({ * @returns {number} */ wasm_on_status: (p, at, len) => { - assert4(currentParser.ptr === p); + assert3(currentParser.ptr === p); const start = at - currentBufferPtr + currentBufferRef.byteOffset; return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)); }, @@ -50328,7 +50328,7 @@ var require_client_h1 = __commonJS({ * @returns {number} */ wasm_on_message_begin: (p) => { - assert4(currentParser.ptr === p); + assert3(currentParser.ptr === p); return currentParser.onMessageBegin(); }, /** @@ -50338,7 +50338,7 @@ var require_client_h1 = __commonJS({ * @returns {number} */ wasm_on_header_field: (p, at, len) => { - assert4(currentParser.ptr === p); + assert3(currentParser.ptr === p); const start = at - currentBufferPtr + currentBufferRef.byteOffset; return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)); }, @@ -50349,7 +50349,7 @@ var require_client_h1 = __commonJS({ * @returns {number} */ wasm_on_header_value: (p, at, len) => { - assert4(currentParser.ptr === p); + assert3(currentParser.ptr === p); const start = at - currentBufferPtr + currentBufferRef.byteOffset; return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)); }, @@ -50361,7 +50361,7 @@ var require_client_h1 = __commonJS({ * @returns {number} */ wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => { - assert4(currentParser.ptr === p); + assert3(currentParser.ptr === p); return currentParser.onHeadersComplete(statusCode, upgrade === 1, shouldKeepAlive === 1); }, /** @@ -50371,7 +50371,7 @@ var require_client_h1 = __commonJS({ * @returns {number} */ wasm_on_body: (p, at, len) => { - assert4(currentParser.ptr === p); + assert3(currentParser.ptr === p); const start = at - currentBufferPtr + currentBufferRef.byteOffset; return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)); }, @@ -50380,7 +50380,7 @@ var require_client_h1 = __commonJS({ * @returns {number} */ wasm_on_message_complete: (p) => { - assert4(currentParser.ptr === p); + assert3(currentParser.ptr === p); return currentParser.onMessageComplete(); } } @@ -50451,10 +50451,10 @@ var require_client_h1 = __commonJS({ if (this.socket.destroyed || !this.paused) { return; } - assert4(this.ptr != null); - assert4(currentParser === null); + assert3(this.ptr != null); + assert3(currentParser === null); this.llhttp.llhttp_resume(this.ptr); - assert4(this.timeoutType === TIMEOUT_BODY); + assert3(this.timeoutType === TIMEOUT_BODY); if (this.timeout) { if (this.timeout.refresh) { this.timeout.refresh(); @@ -50477,9 +50477,9 @@ var require_client_h1 = __commonJS({ * @param {Buffer} chunk */ execute(chunk) { - assert4(currentParser === null); - assert4(this.ptr != null); - assert4(!this.paused); + assert3(currentParser === null); + assert3(this.ptr != null); + assert3(!this.paused); const { socket, llhttp } = this; if (chunk.length > currentBufferSize) { if (currentBufferPtr) { @@ -50517,12 +50517,12 @@ var require_client_h1 = __commonJS({ } } } catch (err) { - util3.destroy(socket, err); + util2.destroy(socket, err); } } destroy() { - assert4(currentParser === null); - assert4(this.ptr != null); + assert3(currentParser === null); + assert3(this.ptr != null); this.llhttp.llhttp_free(this.ptr); this.ptr = null; this.timeout && timers.clearTimeout(this.timeout); @@ -50582,13 +50582,13 @@ var require_client_h1 = __commonJS({ } const key = this.headers[len - 2]; if (key.length === 10) { - const headerName = util3.bufferToLowerCasedHeaderName(key); + const headerName = util2.bufferToLowerCasedHeaderName(key); if (headerName === "keep-alive") { this.keepAlive += buf.toString(); } else if (headerName === "connection") { this.connection += buf.toString(); } - } else if (key.length === 14 && util3.bufferToLowerCasedHeaderName(key) === "content-length") { + } else if (key.length === 14 && util2.bufferToLowerCasedHeaderName(key) === "content-length") { this.contentLength += buf.toString(); } this.trackHeader(buf.length); @@ -50600,7 +50600,7 @@ var require_client_h1 = __commonJS({ trackHeader(len) { this.headersSize += len; if (this.headersSize >= this.headersMaxSize) { - util3.destroy(this.socket, new HeadersOverflowError()); + util2.destroy(this.socket, new HeadersOverflowError()); } } /** @@ -50608,14 +50608,14 @@ var require_client_h1 = __commonJS({ */ onUpgrade(head) { const { upgrade, client, socket, headers, statusCode } = this; - assert4(upgrade); - assert4(client[kSocket] === socket); - assert4(!socket.destroyed); - assert4(!this.paused); - assert4((headers.length & 1) === 0); + assert3(upgrade); + assert3(client[kSocket] === socket); + assert3(!socket.destroyed); + assert3(!this.paused); + assert3((headers.length & 1) === 0); const request2 = client[kQueue][client[kRunningIdx]]; - assert4(request2); - assert4(request2.upgrade || request2.method === "CONNECT"); + assert3(request2); + assert3(request2.upgrade || request2.method === "CONNECT"); this.statusCode = 0; this.statusText = ""; this.shouldKeepAlive = false; @@ -50634,7 +50634,7 @@ var require_client_h1 = __commonJS({ try { request2.onUpgrade(statusCode, headers, socket); } catch (err) { - util3.destroy(socket, err); + util2.destroy(socket, err); } client[kResume](); } @@ -50653,17 +50653,17 @@ var require_client_h1 = __commonJS({ if (!request2) { return -1; } - assert4(!this.upgrade); - assert4(this.statusCode < 200); + assert3(!this.upgrade); + assert3(this.statusCode < 200); if (statusCode === 100) { - util3.destroy(socket, new SocketError("bad response", util3.getSocketInfo(socket))); + util2.destroy(socket, new SocketError("bad response", util2.getSocketInfo(socket))); return -1; } if (upgrade && !request2.upgrade) { - util3.destroy(socket, new SocketError("bad upgrade", util3.getSocketInfo(socket))); + util2.destroy(socket, new SocketError("bad upgrade", util2.getSocketInfo(socket))); return -1; } - assert4(this.timeoutType === TIMEOUT_HEADERS); + assert3(this.timeoutType === TIMEOUT_HEADERS); this.statusCode = statusCode; this.shouldKeepAlive = shouldKeepAlive || // Override llhttp value which does not allow keepAlive for HEAD. request2.method === "HEAD" && !socket[kReset] && this.connection.toLowerCase() === "keep-alive"; @@ -50676,20 +50676,20 @@ var require_client_h1 = __commonJS({ } } if (request2.method === "CONNECT") { - assert4(client[kRunning] === 1); + assert3(client[kRunning] === 1); this.upgrade = true; return 2; } if (upgrade) { - assert4(client[kRunning] === 1); + assert3(client[kRunning] === 1); this.upgrade = true; return 2; } - assert4((this.headers.length & 1) === 0); + assert3((this.headers.length & 1) === 0); this.headers = []; this.headersSize = 0; if (this.shouldKeepAlive && client[kPipelining]) { - const keepAliveTimeout = this.keepAlive ? util3.parseKeepAliveTimeout(this.keepAlive) : null; + const keepAliveTimeout = this.keepAlive ? util2.parseKeepAliveTimeout(this.keepAlive) : null; if (keepAliveTimeout != null) { const timeout = Math.min( keepAliveTimeout - client[kKeepAliveTimeoutThreshold], @@ -50732,16 +50732,16 @@ var require_client_h1 = __commonJS({ return -1; } const request2 = client[kQueue][client[kRunningIdx]]; - assert4(request2); - assert4(this.timeoutType === TIMEOUT_BODY); + assert3(request2); + assert3(this.timeoutType === TIMEOUT_BODY); if (this.timeout) { if (this.timeout.refresh) { this.timeout.refresh(); } } - assert4(statusCode >= 200); + assert3(statusCode >= 200); if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) { - util3.destroy(socket, new ResponseExceededMaxSizeError()); + util2.destroy(socket, new ResponseExceededMaxSizeError()); return -1; } this.bytesRead += buf.length; @@ -50761,10 +50761,10 @@ var require_client_h1 = __commonJS({ if (upgrade) { return 0; } - assert4(statusCode >= 100); - assert4((this.headers.length & 1) === 0); + assert3(statusCode >= 100); + assert3((this.headers.length & 1) === 0); const request2 = client[kQueue][client[kRunningIdx]]; - assert4(request2); + assert3(request2); this.statusCode = 0; this.statusText = ""; this.bytesRead = 0; @@ -50777,20 +50777,20 @@ var require_client_h1 = __commonJS({ return 0; } if (request2.method !== "HEAD" && contentLength && bytesRead !== parseInt(contentLength, 10)) { - util3.destroy(socket, new ResponseContentLengthMismatchError()); + util2.destroy(socket, new ResponseContentLengthMismatchError()); return -1; } request2.onComplete(headers); client[kQueue][client[kRunningIdx]++] = null; if (socket[kWriting]) { - assert4(client[kRunning] === 0); - util3.destroy(socket, new InformationalError("reset")); + assert3(client[kRunning] === 0); + util2.destroy(socket, new InformationalError("reset")); return constants.ERROR.PAUSED; } else if (!shouldKeepAlive) { - util3.destroy(socket, new InformationalError("reset")); + util2.destroy(socket, new InformationalError("reset")); return constants.ERROR.PAUSED; } else if (socket[kReset] && client[kRunning] === 0) { - util3.destroy(socket, new InformationalError("reset")); + util2.destroy(socket, new InformationalError("reset")); return constants.ERROR.PAUSED; } else if (client[kPipelining] == null || client[kPipelining] === 1) { setImmediate(client[kResume]); @@ -50804,16 +50804,16 @@ var require_client_h1 = __commonJS({ const { socket, timeoutType, client, paused } = parser.deref(); if (timeoutType === TIMEOUT_HEADERS) { if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) { - assert4(!paused, "cannot be paused while waiting for headers"); - util3.destroy(socket, new HeadersTimeoutError()); + assert3(!paused, "cannot be paused while waiting for headers"); + util2.destroy(socket, new HeadersTimeoutError()); } } else if (timeoutType === TIMEOUT_BODY) { if (!paused) { - util3.destroy(socket, new BodyTimeoutError()); + util2.destroy(socket, new BodyTimeoutError()); } } else if (timeoutType === TIMEOUT_KEEP_ALIVE) { - assert4(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]); - util3.destroy(socket, new InformationalError("socket idle timeout")); + assert3(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]); + util2.destroy(socket, new InformationalError("socket idle timeout")); } } function connectH1(client, socket) { @@ -50832,10 +50832,10 @@ var require_client_h1 = __commonJS({ socket[kReset] = false; socket[kBlocking] = false; socket[kParser] = new Parser(client, socket, llhttpInstance); - util3.addListener(socket, "error", onHttpSocketError); - util3.addListener(socket, "readable", onHttpSocketReadable); - util3.addListener(socket, "end", onHttpSocketEnd); - util3.addListener(socket, "close", onHttpSocketClose); + util2.addListener(socket, "error", onHttpSocketError); + util2.addListener(socket, "readable", onHttpSocketReadable); + util2.addListener(socket, "end", onHttpSocketEnd); + util2.addListener(socket, "close", onHttpSocketClose); socket[kClosed] = false; socket.on("close", onSocketClose); return { @@ -50880,7 +50880,7 @@ var require_client_h1 = __commonJS({ if (client[kRunning] > 0 && (request2.upgrade || request2.method === "CONNECT")) { return true; } - if (client[kRunning] > 0 && util3.bodyLength(request2.body) !== 0 && (util3.isStream(request2.body) || util3.isAsyncIterable(request2.body) || util3.isFormDataLike(request2.body))) { + if (client[kRunning] > 0 && util2.bodyLength(request2.body) !== 0 && (util2.isStream(request2.body) || util2.isAsyncIterable(request2.body) || util2.isFormDataLike(request2.body))) { return true; } } @@ -50889,7 +50889,7 @@ var require_client_h1 = __commonJS({ }; } function onHttpSocketError(err) { - assert4(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); + assert3(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); const parser = this[kParser]; if (err.code === "ECONNRESET" && parser.statusCode && !parser.shouldKeepAlive) { parser.onMessageComplete(); @@ -50907,7 +50907,7 @@ var require_client_h1 = __commonJS({ parser.onMessageComplete(); return; } - util3.destroy(this, new SocketError("other side closed", util3.getSocketInfo(this))); + util2.destroy(this, new SocketError("other side closed", util2.getSocketInfo(this))); } function onHttpSocketClose() { const parser = this[kParser]; @@ -50918,24 +50918,24 @@ var require_client_h1 = __commonJS({ this[kParser].destroy(); this[kParser] = null; } - const err = this[kError] || new SocketError("closed", util3.getSocketInfo(this)); + const err = this[kError] || new SocketError("closed", util2.getSocketInfo(this)); const client = this[kClient]; client[kSocket] = null; client[kHTTPContext] = null; if (client.destroyed) { - assert4(client[kPending] === 0); + assert3(client[kPending] === 0); const requests = client[kQueue].splice(client[kRunningIdx]); for (let i = 0; i < requests.length; i++) { const request2 = requests[i]; - util3.errorRequest(client, request2, err); + util2.errorRequest(client, request2, err); } } else if (client[kRunning] > 0 && err.code !== "UND_ERR_INFO") { const request2 = client[kQueue][client[kRunningIdx]]; client[kQueue][client[kRunningIdx]++] = null; - util3.errorRequest(client, request2, err); + util2.errorRequest(client, request2, err); } client[kPendingIdx] = client[kRunningIdx]; - assert4(client[kRunning] === 0); + assert3(client[kRunning] === 0); client.emit("disconnect", client[kUrl], [client], err); client[kResume](); } @@ -50971,10 +50971,10 @@ var require_client_h1 = __commonJS({ return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; } function writeH1(client, request2) { - const { method, path: path4, host, upgrade, blocking, reset } = request2; + const { method, path: path3, host, upgrade, blocking, reset } = request2; let { body, headers, contentLength } = request2; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH"; - if (util3.isFormDataLike(body)) { + if (util2.isFormDataLike(body)) { if (!extractBody) { extractBody = require_body2().extractBody; } @@ -50984,13 +50984,13 @@ var require_client_h1 = __commonJS({ } body = bodyStream.stream; contentLength = bodyStream.length; - } else if (util3.isBlobLike(body) && request2.contentType == null && body.type) { + } else if (util2.isBlobLike(body) && request2.contentType == null && body.type) { headers.push("content-type", body.type); } if (body && typeof body.read === "function") { body.read(0); } - const bodyLength = util3.bodyLength(body); + const bodyLength = util2.bodyLength(body); contentLength = bodyLength ?? contentLength; if (contentLength === null) { contentLength = request2.contentLength; @@ -51000,7 +51000,7 @@ var require_client_h1 = __commonJS({ } if (shouldSendContentLength(method) && contentLength > 0 && request2.contentLength !== null && request2.contentLength !== contentLength) { if (client[kStrictContentLength]) { - util3.errorRequest(client, request2, new RequestContentLengthMismatchError()); + util2.errorRequest(client, request2, new RequestContentLengthMismatchError()); return false; } process.emitWarning(new RequestContentLengthMismatchError()); @@ -51010,14 +51010,14 @@ var require_client_h1 = __commonJS({ if (request2.aborted || request2.completed) { return; } - util3.errorRequest(client, request2, err || new RequestAbortedError()); - util3.destroy(body); - util3.destroy(socket, new InformationalError("aborted")); + util2.errorRequest(client, request2, err || new RequestAbortedError()); + util2.destroy(body); + util2.destroy(socket, new InformationalError("aborted")); }; try { request2.onConnect(abort); } catch (err) { - util3.errorRequest(client, request2, err); + util2.errorRequest(client, request2, err); } if (request2.aborted) { return false; @@ -51037,7 +51037,7 @@ var require_client_h1 = __commonJS({ if (blocking) { socket[kBlocking] = true; } - let header = `${method} ${path4} HTTP/1.1\r + let header = `${method} ${path3} HTTP/1.1\r `; if (typeof host === "string") { header += `host: ${host}\r @@ -51074,25 +51074,25 @@ upgrade: ${upgrade}\r } if (!body || bodyLength === 0) { writeBuffer(abort, null, client, request2, socket, contentLength, header, expectsPayload); - } else if (util3.isBuffer(body)) { + } else if (util2.isBuffer(body)) { writeBuffer(abort, body, client, request2, socket, contentLength, header, expectsPayload); - } else if (util3.isBlobLike(body)) { + } else if (util2.isBlobLike(body)) { if (typeof body.stream === "function") { writeIterable(abort, body.stream(), client, request2, socket, contentLength, header, expectsPayload); } else { writeBlob(abort, body, client, request2, socket, contentLength, header, expectsPayload); } - } else if (util3.isStream(body)) { + } else if (util2.isStream(body)) { writeStream(abort, body, client, request2, socket, contentLength, header, expectsPayload); - } else if (util3.isIterable(body)) { + } else if (util2.isIterable(body)) { writeIterable(abort, body, client, request2, socket, contentLength, header, expectsPayload); } else { - assert4(false); + assert3(false); } return true; } function writeStream(abort, body, client, request2, socket, contentLength, header, expectsPayload) { - assert4(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined"); + assert3(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined"); let finished = false; const writer = new AsyncWriter({ abort, socket, request: request2, contentLength, client, expectsPayload, header }); const onData = function(chunk) { @@ -51104,7 +51104,7 @@ upgrade: ${upgrade}\r this.pause(); } } catch (err) { - util3.destroy(this, err); + util2.destroy(this, err); } }; const onDrain = function() { @@ -51129,7 +51129,7 @@ upgrade: ${upgrade}\r return; } finished = true; - assert4(socket.destroyed || socket[kWriting] && client[kRunning] <= 1); + assert3(socket.destroyed || socket[kWriting] && client[kRunning] <= 1); socket.off("drain", onDrain).off("error", onFinished); body.removeListener("data", onData).removeListener("end", onFinished).removeListener("close", onClose); if (!err) { @@ -51141,9 +51141,9 @@ upgrade: ${upgrade}\r } writer.destroy(err); if (err && (err.code !== "UND_ERR_INFO" || err.message !== "reset")) { - util3.destroy(body, err); + util2.destroy(body, err); } else { - util3.destroy(body); + util2.destroy(body); } }; body.on("data", onData).on("end", onFinished).on("error", onFinished).on("close", onClose); @@ -51168,12 +51168,12 @@ upgrade: ${upgrade}\r \r `, "latin1"); } else { - assert4(contentLength === null, "no body must not have content length"); + assert3(contentLength === null, "no body must not have content length"); socket.write(`${header}\r `, "latin1"); } - } else if (util3.isBuffer(body)) { - assert4(contentLength === body.byteLength, "buffer body must have content length"); + } else if (util2.isBuffer(body)) { + assert3(contentLength === body.byteLength, "buffer body must have content length"); socket.cork(); socket.write(`${header}content-length: ${contentLength}\r \r @@ -51192,7 +51192,7 @@ upgrade: ${upgrade}\r } } async function writeBlob(abort, body, client, request2, socket, contentLength, header, expectsPayload) { - assert4(contentLength === body.size, "blob body must have content length"); + assert3(contentLength === body.size, "blob body must have content length"); try { if (contentLength != null && contentLength !== body.size) { throw new RequestContentLengthMismatchError(); @@ -51215,7 +51215,7 @@ upgrade: ${upgrade}\r } } async function writeIterable(abort, body, client, request2, socket, contentLength, header, expectsPayload) { - assert4(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined"); + assert3(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined"); let callback = null; function onDrain() { if (callback) { @@ -51225,7 +51225,7 @@ upgrade: ${upgrade}\r } } const waitForDrain = () => new Promise((resolve2, reject) => { - assert4(callback === null); + assert3(callback === null); if (socket[kError]) { reject(socket[kError]); } else { @@ -51374,7 +51374,7 @@ ${len.toString(16)}\r const { socket, client, abort } = this; socket[kWriting] = false; if (err) { - assert4(client[kRunning] <= 1, "pipeline should only contain this request"); + assert3(client[kRunning] <= 1, "pipeline should only contain this request"); abort(err); } } @@ -51387,9 +51387,9 @@ ${len.toString(16)}\r var require_client_h2 = __commonJS({ "node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/dispatcher/client-h2.js"(exports, module) { "use strict"; - var assert4 = __require("node:assert"); + var assert3 = __require("node:assert"); var { pipeline: pipeline2 } = __require("node:stream"); - var util3 = require_util10(); + var util2 = require_util10(); var { RequestContentLengthMismatchError, RequestAbortedError, @@ -51464,17 +51464,17 @@ var require_client_h2 = __commonJS({ session[kClient] = client; session[kSocket] = socket; session[kHTTP2Session] = null; - util3.addListener(session, "error", onHttp2SessionError); - util3.addListener(session, "frameError", onHttp2FrameError); - util3.addListener(session, "end", onHttp2SessionEnd); - util3.addListener(session, "goaway", onHttp2SessionGoAway); - util3.addListener(session, "close", onHttp2SessionClose); + util2.addListener(session, "error", onHttp2SessionError); + util2.addListener(session, "frameError", onHttp2FrameError); + util2.addListener(session, "end", onHttp2SessionEnd); + util2.addListener(session, "goaway", onHttp2SessionGoAway); + util2.addListener(session, "close", onHttp2SessionClose); session.unref(); client[kHTTP2Session] = session; socket[kHTTP2Session] = session; - util3.addListener(socket, "error", onHttp2SocketError); - util3.addListener(socket, "end", onHttp2SocketEnd); - util3.addListener(socket, "close", onHttp2SocketClose); + util2.addListener(socket, "error", onHttp2SocketError); + util2.addListener(socket, "end", onHttp2SocketEnd); + util2.addListener(socket, "close", onHttp2SocketClose); socket[kClosed] = false; socket.on("close", onSocketClose); return { @@ -51514,7 +51514,7 @@ var require_client_h2 = __commonJS({ } } function onHttp2SessionError(err) { - assert4(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); + assert3(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); this[kSocket][kError] = err; this[kClient][kOnError](err); } @@ -51526,25 +51526,25 @@ var require_client_h2 = __commonJS({ } } function onHttp2SessionEnd() { - const err = new SocketError("other side closed", util3.getSocketInfo(this[kSocket])); + const err = new SocketError("other side closed", util2.getSocketInfo(this[kSocket])); this.destroy(err); - util3.destroy(this[kSocket], err); + util2.destroy(this[kSocket], err); } function onHttp2SessionGoAway(errorCode) { - const err = this[kError] || new SocketError(`HTTP/2: "GOAWAY" frame received with code ${errorCode}`, util3.getSocketInfo(this[kSocket])); + const err = this[kError] || new SocketError(`HTTP/2: "GOAWAY" frame received with code ${errorCode}`, util2.getSocketInfo(this[kSocket])); const client = this[kClient]; client[kSocket] = null; client[kHTTPContext] = null; this.close(); this[kHTTP2Session] = null; - util3.destroy(this[kSocket], err); + util2.destroy(this[kSocket], err); if (client[kRunningIdx] < client[kQueue].length) { const request2 = client[kQueue][client[kRunningIdx]]; client[kQueue][client[kRunningIdx]++] = null; - util3.errorRequest(client, request2, err); + util2.errorRequest(client, request2, err); client[kPendingIdx] = client[kRunningIdx]; } - assert4(client[kRunning] === 0); + assert3(client[kRunning] === 0); client.emit("disconnect", client[kUrl], [client], err); client.emit("connectionError", client[kUrl], [client], err); client[kResume](); @@ -51552,20 +51552,20 @@ var require_client_h2 = __commonJS({ function onHttp2SessionClose() { const { [kClient]: client } = this; const { [kSocket]: socket } = client; - const err = this[kSocket][kError] || this[kError] || new SocketError("closed", util3.getSocketInfo(socket)); + const err = this[kSocket][kError] || this[kError] || new SocketError("closed", util2.getSocketInfo(socket)); client[kSocket] = null; client[kHTTPContext] = null; if (client.destroyed) { - assert4(client[kPending] === 0); + assert3(client[kPending] === 0); const requests = client[kQueue].splice(client[kRunningIdx]); for (let i = 0; i < requests.length; i++) { const request2 = requests[i]; - util3.errorRequest(client, request2, err); + util2.errorRequest(client, request2, err); } } } function onHttp2SocketClose() { - const err = this[kError] || new SocketError("closed", util3.getSocketInfo(this)); + const err = this[kError] || new SocketError("closed", util2.getSocketInfo(this)); const client = this[kHTTP2Session][kClient]; client[kSocket] = null; client[kHTTPContext] = null; @@ -51573,17 +51573,17 @@ var require_client_h2 = __commonJS({ this[kHTTP2Session].destroy(err); } client[kPendingIdx] = client[kRunningIdx]; - assert4(client[kRunning] === 0); + assert3(client[kRunning] === 0); client.emit("disconnect", client[kUrl], [client], err); client[kResume](); } function onHttp2SocketError(err) { - assert4(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); + assert3(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); this[kError] = err; this[kClient][kOnError](err); } function onHttp2SocketEnd() { - util3.destroy(this, new SocketError("other side closed", util3.getSocketInfo(this))); + util2.destroy(this, new SocketError("other side closed", util2.getSocketInfo(this))); } function onSocketClose() { this[kClosed] = true; @@ -51594,10 +51594,10 @@ var require_client_h2 = __commonJS({ function writeH2(client, request2) { const requestTimeout = request2.bodyTimeout ?? client[kBodyTimeout]; const session = client[kHTTP2Session]; - const { method, path: path4, host, upgrade, expectContinue, signal, protocol, headers: reqHeaders } = request2; + const { method, path: path3, host, upgrade, expectContinue, signal, protocol, headers: reqHeaders } = request2; let { body } = request2; if (upgrade) { - util3.errorRequest(client, request2, new Error("Upgrade not supported for H2")); + util2.errorRequest(client, request2, new Error("Upgrade not supported for H2")); return false; } const headers = {}; @@ -51627,27 +51627,27 @@ var require_client_h2 = __commonJS({ } } let stream = null; - const { hostname: hostname5, port } = client[kUrl]; - headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname5}${port ? `:${port}` : ""}`; + const { hostname: hostname4, port } = client[kUrl]; + headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname4}${port ? `:${port}` : ""}`; headers[HTTP2_HEADER_METHOD] = method; const abort = (err) => { if (request2.aborted || request2.completed) { return; } err = err || new RequestAbortedError(); - util3.errorRequest(client, request2, err); + util2.errorRequest(client, request2, err); if (stream != null) { stream.removeAllListeners("data"); stream.close(); client[kOnError](err); client[kResume](); } - util3.destroy(body, err); + util2.destroy(body, err); }; try { request2.onConnect(abort); } catch (err) { - util3.errorRequest(client, request2, err); + util2.errorRequest(client, request2, err); } if (request2.aborted) { return false; @@ -51673,14 +51673,14 @@ var require_client_h2 = __commonJS({ stream.setTimeout(requestTimeout); return true; } - headers[HTTP2_HEADER_PATH] = path4; + headers[HTTP2_HEADER_PATH] = path3; headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https"; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { body.read(0); } - let contentLength = util3.bodyLength(body); - if (util3.isFormDataLike(body)) { + let contentLength = util2.bodyLength(body); + if (util2.isFormDataLike(body)) { extractBody ??= require_body2().extractBody; const [bodyStream, contentType] = extractBody(body); headers["content-type"] = contentType; @@ -51695,13 +51695,13 @@ var require_client_h2 = __commonJS({ } if (shouldSendContentLength(method) && contentLength > 0 && request2.contentLength != null && request2.contentLength !== contentLength) { if (client[kStrictContentLength]) { - util3.errorRequest(client, request2, new RequestContentLengthMismatchError()); + util2.errorRequest(client, request2, new RequestContentLengthMismatchError()); return false; } process.emitWarning(new RequestContentLengthMismatchError()); } if (contentLength != null) { - assert4(body, "no body must not have content length"); + assert3(body, "no body must not have content length"); headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`; } session.ref(); @@ -51808,7 +51808,7 @@ var require_client_h2 = __commonJS({ contentLength, expectsPayload ); - } else if (util3.isBuffer(body)) { + } else if (util2.isBuffer(body)) { writeBuffer( abort, stream, @@ -51819,7 +51819,7 @@ var require_client_h2 = __commonJS({ contentLength, expectsPayload ); - } else if (util3.isBlobLike(body)) { + } else if (util2.isBlobLike(body)) { if (typeof body.stream === "function") { writeIterable( abort, @@ -51843,7 +51843,7 @@ var require_client_h2 = __commonJS({ expectsPayload ); } - } else if (util3.isStream(body)) { + } else if (util2.isStream(body)) { writeStream( abort, client[kSocket], @@ -51854,7 +51854,7 @@ var require_client_h2 = __commonJS({ request2, contentLength ); - } else if (util3.isIterable(body)) { + } else if (util2.isIterable(body)) { writeIterable( abort, stream, @@ -51866,14 +51866,14 @@ var require_client_h2 = __commonJS({ expectsPayload ); } else { - assert4(false); + assert3(false); } } } function writeBuffer(abort, h2stream, body, client, request2, socket, contentLength, expectsPayload) { try { - if (body != null && util3.isBuffer(body)) { - assert4(contentLength === body.byteLength, "buffer body must have content length"); + if (body != null && util2.isBuffer(body)) { + assert3(contentLength === body.byteLength, "buffer body must have content length"); h2stream.cork(); h2stream.write(body); h2stream.uncork(); @@ -51885,21 +51885,21 @@ var require_client_h2 = __commonJS({ } request2.onRequestSent(); client[kResume](); - } catch (error50) { - abort(error50); + } catch (error49) { + abort(error49); } } function writeStream(abort, socket, expectsPayload, h2stream, body, client, request2, contentLength) { - assert4(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined"); - const pipe4 = pipeline2( + assert3(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined"); + const pipe3 = pipeline2( body, h2stream, (err) => { if (err) { - util3.destroy(pipe4, err); + util2.destroy(pipe3, err); abort(err); } else { - util3.removeAllListeners(pipe4); + util2.removeAllListeners(pipe3); request2.onRequestSent(); if (!expectsPayload) { socket[kReset] = true; @@ -51908,13 +51908,13 @@ var require_client_h2 = __commonJS({ } } ); - util3.addListener(pipe4, "data", onPipeData); + util2.addListener(pipe3, "data", onPipeData); function onPipeData(chunk) { request2.onBodySent(chunk); } } async function writeBlob(abort, h2stream, body, client, request2, socket, contentLength, expectsPayload) { - assert4(contentLength === body.size, "blob body must have content length"); + assert3(contentLength === body.size, "blob body must have content length"); try { if (contentLength != null && contentLength !== body.size) { throw new RequestContentLengthMismatchError(); @@ -51935,7 +51935,7 @@ var require_client_h2 = __commonJS({ } } async function writeIterable(abort, h2stream, body, client, request2, socket, contentLength, expectsPayload) { - assert4(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined"); + assert3(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined"); let callback = null; function onDrain() { if (callback) { @@ -51945,7 +51945,7 @@ var require_client_h2 = __commonJS({ } } const waitForDrain = () => new Promise((resolve2, reject) => { - assert4(callback === null); + assert3(callback === null); if (socket[kError]) { reject(socket[kError]); } else { @@ -51984,10 +51984,10 @@ var require_client_h2 = __commonJS({ var require_client2 = __commonJS({ "node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/dispatcher/client.js"(exports, module) { "use strict"; - var assert4 = __require("node:assert"); + var assert3 = __require("node:assert"); var net = __require("node:net"); var http2 = __require("node:http"); - var util3 = require_util10(); + var util2 = require_util10(); var { ClientStats } = require_stats(); var { channels } = require_diagnostics(); var Request2 = require_request3(); @@ -52159,7 +52159,7 @@ var require_client2 = __commonJS({ ...connect2 }); } - this[kUrl] = util3.parseOrigin(url4); + this[kUrl] = util2.parseOrigin(url4); this[kConnector] = connect2; this[kPipelining] = pipelining != null ? pipelining : 1; this[kMaxHeadersSize] = maxHeaderSize; @@ -52223,7 +52223,7 @@ var require_client2 = __commonJS({ const request2 = new Request2(this[kUrl].origin, opts, handler2); this[kQueue].push(request2); if (this[kResuming]) { - } else if (util3.bodyLength(request2.body) == null && util3.isIterable(request2.body)) { + } else if (util2.bodyLength(request2.body) == null && util2.isIterable(request2.body)) { this[kResuming] = 1; queueMicrotask(() => resume(this)); } else { @@ -52248,7 +52248,7 @@ var require_client2 = __commonJS({ const requests = this[kQueue].splice(this[kPendingIdx]); for (let i = 0; i < requests.length; i++) { const request2 = requests[i]; - util3.errorRequest(this, request2, err); + util2.errorRequest(this, request2, err); } const callback = () => { if (this[kClosedResolve]) { @@ -52269,32 +52269,32 @@ var require_client2 = __commonJS({ }; function onError(client, err) { if (client[kRunning] === 0 && err.code !== "UND_ERR_INFO" && err.code !== "UND_ERR_SOCKET") { - assert4(client[kPendingIdx] === client[kRunningIdx]); + assert3(client[kPendingIdx] === client[kRunningIdx]); const requests = client[kQueue].splice(client[kRunningIdx]); for (let i = 0; i < requests.length; i++) { const request2 = requests[i]; - util3.errorRequest(client, request2, err); + util2.errorRequest(client, request2, err); } - assert4(client[kSize] === 0); + assert3(client[kSize] === 0); } } function connect(client) { - assert4(!client[kConnecting]); - assert4(!client[kHTTPContext]); - let { host, hostname: hostname5, protocol, port } = client[kUrl]; - if (hostname5[0] === "[") { - const idx = hostname5.indexOf("]"); - assert4(idx !== -1); - const ip2 = hostname5.substring(1, idx); - assert4(net.isIPv6(ip2)); - hostname5 = ip2; + assert3(!client[kConnecting]); + assert3(!client[kHTTPContext]); + let { host, hostname: hostname4, protocol, port } = client[kUrl]; + if (hostname4[0] === "[") { + const idx = hostname4.indexOf("]"); + assert3(idx !== -1); + const ip2 = hostname4.substring(1, idx); + assert3(net.isIPv6(ip2)); + hostname4 = ip2; } client[kConnecting] = true; if (channels.beforeConnect.hasSubscribers) { channels.beforeConnect.publish({ connectParams: { host, - hostname: hostname5, + hostname: hostname4, protocol, port, version: client[kHTTPContext]?.version, @@ -52306,28 +52306,28 @@ var require_client2 = __commonJS({ } client[kConnector]({ host, - hostname: hostname5, + hostname: hostname4, protocol, port, servername: client[kServerName], localAddress: client[kLocalAddress] }, (err, socket) => { if (err) { - handleConnectError(client, err, { host, hostname: hostname5, protocol, port }); + handleConnectError(client, err, { host, hostname: hostname4, protocol, port }); client[kResume](); return; } if (client.destroyed) { - util3.destroy(socket.on("error", noop4), new ClientDestroyedError()); + util2.destroy(socket.on("error", noop4), new ClientDestroyedError()); client[kResume](); return; } - assert4(socket); + assert3(socket); try { client[kHTTPContext] = socket.alpnProtocol === "h2" ? connectH2(client, socket) : connectH1(client, socket); } catch (err2) { socket.destroy().on("error", noop4); - handleConnectError(client, err2, { host, hostname: hostname5, protocol, port }); + handleConnectError(client, err2, { host, hostname: hostname4, protocol, port }); client[kResume](); return; } @@ -52340,7 +52340,7 @@ var require_client2 = __commonJS({ channels.connected.publish({ connectParams: { host, - hostname: hostname5, + hostname: hostname4, protocol, port, version: client[kHTTPContext]?.version, @@ -52355,7 +52355,7 @@ var require_client2 = __commonJS({ client[kResume](); }); } - function handleConnectError(client, err, { host, hostname: hostname5, protocol, port }) { + function handleConnectError(client, err, { host, hostname: hostname4, protocol, port }) { if (client.destroyed) { return; } @@ -52364,7 +52364,7 @@ var require_client2 = __commonJS({ channels.connectError.publish({ connectParams: { host, - hostname: hostname5, + hostname: hostname4, protocol, port, version: client[kHTTPContext]?.version, @@ -52376,10 +52376,10 @@ var require_client2 = __commonJS({ }); } if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") { - assert4(client[kRunning] === 0); + assert3(client[kRunning] === 0); while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) { const request2 = client[kQueue][client[kPendingIdx]++]; - util3.errorRequest(client, request2, err); + util2.errorRequest(client, request2, err); } } else { onError(client, err); @@ -52406,7 +52406,7 @@ var require_client2 = __commonJS({ function _resume(client, sync) { while (true) { if (client.destroyed) { - assert4(client[kPending] === 0); + assert3(client[kPending] === 0); return; } if (client[kClosedResolve] && !client[kSize]) { @@ -52726,7 +52726,7 @@ var require_pool2 = __commonJS({ var { InvalidArgumentError } = require_errors4(); - var util3 = require_util10(); + var util2 = require_util10(); var { kUrl } = require_symbols6(); var buildConnector = require_connect2(); var kOptions = Symbol("options"); @@ -52772,8 +52772,8 @@ var require_pool2 = __commonJS({ } super(); this[kConnections] = connections || null; - this[kUrl] = util3.parseOrigin(origin); - this[kOptions] = { ...util3.deepClone(options), connect, allowH2, clientTtl }; + this[kUrl] = util2.parseOrigin(origin); + this[kOptions] = { ...util2.deepClone(options), connect, allowH2, clientTtl }; this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; this[kFactory] = factory; this.on("connect", (origin2, targets) => { @@ -52783,7 +52783,7 @@ var require_pool2 = __commonJS({ } } }); - this.on("connectionError", (origin2, targets, error50) => { + this.on("connectionError", (origin2, targets, error49) => { for (const target of targets) { const idx = this[kClients].indexOf(target); if (idx !== -1) { @@ -52964,7 +52964,7 @@ var require_agent2 = __commonJS({ var DispatcherBase = require_dispatcher_base2(); var Pool = require_pool2(); var Client2 = require_client2(); - var util3 = require_util10(); + var util2 = require_util10(); var kOnConnect = Symbol("onConnect"); var kOnDisconnect = Symbol("onDisconnect"); var kOnConnectionError = Symbol("onConnectionError"); @@ -52990,7 +52990,7 @@ var require_agent2 = __commonJS({ if (connect && typeof connect !== "function") { connect = { ...connect }; } - this[kOptions] = { ...util3.deepClone(options), maxOrigins, connect }; + this[kOptions] = { ...util2.deepClone(options), maxOrigins, connect }; this[kFactory] = factory; this[kClients] = /* @__PURE__ */ new Map(); this[kOrigins] = /* @__PURE__ */ new Set(); @@ -53145,10 +53145,10 @@ var require_proxy_agent2 = __commonJS({ }; const { origin, - path: path4 = "/", + path: path3 = "/", headers = {} } = opts; - opts.path = origin + path4; + opts.path = origin + path3; if (!("host" in headers) && !("Host" in headers)) { const { host } = new URL(origin); headers.host = host; @@ -53367,10 +53367,10 @@ var require_env_http_proxy_agent = __commonJS({ ]); } #getProxyAgentForUrl(url4) { - let { protocol, host: hostname5, port } = url4; - hostname5 = hostname5.replace(/:\d*$/, "").toLowerCase(); + let { protocol, host: hostname4, port } = url4; + hostname4 = hostname4.replace(/:\d*$/, "").toLowerCase(); port = Number.parseInt(port, 10) || DEFAULT_PORTS[protocol] || 0; - if (!this.#shouldProxy(hostname5, port)) { + if (!this.#shouldProxy(hostname4, port)) { return this[kNoProxyAgent]; } if (protocol === "https:") { @@ -53378,7 +53378,7 @@ var require_env_http_proxy_agent = __commonJS({ } return this[kHttpProxyAgent]; } - #shouldProxy(hostname5, port) { + #shouldProxy(hostname4, port) { if (this.#noProxyChanged) { this.#parseNoProxy(); } @@ -53394,11 +53394,11 @@ var require_env_http_proxy_agent = __commonJS({ continue; } if (!/^[.*]/.test(entry.hostname)) { - if (hostname5 === entry.hostname) { + if (hostname4 === entry.hostname) { return false; } } else { - if (hostname5.endsWith(entry.hostname.replace(/^\*/, ""))) { + if (hostname4.endsWith(entry.hostname.replace(/^\*/, ""))) { return false; } } @@ -53441,7 +53441,7 @@ var require_env_http_proxy_agent = __commonJS({ var require_retry_handler = __commonJS({ "node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/handler/retry-handler.js"(exports, module) { "use strict"; - var assert4 = __require("node:assert"); + var assert3 = __require("node:assert"); var { kRetryHandlerDefaultRetry } = require_symbols6(); var { RequestRetryError } = require_errors4(); var WrapHandler = require_wrap_handler(); @@ -53624,8 +53624,8 @@ var require_retry_handler = __commonJS({ }); } const { start, size, end = size ? size - 1 : null } = contentRange; - assert4(this.start === start, "content-range mismatch"); - assert4(this.end == null || this.end === end, "content-range mismatch"); + assert3(this.start === start, "content-range mismatch"); + assert3(this.end == null || this.end === end, "content-range mismatch"); return; } if (this.end == null) { @@ -53642,11 +53642,11 @@ var require_retry_handler = __commonJS({ return; } const { start, size, end = size ? size - 1 : null } = range2; - assert4( + assert3( start != null && Number.isFinite(start), "content-range mismatch" ); - assert4(end != null && Number.isFinite(end), "invalid content-length"); + assert3(end != null && Number.isFinite(end), "invalid content-length"); this.start = start; this.end = end; } @@ -53654,8 +53654,8 @@ var require_retry_handler = __commonJS({ const contentLength = headers["content-length"]; this.end = contentLength != null ? Number(contentLength) - 1 : null; } - assert4(Number.isFinite(this.start)); - assert4( + assert3(Number.isFinite(this.start)); + assert3( this.end == null || Number.isFinite(this.end), "invalid content-length" ); @@ -53789,7 +53789,7 @@ var require_h2c_client = __commonJS({ var { connect } = __require("node:net"); var { kClose, kDestroy } = require_symbols6(); var { InvalidArgumentError } = require_errors4(); - var util3 = require_util10(); + var util2 = require_util10(); var Client2 = require_client2(); var DispatcherBase = require_dispatcher_base2(); var H2CClient = class extends DispatcherBase { @@ -53829,10 +53829,10 @@ var require_h2c_client = __commonJS({ #buildConnector(connectOpts) { return (opts, callback) => { const timeout = connectOpts?.connectOpts ?? 1e4; - const { hostname: hostname5, port, pathname } = opts; + const { hostname: hostname4, port, pathname } = opts; const socket = connect({ ...opts, - host: hostname5, + host: hostname4, port, pathname }); @@ -53841,9 +53841,9 @@ var require_h2c_client = __commonJS({ socket.setKeepAlive(true, keepAliveInitialDelay); } socket.alpnProtocol = "h2"; - const clearConnectTimeout = util3.setupConnectTimeout( + const clearConnectTimeout = util2.setupConnectTimeout( new WeakRef(socket), - { timeout, hostname: hostname5, port } + { timeout, hostname: hostname4, port } ); socket.setNoDelay(true).once("connect", function() { queueMicrotask(clearConnectTimeout); @@ -53881,10 +53881,10 @@ var require_h2c_client = __commonJS({ var require_readable2 = __commonJS({ "node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/api/readable.js"(exports, module) { "use strict"; - var assert4 = __require("node:assert"); + var assert3 = __require("node:assert"); var { Readable } = __require("node:stream"); - var { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError: AbortError3 } = require_errors4(); - var util3 = require_util10(); + var { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError: AbortError2 } = require_errors4(); + var util2 = require_util10(); var { ReadableStreamFrom } = require_util10(); var kConsume = Symbol("kConsume"); var kReading = Symbol("kReading"); @@ -54063,7 +54063,7 @@ var require_readable2 = __commonJS({ * @returns {boolean} */ get bodyUsed() { - return util3.isDisturbed(this); + return util2.isDisturbed(this); } /** * @see https://fetch.spec.whatwg.org/#dom-body-body @@ -54075,7 +54075,7 @@ var require_readable2 = __commonJS({ this[kBody] = ReadableStreamFrom(this); if (this[kConsume]) { this[kBody].getReader(); - assert4(this[kBody].locked); + assert3(this[kBody].locked); } } return this[kBody]; @@ -54094,24 +54094,24 @@ var require_readable2 = __commonJS({ } const limit = opts?.limit && Number.isFinite(opts.limit) ? opts.limit : 128 * 1024; if (signal?.aborted) { - return Promise.reject(signal.reason ?? new AbortError3()); + return Promise.reject(signal.reason ?? new AbortError2()); } if (this._readableState.closeEmitted) { return Promise.resolve(null); } return new Promise((resolve2, reject) => { if (this[kContentLength] && this[kContentLength] > limit || this[kBytesRead] > limit) { - this.destroy(new AbortError3()); + this.destroy(new AbortError2()); } if (signal) { const onAbort = () => { - this.destroy(signal.reason ?? new AbortError3()); + this.destroy(signal.reason ?? new AbortError2()); }; signal.addEventListener("abort", onAbort); this.on("close", function() { signal.removeEventListener("abort", onAbort); if (signal.aborted) { - reject(signal.reason ?? new AbortError3()); + reject(signal.reason ?? new AbortError2()); } else { resolve2(null); } @@ -54141,10 +54141,10 @@ var require_readable2 = __commonJS({ return bodyReadable[kBody]?.locked === true || bodyReadable[kConsume] !== null; } function isUnusable(bodyReadable) { - return util3.isDisturbed(bodyReadable) || isLocked(bodyReadable); + return util2.isDisturbed(bodyReadable) || isLocked(bodyReadable); } function consume(stream, type2) { - assert4(!stream[kConsume]); + assert3(!stream[kConsume]); return new Promise((resolve2, reject) => { if (isUnusable(stream)) { const rState = stream._readableState; @@ -54283,11 +54283,11 @@ var require_readable2 = __commonJS({ var require_api_request2 = __commonJS({ "node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/api/api-request.js"(exports, module) { "use strict"; - var assert4 = __require("node:assert"); + var assert3 = __require("node:assert"); var { AsyncResource } = __require("node:async_hooks"); var { Readable } = require_readable2(); var { InvalidArgumentError, RequestAbortedError } = require_errors4(); - var util3 = require_util10(); + var util2 = require_util10(); function noop4() { } var RequestHandler = class extends AsyncResource { @@ -54314,8 +54314,8 @@ var require_api_request2 = __commonJS({ } super("UNDICI_REQUEST"); } catch (err) { - if (util3.isStream(body)) { - util3.destroy(body.on("error", noop4), err); + if (util2.isStream(body)) { + util2.destroy(body.on("error", noop4), err); } throw err; } @@ -54335,10 +54335,10 @@ var require_api_request2 = __commonJS({ if (signal?.aborted) { this.reason = signal.reason ?? new RequestAbortedError(); } else if (signal) { - this.removeAbortListener = util3.addAbortListener(signal, () => { + this.removeAbortListener = util2.addAbortListener(signal, () => { this.reason = signal.reason ?? new RequestAbortedError(); if (this.res) { - util3.destroy(this.res.on("error", noop4), this.reason); + util2.destroy(this.res.on("error", noop4), this.reason); } else if (this.abort) { this.abort(this.reason); } @@ -54350,20 +54350,20 @@ var require_api_request2 = __commonJS({ abort(this.reason); return; } - assert4(this.callback); + assert3(this.callback); this.abort = abort; this.context = context; } onHeaders(statusCode, rawHeaders, resume, statusMessage) { const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this; - const headers = responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders); + const headers = responseHeaders === "raw" ? util2.parseRawHeaders(rawHeaders) : util2.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { this.onInfo({ statusCode, headers }); } return; } - const parsedHeaders = responseHeaders === "raw" ? util3.parseHeaders(rawHeaders) : headers; + const parsedHeaders = responseHeaders === "raw" ? util2.parseHeaders(rawHeaders) : headers; const contentType = parsedHeaders["content-type"]; const contentLength = parsedHeaders["content-length"]; const res = new Readable({ @@ -54391,7 +54391,7 @@ var require_api_request2 = __commonJS({ }); } catch (err) { this.res = null; - util3.destroy(res.on("error", noop4), err); + util2.destroy(res.on("error", noop4), err); queueMicrotask(() => { throw err; }); @@ -54402,7 +54402,7 @@ var require_api_request2 = __commonJS({ return this.res.push(chunk); } onComplete(trailers) { - util3.parseHeaders(trailers, this.trailers); + util2.parseHeaders(trailers, this.trailers); this.res.push(null); } onError(err) { @@ -54416,14 +54416,14 @@ var require_api_request2 = __commonJS({ if (res) { this.res = null; queueMicrotask(() => { - util3.destroy(res.on("error", noop4), err); + util2.destroy(res.on("error", noop4), err); }); } if (body) { this.body = null; - if (util3.isStream(body)) { + if (util2.isStream(body)) { body.on("error", noop4); - util3.destroy(body, err); + util2.destroy(body, err); } } if (this.removeAbortListener) { @@ -54512,11 +54512,11 @@ var require_abort_signal2 = __commonJS({ var require_api_stream2 = __commonJS({ "node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/api/api-stream.js"(exports, module) { "use strict"; - var assert4 = __require("node:assert"); + var assert3 = __require("node:assert"); var { finished } = __require("node:stream"); var { AsyncResource } = __require("node:async_hooks"); var { InvalidArgumentError, InvalidReturnValueError } = require_errors4(); - var util3 = require_util10(); + var util2 = require_util10(); var { addSignal, removeSignal } = require_abort_signal2(); function noop4() { } @@ -54544,8 +54544,8 @@ var require_api_stream2 = __commonJS({ } super("UNDICI_STREAM"); } catch (err) { - if (util3.isStream(body)) { - util3.destroy(body.on("error", noop4), err); + if (util2.isStream(body)) { + util2.destroy(body.on("error", noop4), err); } throw err; } @@ -54559,7 +54559,7 @@ var require_api_stream2 = __commonJS({ this.trailers = null; this.body = body; this.onInfo = onInfo || null; - if (util3.isStream(body)) { + if (util2.isStream(body)) { body.on("error", (err) => { this.onError(err); }); @@ -54571,13 +54571,13 @@ var require_api_stream2 = __commonJS({ abort(this.reason); return; } - assert4(this.callback); + assert3(this.callback); this.abort = abort; this.context = context; } onHeaders(statusCode, rawHeaders, resume, statusMessage) { const { factory, opaque, context, responseHeaders } = this; - const headers = responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders); + const headers = responseHeaders === "raw" ? util2.parseRawHeaders(rawHeaders) : util2.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { this.onInfo({ statusCode, headers }); @@ -54601,7 +54601,7 @@ var require_api_stream2 = __commonJS({ const { callback, res: res2, opaque: opaque2, trailers, abort } = this; this.res = null; if (err || !res2?.readable) { - util3.destroy(res2, err); + util2.destroy(res2, err); } this.callback = null; this.runInAsyncScope(callback, null, err || null, { opaque: opaque2, trailers }); @@ -54624,7 +54624,7 @@ var require_api_stream2 = __commonJS({ if (!res) { return; } - this.trailers = util3.parseHeaders(trailers); + this.trailers = util2.parseHeaders(trailers); res.end(); } onError(err) { @@ -54633,7 +54633,7 @@ var require_api_stream2 = __commonJS({ this.factory = null; if (res) { this.res = null; - util3.destroy(res, err); + util2.destroy(res, err); } else if (callback) { this.callback = null; queueMicrotask(() => { @@ -54642,7 +54642,7 @@ var require_api_stream2 = __commonJS({ } if (body) { this.body = null; - util3.destroy(body, err); + util2.destroy(body, err); } } }; @@ -54678,14 +54678,14 @@ var require_api_pipeline2 = __commonJS({ Duplex, PassThrough } = __require("node:stream"); - var assert4 = __require("node:assert"); + var assert3 = __require("node:assert"); var { AsyncResource } = __require("node:async_hooks"); var { InvalidArgumentError, InvalidReturnValueError, RequestAbortedError } = require_errors4(); - var util3 = require_util10(); + var util2 = require_util10(); var { addSignal, removeSignal } = require_abort_signal2(); function noop4() { } @@ -54773,9 +54773,9 @@ var require_api_pipeline2 = __commonJS({ if (abort && err) { abort(); } - util3.destroy(body, err); - util3.destroy(req, err); - util3.destroy(res, err); + util2.destroy(body, err); + util2.destroy(req, err); + util2.destroy(res, err); removeSignal(this); callback(err); } @@ -54792,7 +54792,7 @@ var require_api_pipeline2 = __commonJS({ abort(this.reason); return; } - assert4(!res, "pipeline cannot be retried"); + assert3(!res, "pipeline cannot be retried"); this.abort = abort; this.context = context; } @@ -54800,7 +54800,7 @@ var require_api_pipeline2 = __commonJS({ const { opaque, handler: handler2, context } = this; if (statusCode < 200) { if (this.onInfo) { - const headers = this.responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders); + const headers = this.responseHeaders === "raw" ? util2.parseRawHeaders(rawHeaders) : util2.parseHeaders(rawHeaders); this.onInfo({ statusCode, headers }); } return; @@ -54809,7 +54809,7 @@ var require_api_pipeline2 = __commonJS({ let body; try { this.handler = null; - const headers = this.responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders); + const headers = this.responseHeaders === "raw" ? util2.parseRawHeaders(rawHeaders) : util2.parseHeaders(rawHeaders); body = this.runInAsyncScope(handler2, null, { statusCode, headers, @@ -54831,14 +54831,14 @@ var require_api_pipeline2 = __commonJS({ } }).on("error", (err) => { const { ret } = this; - util3.destroy(ret, err); + util2.destroy(ret, err); }).on("end", () => { const { ret } = this; ret.push(null); }).on("close", () => { const { ret } = this; if (!ret._readableState.ended) { - util3.destroy(ret, new RequestAbortedError()); + util2.destroy(ret, new RequestAbortedError()); } }); this.body = body; @@ -54854,7 +54854,7 @@ var require_api_pipeline2 = __commonJS({ onError(err) { const { ret } = this; this.handler = null; - util3.destroy(ret, err); + util2.destroy(ret, err); } }; function pipeline2(opts, handler2) { @@ -54876,8 +54876,8 @@ var require_api_upgrade2 = __commonJS({ "use strict"; var { InvalidArgumentError, SocketError } = require_errors4(); var { AsyncResource } = __require("node:async_hooks"); - var assert4 = __require("node:assert"); - var util3 = require_util10(); + var assert3 = __require("node:assert"); + var util2 = require_util10(); var { addSignal, removeSignal } = require_abort_signal2(); var UpgradeHandler = class extends AsyncResource { constructor(opts, callback) { @@ -54904,7 +54904,7 @@ var require_api_upgrade2 = __commonJS({ abort(this.reason); return; } - assert4(this.callback); + assert3(this.callback); this.abort = abort; this.context = null; } @@ -54912,11 +54912,11 @@ var require_api_upgrade2 = __commonJS({ throw new SocketError("bad upgrade", null); } onUpgrade(statusCode, rawHeaders, socket) { - assert4(statusCode === 101); + assert3(statusCode === 101); const { callback, opaque, context } = this; removeSignal(this); this.callback = null; - const headers = this.responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders); + const headers = this.responseHeaders === "raw" ? util2.parseRawHeaders(rawHeaders) : util2.parseHeaders(rawHeaders); this.runInAsyncScope(callback, null, null, { headers, socket, @@ -54967,10 +54967,10 @@ var require_api_upgrade2 = __commonJS({ var require_api_connect2 = __commonJS({ "node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/api/api-connect.js"(exports, module) { "use strict"; - var assert4 = __require("node:assert"); + var assert3 = __require("node:assert"); var { AsyncResource } = __require("node:async_hooks"); var { InvalidArgumentError, SocketError } = require_errors4(); - var util3 = require_util10(); + var util2 = require_util10(); var { addSignal, removeSignal } = require_abort_signal2(); var ConnectHandler = class extends AsyncResource { constructor(opts, callback) { @@ -54996,7 +54996,7 @@ var require_api_connect2 = __commonJS({ abort(this.reason); return; } - assert4(this.callback); + assert3(this.callback); this.abort = abort; this.context = context; } @@ -55009,7 +55009,7 @@ var require_api_connect2 = __commonJS({ this.callback = null; let headers = rawHeaders; if (headers != null) { - headers = this.responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders); + headers = this.responseHeaders === "raw" ? util2.parseRawHeaders(rawHeaders) : util2.parseHeaders(rawHeaders); } this.runInAsyncScope(callback, null, null, { statusCode, @@ -55182,10 +55182,10 @@ var require_mock_utils2 = __commonJS({ } } function buildHeadersFromArray(headers) { - const clone4 = headers.slice(); + const clone3 = headers.slice(); const entries = []; - for (let index = 0; index < clone4.length; index += 2) { - entries.push([clone4[index], clone4[index + 1]]); + for (let index = 0; index < clone3.length; index += 2) { + entries.push([clone3[index], clone3[index + 1]]); } return Object.fromEntries(entries); } @@ -55210,11 +55210,11 @@ var require_mock_utils2 = __commonJS({ } return true; } - function normalizeSearchParams(query2) { - if (typeof query2 !== "string") { - return query2; + function normalizeSearchParams(query) { + if (typeof query !== "string") { + return query; } - const originalQp = new URLSearchParams(query2); + const originalQp = new URLSearchParams(query); const normalizedQp = new URLSearchParams(); for (let [key, value2] of originalQp.entries()) { key = key.replace("[]", ""); @@ -55234,20 +55234,20 @@ var require_mock_utils2 = __commonJS({ } return normalizedQp; } - function safeUrl(path4) { - if (typeof path4 !== "string") { - return path4; + function safeUrl(path3) { + if (typeof path3 !== "string") { + return path3; } - const pathSegments = path4.split("?", 3); + const pathSegments = path3.split("?", 3); if (pathSegments.length !== 2) { - return path4; + return path3; } const qp = new URLSearchParams(pathSegments.pop()); qp.sort(); return [...pathSegments, qp.toString()].join("?"); } - function matchKey(mockDispatch2, { path: path4, method, body, headers }) { - const pathMatch = matchValue(mockDispatch2.path, path4); + function matchKey(mockDispatch2, { path: path3, method, body, headers }) { + const pathMatch = matchValue(mockDispatch2.path, path3); const methodMatch = matchValue(mockDispatch2.method, method); const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true; const headersMatch = matchHeaders(mockDispatch2, headers); @@ -55272,8 +55272,8 @@ var require_mock_utils2 = __commonJS({ const basePath = key.query ? serializePathWithQuery(key.path, key.query) : key.path; const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath; const resolvedPathWithoutTrailingSlash = removeTrailingSlash(resolvedPath); - let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path4, ignoreTrailingSlash }) => { - return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(path4)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path4), resolvedPath); + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path3, ignoreTrailingSlash }) => { + return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(path3)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path3), resolvedPath); }); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); @@ -55311,23 +55311,23 @@ var require_mock_utils2 = __commonJS({ mockDispatches.splice(index, 1); } } - function removeTrailingSlash(path4) { - while (path4.endsWith("/")) { - path4 = path4.slice(0, -1); + function removeTrailingSlash(path3) { + while (path3.endsWith("/")) { + path3 = path3.slice(0, -1); } - if (path4.length === 0) { - path4 = "/"; + if (path3.length === 0) { + path3 = "/"; } - return path4; + return path3; } function buildKey(opts) { - const { path: path4, method, body, headers, query: query2 } = opts; + const { path: path3, method, body, headers, query } = opts; return { - path: path4, + path: path3, method, body, headers, - query: query2 + query }; } function generateKeyValues(data) { @@ -55364,13 +55364,13 @@ var require_mock_utils2 = __commonJS({ if (mockDispatch2.data.callback) { mockDispatch2.data = { ...mockDispatch2.data, ...mockDispatch2.data.callback(opts) }; } - const { data: { statusCode, data, headers, trailers, error: error50 }, delay: delay2, persist } = mockDispatch2; + const { data: { statusCode, data, headers, trailers, error: error49 }, delay: delay2, persist } = mockDispatch2; const { timesInvoked, times } = mockDispatch2; mockDispatch2.consumed = !persist && timesInvoked >= times; mockDispatch2.pending = timesInvoked < times; - if (error50 !== null) { + if (error49 !== null) { deleteMockDispatch(this[kDispatches], key); - handler2.onError(error50); + handler2.onError(error49); return true; } if (typeof delay2 === "number" && delay2 > 0) { @@ -55408,19 +55408,19 @@ var require_mock_utils2 = __commonJS({ if (agent2.isMockActive) { try { mockDispatch.call(this, opts, handler2); - } catch (error50) { - if (error50.code === "UND_MOCK_ERR_MOCK_NOT_MATCHED") { + } catch (error49) { + if (error49.code === "UND_MOCK_ERR_MOCK_NOT_MATCHED") { const netConnect = agent2[kGetNetConnect](); if (netConnect === false) { - throw new MockNotMatchedError(`${error50.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); + throw new MockNotMatchedError(`${error49.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); } if (checkNetConnect(netConnect, origin)) { originalDispatch.call(this, opts, handler2); } else { - throw new MockNotMatchedError(`${error50.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); + throw new MockNotMatchedError(`${error49.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); } } else { - throw error50; + throw error49; } } } else { @@ -55595,11 +55595,11 @@ var require_mock_interceptor2 = __commonJS({ /** * Mock an undici request with a defined error. */ - replyWithError(error50) { - if (typeof error50 === "undefined") { + replyWithError(error49) { + if (typeof error49 === "undefined") { throw new InvalidArgumentError("error must be defined"); } - const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error50 }, { ignoreTrailingSlash: this[kIgnoreTrailingSlash] }); + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error49 }, { ignoreTrailingSlash: this[kIgnoreTrailingSlash] }); return new MockScope(newMockDispatch); } /** @@ -55749,8 +55749,8 @@ var require_mock_call_history = __commonJS({ } url4.search = new URLSearchParams(requestInit.query).toString(); return url4; - } catch (error50) { - throw new InvalidArgumentError("An error occurred when computing MockCallHistoryLog.url", { cause: error50 }); + } catch (error49) { + throw new InvalidArgumentError("An error occurred when computing MockCallHistoryLog.url", { cause: error49 }); } } var MockCallHistoryLog = class { @@ -55810,17 +55810,17 @@ var require_mock_call_history = __commonJS({ lastCall() { return this.logs.at(-1); } - nthCall(number8) { - if (typeof number8 !== "number") { + nthCall(number7) { + if (typeof number7 !== "number") { throw new InvalidArgumentError("nthCall must be called with a number"); } - if (!Number.isInteger(number8)) { + if (!Number.isInteger(number7)) { throw new InvalidArgumentError("nthCall must be called with an integer"); } - if (Math.sign(number8) !== 1) { + if (Math.sign(number7) !== 1) { throw new InvalidArgumentError("nthCall must be called with a positive value. use firstCall or lastCall instead"); } - return this.logs.at(number8 - 1); + return this.logs.at(number7 - 1); } filterCalls(criteria, options) { if (this.logs.length === 0) { @@ -55981,10 +55981,10 @@ var require_pending_interceptors_formatter2 = __commonJS({ } format(pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( - ({ method, path: path4, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + ({ method, path: path3, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, - Path: path4, + Path: path3, "Status code": statusCode, Persistent: persist ? PERSISTENT : NOT_PERSISTENT, Invocations: timesInvoked, @@ -56064,9 +56064,9 @@ var require_mock_agent2 = __commonJS({ const acceptNonStandardSearchParameters = this[kMockAgentAcceptsNonStandardSearchParameters]; const dispatchOpts = { ...opts }; if (acceptNonStandardSearchParameters && dispatchOpts.path) { - const [path4, searchParams] = dispatchOpts.path.split("?"); + const [path3, searchParams] = dispatchOpts.path.split("?"); const normalizedSearchParams = normalizeSearchParams(searchParams, acceptNonStandardSearchParameters); - dispatchOpts.path = `${path4}?${normalizedSearchParams}`; + dispatchOpts.path = `${path3}?${normalizedSearchParams}`; } return this[kAgent].dispatch(dispatchOpts, handler2); } @@ -56274,7 +56274,7 @@ var require_snapshot_recorder = __commonJS({ "node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/mock/snapshot-recorder.js"(exports, module) { "use strict"; var { writeFile, readFile, mkdir } = __require("node:fs/promises"); - var { dirname: dirname2, resolve: resolve2 } = __require("node:path"); + var { dirname, resolve: resolve2 } = __require("node:path"); var { setTimeout: setTimeout2, clearTimeout: clearTimeout2 } = __require("node:timers"); var { InvalidArgumentError, UndiciError } = require_errors4(); var { hashId, isUrlExcludedFactory, normalizeHeaders, createHeaderFilters } = require_snapshot_utils(); @@ -56463,12 +56463,12 @@ var require_snapshot_recorder = __commonJS({ * @return {Promise} - Resolves when snapshots are loaded */ async loadSnapshots(filePath) { - const path4 = filePath || this.#snapshotPath; - if (!path4) { + const path3 = filePath || this.#snapshotPath; + if (!path3) { throw new InvalidArgumentError("Snapshot path is required"); } try { - const data = await readFile(resolve2(path4), "utf8"); + const data = await readFile(resolve2(path3), "utf8"); const parsed2 = JSON.parse(data); if (Array.isArray(parsed2)) { this.#snapshots.clear(); @@ -56478,11 +56478,11 @@ var require_snapshot_recorder = __commonJS({ } else { this.#snapshots = new Map(Object.entries(parsed2)); } - } catch (error50) { - if (error50.code === "ENOENT") { + } catch (error49) { + if (error49.code === "ENOENT") { this.#snapshots.clear(); } else { - throw new UndiciError(`Failed to load snapshots from ${path4}`, { cause: error50 }); + throw new UndiciError(`Failed to load snapshots from ${path3}`, { cause: error49 }); } } } @@ -56493,12 +56493,12 @@ var require_snapshot_recorder = __commonJS({ * @returns {Promise} - Resolves when snapshots are saved */ async saveSnapshots(filePath) { - const path4 = filePath || this.#snapshotPath; - if (!path4) { + const path3 = filePath || this.#snapshotPath; + if (!path3) { throw new InvalidArgumentError("Snapshot path is required"); } - const resolvedPath = resolve2(path4); - await mkdir(dirname2(resolvedPath), { recursive: true }); + const resolvedPath = resolve2(path3); + await mkdir(dirname(resolvedPath), { recursive: true }); const data = Array.from(this.#snapshots.entries()).map(([hash2, snapshot2]) => ({ hash: hash2, snapshot: snapshot2 @@ -56713,12 +56713,12 @@ var require_snapshot_agent = __commonJS({ } else if (mode === "update") { return this.#recordAndReplay(opts, handler2); } else { - const error50 = new UndiciError(`No snapshot found for ${opts.method || "GET"} ${opts.path}`); + const error49 = new UndiciError(`No snapshot found for ${opts.method || "GET"} ${opts.path}`); if (handler2.onError) { - handler2.onError(error50); + handler2.onError(error49); return; } - throw error50; + throw error49; } } else if (mode === "record") { return this.#recordAndReplay(opts, handler2); @@ -56768,8 +56768,8 @@ var require_snapshot_agent = __commonJS({ trailers: responseData.trailers }).then(() => { handler2.onResponseEnd(controller, trailers); - }).catch((error50) => { - handler2.onResponseError(controller, error50); + }).catch((error49) => { + handler2.onResponseError(controller, error49); }); } }; @@ -56803,8 +56803,8 @@ var require_snapshot_agent = __commonJS({ const body = Buffer.from(response.body, "base64"); handler2.onResponseData(controller, body); handler2.onResponseEnd(controller, response.trailers); - } catch (error50) { - handler2.onError?.(error50); + } catch (error49) { + handler2.onError?.(error49); } } /** @@ -56977,7 +56977,7 @@ var require_global4 = __commonJS({ var require_decorator_handler = __commonJS({ "node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/handler/decorator-handler.js"(exports, module) { "use strict"; - var assert4 = __require("node:assert"); + var assert3 = __require("node:assert"); var WrapHandler = require_wrap_handler(); module.exports = class DecoratorHandler { #handler; @@ -56994,25 +56994,25 @@ var require_decorator_handler = __commonJS({ this.#handler.onRequestStart?.(...args3); } onRequestUpgrade(...args3) { - assert4(!this.#onCompleteCalled); - assert4(!this.#onErrorCalled); + assert3(!this.#onCompleteCalled); + assert3(!this.#onErrorCalled); return this.#handler.onRequestUpgrade?.(...args3); } onResponseStart(...args3) { - assert4(!this.#onCompleteCalled); - assert4(!this.#onErrorCalled); - assert4(!this.#onResponseStartCalled); + assert3(!this.#onCompleteCalled); + assert3(!this.#onErrorCalled); + assert3(!this.#onResponseStartCalled); this.#onResponseStartCalled = true; return this.#handler.onResponseStart?.(...args3); } onResponseData(...args3) { - assert4(!this.#onCompleteCalled); - assert4(!this.#onErrorCalled); + assert3(!this.#onCompleteCalled); + assert3(!this.#onErrorCalled); return this.#handler.onResponseData?.(...args3); } onResponseEnd(...args3) { - assert4(!this.#onCompleteCalled); - assert4(!this.#onErrorCalled); + assert3(!this.#onCompleteCalled); + assert3(!this.#onErrorCalled); this.#onCompleteCalled = true; return this.#handler.onResponseEnd?.(...args3); } @@ -57033,9 +57033,9 @@ var require_decorator_handler = __commonJS({ var require_redirect_handler = __commonJS({ "node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/handler/redirect-handler.js"(exports, module) { "use strict"; - var util3 = require_util10(); + var util2 = require_util10(); var { kBodyUsed } = require_symbols6(); - var assert4 = __require("node:assert"); + var assert3 = __require("node:assert"); var { InvalidArgumentError } = require_errors4(); var EE = __require("node:events"); var redirectableStatusCodes = [300, 301, 302, 303, 307, 308]; @@ -57048,7 +57048,7 @@ var require_redirect_handler = __commonJS({ this[kBodyUsed] = false; } async *[Symbol.asyncIterator]() { - assert4(!this[kBodyUsed], "disturbed"); + assert3(!this[kBodyUsed], "disturbed"); this[kBodyUsed] = true; yield* this[kBody]; } @@ -57072,10 +57072,10 @@ var require_redirect_handler = __commonJS({ this.maxRedirections = maxRedirections; this.handler = handler2; this.history = []; - if (util3.isStream(this.opts.body)) { - if (util3.bodyLength(this.opts.body) === 0) { + if (util2.isStream(this.opts.body)) { + if (util2.bodyLength(this.opts.body) === 0) { this.opts.body.on("data", function() { - assert4(false); + assert3(false); }); } if (typeof this.opts.body.readableDidRead !== "boolean") { @@ -57086,7 +57086,7 @@ var require_redirect_handler = __commonJS({ } } else if (this.opts.body && typeof this.opts.body.pipeTo === "function") { this.opts.body = new BodyAsyncIterable(this.opts.body); - } else if (this.opts.body && typeof this.opts.body !== "string" && !ArrayBuffer.isView(this.opts.body) && util3.isIterable(this.opts.body) && !util3.isFormDataLike(this.opts.body)) { + } else if (this.opts.body && typeof this.opts.body !== "string" && !ArrayBuffer.isView(this.opts.body) && util2.isIterable(this.opts.body) && !util2.isFormDataLike(this.opts.body)) { this.opts.body = new BodyAsyncIterable(this.opts.body); } } @@ -57102,19 +57102,19 @@ var require_redirect_handler = __commonJS({ } if ((statusCode === 301 || statusCode === 302) && this.opts.method === "POST") { this.opts.method = "GET"; - if (util3.isStream(this.opts.body)) { - util3.destroy(this.opts.body.on("error", noop4)); + if (util2.isStream(this.opts.body)) { + util2.destroy(this.opts.body.on("error", noop4)); } this.opts.body = null; } if (statusCode === 303 && this.opts.method !== "HEAD") { this.opts.method = "GET"; - if (util3.isStream(this.opts.body)) { - util3.destroy(this.opts.body.on("error", noop4)); + if (util2.isStream(this.opts.body)) { + util2.destroy(this.opts.body.on("error", noop4)); } this.opts.body = null; } - this.location = this.history.length >= this.maxRedirections || util3.isDisturbed(this.opts.body) || redirectableStatusCodes.indexOf(statusCode) === -1 ? null : headers.location; + this.location = this.history.length >= this.maxRedirections || util2.isDisturbed(this.opts.body) || redirectableStatusCodes.indexOf(statusCode) === -1 ? null : headers.location; if (this.opts.origin) { this.history.push(new URL(this.opts.path, this.opts.origin)); } @@ -57122,16 +57122,16 @@ var require_redirect_handler = __commonJS({ this.handler.onResponseStart?.(controller, statusCode, headers, statusMessage); return; } - const { origin, pathname, search: search2 } = util3.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); - const path4 = search2 ? `${pathname}${search2}` : pathname; - const redirectUrlString = `${origin}${path4}`; + const { origin, pathname, search: search2 } = util2.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); + const path3 = search2 ? `${pathname}${search2}` : pathname; + const redirectUrlString = `${origin}${path3}`; for (const historyUrl of this.history) { if (historyUrl.toString() === redirectUrlString) { throw new InvalidArgumentError(`Redirect loop detected. Cannot redirect to ${origin}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`); } } this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); - this.opts.path = path4; + this.opts.path = path3; this.opts.origin = origin; this.opts.query = null; } @@ -57148,19 +57148,19 @@ var require_redirect_handler = __commonJS({ this.handler.onResponseEnd(controller, trailers); } } - onResponseError(controller, error50) { - this.handler.onResponseError?.(controller, error50); + onResponseError(controller, error49) { + this.handler.onResponseError?.(controller, error49); } }; function shouldRemoveHeader(header, removeContent, unknownOrigin) { if (header.length === 4) { - return util3.headerNameToString(header) === "host"; + return util2.headerNameToString(header) === "host"; } - if (removeContent && util3.headerNameToString(header).startsWith("content-")) { + if (removeContent && util2.headerNameToString(header).startsWith("content-")) { return true; } if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) { - const name = util3.headerNameToString(header); + const name = util2.headerNameToString(header); return name === "authorization" || name === "cookie" || name === "proxy-authorization"; } return false; @@ -57181,7 +57181,7 @@ var require_redirect_handler = __commonJS({ } } } else { - assert4(headers == null, "headers must be an object or an array"); + assert3(headers == null, "headers must be an object or an array"); } return ret; } @@ -57585,16 +57585,16 @@ var require_dns = __commonJS({ setRecords(origin, addresses) { const timestamp = Date.now(); const records = { records: { 4: null, 6: null } }; - for (const record4 of addresses) { - record4.timestamp = timestamp; - if (typeof record4.ttl === "number") { - record4.ttl = Math.min(record4.ttl, this.#maxTTL); + for (const record3 of addresses) { + record3.timestamp = timestamp; + if (typeof record3.ttl === "number") { + record3.ttl = Math.min(record3.ttl, this.#maxTTL); } else { - record4.ttl = this.#maxTTL; + record3.ttl = this.#maxTTL; } - const familyRecords = records.records[record4.family] ?? { ips: [] }; - familyRecords.ips.push(record4); - records.records[record4.family] = familyRecords; + const familyRecords = records.records[record3.family] ?? { ips: [] }; + familyRecords.ips.push(record3); + records.records[record3.family] = familyRecords; } this.#records.set(origin.hostname, records); } @@ -57995,76 +57995,76 @@ var require_cache2 = __commonJS({ var require_date = __commonJS({ "node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/util/date.js"(exports, module) { "use strict"; - function parseHttpDate(date6) { - switch (date6[3]) { + function parseHttpDate(date5) { + switch (date5[3]) { case ",": - return parseImfDate(date6); + return parseImfDate(date5); case " ": - return parseAscTimeDate(date6); + return parseAscTimeDate(date5); default: - return parseRfc850Date(date6); + return parseRfc850Date(date5); } } - function parseImfDate(date6) { - if (date6.length !== 29 || date6[4] !== " " || date6[7] !== " " || date6[11] !== " " || date6[16] !== " " || date6[19] !== ":" || date6[22] !== ":" || date6[25] !== " " || date6[26] !== "G" || date6[27] !== "M" || date6[28] !== "T") { + function parseImfDate(date5) { + if (date5.length !== 29 || date5[4] !== " " || date5[7] !== " " || date5[11] !== " " || date5[16] !== " " || date5[19] !== ":" || date5[22] !== ":" || date5[25] !== " " || date5[26] !== "G" || date5[27] !== "M" || date5[28] !== "T") { return void 0; } let weekday = -1; - if (date6[0] === "S" && date6[1] === "u" && date6[2] === "n") { + if (date5[0] === "S" && date5[1] === "u" && date5[2] === "n") { weekday = 0; - } else if (date6[0] === "M" && date6[1] === "o" && date6[2] === "n") { + } else if (date5[0] === "M" && date5[1] === "o" && date5[2] === "n") { weekday = 1; - } else if (date6[0] === "T" && date6[1] === "u" && date6[2] === "e") { + } else if (date5[0] === "T" && date5[1] === "u" && date5[2] === "e") { weekday = 2; - } else if (date6[0] === "W" && date6[1] === "e" && date6[2] === "d") { + } else if (date5[0] === "W" && date5[1] === "e" && date5[2] === "d") { weekday = 3; - } else if (date6[0] === "T" && date6[1] === "h" && date6[2] === "u") { + } else if (date5[0] === "T" && date5[1] === "h" && date5[2] === "u") { weekday = 4; - } else if (date6[0] === "F" && date6[1] === "r" && date6[2] === "i") { + } else if (date5[0] === "F" && date5[1] === "r" && date5[2] === "i") { weekday = 5; - } else if (date6[0] === "S" && date6[1] === "a" && date6[2] === "t") { + } else if (date5[0] === "S" && date5[1] === "a" && date5[2] === "t") { weekday = 6; } else { return void 0; } let day = 0; - if (date6[5] === "0") { - const code = date6.charCodeAt(6); + if (date5[5] === "0") { + const code = date5.charCodeAt(6); if (code < 49 || code > 57) { return void 0; } day = code - 48; } else { - const code1 = date6.charCodeAt(5); + const code1 = date5.charCodeAt(5); if (code1 < 49 || code1 > 51) { return void 0; } - const code2 = date6.charCodeAt(6); + const code2 = date5.charCodeAt(6); if (code2 < 48 || code2 > 57) { return void 0; } day = (code1 - 48) * 10 + (code2 - 48); } let monthIdx = -1; - if (date6[8] === "J" && date6[9] === "a" && date6[10] === "n") { + if (date5[8] === "J" && date5[9] === "a" && date5[10] === "n") { monthIdx = 0; - } else if (date6[8] === "F" && date6[9] === "e" && date6[10] === "b") { + } else if (date5[8] === "F" && date5[9] === "e" && date5[10] === "b") { monthIdx = 1; - } else if (date6[8] === "M" && date6[9] === "a") { - if (date6[10] === "r") { + } else if (date5[8] === "M" && date5[9] === "a") { + if (date5[10] === "r") { monthIdx = 2; - } else if (date6[10] === "y") { + } else if (date5[10] === "y") { monthIdx = 4; } else { return void 0; } - } else if (date6[8] === "J") { - if (date6[9] === "a" && date6[10] === "n") { + } else if (date5[8] === "J") { + if (date5[9] === "a" && date5[10] === "n") { monthIdx = 0; - } else if (date6[9] === "u") { - if (date6[10] === "n") { + } else if (date5[9] === "u") { + if (date5[10] === "n") { monthIdx = 5; - } else if (date6[10] === "l") { + } else if (date5[10] === "l") { monthIdx = 6; } else { return void 0; @@ -58072,55 +58072,55 @@ var require_date = __commonJS({ } else { return void 0; } - } else if (date6[8] === "A") { - if (date6[9] === "p" && date6[10] === "r") { + } else if (date5[8] === "A") { + if (date5[9] === "p" && date5[10] === "r") { monthIdx = 3; - } else if (date6[9] === "u" && date6[10] === "g") { + } else if (date5[9] === "u" && date5[10] === "g") { monthIdx = 7; } else { return void 0; } - } else if (date6[8] === "S" && date6[9] === "e" && date6[10] === "p") { + } else if (date5[8] === "S" && date5[9] === "e" && date5[10] === "p") { monthIdx = 8; - } else if (date6[8] === "O" && date6[9] === "c" && date6[10] === "t") { + } else if (date5[8] === "O" && date5[9] === "c" && date5[10] === "t") { monthIdx = 9; - } else if (date6[8] === "N" && date6[9] === "o" && date6[10] === "v") { + } else if (date5[8] === "N" && date5[9] === "o" && date5[10] === "v") { monthIdx = 10; - } else if (date6[8] === "D" && date6[9] === "e" && date6[10] === "c") { + } else if (date5[8] === "D" && date5[9] === "e" && date5[10] === "c") { monthIdx = 11; } else { return void 0; } - const yearDigit1 = date6.charCodeAt(12); + const yearDigit1 = date5.charCodeAt(12); if (yearDigit1 < 48 || yearDigit1 > 57) { return void 0; } - const yearDigit2 = date6.charCodeAt(13); + const yearDigit2 = date5.charCodeAt(13); if (yearDigit2 < 48 || yearDigit2 > 57) { return void 0; } - const yearDigit3 = date6.charCodeAt(14); + const yearDigit3 = date5.charCodeAt(14); if (yearDigit3 < 48 || yearDigit3 > 57) { return void 0; } - const yearDigit4 = date6.charCodeAt(15); + const yearDigit4 = date5.charCodeAt(15); if (yearDigit4 < 48 || yearDigit4 > 57) { return void 0; } const year = (yearDigit1 - 48) * 1e3 + (yearDigit2 - 48) * 100 + (yearDigit3 - 48) * 10 + (yearDigit4 - 48); let hour = 0; - if (date6[17] === "0") { - const code = date6.charCodeAt(18); + if (date5[17] === "0") { + const code = date5.charCodeAt(18); if (code < 48 || code > 57) { return void 0; } hour = code - 48; } else { - const code1 = date6.charCodeAt(17); + const code1 = date5.charCodeAt(17); if (code1 < 48 || code1 > 50) { return void 0; } - const code2 = date6.charCodeAt(18); + const code2 = date5.charCodeAt(18); if (code2 < 48 || code2 > 57) { return void 0; } @@ -58130,36 +58130,36 @@ var require_date = __commonJS({ hour = (code1 - 48) * 10 + (code2 - 48); } let minute = 0; - if (date6[20] === "0") { - const code = date6.charCodeAt(21); + if (date5[20] === "0") { + const code = date5.charCodeAt(21); if (code < 48 || code > 57) { return void 0; } minute = code - 48; } else { - const code1 = date6.charCodeAt(20); + const code1 = date5.charCodeAt(20); if (code1 < 48 || code1 > 53) { return void 0; } - const code2 = date6.charCodeAt(21); + const code2 = date5.charCodeAt(21); if (code2 < 48 || code2 > 57) { return void 0; } minute = (code1 - 48) * 10 + (code2 - 48); } let second = 0; - if (date6[23] === "0") { - const code = date6.charCodeAt(24); + if (date5[23] === "0") { + const code = date5.charCodeAt(24); if (code < 48 || code > 57) { return void 0; } second = code - 48; } else { - const code1 = date6.charCodeAt(23); + const code1 = date5.charCodeAt(23); if (code1 < 48 || code1 > 53) { return void 0; } - const code2 = date6.charCodeAt(24); + const code2 = date5.charCodeAt(24); if (code2 < 48 || code2 > 57) { return void 0; } @@ -58168,48 +58168,48 @@ var require_date = __commonJS({ const result = new Date(Date.UTC(year, monthIdx, day, hour, minute, second)); return result.getUTCDay() === weekday ? result : void 0; } - function parseAscTimeDate(date6) { - if (date6.length !== 24 || date6[7] !== " " || date6[10] !== " " || date6[19] !== " ") { + function parseAscTimeDate(date5) { + if (date5.length !== 24 || date5[7] !== " " || date5[10] !== " " || date5[19] !== " ") { return void 0; } let weekday = -1; - if (date6[0] === "S" && date6[1] === "u" && date6[2] === "n") { + if (date5[0] === "S" && date5[1] === "u" && date5[2] === "n") { weekday = 0; - } else if (date6[0] === "M" && date6[1] === "o" && date6[2] === "n") { + } else if (date5[0] === "M" && date5[1] === "o" && date5[2] === "n") { weekday = 1; - } else if (date6[0] === "T" && date6[1] === "u" && date6[2] === "e") { + } else if (date5[0] === "T" && date5[1] === "u" && date5[2] === "e") { weekday = 2; - } else if (date6[0] === "W" && date6[1] === "e" && date6[2] === "d") { + } else if (date5[0] === "W" && date5[1] === "e" && date5[2] === "d") { weekday = 3; - } else if (date6[0] === "T" && date6[1] === "h" && date6[2] === "u") { + } else if (date5[0] === "T" && date5[1] === "h" && date5[2] === "u") { weekday = 4; - } else if (date6[0] === "F" && date6[1] === "r" && date6[2] === "i") { + } else if (date5[0] === "F" && date5[1] === "r" && date5[2] === "i") { weekday = 5; - } else if (date6[0] === "S" && date6[1] === "a" && date6[2] === "t") { + } else if (date5[0] === "S" && date5[1] === "a" && date5[2] === "t") { weekday = 6; } else { return void 0; } let monthIdx = -1; - if (date6[4] === "J" && date6[5] === "a" && date6[6] === "n") { + if (date5[4] === "J" && date5[5] === "a" && date5[6] === "n") { monthIdx = 0; - } else if (date6[4] === "F" && date6[5] === "e" && date6[6] === "b") { + } else if (date5[4] === "F" && date5[5] === "e" && date5[6] === "b") { monthIdx = 1; - } else if (date6[4] === "M" && date6[5] === "a") { - if (date6[6] === "r") { + } else if (date5[4] === "M" && date5[5] === "a") { + if (date5[6] === "r") { monthIdx = 2; - } else if (date6[6] === "y") { + } else if (date5[6] === "y") { monthIdx = 4; } else { return void 0; } - } else if (date6[4] === "J") { - if (date6[5] === "a" && date6[6] === "n") { + } else if (date5[4] === "J") { + if (date5[5] === "a" && date5[6] === "n") { monthIdx = 0; - } else if (date6[5] === "u") { - if (date6[6] === "n") { + } else if (date5[5] === "u") { + if (date5[6] === "n") { monthIdx = 5; - } else if (date6[6] === "l") { + } else if (date5[6] === "l") { monthIdx = 6; } else { return void 0; @@ -58217,56 +58217,56 @@ var require_date = __commonJS({ } else { return void 0; } - } else if (date6[4] === "A") { - if (date6[5] === "p" && date6[6] === "r") { + } else if (date5[4] === "A") { + if (date5[5] === "p" && date5[6] === "r") { monthIdx = 3; - } else if (date6[5] === "u" && date6[6] === "g") { + } else if (date5[5] === "u" && date5[6] === "g") { monthIdx = 7; } else { return void 0; } - } else if (date6[4] === "S" && date6[5] === "e" && date6[6] === "p") { + } else if (date5[4] === "S" && date5[5] === "e" && date5[6] === "p") { monthIdx = 8; - } else if (date6[4] === "O" && date6[5] === "c" && date6[6] === "t") { + } else if (date5[4] === "O" && date5[5] === "c" && date5[6] === "t") { monthIdx = 9; - } else if (date6[4] === "N" && date6[5] === "o" && date6[6] === "v") { + } else if (date5[4] === "N" && date5[5] === "o" && date5[6] === "v") { monthIdx = 10; - } else if (date6[4] === "D" && date6[5] === "e" && date6[6] === "c") { + } else if (date5[4] === "D" && date5[5] === "e" && date5[6] === "c") { monthIdx = 11; } else { return void 0; } let day = 0; - if (date6[8] === " ") { - const code = date6.charCodeAt(9); + if (date5[8] === " ") { + const code = date5.charCodeAt(9); if (code < 49 || code > 57) { return void 0; } day = code - 48; } else { - const code1 = date6.charCodeAt(8); + const code1 = date5.charCodeAt(8); if (code1 < 49 || code1 > 51) { return void 0; } - const code2 = date6.charCodeAt(9); + const code2 = date5.charCodeAt(9); if (code2 < 48 || code2 > 57) { return void 0; } day = (code1 - 48) * 10 + (code2 - 48); } let hour = 0; - if (date6[11] === "0") { - const code = date6.charCodeAt(12); + if (date5[11] === "0") { + const code = date5.charCodeAt(12); if (code < 48 || code > 57) { return void 0; } hour = code - 48; } else { - const code1 = date6.charCodeAt(11); + const code1 = date5.charCodeAt(11); if (code1 < 48 || code1 > 50) { return void 0; } - const code2 = date6.charCodeAt(12); + const code2 = date5.charCodeAt(12); if (code2 < 48 || code2 > 57) { return void 0; } @@ -58276,54 +58276,54 @@ var require_date = __commonJS({ hour = (code1 - 48) * 10 + (code2 - 48); } let minute = 0; - if (date6[14] === "0") { - const code = date6.charCodeAt(15); + if (date5[14] === "0") { + const code = date5.charCodeAt(15); if (code < 48 || code > 57) { return void 0; } minute = code - 48; } else { - const code1 = date6.charCodeAt(14); + const code1 = date5.charCodeAt(14); if (code1 < 48 || code1 > 53) { return void 0; } - const code2 = date6.charCodeAt(15); + const code2 = date5.charCodeAt(15); if (code2 < 48 || code2 > 57) { return void 0; } minute = (code1 - 48) * 10 + (code2 - 48); } let second = 0; - if (date6[17] === "0") { - const code = date6.charCodeAt(18); + if (date5[17] === "0") { + const code = date5.charCodeAt(18); if (code < 48 || code > 57) { return void 0; } second = code - 48; } else { - const code1 = date6.charCodeAt(17); + const code1 = date5.charCodeAt(17); if (code1 < 48 || code1 > 53) { return void 0; } - const code2 = date6.charCodeAt(18); + const code2 = date5.charCodeAt(18); if (code2 < 48 || code2 > 57) { return void 0; } second = (code1 - 48) * 10 + (code2 - 48); } - const yearDigit1 = date6.charCodeAt(20); + const yearDigit1 = date5.charCodeAt(20); if (yearDigit1 < 48 || yearDigit1 > 57) { return void 0; } - const yearDigit2 = date6.charCodeAt(21); + const yearDigit2 = date5.charCodeAt(21); if (yearDigit2 < 48 || yearDigit2 > 57) { return void 0; } - const yearDigit3 = date6.charCodeAt(22); + const yearDigit3 = date5.charCodeAt(22); if (yearDigit3 < 48 || yearDigit3 > 57) { return void 0; } - const yearDigit4 = date6.charCodeAt(23); + const yearDigit4 = date5.charCodeAt(23); if (yearDigit4 < 48 || yearDigit4 > 57) { return void 0; } @@ -58331,109 +58331,109 @@ var require_date = __commonJS({ const result = new Date(Date.UTC(year, monthIdx, day, hour, minute, second)); return result.getUTCDay() === weekday ? result : void 0; } - function parseRfc850Date(date6) { + function parseRfc850Date(date5) { let commaIndex = -1; let weekday = -1; - if (date6[0] === "S") { - if (date6[1] === "u" && date6[2] === "n" && date6[3] === "d" && date6[4] === "a" && date6[5] === "y") { + if (date5[0] === "S") { + if (date5[1] === "u" && date5[2] === "n" && date5[3] === "d" && date5[4] === "a" && date5[5] === "y") { weekday = 0; commaIndex = 6; - } else if (date6[1] === "a" && date6[2] === "t" && date6[3] === "u" && date6[4] === "r" && date6[5] === "d" && date6[6] === "a" && date6[7] === "y") { + } else if (date5[1] === "a" && date5[2] === "t" && date5[3] === "u" && date5[4] === "r" && date5[5] === "d" && date5[6] === "a" && date5[7] === "y") { weekday = 6; commaIndex = 8; } - } else if (date6[0] === "M" && date6[1] === "o" && date6[2] === "n" && date6[3] === "d" && date6[4] === "a" && date6[5] === "y") { + } else if (date5[0] === "M" && date5[1] === "o" && date5[2] === "n" && date5[3] === "d" && date5[4] === "a" && date5[5] === "y") { weekday = 1; commaIndex = 6; - } else if (date6[0] === "T") { - if (date6[1] === "u" && date6[2] === "e" && date6[3] === "s" && date6[4] === "d" && date6[5] === "a" && date6[6] === "y") { + } else if (date5[0] === "T") { + if (date5[1] === "u" && date5[2] === "e" && date5[3] === "s" && date5[4] === "d" && date5[5] === "a" && date5[6] === "y") { weekday = 2; commaIndex = 7; - } else if (date6[1] === "h" && date6[2] === "u" && date6[3] === "r" && date6[4] === "s" && date6[5] === "d" && date6[6] === "a" && date6[7] === "y") { + } else if (date5[1] === "h" && date5[2] === "u" && date5[3] === "r" && date5[4] === "s" && date5[5] === "d" && date5[6] === "a" && date5[7] === "y") { weekday = 4; commaIndex = 8; } - } else if (date6[0] === "W" && date6[1] === "e" && date6[2] === "d" && date6[3] === "n" && date6[4] === "e" && date6[5] === "s" && date6[6] === "d" && date6[7] === "a" && date6[8] === "y") { + } else if (date5[0] === "W" && date5[1] === "e" && date5[2] === "d" && date5[3] === "n" && date5[4] === "e" && date5[5] === "s" && date5[6] === "d" && date5[7] === "a" && date5[8] === "y") { weekday = 3; commaIndex = 9; - } else if (date6[0] === "F" && date6[1] === "r" && date6[2] === "i" && date6[3] === "d" && date6[4] === "a" && date6[5] === "y") { + } else if (date5[0] === "F" && date5[1] === "r" && date5[2] === "i" && date5[3] === "d" && date5[4] === "a" && date5[5] === "y") { weekday = 5; commaIndex = 6; } else { return void 0; } - if (date6[commaIndex] !== "," || date6.length - commaIndex - 1 !== 23 || date6[commaIndex + 1] !== " " || date6[commaIndex + 4] !== "-" || date6[commaIndex + 8] !== "-" || date6[commaIndex + 11] !== " " || date6[commaIndex + 14] !== ":" || date6[commaIndex + 17] !== ":" || date6[commaIndex + 20] !== " " || date6[commaIndex + 21] !== "G" || date6[commaIndex + 22] !== "M" || date6[commaIndex + 23] !== "T") { + if (date5[commaIndex] !== "," || date5.length - commaIndex - 1 !== 23 || date5[commaIndex + 1] !== " " || date5[commaIndex + 4] !== "-" || date5[commaIndex + 8] !== "-" || date5[commaIndex + 11] !== " " || date5[commaIndex + 14] !== ":" || date5[commaIndex + 17] !== ":" || date5[commaIndex + 20] !== " " || date5[commaIndex + 21] !== "G" || date5[commaIndex + 22] !== "M" || date5[commaIndex + 23] !== "T") { return void 0; } let day = 0; - if (date6[commaIndex + 2] === "0") { - const code = date6.charCodeAt(commaIndex + 3); + if (date5[commaIndex + 2] === "0") { + const code = date5.charCodeAt(commaIndex + 3); if (code < 49 || code > 57) { return void 0; } day = code - 48; } else { - const code1 = date6.charCodeAt(commaIndex + 2); + const code1 = date5.charCodeAt(commaIndex + 2); if (code1 < 49 || code1 > 51) { return void 0; } - const code2 = date6.charCodeAt(commaIndex + 3); + const code2 = date5.charCodeAt(commaIndex + 3); if (code2 < 48 || code2 > 57) { return void 0; } day = (code1 - 48) * 10 + (code2 - 48); } let monthIdx = -1; - if (date6[commaIndex + 5] === "J" && date6[commaIndex + 6] === "a" && date6[commaIndex + 7] === "n") { + if (date5[commaIndex + 5] === "J" && date5[commaIndex + 6] === "a" && date5[commaIndex + 7] === "n") { monthIdx = 0; - } else if (date6[commaIndex + 5] === "F" && date6[commaIndex + 6] === "e" && date6[commaIndex + 7] === "b") { + } else if (date5[commaIndex + 5] === "F" && date5[commaIndex + 6] === "e" && date5[commaIndex + 7] === "b") { monthIdx = 1; - } else if (date6[commaIndex + 5] === "M" && date6[commaIndex + 6] === "a" && date6[commaIndex + 7] === "r") { + } else if (date5[commaIndex + 5] === "M" && date5[commaIndex + 6] === "a" && date5[commaIndex + 7] === "r") { monthIdx = 2; - } else if (date6[commaIndex + 5] === "A" && date6[commaIndex + 6] === "p" && date6[commaIndex + 7] === "r") { + } else if (date5[commaIndex + 5] === "A" && date5[commaIndex + 6] === "p" && date5[commaIndex + 7] === "r") { monthIdx = 3; - } else if (date6[commaIndex + 5] === "M" && date6[commaIndex + 6] === "a" && date6[commaIndex + 7] === "y") { + } else if (date5[commaIndex + 5] === "M" && date5[commaIndex + 6] === "a" && date5[commaIndex + 7] === "y") { monthIdx = 4; - } else if (date6[commaIndex + 5] === "J" && date6[commaIndex + 6] === "u" && date6[commaIndex + 7] === "n") { + } else if (date5[commaIndex + 5] === "J" && date5[commaIndex + 6] === "u" && date5[commaIndex + 7] === "n") { monthIdx = 5; - } else if (date6[commaIndex + 5] === "J" && date6[commaIndex + 6] === "u" && date6[commaIndex + 7] === "l") { + } else if (date5[commaIndex + 5] === "J" && date5[commaIndex + 6] === "u" && date5[commaIndex + 7] === "l") { monthIdx = 6; - } else if (date6[commaIndex + 5] === "A" && date6[commaIndex + 6] === "u" && date6[commaIndex + 7] === "g") { + } else if (date5[commaIndex + 5] === "A" && date5[commaIndex + 6] === "u" && date5[commaIndex + 7] === "g") { monthIdx = 7; - } else if (date6[commaIndex + 5] === "S" && date6[commaIndex + 6] === "e" && date6[commaIndex + 7] === "p") { + } else if (date5[commaIndex + 5] === "S" && date5[commaIndex + 6] === "e" && date5[commaIndex + 7] === "p") { monthIdx = 8; - } else if (date6[commaIndex + 5] === "O" && date6[commaIndex + 6] === "c" && date6[commaIndex + 7] === "t") { + } else if (date5[commaIndex + 5] === "O" && date5[commaIndex + 6] === "c" && date5[commaIndex + 7] === "t") { monthIdx = 9; - } else if (date6[commaIndex + 5] === "N" && date6[commaIndex + 6] === "o" && date6[commaIndex + 7] === "v") { + } else if (date5[commaIndex + 5] === "N" && date5[commaIndex + 6] === "o" && date5[commaIndex + 7] === "v") { monthIdx = 10; - } else if (date6[commaIndex + 5] === "D" && date6[commaIndex + 6] === "e" && date6[commaIndex + 7] === "c") { + } else if (date5[commaIndex + 5] === "D" && date5[commaIndex + 6] === "e" && date5[commaIndex + 7] === "c") { monthIdx = 11; } else { return void 0; } - const yearDigit1 = date6.charCodeAt(commaIndex + 9); + const yearDigit1 = date5.charCodeAt(commaIndex + 9); if (yearDigit1 < 48 || yearDigit1 > 57) { return void 0; } - const yearDigit2 = date6.charCodeAt(commaIndex + 10); + const yearDigit2 = date5.charCodeAt(commaIndex + 10); if (yearDigit2 < 48 || yearDigit2 > 57) { return void 0; } let year = (yearDigit1 - 48) * 10 + (yearDigit2 - 48); year += year < 70 ? 2e3 : 1900; let hour = 0; - if (date6[commaIndex + 12] === "0") { - const code = date6.charCodeAt(commaIndex + 13); + if (date5[commaIndex + 12] === "0") { + const code = date5.charCodeAt(commaIndex + 13); if (code < 48 || code > 57) { return void 0; } hour = code - 48; } else { - const code1 = date6.charCodeAt(commaIndex + 12); + const code1 = date5.charCodeAt(commaIndex + 12); if (code1 < 48 || code1 > 50) { return void 0; } - const code2 = date6.charCodeAt(commaIndex + 13); + const code2 = date5.charCodeAt(commaIndex + 13); if (code2 < 48 || code2 > 57) { return void 0; } @@ -58443,36 +58443,36 @@ var require_date = __commonJS({ hour = (code1 - 48) * 10 + (code2 - 48); } let minute = 0; - if (date6[commaIndex + 15] === "0") { - const code = date6.charCodeAt(commaIndex + 16); + if (date5[commaIndex + 15] === "0") { + const code = date5.charCodeAt(commaIndex + 16); if (code < 48 || code > 57) { return void 0; } minute = code - 48; } else { - const code1 = date6.charCodeAt(commaIndex + 15); + const code1 = date5.charCodeAt(commaIndex + 15); if (code1 < 48 || code1 > 53) { return void 0; } - const code2 = date6.charCodeAt(commaIndex + 16); + const code2 = date5.charCodeAt(commaIndex + 16); if (code2 < 48 || code2 > 57) { return void 0; } minute = (code1 - 48) * 10 + (code2 - 48); } let second = 0; - if (date6[commaIndex + 18] === "0") { - const code = date6.charCodeAt(commaIndex + 19); + if (date5[commaIndex + 18] === "0") { + const code = date5.charCodeAt(commaIndex + 19); if (code < 48 || code > 57) { return void 0; } second = code - 48; } else { - const code1 = date6.charCodeAt(commaIndex + 18); + const code1 = date5.charCodeAt(commaIndex + 18); if (code1 < 48 || code1 > 53) { return void 0; } - const code2 = date6.charCodeAt(commaIndex + 19); + const code2 = date5.charCodeAt(commaIndex + 19); if (code2 < 48 || code2 > 57) { return void 0; } @@ -58491,7 +58491,7 @@ var require_date = __commonJS({ var require_cache_handler = __commonJS({ "node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/handler/cache-handler.js"(exports, module) { "use strict"; - var util3 = require_util10(); + var util2 = require_util10(); var { parseCacheControlHeader, parseVaryHeader, @@ -58577,7 +58577,7 @@ var require_cache_handler = __commonJS({ resHeaders, statusMessage ); - if (!util3.safeHTTPMethods.includes(this.#cacheKey.method) && statusCode >= 200 && statusCode <= 399) { + if (!util2.safeHTTPMethods.includes(this.#cacheKey.method) && statusCode >= 200 && statusCode <= 399) { try { this.#store.delete(this.#cacheKey)?.catch?.(noop4); } catch { @@ -58789,8 +58789,8 @@ var require_cache_handler = __commonJS({ } return strippedHeaders ?? resHeaders; } - function isValidDate2(date6) { - return date6 instanceof Date && Number.isFinite(date6.valueOf()); + function isValidDate2(date5) { + return date5 instanceof Date && Number.isFinite(date5.valueOf()); } module.exports = CacheHandler; } @@ -58977,7 +58977,7 @@ var require_memory_cache_store = __commonJS({ var require_cache_revalidation_handler = __commonJS({ "node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/handler/cache-revalidation-handler.js"(exports, module) { "use strict"; - var assert4 = __require("node:assert"); + var assert3 = __require("node:assert"); var CacheRevalidationHandler = class { #successful = false; /** @@ -59014,7 +59014,7 @@ var require_cache_revalidation_handler = __commonJS({ this.#handler.onRequestUpgrade?.(controller, statusCode, headers, socket); } onResponseStart(controller, statusCode, headers, statusMessage) { - assert4(this.#callback != null); + assert3(this.#callback != null); this.#successful = statusCode === 304 || this.#allowErrorStatusCodes && statusCode >= 500 && statusCode <= 504; this.#callback(this.#successful, this.#context); this.#callback = null; @@ -59064,14 +59064,14 @@ var require_cache_revalidation_handler = __commonJS({ var require_cache3 = __commonJS({ "node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/interceptor/cache.js"(exports, module) { "use strict"; - var assert4 = __require("node:assert"); + var assert3 = __require("node:assert"); var { Readable } = __require("node:stream"); - var util3 = require_util10(); + var util2 = require_util10(); var CacheHandler = require_cache_handler(); var MemoryCacheStore = require_memory_cache_store(); var CacheRevalidationHandler = require_cache_revalidation_handler(); var { assertCacheStore, assertCacheMethods, makeCacheKey, normalizeHeaders, parseCacheControlHeader } = require_cache2(); - var { AbortError: AbortError3 } = require_errors4(); + var { AbortError: AbortError2 } = require_errors4(); function needsRevalidation(result, cacheControlDirectives) { if (cacheControlDirectives?.["no-cache"]) { return true; @@ -59105,20 +59105,20 @@ var require_cache3 = __commonJS({ } function handleUncachedResponse(dispatch, globalOpts, cacheKey, handler2, opts, reqCacheControl) { if (reqCacheControl?.["only-if-cached"]) { - let aborted4 = false; + let aborted3 = false; try { if (typeof handler2.onConnect === "function") { handler2.onConnect(() => { - aborted4 = true; + aborted3 = true; }); - if (aborted4) { + if (aborted3) { return; } } if (typeof handler2.onHeaders === "function") { handler2.onHeaders(504, [], () => { }, "Gateway Timeout"); - if (aborted4) { + if (aborted3) { return; } } @@ -59135,9 +59135,9 @@ var require_cache3 = __commonJS({ return dispatch(opts, new CacheHandler(globalOpts, cacheKey, handler2)); } function sendCachedValue(handler2, opts, result, age, context, isStale) { - const stream = util3.isStream(result.body) ? result.body : Readable.from(result.body ?? []); - assert4(!stream.destroyed, "stream should not be destroyed"); - assert4(!stream.readableDidRead, "stream should not be readableDidRead"); + const stream = util2.isStream(result.body) ? result.body : Readable.from(result.body ?? []); + assert3(!stream.destroyed, "stream should not be destroyed"); + assert3(!stream.readableDidRead, "stream should not be readableDidRead"); const controller = { resume() { stream.resume(); @@ -59155,7 +59155,7 @@ var require_cache3 = __commonJS({ return stream.errored; }, abort(reason) { - stream.destroy(reason ?? new AbortError3()); + stream.destroy(reason ?? new AbortError2()); } }; stream.on("error", function(err) { @@ -59188,7 +59188,7 @@ var require_cache3 = __commonJS({ }); } } - function handleResult3(dispatch, globalOpts, cacheKey, handler2, opts, reqCacheControl, result) { + function handleResult2(dispatch, globalOpts, cacheKey, handler2, opts, reqCacheControl, result) { if (!result) { return handleUncachedResponse(dispatch, globalOpts, cacheKey, handler2, opts, reqCacheControl); } @@ -59201,7 +59201,7 @@ var require_cache3 = __commonJS({ return dispatch(opts, handler2); } if (needsRevalidation(result, reqCacheControl)) { - if (util3.isStream(opts.body) && util3.bodyLength(opts.body) !== 0) { + if (util2.isStream(opts.body) && util2.bodyLength(opts.body) !== 0) { return dispatch(opts, new CacheHandler(globalOpts, cacheKey, handler2)); } if (withinStaleWhileRevalidateWindow(result)) { @@ -59271,7 +59271,7 @@ var require_cache3 = __commonJS({ (success2, context) => { if (success2) { sendCachedValue(handler2, opts, result, age, context, true); - } else if (util3.isStream(result.body)) { + } else if (util2.isStream(result.body)) { result.body.on("error", () => { }).destroy(); } @@ -59281,7 +59281,7 @@ var require_cache3 = __commonJS({ ) ); } - if (util3.isStream(opts.body)) { + if (util2.isStream(opts.body)) { opts.body.on("error", () => { }).destroy(); } @@ -59311,7 +59311,7 @@ var require_cache3 = __commonJS({ cacheByDefault, type: type2 }; - const safeMethodsToNotCache = util3.safeHTTPMethods.filter((method) => methods.includes(method) === false); + const safeMethodsToNotCache = util2.safeHTTPMethods.filter((method) => methods.includes(method) === false); return (dispatch) => { return (opts2, handler2) => { if (!opts2.origin || safeMethodsToNotCache.includes(opts2.method)) { @@ -59329,7 +59329,7 @@ var require_cache3 = __commonJS({ const result = store.get(cacheKey); if (result && typeof result.then === "function") { result.then((result2) => { - handleResult3( + handleResult2( dispatch, globalOpts, cacheKey, @@ -59340,7 +59340,7 @@ var require_cache3 = __commonJS({ ); }); } else { - handleResult3( + handleResult2( dispatch, globalOpts, cacheKey, @@ -59443,8 +59443,8 @@ var require_decompress = __commonJS({ } } }); - decompressor.on("error", (error50) => { - super.onResponseError(controller, error50); + decompressor.on("error", (error49) => { + super.onResponseError(controller, error49); }); } /** @@ -59939,8 +59939,8 @@ var require_headers2 = __commonJS({ isValidHeaderValue } = require_util11(); var { webidl } = require_webidl2(); - var assert4 = __require("node:assert"); - var util3 = __require("node:util"); + var assert3 = __require("node:assert"); + var util2 = __require("node:util"); function isHTTPWhiteSpaceCharCode(code) { return code === 10 || code === 13 || code === 9 || code === 32; } @@ -60147,24 +60147,24 @@ var require_headers2 = __commonJS({ // https://fetch.spec.whatwg.org/#convert-header-names-to-a-sorted-lowercase-set toSortedArray() { const size = this.headersMap.size; - const array4 = new Array(size); + const array3 = new Array(size); if (size <= 32) { if (size === 0) { - return array4; + return array3; } const iterator2 = this.headersMap[Symbol.iterator](); const firstValue = iterator2.next().value; - array4[0] = [firstValue[0], firstValue[1].value]; - assert4(firstValue[1].value !== null); + array3[0] = [firstValue[0], firstValue[1].value]; + assert3(firstValue[1].value !== null); for (let i = 1, j = 0, right = 0, left = 0, pivot = 0, x, value2; i < size; ++i) { value2 = iterator2.next().value; - x = array4[i] = [value2[0], value2[1].value]; - assert4(x[1] !== null); + x = array3[i] = [value2[0], value2[1].value]; + assert3(x[1] !== null); left = 0; right = i; while (left < right) { pivot = left + (right - left >> 1); - if (array4[pivot][0] <= x[0]) { + if (array3[pivot][0] <= x[0]) { left = pivot + 1; } else { right = pivot; @@ -60173,22 +60173,22 @@ var require_headers2 = __commonJS({ if (i !== pivot) { j = i; while (j > left) { - array4[j] = array4[--j]; + array3[j] = array3[--j]; } - array4[left] = x; + array3[left] = x; } } if (!iterator2.next().done) { throw new TypeError("Unreachable"); } - return array4; + return array3; } else { let i = 0; for (const { 0: name, 1: { value: value2 } } of this.headersMap) { - array4[i++] = [name, value2]; - assert4(value2 !== null); + array3[i++] = [name, value2]; + assert3(value2 !== null); } - return array4.sort(compareHeaderName); + return array3.sort(compareHeaderName); } } }; @@ -60309,9 +60309,9 @@ var require_headers2 = __commonJS({ } return []; } - [util3.inspect.custom](depth, options) { + [util2.inspect.custom](depth, options) { options.depth ??= depth; - return `Headers ${util3.formatWithOptions(options, this.#headersList.entries)}`; + return `Headers ${util2.formatWithOptions(options, this.#headersList.entries)}`; } static getHeadersGuard(o) { return o.#guard; @@ -60350,14 +60350,14 @@ var require_headers2 = __commonJS({ value: "Headers", configurable: true }, - [util3.inspect.custom]: { + [util2.inspect.custom]: { enumerable: false } }); webidl.converters.HeadersInit = function(V, prefix, argument) { if (webidl.util.Type(V) === webidl.util.Types.OBJECT) { const iterator2 = Reflect.get(V, Symbol.iterator); - if (!util3.types.isProxy(V) && iterator2 === Headers2.prototype.entries) { + if (!util2.types.isProxy(V) && iterator2 === Headers2.prototype.entries) { try { return getHeadersList(V).entriesList; } catch { @@ -60394,13 +60394,13 @@ var require_response2 = __commonJS({ "use strict"; var { Headers: Headers2, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = require_headers2(); var { extractBody, cloneBody, mixinBody, streamRegistry, bodyUnusable } = require_body2(); - var util3 = require_util10(); + var util2 = require_util10(); var nodeUtil = __require("node:util"); - var { kEnumerableProperty } = util3; + var { kEnumerableProperty } = util2; var { isValidReasonPhrase, isCancelled, - isAborted: isAborted3, + isAborted: isAborted2, serializeJavascriptValueToJSONString, isErrorLike, isomorphicEncode, @@ -60413,7 +60413,7 @@ var require_response2 = __commonJS({ var { webidl } = require_webidl2(); var { URLSerializer } = require_data_url(); var { kConstruct } = require_symbols6(); - var assert4 = __require("node:assert"); + var assert3 = __require("node:assert"); var textEncoder = new TextEncoder("utf-8"); var Response2 = class _Response { /** @type {Headers} */ @@ -60525,7 +60525,7 @@ var require_response2 = __commonJS({ } get bodyUsed() { webidl.brandCheck(this, _Response); - return !!this.#state.body && util3.isDisturbed(this.#state.body.stream); + return !!this.#state.body && util2.isDisturbed(this.#state.body.stream); } // Returns a clone of response. clone() { @@ -60669,7 +60669,7 @@ var require_response2 = __commonJS({ return p in state ? state[p] : target[p]; }, set(target, p, value2) { - assert4(!(p in state)); + assert3(!(p in state)); target[p] = value2; return true; } @@ -60703,12 +60703,12 @@ var require_response2 = __commonJS({ body: null }); } else { - assert4(false); + assert3(false); } } function makeAppropriateNetworkError(fetchParams, err = null) { - assert4(isCancelled(fetchParams)); - return isAborted3(fetchParams) ? makeNetworkError(Object.assign(new DOMException("The operation was aborted.", "AbortError"), { cause: err })) : makeNetworkError(Object.assign(new DOMException("Request was cancelled."), { cause: err })); + assert3(isCancelled(fetchParams)); + return isAborted2(fetchParams) ? makeNetworkError(Object.assign(new DOMException("The operation was aborted.", "AbortError"), { cause: err })) : makeNetworkError(Object.assign(new DOMException("Request was cancelled."), { cause: err })); } function initializeResponse(response, init, body) { if (init.status !== null && (init.status < 200 || init.status > 599)) { @@ -60817,7 +60817,7 @@ var require_request4 = __commonJS({ "use strict"; var { extractBody, mixinBody, cloneBody, bodyUnusable } = require_body2(); var { Headers: Headers2, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = require_headers2(); - var util3 = require_util10(); + var util2 = require_util10(); var nodeUtil = __require("node:util"); var { isValidHTTPToken, @@ -60834,12 +60834,12 @@ var require_request4 = __commonJS({ requestCache, requestDuplex } = require_constants8(); - var { kEnumerableProperty, normalizedMethodRecordsBase, normalizedMethodRecords } = util3; + var { kEnumerableProperty, normalizedMethodRecordsBase, normalizedMethodRecords } = util2; var { webidl } = require_webidl2(); var { URLSerializer } = require_data_url(); var { kConstruct } = require_symbols6(); - var assert4 = __require("node:assert"); - var { getMaxListeners, setMaxListeners: setMaxListeners2, defaultMaxListeners } = __require("node:events"); + var assert3 = __require("node:assert"); + var { getMaxListeners, setMaxListeners, defaultMaxListeners } = __require("node:events"); var kAbortController = Symbol("abortController"); var requestFinalizer = new FinalizationRegistry(({ signal, abort }) => { signal.removeEventListener("abort", abort); @@ -60914,7 +60914,7 @@ var require_request4 = __commonJS({ request2 = makeRequest({ urlList: [parsedURL] }); fallbackMode = "cors"; } else { - assert4(webidl.is.Request(input)); + assert3(webidl.is.Request(input)); request2 = input.#state; signal = input.#signal; this.#dispatcher = init.dispatcher || input.#dispatcher; @@ -61079,9 +61079,9 @@ var require_request4 = __commonJS({ const acRef = new WeakRef(ac); const abort = buildAbort(acRef); if (abortSignalHasEventHandlerLeakWarning && getMaxListeners(signal) === defaultMaxListeners) { - setMaxListeners2(1500, signal); + setMaxListeners(1500, signal); } - util3.addAbortListener(signal, abort); + util2.addAbortListener(signal, abort); requestFinalizer.register(ac, { signal, abort }, abort); } } @@ -61265,7 +61265,7 @@ var require_request4 = __commonJS({ } get bodyUsed() { webidl.brandCheck(this, _Request); - return !!this.#state.body && util3.isDisturbed(this.#state.body.stream); + return !!this.#state.body && util2.isDisturbed(this.#state.body.stream); } get duplex() { webidl.brandCheck(this, _Request); @@ -61289,7 +61289,7 @@ var require_request4 = __commonJS({ } const acRef = new WeakRef(ac); list.add(acRef); - util3.addAbortListener( + util2.addAbortListener( ac.signal, buildAbort(acRef) ); @@ -61563,7 +61563,7 @@ var require_request4 = __commonJS({ var require_subresource_integrity = __commonJS({ "node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js"(exports, module) { "use strict"; - var assert4 = __require("node:assert"); + var assert3 = __require("node:assert"); var validSRIHashAlgorithmTokenSet = /* @__PURE__ */ new Map([["sha256", 0], ["sha384", 1], ["sha512", 2]]); var crypto2; try { @@ -61610,7 +61610,7 @@ var require_subresource_integrity = __commonJS({ const result = []; let strongest = null; for (const item of metadataList) { - assert4(isValidSRIHashAlgorithm(item.alg), "Invalid SRI hash algorithm token"); + assert3(isValidSRIHashAlgorithm(item.alg), "Invalid SRI hash algorithm token"); if (result.length === 0) { result.push(item); strongest = item; @@ -61730,7 +61730,7 @@ var require_fetch2 = __commonJS({ coarsenedSharedCurrentTime, sameOrigin, isCancelled, - isAborted: isAborted3, + isAborted: isAborted2, isErrorLike, fullyReadBody, readableStreamClose, @@ -61744,7 +61744,7 @@ var require_fetch2 = __commonJS({ createInflate, extractMimeType } = require_util11(); - var assert4 = __require("node:assert"); + var assert3 = __require("node:assert"); var { safelyExtractBody, extractBody } = require_body2(); var { redirectStatusSet, @@ -61783,17 +61783,17 @@ var require_fetch2 = __commonJS({ this.emit("terminated", reason); } // https://fetch.spec.whatwg.org/#fetch-controller-abort - abort(error50) { + abort(error49) { if (this.state !== "ongoing") { return; } this.state = "aborted"; - if (!error50) { - error50 = new DOMException("The operation was aborted.", "AbortError"); + if (!error49) { + error49 = new DOMException("The operation was aborted.", "AbortError"); } - this.serializedAbortReason = error50; - this.connection?.destroy(error50); - this.emit("terminated", error50); + this.serializedAbortReason = error49; + this.connection?.destroy(error49); + this.emit("terminated", error49); } }; function handleFetchDone(response) { @@ -61825,7 +61825,7 @@ var require_fetch2 = __commonJS({ requestObject.signal, () => { locallyAborted = true; - assert4(controller != null); + assert3(controller != null); controller.abort(requestObject.signal.reason); const realResponse = responseObject?.deref(); abortFetch(p, request2, realResponse, requestObject.signal.reason); @@ -61892,12 +61892,12 @@ var require_fetch2 = __commonJS({ ); } var markResourceTiming = performance.markResourceTiming; - function abortFetch(p, request2, responseObject, error50) { + function abortFetch(p, request2, responseObject, error49) { if (p) { - p.reject(error50); + p.reject(error49); } if (request2.body?.stream != null && isReadable(request2.body.stream)) { - request2.body.stream.cancel(error50).catch((err) => { + request2.body.stream.cancel(error49).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -61909,7 +61909,7 @@ var require_fetch2 = __commonJS({ } const response = getResponseState(responseObject); if (response.body?.stream != null && isReadable(response.body.stream)) { - response.body.stream.cancel(error50).catch((err) => { + response.body.stream.cancel(error49).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -61928,7 +61928,7 @@ var require_fetch2 = __commonJS({ dispatcher = getGlobalDispatcher() // undici }) { - assert4(dispatcher); + assert3(dispatcher); let taskDestination = null; let crossOriginIsolatedCapability = false; if (request2.client != null) { @@ -61951,7 +61951,7 @@ var require_fetch2 = __commonJS({ taskDestination, crossOriginIsolatedCapability }; - assert4(!request2.body || request2.body.stream); + assert3(!request2.body || request2.body.stream); if (request2.window === "client") { request2.window = request2.client?.globalObject?.constructor?.name === "Window" ? request2.client : "no-window"; } @@ -62040,7 +62040,7 @@ var require_fetch2 = __commonJS({ } else if (request2.responseTainting === "opaque") { response = filterResponse(response, "opaque"); } else { - assert4(false); + assert3(false); } } let internalResponse = response.status === 0 ? response : response.internalResponse; @@ -62270,7 +62270,7 @@ var require_fetch2 = __commonJS({ } else if (request2.redirect === "follow") { response = await httpRedirectFetch(fetchParams, response); } else { - assert4(false); + assert3(false); } } response.timingInfo = timingInfo; @@ -62323,7 +62323,7 @@ var require_fetch2 = __commonJS({ request2.headersList.delete("host", true); } if (request2.body != null) { - assert4(request2.body.source != null); + assert3(request2.body.source != null); request2.body = safelyExtractBody(request2.body.source)[0]; } const timingInfo = fetchParams.timingInfo; @@ -62456,7 +62456,7 @@ var require_fetch2 = __commonJS({ return response; } async function httpNetworkFetch(fetchParams, includeCredentials = false, forceNewConnection = false) { - assert4(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed); + assert3(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed); fetchParams.controller.connection = { abort: null, destroyed: false, @@ -62564,7 +62564,7 @@ var require_fetch2 = __commonJS({ let isFailure; try { const { done, value: value2 } = await fetchParams.controller.next(); - if (isAborted3(fetchParams)) { + if (isAborted2(fetchParams)) { break; } bytes = done ? void 0 : value2; @@ -62600,7 +62600,7 @@ var require_fetch2 = __commonJS({ } }; function onAborted(reason) { - if (isAborted3(fetchParams)) { + if (isAborted2(fetchParams)) { response.aborted = true; if (isReadable(stream)) { fetchParams.controller.controller.error( @@ -62722,13 +62722,13 @@ var require_fetch2 = __commonJS({ fetchParams.controller.ended = true; this.body.push(null); }, - onError(error50) { + onError(error49) { if (this.abort) { fetchParams.controller.off("terminated", this.abort); } - this.body?.destroy(error50); - fetchParams.controller.terminate(error50); - reject(error50); + this.body?.destroy(error49); + fetchParams.controller.terminate(error49); + reject(error49); }, onUpgrade(status, rawHeaders, socket) { if (status !== 101) { @@ -62763,7 +62763,7 @@ var require_fetch2 = __commonJS({ var require_util12 = __commonJS({ "node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/web/cache/util.js"(exports, module) { "use strict"; - var assert4 = __require("node:assert"); + var assert3 = __require("node:assert"); var { URLSerializer } = require_data_url(); var { isValidHeaderName } = require_util11(); function urlEquals(A, B, excludeFragment = false) { @@ -62772,7 +62772,7 @@ var require_util12 = __commonJS({ return serializedA === serializedB; } function getFieldValues(header) { - assert4(header !== null); + assert3(header !== null); const values = []; for (let value2 of header.split(",")) { value2 = value2.trim(); @@ -62793,7 +62793,7 @@ var require_util12 = __commonJS({ var require_cache4 = __commonJS({ "node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/web/cache/cache.js"(exports, module) { "use strict"; - var assert4 = __require("node:assert"); + var assert3 = __require("node:assert"); var { kConstruct } = require_symbols6(); var { urlEquals, getFieldValues } = require_util12(); var { kEnumerableProperty, isDisturbed } = require_util10(); @@ -63043,7 +63043,7 @@ var require_cache4 = __commonJS({ return false; } } else { - assert4(typeof request2 === "string"); + assert3(typeof request2 === "string"); r = getRequestState(new Request2(request2)); } const operations = []; @@ -63154,7 +63154,7 @@ var require_cache4 = __commonJS({ } for (const requestResponse of requestResponses) { const idx = cache.indexOf(requestResponse); - assert4(idx !== -1); + assert3(idx !== -1); cache.splice(idx, 1); } } else if (operation.type === "put") { @@ -63186,7 +63186,7 @@ var require_cache4 = __commonJS({ requestResponses = this.#queryCache(operation.request); for (const requestResponse of requestResponses) { const idx = cache.indexOf(requestResponse); - assert4(idx !== -1); + assert3(idx !== -1); cache.splice(idx, 1); } cache.push([operation.request, operation.response]); @@ -63522,9 +63522,9 @@ var require_util13 = __commonJS({ } } } - function validateCookiePath(path4) { - for (let i = 0; i < path4.length; ++i) { - const code = path4.charCodeAt(i); + function validateCookiePath(path3) { + for (let i = 0; i < path3.length; ++i) { + const code = path3.charCodeAt(i); if (code < 32 || // exclude CTLs (0-31) code === 127 || // DEL code === 59) { @@ -63561,11 +63561,11 @@ var require_util13 = __commonJS({ "Dec" ]; var IMFPaddedNumbers = Array(61).fill(0).map((_, i) => i.toString().padStart(2, "0")); - function toIMFDate(date6) { - if (typeof date6 === "number") { - date6 = new Date(date6); + function toIMFDate(date5) { + if (typeof date5 === "number") { + date5 = new Date(date5); } - return `${IMFDays[date6.getUTCDay()]}, ${IMFPaddedNumbers[date6.getUTCDate()]} ${IMFMonths[date6.getUTCMonth()]} ${date6.getUTCFullYear()} ${IMFPaddedNumbers[date6.getUTCHours()]}:${IMFPaddedNumbers[date6.getUTCMinutes()]}:${IMFPaddedNumbers[date6.getUTCSeconds()]} GMT`; + return `${IMFDays[date5.getUTCDay()]}, ${IMFPaddedNumbers[date5.getUTCDate()]} ${IMFMonths[date5.getUTCMonth()]} ${date5.getUTCFullYear()} ${IMFPaddedNumbers[date5.getUTCHours()]}:${IMFPaddedNumbers[date5.getUTCMinutes()]}:${IMFPaddedNumbers[date5.getUTCSeconds()]} GMT`; } function validateCookieMaxAge(maxAge) { if (maxAge < 0) { @@ -63638,7 +63638,7 @@ var require_parse2 = __commonJS({ var { maxNameValuePairSize, maxAttributeValueSize } = require_constants9(); var { isCTLExcludingHtab } = require_util13(); var { collectASequenceOfCodePointsFast } = require_data_url(); - var assert4 = __require("node:assert"); + var assert3 = __require("node:assert"); var { unescape: qsUnescape } = __require("node:querystring"); function parseSetCookie(header) { if (isCTLExcludingHtab(header)) { @@ -63681,7 +63681,7 @@ var require_parse2 = __commonJS({ if (unparsedAttributes.length === 0) { return cookieAttributeList; } - assert4(unparsedAttributes[0] === ";"); + assert3(unparsedAttributes[0] === ";"); unparsedAttributes = unparsedAttributes.slice(1); let cookieAv = ""; if (unparsedAttributes.includes(";")) { @@ -64526,7 +64526,7 @@ var require_connection2 = __commonJS({ var { Headers: Headers2, getHeadersList } = require_headers2(); var { getDecodeSplit } = require_util11(); var { WebsocketFrameSend } = require_frame2(); - var assert4 = __require("node:assert"); + var assert3 = __require("node:assert"); var crypto2; try { crypto2 = __require("node:crypto"); @@ -64626,7 +64626,7 @@ var require_connection2 = __commonJS({ if (reason.length !== 0 && code === null) { code = 1e3; } - assert4(code === null || Number.isInteger(code)); + assert3(code === null || Number.isInteger(code)); if (code === null && reason.length === 0) { frame.frameData = emptyBuffer; } else if (code !== null && reason === null) { @@ -64725,7 +64725,7 @@ var require_receiver2 = __commonJS({ "node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/web/websocket/receiver.js"(exports, module) { "use strict"; var { Writable } = __require("node:stream"); - var assert4 = __require("node:assert"); + var assert3 = __require("node:assert"); var { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = require_constants10(); var { isValidStatusCode, @@ -64877,9 +64877,9 @@ var require_receiver2 = __commonJS({ } this.#state = parserStates.INFO; } else { - this.#extensions.get("permessage-deflate").decompress(body, this.#info.fin, (error50, data) => { - if (error50) { - failWebsocketConnection(this.#handler, 1007, error50.message); + this.#extensions.get("permessage-deflate").decompress(body, this.#info.fin, (error49, data) => { + if (error49) { + failWebsocketConnection(this.#handler, 1007, error49.message); return; } this.writeFragments(data); @@ -64962,7 +64962,7 @@ var require_receiver2 = __commonJS({ return output; } parseCloseBody(data) { - assert4(data.length !== 1); + assert3(data.length !== 1); let code; if (data.length >= 2) { code = data.readUInt16BE(0); @@ -65651,10 +65651,10 @@ var require_websocketerror = __commonJS({ * @param {string} reason */ static createUnvalidatedWebSocketError(message, code, reason) { - const error50 = new _WebSocketError(message, kConstruct); - error50.#closeCode = code; - error50.#reason = reason; - return error50; + const error49 = new _WebSocketError(message, kConstruct); + error49.#closeCode = code; + error49.#reason = reason; + return error49; } }; var { createUnvalidatedWebSocketError } = WebSocketError; @@ -65823,14 +65823,14 @@ var require_websocketstream = __commonJS({ data = new Uint8Array(ArrayBuffer.isView(chunk) ? new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength) : chunk.slice()); opcode = opcodes.BINARY; } else { - let string7; + let string6; try { - string7 = webidl.converters.DOMString(chunk); + string6 = webidl.converters.DOMString(chunk); } catch (e) { promise2.reject(e); return promise2.promise; } - data = new TextEncoder().encode(string7); + data = new TextEncoder().encode(string6); opcode = opcodes.TEXT; } if (!this.#handler.closeState.has(sentCloseFrameState.SENT) && !this.#handler.closeState.has(sentCloseFrameState.RECEIVED)) { @@ -65921,10 +65921,10 @@ var require_websocketstream = __commonJS({ reason }); } else { - const error50 = createUnvalidatedWebSocketError("unclean close", code, reason); - this.#readableStreamController.error(error50); - this.#writableStream.abort(error50); - this.#closedPromise.reject(error50); + const error49 = createUnvalidatedWebSocketError("unclean close", code, reason); + this.#readableStreamController.error(error49); + this.#writableStream.abort(error49); + this.#closedPromise.reject(error49); } } #closeUsingReason(reason) { @@ -66403,8 +66403,8 @@ var require_eventsource = __commonJS({ pipeline2( response.body.stream, eventSourceStream, - (error50) => { - if (error50?.aborted === false) { + (error49) => { + if (error49?.aborted === false) { this.close(); this.dispatchEvent(new Event("error")); } @@ -66569,7 +66569,7 @@ var require_undici2 = __commonJS({ var RetryAgent = require_retry_agent(); var H2CClient = require_h2c_client(); var errors = require_errors4(); - var util3 = require_util10(); + var util2 = require_util10(); var { InvalidArgumentError } = errors; var api = require_api2(); var buildConnector = require_connect2(); @@ -66613,8 +66613,8 @@ var require_undici2 = __commonJS({ module.exports.buildConnector = buildConnector; module.exports.errors = errors; module.exports.util = { - parseHeaders: util3.parseHeaders, - headerNameToString: util3.headerNameToString + parseHeaders: util2.parseHeaders, + headerNameToString: util2.headerNameToString }; function makeDispatcher(fn2) { return (url4, opts, handler2) => { @@ -66632,16 +66632,16 @@ var require_undici2 = __commonJS({ if (typeof opts.path !== "string") { throw new InvalidArgumentError("invalid opts.path"); } - let path4 = opts.path; + let path3 = opts.path; if (!opts.path.startsWith("/")) { - path4 = `/${path4}`; + path3 = `/${path3}`; } - url4 = new URL(util3.parseOrigin(url4).origin + path4); + url4 = new URL(util2.parseOrigin(url4).origin + path3); } else { if (!opts) { opts = typeof url4 === "object" ? url4 : {}; } - url4 = util3.parseURL(url4); + url4 = util2.parseURL(url4); } const { agent: agent2, dispatcher = getGlobalDispatcher() } = opts; if (agent2) { @@ -66749,14 +66749,14 @@ var require_uri_templates = __commonJS({ "*": true }; var urlEscapedChars = /[:/&?#]/; - function notReallyPercentEncode(string7) { - return encodeURI(string7).replace(/%25[0-9][0-9]/g, function(doubleEncoded) { + function notReallyPercentEncode(string6) { + return encodeURI(string6).replace(/%25[0-9][0-9]/g, function(doubleEncoded) { return "%" + doubleEncoded.substring(3); }); } - function isPercentEncoded(string7) { - string7 = string7.replace(/%../g, ""); - return encodeURIComponent(string7) === string7; + function isPercentEncoded(string6) { + string6 = string6.replace(/%../g, ""); + return encodeURIComponent(string6) === string6; } function uriTemplateSubstitution(spec) { var modifier = ""; @@ -67324,7 +67324,7 @@ var require_strip_ansi = __commonJS({ "node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js"(exports, module) { "use strict"; var ansiRegex = require_ansi_regex(); - module.exports = (string7) => typeof string7 === "string" ? string7.replace(ansiRegex(), "") : string7; + module.exports = (string6) => typeof string6 === "string" ? string6.replace(ansiRegex(), "") : string6; } }); @@ -67377,19 +67377,19 @@ var require_string_width = __commonJS({ "use strict"; var stripAnsi = require_strip_ansi(); var isFullwidthCodePoint = require_is_fullwidth_code_point(); - var emojiRegex4 = require_emoji_regex(); - var stringWidth = (string7) => { - if (typeof string7 !== "string" || string7.length === 0) { + var emojiRegex3 = require_emoji_regex(); + var stringWidth = (string6) => { + if (typeof string6 !== "string" || string6.length === 0) { return 0; } - string7 = stripAnsi(string7); - if (string7.length === 0) { + string6 = stripAnsi(string6); + if (string6.length === 0) { return 0; } - string7 = string7.replace(emojiRegex4(), " "); + string6 = string6.replace(emojiRegex3(), " "); let width = 0; - for (let i = 0; i < string7.length; i++) { - const code = string7.codePointAt(i); + for (let i = 0; i < string6.length; i++) { + const code = string6.codePointAt(i); if (code <= 31 || code >= 127 && code <= 159) { continue; } @@ -68054,9 +68054,9 @@ var require_conversions = __commonJS({ return [r, g, b]; }; convert.rgb.hex = function(args3) { - const integer5 = ((Math.round(args3[0]) & 255) << 16) + ((Math.round(args3[1]) & 255) << 8) + (Math.round(args3[2]) & 255); - const string7 = integer5.toString(16).toUpperCase(); - return "000000".substring(string7.length) + string7; + const integer4 = ((Math.round(args3[0]) & 255) << 16) + ((Math.round(args3[1]) & 255) << 8) + (Math.round(args3[2]) & 255); + const string6 = integer4.toString(16).toUpperCase(); + return "000000".substring(string6.length) + string6; }; convert.hex.rgb = function(args3) { const match2 = args3.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); @@ -68069,10 +68069,10 @@ var require_conversions = __commonJS({ return char + char; }).join(""); } - const integer5 = parseInt(colorString, 16); - const r = integer5 >> 16 & 255; - const g = integer5 >> 8 & 255; - const b = integer5 & 255; + const integer4 = parseInt(colorString, 16); + const r = integer4 >> 16 & 255; + const g = integer4 >> 8 & 255; + const b = integer4 & 255; return [r, g, b]; }; convert.rgb.hcg = function(rgb) { @@ -68235,9 +68235,9 @@ var require_conversions = __commonJS({ }; convert.gray.hex = function(gray) { const val = Math.round(gray[0] / 100 * 255) & 255; - const integer5 = (val << 16) + (val << 8) + val; - const string7 = integer5.toString(16).toUpperCase(); - return "000000".substring(string7.length) + string7; + const integer4 = (val << 16) + (val << 8) + val; + const string6 = integer4.toString(16).toUpperCase(); + return "000000".substring(string6.length) + string6; }; convert.rgb.gray = function(rgb) { const val = (rgb[0] + rgb[1] + rgb[2]) / 3; @@ -68288,15 +68288,15 @@ var require_route = __commonJS({ }; } function wrapConversion(toModel, graph) { - const path4 = [graph[toModel].parent, toModel]; + const path3 = [graph[toModel].parent, toModel]; let fn2 = conversions[graph[toModel].parent][toModel]; let cur = graph[toModel].parent; while (graph[cur].parent) { - path4.unshift(graph[cur].parent); + path3.unshift(graph[cur].parent); fn2 = link(conversions[graph[cur].parent][cur], fn2); cur = graph[cur].parent; } - fn2.conversion = path4; + fn2.conversion = path3; return fn2; } module.exports = function(fromModel) { @@ -68563,8 +68563,8 @@ var require_slice_ansi = __commonJS({ } return output.join(""); }; - module.exports = (string7, begin, end) => { - const characters = [...string7]; + module.exports = (string6, begin, end) => { + const characters = [...string6]; const ansiCodes = []; let stringEnd = typeof end === "number" ? end : characters.length; let isInsideEscape = false; @@ -68574,7 +68574,7 @@ var require_slice_ansi = __commonJS({ for (const [index, character] of characters.entries()) { let leftEscape = false; if (ESCAPES.includes(character)) { - const code = /\d[^m]*/.exec(string7.slice(index, index + 18)); + const code = /\d[^m]*/.exec(string6.slice(index, index + 18)); ansiCode = code && code.length > 0 ? code[0] : void 0; if (visible < stringEnd) { isInsideEscape = true; @@ -68753,10 +68753,10 @@ var require_utils6 = __commonJS({ }; }; exports.makeBorderConfig = makeBorderConfig; - var groupBySizes = (array4, sizes) => { + var groupBySizes = (array3, sizes) => { let startIndex = 0; return sizes.map((size) => { - const group2 = array4.slice(startIndex, startIndex + size); + const group2 = array3.slice(startIndex, startIndex + size); startIndex += size; return group2; }); @@ -68780,20 +68780,20 @@ var require_utils6 = __commonJS({ }); }; exports.sequence = sequence; - var sumArray = (array4) => { - return array4.reduce((accumulator, element) => { + var sumArray = (array3) => { + return array3.reduce((accumulator, element) => { return accumulator + element; }, 0); }; exports.sumArray = sumArray; - var extractTruncates = (config4) => { - return config4.columns.map(({ truncate }) => { + var extractTruncates = (config3) => { + return config3.columns.map(({ truncate }) => { return truncate; }); }; exports.extractTruncates = extractTruncates; - var flatten = (array4) => { - return [].concat(...array4); + var flatten = (array3) => { + return [].concat(...array3); }; exports.flatten = flatten; var calculateRangeCoordinate = (spanningCellConfig) => { @@ -68889,12 +68889,12 @@ var require_alignTableData = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.alignTableData = void 0; var alignString_1 = require_alignString(); - var alignTableData = (rows, config4) => { + var alignTableData = (rows, config3) => { return rows.map((row, rowIndex) => { return row.map((cell, cellIndex) => { var _a2; - const { width, alignment } = config4.columns[cellIndex]; - const containingRange = (_a2 = config4.spanningCellManager) === null || _a2 === void 0 ? void 0 : _a2.getContainingRange({ + const { width, alignment } = config3.columns[cellIndex]; + const containingRange = (_a2 = config3.spanningCellManager) === null || _a2 === void 0 ? void 0 : _a2.getContainingRange({ col: cellIndex, row: rowIndex }, { mapped: true }); @@ -69027,18 +69027,18 @@ var require_calculateRowHeights = __commonJS({ exports.calculateRowHeights = void 0; var calculateCellHeight_1 = require_calculateCellHeight(); var utils_1 = require_utils6(); - var calculateRowHeights = (rows, config4) => { + var calculateRowHeights = (rows, config3) => { const rowHeights = []; for (const [rowIndex, row] of rows.entries()) { let rowHeight = 1; row.forEach((cell, cellIndex) => { var _a2; - const containingRange = (_a2 = config4.spanningCellManager) === null || _a2 === void 0 ? void 0 : _a2.getContainingRange({ + const containingRange = (_a2 = config3.spanningCellManager) === null || _a2 === void 0 ? void 0 : _a2.getContainingRange({ col: cellIndex, row: rowIndex }); if (!containingRange) { - const cellHeight = (0, calculateCellHeight_1.calculateCellHeight)(cell, config4.columns[cellIndex].width, config4.columns[cellIndex].wrapWord); + const cellHeight = (0, calculateCellHeight_1.calculateCellHeight)(cell, config3.columns[cellIndex].width, config3.columns[cellIndex].wrapWord); rowHeight = Math.max(rowHeight, cellHeight); return; } @@ -69048,7 +69048,7 @@ var require_calculateRowHeights = __commonJS({ const totalHorizontalBorderHeight = bottomRight.row - topLeft.row; const totalHiddenHorizontalBorderHeight = (0, utils_1.sequence)(topLeft.row + 1, bottomRight.row).filter((horizontalBorderIndex) => { var _a3; - return !((_a3 = config4.drawHorizontalLine) === null || _a3 === void 0 ? void 0 : _a3.call(config4, horizontalBorderIndex, rows.length)); + return !((_a3 = config3.drawHorizontalLine) === null || _a3 === void 0 ? void 0 : _a3.call(config3, horizontalBorderIndex, rows.length)); }).length; const cellHeight = height - totalOccupiedSpanningCellHeight - totalHorizontalBorderHeight + totalHiddenHorizontalBorderHeight; rowHeight = Math.max(rowHeight, cellHeight); @@ -69328,8 +69328,8 @@ var require_drawRow = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.drawRow = void 0; var drawContent_1 = require_drawContent(); - var drawRow = (row, config4) => { - const { border, drawVerticalLine, rowIndex, spanningCellManager } = config4; + var drawRow = (row, config3) => { + const { border, drawVerticalLine, rowIndex, spanningCellManager } = config3; return (0, drawContent_1.drawContent)({ contents: row, drawSeparator: drawVerticalLine, @@ -71886,17 +71886,17 @@ var require_validateConfig = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.validateConfig = void 0; var validators_1 = __importDefault(require_validators()); - var validateConfig = (schemaId, config4) => { + var validateConfig = (schemaId, config3) => { const validate2 = validators_1.default[schemaId]; - if (!validate2(config4) && validate2.errors) { - const errors = validate2.errors.map((error50) => { + if (!validate2(config3) && validate2.errors) { + const errors = validate2.errors.map((error49) => { return { - message: error50.message, - params: error50.params, - schemaPath: error50.schemaPath + message: error49.message, + params: error49.params, + schemaPath: error49.schemaPath }; }); - console.log("config", config4); + console.log("config", config3); console.log("errors", errors); throw new Error("Invalid config."); } @@ -71927,18 +71927,18 @@ var require_makeStreamConfig = __commonJS({ }; }); }; - var makeStreamConfig = (config4) => { - (0, validateConfig_1.validateConfig)("streamConfig.json", config4); - if (config4.columnDefault.width === void 0) { + var makeStreamConfig = (config3) => { + (0, validateConfig_1.validateConfig)("streamConfig.json", config3); + if (config3.columnDefault.width === void 0) { throw new Error("Must provide config.columnDefault.width when creating a stream."); } return { drawVerticalLine: () => { return true; }, - ...config4, - border: (0, utils_1.makeBorderConfig)(config4.border), - columns: makeColumnsConfig(config4.columnCount, config4.columns, config4.columnDefault) + ...config3, + border: (0, utils_1.makeBorderConfig)(config3.border), + columns: makeColumnsConfig(config3.columnCount, config3.columns, config3.columnDefault) }; }; exports.makeStreamConfig = makeStreamConfig; @@ -71971,7 +71971,7 @@ var require_mapDataUsingRowHeights = __commonJS({ ]; }; exports.padCellVertically = padCellVertically; - var mapDataUsingRowHeights = (unmappedRows, rowHeights, config4) => { + var mapDataUsingRowHeights = (unmappedRows, rowHeights, config3) => { const nColumns = unmappedRows[0].length; const mappedRows = unmappedRows.map((unmappedRow, unmappedRowIndex) => { const outputRowHeight = rowHeights[unmappedRowIndex]; @@ -71980,7 +71980,7 @@ var require_mapDataUsingRowHeights = __commonJS({ }); unmappedRow.forEach((cell, cellIndex) => { var _a2; - const containingRange = (_a2 = config4.spanningCellManager) === null || _a2 === void 0 ? void 0 : _a2.getContainingRange({ + const containingRange = (_a2 = config3.spanningCellManager) === null || _a2 === void 0 ? void 0 : _a2.getContainingRange({ col: cellIndex, row: unmappedRowIndex }); @@ -71990,8 +71990,8 @@ var require_mapDataUsingRowHeights = __commonJS({ }); return; } - const cellLines = (0, wrapCell_1.wrapCell)(cell, config4.columns[cellIndex].width, config4.columns[cellIndex].wrapWord); - const paddedCellLines = (0, exports.padCellVertically)(cellLines, outputRowHeight, config4.columns[cellIndex].verticalAlignment); + const cellLines = (0, wrapCell_1.wrapCell)(cell, config3.columns[cellIndex].width, config3.columns[cellIndex].wrapWord); + const paddedCellLines = (0, exports.padCellVertically)(cellLines, outputRowHeight, config3.columns[cellIndex].verticalAlignment); paddedCellLines.forEach((cellLine, cellLineIndex) => { outputRow[cellLineIndex][cellIndex] = cellLine; }); @@ -72014,18 +72014,18 @@ var require_padTableData = __commonJS({ return " ".repeat(paddingLeft) + input + " ".repeat(paddingRight); }; exports.padString = padString; - var padTableData = (rows, config4) => { + var padTableData = (rows, config3) => { return rows.map((cells, rowIndex) => { return cells.map((cell, cellIndex) => { var _a2; - const containingRange = (_a2 = config4.spanningCellManager) === null || _a2 === void 0 ? void 0 : _a2.getContainingRange({ + const containingRange = (_a2 = config3.spanningCellManager) === null || _a2 === void 0 ? void 0 : _a2.getContainingRange({ col: cellIndex, row: rowIndex }, { mapped: true }); if (containingRange) { return cell; } - const { paddingLeft, paddingRight } = config4.columns[cellIndex]; + const { paddingLeft, paddingRight } = config3.columns[cellIndex]; return (0, exports.padString)(cell, paddingLeft, paddingRight); }); }); @@ -72087,13 +72087,13 @@ var require_lodash = __commonJS({ var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g"); var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + "]"); var freeParseInt = parseInt; - var freeGlobal2 = typeof global == "object" && global && global.Object === Object && global; - var freeSelf2 = typeof self == "object" && self && self.Object === Object && self; - var root2 = freeGlobal2 || freeSelf2 || Function("return this")(); + var freeGlobal = typeof global == "object" && global && global.Object === Object && global; + var freeSelf = typeof self == "object" && self && self.Object === Object && self; + var root = freeGlobal || freeSelf || Function("return this")(); var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports; var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module; var moduleExports = freeModule && freeModule.exports === freeExports; - var freeProcess = moduleExports && freeGlobal2.process; + var freeProcess = moduleExports && freeGlobal.process; var nodeUtil = (function() { try { return freeProcess && freeProcess.binding("util"); @@ -72102,8 +72102,8 @@ var require_lodash = __commonJS({ })(); var nodeIsRegExp = nodeUtil && nodeUtil.isRegExp; var asciiSize = baseProperty("length"); - function asciiToArray(string7) { - return string7.split(""); + function asciiToArray(string6) { + return string6.split(""); } function baseProperty(key) { return function(object5) { @@ -72115,35 +72115,35 @@ var require_lodash = __commonJS({ return func(value2); }; } - function hasUnicode(string7) { - return reHasUnicode.test(string7); + function hasUnicode(string6) { + return reHasUnicode.test(string6); } - function stringSize(string7) { - return hasUnicode(string7) ? unicodeSize(string7) : asciiSize(string7); + function stringSize(string6) { + return hasUnicode(string6) ? unicodeSize(string6) : asciiSize(string6); } - function stringToArray(string7) { - return hasUnicode(string7) ? unicodeToArray(string7) : asciiToArray(string7); + function stringToArray(string6) { + return hasUnicode(string6) ? unicodeToArray(string6) : asciiToArray(string6); } - function unicodeSize(string7) { + function unicodeSize(string6) { var result = reUnicode.lastIndex = 0; - while (reUnicode.test(string7)) { + while (reUnicode.test(string6)) { result++; } return result; } - function unicodeToArray(string7) { - return string7.match(reUnicode) || []; + function unicodeToArray(string6) { + return string6.match(reUnicode) || []; } - var objectProto6 = Object.prototype; - var objectToString2 = objectProto6.toString; - var Symbol3 = root2.Symbol; - var symbolProto = Symbol3 ? Symbol3.prototype : void 0; + var objectProto = Object.prototype; + var objectToString = objectProto.toString; + var Symbol2 = root.Symbol; + var symbolProto = Symbol2 ? Symbol2.prototype : void 0; var symbolToString = symbolProto ? symbolProto.toString : void 0; function baseIsRegExp(value2) { - return isObject5(value2) && objectToString2.call(value2) == regexpTag; + return isObject4(value2) && objectToString.call(value2) == regexpTag; } - function baseSlice(array4, start, end) { - var index = -1, length = array4.length; + function baseSlice(array3, start, end) { + var index = -1, length = array3.length; if (start < 0) { start = -start > length ? 0 : length + start; } @@ -72155,7 +72155,7 @@ var require_lodash = __commonJS({ start >>>= 0; var result = Array(length); while (++index < length) { - result[index] = array4[index + start]; + result[index] = array3[index + start]; } return result; } @@ -72169,12 +72169,12 @@ var require_lodash = __commonJS({ var result = value2 + ""; return result == "0" && 1 / value2 == -INFINITY2 ? "-0" : result; } - function castSlice(array4, start, end) { - var length = array4.length; + function castSlice(array3, start, end) { + var length = array3.length; end = end === void 0 ? length : end; - return !start && end >= length ? array4 : baseSlice(array4, start, end); + return !start && end >= length ? array3 : baseSlice(array3, start, end); } - function isObject5(value2) { + function isObject4(value2) { var type2 = typeof value2; return !!value2 && (type2 == "object" || type2 == "function"); } @@ -72183,7 +72183,7 @@ var require_lodash = __commonJS({ } var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; function isSymbol(value2) { - return typeof value2 == "symbol" || isObjectLike2(value2) && objectToString2.call(value2) == symbolTag; + return typeof value2 == "symbol" || isObjectLike2(value2) && objectToString.call(value2) == symbolTag; } function toFinite(value2) { if (!value2) { @@ -72207,9 +72207,9 @@ var require_lodash = __commonJS({ if (isSymbol(value2)) { return NAN; } - if (isObject5(value2)) { + if (isObject4(value2)) { var other = typeof value2.valueOf == "function" ? value2.valueOf() : value2; - value2 = isObject5(other) ? other + "" : other; + value2 = isObject4(other) ? other + "" : other; } if (typeof value2 != "string") { return value2 === 0 ? value2 : +value2; @@ -72221,27 +72221,27 @@ var require_lodash = __commonJS({ function toString2(value2) { return value2 == null ? "" : baseToString2(value2); } - function truncate(string7, options) { + function truncate(string6, options) { var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION; - if (isObject5(options)) { + if (isObject4(options)) { var separator2 = "separator" in options ? options.separator : separator2; length = "length" in options ? toInteger(options.length) : length; omission = "omission" in options ? baseToString2(options.omission) : omission; } - string7 = toString2(string7); - var strLength = string7.length; - if (hasUnicode(string7)) { - var strSymbols = stringToArray(string7); + string6 = toString2(string6); + var strLength = string6.length; + if (hasUnicode(string6)) { + var strSymbols = stringToArray(string6); strLength = strSymbols.length; } if (length >= strLength) { - return string7; + return string6; } var end = length - stringSize(omission); if (end < 1) { return omission; } - var result = strSymbols ? castSlice(strSymbols, 0, end).join("") : string7.slice(0, end); + var result = strSymbols ? castSlice(strSymbols, 0, end).join("") : string6.slice(0, end); if (separator2 === void 0) { return result + omission; } @@ -72249,7 +72249,7 @@ var require_lodash = __commonJS({ end += result.length - end; } if (isRegExp(separator2)) { - if (string7.slice(end).search(separator2)) { + if (string6.slice(end).search(separator2)) { var match2, substring = result; if (!separator2.global) { separator2 = RegExp(separator2.source, toString2(reFlags.exec(separator2)) + "g"); @@ -72260,7 +72260,7 @@ var require_lodash = __commonJS({ } result = result.slice(0, newEnd === void 0 ? end : newEnd); } - } else if (string7.indexOf(baseToString2(separator2), end) != end) { + } else if (string6.indexOf(baseToString2(separator2), end) != end) { var index = result.lastIndexOf(separator2); if (index > -1) { result = result.slice(0, index); @@ -72316,60 +72316,60 @@ var require_createStream = __commonJS({ var stringifyTableData_1 = require_stringifyTableData(); var truncateTableData_1 = require_truncateTableData(); var utils_1 = require_utils6(); - var prepareData = (data, config4) => { + var prepareData = (data, config3) => { let rows = (0, stringifyTableData_1.stringifyTableData)(data); - rows = (0, truncateTableData_1.truncateTableData)(rows, (0, utils_1.extractTruncates)(config4)); - const rowHeights = (0, calculateRowHeights_1.calculateRowHeights)(rows, config4); - rows = (0, mapDataUsingRowHeights_1.mapDataUsingRowHeights)(rows, rowHeights, config4); - rows = (0, alignTableData_1.alignTableData)(rows, config4); - rows = (0, padTableData_1.padTableData)(rows, config4); + rows = (0, truncateTableData_1.truncateTableData)(rows, (0, utils_1.extractTruncates)(config3)); + const rowHeights = (0, calculateRowHeights_1.calculateRowHeights)(rows, config3); + rows = (0, mapDataUsingRowHeights_1.mapDataUsingRowHeights)(rows, rowHeights, config3); + rows = (0, alignTableData_1.alignTableData)(rows, config3); + rows = (0, padTableData_1.padTableData)(rows, config3); return rows; }; - var create = (row, columnWidths, config4) => { - const rows = prepareData([row], config4); + var create = (row, columnWidths, config3) => { + const rows = prepareData([row], config3); const body = rows.map((literalRow) => { - return (0, drawRow_1.drawRow)(literalRow, config4); + return (0, drawRow_1.drawRow)(literalRow, config3); }).join(""); let output; output = ""; - output += (0, drawBorder_1.drawBorderTop)(columnWidths, config4); + output += (0, drawBorder_1.drawBorderTop)(columnWidths, config3); output += body; - output += (0, drawBorder_1.drawBorderBottom)(columnWidths, config4); + output += (0, drawBorder_1.drawBorderBottom)(columnWidths, config3); output = output.trimEnd(); process.stdout.write(output); }; - var append3 = (row, columnWidths, config4) => { - const rows = prepareData([row], config4); + var append3 = (row, columnWidths, config3) => { + const rows = prepareData([row], config3); const body = rows.map((literalRow) => { - return (0, drawRow_1.drawRow)(literalRow, config4); + return (0, drawRow_1.drawRow)(literalRow, config3); }).join(""); let output = ""; - const bottom = (0, drawBorder_1.drawBorderBottom)(columnWidths, config4); + const bottom = (0, drawBorder_1.drawBorderBottom)(columnWidths, config3); if (bottom !== "\n") { output = "\r\x1B[K"; } - output += (0, drawBorder_1.drawBorderJoin)(columnWidths, config4); + output += (0, drawBorder_1.drawBorderJoin)(columnWidths, config3); output += body; output += bottom; output = output.trimEnd(); process.stdout.write(output); }; var createStream = (userConfig) => { - const config4 = (0, makeStreamConfig_1.makeStreamConfig)(userConfig); - const columnWidths = Object.values(config4.columns).map((column) => { + const config3 = (0, makeStreamConfig_1.makeStreamConfig)(userConfig); + const columnWidths = Object.values(config3.columns).map((column) => { return column.width + column.paddingLeft + column.paddingRight; }); let empty = true; return { write: (row) => { - if (row.length !== config4.columnCount) { + if (row.length !== config3.columnCount) { throw new Error("Row cell count does not match the config.columnCount."); } if (empty) { empty = false; - create(row, columnWidths, config4); + create(row, columnWidths, config3); } else { - append3(row, columnWidths, config4); + append3(row, columnWidths, config3); } } }; @@ -72384,8 +72384,8 @@ var require_calculateOutputColumnWidths = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.calculateOutputColumnWidths = void 0; - var calculateOutputColumnWidths = (config4) => { - return config4.columns.map((col) => { + var calculateOutputColumnWidths = (config3) => { + return config3.columns.map((col) => { return col.paddingLeft + col.width + col.paddingRight; }); }; @@ -72403,12 +72403,12 @@ var require_drawTable = __commonJS({ var drawContent_1 = require_drawContent(); var drawRow_1 = require_drawRow(); var utils_1 = require_utils6(); - var drawTable = (rows, outputColumnWidths, rowHeights, config4) => { - const { drawHorizontalLine, singleLine } = config4; + var drawTable = (rows, outputColumnWidths, rowHeights, config3) => { + const { drawHorizontalLine, singleLine } = config3; const contents = (0, utils_1.groupBySizes)(rows, rowHeights).map((group2, groupIndex) => { return group2.map((row) => { return (0, drawRow_1.drawRow)(row, { - ...config4, + ...config3, rowIndex: groupIndex }); }).join(""); @@ -72424,10 +72424,10 @@ var require_drawTable = __commonJS({ elementType: "row", rowIndex: -1, separatorGetter: (0, drawBorder_1.createTableBorderGetter)(outputColumnWidths, { - ...config4, + ...config3, rowCount: contents.length }), - spanningCellManager: config4.spanningCellManager + spanningCellManager: config3.spanningCellManager }); }; exports.drawTable = drawTable; @@ -72440,10 +72440,10 @@ var require_injectHeaderConfig = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.injectHeaderConfig = void 0; - var injectHeaderConfig = (rows, config4) => { + var injectHeaderConfig = (rows, config3) => { var _a2; - let spanningCellConfig = (_a2 = config4.spanningCells) !== null && _a2 !== void 0 ? _a2 : []; - const headerConfig = config4.header; + let spanningCellConfig = (_a2 = config3.spanningCells) !== null && _a2 !== void 0 ? _a2 : []; + const headerConfig = config3.header; const adjustedRows = [...rows]; if (headerConfig) { spanningCellConfig = spanningCellConfig.map(({ row, ...rest }) => { @@ -72670,8 +72670,8 @@ var require_spanningCellManager = __commonJS({ }; var createSpanningCellManager = (parameters) => { const { spanningCellConfigs, columnsConfig } = parameters; - const ranges = spanningCellConfigs.map((config4) => { - return (0, makeRangeConfig_1.makeRangeConfig)(config4, columnsConfig); + const ranges = spanningCellConfigs.map((config3) => { + return (0, makeRangeConfig_1.makeRangeConfig)(config3, columnsConfig); }); const rangeCache = {}; let rowHeights = []; @@ -72733,8 +72733,8 @@ var require_validateSpanningCellConfig = __commonJS({ }; var validateSpanningCellConfig = (rows, configs) => { const [nRow, nCol] = [rows.length, rows[0].length]; - configs.forEach((config4, configIndex) => { - const { colSpan, rowSpan } = config4; + configs.forEach((config3, configIndex) => { + const { colSpan, rowSpan } = config3; if (colSpan === void 0 && rowSpan === void 0) { throw new Error(`Expect at least colSpan or rowSpan is provided in config.spanningCells[${configIndex}]`); } @@ -72796,25 +72796,25 @@ var require_makeTableConfig = __commonJS({ }; }); }; - var makeTableConfig = (rows, config4 = {}, injectedSpanningCellConfig) => { + var makeTableConfig = (rows, config3 = {}, injectedSpanningCellConfig) => { var _a2, _b, _c, _d, _e; - (0, validateConfig_1.validateConfig)("config.json", config4); - (0, validateSpanningCellConfig_1.validateSpanningCellConfig)(rows, (_a2 = config4.spanningCells) !== null && _a2 !== void 0 ? _a2 : []); - const spanningCellConfigs = (_b = injectedSpanningCellConfig !== null && injectedSpanningCellConfig !== void 0 ? injectedSpanningCellConfig : config4.spanningCells) !== null && _b !== void 0 ? _b : []; - const columnsConfig = makeColumnsConfig(rows, config4.columns, config4.columnDefault, spanningCellConfigs); - const drawVerticalLine = (_c = config4.drawVerticalLine) !== null && _c !== void 0 ? _c : (() => { + (0, validateConfig_1.validateConfig)("config.json", config3); + (0, validateSpanningCellConfig_1.validateSpanningCellConfig)(rows, (_a2 = config3.spanningCells) !== null && _a2 !== void 0 ? _a2 : []); + const spanningCellConfigs = (_b = injectedSpanningCellConfig !== null && injectedSpanningCellConfig !== void 0 ? injectedSpanningCellConfig : config3.spanningCells) !== null && _b !== void 0 ? _b : []; + const columnsConfig = makeColumnsConfig(rows, config3.columns, config3.columnDefault, spanningCellConfigs); + const drawVerticalLine = (_c = config3.drawVerticalLine) !== null && _c !== void 0 ? _c : (() => { return true; }); - const drawHorizontalLine = (_d = config4.drawHorizontalLine) !== null && _d !== void 0 ? _d : (() => { + const drawHorizontalLine = (_d = config3.drawHorizontalLine) !== null && _d !== void 0 ? _d : (() => { return true; }); return { - ...config4, - border: (0, utils_1.makeBorderConfig)(config4.border), + ...config3, + border: (0, utils_1.makeBorderConfig)(config3.border), columns: columnsConfig, drawHorizontalLine, drawVerticalLine, - singleLine: (_e = config4.singleLine) !== null && _e !== void 0 ? _e : false, + singleLine: (_e = config3.singleLine) !== null && _e !== void 0 ? _e : false, spanningCellManager: (0, spanningCellManager_1.createSpanningCellManager)({ columnsConfig, drawHorizontalLine, @@ -72886,16 +72886,16 @@ var require_table = __commonJS({ (0, validateTableData_1.validateTableData)(data); let rows = (0, stringifyTableData_1.stringifyTableData)(data); const [injectedRows, injectedSpanningCellConfig] = (0, injectHeaderConfig_1.injectHeaderConfig)(rows, userConfig); - const config4 = (0, makeTableConfig_1.makeTableConfig)(injectedRows, userConfig, injectedSpanningCellConfig); - rows = (0, truncateTableData_1.truncateTableData)(injectedRows, (0, utils_1.extractTruncates)(config4)); - const rowHeights = (0, calculateRowHeights_1.calculateRowHeights)(rows, config4); - config4.spanningCellManager.setRowHeights(rowHeights); - config4.spanningCellManager.setRowIndexMapping(rowHeights); - rows = (0, mapDataUsingRowHeights_1.mapDataUsingRowHeights)(rows, rowHeights, config4); - rows = (0, alignTableData_1.alignTableData)(rows, config4); - rows = (0, padTableData_1.padTableData)(rows, config4); - const outputColumnWidths = (0, calculateOutputColumnWidths_1.calculateOutputColumnWidths)(config4); - return (0, drawTable_1.drawTable)(rows, outputColumnWidths, rowHeights, config4); + const config3 = (0, makeTableConfig_1.makeTableConfig)(injectedRows, userConfig, injectedSpanningCellConfig); + rows = (0, truncateTableData_1.truncateTableData)(injectedRows, (0, utils_1.extractTruncates)(config3)); + const rowHeights = (0, calculateRowHeights_1.calculateRowHeights)(rows, config3); + config3.spanningCellManager.setRowHeights(rowHeights); + config3.spanningCellManager.setRowIndexMapping(rowHeights); + rows = (0, mapDataUsingRowHeights_1.mapDataUsingRowHeights)(rows, rowHeights, config3); + rows = (0, alignTableData_1.alignTableData)(rows, config3); + rows = (0, padTableData_1.padTableData)(rows, config3); + const outputColumnWidths = (0, calculateOutputColumnWidths_1.calculateOutputColumnWidths)(config3); + return (0, drawTable_1.drawTable)(rows, outputColumnWidths, rowHeights, config3); }; exports.table = table2; } @@ -73123,8 +73123,8 @@ var require_light = __commonJS({ } else { return returned; } - } catch (error50) { - e2 = error50; + } catch (error49) { + e2 = error49; { this.trigger("error", e2); } @@ -73134,8 +73134,8 @@ var require_light = __commonJS({ return (await Promise.all(promises)).find(function(x) { return x != null; }); - } catch (error50) { - e = error50; + } catch (error49) { + e = error49; { this.trigger("error", e); } @@ -73247,10 +73247,10 @@ var require_light = __commonJS({ _randomIndex() { return Math.random().toString(36).slice(2); } - doDrop({ error: error50, message = "This job has been dropped by Bottleneck" } = {}) { + doDrop({ error: error49, message = "This job has been dropped by Bottleneck" } = {}) { if (this._states.remove(this.options.id)) { if (this.rejectOnDrop) { - this._reject(error50 != null ? error50 : new BottleneckError$1(message)); + this._reject(error49 != null ? error49 : new BottleneckError$1(message)); } this.Events.trigger("dropped", { args: this.args, options: this.options, task: this.task, promise: this.promise }); return true; @@ -73284,7 +73284,7 @@ var require_light = __commonJS({ return this.Events.trigger("scheduled", { args: this.args, options: this.options }); } async doExecute(chained, clearGlobalState, run2, free) { - var error50, eventInfo, passed; + var error49, eventInfo, passed; if (this.retryCount === 0) { this._assertStatus("RUNNING"); this._states.next(this.options.id); @@ -73302,24 +73302,24 @@ var require_light = __commonJS({ return this._resolve(passed); } } catch (error1) { - error50 = error1; - return this._onFailure(error50, eventInfo, clearGlobalState, run2, free); + error49 = error1; + return this._onFailure(error49, eventInfo, clearGlobalState, run2, free); } } doExpire(clearGlobalState, run2, free) { - var error50, eventInfo; + var error49, eventInfo; if (this._states.jobStatus(this.options.id === "RUNNING")) { this._states.next(this.options.id); } this._assertStatus("EXECUTING"); eventInfo = { args: this.args, options: this.options, retryCount: this.retryCount }; - error50 = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`); - return this._onFailure(error50, eventInfo, clearGlobalState, run2, free); + error49 = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`); + return this._onFailure(error49, eventInfo, clearGlobalState, run2, free); } - async _onFailure(error50, eventInfo, clearGlobalState, run2, free) { + async _onFailure(error49, eventInfo, clearGlobalState, run2, free) { var retry2, retryAfter; if (clearGlobalState()) { - retry2 = await this.Events.trigger("failed", error50, eventInfo); + retry2 = await this.Events.trigger("failed", error49, eventInfo); if (retry2 != null) { retryAfter = ~~retry2; this.Events.trigger("retry", `Retrying ${this.options.id} after ${retryAfter} ms`, eventInfo); @@ -73329,7 +73329,7 @@ var require_light = __commonJS({ this.doDone(eventInfo); await free(this.options, eventInfo); this._assertStatus("DONE"); - return this._reject(error50); + return this._reject(error49); } } } @@ -73423,9 +73423,9 @@ var require_light = __commonJS({ await this.yieldLoop(); return this._done; } - async __groupCheck__(time5) { + async __groupCheck__(time4) { await this.yieldLoop(); - return this._nextRequest + this.timeout < time5; + return this._nextRequest + this.timeout < time4; } computeCapacity() { var maxConcurrent, reservoir; @@ -73608,7 +73608,7 @@ var require_light = __commonJS({ return this._queue.length === 0; } async _tryToRun() { - var args3, cb, error50, reject, resolve2, returned, task; + var args3, cb, error49, reject, resolve2, returned, task; if (this._running < 1 && this._queue.length > 0) { this._running++; ({ task, args: args3, resolve: resolve2, reject } = this._queue.shift()); @@ -73619,9 +73619,9 @@ var require_light = __commonJS({ return resolve2(returned); }; } catch (error1) { - error50 = error1; + error49 = error1; return function() { - return reject(error50); + return reject(error49); }; } })(); @@ -73643,12 +73643,12 @@ var require_light = __commonJS({ } }; var Sync_1 = Sync; - var version4 = "2.19.5"; + var version3 = "2.19.5"; var version$1 = { - version: version4 + version: version3 }; var version$2 = /* @__PURE__ */ Object.freeze({ - version: version4, + version: version3, default: version$1 }); var require$$2 = () => console.log("You must import the full version of Bottleneck in order to use this feature."); @@ -73743,20 +73743,20 @@ var require_light = __commonJS({ var base; clearInterval(this.interval); return typeof (base = this.interval = setInterval(async () => { - var e, k, ref, results, time5, v; - time5 = Date.now(); + var e, k, ref, results, time4, v; + time4 = Date.now(); ref = this.instances; results = []; for (k in ref) { v = ref[k]; try { - if (await v._store.__groupCheck__(time5)) { + if (await v._store.__groupCheck__(time4)) { results.push(this.deleteKey(k)); } else { results.push(void 0); } - } catch (error50) { - e = error50; + } catch (error49) { + e = error49; results.push(v.Events.trigger("error", e)); } } @@ -73836,7 +73836,7 @@ var require_light = __commonJS({ var Batcher_1 = Batcher; var require$$4$1 = () => console.log("You must import the full version of Bottleneck in order to use this feature."); var require$$8 = getCjsExportFromNamespace(version$2); - var Bottleneck, DEFAULT_PRIORITY$1, Events$4, Job$1, LocalDatastore$1, NUM_PRIORITIES$1, Queues$1, RedisDatastore$1, States$1, Sync$1, parser$5, splice2 = [].splice; + var Bottleneck, DEFAULT_PRIORITY$1, Events$4, Job$1, LocalDatastore$1, NUM_PRIORITIES$1, Queues$1, RedisDatastore$1, States$1, Sync$1, parser$5, splice = [].splice; NUM_PRIORITIES$1 = 10; DEFAULT_PRIORITY$1 = 5; parser$5 = parser; @@ -74089,14 +74089,14 @@ var require_light = __commonJS({ return done; } async _addToQueue(job) { - var args3, blocked, error50, options, reachedHWM, shifted, strategy; + var args3, blocked, error49, options, reachedHWM, shifted, strategy; ({ args: args3, options } = job); try { ({ reachedHWM, blocked, strategy } = await this._store.__submit__(this.queued(), options.weight)); } catch (error1) { - error50 = error1; - this.Events.trigger("debug", `Could not queue ${options.id}`, { args: args3, options, error: error50 }); - job.doDrop({ error: error50 }); + error49 = error1; + this.Events.trigger("debug", `Could not queue ${options.id}`, { args: args3, options, error: error49 }); + job.doDrop({ error: error49 }); return false; } if (blocked) { @@ -74131,10 +74131,10 @@ var require_light = __commonJS({ submit(...args3) { var cb, fn2, job, options, ref, ref1, task; if (typeof args3[0] === "function") { - ref = args3, [fn2, ...args3] = ref, [cb] = splice2.call(args3, -1); + ref = args3, [fn2, ...args3] = ref, [cb] = splice.call(args3, -1); options = parser$5.load({}, this.jobDefaults); } else { - ref1 = args3, [options, fn2, ...args3] = ref1, [cb] = splice2.call(args3, -1); + ref1 = args3, [options, fn2, ...args3] = ref1, [cb] = splice.call(args3, -1); options = parser$5.load(options, this.jobDefaults); } task = (...args4) => { @@ -74313,7 +74313,7 @@ var require_fast_content_type_parse = __commonJS({ } return result; } - function safeParse6(header) { + function safeParse5(header) { if (typeof header !== "string") { return defaultContentType; } @@ -74351,9 +74351,9 @@ var require_fast_content_type_parse = __commonJS({ } return result; } - module.exports.default = { parse: parse5, safeParse: safeParse6 }; + module.exports.default = { parse: parse5, safeParse: safeParse5 }; module.exports.parse = parse5; - module.exports.safeParse = safeParse6; + module.exports.safeParse = safeParse5; module.exports.defaultContentType = defaultContentType; } }); @@ -74586,11 +74586,11 @@ function makeWebStreamReader(stream) { return new WebStreamDefaultReader(reader); } return new WebStreamByobReader(reader); - } catch (error50) { - if (error50 instanceof TypeError) { + } catch (error49) { + if (error49 instanceof TypeError) { return new WebStreamDefaultReader(stream.getReader()); } - throw error50; + throw error49; } } var init_WebStreamReaderFactory = __esm({ @@ -75251,8 +75251,8 @@ var init_lib2 = __esm({ }); // node_modules/.pnpm/token-types@6.1.1/node_modules/token-types/lib/index.js -function dv(array4) { - return new DataView(array4.buffer, array4.byteOffset); +function dv(array3) { + return new DataView(array3.buffer, array3.byteOffset); } var ieee754, UINT8, UINT16_LE, UINT16_BE, UINT32_LE, UINT32_BE, INT32_BE, UINT64_LE, StringType; var init_lib3 = __esm({ @@ -75261,71 +75261,71 @@ var init_lib3 = __esm({ init_lib2(); UINT8 = { len: 1, - get(array4, offset) { - return dv(array4).getUint8(offset); + get(array3, offset) { + return dv(array3).getUint8(offset); }, - put(array4, offset, value2) { - dv(array4).setUint8(offset, value2); + put(array3, offset, value2) { + dv(array3).setUint8(offset, value2); return offset + 1; } }; UINT16_LE = { len: 2, - get(array4, offset) { - return dv(array4).getUint16(offset, true); + get(array3, offset) { + return dv(array3).getUint16(offset, true); }, - put(array4, offset, value2) { - dv(array4).setUint16(offset, value2, true); + put(array3, offset, value2) { + dv(array3).setUint16(offset, value2, true); return offset + 2; } }; UINT16_BE = { len: 2, - get(array4, offset) { - return dv(array4).getUint16(offset); + get(array3, offset) { + return dv(array3).getUint16(offset); }, - put(array4, offset, value2) { - dv(array4).setUint16(offset, value2); + put(array3, offset, value2) { + dv(array3).setUint16(offset, value2); return offset + 2; } }; UINT32_LE = { len: 4, - get(array4, offset) { - return dv(array4).getUint32(offset, true); + get(array3, offset) { + return dv(array3).getUint32(offset, true); }, - put(array4, offset, value2) { - dv(array4).setUint32(offset, value2, true); + put(array3, offset, value2) { + dv(array3).setUint32(offset, value2, true); return offset + 4; } }; UINT32_BE = { len: 4, - get(array4, offset) { - return dv(array4).getUint32(offset); + get(array3, offset) { + return dv(array3).getUint32(offset); }, - put(array4, offset, value2) { - dv(array4).setUint32(offset, value2); + put(array3, offset, value2) { + dv(array3).setUint32(offset, value2); return offset + 4; } }; INT32_BE = { len: 4, - get(array4, offset) { - return dv(array4).getInt32(offset); + get(array3, offset) { + return dv(array3).getInt32(offset); }, - put(array4, offset, value2) { - dv(array4).setInt32(offset, value2); + put(array3, offset, value2) { + dv(array3).setInt32(offset, value2); return offset + 4; } }; UINT64_LE = { len: 8, - get(array4, offset) { - return dv(array4).getBigUint64(offset, true); + get(array3, offset) { + return dv(array3).getBigUint64(offset, true); }, - put(array4, offset, value2) { - dv(array4).setBigUint64(offset, value2, true); + put(array3, offset, value2) { + dv(array3).setBigUint64(offset, value2, true); return offset + 8; } }; @@ -75527,7 +75527,7 @@ var require_common = __commonJS({ debug2.namespace = namespace; debug2.useColors = createDebug.useColors(); debug2.color = createDebug.selectColor(namespace); - debug2.extend = extend4; + debug2.extend = extend3; debug2.destroy = createDebug.destroy; Object.defineProperty(debug2, "enabled", { enumerable: true, @@ -75551,7 +75551,7 @@ var require_common = __commonJS({ } return debug2; } - function extend4(namespace, delimiter) { + function extend3(namespace, delimiter) { const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); newDebug.log = this.log; return newDebug; @@ -75773,14 +75773,14 @@ var require_browser = __commonJS({ } else { exports.storage.removeItem("debug"); } - } catch (error50) { + } catch (error49) { } } function load() { let r; try { r = exports.storage.getItem("debug") || exports.storage.getItem("DEBUG"); - } catch (error50) { + } catch (error49) { } if (!r && typeof process !== "undefined" && "env" in process) { r = process.env.DEBUG; @@ -75790,7 +75790,7 @@ var require_browser = __commonJS({ function localstorage() { try { return localStorage; - } catch (error50) { + } catch (error49) { } } module.exports = require_common()(exports); @@ -75798,8 +75798,8 @@ var require_browser = __commonJS({ formatters.j = function(v) { try { return JSON.stringify(v); - } catch (error50) { - return "[UnexpectedJSONParseError]: " + error50.message; + } catch (error49) { + return "[UnexpectedJSONParseError]: " + error49.message; } }; } @@ -75809,14 +75809,14 @@ var require_browser = __commonJS({ var require_node = __commonJS({ "node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js"(exports, module) { var tty = __require("tty"); - var util3 = __require("util"); + var util2 = __require("util"); exports.init = init; exports.log = log2; exports.formatArgs = formatArgs2; exports.save = save; exports.load = load; exports.useColors = useColors; - exports.destroy = util3.deprecate( + exports.destroy = util2.deprecate( () => { }, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`." @@ -75904,7 +75904,7 @@ var require_node = __commonJS({ 221 ]; } - } catch (error50) { + } catch (error49) { } exports.inspectOpts = Object.keys(process.env).filter((key) => { return /^debug_/i.test(key); @@ -75947,7 +75947,7 @@ var require_node = __commonJS({ return (/* @__PURE__ */ new Date()).toISOString() + " "; } function log2(...args3) { - return process.stderr.write(util3.formatWithOptions(exports.inspectOpts, ...args3) + "\n"); + return process.stderr.write(util2.formatWithOptions(exports.inspectOpts, ...args3) + "\n"); } function save(namespaces) { if (namespaces) { @@ -75970,11 +75970,11 @@ var require_node = __commonJS({ var { formatters } = module.exports; formatters.o = function(v) { this.inspectOpts.colors = this.useColors; - return util3.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" "); + return util2.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" "); }; formatters.O = function(v) { this.inspectOpts.colors = this.useColors; - return util3.inspect(v, this.inspectOpts); + return util2.inspect(v, this.inspectOpts); }; } }); @@ -76002,61 +76002,61 @@ var init_ZipToken = __esm({ EndOfCentralDirectory: 101010256 }; DataDescriptor = { - get(array4) { + get(array3) { return { - signature: UINT32_LE.get(array4, 0), - compressedSize: UINT32_LE.get(array4, 8), - uncompressedSize: UINT32_LE.get(array4, 12) + signature: UINT32_LE.get(array3, 0), + compressedSize: UINT32_LE.get(array3, 8), + uncompressedSize: UINT32_LE.get(array3, 12) }; }, len: 16 }; LocalFileHeaderToken = { - get(array4) { - const flags = UINT16_LE.get(array4, 6); + get(array3) { + const flags = UINT16_LE.get(array3, 6); return { - signature: UINT32_LE.get(array4, 0), - minVersion: UINT16_LE.get(array4, 4), + signature: UINT32_LE.get(array3, 0), + minVersion: UINT16_LE.get(array3, 4), dataDescriptor: !!(flags & 8), - compressedMethod: UINT16_LE.get(array4, 8), - compressedSize: UINT32_LE.get(array4, 18), - uncompressedSize: UINT32_LE.get(array4, 22), - filenameLength: UINT16_LE.get(array4, 26), - extraFieldLength: UINT16_LE.get(array4, 28), + compressedMethod: UINT16_LE.get(array3, 8), + compressedSize: UINT32_LE.get(array3, 18), + uncompressedSize: UINT32_LE.get(array3, 22), + filenameLength: UINT16_LE.get(array3, 26), + extraFieldLength: UINT16_LE.get(array3, 28), filename: null }; }, len: 30 }; EndOfCentralDirectoryRecordToken = { - get(array4) { + get(array3) { return { - signature: UINT32_LE.get(array4, 0), - nrOfThisDisk: UINT16_LE.get(array4, 4), - nrOfThisDiskWithTheStart: UINT16_LE.get(array4, 6), - nrOfEntriesOnThisDisk: UINT16_LE.get(array4, 8), - nrOfEntriesOfSize: UINT16_LE.get(array4, 10), - sizeOfCd: UINT32_LE.get(array4, 12), - offsetOfStartOfCd: UINT32_LE.get(array4, 16), - zipFileCommentLength: UINT16_LE.get(array4, 20) + signature: UINT32_LE.get(array3, 0), + nrOfThisDisk: UINT16_LE.get(array3, 4), + nrOfThisDiskWithTheStart: UINT16_LE.get(array3, 6), + nrOfEntriesOnThisDisk: UINT16_LE.get(array3, 8), + nrOfEntriesOfSize: UINT16_LE.get(array3, 10), + sizeOfCd: UINT32_LE.get(array3, 12), + offsetOfStartOfCd: UINT32_LE.get(array3, 16), + zipFileCommentLength: UINT16_LE.get(array3, 20) }; }, len: 22 }; FileHeader = { - get(array4) { - const flags = UINT16_LE.get(array4, 8); + get(array3) { + const flags = UINT16_LE.get(array3, 8); return { - signature: UINT32_LE.get(array4, 0), - minVersion: UINT16_LE.get(array4, 6), + signature: UINT32_LE.get(array3, 0), + minVersion: UINT16_LE.get(array3, 6), dataDescriptor: !!(flags & 8), - compressedMethod: UINT16_LE.get(array4, 10), - compressedSize: UINT32_LE.get(array4, 20), - uncompressedSize: UINT32_LE.get(array4, 24), - filenameLength: UINT16_LE.get(array4, 28), - extraFieldLength: UINT16_LE.get(array4, 30), - fileCommentLength: UINT16_LE.get(array4, 32), - relativeOffsetOfLocalHeader: UINT32_LE.get(array4, 42), + compressedMethod: UINT16_LE.get(array3, 10), + compressedSize: UINT32_LE.get(array3, 20), + uncompressedSize: UINT32_LE.get(array3, 24), + filenameLength: UINT16_LE.get(array3, 28), + extraFieldLength: UINT16_LE.get(array3, 30), + fileCommentLength: UINT16_LE.get(array3, 32), + relativeOffsetOfLocalHeader: UINT32_LE.get(array3, 42), filename: null }; }, @@ -76350,24 +76350,24 @@ var init_uint8array_extras = __esm({ }); // node_modules/.pnpm/file-type@21.3.0/node_modules/file-type/util.js -function stringToBytes(string7, encoding) { +function stringToBytes(string6, encoding) { if (encoding === "utf-16le") { const bytes = []; - for (let index = 0; index < string7.length; index++) { - const code = string7.charCodeAt(index); + for (let index = 0; index < string6.length; index++) { + const code = string6.charCodeAt(index); bytes.push(code & 255, code >> 8 & 255); } return bytes; } if (encoding === "utf-16be") { const bytes = []; - for (let index = 0; index < string7.length; index++) { - const code = string7.charCodeAt(index); + for (let index = 0; index < string6.length; index++) { + const code = string6.charCodeAt(index); bytes.push(code >> 8 & 255, code & 255); } return bytes; } - return [...string7].map((character) => character.charCodeAt(0)); + return [...string6].map((character) => character.charCodeAt(0)); } function tarHeaderChecksumMatches(arrayBuffer, offset = 0) { const readSum = Number.parseInt(new StringType(6).get(arrayBuffer, 148).replace(/\0.*$/, "").trim(), 8); @@ -76992,9 +76992,9 @@ var init_core4 = __esm({ if (!done && chunk) { try { detectedFileType = await this.fromBuffer(chunk.subarray(0, sampleSize)); - } catch (error50) { - if (!(error50 instanceof EndOfStreamError)) { - throw error50; + } catch (error49) { + if (!(error49 instanceof EndOfStreamError)) { + throw error49; } detectedFileType = void 0; } @@ -77262,9 +77262,9 @@ var init_core4 = __esm({ } return {}; } - }).catch((error50) => { - if (!(error50 instanceof EndOfStreamError)) { - throw error50; + }).catch((error49) => { + if (!(error49 instanceof EndOfStreamError)) { + throw error49; } }); return fileType ?? { @@ -77670,8 +77670,8 @@ var init_core4 = __esm({ }; } if (this.checkString("AC")) { - const version4 = new StringType(4, "latin1").get(this.buffer, 2); - if (version4.match("^d*") && version4 >= 1e3 && version4 <= 1050) { + const version3 = new StringType(4, "latin1").get(this.buffer, 2); + if (version3.match("^d*") && version3 >= 1e3 && version3 <= 1050) { return { ext: "dwg", mime: "image/vnd.dwg" @@ -77692,8 +77692,8 @@ var init_core4 = __esm({ } if (this.checkString("!")) { await tokenizer.ignore(8); - const string7 = await tokenizer.readToken(new StringType(13, "ascii")); - if (string7 === "debian-binary") { + const string6 = await tokenizer.readToken(new StringType(13, "ascii")); + if (string6 === "debian-binary") { return { ext: "deb", mime: "application/x-deb" @@ -77862,10 +77862,10 @@ var init_core4 = __esm({ } if (this.check([48, 38, 178, 117, 142, 102, 207, 17, 166, 217])) { async function readHeader() { - const guid5 = new Uint8Array(16); - await tokenizer.readBuffer(guid5); + const guid4 = new Uint8Array(16); + await tokenizer.readBuffer(guid4); return { - id: guid5, + id: guid4, size: Number(await tokenizer.readToken(UINT64_LE)) }; } @@ -78207,9 +78207,9 @@ var init_core4 = __esm({ } } async readTiffHeader(bigEndian) { - const version4 = (bigEndian ? UINT16_BE : UINT16_LE).get(this.buffer, 2); + const version3 = (bigEndian ? UINT16_BE : UINT16_LE).get(this.buffer, 2); const ifdOffset = (bigEndian ? UINT32_BE : UINT32_LE).get(this.buffer, 4); - if (version4 === 42) { + if (version3 === 42) { if (ifdOffset >= 6) { if (this.checkString("CR", { offset: 8 })) { return { @@ -78235,7 +78235,7 @@ var init_core4 = __esm({ mime: "image/tiff" }; } - if (version4 === 43) { + if (version3 === 43) { return { ext: "tif", mime: "image/tiff" @@ -78581,7 +78581,7 @@ var require_config = __commonJS({ }); // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/utils.js -var require_utils8 = __commonJS({ +var require_utils7 = __commonJS({ "node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/utils.js"(exports) { "use strict"; var DOMException2 = require_DOMException(); @@ -78701,7 +78701,7 @@ var require_EventTarget = __commonJS({ "use strict"; var Event2 = require_Event(); var MouseEvent = require_MouseEvent(); - var utils = require_utils8(); + var utils = require_utils7(); module.exports = EventTarget2; function EventTarget2() { } @@ -78945,7 +78945,7 @@ var require_EventTarget = __commonJS({ var require_LinkedList = __commonJS({ "node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/LinkedList.js"(exports, module) { "use strict"; - var utils = require_utils8(); + var utils = require_utils7(); var LinkedList = module.exports = { // basic validity tests on a circular linked list a valid: function(a) { @@ -79014,7 +79014,7 @@ var require_NodeUtils = __commonJS({ \u0275escapeClosingCommentTag: escapeClosingCommentTag, \u0275escapeProcessingInstructionContent: escapeProcessingInstructionContent }; - var utils = require_utils8(); + var utils = require_utils7(); var NAMESPACE = utils.NAMESPACE; var hasRawContent = { STYLE: true, @@ -79199,7 +79199,7 @@ var require_Node = __commonJS({ var EventTarget2 = require_EventTarget(); var LinkedList = require_LinkedList(); var NodeUtils = require_NodeUtils(); - var utils = require_utils8(); + var utils = require_utils7(); function Node() { EventTarget2.call(this); this.parentNode = null; @@ -79475,13 +79475,13 @@ var require_Node = __commonJS({ // This method delegates shallow cloning to a clone() method // that each concrete subclass must implement cloneNode: { value: function(deep) { - var clone4 = this.clone(); + var clone3 = this.clone(); if (deep) { for (var kid = this.firstChild; kid !== null; kid = kid.nextSibling) { - clone4._appendChild(kid.cloneNode(true)); + clone3._appendChild(kid.cloneNode(true)); } } - return clone4; + return clone3; } }, lookupPrefix: { value: function lookupPrefix(ns) { var e; @@ -79695,10 +79695,10 @@ var require_Node = __commonJS({ // _lastModTime property. modify: { value: function() { if (this.doc.modclock) { - var time5 = ++this.doc.modclock; + var time4 = ++this.doc.modclock; for (var n = this; n; n = n.parentElement) { if (n._lastModTime) { - n._lastModTime = time5; + n._lastModTime = time4; } } } @@ -79894,11 +79894,11 @@ var require_ContainerNode = __commonJS({ // Remove all of this node's children. This is a minor // optimization that only calls modify() once. removeChildren: { value: function removeChildren() { - var root2 = this.rooted ? this.ownerDocument : null, next2 = this.firstChild, kid; + var root = this.rooted ? this.ownerDocument : null, next2 = this.firstChild, kid; while (next2 !== null) { kid = next2; next2 = kid.nextSibling; - if (root2) root2.mutateRemove(kid); + if (root) root.mutateRemove(kid); kid.parentNode = null; } if (this._childNodes) { @@ -79960,7 +79960,7 @@ var require_xmlnames = __commonJS({ var require_attributes = __commonJS({ "node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/attributes.js"(exports) { "use strict"; - var utils = require_utils8(); + var utils = require_utils7(); exports.property = function(attr) { if (Array.isArray(attr.type)) { var valid = /* @__PURE__ */ Object.create(null); @@ -80094,10 +80094,10 @@ var require_FilteredElementList = __commonJS({ "use strict"; module.exports = FilteredElementList; var Node = require_Node(); - function FilteredElementList(root2, filter) { - this.root = root2; + function FilteredElementList(root, filter) { + this.root = root; this.filter = filter; - this.lastModTime = root2.lastModTime; + this.lastModTime = root.lastModTime; this.done = false; this.cache = []; this.traverse(); @@ -80164,7 +80164,7 @@ var require_FilteredElementList = __commonJS({ var require_DOMTokenList = __commonJS({ "node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/DOMTokenList.js"(exports, module) { "use strict"; - var utils = require_utils8(); + var utils = require_utils7(); module.exports = DOMTokenList; function DOMTokenList(getter, setter) { this._getString = getter; @@ -81193,7 +81193,7 @@ var require_NamedNodeMap = __commonJS({ "node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/NamedNodeMap.js"(exports, module) { "use strict"; module.exports = NamedNodeMap; - var utils = require_utils8(); + var utils = require_utils7(); function NamedNodeMap(element) { this.element = element; } @@ -81234,7 +81234,7 @@ var require_Element = __commonJS({ "use strict"; module.exports = Element; var xml = require_xmlnames(); - var utils = require_utils8(); + var utils = require_utils7(); var NAMESPACE = utils.NAMESPACE; var attributes = require_attributes(); var Node = require_Node(); @@ -81453,15 +81453,15 @@ var require_Element = __commonJS({ // // This is not a DOM method, but is convenient for // lazy traversals of the tree. - nextElement: { value: function(root2) { - if (!root2) root2 = this.ownerDocument.documentElement; + nextElement: { value: function(root) { + if (!root) root = this.ownerDocument.documentElement; var next2 = this.firstElementChild; if (!next2) { - if (this === root2) return null; + if (this === root) return null; next2 = this.nextElementSibling; } if (next2) return next2; - for (var parent = this.parentElement; parent && parent !== root2; parent = parent.parentElement) { + for (var parent = this.parentElement; parent && parent !== root; parent = parent.parentElement) { next2 = parent.nextElementSibling; if (next2) return next2; } @@ -81511,7 +81511,7 @@ var require_Element = __commonJS({ return new FilteredElementList(this, elementNameFilter(String(name))); } }, // Utility methods used by the public API methods above - clone: { value: function clone4() { + clone: { value: function clone3() { var e; if (this.namespaceURI !== NAMESPACE.HTML || this.prefix || !this.ownerDocument.isHTML) { e = this.ownerDocument.createElementNS( @@ -82271,7 +82271,7 @@ var require_Leaf = __commonJS({ module.exports = Leaf; var Node = require_Node(); var NodeList = require_NodeList(); - var utils = require_utils8(); + var utils = require_utils7(); var HierarchyRequestError = utils.HierarchyRequestError; var NotFoundError = utils.NotFoundError; function Leaf() { @@ -82311,7 +82311,7 @@ var require_CharacterData = __commonJS({ "use strict"; module.exports = CharacterData; var Leaf = require_Leaf(); - var utils = require_utils8(); + var utils = require_utils7(); var ChildNode = require_ChildNode(); var NonDocumentTypeChildNode = require_NonDocumentTypeChildNode(); function CharacterData() { @@ -82421,7 +82421,7 @@ var require_Text = __commonJS({ "node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/Text.js"(exports, module) { "use strict"; module.exports = Text; - var utils = require_utils8(); + var utils = require_utils7(); var Node = require_Node(); var CharacterData = require_CharacterData(); function Text(doc, data) { @@ -82485,7 +82485,7 @@ var require_Text = __commonJS({ // Obsolete, removed from spec. replaceWholeText: { value: utils.nyi }, // Utility methods - clone: { value: function clone4() { + clone: { value: function clone3() { return new Text(this.ownerDocument, this._data); } } }); @@ -82532,7 +82532,7 @@ var require_Comment = __commonJS({ } }, // Utility methods - clone: { value: function clone4() { + clone: { value: function clone3() { return new Comment2(this.ownerDocument, this._data); } } }); @@ -82549,7 +82549,7 @@ var require_DocumentFragment = __commonJS({ var ContainerNode = require_ContainerNode(); var Element = require_Element(); var select = require_select(); - var utils = require_utils8(); + var utils = require_utils7(); function DocumentFragment(doc) { ContainerNode.call(this); this.nodeType = Node.DOCUMENT_FRAGMENT_NODE; @@ -82581,7 +82581,7 @@ var require_DocumentFragment = __commonJS({ return nodes.item ? nodes : new NodeList(nodes); } }, // Utility methods - clone: { value: function clone4() { + clone: { value: function clone3() { return new DocumentFragment(this.ownerDocument); } }, isEqual: { value: function isEqual(n) { @@ -82646,7 +82646,7 @@ var require_ProcessingInstruction = __commonJS({ } }, // Utility methods - clone: { value: function clone4() { + clone: { value: function clone3() { return new ProcessingInstruction(this.ownerDocument, this.target, this._data); } }, isEqual: { value: function isEqual(n) { @@ -82764,7 +82764,7 @@ var require_TreeWalker = __commonJS({ var Node = require_Node(); var NodeFilter = require_NodeFilter(); var NodeTraversal = require_NodeTraversal(); - var utils = require_utils8(); + var utils = require_utils7(); var mapChild = { first: "firstChild", last: "lastChild", @@ -82838,15 +82838,15 @@ var require_TreeWalker = __commonJS({ } } } - function TreeWalker(root2, whatToShow, filter) { - if (!root2 || !root2.nodeType) { + function TreeWalker(root, whatToShow, filter) { + if (!root || !root.nodeType) { utils.NotSupportedError(); } - this._root = root2; + this._root = root; this._whatToShow = Number(whatToShow) || 0; this._filter = filter || null; this._active = false; - this._currentNode = root2; + this._currentNode = root; } Object.defineProperties(TreeWalker.prototype, { root: { get: function() { @@ -83044,7 +83044,7 @@ var require_NodeIterator = __commonJS({ module.exports = NodeIterator; var NodeFilter = require_NodeFilter(); var NodeTraversal = require_NodeTraversal(); - var utils = require_utils8(); + var utils = require_utils7(); function move(node2, stayWithin, directionIsNext) { if (directionIsNext) { return NodeTraversal.next(node2, stayWithin); @@ -83085,20 +83085,20 @@ var require_NodeIterator = __commonJS({ ni._pointerBeforeReferenceNode = beforeNode; return node2; } - function NodeIterator(root2, whatToShow, filter) { - if (!root2 || !root2.nodeType) { + function NodeIterator(root, whatToShow, filter) { + if (!root || !root.nodeType) { utils.NotSupportedError(); } - this._root = root2; - this._referenceNode = root2; + this._root = root; + this._referenceNode = root; this._pointerBeforeReferenceNode = true; this._whatToShow = Number(whatToShow) || 0; this._filter = filter || null; this._active = false; - root2.doc._attachNodeIterator(this); + root.doc._attachNodeIterator(this); } Object.defineProperties(NodeIterator.prototype, { - root: { get: function root2() { + root: { get: function root() { return this._root; } }, referenceNode: { get: function referenceNode() { @@ -83322,7 +83322,7 @@ var require_URL = __commonJS({ if (r.path.charAt(0) === "/") { t.path = remove_dot_segments(r.path); } else { - t.path = merge5(base.path, r.path); + t.path = merge4(base.path, r.path); t.path = remove_dot_segments(t.path); } t.query = r.query; @@ -83331,7 +83331,7 @@ var require_URL = __commonJS({ } t.fragment = r.fragment; return t.toString(); - function merge5(basepath, refpath) { + function merge4(basepath, refpath) { if (base.host !== void 0 && !base.path) return "/" + refpath; var lastslash = basepath.lastIndexOf("/"); @@ -83340,32 +83340,32 @@ var require_URL = __commonJS({ else return basepath.substring(0, lastslash + 1) + refpath; } - function remove_dot_segments(path4) { - if (!path4) return path4; + function remove_dot_segments(path3) { + if (!path3) return path3; var output = ""; - while (path4.length > 0) { - if (path4 === "." || path4 === "..") { - path4 = ""; + while (path3.length > 0) { + if (path3 === "." || path3 === "..") { + path3 = ""; break; } - var twochars = path4.substring(0, 2); - var threechars = path4.substring(0, 3); - var fourchars = path4.substring(0, 4); + var twochars = path3.substring(0, 2); + var threechars = path3.substring(0, 3); + var fourchars = path3.substring(0, 4); if (threechars === "../") { - path4 = path4.substring(3); + path3 = path3.substring(3); } else if (twochars === "./") { - path4 = path4.substring(2); + path3 = path3.substring(2); } else if (threechars === "/./") { - path4 = "/" + path4.substring(3); - } else if (twochars === "/." && path4.length === 2) { - path4 = "/"; - } else if (fourchars === "/../" || threechars === "/.." && path4.length === 3) { - path4 = "/" + path4.substring(4); + path3 = "/" + path3.substring(3); + } else if (twochars === "/." && path3.length === 2) { + path3 = "/"; + } else if (fourchars === "/../" || threechars === "/.." && path3.length === 3) { + path3 = "/" + path3.substring(4); output = output.replace(/\/?[^\/]*$/, ""); } else { - var segment = path4.match(/(\/?([^\/]*))/)[0]; + var segment = path3.match(/(\/?([^\/]*))/)[0]; output += segment; - path4 = path4.substring(segment.length); + path3 = path3.substring(segment.length); } } return output; @@ -83975,7 +83975,7 @@ var require_htmlelts = __commonJS({ var Node = require_Node(); var Element = require_Element(); var CSSStyleDeclaration = require_CSSStyleDeclaration(); - var utils = require_utils8(); + var utils = require_utils7(); var URLUtils = require_URLUtils(); var defineElement = require_defineElement(); var htmlElements = exports.elements = {}; @@ -85529,7 +85529,7 @@ var require_svg = __commonJS({ "use strict"; var Element = require_Element(); var defineElement = require_defineElement(); - var utils = require_utils8(); + var utils = require_utils7(); var CSSStyleDeclaration = require_CSSStyleDeclaration(); var svgElements = exports.elements = {}; var svgNameToImpl = /* @__PURE__ */ Object.create(null); @@ -85697,7 +85697,7 @@ var require_Document = __commonJS({ var xml = require_xmlnames(); var html = require_htmlelts(); var svg = require_svg(); - var utils = require_utils8(); + var utils = require_utils7(); var MUTATE = require_MutationConstants(); var NAMESPACE = utils.NAMESPACE; var isApiWritable = require_config().isApiWritable; @@ -85879,28 +85879,28 @@ var require_Document = __commonJS({ } } }, // See: http://www.w3.org/TR/dom/#dom-document-createtreewalker - createTreeWalker: { value: function(root3, whatToShow, filter) { - if (!root3) { + createTreeWalker: { value: function(root2, whatToShow, filter) { + if (!root2) { throw new TypeError("root argument is required"); } - if (!(root3 instanceof Node)) { + if (!(root2 instanceof Node)) { throw new TypeError("root not a node"); } whatToShow = whatToShow === void 0 ? NodeFilter.SHOW_ALL : +whatToShow; filter = filter === void 0 ? null : filter; - return new TreeWalker(root3, whatToShow, filter); + return new TreeWalker(root2, whatToShow, filter); } }, // See: http://www.w3.org/TR/dom/#dom-document-createnodeiterator - createNodeIterator: { value: function(root3, whatToShow, filter) { - if (!root3) { + createNodeIterator: { value: function(root2, whatToShow, filter) { + if (!root2) { throw new TypeError("root argument is required"); } - if (!(root3 instanceof Node)) { + if (!(root2 instanceof Node)) { throw new TypeError("root not a node"); } whatToShow = whatToShow === void 0 ? NodeFilter.SHOW_ALL : +whatToShow; filter = filter === void 0 ? null : filter; - return new NodeIterator(root3, whatToShow, filter); + return new NodeIterator(root2, whatToShow, filter); } }, _attachNodeIterator: { value: function(ni) { if (!this._nodeIterators) { @@ -86118,7 +86118,7 @@ var require_Document = __commonJS({ } } }, // Utility methods - clone: { value: function clone4() { + clone: { value: function clone3() { var d = new Document(this.isHTML, this._address); d._quirks = this._quirks; d._contentType = this._contentType; @@ -86126,14 +86126,14 @@ var require_Document = __commonJS({ } }, // We need to adopt the nodes if we do a deep clone cloneNode: { value: function cloneNode(deep) { - var clone4 = Node.prototype.cloneNode.call(this, false); + var clone3 = Node.prototype.cloneNode.call(this, false); if (deep) { for (var kid = this.firstChild; kid !== null; kid = kid.nextSibling) { - clone4._appendChild(clone4.importNode(kid, true)); + clone3._appendChild(clone3.importNode(kid, true)); } } - clone4._updateDocTypeElement(); - return clone4; + clone3._updateDocTypeElement(); + return clone3; } }, isEqual: { value: function isEqual(n) { return true; @@ -86336,7 +86336,7 @@ var require_Document = __commonJS({ } return null; } - function root2(n) { + function root(n) { n._nid = n.ownerDocument._nextnid++; n.ownerDocument._nodes[n._nid] = n; if (n.nodeType === Node.ELEMENT_NODE) { @@ -86354,7 +86354,7 @@ var require_Document = __commonJS({ n._nid = void 0; } function recursivelyRoot(node2) { - root2(node2); + root(node2); if (node2.nodeType === Node.ELEMENT_NODE) { for (var kid = node2.firstChild; kid !== null; kid = kid.nextSibling) recursivelyRoot(kid); @@ -86445,7 +86445,7 @@ var require_DocumentType = __commonJS({ } }, // Utility methods - clone: { value: function clone4() { + clone: { value: function clone3() { return new DocumentType(this.ownerDocument, this.name, this.publicId, this.systemId); } }, isEqual: { value: function isEqual(n) { @@ -86464,7 +86464,7 @@ var require_HTMLParser = __commonJS({ var Document = require_Document(); var DocumentType = require_DocumentType(); var Node = require_Node(); - var NAMESPACE = require_utils8().NAMESPACE; + var NAMESPACE = require_utils7().NAMESPACE; var html = require_htmlelts(); var impl = html.elements; var pushAll = Function.prototype.apply.bind(Array.prototype.push); @@ -89461,9 +89461,9 @@ var require_HTMLParser = __commonJS({ // as it removes the nodes from `doc` to add them to fragment. _asDocumentFragment: function() { var frag = doc.createDocumentFragment(); - var root3 = doc.firstChild; - while (root3.hasChildNodes()) { - frag.appendChild(root3.firstChild); + var root2 = doc.firstChild; + while (root2.hasChildNodes()) { + frag.appendChild(root2.firstChild); } return frag; }, @@ -89556,9 +89556,9 @@ var require_HTMLParser = __commonJS({ break; } } - var root2 = doc.createElement("html"); - doc._appendChild(root2); - stack.push(root2); + var root = doc.createElement("html"); + doc._appendChild(root); + stack.push(root); if (fragmentContext instanceof impl.HTMLTemplateElement) { templateInsertionModes.push(in_template_mode); } @@ -94626,7 +94626,7 @@ var require_DOMImplementation = __commonJS({ var Document = require_Document(); var DocumentType = require_DocumentType(); var HTMLParser = require_HTMLParser(); - var utils = require_utils8(); + var utils = require_utils7(); var xml = require_xmlnames(); function DOMImplementation(contextObject) { this.contextObject = contextObject; @@ -94642,9 +94642,9 @@ var require_DOMImplementation = __commonJS({ // HTML }; DOMImplementation.prototype = { - hasFeature: function hasFeature(feature, version4) { + hasFeature: function hasFeature(feature, version3) { var f = supportedFeatures[(feature || "").toLowerCase()]; - return f && f[version4 || ""] || false; + return f && f[version3 || ""] || false; }, createDocumentType: function createDocumentType(qualifiedName, publicId, systemId) { if (!xml.isValidQName(qualifiedName)) utils.InvalidCharacterError(); @@ -94777,7 +94777,7 @@ var require_WindowTimers = __commonJS({ var require_impl = __commonJS({ "node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/impl.js"(exports, module) { "use strict"; - var utils = require_utils8(); + var utils = require_utils7(); exports = module.exports = { CSSStyleDeclaration: require_CSSStyleDeclaration(), CharacterData: require_CharacterData(), @@ -94811,7 +94811,7 @@ var require_Window = __commonJS({ var DOMImplementation = require_DOMImplementation(); var EventTarget2 = require_EventTarget(); var Location = require_Location(); - var utils = require_utils8(); + var utils = require_utils7(); module.exports = Window; function Window(document2) { this.document = document2 || new DOMImplementation(null).createHTMLDocument(""); @@ -94959,7 +94959,7 @@ var require_lib3 = __commonJS({ var require_turndown_cjs = __commonJS({ "node_modules/.pnpm/turndown@7.2.2/node_modules/turndown/lib/turndown.cjs.js"(exports, module) { "use strict"; - function extend4(destination) { + function extend3(destination) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { @@ -94971,16 +94971,16 @@ var require_turndown_cjs = __commonJS({ function repeat(character, count) { return Array(count + 1).join(character); } - function trimLeadingNewlines(string7) { - return string7.replace(/^\n*/, ""); + function trimLeadingNewlines(string6) { + return string6.replace(/^\n*/, ""); } - function trimTrailingNewlines(string7) { - var indexEnd = string7.length; - while (indexEnd > 0 && string7[indexEnd - 1] === "\n") indexEnd--; - return string7.substring(0, indexEnd); + function trimTrailingNewlines(string6) { + var indexEnd = string6.length; + while (indexEnd > 0 && string6[indexEnd - 1] === "\n") indexEnd--; + return string6.substring(0, indexEnd); } - function trimNewlines(string7) { - return trimTrailingNewlines(trimLeadingNewlines(string7)); + function trimNewlines(string6) { + return trimTrailingNewlines(trimLeadingNewlines(string6)); } var blockElements = [ "ADDRESS", @@ -95399,9 +95399,9 @@ var require_turndown_cjs = __commonJS({ } return current.firstChild || current.nextSibling || current.parentNode; } - var root2 = typeof window !== "undefined" ? window : {}; + var root = typeof window !== "undefined" ? window : {}; function canParseHTMLNatively() { - var Parser = root2.DOMParser; + var Parser = root.DOMParser; var canParse = false; try { if (new Parser().parseFromString("", "text/html")) { @@ -95416,15 +95416,15 @@ var require_turndown_cjs = __commonJS({ }; { var domino = require_lib3(); - Parser.prototype.parseFromString = function(string7) { - return domino.createDocument(string7); + Parser.prototype.parseFromString = function(string6) { + return domino.createDocument(string6); }; } return Parser; } - var HTMLParser = canParseHTMLNatively() ? root2.DOMParser : createHTMLParser(); + var HTMLParser = canParseHTMLNatively() ? root.DOMParser : createHTMLParser(); function RootNode(input, options) { - var root3; + var root2; if (typeof input === "string") { var doc = htmlParser().parseFromString( // DOM parsers arrange elements in the and . @@ -95433,17 +95433,17 @@ var require_turndown_cjs = __commonJS({ '' + input + "", "text/html" ); - root3 = doc.getElementById("turndown-root"); + root2 = doc.getElementById("turndown-root"); } else { - root3 = input.cloneNode(true); + root2 = input.cloneNode(true); } collapseWhitespace({ - element: root3, + element: root2, isBlock, isVoid, isPre: options.preformattedCode ? isPreOrCode : null }); - return root3; + return root2; } var _htmlParser; function htmlParser() { @@ -95476,8 +95476,8 @@ var require_turndown_cjs = __commonJS({ } return { leading: edges.leading, trailing: edges.trailing }; } - function edgeWhitespace(string7) { - var m = string7.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/); + function edgeWhitespace(string6) { + var m = string6.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/); return { leading: m[1], // whole string for whitespace-only strings @@ -95552,7 +95552,7 @@ var require_turndown_cjs = __commonJS({ return node2.isBlock ? "\n\n" + content + "\n\n" : content; } }; - this.options = extend4({}, defaults, options); + this.options = extend3({}, defaults, options); this.rules = new Rules(this.options); } TurndownService2.prototype = { @@ -95631,10 +95631,10 @@ var require_turndown_cjs = __commonJS({ * @returns A string with Markdown syntax escaped * @type String */ - escape: function(string7) { + escape: function(string6) { return escapes.reduce(function(accumulator, escape2) { return accumulator.replace(escape2[0], escape2[1]); - }, string7); + }, string6); } }; function process5(parentNode) { @@ -95864,31 +95864,31 @@ var require_semver = __commonJS({ var parseOptions = require_parse_options(); var { compareIdentifiers } = require_identifiers(); var SemVer = class _SemVer { - constructor(version4, options) { + constructor(version3, options) { options = parseOptions(options); - if (version4 instanceof _SemVer) { - if (version4.loose === !!options.loose && version4.includePrerelease === !!options.includePrerelease) { - return version4; + if (version3 instanceof _SemVer) { + if (version3.loose === !!options.loose && version3.includePrerelease === !!options.includePrerelease) { + return version3; } else { - version4 = version4.version; + version3 = version3.version; } - } else if (typeof version4 !== "string") { - throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version4}".`); + } else if (typeof version3 !== "string") { + throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version3}".`); } - if (version4.length > MAX_LENGTH) { + if (version3.length > MAX_LENGTH) { throw new TypeError( `version is longer than ${MAX_LENGTH} characters` ); } - debug2("SemVer", version4, options); + debug2("SemVer", version3, options); this.options = options; this.loose = !!options.loose; this.includePrerelease = !!options.includePrerelease; - const m = version4.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]); + const m = version3.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]); if (!m) { - throw new TypeError(`Invalid Version: ${version4}`); + throw new TypeError(`Invalid Version: ${version3}`); } - this.raw = version4; + this.raw = version3; this.major = +m[1]; this.minor = +m[2]; this.patch = +m[3]; @@ -96138,12 +96138,12 @@ var require_parse3 = __commonJS({ "node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/parse.js"(exports, module) { "use strict"; var SemVer = require_semver(); - var parse5 = (version4, options, throwErrors = false) => { - if (version4 instanceof SemVer) { - return version4; + var parse5 = (version3, options, throwErrors = false) => { + if (version3 instanceof SemVer) { + return version3; } try { - return new SemVer(version4, options); + return new SemVer(version3, options); } catch (er) { if (!throwErrors) { return null; @@ -96160,8 +96160,8 @@ var require_valid = __commonJS({ "node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/valid.js"(exports, module) { "use strict"; var parse5 = require_parse3(); - var valid = (version4, options) => { - const v = parse5(version4, options); + var valid = (version3, options) => { + const v = parse5(version3, options); return v ? v.version : null; }; module.exports = valid; @@ -96173,8 +96173,8 @@ var require_clean = __commonJS({ "node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/clean.js"(exports, module) { "use strict"; var parse5 = require_parse3(); - var clean = (version4, options) => { - const s = parse5(version4.trim().replace(/^[=v]+/, ""), options); + var clean = (version3, options) => { + const s = parse5(version3.trim().replace(/^[=v]+/, ""), options); return s ? s.version : null; }; module.exports = clean; @@ -96186,7 +96186,7 @@ var require_inc = __commonJS({ "node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/inc.js"(exports, module) { "use strict"; var SemVer = require_semver(); - var inc = (version4, release, options, identifier, identifierBase) => { + var inc = (version3, release, options, identifier, identifierBase) => { if (typeof options === "string") { identifierBase = identifier; identifier = options; @@ -96194,7 +96194,7 @@ var require_inc = __commonJS({ } try { return new SemVer( - version4 instanceof SemVer ? version4.version : version4, + version3 instanceof SemVer ? version3.version : version3, options ).inc(release, identifier, identifierBase).version; } catch (er) { @@ -96284,8 +96284,8 @@ var require_prerelease = __commonJS({ "node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/prerelease.js"(exports, module) { "use strict"; var parse5 = require_parse3(); - var prerelease = (version4, options) => { - const parsed2 = parse5(version4, options); + var prerelease = (version3, options) => { + const parsed2 = parse5(version3, options); return parsed2 && parsed2.prerelease.length ? parsed2.prerelease : null; }; module.exports = prerelease; @@ -96381,8 +96381,8 @@ var require_eq = __commonJS({ "node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/eq.js"(exports, module) { "use strict"; var compare = require_compare(); - var eq2 = (a, b, loose) => compare(a, b, loose) === 0; - module.exports = eq2; + var eq = (a, b, loose) => compare(a, b, loose) === 0; + module.exports = eq; } }); @@ -96420,7 +96420,7 @@ var require_lte = __commonJS({ var require_cmp = __commonJS({ "node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/cmp.js"(exports, module) { "use strict"; - var eq2 = require_eq(); + var eq = require_eq(); var neq = require_neq(); var gt = require_gt(); var gte = require_gte(); @@ -96447,7 +96447,7 @@ var require_cmp = __commonJS({ case "": case "=": case "==": - return eq2(a, b, loose); + return eq(a, b, loose); case "!=": return neq(a, b, loose); case ">": @@ -96473,24 +96473,24 @@ var require_coerce = __commonJS({ var SemVer = require_semver(); var parse5 = require_parse3(); var { safeRe: re, t } = require_re(); - var coerce = (version4, options) => { - if (version4 instanceof SemVer) { - return version4; + var coerce = (version3, options) => { + if (version3 instanceof SemVer) { + return version3; } - if (typeof version4 === "number") { - version4 = String(version4); + if (typeof version3 === "number") { + version3 = String(version3); } - if (typeof version4 !== "string") { + if (typeof version3 !== "string") { return null; } options = options || {}; let match2 = null; if (!options.rtl) { - match2 = version4.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]); + match2 = version3.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]); } else { const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL]; let next2; - while ((next2 = coerceRtlRegex.exec(version4)) && (!match2 || match2.index + match2[0].length !== version4.length)) { + while ((next2 = coerceRtlRegex.exec(version3)) && (!match2 || match2.index + match2[0].length !== version3.length)) { if (!match2 || next2.index + next2[0].length !== match2.index + match2[0].length) { match2 = next2; } @@ -96622,9 +96622,9 @@ var require_range = __commonJS({ parseRange(range2) { const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE); const memoKey = memoOpts + ":" + range2; - const cached6 = cache.get(memoKey); - if (cached6) { - return cached6; + const cached5 = cache.get(memoKey); + if (cached5) { + return cached5; } const loose = this.options.loose; const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]; @@ -96674,19 +96674,19 @@ var require_range = __commonJS({ }); } // if ANY of the sets match ALL of its comparators, then pass - test(version4) { - if (!version4) { + test(version3) { + if (!version3) { return false; } - if (typeof version4 === "string") { + if (typeof version3 === "string") { try { - version4 = new SemVer(version4, this.options); + version3 = new SemVer(version3, this.options); } catch (er) { return false; } } for (let i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version4, this.options)) { + if (testSet(this.set[i], version3, this.options)) { return true; } } @@ -96901,13 +96901,13 @@ var require_range = __commonJS({ } return `${from} ${to}`.trim(); }; - var testSet = (set2, version4, options) => { + var testSet = (set2, version3, options) => { for (let i = 0; i < set2.length; i++) { - if (!set2[i].test(version4)) { + if (!set2[i].test(version3)) { return false; } } - if (version4.prerelease.length && !options.includePrerelease) { + if (version3.prerelease.length && !options.includePrerelease) { for (let i = 0; i < set2.length; i++) { debug2(set2[i].semver); if (set2[i].semver === Comparator.ANY) { @@ -96915,7 +96915,7 @@ var require_range = __commonJS({ } if (set2[i].semver.prerelease.length > 0) { const allowed = set2[i].semver; - if (allowed.major === version4.major && allowed.minor === version4.minor && allowed.patch === version4.patch) { + if (allowed.major === version3.major && allowed.minor === version3.minor && allowed.patch === version3.patch) { return true; } } @@ -96976,19 +96976,19 @@ var require_comparator = __commonJS({ toString() { return this.value; } - test(version4) { - debug2("Comparator.test", version4, this.options.loose); - if (this.semver === ANY || version4 === ANY) { + test(version3) { + debug2("Comparator.test", version3, this.options.loose); + if (this.semver === ANY || version3 === ANY) { return true; } - if (typeof version4 === "string") { + if (typeof version3 === "string") { try { - version4 = new SemVer(version4, this.options); + version3 = new SemVer(version3, this.options); } catch (er) { return false; } } - return cmp(version4, this.operator, this.semver, this.options); + return cmp(version3, this.operator, this.semver, this.options); } intersects(comp, options) { if (!(comp instanceof _Comparator)) { @@ -97045,13 +97045,13 @@ var require_satisfies = __commonJS({ "node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/satisfies.js"(exports, module) { "use strict"; var Range = require_range(); - var satisfies = (version4, range2, options) => { + var satisfies = (version3, range2, options) => { try { range2 = new Range(range2, options); } catch (er) { return false; } - return range2.test(version4); + return range2.test(version3); }; module.exports = satisfies; } @@ -97213,8 +97213,8 @@ var require_outside = __commonJS({ var lt = require_lt(); var lte = require_lte(); var gte = require_gte(); - var outside = (version4, range2, hilo, options) => { - version4 = new SemVer(version4, options); + var outside = (version3, range2, hilo, options) => { + version3 = new SemVer(version3, options); range2 = new Range(range2, options); let gtfn, ltefn, ltfn, comp, ecomp; switch (hilo) { @@ -97235,7 +97235,7 @@ var require_outside = __commonJS({ default: throw new TypeError('Must provide a hilo val of "<" or ">"'); } - if (satisfies(version4, range2, options)) { + if (satisfies(version3, range2, options)) { return false; } for (let i = 0; i < range2.set.length; ++i) { @@ -97257,9 +97257,9 @@ var require_outside = __commonJS({ if (high.operator === comp || high.operator === ecomp) { return false; } - if ((!low.operator || low.operator === comp) && ltefn(version4, low.semver)) { + if ((!low.operator || low.operator === comp) && ltefn(version3, low.semver)) { return false; - } else if (low.operator === ecomp && ltfn(version4, low.semver)) { + } else if (low.operator === ecomp && ltfn(version3, low.semver)) { return false; } } @@ -97274,7 +97274,7 @@ var require_gtr = __commonJS({ "node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/gtr.js"(exports, module) { "use strict"; var outside = require_outside(); - var gtr = (version4, range2, options) => outside(version4, range2, ">", options); + var gtr = (version3, range2, options) => outside(version3, range2, ">", options); module.exports = gtr; } }); @@ -97284,7 +97284,7 @@ var require_ltr = __commonJS({ "node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/ltr.js"(exports, module) { "use strict"; var outside = require_outside(); - var ltr = (version4, range2, options) => outside(version4, range2, "<", options); + var ltr = (version3, range2, options) => outside(version3, range2, "<", options); module.exports = ltr; } }); @@ -97314,12 +97314,12 @@ var require_simplify = __commonJS({ let first = null; let prev = null; const v = versions.sort((a, b) => compare(a, b, options)); - for (const version4 of v) { - const included = satisfies(version4, range2, options); + for (const version3 of v) { + const included = satisfies(version3, range2, options); if (included) { - prev = version4; + prev = version3; if (!first) { - first = version4; + first = version3; } } else { if (prev) { @@ -97428,15 +97428,15 @@ var require_subset = __commonJS({ return null; } } - for (const eq2 of eqSet) { - if (gt && !satisfies(eq2, String(gt), options)) { + for (const eq of eqSet) { + if (gt && !satisfies(eq, String(gt), options)) { return null; } - if (lt && !satisfies(eq2, String(lt), options)) { + if (lt && !satisfies(eq, String(lt), options)) { return null; } for (const c of dom) { - if (!satisfies(eq2, String(c), options)) { + if (!satisfies(eq, String(c), options)) { return false; } } @@ -97540,7 +97540,7 @@ var require_semver2 = __commonJS({ var rsort = require_rsort(); var gt = require_gt(); var lt = require_lt(); - var eq2 = require_eq(); + var eq = require_eq(); var neq = require_neq(); var gte = require_gte(); var lte = require_lte(); @@ -97578,7 +97578,7 @@ var require_semver2 = __commonJS({ rsort, gt, lt, - eq: eq2, + eq, neq, gte, lte, @@ -97626,7 +97626,7 @@ var spliterate = (arr, predicate) => { return result; }; var ReadonlyArray = Array; -var includes = (array4, element) => array4.includes(element); +var includes = (array3, element) => array3.includes(element); var range = (length, offset = 0) => [...new Array(length)].map((_, i) => i + offset); var append = (to, value2, opts) => { if (to === void 0) { @@ -97662,7 +97662,7 @@ var appendUnique = (to, value2, opts) => { to.push(v); return to; }; -var groupBy = (array4, discriminant) => array4.reduce((result, item) => { +var groupBy = (array3, discriminant) => array3.reduce((result, item) => { const key = item[discriminant]; result[key] = append(result[key], item); return result; @@ -97967,8 +97967,8 @@ var Hkt = class { // node_modules/.pnpm/@ark+util@0.56.0/node_modules/@ark/util/out/isomorphic.js var fileName = () => { try { - const error50 = new Error(); - const stackLine = error50.stack?.split("\n")[2]?.trim() || ""; + const error49 = new Error(); + const stackLine = error49.stack?.split("\n")[2]?.trim() || ""; const filePath = stackLine.match(/\(?(.+?)(?::\d+:\d+)?\)?$/)?.[1] || "unknown"; return filePath.replace(/^file:\/\//, ""); } catch { @@ -98197,20 +98197,20 @@ var _serialize = (data, opts, seen) => { return data; } }; -var describeCollapsibleDate = (date6) => { - const year = date6.getFullYear(); - const month = date6.getMonth(); - const dayOfMonth = date6.getDate(); - const hours = date6.getHours(); - const minutes = date6.getMinutes(); - const seconds = date6.getSeconds(); - const milliseconds = date6.getMilliseconds(); +var describeCollapsibleDate = (date5) => { + const year = date5.getFullYear(); + const month = date5.getMonth(); + const dayOfMonth = date5.getDate(); + const hours = date5.getHours(); + const minutes = date5.getMinutes(); + const seconds = date5.getSeconds(); + const milliseconds = date5.getMilliseconds(); if (month === 0 && dayOfMonth === 1 && hours === 0 && minutes === 0 && seconds === 0 && milliseconds === 0) return `${year}`; const datePortion = `${months[month]} ${dayOfMonth}, ${year}`; if (hours === 0 && minutes === 0 && seconds === 0 && milliseconds === 0) return datePortion; - let timePortion = date6.toLocaleTimeString(); + let timePortion = date5.toLocaleTimeString(); const suffix2 = timePortion.endsWith(" AM") || timePortion.endsWith(" PM") ? timePortion.slice(-3) : ""; if (suffix2) timePortion = timePortion.slice(0, -suffix2.length); @@ -98238,29 +98238,29 @@ var timeWithUnnecessarySeconds = /:\d\d:00$/; var pad = (value2, length) => String(value2).padStart(length, "0"); // node_modules/.pnpm/@ark+util@0.56.0/node_modules/@ark/util/out/path.js -var appendStringifiedKey = (path4, prop, ...[opts]) => { +var appendStringifiedKey = (path3, prop, ...[opts]) => { const stringifySymbol = opts?.stringifySymbol ?? printable; - let propAccessChain = path4; + let propAccessChain = path3; switch (typeof prop) { case "string": - propAccessChain = isDotAccessible(prop) ? path4 === "" ? prop : `${path4}.${prop}` : `${path4}[${JSON.stringify(prop)}]`; + propAccessChain = isDotAccessible(prop) ? path3 === "" ? prop : `${path3}.${prop}` : `${path3}[${JSON.stringify(prop)}]`; break; case "number": - propAccessChain = `${path4}[${prop}]`; + propAccessChain = `${path3}[${prop}]`; break; case "symbol": - propAccessChain = `${path4}[${stringifySymbol(prop)}]`; + propAccessChain = `${path3}[${stringifySymbol(prop)}]`; break; default: if (opts?.stringifyNonKey) - propAccessChain = `${path4}[${opts.stringifyNonKey(prop)}]`; + propAccessChain = `${path3}[${opts.stringifyNonKey(prop)}]`; else { throwParseError(`${printable(prop)} must be a PropertyKey or stringifyNonKey must be passed to options`); } } return propAccessChain; }; -var stringifyPath = (path4, ...opts) => path4.reduce((s, k) => appendStringifiedKey(s, k, ...opts), ""); +var stringifyPath = (path3, ...opts) => path3.reduce((s, k) => appendStringifiedKey(s, k, ...opts), ""); var ReadonlyPath = class extends ReadonlyArray { // alternate strategy for caching since the base object is frozen cache = {}; @@ -98287,8 +98287,8 @@ var ReadonlyPath = class extends ReadonlyArray { return this.cache.stringifyAncestors; let propString = ""; const result = [propString]; - for (const path4 of this) { - propString = appendStringifiedKey(propString, path4); + for (const path3 of this) { + propString = appendStringifiedKey(propString, path3); result.push(propString); } return this.cache.stringifyAncestors = result; @@ -98418,11 +98418,11 @@ var CompiledFunction = class extends CastableBase { this.indentation -= 4; return this; } - prop(key, optional4 = false) { - return compileLiteralPropAccess(key, optional4); + prop(key, optional3 = false) { + return compileLiteralPropAccess(key, optional3); } - index(key, optional4 = false) { - return indexPropAccess(`${key}`, optional4); + index(key, optional3 = false) { + return indexPropAccess(`${key}`, optional3); } line(statement) { ; @@ -98475,13 +98475,13 @@ var CompiledFunction = class extends CastableBase { } }; var compileSerializedValue = (value2) => hasDomain(value2, "object") || typeof value2 === "symbol" ? registeredReference(value2) : serializePrimitive(value2); -var compileLiteralPropAccess = (key, optional4 = false) => { +var compileLiteralPropAccess = (key, optional3 = false) => { if (typeof key === "string" && isDotAccessible(key)) - return `${optional4 ? "?" : ""}.${key}`; - return indexPropAccess(serializeLiteralKey(key), optional4); + return `${optional3 ? "?" : ""}.${key}`; + return indexPropAccess(serializeLiteralKey(key), optional3); }; var serializeLiteralKey = (key) => typeof key === "symbol" ? registeredReference(key) : JSON.stringify(key); -var indexPropAccess = (key, optional4 = false) => `${optional4 ? "?." : ""}[${key}]`; +var indexPropAccess = (key, optional3 = false) => `${optional3 ? "?." : ""}[${key}]`; var NodeCompiler = class extends CompiledFunction { traversalKind; optimistic; @@ -98672,8 +98672,8 @@ var ToJsonSchema = { // node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/config.js $ark.config ??= {}; -var configureSchema = (config4) => { - const result = Object.assign($ark.config, mergeConfigs($ark.config, config4)); +var configureSchema = (config3) => { + const result = Object.assign($ark.config, mergeConfigs($ark.config, config3)); if ($ark.resolvedConfig) $ark.resolvedConfig = mergeConfigs($ark.resolvedConfig, result); return result; @@ -99361,8 +99361,8 @@ var initializer2 = (inst, issues) => { // enumerable: false, }, addIssue: { - value: (issue4) => { - inst.issues.push(issue4); + value: (issue3) => { + inst.issues.push(issue3); inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2); } // enumerable: false, @@ -99444,7 +99444,7 @@ var ZodType2 = /* @__PURE__ */ $constructor("ZodType", (inst, def) => { inst.safeDecode = (data, params) => safeDecode2(inst, data, params); inst.safeEncodeAsync = async (data, params) => safeEncodeAsync2(inst, data, params); inst.safeDecodeAsync = async (data, params) => safeDecodeAsync2(inst, data, params); - inst.refine = (check4, params) => inst.check(refine(check4, params)); + inst.refine = (check3, params) => inst.check(refine(check3, params)); inst.superRefine = (refinement) => inst.check(superRefine(refinement)); inst.overwrite = (fn2) => inst.check(_overwrite(fn2)); inst.optional = () => optional(inst); @@ -100184,11 +100184,11 @@ var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => { if (_ctx.direction === "backward") { throw new $ZodEncodeError(inst.constructor.name); } - payload.addIssue = (issue4) => { - if (typeof issue4 === "string") { - payload.issues.push(util_exports.issue(issue4, payload.value, def)); + payload.addIssue = (issue3) => { + if (typeof issue3 === "string") { + payload.issues.push(util_exports.issue(issue3, payload.value, def)); } else { - const _issue = issue4; + const _issue = issue3; if (_issue.fatal) _issue.continue = false; _issue.code ?? (_issue.code = "custom"); @@ -100505,7 +100505,7 @@ function getErrorMap2() { return config().customError; } var ZodFirstPartyTypeKind2; -/* @__PURE__ */ (function(ZodFirstPartyTypeKind4) { +/* @__PURE__ */ (function(ZodFirstPartyTypeKind3) { })(ZodFirstPartyTypeKind2 || (ZodFirstPartyTypeKind2 = {})); // node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/classic/external.js @@ -100609,13 +100609,13 @@ function resolveRef(ref, ctx) { if (!ref.startsWith("#")) { throw new Error("External $ref is not supported, only local refs (#/...) are allowed"); } - const path4 = ref.slice(1).split("/").filter(Boolean); - if (path4.length === 0) { + const path3 = ref.slice(1).split("/").filter(Boolean); + if (path3.length === 0) { return ctx.rootSchema; } const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions"; - if (path4[0] === defsKey) { - const key = path4[1]; + if (path3[0] === defsKey) { + const key = path3[1]; if (!key || !ctx.defs[key]) { throw new Error(`Reference not found: ${ref}`); } @@ -100976,10 +100976,10 @@ function fromJSONSchema(schema2, params) { if (typeof schema2 === "boolean") { return schema2 ? z.any() : z.never(); } - const version4 = detectVersion(schema2, params?.defaultTarget); + const version3 = detectVersion(schema2, params?.defaultTarget); const defs = schema2.$defs || schema2.definitions || {}; const ctx = { - version: version4, + version: version3, defs, refs: /* @__PURE__ */ new Map(), processing: /* @__PURE__ */ new Set(), @@ -101115,15 +101115,15 @@ var JSONRPCResultResponseSchema = object2({ }).strict(); var isJSONRPCResultResponse = (value2) => JSONRPCResultResponseSchema.safeParse(value2).success; var ErrorCode; -(function(ErrorCode4) { - ErrorCode4[ErrorCode4["ConnectionClosed"] = -32e3] = "ConnectionClosed"; - ErrorCode4[ErrorCode4["RequestTimeout"] = -32001] = "RequestTimeout"; - ErrorCode4[ErrorCode4["ParseError"] = -32700] = "ParseError"; - ErrorCode4[ErrorCode4["InvalidRequest"] = -32600] = "InvalidRequest"; - ErrorCode4[ErrorCode4["MethodNotFound"] = -32601] = "MethodNotFound"; - ErrorCode4[ErrorCode4["InvalidParams"] = -32602] = "InvalidParams"; - ErrorCode4[ErrorCode4["InternalError"] = -32603] = "InternalError"; - ErrorCode4[ErrorCode4["UrlElicitationRequired"] = -32042] = "UrlElicitationRequired"; +(function(ErrorCode3) { + ErrorCode3[ErrorCode3["ConnectionClosed"] = -32e3] = "ConnectionClosed"; + ErrorCode3[ErrorCode3["RequestTimeout"] = -32001] = "RequestTimeout"; + ErrorCode3[ErrorCode3["ParseError"] = -32700] = "ParseError"; + ErrorCode3[ErrorCode3["InvalidRequest"] = -32600] = "InvalidRequest"; + ErrorCode3[ErrorCode3["MethodNotFound"] = -32601] = "MethodNotFound"; + ErrorCode3[ErrorCode3["InvalidParams"] = -32602] = "InvalidParams"; + ErrorCode3[ErrorCode3["InternalError"] = -32603] = "InternalError"; + ErrorCode3[ErrorCode3["UrlElicitationRequired"] = -32042] = "UrlElicitationRequired"; })(ErrorCode || (ErrorCode = {})); var JSONRPCErrorResponseSchema = object2({ jsonrpc: literal(JSONRPC_VERSION), @@ -102608,8 +102608,8 @@ var Protocol = class { resolver(message); } else { const errorMessage = message; - const error50 = new McpError(errorMessage.error.code, errorMessage.error.message, errorMessage.error.data); - resolver(error50); + const error49 = new McpError(errorMessage.error.code, errorMessage.error.message, errorMessage.error.data); + resolver(error49); } } else { const messageType = queuedMessage.type === "response" ? "Response" : "Error"; @@ -102653,8 +102653,8 @@ var Protocol = class { nextCursor, _meta: {} }; - } catch (error50) { - throw new McpError(ErrorCode.InvalidParams, `Failed to list tasks: ${error50 instanceof Error ? error50.message : String(error50)}`); + } catch (error49) { + throw new McpError(ErrorCode.InvalidParams, `Failed to list tasks: ${error49 instanceof Error ? error49.message : String(error49)}`); } }); this.setRequestHandler(CancelTaskRequestSchema, async (request2, extra) => { @@ -102676,11 +102676,11 @@ var Protocol = class { _meta: {}, ...cancelledTask }; - } catch (error50) { - if (error50 instanceof McpError) { - throw error50; + } catch (error49) { + if (error49 instanceof McpError) { + throw error49; } - throw new McpError(ErrorCode.InvalidRequest, `Failed to cancel task: ${error50 instanceof Error ? error50.message : String(error50)}`); + throw new McpError(ErrorCode.InvalidRequest, `Failed to cancel task: ${error49 instanceof Error ? error49.message : String(error49)}`); } }); } @@ -102738,9 +102738,9 @@ var Protocol = class { this._onclose(); }; const _onerror = this.transport?.onerror; - this._transport.onerror = (error50) => { - _onerror?.(error50); - this._onerror(error50); + this._transport.onerror = (error49) => { + _onerror?.(error49); + this._onerror(error49); }; const _onmessage = this._transport?.onmessage; this._transport.onmessage = (message, extra) => { @@ -102763,22 +102763,22 @@ var Protocol = class { this._progressHandlers.clear(); this._taskProgressTokens.clear(); this._pendingDebouncedNotifications.clear(); - const error50 = McpError.fromError(ErrorCode.ConnectionClosed, "Connection closed"); + const error49 = McpError.fromError(ErrorCode.ConnectionClosed, "Connection closed"); this._transport = void 0; this.onclose?.(); for (const handler2 of responseHandlers.values()) { - handler2(error50); + handler2(error49); } } - _onerror(error50) { - this.onerror?.(error50); + _onerror(error49) { + this.onerror?.(error49); } _onnotification(notification) { const handler2 = this._notificationHandlers.get(notification.method) ?? this.fallbackNotificationHandler; if (handler2 === void 0) { return; } - Promise.resolve().then(() => handler2(notification)).catch((error50) => this._onerror(new Error(`Uncaught error in notification handler: ${error50}`))); + Promise.resolve().then(() => handler2(notification)).catch((error49) => this._onerror(new Error(`Uncaught error in notification handler: ${error49}`))); } _onrequest(request2, extra) { const handler2 = this._requestHandlers.get(request2.method) ?? this.fallbackRequestHandler; @@ -102798,9 +102798,9 @@ var Protocol = class { type: "error", message: errorResponse, timestamp: Date.now() - }, capturedTransport?.sessionId).catch((error50) => this._onerror(new Error(`Failed to enqueue error response: ${error50}`))); + }, capturedTransport?.sessionId).catch((error49) => this._onerror(new Error(`Failed to enqueue error response: ${error49}`))); } else { - capturedTransport?.send(errorResponse).catch((error50) => this._onerror(new Error(`Failed to send an error response: ${error50}`))); + capturedTransport?.send(errorResponse).catch((error49) => this._onerror(new Error(`Failed to send an error response: ${error49}`))); } return; } @@ -102861,7 +102861,7 @@ var Protocol = class { } else { await capturedTransport?.send(response); } - }, async (error50) => { + }, async (error49) => { if (abortController.signal.aborted) { return; } @@ -102869,9 +102869,9 @@ var Protocol = class { jsonrpc: "2.0", id: request2.id, error: { - code: Number.isSafeInteger(error50["code"]) ? error50["code"] : ErrorCode.InternalError, - message: error50.message ?? "Internal error", - ...error50["data"] !== void 0 && { data: error50["data"] } + code: Number.isSafeInteger(error49["code"]) ? error49["code"] : ErrorCode.InternalError, + message: error49.message ?? "Internal error", + ...error49["data"] !== void 0 && { data: error49["data"] } } }; if (relatedTaskId && this._taskMessageQueue) { @@ -102883,7 +102883,7 @@ var Protocol = class { } else { await capturedTransport?.send(errorResponse); } - }).catch((error50) => this._onerror(new Error(`Failed to send response: ${error50}`))).finally(() => { + }).catch((error49) => this._onerror(new Error(`Failed to send response: ${error49}`))).finally(() => { this._requestHandlerAbortControllers.delete(request2.id); }); } @@ -102900,11 +102900,11 @@ var Protocol = class { if (timeoutInfo && responseHandler && timeoutInfo.resetTimeoutOnProgress) { try { this._resetTimeout(messageId); - } catch (error50) { + } catch (error49) { this._responseHandlers.delete(messageId); this._progressHandlers.delete(messageId); this._cleanupTimeout(messageId); - responseHandler(error50); + responseHandler(error49); return; } } @@ -102918,8 +102918,8 @@ var Protocol = class { if (isJSONRPCResultResponse(response)) { resolver(response); } else { - const error50 = new McpError(response.error.code, response.error.message, response.error.data); - resolver(error50); + const error49 = new McpError(response.error.code, response.error.message, response.error.data); + resolver(error49); } return; } @@ -102947,8 +102947,8 @@ var Protocol = class { if (isJSONRPCResultResponse(response)) { handler2(response); } else { - const error50 = McpError.fromError(response.error.code, response.error.message, response.error.data); - handler2(error50); + const error49 = McpError.fromError(response.error.code, response.error.message, response.error.data); + handler2(error49); } } get transport() { @@ -102993,10 +102993,10 @@ var Protocol = class { try { const result = await this.request(request2, resultSchema, options); yield { type: "result", result }; - } catch (error50) { + } catch (error49) { yield { type: "error", - error: error50 instanceof McpError ? error50 : new McpError(ErrorCode.InternalError, String(error50)) + error: error49 instanceof McpError ? error49 : new McpError(ErrorCode.InternalError, String(error49)) }; } return; @@ -103039,10 +103039,10 @@ var Protocol = class { await new Promise((resolve2) => setTimeout(resolve2, pollInterval)); options?.signal?.throwIfAborted(); } - } catch (error50) { + } catch (error49) { yield { type: "error", - error: error50 instanceof McpError ? error50 : new McpError(ErrorCode.InternalError, String(error50)) + error: error49 instanceof McpError ? error49 : new McpError(ErrorCode.InternalError, String(error49)) }; } } @@ -103054,8 +103054,8 @@ var Protocol = class { request(request2, resultSchema, options) { const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options ?? {}; return new Promise((resolve2, reject) => { - const earlyReject = (error50) => { - reject(error50); + const earlyReject = (error49) => { + reject(error49); }; if (!this._transport) { earlyReject(new Error("Not connected")); @@ -103115,9 +103115,9 @@ var Protocol = class { requestId: messageId, reason: String(reason) } - }, { relatedRequestId, resumptionToken, onresumptiontoken }).catch((error51) => this._onerror(new Error(`Failed to send cancellation: ${error51}`))); - const error50 = reason instanceof McpError ? reason : new McpError(ErrorCode.RequestTimeout, String(reason)); - reject(error50); + }, { relatedRequestId, resumptionToken, onresumptiontoken }).catch((error50) => this._onerror(new Error(`Failed to send cancellation: ${error50}`))); + const error49 = reason instanceof McpError ? reason : new McpError(ErrorCode.RequestTimeout, String(reason)); + reject(error49); }; this._responseHandlers.set(messageId, (response) => { if (options?.signal?.aborted) { @@ -103133,8 +103133,8 @@ var Protocol = class { } else { resolve2(parseResult.data); } - } catch (error50) { - reject(error50); + } catch (error49) { + reject(error49); } }); options?.signal?.addEventListener("abort", () => { @@ -103158,14 +103158,14 @@ var Protocol = class { type: "request", message: jsonrpcRequest, timestamp: Date.now() - }).catch((error50) => { + }).catch((error49) => { this._cleanupTimeout(messageId); - reject(error50); + reject(error49); }); } else { - this._transport.send(jsonrpcRequest, { relatedRequestId, resumptionToken, onresumptiontoken }).catch((error50) => { + this._transport.send(jsonrpcRequest, { relatedRequestId, resumptionToken, onresumptiontoken }).catch((error49) => { this._cleanupTimeout(messageId); - reject(error50); + reject(error49); }); } }); @@ -103258,7 +103258,7 @@ var Protocol = class { } }; } - this._transport?.send(jsonrpcNotification2, options).catch((error50) => this._onerror(error50)); + this._transport?.send(jsonrpcNotification2, options).catch((error49) => this._onerror(error49)); }); return; } @@ -103979,11 +103979,11 @@ var Server = class extends Protocol { if (!validationResult.valid) { throw new McpError(ErrorCode.InvalidParams, `Elicitation response content does not match requested schema: ${validationResult.errorMessage}`); } - } catch (error50) { - if (error50 instanceof McpError) { - throw error50; + } catch (error49) { + if (error49 instanceof McpError) { + throw error49; } - throw new McpError(ErrorCode.InternalError, `Error validating elicitation response: ${error50 instanceof Error ? error50.message : String(error50)}`); + throw new McpError(ErrorCode.InternalError, `Error validating elicitation response: ${error49 instanceof Error ? error49.message : String(error49)}`); } } return result; @@ -104087,8 +104087,8 @@ var StdioServerTransport = class { this._readBuffer.append(chunk); this.processReadBuffer(); }; - this._onerror = (error50) => { - this.onerror?.(error50); + this._onerror = (error49) => { + this.onerror?.(error49); }; } /** @@ -104110,8 +104110,8 @@ var StdioServerTransport = class { break; } this.onmessage?.(message); - } catch (error50) { - this.onerror?.(error50); + } catch (error49) { + this.onerror?.(error49); } } } @@ -104211,14 +104211,14 @@ var KeyStore = class { } }; function createKey(key) { - let path4 = null; + let path3 = null; let id = null; let src = null; let weight = 1; let getFn = null; if (isString(key) || isArray2(key)) { src = key; - path4 = createKeyPath(key); + path3 = createKeyPath(key); id = createKeyId(key); } else { if (!hasOwn.call(key, "name")) { @@ -104232,11 +104232,11 @@ function createKey(key) { throw new Error(INVALID_KEY_WEIGHT_VALUE(name)); } } - path4 = createKeyPath(name); + path3 = createKeyPath(name); id = createKeyId(name); getFn = key.getFn; } - return { path: path4, id, weight, src, getFn }; + return { path: path3, id, weight, src, getFn }; } function createKeyPath(key) { return isArray2(key) ? key : key.split("."); @@ -104244,34 +104244,34 @@ function createKeyPath(key) { function createKeyId(key) { return isArray2(key) ? key.join(".") : key; } -function get(obj, path4) { +function get(obj, path3) { let list = []; let arr = false; - const deepGet = (obj2, path5, index) => { + const deepGet = (obj2, path4, index) => { if (!isDefined(obj2)) { return; } - if (!path5[index]) { + if (!path4[index]) { list.push(obj2); } else { - let key = path5[index]; + let key = path4[index]; const value2 = obj2[key]; if (!isDefined(value2)) { return; } - if (index === path5.length - 1 && (isString(value2) || isNumber(value2) || isBoolean(value2))) { + if (index === path4.length - 1 && (isString(value2) || isNumber(value2) || isBoolean(value2))) { list.push(toString(value2)); } else if (isArray2(value2)) { arr = true; for (let i = 0, len = value2.length; i < len; i += 1) { - deepGet(value2[i], path5, index + 1); + deepGet(value2[i], path4, index + 1); } - } else if (path5.length) { - deepGet(value2, path5, index + 1); + } else if (path4.length) { + deepGet(value2, path4, index + 1); } } }; - deepGet(obj, isString(path4) ? path4.split(".") : path4, 0); + deepGet(obj, isString(path3) ? path3.split(".") : path3, 0); return arr ? list : list[0]; } var MatchOptions = { @@ -104421,15 +104421,15 @@ var FuseIndex = class { if (!isDefined(doc) || isBlank(doc)) { return; } - let record4 = { + let record3 = { v: doc, i: docIndex, n: this.norm.get(doc) }; - this.records.push(record4); + this.records.push(record3); } _addObject(doc, docIndex) { - let record4 = { i: docIndex, $: {} }; + let record3 = { i: docIndex, $: {} }; this.keys.forEach((key, keyIndex) => { let value2 = key.getFn ? key.getFn(doc) : this.getFn(doc, key.path); if (!isDefined(value2)) { @@ -104459,16 +104459,16 @@ var FuseIndex = class { }); } else ; } - record4.$[keyIndex] = subRecords; + record3.$[keyIndex] = subRecords; } else if (isString(value2) && !isBlank(value2)) { let subRecord = { v: value2, n: this.norm.get(value2) }; - record4.$[keyIndex] = subRecord; + record3.$[keyIndex] = subRecord; } }); - this.records.push(record4); + this.records.push(record3); } toJSON() { return { @@ -105000,10 +105000,10 @@ var SPACE_RE = / +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/; var OR_TOKEN = "|"; function parseQuery(pattern, options = {}) { return pattern.split(OR_TOKEN).map((item) => { - let query2 = item.trim().split(SPACE_RE).filter((item2) => item2 && !!item2.trim()); + let query = item.trim().split(SPACE_RE).filter((item2) => item2 && !!item2.trim()); let results = []; - for (let i = 0, len = query2.length; i < len; i += 1) { - const queryItem = query2[i]; + for (let i = 0, len = query.length; i < len; i += 1) { + const queryItem = query[i]; let found = false; let idx = -1; while (!found && ++idx < searchersLen) { @@ -105064,8 +105064,8 @@ var ExtendedSearch = class { return options.useExtendedSearch; } searchIn(text) { - const query2 = this.query; - if (!query2) { + const query = this.query; + if (!query) { return { isMatch: false, score: 1 @@ -105077,8 +105077,8 @@ var ExtendedSearch = class { let numMatches = 0; let allIndices = []; let totalScore = 0; - for (let i = 0, qLen = query2.length; i < qLen; i += 1) { - const searchers2 = query2[i]; + for (let i = 0, qLen = query.length; i < qLen; i += 1) { + const searchers2 = query[i]; allIndices.length = 0; numMatches = 0; for (let j = 0, pLen = searchers2.length; j < pLen; j += 1) { @@ -105140,24 +105140,24 @@ var KeyType = { PATH: "$path", PATTERN: "$val" }; -var isExpression = (query2) => !!(query2[LogicalOperator.AND] || query2[LogicalOperator.OR]); -var isPath = (query2) => !!query2[KeyType.PATH]; -var isLeaf = (query2) => !isArray2(query2) && isObject2(query2) && !isExpression(query2); -var convertToExplicit = (query2) => ({ - [LogicalOperator.AND]: Object.keys(query2).map((key) => ({ - [key]: query2[key] +var isExpression = (query) => !!(query[LogicalOperator.AND] || query[LogicalOperator.OR]); +var isPath = (query) => !!query[KeyType.PATH]; +var isLeaf = (query) => !isArray2(query) && isObject2(query) && !isExpression(query); +var convertToExplicit = (query) => ({ + [LogicalOperator.AND]: Object.keys(query).map((key) => ({ + [key]: query[key] })) }); -function parse3(query2, options, { auto = true } = {}) { - const next2 = (query3) => { - let keys = Object.keys(query3); - const isQueryPath = isPath(query3); - if (!isQueryPath && keys.length > 1 && !isExpression(query3)) { - return next2(convertToExplicit(query3)); +function parse3(query, options, { auto = true } = {}) { + const next2 = (query2) => { + let keys = Object.keys(query2); + const isQueryPath = isPath(query2); + if (!isQueryPath && keys.length > 1 && !isExpression(query2)) { + return next2(convertToExplicit(query2)); } - if (isLeaf(query3)) { - const key = isQueryPath ? query3[KeyType.PATH] : keys[0]; - const pattern = isQueryPath ? query3[KeyType.PATTERN] : query3[key]; + if (isLeaf(query2)) { + const key = isQueryPath ? query2[KeyType.PATH] : keys[0]; + const pattern = isQueryPath ? query2[KeyType.PATTERN] : query2[key]; if (!isString(pattern)) { throw new Error(LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(key)); } @@ -105175,7 +105175,7 @@ function parse3(query2, options, { auto = true } = {}) { operator: keys[0] }; keys.forEach((key) => { - const value2 = query3[key]; + const value2 = query2[key]; if (isArray2(value2)) { value2.forEach((item) => { node2.children.push(next2(item)); @@ -105184,10 +105184,10 @@ function parse3(query2, options, { auto = true } = {}) { }); return node2; }; - if (!isExpression(query2)) { - query2 = convertToExplicit(query2); + if (!isExpression(query)) { + query = convertToExplicit(query); } - return next2(query2); + return next2(query); } function computeScore(results, { ignoreFieldNorm = Config.ignoreFieldNorm }) { results.forEach((result) => { @@ -105296,7 +105296,7 @@ var Fuse = class { getIndex() { return this._myIndex; } - search(query2, { limit = -1 } = {}) { + search(query, { limit = -1 } = {}) { const { includeMatches, includeScore, @@ -105304,7 +105304,7 @@ var Fuse = class { sortFn, ignoreFieldNorm } = this.options; - let results = isString(query2) ? isString(this._docs[0]) ? this._searchStringList(query2) : this._searchObjectList(query2) : this._searchLogical(query2); + let results = isString(query) ? isString(this._docs[0]) ? this._searchStringList(query) : this._searchObjectList(query) : this._searchLogical(query); computeScore(results, { ignoreFieldNorm }); if (shouldSort) { results.sort(sortFn); @@ -105317,8 +105317,8 @@ var Fuse = class { includeScore }); } - _searchStringList(query2) { - const searcher = createSearcher(query2, this.options); + _searchStringList(query) { + const searcher = createSearcher(query, this.options); const { records } = this._myIndex; const results = []; records.forEach(({ v: text, i: idx, n: norm2 }) => { @@ -105336,8 +105336,8 @@ var Fuse = class { }); return results; } - _searchLogical(query2) { - const expression = parse3(query2, this.options); + _searchLogical(query) { + const expression = parse3(query, this.options); const evaluate = (node2, item, idx) => { if (!node2.children) { const { keyId, searcher } = node2; @@ -105388,8 +105388,8 @@ var Fuse = class { }); return results; } - _searchObjectList(query2) { - const searcher = createSearcher(query2, this.options); + _searchObjectList(query) { + const searcher = createSearcher(query, this.options); const { keys, records } = this._myIndex; const results = []; records.forEach(({ $: item, i: idx }) => { @@ -105843,18 +105843,18 @@ function merge2(a, b) { checks: [] }); } -function partial2(Class3, schema2, mask) { +function partial2(Class2, schema2, mask) { const oldShape = schema2._zod.def.shape; const shape = { ...oldShape }; if (mask) for (const key$1 in mask) { if (!(key$1 in oldShape)) throw new Error(`Unrecognized key: "${key$1}"`); if (!mask[key$1]) continue; - shape[key$1] = Class3 ? new Class3({ + shape[key$1] = Class2 ? new Class2({ type: "optional", innerType: oldShape[key$1] }) : oldShape[key$1]; } - else for (const key$1 in oldShape) shape[key$1] = Class3 ? new Class3({ + else for (const key$1 in oldShape) shape[key$1] = Class2 ? new Class2({ type: "optional", innerType: oldShape[key$1] }) : oldShape[key$1]; @@ -105864,18 +105864,18 @@ function partial2(Class3, schema2, mask) { checks: [] }); } -function required2(Class3, schema2, mask) { +function required2(Class2, schema2, mask) { const oldShape = schema2._zod.def.shape; const shape = { ...oldShape }; if (mask) for (const key$1 in mask) { if (!(key$1 in shape)) throw new Error(`Unrecognized key: "${key$1}"`); if (!mask[key$1]) continue; - shape[key$1] = new Class3({ + shape[key$1] = new Class2({ type: "nonoptional", innerType: oldShape[key$1] }); } - else for (const key$1 in oldShape) shape[key$1] = new Class3({ + else for (const key$1 in oldShape) shape[key$1] = new Class2({ type: "nonoptional", innerType: oldShape[key$1] }); @@ -105889,11 +105889,11 @@ function aborted2(x, startIndex = 0) { for (let i$3 = startIndex; i$3 < x.issues.length; i$3++) if (x.issues[i$3]?.continue !== true) return true; return false; } -function prefixIssues2(path4, issues) { +function prefixIssues2(path3, issues) { return issues.map((iss) => { var _a2; (_a2 = iss).path ?? (_a2.path = []); - iss.path.unshift(path4); + iss.path.unshift(path3); return iss; }); } @@ -106091,8 +106091,8 @@ function datetime$1(args3) { const opts = ["Z"]; if (args3.local) opts.push(""); if (args3.offset) opts.push(`([+-]\\d{2}:\\d{2})`); - const timeRegex3 = `${time$2}(?:${opts.join("|")})`; - return /* @__PURE__ */ new RegExp(`^${dateSource2}T(?:${timeRegex3})$`); + const timeRegex2 = `${time$2}(?:${opts.join("|")})`; + return /* @__PURE__ */ new RegExp(`^${dateSource2}T(?:${timeRegex2})$`); } var string$1 = (params) => { const regex$1 = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`; @@ -106506,23 +106506,23 @@ var $ZodType2 = /* @__PURE__ */ $constructor2("$ZodType", (inst, def$30) => { }); } else { const runChecks = (payload, checks$1, ctx) => { - let isAborted3 = aborted2(payload); + let isAborted2 = aborted2(payload); let asyncResult; for (const ch of checks$1) { if (ch._zod.def.when) { if (!ch._zod.def.when(payload)) continue; - } else if (isAborted3) continue; + } else if (isAborted2) continue; const currLen = payload.issues.length; const _$1 = ch._zod.check(payload); if (_$1 instanceof Promise && ctx?.async === false) throw new $ZodAsyncError2(); if (asyncResult || _$1 instanceof Promise) asyncResult = (asyncResult ?? Promise.resolve()).then(async () => { await _$1; if (payload.issues.length === currLen) return; - if (!isAborted3) isAborted3 = aborted2(payload, currLen); + if (!isAborted2) isAborted2 = aborted2(payload, currLen); }); else { if (payload.issues.length === currLen) continue; - if (!isAborted3) isAborted3 = aborted2(payload, currLen); + if (!isAborted2) isAborted2 = aborted2(payload, currLen); } } if (asyncResult) return asyncResult.then(() => { @@ -107624,14 +107624,14 @@ function registry3() { return new $ZodRegistry2(); } var globalRegistry2 = /* @__PURE__ */ registry3(); -function _string2(Class3, params) { - return new Class3({ +function _string2(Class2, params) { + return new Class2({ type: "string", ...normalizeParams2(params) }); } -function _email2(Class3, params) { - return new Class3({ +function _email2(Class2, params) { + return new Class2({ type: "string", format: "email", check: "string_format", @@ -107639,8 +107639,8 @@ function _email2(Class3, params) { ...normalizeParams2(params) }); } -function _guid2(Class3, params) { - return new Class3({ +function _guid2(Class2, params) { + return new Class2({ type: "string", format: "guid", check: "string_format", @@ -107648,8 +107648,8 @@ function _guid2(Class3, params) { ...normalizeParams2(params) }); } -function _uuid2(Class3, params) { - return new Class3({ +function _uuid2(Class2, params) { + return new Class2({ type: "string", format: "uuid", check: "string_format", @@ -107657,8 +107657,8 @@ function _uuid2(Class3, params) { ...normalizeParams2(params) }); } -function _uuidv42(Class3, params) { - return new Class3({ +function _uuidv42(Class2, params) { + return new Class2({ type: "string", format: "uuid", check: "string_format", @@ -107667,8 +107667,8 @@ function _uuidv42(Class3, params) { ...normalizeParams2(params) }); } -function _uuidv62(Class3, params) { - return new Class3({ +function _uuidv62(Class2, params) { + return new Class2({ type: "string", format: "uuid", check: "string_format", @@ -107677,8 +107677,8 @@ function _uuidv62(Class3, params) { ...normalizeParams2(params) }); } -function _uuidv72(Class3, params) { - return new Class3({ +function _uuidv72(Class2, params) { + return new Class2({ type: "string", format: "uuid", check: "string_format", @@ -107687,8 +107687,8 @@ function _uuidv72(Class3, params) { ...normalizeParams2(params) }); } -function _url2(Class3, params) { - return new Class3({ +function _url2(Class2, params) { + return new Class2({ type: "string", format: "url", check: "string_format", @@ -107696,8 +107696,8 @@ function _url2(Class3, params) { ...normalizeParams2(params) }); } -function _emoji3(Class3, params) { - return new Class3({ +function _emoji3(Class2, params) { + return new Class2({ type: "string", format: "emoji", check: "string_format", @@ -107705,8 +107705,8 @@ function _emoji3(Class3, params) { ...normalizeParams2(params) }); } -function _nanoid2(Class3, params) { - return new Class3({ +function _nanoid2(Class2, params) { + return new Class2({ type: "string", format: "nanoid", check: "string_format", @@ -107714,8 +107714,8 @@ function _nanoid2(Class3, params) { ...normalizeParams2(params) }); } -function _cuid3(Class3, params) { - return new Class3({ +function _cuid3(Class2, params) { + return new Class2({ type: "string", format: "cuid", check: "string_format", @@ -107723,8 +107723,8 @@ function _cuid3(Class3, params) { ...normalizeParams2(params) }); } -function _cuid22(Class3, params) { - return new Class3({ +function _cuid22(Class2, params) { + return new Class2({ type: "string", format: "cuid2", check: "string_format", @@ -107732,8 +107732,8 @@ function _cuid22(Class3, params) { ...normalizeParams2(params) }); } -function _ulid2(Class3, params) { - return new Class3({ +function _ulid2(Class2, params) { + return new Class2({ type: "string", format: "ulid", check: "string_format", @@ -107741,8 +107741,8 @@ function _ulid2(Class3, params) { ...normalizeParams2(params) }); } -function _xid2(Class3, params) { - return new Class3({ +function _xid2(Class2, params) { + return new Class2({ type: "string", format: "xid", check: "string_format", @@ -107750,8 +107750,8 @@ function _xid2(Class3, params) { ...normalizeParams2(params) }); } -function _ksuid2(Class3, params) { - return new Class3({ +function _ksuid2(Class2, params) { + return new Class2({ type: "string", format: "ksuid", check: "string_format", @@ -107759,8 +107759,8 @@ function _ksuid2(Class3, params) { ...normalizeParams2(params) }); } -function _ipv42(Class3, params) { - return new Class3({ +function _ipv42(Class2, params) { + return new Class2({ type: "string", format: "ipv4", check: "string_format", @@ -107768,8 +107768,8 @@ function _ipv42(Class3, params) { ...normalizeParams2(params) }); } -function _ipv62(Class3, params) { - return new Class3({ +function _ipv62(Class2, params) { + return new Class2({ type: "string", format: "ipv6", check: "string_format", @@ -107777,8 +107777,8 @@ function _ipv62(Class3, params) { ...normalizeParams2(params) }); } -function _cidrv42(Class3, params) { - return new Class3({ +function _cidrv42(Class2, params) { + return new Class2({ type: "string", format: "cidrv4", check: "string_format", @@ -107786,8 +107786,8 @@ function _cidrv42(Class3, params) { ...normalizeParams2(params) }); } -function _cidrv62(Class3, params) { - return new Class3({ +function _cidrv62(Class2, params) { + return new Class2({ type: "string", format: "cidrv6", check: "string_format", @@ -107795,8 +107795,8 @@ function _cidrv62(Class3, params) { ...normalizeParams2(params) }); } -function _base642(Class3, params) { - return new Class3({ +function _base642(Class2, params) { + return new Class2({ type: "string", format: "base64", check: "string_format", @@ -107804,8 +107804,8 @@ function _base642(Class3, params) { ...normalizeParams2(params) }); } -function _base64url2(Class3, params) { - return new Class3({ +function _base64url2(Class2, params) { + return new Class2({ type: "string", format: "base64url", check: "string_format", @@ -107813,8 +107813,8 @@ function _base64url2(Class3, params) { ...normalizeParams2(params) }); } -function _e1642(Class3, params) { - return new Class3({ +function _e1642(Class2, params) { + return new Class2({ type: "string", format: "e164", check: "string_format", @@ -107822,8 +107822,8 @@ function _e1642(Class3, params) { ...normalizeParams2(params) }); } -function _jwt2(Class3, params) { - return new Class3({ +function _jwt2(Class2, params) { + return new Class2({ type: "string", format: "jwt", check: "string_format", @@ -107831,8 +107831,8 @@ function _jwt2(Class3, params) { ...normalizeParams2(params) }); } -function _isoDateTime2(Class3, params) { - return new Class3({ +function _isoDateTime2(Class2, params) { + return new Class2({ type: "string", format: "datetime", check: "string_format", @@ -107842,16 +107842,16 @@ function _isoDateTime2(Class3, params) { ...normalizeParams2(params) }); } -function _isoDate2(Class3, params) { - return new Class3({ +function _isoDate2(Class2, params) { + return new Class2({ type: "string", format: "date", check: "string_format", ...normalizeParams2(params) }); } -function _isoTime2(Class3, params) { - return new Class3({ +function _isoTime2(Class2, params) { + return new Class2({ type: "string", format: "time", check: "string_format", @@ -107859,31 +107859,31 @@ function _isoTime2(Class3, params) { ...normalizeParams2(params) }); } -function _isoDuration2(Class3, params) { - return new Class3({ +function _isoDuration2(Class2, params) { + return new Class2({ type: "string", format: "duration", check: "string_format", ...normalizeParams2(params) }); } -function _number2(Class3, params) { - return new Class3({ +function _number2(Class2, params) { + return new Class2({ type: "number", checks: [], ...normalizeParams2(params) }); } -function _coercedNumber2(Class3, params) { - return new Class3({ +function _coercedNumber2(Class2, params) { + return new Class2({ type: "number", coerce: true, checks: [], ...normalizeParams2(params) }); } -function _int2(Class3, params) { - return new Class3({ +function _int2(Class2, params) { + return new Class2({ type: "number", check: "number_format", abort: false, @@ -107891,26 +107891,26 @@ function _int2(Class3, params) { ...normalizeParams2(params) }); } -function _boolean2(Class3, params) { - return new Class3({ +function _boolean2(Class2, params) { + return new Class2({ type: "boolean", ...normalizeParams2(params) }); } -function _null$1(Class3, params) { - return new Class3({ +function _null$1(Class2, params) { + return new Class2({ type: "null", ...normalizeParams2(params) }); } -function _any2(Class3) { - return new Class3({ type: "any" }); +function _any2(Class2) { + return new Class2({ type: "any" }); } -function _unknown2(Class3) { - return new Class3({ type: "unknown" }); +function _unknown2(Class2) { + return new Class2({ type: "unknown" }); } -function _never2(Class3, params) { - return new Class3({ +function _never2(Class2, params) { + return new Class2({ type: "never", ...normalizeParams2(params) }); @@ -108039,25 +108039,25 @@ function _toLowerCase2() { function _toUpperCase2() { return _overwrite2((input) => input.toUpperCase()); } -function _array2(Class3, element, params) { - return new Class3({ +function _array2(Class2, element, params) { + return new Class2({ type: "array", element, ...normalizeParams2(params) }); } -function _custom2(Class3, fn2, _params) { +function _custom2(Class2, fn2, _params) { const norm2 = normalizeParams2(_params); norm2.abort ?? (norm2.abort = true); - return new Class3({ + return new Class2({ type: "custom", check: "custom", fn: fn2, ...norm2 }); } -function _refine2(Class3, fn2, _params) { - return new Class3({ +function _refine2(Class2, fn2, _params) { + return new Class2({ type: "custom", check: "custom", fn: fn2, @@ -109903,9 +109903,9 @@ var require_inherits_browser = /* @__PURE__ */ __commonJSMin(((exports, module) })); var require_inherits = /* @__PURE__ */ __commonJSMin(((exports, module) => { try { - var util3 = __require2("util"); - if (typeof util3.inherits !== "function") throw ""; - module.exports = util3.inherits; + var util2 = __require2("util"); + if (typeof util2.inherits !== "function") throw ""; + module.exports = util2.inherits; } catch (e) { module.exports = require_inherits_browser(); } @@ -110648,9 +110648,9 @@ var require_utf7 = /* @__PURE__ */ __commonJSMin(((exports) => { this.inBase64 = false; this.base64Accum = ""; } - var base64Regex3 = /[A-Za-z0-9\/+]/; + var base64Regex2 = /[A-Za-z0-9\/+]/; var base64Chars = []; - for (var i$2 = 0; i$2 < 256; i$2++) base64Chars[i$2] = base64Regex3.test(String.fromCharCode(i$2)); + for (var i$2 = 0; i$2 < 256; i$2++) base64Chars[i$2] = base64Regex2.test(String.fromCharCode(i$2)); var plusChar = "+".charCodeAt(0); var minusChar = "-".charCodeAt(0); var andChar = "&".charCodeAt(0); @@ -122609,24 +122609,24 @@ var require_compile2 = /* @__PURE__ */ __commonJSMin(((exports) => { } } exports.compileSchema = compileSchema; - function resolveRef2(root2, baseId, ref) { + function resolveRef2(root, baseId, ref) { var _a2; ref = (0, resolve_1$1.resolveUrl)(this.opts.uriResolver, baseId, ref); - const schOrFunc = root2.refs[ref]; + const schOrFunc = root.refs[ref]; if (schOrFunc) return schOrFunc; - let _sch = resolve$1.call(this, root2, ref); + let _sch = resolve$1.call(this, root, ref); if (_sch === void 0) { - const schema2 = (_a2 = root2.localRefs) === null || _a2 === void 0 ? void 0 : _a2[ref]; + const schema2 = (_a2 = root.localRefs) === null || _a2 === void 0 ? void 0 : _a2[ref]; const { schemaId } = this.opts; if (schema2) _sch = new SchemaEnv({ schema: schema2, schemaId, - root: root2, + root, baseId }); } if (_sch === void 0) return; - return root2.refs[ref] = inlineOrCompile.call(this, _sch); + return root.refs[ref] = inlineOrCompile.call(this, _sch); } exports.resolveRef = resolveRef2; function inlineOrCompile(sch) { @@ -122640,20 +122640,20 @@ var require_compile2 = /* @__PURE__ */ __commonJSMin(((exports) => { function sameSchemaEnv(s1, s2) { return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId; } - function resolve$1(root2, ref) { + function resolve$1(root, ref) { let sch; while (typeof (sch = this.refs[ref]) == "string") ref = sch; - return sch || this.schemas[ref] || resolveSchema.call(this, root2, ref); + return sch || this.schemas[ref] || resolveSchema.call(this, root, ref); } - function resolveSchema(root2, ref) { + function resolveSchema(root, ref) { const p = this.opts.uriResolver.parse(ref); const refPath = (0, resolve_1$1._getFullPath)(this.opts.uriResolver, p); - let baseId = (0, resolve_1$1.getFullPath)(this.opts.uriResolver, root2.baseId, void 0); - if (Object.keys(root2.schema).length > 0 && refPath === baseId) return getJsonPointer.call(this, p, root2); + let baseId = (0, resolve_1$1.getFullPath)(this.opts.uriResolver, root.baseId, void 0); + if (Object.keys(root.schema).length > 0 && refPath === baseId) return getJsonPointer.call(this, p, root); const id = (0, resolve_1$1.normalizeId)(refPath); const schOrRef = this.refs[id] || this.schemas[id]; if (typeof schOrRef == "string") { - const sch = resolveSchema.call(this, root2, schOrRef); + const sch = resolveSchema.call(this, root, schOrRef); if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object") return; return getJsonPointer.call(this, p, sch); } @@ -122667,7 +122667,7 @@ var require_compile2 = /* @__PURE__ */ __commonJSMin(((exports) => { return new SchemaEnv({ schema: schema2, schemaId, - root: root2, + root, baseId }); } @@ -122681,7 +122681,7 @@ var require_compile2 = /* @__PURE__ */ __commonJSMin(((exports) => { "dependencies", "definitions" ]); - function getJsonPointer(parsedRef, { baseId, schema: schema2, root: root2 }) { + function getJsonPointer(parsedRef, { baseId, schema: schema2, root }) { var _a2; if (((_a2 = parsedRef.fragment) === null || _a2 === void 0 ? void 0 : _a2[0]) !== "/") return; for (const part of parsedRef.fragment.slice(1).split("/")) { @@ -122695,13 +122695,13 @@ var require_compile2 = /* @__PURE__ */ __commonJSMin(((exports) => { let env3; if (typeof schema2 != "boolean" && schema2.$ref && !(0, util_1$22.schemaHasRulesButRef)(schema2, this.RULES)) { const $ref = (0, resolve_1$1.resolveUrl)(this.opts.uriResolver, baseId, schema2.$ref); - env3 = resolveSchema.call(this, root2, $ref); + env3 = resolveSchema.call(this, root, $ref); } const { schemaId } = this.opts; env3 = env3 || new SchemaEnv({ schema: schema2, schemaId, - root: root2, + root, baseId }); if (env3.schema !== env3.root.schema) return env3; @@ -122825,8 +122825,8 @@ var require_utils4 = /* @__PURE__ */ __commonJSMin(((exports, module) => { for (let i$3 = 0; i$3 < str$1.length; i$3++) if (str$1[i$3] === token) ind++; return ind; } - function removeDotSegments$1(path4) { - let input = path4; + function removeDotSegments$1(path3) { + let input = path3; const output = []; let nextSlash = -1; let len = 0; @@ -122979,9 +122979,9 @@ var require_schemes2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { wsComponent.secure = void 0; } if (wsComponent.resourceName) { - const [path4, query2] = wsComponent.resourceName.split("?"); - wsComponent.path = path4 && path4 !== "/" ? path4 : void 0; - wsComponent.query = query2; + const [path3, query] = wsComponent.resourceName.split("?"); + wsComponent.path = path3 && path3 !== "/" ? path3 : void 0; + wsComponent.query = query; wsComponent.resourceName = void 0; } wsComponent.fragment = void 0; @@ -123566,11 +123566,11 @@ var require_core$1 = /* @__PURE__ */ __commonJSMin(((exports) => { while (typeof (sch = getSchEnv.call(this, keyRef)) == "string") keyRef = sch; if (sch === void 0) { const { schemaId } = this.opts; - const root2 = new compile_1$2.SchemaEnv({ + const root = new compile_1$2.SchemaEnv({ schema: {}, schemaId }); - sch = compile_1$2.resolveSchema.call(this, root2, keyRef); + sch = compile_1$2.resolveSchema.call(this, root, keyRef); if (!sch) return; this.refs[keyRef] = sch; } @@ -123875,16 +123875,16 @@ var require_ref2 = /* @__PURE__ */ __commonJSMin(((exports) => { code(cxt) { const { gen, schema: $ref, it } = cxt; const { baseId, schemaEnv: env3, validateName, opts, self: self2 } = it; - const { root: root2 } = env3; - if (($ref === "#" || $ref === "#/") && baseId === root2.baseId) return callRootRef(); - const schOrEnv = compile_1$1.resolveRef.call(self2, root2, baseId, $ref); + const { root } = env3; + if (($ref === "#" || $ref === "#/") && baseId === root.baseId) return callRootRef(); + const schOrEnv = compile_1$1.resolveRef.call(self2, root, baseId, $ref); if (schOrEnv === void 0) throw new ref_error_1$2.default(it.opts.uriResolver, baseId, $ref); if (schOrEnv instanceof compile_1$1.SchemaEnv) return callValidate(schOrEnv); return inlineRefSchema(schOrEnv); function callRootRef() { - if (env3 === root2) return callRef(cxt, validateName, env3, env3.$async); - const rootName = gen.scopeValue("root", { ref: root2 }); - return callRef(cxt, (0, codegen_1$25._)`${rootName}.validate`, root2, root2.$async); + if (env3 === root) return callRef(cxt, validateName, env3, env3.$async); + const rootName = gen.scopeValue("root", { ref: root }); + return callRef(cxt, (0, codegen_1$25._)`${rootName}.validate`, root, root.$async); } function callValidate(sch) { callRef(cxt, getValidate(cxt, sch), sch, sch.$async); @@ -125578,7 +125578,7 @@ var require_formats2 = /* @__PURE__ */ __commonJSMin(((exports) => { }; } exports.fullFormats = { - date: fmtDef(date6, compareDate), + date: fmtDef(date5, compareDate), time: fmtDef(getTime(true), compareTime), "date-time": fmtDef(getDateTime(true), compareDateTime), "iso-time": fmtDef(getTime(), compareIsoTime), @@ -125648,7 +125648,7 @@ var require_formats2 = /* @__PURE__ */ __commonJSMin(((exports) => { 30, 31 ]; - function date6(str$1) { + function date5(str$1) { const matches = DATE.exec(str$1); if (!matches) return false; const year = +matches[1]; @@ -125704,7 +125704,7 @@ var require_formats2 = /* @__PURE__ */ __commonJSMin(((exports) => { const time$2 = getTime(strictTimeZone); return function date_time(str$1) { const dateTime = str$1.split(DATE_TIME_SEPARATOR); - return dateTime.length === 2 && date6(dateTime[0]) && time$2(dateTime[1]); + return dateTime.length === 2 && date5(dateTime[0]) && time$2(dateTime[1]); }; } function compareDateTime(dt1, dt2) { @@ -125782,7 +125782,7 @@ var require_limit2 = /* @__PURE__ */ __commonJSMin(((exports) => { fail: ops.LTE } }; - const error50 = { + const error49 = { message: ({ keyword, schemaCode }) => (0, codegen_1$1.str)`should be ${KWDs[keyword].okStr} ${schemaCode}`, params: ({ keyword, schemaCode }) => (0, codegen_1$1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}` }; @@ -125791,7 +125791,7 @@ var require_limit2 = /* @__PURE__ */ __commonJSMin(((exports) => { type: "string", schemaType: "string", $data: true, - error: error50, + error: error49, code(cxt) { const { gen, data, schemaCode, keyword, it } = cxt; const { opts, self: self2 } = it; @@ -125853,11 +125853,11 @@ var require_dist2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { if (!f) throw new Error(`Unknown format "${name}"`); return f; }; - function addFormats(ajv, list, fs5, exportName) { + function addFormats(ajv, list, fs3, exportName) { var _a2; var _b; (_a2 = (_b = ajv.opts.code).formats) !== null && _a2 !== void 0 || (_b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`); - for (const f of list) ajv.addFormat(f, fs5[f]); + for (const f of list) ajv.addFormat(f, fs3[f]); } module.exports = exports = formatsPlugin; Object.defineProperty(exports, "__esModule", { value: true }); @@ -126096,11 +126096,11 @@ var EventSource = class extends EventTarget { return; } const decoder = new TextDecoder(), reader = body.getReader(); - let open2 = true; + let open = true; do { const { done, value: value2 } = await reader.read(); - value2 && __privateGet(this, _parser).feed(decoder.decode(value2, { stream: !done })), done && (open2 = false, __privateGet(this, _parser).reset(), __privateMethod(this, _EventSource_instances, scheduleReconnect_fn).call(this)); - } while (open2); + value2 && __privateGet(this, _parser).feed(decoder.decode(value2, { stream: !done })), done && (open = false, __privateGet(this, _parser).reset(), __privateMethod(this, _EventSource_instances, scheduleReconnect_fn).call(this)); + } while (open); }), __privateAdd(this, _onFetchError, (err) => { __privateSet(this, _controller, void 0), !(err.name === "AbortError" || err.type === "aborted") && __privateMethod(this, _EventSource_instances, scheduleReconnect_fn).call(this, flattenError3(err)); }), __privateAdd(this, _onEvent, (event) => { @@ -126477,8 +126477,8 @@ var EventSourceParserStream = class extends TransformStream { onEvent: (event) => { controller.enqueue(event); }, - onError(error50) { - onError === "terminate" ? controller.error(error50) : typeof onError == "function" && onError(error50); + onError(error49) { + onError === "terminate" ? controller.error(error49) : typeof onError == "function" && onError(error49); }, onRetry, onComment @@ -126644,7 +126644,7 @@ var FastMCPSession = class extends FastMCPSessionEventEmitter { tools, transportType, utils, - version: version4 + version: version3 }) { super(); this.#auth = auth2; @@ -126668,7 +126668,7 @@ var FastMCPSession = class extends FastMCPSessionEventEmitter { this.#capabilities.logging = {}; this.#capabilities.completions = {}; this.#server = new Server( - { name, version: version4 }, + { name, version: version3 }, { capabilities: this.#capabilities, instructions } ); this.#utils = utils; @@ -126702,8 +126702,8 @@ var FastMCPSession = class extends FastMCPSessionEventEmitter { } try { await this.#server.close(); - } catch (error50) { - this.#logger.error("[FastMCP error]", "could not close server", error50); + } catch (error49) { + this.#logger.error("[FastMCP error]", "could not close server", error49); } } async connect(transport) { @@ -126780,13 +126780,13 @@ ${e instanceof Error ? e.stack : JSON.stringify(e)}` } this.#connectionState = "ready"; this.emit("ready"); - } catch (error50) { + } catch (error49) { this.#connectionState = "error"; const errorEvent = { - error: error50 instanceof Error ? error50 : new Error(String(error50)) + error: error49 instanceof Error ? error49 : new Error(String(error49)) }; this.emit("error", errorEvent); - throw error50; + throw error49; } } promptsListChanged(prompts) { @@ -126828,11 +126828,11 @@ ${e instanceof Error ? e.stack : JSON.stringify(e)}` await this.#server.notification({ method }); - } catch (error50) { + } catch (error49) { this.#logger.error( `[FastMCP error] failed to send ${method} notification. -${error50 instanceof Error ? error50.stack : JSON.stringify(error50)}` +${error49 instanceof Error ? error49.stack : JSON.stringify(error49)}` ); } } @@ -127007,8 +127007,8 @@ ${error50 instanceof Error ? error50.stack : JSON.stringify(error50)}` }); } setupErrorHandling() { - this.#server.onerror = (error50) => { - this.#logger.error("[FastMCP error]", error50); + this.#server.onerror = (error49) => { + this.#logger.error("[FastMCP error]", error49); }; } setupLoggingHandlers() { @@ -127062,8 +127062,8 @@ ${error50 instanceof Error ? error50.stack : JSON.stringify(error50)}` args3, this.#auth ); - } catch (error50) { - const errorMessage = error50 instanceof Error ? error50.message : String(error50); + } catch (error49) { + const errorMessage = error49 instanceof Error ? error49.message : String(error49); throw new McpError( ErrorCode.InternalError, `Failed to load prompt '${request2.params.name}': ${errorMessage}` @@ -127145,8 +127145,8 @@ ${error50 instanceof Error ? error50.stack : JSON.stringify(error50)}` let maybeArrayResult; try { maybeArrayResult = await resource.load(this.#auth); - } catch (error50) { - const errorMessage = error50 instanceof Error ? error50.message : String(error50); + } catch (error49) { + const errorMessage = error49 instanceof Error ? error49.message : String(error49); throw new McpError( ErrorCode.InternalError, `Failed to load resource '${resource.name}' (${resource.uri}): ${errorMessage}`, @@ -127211,8 +127211,8 @@ ${error50 instanceof Error ? error50.stack : JSON.stringify(error50)}` this.emit("rootsChanged", { roots: roots.roots }); - }).catch((error50) => { - if (error50 instanceof McpError && error50.code === ErrorCode.MethodNotFound) { + }).catch((error49) => { + if (error49 instanceof McpError && error49.code === ErrorCode.MethodNotFound) { this.#logger.debug( "[FastMCP debug] listRoots method not supported by client" ); @@ -127220,7 +127220,7 @@ ${error50 instanceof Error ? error50.stack : JSON.stringify(error50)}` this.#logger.error( `[FastMCP error] received error listing roots. -${error50 instanceof Error ? error50.stack : JSON.stringify(error50)}` +${error49 instanceof Error ? error49.stack : JSON.stringify(error49)}` ); } }); @@ -127272,9 +127272,9 @@ ${error50 instanceof Error ? error50.stack : JSON.stringify(error50)}` request2.params.arguments ); if (parsed2.issues) { - const friendlyErrors = this.#utils?.formatInvalidParamsErrorMessage ? this.#utils.formatInvalidParamsErrorMessage(parsed2.issues) : parsed2.issues.map((issue4) => { - const path4 = issue4.path?.join(".") || "root"; - return `${path4}: ${issue4.message}`; + const friendlyErrors = this.#utils?.formatInvalidParamsErrorMessage ? this.#utils.formatInvalidParamsErrorMessage(parsed2.issues) : parsed2.issues.map((issue3) => { + const path3 = issue3.path?.join(".") || "root"; + return `${path3}: ${issue3.message}`; }).join(", "); throw new McpError( ErrorCode.InvalidParams, @@ -127403,15 +127403,15 @@ ${error50 instanceof Error ? error50.stack : JSON.stringify(error50)}` } else { result = ContentResultZodSchema.parse(maybeStringResult); } - } catch (error50) { - if (error50 instanceof UserError) { + } catch (error49) { + if (error49 instanceof UserError) { return { - content: [{ text: error50.message, type: "text" }], + content: [{ text: error49.message, type: "text" }], isError: true, - ...error50.extras ? { structuredContent: error50.extras } : {} + ...error49.extras ? { structuredContent: error49.extras } : {} }; } - const errorMessage = error50 instanceof Error ? error50.message : String(error50); + const errorMessage = error49 instanceof Error ? error49.message : String(error49); return { content: [ { @@ -127707,8 +127707,8 @@ var FastMCP = class extends FastMCPEventEmitter { * Starts the server. */ async start(options) { - const config4 = this.#parseRuntimeConfig(options); - if (config4.transportType === "stdio") { + const config3 = this.#parseRuntimeConfig(options); + if (config3.transportType === "stdio") { const transport = new StdioServerTransport(); let auth2; if (this.#authenticate) { @@ -127716,10 +127716,10 @@ var FastMCP = class extends FastMCPEventEmitter { auth2 = await this.#authenticate( void 0 ); - } catch (error50) { + } catch (error49) { this.#logger.error( "[FastMCP error] Authentication failed for stdio transport:", - error50 instanceof Error ? error50.message : String(error50) + error49 instanceof Error ? error49.message : String(error49) ); } } @@ -127760,8 +127760,8 @@ var FastMCP = class extends FastMCPEventEmitter { session }); this.#serverState = "running"; - } else if (config4.transportType === "httpStream") { - const httpConfig = config4.httpStream; + } else if (config3.transportType === "httpStream") { + const httpConfig = config3.httpStream; if (httpConfig.stateless) { this.#logger.info( `[FastMCP info] Starting server in stateless mode on HTTP Stream at http://${httpConfig.host}:${httpConfig.port}${httpConfig.endpoint}` @@ -127912,10 +127912,10 @@ var FastMCP = class extends FastMCPEventEmitter { const healthConfig = this.#options.health ?? {}; const enabled = healthConfig.enabled === void 0 ? true : healthConfig.enabled; if (enabled) { - const path4 = healthConfig.path ?? "/health"; + const path3 = healthConfig.path ?? "/health"; const url4 = new URL(req.url || "", `http://${host}`); try { - if (req.method === "GET" && url4.pathname === path4) { + if (req.method === "GET" && url4.pathname === path3) { res.writeHead(healthConfig.status ?? 200, { "Content-Type": "text/plain" }).end(healthConfig.message ?? "\u2713 Ok"); @@ -127949,8 +127949,8 @@ var FastMCP = class extends FastMCPEventEmitter { } return; } - } catch (error50) { - this.#logger.error("[FastMCP error] health endpoint error", error50); + } catch (error49) { + this.#logger.error("[FastMCP error] health endpoint error", error49); } } const oauthConfig = this.#options.oauth; @@ -127996,11 +127996,11 @@ var FastMCP = class extends FastMCPEventEmitter { const request2 = JSON.parse(body); const response = await oauthProxy.registerClient(request2); res.writeHead(201, { "Content-Type": "application/json" }).end(JSON.stringify(response)); - } catch (error50) { - const statusCode = error50.statusCode || 400; + } catch (error49) { + const statusCode = error49.statusCode || 400; res.writeHead(statusCode, { "Content-Type": "application/json" }).end( JSON.stringify( - error50.toJSON?.() || { + error49.toJSON?.() || { error: "invalid_request" } ) @@ -128022,10 +128022,10 @@ var FastMCP = class extends FastMCPEventEmitter { const html = await response.text(); res.writeHead(response.status, { "Content-Type": "text/html" }).end(html); } - } catch (error50) { + } catch (error49) { res.writeHead(400, { "Content-Type": "application/json" }).end( JSON.stringify( - error50.toJSON?.() || { + error49.toJSON?.() || { error: "invalid_request" } ) @@ -128044,10 +128044,10 @@ var FastMCP = class extends FastMCPEventEmitter { const text = await response.text(); res.writeHead(response.status).end(text); } - } catch (error50) { + } catch (error49) { res.writeHead(400, { "Content-Type": "application/json" }).end( JSON.stringify( - error50.toJSON?.() || { + error49.toJSON?.() || { error: "server_error" } ) @@ -128075,10 +128075,10 @@ var FastMCP = class extends FastMCPEventEmitter { const text = await response.text(); res.writeHead(response.status).end(text); } - } catch (error50) { + } catch (error49) { res.writeHead(400, { "Content-Type": "application/json" }).end( JSON.stringify( - error50.toJSON?.() || { + error49.toJSON?.() || { error: "server_error" } ) @@ -128122,11 +128122,11 @@ var FastMCP = class extends FastMCPEventEmitter { }; } res.writeHead(200, { "Content-Type": "application/json" }).end(JSON.stringify(response)); - } catch (error50) { - const statusCode = error50.statusCode || 400; + } catch (error49) { + const statusCode = error49.statusCode || 400; res.writeHead(statusCode, { "Content-Type": "application/json" }).end( JSON.stringify( - error50.toJSON?.() || { + error49.toJSON?.() || { error: "invalid_request" } ) @@ -128135,8 +128135,8 @@ var FastMCP = class extends FastMCPEventEmitter { }); return; } - } catch (error50) { - this.#logger.error("[FastMCP error] OAuth Proxy endpoint error", error50); + } catch (error49) { + this.#logger.error("[FastMCP error] OAuth Proxy endpoint error", error49); res.writeHead(500).end(); return; } @@ -128278,26 +128278,26 @@ var ArkError = class _ArkError extends CastableBase { get expected() { if (this.input.expected) return this.input.expected; - const config4 = this.meta?.expected ?? this.nodeConfig.expected; - return typeof config4 === "function" ? config4(this.input) : config4; + const config3 = this.meta?.expected ?? this.nodeConfig.expected; + return typeof config3 === "function" ? config3(this.input) : config3; } get actual() { if (this.input.actual) return this.input.actual; - const config4 = this.meta?.actual ?? this.nodeConfig.actual; - return typeof config4 === "function" ? config4(this.data) : config4; + const config3 = this.meta?.actual ?? this.nodeConfig.actual; + return typeof config3 === "function" ? config3(this.data) : config3; } get problem() { if (this.input.problem) return this.input.problem; - const config4 = this.meta?.problem ?? this.nodeConfig.problem; - return typeof config4 === "function" ? config4(this) : config4; + const config3 = this.meta?.problem ?? this.nodeConfig.problem; + return typeof config3 === "function" ? config3(this) : config3; } get message() { if (this.input.message) return this.input.message; - const config4 = this.meta?.message ?? this.nodeConfig.message; - return typeof config4 === "function" ? config4(this) : config4; + const config3 = this.meta?.message ?? this.nodeConfig.message; + return typeof config3 === "function" ? config3(this) : config3; } get flat() { return this.hasCode("intersection") ? [...this.errors] : [this]; @@ -128369,25 +128369,25 @@ var ArkErrors = class _ArkErrors extends ReadonlyArray { /** * Append an ArkError to this array, ignoring duplicates. */ - add(error50) { - const existing = this.byPath[error50.propString]; + add(error49) { + const existing = this.byPath[error49.propString]; if (existing) { - if (error50 === existing) + if (error49 === existing) return; if (existing.hasCode("union") && existing.errors.length === 0) return; - const errorIntersection = error50.hasCode("union") && error50.errors.length === 0 ? error50 : new ArkError({ + const errorIntersection = error49.hasCode("union") && error49.errors.length === 0 ? error49 : new ArkError({ code: "intersection", - errors: existing.hasCode("intersection") ? [...existing.errors, error50] : [existing, error50] + errors: existing.hasCode("intersection") ? [...existing.errors, error49] : [existing, error49] }, this.ctx); const existingIndex = this.indexOf(existing); this.mutable[existingIndex === -1 ? this.length : existingIndex] = errorIntersection; - this.byPath[error50.propString] = errorIntersection; - this.addAncestorPaths(error50); + this.byPath[error49.propString] = errorIntersection; + this.addAncestorPaths(error49); } else { - this.byPath[error50.propString] = error50; - this.addAncestorPaths(error50); - this.mutable.push(error50); + this.byPath[error49.propString] = error49; + this.addAncestorPaths(error49); + this.mutable.push(error49); } this.count++; } @@ -128409,15 +128409,15 @@ var ArkErrors = class _ArkErrors extends ReadonlyArray { /** * @internal */ - affectsPath(path4) { + affectsPath(path3) { if (this.length === 0) return false; return ( // this would occur if there is an existing error at a prefix of path // e.g. the path is ["foo", "bar"] and there is an error at ["foo"] - path4.stringifyAncestors().some((s) => s in this.byPath) || // this would occur if there is an existing error at a suffix of path + path3.stringifyAncestors().some((s) => s in this.byPath) || // this would occur if there is an existing error at a suffix of path // e.g. the path is ["foo"] and there is an error at ["foo", "bar"] - path4.stringify() in this.byAncestorPath + path3.stringify() in this.byAncestorPath ); } /** @@ -128438,9 +128438,9 @@ var ArkErrors = class _ArkErrors extends ReadonlyArray { toString() { return this.join("\n"); } - addAncestorPaths(error50) { - for (const propString of error50.path.stringifyAncestors()) { - this.byAncestorPath[propString] = append(this.byAncestorPath[propString], error50); + addAncestorPaths(error49) { + for (const propString of error49.path.stringifyAncestors()) { + this.byAncestorPath[propString] = append(this.byAncestorPath[propString], error49); } } }; @@ -128450,14 +128450,14 @@ var TraversalError = class extends Error { if (errors.length === 1) super(errors.summary); else - super("\n" + errors.map((error50) => ` \u2022 ${indent(error50)}`).join("\n")); + super("\n" + errors.map((error49) => ` \u2022 ${indent(error49)}`).join("\n")); Object.defineProperty(this, "arkErrors", { value: errors, enumerable: false }); } }; -var indent = (error50) => error50.toString().split("\n").join("\n "); +var indent = (error49) => error49.toString().split("\n").join("\n "); // node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/shared/traversal.js var Traversal = class { @@ -128490,9 +128490,9 @@ var Traversal = class { queuedMorphs = []; branches = []; seen = {}; - constructor(root2, config4) { - this.root = root2; - this.config = config4; + constructor(root, config3) { + this.root = root; + this.config = config3; } /** * #### the data being validated or morphed @@ -128593,34 +128593,34 @@ var Traversal = class { return this.errorFromContext(input); } errorFromContext(errCtx) { - const error50 = new ArkError(errCtx, this); + const error49 = new ArkError(errCtx, this); if (this.currentBranch) - this.currentBranch.error = error50; + this.currentBranch.error = error49; else - this.errors.add(error50); - return error50; + this.errors.add(error49); + return error49; } applyQueuedMorphs() { while (this.queuedMorphs.length) { const queuedMorphs = this.queuedMorphs; this.queuedMorphs = []; - for (const { path: path4, morphs } of queuedMorphs) { - if (this.errors.affectsPath(path4)) + for (const { path: path3, morphs } of queuedMorphs) { + if (this.errors.affectsPath(path3)) continue; - this.applyMorphsAtPath(path4, morphs); + this.applyMorphsAtPath(path3, morphs); } } } - applyMorphsAtPath(path4, morphs) { - const key = path4[path4.length - 1]; + applyMorphsAtPath(path3, morphs) { + const key = path3[path3.length - 1]; let parent; if (key !== void 0) { parent = this.root; - for (let pathIndex = 0; pathIndex < path4.length - 1; pathIndex++) - parent = parent[path4[pathIndex]]; + for (let pathIndex = 0; pathIndex < path3.length - 1; pathIndex++) + parent = parent[path3[pathIndex]]; } for (const morph of morphs) { - this.path = [...path4]; + this.path = [...path3]; const morphIsNode = isNode(morph); const result = morph(parent === void 0 ? this.root : parent[key], this); if (result instanceof ArkError) { @@ -128742,10 +128742,10 @@ var BaseNode = class extends Callable { }; case "optimistic": this.contextFreeMorph = this.shallowMorphs[0]; - const clone4 = this.$.resolvedConfig.clone; + const clone3 = this.$.resolvedConfig.clone; return (data, onFail) => { if (this.allows(data)) { - return this.contextFreeMorph(clone4 && (typeof data === "object" && data !== null || typeof data === "function") ? clone4(data) : data); + return this.contextFreeMorph(clone3 && (typeof data === "object" && data !== null || typeof data === "function") ? clone3(data) : data); } const ctx = new Traversal(data, this.$.resolvedConfig); this.traverseApply(data, ctx); @@ -128996,15 +128996,15 @@ var NodeSelector = { normalize: (selector) => typeof selector === "function" ? { boundary: "references", method: "filter", where: selector } : typeof selector === "string" ? isKeyOf(selector, NodeSelector.applyBoundary) ? { method: "filter", boundary: selector } : { boundary: "references", method: "filter", kind: selector } : { boundary: "references", method: "filter", ...selector } }; var writeSelectAssertionMessage = (from, selector) => `${from} had no references matching ${printable(selector)}.`; -var typePathToPropString = (path4) => stringifyPath(path4, { +var typePathToPropString = (path3) => stringifyPath(path3, { stringifyNonKey: (node2) => node2.expression }); var referenceMatcher = /"(\$ark\.[^"]+)"/g; var compileMeta = (metaJson) => JSON.stringify(metaJson).replace(referenceMatcher, "$1"); -var flatRef = (path4, node2) => ({ - path: path4, +var flatRef = (path3, node2) => ({ + path: path3, node: node2, - propString: typePathToPropString(path4) + propString: typePathToPropString(path3) }); var flatRefsAreEqual = (l, r) => l.propString === r.propString && l.node.equals(r.node); var appendUniqueFlatRefs = (existing, refs) => appendUnique(existing, refs, { @@ -129040,12 +129040,12 @@ var Disjoint = class _Disjoint extends Array { } describeReasons() { if (this.length === 1) { - const { path: path4, l, r } = this[0]; - const pathString = stringifyPath(path4); + const { path: path3, l, r } = this[0]; + const pathString = stringifyPath(path3); return writeUnsatisfiableExpressionError(`Intersection${pathString && ` at ${pathString}`} of ${describeReasons(l, r)}`); } return `The following intersections result in unsatisfiable types: -\u2022 ${this.map(({ path: path4, l, r }) => `${path4}: ${describeReasons(l, r)}`).join("\n\u2022 ")}`; +\u2022 ${this.map(({ path: path3, l, r }) => `${path3}: ${describeReasons(l, r)}`).join("\n\u2022 ")}`; } throw() { return throwParseError(this.describeReasons()); @@ -129241,10 +129241,10 @@ var intersectConstraints = (s) => { const head = s.r.shift(); if (!head) { let result = s.l.length === 0 && s.kind === "structure" ? $ark.intrinsic.unknown.internal : s.ctx.$.node(s.kind, Object.assign(s.baseInner, unflattenConstraints(s.l)), { prereduced: true }); - for (const root2 of s.roots) { + for (const root of s.roots) { if (result instanceof Disjoint) return result; - result = intersectOrPipeNodes(root2, result, s.ctx); + result = intersectOrPipeNodes(root, result, s.ctx); } return result; } @@ -129566,7 +129566,7 @@ var operandKindsByBoundKind = { }; var compileComparator = (kind, exclusive) => `${isKeyOf(kind, boundKindPairsByLower) ? ">" : "<"}${exclusive ? "" : "="}`; var dateLimitToString = (limit) => typeof limit === "string" ? limit : new Date(limit).toLocaleString(); -var writeUnboundableMessage = (root2) => `Bounded expression ${root2} must be exactly one of number, string, Array, or Date`; +var writeUnboundableMessage = (root) => `Bounded expression ${root} must be exactly one of number, string, Array, or Date`; // node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/refinements/after.js var implementation3 = implementNode({ @@ -130442,10 +130442,10 @@ var BaseRoot = class extends BaseNode { }); }); } - get(...path4) { - if (path4[0] === void 0) + get(...path3) { + if (path3[0] === void 0) return this; - return this.$.schema(this.applyStructuralOperation("get", path4)); + return this.$.schema(this.applyStructuralOperation("get", path3)); } extract(r) { const rNode = this.$.parseDefinition(r); @@ -130462,14 +130462,14 @@ var BaseRoot = class extends BaseNode { }, { prereduced: true }); } overlaps(r) { - const intersection4 = this.intersect(r); - return !(intersection4 instanceof Disjoint); + const intersection3 = this.intersect(r); + return !(intersection3 instanceof Disjoint); } extends(r) { if (this.isNever()) return true; - const intersection4 = this.intersect(r); - return !(intersection4 instanceof Disjoint) && this.equals(intersection4); + const intersection3 = this.intersect(r); + return !(intersection3 instanceof Disjoint) && this.equals(intersection3); } ifExtends(r) { return this.extends(r) ? this : void 0; @@ -130524,8 +130524,8 @@ var BaseRoot = class extends BaseNode { to(def) { return this.$.finalize(this.toNode(this.$.parseDefinition(def))); } - toNode(root2) { - const result = pipeNodesRoot(this, root2, this.$); + toNode(root) { + const result = pipeNodesRoot(this, root, this.$); if (result instanceof Disjoint) return result.throw(); return result; @@ -130819,7 +130819,7 @@ var implementation13 = implementNode({ numberAllowsNaN: {} }, normalize: (schema2) => typeof schema2 === "string" ? { domain: schema2 } : hasKey(schema2, "numberAllowsNaN") && schema2.domain !== "number" ? throwParseError(Domain.writeBadAllowNanMessage(schema2.domain)) : schema2, - applyConfig: (schema2, config4) => schema2.numberAllowsNaN === void 0 && schema2.domain === "number" && config4.numberAllowsNaN ? { ...schema2, numberAllowsNaN: true } : schema2, + applyConfig: (schema2, config3) => schema2.numberAllowsNaN === void 0 && schema2.domain === "number" && config3.numberAllowsNaN ? { ...schema2, numberAllowsNaN: true } : schema2, defaults: { description: (node2) => domainDescriptions[node2.domain], actual: (data) => Number.isNaN(data) ? "NaN" : domainDescriptions[domainOf(data)] @@ -131279,8 +131279,8 @@ var implementation16 = implementNode({ throwParseError(Proto.writeBadInvalidDateMessage(normalized.proto)); return normalized; }, - applyConfig: (schema2, config4) => { - if (schema2.dateAllowsInvalid === void 0 && schema2.proto === Date && config4.dateAllowsInvalid) + applyConfig: (schema2, config3) => { + if (schema2.dateAllowsInvalid === void 0 && schema2.proto === Date && config3.dateAllowsInvalid) return { ...schema2, dateAllowsInvalid: true }; return schema2; }, @@ -131387,13 +131387,13 @@ var implementation17 = implementNode({ description: (node2) => node2.distribute((branch) => branch.description, describeBranches), expected: (ctx) => { const byPath = groupBy(ctx.errors, "propString"); - const pathDescriptions = Object.entries(byPath).map(([path4, errors]) => { + const pathDescriptions = Object.entries(byPath).map(([path3, errors]) => { const branchesAtPath = []; for (const errorAtPath of errors) appendUnique(branchesAtPath, errorAtPath.expected); const expected = describeBranches(branchesAtPath); const actual = errors.every((e) => e.actual === errors[0].actual) ? errors[0].actual : printable(errors[0].data); - return `${path4 && `${path4} `}must be ${expected}${actual && ` (was ${actual})`}`; + return `${path3 && `${path3} `}must be ${expected}${actual && ` (was ${actual})`}`; }); return describeBranches(pathDescriptions); }, @@ -131775,10 +131775,10 @@ var viableOrderedCandidates = (candidates, originalBranches) => { }); return viableCandidates; }; -var discriminantCaseToNode = (caseDiscriminant, path4, $2) => { +var discriminantCaseToNode = (caseDiscriminant, path3, $2) => { let node2 = caseDiscriminant === "undefined" ? $2.node("unit", { unit: void 0 }) : caseDiscriminant === "null" ? $2.node("unit", { unit: null }) : caseDiscriminant === "boolean" ? $2.units([true, false]) : caseDiscriminant; - for (let i = path4.length - 1; i >= 0; i--) { - const key = path4[i]; + for (let i = path3.length - 1; i >= 0; i--) { + const key = path3[i]; node2 = $2.node("intersection", typeof key === "number" ? { proto: "Array", // create unknown for preceding elements (could be optimized with safe imports) @@ -131790,7 +131790,7 @@ var discriminantCaseToNode = (caseDiscriminant, path4, $2) => { } return node2; }; -var optionallyChainPropString = (path4) => path4.reduce((acc, k) => acc + compileLiteralPropAccess(k, true), "data"); +var optionallyChainPropString = (path3) => path3.reduce((acc, k) => acc + compileLiteralPropAccess(k, true), "data"); var serializedTypeOfDescriptions = registeredReference(jsTypeOfDescriptions); var serializedPrintable = registeredReference(printable); var Union = { @@ -131872,14 +131872,14 @@ var reduceBranches = ({ branches, ordered }) => { uniquenessByIndex[j] = false; continue; } - const intersection4 = intersectNodesRoot(branches[i].rawIn, branches[j].rawIn, branches[0].$); - if (intersection4 instanceof Disjoint) + const intersection3 = intersectNodesRoot(branches[i].rawIn, branches[j].rawIn, branches[0].$); + if (intersection3 instanceof Disjoint) continue; if (!ordered) assertDeterminateOverlap(branches[i], branches[j]); - if (intersection4.equals(branches[i].rawIn)) { + if (intersection3.equals(branches[i].rawIn)) { uniquenessByIndex[i] = !!ordered; - } else if (intersection4.equals(branches[j].rawIn)) + } else if (intersection3.equals(branches[j].rawIn)) uniquenessByIndex[j] = false; } } @@ -132550,11 +132550,11 @@ var implementation22 = implementNode({ kind: "structure", hasAssociatedError: false, normalize: (schema2) => schema2, - applyConfig: (schema2, config4) => { - if (!schema2.undeclared && config4.onUndeclaredKey !== "ignore") { + applyConfig: (schema2, config3) => { + if (!schema2.undeclared && config3.onUndeclaredKey !== "ignore") { return { ...schema2, - undeclared: config4.onUndeclaredKey + undeclared: config3.onUndeclaredKey }; } return schema2; @@ -132702,9 +132702,9 @@ var implementation22 = implementNode({ seen[requiredProp.key] = true; if (inner.index) { for (const index of inner.index) { - const intersection4 = intersectPropsAndIndex(requiredProp, index, $2); - if (intersection4 instanceof Disjoint) - return intersection4; + const intersection3 = intersectPropsAndIndex(requiredProp, index, $2); + if (intersection3 instanceof Disjoint) + return intersection3; } } } @@ -132717,11 +132717,11 @@ var implementation22 = implementNode({ seen[optionalProp.key] = true; if (inner.index) { for (const index of inner.index) { - const intersection4 = intersectPropsAndIndex(optionalProp, index, $2); - if (intersection4 instanceof Disjoint) - return intersection4; - if (intersection4 !== null) { - newOptionalProps[i] = intersection4; + const intersection3 = intersectPropsAndIndex(optionalProp, index, $2); + if (intersection3 instanceof Disjoint) + return intersection3; + if (intersection3 !== null) { + newOptionalProps[i] = intersection3; updated = true; } } @@ -132776,13 +132776,13 @@ var StructureNode = class extends BaseConstraint { return throwParseError(writeInvalidKeysMessage(this.expression, invalidKeys)); } } - get(indexer, ...path4) { + get(indexer, ...path3) { let value2; - let required4 = false; + let required3 = false; const key = indexerToKey(indexer); if ((typeof key === "string" || typeof key === "symbol") && this.propsByKey[key]) { value2 = this.propsByKey[key].value; - required4 = this.propsByKey[key].required; + required3 = this.propsByKey[key].required; } if (this.index) { for (const n of this.index) { @@ -132799,7 +132799,7 @@ var StructureNode = class extends BaseConstraint { if (index < this.sequence.prevariadic.length) { const fixedElement = this.sequence.prevariadic[index].node; value2 = value2?.and(fixedElement) ?? fixedElement; - required4 ||= index < this.sequence.prefixLength; + required3 ||= index < this.sequence.prefixLength; } else if (this.sequence.variadic) { const nonFixedElement = this.$.node("union", this.sequence.variadicOrPostfix); value2 = value2?.and(nonFixedElement) ?? nonFixedElement; @@ -132812,8 +132812,8 @@ var StructureNode = class extends BaseConstraint { } return throwParseError(writeInvalidKeysMessage(this.expression, [key])); } - const result = value2.get(...path4); - return required4 ? result : result.or($ark.intrinsic.undefined); + const result = value2.get(...path3); + return required3 ? result : result.or($ark.intrinsic.undefined); } pick(...keys) { this.assertHasKeys(keys); @@ -132824,14 +132824,14 @@ var StructureNode = class extends BaseConstraint { return this.$.node("structure", this.filterKeys("omit", keys)); } optionalize() { - const { required: required4, ...inner } = this.inner; + const { required: required3, ...inner } = this.inner; return this.$.node("structure", { ...inner, optional: this.props.map((prop) => prop.hasKind("required") ? this.$.node("optional", prop.inner) : prop) }); } require() { - const { optional: optional4, ...inner } = this.inner; + const { optional: optional3, ...inner } = this.inner; return this.$.node("structure", { ...inner, required: this.props.map((prop) => prop.hasKind("optional") ? { @@ -133329,9 +133329,9 @@ var BaseScope = class { resolved = false; nodesByHash = {}; intrinsic; - constructor(def, config4) { - this.config = mergeConfigs($ark.config, config4); - this.resolvedConfig = mergeConfigs($ark.resolvedConfig, config4); + constructor(def, config3) { + this.config = mergeConfigs($ark.config, config3); + this.resolvedConfig = mergeConfigs($ark.resolvedConfig, config3); this.name = this.resolvedConfig.name ?? `anonymousScope${Object.keys(scopesByName).length}`; if (this.name in scopesByName) throwParseError(`A Scope already named ${this.name} already exists`); @@ -133481,11 +133481,11 @@ var BaseScope = class { return $ark.ambient; } maybeResolve(name) { - const cached6 = this.resolutions[name]; - if (cached6) { - if (typeof cached6 !== "string") - return this.bindReference(cached6); - const v = nodesByRegisteredId[cached6]; + const cached5 = this.resolutions[name]; + if (cached5) { + if (typeof cached5 !== "string") + return this.bindReference(cached5); + const v = nodesByRegisteredId[cached5]; if (hasArkKind(v, "root")) return this.resolutions[name] = v; if (hasArkKind(v, "context")) { @@ -133502,7 +133502,7 @@ var BaseScope = class { nodesByRegisteredId[v.id] = node2; return this.resolutions[name] = node2; } - return throwInternalError(`Unexpected nodesById entry for ${cached6}: ${printable(v)}`); + return throwInternalError(`Unexpected nodesById entry for ${cached5}: ${printable(v)}`); } let def = this.aliases[name] ?? this.ambient?.[name]; if (!def) @@ -133528,8 +133528,8 @@ var BaseScope = class { phase: "unresolved" }); } - traversal(root2) { - return new Traversal(root2, this.resolvedConfig); + traversal(root) { + return new Traversal(root, this.resolvedConfig); } import(...names) { return new RootModule(flatMorph(this.export(...names), (alias, value2) => [ @@ -133650,7 +133650,7 @@ var maybeResolveSubalias = (base, name) => { } throwInternalError(`Unexpected resolution for alias '${name}': ${printable(resolution)}`); }; -var schemaScope = (aliases, config4) => new SchemaScope(aliases, config4); +var schemaScope = (aliases, config3) => new SchemaScope(aliases, config3); var rootSchemaScope = new SchemaScope({}); var resolutionsOfModule = ($2, typeSet) => { const result = {}; @@ -133742,7 +133742,7 @@ Object.assign(regex, { as: regex }); // node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/parser/shift/operand/date.js var isDateLiteral = (value2) => typeof value2 === "string" && value2[0] === "d" && (value2[1] === "'" || value2[1] === '"') && value2[value2.length - 1] === value2[1]; var isValidDate = (d) => d.toString() !== "Invalid Date"; -var extractDateLiteralSource = (literal4) => literal4.slice(2, -1); +var extractDateLiteralSource = (literal3) => literal3.slice(2, -1); var writeInvalidDateMessage = (source) => `'${source}' could not be parsed by the Date constructor`; var tryParseDate = (source, errorOnFail) => maybeParseDate(source, errorOnFail); var maybeParseDate = (source, errorOnFail) => { @@ -133793,8 +133793,8 @@ var parseEnclosed = (s, enclosing) => { } else if (isKeyOf(enclosing, enclosingQuote)) s.root = s.ctx.$.node("unit", { unit: enclosed }); else { - const date6 = tryParseDate(enclosed, writeInvalidDateMessage(enclosed)); - s.root = s.ctx.$.node("unit", { meta: enclosed, unit: date6 }); + const date5 = tryParseDate(enclosed, writeInvalidDateMessage(enclosed)); + s.root = s.ctx.$.node("unit", { meta: enclosed, unit: date5 }); } }; var enclosingQuote = { @@ -133957,9 +133957,9 @@ var parseBound = (s, start) => { return; } if (s.root.unit instanceof Date) { - const literal4 = `d'${s.root.description ?? s.root.unit.toISOString()}'`; + const literal3 = `d'${s.root.description ?? s.root.unit.toISOString()}'`; s.unsetRoot(); - s.reduceLeftBound(literal4, comparator); + s.reduceLeftBound(literal3, comparator); return; } } @@ -133971,23 +133971,23 @@ var comparatorStartChars = { "=": 1 }; var shiftComparator = (s, start) => s.scanner.lookaheadIs("=") ? `${start}${s.scanner.shift()}` : start; -var getBoundKinds = (comparator, limit, root2, boundKind) => { - if (root2.extends($ark.intrinsic.number)) { +var getBoundKinds = (comparator, limit, root, boundKind) => { + if (root.extends($ark.intrinsic.number)) { if (typeof limit !== "number") { return throwParseError(writeInvalidLimitMessage(comparator, limit, boundKind)); } return comparator === "==" ? ["min", "max"] : comparator[0] === ">" ? ["min"] : ["max"]; } - if (root2.extends($ark.intrinsic.lengthBoundable)) { + if (root.extends($ark.intrinsic.lengthBoundable)) { if (typeof limit !== "number") { return throwParseError(writeInvalidLimitMessage(comparator, limit, boundKind)); } return comparator === "==" ? ["exactLength"] : comparator[0] === ">" ? ["minLength"] : ["maxLength"]; } - if (root2.extends($ark.intrinsic.Date)) { + if (root.extends($ark.intrinsic.Date)) { return comparator === "==" ? ["after", "before"] : comparator[0] === ">" ? ["after"] : ["before"]; } - return throwParseError(writeUnboundableMessage(root2.expression)); + return throwParseError(writeUnboundableMessage(root.expression)); }; var openLeftBoundToRoot = (leftBound) => ({ rule: isDateLiteral(leftBound.limit) ? extractDateLiteralSource(leftBound.limit) : leftBound.limit, @@ -134121,8 +134121,8 @@ var RuntimeState = class _RuntimeState { hasRoot() { return this.root !== void 0; } - setRoot(root2) { - this.root = root2; + setRoot(root) { + this.root = root; } unsetRoot() { const value2 = this.root; @@ -134189,9 +134189,9 @@ var RuntimeState = class _RuntimeState { pushRootToBranch(token) { this.assertRangeUnset(); this.applyPrefixes(); - const root2 = this.root; + const root = this.root; this.root = void 0; - this.branches.intersection = this.branches.intersection?.rawAnd(root2) ?? root2; + this.branches.intersection = this.branches.intersection?.rawAnd(root) ?? root; if (token === "&") return; this.branches.union = this.branches.union?.rawOr(this.branches.intersection) ?? this.branches.intersection; @@ -134718,12 +134718,12 @@ var parseStandardSchema = (def, ctx) => ctx.$.intrinsic.unknown.pipe((v, ctx2) = const result = def["~standard"].validate(v); if (!result.issues) return result.value; - for (const { message, path: path4 } of result.issues) { - if (path4) { - if (path4.length) { + for (const { message, path: path3 } of result.issues) { + if (path3) { + if (path3.length) { ctx2.error({ problem: uncapitalize(message), - relativePath: path4.map((k) => typeof k === "object" ? k.key : k) + relativePath: path3.map((k) => typeof k === "object" ? k.key : k) }); } else { ctx2.error({ @@ -134804,9 +134804,9 @@ var InternalScope = class _InternalScope extends BaseScope { if (hasArkKind(def, "module") || hasArkKind(def, "generic")) return [alias, def]; const qualifiedName = this.name === "ark" ? alias : alias === "root" ? this.name : `${this.name}.${alias}`; - const config4 = this.resolvedConfig.keywords?.[qualifiedName]; - if (config4) - def = [def, "@", config4]; + const config3 = this.resolvedConfig.keywords?.[qualifiedName]; + if (config3) + def = [def, "@", config3]; return [alias, def]; } if (alias[alias.length - 1] !== ">") { @@ -134874,8 +134874,8 @@ var InternalScope = class _InternalScope extends BaseScope { return def; } type = new InternalTypeParser(this); - static scope = ((def, config4 = {}) => new _InternalScope(def, config4)); - static module = ((def, config4 = {}) => this.scope(def, config4).export()); + static scope = ((def, config3 = {}) => new _InternalScope(def, config3)); + static module = ((def, config3 = {}) => this.scope(def, config3).export()); }; var scope = Object.assign(InternalScope.scope, { define: (def) => def @@ -135142,10 +135142,10 @@ var stringDate = Scope.module({ declaredIn: parsableDate, in: "string", morphs: (s, ctx) => { - const date6 = new Date(s); - if (Number.isNaN(date6.valueOf())) + const date5 = new Date(s); + if (Number.isNaN(date5.valueOf())) return ctx.error("a parsable date"); - return date6; + return date5; }, declaredOut: intrinsic.Date }), @@ -135176,10 +135176,10 @@ var ip = Scope.module({ name: "string.ip" }); var jsonStringDescription = "a JSON string"; -var writeJsonSyntaxErrorProblem = (error50) => { - if (!(error50 instanceof SyntaxError)) - throw error50; - return `must be ${jsonStringDescription} (${error50})`; +var writeJsonSyntaxErrorProblem = (error49) => { + if (!(error49 instanceof SyntaxError)) + throw error49; + return `must be ${jsonStringDescription} (${error49})`; }; var jsonRoot = rootSchema({ meta: jsonStringDescription, @@ -136130,8 +136130,8 @@ var handleToolSuccess = (data) => { content: [{ type: "text", text }] }; }; -var handleToolError = (error50) => { - const errorMessage = error50 instanceof Error ? error50.message : String(error50); +var handleToolError = (error49) => { + const errorMessage = error49 instanceof Error ? error49.message : String(error49); return { content: [ { @@ -136147,12 +136147,12 @@ var execute = (fn2, toolName) => { try { const result = await fn2(params); return handleToolSuccess(result); - } catch (error50) { - const errorMessage = error50 instanceof Error ? error50.message : String(error50); + } catch (error49) { + const errorMessage = error49 instanceof Error ? error49.message : String(error49); const prefix = toolName ? `[${toolName}]` : "tool"; log.error(`${prefix} error: ${errorMessage}`); log.debug(`${prefix} params: ${formatJsonValue(params)}`); - return handleToolError(error50); + return handleToolError(error49); } }; _fn.raw = fn2; @@ -136304,7 +136304,7 @@ Use this tool to: parameters: BashParams, execute: execute(async (params) => { const timeout = Math.min(params.timeout ?? 12e4, 6e5); - const cwd2 = params.working_directory ?? process.cwd(); + const cwd = params.working_directory ?? process.cwd(); const env3 = filterEnv(); if (params.background) { const tempDir = getTempDir(); @@ -136317,7 +136317,7 @@ Use this tool to: proc2 = spawnBash({ command: params.command, env: env3, - cwd: cwd2, + cwd, stdio: ["ignore", logFd, logFd] }); } finally { @@ -136340,7 +136340,7 @@ Use this tool to: const proc = spawnBash({ command: params.command, env: env3, - cwd: cwd2, + cwd, stdio: ["ignore", "pipe", "pipe"] }); let stdout = "", stderr = "", timedOut = false, exited = false; @@ -136802,8 +136802,8 @@ function GetCheckSuiteLogsTool(ctx) { full_log_path: logPath }); log.debug(`analyzed logs for job ${job.name}: ${analysis.index.length} indexed lines`); - } catch (error50) { - log.error(`failed to fetch logs for job ${job.id}: ${error50}`); + } catch (error49) { + log.error(`failed to fetch logs for job ${job.id}: ${error49}`); } } } @@ -136903,12 +136903,12 @@ async function doRequest(state, request2, options) { const req = (isAuth ? state.auth : state.global).key(state.id).schedule(jobOptions, request2, options); if (isGraphQL) { const res = await req; - if (res.data.errors != null && res.data.errors.some((error50) => error50.type === "RATE_LIMITED")) { - const error50 = Object.assign(new Error("GraphQL Rate Limit Exceeded"), { + if (res.data.errors != null && res.data.errors.some((error49) => error49.type === "RATE_LIMITED")) { + const error49 = Object.assign(new Error("GraphQL Rate Limit Exceeded"), { response: res, data: res.data }); - throw error50; + throw error49; } } return req; @@ -136943,7 +136943,7 @@ var triggers_notification_paths_default = [ ]; function routeMatcher(paths) { const regexes = paths.map( - (path4) => path4.split("/").map((c) => c.startsWith("{") ? "(?:.+?)" : c).join("/") + (path3) => path3.split("/").map((c) => c.startsWith("{") ? "(?:.+?)" : c).join("/") ); const regex22 = `^(?:${regexes.map((r) => `(?:${r})`).join("|")})[^/]*$`; return new RegExp(regex22, "i"); @@ -137033,19 +137033,19 @@ function throttling(octokit, octokitOptions) { "error", (e) => octokit.log.warn("Error in throttling-plugin limit handler", e) ); - state.retryLimiter.on("failed", async function(error50, info2) { + state.retryLimiter.on("failed", async function(error49, info2) { const [state2, request2, options] = info2.args; const { pathname } = new URL(options.url, "http://github.test"); - const shouldRetryGraphQL = pathname.startsWith("/graphql") && error50.status !== 401; - if (!(shouldRetryGraphQL || error50.status === 403 || error50.status === 429)) { + const shouldRetryGraphQL = pathname.startsWith("/graphql") && error49.status !== 401; + if (!(shouldRetryGraphQL || error49.status === 403 || error49.status === 429)) { return; } const retryCount = ~~request2.retryCount; request2.retryCount = retryCount; options.request.retryCount = retryCount; const { wantRetry, retryAfter = 0 } = await (async function() { - if (/\bsecondary rate\b/i.test(error50.message)) { - const retryAfter2 = Number(error50.response.headers["retry-after"]) || state2.fallbackSecondaryRateRetryAfter; + if (/\bsecondary rate\b/i.test(error49.message)) { + const retryAfter2 = Number(error49.response.headers["retry-after"]) || state2.fallbackSecondaryRateRetryAfter; const wantRetry2 = await emitter.trigger( "secondary-limit", retryAfter2, @@ -137055,11 +137055,11 @@ function throttling(octokit, octokitOptions) { ); return { wantRetry: wantRetry2, retryAfter: retryAfter2 }; } - if (error50.response.headers != null && error50.response.headers["x-ratelimit-remaining"] === "0" || (error50.response.data?.errors ?? []).some( + if (error49.response.headers != null && error49.response.headers["x-ratelimit-remaining"] === "0" || (error49.response.data?.errors ?? []).some( (error210) => error210.type === "RATE_LIMITED" )) { const rateLimitReset = new Date( - ~~error50.response.headers["x-ratelimit-reset"] * 1e3 + ~~error49.response.headers["x-ratelimit-reset"] * 1e3 ).getTime(); const retryAfter2 = Math.max( // Add one second so we retry _after_ the reset time @@ -137147,8 +137147,8 @@ function addHook(state, kind, name, hook2) { } if (kind === "error") { hook2 = (method, options) => { - return Promise.resolve().then(method.bind(null, options)).catch((error50) => { - return orig(error50, options); + return Promise.resolve().then(method.bind(null, options)).catch((error49) => { + return orig(error49, options); }); }; } @@ -137407,7 +137407,7 @@ function expand(template, context) { var operators = ["+", "#", ".", "/", ";", "?", "&"]; template = template.replace( /\{([^\{\}]+)\}|([^\{\}]+)/g, - function(_, expression, literal4) { + function(_, expression, literal3) { if (expression) { let operator = ""; const values = []; @@ -137431,7 +137431,7 @@ function expand(template, context) { return values.join(","); } } else { - return encodeReserved(literal4); + return encodeReserved(literal3); } } ); @@ -137604,26 +137604,26 @@ async function fetchWrapper(requestOptions) { // See https://fetch.spec.whatwg.org/#dom-requestinit-duplex. ...requestOptions.body && { duplex: "half" } }); - } catch (error50) { + } catch (error49) { let message = "Unknown Error"; - if (error50 instanceof Error) { - if (error50.name === "AbortError") { - error50.status = 500; - throw error50; + if (error49 instanceof Error) { + if (error49.name === "AbortError") { + error49.status = 500; + throw error49; } - message = error50.message; - if (error50.name === "TypeError" && "cause" in error50) { - if (error50.cause instanceof Error) { - message = error50.cause.message; - } else if (typeof error50.cause === "string") { - message = error50.cause; + message = error49.message; + if (error49.name === "TypeError" && "cause" in error49) { + if (error49.cause instanceof Error) { + message = error49.cause.message; + } else if (typeof error49.cause === "string") { + message = error49.cause; } } } const requestError = new RequestError(message, 500, { request: requestOptions }); - requestError.cause = error50; + requestError.cause = error49; throw requestError; } const status = fetchResponse.status; @@ -137769,9 +137769,9 @@ var NON_VARIABLE_OPTIONS = [ ]; var FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"]; var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/; -function graphql(request2, query2, options) { +function graphql(request2, query, options) { if (options) { - if (typeof query2 === "string" && "query" in options) { + if (typeof query === "string" && "query" in options) { return Promise.reject( new Error(`[@octokit/graphql] "query" cannot be used as variable name`) ); @@ -137785,7 +137785,7 @@ function graphql(request2, query2, options) { ); } } - const parsedOptions = typeof query2 === "string" ? Object.assign({ query: query2 }, options) : query2; + const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query; const requestOptions = Object.keys( parsedOptions ).reduce((result, key) => { @@ -137820,8 +137820,8 @@ function graphql(request2, query2, options) { } function withDefaults3(request2, newDefaults) { const newRequest = request2.defaults(newDefaults); - const newApi = (query2, options) => { - return graphql(newRequest, query2, options); + const newApi = (query, options) => { + return graphql(newRequest, query, options); }; return Object.assign(newApi, { defaults: withDefaults3.bind(null, newRequest), @@ -138033,19 +138033,19 @@ function requestLog(octokit) { octokit.log.debug("request", options); const start = Date.now(); const requestOptions = octokit.request.endpoint.parse(options); - const path4 = requestOptions.url.replace(options.baseUrl, ""); + const path3 = requestOptions.url.replace(options.baseUrl, ""); return request2(options).then((response) => { const requestId = response.headers["x-github-request-id"]; octokit.log.info( - `${requestOptions.method} ${path4} - ${response.status} with id ${requestId} in ${Date.now() - start}ms` + `${requestOptions.method} ${path3} - ${response.status} with id ${requestId} in ${Date.now() - start}ms` ); return response; - }).catch((error50) => { - const requestId = error50.response?.headers["x-github-request-id"] || "UNKNOWN"; + }).catch((error49) => { + const requestId = error49.response?.headers["x-github-request-id"] || "UNKNOWN"; octokit.log.error( - `${requestOptions.method} ${path4} - ${error50.status} with id ${requestId} in ${Date.now() - start}ms` + `${requestOptions.method} ${path3} - ${error49.status} with id ${requestId} in ${Date.now() - start}ms` ); - throw error50; + throw error49; }); }); } @@ -138110,8 +138110,8 @@ function iterator(octokit, route, parameters) { } } return { value: normalizedResponse }; - } catch (error50) { - if (error50.status !== 409) throw error50; + } catch (error49) { + if (error49.status !== 409) throw error49; url4 = ""; return { value: { @@ -140513,9 +140513,9 @@ var Octokit2 = Octokit.plugin(requestLog, legacyRestEndpointMethods, paginateRes ); // utils/retry.ts -var defaultShouldRetry = (error50) => { - if (!(error50 instanceof Error)) return false; - return error50.name === "AbortError" || error50.message.includes("fetch failed") || error50.message.includes("ECONNRESET") || error50.message.includes("ETIMEDOUT"); +var defaultShouldRetry = (error49) => { + if (!(error49 instanceof Error)) return false; + return error49.name === "AbortError" || error49.message.includes("fetch failed") || error49.message.includes("ECONNRESET") || error49.message.includes("ETIMEDOUT"); }; async function retry(fn2, options = {}) { const maxAttempts = options.maxAttempts ?? 3; @@ -140526,10 +140526,10 @@ async function retry(fn2, options = {}) { for (let attempt = 1; attempt <= maxAttempts; attempt++) { try { return await fn2(); - } catch (error50) { - lastError = error50; - if (attempt === maxAttempts || !shouldRetry(error50)) { - throw error50; + } catch (error49) { + lastError = error49; + if (attempt === maxAttempts || !shouldRetry(error49)) { + throw error49; } const delay2 = delayMs * attempt; log.warning( @@ -140578,12 +140578,12 @@ async function acquireTokenViaOIDC(opts) { const repoList = opts?.repos?.length ? [tokenData.repository, ...opts.repos.map((r) => `${owner}/${r}`)].join(", ") : tokenData.repository; log.info(`\xBB installation token obtained for ${repoList}`); return tokenData.token; - } catch (error50) { + } catch (error49) { clearTimeout(timeoutId); - if (error50 instanceof Error && error50.name === "AbortError") { + if (error49 instanceof Error && error49.name === "AbortError") { throw new Error(`Token exchange timed out after ${timeoutMs}ms`); } - throw error50; + throw error49; } } var base64UrlEncode = (str) => { @@ -140606,9 +140606,9 @@ var generateJWT = (appId, privateKey) => { const signature = createSign("RSA-SHA256").update(signaturePart).sign(privateKey, "base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, ""); return `${signaturePart}.${signature}`; }; -var githubRequest = async (path4, options = {}) => { +var githubRequest = async (path3, options = {}) => { const { method = "GET", headers = {}, body } = options; - const url4 = `https://api.github.com${path4}`; + const url4 = `https://api.github.com${path3}`; const requestHeaders = { Accept: "application/vnd.github.v3+json", "User-Agent": "Pullfrog-Installation-Token-Generator/1.0", @@ -140670,14 +140670,14 @@ var findInstallationId = async (jwt2, repoOwner, repoName) => { }; async function acquireTokenViaGitHubApp() { const repoContext = parseRepoContext(); - const config4 = { + const config3 = { appId: process.env.GITHUB_APP_ID, privateKey: process.env.GITHUB_PRIVATE_KEY?.replace(/\\n/g, "\n"), repoOwner: repoContext.owner, repoName: repoContext.name }; - const jwt2 = generateJWT(config4.appId, config4.privateKey); - const installationId = await findInstallationId(jwt2, config4.repoOwner, config4.repoName); + const jwt2 = generateJWT(config3.appId, config3.privateKey); + const installationId = await findInstallationId(jwt2, config3.repoOwner, config3.repoName); const token = await createInstallationToken(jwt2, installationId); return token; } @@ -140915,10 +140915,10 @@ async function deleteProgressComment(ctx) { repo: ctx.repo.name, comment_id: existingCommentId }); - } catch (error50) { - if (error50 instanceof Error && error50.message.includes("Not Found")) { + } catch (error49) { + if (error49 instanceof Error && error49.message.includes("Not Found")) { } else { - throw error50; + throw error49; } } ctx.toolState.progressCommentId = null; @@ -141150,8 +141150,8 @@ var args2 = noSuggest2("args"); // node_modules/.pnpm/@ark+util@0.53.0/node_modules/@ark/util/out/isomorphic.js var fileName2 = () => { try { - const error50 = new Error(); - const stackLine = error50.stack?.split("\n")[2]?.trim() || ""; + const error49 = new Error(); + const stackLine = error49.stack?.split("\n")[2]?.trim() || ""; const filePath = stackLine.match(/\(?(.+?)(?::\d+:\d+)?\)?$/)?.[1] || "unknown"; return filePath.replace(/^file:\/\//, ""); } catch { @@ -141380,18 +141380,18 @@ var INSTALL_METADATA = { import fs from "node:fs/promises"; import path from "node:path"; import process4 from "node:process"; -async function pathExists(path23, type2) { +async function pathExists(path22, type2) { try { - const stat = await fs.stat(path23); + const stat = await fs.stat(path22); return type2 === "file" ? stat.isFile() : stat.isDirectory(); } catch { return false; } } -function* lookup(cwd2 = process4.cwd()) { - let directory = path.resolve(cwd2); - const { root: root2 } = path.parse(directory); - while (directory && directory !== root2) { +function* lookup(cwd = process4.cwd()) { + let directory = path.resolve(cwd); + const { root } = path.parse(directory); + while (directory && directory !== root) { yield directory; directory = path.dirname(directory); } @@ -141403,7 +141403,7 @@ async function parsePackageJson(filepath, options) { } async function detect(options = {}) { const { - cwd: cwd2, + cwd, strategies = ["lockfile", "packageManager-field", "devEngines-field"] } = options; let stopDir; @@ -141413,7 +141413,7 @@ async function detect(options = {}) { } else { stopDir = options.stopDir; } - for (const directory of lookup(cwd2)) { + for (const directory of lookup(cwd)) { for (const strategy of strategies) { switch (strategy) { case "lockfile": { @@ -141455,7 +141455,7 @@ async function detect(options = {}) { return null; } function getNameAndVer(pkg) { - const handelVer = (version4) => version4?.match(/\d+(\.\d+){0,2}/)?.[0] ?? version4; + const handelVer = (version3) => version3?.match(/\d+(\.\d+){0,2}/)?.[0] ?? version3; if (typeof pkg.packageManager === "string") { const [name, ver] = pkg.packageManager.replace(/^\^/, "").split("@"); return { name, ver: handelVer(ver) }; @@ -141477,17 +141477,17 @@ async function handlePackageManager(filepath, options) { if (nameAndVer) { const name = nameAndVer.name; const ver = nameAndVer.ver; - let version4 = ver; + let version3 = ver; if (name === "yarn" && ver && Number.parseInt(ver) > 1) { agent2 = "yarn@berry"; - version4 = "berry"; - return { name, agent: agent2, version: version4 }; + version3 = "berry"; + return { name, agent: agent2, version: version3 }; } else if (name === "pnpm" && ver && Number.parseInt(ver) < 7) { agent2 = "pnpm@6"; - return { name, agent: agent2, version: version4 }; + return { name, agent: agent2, version: version3 }; } else if (AGENTS.includes(name)) { agent2 = name; - return { name, agent: agent2, version: version4 }; + return { name, agent: agent2, version: version3 }; } else { return options.onUnknown?.(pkg.packageManager) ?? null; } @@ -141506,6 +141506,13 @@ import { spawn as nodeSpawn } from "node:child_process"; // utils/activity.ts var DEFAULT_ACTIVITY_TIMEOUT_MS = 3e4; var DEFAULT_ACTIVITY_CHECK_INTERVAL_MS = 5e3; +var _lastActivity = Date.now(); +function markActivity() { + _lastActivity = Date.now(); +} +function getIdleMs() { + return Date.now() - _lastActivity; +} function wrapWrite(original, onActivity) { const wrapped = (chunk, encodingOrCb, cb) => { onActivity(); @@ -141517,17 +141524,13 @@ function wrapWrite(original, onActivity) { return wrapped; } function startProcessOutputMonitor(ctx) { - let lastActivity = Date.now(); let timedOut = false; const originalStdoutWrite = process.stdout.write.bind(process.stdout); const originalStderrWrite = process.stderr.write.bind(process.stderr); - function markActivity() { - lastActivity = Date.now(); - } process.stdout.write = wrapWrite(originalStdoutWrite, markActivity); process.stderr.write = wrapWrite(originalStderrWrite, markActivity); const intervalId = setInterval(() => { - const idleMs = Date.now() - lastActivity; + const idleMs = getIdleMs(); if (timedOut || idleMs <= ctx.timeoutMs) return; timedOut = true; ctx.onTimeout(idleMs); @@ -141540,6 +141543,7 @@ function startProcessOutputMonitor(ctx) { return { stop }; } function createProcessOutputActivityTimeout(ctx) { + markActivity(); let rejectFn = null; const promise2 = new Promise((_, reject) => { rejectFn = reject; @@ -141611,7 +141615,7 @@ function installSignalHandlers() { process.on("SIGTERM", () => handleSignal("SIGTERM")); } async function spawn2(options) { - const { cmd, args: args3, env: env3, input, timeout, cwd: cwd2, stdio, onStdout, onStderr } = options; + const { cmd, args: args3, env: env3, input, timeout, cwd, stdio, onStdout, onStderr } = options; const activityTimeoutMs = options.activityTimeout ?? DEFAULT_ACTIVITY_TIMEOUT_MS; installSignalHandlers(); const startTime = Date.now(); @@ -141624,7 +141628,7 @@ async function spawn2(options) { HOME: process.env.HOME || "" }, stdio: stdio || ["pipe", "pipe", "pipe"], - cwd: cwd2 || process.cwd() + cwd: cwd || process.cwd() }); trackChild({ child }); let timeoutId; @@ -141695,12 +141699,12 @@ async function spawn2(options) { durationMs }); }); - child.on("error", (error50) => { + child.on("error", (error49) => { const durationMs = Date.now() - startTime; untrackChild(child); if (timeoutId) clearTimeout(timeoutId); if (activityCheckIntervalId) clearInterval(activityCheckIntervalId); - console.error(`[spawn] process spawn error: ${error50.message}`); + console.error(`[spawn] process spawn error: ${error49.message}`); resolve2({ stdout: stdoutBuffer, stderr: stderrBuffer, @@ -141911,13 +141915,13 @@ var installPythonDependencies = { if (!hasPython) { return false; } - const cwd2 = process.cwd(); - return PYTHON_CONFIGS.some((config4) => existsSync3(join6(cwd2, config4.file))); + const cwd = process.cwd(); + return PYTHON_CONFIGS.some((config3) => existsSync3(join6(cwd, config3.file))); }, run: async () => { - const cwd2 = process.cwd(); - const config4 = PYTHON_CONFIGS.find((c) => existsSync3(join6(cwd2, c.file))); - if (!config4) { + const cwd = process.cwd(); + const config3 = PYTHON_CONFIGS.find((c) => existsSync3(join6(cwd, c.file))); + if (!config3) { return { language: "python", packageManager: "pip", @@ -141926,22 +141930,22 @@ var installPythonDependencies = { issues: ["no python config file found"] }; } - log.info(`\xBB detected python config: ${config4.file} (using ${config4.tool})`); - const isAvailable = await isCommandAvailable2(config4.tool); + log.info(`\xBB detected python config: ${config3.file} (using ${config3.tool})`); + const isAvailable = await isCommandAvailable2(config3.tool); if (!isAvailable) { - log.info(`\xBB ${config4.tool} not found, attempting to install...`); - const installError = await installTool(config4.tool); + log.info(`\xBB ${config3.tool} not found, attempting to install...`); + const installError = await installTool(config3.tool); if (installError) { return { language: "python", - packageManager: config4.tool, - configFile: config4.file, + packageManager: config3.tool, + configFile: config3.file, dependenciesInstalled: false, issues: [installError] }; } } - const [cmd, ...args3] = config4.installCmd; + const [cmd, ...args3] = config3.installCmd; log.info(`\xBB running: ${cmd} ${args3.join(" ")}`); const result = await spawn2({ cmd, @@ -141952,16 +141956,16 @@ var installPythonDependencies = { if (result.exitCode !== 0) { return { language: "python", - packageManager: config4.tool, - configFile: config4.file, + packageManager: config3.tool, + configFile: config3.file, dependenciesInstalled: false, issues: [result.stderr || `${cmd} exited with code ${result.exitCode}`] }; } return { language: "python", - packageManager: config4.tool, - configFile: config4.file, + packageManager: config3.tool, + configFile: config3.file, dependenciesInstalled: true, issues: [] }; @@ -142192,9 +142196,9 @@ async function revokeGitHubInstallationToken(token) { } }); log.debug("\xBB installation token revoked"); - } catch (error50) { + } catch (error49) { log.warning( - `Failed to revoke installation token: ${error50 instanceof Error ? error50.message : String(error50)}` + `Failed to revoke installation token: ${error49 instanceof Error ? error49.message : String(error49)}` ); } } @@ -142294,9 +142298,9 @@ function CommitFilesTool(_ctx) { `Commit blocked: secrets detected in file ${file2}. Please remove any sensitive information (API keys, tokens, passwords) before committing.` ); } - } catch (error50) { - if (error50 instanceof Error && error50.message.includes("Commit blocked")) { - throw error50; + } catch (error49) { + if (error49 instanceof Error && error49.message.includes("Commit blocked")) { + throw error49; } } } @@ -142515,12 +142519,12 @@ function IssueInfoTool(ctx) { description: "Retrieve GitHub issue information by issue number", parameters: IssueInfo, execute: execute(async ({ issue_number }) => { - const issue4 = await ctx.octokit.rest.issues.get({ + const issue3 = await ctx.octokit.rest.issues.get({ owner: ctx.repo.owner, repo: ctx.repo.name, issue_number }); - const data = issue4.data; + const data = issue3.data; ctx.toolState.issueNumber = issue_number; const hints = []; if (data.comments > 0) { @@ -143265,8 +143269,8 @@ function UploadFileTool(ctx) { }) }); if (!response.ok) { - const error50 = await response.text(); - throw new Error(`failed to get upload URL: ${error50}`); + const error49 = await response.text(); + throw new Error(`failed to get upload URL: ${error49}`); } const { uploadUrl, publicUrl, contentDisposition } = await response.json(); const uploadResponse = await fetch(uploadUrl, { @@ -143323,12 +143327,12 @@ function isPortAvailable(port) { server.listen(port, mcpHost); }); } -function getErrorMessage(error50) { - if (error50 instanceof Error) return error50.message; - return String(error50); +function getErrorMessage(error49) { + if (error49 instanceof Error) return error49.message; + return String(error49); } -function isAddressInUse(error50) { - const message = getErrorMessage(error50).toLowerCase(); +function isAddressInUse(error49) { + const message = getErrorMessage(error49).toLowerCase(); return message.includes("eaddrinuse") || message.includes("address already in use"); } function buildTools(ctx) { @@ -143383,9 +143387,9 @@ async function tryStartMcpServer(ctx, port) { }); const url4 = `http://${mcpHost}:${port}${mcpEndpoint}`; return { server, url: url4, port }; - } catch (error50) { - if (!isAddressInUse(error50)) { - throw error50; + } catch (error49) { + if (!isAddressInUse(error49)) { + throw error49; } try { await server.stop(); @@ -143416,10 +143420,10 @@ async function selectMcpPort(ctx) { if (result) { return result; } - } catch (error50) { - lastError = error50; - if (!isAddressInUse(error50)) { - throw error50; + } catch (error49) { + lastError = error49; + if (!isAddressInUse(error49)) { + throw error49; } } } @@ -143558,17 +143562,19 @@ function computeModes() { - **Consider lifecycle**: Initialization, cleanup, error recovery. Are resources acquired before use? Released after? What happens on cancellation? - Do NOT stop at "this looks reasonable." Dig until you either find a problem or have concrete evidence there isn't one. -4. **DRAFT** - For each issue found, create an inline comment. Use the NEW line number from the diff (second column: \`| OLD | NEW | TYPE | CODE\`). +4. **DRAFT LINE-BY-LINE COMMENTS** - For each issue found, draft an inline comment on the specific line. Use the NEW line number from the diff (second column: \`| OLD | NEW | TYPE | CODE\`). If no issues found, skip to step 6. -5. **FILTER** - Remove noise, keep substance: - - Remove style-only comments (formatting, naming conventions) unless they cause real confusion - - Remove compliments that aren't actionable - - Keep: bugs, logic errors, missing error handling, security issues, race conditions, resource leaks, incorrect assumptions +5. **FILTER LINE-BY-LINE COMMENTS** - Each inline comment must be actionable. Remove anything that doesn't require action: + - **Not actionable \u2192 no comment**: Do NOT create inline comments for compliments (e.g., "this looks clean", "nice refactor") or general observations. These waste reviewer attention. + - **Actionable by agent \u2192 keep**: Bugs, logic errors, missing error handling, security issues, race conditions, resource leaks, incorrect assumptions. + - **Requires human decision \u2192 keep**: If something needs human judgment (architectural choice, product decision, tradeoff evaluation), create a comment clearly stating what decision is needed and why. + - Remove style-only comments (formatting, naming conventions) unless they cause real confusion. -6. **SUBMIT** \u2014 Use ${ghPullfrogMcpName}/create_pull_request_review: - - \`comments\`: Inline feedback on specific diff lines - - \`body\`: 1-3 sentence summary with urgency level and any concerns about code outside the diff - - If no issues found, submit with empty comments and a brief approving body +6. **WRITE SUMMARY** - Draft a 1-3 sentence summary for the review body. Include urgency level and any concerns about code outside the diff. + +7. **SUBMIT** \u2014 Use ${ghPullfrogMcpName}/create_pull_request_review: + - \`body\`: The summary from step 6 + - \`comments\`: The filtered inline comments from step 5 ${permalinkTip} ` @@ -143678,16533 +143684,9 @@ ${permalinkTip}` } var modes = computeModes(); -// node_modules/.pnpm/@anthropic-ai+claude-agent-sdk@0.2.7_zod@4.3.5/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs -import { join as join52 } from "path"; -import { fileURLToPath as fileURLToPath2 } from "url"; -import { setMaxListeners } from "events"; -import { spawn as spawn3 } from "child_process"; -import { createInterface } from "readline"; -import * as fs3 from "fs"; -import { stat as statPromise, open } from "fs/promises"; -import { join as join8 } from "path"; -import { homedir } from "os"; -import { dirname, join as join22 } from "path"; -import { cwd } from "process"; -import { realpathSync as realpathSync2 } from "fs"; -import { randomUUID as randomUUID3 } from "crypto"; -import { randomUUID as randomUUID22 } from "crypto"; -import { appendFileSync as appendFileSync2, existsSync as existsSync22, mkdirSync as mkdirSync22 } from "fs"; -import { join as join32 } from "path"; -import { randomUUID as randomUUID32 } from "crypto"; -var __create3 = Object.create; -var __getProtoOf3 = Object.getPrototypeOf; -var __defProp3 = Object.defineProperty; -var __getOwnPropNames3 = Object.getOwnPropertyNames; -var __hasOwnProp3 = Object.prototype.hasOwnProperty; -var __toESM3 = (mod, isNodeMode, target) => { - target = mod != null ? __create3(__getProtoOf3(mod)) : {}; - const to = isNodeMode || !mod || !mod.__esModule ? __defProp3(target, "default", { value: mod, enumerable: true }) : target; - for (let key of __getOwnPropNames3(mod)) - if (!__hasOwnProp3.call(to, key)) - __defProp3(to, key, { - get: () => mod[key], - enumerable: true - }); - return to; -}; -var __commonJS2 = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports); -var __export2 = (target, all) => { - for (var name in all) - __defProp3(target, name, { - get: all[name], - enumerable: true, - configurable: true, - set: (newValue) => all[name] = () => newValue - }); -}; -var require_code4 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0; - class _CodeOrName { - } - exports._CodeOrName = _CodeOrName; - exports.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i; - class Name extends _CodeOrName { - constructor(s) { - super(); - if (!exports.IDENTIFIER.test(s)) - throw new Error("CodeGen: name must be a valid identifier"); - this.str = s; - } - toString() { - return this.str; - } - emptyStr() { - return false; - } - get names() { - return { [this.str]: 1 }; - } - } - exports.Name = Name; - class _Code extends _CodeOrName { - constructor(code) { - super(); - this._items = typeof code === "string" ? [code] : code; - } - toString() { - return this.str; - } - emptyStr() { - if (this._items.length > 1) - return false; - const item = this._items[0]; - return item === "" || item === '""'; - } - get str() { - var _a2; - return (_a2 = this._str) !== null && _a2 !== void 0 ? _a2 : this._str = this._items.reduce((s, c) => `${s}${c}`, ""); - } - get names() { - var _a2; - return (_a2 = this._names) !== null && _a2 !== void 0 ? _a2 : this._names = this._items.reduce((names, c) => { - if (c instanceof Name) - names[c.str] = (names[c.str] || 0) + 1; - return names; - }, {}); - } - } - exports._Code = _Code; - exports.nil = new _Code(""); - function _(strs, ...args3) { - const code = [strs[0]]; - let i = 0; - while (i < args3.length) { - addCodeArg(code, args3[i]); - code.push(strs[++i]); - } - return new _Code(code); - } - exports._ = _; - var plus = new _Code("+"); - function str(strs, ...args3) { - const expr = [safeStringify(strs[0])]; - let i = 0; - while (i < args3.length) { - expr.push(plus); - addCodeArg(expr, args3[i]); - expr.push(plus, safeStringify(strs[++i])); - } - optimize(expr); - return new _Code(expr); - } - exports.str = str; - function addCodeArg(code, arg) { - if (arg instanceof _Code) - code.push(...arg._items); - else if (arg instanceof Name) - code.push(arg); - else - code.push(interpolate(arg)); - } - exports.addCodeArg = addCodeArg; - function optimize(expr) { - let i = 1; - while (i < expr.length - 1) { - if (expr[i] === plus) { - const res = mergeExprItems(expr[i - 1], expr[i + 1]); - if (res !== void 0) { - expr.splice(i - 1, 3, res); - continue; - } - expr[i++] = "+"; - } - i++; - } - } - function mergeExprItems(a, b) { - if (b === '""') - return a; - if (a === '""') - return b; - if (typeof a == "string") { - if (b instanceof Name || a[a.length - 1] !== '"') - return; - if (typeof b != "string") - return `${a.slice(0, -1)}${b}"`; - if (b[0] === '"') - return a.slice(0, -1) + b.slice(1); - return; - } - if (typeof b == "string" && b[0] === '"' && !(a instanceof Name)) - return `"${a}${b.slice(1)}`; - return; - } - function strConcat(c1, c2) { - return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str`${c1}${c2}`; - } - exports.strConcat = strConcat; - function interpolate(x) { - return typeof x == "number" || typeof x == "boolean" || x === null ? x : safeStringify(Array.isArray(x) ? x.join(",") : x); - } - function stringify(x) { - return new _Code(safeStringify(x)); - } - exports.stringify = stringify; - function safeStringify(x) { - return JSON.stringify(x).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029"); - } - exports.safeStringify = safeStringify; - function getProperty(key) { - return typeof key == "string" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _`[${key}]`; - } - exports.getProperty = getProperty; - function getEsmExportName(key) { - if (typeof key == "string" && exports.IDENTIFIER.test(key)) { - return new _Code(`${key}`); - } - throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`); - } - exports.getEsmExportName = getEsmExportName; - function regexpCode(rx) { - return new _Code(rx.toString()); - } - exports.regexpCode = regexpCode; -}); -var require_scope3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = void 0; - var code_1 = require_code4(); - class ValueError extends Error { - constructor(name) { - super(`CodeGen: "code" for ${name} not defined`); - this.value = name.value; - } - } - var UsedValueState; - (function(UsedValueState2) { - UsedValueState2[UsedValueState2["Started"] = 0] = "Started"; - UsedValueState2[UsedValueState2["Completed"] = 1] = "Completed"; - })(UsedValueState || (exports.UsedValueState = UsedValueState = {})); - exports.varKinds = { - const: new code_1.Name("const"), - let: new code_1.Name("let"), - var: new code_1.Name("var") - }; - class Scope2 { - constructor({ prefixes, parent } = {}) { - this._names = {}; - this._prefixes = prefixes; - this._parent = parent; - } - toName(nameOrPrefix) { - return nameOrPrefix instanceof code_1.Name ? nameOrPrefix : this.name(nameOrPrefix); - } - name(prefix) { - return new code_1.Name(this._newName(prefix)); - } - _newName(prefix) { - const ng = this._names[prefix] || this._nameGroup(prefix); - return `${prefix}${ng.index++}`; - } - _nameGroup(prefix) { - var _a2, _b; - if (((_b = (_a2 = this._parent) === null || _a2 === void 0 ? void 0 : _a2._prefixes) === null || _b === void 0 ? void 0 : _b.has(prefix)) || this._prefixes && !this._prefixes.has(prefix)) { - throw new Error(`CodeGen: prefix "${prefix}" is not allowed in this scope`); - } - return this._names[prefix] = { prefix, index: 0 }; - } - } - exports.Scope = Scope2; - class ValueScopeName extends code_1.Name { - constructor(prefix, nameStr) { - super(nameStr); - this.prefix = prefix; - } - setValue(value2, { property, itemIndex }) { - this.value = value2; - this.scopePath = (0, code_1._)`.${new code_1.Name(property)}[${itemIndex}]`; - } - } - exports.ValueScopeName = ValueScopeName; - var line = (0, code_1._)`\n`; - class ValueScope extends Scope2 { - constructor(opts) { - super(opts); - this._values = {}; - this._scope = opts.scope; - this.opts = { ...opts, _n: opts.lines ? line : code_1.nil }; - } - get() { - return this._scope; - } - name(prefix) { - return new ValueScopeName(prefix, this._newName(prefix)); - } - value(nameOrPrefix, value2) { - var _a2; - if (value2.ref === void 0) - throw new Error("CodeGen: ref must be passed in value"); - const name = this.toName(nameOrPrefix); - const { prefix } = name; - const valueKey = (_a2 = value2.key) !== null && _a2 !== void 0 ? _a2 : value2.ref; - let vs = this._values[prefix]; - if (vs) { - const _name = vs.get(valueKey); - if (_name) - return _name; - } else { - vs = this._values[prefix] = /* @__PURE__ */ new Map(); - } - vs.set(valueKey, name); - const s = this._scope[prefix] || (this._scope[prefix] = []); - const itemIndex = s.length; - s[itemIndex] = value2.ref; - name.setValue(value2, { property: prefix, itemIndex }); - return name; - } - getValue(prefix, keyOrRef) { - const vs = this._values[prefix]; - if (!vs) - return; - return vs.get(keyOrRef); - } - scopeRefs(scopeName, values = this._values) { - return this._reduceValues(values, (name) => { - if (name.scopePath === void 0) - throw new Error(`CodeGen: name "${name}" has no value`); - return (0, code_1._)`${scopeName}${name.scopePath}`; - }); - } - scopeCode(values = this._values, usedValues, getCode) { - return this._reduceValues(values, (name) => { - if (name.value === void 0) - throw new Error(`CodeGen: name "${name}" has no value`); - return name.value.code; - }, usedValues, getCode); - } - _reduceValues(values, valueCode, usedValues = {}, getCode) { - let code = code_1.nil; - for (const prefix in values) { - const vs = values[prefix]; - if (!vs) - continue; - const nameSet = usedValues[prefix] = usedValues[prefix] || /* @__PURE__ */ new Map(); - vs.forEach((name) => { - if (nameSet.has(name)) - return; - nameSet.set(name, UsedValueState.Started); - let c = valueCode(name); - if (c) { - const def = this.opts.es5 ? exports.varKinds.var : exports.varKinds.const; - code = (0, code_1._)`${code}${def} ${name} = ${c};${this.opts._n}`; - } else if (c = getCode === null || getCode === void 0 ? void 0 : getCode(name)) { - code = (0, code_1._)`${code}${c}${this.opts._n}`; - } else { - throw new ValueError(name); - } - nameSet.set(name, UsedValueState.Completed); - }); - } - return code; - } - } - exports.ValueScope = ValueScope; -}); -var require_codegen3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.or = exports.and = exports.not = exports.CodeGen = exports.operators = exports.varKinds = exports.ValueScopeName = exports.ValueScope = exports.Scope = exports.Name = exports.regexpCode = exports.stringify = exports.getProperty = exports.nil = exports.strConcat = exports.str = exports._ = void 0; - var code_1 = require_code4(); - var scope_1 = require_scope3(); - var code_2 = require_code4(); - Object.defineProperty(exports, "_", { enumerable: true, get: function() { - return code_2._; - } }); - Object.defineProperty(exports, "str", { enumerable: true, get: function() { - return code_2.str; - } }); - Object.defineProperty(exports, "strConcat", { enumerable: true, get: function() { - return code_2.strConcat; - } }); - Object.defineProperty(exports, "nil", { enumerable: true, get: function() { - return code_2.nil; - } }); - Object.defineProperty(exports, "getProperty", { enumerable: true, get: function() { - return code_2.getProperty; - } }); - Object.defineProperty(exports, "stringify", { enumerable: true, get: function() { - return code_2.stringify; - } }); - Object.defineProperty(exports, "regexpCode", { enumerable: true, get: function() { - return code_2.regexpCode; - } }); - Object.defineProperty(exports, "Name", { enumerable: true, get: function() { - return code_2.Name; - } }); - var scope_2 = require_scope3(); - Object.defineProperty(exports, "Scope", { enumerable: true, get: function() { - return scope_2.Scope; - } }); - Object.defineProperty(exports, "ValueScope", { enumerable: true, get: function() { - return scope_2.ValueScope; - } }); - Object.defineProperty(exports, "ValueScopeName", { enumerable: true, get: function() { - return scope_2.ValueScopeName; - } }); - Object.defineProperty(exports, "varKinds", { enumerable: true, get: function() { - return scope_2.varKinds; - } }); - exports.operators = { - GT: new code_1._Code(">"), - GTE: new code_1._Code(">="), - LT: new code_1._Code("<"), - LTE: new code_1._Code("<="), - EQ: new code_1._Code("==="), - NEQ: new code_1._Code("!=="), - NOT: new code_1._Code("!"), - OR: new code_1._Code("||"), - AND: new code_1._Code("&&"), - ADD: new code_1._Code("+") - }; - class Node { - optimizeNodes() { - return this; - } - optimizeNames(_names, _constants) { - return this; - } - } - class Def extends Node { - constructor(varKind, name, rhs) { - super(); - this.varKind = varKind; - this.name = name; - this.rhs = rhs; - } - render({ es5, _n }) { - const varKind = es5 ? scope_1.varKinds.var : this.varKind; - const rhs = this.rhs === void 0 ? "" : ` = ${this.rhs}`; - return `${varKind} ${this.name}${rhs};` + _n; - } - optimizeNames(names, constants) { - if (!names[this.name.str]) - return; - if (this.rhs) - this.rhs = optimizeExpr(this.rhs, names, constants); - return this; - } - get names() { - return this.rhs instanceof code_1._CodeOrName ? this.rhs.names : {}; - } - } - class Assign extends Node { - constructor(lhs, rhs, sideEffects) { - super(); - this.lhs = lhs; - this.rhs = rhs; - this.sideEffects = sideEffects; - } - render({ _n }) { - return `${this.lhs} = ${this.rhs};` + _n; - } - optimizeNames(names, constants) { - if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects) - return; - this.rhs = optimizeExpr(this.rhs, names, constants); - return this; - } - get names() { - const names = this.lhs instanceof code_1.Name ? {} : { ...this.lhs.names }; - return addExprNames(names, this.rhs); - } - } - class AssignOp extends Assign { - constructor(lhs, op, rhs, sideEffects) { - super(lhs, rhs, sideEffects); - this.op = op; - } - render({ _n }) { - return `${this.lhs} ${this.op}= ${this.rhs};` + _n; - } - } - class Label extends Node { - constructor(label) { - super(); - this.label = label; - this.names = {}; - } - render({ _n }) { - return `${this.label}:` + _n; - } - } - class Break extends Node { - constructor(label) { - super(); - this.label = label; - this.names = {}; - } - render({ _n }) { - const label = this.label ? ` ${this.label}` : ""; - return `break${label};` + _n; - } - } - class Throw extends Node { - constructor(error210) { - super(); - this.error = error210; - } - render({ _n }) { - return `throw ${this.error};` + _n; - } - get names() { - return this.error.names; - } - } - class AnyCode extends Node { - constructor(code) { - super(); - this.code = code; - } - render({ _n }) { - return `${this.code};` + _n; - } - optimizeNodes() { - return `${this.code}` ? this : void 0; - } - optimizeNames(names, constants) { - this.code = optimizeExpr(this.code, names, constants); - return this; - } - get names() { - return this.code instanceof code_1._CodeOrName ? this.code.names : {}; - } - } - class ParentNode extends Node { - constructor(nodes = []) { - super(); - this.nodes = nodes; - } - render(opts) { - return this.nodes.reduce((code, n) => code + n.render(opts), ""); - } - optimizeNodes() { - const { nodes } = this; - let i = nodes.length; - while (i--) { - const n = nodes[i].optimizeNodes(); - if (Array.isArray(n)) - nodes.splice(i, 1, ...n); - else if (n) - nodes[i] = n; - else - nodes.splice(i, 1); - } - return nodes.length > 0 ? this : void 0; - } - optimizeNames(names, constants) { - const { nodes } = this; - let i = nodes.length; - while (i--) { - const n = nodes[i]; - if (n.optimizeNames(names, constants)) - continue; - subtractNames(names, n.names); - nodes.splice(i, 1); - } - return nodes.length > 0 ? this : void 0; - } - get names() { - return this.nodes.reduce((names, n) => addNames(names, n.names), {}); - } - } - class BlockNode extends ParentNode { - render(opts) { - return "{" + opts._n + super.render(opts) + "}" + opts._n; - } - } - class Root extends ParentNode { - } - class Else extends BlockNode { - } - Else.kind = "else"; - class If extends BlockNode { - constructor(condition, nodes) { - super(nodes); - this.condition = condition; - } - render(opts) { - let code = `if(${this.condition})` + super.render(opts); - if (this.else) - code += "else " + this.else.render(opts); - return code; - } - optimizeNodes() { - super.optimizeNodes(); - const cond = this.condition; - if (cond === true) - return this.nodes; - let e = this.else; - if (e) { - const ns = e.optimizeNodes(); - e = this.else = Array.isArray(ns) ? new Else(ns) : ns; - } - if (e) { - if (cond === false) - return e instanceof If ? e : e.nodes; - if (this.nodes.length) - return this; - return new If(not(cond), e instanceof If ? [e] : e.nodes); - } - if (cond === false || !this.nodes.length) - return; - return this; - } - optimizeNames(names, constants) { - var _a2; - this.else = (_a2 = this.else) === null || _a2 === void 0 ? void 0 : _a2.optimizeNames(names, constants); - if (!(super.optimizeNames(names, constants) || this.else)) - return; - this.condition = optimizeExpr(this.condition, names, constants); - return this; - } - get names() { - const names = super.names; - addExprNames(names, this.condition); - if (this.else) - addNames(names, this.else.names); - return names; - } - } - If.kind = "if"; - class For extends BlockNode { - } - For.kind = "for"; - class ForLoop extends For { - constructor(iteration) { - super(); - this.iteration = iteration; - } - render(opts) { - return `for(${this.iteration})` + super.render(opts); - } - optimizeNames(names, constants) { - if (!super.optimizeNames(names, constants)) - return; - this.iteration = optimizeExpr(this.iteration, names, constants); - return this; - } - get names() { - return addNames(super.names, this.iteration.names); - } - } - class ForRange extends For { - constructor(varKind, name, from, to) { - super(); - this.varKind = varKind; - this.name = name; - this.from = from; - this.to = to; - } - render(opts) { - const varKind = opts.es5 ? scope_1.varKinds.var : this.varKind; - const { name, from, to } = this; - return `for(${varKind} ${name}=${from}; ${name}<${to}; ${name}++)` + super.render(opts); - } - get names() { - const names = addExprNames(super.names, this.from); - return addExprNames(names, this.to); - } - } - class ForIter extends For { - constructor(loop, varKind, name, iterable) { - super(); - this.loop = loop; - this.varKind = varKind; - this.name = name; - this.iterable = iterable; - } - render(opts) { - return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts); - } - optimizeNames(names, constants) { - if (!super.optimizeNames(names, constants)) - return; - this.iterable = optimizeExpr(this.iterable, names, constants); - return this; - } - get names() { - return addNames(super.names, this.iterable.names); - } - } - class Func extends BlockNode { - constructor(name, args3, async) { - super(); - this.name = name; - this.args = args3; - this.async = async; - } - render(opts) { - const _async = this.async ? "async " : ""; - return `${_async}function ${this.name}(${this.args})` + super.render(opts); - } - } - Func.kind = "func"; - class Return extends ParentNode { - render(opts) { - return "return " + super.render(opts); - } - } - Return.kind = "return"; - class Try extends BlockNode { - render(opts) { - let code = "try" + super.render(opts); - if (this.catch) - code += this.catch.render(opts); - if (this.finally) - code += this.finally.render(opts); - return code; - } - optimizeNodes() { - var _a2, _b; - super.optimizeNodes(); - (_a2 = this.catch) === null || _a2 === void 0 || _a2.optimizeNodes(); - (_b = this.finally) === null || _b === void 0 || _b.optimizeNodes(); - return this; - } - optimizeNames(names, constants) { - var _a2, _b; - super.optimizeNames(names, constants); - (_a2 = this.catch) === null || _a2 === void 0 || _a2.optimizeNames(names, constants); - (_b = this.finally) === null || _b === void 0 || _b.optimizeNames(names, constants); - return this; - } - get names() { - const names = super.names; - if (this.catch) - addNames(names, this.catch.names); - if (this.finally) - addNames(names, this.finally.names); - return names; - } - } - class Catch extends BlockNode { - constructor(error210) { - super(); - this.error = error210; - } - render(opts) { - return `catch(${this.error})` + super.render(opts); - } - } - Catch.kind = "catch"; - class Finally extends BlockNode { - render(opts) { - return "finally" + super.render(opts); - } - } - Finally.kind = "finally"; - class CodeGen { - constructor(extScope, opts = {}) { - this._values = {}; - this._blockStarts = []; - this._constants = {}; - this.opts = { ...opts, _n: opts.lines ? ` -` : "" }; - this._extScope = extScope; - this._scope = new scope_1.Scope({ parent: extScope }); - this._nodes = [new Root()]; - } - toString() { - return this._root.render(this.opts); - } - name(prefix) { - return this._scope.name(prefix); - } - scopeName(prefix) { - return this._extScope.name(prefix); - } - scopeValue(prefixOrName, value2) { - const name = this._extScope.value(prefixOrName, value2); - const vs = this._values[name.prefix] || (this._values[name.prefix] = /* @__PURE__ */ new Set()); - vs.add(name); - return name; - } - getScopeValue(prefix, keyOrRef) { - return this._extScope.getValue(prefix, keyOrRef); - } - scopeRefs(scopeName) { - return this._extScope.scopeRefs(scopeName, this._values); - } - scopeCode() { - return this._extScope.scopeCode(this._values); - } - _def(varKind, nameOrPrefix, rhs, constant) { - const name = this._scope.toName(nameOrPrefix); - if (rhs !== void 0 && constant) - this._constants[name.str] = rhs; - this._leafNode(new Def(varKind, name, rhs)); - return name; - } - const(nameOrPrefix, rhs, _constant) { - return this._def(scope_1.varKinds.const, nameOrPrefix, rhs, _constant); - } - let(nameOrPrefix, rhs, _constant) { - return this._def(scope_1.varKinds.let, nameOrPrefix, rhs, _constant); - } - var(nameOrPrefix, rhs, _constant) { - return this._def(scope_1.varKinds.var, nameOrPrefix, rhs, _constant); - } - assign(lhs, rhs, sideEffects) { - return this._leafNode(new Assign(lhs, rhs, sideEffects)); - } - add(lhs, rhs) { - return this._leafNode(new AssignOp(lhs, exports.operators.ADD, rhs)); - } - code(c) { - if (typeof c == "function") - c(); - else if (c !== code_1.nil) - this._leafNode(new AnyCode(c)); - return this; - } - object(...keyValues) { - const code = ["{"]; - for (const [key, value2] of keyValues) { - if (code.length > 1) - code.push(","); - code.push(key); - if (key !== value2 || this.opts.es5) { - code.push(":"); - (0, code_1.addCodeArg)(code, value2); - } - } - code.push("}"); - return new code_1._Code(code); - } - if(condition, thenBody, elseBody) { - this._blockNode(new If(condition)); - if (thenBody && elseBody) { - this.code(thenBody).else().code(elseBody).endIf(); - } else if (thenBody) { - this.code(thenBody).endIf(); - } else if (elseBody) { - throw new Error('CodeGen: "else" body without "then" body'); - } - return this; - } - elseIf(condition) { - return this._elseNode(new If(condition)); - } - else() { - return this._elseNode(new Else()); - } - endIf() { - return this._endBlockNode(If, Else); - } - _for(node2, forBody) { - this._blockNode(node2); - if (forBody) - this.code(forBody).endFor(); - return this; - } - for(iteration, forBody) { - return this._for(new ForLoop(iteration), forBody); - } - forRange(nameOrPrefix, from, to, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.let) { - const name = this._scope.toName(nameOrPrefix); - return this._for(new ForRange(varKind, name, from, to), () => forBody(name)); - } - forOf(nameOrPrefix, iterable, forBody, varKind = scope_1.varKinds.const) { - const name = this._scope.toName(nameOrPrefix); - if (this.opts.es5) { - const arr = iterable instanceof code_1.Name ? iterable : this.var("_arr", iterable); - return this.forRange("_i", 0, (0, code_1._)`${arr}.length`, (i) => { - this.var(name, (0, code_1._)`${arr}[${i}]`); - forBody(name); - }); - } - return this._for(new ForIter("of", varKind, name, iterable), () => forBody(name)); - } - forIn(nameOrPrefix, obj, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.const) { - if (this.opts.ownProperties) { - return this.forOf(nameOrPrefix, (0, code_1._)`Object.keys(${obj})`, forBody); - } - const name = this._scope.toName(nameOrPrefix); - return this._for(new ForIter("in", varKind, name, obj), () => forBody(name)); - } - endFor() { - return this._endBlockNode(For); - } - label(label) { - return this._leafNode(new Label(label)); - } - break(label) { - return this._leafNode(new Break(label)); - } - return(value2) { - const node2 = new Return(); - this._blockNode(node2); - this.code(value2); - if (node2.nodes.length !== 1) - throw new Error('CodeGen: "return" should have one node'); - return this._endBlockNode(Return); - } - try(tryBody, catchCode, finallyCode) { - if (!catchCode && !finallyCode) - throw new Error('CodeGen: "try" without "catch" and "finally"'); - const node2 = new Try(); - this._blockNode(node2); - this.code(tryBody); - if (catchCode) { - const error210 = this.name("e"); - this._currNode = node2.catch = new Catch(error210); - catchCode(error210); - } - if (finallyCode) { - this._currNode = node2.finally = new Finally(); - this.code(finallyCode); - } - return this._endBlockNode(Catch, Finally); - } - throw(error210) { - return this._leafNode(new Throw(error210)); - } - block(body, nodeCount) { - this._blockStarts.push(this._nodes.length); - if (body) - this.code(body).endBlock(nodeCount); - return this; - } - endBlock(nodeCount) { - const len = this._blockStarts.pop(); - if (len === void 0) - throw new Error("CodeGen: not in self-balancing block"); - const toClose = this._nodes.length - len; - if (toClose < 0 || nodeCount !== void 0 && toClose !== nodeCount) { - throw new Error(`CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`); - } - this._nodes.length = len; - return this; - } - func(name, args3 = code_1.nil, async, funcBody) { - this._blockNode(new Func(name, args3, async)); - if (funcBody) - this.code(funcBody).endFunc(); - return this; - } - endFunc() { - return this._endBlockNode(Func); - } - optimize(n = 1) { - while (n-- > 0) { - this._root.optimizeNodes(); - this._root.optimizeNames(this._root.names, this._constants); - } - } - _leafNode(node2) { - this._currNode.nodes.push(node2); - return this; - } - _blockNode(node2) { - this._currNode.nodes.push(node2); - this._nodes.push(node2); - } - _endBlockNode(N1, N2) { - const n = this._currNode; - if (n instanceof N1 || N2 && n instanceof N2) { - this._nodes.pop(); - return this; - } - throw new Error(`CodeGen: not in block "${N2 ? `${N1.kind}/${N2.kind}` : N1.kind}"`); - } - _elseNode(node2) { - const n = this._currNode; - if (!(n instanceof If)) { - throw new Error('CodeGen: "else" without "if"'); - } - this._currNode = n.else = node2; - return this; - } - get _root() { - return this._nodes[0]; - } - get _currNode() { - const ns = this._nodes; - return ns[ns.length - 1]; - } - set _currNode(node2) { - const ns = this._nodes; - ns[ns.length - 1] = node2; - } - } - exports.CodeGen = CodeGen; - function addNames(names, from) { - for (const n in from) - names[n] = (names[n] || 0) + (from[n] || 0); - return names; - } - function addExprNames(names, from) { - return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names; - } - function optimizeExpr(expr, names, constants) { - if (expr instanceof code_1.Name) - return replaceName(expr); - if (!canOptimize(expr)) - return expr; - return new code_1._Code(expr._items.reduce((items, c) => { - if (c instanceof code_1.Name) - c = replaceName(c); - if (c instanceof code_1._Code) - items.push(...c._items); - else - items.push(c); - return items; - }, [])); - function replaceName(n) { - const c = constants[n.str]; - if (c === void 0 || names[n.str] !== 1) - return n; - delete names[n.str]; - return c; - } - function canOptimize(e) { - return e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants[c.str] !== void 0); - } - } - function subtractNames(names, from) { - for (const n in from) - names[n] = (names[n] || 0) - (from[n] || 0); - } - function not(x) { - return typeof x == "boolean" || typeof x == "number" || x === null ? !x : (0, code_1._)`!${par(x)}`; - } - exports.not = not; - var andCode = mappend(exports.operators.AND); - function and(...args3) { - return args3.reduce(andCode); - } - exports.and = and; - var orCode = mappend(exports.operators.OR); - function or(...args3) { - return args3.reduce(orCode); - } - exports.or = or; - function mappend(op) { - return (x, y) => x === code_1.nil ? y : y === code_1.nil ? x : (0, code_1._)`${par(x)} ${op} ${par(y)}`; - } - function par(x) { - return x instanceof code_1.Name ? x : (0, code_1._)`(${x})`; - } -}); -var require_util16 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.checkStrictMode = exports.getErrorPath = exports.Type = exports.useFunc = exports.setEvaluated = exports.evaluatedPropsToName = exports.mergeEvaluated = exports.eachItem = exports.unescapeJsonPointer = exports.escapeJsonPointer = exports.escapeFragment = exports.unescapeFragment = exports.schemaRefOrVal = exports.schemaHasRulesButRef = exports.schemaHasRules = exports.checkUnknownRules = exports.alwaysValidSchema = exports.toHash = void 0; - var codegen_1 = require_codegen3(); - var code_1 = require_code4(); - function toHash(arr) { - const hash2 = {}; - for (const item of arr) - hash2[item] = true; - return hash2; - } - exports.toHash = toHash; - function alwaysValidSchema(it, schema2) { - if (typeof schema2 == "boolean") - return schema2; - if (Object.keys(schema2).length === 0) - return true; - checkUnknownRules(it, schema2); - return !schemaHasRules(schema2, it.self.RULES.all); - } - exports.alwaysValidSchema = alwaysValidSchema; - function checkUnknownRules(it, schema2 = it.schema) { - const { opts, self: self2 } = it; - if (!opts.strictSchema) - return; - if (typeof schema2 === "boolean") - return; - const rules = self2.RULES.keywords; - for (const key in schema2) { - if (!rules[key]) - checkStrictMode(it, `unknown keyword: "${key}"`); - } - } - exports.checkUnknownRules = checkUnknownRules; - function schemaHasRules(schema2, rules) { - if (typeof schema2 == "boolean") - return !schema2; - for (const key in schema2) - if (rules[key]) - return true; - return false; - } - exports.schemaHasRules = schemaHasRules; - function schemaHasRulesButRef(schema2, RULES) { - if (typeof schema2 == "boolean") - return !schema2; - for (const key in schema2) - if (key !== "$ref" && RULES.all[key]) - return true; - return false; - } - exports.schemaHasRulesButRef = schemaHasRulesButRef; - function schemaRefOrVal({ topSchemaRef, schemaPath }, schema2, keyword, $data) { - if (!$data) { - if (typeof schema2 == "number" || typeof schema2 == "boolean") - return schema2; - if (typeof schema2 == "string") - return (0, codegen_1._)`${schema2}`; - } - return (0, codegen_1._)`${topSchemaRef}${schemaPath}${(0, codegen_1.getProperty)(keyword)}`; - } - exports.schemaRefOrVal = schemaRefOrVal; - function unescapeFragment(str) { - return unescapeJsonPointer(decodeURIComponent(str)); - } - exports.unescapeFragment = unescapeFragment; - function escapeFragment(str) { - return encodeURIComponent(escapeJsonPointer(str)); - } - exports.escapeFragment = escapeFragment; - function escapeJsonPointer(str) { - if (typeof str == "number") - return `${str}`; - return str.replace(/~/g, "~0").replace(/\//g, "~1"); - } - exports.escapeJsonPointer = escapeJsonPointer; - function unescapeJsonPointer(str) { - return str.replace(/~1/g, "/").replace(/~0/g, "~"); - } - exports.unescapeJsonPointer = unescapeJsonPointer; - function eachItem(xs, f) { - if (Array.isArray(xs)) { - for (const x of xs) - f(x); - } else { - f(xs); - } - } - exports.eachItem = eachItem; - function makeMergeEvaluated({ mergeNames, mergeToName, mergeValues: mergeValues32, resultToName }) { - return (gen, from, to, toName) => { - const res = to === void 0 ? from : to instanceof codegen_1.Name ? (from instanceof codegen_1.Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to) : from instanceof codegen_1.Name ? (mergeToName(gen, to, from), from) : mergeValues32(from, to); - return toName === codegen_1.Name && !(res instanceof codegen_1.Name) ? resultToName(gen, res) : res; - }; - } - exports.mergeEvaluated = { - props: makeMergeEvaluated({ - mergeNames: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true && ${from} !== undefined`, () => { - gen.if((0, codegen_1._)`${from} === true`, () => gen.assign(to, true), () => gen.assign(to, (0, codegen_1._)`${to} || {}`).code((0, codegen_1._)`Object.assign(${to}, ${from})`)); - }), - mergeToName: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true`, () => { - if (from === true) { - gen.assign(to, true); - } else { - gen.assign(to, (0, codegen_1._)`${to} || {}`); - setEvaluated(gen, to, from); - } - }), - mergeValues: (from, to) => from === true ? true : { ...from, ...to }, - resultToName: evaluatedPropsToName - }), - items: makeMergeEvaluated({ - mergeNames: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true && ${from} !== undefined`, () => gen.assign(to, (0, codegen_1._)`${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`)), - mergeToName: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true`, () => gen.assign(to, from === true ? true : (0, codegen_1._)`${to} > ${from} ? ${to} : ${from}`)), - mergeValues: (from, to) => from === true ? true : Math.max(from, to), - resultToName: (gen, items) => gen.var("items", items) - }) - }; - function evaluatedPropsToName(gen, ps) { - if (ps === true) - return gen.var("props", true); - const props = gen.var("props", (0, codegen_1._)`{}`); - if (ps !== void 0) - setEvaluated(gen, props, ps); - return props; - } - exports.evaluatedPropsToName = evaluatedPropsToName; - function setEvaluated(gen, props, ps) { - Object.keys(ps).forEach((p) => gen.assign((0, codegen_1._)`${props}${(0, codegen_1.getProperty)(p)}`, true)); - } - exports.setEvaluated = setEvaluated; - var snippets = {}; - function useFunc(gen, f) { - return gen.scopeValue("func", { - ref: f, - code: snippets[f.code] || (snippets[f.code] = new code_1._Code(f.code)) - }); - } - exports.useFunc = useFunc; - var Type2; - (function(Type22) { - Type22[Type22["Num"] = 0] = "Num"; - Type22[Type22["Str"] = 1] = "Str"; - })(Type2 || (exports.Type = Type2 = {})); - function getErrorPath(dataProp, dataPropType, jsPropertySyntax) { - if (dataProp instanceof codegen_1.Name) { - const isNumber2 = dataPropType === Type2.Num; - return jsPropertySyntax ? isNumber2 ? (0, codegen_1._)`"[" + ${dataProp} + "]"` : (0, codegen_1._)`"['" + ${dataProp} + "']"` : isNumber2 ? (0, codegen_1._)`"/" + ${dataProp}` : (0, codegen_1._)`"/" + ${dataProp}.replace(/~/g, "~0").replace(/\\//g, "~1")`; - } - return jsPropertySyntax ? (0, codegen_1.getProperty)(dataProp).toString() : "/" + escapeJsonPointer(dataProp); - } - exports.getErrorPath = getErrorPath; - function checkStrictMode(it, msg, mode = it.opts.strictSchema) { - if (!mode) - return; - msg = `strict mode: ${msg}`; - if (mode === true) - throw new Error(msg); - it.self.logger.warn(msg); - } - exports.checkStrictMode = checkStrictMode; -}); -var require_names3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var codegen_1 = require_codegen3(); - var names = { - data: new codegen_1.Name("data"), - valCxt: new codegen_1.Name("valCxt"), - instancePath: new codegen_1.Name("instancePath"), - parentData: new codegen_1.Name("parentData"), - parentDataProperty: new codegen_1.Name("parentDataProperty"), - rootData: new codegen_1.Name("rootData"), - dynamicAnchors: new codegen_1.Name("dynamicAnchors"), - vErrors: new codegen_1.Name("vErrors"), - errors: new codegen_1.Name("errors"), - this: new codegen_1.Name("this"), - self: new codegen_1.Name("self"), - scope: new codegen_1.Name("scope"), - json: new codegen_1.Name("json"), - jsonPos: new codegen_1.Name("jsonPos"), - jsonLen: new codegen_1.Name("jsonLen"), - jsonPart: new codegen_1.Name("jsonPart") - }; - exports.default = names; -}); -var require_errors5 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.extendErrors = exports.resetErrorsCount = exports.reportExtraError = exports.reportError = exports.keyword$DataError = exports.keywordError = void 0; - var codegen_1 = require_codegen3(); - var util_1 = require_util16(); - var names_1 = require_names3(); - exports.keywordError = { - message: ({ keyword }) => (0, codegen_1.str)`must pass "${keyword}" keyword validation` - }; - exports.keyword$DataError = { - message: ({ keyword, schemaType }) => schemaType ? (0, codegen_1.str)`"${keyword}" keyword must be ${schemaType} ($data)` : (0, codegen_1.str)`"${keyword}" keyword is invalid ($data)` - }; - function reportError(cxt, error210 = exports.keywordError, errorPaths, overrideAllErrors) { - const { it } = cxt; - const { gen, compositeRule, allErrors } = it; - const errObj = errorObjectCode(cxt, error210, errorPaths); - if (overrideAllErrors !== null && overrideAllErrors !== void 0 ? overrideAllErrors : compositeRule || allErrors) { - addError(gen, errObj); - } else { - returnErrors(it, (0, codegen_1._)`[${errObj}]`); - } - } - exports.reportError = reportError; - function reportExtraError(cxt, error210 = exports.keywordError, errorPaths) { - const { it } = cxt; - const { gen, compositeRule, allErrors } = it; - const errObj = errorObjectCode(cxt, error210, errorPaths); - addError(gen, errObj); - if (!(compositeRule || allErrors)) { - returnErrors(it, names_1.default.vErrors); - } - } - exports.reportExtraError = reportExtraError; - function resetErrorsCount(gen, errsCount) { - gen.assign(names_1.default.errors, errsCount); - gen.if((0, codegen_1._)`${names_1.default.vErrors} !== null`, () => gen.if(errsCount, () => gen.assign((0, codegen_1._)`${names_1.default.vErrors}.length`, errsCount), () => gen.assign(names_1.default.vErrors, null))); - } - exports.resetErrorsCount = resetErrorsCount; - function extendErrors({ gen, keyword, schemaValue, data, errsCount, it }) { - if (errsCount === void 0) - throw new Error("ajv implementation error"); - const err = gen.name("err"); - gen.forRange("i", errsCount, names_1.default.errors, (i) => { - gen.const(err, (0, codegen_1._)`${names_1.default.vErrors}[${i}]`); - gen.if((0, codegen_1._)`${err}.instancePath === undefined`, () => gen.assign((0, codegen_1._)`${err}.instancePath`, (0, codegen_1.strConcat)(names_1.default.instancePath, it.errorPath))); - gen.assign((0, codegen_1._)`${err}.schemaPath`, (0, codegen_1.str)`${it.errSchemaPath}/${keyword}`); - if (it.opts.verbose) { - gen.assign((0, codegen_1._)`${err}.schema`, schemaValue); - gen.assign((0, codegen_1._)`${err}.data`, data); - } - }); - } - exports.extendErrors = extendErrors; - function addError(gen, errObj) { - const err = gen.const("err", errObj); - gen.if((0, codegen_1._)`${names_1.default.vErrors} === null`, () => gen.assign(names_1.default.vErrors, (0, codegen_1._)`[${err}]`), (0, codegen_1._)`${names_1.default.vErrors}.push(${err})`); - gen.code((0, codegen_1._)`${names_1.default.errors}++`); - } - function returnErrors(it, errs) { - const { gen, validateName, schemaEnv } = it; - if (schemaEnv.$async) { - gen.throw((0, codegen_1._)`new ${it.ValidationError}(${errs})`); - } else { - gen.assign((0, codegen_1._)`${validateName}.errors`, errs); - gen.return(false); - } - } - var E = { - keyword: new codegen_1.Name("keyword"), - schemaPath: new codegen_1.Name("schemaPath"), - params: new codegen_1.Name("params"), - propertyName: new codegen_1.Name("propertyName"), - message: new codegen_1.Name("message"), - schema: new codegen_1.Name("schema"), - parentSchema: new codegen_1.Name("parentSchema") - }; - function errorObjectCode(cxt, error210, errorPaths) { - const { createErrors } = cxt.it; - if (createErrors === false) - return (0, codegen_1._)`{}`; - return errorObject(cxt, error210, errorPaths); - } - function errorObject(cxt, error210, errorPaths = {}) { - const { gen, it } = cxt; - const keyValues = [ - errorInstancePath(it, errorPaths), - errorSchemaPath(cxt, errorPaths) - ]; - extraErrorProps(cxt, error210, keyValues); - return gen.object(...keyValues); - } - function errorInstancePath({ errorPath }, { instancePath }) { - const instPath = instancePath ? (0, codegen_1.str)`${errorPath}${(0, util_1.getErrorPath)(instancePath, util_1.Type.Str)}` : errorPath; - return [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, instPath)]; - } - function errorSchemaPath({ keyword, it: { errSchemaPath } }, { schemaPath, parentSchema }) { - let schPath = parentSchema ? errSchemaPath : (0, codegen_1.str)`${errSchemaPath}/${keyword}`; - if (schemaPath) { - schPath = (0, codegen_1.str)`${schPath}${(0, util_1.getErrorPath)(schemaPath, util_1.Type.Str)}`; - } - return [E.schemaPath, schPath]; - } - function extraErrorProps(cxt, { params, message }, keyValues) { - const { keyword, data, schemaValue, it } = cxt; - const { opts, propertyName, topSchemaRef, schemaPath } = it; - keyValues.push([E.keyword, keyword], [E.params, typeof params == "function" ? params(cxt) : params || (0, codegen_1._)`{}`]); - if (opts.messages) { - keyValues.push([E.message, typeof message == "function" ? message(cxt) : message]); - } - if (opts.verbose) { - keyValues.push([E.schema, schemaValue], [E.parentSchema, (0, codegen_1._)`${topSchemaRef}${schemaPath}`], [names_1.default.data, data]); - } - if (propertyName) - keyValues.push([E.propertyName, propertyName]); - } -}); -var require_boolSchema3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.boolOrEmptySchema = exports.topBoolOrEmptySchema = void 0; - var errors_1 = require_errors5(); - var codegen_1 = require_codegen3(); - var names_1 = require_names3(); - var boolError = { - message: "boolean schema is false" - }; - function topBoolOrEmptySchema(it) { - const { gen, schema: schema2, validateName } = it; - if (schema2 === false) { - falseSchemaError(it, false); - } else if (typeof schema2 == "object" && schema2.$async === true) { - gen.return(names_1.default.data); - } else { - gen.assign((0, codegen_1._)`${validateName}.errors`, null); - gen.return(true); - } - } - exports.topBoolOrEmptySchema = topBoolOrEmptySchema; - function boolOrEmptySchema(it, valid) { - const { gen, schema: schema2 } = it; - if (schema2 === false) { - gen.var(valid, false); - falseSchemaError(it); - } else { - gen.var(valid, true); - } - } - exports.boolOrEmptySchema = boolOrEmptySchema; - function falseSchemaError(it, overrideAllErrors) { - const { gen, data } = it; - const cxt = { - gen, - keyword: "false schema", - data, - schema: false, - schemaCode: false, - schemaValue: false, - params: {}, - it - }; - (0, errors_1.reportError)(cxt, boolError, void 0, overrideAllErrors); - } -}); -var require_rules3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getRules = exports.isJSONType = void 0; - var _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"]; - var jsonTypes = new Set(_jsonTypes); - function isJSONType(x) { - return typeof x == "string" && jsonTypes.has(x); - } - exports.isJSONType = isJSONType; - function getRules() { - const groups2 = { - number: { type: "number", rules: [] }, - string: { type: "string", rules: [] }, - array: { type: "array", rules: [] }, - object: { type: "object", rules: [] } - }; - return { - types: { ...groups2, integer: true, boolean: true, null: true }, - rules: [{ rules: [] }, groups2.number, groups2.string, groups2.array, groups2.object], - post: { rules: [] }, - all: {}, - keywords: {} - }; - } - exports.getRules = getRules; -}); -var require_applicability3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.shouldUseRule = exports.shouldUseGroup = exports.schemaHasRulesForType = void 0; - function schemaHasRulesForType({ schema: schema2, self: self2 }, type2) { - const group2 = self2.RULES.types[type2]; - return group2 && group2 !== true && shouldUseGroup(schema2, group2); - } - exports.schemaHasRulesForType = schemaHasRulesForType; - function shouldUseGroup(schema2, group2) { - return group2.rules.some((rule) => shouldUseRule(schema2, rule)); - } - exports.shouldUseGroup = shouldUseGroup; - function shouldUseRule(schema2, rule) { - var _a2; - return schema2[rule.keyword] !== void 0 || ((_a2 = rule.definition.implements) === null || _a2 === void 0 ? void 0 : _a2.some((kwd) => schema2[kwd] !== void 0)); - } - exports.shouldUseRule = shouldUseRule; -}); -var require_dataType3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.reportTypeError = exports.checkDataTypes = exports.checkDataType = exports.coerceAndCheckDataType = exports.getJSONTypes = exports.getSchemaTypes = exports.DataType = void 0; - var rules_1 = require_rules3(); - var applicability_1 = require_applicability3(); - var errors_1 = require_errors5(); - var codegen_1 = require_codegen3(); - var util_1 = require_util16(); - var DataType; - (function(DataType2) { - DataType2[DataType2["Correct"] = 0] = "Correct"; - DataType2[DataType2["Wrong"] = 1] = "Wrong"; - })(DataType || (exports.DataType = DataType = {})); - function getSchemaTypes(schema2) { - const types = getJSONTypes(schema2.type); - const hasNull = types.includes("null"); - if (hasNull) { - if (schema2.nullable === false) - throw new Error("type: null contradicts nullable: false"); - } else { - if (!types.length && schema2.nullable !== void 0) { - throw new Error('"nullable" cannot be used without "type"'); - } - if (schema2.nullable === true) - types.push("null"); - } - return types; - } - exports.getSchemaTypes = getSchemaTypes; - function getJSONTypes(ts) { - const types = Array.isArray(ts) ? ts : ts ? [ts] : []; - if (types.every(rules_1.isJSONType)) - return types; - throw new Error("type must be JSONType or JSONType[]: " + types.join(",")); - } - exports.getJSONTypes = getJSONTypes; - function coerceAndCheckDataType(it, types) { - const { gen, data, opts } = it; - const coerceTo = coerceToTypes(types, opts.coerceTypes); - const checkTypes = types.length > 0 && !(coerceTo.length === 0 && types.length === 1 && (0, applicability_1.schemaHasRulesForType)(it, types[0])); - if (checkTypes) { - const wrongType = checkDataTypes(types, data, opts.strictNumbers, DataType.Wrong); - gen.if(wrongType, () => { - if (coerceTo.length) - coerceData(it, types, coerceTo); - else - reportTypeError(it); - }); - } - return checkTypes; - } - exports.coerceAndCheckDataType = coerceAndCheckDataType; - var COERCIBLE = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]); - function coerceToTypes(types, coerceTypes) { - return coerceTypes ? types.filter((t) => COERCIBLE.has(t) || coerceTypes === "array" && t === "array") : []; - } - function coerceData(it, types, coerceTo) { - const { gen, data, opts } = it; - const dataType = gen.let("dataType", (0, codegen_1._)`typeof ${data}`); - const coerced = gen.let("coerced", (0, codegen_1._)`undefined`); - if (opts.coerceTypes === "array") { - gen.if((0, codegen_1._)`${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen.assign(data, (0, codegen_1._)`${data}[0]`).assign(dataType, (0, codegen_1._)`typeof ${data}`).if(checkDataTypes(types, data, opts.strictNumbers), () => gen.assign(coerced, data))); - } - gen.if((0, codegen_1._)`${coerced} !== undefined`); - for (const t of coerceTo) { - if (COERCIBLE.has(t) || t === "array" && opts.coerceTypes === "array") { - coerceSpecificType(t); - } - } - gen.else(); - reportTypeError(it); - gen.endIf(); - gen.if((0, codegen_1._)`${coerced} !== undefined`, () => { - gen.assign(data, coerced); - assignParentData(it, coerced); - }); - function coerceSpecificType(t) { - switch (t) { - case "string": - gen.elseIf((0, codegen_1._)`${dataType} == "number" || ${dataType} == "boolean"`).assign(coerced, (0, codegen_1._)`"" + ${data}`).elseIf((0, codegen_1._)`${data} === null`).assign(coerced, (0, codegen_1._)`""`); - return; - case "number": - gen.elseIf((0, codegen_1._)`${dataType} == "boolean" || ${data} === null - || (${dataType} == "string" && ${data} && ${data} == +${data})`).assign(coerced, (0, codegen_1._)`+${data}`); - return; - case "integer": - gen.elseIf((0, codegen_1._)`${dataType} === "boolean" || ${data} === null - || (${dataType} === "string" && ${data} && ${data} == +${data} && !(${data} % 1))`).assign(coerced, (0, codegen_1._)`+${data}`); - return; - case "boolean": - gen.elseIf((0, codegen_1._)`${data} === "false" || ${data} === 0 || ${data} === null`).assign(coerced, false).elseIf((0, codegen_1._)`${data} === "true" || ${data} === 1`).assign(coerced, true); - return; - case "null": - gen.elseIf((0, codegen_1._)`${data} === "" || ${data} === 0 || ${data} === false`); - gen.assign(coerced, null); - return; - case "array": - gen.elseIf((0, codegen_1._)`${dataType} === "string" || ${dataType} === "number" - || ${dataType} === "boolean" || ${data} === null`).assign(coerced, (0, codegen_1._)`[${data}]`); - } - } - } - function assignParentData({ gen, parentData, parentDataProperty }, expr) { - gen.if((0, codegen_1._)`${parentData} !== undefined`, () => gen.assign((0, codegen_1._)`${parentData}[${parentDataProperty}]`, expr)); - } - function checkDataType(dataType, data, strictNums, correct = DataType.Correct) { - const EQ = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ; - let cond; - switch (dataType) { - case "null": - return (0, codegen_1._)`${data} ${EQ} null`; - case "array": - cond = (0, codegen_1._)`Array.isArray(${data})`; - break; - case "object": - cond = (0, codegen_1._)`${data} && typeof ${data} == "object" && !Array.isArray(${data})`; - break; - case "integer": - cond = numCond((0, codegen_1._)`!(${data} % 1) && !isNaN(${data})`); - break; - case "number": - cond = numCond(); - break; - default: - return (0, codegen_1._)`typeof ${data} ${EQ} ${dataType}`; - } - return correct === DataType.Correct ? cond : (0, codegen_1.not)(cond); - function numCond(_cond = codegen_1.nil) { - return (0, codegen_1.and)((0, codegen_1._)`typeof ${data} == "number"`, _cond, strictNums ? (0, codegen_1._)`isFinite(${data})` : codegen_1.nil); - } - } - exports.checkDataType = checkDataType; - function checkDataTypes(dataTypes, data, strictNums, correct) { - if (dataTypes.length === 1) { - return checkDataType(dataTypes[0], data, strictNums, correct); - } - let cond; - const types = (0, util_1.toHash)(dataTypes); - if (types.array && types.object) { - const notObj = (0, codegen_1._)`typeof ${data} != "object"`; - cond = types.null ? notObj : (0, codegen_1._)`!${data} || ${notObj}`; - delete types.null; - delete types.array; - delete types.object; - } else { - cond = codegen_1.nil; - } - if (types.number) - delete types.integer; - for (const t in types) - cond = (0, codegen_1.and)(cond, checkDataType(t, data, strictNums, correct)); - return cond; - } - exports.checkDataTypes = checkDataTypes; - var typeError = { - message: ({ schema: schema2 }) => `must be ${schema2}`, - params: ({ schema: schema2, schemaValue }) => typeof schema2 == "string" ? (0, codegen_1._)`{type: ${schema2}}` : (0, codegen_1._)`{type: ${schemaValue}}` - }; - function reportTypeError(it) { - const cxt = getTypeErrorContext(it); - (0, errors_1.reportError)(cxt, typeError); - } - exports.reportTypeError = reportTypeError; - function getTypeErrorContext(it) { - const { gen, data, schema: schema2 } = it; - const schemaCode = (0, util_1.schemaRefOrVal)(it, schema2, "type"); - return { - gen, - keyword: "type", - data, - schema: schema2.type, - schemaCode, - schemaValue: schemaCode, - parentSchema: schema2, - params: {}, - it - }; - } -}); -var require_defaults3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.assignDefaults = void 0; - var codegen_1 = require_codegen3(); - var util_1 = require_util16(); - function assignDefaults(it, ty) { - const { properties, items } = it.schema; - if (ty === "object" && properties) { - for (const key in properties) { - assignDefault(it, key, properties[key].default); - } - } else if (ty === "array" && Array.isArray(items)) { - items.forEach((sch, i) => assignDefault(it, i, sch.default)); - } - } - exports.assignDefaults = assignDefaults; - function assignDefault(it, prop, defaultValue) { - const { gen, compositeRule, data, opts } = it; - if (defaultValue === void 0) - return; - const childData = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(prop)}`; - if (compositeRule) { - (0, util_1.checkStrictMode)(it, `default is ignored for: ${childData}`); - return; - } - let condition = (0, codegen_1._)`${childData} === undefined`; - if (opts.useDefaults === "empty") { - condition = (0, codegen_1._)`${condition} || ${childData} === null || ${childData} === ""`; - } - gen.if(condition, (0, codegen_1._)`${childData} = ${(0, codegen_1.stringify)(defaultValue)}`); - } -}); -var require_code22 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.validateUnion = exports.validateArray = exports.usePattern = exports.callValidateCode = exports.schemaProperties = exports.allSchemaProperties = exports.noPropertyInData = exports.propertyInData = exports.isOwnProperty = exports.hasPropFunc = exports.reportMissingProp = exports.checkMissingProp = exports.checkReportMissingProp = void 0; - var codegen_1 = require_codegen3(); - var util_1 = require_util16(); - var names_1 = require_names3(); - var util_2 = require_util16(); - function checkReportMissingProp(cxt, prop) { - const { gen, data, it } = cxt; - gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => { - cxt.setParams({ missingProperty: (0, codegen_1._)`${prop}` }, true); - cxt.error(); - }); - } - exports.checkReportMissingProp = checkReportMissingProp; - function checkMissingProp({ gen, data, it: { opts } }, properties, missing) { - return (0, codegen_1.or)(...properties.map((prop) => (0, codegen_1.and)(noPropertyInData(gen, data, prop, opts.ownProperties), (0, codegen_1._)`${missing} = ${prop}`))); - } - exports.checkMissingProp = checkMissingProp; - function reportMissingProp(cxt, missing) { - cxt.setParams({ missingProperty: missing }, true); - cxt.error(); - } - exports.reportMissingProp = reportMissingProp; - function hasPropFunc(gen) { - return gen.scopeValue("func", { - ref: Object.prototype.hasOwnProperty, - code: (0, codegen_1._)`Object.prototype.hasOwnProperty` - }); - } - exports.hasPropFunc = hasPropFunc; - function isOwnProperty(gen, data, property) { - return (0, codegen_1._)`${hasPropFunc(gen)}.call(${data}, ${property})`; - } - exports.isOwnProperty = isOwnProperty; - function propertyInData(gen, data, property, ownProperties) { - const cond = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(property)} !== undefined`; - return ownProperties ? (0, codegen_1._)`${cond} && ${isOwnProperty(gen, data, property)}` : cond; - } - exports.propertyInData = propertyInData; - function noPropertyInData(gen, data, property, ownProperties) { - const cond = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(property)} === undefined`; - return ownProperties ? (0, codegen_1.or)(cond, (0, codegen_1.not)(isOwnProperty(gen, data, property))) : cond; - } - exports.noPropertyInData = noPropertyInData; - function allSchemaProperties(schemaMap) { - return schemaMap ? Object.keys(schemaMap).filter((p) => p !== "__proto__") : []; - } - exports.allSchemaProperties = allSchemaProperties; - function schemaProperties(it, schemaMap) { - return allSchemaProperties(schemaMap).filter((p) => !(0, util_1.alwaysValidSchema)(it, schemaMap[p])); - } - exports.schemaProperties = schemaProperties; - function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context, passSchema) { - const dataAndSchema = passSchema ? (0, codegen_1._)`${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data; - const valCxt = [ - [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, errorPath)], - [names_1.default.parentData, it.parentData], - [names_1.default.parentDataProperty, it.parentDataProperty], - [names_1.default.rootData, names_1.default.rootData] - ]; - if (it.opts.dynamicRef) - valCxt.push([names_1.default.dynamicAnchors, names_1.default.dynamicAnchors]); - const args3 = (0, codegen_1._)`${dataAndSchema}, ${gen.object(...valCxt)}`; - return context !== codegen_1.nil ? (0, codegen_1._)`${func}.call(${context}, ${args3})` : (0, codegen_1._)`${func}(${args3})`; - } - exports.callValidateCode = callValidateCode; - var newRegExp = (0, codegen_1._)`new RegExp`; - function usePattern({ gen, it: { opts } }, pattern) { - const u = opts.unicodeRegExp ? "u" : ""; - const { regExp } = opts.code; - const rx = regExp(pattern, u); - return gen.scopeValue("pattern", { - key: rx.toString(), - ref: rx, - code: (0, codegen_1._)`${regExp.code === "new RegExp" ? newRegExp : (0, util_2.useFunc)(gen, regExp)}(${pattern}, ${u})` - }); - } - exports.usePattern = usePattern; - function validateArray(cxt) { - const { gen, data, keyword, it } = cxt; - const valid = gen.name("valid"); - if (it.allErrors) { - const validArr = gen.let("valid", true); - validateItems(() => gen.assign(validArr, false)); - return validArr; - } - gen.var(valid, true); - validateItems(() => gen.break()); - return valid; - function validateItems(notValid) { - const len = gen.const("len", (0, codegen_1._)`${data}.length`); - gen.forRange("i", 0, len, (i) => { - cxt.subschema({ - keyword, - dataProp: i, - dataPropType: util_1.Type.Num - }, valid); - gen.if((0, codegen_1.not)(valid), notValid); - }); - } - } - exports.validateArray = validateArray; - function validateUnion(cxt) { - const { gen, schema: schema2, keyword, it } = cxt; - if (!Array.isArray(schema2)) - throw new Error("ajv implementation error"); - const alwaysValid = schema2.some((sch) => (0, util_1.alwaysValidSchema)(it, sch)); - if (alwaysValid && !it.opts.unevaluated) - return; - const valid = gen.let("valid", false); - const schValid = gen.name("_valid"); - gen.block(() => schema2.forEach((_sch, i) => { - const schCxt = cxt.subschema({ - keyword, - schemaProp: i, - compositeRule: true - }, schValid); - gen.assign(valid, (0, codegen_1._)`${valid} || ${schValid}`); - const merged = cxt.mergeValidEvaluated(schCxt, schValid); - if (!merged) - gen.if((0, codegen_1.not)(valid)); - })); - cxt.result(valid, () => cxt.reset(), () => cxt.error(true)); - } - exports.validateUnion = validateUnion; -}); -var require_keyword3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.validateKeywordUsage = exports.validSchemaType = exports.funcKeywordCode = exports.macroKeywordCode = void 0; - var codegen_1 = require_codegen3(); - var names_1 = require_names3(); - var code_1 = require_code22(); - var errors_1 = require_errors5(); - function macroKeywordCode(cxt, def) { - const { gen, keyword, schema: schema2, parentSchema, it } = cxt; - const macroSchema = def.macro.call(it.self, schema2, parentSchema, it); - const schemaRef = useKeyword(gen, keyword, macroSchema); - if (it.opts.validateSchema !== false) - it.self.validateSchema(macroSchema, true); - const valid = gen.name("valid"); - cxt.subschema({ - schema: macroSchema, - schemaPath: codegen_1.nil, - errSchemaPath: `${it.errSchemaPath}/${keyword}`, - topSchemaRef: schemaRef, - compositeRule: true - }, valid); - cxt.pass(valid, () => cxt.error(true)); - } - exports.macroKeywordCode = macroKeywordCode; - function funcKeywordCode(cxt, def) { - var _a2; - const { gen, keyword, schema: schema2, parentSchema, $data, it } = cxt; - checkAsyncKeyword(it, def); - const validate2 = !$data && def.compile ? def.compile.call(it.self, schema2, parentSchema, it) : def.validate; - const validateRef = useKeyword(gen, keyword, validate2); - const valid = gen.let("valid"); - cxt.block$data(valid, validateKeyword); - cxt.ok((_a2 = def.valid) !== null && _a2 !== void 0 ? _a2 : valid); - function validateKeyword() { - if (def.errors === false) { - assignValid(); - if (def.modifying) - modifyData(cxt); - reportErrs(() => cxt.error()); - } else { - const ruleErrs = def.async ? validateAsync() : validateSync(); - if (def.modifying) - modifyData(cxt); - reportErrs(() => addErrs(cxt, ruleErrs)); - } - } - function validateAsync() { - const ruleErrs = gen.let("ruleErrs", null); - gen.try(() => assignValid((0, codegen_1._)`await `), (e) => gen.assign(valid, false).if((0, codegen_1._)`${e} instanceof ${it.ValidationError}`, () => gen.assign(ruleErrs, (0, codegen_1._)`${e}.errors`), () => gen.throw(e))); - return ruleErrs; - } - function validateSync() { - const validateErrs = (0, codegen_1._)`${validateRef}.errors`; - gen.assign(validateErrs, null); - assignValid(codegen_1.nil); - return validateErrs; - } - function assignValid(_await = def.async ? (0, codegen_1._)`await ` : codegen_1.nil) { - const passCxt = it.opts.passContext ? names_1.default.this : names_1.default.self; - const passSchema = !("compile" in def && !$data || def.schema === false); - gen.assign(valid, (0, codegen_1._)`${_await}${(0, code_1.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def.modifying); - } - function reportErrs(errors3) { - var _a22; - gen.if((0, codegen_1.not)((_a22 = def.valid) !== null && _a22 !== void 0 ? _a22 : valid), errors3); - } - } - exports.funcKeywordCode = funcKeywordCode; - function modifyData(cxt) { - const { gen, data, it } = cxt; - gen.if(it.parentData, () => gen.assign(data, (0, codegen_1._)`${it.parentData}[${it.parentDataProperty}]`)); - } - function addErrs(cxt, errs) { - const { gen } = cxt; - gen.if((0, codegen_1._)`Array.isArray(${errs})`, () => { - gen.assign(names_1.default.vErrors, (0, codegen_1._)`${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`).assign(names_1.default.errors, (0, codegen_1._)`${names_1.default.vErrors}.length`); - (0, errors_1.extendErrors)(cxt); - }, () => cxt.error()); - } - function checkAsyncKeyword({ schemaEnv }, def) { - if (def.async && !schemaEnv.$async) - throw new Error("async keyword in sync schema"); - } - function useKeyword(gen, keyword, result) { - if (result === void 0) - throw new Error(`keyword "${keyword}" failed to compile`); - return gen.scopeValue("keyword", typeof result == "function" ? { ref: result } : { ref: result, code: (0, codegen_1.stringify)(result) }); - } - function validSchemaType(schema2, schemaType, allowUndefined = false) { - return !schemaType.length || schemaType.some((st) => st === "array" ? Array.isArray(schema2) : st === "object" ? schema2 && typeof schema2 == "object" && !Array.isArray(schema2) : typeof schema2 == st || allowUndefined && typeof schema2 == "undefined"); - } - exports.validSchemaType = validSchemaType; - function validateKeywordUsage({ schema: schema2, opts, self: self2, errSchemaPath }, def, keyword) { - if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) { - throw new Error("ajv implementation error"); - } - const deps = def.dependencies; - if (deps === null || deps === void 0 ? void 0 : deps.some((kwd) => !Object.prototype.hasOwnProperty.call(schema2, kwd))) { - throw new Error(`parent schema must have dependencies of ${keyword}: ${deps.join(",")}`); - } - if (def.validateSchema) { - const valid = def.validateSchema(schema2[keyword]); - if (!valid) { - const msg = `keyword "${keyword}" value is invalid at path "${errSchemaPath}": ` + self2.errorsText(def.validateSchema.errors); - if (opts.validateSchema === "log") - self2.logger.error(msg); - else - throw new Error(msg); - } - } - } - exports.validateKeywordUsage = validateKeywordUsage; -}); -var require_subschema3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.extendSubschemaMode = exports.extendSubschemaData = exports.getSubschema = void 0; - var codegen_1 = require_codegen3(); - var util_1 = require_util16(); - function getSubschema(it, { keyword, schemaProp, schema: schema2, schemaPath, errSchemaPath, topSchemaRef }) { - if (keyword !== void 0 && schema2 !== void 0) { - throw new Error('both "keyword" and "schema" passed, only one allowed'); - } - if (keyword !== void 0) { - const sch = it.schema[keyword]; - return schemaProp === void 0 ? { - schema: sch, - schemaPath: (0, codegen_1._)`${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}`, - errSchemaPath: `${it.errSchemaPath}/${keyword}` - } : { - schema: sch[schemaProp], - schemaPath: (0, codegen_1._)`${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}${(0, codegen_1.getProperty)(schemaProp)}`, - errSchemaPath: `${it.errSchemaPath}/${keyword}/${(0, util_1.escapeFragment)(schemaProp)}` - }; - } - if (schema2 !== void 0) { - if (schemaPath === void 0 || errSchemaPath === void 0 || topSchemaRef === void 0) { - throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"'); - } - return { - schema: schema2, - schemaPath, - topSchemaRef, - errSchemaPath - }; - } - throw new Error('either "keyword" or "schema" must be passed'); - } - exports.getSubschema = getSubschema; - function extendSubschemaData(subschema, it, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }) { - if (data !== void 0 && dataProp !== void 0) { - throw new Error('both "data" and "dataProp" passed, only one allowed'); - } - const { gen } = it; - if (dataProp !== void 0) { - const { errorPath, dataPathArr, opts } = it; - const nextData = gen.let("data", (0, codegen_1._)`${it.data}${(0, codegen_1.getProperty)(dataProp)}`, true); - dataContextProps(nextData); - subschema.errorPath = (0, codegen_1.str)`${errorPath}${(0, util_1.getErrorPath)(dataProp, dpType, opts.jsPropertySyntax)}`; - subschema.parentDataProperty = (0, codegen_1._)`${dataProp}`; - subschema.dataPathArr = [...dataPathArr, subschema.parentDataProperty]; - } - if (data !== void 0) { - const nextData = data instanceof codegen_1.Name ? data : gen.let("data", data, true); - dataContextProps(nextData); - if (propertyName !== void 0) - subschema.propertyName = propertyName; - } - if (dataTypes) - subschema.dataTypes = dataTypes; - function dataContextProps(_nextData) { - subschema.data = _nextData; - subschema.dataLevel = it.dataLevel + 1; - subschema.dataTypes = []; - it.definedProperties = /* @__PURE__ */ new Set(); - subschema.parentData = it.data; - subschema.dataNames = [...it.dataNames, _nextData]; - } - } - exports.extendSubschemaData = extendSubschemaData; - function extendSubschemaMode(subschema, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }) { - if (compositeRule !== void 0) - subschema.compositeRule = compositeRule; - if (createErrors !== void 0) - subschema.createErrors = createErrors; - if (allErrors !== void 0) - subschema.allErrors = allErrors; - subschema.jtdDiscriminator = jtdDiscriminator; - subschema.jtdMetadata = jtdMetadata; - } - exports.extendSubschemaMode = extendSubschemaMode; -}); -var require_fast_deep_equal3 = __commonJS2((exports, module) => { - module.exports = function equal(a, b) { - if (a === b) - return true; - if (a && b && typeof a == "object" && typeof b == "object") { - if (a.constructor !== b.constructor) - return false; - var length, i, keys; - if (Array.isArray(a)) { - length = a.length; - if (length != b.length) - return false; - for (i = length; i-- !== 0; ) - if (!equal(a[i], b[i])) - return false; - return true; - } - if (a.constructor === RegExp) - return a.source === b.source && a.flags === b.flags; - if (a.valueOf !== Object.prototype.valueOf) - return a.valueOf() === b.valueOf(); - if (a.toString !== Object.prototype.toString) - return a.toString() === b.toString(); - keys = Object.keys(a); - length = keys.length; - if (length !== Object.keys(b).length) - return false; - for (i = length; i-- !== 0; ) - if (!Object.prototype.hasOwnProperty.call(b, keys[i])) - return false; - for (i = length; i-- !== 0; ) { - var key = keys[i]; - if (!equal(a[key], b[key])) - return false; - } - return true; - } - return a !== a && b !== b; - }; -}); -var require_json_schema_traverse3 = __commonJS2((exports, module) => { - var traverse = module.exports = function(schema2, opts, cb) { - if (typeof opts == "function") { - cb = opts; - opts = {}; - } - cb = opts.cb || cb; - var pre = typeof cb == "function" ? cb : cb.pre || function() { - }; - var post = cb.post || function() { - }; - _traverse(opts, pre, post, schema2, "", schema2); - }; - traverse.keywords = { - additionalItems: true, - items: true, - contains: true, - additionalProperties: true, - propertyNames: true, - not: true, - if: true, - then: true, - else: true - }; - traverse.arrayKeywords = { - items: true, - allOf: true, - anyOf: true, - oneOf: true - }; - traverse.propsKeywords = { - $defs: true, - definitions: true, - properties: true, - patternProperties: true, - dependencies: true - }; - traverse.skipKeywords = { - default: true, - enum: true, - const: true, - required: true, - maximum: true, - minimum: true, - exclusiveMaximum: true, - exclusiveMinimum: true, - multipleOf: true, - maxLength: true, - minLength: true, - pattern: true, - format: true, - maxItems: true, - minItems: true, - uniqueItems: true, - maxProperties: true, - minProperties: true - }; - function _traverse(opts, pre, post, schema2, jsonPtr, rootSchema2, parentJsonPtr, parentKeyword, parentSchema, keyIndex) { - if (schema2 && typeof schema2 == "object" && !Array.isArray(schema2)) { - pre(schema2, jsonPtr, rootSchema2, parentJsonPtr, parentKeyword, parentSchema, keyIndex); - for (var key in schema2) { - var sch = schema2[key]; - if (Array.isArray(sch)) { - if (key in traverse.arrayKeywords) { - for (var i = 0; i < sch.length; i++) - _traverse(opts, pre, post, sch[i], jsonPtr + "/" + key + "/" + i, rootSchema2, jsonPtr, key, schema2, i); - } - } else if (key in traverse.propsKeywords) { - if (sch && typeof sch == "object") { - for (var prop in sch) - _traverse(opts, pre, post, sch[prop], jsonPtr + "/" + key + "/" + escapeJsonPtr(prop), rootSchema2, jsonPtr, key, schema2, prop); - } - } else if (key in traverse.keywords || opts.allKeys && !(key in traverse.skipKeywords)) { - _traverse(opts, pre, post, sch, jsonPtr + "/" + key, rootSchema2, jsonPtr, key, schema2); - } - } - post(schema2, jsonPtr, rootSchema2, parentJsonPtr, parentKeyword, parentSchema, keyIndex); - } - } - function escapeJsonPtr(str) { - return str.replace(/~/g, "~0").replace(/\//g, "~1"); - } -}); -var require_resolve3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getSchemaRefs = exports.resolveUrl = exports.normalizeId = exports._getFullPath = exports.getFullPath = exports.inlineRef = void 0; - var util_1 = require_util16(); - var equal = require_fast_deep_equal3(); - var traverse = require_json_schema_traverse3(); - var SIMPLE_INLINED = /* @__PURE__ */ new Set([ - "type", - "format", - "pattern", - "maxLength", - "minLength", - "maxProperties", - "minProperties", - "maxItems", - "minItems", - "maximum", - "minimum", - "uniqueItems", - "multipleOf", - "required", - "enum", - "const" - ]); - function inlineRef(schema2, limit = true) { - if (typeof schema2 == "boolean") - return true; - if (limit === true) - return !hasRef(schema2); - if (!limit) - return false; - return countKeys(schema2) <= limit; - } - exports.inlineRef = inlineRef; - var REF_KEYWORDS = /* @__PURE__ */ new Set([ - "$ref", - "$recursiveRef", - "$recursiveAnchor", - "$dynamicRef", - "$dynamicAnchor" - ]); - function hasRef(schema2) { - for (const key in schema2) { - if (REF_KEYWORDS.has(key)) - return true; - const sch = schema2[key]; - if (Array.isArray(sch) && sch.some(hasRef)) - return true; - if (typeof sch == "object" && hasRef(sch)) - return true; - } - return false; - } - function countKeys(schema2) { - let count = 0; - for (const key in schema2) { - if (key === "$ref") - return Infinity; - count++; - if (SIMPLE_INLINED.has(key)) - continue; - if (typeof schema2[key] == "object") { - (0, util_1.eachItem)(schema2[key], (sch) => count += countKeys(sch)); - } - if (count === Infinity) - return Infinity; - } - return count; - } - function getFullPath(resolver, id = "", normalize2) { - if (normalize2 !== false) - id = normalizeId(id); - const p = resolver.parse(id); - return _getFullPath(resolver, p); - } - exports.getFullPath = getFullPath; - function _getFullPath(resolver, p) { - const serialized = resolver.serialize(p); - return serialized.split("#")[0] + "#"; - } - exports._getFullPath = _getFullPath; - var TRAILING_SLASH_HASH = /#\/?$/; - function normalizeId(id) { - return id ? id.replace(TRAILING_SLASH_HASH, "") : ""; - } - exports.normalizeId = normalizeId; - function resolveUrl(resolver, baseId, id) { - id = normalizeId(id); - return resolver.resolve(baseId, id); - } - exports.resolveUrl = resolveUrl; - var ANCHOR = /^[a-z_][-a-z0-9._]*$/i; - function getSchemaRefs(schema2, baseId) { - if (typeof schema2 == "boolean") - return {}; - const { schemaId, uriResolver } = this.opts; - const schId = normalizeId(schema2[schemaId] || baseId); - const baseIds = { "": schId }; - const pathPrefix = getFullPath(uriResolver, schId, false); - const localRefs = {}; - const schemaRefs = /* @__PURE__ */ new Set(); - traverse(schema2, { allKeys: true }, (sch, jsonPtr, _, parentJsonPtr) => { - if (parentJsonPtr === void 0) - return; - const fullPath = pathPrefix + jsonPtr; - let innerBaseId = baseIds[parentJsonPtr]; - if (typeof sch[schemaId] == "string") - innerBaseId = addRef.call(this, sch[schemaId]); - addAnchor.call(this, sch.$anchor); - addAnchor.call(this, sch.$dynamicAnchor); - baseIds[jsonPtr] = innerBaseId; - function addRef(ref) { - const _resolve = this.opts.uriResolver.resolve; - ref = normalizeId(innerBaseId ? _resolve(innerBaseId, ref) : ref); - if (schemaRefs.has(ref)) - throw ambiguos(ref); - schemaRefs.add(ref); - let schOrRef = this.refs[ref]; - if (typeof schOrRef == "string") - schOrRef = this.refs[schOrRef]; - if (typeof schOrRef == "object") { - checkAmbiguosRef(sch, schOrRef.schema, ref); - } else if (ref !== normalizeId(fullPath)) { - if (ref[0] === "#") { - checkAmbiguosRef(sch, localRefs[ref], ref); - localRefs[ref] = sch; - } else { - this.refs[ref] = fullPath; - } - } - return ref; - } - function addAnchor(anchor) { - if (typeof anchor == "string") { - if (!ANCHOR.test(anchor)) - throw new Error(`invalid anchor "${anchor}"`); - addRef.call(this, `#${anchor}`); - } - } - }); - return localRefs; - function checkAmbiguosRef(sch1, sch2, ref) { - if (sch2 !== void 0 && !equal(sch1, sch2)) - throw ambiguos(ref); - } - function ambiguos(ref) { - return new Error(`reference "${ref}" resolves to more than one schema`); - } - } - exports.getSchemaRefs = getSchemaRefs; -}); -var require_validate3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getData = exports.KeywordCxt = exports.validateFunctionCode = void 0; - var boolSchema_1 = require_boolSchema3(); - var dataType_1 = require_dataType3(); - var applicability_1 = require_applicability3(); - var dataType_2 = require_dataType3(); - var defaults_1 = require_defaults3(); - var keyword_1 = require_keyword3(); - var subschema_1 = require_subschema3(); - var codegen_1 = require_codegen3(); - var names_1 = require_names3(); - var resolve_1 = require_resolve3(); - var util_1 = require_util16(); - var errors_1 = require_errors5(); - function validateFunctionCode(it) { - if (isSchemaObj(it)) { - checkKeywords(it); - if (schemaCxtHasRules(it)) { - topSchemaObjCode(it); - return; - } - } - validateFunction(it, () => (0, boolSchema_1.topBoolOrEmptySchema)(it)); - } - exports.validateFunctionCode = validateFunctionCode; - function validateFunction({ gen, validateName, schema: schema2, schemaEnv, opts }, body) { - if (opts.code.es5) { - gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${names_1.default.valCxt}`, schemaEnv.$async, () => { - gen.code((0, codegen_1._)`"use strict"; ${funcSourceUrl(schema2, opts)}`); - destructureValCxtES5(gen, opts); - gen.code(body); - }); - } else { - gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema2, opts)).code(body)); - } - } - function destructureValCxt(opts) { - return (0, codegen_1._)`{${names_1.default.instancePath}="", ${names_1.default.parentData}, ${names_1.default.parentDataProperty}, ${names_1.default.rootData}=${names_1.default.data}${opts.dynamicRef ? (0, codegen_1._)`, ${names_1.default.dynamicAnchors}={}` : codegen_1.nil}}={}`; - } - function destructureValCxtES5(gen, opts) { - gen.if(names_1.default.valCxt, () => { - gen.var(names_1.default.instancePath, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.instancePath}`); - gen.var(names_1.default.parentData, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.parentData}`); - gen.var(names_1.default.parentDataProperty, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.parentDataProperty}`); - gen.var(names_1.default.rootData, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.rootData}`); - if (opts.dynamicRef) - gen.var(names_1.default.dynamicAnchors, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.dynamicAnchors}`); - }, () => { - gen.var(names_1.default.instancePath, (0, codegen_1._)`""`); - gen.var(names_1.default.parentData, (0, codegen_1._)`undefined`); - gen.var(names_1.default.parentDataProperty, (0, codegen_1._)`undefined`); - gen.var(names_1.default.rootData, names_1.default.data); - if (opts.dynamicRef) - gen.var(names_1.default.dynamicAnchors, (0, codegen_1._)`{}`); - }); - } - function topSchemaObjCode(it) { - const { schema: schema2, opts, gen } = it; - validateFunction(it, () => { - if (opts.$comment && schema2.$comment) - commentKeyword(it); - checkNoDefault(it); - gen.let(names_1.default.vErrors, null); - gen.let(names_1.default.errors, 0); - if (opts.unevaluated) - resetEvaluated(it); - typeAndKeywords(it); - returnResults(it); - }); - return; - } - function resetEvaluated(it) { - const { gen, validateName } = it; - it.evaluated = gen.const("evaluated", (0, codegen_1._)`${validateName}.evaluated`); - gen.if((0, codegen_1._)`${it.evaluated}.dynamicProps`, () => gen.assign((0, codegen_1._)`${it.evaluated}.props`, (0, codegen_1._)`undefined`)); - gen.if((0, codegen_1._)`${it.evaluated}.dynamicItems`, () => gen.assign((0, codegen_1._)`${it.evaluated}.items`, (0, codegen_1._)`undefined`)); - } - function funcSourceUrl(schema2, opts) { - const schId = typeof schema2 == "object" && schema2[opts.schemaId]; - return schId && (opts.code.source || opts.code.process) ? (0, codegen_1._)`/*# sourceURL=${schId} */` : codegen_1.nil; - } - function subschemaCode(it, valid) { - if (isSchemaObj(it)) { - checkKeywords(it); - if (schemaCxtHasRules(it)) { - subSchemaObjCode(it, valid); - return; - } - } - (0, boolSchema_1.boolOrEmptySchema)(it, valid); - } - function schemaCxtHasRules({ schema: schema2, self: self2 }) { - if (typeof schema2 == "boolean") - return !schema2; - for (const key in schema2) - if (self2.RULES.all[key]) - return true; - return false; - } - function isSchemaObj(it) { - return typeof it.schema != "boolean"; - } - function subSchemaObjCode(it, valid) { - const { schema: schema2, gen, opts } = it; - if (opts.$comment && schema2.$comment) - commentKeyword(it); - updateContext(it); - checkAsyncSchema(it); - const errsCount = gen.const("_errs", names_1.default.errors); - typeAndKeywords(it, errsCount); - gen.var(valid, (0, codegen_1._)`${errsCount} === ${names_1.default.errors}`); - } - function checkKeywords(it) { - (0, util_1.checkUnknownRules)(it); - checkRefsAndKeywords(it); - } - function typeAndKeywords(it, errsCount) { - if (it.opts.jtd) - return schemaKeywords(it, [], false, errsCount); - const types = (0, dataType_1.getSchemaTypes)(it.schema); - const checkedTypes = (0, dataType_1.coerceAndCheckDataType)(it, types); - schemaKeywords(it, types, !checkedTypes, errsCount); - } - function checkRefsAndKeywords(it) { - const { schema: schema2, errSchemaPath, opts, self: self2 } = it; - if (schema2.$ref && opts.ignoreKeywordsWithRef && (0, util_1.schemaHasRulesButRef)(schema2, self2.RULES)) { - self2.logger.warn(`$ref: keywords ignored in schema at path "${errSchemaPath}"`); - } - } - function checkNoDefault(it) { - const { schema: schema2, opts } = it; - if (schema2.default !== void 0 && opts.useDefaults && opts.strictSchema) { - (0, util_1.checkStrictMode)(it, "default is ignored in the schema root"); - } - } - function updateContext(it) { - const schId = it.schema[it.opts.schemaId]; - if (schId) - it.baseId = (0, resolve_1.resolveUrl)(it.opts.uriResolver, it.baseId, schId); - } - function checkAsyncSchema(it) { - if (it.schema.$async && !it.schemaEnv.$async) - throw new Error("async schema in sync schema"); - } - function commentKeyword({ gen, schemaEnv, schema: schema2, errSchemaPath, opts }) { - const msg = schema2.$comment; - if (opts.$comment === true) { - gen.code((0, codegen_1._)`${names_1.default.self}.logger.log(${msg})`); - } else if (typeof opts.$comment == "function") { - const schemaPath = (0, codegen_1.str)`${errSchemaPath}/$comment`; - const rootName = gen.scopeValue("root", { ref: schemaEnv.root }); - gen.code((0, codegen_1._)`${names_1.default.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`); - } - } - function returnResults(it) { - const { gen, schemaEnv, validateName, ValidationError, opts } = it; - if (schemaEnv.$async) { - gen.if((0, codegen_1._)`${names_1.default.errors} === 0`, () => gen.return(names_1.default.data), () => gen.throw((0, codegen_1._)`new ${ValidationError}(${names_1.default.vErrors})`)); - } else { - gen.assign((0, codegen_1._)`${validateName}.errors`, names_1.default.vErrors); - if (opts.unevaluated) - assignEvaluated(it); - gen.return((0, codegen_1._)`${names_1.default.errors} === 0`); - } - } - function assignEvaluated({ gen, evaluated, props, items }) { - if (props instanceof codegen_1.Name) - gen.assign((0, codegen_1._)`${evaluated}.props`, props); - if (items instanceof codegen_1.Name) - gen.assign((0, codegen_1._)`${evaluated}.items`, items); - } - function schemaKeywords(it, types, typeErrors, errsCount) { - const { gen, schema: schema2, data, allErrors, opts, self: self2 } = it; - const { RULES } = self2; - if (schema2.$ref && (opts.ignoreKeywordsWithRef || !(0, util_1.schemaHasRulesButRef)(schema2, RULES))) { - gen.block(() => keywordCode(it, "$ref", RULES.all.$ref.definition)); - return; - } - if (!opts.jtd) - checkStrictTypes(it, types); - gen.block(() => { - for (const group2 of RULES.rules) - groupKeywords(group2); - groupKeywords(RULES.post); - }); - function groupKeywords(group2) { - if (!(0, applicability_1.shouldUseGroup)(schema2, group2)) - return; - if (group2.type) { - gen.if((0, dataType_2.checkDataType)(group2.type, data, opts.strictNumbers)); - iterateKeywords(it, group2); - if (types.length === 1 && types[0] === group2.type && typeErrors) { - gen.else(); - (0, dataType_2.reportTypeError)(it); - } - gen.endIf(); - } else { - iterateKeywords(it, group2); - } - if (!allErrors) - gen.if((0, codegen_1._)`${names_1.default.errors} === ${errsCount || 0}`); - } - } - function iterateKeywords(it, group2) { - const { gen, schema: schema2, opts: { useDefaults } } = it; - if (useDefaults) - (0, defaults_1.assignDefaults)(it, group2.type); - gen.block(() => { - for (const rule of group2.rules) { - if ((0, applicability_1.shouldUseRule)(schema2, rule)) { - keywordCode(it, rule.keyword, rule.definition, group2.type); - } - } - }); - } - function checkStrictTypes(it, types) { - if (it.schemaEnv.meta || !it.opts.strictTypes) - return; - checkContextTypes(it, types); - if (!it.opts.allowUnionTypes) - checkMultipleTypes(it, types); - checkKeywordTypes(it, it.dataTypes); - } - function checkContextTypes(it, types) { - if (!types.length) - return; - if (!it.dataTypes.length) { - it.dataTypes = types; - return; - } - types.forEach((t) => { - if (!includesType(it.dataTypes, t)) { - strictTypesError(it, `type "${t}" not allowed by context "${it.dataTypes.join(",")}"`); - } - }); - narrowSchemaTypes(it, types); - } - function checkMultipleTypes(it, ts) { - if (ts.length > 1 && !(ts.length === 2 && ts.includes("null"))) { - strictTypesError(it, "use allowUnionTypes to allow union type keyword"); - } - } - function checkKeywordTypes(it, ts) { - const rules = it.self.RULES.all; - for (const keyword in rules) { - const rule = rules[keyword]; - if (typeof rule == "object" && (0, applicability_1.shouldUseRule)(it.schema, rule)) { - const { type: type2 } = rule.definition; - if (type2.length && !type2.some((t) => hasApplicableType(ts, t))) { - strictTypesError(it, `missing type "${type2.join(",")}" for keyword "${keyword}"`); - } - } - } - } - function hasApplicableType(schTs, kwdT) { - return schTs.includes(kwdT) || kwdT === "number" && schTs.includes("integer"); - } - function includesType(ts, t) { - return ts.includes(t) || t === "integer" && ts.includes("number"); - } - function narrowSchemaTypes(it, withTypes) { - const ts = []; - for (const t of it.dataTypes) { - if (includesType(withTypes, t)) - ts.push(t); - else if (withTypes.includes("integer") && t === "number") - ts.push("integer"); - } - it.dataTypes = ts; - } - function strictTypesError(it, msg) { - const schemaPath = it.schemaEnv.baseId + it.errSchemaPath; - msg += ` at "${schemaPath}" (strictTypes)`; - (0, util_1.checkStrictMode)(it, msg, it.opts.strictTypes); - } - class KeywordCxt { - constructor(it, def, keyword) { - (0, keyword_1.validateKeywordUsage)(it, def, keyword); - this.gen = it.gen; - this.allErrors = it.allErrors; - this.keyword = keyword; - this.data = it.data; - this.schema = it.schema[keyword]; - this.$data = def.$data && it.opts.$data && this.schema && this.schema.$data; - this.schemaValue = (0, util_1.schemaRefOrVal)(it, this.schema, keyword, this.$data); - this.schemaType = def.schemaType; - this.parentSchema = it.schema; - this.params = {}; - this.it = it; - this.def = def; - if (this.$data) { - this.schemaCode = it.gen.const("vSchema", getData(this.$data, it)); - } else { - this.schemaCode = this.schemaValue; - if (!(0, keyword_1.validSchemaType)(this.schema, def.schemaType, def.allowUndefined)) { - throw new Error(`${keyword} value must be ${JSON.stringify(def.schemaType)}`); - } - } - if ("code" in def ? def.trackErrors : def.errors !== false) { - this.errsCount = it.gen.const("_errs", names_1.default.errors); - } - } - result(condition, successAction, failAction) { - this.failResult((0, codegen_1.not)(condition), successAction, failAction); - } - failResult(condition, successAction, failAction) { - this.gen.if(condition); - if (failAction) - failAction(); - else - this.error(); - if (successAction) { - this.gen.else(); - successAction(); - if (this.allErrors) - this.gen.endIf(); - } else { - if (this.allErrors) - this.gen.endIf(); - else - this.gen.else(); - } - } - pass(condition, failAction) { - this.failResult((0, codegen_1.not)(condition), void 0, failAction); - } - fail(condition) { - if (condition === void 0) { - this.error(); - if (!this.allErrors) - this.gen.if(false); - return; - } - this.gen.if(condition); - this.error(); - if (this.allErrors) - this.gen.endIf(); - else - this.gen.else(); - } - fail$data(condition) { - if (!this.$data) - return this.fail(condition); - const { schemaCode } = this; - this.fail((0, codegen_1._)`${schemaCode} !== undefined && (${(0, codegen_1.or)(this.invalid$data(), condition)})`); - } - error(append3, errorParams, errorPaths) { - if (errorParams) { - this.setParams(errorParams); - this._error(append3, errorPaths); - this.setParams({}); - return; - } - this._error(append3, errorPaths); - } - _error(append3, errorPaths) { - (append3 ? errors_1.reportExtraError : errors_1.reportError)(this, this.def.error, errorPaths); - } - $dataError() { - (0, errors_1.reportError)(this, this.def.$dataError || errors_1.keyword$DataError); - } - reset() { - if (this.errsCount === void 0) - throw new Error('add "trackErrors" to keyword definition'); - (0, errors_1.resetErrorsCount)(this.gen, this.errsCount); - } - ok(cond) { - if (!this.allErrors) - this.gen.if(cond); - } - setParams(obj, assign) { - if (assign) - Object.assign(this.params, obj); - else - this.params = obj; - } - block$data(valid, codeBlock, $dataValid = codegen_1.nil) { - this.gen.block(() => { - this.check$data(valid, $dataValid); - codeBlock(); - }); - } - check$data(valid = codegen_1.nil, $dataValid = codegen_1.nil) { - if (!this.$data) - return; - const { gen, schemaCode, schemaType, def } = this; - gen.if((0, codegen_1.or)((0, codegen_1._)`${schemaCode} === undefined`, $dataValid)); - if (valid !== codegen_1.nil) - gen.assign(valid, true); - if (schemaType.length || def.validateSchema) { - gen.elseIf(this.invalid$data()); - this.$dataError(); - if (valid !== codegen_1.nil) - gen.assign(valid, false); - } - gen.else(); - } - invalid$data() { - const { gen, schemaCode, schemaType, def, it } = this; - return (0, codegen_1.or)(wrong$DataType(), invalid$DataSchema()); - function wrong$DataType() { - if (schemaType.length) { - if (!(schemaCode instanceof codegen_1.Name)) - throw new Error("ajv implementation error"); - const st = Array.isArray(schemaType) ? schemaType : [schemaType]; - return (0, codegen_1._)`${(0, dataType_2.checkDataTypes)(st, schemaCode, it.opts.strictNumbers, dataType_2.DataType.Wrong)}`; - } - return codegen_1.nil; - } - function invalid$DataSchema() { - if (def.validateSchema) { - const validateSchemaRef = gen.scopeValue("validate$data", { ref: def.validateSchema }); - return (0, codegen_1._)`!${validateSchemaRef}(${schemaCode})`; - } - return codegen_1.nil; - } - } - subschema(appl, valid) { - const subschema = (0, subschema_1.getSubschema)(this.it, appl); - (0, subschema_1.extendSubschemaData)(subschema, this.it, appl); - (0, subschema_1.extendSubschemaMode)(subschema, appl); - const nextContext = { ...this.it, ...subschema, items: void 0, props: void 0 }; - subschemaCode(nextContext, valid); - return nextContext; - } - mergeEvaluated(schemaCxt, toName) { - const { it, gen } = this; - if (!it.opts.unevaluated) - return; - if (it.props !== true && schemaCxt.props !== void 0) { - it.props = util_1.mergeEvaluated.props(gen, schemaCxt.props, it.props, toName); - } - if (it.items !== true && schemaCxt.items !== void 0) { - it.items = util_1.mergeEvaluated.items(gen, schemaCxt.items, it.items, toName); - } - } - mergeValidEvaluated(schemaCxt, valid) { - const { it, gen } = this; - if (it.opts.unevaluated && (it.props !== true || it.items !== true)) { - gen.if(valid, () => this.mergeEvaluated(schemaCxt, codegen_1.Name)); - return true; - } - } - } - exports.KeywordCxt = KeywordCxt; - function keywordCode(it, keyword, def, ruleType) { - const cxt = new KeywordCxt(it, def, keyword); - if ("code" in def) { - def.code(cxt, ruleType); - } else if (cxt.$data && def.validate) { - (0, keyword_1.funcKeywordCode)(cxt, def); - } else if ("macro" in def) { - (0, keyword_1.macroKeywordCode)(cxt, def); - } else if (def.compile || def.validate) { - (0, keyword_1.funcKeywordCode)(cxt, def); - } - } - var JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/; - var RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/; - function getData($data, { dataLevel, dataNames, dataPathArr }) { - let jsonPointer; - let data; - if ($data === "") - return names_1.default.rootData; - if ($data[0] === "/") { - if (!JSON_POINTER.test($data)) - throw new Error(`Invalid JSON-pointer: ${$data}`); - jsonPointer = $data; - data = names_1.default.rootData; - } else { - const matches = RELATIVE_JSON_POINTER.exec($data); - if (!matches) - throw new Error(`Invalid JSON-pointer: ${$data}`); - const up = +matches[1]; - jsonPointer = matches[2]; - if (jsonPointer === "#") { - if (up >= dataLevel) - throw new Error(errorMsg("property/index", up)); - return dataPathArr[dataLevel - up]; - } - if (up > dataLevel) - throw new Error(errorMsg("data", up)); - data = dataNames[dataLevel - up]; - if (!jsonPointer) - return data; - } - let expr = data; - const segments = jsonPointer.split("/"); - for (const segment of segments) { - if (segment) { - data = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)((0, util_1.unescapeJsonPointer)(segment))}`; - expr = (0, codegen_1._)`${expr} && ${data}`; - } - } - return expr; - function errorMsg(pointerType, up) { - return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}`; - } - } - exports.getData = getData; -}); -var require_validation_error3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - class ValidationError extends Error { - constructor(errors3) { - super("validation failed"); - this.errors = errors3; - this.ajv = this.validation = true; - } - } - exports.default = ValidationError; -}); -var require_ref_error3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var resolve_1 = require_resolve3(); - class MissingRefError extends Error { - constructor(resolver, baseId, ref, msg) { - super(msg || `can't resolve reference ${ref} from id ${baseId}`); - this.missingRef = (0, resolve_1.resolveUrl)(resolver, baseId, ref); - this.missingSchema = (0, resolve_1.normalizeId)((0, resolve_1.getFullPath)(resolver, this.missingRef)); - } - } - exports.default = MissingRefError; -}); -var require_compile3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.resolveSchema = exports.getCompilingSchema = exports.resolveRef = exports.compileSchema = exports.SchemaEnv = void 0; - var codegen_1 = require_codegen3(); - var validation_error_1 = require_validation_error3(); - var names_1 = require_names3(); - var resolve_1 = require_resolve3(); - var util_1 = require_util16(); - var validate_1 = require_validate3(); - class SchemaEnv { - constructor(env3) { - var _a2; - this.refs = {}; - this.dynamicAnchors = {}; - let schema2; - if (typeof env3.schema == "object") - schema2 = env3.schema; - this.schema = env3.schema; - this.schemaId = env3.schemaId; - this.root = env3.root || this; - this.baseId = (_a2 = env3.baseId) !== null && _a2 !== void 0 ? _a2 : (0, resolve_1.normalizeId)(schema2 === null || schema2 === void 0 ? void 0 : schema2[env3.schemaId || "$id"]); - this.schemaPath = env3.schemaPath; - this.localRefs = env3.localRefs; - this.meta = env3.meta; - this.$async = schema2 === null || schema2 === void 0 ? void 0 : schema2.$async; - this.refs = {}; - } - } - exports.SchemaEnv = SchemaEnv; - function compileSchema(sch) { - const _sch = getCompilingSchema.call(this, sch); - if (_sch) - return _sch; - const rootId = (0, resolve_1.getFullPath)(this.opts.uriResolver, sch.root.baseId); - const { es5, lines } = this.opts.code; - const { ownProperties } = this.opts; - const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties }); - let _ValidationError; - if (sch.$async) { - _ValidationError = gen.scopeValue("Error", { - ref: validation_error_1.default, - code: (0, codegen_1._)`require("ajv/dist/runtime/validation_error").default` - }); - } - const validateName = gen.scopeName("validate"); - sch.validateName = validateName; - const schemaCxt = { - gen, - allErrors: this.opts.allErrors, - data: names_1.default.data, - parentData: names_1.default.parentData, - parentDataProperty: names_1.default.parentDataProperty, - dataNames: [names_1.default.data], - dataPathArr: [codegen_1.nil], - dataLevel: 0, - dataTypes: [], - definedProperties: /* @__PURE__ */ new Set(), - topSchemaRef: gen.scopeValue("schema", this.opts.code.source === true ? { ref: sch.schema, code: (0, codegen_1.stringify)(sch.schema) } : { ref: sch.schema }), - validateName, - ValidationError: _ValidationError, - schema: sch.schema, - schemaEnv: sch, - rootId, - baseId: sch.baseId || rootId, - schemaPath: codegen_1.nil, - errSchemaPath: sch.schemaPath || (this.opts.jtd ? "" : "#"), - errorPath: (0, codegen_1._)`""`, - opts: this.opts, - self: this - }; - let sourceCode; - try { - this._compilations.add(sch); - (0, validate_1.validateFunctionCode)(schemaCxt); - gen.optimize(this.opts.code.optimize); - const validateCode = gen.toString(); - sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${validateCode}`; - if (this.opts.code.process) - sourceCode = this.opts.code.process(sourceCode, sch); - const makeValidate = new Function(`${names_1.default.self}`, `${names_1.default.scope}`, sourceCode); - const validate2 = makeValidate(this, this.scope.get()); - this.scope.value(validateName, { ref: validate2 }); - validate2.errors = null; - validate2.schema = sch.schema; - validate2.schemaEnv = sch; - if (sch.$async) - validate2.$async = true; - if (this.opts.code.source === true) { - validate2.source = { validateName, validateCode, scopeValues: gen._values }; - } - if (this.opts.unevaluated) { - const { props, items } = schemaCxt; - validate2.evaluated = { - props: props instanceof codegen_1.Name ? void 0 : props, - items: items instanceof codegen_1.Name ? void 0 : items, - dynamicProps: props instanceof codegen_1.Name, - dynamicItems: items instanceof codegen_1.Name - }; - if (validate2.source) - validate2.source.evaluated = (0, codegen_1.stringify)(validate2.evaluated); - } - sch.validate = validate2; - return sch; - } catch (e) { - delete sch.validate; - delete sch.validateName; - if (sourceCode) - this.logger.error("Error compiling schema, function code:", sourceCode); - throw e; - } finally { - this._compilations.delete(sch); - } - } - exports.compileSchema = compileSchema; - function resolveRef2(root2, baseId, ref) { - var _a2; - ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref); - const schOrFunc = root2.refs[ref]; - if (schOrFunc) - return schOrFunc; - let _sch = resolve2.call(this, root2, ref); - if (_sch === void 0) { - const schema2 = (_a2 = root2.localRefs) === null || _a2 === void 0 ? void 0 : _a2[ref]; - const { schemaId } = this.opts; - if (schema2) - _sch = new SchemaEnv({ schema: schema2, schemaId, root: root2, baseId }); - } - if (_sch === void 0) - return; - return root2.refs[ref] = inlineOrCompile.call(this, _sch); - } - exports.resolveRef = resolveRef2; - function inlineOrCompile(sch) { - if ((0, resolve_1.inlineRef)(sch.schema, this.opts.inlineRefs)) - return sch.schema; - return sch.validate ? sch : compileSchema.call(this, sch); - } - function getCompilingSchema(schEnv) { - for (const sch of this._compilations) { - if (sameSchemaEnv(sch, schEnv)) - return sch; - } - } - exports.getCompilingSchema = getCompilingSchema; - function sameSchemaEnv(s1, s2) { - return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId; - } - function resolve2(root2, ref) { - let sch; - while (typeof (sch = this.refs[ref]) == "string") - ref = sch; - return sch || this.schemas[ref] || resolveSchema.call(this, root2, ref); - } - function resolveSchema(root2, ref) { - const p = this.opts.uriResolver.parse(ref); - const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p); - let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root2.baseId, void 0); - if (Object.keys(root2.schema).length > 0 && refPath === baseId) { - return getJsonPointer.call(this, p, root2); - } - const id = (0, resolve_1.normalizeId)(refPath); - const schOrRef = this.refs[id] || this.schemas[id]; - if (typeof schOrRef == "string") { - const sch = resolveSchema.call(this, root2, schOrRef); - if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object") - return; - return getJsonPointer.call(this, p, sch); - } - if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== "object") - return; - if (!schOrRef.validate) - compileSchema.call(this, schOrRef); - if (id === (0, resolve_1.normalizeId)(ref)) { - const { schema: schema2 } = schOrRef; - const { schemaId } = this.opts; - const schId = schema2[schemaId]; - if (schId) - baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId); - return new SchemaEnv({ schema: schema2, schemaId, root: root2, baseId }); - } - return getJsonPointer.call(this, p, schOrRef); - } - exports.resolveSchema = resolveSchema; - var PREVENT_SCOPE_CHANGE = /* @__PURE__ */ new Set([ - "properties", - "patternProperties", - "enum", - "dependencies", - "definitions" - ]); - function getJsonPointer(parsedRef, { baseId, schema: schema2, root: root2 }) { - var _a2; - if (((_a2 = parsedRef.fragment) === null || _a2 === void 0 ? void 0 : _a2[0]) !== "/") - return; - for (const part of parsedRef.fragment.slice(1).split("/")) { - if (typeof schema2 === "boolean") - return; - const partSchema = schema2[(0, util_1.unescapeFragment)(part)]; - if (partSchema === void 0) - return; - schema2 = partSchema; - const schId = typeof schema2 === "object" && schema2[this.opts.schemaId]; - if (!PREVENT_SCOPE_CHANGE.has(part) && schId) { - baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId); - } - } - let env3; - if (typeof schema2 != "boolean" && schema2.$ref && !(0, util_1.schemaHasRulesButRef)(schema2, this.RULES)) { - const $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schema2.$ref); - env3 = resolveSchema.call(this, root2, $ref); - } - const { schemaId } = this.opts; - env3 = env3 || new SchemaEnv({ schema: schema2, schemaId, root: root2, baseId }); - if (env3.schema !== env3.root.schema) - return env3; - return; - } -}); -var require_data3 = __commonJS2((exports, module) => { - module.exports = { - $id: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", - description: "Meta-schema for $data reference (JSON AnySchema extension proposal)", - type: "object", - required: ["$data"], - properties: { - $data: { - type: "string", - anyOf: [{ format: "relative-json-pointer" }, { format: "json-pointer" }] - } - }, - additionalProperties: false - }; -}); -var require_scopedChars = __commonJS2((exports, module) => { - var HEX = { - 0: 0, - 1: 1, - 2: 2, - 3: 3, - 4: 4, - 5: 5, - 6: 6, - 7: 7, - 8: 8, - 9: 9, - a: 10, - A: 10, - b: 11, - B: 11, - c: 12, - C: 12, - d: 13, - D: 13, - e: 14, - E: 14, - f: 15, - F: 15 - }; - module.exports = { - HEX - }; -}); -var require_utils7 = __commonJS2((exports, module) => { - var { HEX } = require_scopedChars(); - var IPV4_REG = /^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u; - function normalizeIPv4(host) { - if (findToken(host, ".") < 3) { - return { host, isIPV4: false }; - } - const matches = host.match(IPV4_REG) || []; - const [address] = matches; - if (address) { - return { host: stripLeadingZeros(address, "."), isIPV4: true }; - } else { - return { host, isIPV4: false }; - } - } - function stringArrayToHexStripped(input, keepZero = false) { - let acc = ""; - let strip = true; - for (const c of input) { - if (HEX[c] === void 0) - return; - if (c !== "0" && strip === true) - strip = false; - if (!strip) - acc += c; - } - if (keepZero && acc.length === 0) - acc = "0"; - return acc; - } - function getIPV6(input) { - let tokenCount = 0; - const output = { error: false, address: "", zone: "" }; - const address = []; - const buffer = []; - let isZone = false; - let endipv6Encountered = false; - let endIpv6 = false; - function consume() { - if (buffer.length) { - if (isZone === false) { - const hex4 = stringArrayToHexStripped(buffer); - if (hex4 !== void 0) { - address.push(hex4); - } else { - output.error = true; - return false; - } - } - buffer.length = 0; - } - return true; - } - for (let i = 0; i < input.length; i++) { - const cursor2 = input[i]; - if (cursor2 === "[" || cursor2 === "]") { - continue; - } - if (cursor2 === ":") { - if (endipv6Encountered === true) { - endIpv6 = true; - } - if (!consume()) { - break; - } - tokenCount++; - address.push(":"); - if (tokenCount > 7) { - output.error = true; - break; - } - if (i - 1 >= 0 && input[i - 1] === ":") { - endipv6Encountered = true; - } - continue; - } else if (cursor2 === "%") { - if (!consume()) { - break; - } - isZone = true; - } else { - buffer.push(cursor2); - continue; - } - } - if (buffer.length) { - if (isZone) { - output.zone = buffer.join(""); - } else if (endIpv6) { - address.push(buffer.join("")); - } else { - address.push(stringArrayToHexStripped(buffer)); - } - } - output.address = address.join(""); - return output; - } - function normalizeIPv6(host) { - if (findToken(host, ":") < 2) { - return { host, isIPV6: false }; - } - const ipv622 = getIPV6(host); - if (!ipv622.error) { - let newHost = ipv622.address; - let escapedHost = ipv622.address; - if (ipv622.zone) { - newHost += "%" + ipv622.zone; - escapedHost += "%25" + ipv622.zone; - } - return { host: newHost, escapedHost, isIPV6: true }; - } else { - return { host, isIPV6: false }; - } - } - function stripLeadingZeros(str, token) { - let out = ""; - let skip = true; - const l = str.length; - for (let i = 0; i < l; i++) { - const c = str[i]; - if (c === "0" && skip) { - if (i + 1 <= l && str[i + 1] === token || i + 1 === l) { - out += c; - skip = false; - } - } else { - if (c === token) { - skip = true; - } else { - skip = false; - } - out += c; - } - } - return out; - } - function findToken(str, token) { - let ind = 0; - for (let i = 0; i < str.length; i++) { - if (str[i] === token) - ind++; - } - return ind; - } - var RDS1 = /^\.\.?\//u; - var RDS2 = /^\/\.(?:\/|$)/u; - var RDS3 = /^\/\.\.(?:\/|$)/u; - var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/u; - function removeDotSegments(input) { - const output = []; - while (input.length) { - if (input.match(RDS1)) { - input = input.replace(RDS1, ""); - } else if (input.match(RDS2)) { - input = input.replace(RDS2, "/"); - } else if (input.match(RDS3)) { - input = input.replace(RDS3, "/"); - output.pop(); - } else if (input === "." || input === "..") { - input = ""; - } else { - const im = input.match(RDS5); - if (im) { - const s = im[0]; - input = input.slice(s.length); - output.push(s); - } else { - throw new Error("Unexpected dot segment condition"); - } - } - } - return output.join(""); - } - function normalizeComponentEncoding(components, esc22) { - const func = esc22 !== true ? escape : unescape; - if (components.scheme !== void 0) { - components.scheme = func(components.scheme); - } - if (components.userinfo !== void 0) { - components.userinfo = func(components.userinfo); - } - if (components.host !== void 0) { - components.host = func(components.host); - } - if (components.path !== void 0) { - components.path = func(components.path); - } - if (components.query !== void 0) { - components.query = func(components.query); - } - if (components.fragment !== void 0) { - components.fragment = func(components.fragment); - } - return components; - } - function recomposeAuthority(components) { - const uriTokens = []; - if (components.userinfo !== void 0) { - uriTokens.push(components.userinfo); - uriTokens.push("@"); - } - if (components.host !== void 0) { - let host = unescape(components.host); - const ipV4res = normalizeIPv4(host); - if (ipV4res.isIPV4) { - host = ipV4res.host; - } else { - const ipV6res = normalizeIPv6(ipV4res.host); - if (ipV6res.isIPV6 === true) { - host = `[${ipV6res.escapedHost}]`; - } else { - host = components.host; - } - } - uriTokens.push(host); - } - if (typeof components.port === "number" || typeof components.port === "string") { - uriTokens.push(":"); - uriTokens.push(String(components.port)); - } - return uriTokens.length ? uriTokens.join("") : void 0; - } - module.exports = { - recomposeAuthority, - normalizeComponentEncoding, - removeDotSegments, - normalizeIPv4, - normalizeIPv6, - stringArrayToHexStripped - }; -}); -var require_schemes3 = __commonJS2((exports, module) => { - var UUID_REG = /^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu; - var URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu; - function isSecure(wsComponents) { - return typeof wsComponents.secure === "boolean" ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss"; - } - function httpParse(components) { - if (!components.host) { - components.error = components.error || "HTTP URIs must have a host."; - } - return components; - } - function httpSerialize(components) { - const secure = String(components.scheme).toLowerCase() === "https"; - if (components.port === (secure ? 443 : 80) || components.port === "") { - components.port = void 0; - } - if (!components.path) { - components.path = "/"; - } - return components; - } - function wsParse(wsComponents) { - wsComponents.secure = isSecure(wsComponents); - wsComponents.resourceName = (wsComponents.path || "/") + (wsComponents.query ? "?" + wsComponents.query : ""); - wsComponents.path = void 0; - wsComponents.query = void 0; - return wsComponents; - } - function wsSerialize(wsComponents) { - if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") { - wsComponents.port = void 0; - } - if (typeof wsComponents.secure === "boolean") { - wsComponents.scheme = wsComponents.secure ? "wss" : "ws"; - wsComponents.secure = void 0; - } - if (wsComponents.resourceName) { - const [path4, query2] = wsComponents.resourceName.split("?"); - wsComponents.path = path4 && path4 !== "/" ? path4 : void 0; - wsComponents.query = query2; - wsComponents.resourceName = void 0; - } - wsComponents.fragment = void 0; - return wsComponents; - } - function urnParse(urnComponents, options) { - if (!urnComponents.path) { - urnComponents.error = "URN can not be parsed"; - return urnComponents; - } - const matches = urnComponents.path.match(URN_REG); - if (matches) { - const scheme = options.scheme || urnComponents.scheme || "urn"; - urnComponents.nid = matches[1].toLowerCase(); - urnComponents.nss = matches[2]; - const urnScheme = `${scheme}:${options.nid || urnComponents.nid}`; - const schemeHandler = SCHEMES[urnScheme]; - urnComponents.path = void 0; - if (schemeHandler) { - urnComponents = schemeHandler.parse(urnComponents, options); - } - } else { - urnComponents.error = urnComponents.error || "URN can not be parsed."; - } - return urnComponents; - } - function urnSerialize(urnComponents, options) { - const scheme = options.scheme || urnComponents.scheme || "urn"; - const nid = urnComponents.nid.toLowerCase(); - const urnScheme = `${scheme}:${options.nid || nid}`; - const schemeHandler = SCHEMES[urnScheme]; - if (schemeHandler) { - urnComponents = schemeHandler.serialize(urnComponents, options); - } - const uriComponents = urnComponents; - const nss = urnComponents.nss; - uriComponents.path = `${nid || options.nid}:${nss}`; - options.skipEscape = true; - return uriComponents; - } - function urnuuidParse(urnComponents, options) { - const uuidComponents = urnComponents; - uuidComponents.uuid = uuidComponents.nss; - uuidComponents.nss = void 0; - if (!options.tolerant && (!uuidComponents.uuid || !UUID_REG.test(uuidComponents.uuid))) { - uuidComponents.error = uuidComponents.error || "UUID is not valid."; - } - return uuidComponents; - } - function urnuuidSerialize(uuidComponents) { - const urnComponents = uuidComponents; - urnComponents.nss = (uuidComponents.uuid || "").toLowerCase(); - return urnComponents; - } - var http2 = { - scheme: "http", - domainHost: true, - parse: httpParse, - serialize: httpSerialize - }; - var https = { - scheme: "https", - domainHost: http2.domainHost, - parse: httpParse, - serialize: httpSerialize - }; - var ws = { - scheme: "ws", - domainHost: true, - parse: wsParse, - serialize: wsSerialize - }; - var wss = { - scheme: "wss", - domainHost: ws.domainHost, - parse: ws.parse, - serialize: ws.serialize - }; - var urn = { - scheme: "urn", - parse: urnParse, - serialize: urnSerialize, - skipNormalize: true - }; - var urnuuid = { - scheme: "urn:uuid", - parse: urnuuidParse, - serialize: urnuuidSerialize, - skipNormalize: true - }; - var SCHEMES = { - http: http2, - https, - ws, - wss, - urn, - "urn:uuid": urnuuid - }; - module.exports = SCHEMES; -}); -var require_fast_uri3 = __commonJS2((exports, module) => { - var { normalizeIPv6, normalizeIPv4, removeDotSegments, recomposeAuthority, normalizeComponentEncoding } = require_utils7(); - var SCHEMES = require_schemes3(); - function normalize2(uri, options) { - if (typeof uri === "string") { - uri = serialize(parse6(uri, options), options); - } else if (typeof uri === "object") { - uri = parse6(serialize(uri, options), options); - } - return uri; - } - function resolve2(baseURI, relativeURI, options) { - const schemelessOptions = Object.assign({ scheme: "null" }, options); - const resolved = resolveComponents(parse6(baseURI, schemelessOptions), parse6(relativeURI, schemelessOptions), schemelessOptions, true); - return serialize(resolved, { ...schemelessOptions, skipEscape: true }); - } - function resolveComponents(base, relative, options, skipNormalization) { - const target = {}; - if (!skipNormalization) { - base = parse6(serialize(base, options), options); - relative = parse6(serialize(relative, options), options); - } - options = options || {}; - if (!options.tolerant && relative.scheme) { - target.scheme = relative.scheme; - target.userinfo = relative.userinfo; - target.host = relative.host; - target.port = relative.port; - target.path = removeDotSegments(relative.path || ""); - target.query = relative.query; - } else { - if (relative.userinfo !== void 0 || relative.host !== void 0 || relative.port !== void 0) { - target.userinfo = relative.userinfo; - target.host = relative.host; - target.port = relative.port; - target.path = removeDotSegments(relative.path || ""); - target.query = relative.query; - } else { - if (!relative.path) { - target.path = base.path; - if (relative.query !== void 0) { - target.query = relative.query; - } else { - target.query = base.query; - } - } else { - if (relative.path.charAt(0) === "/") { - target.path = removeDotSegments(relative.path); - } else { - if ((base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0) && !base.path) { - target.path = "/" + relative.path; - } else if (!base.path) { - target.path = relative.path; - } else { - target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path; - } - target.path = removeDotSegments(target.path); - } - target.query = relative.query; - } - target.userinfo = base.userinfo; - target.host = base.host; - target.port = base.port; - } - target.scheme = base.scheme; - } - target.fragment = relative.fragment; - return target; - } - function equal(uriA, uriB, options) { - if (typeof uriA === "string") { - uriA = unescape(uriA); - uriA = serialize(normalizeComponentEncoding(parse6(uriA, options), true), { ...options, skipEscape: true }); - } else if (typeof uriA === "object") { - uriA = serialize(normalizeComponentEncoding(uriA, true), { ...options, skipEscape: true }); - } - if (typeof uriB === "string") { - uriB = unescape(uriB); - uriB = serialize(normalizeComponentEncoding(parse6(uriB, options), true), { ...options, skipEscape: true }); - } else if (typeof uriB === "object") { - uriB = serialize(normalizeComponentEncoding(uriB, true), { ...options, skipEscape: true }); - } - return uriA.toLowerCase() === uriB.toLowerCase(); - } - function serialize(cmpts, opts) { - const components = { - host: cmpts.host, - scheme: cmpts.scheme, - userinfo: cmpts.userinfo, - port: cmpts.port, - path: cmpts.path, - query: cmpts.query, - nid: cmpts.nid, - nss: cmpts.nss, - uuid: cmpts.uuid, - fragment: cmpts.fragment, - reference: cmpts.reference, - resourceName: cmpts.resourceName, - secure: cmpts.secure, - error: "" - }; - const options = Object.assign({}, opts); - const uriTokens = []; - const schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; - if (schemeHandler && schemeHandler.serialize) - schemeHandler.serialize(components, options); - if (components.path !== void 0) { - if (!options.skipEscape) { - components.path = escape(components.path); - if (components.scheme !== void 0) { - components.path = components.path.split("%3A").join(":"); - } - } else { - components.path = unescape(components.path); - } - } - if (options.reference !== "suffix" && components.scheme) { - uriTokens.push(components.scheme, ":"); - } - const authority = recomposeAuthority(components); - if (authority !== void 0) { - if (options.reference !== "suffix") { - uriTokens.push("//"); - } - uriTokens.push(authority); - if (components.path && components.path.charAt(0) !== "/") { - uriTokens.push("/"); - } - } - if (components.path !== void 0) { - let s = components.path; - if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) { - s = removeDotSegments(s); - } - if (authority === void 0) { - s = s.replace(/^\/\//u, "/%2F"); - } - uriTokens.push(s); - } - if (components.query !== void 0) { - uriTokens.push("?", components.query); - } - if (components.fragment !== void 0) { - uriTokens.push("#", components.fragment); - } - return uriTokens.join(""); - } - var hexLookUp = Array.from({ length: 127 }, (_v, k) => /[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(k))); - function nonSimpleDomain(value2) { - let code = 0; - for (let i = 0, len = value2.length; i < len; ++i) { - code = value2.charCodeAt(i); - if (code > 126 || hexLookUp[code]) { - return true; - } - } - return false; - } - var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u; - function parse6(uri, opts) { - const options = Object.assign({}, opts); - const parsed2 = { - scheme: void 0, - userinfo: void 0, - host: "", - port: void 0, - path: "", - query: void 0, - fragment: void 0 - }; - const gotEncoding = uri.indexOf("%") !== -1; - let isIP = false; - if (options.reference === "suffix") - uri = (options.scheme ? options.scheme + ":" : "") + "//" + uri; - const matches = uri.match(URI_PARSE); - if (matches) { - parsed2.scheme = matches[1]; - parsed2.userinfo = matches[3]; - parsed2.host = matches[4]; - parsed2.port = parseInt(matches[5], 10); - parsed2.path = matches[6] || ""; - parsed2.query = matches[7]; - parsed2.fragment = matches[8]; - if (isNaN(parsed2.port)) { - parsed2.port = matches[5]; - } - if (parsed2.host) { - const ipv4result = normalizeIPv4(parsed2.host); - if (ipv4result.isIPV4 === false) { - const ipv6result = normalizeIPv6(ipv4result.host); - parsed2.host = ipv6result.host.toLowerCase(); - isIP = ipv6result.isIPV6; - } else { - parsed2.host = ipv4result.host; - isIP = true; - } - } - if (parsed2.scheme === void 0 && parsed2.userinfo === void 0 && parsed2.host === void 0 && parsed2.port === void 0 && parsed2.query === void 0 && !parsed2.path) { - parsed2.reference = "same-document"; - } else if (parsed2.scheme === void 0) { - parsed2.reference = "relative"; - } else if (parsed2.fragment === void 0) { - parsed2.reference = "absolute"; - } else { - parsed2.reference = "uri"; - } - if (options.reference && options.reference !== "suffix" && options.reference !== parsed2.reference) { - parsed2.error = parsed2.error || "URI is not a " + options.reference + " reference."; - } - const schemeHandler = SCHEMES[(options.scheme || parsed2.scheme || "").toLowerCase()]; - if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) { - if (parsed2.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed2.host)) { - try { - parsed2.host = URL.domainToASCII(parsed2.host.toLowerCase()); - } catch (e) { - parsed2.error = parsed2.error || "Host's domain name can not be converted to ASCII: " + e; - } - } - } - if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) { - if (gotEncoding && parsed2.scheme !== void 0) { - parsed2.scheme = unescape(parsed2.scheme); - } - if (gotEncoding && parsed2.host !== void 0) { - parsed2.host = unescape(parsed2.host); - } - if (parsed2.path) { - parsed2.path = escape(unescape(parsed2.path)); - } - if (parsed2.fragment) { - parsed2.fragment = encodeURI(decodeURIComponent(parsed2.fragment)); - } - } - if (schemeHandler && schemeHandler.parse) { - schemeHandler.parse(parsed2, options); - } - } else { - parsed2.error = parsed2.error || "URI can not be parsed."; - } - return parsed2; - } - var fastUri = { - SCHEMES, - normalize: normalize2, - resolve: resolve2, - resolveComponents, - equal, - serialize, - parse: parse6 - }; - module.exports = fastUri; - module.exports.default = fastUri; - module.exports.fastUri = fastUri; -}); -var require_uri3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var uri = require_fast_uri3(); - uri.code = 'require("ajv/dist/runtime/uri").default'; - exports.default = uri; -}); -var require_core5 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0; - var validate_1 = require_validate3(); - Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function() { - return validate_1.KeywordCxt; - } }); - var codegen_1 = require_codegen3(); - Object.defineProperty(exports, "_", { enumerable: true, get: function() { - return codegen_1._; - } }); - Object.defineProperty(exports, "str", { enumerable: true, get: function() { - return codegen_1.str; - } }); - Object.defineProperty(exports, "stringify", { enumerable: true, get: function() { - return codegen_1.stringify; - } }); - Object.defineProperty(exports, "nil", { enumerable: true, get: function() { - return codegen_1.nil; - } }); - Object.defineProperty(exports, "Name", { enumerable: true, get: function() { - return codegen_1.Name; - } }); - Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function() { - return codegen_1.CodeGen; - } }); - var validation_error_1 = require_validation_error3(); - var ref_error_1 = require_ref_error3(); - var rules_1 = require_rules3(); - var compile_1 = require_compile3(); - var codegen_2 = require_codegen3(); - var resolve_1 = require_resolve3(); - var dataType_1 = require_dataType3(); - var util_1 = require_util16(); - var $dataRefSchema = require_data3(); - var uri_1 = require_uri3(); - var defaultRegExp = (str, flags) => new RegExp(str, flags); - defaultRegExp.code = "new RegExp"; - var META_IGNORE_OPTIONS = ["removeAdditional", "useDefaults", "coerceTypes"]; - var EXT_SCOPE_NAMES = /* @__PURE__ */ new Set([ - "validate", - "serialize", - "parse", - "wrapper", - "root", - "schema", - "keyword", - "pattern", - "formats", - "validate$data", - "func", - "obj", - "Error" - ]); - var removedOptions = { - errorDataPath: "", - format: "`validateFormats: false` can be used instead.", - nullable: '"nullable" keyword is supported by default.', - jsonPointers: "Deprecated jsPropertySyntax can be used instead.", - extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.", - missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.", - processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`", - sourceCode: "Use option `code: {source: true}`", - strictDefaults: "It is default now, see option `strict`.", - strictKeywords: "It is default now, see option `strict`.", - uniqueItems: '"uniqueItems" keyword is always validated.', - unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).", - cache: "Map is used as cache, schema object as key.", - serialize: "Map is used as cache, schema object as key.", - ajvErrors: "It is default now." - }; - var deprecatedOptions = { - ignoreKeywordsWithRef: "", - jsPropertySyntax: "", - unicode: '"minLength"/"maxLength" account for unicode characters by default.' - }; - var MAX_EXPRESSION = 200; - function requiredOptions(o) { - var _a2, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0; - const s = o.strict; - const _optz = (_a2 = o.code) === null || _a2 === void 0 ? void 0 : _a2.optimize; - const optimize = _optz === true || _optz === void 0 ? 1 : _optz || 0; - const regExp = (_c = (_b = o.code) === null || _b === void 0 ? void 0 : _b.regExp) !== null && _c !== void 0 ? _c : defaultRegExp; - const uriResolver = (_d = o.uriResolver) !== null && _d !== void 0 ? _d : uri_1.default; - return { - strictSchema: (_f = (_e = o.strictSchema) !== null && _e !== void 0 ? _e : s) !== null && _f !== void 0 ? _f : true, - strictNumbers: (_h = (_g = o.strictNumbers) !== null && _g !== void 0 ? _g : s) !== null && _h !== void 0 ? _h : true, - strictTypes: (_k = (_j = o.strictTypes) !== null && _j !== void 0 ? _j : s) !== null && _k !== void 0 ? _k : "log", - strictTuples: (_m = (_l = o.strictTuples) !== null && _l !== void 0 ? _l : s) !== null && _m !== void 0 ? _m : "log", - strictRequired: (_p = (_o = o.strictRequired) !== null && _o !== void 0 ? _o : s) !== null && _p !== void 0 ? _p : false, - code: o.code ? { ...o.code, optimize, regExp } : { optimize, regExp }, - loopRequired: (_q = o.loopRequired) !== null && _q !== void 0 ? _q : MAX_EXPRESSION, - loopEnum: (_r = o.loopEnum) !== null && _r !== void 0 ? _r : MAX_EXPRESSION, - meta: (_s = o.meta) !== null && _s !== void 0 ? _s : true, - messages: (_t = o.messages) !== null && _t !== void 0 ? _t : true, - inlineRefs: (_u = o.inlineRefs) !== null && _u !== void 0 ? _u : true, - schemaId: (_v = o.schemaId) !== null && _v !== void 0 ? _v : "$id", - addUsedSchema: (_w = o.addUsedSchema) !== null && _w !== void 0 ? _w : true, - validateSchema: (_x = o.validateSchema) !== null && _x !== void 0 ? _x : true, - validateFormats: (_y = o.validateFormats) !== null && _y !== void 0 ? _y : true, - unicodeRegExp: (_z = o.unicodeRegExp) !== null && _z !== void 0 ? _z : true, - int32range: (_0 = o.int32range) !== null && _0 !== void 0 ? _0 : true, - uriResolver - }; - } - class Ajv2 { - constructor(opts = {}) { - this.schemas = {}; - this.refs = {}; - this.formats = {}; - this._compilations = /* @__PURE__ */ new Set(); - this._loading = {}; - this._cache = /* @__PURE__ */ new Map(); - opts = this.opts = { ...opts, ...requiredOptions(opts) }; - const { es5, lines } = this.opts.code; - this.scope = new codegen_2.ValueScope({ scope: {}, prefixes: EXT_SCOPE_NAMES, es5, lines }); - this.logger = getLogger(opts.logger); - const formatOpt = opts.validateFormats; - opts.validateFormats = false; - this.RULES = (0, rules_1.getRules)(); - checkOptions.call(this, removedOptions, opts, "NOT SUPPORTED"); - checkOptions.call(this, deprecatedOptions, opts, "DEPRECATED", "warn"); - this._metaOpts = getMetaSchemaOptions.call(this); - if (opts.formats) - addInitialFormats.call(this); - this._addVocabularies(); - this._addDefaultMetaSchema(); - if (opts.keywords) - addInitialKeywords.call(this, opts.keywords); - if (typeof opts.meta == "object") - this.addMetaSchema(opts.meta); - addInitialSchemas.call(this); - opts.validateFormats = formatOpt; - } - _addVocabularies() { - this.addKeyword("$async"); - } - _addDefaultMetaSchema() { - const { $data, meta: meta3, schemaId } = this.opts; - let _dataRefSchema = $dataRefSchema; - if (schemaId === "id") { - _dataRefSchema = { ...$dataRefSchema }; - _dataRefSchema.id = _dataRefSchema.$id; - delete _dataRefSchema.$id; - } - if (meta3 && $data) - this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false); - } - defaultMeta() { - const { meta: meta3, schemaId } = this.opts; - return this.opts.defaultMeta = typeof meta3 == "object" ? meta3[schemaId] || meta3 : void 0; - } - validate(schemaKeyRef, data) { - let v; - if (typeof schemaKeyRef == "string") { - v = this.getSchema(schemaKeyRef); - if (!v) - throw new Error(`no schema with key or ref "${schemaKeyRef}"`); - } else { - v = this.compile(schemaKeyRef); - } - const valid = v(data); - if (!("$async" in v)) - this.errors = v.errors; - return valid; - } - compile(schema2, _meta) { - const sch = this._addSchema(schema2, _meta); - return sch.validate || this._compileSchemaEnv(sch); - } - compileAsync(schema2, meta3) { - if (typeof this.opts.loadSchema != "function") { - throw new Error("options.loadSchema should be a function"); - } - const { loadSchema } = this.opts; - return runCompileAsync.call(this, schema2, meta3); - async function runCompileAsync(_schema, _meta) { - await loadMetaSchema.call(this, _schema.$schema); - const sch = this._addSchema(_schema, _meta); - return sch.validate || _compileAsync.call(this, sch); - } - async function loadMetaSchema($ref) { - if ($ref && !this.getSchema($ref)) { - await runCompileAsync.call(this, { $ref }, true); - } - } - async function _compileAsync(sch) { - try { - return this._compileSchemaEnv(sch); - } catch (e) { - if (!(e instanceof ref_error_1.default)) - throw e; - checkLoaded.call(this, e); - await loadMissingSchema.call(this, e.missingSchema); - return _compileAsync.call(this, sch); - } - } - function checkLoaded({ missingSchema: ref, missingRef }) { - if (this.refs[ref]) { - throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`); - } - } - async function loadMissingSchema(ref) { - const _schema = await _loadSchema.call(this, ref); - if (!this.refs[ref]) - await loadMetaSchema.call(this, _schema.$schema); - if (!this.refs[ref]) - this.addSchema(_schema, ref, meta3); - } - async function _loadSchema(ref) { - const p = this._loading[ref]; - if (p) - return p; - try { - return await (this._loading[ref] = loadSchema(ref)); - } finally { - delete this._loading[ref]; - } - } - } - addSchema(schema2, key, _meta, _validateSchema = this.opts.validateSchema) { - if (Array.isArray(schema2)) { - for (const sch of schema2) - this.addSchema(sch, void 0, _meta, _validateSchema); - return this; - } - let id; - if (typeof schema2 === "object") { - const { schemaId } = this.opts; - id = schema2[schemaId]; - if (id !== void 0 && typeof id != "string") { - throw new Error(`schema ${schemaId} must be string`); - } - } - key = (0, resolve_1.normalizeId)(key || id); - this._checkUnique(key); - this.schemas[key] = this._addSchema(schema2, _meta, key, _validateSchema, true); - return this; - } - addMetaSchema(schema2, key, _validateSchema = this.opts.validateSchema) { - this.addSchema(schema2, key, true, _validateSchema); - return this; - } - validateSchema(schema2, throwOrLogError) { - if (typeof schema2 == "boolean") - return true; - let $schema; - $schema = schema2.$schema; - if ($schema !== void 0 && typeof $schema != "string") { - throw new Error("$schema must be a string"); - } - $schema = $schema || this.opts.defaultMeta || this.defaultMeta(); - if (!$schema) { - this.logger.warn("meta-schema not available"); - this.errors = null; - return true; - } - const valid = this.validate($schema, schema2); - if (!valid && throwOrLogError) { - const message = "schema is invalid: " + this.errorsText(); - if (this.opts.validateSchema === "log") - this.logger.error(message); - else - throw new Error(message); - } - return valid; - } - getSchema(keyRef) { - let sch; - while (typeof (sch = getSchEnv.call(this, keyRef)) == "string") - keyRef = sch; - if (sch === void 0) { - const { schemaId } = this.opts; - const root2 = new compile_1.SchemaEnv({ schema: {}, schemaId }); - sch = compile_1.resolveSchema.call(this, root2, keyRef); - if (!sch) - return; - this.refs[keyRef] = sch; - } - return sch.validate || this._compileSchemaEnv(sch); - } - removeSchema(schemaKeyRef) { - if (schemaKeyRef instanceof RegExp) { - this._removeAllSchemas(this.schemas, schemaKeyRef); - this._removeAllSchemas(this.refs, schemaKeyRef); - return this; - } - switch (typeof schemaKeyRef) { - case "undefined": - this._removeAllSchemas(this.schemas); - this._removeAllSchemas(this.refs); - this._cache.clear(); - return this; - case "string": { - const sch = getSchEnv.call(this, schemaKeyRef); - if (typeof sch == "object") - this._cache.delete(sch.schema); - delete this.schemas[schemaKeyRef]; - delete this.refs[schemaKeyRef]; - return this; - } - case "object": { - const cacheKey = schemaKeyRef; - this._cache.delete(cacheKey); - let id = schemaKeyRef[this.opts.schemaId]; - if (id) { - id = (0, resolve_1.normalizeId)(id); - delete this.schemas[id]; - delete this.refs[id]; - } - return this; - } - default: - throw new Error("ajv.removeSchema: invalid parameter"); - } - } - addVocabulary(definitions) { - for (const def of definitions) - this.addKeyword(def); - return this; - } - addKeyword(kwdOrDef, def) { - let keyword; - if (typeof kwdOrDef == "string") { - keyword = kwdOrDef; - if (typeof def == "object") { - this.logger.warn("these parameters are deprecated, see docs for addKeyword"); - def.keyword = keyword; - } - } else if (typeof kwdOrDef == "object" && def === void 0) { - def = kwdOrDef; - keyword = def.keyword; - if (Array.isArray(keyword) && !keyword.length) { - throw new Error("addKeywords: keyword must be string or non-empty array"); - } - } else { - throw new Error("invalid addKeywords parameters"); - } - checkKeyword.call(this, keyword, def); - if (!def) { - (0, util_1.eachItem)(keyword, (kwd) => addRule.call(this, kwd)); - return this; - } - keywordMetaschema.call(this, def); - const definition = { - ...def, - type: (0, dataType_1.getJSONTypes)(def.type), - schemaType: (0, dataType_1.getJSONTypes)(def.schemaType) - }; - (0, util_1.eachItem)(keyword, definition.type.length === 0 ? (k) => addRule.call(this, k, definition) : (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t))); - return this; - } - getKeyword(keyword) { - const rule = this.RULES.all[keyword]; - return typeof rule == "object" ? rule.definition : !!rule; - } - removeKeyword(keyword) { - const { RULES } = this; - delete RULES.keywords[keyword]; - delete RULES.all[keyword]; - for (const group2 of RULES.rules) { - const i = group2.rules.findIndex((rule) => rule.keyword === keyword); - if (i >= 0) - group2.rules.splice(i, 1); - } - return this; - } - addFormat(name, format2) { - if (typeof format2 == "string") - format2 = new RegExp(format2); - this.formats[name] = format2; - return this; - } - errorsText(errors3 = this.errors, { separator: separator2 = ", ", dataVar = "data" } = {}) { - if (!errors3 || errors3.length === 0) - return "No errors"; - return errors3.map((e) => `${dataVar}${e.instancePath} ${e.message}`).reduce((text, msg) => text + separator2 + msg); - } - $dataMetaSchema(metaSchema, keywordsJsonPointers) { - const rules = this.RULES.all; - metaSchema = JSON.parse(JSON.stringify(metaSchema)); - for (const jsonPointer of keywordsJsonPointers) { - const segments = jsonPointer.split("/").slice(1); - let keywords2 = metaSchema; - for (const seg of segments) - keywords2 = keywords2[seg]; - for (const key in rules) { - const rule = rules[key]; - if (typeof rule != "object") - continue; - const { $data } = rule.definition; - const schema2 = keywords2[key]; - if ($data && schema2) - keywords2[key] = schemaOrData(schema2); - } - } - return metaSchema; - } - _removeAllSchemas(schemas4, regex4) { - for (const keyRef in schemas4) { - const sch = schemas4[keyRef]; - if (!regex4 || regex4.test(keyRef)) { - if (typeof sch == "string") { - delete schemas4[keyRef]; - } else if (sch && !sch.meta) { - this._cache.delete(sch.schema); - delete schemas4[keyRef]; - } - } - } - } - _addSchema(schema2, meta3, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) { - let id; - const { schemaId } = this.opts; - if (typeof schema2 == "object") { - id = schema2[schemaId]; - } else { - if (this.opts.jtd) - throw new Error("schema must be object"); - else if (typeof schema2 != "boolean") - throw new Error("schema must be object or boolean"); - } - let sch = this._cache.get(schema2); - if (sch !== void 0) - return sch; - baseId = (0, resolve_1.normalizeId)(id || baseId); - const localRefs = resolve_1.getSchemaRefs.call(this, schema2, baseId); - sch = new compile_1.SchemaEnv({ schema: schema2, schemaId, meta: meta3, baseId, localRefs }); - this._cache.set(sch.schema, sch); - if (addSchema && !baseId.startsWith("#")) { - if (baseId) - this._checkUnique(baseId); - this.refs[baseId] = sch; - } - if (validateSchema) - this.validateSchema(schema2, true); - return sch; - } - _checkUnique(id) { - if (this.schemas[id] || this.refs[id]) { - throw new Error(`schema with key or id "${id}" already exists`); - } - } - _compileSchemaEnv(sch) { - if (sch.meta) - this._compileMetaSchema(sch); - else - compile_1.compileSchema.call(this, sch); - if (!sch.validate) - throw new Error("ajv implementation error"); - return sch.validate; - } - _compileMetaSchema(sch) { - const currentOpts = this.opts; - this.opts = this._metaOpts; - try { - compile_1.compileSchema.call(this, sch); - } finally { - this.opts = currentOpts; - } - } - } - Ajv2.ValidationError = validation_error_1.default; - Ajv2.MissingRefError = ref_error_1.default; - exports.default = Ajv2; - function checkOptions(checkOpts, options, msg, log2 = "error") { - for (const key in checkOpts) { - const opt = key; - if (opt in options) - this.logger[log2](`${msg}: option ${key}. ${checkOpts[opt]}`); - } - } - function getSchEnv(keyRef) { - keyRef = (0, resolve_1.normalizeId)(keyRef); - return this.schemas[keyRef] || this.refs[keyRef]; - } - function addInitialSchemas() { - const optsSchemas = this.opts.schemas; - if (!optsSchemas) - return; - if (Array.isArray(optsSchemas)) - this.addSchema(optsSchemas); - else - for (const key in optsSchemas) - this.addSchema(optsSchemas[key], key); - } - function addInitialFormats() { - for (const name in this.opts.formats) { - const format2 = this.opts.formats[name]; - if (format2) - this.addFormat(name, format2); - } - } - function addInitialKeywords(defs) { - if (Array.isArray(defs)) { - this.addVocabulary(defs); - return; - } - this.logger.warn("keywords option as map is deprecated, pass array"); - for (const keyword in defs) { - const def = defs[keyword]; - if (!def.keyword) - def.keyword = keyword; - this.addKeyword(def); - } - } - function getMetaSchemaOptions() { - const metaOpts = { ...this.opts }; - for (const opt of META_IGNORE_OPTIONS) - delete metaOpts[opt]; - return metaOpts; - } - var noLogs = { log() { - }, warn() { - }, error() { - } }; - function getLogger(logger) { - if (logger === false) - return noLogs; - if (logger === void 0) - return console; - if (logger.log && logger.warn && logger.error) - return logger; - throw new Error("logger must implement log, warn and error methods"); - } - var KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i; - function checkKeyword(keyword, def) { - const { RULES } = this; - (0, util_1.eachItem)(keyword, (kwd) => { - if (RULES.keywords[kwd]) - throw new Error(`Keyword ${kwd} is already defined`); - if (!KEYWORD_NAME.test(kwd)) - throw new Error(`Keyword ${kwd} has invalid name`); - }); - if (!def) - return; - if (def.$data && !("code" in def || "validate" in def)) { - throw new Error('$data keyword must have "code" or "validate" function'); - } - } - function addRule(keyword, definition, dataType) { - var _a2; - const post = definition === null || definition === void 0 ? void 0 : definition.post; - if (dataType && post) - throw new Error('keyword with "post" flag cannot have "type"'); - const { RULES } = this; - let ruleGroup = post ? RULES.post : RULES.rules.find(({ type: t }) => t === dataType); - if (!ruleGroup) { - ruleGroup = { type: dataType, rules: [] }; - RULES.rules.push(ruleGroup); - } - RULES.keywords[keyword] = true; - if (!definition) - return; - const rule = { - keyword, - definition: { - ...definition, - type: (0, dataType_1.getJSONTypes)(definition.type), - schemaType: (0, dataType_1.getJSONTypes)(definition.schemaType) - } - }; - if (definition.before) - addBeforeRule.call(this, ruleGroup, rule, definition.before); - else - ruleGroup.rules.push(rule); - RULES.all[keyword] = rule; - (_a2 = definition.implements) === null || _a2 === void 0 || _a2.forEach((kwd) => this.addKeyword(kwd)); - } - function addBeforeRule(ruleGroup, rule, before) { - const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before); - if (i >= 0) { - ruleGroup.rules.splice(i, 0, rule); - } else { - ruleGroup.rules.push(rule); - this.logger.warn(`rule ${before} is not defined`); - } - } - function keywordMetaschema(def) { - let { metaSchema } = def; - if (metaSchema === void 0) - return; - if (def.$data && this.opts.$data) - metaSchema = schemaOrData(metaSchema); - def.validateSchema = this.compile(metaSchema, true); - } - var $dataRef = { - $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#" - }; - function schemaOrData(schema2) { - return { anyOf: [schema2, $dataRef] }; - } -}); -var require_id3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var def = { - keyword: "id", - code() { - throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID'); - } - }; - exports.default = def; -}); -var require_ref3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.callRef = exports.getValidate = void 0; - var ref_error_1 = require_ref_error3(); - var code_1 = require_code22(); - var codegen_1 = require_codegen3(); - var names_1 = require_names3(); - var compile_1 = require_compile3(); - var util_1 = require_util16(); - var def = { - keyword: "$ref", - schemaType: "string", - code(cxt) { - const { gen, schema: $ref, it } = cxt; - const { baseId, schemaEnv: env3, validateName, opts, self: self2 } = it; - const { root: root2 } = env3; - if (($ref === "#" || $ref === "#/") && baseId === root2.baseId) - return callRootRef(); - const schOrEnv = compile_1.resolveRef.call(self2, root2, baseId, $ref); - if (schOrEnv === void 0) - throw new ref_error_1.default(it.opts.uriResolver, baseId, $ref); - if (schOrEnv instanceof compile_1.SchemaEnv) - return callValidate(schOrEnv); - return inlineRefSchema(schOrEnv); - function callRootRef() { - if (env3 === root2) - return callRef(cxt, validateName, env3, env3.$async); - const rootName = gen.scopeValue("root", { ref: root2 }); - return callRef(cxt, (0, codegen_1._)`${rootName}.validate`, root2, root2.$async); - } - function callValidate(sch) { - const v = getValidate(cxt, sch); - callRef(cxt, v, sch, sch.$async); - } - function inlineRefSchema(sch) { - const schName = gen.scopeValue("schema", opts.code.source === true ? { ref: sch, code: (0, codegen_1.stringify)(sch) } : { ref: sch }); - const valid = gen.name("valid"); - const schCxt = cxt.subschema({ - schema: sch, - dataTypes: [], - schemaPath: codegen_1.nil, - topSchemaRef: schName, - errSchemaPath: $ref - }, valid); - cxt.mergeEvaluated(schCxt); - cxt.ok(valid); - } - } - }; - function getValidate(cxt, sch) { - const { gen } = cxt; - return sch.validate ? gen.scopeValue("validate", { ref: sch.validate }) : (0, codegen_1._)`${gen.scopeValue("wrapper", { ref: sch })}.validate`; - } - exports.getValidate = getValidate; - function callRef(cxt, v, sch, $async) { - const { gen, it } = cxt; - const { allErrors, schemaEnv: env3, opts } = it; - const passCxt = opts.passContext ? names_1.default.this : codegen_1.nil; - if ($async) - callAsyncRef(); - else - callSyncRef(); - function callAsyncRef() { - if (!env3.$async) - throw new Error("async schema referenced by sync schema"); - const valid = gen.let("valid"); - gen.try(() => { - gen.code((0, codegen_1._)`await ${(0, code_1.callValidateCode)(cxt, v, passCxt)}`); - addEvaluatedFrom(v); - if (!allErrors) - gen.assign(valid, true); - }, (e) => { - gen.if((0, codegen_1._)`!(${e} instanceof ${it.ValidationError})`, () => gen.throw(e)); - addErrorsFrom(e); - if (!allErrors) - gen.assign(valid, false); - }); - cxt.ok(valid); - } - function callSyncRef() { - cxt.result((0, code_1.callValidateCode)(cxt, v, passCxt), () => addEvaluatedFrom(v), () => addErrorsFrom(v)); - } - function addErrorsFrom(source) { - const errs = (0, codegen_1._)`${source}.errors`; - gen.assign(names_1.default.vErrors, (0, codegen_1._)`${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`); - gen.assign(names_1.default.errors, (0, codegen_1._)`${names_1.default.vErrors}.length`); - } - function addEvaluatedFrom(source) { - var _a2; - if (!it.opts.unevaluated) - return; - const schEvaluated = (_a2 = sch === null || sch === void 0 ? void 0 : sch.validate) === null || _a2 === void 0 ? void 0 : _a2.evaluated; - if (it.props !== true) { - if (schEvaluated && !schEvaluated.dynamicProps) { - if (schEvaluated.props !== void 0) { - it.props = util_1.mergeEvaluated.props(gen, schEvaluated.props, it.props); - } - } else { - const props = gen.var("props", (0, codegen_1._)`${source}.evaluated.props`); - it.props = util_1.mergeEvaluated.props(gen, props, it.props, codegen_1.Name); - } - } - if (it.items !== true) { - if (schEvaluated && !schEvaluated.dynamicItems) { - if (schEvaluated.items !== void 0) { - it.items = util_1.mergeEvaluated.items(gen, schEvaluated.items, it.items); - } - } else { - const items = gen.var("items", (0, codegen_1._)`${source}.evaluated.items`); - it.items = util_1.mergeEvaluated.items(gen, items, it.items, codegen_1.Name); - } - } - } - } - exports.callRef = callRef; - exports.default = def; -}); -var require_core22 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var id_1 = require_id3(); - var ref_1 = require_ref3(); - var core22 = [ - "$schema", - "$id", - "$defs", - "$vocabulary", - { keyword: "$comment" }, - "definitions", - id_1.default, - ref_1.default - ]; - exports.default = core22; -}); -var require_limitNumber3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var codegen_1 = require_codegen3(); - var ops = codegen_1.operators; - var KWDs = { - maximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT }, - minimum: { okStr: ">=", ok: ops.GTE, fail: ops.LT }, - exclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE }, - exclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE } - }; - var error210 = { - message: ({ keyword, schemaCode }) => (0, codegen_1.str)`must be ${KWDs[keyword].okStr} ${schemaCode}`, - params: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}` - }; - var def = { - keyword: Object.keys(KWDs), - type: "number", - schemaType: "number", - $data: true, - error: error210, - code(cxt) { - const { keyword, data, schemaCode } = cxt; - cxt.fail$data((0, codegen_1._)`${data} ${KWDs[keyword].fail} ${schemaCode} || isNaN(${data})`); - } - }; - exports.default = def; -}); -var require_multipleOf3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var codegen_1 = require_codegen3(); - var error210 = { - message: ({ schemaCode }) => (0, codegen_1.str)`must be multiple of ${schemaCode}`, - params: ({ schemaCode }) => (0, codegen_1._)`{multipleOf: ${schemaCode}}` - }; - var def = { - keyword: "multipleOf", - type: "number", - schemaType: "number", - $data: true, - error: error210, - code(cxt) { - const { gen, data, schemaCode, it } = cxt; - const prec = it.opts.multipleOfPrecision; - const res = gen.let("res"); - const invalid = prec ? (0, codegen_1._)`Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}` : (0, codegen_1._)`${res} !== parseInt(${res})`; - cxt.fail$data((0, codegen_1._)`(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`); - } - }; - exports.default = def; -}); -var require_ucs2length3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - function ucs2length(str) { - const len = str.length; - let length = 0; - let pos = 0; - let value2; - while (pos < len) { - length++; - value2 = str.charCodeAt(pos++); - if (value2 >= 55296 && value2 <= 56319 && pos < len) { - value2 = str.charCodeAt(pos); - if ((value2 & 64512) === 56320) - pos++; - } - } - return length; - } - exports.default = ucs2length; - ucs2length.code = 'require("ajv/dist/runtime/ucs2length").default'; -}); -var require_limitLength3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var codegen_1 = require_codegen3(); - var util_1 = require_util16(); - var ucs2length_1 = require_ucs2length3(); - var error210 = { - message({ keyword, schemaCode }) { - const comp = keyword === "maxLength" ? "more" : "fewer"; - return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} characters`; - }, - params: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}` - }; - var def = { - keyword: ["maxLength", "minLength"], - type: "string", - schemaType: "number", - $data: true, - error: error210, - code(cxt) { - const { keyword, data, schemaCode, it } = cxt; - const op = keyword === "maxLength" ? codegen_1.operators.GT : codegen_1.operators.LT; - const len = it.opts.unicode === false ? (0, codegen_1._)`${data}.length` : (0, codegen_1._)`${(0, util_1.useFunc)(cxt.gen, ucs2length_1.default)}(${data})`; - cxt.fail$data((0, codegen_1._)`${len} ${op} ${schemaCode}`); - } - }; - exports.default = def; -}); -var require_pattern3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var code_1 = require_code22(); - var codegen_1 = require_codegen3(); - var error210 = { - message: ({ schemaCode }) => (0, codegen_1.str)`must match pattern "${schemaCode}"`, - params: ({ schemaCode }) => (0, codegen_1._)`{pattern: ${schemaCode}}` - }; - var def = { - keyword: "pattern", - type: "string", - schemaType: "string", - $data: true, - error: error210, - code(cxt) { - const { data, $data, schema: schema2, schemaCode, it } = cxt; - const u = it.opts.unicodeRegExp ? "u" : ""; - const regExp = $data ? (0, codegen_1._)`(new RegExp(${schemaCode}, ${u}))` : (0, code_1.usePattern)(cxt, schema2); - cxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`); - } - }; - exports.default = def; -}); -var require_limitProperties3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var codegen_1 = require_codegen3(); - var error210 = { - message({ keyword, schemaCode }) { - const comp = keyword === "maxProperties" ? "more" : "fewer"; - return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} properties`; - }, - params: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}` - }; - var def = { - keyword: ["maxProperties", "minProperties"], - type: "object", - schemaType: "number", - $data: true, - error: error210, - code(cxt) { - const { keyword, data, schemaCode } = cxt; - const op = keyword === "maxProperties" ? codegen_1.operators.GT : codegen_1.operators.LT; - cxt.fail$data((0, codegen_1._)`Object.keys(${data}).length ${op} ${schemaCode}`); - } - }; - exports.default = def; -}); -var require_required3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var code_1 = require_code22(); - var codegen_1 = require_codegen3(); - var util_1 = require_util16(); - var error210 = { - message: ({ params: { missingProperty } }) => (0, codegen_1.str)`must have required property '${missingProperty}'`, - params: ({ params: { missingProperty } }) => (0, codegen_1._)`{missingProperty: ${missingProperty}}` - }; - var def = { - keyword: "required", - type: "object", - schemaType: "array", - $data: true, - error: error210, - code(cxt) { - const { gen, schema: schema2, schemaCode, data, $data, it } = cxt; - const { opts } = it; - if (!$data && schema2.length === 0) - return; - const useLoop = schema2.length >= opts.loopRequired; - if (it.allErrors) - allErrorsMode(); - else - exitOnErrorMode(); - if (opts.strictRequired) { - const props = cxt.parentSchema.properties; - const { definedProperties } = cxt.it; - for (const requiredKey of schema2) { - if ((props === null || props === void 0 ? void 0 : props[requiredKey]) === void 0 && !definedProperties.has(requiredKey)) { - const schemaPath = it.schemaEnv.baseId + it.errSchemaPath; - const msg = `required property "${requiredKey}" is not defined at "${schemaPath}" (strictRequired)`; - (0, util_1.checkStrictMode)(it, msg, it.opts.strictRequired); - } - } - } - function allErrorsMode() { - if (useLoop || $data) { - cxt.block$data(codegen_1.nil, loopAllRequired); - } else { - for (const prop of schema2) { - (0, code_1.checkReportMissingProp)(cxt, prop); - } - } - } - function exitOnErrorMode() { - const missing = gen.let("missing"); - if (useLoop || $data) { - const valid = gen.let("valid", true); - cxt.block$data(valid, () => loopUntilMissing(missing, valid)); - cxt.ok(valid); - } else { - gen.if((0, code_1.checkMissingProp)(cxt, schema2, missing)); - (0, code_1.reportMissingProp)(cxt, missing); - gen.else(); - } - } - function loopAllRequired() { - gen.forOf("prop", schemaCode, (prop) => { - cxt.setParams({ missingProperty: prop }); - gen.if((0, code_1.noPropertyInData)(gen, data, prop, opts.ownProperties), () => cxt.error()); - }); - } - function loopUntilMissing(missing, valid) { - cxt.setParams({ missingProperty: missing }); - gen.forOf(missing, schemaCode, () => { - gen.assign(valid, (0, code_1.propertyInData)(gen, data, missing, opts.ownProperties)); - gen.if((0, codegen_1.not)(valid), () => { - cxt.error(); - gen.break(); - }); - }, codegen_1.nil); - } - } - }; - exports.default = def; -}); -var require_limitItems3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var codegen_1 = require_codegen3(); - var error210 = { - message({ keyword, schemaCode }) { - const comp = keyword === "maxItems" ? "more" : "fewer"; - return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} items`; - }, - params: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}` - }; - var def = { - keyword: ["maxItems", "minItems"], - type: "array", - schemaType: "number", - $data: true, - error: error210, - code(cxt) { - const { keyword, data, schemaCode } = cxt; - const op = keyword === "maxItems" ? codegen_1.operators.GT : codegen_1.operators.LT; - cxt.fail$data((0, codegen_1._)`${data}.length ${op} ${schemaCode}`); - } - }; - exports.default = def; -}); -var require_equal3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var equal = require_fast_deep_equal3(); - equal.code = 'require("ajv/dist/runtime/equal").default'; - exports.default = equal; -}); -var require_uniqueItems3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var dataType_1 = require_dataType3(); - var codegen_1 = require_codegen3(); - var util_1 = require_util16(); - var equal_1 = require_equal3(); - var error210 = { - message: ({ params: { i, j } }) => (0, codegen_1.str)`must NOT have duplicate items (items ## ${j} and ${i} are identical)`, - params: ({ params: { i, j } }) => (0, codegen_1._)`{i: ${i}, j: ${j}}` - }; - var def = { - keyword: "uniqueItems", - type: "array", - schemaType: "boolean", - $data: true, - error: error210, - code(cxt) { - const { gen, data, $data, schema: schema2, parentSchema, schemaCode, it } = cxt; - if (!$data && !schema2) - return; - const valid = gen.let("valid"); - const itemTypes = parentSchema.items ? (0, dataType_1.getSchemaTypes)(parentSchema.items) : []; - cxt.block$data(valid, validateUniqueItems, (0, codegen_1._)`${schemaCode} === false`); - cxt.ok(valid); - function validateUniqueItems() { - const i = gen.let("i", (0, codegen_1._)`${data}.length`); - const j = gen.let("j"); - cxt.setParams({ i, j }); - gen.assign(valid, true); - gen.if((0, codegen_1._)`${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j)); - } - function canOptimize() { - return itemTypes.length > 0 && !itemTypes.some((t) => t === "object" || t === "array"); - } - function loopN(i, j) { - const item = gen.name("item"); - const wrongType = (0, dataType_1.checkDataTypes)(itemTypes, item, it.opts.strictNumbers, dataType_1.DataType.Wrong); - const indices = gen.const("indices", (0, codegen_1._)`{}`); - gen.for((0, codegen_1._)`;${i}--;`, () => { - gen.let(item, (0, codegen_1._)`${data}[${i}]`); - gen.if(wrongType, (0, codegen_1._)`continue`); - if (itemTypes.length > 1) - gen.if((0, codegen_1._)`typeof ${item} == "string"`, (0, codegen_1._)`${item} += "_"`); - gen.if((0, codegen_1._)`typeof ${indices}[${item}] == "number"`, () => { - gen.assign(j, (0, codegen_1._)`${indices}[${item}]`); - cxt.error(); - gen.assign(valid, false).break(); - }).code((0, codegen_1._)`${indices}[${item}] = ${i}`); - }); - } - function loopN2(i, j) { - const eql = (0, util_1.useFunc)(gen, equal_1.default); - const outer = gen.name("outer"); - gen.label(outer).for((0, codegen_1._)`;${i}--;`, () => gen.for((0, codegen_1._)`${j} = ${i}; ${j}--;`, () => gen.if((0, codegen_1._)`${eql}(${data}[${i}], ${data}[${j}])`, () => { - cxt.error(); - gen.assign(valid, false).break(outer); - }))); - } - } - }; - exports.default = def; -}); -var require_const3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var codegen_1 = require_codegen3(); - var util_1 = require_util16(); - var equal_1 = require_equal3(); - var error210 = { - message: "must be equal to constant", - params: ({ schemaCode }) => (0, codegen_1._)`{allowedValue: ${schemaCode}}` - }; - var def = { - keyword: "const", - $data: true, - error: error210, - code(cxt) { - const { gen, data, $data, schemaCode, schema: schema2 } = cxt; - if ($data || schema2 && typeof schema2 == "object") { - cxt.fail$data((0, codegen_1._)`!${(0, util_1.useFunc)(gen, equal_1.default)}(${data}, ${schemaCode})`); - } else { - cxt.fail((0, codegen_1._)`${schema2} !== ${data}`); - } - } - }; - exports.default = def; -}); -var require_enum3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var codegen_1 = require_codegen3(); - var util_1 = require_util16(); - var equal_1 = require_equal3(); - var error210 = { - message: "must be equal to one of the allowed values", - params: ({ schemaCode }) => (0, codegen_1._)`{allowedValues: ${schemaCode}}` - }; - var def = { - keyword: "enum", - schemaType: "array", - $data: true, - error: error210, - code(cxt) { - const { gen, data, $data, schema: schema2, schemaCode, it } = cxt; - if (!$data && schema2.length === 0) - throw new Error("enum must have non-empty array"); - const useLoop = schema2.length >= it.opts.loopEnum; - let eql; - const getEql = () => eql !== null && eql !== void 0 ? eql : eql = (0, util_1.useFunc)(gen, equal_1.default); - let valid; - if (useLoop || $data) { - valid = gen.let("valid"); - cxt.block$data(valid, loopEnum); - } else { - if (!Array.isArray(schema2)) - throw new Error("ajv implementation error"); - const vSchema = gen.const("vSchema", schemaCode); - valid = (0, codegen_1.or)(...schema2.map((_x, i) => equalCode(vSchema, i))); - } - cxt.pass(valid); - function loopEnum() { - gen.assign(valid, false); - gen.forOf("v", schemaCode, (v) => gen.if((0, codegen_1._)`${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break())); - } - function equalCode(vSchema, i) { - const sch = schema2[i]; - return typeof sch === "object" && sch !== null ? (0, codegen_1._)`${getEql()}(${data}, ${vSchema}[${i}])` : (0, codegen_1._)`${data} === ${sch}`; - } - } - }; - exports.default = def; -}); -var require_validation3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var limitNumber_1 = require_limitNumber3(); - var multipleOf_1 = require_multipleOf3(); - var limitLength_1 = require_limitLength3(); - var pattern_1 = require_pattern3(); - var limitProperties_1 = require_limitProperties3(); - var required_1 = require_required3(); - var limitItems_1 = require_limitItems3(); - var uniqueItems_1 = require_uniqueItems3(); - var const_1 = require_const3(); - var enum_1 = require_enum3(); - var validation = [ - limitNumber_1.default, - multipleOf_1.default, - limitLength_1.default, - pattern_1.default, - limitProperties_1.default, - required_1.default, - limitItems_1.default, - uniqueItems_1.default, - { keyword: "type", schemaType: ["string", "array"] }, - { keyword: "nullable", schemaType: "boolean" }, - const_1.default, - enum_1.default - ]; - exports.default = validation; -}); -var require_additionalItems3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.validateAdditionalItems = void 0; - var codegen_1 = require_codegen3(); - var util_1 = require_util16(); - var error210 = { - message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`, - params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}` - }; - var def = { - keyword: "additionalItems", - type: "array", - schemaType: ["boolean", "object"], - before: "uniqueItems", - error: error210, - code(cxt) { - const { parentSchema, it } = cxt; - const { items } = parentSchema; - if (!Array.isArray(items)) { - (0, util_1.checkStrictMode)(it, '"additionalItems" is ignored when "items" is not an array of schemas'); - return; - } - validateAdditionalItems(cxt, items); - } - }; - function validateAdditionalItems(cxt, items) { - const { gen, schema: schema2, data, keyword, it } = cxt; - it.items = true; - const len = gen.const("len", (0, codegen_1._)`${data}.length`); - if (schema2 === false) { - cxt.setParams({ len: items.length }); - cxt.pass((0, codegen_1._)`${len} <= ${items.length}`); - } else if (typeof schema2 == "object" && !(0, util_1.alwaysValidSchema)(it, schema2)) { - const valid = gen.var("valid", (0, codegen_1._)`${len} <= ${items.length}`); - gen.if((0, codegen_1.not)(valid), () => validateItems(valid)); - cxt.ok(valid); - } - function validateItems(valid) { - gen.forRange("i", items.length, len, (i) => { - cxt.subschema({ keyword, dataProp: i, dataPropType: util_1.Type.Num }, valid); - if (!it.allErrors) - gen.if((0, codegen_1.not)(valid), () => gen.break()); - }); - } - } - exports.validateAdditionalItems = validateAdditionalItems; - exports.default = def; -}); -var require_items3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.validateTuple = void 0; - var codegen_1 = require_codegen3(); - var util_1 = require_util16(); - var code_1 = require_code22(); - var def = { - keyword: "items", - type: "array", - schemaType: ["object", "array", "boolean"], - before: "uniqueItems", - code(cxt) { - const { schema: schema2, it } = cxt; - if (Array.isArray(schema2)) - return validateTuple(cxt, "additionalItems", schema2); - it.items = true; - if ((0, util_1.alwaysValidSchema)(it, schema2)) - return; - cxt.ok((0, code_1.validateArray)(cxt)); - } - }; - function validateTuple(cxt, extraItems, schArr = cxt.schema) { - const { gen, parentSchema, data, keyword, it } = cxt; - checkStrictTuple(parentSchema); - if (it.opts.unevaluated && schArr.length && it.items !== true) { - it.items = util_1.mergeEvaluated.items(gen, schArr.length, it.items); - } - const valid = gen.name("valid"); - const len = gen.const("len", (0, codegen_1._)`${data}.length`); - schArr.forEach((sch, i) => { - if ((0, util_1.alwaysValidSchema)(it, sch)) - return; - gen.if((0, codegen_1._)`${len} > ${i}`, () => cxt.subschema({ - keyword, - schemaProp: i, - dataProp: i - }, valid)); - cxt.ok(valid); - }); - function checkStrictTuple(sch) { - const { opts, errSchemaPath } = it; - const l = schArr.length; - const fullTuple = l === sch.minItems && (l === sch.maxItems || sch[extraItems] === false); - if (opts.strictTuples && !fullTuple) { - const msg = `"${keyword}" is ${l}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path "${errSchemaPath}"`; - (0, util_1.checkStrictMode)(it, msg, opts.strictTuples); - } - } - } - exports.validateTuple = validateTuple; - exports.default = def; -}); -var require_prefixItems3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var items_1 = require_items3(); - var def = { - keyword: "prefixItems", - type: "array", - schemaType: ["array"], - before: "uniqueItems", - code: (cxt) => (0, items_1.validateTuple)(cxt, "items") - }; - exports.default = def; -}); -var require_items20203 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var codegen_1 = require_codegen3(); - var util_1 = require_util16(); - var code_1 = require_code22(); - var additionalItems_1 = require_additionalItems3(); - var error210 = { - message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`, - params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}` - }; - var def = { - keyword: "items", - type: "array", - schemaType: ["object", "boolean"], - before: "uniqueItems", - error: error210, - code(cxt) { - const { schema: schema2, parentSchema, it } = cxt; - const { prefixItems } = parentSchema; - it.items = true; - if ((0, util_1.alwaysValidSchema)(it, schema2)) - return; - if (prefixItems) - (0, additionalItems_1.validateAdditionalItems)(cxt, prefixItems); - else - cxt.ok((0, code_1.validateArray)(cxt)); - } - }; - exports.default = def; -}); -var require_contains3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var codegen_1 = require_codegen3(); - var util_1 = require_util16(); - var error210 = { - message: ({ params: { min, max } }) => max === void 0 ? (0, codegen_1.str)`must contain at least ${min} valid item(s)` : (0, codegen_1.str)`must contain at least ${min} and no more than ${max} valid item(s)`, - params: ({ params: { min, max } }) => max === void 0 ? (0, codegen_1._)`{minContains: ${min}}` : (0, codegen_1._)`{minContains: ${min}, maxContains: ${max}}` - }; - var def = { - keyword: "contains", - type: "array", - schemaType: ["object", "boolean"], - before: "uniqueItems", - trackErrors: true, - error: error210, - code(cxt) { - const { gen, schema: schema2, parentSchema, data, it } = cxt; - let min; - let max; - const { minContains, maxContains } = parentSchema; - if (it.opts.next) { - min = minContains === void 0 ? 1 : minContains; - max = maxContains; - } else { - min = 1; - } - const len = gen.const("len", (0, codegen_1._)`${data}.length`); - cxt.setParams({ min, max }); - if (max === void 0 && min === 0) { - (0, util_1.checkStrictMode)(it, `"minContains" == 0 without "maxContains": "contains" keyword ignored`); - return; - } - if (max !== void 0 && min > max) { - (0, util_1.checkStrictMode)(it, `"minContains" > "maxContains" is always invalid`); - cxt.fail(); - return; - } - if ((0, util_1.alwaysValidSchema)(it, schema2)) { - let cond = (0, codegen_1._)`${len} >= ${min}`; - if (max !== void 0) - cond = (0, codegen_1._)`${cond} && ${len} <= ${max}`; - cxt.pass(cond); - return; - } - it.items = true; - const valid = gen.name("valid"); - if (max === void 0 && min === 1) { - validateItems(valid, () => gen.if(valid, () => gen.break())); - } else if (min === 0) { - gen.let(valid, true); - if (max !== void 0) - gen.if((0, codegen_1._)`${data}.length > 0`, validateItemsWithCount); - } else { - gen.let(valid, false); - validateItemsWithCount(); - } - cxt.result(valid, () => cxt.reset()); - function validateItemsWithCount() { - const schValid = gen.name("_valid"); - const count = gen.let("count", 0); - validateItems(schValid, () => gen.if(schValid, () => checkLimits(count))); - } - function validateItems(_valid, block) { - gen.forRange("i", 0, len, (i) => { - cxt.subschema({ - keyword: "contains", - dataProp: i, - dataPropType: util_1.Type.Num, - compositeRule: true - }, _valid); - block(); - }); - } - function checkLimits(count) { - gen.code((0, codegen_1._)`${count}++`); - if (max === void 0) { - gen.if((0, codegen_1._)`${count} >= ${min}`, () => gen.assign(valid, true).break()); - } else { - gen.if((0, codegen_1._)`${count} > ${max}`, () => gen.assign(valid, false).break()); - if (min === 1) - gen.assign(valid, true); - else - gen.if((0, codegen_1._)`${count} >= ${min}`, () => gen.assign(valid, true)); - } - } - } - }; - exports.default = def; -}); -var require_dependencies3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = void 0; - var codegen_1 = require_codegen3(); - var util_1 = require_util16(); - var code_1 = require_code22(); - exports.error = { - message: ({ params: { property, depsCount, deps } }) => { - const property_ies = depsCount === 1 ? "property" : "properties"; - return (0, codegen_1.str)`must have ${property_ies} ${deps} when property ${property} is present`; - }, - params: ({ params: { property, depsCount, deps, missingProperty } }) => (0, codegen_1._)`{property: ${property}, - missingProperty: ${missingProperty}, - depsCount: ${depsCount}, - deps: ${deps}}` - }; - var def = { - keyword: "dependencies", - type: "object", - schemaType: "object", - error: exports.error, - code(cxt) { - const [propDeps, schDeps] = splitDependencies(cxt); - validatePropertyDeps(cxt, propDeps); - validateSchemaDeps(cxt, schDeps); - } - }; - function splitDependencies({ schema: schema2 }) { - const propertyDeps = {}; - const schemaDeps = {}; - for (const key in schema2) { - if (key === "__proto__") - continue; - const deps = Array.isArray(schema2[key]) ? propertyDeps : schemaDeps; - deps[key] = schema2[key]; - } - return [propertyDeps, schemaDeps]; - } - function validatePropertyDeps(cxt, propertyDeps = cxt.schema) { - const { gen, data, it } = cxt; - if (Object.keys(propertyDeps).length === 0) - return; - const missing = gen.let("missing"); - for (const prop in propertyDeps) { - const deps = propertyDeps[prop]; - if (deps.length === 0) - continue; - const hasProperty = (0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties); - cxt.setParams({ - property: prop, - depsCount: deps.length, - deps: deps.join(", ") - }); - if (it.allErrors) { - gen.if(hasProperty, () => { - for (const depProp of deps) { - (0, code_1.checkReportMissingProp)(cxt, depProp); - } - }); - } else { - gen.if((0, codegen_1._)`${hasProperty} && (${(0, code_1.checkMissingProp)(cxt, deps, missing)})`); - (0, code_1.reportMissingProp)(cxt, missing); - gen.else(); - } - } - } - exports.validatePropertyDeps = validatePropertyDeps; - function validateSchemaDeps(cxt, schemaDeps = cxt.schema) { - const { gen, data, keyword, it } = cxt; - const valid = gen.name("valid"); - for (const prop in schemaDeps) { - if ((0, util_1.alwaysValidSchema)(it, schemaDeps[prop])) - continue; - gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties), () => { - const schCxt = cxt.subschema({ keyword, schemaProp: prop }, valid); - cxt.mergeValidEvaluated(schCxt, valid); - }, () => gen.var(valid, true)); - cxt.ok(valid); - } - } - exports.validateSchemaDeps = validateSchemaDeps; - exports.default = def; -}); -var require_propertyNames3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var codegen_1 = require_codegen3(); - var util_1 = require_util16(); - var error210 = { - message: "property name must be valid", - params: ({ params }) => (0, codegen_1._)`{propertyName: ${params.propertyName}}` - }; - var def = { - keyword: "propertyNames", - type: "object", - schemaType: ["object", "boolean"], - error: error210, - code(cxt) { - const { gen, schema: schema2, data, it } = cxt; - if ((0, util_1.alwaysValidSchema)(it, schema2)) - return; - const valid = gen.name("valid"); - gen.forIn("key", data, (key) => { - cxt.setParams({ propertyName: key }); - cxt.subschema({ - keyword: "propertyNames", - data: key, - dataTypes: ["string"], - propertyName: key, - compositeRule: true - }, valid); - gen.if((0, codegen_1.not)(valid), () => { - cxt.error(true); - if (!it.allErrors) - gen.break(); - }); - }); - cxt.ok(valid); - } - }; - exports.default = def; -}); -var require_additionalProperties3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var code_1 = require_code22(); - var codegen_1 = require_codegen3(); - var names_1 = require_names3(); - var util_1 = require_util16(); - var error210 = { - message: "must NOT have additional properties", - params: ({ params }) => (0, codegen_1._)`{additionalProperty: ${params.additionalProperty}}` - }; - var def = { - keyword: "additionalProperties", - type: ["object"], - schemaType: ["boolean", "object"], - allowUndefined: true, - trackErrors: true, - error: error210, - code(cxt) { - const { gen, schema: schema2, parentSchema, data, errsCount, it } = cxt; - if (!errsCount) - throw new Error("ajv implementation error"); - const { allErrors, opts } = it; - it.props = true; - if (opts.removeAdditional !== "all" && (0, util_1.alwaysValidSchema)(it, schema2)) - return; - const props = (0, code_1.allSchemaProperties)(parentSchema.properties); - const patProps = (0, code_1.allSchemaProperties)(parentSchema.patternProperties); - checkAdditionalProperties(); - cxt.ok((0, codegen_1._)`${errsCount} === ${names_1.default.errors}`); - function checkAdditionalProperties() { - gen.forIn("key", data, (key) => { - if (!props.length && !patProps.length) - additionalPropertyCode(key); - else - gen.if(isAdditional(key), () => additionalPropertyCode(key)); - }); - } - function isAdditional(key) { - let definedProp; - if (props.length > 8) { - const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema.properties, "properties"); - definedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key); - } else if (props.length) { - definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._)`${key} === ${p}`)); - } else { - definedProp = codegen_1.nil; - } - if (patProps.length) { - definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p) => (0, codegen_1._)`${(0, code_1.usePattern)(cxt, p)}.test(${key})`)); - } - return (0, codegen_1.not)(definedProp); - } - function deleteAdditional(key) { - gen.code((0, codegen_1._)`delete ${data}[${key}]`); - } - function additionalPropertyCode(key) { - if (opts.removeAdditional === "all" || opts.removeAdditional && schema2 === false) { - deleteAdditional(key); - return; - } - if (schema2 === false) { - cxt.setParams({ additionalProperty: key }); - cxt.error(); - if (!allErrors) - gen.break(); - return; - } - if (typeof schema2 == "object" && !(0, util_1.alwaysValidSchema)(it, schema2)) { - const valid = gen.name("valid"); - if (opts.removeAdditional === "failing") { - applyAdditionalSchema(key, valid, false); - gen.if((0, codegen_1.not)(valid), () => { - cxt.reset(); - deleteAdditional(key); - }); - } else { - applyAdditionalSchema(key, valid); - if (!allErrors) - gen.if((0, codegen_1.not)(valid), () => gen.break()); - } - } - } - function applyAdditionalSchema(key, valid, errors3) { - const subschema = { - keyword: "additionalProperties", - dataProp: key, - dataPropType: util_1.Type.Str - }; - if (errors3 === false) { - Object.assign(subschema, { - compositeRule: true, - createErrors: false, - allErrors: false - }); - } - cxt.subschema(subschema, valid); - } - } - }; - exports.default = def; -}); -var require_properties3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var validate_1 = require_validate3(); - var code_1 = require_code22(); - var util_1 = require_util16(); - var additionalProperties_1 = require_additionalProperties3(); - var def = { - keyword: "properties", - type: "object", - schemaType: "object", - code(cxt) { - const { gen, schema: schema2, parentSchema, data, it } = cxt; - if (it.opts.removeAdditional === "all" && parentSchema.additionalProperties === void 0) { - additionalProperties_1.default.code(new validate_1.KeywordCxt(it, additionalProperties_1.default, "additionalProperties")); - } - const allProps = (0, code_1.allSchemaProperties)(schema2); - for (const prop of allProps) { - it.definedProperties.add(prop); - } - if (it.opts.unevaluated && allProps.length && it.props !== true) { - it.props = util_1.mergeEvaluated.props(gen, (0, util_1.toHash)(allProps), it.props); - } - const properties = allProps.filter((p) => !(0, util_1.alwaysValidSchema)(it, schema2[p])); - if (properties.length === 0) - return; - const valid = gen.name("valid"); - for (const prop of properties) { - if (hasDefault(prop)) { - applyPropertySchema(prop); - } else { - gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties)); - applyPropertySchema(prop); - if (!it.allErrors) - gen.else().var(valid, true); - gen.endIf(); - } - cxt.it.definedProperties.add(prop); - cxt.ok(valid); - } - function hasDefault(prop) { - return it.opts.useDefaults && !it.compositeRule && schema2[prop].default !== void 0; - } - function applyPropertySchema(prop) { - cxt.subschema({ - keyword: "properties", - schemaProp: prop, - dataProp: prop - }, valid); - } - } - }; - exports.default = def; -}); -var require_patternProperties3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var code_1 = require_code22(); - var codegen_1 = require_codegen3(); - var util_1 = require_util16(); - var util_2 = require_util16(); - var def = { - keyword: "patternProperties", - type: "object", - schemaType: "object", - code(cxt) { - const { gen, schema: schema2, data, parentSchema, it } = cxt; - const { opts } = it; - const patterns = (0, code_1.allSchemaProperties)(schema2); - const alwaysValidPatterns = patterns.filter((p) => (0, util_1.alwaysValidSchema)(it, schema2[p])); - if (patterns.length === 0 || alwaysValidPatterns.length === patterns.length && (!it.opts.unevaluated || it.props === true)) { - return; - } - const checkProperties = opts.strictSchema && !opts.allowMatchingProperties && parentSchema.properties; - const valid = gen.name("valid"); - if (it.props !== true && !(it.props instanceof codegen_1.Name)) { - it.props = (0, util_2.evaluatedPropsToName)(gen, it.props); - } - const { props } = it; - validatePatternProperties(); - function validatePatternProperties() { - for (const pat of patterns) { - if (checkProperties) - checkMatchingProperties(pat); - if (it.allErrors) { - validateProperties(pat); - } else { - gen.var(valid, true); - validateProperties(pat); - gen.if(valid); - } - } - } - function checkMatchingProperties(pat) { - for (const prop in checkProperties) { - if (new RegExp(pat).test(prop)) { - (0, util_1.checkStrictMode)(it, `property ${prop} matches pattern ${pat} (use allowMatchingProperties)`); - } - } - } - function validateProperties(pat) { - gen.forIn("key", data, (key) => { - gen.if((0, codegen_1._)`${(0, code_1.usePattern)(cxt, pat)}.test(${key})`, () => { - const alwaysValid = alwaysValidPatterns.includes(pat); - if (!alwaysValid) { - cxt.subschema({ - keyword: "patternProperties", - schemaProp: pat, - dataProp: key, - dataPropType: util_2.Type.Str - }, valid); - } - if (it.opts.unevaluated && props !== true) { - gen.assign((0, codegen_1._)`${props}[${key}]`, true); - } else if (!alwaysValid && !it.allErrors) { - gen.if((0, codegen_1.not)(valid), () => gen.break()); - } - }); - }); - } - } - }; - exports.default = def; -}); -var require_not3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var util_1 = require_util16(); - var def = { - keyword: "not", - schemaType: ["object", "boolean"], - trackErrors: true, - code(cxt) { - const { gen, schema: schema2, it } = cxt; - if ((0, util_1.alwaysValidSchema)(it, schema2)) { - cxt.fail(); - return; - } - const valid = gen.name("valid"); - cxt.subschema({ - keyword: "not", - compositeRule: true, - createErrors: false, - allErrors: false - }, valid); - cxt.failResult(valid, () => cxt.reset(), () => cxt.error()); - }, - error: { message: "must NOT be valid" } - }; - exports.default = def; -}); -var require_anyOf3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var code_1 = require_code22(); - var def = { - keyword: "anyOf", - schemaType: "array", - trackErrors: true, - code: code_1.validateUnion, - error: { message: "must match a schema in anyOf" } - }; - exports.default = def; -}); -var require_oneOf3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var codegen_1 = require_codegen3(); - var util_1 = require_util16(); - var error210 = { - message: "must match exactly one schema in oneOf", - params: ({ params }) => (0, codegen_1._)`{passingSchemas: ${params.passing}}` - }; - var def = { - keyword: "oneOf", - schemaType: "array", - trackErrors: true, - error: error210, - code(cxt) { - const { gen, schema: schema2, parentSchema, it } = cxt; - if (!Array.isArray(schema2)) - throw new Error("ajv implementation error"); - if (it.opts.discriminator && parentSchema.discriminator) - return; - const schArr = schema2; - const valid = gen.let("valid", false); - const passing = gen.let("passing", null); - const schValid = gen.name("_valid"); - cxt.setParams({ passing }); - gen.block(validateOneOf); - cxt.result(valid, () => cxt.reset(), () => cxt.error(true)); - function validateOneOf() { - schArr.forEach((sch, i) => { - let schCxt; - if ((0, util_1.alwaysValidSchema)(it, sch)) { - gen.var(schValid, true); - } else { - schCxt = cxt.subschema({ - keyword: "oneOf", - schemaProp: i, - compositeRule: true - }, schValid); - } - if (i > 0) { - gen.if((0, codegen_1._)`${schValid} && ${valid}`).assign(valid, false).assign(passing, (0, codegen_1._)`[${passing}, ${i}]`).else(); - } - gen.if(schValid, () => { - gen.assign(valid, true); - gen.assign(passing, i); - if (schCxt) - cxt.mergeEvaluated(schCxt, codegen_1.Name); - }); - }); - } - } - }; - exports.default = def; -}); -var require_allOf3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var util_1 = require_util16(); - var def = { - keyword: "allOf", - schemaType: "array", - code(cxt) { - const { gen, schema: schema2, it } = cxt; - if (!Array.isArray(schema2)) - throw new Error("ajv implementation error"); - const valid = gen.name("valid"); - schema2.forEach((sch, i) => { - if ((0, util_1.alwaysValidSchema)(it, sch)) - return; - const schCxt = cxt.subschema({ keyword: "allOf", schemaProp: i }, valid); - cxt.ok(valid); - cxt.mergeEvaluated(schCxt); - }); - } - }; - exports.default = def; -}); -var require_if3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var codegen_1 = require_codegen3(); - var util_1 = require_util16(); - var error210 = { - message: ({ params }) => (0, codegen_1.str)`must match "${params.ifClause}" schema`, - params: ({ params }) => (0, codegen_1._)`{failingKeyword: ${params.ifClause}}` - }; - var def = { - keyword: "if", - schemaType: ["object", "boolean"], - trackErrors: true, - error: error210, - code(cxt) { - const { gen, parentSchema, it } = cxt; - if (parentSchema.then === void 0 && parentSchema.else === void 0) { - (0, util_1.checkStrictMode)(it, '"if" without "then" and "else" is ignored'); - } - const hasThen = hasSchema(it, "then"); - const hasElse = hasSchema(it, "else"); - if (!hasThen && !hasElse) - return; - const valid = gen.let("valid", true); - const schValid = gen.name("_valid"); - validateIf(); - cxt.reset(); - if (hasThen && hasElse) { - const ifClause = gen.let("ifClause"); - cxt.setParams({ ifClause }); - gen.if(schValid, validateClause("then", ifClause), validateClause("else", ifClause)); - } else if (hasThen) { - gen.if(schValid, validateClause("then")); - } else { - gen.if((0, codegen_1.not)(schValid), validateClause("else")); - } - cxt.pass(valid, () => cxt.error(true)); - function validateIf() { - const schCxt = cxt.subschema({ - keyword: "if", - compositeRule: true, - createErrors: false, - allErrors: false - }, schValid); - cxt.mergeEvaluated(schCxt); - } - function validateClause(keyword, ifClause) { - return () => { - const schCxt = cxt.subschema({ keyword }, schValid); - gen.assign(valid, schValid); - cxt.mergeValidEvaluated(schCxt, valid); - if (ifClause) - gen.assign(ifClause, (0, codegen_1._)`${keyword}`); - else - cxt.setParams({ ifClause: keyword }); - }; - } - } - }; - function hasSchema(it, keyword) { - const schema2 = it.schema[keyword]; - return schema2 !== void 0 && !(0, util_1.alwaysValidSchema)(it, schema2); - } - exports.default = def; -}); -var require_thenElse3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var util_1 = require_util16(); - var def = { - keyword: ["then", "else"], - schemaType: ["object", "boolean"], - code({ keyword, parentSchema, it }) { - if (parentSchema.if === void 0) - (0, util_1.checkStrictMode)(it, `"${keyword}" without "if" is ignored`); - } - }; - exports.default = def; -}); -var require_applicator3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var additionalItems_1 = require_additionalItems3(); - var prefixItems_1 = require_prefixItems3(); - var items_1 = require_items3(); - var items2020_1 = require_items20203(); - var contains_1 = require_contains3(); - var dependencies_1 = require_dependencies3(); - var propertyNames_1 = require_propertyNames3(); - var additionalProperties_1 = require_additionalProperties3(); - var properties_1 = require_properties3(); - var patternProperties_1 = require_patternProperties3(); - var not_1 = require_not3(); - var anyOf_1 = require_anyOf3(); - var oneOf_1 = require_oneOf3(); - var allOf_1 = require_allOf3(); - var if_1 = require_if3(); - var thenElse_1 = require_thenElse3(); - function getApplicator(draft2020 = false) { - const applicator = [ - not_1.default, - anyOf_1.default, - oneOf_1.default, - allOf_1.default, - if_1.default, - thenElse_1.default, - propertyNames_1.default, - additionalProperties_1.default, - dependencies_1.default, - properties_1.default, - patternProperties_1.default - ]; - if (draft2020) - applicator.push(prefixItems_1.default, items2020_1.default); - else - applicator.push(additionalItems_1.default, items_1.default); - applicator.push(contains_1.default); - return applicator; - } - exports.default = getApplicator; -}); -var require_format4 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var codegen_1 = require_codegen3(); - var error210 = { - message: ({ schemaCode }) => (0, codegen_1.str)`must match format "${schemaCode}"`, - params: ({ schemaCode }) => (0, codegen_1._)`{format: ${schemaCode}}` - }; - var def = { - keyword: "format", - type: ["number", "string"], - schemaType: "string", - $data: true, - error: error210, - code(cxt, ruleType) { - const { gen, data, $data, schema: schema2, schemaCode, it } = cxt; - const { opts, errSchemaPath, schemaEnv, self: self2 } = it; - if (!opts.validateFormats) - return; - if ($data) - validate$DataFormat(); - else - validateFormat(); - function validate$DataFormat() { - const fmts = gen.scopeValue("formats", { - ref: self2.formats, - code: opts.code.formats - }); - const fDef = gen.const("fDef", (0, codegen_1._)`${fmts}[${schemaCode}]`); - const fType = gen.let("fType"); - const format2 = gen.let("format"); - gen.if((0, codegen_1._)`typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, (0, codegen_1._)`${fDef}.type || "string"`).assign(format2, (0, codegen_1._)`${fDef}.validate`), () => gen.assign(fType, (0, codegen_1._)`"string"`).assign(format2, fDef)); - cxt.fail$data((0, codegen_1.or)(unknownFmt(), invalidFmt())); - function unknownFmt() { - if (opts.strictSchema === false) - return codegen_1.nil; - return (0, codegen_1._)`${schemaCode} && !${format2}`; - } - function invalidFmt() { - const callFormat = schemaEnv.$async ? (0, codegen_1._)`(${fDef}.async ? await ${format2}(${data}) : ${format2}(${data}))` : (0, codegen_1._)`${format2}(${data})`; - const validData = (0, codegen_1._)`(typeof ${format2} == "function" ? ${callFormat} : ${format2}.test(${data}))`; - return (0, codegen_1._)`${format2} && ${format2} !== true && ${fType} === ${ruleType} && !${validData}`; - } - } - function validateFormat() { - const formatDef = self2.formats[schema2]; - if (!formatDef) { - unknownFormat(); - return; - } - if (formatDef === true) - return; - const [fmtType, format2, fmtRef] = getFormat(formatDef); - if (fmtType === ruleType) - cxt.pass(validCondition()); - function unknownFormat() { - if (opts.strictSchema === false) { - self2.logger.warn(unknownMsg()); - return; - } - throw new Error(unknownMsg()); - function unknownMsg() { - return `unknown format "${schema2}" ignored in schema at path "${errSchemaPath}"`; - } - } - function getFormat(fmtDef) { - const code = fmtDef instanceof RegExp ? (0, codegen_1.regexpCode)(fmtDef) : opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(schema2)}` : void 0; - const fmt = gen.scopeValue("formats", { key: schema2, ref: fmtDef, code }); - if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) { - return [fmtDef.type || "string", fmtDef.validate, (0, codegen_1._)`${fmt}.validate`]; - } - return ["string", fmtDef, fmt]; - } - function validCondition() { - if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) { - if (!schemaEnv.$async) - throw new Error("async format in sync schema"); - return (0, codegen_1._)`await ${fmtRef}(${data})`; - } - return typeof format2 == "function" ? (0, codegen_1._)`${fmtRef}(${data})` : (0, codegen_1._)`${fmtRef}.test(${data})`; - } - } - } - }; - exports.default = def; -}); -var require_format22 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var format_1 = require_format4(); - var format2 = [format_1.default]; - exports.default = format2; -}); -var require_metadata3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.contentVocabulary = exports.metadataVocabulary = void 0; - exports.metadataVocabulary = [ - "title", - "description", - "default", - "deprecated", - "readOnly", - "writeOnly", - "examples" - ]; - exports.contentVocabulary = [ - "contentMediaType", - "contentEncoding", - "contentSchema" - ]; -}); -var require_draft73 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var core_1 = require_core22(); - var validation_1 = require_validation3(); - var applicator_1 = require_applicator3(); - var format_1 = require_format22(); - var metadata_1 = require_metadata3(); - var draft7Vocabularies = [ - core_1.default, - validation_1.default, - (0, applicator_1.default)(), - format_1.default, - metadata_1.metadataVocabulary, - metadata_1.contentVocabulary - ]; - exports.default = draft7Vocabularies; -}); -var require_types3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DiscrError = void 0; - var DiscrError; - (function(DiscrError2) { - DiscrError2["Tag"] = "tag"; - DiscrError2["Mapping"] = "mapping"; - })(DiscrError || (exports.DiscrError = DiscrError = {})); -}); -var require_discriminator3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var codegen_1 = require_codegen3(); - var types_1 = require_types3(); - var compile_1 = require_compile3(); - var ref_error_1 = require_ref_error3(); - var util_1 = require_util16(); - var error210 = { - message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag ? `tag "${tagName}" must be string` : `value of tag "${tagName}" must be in oneOf`, - params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._)`{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}` - }; - var def = { - keyword: "discriminator", - type: "object", - schemaType: "object", - error: error210, - code(cxt) { - const { gen, data, schema: schema2, parentSchema, it } = cxt; - const { oneOf } = parentSchema; - if (!it.opts.discriminator) { - throw new Error("discriminator: requires discriminator option"); - } - const tagName = schema2.propertyName; - if (typeof tagName != "string") - throw new Error("discriminator: requires propertyName"); - if (schema2.mapping) - throw new Error("discriminator: mapping is not supported"); - if (!oneOf) - throw new Error("discriminator: requires oneOf keyword"); - const valid = gen.let("valid", false); - const tag = gen.const("tag", (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(tagName)}`); - gen.if((0, codegen_1._)`typeof ${tag} == "string"`, () => validateMapping(), () => cxt.error(false, { discrError: types_1.DiscrError.Tag, tag, tagName })); - cxt.ok(valid); - function validateMapping() { - const mapping = getMapping(); - gen.if(false); - for (const tagValue in mapping) { - gen.elseIf((0, codegen_1._)`${tag} === ${tagValue}`); - gen.assign(valid, applyTagSchema(mapping[tagValue])); - } - gen.else(); - cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag, tagName }); - gen.endIf(); - } - function applyTagSchema(schemaProp) { - const _valid = gen.name("valid"); - const schCxt = cxt.subschema({ keyword: "oneOf", schemaProp }, _valid); - cxt.mergeEvaluated(schCxt, codegen_1.Name); - return _valid; - } - function getMapping() { - var _a2; - const oneOfMapping = {}; - const topRequired = hasRequired(parentSchema); - let tagRequired = true; - for (let i = 0; i < oneOf.length; i++) { - let sch = oneOf[i]; - if ((sch === null || sch === void 0 ? void 0 : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it.self.RULES)) { - const ref = sch.$ref; - sch = compile_1.resolveRef.call(it.self, it.schemaEnv.root, it.baseId, ref); - if (sch instanceof compile_1.SchemaEnv) - sch = sch.schema; - if (sch === void 0) - throw new ref_error_1.default(it.opts.uriResolver, it.baseId, ref); - } - const propSch = (_a2 = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a2 === void 0 ? void 0 : _a2[tagName]; - if (typeof propSch != "object") { - throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${tagName}"`); - } - tagRequired = tagRequired && (topRequired || hasRequired(sch)); - addMappings(propSch, i); - } - if (!tagRequired) - throw new Error(`discriminator: "${tagName}" must be required`); - return oneOfMapping; - function hasRequired({ required: required22 }) { - return Array.isArray(required22) && required22.includes(tagName); - } - function addMappings(sch, i) { - if (sch.const) { - addMapping(sch.const, i); - } else if (sch.enum) { - for (const tagValue of sch.enum) { - addMapping(tagValue, i); - } - } else { - throw new Error(`discriminator: "properties/${tagName}" must have "const" or "enum"`); - } - } - function addMapping(tagValue, i) { - if (typeof tagValue != "string" || tagValue in oneOfMapping) { - throw new Error(`discriminator: "${tagName}" values must be unique strings`); - } - oneOfMapping[tagValue] = i; - } - } - } - }; - exports.default = def; -}); -var require_json_schema_draft_073 = __commonJS2((exports, module) => { - module.exports = { - $schema: "http://json-schema.org/draft-07/schema#", - $id: "http://json-schema.org/draft-07/schema#", - title: "Core schema meta-schema", - definitions: { - schemaArray: { - type: "array", - minItems: 1, - items: { $ref: "#" } - }, - nonNegativeInteger: { - type: "integer", - minimum: 0 - }, - nonNegativeIntegerDefault0: { - allOf: [{ $ref: "#/definitions/nonNegativeInteger" }, { default: 0 }] - }, - simpleTypes: { - enum: ["array", "boolean", "integer", "null", "number", "object", "string"] - }, - stringArray: { - type: "array", - items: { type: "string" }, - uniqueItems: true, - default: [] - } - }, - type: ["object", "boolean"], - properties: { - $id: { - type: "string", - format: "uri-reference" - }, - $schema: { - type: "string", - format: "uri" - }, - $ref: { - type: "string", - format: "uri-reference" - }, - $comment: { - type: "string" - }, - title: { - type: "string" - }, - description: { - type: "string" - }, - default: true, - readOnly: { - type: "boolean", - default: false - }, - examples: { - type: "array", - items: true - }, - multipleOf: { - type: "number", - exclusiveMinimum: 0 - }, - maximum: { - type: "number" - }, - exclusiveMaximum: { - type: "number" - }, - minimum: { - type: "number" - }, - exclusiveMinimum: { - type: "number" - }, - maxLength: { $ref: "#/definitions/nonNegativeInteger" }, - minLength: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, - pattern: { - type: "string", - format: "regex" - }, - additionalItems: { $ref: "#" }, - items: { - anyOf: [{ $ref: "#" }, { $ref: "#/definitions/schemaArray" }], - default: true - }, - maxItems: { $ref: "#/definitions/nonNegativeInteger" }, - minItems: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, - uniqueItems: { - type: "boolean", - default: false - }, - contains: { $ref: "#" }, - maxProperties: { $ref: "#/definitions/nonNegativeInteger" }, - minProperties: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, - required: { $ref: "#/definitions/stringArray" }, - additionalProperties: { $ref: "#" }, - definitions: { - type: "object", - additionalProperties: { $ref: "#" }, - default: {} - }, - properties: { - type: "object", - additionalProperties: { $ref: "#" }, - default: {} - }, - patternProperties: { - type: "object", - additionalProperties: { $ref: "#" }, - propertyNames: { format: "regex" }, - default: {} - }, - dependencies: { - type: "object", - additionalProperties: { - anyOf: [{ $ref: "#" }, { $ref: "#/definitions/stringArray" }] - } - }, - propertyNames: { $ref: "#" }, - const: true, - enum: { - type: "array", - items: true, - minItems: 1, - uniqueItems: true - }, - type: { - anyOf: [ - { $ref: "#/definitions/simpleTypes" }, - { - type: "array", - items: { $ref: "#/definitions/simpleTypes" }, - minItems: 1, - uniqueItems: true - } - ] - }, - format: { type: "string" }, - contentMediaType: { type: "string" }, - contentEncoding: { type: "string" }, - if: { $ref: "#" }, - then: { $ref: "#" }, - else: { $ref: "#" }, - allOf: { $ref: "#/definitions/schemaArray" }, - anyOf: { $ref: "#/definitions/schemaArray" }, - oneOf: { $ref: "#/definitions/schemaArray" }, - not: { $ref: "#" } - }, - default: true - }; -}); -var require_ajv3 = __commonJS2((exports, module) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv = void 0; - var core_1 = require_core5(); - var draft7_1 = require_draft73(); - var discriminator_1 = require_discriminator3(); - var draft7MetaSchema = require_json_schema_draft_073(); - var META_SUPPORT_DATA = ["/properties"]; - var META_SCHEMA_ID = "http://json-schema.org/draft-07/schema"; - class Ajv2 extends core_1.default { - _addVocabularies() { - super._addVocabularies(); - draft7_1.default.forEach((v) => this.addVocabulary(v)); - if (this.opts.discriminator) - this.addKeyword(discriminator_1.default); - } - _addDefaultMetaSchema() { - super._addDefaultMetaSchema(); - if (!this.opts.meta) - return; - const metaSchema = this.opts.$data ? this.$dataMetaSchema(draft7MetaSchema, META_SUPPORT_DATA) : draft7MetaSchema; - this.addMetaSchema(metaSchema, META_SCHEMA_ID, false); - this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID; - } - defaultMeta() { - return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : void 0); - } - } - exports.Ajv = Ajv2; - module.exports = exports = Ajv2; - module.exports.Ajv = Ajv2; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = Ajv2; - var validate_1 = require_validate3(); - Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function() { - return validate_1.KeywordCxt; - } }); - var codegen_1 = require_codegen3(); - Object.defineProperty(exports, "_", { enumerable: true, get: function() { - return codegen_1._; - } }); - Object.defineProperty(exports, "str", { enumerable: true, get: function() { - return codegen_1.str; - } }); - Object.defineProperty(exports, "stringify", { enumerable: true, get: function() { - return codegen_1.stringify; - } }); - Object.defineProperty(exports, "nil", { enumerable: true, get: function() { - return codegen_1.nil; - } }); - Object.defineProperty(exports, "Name", { enumerable: true, get: function() { - return codegen_1.Name; - } }); - Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function() { - return codegen_1.CodeGen; - } }); - var validation_error_1 = require_validation_error3(); - Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function() { - return validation_error_1.default; - } }); - var ref_error_1 = require_ref_error3(); - Object.defineProperty(exports, "MissingRefError", { enumerable: true, get: function() { - return ref_error_1.default; - } }); -}); -var require_formats3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.formatNames = exports.fastFormats = exports.fullFormats = void 0; - function fmtDef(validate2, compare) { - return { validate: validate2, compare }; - } - exports.fullFormats = { - date: fmtDef(date42, compareDate), - time: fmtDef(getTime(true), compareTime), - "date-time": fmtDef(getDateTime(true), compareDateTime), - "iso-time": fmtDef(getTime(), compareIsoTime), - "iso-date-time": fmtDef(getDateTime(), compareIsoDateTime), - duration: /^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/, - uri, - "uri-reference": /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i, - "uri-template": /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i, - url: /^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu, - email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i, - hostname: /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i, - ipv4: /^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/, - ipv6: /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i, - regex: regex4, - uuid: /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i, - "json-pointer": /^(?:\/(?:[^~/]|~0|~1)*)*$/, - "json-pointer-uri-fragment": /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i, - "relative-json-pointer": /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/, - byte, - int32: { type: "number", validate: validateInt32 }, - int64: { type: "number", validate: validateInt64 }, - float: { type: "number", validate: validateNumber }, - double: { type: "number", validate: validateNumber }, - password: true, - binary: true - }; - exports.fastFormats = { - ...exports.fullFormats, - date: fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d$/, compareDate), - time: fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, compareTime), - "date-time": fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, compareDateTime), - "iso-time": fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, compareIsoTime), - "iso-date-time": fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, compareIsoDateTime), - uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i, - "uri-reference": /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i, - email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i - }; - exports.formatNames = Object.keys(exports.fullFormats); - function isLeapYear(year) { - return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); - } - var DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/; - var DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; - function date42(str) { - const matches = DATE.exec(str); - if (!matches) - return false; - const year = +matches[1]; - const month = +matches[2]; - const day = +matches[3]; - return month >= 1 && month <= 12 && day >= 1 && day <= (month === 2 && isLeapYear(year) ? 29 : DAYS[month]); - } - function compareDate(d1, d2) { - if (!(d1 && d2)) - return; - if (d1 > d2) - return 1; - if (d1 < d2) - return -1; - return 0; - } - var TIME = /^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i; - function getTime(strictTimeZone) { - return function time5(str) { - const matches = TIME.exec(str); - if (!matches) - return false; - const hr = +matches[1]; - const min = +matches[2]; - const sec = +matches[3]; - const tz = matches[4]; - const tzSign = matches[5] === "-" ? -1 : 1; - const tzH = +(matches[6] || 0); - const tzM = +(matches[7] || 0); - if (tzH > 23 || tzM > 59 || strictTimeZone && !tz) - return false; - if (hr <= 23 && min <= 59 && sec < 60) - return true; - const utcMin = min - tzM * tzSign; - const utcHr = hr - tzH * tzSign - (utcMin < 0 ? 1 : 0); - return (utcHr === 23 || utcHr === -1) && (utcMin === 59 || utcMin === -1) && sec < 61; - }; - } - function compareTime(s1, s2) { - if (!(s1 && s2)) - return; - const t1 = (/* @__PURE__ */ new Date("2020-01-01T" + s1)).valueOf(); - const t2 = (/* @__PURE__ */ new Date("2020-01-01T" + s2)).valueOf(); - if (!(t1 && t2)) - return; - return t1 - t2; - } - function compareIsoTime(t1, t2) { - if (!(t1 && t2)) - return; - const a1 = TIME.exec(t1); - const a2 = TIME.exec(t2); - if (!(a1 && a2)) - return; - t1 = a1[1] + a1[2] + a1[3]; - t2 = a2[1] + a2[2] + a2[3]; - if (t1 > t2) - return 1; - if (t1 < t2) - return -1; - return 0; - } - var DATE_TIME_SEPARATOR = /t|\s/i; - function getDateTime(strictTimeZone) { - const time32 = getTime(strictTimeZone); - return function date_time(str) { - const dateTime = str.split(DATE_TIME_SEPARATOR); - return dateTime.length === 2 && date42(dateTime[0]) && time32(dateTime[1]); - }; - } - function compareDateTime(dt1, dt2) { - if (!(dt1 && dt2)) - return; - const d1 = new Date(dt1).valueOf(); - const d2 = new Date(dt2).valueOf(); - if (!(d1 && d2)) - return; - return d1 - d2; - } - function compareIsoDateTime(dt1, dt2) { - if (!(dt1 && dt2)) - return; - const [d1, t1] = dt1.split(DATE_TIME_SEPARATOR); - const [d2, t2] = dt2.split(DATE_TIME_SEPARATOR); - const res = compareDate(d1, d2); - if (res === void 0) - return; - return res || compareTime(t1, t2); - } - var NOT_URI_FRAGMENT = /\/|:/; - var URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i; - function uri(str) { - return NOT_URI_FRAGMENT.test(str) && URI.test(str); - } - var BYTE = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm; - function byte(str) { - BYTE.lastIndex = 0; - return BYTE.test(str); - } - var MIN_INT32 = -(2 ** 31); - var MAX_INT32 = 2 ** 31 - 1; - function validateInt32(value2) { - return Number.isInteger(value2) && value2 <= MAX_INT32 && value2 >= MIN_INT32; - } - function validateInt64(value2) { - return Number.isInteger(value2); - } - function validateNumber() { - return true; - } - var Z_ANCHOR = /[^\\]\\Z/; - function regex4(str) { - if (Z_ANCHOR.test(str)) - return false; - try { - new RegExp(str); - return true; - } catch (e) { - return false; - } - } -}); -var require_limit3 = __commonJS2((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.formatLimitDefinition = void 0; - var ajv_1 = require_ajv3(); - var codegen_1 = require_codegen3(); - var ops = codegen_1.operators; - var KWDs = { - formatMaximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT }, - formatMinimum: { okStr: ">=", ok: ops.GTE, fail: ops.LT }, - formatExclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE }, - formatExclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE } - }; - var error210 = { - message: ({ keyword, schemaCode }) => (0, codegen_1.str)`should be ${KWDs[keyword].okStr} ${schemaCode}`, - params: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}` - }; - exports.formatLimitDefinition = { - keyword: Object.keys(KWDs), - type: "string", - schemaType: "string", - $data: true, - error: error210, - code(cxt) { - const { gen, data, schemaCode, keyword, it } = cxt; - const { opts, self: self2 } = it; - if (!opts.validateFormats) - return; - const fCxt = new ajv_1.KeywordCxt(it, self2.RULES.all.format.definition, "format"); - if (fCxt.$data) - validate$DataFormat(); - else - validateFormat(); - function validate$DataFormat() { - const fmts = gen.scopeValue("formats", { - ref: self2.formats, - code: opts.code.formats - }); - const fmt = gen.const("fmt", (0, codegen_1._)`${fmts}[${fCxt.schemaCode}]`); - cxt.fail$data((0, codegen_1.or)((0, codegen_1._)`typeof ${fmt} != "object"`, (0, codegen_1._)`${fmt} instanceof RegExp`, (0, codegen_1._)`typeof ${fmt}.compare != "function"`, compareCode(fmt))); - } - function validateFormat() { - const format2 = fCxt.schema; - const fmtDef = self2.formats[format2]; - if (!fmtDef || fmtDef === true) - return; - if (typeof fmtDef != "object" || fmtDef instanceof RegExp || typeof fmtDef.compare != "function") { - throw new Error(`"${keyword}": format "${format2}" does not define "compare" function`); - } - const fmt = gen.scopeValue("formats", { - key: format2, - ref: fmtDef, - code: opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(format2)}` : void 0 - }); - cxt.fail$data(compareCode(fmt)); - } - function compareCode(fmt) { - return (0, codegen_1._)`${fmt}.compare(${data}, ${schemaCode}) ${KWDs[keyword].fail} 0`; - } - }, - dependencies: ["format"] - }; - var formatLimitPlugin = (ajv) => { - ajv.addKeyword(exports.formatLimitDefinition); - return ajv; - }; - exports.default = formatLimitPlugin; -}); -var require_dist3 = __commonJS2((exports, module) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var formats_1 = require_formats3(); - var limit_1 = require_limit3(); - var codegen_1 = require_codegen3(); - var fullName = new codegen_1.Name("fullFormats"); - var fastName = new codegen_1.Name("fastFormats"); - var formatsPlugin = (ajv, opts = { keywords: true }) => { - if (Array.isArray(opts)) { - addFormats(ajv, opts, formats_1.fullFormats, fullName); - return ajv; - } - const [formats, exportName] = opts.mode === "fast" ? [formats_1.fastFormats, fastName] : [formats_1.fullFormats, fullName]; - const list = opts.formats || formats_1.formatNames; - addFormats(ajv, list, formats, exportName); - if (opts.keywords) - (0, limit_1.default)(ajv); - return ajv; - }; - formatsPlugin.get = (name, mode = "full") => { - const formats = mode === "fast" ? formats_1.fastFormats : formats_1.fullFormats; - const f = formats[name]; - if (!f) - throw new Error(`Unknown format "${name}"`); - return f; - }; - function addFormats(ajv, list, fs22, exportName) { - var _a2; - var _b; - (_a2 = (_b = ajv.opts.code).formats) !== null && _a2 !== void 0 || (_b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`); - for (const f of list) - ajv.addFormat(f, fs22[f]); - } - module.exports = exports = formatsPlugin; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = formatsPlugin; -}); -var DEFAULT_MAX_LISTENERS = 50; -function createAbortController(maxListeners = DEFAULT_MAX_LISTENERS) { - const controller = new AbortController(); - setMaxListeners(maxListeners, controller.signal); - return controller; -} -var freeGlobal = typeof global == "object" && global && global.Object === Object && global; -var _freeGlobal_default = freeGlobal; -var freeSelf = typeof self == "object" && self && self.Object === Object && self; -var root = _freeGlobal_default || freeSelf || Function("return this")(); -var _root_default = root; -var Symbol2 = _root_default.Symbol; -var _Symbol_default = Symbol2; -var objectProto = Object.prototype; -var hasOwnProperty = objectProto.hasOwnProperty; -var nativeObjectToString = objectProto.toString; -var symToStringTag = _Symbol_default ? _Symbol_default.toStringTag : void 0; -function getRawTag(value2) { - var isOwn = hasOwnProperty.call(value2, symToStringTag), tag = value2[symToStringTag]; - try { - value2[symToStringTag] = void 0; - var unmasked = true; - } catch (e) { - } - var result = nativeObjectToString.call(value2); - if (unmasked) { - if (isOwn) { - value2[symToStringTag] = tag; - } else { - delete value2[symToStringTag]; - } - } - return result; -} -var _getRawTag_default = getRawTag; -var objectProto2 = Object.prototype; -var nativeObjectToString2 = objectProto2.toString; -function objectToString(value2) { - return nativeObjectToString2.call(value2); -} -var _objectToString_default = objectToString; -var nullTag = "[object Null]"; -var undefinedTag = "[object Undefined]"; -var symToStringTag2 = _Symbol_default ? _Symbol_default.toStringTag : void 0; -function baseGetTag(value2) { - if (value2 == null) { - return value2 === void 0 ? undefinedTag : nullTag; - } - return symToStringTag2 && symToStringTag2 in Object(value2) ? _getRawTag_default(value2) : _objectToString_default(value2); -} -var _baseGetTag_default = baseGetTag; -function isObject4(value2) { - var type2 = typeof value2; - return value2 != null && (type2 == "object" || type2 == "function"); -} -var isObject_default = isObject4; -var asyncTag = "[object AsyncFunction]"; -var funcTag = "[object Function]"; -var genTag = "[object GeneratorFunction]"; -var proxyTag = "[object Proxy]"; -function isFunction(value2) { - if (!isObject_default(value2)) { - return false; - } - var tag = _baseGetTag_default(value2); - return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; -} -var isFunction_default = isFunction; -var coreJsData = _root_default["__core-js_shared__"]; -var _coreJsData_default = coreJsData; -var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(_coreJsData_default && _coreJsData_default.keys && _coreJsData_default.keys.IE_PROTO || ""); - return uid ? "Symbol(src)_1." + uid : ""; -})(); -function isMasked(func) { - return !!maskSrcKey && maskSrcKey in func; -} -var _isMasked_default = isMasked; -var funcProto = Function.prototype; -var funcToString = funcProto.toString; -function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) { - } - try { - return func + ""; - } catch (e) { - } - } - return ""; -} -var _toSource_default = toSource; -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; -var reIsHostCtor = /^\[object .+?Constructor\]$/; -var funcProto2 = Function.prototype; -var objectProto3 = Object.prototype; -var funcToString2 = funcProto2.toString; -var hasOwnProperty2 = objectProto3.hasOwnProperty; -var reIsNative = RegExp("^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"); -function baseIsNative(value2) { - if (!isObject_default(value2) || _isMasked_default(value2)) { - return false; - } - var pattern = isFunction_default(value2) ? reIsNative : reIsHostCtor; - return pattern.test(_toSource_default(value2)); -} -var _baseIsNative_default = baseIsNative; -function getValue(object5, key) { - return object5 == null ? void 0 : object5[key]; -} -var _getValue_default = getValue; -function getNative(object5, key) { - var value2 = _getValue_default(object5, key); - return _baseIsNative_default(value2) ? value2 : void 0; -} -var _getNative_default = getNative; -var nativeCreate = _getNative_default(Object, "create"); -var _nativeCreate_default = nativeCreate; -function hashClear() { - this.__data__ = _nativeCreate_default ? _nativeCreate_default(null) : {}; - this.size = 0; -} -var _hashClear_default = hashClear; -function hashDelete(key) { - var result = this.has(key) && delete this.__data__[key]; - this.size -= result ? 1 : 0; - return result; -} -var _hashDelete_default = hashDelete; -var HASH_UNDEFINED = "__lodash_hash_undefined__"; -var objectProto4 = Object.prototype; -var hasOwnProperty3 = objectProto4.hasOwnProperty; -function hashGet(key) { - var data = this.__data__; - if (_nativeCreate_default) { - var result = data[key]; - return result === HASH_UNDEFINED ? void 0 : result; - } - return hasOwnProperty3.call(data, key) ? data[key] : void 0; -} -var _hashGet_default = hashGet; -var objectProto5 = Object.prototype; -var hasOwnProperty4 = objectProto5.hasOwnProperty; -function hashHas(key) { - var data = this.__data__; - return _nativeCreate_default ? data[key] !== void 0 : hasOwnProperty4.call(data, key); -} -var _hashHas_default = hashHas; -var HASH_UNDEFINED2 = "__lodash_hash_undefined__"; -function hashSet(key, value2) { - var data = this.__data__; - this.size += this.has(key) ? 0 : 1; - data[key] = _nativeCreate_default && value2 === void 0 ? HASH_UNDEFINED2 : value2; - return this; -} -var _hashSet_default = hashSet; -function Hash(entries) { - var index = -1, length = entries == null ? 0 : entries.length; - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} -Hash.prototype.clear = _hashClear_default; -Hash.prototype["delete"] = _hashDelete_default; -Hash.prototype.get = _hashGet_default; -Hash.prototype.has = _hashHas_default; -Hash.prototype.set = _hashSet_default; -var _Hash_default = Hash; -function listCacheClear() { - this.__data__ = []; - this.size = 0; -} -var _listCacheClear_default = listCacheClear; -function eq(value2, other) { - return value2 === other || value2 !== value2 && other !== other; -} -var eq_default = eq; -function assocIndexOf(array4, key) { - var length = array4.length; - while (length--) { - if (eq_default(array4[length][0], key)) { - return length; - } - } - return -1; -} -var _assocIndexOf_default = assocIndexOf; -var arrayProto = Array.prototype; -var splice = arrayProto.splice; -function listCacheDelete(key) { - var data = this.__data__, index = _assocIndexOf_default(data, key); - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); - } - --this.size; - return true; -} -var _listCacheDelete_default = listCacheDelete; -function listCacheGet(key) { - var data = this.__data__, index = _assocIndexOf_default(data, key); - return index < 0 ? void 0 : data[index][1]; -} -var _listCacheGet_default = listCacheGet; -function listCacheHas(key) { - return _assocIndexOf_default(this.__data__, key) > -1; -} -var _listCacheHas_default = listCacheHas; -function listCacheSet(key, value2) { - var data = this.__data__, index = _assocIndexOf_default(data, key); - if (index < 0) { - ++this.size; - data.push([key, value2]); - } else { - data[index][1] = value2; - } - return this; -} -var _listCacheSet_default = listCacheSet; -function ListCache(entries) { - var index = -1, length = entries == null ? 0 : entries.length; - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} -ListCache.prototype.clear = _listCacheClear_default; -ListCache.prototype["delete"] = _listCacheDelete_default; -ListCache.prototype.get = _listCacheGet_default; -ListCache.prototype.has = _listCacheHas_default; -ListCache.prototype.set = _listCacheSet_default; -var _ListCache_default = ListCache; -var Map2 = _getNative_default(_root_default, "Map"); -var _Map_default = Map2; -function mapCacheClear() { - this.size = 0; - this.__data__ = { - hash: new _Hash_default(), - map: new (_Map_default || _ListCache_default)(), - string: new _Hash_default() - }; -} -var _mapCacheClear_default = mapCacheClear; -function isKeyable(value2) { - var type2 = typeof value2; - return type2 == "string" || type2 == "number" || type2 == "symbol" || type2 == "boolean" ? value2 !== "__proto__" : value2 === null; -} -var _isKeyable_default = isKeyable; -function getMapData(map2, key) { - var data = map2.__data__; - return _isKeyable_default(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map; -} -var _getMapData_default = getMapData; -function mapCacheDelete(key) { - var result = _getMapData_default(this, key)["delete"](key); - this.size -= result ? 1 : 0; - return result; -} -var _mapCacheDelete_default = mapCacheDelete; -function mapCacheGet(key) { - return _getMapData_default(this, key).get(key); -} -var _mapCacheGet_default = mapCacheGet; -function mapCacheHas(key) { - return _getMapData_default(this, key).has(key); -} -var _mapCacheHas_default = mapCacheHas; -function mapCacheSet(key, value2) { - var data = _getMapData_default(this, key), size = data.size; - data.set(key, value2); - this.size += data.size == size ? 0 : 1; - return this; -} -var _mapCacheSet_default = mapCacheSet; -function MapCache(entries) { - var index = -1, length = entries == null ? 0 : entries.length; - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} -MapCache.prototype.clear = _mapCacheClear_default; -MapCache.prototype["delete"] = _mapCacheDelete_default; -MapCache.prototype.get = _mapCacheGet_default; -MapCache.prototype.has = _mapCacheHas_default; -MapCache.prototype.set = _mapCacheSet_default; -var _MapCache_default = MapCache; -var FUNC_ERROR_TEXT = "Expected a function"; -function memoize(func, resolver) { - if (typeof func != "function" || resolver != null && typeof resolver != "function") { - throw new TypeError(FUNC_ERROR_TEXT); - } - var memoized = function() { - var args3 = arguments, key = resolver ? resolver.apply(this, args3) : args3[0], cache = memoized.cache; - if (cache.has(key)) { - return cache.get(key); - } - var result = func.apply(this, args3); - memoized.cache = cache.set(key, result) || cache; - return result; - }; - memoized.cache = new (memoize.Cache || _MapCache_default)(); - return memoized; -} -memoize.Cache = _MapCache_default; -var memoize_default = memoize; -var CHUNK_SIZE = 2e3; -function writeToStderr(data) { - if (process.stderr.destroyed) { - return; - } - for (let i = 0; i < data.length; i += CHUNK_SIZE) { - process.stderr.write(data.substring(i, i + CHUNK_SIZE)); - } -} -var parseDebugFilter = memoize_default((filterString) => { - if (!filterString || filterString.trim() === "") { - return null; - } - const filters = filterString.split(",").map((f) => f.trim()).filter(Boolean); - if (filters.length === 0) { - return null; - } - const hasExclusive = filters.some((f) => f.startsWith("!")); - const hasInclusive = filters.some((f) => !f.startsWith("!")); - if (hasExclusive && hasInclusive) { - return null; - } - const cleanFilters = filters.map((f) => f.replace(/^!/, "").toLowerCase()); - return { - include: hasExclusive ? [] : cleanFilters, - exclude: hasExclusive ? cleanFilters : [], - isExclusive: hasExclusive - }; -}); -function extractDebugCategories(message) { - const categories = []; - const mcpMatch = message.match(/^MCP server ["']([^"']+)["']/); - if (mcpMatch && mcpMatch[1]) { - categories.push("mcp"); - categories.push(mcpMatch[1].toLowerCase()); - } else { - const prefixMatch = message.match(/^([^:[]+):/); - if (prefixMatch && prefixMatch[1]) { - categories.push(prefixMatch[1].trim().toLowerCase()); - } - } - const bracketMatch = message.match(/^\[([^\]]+)]/); - if (bracketMatch && bracketMatch[1]) { - categories.push(bracketMatch[1].trim().toLowerCase()); - } - if (message.toLowerCase().includes("statsig event:")) { - categories.push("statsig"); - } - const secondaryMatch = message.match(/:\s*([^:]+?)(?:\s+(?:type|mode|status|event))?:/); - if (secondaryMatch && secondaryMatch[1]) { - const secondary = secondaryMatch[1].trim().toLowerCase(); - if (secondary.length < 30 && !secondary.includes(" ")) { - categories.push(secondary); - } - } - return Array.from(new Set(categories)); -} -function shouldShowDebugCategories(categories, filter) { - if (!filter) { - return true; - } - if (categories.length === 0) { - return false; - } - if (filter.isExclusive) { - return !categories.some((cat) => filter.exclude.includes(cat)); - } else { - return categories.some((cat) => filter.include.includes(cat)); - } -} -function shouldShowDebugMessage(message, filter) { - if (!filter) { - return true; - } - const categories = extractDebugCategories(message); - return shouldShowDebugCategories(categories, filter); -} -function getClaudeConfigHomeDir() { - return process.env.CLAUDE_CONFIG_DIR ?? join8(homedir(), ".claude"); -} -function isEnvTruthy(envVar) { - if (!envVar) - return false; - if (typeof envVar === "boolean") - return envVar; - const normalizedValue = envVar.toLowerCase().trim(); - return ["1", "true", "yes", "on"].includes(normalizedValue); -} -var MAX_OUTPUT_LENGTH = 15e4; -var DEFAULT_MAX_OUTPUT_LENGTH = 3e4; -function createMaxOutputLengthValidator(name) { - return { - name, - default: DEFAULT_MAX_OUTPUT_LENGTH, - validate: (value2) => { - if (!value2) { - return { - effective: DEFAULT_MAX_OUTPUT_LENGTH, - status: "valid" - }; - } - const parsed2 = parseInt(value2, 10); - if (isNaN(parsed2) || parsed2 <= 0) { - return { - effective: DEFAULT_MAX_OUTPUT_LENGTH, - status: "invalid", - message: `Invalid value "${value2}" (using default: ${DEFAULT_MAX_OUTPUT_LENGTH})` - }; - } - if (parsed2 > MAX_OUTPUT_LENGTH) { - return { - effective: MAX_OUTPUT_LENGTH, - status: "capped", - message: `Capped from ${parsed2} to ${MAX_OUTPUT_LENGTH}` - }; - } - return { effective: parsed2, status: "valid" }; - } - }; -} -var bashMaxOutputLengthValidator = createMaxOutputLengthValidator("BASH_MAX_OUTPUT_LENGTH"); -var taskMaxOutputLengthValidator = createMaxOutputLengthValidator("TASK_MAX_OUTPUT_LENGTH"); -var maxOutputTokensValidator = { - name: "CLAUDE_CODE_MAX_OUTPUT_TOKENS", - default: 32e3, - validate: (value2) => { - const MAX_OUTPUT_TOKENS = 64e3; - const DEFAULT_MAX_OUTPUT_TOKENS = 32e3; - if (!value2) { - return { effective: DEFAULT_MAX_OUTPUT_TOKENS, status: "valid" }; - } - const parsed2 = parseInt(value2, 10); - if (isNaN(parsed2) || parsed2 <= 0) { - return { - effective: DEFAULT_MAX_OUTPUT_TOKENS, - status: "invalid", - message: `Invalid value "${value2}" (using default: ${DEFAULT_MAX_OUTPUT_TOKENS})` - }; - } - if (parsed2 > MAX_OUTPUT_TOKENS) { - return { - effective: MAX_OUTPUT_TOKENS, - status: "capped", - message: `Capped from ${parsed2} to ${MAX_OUTPUT_TOKENS}` - }; - } - return { effective: parsed2, status: "valid" }; - } -}; -function getInitialState() { - let resolvedCwd = ""; - if (typeof process !== "undefined" && typeof process.cwd === "function") { - resolvedCwd = realpathSync2(cwd()); - } - return { - originalCwd: resolvedCwd, - projectRoot: resolvedCwd, - totalCostUSD: 0, - totalAPIDuration: 0, - totalAPIDurationWithoutRetries: 0, - totalToolDuration: 0, - startTime: Date.now(), - lastInteractionTime: Date.now(), - totalLinesAdded: 0, - totalLinesRemoved: 0, - hasUnknownModelCost: false, - cwd: resolvedCwd, - modelUsage: {}, - mainLoopModelOverride: void 0, - initialMainLoopModel: null, - modelStrings: null, - isInteractive: false, - clientType: "cli", - sessionIngressToken: void 0, - oauthTokenFromFd: void 0, - apiKeyFromFd: void 0, - flagSettingsPath: void 0, - allowedSettingSources: [ - "userSettings", - "projectSettings", - "localSettings", - "flagSettings", - "policySettings" - ], - meter: null, - sessionCounter: null, - locCounter: null, - prCounter: null, - commitCounter: null, - costCounter: null, - tokenCounter: null, - codeEditToolDecisionCounter: null, - activeTimeCounter: null, - sessionId: randomUUID3(), - loggerProvider: null, - eventLogger: null, - meterProvider: null, - tracerProvider: null, - agentColorMap: /* @__PURE__ */ new Map(), - agentColorIndex: 0, - envVarValidators: [bashMaxOutputLengthValidator, maxOutputTokensValidator], - lastAPIRequest: null, - inMemoryErrorLog: [], - inlinePlugins: [], - sessionBypassPermissionsMode: false, - sessionTrustAccepted: false, - sessionPersistenceDisabled: false, - hasExitedPlanMode: false, - needsPlanModeExitAttachment: false, - hasExitedDelegateMode: false, - needsDelegateModeExitAttachment: false, - lspRecommendationShownThisSession: false, - initJsonSchema: null, - registeredHooks: null, - planSlugCache: /* @__PURE__ */ new Map(), - teleportedSessionInfo: null, - invokedSkills: /* @__PURE__ */ new Map(), - slowOperations: [], - sdkBetas: void 0, - mainThreadAgentType: void 0 - }; -} -var STATE = getInitialState(); -function getSessionId() { - return STATE.sessionId; -} -function createBufferedWriter({ - writeFn, - flushIntervalMs = 1e3, - maxBufferSize: maxBufferSize2 = 100, - immediateMode = false -}) { - let buffer = []; - let flushTimer = null; - function clearTimer() { - if (flushTimer) { - clearTimeout(flushTimer); - flushTimer = null; - } - } - function flush() { - if (buffer.length === 0) - return; - writeFn(buffer.join("")); - buffer = []; - clearTimer(); - } - function scheduleFlush() { - if (!flushTimer) { - flushTimer = setTimeout(flush, flushIntervalMs); - } - } - return { - write(content) { - if (immediateMode) { - writeFn(content); - return; - } - buffer.push(content); - scheduleFlush(); - if (buffer.length >= maxBufferSize2) { - flush(); - } - }, - flush, - dispose() { - flush(); - } - }; -} -var cleanupFunctions = /* @__PURE__ */ new Set(); -function registerCleanup(cleanupFn2) { - cleanupFunctions.add(cleanupFn2); - return () => cleanupFunctions.delete(cleanupFn2); -} -var SLOW_OPERATION_THRESHOLD_MS = Infinity; -function describeValue(value2) { - if (value2 === null) - return "null"; - if (value2 === void 0) - return "undefined"; - if (Array.isArray(value2)) - return `Array[${value2.length}]`; - if (typeof value2 === "object") { - const keys = Object.keys(value2); - return `Object{${keys.length} keys}`; - } - if (typeof value2 === "string") - return `string(${value2.length} chars)`; - return typeof value2; -} -function withSlowLogging(operation, fn2) { - const startTime = performance.now(); - try { - return fn2(); - } finally { - const duration5 = performance.now() - startTime; - if (duration5 > SLOW_OPERATION_THRESHOLD_MS && false) { - } - } -} -function jsonStringify(value2, replacer, space) { - const description = describeValue(value2); - return withSlowLogging(`JSON.stringify(${description})`, () => JSON.stringify(value2, replacer, space)); -} -var jsonParse = (text, reviver) => { - const length = typeof text === "string" ? text.length : 0; - return withSlowLogging(`JSON.parse(${length} chars)`, () => JSON.parse(text, reviver)); -}; -var isDebugMode = memoize_default(() => { - return isEnvTruthy(process.env.DEBUG) || isEnvTruthy(process.env.DEBUG_SDK) || process.argv.includes("--debug") || process.argv.includes("-d") || isDebugToStdErr() || process.argv.some((arg) => arg.startsWith("--debug=")); -}); -var getDebugFilter = memoize_default(() => { - const debugArg = process.argv.find((arg) => arg.startsWith("--debug=")); - if (!debugArg) { - return null; - } - const filterPattern = debugArg.substring("--debug=".length); - return parseDebugFilter(filterPattern); -}); -var isDebugToStdErr = memoize_default(() => { - return process.argv.includes("--debug-to-stderr") || process.argv.includes("-d2e"); -}); -function shouldLogDebugMessage(message) { - if (false) { - } - if (typeof process === "undefined" || typeof process.versions === "undefined" || typeof process.versions.node === "undefined") { - return false; - } - const filter = getDebugFilter(); - return shouldShowDebugMessage(message, filter); -} -var hasFormattedOutput = false; -var debugWriter = null; -function getDebugWriter() { - if (!debugWriter) { - debugWriter = createBufferedWriter({ - writeFn: (content) => { - const path4 = getDebugLogPath(); - if (!getFsImplementation().existsSync(dirname(path4))) { - getFsImplementation().mkdirSync(dirname(path4)); - } - getFsImplementation().appendFileSync(path4, content); - updateLatestDebugLogSymlink(); - }, - flushIntervalMs: 1e3, - maxBufferSize: 100, - immediateMode: isDebugMode() - }); - registerCleanup(async () => debugWriter?.dispose()); - } - return debugWriter; -} -function logForDebugging2(message, { level } = { - level: "debug" -}) { - if (!shouldLogDebugMessage(message)) { - return; - } - if (hasFormattedOutput && message.includes(` -`)) { - message = jsonStringify(message); - } - const timestamp = (/* @__PURE__ */ new Date()).toISOString(); - const output = `${timestamp} [${level.toUpperCase()}] ${message.trim()} -`; - if (isDebugToStdErr()) { - writeToStderr(output); - return; - } - getDebugWriter().write(output); -} -function getDebugLogPath() { - return process.env.CLAUDE_CODE_DEBUG_LOGS_DIR ?? join22(getClaudeConfigHomeDir(), "debug", `${getSessionId()}.txt`); -} -var updateLatestDebugLogSymlink = memoize_default(() => { - if (process.argv[2] === "--ripgrep") { - return; - } - try { - const debugLogPath = getDebugLogPath(); - const debugLogsDir = dirname(debugLogPath); - const latestSymlinkPath = join22(debugLogsDir, "latest"); - if (!getFsImplementation().existsSync(debugLogsDir)) { - getFsImplementation().mkdirSync(debugLogsDir); - } - if (getFsImplementation().existsSync(latestSymlinkPath)) { - try { - getFsImplementation().unlinkSync(latestSymlinkPath); - } catch { - } - } - getFsImplementation().symlinkSync(debugLogPath, latestSymlinkPath); - } catch { - } -}); -var isLoggingSlowOperation = false; -function withSlowLogging2(operation, fn2) { - const startTime = performance.now(); - try { - return fn2(); - } finally { - const duration5 = performance.now() - startTime; - if (duration5 > SLOW_OPERATION_THRESHOLD_MS && !isLoggingSlowOperation && false) { - } - } -} -var NodeFsOperations = { - cwd() { - return process.cwd(); - }, - existsSync(fsPath) { - return withSlowLogging2(`existsSync(${fsPath})`, () => fs3.existsSync(fsPath)); - }, - async stat(fsPath) { - return statPromise(fsPath); - }, - statSync(fsPath) { - return withSlowLogging2(`statSync(${fsPath})`, () => fs3.statSync(fsPath)); - }, - lstatSync(fsPath) { - return withSlowLogging2(`lstatSync(${fsPath})`, () => fs3.lstatSync(fsPath)); - }, - readFileSync(fsPath, options) { - return withSlowLogging2(`readFileSync(${fsPath})`, () => fs3.readFileSync(fsPath, { encoding: options.encoding })); - }, - readFileBytesSync(fsPath) { - return withSlowLogging2(`readFileBytesSync(${fsPath})`, () => fs3.readFileSync(fsPath)); - }, - readSync(fsPath, options) { - return withSlowLogging2(`readSync(${fsPath}, ${options.length} bytes)`, () => { - let fd = void 0; - try { - fd = fs3.openSync(fsPath, "r"); - const buffer = Buffer.alloc(options.length); - const bytesRead = fs3.readSync(fd, buffer, 0, options.length, 0); - return { buffer, bytesRead }; - } finally { - if (fd) - fs3.closeSync(fd); - } - }); - }, - appendFileSync(path4, data, options) { - return withSlowLogging2(`appendFileSync(${path4}, ${data.length} chars)`, () => { - if (!fs3.existsSync(path4) && options?.mode !== void 0) { - const fd = fs3.openSync(path4, "a", options.mode); - try { - fs3.appendFileSync(fd, data); - } finally { - fs3.closeSync(fd); - } - } else { - fs3.appendFileSync(path4, data); - } - }); - }, - copyFileSync(src, dest) { - return withSlowLogging2(`copyFileSync(${src} \u2192 ${dest})`, () => fs3.copyFileSync(src, dest)); - }, - unlinkSync(path4) { - return withSlowLogging2(`unlinkSync(${path4})`, () => fs3.unlinkSync(path4)); - }, - renameSync(oldPath, newPath) { - return withSlowLogging2(`renameSync(${oldPath} \u2192 ${newPath})`, () => fs3.renameSync(oldPath, newPath)); - }, - linkSync(target, path4) { - return withSlowLogging2(`linkSync(${target} \u2192 ${path4})`, () => fs3.linkSync(target, path4)); - }, - symlinkSync(target, path4) { - return withSlowLogging2(`symlinkSync(${target} \u2192 ${path4})`, () => fs3.symlinkSync(target, path4)); - }, - readlinkSync(path4) { - return withSlowLogging2(`readlinkSync(${path4})`, () => fs3.readlinkSync(path4)); - }, - realpathSync(path4) { - return withSlowLogging2(`realpathSync(${path4})`, () => fs3.realpathSync(path4)); - }, - mkdirSync(dirPath, options) { - return withSlowLogging2(`mkdirSync(${dirPath})`, () => { - if (!fs3.existsSync(dirPath)) { - const mkdirOptions = { - recursive: true - }; - if (options?.mode !== void 0) { - mkdirOptions.mode = options.mode; - } - fs3.mkdirSync(dirPath, mkdirOptions); - } - }); - }, - readdirSync(dirPath) { - return withSlowLogging2(`readdirSync(${dirPath})`, () => fs3.readdirSync(dirPath, { withFileTypes: true })); - }, - readdirStringSync(dirPath) { - return withSlowLogging2(`readdirStringSync(${dirPath})`, () => fs3.readdirSync(dirPath)); - }, - isDirEmptySync(dirPath) { - return withSlowLogging2(`isDirEmptySync(${dirPath})`, () => { - const files = this.readdirSync(dirPath); - return files.length === 0; - }); - }, - rmdirSync(dirPath) { - return withSlowLogging2(`rmdirSync(${dirPath})`, () => fs3.rmdirSync(dirPath)); - }, - rmSync(path4, options) { - return withSlowLogging2(`rmSync(${path4})`, () => fs3.rmSync(path4, options)); - }, - createWriteStream(path4) { - return fs3.createWriteStream(path4); - } -}; -var activeFs = NodeFsOperations; -function getFsImplementation() { - return activeFs; -} -var AbortError2 = class extends Error { -}; -function isRunningWithBun() { - return process.versions.bun !== void 0; -} -var debugFilePath = null; -var initialized = false; -function getOrCreateDebugFile() { - if (initialized) { - return debugFilePath; - } - initialized = true; - if (!process.env.DEBUG_CLAUDE_AGENT_SDK) { - return null; - } - const debugDir = join32(getClaudeConfigHomeDir(), "debug"); - debugFilePath = join32(debugDir, `sdk-${randomUUID22()}.txt`); - if (!existsSync22(debugDir)) { - mkdirSync22(debugDir, { recursive: true }); - } - process.stderr.write(`SDK debug logs: ${debugFilePath} -`); - return debugFilePath; -} -function logForSdkDebugging(message) { - const path4 = getOrCreateDebugFile(); - if (!path4) { - return; - } - const timestamp = (/* @__PURE__ */ new Date()).toISOString(); - const output = `${timestamp} ${message} -`; - appendFileSync2(path4, output); -} -function mergeSandboxIntoExtraArgs(extraArgs, sandbox) { - const effectiveExtraArgs = { ...extraArgs }; - if (sandbox) { - let settingsObj = { sandbox }; - if (effectiveExtraArgs.settings) { - try { - const existingSettings = jsonParse(effectiveExtraArgs.settings); - settingsObj = { ...existingSettings, sandbox }; - } catch { - } - } - effectiveExtraArgs.settings = jsonStringify(settingsObj); - } - return effectiveExtraArgs; -} -var ProcessTransport = class { - options; - process; - processStdin; - processStdout; - ready = false; - abortController; - exitError; - exitListeners = []; - processExitHandler; - abortHandler; - constructor(options) { - this.options = options; - this.abortController = options.abortController || createAbortController(); - this.initialize(); - } - getDefaultExecutable() { - return isRunningWithBun() ? "bun" : "node"; - } - spawnLocalProcess(spawnOptions) { - const { command, args: args3, cwd: cwd2, env: env3, signal } = spawnOptions; - const stderrMode = env3.DEBUG_CLAUDE_AGENT_SDK || this.options.stderr ? "pipe" : "ignore"; - const childProcess = spawn3(command, args3, { - cwd: cwd2, - stdio: ["pipe", "pipe", stderrMode], - signal, - env: env3, - windowsHide: true - }); - if (env3.DEBUG_CLAUDE_AGENT_SDK || this.options.stderr) { - childProcess.stderr.on("data", (data) => { - const message = data.toString(); - logForSdkDebugging(message); - if (this.options.stderr) { - this.options.stderr(message); - } - }); - } - const mappedProcess = { - stdin: childProcess.stdin, - stdout: childProcess.stdout, - get killed() { - return childProcess.killed; - }, - get exitCode() { - return childProcess.exitCode; - }, - kill: childProcess.kill.bind(childProcess), - on: childProcess.on.bind(childProcess), - once: childProcess.once.bind(childProcess), - off: childProcess.off.bind(childProcess) - }; - return mappedProcess; - } - initialize() { - try { - const { - additionalDirectories = [], - betas, - cwd: cwd2, - executable = this.getDefaultExecutable(), - executableArgs = [], - extraArgs = {}, - pathToClaudeCodeExecutable, - env: env3 = { ...process.env }, - maxThinkingTokens, - maxTurns, - maxBudgetUsd, - model, - fallbackModel, - jsonSchema: jsonSchema2, - permissionMode, - allowDangerouslySkipPermissions, - permissionPromptToolName, - continueConversation, - resume, - settingSources, - allowedTools = [], - disallowedTools = [], - tools, - mcpServers, - strictMcpConfig, - canUseTool, - includePartialMessages, - plugins, - sandbox - } = this.options; - const args3 = [ - "--output-format", - "stream-json", - "--verbose", - "--input-format", - "stream-json" - ]; - if (maxThinkingTokens !== void 0) { - args3.push("--max-thinking-tokens", maxThinkingTokens.toString()); - } - if (maxTurns) - args3.push("--max-turns", maxTurns.toString()); - if (maxBudgetUsd !== void 0) { - args3.push("--max-budget-usd", maxBudgetUsd.toString()); - } - if (model) - args3.push("--model", model); - if (betas && betas.length > 0) { - args3.push("--betas", betas.join(",")); - } - if (jsonSchema2) { - args3.push("--json-schema", jsonStringify(jsonSchema2)); - } - if (env3.DEBUG_CLAUDE_AGENT_SDK) { - args3.push("--debug-to-stderr"); - } - if (canUseTool) { - if (permissionPromptToolName) { - throw new Error("canUseTool callback cannot be used with permissionPromptToolName. Please use one or the other."); - } - args3.push("--permission-prompt-tool", "stdio"); - } else if (permissionPromptToolName) { - args3.push("--permission-prompt-tool", permissionPromptToolName); - } - if (continueConversation) - args3.push("--continue"); - if (resume) - args3.push("--resume", resume); - if (allowedTools.length > 0) { - args3.push("--allowedTools", allowedTools.join(",")); - } - if (disallowedTools.length > 0) { - args3.push("--disallowedTools", disallowedTools.join(",")); - } - if (tools !== void 0) { - if (Array.isArray(tools)) { - if (tools.length === 0) { - args3.push("--tools", ""); - } else { - args3.push("--tools", tools.join(",")); - } - } else { - args3.push("--tools", "default"); - } - } - if (mcpServers && Object.keys(mcpServers).length > 0) { - args3.push("--mcp-config", jsonStringify({ mcpServers })); - } - if (settingSources) { - args3.push("--setting-sources", settingSources.join(",")); - } - if (strictMcpConfig) { - args3.push("--strict-mcp-config"); - } - if (permissionMode) { - args3.push("--permission-mode", permissionMode); - } - if (allowDangerouslySkipPermissions) { - args3.push("--allow-dangerously-skip-permissions"); - } - if (fallbackModel) { - if (model && fallbackModel === model) { - throw new Error("Fallback model cannot be the same as the main model. Please specify a different model for fallbackModel option."); - } - args3.push("--fallback-model", fallbackModel); - } - if (includePartialMessages) { - args3.push("--include-partial-messages"); - } - for (const dir of additionalDirectories) { - args3.push("--add-dir", dir); - } - if (plugins && plugins.length > 0) { - for (const plugin of plugins) { - if (plugin.type === "local") { - args3.push("--plugin-dir", plugin.path); - } else { - throw new Error(`Unsupported plugin type: ${plugin.type}`); - } - } - } - if (this.options.forkSession) { - args3.push("--fork-session"); - } - if (this.options.resumeSessionAt) { - args3.push("--resume-session-at", this.options.resumeSessionAt); - } - if (this.options.persistSession === false) { - args3.push("--no-session-persistence"); - } - const effectiveExtraArgs = mergeSandboxIntoExtraArgs(extraArgs ?? {}, sandbox); - for (const [flag, value2] of Object.entries(effectiveExtraArgs)) { - if (value2 === null) { - args3.push(`--${flag}`); - } else { - args3.push(`--${flag}`, value2); - } - } - if (!env3.CLAUDE_CODE_ENTRYPOINT) { - env3.CLAUDE_CODE_ENTRYPOINT = "sdk-ts"; - } - delete env3.NODE_OPTIONS; - if (env3.DEBUG_CLAUDE_AGENT_SDK) { - env3.DEBUG = "1"; - } else { - delete env3.DEBUG; - } - const isNative = isNativeBinary(pathToClaudeCodeExecutable); - const spawnCommand = isNative ? pathToClaudeCodeExecutable : executable; - const spawnArgs = isNative ? [...executableArgs, ...args3] : [...executableArgs, pathToClaudeCodeExecutable, ...args3]; - const spawnOptions = { - command: spawnCommand, - args: spawnArgs, - cwd: cwd2, - env: env3, - signal: this.abortController.signal - }; - if (this.options.spawnClaudeCodeProcess) { - logForSdkDebugging(`Spawning Claude Code (custom): ${spawnCommand} ${spawnArgs.join(" ")}`); - this.process = this.options.spawnClaudeCodeProcess(spawnOptions); - } else { - const fs22 = getFsImplementation(); - if (!fs22.existsSync(pathToClaudeCodeExecutable)) { - const errorMessage = isNative ? `Claude Code native binary not found at ${pathToClaudeCodeExecutable}. Please ensure Claude Code is installed via native installer or specify a valid path with options.pathToClaudeCodeExecutable.` : `Claude Code executable not found at ${pathToClaudeCodeExecutable}. Is options.pathToClaudeCodeExecutable set?`; - throw new ReferenceError(errorMessage); - } - logForSdkDebugging(`Spawning Claude Code: ${spawnCommand} ${spawnArgs.join(" ")}`); - this.process = this.spawnLocalProcess(spawnOptions); - } - this.processStdin = this.process.stdin; - this.processStdout = this.process.stdout; - const cleanup = () => { - if (this.process && !this.process.killed) { - this.process.kill("SIGTERM"); - } - }; - this.processExitHandler = cleanup; - this.abortHandler = cleanup; - process.on("exit", this.processExitHandler); - this.abortController.signal.addEventListener("abort", this.abortHandler); - this.process.on("error", (error50) => { - this.ready = false; - if (this.abortController.signal.aborted) { - this.exitError = new AbortError2("Claude Code process aborted by user"); - } else { - this.exitError = new Error(`Failed to spawn Claude Code process: ${error50.message}`); - logForSdkDebugging(this.exitError.message); - } - }); - this.process.on("exit", (code, signal) => { - this.ready = false; - if (this.abortController.signal.aborted) { - this.exitError = new AbortError2("Claude Code process aborted by user"); - } else { - const error50 = this.getProcessExitError(code, signal); - if (error50) { - this.exitError = error50; - logForSdkDebugging(error50.message); - } - } - }); - this.ready = true; - } catch (error50) { - this.ready = false; - throw error50; - } - } - getProcessExitError(code, signal) { - if (code !== 0 && code !== null) { - return new Error(`Claude Code process exited with code ${code}`); - } else if (signal) { - return new Error(`Claude Code process terminated by signal ${signal}`); - } - return; - } - write(data) { - if (this.abortController.signal.aborted) { - throw new AbortError2("Operation aborted"); - } - if (!this.ready || !this.processStdin) { - throw new Error("ProcessTransport is not ready for writing"); - } - if (this.process?.killed || this.process?.exitCode !== null) { - throw new Error("Cannot write to terminated process"); - } - if (this.exitError) { - throw new Error(`Cannot write to process that exited with error: ${this.exitError.message}`); - } - logForSdkDebugging(`[ProcessTransport] Writing to stdin: ${data.substring(0, 100)}`); - try { - const written = this.processStdin.write(data); - if (!written) { - logForSdkDebugging("[ProcessTransport] Write buffer full, data queued"); - } - } catch (error50) { - this.ready = false; - throw new Error(`Failed to write to process stdin: ${error50.message}`); - } - } - close() { - if (this.processStdin) { - this.processStdin.end(); - this.processStdin = void 0; - } - if (this.abortHandler) { - this.abortController.signal.removeEventListener("abort", this.abortHandler); - this.abortHandler = void 0; - } - for (const { handler: handler2 } of this.exitListeners) { - this.process?.off("exit", handler2); - } - this.exitListeners = []; - if (this.process && !this.process.killed) { - this.process.kill("SIGTERM"); - setTimeout(() => { - if (this.process && !this.process.killed) { - this.process.kill("SIGKILL"); - } - }, 5e3); - } - this.ready = false; - if (this.processExitHandler) { - process.off("exit", this.processExitHandler); - this.processExitHandler = void 0; - } - } - isReady() { - return this.ready; - } - async *readMessages() { - if (!this.processStdout) { - throw new Error("ProcessTransport output stream not available"); - } - const rl = createInterface({ input: this.processStdout }); - try { - for await (const line of rl) { - if (line.trim()) { - const message = jsonParse(line); - yield message; - } - } - await this.waitForExit(); - } catch (error50) { - throw error50; - } finally { - rl.close(); - } - } - endInput() { - if (this.processStdin) { - this.processStdin.end(); - } - } - getInputStream() { - return this.processStdin; - } - onExit(callback) { - if (!this.process) - return () => { - }; - const handler2 = (code, signal) => { - const error50 = this.getProcessExitError(code, signal); - callback(error50); - }; - this.process.on("exit", handler2); - this.exitListeners.push({ callback, handler: handler2 }); - return () => { - if (this.process) { - this.process.off("exit", handler2); - } - const index = this.exitListeners.findIndex((l) => l.handler === handler2); - if (index !== -1) { - this.exitListeners.splice(index, 1); - } - }; - } - async waitForExit() { - if (!this.process) { - if (this.exitError) { - throw this.exitError; - } - return; - } - if (this.process.exitCode !== null || this.process.killed) { - if (this.exitError) { - throw this.exitError; - } - return; - } - return new Promise((resolve2, reject) => { - const exitHandler = (code, signal) => { - if (this.abortController.signal.aborted) { - reject(new AbortError2("Operation aborted")); - return; - } - const error50 = this.getProcessExitError(code, signal); - if (error50) { - reject(error50); - } else { - resolve2(); - } - }; - this.process.once("exit", exitHandler); - const errorHandler = (error50) => { - this.process.off("exit", exitHandler); - reject(error50); - }; - this.process.once("error", errorHandler); - this.process.once("exit", () => { - this.process.off("error", errorHandler); - }); - }); - } -}; -function isNativeBinary(executablePath) { - const jsExtensions = [".js", ".mjs", ".tsx", ".ts", ".jsx"]; - return !jsExtensions.some((ext) => executablePath.endsWith(ext)); -} -var Stream = class { - returned; - queue = []; - readResolve; - readReject; - isDone = false; - hasError; - started = false; - constructor(returned) { - this.returned = returned; - } - [Symbol.asyncIterator]() { - if (this.started) { - throw new Error("Stream can only be iterated once"); - } - this.started = true; - return this; - } - next() { - if (this.queue.length > 0) { - return Promise.resolve({ - done: false, - value: this.queue.shift() - }); - } - if (this.isDone) { - return Promise.resolve({ done: true, value: void 0 }); - } - if (this.hasError) { - return Promise.reject(this.hasError); - } - return new Promise((resolve2, reject) => { - this.readResolve = resolve2; - this.readReject = reject; - }); - } - enqueue(value2) { - if (this.readResolve) { - const resolve2 = this.readResolve; - this.readResolve = void 0; - this.readReject = void 0; - resolve2({ done: false, value: value2 }); - } else { - this.queue.push(value2); - } - } - done() { - this.isDone = true; - if (this.readResolve) { - const resolve2 = this.readResolve; - this.readResolve = void 0; - this.readReject = void 0; - resolve2({ done: true, value: void 0 }); - } - } - error(error50) { - this.hasError = error50; - if (this.readReject) { - const reject = this.readReject; - this.readResolve = void 0; - this.readReject = void 0; - reject(error50); - } - } - return() { - this.isDone = true; - if (this.returned) { - this.returned(); - } - return Promise.resolve({ done: true, value: void 0 }); - } -}; -var SdkControlServerTransport = class { - sendMcpMessage; - isClosed = false; - constructor(sendMcpMessage) { - this.sendMcpMessage = sendMcpMessage; - } - onclose; - onerror; - onmessage; - async start() { - } - async send(message) { - if (this.isClosed) { - throw new Error("Transport is closed"); - } - this.sendMcpMessage(message); - } - async close() { - if (this.isClosed) { - return; - } - this.isClosed = true; - this.onclose?.(); - } -}; -var Query = class { - transport; - isSingleUserTurn; - canUseTool; - hooks; - abortController; - jsonSchema; - initConfig; - pendingControlResponses = /* @__PURE__ */ new Map(); - cleanupPerformed = false; - sdkMessages; - inputStream = new Stream(); - initialization; - cancelControllers = /* @__PURE__ */ new Map(); - hookCallbacks = /* @__PURE__ */ new Map(); - nextCallbackId = 0; - sdkMcpTransports = /* @__PURE__ */ new Map(); - sdkMcpServerInstances = /* @__PURE__ */ new Map(); - pendingMcpResponses = /* @__PURE__ */ new Map(); - firstResultReceivedResolve; - firstResultReceived = false; - hasBidirectionalNeeds() { - return this.sdkMcpTransports.size > 0 || this.hooks !== void 0 && Object.keys(this.hooks).length > 0 || this.canUseTool !== void 0; - } - constructor(transport, isSingleUserTurn, canUseTool, hooks, abortController, sdkMcpServers = /* @__PURE__ */ new Map(), jsonSchema2, initConfig) { - this.transport = transport; - this.isSingleUserTurn = isSingleUserTurn; - this.canUseTool = canUseTool; - this.hooks = hooks; - this.abortController = abortController; - this.jsonSchema = jsonSchema2; - this.initConfig = initConfig; - for (const [name, server] of sdkMcpServers) { - this.connectSdkMcpServer(name, server); - } - this.sdkMessages = this.readSdkMessages(); - this.readMessages(); - this.initialization = this.initialize(); - this.initialization.catch(() => { - }); - } - setError(error50) { - this.inputStream.error(error50); - } - cleanup(error50) { - if (this.cleanupPerformed) - return; - this.cleanupPerformed = true; - try { - this.transport.close(); - this.pendingControlResponses.clear(); - this.pendingMcpResponses.clear(); - this.cancelControllers.clear(); - this.hookCallbacks.clear(); - for (const transport of this.sdkMcpTransports.values()) { - try { - transport.close(); - } catch { - } - } - this.sdkMcpTransports.clear(); - if (error50) { - this.inputStream.error(error50); - } else { - this.inputStream.done(); - } - } catch (_error) { - } - } - next(...[value2]) { - return this.sdkMessages.next(...[value2]); - } - return(value2) { - return this.sdkMessages.return(value2); - } - throw(e) { - return this.sdkMessages.throw(e); - } - [Symbol.asyncIterator]() { - return this.sdkMessages; - } - [Symbol.asyncDispose]() { - return this.sdkMessages[Symbol.asyncDispose](); - } - async readMessages() { - try { - for await (const message of this.transport.readMessages()) { - if (message.type === "control_response") { - const handler2 = this.pendingControlResponses.get(message.response.request_id); - if (handler2) { - handler2(message.response); - } - continue; - } else if (message.type === "control_request") { - this.handleControlRequest(message); - continue; - } else if (message.type === "control_cancel_request") { - this.handleControlCancelRequest(message); - continue; - } else if (message.type === "keep_alive") { - continue; - } - if (message.type === "result") { - this.firstResultReceived = true; - if (this.firstResultReceivedResolve) { - this.firstResultReceivedResolve(); - } - if (this.isSingleUserTurn) { - logForDebugging2(`[Query.readMessages] First result received for single-turn query, closing stdin`); - this.transport.endInput(); - } - } - this.inputStream.enqueue(message); - } - if (this.firstResultReceivedResolve) { - this.firstResultReceivedResolve(); - } - this.inputStream.done(); - this.cleanup(); - } catch (error50) { - if (this.firstResultReceivedResolve) { - this.firstResultReceivedResolve(); - } - this.inputStream.error(error50); - this.cleanup(error50); - } - } - async handleControlRequest(request2) { - const controller = new AbortController(); - this.cancelControllers.set(request2.request_id, controller); - try { - const response = await this.processControlRequest(request2, controller.signal); - const controlResponse = { - type: "control_response", - response: { - subtype: "success", - request_id: request2.request_id, - response - } - }; - await Promise.resolve(this.transport.write(jsonStringify(controlResponse) + ` -`)); - } catch (error50) { - const controlErrorResponse = { - type: "control_response", - response: { - subtype: "error", - request_id: request2.request_id, - error: error50.message || String(error50) - } - }; - await Promise.resolve(this.transport.write(jsonStringify(controlErrorResponse) + ` -`)); - } finally { - this.cancelControllers.delete(request2.request_id); - } - } - handleControlCancelRequest(request2) { - const controller = this.cancelControllers.get(request2.request_id); - if (controller) { - controller.abort(); - this.cancelControllers.delete(request2.request_id); - } - } - async processControlRequest(request2, signal) { - if (request2.request.subtype === "can_use_tool") { - if (!this.canUseTool) { - throw new Error("canUseTool callback is not provided."); - } - const result = await this.canUseTool(request2.request.tool_name, request2.request.input, { - signal, - suggestions: request2.request.permission_suggestions, - blockedPath: request2.request.blocked_path, - decisionReason: request2.request.decision_reason, - toolUseID: request2.request.tool_use_id, - agentID: request2.request.agent_id - }); - return { - ...result, - toolUseID: request2.request.tool_use_id - }; - } else if (request2.request.subtype === "hook_callback") { - const result = await this.handleHookCallbacks(request2.request.callback_id, request2.request.input, request2.request.tool_use_id, signal); - return result; - } else if (request2.request.subtype === "mcp_message") { - const mcpRequest = request2.request; - const transport = this.sdkMcpTransports.get(mcpRequest.server_name); - if (!transport) { - throw new Error(`SDK MCP server not found: ${mcpRequest.server_name}`); - } - if ("method" in mcpRequest.message && "id" in mcpRequest.message && mcpRequest.message.id !== null) { - const response = await this.handleMcpControlRequest(mcpRequest.server_name, mcpRequest, transport); - return { mcp_response: response }; - } else { - if (transport.onmessage) { - transport.onmessage(mcpRequest.message); - } - return { mcp_response: { jsonrpc: "2.0", result: {}, id: 0 } }; - } - } - throw new Error("Unsupported control request subtype: " + request2.request.subtype); - } - async *readSdkMessages() { - for await (const message of this.inputStream) { - yield message; - } - } - async initialize() { - let hooks; - if (this.hooks) { - hooks = {}; - for (const [event, matchers] of Object.entries(this.hooks)) { - if (matchers.length > 0) { - hooks[event] = matchers.map((matcher) => { - const callbackIds = []; - for (const callback of matcher.hooks) { - const callbackId = `hook_${this.nextCallbackId++}`; - this.hookCallbacks.set(callbackId, callback); - callbackIds.push(callbackId); - } - return { - matcher: matcher.matcher, - hookCallbackIds: callbackIds, - timeout: matcher.timeout - }; - }); - } - } - } - const sdkMcpServers = this.sdkMcpTransports.size > 0 ? Array.from(this.sdkMcpTransports.keys()) : void 0; - const initRequest = { - subtype: "initialize", - hooks, - sdkMcpServers, - jsonSchema: this.jsonSchema, - systemPrompt: this.initConfig?.systemPrompt, - appendSystemPrompt: this.initConfig?.appendSystemPrompt, - agents: this.initConfig?.agents - }; - const response = await this.request(initRequest); - return response.response; - } - async interrupt() { - await this.request({ - subtype: "interrupt" - }); - } - async setPermissionMode(mode) { - await this.request({ - subtype: "set_permission_mode", - mode - }); - } - async setModel(model) { - await this.request({ - subtype: "set_model", - model - }); - } - async setMaxThinkingTokens(maxThinkingTokens) { - await this.request({ - subtype: "set_max_thinking_tokens", - max_thinking_tokens: maxThinkingTokens - }); - } - async rewindFiles(userMessageId, options) { - const response = await this.request({ - subtype: "rewind_files", - user_message_id: userMessageId, - dry_run: options?.dryRun - }); - return response.response; - } - async processPendingPermissionRequests(pendingPermissionRequests) { - for (const request2 of pendingPermissionRequests) { - if (request2.request.subtype === "can_use_tool") { - this.handleControlRequest(request2).catch(() => { - }); - } - } - } - request(request2) { - const requestId = Math.random().toString(36).substring(2, 15); - const sdkRequest = { - request_id: requestId, - type: "control_request", - request: request2 - }; - return new Promise((resolve2, reject) => { - this.pendingControlResponses.set(requestId, (response) => { - if (response.subtype === "success") { - resolve2(response); - } else { - reject(new Error(response.error)); - if (response.pending_permission_requests) { - this.processPendingPermissionRequests(response.pending_permission_requests); - } - } - }); - Promise.resolve(this.transport.write(jsonStringify(sdkRequest) + ` -`)); - }); - } - async supportedCommands() { - return (await this.initialization).commands; - } - async supportedModels() { - return (await this.initialization).models; - } - async mcpServerStatus() { - const response = await this.request({ - subtype: "mcp_status" - }); - const mcpStatusResponse = response.response; - return mcpStatusResponse.mcpServers; - } - async setMcpServers(servers) { - const sdkServers = {}; - const processServers = {}; - for (const [name, config4] of Object.entries(servers)) { - if (config4.type === "sdk" && "instance" in config4) { - sdkServers[name] = config4.instance; - } else { - processServers[name] = config4; - } - } - const currentSdkNames = new Set(this.sdkMcpServerInstances.keys()); - const newSdkNames = new Set(Object.keys(sdkServers)); - for (const name of currentSdkNames) { - if (!newSdkNames.has(name)) { - await this.disconnectSdkMcpServer(name); - } - } - for (const [name, server] of Object.entries(sdkServers)) { - if (!currentSdkNames.has(name)) { - this.connectSdkMcpServer(name, server); - } - } - const sdkServerConfigs = {}; - for (const name of Object.keys(sdkServers)) { - sdkServerConfigs[name] = { type: "sdk", name }; - } - const response = await this.request({ - subtype: "mcp_set_servers", - servers: { ...processServers, ...sdkServerConfigs } - }); - return response.response; - } - async accountInfo() { - return (await this.initialization).account; - } - async streamInput(stream) { - logForDebugging2(`[Query.streamInput] Starting to process input stream`); - try { - let messageCount = 0; - for await (const message of stream) { - messageCount++; - logForDebugging2(`[Query.streamInput] Processing message ${messageCount}: ${message.type}`); - if (this.abortController?.signal.aborted) - break; - await Promise.resolve(this.transport.write(jsonStringify(message) + ` -`)); - } - logForDebugging2(`[Query.streamInput] Finished processing ${messageCount} messages from input stream`); - if (messageCount > 0 && this.hasBidirectionalNeeds()) { - logForDebugging2(`[Query.streamInput] Has bidirectional needs, waiting for first result`); - await this.waitForFirstResult(); - } - logForDebugging2(`[Query] Calling transport.endInput() to close stdin to CLI process`); - this.transport.endInput(); - } catch (error50) { - if (!(error50 instanceof AbortError2)) { - throw error50; - } - } - } - waitForFirstResult() { - if (this.firstResultReceived) { - logForDebugging2(`[Query.waitForFirstResult] Result already received, returning immediately`); - return Promise.resolve(); - } - return new Promise((resolve2) => { - if (this.abortController?.signal.aborted) { - resolve2(); - return; - } - this.abortController?.signal.addEventListener("abort", () => resolve2(), { - once: true - }); - this.firstResultReceivedResolve = resolve2; - }); - } - handleHookCallbacks(callbackId, input, toolUseID, abortSignal) { - const callback = this.hookCallbacks.get(callbackId); - if (!callback) { - throw new Error(`No hook callback found for ID: ${callbackId}`); - } - return callback(input, toolUseID, { - signal: abortSignal - }); - } - connectSdkMcpServer(name, server) { - const sdkTransport = new SdkControlServerTransport((message) => this.sendMcpServerMessageToCli(name, message)); - this.sdkMcpTransports.set(name, sdkTransport); - this.sdkMcpServerInstances.set(name, server); - server.connect(sdkTransport); - } - async disconnectSdkMcpServer(name) { - const transport = this.sdkMcpTransports.get(name); - if (transport) { - await transport.close(); - this.sdkMcpTransports.delete(name); - } - this.sdkMcpServerInstances.delete(name); - } - sendMcpServerMessageToCli(serverName, message) { - if ("id" in message && message.id !== null && message.id !== void 0) { - const key = `${serverName}:${message.id}`; - const pending = this.pendingMcpResponses.get(key); - if (pending) { - pending.resolve(message); - this.pendingMcpResponses.delete(key); - return; - } - } - const controlRequest = { - type: "control_request", - request_id: randomUUID32(), - request: { - subtype: "mcp_message", - server_name: serverName, - message - } - }; - this.transport.write(jsonStringify(controlRequest) + ` -`); - } - handleMcpControlRequest(serverName, mcpRequest, transport) { - const messageId = "id" in mcpRequest.message ? mcpRequest.message.id : null; - const key = `${serverName}:${messageId}`; - return new Promise((resolve2, reject) => { - const cleanup = () => { - this.pendingMcpResponses.delete(key); - }; - const resolveAndCleanup = (response) => { - cleanup(); - resolve2(response); - }; - const rejectAndCleanup = (error50) => { - cleanup(); - reject(error50); - }; - this.pendingMcpResponses.set(key, { - resolve: resolveAndCleanup, - reject: rejectAndCleanup - }); - if (transport.onmessage) { - transport.onmessage(mcpRequest.message); - } else { - cleanup(); - reject(new Error("No message handler registered")); - return; - } - }); - } -}; -var util2; -(function(util22) { - util22.assertEqual = (_) => { - }; - function assertIs3(_arg) { - } - util22.assertIs = assertIs3; - function assertNever3(_x) { - throw new Error(); - } - util22.assertNever = assertNever3; - util22.arrayToEnum = (items) => { - const obj = {}; - for (const item of items) { - obj[item] = item; - } - return obj; - }; - util22.getValidEnumValues = (obj) => { - const validKeys = util22.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number"); - const filtered = {}; - for (const k of validKeys) { - filtered[k] = obj[k]; - } - return util22.objectValues(filtered); - }; - util22.objectValues = (obj) => { - return util22.objectKeys(obj).map(function(e) { - return obj[e]; - }); - }; - util22.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object5) => { - const keys = []; - for (const key in object5) { - if (Object.prototype.hasOwnProperty.call(object5, key)) { - keys.push(key); - } - } - return keys; - }; - util22.find = (arr, checker) => { - for (const item of arr) { - if (checker(item)) - return item; - } - return; - }; - util22.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val; - function joinValues3(array4, separator2 = " | ") { - return array4.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator2); - } - util22.joinValues = joinValues3; - util22.jsonStringifyReplacer = (_, value2) => { - if (typeof value2 === "bigint") { - return value2.toString(); - } - return value2; - }; -})(util2 || (util2 = {})); -var objectUtil2; -(function(objectUtil22) { - objectUtil22.mergeShapes = (first, second) => { - return { - ...first, - ...second - }; - }; -})(objectUtil2 || (objectUtil2 = {})); -var ZodParsedType2 = util2.arrayToEnum([ - "string", - "nan", - "number", - "integer", - "float", - "boolean", - "date", - "bigint", - "symbol", - "function", - "undefined", - "null", - "array", - "object", - "unknown", - "promise", - "void", - "never", - "map", - "set" -]); -var getParsedType3 = (data) => { - const t = typeof data; - switch (t) { - case "undefined": - return ZodParsedType2.undefined; - case "string": - return ZodParsedType2.string; - case "number": - return Number.isNaN(data) ? ZodParsedType2.nan : ZodParsedType2.number; - case "boolean": - return ZodParsedType2.boolean; - case "function": - return ZodParsedType2.function; - case "bigint": - return ZodParsedType2.bigint; - case "symbol": - return ZodParsedType2.symbol; - case "object": - if (Array.isArray(data)) { - return ZodParsedType2.array; - } - if (data === null) { - return ZodParsedType2.null; - } - if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") { - return ZodParsedType2.promise; - } - if (typeof Map !== "undefined" && data instanceof Map) { - return ZodParsedType2.map; - } - if (typeof Set !== "undefined" && data instanceof Set) { - return ZodParsedType2.set; - } - if (typeof Date !== "undefined" && data instanceof Date) { - return ZodParsedType2.date; - } - return ZodParsedType2.object; - default: - return ZodParsedType2.unknown; - } -}; -var ZodIssueCode4 = util2.arrayToEnum([ - "invalid_type", - "invalid_literal", - "custom", - "invalid_union", - "invalid_union_discriminator", - "invalid_enum_value", - "unrecognized_keys", - "invalid_arguments", - "invalid_return_type", - "invalid_date", - "invalid_string", - "too_small", - "too_big", - "invalid_intersection_types", - "not_multiple_of", - "not_finite" -]); -var ZodError4 = class _ZodError extends Error { - get errors() { - return this.issues; - } - constructor(issues) { - super(); - this.issues = []; - this.addIssue = (sub) => { - this.issues = [...this.issues, sub]; - }; - this.addIssues = (subs = []) => { - this.issues = [...this.issues, ...subs]; - }; - const actualProto = new.target.prototype; - if (Object.setPrototypeOf) { - Object.setPrototypeOf(this, actualProto); - } else { - this.__proto__ = actualProto; - } - this.name = "ZodError"; - this.issues = issues; - } - format(_mapper) { - const mapper = _mapper || function(issue4) { - return issue4.message; - }; - const fieldErrors = { _errors: [] }; - const processError = (error50) => { - for (const issue4 of error50.issues) { - if (issue4.code === "invalid_union") { - issue4.unionErrors.map(processError); - } else if (issue4.code === "invalid_return_type") { - processError(issue4.returnTypeError); - } else if (issue4.code === "invalid_arguments") { - processError(issue4.argumentsError); - } else if (issue4.path.length === 0) { - fieldErrors._errors.push(mapper(issue4)); - } else { - let curr = fieldErrors; - let i = 0; - while (i < issue4.path.length) { - const el = issue4.path[i]; - const terminal = i === issue4.path.length - 1; - if (!terminal) { - curr[el] = curr[el] || { _errors: [] }; - } else { - curr[el] = curr[el] || { _errors: [] }; - curr[el]._errors.push(mapper(issue4)); - } - curr = curr[el]; - i++; - } - } - } - }; - processError(this); - return fieldErrors; - } - static assert(value2) { - if (!(value2 instanceof _ZodError)) { - throw new Error(`Not a ZodError: ${value2}`); - } - } - toString() { - return this.message; - } - get message() { - return JSON.stringify(this.issues, util2.jsonStringifyReplacer, 2); - } - get isEmpty() { - return this.issues.length === 0; - } - flatten(mapper = (issue4) => issue4.message) { - const fieldErrors = {}; - const formErrors = []; - for (const sub of this.issues) { - if (sub.path.length > 0) { - const firstEl = sub.path[0]; - fieldErrors[firstEl] = fieldErrors[firstEl] || []; - fieldErrors[firstEl].push(mapper(sub)); - } else { - formErrors.push(mapper(sub)); - } - } - return { formErrors, fieldErrors }; - } - get formErrors() { - return this.flatten(); - } -}; -ZodError4.create = (issues) => { - const error50 = new ZodError4(issues); - return error50; -}; -var errorMap2 = (issue4, _ctx) => { - let message; - switch (issue4.code) { - case ZodIssueCode4.invalid_type: - if (issue4.received === ZodParsedType2.undefined) { - message = "Required"; - } else { - message = `Expected ${issue4.expected}, received ${issue4.received}`; - } - break; - case ZodIssueCode4.invalid_literal: - message = `Invalid literal value, expected ${JSON.stringify(issue4.expected, util2.jsonStringifyReplacer)}`; - break; - case ZodIssueCode4.unrecognized_keys: - message = `Unrecognized key(s) in object: ${util2.joinValues(issue4.keys, ", ")}`; - break; - case ZodIssueCode4.invalid_union: - message = `Invalid input`; - break; - case ZodIssueCode4.invalid_union_discriminator: - message = `Invalid discriminator value. Expected ${util2.joinValues(issue4.options)}`; - break; - case ZodIssueCode4.invalid_enum_value: - message = `Invalid enum value. Expected ${util2.joinValues(issue4.options)}, received '${issue4.received}'`; - break; - case ZodIssueCode4.invalid_arguments: - message = `Invalid function arguments`; - break; - case ZodIssueCode4.invalid_return_type: - message = `Invalid function return type`; - break; - case ZodIssueCode4.invalid_date: - message = `Invalid date`; - break; - case ZodIssueCode4.invalid_string: - if (typeof issue4.validation === "object") { - if ("includes" in issue4.validation) { - message = `Invalid input: must include "${issue4.validation.includes}"`; - if (typeof issue4.validation.position === "number") { - message = `${message} at one or more positions greater than or equal to ${issue4.validation.position}`; - } - } else if ("startsWith" in issue4.validation) { - message = `Invalid input: must start with "${issue4.validation.startsWith}"`; - } else if ("endsWith" in issue4.validation) { - message = `Invalid input: must end with "${issue4.validation.endsWith}"`; - } else { - util2.assertNever(issue4.validation); - } - } else if (issue4.validation !== "regex") { - message = `Invalid ${issue4.validation}`; - } else { - message = "Invalid"; - } - break; - case ZodIssueCode4.too_small: - if (issue4.type === "array") - message = `Array must contain ${issue4.exact ? "exactly" : issue4.inclusive ? `at least` : `more than`} ${issue4.minimum} element(s)`; - else if (issue4.type === "string") - message = `String must contain ${issue4.exact ? "exactly" : issue4.inclusive ? `at least` : `over`} ${issue4.minimum} character(s)`; - else if (issue4.type === "number") - message = `Number must be ${issue4.exact ? `exactly equal to ` : issue4.inclusive ? `greater than or equal to ` : `greater than `}${issue4.minimum}`; - else if (issue4.type === "bigint") - message = `Number must be ${issue4.exact ? `exactly equal to ` : issue4.inclusive ? `greater than or equal to ` : `greater than `}${issue4.minimum}`; - else if (issue4.type === "date") - message = `Date must be ${issue4.exact ? `exactly equal to ` : issue4.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue4.minimum))}`; - else - message = "Invalid input"; - break; - case ZodIssueCode4.too_big: - if (issue4.type === "array") - message = `Array must contain ${issue4.exact ? `exactly` : issue4.inclusive ? `at most` : `less than`} ${issue4.maximum} element(s)`; - else if (issue4.type === "string") - message = `String must contain ${issue4.exact ? `exactly` : issue4.inclusive ? `at most` : `under`} ${issue4.maximum} character(s)`; - else if (issue4.type === "number") - message = `Number must be ${issue4.exact ? `exactly` : issue4.inclusive ? `less than or equal to` : `less than`} ${issue4.maximum}`; - else if (issue4.type === "bigint") - message = `BigInt must be ${issue4.exact ? `exactly` : issue4.inclusive ? `less than or equal to` : `less than`} ${issue4.maximum}`; - else if (issue4.type === "date") - message = `Date must be ${issue4.exact ? `exactly` : issue4.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue4.maximum))}`; - else - message = "Invalid input"; - break; - case ZodIssueCode4.custom: - message = `Invalid input`; - break; - case ZodIssueCode4.invalid_intersection_types: - message = `Intersection results could not be merged`; - break; - case ZodIssueCode4.not_multiple_of: - message = `Number must be a multiple of ${issue4.multipleOf}`; - break; - case ZodIssueCode4.not_finite: - message = "Number must be finite"; - break; - default: - message = _ctx.defaultError; - util2.assertNever(issue4); - } - return { message }; -}; -var en_default3 = errorMap2; -var overrideErrorMap2 = en_default3; -function getErrorMap3() { - return overrideErrorMap2; -} -var makeIssue2 = (params) => { - const { data, path: path4, errorMaps, issueData } = params; - const fullPath = [...path4, ...issueData.path || []]; - const fullIssue = { - ...issueData, - path: fullPath - }; - if (issueData.message !== void 0) { - return { - ...issueData, - path: fullPath, - message: issueData.message - }; - } - let errorMessage = ""; - const maps = errorMaps.filter((m) => !!m).slice().reverse(); - for (const map2 of maps) { - errorMessage = map2(fullIssue, { data, defaultError: errorMessage }).message; - } - return { - ...issueData, - path: fullPath, - message: errorMessage - }; -}; -function addIssueToContext2(ctx, issueData) { - const overrideMap = getErrorMap3(); - const issue4 = makeIssue2({ - issueData, - data: ctx.data, - path: ctx.path, - errorMaps: [ - ctx.common.contextualErrorMap, - ctx.schemaErrorMap, - overrideMap, - overrideMap === en_default3 ? void 0 : en_default3 - ].filter((x) => !!x) - }); - ctx.common.issues.push(issue4); -} -var ParseStatus2 = class _ParseStatus { - constructor() { - this.value = "valid"; - } - dirty() { - if (this.value === "valid") - this.value = "dirty"; - } - abort() { - if (this.value !== "aborted") - this.value = "aborted"; - } - static mergeArray(status, results) { - const arrayValue = []; - for (const s of results) { - if (s.status === "aborted") - return INVALID2; - if (s.status === "dirty") - status.dirty(); - arrayValue.push(s.value); - } - return { status: status.value, value: arrayValue }; - } - static async mergeObjectAsync(status, pairs) { - const syncPairs = []; - for (const pair of pairs) { - const key = await pair.key; - const value2 = await pair.value; - syncPairs.push({ - key, - value: value2 - }); - } - return _ParseStatus.mergeObjectSync(status, syncPairs); - } - static mergeObjectSync(status, pairs) { - const finalObject = {}; - for (const pair of pairs) { - const { key, value: value2 } = pair; - if (key.status === "aborted") - return INVALID2; - if (value2.status === "aborted") - return INVALID2; - if (key.status === "dirty") - status.dirty(); - if (value2.status === "dirty") - status.dirty(); - if (key.value !== "__proto__" && (typeof value2.value !== "undefined" || pair.alwaysSet)) { - finalObject[key.value] = value2.value; - } - } - return { status: status.value, value: finalObject }; - } -}; -var INVALID2 = Object.freeze({ - status: "aborted" -}); -var DIRTY2 = (value2) => ({ status: "dirty", value: value2 }); -var OK2 = (value2) => ({ status: "valid", value: value2 }); -var isAborted2 = (x) => x.status === "aborted"; -var isDirty2 = (x) => x.status === "dirty"; -var isValid2 = (x) => x.status === "valid"; -var isAsync2 = (x) => typeof Promise !== "undefined" && x instanceof Promise; -var errorUtil2; -(function(errorUtil22) { - errorUtil22.errToObj = (message) => typeof message === "string" ? { message } : message || {}; - errorUtil22.toString = (message) => typeof message === "string" ? message : message?.message; -})(errorUtil2 || (errorUtil2 = {})); -var ParseInputLazyPath2 = class { - constructor(parent, value2, path4, key) { - this._cachedPath = []; - this.parent = parent; - this.data = value2; - this._path = path4; - this._key = key; - } - get path() { - if (!this._cachedPath.length) { - if (Array.isArray(this._key)) { - this._cachedPath.push(...this._path, ...this._key); - } else { - this._cachedPath.push(...this._path, this._key); - } - } - return this._cachedPath; - } -}; -var handleResult2 = (ctx, result) => { - if (isValid2(result)) { - return { success: true, data: result.value }; - } else { - if (!ctx.common.issues.length) { - throw new Error("Validation failed but no issues detected."); - } - return { - success: false, - get error() { - if (this._error) - return this._error; - const error50 = new ZodError4(ctx.common.issues); - this._error = error50; - return this._error; - } - }; - } -}; -function processCreateParams2(params) { - if (!params) - return {}; - const { errorMap: errorMap22, invalid_type_error, required_error, description } = params; - if (errorMap22 && (invalid_type_error || required_error)) { - throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`); - } - if (errorMap22) - return { errorMap: errorMap22, description }; - const customMap = (iss, ctx) => { - const { message } = params; - if (iss.code === "invalid_enum_value") { - return { message: message ?? ctx.defaultError }; - } - if (typeof ctx.data === "undefined") { - return { message: message ?? required_error ?? ctx.defaultError }; - } - if (iss.code !== "invalid_type") - return { message: ctx.defaultError }; - return { message: message ?? invalid_type_error ?? ctx.defaultError }; - }; - return { errorMap: customMap, description }; -} -var ZodType4 = class { - get description() { - return this._def.description; - } - _getType(input) { - return getParsedType3(input.data); - } - _getOrReturnCtx(input, ctx) { - return ctx || { - common: input.parent.common, - data: input.data, - parsedType: getParsedType3(input.data), - schemaErrorMap: this._def.errorMap, - path: input.path, - parent: input.parent - }; - } - _processInputParams(input) { - return { - status: new ParseStatus2(), - ctx: { - common: input.parent.common, - data: input.data, - parsedType: getParsedType3(input.data), - schemaErrorMap: this._def.errorMap, - path: input.path, - parent: input.parent - } - }; - } - _parseSync(input) { - const result = this._parse(input); - if (isAsync2(result)) { - throw new Error("Synchronous parse encountered promise."); - } - return result; - } - _parseAsync(input) { - const result = this._parse(input); - return Promise.resolve(result); - } - parse(data, params) { - const result = this.safeParse(data, params); - if (result.success) - return result.data; - throw result.error; - } - safeParse(data, params) { - const ctx = { - common: { - issues: [], - async: params?.async ?? false, - contextualErrorMap: params?.errorMap - }, - path: params?.path || [], - schemaErrorMap: this._def.errorMap, - parent: null, - data, - parsedType: getParsedType3(data) - }; - const result = this._parseSync({ data, path: ctx.path, parent: ctx }); - return handleResult2(ctx, result); - } - "~validate"(data) { - const ctx = { - common: { - issues: [], - async: !!this["~standard"].async - }, - path: [], - schemaErrorMap: this._def.errorMap, - parent: null, - data, - parsedType: getParsedType3(data) - }; - if (!this["~standard"].async) { - try { - const result = this._parseSync({ data, path: [], parent: ctx }); - return isValid2(result) ? { - value: result.value - } : { - issues: ctx.common.issues - }; - } catch (err) { - if (err?.message?.toLowerCase()?.includes("encountered")) { - this["~standard"].async = true; - } - ctx.common = { - issues: [], - async: true - }; - } - } - return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid2(result) ? { - value: result.value - } : { - issues: ctx.common.issues - }); - } - async parseAsync(data, params) { - const result = await this.safeParseAsync(data, params); - if (result.success) - return result.data; - throw result.error; - } - async safeParseAsync(data, params) { - const ctx = { - common: { - issues: [], - contextualErrorMap: params?.errorMap, - async: true - }, - path: params?.path || [], - schemaErrorMap: this._def.errorMap, - parent: null, - data, - parsedType: getParsedType3(data) - }; - const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx }); - const result = await (isAsync2(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult)); - return handleResult2(ctx, result); - } - refine(check4, message) { - const getIssueProperties = (val) => { - if (typeof message === "string" || typeof message === "undefined") { - return { message }; - } else if (typeof message === "function") { - return message(val); - } else { - return message; - } - }; - return this._refinement((val, ctx) => { - const result = check4(val); - const setError = () => ctx.addIssue({ - code: ZodIssueCode4.custom, - ...getIssueProperties(val) - }); - if (typeof Promise !== "undefined" && result instanceof Promise) { - return result.then((data) => { - if (!data) { - setError(); - return false; - } else { - return true; - } - }); - } - if (!result) { - setError(); - return false; - } else { - return true; - } - }); - } - refinement(check4, refinementData) { - return this._refinement((val, ctx) => { - if (!check4(val)) { - ctx.addIssue(typeof refinementData === "function" ? refinementData(val, ctx) : refinementData); - return false; - } else { - return true; - } - }); - } - _refinement(refinement) { - return new ZodEffects2({ - schema: this, - typeName: ZodFirstPartyTypeKind3.ZodEffects, - effect: { type: "refinement", refinement } - }); - } - superRefine(refinement) { - return this._refinement(refinement); - } - constructor(def) { - this.spa = this.safeParseAsync; - this._def = def; - this.parse = this.parse.bind(this); - this.safeParse = this.safeParse.bind(this); - this.parseAsync = this.parseAsync.bind(this); - this.safeParseAsync = this.safeParseAsync.bind(this); - this.spa = this.spa.bind(this); - this.refine = this.refine.bind(this); - this.refinement = this.refinement.bind(this); - this.superRefine = this.superRefine.bind(this); - this.optional = this.optional.bind(this); - this.nullable = this.nullable.bind(this); - this.nullish = this.nullish.bind(this); - this.array = this.array.bind(this); - this.promise = this.promise.bind(this); - this.or = this.or.bind(this); - this.and = this.and.bind(this); - this.transform = this.transform.bind(this); - this.brand = this.brand.bind(this); - this.default = this.default.bind(this); - this.catch = this.catch.bind(this); - this.describe = this.describe.bind(this); - this.pipe = this.pipe.bind(this); - this.readonly = this.readonly.bind(this); - this.isNullable = this.isNullable.bind(this); - this.isOptional = this.isOptional.bind(this); - this["~standard"] = { - version: 1, - vendor: "zod", - validate: (data) => this["~validate"](data) - }; - } - optional() { - return ZodOptional4.create(this, this._def); - } - nullable() { - return ZodNullable4.create(this, this._def); - } - nullish() { - return this.nullable().optional(); - } - array() { - return ZodArray4.create(this); - } - promise() { - return ZodPromise3.create(this, this._def); - } - or(option) { - return ZodUnion4.create([this, option], this._def); - } - and(incoming) { - return ZodIntersection4.create(this, incoming, this._def); - } - transform(transform4) { - return new ZodEffects2({ - ...processCreateParams2(this._def), - schema: this, - typeName: ZodFirstPartyTypeKind3.ZodEffects, - effect: { type: "transform", transform: transform4 } - }); - } - default(def) { - const defaultValueFunc = typeof def === "function" ? def : () => def; - return new ZodDefault4({ - ...processCreateParams2(this._def), - innerType: this, - defaultValue: defaultValueFunc, - typeName: ZodFirstPartyTypeKind3.ZodDefault - }); - } - brand() { - return new ZodBranded2({ - typeName: ZodFirstPartyTypeKind3.ZodBranded, - type: this, - ...processCreateParams2(this._def) - }); - } - catch(def) { - const catchValueFunc = typeof def === "function" ? def : () => def; - return new ZodCatch4({ - ...processCreateParams2(this._def), - innerType: this, - catchValue: catchValueFunc, - typeName: ZodFirstPartyTypeKind3.ZodCatch - }); - } - describe(description) { - const This = this.constructor; - return new This({ - ...this._def, - description - }); - } - pipe(target) { - return ZodPipeline2.create(this, target); - } - readonly() { - return ZodReadonly4.create(this); - } - isOptional() { - return this.safeParse(void 0).success; - } - isNullable() { - return this.safeParse(null).success; - } -}; -var cuidRegex2 = /^c[^\s-]{8,}$/i; -var cuid2Regex2 = /^[0-9a-z]+$/; -var ulidRegex2 = /^[0-9A-HJKMNP-TV-Z]{26}$/i; -var uuidRegex2 = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i; -var nanoidRegex2 = /^[a-z0-9_-]{21}$/i; -var jwtRegex2 = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/; -var durationRegex2 = /^[-+]?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)?)??$/; -var emailRegex2 = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i; -var _emojiRegex2 = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`; -var emojiRegex3; -var ipv4Regex2 = /^(?:(?: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])$/; -var ipv4CidrRegex2 = /^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/; -var ipv6Regex2 = /^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/; -var ipv6CidrRegex2 = /^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/; -var base64Regex2 = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/; -var base64urlRegex2 = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/; -var dateRegexSource2 = `((\\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])))`; -var dateRegex2 = new RegExp(`^${dateRegexSource2}$`); -function timeRegexSource2(args3) { - let secondsRegexSource = `[0-5]\\d`; - if (args3.precision) { - secondsRegexSource = `${secondsRegexSource}\\.\\d{${args3.precision}}`; - } else if (args3.precision == null) { - secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`; - } - const secondsQuantifier = args3.precision ? "+" : "?"; - return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`; -} -function timeRegex2(args3) { - return new RegExp(`^${timeRegexSource2(args3)}$`); -} -function datetimeRegex2(args3) { - let regex4 = `${dateRegexSource2}T${timeRegexSource2(args3)}`; - const opts = []; - opts.push(args3.local ? `Z?` : `Z`); - if (args3.offset) - opts.push(`([+-]\\d{2}:?\\d{2})`); - regex4 = `${regex4}(${opts.join("|")})`; - return new RegExp(`^${regex4}$`); -} -function isValidIP2(ip2, version4) { - if ((version4 === "v4" || !version4) && ipv4Regex2.test(ip2)) { - return true; - } - if ((version4 === "v6" || !version4) && ipv6Regex2.test(ip2)) { - return true; - } - return false; -} -function isValidJWT4(jwt2, alg) { - if (!jwtRegex2.test(jwt2)) - return false; - try { - const [header] = jwt2.split("."); - if (!header) - return false; - const base646 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "="); - const decoded = JSON.parse(atob(base646)); - if (typeof decoded !== "object" || decoded === null) - return false; - if ("typ" in decoded && decoded?.typ !== "JWT") - return false; - if (!decoded.alg) - return false; - if (alg && decoded.alg !== alg) - return false; - return true; - } catch { - return false; - } -} -function isValidCidr2(ip2, version4) { - if ((version4 === "v4" || !version4) && ipv4CidrRegex2.test(ip2)) { - return true; - } - if ((version4 === "v6" || !version4) && ipv6CidrRegex2.test(ip2)) { - return true; - } - return false; -} -var ZodString4 = class _ZodString4 extends ZodType4 { - _parse(input) { - if (this._def.coerce) { - input.data = String(input.data); - } - const parsedType3 = this._getType(input); - if (parsedType3 !== ZodParsedType2.string) { - const ctx2 = this._getOrReturnCtx(input); - addIssueToContext2(ctx2, { - code: ZodIssueCode4.invalid_type, - expected: ZodParsedType2.string, - received: ctx2.parsedType - }); - return INVALID2; - } - const status = new ParseStatus2(); - let ctx = void 0; - for (const check4 of this._def.checks) { - if (check4.kind === "min") { - if (input.data.length < check4.value) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode4.too_small, - minimum: check4.value, - type: "string", - inclusive: true, - exact: false, - message: check4.message - }); - status.dirty(); - } - } else if (check4.kind === "max") { - if (input.data.length > check4.value) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode4.too_big, - maximum: check4.value, - type: "string", - inclusive: true, - exact: false, - message: check4.message - }); - status.dirty(); - } - } else if (check4.kind === "length") { - const tooBig = input.data.length > check4.value; - const tooSmall = input.data.length < check4.value; - if (tooBig || tooSmall) { - ctx = this._getOrReturnCtx(input, ctx); - if (tooBig) { - addIssueToContext2(ctx, { - code: ZodIssueCode4.too_big, - maximum: check4.value, - type: "string", - inclusive: true, - exact: true, - message: check4.message - }); - } else if (tooSmall) { - addIssueToContext2(ctx, { - code: ZodIssueCode4.too_small, - minimum: check4.value, - type: "string", - inclusive: true, - exact: true, - message: check4.message - }); - } - status.dirty(); - } - } else if (check4.kind === "email") { - if (!emailRegex2.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext2(ctx, { - validation: "email", - code: ZodIssueCode4.invalid_string, - message: check4.message - }); - status.dirty(); - } - } else if (check4.kind === "emoji") { - if (!emojiRegex3) { - emojiRegex3 = new RegExp(_emojiRegex2, "u"); - } - if (!emojiRegex3.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext2(ctx, { - validation: "emoji", - code: ZodIssueCode4.invalid_string, - message: check4.message - }); - status.dirty(); - } - } else if (check4.kind === "uuid") { - if (!uuidRegex2.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext2(ctx, { - validation: "uuid", - code: ZodIssueCode4.invalid_string, - message: check4.message - }); - status.dirty(); - } - } else if (check4.kind === "nanoid") { - if (!nanoidRegex2.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext2(ctx, { - validation: "nanoid", - code: ZodIssueCode4.invalid_string, - message: check4.message - }); - status.dirty(); - } - } else if (check4.kind === "cuid") { - if (!cuidRegex2.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext2(ctx, { - validation: "cuid", - code: ZodIssueCode4.invalid_string, - message: check4.message - }); - status.dirty(); - } - } else if (check4.kind === "cuid2") { - if (!cuid2Regex2.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext2(ctx, { - validation: "cuid2", - code: ZodIssueCode4.invalid_string, - message: check4.message - }); - status.dirty(); - } - } else if (check4.kind === "ulid") { - if (!ulidRegex2.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext2(ctx, { - validation: "ulid", - code: ZodIssueCode4.invalid_string, - message: check4.message - }); - status.dirty(); - } - } else if (check4.kind === "url") { - try { - new URL(input.data); - } catch { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext2(ctx, { - validation: "url", - code: ZodIssueCode4.invalid_string, - message: check4.message - }); - status.dirty(); - } - } else if (check4.kind === "regex") { - check4.regex.lastIndex = 0; - const testResult = check4.regex.test(input.data); - if (!testResult) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext2(ctx, { - validation: "regex", - code: ZodIssueCode4.invalid_string, - message: check4.message - }); - status.dirty(); - } - } else if (check4.kind === "trim") { - input.data = input.data.trim(); - } else if (check4.kind === "includes") { - if (!input.data.includes(check4.value, check4.position)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode4.invalid_string, - validation: { includes: check4.value, position: check4.position }, - message: check4.message - }); - status.dirty(); - } - } else if (check4.kind === "toLowerCase") { - input.data = input.data.toLowerCase(); - } else if (check4.kind === "toUpperCase") { - input.data = input.data.toUpperCase(); - } else if (check4.kind === "startsWith") { - if (!input.data.startsWith(check4.value)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode4.invalid_string, - validation: { startsWith: check4.value }, - message: check4.message - }); - status.dirty(); - } - } else if (check4.kind === "endsWith") { - if (!input.data.endsWith(check4.value)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode4.invalid_string, - validation: { endsWith: check4.value }, - message: check4.message - }); - status.dirty(); - } - } else if (check4.kind === "datetime") { - const regex4 = datetimeRegex2(check4); - if (!regex4.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode4.invalid_string, - validation: "datetime", - message: check4.message - }); - status.dirty(); - } - } else if (check4.kind === "date") { - const regex4 = dateRegex2; - if (!regex4.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode4.invalid_string, - validation: "date", - message: check4.message - }); - status.dirty(); - } - } else if (check4.kind === "time") { - const regex4 = timeRegex2(check4); - if (!regex4.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode4.invalid_string, - validation: "time", - message: check4.message - }); - status.dirty(); - } - } else if (check4.kind === "duration") { - if (!durationRegex2.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext2(ctx, { - validation: "duration", - code: ZodIssueCode4.invalid_string, - message: check4.message - }); - status.dirty(); - } - } else if (check4.kind === "ip") { - if (!isValidIP2(input.data, check4.version)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext2(ctx, { - validation: "ip", - code: ZodIssueCode4.invalid_string, - message: check4.message - }); - status.dirty(); - } - } else if (check4.kind === "jwt") { - if (!isValidJWT4(input.data, check4.alg)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext2(ctx, { - validation: "jwt", - code: ZodIssueCode4.invalid_string, - message: check4.message - }); - status.dirty(); - } - } else if (check4.kind === "cidr") { - if (!isValidCidr2(input.data, check4.version)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext2(ctx, { - validation: "cidr", - code: ZodIssueCode4.invalid_string, - message: check4.message - }); - status.dirty(); - } - } else if (check4.kind === "base64") { - if (!base64Regex2.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext2(ctx, { - validation: "base64", - code: ZodIssueCode4.invalid_string, - message: check4.message - }); - status.dirty(); - } - } else if (check4.kind === "base64url") { - if (!base64urlRegex2.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext2(ctx, { - validation: "base64url", - code: ZodIssueCode4.invalid_string, - message: check4.message - }); - status.dirty(); - } - } else { - util2.assertNever(check4); - } - } - return { status: status.value, value: input.data }; - } - _regex(regex4, validation, message) { - return this.refinement((data) => regex4.test(data), { - validation, - code: ZodIssueCode4.invalid_string, - ...errorUtil2.errToObj(message) - }); - } - _addCheck(check4) { - return new _ZodString4({ - ...this._def, - checks: [...this._def.checks, check4] - }); - } - email(message) { - return this._addCheck({ kind: "email", ...errorUtil2.errToObj(message) }); - } - url(message) { - return this._addCheck({ kind: "url", ...errorUtil2.errToObj(message) }); - } - emoji(message) { - return this._addCheck({ kind: "emoji", ...errorUtil2.errToObj(message) }); - } - uuid(message) { - return this._addCheck({ kind: "uuid", ...errorUtil2.errToObj(message) }); - } - nanoid(message) { - return this._addCheck({ kind: "nanoid", ...errorUtil2.errToObj(message) }); - } - cuid(message) { - return this._addCheck({ kind: "cuid", ...errorUtil2.errToObj(message) }); - } - cuid2(message) { - return this._addCheck({ kind: "cuid2", ...errorUtil2.errToObj(message) }); - } - ulid(message) { - return this._addCheck({ kind: "ulid", ...errorUtil2.errToObj(message) }); - } - base64(message) { - return this._addCheck({ kind: "base64", ...errorUtil2.errToObj(message) }); - } - base64url(message) { - return this._addCheck({ - kind: "base64url", - ...errorUtil2.errToObj(message) - }); - } - jwt(options) { - return this._addCheck({ kind: "jwt", ...errorUtil2.errToObj(options) }); - } - ip(options) { - return this._addCheck({ kind: "ip", ...errorUtil2.errToObj(options) }); - } - cidr(options) { - return this._addCheck({ kind: "cidr", ...errorUtil2.errToObj(options) }); - } - datetime(options) { - if (typeof options === "string") { - return this._addCheck({ - kind: "datetime", - precision: null, - offset: false, - local: false, - message: options - }); - } - return this._addCheck({ - kind: "datetime", - precision: typeof options?.precision === "undefined" ? null : options?.precision, - offset: options?.offset ?? false, - local: options?.local ?? false, - ...errorUtil2.errToObj(options?.message) - }); - } - date(message) { - return this._addCheck({ kind: "date", message }); - } - time(options) { - if (typeof options === "string") { - return this._addCheck({ - kind: "time", - precision: null, - message: options - }); - } - return this._addCheck({ - kind: "time", - precision: typeof options?.precision === "undefined" ? null : options?.precision, - ...errorUtil2.errToObj(options?.message) - }); - } - duration(message) { - return this._addCheck({ kind: "duration", ...errorUtil2.errToObj(message) }); - } - regex(regex4, message) { - return this._addCheck({ - kind: "regex", - regex: regex4, - ...errorUtil2.errToObj(message) - }); - } - includes(value2, options) { - return this._addCheck({ - kind: "includes", - value: value2, - position: options?.position, - ...errorUtil2.errToObj(options?.message) - }); - } - startsWith(value2, message) { - return this._addCheck({ - kind: "startsWith", - value: value2, - ...errorUtil2.errToObj(message) - }); - } - endsWith(value2, message) { - return this._addCheck({ - kind: "endsWith", - value: value2, - ...errorUtil2.errToObj(message) - }); - } - min(minLength, message) { - return this._addCheck({ - kind: "min", - value: minLength, - ...errorUtil2.errToObj(message) - }); - } - max(maxLength, message) { - return this._addCheck({ - kind: "max", - value: maxLength, - ...errorUtil2.errToObj(message) - }); - } - length(len, message) { - return this._addCheck({ - kind: "length", - value: len, - ...errorUtil2.errToObj(message) - }); - } - nonempty(message) { - return this.min(1, errorUtil2.errToObj(message)); - } - trim() { - return new _ZodString4({ - ...this._def, - checks: [...this._def.checks, { kind: "trim" }] - }); - } - toLowerCase() { - return new _ZodString4({ - ...this._def, - checks: [...this._def.checks, { kind: "toLowerCase" }] - }); - } - toUpperCase() { - return new _ZodString4({ - ...this._def, - checks: [...this._def.checks, { kind: "toUpperCase" }] - }); - } - get isDatetime() { - return !!this._def.checks.find((ch) => ch.kind === "datetime"); - } - get isDate() { - return !!this._def.checks.find((ch) => ch.kind === "date"); - } - get isTime() { - return !!this._def.checks.find((ch) => ch.kind === "time"); - } - get isDuration() { - return !!this._def.checks.find((ch) => ch.kind === "duration"); - } - get isEmail() { - return !!this._def.checks.find((ch) => ch.kind === "email"); - } - get isURL() { - return !!this._def.checks.find((ch) => ch.kind === "url"); - } - get isEmoji() { - return !!this._def.checks.find((ch) => ch.kind === "emoji"); - } - get isUUID() { - return !!this._def.checks.find((ch) => ch.kind === "uuid"); - } - get isNANOID() { - return !!this._def.checks.find((ch) => ch.kind === "nanoid"); - } - get isCUID() { - return !!this._def.checks.find((ch) => ch.kind === "cuid"); - } - get isCUID2() { - return !!this._def.checks.find((ch) => ch.kind === "cuid2"); - } - get isULID() { - return !!this._def.checks.find((ch) => ch.kind === "ulid"); - } - get isIP() { - return !!this._def.checks.find((ch) => ch.kind === "ip"); - } - get isCIDR() { - return !!this._def.checks.find((ch) => ch.kind === "cidr"); - } - get isBase64() { - return !!this._def.checks.find((ch) => ch.kind === "base64"); - } - get isBase64url() { - return !!this._def.checks.find((ch) => ch.kind === "base64url"); - } - get minLength() { - let min = null; - for (const ch of this._def.checks) { - if (ch.kind === "min") { - if (min === null || ch.value > min) - min = ch.value; - } - } - return min; - } - get maxLength() { - let max = null; - for (const ch of this._def.checks) { - if (ch.kind === "max") { - if (max === null || ch.value < max) - max = ch.value; - } - } - return max; - } -}; -ZodString4.create = (params) => { - return new ZodString4({ - checks: [], - typeName: ZodFirstPartyTypeKind3.ZodString, - coerce: params?.coerce ?? false, - ...processCreateParams2(params) - }); -}; -function floatSafeRemainder4(val, step) { - const valDecCount = (val.toString().split(".")[1] || "").length; - const stepDecCount = (step.toString().split(".")[1] || "").length; - const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount; - const valInt = Number.parseInt(val.toFixed(decCount).replace(".", "")); - const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", "")); - return valInt % stepInt / 10 ** decCount; -} -var ZodNumber4 = class _ZodNumber extends ZodType4 { - constructor() { - super(...arguments); - this.min = this.gte; - this.max = this.lte; - this.step = this.multipleOf; - } - _parse(input) { - if (this._def.coerce) { - input.data = Number(input.data); - } - const parsedType3 = this._getType(input); - if (parsedType3 !== ZodParsedType2.number) { - const ctx2 = this._getOrReturnCtx(input); - addIssueToContext2(ctx2, { - code: ZodIssueCode4.invalid_type, - expected: ZodParsedType2.number, - received: ctx2.parsedType - }); - return INVALID2; - } - let ctx = void 0; - const status = new ParseStatus2(); - for (const check4 of this._def.checks) { - if (check4.kind === "int") { - if (!util2.isInteger(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode4.invalid_type, - expected: "integer", - received: "float", - message: check4.message - }); - status.dirty(); - } - } else if (check4.kind === "min") { - const tooSmall = check4.inclusive ? input.data < check4.value : input.data <= check4.value; - if (tooSmall) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode4.too_small, - minimum: check4.value, - type: "number", - inclusive: check4.inclusive, - exact: false, - message: check4.message - }); - status.dirty(); - } - } else if (check4.kind === "max") { - const tooBig = check4.inclusive ? input.data > check4.value : input.data >= check4.value; - if (tooBig) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode4.too_big, - maximum: check4.value, - type: "number", - inclusive: check4.inclusive, - exact: false, - message: check4.message - }); - status.dirty(); - } - } else if (check4.kind === "multipleOf") { - if (floatSafeRemainder4(input.data, check4.value) !== 0) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode4.not_multiple_of, - multipleOf: check4.value, - message: check4.message - }); - status.dirty(); - } - } else if (check4.kind === "finite") { - if (!Number.isFinite(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode4.not_finite, - message: check4.message - }); - status.dirty(); - } - } else { - util2.assertNever(check4); - } - } - return { status: status.value, value: input.data }; - } - gte(value2, message) { - return this.setLimit("min", value2, true, errorUtil2.toString(message)); - } - gt(value2, message) { - return this.setLimit("min", value2, false, errorUtil2.toString(message)); - } - lte(value2, message) { - return this.setLimit("max", value2, true, errorUtil2.toString(message)); - } - lt(value2, message) { - return this.setLimit("max", value2, false, errorUtil2.toString(message)); - } - setLimit(kind, value2, inclusive, message) { - return new _ZodNumber({ - ...this._def, - checks: [ - ...this._def.checks, - { - kind, - value: value2, - inclusive, - message: errorUtil2.toString(message) - } - ] - }); - } - _addCheck(check4) { - return new _ZodNumber({ - ...this._def, - checks: [...this._def.checks, check4] - }); - } - int(message) { - return this._addCheck({ - kind: "int", - message: errorUtil2.toString(message) - }); - } - positive(message) { - return this._addCheck({ - kind: "min", - value: 0, - inclusive: false, - message: errorUtil2.toString(message) - }); - } - negative(message) { - return this._addCheck({ - kind: "max", - value: 0, - inclusive: false, - message: errorUtil2.toString(message) - }); - } - nonpositive(message) { - return this._addCheck({ - kind: "max", - value: 0, - inclusive: true, - message: errorUtil2.toString(message) - }); - } - nonnegative(message) { - return this._addCheck({ - kind: "min", - value: 0, - inclusive: true, - message: errorUtil2.toString(message) - }); - } - multipleOf(value2, message) { - return this._addCheck({ - kind: "multipleOf", - value: value2, - message: errorUtil2.toString(message) - }); - } - finite(message) { - return this._addCheck({ - kind: "finite", - message: errorUtil2.toString(message) - }); - } - safe(message) { - return this._addCheck({ - kind: "min", - inclusive: true, - value: Number.MIN_SAFE_INTEGER, - message: errorUtil2.toString(message) - })._addCheck({ - kind: "max", - inclusive: true, - value: Number.MAX_SAFE_INTEGER, - message: errorUtil2.toString(message) - }); - } - get minValue() { - let min = null; - for (const ch of this._def.checks) { - if (ch.kind === "min") { - if (min === null || ch.value > min) - min = ch.value; - } - } - return min; - } - get maxValue() { - let max = null; - for (const ch of this._def.checks) { - if (ch.kind === "max") { - if (max === null || ch.value < max) - max = ch.value; - } - } - return max; - } - get isInt() { - return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util2.isInteger(ch.value)); - } - get isFinite() { - let max = null; - let min = null; - for (const ch of this._def.checks) { - if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") { - return true; - } else if (ch.kind === "min") { - if (min === null || ch.value > min) - min = ch.value; - } else if (ch.kind === "max") { - if (max === null || ch.value < max) - max = ch.value; - } - } - return Number.isFinite(min) && Number.isFinite(max); - } -}; -ZodNumber4.create = (params) => { - return new ZodNumber4({ - checks: [], - typeName: ZodFirstPartyTypeKind3.ZodNumber, - coerce: params?.coerce || false, - ...processCreateParams2(params) - }); -}; -var ZodBigInt3 = class _ZodBigInt extends ZodType4 { - constructor() { - super(...arguments); - this.min = this.gte; - this.max = this.lte; - } - _parse(input) { - if (this._def.coerce) { - try { - input.data = BigInt(input.data); - } catch { - return this._getInvalidInput(input); - } - } - const parsedType3 = this._getType(input); - if (parsedType3 !== ZodParsedType2.bigint) { - return this._getInvalidInput(input); - } - let ctx = void 0; - const status = new ParseStatus2(); - for (const check4 of this._def.checks) { - if (check4.kind === "min") { - const tooSmall = check4.inclusive ? input.data < check4.value : input.data <= check4.value; - if (tooSmall) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode4.too_small, - type: "bigint", - minimum: check4.value, - inclusive: check4.inclusive, - message: check4.message - }); - status.dirty(); - } - } else if (check4.kind === "max") { - const tooBig = check4.inclusive ? input.data > check4.value : input.data >= check4.value; - if (tooBig) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode4.too_big, - type: "bigint", - maximum: check4.value, - inclusive: check4.inclusive, - message: check4.message - }); - status.dirty(); - } - } else if (check4.kind === "multipleOf") { - if (input.data % check4.value !== BigInt(0)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode4.not_multiple_of, - multipleOf: check4.value, - message: check4.message - }); - status.dirty(); - } - } else { - util2.assertNever(check4); - } - } - return { status: status.value, value: input.data }; - } - _getInvalidInput(input) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext2(ctx, { - code: ZodIssueCode4.invalid_type, - expected: ZodParsedType2.bigint, - received: ctx.parsedType - }); - return INVALID2; - } - gte(value2, message) { - return this.setLimit("min", value2, true, errorUtil2.toString(message)); - } - gt(value2, message) { - return this.setLimit("min", value2, false, errorUtil2.toString(message)); - } - lte(value2, message) { - return this.setLimit("max", value2, true, errorUtil2.toString(message)); - } - lt(value2, message) { - return this.setLimit("max", value2, false, errorUtil2.toString(message)); - } - setLimit(kind, value2, inclusive, message) { - return new _ZodBigInt({ - ...this._def, - checks: [ - ...this._def.checks, - { - kind, - value: value2, - inclusive, - message: errorUtil2.toString(message) - } - ] - }); - } - _addCheck(check4) { - return new _ZodBigInt({ - ...this._def, - checks: [...this._def.checks, check4] - }); - } - positive(message) { - return this._addCheck({ - kind: "min", - value: BigInt(0), - inclusive: false, - message: errorUtil2.toString(message) - }); - } - negative(message) { - return this._addCheck({ - kind: "max", - value: BigInt(0), - inclusive: false, - message: errorUtil2.toString(message) - }); - } - nonpositive(message) { - return this._addCheck({ - kind: "max", - value: BigInt(0), - inclusive: true, - message: errorUtil2.toString(message) - }); - } - nonnegative(message) { - return this._addCheck({ - kind: "min", - value: BigInt(0), - inclusive: true, - message: errorUtil2.toString(message) - }); - } - multipleOf(value2, message) { - return this._addCheck({ - kind: "multipleOf", - value: value2, - message: errorUtil2.toString(message) - }); - } - get minValue() { - let min = null; - for (const ch of this._def.checks) { - if (ch.kind === "min") { - if (min === null || ch.value > min) - min = ch.value; - } - } - return min; - } - get maxValue() { - let max = null; - for (const ch of this._def.checks) { - if (ch.kind === "max") { - if (max === null || ch.value < max) - max = ch.value; - } - } - return max; - } -}; -ZodBigInt3.create = (params) => { - return new ZodBigInt3({ - checks: [], - typeName: ZodFirstPartyTypeKind3.ZodBigInt, - coerce: params?.coerce ?? false, - ...processCreateParams2(params) - }); -}; -var ZodBoolean4 = class extends ZodType4 { - _parse(input) { - if (this._def.coerce) { - input.data = Boolean(input.data); - } - const parsedType3 = this._getType(input); - if (parsedType3 !== ZodParsedType2.boolean) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext2(ctx, { - code: ZodIssueCode4.invalid_type, - expected: ZodParsedType2.boolean, - received: ctx.parsedType - }); - return INVALID2; - } - return OK2(input.data); - } -}; -ZodBoolean4.create = (params) => { - return new ZodBoolean4({ - typeName: ZodFirstPartyTypeKind3.ZodBoolean, - coerce: params?.coerce || false, - ...processCreateParams2(params) - }); -}; -var ZodDate3 = class _ZodDate extends ZodType4 { - _parse(input) { - if (this._def.coerce) { - input.data = new Date(input.data); - } - const parsedType3 = this._getType(input); - if (parsedType3 !== ZodParsedType2.date) { - const ctx2 = this._getOrReturnCtx(input); - addIssueToContext2(ctx2, { - code: ZodIssueCode4.invalid_type, - expected: ZodParsedType2.date, - received: ctx2.parsedType - }); - return INVALID2; - } - if (Number.isNaN(input.data.getTime())) { - const ctx2 = this._getOrReturnCtx(input); - addIssueToContext2(ctx2, { - code: ZodIssueCode4.invalid_date - }); - return INVALID2; - } - const status = new ParseStatus2(); - let ctx = void 0; - for (const check4 of this._def.checks) { - if (check4.kind === "min") { - if (input.data.getTime() < check4.value) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode4.too_small, - message: check4.message, - inclusive: true, - exact: false, - minimum: check4.value, - type: "date" - }); - status.dirty(); - } - } else if (check4.kind === "max") { - if (input.data.getTime() > check4.value) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode4.too_big, - message: check4.message, - inclusive: true, - exact: false, - maximum: check4.value, - type: "date" - }); - status.dirty(); - } - } else { - util2.assertNever(check4); - } - } - return { - status: status.value, - value: new Date(input.data.getTime()) - }; - } - _addCheck(check4) { - return new _ZodDate({ - ...this._def, - checks: [...this._def.checks, check4] - }); - } - min(minDate, message) { - return this._addCheck({ - kind: "min", - value: minDate.getTime(), - message: errorUtil2.toString(message) - }); - } - max(maxDate, message) { - return this._addCheck({ - kind: "max", - value: maxDate.getTime(), - message: errorUtil2.toString(message) - }); - } - get minDate() { - let min = null; - for (const ch of this._def.checks) { - if (ch.kind === "min") { - if (min === null || ch.value > min) - min = ch.value; - } - } - return min != null ? new Date(min) : null; - } - get maxDate() { - let max = null; - for (const ch of this._def.checks) { - if (ch.kind === "max") { - if (max === null || ch.value < max) - max = ch.value; - } - } - return max != null ? new Date(max) : null; - } -}; -ZodDate3.create = (params) => { - return new ZodDate3({ - checks: [], - coerce: params?.coerce || false, - typeName: ZodFirstPartyTypeKind3.ZodDate, - ...processCreateParams2(params) - }); -}; -var ZodSymbol3 = class extends ZodType4 { - _parse(input) { - const parsedType3 = this._getType(input); - if (parsedType3 !== ZodParsedType2.symbol) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext2(ctx, { - code: ZodIssueCode4.invalid_type, - expected: ZodParsedType2.symbol, - received: ctx.parsedType - }); - return INVALID2; - } - return OK2(input.data); - } -}; -ZodSymbol3.create = (params) => { - return new ZodSymbol3({ - typeName: ZodFirstPartyTypeKind3.ZodSymbol, - ...processCreateParams2(params) - }); -}; -var ZodUndefined3 = class extends ZodType4 { - _parse(input) { - const parsedType3 = this._getType(input); - if (parsedType3 !== ZodParsedType2.undefined) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext2(ctx, { - code: ZodIssueCode4.invalid_type, - expected: ZodParsedType2.undefined, - received: ctx.parsedType - }); - return INVALID2; - } - return OK2(input.data); - } -}; -ZodUndefined3.create = (params) => { - return new ZodUndefined3({ - typeName: ZodFirstPartyTypeKind3.ZodUndefined, - ...processCreateParams2(params) - }); -}; -var ZodNull4 = class extends ZodType4 { - _parse(input) { - const parsedType3 = this._getType(input); - if (parsedType3 !== ZodParsedType2.null) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext2(ctx, { - code: ZodIssueCode4.invalid_type, - expected: ZodParsedType2.null, - received: ctx.parsedType - }); - return INVALID2; - } - return OK2(input.data); - } -}; -ZodNull4.create = (params) => { - return new ZodNull4({ - typeName: ZodFirstPartyTypeKind3.ZodNull, - ...processCreateParams2(params) - }); -}; -var ZodAny4 = class extends ZodType4 { - constructor() { - super(...arguments); - this._any = true; - } - _parse(input) { - return OK2(input.data); - } -}; -ZodAny4.create = (params) => { - return new ZodAny4({ - typeName: ZodFirstPartyTypeKind3.ZodAny, - ...processCreateParams2(params) - }); -}; -var ZodUnknown4 = class extends ZodType4 { - constructor() { - super(...arguments); - this._unknown = true; - } - _parse(input) { - return OK2(input.data); - } -}; -ZodUnknown4.create = (params) => { - return new ZodUnknown4({ - typeName: ZodFirstPartyTypeKind3.ZodUnknown, - ...processCreateParams2(params) - }); -}; -var ZodNever4 = class extends ZodType4 { - _parse(input) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext2(ctx, { - code: ZodIssueCode4.invalid_type, - expected: ZodParsedType2.never, - received: ctx.parsedType - }); - return INVALID2; - } -}; -ZodNever4.create = (params) => { - return new ZodNever4({ - typeName: ZodFirstPartyTypeKind3.ZodNever, - ...processCreateParams2(params) - }); -}; -var ZodVoid3 = class extends ZodType4 { - _parse(input) { - const parsedType3 = this._getType(input); - if (parsedType3 !== ZodParsedType2.undefined) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext2(ctx, { - code: ZodIssueCode4.invalid_type, - expected: ZodParsedType2.void, - received: ctx.parsedType - }); - return INVALID2; - } - return OK2(input.data); - } -}; -ZodVoid3.create = (params) => { - return new ZodVoid3({ - typeName: ZodFirstPartyTypeKind3.ZodVoid, - ...processCreateParams2(params) - }); -}; -var ZodArray4 = class _ZodArray extends ZodType4 { - _parse(input) { - const { ctx, status } = this._processInputParams(input); - const def = this._def; - if (ctx.parsedType !== ZodParsedType2.array) { - addIssueToContext2(ctx, { - code: ZodIssueCode4.invalid_type, - expected: ZodParsedType2.array, - received: ctx.parsedType - }); - return INVALID2; - } - if (def.exactLength !== null) { - const tooBig = ctx.data.length > def.exactLength.value; - const tooSmall = ctx.data.length < def.exactLength.value; - if (tooBig || tooSmall) { - addIssueToContext2(ctx, { - code: tooBig ? ZodIssueCode4.too_big : ZodIssueCode4.too_small, - minimum: tooSmall ? def.exactLength.value : void 0, - maximum: tooBig ? def.exactLength.value : void 0, - type: "array", - inclusive: true, - exact: true, - message: def.exactLength.message - }); - status.dirty(); - } - } - if (def.minLength !== null) { - if (ctx.data.length < def.minLength.value) { - addIssueToContext2(ctx, { - code: ZodIssueCode4.too_small, - minimum: def.minLength.value, - type: "array", - inclusive: true, - exact: false, - message: def.minLength.message - }); - status.dirty(); - } - } - if (def.maxLength !== null) { - if (ctx.data.length > def.maxLength.value) { - addIssueToContext2(ctx, { - code: ZodIssueCode4.too_big, - maximum: def.maxLength.value, - type: "array", - inclusive: true, - exact: false, - message: def.maxLength.message - }); - status.dirty(); - } - } - if (ctx.common.async) { - return Promise.all([...ctx.data].map((item, i) => { - return def.type._parseAsync(new ParseInputLazyPath2(ctx, item, ctx.path, i)); - })).then((result2) => { - return ParseStatus2.mergeArray(status, result2); - }); - } - const result = [...ctx.data].map((item, i) => { - return def.type._parseSync(new ParseInputLazyPath2(ctx, item, ctx.path, i)); - }); - return ParseStatus2.mergeArray(status, result); - } - get element() { - return this._def.type; - } - min(minLength, message) { - return new _ZodArray({ - ...this._def, - minLength: { value: minLength, message: errorUtil2.toString(message) } - }); - } - max(maxLength, message) { - return new _ZodArray({ - ...this._def, - maxLength: { value: maxLength, message: errorUtil2.toString(message) } - }); - } - length(len, message) { - return new _ZodArray({ - ...this._def, - exactLength: { value: len, message: errorUtil2.toString(message) } - }); - } - nonempty(message) { - return this.min(1, message); - } -}; -ZodArray4.create = (schema2, params) => { - return new ZodArray4({ - type: schema2, - minLength: null, - maxLength: null, - exactLength: null, - typeName: ZodFirstPartyTypeKind3.ZodArray, - ...processCreateParams2(params) - }); -}; -function deepPartialify2(schema2) { - if (schema2 instanceof ZodObject4) { - const newShape = {}; - for (const key in schema2.shape) { - const fieldSchema = schema2.shape[key]; - newShape[key] = ZodOptional4.create(deepPartialify2(fieldSchema)); - } - return new ZodObject4({ - ...schema2._def, - shape: () => newShape - }); - } else if (schema2 instanceof ZodArray4) { - return new ZodArray4({ - ...schema2._def, - type: deepPartialify2(schema2.element) - }); - } else if (schema2 instanceof ZodOptional4) { - return ZodOptional4.create(deepPartialify2(schema2.unwrap())); - } else if (schema2 instanceof ZodNullable4) { - return ZodNullable4.create(deepPartialify2(schema2.unwrap())); - } else if (schema2 instanceof ZodTuple3) { - return ZodTuple3.create(schema2.items.map((item) => deepPartialify2(item))); - } else { - return schema2; - } -} -var ZodObject4 = class _ZodObject extends ZodType4 { - constructor() { - super(...arguments); - this._cached = null; - this.nonstrict = this.passthrough; - this.augment = this.extend; - } - _getCached() { - if (this._cached !== null) - return this._cached; - const shape = this._def.shape(); - const keys = util2.objectKeys(shape); - this._cached = { shape, keys }; - return this._cached; - } - _parse(input) { - const parsedType3 = this._getType(input); - if (parsedType3 !== ZodParsedType2.object) { - const ctx2 = this._getOrReturnCtx(input); - addIssueToContext2(ctx2, { - code: ZodIssueCode4.invalid_type, - expected: ZodParsedType2.object, - received: ctx2.parsedType - }); - return INVALID2; - } - const { status, ctx } = this._processInputParams(input); - const { shape, keys: shapeKeys } = this._getCached(); - const extraKeys = []; - if (!(this._def.catchall instanceof ZodNever4 && this._def.unknownKeys === "strip")) { - for (const key in ctx.data) { - if (!shapeKeys.includes(key)) { - extraKeys.push(key); - } - } - } - const pairs = []; - for (const key of shapeKeys) { - const keyValidator = shape[key]; - const value2 = ctx.data[key]; - pairs.push({ - key: { status: "valid", value: key }, - value: keyValidator._parse(new ParseInputLazyPath2(ctx, value2, ctx.path, key)), - alwaysSet: key in ctx.data - }); - } - if (this._def.catchall instanceof ZodNever4) { - const unknownKeys = this._def.unknownKeys; - if (unknownKeys === "passthrough") { - for (const key of extraKeys) { - pairs.push({ - key: { status: "valid", value: key }, - value: { status: "valid", value: ctx.data[key] } - }); - } - } else if (unknownKeys === "strict") { - if (extraKeys.length > 0) { - addIssueToContext2(ctx, { - code: ZodIssueCode4.unrecognized_keys, - keys: extraKeys - }); - status.dirty(); - } - } else if (unknownKeys === "strip") { - } else { - throw new Error(`Internal ZodObject error: invalid unknownKeys value.`); - } - } else { - const catchall = this._def.catchall; - for (const key of extraKeys) { - const value2 = ctx.data[key]; - pairs.push({ - key: { status: "valid", value: key }, - value: catchall._parse(new ParseInputLazyPath2(ctx, value2, ctx.path, key)), - alwaysSet: key in ctx.data - }); - } - } - if (ctx.common.async) { - return Promise.resolve().then(async () => { - const syncPairs = []; - for (const pair of pairs) { - const key = await pair.key; - const value2 = await pair.value; - syncPairs.push({ - key, - value: value2, - alwaysSet: pair.alwaysSet - }); - } - return syncPairs; - }).then((syncPairs) => { - return ParseStatus2.mergeObjectSync(status, syncPairs); - }); - } else { - return ParseStatus2.mergeObjectSync(status, pairs); - } - } - get shape() { - return this._def.shape(); - } - strict(message) { - errorUtil2.errToObj; - return new _ZodObject({ - ...this._def, - unknownKeys: "strict", - ...message !== void 0 ? { - errorMap: (issue4, ctx) => { - const defaultError = this._def.errorMap?.(issue4, ctx).message ?? ctx.defaultError; - if (issue4.code === "unrecognized_keys") - return { - message: errorUtil2.errToObj(message).message ?? defaultError - }; - return { - message: defaultError - }; - } - } : {} - }); - } - strip() { - return new _ZodObject({ - ...this._def, - unknownKeys: "strip" - }); - } - passthrough() { - return new _ZodObject({ - ...this._def, - unknownKeys: "passthrough" - }); - } - extend(augmentation) { - return new _ZodObject({ - ...this._def, - shape: () => ({ - ...this._def.shape(), - ...augmentation - }) - }); - } - merge(merging) { - const merged = new _ZodObject({ - unknownKeys: merging._def.unknownKeys, - catchall: merging._def.catchall, - shape: () => ({ - ...this._def.shape(), - ...merging._def.shape() - }), - typeName: ZodFirstPartyTypeKind3.ZodObject - }); - return merged; - } - setKey(key, schema2) { - return this.augment({ [key]: schema2 }); - } - catchall(index) { - return new _ZodObject({ - ...this._def, - catchall: index - }); - } - pick(mask) { - const shape = {}; - for (const key of util2.objectKeys(mask)) { - if (mask[key] && this.shape[key]) { - shape[key] = this.shape[key]; - } - } - return new _ZodObject({ - ...this._def, - shape: () => shape - }); - } - omit(mask) { - const shape = {}; - for (const key of util2.objectKeys(this.shape)) { - if (!mask[key]) { - shape[key] = this.shape[key]; - } - } - return new _ZodObject({ - ...this._def, - shape: () => shape - }); - } - deepPartial() { - return deepPartialify2(this); - } - partial(mask) { - const newShape = {}; - for (const key of util2.objectKeys(this.shape)) { - const fieldSchema = this.shape[key]; - if (mask && !mask[key]) { - newShape[key] = fieldSchema; - } else { - newShape[key] = fieldSchema.optional(); - } - } - return new _ZodObject({ - ...this._def, - shape: () => newShape - }); - } - required(mask) { - const newShape = {}; - for (const key of util2.objectKeys(this.shape)) { - if (mask && !mask[key]) { - newShape[key] = this.shape[key]; - } else { - const fieldSchema = this.shape[key]; - let newField = fieldSchema; - while (newField instanceof ZodOptional4) { - newField = newField._def.innerType; - } - newShape[key] = newField; - } - } - return new _ZodObject({ - ...this._def, - shape: () => newShape - }); - } - keyof() { - return createZodEnum2(util2.objectKeys(this.shape)); - } -}; -ZodObject4.create = (shape, params) => { - return new ZodObject4({ - shape: () => shape, - unknownKeys: "strip", - catchall: ZodNever4.create(), - typeName: ZodFirstPartyTypeKind3.ZodObject, - ...processCreateParams2(params) - }); -}; -ZodObject4.strictCreate = (shape, params) => { - return new ZodObject4({ - shape: () => shape, - unknownKeys: "strict", - catchall: ZodNever4.create(), - typeName: ZodFirstPartyTypeKind3.ZodObject, - ...processCreateParams2(params) - }); -}; -ZodObject4.lazycreate = (shape, params) => { - return new ZodObject4({ - shape, - unknownKeys: "strip", - catchall: ZodNever4.create(), - typeName: ZodFirstPartyTypeKind3.ZodObject, - ...processCreateParams2(params) - }); -}; -var ZodUnion4 = class extends ZodType4 { - _parse(input) { - const { ctx } = this._processInputParams(input); - const options = this._def.options; - function handleResults(results) { - for (const result of results) { - if (result.result.status === "valid") { - return result.result; - } - } - for (const result of results) { - if (result.result.status === "dirty") { - ctx.common.issues.push(...result.ctx.common.issues); - return result.result; - } - } - const unionErrors = results.map((result) => new ZodError4(result.ctx.common.issues)); - addIssueToContext2(ctx, { - code: ZodIssueCode4.invalid_union, - unionErrors - }); - return INVALID2; - } - if (ctx.common.async) { - return Promise.all(options.map(async (option) => { - const childCtx = { - ...ctx, - common: { - ...ctx.common, - issues: [] - }, - parent: null - }; - return { - result: await option._parseAsync({ - data: ctx.data, - path: ctx.path, - parent: childCtx - }), - ctx: childCtx - }; - })).then(handleResults); - } else { - let dirty = void 0; - const issues = []; - for (const option of options) { - const childCtx = { - ...ctx, - common: { - ...ctx.common, - issues: [] - }, - parent: null - }; - const result = option._parseSync({ - data: ctx.data, - path: ctx.path, - parent: childCtx - }); - if (result.status === "valid") { - return result; - } else if (result.status === "dirty" && !dirty) { - dirty = { result, ctx: childCtx }; - } - if (childCtx.common.issues.length) { - issues.push(childCtx.common.issues); - } - } - if (dirty) { - ctx.common.issues.push(...dirty.ctx.common.issues); - return dirty.result; - } - const unionErrors = issues.map((issues2) => new ZodError4(issues2)); - addIssueToContext2(ctx, { - code: ZodIssueCode4.invalid_union, - unionErrors - }); - return INVALID2; - } - } - get options() { - return this._def.options; - } -}; -ZodUnion4.create = (types, params) => { - return new ZodUnion4({ - options: types, - typeName: ZodFirstPartyTypeKind3.ZodUnion, - ...processCreateParams2(params) - }); -}; -var getDiscriminator2 = (type2) => { - if (type2 instanceof ZodLazy3) { - return getDiscriminator2(type2.schema); - } else if (type2 instanceof ZodEffects2) { - return getDiscriminator2(type2.innerType()); - } else if (type2 instanceof ZodLiteral4) { - return [type2.value]; - } else if (type2 instanceof ZodEnum4) { - return type2.options; - } else if (type2 instanceof ZodNativeEnum2) { - return util2.objectValues(type2.enum); - } else if (type2 instanceof ZodDefault4) { - return getDiscriminator2(type2._def.innerType); - } else if (type2 instanceof ZodUndefined3) { - return [void 0]; - } else if (type2 instanceof ZodNull4) { - return [null]; - } else if (type2 instanceof ZodOptional4) { - return [void 0, ...getDiscriminator2(type2.unwrap())]; - } else if (type2 instanceof ZodNullable4) { - return [null, ...getDiscriminator2(type2.unwrap())]; - } else if (type2 instanceof ZodBranded2) { - return getDiscriminator2(type2.unwrap()); - } else if (type2 instanceof ZodReadonly4) { - return getDiscriminator2(type2.unwrap()); - } else if (type2 instanceof ZodCatch4) { - return getDiscriminator2(type2._def.innerType); - } else { - return []; - } -}; -var ZodDiscriminatedUnion4 = class _ZodDiscriminatedUnion extends ZodType4 { - _parse(input) { - const { ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType2.object) { - addIssueToContext2(ctx, { - code: ZodIssueCode4.invalid_type, - expected: ZodParsedType2.object, - received: ctx.parsedType - }); - return INVALID2; - } - const discriminator = this.discriminator; - const discriminatorValue = ctx.data[discriminator]; - const option = this.optionsMap.get(discriminatorValue); - if (!option) { - addIssueToContext2(ctx, { - code: ZodIssueCode4.invalid_union_discriminator, - options: Array.from(this.optionsMap.keys()), - path: [discriminator] - }); - return INVALID2; - } - if (ctx.common.async) { - return option._parseAsync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - } else { - return option._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - } - } - get discriminator() { - return this._def.discriminator; - } - get options() { - return this._def.options; - } - get optionsMap() { - return this._def.optionsMap; - } - static create(discriminator, options, params) { - const optionsMap = /* @__PURE__ */ new Map(); - for (const type2 of options) { - const discriminatorValues = getDiscriminator2(type2.shape[discriminator]); - if (!discriminatorValues.length) { - throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`); - } - for (const value2 of discriminatorValues) { - if (optionsMap.has(value2)) { - throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value2)}`); - } - optionsMap.set(value2, type2); - } - } - return new _ZodDiscriminatedUnion({ - typeName: ZodFirstPartyTypeKind3.ZodDiscriminatedUnion, - discriminator, - options, - optionsMap, - ...processCreateParams2(params) - }); - } -}; -function mergeValues4(a, b) { - const aType = getParsedType3(a); - const bType = getParsedType3(b); - if (a === b) { - return { valid: true, data: a }; - } else if (aType === ZodParsedType2.object && bType === ZodParsedType2.object) { - const bKeys = util2.objectKeys(b); - const sharedKeys = util2.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1); - const newObj = { ...a, ...b }; - for (const key of sharedKeys) { - const sharedValue = mergeValues4(a[key], b[key]); - if (!sharedValue.valid) { - return { valid: false }; - } - newObj[key] = sharedValue.data; - } - return { valid: true, data: newObj }; - } else if (aType === ZodParsedType2.array && bType === ZodParsedType2.array) { - if (a.length !== b.length) { - return { valid: false }; - } - const newArray = []; - for (let index = 0; index < a.length; index++) { - const itemA = a[index]; - const itemB = b[index]; - const sharedValue = mergeValues4(itemA, itemB); - if (!sharedValue.valid) { - return { valid: false }; - } - newArray.push(sharedValue.data); - } - return { valid: true, data: newArray }; - } else if (aType === ZodParsedType2.date && bType === ZodParsedType2.date && +a === +b) { - return { valid: true, data: a }; - } else { - return { valid: false }; - } -} -var ZodIntersection4 = class extends ZodType4 { - _parse(input) { - const { status, ctx } = this._processInputParams(input); - const handleParsed = (parsedLeft, parsedRight) => { - if (isAborted2(parsedLeft) || isAborted2(parsedRight)) { - return INVALID2; - } - const merged = mergeValues4(parsedLeft.value, parsedRight.value); - if (!merged.valid) { - addIssueToContext2(ctx, { - code: ZodIssueCode4.invalid_intersection_types - }); - return INVALID2; - } - if (isDirty2(parsedLeft) || isDirty2(parsedRight)) { - status.dirty(); - } - return { status: status.value, value: merged.data }; - }; - if (ctx.common.async) { - return Promise.all([ - this._def.left._parseAsync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }), - this._def.right._parseAsync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }) - ]).then(([left, right]) => handleParsed(left, right)); - } else { - return handleParsed(this._def.left._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }), this._def.right._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - })); - } - } -}; -ZodIntersection4.create = (left, right, params) => { - return new ZodIntersection4({ - left, - right, - typeName: ZodFirstPartyTypeKind3.ZodIntersection, - ...processCreateParams2(params) - }); -}; -var ZodTuple3 = class _ZodTuple extends ZodType4 { - _parse(input) { - const { status, ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType2.array) { - addIssueToContext2(ctx, { - code: ZodIssueCode4.invalid_type, - expected: ZodParsedType2.array, - received: ctx.parsedType - }); - return INVALID2; - } - if (ctx.data.length < this._def.items.length) { - addIssueToContext2(ctx, { - code: ZodIssueCode4.too_small, - minimum: this._def.items.length, - inclusive: true, - exact: false, - type: "array" - }); - return INVALID2; - } - const rest = this._def.rest; - if (!rest && ctx.data.length > this._def.items.length) { - addIssueToContext2(ctx, { - code: ZodIssueCode4.too_big, - maximum: this._def.items.length, - inclusive: true, - exact: false, - type: "array" - }); - status.dirty(); - } - const items = [...ctx.data].map((item, itemIndex) => { - const schema2 = this._def.items[itemIndex] || this._def.rest; - if (!schema2) - return null; - return schema2._parse(new ParseInputLazyPath2(ctx, item, ctx.path, itemIndex)); - }).filter((x) => !!x); - if (ctx.common.async) { - return Promise.all(items).then((results) => { - return ParseStatus2.mergeArray(status, results); - }); - } else { - return ParseStatus2.mergeArray(status, items); - } - } - get items() { - return this._def.items; - } - rest(rest) { - return new _ZodTuple({ - ...this._def, - rest - }); - } -}; -ZodTuple3.create = (schemas, params) => { - if (!Array.isArray(schemas)) { - throw new Error("You must pass an array of schemas to z.tuple([ ... ])"); - } - return new ZodTuple3({ - items: schemas, - typeName: ZodFirstPartyTypeKind3.ZodTuple, - rest: null, - ...processCreateParams2(params) - }); -}; -var ZodRecord4 = class _ZodRecord extends ZodType4 { - get keySchema() { - return this._def.keyType; - } - get valueSchema() { - return this._def.valueType; - } - _parse(input) { - const { status, ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType2.object) { - addIssueToContext2(ctx, { - code: ZodIssueCode4.invalid_type, - expected: ZodParsedType2.object, - received: ctx.parsedType - }); - return INVALID2; - } - const pairs = []; - const keyType = this._def.keyType; - const valueType = this._def.valueType; - for (const key in ctx.data) { - pairs.push({ - key: keyType._parse(new ParseInputLazyPath2(ctx, key, ctx.path, key)), - value: valueType._parse(new ParseInputLazyPath2(ctx, ctx.data[key], ctx.path, key)), - alwaysSet: key in ctx.data - }); - } - if (ctx.common.async) { - return ParseStatus2.mergeObjectAsync(status, pairs); - } else { - return ParseStatus2.mergeObjectSync(status, pairs); - } - } - get element() { - return this._def.valueType; - } - static create(first, second, third) { - if (second instanceof ZodType4) { - return new _ZodRecord({ - keyType: first, - valueType: second, - typeName: ZodFirstPartyTypeKind3.ZodRecord, - ...processCreateParams2(third) - }); - } - return new _ZodRecord({ - keyType: ZodString4.create(), - valueType: first, - typeName: ZodFirstPartyTypeKind3.ZodRecord, - ...processCreateParams2(second) - }); - } -}; -var ZodMap3 = class extends ZodType4 { - get keySchema() { - return this._def.keyType; - } - get valueSchema() { - return this._def.valueType; - } - _parse(input) { - const { status, ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType2.map) { - addIssueToContext2(ctx, { - code: ZodIssueCode4.invalid_type, - expected: ZodParsedType2.map, - received: ctx.parsedType - }); - return INVALID2; - } - const keyType = this._def.keyType; - const valueType = this._def.valueType; - const pairs = [...ctx.data.entries()].map(([key, value2], index) => { - return { - key: keyType._parse(new ParseInputLazyPath2(ctx, key, ctx.path, [index, "key"])), - value: valueType._parse(new ParseInputLazyPath2(ctx, value2, ctx.path, [index, "value"])) - }; - }); - if (ctx.common.async) { - const finalMap = /* @__PURE__ */ new Map(); - return Promise.resolve().then(async () => { - for (const pair of pairs) { - const key = await pair.key; - const value2 = await pair.value; - if (key.status === "aborted" || value2.status === "aborted") { - return INVALID2; - } - if (key.status === "dirty" || value2.status === "dirty") { - status.dirty(); - } - finalMap.set(key.value, value2.value); - } - return { status: status.value, value: finalMap }; - }); - } else { - const finalMap = /* @__PURE__ */ new Map(); - for (const pair of pairs) { - const key = pair.key; - const value2 = pair.value; - if (key.status === "aborted" || value2.status === "aborted") { - return INVALID2; - } - if (key.status === "dirty" || value2.status === "dirty") { - status.dirty(); - } - finalMap.set(key.value, value2.value); - } - return { status: status.value, value: finalMap }; - } - } -}; -ZodMap3.create = (keyType, valueType, params) => { - return new ZodMap3({ - valueType, - keyType, - typeName: ZodFirstPartyTypeKind3.ZodMap, - ...processCreateParams2(params) - }); -}; -var ZodSet3 = class _ZodSet extends ZodType4 { - _parse(input) { - const { status, ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType2.set) { - addIssueToContext2(ctx, { - code: ZodIssueCode4.invalid_type, - expected: ZodParsedType2.set, - received: ctx.parsedType - }); - return INVALID2; - } - const def = this._def; - if (def.minSize !== null) { - if (ctx.data.size < def.minSize.value) { - addIssueToContext2(ctx, { - code: ZodIssueCode4.too_small, - minimum: def.minSize.value, - type: "set", - inclusive: true, - exact: false, - message: def.minSize.message - }); - status.dirty(); - } - } - if (def.maxSize !== null) { - if (ctx.data.size > def.maxSize.value) { - addIssueToContext2(ctx, { - code: ZodIssueCode4.too_big, - maximum: def.maxSize.value, - type: "set", - inclusive: true, - exact: false, - message: def.maxSize.message - }); - status.dirty(); - } - } - const valueType = this._def.valueType; - function finalizeSet(elements2) { - const parsedSet = /* @__PURE__ */ new Set(); - for (const element of elements2) { - if (element.status === "aborted") - return INVALID2; - if (element.status === "dirty") - status.dirty(); - parsedSet.add(element.value); - } - return { status: status.value, value: parsedSet }; - } - const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath2(ctx, item, ctx.path, i))); - if (ctx.common.async) { - return Promise.all(elements).then((elements2) => finalizeSet(elements2)); - } else { - return finalizeSet(elements); - } - } - min(minSize, message) { - return new _ZodSet({ - ...this._def, - minSize: { value: minSize, message: errorUtil2.toString(message) } - }); - } - max(maxSize, message) { - return new _ZodSet({ - ...this._def, - maxSize: { value: maxSize, message: errorUtil2.toString(message) } - }); - } - size(size, message) { - return this.min(size, message).max(size, message); - } - nonempty(message) { - return this.min(1, message); - } -}; -ZodSet3.create = (valueType, params) => { - return new ZodSet3({ - valueType, - minSize: null, - maxSize: null, - typeName: ZodFirstPartyTypeKind3.ZodSet, - ...processCreateParams2(params) - }); -}; -var ZodFunction3 = class _ZodFunction extends ZodType4 { - constructor() { - super(...arguments); - this.validate = this.implement; - } - _parse(input) { - const { ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType2.function) { - addIssueToContext2(ctx, { - code: ZodIssueCode4.invalid_type, - expected: ZodParsedType2.function, - received: ctx.parsedType - }); - return INVALID2; - } - function makeArgsIssue(args3, error50) { - return makeIssue2({ - data: args3, - path: ctx.path, - errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap3(), en_default3].filter((x) => !!x), - issueData: { - code: ZodIssueCode4.invalid_arguments, - argumentsError: error50 - } - }); - } - function makeReturnsIssue(returns, error50) { - return makeIssue2({ - data: returns, - path: ctx.path, - errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap3(), en_default3].filter((x) => !!x), - issueData: { - code: ZodIssueCode4.invalid_return_type, - returnTypeError: error50 - } - }); - } - const params = { errorMap: ctx.common.contextualErrorMap }; - const fn2 = ctx.data; - if (this._def.returns instanceof ZodPromise3) { - const me = this; - return OK2(async function(...args3) { - const error50 = new ZodError4([]); - const parsedArgs = await me._def.args.parseAsync(args3, params).catch((e) => { - error50.addIssue(makeArgsIssue(args3, e)); - throw error50; - }); - const result = await Reflect.apply(fn2, this, parsedArgs); - const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e) => { - error50.addIssue(makeReturnsIssue(result, e)); - throw error50; - }); - return parsedReturns; - }); - } else { - const me = this; - return OK2(function(...args3) { - const parsedArgs = me._def.args.safeParse(args3, params); - if (!parsedArgs.success) { - throw new ZodError4([makeArgsIssue(args3, parsedArgs.error)]); - } - const result = Reflect.apply(fn2, this, parsedArgs.data); - const parsedReturns = me._def.returns.safeParse(result, params); - if (!parsedReturns.success) { - throw new ZodError4([makeReturnsIssue(result, parsedReturns.error)]); - } - return parsedReturns.data; - }); - } - } - parameters() { - return this._def.args; - } - returnType() { - return this._def.returns; - } - args(...items) { - return new _ZodFunction({ - ...this._def, - args: ZodTuple3.create(items).rest(ZodUnknown4.create()) - }); - } - returns(returnType) { - return new _ZodFunction({ - ...this._def, - returns: returnType - }); - } - implement(func) { - const validatedFunc = this.parse(func); - return validatedFunc; - } - strictImplement(func) { - const validatedFunc = this.parse(func); - return validatedFunc; - } - static create(args3, returns, params) { - return new _ZodFunction({ - args: args3 ? args3 : ZodTuple3.create([]).rest(ZodUnknown4.create()), - returns: returns || ZodUnknown4.create(), - typeName: ZodFirstPartyTypeKind3.ZodFunction, - ...processCreateParams2(params) - }); - } -}; -var ZodLazy3 = class extends ZodType4 { - get schema() { - return this._def.getter(); - } - _parse(input) { - const { ctx } = this._processInputParams(input); - const lazySchema = this._def.getter(); - return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx }); - } -}; -ZodLazy3.create = (getter, params) => { - return new ZodLazy3({ - getter, - typeName: ZodFirstPartyTypeKind3.ZodLazy, - ...processCreateParams2(params) - }); -}; -var ZodLiteral4 = class extends ZodType4 { - _parse(input) { - if (input.data !== this._def.value) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext2(ctx, { - received: ctx.data, - code: ZodIssueCode4.invalid_literal, - expected: this._def.value - }); - return INVALID2; - } - return { status: "valid", value: input.data }; - } - get value() { - return this._def.value; - } -}; -ZodLiteral4.create = (value2, params) => { - return new ZodLiteral4({ - value: value2, - typeName: ZodFirstPartyTypeKind3.ZodLiteral, - ...processCreateParams2(params) - }); -}; -function createZodEnum2(values, params) { - return new ZodEnum4({ - values, - typeName: ZodFirstPartyTypeKind3.ZodEnum, - ...processCreateParams2(params) - }); -} -var ZodEnum4 = class _ZodEnum extends ZodType4 { - _parse(input) { - if (typeof input.data !== "string") { - const ctx = this._getOrReturnCtx(input); - const expectedValues = this._def.values; - addIssueToContext2(ctx, { - expected: util2.joinValues(expectedValues), - received: ctx.parsedType, - code: ZodIssueCode4.invalid_type - }); - return INVALID2; - } - if (!this._cache) { - this._cache = new Set(this._def.values); - } - if (!this._cache.has(input.data)) { - const ctx = this._getOrReturnCtx(input); - const expectedValues = this._def.values; - addIssueToContext2(ctx, { - received: ctx.data, - code: ZodIssueCode4.invalid_enum_value, - options: expectedValues - }); - return INVALID2; - } - return OK2(input.data); - } - get options() { - return this._def.values; - } - get enum() { - const enumValues2 = {}; - for (const val of this._def.values) { - enumValues2[val] = val; - } - return enumValues2; - } - get Values() { - const enumValues2 = {}; - for (const val of this._def.values) { - enumValues2[val] = val; - } - return enumValues2; - } - get Enum() { - const enumValues2 = {}; - for (const val of this._def.values) { - enumValues2[val] = val; - } - return enumValues2; - } - extract(values, newDef = this._def) { - return _ZodEnum.create(values, { - ...this._def, - ...newDef - }); - } - exclude(values, newDef = this._def) { - return _ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), { - ...this._def, - ...newDef - }); - } -}; -ZodEnum4.create = createZodEnum2; -var ZodNativeEnum2 = class extends ZodType4 { - _parse(input) { - const nativeEnumValues = util2.getValidEnumValues(this._def.values); - const ctx = this._getOrReturnCtx(input); - if (ctx.parsedType !== ZodParsedType2.string && ctx.parsedType !== ZodParsedType2.number) { - const expectedValues = util2.objectValues(nativeEnumValues); - addIssueToContext2(ctx, { - expected: util2.joinValues(expectedValues), - received: ctx.parsedType, - code: ZodIssueCode4.invalid_type - }); - return INVALID2; - } - if (!this._cache) { - this._cache = new Set(util2.getValidEnumValues(this._def.values)); - } - if (!this._cache.has(input.data)) { - const expectedValues = util2.objectValues(nativeEnumValues); - addIssueToContext2(ctx, { - received: ctx.data, - code: ZodIssueCode4.invalid_enum_value, - options: expectedValues - }); - return INVALID2; - } - return OK2(input.data); - } - get enum() { - return this._def.values; - } -}; -ZodNativeEnum2.create = (values, params) => { - return new ZodNativeEnum2({ - values, - typeName: ZodFirstPartyTypeKind3.ZodNativeEnum, - ...processCreateParams2(params) - }); -}; -var ZodPromise3 = class extends ZodType4 { - unwrap() { - return this._def.type; - } - _parse(input) { - const { ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType2.promise && ctx.common.async === false) { - addIssueToContext2(ctx, { - code: ZodIssueCode4.invalid_type, - expected: ZodParsedType2.promise, - received: ctx.parsedType - }); - return INVALID2; - } - const promisified = ctx.parsedType === ZodParsedType2.promise ? ctx.data : Promise.resolve(ctx.data); - return OK2(promisified.then((data) => { - return this._def.type.parseAsync(data, { - path: ctx.path, - errorMap: ctx.common.contextualErrorMap - }); - })); - } -}; -ZodPromise3.create = (schema2, params) => { - return new ZodPromise3({ - type: schema2, - typeName: ZodFirstPartyTypeKind3.ZodPromise, - ...processCreateParams2(params) - }); -}; -var ZodEffects2 = class extends ZodType4 { - innerType() { - return this._def.schema; - } - sourceType() { - return this._def.schema._def.typeName === ZodFirstPartyTypeKind3.ZodEffects ? this._def.schema.sourceType() : this._def.schema; - } - _parse(input) { - const { status, ctx } = this._processInputParams(input); - const effect = this._def.effect || null; - const checkCtx = { - addIssue: (arg) => { - addIssueToContext2(ctx, arg); - if (arg.fatal) { - status.abort(); - } else { - status.dirty(); - } - }, - get path() { - return ctx.path; - } - }; - checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx); - if (effect.type === "preprocess") { - const processed = effect.transform(ctx.data, checkCtx); - if (ctx.common.async) { - return Promise.resolve(processed).then(async (processed2) => { - if (status.value === "aborted") - return INVALID2; - const result = await this._def.schema._parseAsync({ - data: processed2, - path: ctx.path, - parent: ctx - }); - if (result.status === "aborted") - return INVALID2; - if (result.status === "dirty") - return DIRTY2(result.value); - if (status.value === "dirty") - return DIRTY2(result.value); - return result; - }); - } else { - if (status.value === "aborted") - return INVALID2; - const result = this._def.schema._parseSync({ - data: processed, - path: ctx.path, - parent: ctx - }); - if (result.status === "aborted") - return INVALID2; - if (result.status === "dirty") - return DIRTY2(result.value); - if (status.value === "dirty") - return DIRTY2(result.value); - return result; - } - } - if (effect.type === "refinement") { - const executeRefinement = (acc) => { - const result = effect.refinement(acc, checkCtx); - if (ctx.common.async) { - return Promise.resolve(result); - } - if (result instanceof Promise) { - throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead."); - } - return acc; - }; - if (ctx.common.async === false) { - const inner = this._def.schema._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - if (inner.status === "aborted") - return INVALID2; - if (inner.status === "dirty") - status.dirty(); - executeRefinement(inner.value); - return { status: status.value, value: inner.value }; - } else { - return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((inner) => { - if (inner.status === "aborted") - return INVALID2; - if (inner.status === "dirty") - status.dirty(); - return executeRefinement(inner.value).then(() => { - return { status: status.value, value: inner.value }; - }); - }); - } - } - if (effect.type === "transform") { - if (ctx.common.async === false) { - const base = this._def.schema._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - if (!isValid2(base)) - return INVALID2; - const result = effect.transform(base.value, checkCtx); - if (result instanceof Promise) { - throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`); - } - return { status: status.value, value: result }; - } else { - return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => { - if (!isValid2(base)) - return INVALID2; - return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ - status: status.value, - value: result - })); - }); - } - } - util2.assertNever(effect); - } -}; -ZodEffects2.create = (schema2, effect, params) => { - return new ZodEffects2({ - schema: schema2, - typeName: ZodFirstPartyTypeKind3.ZodEffects, - effect, - ...processCreateParams2(params) - }); -}; -ZodEffects2.createWithPreprocess = (preprocess4, schema2, params) => { - return new ZodEffects2({ - schema: schema2, - effect: { type: "preprocess", transform: preprocess4 }, - typeName: ZodFirstPartyTypeKind3.ZodEffects, - ...processCreateParams2(params) - }); -}; -var ZodOptional4 = class extends ZodType4 { - _parse(input) { - const parsedType3 = this._getType(input); - if (parsedType3 === ZodParsedType2.undefined) { - return OK2(void 0); - } - return this._def.innerType._parse(input); - } - unwrap() { - return this._def.innerType; - } -}; -ZodOptional4.create = (type2, params) => { - return new ZodOptional4({ - innerType: type2, - typeName: ZodFirstPartyTypeKind3.ZodOptional, - ...processCreateParams2(params) - }); -}; -var ZodNullable4 = class extends ZodType4 { - _parse(input) { - const parsedType3 = this._getType(input); - if (parsedType3 === ZodParsedType2.null) { - return OK2(null); - } - return this._def.innerType._parse(input); - } - unwrap() { - return this._def.innerType; - } -}; -ZodNullable4.create = (type2, params) => { - return new ZodNullable4({ - innerType: type2, - typeName: ZodFirstPartyTypeKind3.ZodNullable, - ...processCreateParams2(params) - }); -}; -var ZodDefault4 = class extends ZodType4 { - _parse(input) { - const { ctx } = this._processInputParams(input); - let data = ctx.data; - if (ctx.parsedType === ZodParsedType2.undefined) { - data = this._def.defaultValue(); - } - return this._def.innerType._parse({ - data, - path: ctx.path, - parent: ctx - }); - } - removeDefault() { - return this._def.innerType; - } -}; -ZodDefault4.create = (type2, params) => { - return new ZodDefault4({ - innerType: type2, - typeName: ZodFirstPartyTypeKind3.ZodDefault, - defaultValue: typeof params.default === "function" ? params.default : () => params.default, - ...processCreateParams2(params) - }); -}; -var ZodCatch4 = class extends ZodType4 { - _parse(input) { - const { ctx } = this._processInputParams(input); - const newCtx = { - ...ctx, - common: { - ...ctx.common, - issues: [] - } - }; - const result = this._def.innerType._parse({ - data: newCtx.data, - path: newCtx.path, - parent: { - ...newCtx - } - }); - if (isAsync2(result)) { - return result.then((result2) => { - return { - status: "valid", - value: result2.status === "valid" ? result2.value : this._def.catchValue({ - get error() { - return new ZodError4(newCtx.common.issues); - }, - input: newCtx.data - }) - }; - }); - } else { - return { - status: "valid", - value: result.status === "valid" ? result.value : this._def.catchValue({ - get error() { - return new ZodError4(newCtx.common.issues); - }, - input: newCtx.data - }) - }; - } - } - removeCatch() { - return this._def.innerType; - } -}; -ZodCatch4.create = (type2, params) => { - return new ZodCatch4({ - innerType: type2, - typeName: ZodFirstPartyTypeKind3.ZodCatch, - catchValue: typeof params.catch === "function" ? params.catch : () => params.catch, - ...processCreateParams2(params) - }); -}; -var ZodNaN3 = class extends ZodType4 { - _parse(input) { - const parsedType3 = this._getType(input); - if (parsedType3 !== ZodParsedType2.nan) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext2(ctx, { - code: ZodIssueCode4.invalid_type, - expected: ZodParsedType2.nan, - received: ctx.parsedType - }); - return INVALID2; - } - return { status: "valid", value: input.data }; - } -}; -ZodNaN3.create = (params) => { - return new ZodNaN3({ - typeName: ZodFirstPartyTypeKind3.ZodNaN, - ...processCreateParams2(params) - }); -}; -var BRAND2 = Symbol("zod_brand"); -var ZodBranded2 = class extends ZodType4 { - _parse(input) { - const { ctx } = this._processInputParams(input); - const data = ctx.data; - return this._def.type._parse({ - data, - path: ctx.path, - parent: ctx - }); - } - unwrap() { - return this._def.type; - } -}; -var ZodPipeline2 = class _ZodPipeline extends ZodType4 { - _parse(input) { - const { status, ctx } = this._processInputParams(input); - if (ctx.common.async) { - const handleAsync = async () => { - const inResult = await this._def.in._parseAsync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - if (inResult.status === "aborted") - return INVALID2; - if (inResult.status === "dirty") { - status.dirty(); - return DIRTY2(inResult.value); - } else { - return this._def.out._parseAsync({ - data: inResult.value, - path: ctx.path, - parent: ctx - }); - } - }; - return handleAsync(); - } else { - const inResult = this._def.in._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - if (inResult.status === "aborted") - return INVALID2; - if (inResult.status === "dirty") { - status.dirty(); - return { - status: "dirty", - value: inResult.value - }; - } else { - return this._def.out._parseSync({ - data: inResult.value, - path: ctx.path, - parent: ctx - }); - } - } - } - static create(a, b) { - return new _ZodPipeline({ - in: a, - out: b, - typeName: ZodFirstPartyTypeKind3.ZodPipeline - }); - } -}; -var ZodReadonly4 = class extends ZodType4 { - _parse(input) { - const result = this._def.innerType._parse(input); - const freeze = (data) => { - if (isValid2(data)) { - data.value = Object.freeze(data.value); - } - return data; - }; - return isAsync2(result) ? result.then((data) => freeze(data)) : freeze(result); - } - unwrap() { - return this._def.innerType; - } -}; -ZodReadonly4.create = (type2, params) => { - return new ZodReadonly4({ - innerType: type2, - typeName: ZodFirstPartyTypeKind3.ZodReadonly, - ...processCreateParams2(params) - }); -}; -var late2 = { - object: ZodObject4.lazycreate -}; -var ZodFirstPartyTypeKind3; -(function(ZodFirstPartyTypeKind22) { - ZodFirstPartyTypeKind22["ZodString"] = "ZodString"; - ZodFirstPartyTypeKind22["ZodNumber"] = "ZodNumber"; - ZodFirstPartyTypeKind22["ZodNaN"] = "ZodNaN"; - ZodFirstPartyTypeKind22["ZodBigInt"] = "ZodBigInt"; - ZodFirstPartyTypeKind22["ZodBoolean"] = "ZodBoolean"; - ZodFirstPartyTypeKind22["ZodDate"] = "ZodDate"; - ZodFirstPartyTypeKind22["ZodSymbol"] = "ZodSymbol"; - ZodFirstPartyTypeKind22["ZodUndefined"] = "ZodUndefined"; - ZodFirstPartyTypeKind22["ZodNull"] = "ZodNull"; - ZodFirstPartyTypeKind22["ZodAny"] = "ZodAny"; - ZodFirstPartyTypeKind22["ZodUnknown"] = "ZodUnknown"; - ZodFirstPartyTypeKind22["ZodNever"] = "ZodNever"; - ZodFirstPartyTypeKind22["ZodVoid"] = "ZodVoid"; - ZodFirstPartyTypeKind22["ZodArray"] = "ZodArray"; - ZodFirstPartyTypeKind22["ZodObject"] = "ZodObject"; - ZodFirstPartyTypeKind22["ZodUnion"] = "ZodUnion"; - ZodFirstPartyTypeKind22["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion"; - ZodFirstPartyTypeKind22["ZodIntersection"] = "ZodIntersection"; - ZodFirstPartyTypeKind22["ZodTuple"] = "ZodTuple"; - ZodFirstPartyTypeKind22["ZodRecord"] = "ZodRecord"; - ZodFirstPartyTypeKind22["ZodMap"] = "ZodMap"; - ZodFirstPartyTypeKind22["ZodSet"] = "ZodSet"; - ZodFirstPartyTypeKind22["ZodFunction"] = "ZodFunction"; - ZodFirstPartyTypeKind22["ZodLazy"] = "ZodLazy"; - ZodFirstPartyTypeKind22["ZodLiteral"] = "ZodLiteral"; - ZodFirstPartyTypeKind22["ZodEnum"] = "ZodEnum"; - ZodFirstPartyTypeKind22["ZodEffects"] = "ZodEffects"; - ZodFirstPartyTypeKind22["ZodNativeEnum"] = "ZodNativeEnum"; - ZodFirstPartyTypeKind22["ZodOptional"] = "ZodOptional"; - ZodFirstPartyTypeKind22["ZodNullable"] = "ZodNullable"; - ZodFirstPartyTypeKind22["ZodDefault"] = "ZodDefault"; - ZodFirstPartyTypeKind22["ZodCatch"] = "ZodCatch"; - ZodFirstPartyTypeKind22["ZodPromise"] = "ZodPromise"; - ZodFirstPartyTypeKind22["ZodBranded"] = "ZodBranded"; - ZodFirstPartyTypeKind22["ZodPipeline"] = "ZodPipeline"; - ZodFirstPartyTypeKind22["ZodReadonly"] = "ZodReadonly"; -})(ZodFirstPartyTypeKind3 || (ZodFirstPartyTypeKind3 = {})); -var stringType2 = ZodString4.create; -var numberType2 = ZodNumber4.create; -var nanType2 = ZodNaN3.create; -var bigIntType2 = ZodBigInt3.create; -var booleanType2 = ZodBoolean4.create; -var dateType2 = ZodDate3.create; -var symbolType2 = ZodSymbol3.create; -var undefinedType2 = ZodUndefined3.create; -var nullType2 = ZodNull4.create; -var anyType2 = ZodAny4.create; -var unknownType2 = ZodUnknown4.create; -var neverType2 = ZodNever4.create; -var voidType2 = ZodVoid3.create; -var arrayType2 = ZodArray4.create; -var objectType2 = ZodObject4.create; -var strictObjectType2 = ZodObject4.strictCreate; -var unionType2 = ZodUnion4.create; -var discriminatedUnionType2 = ZodDiscriminatedUnion4.create; -var intersectionType2 = ZodIntersection4.create; -var tupleType2 = ZodTuple3.create; -var recordType2 = ZodRecord4.create; -var mapType2 = ZodMap3.create; -var setType2 = ZodSet3.create; -var functionType2 = ZodFunction3.create; -var lazyType2 = ZodLazy3.create; -var literalType2 = ZodLiteral4.create; -var enumType2 = ZodEnum4.create; -var nativeEnumType2 = ZodNativeEnum2.create; -var promiseType2 = ZodPromise3.create; -var effectsType2 = ZodEffects2.create; -var optionalType2 = ZodOptional4.create; -var nullableType2 = ZodNullable4.create; -var preprocessType2 = ZodEffects2.createWithPreprocess; -var pipelineType2 = ZodPipeline2.create; -var NEVER3 = Object.freeze({ - status: "aborted" -}); -function $constructor3(name, initializer5, params) { - function init(inst, def) { - var _a2; - Object.defineProperty(inst, "_zod", { - value: inst._zod ?? {}, - enumerable: false - }); - (_a2 = inst._zod).traits ?? (_a2.traits = /* @__PURE__ */ new Set()); - inst._zod.traits.add(name); - initializer5(inst, def); - for (const k in _.prototype) { - if (!(k in inst)) - Object.defineProperty(inst, k, { value: _.prototype[k].bind(inst) }); - } - inst._zod.constr = _; - inst._zod.def = def; - } - const Parent = params?.Parent ?? Object; - class Definition extends Parent { - } - Object.defineProperty(Definition, "name", { value: name }); - function _(def) { - var _a2; - const inst = params?.Parent ? new Definition() : this; - init(inst, def); - (_a2 = inst._zod).deferred ?? (_a2.deferred = []); - for (const fn2 of inst._zod.deferred) { - fn2(); - } - return inst; - } - Object.defineProperty(_, "init", { value: init }); - Object.defineProperty(_, Symbol.hasInstance, { - value: (inst) => { - if (params?.Parent && inst instanceof params.Parent) - return true; - return inst?._zod?.traits?.has(name); - } - }); - Object.defineProperty(_, "name", { value: name }); - return _; -} -var $brand2 = Symbol("zod_brand"); -var $ZodAsyncError3 = class extends Error { - constructor() { - super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`); - } -}; -var globalConfig3 = {}; -function config3(newConfig) { - if (newConfig) - Object.assign(globalConfig3, newConfig); - return globalConfig3; -} -var exports_util = {}; -__export2(exports_util, { - unwrapMessage: () => unwrapMessage3, - stringifyPrimitive: () => stringifyPrimitive2, - required: () => required3, - randomString: () => randomString2, - propertyKeyTypes: () => propertyKeyTypes3, - promiseAllObject: () => promiseAllObject2, - primitiveTypes: () => primitiveTypes2, - prefixIssues: () => prefixIssues3, - pick: () => pick3, - partial: () => partial3, - optionalKeys: () => optionalKeys3, - omit: () => omit5, - numKeys: () => numKeys2, - nullish: () => nullish4, - normalizeParams: () => normalizeParams3, - merge: () => merge4, - jsonStringifyReplacer: () => jsonStringifyReplacer3, - joinValues: () => joinValues2, - issue: () => issue3, - isPlainObject: () => isPlainObject6, - isObject: () => isObject22, - getSizableOrigin: () => getSizableOrigin2, - getParsedType: () => getParsedType22, - getLengthableOrigin: () => getLengthableOrigin3, - getEnumValues: () => getEnumValues3, - getElementAtPath: () => getElementAtPath2, - floatSafeRemainder: () => floatSafeRemainder22, - finalizeIssue: () => finalizeIssue3, - extend: () => extend3, - escapeRegex: () => escapeRegex3, - esc: () => esc3, - defineLazy: () => defineLazy3, - createTransparentProxy: () => createTransparentProxy2, - clone: () => clone3, - cleanRegex: () => cleanRegex3, - cleanEnum: () => cleanEnum2, - captureStackTrace: () => captureStackTrace3, - cached: () => cached5, - assignProp: () => assignProp3, - assertNotEqual: () => assertNotEqual2, - assertNever: () => assertNever2, - assertIs: () => assertIs2, - assertEqual: () => assertEqual2, - assert: () => assert3, - allowsEval: () => allowsEval3, - aborted: () => aborted3, - NUMBER_FORMAT_RANGES: () => NUMBER_FORMAT_RANGES3, - Class: () => Class2, - BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES2 -}); -function assertEqual2(val) { - return val; -} -function assertNotEqual2(val) { - return val; -} -function assertIs2(_arg) { -} -function assertNever2(_x) { - throw new Error(); -} -function assert3(_) { -} -function getEnumValues3(entries) { - const numericValues = Object.values(entries).filter((v) => typeof v === "number"); - const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v); - return values; -} -function joinValues2(array4, separator2 = "|") { - return array4.map((val) => stringifyPrimitive2(val)).join(separator2); -} -function jsonStringifyReplacer3(_, value2) { - if (typeof value2 === "bigint") - return value2.toString(); - return value2; -} -function cached5(getter) { - const set2 = false; - return { - get value() { - if (!set2) { - const value2 = getter(); - Object.defineProperty(this, "value", { value: value2 }); - return value2; - } - throw new Error("cached value already set"); - } - }; -} -function nullish4(input) { - return input === null || input === void 0; -} -function cleanRegex3(source) { - const start = source.startsWith("^") ? 1 : 0; - const end = source.endsWith("$") ? source.length - 1 : source.length; - return source.slice(start, end); -} -function floatSafeRemainder22(val, step) { - const valDecCount = (val.toString().split(".")[1] || "").length; - const stepDecCount = (step.toString().split(".")[1] || "").length; - const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount; - const valInt = Number.parseInt(val.toFixed(decCount).replace(".", "")); - const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", "")); - return valInt % stepInt / 10 ** decCount; -} -function defineLazy3(object5, key, getter) { - const set2 = false; - Object.defineProperty(object5, key, { - get() { - if (!set2) { - const value2 = getter(); - object5[key] = value2; - return value2; - } - throw new Error("cached value already set"); - }, - set(v) { - Object.defineProperty(object5, key, { - value: v - }); - }, - configurable: true - }); -} -function assignProp3(target, prop, value2) { - Object.defineProperty(target, prop, { - value: value2, - writable: true, - enumerable: true, - configurable: true - }); -} -function getElementAtPath2(obj, path4) { - if (!path4) - return obj; - return path4.reduce((acc, key) => acc?.[key], obj); -} -function promiseAllObject2(promisesObj) { - const keys = Object.keys(promisesObj); - const promises = keys.map((key) => promisesObj[key]); - return Promise.all(promises).then((results) => { - const resolvedObj = {}; - for (let i = 0; i < keys.length; i++) { - resolvedObj[keys[i]] = results[i]; - } - return resolvedObj; - }); -} -function randomString2(length = 10) { - const chars = "abcdefghijklmnopqrstuvwxyz"; - let str = ""; - for (let i = 0; i < length; i++) { - str += chars[Math.floor(Math.random() * chars.length)]; - } - return str; -} -function esc3(str) { - return JSON.stringify(str); -} -var captureStackTrace3 = Error.captureStackTrace ? Error.captureStackTrace : (..._args) => { -}; -function isObject22(data) { - return typeof data === "object" && data !== null && !Array.isArray(data); -} -var allowsEval3 = cached5(() => { - if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) { - return false; - } - try { - const F = Function; - new F(""); - return true; - } catch (_) { - return false; - } -}); -function isPlainObject6(o) { - if (isObject22(o) === false) - return false; - const ctor = o.constructor; - if (ctor === void 0) - return true; - const prot = ctor.prototype; - if (isObject22(prot) === false) - return false; - if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) { - return false; - } - return true; -} -function numKeys2(data) { - let keyCount = 0; - for (const key in data) { - if (Object.prototype.hasOwnProperty.call(data, key)) { - keyCount++; - } - } - return keyCount; -} -var getParsedType22 = (data) => { - const t = typeof data; - switch (t) { - case "undefined": - return "undefined"; - case "string": - return "string"; - case "number": - return Number.isNaN(data) ? "nan" : "number"; - case "boolean": - return "boolean"; - case "function": - return "function"; - case "bigint": - return "bigint"; - case "symbol": - return "symbol"; - case "object": - if (Array.isArray(data)) { - return "array"; - } - if (data === null) { - return "null"; - } - if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") { - return "promise"; - } - if (typeof Map !== "undefined" && data instanceof Map) { - return "map"; - } - if (typeof Set !== "undefined" && data instanceof Set) { - return "set"; - } - if (typeof Date !== "undefined" && data instanceof Date) { - return "date"; - } - if (typeof File !== "undefined" && data instanceof File) { - return "file"; - } - return "object"; - default: - throw new Error(`Unknown data type: ${t}`); - } -}; -var propertyKeyTypes3 = /* @__PURE__ */ new Set(["string", "number", "symbol"]); -var primitiveTypes2 = /* @__PURE__ */ new Set(["string", "number", "bigint", "boolean", "symbol", "undefined"]); -function escapeRegex3(str) { - return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); -} -function clone3(inst, def, params) { - const cl = new inst._zod.constr(def ?? inst._zod.def); - if (!def || params?.parent) - cl._zod.parent = inst; - return cl; -} -function normalizeParams3(_params) { - const params = _params; - if (!params) - return {}; - if (typeof params === "string") - return { error: () => params }; - if (params?.message !== void 0) { - if (params?.error !== void 0) - throw new Error("Cannot specify both `message` and `error` params"); - params.error = params.message; - } - delete params.message; - if (typeof params.error === "string") - return { ...params, error: () => params.error }; - return params; -} -function createTransparentProxy2(getter) { - let target; - return new Proxy({}, { - get(_, prop, receiver) { - target ?? (target = getter()); - return Reflect.get(target, prop, receiver); - }, - set(_, prop, value2, receiver) { - target ?? (target = getter()); - return Reflect.set(target, prop, value2, receiver); - }, - has(_, prop) { - target ?? (target = getter()); - return Reflect.has(target, prop); - }, - deleteProperty(_, prop) { - target ?? (target = getter()); - return Reflect.deleteProperty(target, prop); - }, - ownKeys(_) { - target ?? (target = getter()); - return Reflect.ownKeys(target); - }, - getOwnPropertyDescriptor(_, prop) { - target ?? (target = getter()); - return Reflect.getOwnPropertyDescriptor(target, prop); - }, - defineProperty(_, prop, descriptor) { - target ?? (target = getter()); - return Reflect.defineProperty(target, prop, descriptor); - } - }); -} -function stringifyPrimitive2(value2) { - if (typeof value2 === "bigint") - return value2.toString() + "n"; - if (typeof value2 === "string") - return `"${value2}"`; - return `${value2}`; -} -function optionalKeys3(shape) { - return Object.keys(shape).filter((k) => { - return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional"; - }); -} -var NUMBER_FORMAT_RANGES3 = { - safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER], - int32: [-2147483648, 2147483647], - uint32: [0, 4294967295], - float32: [-34028234663852886e22, 34028234663852886e22], - float64: [-Number.MAX_VALUE, Number.MAX_VALUE] -}; -var BIGINT_FORMAT_RANGES2 = { - int64: [/* @__PURE__ */ BigInt("-9223372036854775808"), /* @__PURE__ */ BigInt("9223372036854775807")], - uint64: [/* @__PURE__ */ BigInt(0), /* @__PURE__ */ BigInt("18446744073709551615")] -}; -function pick3(schema2, mask) { - const newShape = {}; - const currDef = schema2._zod.def; - for (const key in mask) { - if (!(key in currDef.shape)) { - throw new Error(`Unrecognized key: "${key}"`); - } - if (!mask[key]) - continue; - newShape[key] = currDef.shape[key]; - } - return clone3(schema2, { - ...schema2._zod.def, - shape: newShape, - checks: [] - }); -} -function omit5(schema2, mask) { - const newShape = { ...schema2._zod.def.shape }; - const currDef = schema2._zod.def; - for (const key in mask) { - if (!(key in currDef.shape)) { - throw new Error(`Unrecognized key: "${key}"`); - } - if (!mask[key]) - continue; - delete newShape[key]; - } - return clone3(schema2, { - ...schema2._zod.def, - shape: newShape, - checks: [] - }); -} -function extend3(schema2, shape) { - if (!isPlainObject6(shape)) { - throw new Error("Invalid input to extend: expected a plain object"); - } - const def = { - ...schema2._zod.def, - get shape() { - const _shape = { ...schema2._zod.def.shape, ...shape }; - assignProp3(this, "shape", _shape); - return _shape; - }, - checks: [] - }; - return clone3(schema2, def); -} -function merge4(a, b) { - return clone3(a, { - ...a._zod.def, - get shape() { - const _shape = { ...a._zod.def.shape, ...b._zod.def.shape }; - assignProp3(this, "shape", _shape); - return _shape; - }, - catchall: b._zod.def.catchall, - checks: [] - }); -} -function partial3(Class3, schema2, mask) { - const oldShape = schema2._zod.def.shape; - const shape = { ...oldShape }; - if (mask) { - for (const key in mask) { - if (!(key in oldShape)) { - throw new Error(`Unrecognized key: "${key}"`); - } - if (!mask[key]) - continue; - shape[key] = Class3 ? new Class3({ - type: "optional", - innerType: oldShape[key] - }) : oldShape[key]; - } - } else { - for (const key in oldShape) { - shape[key] = Class3 ? new Class3({ - type: "optional", - innerType: oldShape[key] - }) : oldShape[key]; - } - } - return clone3(schema2, { - ...schema2._zod.def, - shape, - checks: [] - }); -} -function required3(Class3, schema2, mask) { - const oldShape = schema2._zod.def.shape; - const shape = { ...oldShape }; - if (mask) { - for (const key in mask) { - if (!(key in shape)) { - throw new Error(`Unrecognized key: "${key}"`); - } - if (!mask[key]) - continue; - shape[key] = new Class3({ - type: "nonoptional", - innerType: oldShape[key] - }); - } - } else { - for (const key in oldShape) { - shape[key] = new Class3({ - type: "nonoptional", - innerType: oldShape[key] - }); - } - } - return clone3(schema2, { - ...schema2._zod.def, - shape, - checks: [] - }); -} -function aborted3(x, startIndex = 0) { - for (let i = startIndex; i < x.issues.length; i++) { - if (x.issues[i]?.continue !== true) - return true; - } - return false; -} -function prefixIssues3(path4, issues) { - return issues.map((iss) => { - var _a2; - (_a2 = iss).path ?? (_a2.path = []); - iss.path.unshift(path4); - return iss; - }); -} -function unwrapMessage3(message) { - return typeof message === "string" ? message : message?.message; -} -function finalizeIssue3(iss, ctx, config22) { - const full = { ...iss, path: iss.path ?? [] }; - if (!iss.message) { - const message = unwrapMessage3(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage3(ctx?.error?.(iss)) ?? unwrapMessage3(config22.customError?.(iss)) ?? unwrapMessage3(config22.localeError?.(iss)) ?? "Invalid input"; - full.message = message; - } - delete full.inst; - delete full.continue; - if (!ctx?.reportInput) { - delete full.input; - } - return full; -} -function getSizableOrigin2(input) { - if (input instanceof Set) - return "set"; - if (input instanceof Map) - return "map"; - if (input instanceof File) - return "file"; - return "unknown"; -} -function getLengthableOrigin3(input) { - if (Array.isArray(input)) - return "array"; - if (typeof input === "string") - return "string"; - return "unknown"; -} -function issue3(...args3) { - const [iss, input, inst] = args3; - if (typeof iss === "string") { - return { - message: iss, - code: "custom", - input, - inst - }; - } - return { ...iss }; -} -function cleanEnum2(obj) { - return Object.entries(obj).filter(([k, _]) => { - return Number.isNaN(Number.parseInt(k, 10)); - }).map((el) => el[1]); -} -var Class2 = class { - constructor(..._args) { - } -}; -var initializer4 = (inst, def) => { - inst.name = "$ZodError"; - Object.defineProperty(inst, "_zod", { - value: inst._zod, - enumerable: false - }); - Object.defineProperty(inst, "issues", { - value: def, - enumerable: false - }); - Object.defineProperty(inst, "message", { - get() { - return JSON.stringify(def, jsonStringifyReplacer3, 2); - }, - enumerable: true - }); -}; -var $ZodError3 = $constructor3("$ZodError", initializer4); -var $ZodRealError3 = $constructor3("$ZodError", initializer4, { Parent: Error }); -function flattenError4(error50, mapper = (issue22) => issue22.message) { - const fieldErrors = {}; - const formErrors = []; - for (const sub of error50.issues) { - if (sub.path.length > 0) { - fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || []; - fieldErrors[sub.path[0]].push(mapper(sub)); - } else { - formErrors.push(mapper(sub)); - } - } - return { formErrors, fieldErrors }; -} -function formatError3(error50, _mapper) { - const mapper = _mapper || function(issue22) { - return issue22.message; - }; - const fieldErrors = { _errors: [] }; - const processError = (error210) => { - for (const issue22 of error210.issues) { - if (issue22.code === "invalid_union" && issue22.errors.length) { - issue22.errors.map((issues) => processError({ issues })); - } else if (issue22.code === "invalid_key") { - processError({ issues: issue22.issues }); - } else if (issue22.code === "invalid_element") { - processError({ issues: issue22.issues }); - } else if (issue22.path.length === 0) { - fieldErrors._errors.push(mapper(issue22)); - } else { - let curr = fieldErrors; - let i = 0; - while (i < issue22.path.length) { - const el = issue22.path[i]; - const terminal = i === issue22.path.length - 1; - if (!terminal) { - curr[el] = curr[el] || { _errors: [] }; - } else { - curr[el] = curr[el] || { _errors: [] }; - curr[el]._errors.push(mapper(issue22)); - } - curr = curr[el]; - i++; - } - } - } - }; - processError(error50); - return fieldErrors; -} -var _parse3 = (_Err) => (schema2, value2, _ctx, _params) => { - const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false }; - const result = schema2._zod.run({ value: value2, issues: [] }, ctx); - if (result instanceof Promise) { - throw new $ZodAsyncError3(); - } - if (result.issues.length) { - const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue3(iss, ctx, config3()))); - captureStackTrace3(e, _params?.callee); - throw e; - } - return result.value; -}; -var _parseAsync3 = (_Err) => async (schema2, value2, _ctx, params) => { - const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true }; - let result = schema2._zod.run({ value: value2, issues: [] }, ctx); - if (result instanceof Promise) - result = await result; - if (result.issues.length) { - const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue3(iss, ctx, config3()))); - captureStackTrace3(e, params?.callee); - throw e; - } - return result.value; -}; -var _safeParse3 = (_Err) => (schema2, value2, _ctx) => { - const ctx = _ctx ? { ..._ctx, async: false } : { async: false }; - const result = schema2._zod.run({ value: value2, issues: [] }, ctx); - if (result instanceof Promise) { - throw new $ZodAsyncError3(); - } - return result.issues.length ? { - success: false, - error: new (_Err ?? $ZodError3)(result.issues.map((iss) => finalizeIssue3(iss, ctx, config3()))) - } : { success: true, data: result.value }; -}; -var safeParse5 = /* @__PURE__ */ _safeParse3($ZodRealError3); -var _safeParseAsync3 = (_Err) => async (schema2, value2, _ctx) => { - const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true }; - let result = schema2._zod.run({ value: value2, issues: [] }, ctx); - if (result instanceof Promise) - result = await result; - return result.issues.length ? { - success: false, - error: new _Err(result.issues.map((iss) => finalizeIssue3(iss, ctx, config3()))) - } : { success: true, data: result.value }; -}; -var safeParseAsync4 = /* @__PURE__ */ _safeParseAsync3($ZodRealError3); -var cuid5 = /^[cC][^\s-]{8,}$/; -var cuid24 = /^[0-9a-z]+$/; -var ulid4 = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/; -var xid4 = /^[0-9a-vA-V]{20}$/; -var ksuid4 = /^[A-Za-z0-9]{27}$/; -var nanoid4 = /^[a-zA-Z0-9_-]{21}$/; -var duration4 = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/; -var guid4 = /^([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})$/; -var uuid8 = (version4) => { - if (!version4) - return /^([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)$/; - return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version4}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`); -}; -var email5 = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/; -var _emoji4 = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`; -function emoji4() { - return new RegExp(_emoji4, "u"); -} -var ipv44 = /^(?:(?: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])$/; -var ipv64 = /^(([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})$/; -var cidrv44 = /^((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])$/; -var cidrv64 = /^(([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])$/; -var base645 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/; -var base64url4 = /^[A-Za-z0-9_-]*$/; -var hostname4 = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/; -var e1644 = /^\+(?:[0-9]){6,14}[0-9]$/; -var dateSource3 = `(?:(?:\\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])))`; -var date5 = /* @__PURE__ */ new RegExp(`^${dateSource3}$`); -function timeSource3(args3) { - const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`; - const regex4 = typeof args3.precision === "number" ? args3.precision === -1 ? `${hhmm}` : args3.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args3.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`; - return regex4; -} -function time4(args3) { - return new RegExp(`^${timeSource3(args3)}$`); -} -function datetime4(args3) { - const time23 = timeSource3({ precision: args3.precision }); - const opts = ["Z"]; - if (args3.local) - opts.push(""); - if (args3.offset) - opts.push(`([+-]\\d{2}:\\d{2})`); - const timeRegex22 = `${time23}(?:${opts.join("|")})`; - return new RegExp(`^${dateSource3}T(?:${timeRegex22})$`); -} -var string6 = (params) => { - const regex4 = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`; - return new RegExp(`^${regex4}$`); -}; -var integer4 = /^\d+$/; -var number7 = /^-?\d+(?:\.\d+)?/i; -var boolean5 = /true|false/i; -var _null5 = /null/i; -var lowercase3 = /^[^A-Z]*$/; -var uppercase3 = /^[^a-z]*$/; -var $ZodCheck3 = /* @__PURE__ */ $constructor3("$ZodCheck", (inst, def) => { - var _a2; - inst._zod ?? (inst._zod = {}); - inst._zod.def = def; - (_a2 = inst._zod).onattach ?? (_a2.onattach = []); -}); -var numericOriginMap3 = { - number: "number", - bigint: "bigint", - object: "date" -}; -var $ZodCheckLessThan3 = /* @__PURE__ */ $constructor3("$ZodCheckLessThan", (inst, def) => { - $ZodCheck3.init(inst, def); - const origin = numericOriginMap3[typeof def.value]; - inst._zod.onattach.push((inst2) => { - const bag = inst2._zod.bag; - const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY; - if (def.value < curr) { - if (def.inclusive) - bag.maximum = def.value; - else - bag.exclusiveMaximum = def.value; - } - }); - inst._zod.check = (payload) => { - if (def.inclusive ? payload.value <= def.value : payload.value < def.value) { - return; - } - payload.issues.push({ - origin, - code: "too_big", - maximum: def.value, - input: payload.value, - inclusive: def.inclusive, - inst, - continue: !def.abort - }); - }; -}); -var $ZodCheckGreaterThan3 = /* @__PURE__ */ $constructor3("$ZodCheckGreaterThan", (inst, def) => { - $ZodCheck3.init(inst, def); - const origin = numericOriginMap3[typeof def.value]; - inst._zod.onattach.push((inst2) => { - const bag = inst2._zod.bag; - const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY; - if (def.value > curr) { - if (def.inclusive) - bag.minimum = def.value; - else - bag.exclusiveMinimum = def.value; - } - }); - inst._zod.check = (payload) => { - if (def.inclusive ? payload.value >= def.value : payload.value > def.value) { - return; - } - payload.issues.push({ - origin, - code: "too_small", - minimum: def.value, - input: payload.value, - inclusive: def.inclusive, - inst, - continue: !def.abort - }); - }; -}); -var $ZodCheckMultipleOf3 = /* @__PURE__ */ $constructor3("$ZodCheckMultipleOf", (inst, def) => { - $ZodCheck3.init(inst, def); - inst._zod.onattach.push((inst2) => { - var _a2; - (_a2 = inst2._zod.bag).multipleOf ?? (_a2.multipleOf = def.value); - }); - inst._zod.check = (payload) => { - if (typeof payload.value !== typeof def.value) - throw new Error("Cannot mix number and bigint in multiple_of check."); - const isMultiple = typeof payload.value === "bigint" ? payload.value % def.value === BigInt(0) : floatSafeRemainder22(payload.value, def.value) === 0; - if (isMultiple) - return; - payload.issues.push({ - origin: typeof payload.value, - code: "not_multiple_of", - divisor: def.value, - input: payload.value, - inst, - continue: !def.abort - }); - }; -}); -var $ZodCheckNumberFormat3 = /* @__PURE__ */ $constructor3("$ZodCheckNumberFormat", (inst, def) => { - $ZodCheck3.init(inst, def); - def.format = def.format || "float64"; - const isInt = def.format?.includes("int"); - const origin = isInt ? "int" : "number"; - const [minimum, maximum] = NUMBER_FORMAT_RANGES3[def.format]; - inst._zod.onattach.push((inst2) => { - const bag = inst2._zod.bag; - bag.format = def.format; - bag.minimum = minimum; - bag.maximum = maximum; - if (isInt) - bag.pattern = integer4; - }); - inst._zod.check = (payload) => { - const input = payload.value; - if (isInt) { - if (!Number.isInteger(input)) { - payload.issues.push({ - expected: origin, - format: def.format, - code: "invalid_type", - input, - inst - }); - return; - } - if (!Number.isSafeInteger(input)) { - if (input > 0) { - payload.issues.push({ - input, - code: "too_big", - maximum: Number.MAX_SAFE_INTEGER, - note: "Integers must be within the safe integer range.", - inst, - origin, - continue: !def.abort - }); - } else { - payload.issues.push({ - input, - code: "too_small", - minimum: Number.MIN_SAFE_INTEGER, - note: "Integers must be within the safe integer range.", - inst, - origin, - continue: !def.abort - }); - } - return; - } - } - if (input < minimum) { - payload.issues.push({ - origin: "number", - input, - code: "too_small", - minimum, - inclusive: true, - inst, - continue: !def.abort - }); - } - if (input > maximum) { - payload.issues.push({ - origin: "number", - input, - code: "too_big", - maximum, - inst - }); - } - }; -}); -var $ZodCheckMaxLength3 = /* @__PURE__ */ $constructor3("$ZodCheckMaxLength", (inst, def) => { - $ZodCheck3.init(inst, def); - inst._zod.when = (payload) => { - const val = payload.value; - return !nullish4(val) && val.length !== void 0; - }; - inst._zod.onattach.push((inst2) => { - const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY; - if (def.maximum < curr) - inst2._zod.bag.maximum = def.maximum; - }); - inst._zod.check = (payload) => { - const input = payload.value; - const length = input.length; - if (length <= def.maximum) - return; - const origin = getLengthableOrigin3(input); - payload.issues.push({ - origin, - code: "too_big", - maximum: def.maximum, - inclusive: true, - input, - inst, - continue: !def.abort - }); - }; -}); -var $ZodCheckMinLength3 = /* @__PURE__ */ $constructor3("$ZodCheckMinLength", (inst, def) => { - $ZodCheck3.init(inst, def); - inst._zod.when = (payload) => { - const val = payload.value; - return !nullish4(val) && val.length !== void 0; - }; - inst._zod.onattach.push((inst2) => { - const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY; - if (def.minimum > curr) - inst2._zod.bag.minimum = def.minimum; - }); - inst._zod.check = (payload) => { - const input = payload.value; - const length = input.length; - if (length >= def.minimum) - return; - const origin = getLengthableOrigin3(input); - payload.issues.push({ - origin, - code: "too_small", - minimum: def.minimum, - inclusive: true, - input, - inst, - continue: !def.abort - }); - }; -}); -var $ZodCheckLengthEquals3 = /* @__PURE__ */ $constructor3("$ZodCheckLengthEquals", (inst, def) => { - $ZodCheck3.init(inst, def); - inst._zod.when = (payload) => { - const val = payload.value; - return !nullish4(val) && val.length !== void 0; - }; - inst._zod.onattach.push((inst2) => { - const bag = inst2._zod.bag; - bag.minimum = def.length; - bag.maximum = def.length; - bag.length = def.length; - }); - inst._zod.check = (payload) => { - const input = payload.value; - const length = input.length; - if (length === def.length) - return; - const origin = getLengthableOrigin3(input); - const tooBig = length > def.length; - payload.issues.push({ - origin, - ...tooBig ? { code: "too_big", maximum: def.length } : { code: "too_small", minimum: def.length }, - inclusive: true, - exact: true, - input: payload.value, - inst, - continue: !def.abort - }); - }; -}); -var $ZodCheckStringFormat3 = /* @__PURE__ */ $constructor3("$ZodCheckStringFormat", (inst, def) => { - var _a2, _b; - $ZodCheck3.init(inst, def); - inst._zod.onattach.push((inst2) => { - const bag = inst2._zod.bag; - bag.format = def.format; - if (def.pattern) { - bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set()); - bag.patterns.add(def.pattern); - } - }); - if (def.pattern) - (_a2 = inst._zod).check ?? (_a2.check = (payload) => { - def.pattern.lastIndex = 0; - if (def.pattern.test(payload.value)) - return; - payload.issues.push({ - origin: "string", - code: "invalid_format", - format: def.format, - input: payload.value, - ...def.pattern ? { pattern: def.pattern.toString() } : {}, - inst, - continue: !def.abort - }); - }); - else - (_b = inst._zod).check ?? (_b.check = () => { - }); -}); -var $ZodCheckRegex3 = /* @__PURE__ */ $constructor3("$ZodCheckRegex", (inst, def) => { - $ZodCheckStringFormat3.init(inst, def); - inst._zod.check = (payload) => { - def.pattern.lastIndex = 0; - if (def.pattern.test(payload.value)) - return; - payload.issues.push({ - origin: "string", - code: "invalid_format", - format: "regex", - input: payload.value, - pattern: def.pattern.toString(), - inst, - continue: !def.abort - }); - }; -}); -var $ZodCheckLowerCase3 = /* @__PURE__ */ $constructor3("$ZodCheckLowerCase", (inst, def) => { - def.pattern ?? (def.pattern = lowercase3); - $ZodCheckStringFormat3.init(inst, def); -}); -var $ZodCheckUpperCase3 = /* @__PURE__ */ $constructor3("$ZodCheckUpperCase", (inst, def) => { - def.pattern ?? (def.pattern = uppercase3); - $ZodCheckStringFormat3.init(inst, def); -}); -var $ZodCheckIncludes3 = /* @__PURE__ */ $constructor3("$ZodCheckIncludes", (inst, def) => { - $ZodCheck3.init(inst, def); - const escapedRegex = escapeRegex3(def.includes); - const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex); - def.pattern = pattern; - inst._zod.onattach.push((inst2) => { - const bag = inst2._zod.bag; - bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set()); - bag.patterns.add(pattern); - }); - inst._zod.check = (payload) => { - if (payload.value.includes(def.includes, def.position)) - return; - payload.issues.push({ - origin: "string", - code: "invalid_format", - format: "includes", - includes: def.includes, - input: payload.value, - inst, - continue: !def.abort - }); - }; -}); -var $ZodCheckStartsWith3 = /* @__PURE__ */ $constructor3("$ZodCheckStartsWith", (inst, def) => { - $ZodCheck3.init(inst, def); - const pattern = new RegExp(`^${escapeRegex3(def.prefix)}.*`); - def.pattern ?? (def.pattern = pattern); - inst._zod.onattach.push((inst2) => { - const bag = inst2._zod.bag; - bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set()); - bag.patterns.add(pattern); - }); - inst._zod.check = (payload) => { - if (payload.value.startsWith(def.prefix)) - return; - payload.issues.push({ - origin: "string", - code: "invalid_format", - format: "starts_with", - prefix: def.prefix, - input: payload.value, - inst, - continue: !def.abort - }); - }; -}); -var $ZodCheckEndsWith3 = /* @__PURE__ */ $constructor3("$ZodCheckEndsWith", (inst, def) => { - $ZodCheck3.init(inst, def); - const pattern = new RegExp(`.*${escapeRegex3(def.suffix)}$`); - def.pattern ?? (def.pattern = pattern); - inst._zod.onattach.push((inst2) => { - const bag = inst2._zod.bag; - bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set()); - bag.patterns.add(pattern); - }); - inst._zod.check = (payload) => { - if (payload.value.endsWith(def.suffix)) - return; - payload.issues.push({ - origin: "string", - code: "invalid_format", - format: "ends_with", - suffix: def.suffix, - input: payload.value, - inst, - continue: !def.abort - }); - }; -}); -var $ZodCheckOverwrite3 = /* @__PURE__ */ $constructor3("$ZodCheckOverwrite", (inst, def) => { - $ZodCheck3.init(inst, def); - inst._zod.check = (payload) => { - payload.value = def.tx(payload.value); - }; -}); -var Doc3 = class { - constructor(args3 = []) { - this.content = []; - this.indent = 0; - if (this) - this.args = args3; - } - indented(fn2) { - this.indent += 1; - fn2(this); - this.indent -= 1; - } - write(arg) { - if (typeof arg === "function") { - arg(this, { execution: "sync" }); - arg(this, { execution: "async" }); - return; - } - const content = arg; - const lines = content.split(` -`).filter((x) => x); - const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length)); - const dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x); - for (const line of dedented) { - this.content.push(line); - } - } - compile() { - const F = Function; - const args3 = this?.args; - const content = this?.content ?? [``]; - const lines = [...content.map((x) => ` ${x}`)]; - return new F(...args3, lines.join(` -`)); - } -}; -var version3 = { - major: 4, - minor: 0, - patch: 0 -}; -var $ZodType3 = /* @__PURE__ */ $constructor3("$ZodType", (inst, def) => { - var _a2; - inst ?? (inst = {}); - inst._zod.def = def; - inst._zod.bag = inst._zod.bag || {}; - inst._zod.version = version3; - const checks = [...inst._zod.def.checks ?? []]; - if (inst._zod.traits.has("$ZodCheck")) { - checks.unshift(inst); - } - for (const ch of checks) { - for (const fn2 of ch._zod.onattach) { - fn2(inst); - } - } - if (checks.length === 0) { - (_a2 = inst._zod).deferred ?? (_a2.deferred = []); - inst._zod.deferred?.push(() => { - inst._zod.run = inst._zod.parse; - }); - } else { - const runChecks = (payload, checks2, ctx) => { - let isAborted22 = aborted3(payload); - let asyncResult; - for (const ch of checks2) { - if (ch._zod.when) { - const shouldRun = ch._zod.when(payload); - if (!shouldRun) - continue; - } else if (isAborted22) { - continue; - } - const currLen = payload.issues.length; - const _ = ch._zod.check(payload); - if (_ instanceof Promise && ctx?.async === false) { - throw new $ZodAsyncError3(); - } - if (asyncResult || _ instanceof Promise) { - asyncResult = (asyncResult ?? Promise.resolve()).then(async () => { - await _; - const nextLen = payload.issues.length; - if (nextLen === currLen) - return; - if (!isAborted22) - isAborted22 = aborted3(payload, currLen); - }); - } else { - const nextLen = payload.issues.length; - if (nextLen === currLen) - continue; - if (!isAborted22) - isAborted22 = aborted3(payload, currLen); - } - } - if (asyncResult) { - return asyncResult.then(() => { - return payload; - }); - } - return payload; - }; - inst._zod.run = (payload, ctx) => { - const result = inst._zod.parse(payload, ctx); - if (result instanceof Promise) { - if (ctx.async === false) - throw new $ZodAsyncError3(); - return result.then((result2) => runChecks(result2, checks, ctx)); - } - return runChecks(result, checks, ctx); - }; - } - inst["~standard"] = { - validate: (value2) => { - try { - const r = safeParse5(inst, value2); - return r.success ? { value: r.data } : { issues: r.error?.issues }; - } catch (_) { - return safeParseAsync4(inst, value2).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues }); - } - }, - vendor: "zod", - version: 1 - }; -}); -var $ZodString3 = /* @__PURE__ */ $constructor3("$ZodString", (inst, def) => { - $ZodType3.init(inst, def); - inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string6(inst._zod.bag); - inst._zod.parse = (payload, _) => { - if (def.coerce) - try { - payload.value = String(payload.value); - } catch (_2) { - } - if (typeof payload.value === "string") - return payload; - payload.issues.push({ - expected: "string", - code: "invalid_type", - input: payload.value, - inst - }); - return payload; - }; -}); -var $ZodStringFormat3 = /* @__PURE__ */ $constructor3("$ZodStringFormat", (inst, def) => { - $ZodCheckStringFormat3.init(inst, def); - $ZodString3.init(inst, def); -}); -var $ZodGUID3 = /* @__PURE__ */ $constructor3("$ZodGUID", (inst, def) => { - def.pattern ?? (def.pattern = guid4); - $ZodStringFormat3.init(inst, def); -}); -var $ZodUUID3 = /* @__PURE__ */ $constructor3("$ZodUUID", (inst, def) => { - if (def.version) { - const versionMap = { - v1: 1, - v2: 2, - v3: 3, - v4: 4, - v5: 5, - v6: 6, - v7: 7, - v8: 8 - }; - const v = versionMap[def.version]; - if (v === void 0) - throw new Error(`Invalid UUID version: "${def.version}"`); - def.pattern ?? (def.pattern = uuid8(v)); - } else - def.pattern ?? (def.pattern = uuid8()); - $ZodStringFormat3.init(inst, def); -}); -var $ZodEmail3 = /* @__PURE__ */ $constructor3("$ZodEmail", (inst, def) => { - def.pattern ?? (def.pattern = email5); - $ZodStringFormat3.init(inst, def); -}); -var $ZodURL3 = /* @__PURE__ */ $constructor3("$ZodURL", (inst, def) => { - $ZodStringFormat3.init(inst, def); - inst._zod.check = (payload) => { - try { - const orig = payload.value; - const url4 = new URL(orig); - const href = url4.href; - if (def.hostname) { - def.hostname.lastIndex = 0; - if (!def.hostname.test(url4.hostname)) { - payload.issues.push({ - code: "invalid_format", - format: "url", - note: "Invalid hostname", - pattern: hostname4.source, - input: payload.value, - inst, - continue: !def.abort - }); - } - } - if (def.protocol) { - def.protocol.lastIndex = 0; - if (!def.protocol.test(url4.protocol.endsWith(":") ? url4.protocol.slice(0, -1) : url4.protocol)) { - payload.issues.push({ - code: "invalid_format", - format: "url", - note: "Invalid protocol", - pattern: def.protocol.source, - input: payload.value, - inst, - continue: !def.abort - }); - } - } - if (!orig.endsWith("/") && href.endsWith("/")) { - payload.value = href.slice(0, -1); - } else { - payload.value = href; - } - return; - } catch (_) { - payload.issues.push({ - code: "invalid_format", - format: "url", - input: payload.value, - inst, - continue: !def.abort - }); - } - }; -}); -var $ZodEmoji3 = /* @__PURE__ */ $constructor3("$ZodEmoji", (inst, def) => { - def.pattern ?? (def.pattern = emoji4()); - $ZodStringFormat3.init(inst, def); -}); -var $ZodNanoID3 = /* @__PURE__ */ $constructor3("$ZodNanoID", (inst, def) => { - def.pattern ?? (def.pattern = nanoid4); - $ZodStringFormat3.init(inst, def); -}); -var $ZodCUID4 = /* @__PURE__ */ $constructor3("$ZodCUID", (inst, def) => { - def.pattern ?? (def.pattern = cuid5); - $ZodStringFormat3.init(inst, def); -}); -var $ZodCUID23 = /* @__PURE__ */ $constructor3("$ZodCUID2", (inst, def) => { - def.pattern ?? (def.pattern = cuid24); - $ZodStringFormat3.init(inst, def); -}); -var $ZodULID3 = /* @__PURE__ */ $constructor3("$ZodULID", (inst, def) => { - def.pattern ?? (def.pattern = ulid4); - $ZodStringFormat3.init(inst, def); -}); -var $ZodXID3 = /* @__PURE__ */ $constructor3("$ZodXID", (inst, def) => { - def.pattern ?? (def.pattern = xid4); - $ZodStringFormat3.init(inst, def); -}); -var $ZodKSUID3 = /* @__PURE__ */ $constructor3("$ZodKSUID", (inst, def) => { - def.pattern ?? (def.pattern = ksuid4); - $ZodStringFormat3.init(inst, def); -}); -var $ZodISODateTime3 = /* @__PURE__ */ $constructor3("$ZodISODateTime", (inst, def) => { - def.pattern ?? (def.pattern = datetime4(def)); - $ZodStringFormat3.init(inst, def); -}); -var $ZodISODate3 = /* @__PURE__ */ $constructor3("$ZodISODate", (inst, def) => { - def.pattern ?? (def.pattern = date5); - $ZodStringFormat3.init(inst, def); -}); -var $ZodISOTime3 = /* @__PURE__ */ $constructor3("$ZodISOTime", (inst, def) => { - def.pattern ?? (def.pattern = time4(def)); - $ZodStringFormat3.init(inst, def); -}); -var $ZodISODuration3 = /* @__PURE__ */ $constructor3("$ZodISODuration", (inst, def) => { - def.pattern ?? (def.pattern = duration4); - $ZodStringFormat3.init(inst, def); -}); -var $ZodIPv43 = /* @__PURE__ */ $constructor3("$ZodIPv4", (inst, def) => { - def.pattern ?? (def.pattern = ipv44); - $ZodStringFormat3.init(inst, def); - inst._zod.onattach.push((inst2) => { - const bag = inst2._zod.bag; - bag.format = `ipv4`; - }); -}); -var $ZodIPv63 = /* @__PURE__ */ $constructor3("$ZodIPv6", (inst, def) => { - def.pattern ?? (def.pattern = ipv64); - $ZodStringFormat3.init(inst, def); - inst._zod.onattach.push((inst2) => { - const bag = inst2._zod.bag; - bag.format = `ipv6`; - }); - inst._zod.check = (payload) => { - try { - new URL(`http://[${payload.value}]`); - } catch { - payload.issues.push({ - code: "invalid_format", - format: "ipv6", - input: payload.value, - inst, - continue: !def.abort - }); - } - }; -}); -var $ZodCIDRv43 = /* @__PURE__ */ $constructor3("$ZodCIDRv4", (inst, def) => { - def.pattern ?? (def.pattern = cidrv44); - $ZodStringFormat3.init(inst, def); -}); -var $ZodCIDRv63 = /* @__PURE__ */ $constructor3("$ZodCIDRv6", (inst, def) => { - def.pattern ?? (def.pattern = cidrv64); - $ZodStringFormat3.init(inst, def); - inst._zod.check = (payload) => { - const [address, prefix] = payload.value.split("/"); - try { - if (!prefix) - throw new Error(); - const prefixNum = Number(prefix); - if (`${prefixNum}` !== prefix) - throw new Error(); - if (prefixNum < 0 || prefixNum > 128) - throw new Error(); - new URL(`http://[${address}]`); - } catch { - payload.issues.push({ - code: "invalid_format", - format: "cidrv6", - input: payload.value, - inst, - continue: !def.abort - }); - } - }; -}); -function isValidBase643(data) { - if (data === "") - return true; - if (data.length % 4 !== 0) - return false; - try { - atob(data); - return true; - } catch { - return false; - } -} -var $ZodBase643 = /* @__PURE__ */ $constructor3("$ZodBase64", (inst, def) => { - def.pattern ?? (def.pattern = base645); - $ZodStringFormat3.init(inst, def); - inst._zod.onattach.push((inst2) => { - inst2._zod.bag.contentEncoding = "base64"; - }); - inst._zod.check = (payload) => { - if (isValidBase643(payload.value)) - return; - payload.issues.push({ - code: "invalid_format", - format: "base64", - input: payload.value, - inst, - continue: !def.abort - }); - }; -}); -function isValidBase64URL3(data) { - if (!base64url4.test(data)) - return false; - const base6422 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/"); - const padded = base6422.padEnd(Math.ceil(base6422.length / 4) * 4, "="); - return isValidBase643(padded); -} -var $ZodBase64URL3 = /* @__PURE__ */ $constructor3("$ZodBase64URL", (inst, def) => { - def.pattern ?? (def.pattern = base64url4); - $ZodStringFormat3.init(inst, def); - inst._zod.onattach.push((inst2) => { - inst2._zod.bag.contentEncoding = "base64url"; - }); - inst._zod.check = (payload) => { - if (isValidBase64URL3(payload.value)) - return; - payload.issues.push({ - code: "invalid_format", - format: "base64url", - input: payload.value, - inst, - continue: !def.abort - }); - }; -}); -var $ZodE1643 = /* @__PURE__ */ $constructor3("$ZodE164", (inst, def) => { - def.pattern ?? (def.pattern = e1644); - $ZodStringFormat3.init(inst, def); -}); -function isValidJWT22(token, algorithm = null) { - try { - const tokensParts = token.split("."); - if (tokensParts.length !== 3) - return false; - const [header] = tokensParts; - if (!header) - return false; - const parsedHeader = JSON.parse(atob(header)); - if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT") - return false; - if (!parsedHeader.alg) - return false; - if (algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm)) - return false; - return true; - } catch { - return false; - } -} -var $ZodJWT3 = /* @__PURE__ */ $constructor3("$ZodJWT", (inst, def) => { - $ZodStringFormat3.init(inst, def); - inst._zod.check = (payload) => { - if (isValidJWT22(payload.value, def.alg)) - return; - payload.issues.push({ - code: "invalid_format", - format: "jwt", - input: payload.value, - inst, - continue: !def.abort - }); - }; -}); -var $ZodNumber3 = /* @__PURE__ */ $constructor3("$ZodNumber", (inst, def) => { - $ZodType3.init(inst, def); - inst._zod.pattern = inst._zod.bag.pattern ?? number7; - inst._zod.parse = (payload, _ctx) => { - if (def.coerce) - try { - payload.value = Number(payload.value); - } catch (_) { - } - const input = payload.value; - if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) { - return payload; - } - const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? "Infinity" : void 0 : void 0; - payload.issues.push({ - expected: "number", - code: "invalid_type", - input, - inst, - ...received ? { received } : {} - }); - return payload; - }; -}); -var $ZodNumberFormat3 = /* @__PURE__ */ $constructor3("$ZodNumber", (inst, def) => { - $ZodCheckNumberFormat3.init(inst, def); - $ZodNumber3.init(inst, def); -}); -var $ZodBoolean3 = /* @__PURE__ */ $constructor3("$ZodBoolean", (inst, def) => { - $ZodType3.init(inst, def); - inst._zod.pattern = boolean5; - inst._zod.parse = (payload, _ctx) => { - if (def.coerce) - try { - payload.value = Boolean(payload.value); - } catch (_) { - } - const input = payload.value; - if (typeof input === "boolean") - return payload; - payload.issues.push({ - expected: "boolean", - code: "invalid_type", - input, - inst - }); - return payload; - }; -}); -var $ZodNull3 = /* @__PURE__ */ $constructor3("$ZodNull", (inst, def) => { - $ZodType3.init(inst, def); - inst._zod.pattern = _null5; - inst._zod.values = /* @__PURE__ */ new Set([null]); - inst._zod.parse = (payload, _ctx) => { - const input = payload.value; - if (input === null) - return payload; - payload.issues.push({ - expected: "null", - code: "invalid_type", - input, - inst - }); - return payload; - }; -}); -var $ZodUnknown3 = /* @__PURE__ */ $constructor3("$ZodUnknown", (inst, def) => { - $ZodType3.init(inst, def); - inst._zod.parse = (payload) => payload; -}); -var $ZodNever3 = /* @__PURE__ */ $constructor3("$ZodNever", (inst, def) => { - $ZodType3.init(inst, def); - inst._zod.parse = (payload, _ctx) => { - payload.issues.push({ - expected: "never", - code: "invalid_type", - input: payload.value, - inst - }); - return payload; - }; -}); -function handleArrayResult3(result, final, index) { - if (result.issues.length) { - final.issues.push(...prefixIssues3(index, result.issues)); - } - final.value[index] = result.value; -} -var $ZodArray3 = /* @__PURE__ */ $constructor3("$ZodArray", (inst, def) => { - $ZodType3.init(inst, def); - inst._zod.parse = (payload, ctx) => { - const input = payload.value; - if (!Array.isArray(input)) { - payload.issues.push({ - expected: "array", - code: "invalid_type", - input, - inst - }); - return payload; - } - payload.value = Array(input.length); - const proms = []; - for (let i = 0; i < input.length; i++) { - const item = input[i]; - const result = def.element._zod.run({ - value: item, - issues: [] - }, ctx); - if (result instanceof Promise) { - proms.push(result.then((result2) => handleArrayResult3(result2, payload, i))); - } else { - handleArrayResult3(result, payload, i); - } - } - if (proms.length) { - return Promise.all(proms).then(() => payload); - } - return payload; - }; -}); -function handleObjectResult2(result, final, key) { - if (result.issues.length) { - final.issues.push(...prefixIssues3(key, result.issues)); - } - final.value[key] = result.value; -} -function handleOptionalObjectResult2(result, final, key, input) { - if (result.issues.length) { - if (input[key] === void 0) { - if (key in input) { - final.value[key] = void 0; - } else { - final.value[key] = result.value; - } - } else { - final.issues.push(...prefixIssues3(key, result.issues)); - } - } else if (result.value === void 0) { - if (key in input) - final.value[key] = void 0; - } else { - final.value[key] = result.value; - } -} -var $ZodObject3 = /* @__PURE__ */ $constructor3("$ZodObject", (inst, def) => { - $ZodType3.init(inst, def); - const _normalized = cached5(() => { - const keys = Object.keys(def.shape); - for (const k of keys) { - if (!(def.shape[k] instanceof $ZodType3)) { - throw new Error(`Invalid element at key "${k}": expected a Zod schema`); - } - } - const okeys = optionalKeys3(def.shape); - return { - shape: def.shape, - keys, - keySet: new Set(keys), - numKeys: keys.length, - optionalKeys: new Set(okeys) - }; - }); - defineLazy3(inst._zod, "propValues", () => { - const shape = def.shape; - const propValues = {}; - for (const key in shape) { - const field = shape[key]._zod; - if (field.values) { - propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set()); - for (const v of field.values) - propValues[key].add(v); - } - } - return propValues; - }); - const generateFastpass = (shape) => { - const doc = new Doc3(["shape", "payload", "ctx"]); - const normalized = _normalized.value; - const parseStr = (key) => { - const k = esc3(key); - return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`; - }; - doc.write(`const input = payload.value;`); - const ids = /* @__PURE__ */ Object.create(null); - let counter = 0; - for (const key of normalized.keys) { - ids[key] = `key_${counter++}`; - } - doc.write(`const newResult = {}`); - for (const key of normalized.keys) { - if (normalized.optionalKeys.has(key)) { - const id = ids[key]; - doc.write(`const ${id} = ${parseStr(key)};`); - const k = esc3(key); - doc.write(` - if (${id}.issues.length) { - if (input[${k}] === undefined) { - if (${k} in input) { - newResult[${k}] = undefined; - } - } else { - payload.issues = payload.issues.concat( - ${id}.issues.map((iss) => ({ - ...iss, - path: iss.path ? [${k}, ...iss.path] : [${k}], - })) - ); - } - } else if (${id}.value === undefined) { - if (${k} in input) newResult[${k}] = undefined; - } else { - newResult[${k}] = ${id}.value; - } - `); - } else { - const id = ids[key]; - doc.write(`const ${id} = ${parseStr(key)};`); - doc.write(` - if (${id}.issues.length) payload.issues = payload.issues.concat(${id}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${esc3(key)}, ...iss.path] : [${esc3(key)}] - })));`); - doc.write(`newResult[${esc3(key)}] = ${id}.value`); - } - } - doc.write(`payload.value = newResult;`); - doc.write(`return payload;`); - const fn2 = doc.compile(); - return (payload, ctx) => fn2(shape, payload, ctx); - }; - let fastpass; - const isObject32 = isObject22; - const jit = !globalConfig3.jitless; - const allowsEval22 = allowsEval3; - const fastEnabled = jit && allowsEval22.value; - const catchall = def.catchall; - let value2; - inst._zod.parse = (payload, ctx) => { - value2 ?? (value2 = _normalized.value); - const input = payload.value; - if (!isObject32(input)) { - payload.issues.push({ - expected: "object", - code: "invalid_type", - input, - inst - }); - return payload; - } - const proms = []; - if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) { - if (!fastpass) - fastpass = generateFastpass(def.shape); - payload = fastpass(payload, ctx); - } else { - payload.value = {}; - const shape = value2.shape; - for (const key of value2.keys) { - const el = shape[key]; - const r = el._zod.run({ value: input[key], issues: [] }, ctx); - const isOptional = el._zod.optin === "optional" && el._zod.optout === "optional"; - if (r instanceof Promise) { - proms.push(r.then((r2) => isOptional ? handleOptionalObjectResult2(r2, payload, key, input) : handleObjectResult2(r2, payload, key))); - } else if (isOptional) { - handleOptionalObjectResult2(r, payload, key, input); - } else { - handleObjectResult2(r, payload, key); - } - } - } - if (!catchall) { - return proms.length ? Promise.all(proms).then(() => payload) : payload; - } - const unrecognized = []; - const keySet = value2.keySet; - const _catchall = catchall._zod; - const t = _catchall.def.type; - for (const key of Object.keys(input)) { - if (keySet.has(key)) - continue; - if (t === "never") { - unrecognized.push(key); - continue; - } - const r = _catchall.run({ value: input[key], issues: [] }, ctx); - if (r instanceof Promise) { - proms.push(r.then((r2) => handleObjectResult2(r2, payload, key))); - } else { - handleObjectResult2(r, payload, key); - } - } - if (unrecognized.length) { - payload.issues.push({ - code: "unrecognized_keys", - keys: unrecognized, - input, - inst - }); - } - if (!proms.length) - return payload; - return Promise.all(proms).then(() => { - return payload; - }); - }; -}); -function handleUnionResults3(results, final, inst, ctx) { - for (const result of results) { - if (result.issues.length === 0) { - final.value = result.value; - return final; - } - } - final.issues.push({ - code: "invalid_union", - input: final.value, - inst, - errors: results.map((result) => result.issues.map((iss) => finalizeIssue3(iss, ctx, config3()))) - }); - return final; -} -var $ZodUnion3 = /* @__PURE__ */ $constructor3("$ZodUnion", (inst, def) => { - $ZodType3.init(inst, def); - defineLazy3(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0); - defineLazy3(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0); - defineLazy3(inst._zod, "values", () => { - if (def.options.every((o) => o._zod.values)) { - return new Set(def.options.flatMap((option) => Array.from(option._zod.values))); - } - return; - }); - defineLazy3(inst._zod, "pattern", () => { - if (def.options.every((o) => o._zod.pattern)) { - const patterns = def.options.map((o) => o._zod.pattern); - return new RegExp(`^(${patterns.map((p) => cleanRegex3(p.source)).join("|")})$`); - } - return; - }); - inst._zod.parse = (payload, ctx) => { - let async = false; - const results = []; - for (const option of def.options) { - const result = option._zod.run({ - value: payload.value, - issues: [] - }, ctx); - if (result instanceof Promise) { - results.push(result); - async = true; - } else { - if (result.issues.length === 0) - return result; - results.push(result); - } - } - if (!async) - return handleUnionResults3(results, payload, inst, ctx); - return Promise.all(results).then((results2) => { - return handleUnionResults3(results2, payload, inst, ctx); - }); - }; -}); -var $ZodDiscriminatedUnion3 = /* @__PURE__ */ $constructor3("$ZodDiscriminatedUnion", (inst, def) => { - $ZodUnion3.init(inst, def); - const _super = inst._zod.parse; - defineLazy3(inst._zod, "propValues", () => { - const propValues = {}; - for (const option of def.options) { - const pv = option._zod.propValues; - if (!pv || Object.keys(pv).length === 0) - throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`); - for (const [k, v] of Object.entries(pv)) { - if (!propValues[k]) - propValues[k] = /* @__PURE__ */ new Set(); - for (const val of v) { - propValues[k].add(val); - } - } - } - return propValues; - }); - const disc = cached5(() => { - const opts = def.options; - const map2 = /* @__PURE__ */ new Map(); - for (const o of opts) { - const values = o._zod.propValues[def.discriminator]; - if (!values || values.size === 0) - throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`); - for (const v of values) { - if (map2.has(v)) { - throw new Error(`Duplicate discriminator value "${String(v)}"`); - } - map2.set(v, o); - } - } - return map2; - }); - inst._zod.parse = (payload, ctx) => { - const input = payload.value; - if (!isObject22(input)) { - payload.issues.push({ - code: "invalid_type", - expected: "object", - input, - inst - }); - return payload; - } - const opt = disc.value.get(input?.[def.discriminator]); - if (opt) { - return opt._zod.run(payload, ctx); - } - if (def.unionFallback) { - return _super(payload, ctx); - } - payload.issues.push({ - code: "invalid_union", - errors: [], - note: "No matching discriminator", - input, - path: [def.discriminator], - inst - }); - return payload; - }; -}); -var $ZodIntersection3 = /* @__PURE__ */ $constructor3("$ZodIntersection", (inst, def) => { - $ZodType3.init(inst, def); - inst._zod.parse = (payload, ctx) => { - const input = payload.value; - const left = def.left._zod.run({ value: input, issues: [] }, ctx); - const right = def.right._zod.run({ value: input, issues: [] }, ctx); - const async = left instanceof Promise || right instanceof Promise; - if (async) { - return Promise.all([left, right]).then(([left2, right2]) => { - return handleIntersectionResults3(payload, left2, right2); - }); - } - return handleIntersectionResults3(payload, left, right); - }; -}); -function mergeValues22(a, b) { - if (a === b) { - return { valid: true, data: a }; - } - if (a instanceof Date && b instanceof Date && +a === +b) { - return { valid: true, data: a }; - } - if (isPlainObject6(a) && isPlainObject6(b)) { - const bKeys = Object.keys(b); - const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1); - const newObj = { ...a, ...b }; - for (const key of sharedKeys) { - const sharedValue = mergeValues22(a[key], b[key]); - if (!sharedValue.valid) { - return { - valid: false, - mergeErrorPath: [key, ...sharedValue.mergeErrorPath] - }; - } - newObj[key] = sharedValue.data; - } - return { valid: true, data: newObj }; - } - if (Array.isArray(a) && Array.isArray(b)) { - if (a.length !== b.length) { - return { valid: false, mergeErrorPath: [] }; - } - const newArray = []; - for (let index = 0; index < a.length; index++) { - const itemA = a[index]; - const itemB = b[index]; - const sharedValue = mergeValues22(itemA, itemB); - if (!sharedValue.valid) { - return { - valid: false, - mergeErrorPath: [index, ...sharedValue.mergeErrorPath] - }; - } - newArray.push(sharedValue.data); - } - return { valid: true, data: newArray }; - } - return { valid: false, mergeErrorPath: [] }; -} -function handleIntersectionResults3(result, left, right) { - if (left.issues.length) { - result.issues.push(...left.issues); - } - if (right.issues.length) { - result.issues.push(...right.issues); - } - if (aborted3(result)) - return result; - const merged = mergeValues22(left.value, right.value); - if (!merged.valid) { - throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`); - } - result.value = merged.data; - return result; -} -var $ZodRecord3 = /* @__PURE__ */ $constructor3("$ZodRecord", (inst, def) => { - $ZodType3.init(inst, def); - inst._zod.parse = (payload, ctx) => { - const input = payload.value; - if (!isPlainObject6(input)) { - payload.issues.push({ - expected: "record", - code: "invalid_type", - input, - inst - }); - return payload; - } - const proms = []; - if (def.keyType._zod.values) { - const values = def.keyType._zod.values; - payload.value = {}; - for (const key of values) { - if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") { - const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx); - if (result instanceof Promise) { - proms.push(result.then((result2) => { - if (result2.issues.length) { - payload.issues.push(...prefixIssues3(key, result2.issues)); - } - payload.value[key] = result2.value; - })); - } else { - if (result.issues.length) { - payload.issues.push(...prefixIssues3(key, result.issues)); - } - payload.value[key] = result.value; - } - } - } - let unrecognized; - for (const key in input) { - if (!values.has(key)) { - unrecognized = unrecognized ?? []; - unrecognized.push(key); - } - } - if (unrecognized && unrecognized.length > 0) { - payload.issues.push({ - code: "unrecognized_keys", - input, - inst, - keys: unrecognized - }); - } - } else { - payload.value = {}; - for (const key of Reflect.ownKeys(input)) { - if (key === "__proto__") - continue; - const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx); - if (keyResult instanceof Promise) { - throw new Error("Async schemas not supported in object keys currently"); - } - if (keyResult.issues.length) { - payload.issues.push({ - origin: "record", - code: "invalid_key", - issues: keyResult.issues.map((iss) => finalizeIssue3(iss, ctx, config3())), - input: key, - path: [key], - inst - }); - payload.value[keyResult.value] = keyResult.value; - continue; - } - const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx); - if (result instanceof Promise) { - proms.push(result.then((result2) => { - if (result2.issues.length) { - payload.issues.push(...prefixIssues3(key, result2.issues)); - } - payload.value[keyResult.value] = result2.value; - })); - } else { - if (result.issues.length) { - payload.issues.push(...prefixIssues3(key, result.issues)); - } - payload.value[keyResult.value] = result.value; - } - } - } - if (proms.length) { - return Promise.all(proms).then(() => payload); - } - return payload; - }; -}); -var $ZodEnum3 = /* @__PURE__ */ $constructor3("$ZodEnum", (inst, def) => { - $ZodType3.init(inst, def); - const values = getEnumValues3(def.entries); - inst._zod.values = new Set(values); - inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes3.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex3(o) : o.toString()).join("|")})$`); - inst._zod.parse = (payload, _ctx) => { - const input = payload.value; - if (inst._zod.values.has(input)) { - return payload; - } - payload.issues.push({ - code: "invalid_value", - values, - input, - inst - }); - return payload; - }; -}); -var $ZodLiteral3 = /* @__PURE__ */ $constructor3("$ZodLiteral", (inst, def) => { - $ZodType3.init(inst, def); - inst._zod.values = new Set(def.values); - inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex3(o) : o ? o.toString() : String(o)).join("|")})$`); - inst._zod.parse = (payload, _ctx) => { - const input = payload.value; - if (inst._zod.values.has(input)) { - return payload; - } - payload.issues.push({ - code: "invalid_value", - values: def.values, - input, - inst - }); - return payload; - }; -}); -var $ZodTransform3 = /* @__PURE__ */ $constructor3("$ZodTransform", (inst, def) => { - $ZodType3.init(inst, def); - inst._zod.parse = (payload, _ctx) => { - const _out = def.transform(payload.value, payload); - if (_ctx.async) { - const output = _out instanceof Promise ? _out : Promise.resolve(_out); - return output.then((output2) => { - payload.value = output2; - return payload; - }); - } - if (_out instanceof Promise) { - throw new $ZodAsyncError3(); - } - payload.value = _out; - return payload; - }; -}); -var $ZodOptional3 = /* @__PURE__ */ $constructor3("$ZodOptional", (inst, def) => { - $ZodType3.init(inst, def); - inst._zod.optin = "optional"; - inst._zod.optout = "optional"; - defineLazy3(inst._zod, "values", () => { - return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, void 0]) : void 0; - }); - defineLazy3(inst._zod, "pattern", () => { - const pattern = def.innerType._zod.pattern; - return pattern ? new RegExp(`^(${cleanRegex3(pattern.source)})?$`) : void 0; - }); - inst._zod.parse = (payload, ctx) => { - if (def.innerType._zod.optin === "optional") { - return def.innerType._zod.run(payload, ctx); - } - if (payload.value === void 0) { - return payload; - } - return def.innerType._zod.run(payload, ctx); - }; -}); -var $ZodNullable3 = /* @__PURE__ */ $constructor3("$ZodNullable", (inst, def) => { - $ZodType3.init(inst, def); - defineLazy3(inst._zod, "optin", () => def.innerType._zod.optin); - defineLazy3(inst._zod, "optout", () => def.innerType._zod.optout); - defineLazy3(inst._zod, "pattern", () => { - const pattern = def.innerType._zod.pattern; - return pattern ? new RegExp(`^(${cleanRegex3(pattern.source)}|null)$`) : void 0; - }); - defineLazy3(inst._zod, "values", () => { - return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, null]) : void 0; - }); - inst._zod.parse = (payload, ctx) => { - if (payload.value === null) - return payload; - return def.innerType._zod.run(payload, ctx); - }; -}); -var $ZodDefault3 = /* @__PURE__ */ $constructor3("$ZodDefault", (inst, def) => { - $ZodType3.init(inst, def); - inst._zod.optin = "optional"; - defineLazy3(inst._zod, "values", () => def.innerType._zod.values); - inst._zod.parse = (payload, ctx) => { - if (payload.value === void 0) { - payload.value = def.defaultValue; - return payload; - } - const result = def.innerType._zod.run(payload, ctx); - if (result instanceof Promise) { - return result.then((result2) => handleDefaultResult3(result2, def)); - } - return handleDefaultResult3(result, def); - }; -}); -function handleDefaultResult3(payload, def) { - if (payload.value === void 0) { - payload.value = def.defaultValue; - } - return payload; -} -var $ZodPrefault3 = /* @__PURE__ */ $constructor3("$ZodPrefault", (inst, def) => { - $ZodType3.init(inst, def); - inst._zod.optin = "optional"; - defineLazy3(inst._zod, "values", () => def.innerType._zod.values); - inst._zod.parse = (payload, ctx) => { - if (payload.value === void 0) { - payload.value = def.defaultValue; - } - return def.innerType._zod.run(payload, ctx); - }; -}); -var $ZodNonOptional3 = /* @__PURE__ */ $constructor3("$ZodNonOptional", (inst, def) => { - $ZodType3.init(inst, def); - defineLazy3(inst._zod, "values", () => { - const v = def.innerType._zod.values; - return v ? new Set([...v].filter((x) => x !== void 0)) : void 0; - }); - inst._zod.parse = (payload, ctx) => { - const result = def.innerType._zod.run(payload, ctx); - if (result instanceof Promise) { - return result.then((result2) => handleNonOptionalResult3(result2, inst)); - } - return handleNonOptionalResult3(result, inst); - }; -}); -function handleNonOptionalResult3(payload, inst) { - if (!payload.issues.length && payload.value === void 0) { - payload.issues.push({ - code: "invalid_type", - expected: "nonoptional", - input: payload.value, - inst - }); - } - return payload; -} -var $ZodCatch3 = /* @__PURE__ */ $constructor3("$ZodCatch", (inst, def) => { - $ZodType3.init(inst, def); - inst._zod.optin = "optional"; - defineLazy3(inst._zod, "optout", () => def.innerType._zod.optout); - defineLazy3(inst._zod, "values", () => def.innerType._zod.values); - inst._zod.parse = (payload, ctx) => { - const result = def.innerType._zod.run(payload, ctx); - if (result instanceof Promise) { - return result.then((result2) => { - payload.value = result2.value; - if (result2.issues.length) { - payload.value = def.catchValue({ - ...payload, - error: { - issues: result2.issues.map((iss) => finalizeIssue3(iss, ctx, config3())) - }, - input: payload.value - }); - payload.issues = []; - } - return payload; - }); - } - payload.value = result.value; - if (result.issues.length) { - payload.value = def.catchValue({ - ...payload, - error: { - issues: result.issues.map((iss) => finalizeIssue3(iss, ctx, config3())) - }, - input: payload.value - }); - payload.issues = []; - } - return payload; - }; -}); -var $ZodPipe3 = /* @__PURE__ */ $constructor3("$ZodPipe", (inst, def) => { - $ZodType3.init(inst, def); - defineLazy3(inst._zod, "values", () => def.in._zod.values); - defineLazy3(inst._zod, "optin", () => def.in._zod.optin); - defineLazy3(inst._zod, "optout", () => def.out._zod.optout); - inst._zod.parse = (payload, ctx) => { - const left = def.in._zod.run(payload, ctx); - if (left instanceof Promise) { - return left.then((left2) => handlePipeResult3(left2, def, ctx)); - } - return handlePipeResult3(left, def, ctx); - }; -}); -function handlePipeResult3(left, def, ctx) { - if (aborted3(left)) { - return left; - } - return def.out._zod.run({ value: left.value, issues: left.issues }, ctx); -} -var $ZodReadonly3 = /* @__PURE__ */ $constructor3("$ZodReadonly", (inst, def) => { - $ZodType3.init(inst, def); - defineLazy3(inst._zod, "propValues", () => def.innerType._zod.propValues); - defineLazy3(inst._zod, "values", () => def.innerType._zod.values); - defineLazy3(inst._zod, "optin", () => def.innerType._zod.optin); - defineLazy3(inst._zod, "optout", () => def.innerType._zod.optout); - inst._zod.parse = (payload, ctx) => { - const result = def.innerType._zod.run(payload, ctx); - if (result instanceof Promise) { - return result.then(handleReadonlyResult3); - } - return handleReadonlyResult3(result); - }; -}); -function handleReadonlyResult3(payload) { - payload.value = Object.freeze(payload.value); - return payload; -} -var $ZodCustom3 = /* @__PURE__ */ $constructor3("$ZodCustom", (inst, def) => { - $ZodCheck3.init(inst, def); - $ZodType3.init(inst, def); - inst._zod.parse = (payload, _) => { - return payload; - }; - inst._zod.check = (payload) => { - const input = payload.value; - const r = def.fn(input); - if (r instanceof Promise) { - return r.then((r2) => handleRefineResult3(r2, payload, input, inst)); - } - handleRefineResult3(r, payload, input, inst); - return; - }; -}); -function handleRefineResult3(result, payload, input, inst) { - if (!result) { - const _iss = { - code: "custom", - input, - inst, - path: [...inst._zod.def.path ?? []], - continue: !inst._zod.def.abort - }; - if (inst._zod.def.params) - _iss.params = inst._zod.def.params; - payload.issues.push(issue3(_iss)); - } -} -var parsedType2 = (data) => { - const t = typeof data; - switch (t) { - case "number": { - return Number.isNaN(data) ? "NaN" : "number"; - } - case "object": { - if (Array.isArray(data)) { - return "array"; - } - if (data === null) { - return "null"; - } - if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) { - return data.constructor.name; - } - } - } - return t; -}; -var error49 = () => { - const Sizable = { - string: { unit: "characters", verb: "to have" }, - file: { unit: "bytes", verb: "to have" }, - array: { unit: "items", verb: "to have" }, - set: { unit: "items", verb: "to have" } - }; - function getSizing(origin) { - return Sizable[origin] ?? null; - } - const Nouns = { - regex: "input", - email: "email address", - url: "URL", - emoji: "emoji", - uuid: "UUID", - uuidv4: "UUIDv4", - uuidv6: "UUIDv6", - nanoid: "nanoid", - guid: "GUID", - cuid: "cuid", - cuid2: "cuid2", - ulid: "ULID", - xid: "XID", - ksuid: "KSUID", - datetime: "ISO datetime", - date: "ISO date", - time: "ISO time", - duration: "ISO duration", - ipv4: "IPv4 address", - ipv6: "IPv6 address", - cidrv4: "IPv4 range", - cidrv6: "IPv6 range", - base64: "base64-encoded string", - base64url: "base64url-encoded string", - json_string: "JSON string", - e164: "E.164 number", - jwt: "JWT", - template_literal: "input" - }; - return (issue22) => { - switch (issue22.code) { - case "invalid_type": - return `Invalid input: expected ${issue22.expected}, received ${parsedType2(issue22.input)}`; - case "invalid_value": - if (issue22.values.length === 1) - return `Invalid input: expected ${stringifyPrimitive2(issue22.values[0])}`; - return `Invalid option: expected one of ${joinValues2(issue22.values, "|")}`; - case "too_big": { - const adj = issue22.inclusive ? "<=" : "<"; - const sizing = getSizing(issue22.origin); - if (sizing) - return `Too big: expected ${issue22.origin ?? "value"} to have ${adj}${issue22.maximum.toString()} ${sizing.unit ?? "elements"}`; - return `Too big: expected ${issue22.origin ?? "value"} to be ${adj}${issue22.maximum.toString()}`; - } - case "too_small": { - const adj = issue22.inclusive ? ">=" : ">"; - const sizing = getSizing(issue22.origin); - if (sizing) { - return `Too small: expected ${issue22.origin} to have ${adj}${issue22.minimum.toString()} ${sizing.unit}`; - } - return `Too small: expected ${issue22.origin} to be ${adj}${issue22.minimum.toString()}`; - } - case "invalid_format": { - const _issue = issue22; - if (_issue.format === "starts_with") { - return `Invalid string: must start with "${_issue.prefix}"`; - } - if (_issue.format === "ends_with") - return `Invalid string: must end with "${_issue.suffix}"`; - if (_issue.format === "includes") - return `Invalid string: must include "${_issue.includes}"`; - if (_issue.format === "regex") - return `Invalid string: must match pattern ${_issue.pattern}`; - return `Invalid ${Nouns[_issue.format] ?? issue22.format}`; - } - case "not_multiple_of": - return `Invalid number: must be a multiple of ${issue22.divisor}`; - case "unrecognized_keys": - return `Unrecognized key${issue22.keys.length > 1 ? "s" : ""}: ${joinValues2(issue22.keys, ", ")}`; - case "invalid_key": - return `Invalid key in ${issue22.origin}`; - case "invalid_union": - return "Invalid input"; - case "invalid_element": - return `Invalid value in ${issue22.origin}`; - default: - return `Invalid input`; - } - }; -}; -function en_default22() { - return { - localeError: error49() - }; -} -var $output2 = Symbol("ZodOutput"); -var $input2 = Symbol("ZodInput"); -var $ZodRegistry3 = class { - constructor() { - this._map = /* @__PURE__ */ new WeakMap(); - this._idmap = /* @__PURE__ */ new Map(); - } - add(schema2, ..._meta) { - const meta3 = _meta[0]; - this._map.set(schema2, meta3); - if (meta3 && typeof meta3 === "object" && "id" in meta3) { - if (this._idmap.has(meta3.id)) { - throw new Error(`ID ${meta3.id} already exists in the registry`); - } - this._idmap.set(meta3.id, schema2); - } - return this; - } - remove(schema2) { - this._map.delete(schema2); - return this; - } - get(schema2) { - const p = schema2._zod.parent; - if (p) { - const pm = { ...this.get(p) ?? {} }; - delete pm.id; - return { ...pm, ...this._map.get(schema2) }; - } - return this._map.get(schema2); - } - has(schema2) { - return this._map.has(schema2); - } -}; -function registry4() { - return new $ZodRegistry3(); -} -var globalRegistry3 = /* @__PURE__ */ registry4(); -function _string3(Class22, params) { - return new Class22({ - type: "string", - ...normalizeParams3(params) - }); -} -function _email3(Class22, params) { - return new Class22({ - type: "string", - format: "email", - check: "string_format", - abort: false, - ...normalizeParams3(params) - }); -} -function _guid3(Class22, params) { - return new Class22({ - type: "string", - format: "guid", - check: "string_format", - abort: false, - ...normalizeParams3(params) - }); -} -function _uuid3(Class22, params) { - return new Class22({ - type: "string", - format: "uuid", - check: "string_format", - abort: false, - ...normalizeParams3(params) - }); -} -function _uuidv43(Class22, params) { - return new Class22({ - type: "string", - format: "uuid", - check: "string_format", - abort: false, - version: "v4", - ...normalizeParams3(params) - }); -} -function _uuidv63(Class22, params) { - return new Class22({ - type: "string", - format: "uuid", - check: "string_format", - abort: false, - version: "v6", - ...normalizeParams3(params) - }); -} -function _uuidv73(Class22, params) { - return new Class22({ - type: "string", - format: "uuid", - check: "string_format", - abort: false, - version: "v7", - ...normalizeParams3(params) - }); -} -function _url4(Class22, params) { - return new Class22({ - type: "string", - format: "url", - check: "string_format", - abort: false, - ...normalizeParams3(params) - }); -} -function _emoji22(Class22, params) { - return new Class22({ - type: "string", - format: "emoji", - check: "string_format", - abort: false, - ...normalizeParams3(params) - }); -} -function _nanoid3(Class22, params) { - return new Class22({ - type: "string", - format: "nanoid", - check: "string_format", - abort: false, - ...normalizeParams3(params) - }); -} -function _cuid4(Class22, params) { - return new Class22({ - type: "string", - format: "cuid", - check: "string_format", - abort: false, - ...normalizeParams3(params) - }); -} -function _cuid23(Class22, params) { - return new Class22({ - type: "string", - format: "cuid2", - check: "string_format", - abort: false, - ...normalizeParams3(params) - }); -} -function _ulid3(Class22, params) { - return new Class22({ - type: "string", - format: "ulid", - check: "string_format", - abort: false, - ...normalizeParams3(params) - }); -} -function _xid3(Class22, params) { - return new Class22({ - type: "string", - format: "xid", - check: "string_format", - abort: false, - ...normalizeParams3(params) - }); -} -function _ksuid3(Class22, params) { - return new Class22({ - type: "string", - format: "ksuid", - check: "string_format", - abort: false, - ...normalizeParams3(params) - }); -} -function _ipv43(Class22, params) { - return new Class22({ - type: "string", - format: "ipv4", - check: "string_format", - abort: false, - ...normalizeParams3(params) - }); -} -function _ipv63(Class22, params) { - return new Class22({ - type: "string", - format: "ipv6", - check: "string_format", - abort: false, - ...normalizeParams3(params) - }); -} -function _cidrv43(Class22, params) { - return new Class22({ - type: "string", - format: "cidrv4", - check: "string_format", - abort: false, - ...normalizeParams3(params) - }); -} -function _cidrv63(Class22, params) { - return new Class22({ - type: "string", - format: "cidrv6", - check: "string_format", - abort: false, - ...normalizeParams3(params) - }); -} -function _base643(Class22, params) { - return new Class22({ - type: "string", - format: "base64", - check: "string_format", - abort: false, - ...normalizeParams3(params) - }); -} -function _base64url3(Class22, params) { - return new Class22({ - type: "string", - format: "base64url", - check: "string_format", - abort: false, - ...normalizeParams3(params) - }); -} -function _e1643(Class22, params) { - return new Class22({ - type: "string", - format: "e164", - check: "string_format", - abort: false, - ...normalizeParams3(params) - }); -} -function _jwt3(Class22, params) { - return new Class22({ - type: "string", - format: "jwt", - check: "string_format", - abort: false, - ...normalizeParams3(params) - }); -} -function _isoDateTime3(Class22, params) { - return new Class22({ - type: "string", - format: "datetime", - check: "string_format", - offset: false, - local: false, - precision: null, - ...normalizeParams3(params) - }); -} -function _isoDate3(Class22, params) { - return new Class22({ - type: "string", - format: "date", - check: "string_format", - ...normalizeParams3(params) - }); -} -function _isoTime3(Class22, params) { - return new Class22({ - type: "string", - format: "time", - check: "string_format", - precision: null, - ...normalizeParams3(params) - }); -} -function _isoDuration3(Class22, params) { - return new Class22({ - type: "string", - format: "duration", - check: "string_format", - ...normalizeParams3(params) - }); -} -function _number3(Class22, params) { - return new Class22({ - type: "number", - checks: [], - ...normalizeParams3(params) - }); -} -function _int3(Class22, params) { - return new Class22({ - type: "number", - check: "number_format", - abort: false, - format: "safeint", - ...normalizeParams3(params) - }); -} -function _boolean3(Class22, params) { - return new Class22({ - type: "boolean", - ...normalizeParams3(params) - }); -} -function _null22(Class22, params) { - return new Class22({ - type: "null", - ...normalizeParams3(params) - }); -} -function _unknown3(Class22) { - return new Class22({ - type: "unknown" - }); -} -function _never3(Class22, params) { - return new Class22({ - type: "never", - ...normalizeParams3(params) - }); -} -function _lt3(value2, params) { - return new $ZodCheckLessThan3({ - check: "less_than", - ...normalizeParams3(params), - value: value2, - inclusive: false - }); -} -function _lte3(value2, params) { - return new $ZodCheckLessThan3({ - check: "less_than", - ...normalizeParams3(params), - value: value2, - inclusive: true - }); -} -function _gt3(value2, params) { - return new $ZodCheckGreaterThan3({ - check: "greater_than", - ...normalizeParams3(params), - value: value2, - inclusive: false - }); -} -function _gte3(value2, params) { - return new $ZodCheckGreaterThan3({ - check: "greater_than", - ...normalizeParams3(params), - value: value2, - inclusive: true - }); -} -function _multipleOf3(value2, params) { - return new $ZodCheckMultipleOf3({ - check: "multiple_of", - ...normalizeParams3(params), - value: value2 - }); -} -function _maxLength3(maximum, params) { - const ch = new $ZodCheckMaxLength3({ - check: "max_length", - ...normalizeParams3(params), - maximum - }); - return ch; -} -function _minLength3(minimum, params) { - return new $ZodCheckMinLength3({ - check: "min_length", - ...normalizeParams3(params), - minimum - }); -} -function _length3(length, params) { - return new $ZodCheckLengthEquals3({ - check: "length_equals", - ...normalizeParams3(params), - length - }); -} -function _regex3(pattern, params) { - return new $ZodCheckRegex3({ - check: "string_format", - format: "regex", - ...normalizeParams3(params), - pattern - }); -} -function _lowercase3(params) { - return new $ZodCheckLowerCase3({ - check: "string_format", - format: "lowercase", - ...normalizeParams3(params) - }); -} -function _uppercase3(params) { - return new $ZodCheckUpperCase3({ - check: "string_format", - format: "uppercase", - ...normalizeParams3(params) - }); -} -function _includes3(includes2, params) { - return new $ZodCheckIncludes3({ - check: "string_format", - format: "includes", - ...normalizeParams3(params), - includes: includes2 - }); -} -function _startsWith3(prefix, params) { - return new $ZodCheckStartsWith3({ - check: "string_format", - format: "starts_with", - ...normalizeParams3(params), - prefix - }); -} -function _endsWith3(suffix2, params) { - return new $ZodCheckEndsWith3({ - check: "string_format", - format: "ends_with", - ...normalizeParams3(params), - suffix: suffix2 - }); -} -function _overwrite3(tx) { - return new $ZodCheckOverwrite3({ - check: "overwrite", - tx - }); -} -function _normalize3(form) { - return _overwrite3((input) => input.normalize(form)); -} -function _trim3() { - return _overwrite3((input) => input.trim()); -} -function _toLowerCase3() { - return _overwrite3((input) => input.toLowerCase()); -} -function _toUpperCase3() { - return _overwrite3((input) => input.toUpperCase()); -} -function _array3(Class22, element, params) { - return new Class22({ - type: "array", - element, - ...normalizeParams3(params) - }); -} -function _custom3(Class22, fn2, _params) { - const norm2 = normalizeParams3(_params); - norm2.abort ?? (norm2.abort = true); - const schema2 = new Class22({ - type: "custom", - check: "custom", - fn: fn2, - ...norm2 - }); - return schema2; -} -function _refine3(Class22, fn2, _params) { - const schema2 = new Class22({ - type: "custom", - check: "custom", - fn: fn2, - ...normalizeParams3(_params) - }); - return schema2; -} -var exports_iso2 = {}; -__export2(exports_iso2, { - time: () => time22, - duration: () => duration22, - datetime: () => datetime22, - date: () => date22, - ZodISOTime: () => ZodISOTime3, - ZodISODuration: () => ZodISODuration3, - ZodISODateTime: () => ZodISODateTime3, - ZodISODate: () => ZodISODate3 -}); -var ZodISODateTime3 = /* @__PURE__ */ $constructor3("ZodISODateTime", (inst, def) => { - $ZodISODateTime3.init(inst, def); - ZodStringFormat3.init(inst, def); -}); -function datetime22(params) { - return _isoDateTime3(ZodISODateTime3, params); -} -var ZodISODate3 = /* @__PURE__ */ $constructor3("ZodISODate", (inst, def) => { - $ZodISODate3.init(inst, def); - ZodStringFormat3.init(inst, def); -}); -function date22(params) { - return _isoDate3(ZodISODate3, params); -} -var ZodISOTime3 = /* @__PURE__ */ $constructor3("ZodISOTime", (inst, def) => { - $ZodISOTime3.init(inst, def); - ZodStringFormat3.init(inst, def); -}); -function time22(params) { - return _isoTime3(ZodISOTime3, params); -} -var ZodISODuration3 = /* @__PURE__ */ $constructor3("ZodISODuration", (inst, def) => { - $ZodISODuration3.init(inst, def); - ZodStringFormat3.init(inst, def); -}); -function duration22(params) { - return _isoDuration3(ZodISODuration3, params); -} -var initializer22 = (inst, issues) => { - $ZodError3.init(inst, issues); - inst.name = "ZodError"; - Object.defineProperties(inst, { - format: { - value: (mapper) => formatError3(inst, mapper) - }, - flatten: { - value: (mapper) => flattenError4(inst, mapper) - }, - addIssue: { - value: (issue22) => inst.issues.push(issue22) - }, - addIssues: { - value: (issues2) => inst.issues.push(...issues2) - }, - isEmpty: { - get() { - return inst.issues.length === 0; - } - } - }); -}; -var ZodError22 = $constructor3("ZodError", initializer22); -var ZodRealError3 = $constructor3("ZodError", initializer22, { - Parent: Error -}); -var parse42 = /* @__PURE__ */ _parse3(ZodRealError3); -var parseAsync22 = /* @__PURE__ */ _parseAsync3(ZodRealError3); -var safeParse32 = /* @__PURE__ */ _safeParse3(ZodRealError3); -var safeParseAsync32 = /* @__PURE__ */ _safeParseAsync3(ZodRealError3); -var ZodType22 = /* @__PURE__ */ $constructor3("ZodType", (inst, def) => { - $ZodType3.init(inst, def); - inst.def = def; - Object.defineProperty(inst, "_def", { value: def }); - inst.check = (...checks3) => { - return inst.clone({ - ...def, - checks: [ - ...def.checks ?? [], - ...checks3.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch) - ] - }); - }; - inst.clone = (def2, params) => clone3(inst, def2, params); - inst.brand = () => inst; - inst.register = (reg, meta3) => { - reg.add(inst, meta3); - return inst; - }; - inst.parse = (data, params) => parse42(inst, data, params, { callee: inst.parse }); - inst.safeParse = (data, params) => safeParse32(inst, data, params); - inst.parseAsync = async (data, params) => parseAsync22(inst, data, params, { callee: inst.parseAsync }); - inst.safeParseAsync = async (data, params) => safeParseAsync32(inst, data, params); - inst.spa = inst.safeParseAsync; - inst.refine = (check4, params) => inst.check(refine3(check4, params)); - inst.superRefine = (refinement) => inst.check(superRefine3(refinement)); - inst.overwrite = (fn2) => inst.check(_overwrite3(fn2)); - inst.optional = () => optional3(inst); - inst.nullable = () => nullable3(inst); - inst.nullish = () => optional3(nullable3(inst)); - inst.nonoptional = (params) => nonoptional3(inst, params); - inst.array = () => array3(inst); - inst.or = (arg) => union3([inst, arg]); - inst.and = (arg) => intersection3(inst, arg); - inst.transform = (tx) => pipe3(inst, transform3(tx)); - inst.default = (def2) => _default4(inst, def2); - inst.prefault = (def2) => prefault3(inst, def2); - inst.catch = (params) => _catch4(inst, params); - inst.pipe = (target) => pipe3(inst, target); - inst.readonly = () => readonly3(inst); - inst.describe = (description) => { - const cl = inst.clone(); - globalRegistry3.add(cl, { description }); - return cl; - }; - Object.defineProperty(inst, "description", { - get() { - return globalRegistry3.get(inst)?.description; - }, - configurable: true - }); - inst.meta = (...args3) => { - if (args3.length === 0) { - return globalRegistry3.get(inst); - } - const cl = inst.clone(); - globalRegistry3.add(cl, args3[0]); - return cl; - }; - inst.isOptional = () => inst.safeParse(void 0).success; - inst.isNullable = () => inst.safeParse(null).success; - return inst; -}); -var _ZodString3 = /* @__PURE__ */ $constructor3("_ZodString", (inst, def) => { - $ZodString3.init(inst, def); - ZodType22.init(inst, def); - const bag = inst._zod.bag; - inst.format = bag.format ?? null; - inst.minLength = bag.minimum ?? null; - inst.maxLength = bag.maximum ?? null; - inst.regex = (...args3) => inst.check(_regex3(...args3)); - inst.includes = (...args3) => inst.check(_includes3(...args3)); - inst.startsWith = (...args3) => inst.check(_startsWith3(...args3)); - inst.endsWith = (...args3) => inst.check(_endsWith3(...args3)); - inst.min = (...args3) => inst.check(_minLength3(...args3)); - inst.max = (...args3) => inst.check(_maxLength3(...args3)); - inst.length = (...args3) => inst.check(_length3(...args3)); - inst.nonempty = (...args3) => inst.check(_minLength3(1, ...args3)); - inst.lowercase = (params) => inst.check(_lowercase3(params)); - inst.uppercase = (params) => inst.check(_uppercase3(params)); - inst.trim = () => inst.check(_trim3()); - inst.normalize = (...args3) => inst.check(_normalize3(...args3)); - inst.toLowerCase = () => inst.check(_toLowerCase3()); - inst.toUpperCase = () => inst.check(_toUpperCase3()); -}); -var ZodString22 = /* @__PURE__ */ $constructor3("ZodString", (inst, def) => { - $ZodString3.init(inst, def); - _ZodString3.init(inst, def); - inst.email = (params) => inst.check(_email3(ZodEmail3, params)); - inst.url = (params) => inst.check(_url4(ZodURL3, params)); - inst.jwt = (params) => inst.check(_jwt3(ZodJWT3, params)); - inst.emoji = (params) => inst.check(_emoji22(ZodEmoji3, params)); - inst.guid = (params) => inst.check(_guid3(ZodGUID3, params)); - inst.uuid = (params) => inst.check(_uuid3(ZodUUID3, params)); - inst.uuidv4 = (params) => inst.check(_uuidv43(ZodUUID3, params)); - inst.uuidv6 = (params) => inst.check(_uuidv63(ZodUUID3, params)); - inst.uuidv7 = (params) => inst.check(_uuidv73(ZodUUID3, params)); - inst.nanoid = (params) => inst.check(_nanoid3(ZodNanoID3, params)); - inst.guid = (params) => inst.check(_guid3(ZodGUID3, params)); - inst.cuid = (params) => inst.check(_cuid4(ZodCUID4, params)); - inst.cuid2 = (params) => inst.check(_cuid23(ZodCUID23, params)); - inst.ulid = (params) => inst.check(_ulid3(ZodULID3, params)); - inst.base64 = (params) => inst.check(_base643(ZodBase643, params)); - inst.base64url = (params) => inst.check(_base64url3(ZodBase64URL3, params)); - inst.xid = (params) => inst.check(_xid3(ZodXID3, params)); - inst.ksuid = (params) => inst.check(_ksuid3(ZodKSUID3, params)); - inst.ipv4 = (params) => inst.check(_ipv43(ZodIPv43, params)); - inst.ipv6 = (params) => inst.check(_ipv63(ZodIPv63, params)); - inst.cidrv4 = (params) => inst.check(_cidrv43(ZodCIDRv43, params)); - inst.cidrv6 = (params) => inst.check(_cidrv63(ZodCIDRv63, params)); - inst.e164 = (params) => inst.check(_e1643(ZodE1643, params)); - inst.datetime = (params) => inst.check(datetime22(params)); - inst.date = (params) => inst.check(date22(params)); - inst.time = (params) => inst.check(time22(params)); - inst.duration = (params) => inst.check(duration22(params)); -}); -function string22(params) { - return _string3(ZodString22, params); -} -var ZodStringFormat3 = /* @__PURE__ */ $constructor3("ZodStringFormat", (inst, def) => { - $ZodStringFormat3.init(inst, def); - _ZodString3.init(inst, def); -}); -var ZodEmail3 = /* @__PURE__ */ $constructor3("ZodEmail", (inst, def) => { - $ZodEmail3.init(inst, def); - ZodStringFormat3.init(inst, def); -}); -var ZodGUID3 = /* @__PURE__ */ $constructor3("ZodGUID", (inst, def) => { - $ZodGUID3.init(inst, def); - ZodStringFormat3.init(inst, def); -}); -var ZodUUID3 = /* @__PURE__ */ $constructor3("ZodUUID", (inst, def) => { - $ZodUUID3.init(inst, def); - ZodStringFormat3.init(inst, def); -}); -var ZodURL3 = /* @__PURE__ */ $constructor3("ZodURL", (inst, def) => { - $ZodURL3.init(inst, def); - ZodStringFormat3.init(inst, def); -}); -var ZodEmoji3 = /* @__PURE__ */ $constructor3("ZodEmoji", (inst, def) => { - $ZodEmoji3.init(inst, def); - ZodStringFormat3.init(inst, def); -}); -var ZodNanoID3 = /* @__PURE__ */ $constructor3("ZodNanoID", (inst, def) => { - $ZodNanoID3.init(inst, def); - ZodStringFormat3.init(inst, def); -}); -var ZodCUID4 = /* @__PURE__ */ $constructor3("ZodCUID", (inst, def) => { - $ZodCUID4.init(inst, def); - ZodStringFormat3.init(inst, def); -}); -var ZodCUID23 = /* @__PURE__ */ $constructor3("ZodCUID2", (inst, def) => { - $ZodCUID23.init(inst, def); - ZodStringFormat3.init(inst, def); -}); -var ZodULID3 = /* @__PURE__ */ $constructor3("ZodULID", (inst, def) => { - $ZodULID3.init(inst, def); - ZodStringFormat3.init(inst, def); -}); -var ZodXID3 = /* @__PURE__ */ $constructor3("ZodXID", (inst, def) => { - $ZodXID3.init(inst, def); - ZodStringFormat3.init(inst, def); -}); -var ZodKSUID3 = /* @__PURE__ */ $constructor3("ZodKSUID", (inst, def) => { - $ZodKSUID3.init(inst, def); - ZodStringFormat3.init(inst, def); -}); -var ZodIPv43 = /* @__PURE__ */ $constructor3("ZodIPv4", (inst, def) => { - $ZodIPv43.init(inst, def); - ZodStringFormat3.init(inst, def); -}); -var ZodIPv63 = /* @__PURE__ */ $constructor3("ZodIPv6", (inst, def) => { - $ZodIPv63.init(inst, def); - ZodStringFormat3.init(inst, def); -}); -var ZodCIDRv43 = /* @__PURE__ */ $constructor3("ZodCIDRv4", (inst, def) => { - $ZodCIDRv43.init(inst, def); - ZodStringFormat3.init(inst, def); -}); -var ZodCIDRv63 = /* @__PURE__ */ $constructor3("ZodCIDRv6", (inst, def) => { - $ZodCIDRv63.init(inst, def); - ZodStringFormat3.init(inst, def); -}); -var ZodBase643 = /* @__PURE__ */ $constructor3("ZodBase64", (inst, def) => { - $ZodBase643.init(inst, def); - ZodStringFormat3.init(inst, def); -}); -var ZodBase64URL3 = /* @__PURE__ */ $constructor3("ZodBase64URL", (inst, def) => { - $ZodBase64URL3.init(inst, def); - ZodStringFormat3.init(inst, def); -}); -var ZodE1643 = /* @__PURE__ */ $constructor3("ZodE164", (inst, def) => { - $ZodE1643.init(inst, def); - ZodStringFormat3.init(inst, def); -}); -var ZodJWT3 = /* @__PURE__ */ $constructor3("ZodJWT", (inst, def) => { - $ZodJWT3.init(inst, def); - ZodStringFormat3.init(inst, def); -}); -var ZodNumber22 = /* @__PURE__ */ $constructor3("ZodNumber", (inst, def) => { - $ZodNumber3.init(inst, def); - ZodType22.init(inst, def); - inst.gt = (value2, params) => inst.check(_gt3(value2, params)); - inst.gte = (value2, params) => inst.check(_gte3(value2, params)); - inst.min = (value2, params) => inst.check(_gte3(value2, params)); - inst.lt = (value2, params) => inst.check(_lt3(value2, params)); - inst.lte = (value2, params) => inst.check(_lte3(value2, params)); - inst.max = (value2, params) => inst.check(_lte3(value2, params)); - inst.int = (params) => inst.check(int3(params)); - inst.safe = (params) => inst.check(int3(params)); - inst.positive = (params) => inst.check(_gt3(0, params)); - inst.nonnegative = (params) => inst.check(_gte3(0, params)); - inst.negative = (params) => inst.check(_lt3(0, params)); - inst.nonpositive = (params) => inst.check(_lte3(0, params)); - inst.multipleOf = (value2, params) => inst.check(_multipleOf3(value2, params)); - inst.step = (value2, params) => inst.check(_multipleOf3(value2, params)); - inst.finite = () => inst; - const bag = inst._zod.bag; - inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null; - inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null; - inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5); - inst.isFinite = true; - inst.format = bag.format ?? null; -}); -function number22(params) { - return _number3(ZodNumber22, params); -} -var ZodNumberFormat3 = /* @__PURE__ */ $constructor3("ZodNumberFormat", (inst, def) => { - $ZodNumberFormat3.init(inst, def); - ZodNumber22.init(inst, def); -}); -function int3(params) { - return _int3(ZodNumberFormat3, params); -} -var ZodBoolean22 = /* @__PURE__ */ $constructor3("ZodBoolean", (inst, def) => { - $ZodBoolean3.init(inst, def); - ZodType22.init(inst, def); -}); -function boolean22(params) { - return _boolean3(ZodBoolean22, params); -} -var ZodNull22 = /* @__PURE__ */ $constructor3("ZodNull", (inst, def) => { - $ZodNull3.init(inst, def); - ZodType22.init(inst, def); -}); -function _null32(params) { - return _null22(ZodNull22, params); -} -var ZodUnknown22 = /* @__PURE__ */ $constructor3("ZodUnknown", (inst, def) => { - $ZodUnknown3.init(inst, def); - ZodType22.init(inst, def); -}); -function unknown4() { - return _unknown3(ZodUnknown22); -} -var ZodNever22 = /* @__PURE__ */ $constructor3("ZodNever", (inst, def) => { - $ZodNever3.init(inst, def); - ZodType22.init(inst, def); -}); -function never3(params) { - return _never3(ZodNever22, params); -} -var ZodArray22 = /* @__PURE__ */ $constructor3("ZodArray", (inst, def) => { - $ZodArray3.init(inst, def); - ZodType22.init(inst, def); - inst.element = def.element; - inst.min = (minLength, params) => inst.check(_minLength3(minLength, params)); - inst.nonempty = (params) => inst.check(_minLength3(1, params)); - inst.max = (maxLength, params) => inst.check(_maxLength3(maxLength, params)); - inst.length = (len, params) => inst.check(_length3(len, params)); - inst.unwrap = () => inst.element; -}); -function array3(element, params) { - return _array3(ZodArray22, element, params); -} -var ZodObject22 = /* @__PURE__ */ $constructor3("ZodObject", (inst, def) => { - $ZodObject3.init(inst, def); - ZodType22.init(inst, def); - exports_util.defineLazy(inst, "shape", () => def.shape); - inst.keyof = () => _enum4(Object.keys(inst._zod.def.shape)); - inst.catchall = (catchall) => inst.clone({ ...inst._zod.def, catchall }); - inst.passthrough = () => inst.clone({ ...inst._zod.def, catchall: unknown4() }); - inst.loose = () => inst.clone({ ...inst._zod.def, catchall: unknown4() }); - inst.strict = () => inst.clone({ ...inst._zod.def, catchall: never3() }); - inst.strip = () => inst.clone({ ...inst._zod.def, catchall: void 0 }); - inst.extend = (incoming) => { - return exports_util.extend(inst, incoming); - }; - inst.merge = (other) => exports_util.merge(inst, other); - inst.pick = (mask) => exports_util.pick(inst, mask); - inst.omit = (mask) => exports_util.omit(inst, mask); - inst.partial = (...args3) => exports_util.partial(ZodOptional22, inst, args3[0]); - inst.required = (...args3) => exports_util.required(ZodNonOptional3, inst, args3[0]); -}); -function object22(shape, params) { - const def = { - type: "object", - get shape() { - exports_util.assignProp(this, "shape", { ...shape }); - return this.shape; - }, - ...exports_util.normalizeParams(params) - }; - return new ZodObject22(def); -} -function looseObject3(shape, params) { - return new ZodObject22({ - type: "object", - get shape() { - exports_util.assignProp(this, "shape", { ...shape }); - return this.shape; - }, - catchall: unknown4(), - ...exports_util.normalizeParams(params) - }); -} -var ZodUnion22 = /* @__PURE__ */ $constructor3("ZodUnion", (inst, def) => { - $ZodUnion3.init(inst, def); - ZodType22.init(inst, def); - inst.options = def.options; -}); -function union3(options, params) { - return new ZodUnion22({ - type: "union", - options, - ...exports_util.normalizeParams(params) - }); -} -var ZodDiscriminatedUnion22 = /* @__PURE__ */ $constructor3("ZodDiscriminatedUnion", (inst, def) => { - ZodUnion22.init(inst, def); - $ZodDiscriminatedUnion3.init(inst, def); -}); -function discriminatedUnion3(discriminator, options, params) { - return new ZodDiscriminatedUnion22({ - type: "union", - options, - discriminator, - ...exports_util.normalizeParams(params) - }); -} -var ZodIntersection22 = /* @__PURE__ */ $constructor3("ZodIntersection", (inst, def) => { - $ZodIntersection3.init(inst, def); - ZodType22.init(inst, def); -}); -function intersection3(left, right) { - return new ZodIntersection22({ - type: "intersection", - left, - right - }); -} -var ZodRecord22 = /* @__PURE__ */ $constructor3("ZodRecord", (inst, def) => { - $ZodRecord3.init(inst, def); - ZodType22.init(inst, def); - inst.keyType = def.keyType; - inst.valueType = def.valueType; -}); -function record3(keyType, valueType, params) { - return new ZodRecord22({ - type: "record", - keyType, - valueType, - ...exports_util.normalizeParams(params) - }); -} -var ZodEnum22 = /* @__PURE__ */ $constructor3("ZodEnum", (inst, def) => { - $ZodEnum3.init(inst, def); - ZodType22.init(inst, def); - inst.enum = def.entries; - inst.options = Object.values(def.entries); - const keys = new Set(Object.keys(def.entries)); - inst.extract = (values, params) => { - const newEntries = {}; - for (const value2 of values) { - if (keys.has(value2)) { - newEntries[value2] = def.entries[value2]; - } else - throw new Error(`Key ${value2} not found in enum`); - } - return new ZodEnum22({ - ...def, - checks: [], - ...exports_util.normalizeParams(params), - entries: newEntries - }); - }; - inst.exclude = (values, params) => { - const newEntries = { ...def.entries }; - for (const value2 of values) { - if (keys.has(value2)) { - delete newEntries[value2]; - } else - throw new Error(`Key ${value2} not found in enum`); - } - return new ZodEnum22({ - ...def, - checks: [], - ...exports_util.normalizeParams(params), - entries: newEntries - }); - }; -}); -function _enum4(values, params) { - const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values; - return new ZodEnum22({ - type: "enum", - entries, - ...exports_util.normalizeParams(params) - }); -} -var ZodLiteral22 = /* @__PURE__ */ $constructor3("ZodLiteral", (inst, def) => { - $ZodLiteral3.init(inst, def); - ZodType22.init(inst, def); - inst.values = new Set(def.values); - Object.defineProperty(inst, "value", { - get() { - if (def.values.length > 1) { - throw new Error("This schema contains multiple valid literal values. Use `.values` instead."); - } - return def.values[0]; - } - }); -}); -function literal3(value2, params) { - return new ZodLiteral22({ - type: "literal", - values: Array.isArray(value2) ? value2 : [value2], - ...exports_util.normalizeParams(params) - }); -} -var ZodTransform3 = /* @__PURE__ */ $constructor3("ZodTransform", (inst, def) => { - $ZodTransform3.init(inst, def); - ZodType22.init(inst, def); - inst._zod.parse = (payload, _ctx) => { - payload.addIssue = (issue22) => { - if (typeof issue22 === "string") { - payload.issues.push(exports_util.issue(issue22, payload.value, def)); - } else { - const _issue = issue22; - if (_issue.fatal) - _issue.continue = false; - _issue.code ?? (_issue.code = "custom"); - _issue.input ?? (_issue.input = payload.value); - _issue.inst ?? (_issue.inst = inst); - _issue.continue ?? (_issue.continue = true); - payload.issues.push(exports_util.issue(_issue)); - } - }; - const output = def.transform(payload.value, payload); - if (output instanceof Promise) { - return output.then((output2) => { - payload.value = output2; - return payload; - }); - } - payload.value = output; - return payload; - }; -}); -function transform3(fn2) { - return new ZodTransform3({ - type: "transform", - transform: fn2 - }); -} -var ZodOptional22 = /* @__PURE__ */ $constructor3("ZodOptional", (inst, def) => { - $ZodOptional3.init(inst, def); - ZodType22.init(inst, def); - inst.unwrap = () => inst._zod.def.innerType; -}); -function optional3(innerType) { - return new ZodOptional22({ - type: "optional", - innerType - }); -} -var ZodNullable22 = /* @__PURE__ */ $constructor3("ZodNullable", (inst, def) => { - $ZodNullable3.init(inst, def); - ZodType22.init(inst, def); - inst.unwrap = () => inst._zod.def.innerType; -}); -function nullable3(innerType) { - return new ZodNullable22({ - type: "nullable", - innerType - }); -} -var ZodDefault22 = /* @__PURE__ */ $constructor3("ZodDefault", (inst, def) => { - $ZodDefault3.init(inst, def); - ZodType22.init(inst, def); - inst.unwrap = () => inst._zod.def.innerType; - inst.removeDefault = inst.unwrap; -}); -function _default4(innerType, defaultValue) { - return new ZodDefault22({ - type: "default", - innerType, - get defaultValue() { - return typeof defaultValue === "function" ? defaultValue() : defaultValue; - } - }); -} -var ZodPrefault3 = /* @__PURE__ */ $constructor3("ZodPrefault", (inst, def) => { - $ZodPrefault3.init(inst, def); - ZodType22.init(inst, def); - inst.unwrap = () => inst._zod.def.innerType; -}); -function prefault3(innerType, defaultValue) { - return new ZodPrefault3({ - type: "prefault", - innerType, - get defaultValue() { - return typeof defaultValue === "function" ? defaultValue() : defaultValue; - } - }); -} -var ZodNonOptional3 = /* @__PURE__ */ $constructor3("ZodNonOptional", (inst, def) => { - $ZodNonOptional3.init(inst, def); - ZodType22.init(inst, def); - inst.unwrap = () => inst._zod.def.innerType; -}); -function nonoptional3(innerType, params) { - return new ZodNonOptional3({ - type: "nonoptional", - innerType, - ...exports_util.normalizeParams(params) - }); -} -var ZodCatch22 = /* @__PURE__ */ $constructor3("ZodCatch", (inst, def) => { - $ZodCatch3.init(inst, def); - ZodType22.init(inst, def); - inst.unwrap = () => inst._zod.def.innerType; - inst.removeCatch = inst.unwrap; -}); -function _catch4(innerType, catchValue) { - return new ZodCatch22({ - type: "catch", - innerType, - catchValue: typeof catchValue === "function" ? catchValue : () => catchValue - }); -} -var ZodPipe3 = /* @__PURE__ */ $constructor3("ZodPipe", (inst, def) => { - $ZodPipe3.init(inst, def); - ZodType22.init(inst, def); - inst.in = def.in; - inst.out = def.out; -}); -function pipe3(in_, out) { - return new ZodPipe3({ - type: "pipe", - in: in_, - out - }); -} -var ZodReadonly22 = /* @__PURE__ */ $constructor3("ZodReadonly", (inst, def) => { - $ZodReadonly3.init(inst, def); - ZodType22.init(inst, def); -}); -function readonly3(innerType) { - return new ZodReadonly22({ - type: "readonly", - innerType - }); -} -var ZodCustom3 = /* @__PURE__ */ $constructor3("ZodCustom", (inst, def) => { - $ZodCustom3.init(inst, def); - ZodType22.init(inst, def); -}); -function check3(fn2, params) { - const ch = new $ZodCheck3({ - check: "custom", - ...exports_util.normalizeParams(params) - }); - ch._zod.check = fn2; - return ch; -} -function custom3(fn2, _params) { - return _custom3(ZodCustom3, fn2 ?? (() => true), _params); -} -function refine3(fn2, _params = {}) { - return _refine3(ZodCustom3, fn2, _params); -} -function superRefine3(fn2, params) { - const ch = check3((payload) => { - payload.addIssue = (issue22) => { - if (typeof issue22 === "string") { - payload.issues.push(exports_util.issue(issue22, payload.value, ch._zod.def)); - } else { - const _issue = issue22; - if (_issue.fatal) - _issue.continue = false; - _issue.code ?? (_issue.code = "custom"); - _issue.input ?? (_issue.input = payload.value); - _issue.inst ?? (_issue.inst = ch); - _issue.continue ?? (_issue.continue = !ch._zod.def.abort); - payload.issues.push(exports_util.issue(_issue)); - } - }; - return fn2(payload.value, payload); - }, params); - return ch; -} -function preprocess3(fn2, schema2) { - return pipe3(transform3(fn2), schema2); -} -config3(en_default22()); -var RELATED_TASK_META_KEY3 = "io.modelcontextprotocol/related-task"; -var JSONRPC_VERSION3 = "2.0"; -var AssertObjectSchema3 = custom3((v) => v !== null && (typeof v === "object" || typeof v === "function")); -var ProgressTokenSchema3 = union3([string22(), number22().int()]); -var CursorSchema3 = string22(); -var TaskCreationParamsSchema3 = looseObject3({ - ttl: union3([number22(), _null32()]).optional(), - pollInterval: number22().optional() -}); -var RelatedTaskMetadataSchema3 = looseObject3({ - taskId: string22() -}); -var RequestMetaSchema3 = looseObject3({ - progressToken: ProgressTokenSchema3.optional(), - [RELATED_TASK_META_KEY3]: RelatedTaskMetadataSchema3.optional() -}); -var BaseRequestParamsSchema3 = looseObject3({ - task: TaskCreationParamsSchema3.optional(), - _meta: RequestMetaSchema3.optional() -}); -var RequestSchema3 = object22({ - method: string22(), - params: BaseRequestParamsSchema3.optional() -}); -var NotificationsParamsSchema3 = looseObject3({ - _meta: object22({ - [RELATED_TASK_META_KEY3]: optional3(RelatedTaskMetadataSchema3) - }).passthrough().optional() -}); -var NotificationSchema3 = object22({ - method: string22(), - params: NotificationsParamsSchema3.optional() -}); -var ResultSchema3 = looseObject3({ - _meta: looseObject3({ - [RELATED_TASK_META_KEY3]: RelatedTaskMetadataSchema3.optional() - }).optional() -}); -var RequestIdSchema3 = union3([string22(), number22().int()]); -var JSONRPCRequestSchema3 = object22({ - jsonrpc: literal3(JSONRPC_VERSION3), - id: RequestIdSchema3, - ...RequestSchema3.shape -}).strict(); -var JSONRPCNotificationSchema3 = object22({ - jsonrpc: literal3(JSONRPC_VERSION3), - ...NotificationSchema3.shape -}).strict(); -var JSONRPCResponseSchema3 = object22({ - jsonrpc: literal3(JSONRPC_VERSION3), - id: RequestIdSchema3, - result: ResultSchema3 -}).strict(); -var ErrorCode3; -(function(ErrorCode22) { - ErrorCode22[ErrorCode22["ConnectionClosed"] = -32e3] = "ConnectionClosed"; - ErrorCode22[ErrorCode22["RequestTimeout"] = -32001] = "RequestTimeout"; - ErrorCode22[ErrorCode22["ParseError"] = -32700] = "ParseError"; - ErrorCode22[ErrorCode22["InvalidRequest"] = -32600] = "InvalidRequest"; - ErrorCode22[ErrorCode22["MethodNotFound"] = -32601] = "MethodNotFound"; - ErrorCode22[ErrorCode22["InvalidParams"] = -32602] = "InvalidParams"; - ErrorCode22[ErrorCode22["InternalError"] = -32603] = "InternalError"; - ErrorCode22[ErrorCode22["UrlElicitationRequired"] = -32042] = "UrlElicitationRequired"; -})(ErrorCode3 || (ErrorCode3 = {})); -var JSONRPCErrorSchema2 = object22({ - jsonrpc: literal3(JSONRPC_VERSION3), - id: RequestIdSchema3, - error: object22({ - code: number22().int(), - message: string22(), - data: optional3(unknown4()) - }) -}).strict(); -var JSONRPCMessageSchema3 = union3([JSONRPCRequestSchema3, JSONRPCNotificationSchema3, JSONRPCResponseSchema3, JSONRPCErrorSchema2]); -var EmptyResultSchema3 = ResultSchema3.strict(); -var CancelledNotificationParamsSchema3 = NotificationsParamsSchema3.extend({ - requestId: RequestIdSchema3, - reason: string22().optional() -}); -var CancelledNotificationSchema3 = NotificationSchema3.extend({ - method: literal3("notifications/cancelled"), - params: CancelledNotificationParamsSchema3 -}); -var IconSchema3 = object22({ - src: string22(), - mimeType: string22().optional(), - sizes: array3(string22()).optional() -}); -var IconsSchema3 = object22({ - icons: array3(IconSchema3).optional() -}); -var BaseMetadataSchema3 = object22({ - name: string22(), - title: string22().optional() -}); -var ImplementationSchema3 = BaseMetadataSchema3.extend({ - ...BaseMetadataSchema3.shape, - ...IconsSchema3.shape, - version: string22(), - websiteUrl: string22().optional() -}); -var FormElicitationCapabilitySchema3 = intersection3(object22({ - applyDefaults: boolean22().optional() -}), record3(string22(), unknown4())); -var ElicitationCapabilitySchema3 = preprocess3((value2) => { - if (value2 && typeof value2 === "object" && !Array.isArray(value2)) { - if (Object.keys(value2).length === 0) { - return { form: {} }; - } - } - return value2; -}, intersection3(object22({ - form: FormElicitationCapabilitySchema3.optional(), - url: AssertObjectSchema3.optional() -}), record3(string22(), unknown4()).optional())); -var ClientTasksCapabilitySchema3 = object22({ - list: optional3(object22({}).passthrough()), - cancel: optional3(object22({}).passthrough()), - requests: optional3(object22({ - sampling: optional3(object22({ - createMessage: optional3(object22({}).passthrough()) - }).passthrough()), - elicitation: optional3(object22({ - create: optional3(object22({}).passthrough()) - }).passthrough()) - }).passthrough()) -}).passthrough(); -var ServerTasksCapabilitySchema3 = object22({ - list: optional3(object22({}).passthrough()), - cancel: optional3(object22({}).passthrough()), - requests: optional3(object22({ - tools: optional3(object22({ - call: optional3(object22({}).passthrough()) - }).passthrough()) - }).passthrough()) -}).passthrough(); -var ClientCapabilitiesSchema3 = object22({ - experimental: record3(string22(), AssertObjectSchema3).optional(), - sampling: object22({ - context: AssertObjectSchema3.optional(), - tools: AssertObjectSchema3.optional() - }).optional(), - elicitation: ElicitationCapabilitySchema3.optional(), - roots: object22({ - listChanged: boolean22().optional() - }).optional(), - tasks: optional3(ClientTasksCapabilitySchema3) -}); -var InitializeRequestParamsSchema3 = BaseRequestParamsSchema3.extend({ - protocolVersion: string22(), - capabilities: ClientCapabilitiesSchema3, - clientInfo: ImplementationSchema3 -}); -var InitializeRequestSchema3 = RequestSchema3.extend({ - method: literal3("initialize"), - params: InitializeRequestParamsSchema3 -}); -var ServerCapabilitiesSchema3 = object22({ - experimental: record3(string22(), AssertObjectSchema3).optional(), - logging: AssertObjectSchema3.optional(), - completions: AssertObjectSchema3.optional(), - prompts: optional3(object22({ - listChanged: optional3(boolean22()) - })), - resources: object22({ - subscribe: boolean22().optional(), - listChanged: boolean22().optional() - }).optional(), - tools: object22({ - listChanged: boolean22().optional() - }).optional(), - tasks: optional3(ServerTasksCapabilitySchema3) -}).passthrough(); -var InitializeResultSchema3 = ResultSchema3.extend({ - protocolVersion: string22(), - capabilities: ServerCapabilitiesSchema3, - serverInfo: ImplementationSchema3, - instructions: string22().optional() -}); -var InitializedNotificationSchema3 = NotificationSchema3.extend({ - method: literal3("notifications/initialized") -}); -var PingRequestSchema3 = RequestSchema3.extend({ - method: literal3("ping") -}); -var ProgressSchema3 = object22({ - progress: number22(), - total: optional3(number22()), - message: optional3(string22()) -}); -var ProgressNotificationParamsSchema3 = object22({ - ...NotificationsParamsSchema3.shape, - ...ProgressSchema3.shape, - progressToken: ProgressTokenSchema3 -}); -var ProgressNotificationSchema3 = NotificationSchema3.extend({ - method: literal3("notifications/progress"), - params: ProgressNotificationParamsSchema3 -}); -var PaginatedRequestParamsSchema3 = BaseRequestParamsSchema3.extend({ - cursor: CursorSchema3.optional() -}); -var PaginatedRequestSchema3 = RequestSchema3.extend({ - params: PaginatedRequestParamsSchema3.optional() -}); -var PaginatedResultSchema3 = ResultSchema3.extend({ - nextCursor: optional3(CursorSchema3) -}); -var TaskSchema3 = object22({ - taskId: string22(), - status: _enum4(["working", "input_required", "completed", "failed", "cancelled"]), - ttl: union3([number22(), _null32()]), - createdAt: string22(), - lastUpdatedAt: string22(), - pollInterval: optional3(number22()), - statusMessage: optional3(string22()) -}); -var CreateTaskResultSchema3 = ResultSchema3.extend({ - task: TaskSchema3 -}); -var TaskStatusNotificationParamsSchema3 = NotificationsParamsSchema3.merge(TaskSchema3); -var TaskStatusNotificationSchema3 = NotificationSchema3.extend({ - method: literal3("notifications/tasks/status"), - params: TaskStatusNotificationParamsSchema3 -}); -var GetTaskRequestSchema3 = RequestSchema3.extend({ - method: literal3("tasks/get"), - params: BaseRequestParamsSchema3.extend({ - taskId: string22() - }) -}); -var GetTaskResultSchema3 = ResultSchema3.merge(TaskSchema3); -var GetTaskPayloadRequestSchema3 = RequestSchema3.extend({ - method: literal3("tasks/result"), - params: BaseRequestParamsSchema3.extend({ - taskId: string22() - }) -}); -var ListTasksRequestSchema3 = PaginatedRequestSchema3.extend({ - method: literal3("tasks/list") -}); -var ListTasksResultSchema3 = PaginatedResultSchema3.extend({ - tasks: array3(TaskSchema3) -}); -var CancelTaskRequestSchema3 = RequestSchema3.extend({ - method: literal3("tasks/cancel"), - params: BaseRequestParamsSchema3.extend({ - taskId: string22() - }) -}); -var CancelTaskResultSchema3 = ResultSchema3.merge(TaskSchema3); -var ResourceContentsSchema3 = object22({ - uri: string22(), - mimeType: optional3(string22()), - _meta: record3(string22(), unknown4()).optional() -}); -var TextResourceContentsSchema3 = ResourceContentsSchema3.extend({ - text: string22() -}); -var Base64Schema3 = string22().refine((val) => { - try { - atob(val); - return true; - } catch (_a2) { - return false; - } -}, { message: "Invalid Base64 string" }); -var BlobResourceContentsSchema3 = ResourceContentsSchema3.extend({ - blob: Base64Schema3 -}); -var AnnotationsSchema3 = object22({ - audience: array3(_enum4(["user", "assistant"])).optional(), - priority: number22().min(0).max(1).optional(), - lastModified: exports_iso2.datetime({ offset: true }).optional() -}); -var ResourceSchema3 = object22({ - ...BaseMetadataSchema3.shape, - ...IconsSchema3.shape, - uri: string22(), - description: optional3(string22()), - mimeType: optional3(string22()), - annotations: AnnotationsSchema3.optional(), - _meta: optional3(looseObject3({})) -}); -var ResourceTemplateSchema3 = object22({ - ...BaseMetadataSchema3.shape, - ...IconsSchema3.shape, - uriTemplate: string22(), - description: optional3(string22()), - mimeType: optional3(string22()), - annotations: AnnotationsSchema3.optional(), - _meta: optional3(looseObject3({})) -}); -var ListResourcesRequestSchema3 = PaginatedRequestSchema3.extend({ - method: literal3("resources/list") -}); -var ListResourcesResultSchema3 = PaginatedResultSchema3.extend({ - resources: array3(ResourceSchema3) -}); -var ListResourceTemplatesRequestSchema3 = PaginatedRequestSchema3.extend({ - method: literal3("resources/templates/list") -}); -var ListResourceTemplatesResultSchema3 = PaginatedResultSchema3.extend({ - resourceTemplates: array3(ResourceTemplateSchema3) -}); -var ResourceRequestParamsSchema3 = BaseRequestParamsSchema3.extend({ - uri: string22() -}); -var ReadResourceRequestParamsSchema3 = ResourceRequestParamsSchema3; -var ReadResourceRequestSchema3 = RequestSchema3.extend({ - method: literal3("resources/read"), - params: ReadResourceRequestParamsSchema3 -}); -var ReadResourceResultSchema3 = ResultSchema3.extend({ - contents: array3(union3([TextResourceContentsSchema3, BlobResourceContentsSchema3])) -}); -var ResourceListChangedNotificationSchema3 = NotificationSchema3.extend({ - method: literal3("notifications/resources/list_changed") -}); -var SubscribeRequestParamsSchema3 = ResourceRequestParamsSchema3; -var SubscribeRequestSchema3 = RequestSchema3.extend({ - method: literal3("resources/subscribe"), - params: SubscribeRequestParamsSchema3 -}); -var UnsubscribeRequestParamsSchema3 = ResourceRequestParamsSchema3; -var UnsubscribeRequestSchema3 = RequestSchema3.extend({ - method: literal3("resources/unsubscribe"), - params: UnsubscribeRequestParamsSchema3 -}); -var ResourceUpdatedNotificationParamsSchema3 = NotificationsParamsSchema3.extend({ - uri: string22() -}); -var ResourceUpdatedNotificationSchema3 = NotificationSchema3.extend({ - method: literal3("notifications/resources/updated"), - params: ResourceUpdatedNotificationParamsSchema3 -}); -var PromptArgumentSchema3 = object22({ - name: string22(), - description: optional3(string22()), - required: optional3(boolean22()) -}); -var PromptSchema3 = object22({ - ...BaseMetadataSchema3.shape, - ...IconsSchema3.shape, - description: optional3(string22()), - arguments: optional3(array3(PromptArgumentSchema3)), - _meta: optional3(looseObject3({})) -}); -var ListPromptsRequestSchema3 = PaginatedRequestSchema3.extend({ - method: literal3("prompts/list") -}); -var ListPromptsResultSchema3 = PaginatedResultSchema3.extend({ - prompts: array3(PromptSchema3) -}); -var GetPromptRequestParamsSchema3 = BaseRequestParamsSchema3.extend({ - name: string22(), - arguments: record3(string22(), string22()).optional() -}); -var GetPromptRequestSchema3 = RequestSchema3.extend({ - method: literal3("prompts/get"), - params: GetPromptRequestParamsSchema3 -}); -var TextContentSchema3 = object22({ - type: literal3("text"), - text: string22(), - annotations: AnnotationsSchema3.optional(), - _meta: record3(string22(), unknown4()).optional() -}); -var ImageContentSchema3 = object22({ - type: literal3("image"), - data: Base64Schema3, - mimeType: string22(), - annotations: AnnotationsSchema3.optional(), - _meta: record3(string22(), unknown4()).optional() -}); -var AudioContentSchema3 = object22({ - type: literal3("audio"), - data: Base64Schema3, - mimeType: string22(), - annotations: AnnotationsSchema3.optional(), - _meta: record3(string22(), unknown4()).optional() -}); -var ToolUseContentSchema3 = object22({ - type: literal3("tool_use"), - name: string22(), - id: string22(), - input: object22({}).passthrough(), - _meta: optional3(object22({}).passthrough()) -}).passthrough(); -var EmbeddedResourceSchema3 = object22({ - type: literal3("resource"), - resource: union3([TextResourceContentsSchema3, BlobResourceContentsSchema3]), - annotations: AnnotationsSchema3.optional(), - _meta: record3(string22(), unknown4()).optional() -}); -var ResourceLinkSchema3 = ResourceSchema3.extend({ - type: literal3("resource_link") -}); -var ContentBlockSchema3 = union3([ - TextContentSchema3, - ImageContentSchema3, - AudioContentSchema3, - ResourceLinkSchema3, - EmbeddedResourceSchema3 -]); -var PromptMessageSchema3 = object22({ - role: _enum4(["user", "assistant"]), - content: ContentBlockSchema3 -}); -var GetPromptResultSchema3 = ResultSchema3.extend({ - description: optional3(string22()), - messages: array3(PromptMessageSchema3) -}); -var PromptListChangedNotificationSchema3 = NotificationSchema3.extend({ - method: literal3("notifications/prompts/list_changed") -}); -var ToolAnnotationsSchema3 = object22({ - title: string22().optional(), - readOnlyHint: boolean22().optional(), - destructiveHint: boolean22().optional(), - idempotentHint: boolean22().optional(), - openWorldHint: boolean22().optional() -}); -var ToolExecutionSchema3 = object22({ - taskSupport: _enum4(["required", "optional", "forbidden"]).optional() -}); -var ToolSchema3 = object22({ - ...BaseMetadataSchema3.shape, - ...IconsSchema3.shape, - description: string22().optional(), - inputSchema: object22({ - type: literal3("object"), - properties: record3(string22(), AssertObjectSchema3).optional(), - required: array3(string22()).optional() - }).catchall(unknown4()), - outputSchema: object22({ - type: literal3("object"), - properties: record3(string22(), AssertObjectSchema3).optional(), - required: array3(string22()).optional() - }).catchall(unknown4()).optional(), - annotations: optional3(ToolAnnotationsSchema3), - execution: optional3(ToolExecutionSchema3), - _meta: record3(string22(), unknown4()).optional() -}); -var ListToolsRequestSchema3 = PaginatedRequestSchema3.extend({ - method: literal3("tools/list") -}); -var ListToolsResultSchema3 = PaginatedResultSchema3.extend({ - tools: array3(ToolSchema3) -}); -var CallToolResultSchema3 = ResultSchema3.extend({ - content: array3(ContentBlockSchema3).default([]), - structuredContent: record3(string22(), unknown4()).optional(), - isError: optional3(boolean22()) -}); -var CompatibilityCallToolResultSchema3 = CallToolResultSchema3.or(ResultSchema3.extend({ - toolResult: unknown4() -})); -var CallToolRequestParamsSchema3 = BaseRequestParamsSchema3.extend({ - name: string22(), - arguments: optional3(record3(string22(), unknown4())) -}); -var CallToolRequestSchema3 = RequestSchema3.extend({ - method: literal3("tools/call"), - params: CallToolRequestParamsSchema3 -}); -var ToolListChangedNotificationSchema3 = NotificationSchema3.extend({ - method: literal3("notifications/tools/list_changed") -}); -var LoggingLevelSchema3 = _enum4(["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]); -var SetLevelRequestParamsSchema3 = BaseRequestParamsSchema3.extend({ - level: LoggingLevelSchema3 -}); -var SetLevelRequestSchema3 = RequestSchema3.extend({ - method: literal3("logging/setLevel"), - params: SetLevelRequestParamsSchema3 -}); -var LoggingMessageNotificationParamsSchema3 = NotificationsParamsSchema3.extend({ - level: LoggingLevelSchema3, - logger: string22().optional(), - data: unknown4() -}); -var LoggingMessageNotificationSchema3 = NotificationSchema3.extend({ - method: literal3("notifications/message"), - params: LoggingMessageNotificationParamsSchema3 -}); -var ModelHintSchema3 = object22({ - name: string22().optional() -}); -var ModelPreferencesSchema3 = object22({ - hints: optional3(array3(ModelHintSchema3)), - costPriority: optional3(number22().min(0).max(1)), - speedPriority: optional3(number22().min(0).max(1)), - intelligencePriority: optional3(number22().min(0).max(1)) -}); -var ToolChoiceSchema3 = object22({ - mode: optional3(_enum4(["auto", "required", "none"])) -}); -var ToolResultContentSchema3 = object22({ - type: literal3("tool_result"), - toolUseId: string22().describe("The unique identifier for the corresponding tool call."), - content: array3(ContentBlockSchema3).default([]), - structuredContent: object22({}).passthrough().optional(), - isError: optional3(boolean22()), - _meta: optional3(object22({}).passthrough()) -}).passthrough(); -var SamplingContentSchema3 = discriminatedUnion3("type", [TextContentSchema3, ImageContentSchema3, AudioContentSchema3]); -var SamplingMessageContentBlockSchema3 = discriminatedUnion3("type", [ - TextContentSchema3, - ImageContentSchema3, - AudioContentSchema3, - ToolUseContentSchema3, - ToolResultContentSchema3 -]); -var SamplingMessageSchema3 = object22({ - role: _enum4(["user", "assistant"]), - content: union3([SamplingMessageContentBlockSchema3, array3(SamplingMessageContentBlockSchema3)]), - _meta: optional3(object22({}).passthrough()) -}).passthrough(); -var CreateMessageRequestParamsSchema3 = BaseRequestParamsSchema3.extend({ - messages: array3(SamplingMessageSchema3), - modelPreferences: ModelPreferencesSchema3.optional(), - systemPrompt: string22().optional(), - includeContext: _enum4(["none", "thisServer", "allServers"]).optional(), - temperature: number22().optional(), - maxTokens: number22().int(), - stopSequences: array3(string22()).optional(), - metadata: AssertObjectSchema3.optional(), - tools: optional3(array3(ToolSchema3)), - toolChoice: optional3(ToolChoiceSchema3) -}); -var CreateMessageRequestSchema3 = RequestSchema3.extend({ - method: literal3("sampling/createMessage"), - params: CreateMessageRequestParamsSchema3 -}); -var CreateMessageResultSchema3 = ResultSchema3.extend({ - model: string22(), - stopReason: optional3(_enum4(["endTurn", "stopSequence", "maxTokens"]).or(string22())), - role: _enum4(["user", "assistant"]), - content: SamplingContentSchema3 -}); -var CreateMessageResultWithToolsSchema3 = ResultSchema3.extend({ - model: string22(), - stopReason: optional3(_enum4(["endTurn", "stopSequence", "maxTokens", "toolUse"]).or(string22())), - role: _enum4(["user", "assistant"]), - content: union3([SamplingMessageContentBlockSchema3, array3(SamplingMessageContentBlockSchema3)]) -}); -var BooleanSchemaSchema3 = object22({ - type: literal3("boolean"), - title: string22().optional(), - description: string22().optional(), - default: boolean22().optional() -}); -var StringSchemaSchema3 = object22({ - type: literal3("string"), - title: string22().optional(), - description: string22().optional(), - minLength: number22().optional(), - maxLength: number22().optional(), - format: _enum4(["email", "uri", "date", "date-time"]).optional(), - default: string22().optional() -}); -var NumberSchemaSchema3 = object22({ - type: _enum4(["number", "integer"]), - title: string22().optional(), - description: string22().optional(), - minimum: number22().optional(), - maximum: number22().optional(), - default: number22().optional() -}); -var UntitledSingleSelectEnumSchemaSchema3 = object22({ - type: literal3("string"), - title: string22().optional(), - description: string22().optional(), - enum: array3(string22()), - default: string22().optional() -}); -var TitledSingleSelectEnumSchemaSchema3 = object22({ - type: literal3("string"), - title: string22().optional(), - description: string22().optional(), - oneOf: array3(object22({ - const: string22(), - title: string22() - })), - default: string22().optional() -}); -var LegacyTitledEnumSchemaSchema3 = object22({ - type: literal3("string"), - title: string22().optional(), - description: string22().optional(), - enum: array3(string22()), - enumNames: array3(string22()).optional(), - default: string22().optional() -}); -var SingleSelectEnumSchemaSchema3 = union3([UntitledSingleSelectEnumSchemaSchema3, TitledSingleSelectEnumSchemaSchema3]); -var UntitledMultiSelectEnumSchemaSchema3 = object22({ - type: literal3("array"), - title: string22().optional(), - description: string22().optional(), - minItems: number22().optional(), - maxItems: number22().optional(), - items: object22({ - type: literal3("string"), - enum: array3(string22()) - }), - default: array3(string22()).optional() -}); -var TitledMultiSelectEnumSchemaSchema3 = object22({ - type: literal3("array"), - title: string22().optional(), - description: string22().optional(), - minItems: number22().optional(), - maxItems: number22().optional(), - items: object22({ - anyOf: array3(object22({ - const: string22(), - title: string22() - })) - }), - default: array3(string22()).optional() -}); -var MultiSelectEnumSchemaSchema3 = union3([UntitledMultiSelectEnumSchemaSchema3, TitledMultiSelectEnumSchemaSchema3]); -var EnumSchemaSchema3 = union3([LegacyTitledEnumSchemaSchema3, SingleSelectEnumSchemaSchema3, MultiSelectEnumSchemaSchema3]); -var PrimitiveSchemaDefinitionSchema3 = union3([EnumSchemaSchema3, BooleanSchemaSchema3, StringSchemaSchema3, NumberSchemaSchema3]); -var ElicitRequestFormParamsSchema3 = BaseRequestParamsSchema3.extend({ - mode: literal3("form").optional(), - message: string22(), - requestedSchema: object22({ - type: literal3("object"), - properties: record3(string22(), PrimitiveSchemaDefinitionSchema3), - required: array3(string22()).optional() - }) -}); -var ElicitRequestURLParamsSchema3 = BaseRequestParamsSchema3.extend({ - mode: literal3("url"), - message: string22(), - elicitationId: string22(), - url: string22().url() -}); -var ElicitRequestParamsSchema3 = union3([ElicitRequestFormParamsSchema3, ElicitRequestURLParamsSchema3]); -var ElicitRequestSchema3 = RequestSchema3.extend({ - method: literal3("elicitation/create"), - params: ElicitRequestParamsSchema3 -}); -var ElicitationCompleteNotificationParamsSchema3 = NotificationsParamsSchema3.extend({ - elicitationId: string22() -}); -var ElicitationCompleteNotificationSchema3 = NotificationSchema3.extend({ - method: literal3("notifications/elicitation/complete"), - params: ElicitationCompleteNotificationParamsSchema3 -}); -var ElicitResultSchema3 = ResultSchema3.extend({ - action: _enum4(["accept", "decline", "cancel"]), - content: preprocess3((val) => val === null ? void 0 : val, record3(string22(), union3([string22(), number22(), boolean22(), array3(string22())])).optional()) -}); -var ResourceTemplateReferenceSchema3 = object22({ - type: literal3("ref/resource"), - uri: string22() -}); -var PromptReferenceSchema3 = object22({ - type: literal3("ref/prompt"), - name: string22() -}); -var CompleteRequestParamsSchema3 = BaseRequestParamsSchema3.extend({ - ref: union3([PromptReferenceSchema3, ResourceTemplateReferenceSchema3]), - argument: object22({ - name: string22(), - value: string22() - }), - context: object22({ - arguments: record3(string22(), string22()).optional() - }).optional() -}); -var CompleteRequestSchema3 = RequestSchema3.extend({ - method: literal3("completion/complete"), - params: CompleteRequestParamsSchema3 -}); -var CompleteResultSchema3 = ResultSchema3.extend({ - completion: looseObject3({ - values: array3(string22()).max(100), - total: optional3(number22().int()), - hasMore: optional3(boolean22()) - }) -}); -var RootSchema3 = object22({ - uri: string22().startsWith("file://"), - name: string22().optional(), - _meta: record3(string22(), unknown4()).optional() -}); -var ListRootsRequestSchema3 = RequestSchema3.extend({ - method: literal3("roots/list") -}); -var ListRootsResultSchema3 = ResultSchema3.extend({ - roots: array3(RootSchema3) -}); -var RootsListChangedNotificationSchema3 = NotificationSchema3.extend({ - method: literal3("notifications/roots/list_changed") -}); -var ClientRequestSchema3 = union3([ - PingRequestSchema3, - InitializeRequestSchema3, - CompleteRequestSchema3, - SetLevelRequestSchema3, - GetPromptRequestSchema3, - ListPromptsRequestSchema3, - ListResourcesRequestSchema3, - ListResourceTemplatesRequestSchema3, - ReadResourceRequestSchema3, - SubscribeRequestSchema3, - UnsubscribeRequestSchema3, - CallToolRequestSchema3, - ListToolsRequestSchema3, - GetTaskRequestSchema3, - GetTaskPayloadRequestSchema3, - ListTasksRequestSchema3 -]); -var ClientNotificationSchema3 = union3([ - CancelledNotificationSchema3, - ProgressNotificationSchema3, - InitializedNotificationSchema3, - RootsListChangedNotificationSchema3, - TaskStatusNotificationSchema3 -]); -var ClientResultSchema3 = union3([ - EmptyResultSchema3, - CreateMessageResultSchema3, - CreateMessageResultWithToolsSchema3, - ElicitResultSchema3, - ListRootsResultSchema3, - GetTaskResultSchema3, - ListTasksResultSchema3, - CreateTaskResultSchema3 -]); -var ServerRequestSchema3 = union3([ - PingRequestSchema3, - CreateMessageRequestSchema3, - ElicitRequestSchema3, - ListRootsRequestSchema3, - GetTaskRequestSchema3, - GetTaskPayloadRequestSchema3, - ListTasksRequestSchema3 -]); -var ServerNotificationSchema3 = union3([ - CancelledNotificationSchema3, - ProgressNotificationSchema3, - LoggingMessageNotificationSchema3, - ResourceUpdatedNotificationSchema3, - ResourceListChangedNotificationSchema3, - ToolListChangedNotificationSchema3, - PromptListChangedNotificationSchema3, - TaskStatusNotificationSchema3, - ElicitationCompleteNotificationSchema3 -]); -var ServerResultSchema3 = union3([ - EmptyResultSchema3, - InitializeResultSchema3, - CompleteResultSchema3, - GetPromptResultSchema3, - ListPromptsResultSchema3, - ListResourcesResultSchema3, - ListResourceTemplatesResultSchema3, - ReadResourceResultSchema3, - CallToolResultSchema3, - ListToolsResultSchema3, - GetTaskResultSchema3, - ListTasksResultSchema3, - CreateTaskResultSchema3 -]); -var ignoreOverride2 = Symbol("Let zodToJsonSchema decide on which parser to use"); -var ALPHA_NUMERIC2 = new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789"); -var import_ajv3 = __toESM3(require_ajv3(), 1); -var import_ajv_formats2 = __toESM3(require_dist3(), 1); -var COMPLETABLE_SYMBOL = Symbol.for("mcp.completable"); -var McpZodTypeKind; -(function(McpZodTypeKind2) { - McpZodTypeKind2["Completable"] = "McpCompletable"; -})(McpZodTypeKind || (McpZodTypeKind = {})); -function query({ - prompt, - options -}) { - const { systemPrompt, settingSources, sandbox, ...rest } = options ?? {}; - let customSystemPrompt; - let appendSystemPrompt; - if (systemPrompt === void 0) { - customSystemPrompt = ""; - } else if (typeof systemPrompt === "string") { - customSystemPrompt = systemPrompt; - } else if (systemPrompt.type === "preset") { - appendSystemPrompt = systemPrompt.append; - } - let pathToClaudeCodeExecutable = rest.pathToClaudeCodeExecutable; - if (!pathToClaudeCodeExecutable) { - const filename = fileURLToPath2(import.meta.url); - const dirname2 = join52(filename, ".."); - pathToClaudeCodeExecutable = join52(dirname2, "cli.js"); - } - process.env.CLAUDE_AGENT_SDK_VERSION = "0.2.7"; - const { - abortController = createAbortController(), - additionalDirectories = [], - agents: agents2, - allowedTools = [], - betas, - canUseTool, - continue: continueConversation, - cwd: cwd2, - disallowedTools = [], - tools, - env: env3, - executable = isRunningWithBun() ? "bun" : "node", - executableArgs = [], - extraArgs = {}, - fallbackModel, - enableFileCheckpointing, - forkSession, - hooks, - includePartialMessages, - persistSession, - maxThinkingTokens, - maxTurns, - maxBudgetUsd, - mcpServers, - model, - outputFormat, - permissionMode = "default", - allowDangerouslySkipPermissions = false, - permissionPromptToolName, - plugins, - resume, - resumeSessionAt, - stderr, - strictMcpConfig - } = rest; - const jsonSchema2 = outputFormat?.type === "json_schema" ? outputFormat.schema : void 0; - let processEnv = env3; - if (!processEnv) { - processEnv = { ...process.env }; - } - if (!processEnv.CLAUDE_CODE_ENTRYPOINT) { - processEnv.CLAUDE_CODE_ENTRYPOINT = "sdk-ts"; - } - if (enableFileCheckpointing) { - processEnv.CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING = "true"; - } - if (!pathToClaudeCodeExecutable) { - throw new Error("pathToClaudeCodeExecutable is required"); - } - const allMcpServers = {}; - const sdkMcpServers = /* @__PURE__ */ new Map(); - if (mcpServers) { - for (const [name, config22] of Object.entries(mcpServers)) { - if (config22.type === "sdk" && "instance" in config22) { - sdkMcpServers.set(name, config22.instance); - allMcpServers[name] = { - type: "sdk", - name - }; - } else { - allMcpServers[name] = config22; - } - } - } - const isSingleUserTurn = typeof prompt === "string"; - const transport = new ProcessTransport({ - abortController, - additionalDirectories, - betas, - cwd: cwd2, - executable, - executableArgs, - extraArgs, - pathToClaudeCodeExecutable, - env: processEnv, - forkSession, - stderr, - maxThinkingTokens, - maxTurns, - maxBudgetUsd, - model, - fallbackModel, - jsonSchema: jsonSchema2, - permissionMode, - allowDangerouslySkipPermissions, - permissionPromptToolName, - continueConversation, - resume, - resumeSessionAt, - settingSources: settingSources ?? [], - allowedTools, - disallowedTools, - tools, - mcpServers: allMcpServers, - strictMcpConfig, - canUseTool: !!canUseTool, - hooks: !!hooks, - includePartialMessages, - persistSession, - plugins, - sandbox, - spawnClaudeCodeProcess: rest.spawnClaudeCodeProcess - }); - const initConfig = { - systemPrompt: customSystemPrompt, - appendSystemPrompt, - agents: agents2 - }; - const queryInstance = new Query(transport, isSingleUserTurn, canUseTool, hooks, abortController, sdkMcpServers, jsonSchema2, initConfig); - if (typeof prompt === "string") { - transport.write(jsonStringify({ - type: "user", - session_id: "", - message: { - role: "user", - content: [{ type: "text", text: prompt }] - }, - parent_tool_use_id: null - }) + ` -`); - } else { - queryInstance.streamInput(prompt); - } - return queryInstance; -} +// agents/claude.ts +import { mkdirSync as mkdirSync2, writeFileSync as writeFileSync6 } from "node:fs"; +import { join as join9 } from "node:path"; // package.json var package_default = { @@ -160293,10 +143775,10 @@ var package_default = { // utils/install.ts import { spawnSync as spawnSync2 } from "node:child_process"; -import { chmodSync, createWriteStream as createWriteStream2, existsSync as existsSync5 } from "node:fs"; +import { chmodSync, createWriteStream, existsSync as existsSync4 } from "node:fs"; import { mkdtemp } from "node:fs/promises"; import { tmpdir } from "node:os"; -import { join as join9 } from "node:path"; +import { join as join8 } from "node:path"; import { pipeline } from "node:stream/promises"; async function installFromNpmTarball(params) { let resolvedVersion = params.version; @@ -160311,16 +143793,16 @@ async function installFromNpmTarball(params) { const registryData = await registryResponse.json(); resolvedVersion = registryData["dist-tags"].latest; log.debug(`\xBB resolved to version ${resolvedVersion}`); - } catch (error50) { + } catch (error49) { log.warning( - `Failed to resolve version from registry: ${error50 instanceof Error ? error50.message : String(error50)}` + `Failed to resolve version from registry: ${error49 instanceof Error ? error49.message : String(error49)}` ); - throw error50; + throw error49; } } log.debug(`\xBB installing ${params.packageName}@${resolvedVersion}...`); const tempDir = process.env.PULLFROG_TEMP_DIR; - const tarballPath = join9(tempDir, "package.tgz"); + const tarballPath = join8(tempDir, "package.tgz"); const npmRegistry = process.env.NPM_REGISTRY || "https://registry.npmjs.org"; let tarballUrl; if (params.packageName.startsWith("@")) { @@ -160336,7 +143818,7 @@ async function installFromNpmTarball(params) { throw new Error(`Failed to download tarball: ${response.status} ${response.statusText}`); } if (!response.body) throw new Error("Response body is null"); - const fileStream = createWriteStream2(tarballPath); + const fileStream = createWriteStream(tarballPath); await pipeline(response.body, fileStream); log.debug(`\xBB downloaded tarball to ${tarballPath}`); log.debug(`\xBB extracting tarball...`); @@ -160349,9 +143831,9 @@ async function installFromNpmTarball(params) { `Failed to extract tarball: ${extractResult.stderr || extractResult.stdout || "Unknown error"}` ); } - const extractedDir = join9(tempDir, "package"); - const cliPath = join9(extractedDir, params.executablePath); - if (!existsSync5(cliPath)) { + const extractedDir = join8(tempDir, "package"); + const cliPath = join8(extractedDir, params.executablePath); + if (!existsSync4(cliPath)) { throw new Error(`Executable not found in extracted package at ${cliPath}`); } if (params.installDependencies) { @@ -160412,22 +143894,22 @@ async function installFromGithub(params) { const assetUrl = asset.browser_download_url; log.debug(`\xBB downloading asset from ${assetUrl}...`); const tempDirPrefix = `${params.owner}-${params.repo}-github-`; - const tempDirPath = await mkdtemp(join9(tmpdir(), tempDirPrefix)); + const tempDirPath = await mkdtemp(join8(tmpdir(), tempDirPrefix)); const urlPath = new URL(assetUrl).pathname; const fileName3 = urlPath.split("/").pop() || "asset"; - const downloadPath = join9(tempDirPath, fileName3); + const downloadPath = join8(tempDirPath, fileName3); const assetResponse = await fetchWithRetry(assetUrl, headers, "Failed to download asset"); if (!assetResponse.body) throw new Error("Response body is null"); - const fileStream = createWriteStream2(downloadPath); + const fileStream = createWriteStream(downloadPath); await pipeline(assetResponse.body, fileStream); log.debug(`\xBB downloaded asset to ${downloadPath}`); let cliPath; if (params.executablePath) { - cliPath = join9(tempDirPath, params.executablePath); + cliPath = join8(tempDirPath, params.executablePath); } else { cliPath = downloadPath; } - if (!existsSync5(cliPath)) { + if (!existsSync4(cliPath)) { throw new Error(`Executable not found at ${cliPath}`); } chmodSync(cliPath, 493); @@ -160437,14 +143919,14 @@ async function installFromGithub(params) { async function installFromCurl(params) { log.info(`\xBB installing ${params.executableName}...`); const tempDir = process.env.PULLFROG_TEMP_DIR; - const installScriptPath = join9(tempDir, "install.sh"); + const installScriptPath = join8(tempDir, "install.sh"); log.debug(`\xBB downloading install script from ${params.installUrl}...`); const installScriptResponse = await fetch(params.installUrl); if (!installScriptResponse.ok) { throw new Error(`Failed to download install script: ${installScriptResponse.status}`); } if (!installScriptResponse.body) throw new Error("Response body is null"); - const fileStream = createWriteStream2(installScriptPath); + const fileStream = createWriteStream(installScriptPath); await pipeline(installScriptResponse.body, fileStream); log.debug(`\xBB downloaded install script to ${installScriptPath}`); chmodSync(installScriptPath, 493); @@ -160456,7 +143938,7 @@ async function installFromCurl(params) { // ensuring a fresh install for each run HOME: tempDir, // XDG_CONFIG_HOME must match HOME so CLI tools find config in the right place - XDG_CONFIG_HOME: join9(tempDir, ".config"), + XDG_CONFIG_HOME: join8(tempDir, ".config"), SHELL: process.env.SHELL, USER: process.env.USER }, @@ -160469,8 +143951,8 @@ async function installFromCurl(params) { `Failed to install ${params.executableName}. Install script exited with code ${installResult.status}. Output: ${errorOutput}` ); } - const cliPath = join9(tempDir, ".local", "bin", params.executableName); - if (!existsSync5(cliPath)) { + const cliPath = join8(tempDir, ".local", "bin", params.executableName); + if (!existsSync4(cliPath)) { throw new Error(`Executable not found at ${cliPath}`); } chmodSync(cliPath, 493); @@ -160522,6 +144004,19 @@ function buildDisallowedTools(ctx) { if (bash !== "enabled") disallowed.push("Bash", "Task(Bash)"); return disallowed; } +function writeMcpConfig(ctx) { + const configDir = join9(ctx.tmpdir, ".claude"); + mkdirSync2(configDir, { recursive: true }); + const configPath = join9(configDir, "mcp.json"); + const mcpConfig = { + mcpServers: { + [ghPullfrogMcpName]: { type: "http", url: ctx.mcpServerUrl } + } + }; + writeFileSync6(configPath, JSON.stringify(mcpConfig, null, 2), "utf-8"); + log.info(`\xBB MCP config written to ${configPath}`); + return configPath; +} async function installClaude() { const versionRange = package_default.dependencies["@anthropic-ai/claude-agent-sdk"] || "latest"; return await installFromNpmTarball({ @@ -160541,34 +144036,82 @@ var claude = agent({ if (disallowedTools.length > 0) { log.info(`\xBB disallowed tools: ${disallowedTools.join(", ")}`); } - const queryOptions = { - permissionMode: "bypassPermissions", - disallowedTools, - mcpServers: { - [ghPullfrogMcpName]: { type: "http", url: ctx.mcpServerUrl } - }, + const mcpConfigPath = writeMcpConfig(ctx); + const args3 = [ + cliPath, + "-p", + ctx.instructions.full, + "--dangerously-skip-permissions", + "--mcp-config", + mcpConfigPath, + "--model", model, - pathToClaudeCodeExecutable: cliPath, - env: process.env - }; - const queryInstance = query({ - prompt: ctx.instructions.full, - options: queryOptions - }); - for await (const message of queryInstance) { - log.debug(JSON.stringify(message, null, 2)); - const handler2 = messageHandlers[message.type]; - await handler2(message); + "--output-format", + "stream-json", + "--verbose" + ]; + if (disallowedTools.length > 0) { + args3.push("--disallowedTools"); + args3.push(...disallowedTools); } + log.info("\xBB running Claude CLI..."); + let stdoutBuffer = ""; + let finalOutput2 = ""; + const bashToolIds = /* @__PURE__ */ new Set(); + const result = await spawn2({ + cmd: "node", + args: args3, + cwd: process.cwd(), + env: process.env, + stdio: ["ignore", "pipe", "pipe"], + onStdout: async (chunk) => { + finalOutput2 += chunk; + stdoutBuffer += chunk; + const lines = stdoutBuffer.split("\n"); + stdoutBuffer = lines.pop() || ""; + for (const line of lines) { + const trimmed = line.trim(); + if (!trimmed) continue; + try { + const message = JSON.parse(trimmed); + markActivity(); + log.debug(JSON.stringify(message, null, 2)); + const handler2 = messageHandlers[message.type]; + if (handler2) { + await handler2(message, bashToolIds); + } + } catch { + log.debug(`[claude] non-JSON stdout line: ${trimmed.substring(0, 200)}`); + } + } + }, + onStderr: (chunk) => { + const trimmed = chunk.trim(); + if (trimmed) { + log.debug(`[claude stderr] ${trimmed}`); + log.warning(trimmed); + finalOutput2 += trimmed + "\n"; + } + } + }); + if (result.exitCode !== 0) { + const errorMessage = result.stderr || finalOutput2 || result.stdout || "Unknown error - no output from Claude CLI"; + log.error(`Claude CLI exited with code ${result.exitCode}: ${errorMessage}`); + return { + success: false, + error: errorMessage, + output: finalOutput2 || result.stdout || "" + }; + } + log.info("\xBB Claude CLI completed successfully"); return { success: true, - output: "" + output: finalOutput2 || result.stdout || "" }; } }); -var bashToolIds = /* @__PURE__ */ new Set(); var messageHandlers = { - assistant: (data) => { + assistant: (data, bashToolIds) => { if (data.message?.content) { for (const content of data.message.content) { if (content.type === "text" && content.text?.trim()) { @@ -160585,14 +144128,14 @@ var messageHandlers = { } } }, - user: (data) => { + user: (data, bashToolIds) => { if (data.message?.content) { for (const content of data.message.content) { if (content.type === "tool_result") { const toolUseId = content.tool_use_id; const isBashTool = toolUseId && bashToolIds.has(toolUseId); + const outputContent = typeof content.content === "string" ? content.content : Array.isArray(content.content) ? content.content.map((c) => typeof c === "string" ? c : c.text || JSON.stringify(c)).join("\n") : String(content.content); if (isBashTool) { - const outputContent = typeof content.content === "string" ? content.content : Array.isArray(content.content) ? content.content.map((c) => typeof c === "string" ? c : c.text || JSON.stringify(c)).join("\n") : String(content.content); log.startGroup(`bash output`); if (content.is_error) { log.warning(outputContent); @@ -160602,8 +144145,9 @@ var messageHandlers = { log.endGroup(); bashToolIds.delete(toolUseId); } else if (content.is_error) { - const errorContent = typeof content.content === "string" ? content.content : String(content.content); - log.warning(`Tool error: ${errorContent}`); + log.warning(`Tool error: ${outputContent}`); + } else { + log.debug(`tool output: ${outputContent}`); } } } @@ -160652,365 +144196,12 @@ var messageHandlers = { }; // agents/codex.ts -import { mkdirSync as mkdirSync3, writeFileSync as writeFileSync6 } from "node:fs"; +import { mkdirSync as mkdirSync3, writeFileSync as writeFileSync7 } from "node:fs"; import { join as join10 } from "node:path"; - -// node_modules/.pnpm/@openai+codex-sdk@0.80.0/node_modules/@openai/codex-sdk/dist/index.js -import { promises as fs4 } from "fs"; -import os from "os"; -import path3 from "path"; -import { spawn as spawn4 } from "child_process"; -import path22 from "path"; -import readline from "readline"; -import { fileURLToPath } from "url"; -async function createOutputSchemaFile(schema2) { - if (schema2 === void 0) { - return { cleanup: async () => { - } }; - } - if (!isJsonObject2(schema2)) { - throw new Error("outputSchema must be a plain JSON object"); - } - const schemaDir = await fs4.mkdtemp(path3.join(os.tmpdir(), "codex-output-schema-")); - const schemaPath = path3.join(schemaDir, "schema.json"); - const cleanup = async () => { - try { - await fs4.rm(schemaDir, { recursive: true, force: true }); - } catch { - } - }; - try { - await fs4.writeFile(schemaPath, JSON.stringify(schema2), "utf8"); - return { schemaPath, cleanup }; - } catch (error50) { - await cleanup(); - throw error50; - } -} -function isJsonObject2(value2) { - return typeof value2 === "object" && value2 !== null && !Array.isArray(value2); -} -var Thread = class { - _exec; - _options; - _id; - _threadOptions; - /** Returns the ID of the thread. Populated after the first turn starts. */ - get id() { - return this._id; - } - /* @internal */ - constructor(exec, options, threadOptions, id = null) { - this._exec = exec; - this._options = options; - this._id = id; - this._threadOptions = threadOptions; - } - /** Provides the input to the agent and streams events as they are produced during the turn. */ - async runStreamed(input, turnOptions = {}) { - return { events: this.runStreamedInternal(input, turnOptions) }; - } - async *runStreamedInternal(input, turnOptions = {}) { - const { schemaPath, cleanup } = await createOutputSchemaFile(turnOptions.outputSchema); - const options = this._threadOptions; - const { prompt, images } = normalizeInput(input); - const generator = this._exec.run({ - input: prompt, - baseUrl: this._options.baseUrl, - apiKey: this._options.apiKey, - threadId: this._id, - images, - model: options?.model, - sandboxMode: options?.sandboxMode, - workingDirectory: options?.workingDirectory, - skipGitRepoCheck: options?.skipGitRepoCheck, - outputSchemaFile: schemaPath, - modelReasoningEffort: options?.modelReasoningEffort, - signal: turnOptions.signal, - networkAccessEnabled: options?.networkAccessEnabled, - webSearchEnabled: options?.webSearchEnabled, - approvalPolicy: options?.approvalPolicy, - additionalDirectories: options?.additionalDirectories - }); - try { - for await (const item of generator) { - let parsed2; - try { - parsed2 = JSON.parse(item); - } catch (error50) { - throw new Error(`Failed to parse item: ${item}`, { cause: error50 }); - } - if (parsed2.type === "thread.started") { - this._id = parsed2.thread_id; - } - yield parsed2; - } - } finally { - await cleanup(); - } - } - /** Provides the input to the agent and returns the completed turn. */ - async run(input, turnOptions = {}) { - const generator = this.runStreamedInternal(input, turnOptions); - const items = []; - let finalResponse = ""; - let usage = null; - let turnFailure = null; - for await (const event of generator) { - if (event.type === "item.completed") { - if (event.item.type === "agent_message") { - finalResponse = event.item.text; - } - items.push(event.item); - } else if (event.type === "turn.completed") { - usage = event.usage; - } else if (event.type === "turn.failed") { - turnFailure = event.error; - break; - } - } - if (turnFailure) { - throw new Error(turnFailure.message); - } - return { items, finalResponse, usage }; - } -}; -function normalizeInput(input) { - if (typeof input === "string") { - return { prompt: input, images: [] }; - } - const promptParts = []; - const images = []; - for (const item of input) { - if (item.type === "text") { - promptParts.push(item.text); - } else if (item.type === "local_image") { - images.push(item.path); - } - } - return { prompt: promptParts.join("\n\n"), images }; -} -var INTERNAL_ORIGINATOR_ENV = "CODEX_INTERNAL_ORIGINATOR_OVERRIDE"; -var TYPESCRIPT_SDK_ORIGINATOR = "codex_sdk_ts"; -var CodexExec = class { - executablePath; - envOverride; - constructor(executablePath = null, env3) { - this.executablePath = executablePath || findCodexPath(); - this.envOverride = env3; - } - async *run(args3) { - const commandArgs = ["exec", "--experimental-json"]; - if (args3.model) { - commandArgs.push("--model", args3.model); - } - if (args3.sandboxMode) { - commandArgs.push("--sandbox", args3.sandboxMode); - } - if (args3.workingDirectory) { - commandArgs.push("--cd", args3.workingDirectory); - } - if (args3.additionalDirectories?.length) { - for (const dir of args3.additionalDirectories) { - commandArgs.push("--add-dir", dir); - } - } - if (args3.skipGitRepoCheck) { - commandArgs.push("--skip-git-repo-check"); - } - if (args3.outputSchemaFile) { - commandArgs.push("--output-schema", args3.outputSchemaFile); - } - if (args3.modelReasoningEffort) { - commandArgs.push("--config", `model_reasoning_effort="${args3.modelReasoningEffort}"`); - } - if (args3.networkAccessEnabled !== void 0) { - commandArgs.push( - "--config", - `sandbox_workspace_write.network_access=${args3.networkAccessEnabled}` - ); - } - if (args3.webSearchEnabled !== void 0) { - commandArgs.push("--config", `features.web_search_request=${args3.webSearchEnabled}`); - } - if (args3.approvalPolicy) { - commandArgs.push("--config", `approval_policy="${args3.approvalPolicy}"`); - } - if (args3.images?.length) { - for (const image of args3.images) { - commandArgs.push("--image", image); - } - } - if (args3.threadId) { - commandArgs.push("resume", args3.threadId); - } - const env3 = {}; - if (this.envOverride) { - Object.assign(env3, this.envOverride); - } else { - for (const [key, value2] of Object.entries(process.env)) { - if (value2 !== void 0) { - env3[key] = value2; - } - } - } - if (!env3[INTERNAL_ORIGINATOR_ENV]) { - env3[INTERNAL_ORIGINATOR_ENV] = TYPESCRIPT_SDK_ORIGINATOR; - } - if (args3.baseUrl) { - env3.OPENAI_BASE_URL = args3.baseUrl; - } - if (args3.apiKey) { - env3.CODEX_API_KEY = args3.apiKey; - } - const child = spawn4(this.executablePath, commandArgs, { - env: env3, - signal: args3.signal - }); - let spawnError = null; - child.once("error", (err) => spawnError = err); - if (!child.stdin) { - child.kill(); - throw new Error("Child process has no stdin"); - } - child.stdin.write(args3.input); - child.stdin.end(); - if (!child.stdout) { - child.kill(); - throw new Error("Child process has no stdout"); - } - const stderrChunks = []; - if (child.stderr) { - child.stderr.on("data", (data) => { - stderrChunks.push(data); - }); - } - const exitPromise = new Promise( - (resolve2) => { - child.once("exit", (code, signal) => { - resolve2({ code, signal }); - }); - } - ); - const rl = readline.createInterface({ - input: child.stdout, - crlfDelay: Infinity - }); - try { - for await (const line of rl) { - yield line; - } - if (spawnError) throw spawnError; - const { code, signal } = await exitPromise; - if (code !== 0 || signal) { - const stderrBuffer = Buffer.concat(stderrChunks); - const detail = signal ? `signal ${signal}` : `code ${code ?? 1}`; - throw new Error(`Codex Exec exited with ${detail}: ${stderrBuffer.toString("utf8")}`); - } - } finally { - rl.close(); - child.removeAllListeners(); - try { - if (!child.killed) child.kill(); - } catch { - } - } - } -}; -var scriptFileName = fileURLToPath(import.meta.url); -var scriptDirName = path22.dirname(scriptFileName); -function findCodexPath() { - const { platform, arch } = process; - let targetTriple = null; - switch (platform) { - case "linux": - case "android": - switch (arch) { - case "x64": - targetTriple = "x86_64-unknown-linux-musl"; - break; - case "arm64": - targetTriple = "aarch64-unknown-linux-musl"; - break; - default: - break; - } - break; - case "darwin": - switch (arch) { - case "x64": - targetTriple = "x86_64-apple-darwin"; - break; - case "arm64": - targetTriple = "aarch64-apple-darwin"; - break; - default: - break; - } - break; - case "win32": - switch (arch) { - case "x64": - targetTriple = "x86_64-pc-windows-msvc"; - break; - case "arm64": - targetTriple = "aarch64-pc-windows-msvc"; - break; - default: - break; - } - break; - default: - break; - } - if (!targetTriple) { - throw new Error(`Unsupported platform: ${platform} (${arch})`); - } - const vendorRoot = path22.join(scriptDirName, "..", "vendor"); - const archRoot = path22.join(vendorRoot, targetTriple); - const codexBinaryName = process.platform === "win32" ? "codex.exe" : "codex"; - const binaryPath = path22.join(archRoot, "codex", codexBinaryName); - return binaryPath; -} -var Codex = class { - exec; - options; - constructor(options = {}) { - this.exec = new CodexExec(options.codexPathOverride, options.env); - this.options = options; - } - /** - * Starts a new conversation with an agent. - * @returns A new thread instance. - */ - startThread(options = {}) { - return new Thread(this.exec, this.options, options); - } - /** - * Resumes a conversation with an agent based on the thread id. - * Threads are persisted in ~/.codex/sessions. - * - * @param id The id of the thread to resume. - * @returns A new thread instance. - */ - resumeThread(id, options = {}) { - return new Thread(this.exec, this.options, options, id); - } -}; - -// agents/codex.ts -var codexModel = { - mini: "gpt-5.1-codex-mini", - // https://developers.openai.com/codex/models/ - // gpt-5.2-codex is not yet available via api key (even through codex cli) - auto: "gpt-5.1-codex", - max: "gpt-5.1-codex-max" -}; -var codexReasoningEffort = { - mini: "low", - auto: void 0, - // use default - max: "high" +var codexEffortConfig = { + mini: { model: "gpt-5.1-codex-mini", reasoningEffort: "low" }, + auto: { model: "gpt-5.1-codex" }, + max: { model: "gpt-5.1-codex-max", reasoningEffort: "high" } }; function writeCodexConfig(ctx) { const codexDir = join10(ctx.tmpdir, ".codex"); @@ -161027,7 +144218,7 @@ url = "${ctx.mcpServerUrl}"`]; } const featuresSection = features.length > 0 ? `[features] ${features.join("\n")}` : ""; - writeFileSync6( + writeFileSync7( configPath, `# written by pullfrog ${featuresSection} @@ -161051,71 +144242,103 @@ var codex = agent({ name: "codex", install: installCodex, run: async (ctx) => { - const cliPath = await installCodex(); - const configDir = join10(ctx.tmpdir, ".config", "codex"); - mkdirSync3(configDir, { recursive: true }); - const codexDir = writeCodexConfig(ctx); - process.env.HOME = ctx.tmpdir; - process.env.CODEX_HOME = codexDir; - const model = codexModel[ctx.payload.effort]; - const modelReasoningEffort = codexReasoningEffort[ctx.payload.effort]; - log.info(`\xBB using model: ${model}`); - if (modelReasoningEffort) { - log.info(`\xBB using modelReasoningEffort: ${modelReasoningEffort}`); - } const apiKey = process.env.OPENAI_API_KEY; if (!apiKey) { throw new Error("OPENAI_API_KEY is required for codex agent"); } - const codexOptions = { - apiKey, - codexPathOverride: cliPath - }; - const codex2 = new Codex(codexOptions); - const threadOptions = { - model, - approvalPolicy: "never", - // write: "disabled" → read-only sandbox, otherwise full access for git ops - sandboxMode: ctx.payload.write === "disabled" ? "read-only" : "danger-full-access", - // web: controls network access - networkAccessEnabled: ctx.payload.web !== "disabled", - // search: controls web search - webSearchEnabled: ctx.payload.search !== "disabled", - ...modelReasoningEffort && { modelReasoningEffort } - }; + const cliPath = await installCodex(); + const codexDir = writeCodexConfig(ctx); + const effortConfig = codexEffortConfig[ctx.payload.effort]; + log.info(`\xBB using model: ${effortConfig.model} (effort: ${ctx.payload.effort})`); + if (effortConfig.reasoningEffort) { + log.info(`\xBB using modelReasoningEffort: ${effortConfig.reasoningEffort}`); + } + const sandboxMode = ctx.payload.write === "disabled" ? "read-only" : "danger-full-access"; + const networkAccessEnabled = ctx.payload.web !== "disabled"; + const webSearchEnabled = ctx.payload.search !== "disabled"; + const args3 = [ + cliPath, + "exec", + ctx.instructions.full, + "--dangerously-bypass-approvals-and-sandbox", + "--model", + effortConfig.model, + "--sandbox", + sandboxMode, + "--json", + "--config", + `sandbox_workspace_write.network_access=${networkAccessEnabled}`, + "--config", + `features.web_search_request=${webSearchEnabled}` + ]; + if (effortConfig.reasoningEffort) { + args3.push("--config", `model_reasoning_effort="${effortConfig.reasoningEffort}"`); + } log.info( - `\xBB Codex options: sandboxMode=${threadOptions.sandboxMode}, networkAccessEnabled=${threadOptions.networkAccessEnabled}, webSearchEnabled=${threadOptions.webSearchEnabled}` + `\xBB Codex options: sandboxMode=${sandboxMode}, networkAccess=${networkAccessEnabled}, webSearch=${webSearchEnabled}` ); - const thread = codex2.startThread(threadOptions); - try { - const streamedTurn = await thread.runStreamed(ctx.instructions.full); - let finalOutput2 = ""; - for await (const event of streamedTurn.events) { - const handler2 = messageHandlers2[event.type]; - log.debug(JSON.stringify(event, null, 2)); - if (handler2) { - handler2(event); + log.info("\xBB running Codex CLI..."); + let stdoutBuffer = ""; + let finalOutput2 = ""; + const commandExecutionIds = /* @__PURE__ */ new Set(); + const env3 = { + ...process.env, + HOME: ctx.tmpdir, + CODEX_HOME: codexDir, + CODEX_API_KEY: apiKey + }; + const result = await spawn2({ + cmd: "node", + args: args3, + cwd: process.cwd(), + env: env3, + stdio: ["ignore", "pipe", "pipe"], + onStdout: async (chunk) => { + finalOutput2 += chunk; + stdoutBuffer += chunk; + const lines = stdoutBuffer.split("\n"); + stdoutBuffer = lines.pop() || ""; + for (const line of lines) { + const trimmed = line.trim(); + if (!trimmed) continue; + try { + const event = JSON.parse(trimmed); + markActivity(); + log.debug(JSON.stringify(event, null, 2)); + const handler2 = messageHandlers2[event.type]; + if (handler2) { + await handler2(event, commandExecutionIds); + } + } catch { + log.debug(`[codex] non-JSON stdout line: ${trimmed.substring(0, 200)}`); + } } - if (event.type === "item.completed" && event.item.type === "agent_message") { - finalOutput2 = event.item.text; + }, + onStderr: (chunk) => { + const trimmed = chunk.trim(); + if (trimmed) { + log.debug(`[codex stderr] ${trimmed}`); + log.warning(trimmed); + finalOutput2 += trimmed + "\n"; } } - return { - success: true, - output: finalOutput2 - }; - } catch (error50) { - const errorMessage = error50 instanceof Error ? error50.message : String(error50); - log.error(`Codex execution failed: ${errorMessage}`); + }); + if (result.exitCode !== 0) { + const errorMessage = result.stderr || finalOutput2 || result.stdout || "Unknown error - no output from Codex CLI"; + log.error(`Codex CLI exited with code ${result.exitCode}: ${errorMessage}`); return { success: false, error: errorMessage, - output: "" + output: finalOutput2 || result.stdout || "" }; } + log.info("\xBB Codex CLI completed successfully"); + return { + success: true, + output: finalOutput2 || result.stdout || "" + }; } }); -var commandExecutionIds = /* @__PURE__ */ new Set(); var messageHandlers2 = { "thread.started": () => { }, @@ -161138,7 +144361,7 @@ var messageHandlers2 = { "turn.failed": (event) => { log.error(`Turn failed: ${event.error.message}`); }, - "item.started": (event) => { + "item.started": (event, commandExecutionIds) => { const item = event.item; if (item.type === "command_execution") { commandExecutionIds.add(item.id); @@ -161164,7 +144387,7 @@ var messageHandlers2 = { } } }, - "item.completed": (event) => { + "item.completed": (event, commandExecutionIds) => { const item = event.item; if (item.type === "agent_message") { log.box(item.text.trim(), { title: "Codex" }); @@ -161200,9 +144423,9 @@ var messageHandlers2 = { }; // agents/cursor.ts -import { spawn as spawn5 } from "node:child_process"; -import { existsSync as existsSync6, mkdirSync as mkdirSync4, readFileSync as readFileSync4, writeFileSync as writeFileSync7 } from "node:fs"; -import { homedir as homedir2 } from "node:os"; +import { spawn as spawn3 } from "node:child_process"; +import { existsSync as existsSync5, mkdirSync as mkdirSync4, readFileSync as readFileSync3, writeFileSync as writeFileSync8 } from "node:fs"; +import { homedir } from "node:os"; import { join as join11 } from "node:path"; var cursorEffortModels = { mini: null, @@ -161230,9 +144453,9 @@ var cursor = agent({ configureCursorTools(ctx); const projectCliConfigPath = join11(process.cwd(), ".cursor", "cli.json"); let modelOverride = null; - if (existsSync6(projectCliConfigPath)) { + if (existsSync5(projectCliConfigPath)) { try { - const projectConfig = JSON.parse(readFileSync4(projectCliConfigPath, "utf-8")); + const projectConfig = JSON.parse(readFileSync3(projectCliConfigPath, "utf-8")); if (projectConfig.model) { log.info(`\xBB using model from project .cursor/cli.json: ${projectConfig.model}`); } else { @@ -161246,7 +144469,7 @@ var cursor = agent({ } if (modelOverride) { log.info(`\xBB using model: ${modelOverride}, effort=${ctx.payload.effort}`); - } else if (!existsSync6(projectCliConfigPath)) { + } else if (!existsSync5(projectCliConfigPath)) { log.info(`\xBB using default model, effort=${ctx.payload.effort}`); } const loggedModelCallIds = /* @__PURE__ */ new Set(); @@ -161325,7 +144548,7 @@ var cursor = agent({ Object.entries(process.env).filter(([key]) => key !== "XDG_CONFIG_HOME") ); return new Promise((resolve2) => { - const child = spawn5(cliPath, cursorArgs, { + const child = spawn3(cliPath, cursorArgs, { cwd: process.cwd(), env: cliEnv, stdio: ["ignore", "pipe", "pipe"] @@ -161340,6 +144563,7 @@ var cursor = agent({ stdout += text; try { const event = JSON.parse(text); + markActivity(); log.debug(JSON.stringify(event, null, 2)); if (event.type === "thinking" && event.subtype === "delta" && !event.text) { return; @@ -161361,16 +144585,16 @@ var cursor = agent({ if (signal) { log.warning(`Cursor CLI terminated by signal: ${signal}`); } - const duration5 = ((Date.now() - startTime) / 1e3).toFixed(1); + const duration4 = ((Date.now() - startTime) / 1e3).toFixed(1); if (code === 0) { - log.success(`Cursor CLI completed successfully in ${duration5}s`); + log.success(`Cursor CLI completed successfully in ${duration4}s`); resolve2({ success: true, output: stdout.trim() }); } else { const errorMessage = stderr || `Cursor CLI exited with code ${code}`; - log.error(`Cursor CLI failed after ${duration5}s: ${errorMessage}`); + log.error(`Cursor CLI failed after ${duration4}s: ${errorMessage}`); resolve2({ success: false, error: errorMessage, @@ -161378,10 +144602,10 @@ var cursor = agent({ }); } }); - child.on("error", (error50) => { - const duration5 = ((Date.now() - startTime) / 1e3).toFixed(1); - const errorMessage = error50.message || String(error50); - log.error(`Cursor CLI execution failed after ${duration5}s: ${errorMessage}`); + child.on("error", (error49) => { + const duration4 = ((Date.now() - startTime) / 1e3).toFixed(1); + const errorMessage = error49.message || String(error49); + log.error(`Cursor CLI execution failed after ${duration4}s: ${errorMessage}`); resolve2({ success: false, error: errorMessage, @@ -161389,8 +144613,8 @@ var cursor = agent({ }); }); }); - } catch (error50) { - const errorMessage = error50 instanceof Error ? error50.message : String(error50); + } catch (error49) { + const errorMessage = error49 instanceof Error ? error49.message : String(error49); log.error(`Cursor execution failed: ${errorMessage}`); return { success: false, @@ -161401,7 +144625,7 @@ var cursor = agent({ } }); function getCursorConfigDir() { - return join11(homedir2(), ".cursor"); + return join11(homedir(), ".cursor"); } function configureCursorMcpServers(ctx) { const cursorConfigDir = getCursorConfigDir(); @@ -161410,7 +144634,7 @@ function configureCursorMcpServers(ctx) { const mcpServers = { [ghPullfrogMcpName]: { type: "http", url: ctx.mcpServerUrl } }; - writeFileSync7(mcpConfigPath, JSON.stringify({ mcpServers }, null, 2), "utf-8"); + writeFileSync8(mcpConfigPath, JSON.stringify({ mcpServers }, null, 2), "utf-8"); log.info(`\xBB MCP config written to ${mcpConfigPath}`); } function configureCursorTools(ctx) { @@ -161422,25 +144646,25 @@ function configureCursorTools(ctx) { if (ctx.payload.search === "disabled") deny.push("WebSearch"); if (ctx.payload.write === "disabled") deny.push("Write(**)"); if (bash !== "enabled") deny.push("Shell(*)"); - const config4 = { + const config3 = { permissions: { allow: ctx.payload.write === "disabled" ? ["Read(**)"] : ["Read(**)", "Write(**)"], deny } }; if (ctx.payload.web === "disabled") { - config4.sandbox = { + config3.sandbox = { mode: "enabled", networkAccess: "allowlist" }; } - writeFileSync7(cliConfigPath, JSON.stringify(config4, null, 2), "utf-8"); - log.info(`\xBB CLI config written to ${cliConfigPath}`, JSON.stringify(config4, null, 2)); + writeFileSync8(cliConfigPath, JSON.stringify(config3, null, 2), "utf-8"); + log.info(`\xBB CLI config written to ${cliConfigPath}`, JSON.stringify(config3, null, 2)); } // agents/gemini.ts -import { mkdirSync as mkdirSync5, readFileSync as readFileSync5, writeFileSync as writeFileSync8 } from "node:fs"; -import { homedir as homedir3 } from "node:os"; +import { mkdirSync as mkdirSync5, readFileSync as readFileSync4, writeFileSync as writeFileSync9 } from "node:fs"; +import { homedir as homedir2 } from "node:os"; import { join as join12 } from "node:path"; var geminiEffortConfig = { // https://ai.google.dev/gemini-api/docs/models @@ -161567,6 +144791,7 @@ var gemini = agent({ log.debug(`[gemini stdout] ${trimmed}`); try { const event = JSON.parse(trimmed); + markActivity(); const handler2 = messageHandlers3[event.type]; if (handler2) { await handler2(event); @@ -161600,8 +144825,8 @@ var gemini = agent({ success: true, output: finalOutput2 }; - } catch (error50) { - const errorMessage = error50 instanceof Error ? error50.message : String(error50); + } catch (error49) { + const errorMessage = error49 instanceof Error ? error49.message : String(error49); log.error(`Failed to run Gemini CLI: ${errorMessage}`); return { success: false, @@ -161614,13 +144839,13 @@ var gemini = agent({ function configureGeminiSettings(ctx) { const { model, thinkingLevel } = geminiEffortConfig[ctx.payload.effort]; log.info(`\xBB using model: ${model}, thinkingLevel: ${thinkingLevel}`); - const realHome = homedir3(); + const realHome = homedir2(); const geminiConfigDir = join12(realHome, ".gemini"); const settingsPath = join12(geminiConfigDir, "settings.json"); mkdirSync5(geminiConfigDir, { recursive: true }); let existingSettings = {}; try { - const content = readFileSync5(settingsPath, "utf-8"); + const content = readFileSync4(settingsPath, "utf-8"); existingSettings = JSON.parse(content); } catch { } @@ -161653,7 +144878,7 @@ function configureGeminiSettings(ctx) { // v0.3.0+ nested format ...exclude.length > 0 && { tools: { exclude } } }; - writeFileSync8(settingsPath, JSON.stringify(newSettings, null, 2), "utf-8"); + writeFileSync9(settingsPath, JSON.stringify(newSettings, null, 2), "utf-8"); log.info(`\xBB Gemini settings written to ${settingsPath}`); if (exclude.length > 0) { log.info(`\xBB excluded tools: ${exclude.join(", ")}`); @@ -161662,7 +144887,7 @@ function configureGeminiSettings(ctx) { } // agents/opencode.ts -import { mkdirSync as mkdirSync6, writeFileSync as writeFileSync9 } from "node:fs"; +import { mkdirSync as mkdirSync6, writeFileSync as writeFileSync10 } from "node:fs"; import { join as join13 } from "node:path"; async function installOpencode() { return await installFromNpmTarball({ @@ -161697,7 +144922,6 @@ var opencode = agent({ log.debug(`\xBB HOME: ${env3.HOME}`); log.debug(`\xBB XDG_CONFIG_HOME: ${env3.XDG_CONFIG_HOME}`); const startTime = Date.now(); - let lastActivityTime = startTime; let eventCount = 0; let output = ""; let stdoutBuffer = ""; @@ -161724,7 +144948,7 @@ var opencode = agent({ const event = JSON.parse(trimmed); eventCount++; log.debug(JSON.stringify(event, null, 2)); - const timeSinceLastActivity = Date.now() - lastActivityTime; + const timeSinceLastActivity = getIdleMs(); if (timeSinceLastActivity > 1e4) { const activeToolCalls = toolCallTimings.size; const toolCallInfo = activeToolCalls > 0 ? ` (waiting for ${activeToolCalls} tool call${activeToolCalls > 1 ? "s" : ""})` : " (OpenCode may be processing internally - LLM calls, planning, etc.)"; @@ -161732,7 +144956,7 @@ var opencode = agent({ `\xBB no activity for ${(timeSinceLastActivity / 1e3).toFixed(1)}s${toolCallInfo} (${eventCount} events processed so far)` ); } - lastActivityTime = Date.now(); + markActivity(); const handler2 = messageHandlers4[event.type]; if (handler2) { await handler2(event); @@ -161758,8 +144982,8 @@ var opencode = agent({ } } }); - const duration5 = Date.now() - startTime; - log.info(`\xBB OpenCode CLI completed in ${duration5}ms with exit code ${result.exitCode}`); + const duration4 = Date.now() - startTime; + log.info(`\xBB OpenCode CLI completed in ${duration4}ms with exit code ${result.exitCode}`); if (!tokensLogged && (accumulatedTokens.input > 0 || accumulatedTokens.output > 0)) { const totalTokens = accumulatedTokens.input + accumulatedTokens.output; log.table([ @@ -161803,18 +145027,18 @@ function configureOpenCode(ctx) { doom_loop: "allow", external_directory: "allow" }; - const config4 = { + const config3 = { mcp: opencodeMcpServers, permission }; - const configJson = JSON.stringify(config4, null, 2); + const configJson = JSON.stringify(config3, null, 2); try { - writeFileSync9(configPath, configJson, "utf-8"); - } catch (error50) { + writeFileSync10(configPath, configJson, "utf-8"); + } catch (error49) { log.error( - `failed to write OpenCode config to ${configPath}: ${error50 instanceof Error ? error50.message : String(error50)}` + `failed to write OpenCode config to ${configPath}: ${error49 instanceof Error ? error49.message : String(error49)}` ); - throw error50; + throw error49; } log.info(`\xBB OpenCode config written to ${configPath}`); log.info( @@ -161944,10 +145168,10 @@ var messageHandlers4 = { }, result: async (event) => { const status = event.status || "unknown"; - const duration5 = event.stats?.duration_ms || 0; + const duration4 = event.stats?.duration_ms || 0; const toolCalls = event.stats?.tool_calls || 0; log.info( - `\xBB OpenCode result: status=${status}, duration=${duration5}ms, tool_calls=${toolCalls}` + `\xBB OpenCode result: status=${status}, duration=${duration4}ms, tool_calls=${toolCalls}` ); if (event.status === "error") { log.error(`\xBB OpenCode CLI failed: ${JSON.stringify(event)}`); @@ -161955,7 +145179,7 @@ var messageHandlers4 = { const inputTokens = event.stats?.input_tokens || accumulatedTokens.input || 0; const outputTokens = event.stats?.output_tokens || accumulatedTokens.output || 0; const totalTokens = event.stats?.total_tokens || inputTokens + outputTokens; - log.info(`\xBB run complete: tool_calls=${toolCalls}, duration=${duration5}ms`); + log.info(`\xBB run complete: tool_calls=${toolCalls}, duration=${duration4}ms`); if ((inputTokens > 0 || outputTokens > 0) && !tokensLogged) { log.table([ [ @@ -162548,8 +145772,9 @@ var JsonPayload = type({ "repoInstructions?": "string", "event?": "object", "effort?": Effort.or("undefined"), - "timeout?": type.string.or("undefined"), - "progressCommentId?": type.string.or("undefined") + "timeout?": "string | undefined", + "progressCommentId?": "string | undefined", + "debug?": "boolean | undefined" }); var COLLABORATOR_PERMISSIONS = ["admin", "maintain", "write"]; function isCollaborator(event) { @@ -162573,11 +145798,11 @@ function isAgentName(value2) { function isPayloadEvent(value2) { return typeof value2 === "object" && value2 !== null && "trigger" in value2; } -function resolveCwd(cwd2) { +function resolveCwd(cwd) { const workspace = process.env.GITHUB_WORKSPACE; - if (!cwd2) return workspace; - if (isAbsolute(cwd2)) return cwd2; - return workspace ? resolve(workspace, cwd2) : cwd2; + if (!cwd) return workspace; + if (isAbsolute(cwd)) return cwd; + return workspace ? resolve(workspace, cwd) : cwd; } function resolvePromptInput() { const prompt = core4.getInput("prompt", { required: true }); @@ -162637,6 +145862,7 @@ function resolvePayload(resolvedPromptInput, repoSettings) { effort: inputs.effort ?? jsonPayload?.effort ?? "auto", timeout: inputs.timeout ?? jsonPayload?.timeout, cwd: resolveCwd(inputs.cwd), + debug: jsonPayload?.debug, // permissions: inputs > repoSettings > fallbacks web: inputs.web ?? repoSettings.web ?? "enabled", search: inputs.search ?? repoSettings.search ?? "enabled", @@ -162773,9 +145999,9 @@ async function setupGit(params) { stdio: "pipe" }); } - } catch (error50) { + } catch (error49) { log.warning( - `Failed to set git config: ${error50 instanceof Error ? error50.message : String(error50)}` + `Failed to set git config: ${error49 instanceof Error ? error49.message : String(error49)}` ); } log.info("\xBB setting up git authentication..."); @@ -162833,8 +146059,8 @@ var Timer = class { } checkpoint(name) { const now = Date.now(); - const duration5 = this.lastCheckpointTimestamp ? now - this.lastCheckpointTimestamp : now - this.initialTimestamp; - log.debug(`\xBB ${name}: ${duration5}ms`); + const duration4 = this.lastCheckpointTimestamp ? now - this.lastCheckpointTimestamp : now - this.initialTimestamp; + log.debug(`\xBB ${name}: ${duration4}ms`); this.lastCheckpointTimestamp = now; } }; @@ -162885,6 +146111,10 @@ async function main() { var _stack = []; try { const payload = resolvePayload(resolvedPromptInput, runContext.repoSettings); + if (payload.debug) { + process.env.LOG_LEVEL = "debug"; + log.info("\xBB debug mode enabled via #debug macro"); + } if (payload.cwd && process.cwd() !== payload.cwd) { process.chdir(payload.cwd); } @@ -162990,8 +146220,8 @@ async function main() { var _promise2 = __callDispose(_stack, _error, _hasError); _promise2 && await _promise2; } - } catch (error50) { - const errorMessage = error50 instanceof Error ? error50.message : "unknown error occurred"; + } catch (error49) { + const errorMessage = error49 instanceof Error ? error49.message : "unknown error occurred"; killTrackedChildren(); log.error(errorMessage); try { @@ -163025,8 +146255,8 @@ async function run() { if (result.result) { core5.setOutput("result", result.result); } - } catch (error50) { - const errorMessage = error50 instanceof Error ? error50.message : "Unknown error occurred"; + } catch (error49) { + const errorMessage = error49 instanceof Error ? error49.message : "Unknown error occurred"; core5.setFailed(`Action failed: ${errorMessage}`); } finally { await runCleanup(); diff --git a/external.ts b/external.ts index 988251a..9cf9f0e 100644 --- a/external.ts +++ b/external.ts @@ -261,6 +261,8 @@ export interface WriteablePayload { cwd?: string | undefined; /** pre-created progress comment ID for updating status */ progressCommentId?: string | undefined; + /** whether debug mode is enabled (LOG_LEVEL=debug) */ + debug?: boolean | undefined; } // immutable payload type for agent execution diff --git a/lint/sdk-type-only-imports.grit b/lint/sdk-type-only-imports.grit new file mode 100644 index 0000000..5e4e239 --- /dev/null +++ b/lint/sdk-type-only-imports.grit @@ -0,0 +1,16 @@ +// Enforce type-only imports from SDK packages +// These SDK packages should only be used for type imports (stream output parsing) +// Runtime SDK usage should be replaced with CLI invocations +// Note: This rule only catches single-specifier imports; for multi-specifier imports, +// the noUnusedImports rule will flag unused runtime imports + +or { + `import { $specifiers } from "@anthropic-ai/claude-agent-sdk"`, + `import { $specifiers } from "@openai/codex-sdk"`, + `import { $specifiers } from "@opencode-ai/sdk"` +} as $import where { + register_diagnostic( + span = $import, + message = "SDK packages must use `import type` only. Use CLI invocation instead of runtime SDK usage." + ) +} diff --git a/main.ts b/main.ts index ce2682c..81e1c54 100644 --- a/main.ts +++ b/main.ts @@ -64,6 +64,13 @@ export async function main(): Promise { // resolve payload after runContextData so permissions can use DB settings // precedence: action inputs > json payload > repoSettings > fallbacks const payload = resolvePayload(resolvedPromptInput, runContext.repoSettings); + + // enable debug logging if #debug macro was used + if (payload.debug) { + process.env.LOG_LEVEL = "debug"; + log.info("» debug mode enabled via #debug macro"); + } + if (payload.cwd && process.cwd() !== payload.cwd) { process.chdir(payload.cwd); } diff --git a/modes.ts b/modes.ts index 515d11f..2204987 100644 --- a/modes.ts +++ b/modes.ts @@ -116,17 +116,19 @@ export function computeModes(): Mode[] { - **Consider lifecycle**: Initialization, cleanup, error recovery. Are resources acquired before use? Released after? What happens on cancellation? - Do NOT stop at "this looks reasonable." Dig until you either find a problem or have concrete evidence there isn't one. -4. **DRAFT** - For each issue found, create an inline comment. Use the NEW line number from the diff (second column: \`| OLD | NEW | TYPE | CODE\`). +4. **DRAFT LINE-BY-LINE COMMENTS** - For each issue found, draft an inline comment on the specific line. Use the NEW line number from the diff (second column: \`| OLD | NEW | TYPE | CODE\`). If no issues found, skip to step 6. -5. **FILTER** - Remove noise, keep substance: - - Remove style-only comments (formatting, naming conventions) unless they cause real confusion - - Remove compliments that aren't actionable - - Keep: bugs, logic errors, missing error handling, security issues, race conditions, resource leaks, incorrect assumptions +5. **FILTER LINE-BY-LINE COMMENTS** - Each inline comment must be actionable. Remove anything that doesn't require action: + - **Not actionable → no comment**: Do NOT create inline comments for compliments (e.g., "this looks clean", "nice refactor") or general observations. These waste reviewer attention. + - **Actionable by agent → keep**: Bugs, logic errors, missing error handling, security issues, race conditions, resource leaks, incorrect assumptions. + - **Requires human decision → keep**: If something needs human judgment (architectural choice, product decision, tradeoff evaluation), create a comment clearly stating what decision is needed and why. + - Remove style-only comments (formatting, naming conventions) unless they cause real confusion. -6. **SUBMIT** — Use ${ghPullfrogMcpName}/create_pull_request_review: - - \`comments\`: Inline feedback on specific diff lines - - \`body\`: 1-3 sentence summary with urgency level and any concerns about code outside the diff - - If no issues found, submit with empty comments and a brief approving body +6. **WRITE SUMMARY** - Draft a 1-3 sentence summary for the review body. Include urgency level and any concerns about code outside the diff. + +7. **SUBMIT** — Use ${ghPullfrogMcpName}/create_pull_request_review: + - \`body\`: The summary from step 6 + - \`comments\`: The filtered inline comments from step 5 ${permalinkTip} `, diff --git a/test/adhoc/nobashcreative.ts b/test/adhoc/nobashcreative.ts index 57fc2a7..144b938 100644 --- a/test/adhoc/nobashcreative.ts +++ b/test/adhoc/nobashcreative.ts @@ -53,8 +53,9 @@ function validator(result: AgentResult): ValidationCheck[] { } export const test: TestRunnerOptions = { - name: "nobashcreative tests", + name: "nobashcreative", fixture, validator, agentEnv, + tags: ["adhoc"], }; diff --git a/test/agnostic/timeout.ts b/test/agnostic/timeout.ts index 32cd382..1d68477 100644 --- a/test/agnostic/timeout.ts +++ b/test/agnostic/timeout.ts @@ -25,9 +25,9 @@ function validator(result: AgentResult): ValidationCheck[] { } export const test: TestRunnerOptions = { - name: "timeout tests", + name: "timeout", fixture, validator, expectFailure: true, - agnostic: true, + tags: ["agnostic"], }; diff --git a/test/crossagent/mcpmerge.ts b/test/crossagent/mcpmerge.ts new file mode 100644 index 0000000..13ee190 --- /dev/null +++ b/test/crossagent/mcpmerge.ts @@ -0,0 +1,86 @@ +import type { AgentResult, TestRunnerOptions, ValidationCheck } from "../utils.ts"; +import { defineFixture, generateAgentUuids, getStructuredOutput } from "../utils.ts"; + +/** + * MCP merge tests - validate MCP server configuration with repo-level MCP configs present. + * + * uses GITHUB_REPOSITORY=pullfrog/test-repo-mcp which has robinMCP server. + * + * two variants: + * - mcpmerge-full: validates repo-level MCP servers merge correctly with gh_pullfrog + * (claude, cursor, gemini, opencode - agents that auto-discover repo MCPs) + * - mcpmerge-pullfrog-only: validates gh_pullfrog remains available when repo has MCP config + * (codex - doesn't auto-discover repo MCPs) + */ + +// shared env for both tests +const sharedEnv = { + GITHUB_REPOSITORY: "pullfrog/test-repo-mcp", +}; + +// --- mcpmerge-full: test repo-level MCP discovery --- + +const fullTestUuids = generateAgentUuids(["PULLFROG_MCP_TEST"]); + +const fullFixture = defineFixture( + { + prompt: `Call the get_test_value tool from the robinMCP server, then call set_output with the exact value returned.`, + effort: "mini", + }, + { localOnly: true } +); + +function fullValidator(result: AgentResult): ValidationCheck[] { + const output = getStructuredOutput(result); + const setOutputCalled = output !== null; + const expectedUuid = fullTestUuids.getUuid(result.agent, "PULLFROG_MCP_TEST"); + const correctValue = setOutputCalled && output === expectedUuid; + + return [ + { name: "set_output", passed: setOutputCalled }, + { name: "repo_mcp", passed: correctValue }, + ]; +} + +// --- mcpmerge-pullfrog-only: test gh_pullfrog availability only --- + +const baseFixture = defineFixture( + { + prompt: `Call set_output with "PULLFROG_MCP_WORKS".`, + effort: "mini", + }, + { localOnly: true } +); + +function baseValidator(result: AgentResult): ValidationCheck[] { + const output = getStructuredOutput(result); + const setOutputCalled = output !== null; + const correctValue = setOutputCalled && output === "PULLFROG_MCP_WORKS"; + + return [ + { name: "set_output", passed: setOutputCalled }, + { name: "correct_value", passed: correctValue }, + ]; +} + +// --- exports --- + +export const tests: Record = { + "mcpmerge-full": { + name: "mcpmerge-full", + fixture: fullFixture, + validator: fullValidator, + tags: ["mcpmerge"], + agents: ["claude", "cursor", "gemini", "opencode"], + env: sharedEnv, + agentEnv: fullTestUuids.agentEnv, + }, + "mcpmerge-pullfrog-only": { + name: "mcpmerge-pullfrog-only", + fixture: baseFixture, + validator: baseValidator, + tags: ["mcpmerge"], + agents: ["codex"], + env: sharedEnv, + }, +}; diff --git a/test/crossagent/nobash.ts b/test/crossagent/nobash.ts index 9a8b09f..95a58d4 100644 --- a/test/crossagent/nobash.ts +++ b/test/crossagent/nobash.ts @@ -39,7 +39,7 @@ function validator(result: AgentResult): ValidationCheck[] { } export const test: TestRunnerOptions = { - name: "nobash tests", + name: "nobash", fixture, validator, agentEnv, diff --git a/test/crossagent/restricted.ts b/test/crossagent/restricted.ts index e96c33b..7d1751c 100644 --- a/test/crossagent/restricted.ts +++ b/test/crossagent/restricted.ts @@ -49,7 +49,7 @@ function validator(result: AgentResult): ValidationCheck[] { } export const test: TestRunnerOptions = { - name: "restricted tests", + name: "restricted", fixture, validator, agentEnv, diff --git a/test/crossagent/smoke.ts b/test/crossagent/smoke.ts index 8d302c5..fe4d443 100644 --- a/test/crossagent/smoke.ts +++ b/test/crossagent/smoke.ts @@ -26,7 +26,7 @@ function validator(result: AgentResult): ValidationCheck[] { } export const test: TestRunnerOptions = { - name: "smoke tests", + name: "smoke", fixture, validator, }; diff --git a/test/run.ts b/test/run.ts index 2cdf373..4f85213 100644 --- a/test/run.ts +++ b/test/run.ts @@ -25,24 +25,20 @@ import { * * usage: node test/run.ts [filters...] * - * filters can be test names, agent names, or special keywords: - * node test/run.ts # run all tests (excludes adhoc tests) - * node test/run.ts smoke # run smoke test for all agents - * node test/run.ts claude # run all tests for claude (excludes adhoc) - * node test/run.ts smoke claude # run smoke test for claude only - * node test/run.ts agnostic # run all agnostic tests (with claude) - * node test/run.ts timeout codex # run timeout test with codex - * node test/run.ts adhoc # run all adhoc tests (exploratory, not CI) - * node test/run.ts nobashcreative # run specific adhoc test by name + * filters can be test names, tags, or agent names: + * node test/run.ts # run all tests (excludes adhoc-tagged tests) + * node test/run.ts smoke # run tests named "smoke" or tagged "smoke" + * node test/run.ts claude # run all tests for claude only + * node test/run.ts mcpmerge # run all tests tagged "mcpmerge" + * node test/run.ts agnostic # run all agnostic-tagged tests (with claude) + * node test/run.ts adhoc # run all adhoc-tagged tests + * node test/run.ts smoke claude # run smoke tests for claude only + * + * special tags: + * - "agnostic": runs with claude only, excluded when filtering by agent + * - "adhoc": excluded from default runs, must be explicitly requested * * by default, runs in a Docker container for isolation. - * automatically detects if already inside Docker and skips spawning another container. - * - * tests mark themselves as agnostic via the `agnostic: true` option. - * agnostic tests only need to run once with any agent (default: claude). - * - * adhoc tests are in the `adhoc/` directory and are excluded from default runs. - * they are for exploration and manual testing, not CI. */ const __dirname = dirname(fileURLToPath(import.meta.url)); @@ -91,86 +87,89 @@ type CancelState = { signal: NodeJS.Signals | null; }; -async function loadTest(testName: string): Promise { - // check crossagent directory first - const crossagentPath = join(__dirname, "crossagent", `${testName}.ts`); - if (existsSync(crossagentPath)) { - const module = await import(crossagentPath); - return { name: testName, config: module.test }; +type TestModule = { + test?: TestRunnerOptions; + tests?: Record; +}; + +// load all tests from all directories +async function loadAllTests(): Promise { + const testInfos: TestInfo[] = []; + const dirs = ["crossagent", "agnostic", "adhoc"]; + + for (const dir of dirs) { + const dirPath = join(__dirname, dir); + if (!existsSync(dirPath)) continue; + + const files = readdirSync(dirPath).filter((f) => f.endsWith(".ts")); + for (const file of files) { + const filePath = join(dirPath, file); + const module = (await import(filePath)) as TestModule; + + if (module.test) { + testInfos.push({ name: module.test.name, config: module.test }); + } else if (module.tests) { + const entries = Object.entries(module.tests); + for (const entry of entries) { + testInfos.push({ name: entry[0], config: entry[1] }); + } + } + } } - // check agnostic directory - const agnosticPath = join(__dirname, "agnostic", `${testName}.ts`); - if (existsSync(agnosticPath)) { - const module = await import(agnosticPath); - return { name: testName, config: module.test }; - } - - // check adhoc directory - const adhocPath = join(__dirname, "adhoc", `${testName}.ts`); - if (existsSync(adhocPath)) { - const module = await import(adhocPath); - return { name: testName, config: module.test }; - } - - return null; + return testInfos; } -function listTestsFromDir(dir: string): string[] { - if (!existsSync(dir)) return []; - return readdirSync(dir) - .filter((f) => f.endsWith(".ts")) - .map((f) => f.replace(".ts", "")); -} - -function listAdhocTests(): string[] { - const adhocDir = join(__dirname, "adhoc"); - return listTestsFromDir(adhocDir); -} - -function listCoreTests(): string[] { - const crossagentDir = join(__dirname, "crossagent"); - const agnosticDir = join(__dirname, "agnostic"); - return [...listTestsFromDir(crossagentDir), ...listTestsFromDir(agnosticDir)]; -} - -function listAvailableTests(): string[] { - return [...listCoreTests(), ...listAdhocTests()]; +// check if test has a specific tag +function hasTag(test: TestInfo, tag: string): boolean { + return test.config.tags?.includes(tag) ?? false; } type ParsedArgs = { - tests: string[]; - agents: string[]; - agnosticOnly: boolean; - adhocOnly: boolean; + filters: string[]; // test names or tags + agentFilters: string[]; }; -function parseArgs(args: string[]): ParsedArgs { - const availableTests = listAvailableTests(); - const tests: string[] = []; - const agentsFound: string[] = []; - let agnosticOnly = false; - let adhocOnly = false; +function parseArgs(args: string[], allTests: TestInfo[]): ParsedArgs { + const testNames = new Set(allTests.map((t) => t.name)); + const allTags = new Set(allTests.flatMap((t) => t.config.tags ?? [])); + + const filters: string[] = []; + const agentFilters: string[] = []; for (const arg of args) { - if (arg === "agnostic") { - agnosticOnly = true; - } else if (arg === "adhoc") { - adhocOnly = true; - } else if (availableTests.includes(arg)) { - tests.push(arg); - } else if (agents.includes(arg as (typeof agents)[number])) { - agentsFound.push(arg); + if (agents.includes(arg as (typeof agents)[number])) { + agentFilters.push(arg); + } else if (testNames.has(arg) || allTags.has(arg)) { + filters.push(arg); } else { console.error(`unknown argument: ${arg}`); - console.error(`available tests: ${availableTests.join(", ")}`); + console.error(`available tests: ${[...testNames].join(", ")}`); + console.error(`available tags: ${[...allTags].join(", ")}`); console.error(`available agents: ${agents.join(", ")}`); - console.error(`special keywords: agnostic, adhoc`); process.exit(1); } } - return { tests, agents: agentsFound, agnosticOnly, adhocOnly }; + return { filters, agentFilters }; +} + +// filter tests based on filters (names or tags) +function filterTests(allTests: TestInfo[], filters: string[]): TestInfo[] { + if (filters.length === 0) { + // default: exclude adhoc tests + return allTests.filter((t) => !hasTag(t, "adhoc")); + } + + // match tests by name or tag + return allTests.filter((t) => { + for (const filter of filters) { + if (t.name === filter || hasTag(t, filter)) { + return true; + } + } + return false; + }); } type RunContext = { @@ -202,16 +201,16 @@ function buildCanceledValidation(ctx: CanceledValidationContext): ValidationResu } async function runTestForAgent(ctx: RunContext): Promise { - const config = ctx.testInfo.config; + const testConfig = ctx.testInfo.config; const env: Record = {}; - if (config.env) { - const entries = Object.entries(config.env); + if (testConfig.env) { + const entries = Object.entries(testConfig.env); for (const entry of entries) { env[entry[0]] = entry[1]; } } - if (config.agentEnv) { - const agentEnv = config.agentEnv.get(ctx.agent); + if (testConfig.agentEnv) { + const agentEnv = testConfig.agentEnv.get(ctx.agent); if (agentEnv) { const entries = Object.entries(agentEnv); for (const entry of entries) { @@ -227,14 +226,14 @@ async function runTestForAgent(ctx: RunContext): Promise { const result = await runAgentStreaming({ test: ctx.testInfo.name, agent: ctx.agent, - fixture: config.fixture, + fixture: testConfig.fixture, env, isCanceled: () => ctx.cancelState.canceled, }); - const validation = validateResult(result, config.validator, { + const validation = validateResult(result, testConfig.validator, { test: ctx.testInfo.name, - expectFailure: config.expectFailure, + expectFailure: testConfig.expectFailure, }); ctx.results.set(getRunKey(ctx.testInfo.name, ctx.agent), validation); return validation; @@ -245,8 +244,7 @@ async function main(): Promise { // run in Docker unless already inside if (!isInsideDocker) { - // acquire token for docker if needed (before spawning containers) - // this ensures GITHUB_TOKEN is available when setupTestRepo() runs inside docker + // acquire token for docker if needed if (!process.env.GITHUB_TOKEN && !process.env.GH_TOKEN) { if (process.env.GITHUB_APP_ID && process.env.GITHUB_PRIVATE_KEY) { console.log("» acquiring github installation token..."); @@ -257,35 +255,12 @@ async function main(): Promise { runTestsInDocker(args); } - const parsed = parseArgs(args); - const adhocTests = listAdhocTests(); + // load all tests + const allTests = await loadAllTests(); + const parsed = parseArgs(args, allTests); - // determine which tests to load - let testsToLoad: string[]; - if (parsed.tests.length > 0) { - testsToLoad = parsed.tests; - } else if (parsed.adhocOnly) { - testsToLoad = adhocTests; - } else { - // by default, exclude adhoc tests - testsToLoad = listCoreTests(); - } - - // load all test configs - const testInfos: TestInfo[] = []; - for (const testName of testsToLoad) { - const info = await loadTest(testName); - if (!info) { - console.error(`failed to load test: ${testName}`); - process.exit(1); - } - testInfos.push(info); - } - - // filter to agnostic-only if requested - const filteredTests = parsed.agnosticOnly - ? testInfos.filter((t) => t.config.agnostic) - : testInfos; + // filter tests + const filteredTests = filterTests(allTests, parsed.filters); if (filteredTests.length === 0) { console.error("no tests to run"); @@ -293,41 +268,36 @@ async function main(): Promise { } // determine which agents to run - const agentsToRun = parsed.agents.length > 0 ? parsed.agents : [...agents]; + const agentsToRun = parsed.agentFilters.length > 0 ? parsed.agentFilters : [...agents]; // build list of test runs type TestRun = { testInfo: TestInfo; agent: string }; const runs: TestRun[] = []; - // determine behavior for agnostic tests: - // - if specific tests were requested (e.g., `timeout codex`), run with specified agent - // - if agnosticOnly flag is set, run with specified agent (or claude) - // - if only agents specified (e.g., `codex`), skip agnostic tests (they run separately) - // - if no filters at all, include agnostic tests with claude - const specificTestsRequested = parsed.tests.length > 0; - const onlyAgentsSpecified = - parsed.agents.length > 0 && !specificTestsRequested && !parsed.agnosticOnly; - const noFiltersAtAll = - parsed.tests.length === 0 && parsed.agents.length === 0 && !parsed.agnosticOnly; - for (const testInfo of filteredTests) { - if (testInfo.config.agnostic) { - // skip agnostic tests when only agents are specified (e.g., `pnpm runtest codex`) - if (onlyAgentsSpecified) continue; + const isAgnostic = hasTag(testInfo, "agnostic"); - // agnostic: run once with appropriate agent - // - if specific tests requested or agnosticOnly: use specified agent or first in list - // - otherwise (no filters): use default agent (claude) - const agent = noFiltersAtAll ? agents[0] : agentsToRun[0]; - runs.push({ testInfo, agent }); + if (isAgnostic) { + // agnostic tests: skip if only filtering by agent, otherwise run with claude + if (parsed.filters.length === 0 && parsed.agentFilters.length > 0) { + continue; + } + runs.push({ testInfo, agent: "claude" }); } else { - // non-agnostic: run for all specified agents - for (const agent of agentsToRun) { + // determine which agents to run for this test + const testAgents = testInfo.config.agents ?? agents; + const effectiveAgents = agentsToRun.filter((a) => testAgents.includes(a)); + for (const agent of effectiveAgents) { runs.push({ testInfo, agent }); } } } + if (runs.length === 0) { + console.error("no test runs after filtering"); + process.exit(1); + } + // describe what we're running const runTestNames = [...new Set(runs.map((r) => r.testInfo.name))]; const runAgentNames = [...new Set(runs.map((r) => r.agent))]; @@ -377,9 +347,8 @@ async function main(): Promise { setSignalHandler(handleCancel); installSignalHandlers(); - // run tests with limited concurrency to avoid overwhelming agent APIs - // group by agent to ensure each agent only runs one test at a time - const maxConcurrency = 5; // one per agent + // run tests with limited concurrency + const maxConcurrency = 5; const validations = await runWithConcurrencyLimit( runs, maxConcurrency, @@ -412,7 +381,6 @@ async function runWithConcurrencyLimit( results.push(result); }, (err: unknown) => { - // fn must never reject; log and rethrow to surface bugs console.error("runWithConcurrencyLimit: fn rejected unexpectedly", err); throw err; } diff --git a/test/utils.ts b/test/utils.ts index bf1425d..136bb1b 100644 --- a/test/utils.ts +++ b/test/utils.ts @@ -1,6 +1,6 @@ import { spawn } from "node:child_process"; import { randomUUID } from "node:crypto"; -import { mkdirSync } from "node:fs"; +import { mkdirSync, writeFileSync } from "node:fs"; import { dirname, join } from "node:path"; import { fileURLToPath } from "node:url"; import { agentsManifest } from "../external.ts"; @@ -169,6 +169,18 @@ export async function runAgentStreaming(options: RunStreamingOptions): Promise; // per-agent env vars (for unique markers) agentEnv?: Map>; + // specific agents to run this test on (defaults to all agents) + agents?: string[]; // if true, test passes when agent fails AND validation checks pass // (used for tests like timeout that expect the agent run to fail) expectFailure?: boolean; - // if true, test is agent-agnostic and only needs to run once with any agent - // agnostic tests run with claude by default, but can be run with specific agent via CLI - agnostic?: boolean; + // tags for grouping tests (e.g., ["mcpmerge"], ["agnostic"]) + // special tags: + // - "agnostic": runs with claude only, excluded when filtering by agent + // - "adhoc": excluded from default runs, must be explicitly requested + tags?: string[]; } export function printSingleValidation(validation: ValidationResult): void { diff --git a/utils/activity.ts b/utils/activity.ts index 838686d..abb9dd3 100644 --- a/utils/activity.ts +++ b/utils/activity.ts @@ -27,6 +27,24 @@ type WriteFunction = { (chunk: string | Uint8Array, encoding?: BufferEncoding, cb?: WriteCallback): boolean; }; +// module-level activity tracking - allows agents to mark activity on any event +let _lastActivity = Date.now(); + +/** + * mark activity to reset the no-output timeout. + * call this whenever the agent emits any event, even if it isn't logged to stdout. + */ +export function markActivity(): void { + _lastActivity = Date.now(); +} + +/** + * get the time since last activity in milliseconds + */ +export function getIdleMs(): number { + return Date.now() - _lastActivity; +} + function wrapWrite(original: WriteFunction, onActivity: () => void): WriteFunction { const wrapped: WriteFunction = ( chunk: string | Uint8Array, @@ -43,21 +61,17 @@ function wrapWrite(original: WriteFunction, onActivity: () => void): WriteFuncti } function startProcessOutputMonitor(ctx: OutputMonitorContext): OutputMonitor { - let lastActivity = Date.now(); let timedOut = false; const originalStdoutWrite: WriteFunction = process.stdout.write.bind(process.stdout); const originalStderrWrite: WriteFunction = process.stderr.write.bind(process.stderr); - function markActivity(): void { - lastActivity = Date.now(); - } - + // stdout/stderr writes also mark activity process.stdout.write = wrapWrite(originalStdoutWrite, markActivity); process.stderr.write = wrapWrite(originalStderrWrite, markActivity); const intervalId = setInterval(() => { - const idleMs = Date.now() - lastActivity; + const idleMs = getIdleMs(); if (timedOut || idleMs <= ctx.timeoutMs) return; timedOut = true; ctx.onTimeout(idleMs); @@ -73,6 +87,8 @@ function startProcessOutputMonitor(ctx: OutputMonitorContext): OutputMonitor { } export function createProcessOutputActivityTimeout(ctx: ActivityTimeoutContext): ActivityTimeout { + markActivity(); // reset baseline + let rejectFn: ((error: Error) => void) | null = null; const promise = new Promise((_, reject) => { rejectFn = reject; diff --git a/utils/payload.ts b/utils/payload.ts index 91cea01..ffb95a4 100644 --- a/utils/payload.ts +++ b/utils/payload.ts @@ -22,8 +22,9 @@ export const JsonPayload = type({ "repoInstructions?": "string", "event?": "object", "effort?": Effort.or("undefined"), - "timeout?": type.string.or("undefined"), - "progressCommentId?": type.string.or("undefined"), + "timeout?": "string | undefined", + "progressCommentId?": "string | undefined", + "debug?": "boolean | undefined", }); // permission levels that indicate collaborator status (have push access) @@ -165,6 +166,7 @@ export function resolvePayload( effort: inputs.effort ?? jsonPayload?.effort ?? "auto", timeout: inputs.timeout ?? jsonPayload?.timeout, cwd: resolveCwd(inputs.cwd), + debug: jsonPayload?.debug, // permissions: inputs > repoSettings > fallbacks web: inputs.web ?? repoSettings.web ?? "enabled",