UNPKG

@herd-labs/trails-code-framework

Version:

A package for building Herd-compliant custom Deno scripts used in Herd Trails

1,642 lines (1,633 loc) 415 kB
var __defProp = Object.defineProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true, configurable: true, set: (newValue) => all[name] = () => newValue }); }; // node_modules/zod/v4/classic/external.js var exports_external = {}; __export(exports_external, { xid: () => xid2, void: () => _void2, uuidv7: () => uuidv7, uuidv6: () => uuidv6, uuidv4: () => uuidv4, uuid: () => uuid2, url: () => url, uppercase: () => _uppercase, unknown: () => unknown, union: () => union, undefined: () => _undefined3, ulid: () => ulid2, uint64: () => uint64, uint32: () => uint32, tuple: () => tuple, trim: () => _trim, treeifyError: () => treeifyError, transform: () => transform, toUpperCase: () => _toUpperCase, toLowerCase: () => _toLowerCase, toJSONSchema: () => toJSONSchema, templateLiteral: () => templateLiteral, symbol: () => symbol, superRefine: () => superRefine, success: () => success, stringbool: () => stringbool, stringFormat: () => stringFormat, string: () => string2, strictObject: () => strictObject, startsWith: () => _startsWith, size: () => _size, setErrorMap: () => setErrorMap, set: () => set, safeParseAsync: () => safeParseAsync2, safeParse: () => safeParse2, registry: () => registry, regexes: () => exports_regexes, regex: () => _regex, refine: () => refine, record: () => record, readonly: () => readonly, property: () => _property, promise: () => promise, prettifyError: () => prettifyError, preprocess: () => preprocess, prefault: () => prefault, positive: () => _positive, pipe: () => pipe, partialRecord: () => partialRecord, parseAsync: () => parseAsync2, parse: () => parse3, overwrite: () => _overwrite, optional: () => optional, object: () => object, number: () => number2, nullish: () => nullish2, nullable: () => nullable, null: () => _null3, normalize: () => _normalize, nonpositive: () => _nonpositive, nonoptional: () => nonoptional, nonnegative: () => _nonnegative, never: () => never, negative: () => _negative, nativeEnum: () => nativeEnum, nanoid: () => nanoid2, nan: () => nan, multipleOf: () => _multipleOf, minSize: () => _minSize, minLength: () => _minLength, mime: () => _mime, maxSize: () => _maxSize, maxLength: () => _maxLength, map: () => map, lte: () => _lte, lt: () => _lt, lowercase: () => _lowercase, looseObject: () => looseObject, locales: () => exports_locales, literal: () => literal, length: () => _length, lazy: () => lazy, ksuid: () => ksuid2, keyof: () => keyof, jwt: () => jwt, json: () => json, iso: () => exports_iso, ipv6: () => ipv62, ipv4: () => ipv42, intersection: () => intersection, int64: () => int64, int32: () => int32, int: () => int, instanceof: () => _instanceof, includes: () => _includes, guid: () => guid2, gte: () => _gte, gt: () => _gt, globalRegistry: () => globalRegistry, getErrorMap: () => getErrorMap, function: () => _function, formatError: () => formatError, float64: () => float64, float32: () => float32, flattenError: () => flattenError, file: () => file, enum: () => _enum2, endsWith: () => _endsWith, emoji: () => emoji2, email: () => email2, e164: () => e1642, discriminatedUnion: () => discriminatedUnion, date: () => date3, custom: () => custom, cuid2: () => cuid22, cuid: () => cuid3, core: () => exports_core2, config: () => config, coerce: () => exports_coerce, clone: () => clone, cidrv6: () => cidrv62, cidrv4: () => cidrv42, check: () => check, catch: () => _catch2, boolean: () => boolean2, bigint: () => bigint2, base64url: () => base64url2, base64: () => base642, array: () => array, any: () => any, _default: () => _default2, _ZodString: () => _ZodString, ZodXID: () => ZodXID, ZodVoid: () => ZodVoid, ZodUnknown: () => ZodUnknown, ZodUnion: () => ZodUnion, ZodUndefined: () => ZodUndefined, ZodUUID: () => ZodUUID, ZodURL: () => ZodURL, ZodULID: () => ZodULID, ZodType: () => ZodType, ZodTuple: () => ZodTuple, ZodTransform: () => ZodTransform, ZodTemplateLiteral: () => ZodTemplateLiteral, ZodSymbol: () => ZodSymbol, ZodSuccess: () => ZodSuccess, ZodStringFormat: () => ZodStringFormat, ZodString: () => ZodString, ZodSet: () => ZodSet, ZodRecord: () => ZodRecord, ZodRealError: () => ZodRealError, ZodReadonly: () => ZodReadonly, ZodPromise: () => ZodPromise, ZodPrefault: () => ZodPrefault, ZodPipe: () => ZodPipe, ZodOptional: () => ZodOptional, ZodObject: () => ZodObject, ZodNumberFormat: () => ZodNumberFormat, ZodNumber: () => ZodNumber, ZodNullable: () => ZodNullable, ZodNull: () => ZodNull, ZodNonOptional: () => ZodNonOptional, ZodNever: () => ZodNever, ZodNanoID: () => ZodNanoID, ZodNaN: () => ZodNaN, ZodMap: () => ZodMap, ZodLiteral: () => ZodLiteral, ZodLazy: () => ZodLazy, ZodKSUID: () => ZodKSUID, ZodJWT: () => ZodJWT, ZodIssueCode: () => ZodIssueCode, ZodIntersection: () => ZodIntersection, ZodISOTime: () => ZodISOTime, ZodISODuration: () => ZodISODuration, ZodISODateTime: () => ZodISODateTime, ZodISODate: () => ZodISODate, ZodIPv6: () => ZodIPv6, ZodIPv4: () => ZodIPv4, ZodGUID: () => ZodGUID, ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind, ZodFile: () => ZodFile, ZodError: () => ZodError, ZodEnum: () => ZodEnum, ZodEmoji: () => ZodEmoji, ZodEmail: () => ZodEmail, ZodE164: () => ZodE164, ZodDiscriminatedUnion: () => ZodDiscriminatedUnion, ZodDefault: () => ZodDefault, ZodDate: () => ZodDate, ZodCustomStringFormat: () => ZodCustomStringFormat, ZodCustom: () => ZodCustom, ZodCatch: () => ZodCatch, ZodCUID2: () => ZodCUID2, ZodCUID: () => ZodCUID, ZodCIDRv6: () => ZodCIDRv6, ZodCIDRv4: () => ZodCIDRv4, ZodBoolean: () => ZodBoolean, ZodBigIntFormat: () => ZodBigIntFormat, ZodBigInt: () => ZodBigInt, ZodBase64URL: () => ZodBase64URL, ZodBase64: () => ZodBase64, ZodArray: () => ZodArray, ZodAny: () => ZodAny, TimePrecision: () => TimePrecision, NEVER: () => NEVER, $output: () => $output, $input: () => $input, $brand: () => $brand }); // node_modules/zod/v4/core/index.js var exports_core2 = {}; __export(exports_core2, { version: () => version, util: () => exports_util, treeifyError: () => treeifyError, toJSONSchema: () => toJSONSchema, toDotPath: () => toDotPath, safeParseAsync: () => safeParseAsync, safeParse: () => safeParse, registry: () => registry, regexes: () => exports_regexes, prettifyError: () => prettifyError, parseAsync: () => parseAsync, parse: () => parse, locales: () => exports_locales, isValidJWT: () => isValidJWT, isValidBase64URL: () => isValidBase64URL, isValidBase64: () => isValidBase64, globalRegistry: () => globalRegistry, globalConfig: () => globalConfig, function: () => _function, formatError: () => formatError, flattenError: () => flattenError, config: () => config, clone: () => clone, _xid: () => _xid, _void: () => _void, _uuidv7: () => _uuidv7, _uuidv6: () => _uuidv6, _uuidv4: () => _uuidv4, _uuid: () => _uuid, _url: () => _url, _uppercase: () => _uppercase, _unknown: () => _unknown, _union: () => _union, _undefined: () => _undefined2, _ulid: () => _ulid, _uint64: () => _uint64, _uint32: () => _uint32, _tuple: () => _tuple, _trim: () => _trim, _transform: () => _transform, _toUpperCase: () => _toUpperCase, _toLowerCase: () => _toLowerCase, _templateLiteral: () => _templateLiteral, _symbol: () => _symbol, _success: () => _success, _stringbool: () => _stringbool, _stringFormat: () => _stringFormat, _string: () => _string, _startsWith: () => _startsWith, _size: () => _size, _set: () => _set, _safeParseAsync: () => _safeParseAsync, _safeParse: () => _safeParse, _regex: () => _regex, _refine: () => _refine, _record: () => _record, _readonly: () => _readonly, _property: () => _property, _promise: () => _promise, _positive: () => _positive, _pipe: () => _pipe, _parseAsync: () => _parseAsync, _parse: () => _parse, _overwrite: () => _overwrite, _optional: () => _optional, _number: () => _number, _nullable: () => _nullable, _null: () => _null2, _normalize: () => _normalize, _nonpositive: () => _nonpositive, _nonoptional: () => _nonoptional, _nonnegative: () => _nonnegative, _never: () => _never, _negative: () => _negative, _nativeEnum: () => _nativeEnum, _nanoid: () => _nanoid, _nan: () => _nan, _multipleOf: () => _multipleOf, _minSize: () => _minSize, _minLength: () => _minLength, _min: () => _gte, _mime: () => _mime, _maxSize: () => _maxSize, _maxLength: () => _maxLength, _max: () => _lte, _map: () => _map, _lte: () => _lte, _lt: () => _lt, _lowercase: () => _lowercase, _literal: () => _literal, _length: () => _length, _lazy: () => _lazy, _ksuid: () => _ksuid, _jwt: () => _jwt, _isoTime: () => _isoTime, _isoDuration: () => _isoDuration, _isoDateTime: () => _isoDateTime, _isoDate: () => _isoDate, _ipv6: () => _ipv6, _ipv4: () => _ipv4, _intersection: () => _intersection, _int64: () => _int64, _int32: () => _int32, _int: () => _int, _includes: () => _includes, _guid: () => _guid, _gte: () => _gte, _gt: () => _gt, _float64: () => _float64, _float32: () => _float32, _file: () => _file, _enum: () => _enum, _endsWith: () => _endsWith, _emoji: () => _emoji2, _email: () => _email, _e164: () => _e164, _discriminatedUnion: () => _discriminatedUnion, _default: () => _default, _date: () => _date, _custom: () => _custom, _cuid2: () => _cuid2, _cuid: () => _cuid, _coercedString: () => _coercedString, _coercedNumber: () => _coercedNumber, _coercedDate: () => _coercedDate, _coercedBoolean: () => _coercedBoolean, _coercedBigint: () => _coercedBigint, _cidrv6: () => _cidrv6, _cidrv4: () => _cidrv4, _catch: () => _catch, _boolean: () => _boolean, _bigint: () => _bigint, _base64url: () => _base64url, _base64: () => _base64, _array: () => _array, _any: () => _any, TimePrecision: () => TimePrecision, NEVER: () => NEVER, JSONSchemaGenerator: () => JSONSchemaGenerator, JSONSchema: () => exports_json_schema, Doc: () => Doc, $output: () => $output, $input: () => $input, $constructor: () => $constructor, $brand: () => $brand, $ZodXID: () => $ZodXID, $ZodVoid: () => $ZodVoid, $ZodUnknown: () => $ZodUnknown, $ZodUnion: () => $ZodUnion, $ZodUndefined: () => $ZodUndefined, $ZodUUID: () => $ZodUUID, $ZodURL: () => $ZodURL, $ZodULID: () => $ZodULID, $ZodType: () => $ZodType, $ZodTuple: () => $ZodTuple, $ZodTransform: () => $ZodTransform, $ZodTemplateLiteral: () => $ZodTemplateLiteral, $ZodSymbol: () => $ZodSymbol, $ZodSuccess: () => $ZodSuccess, $ZodStringFormat: () => $ZodStringFormat, $ZodString: () => $ZodString, $ZodSet: () => $ZodSet, $ZodRegistry: () => $ZodRegistry, $ZodRecord: () => $ZodRecord, $ZodRealError: () => $ZodRealError, $ZodReadonly: () => $ZodReadonly, $ZodPromise: () => $ZodPromise, $ZodPrefault: () => $ZodPrefault, $ZodPipe: () => $ZodPipe, $ZodOptional: () => $ZodOptional, $ZodObject: () => $ZodObject, $ZodNumberFormat: () => $ZodNumberFormat, $ZodNumber: () => $ZodNumber, $ZodNullable: () => $ZodNullable, $ZodNull: () => $ZodNull, $ZodNonOptional: () => $ZodNonOptional, $ZodNever: () => $ZodNever, $ZodNanoID: () => $ZodNanoID, $ZodNaN: () => $ZodNaN, $ZodMap: () => $ZodMap, $ZodLiteral: () => $ZodLiteral, $ZodLazy: () => $ZodLazy, $ZodKSUID: () => $ZodKSUID, $ZodJWT: () => $ZodJWT, $ZodIntersection: () => $ZodIntersection, $ZodISOTime: () => $ZodISOTime, $ZodISODuration: () => $ZodISODuration, $ZodISODateTime: () => $ZodISODateTime, $ZodISODate: () => $ZodISODate, $ZodIPv6: () => $ZodIPv6, $ZodIPv4: () => $ZodIPv4, $ZodGUID: () => $ZodGUID, $ZodFunction: () => $ZodFunction, $ZodFile: () => $ZodFile, $ZodError: () => $ZodError, $ZodEnum: () => $ZodEnum, $ZodEmoji: () => $ZodEmoji, $ZodEmail: () => $ZodEmail, $ZodE164: () => $ZodE164, $ZodDiscriminatedUnion: () => $ZodDiscriminatedUnion, $ZodDefault: () => $ZodDefault, $ZodDate: () => $ZodDate, $ZodCustomStringFormat: () => $ZodCustomStringFormat, $ZodCustom: () => $ZodCustom, $ZodCheckUpperCase: () => $ZodCheckUpperCase, $ZodCheckStringFormat: () => $ZodCheckStringFormat, $ZodCheckStartsWith: () => $ZodCheckStartsWith, $ZodCheckSizeEquals: () => $ZodCheckSizeEquals, $ZodCheckRegex: () => $ZodCheckRegex, $ZodCheckProperty: () => $ZodCheckProperty, $ZodCheckOverwrite: () => $ZodCheckOverwrite, $ZodCheckNumberFormat: () => $ZodCheckNumberFormat, $ZodCheckMultipleOf: () => $ZodCheckMultipleOf, $ZodCheckMinSize: () => $ZodCheckMinSize, $ZodCheckMinLength: () => $ZodCheckMinLength, $ZodCheckMimeType: () => $ZodCheckMimeType, $ZodCheckMaxSize: () => $ZodCheckMaxSize, $ZodCheckMaxLength: () => $ZodCheckMaxLength, $ZodCheckLowerCase: () => $ZodCheckLowerCase, $ZodCheckLessThan: () => $ZodCheckLessThan, $ZodCheckLengthEquals: () => $ZodCheckLengthEquals, $ZodCheckIncludes: () => $ZodCheckIncludes, $ZodCheckGreaterThan: () => $ZodCheckGreaterThan, $ZodCheckEndsWith: () => $ZodCheckEndsWith, $ZodCheckBigIntFormat: () => $ZodCheckBigIntFormat, $ZodCheck: () => $ZodCheck, $ZodCatch: () => $ZodCatch, $ZodCUID2: () => $ZodCUID2, $ZodCUID: () => $ZodCUID, $ZodCIDRv6: () => $ZodCIDRv6, $ZodCIDRv4: () => $ZodCIDRv4, $ZodBoolean: () => $ZodBoolean, $ZodBigIntFormat: () => $ZodBigIntFormat, $ZodBigInt: () => $ZodBigInt, $ZodBase64URL: () => $ZodBase64URL, $ZodBase64: () => $ZodBase64, $ZodAsyncError: () => $ZodAsyncError, $ZodArray: () => $ZodArray, $ZodAny: () => $ZodAny }); // node_modules/zod/v4/core/core.js var NEVER = Object.freeze({ status: "aborted" }); function $constructor(name, initializer, params) { function init(inst, def) { var _a; Object.defineProperty(inst, "_zod", { value: inst._zod ?? {}, enumerable: false }); (_a = inst._zod).traits ?? (_a.traits = new Set); inst._zod.traits.add(name); initializer(inst, def); for (const k in _.prototype) { if (!(k in inst)) Object.defineProperty(inst, k, { value: _.prototype[k].bind(inst) }); } inst._zod.constr = _; inst._zod.def = def; } const Parent = params?.Parent ?? Object; class Definition extends Parent { } Object.defineProperty(Definition, "name", { value: name }); function _(def) { var _a; const inst = params?.Parent ? new Definition : this; init(inst, def); (_a = inst._zod).deferred ?? (_a.deferred = []); for (const fn of inst._zod.deferred) { fn(); } return inst; } Object.defineProperty(_, "init", { value: init }); Object.defineProperty(_, Symbol.hasInstance, { value: (inst) => { if (params?.Parent && inst instanceof params.Parent) return true; return inst?._zod?.traits?.has(name); } }); Object.defineProperty(_, "name", { value: name }); return _; } var $brand = Symbol("zod_brand"); class $ZodAsyncError extends Error { constructor() { super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`); } } var globalConfig = {}; function config(newConfig) { if (newConfig) Object.assign(globalConfig, newConfig); return globalConfig; } // node_modules/zod/v4/core/util.js var exports_util = {}; __export(exports_util, { unwrapMessage: () => unwrapMessage, stringifyPrimitive: () => stringifyPrimitive, required: () => required, randomString: () => randomString, propertyKeyTypes: () => propertyKeyTypes, promiseAllObject: () => promiseAllObject, primitiveTypes: () => primitiveTypes, prefixIssues: () => prefixIssues, pick: () => pick, partial: () => partial, optionalKeys: () => optionalKeys, omit: () => omit, numKeys: () => numKeys, nullish: () => nullish, normalizeParams: () => normalizeParams, merge: () => merge, jsonStringifyReplacer: () => jsonStringifyReplacer, joinValues: () => joinValues, issue: () => issue, isPlainObject: () => isPlainObject, isObject: () => isObject, getSizableOrigin: () => getSizableOrigin, getParsedType: () => getParsedType, getLengthableOrigin: () => getLengthableOrigin, getEnumValues: () => getEnumValues, getElementAtPath: () => getElementAtPath, floatSafeRemainder: () => floatSafeRemainder, finalizeIssue: () => finalizeIssue, extend: () => extend, escapeRegex: () => escapeRegex, esc: () => esc, defineLazy: () => defineLazy, createTransparentProxy: () => createTransparentProxy, clone: () => clone, cleanRegex: () => cleanRegex, cleanEnum: () => cleanEnum, captureStackTrace: () => captureStackTrace, cached: () => cached, assignProp: () => assignProp, assertNotEqual: () => assertNotEqual, assertNever: () => assertNever, assertIs: () => assertIs, assertEqual: () => assertEqual, assert: () => assert, allowsEval: () => allowsEval, aborted: () => aborted, NUMBER_FORMAT_RANGES: () => NUMBER_FORMAT_RANGES, Class: () => Class, BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES }); function assertEqual(val) { return val; } function assertNotEqual(val) { return val; } function assertIs(_arg) {} function assertNever(_x) { throw new Error; } function assert(_) {} function getEnumValues(entries) { const numericValues = Object.values(entries).filter((v) => typeof v === "number"); const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v); return values; } function joinValues(array, separator = "|") { return array.map((val) => stringifyPrimitive(val)).join(separator); } function jsonStringifyReplacer(_, value) { if (typeof value === "bigint") return value.toString(); return value; } function cached(getter) { const set = false; return { get value() { if (!set) { const value = getter(); Object.defineProperty(this, "value", { value }); return value; } throw new Error("cached value already set"); } }; } function nullish(input) { return input === null || input === undefined; } function cleanRegex(source) { const start = source.startsWith("^") ? 1 : 0; const end = source.endsWith("$") ? source.length - 1 : source.length; return source.slice(start, end); } function floatSafeRemainder(val, step) { const valDecCount = (val.toString().split(".")[1] || "").length; const stepDecCount = (step.toString().split(".")[1] || "").length; const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount; const valInt = Number.parseInt(val.toFixed(decCount).replace(".", "")); const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", "")); return valInt % stepInt / 10 ** decCount; } function defineLazy(object, key, getter) { const set = false; Object.defineProperty(object, key, { get() { if (!set) { const value = getter(); object[key] = value; return value; } throw new Error("cached value already set"); }, set(v) { Object.defineProperty(object, key, { value: v }); }, configurable: true }); } function assignProp(target, prop, value) { Object.defineProperty(target, prop, { value, writable: true, enumerable: true, configurable: true }); } function getElementAtPath(obj, path) { if (!path) return obj; return path.reduce((acc, key) => acc?.[key], obj); } function promiseAllObject(promisesObj) { const keys = Object.keys(promisesObj); const promises = keys.map((key) => promisesObj[key]); return Promise.all(promises).then((results) => { const resolvedObj = {}; for (let i = 0;i < keys.length; i++) { resolvedObj[keys[i]] = results[i]; } return resolvedObj; }); } function randomString(length = 10) { const chars = "abcdefghijklmnopqrstuvwxyz"; let str = ""; for (let i = 0;i < length; i++) { str += chars[Math.floor(Math.random() * chars.length)]; } return str; } function esc(str) { return JSON.stringify(str); } var captureStackTrace = Error.captureStackTrace ? Error.captureStackTrace : (..._args) => {}; function isObject(data) { return typeof data === "object" && data !== null && !Array.isArray(data); } var allowsEval = cached(() => { if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) { return false; } try { const F = Function; new F(""); return true; } catch (_) { return false; } }); function isPlainObject(o) { if (isObject(o) === false) return false; const ctor = o.constructor; if (ctor === undefined) return true; const prot = ctor.prototype; if (isObject(prot) === false) return false; if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) { return false; } return true; } function numKeys(data) { let keyCount = 0; for (const key in data) { if (Object.prototype.hasOwnProperty.call(data, key)) { keyCount++; } } return keyCount; } var getParsedType = (data) => { const t = typeof data; switch (t) { case "undefined": return "undefined"; case "string": return "string"; case "number": return Number.isNaN(data) ? "nan" : "number"; case "boolean": return "boolean"; case "function": return "function"; case "bigint": return "bigint"; case "symbol": return "symbol"; case "object": if (Array.isArray(data)) { return "array"; } if (data === null) { return "null"; } if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") { return "promise"; } if (typeof Map !== "undefined" && data instanceof Map) { return "map"; } if (typeof Set !== "undefined" && data instanceof Set) { return "set"; } if (typeof Date !== "undefined" && data instanceof Date) { return "date"; } if (typeof File !== "undefined" && data instanceof File) { return "file"; } return "object"; default: throw new Error(`Unknown data type: ${t}`); } }; var propertyKeyTypes = new Set(["string", "number", "symbol"]); var primitiveTypes = new Set(["string", "number", "bigint", "boolean", "symbol", "undefined"]); function escapeRegex(str) { return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); } function clone(inst, def, params) { const cl = new inst._zod.constr(def ?? inst._zod.def); if (!def || params?.parent) cl._zod.parent = inst; return cl; } function normalizeParams(_params) { const params = _params; if (!params) return {}; if (typeof params === "string") return { error: () => params }; if (params?.message !== undefined) { if (params?.error !== undefined) throw new Error("Cannot specify both `message` and `error` params"); params.error = params.message; } delete params.message; if (typeof params.error === "string") return { ...params, error: () => params.error }; return params; } function createTransparentProxy(getter) { let target; return new Proxy({}, { get(_, prop, receiver) { target ?? (target = getter()); return Reflect.get(target, prop, receiver); }, set(_, prop, value, receiver) { target ?? (target = getter()); return Reflect.set(target, prop, value, receiver); }, has(_, prop) { target ?? (target = getter()); return Reflect.has(target, prop); }, deleteProperty(_, prop) { target ?? (target = getter()); return Reflect.deleteProperty(target, prop); }, ownKeys(_) { target ?? (target = getter()); return Reflect.ownKeys(target); }, getOwnPropertyDescriptor(_, prop) { target ?? (target = getter()); return Reflect.getOwnPropertyDescriptor(target, prop); }, defineProperty(_, prop, descriptor) { target ?? (target = getter()); return Reflect.defineProperty(target, prop, descriptor); } }); } function stringifyPrimitive(value) { if (typeof value === "bigint") return value.toString() + "n"; if (typeof value === "string") return `"${value}"`; return `${value}`; } function optionalKeys(shape) { return Object.keys(shape).filter((k) => { return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional"; }); } var NUMBER_FORMAT_RANGES = { safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER], int32: [-2147483648, 2147483647], uint32: [0, 4294967295], float32: [-340282346638528860000000000000000000000, 340282346638528860000000000000000000000], float64: [-Number.MAX_VALUE, Number.MAX_VALUE] }; var BIGINT_FORMAT_RANGES = { int64: [/* @__PURE__ */ BigInt("-9223372036854775808"), /* @__PURE__ */ BigInt("9223372036854775807")], uint64: [/* @__PURE__ */ BigInt(0), /* @__PURE__ */ BigInt("18446744073709551615")] }; function pick(schema, mask) { const newShape = {}; const currDef = schema._zod.def; for (const key in mask) { if (!(key in currDef.shape)) { throw new Error(`Unrecognized key: "${key}"`); } if (!mask[key]) continue; newShape[key] = currDef.shape[key]; } return clone(schema, { ...schema._zod.def, shape: newShape, checks: [] }); } function omit(schema, mask) { const newShape = { ...schema._zod.def.shape }; const currDef = schema._zod.def; for (const key in mask) { if (!(key in currDef.shape)) { throw new Error(`Unrecognized key: "${key}"`); } if (!mask[key]) continue; delete newShape[key]; } return clone(schema, { ...schema._zod.def, shape: newShape, checks: [] }); } function extend(schema, shape) { if (!isPlainObject(shape)) { throw new Error("Invalid input to extend: expected a plain object"); } const def = { ...schema._zod.def, get shape() { const _shape = { ...schema._zod.def.shape, ...shape }; assignProp(this, "shape", _shape); return _shape; }, checks: [] }; return clone(schema, def); } function merge(a, b) { return clone(a, { ...a._zod.def, get shape() { const _shape = { ...a._zod.def.shape, ...b._zod.def.shape }; assignProp(this, "shape", _shape); return _shape; }, catchall: b._zod.def.catchall, checks: [] }); } function partial(Class, schema, mask) { const oldShape = schema._zod.def.shape; const shape = { ...oldShape }; if (mask) { for (const key in mask) { if (!(key in oldShape)) { throw new Error(`Unrecognized key: "${key}"`); } if (!mask[key]) continue; shape[key] = Class ? new Class({ type: "optional", innerType: oldShape[key] }) : oldShape[key]; } } else { for (const key in oldShape) { shape[key] = Class ? new Class({ type: "optional", innerType: oldShape[key] }) : oldShape[key]; } } return clone(schema, { ...schema._zod.def, shape, checks: [] }); } function required(Class, schema, mask) { const oldShape = schema._zod.def.shape; const shape = { ...oldShape }; if (mask) { for (const key in mask) { if (!(key in shape)) { throw new Error(`Unrecognized key: "${key}"`); } if (!mask[key]) continue; shape[key] = new Class({ type: "nonoptional", innerType: oldShape[key] }); } } else { for (const key in oldShape) { shape[key] = new Class({ type: "nonoptional", innerType: oldShape[key] }); } } return clone(schema, { ...schema._zod.def, shape, checks: [] }); } function aborted(x, startIndex = 0) { for (let i = startIndex;i < x.issues.length; i++) { if (x.issues[i]?.continue !== true) return true; } return false; } function prefixIssues(path, issues) { return issues.map((iss) => { var _a; (_a = iss).path ?? (_a.path = []); iss.path.unshift(path); return iss; }); } function unwrapMessage(message) { return typeof message === "string" ? message : message?.message; } function finalizeIssue(iss, ctx, config2) { const full = { ...iss, path: iss.path ?? [] }; if (!iss.message) { const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input"; full.message = message; } delete full.inst; delete full.continue; if (!ctx?.reportInput) { delete full.input; } return full; } function getSizableOrigin(input) { if (input instanceof Set) return "set"; if (input instanceof Map) return "map"; if (input instanceof File) return "file"; return "unknown"; } function getLengthableOrigin(input) { if (Array.isArray(input)) return "array"; if (typeof input === "string") return "string"; return "unknown"; } function issue(...args) { const [iss, input, inst] = args; if (typeof iss === "string") { return { message: iss, code: "custom", input, inst }; } return { ...iss }; } function cleanEnum(obj) { return Object.entries(obj).filter(([k, _]) => { return Number.isNaN(Number.parseInt(k, 10)); }).map((el) => el[1]); } class Class { constructor(..._args) {} } // node_modules/zod/v4/core/errors.js var initializer = (inst, def) => { inst.name = "$ZodError"; Object.defineProperty(inst, "_zod", { value: inst._zod, enumerable: false }); Object.defineProperty(inst, "issues", { value: def, enumerable: false }); Object.defineProperty(inst, "message", { get() { return JSON.stringify(def, jsonStringifyReplacer, 2); }, enumerable: true }); Object.defineProperty(inst, "toString", { value: () => inst.message, enumerable: false }); }; var $ZodError = $constructor("$ZodError", initializer); var $ZodRealError = $constructor("$ZodError", initializer, { Parent: Error }); function flattenError(error, mapper = (issue2) => issue2.message) { const fieldErrors = {}; const formErrors = []; for (const sub of error.issues) { if (sub.path.length > 0) { fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || []; fieldErrors[sub.path[0]].push(mapper(sub)); } else { formErrors.push(mapper(sub)); } } return { formErrors, fieldErrors }; } function formatError(error, _mapper) { const mapper = _mapper || function(issue2) { return issue2.message; }; const fieldErrors = { _errors: [] }; const processError = (error2) => { for (const issue2 of error2.issues) { if (issue2.code === "invalid_union" && issue2.errors.length) { issue2.errors.map((issues) => processError({ issues })); } else if (issue2.code === "invalid_key") { processError({ issues: issue2.issues }); } else if (issue2.code === "invalid_element") { processError({ issues: issue2.issues }); } else if (issue2.path.length === 0) { fieldErrors._errors.push(mapper(issue2)); } else { let curr = fieldErrors; let i = 0; while (i < issue2.path.length) { const el = issue2.path[i]; const terminal = i === issue2.path.length - 1; if (!terminal) { curr[el] = curr[el] || { _errors: [] }; } else { curr[el] = curr[el] || { _errors: [] }; curr[el]._errors.push(mapper(issue2)); } curr = curr[el]; i++; } } } }; processError(error); return fieldErrors; } function treeifyError(error, _mapper) { const mapper = _mapper || function(issue2) { return issue2.message; }; const result = { errors: [] }; const processError = (error2, path = []) => { var _a, _b; for (const issue2 of error2.issues) { if (issue2.code === "invalid_union" && issue2.errors.length) { issue2.errors.map((issues) => processError({ issues }, issue2.path)); } else if (issue2.code === "invalid_key") { processError({ issues: issue2.issues }, issue2.path); } else if (issue2.code === "invalid_element") { processError({ issues: issue2.issues }, issue2.path); } else { const fullpath = [...path, ...issue2.path]; if (fullpath.length === 0) { result.errors.push(mapper(issue2)); continue; } let curr = result; let i = 0; while (i < fullpath.length) { const el = fullpath[i]; const terminal = i === fullpath.length - 1; if (typeof el === "string") { curr.properties ?? (curr.properties = {}); (_a = curr.properties)[el] ?? (_a[el] = { errors: [] }); curr = curr.properties[el]; } else { curr.items ?? (curr.items = []); (_b = curr.items)[el] ?? (_b[el] = { errors: [] }); curr = curr.items[el]; } if (terminal) { curr.errors.push(mapper(issue2)); } i++; } } } }; processError(error); return result; } function toDotPath(path) { const segs = []; for (const seg of path) { if (typeof seg === "number") segs.push(`[${seg}]`); else if (typeof seg === "symbol") segs.push(`[${JSON.stringify(String(seg))}]`); else if (/[^\w$]/.test(seg)) segs.push(`[${JSON.stringify(seg)}]`); else { if (segs.length) segs.push("."); segs.push(seg); } } return segs.join(""); } function prettifyError(error) { const lines = []; const issues = [...error.issues].sort((a, b) => a.path.length - b.path.length); for (const issue2 of issues) { lines.push(`✖ ${issue2.message}`); if (issue2.path?.length) lines.push(` → at ${toDotPath(issue2.path)}`); } return lines.join(` `); } // node_modules/zod/v4/core/parse.js var _parse = (_Err) => (schema, value, _ctx, _params) => { const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false }; const result = schema._zod.run({ value, issues: [] }, ctx); if (result instanceof Promise) { throw new $ZodAsyncError; } if (result.issues.length) { const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))); captureStackTrace(e, _params?.callee); throw e; } return result.value; }; var parse = /* @__PURE__ */ _parse($ZodRealError); var _parseAsync = (_Err) => async (schema, value, _ctx, params) => { const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true }; let result = schema._zod.run({ value, issues: [] }, ctx); if (result instanceof Promise) result = await result; if (result.issues.length) { const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))); captureStackTrace(e, params?.callee); throw e; } return result.value; }; var parseAsync = /* @__PURE__ */ _parseAsync($ZodRealError); var _safeParse = (_Err) => (schema, value, _ctx) => { const ctx = _ctx ? { ..._ctx, async: false } : { async: false }; const result = schema._zod.run({ value, issues: [] }, ctx); if (result instanceof Promise) { throw new $ZodAsyncError; } return result.issues.length ? { success: false, error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))) } : { success: true, data: result.value }; }; var safeParse = /* @__PURE__ */ _safeParse($ZodRealError); var _safeParseAsync = (_Err) => async (schema, value, _ctx) => { const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true }; let result = schema._zod.run({ value, issues: [] }, ctx); if (result instanceof Promise) result = await result; return result.issues.length ? { success: false, error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))) } : { success: true, data: result.value }; }; var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError); // node_modules/zod/v4/core/regexes.js var exports_regexes = {}; __export(exports_regexes, { xid: () => xid, uuid7: () => uuid7, uuid6: () => uuid6, uuid4: () => uuid4, uuid: () => uuid, uppercase: () => uppercase, unicodeEmail: () => unicodeEmail, undefined: () => _undefined, ulid: () => ulid, time: () => time, string: () => string, rfc5322Email: () => rfc5322Email, number: () => number, null: () => _null, nanoid: () => nanoid, lowercase: () => lowercase, ksuid: () => ksuid, ipv6: () => ipv6, ipv4: () => ipv4, integer: () => integer, html5Email: () => html5Email, hostname: () => hostname, guid: () => guid, extendedDuration: () => extendedDuration, emoji: () => emoji, email: () => email, e164: () => e164, duration: () => duration, domain: () => domain, datetime: () => datetime, date: () => date, cuid2: () => cuid2, cuid: () => cuid, cidrv6: () => cidrv6, cidrv4: () => cidrv4, browserEmail: () => browserEmail, boolean: () => boolean, bigint: () => bigint, base64url: () => base64url, base64: () => base64 }); var cuid = /^[cC][^\s-]{8,}$/; var cuid2 = /^[0-9a-z]+$/; var ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/; var xid = /^[0-9a-vA-V]{20}$/; var ksuid = /^[A-Za-z0-9]{27}$/; var nanoid = /^[a-zA-Z0-9_-]{21}$/; var duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/; var extendedDuration = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/; var guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/; var uuid = (version) => { if (!version) return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/; return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`); }; var uuid4 = /* @__PURE__ */ uuid(4); var uuid6 = /* @__PURE__ */ uuid(6); var uuid7 = /* @__PURE__ */ uuid(7); var email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/; var html5Email = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/; var rfc5322Email = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; var unicodeEmail = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u; var browserEmail = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/; var _emoji = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`; function emoji() { return new RegExp(_emoji, "u"); } var ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/; var ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/; var cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/; var 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])$/; var base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/; var base64url = /^[A-Za-z0-9_-]*$/; var hostname = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/; var domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/; var e164 = /^\+(?:[0-9]){6,14}[0-9]$/; 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])))`; var date = /* @__PURE__ */ new RegExp(`^${dateSource}$`); function timeSource(args) { const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`; const regex = typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`; return regex; } function time(args) { return new RegExp(`^${timeSource(args)}$`); } function datetime(args) { const time2 = timeSource({ precision: args.precision }); const opts = ["Z"]; if (args.local) opts.push(""); if (args.offset) opts.push(`([+-]\\d{2}:\\d{2})`); const timeRegex = `${time2}(?:${opts.join("|")})`; return new RegExp(`^${dateSource}T(?:${timeRegex})$`); } var string = (params) => { const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`; return new RegExp(`^${regex}$`); }; var bigint = /^\d+n?$/; var integer = /^\d+$/; var number = /^-?\d+(?:\.\d+)?/i; var boolean = /true|false/i; var _null = /null/i; var _undefined = /undefined/i; var lowercase = /^[^A-Z]*$/; var uppercase = /^[^a-z]*$/; // node_modules/zod/v4/core/checks.js var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => { var _a; inst._zod ?? (inst._zod = {}); inst._zod.def = def; (_a = inst._zod).onattach ?? (_a.onattach = []); }); var numericOriginMap = { number: "number", bigint: "bigint", object: "date" }; var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst, def) => { $ZodCheck.init(inst, def); const origin = numericOriginMap[typeof def.value]; inst._zod.onattach.push((inst2) => { const bag = inst2._zod.bag; const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY; if (def.value < curr) { if (def.inclusive) bag.maximum = def.value; else bag.exclusiveMaximum = def.value; } }); inst._zod.check = (payload) => { if (def.inclusive ? payload.value <= def.value : payload.value < def.value) { return; } payload.issues.push({ origin, code: "too_big", maximum: def.value, input: payload.value, inclusive: def.inclusive, inst, continue: !def.abort }); }; }); var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan", (inst, def) => { $ZodCheck.init(inst, def); const origin = numericOriginMap[typeof def.value]; inst._zod.onattach.push((inst2) => { const bag = inst2._zod.bag; const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY; if (def.value > curr) { if (def.inclusive) bag.minimum = def.value; else bag.exclusiveMinimum = def.value; } }); inst._zod.check = (payload) => { if (def.inclusive ? payload.value >= def.value : payload.value > def.value) { return; } payload.issues.push({ origin, code: "too_small", minimum: def.value, input: payload.value, inclusive: def.inclusive, inst, continue: !def.abort }); }; }); var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => { $ZodCheck.init(inst, def); inst._zod.onattach.push((inst2) => { var _a; (_a = inst2._zod.bag).multipleOf ?? (_a.multipleOf = def.value); }); inst._zod.check = (payload) => { if (typeof payload.value !== typeof def.value) throw new Error("Cannot mix number and bigint in multiple_of check."); const isMultiple = typeof payload.value === "bigint" ? payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0; if (isMultiple) return; payload.issues.push({ origin: typeof payload.value, code: "not_multiple_of", divisor: def.value, input: payload.value, inst, continue: !def.abort }); }; }); var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat", (inst, def) => { $ZodCheck.init(inst, def); def.format = def.format || "float64"; const isInt = def.format?.includes("int"); const origin = isInt ? "int" : "number"; const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format]; inst._zod.onattach.push((inst2) => { const bag = inst2._zod.bag; bag.format = def.format; bag.minimum = minimum; bag.maximum = maximum; if (isInt) bag.pattern = integer; }); inst._zod.check = (payload) => { const input = payload.value; if (isInt) { if (!Number.isInteger(input)) { payload.issues.push({ expected: origin, format: def.format, code: "invalid_type", input, inst }); return; } if (!Number.isSafeInteger(input)) { if (input > 0) { payload.issues.push({ input, code: "too_big", maximum: Number.MAX_SAFE_INTEGER, note: "Integers must be within the safe integer range.", inst, origin, continue: !def.abort }); } else { payload.issues.push({ input, code: "too_small", minimum: Number.MIN_SAFE_INTEGER, note: "Integers must be within the safe integer range.", inst, origin, continue: !def.abort }); } return; } } if (input < minimum) { payload.issues.push({ origin: "number", input, code: "too_small", minimum, inclusive: true, inst, continue: !def.abort }); } if (input > maximum) { payload.issues.push({ origin: "number", input, code: "too_big", maximum, inst }); } }; }); var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat", (inst, def) => { $ZodCheck.init(inst, def); const [minimum, maximum] = BIGINT_FORMAT_RANGES[def.format]; inst._zod.onattach.push((inst2) => { const bag = inst2._zod.bag; bag.format = def.format; bag.minimum = minimum; bag.maximum = maximum; }); inst._zod.check = (payload) => { const input = payload.value; if (input < minimum) { payload.issues.push({ origin: "bigint", input, code: "too_small", minimum, inclusive: true, inst, continue: !def.abort }); } if (input > maximum) { payload.issues.push({ origin: "bigint", input, code: "too_big", maximum, inst }); } }; }); var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, def) => { var _a; $ZodCheck.init(inst, def); (_a = inst._zod.def).when ?? (_a.when = (payload) => { const val = payload.value; return !nullish(val) && val.size !== undefined; }); inst._zod.onattach.push((inst2) => { const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY; if (def.maximum < curr) inst2._zod.bag.maximum = def.maximum; }); inst._zod.check = (payload) => { const input = payload.value; const size = input.size; if (size <= def.maximum) return; payload.issues.push({ origin: getSizableOrigin(input), code: "too_big", maximum: def.maximum, input, inst, continue: !def.abort }); }; }); var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, def) => { var _a; $ZodCheck.init(inst, def); (_a = inst._zod.def).when ?? (_a.when = (payload) => { const val = payload.value; return !nullish(val) && val.size !== undefined; }); inst._zod.onattach.push((inst2) => { const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY; if (def.minimum > curr) inst2._zod.bag.minimum = def.minimum; }); inst._zod.check = (payload) => { const input = payload.value; const size = input.size; if (size >= def.minimum) return; payload.issues.push({ origin: getSizableOrigin(input), code: "too_small", minimum: def.minimum, input, inst, continue: !def.abort }); }; }); var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (inst, def) => { var _a; $ZodCheck.init(inst, def); (_a = inst._zod.def).when ?? (_a.when = (payload) => { const val = payload.value; return !nullish(val) && val.size !== undefined; }); inst._zod.onattach.push((inst2) => { const bag = inst2._zod.bag; bag.minimum = def.size; bag.maximum = def.size; bag.size = def.size; }); inst._zod.check = (payload) => { const input = payload.value; const size = input.size; if (size === def.size) return; const tooBig = size > def.size; payload.issues.push({ origin: getSizableOrigin(input), ...tooBig ? { code: "too_big", maximum: def.size } : { code: "too_small", minimum: def.size }, inclusive: true, exact: true, input: payload.value, inst, continue: !def.abort }); }; }); var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => { var _a; $ZodCheck.init(inst, def); (_a = inst._zod.def).when ?? (_a.when = (payload) => { const val = payload.value; return !nullish(val) && val.length !== undefined; }); inst._zod.onattach.push((inst2) => { const curr = in