@vanillagreen/pi-claude-bridge 1.0.5 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bundle/index.js CHANGED
@@ -5,8 +5,8 @@ var __export = (target, all) => {
5
5
  };
6
6
 
7
7
  // src/index.ts
8
- import { calculateCost, getModels } from "@mariozechner/pi-ai";
9
- import * as piAi from "@mariozechner/pi-ai";
8
+ import { calculateCost, getModels } from "@earendil-works/pi-ai";
9
+ import * as piAi from "@earendil-works/pi-ai";
10
10
 
11
11
  // node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs
12
12
  import { execFile as Rc } from "child_process";
@@ -18744,9 +18744,22 @@ function lA($, X) {
18744
18744
  import { randomUUID } from "crypto";
18745
18745
  import { mkdirSync as mkdirSync2, writeFileSync, appendFileSync as appendFileSync2, existsSync as existsSync2, rmSync as rmSync2 } from "fs";
18746
18746
  import { dirname } from "path";
18747
+ import { readFileSync as readFileSync2 } from "fs";
18747
18748
  import { realpathSync as realpathSync2 } from "fs";
18748
18749
  import { homedir } from "os";
18749
18750
  import { join } from "path";
18751
+ function parseJsonl(content) {
18752
+ return content.split("\n").filter((line) => line.trim()).map(parseRecord);
18753
+ }
18754
+ function parseJsonlFile(path) {
18755
+ return parseJsonl(readFileSync2(path, "utf-8"));
18756
+ }
18757
+ function parseRecord(line) {
18758
+ const raw = JSON.parse(line);
18759
+ if (raw.type === "user") return raw;
18760
+ if (raw.type === "assistant") return raw;
18761
+ return raw;
18762
+ }
18750
18763
  function serializeRecord(record2) {
18751
18764
  return JSON.stringify(record2);
18752
18765
  }
@@ -19147,8 +19160,31 @@ function createSession(opts) {
19147
19160
  model: opts.model
19148
19161
  });
19149
19162
  }
19163
+ function openSession(opts) {
19164
+ const projectPath = normalizeProjectPath(opts.projectPath);
19165
+ const jsonlPath = getSessionPath(opts.sessionId, projectPath, opts.claudeDir);
19166
+ return readSession(jsonlPath, projectPath);
19167
+ }
19168
+ function readSession(jsonlPath, projectPath) {
19169
+ const records = parseJsonlFile(jsonlPath);
19170
+ const firstMsg = records.find((r6) => r6.type === "user" || r6.type === "assistant");
19171
+ const sessionId = firstMsg?.sessionId ?? "";
19172
+ const resolvedProjectPath = projectPath ?? firstMsg?.cwd ?? "";
19173
+ return new Session({
19174
+ sessionId,
19175
+ projectPath: resolvedProjectPath,
19176
+ jsonlPath,
19177
+ slug: firstMsg?.slug,
19178
+ cwd: firstMsg?.cwd,
19179
+ version: firstMsg?.version,
19180
+ gitBranch: firstMsg?.gitBranch,
19181
+ records,
19182
+ fileExists: true
19183
+ });
19184
+ }
19150
19185
 
19151
19186
  // src/index.ts
19187
+ import { createHash } from "crypto";
19152
19188
  import { accessSync, appendFileSync as appendFileSync3, constants as fsConstants, mkdirSync as mkdirSync3, realpathSync as realpathSync3, statSync as statSync3 } from "fs";
19153
19189
  import { homedir as homedir5 } from "os";
19154
19190
  import { delimiter, dirname as dirname5, join as join5 } from "path";
@@ -19275,6 +19311,38 @@ function messageContentToText(content) {
19275
19311
  }
19276
19312
  return hasText ? parts.join("\n") : "";
19277
19313
  }
