@elysiajs/openapi 1.4.11 → 1.4.12

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.
@@ -272,11 +272,11 @@ function CreateType(schema, options) {
272
272
  }
273
273
 
274
274
  // node_modules/@sinclair/typebox/build/esm/type/symbols/symbols.mjs
275
- var TransformKind = Symbol.for("TypeBox.Transform");
276
- var ReadonlyKind = Symbol.for("TypeBox.Readonly");
277
- var OptionalKind = Symbol.for("TypeBox.Optional");
278
- var Hint = Symbol.for("TypeBox.Hint");
279
- var Kind = Symbol.for("TypeBox.Kind");
275
+ var TransformKind = /* @__PURE__ */ Symbol.for("TypeBox.Transform");
276
+ var ReadonlyKind = /* @__PURE__ */ Symbol.for("TypeBox.Readonly");
277
+ var OptionalKind = /* @__PURE__ */ Symbol.for("TypeBox.Optional");
278
+ var Hint = /* @__PURE__ */ Symbol.for("TypeBox.Hint");
279
+ var Kind = /* @__PURE__ */ Symbol.for("TypeBox.Kind");
280
280
 
281
281
  // node_modules/@sinclair/typebox/build/esm/type/error/error.mjs
282
282
  var TypeBoxError = class extends Error {
@@ -3180,47 +3180,41 @@ function TypeBoxFromTypeBox(type) {
3180
3180
  return CloneType(type);
3181
3181
  }
3182
3182
 
3183
- // node_modules/valibot/dist/index.js
3184
- var store;
3183
+ // node_modules/valibot/dist/index.mjs
3184
+ var store$4;
3185
3185
  // @__NO_SIDE_EFFECTS__
3186
- function getGlobalConfig(config2) {
3186
+ function getGlobalConfig(config$1) {
3187
3187
  return {
3188
- lang: config2?.lang ?? store?.lang,
3189
- message: config2?.message,
3190
- abortEarly: config2?.abortEarly ?? store?.abortEarly,
3191
- abortPipeEarly: config2?.abortPipeEarly ?? store?.abortPipeEarly
3188
+ lang: config$1?.lang ?? store$4?.lang,
3189
+ message: config$1?.message,
3190
+ abortEarly: config$1?.abortEarly ?? store$4?.abortEarly,
3191
+ abortPipeEarly: config$1?.abortPipeEarly ?? store$4?.abortPipeEarly
3192
3192
  };
3193
3193
  }
3194
- var store2;
3194
+ var store$3;
3195
3195
  // @__NO_SIDE_EFFECTS__
3196
3196
  function getGlobalMessage(lang) {
3197
- return store2?.get(lang);
3197
+ return store$3?.get(lang);
3198
3198
  }
3199
- var store3;
3199
+ var store$2;
3200
3200
  // @__NO_SIDE_EFFECTS__
3201
3201
  function getSchemaMessage(lang) {
3202
- return store3?.get(lang);
3202
+ return store$2?.get(lang);
3203
3203
  }
3204
- var store4;
3204
+ var store$1;
3205
3205
  // @__NO_SIDE_EFFECTS__
3206
3206
  function getSpecificMessage(reference, lang) {
3207
- return store4?.get(reference)?.get(lang);
3207
+ return store$1?.get(reference)?.get(lang);
3208
3208
  }
3209
3209
  // @__NO_SIDE_EFFECTS__
3210
3210
  function _stringify(input) {
3211
3211
  const type = typeof input;
3212
- if (type === "string") {
3213
- return `"${input}"`;
3214
- }
3215
- if (type === "number" || type === "bigint" || type === "boolean") {
3216
- return `${input}`;
3217
- }
3218
- if (type === "object" || type === "function") {
3219
- return (input && Object.getPrototypeOf(input)?.constructor?.name) ?? "null";
3220
- }
3212
+ if (type === "string") return `"${input}"`;
3213
+ if (type === "number" || type === "bigint" || type === "boolean") return `${input}`;
3214
+ if (type === "object" || type === "function") return (input && Object.getPrototypeOf(input)?.constructor?.name) ?? "null";
3221
3215
  return type;
3222
3216
  }
3223
- function _addIssue(context, label, dataset, config2, other) {
3217
+ function _addIssue(context, label, dataset, config$1, other) {
3224
3218
  const input = other && "input" in other ? other.input : dataset.value;
3225
3219
  const expected = other?.expected ?? context.expects ?? null;
3226
3220
  const received = other?.received ?? /* @__PURE__ */ _stringify(input);
@@ -3234,48 +3228,49 @@ function _addIssue(context, label, dataset, config2, other) {
3234
3228
  requirement: context.requirement,
3235
3229
  path: other?.path,
3236
3230
  issues: other?.issues,
3237
- lang: config2.lang,
3238
- abortEarly: config2.abortEarly,
3239
- abortPipeEarly: config2.abortPipeEarly
3231
+ lang: config$1.lang,
3232
+ abortEarly: config$1.abortEarly,
3233
+ abortPipeEarly: config$1.abortPipeEarly
3240
3234
  };
3241
3235
  const isSchema = context.kind === "schema";
3242
- const message2 = other?.message ?? context.message ?? /* @__PURE__ */ getSpecificMessage(context.reference, issue2.lang) ?? (isSchema ? /* @__PURE__ */ getSchemaMessage(issue2.lang) : null) ?? config2.message ?? /* @__PURE__ */ getGlobalMessage(issue2.lang);
3243
- if (message2 !== void 0) {
3244
- issue2.message = typeof message2 === "function" ? (
3245
- // @ts-expect-error
3246
- message2(issue2)
3247
- ) : message2;
3248
- }
3249
- if (isSchema) {
3250
- dataset.typed = false;
3251
- }
3252
- if (dataset.issues) {
3253
- dataset.issues.push(issue2);
3254
- } else {
3255
- dataset.issues = [issue2];
3256
- }
3236
+ const message$1 = other?.message ?? context.message ?? /* @__PURE__ */ getSpecificMessage(context.reference, issue2.lang) ?? (isSchema ? /* @__PURE__ */ getSchemaMessage(issue2.lang) : null) ?? config$1.message ?? /* @__PURE__ */ getGlobalMessage(issue2.lang);
3237
+ if (message$1 !== void 0) issue2.message = typeof message$1 === "function" ? message$1(issue2) : message$1;
3238
+ if (isSchema) dataset.typed = false;
3239
+ if (dataset.issues) dataset.issues.push(issue2);
3240
+ else dataset.issues = [issue2];
3257
3241
  }
3258
3242
  // @__NO_SIDE_EFFECTS__
3259
3243
  function _getStandardProps(context) {
3260
3244
  return {
3261
3245
  version: 1,
3262
3246
  vendor: "valibot",
3263
- validate(value2) {
3264
- return context["~run"]({ value: value2 }, /* @__PURE__ */ getGlobalConfig());
3247
+ validate(value$1) {
3248
+ return context["~run"]({ value: value$1 }, /* @__PURE__ */ getGlobalConfig());
3265
3249
  }
3266
3250
  };
3267
3251
  }
3268
3252
  var NON_DIGIT_REGEX = /\D/gu;
3269
3253
  // @__NO_SIDE_EFFECTS__
3270
3254
  function _isLuhnAlgo(input) {
3271
- const number2 = input.replace(NON_DIGIT_REGEX, "");
3272
- let length2 = number2.length;
3255
+ const number$1 = input.replace(NON_DIGIT_REGEX, "");
3256
+ let length$1 = number$1.length;
3273
3257
  let bit = 1;
3274
3258
  let sum = 0;
3275
- while (length2) {
3276
- const value2 = +number2[--length2];
3259
+ while (length$1) {
3260
+ const value$1 = +number$1[--length$1];
3277
3261
  bit ^= 1;
3278
- sum += bit ? [0, 2, 4, 6, 8, 1, 3, 5, 7, 9][value2] : value2;
3262
+ sum += bit ? [
3263
+ 0,
3264
+ 2,
3265
+ 4,
3266
+ 6,
3267
+ 8,
3268
+ 1,
3269
+ 3,
3270
+ 5,
3271
+ 7,
3272
+ 9
3273
+ ][value$1] : value$1;
3279
3274
  }
3280
3275
  return sum % 10 === 0;
3281
3276
  }
@@ -3285,14 +3280,8 @@ var CUID2_REGEX = /^[a-z][\da-z]*$/u;
3285
3280
  var DECIMAL_REGEX = /^[+-]?(?:\d*\.)?\d+$/u;
3286
3281
  var DIGITS_REGEX = /^\d+$/u;
3287
3282
  var EMAIL_REGEX = /^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu;
3288
- var EMOJI_REGEX = (
3289
- // eslint-disable-next-line redos-detector/no-unsafe-regex, regexp/no-dupe-disjunctions -- false positives
3290
- new RegExp("^(?:[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}))*)+$", "u")
3291
- );
3292
- var IPV4_REGEX = (
3293
- // eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive
3294
- /^(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])(?:\.(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])){3}$/u
3295
- );
3283
+ var EMOJI_REGEX = new RegExp("^(?:[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|(?![\\p{Emoji_Modifier_Base}\\u{1F1E6}-\\u{1F1FF}])\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|(?![\\p{Emoji_Modifier_Base}\\u{1F1E6}-\\u{1F1FF}])\\p{Emoji_Presentation}))*)+$", "u");
3284
+ var IPV4_REGEX = /^(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])(?:\.(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])){3}$/u;
3296
3285
  var IPV6_REGEX = /^(?:(?:[\da-f]{1,4}:){7}[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,7}:|(?:[\da-f]{1,4}:){1,6}:[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,5}(?::[\da-f]{1,4}){1,2}|(?:[\da-f]{1,4}:){1,4}(?::[\da-f]{1,4}){1,3}|(?:[\da-f]{1,4}:){1,3}(?::[\da-f]{1,4}){1,4}|(?:[\da-f]{1,4}:){1,2}(?::[\da-f]{1,4}){1,5}|[\da-f]{1,4}:(?::[\da-f]{1,4}){1,6}|:(?:(?::[\da-f]{1,4}){1,7}|:)|fe80:(?::[\da-f]{0,4}){0,4}%[\da-z]+|::(?:f{4}(?::0{1,4})?:)?(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d)|(?:[\da-f]{1,4}:){1,4}:(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d))$/iu;
3297
3286
  var IP_REGEX = /^(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])(?:\.(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])){3}$|^(?:(?:[\da-f]{1,4}:){7}[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,7}:|(?:[\da-f]{1,4}:){1,6}:[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,5}(?::[\da-f]{1,4}){1,2}|(?:[\da-f]{1,4}:){1,4}(?::[\da-f]{1,4}){1,3}|(?:[\da-f]{1,4}:){1,3}(?::[\da-f]{1,4}){1,4}|(?:[\da-f]{1,4}:){1,2}(?::[\da-f]{1,4}){1,5}|[\da-f]{1,4}:(?::[\da-f]{1,4}){1,6}|:(?:(?::[\da-f]{1,4}){1,7}|:)|fe80:(?::[\da-f]{0,4}){0,4}%[\da-z]+|::(?:f{4}(?::0{1,4})?:)?(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d)|(?:[\da-f]{1,4}:){1,4}:(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d))$/iu;
3298
3287
  var ISO_DATE_REGEX = /^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])$/u;
@@ -3309,7 +3298,7 @@ var OCTAL_REGEX = /^(?:0o)?[0-7]+$/u;
3309
3298
  var ULID_REGEX = /^[\da-hjkmnp-tv-zA-HJKMNP-TV-Z]{26}$/u;
3310
3299
  var UUID_REGEX = /^[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}$/iu;
3311
3300
  // @__NO_SIDE_EFFECTS__
