@codions/portta 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/README.md +41 -88
  2. package/dist/assets/agents/hook.sh.tmpl +21 -0
  3. package/dist/assets/agents/instruction.md +8 -0
  4. package/dist/assets/agents/portta-context.ts.tmpl +24 -0
  5. package/dist/assets/skills/portta-adopt-compose/SKILL.md +220 -0
  6. package/dist/assets/skills/portta-dockerize/SKILL.md +118 -0
  7. package/dist/assets/skills/portta-host-context/SKILL.md +142 -0
  8. package/dist/cli.js +1542 -1017
  9. package/dist/documentation.json.gz +0 -0
  10. package/dist/runtime/.env.example +6 -42
  11. package/dist/runtime/VERSION +1 -1
  12. package/dist/runtime/docker/compose/features/web-dev.yaml +0 -2
  13. package/dist/runtime/docker/compose/features/web.yaml +0 -8
  14. package/dist/runtime/templates/README.md +3 -3
  15. package/dist/runtime/templates/overlays/06-monorepo.yaml +0 -7
  16. package/dist/runtime/templates/overlays/07-worktree.env +0 -1
  17. package/dist/runtime/templates/project/PORTTA.md +8 -7
  18. package/package.json +4 -15
  19. package/dist/acp-providers-M3DUUBYJ.js +0 -3
  20. package/dist/arktype-aI7TBD0R-SOJGD3SZ.js +0 -3
  21. package/dist/assets/skills/portta-workflows/SKILL.md +0 -285
  22. package/dist/assets/workflows/bake-off.workflow.js +0 -172
  23. package/dist/assets/workflows/code-review.workflow.js +0 -179
  24. package/dist/assets/workflows/deep-research.workflow.js +0 -223
  25. package/dist/assets/workflows/multi-provider-review.workflow.js +0 -169
  26. package/dist/assets/workflows/provider-debate.workflow.js +0 -141
  27. package/dist/assets/workflows/second-opinion.workflow.js +0 -176
  28. package/dist/chunk-3EZNE4MC.js +0 -6
  29. package/dist/chunk-4TGTGGMK.js +0 -4
  30. package/dist/chunk-4YGEG6YX.js +0 -1878
  31. package/dist/chunk-5SBYE3YH.js +0 -26
  32. package/dist/chunk-6J5HN4ZN.js +0 -3
  33. package/dist/chunk-6TV2V7RR.js +0 -3
  34. package/dist/chunk-CFWGQ7VJ.js +0 -19
  35. package/dist/chunk-EFZZFIRZ.js +0 -3
  36. package/dist/chunk-EH7H7D7J.js +0 -15
  37. package/dist/chunk-EYT7VTYA.js +0 -4
  38. package/dist/chunk-FRQCKCCK.js +0 -332
  39. package/dist/chunk-GI2EUNAK.js +0 -16
  40. package/dist/chunk-HB5T7XDN.js +0 -5
  41. package/dist/chunk-IILMQFWO.js +0 -14
  42. package/dist/chunk-LAYNTFDR.js +0 -70
  43. package/dist/chunk-MH5YJA5O.js +0 -2
  44. package/dist/chunk-O6U47HHQ.js +0 -341
  45. package/dist/chunk-OPVZAG2C.js +0 -10
  46. package/dist/chunk-PTKKSRMI.js +0 -223
  47. package/dist/chunk-Q3VNQ3LU.js +0 -3
  48. package/dist/chunk-QBKADN76.js +0 -4
  49. package/dist/chunk-QS5PHDYT.js +0 -240
  50. package/dist/chunk-SBVO6RXF.js +0 -87
  51. package/dist/chunk-T3TSZO4I.js +0 -7
  52. package/dist/chunk-TA2XHP5D.js +0 -4
  53. package/dist/chunk-UUSUJUAD.js +0 -7
  54. package/dist/chunk-UX7P3YHF.js +0 -3
  55. package/dist/chunk-VDSWNWUY.js +0 -168
  56. package/dist/chunk-WNZR7VOO.js +0 -145
  57. package/dist/chunk-YYSFNLBX.js +0 -5
  58. package/dist/cli-O2MMC25H.js +0 -98
  59. package/dist/completions-F4476JAU.js +0 -12
  60. package/dist/config-E5XLLPKE.js +0 -3
  61. package/dist/core-FSKGFGJO.js +0 -18
  62. package/dist/default-u_dwuiYb-OWTONHM6.js +0 -3
  63. package/dist/dispatch-ZCNGHCNP.js +0 -8
  64. package/dist/doctor-7F6ZXPZE.js +0 -5
  65. package/dist/effect-QlVUlMFu-4UNP2EGS.js +0 -3
  66. package/dist/esm-575VQW4T.js +0 -4
  67. package/dist/host.js +0 -8
  68. package/dist/init-HGEXUJP3.js +0 -245
  69. package/dist/linear-commands-XGHGICI7.js +0 -5
  70. package/dist/oneshot-DL57ZA55.js +0 -36
  71. package/dist/opencode-YDUTVKTG.js +0 -3
  72. package/dist/pi-L73UX3S5.js +0 -3
  73. package/dist/project-commands-2N44CRGM.js +0 -7
  74. package/dist/project-env-NWBVITHM.js +0 -4
  75. package/dist/run-commands-TCBNFJOT.js +0 -13
  76. package/dist/runtime/docker/compose/features/panel-host.yaml +0 -42
  77. package/dist/shell-ZWXPCUMD.js +0 -3
  78. package/dist/subprocess-jsonl-FQKDRENI.js +0 -3
  79. package/dist/supervisor.js +0 -179
  80. package/dist/sury-CWZTCd75-XQOYZHNU.js +0 -3
  81. package/dist/typebox-Dei93FPO-RCGWIHUQ.js +0 -3
  82. package/dist/valibot--1zFm7rT-DKLMYF44.js +0 -3
  83. package/dist/valibot-D_HTw1Gn-QTR63R64.js +0 -4
  84. package/dist/worktree-commands-F7REOKFJ.js +0 -50
  85. package/dist/zod-Bwrt9trS-6RSVELLV.js +0 -3
  86. package/dist/zod-DSgpEGAE-5JBFOUHY.js +0 -3