19314
+ function imageBlockToAnthropic(block) {
19315
+ if (!block.data || !block.mimeType) return void 0;
19316
+ return { type: "image", source: { type: "base64", media_type: block.mimeType, data: block.data } };
19317
+ }
19318
+ function toolResultContentToAnthropic(content) {
19319
+ if (typeof content === "string") return content;
19320
+ if (!Array.isArray(content)) return "";
19321
+ const blocks = [];
19322
+ for (const block of content) {
19323
+ if (block.type === "text" && block.text) {
19324
+ blocks.push({ type: "text", text: block.text });
19325
+ } else if (block.type === "image") {
19326
+ const image = imageBlockToAnthropic(block);
19327
+ if (image) blocks.push(image);
19328
+ } else if (block.type) {
19329
+ blocks.push({ type: "text", text: `[${block.type}]` });
19330
+ }
19331
+ }
19332
+ if (blocks.length === 0) return "";
19333
+ if (blocks.every((block) => block.type === "text")) return blocks.map((block) => block.text).join("\n");
19334
+ return blocks;
19335
+ }
19336
+ function assistantProvenancePrefix(msg) {
19337
+ if (msg.role !== "assistant") return void 0;
19338
+ const provider = typeof msg.provider === "string" ? msg.provider : void 0;
19339
+ const model = typeof msg.model === "string" ? msg.model : void 0;
19340
+ const api = typeof msg.api === "string" ? msg.api : void 0;
19341
+ if (!provider && !model && !api) return void 0;
19342
+ if (provider === PROVIDER_ID || api === "anthropic") return void 0;
19343
+ return `[Prior Pi assistant response from ${provider ?? api ?? "unknown-provider"}${model ? `/${model}` : ""}]
19344
+ `;
19345
+ }
19278
19346
  function convertPiMessages(messages, customToolNameToSdk) {
19279
19347
  const anthropicMessages = [];
19280
19348
  const sanitizedIds = /* @__PURE__ */ new Map();
@@ -19287,16 +19355,18 @@ function convertPiMessages(messages, customToolNameToSdk) {
19287
19355
  for (const block of msg.content) {
19288
19356
  if (block.type === "text" && block.text) parts.push({ type: "text", text: block.text });
19289
19357
  else if (block.type === "image" && block.data && block.mimeType) {
19290
- parts.push({ type: "image", source: { type: "base64", media_type: block.mimeType, data: block.data } });
19358
+ parts.push(imageBlockToAnthropic(block));
19291
19359
  }
19292
19360
  }
19293
- anthropicMessages.push({ role: "user", content: parts.length ? parts : "[image]" });
19361
+ anthropicMessages.push({ role: "user", content: parts.filter(Boolean).length ? parts.filter(Boolean) : "[image]" });
19294
19362
  } else {
19295
19363
  anthropicMessages.push({ role: "user", content: "[empty]" });
19296
19364
  }
19297
19365
  } else if (msg.role === "assistant") {
19298
19366
  const content = Array.isArray(msg.content) ? msg.content : [];
19299
19367
  const blocks = [];
19368
+ const provenance = assistantProvenancePrefix(msg);
19369
+ if (provenance) blocks.push({ type: "text", text: provenance });
19300
19370
  for (const block of content) {
19301
19371
  if (block.type === "text" && block.text) {
19302
19372
  blocks.push({ type: "text", text: block.text });
@@ -19314,10 +19384,10 @@ function convertPiMessages(messages, customToolNameToSdk) {
19314
19384
  if (!blocks.length) blocks.push({ type: "text", text: "[incompatible content omitted]" });
19315
19385
  anthropicMessages.push({ role: "assistant", content: blocks });
19316
19386
  } else if (msg.role === "toolResult") {
19317
- const text = typeof msg.content === "string" ? msg.content : messageContentToText(msg.content);
19387
+ const content = toolResultContentToAnthropic(msg.content);
19318
19388
  anthropicMessages.push({
19319
19389
  role: "user",
19320
- content: [{ type: "tool_result", tool_use_id: sanitizeToolId(msg.toolCallId, sanitizedIds), content: text || "", is_error: msg.isError }]
19390
+ content: [{ type: "tool_result", tool_use_id: sanitizeToolId(msg.toolCallId, sanitizedIds), content: content || "", is_error: msg.isError }]
19321
19391
  });
19322
19392
  }
19323
19393
  }
@@ -19360,7 +19430,7 @@ function rewriteSkillsBlock(skillsBlock) {
19360
19430
  }
19361
19431
 
19362
19432
  // src/session-verify.ts
19363
- import { statSync as statSync2, readFileSync as readFileSync2 } from "fs";
19433
+ import { statSync as statSync2, readFileSync as readFileSync3 } from "fs";
19364
19434
  function verifyWrittenSession(jsonlPath, expectedSessionId, expectedRecordCount) {
19365
19435
  const warnings = [];
19366
19436
  let st;
@@ -19372,7 +19442,7 @@ function verifyWrittenSession(jsonlPath, expectedSessionId, expectedRecordCount)
19372
19442
  }
19373
19443
  let content;
19374
19444
  try {
19375
- content = readFileSync2(jsonlPath, "utf8");
19445
+ content = readFileSync3(jsonlPath, "utf8");
19376
19446
  } catch (e2) {
19377
19447
  warnings.push(`file unreadable \u2014 path=${jsonlPath} size=${st.size} err=${e2.message}`);
19378
19448
  return warnings;
@@ -19484,7 +19554,7 @@ function popContext() {
19484
19554
  }
19485
19555
 
19486
19556
  // src/config.ts
19487
- import { existsSync as existsSync3, readFileSync as readFileSync3 } from "fs";
19557
+ import { existsSync as existsSync3, readFileSync as readFileSync4 } from "fs";
19488
19558
  import { homedir as homedir2 } from "os";
19489
19559
  import { dirname as dirname2, join as join2, resolve } from "path";
19490
19560
  var PACKAGE_ID = "@vanillagreen/pi-claude-bridge";
@@ -19525,7 +19595,7 @@ function settingsPaths(cwd) {
19525
19595
  function tryParseJson(path) {
19526
19596
  if (!existsSync3(path)) return {};
19527
19597
  try {
19528
- return JSON.parse(readFileSync3(path, "utf-8"));
19598
+ return JSON.parse(readFileSync4(path, "utf-8"));
19529
19599
  } catch (e2) {
19530
19600
  console.error(`claude-bridge: failed to parse ${path}: ${e2}`);
19531
19601
  return {};
@@ -19536,7 +19606,7 @@ function readManagerConfig(cwd) {
19536
19606
  for (const path of settingsPaths(cwd)) {
19537
19607
  if (!existsSync3(path)) continue;
19538
19608
  try {
19539
- const parsed = JSON.parse(readFileSync3(path, "utf8"));
19609
+ const parsed = JSON.parse(readFileSync4(path, "utf8"));
19540
19610
  const configRoot = asRecord(asRecord(asRecord(parsed?.vstack)?.extensionManager)?.config);
19541
19611
  const config2 = asRecord(configRoot?.[PACKAGE_ID]);
19542
19612
  if (config2) mergeDeep(merged, config2);
@@ -19587,7 +19657,7 @@ function loadConfig(cwd) {
19587
19657
  }
19588
19658
 
19589
19659
  // src/agents-md.ts
19590
- import { existsSync as existsSync4, readFileSync as readFileSync4 } from "fs";
19660
+ import { existsSync as existsSync4, readFileSync as readFileSync5 } from "fs";
19591
19661
  import { homedir as homedir3 } from "os";
19592
19662
  import { dirname as dirname3, join as join3, resolve as resolve2 } from "path";
19593
19663
  var GLOBAL_AGENTS_PATH = join3(homedir3(), ".pi", "agent", "AGENTS.md");
@@ -19612,7 +19682,7 @@ function extractAgentsAppend() {
19612
19682
  const agentsPath = resolveAgentsMdPath();
19613
19683
  if (!agentsPath) return void 0;
19614
19684
  try {
19615
- const content = readFileSync4(agentsPath, "utf-8").trim();
19685
+ const content = readFileSync5(agentsPath, "utf-8").trim();
19616
19686
  if (!content) return void 0;
19617
19687
  const sanitized = sanitizeAgentsContent(content);
19618
19688
  return sanitized.length > 0 ? `# CLAUDE.md
@@ -19632,7 +19702,7 @@ function sanitizeAgentsContent(content) {
19632
19702
  }
19633
19703
 
19634
19704
  // src/prompt-context.ts
19635
- import { existsSync as existsSync5, readFileSync as readFileSync5 } from "fs";
19705
+ import { existsSync as existsSync5, readFileSync as readFileSync6 } from "fs";
19636
19706
  import { homedir as homedir4 } from "os";
19637
19707
  import { dirname as dirname4, join as join4, resolve as resolve3 } from "path";
19638
19708
  function piUserDir2() {
@@ -19643,7 +19713,7 @@ function piUserDir2() {
19643
19713
  function readTrimmed(path) {
19644
19714
  try {
19645
19715
  if (!existsSync5(path)) return void 0;
19646
- const content = readFileSync5(path, "utf8").trim();
19716
+ const content = readFileSync6(path, "utf8").trim();
19647
19717
  return content.length > 0 ? content : void 0;
19648
19718
  } catch {
19649
19719
  return void 0;
@@ -19812,6 +19882,7 @@ __export(external_exports, {
19812
19882
  ZodOptional: () => ZodOptional,
19813
19883
  ZodPipe: () => ZodPipe,
19814
19884
  ZodPrefault: () => ZodPrefault,
19885
+ ZodPreprocess: () => ZodPreprocess,
19815
19886
  ZodPromise: () => ZodPromise,
19816
19887
  ZodReadonly: () => ZodReadonly,
19817
19888
  ZodRealError: () => ZodRealError,
@@ -19890,6 +19961,7 @@ __export(external_exports, {
19890
19961
  int32: () => int32,
19891
19962
  int64: () => int64,
19892
19963
  intersection: () => intersection,
19964
+ invertCodec: () => invertCodec,
19893
19965
  ipv4: () => ipv42,
19894
19966
  ipv6: () => ipv62,
19895
19967
  iso: () => iso_exports,
@@ -20071,6 +20143,7 @@ __export(core_exports2, {
20071
20143
  $ZodOptional: () => $ZodOptional,
20072
20144
  $ZodPipe: () => $ZodPipe,
20073
20145
  $ZodPrefault: () => $ZodPrefault,
20146
+ $ZodPreprocess: () => $ZodPreprocess,
20074
20147
  $ZodPromise: () => $ZodPromise,
20075
20148
  $ZodReadonly: () => $ZodReadonly,
20076
20149
  $ZodRealError: () => $ZodRealError,
@@ -20270,7 +20343,8 @@ __export(core_exports2, {
20270
20343
  });
20271
20344
 
20272
20345
  // node_modules/zod/v4/core/core.js
20273
- var NEVER = Object.freeze({
20346
+ var _a;
20347
+ var NEVER = /* @__PURE__ */ Object.freeze({
20274
20348
  status: "aborted"
20275
20349
  });
20276
20350
  // @__NO_SIDE_EFFECTS__
@@ -20305,10 +20379,10 @@ function $constructor(name, initializer3, params) {
20305
20379
  }
20306
20380
  Object.defineProperty(Definition, "name", { value: name });
20307
20381
  function _(def) {
20308
- var _a2;
20382
+ var _a3;
20309
20383
  const inst = params?.Parent ? new Definition() : this;
20310
20384
  init(inst, def);
20311
- (_a2 = inst._zod).deferred ?? (_a2.deferred = []);
20385
+ (_a3 = inst._zod).deferred ?? (_a3.deferred = []);
20312
20386
  for (const fn of inst._zod.deferred) {
20313
20387
  fn();
20314
20388
  }
@@ -20337,7 +20411,8 @@ var $ZodEncodeError = class extends Error {
20337
20411
  this.name = "ZodEncodeError";
20338
20412
  }
20339
20413
  };
20340
- var globalConfig = {};
20414
+ (_a = globalThis).__zod_globalConfig ?? (_a.__zod_globalConfig = {});
20415
+ var globalConfig = globalThis.__zod_globalConfig;
20341
20416
  function config(newConfig) {
20342
20417
  if (newConfig)
20343
20418
  Object.assign(globalConfig, newConfig);
@@ -20370,6 +20445,7 @@ __export(util_exports, {
20370
20445
  defineLazy: () => defineLazy,
20371
20446
  esc: () => esc,
20372
20447
  escapeRegex: () => escapeRegex,
20448
+ explicitlyAborted: () => explicitlyAborted,
20373
20449
  extend: () => extend,
20374
20450
  finalizeIssue: () => finalizeIssue,
20375
20451
  floatSafeRemainder: () => floatSafeRemainder,
@@ -20458,19 +20534,12 @@ function cleanRegex(source) {
20458
20534
  return source.slice(start, end);
20459
20535
  }
20460
20536
  function floatSafeRemainder(val, step) {
20461
- const valDecCount = (val.toString().split(".")[1] || "").length;
20462
- const stepString = step.toString();
20463
- let stepDecCount = (stepString.split(".")[1] || "").length;
20464
- if (stepDecCount === 0 && /\d?e-\d?/.test(stepString)) {
20465
- const match = stepString.match(/\d?e-(\d?)/);
20466
- if (match?.[1]) {
20467
- stepDecCount = Number.parseInt(match[1]);
20468
- }
20469
- }
20470
- const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
20471
- const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
20472
- const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
20473
- return valInt % stepInt / 10 ** decCount;
20537
+ const ratio = val / step;
20538
+ const roundedRatio = Math.round(ratio);
20539
+ const tolerance = Number.EPSILON * Math.max(Math.abs(ratio), 1);
20540
+ if (Math.abs(ratio - roundedRatio) < tolerance)
20541
+ return 0;
20542
+ return ratio - roundedRatio;
20474
20543
  }
20475
20544
  var EVALUATING = /* @__PURE__ */ Symbol("evaluating");
20476
20545
  function defineLazy(object2, key, getter) {
@@ -20552,7 +20621,10 @@ var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace :
20552
20621
  function isObject(data) {
20553
20622
  return typeof data === "object" && data !== null && !Array.isArray(data);
20554
20623
  }
20555
- var allowsEval = cached(() => {
20624
+ var allowsEval = /* @__PURE__ */ cached(() => {
20625
+ if (globalConfig.jitless) {
20626
+ return false;
20627
+ }
20556
20628
  if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) {
20557
20629
  return false;
20558
20630
  }
@@ -20585,6 +20657,10 @@ function shallowClone(o2) {
20585
20657
  return { ...o2 };
20586
20658
  if (Array.isArray(o2))
20587
20659
  return [...o2];
20660
+ if (o2 instanceof Map)
20661
+ return new Map(o2);
20662
+ if (o2 instanceof Set)
20663
+ return new Set(o2);
20588
20664
  return o2;
20589
20665
  }
20590
20666
  function numKeys(data) {
@@ -20641,7 +20717,14 @@ var getParsedType = (data) => {
20641
20717
  }
20642
20718
  };
20643
20719
  var propertyKeyTypes = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
20644
- var primitiveTypes = /* @__PURE__ */ new Set(["string", "number", "bigint", "boolean", "symbol", "undefined"]);
20720
+ var primitiveTypes = /* @__PURE__ */ new Set([
20721
+ "string",
20722
+ "number",
20723
+ "bigint",
20724
+ "boolean",
20725
+ "symbol",
20726
+ "undefined"
20727
+ ]);
20645
20728
  function escapeRegex(str) {
20646
20729
  return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
20647
20730
  }
@@ -20810,6 +20893,9 @@ function safeExtend(schema, shape) {
20810
20893
  return clone(schema, def);
20811
20894
  }
20812
20895
  function merge(a6, b7) {
20896
+ if (a6._zod.def.checks?.length) {
20897
+ throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
20898
+ }
20813
20899
  const def = mergeDefs(a6._zod.def, {
20814
20900
  get shape() {
20815
20901
  const _shape = { ...a6._zod.def.shape, ...b7._zod.def.shape };
@@ -20819,8 +20905,7 @@ function merge(a6, b7) {
20819
20905
  get catchall() {
20820
20906
  return b7._zod.def.catchall;
20821
20907
  },
20822
- checks: []
20823
- // delete existing checks
20908
+ checks: b7._zod.def.checks ?? []
20824
20909
  });
20825
20910
  return clone(a6, def);
20826
20911
  }
@@ -20903,10 +20988,20 @@ function aborted(x2, startIndex = 0) {
20903
20988
  }
20904
20989
  return false;
20905
20990
  }
20991
+ function explicitlyAborted(x2, startIndex = 0) {
20992
+ if (x2.aborted === true)
20993
+ return true;
20994
+ for (let i2 = startIndex; i2 < x2.issues.length; i2++) {
20995
+ if (x2.issues[i2]?.continue === false) {
20996
+ return true;
20997
+ }
20998
+ }
20999
+ return false;
21000
+ }
20906
21001
  function prefixIssues(path, issues) {
20907
21002
  return issues.map((iss) => {
20908
- var _a2;
20909
- (_a2 = iss).path ?? (_a2.path = []);
21003
+ var _a3;
21004
+ (_a3 = iss).path ?? (_a3.path = []);
20910
21005
  iss.path.unshift(path);
20911
21006
  return iss;
20912
21007
  });
@@ -20915,17 +21010,14 @@ function unwrapMessage(message) {
20915
21010
  return typeof message === "string" ? message : message?.message;
20916
21011
  }
20917
21012
  function finalizeIssue(iss, ctx2, config2) {
20918
- const full = { ...iss, path: iss.path ?? [] };
20919
- if (!iss.message) {
20920
- const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx2?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input";
20921
- full.message = message;
20922
- }
20923
- delete full.inst;
20924
- delete full.continue;
20925
- if (!ctx2?.reportInput) {
20926
- delete full.input;
21013
+ const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx2?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input";
21014
+ const { inst: _inst, continue: _continue, input: _input, ...rest } = iss;
21015
+ rest.path ?? (rest.path = []);
21016
+ rest.message = message;
21017
+ if (ctx2?.reportInput) {
21018
+ rest.input = _input;
20927
21019
  }
20928
- return full;
21020
+ return rest;
20929
21021
  }
20930
21022
  function getSizableOrigin(input) {
20931
21023
  if (input instanceof Set)
@@ -21042,10 +21134,10 @@ var initializer = (inst, def) => {
21042
21134
  };
21043
21135
  var $ZodError = $constructor("$ZodError", initializer);
21044
21136
  var $ZodRealError = $constructor("$ZodError", initializer, { Parent: Error });
21045
- function flattenError(error48, mapper = (issue2) => issue2.message) {
21137
+ function flattenError(error51, mapper = (issue2) => issue2.message) {
21046
21138
  const fieldErrors = {};
21047
21139
  const formErrors = [];
21048
- for (const sub of error48.issues) {
21140
+ for (const sub of error51.issues) {
21049
21141
  if (sub.path.length > 0) {
21050
21142
  fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
21051
21143
  fieldErrors[sub.path[0]].push(mapper(sub));
@@ -21055,50 +21147,53 @@ function flattenError(error48, mapper = (issue2) => issue2.message) {
21055
21147
  }
21056
21148
  return { formErrors, fieldErrors };
21057
21149
  }
21058
- function formatError(error48, mapper = (issue2) => issue2.message) {
21150
+ function formatError(error51, mapper = (issue2) => issue2.message) {
21059
21151
  const fieldErrors = { _errors: [] };
21060
- const processError = (error49) => {
21061
- for (const issue2 of error49.issues) {
21152
+ const processError = (error52, path = []) => {
21153
+ for (const issue2 of error52.issues) {
21062
21154
  if (issue2.code === "invalid_union" && issue2.errors.length) {
21063
- issue2.errors.map((issues) => processError({ issues }));
21155
+ issue2.errors.map((issues) => processError({ issues }, [...path, ...issue2.path]));
21064
21156
  } else if (issue2.code === "invalid_key") {
21065
- processError({ issues: issue2.issues });
21157
+ processError({ issues: issue2.issues }, [...path, ...issue2.path]);
21066
21158
  } else if (issue2.code === "invalid_element") {
21067
- processError({ issues: issue2.issues });
21068
- } else if (issue2.path.length === 0) {
21069
- fieldErrors._errors.push(mapper(issue2));
21159
+ processError({ issues: issue2.issues }, [...path, ...issue2.path]);
21070
21160
  } else {
21071
- let curr = fieldErrors;
21072
- let i2 = 0;
21073
- while (i2 < issue2.path.length) {
21074
- const el = issue2.path[i2];
21075
- const terminal = i2 === issue2.path.length - 1;
21076
- if (!terminal) {
21077
- curr[el] = curr[el] || { _errors: [] };
21078
- } else {
21079
- curr[el] = curr[el] || { _errors: [] };
21080
- curr[el]._errors.push(mapper(issue2));
21161
+ const fullpath = [...path, ...issue2.path];
21162
+ if (fullpath.length === 0) {
21163
+ fieldErrors._errors.push(mapper(issue2));
21164
+ } else {
21165
+ let curr = fieldErrors;
21166
+ let i2 = 0;
21167
+ while (i2 < fullpath.length) {
21168
+ const el = fullpath[i2];
21169
+ const terminal = i2 === fullpath.length - 1;
21170
+ if (!terminal) {
21171
+ curr[el] = curr[el] || { _errors: [] };
21172
+ } else {
21173
+ curr[el] = curr[el] || { _errors: [] };
21174
+ curr[el]._errors.push(mapper(issue2));
21175
+ }
21176
+ curr = curr[el];
21177
+ i2++;
21081
21178
  }
21082
- curr = curr[el];
21083
- i2++;
21084
21179
  }
21085
21180
  }
21086
21181
  }
21087
21182
  };
21088
- processError(error48);
21183
+ processError(error51);
21089
21184
  return fieldErrors;
21090
21185
  }
21091
- function treeifyError(error48, mapper = (issue2) => issue2.message) {
21186
+ function treeifyError(error51, mapper = (issue2) => issue2.message) {
21092
21187
  const result = { errors: [] };
21093
- const processError = (error49, path = []) => {
21094
- var _a2, _b;
21095
- for (const issue2 of error49.issues) {
21188
+ const processError = (error52, path = []) => {
21189
+ var _a3, _b;
21190
+ for (const issue2 of error52.issues) {
21096
21191
  if (issue2.code === "invalid_union" && issue2.errors.length) {
21097
- issue2.errors.map((issues) => processError({ issues }, issue2.path));
21192
+ issue2.errors.map((issues) => processError({ issues }, [...path, ...issue2.path]));
21098
21193
  } else if (issue2.code === "invalid_key") {
21099
- processError({ issues: issue2.issues }, issue2.path);
21194
+ processError({ issues: issue2.issues }, [...path, ...issue2.path]);
21100
21195
  } else if (issue2.code === "invalid_element") {
21101
- processError({ issues: issue2.issues }, issue2.path);
21196
+ processError({ issues: issue2.issues }, [...path, ...issue2.path]);
21102
21197
  } else {
21103
21198
  const fullpath = [...path, ...issue2.path];
21104
21199
  if (fullpath.length === 0) {
@@ -21112,7 +21207,7 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
21112
21207
  const terminal = i2 === fullpath.length - 1;
21113
21208
  if (typeof el === "string") {
21114
21209
  curr.properties ?? (curr.properties = {});
21115
- (_a2 = curr.properties)[el] ?? (_a2[el] = { errors: [] });
21210
+ (_a3 = curr.properties)[el] ?? (_a3[el] = { errors: [] });
21116
21211
  curr = curr.properties[el];
21117
21212
  } else {
21118
21213
  curr.items ?? (curr.items = []);
@@ -21127,7 +21222,7 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
21127
21222
  }
21128
21223
  }
21129
21224
  };
21130
- processError(error48);
21225
+ processError(error51);
21131
21226
  return result;
21132
21227
  }
21133
21228
  function toDotPath(_path) {
@@ -21148,9 +21243,9 @@ function toDotPath(_path) {
21148
21243
  }
21149
21244
  return segs.join("");
21150
21245
  }
21151
- function prettifyError(error48) {
21246
+ function prettifyError(error51) {
21152
21247
  const lines = [];
21153
- const issues = [...error48.issues].sort((a6, b7) => (a6.path ?? []).length - (b7.path ?? []).length);
21248
+ const issues = [...error51.issues].sort((a6, b7) => (a6.path ?? []).length - (b7.path ?? []).length);
21154
21249
  for (const issue2 of issues) {
21155
21250
  lines.push(`\u2716 ${issue2.message}`);
21156
21251
  if (issue2.path?.length)
@@ -21161,7 +21256,7 @@ function prettifyError(error48) {
21161
21256
 
21162
21257
  // node_modules/zod/v4/core/parse.js
21163
21258
  var _parse = (_Err) => (schema, value, _ctx2, _params) => {
21164
- const ctx2 = _ctx2 ? Object.assign(_ctx2, { async: false }) : { async: false };
21259
+ const ctx2 = _ctx2 ? { ..._ctx2, async: false } : { async: false };
21165
21260
  const result = schema._zod.run({ value, issues: [] }, ctx2);
21166
21261
  if (result instanceof Promise) {
21167
21262
  throw new $ZodAsyncError();
@@ -21175,7 +21270,7 @@ var _parse = (_Err) => (schema, value, _ctx2, _params) => {
21175
21270
  };
21176
21271
  var parse = /* @__PURE__ */ _parse($ZodRealError);
21177
21272
  var _parseAsync = (_Err) => async (schema, value, _ctx2, params) => {
21178
- const ctx2 = _ctx2 ? Object.assign(_ctx2, { async: true }) : { async: true };
21273
+ const ctx2 = _ctx2 ? { ..._ctx2, async: true } : { async: true };
21179
21274
  let result = schema._zod.run({ value, issues: [] }, ctx2);
21180
21275
  if (result instanceof Promise)
21181
21276
  result = await result;
@@ -21200,7 +21295,7 @@ var _safeParse = (_Err) => (schema, value, _ctx2) => {
21200
21295
  };
21201
21296
  var safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
21202
21297
  var _safeParseAsync = (_Err) => async (schema, value, _ctx2) => {
21203
- const ctx2 = _ctx2 ? Object.assign(_ctx2, { async: true }) : { async: true };
21298
+ const ctx2 = _ctx2 ? { ..._ctx2, async: true } : { async: true };
21204
21299
  let result = schema._zod.run({ value, issues: [] }, ctx2);
21205
21300
  if (result instanceof Promise)
21206
21301
  result = await result;
@@ -21211,7 +21306,7 @@ var _safeParseAsync = (_Err) => async (schema, value, _ctx2) => {
21211
21306
  };
21212
21307
  var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
21213
21308
  var _encode = (_Err) => (schema, value, _ctx2) => {
21214
- const ctx2 = _ctx2 ? Object.assign(_ctx2, { direction: "backward" }) : { direction: "backward" };
21309
+ const ctx2 = _ctx2 ? { ..._ctx2, direction: "backward" } : { direction: "backward" };
21215
21310
  return _parse(_Err)(schema, value, ctx2);
21216
21311
  };
21217
21312
  var encode = /* @__PURE__ */ _encode($ZodRealError);
@@ -21220,7 +21315,7 @@ var _decode = (_Err) => (schema, value, _ctx2) => {
21220
21315
  };
21221
21316
  var decode = /* @__PURE__ */ _decode($ZodRealError);
21222
21317
  var _encodeAsync = (_Err) => async (schema, value, _ctx2) => {
21223
- const ctx2 = _ctx2 ? Object.assign(_ctx2, { direction: "backward" }) : { direction: "backward" };
21318
+ const ctx2 = _ctx2 ? { ..._ctx2, direction: "backward" } : { direction: "backward" };
21224
21319
  return _parseAsync(_Err)(schema, value, ctx2);
21225
21320
  };
21226
21321
  var encodeAsync = /* @__PURE__ */ _encodeAsync($ZodRealError);
@@ -21229,7 +21324,7 @@ var _decodeAsync = (_Err) => async (schema, value, _ctx2) => {
21229
21324
  };
21230
21325
  var decodeAsync = /* @__PURE__ */ _decodeAsync($ZodRealError);
21231
21326
  var _safeEncode = (_Err) => (schema, value, _ctx2) => {
21232
- const ctx2 = _ctx2 ? Object.assign(_ctx2, { direction: "backward" }) : { direction: "backward" };
21327
+ const ctx2 = _ctx2 ? { ..._ctx2, direction: "backward" } : { direction: "backward" };
21233
21328
  return _safeParse(_Err)(schema, value, ctx2);
21234
21329
  };
21235
21330
  var safeEncode = /* @__PURE__ */ _safeEncode($ZodRealError);
@@ -21238,7 +21333,7 @@ var _safeDecode = (_Err) => (schema, value, _ctx2) => {
21238
21333
  };
21239
21334
  var safeDecode = /* @__PURE__ */ _safeDecode($ZodRealError);
21240
21335
  var _safeEncodeAsync = (_Err) => async (schema, value, _ctx2) => {
21241
- const ctx2 = _ctx2 ? Object.assign(_ctx2, { direction: "backward" }) : { direction: "backward" };
21336
+ const ctx2 = _ctx2 ? { ..._ctx2, direction: "backward" } : { direction: "backward" };
21242
21337
  return _safeParseAsync(_Err)(schema, value, ctx2);
21243
21338
  };
21244
21339
  var safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync($ZodRealError);
@@ -21271,6 +21366,7 @@ __export(regexes_exports, {
21271
21366
  hex: () => hex,
21272
21367
  hostname: () => hostname,
21273
21368
  html5Email: () => html5Email,
21369
+ httpProtocol: () => httpProtocol,
21274
21370
  idnEmail: () => idnEmail,
21275
21371
  integer: () => integer,
21276
21372
  ipv4: () => ipv4,
@@ -21309,7 +21405,7 @@ __export(regexes_exports, {
21309
21405
  uuid7: () => uuid7,
21310
21406
  xid: () => xid
21311
21407
  });
21312
- var cuid = /^[cC][^\s-]{8,}$/;
21408
+ var cuid = /^[cC][0-9a-z]{6,}$/;
21313
21409
  var cuid2 = /^[0-9a-z]+$/;
21314
21410
  var ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
21315
21411
  var xid = /^[0-9a-vA-V]{20}$/;
@@ -21348,6 +21444,7 @@ var base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/
21348
21444
  var base64url = /^[A-Za-z0-9_-]*$/;
21349
21445
  var hostname = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/;
21350
21446
  var domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/;
21447
+ var httpProtocol = /^https?$/;
21351
21448
  var e164 = /^\+[1-9]\d{6,14}$/;
21352
21449
  var dateSource = `(?:(?:\\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])))`;
21353
21450
  var date = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
@@ -21406,10 +21503,10 @@ var sha512_base64url = /* @__PURE__ */ fixedBase64url(86);
21406
21503
 
21407
21504
  // node_modules/zod/v4/core/checks.js
21408
21505
  var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
21409
- var _a2;
21506
+ var _a3;
21410
21507
  inst._zod ?? (inst._zod = {});
21411
21508
  inst._zod.def = def;
21412
- (_a2 = inst._zod).onattach ?? (_a2.onattach = []);
21509
+ (_a3 = inst._zod).onattach ?? (_a3.onattach = []);
21413
21510
  });
21414
21511
  var numericOriginMap = {
21415
21512
  number: "number",
@@ -21475,8 +21572,8 @@ var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan",
21475
21572
  var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
21476
21573
  $ZodCheck.init(inst, def);
21477
21574
  inst._zod.onattach.push((inst2) => {
21478
- var _a2;
21479
- (_a2 = inst2._zod.bag).multipleOf ?? (_a2.multipleOf = def.value);
21575
+ var _a3;
21576
+ (_a3 = inst2._zod.bag).multipleOf ?? (_a3.multipleOf = def.value);
21480
21577
  });
21481
21578
  inst._zod.check = (payload) => {
21482
21579
  if (typeof payload.value !== typeof def.value)
@@ -21609,9 +21706,9 @@ var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat"
21609
21706
  };
21610
21707
  });
21611
21708
  var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, def) => {
21612
- var _a2;
21709
+ var _a3;
21613
21710
  $ZodCheck.init(inst, def);
21614
- (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
21711
+ (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
21615
21712
  const val = payload.value;
21616
21713
  return !nullish(val) && val.size !== void 0;
21617
21714
  });
@@ -21637,9 +21734,9 @@ var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, d
21637
21734
  };
21638
21735
  });
21639
21736
  var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, def) => {
21640
- var _a2;
21737
+ var _a3;
21641
21738
  $ZodCheck.init(inst, def);
21642
- (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
21739
+ (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
21643
21740
  const val = payload.value;
21644
21741
  return !nullish(val) && val.size !== void 0;
21645
21742
  });
@@ -21665,9 +21762,9 @@ var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, d
21665
21762
  };
21666
21763
  });
21667
21764
  var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (inst, def) => {
21668
- var _a2;
21765
+ var _a3;
21669
21766
  $ZodCheck.init(inst, def);
21670
- (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
21767
+ (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
21671
21768
  const val = payload.value;
21672
21769
  return !nullish(val) && val.size !== void 0;
21673
21770
  });
@@ -21695,9 +21792,9 @@ var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (i
21695
21792
  };
21696
21793
  });
21697
21794
  var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
21698
- var _a2;
21795
+ var _a3;
21699
21796
  $ZodCheck.init(inst, def);
21700
- (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
21797
+ (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
21701
21798
  const val = payload.value;
21702
21799
  return !nullish(val) && val.length !== void 0;
21703
21800
  });
@@ -21724,9 +21821,9 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
21724
21821
  };
21725
21822
  });
21726
21823
  var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
21727
- var _a2;
21824
+ var _a3;
21728
21825
  $ZodCheck.init(inst, def);
21729
- (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
21826
+ (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
21730
21827
  const val = payload.value;
21731
21828
  return !nullish(val) && val.length !== void 0;
21732
21829
  });
@@ -21753,9 +21850,9 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
21753
21850
  };
21754
21851
  });
21755
21852
  var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
21756
- var _a2;
21853
+ var _a3;
21757
21854
  $ZodCheck.init(inst, def);
21758
- (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
21855
+ (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
21759
21856
  const val = payload.value;
21760
21857
  return !nullish(val) && val.length !== void 0;
21761
21858
  });
@@ -21784,7 +21881,7 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
21784
21881
  };
21785
21882
  });
21786
21883
  var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
21787
- var _a2, _b;
21884
+ var _a3, _b;
21788
21885
  $ZodCheck.init(inst, def);
21789
21886
  inst._zod.onattach.push((inst2) => {
21790
21887
  const bag = inst2._zod.bag;
@@ -21795,7 +21892,7 @@ var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat"
21795
21892
  }
21796
21893
  });
21797
21894
  if (def.pattern)
21798
- (_a2 = inst._zod).check ?? (_a2.check = (payload) => {
21895
+ (_a3 = inst._zod).check ?? (_a3.check = (payload) => {
21799
21896
  def.pattern.lastIndex = 0;
21800
21897
  if (def.pattern.test(payload.value))
21801
21898
  return;
@@ -21991,13 +22088,13 @@ var Doc = class {
21991
22088
  // node_modules/zod/v4/core/versions.js
21992
22089
  var version = {
21993
22090
  major: 4,
21994
- minor: 3,
21995
- patch: 6
22091
+ minor: 4,
22092
+ patch: 3
21996
22093
  };
21997
22094
 
21998
22095
  // node_modules/zod/v4/core/schemas.js
21999
22096
  var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
22000
- var _a2;
22097
+ var _a3;
22001
22098
  inst ?? (inst = {});
22002
22099
  inst._zod.def = def;
22003
22100
  inst._zod.bag = inst._zod.bag || {};
@@ -22012,7 +22109,7 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
22012
22109
  }
22013
22110
  }
22014
22111
  if (checks.length === 0) {
22015
- (_a2 = inst._zod).deferred ?? (_a2.deferred = []);
22112
+ (_a3 = inst._zod).deferred ?? (_a3.deferred = []);
22016
22113
  inst._zod.deferred?.push(() => {
22017
22114
  inst._zod.run = inst._zod.parse;
22018
22115
  });
@@ -22022,6 +22119,8 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
22022
22119
  let asyncResult;
22023
22120
  for (const ch of checks2) {
22024
22121
  if (ch._zod.def.when) {
22122
+ if (explicitlyAborted(payload))
22123
+ continue;
22025
22124
  const shouldRun = ch._zod.def.when(payload);
22026
22125
  if (!shouldRun)
22027
22126
  continue;
@@ -22162,6 +22261,19 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
22162
22261
  inst._zod.check = (payload) => {
22163
22262
  try {
22164
22263
  const trimmed = payload.value.trim();
22264
+ if (!def.normalize && def.protocol?.source === httpProtocol.source) {
22265
+ if (!/^https?:\/\//i.test(trimmed)) {
22266
+ payload.issues.push({
22267
+ code: "invalid_format",
22268
+ format: "url",
22269
+ note: "Invalid URL format",
22270
+ input: payload.value,
22271
+ inst,
22272
+ continue: !def.abort
22273
+ });
22274
+ return;
22275
+ }
22276
+ }
22165
22277
  const url2 = new URL(trimmed);
22166
22278
  if (def.hostname) {
22167
22279
  def.hostname.lastIndex = 0;
@@ -22315,6 +22427,8 @@ var $ZodCIDRv6 = /* @__PURE__ */ $constructor("$ZodCIDRv6", (inst, def) => {
22315
22427
  function isValidBase64(data) {
22316
22428
  if (data === "")
22317
22429
  return true;
22430
+ if (/\s/.test(data))
22431
+ return false;
22318
22432
  if (data.length % 4 !== 0)
22319
22433
  return false;
22320
22434
  try {
@@ -22507,8 +22621,6 @@ var $ZodUndefined = /* @__PURE__ */ $constructor("$ZodUndefined", (inst, def) =>
22507
22621
  $ZodType.init(inst, def);
22508
22622
  inst._zod.pattern = _undefined;
22509
22623
  inst._zod.values = /* @__PURE__ */ new Set([void 0]);
22510
- inst._zod.optin = "optional";
22511
- inst._zod.optout = "optional";
22512
22624
  inst._zod.parse = (payload, _ctx2) => {
22513
22625
  const input = payload.value;
22514
22626
  if (typeof input === "undefined")
@@ -22637,15 +22749,27 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
22637
22749
  return payload;
22638
22750
  };
22639
22751
  });
22640
- function handlePropertyResult(result, final, key, input, isOptionalOut) {
22752
+ function handlePropertyResult(result, final, key, input, isOptionalIn, isOptionalOut) {
22753
+ const isPresent = key in input;
22641
22754
  if (result.issues.length) {
22642
- if (isOptionalOut && !(key in input)) {
22755
+ if (isOptionalIn && isOptionalOut && !isPresent) {
22643
22756
  return;
22644
22757
  }
22645
22758
  final.issues.push(...prefixIssues(key, result.issues));
22646
22759
  }
22760
+ if (!isPresent && !isOptionalIn) {
22761
+ if (!result.issues.length) {
22762
+ final.issues.push({
22763
+ code: "invalid_type",
22764
+ expected: "nonoptional",
22765
+ input: void 0,
22766
+ path: [key]
22767
+ });
22768
+ }
22769
+ return;
22770
+ }
22647
22771
  if (result.value === void 0) {
22648
- if (key in input) {
22772
+ if (isPresent) {
22649
22773
  final.value[key] = void 0;
22650
22774
  }
22651
22775
  } else {
@@ -22673,8 +22797,11 @@ function handleCatchall(proms, input, payload, ctx2, def, inst) {
22673
22797
  const keySet = def.keySet;
22674
22798
  const _catchall = def.catchall._zod;
22675
22799
  const t = _catchall.def.type;
22800
+ const isOptionalIn = _catchall.optin === "optional";
22676
22801
  const isOptionalOut = _catchall.optout === "optional";
22677
22802
  for (const key in input) {
22803
+ if (key === "__proto__")
22804
+ continue;
22678
22805
  if (keySet.has(key))
22679
22806
  continue;
22680
22807
  if (t === "never") {
@@ -22683,9 +22810,9 @@ function handleCatchall(proms, input, payload, ctx2, def, inst) {
22683
22810
  }
22684
22811
  const r6 = _catchall.run({ value: input[key], issues: [] }, ctx2);
22685
22812
  if (r6 instanceof Promise) {
22686
- proms.push(r6.then((r10) => handlePropertyResult(r10, payload, key, input, isOptionalOut)));
22813
+ proms.push(r6.then((r10) => handlePropertyResult(r10, payload, key, input, isOptionalIn, isOptionalOut)));
22687
22814
  } else {
22688
- handlePropertyResult(r6, payload, key, input, isOptionalOut);
22815
+ handlePropertyResult(r6, payload, key, input, isOptionalIn, isOptionalOut);
22689
22816
  }
22690
22817
  }
22691
22818
  if (unrecognized.length) {
@@ -22751,12 +22878,13 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
22751
22878
  const shape = value.shape;
22752
22879
  for (const key of value.keys) {
22753
22880
  const el = shape[key];
22881
+ const isOptionalIn = el._zod.optin === "optional";
22754
22882
  const isOptionalOut = el._zod.optout === "optional";
22755
22883
  const r6 = el._zod.run({ value: input[key], issues: [] }, ctx2);
22756
22884
  if (r6 instanceof Promise) {
22757
- proms.push(r6.then((r10) => handlePropertyResult(r10, payload, key, input, isOptionalOut)));
22885
+ proms.push(r6.then((r10) => handlePropertyResult(r10, payload, key, input, isOptionalIn, isOptionalOut)));
22758
22886
  } else {
22759
- handlePropertyResult(r6, payload, key, input, isOptionalOut);
22887
+ handlePropertyResult(r6, payload, key, input, isOptionalIn, isOptionalOut);
22760
22888
  }
22761
22889
  }
22762
22890
  if (!catchall) {
@@ -22787,9 +22915,10 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
22787
22915
  const id = ids[key];
22788
22916
  const k2 = esc(key);
22789
22917
  const schema = shape[key];
22918
+ const isOptionalIn = schema?._zod?.optin === "optional";
22790
22919
  const isOptionalOut = schema?._zod?.optout === "optional";
22791
22920
  doc.write(`const ${id} = ${parseStr(key)};`);
22792
- if (isOptionalOut) {
22921
+ if (isOptionalIn && isOptionalOut) {
22793
22922
  doc.write(`
22794
22923
  if (${id}.issues.length) {
22795
22924
  if (${k2} in input) {
@@ -22808,6 +22937,33 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
22808
22937
  newResult[${k2}] = ${id}.value;
22809
22938
  }
22810
22939
 
22940
+ `);
22941
+ } else if (!isOptionalIn) {
22942
+ doc.write(`
22943
+ const ${id}_present = ${k2} in input;
22944
+ if (${id}.issues.length) {
22945
+ payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
22946
+ ...iss,
22947
+ path: iss.path ? [${k2}, ...iss.path] : [${k2}]
22948
+ })));
22949
+ }
22950
+ if (!${id}_present && !${id}.issues.length) {
22951
+ payload.issues.push({
22952
+ code: "invalid_type",
22953
+ expected: "nonoptional",
22954
+ input: undefined,
22955
+ path: [${k2}]
22956
+ });
22957
+ }
22958
+
22959
+ if (${id}_present) {
22960
+ if (${id}.value === undefined) {
22961
+ newResult[${k2}] = undefined;
22962
+ } else {
22963
+ newResult[${k2}] = ${id}.value;
22964
+ }
22965
+ }
22966
+
22811
22967
  `);
22812
22968
  } else {
22813
22969
  doc.write(`
@@ -22901,10 +23057,9 @@ var $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
22901
23057
  }
22902
23058
  return void 0;
22903
23059
  });
22904
- const single = def.options.length === 1;
22905
- const first = def.options[0]._zod.run;
23060
+ const first = def.options.length === 1 ? def.options[0]._zod.run : null;
22906
23061
  inst._zod.parse = (payload, ctx2) => {
22907
- if (single) {
23062
+ if (first) {
22908
23063
  return first(payload, ctx2);
22909
23064
  }
22910
23065
  let async = false;
@@ -22957,10 +23112,9 @@ function handleExclusiveUnionResults(results, final, inst, ctx2) {
22957
23112
  var $ZodXor = /* @__PURE__ */ $constructor("$ZodXor", (inst, def) => {
22958
23113
  $ZodUnion.init(inst, def);
22959
23114
  def.inclusive = false;
22960
- const single = def.options.length === 1;
22961
- const first = def.options[0]._zod.run;
23115
+ const first = def.options.length === 1 ? def.options[0]._zod.run : null;
22962
23116
  inst._zod.parse = (payload, ctx2) => {
22963
- if (single) {
23117
+ if (first) {
22964
23118
  return first(payload, ctx2);
22965
23119
  }
22966
23120
  let async = false;
@@ -23035,7 +23189,7 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
23035
23189
  if (opt) {
23036
23190
  return opt._zod.run(payload, ctx2);
23037
23191
  }
23038
- if (def.unionFallback) {
23192
+ if (def.unionFallback || ctx2.direction === "backward") {
23039
23193
  return _super(payload, ctx2);
23040
23194
  }
23041
23195
  payload.issues.push({
@@ -23043,6 +23197,7 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
23043
23197
  errors: [],
23044
23198
  note: "No matching discriminator",
23045
23199
  discriminator: def.discriminator,
23200
+ options: Array.from(disc.value.keys()),
23046
23201
  input,
23047
23202
  path: [def.discriminator],
23048
23203
  inst
@@ -23164,64 +23319,96 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
23164
23319
  }
23165
23320
  payload.value = [];
23166
23321
  const proms = [];
23167
- const reversedIndex = [...items].reverse().findIndex((item) => item._zod.optin !== "optional");
23168
- const optStart = reversedIndex === -1 ? 0 : items.length - reversedIndex;
23322
+ const optinStart = getTupleOptStart(items, "optin");
23323
+ const optoutStart = getTupleOptStart(items, "optout");
23169
23324
  if (!def.rest) {
23170
- const tooBig = input.length > items.length;
23171
- const tooSmall = input.length < optStart - 1;
23172
- if (tooBig || tooSmall) {
23325
+ if (input.length < optinStart) {
23173
23326
  payload.issues.push({
23174
- ...tooBig ? { code: "too_big", maximum: items.length, inclusive: true } : { code: "too_small", minimum: items.length },
23327
+ code: "too_small",
23328
+ minimum: optinStart,
23329
+ inclusive: true,
23175
23330
  input,
23176
23331
  inst,
23177
23332
  origin: "array"
23178
23333
  });
23179
23334
  return payload;
23180
23335
  }
23181
- }
23182
- let i2 = -1;
23183
- for (const item of items) {
23184
- i2++;
23185
- if (i2 >= input.length) {
23186
- if (i2 >= optStart)
23187
- continue;
23336
+ if (input.length > items.length) {
23337
+ payload.issues.push({
23338
+ code: "too_big",
23339
+ maximum: items.length,
23340
+ inclusive: true,
23341
+ input,
23342
+ inst,
23343
+ origin: "array"
23344
+ });
23188
23345
  }
23189
- const result = item._zod.run({
23190
- value: input[i2],
23191
- issues: []
23192
- }, ctx2);
23193
- if (result instanceof Promise) {
23194
- proms.push(result.then((result2) => handleTupleResult(result2, payload, i2)));
23346
+ }
23347
+ const itemResults = new Array(items.length);
23348
+ for (let i2 = 0; i2 < items.length; i2++) {
23349
+ const r6 = items[i2]._zod.run({ value: input[i2], issues: [] }, ctx2);
23350
+ if (r6 instanceof Promise) {
23351
+ proms.push(r6.then((rr) => {
23352
+ itemResults[i2] = rr;
23353
+ }));
23195
23354
  } else {
23196
- handleTupleResult(result, payload, i2);
23355
+ itemResults[i2] = r6;
23197
23356
  }
23198
23357
  }
23199
23358
  if (def.rest) {
23359
+ let i2 = items.length - 1;
23200
23360
  const rest = input.slice(items.length);
23201
23361
  for (const el of rest) {
23202
23362
  i2++;
23203
- const result = def.rest._zod.run({
23204
- value: el,
23205
- issues: []
23206
- }, ctx2);
23363
+ const result = def.rest._zod.run({ value: el, issues: [] }, ctx2);
23207
23364
  if (result instanceof Promise) {
23208
- proms.push(result.then((result2) => handleTupleResult(result2, payload, i2)));
23365
+ proms.push(result.then((r6) => handleTupleResult(r6, payload, i2)));
23209
23366
  } else {
23210
23367
  handleTupleResult(result, payload, i2);
23211
23368
  }
23212
23369
  }
23213
23370
  }
23214
- if (proms.length)
23215
- return Promise.all(proms).then(() => payload);
23216
- return payload;
23371
+ if (proms.length) {
23372
+ return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items, input, optoutStart));
23373
+ }
23374
+ return handleTupleResults(itemResults, payload, items, input, optoutStart);
23217
23375
  };
23218
23376
  });
23377
+ function getTupleOptStart(items, key) {
23378
+ for (let i2 = items.length - 1; i2 >= 0; i2--) {
23379
+ if (items[i2]._zod[key] !== "optional")
23380
+ return i2 + 1;
23381
+ }
23382
+ return 0;
23383
+ }
23219
23384
  function handleTupleResult(result, final, index) {
23220
23385
  if (result.issues.length) {
23221
23386
  final.issues.push(...prefixIssues(index, result.issues));
23222
23387
  }
23223
23388
  final.value[index] = result.value;
23224
23389
  }
23390
+ function handleTupleResults(itemResults, final, items, input, optoutStart) {
23391
+ for (let i2 = 0; i2 < items.length; i2++) {
23392
+ const r6 = itemResults[i2];
23393
+ const isPresent = i2 < input.length;
23394
+ if (r6.issues.length) {
23395
+ if (!isPresent && i2 >= optoutStart) {
23396
+ final.value.length = i2;
23397
+ break;
23398
+ }
23399
+ final.issues.push(...prefixIssues(i2, r6.issues));
23400
+ }
23401
+ final.value[i2] = r6.value;
23402
+ }
23403
+ for (let i2 = final.value.length - 1; i2 >= input.length; i2--) {
23404
+ if (items[i2]._zod.optout === "optional" && final.value[i2] === void 0) {
23405
+ final.value.length = i2;
23406
+ } else {
23407
+ break;
23408
+ }
23409
+ }
23410
+ return final;
23411
+ }
23225
23412
  var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
23226
23413
  $ZodType.init(inst, def);
23227
23414
  inst._zod.parse = (payload, ctx2) => {
@@ -23243,19 +23430,35 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
23243
23430
  for (const key of values) {
23244
23431
  if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
23245
23432
  recordKeys.add(typeof key === "number" ? key.toString() : key);
23433
+ const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx2);
23434
+ if (keyResult instanceof Promise) {
23435
+ throw new Error("Async schemas not supported in object keys currently");
23436
+ }
23437
+ if (keyResult.issues.length) {
23438
+ payload.issues.push({
23439
+ code: "invalid_key",
23440
+ origin: "record",
23441
+ issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx2, config())),
23442
+ input: key,
23443
+ path: [key],
23444
+ inst
23445
+ });
23446
+ continue;
23447
+ }
23448
+ const outKey = keyResult.value;
23246
23449
  const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx2);
23247
23450
  if (result instanceof Promise) {
23248
23451
  proms.push(result.then((result2) => {
23249
23452
  if (result2.issues.length) {
23250
23453
  payload.issues.push(...prefixIssues(key, result2.issues));
23251
23454
  }
23252
- payload.value[key] = result2.value;
23455
+ payload.value[outKey] = result2.value;
23253
23456
  }));
23254
23457
  } else {
23255
23458
  if (result.issues.length) {
23256
23459
  payload.issues.push(...prefixIssues(key, result.issues));
23257
23460
  }
23258
- payload.value[key] = result.value;
23461
+ payload.value[outKey] = result.value;
23259
23462
  }
23260
23463
  }
23261
23464
  }
@@ -23279,6 +23482,8 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
23279
23482
  for (const key of Reflect.ownKeys(input)) {
23280
23483
  if (key === "__proto__")
23281
23484
  continue;
23485
+ if (!Object.prototype.propertyIsEnumerable.call(input, key))
23486
+ continue;
23282
23487
  let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx2);
23283
23488
  if (keyResult instanceof Promise) {
23284
23489
  throw new Error("Async schemas not supported in object keys currently");
@@ -23483,6 +23688,7 @@ var $ZodFile = /* @__PURE__ */ $constructor("$ZodFile", (inst, def) => {
23483
23688
  });
23484
23689
  var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) => {
23485
23690
  $ZodType.init(inst, def);
23691
+ inst._zod.optin = "optional";
23486
23692
  inst._zod.parse = (payload, ctx2) => {
23487
23693
  if (ctx2.direction === "backward") {
23488
23694
  throw new $ZodEncodeError(inst.constructor.name);
@@ -23492,6 +23698,7 @@ var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) =>
23492
23698
  const output = _out instanceof Promise ? _out : Promise.resolve(_out);
23493
23699
  return output.then((output2) => {
23494
23700
  payload.value = output2;
23701
+ payload.fallback = true;
23495
23702
  return payload;
23496
23703
  });
23497
23704
  }
@@ -23499,11 +23706,12 @@ var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) =>
23499
23706
  throw new $ZodAsyncError();
23500
23707
  }
23501
23708
  payload.value = _out;
23709
+ payload.fallback = true;
23502
23710
  return payload;
23503
23711
  };
23504
23712
  });
23505
23713
  function handleOptionalResult(result, input) {
23506
- if (result.issues.length && input === void 0) {
23714
+ if (input === void 0 && (result.issues.length || result.fallback)) {
23507
23715
  return { issues: [], value: void 0 };
23508
23716
  }
23509
23717
  return result;
@@ -23521,10 +23729,11 @@ var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
23521
23729
  });
23522
23730
  inst._zod.parse = (payload, ctx2) => {
23523
23731
  if (def.innerType._zod.optin === "optional") {
23732
+ const input = payload.value;
23524
23733
  const result = def.innerType._zod.run(payload, ctx2);
23525
23734
  if (result instanceof Promise)
23526
- return result.then((r6) => handleOptionalResult(r6, payload.value));
23527
- return handleOptionalResult(result, payload.value);
23735
+ return result.then((r6) => handleOptionalResult(r6, input));
23736
+ return handleOptionalResult(result, input);
23528
23737
  }
23529
23738
  if (payload.value === void 0) {
23530
23739
  return payload;
@@ -23640,7 +23849,7 @@ var $ZodSuccess = /* @__PURE__ */ $constructor("$ZodSuccess", (inst, def) => {
23640
23849
  });
23641
23850
  var $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
23642
23851
  $ZodType.init(inst, def);
23643
- defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
23852
+ inst._zod.optin = "optional";
23644
23853
  defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
23645
23854
  defineLazy(inst._zod, "values", () => def.innerType._zod.values);
23646
23855
  inst._zod.parse = (payload, ctx2) => {
@@ -23660,6 +23869,7 @@ var $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
23660
23869
  input: payload.value
23661
23870
  });
23662
23871
  payload.issues = [];
23872
+ payload.fallback = true;
23663
23873
  }
23664
23874
  return payload;
23665
23875
  });