3312
- function base64(message2) {
3301
+ function base64(message$1) {
3313
3302
  return {
3314
3303
  kind: "validation",
3315
3304
  type: "base64",
@@ -3317,17 +3306,15 @@ function base64(message2) {
3317
3306
  async: false,
3318
3307
  expects: null,
3319
3308
  requirement: BASE64_REGEX,
3320
- message: message2,
3321
- "~run"(dataset, config2) {
3322
- if (dataset.typed && !this.requirement.test(dataset.value)) {
3323
- _addIssue(this, "Base64", dataset, config2);
3324
- }
3309
+ message: message$1,
3310
+ "~run"(dataset, config$1) {
3311
+ if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "Base64", dataset, config$1);
3325
3312
  return dataset;
3326
3313
  }
3327
3314
  };
3328
3315
  }
3329
3316
  // @__NO_SIDE_EFFECTS__
3330
- function bic(message2) {
3317
+ function bic(message$1) {
3331
3318
  return {
3332
3319
  kind: "validation",
3333
3320
  type: "bic",
@@ -3335,11 +3322,9 @@ function bic(message2) {
3335
3322
  async: false,
3336
3323
  expects: null,
3337
3324
  requirement: BIC_REGEX,
3338
- message: message2,
3339
- "~run"(dataset, config2) {
3340
- if (dataset.typed && !this.requirement.test(dataset.value)) {
3341
- _addIssue(this, "BIC", dataset, config2);
3342
- }
3325
+ message: message$1,
3326
+ "~run"(dataset, config$1) {
3327
+ if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "BIC", dataset, config$1);
3343
3328
  return dataset;
3344
3329
  }
3345
3330
  };
@@ -3347,24 +3332,16 @@ function bic(message2) {
3347
3332
  var CREDIT_CARD_REGEX = /^(?:\d{14,19}|\d{4}(?: \d{3,6}){2,4}|\d{4}(?:-\d{3,6}){2,4})$/u;
3348
3333
  var SANITIZE_REGEX = /[- ]/gu;
3349
3334
  var PROVIDER_REGEX_LIST = [
3350
- // American Express
3351
3335
  /^3[47]\d{13}$/u,
3352
- // Diners Club
3353
3336
  /^3(?:0[0-5]|[68]\d)\d{11,13}$/u,
3354
- // Discover
3355
3337
  /^6(?:011|5\d{2})\d{12,15}$/u,
3356
- // JCB
3357
3338
  /^(?:2131|1800|35\d{3})\d{11}$/u,
3358
- // Mastercard
3359
- // eslint-disable-next-line redos-detector/no-unsafe-regex
3360
3339
  /^5[1-5]\d{2}|(?:222\d|22[3-9]\d|2[3-6]\d{2}|27[01]\d|2720)\d{12}$/u,
3361
- // UnionPay
3362
3340
  /^(?:6[27]\d{14,17}|81\d{14,17})$/u,
3363
- // Visa
3364
3341
  /^4\d{12}(?:\d{3,6})?$/u
3365
3342
  ];
3366
3343
  // @__NO_SIDE_EFFECTS__
3367
- function creditCard(message2) {
3344
+ function creditCard(message$1) {
3368
3345
  return {
3369
3346
  kind: "validation",
3370
3347
  type: "credit_card",
@@ -3373,22 +3350,17 @@ function creditCard(message2) {
3373
3350
  expects: null,
3374
3351
  requirement(input) {
3375
3352
  let sanitized;
3376
- return CREDIT_CARD_REGEX.test(input) && // Remove any hyphens and blanks
3377
- (sanitized = input.replace(SANITIZE_REGEX, "")) && // Check if it matches a provider
3378
- PROVIDER_REGEX_LIST.some((regex2) => regex2.test(sanitized)) && // Check if passes luhn algorithm
3379
- /* @__PURE__ */ _isLuhnAlgo(sanitized);
3353
+ return CREDIT_CARD_REGEX.test(input) && (sanitized = input.replace(SANITIZE_REGEX, "")) && PROVIDER_REGEX_LIST.some((regex$1) => regex$1.test(sanitized)) && /* @__PURE__ */ _isLuhnAlgo(sanitized);
3380
3354
  },
3381
- message: message2,
3382
- "~run"(dataset, config2) {
3383
- if (dataset.typed && !this.requirement(dataset.value)) {
3384
- _addIssue(this, "credit card", dataset, config2);
3385
- }
3355
+ message: message$1,
3356
+ "~run"(dataset, config$1) {
3357
+ if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "credit card", dataset, config$1);
3386
3358
  return dataset;
3387
3359
  }
3388
3360
  };
3389
3361
  }
3390
3362
  // @__NO_SIDE_EFFECTS__
3391
- function cuid2(message2) {
3363
+ function cuid2(message$1) {
3392
3364
  return {
3393
3365
  kind: "validation",
3394
3366
  type: "cuid2",
@@ -3396,17 +3368,15 @@ function cuid2(message2) {
3396
3368
  async: false,
3397
3369
  expects: null,
3398
3370
  requirement: CUID2_REGEX,
3399
- message: message2,
3400
- "~run"(dataset, config2) {
3401
- if (dataset.typed && !this.requirement.test(dataset.value)) {
3402
- _addIssue(this, "Cuid2", dataset, config2);
3403
- }
3371
+ message: message$1,
3372
+ "~run"(dataset, config$1) {
3373
+ if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "Cuid2", dataset, config$1);
3404
3374
  return dataset;
3405
3375
  }
3406
3376
  };
3407
3377
  }
3408
3378
  // @__NO_SIDE_EFFECTS__
3409
- function decimal(message2) {
3379
+ function decimal(message$1) {
3410
3380
  return {
3411
3381
  kind: "validation",
3412
3382
  type: "decimal",
@@ -3414,17 +3384,15 @@ function decimal(message2) {
3414
3384
  async: false,
3415
3385
  expects: null,
3416
3386
  requirement: DECIMAL_REGEX,
3417
- message: message2,
3418
- "~run"(dataset, config2) {
3419
- if (dataset.typed && !this.requirement.test(dataset.value)) {
3420
- _addIssue(this, "decimal", dataset, config2);
3421
- }
3387
+ message: message$1,
3388
+ "~run"(dataset, config$1) {
3389
+ if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "decimal", dataset, config$1);
3422
3390
  return dataset;
3423
3391
  }
3424
3392
  };
3425
3393
  }
3426
3394
  // @__NO_SIDE_EFFECTS__
3427
- function digits(message2) {
3395
+ function digits(message$1) {
3428
3396
  return {
3429
3397
  kind: "validation",
3430
3398
  type: "digits",
@@ -3432,17 +3400,15 @@ function digits(message2) {
3432
3400
  async: false,
3433
3401
  expects: null,
3434
3402
  requirement: DIGITS_REGEX,
3435
- message: message2,
3436
- "~run"(dataset, config2) {
3437
- if (dataset.typed && !this.requirement.test(dataset.value)) {
3438
- _addIssue(this, "digits", dataset, config2);
3439
- }
3403
+ message: message$1,
3404
+ "~run"(dataset, config$1) {
3405
+ if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "digits", dataset, config$1);
3440
3406
  return dataset;
3441
3407
  }
3442
3408
  };
3443
3409
  }
3444
3410
  // @__NO_SIDE_EFFECTS__
3445
- function email(message2) {
3411
+ function email(message$1) {
3446
3412
  return {
3447
3413
  kind: "validation",
3448
3414
  type: "email",
@@ -3450,17 +3416,15 @@ function email(message2) {
3450
3416
  expects: null,
3451
3417
  async: false,
3452
3418
  requirement: EMAIL_REGEX,
3453
- message: message2,
3454
- "~run"(dataset, config2) {
3455
- if (dataset.typed && !this.requirement.test(dataset.value)) {
3456
- _addIssue(this, "email", dataset, config2);
3457
- }
3419
+ message: message$1,
3420
+ "~run"(dataset, config$1) {
3421
+ if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "email", dataset, config$1);
3458
3422
  return dataset;
3459
3423
  }
3460
3424
  };
3461
3425
  }
3462
3426
  // @__NO_SIDE_EFFECTS__
3463
- function emoji(message2) {
3427
+ function emoji(message$1) {
3464
3428
  return {
3465
3429
  kind: "validation",
3466
3430
  type: "emoji",
@@ -3468,17 +3432,15 @@ function emoji(message2) {
3468
3432
  async: false,
3469
3433
  expects: null,
3470
3434
  requirement: EMOJI_REGEX,
3471
- message: message2,
3472
- "~run"(dataset, config2) {
3473
- if (dataset.typed && !this.requirement.test(dataset.value)) {
3474
- _addIssue(this, "emoji", dataset, config2);
3475
- }
3435
+ message: message$1,
3436
+ "~run"(dataset, config$1) {
3437
+ if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "emoji", dataset, config$1);
3476
3438
  return dataset;
3477
3439
  }
3478
3440
  };
3479
3441
  }
3480
3442
  // @__NO_SIDE_EFFECTS__
3481
- function ip(message2) {
3443
+ function ip(message$1) {
3482
3444
  return {
3483
3445
  kind: "validation",
3484
3446
  type: "ip",
@@ -3486,17 +3448,15 @@ function ip(message2) {
3486
3448
  async: false,
3487
3449
  expects: null,
3488
3450
  requirement: IP_REGEX,
3489
- message: message2,
3490
- "~run"(dataset, config2) {
3491
- if (dataset.typed && !this.requirement.test(dataset.value)) {
3492
- _addIssue(this, "IP", dataset, config2);
3493
- }
3451
+ message: message$1,
3452
+ "~run"(dataset, config$1) {
3453
+ if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "IP", dataset, config$1);
3494
3454
  return dataset;
3495
3455
  }
3496
3456
  };
3497
3457
  }
3498
3458
  // @__NO_SIDE_EFFECTS__
3499
- function ipv4(message2) {
3459
+ function ipv4(message$1) {
3500
3460
  return {
3501
3461
  kind: "validation",
3502
3462
  type: "ipv4",
@@ -3504,17 +3464,15 @@ function ipv4(message2) {
3504
3464
  async: false,
3505
3465
  expects: null,
3506
3466
  requirement: IPV4_REGEX,
3507
- message: message2,
3508
- "~run"(dataset, config2) {
3509
- if (dataset.typed && !this.requirement.test(dataset.value)) {
3510
- _addIssue(this, "IPv4", dataset, config2);
3511
- }
3467
+ message: message$1,
3468
+ "~run"(dataset, config$1) {
3469
+ if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "IPv4", dataset, config$1);
3512
3470
  return dataset;
3513
3471
  }
3514
3472
  };
3515
3473
  }
3516
3474
  // @__NO_SIDE_EFFECTS__
3517
- function ipv6(message2) {
3475
+ function ipv6(message$1) {
3518
3476
  return {
3519
3477
  kind: "validation",
3520
3478
  type: "ipv6",
@@ -3522,17 +3480,15 @@ function ipv6(message2) {
3522
3480
  async: false,
3523
3481
  expects: null,
3524
3482
  requirement: IPV6_REGEX,
3525
- message: message2,
3526
- "~run"(dataset, config2) {
3527
- if (dataset.typed && !this.requirement.test(dataset.value)) {
3528
- _addIssue(this, "IPv6", dataset, config2);
3529
- }
3483
+ message: message$1,
3484
+ "~run"(dataset, config$1) {
3485
+ if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "IPv6", dataset, config$1);
3530
3486
  return dataset;
3531
3487
  }
3532
3488
  };
3533
3489
  }
3534
3490
  // @__NO_SIDE_EFFECTS__
3535
- function isoDate(message2) {
3491
+ function isoDate(message$1) {
3536
3492
  return {
3537
3493
  kind: "validation",
3538
3494
  type: "iso_date",
@@ -3540,17 +3496,15 @@ function isoDate(message2) {
3540
3496
  async: false,
3541
3497
  expects: null,
3542
3498
  requirement: ISO_DATE_REGEX,
3543
- message: message2,
3544
- "~run"(dataset, config2) {
3545
- if (dataset.typed && !this.requirement.test(dataset.value)) {
3546
- _addIssue(this, "date", dataset, config2);
3547
- }
3499
+ message: message$1,
3500
+ "~run"(dataset, config$1) {
3501
+ if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "date", dataset, config$1);
3548
3502
  return dataset;
3549
3503
  }
3550
3504
  };
3551
3505
  }
3552
3506
  // @__NO_SIDE_EFFECTS__
3553
- function isoDateTime(message2) {
3507
+ function isoDateTime(message$1) {
3554
3508
  return {
3555
3509
  kind: "validation",
3556
3510
  type: "iso_date_time",
@@ -3558,17 +3512,15 @@ function isoDateTime(message2) {
3558
3512
  async: false,
3559
3513
  expects: null,
3560
3514
  requirement: ISO_DATE_TIME_REGEX,
3561
- message: message2,
3562
- "~run"(dataset, config2) {
3563
- if (dataset.typed && !this.requirement.test(dataset.value)) {
3564
- _addIssue(this, "date-time", dataset, config2);
3565
- }
3515
+ message: message$1,
3516
+ "~run"(dataset, config$1) {
3517
+ if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "date-time", dataset, config$1);
3566
3518
  return dataset;
3567
3519
  }
3568
3520
  };
3569
3521
  }
3570
3522
  // @__NO_SIDE_EFFECTS__
3571
- function isoTime(message2) {
3523
+ function isoTime(message$1) {
3572
3524
  return {
3573
3525
  kind: "validation",
3574
3526
  type: "iso_time",
@@ -3576,17 +3528,15 @@ function isoTime(message2) {
3576
3528
  async: false,
3577
3529
  expects: null,
3578
3530
  requirement: ISO_TIME_REGEX,
3579
- message: message2,
3580
- "~run"(dataset, config2) {
3581
- if (dataset.typed && !this.requirement.test(dataset.value)) {
3582
- _addIssue(this, "time", dataset, config2);
3583
- }
3531
+ message: message$1,
3532
+ "~run"(dataset, config$1) {
3533
+ if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "time", dataset, config$1);
3584
3534
  return dataset;
3585
3535
  }
3586
3536
  };
3587
3537
  }
3588
3538
  // @__NO_SIDE_EFFECTS__
3589
- function isoTimeSecond(message2) {
3539
+ function isoTimeSecond(message$1) {
3590
3540
  return {
3591
3541
  kind: "validation",
3592
3542
  type: "iso_time_second",
@@ -3594,17 +3544,15 @@ function isoTimeSecond(message2) {
3594
3544
  async: false,
3595
3545
  expects: null,
3596
3546
  requirement: ISO_TIME_SECOND_REGEX,
3597
- message: message2,
3598
- "~run"(dataset, config2) {
3599
- if (dataset.typed && !this.requirement.test(dataset.value)) {
3600
- _addIssue(this, "time-second", dataset, config2);
3601
- }
3547
+ message: message$1,
3548
+ "~run"(dataset, config$1) {
3549
+ if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "time-second", dataset, config$1);
3602
3550
  return dataset;
3603
3551
  }
3604
3552
  };
3605
3553
  }
3606
3554
  // @__NO_SIDE_EFFECTS__
3607
- function isoTimestamp(message2) {
3555
+ function isoTimestamp(message$1) {
3608
3556
  return {
3609
3557
  kind: "validation",
3610
3558
  type: "iso_timestamp",
@@ -3612,17 +3560,15 @@ function isoTimestamp(message2) {
3612
3560
  async: false,
3613
3561
  expects: null,
3614
3562
  requirement: ISO_TIMESTAMP_REGEX,
3615
- message: message2,
3616
- "~run"(dataset, config2) {
3617
- if (dataset.typed && !this.requirement.test(dataset.value)) {
3618
- _addIssue(this, "timestamp", dataset, config2);
3619
- }
3563
+ message: message$1,
3564
+ "~run"(dataset, config$1) {
3565
+ if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "timestamp", dataset, config$1);
3620
3566
  return dataset;
3621
3567
  }
3622
3568
  };
3623
3569
  }
3624
3570
  // @__NO_SIDE_EFFECTS__
3625
- function isoWeek(message2) {
3571
+ function isoWeek(message$1) {
3626
3572
  return {
3627
3573
  kind: "validation",
3628
3574
  type: "iso_week",
@@ -3630,17 +3576,15 @@ function isoWeek(message2) {
3630
3576
  async: false,
3631
3577
  expects: null,
3632
3578
  requirement: ISO_WEEK_REGEX,
3633
- message: message2,
3634
- "~run"(dataset, config2) {
3635
- if (dataset.typed && !this.requirement.test(dataset.value)) {
3636
- _addIssue(this, "week", dataset, config2);
3637
- }
3579
+ message: message$1,
3580
+ "~run"(dataset, config$1) {
3581
+ if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "week", dataset, config$1);
3638
3582
  return dataset;
3639
3583
  }
3640
3584
  };
3641
3585
  }
3642
3586
  // @__NO_SIDE_EFFECTS__
3643
- function mac(message2) {
3587
+ function mac(message$1) {
3644
3588
  return {
3645
3589
  kind: "validation",
3646
3590
  type: "mac",
@@ -3648,17 +3592,15 @@ function mac(message2) {
3648
3592
  async: false,
3649
3593
  expects: null,
3650
3594
  requirement: MAC_REGEX,
3651
- message: message2,
3652
- "~run"(dataset, config2) {
3653
- if (dataset.typed && !this.requirement.test(dataset.value)) {
3654
- _addIssue(this, "MAC", dataset, config2);
3655
- }
3595
+ message: message$1,
3596
+ "~run"(dataset, config$1) {
3597
+ if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "MAC", dataset, config$1);
3656
3598
  return dataset;
3657
3599
  }
3658
3600
  };
3659
3601
  }
3660
3602
  // @__NO_SIDE_EFFECTS__
3661
- function mac48(message2) {
3603
+ function mac48(message$1) {
3662
3604
  return {
3663
3605
  kind: "validation",
3664
3606
  type: "mac48",
@@ -3666,17 +3608,15 @@ function mac48(message2) {
3666
3608
  async: false,
3667
3609
  expects: null,
3668
3610
  requirement: MAC48_REGEX,
3669
- message: message2,
3670
- "~run"(dataset, config2) {
3671
- if (dataset.typed && !this.requirement.test(dataset.value)) {
3672
- _addIssue(this, "48-bit MAC", dataset, config2);
3673
- }
3611
+ message: message$1,
3612
+ "~run"(dataset, config$1) {
3613
+ if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "48-bit MAC", dataset, config$1);
3674
3614
  return dataset;
3675
3615
  }
3676
3616
  };
3677
3617
  }
3678
3618
  // @__NO_SIDE_EFFECTS__
3679
- function mac64(message2) {
3619
+ function mac64(message$1) {
3680
3620
  return {
3681
3621
  kind: "validation",
3682
3622
  type: "mac64",
@@ -3684,17 +3624,15 @@ function mac64(message2) {
3684
3624
  async: false,
3685
3625
  expects: null,
3686
3626
  requirement: MAC64_REGEX,
3687
- message: message2,
3688
- "~run"(dataset, config2) {
3689
- if (dataset.typed && !this.requirement.test(dataset.value)) {
3690
- _addIssue(this, "64-bit MAC", dataset, config2);
3691
- }
3627
+ message: message$1,
3628
+ "~run"(dataset, config$1) {
3629
+ if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "64-bit MAC", dataset, config$1);
3692
3630
  return dataset;
3693
3631
  }
3694
3632
  };
3695
3633
  }
3696
3634
  // @__NO_SIDE_EFFECTS__
3697
- function nanoid(message2) {
3635
+ function nanoid(message$1) {
3698
3636
  return {
3699
3637
  kind: "validation",
3700
3638
  type: "nanoid",
@@ -3702,17 +3640,15 @@ function nanoid(message2) {
3702
3640
  async: false,
3703
3641
  expects: null,
3704
3642
  requirement: NANO_ID_REGEX,
3705
- message: message2,
3706
- "~run"(dataset, config2) {
3707
- if (dataset.typed && !this.requirement.test(dataset.value)) {
3708
- _addIssue(this, "Nano ID", dataset, config2);
3709
- }
3643
+ message: message$1,
3644
+ "~run"(dataset, config$1) {
3645
+ if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "Nano ID", dataset, config$1);
3710
3646
  return dataset;
3711
3647
  }
3712
3648
  };
3713
3649
  }
3714
3650
  // @__NO_SIDE_EFFECTS__
3715
- function octal(message2) {
3651
+ function octal(message$1) {
3716
3652
  return {
3717
3653
  kind: "validation",
3718
3654
  type: "octal",
@@ -3720,17 +3656,15 @@ function octal(message2) {
3720
3656
  async: false,
3721
3657
  expects: null,
3722
3658
  requirement: OCTAL_REGEX,
3723
- message: message2,
3724
- "~run"(dataset, config2) {
3725
- if (dataset.typed && !this.requirement.test(dataset.value)) {
3726
- _addIssue(this, "octal", dataset, config2);
3727
- }
3659
+ message: message$1,
3660
+ "~run"(dataset, config$1) {
3661
+ if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "octal", dataset, config$1);
3728
3662
  return dataset;
3729
3663
  }
3730
3664
  };
3731
3665
  }
3732
3666
  // @__NO_SIDE_EFFECTS__
3733
- function ulid(message2) {
3667
+ function ulid(message$1) {
3734
3668
  return {
3735
3669
  kind: "validation",
3736
3670
  type: "ulid",
@@ -3738,17 +3672,15 @@ function ulid(message2) {
3738
3672
  async: false,
3739
3673
  expects: null,
3740
3674
  requirement: ULID_REGEX,
3741
- message: message2,
3742
- "~run"(dataset, config2) {
3743
- if (dataset.typed && !this.requirement.test(dataset.value)) {
3744
- _addIssue(this, "ULID", dataset, config2);
3745
- }
3675
+ message: message$1,
3676
+ "~run"(dataset, config$1) {
3677
+ if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "ULID", dataset, config$1);
3746
3678
  return dataset;
3747
3679
  }
3748
3680
  };
3749
3681
  }
3750
3682
  // @__NO_SIDE_EFFECTS__
3751
- function url(message2) {
3683
+ function url(message$1) {
3752
3684
  return {
3753
3685
  kind: "validation",
3754
3686
  type: "url",
@@ -3763,17 +3695,15 @@ function url(message2) {
3763
3695
  return false;
3764
3696
  }
3765
3697
  },
3766
- message: message2,
3767
- "~run"(dataset, config2) {
3768
- if (dataset.typed && !this.requirement(dataset.value)) {
3769
- _addIssue(this, "URL", dataset, config2);
3770
- }
3698
+ message: message$1,
3699
+ "~run"(dataset, config$1) {
3700
+ if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "URL", dataset, config$1);
3771
3701
  return dataset;
3772
3702
  }
3773
3703
  };
3774
3704
  }
3775
3705
  // @__NO_SIDE_EFFECTS__
3776
- function uuid(message2) {
3706
+ function uuid(message$1) {
3777
3707
  return {
3778
3708
  kind: "validation",
3779
3709
  type: "uuid",
@@ -3781,64 +3711,55 @@ function uuid(message2) {
3781
3711
  async: false,
3782
3712
  expects: null,
3783
3713
  requirement: UUID_REGEX,
3784
- message: message2,
3785
- "~run"(dataset, config2) {
3786
- if (dataset.typed && !this.requirement.test(dataset.value)) {
3787
- _addIssue(this, "UUID", dataset, config2);
3788
- }
3714
+ message: message$1,
3715
+ "~run"(dataset, config$1) {
3716
+ if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "UUID", dataset, config$1);
3789
3717
  return dataset;
3790
3718
  }
3791
3719
  };
3792
3720
  }
3793
3721
  // @__NO_SIDE_EFFECTS__
3794
- function string(message2) {
3722
+ function string(message$1) {
3795
3723
  return {
3796
3724
  kind: "schema",
3797
3725
  type: "string",
3798
3726
  reference: string,
3799
3727
  expects: "string",
3800
3728
  async: false,
3801
- message: message2,
3729
+ message: message$1,
3802
3730
  get "~standard"() {
3803
3731
  return /* @__PURE__ */ _getStandardProps(this);
3804
3732
  },
3805
- "~run"(dataset, config2) {
3806
- if (typeof dataset.value === "string") {
3807
- dataset.typed = true;
3808
- } else {
3809
- _addIssue(this, "type", dataset, config2);
3810
- }
3733
+ "~run"(dataset, config$1) {
3734
+ if (typeof dataset.value === "string") dataset.typed = true;
3735
+ else _addIssue(this, "type", dataset, config$1);
3811
3736
  return dataset;
3812
3737
  }
3813
3738
  };
3814
3739
  }
3815
3740
  // @__NO_SIDE_EFFECTS__
3816
- function pipe(...pipe22) {
3741
+ function pipe(...pipe$1) {
3817
3742
  return {
3818
- ...pipe22[0],
3819
- pipe: pipe22,
3743
+ ...pipe$1[0],
3744
+ pipe: pipe$1,
3820
3745
  get "~standard"() {
3821
3746
  return /* @__PURE__ */ _getStandardProps(this);
3822
3747
  },
3823
- "~run"(dataset, config2) {
3824
- for (const item of pipe22) {
3825
- if (item.kind !== "metadata") {
3826
- if (dataset.issues && (item.kind === "schema" || item.kind === "transformation")) {
3827
- dataset.typed = false;
3828
- break;
3829
- }
3830
- if (!dataset.issues || !config2.abortEarly && !config2.abortPipeEarly) {
3831
- dataset = item["~run"](dataset, config2);
3832
- }
3748
+ "~run"(dataset, config$1) {
3749
+ for (const item of pipe$1) if (item.kind !== "metadata") {
3750
+ if (dataset.issues && (item.kind === "schema" || item.kind === "transformation")) {
3751
+ dataset.typed = false;
3752
+ break;
3833
3753
  }
3754
+ if (!dataset.issues || !config$1.abortEarly && !config$1.abortPipeEarly) dataset = item["~run"](dataset, config$1);
3834
3755
  }
3835
3756
  return dataset;
3836
3757
  }
3837
3758
  };
3838
3759
  }
3839
3760
  // @__NO_SIDE_EFFECTS__
3840
- function safeParse(schema, input, config2) {
3841
- const dataset = schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config2));
3761
+ function safeParse(schema, input, config$1) {
3762
+ const dataset = schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1));
3842
3763
  return {
3843
3764
  typed: dataset.typed,
3844
3765
  success: !dataset.issues,
@@ -4143,30 +4064,39 @@ var NEVER = Object.freeze({
4143
4064
  // @__NO_SIDE_EFFECTS__
4144
4065
  function $constructor(name, initializer3, params) {
4145
4066
  function init(inst, def) {
4146
- var _a;
4147
- Object.defineProperty(inst, "_zod", {
4148
- value: inst._zod ?? {},
4149
- enumerable: false
4150
- });
4151
- (_a = inst._zod).traits ?? (_a.traits = /* @__PURE__ */ new Set());
4067
+ if (!inst._zod) {
4068
+ Object.defineProperty(inst, "_zod", {
4069
+ value: {
4070
+ def,
4071
+ constr: _,
4072
+ traits: /* @__PURE__ */ new Set()
4073
+ },
4074
+ enumerable: false
4075
+ });
4076
+ }
4077
+ if (inst._zod.traits.has(name)) {
4078
+ return;
4079
+ }
4152
4080
  inst._zod.traits.add(name);
4153
4081
  initializer3(inst, def);
4154
- for (const k in _.prototype) {
4155
- if (!(k in inst))
4156
- Object.defineProperty(inst, k, { value: _.prototype[k].bind(inst) });
4082
+ const proto = _.prototype;
4083
+ const keys = Object.keys(proto);
4084
+ for (let i = 0; i < keys.length; i++) {
4085
+ const k = keys[i];
4086
+ if (!(k in inst)) {
4087
+ inst[k] = proto[k].bind(inst);
4088
+ }
4157
4089
  }
4158
- inst._zod.constr = _;
4159
- inst._zod.def = def;
4160
4090
  }
4161
4091
  const Parent = params?.Parent ?? Object;
4162
4092
  class Definition extends Parent {
4163
4093
  }
4164
4094
  Object.defineProperty(Definition, "name", { value: name });
4165
4095
  function _(def) {
4166
- var _a;
4096
+ var _a2;
4167
4097
  const inst = params?.Parent ? new Definition() : this;
4168
4098
  init(inst, def);
4169
- (_a = inst._zod).deferred ?? (_a.deferred = []);
4099
+ (_a2 = inst._zod).deferred ?? (_a2.deferred = []);
4170
4100
  for (const fn of inst._zod.deferred) {
4171
4101
  fn();
4172
4102
  }
@@ -4183,7 +4113,6 @@ function $constructor(name, initializer3, params) {
4183
4113
  Object.defineProperty(_, "name", { value: name });
4184
4114
  return _;
4185
4115
  }
4186
- var $brand = Symbol("zod_brand");
4187
4116
  var $ZodAsyncError = class extends Error {
4188
4117
  constructor() {
4189
4118
  super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
@@ -4260,6 +4189,7 @@ __export(util_exports, {
4260
4189
  required: () => required,
4261
4190
  safeExtend: () => safeExtend,
4262
4191
  shallowClone: () => shallowClone,
4192
+ slugify: () => slugify,
4263
4193
  stringifyPrimitive: () => stringifyPrimitive,
4264
4194
  uint8ArrayToBase64: () => uint8ArrayToBase64,
4265
4195
  uint8ArrayToBase64url: () => uint8ArrayToBase64url,
@@ -4275,7 +4205,7 @@ function assertNotEqual(val) {
4275
4205
  function assertIs(_arg) {
4276
4206
  }
4277
4207
  function assertNever(_x) {
4278
- throw new Error();
4208
+ throw new Error("Unexpected value in exhaustive check");
4279
4209
  }
4280
4210
  function assert(_) {
4281
4211
  }
@@ -4328,7 +4258,7 @@ function floatSafeRemainder(val, step) {
4328
4258
  const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
4329
4259
  return valInt % stepInt / 10 ** decCount;
4330
4260
  }
4331
- var EVALUATING = Symbol("evaluating");
4261
+ var EVALUATING = /* @__PURE__ */ Symbol("evaluating");
4332
4262
  function defineLazy(object, key, getter) {
4333
4263
  let value = void 0;
4334
4264
  Object.defineProperty(object, key, {
@@ -4400,6 +4330,9 @@ function randomString(length = 10) {
4400
4330
  function esc(str) {
4401
4331
  return JSON.stringify(str);
4402
4332
  }
4333
+ function slugify(input) {
4334
+ return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
4335
+ }
4403
4336
  var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {
4404
4337
  };
4405
4338
  function isObject(data) {
@@ -4423,6 +4356,8 @@ function isPlainObject(o) {
4423
4356
  const ctor = o.constructor;
4424
4357
  if (ctor === void 0)
4425
4358
  return true;
4359
+ if (typeof ctor !== "function")
4360
+ return true;
4426
4361
  const prot = ctor.prototype;
4427
4362
  if (isObject(prot) === false)
4428
4363
  return false;
@@ -4739,8 +4674,8 @@ function aborted(x, startIndex = 0) {
4739
4674
  }
4740
4675
  function prefixIssues(path, issues) {
4741
4676
  return issues.map((iss) => {
4742
- var _a;
4743
- (_a = iss).path ?? (_a.path = []);
4677
+ var _a2;
4678
+ (_a2 = iss).path ?? (_a2.path = []);
4744
4679
  iss.path.unshift(path);
4745
4680
  return iss;
4746
4681
  });
@@ -4868,10 +4803,7 @@ function flattenError(error, mapper = (issue2) => issue2.message) {
4868
4803
  }
4869
4804
  return { formErrors, fieldErrors };
4870
4805
  }
4871
- function formatError(error, _mapper) {
4872
- const mapper = _mapper || function(issue2) {
4873
- return issue2.message;
4874
- };
4806
+ function formatError(error, mapper = (issue2) => issue2.message) {
4875
4807
  const fieldErrors = { _errors: [] };
4876
4808
  const processError = (error2) => {
4877
4809
  for (const issue2 of error2.issues) {
@@ -5008,7 +4940,6 @@ var cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]
5008
4940
  var cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
5009
4941
  var base642 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
5010
4942
  var base64url = /^[A-Za-z0-9_-]*$/;
5011
- 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])?)*\.?$/;
5012
4943
  var e164 = /^\+(?:[0-9]){6,14}[0-9]$/;
5013
4944
  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])))`;
5014
4945
  var date = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
@@ -5045,10 +4976,10 @@ var uppercase = /^[^a-z]*$/;
5045
4976
 
5046
4977
  // node_modules/zod/v4/core/checks.js
5047
4978
  var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
5048
- var _a;
4979
+ var _a2;
5049
4980
  inst._zod ?? (inst._zod = {});
5050
4981
  inst._zod.def = def;
5051
- (_a = inst._zod).onattach ?? (_a.onattach = []);
4982
+ (_a2 = inst._zod).onattach ?? (_a2.onattach = []);
5052
4983
  });
5053
4984
  var numericOriginMap = {
5054
4985
  number: "number",
@@ -5114,8 +5045,8 @@ var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan",
5114
5045
  var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
5115
5046
  $ZodCheck.init(inst, def);
5116
5047
  inst._zod.onattach.push((inst2) => {
5117
- var _a;
5118
- (_a = inst2._zod.bag).multipleOf ?? (_a.multipleOf = def.value);
5048
+ var _a2;
5049
+ (_a2 = inst2._zod.bag).multipleOf ?? (_a2.multipleOf = def.value);
5119
5050
  });
5120
5051
  inst._zod.check = (payload) => {
5121
5052
  if (typeof payload.value !== typeof def.value)
@@ -5209,9 +5140,9 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
5209
5140
  };
5210
5141
  });
5211
5142
  var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
5212
- var _a;
5143
+ var _a2;
5213
5144
  $ZodCheck.init(inst, def);
5214
- (_a = inst._zod.def).when ?? (_a.when = (payload) => {
5145
+ (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
5215
5146
  const val = payload.value;
5216
5147
  return !nullish(val) && val.length !== void 0;
5217
5148
  });
@@ -5238,9 +5169,9 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
5238
5169
  };
5239
5170
  });
5240
5171
  var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
5241
- var _a;
5172
+ var _a2;
5242
5173
  $ZodCheck.init(inst, def);
5243
- (_a = inst._zod.def).when ?? (_a.when = (payload) => {
5174
+ (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
5244
5175
  const val = payload.value;
5245
5176
  return !nullish(val) && val.length !== void 0;
5246
5177
  });
@@ -5267,9 +5198,9 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
5267
5198
  };
5268
5199
  });
5269
5200
  var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
5270
- var _a;
5201
+ var _a2;
5271
5202
  $ZodCheck.init(inst, def);
5272
- (_a = inst._zod.def).when ?? (_a.when = (payload) => {
5203
+ (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
5273
5204
  const val = payload.value;
5274
5205
  return !nullish(val) && val.length !== void 0;
5275
5206
  });
@@ -5298,7 +5229,7 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
5298
5229
  };
5299
5230
  });
5300
5231
  var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
5301
- var _a, _b;
5232
+ var _a2, _b;
5302
5233
  $ZodCheck.init(inst, def);
5303
5234
  inst._zod.onattach.push((inst2) => {
5304
5235
  const bag = inst2._zod.bag;
@@ -5309,7 +5240,7 @@ var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat"
5309
5240
  }
5310
5241
  });
5311
5242
  if (def.pattern)
5312
- (_a = inst._zod).check ?? (_a.check = (payload) => {
5243
+ (_a2 = inst._zod).check ?? (_a2.check = (payload) => {
5313
5244
  def.pattern.lastIndex = 0;
5314
5245
  if (def.pattern.test(payload.value))
5315
5246
  return;
@@ -5468,13 +5399,13 @@ var Doc = class {
5468
5399
  // node_modules/zod/v4/core/versions.js
5469
5400
  var version = {
5470
5401
  major: 4,
5471
- minor: 1,
5472
- patch: 8
5402
+ minor: 2,
5403
+ patch: 1
5473
5404
  };
5474
5405
 
5475
5406
  // node_modules/zod/v4/core/schemas.js
5476
5407
  var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
5477
- var _a;
5408
+ var _a2;
5478
5409
  inst ?? (inst = {});
5479
5410
  inst._zod.def = def;
5480
5411
  inst._zod.bag = inst._zod.bag || {};
@@ -5489,7 +5420,7 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
5489
5420
  }
5490
5421
  }
5491
5422
  if (checks.length === 0) {
5492
- (_a = inst._zod).deferred ?? (_a.deferred = []);
5423
+ (_a2 = inst._zod).deferred ?? (_a2.deferred = []);
5493
5424
  inst._zod.deferred?.push(() => {
5494
5425
  inst._zod.run = inst._zod.parse;
5495
5426
  });
@@ -5647,7 +5578,7 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
5647
5578
  code: "invalid_format",
5648
5579
  format: "url",
5649
5580
  note: "Invalid hostname",
5650
- pattern: hostname.source,
5581
+ pattern: def.hostname.source,
5651
5582
  input: payload.value,
5652
5583
  inst,
5653
5584
  continue: !def.abort
@@ -5732,18 +5663,12 @@ var $ZodISODuration = /* @__PURE__ */ $constructor("$ZodISODuration", (inst, def
5732
5663
  var $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def) => {
5733
5664
  def.pattern ?? (def.pattern = ipv42);
5734
5665
  $ZodStringFormat.init(inst, def);
5735
- inst._zod.onattach.push((inst2) => {
5736
- const bag = inst2._zod.bag;
5737
- bag.format = `ipv4`;
5738
- });
5666
+ inst._zod.bag.format = `ipv4`;
5739
5667
  });
5740
5668
  var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
5741
5669
  def.pattern ?? (def.pattern = ipv62);
5742
5670
  $ZodStringFormat.init(inst, def);
5743
- inst._zod.onattach.push((inst2) => {
5744
- const bag = inst2._zod.bag;
5745
- bag.format = `ipv6`;
5746
- });
5671
+ inst._zod.bag.format = `ipv6`;
5747
5672
  inst._zod.check = (payload) => {
5748
5673
  try {
5749
5674
  new URL(`http://[${payload.value}]`);
@@ -5805,9 +5730,7 @@ function isValidBase64(data) {
5805
5730
  var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
5806
5731
  def.pattern ?? (def.pattern = base642);
5807
5732
  $ZodStringFormat.init(inst, def);
5808
- inst._zod.onattach.push((inst2) => {
5809
- inst2._zod.bag.contentEncoding = "base64";
5810
- });
5733
+ inst._zod.bag.contentEncoding = "base64";
5811
5734
  inst._zod.check = (payload) => {
5812
5735
  if (isValidBase64(payload.value))
5813
5736
  return;
@@ -5830,9 +5753,7 @@ function isValidBase64URL(data) {
5830
5753
  var $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => {
5831
5754
  def.pattern ?? (def.pattern = base64url);
5832
5755
  $ZodStringFormat.init(inst, def);
5833
- inst._zod.onattach.push((inst2) => {
5834
- inst2._zod.bag.contentEncoding = "base64url";
5835
- });
5756
+ inst._zod.bag.contentEncoding = "base64url";
5836
5757
  inst._zod.check = (payload) => {
5837
5758
  if (isValidBase64URL(payload.value))
5838
5759
  return;
@@ -5907,7 +5828,7 @@ var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
5907
5828
  return payload;
5908
5829
  };
5909
5830
  });
5910
- var $ZodNumberFormat = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
5831
+ var $ZodNumberFormat = /* @__PURE__ */ $constructor("$ZodNumberFormat", (inst, def) => {
5911
5832
  $ZodCheckNumberFormat.init(inst, def);
5912
5833
  $ZodNumber.init(inst, def);
5913
5834
  });
@@ -6134,7 +6055,7 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
6134
6055
  const keySet = def.keySet;
6135
6056
  const _catchall = def.catchall._zod;
6136
6057
  const t = _catchall.def.type;
6137
- for (const key of Object.keys(input)) {
6058
+ for (const key in input) {
6138
6059
  if (keySet.has(key))
6139
6060
  continue;
6140
6061
  if (t === "never") {
@@ -6164,6 +6085,19 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
6164
6085
  }
6165
6086
  var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
6166
6087
  $ZodType.init(inst, def);
6088
+ const desc = Object.getOwnPropertyDescriptor(def, "shape");
6089
+ if (!desc?.get) {
6090
+ const sh = def.shape;
6091
+ Object.defineProperty(def, "shape", {
6092
+ get: () => {
6093
+ const newSh = { ...sh };
6094
+ Object.defineProperty(def, "shape", {
6095
+ value: newSh
6096
+ });
6097
+ return newSh;
6098
+ }
6099
+ });
6100
+ }
6167
6101
  const _normalized = cached(() => normalizeDef(def));
6168
6102
  defineLazy(inst._zod, "propValues", () => {
6169
6103
  const shape = def.shape;
@@ -6354,6 +6288,7 @@ var $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
6354
6288
  };
6355
6289
  });
6356
6290
  var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnion", (inst, def) => {
6291
+ def.inclusive = false;
6357
6292
  $ZodUnion.init(inst, def);
6358
6293
  const _super = inst._zod.parse;
6359
6294
  defineLazy(inst._zod, "propValues", () => {
@@ -6496,7 +6431,6 @@ function handleIntersectionResults(result, left, right) {
6496
6431
  var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
6497
6432
  $ZodType.init(inst, def);
6498
6433
  const items = def.items;
6499
- const optStart = items.length - [...items].reverse().findIndex((item) => item._zod.optin !== "optional");
6500
6434
  inst._zod.parse = (payload, ctx) => {
6501
6435
  const input = payload.value;
6502
6436
  if (!Array.isArray(input)) {
@@ -6510,6 +6444,8 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
6510
6444
  }
6511
6445
  payload.value = [];
6512
6446
  const proms = [];
6447
+ const reversedIndex = [...items].reverse().findIndex((item) => item._zod.optin !== "optional");
6448
+ const optStart = reversedIndex === -1 ? 0 : items.length - reversedIndex;
6513
6449
  if (!def.rest) {
6514
6450
  const tooBig = input.length > items.length;
6515
6451
  const tooSmall = input.length < optStart - 1;
@@ -6580,11 +6516,13 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
6580
6516
  return payload;
6581
6517
  }
6582
6518
  const proms = [];
6583
- if (def.keyType._zod.values) {
6584
- const values = def.keyType._zod.values;
6519
+ const values = def.keyType._zod.values;
6520
+ if (values) {
6585
6521
  payload.value = {};
6522
+ const recordKeys = /* @__PURE__ */ new Set();
6586
6523
  for (const key of values) {
6587
6524
  if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
6525
+ recordKeys.add(typeof key === "number" ? key.toString() : key);
6588
6526
  const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
6589
6527
  if (result instanceof Promise) {
6590
6528
  proms.push(result.then((result2) => {
@@ -6603,7 +6541,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
6603
6541
  }
6604
6542
  let unrecognized;
6605
6543
  for (const key in input) {
6606
- if (!values.has(key)) {
6544
+ if (!recordKeys.has(key)) {
6607
6545
  unrecognized = unrecognized ?? [];
6608
6546
  unrecognized.push(key);
6609
6547
  }
@@ -6626,15 +6564,18 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
6626
6564
  throw new Error("Async schemas not supported in object keys currently");
6627
6565
  }
6628
6566
  if (keyResult.issues.length) {
6629
- payload.issues.push({
6630
- code: "invalid_key",
6631
- origin: "record",
6632
- issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
6633
- input: key,
6634
- path: [key],
6635
- inst
6636
- });
6637
- payload.value[keyResult.value] = keyResult.value;
6567
+ if (def.mode === "loose") {
6568
+ payload.value[key] = input[key];
6569
+ } else {
6570
+ payload.issues.push({
6571
+ code: "invalid_key",
6572
+ origin: "record",
6573
+ issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
6574
+ input: key,
6575
+ path: [key],
6576
+ inst
6577
+ });
6578
+ }
6638
6579
  continue;
6639
6580
  }
6640
6581
  const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
@@ -6684,11 +6625,12 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
6684
6625
  if (def.values.length === 0) {
6685
6626
  throw new Error("Cannot create literal schema with no valid values");
6686
6627
  }
6687
- inst._zod.values = new Set(def.values);
6628
+ const values = new Set(def.values);
6629
+ inst._zod.values = values;
6688
6630
  inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`);
6689
6631
  inst._zod.parse = (payload, _ctx) => {
6690
6632
  const input = payload.value;
6691
- if (inst._zod.values.has(input)) {
6633
+ if (values.has(input)) {
6692
6634
  return payload;
6693
6635
  }
6694
6636
  payload.issues.push({
@@ -6904,8 +6846,8 @@ var $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => {
6904
6846
  $ZodType.init(inst, def);
6905
6847
  defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
6906
6848
  defineLazy(inst._zod, "values", () => def.innerType._zod.values);
6907
- defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
6908
- defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
6849
+ defineLazy(inst._zod, "optin", () => def.innerType?._zod?.optin);
6850
+ defineLazy(inst._zod, "optout", () => def.innerType?._zod?.optout);
6909
6851
  inst._zod.parse = (payload, ctx) => {
6910
6852
  if (ctx.direction === "backward") {
6911
6853
  return def.innerType._zod.run(payload, ctx);
@@ -6962,21 +6904,20 @@ function handleRefineResult(result, payload, input, inst) {
6962
6904
  }
6963
6905
 
6964
6906
  // node_modules/zod/v4/core/registries.js
6965
- var $output = Symbol("ZodOutput");
6966
- var $input = Symbol("ZodInput");
6907
+ var _a;
6967
6908
  var $ZodRegistry = class {
6968
6909
  constructor() {
6969
6910
  this._map = /* @__PURE__ */ new WeakMap();
6970
6911
  this._idmap = /* @__PURE__ */ new Map();
6971
6912
  }
6972
6913
  add(schema, ..._meta) {
6973
- const meta = _meta[0];
6974
- this._map.set(schema, meta);
6975
- if (meta && typeof meta === "object" && "id" in meta) {
6976
- if (this._idmap.has(meta.id)) {
6977
- throw new Error(`ID ${meta.id} already exists in the registry`);
6914
+ const meta2 = _meta[0];
6915
+ this._map.set(schema, meta2);
6916
+ if (meta2 && typeof meta2 === "object" && "id" in meta2) {
6917
+ if (this._idmap.has(meta2.id)) {
6918
+ throw new Error(`ID ${meta2.id} already exists in the registry`);
6978
6919
  }
6979
- this._idmap.set(meta.id, schema);
6920
+ this._idmap.set(meta2.id, schema);
6980
6921
  }
6981
6922
  return this;
6982
6923
  }
@@ -6986,9 +6927,9 @@ var $ZodRegistry = class {
6986
6927
  return this;
6987
6928
  }
6988
6929
  remove(schema) {
6989
- const meta = this._map.get(schema);
6990
- if (meta && typeof meta === "object" && "id" in meta) {
6991
- this._idmap.delete(meta.id);
6930
+ const meta2 = this._map.get(schema);
6931
+ if (meta2 && typeof meta2 === "object" && "id" in meta2) {
6932
+ this._idmap.delete(meta2.id);
6992
6933
  }
6993
6934
  this._map.delete(schema);
6994
6935
  return this;
@@ -7010,7 +6951,8 @@ var $ZodRegistry = class {
7010
6951
  function registry() {
7011
6952
  return new $ZodRegistry();
7012
6953
  }
7013
- var globalRegistry = /* @__PURE__ */ registry();
6954
+ (_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
6955
+ var globalRegistry = globalThis.__zod_globalRegistry;
7014
6956
 
7015
6957
  // node_modules/zod/v4/core/api.js
7016
6958
  function _string(Class2, params) {
@@ -7401,6 +7343,9 @@ function _toLowerCase() {
7401
7343
  function _toUpperCase() {
7402
7344
  return _overwrite((input) => input.toUpperCase());
7403
7345
  }
7346
+ function _slugify() {
7347
+ return _overwrite((input) => slugify(input));
7348
+ }
7404
7349
  function _array(Class2, element, params) {
7405
7350
  return new Class2({
7406
7351
  type: "array",
@@ -7449,6 +7394,701 @@ function _check(fn, params) {
7449
7394
  return ch;
7450
7395
  }
7451
7396
 
7397
+ // node_modules/zod/v4/core/to-json-schema.js
7398
+ function initializeContext(params) {
7399
+ let target = params?.target ?? "draft-2020-12";
7400
+ if (target === "draft-4")
7401
+ target = "draft-04";
7402
+ if (target === "draft-7")
7403
+ target = "draft-07";
7404
+ return {
7405
+ processors: params.processors ?? {},
7406
+ metadataRegistry: params?.metadata ?? globalRegistry,
7407
+ target,
7408
+ unrepresentable: params?.unrepresentable ?? "throw",
7409
+ override: params?.override ?? (() => {
7410
+ }),
7411
+ io: params?.io ?? "output",
7412
+ counter: 0,
7413
+ seen: /* @__PURE__ */ new Map(),
7414
+ cycles: params?.cycles ?? "ref",
7415
+ reused: params?.reused ?? "inline",
7416
+ external: params?.external ?? void 0
7417
+ };
7418
+ }
7419
+ function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
7420
+ var _a2;
7421
+ const def = schema._zod.def;
7422
+ const seen = ctx.seen.get(schema);
7423
+ if (seen) {
7424
+ seen.count++;
7425
+ const isCycle = _params.schemaPath.includes(schema);
7426
+ if (isCycle) {
7427
+ seen.cycle = _params.path;
7428
+ }
7429
+ return seen.schema;
7430
+ }
7431
+ const result = { schema: {}, count: 1, cycle: void 0, path: _params.path };
7432
+ ctx.seen.set(schema, result);
7433
+ const overrideSchema = schema._zod.toJSONSchema?.();
7434
+ if (overrideSchema) {
7435
+ result.schema = overrideSchema;
7436
+ } else {
7437
+ const params = {
7438
+ ..._params,
7439
+ schemaPath: [..._params.schemaPath, schema],
7440
+ path: _params.path
7441
+ };
7442
+ const parent = schema._zod.parent;
7443
+ if (parent) {
7444
+ result.ref = parent;
7445
+ process2(parent, ctx, params);
7446
+ ctx.seen.get(parent).isParent = true;
7447
+ } else if (schema._zod.processJSONSchema) {
7448
+ schema._zod.processJSONSchema(ctx, result.schema, params);
7449
+ } else {
7450
+ const _json = result.schema;
7451
+ const processor = ctx.processors[def.type];
7452
+ if (!processor) {
7453
+ throw new Error(`[toJSONSchema]: Non-representable type encountered: ${def.type}`);
7454
+ }
7455
+ processor(schema, ctx, _json, params);
7456
+ }
7457
+ }
7458
+ const meta2 = ctx.metadataRegistry.get(schema);
7459
+ if (meta2)
7460
+ Object.assign(result.schema, meta2);
7461
+ if (ctx.io === "input" && isTransforming(schema)) {
7462
+ delete result.schema.examples;
7463
+ delete result.schema.default;
7464
+ }
7465
+ if (ctx.io === "input" && result.schema._prefault)
7466
+ (_a2 = result.schema).default ?? (_a2.default = result.schema._prefault);
7467
+ delete result.schema._prefault;
7468
+ const _result = ctx.seen.get(schema);
7469
+ return _result.schema;
7470
+ }
7471
+ function extractDefs(ctx, schema) {
7472
+ const root = ctx.seen.get(schema);
7473
+ if (!root)
7474
+ throw new Error("Unprocessed schema. This is a bug in Zod.");
7475
+ const makeURI = (entry) => {
7476
+ const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
7477
+ if (ctx.external) {
7478
+ const externalId = ctx.external.registry.get(entry[0])?.id;
7479
+ const uriGenerator = ctx.external.uri ?? ((id2) => id2);
7480
+ if (externalId) {
7481
+ return { ref: uriGenerator(externalId) };
7482
+ }
7483
+ const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
7484
+ entry[1].defId = id;
7485
+ return { defId: id, ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}` };
7486
+ }
7487
+ if (entry[1] === root) {
7488
+ return { ref: "#" };
7489
+ }
7490
+ const uriPrefix = `#`;
7491
+ const defUriPrefix = `${uriPrefix}/${defsSegment}/`;
7492
+ const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`;
7493
+ return { defId, ref: defUriPrefix + defId };
7494
+ };
7495
+ const extractToDef = (entry) => {
7496
+ if (entry[1].schema.$ref) {
7497
+ return;
7498
+ }
7499
+ const seen = entry[1];
7500
+ const { ref, defId } = makeURI(entry);
7501
+ seen.def = { ...seen.schema };
7502
+ if (defId)
7503
+ seen.defId = defId;
7504
+ const schema2 = seen.schema;
7505
+ for (const key in schema2) {
7506
+ delete schema2[key];
7507
+ }
7508
+ schema2.$ref = ref;
7509
+ };
7510
+ if (ctx.cycles === "throw") {
7511
+ for (const entry of ctx.seen.entries()) {
7512
+ const seen = entry[1];
7513
+ if (seen.cycle) {
7514
+ throw new Error(`Cycle detected: #/${seen.cycle?.join("/")}/<root>
7515
+
7516
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
7517
+ }
7518
+ }
7519
+ }
7520
+ for (const entry of ctx.seen.entries()) {
7521
+ const seen = entry[1];
7522
+ if (schema === entry[0]) {
7523
+ extractToDef(entry);
7524
+ continue;
7525
+ }
7526
+ if (ctx.external) {
7527
+ const ext = ctx.external.registry.get(entry[0])?.id;
7528
+ if (schema !== entry[0] && ext) {
7529
+ extractToDef(entry);
7530
+ continue;
7531
+ }
7532
+ }
7533
+ const id = ctx.metadataRegistry.get(entry[0])?.id;
7534
+ if (id) {
7535
+ extractToDef(entry);
7536
+ continue;
7537
+ }
7538
+ if (seen.cycle) {
7539
+ extractToDef(entry);
7540
+ continue;
7541
+ }
7542
+ if (seen.count > 1) {
7543
+ if (ctx.reused === "ref") {
7544
+ extractToDef(entry);
7545
+ continue;
7546
+ }
7547
+ }
7548
+ }
7549
+ }
7550
+ function finalize(ctx, schema) {
7551
+ const root = ctx.seen.get(schema);
7552
+ if (!root)
7553
+ throw new Error("Unprocessed schema. This is a bug in Zod.");
7554
+ const flattenRef = (zodSchema) => {
7555
+ const seen = ctx.seen.get(zodSchema);
7556
+ const schema2 = seen.def ?? seen.schema;
7557
+ const _cached = { ...schema2 };
7558
+ if (seen.ref === null) {
7559
+ return;
7560
+ }
7561
+ const ref = seen.ref;
7562
+ seen.ref = null;
7563
+ if (ref) {
7564
+ flattenRef(ref);
7565
+ const refSchema = ctx.seen.get(ref).schema;
7566
+ if (refSchema.$ref && (ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0")) {
7567
+ schema2.allOf = schema2.allOf ?? [];
7568
+ schema2.allOf.push(refSchema);
7569
+ } else {
7570
+ Object.assign(schema2, refSchema);
7571
+ Object.assign(schema2, _cached);
7572
+ }
7573
+ }
7574
+ if (!seen.isParent)
7575
+ ctx.override({
7576
+ zodSchema,
7577
+ jsonSchema: schema2,
7578
+ path: seen.path ?? []
7579
+ });
7580
+ };
7581
+ for (const entry of [...ctx.seen.entries()].reverse()) {
7582
+ flattenRef(entry[0]);
7583
+ }
7584
+ const result = {};
7585
+ if (ctx.target === "draft-2020-12") {
7586
+ result.$schema = "https://json-schema.org/draft/2020-12/schema";
7587
+ } else if (ctx.target === "draft-07") {
7588
+ result.$schema = "http://json-schema.org/draft-07/schema#";
7589
+ } else if (ctx.target === "draft-04") {
7590
+ result.$schema = "http://json-schema.org/draft-04/schema#";
7591
+ } else if (ctx.target === "openapi-3.0") {
7592
+ } else {
7593
+ }
7594
+ if (ctx.external?.uri) {
7595
+ const id = ctx.external.registry.get(schema)?.id;
7596
+ if (!id)
7597
+ throw new Error("Schema is missing an `id` property");
7598
+ result.$id = ctx.external.uri(id);
7599
+ }
7600
+ Object.assign(result, root.def ?? root.schema);
7601
+ const defs = ctx.external?.defs ?? {};
7602
+ for (const entry of ctx.seen.entries()) {
7603
+ const seen = entry[1];
7604
+ if (seen.def && seen.defId) {
7605
+ defs[seen.defId] = seen.def;
7606
+ }
7607
+ }
7608
+ if (ctx.external) {
7609
+ } else {
7610
+ if (Object.keys(defs).length > 0) {
7611
+ if (ctx.target === "draft-2020-12") {
7612
+ result.$defs = defs;
7613
+ } else {
7614
+ result.definitions = defs;
7615
+ }
7616
+ }
7617
+ }
7618
+ try {
7619
+ const finalized = JSON.parse(JSON.stringify(result));
7620
+ Object.defineProperty(finalized, "~standard", {
7621
+ value: {
7622
+ ...schema["~standard"],
7623
+ jsonSchema: {
7624
+ input: createStandardJSONSchemaMethod(schema, "input"),
7625
+ output: createStandardJSONSchemaMethod(schema, "output")
7626
+ }
7627
+ },
7628
+ enumerable: false,
7629
+ writable: false
7630
+ });
7631
+ return finalized;
7632
+ } catch (_err) {
7633
+ throw new Error("Error converting schema to JSON.");
7634
+ }
7635
+ }
7636
+ function isTransforming(_schema, _ctx) {
7637
+ const ctx = _ctx ?? { seen: /* @__PURE__ */ new Set() };
7638
+ if (ctx.seen.has(_schema))
7639
+ return false;
7640
+ ctx.seen.add(_schema);
7641
+ const def = _schema._zod.def;
7642
+ if (def.type === "transform")
7643
+ return true;
7644
+ if (def.type === "array")
7645
+ return isTransforming(def.element, ctx);
7646
+ if (def.type === "set")
7647
+ return isTransforming(def.valueType, ctx);
7648
+ if (def.type === "lazy")
7649
+ return isTransforming(def.getter(), ctx);
7650
+ if (def.type === "promise" || def.type === "optional" || def.type === "nonoptional" || def.type === "nullable" || def.type === "readonly" || def.type === "default" || def.type === "prefault") {
7651
+ return isTransforming(def.innerType, ctx);
7652
+ }
7653
+ if (def.type === "intersection") {
7654
+ return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);
7655
+ }
7656
+ if (def.type === "record" || def.type === "map") {
7657
+ return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
7658
+ }
7659
+ if (def.type === "pipe") {
7660
+ return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
7661
+ }
7662
+ if (def.type === "object") {
7663
+ for (const key in def.shape) {
7664
+ if (isTransforming(def.shape[key], ctx))
7665
+ return true;
7666
+ }
7667
+ return false;
7668
+ }
7669
+ if (def.type === "union") {
7670
+ for (const option of def.options) {
7671
+ if (isTransforming(option, ctx))
7672
+ return true;
7673
+ }
7674
+ return false;
7675
+ }
7676
+ if (def.type === "tuple") {
7677
+ for (const item of def.items) {
7678
+ if (isTransforming(item, ctx))
7679
+ return true;
7680
+ }
7681
+ if (def.rest && isTransforming(def.rest, ctx))
7682
+ return true;
7683
+ return false;
7684
+ }
7685
+ return false;
7686
+ }
7687
+ var createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
7688
+ const ctx = initializeContext({ ...params, processors });
7689
+ process2(schema, ctx);
7690
+ extractDefs(ctx, schema);
7691
+ return finalize(ctx, schema);
7692
+ };
7693
+ var createStandardJSONSchemaMethod = (schema, io) => (params) => {
7694
+ const { libraryOptions, target } = params ?? {};
7695
+ const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors: {} });
7696
+ process2(schema, ctx);
7697
+ extractDefs(ctx, schema);
7698
+ return finalize(ctx, schema);
7699
+ };
7700
+
7701
+ // node_modules/zod/v4/core/json-schema-processors.js
7702
+ var formatMap = {
7703
+ guid: "uuid",
7704
+ url: "uri",
7705
+ datetime: "date-time",
7706
+ json_string: "json-string",
7707
+ regex: ""
7708
+ // do not set
7709
+ };
7710
+ var stringProcessor = (schema, ctx, _json, _params) => {
7711
+ const json = _json;
7712
+ json.type = "string";
7713
+ const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
7714
+ if (typeof minimum === "number")
7715
+ json.minLength = minimum;
7716
+ if (typeof maximum === "number")
7717
+ json.maxLength = maximum;
7718
+ if (format) {
7719
+ json.format = formatMap[format] ?? format;
7720
+ if (json.format === "")
7721
+ delete json.format;
7722
+ }
7723
+ if (contentEncoding)
7724
+ json.contentEncoding = contentEncoding;
7725
+ if (patterns && patterns.size > 0) {
7726
+ const regexes = [...patterns];
7727
+ if (regexes.length === 1)
7728
+ json.pattern = regexes[0].source;
7729
+ else if (regexes.length > 1) {
7730
+ json.allOf = [
7731
+ ...regexes.map((regex) => ({
7732
+ ...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
7733
+ pattern: regex.source
7734
+ }))
7735
+ ];
7736
+ }
7737
+ }
7738
+ };
7739
+ var numberProcessor = (schema, ctx, _json, _params) => {
7740
+ const json = _json;
7741
+ const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
7742
+ if (typeof format === "string" && format.includes("int"))
7743
+ json.type = "integer";
7744
+ else
7745
+ json.type = "number";
7746
+ if (typeof exclusiveMinimum === "number") {
7747
+ if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
7748
+ json.minimum = exclusiveMinimum;
7749
+ json.exclusiveMinimum = true;
7750
+ } else {
7751
+ json.exclusiveMinimum = exclusiveMinimum;
7752
+ }
7753
+ }
7754
+ if (typeof minimum === "number") {
7755
+ json.minimum = minimum;
7756
+ if (typeof exclusiveMinimum === "number" && ctx.target !== "draft-04") {
7757
+ if (exclusiveMinimum >= minimum)
7758
+ delete json.minimum;
7759
+ else
7760
+ delete json.exclusiveMinimum;
7761
+ }
7762
+ }
7763
+ if (typeof exclusiveMaximum === "number") {
7764
+ if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
7765
+ json.maximum = exclusiveMaximum;
7766
+ json.exclusiveMaximum = true;
7767
+ } else {
7768
+ json.exclusiveMaximum = exclusiveMaximum;
7769
+ }
7770
+ }
7771
+ if (typeof maximum === "number") {
7772
+ json.maximum = maximum;
7773
+ if (typeof exclusiveMaximum === "number" && ctx.target !== "draft-04") {
7774
+ if (exclusiveMaximum <= maximum)
7775
+ delete json.maximum;
7776
+ else
7777
+ delete json.exclusiveMaximum;
7778
+ }
7779
+ }
7780
+ if (typeof multipleOf === "number")
7781
+ json.multipleOf = multipleOf;
7782
+ };
7783
+ var booleanProcessor = (_schema, _ctx, json, _params) => {
7784
+ json.type = "boolean";
7785
+ };
7786
+ var bigintProcessor = (_schema, ctx, _json, _params) => {
7787
+ if (ctx.unrepresentable === "throw") {
7788
+ throw new Error("BigInt cannot be represented in JSON Schema");
7789
+ }
7790
+ };
7791
+ var symbolProcessor = (_schema, ctx, _json, _params) => {
7792
+ if (ctx.unrepresentable === "throw") {
7793
+ throw new Error("Symbols cannot be represented in JSON Schema");
7794
+ }
7795
+ };
7796
+ var nullProcessor = (_schema, ctx, json, _params) => {
7797
+ if (ctx.target === "openapi-3.0") {
7798
+ json.type = "string";
7799
+ json.nullable = true;
7800
+ json.enum = [null];
7801
+ } else {
7802
+ json.type = "null";
7803
+ }
7804
+ };
7805
+ var undefinedProcessor = (_schema, ctx, _json, _params) => {
7806
+ if (ctx.unrepresentable === "throw") {
7807
+ throw new Error("Undefined cannot be represented in JSON Schema");
7808
+ }
7809
+ };
7810
+ var voidProcessor = (_schema, ctx, _json, _params) => {
7811
+ if (ctx.unrepresentable === "throw") {
7812
+ throw new Error("Void cannot be represented in JSON Schema");
7813
+ }
7814
+ };
7815
+ var neverProcessor = (_schema, _ctx, json, _params) => {
7816
+ json.not = {};
7817
+ };
7818
+ var anyProcessor = (_schema, _ctx, _json, _params) => {
7819
+ };
7820
+ var unknownProcessor = (_schema, _ctx, _json, _params) => {
7821
+ };
7822
+ var dateProcessor = (_schema, ctx, _json, _params) => {
7823
+ if (ctx.unrepresentable === "throw") {
7824
+ throw new Error("Date cannot be represented in JSON Schema");
7825
+ }
7826
+ };
7827
+ var enumProcessor = (schema, _ctx, json, _params) => {
7828
+ const def = schema._zod.def;
7829
+ const values = getEnumValues(def.entries);
7830
+ if (values.every((v) => typeof v === "number"))
7831
+ json.type = "number";
7832
+ if (values.every((v) => typeof v === "string"))
7833
+ json.type = "string";
7834
+ json.enum = values;
7835
+ };
7836
+ var literalProcessor = (schema, ctx, json, _params) => {
7837
+ const def = schema._zod.def;
7838
+ const vals = [];
7839
+ for (const val of def.values) {
7840
+ if (val === void 0) {
7841
+ if (ctx.unrepresentable === "throw") {
7842
+ throw new Error("Literal `undefined` cannot be represented in JSON Schema");
7843
+ } else {
7844
+ }
7845
+ } else if (typeof val === "bigint") {
7846
+ if (ctx.unrepresentable === "throw") {
7847
+ throw new Error("BigInt literals cannot be represented in JSON Schema");
7848
+ } else {
7849
+ vals.push(Number(val));
7850
+ }
7851
+ } else {
7852
+ vals.push(val);
7853
+ }
7854
+ }
7855
+ if (vals.length === 0) {
7856
+ } else if (vals.length === 1) {
7857
+ const val = vals[0];
7858
+ json.type = val === null ? "null" : typeof val;
7859
+ if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
7860
+ json.enum = [val];
7861
+ } else {
7862
+ json.const = val;
7863
+ }
7864
+ } else {
7865
+ if (vals.every((v) => typeof v === "number"))
7866
+ json.type = "number";
7867
+ if (vals.every((v) => typeof v === "string"))
7868
+ json.type = "string";
7869
+ if (vals.every((v) => typeof v === "boolean"))
7870
+ json.type = "boolean";
7871
+ if (vals.every((v) => v === null))
7872
+ json.type = "null";
7873
+ json.enum = vals;
7874
+ }
7875
+ };
7876
+ var customProcessor = (_schema, ctx, _json, _params) => {
7877
+ if (ctx.unrepresentable === "throw") {
7878
+ throw new Error("Custom types cannot be represented in JSON Schema");
7879
+ }
7880
+ };
7881
+ var transformProcessor = (_schema, ctx, _json, _params) => {
7882
+ if (ctx.unrepresentable === "throw") {
7883
+ throw new Error("Transforms cannot be represented in JSON Schema");
7884
+ }
7885
+ };
7886
+ var arrayProcessor = (schema, ctx, _json, params) => {
7887
+ const json = _json;
7888
+ const def = schema._zod.def;
7889
+ const { minimum, maximum } = schema._zod.bag;
7890
+ if (typeof minimum === "number")
7891
+ json.minItems = minimum;
7892
+ if (typeof maximum === "number")
7893
+ json.maxItems = maximum;
7894
+ json.type = "array";
7895
+ json.items = process2(def.element, ctx, { ...params, path: [...params.path, "items"] });
7896
+ };
7897
+ var objectProcessor = (schema, ctx, _json, params) => {
7898
+ const json = _json;
7899
+ const def = schema._zod.def;
7900
+ json.type = "object";
7901
+ json.properties = {};
7902
+ const shape = def.shape;
7903
+ for (const key in shape) {
7904
+ json.properties[key] = process2(shape[key], ctx, {
7905
+ ...params,
7906
+ path: [...params.path, "properties", key]
7907
+ });
7908
+ }
7909
+ const allKeys = new Set(Object.keys(shape));
7910
+ const requiredKeys = new Set([...allKeys].filter((key) => {
7911
+ const v = def.shape[key]._zod;
7912
+ if (ctx.io === "input") {
7913
+ return v.optin === void 0;
7914
+ } else {
7915
+ return v.optout === void 0;
7916
+ }
7917
+ }));
7918
+ if (requiredKeys.size > 0) {
7919
+ json.required = Array.from(requiredKeys);
7920
+ }
7921
+ if (def.catchall?._zod.def.type === "never") {
7922
+ json.additionalProperties = false;
7923
+ } else if (!def.catchall) {
7924
+ if (ctx.io === "output")
7925
+ json.additionalProperties = false;
7926
+ } else if (def.catchall) {
7927
+ json.additionalProperties = process2(def.catchall, ctx, {
7928
+ ...params,
7929
+ path: [...params.path, "additionalProperties"]
7930
+ });
7931
+ }
7932
+ };
7933
+ var unionProcessor = (schema, ctx, json, params) => {
7934
+ const def = schema._zod.def;
7935
+ const isExclusive = def.inclusive === false;
7936
+ const options = def.options.map((x, i) => process2(x, ctx, {
7937
+ ...params,
7938
+ path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
7939
+ }));
7940
+ if (isExclusive) {
7941
+ json.oneOf = options;
7942
+ } else {
7943
+ json.anyOf = options;
7944
+ }
7945
+ };
7946
+ var intersectionProcessor = (schema, ctx, json, params) => {
7947
+ const def = schema._zod.def;
7948
+ const a = process2(def.left, ctx, {
7949
+ ...params,
7950
+ path: [...params.path, "allOf", 0]
7951
+ });
7952
+ const b = process2(def.right, ctx, {
7953
+ ...params,
7954
+ path: [...params.path, "allOf", 1]
7955
+ });
7956
+ const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
7957
+ const allOf = [
7958
+ ...isSimpleIntersection(a) ? a.allOf : [a],
7959
+ ...isSimpleIntersection(b) ? b.allOf : [b]
7960
+ ];
7961
+ json.allOf = allOf;
7962
+ };
7963
+ var tupleProcessor = (schema, ctx, _json, params) => {
7964
+ const json = _json;
7965
+ const def = schema._zod.def;
7966
+ json.type = "array";
7967
+ const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
7968
+ const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
7969
+ const prefixItems = def.items.map((x, i) => process2(x, ctx, {
7970
+ ...params,
7971
+ path: [...params.path, prefixPath, i]
7972
+ }));
7973
+ const rest = def.rest ? process2(def.rest, ctx, {
7974
+ ...params,
7975
+ path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []]
7976
+ }) : null;
7977
+ if (ctx.target === "draft-2020-12") {
7978
+ json.prefixItems = prefixItems;
7979
+ if (rest) {
7980
+ json.items = rest;
7981
+ }
7982
+ } else if (ctx.target === "openapi-3.0") {
7983
+ json.items = {
7984
+ anyOf: prefixItems
7985
+ };
7986
+ if (rest) {
7987
+ json.items.anyOf.push(rest);
7988
+ }
7989
+ json.minItems = prefixItems.length;
7990
+ if (!rest) {
7991
+ json.maxItems = prefixItems.length;
7992
+ }
7993
+ } else {
7994
+ json.items = prefixItems;
7995
+ if (rest) {
7996
+ json.additionalItems = rest;
7997
+ }
7998
+ }
7999
+ const { minimum, maximum } = schema._zod.bag;
8000
+ if (typeof minimum === "number")
8001
+ json.minItems = minimum;
8002
+ if (typeof maximum === "number")
8003
+ json.maxItems = maximum;
8004
+ };
8005
+ var recordProcessor = (schema, ctx, _json, params) => {
8006
+ const json = _json;
8007
+ const def = schema._zod.def;
8008
+ json.type = "object";
8009
+ if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
8010
+ json.propertyNames = process2(def.keyType, ctx, {
8011
+ ...params,
8012
+ path: [...params.path, "propertyNames"]
8013
+ });
8014
+ }
8015
+ json.additionalProperties = process2(def.valueType, ctx, {
8016
+ ...params,
8017
+ path: [...params.path, "additionalProperties"]
8018
+ });
8019
+ };
8020
+ var nullableProcessor = (schema, ctx, json, params) => {
8021
+ const def = schema._zod.def;
8022
+ const inner = process2(def.innerType, ctx, params);
8023
+ const seen = ctx.seen.get(schema);
8024
+ if (ctx.target === "openapi-3.0") {
8025
+ seen.ref = def.innerType;
8026
+ json.nullable = true;
8027
+ } else {
8028
+ json.anyOf = [inner, { type: "null" }];
8029
+ }
8030
+ };
8031
+ var nonoptionalProcessor = (schema, ctx, _json, params) => {
8032
+ const def = schema._zod.def;
8033
+ process2(def.innerType, ctx, params);
8034
+ const seen = ctx.seen.get(schema);
8035
+ seen.ref = def.innerType;
8036
+ };
8037
+ var defaultProcessor = (schema, ctx, json, params) => {
8038
+ const def = schema._zod.def;
8039
+ process2(def.innerType, ctx, params);
8040
+ const seen = ctx.seen.get(schema);
8041
+ seen.ref = def.innerType;
8042
+ json.default = JSON.parse(JSON.stringify(def.defaultValue));
8043
+ };
8044
+ var prefaultProcessor = (schema, ctx, json, params) => {
8045
+ const def = schema._zod.def;
8046
+ process2(def.innerType, ctx, params);
8047
+ const seen = ctx.seen.get(schema);
8048
+ seen.ref = def.innerType;
8049
+ if (ctx.io === "input")
8050
+ json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
8051
+ };
8052
+ var catchProcessor = (schema, ctx, json, params) => {
8053
+ const def = schema._zod.def;
8054
+ process2(def.innerType, ctx, params);
8055
+ const seen = ctx.seen.get(schema);
8056
+ seen.ref = def.innerType;
8057
+ let catchValue;
8058
+ try {
8059
+ catchValue = def.catchValue(void 0);
8060
+ } catch {
8061
+ throw new Error("Dynamic catch values are not supported in JSON Schema");
8062
+ }
8063
+ json.default = catchValue;
8064
+ };
8065
+ var pipeProcessor = (schema, ctx, _json, params) => {
8066
+ const def = schema._zod.def;
8067
+ const innerType = ctx.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
8068
+ process2(innerType, ctx, params);
8069
+ const seen = ctx.seen.get(schema);
8070
+ seen.ref = innerType;
8071
+ };
8072
+ var readonlyProcessor = (schema, ctx, json, params) => {
8073
+ const def = schema._zod.def;
8074
+ process2(def.innerType, ctx, params);
8075
+ const seen = ctx.seen.get(schema);
8076
+ seen.ref = def.innerType;
8077
+ json.readOnly = true;
8078
+ };
8079
+ var promiseProcessor = (schema, ctx, _json, params) => {
8080
+ const def = schema._zod.def;
8081
+ process2(def.innerType, ctx, params);
8082
+ const seen = ctx.seen.get(schema);
8083
+ seen.ref = def.innerType;
8084
+ };
8085
+ var optionalProcessor = (schema, ctx, _json, params) => {
8086
+ const def = schema._zod.def;
8087
+ process2(def.innerType, ctx, params);
8088
+ const seen = ctx.seen.get(schema);
8089
+ seen.ref = def.innerType;
8090
+ };
8091
+
7452
8092
  // node_modules/zod/v4/classic/iso.js
7453
8093
  var ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => {
7454
8094
  $ZodISODateTime.init(inst, def);
@@ -7536,25 +8176,28 @@ var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
7536
8176
  // node_modules/zod/v4/classic/schemas.js
7537
8177
  var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
7538
8178
  $ZodType.init(inst, def);
8179
+ Object.assign(inst["~standard"], {
8180
+ jsonSchema: {
8181
+ input: createStandardJSONSchemaMethod(inst, "input"),
8182
+ output: createStandardJSONSchemaMethod(inst, "output")
8183
+ }
8184
+ });
8185
+ inst.toJSONSchema = createToJSONSchemaMethod(inst, {});
7539
8186
  inst.def = def;
7540
8187
  inst.type = def.type;
7541
8188
  Object.defineProperty(inst, "_def", { value: def });
7542
8189
  inst.check = (...checks) => {
7543
- return inst.clone(
7544
- {
7545
- ...def,
7546
- checks: [
7547
- ...def.checks ?? [],
7548
- ...checks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
7549
- ]
7550
- }
7551
- // { parent: true }
7552
- );
8190
+ return inst.clone(util_exports.mergeDefs(def, {
8191
+ checks: [
8192
+ ...def.checks ?? [],
8193
+ ...checks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
8194
+ ]
8195
+ }));
7553
8196
  };
7554
8197
  inst.clone = (def2, params) => clone(inst, def2, params);
7555
8198
  inst.brand = () => inst;
7556
- inst.register = ((reg, meta) => {
7557
- reg.add(inst, meta);
8199
+ inst.register = ((reg, meta2) => {
8200
+ reg.add(inst, meta2);
7558
8201
  return inst;
7559
8202
  });
7560
8203
  inst.parse = (data, params) => parse2(inst, data, params, { callee: inst.parse });
@@ -7612,6 +8255,7 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
7612
8255
  var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
7613
8256
  $ZodString.init(inst, def);
7614
8257
  ZodType.init(inst, def);
8258
+ inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json, params);
7615
8259
  const bag = inst._zod.bag;
7616
8260
  inst.format = bag.format ?? null;
7617
8261
  inst.minLength = bag.minimum ?? null;
@@ -7630,6 +8274,7 @@ var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
7630
8274
  inst.normalize = (...args) => inst.check(_normalize(...args));
7631
8275
  inst.toLowerCase = () => inst.check(_toLowerCase());
7632
8276
  inst.toUpperCase = () => inst.check(_toUpperCase());
8277
+ inst.slugify = () => inst.check(_slugify());
7633
8278
  });
7634
8279
  var ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
7635
8280
  $ZodString.init(inst, def);
@@ -7748,6 +8393,7 @@ var ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
7748
8393
  var ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
7749
8394
  $ZodNumber.init(inst, def);
7750
8395
  ZodType.init(inst, def);
8396
+ inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json, params);
7751
8397
  inst.gt = (value, params) => inst.check(_gt(value, params));
7752
8398
  inst.gte = (value, params) => inst.check(_gte(value, params));
7753
8399
  inst.min = (value, params) => inst.check(_gte(value, params));
@@ -7780,10 +8426,12 @@ function int(params) {
7780
8426
  var ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
7781
8427
  $ZodBoolean.init(inst, def);
7782
8428
  ZodType.init(inst, def);
8429
+ inst._zod.processJSONSchema = (ctx, json, params) => booleanProcessor(inst, ctx, json, params);
7783
8430
  });
7784
8431
  var ZodBigInt = /* @__PURE__ */ $constructor("ZodBigInt", (inst, def) => {
7785
8432
  $ZodBigInt.init(inst, def);
7786
8433
  ZodType.init(inst, def);
8434
+ inst._zod.processJSONSchema = (ctx, json, params) => bigintProcessor(inst, ctx, json, params);
7787
8435
  inst.gte = (value, params) => inst.check(_gte(value, params));
7788
8436
  inst.min = (value, params) => inst.check(_gte(value, params));
7789
8437
  inst.gt = (value, params) => inst.check(_gt(value, params));
@@ -7805,22 +8453,27 @@ var ZodBigInt = /* @__PURE__ */ $constructor("ZodBigInt", (inst, def) => {
7805
8453
  var ZodSymbol = /* @__PURE__ */ $constructor("ZodSymbol", (inst, def) => {
7806
8454
  $ZodSymbol.init(inst, def);
7807
8455
  ZodType.init(inst, def);
8456
+ inst._zod.processJSONSchema = (ctx, json, params) => symbolProcessor(inst, ctx, json, params);
7808
8457
  });
7809
8458
  var ZodUndefined = /* @__PURE__ */ $constructor("ZodUndefined", (inst, def) => {
7810
8459
  $ZodUndefined.init(inst, def);
7811
8460
  ZodType.init(inst, def);
8461
+ inst._zod.processJSONSchema = (ctx, json, params) => undefinedProcessor(inst, ctx, json, params);
7812
8462
  });
7813
8463
  var ZodNull = /* @__PURE__ */ $constructor("ZodNull", (inst, def) => {
7814
8464
  $ZodNull.init(inst, def);
7815
8465
  ZodType.init(inst, def);
8466
+ inst._zod.processJSONSchema = (ctx, json, params) => nullProcessor(inst, ctx, json, params);
7816
8467
  });
7817
8468
  var ZodAny = /* @__PURE__ */ $constructor("ZodAny", (inst, def) => {
7818
8469
  $ZodAny.init(inst, def);
7819
8470
  ZodType.init(inst, def);
8471
+ inst._zod.processJSONSchema = (ctx, json, params) => anyProcessor(inst, ctx, json, params);
7820
8472
  });
7821
8473
  var ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
7822
8474
  $ZodUnknown.init(inst, def);
7823
8475
  ZodType.init(inst, def);
8476
+ inst._zod.processJSONSchema = (ctx, json, params) => unknownProcessor(inst, ctx, json, params);
7824
8477
  });
7825
8478
  function unknown() {
7826
8479
  return _unknown(ZodUnknown);
@@ -7828,6 +8481,7 @@ function unknown() {
7828
8481
  var ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => {
7829
8482
  $ZodNever.init(inst, def);
7830
8483
  ZodType.init(inst, def);
8484
+ inst._zod.processJSONSchema = (ctx, json, params) => neverProcessor(inst, ctx, json, params);
7831
8485
  });
7832
8486
  function never(params) {
7833
8487
  return _never(ZodNever, params);
@@ -7835,10 +8489,12 @@ function never(params) {
7835
8489
  var ZodVoid = /* @__PURE__ */ $constructor("ZodVoid", (inst, def) => {
7836
8490
  $ZodVoid.init(inst, def);
7837
8491
  ZodType.init(inst, def);
8492
+ inst._zod.processJSONSchema = (ctx, json, params) => voidProcessor(inst, ctx, json, params);
7838
8493
  });
7839
8494
  var ZodDate = /* @__PURE__ */ $constructor("ZodDate", (inst, def) => {
7840
8495
  $ZodDate.init(inst, def);
7841
8496
  ZodType.init(inst, def);
8497
+ inst._zod.processJSONSchema = (ctx, json, params) => dateProcessor(inst, ctx, json, params);
7842
8498
  inst.min = (value, params) => inst.check(_gte(value, params));
7843
8499
  inst.max = (value, params) => inst.check(_lte(value, params));
7844
8500
  const c = inst._zod.bag;
@@ -7848,6 +8504,7 @@ var ZodDate = /* @__PURE__ */ $constructor("ZodDate", (inst, def) => {
7848
8504
  var ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
7849
8505
  $ZodArray.init(inst, def);
7850
8506
  ZodType.init(inst, def);
8507
+ inst._zod.processJSONSchema = (ctx, json, params) => arrayProcessor(inst, ctx, json, params);
7851
8508
  inst.element = def.element;
7852
8509
  inst.min = (minLength, params) => inst.check(_minLength(minLength, params));
7853
8510
  inst.nonempty = (params) => inst.check(_minLength(1, params));
@@ -7861,7 +8518,10 @@ function array(element, params) {
7861
8518
  var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
7862
8519
  $ZodObjectJIT.init(inst, def);
7863
8520
  ZodType.init(inst, def);
7864
- util_exports.defineLazy(inst, "shape", () => def.shape);
8521
+ inst._zod.processJSONSchema = (ctx, json, params) => objectProcessor(inst, ctx, json, params);
8522
+ util_exports.defineLazy(inst, "shape", () => {
8523
+ return def.shape;
8524
+ });
7865
8525
  inst.keyof = () => _enum(Object.keys(inst._zod.def.shape));
7866
8526
  inst.catchall = (catchall) => inst.clone({ ...inst._zod.def, catchall });
7867
8527
  inst.passthrough = () => inst.clone({ ...inst._zod.def, catchall: unknown() });
@@ -7883,6 +8543,7 @@ var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
7883
8543
  var ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
7884
8544
  $ZodUnion.init(inst, def);
7885
8545
  ZodType.init(inst, def);
8546
+ inst._zod.processJSONSchema = (ctx, json, params) => unionProcessor(inst, ctx, json, params);
7886
8547
  inst.options = def.options;
7887
8548
  });
7888
8549
  function union(options, params) {
@@ -7899,6 +8560,7 @@ var ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("ZodDiscriminatedUnion"
7899
8560
  var ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => {
7900
8561
  $ZodIntersection.init(inst, def);
7901
8562
  ZodType.init(inst, def);
8563
+ inst._zod.processJSONSchema = (ctx, json, params) => intersectionProcessor(inst, ctx, json, params);
7902
8564
  });
7903
8565
  function intersection(left, right) {
7904
8566
  return new ZodIntersection({
@@ -7910,6 +8572,7 @@ function intersection(left, right) {
7910
8572
  var ZodTuple = /* @__PURE__ */ $constructor("ZodTuple", (inst, def) => {
7911
8573
  $ZodTuple.init(inst, def);
7912
8574
  ZodType.init(inst, def);
8575
+ inst._zod.processJSONSchema = (ctx, json, params) => tupleProcessor(inst, ctx, json, params);
7913
8576
  inst.rest = (rest) => inst.clone({
7914
8577
  ...inst._zod.def,
7915
8578
  rest
@@ -7918,12 +8581,14 @@ var ZodTuple = /* @__PURE__ */ $constructor("ZodTuple", (inst, def) => {
7918
8581
  var ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
7919
8582
  $ZodRecord.init(inst, def);
7920
8583
  ZodType.init(inst, def);
8584
+ inst._zod.processJSONSchema = (ctx, json, params) => recordProcessor(inst, ctx, json, params);
7921
8585
  inst.keyType = def.keyType;
7922
8586
  inst.valueType = def.valueType;
7923
8587
  });
7924
8588
  var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
7925
8589
  $ZodEnum.init(inst, def);
7926
8590
  ZodType.init(inst, def);
8591
+ inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json, params);
7927
8592
  inst.enum = def.entries;
7928
8593
  inst.options = Object.values(def.entries);
7929
8594
  const keys = new Set(Object.keys(def.entries));
@@ -7969,6 +8634,7 @@ function _enum(values, params) {
7969
8634
  var ZodLiteral = /* @__PURE__ */ $constructor("ZodLiteral", (inst, def) => {
7970
8635
  $ZodLiteral.init(inst, def);
7971
8636
  ZodType.init(inst, def);
8637
+ inst._zod.processJSONSchema = (ctx, json, params) => literalProcessor(inst, ctx, json, params);
7972
8638
  inst.values = new Set(def.values);
7973
8639
  Object.defineProperty(inst, "value", {
7974
8640
  get() {
@@ -7982,6 +8648,7 @@ var ZodLiteral = /* @__PURE__ */ $constructor("ZodLiteral", (inst, def) => {
7982
8648
  var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
7983
8649
  $ZodTransform.init(inst, def);
7984
8650
  ZodType.init(inst, def);
8651
+ inst._zod.processJSONSchema = (ctx, json, params) => transformProcessor(inst, ctx, json, params);
7985
8652
  inst._zod.parse = (payload, _ctx) => {
7986
8653
  if (_ctx.direction === "backward") {
7987
8654
  throw new $ZodEncodeError(inst.constructor.name);
@@ -8019,6 +8686,7 @@ function transform(fn) {
8019
8686
  var ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => {
8020
8687
  $ZodOptional.init(inst, def);
8021
8688
  ZodType.init(inst, def);
8689
+ inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
8022
8690
  inst.unwrap = () => inst._zod.def.innerType;
8023
8691
  });
8024
8692
  function optional(innerType) {
@@ -8030,6 +8698,7 @@ function optional(innerType) {
8030
8698
  var ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => {
8031
8699
  $ZodNullable.init(inst, def);
8032
8700
  ZodType.init(inst, def);
8701
+ inst._zod.processJSONSchema = (ctx, json, params) => nullableProcessor(inst, ctx, json, params);
8033
8702
  inst.unwrap = () => inst._zod.def.innerType;
8034
8703
  });
8035
8704
  function nullable(innerType) {
@@ -8041,6 +8710,7 @@ function nullable(innerType) {
8041
8710
  var ZodDefault = /* @__PURE__ */ $constructor("ZodDefault", (inst, def) => {
8042
8711
  $ZodDefault.init(inst, def);
8043
8712
  ZodType.init(inst, def);
8713
+ inst._zod.processJSONSchema = (ctx, json, params) => defaultProcessor(inst, ctx, json, params);
8044
8714
  inst.unwrap = () => inst._zod.def.innerType;
8045
8715
  inst.removeDefault = inst.unwrap;
8046
8716
  });
@@ -8056,6 +8726,7 @@ function _default(innerType, defaultValue) {
8056
8726
  var ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => {
8057
8727
  $ZodPrefault.init(inst, def);
8058
8728
  ZodType.init(inst, def);
8729
+ inst._zod.processJSONSchema = (ctx, json, params) => prefaultProcessor(inst, ctx, json, params);
8059
8730
  inst.unwrap = () => inst._zod.def.innerType;
8060
8731
  });
8061
8732
  function prefault(innerType, defaultValue) {
@@ -8070,6 +8741,7 @@ function prefault(innerType, defaultValue) {
8070
8741
  var ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => {
8071
8742
  $ZodNonOptional.init(inst, def);
8072
8743
  ZodType.init(inst, def);
8744
+ inst._zod.processJSONSchema = (ctx, json, params) => nonoptionalProcessor(inst, ctx, json, params);
8073
8745
  inst.unwrap = () => inst._zod.def.innerType;
8074
8746
  });
8075
8747
  function nonoptional(innerType, params) {
@@ -8082,6 +8754,7 @@ function nonoptional(innerType, params) {
8082
8754
  var ZodCatch = /* @__PURE__ */ $constructor("ZodCatch", (inst, def) => {
8083
8755
  $ZodCatch.init(inst, def);
8084
8756
  ZodType.init(inst, def);
8757
+ inst._zod.processJSONSchema = (ctx, json, params) => catchProcessor(inst, ctx, json, params);
8085
8758
  inst.unwrap = () => inst._zod.def.innerType;
8086
8759
  inst.removeCatch = inst.unwrap;
8087
8760
  });
@@ -8095,6 +8768,7 @@ function _catch(innerType, catchValue) {
8095
8768
  var ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => {
8096
8769
  $ZodPipe.init(inst, def);
8097
8770
  ZodType.init(inst, def);
8771
+ inst._zod.processJSONSchema = (ctx, json, params) => pipeProcessor(inst, ctx, json, params);
8098
8772
  inst.in = def.in;
8099
8773
  inst.out = def.out;
8100
8774
  });
@@ -8109,6 +8783,7 @@ function pipe2(in_, out) {
8109
8783
  var ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
8110
8784
  $ZodReadonly.init(inst, def);
8111
8785
  ZodType.init(inst, def);
8786
+ inst._zod.processJSONSchema = (ctx, json, params) => readonlyProcessor(inst, ctx, json, params);
8112
8787
  inst.unwrap = () => inst._zod.def.innerType;
8113
8788
  });
8114
8789
  function readonly(innerType) {
@@ -8120,11 +8795,13 @@ function readonly(innerType) {
8120
8795
  var ZodPromise = /* @__PURE__ */ $constructor("ZodPromise", (inst, def) => {
8121
8796
  $ZodPromise.init(inst, def);
8122
8797
  ZodType.init(inst, def);
8798
+ inst._zod.processJSONSchema = (ctx, json, params) => promiseProcessor(inst, ctx, json, params);
8123
8799
  inst.unwrap = () => inst._zod.def.innerType;
8124
8800
  });
8125
8801
  var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
8126
8802
  $ZodCustom.init(inst, def);
8127
8803
  ZodType.init(inst, def);
8804
+ inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params);
8128
8805
  });
8129
8806
  function refine(fn, _params = {}) {
8130
8807
  return _refine(ZodCustom, fn, _params);