@@ -1,341 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
3
- import{a as u,d as je}from"./chunk-6J5HN4ZN.js";var zf={};je(zf,{$ZodAny:()=>Us,$ZodArray:()=>qs,$ZodAsyncError:()=>B,$ZodBase64:()=>Ss,$ZodBase64URL:()=>Ns,$ZodBigInt:()=>eo,$ZodBigIntFormat:()=>js,$ZodBoolean:()=>Gn,$ZodCIDRv4:()=>As,$ZodCIDRv6:()=>Os,$ZodCUID:()=>hs,$ZodCUID2:()=>gs,$ZodCatch:()=>mu,$ZodCheck:()=>Z,$ZodCheckBigIntFormat:()=>Sn,$ZodCheckEndsWith:()=>Mn,$ZodCheckGreaterThan:()=>rt,$ZodCheckIncludes:()=>Rn,$ZodCheckLengthEquals:()=>Ln,$ZodCheckLessThan:()=>nt,$ZodCheckLowerCase:()=>Vn,$ZodCheckMaxLength:()=>En,$ZodCheckMaxSize:()=>Nn,
4
- $ZodCheckMimeType:()=>Un,$ZodCheckMinLength:()=>Tn,$ZodCheckMinSize:()=>Zn,$ZodCheckMultipleOf:()=>An,$ZodCheckNumberFormat:()=>On,$ZodCheckOverwrite:()=>Bn,$ZodCheckProperty:()=>ot,$ZodCheckRegex:()=>Dn,$ZodCheckSizeEquals:()=>Cn,$ZodCheckStartsWith:()=>Fn,$ZodCheckStringFormat:()=>we,$ZodCheckUpperCase:()=>jn,$ZodCodec:()=>Yn,$ZodCreditCard:()=>Ts,$ZodCustom:()=>vu,$ZodCustomStringFormat:()=>Ds,$ZodCyclicError:()=>yt,$ZodDate:()=>Ws,$ZodDefault:()=>lu,$ZodDiscriminatedUnion:()=>Qs,$ZodE164:()=>Zs,
5
- $ZodEmail:()=>ls,$ZodEmoji:()=>ds,$ZodEncodeError:()=>ye,$ZodEnum:()=>ou,$ZodError:()=>Jt,$ZodExactOptional:()=>au,$ZodFile:()=>su,$ZodFunction:()=>bu,$ZodGUID:()=>as,$ZodIPv4:()=>ks,$ZodIPv6:()=>Is,$ZodISODate:()=>ws,$ZodISODateTime:()=>ys,$ZodISODuration:()=>zs,$ZodISOTime:()=>vs,$ZodIntersection:()=>eu,$ZodJWT:()=>Ls,$ZodKSUID:()=>bs,$ZodLazy:()=>wu,$ZodLiteral:()=>iu,$ZodMAC:()=>Ps,$ZodMap:()=>nu,$ZodNaN:()=>hu,$ZodNanoID:()=>ms,$ZodNever:()=>Ks,$ZodNonOptional:()=>pu,$ZodNull:()=>Ms,$ZodNullable:()=>cu,
6
- $ZodNumber:()=>Qr,$ZodNumberFormat:()=>Vs,$ZodObject:()=>ro,$ZodObjectJIT:()=>Hs,$ZodOptional:()=>io,$ZodPipe:()=>so,$ZodPrefault:()=>fu,$ZodPreprocess:()=>gu,$ZodPromise:()=>yu,$ZodReadonly:()=>_u,$ZodRealError:()=>J,$ZodRecord:()=>tu,$ZodRegistry:()=>vt,$ZodSet:()=>ru,$ZodString:()=>ct,$ZodStringFormat:()=>O,$ZodSuccess:()=>du,$ZodSymbol:()=>Rs,$ZodTemplateLiteral:()=>$u,$ZodTransform:()=>uu,$ZodTuple:()=>oo,$ZodType:()=>k,$ZodULID:()=>_s,$ZodURL:()=>ps,$ZodUUID:()=>cs,$ZodUndefined:()=>Fs,$ZodUnion:()=>Hn,
7
- $ZodUnknown:()=>Bs,$ZodVoid:()=>Js,$ZodXID:()=>$s,$ZodXor:()=>Ys,$brand:()=>fi,$constructor:()=>g,$input:()=>Ou,$output:()=>Au,Doc:()=>fe,INVALID:()=>W,JSONSchema:()=>So,JSONSchemaGenerator:()=>xt,NEVER:()=>ci,TimePrecision:()=>nc,URL_BAD_FORMAT:()=>Wn,URL_UNPARSEABLE:()=>qn,ZodCompileAsyncError:()=>Q,ZodCompileUnsupportedError:()=>I,_any:()=>zc,_array:()=>tl,_base64:()=>Ya,_base64url:()=>Xa,_bigint:()=>gc,_boolean:()=>mc,_catch:()=>yl,_check:()=>vo,_cidrv4:()=>Ga,_cidrv6:()=>Ha,_coercedBigint:()=>_c,
8
- _coercedBoolean:()=>hc,_coercedDate:()=>Ac,_coercedNumber:()=>ac,_coercedString:()=>Na,_creditCard:()=>ec,_cuid:()=>Fa,_cuid2:()=>Ma,_custom:()=>Il,_date:()=>Pc,_decode:()=>xr,_decodeAsync:()=>Pr,_default:()=>_l,_discriminatedUnion:()=>ol,_e164:()=>Qa,_email:()=>Za,_emoji:()=>ja,_encode:()=>kr,_encodeAsync:()=>Ir,_endsWith:()=>Jc,_enum:()=>ll,_file:()=>dl,_float32:()=>lc,_float64:()=>fc,_gt:()=>yo,_gte:()=>wo,_guid:()=>Ca,_includes:()=>Bc,_int:()=>cc,_int32:()=>pc,_int64:()=>$c,_intersection:()=>il,
9
- _ipv4:()=>Ja,_ipv6:()=>Wa,_isoDate:()=>oc,_isoDateTime:()=>rc,_isoDuration:()=>sc,_isoTime:()=>ic,_jwt:()=>tc,_ksuid:()=>Ka,_lazy:()=>kl,_length:()=>Rc,_literal:()=>pl,_lowercase:()=>Mc,_lt:()=>$o,_lte:()=>bo,_mac:()=>qa,_map:()=>al,_max:()=>bo,_maxLength:()=>Vc,_maxSize:()=>Tc,_mime:()=>Gc,_min:()=>wo,_minLength:()=>jc,_minSize:()=>Lc,_multipleOf:()=>Ec,_nan:()=>Oc,_nanoid:()=>Ra,_nativeEnum:()=>fl,_negative:()=>Nc,_never:()=>xc,_nonnegative:()=>Cc,_nonoptional:()=>$l,_nonpositive:()=>Zc,_normalize:()=>Hc,
10
- _null:()=>vc,_nullable:()=>gl,_number:()=>uc,_optional:()=>hl,_overwrite:()=>ze,_parse:()=>We,_parseAsync:()=>Ge,_pipe:()=>wl,_positive:()=>Sc,_promise:()=>xl,_properties:()=>qc,_property:()=>Wc,_readonly:()=>vl,_record:()=>ul,_refine:()=>Pl,_regex:()=>Fc,_safeDecode:()=>Or,_safeDecodeAsync:()=>Nr,_safeEncode:()=>Ar,_safeEncodeAsync:()=>Sr,_safeParse:()=>Ye,_safeParseAsync:()=>Xe,_set:()=>cl,_size:()=>Dc,_slugify:()=>el,_startsWith:()=>Kc,_string:()=>Sa,_stringFormat:()=>Zl,_stringbool:()=>Nl,_success:()=>bl,
11
- _superRefine:()=>Al,_symbol:()=>yc,_templateLiteral:()=>zl,_toLowerCase:()=>Xc,_toUpperCase:()=>Qc,_transform:()=>ml,_trim:()=>Yc,_tuple:()=>sl,_uint32:()=>dc,_uint64:()=>bc,_ulid:()=>Ua,_undefined:()=>wc,_union:()=>nl,_unknown:()=>kc,_uppercase:()=>Uc,_url:()=>Va,_uuid:()=>Ea,_uuidv4:()=>Ta,_uuidv6:()=>La,_uuidv7:()=>Da,_void:()=>Ic,_xid:()=>Ba,_xor:()=>rl,clone:()=>G,compile:()=>Zu,compileFn:()=>zt,config:()=>K,createStandardJSONSchemaMethod:()=>cr,createToJSONSchemaMethod:()=>El,decode:()=>Pi,
12
- decodeAsync:()=>Oi,describe:()=>Ol,encode:()=>Ii,encodeAsync:()=>Ai,extractDefs:()=>ie,finalize:()=>se,flattenError:()=>gi,formatError:()=>_i,getDiscriminatedOption:()=>Xs,globalConfig:()=>V,globalRegistry:()=>re,handleUnrepresentable:()=>L,initializeContext:()=>oe,isBackEdge:()=>wt,isRecursiveSchema:()=>tr,isValidBase64:()=>Le,isValidBase64URL:()=>ht,isValidCIDRv6:()=>mt,isValidCreditCard:()=>gt,isValidIPv6:()=>Te,isValidJWT:()=>_t,locales:()=>rr,memoizer:()=>Iu,mergeValues:()=>ve,meta:()=>Sl,parse:()=>qe,
13
- parseAsync:()=>He,parseURLObject:()=>lt,prettifyError:()=>bi,process:()=>A,regexes:()=>le,registry:()=>lo,safeDecode:()=>Ni,safeDecodeAsync:()=>Ci,safeEncode:()=>Si,safeEncodeAsync:()=>Zi,safeParse:()=>Wt,safeParseAsync:()=>qt,standardProps:()=>Xr,stripTabAndNewline:()=>ft,toDotPath:()=>zr,toJSONSchema:()=>Oo,toZod:()=>At,treeifyError:()=>$i,urlHostnameOk:()=>pt,urlProtocolOk:()=>dt,util:()=>H,validate:()=>zi,validateAsync:()=>xi,version:()=>Kn});var H={};je(H,{BIGINT_FORMAT_RANGES:()=>Lt,CONSTANT_CATCH:()=>Ke,Class:()=>Pt,NUMBER_FORMAT_RANGES:()=>Tt,aborted:()=>te,allowsEval:()=>Zt,assert:()=>Do,assertEqual:()=>Co,assertIs:()=>To,assertNever:()=>Lo,assertNotEqual:()=>Eo,assignProp:()=>T,attachSchema:()=>Be,base64ToUint8Array:()=>_r,base64urlToUint8Array:()=>ti,cached:()=>$e,captureStackTrace:()=>Me,cleanEnum:()=>ei,cleanRegex:()=>Ie,clone:()=>G,cloneDef:()=>jo,codePointLength:()=>ae,constantCatch:()=>Ft,createTransparentProxy:()=>Ko,defineLazy:()=>St,
14
- defineLazyInternal:()=>x,esc:()=>F,escapeRegex:()=>q,explicitlyAborted:()=>Dt,extend:()=>qo,finalizeIssue:()=>U,floatSafeRemainder:()=>Pe,getElementAtPath:()=>Ro,getEnumValues:()=>xe,getLengthableOrigin:()=>Ne,getParsedType:()=>Bo,getSizableOrigin:()=>Se,hexToUint8Array:()=>ri,hide:()=>Rt,installLazyProp:()=>ai,isObject:()=>ue,isPlainObject:()=>Y,issue:()=>be,joinValues:()=>Re,jsonStringifyReplacer:()=>Ot,members:()=>jt,merge:()=>Ho,mergeDefs:()=>X,normalizeParams:()=>_,nullish:()=>Fe,numKeys:()=>Uo,
15
- objectClone:()=>Vo,omit:()=>Wo,optionalKeys:()=>Et,own:()=>_e,parsedType:()=>Vt,partial:()=>Yo,pick:()=>Jo,prefixIssues:()=>M,primitiveTypes:()=>Ct,promiseAllObject:()=>Fo,propertyKeyTypes:()=>Oe,randomString:()=>Mo,required:()=>Xo,safeExtend:()=>Go,shallowClone:()=>Ae,slugify:()=>Nt,stringifyPrimitive:()=>Ue,toZod:()=>At,uint8ArrayToBase64:()=>$r,uint8ArrayToBase64url:()=>ni,uint8ArrayToHex:()=>oi,unwrapMessage:()=>ge});function Co(e){return e}u(Co,"assertEqual");function Eo(e){return e}u(Eo,"assertNotEqual");function At(){return e=>e}u(At,"toZod");function To(e){}u(To,"assertIs");function Lo(e){throw new Error("Unexpected value in exhaustive check")}u(Lo,"assertNever");function Do(e){}u(Do,"assert");function xe(e){let t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}u(xe,"getEnumValues");function Re(e,t="|"){return e.map(n=>Ue(n)).join(
16
- t)}u(Re,"joinValues");function Ot(e,t){return typeof t=="bigint"?t.toString():t}u(Ot,"jsonStringifyReplacer");function $e(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}u($e,"cached");function Fe(e){return e==null}u(Fe,"nullish");function Ie(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}u(Ie,"cleanRegex");function Pe(e,t){let n=e/t,r=Math.round(n),o=4*Number.EPSILON*Math.
17
- max(Math.abs(n),1);return Math.abs(n-r)<o?0:n-r}u(Pe,"floatSafeRemainder");var gr=Symbol("evaluating");function St(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==gr)return r===void 0&&(r=gr,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}u(St,"defineLazy");function Vo(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}u(Vo,"objectClone");function T(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}
18
- u(T,"assignProp");function X(...e){let t={};for(let n of e){let r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}u(X,"mergeDefs");function jo(e){return X(e._zod.def)}u(jo,"cloneDef");function Ro(e,t){return t?t.reduce((n,r)=>n?.[r],e):e}u(Ro,"getElementAtPath");function Fo(e){let t=Object.keys(e),n=t.map(r=>e[r]);return Promise.all(n).then(r=>{let o={};for(let i=0;i<t.length;i++)o[t[i]]=r[i];return o})}u(Fo,"promiseAllObject");function Mo(e=10){let t="\
19
- abcdefghijklmnopqrstuvwxyz",n="";for(let r=0;r<e;r++)n+=t[Math.floor(Math.random()*t.length)];return n}u(Mo,"randomString");function F(e){return JSON.stringify(e)}u(F,"esc");function Nt(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}u(Nt,"slugify");var Me="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ue(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}u(ue,"isObject");var Zt=$e(()=>{if(V.jitless||typeof navigator<
20
- "u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Y(e){if(ue(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(ue(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}u(Y,"isPlainObject");function Ae(e){return Y(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}u(Ae,"shallowClone");function Uo(e){let t=0;for(let n in e)
21
- Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}u(Uo,"numKeys");var Bo=u(e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof
22
- Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},"getParsedType"),Oe=new Set(["string","number","symbol"]),Ct=new Set(["string","number","bigint","boolean","symbol","undefined"]);function q(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}u(q,"escapeRegex");function G(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=
23
- e),r}u(G,"clone");function _(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:u(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:u(()=>t.error,"error")}:t}u(_,"normalizeParams");function Ko(e){let t;return new Proxy({},{get(n,r,o){return t??(t=e()),Reflect.get(t,r,o)},set(n,r,o,i){return t??(t=e()),Reflect.set(t,r,o,i)},has(n,r){
24
- return t??(t=e()),Reflect.has(t,r)},deleteProperty(n,r){return t??(t=e()),Reflect.deleteProperty(t,r)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,o){return t??(t=e()),Reflect.defineProperty(t,r,o)}})}u(Ko,"createTransparentProxy");function Ue(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}u(Ue,"stringifyPrimitive");function Et(e){return Object.keys(e).
25
- filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}u(Et,"optionalKeys");var Tt={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Lt={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Jo(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(
26
- ".pick() cannot be used on object schemas containing refinements");let i=X(e._zod.def,{get shape(){let s={};for(let a of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,a))throw new Error(`Unrecognized key: "${String(a)}"`);t[a]&&T(s,a,n.shape[a])}return T(this,"shape",s),s},checks:[]});return G(e,i)}u(Jo,"pick");function Wo(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=X(e._zod.def,
27
- {get shape(){let s={...e._zod.def.shape};for(let a of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,a))throw new Error(`Unrecognized key: "${String(a)}"`);t[a]&&delete s[a]}return T(this,"shape",s),s},checks:[]});return G(e,i)}u(Wo,"omit");function qo(e,t){if(!Y(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let i=e._zod.def.shape;for(let s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(i,s)!==void 0)
28
- throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let o=X(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return T(this,"shape",i),i}});return G(e,o)}u(qo,"extend");function Go(e,t){if(!Y(t))throw new Error("Invalid input to safeExtend: expected a plain object");let n=X(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return T(this,"shape",r),r}});return G(e,n)}u(Go,"safeExtend");function Ho(e,t){if(!t?._zod?.def)throw new Error(
29
- "Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=X(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return T(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return G(e,n)}u(Ho,"merge");function Yo(e,t,n,r="partial"){let i=t._zod.def.checks;
30
- if(i&&i.length>0)throw new Error(`.${r}() cannot be used on object schemas containing refinements`);let a=X(t._zod.def,{get shape(){let c=t._zod.def.shape,l={...c};if(n)for(let f of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(c,f))throw new Error(`Unrecognized key: "${String(f)}"`);n[f]&&(l[f]=e?new e({type:"optional",innerType:c[f]}):c[f])}else for(let f of Reflect.ownKeys(c))l[f]=e?new e({type:"optional",innerType:c[f]}):c[f];return T(this,"shape",l),l},checks:[]});return G(t,
31
- a)}u(Yo,"partial");function Xo(e,t,n){let r=X(t._zod.def,{get shape(){let o=t._zod.def.shape,i={...o};if(n)for(let s of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(i,s))throw new Error(`Unrecognized key: "${String(s)}"`);n[s]&&(i[s]=new e({type:"nonoptional",innerType:o[s]}))}else for(let s of Reflect.ownKeys(o))i[s]=new e({type:"nonoptional",innerType:o[s]});return T(this,"shape",i),i}});return G(t,r)}u(Xo,"required");function te(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<
32
- e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}u(te,"aborted");function Dt(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}u(Dt,"explicitlyAborted");function M(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}u(M,"prefixIssues");function ge(e){return typeof e=="string"?e:e?.message}u(ge,"unwrapMessage");function Be(e,t,n){var r;for(let o=t;o<e.length;o++)(r=e[o]).schema??(r.schema=
33
- n)}u(Be,"attachSchema");function U(e,t,n){var r;let o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:ge(e.inst?._zod.def?.error?.(e))??ge(i?.(e))??ge(t?.error?.(e))??ge(n.customError?.(e))??ge(n.localeError?.(e))??"Invalid input",{inst:a,schema:c,continue:l,input:f,...p}=e;return p.path??(p.path=[]),p.message=s,t?.reportInput&&(p.input=f),p}u(U,"finalizeIs\
34
- sue");function Se(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}u(Se,"getSizableOrigin");var Qo=/[\uD800-\uDBFF]/;function ae(e){let t=e.length;if(!Qo.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)===55296&&(e.charCodeAt(r+1)&64512)===56320&&(n--,r++);return n}u(ae,"codePointLength");function Ne(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}u(Ne,"getLengthableOrigin");function Vt(e){let t=typeof e;switch(t){case"\
35
- number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}u(Vt,"parsedType");function be(...e){let[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}u(be,"issue");function ei(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}u(ei,"cle\
36
- anEnum");function _r(e){let t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}u(_r,"base64ToUint8Array");function $r(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}u($r,"uint8ArrayToBase64");function ti(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return _r(t+n)}u(ti,"base64urlToUint8Array");function ni(e){return $r(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}u(ni,"uint8\
37
- ArrayToBase64url");function ri(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)n[r/2]=Number.parseInt(t.slice(r,r+2),16);return n}u(ri,"hexToUint8Array");function oi(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}u(oi,"uint8ArrayToHex");var Pt=class{static{u(this,"Class")}constructor(...t){}};function jt(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);
38
- r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):ii(e,n,r.value)}}u(jt,"members");function _e(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}u(_e,"own");function Rt(e,t,n){return _e(e,t,n,!1)}u(Rt,"hide");function ii(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:_e(this,t,n.bind(this))},set(r){_e(this,t,r)}})}u(ii,"defineBound");function si(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}u(si,"claim");
39
- var It,ee=!1,ui={configurable:!0,get(){ee=!0}};function x(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&It!==e._zod){It=void 0;return}It=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,ui);let o=ee;ee=!1;try{let i=n(this);return ee?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i}),ee=ee||o,i}catch(i){throw delete this[t],ee=ee||o,i}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}u(x,"def\
40
- ineLazyInternal");function ai(e,t,n,r){let o=si(e,t);o&&Object.defineProperty(o,t,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,i),i.value=n(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:i})}})}u(ai,"installLazyProp");var Ke="~constantCatch";function Ft(e){let t=u(()=>e,"fn");return t[Ke]=!0,t}u(Ft,"constantCatch");var br,ci=Object.freeze({status:"aborted"}),Mt={value:void 0,enumerable:!1},yr="captureStackTrace"in Error?Error:null;function li(e){let t=yr;if(t){let n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return yr=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}u(li,"newError");function g(e,t,n,r){let o={};function i(d){this.def=d,this.constr=p,this.traits=new Set}u(i,"Internals"),i.prototype=o;let s=n,a=s&&new WeakSet;function c(d,m){if(!d._zod){Mt.value=
41
- new i(m);try{Object.defineProperty(d,"_zod",Mt)}finally{Mt.value=void 0}}if(d._zod.traits.has(e))return;if(d._zod.traits.add(e),t(d,m),a){let $=Object.getPrototypeOf(d),b=d._zod.constr.prototype,N=$;for(;N&&N!==b;)N=Object.getPrototypeOf(N);let y=N??$;a.has(y)||(a.add(y),jt(y,s))}let h=p.prototype;for(let $ in h)Object.prototype.hasOwnProperty.call(h,$)&&($ in d||(d[$]=h[$].bind(d)))}u(c,"init");let l=r?.Parent??Object;class f extends l{static{u(this,"Definition")}}Object.defineProperty(f,"name",
42
- {value:e});function p(d){let m=r?.Parent?li(f):this;c(m,d);let h=m._zod.deferred;if(h){for(let b of h)b();m._zod.deferred=void 0}let $=globalThis.__zod_globalConfig?.postProcessor;return $&&$(m),m}return u(p,"_"),Object.defineProperty(p,"init",{value:c}),Object.defineProperty(p,Symbol.hasInstance,{value:u(d=>r?.Parent&&d instanceof r.Parent?!0:d?._zod?.traits?.has(e),"value")}),Object.defineProperty(p,"name",{value:e}),p}u(g,"$constructor");var fi=Symbol("zod_brand"),B=class extends Error{static{
43
- u(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ye=class extends Error{static{u(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(br=globalThis).__zod_globalConfig??(br.__zod_globalConfig={});var V=globalThis.__zod_globalConfig;function K(e){return e&&Object.assign(V,e),V}u(K,"config");function pi(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Ot,2)),e.message}u(pi,"_getMessage");function di(e){this._zod.message=e}u(di,"_setMessage");var mi={get:pi,set:di,enumerable:!0,configurable:!0},Bt={value:void 0,enumerable:!1},Kt={value:void 0,enumerable:!1},wr=new WeakSet([Object.prototype,Error.prototype]),vr=u((e,t)=>{e.name="$ZodError",Bt.value=e._zod,Object.defineProperty(e,"_zod",Bt),Kt.value=t,Object.defineProperty(e,"issues",Kt),Bt.value=void 0,Kt.value=void 0,
44
- Object.defineProperty(e,"message",mi);let n=Object.getPrototypeOf(e);wr.has(n)||(wr.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let r=u(()=>this.message,"value");return Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0})}}))},"initializer"),Jt=g("$ZodError",vr),J=g("$ZodError",vr,void 0,{Parent:Error});function hi(e,t,n){return Object.prototype.hasOwnProperty.
45
- call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}u(hi,"node");function gi(e,t=n=>n.message){let n={},r=[];for(let o of e.issues)o.path.length>0?hi(n,o.path[0],()=>[]).push(t(o)):r.push(t(o));return{formErrors:r,fieldErrors:n}}u(gi,"flattenError");function _i(e,t=n=>n.message){let n={_errors:[]},r=u((o,i=[])=>{for(let s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>r({issues:a},[...i,...s.path]));else if(s.
46
- code==="invalid_key")r({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")r({issues:s.issues},[...i,...s.path]);else{let a=[...i,...s.path];if(a.length===0)n._errors.push(t(s));else{let c=n,l=0;for(;l<a.length;){let f=a[l],p=l===a.length-1;if(f==="_errors"){p&&c._errors.push(t(s)),l++;continue}Object.prototype.hasOwnProperty.call(c,f)||Object.defineProperty(c,f,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let d=c[f];p&&d._errors.push(t(s)),c=d,l++}}}},"proc\
47
- essError");return r(e),n}u(_i,"formatError");function $i(e,t=n=>n.message){let n={errors:[]},r=u((o,i=[])=>{var s;for(let a of o.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>r({issues:c},[...i,...a.path]));else if(a.code==="invalid_key")r({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")r({issues:a.issues},[...i,...a.path]);else{let c=[...i,...a.path];if(c.length===0){n.errors.push(t(a));continue}let l=n,f=0;for(;f<c.length;){let p=c[f],d=f===c.length-
48
- 1;typeof p=="string"?(l.properties??(l.properties={}),Object.prototype.hasOwnProperty.call(l.properties,p)||Object.defineProperty(l.properties,p,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),l=l.properties[p]):(l.items??(l.items=[]),(s=l.items)[p]??(s[p]={errors:[]}),l=l.items[p]),d&&l.errors.push(t(a)),f++}}},"processError");return r(e),n}u($i,"treeifyError");function zr(e){let t=[],n=e.map(r=>typeof r=="object"?r.key:r);for(let r of n)typeof r=="number"?t.push(`[${r}]`):typeof r==
49
- "symbol"?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}u(zr,"toDotPath");function bi(e){let t=[],n=[...e.issues].sort((r,o)=>(r.path??[]).length-(o.path??[]).length);for(let r of n)t.push(`\u2716 ${r.message}`),r.path?.length&&t.push(` \u2192 at ${zr(r.path)}`);return t.join(`
50
- `)}u(bi,"prettifyError");function Je(e,t){return{callee:t?.callee??e,Err:t?.Err}}u(Je,"finalizeParams");var We=u(e=>{let t=u((n,r,o,i)=>{let s=o?{...o,async:!1}:{async:!1},a=n._zod.run({value:r,issues:[]},s);if(a instanceof Promise)throw new B;if(a.issues.length){let c=new(i?.Err??e)(a.issues.map(l=>U(l,s,K())));throw Me(c,i?.callee??t),c}return a.value},"fn");return t},"_parse"),qe=We(J),Ge=u(e=>{let t=u(async(n,r,o,i)=>{let s=o?{...o,async:!0}:{async:!0},a=n._zod.run({value:r,issues:[]},s);if(a instanceof Promise&&(a=
51
- await a),a.issues.length){let c=new(i?.Err??e)(a.issues.map(l=>U(l,s,K())));throw Me(c,i?.callee??t),c}return a.value},"fn");return t},"_parseAsync"),He=Ge(J),Ye=u(e=>(t,n,r)=>{let o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new B;return i.issues.length?{success:!1,error:new(e??Jt)(i.issues.map(s=>U(s,o,K())))}:{success:!0,data:i.value}},"_safeParse"),Wt=Ye(J),Xe=u(e=>async(t,n,r)=>{let o=r?{...r,async:!0}:{async:!0},i=t._zod.run({value:n,issues:[]},
52
- o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>U(s,o,K())))}:{success:!0,data:i.value}},"_safeParseAsync"),qt=Xe(J),wi=Symbol.for("zod.compile.invalid"),vi=Symbol.for("zod.compile.fallback"),zi=u(((e,t,n)=>{let r=e._zod.bag.validator;return r!==void 0&&r(t)!==wi?!0:ki(e,t,n)}),"validate");function ki(e,t,n){let r=n?{...n,async:!1}:{async:!1},o=e._zod.bag.fallbackRun,i;if(o?(r[vi]=!0,i=o({value:t,issues:[]},r)):i=e._zod.run({value:t,issues:[]},
53
- r),i instanceof Promise)throw new B;return i.issues.length===0}u(ki,"validateFallback");var xi=u(async(e,t,n)=>{let r=n?{...n,async:!0}:{async:!0},o=e._zod.run({value:t,issues:[]},r);return o instanceof Promise&&(o=await o),o.issues.length===0},"validateAsync"),kr=u(e=>{let t=We(e),n=u((r,o,i,s)=>{let a=i?{...i,direction:"backward"}:{direction:"backward"};return t(r,o,a,Je(n,s))},"fn");return n},"_encode"),Ii=kr(J),xr=u(e=>{let t=We(e),n=u((r,o,i,s)=>t(r,o,i,Je(n,s)),"fn");return n},"_decode"),Pi=xr(
54
- J),Ir=u(e=>{let t=Ge(e),n=u(async(r,o,i,s)=>{let a=i?{...i,direction:"backward"}:{direction:"backward"};return await t(r,o,a,Je(n,s))},"fn");return n},"_encodeAsync"),Ai=Ir(J),Pr=u(e=>{let t=Ge(e),n=u(async(r,o,i,s)=>await t(r,o,i,Je(n,s)),"fn");return n},"_decodeAsync"),Oi=Pr(J),Ar=u(e=>(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return Ye(e)(t,n,o)},"_safeEncode"),Si=Ar(J),Or=u(e=>(t,n,r)=>Ye(e)(t,n,r),"_safeDecode"),Ni=Or(J),Sr=u(e=>async(t,n,r)=>{let o=r?{...r,direction:"\
55
- backward"}:{direction:"backward"};return Xe(e)(t,n,o)},"_safeEncodeAsync"),Zi=Sr(J),Nr=u(e=>async(t,n,r)=>Xe(e)(t,n,r),"_safeDecodeAsync"),Ci=Nr(J);var le={};je(le,{base64:()=>dn,base64url:()=>Qe,bigint:()=>yn,boolean:()=>wn,browserEmail:()=>Fi,cidrv4:()=>fn,cidrv6:()=>pn,creditCard:()=>et,cuid:()=>Ht,cuid2:()=>Yt,date:()=>gn,datetime:()=>$n,domain:()=>Bi,duration:()=>rn,e164:()=>hn,email:()=>sn,emoji:()=>un,extendedDuration:()=>Ei,guid:()=>on,hex:()=>Ji,hostname:()=>Ui,html5Email:()=>Vi,httpProtocol:()=>mn,idnEmail:()=>Ri,integer:()=>Ze,ipv4:()=>an,ipv6:()=>cn,ksuid:()=>en,lowercase:()=>kn,mac:()=>ln,md5_base64:()=>qi,md5_base64url:()=>Gi,
56
- md5_hex:()=>Wi,nanoid:()=>tn,nanoidOfLength:()=>nn,null:()=>vn,number:()=>ne,rfc5322Email:()=>ji,sha1_base64:()=>Yi,sha1_base64url:()=>Xi,sha1_hex:()=>Hi,sha256_base64:()=>es,sha256_base64url:()=>ts,sha256_hex:()=>Qi,sha384_base64:()=>rs,sha384_base64url:()=>os,sha384_hex:()=>ns,sha512_base64:()=>ss,sha512_base64url:()=>us,sha512_hex:()=>is,string:()=>bn,time:()=>_n,ulid:()=>Xt,undefined:()=>zn,unicodeEmail:()=>Zr,uppercase:()=>xn,uuid:()=>ce,uuid4:()=>Ti,uuid6:()=>Li,uuid7:()=>Di,xid:()=>Qt});var Ht=/^[cC][0-9a-z]{6,}$/,Yt=/^[0-9a-z]+$/,Xt=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Qt=/^[0-9a-vA-V]{20}$/,en=/^[A-Za-z0-9]{27}$/,tn=/^[a-zA-Z0-9_-]{21}$/;function nn(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}u(nn,"nanoidOfLength");var rn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ei=/^[-+]?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)?)??$/,
57
- on=/^([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})$/,ce=u(e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,"uuid"),Ti=ce(4),Li=ce(6),Di=ce(7),sn=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,
58
- Vi=/^[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])?)*$/,ji=/^(([^<>()\[\]\\.,;:\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,}))$/,Zr=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Ri=Zr,Fi=/^[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])?)*$/,Mi="^[\\p{Extended_Pictogra\
59
- phic}\\p{Emoji_Component}]+$";function un(){return new RegExp(Mi,"u")}u(un,"emoji");var an=/^(?:(?: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])$/,cn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,
60
- ln=u(e=>{let t=q(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},"mac"),fn=/^((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])$/,pn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,
61
- dn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Qe=/^[A-Za-z0-9_-]*$/,Ui=/^(?=.{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])?)*\.?$/,Bi=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,mn=/^https?$/,hn=/^\+[1-9]\d{6,14}$/,et=/^\d(?:[ -]?\d){11,18}$/,Cr="(?:(?:\\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-\
62
- 9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function Ki(e){return new RegExp(`^${e}$`)}u(Ki,"anchor");var gn=Ki(Cr);function Gt(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}u(Gt,"timeSource");function _n(e){return new RegExp(`^${Gt(e)}$`)}u(_n,"time");function $n(e){
63
- let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${Gt({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,r=e.local?`${n}|${Gt({precision:e.precision})}`:n;return new RegExp(`^${Cr}T(?:${r})$`)}u($n,"datetime");var bn=u(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),yn=/^-?\d+n?$/,Ze=/^-?\d+$/,ne=/^-?\d+(?:\.\d+)?$/,wn=/^(?:true|false)$/i,vn=/^null$/i;var zn=/^undefined$/i;var kn=/^[^A-Z]*$/,xn=/^[^a-z]*$/,Ji=/^[0-9a-fA-F]*$/;function Ce(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}u(Ce,"fixedBase64");function Ee(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}u(Ee,"fixedBase64url");var Wi=/^[0-9a-fA-F]{32}$/,qi=Ce(22,"=="),Gi=Ee(22),Hi=/^[0-9a-fA-F]{40}$/,Yi=Ce(27,"="),Xi=Ee(27),Qi=/^[0-9a-fA-F]{64}$/,es=Ce(43,"="),ts=Ee(43),ns=/^[0-9a-fA-F]{96}$/,rs=Ce(64,""),os=Ee(64),is=/^[0-9a-fA-F]{128}$/,ss=Ce(86,"=="),us=Ee(86);var Z=g("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),In=u(e=>{let t=e.value;return!Fe(t)&&t.size!==void 0},"_whenHasSize"),Pn=u(e=>{let t=e.value;return!Fe(t)&&t.length!==void 0},"_whenHasLength"),tt={number:"number",bigint:"bigint",object:"date"},nt=g("$ZodCheckLessThan",(e,t)=>{Z.init(e,t);let n=tt[typeof t.value];e._zod.onattach.push(r=>{let o=r._zod.bag,i=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?
64
- o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:tt[typeof r.value]??n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),rt=g("$ZodCheckGreaterThan",(e,t)=>{Z.init(e,t);let n=tt[typeof t.value];e._zod.onattach.push(r=>{let o=r._zod.bag,i=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?
65
- o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:tt[typeof r.value]??n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),An=g("$ZodCheckMultipleOf",(e,t)=>{Z.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Can\
66
- not mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):Pe(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),On=g("$ZodCheckNumberFormat",(e,t)=>{Z.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),r=n?"int":"number",[o,i]=Tt[t.format];e._zod.onattach.push(s=>{let a=s._zod.bag;a.format=t.format,a.minimum=o,a.maximum=
67
- i,n&&(a.pattern=Ze)}),e._zod.check=s=>{let a=s.value;if(n){if(!Number.isInteger(a)){s.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe \
68
- integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Sn=g("$ZodCheckBigIntFormat",(e,t)=>{Z.init(e,t);let[n,r]=Lt[t.format];e._zod.onattach.push(o=>{let i=o._zod.bag;i.format=t.format,i.minimum=n,i.maximum=r}),e._zod.check=o=>{let i=o.value;i<n&&o.issues.push(
69
- {origin:"bigint",input:i,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),i>r&&o.issues.push({origin:"bigint",input:i,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),Nn=g("$ZodCheckMaxSize",(e,t)=>{var n;Z.init(e,t),(n=e._zod.def).when??(n.when=In),e._zod.onattach.push(r=>{let o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let o=r.value;o.size<=t.maximum||r.issues.push({origin:Se(o),code:"too_big",
70
- maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Zn=g("$ZodCheckMinSize",(e,t)=>{var n;Z.init(e,t),(n=e._zod.def).when??(n.when=In),e._zod.onattach.push(r=>{let o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let o=r.value;o.size>=t.minimum||r.issues.push({origin:Se(o),code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Cn=g("$ZodCheckSizeEquals",(e,t)=>{var n;Z.init(e,t),(n=e._zod.
71
- def).when??(n.when=In),e._zod.onattach.push(r=>{let o=r._zod.bag;o.minimum=t.size,o.maximum=t.size,o.size=t.size}),e._zod.check=r=>{let o=r.value,i=o.size;if(i===t.size)return;let s=i>t.size;r.issues.push({origin:Se(o),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),En=g("$ZodCheckMaxLength",(e,t)=>{var n;Z.init(e,t),(n=e._zod.def).when??(n.when=Pn),e._zod.onattach.push(r=>{let o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;
72
- t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let o=r.value,i=o.length;if((typeof o=="string"&&i>t.maximum?ae(o):i)<=t.maximum)return;let a=Ne(o);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Tn=g("$ZodCheckMinLength",(e,t)=>{var n;Z.init(e,t),(n=e._zod.def).when??(n.when=Pn),e._zod.onattach.push(r=>{let o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let o=r.
73
- value,i=o.length;if((typeof o=="string"&&i>=t.minimum&&i<t.minimum*2?ae(o):i)>=t.minimum)return;let a=Ne(o);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Ln=g("$ZodCheckLengthEquals",(e,t)=>{var n;Z.init(e,t),(n=e._zod.def).when??(n.when=Pn),e._zod.onattach.push(r=>{let o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{let o=r.value,i=o.length,s=typeof o=="string"&&i>=t.length&&i<=t.length*2?ae(
74
- o):i;if(s===t.length)return;let a=Ne(o),c=s>t.length;r.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),we=g("$ZodCheckStringFormat",(e,t)=>{var n,r;Z.init(e,t),e._zod.onattach.push(o=>{let i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.
75
- issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Dn=g("$ZodCheckRegex",(e,t)=>{we.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Vn=g("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=kn),
76
- we.init(e,t)}),jn=g("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=xn),we.init(e,t)}),Rn=g("$ZodCheckIncludes",(e,t)=>{Z.init(e,t);let n=q(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{let i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,
77
- continue:!t.abort})}}),Fn=g("$ZodCheckStartsWith",(e,t)=>{Z.init(e,t);let n=new RegExp(`^${q(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{let o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),Mn=g("$ZodCheckEndsWith",(e,t)=>{Z.init(e,t);let n=new RegExp(`.*${q(t.suffix)}$`);t.pattern??
78
- (t.pattern=n),e._zod.onattach.push(r=>{let o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function Er(e,t,n){e.issues.length&&t.issues.push(...M(n,e.issues))}u(Er,"handleCheckPropertyResult");var ot=g("$ZodCheckProperty",(e,t)=>{Z.init(e,t),e._zod.check=n=>{let r=t.schema._zod.run({value:n.value[t.property],
79
- issues:[]},{});if(r instanceof Promise)return r.then(o=>Er(o,n,t.property));Er(r,n,t.property)}}),Un=g("$ZodCheckMimeType",(e,t)=>{Z.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(r=>{r._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),Bn=g("$ZodCheckOverwrite",(e,t)=>{Z.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});var fe=class{static{u(this,"Doc")}constructor(t=[],n={}){this.content=[],this.indent=0,this.args=t,this.closed=n}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let r=t.split(`
80
- `).filter(s=>s),o=Math.min(...r.map(s=>s.length-s.trimStart().length)),i=r.map(s=>s.slice(o)).map(s=>" ".repeat(this.indent*2)+s);for(let s of i)this.content.push(s)}compile(){let t=Function,n=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
81
- ${n.join(`
82
- `)}
83
- };`)(...Object.values(this.closed))}};var Kn={major:4,minor:5,patch:4};var k=g("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Kn;let r=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...r??[]]:r?.length?[...r]:[];for(let i of o)for(let s of i._zod.onattach)s(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=u((a,c,l)=>{if(a.memo)return a;let f=te(a),p;for(let d of c){if(d._zod.def.when){if(Dt(a)||!d._zod.def.when(a))continue}else if(f)continue;let m=a.
84
- issues.length,h=d._zod.check(a);if(h instanceof Promise&&l?.async===!1)throw new B;if(p||h instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await h,a.issues.length!==m&&(Be(a.issues,m,e),f||(f=te(a,m)))});else{if(a.issues.length===m)continue;Be(a.issues,m,e),f||(f=te(a,m))}}return p?p.then(()=>a):a},"runChecks"),s=u((a,c,l)=>{if(te(a))return a.aborted=!0,a;let f=i(c,o,l);if(f instanceof Promise){if(l.async===!1)throw new B;return f.then(p=>e._zod.parse(p,l))}return e._zod.parse(f,l)},"\
85
- handleCanaryResult");e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){let f=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});return f instanceof Promise?f.then(p=>s(p,a,c)):s(f,a,c)}let l=e._zod.parse(a,c);if(l instanceof Promise){if(c.async===!1)throw new B;return l.then(f=>i(f,o,c))}return i(l,o,c)}}},{get"~standard"(){return Rt(this,"~standard",Xr(this))},set"~standard"(e){_e(this,"~standard",e)}}),Lr=u(e=>e.success?{value:e.data}:{issues:e.
86
- error?.issues},"toStandardResult");function Xr(e){return{validate:u(t=>{try{return Lr(Wt(e,t))}catch{return qt(e,t).then(Lr)}},"validate"),vendor:"zod",version:1}}u(Xr,"standardProps");var ct=g("$ZodString",(e,t)=>{k.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??bn(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),O=g("$ZodStringFormat",
87
- (e,t)=>{we.init(e,t),ct.init(e,t)}),as=g("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=on),O.init(e,t)}),cs=g("$ZodUUID",(e,t)=>{if(t.version){let r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ce(r))}else t.pattern??(t.pattern=ce());O.init(e,t)}),ls=g("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=sn),O.init(e,t)}),Wn=1,qn=2;function lt(e,t){if(!t.normalize&&t.protocol?.source===mn.source&&!/^https?:\/\//i.
88
- test(e))return Wn;try{return new URL(e)}catch{return qn}}u(lt,"parseURLObject");var fs=/[\t\n\r]/g;function ft(e){return e.replace(fs,"")}u(ft,"stripTabAndNewline");function pt(e,t){return t.lastIndex=0,t.test(e.hostname)}u(pt,"urlHostnameOk");function dt(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}u(dt,"urlProtocolOk");var ps=g("$ZodURL",(e,t)=>{O.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),o=lt(r,t);if(o===Wn){n.issues.push({code:"invali\
89
- d_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}if(o===qn){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort});return}t.hostname&&!pt(o,t.hostname)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!dt(o,t.protocol)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.
90
- source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?o.href:ft(r);return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),ds=g("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=un()),O.init(e,t)}),ms=g("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?tn:nn(t.length)),O.init(e,t)}),hs=g("$ZodCUID",(e,t)=>{t.pattern??
91
- (t.pattern=Ht),O.init(e,t)}),gs=g("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Yt),O.init(e,t)}),_s=g("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Xt),O.init(e,t)}),$s=g("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Qt),O.init(e,t)}),bs=g("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=en),O.init(e,t)}),ys=g("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=$n(t)),O.init(e,t),(t.local||t.precision===-1)&&(e._zod.bag.laxFormat=!0,e._zod.onattach.push(n=>{n._zod.bag.laxFormat=!0}))}),ws=g("$ZodISODate",(e,t)=>{t.pattern??
92
- (t.pattern=gn),O.init(e,t)}),vs=g("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=_n(t)),O.init(e,t)}),zs=g("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=rn),O.init(e,t)}),ks=g("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=an),O.init(e,t),e._zod.bag.format="ipv4"}),xs=/^[0-9a-fA-F:.]+$/;function Te(e){if(!xs.test(e))return!1;try{return new URL(`http://[${e}]`),!0}catch{return!1}}u(Te,"isValidIPv6");var Is=g("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=cn),O.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{
93
- Te(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}),Ps=g("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=ln(t.delimiter)),O.init(e,t),e._zod.bag.format="mac"}),As=g("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=fn),O.init(e,t)});function mt(e){let t=e.split("/");if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let o=Number(r);return`${o}`!==r||o<0||o>128?!1:Te(n)}u(mt,"isValidCIDRv6");var Os=g("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=pn),O.init(e,
94
- t),e._zod.check=n=>{mt(n.value)||n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}});function Le(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}u(Le,"isValidBase64");var Ss=g("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=dn),O.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Le(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function ht(e){
95
- if(!Qe.test(e))return!1;let t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Le(n)}u(ht,"isValidBase64URL");var Ns=g("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Qe),O.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{ht(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Zs=g("$ZodE164",(e,t)=>{t.pattern??(t.pattern=hn),O.init(e,t)}),Cs=/[- ]/g;function Es(e){let t=e.length,n=1,r=0;for(;t;){
96
- let o=+e[--t];n^=1,r+=n?[0,2,4,6,8,1,3,5,7,9][o]:o}return r%10===0}u(Es,"isLuhnAlgo");function gt(e){return et.test(e)?Es(e.replace(Cs,"")):!1}u(gt,"isValidCreditCard");var Ts=g("$ZodCreditCard",(e,t)=>{t.pattern??(t.pattern=et),O.init(e,t),e._zod.check=n=>{gt(n.value)||n.issues.push({code:"invalid_format",format:"credit_card",input:n.value,inst:e,continue:!t.abort})}});function _t(e,t=null){try{let n=e.split(".");if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let o=JSON.parse(atob(r));return!("\
97
- typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}u(_t,"isValidJWT");var Ls=g("$ZodJWT",(e,t)=>{O.init(e,t),e._zod.check=n=>{_t(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Ds=g("$ZodCustomStringFormat",(e,t)=>{O.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),Qr=g("$ZodNumber",(e,t)=>{k.init(e,t),e._zod.pattern=
98
- e._zod.bag.pattern??ne,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;let i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:String(o):void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),n}}),Vs=g("$ZodNumberFormat",(e,t)=>{On.init(e,t),Qr.init(e,t)}),Gn=g("$ZodBoolean",(e,t)=>{k.init(e,t),e._zod.pattern=wn,e._zod.parse=(n,r)=>{
99
- if(t.coerce)try{n.value=!!n.value}catch{}let o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),eo=g("$ZodBigInt",(e,t)=>{k.init(e,t),e._zod.pattern=yn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),js=g("$ZodBigIntFormat",(e,t)=>{Sn.init(e,t),eo.init(e,t)}),Rs=g("$ZodSymbol",(e,t)=>{k.init(e,t),e._zod.
100
- parse=(n,r)=>{let o=n.value;return typeof o=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:o,inst:e}),n}}),Fs=g("$ZodUndefined",(e,t)=>{k.init(e,t),e._zod.pattern=zn,e._zod.values=new Set([void 0]),e._zod.parse=(n,r)=>{let o=n.value;return typeof o>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:o,inst:e}),n}}),Ms=g("$ZodNull",(e,t)=>{k.init(e,t),e._zod.pattern=vn,e._zod.values=new Set([null]),e._zod.parse=(n,r)=>{let o=n.value;return o===null||n.issues.
101
- push({expected:"null",code:"invalid_type",input:o,inst:e}),n}}),Us=g("$ZodAny",(e,t)=>{k.init(e,t),e._zod.parse=n=>n}),Bs=g("$ZodUnknown",(e,t)=>{k.init(e,t),e._zod.parse=n=>n}),Ks=g("$ZodNever",(e,t)=>{k.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),Js=g("$ZodVoid",(e,t)=>{k.init(e,t),e._zod.parse=(n,r)=>{let o=n.value;return typeof o>"u"||n.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),n}}),Ws=g("$ZodDate",(e,t)=>{
102
- k.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let o=n.value,i=o instanceof Date;return i&&!Number.isNaN(o.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:o,...i?{received:"Invalid Date"}:{},inst:e}),n}});function Dr(e,t,n){e.issues.length&&t.issues.push(...M(n,e.issues)),t.value[n]=e.value}u(Dr,"handleArrayResult");var qs=g("$ZodArray",(e,t)=>{k.init(e,t);let n=V.memoizer;n?.attach(e),e._zod.parse=(r,o)=>{let i=r.value;if(!Array.isArray(i))
103
- return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=n?n.alloc(e,r,Array(i.length),o):Array(i.length);let s=[];for(let a=0;a<i.length;a++){let c=i[a],l=t.element._zod.run({value:c,issues:[]},o);l instanceof Promise?s.push(l.then(f=>Dr(f,r,a))):Dr(l,r,a)}return s.length?Promise.all(s).then(()=>r):r}});function at(e,t,n,r,o,i){let s=n in r,a=i==="optional";if(!(!s&&a&&o==="optional")){if(e.issues.length){if(o!==void 0&&a&&!s)return;t.issues.push(...M(n,e.issues))}if(!s&&
104
- o===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?s&&(t.value[n]=void 0):t.value[n]=e.value}}u(at,"handlePropertyResult");var Gs=[];function to(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Gs,o=r.length?[...t,...r]:t;for(let s of o)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(s)}": expected a Zod schema`);let i=Et(e.shape);
105
- return{...e,allKeys:o,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}u(to,"normalizeDef");function no(e,t,n,r,o,i){let s=[],a=o.keySet,c=o.catchall._zod,l=c.def.type,f=c.optin,p=c.optout;for(let d in t){if(a.has(d))continue;if(d==="__proto__"){l==="never"&&s.push(d);continue}if(l==="never"){s.push(d);continue}let m=c.run({value:t[d],issues:[]},r);m instanceof Promise?e.push(m.then(h=>at(h,n,d,t,f,p))):at(m,n,d,t,f,p)}return s.length&&n.issues.push({code:"unrecognized_ke\
106
- ys",keys:s,input:t,inst:i,continue:!0}),e.length?Promise.all(e).then(()=>n):n}u(no,"handleCatchall");var Jn=new WeakMap,ro=g("$ZodObject",(e,t)=>{if(k.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let c=t.shape;Jn.set(t,c),Object.defineProperty(t,"shape",{get:u(()=>{let l={...c};return Object.defineProperty(t,"shape",{value:l}),Jn.set(t,l),l},"get")})}let r=$e(()=>to(t));x(e,"propValues",c=>{let l=c.def.shape,f={};for(let p in l){let d=l[p]._zod;if(d.values){Object.prototype.hasOwnProperty.
107
- call(f,p)||T(f,p,new Set);for(let m of d.values)f[p].add(m);d.optin!==void 0&&f[p].add(void 0)}}return f});let o=ue,i=t.catchall,s,a=V.memoizer;a?.attach(e),e._zod.parse=(c,l)=>{s??(s=r.value);let f=c.value;if(!o(f))return c.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),c;c.value=a?a.alloc(e,c,{},l):{};let p=[],d=s.shape;for(let m of s.allKeys){if(m==="__proto__")continue;let h=d[m],$=h._zod.optin,b=h._zod.optout,N=h._zod.run({value:f[m],issues:[]},l);N instanceof Promise?p.
108
- push(N.then(y=>at(y,c,m,f,$,b))):at(N,c,m,f,$,b)}return i?no(p,f,c,l,r.value,e):p.length?Promise.all(p).then(()=>c):c}}),Hs=g("$ZodObjectJIT",(e,t)=>{ro.init(e,t);let n=e._zod.parse,r=$e(()=>to(t)),o=V.memoizer,i=u(m=>{let h=r.value,$=h.symbolKeys,b=new fe(["payload","ctx"],{shape:m,inst:e,memo:o,syms:$}),N=u(C=>`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`,"parseStr"),y=u((C,P)=>`
109
- for (let i = 0; i < ${C}.issues.length; i++) {
110
- const iss = ${C}.issues[i];
111
- iss.path = iss.path ? [${P}, ...iss.path] : [${P}];
112
- payload.issues.push(iss);
113
- }`,"prefixStr");b.write("const input = payload.value;");let z=Object.create(null),S=0;for(let C of h.allKeys)z[C]=`key_${S++}`;b.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let C of h.allKeys){if(C==="__proto__")continue;let P=z[C],D=typeof C=="symbol"?`syms[${$.indexOf(C)}]`:F(C),ke=`${D} in input`,dr=m[C],mr=dr?._zod?.optin,hr=mr!==void 0,No=dr?._zod?.optout==="optional";if(b.write(`const ${P} = ${N(D)};`),hr&&No){let Zo=mr==="optional"?
114
- `${P}_present`:`${P}.value !== undefined || ${P}_present`;b.write(`
115
- const ${P}_present = ${ke};
116
- if (!${P}.issues.length || ${P}_present) {
117
- if (${P}.issues.length) {${y(P,D)}
118
- }
119
-
120
- if (${Zo}) {
121
- newResult[${D}] = ${P}.value;
122
- }
123
- }
124
-
125
- `)}else hr?b.write(`
126
- if (${P}.issues.length) {${y(P,D)}
127
- }
128
-
129
- if (${P}.value === undefined) {
130
- if (${ke}) {
131
- newResult[${D}] = undefined;
132
- }
133
- } else {
134
- newResult[${D}] = ${P}.value;
135
- }
136
-
137
- `):b.write(`
138
- const ${P}_present = ${ke};
139
- if (${P}.issues.length) {${y(P,D)}
140
- }
141
- if (!${P}_present && !${P}.issues.length) {
142
- payload.issues.push({
143
- code: "invalid_type",
144
- expected: "nonoptional",
145
- input: undefined,
146
- path: [${D}]
147
- });
148
- }
149
-
150
- if (${P}_present) {
151
- newResult[${D}] = ${P}.value;
152
- }
153
-
154
- `)}return b.write("payload.value = newResult;"),b.write("return payload;"),b.compile()},"generateFastpass"),s,a=ue,c=!V.jitless,f=c&&Zt.value,p=t.catchall,d;e._zod.parse=(m,h)=>{d??(d=r.value);let $=m.value;return a($)?c&&f&&h?.async===!1&&h.jitless!==!0?(s||(s=i(t.shape)),m=s(m,h),p?no([],$,m,h,d,e):m):n(m,h):(m.issues.push({expected:"object",code:"invalid_type",input:$,inst:e}),m)}});function Vr(e,t,n,r){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let o=e.filter(i=>!te(
155
- i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(s=>U(s,r,K())))}),t)}u(Vr,"handleUnionResults");var Hn=g("$ZodUnion",(e,t)=>{k.init(e,t),x(e,"optin",r=>r.def.options.some(o=>o._zod.optin==="defaulted")?"defaulted":r.def.options.some(o=>o._zod.optin!==void 0)?"optional":void 0),x(e,"optout",r=>r.def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),x(e,"values",r=>{if(r.def.options.every(o=>o._zod.
156
- values))return new Set(r.def.options.flatMap(o=>Array.from(o._zod.values)))}),x(e,"pattern",r=>{if(r.def.options.every(o=>o._zod.pattern)){let o=r.def.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>Ie(i.source)).join("|")})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,o)=>{if(n)return n(r,o);let i=!1,s=[];for(let a of t.options){let c=a._zod.run({value:r.value,issues:[]},o);if(c instanceof Promise)s.push(c),i=!0;else{if(c.issues.length===0)return c;
157
- s.push(c)}}return i?Promise.all(s).then(a=>Vr(a,r,e,o)):Vr(s,r,e,o)}});function jr(e,t,n,r){let o=[];for(let i=0;i<e.length;i++)e[i].issues.length===0&&o.push(i);return o.length===1?(t.value=e[o[0]].value,t):(o.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(s=>U(s,r,K())))}):t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1,matches:o}),t)}u(jr,"handleExclusiveUnionResults");var Ys=g("$ZodXor",(e,t)=>{Hn.init(e,t),t.inclusive=
158
- !1;let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,o)=>{if(n)return n(r,o);let i=!1,s=[];for(let a of t.options){let c=a._zod.run({value:r.value,issues:[]},o);c instanceof Promise?(s.push(c),i=!0):s.push(c)}return i?Promise.all(s).then(a=>jr(a,r,e,o)):jr(s,r,e,o)}});function Xs(e,t){let n=e._zod,r=n.bag.optionsMap;if(!r){r=new Map;let{options:o,discriminator:i}=n.def;for(let s of o)for(let a of s._zod.propValues?.[i]??[])r.has(a)||r.set(a,s);n.bag.optionsMap=r}return r.get(
159
- t)}u(Xs,"getDiscriminatedOption");var Qs=g("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Hn.init(e,t);let n=e._zod.parse;x(e,"propValues",o=>{let i={};for(let s of o.def.options){let a=s._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${o.def.options.indexOf(s)}"`);for(let[c,l]of Object.entries(a)){Object.prototype.hasOwnProperty.call(i,c)||T(i,c,new Set);for(let f of l)i[c].add(f)}}return i}),t.options.forEach((o,i)=>{let s=Jn.get(
160
- o._zod.def);if(s&&!Object.prototype.hasOwnProperty.call(s,t.discriminator))throw new Error(`Invalid discriminated union option at index "${i}"`)});let r=$e(()=>{let o=t.options,i=new Map;for(let s of o){let a=s._zod.propValues?.[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let c of a){if(i.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);i.set(c,s)}}return i});e._zod.parse=(o,i)=>{let s=o.value;
161
- if(!ue(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;let a=r.value.get(s?.[t.discriminator]);return a?a._zod.run(o,i):t.unionFallback||i.direction==="backward"?n(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(r.value.keys()),input:s,path:[t.discriminator],inst:e}),o)}}),eu=g("$ZodIntersection",(e,t)=>{k.init(e,t),e._zod.parse=(n,r)=>{let o=n.value,i=t.left._zod.run({value:o,
162
- issues:[]},r),s=t.right._zod.run({value:o,issues:[]},r);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([c,l])=>Rr(n,c,l)):Rr(n,i,s)}});function ve(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Y(e)&&Y(t)){let n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),o={...e,...t};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(let i of r){if(i==="__proto__")continue;let s=ve(
163
- e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let o=e[r],i=t[r],s=ve(o,i);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}u(ve,"mergeValues");function Rr(e,t,n){let r=new Map,o,i=new Map,s=u((l,f)=>{let p;
164
- if(l.code==="unrecognized_keys"&&!l.path?.length)o??(o=l),p=l.keys;else if(l.code==="invalid_key"&&l.origin==="record"&&l.path?.length===1){let d=String(l.path[0]);i.has(d)||i.set(d,l),p=[d]}else return!1;for(let d of p)r.has(d)||r.set(d,{}),r.get(d)[f]=!0;return!0},"collect");for(let l of t.issues)s(l,"l")||e.issues.push(l);for(let l of n.issues)s(l,"r")||e.issues.push(l);let a=[...r].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(a.length){let l=o?a.filter(f=>o.keys.includes(f)):[];l.length&&e.issues.
165
- push({...o,keys:l});for(let f of a)!l.includes(f)&&i.has(f)&&e.issues.push(i.get(f))}let c=ve(t.value,n.value);if(!c.valid){if(te(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}u(Rr,"handleIntersectionResults");var oo=g("$ZodTuple",(e,t)=>{k.init(e,t);let n=t.items,r=V.memoizer;r?.attach(e),e._zod.parse=(o,i)=>{let s=o.value;if(!Array.isArray(s))return o.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_typ\
166
- e"}),o;o.value=r?r.alloc(e,o,[],i):[];let a=[],c=Fr(n,"optin"),l=Fr(n,"optout");if(!t.rest){if(s.length<c)return o.issues.push({code:"too_small",minimum:c,inclusive:!0,input:s,inst:e,origin:"array"}),o;s.length>n.length&&o.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:s,inst:e,origin:"array"})}let f=new Array(n.length);for(let p=0;p<n.length;p++){let d=n[p]._zod.run({value:s[p],issues:[]},i);d instanceof Promise?a.push(d.then(m=>{f[p]=m})):f[p]=d}if(t.rest){let p=n.length-1,d=s.
167
- slice(n.length);for(let m of d){p++;let h=t.rest._zod.run({value:m,issues:[]},i);h instanceof Promise?a.push(h.then($=>Mr($,o,p))):Mr(h,o,p)}}return a.length?Promise.all(a).then(()=>Ur(f,o,n,s,l)):Ur(f,o,n,s,l)}});function Fr(e,t){for(let n=e.length-1;n>=0;n--)if(!(t==="optin"?e[n]._zod.optin!==void 0:e[n]._zod.optout==="optional"))return n+1;return 0}u(Fr,"getTupleOptStart");function Mr(e,t,n){e.issues.length&&t.issues.push(...M(n,e.issues)),t.value[n]=e.value}u(Mr,"handleTupleResult");function Ur(e,t,n,r,o){
168
- for(let i=0;i<n.length;i++){let s=e[i],a=i<r.length;if(!a&&i>=o&&n[i]._zod.optin==="optional"){t.value.length=i;break}if(s.issues.length){if(!a&&i>=o){t.value.length=i;break}t.issues.push(...M(i,s.issues))}t.value[i]=s.value}for(let i=t.value.length-1;i>=r.length&&(n[i]._zod.optout==="optional"&&t.value[i]===void 0);i--)t.value.length=i;return t}u(Ur,"handleTupleResults");var tu=g("$ZodRecord",(e,t)=>{k.init(e,t);let n=V.memoizer;n?.attach(e),e._zod.parse=(r,o)=>{let i=r.value;if(!Y(i))return r.
169
- issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let s=[],a=t.keyType._zod.values;if(a&&!t.partial){r.value=n?n.alloc(e,r,{},o):{};let c=new Set;for(let f of a)if(typeof f=="string"||typeof f=="number"||typeof f=="symbol"){if(c.add(typeof f=="number"?f.toString():f),f==="__proto__")continue;let p=t.keyType._zod.run({value:f,issues:[]},o);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(p.issues.length){r.issues.push({code:"in\
170
- valid_key",origin:"record",issues:p.issues.map(h=>U(h,o,K())),input:f,path:[f],inst:e});continue}let d=p.value;if(d==="__proto__")continue;let m=t.valueType._zod.run({value:i[f],issues:[]},o);m instanceof Promise?s.push(m.then(h=>{h.issues.length&&r.issues.push(...M(f,h.issues)),r.value[d]=h.value})):(m.issues.length&&r.issues.push(...M(f,m.issues)),r.value[d]=m.value)}let l;for(let f in i)if(!c.has(f))if(t.mode==="loose"){if(f==="__proto__")continue;r.value[f]=i[f]}else l=l??[],l.push(f);l&&l.length>
171
- 0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},o):{};let c;for(let l of Reflect.ownKeys(i)){if(l==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,l))continue;let f=t.keyType._zod.run({value:l,issues:[]},o);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&ne.test(l)&&f.issues.length){let h=t.keyType._zod.run({value:Number(l),issues:[]},o);if(h instanceof Promise)
172
- throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(f=h)}if(f.issues.length){t.mode==="loose"?r.value[l]=i[l]:a?(c=c??[],c.push(l)):r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(h=>U(h,o,K())),input:l,path:[l],inst:e});continue}let d=f.value;if(d==="__proto__")continue;let m=t.valueType._zod.run({value:i[l],issues:[]},o);m instanceof Promise?s.push(m.then(h=>{h.issues.length&&r.issues.push(...M(l,h.issues)),r.value[d]=h.value})):(m.
173
- issues.length&&r.issues.push(...M(l,m.issues)),r.value[d]=m.value)}c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:c,continue:!0})}return s.length?Promise.all(s).then(()=>r):r}}),nu=g("$ZodMap",(e,t)=>{k.init(e,t);let n=V.memoizer;n?.attach(e),e._zod.parse=(r,o)=>{let i=r.value;if(!(i instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:i,inst:e}),r;let s=[];r.value=n?n.alloc(e,r,new Map,o):new Map;for(let[a,c]of i){let l=t.keyType._zod.run({value:a,
174
- issues:[]},o),f=t.valueType._zod.run({value:c,issues:[]},o);l instanceof Promise||f instanceof Promise?s.push(Promise.all([l,f]).then(([p,d])=>{Br(p,d,r,a,i,e,o)})):Br(l,f,r,a,i,e,o)}return s.length?Promise.all(s).then(()=>r):r}});function Br(e,t,n,r,o,i,s){e.issues.length&&(Oe.has(typeof r)?n.issues.push(...M(r,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:o,inst:i,issues:e.issues.map(a=>U(a,s,K()))})),t.issues.length&&(Oe.has(typeof r)?n.issues.push(...M(r,t.issues)):n.issues.
175
- push({origin:"map",code:"invalid_element",input:o,inst:i,key:r,issues:t.issues.map(a=>U(a,s,K()))})),n.value.set(e.value,t.value)}u(Br,"handleMapResult");var ru=g("$ZodSet",(e,t)=>{k.init(e,t);let n=V.memoizer;n?.attach(e),e._zod.parse=(r,o)=>{let i=r.value;if(!(i instanceof Set))return r.issues.push({input:i,inst:e,expected:"set",code:"invalid_type"}),r;let s=[];r.value=n?n.alloc(e,r,new Set,o):new Set;for(let a of i){let c=t.valueType._zod.run({value:a,issues:[]},o);c instanceof Promise?s.push(
176
- c.then(l=>Kr(l,r))):Kr(c,r)}return s.length?Promise.all(s).then(()=>r):r}});function Kr(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}u(Kr,"handleSetResult");var ou=g("$ZodEnum",(e,t)=>{k.init(e,t);let n=xe(t.entries),r=new Set(n);e._zod.values=r;let o=n.filter(i=>Oe.has(typeof i));e._zod.pattern=new RegExp(o.length?`^(${o.map(i=>q(i.toString())).join("|")})$`:"^[^\\s\\S]$"),e._zod.parse=(i,s)=>{let a=i.value;return r.has(a)||i.issues.push({code:"invalid_value",values:n,input:a,
177
- inst:e}),i}}),iu=g("$ZodLiteral",(e,t)=>{k.init(e,t);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(t.values.length?`^(${t.values.map(r=>typeof r=="string"?q(r):r?q(r.toString()):String(r)).join("|")})$`:"^[^\\s\\S]$"),e._zod.parse=(r,o)=>{let i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),su=g("$ZodFile",(e,t)=>{k.init(e,t),e._zod.parse=(n,r)=>{let o=n.value;return o instanceof File||n.issues.push({expected:"file",code:"in\
178
- valid_type",input:o,inst:e}),n}}),uu=g("$ZodTransform",(e,t)=>{k.init(e,t),e._zod.optin="optional",V.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new ye(e.constructor.name);let o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(n.value=s,n));if(o instanceof Promise)throw new B;return n.value=o,n}});function Jr(e,t){return e.value=t.issues.length?void 0:t.value,e}u(Jr,"handleOptionalResult");var io=g("$ZodOptional",(e,t)=>{k.
179
- init(e,t),x(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",x(e,"values",n=>{let r=n.def.innerType._zod.values;return r?new Set([...r,void 0]):void 0}),x(e,"pattern",n=>{let r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${Ie(r.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(n.value===void 0){if(t.innerType._zod.optin!=="defaulted")return n;let o=t.innerType._zod.run({value:n.value,issues:[]},r);return o instanceof Promise?o.then(i=>Jr(
180
- n,i)):Jr(n,o)}return t.innerType._zod.run(n,r)}}),au=g("$ZodExactOptional",(e,t)=>{io.init(e,t),x(e,"values",n=>n.def.innerType._zod.values),x(e,"pattern",n=>n.def.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),cu=g("$ZodNullable",(e,t)=>{k.init(e,t),x(e,"optin",n=>n.def.innerType._zod.optin),x(e,"optout",n=>n.def.innerType._zod.optout),x(e,"pattern",n=>{let r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${Ie(r.source)}|null)$`):void 0}),x(e,"values",n=>n.def.innerType.
181
- _zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),lu=g("$ZodDefault",(e,t)=>{k.init(e,t),e._zod.optin="defaulted",x(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;let o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>Wr(i,t)):Wr(o,t)}});function Wr(e,t){return e.value===void 0&&
182
- (e.value=t.defaultValue),e}u(Wr,"handleDefaultResult");var fu=g("$ZodPrefault",(e,t)=>{k.init(e,t),e._zod.optin="defaulted",x(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),pu=g("$ZodNonOptional",(e,t)=>{k.init(e,t),x(e,"values",n=>{let r=n.def.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(n,r)=>{let o=t.innerType._zod.run(n,r);return o instanceof
183
- Promise?o.then(i=>qr(i,e)):qr(o,e)}});function qr(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}u(qr,"handleNonOptionalResult");var du=g("$ZodSuccess",(e,t)=>{k.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new ye("ZodSuccess");let o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>(n.value=i.issues.length===0,n)):(n.value=o.issues.length===0,n)}});function Gr(e,t,n,r){return t.issues.
184
- length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(o=>U(o,r,K()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}u(Gr,"handleCatchResult");var mu=g("$ZodCatch",(e,t)=>{k.init(e,t),x(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),x(e,"optout",n=>n.def.innerType._zod.optout),x(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);let o=t.innerType._zod.run({value:n.
185
- value,issues:[]},r);return o instanceof Promise?o.then(i=>Gr(n,i,t,r)):Gr(n,o,t,r)}}),hu=g("$ZodNaN",(e,t)=>{k.init(e,t),e._zod.parse=(n,r)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:e,expected:"nan",code:"invalid_type"}),n)}),so=g("$ZodPipe",(e,t)=>{k.init(e,t),x(e,"values",n=>n.def.in._zod.values),x(e,"optin",n=>n.def.in._zod.optin),x(e,"optout",n=>n.def.out._zod.optout),x(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction===
186
- "backward"){let i=t.out._zod.run(n,r);return i instanceof Promise?i.then(s=>it(s,t.in,r)):it(i,t.in,r)}let o=t.in._zod.run(n,r);return o instanceof Promise?o.then(i=>it(i,t.out,r)):it(o,t.out,r)}});function it(e,t,n){return e.issues.some(r=>r.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}u(it,"handlePipeResult");var Yn=g("$ZodCodec",(e,t)=>{k.init(e,t),x(e,"values",n=>n.def.in._zod.values),x(e,"optin",n=>n.def.in._zod.optin),x(e,"optout",n=>n.def.out.
187
- _zod.optout),x(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,r)=>{if((r.direction||"forward")==="forward"){let i=t.in._zod.run(n,r);return i instanceof Promise?i.then(s=>st(s,t,r)):st(i,t,r)}else{let i=t.out._zod.run(n,r);return i instanceof Promise?i.then(s=>st(s,t,r)):st(i,t,r)}}});function st(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||"forward")==="forward"){let o=t.transform(e.value,e);return o instanceof Promise?o.then(i=>ut(e,i,t.out,n)):ut(e,o,t.out,n)}else{
188
- let o=t.reverseTransform(e.value,e);return o instanceof Promise?o.then(i=>ut(e,i,t.in,n)):ut(e,o,t.in,n)}}u(st,"handleCodecAResult");function ut(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}u(ut,"handleCodecTxResult");var gu=g("$ZodPreprocess",(e,t)=>{so.init(e,t)}),_u=g("$ZodReadonly",(e,t)=>{k.init(e,t),x(e,"propValues",n=>n.def.innerType._zod.propValues),x(e,"values",n=>n.def.innerType._zod.values),x(e,"optin",n=>n.def.innerType?._zod?.optin),x(e,"o\
189
- ptout",n=>n.def.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);let o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(Hr):Hr(o)}});function Hr(e){return e.memo||(e.value=Object.freeze(e.value)),e}u(Hr,"handleReadonlyResult");var $u=g("$ZodTemplateLiteral",(e,t)=>{k.init(e,t);let n=[];for(let r of t.parts)if(typeof r=="object"&&r!==null){if(!r._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...r.
190
- _zod.traits].shift()}`);let o=r._zod.pattern instanceof RegExp?r._zod.pattern.source:r._zod.pattern;if(!o)throw new Error(`Invalid template literal part: ${r._zod.traits}`);let i=o.startsWith("^")?1:0,s=o.endsWith("$")?o.length-1:o.length;n.push(o.slice(i,s))}else if(r===null||Ct.has(typeof r))n.push(q(`${r}`));else throw new Error(`Invalid template literal part: ${r}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(r,o)=>typeof r.value!="string"?(r.issues.push({input:r.value,inst:e,
191
- expected:"string",code:"invalid_type"}),r):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(r.value)||r.issues.push({input:r.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),r)}),bu=g("$ZodFunction",(e,t)=>(k.init(e,t),Object.defineProperty(e,"_def",{value:t}),e._zod.def=t,e.implement=n=>{if(typeof n!="function")throw new Error("implement() must be called with a function");return Object.defineProperty(function(...r){let o=e._def.input?qe(e._def.
192
- input,r):r,i=Reflect.apply(n,this,o);return e._def.output?qe(e._def.output,i):i},"_zod",{value:e._zod,enumerable:!1})},e.implementAsync=n=>{if(typeof n!="function")throw new Error("implementAsync() must be called with a function");return Object.defineProperty(async function(...r){let o=e._def.input?await He(e._def.input,r):r,i=await Reflect.apply(n,this,o);return e._def.output?await He(e._def.output,i):i},"_zod",{value:e._zod,enumerable:!1})},e._zod.parse=(n,r)=>typeof n.value!="function"?(n.issues.
193
- push({code:"invalid_type",expected:"function",input:n.value,inst:e}),n):(e._def.output&&e._def.output._zod.def.type==="promise"?n.value=e.implementAsync(n.value):n.value=e.implement(n.value),n),e.input=(...n)=>{let r=e.constructor;return Array.isArray(n[0])?new r({type:"function",input:new oo({type:"tuple",items:n[0],rest:n[1]}),output:e._def.output}):new r({type:"function",input:n[0],output:e._def.output})},e.output=n=>{let r=e.constructor;return new r({type:"function",input:e._def.input,output:n})},
194
- e)),yu=g("$ZodPromise",(e,t)=>{k.init(e,t),e._zod.parse=(n,r)=>Promise.resolve(n.value).then(o=>t.innerType._zod.run({value:o,issues:[]},r))}),wu=g("$ZodLazy",(e,t)=>{k.init(e,t),St(e._zod,"innerType",()=>{let n=t;return n._cachedInner||(n._cachedInner=t.getter()),n._cachedInner}),x(e,"pattern",n=>n.innerType?._zod?.pattern),x(e,"propValues",n=>n.innerType?._zod?.propValues),x(e,"optin",n=>n.innerType?._zod?.optin??void 0),x(e,"optout",n=>n.innerType?._zod?.optout??void 0),e._zod.parse=(n,r)=>e.
195
- _zod.innerType._zod.run(n,r)}),vu=g("$ZodCustom",(e,t)=>{Z.init(e,t),k.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{let r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(i=>Yr(i,n,r,e));Yr(o,n,r,e)}});function Yr(e,t,n,r){if(!e){let o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(be(o))}}u(Yr,"handleRefineResult");var yt=class extends Error{static{u(this,"$ZodCyclicError")}constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},Qn="~memo",uo=[];function Xn(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}u(Xn,"cloneIssues");var ao=new WeakMap;function er(e,t){let n=ao.get(e);if(n!==void 0)return n;if(t.has(e))return!0;t.add(e);let r=!1,o=u(a=>{!r&&a?._zod&&er(a,t)&&(r=!0)},"check"),i=e._zod.def,s=i.type;switch(s){case"object":{for(let a of Reflect.
196
- ownKeys(i.shape))o(i.shape[a]);o(i.catchall);break}case"array":o(i.element);break;case"tuple":for(let a of i.items)o(a);o(i.rest);break;case"record":case"map":o(i.keyType),o(i.valueType);break;case"set":o(i.valueType);break;case"union":for(let a of i.options)o(a);break;case"intersection":o(i.left),o(i.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":o(i.innerType);break;case"pipe":o(i.in),o(i.out);break;case"\
197
- function":o(i.input),o(i.output);break;case"lazy":o(e._zod.innerType);break;case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let a in i){let c=Object.getOwnPropertyDescriptor(i,a);if(!c||c.get)continue;let l=c.value;if(!(!l||typeof l!="object")){if(l._zod)o(l);else if(Array.
198
- isArray(l))for(let f of l)o(f)}}}return t.delete(e),ao.set(e,r),r}u(er,"isRecursive");function tr(e){return er(e,new Set)}u(tr,"isRecursiveSchema");function ku(e,t){let n=e.buckets.get(t);return n||(n=new Map,e.buckets.set(t,n)),n}u(ku,"bucketFor");var $t,bt=[],xu={alloc(e,t,n){let r=$t;if(!r)return n;$t=void 0;let o={value:n,issues:null};return r.set(t.value,o),bt.push(o),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let n=e._zod.parse,r=u((o,i)=>{if(i.direction!==
199
- "backward"&&wt(i,o.value))throw new yt;return n(o,i)},"wrapped");e._zod.parse=r,e._zod.run===n&&(e._zod.run=r)})},attach(e){var t;let n,r,o;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let i=e._zod.parse,s=u((a,c)=>{if(n===void 0&&(n=er(e,new Set),!n))return e._zod.parse=i,e._zod.run===s&&(e._zod.run=i),i(a,c);let l=a.value;if(l===null||typeof l!="object")return i(a,c);let f=c[Qn];f||(f={buckets:new Map,backEdges:void 0},c[Qn]=f);let p;r===c?p=o:(p=ku(f,e),r=c,o=p);let d=p.get(
200
- l);if(d)return a.value=d.value,d.issues?d.issues.length&&a.issues.push(...Xn(d.issues)):(a.memo=!0,f.backEdges??(f.backEdges=new Set),f.backEdges.add(d.value)),a;$t=p;let m=bt.length,h=i(a,c);$t=void 0;let $=bt.length>m?bt.pop():void 0;return h instanceof Promise?h.then(b=>($&&($.issues=b.issues.length?Xn(b.issues):uo),b)):($&&($.issues=h.issues.length?Xn(h.issues):uo),h)},"wrapped");e._zod.parse=s,e._zod.run===i&&(e._zod.run=s)})}};function Iu(){return xu}u(Iu,"memoizer");function wt(e,t){let n=e[Qn]?.
201
- backEdges;return n!==void 0&&t!==null&&typeof t=="object"&&n.has(t)}u(wt,"isBackEdge");var rr={};je(rr,{en:()=>nr});var Pu=u(()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(i){return e[i]??null}u(t,"getSizing");let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"\
202
- ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",credit_card:"credit card number",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};function o(i,s){return i==="number"&&typeof s=="number"&&!Number.isFinite(s)?String(s):r[i]??i}return u(o,"getTypeName"),i=>{switch(i.code){case"invalid_type":{let s=o(i.expected),
203
- a=Vt(i.input),c=o(a,i.input);return`Invalid input: expected ${s}, received ${c}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${Ue(i.values[0])}`:`Invalid option: expected one of ${Re(i.values,"|")}`;case"too_big":{let s=i.exact?"exactly ":i.inclusive?"<=":"<",a=t(i.origin);return a?`Too big: expected ${i.origin??"value"} to have ${s}${i.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${s}${i.maximum.toString()}`}case"too_small":{
204
- let s=i.exact?"exactly ":i.inclusive?">=":">",a=t(i.origin);return a?`Too small: expected ${i.origin} to have ${s}${i.minimum.toString()} ${a.unit}`:`Too small: expected ${i.origin} to be ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string:\
205
- must match pattern ${s.pattern}`:`Invalid ${n[s.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${Re(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`Invalid discriminator value. Expected ${i.options.map(a=>`'${a}'`).join(" | ")}`:i.inclusive===!1?"Invalid input: more \
206
- than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}},"error");function nr(){return{localeError:Pu()}}u(nr,"default");var co,Au=Symbol("ZodOutput"),Ou=Symbol("ZodInput"),vt=class{static{u(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){let r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){let n=t._zod.parent;if(n){let r={...this.get(n)??{}};
207
- delete r.id;let o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function lo(){return new vt}u(lo,"registry");(co=globalThis).__zod_globalRegistry??(co.__zod_globalRegistry=lo());var re=globalThis.__zod_globalRegistry;var W=Symbol.for("zod.compile.invalid"),fo=Symbol.for("zod.compile.fallback"),Q=class extends Error{static{u(this,"ZodCompileAsyncError")}constructor(t="z.compile does not support async refinements, transforms, or checks"){super(t),this.name="ZodCompileAsyncError"}},I=class extends Error{static{u(this,"ZodCompileUnsupportedError")}constructor(t,n=!0){super(`z.compile does not support ${t}; this schema must use the runtime parser`),this.name="ZodCompileUnsupportedError",this.islandable=n}};function Nu(e,t){
208
- try{return zt(e,{assertOnly:!0})}catch{return t}}u(Nu,"compileValidator");function Zu(e,t){try{let n=zt(e),r=G(e),o=e._zod.run,i=o.__originalRun??o,s=u((a,c)=>{if(c?.async||c?.direction==="backward"||c?.skipChecks||c?.[fo]||c&&wt(c,a.value))return i(a,c);let l=n(a.value);return l!==W?(a.value=l,a):(c&&(c[fo]=!0),i(a,c))},"wrapped");return s.__originalRun=i,r._zod.bag.fallbackRun=i,r._zod.bag.validator=Nu(e,n),r._zod.run=s,o.__originalRun||Cu(r,e,n),r}catch(n){if(t?.strict)throw n;return e}}u(Zu,
209
- "compile");function Cu(e,t,n){let r=e,o=t;if(typeof o.safeParse=="function"){let i=o.safeParse;r.safeParse=(s,a)=>{let c=n(s);return c!==W?{success:!0,data:c}:i(s,a)}}if(typeof o.parse=="function"){let i=o.parse;r.parse=(s,a)=>{let c=n(s);return c!==W?c:i(s,a)}}}u(Cu,"installCompiledUserMethods");function zt(e,t){let n=!0;try{n=tr(e)}catch{}if(n)throw new I("a schema whose subtree contains a reference cycle");let r={constants:new Map,constantCounter:0,varCounter:0},o=new fe(["input"]),i=E(o,r,e,
210
- "input",!t?.assertOnly);o.write(i===null?"return true;":`return ${i};`);let s=["INVALID",...r.constants.keys()],a=[W,...r.constants.values()],c=o.content.join(`
211
- `),l=t?.debug?s.length>0?`// Constants: ${s.join(", ")}
212
- ${c}`:c:"",f=Function,p=`return (input) => {
213
- ${c}
214
- }`,d;try{d=new f(...s,p)(...a)}catch(m){throw new I(`this schema (generated code failed to evaluate: ${m.message})`)}return t?.debug&&(d.code=l),d}u(zt,"compileFn");function w(e,t){for(let[r,o]of e.constants)if(o===t)return r;let n=`c${e.constantCounter++}`;return e.constants.set(n,t),n}u(w,"addConstant");function v(e){return`v${e.varCounter++}`}u(v,"newVar");function Eu(e,t){let n=e._zod.run({value:t,issues:[]},{});if(n&&typeof n.then=="function")return W;let r=n;return r.issues.length===0?r.value:
215
- W}u(Eu,"runtimeRun");function j(e,t,n,r,o=!0){let i=e.content.length,s=t.constants.size,a=t.constantCounter,c=t.varCounter;try{return E(e,t,n,r,o)}catch(l){if(!(l instanceof I)||!l.islandable)throw l;if(e.content.length=i,t.constants.size>s){let f=Array.from(t.constants.keys()).slice(s);for(let p of f)t.constants.delete(p)}return t.constantCounter=a,t.varCounter=c,Tu(e,t,n,r)}}u(j,"compileChild");function Tu(e,t,n,r){let o=w(t,n),i=w(t,Eu),s=v(t);return e.write(`const ${s} = ${i}(${o}, ${r});`),
216
- e.write(`if (${s} === INVALID) return INVALID;`),s}u(Tu,"emitRuntimeIsland");var Lu=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);function Du(e,t,n,r){let o=n._zod.def.checks;if(!o||o.length===0)return r;let i=r;for(let s of o){let a=s._zod.def;if(a.when&&!Lu.has(a.check))throw new I('check with a custom "when" condition');switch(a.check){case"greater_than":Vu(e,t,a,i);break;case"less_than":ju(e,t,a,i);break;case"multiple_of":Ru(e,t,a,i);break;case"numb\
217
- er_format":go(e,a,i);break;case"min_length":{let c=pe(a.minimum,"min_length"),l=or(e,t,i,`${i}.length >= ${c} && ${i}.length < ${a.minimum*2}`);e.write(`if (${l} < ${c}) return INVALID;`);break}case"max_length":{let c=pe(a.maximum,"max_length"),l=or(e,t,i,`${i}.length > ${c}`);e.write(`if (${l} > ${c}) return INVALID;`);break}case"length_equals":{let c=pe(a.length,"length_equals"),l=or(e,t,i,`${i}.length >= ${c} && ${i}.length <= ${a.length*2}`);e.write(`if (${l} !== ${c}) return INVALID;`);break}case"\
218
- min_size":e.write(`if (${i}.size < ${pe(a.minimum,"min_size")}) return INVALID;`);break;case"max_size":e.write(`if (${i}.size > ${pe(a.maximum,"max_size")}) return INVALID;`);break;case"size_equals":e.write(`if (${i}.size !== ${pe(a.size,"size_equals")}) return INVALID;`);break;case"string_format":i=_o(e,t,a,i);break;case"custom":i=Ku(e,t,s,i);break;case"bigint_format":Fu(e,a,i);break;case"mime_type":Mu(e,t,a,i);break;case"property":Uu(e,t,a,i);break;case"overwrite":{let c=v(t);Bu(e,t,s,i,c),i=c;
219
- break}default:throw new I(`check type ${a.check}`)}}return i}u(Du,"generateChecks");function or(e,t,n,r){let o=w(t,ae),i=v(t);return e.write(`const ${i} = typeof ${n} === "string" && ${r} ? ${o}(${n}) : ${n}.length;`),i}u(or,"codePointLengthVar");function pe(e,t){if(typeof e!="number"||!Number.isFinite(e))throw new I(`${t} bound of type ${typeof e}`);return`${e}`}u(pe,"numericOperand");function ho(e,t){if(typeof t=="bigint")return`${t}n`;if(typeof t=="number"){if(Number.isNaN(t))throw new I("com\
220
- parison check with NaN bound");return`${t}`}if(t instanceof Date){if(Number.isNaN(t.getTime()))throw new I("comparison check with Invalid Date bound");return w(e,t)}throw new I(`comparison check bound of type ${typeof t}`)}u(ho,"comparisonOperand");function Vu(e,t,n,r){let o=n.inclusive?"<":"<=";e.write(`if (${r} ${o} ${ho(t,n.value)}) return INVALID;`)}u(Vu,"generateGreaterThanCheck");function ju(e,t,n,r){let o=n.inclusive?">":">=";e.write(`if (${r} ${o} ${ho(t,n.value)}) return INVALID;`)}u(ju,
221
- "generateLessThanCheck");function Ru(e,t,n,r){if(typeof n.value=="bigint"){if(n.value===BigInt(0))throw new I("multiple_of check with a zero divisor");e.write(`if (${r} % ${n.value}n !== 0n) return INVALID;`)}else{let o=w(t,Pe);e.write(`if (${o}(${r}, ${pe(n.value,"multiple_of")}) !== 0) return INVALID;`)}}u(Ru,"generateMultipleOfCheck");function go(e,t,n){let r=t.format;switch(r){case"safeint":e.write(`if (!Number.isSafeInteger(${n})) return INVALID;`);break;case"int32":e.write(`if (!Number.isI\
222
- nteger(${n}) || ${n} < -2147483648 || ${n} > 2147483647) return INVALID;`);break;case"uint32":e.write(`if (!Number.isInteger(${n}) || ${n} < 0 || ${n} > 4294967295) return INVALID;`);break;case"float32":e.write(`if (!Number.isFinite(${n}) || ${n} < -3.4028234663852886e38 || ${n} > 3.4028234663852886e38) return INVALID;`);break;case"float64":e.write(`if (!Number.isFinite(${n})) return INVALID;`);break;default:throw new I(`number format ${r}`)}}u(go,"generateNumberFormatCheck");function Fu(e,t,n){
223
- let r=t.format;if(r)switch(r){case"int64":e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break;default:throw new I(`bigint format ${r}`)}}u(Fu,"generateBigIntFormatCheck");function Mu(e,t,n,r){let o=n.mime;if(o&&o.length>0){let i=w(t,new Set(o));e.write(`if (!${i}.has(${r}.type)) return INVALID;`)}}u(Mu,"generateMimeTypeCheck");function Uu(e,t,n,r){let o=`${r}\
224
- [${JSON.stringify(n.property)}]`;E(e,t,n.schema,o)}u(Uu,"generatePropertyCheck");function Bu(e,t,n,r,o){let i=n._zod.def.tx;if(!i)throw new I("overwrite check without a transform function");if(he(i))throw new Q("z.compile: async overwrite transforms are not supported");let s=w(t,i);e.write(`const ${o} = ${s}(${r});`)}u(Bu,"generateOverwriteCheck");function ir(){throw new B}u(ir,"throwAsync");function ur(e){this.issues.push(e)}u(ur,"pushIssue");function Ku(e,t,n,r){let o=n._zod.def;if(o.fn){if(he(
225
- o.fn))throw new Q("z.compile: async .refine() predicates are not supported");let i=w(t,o.fn),s=w(t,ir),a=v(t);return e.write(`const ${a} = ${i}(${r});`),e.write(`if (${a} instanceof Promise) ${s}();`),e.write(`if (!${a}) return INVALID;`),r}if(n._zod.check){if(he(n._zod.check))throw new Q("z.compile: async .superRefine() / check functions are not supported");let i=n._zod.check,a=w(t,u(l=>{let f={value:l,issues:[],addIssue:ur};return i(f)instanceof Promise&&ir(),f.issues.length===0?f.value:W},"he\
226
- lperFn")),c=v(t);return e.write(`const ${c} = ${a}(${r});`),e.write(`if (${c} === INVALID) return INVALID;`),c}throw new I("custom check without a predicate or check function")}u(Ku,"generateCustomRefineCheck");var Ju=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"]);function _o(e,t,n,r){let o=n.format;if(o==="base64"){let c=w(t,
227
- Le);return e.write(`if (!${c}(${r})) return INVALID;`),r}if(o==="base64url"){let c=w(t,ht);return e.write(`if (!${c}(${r})) return INVALID;`),r}if(o==="jwt"){let c=w(t,_t),l=w(t,n.alg??null);return e.write(`if (!${c}(${r}, ${l})) return INVALID;`),r}if(o==="ipv6"){let c=w(t,Te);return e.write(`if (!${c}(${r})) return INVALID;`),r}if(o==="cidrv6"){let c=w(t,mt);return e.write(`if (!${c}(${r})) return INVALID;`),r}if(o==="credit_card"){let c=w(t,gt);return e.write(`if (!${c}(${r})) return INVALID;`),
228
- r}let i=n;if(o==="url"||o==="httpurl"||i.normalize||i.hostname!==void 0||i.protocol!==void 0){let c=w(t,lt),l=w(t,n),f=v(t),p=v(t);if(e.write(`const ${f} = ${r}.trim();`),e.write(`const ${p} = ${c}(${f}, ${l});`),e.write(`if (typeof ${p} === "number") return INVALID;`),i.hostname!==void 0){let h=w(t,pt);e.write(`if (!${h}(${p}, ${l}.hostname)) return INVALID;`)}if(i.protocol!==void 0){let h=w(t,dt);e.write(`if (!${h}(${p}, ${l}.protocol)) return INVALID;`)}let d=v(t),m=i.normalize?`${p}.href`:`${w(
229
- t,ft)}(${f})`;return e.write(`const ${d} = ${m};`),d}let s=n.fn;if(s){if(he(s))throw new I(`async string format ${o}`);let c=w(t,s);return e.write(`if (!${c}(${r})) return INVALID;`),r}if(Ju.has(o)&&n.pattern){let c=w(t,n.pattern);return e.write(`${c}.lastIndex = 0;`),e.write(`if (!${c}.test(${r})) return INVALID;`),r}let a=n.format;switch(a){case"regex":throw new I("regex format without a pattern");case"lowercase":e.write(`if (${r} !== ${r}.toLowerCase()) return INVALID;`);break;case"uppercase":
230
- e.write(`if (${r} !== ${r}.toUpperCase()) return INVALID;`);break;case"includes":e.write(`if (!${r}.includes(${F(n.includes)})) return INVALID;`);break;case"starts_with":{let c=n.prefix;e.write(`if (${r}.slice(0, ${c.length}) !== ${F(c)}) return INVALID;`);break}case"ends_with":{let c=n.suffix;e.write(`if (${r}.slice(-${c.length}) !== ${F(c)}) return INVALID;`);break}default:throw new I(`string format ${a}`)}return r}u(_o,"generateStringFormatCheck");function E(e,t,n,r,o=!0){let i=n._zod.def,s=i.
231
- type;if(i.coerce)throw new I(`coercion (z.coerce.${s}())`);let a=o||!!i.checks?.length,c;switch(s){case"string":c=Wu(e,t,n,r);break;case"number":c=qu(e,n,r);break;case"boolean":c=Gu(e,r);break;case"bigint":c=Hu(e,n,r);break;case"symbol":c=Yu(e,r);break;case"undefined":c=Xu(e,r);break;case"null":c=Qu(e,r);break;case"any":case"unknown":c=r;break;case"never":e.write("return INVALID;"),c=r;break;case"void":c=ea(e,r);break;case"nan":c=ta(e,r);break;case"date":c=na(e,r);break;case"object":c=ra(e,t,n,r,
232
- a);break;case"optional":c=oa(e,t,n,r,a);break;case"nullable":c=ua(e,t,n,r,a);break;case"array":c=aa(e,t,n,r,a);break;case"literal":c=ca(e,t,n,r);break;case"enum":c=la(e,t,n,r);break;case"readonly":{let l=po(e,t,n,r),f=v(t);e.write(`const ${f} = Object.freeze(${l});`),c=f;break}case"success":po(e,t,n,r),c="true";break;case"default":case"prefault":c=fa(e,t,n,r);break;case"nonoptional":c=pa(e,t,n,r);break;case"tuple":c=da(e,t,n,r);break;case"union":c=ma(e,t,n,r);break;case"intersection":c=_a(e,t,n,
233
- r);break;case"record":c=$a(e,t,n,r);break;case"map":c=ya(e,t,n,r);break;case"set":c=wa(e,t,n,r);break;case"file":c=va(e,r);break;case"template_literal":c=za(e,t,n,r);break;case"lazy":c=ka(e,t,n,r);break;case"pipe":c=xa(e,t,n,r);break;case"custom":c=Ia(e,t,n,r);break;case"transform":c=Oa(e,t,n,r);break;case"catch":c=Aa(e,t,n,r);break;default:throw new I(`schema type ${s}`)}return c===null?null:Du(e,t,n,c)}u(E,"generateCheck");function Wu(e,t,n,r){e.write(`if (typeof ${r} !== "string") return INVA\
234
- LID;`);let o=n._zod.def;return o.format===void 0?r:_o(e,t,o,r)}u(Wu,"generateStringCheck");function qu(e,t,n){e.write(`if (typeof ${n} !== "number" || !Number.isFinite(${n})) return INVALID;`);let r=t._zod.def;return r.check==="number_format"&&r.format&&go(e,{format:r.format},n),n}u(qu,"generateNumberCheck");function Gu(e,t){return e.write(`if (typeof ${t} !== "boolean") return INVALID;`),t}u(Gu,"generateBooleanCheck");function Hu(e,t,n){e.write(`if (typeof ${n} !== "bigint") return INVALID;`);let r=t.
235
- _zod.def;if(r.format)switch(r.format){case"int64":e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break}return n}u(Hu,"generateBigIntCheck");function Yu(e,t){return e.write(`if (typeof ${t} !== "symbol") return INVALID;`),t}u(Yu,"generateSymbolCheck");function Xu(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}u(Xu,"generateUndefinedCheck");function Qu(e,t){
236
- return e.write(`if (${t} !== null) return INVALID;`),t}u(Qu,"generateNullCheck");function ea(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}u(ea,"generateVoidCheck");function ta(e,t){return e.write(`if (typeof ${t} !== "number" || !Number.isNaN(${t})) return INVALID;`),t}u(ta,"generateNaNCheck");function na(e,t){return e.write(`if (!(${t} instanceof Date) || Number.isNaN(${t}.getTime())) return INVALID;`),t}u(na,"generateDateCheck");function ra(e,t,n,r,o=!0){let i=n._zod.def;e.
237
- write(`if (typeof ${r} !== "object" || ${r} === null || Array.isArray(${r})) return INVALID;`);let s=i.shape,a=Object.keys(s),c=Object.getOwnPropertySymbols(s),l=c.length?[...a,...c]:a,f=u(y=>typeof y=="symbol"?w(t,y):F(y),"keyExpr"),p=u(y=>typeof y=="symbol"?`[${f(y)}]`:F(y),"propKey"),d=s;if(a.includes("__proto__"))throw new I('object shape key "__proto__"');let m=new Map;for(let y of l){let z=d[y],S=f(y),C=v(t);if(e.write(`const ${C} = ${r}[${S}];`),z._zod.optin!==void 0){let P=v(t);e.write(`\
238
- let ${P} = (() => {`),e.indented(D=>{let ke=j(D,t,z,C);D.write(`return ${ke};`)}),e.write("})();"),z._zod.optout==="optional"?(e.write(`if (${P} === INVALID) {`),e.indented(D=>{D.write(`if (${S} in ${r}) return INVALID;`),D.write(`${P} = undefined;`)}),e.write("}")):e.write(`if (${P} === INVALID) return INVALID;`),m.set(y,P)}else{sa(z)&&e.write(`if (!(${S} in ${r})) return INVALID;`);let P=j(e,t,z,C,o);P!==null&&m.set(y,P)}}let h=i.catchall,$="none";if(h){let y=h._zod.def.type;if(y==="never"){let z=a.
239
- map(S=>`k !== ${F(S)}`).join(" && ")||"true";e.write(`for (const k in ${r}) {`),e.indented(S=>{S.write(`if (${z}) return INVALID;`)}),e.write("}")}else(y==="unknown"||y==="any")&&!h._zod.def.checks?.length?$="passthrough":$="schema"}let b=v(t),N=l.some(y=>me(d[y])||sr(d[y]));if(!o){if($==="schema"){let y=a.length>0?w(t,new Set(a)):null;e.write(`for (const k in ${r}) {`),e.indented(z=>{z.write('if (k === "__proto__") continue;'),y&&z.write(`if (${y}.has(k)) continue;`);let S=v(t);z.write(`const ${S}\
240
- = ${r}[k];`),j(z,t,h,S,!1)}),e.write("}")}return null}if(N){e.write(`const ${b} = {};`);for(let y of l){let z=f(y),S=m.get(y);sr(d[y])?e.write(`if (${z} in ${r}) ${b}[${z}] = ${S};`):me(d[y])?e.write(`if (${S} !== undefined || ${z} in ${r}) ${b}[${z}] = ${S};`):e.write(`${b}[${z}] = ${S};`)}}else{let y=l.map(z=>`${p(z)}: ${m.get(z)}`).join(", ");e.write(`const ${b} = { ${y} };`)}if($!=="none"){let y=a.length>0?w(t,new Set(a)):null;e.write(`for (const k in ${r}) {`),e.indented(z=>{if(z.write('if\
241
- (k === "__proto__") continue;'),y&&z.write(`if (${y}.has(k)) continue;`),$==="passthrough")z.write(`${b}[k] = ${r}[k];`);else{let S=v(t);z.write(`const ${S} = ${r}[k];`);let C=j(z,t,h,S);z.write(`${b}[k] = ${C};`)}}),e.write("}")}return b}u(ra,"generateObjectCheck");function oa(e,t,n,r,o=!0){let i=n._zod.def;if(ia(n))return E(e,t,i.innerType,r,o);if(i.innerType._zod.optin==="defaulted"){let a=v(t),c=v(t);return e.write(`let ${a};`),e.write(`if (${r} === undefined) {`),e.indented(l=>{l.write(`co\
242
- nst ${c} = (() => {`),l.indented(f=>{let p=E(f,t,i.innerType,r);f.write(`return ${p};`)}),l.write("})();"),l.write(`if (${c} !== INVALID) ${a} = ${c};`)}),e.write("} else {"),e.indented(l=>{let f=E(l,t,i.innerType,r);l.write(`${a} = ${f};`)}),e.write("}"),a}let s=o?v(t):null;return s&&e.write(`let ${s};`),e.write(`if (${r} !== undefined) {`),e.indented(a=>{let c=E(a,t,i.innerType,r,o);s&&c!==null&&a.write(`${s} = ${c};`)}),e.write("}"),s}u(oa,"generateOptionalCheck");function ia(e){return e._zod.
243
- traits?.has("$ZodExactOptional")===!0}u(ia,"isExactOptional");function sa(e){return e._zod.optin===void 0&&de(e)}u(sa,"requiresPresenceCheck");function de(e){if(e._zod.def.coerce)return!0;let t=e._zod.def;switch(t.type){case"any":case"unknown":case"undefined":case"void":case"default":case"prefault":case"transform":case"custom":case"lazy":return!0;case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"never":case"nan":case"date":case"object":case"array":case"tuple":case"\
244
- record":case"map":case"set":case"file":case"template_literal":return!1;case"nonoptional":return t.innerType?de(t.innerType):!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":case"nullable":case"readonly":case"success":return t.innerType?de(t.innerType):!0;case"catch":return!0;case"union":return t.options?t.options.some(de):!0;case"intersection":return!t.left||!t.right?!0:de(t.left)&&de(t.right);case"pipe":return t.in?de(t.in):!0;default:
245
- return!0}}u(de,"fastPathAcceptsAbsence");function sr(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}u(sr,"dropsWhenAbsent");function me(e){let t=e._zod.def;switch(t.type){case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":case"never":case"success":return!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.
246
- values?.has(void 0);case"optional":return!0;case"nullable":case"readonly":case"nonoptional":return t.innerType?me(t.innerType):!0;case"union":return t.options?t.options.some(me):!0;case"intersection":return!t.left||!t.right||me(t.left)||me(t.right);case"pipe":return t.out?me(t.out):!0;default:return!0}}u(me,"mayOutputUndefined");function ua(e,t,n,r,o=!0){let i=n._zod.def,s=o?v(t):null;return s&&e.write(`let ${s} = null;`),e.write(`if (${r} !== null) {`),e.indented(a=>{let c=E(a,t,i.innerType,r,o);
247
- s&&c!==null&&a.write(`${s} = ${c};`)}),e.write("}"),s}u(ua,"generateNullableCheck");function aa(e,t,n,r,o=!0){let i=n._zod.def;e.write(`if (!Array.isArray(${r})) return INVALID;`);let s=o?v(t):null,a=v(t),c=v(t);return s&&e.write(`const ${s} = new Array(${r}.length);`),e.write(`for (let ${a} = 0; ${a} < ${r}.length; ${a}++) {`),e.indented(l=>{l.write(`const ${c} = ${r}[${a}];`);let f=j(l,t,i.element,c,o);s&&f!==null&&l.write(`${s}[${a}] = ${f};`)}),e.write("}"),s}u(aa,"generateArrayCheck");function ca(e,t,n,r){
248
- let i=n._zod.def.values;if(i.length!==1){let a=w(t,new Set(i));return e.write(`if (!${a}.has(${r})) return INVALID;`),r}let s=i[0];if(typeof s=="number"&&Number.isNaN(s)){let a=w(t,new Set(i));return e.write(`if (!${a}.has(${r})) return INVALID;`),r}if(typeof s=="string")e.write(`if (${r} !== ${F(s)}) return INVALID;`);else if(typeof s=="number"||typeof s=="boolean")e.write(`if (${r} !== ${s}) return INVALID;`);else if(s===null)e.write(`if (${r} !== null) return INVALID;`);else if(s===void 0)e.write(
249
- `if (${r} !== undefined) return INVALID;`);else if(typeof s=="bigint")e.write(`if (${r} !== ${s}n) return INVALID;`);else throw new I(`literal type ${typeof s}`);return r}u(ca,"generateLiteralCheck");function la(e,t,n,r){let o=n._zod.values;if(!o)throw new I("enum schema without enumerated values");let i=w(t,o);return e.write(`if (!${i}.has(${r})) return INVALID;`),r}u(la,"generateEnumCheck");function po(e,t,n,r){let o=n._zod.def;return E(e,t,o.innerType,r)}u(po,"generateWrapperCheck");function fa(e,t,n,r){
250
- let o=n._zod.def,s=Object.getOwnPropertyDescriptor(n._zod.def,"defaultValue")?()=>n._zod.def.defaultValue:void 0;if(n._zod.def.type==="prefault"){if(!s)return E(e,t,o.innerType,r);let c=w(t,s),l=v(t);return e.write(`let ${l} = ${r};`),e.write(`if (${r} === undefined) ${l} = ${c}();`),E(e,t,o.innerType,l)}let a=v(t);if(s){let c=w(t,s),l=w(t,Ae);e.write(`let ${a};`),e.write(`if (${r} === undefined) {`),e.indented(f=>{f.write(`${a} = ${l}(${c}());`)}),e.write("} else {"),e.indented(f=>{let p=E(f,t,
251
- o.innerType,r);f.write(`${a} = ${p} === undefined ? ${l}(${c}()) : ${p};`)}),e.write("}")}else e.write(`let ${a};`),e.write(`if (${r} !== undefined) {`),e.indented(c=>{let l=E(c,t,o.innerType,r);c.write(`${a} = ${l};`)}),e.write("}");return a}u(fa,"generateDefaultCheck");function pa(e,t,n,r){let o=n._zod.def,i=E(e,t,o.innerType,r),s=v(t);return e.write(`const ${s} = ${i};`),e.write(`if (${s} === undefined) return INVALID;`),s}u(pa,"generateNonOptionalCheck");function da(e,t,n,r){let o=n._zod.def,
252
- i=o.items,s=o.rest;e.write(`if (!Array.isArray(${r})) return INVALID;`);let a=mo(i,"optin"),c=mo(i,"optout");s?e.write(`if (${r}.length < ${a}) return INVALID;`):e.write(`if (${r}.length < ${a} || ${r}.length > ${i.length}) return INVALID;`);let l=v(t);e.write(`const ${l} = [];`);for(let f=0;f<i.length;f++){let p=i[f];if(f>=c)e.write(`if (${l}.length === ${f}) {`),e.indented(d=>{d.write(`if (${f} < ${r}.length) {`),d.indented(m=>{let h=v(t);m.write(`const ${h} = ${r}[${f}];`);let $=j(m,t,p,h);m.
253
- write(`${l}[${f}] = ${$};`)}),d.write("} else {"),d.indented(m=>{if(sr(p)){m.write(`${l}.length = ${f};`);return}let h=v(t),$=v(t);m.write(`const ${h} = undefined;`),m.write(`const ${$} = (() => {`),m.indented(b=>{let N=j(b,t,p,h);b.write(`return ${N};`)}),m.write("})();"),m.write(`if (${$} === INVALID || ${$} === undefined) ${l}.length = ${f};`),m.write(`else ${l}[${f}] = ${$};`)}),d.write("}")}),e.write("}");else{let d=v(t);e.write(`const ${d} = ${r}[${f}];`);let m=j(e,t,p,d);e.write(`${l}[${f}\
254
- ] = ${m};`)}}if(s){let f=v(t),p=v(t);e.write(`for (let ${f} = ${i.length}; ${f} < ${r}.length; ${f}++) {`),e.indented(d=>{d.write(`const ${p} = ${r}[${f}];`);let m=j(d,t,s,p);d.write(`${l}[${f}] = ${m};`)}),e.write("}")}return l}u(da,"generateTupleCheck");function mo(e,t){for(let n=e.length-1;n>=0;n--)if(!(t==="optin"?e[n]._zod.optin!==void 0:e[n]._zod.optout==="optional"))return n+1;return 0}u(mo,"getTupleOptStart");function ma(e,t,n,r){let o=n._zod.def,i=o.options;if(o.discriminator)return ha(
255
- e,t,o,r);if(o.inclusive===!1)throw new I("exclusive unions (z.xor)");if(i.length===0)return e.write("return INVALID;"),r;if(i.length===1)return E(e,t,i[0],r);if(i.every(c=>c._zod.def.type==="literal"&&!c._zod.def.checks?.length)){let c=new Set(i.flatMap(f=>f._zod.def.values)),l=w(t,c);return e.write(`if (!${l}.has(${r})) return INVALID;`),r}let a=v(t);e.write(`let ${a};`);for(let c=0;c<i.length;c++){let l=i[c];c===0?e.write(`${a} = (() => {`):e.write(`if (${a} === INVALID) ${a} = (() => {`),e.indented(
256
- f=>{let p=E(f,t,l,r);f.write(`return ${p};`)}),e.write("})();")}return e.write(`if (${a} === INVALID) return INVALID;`),a}u(ma,"generateUnionCheck");function ha(e,t,n,r){if(n.unionFallback)throw new I("discriminated union with unionFallback");if(n.options.length===0)return e.write("return INVALID;"),r;let o=v(t),i=v(t);e.write(`const ${o} = ${r}?.[${F(n.discriminator)}];`),e.write(`let ${i};`);let s=!0,a=new Set;for(let c of n.options){let l=c._zod.propValues?.[n.discriminator];if(!l||l.size===0)
257
- throw new I("discriminated union option without static discriminator values");for(let d of l){if(a.has(d))throw new I(`duplicate discriminator value ${String(d)}`);a.add(d)}let f=Array.from(l,d=>ga(t,o,d)),p=s?"if":"else if";e.write(`${p} (${f.join(" || ")}) {`),e.indented(d=>{let m=E(d,t,c,r);d.write(`${i} = ${m};`)}),e.write("}"),s=!1}return e.write("else { return INVALID; }"),i}u(ha,"generateDiscriminatedUnionCheck");function ga(e,t,n){if(typeof n=="string")return`${t} === ${F(n)}`;if(typeof n==
258
- "number")return Number.isNaN(n)?`Number.isNaN(${t})`:`${t} === ${n}`;if(typeof n=="boolean")return`${t} === ${n}`;if(n===null)return`${t} === null`;if(n===void 0)return`${t} === undefined`;if(typeof n=="bigint")return`${t} === ${n}n`;if(typeof n=="symbol"){let r=w(e,n);return`${t} === ${r}`}throw new I(`literal discriminator value ${String(n)}`)}u(ga,"literalEquality");function _a(e,t,n,r){let o=n._zod.def,i=j(e,t,o.left,r),s=j(e,t,o.right,r),a=w(t,ve),c=v(t);return e.write(`const ${c} = ${a}(${i}\
259
- , ${s});`),e.write(`if (!${c}.valid) return INVALID;`),`${c}.data`}u(_a,"generateIntersectionCheck");function $a(e,t,n,r){let o=n._zod.def,i=w(t,Y);e.write(`if (!${i}(${r})) return INVALID;`);let s=v(t),a=v(t),c=v(t);e.write(`const ${s} = {};`);let l=o,f=l.partial?void 0:o.keyType._zod.values;if(f){let h=[];for(let b of f){if(!(typeof b=="string"||typeof b=="number"||typeof b=="symbol"))throw new I(`record key value ${String(b)}`);let N=typeof b=="number"?b.toString():b;if(N==="__proto__")throw new I(
260
- 'record key "__proto__"');h.push(N);let y=w(t,b),z=E(e,t,o.keyType,y),S=v(t);e.write(`const ${S} = ${r}[${ba(t,N)}];`);let C=j(e,t,o.valueType,S);e.write(`${s}[${z}] = ${C};`)}let $=w(t,new Set(h));return e.write(`for (const ${a} in ${r}) {`),e.indented(b=>{b.write(`if (${$}.has(${a})) continue;`),l.mode==="loose"?b.write(`if (${a} !== "__proto__") ${s}[${a}] = ${r}[${a}];`):b.write("return INVALID;")}),e.write("}"),s}let p=o.keyType._zod.def;if(!(p.type==="string"&&p.format===void 0&&!p.coerce&&
261
- (p.checks?.length??0)===0)){let h=o.mode==="loose",$=w(t,zt(o.keyType)),b=w(t,ne),N=w(t,Object.prototype.propertyIsEnumerable),y=v(t);return e.write(`for (const ${a} of Reflect.ownKeys(${r})) {`),e.indented(z=>{z.write(`if (${a} === "__proto__") continue;`),z.write(`if (!${N}.call(${r}, ${a})) continue;`),z.write(`let ${y} = ${$}(${a});`),z.write(`if (${y} === INVALID && typeof ${a} === "string" && ${b}.test(${a})) ${y} = ${$}(Number(${a}));`),h?z.write(`if (${y} === INVALID) { ${s}[${a}] = ${r}\
262
- [${a}]; continue; }`):z.write(`if (${y} === INVALID) return INVALID;`),z.write(`if (${y} === "__proto__") continue;`);let S=v(t);z.write(`const ${S} = ${r}[${a}];`);let C=j(z,t,o.valueType,S);z.write(`${s}[${y}] = ${C};`)}),e.write("}"),s}let m=w(t,Object.prototype.propertyIsEnumerable);return e.write(`for (const ${a} of Reflect.ownKeys(${r})) {`),e.indented(h=>{h.write(`if (${a} === "__proto__") continue;`),h.write(`if (!${m}.call(${r}, ${a})) continue;`),h.write(`if (typeof ${a} !== "string") \
263
- return INVALID;`),h.write(`const ${c} = ${r}[${a}];`);let $=j(h,t,o.valueType,c);h.write(`${s}[${a}] = ${$};`)}),e.write("}"),s}u($a,"generateRecordCheck");function ba(e,t){return typeof t=="string"?F(t):w(e,t)}u(ba,"literalPropertyKey");function ya(e,t,n,r){let o=n._zod.def;e.write(`if (!(${r} instanceof Map)) return INVALID;`);let i=v(t),s=v(t),a=v(t);return e.write(`const ${i} = new Map();`),e.write(`for (const [${s}, ${a}] of ${r}) {`),e.indented(c=>{let l=E(c,t,o.keyType,s),f=E(c,t,o.valueType,
264
- a);c.write(`${i}.set(${l}, ${f});`)}),e.write("}"),i}u(ya,"generateMapCheck");function wa(e,t,n,r){let o=n._zod.def;e.write(`if (!(${r} instanceof Set)) return INVALID;`);let i=v(t),s=v(t);return e.write(`const ${i} = new Set();`),e.write(`for (const ${s} of ${r}) {`),e.indented(a=>{let c=E(a,t,o.valueType,s);a.write(`${i}.add(${c});`)}),e.write("}"),i}u(wa,"generateSetCheck");function va(e,t){return e.write(`if (!(${t} instanceof File)) return INVALID;`),t}u(va,"generateFileCheck");function za(e,t,n,r){
265
- e.write(`if (typeof ${r} !== "string") return INVALID;`);let o=n._zod.pattern;if(o){let i=w(t,o);e.write(`${i}.lastIndex = 0;`),e.write(`if (!${i}.test(${r})) return INVALID;`)}return r}u(za,"generateTemplateLiteralCheck");function ka(e,t,n,r){let o=n._zod.def,i=w(t,o.getter),s=w(t,{parser:null});e.write(`if (!${s}.parser) {`),e.indented(c=>{c.write(`const inner = ${i}();`),c.write(`${s}.parser = function(input) {`),c.indented(l=>{l.write("const result = inner._zod.run({ value: input, issues: []\
266
- }, {});"),l.write("return result.issues.length === 0 ? result.value : INVALID;")}),c.write("};")}),e.write("}");let a=v(t);return e.write(`const ${a} = ${s}.parser(${r});`),e.write(`if (${a} === INVALID) return INVALID;`),a}u(ka,"generateLazyCheck");function xa(e,t,n,r){let o=n._zod.def,i=E(e,t,o.in,r);if(o.transform){if(he(o.transform))throw new Q("z.compile: async transforms in pipes are not supported");let s=o.transform,c=w(t,u(f=>{let p={value:f,issues:[],addIssue:ur},d=s(f,p);return d instanceof
267
- Promise?W:p.issues.length===0?d:W},"helperFn")),l=v(t);return e.write(`const ${l} = ${c}(${i});`),e.write(`if (${l} === INVALID) return INVALID;`),E(e,t,o.out,l)}else return E(e,t,o.out,i)}u(xa,"generatePipeCheck");function he(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}u(he,"isAsyncFunction");function Ia(e,t,n,r){let o=n._zod.def;if(o.fn){if(he(o.fn))throw new Q("z.compile: async custom predicates are not supported");let i=w(t,
268
- o.fn),s=w(t,ir),a=v(t);e.write(`const ${a} = ${i}(${r});`),e.write(`if (${a} instanceof Promise) ${s}();`),e.write(`if (!${a}) return INVALID;`)}else throw new I("custom schema without a predicate function");return r}u(Ia,"generateCustomCheck");function Pa(e,t,n){let r=e._zod.run({value:n,issues:[]},{});if(r&&typeof r.then=="function")return W;let o=r;return o.issues.length===0?o.value:t()}u(Pa,"runtimeCatch");function Aa(e,t,n,r){let o=n._zod.def;if(!o.catchValue[Ke])throw new I("catch with a c\
269
- allback (only a constant catch value compiles)",!1);let i=v(t);e.write(`let ${i} = (() => {`),e.indented(l=>{let f=j(l,t,o.innerType,r);l.write(`return ${f};`)}),e.write("})();");let s=w(t,o.innerType),a=w(t,o.catchValue),c=w(t,Pa);return e.write(`if (${i} === INVALID) {`),e.indented(l=>{l.write(`${i} = ${c}(${s}, ${a}, ${r});`),l.write(`if (${i} === INVALID) return INVALID;`)}),e.write("}"),i}u(Aa,"generateCatchCheck");function Oa(e,t,n,r){let o=n._zod.def;if(o.transform){if(he(o.transform))throw new Q(
270
- "z.compile: async transforms are not supported");let i=o.transform,a=w(t,u(l=>{let f={value:l,issues:[],addIssue:ur},p=i(l,f);return p instanceof Promise?W:f.issues.length===0?p:W},"helperFn")),c=v(t);return e.write(`const ${c} = ${a}(${r});`),e.write(`if (${c} === INVALID) return INVALID;`),c}return r}u(Oa,"generateTransformCheck");function Sa(e,t){return new e({type:"string",..._(t)})}u(Sa,"_string");function Na(e,t){return new e({type:"string",coerce:!0,..._(t)})}u(Na,"_coercedString");function Za(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,..._(t)})}u(Za,"_email");function Ca(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,..._(t)})}u(Ca,"_guid");function Ea(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,..._(t)})}u(Ea,"_uuid");
271
- function Ta(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",..._(t)})}u(Ta,"_uuidv4");function La(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",..._(t)})}u(La,"_uuidv6");function Da(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",..._(t)})}u(Da,"_uuidv7");function Va(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,..._(t)})}u(Va,"_url");function ja(e,t){
272
- return new e({type:"string",format:"emoji",check:"string_format",abort:!1,..._(t)})}u(ja,"_emoji");function Ra(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,..._(t)})}u(Ra,"_nanoid");function Fa(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,..._(t)})}u(Fa,"_cuid");function Ma(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,..._(t)})}u(Ma,"_cuid2");function Ua(e,t){return new e({type:"string",format:"\
273
- ulid",check:"string_format",abort:!1,..._(t)})}u(Ua,"_ulid");function Ba(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,..._(t)})}u(Ba,"_xid");function Ka(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,..._(t)})}u(Ka,"_ksuid");function Ja(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,..._(t)})}u(Ja,"_ipv4");function Wa(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,..._(t)})}
274
- u(Wa,"_ipv6");function qa(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,..._(t)})}u(qa,"_mac");function Ga(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,..._(t)})}u(Ga,"_cidrv4");function Ha(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,..._(t)})}u(Ha,"_cidrv6");function Ya(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,..._(t)})}u(Ya,"_base64");function Xa(e,t){return new e(
275
- {type:"string",format:"base64url",check:"string_format",abort:!1,..._(t)})}u(Xa,"_base64url");function Qa(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,..._(t)})}u(Qa,"_e164");function ec(e,t){return new e({type:"string",format:"credit_card",check:"string_format",abort:!1,..._(t)})}u(ec,"_creditCard");function tc(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,..._(t)})}u(tc,"_jwt");var nc={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};
276
- function rc(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,..._(t)})}u(rc,"_isoDateTime");function oc(e,t){return new e({type:"string",format:"date",check:"string_format",..._(t)})}u(oc,"_isoDate");function ic(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,..._(t)})}u(ic,"_isoTime");function sc(e,t){return new e({type:"string",format:"duration",check:"string_format",..._(t)})}u(sc,"_isoDuration");function uc(e,t){
277
- return new e({type:"number",checks:[],..._(t)})}u(uc,"_number");function ac(e,t){return new e({type:"number",coerce:!0,checks:[],..._(t)})}u(ac,"_coercedNumber");function cc(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",..._(t)})}u(cc,"_int");function lc(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",..._(t)})}u(lc,"_float32");function fc(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",..._(t)})}
278
- u(fc,"_float64");function pc(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",..._(t)})}u(pc,"_int32");function dc(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",..._(t)})}u(dc,"_uint32");function mc(e,t){return new e({type:"boolean",..._(t)})}u(mc,"_boolean");function hc(e,t){return new e({type:"boolean",coerce:!0,..._(t)})}u(hc,"_coercedBoolean");function gc(e,t){return new e({type:"bigint",..._(t)})}u(gc,"_bigint");function _c(e,t){
279
- return new e({type:"bigint",coerce:!0,..._(t)})}u(_c,"_coercedBigint");function $c(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",..._(t)})}u($c,"_int64");function bc(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",..._(t)})}u(bc,"_uint64");function yc(e,t){return new e({type:"symbol",..._(t)})}u(yc,"_symbol");function wc(e,t){return new e({type:"undefined",..._(t)})}u(wc,"_undefined");function vc(e,t){return new e({type:"null",..._(
280
- t)})}u(vc,"_null");function zc(e){return new e({type:"any"})}u(zc,"_any");function kc(e){return new e({type:"unknown"})}u(kc,"_unknown");function xc(e,t){return new e({type:"never",..._(t)})}u(xc,"_never");function Ic(e,t){return new e({type:"void",..._(t)})}u(Ic,"_void");function Pc(e,t){return new e({type:"date",..._(t)})}u(Pc,"_date");function Ac(e,t){return new e({type:"date",coerce:!0,..._(t)})}u(Ac,"_coercedDate");function Oc(e,t){return new e({type:"nan",..._(t)})}u(Oc,"_nan");function $o(e,t){
281
- return new nt({check:"less_than",..._(t),value:e,inclusive:!1})}u($o,"_lt");function bo(e,t){return new nt({check:"less_than",..._(t),value:e,inclusive:!0})}u(bo,"_lte");function yo(e,t){return new rt({check:"greater_than",..._(t),value:e,inclusive:!1})}u(yo,"_gt");function wo(e,t){return new rt({check:"greater_than",..._(t),value:e,inclusive:!0})}u(wo,"_gte");function Sc(e){return yo(0,e)}u(Sc,"_positive");function Nc(e){return $o(0,e)}u(Nc,"_negative");function Zc(e){return bo(0,e)}u(Zc,"_nonpositive");function Cc(e){return wo(0,e)}u(Cc,"_nonnegative");function Ec(e,t){return new An({check:"multiple_of",..._(t),value:e})}u(Ec,"_multipleOf");function Tc(e,t){return new Nn({check:"max_size",..._(t),maximum:e})}u(Tc,"_maxSize");function Lc(e,t){return new Zn({check:"min_size",..._(t),minimum:e})}u(Lc,"_minSize");function Dc(e,t){return new Cn({check:"s\
282
- ize_equals",..._(t),size:e})}u(Dc,"_size");function Vc(e,t){return new En({check:"max_length",..._(t),maximum:e})}u(Vc,"_maxLength");function jc(e,t){return new Tn({check:"min_length",..._(t),minimum:e})}u(jc,"_minLength");function Rc(e,t){return new Ln({check:"length_equals",..._(t),length:e})}u(Rc,"_length");function Fc(e,t){return new Dn({check:"string_format",format:"regex",..._(t),pattern:e})}u(Fc,"_regex");function Mc(e){return new Vn({check:"string_format",format:"lowercase",..._(e)})}u(Mc,
283
- "_lowercase");function Uc(e){return new jn({check:"string_format",format:"uppercase",..._(e)})}u(Uc,"_uppercase");function Bc(e,t){return new Rn({check:"string_format",format:"includes",..._(t),includes:e})}u(Bc,"_includes");function Kc(e,t){return new Fn({check:"string_format",format:"starts_with",..._(t),prefix:e})}u(Kc,"_startsWith");function Jc(e,t){return new Mn({check:"string_format",format:"ends_with",..._(t),suffix:e})}u(Jc,"_endsWith");function Wc(e,t,n){return new ot({check:"property",
284
- property:e,schema:t,..._(n)})}u(Wc,"_property");function qc(e){return Object.entries(e).map(([t,n])=>new ot({check:"property",property:t,schema:n}))}u(qc,"_properties");function Gc(e,t){return new Un({check:"mime_type",mime:e,..._(t)})}u(Gc,"_mime");function ze(e){return new Bn({check:"overwrite",tx:e})}u(ze,"_overwrite");function Hc(e){return ze(t=>t.normalize(e))}u(Hc,"_normalize");function Yc(){return ze(e=>e.trim())}u(Yc,"_trim");function Xc(){return ze(e=>e.toLowerCase())}u(Xc,"_toLowerCase");
285
- function Qc(){return ze(e=>e.toUpperCase())}u(Qc,"_toUpperCase");function el(){return ze(e=>Nt(e))}u(el,"_slugify");function tl(e,t,n){return new e({type:"array",element:t,..._(n)})}u(tl,"_array");function nl(e,t,n){return new e({type:"union",options:t,..._(n)})}u(nl,"_union");function rl(e,t,n){return new e({type:"union",options:t,inclusive:!1,..._(n)})}u(rl,"_xor");function ol(e,t,n,r){return new e({type:"union",options:n,discriminator:t,..._(r)})}u(ol,"_discriminatedUnion");function il(e,t,n){
286
- return new e({type:"intersection",left:t,right:n})}u(il,"_intersection");function sl(e,t,n,r){let o=n instanceof k,i=o?r:n,s=o?n:null;return new e({type:"tuple",items:t,rest:s,..._(i)})}u(sl,"_tuple");function ul(e,t,n,r){return new e({type:"record",keyType:t,valueType:n,..._(r)})}u(ul,"_record");function al(e,t,n,r){return new e({type:"map",keyType:t,valueType:n,..._(r)})}u(al,"_map");function cl(e,t,n){return new e({type:"set",valueType:t,..._(n)})}u(cl,"_set");function ll(e,t,n){let r=Array.isArray(
287
- t)?Object.fromEntries(t.map(o=>[o,o])):t;return new e({type:"enum",entries:r,..._(n)})}u(ll,"_enum");function fl(e,t,n){return new e({type:"enum",entries:t,..._(n)})}u(fl,"_nativeEnum");function pl(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],..._(n)})}u(pl,"_literal");function dl(e,t){return new e({type:"file",..._(t)})}u(dl,"_file");function ml(e,t){return new e({type:"transform",transform:t})}u(ml,"_transform");function hl(e,t){return new e({type:"optional",innerType:t})}
288
- u(hl,"_optional");function gl(e,t){return new e({type:"nullable",innerType:t})}u(gl,"_nullable");function _l(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n=="function"?n():Ae(n)}})}u(_l,"_default");function $l(e,t,n){return new e({type:"nonoptional",innerType:t,..._(n)})}u($l,"_nonoptional");function bl(e,t){return new e({type:"success",innerType:t})}u(bl,"_success");function yl(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n=="function"?n:Ft(
289
- n)})}u(yl,"_catch");function wl(e,t,n){return new e({type:"pipe",in:t,out:n})}u(wl,"_pipe");function vl(e,t){return new e({type:"readonly",innerType:t})}u(vl,"_readonly");function zl(e,t,n){return new e({type:"template_literal",parts:t,..._(n)})}u(zl,"_templateLiteral");function kl(e,t){return new e({type:"lazy",getter:t})}u(kl,"_lazy");function xl(e,t){return new e({type:"promise",innerType:t})}u(xl,"_promise");function Il(e,t,n){let r=_(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"\
290
- custom",fn:t,...r})}u(Il,"_custom");function Pl(e,t,n){return new e({type:"custom",check:"custom",fn:t,..._(n)})}u(Pl,"_refine");function Al(e,t){let n=vo(r=>(r.addIssue=o=>{if(typeof o=="string")r.issues.push(be(o,r.value,n._zod.def));else{let i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=r.value),i.inst??(i.inst=n),i.continue??(i.continue=!n._zod.def.abort),r.issues.push(be(i))}},e(r.value,r)),t);return n}u(Al,"_superRefine");function vo(e,t){let n=new Z({check:"\
291
- custom",..._(t)});return n._zod.check=e,n}u(vo,"_check");function Ol(e){let t=new Z({check:"describe"});return t._zod.onattach=[n=>{let r=re.get(n)??{};re.add(n,{...r,description:e})}],t._zod.check=()=>{},t}u(Ol,"describe");function Sl(e){let t=new Z({check:"meta"});return t._zod.onattach=[n=>{let r=re.get(n)??{};re.add(n,{...r,...e})}],t._zod.check=()=>{},t}u(Sl,"meta");function Nl(e,t){let n=_(t),r=n.truthy??["true","1","yes","on","y","enabled"],o=n.falsy??["false","0","no","off","n","disabled"];
292
- n.case!=="sensitive"&&(r=r.map(m=>typeof m=="string"?m.toLowerCase():m),o=o.map(m=>typeof m=="string"?m.toLowerCase():m));let i=new Set(r),s=new Set(o),a=e.Codec??Yn,c=e.Boolean??Gn,l=e.String??ct,f=new l({type:"string",error:n.error}),p=new c({type:"boolean",error:n.error}),d=new a({type:"pipe",in:f,out:p,transform:u(((m,h)=>{let $=m;return n.case!=="sensitive"&&($=$.toLowerCase()),i.has($)?!0:s.has($)?!1:(h.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...s],input:h.value,
293
- inst:d,continue:!1}),{})}),"transform"),reverseTransform:u(((m,h)=>m===!0?r[0]||"true":o[0]||"false"),"reverseTransform"),error:n.error});return d._zod.bag.truthy=r,d._zod.bag.falsy=o,d._zod.bag.case=n.case??"insensitive",d}u(Nl,"_stringbool");function Zl(e,t,n,r={}){let o=_(r),i={check:"string_format",type:"string",format:t,fn:typeof n=="function"?n:a=>n.test(a),...o};return n instanceof RegExp&&(i.pattern=n),new e(i)}u(Zl,"_stringFormat");function De(e,...t){for(let n of t)for(let r of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,r)&&T(e,r,n[r]);return e}u(De,"assignProps");function oe(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??re,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,
294
- cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}u(oe,"initializeContext");function L(e,t,n,r,o){let i=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:r.path,message:o}):t.unrepresentable;if(i==="any")return!1;if(i===void 0||i==="throw")throw new Error(o);return Object.assign(n,i),!0}u(L,"handleUnrepresentable");function A(e,t,n={path:[],schemaPath:[]}){var r;let o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,
295
- n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;let s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{let f={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,f);else{let d=s.schema,m=t.processors[o.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);m(e,t,d,f)}let p=e.
296
- _zod.parent;p&&(s.ref||(s.ref=p),A(p,t,f),t.seen.get(p).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&De(s.schema,c),t.io==="input"&&R(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&"_prefault"in s.schema&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}u(A,"process");function zo(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}u(zo,"encodeJSONPointerSegment");function ie(e,t){let n=e.seen.get(t);if(!n)throw new Error(
297
- "Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let s of e.seen.entries()){let a=e.metadataRegistry.get(s[0])?.id;if(a){let c=r.get(a);if(c&&c!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,s[0])}}let o=u(s=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.
298
- get(s[0])?.id,d=e.external.uri??(h=>h);if(p)return{ref:d(p)};let m=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=m,{defId:m,ref:`${d("__shared")}#/${a}/${zo(m)}`}}let c="#",l=`${c}/${a}/`;if(s[1]===n&&!s[1].schema.id)return{ref:c};let f=s[1].schema.id??`__schema${e.counter++}`;return{defId:f,ref:l+zo(f)}},"makeURI"),i=u(s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:l}=o(s);a.def={...a.schema},l&&(a.defId=l);let f=a.schema;for(let p in f)delete f[p];f.$ref=c},"extr\
299
- actToDef");if(e.cycles==="throw")for(let s of e.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
300
-
301
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let a=s[1];if(t===s[0]){i(s);continue}if(e.external){let l=e.external.registry.get(s[0])?.id;if(t!==s[0]&&l){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(a.cycle){i(s);continue}if(a.count>1&&e.reused==="ref"){i(s);continue}}e.external&&(e.sharedDefsExtractedFor=e.external)}u(ie,"extractDefs");function Io(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==
302
- void 0)return;let n=[];for(let r of t){if(!r||typeof r!="object")return;Io(r);let o=Object.keys(r);if(o.length!==1||o[0]!=="type")return;let i=r.type;for(let s of Array.isArray(i)?i:[i]){if(typeof s!="string")return;n.includes(s)||n.push(s)}}delete e.anyOf,e.type=n.length===1?n[0]:n}u(Io,"compactTypeUnion");var Po=new Set(["type","properties","required","additionalProperties"]),ko=["oneOf","anyOf"];function xo(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?
303
- null:Object.keys(t).length?t:null}u(xo,"undeclaredConstraint");function ar(e){let t=[];for(let i of e){if(typeof i!="object"||i.type!=="object")return null;for(let s in i)if(!Po.has(s))return null;t.push(i)}let n={},r=new Set;for(let i of t){for(let s in i.properties){if(Object.prototype.hasOwnProperty.call(n,s))continue;let a=[];for(let l of t){let f=l.properties?.[s]??xo(l);f!=null&&(a.some(p=>JSON.stringify(p)===JSON.stringify(f))||a.push(f))}let c=a.length===1?a[0]:ar(a)??{allOf:a};T(n,s,c)}
304
- for(let s of i.required??[])r.add(s)}let o={type:"object",properties:n};if(r.size&&(o.required=[...r]),t.every(i=>i.additionalProperties===!1))o.additionalProperties=!1;else{let i=[];for(let s of t){let a=xo(s);a&&!i.some(c=>JSON.stringify(c)===JSON.stringify(a))&&i.push(a)}i.length===1?o.additionalProperties=i[0]:i.length>1&&(o.additionalProperties={allOf:i})}return o}u(ar,"foldObjects");function Cl(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let o of Po)if(o in e)return;let n=t.
305
- filter(o=>ko.some(i=>Array.isArray(o[i]))),r=null;if(!n.length)r=ar(t);else{let o=n[0],i=ko.find(c=>Array.isArray(o[c]));if(Object.keys(o).length!==1)return;let s=t.filter(c=>c!==o),a=o[i].map(c=>ar([...s,c]));if(a.some(c=>!c))return;r={[i]:a}}r&&(delete e.allOf,De(e,r))}u(Cl,"foldIntersection");function se(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let r=u(a=>{let c=e.seen.get(a);if(c.ref===null)return;let l=c.def??c.schema,f={...l},p=c.ref;if(c.
306
- ref=null,p){r(p);let m=e.seen.get(p),h=m.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(h)):De(l,h),De(l,f),a._zod.parent===p)for(let b in l)b==="$ref"||b==="allOf"||b in f||delete l[b];if(h.$ref&&m.def)for(let b in l)b==="$ref"||b==="allOf"||b in m.def&&JSON.stringify(l[b])===JSON.stringify(m.def[b])&&delete l[b]}let d=a._zod.parent;if(d&&d!==p){r(d);let m=e.seen.get(d);if(m?.schema.$ref&&(l.$ref=m.schema.$ref,m.def))
307
- for(let h in l)h==="$ref"||h==="allOf"||h in m.def&&JSON.stringify(l[h])===JSON.stringify(m.def[h])&&delete l[h]}e.override({zodSchema:a,jsonSchema:l,path:c.path??[]})},"flattenRef");if(!e.external||e.sharedEmitDoneFor!==e.external){for(let a of[...e.seen.entries()].reverse())r(a[0]);if(e.target!=="openapi-3.0")for(let a of e.seen.entries())Io(a[1].def??a[1].schema);for(let a of e.deferred)a();if(e.intersections.length){let a=new Map;for(let c of e.seen.values())for(let l of[c.schema,c.def]){let f=l?.
308
- allOf;if(!Array.isArray(f))continue;let p=a.get(f);p?p.push(l):a.set(f,[l])}for(let c of e.intersections)for(let l of a.get(c)??[])Cl(l)}}let o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` proper\
309
- ty");o.$id=e.external.uri(a)}De(o,n.defId?n.schema:n.def??n.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&o.id===i&&delete o.id;let s=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let a of e.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,T(s,c.defId,c.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{let a=JSON.parse(JSON.stringify(
310
- o));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:cr(t,"input",e.processors),output:cr(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}u(se,"finalize");function R(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return R(r.element,n);if(r.type==="set")return R(r.valueType,n);if(r.type==="lazy")return R(
311
- r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault"||r.type==="catch")return R(r.innerType,n);if(r.type==="intersection")return R(r.left,n)||R(r.right,n);if(r.type==="record"||r.type==="map")return R(r.keyType,n)||R(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:R(r.in,n)||R(r.out,n);if(r.type==="object"){for(let o in r.shape)if(R(r.shape[o],n))return!0;return!1}
312
- if(r.type==="union"){for(let o of r.options)if(R(o,n))return!0;return!1}if(r.type==="tuple"){for(let o of r.items)if(R(o,n))return!0;return!!(r.rest&&R(r.rest,n))}return!1}u(R,"isTransforming");var El=u((e,t={})=>n=>{let r=oe({...n,processors:t});return A(e,r),ie(r,e),se(r,e)},"createToJSONSchemaMethod"),cr=u((e,t,n={})=>r=>{let{libraryOptions:o,target:i}=r??{},s=oe({...o??{},target:i,io:t,processors:n});return A(e,s),ie(s,e),se(s,e)},"createStandardJSONSchemaMethod");var Tl={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Ll=u((e,t,n,r)=>{let o=n;o.type="string";let{minimum:i,maximum:s,format:a,patterns:c,contentEncoding:l,laxFormat:f}=e._zod.bag;if(typeof i=="number"&&(o.minLength=i),typeof s=="number"&&(o.maxLength=s),a&&(o.format=Tl[a]??a,o.format===""&&delete o.format,(a==="time"||f)&&delete o.format),l&&(o.contentEncoding=l),c&&c.size>0){let p=[...c];p.length===1?o.pattern=p[0].source:p.length>1&&(o.allOf=[...p.map(d=>({...t.
313
- target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},"stringProcessor"),Dl=u((e,t,n,r)=>{let o=n,{minimum:i,maximum:s,format:a,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:f}=e._zod.bag;typeof a=="string"&&a.includes("int")?o.type="integer":o.type="number";let p=typeof f=="number"&&f>=(i??Number.NEGATIVE_INFINITY),d=typeof l=="number"&&l<=(s??Number.POSITIVE_INFINITY),m=t.target==="draft-04"||t.target==="openapi-3.0";p?m?(o.minimum=f,
314
- o.exclusiveMinimum=!0):o.exclusiveMinimum=f:typeof i=="number"&&(o.minimum=i),d?m?(o.maximum=l,o.exclusiveMaximum=!0):o.exclusiveMaximum=l:typeof s=="number"&&(o.maximum=s),typeof c=="number"&&(Number.isFinite(c)&&c!==0?o.multipleOf=Math.abs(c):L(e,t,o,r,`A multipleOf divisor of ${c} cannot be represented in JSON Schema`))},"numberProcessor"),Vl=u((e,t,n,r)=>{n.type="boolean"},"booleanProcessor"),jl=u((e,t,n,r)=>{L(e,t,n,r,"BigInt cannot be represented in JSON Schema")},"bigintProcessor"),Rl=u((e,t,n,r)=>{
315
- L(e,t,n,r,"Symbols cannot be represented in JSON Schema")},"symbolProcessor"),Fl=u((e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},"nullProcessor"),Ml=u((e,t,n,r)=>{L(e,t,n,r,"Undefined cannot be represented in JSON Schema")},"undefinedProcessor"),Ul=u((e,t,n,r)=>{L(e,t,n,r,"Void cannot be represented in JSON Schema")},"voidProcessor"),Bl=u((e,t,n,r)=>{n.not={}},"neverProcessor"),Kl=u((e,t,n,r)=>{},"anyProcessor"),Jl=u((e,t,n,r)=>{},"unknownProce\
316
- ssor"),Wl=u((e,t,n,r)=>{L(e,t,n,r,"Date cannot be represented in JSON Schema")},"dateProcessor"),ql=u((e,t,n,r)=>{let o=e._zod.def,i=xe(o.entries);if(i.length===0){n.not={};return}i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),n.enum=i},"enumProcessor"),Gl=u((e,t,n,r)=>{let o=e._zod.def;if(o.values.length===0){n.not={};return}let i=[];for(let s of o.values)if(s===void 0){if(L(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))
317
- return}else if(typeof s=="bigint"){if(L(e,t,n,r,"BigInt literals cannot be represented in JSON Schema"))return;i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){let s=i[0];n.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[s]:n.const=s}else i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),i.every(s=>typeof s=="boolean")&&(n.type="boolean"),i.every(s=>s===null)&&(n.type="null"),n.enum=i},"liter\
318
- alProcessor"),Hl=u((e,t,n,r)=>{L(e,t,n,r,"NaN cannot be represented in JSON Schema")},"nanProcessor"),Yl=u((e,t,n,r)=>{let o=n,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");o.type="string",o.pattern=i.source},"templateLiteralProcessor"),Xl=u((e,t,n,r)=>{let o=n,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:c}=e._zod.bag;s!==void 0&&(i.minLength=s),a!==void 0&&(i.maxLength=a),c?c.length===1?(i.contentMediaType=c[0],Object.assign(
319
- o,i)):(Object.assign(o,i),o.anyOf=c.map(l=>({contentMediaType:l}))):Object.assign(o,i)},"fileProcessor"),Ql=u((e,t,n,r)=>{n.type="boolean"},"successProcessor"),ef=u((e,t,n,r)=>{L(e,t,n,r,"Custom types cannot be represented in JSON Schema")},"customProcessor"),tf=u((e,t,n,r)=>{L(e,t,n,r,"Function types cannot be represented in JSON Schema")},"functionProcessor"),nf=u((e,t,n,r)=>{L(e,t,n,r,"Transforms cannot be represented in JSON Schema")},"transformProcessor"),rf=u((e,t,n,r)=>{L(e,t,n,r,"Map can\
320
- not be represented in JSON Schema")},"mapProcessor"),of=u((e,t,n,r)=>{L(e,t,n,r,"Set cannot be represented in JSON Schema")},"setProcessor"),sf=u((e,t,n,r)=>{let o=n,i=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;typeof s=="number"&&(o.minItems=s),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=A(i.element,t,{...r,path:[...r.path,"items"]})},"arrayProcessor");function Ve(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?Ve(t.out):t.type==="catch"?Ve(t.innerType):
321
- e._zod.optin}u(Ve,"inputOptin");var uf=u((e,t,n,r)=>{let o=n,i=e._zod.def,s=i.shape;if(Object.getOwnPropertySymbols(s).length&&L(e,t,o,r,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(let f in s)T(o.properties,f,A(s[f],t,{...r,path:[...r.path,"properties",f]}));let c=new Set(Object.keys(s)),l=new Set([...c].filter(f=>{let p=i.shape[f];return t.io==="input"?Ve(p)===void 0:p._zod.optout===void 0}));l.size>0&&(o.required=Array.from(l)),i.catchall?._zod.
322
- def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=A(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},"objectProcessor"),af=u((e,t,n,r)=>{let o=e._zod.def,i=o.inclusive===!1,s=o.options.map((a,c)=>A(a,t,{...r,path:[...r.path,i?"oneOf":"anyOf",c]}));i?n.oneOf=s:n.anyOf=s},"unionProcessor"),cf=u((e,t,n,r)=>{let o=e._zod.def,i=A(o.left,t,{...r,path:[...r.path,"allOf",0]}),s=A(o.right,t,{...r,path:[...r.
323
- path,"allOf",1]}),a=u(l=>"allOf"in l&&Object.keys(l).length===1,"isSimpleIntersection"),c=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];n.allOf=c,t.intersections.push(c)},"intersectionProcessor"),lf=u((e,t,n,r)=>{let o=n,i=e._zod.def;o.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=i.items.map(($,b)=>A($,t,{...r,path:[...r.path,s,b]})),l=i.rest?A(i.rest,t,{...r,path:[...r.path,a,...t.target==="ope\
324
- napi-3.0"?[i.items.length]:[]]}):null,f=i.items.length;for(;f>0;){let $=i.items[f-1];if(!(t.io==="input"?Ve($)!==void 0:$._zod.optout==="optional"))break;f--}let p=i.items.length,d=!i.rest;t.target==="draft-2020-12"?(o.prefixItems=c,d?o.items=!1:l&&(o.items=l),f>0&&(o.minItems=f),d&&(o.maxItems=p)):t.target==="openapi-3.0"?(o.items={anyOf:c},l&&o.items.anyOf.push(l),f>0&&(o.minItems=f),d&&(o.maxItems=p)):(o.items=c,d?o.additionalItems=!1:l&&(o.additionalItems=l),f>0&&(o.minItems=f),d&&(o.maxItems=
325
- p));let{minimum:m,maximum:h}=e._zod.bag;typeof m=="number"&&(o.minItems=m),typeof h=="number"&&(o.maxItems=h)},"tupleProcessor");function lr(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let h=e.get(t)?.def;if(!h)return t;let $=lr(e,h,n);return $===h?t:$}for(let h of["anyOf","oneOf"]){let $=t[h];if(!Array.isArray($))continue;let b=$.map(N=>lr(e,N,n));b.some((N,y)=>N!==$[y])&&(t={...t,[h]:b})}let r=Array.isArray(t.type)?t.type:[t.type],o=!r.includes("string")&&r.some(h=>h==="number"||h==="integ\
326
- er"),i=t.enum??(t.const!==void 0?[t.const]:void 0);if(!o&&!i?.some(h=>typeof h=="number"))return t;let{minimum:s,maximum:a,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:f,format:p,id:d,...m}=t;return m.enum?m.enum=m.enum.map(h=>typeof h=="number"?String(h):h):typeof m.const=="number"&&(m.const=String(m.const)),o&&(m.type="string",i||(m.pattern=(r.includes("number")?ne:Ze).source)),m}u(lr,"stringifyKeyNames");var fr=new WeakMap;function ff(e){let t=new Map;for(let r of e.seen.values())r.def&&!t.
327
- has(r.schema)&&t.set(r.schema,r);let n=new Map;for(let r of fr.get(e)??[]){let o=e.seen.get(r),i=(o?.def??o?.schema)?.propertyNames;if(!i||i===!0||n.has(i))continue;let s=lr(t,i,new Set);s!==i&&n.set(i,s)}if(n.size)for(let r of e.seen.values())for(let o of[r.schema,r.def]){let i=o&&n.get(o.propertyNames);i&&(o.propertyNames=i)}}u(ff,"rewriteKeyNames");var pf=u((e,t,n,r)=>{let o=n,i=e._zod.def;o.type="object";let s=i.keyType,c=s._zod.bag?.patterns;if(i.mode==="loose"&&c&&c.size>0){let p=A(i.valueType,
328
- t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(let d of c)T(o.patternProperties,d.source,p)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){o.propertyNames=A(i.keyType,t,{...r,path:[...r.path,"propertyNames"]});let p=fr.get(t);p||(p=[],fr.set(t,p),t.deferred.push(()=>ff(t))),p.push(e)}o.additionalProperties=A(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]})}let l=s._zod.values,f=t.io==="input"&&Ve(i.valueType)!==void 0;if(l&&!i.partial&&!f){
329
- let p=[...l].filter(d=>typeof d=="string"||typeof d=="number");p.length>0&&(o.required=p.map(String))}},"recordProcessor"),df=u((e,t,n,r)=>{let o=e._zod.def,i=A(o.innerType,t,r),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=o.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},"nullableProcessor"),mf=u((e,t,n,r)=>{let o=e._zod.def;A(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType},"nonoptionalProcessor"),pr=Symbol();function Ao(e,t,n,r,o){let i=!1,s=JSON.stringify(e,(a,c)=>typeof c!="bi\
330
- gint"?c:(i=!0,null));return i?(L(t,n,r,o,"BigInt defaults cannot be represented in JSON Schema"),pr):JSON.parse(s)}u(Ao,"serializeDefaultValue");var hf=u((e,t,n,r)=>{let o=e._zod.def;A(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType;let s=Ao(o.defaultValue,e,t,n,r);s!==pr&&(n.default=s)},"defaultProcessor"),gf=u((e,t,n,r)=>{let o=e._zod.def;A(o.innerType,t,r);let i=t.seen.get(e);if(i.ref=o.innerType,t.io!=="input")return;let s=Ao(o.defaultValue,e,t,n,r);s!==pr&&(n._prefault=s)},"prefaultP\
331
- rocessor"),_f=u((e,t,n,r)=>{let o=e._zod.def;A(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0)}catch{L(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=s},"catchProcessor"),$f=u((e,t,n,r)=>{let o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?i?o.out:o.in:o.out;A(s,t,r);let a=t.seen.get(e);a.ref=s},"pipeProcessor"),bf=u((e,t,n,r)=>{let o=e._zod.def;A(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType,
332
- n.readOnly=!0},"readonlyProcessor"),yf=u((e,t,n,r)=>{let o=e._zod.def;A(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType},"promiseProcessor"),wf=u((e,t,n,r)=>{let o=e._zod.def;A(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType},"optionalProcessor"),vf=u((e,t,n,r)=>{let o=e._zod.innerType;A(o,t,r);let i=t.seen.get(e);i.ref=o},"lazyProcessor"),kt={string:Ll,number:Dl,boolean:Vl,bigint:jl,symbol:Rl,null:Fl,undefined:Ml,void:Ul,never:Bl,any:Kl,unknown:Jl,date:Wl,enum:ql,literal:Gl,nan:Hl,
333
- template_literal:Yl,file:Xl,success:Ql,custom:ef,function:tf,transform:nf,map:rf,set:of,array:sf,object:uf,union:af,intersection:cf,tuple:lf,record:pf,nullable:df,nonoptional:mf,default:hf,prefault:gf,catch:_f,pipe:$f,readonly:bf,promise:yf,optional:wf,lazy:vf};function Oo(e,t){if("_idmap"in e){let r=e,o=oe({...t,processors:kt}),i={};for(let c of r._idmap.entries()){let[l,f]=c;A(f,o)}let s={},a={registry:r,uri:t?.uri,defs:i};o.external=a;for(let c of r._idmap.entries()){let[l,f]=c;ie(o,f),T(s,l,
334
- se(o,f))}if(Object.keys(i).length>0){let c=o.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:i}}return{schemas:s}}let n=oe({...t,processors:kt});return A(e,n),ie(n,e),se(n,e)}u(Oo,"toJSONSchema");var xt=class{static{u(this,"JSONSchemaGenerator")}get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let n=t?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=oe({processors:kt,
335
- target:n,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,n={path:[],schemaPath:[]}){return A(t,this.ctx,n)}emit(t,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,ie(this.ctx,t);let r=se(this.ctx,t),{"~standard":o,...i}=r;return i}};var So={};export{At as a,Ot as b,T as c,X as d,Y as e,G as f,_ as g,_e as h,ai as i,H as j,ci as k,g as l,fi as m,B as n,ye as o,V as p,K as q,Jt as r,J as s,gi as t,_i as u,$i as v,zr as w,bi as x,We as y,qe as z,Ge as A,He as B,Ye as C,Wt as D,Xe as E,qt as F,zi as G,xi as H,kr as I,Ii as J,xr as K,Pi as L,Ir as M,Ai as N,Pr as O,Oi as P,Ar as Q,Si as R,Or as S,Ni as T,Sr as U,Zi as V,Nr as W,Ci as X,le as Y,Z,nt as _,rt as $,An as aa,On as ba,Sn as ca,Nn as da,Zn as ea,Cn as fa,En as ga,Tn as ha,Ln as ia,
336
- we as ja,Dn as ka,Vn as la,jn as ma,Rn as na,Fn as oa,Mn as pa,ot as qa,Un as ra,Bn as sa,fe as ta,Kn as ua,k as va,Xr as wa,ct as xa,O as ya,as as za,cs as Aa,ls as Ba,Wn as Ca,qn as Da,lt as Ea,ft as Fa,pt as Ga,dt as Ha,ps as Ia,ds as Ja,ms as Ka,hs as La,gs as Ma,_s as Na,$s as Oa,bs as Pa,ys as Qa,ws as Ra,vs as Sa,zs as Ta,ks as Ua,Te as Va,Is as Wa,Ps as Xa,As as Ya,mt as Za,Os as _a,Le as $a,Ss as ab,ht as bb,Ns as cb,Zs as db,gt as eb,Ts as fb,_t as gb,Ls as hb,Ds as ib,Qr as jb,Vs as kb,
337
- Gn as lb,eo as mb,js as nb,Rs as ob,Fs as pb,Ms as qb,Us as rb,Bs as sb,Ks as tb,Js as ub,Ws as vb,qs as wb,ro as xb,Hs as yb,Hn as zb,Ys as Ab,Xs as Bb,Qs as Cb,eu as Db,ve as Eb,oo as Fb,tu as Gb,nu as Hb,ru as Ib,ou as Jb,iu as Kb,su as Lb,uu as Mb,io as Nb,au as Ob,cu as Pb,lu as Qb,fu as Rb,pu as Sb,du as Tb,mu as Ub,hu as Vb,so as Wb,Yn as Xb,gu as Yb,_u as Zb,$u as _b,bu as $b,yu as ac,wu as bc,vu as cc,yt as dc,tr as ec,Iu as fc,wt as gc,nr as hc,rr as ic,Au as jc,Ou as kc,vt as lc,lo as mc,
338
- re as nc,W as oc,Q as pc,I as qc,Zu as rc,zt as sc,Sa as tc,Na as uc,Za as vc,Ca as wc,Ea as xc,Ta as yc,La as zc,Da as Ac,Va as Bc,ja as Cc,Ra as Dc,Fa as Ec,Ma as Fc,Ua as Gc,Ba as Hc,Ka as Ic,Ja as Jc,Wa as Kc,qa as Lc,Ga as Mc,Ha as Nc,Ya as Oc,Xa as Pc,Qa as Qc,ec as Rc,tc as Sc,nc as Tc,rc as Uc,oc as Vc,ic as Wc,sc as Xc,uc as Yc,ac as Zc,cc as _c,lc as $c,fc as ad,pc as bd,dc as cd,mc as dd,hc as ed,gc as fd,_c as gd,$c as hd,bc as id,yc as jd,wc as kd,vc as ld,zc as md,kc as nd,xc as od,
339
- Ic as pd,Pc as qd,Ac as rd,Oc as sd,$o as td,bo as ud,yo as vd,wo as wd,Sc as xd,Nc as yd,Zc as zd,Cc as Ad,Ec as Bd,Tc as Cd,Lc as Dd,Dc as Ed,Vc as Fd,jc as Gd,Rc as Hd,Fc as Id,Mc as Jd,Uc as Kd,Bc as Ld,Kc as Md,Jc as Nd,Wc as Od,qc as Pd,Gc as Qd,ze as Rd,Hc as Sd,Yc as Td,Xc as Ud,Qc as Vd,el as Wd,tl as Xd,nl as Yd,rl as Zd,ol as _d,il as $d,sl as ae,ul as be,al as ce,cl as de,ll as ee,fl as fe,pl as ge,dl as he,ml as ie,hl as je,gl as ke,_l as le,$l as me,bl as ne,yl as oe,wl as pe,vl as qe,
340
- zl as re,kl as se,xl as te,Il as ue,Pl as ve,Al as we,vo as xe,Ol as ye,Sl as ze,Nl as Ae,Zl as Be,oe as Ce,L as De,A as Ee,ie as Fe,se as Ge,El as He,cr as Ie,Ll as Je,Dl as Ke,Vl as Le,jl as Me,Rl as Ne,Fl as Oe,Ml as Pe,Ul as Qe,Bl as Re,Kl as Se,Jl as Te,Wl as Ue,ql as Ve,Gl as We,Hl as Xe,Yl as Ye,Xl as Ze,Ql as _e,ef as $e,tf as af,nf as bf,rf as cf,of as df,sf as ef,uf as ff,af as gf,cf as hf,lf as if,pf as jf,df as kf,mf as lf,hf as mf,gf as nf,_f as of,$f as pf,bf as qf,yf as rf,wf as sf,
341
- vf as tf,Oo as uf,xt as vf,So as wf,zf as xf};