@yukino.js/yukino 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/{acp-LOU6R4C7.js → acp-U7GA5YRP.js} +1 -1
- package/dist/anthropic-3TRLGKHZ.js +4 -0
- package/dist/chunk-3OULXPVI.js +5 -0
- package/dist/chunk-E7FXB7TA.js +61 -0
- package/dist/{chunk-GYBJR2RB.js → chunk-IW5L5276.js} +2 -2
- package/dist/chunk-ME5UYXP4.js +1031 -0
- package/dist/chunk-P6DHMU7R.js +4 -0
- package/dist/{chunk-BPA7URET.js → chunk-SYLHBECV.js} +2 -2
- package/dist/chunk-TPWRDFEX.js +4 -0
- package/dist/chunk-WVT2D5AR.js +4 -0
- package/dist/{chunk-YVLW4WBA.js → chunk-XFVM5ZZL.js} +20 -20
- package/dist/lib/{anthropic-UC7XIWCM.js → anthropic-GAD2PGEN.js} +2 -6
- package/dist/lib/chunk-3ONNRNKQ.js +1335 -0
- package/dist/lib/{chunk-DXUJGZ5F.js → chunk-6NYUYSER.js} +3 -3
- package/dist/lib/{chunk-WDO5MWH2.js → chunk-CBBSDV2D.js} +1 -1
- package/dist/lib/{chunk-GAWWN3TY.js → chunk-D3SXNTPZ.js} +416 -39
- package/dist/lib/{chunk-64Z3SMSG.js → chunk-RVSLQCZ5.js} +84 -44
- package/dist/lib/index.d.ts +101 -113
- package/dist/lib/index.js +6268 -1810
- package/dist/lib/{openai-OL5HXQUU.js → openai-BYOGAZU5.js} +2 -4
- package/dist/lib/{providers-N35WJDJM.js → providers-YHVXG3PP.js} +1 -1
- package/dist/lib/{seatbelt-G5Z5QEDD.js → seatbelt-VE3I3EGH.js} +1 -1
- package/dist/main.js +182 -182
- package/dist/{openai-NIBMRDVB.js → openai-PYPO6SKD.js} +15 -15
- package/dist/{providers-TG3LGHNS.js → providers-6UOA2HYN.js} +1 -1
- package/dist/{seatbelt-IOLIYZZX.js → seatbelt-3YN3GMQO.js} +1 -1
- package/dist/server-NXQ6REG3.js +4 -0
- package/package.json +8 -24
- package/dist/agent-5NW5ZV5P.js +0 -4
- package/dist/anthropic-UXFSBFXM.js +0 -4
- package/dist/chunk-2HUCPWD6.js +0 -29
- package/dist/chunk-3EQYWNP6.js +0 -4
- package/dist/chunk-3SPUH3TD.js +0 -164
- package/dist/chunk-5HF4GLFR.js +0 -865
- package/dist/chunk-HBXZ6MB4.js +0 -4
- package/dist/chunk-MQAQBW7F.js +0 -35
- package/dist/chunk-OFC2GD5K.js +0 -4
- package/dist/chunk-SDXAS44V.js +0 -4
- package/dist/chunk-TJVN4NL5.js +0 -5
- package/dist/chunk-VM26JJ6N.js +0 -4
- package/dist/chunk-WNHTKUKK.js +0 -4
- package/dist/chunk-ZPYQCXWT.js +0 -5
- package/dist/lib/agent-UGEA6EVB.js +0 -16
- package/dist/lib/chunk-65EUCQOF.js +0 -259
- package/dist/lib/chunk-F2YJG72O.js +0 -150
- package/dist/lib/chunk-NIJXTKNM.js +0 -3628
- package/dist/lib/chunk-OCTB6YMC.js +0 -625
- package/dist/lib/chunk-R3NJ2EET.js +0 -540
- package/dist/lib/chunk-UKINFW65.js +0 -652
- package/dist/lib/chunk-V2EYBIAU.js +0 -323
- package/dist/lib/permissions-EAKP6IZ3.js +0 -23
- package/dist/permissions-5EQWZS7O.js +0 -4
- package/dist/server-7ENYPCYC.js +0 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __yukinoCreateRequire } from "node:module";
|
|
3
3
|
const require = __yukinoCreateRequire(import.meta.url);
|
|
4
|
-
import{d as he}from"./chunk-7MKA3SHV.js";var xe={};he(xe,{$ZodAny:()=>Ya,$ZodArray:()=>ru,$ZodAsyncError:()=>ne,$ZodBase64:()=>La,$ZodBase64URL:()=>Va,$ZodBigInt:()=>xn,$ZodBigIntFormat:()=>Ga,$ZodBoolean:()=>sr,$ZodCIDRv4:()=>Ea,$ZodCIDRv6:()=>Ca,$ZodCUID:()=>wa,$ZodCUID2:()=>za,$ZodCatch:()=>bu,$ZodCheck:()=>L,$ZodCheckBigIntFormat:()=>Ho,$ZodCheckEndsWith:()=>la,$ZodCheckGreaterThan:()=>un,$ZodCheckIncludes:()=>ca,$ZodCheckLengthEquals:()=>ia,$ZodCheckLessThan:()=>an,$ZodCheckLowerCase:()=>aa,$ZodCheckMaxLength:()=>ra,$ZodCheckMaxSize:()=>Qo,$ZodCheckMimeType:()=>ma,$ZodCheckMinLength:()=>na,$ZodCheckMinSize:()=>ea,$ZodCheckMultipleOf:()=>qo,$ZodCheckNumberFormat:()=>Yo,$ZodCheckOverwrite:()=>pa,$ZodCheckProperties:()=>fa,$ZodCheckProperty:()=>da,$ZodCheckRegex:()=>oa,$ZodCheckSizeEquals:()=>ta,$ZodCheckStartsWith:()=>sa,$ZodCheckStringFormat:()=>dt,$ZodCheckUpperCase:()=>ua,$ZodCodec:()=>dr,$ZodCreditCard:()=>Fa,$ZodCustom:()=>Pu,$ZodCustomStringFormat:()=>Ba,$ZodCyclicError:()=>jn,$ZodDate:()=>tu,$ZodDefault:()=>$u,$ZodDiscriminatedUnion:()=>au,$ZodE164:()=>Ra,$ZodEmail:()=>ya,$ZodEmoji:()=>xa,$ZodEncodeError:()=>ze,$ZodEnum:()=>du,$ZodError:()=>so,$ZodExactOptional:()=>gu,$ZodFile:()=>mu,$ZodFunction:()=>zu,$ZodGUID:()=>$a,$ZodIBAN:()=>Ma,$ZodIPv4:()=>Aa,$ZodIPv6:()=>Ta,$ZodISODate:()=>Oa,$ZodISODateTime:()=>ja,$ZodISODuration:()=>Ua,$ZodISOTime:()=>Na,$ZodIntersection:()=>uu,$ZodJWT:()=>Ja,$ZodKSUID:()=>Da,$ZodLazy:()=>fr,$ZodLiteral:()=>fu,$ZodMAC:()=>Za,$ZodMap:()=>su,$ZodNaN:()=>ku,$ZodNanoID:()=>Ia,$ZodNever:()=>Qa,$ZodNonOptional:()=>yu,$ZodNull:()=>qa,$ZodNullable:()=>vu,$ZodNumber:()=>kn,$ZodNumberFormat:()=>Ka,$ZodObject:()=>ed,$ZodObjectJIT:()=>nu,$ZodOptional:()=>wn,$ZodPipe:()=>zn,$ZodPrefault:()=>hu,$ZodPreprocess:()=>xu,$ZodPromise:()=>Su,$ZodReadonly:()=>Iu,$ZodRealError:()=>ie,$ZodRecord:()=>cu,$ZodRegistry:()=>Zn,$ZodSet:()=>lu,$ZodString:()=>Re,$ZodStringFormat:()=>Z,$ZodSuccess:()=>_u,$ZodSymbol:()=>Wa,$ZodTemplateLiteral:()=>wu,$ZodTransform:()=>pu,$ZodTuple:()=>In,$ZodType:()=>P,$ZodULID:()=>Sa,$ZodURL:()=>ka,$ZodUUID:()=>ha,$ZodUndefined:()=>Xa,$ZodUnion:()=>lr,$ZodUnknown:()=>Ha,$ZodVoid:()=>eu,$ZodXID:()=>Pa,$ZodXor:()=>iu,$brand:()=>ao,$constructor:()=>p,$input:()=>Nu,$output:()=>Ou,Doc:()=>Ve,INVALID:()=>H,JSONSchema:()=>Ff,JSONSchemaGenerator:()=>$i,NEVER:()=>oo,TimePrecision:()=>Mu,URL_BAD_FORMAT:()=>_a,URL_UNPARSEABLE:()=>ir,ZodCompileAsyncError:()=>fe,ZodCompileUnsupportedError:()=>N,_any:()=>ac,_array:()=>mc,_base64:()=>ii,_base64url:()=>oi,_bigint:()=>Qu,_boolean:()=>Yu,_catch:()=>wh,_check:()=>zf,_cidrv4:()=>ri,_cidrv6:()=>ni,_coercedBigint:()=>ec,_coercedBoolean:()=>Hu,_coercedDate:()=>dc,_coercedNumber:()=>Bu,_coercedString:()=>Lu,_creditCard:()=>Ru,_cuid:()=>Xn,_cuid2:()=>qn,_custom:()=>gc,_date:()=>lc,_decode:()=>Wr,_decodeAsync:()=>qr,_default:()=>kh,_discriminatedUnion:()=>lh,_e164:()=>ai,_email:()=>Rn,_emoji:()=>Gn,_encode:()=>Gr,_encodeAsync:()=>Xr,_endsWith:()=>bt,_enum:()=>vh,_file:()=>pc,_float32:()=>Gu,_float64:()=>Wu,_gt:()=>ge,_gte:()=>ue,_guid:()=>Fn,_iban:()=>Fu,_includes:()=>yt,_int:()=>Ku,_int32:()=>Xu,_int64:()=>tc,_intersection:()=>dh,_ipv4:()=>ei,_ipv6:()=>ti,_isoDate:()=>_r,_isoDateTime:()=>yr,_isoDuration:()=>kr,_isoTime:()=>br,_jwt:()=>ui,_ksuid:()=>Qn,_lazy:()=>Dh,_length:()=>We,_literal:()=>hh,_lowercase:()=>$t,_lt:()=>pe,_lte:()=>ae,_mac:()=>Vu,_map:()=>ph,_max:()=>ae,_maxLength:()=>Ge,_maxSize:()=>Pe,_mime:()=>xt,_min:()=>ue,_minLength:()=>ke,_minSize:()=>ve,_multipleOf:()=>Se,_nan:()=>fc,_nanoid:()=>Wn,_nativeEnum:()=>$h,_negative:()=>si,_never:()=>cc,_nonnegative:()=>di,_nonoptional:()=>xh,_nonpositive:()=>li,_normalize:()=>It,_null:()=>oc,_nullable:()=>bh,_number:()=>Ju,_optional:()=>_h,_overwrite:()=>me,_parse:()=>ut,_parseAsync:()=>ct,_pipe:()=>zh,_positive:()=>ci,_promise:()=>jh,_properties:()=>kt,_property:()=>fi,_readonly:()=>Sh,_record:()=>mh,_refine:()=>vc,_regex:()=>vt,_safeDecode:()=>Hr,_safeDecodeAsync:()=>en,_safeEncode:()=>Yr,_safeEncodeAsync:()=>Qr,_safeParse:()=>st,_safeParseAsync:()=>lt,_set:()=>gh,_size:()=>Ke,_slugify:()=>Pt,_startsWith:()=>_t,_string:()=>Cu,_stringFormat:()=>Xe,_stringbool:()=>_c,_success:()=>Ih,_superRefine:()=>$c,_symbol:()=>nc,_templateLiteral:()=>Ph,_toLowerCase:()=>zt,_toUpperCase:()=>St,_transform:()=>yh,_trim:()=>wt,_tuple:()=>fh,_uint32:()=>qu,_uint64:()=>rc,_ulid:()=>Yn,_undefined:()=>ic,_union:()=>ch,_unknown:()=>uc,_uppercase:()=>ht,_url:()=>hr,_uuid:()=>Mn,_uuidv4:()=>Jn,_uuidv6:()=>Bn,_uuidv7:()=>Kn,_void:()=>sc,_xid:()=>Hn,_xor:()=>sh,base64Charset:()=>$n,base64urlCharset:()=>cr,canParseURL:()=>ba,clone:()=>T,compile:()=>Zu,compileFn:()=>Ln,config:()=>F,createStandardJSONSchemaMethod:()=>Dt,createToJSONSchemaMethod:()=>kc,decode:()=>fg,decodeAsync:()=>pg,describe:()=>hc,encode:()=>dg,encodeAsync:()=>mg,extractDefs:()=>je,finalize:()=>Oe,flattenError:()=>qt,formatError:()=>Yt,getDiscriminatedOption:()=>ou,globalConfig:()=>B,globalRegistry:()=>G,handleUnrepresentable:()=>M,initializeContext:()=>De,isBackEdge:()=>Nn,isRecursiveSchema:()=>On,isValidBase64:()=>ur,isValidBase64URL:()=>hn,isValidCIDRv6:()=>vn,isValidCreditCard:()=>yn,isValidIBAN:()=>_n,isValidIPv6:()=>ar,isValidJWT:()=>bn,locales:()=>$r,memoizer:()=>gr,mergeValues:()=>ft,meta:()=>yc,parse:()=>Br,parseAsync:()=>Kr,parseURLObject:()=>Yl,prettifyError:()=>fo,process:()=>E,processSchema:()=>E,regexes:()=>le,registry:()=>En,safeDecode:()=>vg,safeDecodeAsync:()=>hg,safeEncode:()=>gg,safeEncodeAsync:()=>$g,safeParse:()=>ag,safeParseAsync:()=>ug,standardProps:()=>fn,stripTabAndNewline:()=>or,toDotPath:()=>jl,toJSONSchema:()=>vi,toZod:()=>Rt,treeifyError:()=>lo,urlHostnameOk:()=>pn,urlProtocolOk:()=>gn,util:()=>$,validate:()=>Ht,validateAsync:()=>Qt,validateURL:()=>mn,version:()=>ga,withParser:()=>Cn});var $={};he($,{BIGINT_FORMAT_RANGES:()=>Kt,CONSTANT_CATCH:()=>Mr,Class:()=>Xi,NUMBER_FORMAT_RANGES:()=>Bt,aborted:()=>Y,allowsEval:()=>Hi,assert:()=>zp,assertEqual:()=>kp,assertIs:()=>Ip,assertNever:()=>wp,assertNotEqual:()=>xp,assignProp:()=>K,attachSchema:()=>Fr,base64ToUint8Array:()=>Il,base64urlToUint8Array:()=>Bp,cached:()=>it,captureStackTrace:()=>Vr,cleanEnum:()=>Jp,cleanRegex:()=>_e,clone:()=>T,cloneDef:()=>Dp,codePointLength:()=>Ce,constantCatch:()=>no,createTransparentProxy:()=>Tp,defineLazy:()=>qi,defineLazyInternal:()=>O,derived:()=>Xp,esc:()=>q,escapeRegex:()=>se,explicitlyAborted:()=>to,extend:()=>Cp,finalizeIssue:()=>re,floatSafeRemainder:()=>Ft,getElementAtPath:()=>jp,getEnumValues:()=>rt,getLengthableOrigin:()=>Wt,getParsedType:()=>Ap,getSizableOrigin:()=>Gt,hexToUint8Array:()=>Gp,hide:()=>Xt,installLazyProp:()=>Qp,isObject:()=>Ee,isPlainObject:()=>ce,issue:()=>at,joinValues:()=>g,jsonStringifyReplacer:()=>nt,members:()=>ro,merge:()=>Vp,mergeDefs:()=>de,normalizeParams:()=>b,nullish:()=>Lr,numKeys:()=>Up,objectClone:()=>Sp,omit:()=>Ep,optionalKeys:()=>eo,own:()=>we,parsedType:()=>y,partial:()=>Rp,pick:()=>Zp,prefixIssues:()=>te,primitiveTypes:()=>Qi,promiseAllObject:()=>Op,propertyKeyTypes:()=>Jt,randomString:()=>Np,rawShape:()=>ot,required:()=>Fp,safeExtend:()=>Lp,shallowClone:()=>Mt,slugify:()=>Yi,stringifyPrimitive:()=>h,toZod:()=>Rt,uint8ArrayToBase64:()=>wl,uint8ArrayToBase64url:()=>Kp,uint8ArrayToHex:()=>Wp,unwrapMessage:()=>tt});function kp(e){return e}function xp(e){return e}function Rt(){return e=>e}function Ip(e){}function wp(e){throw new Error("Unexpected value in exhaustive check")}function zp(e){}function rt(e){let r=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,t])=>r.indexOf(+o)===-1).map(([o,t])=>t)}function g(e,r="|"){return e.map(i=>h(i)).join(r)}function nt(e,r){return typeof r=="bigint"?r.toString():r}var Wi=class{constructor(r){this._getter=r,this._value=void 0}get value(){let r=this._getter;return r!==void 0&&(this._value=r(),this._getter=void 0),this._value}};function it(e){return new Wi(e)}function Lr(e){return e==null}function _e(e){let r=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(r,i)}function Ft(e,r){let i=e/r,o=Math.round(i),t=4*Number.EPSILON*Math.max(Math.abs(i),1);return Math.abs(i-o)<t?0:i-o}var _l=Symbol("evaluating");function qi(e,r,i){let o;Object.defineProperty(e,r,{get(){if(o!==_l)return o===void 0&&(o=_l,o=i()),o},set(t){Object.defineProperty(e,r,{value:t})},configurable:!0})}function Sp(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function K(e,r,i){Object.defineProperty(e,r,{value:i,writable:!0,enumerable:!0,configurable:!0})}function ot(e){let r=Object.getOwnPropertyDescriptor(e,"shape");return r?.get?r.get.raw:r?.value}function ye(e){return ot(e._zod.def)??e._zod.def.shape}function bl(e,r,i){Object.defineProperty(e,r,{get(){let o=i();return K(this,r,o),o},enumerable:!0,configurable:!0})}function kl(e,r,i){r in e?K(e,r,i):e[r]=i}function Ze(e,r,i,o){let t=ye(r);for(let n of i){let a=Object.getOwnPropertyDescriptor(t,n);a.enumerable&&(a.get?bl(e,n,()=>{let u=r._zod.def.shape[n];return o?o(u,n):u}):kl(e,n,o?o(a.value,n):a.value))}}function Pp(e,r){for(let i of Reflect.ownKeys(r)){let o=Object.getOwnPropertyDescriptor(r,i);o.enumerable&&(o.get?bl(e,i,()=>r[i]):kl(e,i,o.value))}}function de(...e){let r={};for(let i of e){let o=Object.getOwnPropertyDescriptors(i);Object.assign(r,o)}return Object.defineProperties({},r)}function Dp(e){return de(e._zod.def)}function jp(e,r){return r?r.reduce((i,o)=>i?.[o],e):e}function Op(e){let r=Object.keys(e),i=r.map(o=>e[o]);return Promise.all(i).then(o=>{let t={};for(let n=0;n<r.length;n++)t[r[n]]=o[n];return t})}function Np(e=10){let r="abcdefghijklmnopqrstuvwxyz",i="";for(let o=0;o<e;o++)i+=r[Math.floor(Math.random()*r.length)];return i}function q(e){return JSON.stringify(e)}function Yi(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Vr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ee(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Hi=it(()=>{if(B.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function ce(e){if(Ee(e)===!1)return!1;let r=e.constructor;if(r===void 0||typeof r!="function")return!0;let i=r.prototype;return!(Ee(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function Mt(e){return ce(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Up(e){let r=0;for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&r++;return r}var Ap=e=>{let r=typeof e;switch(r){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 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: ${r}`)}},Jt=new Set(["string","number","symbol"]),Qi=new Set(["string","number","bigint","boolean","symbol","undefined"]);function se(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function T(e,r,i){let o=new e._zod.constr(r??e._zod.def);return(!r||i?.parent)&&(o._zod.parent=e),o}function b(e){let r=e;if(!r)return{};if(typeof r=="string")return{error:()=>r};if(r?.message!==void 0){if(r?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");r.error=r.message}return delete r.message,typeof r.error=="string"?{...r,error:()=>r.error}:r}function Tp(e){let r;return new Proxy({},{get(i,o,t){return r??(r=e()),Reflect.get(r,o,t)},set(i,o,t,n){return r??(r=e()),Reflect.set(r,o,t,n)},has(i,o){return r??(r=e()),Reflect.has(r,o)},deleteProperty(i,o){return r??(r=e()),Reflect.deleteProperty(r,o)},ownKeys(i){return r??(r=e()),Reflect.ownKeys(r)},getOwnPropertyDescriptor(i,o){return r??(r=e()),Reflect.getOwnPropertyDescriptor(r,o)},defineProperty(i,o,t){return r??(r=e()),Reflect.defineProperty(r,o,t)}})}function h(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function eo(e){return Object.keys(e).filter(r=>e[r]._zod.optin!==void 0&&e[r]._zod.optout==="optional")}var Bt={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]},Kt={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Zp(e,r){let i=e._zod.def,o=i.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let n={};return Ze(n,e,Rr(e,r)),T(e,de(i,{shape:n,checks:[]}))}function Rr(e,r){let i=ye(e),o=[];for(let t of Reflect.ownKeys(r)){if(!Object.getOwnPropertyDescriptor(i,t)?.enumerable)throw new Error(`Unrecognized key: "${String(t)}"`);r[t]&&o.push(t)}return o}function Ep(e,r){let i=e._zod.def,o=i.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let n=new Set(Rr(e,r)),a={};return Ze(a,e,Reflect.ownKeys(ye(e)).filter(u=>!n.has(u))),T(e,de(i,{shape:a,checks:[]}))}function Cp(e,r){if(!ce(r))throw new Error("Invalid input to extend: expected a plain object");let i=e._zod.def.checks;if(i&&i.length>0){let t=ye(e);for(let n of Reflect.ownKeys(r))if(Object.getOwnPropertyDescriptor(t,n)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return T(e,de(e._zod.def,{shape:xl(e,r)}))}function xl(e,r){let i={};return Ze(i,e,Reflect.ownKeys(ye(e))),Pp(i,r),i}function Lp(e,r){if(!ce(r))throw new Error("Invalid input to safeExtend: expected a plain object");return T(e,de(e._zod.def,{shape:xl(e,r)}))}function Vp(e,r){if(!r?._zod?.def)throw new Error("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 i={};Ze(i,e,Reflect.ownKeys(ye(e))),Ze(i,r,Reflect.ownKeys(ye(r)));let o=de(e._zod.def,{shape:i,get catchall(){return r._zod.def.catchall},checks:r._zod.def.checks??[]});return T(e,o)}function Rp(e,r,i,o="partial"){let n=r._zod.def.checks;if(n&&n.length>0)throw new Error(`.${o}() cannot be used on object schemas containing refinements`);let u=i?new Set(Rr(r,i)):void 0,s={};return Ze(s,r,Reflect.ownKeys(ye(r)),e&&((c,l)=>u&&!u.has(l)?c:new e({type:"optional",innerType:c}))),T(r,de(r._zod.def,{shape:s,checks:[]}))}function Fp(e,r,i){let o=i?new Set(Rr(r,i)):void 0,t={};return Ze(t,r,Reflect.ownKeys(ye(r)),(n,a)=>o&&!o.has(a)?n:new e({type:"nonoptional",innerType:n})),T(r,de(r._zod.def,{shape:t}))}function Y(e,r=0){if(e.aborted===!0)return!0;for(let i=r;i<e.issues.length;i++)if(e.issues[i]?.continue!==!0)return!0;return!1}function to(e,r=0){if(e.aborted===!0)return!0;for(let i=r;i<e.issues.length;i++)if(e.issues[i]?.continue===!1)return!0;return!1}function te(e,r){return r.map(i=>{var o;return(o=i).path??(o.path=[]),i.path.unshift(e),i})}function tt(e){return typeof e=="string"?e:e?.message}function Fr(e,r,i){var o;for(let t=r;t<e.length;t++)(o=e[t]).schema??(o.schema=i)}function re(e,r,i){var o;let t=e.inst?._zod?.traits;t?.has("$ZodType")&&(t.has("$ZodCheck")?(o=e).schema??(o.schema=e.inst):e.schema=e.inst);let n=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,a=e.message?e.message:tt(e.inst?._zod.def?.error?.(e))??tt(n?.(e))??tt(r?.error?.(e))??tt(i.customError?.(e))??tt(i.localeError?.(e))??"Invalid input",u={};for(let s of Object.keys(e))s==="inst"||s==="schema"||s==="continue"||s==="input"||s==="__proto__"||(u[s]=e[s]);return u.path??(u.path=[]),u.message=a,r?.reportInput&&(u.input=e.input),u}function Gt(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var Mp=/[\uD800-\uDBFF]/;function Ce(e){let r=e.length;if(!Mp.test(e))return r;let i=r;for(let o=0;o<r-1;o++)(e.charCodeAt(o)&64512)===55296&&(e.charCodeAt(o+1)&64512)===56320&&(i--,o++);return i}function Wt(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function y(e){let r=typeof e;switch(r){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let i=e;if(i&&Object.getPrototypeOf(i)!==Object.prototype&&"constructor"in i&&i.constructor)return i.constructor.name}}return r}function at(...e){let[r,i,o]=e;return typeof r=="string"?{message:r,code:"custom",input:i,inst:o}:{...r}}function Jp(e){return Object.entries(e).filter(([r,i])=>Number.isNaN(Number.parseInt(r,10))).map(r=>r[1])}function Il(e){let r=atob(e),i=new Uint8Array(r.length);for(let o=0;o<r.length;o++)i[o]=r.charCodeAt(o);return i}function wl(e){let r="";for(let i=0;i<e.length;i++)r+=String.fromCharCode(e[i]);return btoa(r)}function Bp(e){let r=e.replace(/-/g,"+").replace(/_/g,"/"),i="=".repeat((4-r.length%4)%4);return Il(r+i)}function Kp(e){return wl(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Gp(e){let r=e.replace(/^0x/,"");if(r.length%2!==0)throw new Error("Invalid hex string length");let i=new Uint8Array(r.length/2);for(let o=0;o<r.length;o+=2)i[o/2]=Number.parseInt(r.slice(o,o+2),16);return i}function Wp(e){return Array.from(e).map(r=>r.toString(16).padStart(2,"0")).join("")}var Xi=class{constructor(...r){}};function ro(e,r){for(let i in r){let o=Object.getOwnPropertyDescriptor(r,i);o.get?Object.defineProperty(e,i,{...o,enumerable:!1}):qp(e,i,o.value)}}function we(e,r,i,o=!0){return Object.defineProperty(e,r,{configurable:!0,writable:!0,enumerable:o,value:i}),i}function Xt(e,r,i){return we(e,r,i,!1)}function Xp(e,r){for(let i in e){let o=e[i];Object.defineProperty(r,i,{configurable:!0,enumerable:!0,get(){return we(this,i,o(this))},set(t){we(this,i,t)}})}return r}function qp(e,r,i){Object.defineProperty(e,r,{configurable:!0,get(){return this==null?i:we(this,r,i.bind(this))},set(o){we(this,r,o)}})}function Yp(e,r){let i=Object.getPrototypeOf(e);return r in i?void 0:i}var Gi,Ie=!1,Hp={configurable:!0,get(){Ie=!0}};function O(e,r,i){let o=Object.getPrototypeOf(e._zod);if(r in o&&Gi!==e._zod){Gi=void 0;return}Gi=e._zod,Object.defineProperty(o,r,{configurable:!0,get(){Object.defineProperty(this,r,Hp);let t=Ie;Ie=!1;try{let n=i(this);return Ie?delete this[r]:Object.defineProperty(this,r,{configurable:!0,writable:!0,value:n}),Ie=Ie||t,n}catch(n){throw delete this[r],Ie=Ie||t,n}},set(t){Object.defineProperty(this,r,{configurable:!0,writable:!0,value:t})}})}function Qp(e,r,i,o){let t=Yp(e,r);t&&Object.defineProperty(t,r,{configurable:!0,get(){let n={configurable:!0,writable:!0,enumerable:o,value:void 0};return Object.defineProperty(this,r,n),n.value=i(this),Object.defineProperty(this,r,n),n.value},set(n){Object.defineProperty(this,r,{configurable:!0,writable:!0,enumerable:o,value:n})}})}var Mr="~constantCatch";function no(e){let r=()=>e;return r[Mr]=!0,r}var zl,oo=Object.freeze({status:"aborted"}),io={value:void 0,enumerable:!1},Sl="captureStackTrace"in Error?Error:null;function eg(e){let r=Sl;if(r){let i=r.stackTraceLimit;if(typeof i=="number"){try{r.stackTraceLimit=0}catch{return Sl=null,new e}try{return new e}finally{r.stackTraceLimit=i}}}return new e}function p(e,r,i,o){let t={};function n(f){this.def=f,this.constr=d,this.traits=new Set}n.prototype=t;let a=i,u=a&&new WeakSet;function s(f,m){if(f._zod){if(f._zod.traits.has(e))return}else{io.value=new n(m);try{Object.defineProperty(f,"_zod",io)}finally{io.value=void 0}}if(f._zod.traits.add(e),r(f,m),u){let _=Object.getPrototypeOf(f),k=f._zod.constr.prototype,z=_;for(;z&&z!==k;)z=Object.getPrototypeOf(z);let I=z??_;u.has(I)||(u.add(I),ro(I,a))}let v=d.prototype;for(let _ in v)Object.prototype.hasOwnProperty.call(v,_)&&(_ in f||(f[_]=v[_].bind(f)))}let c=o?.Parent??Object;class l extends c{}Object.defineProperty(l,"name",{value:e});function d(f){let m=o?.Parent?eg(l):this;s(m,f);let v=m._zod.deferred;if(v){for(let k of v)k();m._zod.deferred=void 0}let _=globalThis.__zod_globalConfig?.postProcessor;return _&&_(m),m}return Object.defineProperty(d,"init",{value:s}),Object.defineProperty(d,Symbol.hasInstance,{value:f=>o?.Parent&&f instanceof o.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var ao=Symbol("zod_brand"),ne=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ze=class extends Error{constructor(r){super(`Encountered unidirectional transform during encode: ${r}`),this.name="ZodEncodeError"}};(zl=globalThis).__zod_globalConfig??(zl.__zod_globalConfig={});var B=globalThis.__zod_globalConfig;function F(e){return e&&Object.assign(B,e),B}function tg(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,nt,2)),e.message}function rg(e){this._zod.message=e}var ng={get:tg,set:rg,enumerable:!0,configurable:!0},co={value:void 0,enumerable:!1},Pl=new WeakSet([Object.prototype,Error.prototype]),Dl=(e,r)=>{e.name="$ZodError",co.value=r,Object.defineProperty(e,"issues",co),co.value=void 0,Object.defineProperty(e,"message",ng);let i=Object.getPrototypeOf(e);Pl.has(i)||(Pl.add(i),Object.defineProperty(i,"toString",{configurable:!0,enumerable:!1,get(){let o=()=>this.message;return Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0})}}))},so=p("$ZodError",Dl),ie=p("$ZodError",Dl,void 0,{Parent:Error});function ig(e,r,i){return Object.prototype.hasOwnProperty.call(e,r)||(r==="__proto__"?Object.defineProperty(e,r,{value:i(),writable:!0,enumerable:!0,configurable:!0}):e[r]=i()),e[r]}function qt(e,r=i=>i.message){let i={},o=[];for(let t of e.issues)t.path.length>0?ig(i,t.path[0],()=>[]).push(r(t)):o.push(r(t));return{formErrors:o,fieldErrors:i}}function Yt(e,r=i=>i.message){let i={_errors:[]},o=(t,n=[])=>{for(let a of t.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(u=>o({issues:u},[...n,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...n,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...n,...a.path]);else{let u=[...n,...a.path];if(u.length===0)i._errors.push(r(a));else{let s=i,c=0;for(;c<u.length;){let l=u[c],d=c===u.length-1;if(l==="_errors"){d&&s._errors.push(r(a)),c++;continue}Object.prototype.hasOwnProperty.call(s,l)||Object.defineProperty(s,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let f=s[l];d&&f._errors.push(r(a)),s=f,c++}}}};return o(e),i}function lo(e,r=i=>i.message){let i={errors:[]},o=(t,n=[])=>{var a;for(let u of t.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(s=>o({issues:s},[...n,...u.path]));else if(u.code==="invalid_key")o({issues:u.issues},[...n,...u.path]);else if(u.code==="invalid_element")o({issues:u.issues},[...n,...u.path]);else{let s=[...n,...u.path];if(s.length===0){i.errors.push(r(u));continue}let c=i,l=0;for(;l<s.length;){let d=s[l],f=l===s.length-1;typeof d=="string"?(c.properties??(c.properties={}),Object.prototype.hasOwnProperty.call(c.properties,d)||Object.defineProperty(c.properties,d,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),c=c.properties[d]):(c.items??(c.items=[]),(a=c.items)[d]??(a[d]={errors:[]}),c=c.items[d]),f&&c.errors.push(r(u)),l++}}};return o(e),i}function jl(e){let r=[],i=e.map(o=>typeof o=="object"?o.key:o);for(let o of i)typeof o=="number"?r.push(`[${o}]`):typeof o=="symbol"?r.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?r.push(`[${JSON.stringify(o)}]`):(r.length&&r.push("."),r.push(o));return r.join("")}function fo(e){let r=[],i=[...e.issues].sort((o,t)=>(o.path??[]).length-(t.path??[]).length);for(let o of i)r.push(`\u2716 ${o.message}`),o.path?.length&&r.push(` \u2192 at ${jl(o.path)}`);return r.join(`
|
|
4
|
+
import{d as he}from"./chunk-7MKA3SHV.js";var yp={};he(yp,{$brand:()=>ao,$input:()=>Nu,$output:()=>Ou,INVALID:()=>H,NEVER:()=>oo,TimePrecision:()=>Mu,ZodAny:()=>js,ZodArray:()=>As,ZodBase64:()=>Zi,ZodBase64URL:()=>Ei,ZodBigInt:()=>Et,ZodBigIntFormat:()=>Vi,ZodBoolean:()=>Zt,ZodCIDRv4:()=>Ai,ZodCIDRv6:()=>Ti,ZodCUID:()=>Si,ZodCUID2:()=>Pi,ZodCatch:()=>tl,ZodCodec:()=>Ar,ZodCompileAsyncError:()=>fe,ZodCompileUnsupportedError:()=>N,ZodCreditCard:()=>ks,ZodCustom:()=>Tr,ZodCustomStringFormat:()=>Qe,ZodDate:()=>Pr,ZodDefault:()=>Xs,ZodDiscriminatedUnion:()=>Zs,ZodE164:()=>Ci,ZodEmail:()=>xi,ZodEmoji:()=>wi,ZodEnum:()=>Ut,ZodError:()=>Eh,ZodExactOptional:()=>Ji,ZodFile:()=>Bs,ZodFirstPartyTypeKind:()=>gl,ZodFunction:()=>dl,ZodGUID:()=>Ii,ZodIBAN:()=>xs,ZodIPv4:()=>Ni,ZodIPv6:()=>Ui,ZodISODate:()=>Ue,ZodISODateTime:()=>Ne,ZodISODuration:()=>Te,ZodISOTime:()=>Ae,ZodInstanceOf:()=>pl,ZodIntersection:()=>Es,ZodIssueCode:()=>Vh,ZodJWT:()=>Li,ZodKSUID:()=>Oi,ZodLazy:()=>cl,ZodLiteral:()=>Js,ZodMAC:()=>bs,ZodMap:()=>Fs,ZodNaN:()=>nl,ZodNanoID:()=>zi,ZodNever:()=>Ns,ZodNonOptional:()=>Bi,ZodNull:()=>Ps,ZodNullable:()=>Ws,ZodNumber:()=>Tt,ZodNumberFormat:()=>et,ZodObject:()=>jr,ZodOptional:()=>Nr,ZodPipe:()=>Ur,ZodPrefault:()=>Ys,ZodPreprocess:()=>il,ZodPromise:()=>ll,ZodReadonly:()=>ol,ZodRealError:()=>oe,ZodRecord:()=>Nt,ZodSet:()=>Ms,ZodString:()=>At,ZodStringFormat:()=>C,ZodSuccess:()=>el,ZodSymbol:()=>zs,ZodTemplateLiteral:()=>ul,ZodTransform:()=>Ks,ZodTuple:()=>Ls,ZodType:()=>j,ZodULID:()=>Di,ZodURL:()=>Sr,ZodUUID:()=>$e,ZodUndefined:()=>Ss,ZodUnion:()=>Or,ZodUnknown:()=>Os,ZodVoid:()=>Us,ZodXID:()=>ji,ZodXor:()=>Ts,_ZodString:()=>ki,_default:()=>qs,_function:()=>ep,any:()=>Om,array:()=>Dr,base64:()=>dm,base64url:()=>fm,bigint:()=>zm,boolean:()=>ws,catch:()=>rl,check:()=>tp,cidrv4:()=>sm,cidrv6:()=>lm,clone:()=>T,codec:()=>qm,coerce:()=>$l,compile:()=>Zu,config:()=>F,core:()=>xe,creditCard:()=>pm,cuid:()=>tm,cuid2:()=>rm,currencyCode:()=>_m,custom:()=>rp,date:()=>Um,decode:()=>ps,decodeAsync:()=>vs,deepPartial:()=>gp,describe:()=>np,discriminatedUnion:()=>Lm,e164:()=>mm,email:()=>Bf,emoji:()=>Qf,encode:()=>ms,encodeAsync:()=>gs,endsWith:()=>bt,enum:()=>Fi,exactOptional:()=>Gs,file:()=>Km,flattenError:()=>qt,float32:()=>km,float64:()=>xm,formatError:()=>Yt,fromJSONSchema:()=>mp,function:()=>ep,getDiscriminatedOption:()=>ou,getErrorMap:()=>Fh,globalRegistry:()=>G,gt:()=>ge,gte:()=>ue,guid:()=>Kf,hash:()=>bm,hex:()=>ym,hostname:()=>hm,httpUrl:()=>Hf,iban:()=>gm,includes:()=>yt,input:()=>$p,instanceof:()=>op,int:()=>_i,int32:()=>Im,int64:()=>Sm,intersection:()=>Cs,invertCodec:()=>Ym,ipv4:()=>am,ipv6:()=>cm,iso:()=>Zr,json:()=>up,jwt:()=>vm,keyof:()=>Am,ksuid:()=>om,lazy:()=>sl,length:()=>We,literal:()=>Bm,locales:()=>$r,looseObject:()=>Em,looseRecord:()=>Rm,lowercase:()=>$t,lt:()=>pe,lte:()=>ae,mac:()=>um,map:()=>Fm,maxLength:()=>Ge,maxSize:()=>Pe,memoizer:()=>gr,meta:()=>ip,mime:()=>xt,minLength:()=>ke,minSize:()=>ve,multipleOf:()=>Se,nan:()=>Xm,nanoid:()=>em,nativeEnum:()=>Jm,negative:()=>si,never:()=>Ri,nonnegative:()=>di,nonoptional:()=>Qs,nonpositive:()=>li,normalize:()=>It,null:()=>Ds,nullable:()=>zr,nullish:()=>Gm,number:()=>Is,object:()=>Tm,optional:()=>Ye,output:()=>hp,overwrite:()=>me,parse:()=>ss,parseAsync:()=>ls,partialRecord:()=>Vm,pipe:()=>bi,positive:()=>ci,prefault:()=>Hs,preprocess:()=>cp,prettifyError:()=>fo,promise:()=>Qm,properties:()=>kt,property:()=>fi,readonly:()=>al,record:()=>Rs,refine:()=>fl,regex:()=>vt,regexes:()=>le,registry:()=>En,safeDecode:()=>hs,safeDecodeAsync:()=>_s,safeEncode:()=>$s,safeEncodeAsync:()=>ys,safeParse:()=>ds,safeParseAsync:()=>fs,set:()=>Mm,setErrorMap:()=>Rh,size:()=>Ke,slugify:()=>Pt,startsWith:()=>_t,strictObject:()=>Zm,string:()=>wr,stringFormat:()=>$m,stringbool:()=>ap,success:()=>Wm,superRefine:()=>ml,symbol:()=>Dm,templateLiteral:()=>Hm,toJSONSchema:()=>vi,toLowerCase:()=>zt,toUpperCase:()=>St,toZod:()=>Rt,transform:()=>Mi,treeifyError:()=>lo,trim:()=>wt,tuple:()=>Vs,uint32:()=>wm,uint64:()=>Pm,ulid:()=>nm,undefined:()=>jm,union:()=>Ct,unknown:()=>qe,uppercase:()=>ht,url:()=>Yf,util:()=>$,uuid:()=>Gf,uuidv4:()=>Wf,uuidv6:()=>Xf,uuidv7:()=>qf,validate:()=>Ht,validateAsync:()=>Qt,void:()=>Nm,withParser:()=>Cn,xid:()=>im,xor:()=>Cm});var xe={};he(xe,{$ZodAny:()=>Ya,$ZodArray:()=>ru,$ZodAsyncError:()=>ne,$ZodBase64:()=>La,$ZodBase64URL:()=>Va,$ZodBigInt:()=>xn,$ZodBigIntFormat:()=>Ga,$ZodBoolean:()=>sr,$ZodCIDRv4:()=>Ea,$ZodCIDRv6:()=>Ca,$ZodCUID:()=>wa,$ZodCUID2:()=>za,$ZodCatch:()=>bu,$ZodCheck:()=>L,$ZodCheckBigIntFormat:()=>Ho,$ZodCheckEndsWith:()=>la,$ZodCheckGreaterThan:()=>un,$ZodCheckIncludes:()=>ca,$ZodCheckLengthEquals:()=>ia,$ZodCheckLessThan:()=>an,$ZodCheckLowerCase:()=>aa,$ZodCheckMaxLength:()=>ra,$ZodCheckMaxSize:()=>Qo,$ZodCheckMimeType:()=>ma,$ZodCheckMinLength:()=>na,$ZodCheckMinSize:()=>ea,$ZodCheckMultipleOf:()=>qo,$ZodCheckNumberFormat:()=>Yo,$ZodCheckOverwrite:()=>pa,$ZodCheckProperties:()=>fa,$ZodCheckProperty:()=>da,$ZodCheckRegex:()=>oa,$ZodCheckSizeEquals:()=>ta,$ZodCheckStartsWith:()=>sa,$ZodCheckStringFormat:()=>dt,$ZodCheckUpperCase:()=>ua,$ZodCodec:()=>dr,$ZodCreditCard:()=>Fa,$ZodCustom:()=>Pu,$ZodCustomStringFormat:()=>Ba,$ZodCyclicError:()=>jn,$ZodDate:()=>tu,$ZodDefault:()=>$u,$ZodDiscriminatedUnion:()=>au,$ZodE164:()=>Ra,$ZodEmail:()=>ya,$ZodEmoji:()=>xa,$ZodEncodeError:()=>ze,$ZodEnum:()=>du,$ZodError:()=>so,$ZodExactOptional:()=>gu,$ZodFile:()=>mu,$ZodFunction:()=>zu,$ZodGUID:()=>$a,$ZodIBAN:()=>Ma,$ZodIPv4:()=>Aa,$ZodIPv6:()=>Ta,$ZodISODate:()=>Oa,$ZodISODateTime:()=>ja,$ZodISODuration:()=>Ua,$ZodISOTime:()=>Na,$ZodIntersection:()=>uu,$ZodJWT:()=>Ja,$ZodKSUID:()=>Da,$ZodLazy:()=>fr,$ZodLiteral:()=>fu,$ZodMAC:()=>Za,$ZodMap:()=>su,$ZodNaN:()=>ku,$ZodNanoID:()=>Ia,$ZodNever:()=>Qa,$ZodNonOptional:()=>yu,$ZodNull:()=>qa,$ZodNullable:()=>vu,$ZodNumber:()=>kn,$ZodNumberFormat:()=>Ka,$ZodObject:()=>ed,$ZodObjectJIT:()=>nu,$ZodOptional:()=>wn,$ZodPipe:()=>zn,$ZodPrefault:()=>hu,$ZodPreprocess:()=>xu,$ZodPromise:()=>Su,$ZodReadonly:()=>Iu,$ZodRealError:()=>ie,$ZodRecord:()=>cu,$ZodRegistry:()=>Zn,$ZodSet:()=>lu,$ZodString:()=>Re,$ZodStringFormat:()=>Z,$ZodSuccess:()=>_u,$ZodSymbol:()=>Wa,$ZodTemplateLiteral:()=>wu,$ZodTransform:()=>pu,$ZodTuple:()=>In,$ZodType:()=>P,$ZodULID:()=>Sa,$ZodURL:()=>ka,$ZodUUID:()=>ha,$ZodUndefined:()=>Xa,$ZodUnion:()=>lr,$ZodUnknown:()=>Ha,$ZodVoid:()=>eu,$ZodXID:()=>Pa,$ZodXor:()=>iu,$brand:()=>ao,$constructor:()=>p,$input:()=>Nu,$output:()=>Ou,Doc:()=>Ve,INVALID:()=>H,JSONSchema:()=>Ff,JSONSchemaGenerator:()=>$i,NEVER:()=>oo,TimePrecision:()=>Mu,URL_BAD_FORMAT:()=>_a,URL_UNPARSEABLE:()=>ir,ZodCompileAsyncError:()=>fe,ZodCompileUnsupportedError:()=>N,_any:()=>ac,_array:()=>mc,_base64:()=>ii,_base64url:()=>oi,_bigint:()=>Qu,_boolean:()=>Yu,_catch:()=>wh,_check:()=>zf,_cidrv4:()=>ri,_cidrv6:()=>ni,_coercedBigint:()=>ec,_coercedBoolean:()=>Hu,_coercedDate:()=>dc,_coercedNumber:()=>Bu,_coercedString:()=>Lu,_creditCard:()=>Ru,_cuid:()=>Xn,_cuid2:()=>qn,_custom:()=>gc,_date:()=>lc,_decode:()=>Wr,_decodeAsync:()=>qr,_default:()=>kh,_discriminatedUnion:()=>lh,_e164:()=>ai,_email:()=>Rn,_emoji:()=>Gn,_encode:()=>Gr,_encodeAsync:()=>Xr,_endsWith:()=>bt,_enum:()=>vh,_file:()=>pc,_float32:()=>Gu,_float64:()=>Wu,_gt:()=>ge,_gte:()=>ue,_guid:()=>Fn,_iban:()=>Fu,_includes:()=>yt,_int:()=>Ku,_int32:()=>Xu,_int64:()=>tc,_intersection:()=>dh,_ipv4:()=>ei,_ipv6:()=>ti,_isoDate:()=>_r,_isoDateTime:()=>yr,_isoDuration:()=>kr,_isoTime:()=>br,_jwt:()=>ui,_ksuid:()=>Qn,_lazy:()=>Dh,_length:()=>We,_literal:()=>hh,_lowercase:()=>$t,_lt:()=>pe,_lte:()=>ae,_mac:()=>Vu,_map:()=>ph,_max:()=>ae,_maxLength:()=>Ge,_maxSize:()=>Pe,_mime:()=>xt,_min:()=>ue,_minLength:()=>ke,_minSize:()=>ve,_multipleOf:()=>Se,_nan:()=>fc,_nanoid:()=>Wn,_nativeEnum:()=>$h,_negative:()=>si,_never:()=>cc,_nonnegative:()=>di,_nonoptional:()=>xh,_nonpositive:()=>li,_normalize:()=>It,_null:()=>oc,_nullable:()=>bh,_number:()=>Ju,_optional:()=>_h,_overwrite:()=>me,_parse:()=>ut,_parseAsync:()=>ct,_pipe:()=>zh,_positive:()=>ci,_promise:()=>jh,_properties:()=>kt,_property:()=>fi,_readonly:()=>Sh,_record:()=>mh,_refine:()=>vc,_regex:()=>vt,_safeDecode:()=>Hr,_safeDecodeAsync:()=>en,_safeEncode:()=>Yr,_safeEncodeAsync:()=>Qr,_safeParse:()=>st,_safeParseAsync:()=>lt,_set:()=>gh,_size:()=>Ke,_slugify:()=>Pt,_startsWith:()=>_t,_string:()=>Cu,_stringFormat:()=>Xe,_stringbool:()=>_c,_success:()=>Ih,_superRefine:()=>$c,_symbol:()=>nc,_templateLiteral:()=>Ph,_toLowerCase:()=>zt,_toUpperCase:()=>St,_transform:()=>yh,_trim:()=>wt,_tuple:()=>fh,_uint32:()=>qu,_uint64:()=>rc,_ulid:()=>Yn,_undefined:()=>ic,_union:()=>ch,_unknown:()=>uc,_uppercase:()=>ht,_url:()=>hr,_uuid:()=>Mn,_uuidv4:()=>Jn,_uuidv6:()=>Bn,_uuidv7:()=>Kn,_void:()=>sc,_xid:()=>Hn,_xor:()=>sh,base64Charset:()=>$n,base64urlCharset:()=>cr,canParseURL:()=>ba,clone:()=>T,compile:()=>Zu,compileFn:()=>Ln,config:()=>F,createStandardJSONSchemaMethod:()=>Dt,createToJSONSchemaMethod:()=>kc,decode:()=>fg,decodeAsync:()=>pg,describe:()=>hc,encode:()=>dg,encodeAsync:()=>mg,extractDefs:()=>je,finalize:()=>Oe,flattenError:()=>qt,formatError:()=>Yt,getDiscriminatedOption:()=>ou,globalConfig:()=>B,globalRegistry:()=>G,handleUnrepresentable:()=>M,initializeContext:()=>De,isBackEdge:()=>Nn,isRecursiveSchema:()=>On,isValidBase64:()=>ur,isValidBase64URL:()=>hn,isValidCIDRv6:()=>vn,isValidCreditCard:()=>yn,isValidIBAN:()=>_n,isValidIPv6:()=>ar,isValidJWT:()=>bn,locales:()=>$r,memoizer:()=>gr,mergeValues:()=>ft,meta:()=>yc,parse:()=>Br,parseAsync:()=>Kr,parseURLObject:()=>Yl,prettifyError:()=>fo,process:()=>E,processSchema:()=>E,regexes:()=>le,registry:()=>En,safeDecode:()=>vg,safeDecodeAsync:()=>hg,safeEncode:()=>gg,safeEncodeAsync:()=>$g,safeParse:()=>ag,safeParseAsync:()=>ug,standardProps:()=>fn,stripTabAndNewline:()=>or,toDotPath:()=>jl,toJSONSchema:()=>vi,toZod:()=>Rt,treeifyError:()=>lo,urlHostnameOk:()=>pn,urlProtocolOk:()=>gn,util:()=>$,validate:()=>Ht,validateAsync:()=>Qt,validateURL:()=>mn,version:()=>ga,withParser:()=>Cn});var $={};he($,{BIGINT_FORMAT_RANGES:()=>Kt,CONSTANT_CATCH:()=>Mr,Class:()=>Xi,NUMBER_FORMAT_RANGES:()=>Bt,aborted:()=>Y,allowsEval:()=>Hi,assert:()=>zp,assertEqual:()=>kp,assertIs:()=>Ip,assertNever:()=>wp,assertNotEqual:()=>xp,assignProp:()=>K,attachSchema:()=>Fr,base64ToUint8Array:()=>Il,base64urlToUint8Array:()=>Bp,cached:()=>it,captureStackTrace:()=>Vr,cleanEnum:()=>Jp,cleanRegex:()=>_e,clone:()=>T,cloneDef:()=>Dp,codePointLength:()=>Ce,constantCatch:()=>no,createTransparentProxy:()=>Tp,defineLazy:()=>qi,defineLazyInternal:()=>O,derived:()=>Xp,esc:()=>q,escapeRegex:()=>se,explicitlyAborted:()=>to,extend:()=>Cp,finalizeIssue:()=>re,floatSafeRemainder:()=>Ft,getElementAtPath:()=>jp,getEnumValues:()=>rt,getLengthableOrigin:()=>Wt,getParsedType:()=>Ap,getSizableOrigin:()=>Gt,hexToUint8Array:()=>Gp,hide:()=>Xt,installLazyProp:()=>Qp,isObject:()=>Ee,isPlainObject:()=>ce,issue:()=>at,joinValues:()=>g,jsonStringifyReplacer:()=>nt,members:()=>ro,merge:()=>Vp,mergeDefs:()=>de,normalizeParams:()=>b,nullish:()=>Lr,numKeys:()=>Up,objectClone:()=>Sp,omit:()=>Ep,optionalKeys:()=>eo,own:()=>we,parsedType:()=>y,partial:()=>Rp,pick:()=>Zp,prefixIssues:()=>te,primitiveTypes:()=>Qi,promiseAllObject:()=>Op,propertyKeyTypes:()=>Jt,randomString:()=>Np,rawShape:()=>ot,required:()=>Fp,safeExtend:()=>Lp,shallowClone:()=>Mt,slugify:()=>Yi,stringifyPrimitive:()=>h,toZod:()=>Rt,uint8ArrayToBase64:()=>wl,uint8ArrayToBase64url:()=>Kp,uint8ArrayToHex:()=>Wp,unwrapMessage:()=>tt});function kp(e){return e}function xp(e){return e}function Rt(){return e=>e}function Ip(e){}function wp(e){throw new Error("Unexpected value in exhaustive check")}function zp(e){}function rt(e){let r=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,t])=>r.indexOf(+o)===-1).map(([o,t])=>t)}function g(e,r="|"){return e.map(i=>h(i)).join(r)}function nt(e,r){return typeof r=="bigint"?r.toString():r}var Wi=class{constructor(r){this._getter=r,this._value=void 0}get value(){let r=this._getter;return r!==void 0&&(this._value=r(),this._getter=void 0),this._value}};function it(e){return new Wi(e)}function Lr(e){return e==null}function _e(e){let r=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(r,i)}function Ft(e,r){let i=e/r,o=Math.round(i),t=4*Number.EPSILON*Math.max(Math.abs(i),1);return Math.abs(i-o)<t?0:i-o}var _l=Symbol("evaluating");function qi(e,r,i){let o;Object.defineProperty(e,r,{get(){if(o!==_l)return o===void 0&&(o=_l,o=i()),o},set(t){Object.defineProperty(e,r,{value:t})},configurable:!0})}function Sp(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function K(e,r,i){Object.defineProperty(e,r,{value:i,writable:!0,enumerable:!0,configurable:!0})}function ot(e){let r=Object.getOwnPropertyDescriptor(e,"shape");return r?.get?r.get.raw:r?.value}function ye(e){return ot(e._zod.def)??e._zod.def.shape}function bl(e,r,i){Object.defineProperty(e,r,{get(){let o=i();return K(this,r,o),o},enumerable:!0,configurable:!0})}function kl(e,r,i){r in e?K(e,r,i):e[r]=i}function Ze(e,r,i,o){let t=ye(r);for(let n of i){let a=Object.getOwnPropertyDescriptor(t,n);a.enumerable&&(a.get?bl(e,n,()=>{let u=r._zod.def.shape[n];return o?o(u,n):u}):kl(e,n,o?o(a.value,n):a.value))}}function Pp(e,r){for(let i of Reflect.ownKeys(r)){let o=Object.getOwnPropertyDescriptor(r,i);o.enumerable&&(o.get?bl(e,i,()=>r[i]):kl(e,i,o.value))}}function de(...e){let r={};for(let i of e){let o=Object.getOwnPropertyDescriptors(i);Object.assign(r,o)}return Object.defineProperties({},r)}function Dp(e){return de(e._zod.def)}function jp(e,r){return r?r.reduce((i,o)=>i?.[o],e):e}function Op(e){let r=Object.keys(e),i=r.map(o=>e[o]);return Promise.all(i).then(o=>{let t={};for(let n=0;n<r.length;n++)t[r[n]]=o[n];return t})}function Np(e=10){let r="abcdefghijklmnopqrstuvwxyz",i="";for(let o=0;o<e;o++)i+=r[Math.floor(Math.random()*r.length)];return i}function q(e){return JSON.stringify(e)}function Yi(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Vr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ee(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Hi=it(()=>{if(B.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function ce(e){if(Ee(e)===!1)return!1;let r=e.constructor;if(r===void 0||typeof r!="function")return!0;let i=r.prototype;return!(Ee(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function Mt(e){return ce(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Up(e){let r=0;for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&r++;return r}var Ap=e=>{let r=typeof e;switch(r){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 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: ${r}`)}},Jt=new Set(["string","number","symbol"]),Qi=new Set(["string","number","bigint","boolean","symbol","undefined"]);function se(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function T(e,r,i){let o=new e._zod.constr(r??e._zod.def);return(!r||i?.parent)&&(o._zod.parent=e),o}function b(e){let r=e;if(!r)return{};if(typeof r=="string")return{error:()=>r};if(r?.message!==void 0){if(r?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");r.error=r.message}return delete r.message,typeof r.error=="string"?{...r,error:()=>r.error}:r}function Tp(e){let r;return new Proxy({},{get(i,o,t){return r??(r=e()),Reflect.get(r,o,t)},set(i,o,t,n){return r??(r=e()),Reflect.set(r,o,t,n)},has(i,o){return r??(r=e()),Reflect.has(r,o)},deleteProperty(i,o){return r??(r=e()),Reflect.deleteProperty(r,o)},ownKeys(i){return r??(r=e()),Reflect.ownKeys(r)},getOwnPropertyDescriptor(i,o){return r??(r=e()),Reflect.getOwnPropertyDescriptor(r,o)},defineProperty(i,o,t){return r??(r=e()),Reflect.defineProperty(r,o,t)}})}function h(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function eo(e){return Object.keys(e).filter(r=>e[r]._zod.optin!==void 0&&e[r]._zod.optout==="optional")}var Bt={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]},Kt={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Zp(e,r){let i=e._zod.def,o=i.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let n={};return Ze(n,e,Rr(e,r)),T(e,de(i,{shape:n,checks:[]}))}function Rr(e,r){let i=ye(e),o=[];for(let t of Reflect.ownKeys(r)){if(!Object.getOwnPropertyDescriptor(i,t)?.enumerable)throw new Error(`Unrecognized key: "${String(t)}"`);r[t]&&o.push(t)}return o}function Ep(e,r){let i=e._zod.def,o=i.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let n=new Set(Rr(e,r)),a={};return Ze(a,e,Reflect.ownKeys(ye(e)).filter(u=>!n.has(u))),T(e,de(i,{shape:a,checks:[]}))}function Cp(e,r){if(!ce(r))throw new Error("Invalid input to extend: expected a plain object");let i=e._zod.def.checks;if(i&&i.length>0){let t=ye(e);for(let n of Reflect.ownKeys(r))if(Object.getOwnPropertyDescriptor(t,n)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return T(e,de(e._zod.def,{shape:xl(e,r)}))}function xl(e,r){let i={};return Ze(i,e,Reflect.ownKeys(ye(e))),Pp(i,r),i}function Lp(e,r){if(!ce(r))throw new Error("Invalid input to safeExtend: expected a plain object");return T(e,de(e._zod.def,{shape:xl(e,r)}))}function Vp(e,r){if(!r?._zod?.def)throw new Error("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 i={};Ze(i,e,Reflect.ownKeys(ye(e))),Ze(i,r,Reflect.ownKeys(ye(r)));let o=de(e._zod.def,{shape:i,get catchall(){return r._zod.def.catchall},checks:r._zod.def.checks??[]});return T(e,o)}function Rp(e,r,i,o="partial"){let n=r._zod.def.checks;if(n&&n.length>0)throw new Error(`.${o}() cannot be used on object schemas containing refinements`);let u=i?new Set(Rr(r,i)):void 0,s={};return Ze(s,r,Reflect.ownKeys(ye(r)),e&&((c,l)=>u&&!u.has(l)?c:new e({type:"optional",innerType:c}))),T(r,de(r._zod.def,{shape:s,checks:[]}))}function Fp(e,r,i){let o=i?new Set(Rr(r,i)):void 0,t={};return Ze(t,r,Reflect.ownKeys(ye(r)),(n,a)=>o&&!o.has(a)?n:new e({type:"nonoptional",innerType:n})),T(r,de(r._zod.def,{shape:t}))}function Y(e,r=0){if(e.aborted===!0)return!0;for(let i=r;i<e.issues.length;i++)if(e.issues[i]?.continue!==!0)return!0;return!1}function to(e,r=0){if(e.aborted===!0)return!0;for(let i=r;i<e.issues.length;i++)if(e.issues[i]?.continue===!1)return!0;return!1}function te(e,r){return r.map(i=>{var o;return(o=i).path??(o.path=[]),i.path.unshift(e),i})}function tt(e){return typeof e=="string"?e:e?.message}function Fr(e,r,i){var o;for(let t=r;t<e.length;t++)(o=e[t]).schema??(o.schema=i)}function re(e,r,i){var o;let t=e.inst?._zod?.traits;t?.has("$ZodType")&&(t.has("$ZodCheck")?(o=e).schema??(o.schema=e.inst):e.schema=e.inst);let n=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,a=e.message?e.message:tt(e.inst?._zod.def?.error?.(e))??tt(n?.(e))??tt(r?.error?.(e))??tt(i.customError?.(e))??tt(i.localeError?.(e))??"Invalid input",u={};for(let s of Object.keys(e))s==="inst"||s==="schema"||s==="continue"||s==="input"||s==="__proto__"||(u[s]=e[s]);return u.path??(u.path=[]),u.message=a,r?.reportInput&&(u.input=e.input),u}function Gt(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var Mp=/[\uD800-\uDBFF]/;function Ce(e){let r=e.length;if(!Mp.test(e))return r;let i=r;for(let o=0;o<r-1;o++)(e.charCodeAt(o)&64512)===55296&&(e.charCodeAt(o+1)&64512)===56320&&(i--,o++);return i}function Wt(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function y(e){let r=typeof e;switch(r){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let i=e;if(i&&Object.getPrototypeOf(i)!==Object.prototype&&"constructor"in i&&i.constructor)return i.constructor.name}}return r}function at(...e){let[r,i,o]=e;return typeof r=="string"?{message:r,code:"custom",input:i,inst:o}:{...r}}function Jp(e){return Object.entries(e).filter(([r,i])=>Number.isNaN(Number.parseInt(r,10))).map(r=>r[1])}function Il(e){let r=atob(e),i=new Uint8Array(r.length);for(let o=0;o<r.length;o++)i[o]=r.charCodeAt(o);return i}function wl(e){let r="";for(let i=0;i<e.length;i++)r+=String.fromCharCode(e[i]);return btoa(r)}function Bp(e){let r=e.replace(/-/g,"+").replace(/_/g,"/"),i="=".repeat((4-r.length%4)%4);return Il(r+i)}function Kp(e){return wl(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Gp(e){let r=e.replace(/^0x/,"");if(r.length%2!==0)throw new Error("Invalid hex string length");let i=new Uint8Array(r.length/2);for(let o=0;o<r.length;o+=2)i[o/2]=Number.parseInt(r.slice(o,o+2),16);return i}function Wp(e){return Array.from(e).map(r=>r.toString(16).padStart(2,"0")).join("")}var Xi=class{constructor(...r){}};function ro(e,r){for(let i in r){let o=Object.getOwnPropertyDescriptor(r,i);o.get?Object.defineProperty(e,i,{...o,enumerable:!1}):qp(e,i,o.value)}}function we(e,r,i,o=!0){return Object.defineProperty(e,r,{configurable:!0,writable:!0,enumerable:o,value:i}),i}function Xt(e,r,i){return we(e,r,i,!1)}function Xp(e,r){for(let i in e){let o=e[i];Object.defineProperty(r,i,{configurable:!0,enumerable:!0,get(){return we(this,i,o(this))},set(t){we(this,i,t)}})}return r}function qp(e,r,i){Object.defineProperty(e,r,{configurable:!0,get(){return this==null?i:we(this,r,i.bind(this))},set(o){we(this,r,o)}})}function Yp(e,r){let i=Object.getPrototypeOf(e);return r in i?void 0:i}var Gi,Ie=!1,Hp={configurable:!0,get(){Ie=!0}};function O(e,r,i){let o=Object.getPrototypeOf(e._zod);if(r in o&&Gi!==e._zod){Gi=void 0;return}Gi=e._zod,Object.defineProperty(o,r,{configurable:!0,get(){Object.defineProperty(this,r,Hp);let t=Ie;Ie=!1;try{let n=i(this);return Ie?delete this[r]:Object.defineProperty(this,r,{configurable:!0,writable:!0,value:n}),Ie=Ie||t,n}catch(n){throw delete this[r],Ie=Ie||t,n}},set(t){Object.defineProperty(this,r,{configurable:!0,writable:!0,value:t})}})}function Qp(e,r,i,o){let t=Yp(e,r);t&&Object.defineProperty(t,r,{configurable:!0,get(){let n={configurable:!0,writable:!0,enumerable:o,value:void 0};return Object.defineProperty(this,r,n),n.value=i(this),Object.defineProperty(this,r,n),n.value},set(n){Object.defineProperty(this,r,{configurable:!0,writable:!0,enumerable:o,value:n})}})}var Mr="~constantCatch";function no(e){let r=()=>e;return r[Mr]=!0,r}var zl,oo=Object.freeze({status:"aborted"}),io={value:void 0,enumerable:!1},Sl="captureStackTrace"in Error?Error:null;function eg(e){let r=Sl;if(r){let i=r.stackTraceLimit;if(typeof i=="number"){try{r.stackTraceLimit=0}catch{return Sl=null,new e}try{return new e}finally{r.stackTraceLimit=i}}}return new e}function p(e,r,i,o){let t={};function n(f){this.def=f,this.constr=d,this.traits=new Set}n.prototype=t;let a=i,u=a&&new WeakSet;function s(f,m){if(f._zod){if(f._zod.traits.has(e))return}else{io.value=new n(m);try{Object.defineProperty(f,"_zod",io)}finally{io.value=void 0}}if(f._zod.traits.add(e),r(f,m),u){let _=Object.getPrototypeOf(f),k=f._zod.constr.prototype,z=_;for(;z&&z!==k;)z=Object.getPrototypeOf(z);let I=z??_;u.has(I)||(u.add(I),ro(I,a))}let v=d.prototype;for(let _ in v)Object.prototype.hasOwnProperty.call(v,_)&&(_ in f||(f[_]=v[_].bind(f)))}let c=o?.Parent??Object;class l extends c{}Object.defineProperty(l,"name",{value:e});function d(f){let m=o?.Parent?eg(l):this;s(m,f);let v=m._zod.deferred;if(v){for(let k of v)k();m._zod.deferred=void 0}let _=globalThis.__zod_globalConfig?.postProcessor;return _&&_(m),m}return Object.defineProperty(d,"init",{value:s}),Object.defineProperty(d,Symbol.hasInstance,{value:f=>o?.Parent&&f instanceof o.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var ao=Symbol("zod_brand"),ne=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ze=class extends Error{constructor(r){super(`Encountered unidirectional transform during encode: ${r}`),this.name="ZodEncodeError"}};(zl=globalThis).__zod_globalConfig??(zl.__zod_globalConfig={});var B=globalThis.__zod_globalConfig;function F(e){return e&&Object.assign(B,e),B}function tg(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,nt,2)),e.message}function rg(e){this._zod.message=e}var ng={get:tg,set:rg,enumerable:!0,configurable:!0},co={value:void 0,enumerable:!1},Pl=new WeakSet([Object.prototype,Error.prototype]),Dl=(e,r)=>{e.name="$ZodError",co.value=r,Object.defineProperty(e,"issues",co),co.value=void 0,Object.defineProperty(e,"message",ng);let i=Object.getPrototypeOf(e);Pl.has(i)||(Pl.add(i),Object.defineProperty(i,"toString",{configurable:!0,enumerable:!1,get(){let o=()=>this.message;return Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0})}}))},so=p("$ZodError",Dl),ie=p("$ZodError",Dl,void 0,{Parent:Error});function ig(e,r,i){return Object.prototype.hasOwnProperty.call(e,r)||(r==="__proto__"?Object.defineProperty(e,r,{value:i(),writable:!0,enumerable:!0,configurable:!0}):e[r]=i()),e[r]}function qt(e,r=i=>i.message){let i={},o=[];for(let t of e.issues)t.path.length>0?ig(i,t.path[0],()=>[]).push(r(t)):o.push(r(t));return{formErrors:o,fieldErrors:i}}function Yt(e,r=i=>i.message){let i={_errors:[]},o=(t,n=[])=>{for(let a of t.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(u=>o({issues:u},[...n,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...n,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...n,...a.path]);else{let u=[...n,...a.path];if(u.length===0)i._errors.push(r(a));else{let s=i,c=0;for(;c<u.length;){let l=u[c],d=c===u.length-1;if(l==="_errors"){d&&s._errors.push(r(a)),c++;continue}Object.prototype.hasOwnProperty.call(s,l)||Object.defineProperty(s,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let f=s[l];d&&f._errors.push(r(a)),s=f,c++}}}};return o(e),i}function lo(e,r=i=>i.message){let i={errors:[]},o=(t,n=[])=>{var a;for(let u of t.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(s=>o({issues:s},[...n,...u.path]));else if(u.code==="invalid_key")o({issues:u.issues},[...n,...u.path]);else if(u.code==="invalid_element")o({issues:u.issues},[...n,...u.path]);else{let s=[...n,...u.path];if(s.length===0){i.errors.push(r(u));continue}let c=i,l=0;for(;l<s.length;){let d=s[l],f=l===s.length-1;typeof d=="string"?(c.properties??(c.properties={}),Object.prototype.hasOwnProperty.call(c.properties,d)||Object.defineProperty(c.properties,d,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),c=c.properties[d]):(c.items??(c.items=[]),(a=c.items)[d]??(a[d]={errors:[]}),c=c.items[d]),f&&c.errors.push(r(u)),l++}}};return o(e),i}function jl(e){let r=[],i=e.map(o=>typeof o=="object"?o.key:o);for(let o of i)typeof o=="number"?r.push(`[${o}]`):typeof o=="symbol"?r.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?r.push(`[${JSON.stringify(o)}]`):(r.length&&r.push("."),r.push(o));return r.join("")}function fo(e){let r=[],i=[...e.issues].sort((o,t)=>(o.path??[]).length-(t.path??[]).length);for(let o of i)r.push(`\u2716 ${o.message}`),o.path?.length&&r.push(` \u2192 at ${jl(o.path)}`);return r.join(`
|
|
5
5
|
`)}function Jr(e,r){return{callee:r?.callee??e,Err:r?.Err}}var ut=e=>{let r=(i,o,t,n)=>{let a=t?{...t,async:!1}:{async:!1},u=i._zod.run({value:o,issues:[]},a);if(u instanceof Promise)throw new ne;if(u.issues.length){let s=new(n?.Err??e)(u.issues.map(c=>re(c,a,F())));throw Vr(s,n?.callee??r),s}return u.value};return r},Br=ut(ie),ct=e=>{let r=async(i,o,t,n)=>{let a=t?{...t,async:!0}:{async:!0},u=i._zod.run({value:o,issues:[]},a);if(u instanceof Promise&&(u=await u),u.issues.length){let s=new(n?.Err??e)(u.issues.map(c=>re(c,a,F())));throw Vr(s,n?.callee??r),s}return u.value};return r},Kr=ct(ie),st=e=>(r,i,o)=>{let t=o?{...o,async:!1}:{async:!1},n=r._zod.run({value:i,issues:[]},t);if(n instanceof Promise)throw new ne;return n.issues.length?Ol(e,n.issues,t):{success:!0,data:n.value}},ag=st(ie);function Ol(e,r,i){let o;return{success:!1,get error(){return o||(o=new e(r.map(t=>re(t,i,F()))),r=void 0,i=void 0),o},set error(t){o=t,r=void 0,i=void 0}}}var lt=e=>async(r,i,o)=>{let t=o?{...o,async:!0}:{async:!0},n=r._zod.run({value:i,issues:[]},t);return n instanceof Promise&&(n=await n),n.issues.length?Ol(e,n.issues,t):{success:!0,data:n.value}},ug=lt(ie),cg=Symbol.for("zod.compile.invalid"),sg=Symbol.for("zod.compile.fallback"),Ht=((e,r,i)=>{let o=e._zod.bag.validator;if(o!==void 0){if(o(r)!==cg)return!0;if(o.definite===!0&&i===void 0)return!1}return lg(e,r,i)});function lg(e,r,i){let o=i?{...i,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},t=e._zod.bag.fallbackRun,n;if(t?(o[sg]=!0,n=t({value:r,issues:[]},o)):n=e._zod.run({value:r,issues:[]},o),n instanceof Promise)throw new ne;return n.issues.length===0}var Qt=async(e,r,i)=>{let o=i?{...i,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},t=e._zod.run({value:r,issues:[]},o);return t instanceof Promise&&(t=await t),t.issues.length===0},Gr=e=>{let r=ut(e),i=(o,t,n,a)=>{let u=n?{...n,direction:"backward"}:{direction:"backward"};return r(o,t,u,Jr(i,a))};return i},dg=Gr(ie),Wr=e=>{let r=ut(e),i=(o,t,n,a)=>r(o,t,n,Jr(i,a));return i},fg=Wr(ie),Xr=e=>{let r=ct(e),i=async(o,t,n,a)=>{let u=n?{...n,direction:"backward"}:{direction:"backward"};return await r(o,t,u,Jr(i,a))};return i},mg=Xr(ie),qr=e=>{let r=ct(e),i=async(o,t,n,a)=>await r(o,t,n,Jr(i,a));return i},pg=qr(ie),Yr=e=>(r,i,o)=>{let t=o?{...o,direction:"backward"}:{direction:"backward"};return st(e)(r,i,t)},gg=Yr(ie),Hr=e=>(r,i,o)=>st(e)(r,i,o),vg=Hr(ie),Qr=e=>async(r,i,o)=>{let t=o?{...o,direction:"backward"}:{direction:"backward"};return lt(e)(r,i,t)},$g=Qr(ie),en=e=>async(r,i,o)=>lt(e)(r,i,o),hg=en(ie);var le={};he(le,{anyString:()=>Lo,base64:()=>jo,base64url:()=>Oo,bigint:()=>Ro,boolean:()=>Fo,browserEmail:()=>zg,cidrv4:()=>Po,cidrv6:()=>Do,creditCard:()=>tn,cuid:()=>po,cuid2:()=>go,currencyCode:()=>To,date:()=>Zo,datetime:()=>Co,domain:()=>Uo,duration:()=>bo,e164:()=>Ao,email:()=>xo,emoji:()=>Io,extendedDuration:()=>yg,guid:()=>ko,hex:()=>Go,hostname:()=>No,html5Email:()=>xg,httpProtocol:()=>er,iban:()=>rn,idnEmail:()=>wg,integer:()=>tr,ipv4:()=>wo,ipv6:()=>zo,ksuid:()=>ho,lowercase:()=>Bo,mac:()=>So,md5_base64:()=>jg,md5_base64url:()=>Og,md5_hex:()=>Dg,nanoid:()=>yo,nanoidOfLength:()=>_o,null:()=>Mo,number:()=>be,rfc5322Email:()=>Ig,sha1_base64:()=>Ug,sha1_base64url:()=>Ag,sha1_hex:()=>Ng,sha256_base64:()=>Zg,sha256_base64url:()=>Eg,sha256_hex:()=>Tg,sha384_base64:()=>Lg,sha384_base64url:()=>Vg,sha384_hex:()=>Cg,sha512_base64:()=>Fg,sha512_base64url:()=>Mg,sha512_hex:()=>Rg,string:()=>Vo,time:()=>Eo,ulid:()=>vo,undefined:()=>Jo,unicodeEmail:()=>Nl,uppercase:()=>Ko,uuid:()=>Le,uuid4:()=>_g,uuid6:()=>bg,uuid7:()=>kg,xid:()=>$o});var po=/^[cC][0-9a-z]{6,}$/,go=/^[0-9a-z]+$/,vo=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,$o=/^[0-9a-vA-V]{20}$/,ho=/^[A-Za-z0-9]{27}$/,yo=/^[a-zA-Z0-9_-]{21}$/;function _o(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var bo=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,yg=/^[-+]?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)?)??$/,ko=/^([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})$/,Le=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)$/,_g=Le(4),bg=Le(6),kg=Le(7),xo=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,xg=/^[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])?)*$/,Ig=/^(([^<>()\[\]\\.,;:\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,}))$/,Nl=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,wg=Nl,zg=/^[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])?)*$/,Sg="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Io(){return new RegExp(Sg,"u")}var wo=/^(?:(?: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])$/,zo=/^(([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}|:))$/,So=e=>{let r=se(e??":");return new RegExp(`^(?:[0-9A-F]{2}${r}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${r}){5}[0-9a-f]{2}$`)},Po=/^((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])$/,Do=/^(([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])$/,jo=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Oo=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,No=/^(?=.{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])?)*\.?$/,Uo=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,er=/^https?$/,Ao=/^\+[1-9]\d{6,14}$/,tn=/^\d(?:[ -]?\d){11,18}$/,To=/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,rn=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,Ul="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function Pg(e){return new RegExp(`^${e}$`)}var Zo=Pg(Ul);function mo(e){let r="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${r}`:e.precision===0?`${r}:[0-5]\\d`:`${r}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${r}:[0-5]\\d(?:\\.\\d+)?`:`${r}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Eo(e){return new RegExp(`^${mo(e)}$`)}function Co(e){let r=["Z"];e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${mo({precision:e.precision,seconds:!0})}(?:${r.join("|")})`,o=e.local?`${i}|${mo({precision:e.precision})}`:i;return new RegExp(`^${Ul}T(?:${o})$`)}var Lo=/^[\s\S]{0,}$/,Vo=e=>{let r=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${r}$`)},Ro=/^-?\d+n?$/,tr=/^-?\d+$/,be=/^-?\d+(?:\.\d+)?$/,Fo=/^(?:true|false)$/i,Mo=/^null$/i;var Jo=/^undefined$/i;var Bo=/^[^A-Z]*$/,Ko=/^[^a-z]*$/,Go=/^[0-9a-fA-F]*$/;function rr(e,r){return new RegExp(`^[A-Za-z0-9+/]{${e}}${r}$`)}function nr(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var Dg=/^[0-9a-fA-F]{32}$/,jg=rr(22,"=="),Og=nr(22),Ng=/^[0-9a-fA-F]{40}$/,Ug=rr(27,"="),Ag=nr(27),Tg=/^[0-9a-fA-F]{64}$/,Zg=rr(43,"="),Eg=nr(43),Cg=/^[0-9a-fA-F]{96}$/,Lg=rr(64,""),Vg=nr(64),Rg=/^[0-9a-fA-F]{128}$/,Fg=rr(86,"=="),Mg=nr(86);var L=p("$ZodCheck",(e,r)=>{var i;e._zod??(e._zod={}),e._zod.def=r,(i=e._zod).onattach??(i.onattach=[])}),Wo=e=>{let r=e.value;return!Lr(r)&&r.size!==void 0},Xo=e=>{let r=e.value;return!Lr(r)&&r.length!==void 0},nn={number:"number",bigint:"bigint",object:"date"},an=p("$ZodCheckLessThan",(e,r)=>{L.init(e,r);let i=nn[typeof r.value];e._zod.check=o=>{(r.inclusive?o.value<=r.value:o.value<r.value)||o.issues.push({origin:nn[typeof o.value]??i,code:"too_big",maximum:typeof r.value=="object"?r.value.getTime():r.value,input:o.value,inclusive:r.inclusive,inst:e,continue:!r.abort})}}),un=p("$ZodCheckGreaterThan",(e,r)=>{L.init(e,r);let i=nn[typeof r.value];e._zod.check=o=>{(r.inclusive?o.value>=r.value:o.value>r.value)||o.issues.push({origin:nn[typeof o.value]??i,code:"too_small",minimum:typeof r.value=="object"?r.value.getTime():r.value,input:o.value,inclusive:r.inclusive,inst:e,continue:!r.abort})}}),qo=p("$ZodCheckMultipleOf",(e,r)=>{L.init(e,r),e._zod.check=i=>{if(typeof i.value!=typeof r.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof i.value=="bigint"?r.value!==BigInt(0)&&i.value%r.value===BigInt(0):Ft(i.value,r.value)===0)||i.issues.push({origin:typeof i.value,code:"not_multiple_of",divisor:r.value,input:i.value,inst:e,continue:!r.abort})}}),Yo=p("$ZodCheckNumberFormat",(e,r)=>{L.init(e,r),r.format=r.format||"float64";let i=r.format?.includes("int"),o=i?"int":"number",[t,n]=Bt[r.format];e._zod.check=a=>{let u=a.value;if(i){if(!Number.isInteger(u)){a.issues.push({expected:o,format:r.format,code:"invalid_type",continue:!1,input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?a.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!r.abort}):a.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!r.abort});return}}u<t&&a.issues.push({origin:"number",input:u,code:"too_small",minimum:t,inclusive:!0,inst:e,continue:!r.abort}),u>n&&a.issues.push({origin:"number",input:u,code:"too_big",maximum:n,inclusive:!0,inst:e,continue:!r.abort})}}),Ho=p("$ZodCheckBigIntFormat",(e,r)=>{L.init(e,r);let[i,o]=Kt[r.format];e._zod.check=t=>{let n=t.value;n<i&&t.issues.push({origin:"bigint",input:n,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!r.abort}),n>o&&t.issues.push({origin:"bigint",input:n,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!r.abort})}}),Qo=p("$ZodCheckMaxSize",(e,r)=>{var i;L.init(e,r),(i=e._zod.def).when??(i.when=Wo),e._zod.check=o=>{let t=o.value;t.size<=r.maximum||o.issues.push({origin:Gt(t),code:"too_big",maximum:r.maximum,inclusive:!0,input:t,inst:e,continue:!r.abort})}}),ea=p("$ZodCheckMinSize",(e,r)=>{var i;L.init(e,r),(i=e._zod.def).when??(i.when=Wo),e._zod.check=o=>{let t=o.value;t.size>=r.minimum||o.issues.push({origin:Gt(t),code:"too_small",minimum:r.minimum,inclusive:!0,input:t,inst:e,continue:!r.abort})}}),ta=p("$ZodCheckSizeEquals",(e,r)=>{var i;L.init(e,r),(i=e._zod.def).when??(i.when=Wo),e._zod.check=o=>{let t=o.value,n=t.size;if(n===r.size)return;let a=n>r.size;o.issues.push({origin:Gt(t),...a?{code:"too_big",maximum:r.size}:{code:"too_small",minimum:r.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!r.abort})}}),ra=p("$ZodCheckMaxLength",(e,r)=>{var i;L.init(e,r),(i=e._zod.def).when??(i.when=Xo),e._zod.check=o=>{let t=o.value,n=t.length;if((typeof t=="string"&&n>r.maximum?Ce(t):n)<=r.maximum)return;let u=Wt(t);o.issues.push({origin:u,code:"too_big",maximum:r.maximum,inclusive:!0,input:t,inst:e,continue:!r.abort})}}),na=p("$ZodCheckMinLength",(e,r)=>{var i;L.init(e,r),(i=e._zod.def).when??(i.when=Xo),e._zod.check=o=>{let t=o.value,n=t.length;if((typeof t=="string"&&n>=r.minimum&&n<r.minimum*2?Ce(t):n)>=r.minimum)return;let u=Wt(t);o.issues.push({origin:u,code:"too_small",minimum:r.minimum,inclusive:!0,input:t,inst:e,continue:!r.abort})}}),ia=p("$ZodCheckLengthEquals",(e,r)=>{var i;L.init(e,r),(i=e._zod.def).when??(i.when=Xo),e._zod.check=o=>{let t=o.value,n=t.length,a=typeof t=="string"&&n>=r.length&&n<=r.length*2?Ce(t):n;if(a===r.length)return;let u=Wt(t),s=a>r.length;o.issues.push({origin:u,...s?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!r.abort})}}),dt=p("$ZodCheckStringFormat",(e,r)=>{var i,o;L.init(e,r),r.pattern?(i=e._zod).check??(i.check=t=>{r.pattern.lastIndex=0,!r.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:r.format,input:t.value,...r.pattern?{pattern:r.pattern.toString()}:{},inst:e,continue:!r.abort})}):(o=e._zod).check??(o.check=()=>{})}),oa=p("$ZodCheckRegex",(e,r)=>{dt.init(e,r),e._zod.check=i=>{r.pattern.lastIndex=0,!r.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:r.pattern.toString(),inst:e,continue:!r.abort})}}),aa=p("$ZodCheckLowerCase",(e,r)=>{r.pattern??(r.pattern=Bo),dt.init(e,r)}),ua=p("$ZodCheckUpperCase",(e,r)=>{r.pattern??(r.pattern=Ko),dt.init(e,r)}),ca=p("$ZodCheckIncludes",(e,r)=>{L.init(e,r);let i=se(r.includes),o=new RegExp(typeof r.position=="number"?`^.{${r.position},}${i}`:i);r.pattern=o,e._zod.check=t=>{t.value.includes(r.includes,r.position)||t.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:r.includes,input:t.value,inst:e,continue:!r.abort})}}),sa=p("$ZodCheckStartsWith",(e,r)=>{L.init(e,r);let i=new RegExp(`^${se(r.prefix)}.*`);r.pattern??(r.pattern=i),e._zod.check=o=>{o.value.startsWith(r.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:r.prefix,input:o.value,inst:e,continue:!r.abort})}}),la=p("$ZodCheckEndsWith",(e,r)=>{L.init(e,r);let i=new RegExp(`.*${se(r.suffix)}$`);r.pattern??(r.pattern=i),e._zod.check=o=>{o.value.endsWith(r.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:r.suffix,input:o.value,inst:e,continue:!r.abort})}});function on(e,r,i){e.issues.length&&r.issues.push(...te(i,e.issues))}var da=p("$ZodCheckProperty",(e,r)=>{L.init(e,r),e._zod.check=i=>{let o=r.schema._zod.run({value:i.value[r.property],issues:[]},{});if(o instanceof Promise)return o.then(t=>on(t,i,r.property));on(o,i,r.property)}}),fa=p("$ZodCheckProperties",(e,r)=>{L.init(e,r),Xt(e,Symbol.iterator,function*(){yield e});let i;e._zod.check=o=>{if(o.value==null){o.issues.push({expected:"object",code:"invalid_type",input:o.value,inst:e});return}i??(i=Reflect.ownKeys(r.shape).map(a=>[a,r.shape[a]]));let t=o.value,n;for(let[a,u]of i){let s=u._zod.run({value:t[a],issues:[]},{});s instanceof Promise?(n??(n=[]),n.push(s.then(c=>on(c,o,a)))):on(s,o,a)}if(n)return Promise.all(n).then(()=>{})}}),ma=p("$ZodCheckMimeType",(e,r)=>{L.init(e,r);let i=new Set(r.mime);e._zod.check=o=>{i.has(o.value.type)||o.issues.push({code:"invalid_value",values:r.mime,input:o.value.type,inst:e,continue:!r.abort})}}),pa=p("$ZodCheckOverwrite",(e,r)=>{L.init(e,r),e._zod.check=i=>{i.value=r.tx(i.value)}});var Ve=class{constructor(r=[],i={}){this.content=[],this.indent=0,this.args=r,this.closed=i}indented(r){this.indent+=1;try{r(this)}finally{this.indent-=1}}write(r){if(typeof r=="function"){r(this,{execution:"sync"}),r(this,{execution:"async"});return}let o=r.split(`
|
|
6
6
|
`).filter(a=>a),t=Math.min(...o.map(a=>a.length-a.trimStart().length)),n=o.map(a=>a.slice(t)).map(a=>" ".repeat(this.indent*2)+a);for(let a of n)this.content.push(a)}compile(){let r=Function,i=this?.content??[""];return new r(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
7
7
|
${i.join(`
|
|
@@ -62,4 +62,4 @@ ${s}`:s:"",l=Function,d=`return (input) => {
|
|
|
62
62
|
${s}
|
|
63
63
|
}`,f;try{f=new l(...a,d)(...u)}catch(m){throw new N(`this schema (generated code failed to evaluate: ${m.message})`)}return r?.debug&&(f.code=c),f.definite=o.definite,f}function S(e,r){for(let[o,t]of e.constants)if(t===r)return o;let i=`c${e.constantCounter++}`;return e.constants.set(i,r),i}function Je(e,r){return e.definite=!1,S(e,r)}function w(e){return`v${e.varCounter++}`}function d$(e,r){let i=e._zod.run({value:r,issues:[]},{});if(i&&typeof i.then=="function")return H;let o=i;return o.issues.length===0?o.value:H}function X(e,r,i,o,t=!0){let n=e.content.length,a=r.constants.size,u=r.constantCounter,s=r.varCounter;try{return R(e,r,i,o,t)}catch(c){if(!(c instanceof N)||!c.islandable)throw c;if(e.content.length=n,r.constants.size>a){let l=Array.from(r.constants.keys()).slice(a);for(let d of l)r.constants.delete(d)}return r.constantCounter=u,r.varCounter=s,f$(e,r,i,o)}}function f$(e,r,i,o){r.definite=!1;let t=S(r,i),n=S(r,d$),a=w(r);return e.write(`const ${a} = ${n}(${t}, ${o});`),e.write(`if (${a} === INVALID) return INVALID;`),a}var m$=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);function p$(e,r,i,o){let t=i._zod.def.checks;if(!t||t.length===0)return o;let n=o;for(let a of t){let u=a._zod.def;if(u.when&&!m$.has(u.check))throw new N('check with a custom "when" condition');switch(u.check){case"greater_than":g$(e,r,u,n);break;case"less_than":v$(e,r,u,n);break;case"multiple_of":$$(e,r,u,n);break;case"number_format":If(e,u,n);break;case"min_length":{let s=Fe(u.minimum,"min_length"),c=Uu(e,r,n,`${n}.length >= ${s} && ${n}.length < ${u.minimum*2}`);e.write(`if (${c} < ${s}) return INVALID;`);break}case"max_length":{let s=Fe(u.maximum,"max_length"),c=Uu(e,r,n,`${n}.length > ${s}`);e.write(`if (${c} > ${s}) return INVALID;`);break}case"length_equals":{let s=Fe(u.length,"length_equals"),c=Uu(e,r,n,`${n}.length >= ${s} && ${n}.length <= ${u.length*2}`);e.write(`if (${c} !== ${s}) return INVALID;`);break}case"min_size":e.write(`if (${n}.size < ${Fe(u.minimum,"min_size")}) return INVALID;`);break;case"max_size":e.write(`if (${n}.size > ${Fe(u.maximum,"max_size")}) return INVALID;`);break;case"size_equals":e.write(`if (${n}.size !== ${Fe(u.size,"size_equals")}) return INVALID;`);break;case"string_format":n=wf(e,r,u,n);break;case"custom":n=x$(e,r,a,n);break;case"bigint_format":h$(e,u,n);break;case"mime_type":y$(e,r,u,n);break;case"property":b$(e,r,u,n);break;case"properties":_$(e,r,u,n);break;case"overwrite":{let s=w(r);k$(e,r,a,n,s),n=s;break}default:throw new N(`check type ${u.check}`)}}return n}function Uu(e,r,i,o){let t=S(r,Ce),n=w(r);return e.write(`const ${n} = typeof ${i} === "string" && ${o} ? ${t}(${i}) : ${i}.length;`),n}function Fe(e,r){if(typeof e!="number"||!Number.isFinite(e))throw new N(`${r} bound of type ${typeof e}`);return`${e}`}function xf(e,r){if(typeof r=="bigint")return`${r}n`;if(typeof r=="number"){if(Number.isNaN(r))throw new N("comparison check with NaN bound");return`${r}`}if(r instanceof Date){if(Number.isNaN(r.getTime()))throw new N("comparison check with Invalid Date bound");return S(e,r)}throw new N(`comparison check bound of type ${typeof r}`)}function g$(e,r,i,o){let t=i.inclusive?"<":"<=";e.write(`if (${o} ${t} ${xf(r,i.value)}) return INVALID;`)}function v$(e,r,i,o){let t=i.inclusive?">":">=";e.write(`if (${o} ${t} ${xf(r,i.value)}) return INVALID;`)}function $$(e,r,i,o){if(typeof i.value=="bigint"){if(i.value===BigInt(0))throw new N("multiple_of check with a zero divisor");e.write(`if (${o} % ${i.value}n !== 0n) return INVALID;`)}else{let t=S(r,Ft);e.write(`if (${t}(${o}, ${Fe(i.value,"multiple_of")}) !== 0) return INVALID;`)}}function If(e,r,i){let o=r.format;switch(o){case"safeint":e.write(`if (!Number.isSafeInteger(${i})) return INVALID;`);break;case"int32":e.write(`if (!Number.isInteger(${i}) || ${i} < -2147483648 || ${i} > 2147483647) return INVALID;`);break;case"uint32":e.write(`if (!Number.isInteger(${i}) || ${i} < 0 || ${i} > 4294967295) return INVALID;`);break;case"float32":e.write(`if (!Number.isFinite(${i}) || ${i} < -3.4028234663852886e38 || ${i} > 3.4028234663852886e38) return INVALID;`);break;case"float64":e.write(`if (!Number.isFinite(${i})) return INVALID;`);break;default:throw new N(`number format ${o}`)}}function h$(e,r,i){let o=r.format;if(o)switch(o){case"int64":e.write(`if (${i} < -9223372036854775808n || ${i} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${i} < 0n || ${i} > 18446744073709551615n) return INVALID;`);break;default:throw new N(`bigint format ${o}`)}}function y$(e,r,i,o){let t=i.mime;if(t&&t.length>0){let n=S(r,new Set(t));e.write(`if (!${n}.has(${o}.type)) return INVALID;`)}}function _$(e,r,i,o){if(i.when)throw new N('check with a custom "when" condition');e.write(`if (${o} == null) return INVALID;`);let t=i.shape;for(let n of Reflect.ownKeys(t)){let a=typeof n=="symbol"?S(r,n):q(n),u=w(r);e.write(`const ${u} = ${o}[${a}];`),X(e,r,t[n],u,!1)}}function b$(e,r,i,o){let t=`${o}[${JSON.stringify(i.property)}]`;R(e,r,i.schema,t)}function k$(e,r,i,o,t){let n=i._zod.def.tx;if(!n)throw new N("overwrite check without a transform function");if(Be(n))throw new fe("z.compile: async overwrite transforms are not supported");let a=S(r,n);e.write(`const ${t} = ${a}(${o});`)}function Au(){throw new ne}function Eu(e){this.issues.push(e)}function x$(e,r,i,o){let t=i._zod.def;if(t.fn){if(Be(t.fn))throw new fe("z.compile: async .refine() predicates are not supported");let n=Je(r,t.fn),a=S(r,Au),u=w(r);return e.write(`const ${u} = ${n}(${o});`),e.write(`if (${u} instanceof Promise) ${a}();`),e.write(`if (!${u}) return INVALID;`),o}if(i._zod.check){if(Be(i._zod.check))throw new fe("z.compile: async .superRefine() / check functions are not supported");let n=i._zod.check,u=Je(r,c=>{let l={value:c,issues:[],addIssue:Eu};return n(l)instanceof Promise&&Au(),l.issues.length===0?l.value:H}),s=w(r);return e.write(`const ${s} = ${u}(${o});`),e.write(`if (${s} === INVALID) return INVALID;`),s}throw new N("custom check without a predicate or check function")}var I$=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 wf(e,r,i,o,t=!0){let n=i.format;if(n==="base64"){let c=S(r,ur);return e.write(`if (!${c}(${o})) return INVALID;`),o}if(n==="base64url"){let c=S(r,hn);return e.write(`if (!${c}(${o})) return INVALID;`),o}if(n==="jwt"){let c=S(r,bn),l=S(r,i.alg??null);return e.write(`if (!${c}(${o}, ${l})) return INVALID;`),o}if(n==="ipv6"){let c=S(r,ar);return e.write(`if (!${c}(${o})) return INVALID;`),o}if(n==="cidrv6"){let c=S(r,vn);return e.write(`if (!${c}(${o})) return INVALID;`),o}if(n==="credit_card"){let c=S(r,yn);return e.write(`if (!${c}(${o})) return INVALID;`),o}if(n==="iban"){let c=S(r,_n);return e.write(`if (!${c}(${o})) return INVALID;`),o}let a=i;if(n==="url"||n==="httpurl"||a.normalize||a.hostname!==void 0||a.protocol!==void 0){let c=S(r,mn),l=S(r,i),d=w(r),f=w(r);if(e.write(`const ${d} = ${o}.trim();`),e.write(`const ${f} = ${c}(${d}, ${l});`),e.write(`if (typeof ${f} === "number") return INVALID;`),a.hostname!==void 0){let _=S(r,pn);e.write(`if (!${_}(${f}, ${l}.hostname)) return INVALID;`)}if(a.protocol!==void 0){let _=S(r,gn);e.write(`if (!${_}(${f}, ${l}.protocol)) return INVALID;`)}if(!t)return null;let m=w(r),v=a.normalize?`${f}.href`:`${S(r,or)}(${d})`;return e.write(`const ${m} = ${v};`),m}let u=i.fn;if(u){if(Be(u))throw new N(`async string format ${n}`);let c=S(r,u);return e.write(`if (!${c}(${o})) return INVALID;`),o}if(I$.has(n)&&i.pattern){let c=S(r,i.pattern);return e.write(`${c}.lastIndex = 0;`),e.write(`if (!${c}.test(${o})) return INVALID;`),o}let s=i.format;switch(s){case"regex":throw new N("regex format without a pattern");case"lowercase":e.write(`if (${o} !== ${o}.toLowerCase()) return INVALID;`);break;case"uppercase":e.write(`if (${o} !== ${o}.toUpperCase()) return INVALID;`);break;case"includes":e.write(`if (!${o}.includes(${q(i.includes)})) return INVALID;`);break;case"starts_with":{let c=i.prefix;e.write(`if (${o}.slice(0, ${c.length}) !== ${q(c)}) return INVALID;`);break}case"ends_with":{let c=i.suffix;e.write(`if (${o}.slice(-${c.length}) !== ${q(c)}) return INVALID;`);break}default:throw new N(`string format ${s}`)}return o}function R(e,r,i,o,t=!0){let n=i._zod.def,a=n.type;if(n.coerce)throw new N(`coercion (z.coerce.${a}())`);let u=t||!!n.checks?.length,s;switch(a){case"string":s=w$(e,r,i,o,u);break;case"number":s=z$(e,i,o);break;case"boolean":s=S$(e,o);break;case"bigint":s=P$(e,i,o);break;case"symbol":s=D$(e,o);break;case"undefined":s=j$(e,o);break;case"null":s=O$(e,o);break;case"any":case"unknown":s=o;break;case"never":e.write("return INVALID;"),s=o;break;case"void":s=N$(e,o);break;case"nan":s=U$(e,o);break;case"date":s=A$(e,o);break;case"object":s=T$(e,r,i,o,u);break;case"optional":s=Z$(e,r,i,o,u);break;case"nullable":s=L$(e,r,i,o,u);break;case"array":s=V$(e,r,i,o,u);break;case"literal":s=R$(e,r,i,o);break;case"enum":s=F$(e,r,i,o);break;case"readonly":{let c=_f(e,r,i,o),l=w(r);e.write(`const ${l} = Object.freeze(${c});`),s=l;break}case"success":_f(e,r,i,o),s="true";break;case"default":case"prefault":s=M$(e,r,i,o);break;case"nonoptional":s=J$(e,r,i,o);break;case"tuple":s=B$(e,r,i,o);break;case"union":s=K$(e,r,i,o);break;case"intersection":s=X$(e,r,i,o);break;case"record":s=q$(e,r,i,o);break;case"map":s=H$(e,r,i,o);break;case"set":s=Q$(e,r,i,o);break;case"file":s=eh(e,o);break;case"template_literal":s=th(e,r,i,o);break;case"lazy":s=rh(e,r,i,o);break;case"pipe":s=nh(e,r,i,o);break;case"custom":s=ih(e,r,i,o);break;case"transform":s=uh(e,r,i,o);break;case"catch":s=ah(e,r,i,o);break;default:throw new N(`schema type ${a}`)}return s===null?null:p$(e,r,i,s)}function w$(e,r,i,o,t=!0){e.write(`if (typeof ${o} !== "string") return INVALID;`);let n=i._zod.def;return n.format===void 0?o:wf(e,r,n,o,t)}function z$(e,r,i){e.write(`if (typeof ${i} !== "number" || !Number.isFinite(${i})) return INVALID;`);let o=r._zod.def;return o.check==="number_format"&&o.format&&If(e,{format:o.format},i),i}function S$(e,r){return e.write(`if (typeof ${r} !== "boolean") return INVALID;`),r}function P$(e,r,i){e.write(`if (typeof ${i} !== "bigint") return INVALID;`);let o=r._zod.def;if(o.format)switch(o.format){case"int64":e.write(`if (${i} < -9223372036854775808n || ${i} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${i} < 0n || ${i} > 18446744073709551615n) return INVALID;`);break}return i}function D$(e,r){return e.write(`if (typeof ${r} !== "symbol") return INVALID;`),r}function j$(e,r){return e.write(`if (${r} !== undefined) return INVALID;`),r}function O$(e,r){return e.write(`if (${r} !== null) return INVALID;`),r}function N$(e,r){return e.write(`if (${r} !== undefined) return INVALID;`),r}function U$(e,r){return e.write(`if (typeof ${r} !== "number" || !Number.isNaN(${r})) return INVALID;`),r}function A$(e,r){return e.write(`if (!(${r} instanceof Date) || Number.isNaN(${r}.getTime())) return INVALID;`),r}function T$(e,r,i,o,t=!0){let n=i._zod.def;e.write(`if (typeof ${o} !== "object" || ${o} === null || Array.isArray(${o})) return INVALID;`);let a=n.shape,u=Object.keys(a),s=Object.getOwnPropertySymbols(a),c=s.length?[...u,...s]:u,l=I=>typeof I=="symbol"?S(r,I):q(I),d=I=>typeof I=="symbol"?`[${l(I)}]`:q(I),f=a;if(u.includes("__proto__"))throw new N('object shape key "__proto__"');let m=new Map;for(let I of c){let D=f[I],A=l(I),V=w(r);if(e.write(`const ${V} = ${o}[${A}];`),D._zod.optin!==void 0){let U=w(r);e.write(`let ${U} = (() => {`),e.indented(W=>{let Vt=X(W,r,D,V);W.write(`return ${Vt};`)}),e.write("})();"),D._zod.optout==="optional"?(e.write(`if (${U} === INVALID) {`),e.indented(W=>{W.write(`if (${A} in ${o}) return INVALID;`),W.write(`${U} = undefined;`)}),e.write("}")):e.write(`if (${U} === INVALID) return INVALID;`),m.set(I,U)}else{C$(D)&&e.write(`if (!(${A} in ${o})) return INVALID;`);let U=X(e,r,D,V,t);U!==null&&m.set(I,U)}}let v=n.catchall,_="none";if(v){let I=v._zod.def.type;if(I==="never"){let D=u.map(A=>`k !== ${q(A)}`).join(" && ")||"true";e.write(`for (const k in ${o}) {`),e.indented(A=>{A.write(`if (${D}) return INVALID;`)}),e.write("}")}else(I==="unknown"||I==="any")&&!v._zod.def.checks?.length?_="passthrough":_="schema"}let k=w(r),z=c.some(I=>yf(f[I])||Tu(f[I]));if(!t){if(_==="schema"){let I=u.length>0?S(r,new Set(u)):null;e.write(`for (const k in ${o}) {`),e.indented(D=>{D.write('if (k === "__proto__") continue;'),I&&D.write(`if (${I}.has(k)) continue;`);let A=w(r);D.write(`const ${A} = ${o}[k];`),X(D,r,v,A,!1)}),e.write("}")}return null}if(z){e.write(`const ${k} = {};`);for(let I of c){let D=l(I),A=m.get(I);Tu(f[I])?e.write(`if (${D} in ${o}) ${k}[${D}] = ${A};`):yf(f[I])?e.write(`if (${A} !== undefined || ${D} in ${o}) ${k}[${D}] = ${A};`):e.write(`${k}[${D}] = ${A};`)}}else{let I=c.map(D=>`${d(D)}: ${m.get(D)}`).join(", ");e.write(`const ${k} = { ${I} };`)}if(_!=="none"){let I=u.length>0?S(r,new Set(u)):null;e.write(`for (const k in ${o}) {`),e.indented(D=>{if(D.write('if (k === "__proto__") continue;'),I&&D.write(`if (${I}.has(k)) continue;`),_==="passthrough")D.write(`${k}[k] = ${o}[k];`);else{let A=w(r);D.write(`const ${A} = ${o}[k];`);let V=X(D,r,v,A);D.write(`${k}[k] = ${V};`)}}),e.write("}")}return k}function Z$(e,r,i,o,t=!0){let n=i._zod.def;if(E$(i))return R(e,r,n.innerType,o,t);if(n.innerType._zod.optin==="defaulted"){let u=w(r),s=w(r);return e.write(`let ${u};`),e.write(`if (${o} === undefined) {`),e.indented(c=>{c.write(`const ${s} = (() => {`),c.indented(l=>{let d=R(l,r,n.innerType,o);l.write(`return ${d};`)}),c.write("})();"),c.write(`if (${s} !== INVALID) ${u} = ${s};`)}),e.write("} else {"),e.indented(c=>{let l=R(c,r,n.innerType,o);c.write(`${u} = ${l};`)}),e.write("}"),u}let a=t?w(r):null;return a&&e.write(`let ${a};`),e.write(`if (${o} !== undefined) {`),e.indented(u=>{let s=R(u,r,n.innerType,o,t);a&&s!==null&&u.write(`${a} = ${s};`)}),e.write("}"),a}function E$(e){return e._zod.traits?.has("$ZodExactOptional")===!0}function C$(e){return e._zod.optin===void 0&&Me(e)}function Me(e){if(e._zod.def.coerce)return!0;let r=e._zod.def;switch(r.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"record":case"map":case"set":case"file":case"template_literal":return!1;case"nonoptional":return r.innerType?Me(r.innerType):!1;case"literal":return!!r.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":case"nullable":case"readonly":case"success":return r.innerType?Me(r.innerType):!0;case"catch":return!0;case"union":return r.options?r.options.some(Me):!0;case"intersection":return!r.left||!r.right?!0:Me(r.left)&&Me(r.right);case"pipe":return r.in?Me(r.in):!0;default:return!0}}function Tu(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}function yf(e){return(e._zod.optin!=="defaulted"||e._zod.optout==="optional")&>(e)}function gt(e){let r=e._zod.def;switch(r.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!!r.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":return!0;case"nullable":case"readonly":case"nonoptional":return r.innerType?gt(r.innerType):!0;case"union":return r.options?r.options.some(gt):!0;case"intersection":return!r.left||!r.right||gt(r.left)||gt(r.right);case"pipe":return r.out?gt(r.out):!0;default:return!0}}function L$(e,r,i,o,t=!0){let n=i._zod.def,a=t?w(r):null;return a&&e.write(`let ${a} = null;`),e.write(`if (${o} !== null) {`),e.indented(u=>{let s=R(u,r,n.innerType,o,t);a&&s!==null&&u.write(`${a} = ${s};`)}),e.write("}"),a}function V$(e,r,i,o,t=!0){let n=i._zod.def;e.write(`if (!Array.isArray(${o})) return INVALID;`);let a=t?w(r):null,u=w(r),s=w(r);return a&&e.write(`const ${a} = new Array(${o}.length);`),e.write(`for (let ${u} = 0; ${u} < ${o}.length; ${u}++) {`),e.indented(c=>{c.write(`const ${s} = ${o}[${u}];`);let l=X(c,r,n.element,s,t);a&&l!==null&&c.write(`${a}[${u}] = ${l};`)}),e.write("}"),a}function R$(e,r,i,o){let n=i._zod.def.values;if(n.length!==1){let u=S(r,new Set(n));return e.write(`if (!${u}.has(${o})) return INVALID;`),o}let a=n[0];if(typeof a=="number"&&Number.isNaN(a)){let u=S(r,new Set(n));return e.write(`if (!${u}.has(${o})) return INVALID;`),o}if(typeof a=="string")e.write(`if (${o} !== ${q(a)}) return INVALID;`);else if(typeof a=="number"||typeof a=="boolean")e.write(`if (${o} !== ${a}) return INVALID;`);else if(a===null)e.write(`if (${o} !== null) return INVALID;`);else if(a===void 0)e.write(`if (${o} !== undefined) return INVALID;`);else if(typeof a=="bigint")e.write(`if (${o} !== ${a}n) return INVALID;`);else throw new N(`literal type ${typeof a}`);return o}function F$(e,r,i,o){let t=i._zod.values;if(!t)throw new N("enum schema without enumerated values");let n=S(r,t);return e.write(`if (!${n}.has(${o})) return INVALID;`),o}function _f(e,r,i,o){let t=i._zod.def;return R(e,r,t.innerType,o)}function M$(e,r,i,o){let t=i._zod.def,a=Object.getOwnPropertyDescriptor(i._zod.def,"defaultValue")?()=>i._zod.def.defaultValue:void 0;if(i._zod.def.type==="prefault"){if(!a)return R(e,r,t.innerType,o);let s=S(r,a),c=w(r);return e.write(`let ${c} = ${o};`),e.write(`if (${o} === undefined) ${c} = ${s}();`),R(e,r,t.innerType,c)}let u=w(r);if(a){let s=S(r,a),c=S(r,Mt);e.write(`let ${u};`),e.write(`if (${o} === undefined) {`),e.indented(l=>{l.write(`${u} = ${c}(${s}());`)}),e.write("} else {"),e.indented(l=>{let d=R(l,r,t.innerType,o);l.write(`${u} = ${d} === undefined ? ${c}(${s}()) : ${d};`)}),e.write("}")}else e.write(`let ${u};`),e.write(`if (${o} !== undefined) {`),e.indented(s=>{let c=R(s,r,t.innerType,o);s.write(`${u} = ${c};`)}),e.write("}");return u}function J$(e,r,i,o){let t=i._zod.def,n=R(e,r,t.innerType,o),a=w(r);return e.write(`const ${a} = ${n};`),e.write(`if (${a} === undefined) return INVALID;`),a}function B$(e,r,i,o){let t=i._zod.def,n=t.items,a=t.rest;e.write(`if (!Array.isArray(${o})) return INVALID;`);let u=bf(n,"optin"),s=bf(n,"optout");a?e.write(`if (${o}.length < ${u}) return INVALID;`):e.write(`if (${o}.length < ${u} || ${o}.length > ${n.length}) return INVALID;`);let c=w(r);e.write(`const ${c} = [];`);for(let l=0;l<n.length;l++){let d=n[l];if(l>=s)e.write(`if (${c}.length === ${l}) {`),e.indented(f=>{f.write(`if (${l} < ${o}.length) {`),f.indented(m=>{let v=w(r);m.write(`const ${v} = ${o}[${l}];`);let _=X(m,r,d,v);m.write(`${c}[${l}] = ${_};`)}),f.write("} else {"),f.indented(m=>{if(Tu(d)){m.write(`${c}.length = ${l};`);return}let v=w(r),_=w(r);m.write(`const ${v} = undefined;`),m.write(`const ${_} = (() => {`),m.indented(k=>{let z=X(k,r,d,v);k.write(`return ${z};`)}),m.write("})();"),m.write(`if (${_} === INVALID || ${_} === undefined) ${c}.length = ${l};`),m.write(`else ${c}[${l}] = ${_};`)}),f.write("}")}),e.write("}");else{let f=w(r);e.write(`const ${f} = ${o}[${l}];`);let m=X(e,r,d,f);e.write(`${c}[${l}] = ${m};`)}}if(a){let l=w(r),d=w(r);e.write(`for (let ${l} = ${n.length}; ${l} < ${o}.length; ${l}++) {`),e.indented(f=>{f.write(`const ${d} = ${o}[${l}];`);let m=X(f,r,a,d);f.write(`${c}[${l}] = ${m};`)}),e.write("}")}return c}function bf(e,r){for(let i=e.length-1;i>=0;i--)if(!(r==="optin"?e[i]._zod.optin!==void 0:e[i]._zod.optout==="optional"))return i+1;return 0}function K$(e,r,i,o){let t=i._zod.def,n=t.options;if(t.discriminator)return G$(e,r,t,o);if(t.inclusive===!1)throw new N("exclusive unions (z.xor)");if(n.length===0)return e.write("return INVALID;"),o;if(n.length===1)return R(e,r,n[0],o);if(n.every(s=>s._zod.def.type==="literal"&&!s._zod.def.checks?.length)){let s=new Set(n.flatMap(l=>l._zod.def.values)),c=S(r,s);return e.write(`if (!${c}.has(${o})) return INVALID;`),o}let u=w(r);e.write(`let ${u};`);for(let s=0;s<n.length;s++){let c=n[s];s===0?e.write(`${u} = (() => {`):e.write(`if (${u} === INVALID) ${u} = (() => {`),e.indented(l=>{let d=R(l,r,c,o);l.write(`return ${d};`)}),e.write("})();")}return e.write(`if (${u} === INVALID) return INVALID;`),u}function G$(e,r,i,o){if(i.unionFallback)throw new N("discriminated union with unionFallback");if(i.options.length===0)return e.write("return INVALID;"),o;let t=w(r),n=w(r);e.write(`const ${t} = ${o}?.[${q(i.discriminator)}];`),e.write(`let ${n};`);let a=!0,u=new Set;for(let s of i.options){let c=s._zod.propValues?.[i.discriminator];if(!c||c.size===0)throw new N("discriminated union option without static discriminator values");for(let f of c){if(u.has(f))throw new N(`duplicate discriminator value ${String(f)}`);u.add(f)}let l=Array.from(c,f=>W$(r,t,f)),d=a?"if":"else if";e.write(`${d} (${l.join(" || ")}) {`),e.indented(f=>{let m=R(f,r,s,o);f.write(`${n} = ${m};`)}),e.write("}"),a=!1}return e.write("else { return INVALID; }"),n}function W$(e,r,i){if(typeof i=="string")return`${r} === ${q(i)}`;if(typeof i=="number")return Number.isNaN(i)?`Number.isNaN(${r})`:`${r} === ${i}`;if(typeof i=="boolean")return`${r} === ${i}`;if(i===null)return`${r} === null`;if(i===void 0)return`${r} === undefined`;if(typeof i=="bigint")return`${r} === ${i}n`;if(typeof i=="symbol"){let o=S(e,i);return`${r} === ${o}`}throw new N(`literal discriminator value ${String(i)}`)}function X$(e,r,i,o){let t=i._zod.def;r.definite=!1;let n=X(e,r,t.left,o),a=X(e,r,t.right,o),u=S(r,ft),s=w(r);return e.write(`const ${s} = ${u}(${n}, ${a});`),e.write(`if (!${s}.valid) return INVALID;`),`${s}.data`}function q$(e,r,i,o){let t=i._zod.def,n=S(r,ce);e.write(`if (!${n}(${o})) return INVALID;`);let a=w(r),u=w(r),s=w(r);e.write(`const ${a} = {};`);let c=t,l=c.partial?void 0:t.keyType._zod.values;if(l){let m=[];for(let _ of l){if(!(typeof _=="string"||typeof _=="number"||typeof _=="symbol"))throw new N(`record key value ${String(_)}`);let k=typeof _=="number"?_.toString():_;if(k==="__proto__")throw new N('record key "__proto__"');m.push(k);let z=S(r,_),I=R(e,r,t.keyType,z),D=w(r);e.write(`const ${D} = ${o}[${Y$(r,k)}];`);let A=X(e,r,t.valueType,D);e.write(`${a}[${I}] = ${A};`)}let v=S(r,new Set(m));return e.write(`for (const ${u} in ${o}) {`),e.indented(_=>{_.write(`if (${v}.has(${u})) continue;`),c.mode==="loose"?_.write(`if (${u} !== "__proto__") ${a}[${u}] = ${o}[${u}];`):_.write("return INVALID;")}),e.write("}"),a}let d=t.keyType._zod.def;if(!(d.type==="string"&&d.format===void 0&&!d.coerce&&(d.checks?.length??0)===0)){let m=t.mode==="loose",v=Ln(t.keyType);v.definite===!1&&(r.definite=!1);let _=S(r,v),k=S(r,be),z=w(r);return kf(e,r,o,u,I=>{I.write(`let ${z} = ${_}(${u});`),I.write(`if (${z} === INVALID && typeof ${u} === "string" && ${k}.test(${u})) ${z} = ${_}(Number(${u}));`),m?I.write(`if (${z} === INVALID) { ${a}[${u}] = ${o}[${u}]; continue; }`):I.write(`if (${z} === INVALID) return INVALID;`),I.write(`if (${z} === "__proto__") continue;`);let D=w(r);I.write(`const ${D} = ${o}[${u}];`);let A=X(I,r,t.valueType,D);I.write(`${a}[${z}] = ${A};`)}),a}return kf(e,r,o,u,m=>{m.write(`const ${s} = ${o}[${u}];`);let v=X(m,r,t.valueType,s);m.write(`${a}[${u}] = ${v};`)},"return INVALID;"),a}function kf(e,r,i,o,t,n){let a=S(r,Object.prototype.propertyIsEnumerable),u=w(r),s=w(r),c=w(r);e.write(`const ${u} = Object.getOwnPropertySymbols(${i});`),e.write(`const ${s} = Object.getOwnPropertyNames(${i});`),e.write(`for (let ${c} = 0; ${c} < ${s}.length; ${c}++) {`),e.indented(l=>{l.write(`const ${o} = ${s}[${c}];`),l.write(`if (${o} === "__proto__" || !${a}.call(${i}, ${o})) continue;`),t(l)}),e.write("}"),e.write(`for (let ${c} = 0; ${c} < ${u}.length; ${c}++) {`),e.indented(l=>{l.write(`const ${o} = ${u}[${c}];`),l.write(`if (!${a}.call(${i}, ${o})) continue;`),n?l.write(n):t(l)}),e.write("}")}function Y$(e,r){return typeof r=="string"?q(r):S(e,r)}function H$(e,r,i,o){let t=i._zod.def;e.write(`if (!(${o} instanceof Map)) return INVALID;`);let n=w(r),a=w(r),u=w(r);return e.write(`const ${n} = new Map();`),e.write(`for (const [${a}, ${u}] of ${o}) {`),e.indented(s=>{let c=R(s,r,t.keyType,a),l=R(s,r,t.valueType,u);s.write(`${n}.set(${c}, ${l});`)}),e.write("}"),n}function Q$(e,r,i,o){let t=i._zod.def;e.write(`if (!(${o} instanceof Set)) return INVALID;`);let n=w(r),a=w(r);return e.write(`const ${n} = new Set();`),e.write(`for (const ${a} of ${o}) {`),e.indented(u=>{let s=R(u,r,t.valueType,a);u.write(`${n}.add(${s});`)}),e.write("}"),n}function eh(e,r){return e.write(`if (!(${r} instanceof File)) return INVALID;`),r}function th(e,r,i,o){e.write(`if (typeof ${o} !== "string") return INVALID;`);let t=i._zod.pattern;if(t){let n=S(r,t);e.write(`${n}.lastIndex = 0;`),e.write(`if (!${n}.test(${o})) return INVALID;`)}return o}function rh(e,r,i,o){let t=i._zod.def,n=Je(r,t.getter),a=S(r,{parser:null});e.write(`if (!${a}.parser) {`),e.indented(s=>{s.write(`const inner = ${n}();`),s.write(`${a}.parser = function(input) {`),s.indented(c=>{c.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),c.write("return result.issues.length === 0 ? result.value : INVALID;")}),s.write("};")}),e.write("}");let u=w(r);return e.write(`const ${u} = ${a}.parser(${o});`),e.write(`if (${u} === INVALID) return INVALID;`),u}function nh(e,r,i,o){let t=i._zod.def,n=R(e,r,t.in,o);if(t.transform){if(Be(t.transform))throw new fe("z.compile: async transforms in pipes are not supported");let a=t.transform,s=Je(r,l=>{let d={value:l,issues:[],addIssue:Eu},f=a(l,d);return f instanceof Promise?H:d.issues.length===0?f:H}),c=w(r);return e.write(`const ${c} = ${s}(${n});`),e.write(`if (${c} === INVALID) return INVALID;`),R(e,r,t.out,c)}else return R(e,r,t.out,n)}function Be(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}function ih(e,r,i,o){let t=i._zod.def;if(t.fn){if(Be(t.fn))throw new fe("z.compile: async custom predicates are not supported");let n=Je(r,t.fn),a=S(r,Au),u=w(r);e.write(`const ${u} = ${n}(${o});`),e.write(`if (${u} instanceof Promise) ${a}();`),e.write(`if (!${u}) return INVALID;`)}else throw new N("custom schema without a predicate function");return o}function oh(e,r,i){let o=e._zod.run({value:i,issues:[]},{});if(o&&typeof o.then=="function")return H;let t=o;return t.issues.length===0?t.value:r()}function ah(e,r,i,o){let t=i._zod.def;if(!t.catchValue[Mr])throw new N("catch with a callback (only a constant catch value compiles)",!1);let n=w(r);e.write(`let ${n} = (() => {`),e.indented(c=>{let l=X(c,r,t.innerType,o);c.write(`return ${l};`)}),e.write("})();");let a=S(r,t.innerType),u=Je(r,t.catchValue),s=S(r,oh);return e.write(`if (${n} === INVALID) {`),e.indented(c=>{c.write(`${n} = ${s}(${a}, ${u}, ${o});`),c.write(`if (${n} === INVALID) return INVALID;`)}),e.write("}"),n}function uh(e,r,i,o){let t=i._zod.def;if(t.transform){if(Be(t.transform))throw new fe("z.compile: async transforms are not supported");let n=t.transform,u=Je(r,c=>{let l={value:c,issues:[],addIssue:Eu},d=n(c,l);return d instanceof Promise?H:l.issues.length===0?d:H}),s=w(r);return e.write(`const ${s} = ${u}(${o});`),e.write(`if (${s} === INVALID) return INVALID;`),s}return o}function Vn(e){return e.checks&&(e.checks=[...e.checks]),e}function Cu(e,r){return new e(Vn({type:"string",...b(r)}))}function Lu(e,r){return new e(Vn({type:"string",coerce:!0,...b(r)}))}function Rn(e,r){return new e({type:"string",format:"email",check:"string_format",abort:!1,...b(r)})}function Fn(e,r){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...b(r)})}function Mn(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...b(r)})}function Jn(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...b(r)})}function Bn(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...b(r)})}function Kn(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...b(r)})}function hr(e,r){return new e({type:"string",format:"url",check:"string_format",abort:!1,...b(r)})}function Gn(e,r){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...b(r)})}function Wn(e,r){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...b(r)})}function Xn(e,r){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...b(r)})}function qn(e,r){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...b(r)})}function Yn(e,r){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...b(r)})}function Hn(e,r){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...b(r)})}function Qn(e,r){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...b(r)})}function ei(e,r){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...b(r)})}function ti(e,r){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...b(r)})}function Vu(e,r){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...b(r)})}function ri(e,r){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...b(r)})}function ni(e,r){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...b(r)})}function ii(e,r){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...b(r)})}function oi(e,r){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...b(r)})}function ai(e,r){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...b(r)})}function Ru(e,r){return new e({type:"string",format:"credit_card",check:"string_format",abort:!1,...b(r)})}function Fu(e,r){return new e({type:"string",format:"iban",check:"string_format",abort:!1,...b(r)})}function ui(e,r){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...b(r)})}var Mu={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function yr(e,r){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...b(r)})}function _r(e,r){return new e({type:"string",format:"date",check:"string_format",...b(r)})}function br(e,r){return new e({type:"string",format:"time",check:"string_format",precision:null,...b(r)})}function kr(e,r){return new e({type:"string",format:"duration",check:"string_format",...b(r)})}function Ju(e,r){return new e(Vn({type:"number",checks:[],...b(r)}))}function Bu(e,r){return new e(Vn({type:"number",coerce:!0,checks:[],...b(r)}))}function Ku(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...b(r)})}function Gu(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...b(r)})}function Wu(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...b(r)})}function Xu(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...b(r)})}function qu(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...b(r)})}function Yu(e,r){return new e({type:"boolean",...b(r)})}function Hu(e,r){return new e({type:"boolean",coerce:!0,...b(r)})}function Qu(e,r){return new e({type:"bigint",...b(r)})}function ec(e,r){return new e({type:"bigint",coerce:!0,...b(r)})}function tc(e,r){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...b(r)})}function rc(e,r){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...b(r)})}function nc(e,r){return new e({type:"symbol",...b(r)})}function ic(e,r){return new e({type:"undefined",...b(r)})}function oc(e,r){return new e({type:"null",...b(r)})}function ac(e){return new e({type:"any"})}function uc(e){return new e({type:"unknown"})}function cc(e,r){return new e({type:"never",...b(r)})}function sc(e,r){return new e({type:"void",...b(r)})}function lc(e,r){return new e({type:"date",...b(r)})}function dc(e,r){return new e({type:"date",coerce:!0,...b(r)})}function fc(e,r){return new e({type:"nan",...b(r)})}function pe(e,r){return new an({check:"less_than",...b(r),value:e,inclusive:!1})}function ae(e,r){return new an({check:"less_than",...b(r),value:e,inclusive:!0})}function ge(e,r){return new un({check:"greater_than",...b(r),value:e,inclusive:!1})}function ue(e,r){return new un({check:"greater_than",...b(r),value:e,inclusive:!0})}function ci(e){return ge(0,e)}function si(e){return pe(0,e)}function li(e){return ae(0,e)}function di(e){return ue(0,e)}function Se(e,r){return new qo({check:"multiple_of",...b(r),value:e})}function Pe(e,r){return new Qo({check:"max_size",...b(r),maximum:e})}function ve(e,r){return new ea({check:"min_size",...b(r),minimum:e})}function Ke(e,r){return new ta({check:"size_equals",...b(r),size:e})}function Ge(e,r){return new ra({check:"max_length",...b(r),maximum:e})}function ke(e,r){return new na({check:"min_length",...b(r),minimum:e})}function We(e,r){return new ia({check:"length_equals",...b(r),length:e})}function vt(e,r){return new oa({check:"string_format",format:"regex",...b(r),pattern:e})}function $t(e){return new aa({check:"string_format",format:"lowercase",...b(e)})}function ht(e){return new ua({check:"string_format",format:"uppercase",...b(e)})}function yt(e,r){return new ca({check:"string_format",format:"includes",...b(r),includes:e})}function _t(e,r){return new sa({check:"string_format",format:"starts_with",...b(r),prefix:e})}function bt(e,r){return new la({check:"string_format",format:"ends_with",...b(r),suffix:e})}function fi(e,r,i){return new da({check:"property",property:e,schema:r,...b(i)})}function kt(e,r){return new fa({check:"properties",shape:e,...b(r)})}function xt(e,r){return new ma({check:"mime_type",mime:e,...b(r)})}function me(e){return new pa({check:"overwrite",tx:e})}function It(e){return me(r=>r.normalize(e))}function wt(){return me(e=>e.trim())}function zt(){return me(e=>e.toLowerCase())}function St(){return me(e=>e.toUpperCase())}function Pt(){return me(e=>Yi(e))}function mc(e,r,i){return new e({type:"array",element:r,...b(i)})}function ch(e,r,i){return new e({type:"union",options:r,...b(i)})}function sh(e,r,i){return new e({type:"union",options:r,inclusive:!1,...b(i)})}function lh(e,r,i,o){return new e({type:"union",options:i,discriminator:r,...b(o)})}function dh(e,r,i){return new e({type:"intersection",left:r,right:i})}function fh(e,r,i,o){let t=i instanceof P,n=t?o:i,a=t?i:null;return new e({type:"tuple",items:r,rest:a,...b(n)})}function mh(e,r,i,o){return new e({type:"record",keyType:r,valueType:i,...b(o)})}function ph(e,r,i,o){return new e({type:"map",keyType:r,valueType:i,...b(o)})}function gh(e,r,i){return new e({type:"set",valueType:r,...b(i)})}function vh(e,r,i){let o=Array.isArray(r)?Object.fromEntries(r.map(t=>[t,t])):r;return new e({type:"enum",entries:o,...b(i)})}function $h(e,r,i){return new e({type:"enum",entries:r,...b(i)})}function hh(e,r,i){return new e({type:"literal",values:Array.isArray(r)?r:[r],...b(i)})}function pc(e,r){return new e({type:"file",...b(r)})}function yh(e,r){return new e({type:"transform",transform:r})}function _h(e,r){return new e({type:"optional",innerType:r})}function bh(e,r){return new e({type:"nullable",innerType:r})}function kh(e,r,i){return new e({type:"default",innerType:r,get defaultValue(){return typeof i=="function"?i():Mt(i)}})}function xh(e,r,i){return new e({type:"nonoptional",innerType:r,...b(i)})}function Ih(e,r){return new e({type:"success",innerType:r})}function wh(e,r,i){return new e({type:"catch",innerType:r,catchValue:typeof i=="function"?i:no(i)})}function zh(e,r,i){return new e({type:"pipe",in:r,out:i})}function Sh(e,r){return new e({type:"readonly",innerType:r})}function Ph(e,r,i){return new e({type:"template_literal",parts:r,...b(i)})}function Dh(e,r){return new e({type:"lazy",getter:r})}function jh(e,r){return new e({type:"promise",innerType:r})}function gc(e,r,i){let o=b(i);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:r,...o})}function vc(e,r,i){return new e({type:"custom",check:"custom",fn:r,...b(i)})}function $c(e,r){let i=zf(o=>(o.addIssue=t=>{if(typeof t=="string")o.issues.push(at(t,o.value,i._zod.def));else{let n=t;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),"input"in n||(n.input=o.value),n.inst??(n.inst=i),n.continue??(n.continue=!i._zod.def.abort),o.issues.push(at(n))}},e(o.value,o)),r);return i}function zf(e,r){let i=new L({check:"custom",...b(r)});return i._zod.check=e,i}function hc(e){let r=new L({check:"describe"});return r._zod.onattach=[i=>{let o=G.get(i)??{};G.add(i,{...o,description:e})}],r._zod.check=()=>{},r}function yc(e){let r=new L({check:"meta"});return r._zod.onattach=[i=>{let o=G.get(i)??{};G.add(i,{...o,...e})}],r._zod.check=()=>{},r}function _c(e,r){let i=b(r),o=i.truthy??["true","1","yes","on","y","enabled"],t=i.falsy??["false","0","no","off","n","disabled"];i.case!=="sensitive"&&(o=o.map(m=>typeof m=="string"?m.toLowerCase():m),t=t.map(m=>typeof m=="string"?m.toLowerCase():m));let n=new Set(o),a=new Set(t),u=e.Codec??dr,s=e.Boolean??sr,c=e.String??Re,l=new c({type:"string",error:i.error}),d=new s({type:"boolean",error:i.error}),f=new u({type:"pipe",in:l,out:d,transform:((m,v)=>{let _=m;return i.case!=="sensitive"&&(_=_.toLowerCase()),n.has(_)?!0:a.has(_)?!1:(v.issues.push({code:"invalid_value",expected:"stringbool",values:[...n,...a],input:v.value,inst:f,continue:!1}),{})}),reverseTransform:((m,v)=>m===!0?o[0]||"true":t[0]||"false"),error:i.error});return f._zod.bag.truthy=o,f._zod.bag.falsy=t,f._zod.bag.case=i.case??"insensitive",f}function Xe(e,r,i,o={}){let t=b(o),n={check:"string_format",type:"string",format:r,fn:typeof i=="function"?i:u=>i.test(u),...t};return i instanceof RegExp&&(n.pattern=i),new e(n)}function xr(e,...r){for(let i of r)for(let o of Reflect.ownKeys(i))Object.prototype.propertyIsEnumerable.call(i,o)&&K(e,o,i[o]);return e}function De(e){let r=e?.target??"draft-2020-12";return r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??G,target:r,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function M(e,r,i,o,t){let n=typeof r.unrepresentable=="function"?r.unrepresentable({zodSchema:e,path:o.path,message:t}):r.unrepresentable;if(n==="any")return!1;if(n===void 0||n==="throw")throw new Error(t);return Object.assign(i,n),!0}function E(e,r,i={path:[],schemaPath:[]}){var o;let t=e._zod.def,n=r.seen.get(e);if(n)return n.count++,i.schemaPath.includes(e)&&(n.cycle=i.path),n.schema;let a={schema:{},count:1,cycle:void 0,path:i.path};r.seen.set(e,a),r.sharedDefsExtractedFor=void 0,r.sharedEmitDoneFor=void 0;let u=e._zod.toJSONSchema?.();if(u)a.schema=u;else{let l={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(r,a.schema,l);else{let f=a.schema,m=r.processors[t.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${t.type}`);m(e,r,f,l)}let d=e._zod.parent;d&&(a.ref||(a.ref=d),E(d,r,l),r.seen.get(d).isParent=!0)}let s=r.metadataRegistry.get(e);return s&&xr(a.schema,s),r.io==="input"&&Q(e)&&(delete a.schema.examples,delete a.schema.default),r.io==="input"&&"_prefault"in a.schema&&((o=a.schema).default??(o.default=a.schema._prefault)),delete a.schema._prefault,r.seen.get(e).schema}function Sf(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function je(e,r){let i=e.seen.get(r);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let o=new Map;for(let a of e.seen.entries()){let u=e.metadataRegistry.get(a[0])?.id;if(u){let s=o.get(u);if(s&&s!==a[0])throw new Error(`Duplicate schema id "${u}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(u,a[0])}}let t=a=>{let u=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(a[0])?.id,f=e.external.uri??(v=>v);if(d)return{ref:f(d)};let m=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=m,{defId:m,ref:`${f("__shared")}#/${u}/${Sf(m)}`}}let s="#",c=`${s}/${u}/`;if(a[1]===i&&!a[1].schema.id)return{ref:s};let l=a[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:c+Sf(l)}},n=a=>{if(a[1].schema.$ref)return;let u=a[1],{ref:s,defId:c}=t(a);u.def={...u.schema},c&&(u.defId=c);let l=u.schema;for(let d in l)delete l[d];l.$ref=s};if(e.cycles==="throw")for(let a of e.seen.entries()){let u=a[1];if(u.cycle)throw new Error(`Cycle detected: #/${u.cycle?.join("/")}/<root>
|
|
64
64
|
|
|
65
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let u=a[1];if(r===a[0]){n(a);continue}if(e.external){let c=e.external.registry.get(a[0])?.id;if(r!==a[0]&&c){n(a);continue}}if(e.metadataRegistry.get(a[0])?.id){n(a);continue}if(u.cycle){n(a);continue}u.count>1&&e.reused==="ref"&&n(a)}e.external&&(e.sharedDefsExtractedFor=e.external)}function jf(e){let r=e.anyOf;if(!Array.isArray(r)||r.length===0||e.type!==void 0)return;let i=[];for(let o of r){if(!o||typeof o!="object")return;jf(o);let t=Object.keys(o);if(t.length!==1||t[0]!=="type")return;let n=o.type;for(let a of Array.isArray(n)?n:[n]){if(typeof a!="string")return;i.includes(a)||i.push(a)}}delete e.anyOf,e.type=i.length===1?i[0]:i}var Of=new Set(["type","properties","required","additionalProperties"]),Pf=["oneOf","anyOf"];function Df(e){let r=e.additionalProperties;return r===void 0||r===!1||typeof r!="object"||r===null?null:Object.keys(r).length?r:null}function bc(e){let r=[];for(let n of e){if(typeof n!="object"||n.type!=="object")return null;for(let a in n)if(!Of.has(a))return null;r.push(n)}let i={},o=new Set;for(let n of r){for(let a in n.properties){if(Object.prototype.hasOwnProperty.call(i,a))continue;let u=[];for(let c of r){let l=c.properties?.[a]??Df(c);l!=null&&(u.some(d=>JSON.stringify(d)===JSON.stringify(l))||u.push(l))}let s=u.length===1?u[0]:bc(u)??{allOf:u};K(i,a,s)}for(let a of n.required??[])o.add(a)}let t={type:"object",properties:i};if(o.size&&(t.required=[...o]),r.every(n=>n.additionalProperties===!1))t.additionalProperties=!1;else{let n=[];for(let a of r){let u=Df(a);u&&!n.some(s=>JSON.stringify(s)===JSON.stringify(u))&&n.push(u)}n.length===1?t.additionalProperties=n[0]:n.length>1&&(t.additionalProperties={allOf:n})}return t}function Oh(e){let r=e.allOf;if(!Array.isArray(r)||r.length<2)return;for(let t of Of)if(t in e)return;let i=r.filter(t=>Pf.some(n=>Array.isArray(t[n]))),o=null;if(!i.length)o=bc(r);else{let t=i[0],n=Pf.find(s=>Array.isArray(t[s]));if(Object.keys(t).length!==1)return;let a=r.filter(s=>s!==t),u=t[n].map(s=>bc([...a,s]));if(u.some(s=>!s))return;o={[n]:u}}o&&(delete e.allOf,xr(e,o))}function Oe(e,r){let i=e.seen.get(r);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=u=>{let s=e.seen.get(u);if(s.ref===null)return;let c=s.def??s.schema,l={...c},d=s.ref;if(s.ref=null,d){o(d);let m=e.seen.get(d),v=m.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(v)):xr(c,v),xr(c,l),u._zod.parent===d)for(let k in c)k==="$ref"||k==="allOf"||k in l||delete c[k];if(v.$ref&&m.def)for(let k in c)k==="$ref"||k==="allOf"||k in m.def&&JSON.stringify(c[k])===JSON.stringify(m.def[k])&&delete c[k]}let f=u._zod.parent;if(f&&f!==d){o(f);let m=e.seen.get(f);if(m?.schema.$ref&&(c.$ref=m.schema.$ref,m.def))for(let v in c)v==="$ref"||v==="allOf"||v in m.def&&JSON.stringify(c[v])===JSON.stringify(m.def[v])&&delete c[v]}e.override({zodSchema:u,jsonSchema:c,path:s.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let u of[...e.seen.entries()].reverse())o(u[0]);if(e.target!=="openapi-3.0")for(let u of e.seen.entries())jf(u[1].def??u[1].schema);for(let u of e.deferred)u();if(e.intersections.length){let u=new Map;for(let s of e.seen.values())for(let c of[s.schema,s.def]){let l=c?.allOf;if(!Array.isArray(l))continue;let d=u.get(l);d?d.push(c):u.set(l,[c])}for(let s of e.intersections)for(let c of u.get(s)??[])Oh(c)}}let t={};if(e.target==="draft-2020-12"?t.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?t.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?t.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let u=e.external.registry.get(r)?.id;if(!u)throw new Error("Schema is missing an `id` property");t.$id=e.external.uri(u)}xr(t,i.defId?i.schema:i.def??i.schema);let n=e.metadataRegistry.get(r)?.id;n!==void 0&&t.id===n&&delete t.id;let a=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let u of e.seen.entries()){let s=u[1];s.def&&s.defId&&(s.def.id===s.defId&&delete s.def.id,K(a,s.defId,s.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?t.$defs=a:t.definitions=a);try{let u=JSON.parse(JSON.stringify(t));return Object.defineProperty(u,"~standard",{value:{...r["~standard"],jsonSchema:{input:Dt(r,"input",e.processors),output:Dt(r,"output",e.processors)}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}function Q(e,r){let i=r??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return Q(o.element,i);if(o.type==="set")return Q(o.valueType,i);if(o.type==="lazy")return Q(o.getter(),i);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault"||o.type==="catch")return Q(o.innerType,i);if(o.type==="intersection")return Q(o.left,i)||Q(o.right,i);if(o.type==="record"||o.type==="map")return Q(o.keyType,i)||Q(o.valueType,i);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Q(o.in,i)||Q(o.out,i);if(o.type==="object"){for(let t in o.shape)if(Q(o.shape[t],i))return!0;return!1}if(o.type==="union"){for(let t of o.options)if(Q(t,i))return!0;return!1}if(o.type==="tuple"){for(let t of o.items)if(Q(t,i))return!0;return!!(o.rest&&Q(o.rest,i))}return!1}var kc=(e,r={})=>i=>{let o=De({...i,processors:r});return E(e,o),je(o,e),Oe(o,e)},Dt=(e,r,i={})=>o=>{let{libraryOptions:t,target:n}=o??{},a=De({...t??{},target:n,io:r,processors:i});return E(e,a),je(a,e),Oe(a,e)};var jt=(e,r,i)=>{(e[r]===void 0||i>e[r])&&(e[r]=i)},Ot=(e,r,i)=>{(e[r]===void 0||i<e[r])&&(e[r]=i)},Nf=(e,r)=>{jt(e,"minimum",r),Ot(e,"maximum",r)},Zf=(e,r)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(r)||e.multipleOf.push(r)},Ef=(e,r)=>{e.patterns??(e.patterns=new Set),e.patterns.add(r)},Cf=(e,r)=>{e.mime=e.mime?e.mime.filter(i=>r.includes(i)):[...r]},Lf=(e,r)=>{e.format=r,r.includes("int")&&(e.isInt=!0)},Uf=(e,r)=>jt(e,"minimum",r.minimum),Af=(e,r)=>Ot(e,"maximum",r.maximum),Tf=e=>(r,i)=>{Lf(r,i.format);let[o,t]=e[i.format];jt(r,"minimum",o),Ot(r,"maximum",t)},Nh={greater_than:(e,r)=>jt(e,r.inclusive?"minimum":"exclusiveMinimum",r.value),less_than:(e,r)=>Ot(e,r.inclusive?"maximum":"exclusiveMaximum",r.value),multiple_of:(e,r)=>Zf(e,r.value),number_format:Tf(Bt),bigint_format:Tf(Kt),min_length:Uf,max_length:Af,length_equals:(e,r)=>Nf(e,r.length),min_size:Uf,max_size:Af,size_equals:(e,r)=>Nf(e,r.size),string_format:(e,r)=>{Lf(e,r.format),r.pattern&&Ef(e,r.pattern),(r.format==="base64"||r.format==="base64url")&&(e.contentEncoding=r.format),(r.local||r.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,r)=>Cf(e,r.mime)};function J(e){let r={},i=e._zod.def,o=e._zod.traits.has("$ZodCheck")?[e,...i.checks??[]]:i.checks??[];for(let n of o)Nh[n._zod.def.check]?.(r,n._zod.def);let t=e._zod.bag;t.minimum!==void 0&&jt(r,"minimum",t.minimum),t.exclusiveMinimum!==void 0&&jt(r,"exclusiveMinimum",t.exclusiveMinimum),t.maximum!==void 0&&Ot(r,"maximum",t.maximum),t.exclusiveMaximum!==void 0&&Ot(r,"exclusiveMaximum",t.exclusiveMaximum),t.multipleOf!==void 0&&Zf(r,t.multipleOf),t.format!==void 0&&(r.format??(r.format=t.format),t.format.includes("int")&&(r.isInt=!0)),t.mime&&Cf(r,t.mime);for(let n of t.patterns??[])Ef(r,n);return r}var Uh={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Ah=new Map([[$n,jo],[cr,Oo]]),Vf=e=>Ah.get(e)??e,wc=(e,r,i,o)=>{let t=i;t.type="string";let{minimum:n,maximum:a,format:u,patterns:s,contentEncoding:c,laxFormat:l}=J(e);if(typeof n=="number"&&(t.minLength=n),typeof a=="number"&&(t.maxLength=a),u&&(t.format=Uh[u]??u,t.format===""&&delete t.format,(u==="time"||l)&&delete t.format),c&&(t.contentEncoding=c),s&&s.size>0){let d=[...s].map(Vf);d.length===1?t.pattern=d[0].source:d.length>1&&(t.allOf=[...d.map(f=>({...r.target==="draft-07"||r.target==="draft-04"||r.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},zc=(e,r,i,o)=>{let t=i,{minimum:n,maximum:a,multipleOf:u,exclusiveMaximum:s,exclusiveMinimum:c,isInt:l}=J(e);t.type=l?"integer":"number";let d=typeof c=="number"&&c>=(n??Number.NEGATIVE_INFINITY),f=typeof s=="number"&&s<=(a??Number.POSITIVE_INFINITY),m=r.target==="draft-04"||r.target==="openapi-3.0";if(d?m?(t.minimum=c,t.exclusiveMinimum=!0):t.exclusiveMinimum=c:typeof n=="number"&&(t.minimum=n),f?m?(t.maximum=s,t.exclusiveMaximum=!0):t.exclusiveMaximum=s:typeof a=="number"&&(t.maximum=a),u){let v=new Set;for(let z of u)Number.isFinite(z)&&z!==0?v.add(Math.abs(z)):M(e,r,t,o,`A multipleOf divisor of ${z} cannot be represented in JSON Schema`);let[_,...k]=v;_!==void 0&&(t.multipleOf=_),k.length&&(t.allOf=[...t.allOf??[],...k.map(z=>({multipleOf:z}))])}},Sc=(e,r,i,o)=>{i.type="boolean"},Pc=(e,r,i,o)=>{M(e,r,i,o,"BigInt cannot be represented in JSON Schema")},Dc=(e,r,i,o)=>{M(e,r,i,o,"Symbols cannot be represented in JSON Schema")},jc=(e,r,i,o)=>{r.target==="openapi-3.0"?(i.type="string",i.nullable=!0,i.enum=[null]):i.type="null"},Oc=(e,r,i,o)=>{M(e,r,i,o,"Undefined cannot be represented in JSON Schema")},Nc=(e,r,i,o)=>{M(e,r,i,o,"Void cannot be represented in JSON Schema")},Uc=(e,r,i,o)=>{i.not={}},Ac=(e,r,i,o)=>{},Tc=(e,r,i,o)=>{},Zc=(e,r,i,o)=>{M(e,r,i,o,"Date cannot be represented in JSON Schema")},Ec=(e,r,i,o)=>{let t=e._zod.def,n=rt(t.entries);if(n.length===0){i.not={};return}n.every(a=>typeof a=="number")&&(i.type="number"),n.every(a=>typeof a=="string")&&(i.type="string"),i.enum=n},Cc=(e,r,i,o)=>{let t=e._zod.def;if(t.values.length===0){i.not={};return}let n=[];for(let a of t.values)if(a===void 0){if(M(e,r,i,o,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof a=="bigint"){if(M(e,r,i,o,"BigInt literals cannot be represented in JSON Schema"))return;n.push(Number(a))}else n.push(a);if(n.length!==0)if(n.length===1){let a=n[0];i.type=a===null?"null":typeof a,r.target==="draft-04"||r.target==="openapi-3.0"?i.enum=[a]:i.const=a}else n.every(a=>typeof a=="number")&&(i.type="number"),n.every(a=>typeof a=="string")&&(i.type="string"),n.every(a=>typeof a=="boolean")&&(i.type="boolean"),n.every(a=>a===null)&&(i.type="null"),i.enum=n},Lc=(e,r,i,o)=>{M(e,r,i,o,"NaN cannot be represented in JSON Schema")},Vc=(e,r,i,o)=>{let t=i,n=e._zod.pattern;if(!n)throw new Error("Pattern not found in template literal");t.type="string",t.pattern=n.source},Rc=(e,r,i,o)=>{let t=i;t.type="string",t.format="binary",t.contentEncoding="binary";let{minimum:n,maximum:a,mime:u}=J(e);n!==void 0&&(t.minLength=n),a!==void 0&&(t.maxLength=a),u&&(u.length===0?t.not={}:u.length===1?t.contentMediaType=u[0]:t.anyOf=u.map(s=>({contentMediaType:s})))},Fc=(e,r,i,o)=>{i.type="boolean"},Mc=(e,r,i,o)=>{M(e,r,i,o,"Custom types cannot be represented in JSON Schema")},Jc=(e,r,i,o)=>{M(e,r,i,o,"Function types cannot be represented in JSON Schema")},Bc=(e,r,i,o)=>{M(e,r,i,o,"Transforms cannot be represented in JSON Schema")},Kc=(e,r,i,o)=>{M(e,r,i,o,"Map cannot be represented in JSON Schema")},Gc=(e,r,i,o)=>{M(e,r,i,o,"Set cannot be represented in JSON Schema")},Wc=(e,r,i,o)=>{let t=i,n=e._zod.def,{minimum:a,maximum:u}=J(e);typeof a=="number"&&(t.minItems=a),typeof u=="number"&&(t.maxItems=u),t.type="array",t.items=E(n.element,r,{...o,path:[...o.path,"items"]})};function Ir(e){let r=e._zod.def;return r.type==="pipe"&&r.in._zod.traits.has("$ZodTransform")?Ir(r.out):r.type==="catch"?Ir(r.innerType):e._zod.optin}var Xc=(e,r,i,o)=>{let t=i,n=e._zod.def,a=n.shape;if(Object.getOwnPropertySymbols(a).length&&M(e,r,t,o,"Symbol keys cannot be represented in JSON Schema"))return;t.type="object",t.properties={};for(let c in a)K(t.properties,c,E(a[c],r,{...o,path:[...o.path,"properties",c]}));let s=[];for(let c of Object.keys(a)){let l=n.shape[c];(r.io==="input"?Ir(l)===void 0:l._zod.optout===void 0)&&s.push(c)}s.length>0&&(t.required=s),n.catchall?._zod.def.type==="never"?t.additionalProperties=!1:n.catchall?n.catchall&&(t.additionalProperties=E(n.catchall,r,{...o,path:[...o.path,"additionalProperties"]})):r.io==="output"&&(t.additionalProperties=!1)},pi=(e,r,i,o)=>{let t=e._zod.def,n=t.inclusive===!1,a=t.options.map((u,s)=>E(u,r,{...o,path:[...o.path,n?"oneOf":"anyOf",s]}));n?i.oneOf=a:i.anyOf=a},qc=(e,r,i,o)=>{let t=e._zod.def,n=E(t.left,r,{...o,path:[...o.path,"allOf",0]}),a=E(t.right,r,{...o,path:[...o.path,"allOf",1]}),u=c=>"allOf"in c&&Object.keys(c).length===1,s=[...u(n)?n.allOf:[n],...u(a)?a.allOf:[a]];i.allOf=s,r.intersections.push(s)},Yc=(e,r,i,o)=>{let t=i,n=e._zod.def;t.type="array";let a=r.target==="draft-2020-12"?"prefixItems":"items",u=r.target==="draft-2020-12"||r.target==="openapi-3.0"?"items":"additionalItems",s=n.items.map((_,k)=>E(_,r,{...o,path:[...o.path,a,k]})),c=n.rest?E(n.rest,r,{...o,path:[...o.path,u,...r.target==="openapi-3.0"?[n.items.length]:[]]}):null,l=n.items.length;for(;l>0;){let _=n.items[l-1];if(!(r.io==="input"?Ir(_)!==void 0:_._zod.optout==="optional"))break;l--}let d=n.items.length,f=!n.rest;r.target==="draft-2020-12"?(t.prefixItems=s,f?t.items=!1:c&&(t.items=c),l>0&&(t.minItems=l),f&&(t.maxItems=d)):r.target==="openapi-3.0"?(t.items={anyOf:s},c&&t.items.anyOf.push(c),l>0&&(t.minItems=l),f&&(t.maxItems=d)):(t.items=s,f?t.additionalItems=!1:c&&(t.additionalItems=c),l>0&&(t.minItems=l),f&&(t.maxItems=d));let{minimum:m,maximum:v}=J(e);typeof m=="number"&&(t.minItems=m),typeof v=="number"&&(t.maxItems=v)};function xc(e,r,i){if(r.$ref){if(i.has(r))return r;i.add(r);let v=e.get(r)?.def;if(!v)return r;let _=xc(e,v,i);return _===v?r:_}for(let v of["anyOf","oneOf"]){let _=r[v];if(!Array.isArray(_))continue;let k=_.map(z=>xc(e,z,i));k.some((z,I)=>z!==_[I])&&(r={...r,[v]:k})}let o=Array.isArray(r.type)?r.type:[r.type],t=!o.includes("string")&&o.some(v=>v==="number"||v==="integer"),n=r.enum??(r.const!==void 0?[r.const]:void 0);if(!t&&!n?.some(v=>typeof v=="number"))return r;let{minimum:a,maximum:u,exclusiveMinimum:s,exclusiveMaximum:c,multipleOf:l,format:d,id:f,...m}=r;return m.enum?m.enum=m.enum.map(v=>typeof v=="number"?String(v):v):typeof m.const=="number"&&(m.const=String(m.const)),t&&(m.type="string",n||(m.pattern=(o.includes("number")?be:tr).source)),m}var Ic=new WeakMap;function Th(e){let r=new Map;for(let o of e.seen.values())o.def&&!r.has(o.schema)&&r.set(o.schema,o);let i=new Map;for(let o of Ic.get(e)??[]){let t=e.seen.get(o),n=(t?.def??t?.schema)?.propertyNames;if(!n||n===!0||i.has(n))continue;let a=xc(r,n,new Set);a!==n&&i.set(n,a)}if(i.size)for(let o of e.seen.values())for(let t of[o.schema,o.def]){let n=t&&i.get(t.propertyNames);n&&(t.propertyNames=n)}}var Hc=(e,r,i,o)=>{let t=i,n=e._zod.def;t.type="object";let a=n.keyType,u=J(a).patterns;if(n.mode==="loose"&&u&&u.size>0){let l=E(n.valueType,r,{...o,path:[...o.path,"patternProperties","*"]});t.patternProperties={};for(let d of u)K(t.patternProperties,Vf(d).source,l)}else{if(r.target==="draft-07"||r.target==="draft-2020-12"){t.propertyNames=E(n.keyType,r,{...o,path:[...o.path,"propertyNames"]});let l=Ic.get(r);l||(l=[],Ic.set(r,l),r.deferred.push(()=>Th(r))),l.push(e)}t.additionalProperties=E(n.valueType,r,{...o,path:[...o.path,"additionalProperties"]})}let s=a._zod.values,c=r.io==="input"&&Ir(n.valueType)!==void 0;if(s&&!n.partial&&!c){let l=[...s].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(t.required=l.map(String))}},Qc=(e,r,i,o)=>{let t=e._zod.def,n=E(t.innerType,r,o),a=r.seen.get(e);r.target==="openapi-3.0"?(a.ref=t.innerType,i.nullable=!0):i.anyOf=[n,{type:"null"}]},es=(e,r,i,o)=>{let t=e._zod.def;E(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType},ts=Symbol();function Rf(e,r,i,o,t){let n=!1,a=JSON.stringify(e,(u,s)=>typeof s!="bigint"?s:(n=!0,null));return n?(M(r,i,o,t,"BigInt defaults cannot be represented in JSON Schema"),ts):JSON.parse(a)}var rs=(e,r,i,o)=>{let t=e._zod.def;E(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType;let a=Rf(t.defaultValue,e,r,i,o);a!==ts&&(i.default=a)},ns=(e,r,i,o)=>{let t=e._zod.def;E(t.innerType,r,o);let n=r.seen.get(e);if(n.ref=t.innerType,r.io!=="input")return;let a=Rf(t.defaultValue,e,r,i,o);a!==ts&&(i._prefault=a)},is=(e,r,i,o)=>{let t=e._zod.def;E(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType;let a;try{a=t.catchValue(void 0)}catch{M(e,r,i,o,"Dynamic catch values are not supported in JSON Schema");return}i.default=a},os=(e,r,i,o)=>{let t=e._zod.def,n=t.in._zod.traits.has("$ZodTransform"),a=r.io==="input"?n?t.out:t.in:t.out;E(a,r,o);let u=r.seen.get(e);u.ref=a},as=(e,r,i,o)=>{let t=e._zod.def;E(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType,i.readOnly=!0},us=(e,r,i,o)=>{let t=e._zod.def;E(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType},gi=(e,r,i,o)=>{let t=e._zod.def;E(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType},cs=(e,r,i,o)=>{let t=e._zod.innerType;E(t,r,o);let n=r.seen.get(e);n.ref=t},mi={string:wc,number:zc,boolean:Sc,bigint:Pc,symbol:Dc,null:jc,undefined:Oc,void:Nc,never:Uc,any:Ac,unknown:Tc,date:Zc,enum:Ec,literal:Cc,nan:Lc,template_literal:Vc,file:Rc,success:Fc,custom:Mc,function:Jc,transform:Bc,map:Kc,set:Gc,array:Wc,object:Xc,union:pi,intersection:qc,tuple:Yc,record:Hc,nullable:Qc,nonoptional:es,default:rs,prefault:ns,catch:is,pipe:os,readonly:as,promise:us,optional:gi,lazy:cs};function vi(e,r){if("_idmap"in e){let o=e,t=De({...r,processors:mi}),n={};for(let s of o._idmap.entries()){let[c,l]=s;E(l,t)}let a={},u={registry:o,uri:r?.uri,defs:n};t.external=u;for(let s of o._idmap.entries()){let[c,l]=s;je(t,l),K(a,c,Oe(t,l))}if(Object.keys(n).length>0){let s=t.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[s]:n}}return{schemas:a}}let i=De({...r,processors:mi});return E(e,i),je(i,e),Oe(i,e)}var $i=class{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(r){this.ctx.counter=r}get seen(){return this.ctx.seen}constructor(r){let i=r?.target??"draft-2020-12";i==="draft-4"&&(i="draft-04"),i==="draft-7"&&(i="draft-07"),this.ctx=De({processors:mi,target:i,...r?.metadata&&{metadata:r.metadata},...r?.unrepresentable&&{unrepresentable:r.unrepresentable},...r?.override&&{override:r.override},...r?.io&&{io:r.io}})}process(r,i={path:[],schemaPath:[]}){return E(r,this.ctx,i)}emit(r,i){i&&(i.cycles&&(this.ctx.cycles=i.cycles),i.reused&&(this.ctx.reused=i.reused),i.external&&(this.ctx.external=i.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,je(this.ctx,r);let o=Oe(this.ctx,r),{"~standard":t,...n}=o;return n}};var Ff={};var Mf=new WeakSet([Object.prototype,Error.prototype]);function hi(e,r,i){Object.defineProperty(e,r,{configurable:!0,enumerable:!1,get(){let o=i(this);return Object.defineProperty(this,r,{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,r,{value:o,configurable:!0,writable:!0})}})}var Jf=(e,r)=>{so.init(e,r),e.name="ZodError";let i=Object.getPrototypeOf(e);Mf.has(i)||(Mf.add(i),hi(i,"format",o=>t=>Yt(o,t)),hi(i,"flatten",o=>t=>qt(o,t)),hi(i,"addIssue",o=>t=>{o.issues.push(t),o.message=JSON.stringify(o.issues,nt,2)}),hi(i,"addIssues",o=>t=>{o.issues.push(...t),o.message=JSON.stringify(o.issues,nt,2)}),Object.defineProperty(i,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},Eh=p("ZodError",Jf),oe=p("ZodError",Jf,void 0,{Parent:Error});var ss=ut(oe),ls=ct(oe),ds=st(oe),fs=lt(oe),ms=Gr(oe),ps=Wr(oe),gs=Xr(oe),vs=qr(oe),$s=Yr(oe),hs=Hr(oe),ys=Qr(oe),_s=en(oe);var yp={};he(yp,{$brand:()=>ao,$input:()=>Nu,$output:()=>Ou,INVALID:()=>H,NEVER:()=>oo,TimePrecision:()=>Mu,ZodAny:()=>js,ZodArray:()=>As,ZodBase64:()=>Zi,ZodBase64URL:()=>Ei,ZodBigInt:()=>Et,ZodBigIntFormat:()=>Vi,ZodBoolean:()=>Zt,ZodCIDRv4:()=>Ai,ZodCIDRv6:()=>Ti,ZodCUID:()=>Si,ZodCUID2:()=>Pi,ZodCatch:()=>tl,ZodCodec:()=>Ar,ZodCompileAsyncError:()=>fe,ZodCompileUnsupportedError:()=>N,ZodCreditCard:()=>ks,ZodCustom:()=>Tr,ZodCustomStringFormat:()=>Qe,ZodDate:()=>Pr,ZodDefault:()=>Xs,ZodDiscriminatedUnion:()=>Zs,ZodE164:()=>Ci,ZodEmail:()=>xi,ZodEmoji:()=>wi,ZodEnum:()=>Ut,ZodError:()=>Eh,ZodExactOptional:()=>Ji,ZodFile:()=>Bs,ZodFirstPartyTypeKind:()=>gl,ZodFunction:()=>dl,ZodGUID:()=>Ii,ZodIBAN:()=>xs,ZodIPv4:()=>Ni,ZodIPv6:()=>Ui,ZodISODate:()=>Ue,ZodISODateTime:()=>Ne,ZodISODuration:()=>Te,ZodISOTime:()=>Ae,ZodInstanceOf:()=>pl,ZodIntersection:()=>Es,ZodIssueCode:()=>Vh,ZodJWT:()=>Li,ZodKSUID:()=>Oi,ZodLazy:()=>cl,ZodLiteral:()=>Js,ZodMAC:()=>bs,ZodMap:()=>Fs,ZodNaN:()=>nl,ZodNanoID:()=>zi,ZodNever:()=>Ns,ZodNonOptional:()=>Bi,ZodNull:()=>Ps,ZodNullable:()=>Ws,ZodNumber:()=>Tt,ZodNumberFormat:()=>et,ZodObject:()=>jr,ZodOptional:()=>Nr,ZodPipe:()=>Ur,ZodPrefault:()=>Ys,ZodPreprocess:()=>il,ZodPromise:()=>ll,ZodReadonly:()=>ol,ZodRealError:()=>oe,ZodRecord:()=>Nt,ZodSet:()=>Ms,ZodString:()=>At,ZodStringFormat:()=>C,ZodSuccess:()=>el,ZodSymbol:()=>zs,ZodTemplateLiteral:()=>ul,ZodTransform:()=>Ks,ZodTuple:()=>Ls,ZodType:()=>j,ZodULID:()=>Di,ZodURL:()=>Sr,ZodUUID:()=>$e,ZodUndefined:()=>Ss,ZodUnion:()=>Or,ZodUnknown:()=>Os,ZodVoid:()=>Us,ZodXID:()=>ji,ZodXor:()=>Ts,_ZodString:()=>ki,_default:()=>qs,_function:()=>ep,any:()=>Om,array:()=>Dr,base64:()=>dm,base64url:()=>fm,bigint:()=>zm,boolean:()=>ws,catch:()=>rl,check:()=>tp,cidrv4:()=>sm,cidrv6:()=>lm,clone:()=>T,codec:()=>qm,coerce:()=>$l,compile:()=>Zu,config:()=>F,core:()=>xe,creditCard:()=>pm,cuid:()=>tm,cuid2:()=>rm,currencyCode:()=>_m,custom:()=>rp,date:()=>Um,decode:()=>ps,decodeAsync:()=>vs,deepPartial:()=>gp,describe:()=>np,discriminatedUnion:()=>Lm,e164:()=>mm,email:()=>Bf,emoji:()=>Qf,encode:()=>ms,encodeAsync:()=>gs,endsWith:()=>bt,enum:()=>Fi,exactOptional:()=>Gs,file:()=>Km,flattenError:()=>qt,float32:()=>km,float64:()=>xm,formatError:()=>Yt,fromJSONSchema:()=>mp,function:()=>ep,getDiscriminatedOption:()=>ou,getErrorMap:()=>Fh,globalRegistry:()=>G,gt:()=>ge,gte:()=>ue,guid:()=>Kf,hash:()=>bm,hex:()=>ym,hostname:()=>hm,httpUrl:()=>Hf,iban:()=>gm,includes:()=>yt,input:()=>$p,instanceof:()=>op,int:()=>_i,int32:()=>Im,int64:()=>Sm,intersection:()=>Cs,invertCodec:()=>Ym,ipv4:()=>am,ipv6:()=>cm,iso:()=>Zr,json:()=>up,jwt:()=>vm,keyof:()=>Am,ksuid:()=>om,lazy:()=>sl,length:()=>We,literal:()=>Bm,locales:()=>$r,looseObject:()=>Em,looseRecord:()=>Rm,lowercase:()=>$t,lt:()=>pe,lte:()=>ae,mac:()=>um,map:()=>Fm,maxLength:()=>Ge,maxSize:()=>Pe,memoizer:()=>gr,meta:()=>ip,mime:()=>xt,minLength:()=>ke,minSize:()=>ve,multipleOf:()=>Se,nan:()=>Xm,nanoid:()=>em,nativeEnum:()=>Jm,negative:()=>si,never:()=>Ri,nonnegative:()=>di,nonoptional:()=>Qs,nonpositive:()=>li,normalize:()=>It,null:()=>Ds,nullable:()=>zr,nullish:()=>Gm,number:()=>Is,object:()=>Tm,optional:()=>Ye,output:()=>hp,overwrite:()=>me,parse:()=>ss,parseAsync:()=>ls,partialRecord:()=>Vm,pipe:()=>bi,positive:()=>ci,prefault:()=>Hs,preprocess:()=>cp,prettifyError:()=>fo,promise:()=>Qm,properties:()=>kt,property:()=>fi,readonly:()=>al,record:()=>Rs,refine:()=>fl,regex:()=>vt,regexes:()=>le,registry:()=>En,safeDecode:()=>hs,safeDecodeAsync:()=>_s,safeEncode:()=>$s,safeEncodeAsync:()=>ys,safeParse:()=>ds,safeParseAsync:()=>fs,set:()=>Mm,setErrorMap:()=>Rh,size:()=>Ke,slugify:()=>Pt,startsWith:()=>_t,strictObject:()=>Zm,string:()=>wr,stringFormat:()=>$m,stringbool:()=>ap,success:()=>Wm,superRefine:()=>ml,symbol:()=>Dm,templateLiteral:()=>Hm,toJSONSchema:()=>vi,toLowerCase:()=>zt,toUpperCase:()=>St,toZod:()=>Rt,transform:()=>Mi,treeifyError:()=>lo,trim:()=>wt,tuple:()=>Vs,uint32:()=>wm,uint64:()=>Pm,ulid:()=>nm,undefined:()=>jm,union:()=>Ct,unknown:()=>qe,uppercase:()=>ht,url:()=>Yf,util:()=>$,uuid:()=>Gf,uuidv4:()=>Wf,uuidv6:()=>Xf,uuidv7:()=>qf,validate:()=>Ht,validateAsync:()=>Qt,void:()=>Nm,withParser:()=>Cn,xid:()=>im,xor:()=>Cm});var Lt={};he(Lt,{ZodAny:()=>js,ZodArray:()=>As,ZodBase64:()=>Zi,ZodBase64URL:()=>Ei,ZodBigInt:()=>Et,ZodBigIntFormat:()=>Vi,ZodBoolean:()=>Zt,ZodCIDRv4:()=>Ai,ZodCIDRv6:()=>Ti,ZodCUID:()=>Si,ZodCUID2:()=>Pi,ZodCatch:()=>tl,ZodCodec:()=>Ar,ZodCreditCard:()=>ks,ZodCustom:()=>Tr,ZodCustomStringFormat:()=>Qe,ZodDate:()=>Pr,ZodDefault:()=>Xs,ZodDiscriminatedUnion:()=>Zs,ZodE164:()=>Ci,ZodEmail:()=>xi,ZodEmoji:()=>wi,ZodEnum:()=>Ut,ZodExactOptional:()=>Ji,ZodFile:()=>Bs,ZodFunction:()=>dl,ZodGUID:()=>Ii,ZodIBAN:()=>xs,ZodIPv4:()=>Ni,ZodIPv6:()=>Ui,ZodISODate:()=>Ue,ZodISODateTime:()=>Ne,ZodISODuration:()=>Te,ZodISOTime:()=>Ae,ZodInstanceOf:()=>pl,ZodIntersection:()=>Es,ZodJWT:()=>Li,ZodKSUID:()=>Oi,ZodLazy:()=>cl,ZodLiteral:()=>Js,ZodMAC:()=>bs,ZodMap:()=>Fs,ZodNaN:()=>nl,ZodNanoID:()=>zi,ZodNever:()=>Ns,ZodNonOptional:()=>Bi,ZodNull:()=>Ps,ZodNullable:()=>Ws,ZodNumber:()=>Tt,ZodNumberFormat:()=>et,ZodObject:()=>jr,ZodOptional:()=>Nr,ZodPipe:()=>Ur,ZodPrefault:()=>Ys,ZodPreprocess:()=>il,ZodPromise:()=>ll,ZodReadonly:()=>ol,ZodRecord:()=>Nt,ZodSet:()=>Ms,ZodString:()=>At,ZodStringFormat:()=>C,ZodSuccess:()=>el,ZodSymbol:()=>zs,ZodTemplateLiteral:()=>ul,ZodTransform:()=>Ks,ZodTuple:()=>Ls,ZodType:()=>j,ZodULID:()=>Di,ZodURL:()=>Sr,ZodUUID:()=>$e,ZodUndefined:()=>Ss,ZodUnion:()=>Or,ZodUnknown:()=>Os,ZodVoid:()=>Us,ZodXID:()=>ji,ZodXor:()=>Ts,_ZodString:()=>ki,_default:()=>qs,_function:()=>ep,any:()=>Om,array:()=>Dr,base64:()=>dm,base64url:()=>fm,bigint:()=>zm,boolean:()=>ws,catch:()=>rl,check:()=>tp,cidrv4:()=>sm,cidrv6:()=>lm,codec:()=>qm,creditCard:()=>pm,cuid:()=>tm,cuid2:()=>rm,currencyCode:()=>_m,custom:()=>rp,date:()=>Um,describe:()=>np,discriminatedUnion:()=>Lm,e164:()=>mm,email:()=>Bf,emoji:()=>Qf,enum:()=>Fi,exactOptional:()=>Gs,file:()=>Km,float32:()=>km,float64:()=>xm,function:()=>ep,guid:()=>Kf,hash:()=>bm,hex:()=>ym,hostname:()=>hm,httpUrl:()=>Hf,iban:()=>gm,instanceof:()=>op,int:()=>_i,int32:()=>Im,int64:()=>Sm,intersection:()=>Cs,invertCodec:()=>Ym,ipv4:()=>am,ipv6:()=>cm,json:()=>up,jwt:()=>vm,keyof:()=>Am,ksuid:()=>om,lazy:()=>sl,literal:()=>Bm,looseObject:()=>Em,looseRecord:()=>Rm,mac:()=>um,map:()=>Fm,meta:()=>ip,nan:()=>Xm,nanoid:()=>em,nativeEnum:()=>Jm,never:()=>Ri,nonoptional:()=>Qs,null:()=>Ds,nullable:()=>zr,nullish:()=>Gm,number:()=>Is,object:()=>Tm,optional:()=>Ye,partialRecord:()=>Vm,pipe:()=>bi,prefault:()=>Hs,preprocess:()=>cp,promise:()=>Qm,readonly:()=>al,record:()=>Rs,refine:()=>fl,set:()=>Mm,strictObject:()=>Zm,string:()=>wr,stringFormat:()=>$m,stringbool:()=>ap,success:()=>Wm,superRefine:()=>ml,symbol:()=>Dm,templateLiteral:()=>Hm,transform:()=>Mi,tuple:()=>Vs,uint32:()=>wm,uint64:()=>Pm,ulid:()=>nm,undefined:()=>jm,union:()=>Ct,unknown:()=>qe,url:()=>Yf,uuid:()=>Gf,uuidv4:()=>Wf,uuidv6:()=>Xf,uuidv7:()=>qf,void:()=>Nm,xid:()=>im,xor:()=>Cm});var yi={};he(yi,{endsWith:()=>bt,gt:()=>ge,gte:()=>ue,includes:()=>yt,length:()=>We,lowercase:()=>$t,lt:()=>pe,lte:()=>ae,maxLength:()=>Ge,maxSize:()=>Pe,mime:()=>xt,minLength:()=>ke,minSize:()=>ve,multipleOf:()=>Se,negative:()=>si,nonnegative:()=>di,nonpositive:()=>li,normalize:()=>It,overwrite:()=>me,positive:()=>ci,properties:()=>kt,property:()=>fi,regex:()=>vt,size:()=>Ke,slugify:()=>Pt,startsWith:()=>_t,toLowerCase:()=>zt,toUpperCase:()=>St,trim:()=>wt,uppercase:()=>ht});function Lh(){B.localeError||F(Un())}function He(){B.memoizer||F({memoizer:gr()})}var j=p("ZodType",(e,r)=>(Lh(),P.init(e,r),e.def=r,e.type=r.type,e),{check(...e){let r=this.def;return this.clone($.mergeDefs(r,{checks:[...r.checks??[],...e.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,r){return T(this,e,r)},brand(){return this},register(e,r){return e.add(this,r),this},refine(e,r){return this.check(fl(e,r))},superRefine(e,r){return this.check(ml(e,r))},overwrite(e){return this.check(me(e))},optional(){return Ye(this)},exactOptional(){return Gs(this)},nullable(){return zr(this)},nullish(){return Ye(zr(this))},nonoptional(e){return Qs(this,e)},array(){return Dr(this)},or(e){return Ct([this,e])},and(e){return Cs(this,e)},transform(e){return bi(this,Mi(e))},default(e){return qs(this,e)},prefault(e){return Hs(this,e)},catch(e){return rl(this,e)},pipe(e){return bi(this,e)},readonly(){return al(this)},describe(e){let r=this.clone();return G.add(r,{description:e}),r},meta(...e){if(e.length===0)return G.get(this);let r=this.clone();return G.add(r,e[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...r){return r.length===0?e(this):e(this,...r)},get"~standard"(){return $.hide(this,"~standard",{...fn(this),jsonSchema:{input:Dt(this,"input"),output:Dt(this,"output")}})},set"~standard"(e){$.own(this,"~standard",e)},parse:function e(r,i){return ss(this,r,i,{callee:e})},parseAsync:async function e(r,i){return await ls(this,r,i,{callee:e})},safeParse(e,r){return ds(this,e,r)},async safeParseAsync(e,r){return fs(this,e,r)},get spa(){return this?.safeParseAsync},set spa(e){$.own(this,"spa",e)},validate(e,r){return Ht(this,e,r)},validateAsync(e,r){return Qt(this,e,r)},encode:function e(r,i){return ms(this,r,i,{callee:e})},decode:function e(r,i){return ps(this,r,i,{callee:e})},encodeAsync:async function e(r,i){return await gs(this,r,i,{callee:e})},decodeAsync:async function e(r,i){return await vs(this,r,i,{callee:e})},safeEncode(e,r){return $s(this,e,r)},safeDecode(e,r){return hs(this,e,r)},async safeEncodeAsync(e,r){return ys(this,e,r)},async safeDecodeAsync(e,r){return _s(this,e,r)},toJSONSchema(e){return kc(this,{})(e)},get description(){return G.get(this)?.description},get _def(){return this._zod.def}}),ki=p("_ZodString",(e,r)=>{Re.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>wc(e,i,o,t)},$.derived({format:e=>J(e).format??null,minLength:e=>J(e).minimum??null,maxLength:e=>J(e).maximum??null},{regex(...e){return this.check(vt(...e))},includes(...e){return this.check(yt(...e))},startsWith(...e){return this.check(_t(...e))},endsWith(...e){return this.check(bt(...e))},min(...e){return this.check(ke(...e))},max(...e){return this.check(Ge(...e))},length(...e){return this.check(We(...e))},nonempty(...e){return this.check(ke(1,...e))},lowercase(e){return this.check($t(e))},uppercase(e){return this.check(ht(e))},trim(){return this.check(wt())},normalize(...e){return this.check(It(...e))},toLowerCase(){return this.check(zt())},toUpperCase(){return this.check(St())},slugify(){return this.check(Pt())}})),At=p("ZodString",(e,r)=>{Re.init(e,r),ki.init(e,r)},{email(e){return this.check(Rn(xi,e))},url(e){return this.check(hr(Sr,e))},jwt(e){return this.check(ui(Li,e))},emoji(e){return this.check(Gn(wi,e))},guid(e){return this.check(Fn(Ii,e))},uuid(e){return this.check(Mn($e,e))},uuidv4(e){return this.check(Jn($e,e))},uuidv6(e){return this.check(Bn($e,e))},uuidv7(e){return this.check(Kn($e,e))},nanoid(e){return this.check(Wn(zi,e))},cuid(e){return this.check(Xn(Si,e))},cuid2(e){return this.check(qn(Pi,e))},ulid(e){return this.check(Yn(Di,e))},base64(e){return this.check(ii(Zi,e))},base64url(e){return this.check(oi(Ei,e))},xid(e){return this.check(Hn(ji,e))},ksuid(e){return this.check(Qn(Oi,e))},ipv4(e){return this.check(ei(Ni,e))},ipv6(e){return this.check(ti(Ui,e))},cidrv4(e){return this.check(ri(Ai,e))},cidrv6(e){return this.check(ni(Ti,e))},e164(e){return this.check(ai(Ci,e))},datetime(e){return this.check(yr(Ne,e))},date(e){return this.check(_r(Ue,e))},time(e){return this.check(br(Ae,e))},duration(e){return this.check(kr(Te,e))}});function wr(e){return Cu(At,e)}var C=p("ZodStringFormat",(e,r)=>{Z.init(e,r),ki.init(e,r)}),Ne=p("ZodISODateTime",(e,r)=>{ja.init(e,r),C.init(e,r)}),Ue=p("ZodISODate",(e,r)=>{Oa.init(e,r),C.init(e,r)}),Ae=p("ZodISOTime",(e,r)=>{Na.init(e,r),C.init(e,r)}),Te=p("ZodISODuration",(e,r)=>{Ua.init(e,r),C.init(e,r)}),xi=p("ZodEmail",(e,r)=>{ya.init(e,r),C.init(e,r)});function Bf(e){return Rn(xi,e)}var Ii=p("ZodGUID",(e,r)=>{$a.init(e,r),C.init(e,r)});function Kf(e){return Fn(Ii,e)}var $e=p("ZodUUID",(e,r)=>{ha.init(e,r),C.init(e,r)});function Gf(e){return Mn($e,e)}function Wf(e){return Jn($e,e)}function Xf(e){return Bn($e,e)}function qf(e){return Kn($e,e)}var Sr=p("ZodURL",(e,r)=>{ka.init(e,r),C.init(e,r)});function Yf(e){return hr(Sr,e)}function Hf(e){return hr(Sr,{protocol:er,hostname:Uo,...$.normalizeParams(e)})}var wi=p("ZodEmoji",(e,r)=>{xa.init(e,r),C.init(e,r)});function Qf(e){return Gn(wi,e)}var zi=p("ZodNanoID",(e,r)=>{Ia.init(e,r),C.init(e,r)});function em(e){return Wn(zi,e)}var Si=p("ZodCUID",(e,r)=>{wa.init(e,r),C.init(e,r)});function tm(e){return Xn(Si,e)}var Pi=p("ZodCUID2",(e,r)=>{za.init(e,r),C.init(e,r)});function rm(e){return qn(Pi,e)}var Di=p("ZodULID",(e,r)=>{Sa.init(e,r),C.init(e,r)});function nm(e){return Yn(Di,e)}var ji=p("ZodXID",(e,r)=>{Pa.init(e,r),C.init(e,r)});function im(e){return Hn(ji,e)}var Oi=p("ZodKSUID",(e,r)=>{Da.init(e,r),C.init(e,r)});function om(e){return Qn(Oi,e)}var Ni=p("ZodIPv4",(e,r)=>{Aa.init(e,r),C.init(e,r)});function am(e){return ei(Ni,e)}var bs=p("ZodMAC",(e,r)=>{Za.init(e,r),C.init(e,r)});function um(e){return Vu(bs,e)}var Ui=p("ZodIPv6",(e,r)=>{Ta.init(e,r),C.init(e,r)});function cm(e){return ti(Ui,e)}var Ai=p("ZodCIDRv4",(e,r)=>{Ea.init(e,r),C.init(e,r)});function sm(e){return ri(Ai,e)}var Ti=p("ZodCIDRv6",(e,r)=>{Ca.init(e,r),C.init(e,r)});function lm(e){return ni(Ti,e)}var Zi=p("ZodBase64",(e,r)=>{La.init(e,r),C.init(e,r)});function dm(e){return ii(Zi,e)}var Ei=p("ZodBase64URL",(e,r)=>{Va.init(e,r),C.init(e,r)});function fm(e){return oi(Ei,e)}var Ci=p("ZodE164",(e,r)=>{Ra.init(e,r),C.init(e,r)});function mm(e){return ai(Ci,e)}var ks=p("ZodCreditCard",(e,r)=>{Fa.init(e,r),C.init(e,r)});function pm(e){return Ru(ks,e)}var xs=p("ZodIBAN",(e,r)=>{Ma.init(e,r),C.init(e,r)});function gm(e){return Fu(xs,e)}var Li=p("ZodJWT",(e,r)=>{Ja.init(e,r),C.init(e,r)});function vm(e){return ui(Li,e)}var Qe=p("ZodCustomStringFormat",(e,r)=>{Ba.init(e,r),C.init(e,r)});function $m(e,r,i={}){return Xe(Qe,e,r,i)}function hm(e){return Xe(Qe,"hostname",No,e)}function ym(e){return Xe(Qe,"hex",Go,e)}function _m(e){return Xe(Qe,"currency_code",To,e)}function bm(e,r){let i=r?.enc??"hex",o=`${e}_${i}`,t=le[o];if(!t)throw new Error(`Unrecognized hash format: ${o}`);return Xe(Qe,o,t,r)}var Tt=p("ZodNumber",(e,r)=>{kn.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>zc(e,i,o,t),e.isFinite=!0},$.derived({minValue:e=>{let{minimum:r,exclusiveMinimum:i}=J(e);return Math.max(r??Number.NEGATIVE_INFINITY,i??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:r,exclusiveMaximum:i}=J(e);return Math.min(r??Number.POSITIVE_INFINITY,i??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:r,multipleOf:i}=J(e);return!!r||!!i?.some(Number.isSafeInteger)},format:e=>J(e).format??null},{gt(e,r){return this.check(ge(e,r))},gte(e,r){return this.check(ue(e,r))},min(e,r){return this.check(ue(e,r))},lt(e,r){return this.check(pe(e,r))},lte(e,r){return this.check(ae(e,r))},max(e,r){return this.check(ae(e,r))},int(e){return this.check(_i(e))},safe(e){return this.check(_i(e))},positive(e){return this.check(ge(0,e))},nonnegative(e){return this.check(ue(0,e))},negative(e){return this.check(pe(0,e))},nonpositive(e){return this.check(ae(0,e))},multipleOf(e,r){return this.check(Se(e,r))},step(e,r){return this.check(Se(e,r))},finite(){return this}}));function Is(e){return Ju(Tt,e)}var et=p("ZodNumberFormat",(e,r)=>{Ka.init(e,r),Tt.init(e,r)});function _i(e){return Ku(et,e)}function km(e){return Gu(et,e)}function xm(e){return Wu(et,e)}function Im(e){return Xu(et,e)}function wm(e){return qu(et,e)}var Zt=p("ZodBoolean",(e,r)=>{sr.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Sc(e,i,o,t)});function ws(e){return Yu(Zt,e)}var Et=p("ZodBigInt",(e,r)=>{xn.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Pc(e,i,o,t)},$.derived({minValue:e=>J(e).minimum??null,maxValue:e=>J(e).maximum??null,format:e=>J(e).format??null},{gte(e,r){return this.check(ue(e,r))},min(e,r){return this.check(ue(e,r))},gt(e,r){return this.check(ge(e,r))},lt(e,r){return this.check(pe(e,r))},lte(e,r){return this.check(ae(e,r))},max(e,r){return this.check(ae(e,r))},positive(e){return this.check(ge(BigInt(0),e))},negative(e){return this.check(pe(BigInt(0),e))},nonpositive(e){return this.check(ae(BigInt(0),e))},nonnegative(e){return this.check(ue(BigInt(0),e))},multipleOf(e,r){return this.check(Se(e,r))}}));function zm(e){return Qu(Et,e)}var Vi=p("ZodBigIntFormat",(e,r)=>{Ga.init(e,r),Et.init(e,r)});function Sm(e){return tc(Vi,e)}function Pm(e){return rc(Vi,e)}var zs=p("ZodSymbol",(e,r)=>{Wa.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Dc(e,i,o,t)});function Dm(e){return nc(zs,e)}var Ss=p("ZodUndefined",(e,r)=>{Xa.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Oc(e,i,o,t)});function jm(e){return ic(Ss,e)}var Ps=p("ZodNull",(e,r)=>{qa.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>jc(e,i,o,t)});function Ds(e){return oc(Ps,e)}var js=p("ZodAny",(e,r)=>{Ya.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Ac(e,i,o,t)});function Om(){return ac(js)}var Os=p("ZodUnknown",(e,r)=>{Ha.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Tc(e,i,o,t)});function qe(){return uc(Os)}var Ns=p("ZodNever",(e,r)=>{Qa.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Uc(e,i,o,t)});function Ri(e){return cc(Ns,e)}var Us=p("ZodVoid",(e,r)=>{eu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Nc(e,i,o,t)});function Nm(e){return sc(Us,e)}var Pr=p("ZodDate",(e,r)=>{tu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Zc(e,i,o,t),e.min=(i,o)=>e.check(ue(i,o)),e.max=(i,o)=>e.check(ae(i,o))},$.derived({minDate:e=>{let{minimum:r}=J(e);return r?new Date(r):null},maxDate:e=>{let{maximum:r}=J(e);return r?new Date(r):null}},{}));function Um(e){return lc(Pr,e)}var As=p("ZodArray",(e,r)=>{He(),ru.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Wc(e,i,o,t),e.element=r.element},{min(e,r){return this.check(ke(e,r))},nonempty(e){return this.check(ke(1,e))},max(e,r){return this.check(Ge(e,r))},length(e,r){return this.check(We(e,r))},unwrap(){return this.element}});function Dr(e,r){return mc(As,e,r)}function Am(e){let r=e._zod.def.shape;return Fi(Object.keys(r))}var jr=p("ZodObject",(e,r)=>{He(),nu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Xc(e,i,o,t),$.installLazyProp(e,"shape",i=>i._zod.def.shape,!1)},{keyof(){return Fi(Object.keys(this._zod.def.shape))},catchall(e){return this.clone($.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone($.mergeDefs(this._zod.def,{catchall:qe()}))},loose(){return this.clone($.mergeDefs(this._zod.def,{catchall:qe()}))},strict(){return this.clone($.mergeDefs(this._zod.def,{catchall:Ri()}))},strip(){return this.clone($.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return $.extend(this,e)},safeExtend(e){return $.safeExtend(this,e)},merge(e){return $.merge(this,e)},pick(e){return $.pick(this,e)},omit(e){return $.omit(this,e)},partial(...e){return $.partial(Nr,this,e[0])},exactPartial(...e){return $.partial(Ji,this,e[0],"exactPartial")},required(...e){return $.required(Bi,this,e[0])}});function Tm(e,r){let i={type:"object",shape:e??{},...$.normalizeParams(r)};return new jr(i)}function Zm(e,r){return new jr({type:"object",shape:e,catchall:Ri(),...$.normalizeParams(r)})}function Em(e,r){return new jr({type:"object",shape:e,catchall:qe(),...$.normalizeParams(r)})}var Or=p("ZodUnion",(e,r)=>{lr.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>pi(e,i,o,t),e.options=r.options});function Ct(e,r){return new Or({type:"union",options:e,...$.normalizeParams(r)})}var Ts=p("ZodXor",(e,r)=>{Or.init(e,r),iu.init(e,r),e._zod.processJSONSchema=(i,o,t)=>pi(e,i,o,t),e.options=r.options});function Cm(e,r){return new Ts({type:"union",options:e,inclusive:!1,...$.normalizeParams(r)})}var Zs=p("ZodDiscriminatedUnion",(e,r)=>{Or.init(e,r),au.init(e,r)});function Lm(e,r,i){return new Zs({type:"union",options:r,discriminator:e,...$.normalizeParams(i)})}var Es=p("ZodIntersection",(e,r)=>{uu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>qc(e,i,o,t)});function Cs(e,r){return new Es({type:"intersection",left:e,right:r})}var Ls=p("ZodTuple",(e,r)=>{He(),In.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Yc(e,i,o,t)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(r=>new Nr({type:"optional",innerType:r}))})}});function Vs(e,r,i){let o=r instanceof P,t=o?i:r,n=o?r:null;return new Ls({type:"tuple",items:e,rest:n,...$.normalizeParams(t)})}var Nt=p("ZodRecord",(e,r)=>{He(),cu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Hc(e,i,o,t),e.keyType=r.keyType,e.valueType=r.valueType});function Rs(e,r,i){return!r||!r._zod?new Nt({type:"record",keyType:wr(),valueType:e,...$.normalizeParams(r)}):new Nt({type:"record",keyType:e,valueType:r,...$.normalizeParams(i)})}function Vm(e,r,i){return new Nt({type:"record",keyType:e,valueType:r,...$.normalizeParams(i),partial:!0})}function Rm(e,r,i){return new Nt({type:"record",keyType:e,valueType:r,mode:"loose",...$.normalizeParams(i)})}var Fs=p("ZodMap",(e,r)=>{He(),su.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Kc(e,i,o,t),e.keyType=r.keyType,e.valueType=r.valueType,e.min=(...i)=>e.check(ve(...i)),e.nonempty=i=>e.check(ve(1,i)),e.max=(...i)=>e.check(Pe(...i)),e.size=(...i)=>e.check(Ke(...i))});function Fm(e,r,i){return new Fs({type:"map",keyType:e,valueType:r,...$.normalizeParams(i)})}var Ms=p("ZodSet",(e,r)=>{He(),lu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Gc(e,i,o,t),e.min=(...i)=>e.check(ve(...i)),e.nonempty=i=>e.check(ve(1,i)),e.max=(...i)=>e.check(Pe(...i)),e.size=(...i)=>e.check(Ke(...i))});function Mm(e,r){return new Ms({type:"set",valueType:e,...$.normalizeParams(r)})}var Ut=p("ZodEnum",(e,r)=>{du.init(e,r),j.init(e,r),e._zod.processJSONSchema=(o,t,n)=>Ec(e,o,t,n),e.enum=r.entries,e.options=[...e._zod.values];let i=new Set(Object.keys(r.entries));e.extract=(o,t)=>{let n={};for(let a of o)if(i.has(a))n[a]=r.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Ut({...r,checks:[],...$.normalizeParams(t),entries:n})},e.exclude=(o,t)=>{let n={...r.entries};for(let a of o)if(i.has(a))delete n[a];else throw new Error(`Key ${a} not found in enum`);return new Ut({...r,checks:[],...$.normalizeParams(t),entries:n})}});function Fi(e,r){let i=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new Ut({type:"enum",entries:i,...$.normalizeParams(r)})}function Jm(e,r){return new Ut({type:"enum",entries:e,...$.normalizeParams(r)})}var Js=p("ZodLiteral",(e,r)=>{fu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Cc(e,i,o,t),e.values=new Set(r.values),Object.defineProperty(e,"value",{get(){if(r.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return r.values[0]}})});function Bm(e,r){return new Js({type:"literal",values:Array.isArray(e)?e:[e],...$.normalizeParams(r)})}var Bs=p("ZodFile",(e,r)=>{mu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Rc(e,i,o,t),e.min=(i,o)=>e.check(ve(i,o)),e.max=(i,o)=>e.check(Pe(i,o)),e.mime=(i,o)=>e.check(xt(Array.isArray(i)?i:[i],o))});function Km(e){return pc(Bs,e)}var Ks=p("ZodTransform",(e,r)=>{He(),pu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Bc(e,i,o,t),e._zod.parse=(i,o)=>{if(o.direction==="backward")throw new ze(e.constructor.name);i.addIssue=n=>{if(typeof n=="string")i.issues.push($.issue(n,i.value,r));else{let a=n;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),"input"in a||(a.input=i.value),a.inst??(a.inst=e),i.issues.push($.issue(a))}};let t=r.transform(i.value,i);return t instanceof Promise?t.then(n=>(i.value=n,i)):(i.value=t,i)}});function Mi(e){return new Ks({type:"transform",transform:e})}var Nr=p("ZodOptional",(e,r)=>{wn.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>gi(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Ye(e){return new Nr({type:"optional",innerType:e})}var Ji=p("ZodExactOptional",(e,r)=>{gu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>gi(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Gs(e){return new Ji({type:"optional",innerType:e})}var Ws=p("ZodNullable",(e,r)=>{vu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Qc(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function zr(e){return new Ws({type:"nullable",innerType:e})}function Gm(e){return Ye(zr(e))}var Xs=p("ZodDefault",(e,r)=>{$u.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>rs(e,i,o,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function qs(e,r){return new Xs({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():$.shallowClone(r)}})}var Ys=p("ZodPrefault",(e,r)=>{hu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>ns(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Hs(e,r){return new Ys({type:"prefault",innerType:e,get defaultValue(){return typeof r=="function"?r():$.shallowClone(r)}})}var Bi=p("ZodNonOptional",(e,r)=>{yu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>es(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Qs(e,r){return new Bi({type:"nonoptional",innerType:e,...$.normalizeParams(r)})}var el=p("ZodSuccess",(e,r)=>{_u.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Fc(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Wm(e){return new el({type:"success",innerType:e})}var tl=p("ZodCatch",(e,r)=>{bu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>is(e,i,o,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function rl(e,r){return new tl({type:"catch",innerType:e,catchValue:typeof r=="function"?r:$.constantCatch(r)})}var nl=p("ZodNaN",(e,r)=>{ku.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Lc(e,i,o,t)});function Xm(e){return fc(nl,e)}var Ur=p("ZodPipe",(e,r)=>{zn.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>os(e,i,o,t),e.in=r.in,e.out=r.out});function bi(e,r){return new Ur({type:"pipe",in:e,out:r})}var Ar=p("ZodCodec",(e,r)=>{Ur.init(e,r),dr.init(e,r)});function qm(e,r,i){return new Ar({type:"pipe",in:e,out:r,transform:i.decode,reverseTransform:i.encode})}function Ym(e){let r=e._zod.def;return new Ar({type:"pipe",in:r.out,out:r.in,transform:r.reverseTransform,reverseTransform:r.transform})}var il=p("ZodPreprocess",(e,r)=>{Ur.init(e,r),xu.init(e,r)}),ol=p("ZodReadonly",(e,r)=>{Iu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>as(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function al(e){return new ol({type:"readonly",innerType:e})}var ul=p("ZodTemplateLiteral",(e,r)=>{wu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Vc(e,i,o,t)});function Hm(e,r){return new ul({type:"template_literal",parts:e,...$.normalizeParams(r)})}var cl=p("ZodLazy",(e,r)=>{fr.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>cs(e,i,o,t),e.unwrap=()=>e._zod.def.getter()});function sl(e){return new cl({type:"lazy",getter:e})}var ll=p("ZodPromise",(e,r)=>{Su.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>us(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Qm(e){return new ll({type:"promise",innerType:e})}var dl=p("ZodFunction",(e,r)=>{zu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Jc(e,i,o,t)});function ep(e){return new dl({type:"function",input:Array.isArray(e?.input)?Vs(e?.input):e?.input??Dr(qe()),output:e?.output??qe()})}var Tr=p("ZodCustom",(e,r)=>{Pu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Mc(e,i,o,t)});function tp(e){let r=new L({check:"custom"});return r._zod.check=e,r}function rp(e,r){return gc(Tr,e??(()=>!0),r)}function fl(e,r={}){return vc(Tr,e,r)}function ml(e,r){return $c(e,r)}var np=hc,ip=yc,pl=p("ZodInstanceOf",(e,r)=>{Tr.init(e,r)},{properties(e,r){return this.check(kt(e,r))}});function op(e,r={}){let i=new pl({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...$.normalizeParams(r)});return i._zod.bag.Class=e,i._zod.check=o=>{o.value instanceof e||o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:i,path:[...i._zod.def.path??[]]})},i}var ap=(...e)=>_c({Codec:Ar,Boolean:Zt,String:At},...e);function up(e){let r=sl(()=>Ct([wr(e),Is(),ws(),Ds(),Dr(r),Rs(wr(),r)]));return r}function cp(e,r){return new il({type:"pipe",in:Mi(e),out:r})}var Vh={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function Rh(e){F({customError:e})}function Fh(){return F().customError}var gl;gl||(gl={});var Zr={};he(Zr,{ZodISODate:()=>Ue,ZodISODateTime:()=>Ne,ZodISODuration:()=>Te,ZodISOTime:()=>Ae,date:()=>Jh,datetime:()=>Mh,duration:()=>Kh,time:()=>Bh});function Mh(e){return yr(Ne,e)}function Jh(e){return _r(Ue,e)}function Bh(e){return br(Ae,e)}function Kh(e){return kr(Te,e)}var x={...Lt,...yi,iso:Zr},Gh=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function Wh(e,r){let i=e.$schema;return i==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":i==="http://json-schema.org/draft-07/schema#"?"draft-7":i==="http://json-schema.org/draft-04/schema#"?"draft-4":r??"draft-2020-12"}function sp(e,r){return e.map((i,o)=>o<r?i:i.optional())}function Xh(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function qh(e,r){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let i=e.slice(1).split("/").filter(Boolean);if(i.length===0)return r.rootSchema;let o=r.version==="draft-2020-12"?"$defs":"definitions";if(i[0]===o){let t=i[1]===void 0?void 0:Xh(i[1]);if(!t||!r.defs[t])throw new Error(`Reference not found: ${e}`);return r.defs[t]}throw new Error(`Reference not found: ${e}`)}function Yh(e,r){return x.transform(o=>o).check(o=>{let t=o.value;if(typeof t!="object"||t===null||Array.isArray(t))return;let n=Object.getOwnPropertyNames(t);if(r.minProperties!==void 0&&n.length<r.minProperties&&o.issues.push({origin:"object",code:"too_small",minimum:r.minProperties,inclusive:!0,message:`Too small: expected object to have >=${r.minProperties} properties`,input:t,inst:e,continue:!0}),r.maxProperties!==void 0&&n.length>r.maxProperties&&o.issues.push({origin:"object",code:"too_big",maximum:r.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${r.maxProperties} properties`,input:t,inst:e,continue:!0}),r.keySchema)for(let a of n){let u=r.keySchema.safeParse(a);u.success||o.issues.push({code:"invalid_key",origin:"record",issues:u.error.issues,input:a,path:[a],continue:!0})}}).pipe(e)}function vl(e,r){if(e===null)return"z";let i=typeof e;if(i!=="object"){if(i==="number"&&Number.isNaN(e))return null;let o=String(e);return`${i[0]}${o.length}:${o}`}if(r.has(e))return null;r.add(e);try{if(Array.isArray(e)){let n=[];for(let a of e){let u=vl(a,r);if(u===null)return null;n.push(u)}return`a${n.length}:[${n.join(",")}]`}let o=Object.keys(e).sort(),t=[];for(let n of o){let a=vl(e[n],r);if(a===null)return null;t.push(`${n.length}:${n}=${a}`)}return`o${t.length}:{${t.join(",")}}`}finally{r.delete(e)}}var Hh=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),Qh=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);function Er(e){return typeof e!="object"||e===null?!1:Array.isArray(e)?e.some(Er):typeof e.$ref=="string"?!0:Object.entries(e).some(([r,i])=>Hh.has(r)?Er(i):!Qh.has(r)||typeof i!="object"||i===null?!1:Object.values(i).some(Er))}function lp(e){return e===1?"element":"elements"}function ey(e,r){return x.transform(o=>o).check(o=>{let t=o.value;if(Array.isArray(t)){if(r.uniqueItems===!0){let n=new Map;for(let a=0;a<t.length;a++){let u=vl(t[a],new Set);if(u===null)continue;let s=n.get(u);if(s===void 0){n.set(u,a);continue}o.issues.push({code:"custom",message:`Array items must be unique: element at index ${a} duplicates the one at index ${s}`,input:t,path:[a],continue:!0})}}if(r.containsSchema){let n=r.minContains??1,a=r.maxContains!==void 0?r.maxContains+1:Number.POSITIVE_INFINITY,u=0;for(let s of t)if(r.containsSchema.safeParse(s).success&&++u>=a)break;u<n&&o.issues.push({code:"custom",message:`Array must contain at least ${n} matching ${lp(n)}; found ${u}`,input:t,continue:!0}),r.maxContains!==void 0&&u>r.maxContains&&o.issues.push({code:"custom",message:`Array must contain at most ${r.maxContains} matching ${lp(r.maxContains)}`,input:t,continue:!0})}}}).pipe(e)}function dp(e,r){if(e!==!1)return e===void 0||e===!0?x.any():ee(e,r)}var ty=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function fp(e,r){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return x.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let t=e.$ref;if(r.refs.has(t))return r.refs.get(t);if(r.processing.has(t))return x.lazy(()=>{if(!r.refs.has(t))throw new Error(`Circular reference not resolved: ${t}`);return r.refs.get(t)});r.processing.add(t);let n=qh(t,r),a=ee(n,r);return r.refs.set(t,a),r.processing.delete(t),a}if(e.enum!==void 0){let t=e.enum;if(r.version==="openapi-3.0"&&e.nullable===!0&&t.length===1&&t[0]===null)return x.null();if(t.length===0)return x.never();if(t.length===1)return x.literal(t[0]);if(t.every(a=>typeof a=="string"))return x.enum(t);let n=t.map(a=>x.literal(a));return n.length<2?n[0]:x.union([n[0],n[1],...n.slice(2)])}if(e.const!==void 0)return x.literal(e.const);let i=e.type;if(Array.isArray(i)){let t=i.map(n=>{let a={...e,type:n};return fp(a,r)});return t.length===0?x.never():t.length===1?t[0]:x.union(t)}if(!i)return x.any();let o;switch(i){case"string":{let t=x.string();if(e.format){let n=e.format;n==="email"?t=t.check(x.email()):n==="uri"||n==="uri-reference"?t=t.check(x.url()):n==="uuid"||n==="guid"?t=t.check(x.uuid()):n==="date-time"?t=t.check(x.iso.datetime({offset:!0})):n==="date"?t=t.check(x.iso.date()):n==="time"?t=t.check(x.regex(ty)):n==="duration"?t=t.check(x.iso.duration()):n==="hostname"?t=t.check(x.hostname()):n==="ipv4"?t=t.check(x.ipv4()):n==="ipv6"?t=t.check(x.ipv6()):n==="mac"?t=t.check(x.mac()):n==="cidr"?t=t.check(x.cidrv4()):n==="cidr-v6"?t=t.check(x.cidrv6()):n==="base64"?t=t.check(x.base64()):n==="base64url"?t=t.check(x.base64url()):n==="e164"?t=t.check(x.e164()):n==="credit_card"?t=t.check(x.creditCard()):n==="iban"?t=t.check(x.iban()):n==="jwt"?t=t.check(x.jwt()):n==="emoji"?t=t.check(x.emoji()):n==="nanoid"?t=t.check(x.nanoid()):n==="cuid"?t=t.check(x.cuid()):n==="cuid2"?t=t.check(x.cuid2()):n==="ulid"?t=t.check(x.ulid()):n==="xid"?t=t.check(x.xid()):n==="ksuid"&&(t=t.check(x.ksuid()))}typeof e.minLength=="number"&&(t=t.min(e.minLength)),typeof e.maxLength=="number"&&(t=t.max(e.maxLength)),e.pattern&&(t=t.regex(new RegExp(e.pattern))),o=t;break}case"number":case"integer":{let t=i==="integer"?x.number().int():x.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(t=t.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(t=t.max(e.maximum)),typeof e.exclusiveMinimum=="number"?t=t.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(t=t.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?t=t.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(t=t.lt(e.maximum)),typeof e.multipleOf=="number"&&(t=t.multipleOf(e.multipleOf)),o=t;break}case"boolean":{o=x.boolean();break}case"null":{o=x.null();break}case"object":{let t={},n=e.properties||{},a=new Set(e.required||[]),u=typeof e.additionalProperties=="object"?ee(e.additionalProperties,r):void 0;for(let[d,f]of Object.entries(n)){let m=ee(f,r);K(t,d,a.has(d)?m:m.optional())}if(e.patternProperties){let d=e.patternProperties,f=Object.keys(d),m=[];for(let _ of f){let k=ee(d[_],r),z=x.string().regex(new RegExp(_));m.push(x.looseRecord(z,k))}let v=[];if(Object.keys(t).length>0&&v.push(x.object(t).passthrough()),v.push(...m),v.length===0)o=x.object({}).passthrough();else if(v.length===1)o=v[0];else{let _=x.intersection(v[0],v[1]);for(let k=2;k<v.length;k++)_=x.intersection(_,v[k]);o=_}if(e.additionalProperties===!1){let _=Object.keys(t),k=f.map(I=>new RegExp(I)),z=o;o=o.check(I=>{if(!ce(I.value))return;let D=[];for(let A of Object.keys(I.value))_.includes(A)||k.some(V=>V.test(A))||D.push(A);D.length&&I.issues.push({code:"unrecognized_keys",keys:D,input:I.value,inst:z})})}}else{let d=x.object(t);e.additionalProperties===!1?o=d.strict():u?o=d.catchall(u):o=d.passthrough()}let s=e.propertyNames!==void 0&&e.propertyNames!==!0,c=typeof e.minProperties=="number"?e.minProperties:void 0,l=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(s||c!==void 0||l!==void 0){let d;if(s){let f=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;d=ee(f,r)}o=Yh(o,{keySchema:d,minProperties:c,maxProperties:l})}break}case"array":{let t=e.prefixItems,n=e.items;if(t&&Array.isArray(t)){let a=typeof e.minItems=="number"?e.minItems:0,u=t.map(d=>ee(d,r)),s=sp(u,a),c=Array.isArray(n)?void 0:dp(n,r),l=x.tuple(s);o=c?l.rest(c):l,typeof e.minItems=="number"&&(o=o.check(x.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(x.maxLength(e.maxItems)))}else if(Array.isArray(n)){let a=typeof e.minItems=="number"?e.minItems:0,u=n.map(d=>ee(d,r)),s=sp(u,a),c=dp(e.additionalItems,r),l=x.tuple(s);o=c?l.rest(c):l,typeof e.minItems=="number"&&(o=o.check(x.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(x.maxLength(e.maxItems)))}else if(n!==void 0){let a=ee(n,r),u=x.array(a);typeof e.minItems=="number"&&(u=u.min(e.minItems)),typeof e.maxItems=="number"&&(u=u.max(e.maxItems)),o=u}else o=x.array(x.any());(e.uniqueItems===!0||e.contains!==void 0)&&(o=ey(o,{uniqueItems:e.uniqueItems===!0,containsSchema:e.contains!==void 0?ee(e.contains,r):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${i}`)}return o}function ee(e,r){if(typeof e=="boolean")return e?x.any():x.never();let i=fp(e,r),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let u=e.anyOf.map(c=>ee(c,r)),s=x.union(u);i=o?x.intersection(i,s):s}if(e.oneOf&&Array.isArray(e.oneOf)){let u=e.oneOf.map(c=>ee(c,r)),s=x.xor(u);i=o?x.intersection(i,s):s}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)i=o?i:x.any();else{let u=o?i:ee(e.allOf[0],r),s=o?0:1;for(let c=s;c<e.allOf.length;c++)u=x.intersection(u,ee(e.allOf[c],r));i=u}e.nullable===!0&&r.version==="openapi-3.0"&&(i=x.nullable(i)),e.readOnly===!0&&(i=x.readonly(i)),e.default!==void 0&&(i=i.default(e.default));let t={},n=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let u of n)u in e&&(t[u]=e[u]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let u of a)u in e&&(t[u]=e[u]);if(e.type==="object"&&e.$ref===void 0){e.propertyNames!==void 0&&!Er(e.propertyNames)&&(t.propertyNames=e.propertyNames);for(let u of["minProperties","maxProperties"])e[u]!==void 0&&(t[u]=e[u])}if(e.type==="array"&&e.$ref===void 0){e.contains!==void 0&&!Er(e.contains)&&(t.contains=e.contains);for(let u of["uniqueItems","minContains","maxContains"])e[u]!==void 0&&(t[u]=e[u])}for(let u of Object.keys(e))Gh.has(u)||K(t,u,e[u]);return Object.keys(t).length>0&&r.registry.add(i,t),e.description&&(i=i.describe(e.description)),i}function mp(e,r){if(typeof e=="boolean")return e?x.any():x.never();let i;try{i=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let o=Wh(i,r?.defaultTarget),t=i.$defs||i.definitions||{},n={version:o,defs:t,refs:new Map,processing:new Set,rootSchema:i,registry:r?.registry??G};return ee(i,n)}var pp=Symbol("z.visit/resolving");function Cr(e,r){let i=typeof r=="function"?r:(a,u)=>{let s=r[a._zod.def.type];return s?s(a,u):a},o=new Map;function t(a){let u=o.get(a);if(u===pp)return new fr({type:"lazy",getter:()=>o.get(a)});if(u!==void 0)return u;o.set(a,pp);let s=n(a),c=i(s,s!==a);return o.set(a,c),c}function n(a){let u=a._zod.def,s=u.type;switch(s){case"object":{let c=u.shape,l=Object.keys(c),d=!1,f={};for(let v of l){let _=t(c[v]);_!==c[v]&&(d=!0),f[v]=_}let m=u.catchall;return u.catchall&&(m=t(u.catchall),m!==u.catchall&&(d=!0)),d?T(a,{...u,shape:f,catchall:m}):a}case"array":{let c=t(u.element);return c===u.element?a:T(a,{...u,element:c})}case"tuple":{let c=u.items,l=!1,d=[];for(let m of c){let v=t(m);v!==m&&(l=!0),d.push(v)}let f=u.rest;return u.rest&&(f=t(u.rest),f!==u.rest&&(l=!0)),l?T(a,{...u,items:d,rest:f}):a}case"record":case"map":{let c=t(u.keyType),l=t(u.valueType);return c===u.keyType&&l===u.valueType?a:T(a,{...u,keyType:c,valueType:l})}case"set":{let c=t(u.valueType);return c===u.valueType?a:T(a,{...u,valueType:c})}case"union":{let c=u.options,l=!1,d=[];for(let f of c){let m=t(f);m!==f&&(l=!0),d.push(m)}return l?T(a,{...u,options:d}):a}case"intersection":{let c=t(u.left),l=t(u.right);return c===u.left&&l===u.right?a:T(a,{...u,left:c,right:l})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let c=t(u.innerType);return c===u.innerType?a:T(a,{...u,innerType:c})}case"pipe":{let c=t(u.in),l=t(u.out);return c===u.in&&l===u.out?a:T(a,{...u,in:c,out:l})}case"function":{let c=t(u.input),l=t(u.output);return c===u.input&&l===u.output?a:T(a,{...u,input:c,output:l})}case"lazy":{let c=u.getter,{_cachedInner:l,...d}=u;return T(a,{...d,getter:()=>t(c())})}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":return a;default:return a}}return t(e)}function gp(e){return Cr(e,{object:r=>r.partial(),union:r=>{let i=r._zod.def;return i.discriminator===void 0?r:Ct(i.options)}})}function ry(e,r){if(!r?.length)return e;let i=e._zod.def;return T(e,de(i,{checks:[...i.checks??[],...r]}),{parent:!0})}function vp(e){return ry(e.out,e.checks)}function ny(e){return e.in._zod.traits.has("$ZodTransform")?vp(e):e.in}function $p(e){return Cr(e,{pipe:r=>ny(r._zod.def),default:(r,i)=>i?Ye(r._zod.def.innerType):r,catch:(r,i)=>i?r._zod.def.innerType:r})}function hp(e){return Cr(e,{pipe:r=>vp(r._zod.def),prefault:(r,i)=>i?r._zod.def.innerType:r})}var $l={};he($l,{bigint:()=>uy,boolean:()=>ay,date:()=>cy,number:()=>oy,string:()=>iy});function iy(e){return Lu(At,e)}function oy(e){return Bu(Tt,e)}function ay(e){return Hu(Zt,e)}function uy(e){return ec(Et,e)}function cy(e){return dc(Pr,e)}export{oo as a,ag as b,ug as c,ss as d,ds as e,fs as f,wr as g,Yf as h,Is as i,_i as j,ws as k,Ds as l,Om as m,qe as n,Dr as o,Tm as p,Em as q,Ct as r,Lm as s,Cs as t,Rs as u,Fi as v,Bm as w,Ye as x,rp as y,cp as z,Vh as A,Zr as B,$l as C,yp as D};
|
|
65
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let u=a[1];if(r===a[0]){n(a);continue}if(e.external){let c=e.external.registry.get(a[0])?.id;if(r!==a[0]&&c){n(a);continue}}if(e.metadataRegistry.get(a[0])?.id){n(a);continue}if(u.cycle){n(a);continue}u.count>1&&e.reused==="ref"&&n(a)}e.external&&(e.sharedDefsExtractedFor=e.external)}function jf(e){let r=e.anyOf;if(!Array.isArray(r)||r.length===0||e.type!==void 0)return;let i=[];for(let o of r){if(!o||typeof o!="object")return;jf(o);let t=Object.keys(o);if(t.length!==1||t[0]!=="type")return;let n=o.type;for(let a of Array.isArray(n)?n:[n]){if(typeof a!="string")return;i.includes(a)||i.push(a)}}delete e.anyOf,e.type=i.length===1?i[0]:i}var Of=new Set(["type","properties","required","additionalProperties"]),Pf=["oneOf","anyOf"];function Df(e){let r=e.additionalProperties;return r===void 0||r===!1||typeof r!="object"||r===null?null:Object.keys(r).length?r:null}function bc(e){let r=[];for(let n of e){if(typeof n!="object"||n.type!=="object")return null;for(let a in n)if(!Of.has(a))return null;r.push(n)}let i={},o=new Set;for(let n of r){for(let a in n.properties){if(Object.prototype.hasOwnProperty.call(i,a))continue;let u=[];for(let c of r){let l=c.properties?.[a]??Df(c);l!=null&&(u.some(d=>JSON.stringify(d)===JSON.stringify(l))||u.push(l))}let s=u.length===1?u[0]:bc(u)??{allOf:u};K(i,a,s)}for(let a of n.required??[])o.add(a)}let t={type:"object",properties:i};if(o.size&&(t.required=[...o]),r.every(n=>n.additionalProperties===!1))t.additionalProperties=!1;else{let n=[];for(let a of r){let u=Df(a);u&&!n.some(s=>JSON.stringify(s)===JSON.stringify(u))&&n.push(u)}n.length===1?t.additionalProperties=n[0]:n.length>1&&(t.additionalProperties={allOf:n})}return t}function Oh(e){let r=e.allOf;if(!Array.isArray(r)||r.length<2)return;for(let t of Of)if(t in e)return;let i=r.filter(t=>Pf.some(n=>Array.isArray(t[n]))),o=null;if(!i.length)o=bc(r);else{let t=i[0],n=Pf.find(s=>Array.isArray(t[s]));if(Object.keys(t).length!==1)return;let a=r.filter(s=>s!==t),u=t[n].map(s=>bc([...a,s]));if(u.some(s=>!s))return;o={[n]:u}}o&&(delete e.allOf,xr(e,o))}function Oe(e,r){let i=e.seen.get(r);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=u=>{let s=e.seen.get(u);if(s.ref===null)return;let c=s.def??s.schema,l={...c},d=s.ref;if(s.ref=null,d){o(d);let m=e.seen.get(d),v=m.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(v)):xr(c,v),xr(c,l),u._zod.parent===d)for(let k in c)k==="$ref"||k==="allOf"||k in l||delete c[k];if(v.$ref&&m.def)for(let k in c)k==="$ref"||k==="allOf"||k in m.def&&JSON.stringify(c[k])===JSON.stringify(m.def[k])&&delete c[k]}let f=u._zod.parent;if(f&&f!==d){o(f);let m=e.seen.get(f);if(m?.schema.$ref&&(c.$ref=m.schema.$ref,m.def))for(let v in c)v==="$ref"||v==="allOf"||v in m.def&&JSON.stringify(c[v])===JSON.stringify(m.def[v])&&delete c[v]}e.override({zodSchema:u,jsonSchema:c,path:s.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let u of[...e.seen.entries()].reverse())o(u[0]);if(e.target!=="openapi-3.0")for(let u of e.seen.entries())jf(u[1].def??u[1].schema);for(let u of e.deferred)u();if(e.intersections.length){let u=new Map;for(let s of e.seen.values())for(let c of[s.schema,s.def]){let l=c?.allOf;if(!Array.isArray(l))continue;let d=u.get(l);d?d.push(c):u.set(l,[c])}for(let s of e.intersections)for(let c of u.get(s)??[])Oh(c)}}let t={};if(e.target==="draft-2020-12"?t.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?t.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?t.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let u=e.external.registry.get(r)?.id;if(!u)throw new Error("Schema is missing an `id` property");t.$id=e.external.uri(u)}xr(t,i.defId?i.schema:i.def??i.schema);let n=e.metadataRegistry.get(r)?.id;n!==void 0&&t.id===n&&delete t.id;let a=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let u of e.seen.entries()){let s=u[1];s.def&&s.defId&&(s.def.id===s.defId&&delete s.def.id,K(a,s.defId,s.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?t.$defs=a:t.definitions=a);try{let u=JSON.parse(JSON.stringify(t));return Object.defineProperty(u,"~standard",{value:{...r["~standard"],jsonSchema:{input:Dt(r,"input",e.processors),output:Dt(r,"output",e.processors)}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}function Q(e,r){let i=r??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return Q(o.element,i);if(o.type==="set")return Q(o.valueType,i);if(o.type==="lazy")return Q(o.getter(),i);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault"||o.type==="catch")return Q(o.innerType,i);if(o.type==="intersection")return Q(o.left,i)||Q(o.right,i);if(o.type==="record"||o.type==="map")return Q(o.keyType,i)||Q(o.valueType,i);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Q(o.in,i)||Q(o.out,i);if(o.type==="object"){for(let t in o.shape)if(Q(o.shape[t],i))return!0;return!1}if(o.type==="union"){for(let t of o.options)if(Q(t,i))return!0;return!1}if(o.type==="tuple"){for(let t of o.items)if(Q(t,i))return!0;return!!(o.rest&&Q(o.rest,i))}return!1}var kc=(e,r={})=>i=>{let o=De({...i,processors:r});return E(e,o),je(o,e),Oe(o,e)},Dt=(e,r,i={})=>o=>{let{libraryOptions:t,target:n}=o??{},a=De({...t??{},target:n,io:r,processors:i});return E(e,a),je(a,e),Oe(a,e)};var jt=(e,r,i)=>{(e[r]===void 0||i>e[r])&&(e[r]=i)},Ot=(e,r,i)=>{(e[r]===void 0||i<e[r])&&(e[r]=i)},Nf=(e,r)=>{jt(e,"minimum",r),Ot(e,"maximum",r)},Zf=(e,r)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(r)||e.multipleOf.push(r)},Ef=(e,r)=>{e.patterns??(e.patterns=new Set),e.patterns.add(r)},Cf=(e,r)=>{e.mime=e.mime?e.mime.filter(i=>r.includes(i)):[...r]},Lf=(e,r)=>{e.format=r,r.includes("int")&&(e.isInt=!0)},Uf=(e,r)=>jt(e,"minimum",r.minimum),Af=(e,r)=>Ot(e,"maximum",r.maximum),Tf=e=>(r,i)=>{Lf(r,i.format);let[o,t]=e[i.format];jt(r,"minimum",o),Ot(r,"maximum",t)},Nh={greater_than:(e,r)=>jt(e,r.inclusive?"minimum":"exclusiveMinimum",r.value),less_than:(e,r)=>Ot(e,r.inclusive?"maximum":"exclusiveMaximum",r.value),multiple_of:(e,r)=>Zf(e,r.value),number_format:Tf(Bt),bigint_format:Tf(Kt),min_length:Uf,max_length:Af,length_equals:(e,r)=>Nf(e,r.length),min_size:Uf,max_size:Af,size_equals:(e,r)=>Nf(e,r.size),string_format:(e,r)=>{Lf(e,r.format),r.pattern&&Ef(e,r.pattern),(r.format==="base64"||r.format==="base64url")&&(e.contentEncoding=r.format),(r.local||r.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,r)=>Cf(e,r.mime)};function J(e){let r={},i=e._zod.def,o=e._zod.traits.has("$ZodCheck")?[e,...i.checks??[]]:i.checks??[];for(let n of o)Nh[n._zod.def.check]?.(r,n._zod.def);let t=e._zod.bag;t.minimum!==void 0&&jt(r,"minimum",t.minimum),t.exclusiveMinimum!==void 0&&jt(r,"exclusiveMinimum",t.exclusiveMinimum),t.maximum!==void 0&&Ot(r,"maximum",t.maximum),t.exclusiveMaximum!==void 0&&Ot(r,"exclusiveMaximum",t.exclusiveMaximum),t.multipleOf!==void 0&&Zf(r,t.multipleOf),t.format!==void 0&&(r.format??(r.format=t.format),t.format.includes("int")&&(r.isInt=!0)),t.mime&&Cf(r,t.mime);for(let n of t.patterns??[])Ef(r,n);return r}var Uh={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Ah=new Map([[$n,jo],[cr,Oo]]),Vf=e=>Ah.get(e)??e,wc=(e,r,i,o)=>{let t=i;t.type="string";let{minimum:n,maximum:a,format:u,patterns:s,contentEncoding:c,laxFormat:l}=J(e);if(typeof n=="number"&&(t.minLength=n),typeof a=="number"&&(t.maxLength=a),u&&(t.format=Uh[u]??u,t.format===""&&delete t.format,(u==="time"||l)&&delete t.format),c&&(t.contentEncoding=c),s&&s.size>0){let d=[...s].map(Vf);d.length===1?t.pattern=d[0].source:d.length>1&&(t.allOf=[...d.map(f=>({...r.target==="draft-07"||r.target==="draft-04"||r.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},zc=(e,r,i,o)=>{let t=i,{minimum:n,maximum:a,multipleOf:u,exclusiveMaximum:s,exclusiveMinimum:c,isInt:l}=J(e);t.type=l?"integer":"number";let d=typeof c=="number"&&c>=(n??Number.NEGATIVE_INFINITY),f=typeof s=="number"&&s<=(a??Number.POSITIVE_INFINITY),m=r.target==="draft-04"||r.target==="openapi-3.0";if(d?m?(t.minimum=c,t.exclusiveMinimum=!0):t.exclusiveMinimum=c:typeof n=="number"&&(t.minimum=n),f?m?(t.maximum=s,t.exclusiveMaximum=!0):t.exclusiveMaximum=s:typeof a=="number"&&(t.maximum=a),u){let v=new Set;for(let z of u)Number.isFinite(z)&&z!==0?v.add(Math.abs(z)):M(e,r,t,o,`A multipleOf divisor of ${z} cannot be represented in JSON Schema`);let[_,...k]=v;_!==void 0&&(t.multipleOf=_),k.length&&(t.allOf=[...t.allOf??[],...k.map(z=>({multipleOf:z}))])}},Sc=(e,r,i,o)=>{i.type="boolean"},Pc=(e,r,i,o)=>{M(e,r,i,o,"BigInt cannot be represented in JSON Schema")},Dc=(e,r,i,o)=>{M(e,r,i,o,"Symbols cannot be represented in JSON Schema")},jc=(e,r,i,o)=>{r.target==="openapi-3.0"?(i.type="string",i.nullable=!0,i.enum=[null]):i.type="null"},Oc=(e,r,i,o)=>{M(e,r,i,o,"Undefined cannot be represented in JSON Schema")},Nc=(e,r,i,o)=>{M(e,r,i,o,"Void cannot be represented in JSON Schema")},Uc=(e,r,i,o)=>{i.not={}},Ac=(e,r,i,o)=>{},Tc=(e,r,i,o)=>{},Zc=(e,r,i,o)=>{M(e,r,i,o,"Date cannot be represented in JSON Schema")},Ec=(e,r,i,o)=>{let t=e._zod.def,n=rt(t.entries);if(n.length===0){i.not={};return}n.every(a=>typeof a=="number")&&(i.type="number"),n.every(a=>typeof a=="string")&&(i.type="string"),i.enum=n},Cc=(e,r,i,o)=>{let t=e._zod.def;if(t.values.length===0){i.not={};return}let n=[];for(let a of t.values)if(a===void 0){if(M(e,r,i,o,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof a=="bigint"){if(M(e,r,i,o,"BigInt literals cannot be represented in JSON Schema"))return;n.push(Number(a))}else n.push(a);if(n.length!==0)if(n.length===1){let a=n[0];i.type=a===null?"null":typeof a,r.target==="draft-04"||r.target==="openapi-3.0"?i.enum=[a]:i.const=a}else n.every(a=>typeof a=="number")&&(i.type="number"),n.every(a=>typeof a=="string")&&(i.type="string"),n.every(a=>typeof a=="boolean")&&(i.type="boolean"),n.every(a=>a===null)&&(i.type="null"),i.enum=n},Lc=(e,r,i,o)=>{M(e,r,i,o,"NaN cannot be represented in JSON Schema")},Vc=(e,r,i,o)=>{let t=i,n=e._zod.pattern;if(!n)throw new Error("Pattern not found in template literal");t.type="string",t.pattern=n.source},Rc=(e,r,i,o)=>{let t=i;t.type="string",t.format="binary",t.contentEncoding="binary";let{minimum:n,maximum:a,mime:u}=J(e);n!==void 0&&(t.minLength=n),a!==void 0&&(t.maxLength=a),u&&(u.length===0?t.not={}:u.length===1?t.contentMediaType=u[0]:t.anyOf=u.map(s=>({contentMediaType:s})))},Fc=(e,r,i,o)=>{i.type="boolean"},Mc=(e,r,i,o)=>{M(e,r,i,o,"Custom types cannot be represented in JSON Schema")},Jc=(e,r,i,o)=>{M(e,r,i,o,"Function types cannot be represented in JSON Schema")},Bc=(e,r,i,o)=>{M(e,r,i,o,"Transforms cannot be represented in JSON Schema")},Kc=(e,r,i,o)=>{M(e,r,i,o,"Map cannot be represented in JSON Schema")},Gc=(e,r,i,o)=>{M(e,r,i,o,"Set cannot be represented in JSON Schema")},Wc=(e,r,i,o)=>{let t=i,n=e._zod.def,{minimum:a,maximum:u}=J(e);typeof a=="number"&&(t.minItems=a),typeof u=="number"&&(t.maxItems=u),t.type="array",t.items=E(n.element,r,{...o,path:[...o.path,"items"]})};function Ir(e){let r=e._zod.def;return r.type==="pipe"&&r.in._zod.traits.has("$ZodTransform")?Ir(r.out):r.type==="catch"?Ir(r.innerType):e._zod.optin}var Xc=(e,r,i,o)=>{let t=i,n=e._zod.def,a=n.shape;if(Object.getOwnPropertySymbols(a).length&&M(e,r,t,o,"Symbol keys cannot be represented in JSON Schema"))return;t.type="object",t.properties={};for(let c in a)K(t.properties,c,E(a[c],r,{...o,path:[...o.path,"properties",c]}));let s=[];for(let c of Object.keys(a)){let l=n.shape[c];(r.io==="input"?Ir(l)===void 0:l._zod.optout===void 0)&&s.push(c)}s.length>0&&(t.required=s),n.catchall?._zod.def.type==="never"?t.additionalProperties=!1:n.catchall?n.catchall&&(t.additionalProperties=E(n.catchall,r,{...o,path:[...o.path,"additionalProperties"]})):r.io==="output"&&(t.additionalProperties=!1)},pi=(e,r,i,o)=>{let t=e._zod.def,n=t.inclusive===!1,a=t.options.map((u,s)=>E(u,r,{...o,path:[...o.path,n?"oneOf":"anyOf",s]}));n?i.oneOf=a:i.anyOf=a},qc=(e,r,i,o)=>{let t=e._zod.def,n=E(t.left,r,{...o,path:[...o.path,"allOf",0]}),a=E(t.right,r,{...o,path:[...o.path,"allOf",1]}),u=c=>"allOf"in c&&Object.keys(c).length===1,s=[...u(n)?n.allOf:[n],...u(a)?a.allOf:[a]];i.allOf=s,r.intersections.push(s)},Yc=(e,r,i,o)=>{let t=i,n=e._zod.def;t.type="array";let a=r.target==="draft-2020-12"?"prefixItems":"items",u=r.target==="draft-2020-12"||r.target==="openapi-3.0"?"items":"additionalItems",s=n.items.map((_,k)=>E(_,r,{...o,path:[...o.path,a,k]})),c=n.rest?E(n.rest,r,{...o,path:[...o.path,u,...r.target==="openapi-3.0"?[n.items.length]:[]]}):null,l=n.items.length;for(;l>0;){let _=n.items[l-1];if(!(r.io==="input"?Ir(_)!==void 0:_._zod.optout==="optional"))break;l--}let d=n.items.length,f=!n.rest;r.target==="draft-2020-12"?(t.prefixItems=s,f?t.items=!1:c&&(t.items=c),l>0&&(t.minItems=l),f&&(t.maxItems=d)):r.target==="openapi-3.0"?(t.items={anyOf:s},c&&t.items.anyOf.push(c),l>0&&(t.minItems=l),f&&(t.maxItems=d)):(t.items=s,f?t.additionalItems=!1:c&&(t.additionalItems=c),l>0&&(t.minItems=l),f&&(t.maxItems=d));let{minimum:m,maximum:v}=J(e);typeof m=="number"&&(t.minItems=m),typeof v=="number"&&(t.maxItems=v)};function xc(e,r,i){if(r.$ref){if(i.has(r))return r;i.add(r);let v=e.get(r)?.def;if(!v)return r;let _=xc(e,v,i);return _===v?r:_}for(let v of["anyOf","oneOf"]){let _=r[v];if(!Array.isArray(_))continue;let k=_.map(z=>xc(e,z,i));k.some((z,I)=>z!==_[I])&&(r={...r,[v]:k})}let o=Array.isArray(r.type)?r.type:[r.type],t=!o.includes("string")&&o.some(v=>v==="number"||v==="integer"),n=r.enum??(r.const!==void 0?[r.const]:void 0);if(!t&&!n?.some(v=>typeof v=="number"))return r;let{minimum:a,maximum:u,exclusiveMinimum:s,exclusiveMaximum:c,multipleOf:l,format:d,id:f,...m}=r;return m.enum?m.enum=m.enum.map(v=>typeof v=="number"?String(v):v):typeof m.const=="number"&&(m.const=String(m.const)),t&&(m.type="string",n||(m.pattern=(o.includes("number")?be:tr).source)),m}var Ic=new WeakMap;function Th(e){let r=new Map;for(let o of e.seen.values())o.def&&!r.has(o.schema)&&r.set(o.schema,o);let i=new Map;for(let o of Ic.get(e)??[]){let t=e.seen.get(o),n=(t?.def??t?.schema)?.propertyNames;if(!n||n===!0||i.has(n))continue;let a=xc(r,n,new Set);a!==n&&i.set(n,a)}if(i.size)for(let o of e.seen.values())for(let t of[o.schema,o.def]){let n=t&&i.get(t.propertyNames);n&&(t.propertyNames=n)}}var Hc=(e,r,i,o)=>{let t=i,n=e._zod.def;t.type="object";let a=n.keyType,u=J(a).patterns;if(n.mode==="loose"&&u&&u.size>0){let l=E(n.valueType,r,{...o,path:[...o.path,"patternProperties","*"]});t.patternProperties={};for(let d of u)K(t.patternProperties,Vf(d).source,l)}else{if(r.target==="draft-07"||r.target==="draft-2020-12"){t.propertyNames=E(n.keyType,r,{...o,path:[...o.path,"propertyNames"]});let l=Ic.get(r);l||(l=[],Ic.set(r,l),r.deferred.push(()=>Th(r))),l.push(e)}t.additionalProperties=E(n.valueType,r,{...o,path:[...o.path,"additionalProperties"]})}let s=a._zod.values,c=r.io==="input"&&Ir(n.valueType)!==void 0;if(s&&!n.partial&&!c){let l=[...s].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(t.required=l.map(String))}},Qc=(e,r,i,o)=>{let t=e._zod.def,n=E(t.innerType,r,o),a=r.seen.get(e);r.target==="openapi-3.0"?(a.ref=t.innerType,i.nullable=!0):i.anyOf=[n,{type:"null"}]},es=(e,r,i,o)=>{let t=e._zod.def;E(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType},ts=Symbol();function Rf(e,r,i,o,t){let n=!1,a=JSON.stringify(e,(u,s)=>typeof s!="bigint"?s:(n=!0,null));return n?(M(r,i,o,t,"BigInt defaults cannot be represented in JSON Schema"),ts):JSON.parse(a)}var rs=(e,r,i,o)=>{let t=e._zod.def;E(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType;let a=Rf(t.defaultValue,e,r,i,o);a!==ts&&(i.default=a)},ns=(e,r,i,o)=>{let t=e._zod.def;E(t.innerType,r,o);let n=r.seen.get(e);if(n.ref=t.innerType,r.io!=="input")return;let a=Rf(t.defaultValue,e,r,i,o);a!==ts&&(i._prefault=a)},is=(e,r,i,o)=>{let t=e._zod.def;E(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType;let a;try{a=t.catchValue(void 0)}catch{M(e,r,i,o,"Dynamic catch values are not supported in JSON Schema");return}i.default=a},os=(e,r,i,o)=>{let t=e._zod.def,n=t.in._zod.traits.has("$ZodTransform"),a=r.io==="input"?n?t.out:t.in:t.out;E(a,r,o);let u=r.seen.get(e);u.ref=a},as=(e,r,i,o)=>{let t=e._zod.def;E(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType,i.readOnly=!0},us=(e,r,i,o)=>{let t=e._zod.def;E(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType},gi=(e,r,i,o)=>{let t=e._zod.def;E(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType},cs=(e,r,i,o)=>{let t=e._zod.innerType;E(t,r,o);let n=r.seen.get(e);n.ref=t},mi={string:wc,number:zc,boolean:Sc,bigint:Pc,symbol:Dc,null:jc,undefined:Oc,void:Nc,never:Uc,any:Ac,unknown:Tc,date:Zc,enum:Ec,literal:Cc,nan:Lc,template_literal:Vc,file:Rc,success:Fc,custom:Mc,function:Jc,transform:Bc,map:Kc,set:Gc,array:Wc,object:Xc,union:pi,intersection:qc,tuple:Yc,record:Hc,nullable:Qc,nonoptional:es,default:rs,prefault:ns,catch:is,pipe:os,readonly:as,promise:us,optional:gi,lazy:cs};function vi(e,r){if("_idmap"in e){let o=e,t=De({...r,processors:mi}),n={};for(let s of o._idmap.entries()){let[c,l]=s;E(l,t)}let a={},u={registry:o,uri:r?.uri,defs:n};t.external=u;for(let s of o._idmap.entries()){let[c,l]=s;je(t,l),K(a,c,Oe(t,l))}if(Object.keys(n).length>0){let s=t.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[s]:n}}return{schemas:a}}let i=De({...r,processors:mi});return E(e,i),je(i,e),Oe(i,e)}var $i=class{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(r){this.ctx.counter=r}get seen(){return this.ctx.seen}constructor(r){let i=r?.target??"draft-2020-12";i==="draft-4"&&(i="draft-04"),i==="draft-7"&&(i="draft-07"),this.ctx=De({processors:mi,target:i,...r?.metadata&&{metadata:r.metadata},...r?.unrepresentable&&{unrepresentable:r.unrepresentable},...r?.override&&{override:r.override},...r?.io&&{io:r.io}})}process(r,i={path:[],schemaPath:[]}){return E(r,this.ctx,i)}emit(r,i){i&&(i.cycles&&(this.ctx.cycles=i.cycles),i.reused&&(this.ctx.reused=i.reused),i.external&&(this.ctx.external=i.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,je(this.ctx,r);let o=Oe(this.ctx,r),{"~standard":t,...n}=o;return n}};var Ff={};var Lt={};he(Lt,{ZodAny:()=>js,ZodArray:()=>As,ZodBase64:()=>Zi,ZodBase64URL:()=>Ei,ZodBigInt:()=>Et,ZodBigIntFormat:()=>Vi,ZodBoolean:()=>Zt,ZodCIDRv4:()=>Ai,ZodCIDRv6:()=>Ti,ZodCUID:()=>Si,ZodCUID2:()=>Pi,ZodCatch:()=>tl,ZodCodec:()=>Ar,ZodCreditCard:()=>ks,ZodCustom:()=>Tr,ZodCustomStringFormat:()=>Qe,ZodDate:()=>Pr,ZodDefault:()=>Xs,ZodDiscriminatedUnion:()=>Zs,ZodE164:()=>Ci,ZodEmail:()=>xi,ZodEmoji:()=>wi,ZodEnum:()=>Ut,ZodExactOptional:()=>Ji,ZodFile:()=>Bs,ZodFunction:()=>dl,ZodGUID:()=>Ii,ZodIBAN:()=>xs,ZodIPv4:()=>Ni,ZodIPv6:()=>Ui,ZodISODate:()=>Ue,ZodISODateTime:()=>Ne,ZodISODuration:()=>Te,ZodISOTime:()=>Ae,ZodInstanceOf:()=>pl,ZodIntersection:()=>Es,ZodJWT:()=>Li,ZodKSUID:()=>Oi,ZodLazy:()=>cl,ZodLiteral:()=>Js,ZodMAC:()=>bs,ZodMap:()=>Fs,ZodNaN:()=>nl,ZodNanoID:()=>zi,ZodNever:()=>Ns,ZodNonOptional:()=>Bi,ZodNull:()=>Ps,ZodNullable:()=>Ws,ZodNumber:()=>Tt,ZodNumberFormat:()=>et,ZodObject:()=>jr,ZodOptional:()=>Nr,ZodPipe:()=>Ur,ZodPrefault:()=>Ys,ZodPreprocess:()=>il,ZodPromise:()=>ll,ZodReadonly:()=>ol,ZodRecord:()=>Nt,ZodSet:()=>Ms,ZodString:()=>At,ZodStringFormat:()=>C,ZodSuccess:()=>el,ZodSymbol:()=>zs,ZodTemplateLiteral:()=>ul,ZodTransform:()=>Ks,ZodTuple:()=>Ls,ZodType:()=>j,ZodULID:()=>Di,ZodURL:()=>Sr,ZodUUID:()=>$e,ZodUndefined:()=>Ss,ZodUnion:()=>Or,ZodUnknown:()=>Os,ZodVoid:()=>Us,ZodXID:()=>ji,ZodXor:()=>Ts,_ZodString:()=>ki,_default:()=>qs,_function:()=>ep,any:()=>Om,array:()=>Dr,base64:()=>dm,base64url:()=>fm,bigint:()=>zm,boolean:()=>ws,catch:()=>rl,check:()=>tp,cidrv4:()=>sm,cidrv6:()=>lm,codec:()=>qm,creditCard:()=>pm,cuid:()=>tm,cuid2:()=>rm,currencyCode:()=>_m,custom:()=>rp,date:()=>Um,describe:()=>np,discriminatedUnion:()=>Lm,e164:()=>mm,email:()=>Bf,emoji:()=>Qf,enum:()=>Fi,exactOptional:()=>Gs,file:()=>Km,float32:()=>km,float64:()=>xm,function:()=>ep,guid:()=>Kf,hash:()=>bm,hex:()=>ym,hostname:()=>hm,httpUrl:()=>Hf,iban:()=>gm,instanceof:()=>op,int:()=>_i,int32:()=>Im,int64:()=>Sm,intersection:()=>Cs,invertCodec:()=>Ym,ipv4:()=>am,ipv6:()=>cm,json:()=>up,jwt:()=>vm,keyof:()=>Am,ksuid:()=>om,lazy:()=>sl,literal:()=>Bm,looseObject:()=>Em,looseRecord:()=>Rm,mac:()=>um,map:()=>Fm,meta:()=>ip,nan:()=>Xm,nanoid:()=>em,nativeEnum:()=>Jm,never:()=>Ri,nonoptional:()=>Qs,null:()=>Ds,nullable:()=>zr,nullish:()=>Gm,number:()=>Is,object:()=>Tm,optional:()=>Ye,partialRecord:()=>Vm,pipe:()=>bi,prefault:()=>Hs,preprocess:()=>cp,promise:()=>Qm,readonly:()=>al,record:()=>Rs,refine:()=>fl,set:()=>Mm,strictObject:()=>Zm,string:()=>wr,stringFormat:()=>$m,stringbool:()=>ap,success:()=>Wm,superRefine:()=>ml,symbol:()=>Dm,templateLiteral:()=>Hm,transform:()=>Mi,tuple:()=>Vs,uint32:()=>wm,uint64:()=>Pm,ulid:()=>nm,undefined:()=>jm,union:()=>Ct,unknown:()=>qe,url:()=>Yf,uuid:()=>Gf,uuidv4:()=>Wf,uuidv6:()=>Xf,uuidv7:()=>qf,void:()=>Nm,xid:()=>im,xor:()=>Cm});var hi={};he(hi,{endsWith:()=>bt,gt:()=>ge,gte:()=>ue,includes:()=>yt,length:()=>We,lowercase:()=>$t,lt:()=>pe,lte:()=>ae,maxLength:()=>Ge,maxSize:()=>Pe,mime:()=>xt,minLength:()=>ke,minSize:()=>ve,multipleOf:()=>Se,negative:()=>si,nonnegative:()=>di,nonpositive:()=>li,normalize:()=>It,overwrite:()=>me,positive:()=>ci,properties:()=>kt,property:()=>fi,regex:()=>vt,size:()=>Ke,slugify:()=>Pt,startsWith:()=>_t,toLowerCase:()=>zt,toUpperCase:()=>St,trim:()=>wt,uppercase:()=>ht});var Mf=new WeakSet([Object.prototype,Error.prototype]);function yi(e,r,i){Object.defineProperty(e,r,{configurable:!0,enumerable:!1,get(){let o=i(this);return Object.defineProperty(this,r,{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,r,{value:o,configurable:!0,writable:!0})}})}var Jf=(e,r)=>{so.init(e,r),e.name="ZodError";let i=Object.getPrototypeOf(e);Mf.has(i)||(Mf.add(i),yi(i,"format",o=>t=>Yt(o,t)),yi(i,"flatten",o=>t=>qt(o,t)),yi(i,"addIssue",o=>t=>{o.issues.push(t),o.message=JSON.stringify(o.issues,nt,2)}),yi(i,"addIssues",o=>t=>{o.issues.push(...t),o.message=JSON.stringify(o.issues,nt,2)}),Object.defineProperty(i,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},Eh=p("ZodError",Jf),oe=p("ZodError",Jf,void 0,{Parent:Error});var ss=ut(oe),ls=ct(oe),ds=st(oe),fs=lt(oe),ms=Gr(oe),ps=Wr(oe),gs=Xr(oe),vs=qr(oe),$s=Yr(oe),hs=Hr(oe),ys=Qr(oe),_s=en(oe);function Lh(){B.localeError||F(Un())}function He(){B.memoizer||F({memoizer:gr()})}var j=p("ZodType",(e,r)=>(Lh(),P.init(e,r),e.def=r,e.type=r.type,e),{check(...e){let r=this.def;return this.clone($.mergeDefs(r,{checks:[...r.checks??[],...e.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,r){return T(this,e,r)},brand(){return this},register(e,r){return e.add(this,r),this},refine(e,r){return this.check(fl(e,r))},superRefine(e,r){return this.check(ml(e,r))},overwrite(e){return this.check(me(e))},optional(){return Ye(this)},exactOptional(){return Gs(this)},nullable(){return zr(this)},nullish(){return Ye(zr(this))},nonoptional(e){return Qs(this,e)},array(){return Dr(this)},or(e){return Ct([this,e])},and(e){return Cs(this,e)},transform(e){return bi(this,Mi(e))},default(e){return qs(this,e)},prefault(e){return Hs(this,e)},catch(e){return rl(this,e)},pipe(e){return bi(this,e)},readonly(){return al(this)},describe(e){let r=this.clone();return G.add(r,{description:e}),r},meta(...e){if(e.length===0)return G.get(this);let r=this.clone();return G.add(r,e[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...r){return r.length===0?e(this):e(this,...r)},get"~standard"(){return $.hide(this,"~standard",{...fn(this),jsonSchema:{input:Dt(this,"input"),output:Dt(this,"output")}})},set"~standard"(e){$.own(this,"~standard",e)},parse:function e(r,i){return ss(this,r,i,{callee:e})},parseAsync:async function e(r,i){return await ls(this,r,i,{callee:e})},safeParse(e,r){return ds(this,e,r)},async safeParseAsync(e,r){return fs(this,e,r)},get spa(){return this?.safeParseAsync},set spa(e){$.own(this,"spa",e)},validate(e,r){return Ht(this,e,r)},validateAsync(e,r){return Qt(this,e,r)},encode:function e(r,i){return ms(this,r,i,{callee:e})},decode:function e(r,i){return ps(this,r,i,{callee:e})},encodeAsync:async function e(r,i){return await gs(this,r,i,{callee:e})},decodeAsync:async function e(r,i){return await vs(this,r,i,{callee:e})},safeEncode(e,r){return $s(this,e,r)},safeDecode(e,r){return hs(this,e,r)},async safeEncodeAsync(e,r){return ys(this,e,r)},async safeDecodeAsync(e,r){return _s(this,e,r)},toJSONSchema(e){return kc(this,{})(e)},get description(){return G.get(this)?.description},get _def(){return this._zod.def}}),ki=p("_ZodString",(e,r)=>{Re.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>wc(e,i,o,t)},$.derived({format:e=>J(e).format??null,minLength:e=>J(e).minimum??null,maxLength:e=>J(e).maximum??null},{regex(...e){return this.check(vt(...e))},includes(...e){return this.check(yt(...e))},startsWith(...e){return this.check(_t(...e))},endsWith(...e){return this.check(bt(...e))},min(...e){return this.check(ke(...e))},max(...e){return this.check(Ge(...e))},length(...e){return this.check(We(...e))},nonempty(...e){return this.check(ke(1,...e))},lowercase(e){return this.check($t(e))},uppercase(e){return this.check(ht(e))},trim(){return this.check(wt())},normalize(...e){return this.check(It(...e))},toLowerCase(){return this.check(zt())},toUpperCase(){return this.check(St())},slugify(){return this.check(Pt())}})),At=p("ZodString",(e,r)=>{Re.init(e,r),ki.init(e,r)},{email(e){return this.check(Rn(xi,e))},url(e){return this.check(hr(Sr,e))},jwt(e){return this.check(ui(Li,e))},emoji(e){return this.check(Gn(wi,e))},guid(e){return this.check(Fn(Ii,e))},uuid(e){return this.check(Mn($e,e))},uuidv4(e){return this.check(Jn($e,e))},uuidv6(e){return this.check(Bn($e,e))},uuidv7(e){return this.check(Kn($e,e))},nanoid(e){return this.check(Wn(zi,e))},cuid(e){return this.check(Xn(Si,e))},cuid2(e){return this.check(qn(Pi,e))},ulid(e){return this.check(Yn(Di,e))},base64(e){return this.check(ii(Zi,e))},base64url(e){return this.check(oi(Ei,e))},xid(e){return this.check(Hn(ji,e))},ksuid(e){return this.check(Qn(Oi,e))},ipv4(e){return this.check(ei(Ni,e))},ipv6(e){return this.check(ti(Ui,e))},cidrv4(e){return this.check(ri(Ai,e))},cidrv6(e){return this.check(ni(Ti,e))},e164(e){return this.check(ai(Ci,e))},datetime(e){return this.check(yr(Ne,e))},date(e){return this.check(_r(Ue,e))},time(e){return this.check(br(Ae,e))},duration(e){return this.check(kr(Te,e))}});function wr(e){return Cu(At,e)}var C=p("ZodStringFormat",(e,r)=>{Z.init(e,r),ki.init(e,r)}),Ne=p("ZodISODateTime",(e,r)=>{ja.init(e,r),C.init(e,r)}),Ue=p("ZodISODate",(e,r)=>{Oa.init(e,r),C.init(e,r)}),Ae=p("ZodISOTime",(e,r)=>{Na.init(e,r),C.init(e,r)}),Te=p("ZodISODuration",(e,r)=>{Ua.init(e,r),C.init(e,r)}),xi=p("ZodEmail",(e,r)=>{ya.init(e,r),C.init(e,r)});function Bf(e){return Rn(xi,e)}var Ii=p("ZodGUID",(e,r)=>{$a.init(e,r),C.init(e,r)});function Kf(e){return Fn(Ii,e)}var $e=p("ZodUUID",(e,r)=>{ha.init(e,r),C.init(e,r)});function Gf(e){return Mn($e,e)}function Wf(e){return Jn($e,e)}function Xf(e){return Bn($e,e)}function qf(e){return Kn($e,e)}var Sr=p("ZodURL",(e,r)=>{ka.init(e,r),C.init(e,r)});function Yf(e){return hr(Sr,e)}function Hf(e){return hr(Sr,{protocol:er,hostname:Uo,...$.normalizeParams(e)})}var wi=p("ZodEmoji",(e,r)=>{xa.init(e,r),C.init(e,r)});function Qf(e){return Gn(wi,e)}var zi=p("ZodNanoID",(e,r)=>{Ia.init(e,r),C.init(e,r)});function em(e){return Wn(zi,e)}var Si=p("ZodCUID",(e,r)=>{wa.init(e,r),C.init(e,r)});function tm(e){return Xn(Si,e)}var Pi=p("ZodCUID2",(e,r)=>{za.init(e,r),C.init(e,r)});function rm(e){return qn(Pi,e)}var Di=p("ZodULID",(e,r)=>{Sa.init(e,r),C.init(e,r)});function nm(e){return Yn(Di,e)}var ji=p("ZodXID",(e,r)=>{Pa.init(e,r),C.init(e,r)});function im(e){return Hn(ji,e)}var Oi=p("ZodKSUID",(e,r)=>{Da.init(e,r),C.init(e,r)});function om(e){return Qn(Oi,e)}var Ni=p("ZodIPv4",(e,r)=>{Aa.init(e,r),C.init(e,r)});function am(e){return ei(Ni,e)}var bs=p("ZodMAC",(e,r)=>{Za.init(e,r),C.init(e,r)});function um(e){return Vu(bs,e)}var Ui=p("ZodIPv6",(e,r)=>{Ta.init(e,r),C.init(e,r)});function cm(e){return ti(Ui,e)}var Ai=p("ZodCIDRv4",(e,r)=>{Ea.init(e,r),C.init(e,r)});function sm(e){return ri(Ai,e)}var Ti=p("ZodCIDRv6",(e,r)=>{Ca.init(e,r),C.init(e,r)});function lm(e){return ni(Ti,e)}var Zi=p("ZodBase64",(e,r)=>{La.init(e,r),C.init(e,r)});function dm(e){return ii(Zi,e)}var Ei=p("ZodBase64URL",(e,r)=>{Va.init(e,r),C.init(e,r)});function fm(e){return oi(Ei,e)}var Ci=p("ZodE164",(e,r)=>{Ra.init(e,r),C.init(e,r)});function mm(e){return ai(Ci,e)}var ks=p("ZodCreditCard",(e,r)=>{Fa.init(e,r),C.init(e,r)});function pm(e){return Ru(ks,e)}var xs=p("ZodIBAN",(e,r)=>{Ma.init(e,r),C.init(e,r)});function gm(e){return Fu(xs,e)}var Li=p("ZodJWT",(e,r)=>{Ja.init(e,r),C.init(e,r)});function vm(e){return ui(Li,e)}var Qe=p("ZodCustomStringFormat",(e,r)=>{Ba.init(e,r),C.init(e,r)});function $m(e,r,i={}){return Xe(Qe,e,r,i)}function hm(e){return Xe(Qe,"hostname",No,e)}function ym(e){return Xe(Qe,"hex",Go,e)}function _m(e){return Xe(Qe,"currency_code",To,e)}function bm(e,r){let i=r?.enc??"hex",o=`${e}_${i}`,t=le[o];if(!t)throw new Error(`Unrecognized hash format: ${o}`);return Xe(Qe,o,t,r)}var Tt=p("ZodNumber",(e,r)=>{kn.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>zc(e,i,o,t),e.isFinite=!0},$.derived({minValue:e=>{let{minimum:r,exclusiveMinimum:i}=J(e);return Math.max(r??Number.NEGATIVE_INFINITY,i??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:r,exclusiveMaximum:i}=J(e);return Math.min(r??Number.POSITIVE_INFINITY,i??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:r,multipleOf:i}=J(e);return!!r||!!i?.some(Number.isSafeInteger)},format:e=>J(e).format??null},{gt(e,r){return this.check(ge(e,r))},gte(e,r){return this.check(ue(e,r))},min(e,r){return this.check(ue(e,r))},lt(e,r){return this.check(pe(e,r))},lte(e,r){return this.check(ae(e,r))},max(e,r){return this.check(ae(e,r))},int(e){return this.check(_i(e))},safe(e){return this.check(_i(e))},positive(e){return this.check(ge(0,e))},nonnegative(e){return this.check(ue(0,e))},negative(e){return this.check(pe(0,e))},nonpositive(e){return this.check(ae(0,e))},multipleOf(e,r){return this.check(Se(e,r))},step(e,r){return this.check(Se(e,r))},finite(){return this}}));function Is(e){return Ju(Tt,e)}var et=p("ZodNumberFormat",(e,r)=>{Ka.init(e,r),Tt.init(e,r)});function _i(e){return Ku(et,e)}function km(e){return Gu(et,e)}function xm(e){return Wu(et,e)}function Im(e){return Xu(et,e)}function wm(e){return qu(et,e)}var Zt=p("ZodBoolean",(e,r)=>{sr.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Sc(e,i,o,t)});function ws(e){return Yu(Zt,e)}var Et=p("ZodBigInt",(e,r)=>{xn.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Pc(e,i,o,t)},$.derived({minValue:e=>J(e).minimum??null,maxValue:e=>J(e).maximum??null,format:e=>J(e).format??null},{gte(e,r){return this.check(ue(e,r))},min(e,r){return this.check(ue(e,r))},gt(e,r){return this.check(ge(e,r))},lt(e,r){return this.check(pe(e,r))},lte(e,r){return this.check(ae(e,r))},max(e,r){return this.check(ae(e,r))},positive(e){return this.check(ge(BigInt(0),e))},negative(e){return this.check(pe(BigInt(0),e))},nonpositive(e){return this.check(ae(BigInt(0),e))},nonnegative(e){return this.check(ue(BigInt(0),e))},multipleOf(e,r){return this.check(Se(e,r))}}));function zm(e){return Qu(Et,e)}var Vi=p("ZodBigIntFormat",(e,r)=>{Ga.init(e,r),Et.init(e,r)});function Sm(e){return tc(Vi,e)}function Pm(e){return rc(Vi,e)}var zs=p("ZodSymbol",(e,r)=>{Wa.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Dc(e,i,o,t)});function Dm(e){return nc(zs,e)}var Ss=p("ZodUndefined",(e,r)=>{Xa.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Oc(e,i,o,t)});function jm(e){return ic(Ss,e)}var Ps=p("ZodNull",(e,r)=>{qa.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>jc(e,i,o,t)});function Ds(e){return oc(Ps,e)}var js=p("ZodAny",(e,r)=>{Ya.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Ac(e,i,o,t)});function Om(){return ac(js)}var Os=p("ZodUnknown",(e,r)=>{Ha.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Tc(e,i,o,t)});function qe(){return uc(Os)}var Ns=p("ZodNever",(e,r)=>{Qa.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Uc(e,i,o,t)});function Ri(e){return cc(Ns,e)}var Us=p("ZodVoid",(e,r)=>{eu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Nc(e,i,o,t)});function Nm(e){return sc(Us,e)}var Pr=p("ZodDate",(e,r)=>{tu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Zc(e,i,o,t),e.min=(i,o)=>e.check(ue(i,o)),e.max=(i,o)=>e.check(ae(i,o))},$.derived({minDate:e=>{let{minimum:r}=J(e);return r?new Date(r):null},maxDate:e=>{let{maximum:r}=J(e);return r?new Date(r):null}},{}));function Um(e){return lc(Pr,e)}var As=p("ZodArray",(e,r)=>{He(),ru.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Wc(e,i,o,t),e.element=r.element},{min(e,r){return this.check(ke(e,r))},nonempty(e){return this.check(ke(1,e))},max(e,r){return this.check(Ge(e,r))},length(e,r){return this.check(We(e,r))},unwrap(){return this.element}});function Dr(e,r){return mc(As,e,r)}function Am(e){let r=e._zod.def.shape;return Fi(Object.keys(r))}var jr=p("ZodObject",(e,r)=>{He(),nu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Xc(e,i,o,t),$.installLazyProp(e,"shape",i=>i._zod.def.shape,!1)},{keyof(){return Fi(Object.keys(this._zod.def.shape))},catchall(e){return this.clone($.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone($.mergeDefs(this._zod.def,{catchall:qe()}))},loose(){return this.clone($.mergeDefs(this._zod.def,{catchall:qe()}))},strict(){return this.clone($.mergeDefs(this._zod.def,{catchall:Ri()}))},strip(){return this.clone($.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return $.extend(this,e)},safeExtend(e){return $.safeExtend(this,e)},merge(e){return $.merge(this,e)},pick(e){return $.pick(this,e)},omit(e){return $.omit(this,e)},partial(...e){return $.partial(Nr,this,e[0])},exactPartial(...e){return $.partial(Ji,this,e[0],"exactPartial")},required(...e){return $.required(Bi,this,e[0])}});function Tm(e,r){let i={type:"object",shape:e??{},...$.normalizeParams(r)};return new jr(i)}function Zm(e,r){return new jr({type:"object",shape:e,catchall:Ri(),...$.normalizeParams(r)})}function Em(e,r){return new jr({type:"object",shape:e,catchall:qe(),...$.normalizeParams(r)})}var Or=p("ZodUnion",(e,r)=>{lr.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>pi(e,i,o,t),e.options=r.options});function Ct(e,r){return new Or({type:"union",options:e,...$.normalizeParams(r)})}var Ts=p("ZodXor",(e,r)=>{Or.init(e,r),iu.init(e,r),e._zod.processJSONSchema=(i,o,t)=>pi(e,i,o,t),e.options=r.options});function Cm(e,r){return new Ts({type:"union",options:e,inclusive:!1,...$.normalizeParams(r)})}var Zs=p("ZodDiscriminatedUnion",(e,r)=>{Or.init(e,r),au.init(e,r)});function Lm(e,r,i){return new Zs({type:"union",options:r,discriminator:e,...$.normalizeParams(i)})}var Es=p("ZodIntersection",(e,r)=>{uu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>qc(e,i,o,t)});function Cs(e,r){return new Es({type:"intersection",left:e,right:r})}var Ls=p("ZodTuple",(e,r)=>{He(),In.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Yc(e,i,o,t)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(r=>new Nr({type:"optional",innerType:r}))})}});function Vs(e,r,i){let o=r instanceof P,t=o?i:r,n=o?r:null;return new Ls({type:"tuple",items:e,rest:n,...$.normalizeParams(t)})}var Nt=p("ZodRecord",(e,r)=>{He(),cu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Hc(e,i,o,t),e.keyType=r.keyType,e.valueType=r.valueType});function Rs(e,r,i){return!r||!r._zod?new Nt({type:"record",keyType:wr(),valueType:e,...$.normalizeParams(r)}):new Nt({type:"record",keyType:e,valueType:r,...$.normalizeParams(i)})}function Vm(e,r,i){return new Nt({type:"record",keyType:e,valueType:r,...$.normalizeParams(i),partial:!0})}function Rm(e,r,i){return new Nt({type:"record",keyType:e,valueType:r,mode:"loose",...$.normalizeParams(i)})}var Fs=p("ZodMap",(e,r)=>{He(),su.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Kc(e,i,o,t),e.keyType=r.keyType,e.valueType=r.valueType,e.min=(...i)=>e.check(ve(...i)),e.nonempty=i=>e.check(ve(1,i)),e.max=(...i)=>e.check(Pe(...i)),e.size=(...i)=>e.check(Ke(...i))});function Fm(e,r,i){return new Fs({type:"map",keyType:e,valueType:r,...$.normalizeParams(i)})}var Ms=p("ZodSet",(e,r)=>{He(),lu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Gc(e,i,o,t),e.min=(...i)=>e.check(ve(...i)),e.nonempty=i=>e.check(ve(1,i)),e.max=(...i)=>e.check(Pe(...i)),e.size=(...i)=>e.check(Ke(...i))});function Mm(e,r){return new Ms({type:"set",valueType:e,...$.normalizeParams(r)})}var Ut=p("ZodEnum",(e,r)=>{du.init(e,r),j.init(e,r),e._zod.processJSONSchema=(o,t,n)=>Ec(e,o,t,n),e.enum=r.entries,e.options=[...e._zod.values];let i=new Set(Object.keys(r.entries));e.extract=(o,t)=>{let n={};for(let a of o)if(i.has(a))n[a]=r.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Ut({...r,checks:[],...$.normalizeParams(t),entries:n})},e.exclude=(o,t)=>{let n={...r.entries};for(let a of o)if(i.has(a))delete n[a];else throw new Error(`Key ${a} not found in enum`);return new Ut({...r,checks:[],...$.normalizeParams(t),entries:n})}});function Fi(e,r){let i=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new Ut({type:"enum",entries:i,...$.normalizeParams(r)})}function Jm(e,r){return new Ut({type:"enum",entries:e,...$.normalizeParams(r)})}var Js=p("ZodLiteral",(e,r)=>{fu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Cc(e,i,o,t),e.values=new Set(r.values),Object.defineProperty(e,"value",{get(){if(r.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return r.values[0]}})});function Bm(e,r){return new Js({type:"literal",values:Array.isArray(e)?e:[e],...$.normalizeParams(r)})}var Bs=p("ZodFile",(e,r)=>{mu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Rc(e,i,o,t),e.min=(i,o)=>e.check(ve(i,o)),e.max=(i,o)=>e.check(Pe(i,o)),e.mime=(i,o)=>e.check(xt(Array.isArray(i)?i:[i],o))});function Km(e){return pc(Bs,e)}var Ks=p("ZodTransform",(e,r)=>{He(),pu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Bc(e,i,o,t),e._zod.parse=(i,o)=>{if(o.direction==="backward")throw new ze(e.constructor.name);i.addIssue=n=>{if(typeof n=="string")i.issues.push($.issue(n,i.value,r));else{let a=n;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),"input"in a||(a.input=i.value),a.inst??(a.inst=e),i.issues.push($.issue(a))}};let t=r.transform(i.value,i);return t instanceof Promise?t.then(n=>(i.value=n,i)):(i.value=t,i)}});function Mi(e){return new Ks({type:"transform",transform:e})}var Nr=p("ZodOptional",(e,r)=>{wn.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>gi(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Ye(e){return new Nr({type:"optional",innerType:e})}var Ji=p("ZodExactOptional",(e,r)=>{gu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>gi(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Gs(e){return new Ji({type:"optional",innerType:e})}var Ws=p("ZodNullable",(e,r)=>{vu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Qc(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function zr(e){return new Ws({type:"nullable",innerType:e})}function Gm(e){return Ye(zr(e))}var Xs=p("ZodDefault",(e,r)=>{$u.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>rs(e,i,o,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function qs(e,r){return new Xs({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():$.shallowClone(r)}})}var Ys=p("ZodPrefault",(e,r)=>{hu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>ns(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Hs(e,r){return new Ys({type:"prefault",innerType:e,get defaultValue(){return typeof r=="function"?r():$.shallowClone(r)}})}var Bi=p("ZodNonOptional",(e,r)=>{yu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>es(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Qs(e,r){return new Bi({type:"nonoptional",innerType:e,...$.normalizeParams(r)})}var el=p("ZodSuccess",(e,r)=>{_u.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Fc(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Wm(e){return new el({type:"success",innerType:e})}var tl=p("ZodCatch",(e,r)=>{bu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>is(e,i,o,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function rl(e,r){return new tl({type:"catch",innerType:e,catchValue:typeof r=="function"?r:$.constantCatch(r)})}var nl=p("ZodNaN",(e,r)=>{ku.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Lc(e,i,o,t)});function Xm(e){return fc(nl,e)}var Ur=p("ZodPipe",(e,r)=>{zn.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>os(e,i,o,t),e.in=r.in,e.out=r.out});function bi(e,r){return new Ur({type:"pipe",in:e,out:r})}var Ar=p("ZodCodec",(e,r)=>{Ur.init(e,r),dr.init(e,r)});function qm(e,r,i){return new Ar({type:"pipe",in:e,out:r,transform:i.decode,reverseTransform:i.encode})}function Ym(e){let r=e._zod.def;return new Ar({type:"pipe",in:r.out,out:r.in,transform:r.reverseTransform,reverseTransform:r.transform})}var il=p("ZodPreprocess",(e,r)=>{Ur.init(e,r),xu.init(e,r)}),ol=p("ZodReadonly",(e,r)=>{Iu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>as(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function al(e){return new ol({type:"readonly",innerType:e})}var ul=p("ZodTemplateLiteral",(e,r)=>{wu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Vc(e,i,o,t)});function Hm(e,r){return new ul({type:"template_literal",parts:e,...$.normalizeParams(r)})}var cl=p("ZodLazy",(e,r)=>{fr.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>cs(e,i,o,t),e.unwrap=()=>e._zod.def.getter()});function sl(e){return new cl({type:"lazy",getter:e})}var ll=p("ZodPromise",(e,r)=>{Su.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>us(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Qm(e){return new ll({type:"promise",innerType:e})}var dl=p("ZodFunction",(e,r)=>{zu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Jc(e,i,o,t)});function ep(e){return new dl({type:"function",input:Array.isArray(e?.input)?Vs(e?.input):e?.input??Dr(qe()),output:e?.output??qe()})}var Tr=p("ZodCustom",(e,r)=>{Pu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Mc(e,i,o,t)});function tp(e){let r=new L({check:"custom"});return r._zod.check=e,r}function rp(e,r){return gc(Tr,e??(()=>!0),r)}function fl(e,r={}){return vc(Tr,e,r)}function ml(e,r){return $c(e,r)}var np=hc,ip=yc,pl=p("ZodInstanceOf",(e,r)=>{Tr.init(e,r)},{properties(e,r){return this.check(kt(e,r))}});function op(e,r={}){let i=new pl({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...$.normalizeParams(r)});return i._zod.bag.Class=e,i._zod.check=o=>{o.value instanceof e||o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:i,path:[...i._zod.def.path??[]]})},i}var ap=(...e)=>_c({Codec:Ar,Boolean:Zt,String:At},...e);function up(e){let r=sl(()=>Ct([wr(e),Is(),ws(),Ds(),Dr(r),Rs(wr(),r)]));return r}function cp(e,r){return new il({type:"pipe",in:Mi(e),out:r})}var Vh={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function Rh(e){F({customError:e})}function Fh(){return F().customError}var gl;gl||(gl={});var Zr={};he(Zr,{ZodISODate:()=>Ue,ZodISODateTime:()=>Ne,ZodISODuration:()=>Te,ZodISOTime:()=>Ae,date:()=>Jh,datetime:()=>Mh,duration:()=>Kh,time:()=>Bh});function Mh(e){return yr(Ne,e)}function Jh(e){return _r(Ue,e)}function Bh(e){return br(Ae,e)}function Kh(e){return kr(Te,e)}var x={...Lt,...hi,iso:Zr},Gh=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function Wh(e,r){let i=e.$schema;return i==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":i==="http://json-schema.org/draft-07/schema#"?"draft-7":i==="http://json-schema.org/draft-04/schema#"?"draft-4":r??"draft-2020-12"}function sp(e,r){return e.map((i,o)=>o<r?i:i.optional())}function Xh(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function qh(e,r){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let i=e.slice(1).split("/").filter(Boolean);if(i.length===0)return r.rootSchema;let o=r.version==="draft-2020-12"?"$defs":"definitions";if(i[0]===o){let t=i[1]===void 0?void 0:Xh(i[1]);if(!t||!r.defs[t])throw new Error(`Reference not found: ${e}`);return r.defs[t]}throw new Error(`Reference not found: ${e}`)}function Yh(e,r){return x.transform(o=>o).check(o=>{let t=o.value;if(typeof t!="object"||t===null||Array.isArray(t))return;let n=Object.getOwnPropertyNames(t);if(r.minProperties!==void 0&&n.length<r.minProperties&&o.issues.push({origin:"object",code:"too_small",minimum:r.minProperties,inclusive:!0,message:`Too small: expected object to have >=${r.minProperties} properties`,input:t,inst:e,continue:!0}),r.maxProperties!==void 0&&n.length>r.maxProperties&&o.issues.push({origin:"object",code:"too_big",maximum:r.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${r.maxProperties} properties`,input:t,inst:e,continue:!0}),r.keySchema)for(let a of n){let u=r.keySchema.safeParse(a);u.success||o.issues.push({code:"invalid_key",origin:"record",issues:u.error.issues,input:a,path:[a],continue:!0})}}).pipe(e)}function vl(e,r){if(e===null)return"z";let i=typeof e;if(i!=="object"){if(i==="number"&&Number.isNaN(e))return null;let o=String(e);return`${i[0]}${o.length}:${o}`}if(r.has(e))return null;r.add(e);try{if(Array.isArray(e)){let n=[];for(let a of e){let u=vl(a,r);if(u===null)return null;n.push(u)}return`a${n.length}:[${n.join(",")}]`}let o=Object.keys(e).sort(),t=[];for(let n of o){let a=vl(e[n],r);if(a===null)return null;t.push(`${n.length}:${n}=${a}`)}return`o${t.length}:{${t.join(",")}}`}finally{r.delete(e)}}var Hh=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),Qh=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);function Er(e){return typeof e!="object"||e===null?!1:Array.isArray(e)?e.some(Er):typeof e.$ref=="string"?!0:Object.entries(e).some(([r,i])=>Hh.has(r)?Er(i):!Qh.has(r)||typeof i!="object"||i===null?!1:Object.values(i).some(Er))}function lp(e){return e===1?"element":"elements"}function ey(e,r){return x.transform(o=>o).check(o=>{let t=o.value;if(Array.isArray(t)){if(r.uniqueItems===!0){let n=new Map;for(let a=0;a<t.length;a++){let u=vl(t[a],new Set);if(u===null)continue;let s=n.get(u);if(s===void 0){n.set(u,a);continue}o.issues.push({code:"custom",message:`Array items must be unique: element at index ${a} duplicates the one at index ${s}`,input:t,path:[a],continue:!0})}}if(r.containsSchema){let n=r.minContains??1,a=r.maxContains!==void 0?r.maxContains+1:Number.POSITIVE_INFINITY,u=0;for(let s of t)if(r.containsSchema.safeParse(s).success&&++u>=a)break;u<n&&o.issues.push({code:"custom",message:`Array must contain at least ${n} matching ${lp(n)}; found ${u}`,input:t,continue:!0}),r.maxContains!==void 0&&u>r.maxContains&&o.issues.push({code:"custom",message:`Array must contain at most ${r.maxContains} matching ${lp(r.maxContains)}`,input:t,continue:!0})}}}).pipe(e)}function dp(e,r){if(e!==!1)return e===void 0||e===!0?x.any():ee(e,r)}var ty=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function fp(e,r){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return x.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let t=e.$ref;if(r.refs.has(t))return r.refs.get(t);if(r.processing.has(t))return x.lazy(()=>{if(!r.refs.has(t))throw new Error(`Circular reference not resolved: ${t}`);return r.refs.get(t)});r.processing.add(t);let n=qh(t,r),a=ee(n,r);return r.refs.set(t,a),r.processing.delete(t),a}if(e.enum!==void 0){let t=e.enum;if(r.version==="openapi-3.0"&&e.nullable===!0&&t.length===1&&t[0]===null)return x.null();if(t.length===0)return x.never();if(t.length===1)return x.literal(t[0]);if(t.every(a=>typeof a=="string"))return x.enum(t);let n=t.map(a=>x.literal(a));return n.length<2?n[0]:x.union([n[0],n[1],...n.slice(2)])}if(e.const!==void 0)return x.literal(e.const);let i=e.type;if(Array.isArray(i)){let t=i.map(n=>{let a={...e,type:n};return fp(a,r)});return t.length===0?x.never():t.length===1?t[0]:x.union(t)}if(!i)return x.any();let o;switch(i){case"string":{let t=x.string();if(e.format){let n=e.format;n==="email"?t=t.check(x.email()):n==="uri"||n==="uri-reference"?t=t.check(x.url()):n==="uuid"||n==="guid"?t=t.check(x.uuid()):n==="date-time"?t=t.check(x.iso.datetime({offset:!0})):n==="date"?t=t.check(x.iso.date()):n==="time"?t=t.check(x.regex(ty)):n==="duration"?t=t.check(x.iso.duration()):n==="hostname"?t=t.check(x.hostname()):n==="ipv4"?t=t.check(x.ipv4()):n==="ipv6"?t=t.check(x.ipv6()):n==="mac"?t=t.check(x.mac()):n==="cidr"?t=t.check(x.cidrv4()):n==="cidr-v6"?t=t.check(x.cidrv6()):n==="base64"?t=t.check(x.base64()):n==="base64url"?t=t.check(x.base64url()):n==="e164"?t=t.check(x.e164()):n==="credit_card"?t=t.check(x.creditCard()):n==="iban"?t=t.check(x.iban()):n==="jwt"?t=t.check(x.jwt()):n==="emoji"?t=t.check(x.emoji()):n==="nanoid"?t=t.check(x.nanoid()):n==="cuid"?t=t.check(x.cuid()):n==="cuid2"?t=t.check(x.cuid2()):n==="ulid"?t=t.check(x.ulid()):n==="xid"?t=t.check(x.xid()):n==="ksuid"&&(t=t.check(x.ksuid()))}typeof e.minLength=="number"&&(t=t.min(e.minLength)),typeof e.maxLength=="number"&&(t=t.max(e.maxLength)),e.pattern&&(t=t.regex(new RegExp(e.pattern))),o=t;break}case"number":case"integer":{let t=i==="integer"?x.number().int():x.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(t=t.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(t=t.max(e.maximum)),typeof e.exclusiveMinimum=="number"?t=t.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(t=t.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?t=t.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(t=t.lt(e.maximum)),typeof e.multipleOf=="number"&&(t=t.multipleOf(e.multipleOf)),o=t;break}case"boolean":{o=x.boolean();break}case"null":{o=x.null();break}case"object":{let t={},n=e.properties||{},a=new Set(e.required||[]),u=typeof e.additionalProperties=="object"?ee(e.additionalProperties,r):void 0;for(let[d,f]of Object.entries(n)){let m=ee(f,r);K(t,d,a.has(d)?m:m.optional())}if(e.patternProperties){let d=e.patternProperties,f=Object.keys(d),m=[];for(let _ of f){let k=ee(d[_],r),z=x.string().regex(new RegExp(_));m.push(x.looseRecord(z,k))}let v=[];if(Object.keys(t).length>0&&v.push(x.object(t).passthrough()),v.push(...m),v.length===0)o=x.object({}).passthrough();else if(v.length===1)o=v[0];else{let _=x.intersection(v[0],v[1]);for(let k=2;k<v.length;k++)_=x.intersection(_,v[k]);o=_}if(e.additionalProperties===!1){let _=Object.keys(t),k=f.map(I=>new RegExp(I)),z=o;o=o.check(I=>{if(!ce(I.value))return;let D=[];for(let A of Object.keys(I.value))_.includes(A)||k.some(V=>V.test(A))||D.push(A);D.length&&I.issues.push({code:"unrecognized_keys",keys:D,input:I.value,inst:z})})}}else{let d=x.object(t);e.additionalProperties===!1?o=d.strict():u?o=d.catchall(u):o=d.passthrough()}let s=e.propertyNames!==void 0&&e.propertyNames!==!0,c=typeof e.minProperties=="number"?e.minProperties:void 0,l=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(s||c!==void 0||l!==void 0){let d;if(s){let f=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;d=ee(f,r)}o=Yh(o,{keySchema:d,minProperties:c,maxProperties:l})}break}case"array":{let t=e.prefixItems,n=e.items;if(t&&Array.isArray(t)){let a=typeof e.minItems=="number"?e.minItems:0,u=t.map(d=>ee(d,r)),s=sp(u,a),c=Array.isArray(n)?void 0:dp(n,r),l=x.tuple(s);o=c?l.rest(c):l,typeof e.minItems=="number"&&(o=o.check(x.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(x.maxLength(e.maxItems)))}else if(Array.isArray(n)){let a=typeof e.minItems=="number"?e.minItems:0,u=n.map(d=>ee(d,r)),s=sp(u,a),c=dp(e.additionalItems,r),l=x.tuple(s);o=c?l.rest(c):l,typeof e.minItems=="number"&&(o=o.check(x.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(x.maxLength(e.maxItems)))}else if(n!==void 0){let a=ee(n,r),u=x.array(a);typeof e.minItems=="number"&&(u=u.min(e.minItems)),typeof e.maxItems=="number"&&(u=u.max(e.maxItems)),o=u}else o=x.array(x.any());(e.uniqueItems===!0||e.contains!==void 0)&&(o=ey(o,{uniqueItems:e.uniqueItems===!0,containsSchema:e.contains!==void 0?ee(e.contains,r):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${i}`)}return o}function ee(e,r){if(typeof e=="boolean")return e?x.any():x.never();let i=fp(e,r),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let u=e.anyOf.map(c=>ee(c,r)),s=x.union(u);i=o?x.intersection(i,s):s}if(e.oneOf&&Array.isArray(e.oneOf)){let u=e.oneOf.map(c=>ee(c,r)),s=x.xor(u);i=o?x.intersection(i,s):s}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)i=o?i:x.any();else{let u=o?i:ee(e.allOf[0],r),s=o?0:1;for(let c=s;c<e.allOf.length;c++)u=x.intersection(u,ee(e.allOf[c],r));i=u}e.nullable===!0&&r.version==="openapi-3.0"&&(i=x.nullable(i)),e.readOnly===!0&&(i=x.readonly(i)),e.default!==void 0&&(i=i.default(e.default));let t={},n=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let u of n)u in e&&(t[u]=e[u]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let u of a)u in e&&(t[u]=e[u]);if(e.type==="object"&&e.$ref===void 0){e.propertyNames!==void 0&&!Er(e.propertyNames)&&(t.propertyNames=e.propertyNames);for(let u of["minProperties","maxProperties"])e[u]!==void 0&&(t[u]=e[u])}if(e.type==="array"&&e.$ref===void 0){e.contains!==void 0&&!Er(e.contains)&&(t.contains=e.contains);for(let u of["uniqueItems","minContains","maxContains"])e[u]!==void 0&&(t[u]=e[u])}for(let u of Object.keys(e))Gh.has(u)||K(t,u,e[u]);return Object.keys(t).length>0&&r.registry.add(i,t),e.description&&(i=i.describe(e.description)),i}function mp(e,r){if(typeof e=="boolean")return e?x.any():x.never();let i;try{i=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let o=Wh(i,r?.defaultTarget),t=i.$defs||i.definitions||{},n={version:o,defs:t,refs:new Map,processing:new Set,rootSchema:i,registry:r?.registry??G};return ee(i,n)}var pp=Symbol("z.visit/resolving");function Cr(e,r){let i=typeof r=="function"?r:(a,u)=>{let s=r[a._zod.def.type];return s?s(a,u):a},o=new Map;function t(a){let u=o.get(a);if(u===pp)return new fr({type:"lazy",getter:()=>o.get(a)});if(u!==void 0)return u;o.set(a,pp);let s=n(a),c=i(s,s!==a);return o.set(a,c),c}function n(a){let u=a._zod.def,s=u.type;switch(s){case"object":{let c=u.shape,l=Object.keys(c),d=!1,f={};for(let v of l){let _=t(c[v]);_!==c[v]&&(d=!0),f[v]=_}let m=u.catchall;return u.catchall&&(m=t(u.catchall),m!==u.catchall&&(d=!0)),d?T(a,{...u,shape:f,catchall:m}):a}case"array":{let c=t(u.element);return c===u.element?a:T(a,{...u,element:c})}case"tuple":{let c=u.items,l=!1,d=[];for(let m of c){let v=t(m);v!==m&&(l=!0),d.push(v)}let f=u.rest;return u.rest&&(f=t(u.rest),f!==u.rest&&(l=!0)),l?T(a,{...u,items:d,rest:f}):a}case"record":case"map":{let c=t(u.keyType),l=t(u.valueType);return c===u.keyType&&l===u.valueType?a:T(a,{...u,keyType:c,valueType:l})}case"set":{let c=t(u.valueType);return c===u.valueType?a:T(a,{...u,valueType:c})}case"union":{let c=u.options,l=!1,d=[];for(let f of c){let m=t(f);m!==f&&(l=!0),d.push(m)}return l?T(a,{...u,options:d}):a}case"intersection":{let c=t(u.left),l=t(u.right);return c===u.left&&l===u.right?a:T(a,{...u,left:c,right:l})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let c=t(u.innerType);return c===u.innerType?a:T(a,{...u,innerType:c})}case"pipe":{let c=t(u.in),l=t(u.out);return c===u.in&&l===u.out?a:T(a,{...u,in:c,out:l})}case"function":{let c=t(u.input),l=t(u.output);return c===u.input&&l===u.output?a:T(a,{...u,input:c,output:l})}case"lazy":{let c=u.getter,{_cachedInner:l,...d}=u;return T(a,{...d,getter:()=>t(c())})}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":return a;default:return a}}return t(e)}function gp(e){return Cr(e,{object:r=>r.partial(),union:r=>{let i=r._zod.def;return i.discriminator===void 0?r:Ct(i.options)}})}function ry(e,r){if(!r?.length)return e;let i=e._zod.def;return T(e,de(i,{checks:[...i.checks??[],...r]}),{parent:!0})}function vp(e){return ry(e.out,e.checks)}function ny(e){return e.in._zod.traits.has("$ZodTransform")?vp(e):e.in}function $p(e){return Cr(e,{pipe:r=>ny(r._zod.def),default:(r,i)=>i?Ye(r._zod.def.innerType):r,catch:(r,i)=>i?r._zod.def.innerType:r})}function hp(e){return Cr(e,{pipe:r=>vp(r._zod.def),prefault:(r,i)=>i?r._zod.def.innerType:r})}var $l={};he($l,{bigint:()=>uy,boolean:()=>ay,date:()=>cy,number:()=>oy,string:()=>iy});function iy(e){return Lu(At,e)}function oy(e){return Bu(Tt,e)}function ay(e){return Hu(Zt,e)}function uy(e){return ec(Et,e)}function cy(e){return dc(Pr,e)}export{oo as a,ag as b,ug as c,ss as d,ds as e,fs as f,wr as g,Yf as h,Is as i,_i as j,ws as k,Ds as l,Om as m,qe as n,Dr as o,Tm as p,Em as q,Ct as r,Lm as s,Cs as t,Rs as u,Fi as v,Bm as w,Ye as x,rp as y,cp as z,Vh as A,Zr as B,$l as C,yp as D};
|