@@ -23674,6 +23884,7 @@ var $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
23674
23884
  input: payload.value
23675
23885
  });
23676
23886
  payload.issues = [];
23887
+ payload.fallback = true;
23677
23888
  }
23678
23889
  return payload;
23679
23890
  };
@@ -23719,7 +23930,7 @@ function handlePipeResult(left, next, ctx2) {
23719
23930
  left.aborted = true;
23720
23931
  return left;
23721
23932
  }
23722
- return next._zod.run({ value: left.value, issues: left.issues }, ctx2);
23933
+ return next._zod.run({ value: left.value, issues: left.issues, fallback: left.fallback }, ctx2);
23723
23934
  }
23724
23935
  var $ZodCodec = /* @__PURE__ */ $constructor("$ZodCodec", (inst, def) => {
23725
23936
  $ZodType.init(inst, def);
@@ -23771,6 +23982,9 @@ function handleCodecTxResult(left, value, nextSchema, ctx2) {
23771
23982
  }
23772
23983
  return nextSchema._zod.run({ value, issues: left.issues }, ctx2);
23773
23984
  }
23985
+ var $ZodPreprocess = /* @__PURE__ */ $constructor("$ZodPreprocess", (inst, def) => {
23986
+ $ZodPipe.init(inst, def);
23987
+ });
23774
23988
  var $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => {
23775
23989
  $ZodType.init(inst, def);
23776
23990
  defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
@@ -23922,7 +24136,12 @@ var $ZodPromise = /* @__PURE__ */ $constructor("$ZodPromise", (inst, def) => {
23922
24136
  });
23923
24137
  var $ZodLazy = /* @__PURE__ */ $constructor("$ZodLazy", (inst, def) => {
23924
24138
  $ZodType.init(inst, def);
23925
- defineLazy(inst._zod, "innerType", () => def.getter());
24139
+ defineLazy(inst._zod, "innerType", () => {
24140
+ const d2 = def;
24141
+ if (!d2._cachedInner)
24142
+ d2._cachedInner = def.getter();
24143
+ return d2._cachedInner;
24144
+ });
23926
24145
  defineLazy(inst._zod, "pattern", () => inst._zod.innerType?._zod?.pattern);
23927
24146
  defineLazy(inst._zod, "propValues", () => inst._zod.innerType?._zod?.propValues);
23928
24147
  defineLazy(inst._zod, "optin", () => inst._zod.innerType?._zod?.optin ?? void 0);
@@ -23977,6 +24196,7 @@ __export(locales_exports, {
23977
24196
  cs: () => cs_default,
23978
24197
  da: () => da_default,
23979
24198
  de: () => de_default,
24199
+ el: () => el_default,
23980
24200
  en: () => en_default,
23981
24201
  eo: () => eo_default,
23982
24202
  es: () => es_default,
@@ -23985,6 +24205,7 @@ __export(locales_exports, {
23985
24205
  fr: () => fr_default,
23986
24206
  frCA: () => fr_CA_default,
23987
24207
  he: () => he_default,
24208
+ hr: () => hr_default,
23988
24209
  hu: () => hu_default,
23989
24210
  hy: () => hy_default,
23990
24211
  id: () => id_default,
@@ -24004,6 +24225,7 @@ __export(locales_exports, {
24004
24225
  pl: () => pl_default,
24005
24226
  ps: () => ps_default,
24006
24227
  pt: () => pt_default,
24228
+ ro: () => ro_default,
24007
24229
  ru: () => ru_default,
24008
24230
  sl: () => sl_default,
24009
24231
  sv: () => sv_default,
@@ -24957,8 +25179,118 @@ function de_default() {
24957
25179
  };
24958
25180
  }
24959
25181
 
24960
- // node_modules/zod/v4/locales/en.js
25182
+ // node_modules/zod/v4/locales/el.js
24961
25183
  var error9 = () => {
25184
+ const Sizable = {
25185
+ string: { unit: "\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2", verb: "\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9" },
25186
+ file: { unit: "bytes", verb: "\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9" },
25187
+ array: { unit: "\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1", verb: "\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9" },
25188
+ set: { unit: "\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1", verb: "\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9" },
25189
+ map: { unit: "\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2", verb: "\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9" }
25190
+ };
25191
+ function getSizing(origin) {
25192
+ return Sizable[origin] ?? null;
25193
+ }
25194
+ const FormatDictionary = {
25195
+ regex: "\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",
25196
+ email: "\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",
25197
+ url: "URL",
25198
+ emoji: "emoji",
25199
+ uuid: "UUID",
25200
+ uuidv4: "UUIDv4",
25201
+ uuidv6: "UUIDv6",
25202
+ nanoid: "nanoid",
25203
+ guid: "GUID",
25204
+ cuid: "cuid",
25205
+ cuid2: "cuid2",
25206
+ ulid: "ULID",
25207
+ xid: "XID",
25208
+ ksuid: "KSUID",
25209
+ datetime: "ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",
25210
+ date: "ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",
25211
+ time: "ISO \u03CE\u03C1\u03B1",
25212
+ duration: "ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",
25213
+ ipv4: "\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",
25214
+ ipv6: "\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",
25215
+ mac: "\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",
25216
+ cidrv4: "\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",
25217
+ cidrv6: "\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",
25218
+ base64: "\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",
25219
+ base64url: "\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",
25220
+ json_string: "\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",
25221
+ e164: "\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",
25222
+ jwt: "JWT",
25223
+ template_literal: "\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"
25224
+ };
25225
+ const TypeDictionary = {
25226
+ nan: "NaN"
25227
+ };
25228
+ return (issue2) => {
25229
+ switch (issue2.code) {
25230
+ case "invalid_type": {
25231
+ const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
25232
+ const receivedType = parsedType(issue2.input);
25233
+ const received = TypeDictionary[receivedType] ?? receivedType;
25234
+ if (typeof issue2.expected === "string" && /^[A-Z]/.test(issue2.expected)) {
25235
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${issue2.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${received}`;
25236
+ }
25237
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${received}`;
25238
+ }
25239
+ case "invalid_value":
25240
+ if (issue2.values.length === 1)
25241
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${stringifyPrimitive(issue2.values[0])}`;
25242
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${joinValues(issue2.values, "|")}`;
25243
+ case "too_big": {
25244
+ const adj = issue2.inclusive ? "<=" : "<";
25245
+ const sizing = getSizing(issue2.origin);
25246
+ if (sizing)
25247
+ return `\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${issue2.origin ?? "\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`;
25248
+ return `\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${issue2.origin ?? "\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${adj}${issue2.maximum.toString()}`;
25249
+ }
25250
+ case "too_small": {
25251
+ const adj = issue2.inclusive ? ">=" : ">";
25252
+ const sizing = getSizing(issue2.origin);
25253
+ if (sizing) {
25254
+ return `\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${issue2.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
25255
+ }
25256
+ return `\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${issue2.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${adj}${issue2.minimum.toString()}`;
25257
+ }
25258
+ case "invalid_format": {
25259
+ const _issue = issue2;
25260
+ if (_issue.format === "starts_with") {
25261
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${_issue.prefix}"`;
25262
+ }
25263
+ if (_issue.format === "ends_with")
25264
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${_issue.suffix}"`;
25265
+ if (_issue.format === "includes")
25266
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${_issue.includes}"`;
25267
+ if (_issue.format === "regex")
25268
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${_issue.pattern}`;
25269
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${FormatDictionary[_issue.format] ?? issue2.format}`;
25270
+ }
25271
+ case "not_multiple_of":
25272
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${issue2.divisor}`;
25273
+ case "unrecognized_keys":
25274
+ return `\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${issue2.keys.length > 1 ? "\u03B1" : "\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${issue2.keys.length > 1 ? "\u03B9\u03AC" : "\u03AF"}: ${joinValues(issue2.keys, ", ")}`;
25275
+ case "invalid_key":
25276
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${issue2.origin}`;
25277
+ case "invalid_union":
25278
+ return "\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";
25279
+ case "invalid_element":
25280
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${issue2.origin}`;
25281
+ default:
25282
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2`;
25283
+ }
25284
+ };
25285
+ };
25286
+ function el_default() {
25287
+ return {
25288
+ localeError: error9()
25289
+ };
25290
+ }
25291
+
25292
+ // node_modules/zod/v4/locales/en.js
25293
+ var error10 = () => {
24962
25294
  const Sizable = {
24963
25295
  string: { unit: "characters", verb: "to have" },
24964
25296
  file: { unit: "bytes", verb: "to have" },
@@ -25052,6 +25384,10 @@ var error9 = () => {
25052
25384
  case "invalid_key":
25053
25385
  return `Invalid key in ${issue2.origin}`;
25054
25386
  case "invalid_union":
25387
+ if (issue2.options && Array.isArray(issue2.options) && issue2.options.length > 0) {
25388
+ const opts = issue2.options.map((o2) => `'${o2}'`).join(" | ");
25389
+ return `Invalid discriminator value. Expected ${opts}`;
25390
+ }
25055
25391
  return "Invalid input";
25056
25392
  case "invalid_element":
25057
25393
  return `Invalid value in ${issue2.origin}`;
@@ -25062,12 +25398,12 @@ var error9 = () => {
25062
25398
  };
25063
25399
  function en_default() {
25064
25400
  return {
25065
- localeError: error9()
25401
+ localeError: error10()
25066
25402
  };
25067
25403
  }
25068
25404
 
25069
25405
  // node_modules/zod/v4/locales/eo.js
25070
- var error10 = () => {
25406
+ var error11 = () => {
25071
25407
  const Sizable = {
25072
25408
  string: { unit: "karaktrojn", verb: "havi" },
25073
25409
  file: { unit: "bajtojn", verb: "havi" },
@@ -25172,12 +25508,12 @@ var error10 = () => {
25172
25508
  };
25173
25509
  function eo_default() {
25174
25510
  return {
25175
- localeError: error10()
25511
+ localeError: error11()
25176
25512
  };
25177
25513
  }
25178
25514
 
25179
25515
  // node_modules/zod/v4/locales/es.js
25180
- var error11 = () => {
25516
+ var error12 = () => {
25181
25517
  const Sizable = {
25182
25518
  string: { unit: "caracteres", verb: "tener" },
25183
25519
  file: { unit: "bytes", verb: "tener" },
@@ -25305,12 +25641,12 @@ var error11 = () => {
25305
25641
  };
25306
25642
  function es_default() {
25307
25643
  return {
25308
- localeError: error11()
25644
+ localeError: error12()
25309
25645
  };
25310
25646
  }
25311
25647
 
25312
25648
  // node_modules/zod/v4/locales/fa.js
25313
- var error12 = () => {
25649
+ var error13 = () => {
25314
25650
  const Sizable = {
25315
25651
  string: { unit: "\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631", verb: "\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F" },
25316
25652
  file: { unit: "\u0628\u0627\u06CC\u062A", verb: "\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F" },
@@ -25420,12 +25756,12 @@ var error12 = () => {
25420
25756
  };
25421
25757
  function fa_default() {
25422
25758
  return {
25423
- localeError: error12()
25759
+ localeError: error13()
25424
25760
  };
25425
25761
  }
25426
25762
 
25427
25763
  // node_modules/zod/v4/locales/fi.js
25428
- var error13 = () => {
25764
+ var error14 = () => {
25429
25765
  const Sizable = {
25430
25766
  string: { unit: "merkki\xE4", subject: "merkkijonon" },
25431
25767
  file: { unit: "tavua", subject: "tiedoston" },
@@ -25533,12 +25869,12 @@ var error13 = () => {
25533
25869
  };
25534
25870
  function fi_default() {
25535
25871
  return {
25536
- localeError: error13()
25872
+ localeError: error14()
25537
25873
  };
25538
25874
  }
25539
25875
 
25540
25876
  // node_modules/zod/v4/locales/fr.js
25541
- var error14 = () => {
25877
+ var error15 = () => {
25542
25878
  const Sizable = {
25543
25879
  string: { unit: "caract\xE8res", verb: "avoir" },
25544
25880
  file: { unit: "octets", verb: "avoir" },
@@ -25579,9 +25915,27 @@ var error14 = () => {
25579
25915
  template_literal: "entr\xE9e"
25580
25916
  };
25581
25917
  const TypeDictionary = {
25582
- nan: "NaN",
25918
+ string: "cha\xEEne",
25583
25919
  number: "nombre",
25584
- array: "tableau"
25920
+ int: "entier",
25921
+ boolean: "bool\xE9en",
25922
+ bigint: "grand entier",
25923
+ symbol: "symbole",
25924
+ undefined: "ind\xE9fini",
25925
+ null: "null",
25926
+ never: "jamais",
25927
+ void: "vide",
25928
+ date: "date",
25929
+ array: "tableau",
25930
+ object: "objet",
25931
+ tuple: "tuple",
25932
+ record: "enregistrement",
25933
+ map: "carte",
25934
+ set: "ensemble",
25935
+ file: "fichier",
25936
+ nonoptional: "non-optionnel",
25937
+ nan: "NaN",
25938
+ function: "fonction"
25585
25939
  };
25586
25940
  return (issue2) => {
25587
25941
  switch (issue2.code) {
@@ -25602,16 +25956,15 @@ var error14 = () => {
25602
25956
  const adj = issue2.inclusive ? "<=" : "<";
25603
25957
  const sizing = getSizing(issue2.origin);
25604
25958
  if (sizing)
25605
- return `Trop grand : ${issue2.origin ?? "valeur"} doit ${sizing.verb} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\xE9l\xE9ment(s)"}`;
25606
- return `Trop grand : ${issue2.origin ?? "valeur"} doit \xEAtre ${adj}${issue2.maximum.toString()}`;
25959
+ return `Trop grand : ${TypeDictionary[issue2.origin] ?? "valeur"} doit ${sizing.verb} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\xE9l\xE9ment(s)"}`;
25960
+ return `Trop grand : ${TypeDictionary[issue2.origin] ?? "valeur"} doit \xEAtre ${adj}${issue2.maximum.toString()}`;
25607
25961
  }
25608
25962
  case "too_small": {
25609
25963
  const adj = issue2.inclusive ? ">=" : ">";
25610
25964
  const sizing = getSizing(issue2.origin);
25611
- if (sizing) {
25612
- return `Trop petit : ${issue2.origin} doit ${sizing.verb} ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
25613
- }
25614
- return `Trop petit : ${issue2.origin} doit \xEAtre ${adj}${issue2.minimum.toString()}`;
25965
+ if (sizing)
25966
+ return `Trop petit : ${TypeDictionary[issue2.origin] ?? "valeur"} doit ${sizing.verb} ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
25967
+ return `Trop petit : ${TypeDictionary[issue2.origin] ?? "valeur"} doit \xEAtre ${adj}${issue2.minimum.toString()}`;
25615
25968
  }
25616
25969
  case "invalid_format": {
25617
25970
  const _issue = issue2;
@@ -25642,12 +25995,12 @@ var error14 = () => {
25642
25995
  };
25643
25996
  function fr_default() {
25644
25997
  return {
25645
- localeError: error14()
25998
+ localeError: error15()
25646
25999
  };
25647
26000
  }
25648
26001
 
25649
26002
  // node_modules/zod/v4/locales/fr-CA.js
25650
- var error15 = () => {
26003
+ var error16 = () => {
25651
26004
  const Sizable = {
25652
26005
  string: { unit: "caract\xE8res", verb: "avoir" },
25653
26006
  file: { unit: "octets", verb: "avoir" },
@@ -25750,12 +26103,12 @@ var error15 = () => {
25750
26103
  };
25751
26104
  function fr_CA_default() {
25752
26105
  return {
25753
- localeError: error15()
26106
+ localeError: error16()
25754
26107
  };
25755
26108
  }
25756
26109
 
25757
26110
  // node_modules/zod/v4/locales/he.js
25758
- var error16 = () => {
26111
+ var error17 = () => {
25759
26112
  const TypeNames = {
25760
26113
  string: { label: "\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA", gender: "f" },
25761
26114
  number: { label: "\u05DE\u05E1\u05E4\u05E8", gender: "m" },
@@ -25945,12 +26298,135 @@ var error16 = () => {
25945
26298
  };
25946
26299
  function he_default() {
25947
26300
  return {
25948
- localeError: error16()
26301
+ localeError: error17()
26302
+ };
26303
+ }
26304
+
26305
+ // node_modules/zod/v4/locales/hr.js
26306
+ var error18 = () => {
26307
+ const Sizable = {
26308
+ string: { unit: "znakova", verb: "imati" },
26309
+ file: { unit: "bajtova", verb: "imati" },
26310
+ array: { unit: "stavki", verb: "imati" },
26311
+ set: { unit: "stavki", verb: "imati" }
26312
+ };
26313
+ function getSizing(origin) {
26314
+ return Sizable[origin] ?? null;
26315
+ }
26316
+ const FormatDictionary = {
26317
+ regex: "unos",
26318
+ email: "email adresa",
26319
+ url: "URL",
26320
+ emoji: "emoji",
26321
+ uuid: "UUID",
26322
+ uuidv4: "UUIDv4",
26323
+ uuidv6: "UUIDv6",
26324
+ nanoid: "nanoid",
26325
+ guid: "GUID",
26326
+ cuid: "cuid",
26327
+ cuid2: "cuid2",
26328
+ ulid: "ULID",
26329
+ xid: "XID",
26330
+ ksuid: "KSUID",
26331
+ datetime: "ISO datum i vrijeme",
26332
+ date: "ISO datum",
26333
+ time: "ISO vrijeme",
26334
+ duration: "ISO trajanje",
26335
+ ipv4: "IPv4 adresa",
26336
+ ipv6: "IPv6 adresa",
26337
+ cidrv4: "IPv4 raspon",
26338
+ cidrv6: "IPv6 raspon",
26339
+ base64: "base64 kodirani tekst",
26340
+ base64url: "base64url kodirani tekst",
26341
+ json_string: "JSON tekst",
26342
+ e164: "E.164 broj",
26343
+ jwt: "JWT",
26344
+ template_literal: "unos"
26345
+ };
26346
+ const TypeDictionary = {
26347
+ nan: "NaN",
26348
+ string: "tekst",
26349
+ number: "broj",
26350
+ boolean: "boolean",
26351
+ array: "niz",
26352
+ object: "objekt",
26353
+ set: "skup",
26354
+ file: "datoteka",
26355
+ date: "datum",
26356
+ bigint: "bigint",
26357
+ symbol: "simbol",
26358
+ undefined: "undefined",
26359
+ null: "null",
26360
+ function: "funkcija",
26361
+ map: "mapa"
26362
+ };
26363
+ return (issue2) => {
26364
+ switch (issue2.code) {
26365
+ case "invalid_type": {
26366
+ const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
26367
+ const receivedType = parsedType(issue2.input);
26368
+ const received = TypeDictionary[receivedType] ?? receivedType;
26369
+ if (/^[A-Z]/.test(issue2.expected)) {
26370
+ return `Neispravan unos: o\u010Dekuje se instanceof ${issue2.expected}, a primljeno je ${received}`;
26371
+ }
26372
+ return `Neispravan unos: o\u010Dekuje se ${expected}, a primljeno je ${received}`;
26373
+ }
26374
+ case "invalid_value":
26375
+ if (issue2.values.length === 1)
26376
+ return `Neispravna vrijednost: o\u010Dekivano ${stringifyPrimitive(issue2.values[0])}`;
26377
+ return `Neispravna opcija: o\u010Dekivano jedno od ${joinValues(issue2.values, "|")}`;
26378
+ case "too_big": {
26379
+ const adj = issue2.inclusive ? "<=" : "<";
26380
+ const sizing = getSizing(issue2.origin);
26381
+ const origin = TypeDictionary[issue2.origin] ?? issue2.origin;
26382
+ if (sizing)
26383
+ return `Preveliko: o\u010Dekivano da ${origin ?? "vrijednost"} ima ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elemenata"}`;
26384
+ return `Preveliko: o\u010Dekivano da ${origin ?? "vrijednost"} bude ${adj}${issue2.maximum.toString()}`;
26385
+ }
26386
+ case "too_small": {
26387
+ const adj = issue2.inclusive ? ">=" : ">";
26388
+ const sizing = getSizing(issue2.origin);
26389
+ const origin = TypeDictionary[issue2.origin] ?? issue2.origin;
26390
+ if (sizing) {
26391
+ return `Premalo: o\u010Dekivano da ${origin} ima ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
26392
+ }
26393
+ return `Premalo: o\u010Dekivano da ${origin} bude ${adj}${issue2.minimum.toString()}`;
26394
+ }
26395
+ case "invalid_format": {
26396
+ const _issue = issue2;
26397
+ if (_issue.format === "starts_with")
26398
+ return `Neispravan tekst: mora zapo\u010Dinjati s "${_issue.prefix}"`;
26399
+ if (_issue.format === "ends_with")
26400
+ return `Neispravan tekst: mora zavr\u0161avati s "${_issue.suffix}"`;
26401
+ if (_issue.format === "includes")
26402
+ return `Neispravan tekst: mora sadr\u017Eavati "${_issue.includes}"`;
26403
+ if (_issue.format === "regex")
26404
+ return `Neispravan tekst: mora odgovarati uzorku ${_issue.pattern}`;
26405
+ return `Neispravna ${FormatDictionary[_issue.format] ?? issue2.format}`;
26406
+ }
26407
+ case "not_multiple_of":
26408
+ return `Neispravan broj: mora biti vi\u0161ekratnik od ${issue2.divisor}`;
26409
+ case "unrecognized_keys":
26410
+ return `Neprepoznat${issue2.keys.length > 1 ? "i klju\u010Devi" : " klju\u010D"}: ${joinValues(issue2.keys, ", ")}`;
26411
+ case "invalid_key":
26412
+ return `Neispravan klju\u010D u ${TypeDictionary[issue2.origin] ?? issue2.origin}`;
26413
+ case "invalid_union":
26414
+ return "Neispravan unos";
26415
+ case "invalid_element":
26416
+ return `Neispravna vrijednost u ${TypeDictionary[issue2.origin] ?? issue2.origin}`;
26417
+ default:
26418
+ return `Neispravan unos`;
26419
+ }
26420
+ };
26421
+ };
26422
+ function hr_default() {
26423
+ return {
26424
+ localeError: error18()
25949
26425
  };
25950
26426
  }
25951
26427
 
25952
26428
  // node_modules/zod/v4/locales/hu.js
25953
- var error17 = () => {
26429
+ var error19 = () => {
25954
26430
  const Sizable = {
25955
26431
  string: { unit: "karakter", verb: "legyen" },
25956
26432
  file: { unit: "byte", verb: "legyen" },
@@ -26054,7 +26530,7 @@ var error17 = () => {
26054
26530
  };
26055
26531
  function hu_default() {
26056
26532
  return {
26057
- localeError: error17()
26533
+ localeError: error19()
26058
26534
  };
26059
26535
  }
26060
26536
 
@@ -26069,7 +26545,7 @@ function withDefiniteArticle(word) {
26069
26545
  const lastChar = word[word.length - 1];
26070
26546
  return word + (vowels.includes(lastChar) ? "\u0576" : "\u0568");
26071
26547
  }
26072
- var error18 = () => {
26548
+ var error20 = () => {
26073
26549
  const Sizable = {
26074
26550
  string: {
26075
26551
  unit: {
@@ -26202,12 +26678,12 @@ var error18 = () => {
26202
26678
  };
26203
26679
  function hy_default() {
26204
26680
  return {
26205
- localeError: error18()
26681
+ localeError: error20()
26206
26682
  };
26207
26683
  }
26208
26684
 
26209
26685
  // node_modules/zod/v4/locales/id.js
26210
- var error19 = () => {
26686
+ var error21 = () => {
26211
26687
  const Sizable = {
26212
26688
  string: { unit: "karakter", verb: "memiliki" },
26213
26689
  file: { unit: "byte", verb: "memiliki" },
@@ -26309,12 +26785,12 @@ var error19 = () => {
26309
26785
  };
26310
26786
  function id_default() {
26311
26787
  return {
26312
- localeError: error19()
26788
+ localeError: error21()
26313
26789
  };
26314
26790
  }
26315
26791
 
26316
26792
  // node_modules/zod/v4/locales/is.js
26317
- var error20 = () => {
26793
+ var error22 = () => {
26318
26794
  const Sizable = {
26319
26795
  string: { unit: "stafi", verb: "a\xF0 hafa" },
26320
26796
  file: { unit: "b\xE6ti", verb: "a\xF0 hafa" },
@@ -26419,12 +26895,12 @@ var error20 = () => {
26419
26895
  };
26420
26896
  function is_default() {
26421
26897
  return {
26422
- localeError: error20()
26898
+ localeError: error22()
26423
26899
  };
26424
26900
  }
26425
26901
 
26426
26902
  // node_modules/zod/v4/locales/it.js
26427
- var error21 = () => {
26903
+ var error23 = () => {
26428
26904
  const Sizable = {
26429
26905
  string: { unit: "caratteri", verb: "avere" },
26430
26906
  file: { unit: "byte", verb: "avere" },
@@ -26509,7 +26985,7 @@ var error21 = () => {
26509
26985
  return `Stringa non valida: deve includere "${_issue.includes}"`;
26510
26986
  if (_issue.format === "regex")
26511
26987
  return `Stringa non valida: deve corrispondere al pattern ${_issue.pattern}`;
26512
- return `Invalid ${FormatDictionary[_issue.format] ?? issue2.format}`;
26988
+ return `Input non valido: ${FormatDictionary[_issue.format] ?? issue2.format}`;
26513
26989
  }
26514
26990
  case "not_multiple_of":
26515
26991
  return `Numero non valido: deve essere un multiplo di ${issue2.divisor}`;
@@ -26528,12 +27004,12 @@ var error21 = () => {
26528
27004
  };
26529
27005
  function it_default() {
26530
27006
  return {
26531
- localeError: error21()
27007
+ localeError: error23()
26532
27008
  };
26533
27009
  }
26534
27010
 
26535
27011
  // node_modules/zod/v4/locales/ja.js
26536
- var error22 = () => {
27012
+ var error24 = () => {
26537
27013
  const Sizable = {
26538
27014
  string: { unit: "\u6587\u5B57", verb: "\u3067\u3042\u308B" },
26539
27015
  file: { unit: "\u30D0\u30A4\u30C8", verb: "\u3067\u3042\u308B" },
@@ -26636,12 +27112,12 @@ var error22 = () => {
26636
27112
  };
26637
27113
  function ja_default() {
26638
27114
  return {
26639
- localeError: error22()
27115
+ localeError: error24()
26640
27116
  };
26641
27117
  }
26642
27118
 
26643
27119
  // node_modules/zod/v4/locales/ka.js
26644
- var error23 = () => {
27120
+ var error25 = () => {
26645
27121
  const Sizable = {
26646
27122
  string: { unit: "\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD", verb: "\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1" },
26647
27123
  file: { unit: "\u10D1\u10D0\u10D8\u10E2\u10D8", verb: "\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1" },
@@ -26674,9 +27150,9 @@ var error23 = () => {
26674
27150
  ipv6: "IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",
26675
27151
  cidrv4: "IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",
26676
27152
  cidrv6: "IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",
26677
- base64: "base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",
26678
- base64url: "base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",
26679
- json_string: "JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",
27153
+ base64: "base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",
27154
+ base64url: "base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",
27155
+ json_string: "JSON \u10D5\u10D4\u10DA\u10D8",
26680
27156
  e164: "E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",
26681
27157
  jwt: "JWT",
26682
27158
  template_literal: "\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"
@@ -26684,7 +27160,7 @@ var error23 = () => {
26684
27160
  const TypeDictionary = {
26685
27161
  nan: "NaN",
26686
27162
  number: "\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",
26687
- string: "\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",
27163
+ string: "\u10D5\u10D4\u10DA\u10D8",
26688
27164
  boolean: "\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",
26689
27165
  function: "\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",
26690
27166
  array: "\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"
@@ -26722,14 +27198,14 @@ var error23 = () => {
26722
27198
  case "invalid_format": {
26723
27199
  const _issue = issue2;
26724
27200
  if (_issue.format === "starts_with") {
26725
- 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`;
27201
+ return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${_issue.prefix}"-\u10D8\u10D7`;
26726
27202
  }
26727
27203
  if (_issue.format === "ends_with")
26728
- return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${_issue.suffix}"-\u10D8\u10D7`;
27204
+ return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${_issue.suffix}"-\u10D8\u10D7`;
26729
27205
  if (_issue.format === "includes")
26730
- 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`;
27206
+ return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${_issue.includes}"-\u10E1`;
26731
27207
  if (_issue.format === "regex")
26732
- 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}`;
27208
+ return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\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}`;
26733
27209
  return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${FormatDictionary[_issue.format] ?? issue2.format}`;
26734
27210
  }
26735
27211
  case "not_multiple_of":
@@ -26749,12 +27225,12 @@ var error23 = () => {
26749
27225
  };
26750
27226
  function ka_default() {
26751
27227
  return {
26752
- localeError: error23()
27228
+ localeError: error25()
26753
27229
  };
26754
27230
  }
26755
27231
 
26756
27232
  // node_modules/zod/v4/locales/km.js
26757
- var error24 = () => {
27233
+ var error26 = () => {
26758
27234
  const Sizable = {
26759
27235
  string: { unit: "\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A", verb: "\u1782\u17BD\u179A\u1798\u17B6\u1793" },
26760
27236
  file: { unit: "\u1794\u17C3", verb: "\u1782\u17BD\u179A\u1798\u17B6\u1793" },
@@ -26860,7 +27336,7 @@ var error24 = () => {
26860
27336
  };
26861
27337
  function km_default() {
26862
27338
  return {
26863
- localeError: error24()
27339
+ localeError: error26()
26864
27340
  };
26865
27341
  }
26866
27342
 
@@ -26870,7 +27346,7 @@ function kh_default() {
26870
27346
  }
26871
27347
 
26872
27348
  // node_modules/zod/v4/locales/ko.js
26873
- var error25 = () => {
27349
+ var error27 = () => {
26874
27350
  const Sizable = {
26875
27351
  string: { unit: "\uBB38\uC790", verb: "to have" },
26876
27352
  file: { unit: "\uBC14\uC774\uD2B8", verb: "to have" },
@@ -26977,7 +27453,7 @@ var error25 = () => {
26977
27453
  };
26978
27454
  function ko_default() {
26979
27455
  return {
26980
- localeError: error25()
27456
+ localeError: error27()
26981
27457
  };
26982
27458
  }
26983
27459
 
@@ -26995,7 +27471,7 @@ function getUnitTypeFromNumber(number4) {
26995
27471
  return "one";
26996
27472
  return "few";
26997
27473
  }
26998
- var error26 = () => {
27474
+ var error28 = () => {
26999
27475
  const Sizable = {
27000
27476
  string: {
27001
27477
  unit: {
@@ -27181,12 +27657,12 @@ var error26 = () => {
27181
27657
  };
27182
27658
  function lt_default() {
27183
27659
  return {
27184
- localeError: error26()
27660
+ localeError: error28()
27185
27661
  };
27186
27662
  }
27187
27663
 
27188
27664
  // node_modules/zod/v4/locales/mk.js
27189
- var error27 = () => {
27665
+ var error29 = () => {
27190
27666
  const Sizable = {
27191
27667
  string: { unit: "\u0437\u043D\u0430\u0446\u0438", verb: "\u0434\u0430 \u0438\u043C\u0430\u0430\u0442" },
27192
27668
  file: { unit: "\u0431\u0430\u0458\u0442\u0438", verb: "\u0434\u0430 \u0438\u043C\u0430\u0430\u0442" },
@@ -27291,12 +27767,12 @@ var error27 = () => {
27291
27767
  };
27292
27768
  function mk_default() {
27293
27769
  return {
27294
- localeError: error27()
27770
+ localeError: error29()
27295
27771
  };
27296
27772
  }
27297
27773
 
27298
27774
  // node_modules/zod/v4/locales/ms.js
27299
- var error28 = () => {
27775
+ var error30 = () => {
27300
27776
  const Sizable = {
27301
27777
  string: { unit: "aksara", verb: "mempunyai" },
27302
27778
  file: { unit: "bait", verb: "mempunyai" },
@@ -27399,12 +27875,12 @@ var error28 = () => {
27399
27875
  };
27400
27876
  function ms_default() {
27401
27877
  return {
27402
- localeError: error28()
27878
+ localeError: error30()
27403
27879
  };
27404
27880
  }
27405
27881
 
27406
27882
  // node_modules/zod/v4/locales/nl.js
27407
- var error29 = () => {
27883
+ var error31 = () => {
27408
27884
  const Sizable = {
27409
27885
  string: { unit: "tekens", verb: "heeft" },
27410
27886
  file: { unit: "bytes", verb: "heeft" },
@@ -27510,12 +27986,12 @@ var error29 = () => {
27510
27986
  };
27511
27987
  function nl_default() {
27512
27988
  return {
27513
- localeError: error29()
27989
+ localeError: error31()
27514
27990
  };
27515
27991
  }
27516
27992
 
27517
27993
  // node_modules/zod/v4/locales/no.js
27518
- var error30 = () => {
27994
+ var error32 = () => {
27519
27995
  const Sizable = {
27520
27996
  string: { unit: "tegn", verb: "\xE5 ha" },
27521
27997
  file: { unit: "bytes", verb: "\xE5 ha" },
@@ -27619,12 +28095,12 @@ var error30 = () => {
27619
28095
  };
27620
28096
  function no_default() {
27621
28097
  return {
27622
- localeError: error30()
28098
+ localeError: error32()
27623
28099
  };
27624
28100
  }
27625
28101
 
27626
28102
  // node_modules/zod/v4/locales/ota.js
27627
- var error31 = () => {
28103
+ var error33 = () => {
27628
28104
  const Sizable = {
27629
28105
  string: { unit: "harf", verb: "olmal\u0131d\u0131r" },
27630
28106
  file: { unit: "bayt", verb: "olmal\u0131d\u0131r" },
@@ -27729,12 +28205,12 @@ var error31 = () => {
27729
28205
  };
27730
28206
  function ota_default() {
27731
28207
  return {
27732
- localeError: error31()
28208
+ localeError: error33()
27733
28209
  };
27734
28210
  }
27735
28211
 
27736
28212
  // node_modules/zod/v4/locales/ps.js
27737
- var error32 = () => {
28213
+ var error34 = () => {
27738
28214
  const Sizable = {
27739
28215
  string: { unit: "\u062A\u0648\u06A9\u064A", verb: "\u0648\u0644\u0631\u064A" },
27740
28216
  file: { unit: "\u0628\u0627\u06CC\u067C\u0633", verb: "\u0648\u0644\u0631\u064A" },
@@ -27844,12 +28320,12 @@ var error32 = () => {
27844
28320
  };
27845
28321
  function ps_default() {
27846
28322
  return {
27847
- localeError: error32()
28323
+ localeError: error34()
27848
28324
  };
27849
28325
  }
27850
28326
 
27851
28327
  // node_modules/zod/v4/locales/pl.js
27852
- var error33 = () => {
28328
+ var error35 = () => {
27853
28329
  const Sizable = {
27854
28330
  string: { unit: "znak\xF3w", verb: "mie\u0107" },
27855
28331
  file: { unit: "bajt\xF3w", verb: "mie\u0107" },
@@ -27954,12 +28430,12 @@ var error33 = () => {
27954
28430
  };
27955
28431
  function pl_default() {
27956
28432
  return {
27957
- localeError: error33()
28433
+ localeError: error35()
27958
28434
  };
27959
28435
  }
27960
28436
 
27961
28437
  // node_modules/zod/v4/locales/pt.js
27962
- var error34 = () => {
28438
+ var error36 = () => {
27963
28439
  const Sizable = {
27964
28440
  string: { unit: "caracteres", verb: "ter" },
27965
28441
  file: { unit: "bytes", verb: "ter" },
@@ -28063,7 +28539,127 @@ var error34 = () => {
28063
28539
  };
28064
28540
  function pt_default() {
28065
28541
  return {
28066
- localeError: error34()
28542
+ localeError: error36()
28543
+ };
28544
+ }
28545
+
28546
+ // node_modules/zod/v4/locales/ro.js
28547
+ var error37 = () => {
28548
+ const Sizable = {
28549
+ string: { unit: "caractere", verb: "s\u0103 aib\u0103" },
28550
+ file: { unit: "octe\u021Bi", verb: "s\u0103 aib\u0103" },
28551
+ array: { unit: "elemente", verb: "s\u0103 aib\u0103" },
28552
+ set: { unit: "elemente", verb: "s\u0103 aib\u0103" },
28553
+ map: { unit: "intr\u0103ri", verb: "s\u0103 aib\u0103" }
28554
+ };
28555
+ function getSizing(origin) {
28556
+ return Sizable[origin] ?? null;
28557
+ }
28558
+ const FormatDictionary = {
28559
+ regex: "intrare",
28560
+ email: "adres\u0103 de email",
28561
+ url: "URL",
28562
+ emoji: "emoji",
28563
+ uuid: "UUID",
28564
+ uuidv4: "UUIDv4",
28565
+ uuidv6: "UUIDv6",
28566
+ nanoid: "nanoid",
28567
+ guid: "GUID",
28568
+ cuid: "cuid",
28569
+ cuid2: "cuid2",
28570
+ ulid: "ULID",
28571
+ xid: "XID",
28572
+ ksuid: "KSUID",
28573
+ datetime: "dat\u0103 \u0219i or\u0103 ISO",
28574
+ date: "dat\u0103 ISO",
28575
+ time: "or\u0103 ISO",
28576
+ duration: "durat\u0103 ISO",
28577
+ ipv4: "adres\u0103 IPv4",
28578
+ ipv6: "adres\u0103 IPv6",
28579
+ mac: "adres\u0103 MAC",
28580
+ cidrv4: "interval IPv4",
28581
+ cidrv6: "interval IPv6",
28582
+ base64: "\u0219ir codat base64",
28583
+ base64url: "\u0219ir codat base64url",
28584
+ json_string: "\u0219ir JSON",
28585
+ e164: "num\u0103r E.164",
28586
+ jwt: "JWT",
28587
+ template_literal: "intrare"
28588
+ };
28589
+ const TypeDictionary = {
28590
+ nan: "NaN",
28591
+ string: "\u0219ir",
28592
+ number: "num\u0103r",
28593
+ boolean: "boolean",
28594
+ function: "func\u021Bie",
28595
+ array: "matrice",
28596
+ object: "obiect",
28597
+ undefined: "nedefinit",
28598
+ symbol: "simbol",
28599
+ bigint: "num\u0103r mare",
28600
+ void: "void",
28601
+ never: "never",
28602
+ map: "hart\u0103",
28603
+ set: "set"
28604
+ };
28605
+ return (issue2) => {
28606
+ switch (issue2.code) {
28607
+ case "invalid_type": {
28608
+ const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
28609
+ const receivedType = parsedType(issue2.input);
28610
+ const received = TypeDictionary[receivedType] ?? receivedType;
28611
+ return `Intrare invalid\u0103: a\u0219teptat ${expected}, primit ${received}`;
28612
+ }
28613
+ case "invalid_value":
28614
+ if (issue2.values.length === 1)
28615
+ return `Intrare invalid\u0103: a\u0219teptat ${stringifyPrimitive(issue2.values[0])}`;
28616
+ return `Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${joinValues(issue2.values, "|")}`;
28617
+ case "too_big": {
28618
+ const adj = issue2.inclusive ? "<=" : "<";
28619
+ const sizing = getSizing(issue2.origin);
28620
+ if (sizing)
28621
+ return `Prea mare: a\u0219teptat ca ${issue2.origin ?? "valoarea"} ${sizing.verb} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elemente"}`;
28622
+ return `Prea mare: a\u0219teptat ca ${issue2.origin ?? "valoarea"} s\u0103 fie ${adj}${issue2.maximum.toString()}`;
28623
+ }
28624
+ case "too_small": {
28625
+ const adj = issue2.inclusive ? ">=" : ">";
28626
+ const sizing = getSizing(issue2.origin);
28627
+ if (sizing) {
28628
+ return `Prea mic: a\u0219teptat ca ${issue2.origin} ${sizing.verb} ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
28629
+ }
28630
+ return `Prea mic: a\u0219teptat ca ${issue2.origin} s\u0103 fie ${adj}${issue2.minimum.toString()}`;
28631
+ }
28632
+ case "invalid_format": {
28633
+ const _issue = issue2;
28634
+ if (_issue.format === "starts_with") {
28635
+ return `\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${_issue.prefix}"`;
28636
+ }
28637
+ if (_issue.format === "ends_with")
28638
+ return `\u0218ir invalid: trebuie s\u0103 se termine cu "${_issue.suffix}"`;
28639
+ if (_issue.format === "includes")
28640
+ return `\u0218ir invalid: trebuie s\u0103 includ\u0103 "${_issue.includes}"`;
28641
+ if (_issue.format === "regex")
28642
+ return `\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${_issue.pattern}`;
28643
+ return `Format invalid: ${FormatDictionary[_issue.format] ?? issue2.format}`;
28644
+ }
28645
+ case "not_multiple_of":
28646
+ return `Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${issue2.divisor}`;
28647
+ case "unrecognized_keys":
28648
+ return `Chei nerecunoscute: ${joinValues(issue2.keys, ", ")}`;
28649
+ case "invalid_key":
28650
+ return `Cheie invalid\u0103 \xEEn ${issue2.origin}`;
28651
+ case "invalid_union":
28652
+ return "Intrare invalid\u0103";
28653
+ case "invalid_element":
28654
+ return `Valoare invalid\u0103 \xEEn ${issue2.origin}`;
28655
+ default:
28656
+ return `Intrare invalid\u0103`;
28657
+ }
28658
+ };
28659
+ };
28660
+ function ro_default() {
28661
+ return {
28662
+ localeError: error37()
28067
28663
  };
28068
28664
  }
28069
28665
 
@@ -28083,7 +28679,7 @@ function getRussianPlural(count, one, few, many) {
28083
28679
  }
28084
28680
  return many;
28085
28681
  }
28086
- var error35 = () => {
28682
+ var error38 = () => {
28087
28683
  const Sizable = {
28088
28684
  string: {
28089
28685
  unit: {
@@ -28220,12 +28816,12 @@ var error35 = () => {
28220
28816
  };
28221
28817
  function ru_default() {
28222
28818
  return {
28223
- localeError: error35()
28819
+ localeError: error38()
28224
28820
  };
28225
28821
  }
28226
28822
 
28227
28823
  // node_modules/zod/v4/locales/sl.js
28228
- var error36 = () => {
28824
+ var error39 = () => {
28229
28825
  const Sizable = {
28230
28826
  string: { unit: "znakov", verb: "imeti" },
28231
28827
  file: { unit: "bajtov", verb: "imeti" },
@@ -28330,12 +28926,12 @@ var error36 = () => {
28330
28926
  };
28331
28927
  function sl_default() {
28332
28928
  return {
28333
- localeError: error36()
28929
+ localeError: error39()
28334
28930
  };
28335
28931
  }
28336
28932
 
28337
28933
  // node_modules/zod/v4/locales/sv.js
28338
- var error37 = () => {
28934
+ var error40 = () => {
28339
28935
  const Sizable = {
28340
28936
  string: { unit: "tecken", verb: "att ha" },
28341
28937
  file: { unit: "bytes", verb: "att ha" },
@@ -28441,12 +29037,12 @@ var error37 = () => {
28441
29037
  };
28442
29038
  function sv_default() {
28443
29039
  return {
28444
- localeError: error37()
29040
+ localeError: error40()
28445
29041
  };
28446
29042
  }
28447
29043
 
28448
29044
  // node_modules/zod/v4/locales/ta.js
28449
- var error38 = () => {
29045
+ var error41 = () => {
28450
29046
  const Sizable = {
28451
29047
  string: { unit: "\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD", verb: "\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD" },
28452
29048
  file: { unit: "\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD", verb: "\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD" },
@@ -28552,12 +29148,12 @@ var error38 = () => {
28552
29148
  };
28553
29149
  function ta_default() {
28554
29150
  return {
28555
- localeError: error38()
29151
+ localeError: error41()
28556
29152
  };
28557
29153
  }
28558
29154
 
28559
29155
  // node_modules/zod/v4/locales/th.js
28560
- var error39 = () => {
29156
+ var error42 = () => {
28561
29157
  const Sizable = {
28562
29158
  string: { unit: "\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
28563
29159
  file: { unit: "\u0E44\u0E1A\u0E15\u0E4C", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
@@ -28663,12 +29259,12 @@ var error39 = () => {
28663
29259
  };
28664
29260
  function th_default() {
28665
29261
  return {
28666
- localeError: error39()
29262
+ localeError: error42()
28667
29263
  };
28668
29264
  }
28669
29265
 
28670
29266
  // node_modules/zod/v4/locales/tr.js
28671
- var error40 = () => {
29267
+ var error43 = () => {
28672
29268
  const Sizable = {
28673
29269
  string: { unit: "karakter", verb: "olmal\u0131" },
28674
29270
  file: { unit: "bayt", verb: "olmal\u0131" },
@@ -28769,12 +29365,12 @@ var error40 = () => {
28769
29365
  };
28770
29366
  function tr_default() {
28771
29367
  return {
28772
- localeError: error40()
29368
+ localeError: error43()
28773
29369
  };
28774
29370
  }
28775
29371
 
28776
29372
  // node_modules/zod/v4/locales/uk.js
28777
- var error41 = () => {
29373
+ var error44 = () => {
28778
29374
  const Sizable = {
28779
29375
  string: { unit: "\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
28780
29376
  file: { unit: "\u0431\u0430\u0439\u0442\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
@@ -28878,7 +29474,7 @@ var error41 = () => {
28878
29474
  };
28879
29475
  function uk_default() {
28880
29476
  return {
28881
- localeError: error41()
29477
+ localeError: error44()
28882
29478
  };
28883
29479
  }
28884
29480
 
@@ -28888,7 +29484,7 @@ function ua_default() {
28888
29484
  }
28889
29485
 
28890
29486
  // node_modules/zod/v4/locales/ur.js
28891
- var error42 = () => {
29487
+ var error45 = () => {
28892
29488
  const Sizable = {
28893
29489
  string: { unit: "\u062D\u0631\u0648\u0641", verb: "\u06C1\u0648\u0646\u0627" },
28894
29490
  file: { unit: "\u0628\u0627\u0626\u0679\u0633", verb: "\u06C1\u0648\u0646\u0627" },
@@ -28994,17 +29590,18 @@ var error42 = () => {
28994
29590
  };
28995
29591
  function ur_default() {
28996
29592
  return {
28997
- localeError: error42()
29593
+ localeError: error45()
28998
29594
  };
28999
29595
  }
29000
29596
 
29001
29597
  // node_modules/zod/v4/locales/uz.js
29002
- var error43 = () => {
29598
+ var error46 = () => {
29003
29599
  const Sizable = {
29004
29600
  string: { unit: "belgi", verb: "bo\u2018lishi kerak" },
29005
29601
  file: { unit: "bayt", verb: "bo\u2018lishi kerak" },
29006
29602
  array: { unit: "element", verb: "bo\u2018lishi kerak" },
29007
- set: { unit: "element", verb: "bo\u2018lishi kerak" }
29603
+ set: { unit: "element", verb: "bo\u2018lishi kerak" },
29604
+ map: { unit: "yozuv", verb: "bo\u2018lishi kerak" }
29008
29605
  };
29009
29606
  function getSizing(origin) {
29010
29607
  return Sizable[origin] ?? null;
@@ -29104,12 +29701,12 @@ var error43 = () => {
29104
29701
  };
29105
29702
  function uz_default() {
29106
29703
  return {
29107
- localeError: error43()
29704
+ localeError: error46()
29108
29705
  };
29109
29706
  }
29110
29707
 
29111
29708
  // node_modules/zod/v4/locales/vi.js
29112
- var error44 = () => {
29709
+ var error47 = () => {
29113
29710
  const Sizable = {
29114
29711
  string: { unit: "k\xFD t\u1EF1", verb: "c\xF3" },
29115
29712
  file: { unit: "byte", verb: "c\xF3" },
@@ -29213,12 +29810,12 @@ var error44 = () => {
29213
29810
  };
29214
29811
  function vi_default() {
29215
29812
  return {
29216
- localeError: error44()
29813
+ localeError: error47()
29217
29814
  };
29218
29815
  }
29219
29816
 
29220
29817
  // node_modules/zod/v4/locales/zh-CN.js
29221
- var error45 = () => {
29818
+ var error48 = () => {
29222
29819
  const Sizable = {
29223
29820
  string: { unit: "\u5B57\u7B26", verb: "\u5305\u542B" },
29224
29821
  file: { unit: "\u5B57\u8282", verb: "\u5305\u542B" },
@@ -29323,12 +29920,12 @@ var error45 = () => {
29323
29920
  };
29324
29921
  function zh_CN_default() {
29325
29922
  return {
29326
- localeError: error45()
29923
+ localeError: error48()
29327
29924
  };
29328
29925
  }
29329
29926
 
29330
29927
  // node_modules/zod/v4/locales/zh-TW.js
29331
- var error46 = () => {
29928
+ var error49 = () => {
29332
29929
  const Sizable = {
29333
29930
  string: { unit: "\u5B57\u5143", verb: "\u64C1\u6709" },
29334
29931
  file: { unit: "\u4F4D\u5143\u7D44", verb: "\u64C1\u6709" },
@@ -29431,12 +30028,12 @@ var error46 = () => {
29431
30028
  };
29432
30029
  function zh_TW_default() {
29433
30030
  return {
29434
- localeError: error46()
30031
+ localeError: error49()
29435
30032
  };
29436
30033
  }
29437
30034
 
29438
30035
  // node_modules/zod/v4/locales/yo.js
29439
- var error47 = () => {
30036
+ var error50 = () => {
29440
30037
  const Sizable = {
29441
30038
  string: { unit: "\xE0mi", verb: "n\xED" },
29442
30039
  file: { unit: "bytes", verb: "n\xED" },
@@ -29539,12 +30136,12 @@ var error47 = () => {
29539
30136
  };
29540
30137
  function yo_default() {
29541
30138
  return {
29542
- localeError: error47()
30139
+ localeError: error50()
29543
30140
  };
29544
30141
  }
29545
30142
 
29546
30143
  // node_modules/zod/v4/core/registries.js
29547
- var _a;
30144
+ var _a2;
29548
30145
  var $output = /* @__PURE__ */ Symbol("ZodOutput");
29549
30146
  var $input = /* @__PURE__ */ Symbol("ZodInput");
29550
30147
  var $ZodRegistry = class {
@@ -29590,7 +30187,7 @@ var $ZodRegistry = class {
29590
30187
  function registry() {
29591
30188
  return new $ZodRegistry();
29592
30189
  }
29593
- (_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
30190
+ (_a2 = globalThis).__zod_globalRegistry ?? (_a2.__zod_globalRegistry = registry());
29594
30191
  var globalRegistry = globalThis.__zod_globalRegistry;
29595
30192
 
29596
30193
  // node_modules/zod/v4/core/api.js
@@ -30508,7 +31105,7 @@ function _refine(Class2, fn, _params) {
30508
31105
  return schema;
30509
31106
  }
30510
31107
  // @__NO_SIDE_EFFECTS__
30511
- function _superRefine(fn) {
31108
+ function _superRefine(fn, params) {
30512
31109
  const ch = /* @__PURE__ */ _check((payload) => {
30513
31110
  payload.addIssue = (issue2) => {
30514
31111
  if (typeof issue2 === "string") {
@@ -30525,7 +31122,7 @@ function _superRefine(fn) {
30525
31122
  }
30526
31123
  };
30527
31124
  return fn(payload.value, payload);
30528
- });
31125
+ }, params);
30529
31126
  return ch;
30530
31127
  }
30531
31128
  // @__NO_SIDE_EFFECTS__
@@ -30655,7 +31252,7 @@ function initializeContext(params) {
30655
31252
  };
30656
31253
  }
30657
31254
  function process2(schema, ctx2, _params = { path: [], schemaPath: [] }) {
30658
- var _a2;
31255
+ var _a3;
30659
31256
  const def = schema._zod.def;
30660
31257
  const seen = ctx2.seen.get(schema);
30661
31258
  if (seen) {
@@ -30702,8 +31299,8 @@ function process2(schema, ctx2, _params = { path: [], schemaPath: [] }) {
30702
31299
  delete result.schema.examples;
30703
31300
  delete result.schema.default;
30704
31301
  }
30705
- if (ctx2.io === "input" && result.schema._prefault)
30706
- (_a2 = result.schema).default ?? (_a2.default = result.schema._prefault);
31302
+ if (ctx2.io === "input" && "_prefault" in result.schema)
31303
+ (_a3 = result.schema).default ?? (_a3.default = result.schema._prefault);
30707
31304
  delete result.schema._prefault;
30708
31305
  const _result = ctx2.seen.get(schema);
30709
31306
  return _result.schema;
@@ -30884,10 +31481,15 @@ function finalize(ctx2, schema) {
30884
31481
  result.$id = ctx2.external.uri(id);
30885
31482
  }
30886
31483
  Object.assign(result, root.def ?? root.schema);
31484
+ const rootMetaId = ctx2.metadataRegistry.get(schema)?.id;
31485
+ if (rootMetaId !== void 0 && result.id === rootMetaId)
31486
+ delete result.id;
30887
31487
  const defs = ctx2.external?.defs ?? {};
30888
31488
  for (const entry of ctx2.seen.entries()) {
30889
31489
  const seen = entry[1];
30890
31490
  if (seen.def && seen.defId) {
31491
+ if (seen.def.id === seen.defId)
31492
+ delete seen.def.id;
30891
31493
  defs[seen.defId] = seen.def;
30892
31494
  }
30893
31495
  }
@@ -30943,6 +31545,8 @@ function isTransforming(_schema, _ctx2) {
30943
31545
  return isTransforming(def.keyType, ctx2) || isTransforming(def.valueType, ctx2);
30944
31546
  }
30945
31547
  if (def.type === "pipe") {
31548
+ if (_schema._zod.traits.has("$ZodCodec"))
31549
+ return true;
30946
31550
  return isTransforming(def.in, ctx2) || isTransforming(def.out, ctx2);
30947
31551
  }
30948
31552
  if (def.type === "object") {
@@ -31032,39 +31636,28 @@ var numberProcessor = (schema, ctx2, _json, _params) => {
31032
31636
  json2.type = "integer";
31033
31637
  else
31034
31638
  json2.type = "number";
31035
- if (typeof exclusiveMinimum === "number") {
31036
- if (ctx2.target === "draft-04" || ctx2.target === "openapi-3.0") {
31639
+ const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
31640
+ const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
31641
+ const legacy = ctx2.target === "draft-04" || ctx2.target === "openapi-3.0";
31642
+ if (exMin) {
31643
+ if (legacy) {
31037
31644
  json2.minimum = exclusiveMinimum;
31038
31645
  json2.exclusiveMinimum = true;
31039
31646
  } else {
31040
31647
  json2.exclusiveMinimum = exclusiveMinimum;
31041
31648
  }
31042
- }
31043
- if (typeof minimum === "number") {
31649
+ } else if (typeof minimum === "number") {
31044
31650
  json2.minimum = minimum;
31045
- if (typeof exclusiveMinimum === "number" && ctx2.target !== "draft-04") {
31046
- if (exclusiveMinimum >= minimum)
31047
- delete json2.minimum;
31048
- else
31049
- delete json2.exclusiveMinimum;
31050
- }
31051
31651
  }
31052
- if (typeof exclusiveMaximum === "number") {
31053
- if (ctx2.target === "draft-04" || ctx2.target === "openapi-3.0") {
31652
+ if (exMax) {
31653
+ if (legacy) {
31054
31654
  json2.maximum = exclusiveMaximum;
31055
31655
  json2.exclusiveMaximum = true;
31056
31656
  } else {
31057
31657
  json2.exclusiveMaximum = exclusiveMaximum;
31058
31658
  }
31059
- }
31060
- if (typeof maximum === "number") {
31659
+ } else if (typeof maximum === "number") {
31061
31660
  json2.maximum = maximum;
31062
- if (typeof exclusiveMaximum === "number" && ctx2.target !== "draft-04") {
31063
- if (exclusiveMaximum <= maximum)
31064
- delete json2.maximum;
31065
- else
31066
- delete json2.exclusiveMaximum;
31067
- }
31068
31661
  }
31069
31662
  if (typeof multipleOf === "number")
31070
31663
  json2.multipleOf = multipleOf;
@@ -31236,7 +31829,10 @@ var arrayProcessor = (schema, ctx2, _json, params) => {
31236
31829
  if (typeof maximum === "number")
31237
31830
  json2.maxItems = maximum;
31238
31831
  json2.type = "array";
31239
- json2.items = process2(def.element, ctx2, { ...params, path: [...params.path, "items"] });
31832
+ json2.items = process2(def.element, ctx2, {
31833
+ ...params,
31834
+ path: [...params.path, "items"]
31835
+ });
31240
31836
  };
31241
31837
  var objectProcessor = (schema, ctx2, _json, params) => {
31242
31838
  const json2 = _json;
@@ -31429,7 +32025,8 @@ var catchProcessor = (schema, ctx2, json2, params) => {
31429
32025
  };
31430
32026
  var pipeProcessor = (schema, ctx2, _json, params) => {
31431
32027
  const def = schema._zod.def;
31432
- const innerType = ctx2.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
32028
+ const inIsTransform = def.in._zod.traits.has("$ZodTransform");
32029
+ const innerType = ctx2.io === "input" ? inIsTransform ? def.out : def.in : def.out;
31433
32030
  process2(innerType, ctx2, params);
31434
32031
  const seen = ctx2.seen.get(schema);
31435
32032
  seen.ref = innerType;
@@ -31663,6 +32260,7 @@ __export(schemas_exports2, {
31663
32260
  ZodOptional: () => ZodOptional,
31664
32261
  ZodPipe: () => ZodPipe,
31665
32262
  ZodPrefault: () => ZodPrefault,
32263
+ ZodPreprocess: () => ZodPreprocess,
31666
32264
  ZodPromise: () => ZodPromise,
31667
32265
  ZodReadonly: () => ZodReadonly,
31668
32266
  ZodRecord: () => ZodRecord,
@@ -31723,6 +32321,7 @@ __export(schemas_exports2, {
31723
32321
  int32: () => int32,
31724
32322
  int64: () => int64,
31725
32323
  intersection: () => intersection,
32324
+ invertCodec: () => invertCodec,
31726
32325
  ipv4: () => ipv42,
31727
32326
  ipv6: () => ipv62,
31728
32327
  json: () => json,
@@ -31892,8 +32491,8 @@ var initializer2 = (inst, issues) => {
31892
32491
  }
31893
32492
  });
31894
32493
  };
31895
- var ZodError = $constructor("ZodError", initializer2);
31896
- var ZodRealError = $constructor("ZodError", initializer2, {
32494
+ var ZodError = /* @__PURE__ */ $constructor("ZodError", initializer2);
32495
+ var ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer2, {
31897
32496
  Parent: Error
31898
32497
  });
31899
32498
 
@@ -31912,6 +32511,43 @@ var safeEncodeAsync2 = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
31912
32511
  var safeDecodeAsync2 = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
31913
32512
 
31914
32513
  // node_modules/zod/v4/classic/schemas.js
32514
+ var _installedGroups = /* @__PURE__ */ new WeakMap();
32515
+ function _installLazyMethods(inst, group, methods) {
32516
+ const proto = Object.getPrototypeOf(inst);
32517
+ let installed = _installedGroups.get(proto);
32518
+ if (!installed) {
32519
+ installed = /* @__PURE__ */ new Set();
32520
+ _installedGroups.set(proto, installed);
32521
+ }
32522
+ if (installed.has(group))
32523
+ return;
32524
+ installed.add(group);
32525
+ for (const key in methods) {
32526
+ const fn = methods[key];
32527
+ Object.defineProperty(proto, key, {
32528
+ configurable: true,
32529
+ enumerable: false,
32530
+ get() {
32531
+ const bound = fn.bind(this);
32532
+ Object.defineProperty(this, key, {
32533
+ configurable: true,
32534
+ writable: true,
32535
+ enumerable: true,
32536
+ value: bound
32537
+ });
32538
+ return bound;
32539
+ },
32540
+ set(v2) {
32541
+ Object.defineProperty(this, key, {
32542
+ configurable: true,
32543
+ writable: true,
32544
+ enumerable: true,
32545
+ value: v2
32546
+ });
32547
+ }
32548
+ });
32549
+ }
32550
+ }
31915
32551
  var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
31916
32552
  $ZodType.init(inst, def);
31917
32553
  Object.assign(inst["~standard"], {
@@ -31924,23 +32560,6 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
31924
32560
  inst.def = def;
31925
32561
  inst.type = def.type;
31926
32562
  Object.defineProperty(inst, "_def", { value: def });
31927
- inst.check = (...checks) => {
31928
- return inst.clone(util_exports.mergeDefs(def, {
31929
- checks: [
31930
- ...def.checks ?? [],
31931
- ...checks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
31932
- ]
31933
- }), {
31934
- parent: true
31935
- });
31936
- };
31937
- inst.with = inst.check;
31938
- inst.clone = (def2, params) => clone(inst, def2, params);
31939
- inst.brand = () => inst;
31940
- inst.register = ((reg, meta3) => {
31941
- reg.add(inst, meta3);
31942
- return inst;
31943
- });
31944
32563
  inst.parse = (data, params) => parse2(inst, data, params, { callee: inst.parse });
31945
32564
  inst.safeParse = (data, params) => safeParse2(inst, data, params);
31946
32565
  inst.parseAsync = async (data, params) => parseAsync2(inst, data, params, { callee: inst.parseAsync });
@@ -31954,45 +32573,108 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
31954
32573
  inst.safeDecode = (data, params) => safeDecode2(inst, data, params);
31955
32574
  inst.safeEncodeAsync = async (data, params) => safeEncodeAsync2(inst, data, params);
31956
32575
  inst.safeDecodeAsync = async (data, params) => safeDecodeAsync2(inst, data, params);
31957
- inst.refine = (check2, params) => inst.check(refine(check2, params));
31958
- inst.superRefine = (refinement) => inst.check(superRefine(refinement));
31959
- inst.overwrite = (fn) => inst.check(_overwrite(fn));
31960
- inst.optional = () => optional(inst);
31961
- inst.exactOptional = () => exactOptional(inst);
31962
- inst.nullable = () => nullable(inst);
31963
- inst.nullish = () => optional(nullable(inst));
31964
- inst.nonoptional = (params) => nonoptional(inst, params);
31965
- inst.array = () => array(inst);
31966
- inst.or = (arg) => union([inst, arg]);
31967
- inst.and = (arg) => intersection(inst, arg);
31968
- inst.transform = (tx2) => pipe(inst, transform(tx2));
31969
- inst.default = (def2) => _default2(inst, def2);
31970
- inst.prefault = (def2) => prefault(inst, def2);
31971
- inst.catch = (params) => _catch2(inst, params);
31972
- inst.pipe = (target) => pipe(inst, target);
31973
- inst.readonly = () => readonly(inst);
31974
- inst.describe = (description) => {
31975
- const cl = inst.clone();
31976
- globalRegistry.add(cl, { description });
31977
- return cl;
31978
- };
32576
+ _installLazyMethods(inst, "ZodType", {
32577
+ check(...chks) {
32578
+ const def2 = this.def;
32579
+ return this.clone(util_exports.mergeDefs(def2, {
32580
+ checks: [
32581
+ ...def2.checks ?? [],
32582
+ ...chks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
32583
+ ]
32584
+ }), { parent: true });
32585
+ },
32586
+ with(...chks) {
32587
+ return this.check(...chks);
32588
+ },
32589
+ clone(def2, params) {
32590
+ return clone(this, def2, params);
32591
+ },
32592
+ brand() {
32593
+ return this;
32594
+ },
32595
+ register(reg, meta3) {
32596
+ reg.add(this, meta3);
32597
+ return this;
32598
+ },
32599
+ refine(check2, params) {
32600
+ return this.check(refine(check2, params));
32601
+ },
32602
+ superRefine(refinement, params) {
32603
+ return this.check(superRefine(refinement, params));
32604
+ },
32605
+ overwrite(fn) {
32606
+ return this.check(_overwrite(fn));
32607
+ },
32608
+ optional() {
32609
+ return optional(this);
32610
+ },
32611
+ exactOptional() {
32612
+ return exactOptional(this);
32613
+ },
32614
+ nullable() {
32615
+ return nullable(this);
32616
+ },
32617
+ nullish() {
32618
+ return optional(nullable(this));
32619
+ },
32620
+ nonoptional(params) {
32621
+ return nonoptional(this, params);
32622
+ },
32623
+ array() {
32624
+ return array(this);
32625
+ },
32626
+ or(arg) {
32627
+ return union([this, arg]);
32628
+ },
32629
+ and(arg) {
32630
+ return intersection(this, arg);
32631
+ },
32632
+ transform(tx2) {
32633
+ return pipe(this, transform(tx2));
32634
+ },
32635
+ default(d2) {
32636
+ return _default2(this, d2);
32637
+ },
32638
+ prefault(d2) {
32639
+ return prefault(this, d2);
32640
+ },
32641
+ catch(params) {
32642
+ return _catch2(this, params);
32643
+ },
32644
+ pipe(target) {
32645
+ return pipe(this, target);
32646
+ },
32647
+ readonly() {
32648
+ return readonly(this);
32649
+ },
32650
+ describe(description) {
32651
+ const cl = this.clone();
32652
+ globalRegistry.add(cl, { description });
32653
+ return cl;
32654
+ },
32655
+ meta(...args) {
32656
+ if (args.length === 0)
32657
+ return globalRegistry.get(this);
32658
+ const cl = this.clone();
32659
+ globalRegistry.add(cl, args[0]);
32660
+ return cl;
32661
+ },
32662
+ isOptional() {
32663
+ return this.safeParse(void 0).success;
32664
+ },
32665
+ isNullable() {
32666
+ return this.safeParse(null).success;
32667
+ },
32668
+ apply(fn) {
32669
+ return fn(this);
32670
+ }
32671
+ });
31979
32672
  Object.defineProperty(inst, "description", {
31980
32673
  get() {
31981
32674
  return globalRegistry.get(inst)?.description;
31982
32675
  },
31983
32676
  configurable: true
31984
32677
  });
31985
- inst.meta = (...args) => {
31986
- if (args.length === 0) {
31987
- return globalRegistry.get(inst);
31988
- }
31989
- const cl = inst.clone();
31990
- globalRegistry.add(cl, args[0]);
31991
- return cl;
31992
- };
31993
- inst.isOptional = () => inst.safeParse(void 0).success;
31994
- inst.isNullable = () => inst.safeParse(null).success;
31995
- inst.apply = (fn) => fn(inst);
31996
32678
  return inst;
31997
32679
  });
31998
32680
  var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
@@ -32003,21 +32685,53 @@ var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
32003
32685
  inst.format = bag.format ?? null;
32004
32686
  inst.minLength = bag.minimum ?? null;
32005
32687
  inst.maxLength = bag.maximum ?? null;
32006
- inst.regex = (...args) => inst.check(_regex(...args));
32007
- inst.includes = (...args) => inst.check(_includes(...args));
32008
- inst.startsWith = (...args) => inst.check(_startsWith(...args));
32009
- inst.endsWith = (...args) => inst.check(_endsWith(...args));
32010
- inst.min = (...args) => inst.check(_minLength(...args));
32011
- inst.max = (...args) => inst.check(_maxLength(...args));
32012
- inst.length = (...args) => inst.check(_length(...args));
32013
- inst.nonempty = (...args) => inst.check(_minLength(1, ...args));
32014
- inst.lowercase = (params) => inst.check(_lowercase(params));
32015
- inst.uppercase = (params) => inst.check(_uppercase(params));
32016
- inst.trim = () => inst.check(_trim());
32017
- inst.normalize = (...args) => inst.check(_normalize(...args));
32018
- inst.toLowerCase = () => inst.check(_toLowerCase());
32019
- inst.toUpperCase = () => inst.check(_toUpperCase());
32020
- inst.slugify = () => inst.check(_slugify());
32688
+ _installLazyMethods(inst, "_ZodString", {
32689
+ regex(...args) {
32690
+ return this.check(_regex(...args));
32691
+ },
32692
+ includes(...args) {
32693
+ return this.check(_includes(...args));
32694
+ },
32695
+ startsWith(...args) {
32696
+ return this.check(_startsWith(...args));
32697
+ },
32698
+ endsWith(...args) {
32699
+ return this.check(_endsWith(...args));
32700
+ },
32701
+ min(...args) {
32702
+ return this.check(_minLength(...args));
32703
+ },
32704
+ max(...args) {
32705
+ return this.check(_maxLength(...args));
32706
+ },
32707
+ length(...args) {
32708
+ return this.check(_length(...args));
32709
+ },
32710
+ nonempty(...args) {
32711
+ return this.check(_minLength(1, ...args));
32712
+ },
32713
+ lowercase(params) {
32714
+ return this.check(_lowercase(params));
32715
+ },
32716
+ uppercase(params) {
32717
+ return this.check(_uppercase(params));
32718
+ },
32719
+ trim() {
32720
+ return this.check(_trim());
32721
+ },
32722
+ normalize(...args) {
32723
+ return this.check(_normalize(...args));
32724
+ },
32725
+ toLowerCase() {
32726
+ return this.check(_toLowerCase());
32727
+ },
32728
+ toUpperCase() {
32729
+ return this.check(_toUpperCase());
32730
+ },
32731
+ slugify() {
32732
+ return this.check(_slugify());
32733
+ }
32734
+ });
32021
32735
  });
32022
32736
  var ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
32023
32737
  $ZodString.init(inst, def);
@@ -32096,7 +32810,7 @@ function url(params) {
32096
32810
  }
32097
32811
  function httpUrl(params) {
32098
32812
  return _url(ZodURL, {
32099
- protocol: /^https?$/,
32813
+ protocol: regexes_exports.httpProtocol,
32100
32814
  hostname: regexes_exports.domain,
32101
32815
  ...util_exports.normalizeParams(params)
32102
32816
  });
@@ -32238,21 +32952,53 @@ var ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
32238
32952
  $ZodNumber.init(inst, def);
32239
32953
  ZodType.init(inst, def);
32240
32954
  inst._zod.processJSONSchema = (ctx2, json2, params) => numberProcessor(inst, ctx2, json2, params);
32241
- inst.gt = (value, params) => inst.check(_gt(value, params));
32242
- inst.gte = (value, params) => inst.check(_gte(value, params));
32243
- inst.min = (value, params) => inst.check(_gte(value, params));
32244
- inst.lt = (value, params) => inst.check(_lt(value, params));
32245
- inst.lte = (value, params) => inst.check(_lte(value, params));
32246
- inst.max = (value, params) => inst.check(_lte(value, params));
32247
- inst.int = (params) => inst.check(int(params));
32248
- inst.safe = (params) => inst.check(int(params));
32249
- inst.positive = (params) => inst.check(_gt(0, params));
32250
- inst.nonnegative = (params) => inst.check(_gte(0, params));
32251
- inst.negative = (params) => inst.check(_lt(0, params));
32252
- inst.nonpositive = (params) => inst.check(_lte(0, params));
32253
- inst.multipleOf = (value, params) => inst.check(_multipleOf(value, params));
32254
- inst.step = (value, params) => inst.check(_multipleOf(value, params));
32255
- inst.finite = () => inst;
32955
+ _installLazyMethods(inst, "ZodNumber", {
32956
+ gt(value, params) {
32957
+ return this.check(_gt(value, params));
32958
+ },
32959
+ gte(value, params) {
32960
+ return this.check(_gte(value, params));
32961
+ },
32962
+ min(value, params) {
32963
+ return this.check(_gte(value, params));
32964
+ },
32965
+ lt(value, params) {
32966
+ return this.check(_lt(value, params));
32967
+ },
32968
+ lte(value, params) {
32969
+ return this.check(_lte(value, params));
32970
+ },
32971
+ max(value, params) {
32972
+ return this.check(_lte(value, params));
32973
+ },
32974
+ int(params) {
32975
+ return this.check(int(params));
32976
+ },
32977
+ safe(params) {
32978
+ return this.check(int(params));
32979
+ },
32980
+ positive(params) {
32981
+ return this.check(_gt(0, params));
32982
+ },
32983
+ nonnegative(params) {
32984
+ return this.check(_gte(0, params));
32985
+ },
32986
+ negative(params) {
32987
+ return this.check(_lt(0, params));
32988
+ },
32989
+ nonpositive(params) {
32990
+ return this.check(_lte(0, params));
32991
+ },
32992
+ multipleOf(value, params) {
32993
+ return this.check(_multipleOf(value, params));
32994
+ },
32995
+ step(value, params) {
32996
+ return this.check(_multipleOf(value, params));
32997
+ },
32998
+ finite() {
32999
+ return this;
33000
+ }
33001
+ });
32256
33002
  const bag = inst._zod.bag;
32257
33003
  inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
32258
33004
  inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
@@ -32399,11 +33145,23 @@ var ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
32399
33145
  ZodType.init(inst, def);
32400
33146
  inst._zod.processJSONSchema = (ctx2, json2, params) => arrayProcessor(inst, ctx2, json2, params);
32401
33147
  inst.element = def.element;
32402
- inst.min = (minLength, params) => inst.check(_minLength(minLength, params));
32403
- inst.nonempty = (params) => inst.check(_minLength(1, params));
32404
- inst.max = (maxLength, params) => inst.check(_maxLength(maxLength, params));
32405
- inst.length = (len, params) => inst.check(_length(len, params));
32406
- inst.unwrap = () => inst.element;
33148
+ _installLazyMethods(inst, "ZodArray", {
33149
+ min(n, params) {
33150
+ return this.check(_minLength(n, params));
33151
+ },
33152
+ nonempty(params) {
33153
+ return this.check(_minLength(1, params));
33154
+ },
33155
+ max(n, params) {
33156
+ return this.check(_maxLength(n, params));
33157
+ },
33158
+ length(n, params) {
33159
+ return this.check(_length(n, params));
33160
+ },
33161
+ unwrap() {
33162
+ return this.element;
33163
+ }
33164
+ });
32407
33165
  });
32408
33166
  function array(element, params) {
32409
33167
  return _array(ZodArray, element, params);
@@ -32419,23 +33177,47 @@ var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
32419
33177
  util_exports.defineLazy(inst, "shape", () => {
32420
33178
  return def.shape;
32421
33179
  });
32422
- inst.keyof = () => _enum2(Object.keys(inst._zod.def.shape));
32423
- inst.catchall = (catchall) => inst.clone({ ...inst._zod.def, catchall });
32424
- inst.passthrough = () => inst.clone({ ...inst._zod.def, catchall: unknown() });
32425
- inst.loose = () => inst.clone({ ...inst._zod.def, catchall: unknown() });
32426
- inst.strict = () => inst.clone({ ...inst._zod.def, catchall: never() });
32427
- inst.strip = () => inst.clone({ ...inst._zod.def, catchall: void 0 });
32428
- inst.extend = (incoming) => {
32429
- return util_exports.extend(inst, incoming);
32430
- };
32431
- inst.safeExtend = (incoming) => {
32432
- return util_exports.safeExtend(inst, incoming);
32433
- };
32434
- inst.merge = (other) => util_exports.merge(inst, other);
32435
- inst.pick = (mask) => util_exports.pick(inst, mask);
32436
- inst.omit = (mask) => util_exports.omit(inst, mask);
32437
- inst.partial = (...args) => util_exports.partial(ZodOptional, inst, args[0]);
32438
- inst.required = (...args) => util_exports.required(ZodNonOptional, inst, args[0]);
33180
+ _installLazyMethods(inst, "ZodObject", {
33181
+ keyof() {
33182
+ return _enum2(Object.keys(this._zod.def.shape));
33183
+ },
33184
+ catchall(catchall) {
33185
+ return this.clone({ ...this._zod.def, catchall });
33186
+ },
33187
+ passthrough() {
33188
+ return this.clone({ ...this._zod.def, catchall: unknown() });
33189
+ },
33190
+ loose() {
33191
+ return this.clone({ ...this._zod.def, catchall: unknown() });
33192
+ },
33193
+ strict() {
33194
+ return this.clone({ ...this._zod.def, catchall: never() });
33195
+ },
33196
+ strip() {
33197
+ return this.clone({ ...this._zod.def, catchall: void 0 });
33198
+ },
33199
+ extend(incoming) {
33200
+ return util_exports.extend(this, incoming);
33201
+ },
33202
+ safeExtend(incoming) {
33203
+ return util_exports.safeExtend(this, incoming);
33204
+ },
33205
+ merge(other) {
33206
+ return util_exports.merge(this, other);
33207
+ },
33208
+ pick(mask) {
33209
+ return util_exports.pick(this, mask);
33210
+ },
33211
+ omit(mask) {
33212
+ return util_exports.omit(this, mask);
33213
+ },
33214
+ partial(...args) {
33215
+ return util_exports.partial(ZodOptional, this, args[0]);
33216
+ },
33217
+ required(...args) {
33218
+ return util_exports.required(ZodNonOptional, this, args[0]);
33219
+ }
33220
+ });
32439
33221
  });
32440
33222
  function object(shape, params) {
32441
33223
  const def = {
@@ -32540,6 +33322,14 @@ var ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
32540
33322
  inst.valueType = def.valueType;
32541
33323
  });
32542
33324
  function record(keyType, valueType, params) {
33325
+ if (!valueType || !valueType._zod) {
33326
+ return new ZodRecord({
33327
+ type: "record",
33328
+ keyType: string2(),
33329
+ valueType: keyType,
33330
+ ...util_exports.normalizeParams(valueType)
33331
+ });
33332
+ }
32543
33333
  return new ZodRecord({
32544
33334
  type: "record",
32545
33335
  keyType,
@@ -32711,10 +33501,12 @@ var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
32711
33501
  if (output instanceof Promise) {
32712
33502
  return output.then((output2) => {
32713
33503
  payload.value = output2;
33504
+ payload.fallback = true;
32714
33505
  return payload;
32715
33506
  });
32716
33507
  }
32717
33508
  payload.value = output;
33509
+ payload.fallback = true;
32718
33510
  return payload;
32719
33511
  };
32720
33512
  });
@@ -32869,6 +33661,20 @@ function codec(in_, out, params) {
32869
33661
  reverseTransform: params.encode
32870
33662
  });
32871
33663
  }
33664
+ function invertCodec(codec2) {
33665
+ const def = codec2._zod.def;
33666
+ return new ZodCodec({
33667
+ type: "pipe",
33668
+ in: def.out,
33669
+ out: def.in,
33670
+ transform: def.reverseTransform,
33671
+ reverseTransform: def.transform
33672
+ });
33673
+ }
33674
+ var ZodPreprocess = /* @__PURE__ */ $constructor("ZodPreprocess", (inst, def) => {
33675
+ ZodPipe.init(inst, def);
33676
+ $ZodPreprocess.init(inst, def);
33677
+ });
32872
33678
  var ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
32873
33679
  $ZodReadonly.init(inst, def);
32874
33680
  ZodType.init(inst, def);
@@ -32948,8 +33754,8 @@ function custom(fn, _params) {
32948
33754
  function refine(fn, _params = {}) {
32949
33755
  return _refine(ZodCustom, fn, _params);
32950
33756
  }
32951
- function superRefine(fn) {
32952
- return _superRefine(fn);
33757
+ function superRefine(fn, params) {
33758
+ return _superRefine(fn, params);
32953
33759
  }
32954
33760
  var describe2 = describe;
32955
33761
  var meta2 = meta;
@@ -32987,7 +33793,11 @@ function json(params) {
32987
33793
  return jsonSchema;
32988
33794
  }
32989
33795
  function preprocess(fn, schema) {
32990
- return pipe(transform(fn), schema);
33796
+ return new ZodPreprocess({
33797
+ type: "pipe",
33798
+ in: transform(fn),
33799
+ out: schema
33800
+ });
32991
33801
  }
32992
33802
 
32993
33803
  // node_modules/zod/v4/classic/compat.js
@@ -33408,12 +34218,6 @@ function convertBaseSchema(schema, ctx2) {
33408
34218
  default:
33409
34219
  throw new Error(`Unsupported type: ${type}`);
33410
34220
  }
33411
- if (schema.description) {
33412
- zodSchema = zodSchema.describe(schema.description);
33413
- }
33414
- if (schema.default !== void 0) {
33415
- zodSchema = zodSchema.default(schema.default);
33416
- }
33417
34221
  return zodSchema;
33418
34222
  }
33419
34223
  function convertSchema(schema, ctx2) {
@@ -33450,6 +34254,9 @@ function convertSchema(schema, ctx2) {
33450
34254
  if (schema.readOnly === true) {
33451
34255
  baseSchema = z.readonly(baseSchema);
33452
34256
  }
34257
+ if (schema.default !== void 0) {
34258
+ baseSchema = baseSchema.default(schema.default);
34259
+ }
33453
34260
  const extraMeta = {};
33454
34261
  const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
33455
34262
  for (const key of coreMetadataKeys) {
@@ -33471,23 +34278,32 @@ function convertSchema(schema, ctx2) {
33471
34278
  if (Object.keys(extraMeta).length > 0) {
33472
34279
  ctx2.registry.add(baseSchema, extraMeta);
33473
34280
  }
34281
+ if (schema.description) {
34282
+ baseSchema = baseSchema.describe(schema.description);
34283
+ }
33474
34284
  return baseSchema;
33475
34285
  }
33476
34286
  function fromJSONSchema(schema, params) {
33477
34287
  if (typeof schema === "boolean") {
33478
34288
  return schema ? z.any() : z.never();
33479
34289
  }
33480
- const version2 = detectVersion(schema, params?.defaultTarget);
33481
- const defs = schema.$defs || schema.definitions || {};
34290
+ let normalized;
34291
+ try {
34292
+ normalized = JSON.parse(JSON.stringify(schema));
34293
+ } catch {
34294
+ throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas");
34295
+ }
34296
+ const version2 = detectVersion(normalized, params?.defaultTarget);
34297
+ const defs = normalized.$defs || normalized.definitions || {};
33482
34298
  const ctx2 = {
33483
34299
  version: version2,
33484
34300
  defs,
33485
34301
  refs: /* @__PURE__ */ new Map(),
33486
34302
  processing: /* @__PURE__ */ new Set(),
33487
- rootSchema: schema,
34303
+ rootSchema: normalized,
33488
34304
  registry: params?.registry ?? globalRegistry
33489
34305
  };
33490
- return convertSchema(schema, ctx2);
34306
+ return convertSchema(normalized, ctx2);
33491
34307
  }
33492
34308
 
33493
34309
  // node_modules/zod/v4/classic/coerce.js
@@ -33521,7 +34337,7 @@ config(en_default());
33521
34337
  // src/typebox-to-zod.ts
33522
34338
  function jsonSchemaPropertyToZod(prop) {
33523
34339
  let base;
33524
- if (Array.isArray(prop.enum)) base = external_exports.enum(prop.enum);
34340
+ if (Array.isArray(prop.enum) && prop.enum.length > 0) base = external_exports.enum(prop.enum);
33525
34341
  else switch (prop.type) {
33526
34342
  case "string":
33527
34343
  base = external_exports.string();
@@ -33533,12 +34349,22 @@ function jsonSchemaPropertyToZod(prop) {
33533
34349
  case "boolean":
33534
34350
  base = external_exports.boolean();
33535
34351
  break;
33536
- case "array":
34352
+ case "array": {
33537
34353
  base = prop.items ? external_exports.array(jsonSchemaPropertyToZod(prop.items)) : external_exports.array(external_exports.unknown());
34354
+ const minItems = typeof prop.minItems === "number" ? prop.minItems : void 0;
34355
+ if (minItems !== void 0) base = base.min(minItems);
33538
34356
  break;
33539
- case "object":
33540
- base = external_exports.record(external_exports.string(), external_exports.unknown());
34357
+ }
34358
+ case "object": {
34359
+ if (prop.properties && typeof prop.properties === "object" && !Array.isArray(prop.properties)) {
34360
+ base = external_exports.object(jsonSchemaToZodShape(prop));
34361
+ if (prop.additionalProperties === false) base = base.strict();
34362
+ else if (prop.additionalProperties === true) base = base.passthrough();
34363
+ } else {
34364
+ base = external_exports.record(external_exports.string(), external_exports.unknown());
34365
+ }
33541
34366
  break;
34367
+ }
33542
34368
  default:
33543
34369
  base = external_exports.unknown();
33544
34370
  }
@@ -33677,6 +34503,88 @@ var CLAUDE_BRIDGE_TOOL_ISOLATION = {
33677
34503
  allowedTools: [`mcp__${MCP_SERVER_NAME}__*`]
33678
34504
  };
33679
34505
  var sharedSession = null;
34506
+ var extensionApi;
34507
+ var BRIDGE_SESSION_CUSTOM_TYPE = "claude-bridge-session";
34508
+ function fingerprintMessages(messages) {
34509
+ const normalized = messages.map((message) => {
34510
+ if (message.role === "assistant") {
34511
+ return {
34512
+ role: message.role,
34513
+ provider: message.provider,
34514
+ model: message.model,
34515
+ content: message.content
34516
+ };
34517
+ }
34518
+ return message;
34519
+ });
34520
+ return createHash("sha256").update(JSON.stringify(normalized)).digest("hex");
34521
+ }
34522
+ function readBuiltSessionContext(sessionManager) {
34523
+ const built = typeof sessionManager?.buildSessionContext === "function" ? sessionManager.buildSessionContext() : void 0;
34524
+ return Array.isArray(built?.messages) ? built : void 0;
34525
+ }
34526
+ function latestPersistedBridgeSession(sessionManager) {
34527
+ const entries = typeof sessionManager?.getEntries === "function" ? sessionManager.getEntries() : [];
34528
+ if (!Array.isArray(entries)) return void 0;
34529
+ for (let i2 = entries.length - 1; i2 >= 0; i2--) {
34530
+ const entry = entries[i2];
34531
+ if (entry?.type !== "custom" || entry.customType !== BRIDGE_SESSION_CUSTOM_TYPE) continue;
34532
+ const data = entry.data;
34533
+ if (!data || typeof data.sessionId !== "string" || typeof data.cursor !== "number" || typeof data.cwd !== "string" || typeof data.fingerprint !== "string") continue;
34534
+ return data;
34535
+ }
34536
+ return void 0;
34537
+ }
34538
+ function claudeSessionExists(sessionId, cwd) {
34539
+ try {
34540
+ const session = openSession({ sessionId, projectPath: cwd, claudeDir: process.env.CLAUDE_CONFIG_DIR });
34541
+ statSync3(session.jsonlPath);
34542
+ return true;
34543
+ } catch {
34544
+ return false;
34545
+ }
34546
+ }
34547
+ function restoreSharedSessionFromPi(ctx2) {
34548
+ const persisted = latestPersistedBridgeSession(ctx2.sessionManager);
34549
+ if (!persisted) return;
34550
+ const built = readBuiltSessionContext(ctx2.sessionManager);
34551
+ if (!built) return;
34552
+ const cursor = Math.max(0, Math.min(persisted.cursor, built.messages.length));
34553
+ const fingerprint = fingerprintMessages(built.messages.slice(0, cursor));
34554
+ if (fingerprint !== persisted.fingerprint) {
34555
+ debug(`restoreSharedSession: fingerprint mismatch for ${persisted.sessionId.slice(0, 8)}`);
34556
+ return;
34557
+ }
34558
+ if (!claudeSessionExists(persisted.sessionId, persisted.cwd)) {
34559
+ debug(`restoreSharedSession: Claude session missing for ${persisted.sessionId.slice(0, 8)}`);
34560
+ return;
34561
+ }
34562
+ sharedSession = { sessionId: persisted.sessionId, cursor, cwd: persisted.cwd };
34563
+ debug(`restoreSharedSession: restored ${persisted.sessionId.slice(0, 8)}, cursor=${cursor}`);
34564
+ }
34565
+ function schedulePersistSharedSession(ctxLike) {
34566
+ if (!extensionApi || !sharedSession || !ctxLike?.sessionManager) return;
34567
+ const snapshot = { ...sharedSession };
34568
+ const timer = setTimeout(() => {
34569
+ try {
34570
+ const built = readBuiltSessionContext(ctxLike.sessionManager);
34571
+ if (!built) return;
34572
+ const cursor = Math.max(0, Math.min(snapshot.cursor, built.messages.length));
34573
+ const data = {
34574
+ ...snapshot,
34575
+ cursor,
34576
+ fingerprint: fingerprintMessages(built.messages.slice(0, cursor)),
34577
+ piSessionId: typeof ctxLike.sessionManager?.getSessionId === "function" ? ctxLike.sessionManager.getSessionId() : void 0,
34578
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString()
34579
+ };
34580
+ extensionApi?.appendEntry(BRIDGE_SESSION_CUSTOM_TYPE, data);
34581
+ debug(`persistSharedSession: saved ${data.sessionId.slice(0, 8)}, cursor=${data.cursor}`);
34582
+ } catch (error51) {
34583
+ debug("persistSharedSession failed:", error51);
34584
+ }
34585
+ }, 0);
34586
+ timer.unref?.();
34587
+ }
33680
34588
  function convertAndImportMessages(session, messages, customToolNameToSdk) {
33681
34589
  const { anthropicMessages, sanitizedIds } = convertPiMessages(messages, customToolNameToSdk);
33682
34590
  debug(`convertAndImportMessages: ${messages.length} pi msgs \u2192 ${anthropicMessages.length} anthropic msgs`);
@@ -34358,8 +35266,8 @@ function streamClaudeAgentSdk(model, context, options) {
34358
35266
  ctx().activeQuery = sdkQuery;
34359
35267
  }
34360
35268
  finalizeCurrentStream(ctx().turnOutput?.stopReason);
34361
- }).catch((error48) => {
34362
- debug(`provider: query error, model=${model.id}, aborted=${Boolean(options?.signal?.aborted)}, error=`, error48);
35269
+ }).catch((error51) => {
35270
+ debug(`provider: query error, model=${model.id}, aborted=${Boolean(options?.signal?.aborted)}, error=`, error51);
34363
35271
  if ((wasAborted || options?.signal?.aborted) && sharedSession) {
34364
35272
  sharedSession = { ...sharedSession, needsRebuild: true, forceRotate: true };
34365
35273
  } else {
@@ -34368,7 +35276,7 @@ function streamClaudeAgentSdk(model, context, options) {
34368
35276
  ctx().deferredUserMessages = [];
34369
35277
  if (ctx().turnOutput) {
34370
35278
  ctx().turnOutput.stopReason = options?.signal?.aborted ? "aborted" : "error";
34371
- ctx().turnOutput.errorMessage = error48 instanceof Error ? error48.message : String(error48);
35279
+ ctx().turnOutput.errorMessage = error51 instanceof Error ? error51.message : String(error51);
34372
35280
  }
34373
35281
  ctx().currentPiStream?.push({ type: "error", reason: ctx().turnOutput?.stopReason ?? "error", error: ctx().turnOutput });
34374
35282
  ctx().currentPiStream?.end();
@@ -34392,6 +35300,7 @@ function streamClaudeAgentSdk(model, context, options) {
34392
35300
  return stream;
34393
35301
  }
34394
35302
  function index_default(pi) {
35303
+ extensionApi = pi;
34395
35304
  process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC = "1";
34396
35305
  const config2 = loadConfig(process.cwd());
34397
35306
  debug("loadConfig:", JSON.stringify(config2));
@@ -34413,8 +35322,13 @@ function index_default(pi) {
34413
35322
  if (event.reason === "new" || event.reason === "resume" || event.reason === "fork") {
34414
35323
  clearSession(`session_start:${event.reason}`);
34415
35324
  }
35325
+ if (event.reason === "startup" || event.reason === "resume" || event.reason === "fork") restoreSharedSessionFromPi(ctx2);
34416
35326
  });
34417
35327
  pi.on("session_shutdown", () => clearSession("session_shutdown"));
35328
+ pi.on("message_end", (event, ctx2) => {
35329
+ const message = event.message;
35330
+ if (message?.role === "assistant" && message.provider === PROVIDER_ID) schedulePersistSharedSession(ctx2);
35331
+ });
34418
35332
  const markRebuild = (event) => {
34419
35333
  if (sharedSession) {
34420
35334
  debug(`${event}: marking needsRebuild on session ${sharedSession.sessionId.slice(0, 8)}`);