@uptimizr/playcanvas 0.2.5 → 1.0.1
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* @uptimizr/playcanvas standalone bundle (global) — Apache-2.0. Inject via a <script> tag into a page that runs PlayCanvas; exposes window.Uptimizr. playcanvas stays external (peer dependency, never bundled). */
|
|
2
|
-
"use strict";var Uptimizr=(()=>{var oa=Object.defineProperty;var lv=Object.getOwnPropertyDescriptor;var dv=Object.getOwnPropertyNames;var fv=Object.prototype.hasOwnProperty;var aa=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(n,i)=>(typeof require<"u"?require:n)[i]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Ve=(e,n)=>{for(var i in n)oa(e,i,{get:n[i],enumerable:!0})},mv=(e,n,i,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of dv(n))!fv.call(e,t)&&t!==i&&oa(e,t,{get:()=>n[t],enumerable:!(o=lv(n,t))||o.enumerable});return e};var pv=e=>mv(oa({},"__esModule",{value:!0}),e);var y_={};Ve(y_,{clamp01:()=>yr,classifyCamera:()=>Cd,createGazeRaycaster:()=>Fo,createSceneRaycaster:()=>Ro,playcanvasCollector:()=>Jo,readConnector:()=>Ho,readDeviceCaps:()=>Ko,readGraphics:()=>Xo,readSceneMeta:()=>Qo,scanSceneProxy:()=>Qg,toVec3:()=>$r,trackScene:()=>Hg});var Pr="default";var C={};Ve(C,{$brand:()=>xa,$input:()=>Gs,$output:()=>Js,NEVER:()=>_a,TimePrecision:()=>tu,ZodAny:()=>Ml,ZodArray:()=>Gl,ZodBase64:()=>_o,ZodBase64URL:()=>xo,ZodBigInt:()=>un,ZodBigIntFormat:()=>Io,ZodBoolean:()=>sn,ZodCIDRv4:()=>yo,ZodCIDRv6:()=>bo,ZodCUID:()=>fo,ZodCUID2:()=>mo,ZodCatch:()=>fd,ZodCodec:()=>ur,ZodCompileAsyncError:()=>Ee,ZodCompileUnsupportedError:()=>R,ZodCreditCard:()=>Tl,ZodCustom:()=>lr,ZodCustomStringFormat:()=>an,ZodDate:()=>rr,ZodDefault:()=>ad,ZodDiscriminatedUnion:()=>Wl,ZodE164:()=>ko,ZodEmail:()=>co,ZodEmoji:()=>uo,ZodEnum:()=>rn,ZodError:()=>_b,ZodExactOptional:()=>Do,ZodFile:()=>nd,ZodFirstPartyTypeKind:()=>Id,ZodFunction:()=>xd,ZodGUID:()=>so,ZodIPv4:()=>ho,ZodIPv6:()=>$o,ZodISODate:()=>ot,ZodISODateTime:()=>it,ZodISODuration:()=>ct,ZodISOTime:()=>at,ZodIntersection:()=>Kl,ZodIssueCode:()=>wb,ZodJWT:()=>wo,ZodKSUID:()=>vo,ZodLazy:()=>yd,ZodLiteral:()=>td,ZodMAC:()=>Ul,ZodMap:()=>Ql,ZodNaN:()=>pd,ZodNanoID:()=>lo,ZodNever:()=>Fl,ZodNonOptional:()=>Oo,ZodNull:()=>Vl,ZodNullable:()=>od,ZodNumber:()=>cn,ZodNumberFormat:()=>St,ZodObject:()=>or,ZodOptional:()=>cr,ZodPipe:()=>sr,ZodPrefault:()=>sd,ZodPreprocess:()=>gd,ZodPromise:()=>_d,ZodReadonly:()=>vd,ZodRealError:()=>he,ZodRecord:()=>nn,ZodSet:()=>ed,ZodString:()=>on,ZodStringFormat:()=>q,ZodSuccess:()=>dd,ZodSymbol:()=>Cl,ZodTemplateLiteral:()=>$d,ZodTransform:()=>rd,ZodTuple:()=>ql,ZodType:()=>Z,ZodULID:()=>po,ZodURL:()=>nr,ZodUUID:()=>Fe,ZodUndefined:()=>Zl,ZodUnion:()=>ar,ZodUnknown:()=>Rl,ZodVoid:()=>Jl,ZodXID:()=>go,ZodXor:()=>Bl,_ZodString:()=>ao,_default:()=>cd,_function:()=>lg,any:()=>Mp,array:()=>ir,base64:()=>kp,base64url:()=>wp,bigint:()=>Ep,boolean:()=>El,catch:()=>md,check:()=>dg,cidrv4:()=>_p,cidrv6:()=>xp,clone:()=>B,codec:()=>ag,coerce:()=>Sd,compile:()=>Xs,config:()=>ne,core:()=>Be,creditCard:()=>Sp,cuid:()=>mp,cuid2:()=>pp,custom:()=>fg,date:()=>Fp,decode:()=>Sl,decodeAsync:()=>Pl,deepPartial:()=>wg,describe:()=>mg,discriminatedUnion:()=>Xp,e164:()=>Ip,email:()=>rp,emoji:()=>dp,encode:()=>Il,encodeAsync:()=>zl,endsWith:()=>Wt,enum:()=>zo,exactOptional:()=>id,file:()=>ng,flattenError:()=>Un,float32:()=>Np,float64:()=>Up,formatError:()=>Tn,fromJSONSchema:()=>xg,function:()=>lg,getDiscriminatedOption:()=>vs,getErrorMap:()=>Sb,globalRegistry:()=>oe,gt:()=>Me,gte:()=>we,guid:()=>ip,hash:()=>jp,hex:()=>Op,hostname:()=>Dp,httpUrl:()=>lp,includes:()=>Gt,input:()=>Sg,instanceof:()=>gg,int:()=>io,int32:()=>Tp,int64:()=>Cp,intersection:()=>Xl,invertCodec:()=>cg,ipv4:()=>$p,ipv6:()=>bp,iso:()=>dr,json:()=>hg,jwt:()=>zp,keyof:()=>Jp,ksuid:()=>hp,lazy:()=>bd,length:()=>xt,literal:()=>tg,locales:()=>Bn,looseObject:()=>Wp,looseRecord:()=>Hp,lowercase:()=>Ft,lt:()=>Le,lte:()=>ke,mac:()=>yp,map:()=>Yp,maxLength:()=>_t,maxSize:()=>et,memoizer:()=>Jn,meta:()=>pg,mime:()=>Kt,minLength:()=>Ge,minSize:()=>Re,multipleOf:()=>Qe,nan:()=>og,nanoid:()=>fp,nativeEnum:()=>eg,negative:()=>Bi,never:()=>So,nonnegative:()=>Ki,nonoptional:()=>ld,nonpositive:()=>Wi,normalize:()=>Xt,null:()=>Ll,nullable:()=>tr,nullish:()=>rg,number:()=>Al,object:()=>Gp,optional:()=>wt,output:()=>zg,overwrite:()=>Ce,parse:()=>_l,parseAsync:()=>xl,partialRecord:()=>qp,pipe:()=>oo,positive:()=>Gi,prefault:()=>ud,preprocess:()=>$g,prettifyError:()=>za,promise:()=>ug,properties:()=>qi,property:()=>Xi,readonly:()=>hd,record:()=>Yl,refine:()=>kd,regex:()=>Rt,regexes:()=>ue,registry:()=>xi,safeDecode:()=>Ol,safeDecodeAsync:()=>Nl,safeEncode:()=>Dl,safeEncodeAsync:()=>jl,safeParse:()=>kl,safeParseAsync:()=>wl,set:()=>Qp,setErrorMap:()=>Ib,size:()=>bt,slugify:()=>Qt,startsWith:()=>Bt,strictObject:()=>Bp,string:()=>er,stringFormat:()=>Pp,stringbool:()=>vg,success:()=>ig,superRefine:()=>wd,symbol:()=>Vp,templateLiteral:()=>sg,toJSONSchema:()=>eo,toLowerCase:()=>Ht,toUpperCase:()=>Yt,toZod:()=>wn,transform:()=>Po,treeifyError:()=>Sa,trim:()=>qt,tuple:()=>Hl,uint32:()=>Ap,uint64:()=>Zp,ulid:()=>gp,undefined:()=>Lp,union:()=>ln,unknown:()=>kt,uppercase:()=>Jt,url:()=>up,util:()=>_,uuid:()=>op,uuidv4:()=>ap,uuidv6:()=>cp,uuidv7:()=>sp,validate:()=>Oa,validateAsync:()=>ja,void:()=>Rp,xid:()=>vp,xor:()=>Kp});var Be={};Ve(Be,{$ZodAny:()=>ss,$ZodArray:()=>ms,$ZodAsyncError:()=>ge,$ZodBase64:()=>Hc,$ZodBase64URL:()=>Yc,$ZodBigInt:()=>li,$ZodBigIntFormat:()=>is,$ZodBoolean:()=>Ln,$ZodCIDRv4:()=>Xc,$ZodCIDRv6:()=>qc,$ZodCUID:()=>Cc,$ZodCUID2:()=>Zc,$ZodCatch:()=>Ns,$ZodCheck:()=>H,$ZodCheckBigIntFormat:()=>fc,$ZodCheckEndsWith:()=>wc,$ZodCheckGreaterThan:()=>Kr,$ZodCheckIncludes:()=>xc,$ZodCheckLengthEquals:()=>$c,$ZodCheckLessThan:()=>Wr,$ZodCheckLowerCase:()=>bc,$ZodCheckMaxLength:()=>vc,$ZodCheckMaxSize:()=>mc,$ZodCheckMimeType:()=>Ic,$ZodCheckMinLength:()=>hc,$ZodCheckMinSize:()=>pc,$ZodCheckMultipleOf:()=>lc,$ZodCheckNumberFormat:()=>dc,$ZodCheckOverwrite:()=>Sc,$ZodCheckProperty:()=>Xr,$ZodCheckRegex:()=>yc,$ZodCheckSizeEquals:()=>gc,$ZodCheckStartsWith:()=>kc,$ZodCheckStringFormat:()=>Vt,$ZodCheckUpperCase:()=>_c,$ZodCodec:()=>Rn,$ZodCreditCard:()=>es,$ZodCustom:()=>Vs,$ZodCustomStringFormat:()=>ns,$ZodCyclicError:()=>vi,$ZodDate:()=>fs,$ZodDefault:()=>Ps,$ZodDiscriminatedUnion:()=>hs,$ZodE164:()=>Qc,$ZodEmail:()=>jc,$ZodEmoji:()=>Ac,$ZodEncodeError:()=>He,$ZodEnum:()=>xs,$ZodError:()=>Nn,$ZodExactOptional:()=>Ss,$ZodFile:()=>ws,$ZodFunction:()=>Cs,$ZodGUID:()=>Dc,$ZodIPv4:()=>Bc,$ZodIPv6:()=>Wc,$ZodISODate:()=>Fc,$ZodISODateTime:()=>Rc,$ZodISODuration:()=>Gc,$ZodISOTime:()=>Jc,$ZodIntersection:()=>$s,$ZodJWT:()=>ts,$ZodKSUID:()=>Mc,$ZodLazy:()=>Fn,$ZodLiteral:()=>ks,$ZodMAC:()=>Kc,$ZodMap:()=>bs,$ZodNaN:()=>Us,$ZodNanoID:()=>Ec,$ZodNever:()=>ls,$ZodNonOptional:()=>Os,$ZodNull:()=>cs,$ZodNullable:()=>zs,$ZodNumber:()=>ui,$ZodNumberFormat:()=>rs,$ZodObject:()=>zf,$ZodObjectJIT:()=>ps,$ZodOptional:()=>fi,$ZodPipe:()=>mi,$ZodPrefault:()=>Ds,$ZodPreprocess:()=>Ts,$ZodPromise:()=>Zs,$ZodReadonly:()=>As,$ZodRealError:()=>ve,$ZodRecord:()=>ys,$ZodRegistry:()=>_i,$ZodSet:()=>_s,$ZodString:()=>gt,$ZodStringFormat:()=>X,$ZodSuccess:()=>js,$ZodSymbol:()=>os,$ZodTemplateLiteral:()=>Es,$ZodTransform:()=>Is,$ZodTuple:()=>di,$ZodType:()=>E,$ZodULID:()=>Vc,$ZodURL:()=>Tc,$ZodUUID:()=>Oc,$ZodUndefined:()=>as,$ZodUnion:()=>Mn,$ZodUnknown:()=>us,$ZodVoid:()=>ds,$ZodXID:()=>Lc,$ZodXor:()=>gs,$brand:()=>xa,$constructor:()=>p,$input:()=>Gs,$output:()=>Js,Doc:()=>pt,INVALID:()=>xe,JSONSchema:()=>ep,JSONSchemaGenerator:()=>to,NEVER:()=>_a,TimePrecision:()=>tu,URL_BAD_FORMAT:()=>Nc,URL_UNPARSEABLE:()=>Uc,ZodCompileAsyncError:()=>Ee,ZodCompileUnsupportedError:()=>R,_any:()=>$u,_array:()=>Iu,_base64:()=>Mi,_base64url:()=>Ri,_bigint:()=>du,_boolean:()=>uu,_catch:()=>db,_check:()=>Wm,_cidrv4:()=>Vi,_cidrv6:()=>Li,_coercedBigint:()=>fu,_coercedBoolean:()=>lu,_coercedDate:()=>ku,_coercedNumber:()=>ru,_coercedString:()=>Ys,_creditCard:()=>eu,_cuid:()=>Ni,_cuid2:()=>Ui,_custom:()=>zu,_date:()=>xu,_decode:()=>Cr,_decodeAsync:()=>Vr,_default:()=>sb,_discriminatedUnion:()=>qy,_e164:()=>Fi,_email:()=>wi,_emoji:()=>Oi,_encode:()=>Er,_encodeAsync:()=>Zr,_endsWith:()=>Wt,_enum:()=>nb,_file:()=>Su,_float32:()=>ou,_float64:()=>au,_gt:()=>Me,_gte:()=>we,_guid:()=>Ii,_includes:()=>Gt,_int:()=>iu,_int32:()=>cu,_int64:()=>mu,_intersection:()=>Hy,_ipv4:()=>Ci,_ipv6:()=>Zi,_isoDate:()=>Xn,_isoDateTime:()=>Kn,_isoDuration:()=>Hn,_isoTime:()=>qn,_jwt:()=>Ji,_ksuid:()=>Ei,_lazy:()=>gb,_length:()=>xt,_literal:()=>ib,_lowercase:()=>Ft,_lt:()=>Le,_lte:()=>ke,_mac:()=>Qs,_map:()=>eb,_max:()=>ke,_maxLength:()=>_t,_maxSize:()=>et,_mime:()=>Kt,_min:()=>we,_minLength:()=>Ge,_minSize:()=>Re,_multipleOf:()=>Qe,_nan:()=>wu,_nanoid:()=>ji,_nativeEnum:()=>rb,_negative:()=>Bi,_never:()=>bu,_nonnegative:()=>Ki,_nonoptional:()=>ub,_nonpositive:()=>Wi,_normalize:()=>Xt,_null:()=>hu,_nullable:()=>cb,_number:()=>nu,_optional:()=>ab,_overwrite:()=>Ce,_parse:()=>At,_parseAsync:()=>Et,_pipe:()=>fb,_positive:()=>Gi,_promise:()=>vb,_properties:()=>qi,_property:()=>Xi,_readonly:()=>mb,_record:()=>Qy,_refine:()=>Pu,_regex:()=>Rt,_safeDecode:()=>Mr,_safeDecodeAsync:()=>Fr,_safeEncode:()=>Lr,_safeEncodeAsync:()=>Rr,_safeParse:()=>Ct,_safeParseAsync:()=>Zt,_set:()=>tb,_size:()=>bt,_slugify:()=>Qt,_startsWith:()=>Bt,_string:()=>Hs,_stringFormat:()=>en,_stringbool:()=>Nu,_success:()=>lb,_superRefine:()=>Du,_symbol:()=>gu,_templateLiteral:()=>pb,_toLowerCase:()=>Ht,_toUpperCase:()=>Yt,_transform:()=>ob,_trim:()=>qt,_tuple:()=>Yy,_uint32:()=>su,_uint64:()=>pu,_ulid:()=>Ti,_undefined:()=>vu,_union:()=>Ky,_unknown:()=>yu,_uppercase:()=>Jt,_url:()=>Wn,_uuid:()=>Si,_uuidv4:()=>zi,_uuidv6:()=>Pi,_uuidv7:()=>Di,_void:()=>_u,_xid:()=>Ai,_xor:()=>Xy,clone:()=>B,compile:()=>Xs,compileFn:()=>ki,config:()=>ne,createStandardJSONSchemaMethod:()=>tn,createToJSONSchemaMethod:()=>Tu,decode:()=>th,decodeAsync:()=>rh,describe:()=>Ou,encode:()=>eh,encodeAsync:()=>nh,extractDefs:()=>nt,finalize:()=>rt,flattenError:()=>Un,formatError:()=>Tn,getDiscriminatedOption:()=>vs,globalConfig:()=>ie,globalRegistry:()=>oe,handleUnrepresentable:()=>re,initializeContext:()=>tt,isBackEdge:()=>hi,isRecursiveSchema:()=>Fs,isValidBase64:()=>Vn,isValidBase64URL:()=>ai,isValidCIDRv6:()=>oi,isValidCreditCard:()=>ci,isValidIPv6:()=>Zn,isValidJWT:()=>si,locales:()=>Bn,memoizer:()=>Jn,mergeValues:()=>Lt,meta:()=>ju,parse:()=>Tr,parseAsync:()=>Ar,parseURLObject:()=>ti,prettifyError:()=>za,process:()=>W,regexes:()=>ue,registry:()=>xi,safeDecode:()=>oh,safeDecodeAsync:()=>ch,safeEncode:()=>ih,safeEncodeAsync:()=>ah,safeParse:()=>Pa,safeParseAsync:()=>Da,standardProps:()=>ei,stripTabAndNewline:()=>ni,toDotPath:()=>rf,toJSONSchema:()=>eo,toZod:()=>wn,treeifyError:()=>Sa,urlHostnameOk:()=>ri,urlProtocolOk:()=>ii,util:()=>_,validate:()=>Oa,validateAsync:()=>ja,version:()=>zc});var _={};Ve(_,{BIGINT_FORMAT_RANGES:()=>ga,CONSTANT_CATCH:()=>Nr,Class:()=>sa,NUMBER_FORMAT_RANGES:()=>pa,aborted:()=>qe,allowsEval:()=>da,assert:()=>yv,assertEqual:()=>gv,assertIs:()=>hv,assertNever:()=>$v,assertNotEqual:()=>vv,assignProp:()=>ee,attachSchema:()=>jr,base64ToUint8Array:()=>Hd,base64urlToUint8Array:()=>Cv,cached:()=>Ut,captureStackTrace:()=>Or,cleanEnum:()=>Ev,cleanRegex:()=>Sn,clone:()=>B,cloneDef:()=>_v,codePointLength:()=>ft,constantCatch:()=>ya,createTransparentProxy:()=>zv,defineLazy:()=>ua,defineLazyInternal:()=>M,esc:()=>fe,escapeRegex:()=>Pe,explicitlyAborted:()=>va,extend:()=>Ov,finalizeIssue:()=>pe,floatSafeRemainder:()=>zn,getElementAtPath:()=>xv,getEnumValues:()=>In,getLengthableOrigin:()=>jn,getParsedType:()=>Sv,getSizableOrigin:()=>On,hexToUint8Array:()=>Vv,hide:()=>$a,installLazyProp:()=>Jv,isObject:()=>dt,isPlainObject:()=>ze,issue:()=>Tt,joinValues:()=>g,jsonStringifyReplacer:()=>Nt,members:()=>ha,merge:()=>Nv,mergeDefs:()=>Ae,normalizeParams:()=>k,nullish:()=>Dr,numKeys:()=>Iv,objectClone:()=>bv,omit:()=>Dv,optionalKeys:()=>ma,own:()=>jt,parsedType:()=>b,partial:()=>Uv,pick:()=>Pv,prefixIssues:()=>me,primitiveTypes:()=>fa,promiseAllObject:()=>kv,propertyKeyTypes:()=>Dn,randomString:()=>wv,required:()=>Tv,safeExtend:()=>jv,shallowClone:()=>Pn,slugify:()=>la,stringifyPrimitive:()=>$,toZod:()=>wn,uint8ArrayToBase64:()=>Yd,uint8ArrayToBase64url:()=>Zv,uint8ArrayToHex:()=>Lv,unwrapMessage:()=>Ot});function gv(e){return e}function vv(e){return e}function wn(){return e=>e}function hv(e){}function $v(e){throw new Error("Unexpected value in exhaustive check")}function yv(e){}function In(e){let n=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,t])=>n.indexOf(+o)===-1).map(([o,t])=>t)}function g(e,n="|"){return e.map(i=>$(i)).join(n)}function Nt(e,n){return typeof n=="bigint"?n.toString():n}function Ut(e){return{get value(){{let i=e();return Object.defineProperty(this,"value",{value:i}),i}throw new Error("cached value already set")}}}function Dr(e){return e==null}function Sn(e){let n=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(n,i)}function zn(e,n){let i=e/n,o=Math.round(i),t=4*Number.EPSILON*Math.max(Math.abs(i),1);return Math.abs(i-o)<t?0:i-o}var qd=Symbol("evaluating");function ua(e,n,i){let o;Object.defineProperty(e,n,{get(){if(o!==qd)return o===void 0&&(o=qd,o=i()),o},set(t){Object.defineProperty(e,n,{value:t})},configurable:!0})}function bv(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function ee(e,n,i){Object.defineProperty(e,n,{value:i,writable:!0,enumerable:!0,configurable:!0})}function Ae(...e){let n={};for(let i of e){let o=Object.getOwnPropertyDescriptors(i);Object.assign(n,o)}return Object.defineProperties({},n)}function _v(e){return Ae(e._zod.def)}function xv(e,n){return n?n.reduce((i,o)=>i?.[o],e):e}function kv(e){let n=Object.keys(e),i=n.map(o=>e[o]);return Promise.all(i).then(o=>{let t={};for(let r=0;r<n.length;r++)t[n[r]]=o[r];return t})}function wv(e=10){let n="abcdefghijklmnopqrstuvwxyz",i="";for(let o=0;o<e;o++)i+=n[Math.floor(Math.random()*n.length)];return i}function fe(e){return JSON.stringify(e)}function la(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Or="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function dt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var da=Ut(()=>{if(ie.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function ze(e){if(dt(e)===!1)return!1;let n=e.constructor;if(n===void 0||typeof n!="function")return!0;let i=n.prototype;return!(dt(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function Pn(e){return ze(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Iv(e){let n=0;for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&n++;return n}var Sv=e=>{let n=typeof e;switch(n){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: ${n}`)}},Dn=new Set(["string","number","symbol"]),fa=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Pe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function B(e,n,i){let o=new e._zod.constr(n??e._zod.def);return(!n||i?.parent)&&(o._zod.parent=e),o}function k(e){let n=e;if(!n)return{};if(typeof n=="string")return{error:()=>n};if(n?.message!==void 0){if(n?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");n.error=n.message}return delete n.message,typeof n.error=="string"?{...n,error:()=>n.error}:n}function zv(e){let n;return new Proxy({},{get(i,o,t){return n??(n=e()),Reflect.get(n,o,t)},set(i,o,t,r){return n??(n=e()),Reflect.set(n,o,t,r)},has(i,o){return n??(n=e()),Reflect.has(n,o)},deleteProperty(i,o){return n??(n=e()),Reflect.deleteProperty(n,o)},ownKeys(i){return n??(n=e()),Reflect.ownKeys(n)},getOwnPropertyDescriptor(i,o){return n??(n=e()),Reflect.getOwnPropertyDescriptor(n,o)},defineProperty(i,o,t){return n??(n=e()),Reflect.defineProperty(n,o,t)}})}function $(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function ma(e){return Object.keys(e).filter(n=>e[n]._zod.optin!==void 0&&e[n]._zod.optout==="optional")}var pa={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]},ga={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Pv(e,n){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 r=Ae(e._zod.def,{get shape(){let a={};for(let c of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(i.shape,c))throw new Error(`Unrecognized key: "${String(c)}"`);n[c]&&ee(a,c,i.shape[c])}return ee(this,"shape",a),a},checks:[]});return B(e,r)}function Dv(e,n){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 r=Ae(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let c of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(i.shape,c))throw new Error(`Unrecognized key: "${String(c)}"`);n[c]&&delete a[c]}return ee(this,"shape",a),a},checks:[]});return B(e,r)}function Ov(e,n){if(!ze(n))throw new Error("Invalid input to extend: expected a plain object");let i=e._zod.def.checks;if(i&&i.length>0){let r=e._zod.def.shape;for(let a of Reflect.ownKeys(n))if(Object.getOwnPropertyDescriptor(r,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let t=Ae(e._zod.def,{get shape(){let r={...e._zod.def.shape,...n};return ee(this,"shape",r),r}});return B(e,t)}function jv(e,n){if(!ze(n))throw new Error("Invalid input to safeExtend: expected a plain object");let i=Ae(e._zod.def,{get shape(){let o={...e._zod.def.shape,...n};return ee(this,"shape",o),o}});return B(e,i)}function Nv(e,n){if(!n?._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=Ae(e._zod.def,{get shape(){let o={...e._zod.def.shape,...n._zod.def.shape};return ee(this,"shape",o),o},get catchall(){return n._zod.def.catchall},checks:n._zod.def.checks??[]});return B(e,i)}function Uv(e,n,i,o="partial"){let r=n._zod.def.checks;if(r&&r.length>0)throw new Error(`.${o}() cannot be used on object schemas containing refinements`);let c=Ae(n._zod.def,{get shape(){let s=n._zod.def.shape,u={...s};if(i)for(let l of Reflect.ownKeys(i)){if(!Object.prototype.hasOwnProperty.call(s,l))throw new Error(`Unrecognized key: "${String(l)}"`);i[l]&&(u[l]=e?new e({type:"optional",innerType:s[l]}):s[l])}else for(let l of Reflect.ownKeys(s))u[l]=e?new e({type:"optional",innerType:s[l]}):s[l];return ee(this,"shape",u),u},checks:[]});return B(n,c)}function Tv(e,n,i){let o=Ae(n._zod.def,{get shape(){let t=n._zod.def.shape,r={...t};if(i)for(let a of Reflect.ownKeys(i)){if(!Object.prototype.hasOwnProperty.call(r,a))throw new Error(`Unrecognized key: "${String(a)}"`);i[a]&&(r[a]=new e({type:"nonoptional",innerType:t[a]}))}else for(let a of Reflect.ownKeys(t))r[a]=new e({type:"nonoptional",innerType:t[a]});return ee(this,"shape",r),r}});return B(n,o)}function qe(e,n=0){if(e.aborted===!0)return!0;for(let i=n;i<e.issues.length;i++)if(e.issues[i]?.continue!==!0)return!0;return!1}function va(e,n=0){if(e.aborted===!0)return!0;for(let i=n;i<e.issues.length;i++)if(e.issues[i]?.continue===!1)return!0;return!1}function me(e,n){return n.map(i=>{var o;return(o=i).path??(o.path=[]),i.path.unshift(e),i})}function Ot(e){return typeof e=="string"?e:e?.message}function jr(e,n,i){var o;for(let t=n;t<e.length;t++)(o=e[t]).schema??(o.schema=i)}function pe(e,n,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 r=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,a=e.message?e.message:Ot(e.inst?._zod.def?.error?.(e))??Ot(r?.(e))??Ot(n?.error?.(e))??Ot(i.customError?.(e))??Ot(i.localeError?.(e))??"Invalid input",{inst:c,schema:s,continue:u,input:l,...d}=e;return d.path??(d.path=[]),d.message=a,n?.reportInput&&(d.input=l),d}function On(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var Av=/[\uD800-\uDBFF]/;function ft(e){let n=e.length;if(!Av.test(e))return n;let i=n;for(let o=0;o<n-1;o++)(e.charCodeAt(o)&64512)===55296&&(e.charCodeAt(o+1)&64512)===56320&&(i--,o++);return i}function jn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function b(e){let n=typeof e;switch(n){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 n}function Tt(...e){let[n,i,o]=e;return typeof n=="string"?{message:n,code:"custom",input:i,inst:o}:{...n}}function Ev(e){return Object.entries(e).filter(([n,i])=>Number.isNaN(Number.parseInt(n,10))).map(n=>n[1])}function Hd(e){let n=atob(e),i=new Uint8Array(n.length);for(let o=0;o<n.length;o++)i[o]=n.charCodeAt(o);return i}function Yd(e){let n="";for(let i=0;i<e.length;i++)n+=String.fromCharCode(e[i]);return btoa(n)}function Cv(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),i="=".repeat((4-n.length%4)%4);return Hd(n+i)}function Zv(e){return Yd(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Vv(e){let n=e.replace(/^0x/,"");if(n.length%2!==0)throw new Error("Invalid hex string length");let i=new Uint8Array(n.length/2);for(let o=0;o<n.length;o+=2)i[o/2]=Number.parseInt(n.slice(o,o+2),16);return i}function Lv(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}var sa=class{constructor(...n){}};function ha(e,n){for(let i in n){let o=Object.getOwnPropertyDescriptor(n,i);o.get?Object.defineProperty(e,i,{...o,enumerable:!1}):Mv(e,i,o.value)}}function jt(e,n,i,o=!0){return Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:o,value:i}),i}function $a(e,n,i){return jt(e,n,i,!1)}function Mv(e,n,i){Object.defineProperty(e,n,{configurable:!0,get(){return this==null?i:jt(this,n,i.bind(this))},set(o){jt(this,n,o)}})}function Rv(e,n){let i=Object.getPrototypeOf(e);return n in i?void 0:i}var ca,Xe=!1,Fv={configurable:!0,get(){Xe=!0}};function M(e,n,i){let o=Object.getPrototypeOf(e._zod);if(n in o&&ca!==e._zod){ca=void 0;return}ca=e._zod,Object.defineProperty(o,n,{configurable:!0,get(){Object.defineProperty(this,n,Fv);let t=Xe;Xe=!1;try{let r=i(this);return Xe?delete this[n]:Object.defineProperty(this,n,{configurable:!0,writable:!0,value:r}),Xe=Xe||t,r}catch(r){throw delete this[n],Xe=Xe||t,r}},set(t){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:t})}})}function Jv(e,n,i,o){let t=Rv(e,n);t&&Object.defineProperty(t,n,{configurable:!0,get(){let r={configurable:!0,writable:!0,enumerable:o,value:void 0};return Object.defineProperty(this,n,r),r.value=i(this),Object.defineProperty(this,n,r),r.value},set(r){Object.defineProperty(this,n,{configurable:!0,writable:!0,enumerable:o,value:r})}})}var Nr="~constantCatch";function ya(e){let n=()=>e;return n[Nr]=!0,n}var Qd,_a=Object.freeze({status:"aborted"}),ba={value:void 0,enumerable:!1},ef="captureStackTrace"in Error?Error:null;function Gv(e){let n=ef;if(n){let i=n.stackTraceLimit;if(typeof i=="number"){try{n.stackTraceLimit=0}catch{return ef=null,new e}try{return new e}finally{n.stackTraceLimit=i}}}return new e}function p(e,n,i,o){let t={};function r(f){this.def=f,this.constr=d,this.traits=new Set}r.prototype=t;let a=i,c=a&&new WeakSet;function s(f,m){if(!f._zod){ba.value=new r(m);try{Object.defineProperty(f,"_zod",ba)}finally{ba.value=void 0}}if(f._zod.traits.has(e))return;if(f._zod.traits.add(e),n(f,m),c){let y=Object.getPrototypeOf(f),x=f._zod.constr.prototype,I=y;for(;I&&I!==x;)I=Object.getPrototypeOf(I);let h=I??y;c.has(h)||(c.add(h),ha(h,a))}let v=d.prototype;for(let y in v)Object.prototype.hasOwnProperty.call(v,y)&&(y in f||(f[y]=v[y].bind(f)))}let u=o?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:e});function d(f){let m=o?.Parent?Gv(l):this;s(m,f);let v=m._zod.deferred;if(v){for(let x of v)x();m._zod.deferred=void 0}let y=globalThis.__zod_globalConfig?.postProcessor;return y&&y(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 xa=Symbol("zod_brand"),ge=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},He=class extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}};(Qd=globalThis).__zod_globalConfig??(Qd.__zod_globalConfig={});var ie=globalThis.__zod_globalConfig;function ne(e){return e&&Object.assign(ie,e),ie}function Bv(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Nt,2)),e.message}function Wv(e){this._zod.message=e}var Kv={get:Bv,set:Wv,enumerable:!0,configurable:!0},wa={value:void 0,enumerable:!1},Ia={value:void 0,enumerable:!1},tf=new WeakSet([Object.prototype,Error.prototype]),nf=(e,n)=>{e.name="$ZodError",wa.value=e._zod,Object.defineProperty(e,"_zod",wa),Ia.value=n,Object.defineProperty(e,"issues",Ia),wa.value=void 0,Ia.value=void 0,Object.defineProperty(e,"message",Kv);let i=Object.getPrototypeOf(e);tf.has(i)||(tf.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})}}))},Nn=p("$ZodError",nf),ve=p("$ZodError",nf,void 0,{Parent:Error});function Xv(e,n,i){return Object.prototype.hasOwnProperty.call(e,n)||(n==="__proto__"?Object.defineProperty(e,n,{value:i(),writable:!0,enumerable:!0,configurable:!0}):e[n]=i()),e[n]}function Un(e,n=i=>i.message){let i={},o=[];for(let t of e.issues)t.path.length>0?Xv(i,t.path[0],()=>[]).push(n(t)):o.push(n(t));return{formErrors:o,fieldErrors:i}}function Tn(e,n=i=>i.message){let i={_errors:[]},o=(t,r=[])=>{for(let a of t.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>o({issues:c},[...r,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...r,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...r,...a.path]);else{let c=[...r,...a.path];if(c.length===0)i._errors.push(n(a));else{let s=i,u=0;for(;u<c.length;){let l=c[u],d=u===c.length-1;if(l==="_errors"){d&&s._errors.push(n(a)),u++;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(n(a)),s=f,u++}}}};return o(e),i}function Sa(e,n=i=>i.message){let i={errors:[]},o=(t,r=[])=>{var a;for(let c of t.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(s=>o({issues:s},[...r,...c.path]));else if(c.code==="invalid_key")o({issues:c.issues},[...r,...c.path]);else if(c.code==="invalid_element")o({issues:c.issues},[...r,...c.path]);else{let s=[...r,...c.path];if(s.length===0){i.errors.push(n(c));continue}let u=i,l=0;for(;l<s.length;){let d=s[l],f=l===s.length-1;typeof d=="string"?(u.properties??(u.properties={}),Object.prototype.hasOwnProperty.call(u.properties,d)||Object.defineProperty(u.properties,d,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),u=u.properties[d]):(u.items??(u.items=[]),(a=u.items)[d]??(a[d]={errors:[]}),u=u.items[d]),f&&u.errors.push(n(c)),l++}}};return o(e),i}function rf(e){let n=[],i=e.map(o=>typeof o=="object"?o.key:o);for(let o of i)typeof o=="number"?n.push(`[${o}]`):typeof o=="symbol"?n.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?n.push(`[${JSON.stringify(o)}]`):(n.length&&n.push("."),n.push(o));return n.join("")}function za(e){let n=[],i=[...e.issues].sort((o,t)=>(o.path??[]).length-(t.path??[]).length);for(let o of i)n.push(`\u2716 ${o.message}`),o.path?.length&&n.push(` \u2192 at ${rf(o.path)}`);return n.join(`
|
|
2
|
+
"use strict";var Uptimizr=(()=>{var oa=Object.defineProperty;var lv=Object.getOwnPropertyDescriptor;var dv=Object.getOwnPropertyNames;var fv=Object.prototype.hasOwnProperty;var aa=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(n,i)=>(typeof require<"u"?require:n)[i]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Ve=(e,n)=>{for(var i in n)oa(e,i,{get:n[i],enumerable:!0})},mv=(e,n,i,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of dv(n))!fv.call(e,t)&&t!==i&&oa(e,t,{get:()=>n[t],enumerable:!(o=lv(n,t))||o.enumerable});return e};var pv=e=>mv(oa({},"__esModule",{value:!0}),e);var b_={};Ve(b_,{clamp01:()=>yr,classifyCamera:()=>Cd,createGazeRaycaster:()=>Fo,createSceneRaycaster:()=>Ro,playcanvasCollector:()=>Jo,readConnector:()=>Ho,readDeviceCaps:()=>Ko,readGraphics:()=>Xo,readSceneMeta:()=>Qo,scanSceneProxy:()=>Qg,toVec3:()=>$r,trackScene:()=>Hg});var Pr="default";var C={};Ve(C,{$brand:()=>xa,$input:()=>Gs,$output:()=>Js,NEVER:()=>_a,TimePrecision:()=>tu,ZodAny:()=>Ml,ZodArray:()=>Gl,ZodBase64:()=>_o,ZodBase64URL:()=>xo,ZodBigInt:()=>un,ZodBigIntFormat:()=>Io,ZodBoolean:()=>sn,ZodCIDRv4:()=>yo,ZodCIDRv6:()=>bo,ZodCUID:()=>fo,ZodCUID2:()=>mo,ZodCatch:()=>fd,ZodCodec:()=>ur,ZodCompileAsyncError:()=>Ee,ZodCompileUnsupportedError:()=>R,ZodCreditCard:()=>Tl,ZodCustom:()=>lr,ZodCustomStringFormat:()=>an,ZodDate:()=>rr,ZodDefault:()=>ad,ZodDiscriminatedUnion:()=>Wl,ZodE164:()=>ko,ZodEmail:()=>co,ZodEmoji:()=>uo,ZodEnum:()=>rn,ZodError:()=>_b,ZodExactOptional:()=>Do,ZodFile:()=>nd,ZodFirstPartyTypeKind:()=>Id,ZodFunction:()=>xd,ZodGUID:()=>so,ZodIPv4:()=>ho,ZodIPv6:()=>$o,ZodISODate:()=>ot,ZodISODateTime:()=>it,ZodISODuration:()=>ct,ZodISOTime:()=>at,ZodIntersection:()=>Kl,ZodIssueCode:()=>wb,ZodJWT:()=>wo,ZodKSUID:()=>vo,ZodLazy:()=>yd,ZodLiteral:()=>td,ZodMAC:()=>Ul,ZodMap:()=>Ql,ZodNaN:()=>pd,ZodNanoID:()=>lo,ZodNever:()=>Fl,ZodNonOptional:()=>Oo,ZodNull:()=>Vl,ZodNullable:()=>od,ZodNumber:()=>cn,ZodNumberFormat:()=>St,ZodObject:()=>or,ZodOptional:()=>cr,ZodPipe:()=>sr,ZodPrefault:()=>sd,ZodPreprocess:()=>gd,ZodPromise:()=>_d,ZodReadonly:()=>vd,ZodRealError:()=>he,ZodRecord:()=>nn,ZodSet:()=>ed,ZodString:()=>on,ZodStringFormat:()=>q,ZodSuccess:()=>dd,ZodSymbol:()=>Cl,ZodTemplateLiteral:()=>$d,ZodTransform:()=>rd,ZodTuple:()=>ql,ZodType:()=>Z,ZodULID:()=>po,ZodURL:()=>nr,ZodUUID:()=>Fe,ZodUndefined:()=>Zl,ZodUnion:()=>ar,ZodUnknown:()=>Rl,ZodVoid:()=>Jl,ZodXID:()=>go,ZodXor:()=>Bl,_ZodString:()=>ao,_default:()=>cd,_function:()=>lg,any:()=>Mp,array:()=>ir,base64:()=>kp,base64url:()=>wp,bigint:()=>Ep,boolean:()=>El,catch:()=>md,check:()=>dg,cidrv4:()=>_p,cidrv6:()=>xp,clone:()=>B,codec:()=>ag,coerce:()=>Sd,compile:()=>Xs,config:()=>ne,core:()=>Be,creditCard:()=>Sp,cuid:()=>mp,cuid2:()=>pp,custom:()=>fg,date:()=>Fp,decode:()=>Sl,decodeAsync:()=>Pl,deepPartial:()=>wg,describe:()=>mg,discriminatedUnion:()=>Xp,e164:()=>Ip,email:()=>rp,emoji:()=>dp,encode:()=>Il,encodeAsync:()=>zl,endsWith:()=>Wt,enum:()=>zo,exactOptional:()=>id,file:()=>ng,flattenError:()=>Un,float32:()=>Np,float64:()=>Up,formatError:()=>Tn,fromJSONSchema:()=>xg,function:()=>lg,getDiscriminatedOption:()=>vs,getErrorMap:()=>Sb,globalRegistry:()=>oe,gt:()=>Me,gte:()=>we,guid:()=>ip,hash:()=>jp,hex:()=>Op,hostname:()=>Dp,httpUrl:()=>lp,includes:()=>Gt,input:()=>Sg,instanceof:()=>gg,int:()=>io,int32:()=>Tp,int64:()=>Cp,intersection:()=>Xl,invertCodec:()=>cg,ipv4:()=>$p,ipv6:()=>bp,iso:()=>dr,json:()=>hg,jwt:()=>zp,keyof:()=>Jp,ksuid:()=>hp,lazy:()=>bd,length:()=>xt,literal:()=>tg,locales:()=>Bn,looseObject:()=>Wp,looseRecord:()=>Hp,lowercase:()=>Ft,lt:()=>Le,lte:()=>ke,mac:()=>yp,map:()=>Yp,maxLength:()=>_t,maxSize:()=>et,memoizer:()=>Jn,meta:()=>pg,mime:()=>Kt,minLength:()=>Ge,minSize:()=>Re,multipleOf:()=>Qe,nan:()=>og,nanoid:()=>fp,nativeEnum:()=>eg,negative:()=>Bi,never:()=>So,nonnegative:()=>Ki,nonoptional:()=>ld,nonpositive:()=>Wi,normalize:()=>Xt,null:()=>Ll,nullable:()=>tr,nullish:()=>rg,number:()=>Al,object:()=>Gp,optional:()=>wt,output:()=>zg,overwrite:()=>Ce,parse:()=>_l,parseAsync:()=>xl,partialRecord:()=>qp,pipe:()=>oo,positive:()=>Gi,prefault:()=>ud,preprocess:()=>$g,prettifyError:()=>za,promise:()=>ug,properties:()=>qi,property:()=>Xi,readonly:()=>hd,record:()=>Yl,refine:()=>kd,regex:()=>Rt,regexes:()=>ue,registry:()=>xi,safeDecode:()=>Ol,safeDecodeAsync:()=>Nl,safeEncode:()=>Dl,safeEncodeAsync:()=>jl,safeParse:()=>kl,safeParseAsync:()=>wl,set:()=>Qp,setErrorMap:()=>Ib,size:()=>bt,slugify:()=>Qt,startsWith:()=>Bt,strictObject:()=>Bp,string:()=>er,stringFormat:()=>Pp,stringbool:()=>vg,success:()=>ig,superRefine:()=>wd,symbol:()=>Vp,templateLiteral:()=>sg,toJSONSchema:()=>eo,toLowerCase:()=>Ht,toUpperCase:()=>Yt,toZod:()=>wn,transform:()=>Po,treeifyError:()=>Sa,trim:()=>qt,tuple:()=>Hl,uint32:()=>Ap,uint64:()=>Zp,ulid:()=>gp,undefined:()=>Lp,union:()=>ln,unknown:()=>kt,uppercase:()=>Jt,url:()=>up,util:()=>_,uuid:()=>op,uuidv4:()=>ap,uuidv6:()=>cp,uuidv7:()=>sp,validate:()=>Oa,validateAsync:()=>ja,void:()=>Rp,xid:()=>vp,xor:()=>Kp});var Be={};Ve(Be,{$ZodAny:()=>ss,$ZodArray:()=>ms,$ZodAsyncError:()=>ge,$ZodBase64:()=>Hc,$ZodBase64URL:()=>Yc,$ZodBigInt:()=>li,$ZodBigIntFormat:()=>is,$ZodBoolean:()=>Ln,$ZodCIDRv4:()=>Xc,$ZodCIDRv6:()=>qc,$ZodCUID:()=>Cc,$ZodCUID2:()=>Zc,$ZodCatch:()=>Ns,$ZodCheck:()=>H,$ZodCheckBigIntFormat:()=>fc,$ZodCheckEndsWith:()=>wc,$ZodCheckGreaterThan:()=>Kr,$ZodCheckIncludes:()=>xc,$ZodCheckLengthEquals:()=>$c,$ZodCheckLessThan:()=>Wr,$ZodCheckLowerCase:()=>bc,$ZodCheckMaxLength:()=>vc,$ZodCheckMaxSize:()=>mc,$ZodCheckMimeType:()=>Ic,$ZodCheckMinLength:()=>hc,$ZodCheckMinSize:()=>pc,$ZodCheckMultipleOf:()=>lc,$ZodCheckNumberFormat:()=>dc,$ZodCheckOverwrite:()=>Sc,$ZodCheckProperty:()=>Xr,$ZodCheckRegex:()=>yc,$ZodCheckSizeEquals:()=>gc,$ZodCheckStartsWith:()=>kc,$ZodCheckStringFormat:()=>Vt,$ZodCheckUpperCase:()=>_c,$ZodCodec:()=>Rn,$ZodCreditCard:()=>es,$ZodCustom:()=>Vs,$ZodCustomStringFormat:()=>ns,$ZodCyclicError:()=>vi,$ZodDate:()=>fs,$ZodDefault:()=>Ps,$ZodDiscriminatedUnion:()=>hs,$ZodE164:()=>Qc,$ZodEmail:()=>jc,$ZodEmoji:()=>Ac,$ZodEncodeError:()=>He,$ZodEnum:()=>xs,$ZodError:()=>Nn,$ZodExactOptional:()=>Ss,$ZodFile:()=>ws,$ZodFunction:()=>Cs,$ZodGUID:()=>Dc,$ZodIPv4:()=>Bc,$ZodIPv6:()=>Wc,$ZodISODate:()=>Fc,$ZodISODateTime:()=>Rc,$ZodISODuration:()=>Gc,$ZodISOTime:()=>Jc,$ZodIntersection:()=>$s,$ZodJWT:()=>ts,$ZodKSUID:()=>Mc,$ZodLazy:()=>Fn,$ZodLiteral:()=>ks,$ZodMAC:()=>Kc,$ZodMap:()=>bs,$ZodNaN:()=>Us,$ZodNanoID:()=>Ec,$ZodNever:()=>ls,$ZodNonOptional:()=>Os,$ZodNull:()=>cs,$ZodNullable:()=>zs,$ZodNumber:()=>ui,$ZodNumberFormat:()=>rs,$ZodObject:()=>zf,$ZodObjectJIT:()=>ps,$ZodOptional:()=>fi,$ZodPipe:()=>mi,$ZodPrefault:()=>Ds,$ZodPreprocess:()=>Ts,$ZodPromise:()=>Zs,$ZodReadonly:()=>As,$ZodRealError:()=>ve,$ZodRecord:()=>ys,$ZodRegistry:()=>_i,$ZodSet:()=>_s,$ZodString:()=>gt,$ZodStringFormat:()=>X,$ZodSuccess:()=>js,$ZodSymbol:()=>os,$ZodTemplateLiteral:()=>Es,$ZodTransform:()=>Is,$ZodTuple:()=>di,$ZodType:()=>E,$ZodULID:()=>Vc,$ZodURL:()=>Tc,$ZodUUID:()=>Oc,$ZodUndefined:()=>as,$ZodUnion:()=>Mn,$ZodUnknown:()=>us,$ZodVoid:()=>ds,$ZodXID:()=>Lc,$ZodXor:()=>gs,$brand:()=>xa,$constructor:()=>p,$input:()=>Gs,$output:()=>Js,Doc:()=>pt,INVALID:()=>xe,JSONSchema:()=>ep,JSONSchemaGenerator:()=>to,NEVER:()=>_a,TimePrecision:()=>tu,URL_BAD_FORMAT:()=>Nc,URL_UNPARSEABLE:()=>Uc,ZodCompileAsyncError:()=>Ee,ZodCompileUnsupportedError:()=>R,_any:()=>$u,_array:()=>Iu,_base64:()=>Mi,_base64url:()=>Ri,_bigint:()=>du,_boolean:()=>uu,_catch:()=>db,_check:()=>Wm,_cidrv4:()=>Vi,_cidrv6:()=>Li,_coercedBigint:()=>fu,_coercedBoolean:()=>lu,_coercedDate:()=>ku,_coercedNumber:()=>ru,_coercedString:()=>Ys,_creditCard:()=>eu,_cuid:()=>Ni,_cuid2:()=>Ui,_custom:()=>zu,_date:()=>xu,_decode:()=>Cr,_decodeAsync:()=>Vr,_default:()=>sb,_discriminatedUnion:()=>qy,_e164:()=>Fi,_email:()=>wi,_emoji:()=>Oi,_encode:()=>Er,_encodeAsync:()=>Zr,_endsWith:()=>Wt,_enum:()=>nb,_file:()=>Su,_float32:()=>ou,_float64:()=>au,_gt:()=>Me,_gte:()=>we,_guid:()=>Ii,_includes:()=>Gt,_int:()=>iu,_int32:()=>cu,_int64:()=>mu,_intersection:()=>Hy,_ipv4:()=>Ci,_ipv6:()=>Zi,_isoDate:()=>Xn,_isoDateTime:()=>Kn,_isoDuration:()=>Hn,_isoTime:()=>qn,_jwt:()=>Ji,_ksuid:()=>Ei,_lazy:()=>gb,_length:()=>xt,_literal:()=>ib,_lowercase:()=>Ft,_lt:()=>Le,_lte:()=>ke,_mac:()=>Qs,_map:()=>eb,_max:()=>ke,_maxLength:()=>_t,_maxSize:()=>et,_mime:()=>Kt,_min:()=>we,_minLength:()=>Ge,_minSize:()=>Re,_multipleOf:()=>Qe,_nan:()=>wu,_nanoid:()=>ji,_nativeEnum:()=>rb,_negative:()=>Bi,_never:()=>bu,_nonnegative:()=>Ki,_nonoptional:()=>ub,_nonpositive:()=>Wi,_normalize:()=>Xt,_null:()=>hu,_nullable:()=>cb,_number:()=>nu,_optional:()=>ab,_overwrite:()=>Ce,_parse:()=>At,_parseAsync:()=>Et,_pipe:()=>fb,_positive:()=>Gi,_promise:()=>vb,_properties:()=>qi,_property:()=>Xi,_readonly:()=>mb,_record:()=>Qy,_refine:()=>Pu,_regex:()=>Rt,_safeDecode:()=>Mr,_safeDecodeAsync:()=>Fr,_safeEncode:()=>Lr,_safeEncodeAsync:()=>Rr,_safeParse:()=>Ct,_safeParseAsync:()=>Zt,_set:()=>tb,_size:()=>bt,_slugify:()=>Qt,_startsWith:()=>Bt,_string:()=>Hs,_stringFormat:()=>en,_stringbool:()=>Nu,_success:()=>lb,_superRefine:()=>Du,_symbol:()=>gu,_templateLiteral:()=>pb,_toLowerCase:()=>Ht,_toUpperCase:()=>Yt,_transform:()=>ob,_trim:()=>qt,_tuple:()=>Yy,_uint32:()=>su,_uint64:()=>pu,_ulid:()=>Ti,_undefined:()=>vu,_union:()=>Ky,_unknown:()=>yu,_uppercase:()=>Jt,_url:()=>Wn,_uuid:()=>Si,_uuidv4:()=>zi,_uuidv6:()=>Pi,_uuidv7:()=>Di,_void:()=>_u,_xid:()=>Ai,_xor:()=>Xy,clone:()=>B,compile:()=>Xs,compileFn:()=>ki,config:()=>ne,createStandardJSONSchemaMethod:()=>tn,createToJSONSchemaMethod:()=>Tu,decode:()=>th,decodeAsync:()=>rh,describe:()=>Ou,encode:()=>eh,encodeAsync:()=>nh,extractDefs:()=>nt,finalize:()=>rt,flattenError:()=>Un,formatError:()=>Tn,getDiscriminatedOption:()=>vs,globalConfig:()=>ie,globalRegistry:()=>oe,handleUnrepresentable:()=>re,initializeContext:()=>tt,isBackEdge:()=>hi,isRecursiveSchema:()=>Fs,isValidBase64:()=>Vn,isValidBase64URL:()=>ai,isValidCIDRv6:()=>oi,isValidCreditCard:()=>ci,isValidIPv6:()=>Zn,isValidJWT:()=>si,locales:()=>Bn,memoizer:()=>Jn,mergeValues:()=>Lt,meta:()=>ju,parse:()=>Tr,parseAsync:()=>Ar,parseURLObject:()=>ti,prettifyError:()=>za,process:()=>W,regexes:()=>ue,registry:()=>xi,safeDecode:()=>oh,safeDecodeAsync:()=>ch,safeEncode:()=>ih,safeEncodeAsync:()=>ah,safeParse:()=>Pa,safeParseAsync:()=>Da,standardProps:()=>ei,stripTabAndNewline:()=>ni,toDotPath:()=>rf,toJSONSchema:()=>eo,toZod:()=>wn,treeifyError:()=>Sa,urlHostnameOk:()=>ri,urlProtocolOk:()=>ii,util:()=>_,validate:()=>Oa,validateAsync:()=>ja,version:()=>zc});var _={};Ve(_,{BIGINT_FORMAT_RANGES:()=>ga,CONSTANT_CATCH:()=>Nr,Class:()=>sa,NUMBER_FORMAT_RANGES:()=>pa,aborted:()=>qe,allowsEval:()=>da,assert:()=>yv,assertEqual:()=>gv,assertIs:()=>hv,assertNever:()=>$v,assertNotEqual:()=>vv,assignProp:()=>ee,attachSchema:()=>jr,base64ToUint8Array:()=>Hd,base64urlToUint8Array:()=>Cv,cached:()=>Ut,captureStackTrace:()=>Or,cleanEnum:()=>Ev,cleanRegex:()=>Sn,clone:()=>B,cloneDef:()=>_v,codePointLength:()=>ft,constantCatch:()=>ya,createTransparentProxy:()=>zv,defineLazy:()=>ua,defineLazyInternal:()=>M,esc:()=>fe,escapeRegex:()=>Pe,explicitlyAborted:()=>va,extend:()=>Ov,finalizeIssue:()=>pe,floatSafeRemainder:()=>zn,getElementAtPath:()=>xv,getEnumValues:()=>In,getLengthableOrigin:()=>jn,getParsedType:()=>Sv,getSizableOrigin:()=>On,hexToUint8Array:()=>Vv,hide:()=>$a,installLazyProp:()=>Jv,isObject:()=>dt,isPlainObject:()=>ze,issue:()=>Tt,joinValues:()=>g,jsonStringifyReplacer:()=>Nt,members:()=>ha,merge:()=>Nv,mergeDefs:()=>Ae,normalizeParams:()=>k,nullish:()=>Dr,numKeys:()=>Iv,objectClone:()=>bv,omit:()=>Dv,optionalKeys:()=>ma,own:()=>jt,parsedType:()=>b,partial:()=>Uv,pick:()=>Pv,prefixIssues:()=>me,primitiveTypes:()=>fa,promiseAllObject:()=>kv,propertyKeyTypes:()=>Dn,randomString:()=>wv,required:()=>Tv,safeExtend:()=>jv,shallowClone:()=>Pn,slugify:()=>la,stringifyPrimitive:()=>$,toZod:()=>wn,uint8ArrayToBase64:()=>Yd,uint8ArrayToBase64url:()=>Zv,uint8ArrayToHex:()=>Lv,unwrapMessage:()=>Ot});function gv(e){return e}function vv(e){return e}function wn(){return e=>e}function hv(e){}function $v(e){throw new Error("Unexpected value in exhaustive check")}function yv(e){}function In(e){let n=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,t])=>n.indexOf(+o)===-1).map(([o,t])=>t)}function g(e,n="|"){return e.map(i=>$(i)).join(n)}function Nt(e,n){return typeof n=="bigint"?n.toString():n}function Ut(e){return{get value(){{let i=e();return Object.defineProperty(this,"value",{value:i}),i}throw new Error("cached value already set")}}}function Dr(e){return e==null}function Sn(e){let n=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(n,i)}function zn(e,n){let i=e/n,o=Math.round(i),t=4*Number.EPSILON*Math.max(Math.abs(i),1);return Math.abs(i-o)<t?0:i-o}var qd=Symbol("evaluating");function ua(e,n,i){let o;Object.defineProperty(e,n,{get(){if(o!==qd)return o===void 0&&(o=qd,o=i()),o},set(t){Object.defineProperty(e,n,{value:t})},configurable:!0})}function bv(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function ee(e,n,i){Object.defineProperty(e,n,{value:i,writable:!0,enumerable:!0,configurable:!0})}function Ae(...e){let n={};for(let i of e){let o=Object.getOwnPropertyDescriptors(i);Object.assign(n,o)}return Object.defineProperties({},n)}function _v(e){return Ae(e._zod.def)}function xv(e,n){return n?n.reduce((i,o)=>i?.[o],e):e}function kv(e){let n=Object.keys(e),i=n.map(o=>e[o]);return Promise.all(i).then(o=>{let t={};for(let r=0;r<n.length;r++)t[n[r]]=o[r];return t})}function wv(e=10){let n="abcdefghijklmnopqrstuvwxyz",i="";for(let o=0;o<e;o++)i+=n[Math.floor(Math.random()*n.length)];return i}function fe(e){return JSON.stringify(e)}function la(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Or="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function dt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var da=Ut(()=>{if(ie.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function ze(e){if(dt(e)===!1)return!1;let n=e.constructor;if(n===void 0||typeof n!="function")return!0;let i=n.prototype;return!(dt(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function Pn(e){return ze(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Iv(e){let n=0;for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&n++;return n}var Sv=e=>{let n=typeof e;switch(n){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: ${n}`)}},Dn=new Set(["string","number","symbol"]),fa=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Pe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function B(e,n,i){let o=new e._zod.constr(n??e._zod.def);return(!n||i?.parent)&&(o._zod.parent=e),o}function k(e){let n=e;if(!n)return{};if(typeof n=="string")return{error:()=>n};if(n?.message!==void 0){if(n?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");n.error=n.message}return delete n.message,typeof n.error=="string"?{...n,error:()=>n.error}:n}function zv(e){let n;return new Proxy({},{get(i,o,t){return n??(n=e()),Reflect.get(n,o,t)},set(i,o,t,r){return n??(n=e()),Reflect.set(n,o,t,r)},has(i,o){return n??(n=e()),Reflect.has(n,o)},deleteProperty(i,o){return n??(n=e()),Reflect.deleteProperty(n,o)},ownKeys(i){return n??(n=e()),Reflect.ownKeys(n)},getOwnPropertyDescriptor(i,o){return n??(n=e()),Reflect.getOwnPropertyDescriptor(n,o)},defineProperty(i,o,t){return n??(n=e()),Reflect.defineProperty(n,o,t)}})}function $(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function ma(e){return Object.keys(e).filter(n=>e[n]._zod.optin!==void 0&&e[n]._zod.optout==="optional")}var pa={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]},ga={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Pv(e,n){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 r=Ae(e._zod.def,{get shape(){let a={};for(let c of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(i.shape,c))throw new Error(`Unrecognized key: "${String(c)}"`);n[c]&&ee(a,c,i.shape[c])}return ee(this,"shape",a),a},checks:[]});return B(e,r)}function Dv(e,n){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 r=Ae(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let c of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(i.shape,c))throw new Error(`Unrecognized key: "${String(c)}"`);n[c]&&delete a[c]}return ee(this,"shape",a),a},checks:[]});return B(e,r)}function Ov(e,n){if(!ze(n))throw new Error("Invalid input to extend: expected a plain object");let i=e._zod.def.checks;if(i&&i.length>0){let r=e._zod.def.shape;for(let a of Reflect.ownKeys(n))if(Object.getOwnPropertyDescriptor(r,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let t=Ae(e._zod.def,{get shape(){let r={...e._zod.def.shape,...n};return ee(this,"shape",r),r}});return B(e,t)}function jv(e,n){if(!ze(n))throw new Error("Invalid input to safeExtend: expected a plain object");let i=Ae(e._zod.def,{get shape(){let o={...e._zod.def.shape,...n};return ee(this,"shape",o),o}});return B(e,i)}function Nv(e,n){if(!n?._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=Ae(e._zod.def,{get shape(){let o={...e._zod.def.shape,...n._zod.def.shape};return ee(this,"shape",o),o},get catchall(){return n._zod.def.catchall},checks:n._zod.def.checks??[]});return B(e,i)}function Uv(e,n,i,o="partial"){let r=n._zod.def.checks;if(r&&r.length>0)throw new Error(`.${o}() cannot be used on object schemas containing refinements`);let c=Ae(n._zod.def,{get shape(){let s=n._zod.def.shape,u={...s};if(i)for(let l of Reflect.ownKeys(i)){if(!Object.prototype.hasOwnProperty.call(s,l))throw new Error(`Unrecognized key: "${String(l)}"`);i[l]&&(u[l]=e?new e({type:"optional",innerType:s[l]}):s[l])}else for(let l of Reflect.ownKeys(s))u[l]=e?new e({type:"optional",innerType:s[l]}):s[l];return ee(this,"shape",u),u},checks:[]});return B(n,c)}function Tv(e,n,i){let o=Ae(n._zod.def,{get shape(){let t=n._zod.def.shape,r={...t};if(i)for(let a of Reflect.ownKeys(i)){if(!Object.prototype.hasOwnProperty.call(r,a))throw new Error(`Unrecognized key: "${String(a)}"`);i[a]&&(r[a]=new e({type:"nonoptional",innerType:t[a]}))}else for(let a of Reflect.ownKeys(t))r[a]=new e({type:"nonoptional",innerType:t[a]});return ee(this,"shape",r),r}});return B(n,o)}function qe(e,n=0){if(e.aborted===!0)return!0;for(let i=n;i<e.issues.length;i++)if(e.issues[i]?.continue!==!0)return!0;return!1}function va(e,n=0){if(e.aborted===!0)return!0;for(let i=n;i<e.issues.length;i++)if(e.issues[i]?.continue===!1)return!0;return!1}function me(e,n){return n.map(i=>{var o;return(o=i).path??(o.path=[]),i.path.unshift(e),i})}function Ot(e){return typeof e=="string"?e:e?.message}function jr(e,n,i){var o;for(let t=n;t<e.length;t++)(o=e[t]).schema??(o.schema=i)}function pe(e,n,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 r=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,a=e.message?e.message:Ot(e.inst?._zod.def?.error?.(e))??Ot(r?.(e))??Ot(n?.error?.(e))??Ot(i.customError?.(e))??Ot(i.localeError?.(e))??"Invalid input",{inst:c,schema:s,continue:u,input:l,...d}=e;return d.path??(d.path=[]),d.message=a,n?.reportInput&&(d.input=l),d}function On(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var Av=/[\uD800-\uDBFF]/;function ft(e){let n=e.length;if(!Av.test(e))return n;let i=n;for(let o=0;o<n-1;o++)(e.charCodeAt(o)&64512)===55296&&(e.charCodeAt(o+1)&64512)===56320&&(i--,o++);return i}function jn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function b(e){let n=typeof e;switch(n){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 n}function Tt(...e){let[n,i,o]=e;return typeof n=="string"?{message:n,code:"custom",input:i,inst:o}:{...n}}function Ev(e){return Object.entries(e).filter(([n,i])=>Number.isNaN(Number.parseInt(n,10))).map(n=>n[1])}function Hd(e){let n=atob(e),i=new Uint8Array(n.length);for(let o=0;o<n.length;o++)i[o]=n.charCodeAt(o);return i}function Yd(e){let n="";for(let i=0;i<e.length;i++)n+=String.fromCharCode(e[i]);return btoa(n)}function Cv(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),i="=".repeat((4-n.length%4)%4);return Hd(n+i)}function Zv(e){return Yd(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Vv(e){let n=e.replace(/^0x/,"");if(n.length%2!==0)throw new Error("Invalid hex string length");let i=new Uint8Array(n.length/2);for(let o=0;o<n.length;o+=2)i[o/2]=Number.parseInt(n.slice(o,o+2),16);return i}function Lv(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}var sa=class{constructor(...n){}};function ha(e,n){for(let i in n){let o=Object.getOwnPropertyDescriptor(n,i);o.get?Object.defineProperty(e,i,{...o,enumerable:!1}):Mv(e,i,o.value)}}function jt(e,n,i,o=!0){return Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:o,value:i}),i}function $a(e,n,i){return jt(e,n,i,!1)}function Mv(e,n,i){Object.defineProperty(e,n,{configurable:!0,get(){return this==null?i:jt(this,n,i.bind(this))},set(o){jt(this,n,o)}})}function Rv(e,n){let i=Object.getPrototypeOf(e);return n in i?void 0:i}var ca,Xe=!1,Fv={configurable:!0,get(){Xe=!0}};function M(e,n,i){let o=Object.getPrototypeOf(e._zod);if(n in o&&ca!==e._zod){ca=void 0;return}ca=e._zod,Object.defineProperty(o,n,{configurable:!0,get(){Object.defineProperty(this,n,Fv);let t=Xe;Xe=!1;try{let r=i(this);return Xe?delete this[n]:Object.defineProperty(this,n,{configurable:!0,writable:!0,value:r}),Xe=Xe||t,r}catch(r){throw delete this[n],Xe=Xe||t,r}},set(t){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:t})}})}function Jv(e,n,i,o){let t=Rv(e,n);t&&Object.defineProperty(t,n,{configurable:!0,get(){let r={configurable:!0,writable:!0,enumerable:o,value:void 0};return Object.defineProperty(this,n,r),r.value=i(this),Object.defineProperty(this,n,r),r.value},set(r){Object.defineProperty(this,n,{configurable:!0,writable:!0,enumerable:o,value:r})}})}var Nr="~constantCatch";function ya(e){let n=()=>e;return n[Nr]=!0,n}var Qd,_a=Object.freeze({status:"aborted"}),ba={value:void 0,enumerable:!1},ef="captureStackTrace"in Error?Error:null;function Gv(e){let n=ef;if(n){let i=n.stackTraceLimit;if(typeof i=="number"){try{n.stackTraceLimit=0}catch{return ef=null,new e}try{return new e}finally{n.stackTraceLimit=i}}}return new e}function p(e,n,i,o){let t={};function r(f){this.def=f,this.constr=d,this.traits=new Set}r.prototype=t;let a=i,c=a&&new WeakSet;function s(f,m){if(!f._zod){ba.value=new r(m);try{Object.defineProperty(f,"_zod",ba)}finally{ba.value=void 0}}if(f._zod.traits.has(e))return;if(f._zod.traits.add(e),n(f,m),c){let y=Object.getPrototypeOf(f),x=f._zod.constr.prototype,I=y;for(;I&&I!==x;)I=Object.getPrototypeOf(I);let h=I??y;c.has(h)||(c.add(h),ha(h,a))}let v=d.prototype;for(let y in v)Object.prototype.hasOwnProperty.call(v,y)&&(y in f||(f[y]=v[y].bind(f)))}let u=o?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:e});function d(f){let m=o?.Parent?Gv(l):this;s(m,f);let v=m._zod.deferred;if(v){for(let x of v)x();m._zod.deferred=void 0}let y=globalThis.__zod_globalConfig?.postProcessor;return y&&y(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 xa=Symbol("zod_brand"),ge=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},He=class extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}};(Qd=globalThis).__zod_globalConfig??(Qd.__zod_globalConfig={});var ie=globalThis.__zod_globalConfig;function ne(e){return e&&Object.assign(ie,e),ie}function Bv(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Nt,2)),e.message}function Wv(e){this._zod.message=e}var Kv={get:Bv,set:Wv,enumerable:!0,configurable:!0},wa={value:void 0,enumerable:!1},Ia={value:void 0,enumerable:!1},tf=new WeakSet([Object.prototype,Error.prototype]),nf=(e,n)=>{e.name="$ZodError",wa.value=e._zod,Object.defineProperty(e,"_zod",wa),Ia.value=n,Object.defineProperty(e,"issues",Ia),wa.value=void 0,Ia.value=void 0,Object.defineProperty(e,"message",Kv);let i=Object.getPrototypeOf(e);tf.has(i)||(tf.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})}}))},Nn=p("$ZodError",nf),ve=p("$ZodError",nf,void 0,{Parent:Error});function Xv(e,n,i){return Object.prototype.hasOwnProperty.call(e,n)||(n==="__proto__"?Object.defineProperty(e,n,{value:i(),writable:!0,enumerable:!0,configurable:!0}):e[n]=i()),e[n]}function Un(e,n=i=>i.message){let i={},o=[];for(let t of e.issues)t.path.length>0?Xv(i,t.path[0],()=>[]).push(n(t)):o.push(n(t));return{formErrors:o,fieldErrors:i}}function Tn(e,n=i=>i.message){let i={_errors:[]},o=(t,r=[])=>{for(let a of t.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>o({issues:c},[...r,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...r,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...r,...a.path]);else{let c=[...r,...a.path];if(c.length===0)i._errors.push(n(a));else{let s=i,u=0;for(;u<c.length;){let l=c[u],d=u===c.length-1;if(l==="_errors"){d&&s._errors.push(n(a)),u++;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(n(a)),s=f,u++}}}};return o(e),i}function Sa(e,n=i=>i.message){let i={errors:[]},o=(t,r=[])=>{var a;for(let c of t.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(s=>o({issues:s},[...r,...c.path]));else if(c.code==="invalid_key")o({issues:c.issues},[...r,...c.path]);else if(c.code==="invalid_element")o({issues:c.issues},[...r,...c.path]);else{let s=[...r,...c.path];if(s.length===0){i.errors.push(n(c));continue}let u=i,l=0;for(;l<s.length;){let d=s[l],f=l===s.length-1;typeof d=="string"?(u.properties??(u.properties={}),Object.prototype.hasOwnProperty.call(u.properties,d)||Object.defineProperty(u.properties,d,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),u=u.properties[d]):(u.items??(u.items=[]),(a=u.items)[d]??(a[d]={errors:[]}),u=u.items[d]),f&&u.errors.push(n(c)),l++}}};return o(e),i}function rf(e){let n=[],i=e.map(o=>typeof o=="object"?o.key:o);for(let o of i)typeof o=="number"?n.push(`[${o}]`):typeof o=="symbol"?n.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?n.push(`[${JSON.stringify(o)}]`):(n.length&&n.push("."),n.push(o));return n.join("")}function za(e){let n=[],i=[...e.issues].sort((o,t)=>(o.path??[]).length-(t.path??[]).length);for(let o of i)n.push(`\u2716 ${o.message}`),o.path?.length&&n.push(` \u2192 at ${rf(o.path)}`);return n.join(`
|
|
3
3
|
`)}function Ur(e,n){return{callee:n?.callee??e,Err:n?.Err}}var At=e=>{let n=(i,o,t,r)=>{let a=t?{...t,async:!1}:{async:!1},c=i._zod.run({value:o,issues:[]},a);if(c instanceof Promise)throw new ge;if(c.issues.length){let s=new(r?.Err??e)(c.issues.map(u=>pe(u,a,ne())));throw Or(s,r?.callee??n),s}return c.value};return n},Tr=At(ve),Et=e=>{let n=async(i,o,t,r)=>{let a=t?{...t,async:!0}:{async:!0},c=i._zod.run({value:o,issues:[]},a);if(c instanceof Promise&&(c=await c),c.issues.length){let s=new(r?.Err??e)(c.issues.map(u=>pe(u,a,ne())));throw Or(s,r?.callee??n),s}return c.value};return n},Ar=Et(ve),Ct=e=>(n,i,o)=>{let t=o?{...o,async:!1}:{async:!1},r=n._zod.run({value:i,issues:[]},t);if(r instanceof Promise)throw new ge;return r.issues.length?{success:!1,error:new(e??Nn)(r.issues.map(a=>pe(a,t,ne())))}:{success:!0,data:r.value}},Pa=Ct(ve),Zt=e=>async(n,i,o)=>{let t=o?{...o,async:!0}:{async:!0},r=n._zod.run({value:i,issues:[]},t);return r instanceof Promise&&(r=await r),r.issues.length?{success:!1,error:new e(r.issues.map(a=>pe(a,t,ne())))}:{success:!0,data:r.value}},Da=Zt(ve),Hv=Symbol.for("zod.compile.invalid"),Yv=Symbol.for("zod.compile.fallback"),Oa=((e,n,i)=>{let o=e._zod.bag.validator;return o!==void 0&&o(n)!==Hv?!0:Qv(e,n,i)});function Qv(e,n,i){let o=i?{...i,async:!1}:{async:!1},t=e._zod.bag.fallbackRun,r;if(t?(o[Yv]=!0,r=t({value:n,issues:[]},o)):r=e._zod.run({value:n,issues:[]},o),r instanceof Promise)throw new ge;return r.issues.length===0}var ja=async(e,n,i)=>{let o=i?{...i,async:!0}:{async:!0},t=e._zod.run({value:n,issues:[]},o);return t instanceof Promise&&(t=await t),t.issues.length===0},Er=e=>{let n=At(e),i=(o,t,r,a)=>{let c=r?{...r,direction:"backward"}:{direction:"backward"};return n(o,t,c,Ur(i,a))};return i},eh=Er(ve),Cr=e=>{let n=At(e),i=(o,t,r,a)=>n(o,t,r,Ur(i,a));return i},th=Cr(ve),Zr=e=>{let n=Et(e),i=async(o,t,r,a)=>{let c=r?{...r,direction:"backward"}:{direction:"backward"};return await n(o,t,c,Ur(i,a))};return i},nh=Zr(ve),Vr=e=>{let n=Et(e),i=async(o,t,r,a)=>await n(o,t,r,Ur(i,a));return i},rh=Vr(ve),Lr=e=>(n,i,o)=>{let t=o?{...o,direction:"backward"}:{direction:"backward"};return Ct(e)(n,i,t)},ih=Lr(ve),Mr=e=>(n,i,o)=>Ct(e)(n,i,o),oh=Mr(ve),Rr=e=>async(n,i,o)=>{let t=o?{...o,direction:"backward"}:{direction:"backward"};return Zt(e)(n,i,t)},ah=Rr(ve),Fr=e=>async(n,i,o)=>Zt(e)(n,i,o),ch=Fr(ve);var ue={};Ve(ue,{base64:()=>Xa,base64url:()=>Jr,bigint:()=>nc,boolean:()=>rc,browserEmail:()=>gh,cidrv4:()=>Wa,cidrv6:()=>Ka,creditCard:()=>Gr,cuid:()=>Ua,cuid2:()=>Ta,date:()=>Ya,datetime:()=>ec,domain:()=>$h,duration:()=>La,e164:()=>Ha,email:()=>Ra,emoji:()=>Fa,extendedDuration:()=>sh,guid:()=>Ma,hex:()=>bh,hostname:()=>hh,html5Email:()=>fh,httpProtocol:()=>qa,idnEmail:()=>ph,integer:()=>An,ipv4:()=>Ja,ipv6:()=>Ga,ksuid:()=>Ca,lowercase:()=>ac,mac:()=>Ba,md5_base64:()=>xh,md5_base64url:()=>kh,md5_hex:()=>_h,nanoid:()=>Za,nanoidOfLength:()=>Va,null:()=>ic,number:()=>Ye,rfc5322Email:()=>mh,sha1_base64:()=>Ih,sha1_base64url:()=>Sh,sha1_hex:()=>wh,sha256_base64:()=>Ph,sha256_base64url:()=>Dh,sha256_hex:()=>zh,sha384_base64:()=>jh,sha384_base64url:()=>Nh,sha384_hex:()=>Oh,sha512_base64:()=>Th,sha512_base64url:()=>Ah,sha512_hex:()=>Uh,string:()=>tc,time:()=>Qa,ulid:()=>Aa,undefined:()=>oc,unicodeEmail:()=>of,uppercase:()=>cc,uuid:()=>mt,uuid4:()=>uh,uuid6:()=>lh,uuid7:()=>dh,xid:()=>Ea});var Ua=/^[cC][0-9a-z]{6,}$/,Ta=/^[0-9a-z]+$/,Aa=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Ea=/^[0-9a-vA-V]{20}$/,Ca=/^[A-Za-z0-9]{27}$/,Za=/^[a-zA-Z0-9_-]{21}$/;function Va(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var La=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,sh=/^[-+]?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)?)??$/,Ma=/^([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})$/,mt=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)$/,uh=mt(4),lh=mt(6),dh=mt(7),Ra=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,fh=/^[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])?)*$/,mh=/^(([^<>()\[\]\\.,;:\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,}))$/,of=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,ph=of,gh=/^[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])?)*$/,vh="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Fa(){return new RegExp(vh,"u")}var Ja=/^(?:(?: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])$/,Ga=/^(([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}|:))$/,Ba=e=>{let n=Pe(e??":");return new RegExp(`^(?:[0-9A-F]{2}${n}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${n}){5}[0-9a-f]{2}$`)},Wa=/^((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])$/,Ka=/^(([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])$/,Xa=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Jr=/^[A-Za-z0-9_-]*$/,hh=/^(?=.{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])?)*\.?$/,$h=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,qa=/^https?$/,Ha=/^\+[1-9]\d{6,14}$/,Gr=/^\d(?:[ -]?\d){11,18}$/,af="(?:(?:\\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 yh(e){return new RegExp(`^${e}$`)}var Ya=yh(af);function Na(e){let n="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${n}`:e.precision===0?`${n}:[0-5]\\d`:`${n}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${n}:[0-5]\\d(?:\\.\\d+)?`:`${n}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Qa(e){return new RegExp(`^${Na(e)}$`)}function ec(e){let n=["Z"];e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${Na({precision:e.precision,seconds:!0})}(?:${n.join("|")})`,o=e.local?`${i}|${Na({precision:e.precision})}`:i;return new RegExp(`^${af}T(?:${o})$`)}var tc=e=>{let n=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${n}$`)},nc=/^-?\d+n?$/,An=/^-?\d+$/,Ye=/^-?\d+(?:\.\d+)?$/,rc=/^(?:true|false)$/i,ic=/^null$/i;var oc=/^undefined$/i;var ac=/^[^A-Z]*$/,cc=/^[^a-z]*$/,bh=/^[0-9a-fA-F]*$/;function En(e,n){return new RegExp(`^[A-Za-z0-9+/]{${e}}${n}$`)}function Cn(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var _h=/^[0-9a-fA-F]{32}$/,xh=En(22,"=="),kh=Cn(22),wh=/^[0-9a-fA-F]{40}$/,Ih=En(27,"="),Sh=Cn(27),zh=/^[0-9a-fA-F]{64}$/,Ph=En(43,"="),Dh=Cn(43),Oh=/^[0-9a-fA-F]{96}$/,jh=En(64,""),Nh=Cn(64),Uh=/^[0-9a-fA-F]{128}$/,Th=En(86,"=="),Ah=Cn(86);var H=p("$ZodCheck",(e,n)=>{var i;e._zod??(e._zod={}),e._zod.def=n,(i=e._zod).onattach??(i.onattach=[])}),sc=e=>{let n=e.value;return!Dr(n)&&n.size!==void 0},uc=e=>{let n=e.value;return!Dr(n)&&n.length!==void 0},Br={number:"number",bigint:"bigint",object:"date"},Wr=p("$ZodCheckLessThan",(e,n)=>{H.init(e,n);let i=Br[typeof n.value];e._zod.onattach.push(o=>{let t=o._zod.bag,r=(n.inclusive?t.maximum:t.exclusiveMaximum)??Number.POSITIVE_INFINITY;n.value<r&&(n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value)}),e._zod.check=o=>{(n.inclusive?o.value<=n.value:o.value<n.value)||o.issues.push({origin:Br[typeof o.value]??i,code:"too_big",maximum:typeof n.value=="object"?n.value.getTime():n.value,input:o.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),Kr=p("$ZodCheckGreaterThan",(e,n)=>{H.init(e,n);let i=Br[typeof n.value];e._zod.onattach.push(o=>{let t=o._zod.bag,r=(n.inclusive?t.minimum:t.exclusiveMinimum)??Number.NEGATIVE_INFINITY;n.value>r&&(n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value)}),e._zod.check=o=>{(n.inclusive?o.value>=n.value:o.value>n.value)||o.issues.push({origin:Br[typeof o.value]??i,code:"too_small",minimum:typeof n.value=="object"?n.value.getTime():n.value,input:o.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),lc=p("$ZodCheckMultipleOf",(e,n)=>{H.init(e,n),e._zod.onattach.push(i=>{var o;(o=i._zod.bag).multipleOf??(o.multipleOf=n.value)}),e._zod.check=i=>{if(typeof i.value!=typeof n.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof i.value=="bigint"?n.value!==BigInt(0)&&i.value%n.value===BigInt(0):zn(i.value,n.value)===0)||i.issues.push({origin:typeof i.value,code:"not_multiple_of",divisor:n.value,input:i.value,inst:e,continue:!n.abort})}}),dc=p("$ZodCheckNumberFormat",(e,n)=>{H.init(e,n),n.format=n.format||"float64";let i=n.format?.includes("int"),o=i?"int":"number",[t,r]=pa[n.format];e._zod.onattach.push(a=>{let c=a._zod.bag;c.format=n.format,c.minimum=t,c.maximum=r,i&&(c.pattern=An)}),e._zod.check=a=>{let c=a.value;if(i){if(!Number.isInteger(c)){a.issues.push({expected:o,format:n.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?a.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!n.abort}):a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!n.abort});return}}c<t&&a.issues.push({origin:"number",input:c,code:"too_small",minimum:t,inclusive:!0,inst:e,continue:!n.abort}),c>r&&a.issues.push({origin:"number",input:c,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!n.abort})}}),fc=p("$ZodCheckBigIntFormat",(e,n)=>{H.init(e,n);let[i,o]=ga[n.format];e._zod.onattach.push(t=>{let r=t._zod.bag;r.format=n.format,r.minimum=i,r.maximum=o}),e._zod.check=t=>{let r=t.value;r<i&&t.issues.push({origin:"bigint",input:r,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!n.abort}),r>o&&t.issues.push({origin:"bigint",input:r,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!n.abort})}}),mc=p("$ZodCheckMaxSize",(e,n)=>{var i;H.init(e,n),(i=e._zod.def).when??(i.when=sc),e._zod.onattach.push(o=>{let t=o._zod.bag.maximum??Number.POSITIVE_INFINITY;n.maximum<t&&(o._zod.bag.maximum=n.maximum)}),e._zod.check=o=>{let t=o.value;t.size<=n.maximum||o.issues.push({origin:On(t),code:"too_big",maximum:n.maximum,inclusive:!0,input:t,inst:e,continue:!n.abort})}}),pc=p("$ZodCheckMinSize",(e,n)=>{var i;H.init(e,n),(i=e._zod.def).when??(i.when=sc),e._zod.onattach.push(o=>{let t=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;n.minimum>t&&(o._zod.bag.minimum=n.minimum)}),e._zod.check=o=>{let t=o.value;t.size>=n.minimum||o.issues.push({origin:On(t),code:"too_small",minimum:n.minimum,inclusive:!0,input:t,inst:e,continue:!n.abort})}}),gc=p("$ZodCheckSizeEquals",(e,n)=>{var i;H.init(e,n),(i=e._zod.def).when??(i.when=sc),e._zod.onattach.push(o=>{let t=o._zod.bag;t.minimum=n.size,t.maximum=n.size,t.size=n.size}),e._zod.check=o=>{let t=o.value,r=t.size;if(r===n.size)return;let a=r>n.size;o.issues.push({origin:On(t),...a?{code:"too_big",maximum:n.size}:{code:"too_small",minimum:n.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!n.abort})}}),vc=p("$ZodCheckMaxLength",(e,n)=>{var i;H.init(e,n),(i=e._zod.def).when??(i.when=uc),e._zod.onattach.push(o=>{let t=o._zod.bag.maximum??Number.POSITIVE_INFINITY;n.maximum<t&&(o._zod.bag.maximum=n.maximum)}),e._zod.check=o=>{let t=o.value,r=t.length;if((typeof t=="string"&&r>n.maximum?ft(t):r)<=n.maximum)return;let c=jn(t);o.issues.push({origin:c,code:"too_big",maximum:n.maximum,inclusive:!0,input:t,inst:e,continue:!n.abort})}}),hc=p("$ZodCheckMinLength",(e,n)=>{var i;H.init(e,n),(i=e._zod.def).when??(i.when=uc),e._zod.onattach.push(o=>{let t=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;n.minimum>t&&(o._zod.bag.minimum=n.minimum)}),e._zod.check=o=>{let t=o.value,r=t.length;if((typeof t=="string"&&r>=n.minimum&&r<n.minimum*2?ft(t):r)>=n.minimum)return;let c=jn(t);o.issues.push({origin:c,code:"too_small",minimum:n.minimum,inclusive:!0,input:t,inst:e,continue:!n.abort})}}),$c=p("$ZodCheckLengthEquals",(e,n)=>{var i;H.init(e,n),(i=e._zod.def).when??(i.when=uc),e._zod.onattach.push(o=>{let t=o._zod.bag;t.minimum=n.length,t.maximum=n.length,t.length=n.length}),e._zod.check=o=>{let t=o.value,r=t.length,a=typeof t=="string"&&r>=n.length&&r<=n.length*2?ft(t):r;if(a===n.length)return;let c=jn(t),s=a>n.length;o.issues.push({origin:c,...s?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!n.abort})}}),Vt=p("$ZodCheckStringFormat",(e,n)=>{var i,o;H.init(e,n),e._zod.onattach.push(t=>{let r=t._zod.bag;r.format=n.format,n.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(n.pattern))}),n.pattern?(i=e._zod).check??(i.check=t=>{n.pattern.lastIndex=0,!n.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:n.format,input:t.value,...n.pattern?{pattern:n.pattern.toString()}:{},inst:e,continue:!n.abort})}):(o=e._zod).check??(o.check=()=>{})}),yc=p("$ZodCheckRegex",(e,n)=>{Vt.init(e,n),e._zod.check=i=>{n.pattern.lastIndex=0,!n.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:n.pattern.toString(),inst:e,continue:!n.abort})}}),bc=p("$ZodCheckLowerCase",(e,n)=>{n.pattern??(n.pattern=ac),Vt.init(e,n)}),_c=p("$ZodCheckUpperCase",(e,n)=>{n.pattern??(n.pattern=cc),Vt.init(e,n)}),xc=p("$ZodCheckIncludes",(e,n)=>{H.init(e,n);let i=Pe(n.includes),o=new RegExp(typeof n.position=="number"?`^.{${n.position},}${i}`:i);n.pattern=o,e._zod.onattach.push(t=>{let r=t._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(o)}),e._zod.check=t=>{t.value.includes(n.includes,n.position)||t.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:n.includes,input:t.value,inst:e,continue:!n.abort})}}),kc=p("$ZodCheckStartsWith",(e,n)=>{H.init(e,n);let i=new RegExp(`^${Pe(n.prefix)}.*`);n.pattern??(n.pattern=i),e._zod.onattach.push(o=>{let t=o._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(i)}),e._zod.check=o=>{o.value.startsWith(n.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:n.prefix,input:o.value,inst:e,continue:!n.abort})}}),wc=p("$ZodCheckEndsWith",(e,n)=>{H.init(e,n);let i=new RegExp(`.*${Pe(n.suffix)}$`);n.pattern??(n.pattern=i),e._zod.onattach.push(o=>{let t=o._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(i)}),e._zod.check=o=>{o.value.endsWith(n.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:n.suffix,input:o.value,inst:e,continue:!n.abort})}});function cf(e,n,i){e.issues.length&&n.issues.push(...me(i,e.issues))}var Xr=p("$ZodCheckProperty",(e,n)=>{H.init(e,n),e._zod.check=i=>{let o=n.schema._zod.run({value:i.value[n.property],issues:[]},{});if(o instanceof Promise)return o.then(t=>cf(t,i,n.property));cf(o,i,n.property)}}),Ic=p("$ZodCheckMimeType",(e,n)=>{H.init(e,n);let i=new Set(n.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=n.mime}),e._zod.check=o=>{i.has(o.value.type)||o.issues.push({code:"invalid_value",values:n.mime,input:o.value.type,inst:e,continue:!n.abort})}}),Sc=p("$ZodCheckOverwrite",(e,n)=>{H.init(e,n),e._zod.check=i=>{i.value=n.tx(i.value)}});var pt=class{constructor(n=[],i={}){this.content=[],this.indent=0,this.args=n,this.closed=i}indented(n){this.indent+=1,n(this),this.indent-=1}write(n){if(typeof n=="function"){n(this,{execution:"sync"}),n(this,{execution:"async"});return}let o=n.split(`
|
|
4
4
|
`).filter(a=>a),t=Math.min(...o.map(a=>a.length-a.trimStart().length)),r=o.map(a=>a.slice(t)).map(a=>" ".repeat(this.indent*2)+a);for(let a of r)this.content.push(a)}compile(){let n=Function,i=this?.content??[""];return new n(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
5
5
|
${i.join(`
|
|
@@ -55,4 +55,4 @@ ${s}`:s:"",l=Function,d=`return (input) => {
|
|
|
55
55
|
${s}
|
|
56
56
|
}`,f;try{f=new l(...a,d)(...c)}catch(m){throw new R(`this schema (generated code failed to evaluate: ${m.message})`)}return n?.debug&&(f.code=u),f}function N(e,n){for(let[o,t]of e.constants)if(t===n)return o;let i=`c${e.constantCounter++}`;return e.constants.set(i,n),i}function T(e){return`v${e.varCounter++}`}function Y$(e,n){let i=e._zod.run({value:n,issues:[]},{});if(i&&typeof i.then=="function")return xe;let o=i;return o.issues.length===0?o.value:xe}function le(e,n,i,o,t=!0){let r=e.content.length,a=n.constants.size,c=n.constantCounter,s=n.varCounter;try{return Q(e,n,i,o,t)}catch(u){if(!(u instanceof R)||!u.islandable)throw u;if(e.content.length=r,n.constants.size>a){let l=Array.from(n.constants.keys()).slice(a);for(let d of l)n.constants.delete(d)}return n.constantCounter=c,n.varCounter=s,Q$(e,n,i,o)}}function Q$(e,n,i,o){let t=N(n,i),r=N(n,Y$),a=T(n);return e.write(`const ${a} = ${r}(${t}, ${o});`),e.write(`if (${a} === INVALID) return INVALID;`),a}var ey=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);function ty(e,n,i,o){let t=i._zod.def.checks;if(!t||t.length===0)return o;let r=o;for(let a of t){let c=a._zod.def;if(c.when&&!ey.has(c.check))throw new R('check with a custom "when" condition');switch(c.check){case"greater_than":ny(e,n,c,r);break;case"less_than":ry(e,n,c,r);break;case"multiple_of":iy(e,n,c,r);break;case"number_format":Gm(e,c,r);break;case"min_length":{let s=vt(c.minimum,"min_length"),u=Bs(e,n,r,`${r}.length >= ${s} && ${r}.length < ${c.minimum*2}`);e.write(`if (${u} < ${s}) return INVALID;`);break}case"max_length":{let s=vt(c.maximum,"max_length"),u=Bs(e,n,r,`${r}.length > ${s}`);e.write(`if (${u} > ${s}) return INVALID;`);break}case"length_equals":{let s=vt(c.length,"length_equals"),u=Bs(e,n,r,`${r}.length >= ${s} && ${r}.length <= ${c.length*2}`);e.write(`if (${u} !== ${s}) return INVALID;`);break}case"min_size":e.write(`if (${r}.size < ${vt(c.minimum,"min_size")}) return INVALID;`);break;case"max_size":e.write(`if (${r}.size > ${vt(c.maximum,"max_size")}) return INVALID;`);break;case"size_equals":e.write(`if (${r}.size !== ${vt(c.size,"size_equals")}) return INVALID;`);break;case"string_format":r=Bm(e,n,c,r);break;case"custom":r=uy(e,n,a,r);break;case"bigint_format":oy(e,c,r);break;case"mime_type":ay(e,n,c,r);break;case"property":cy(e,n,c,r);break;case"overwrite":{let s=T(n);sy(e,n,a,r,s),r=s;break}default:throw new R(`check type ${c.check}`)}}return r}function Bs(e,n,i,o){let t=N(n,ft),r=T(n);return e.write(`const ${r} = typeof ${i} === "string" && ${o} ? ${t}(${i}) : ${i}.length;`),r}function vt(e,n){if(typeof e!="number"||!Number.isFinite(e))throw new R(`${n} bound of type ${typeof e}`);return`${e}`}function Jm(e,n){if(typeof n=="bigint")return`${n}n`;if(typeof n=="number"){if(Number.isNaN(n))throw new R("comparison check with NaN bound");return`${n}`}if(n instanceof Date){if(Number.isNaN(n.getTime()))throw new R("comparison check with Invalid Date bound");return N(e,n)}throw new R(`comparison check bound of type ${typeof n}`)}function ny(e,n,i,o){let t=i.inclusive?"<":"<=";e.write(`if (${o} ${t} ${Jm(n,i.value)}) return INVALID;`)}function ry(e,n,i,o){let t=i.inclusive?">":">=";e.write(`if (${o} ${t} ${Jm(n,i.value)}) return INVALID;`)}function iy(e,n,i,o){if(typeof i.value=="bigint"){if(i.value===BigInt(0))throw new R("multiple_of check with a zero divisor");e.write(`if (${o} % ${i.value}n !== 0n) return INVALID;`)}else{let t=N(n,zn);e.write(`if (${t}(${o}, ${vt(i.value,"multiple_of")}) !== 0) return INVALID;`)}}function Gm(e,n,i){let o=n.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 R(`number format ${o}`)}}function oy(e,n,i){let o=n.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 R(`bigint format ${o}`)}}function ay(e,n,i,o){let t=i.mime;if(t&&t.length>0){let r=N(n,new Set(t));e.write(`if (!${r}.has(${o}.type)) return INVALID;`)}}function cy(e,n,i,o){let t=`${o}[${JSON.stringify(i.property)}]`;Q(e,n,i.schema,t)}function sy(e,n,i,o,t){let r=i._zod.def.tx;if(!r)throw new R("overwrite check without a transform function");if(yt(r))throw new Ee("z.compile: async overwrite transforms are not supported");let a=N(n,r);e.write(`const ${t} = ${a}(${o});`)}function Ws(){throw new ge}function qs(e){this.issues.push(e)}function uy(e,n,i,o){let t=i._zod.def;if(t.fn){if(yt(t.fn))throw new Ee("z.compile: async .refine() predicates are not supported");let r=N(n,t.fn),a=N(n,Ws),c=T(n);return e.write(`const ${c} = ${r}(${o});`),e.write(`if (${c} instanceof Promise) ${a}();`),e.write(`if (!${c}) return INVALID;`),o}if(i._zod.check){if(yt(i._zod.check))throw new Ee("z.compile: async .superRefine() / check functions are not supported");let r=i._zod.check,c=N(n,u=>{let l={value:u,issues:[],addIssue:qs};return r(l)instanceof Promise&&Ws(),l.issues.length===0?l.value:xe}),s=T(n);return e.write(`const ${s} = ${c}(${o});`),e.write(`if (${s} === INVALID) return INVALID;`),s}throw new R("custom check without a predicate or check function")}var ly=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 Bm(e,n,i,o){let t=i.format;if(t==="base64"){let s=N(n,Vn);return e.write(`if (!${s}(${o})) return INVALID;`),o}if(t==="base64url"){let s=N(n,ai);return e.write(`if (!${s}(${o})) return INVALID;`),o}if(t==="jwt"){let s=N(n,si),u=N(n,i.alg??null);return e.write(`if (!${s}(${o}, ${u})) return INVALID;`),o}if(t==="ipv6"){let s=N(n,Zn);return e.write(`if (!${s}(${o})) return INVALID;`),o}if(t==="cidrv6"){let s=N(n,oi);return e.write(`if (!${s}(${o})) return INVALID;`),o}if(t==="credit_card"){let s=N(n,ci);return e.write(`if (!${s}(${o})) return INVALID;`),o}let r=i;if(t==="url"||t==="httpurl"||r.normalize||r.hostname!==void 0||r.protocol!==void 0){let s=N(n,ti),u=N(n,i),l=T(n),d=T(n);if(e.write(`const ${l} = ${o}.trim();`),e.write(`const ${d} = ${s}(${l}, ${u});`),e.write(`if (typeof ${d} === "number") return INVALID;`),r.hostname!==void 0){let v=N(n,ri);e.write(`if (!${v}(${d}, ${u}.hostname)) return INVALID;`)}if(r.protocol!==void 0){let v=N(n,ii);e.write(`if (!${v}(${d}, ${u}.protocol)) return INVALID;`)}let f=T(n),m=r.normalize?`${d}.href`:`${N(n,ni)}(${l})`;return e.write(`const ${f} = ${m};`),f}let a=i.fn;if(a){if(yt(a))throw new R(`async string format ${t}`);let s=N(n,a);return e.write(`if (!${s}(${o})) return INVALID;`),o}if(ly.has(t)&&i.pattern){let s=N(n,i.pattern);return e.write(`${s}.lastIndex = 0;`),e.write(`if (!${s}.test(${o})) return INVALID;`),o}let c=i.format;switch(c){case"regex":throw new R("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(${fe(i.includes)})) return INVALID;`);break;case"starts_with":{let s=i.prefix;e.write(`if (${o}.slice(0, ${s.length}) !== ${fe(s)}) return INVALID;`);break}case"ends_with":{let s=i.suffix;e.write(`if (${o}.slice(-${s.length}) !== ${fe(s)}) return INVALID;`);break}default:throw new R(`string format ${c}`)}return o}function Q(e,n,i,o,t=!0){let r=i._zod.def,a=r.type;if(r.coerce)throw new R(`coercion (z.coerce.${a}())`);let c=t||!!r.checks?.length,s;switch(a){case"string":s=dy(e,n,i,o);break;case"number":s=fy(e,i,o);break;case"boolean":s=my(e,o);break;case"bigint":s=py(e,i,o);break;case"symbol":s=gy(e,o);break;case"undefined":s=vy(e,o);break;case"null":s=hy(e,o);break;case"any":case"unknown":s=o;break;case"never":e.write("return INVALID;"),s=o;break;case"void":s=$y(e,o);break;case"nan":s=yy(e,o);break;case"date":s=by(e,o);break;case"object":s=_y(e,n,i,o,c);break;case"optional":s=xy(e,n,i,o,c);break;case"nullable":s=Iy(e,n,i,o,c);break;case"array":s=Sy(e,n,i,o,c);break;case"literal":s=zy(e,n,i,o);break;case"enum":s=Py(e,n,i,o);break;case"readonly":{let u=Rm(e,n,i,o),l=T(n);e.write(`const ${l} = Object.freeze(${u});`),s=l;break}case"success":Rm(e,n,i,o),s="true";break;case"default":case"prefault":s=Dy(e,n,i,o);break;case"nonoptional":s=Oy(e,n,i,o);break;case"tuple":s=jy(e,n,i,o);break;case"union":s=Ny(e,n,i,o);break;case"intersection":s=Ay(e,n,i,o);break;case"record":s=Ey(e,n,i,o);break;case"map":s=Zy(e,n,i,o);break;case"set":s=Vy(e,n,i,o);break;case"file":s=Ly(e,o);break;case"template_literal":s=My(e,n,i,o);break;case"lazy":s=Ry(e,n,i,o);break;case"pipe":s=Fy(e,n,i,o);break;case"custom":s=Jy(e,n,i,o);break;case"transform":s=Wy(e,n,i,o);break;case"catch":s=By(e,n,i,o);break;default:throw new R(`schema type ${a}`)}return s===null?null:ty(e,n,i,s)}function dy(e,n,i,o){e.write(`if (typeof ${o} !== "string") return INVALID;`);let t=i._zod.def;return t.format===void 0?o:Bm(e,n,t,o)}function fy(e,n,i){e.write(`if (typeof ${i} !== "number" || !Number.isFinite(${i})) return INVALID;`);let o=n._zod.def;return o.check==="number_format"&&o.format&&Gm(e,{format:o.format},i),i}function my(e,n){return e.write(`if (typeof ${n} !== "boolean") return INVALID;`),n}function py(e,n,i){e.write(`if (typeof ${i} !== "bigint") return INVALID;`);let o=n._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 gy(e,n){return e.write(`if (typeof ${n} !== "symbol") return INVALID;`),n}function vy(e,n){return e.write(`if (${n} !== undefined) return INVALID;`),n}function hy(e,n){return e.write(`if (${n} !== null) return INVALID;`),n}function $y(e,n){return e.write(`if (${n} !== undefined) return INVALID;`),n}function yy(e,n){return e.write(`if (typeof ${n} !== "number" || !Number.isNaN(${n})) return INVALID;`),n}function by(e,n){return e.write(`if (!(${n} instanceof Date) || Number.isNaN(${n}.getTime())) return INVALID;`),n}function _y(e,n,i,o,t=!0){let r=i._zod.def;e.write(`if (typeof ${o} !== "object" || ${o} === null || Array.isArray(${o})) return INVALID;`);let a=r.shape,c=Object.keys(a),s=Object.getOwnPropertySymbols(a),u=s.length?[...c,...s]:c,l=h=>typeof h=="symbol"?N(n,h):fe(h),d=h=>typeof h=="symbol"?`[${l(h)}]`:fe(h),f=a;if(c.includes("__proto__"))throw new R('object shape key "__proto__"');let m=new Map;for(let h of u){let P=f[h],A=l(h),U=T(n);if(e.write(`const ${U} = ${o}[${A}];`),P._zod.optin!==void 0){let j=T(n);e.write(`let ${j} = (() => {`),e.indented(O=>{let Y=le(O,n,P,U);O.write(`return ${Y};`)}),e.write("})();"),P._zod.optout==="optional"?(e.write(`if (${j} === INVALID) {`),e.indented(O=>{O.write(`if (${A} in ${o}) return INVALID;`),O.write(`${j} = undefined;`)}),e.write("}")):e.write(`if (${j} === INVALID) return INVALID;`),m.set(h,j)}else{wy(P)&&e.write(`if (!(${A} in ${o})) return INVALID;`);let j=le(e,n,P,U,t);j!==null&&m.set(h,j)}}let v=r.catchall,y="none";if(v){let h=v._zod.def.type;if(h==="never"){let P=c.map(A=>`k !== ${fe(A)}`).join(" && ")||"true";e.write(`for (const k in ${o}) {`),e.indented(A=>{A.write(`if (${P}) return INVALID;`)}),e.write("}")}else(h==="unknown"||h==="any")&&!v._zod.def.checks?.length?y="passthrough":y="schema"}let x=T(n),I=u.some(h=>$t(f[h])||Ks(f[h]));if(!t){if(y==="schema"){let h=c.length>0?N(n,new Set(c)):null;e.write(`for (const k in ${o}) {`),e.indented(P=>{P.write('if (k === "__proto__") continue;'),h&&P.write(`if (${h}.has(k)) continue;`);let A=T(n);P.write(`const ${A} = ${o}[k];`),le(P,n,v,A,!1)}),e.write("}")}return null}if(I){e.write(`const ${x} = {};`);for(let h of u){let P=l(h),A=m.get(h);Ks(f[h])?e.write(`if (${P} in ${o}) ${x}[${P}] = ${A};`):$t(f[h])?e.write(`if (${A} !== undefined || ${P} in ${o}) ${x}[${P}] = ${A};`):e.write(`${x}[${P}] = ${A};`)}}else{let h=u.map(P=>`${d(P)}: ${m.get(P)}`).join(", ");e.write(`const ${x} = { ${h} };`)}if(y!=="none"){let h=c.length>0?N(n,new Set(c)):null;e.write(`for (const k in ${o}) {`),e.indented(P=>{if(P.write('if (k === "__proto__") continue;'),h&&P.write(`if (${h}.has(k)) continue;`),y==="passthrough")P.write(`${x}[k] = ${o}[k];`);else{let A=T(n);P.write(`const ${A} = ${o}[k];`);let U=le(P,n,v,A);P.write(`${x}[k] = ${U};`)}}),e.write("}")}return x}function xy(e,n,i,o,t=!0){let r=i._zod.def;if(ky(i))return Q(e,n,r.innerType,o,t);if(r.innerType._zod.optin==="defaulted"){let c=T(n),s=T(n);return e.write(`let ${c};`),e.write(`if (${o} === undefined) {`),e.indented(u=>{u.write(`const ${s} = (() => {`),u.indented(l=>{let d=Q(l,n,r.innerType,o);l.write(`return ${d};`)}),u.write("})();"),u.write(`if (${s} !== INVALID) ${c} = ${s};`)}),e.write("} else {"),e.indented(u=>{let l=Q(u,n,r.innerType,o);u.write(`${c} = ${l};`)}),e.write("}"),c}let a=t?T(n):null;return a&&e.write(`let ${a};`),e.write(`if (${o} !== undefined) {`),e.indented(c=>{let s=Q(c,n,r.innerType,o,t);a&&s!==null&&c.write(`${a} = ${s};`)}),e.write("}"),a}function ky(e){return e._zod.traits?.has("$ZodExactOptional")===!0}function wy(e){return e._zod.optin===void 0&&ht(e)}function ht(e){if(e._zod.def.coerce)return!0;let n=e._zod.def;switch(n.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 n.innerType?ht(n.innerType):!1;case"literal":return!!n.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":case"nullable":case"readonly":case"success":return n.innerType?ht(n.innerType):!0;case"catch":return!0;case"union":return n.options?n.options.some(ht):!0;case"intersection":return!n.left||!n.right?!0:ht(n.left)&&ht(n.right);case"pipe":return n.in?ht(n.in):!0;default:return!0}}function Ks(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}function $t(e){let n=e._zod.def;switch(n.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!!n.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":return!0;case"nullable":case"readonly":case"nonoptional":return n.innerType?$t(n.innerType):!0;case"union":return n.options?n.options.some($t):!0;case"intersection":return!n.left||!n.right||$t(n.left)||$t(n.right);case"pipe":return n.out?$t(n.out):!0;default:return!0}}function Iy(e,n,i,o,t=!0){let r=i._zod.def,a=t?T(n):null;return a&&e.write(`let ${a} = null;`),e.write(`if (${o} !== null) {`),e.indented(c=>{let s=Q(c,n,r.innerType,o,t);a&&s!==null&&c.write(`${a} = ${s};`)}),e.write("}"),a}function Sy(e,n,i,o,t=!0){let r=i._zod.def;e.write(`if (!Array.isArray(${o})) return INVALID;`);let a=t?T(n):null,c=T(n),s=T(n);return a&&e.write(`const ${a} = new Array(${o}.length);`),e.write(`for (let ${c} = 0; ${c} < ${o}.length; ${c}++) {`),e.indented(u=>{u.write(`const ${s} = ${o}[${c}];`);let l=le(u,n,r.element,s,t);a&&l!==null&&u.write(`${a}[${c}] = ${l};`)}),e.write("}"),a}function zy(e,n,i,o){let r=i._zod.def.values;if(r.length!==1){let c=N(n,new Set(r));return e.write(`if (!${c}.has(${o})) return INVALID;`),o}let a=r[0];if(typeof a=="number"&&Number.isNaN(a)){let c=N(n,new Set(r));return e.write(`if (!${c}.has(${o})) return INVALID;`),o}if(typeof a=="string")e.write(`if (${o} !== ${fe(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 R(`literal type ${typeof a}`);return o}function Py(e,n,i,o){let t=i._zod.values;if(!t)throw new R("enum schema without enumerated values");let r=N(n,t);return e.write(`if (!${r}.has(${o})) return INVALID;`),o}function Rm(e,n,i,o){let t=i._zod.def;return Q(e,n,t.innerType,o)}function Dy(e,n,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 Q(e,n,t.innerType,o);let s=N(n,a),u=T(n);return e.write(`let ${u} = ${o};`),e.write(`if (${o} === undefined) ${u} = ${s}();`),Q(e,n,t.innerType,u)}let c=T(n);if(a){let s=N(n,a),u=N(n,Pn);e.write(`let ${c};`),e.write(`if (${o} === undefined) {`),e.indented(l=>{l.write(`${c} = ${u}(${s}());`)}),e.write("} else {"),e.indented(l=>{let d=Q(l,n,t.innerType,o);l.write(`${c} = ${d} === undefined ? ${u}(${s}()) : ${d};`)}),e.write("}")}else e.write(`let ${c};`),e.write(`if (${o} !== undefined) {`),e.indented(s=>{let u=Q(s,n,t.innerType,o);s.write(`${c} = ${u};`)}),e.write("}");return c}function Oy(e,n,i,o){let t=i._zod.def,r=Q(e,n,t.innerType,o),a=T(n);return e.write(`const ${a} = ${r};`),e.write(`if (${a} === undefined) return INVALID;`),a}function jy(e,n,i,o){let t=i._zod.def,r=t.items,a=t.rest;e.write(`if (!Array.isArray(${o})) return INVALID;`);let c=Fm(r,"optin"),s=Fm(r,"optout");a?e.write(`if (${o}.length < ${c}) return INVALID;`):e.write(`if (${o}.length < ${c} || ${o}.length > ${r.length}) return INVALID;`);let u=T(n);e.write(`const ${u} = [];`);for(let l=0;l<r.length;l++){let d=r[l];if(l>=s)e.write(`if (${u}.length === ${l}) {`),e.indented(f=>{f.write(`if (${l} < ${o}.length) {`),f.indented(m=>{let v=T(n);m.write(`const ${v} = ${o}[${l}];`);let y=le(m,n,d,v);m.write(`${u}[${l}] = ${y};`)}),f.write("} else {"),f.indented(m=>{if(Ks(d)){m.write(`${u}.length = ${l};`);return}let v=T(n),y=T(n);m.write(`const ${v} = undefined;`),m.write(`const ${y} = (() => {`),m.indented(x=>{let I=le(x,n,d,v);x.write(`return ${I};`)}),m.write("})();"),m.write(`if (${y} === INVALID || ${y} === undefined) ${u}.length = ${l};`),m.write(`else ${u}[${l}] = ${y};`)}),f.write("}")}),e.write("}");else{let f=T(n);e.write(`const ${f} = ${o}[${l}];`);let m=le(e,n,d,f);e.write(`${u}[${l}] = ${m};`)}}if(a){let l=T(n),d=T(n);e.write(`for (let ${l} = ${r.length}; ${l} < ${o}.length; ${l}++) {`),e.indented(f=>{f.write(`const ${d} = ${o}[${l}];`);let m=le(f,n,a,d);f.write(`${u}[${l}] = ${m};`)}),e.write("}")}return u}function Fm(e,n){for(let i=e.length-1;i>=0;i--)if(!(n==="optin"?e[i]._zod.optin!==void 0:e[i]._zod.optout==="optional"))return i+1;return 0}function Ny(e,n,i,o){let t=i._zod.def,r=t.options;if(t.discriminator)return Uy(e,n,t,o);if(t.inclusive===!1)throw new R("exclusive unions (z.xor)");if(r.length===0)return e.write("return INVALID;"),o;if(r.length===1)return Q(e,n,r[0],o);if(r.every(s=>s._zod.def.type==="literal"&&!s._zod.def.checks?.length)){let s=new Set(r.flatMap(l=>l._zod.def.values)),u=N(n,s);return e.write(`if (!${u}.has(${o})) return INVALID;`),o}let c=T(n);e.write(`let ${c};`);for(let s=0;s<r.length;s++){let u=r[s];s===0?e.write(`${c} = (() => {`):e.write(`if (${c} === INVALID) ${c} = (() => {`),e.indented(l=>{let d=Q(l,n,u,o);l.write(`return ${d};`)}),e.write("})();")}return e.write(`if (${c} === INVALID) return INVALID;`),c}function Uy(e,n,i,o){if(i.unionFallback)throw new R("discriminated union with unionFallback");if(i.options.length===0)return e.write("return INVALID;"),o;let t=T(n),r=T(n);e.write(`const ${t} = ${o}?.[${fe(i.discriminator)}];`),e.write(`let ${r};`);let a=!0,c=new Set;for(let s of i.options){let u=s._zod.propValues?.[i.discriminator];if(!u||u.size===0)throw new R("discriminated union option without static discriminator values");for(let f of u){if(c.has(f))throw new R(`duplicate discriminator value ${String(f)}`);c.add(f)}let l=Array.from(u,f=>Ty(n,t,f)),d=a?"if":"else if";e.write(`${d} (${l.join(" || ")}) {`),e.indented(f=>{let m=Q(f,n,s,o);f.write(`${r} = ${m};`)}),e.write("}"),a=!1}return e.write("else { return INVALID; }"),r}function Ty(e,n,i){if(typeof i=="string")return`${n} === ${fe(i)}`;if(typeof i=="number")return Number.isNaN(i)?`Number.isNaN(${n})`:`${n} === ${i}`;if(typeof i=="boolean")return`${n} === ${i}`;if(i===null)return`${n} === null`;if(i===void 0)return`${n} === undefined`;if(typeof i=="bigint")return`${n} === ${i}n`;if(typeof i=="symbol"){let o=N(e,i);return`${n} === ${o}`}throw new R(`literal discriminator value ${String(i)}`)}function Ay(e,n,i,o){let t=i._zod.def,r=le(e,n,t.left,o),a=le(e,n,t.right,o),c=N(n,Lt),s=T(n);return e.write(`const ${s} = ${c}(${r}, ${a});`),e.write(`if (!${s}.valid) return INVALID;`),`${s}.data`}function Ey(e,n,i,o){let t=i._zod.def,r=N(n,ze);e.write(`if (!${r}(${o})) return INVALID;`);let a=T(n),c=T(n),s=T(n);e.write(`const ${a} = {};`);let u=t,l=u.partial?void 0:t.keyType._zod.values;if(l){let v=[];for(let x of l){if(!(typeof x=="string"||typeof x=="number"||typeof x=="symbol"))throw new R(`record key value ${String(x)}`);let I=typeof x=="number"?x.toString():x;if(I==="__proto__")throw new R('record key "__proto__"');v.push(I);let h=N(n,x),P=Q(e,n,t.keyType,h),A=T(n);e.write(`const ${A} = ${o}[${Cy(n,I)}];`);let U=le(e,n,t.valueType,A);e.write(`${a}[${P}] = ${U};`)}let y=N(n,new Set(v));return e.write(`for (const ${c} in ${o}) {`),e.indented(x=>{x.write(`if (${y}.has(${c})) continue;`),u.mode==="loose"?x.write(`if (${c} !== "__proto__") ${a}[${c}] = ${o}[${c}];`):x.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 v=t.mode==="loose",y=N(n,ki(t.keyType)),x=N(n,Ye),I=N(n,Object.prototype.propertyIsEnumerable),h=T(n);return e.write(`for (const ${c} of Reflect.ownKeys(${o})) {`),e.indented(P=>{P.write(`if (${c} === "__proto__") continue;`),P.write(`if (!${I}.call(${o}, ${c})) continue;`),P.write(`let ${h} = ${y}(${c});`),P.write(`if (${h} === INVALID && typeof ${c} === "string" && ${x}.test(${c})) ${h} = ${y}(Number(${c}));`),v?P.write(`if (${h} === INVALID) { ${a}[${c}] = ${o}[${c}]; continue; }`):P.write(`if (${h} === INVALID) return INVALID;`),P.write(`if (${h} === "__proto__") continue;`);let A=T(n);P.write(`const ${A} = ${o}[${c}];`);let U=le(P,n,t.valueType,A);P.write(`${a}[${h}] = ${U};`)}),e.write("}"),a}let m=N(n,Object.prototype.propertyIsEnumerable);return e.write(`for (const ${c} of Reflect.ownKeys(${o})) {`),e.indented(v=>{v.write(`if (${c} === "__proto__") continue;`),v.write(`if (!${m}.call(${o}, ${c})) continue;`),v.write(`if (typeof ${c} !== "string") return INVALID;`),v.write(`const ${s} = ${o}[${c}];`);let y=le(v,n,t.valueType,s);v.write(`${a}[${c}] = ${y};`)}),e.write("}"),a}function Cy(e,n){return typeof n=="string"?fe(n):N(e,n)}function Zy(e,n,i,o){let t=i._zod.def;e.write(`if (!(${o} instanceof Map)) return INVALID;`);let r=T(n),a=T(n),c=T(n);return e.write(`const ${r} = new Map();`),e.write(`for (const [${a}, ${c}] of ${o}) {`),e.indented(s=>{let u=Q(s,n,t.keyType,a),l=Q(s,n,t.valueType,c);s.write(`${r}.set(${u}, ${l});`)}),e.write("}"),r}function Vy(e,n,i,o){let t=i._zod.def;e.write(`if (!(${o} instanceof Set)) return INVALID;`);let r=T(n),a=T(n);return e.write(`const ${r} = new Set();`),e.write(`for (const ${a} of ${o}) {`),e.indented(c=>{let s=Q(c,n,t.valueType,a);c.write(`${r}.add(${s});`)}),e.write("}"),r}function Ly(e,n){return e.write(`if (!(${n} instanceof File)) return INVALID;`),n}function My(e,n,i,o){e.write(`if (typeof ${o} !== "string") return INVALID;`);let t=i._zod.pattern;if(t){let r=N(n,t);e.write(`${r}.lastIndex = 0;`),e.write(`if (!${r}.test(${o})) return INVALID;`)}return o}function Ry(e,n,i,o){let t=i._zod.def,r=N(n,t.getter),a=N(n,{parser:null});e.write(`if (!${a}.parser) {`),e.indented(s=>{s.write(`const inner = ${r}();`),s.write(`${a}.parser = function(input) {`),s.indented(u=>{u.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),u.write("return result.issues.length === 0 ? result.value : INVALID;")}),s.write("};")}),e.write("}");let c=T(n);return e.write(`const ${c} = ${a}.parser(${o});`),e.write(`if (${c} === INVALID) return INVALID;`),c}function Fy(e,n,i,o){let t=i._zod.def,r=Q(e,n,t.in,o);if(t.transform){if(yt(t.transform))throw new Ee("z.compile: async transforms in pipes are not supported");let a=t.transform,s=N(n,l=>{let d={value:l,issues:[],addIssue:qs},f=a(l,d);return f instanceof Promise?xe:d.issues.length===0?f:xe}),u=T(n);return e.write(`const ${u} = ${s}(${r});`),e.write(`if (${u} === INVALID) return INVALID;`),Q(e,n,t.out,u)}else return Q(e,n,t.out,r)}function yt(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}function Jy(e,n,i,o){let t=i._zod.def;if(t.fn){if(yt(t.fn))throw new Ee("z.compile: async custom predicates are not supported");let r=N(n,t.fn),a=N(n,Ws),c=T(n);e.write(`const ${c} = ${r}(${o});`),e.write(`if (${c} instanceof Promise) ${a}();`),e.write(`if (!${c}) return INVALID;`)}else throw new R("custom schema without a predicate function");return o}function Gy(e,n,i){let o=e._zod.run({value:i,issues:[]},{});if(o&&typeof o.then=="function")return xe;let t=o;return t.issues.length===0?t.value:n()}function By(e,n,i,o){let t=i._zod.def;if(!t.catchValue[Nr])throw new R("catch with a callback (only a constant catch value compiles)",!1);let r=T(n);e.write(`let ${r} = (() => {`),e.indented(u=>{let l=le(u,n,t.innerType,o);u.write(`return ${l};`)}),e.write("})();");let a=N(n,t.innerType),c=N(n,t.catchValue),s=N(n,Gy);return e.write(`if (${r} === INVALID) {`),e.indented(u=>{u.write(`${r} = ${s}(${a}, ${c}, ${o});`),u.write(`if (${r} === INVALID) return INVALID;`)}),e.write("}"),r}function Wy(e,n,i,o){let t=i._zod.def;if(t.transform){if(yt(t.transform))throw new Ee("z.compile: async transforms are not supported");let r=t.transform,c=N(n,u=>{let l={value:u,issues:[],addIssue:qs},d=r(u,l);return d instanceof Promise?xe:l.issues.length===0?d:xe}),s=T(n);return e.write(`const ${s} = ${c}(${o});`),e.write(`if (${s} === INVALID) return INVALID;`),s}return o}function Hs(e,n){return new e({type:"string",...k(n)})}function Ys(e,n){return new e({type:"string",coerce:!0,...k(n)})}function wi(e,n){return new e({type:"string",format:"email",check:"string_format",abort:!1,...k(n)})}function Ii(e,n){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...k(n)})}function Si(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...k(n)})}function zi(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...k(n)})}function Pi(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...k(n)})}function Di(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...k(n)})}function Wn(e,n){return new e({type:"string",format:"url",check:"string_format",abort:!1,...k(n)})}function Oi(e,n){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...k(n)})}function ji(e,n){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...k(n)})}function Ni(e,n){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...k(n)})}function Ui(e,n){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...k(n)})}function Ti(e,n){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...k(n)})}function Ai(e,n){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...k(n)})}function Ei(e,n){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...k(n)})}function Ci(e,n){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...k(n)})}function Zi(e,n){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...k(n)})}function Qs(e,n){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...k(n)})}function Vi(e,n){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...k(n)})}function Li(e,n){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...k(n)})}function Mi(e,n){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...k(n)})}function Ri(e,n){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...k(n)})}function Fi(e,n){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...k(n)})}function eu(e,n){return new e({type:"string",format:"credit_card",check:"string_format",abort:!1,...k(n)})}function Ji(e,n){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...k(n)})}var tu={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Kn(e,n){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...k(n)})}function Xn(e,n){return new e({type:"string",format:"date",check:"string_format",...k(n)})}function qn(e,n){return new e({type:"string",format:"time",check:"string_format",precision:null,...k(n)})}function Hn(e,n){return new e({type:"string",format:"duration",check:"string_format",...k(n)})}function nu(e,n){return new e({type:"number",checks:[],...k(n)})}function ru(e,n){return new e({type:"number",coerce:!0,checks:[],...k(n)})}function iu(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...k(n)})}function ou(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...k(n)})}function au(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...k(n)})}function cu(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...k(n)})}function su(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...k(n)})}function uu(e,n){return new e({type:"boolean",...k(n)})}function lu(e,n){return new e({type:"boolean",coerce:!0,...k(n)})}function du(e,n){return new e({type:"bigint",...k(n)})}function fu(e,n){return new e({type:"bigint",coerce:!0,...k(n)})}function mu(e,n){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...k(n)})}function pu(e,n){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...k(n)})}function gu(e,n){return new e({type:"symbol",...k(n)})}function vu(e,n){return new e({type:"undefined",...k(n)})}function hu(e,n){return new e({type:"null",...k(n)})}function $u(e){return new e({type:"any"})}function yu(e){return new e({type:"unknown"})}function bu(e,n){return new e({type:"never",...k(n)})}function _u(e,n){return new e({type:"void",...k(n)})}function xu(e,n){return new e({type:"date",...k(n)})}function ku(e,n){return new e({type:"date",coerce:!0,...k(n)})}function wu(e,n){return new e({type:"nan",...k(n)})}function Le(e,n){return new Wr({check:"less_than",...k(n),value:e,inclusive:!1})}function ke(e,n){return new Wr({check:"less_than",...k(n),value:e,inclusive:!0})}function Me(e,n){return new Kr({check:"greater_than",...k(n),value:e,inclusive:!1})}function we(e,n){return new Kr({check:"greater_than",...k(n),value:e,inclusive:!0})}function Gi(e){return Me(0,e)}function Bi(e){return Le(0,e)}function Wi(e){return ke(0,e)}function Ki(e){return we(0,e)}function Qe(e,n){return new lc({check:"multiple_of",...k(n),value:e})}function et(e,n){return new mc({check:"max_size",...k(n),maximum:e})}function Re(e,n){return new pc({check:"min_size",...k(n),minimum:e})}function bt(e,n){return new gc({check:"size_equals",...k(n),size:e})}function _t(e,n){return new vc({check:"max_length",...k(n),maximum:e})}function Ge(e,n){return new hc({check:"min_length",...k(n),minimum:e})}function xt(e,n){return new $c({check:"length_equals",...k(n),length:e})}function Rt(e,n){return new yc({check:"string_format",format:"regex",...k(n),pattern:e})}function Ft(e){return new bc({check:"string_format",format:"lowercase",...k(e)})}function Jt(e){return new _c({check:"string_format",format:"uppercase",...k(e)})}function Gt(e,n){return new xc({check:"string_format",format:"includes",...k(n),includes:e})}function Bt(e,n){return new kc({check:"string_format",format:"starts_with",...k(n),prefix:e})}function Wt(e,n){return new wc({check:"string_format",format:"ends_with",...k(n),suffix:e})}function Xi(e,n,i){return new Xr({check:"property",property:e,schema:n,...k(i)})}function qi(e){return Object.entries(e).map(([n,i])=>new Xr({check:"property",property:n,schema:i}))}function Kt(e,n){return new Ic({check:"mime_type",mime:e,...k(n)})}function Ce(e){return new Sc({check:"overwrite",tx:e})}function Xt(e){return Ce(n=>n.normalize(e))}function qt(){return Ce(e=>e.trim())}function Ht(){return Ce(e=>e.toLowerCase())}function Yt(){return Ce(e=>e.toUpperCase())}function Qt(){return Ce(e=>la(e))}function Iu(e,n,i){return new e({type:"array",element:n,...k(i)})}function Ky(e,n,i){return new e({type:"union",options:n,...k(i)})}function Xy(e,n,i){return new e({type:"union",options:n,inclusive:!1,...k(i)})}function qy(e,n,i,o){return new e({type:"union",options:i,discriminator:n,...k(o)})}function Hy(e,n,i){return new e({type:"intersection",left:n,right:i})}function Yy(e,n,i,o){let t=i instanceof E,r=t?o:i,a=t?i:null;return new e({type:"tuple",items:n,rest:a,...k(r)})}function Qy(e,n,i,o){return new e({type:"record",keyType:n,valueType:i,...k(o)})}function eb(e,n,i,o){return new e({type:"map",keyType:n,valueType:i,...k(o)})}function tb(e,n,i){return new e({type:"set",valueType:n,...k(i)})}function nb(e,n,i){let o=Array.isArray(n)?Object.fromEntries(n.map(t=>[t,t])):n;return new e({type:"enum",entries:o,...k(i)})}function rb(e,n,i){return new e({type:"enum",entries:n,...k(i)})}function ib(e,n,i){return new e({type:"literal",values:Array.isArray(n)?n:[n],...k(i)})}function Su(e,n){return new e({type:"file",...k(n)})}function ob(e,n){return new e({type:"transform",transform:n})}function ab(e,n){return new e({type:"optional",innerType:n})}function cb(e,n){return new e({type:"nullable",innerType:n})}function sb(e,n,i){return new e({type:"default",innerType:n,get defaultValue(){return typeof i=="function"?i():Pn(i)}})}function ub(e,n,i){return new e({type:"nonoptional",innerType:n,...k(i)})}function lb(e,n){return new e({type:"success",innerType:n})}function db(e,n,i){return new e({type:"catch",innerType:n,catchValue:typeof i=="function"?i:ya(i)})}function fb(e,n,i){return new e({type:"pipe",in:n,out:i})}function mb(e,n){return new e({type:"readonly",innerType:n})}function pb(e,n,i){return new e({type:"template_literal",parts:n,...k(i)})}function gb(e,n){return new e({type:"lazy",getter:n})}function vb(e,n){return new e({type:"promise",innerType:n})}function zu(e,n,i){let o=k(i);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:n,...o})}function Pu(e,n,i){return new e({type:"custom",check:"custom",fn:n,...k(i)})}function Du(e,n){let i=Wm(o=>(o.addIssue=t=>{if(typeof t=="string")o.issues.push(Tt(t,o.value,i._zod.def));else{let r=t;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),"input"in r||(r.input=o.value),r.inst??(r.inst=i),r.continue??(r.continue=!i._zod.def.abort),o.issues.push(Tt(r))}},e(o.value,o)),n);return i}function Wm(e,n){let i=new H({check:"custom",...k(n)});return i._zod.check=e,i}function Ou(e){let n=new H({check:"describe"});return n._zod.onattach=[i=>{let o=oe.get(i)??{};oe.add(i,{...o,description:e})}],n._zod.check=()=>{},n}function ju(e){let n=new H({check:"meta"});return n._zod.onattach=[i=>{let o=oe.get(i)??{};oe.add(i,{...o,...e})}],n._zod.check=()=>{},n}function Nu(e,n){let i=k(n),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 r=new Set(o),a=new Set(t),c=e.Codec??Rn,s=e.Boolean??Ln,u=e.String??gt,l=new u({type:"string",error:i.error}),d=new s({type:"boolean",error:i.error}),f=new c({type:"pipe",in:l,out:d,transform:((m,v)=>{let y=m;return i.case!=="sensitive"&&(y=y.toLowerCase()),r.has(y)?!0:a.has(y)?!1:(v.issues.push({code:"invalid_value",expected:"stringbool",values:[...r,...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 en(e,n,i,o={}){let t=k(o),r={check:"string_format",type:"string",format:n,fn:typeof i=="function"?i:c=>i.test(c),...t};return i instanceof RegExp&&(r.pattern=i),new e(r)}function Yn(e,...n){for(let i of n)for(let o of Reflect.ownKeys(i))Object.prototype.propertyIsEnumerable.call(i,o)&&ee(e,o,i[o]);return e}function tt(e){let n=e?.target??"draft-2020-12";return n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??oe,target:n,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 re(e,n,i,o,t){let r=typeof n.unrepresentable=="function"?n.unrepresentable({zodSchema:e,path:o.path,message:t}):n.unrepresentable;if(r==="any")return!1;if(r===void 0||r==="throw")throw new Error(t);return Object.assign(i,r),!0}function W(e,n,i={path:[],schemaPath:[]}){var o;let t=e._zod.def,r=n.seen.get(e);if(r)return r.count++,i.schemaPath.includes(e)&&(r.cycle=i.path),r.schema;let a={schema:{},count:1,cycle:void 0,path:i.path};n.seen.set(e,a),n.sharedDefsExtractedFor=void 0,n.sharedEmitDoneFor=void 0;let c=e._zod.toJSONSchema?.();if(c)a.schema=c;else{let l={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(n,a.schema,l);else{let f=a.schema,m=n.processors[t.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${t.type}`);m(e,n,f,l)}let d=e._zod.parent;d&&(a.ref||(a.ref=d),W(d,n,l),n.seen.get(d).isParent=!0)}let s=n.metadataRegistry.get(e);return s&&Yn(a.schema,s),n.io==="input"&&de(e)&&(delete a.schema.examples,delete a.schema.default),n.io==="input"&&"_prefault"in a.schema&&((o=a.schema).default??(o.default=a.schema._prefault)),delete a.schema._prefault,n.seen.get(e).schema}function Km(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function nt(e,n){let i=e.seen.get(n);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 c=e.metadataRegistry.get(a[0])?.id;if(c){let s=o.get(c);if(s&&s!==a[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(c,a[0])}}let t=a=>{let c=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")}#/${c}/${Km(m)}`}}let s="#",u=`${s}/${c}/`;if(a[1]===i&&!a[1].schema.id)return{ref:s};let l=a[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+Km(l)}},r=a=>{if(a[1].schema.$ref)return;let c=a[1],{ref:s,defId:u}=t(a);c.def={...c.schema},u&&(c.defId=u);let l=c.schema;for(let d in l)delete l[d];l.$ref=s};if(e.cycles==="throw")for(let a of e.seen.entries()){let c=a[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
57
57
|
|
|
58
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let c=a[1];if(n===a[0]){r(a);continue}if(e.external){let u=e.external.registry.get(a[0])?.id;if(n!==a[0]&&u){r(a);continue}}if(e.metadataRegistry.get(a[0])?.id){r(a);continue}if(c.cycle){r(a);continue}if(c.count>1&&e.reused==="ref"){r(a);continue}}e.external&&(e.sharedDefsExtractedFor=e.external)}function Hm(e){let n=e.anyOf;if(!Array.isArray(n)||n.length===0||e.type!==void 0)return;let i=[];for(let o of n){if(!o||typeof o!="object")return;Hm(o);let t=Object.keys(o);if(t.length!==1||t[0]!=="type")return;let r=o.type;for(let a of Array.isArray(r)?r:[r]){if(typeof a!="string")return;i.includes(a)||i.push(a)}}delete e.anyOf,e.type=i.length===1?i[0]:i}var Ym=new Set(["type","properties","required","additionalProperties"]),Xm=["oneOf","anyOf"];function qm(e){let n=e.additionalProperties;return n===void 0||n===!1||typeof n!="object"||n===null?null:Object.keys(n).length?n:null}function Uu(e){let n=[];for(let r of e){if(typeof r!="object"||r.type!=="object")return null;for(let a in r)if(!Ym.has(a))return null;n.push(r)}let i={},o=new Set;for(let r of n){for(let a in r.properties){if(Object.prototype.hasOwnProperty.call(i,a))continue;let c=[];for(let u of n){let l=u.properties?.[a]??qm(u);l!=null&&(c.some(d=>JSON.stringify(d)===JSON.stringify(l))||c.push(l))}let s=c.length===1?c[0]:Uu(c)??{allOf:c};ee(i,a,s)}for(let a of r.required??[])o.add(a)}let t={type:"object",properties:i};if(o.size&&(t.required=[...o]),n.every(r=>r.additionalProperties===!1))t.additionalProperties=!1;else{let r=[];for(let a of n){let c=qm(a);c&&!r.some(s=>JSON.stringify(s)===JSON.stringify(c))&&r.push(c)}r.length===1?t.additionalProperties=r[0]:r.length>1&&(t.additionalProperties={allOf:r})}return t}function hb(e){let n=e.allOf;if(!Array.isArray(n)||n.length<2)return;for(let t of Ym)if(t in e)return;let i=n.filter(t=>Xm.some(r=>Array.isArray(t[r]))),o=null;if(!i.length)o=Uu(n);else{let t=i[0],r=Xm.find(s=>Array.isArray(t[s]));if(Object.keys(t).length!==1)return;let a=n.filter(s=>s!==t),c=t[r].map(s=>Uu([...a,s]));if(c.some(s=>!s))return;o={[r]:c}}o&&(delete e.allOf,Yn(e,o))}function rt(e,n){let i=e.seen.get(n);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=c=>{let s=e.seen.get(c);if(s.ref===null)return;let u=s.def??s.schema,l={...u},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")?(u.allOf=u.allOf??[],u.allOf.push(v)):Yn(u,v),Yn(u,l),c._zod.parent===d)for(let x in u)x==="$ref"||x==="allOf"||x in l||delete u[x];if(v.$ref&&m.def)for(let x in u)x==="$ref"||x==="allOf"||x in m.def&&JSON.stringify(u[x])===JSON.stringify(m.def[x])&&delete u[x]}let f=c._zod.parent;if(f&&f!==d){o(f);let m=e.seen.get(f);if(m?.schema.$ref&&(u.$ref=m.schema.$ref,m.def))for(let v in u)v==="$ref"||v==="allOf"||v in m.def&&JSON.stringify(u[v])===JSON.stringify(m.def[v])&&delete u[v]}e.override({zodSchema:c,jsonSchema:u,path:s.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let c of[...e.seen.entries()].reverse())o(c[0]);if(e.target!=="openapi-3.0")for(let c of e.seen.entries())Hm(c[1].def??c[1].schema);for(let c of e.deferred)c();if(e.intersections.length){let c=new Map;for(let s of e.seen.values())for(let u of[s.schema,s.def]){let l=u?.allOf;if(!Array.isArray(l))continue;let d=c.get(l);d?d.push(u):c.set(l,[u])}for(let s of e.intersections)for(let u of c.get(s)??[])hb(u)}}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 c=e.external.registry.get(n)?.id;if(!c)throw new Error("Schema is missing an `id` property");t.$id=e.external.uri(c)}Yn(t,i.defId?i.schema:i.def??i.schema);let r=e.metadataRegistry.get(n)?.id;r!==void 0&&t.id===r&&delete t.id;let a=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let c of e.seen.entries()){let s=c[1];s.def&&s.defId&&(s.def.id===s.defId&&delete s.def.id,ee(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 c=JSON.parse(JSON.stringify(t));return Object.defineProperty(c,"~standard",{value:{...n["~standard"],jsonSchema:{input:tn(n,"input",e.processors),output:tn(n,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function de(e,n){let i=n??{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 de(o.element,i);if(o.type==="set")return de(o.valueType,i);if(o.type==="lazy")return de(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 de(o.innerType,i);if(o.type==="intersection")return de(o.left,i)||de(o.right,i);if(o.type==="record"||o.type==="map")return de(o.keyType,i)||de(o.valueType,i);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:de(o.in,i)||de(o.out,i);if(o.type==="object"){for(let t in o.shape)if(de(o.shape[t],i))return!0;return!1}if(o.type==="union"){for(let t of o.options)if(de(t,i))return!0;return!1}if(o.type==="tuple"){for(let t of o.items)if(de(t,i))return!0;return!!(o.rest&&de(o.rest,i))}return!1}var Tu=(e,n={})=>i=>{let o=tt({...i,processors:n});return W(e,o),nt(o,e),rt(o,e)},tn=(e,n,i={})=>o=>{let{libraryOptions:t,target:r}=o??{},a=tt({...t??{},target:r,io:n,processors:i});return W(e,a),nt(a,e),rt(a,e)};var $b={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Cu=(e,n,i,o)=>{let t=i;t.type="string";let{minimum:r,maximum:a,format:c,patterns:s,contentEncoding:u,laxFormat:l}=e._zod.bag;if(typeof r=="number"&&(t.minLength=r),typeof a=="number"&&(t.maxLength=a),c&&(t.format=$b[c]??c,t.format===""&&delete t.format,(c==="time"||l)&&delete t.format),u&&(t.contentEncoding=u),s&&s.size>0){let d=[...s];d.length===1?t.pattern=d[0].source:d.length>1&&(t.allOf=[...d.map(f=>({...n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},Zu=(e,n,i,o)=>{let t=i,{minimum:r,maximum:a,format:c,multipleOf:s,exclusiveMaximum:u,exclusiveMinimum:l}=e._zod.bag;typeof c=="string"&&c.includes("int")?t.type="integer":t.type="number";let d=typeof l=="number"&&l>=(r??Number.NEGATIVE_INFINITY),f=typeof u=="number"&&u<=(a??Number.POSITIVE_INFINITY),m=n.target==="draft-04"||n.target==="openapi-3.0";d?m?(t.minimum=l,t.exclusiveMinimum=!0):t.exclusiveMinimum=l:typeof r=="number"&&(t.minimum=r),f?m?(t.maximum=u,t.exclusiveMaximum=!0):t.exclusiveMaximum=u:typeof a=="number"&&(t.maximum=a),typeof s=="number"&&(Number.isFinite(s)&&s!==0?t.multipleOf=Math.abs(s):re(e,n,t,o,`A multipleOf divisor of ${s} cannot be represented in JSON Schema`))},Vu=(e,n,i,o)=>{i.type="boolean"},Lu=(e,n,i,o)=>{re(e,n,i,o,"BigInt cannot be represented in JSON Schema")},Mu=(e,n,i,o)=>{re(e,n,i,o,"Symbols cannot be represented in JSON Schema")},Ru=(e,n,i,o)=>{n.target==="openapi-3.0"?(i.type="string",i.nullable=!0,i.enum=[null]):i.type="null"},Fu=(e,n,i,o)=>{re(e,n,i,o,"Undefined cannot be represented in JSON Schema")},Ju=(e,n,i,o)=>{re(e,n,i,o,"Void cannot be represented in JSON Schema")},Gu=(e,n,i,o)=>{i.not={}},Bu=(e,n,i,o)=>{},Wu=(e,n,i,o)=>{},Ku=(e,n,i,o)=>{re(e,n,i,o,"Date cannot be represented in JSON Schema")},Xu=(e,n,i,o)=>{let t=e._zod.def,r=In(t.entries);if(r.length===0){i.not={};return}r.every(a=>typeof a=="number")&&(i.type="number"),r.every(a=>typeof a=="string")&&(i.type="string"),i.enum=r},qu=(e,n,i,o)=>{let t=e._zod.def;if(t.values.length===0){i.not={};return}let r=[];for(let a of t.values)if(a===void 0){if(re(e,n,i,o,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof a=="bigint"){if(re(e,n,i,o,"BigInt literals cannot be represented in JSON Schema"))return;r.push(Number(a))}else r.push(a);if(r.length!==0)if(r.length===1){let a=r[0];i.type=a===null?"null":typeof a,n.target==="draft-04"||n.target==="openapi-3.0"?i.enum=[a]:i.const=a}else r.every(a=>typeof a=="number")&&(i.type="number"),r.every(a=>typeof a=="string")&&(i.type="string"),r.every(a=>typeof a=="boolean")&&(i.type="boolean"),r.every(a=>a===null)&&(i.type="null"),i.enum=r},Hu=(e,n,i,o)=>{re(e,n,i,o,"NaN cannot be represented in JSON Schema")},Yu=(e,n,i,o)=>{let t=i,r=e._zod.pattern;if(!r)throw new Error("Pattern not found in template literal");t.type="string",t.pattern=r.source},Qu=(e,n,i,o)=>{let t=i,r={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:c,mime:s}=e._zod.bag;a!==void 0&&(r.minLength=a),c!==void 0&&(r.maxLength=c),s?s.length===1?(r.contentMediaType=s[0],Object.assign(t,r)):(Object.assign(t,r),t.anyOf=s.map(u=>({contentMediaType:u}))):Object.assign(t,r)},el=(e,n,i,o)=>{i.type="boolean"},tl=(e,n,i,o)=>{re(e,n,i,o,"Custom types cannot be represented in JSON Schema")},nl=(e,n,i,o)=>{re(e,n,i,o,"Function types cannot be represented in JSON Schema")},rl=(e,n,i,o)=>{re(e,n,i,o,"Transforms cannot be represented in JSON Schema")},il=(e,n,i,o)=>{re(e,n,i,o,"Map cannot be represented in JSON Schema")},ol=(e,n,i,o)=>{re(e,n,i,o,"Set cannot be represented in JSON Schema")},al=(e,n,i,o)=>{let t=i,r=e._zod.def,{minimum:a,maximum:c}=e._zod.bag;typeof a=="number"&&(t.minItems=a),typeof c=="number"&&(t.maxItems=c),t.type="array",t.items=W(r.element,n,{...o,path:[...o.path,"items"]})};function Qn(e){let n=e._zod.def;return n.type==="pipe"&&n.in._zod.traits.has("$ZodTransform")?Qn(n.out):n.type==="catch"?Qn(n.innerType):e._zod.optin}var cl=(e,n,i,o)=>{let t=i,r=e._zod.def,a=r.shape;if(Object.getOwnPropertySymbols(a).length&&re(e,n,t,o,"Symbol keys cannot be represented in JSON Schema"))return;t.type="object",t.properties={};for(let l in a)ee(t.properties,l,W(a[l],n,{...o,path:[...o.path,"properties",l]}));let s=new Set(Object.keys(a)),u=new Set([...s].filter(l=>{let d=r.shape[l];return n.io==="input"?Qn(d)===void 0:d._zod.optout===void 0}));u.size>0&&(t.required=Array.from(u)),r.catchall?._zod.def.type==="never"?t.additionalProperties=!1:r.catchall?r.catchall&&(t.additionalProperties=W(r.catchall,n,{...o,path:[...o.path,"additionalProperties"]})):n.io==="output"&&(t.additionalProperties=!1)},Yi=(e,n,i,o)=>{let t=e._zod.def,r=t.inclusive===!1,a=t.options.map((c,s)=>W(c,n,{...o,path:[...o.path,r?"oneOf":"anyOf",s]}));r?i.oneOf=a:i.anyOf=a},sl=(e,n,i,o)=>{let t=e._zod.def,r=W(t.left,n,{...o,path:[...o.path,"allOf",0]}),a=W(t.right,n,{...o,path:[...o.path,"allOf",1]}),c=u=>"allOf"in u&&Object.keys(u).length===1,s=[...c(r)?r.allOf:[r],...c(a)?a.allOf:[a]];i.allOf=s,n.intersections.push(s)},ul=(e,n,i,o)=>{let t=i,r=e._zod.def;t.type="array";let a=n.target==="draft-2020-12"?"prefixItems":"items",c=n.target==="draft-2020-12"||n.target==="openapi-3.0"?"items":"additionalItems",s=r.items.map((y,x)=>W(y,n,{...o,path:[...o.path,a,x]})),u=r.rest?W(r.rest,n,{...o,path:[...o.path,c,...n.target==="openapi-3.0"?[r.items.length]:[]]}):null,l=r.items.length;for(;l>0;){let y=r.items[l-1];if(!(n.io==="input"?Qn(y)!==void 0:y._zod.optout==="optional"))break;l--}let d=r.items.length,f=!r.rest;n.target==="draft-2020-12"?(t.prefixItems=s,f?t.items=!1:u&&(t.items=u),l>0&&(t.minItems=l),f&&(t.maxItems=d)):n.target==="openapi-3.0"?(t.items={anyOf:s},u&&t.items.anyOf.push(u),l>0&&(t.minItems=l),f&&(t.maxItems=d)):(t.items=s,f?t.additionalItems=!1:u&&(t.additionalItems=u),l>0&&(t.minItems=l),f&&(t.maxItems=d));let{minimum:m,maximum:v}=e._zod.bag;typeof m=="number"&&(t.minItems=m),typeof v=="number"&&(t.maxItems=v)};function Au(e,n,i){if(n.$ref){if(i.has(n))return n;i.add(n);let v=e.get(n)?.def;if(!v)return n;let y=Au(e,v,i);return y===v?n:y}for(let v of["anyOf","oneOf"]){let y=n[v];if(!Array.isArray(y))continue;let x=y.map(I=>Au(e,I,i));x.some((I,h)=>I!==y[h])&&(n={...n,[v]:x})}let o=Array.isArray(n.type)?n.type:[n.type],t=!o.includes("string")&&o.some(v=>v==="number"||v==="integer"),r=n.enum??(n.const!==void 0?[n.const]:void 0);if(!t&&!r?.some(v=>typeof v=="number"))return n;let{minimum:a,maximum:c,exclusiveMinimum:s,exclusiveMaximum:u,multipleOf:l,format:d,id:f,...m}=n;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",r||(m.pattern=(o.includes("number")?Ye:An).source)),m}var Eu=new WeakMap;function yb(e){let n=new Map;for(let o of e.seen.values())o.def&&!n.has(o.schema)&&n.set(o.schema,o);let i=new Map;for(let o of Eu.get(e)??[]){let t=e.seen.get(o),r=(t?.def??t?.schema)?.propertyNames;if(!r||r===!0||i.has(r))continue;let a=Au(n,r,new Set);a!==r&&i.set(r,a)}if(i.size)for(let o of e.seen.values())for(let t of[o.schema,o.def]){let r=t&&i.get(t.propertyNames);r&&(t.propertyNames=r)}}var ll=(e,n,i,o)=>{let t=i,r=e._zod.def;t.type="object";let a=r.keyType,s=a._zod.bag?.patterns;if(r.mode==="loose"&&s&&s.size>0){let d=W(r.valueType,n,{...o,path:[...o.path,"patternProperties","*"]});t.patternProperties={};for(let f of s)ee(t.patternProperties,f.source,d)}else{if(n.target==="draft-07"||n.target==="draft-2020-12"){t.propertyNames=W(r.keyType,n,{...o,path:[...o.path,"propertyNames"]});let d=Eu.get(n);d||(d=[],Eu.set(n,d),n.deferred.push(()=>yb(n))),d.push(e)}t.additionalProperties=W(r.valueType,n,{...o,path:[...o.path,"additionalProperties"]})}let u=a._zod.values,l=n.io==="input"&&Qn(r.valueType)!==void 0;if(u&&!r.partial&&!l){let d=[...u].filter(f=>typeof f=="string"||typeof f=="number");d.length>0&&(t.required=d.map(String))}},dl=(e,n,i,o)=>{let t=e._zod.def,r=W(t.innerType,n,o),a=n.seen.get(e);n.target==="openapi-3.0"?(a.ref=t.innerType,i.nullable=!0):i.anyOf=[r,{type:"null"}]},fl=(e,n,i,o)=>{let t=e._zod.def;W(t.innerType,n,o);let r=n.seen.get(e);r.ref=t.innerType},ml=Symbol();function Qm(e,n,i,o,t){let r=!1,a=JSON.stringify(e,(c,s)=>typeof s!="bigint"?s:(r=!0,null));return r?(re(n,i,o,t,"BigInt defaults cannot be represented in JSON Schema"),ml):JSON.parse(a)}var pl=(e,n,i,o)=>{let t=e._zod.def;W(t.innerType,n,o);let r=n.seen.get(e);r.ref=t.innerType;let a=Qm(t.defaultValue,e,n,i,o);a!==ml&&(i.default=a)},gl=(e,n,i,o)=>{let t=e._zod.def;W(t.innerType,n,o);let r=n.seen.get(e);if(r.ref=t.innerType,n.io!=="input")return;let a=Qm(t.defaultValue,e,n,i,o);a!==ml&&(i._prefault=a)},vl=(e,n,i,o)=>{let t=e._zod.def;W(t.innerType,n,o);let r=n.seen.get(e);r.ref=t.innerType;let a;try{a=t.catchValue(void 0)}catch{re(e,n,i,o,"Dynamic catch values are not supported in JSON Schema");return}i.default=a},hl=(e,n,i,o)=>{let t=e._zod.def,r=t.in._zod.traits.has("$ZodTransform"),a=n.io==="input"?r?t.out:t.in:t.out;W(a,n,o);let c=n.seen.get(e);c.ref=a},$l=(e,n,i,o)=>{let t=e._zod.def;W(t.innerType,n,o);let r=n.seen.get(e);r.ref=t.innerType,i.readOnly=!0},yl=(e,n,i,o)=>{let t=e._zod.def;W(t.innerType,n,o);let r=n.seen.get(e);r.ref=t.innerType},Qi=(e,n,i,o)=>{let t=e._zod.def;W(t.innerType,n,o);let r=n.seen.get(e);r.ref=t.innerType},bl=(e,n,i,o)=>{let t=e._zod.innerType;W(t,n,o);let r=n.seen.get(e);r.ref=t},Hi={string:Cu,number:Zu,boolean:Vu,bigint:Lu,symbol:Mu,null:Ru,undefined:Fu,void:Ju,never:Gu,any:Bu,unknown:Wu,date:Ku,enum:Xu,literal:qu,nan:Hu,template_literal:Yu,file:Qu,success:el,custom:tl,function:nl,transform:rl,map:il,set:ol,array:al,object:cl,union:Yi,intersection:sl,tuple:ul,record:ll,nullable:dl,nonoptional:fl,default:pl,prefault:gl,catch:vl,pipe:hl,readonly:$l,promise:yl,optional:Qi,lazy:bl};function eo(e,n){if("_idmap"in e){let o=e,t=tt({...n,processors:Hi}),r={};for(let s of o._idmap.entries()){let[u,l]=s;W(l,t)}let a={},c={registry:o,uri:n?.uri,defs:r};t.external=c;for(let s of o._idmap.entries()){let[u,l]=s;nt(t,l),ee(a,u,rt(t,l))}if(Object.keys(r).length>0){let s=t.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[s]:r}}return{schemas:a}}let i=tt({...n,processors:Hi});return W(e,i),nt(i,e),rt(i,e)}var to=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(n){this.ctx.counter=n}get seen(){return this.ctx.seen}constructor(n){let i=n?.target??"draft-2020-12";i==="draft-4"&&(i="draft-04"),i==="draft-7"&&(i="draft-07"),this.ctx=tt({processors:Hi,target:i,...n?.metadata&&{metadata:n.metadata},...n?.unrepresentable&&{unrepresentable:n.unrepresentable},...n?.override&&{override:n.override},...n?.io&&{io:n.io}})}process(n,i={path:[],schemaPath:[]}){return W(n,this.ctx,i)}emit(n,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,nt(this.ctx,n);let o=rt(this.ctx,n),{"~standard":t,...r}=o;return r}};var ep={};var dn={};Ve(dn,{ZodAny:()=>Ml,ZodArray:()=>Gl,ZodBase64:()=>_o,ZodBase64URL:()=>xo,ZodBigInt:()=>un,ZodBigIntFormat:()=>Io,ZodBoolean:()=>sn,ZodCIDRv4:()=>yo,ZodCIDRv6:()=>bo,ZodCUID:()=>fo,ZodCUID2:()=>mo,ZodCatch:()=>fd,ZodCodec:()=>ur,ZodCreditCard:()=>Tl,ZodCustom:()=>lr,ZodCustomStringFormat:()=>an,ZodDate:()=>rr,ZodDefault:()=>ad,ZodDiscriminatedUnion:()=>Wl,ZodE164:()=>ko,ZodEmail:()=>co,ZodEmoji:()=>uo,ZodEnum:()=>rn,ZodExactOptional:()=>Do,ZodFile:()=>nd,ZodFunction:()=>xd,ZodGUID:()=>so,ZodIPv4:()=>ho,ZodIPv6:()=>$o,ZodISODate:()=>ot,ZodISODateTime:()=>it,ZodISODuration:()=>ct,ZodISOTime:()=>at,ZodIntersection:()=>Kl,ZodJWT:()=>wo,ZodKSUID:()=>vo,ZodLazy:()=>yd,ZodLiteral:()=>td,ZodMAC:()=>Ul,ZodMap:()=>Ql,ZodNaN:()=>pd,ZodNanoID:()=>lo,ZodNever:()=>Fl,ZodNonOptional:()=>Oo,ZodNull:()=>Vl,ZodNullable:()=>od,ZodNumber:()=>cn,ZodNumberFormat:()=>St,ZodObject:()=>or,ZodOptional:()=>cr,ZodPipe:()=>sr,ZodPrefault:()=>sd,ZodPreprocess:()=>gd,ZodPromise:()=>_d,ZodReadonly:()=>vd,ZodRecord:()=>nn,ZodSet:()=>ed,ZodString:()=>on,ZodStringFormat:()=>q,ZodSuccess:()=>dd,ZodSymbol:()=>Cl,ZodTemplateLiteral:()=>$d,ZodTransform:()=>rd,ZodTuple:()=>ql,ZodType:()=>Z,ZodULID:()=>po,ZodURL:()=>nr,ZodUUID:()=>Fe,ZodUndefined:()=>Zl,ZodUnion:()=>ar,ZodUnknown:()=>Rl,ZodVoid:()=>Jl,ZodXID:()=>go,ZodXor:()=>Bl,_ZodString:()=>ao,_default:()=>cd,_function:()=>lg,any:()=>Mp,array:()=>ir,base64:()=>kp,base64url:()=>wp,bigint:()=>Ep,boolean:()=>El,catch:()=>md,check:()=>dg,cidrv4:()=>_p,cidrv6:()=>xp,codec:()=>ag,creditCard:()=>Sp,cuid:()=>mp,cuid2:()=>pp,custom:()=>fg,date:()=>Fp,describe:()=>mg,discriminatedUnion:()=>Xp,e164:()=>Ip,email:()=>rp,emoji:()=>dp,enum:()=>zo,exactOptional:()=>id,file:()=>ng,float32:()=>Np,float64:()=>Up,function:()=>lg,guid:()=>ip,hash:()=>jp,hex:()=>Op,hostname:()=>Dp,httpUrl:()=>lp,instanceof:()=>gg,int:()=>io,int32:()=>Tp,int64:()=>Cp,intersection:()=>Xl,invertCodec:()=>cg,ipv4:()=>$p,ipv6:()=>bp,json:()=>hg,jwt:()=>zp,keyof:()=>Jp,ksuid:()=>hp,lazy:()=>bd,literal:()=>tg,looseObject:()=>Wp,looseRecord:()=>Hp,mac:()=>yp,map:()=>Yp,meta:()=>pg,nan:()=>og,nanoid:()=>fp,nativeEnum:()=>eg,never:()=>So,nonoptional:()=>ld,null:()=>Ll,nullable:()=>tr,nullish:()=>rg,number:()=>Al,object:()=>Gp,optional:()=>wt,partialRecord:()=>qp,pipe:()=>oo,prefault:()=>ud,preprocess:()=>$g,promise:()=>ug,readonly:()=>hd,record:()=>Yl,refine:()=>kd,set:()=>Qp,strictObject:()=>Bp,string:()=>er,stringFormat:()=>Pp,stringbool:()=>vg,success:()=>ig,superRefine:()=>wd,symbol:()=>Vp,templateLiteral:()=>sg,transform:()=>Po,tuple:()=>Hl,uint32:()=>Ap,uint64:()=>Zp,ulid:()=>gp,undefined:()=>Lp,union:()=>ln,unknown:()=>kt,url:()=>up,uuid:()=>op,uuidv4:()=>ap,uuidv6:()=>cp,uuidv7:()=>sp,void:()=>Rp,xid:()=>vp,xor:()=>Kp});var no={};Ve(no,{endsWith:()=>Wt,gt:()=>Me,gte:()=>we,includes:()=>Gt,length:()=>xt,lowercase:()=>Ft,lt:()=>Le,lte:()=>ke,maxLength:()=>_t,maxSize:()=>et,mime:()=>Kt,minLength:()=>Ge,minSize:()=>Re,multipleOf:()=>Qe,negative:()=>Bi,nonnegative:()=>Ki,nonpositive:()=>Wi,normalize:()=>Xt,overwrite:()=>Ce,positive:()=>Gi,properties:()=>qi,property:()=>Xi,regex:()=>Rt,size:()=>bt,slugify:()=>Qt,startsWith:()=>Bt,toLowerCase:()=>Ht,toUpperCase:()=>Yt,trim:()=>qt,uppercase:()=>Jt});var tp=new WeakSet([Object.prototype,Error.prototype]);function ro(e,n,i){Object.defineProperty(e,n,{configurable:!0,enumerable:!1,get(){let o=i(this);return Object.defineProperty(this,n,{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,n,{value:o,configurable:!0,writable:!0})}})}var np=(e,n)=>{Nn.init(e,n),e.name="ZodError";let i=Object.getPrototypeOf(e);tp.has(i)||(tp.add(i),ro(i,"format",o=>t=>Tn(o,t)),ro(i,"flatten",o=>t=>Un(o,t)),ro(i,"addIssue",o=>t=>{o.issues.push(t),o.message=JSON.stringify(o.issues,Nt,2)}),ro(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}}))},_b=p("ZodError",np),he=p("ZodError",np,void 0,{Parent:Error});var _l=At(he),xl=Et(he),kl=Ct(he),wl=Zt(he),Il=Er(he),Sl=Cr(he),zl=Zr(he),Pl=Vr(he),Dl=Lr(he),Ol=Mr(he),jl=Rr(he),Nl=Fr(he);function kb(){ie.localeError||ne($i())}function It(){ie.memoizer||ne({memoizer:Jn()})}var Z=p("ZodType",(e,n)=>(kb(),E.init(e,n),e.def=n,e.type=n.type,e),{check(...e){let n=this.def;return this.clone(_.mergeDefs(n,{checks:[...n.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,n){return B(this,e,n)},brand(){return this},register(e,n){return e.add(this,n),this},refine(e,n){return this.check(kd(e,n))},superRefine(e,n){return this.check(wd(e,n))},overwrite(e){return this.check(Ce(e))},optional(){return wt(this)},exactOptional(){return id(this)},nullable(){return tr(this)},nullish(){return wt(tr(this))},nonoptional(e){return ld(this,e)},array(){return ir(this)},or(e){return ln([this,e])},and(e){return Xl(this,e)},transform(e){return oo(this,Po(e))},default(e){return cd(this,e)},prefault(e){return ud(this,e)},catch(e){return md(this,e)},pipe(e){return oo(this,e)},readonly(){return hd(this)},describe(e){let n=this.clone();return oe.add(n,{description:e}),n},meta(...e){if(e.length===0)return oe.get(this);let n=this.clone();return oe.add(n,e[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...n){return n.length===0?e(this):e(this,...n)},get"~standard"(){return _.hide(this,"~standard",{...ei(this),jsonSchema:{input:tn(this,"input"),output:tn(this,"output")}})},set"~standard"(e){_.own(this,"~standard",e)},parse:function e(n,i){return _l(this,n,i,{callee:e})},parseAsync:async function e(n,i){return await xl(this,n,i,{callee:e})},safeParse(e,n){return kl(this,e,n)},async safeParseAsync(e,n){return wl(this,e,n)},get spa(){return this?.safeParseAsync},set spa(e){_.own(this,"spa",e)},encode:function e(n,i){return Il(this,n,i,{callee:e})},decode:function e(n,i){return Sl(this,n,i,{callee:e})},encodeAsync:async function e(n,i){return await zl(this,n,i,{callee:e})},decodeAsync:async function e(n,i){return await Pl(this,n,i,{callee:e})},safeEncode(e,n){return Dl(this,e,n)},safeDecode(e,n){return Ol(this,e,n)},async safeEncodeAsync(e,n){return jl(this,e,n)},async safeDecodeAsync(e,n){return Nl(this,e,n)},toJSONSchema(e){return Tu(this,{})(e)},get description(){return oe.get(this)?.description},get _def(){return this._zod.def}}),ao=p("_ZodString",(e,n)=>{gt.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(o,t,r)=>Cu(e,o,t,r);let i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null},{regex(...e){return this.check(Rt(...e))},includes(...e){return this.check(Gt(...e))},startsWith(...e){return this.check(Bt(...e))},endsWith(...e){return this.check(Wt(...e))},min(...e){return this.check(Ge(...e))},max(...e){return this.check(_t(...e))},length(...e){return this.check(xt(...e))},nonempty(...e){return this.check(Ge(1,...e))},lowercase(e){return this.check(Ft(e))},uppercase(e){return this.check(Jt(e))},trim(){return this.check(qt())},normalize(...e){return this.check(Xt(...e))},toLowerCase(){return this.check(Ht())},toUpperCase(){return this.check(Yt())},slugify(){return this.check(Qt())}}),on=p("ZodString",(e,n)=>{gt.init(e,n),ao.init(e,n)},{email(e){return this.check(wi(co,e))},url(e){return this.check(Wn(nr,e))},jwt(e){return this.check(Ji(wo,e))},emoji(e){return this.check(Oi(uo,e))},guid(e){return this.check(Ii(so,e))},uuid(e){return this.check(Si(Fe,e))},uuidv4(e){return this.check(zi(Fe,e))},uuidv6(e){return this.check(Pi(Fe,e))},uuidv7(e){return this.check(Di(Fe,e))},nanoid(e){return this.check(ji(lo,e))},cuid(e){return this.check(Ni(fo,e))},cuid2(e){return this.check(Ui(mo,e))},ulid(e){return this.check(Ti(po,e))},base64(e){return this.check(Mi(_o,e))},base64url(e){return this.check(Ri(xo,e))},xid(e){return this.check(Ai(go,e))},ksuid(e){return this.check(Ei(vo,e))},ipv4(e){return this.check(Ci(ho,e))},ipv6(e){return this.check(Zi($o,e))},cidrv4(e){return this.check(Vi(yo,e))},cidrv6(e){return this.check(Li(bo,e))},e164(e){return this.check(Fi(ko,e))},datetime(e){return this.check(Kn(it,e))},date(e){return this.check(Xn(ot,e))},time(e){return this.check(qn(at,e))},duration(e){return this.check(Hn(ct,e))}});function er(e){return Hs(on,e)}var q=p("ZodStringFormat",(e,n)=>{X.init(e,n),ao.init(e,n)}),it=p("ZodISODateTime",(e,n)=>{Rc.init(e,n),q.init(e,n)}),ot=p("ZodISODate",(e,n)=>{Fc.init(e,n),q.init(e,n)}),at=p("ZodISOTime",(e,n)=>{Jc.init(e,n),q.init(e,n)}),ct=p("ZodISODuration",(e,n)=>{Gc.init(e,n),q.init(e,n)}),co=p("ZodEmail",(e,n)=>{jc.init(e,n),q.init(e,n)});function rp(e){return wi(co,e)}var so=p("ZodGUID",(e,n)=>{Dc.init(e,n),q.init(e,n)});function ip(e){return Ii(so,e)}var Fe=p("ZodUUID",(e,n)=>{Oc.init(e,n),q.init(e,n)});function op(e){return Si(Fe,e)}function ap(e){return zi(Fe,e)}function cp(e){return Pi(Fe,e)}function sp(e){return Di(Fe,e)}var nr=p("ZodURL",(e,n)=>{Tc.init(e,n),q.init(e,n)});function up(e){return Wn(nr,e)}function lp(e){return Wn(nr,{protocol:ue.httpProtocol,hostname:ue.domain,..._.normalizeParams(e)})}var uo=p("ZodEmoji",(e,n)=>{Ac.init(e,n),q.init(e,n)});function dp(e){return Oi(uo,e)}var lo=p("ZodNanoID",(e,n)=>{Ec.init(e,n),q.init(e,n)});function fp(e){return ji(lo,e)}var fo=p("ZodCUID",(e,n)=>{Cc.init(e,n),q.init(e,n)});function mp(e){return Ni(fo,e)}var mo=p("ZodCUID2",(e,n)=>{Zc.init(e,n),q.init(e,n)});function pp(e){return Ui(mo,e)}var po=p("ZodULID",(e,n)=>{Vc.init(e,n),q.init(e,n)});function gp(e){return Ti(po,e)}var go=p("ZodXID",(e,n)=>{Lc.init(e,n),q.init(e,n)});function vp(e){return Ai(go,e)}var vo=p("ZodKSUID",(e,n)=>{Mc.init(e,n),q.init(e,n)});function hp(e){return Ei(vo,e)}var ho=p("ZodIPv4",(e,n)=>{Bc.init(e,n),q.init(e,n)});function $p(e){return Ci(ho,e)}var Ul=p("ZodMAC",(e,n)=>{Kc.init(e,n),q.init(e,n)});function yp(e){return Qs(Ul,e)}var $o=p("ZodIPv6",(e,n)=>{Wc.init(e,n),q.init(e,n)});function bp(e){return Zi($o,e)}var yo=p("ZodCIDRv4",(e,n)=>{Xc.init(e,n),q.init(e,n)});function _p(e){return Vi(yo,e)}var bo=p("ZodCIDRv6",(e,n)=>{qc.init(e,n),q.init(e,n)});function xp(e){return Li(bo,e)}var _o=p("ZodBase64",(e,n)=>{Hc.init(e,n),q.init(e,n)});function kp(e){return Mi(_o,e)}var xo=p("ZodBase64URL",(e,n)=>{Yc.init(e,n),q.init(e,n)});function wp(e){return Ri(xo,e)}var ko=p("ZodE164",(e,n)=>{Qc.init(e,n),q.init(e,n)});function Ip(e){return Fi(ko,e)}var Tl=p("ZodCreditCard",(e,n)=>{es.init(e,n),q.init(e,n)});function Sp(e){return eu(Tl,e)}var wo=p("ZodJWT",(e,n)=>{ts.init(e,n),q.init(e,n)});function zp(e){return Ji(wo,e)}var an=p("ZodCustomStringFormat",(e,n)=>{ns.init(e,n),q.init(e,n)});function Pp(e,n,i={}){return en(an,e,n,i)}function Dp(e){return en(an,"hostname",ue.hostname,e)}function Op(e){return en(an,"hex",ue.hex,e)}function jp(e,n){let i=n?.enc??"hex",o=`${e}_${i}`,t=ue[o];if(!t)throw new Error(`Unrecognized hash format: ${o}`);return en(an,o,t,n)}var cn=p("ZodNumber",(e,n)=>{ui.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(o,t,r)=>Zu(e,o,t,r);let i=e._zod.bag;e.minValue=Math.max(i.minimum??Number.NEGATIVE_INFINITY,i.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(i.maximum??Number.POSITIVE_INFINITY,i.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(i.format??"").includes("int")||Number.isSafeInteger(i.multipleOf??.5),e.isFinite=!0,e.format=i.format??null},{gt(e,n){return this.check(Me(e,n))},gte(e,n){return this.check(we(e,n))},min(e,n){return this.check(we(e,n))},lt(e,n){return this.check(Le(e,n))},lte(e,n){return this.check(ke(e,n))},max(e,n){return this.check(ke(e,n))},int(e){return this.check(io(e))},safe(e){return this.check(io(e))},positive(e){return this.check(Me(0,e))},nonnegative(e){return this.check(we(0,e))},negative(e){return this.check(Le(0,e))},nonpositive(e){return this.check(ke(0,e))},multipleOf(e,n){return this.check(Qe(e,n))},step(e,n){return this.check(Qe(e,n))},finite(){return this}});function Al(e){return nu(cn,e)}var St=p("ZodNumberFormat",(e,n)=>{rs.init(e,n),cn.init(e,n)});function io(e){return iu(St,e)}function Np(e){return ou(St,e)}function Up(e){return au(St,e)}function Tp(e){return cu(St,e)}function Ap(e){return su(St,e)}var sn=p("ZodBoolean",(e,n)=>{Ln.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Vu(e,i,o,t)});function El(e){return uu(sn,e)}var un=p("ZodBigInt",(e,n)=>{li.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(o,t,r)=>Lu(e,o,t,r);let i=e._zod.bag;e.minValue=i.minimum??null,e.maxValue=i.maximum??null,e.format=i.format??null},{gte(e,n){return this.check(we(e,n))},min(e,n){return this.check(we(e,n))},gt(e,n){return this.check(Me(e,n))},lt(e,n){return this.check(Le(e,n))},lte(e,n){return this.check(ke(e,n))},max(e,n){return this.check(ke(e,n))},positive(e){return this.check(Me(BigInt(0),e))},negative(e){return this.check(Le(BigInt(0),e))},nonpositive(e){return this.check(ke(BigInt(0),e))},nonnegative(e){return this.check(we(BigInt(0),e))},multipleOf(e,n){return this.check(Qe(e,n))}});function Ep(e){return du(un,e)}var Io=p("ZodBigIntFormat",(e,n)=>{is.init(e,n),un.init(e,n)});function Cp(e){return mu(Io,e)}function Zp(e){return pu(Io,e)}var Cl=p("ZodSymbol",(e,n)=>{os.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Mu(e,i,o,t)});function Vp(e){return gu(Cl,e)}var Zl=p("ZodUndefined",(e,n)=>{as.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Fu(e,i,o,t)});function Lp(e){return vu(Zl,e)}var Vl=p("ZodNull",(e,n)=>{cs.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Ru(e,i,o,t)});function Ll(e){return hu(Vl,e)}var Ml=p("ZodAny",(e,n)=>{ss.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Bu(e,i,o,t)});function Mp(){return $u(Ml)}var Rl=p("ZodUnknown",(e,n)=>{us.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Wu(e,i,o,t)});function kt(){return yu(Rl)}var Fl=p("ZodNever",(e,n)=>{ls.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Gu(e,i,o,t)});function So(e){return bu(Fl,e)}var Jl=p("ZodVoid",(e,n)=>{ds.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Ju(e,i,o,t)});function Rp(e){return _u(Jl,e)}var rr=p("ZodDate",(e,n)=>{fs.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(o,t,r)=>Ku(e,o,t,r),e.min=(o,t)=>e.check(we(o,t)),e.max=(o,t)=>e.check(ke(o,t));let i=e._zod.bag;e.minDate=i.minimum?new Date(i.minimum):null,e.maxDate=i.maximum?new Date(i.maximum):null});function Fp(e){return xu(rr,e)}var Gl=p("ZodArray",(e,n)=>{It(),ms.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>al(e,i,o,t),e.element=n.element},{min(e,n){return this.check(Ge(e,n))},nonempty(e){return this.check(Ge(1,e))},max(e,n){return this.check(_t(e,n))},length(e,n){return this.check(xt(e,n))},unwrap(){return this.element}});function ir(e,n){return Iu(Gl,e,n)}function Jp(e){let n=e._zod.def.shape;return zo(Object.keys(n))}var or=p("ZodObject",(e,n)=>{It(),ps.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>cl(e,i,o,t),_.installLazyProp(e,"shape",i=>i._zod.def.shape,!1)},{keyof(){return zo(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:kt()})},loose(){return this.clone({...this._zod.def,catchall:kt()})},strict(){return this.clone({...this._zod.def,catchall:So()})},strip(){return this.clone({...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(cr,this,e[0])},exactPartial(...e){return _.partial(Do,this,e[0],"exactPartial")},required(...e){return _.required(Oo,this,e[0])}});function Gp(e,n){let i={type:"object",shape:e??{},..._.normalizeParams(n)};return new or(i)}function Bp(e,n){return new or({type:"object",shape:e,catchall:So(),..._.normalizeParams(n)})}function Wp(e,n){return new or({type:"object",shape:e,catchall:kt(),..._.normalizeParams(n)})}var ar=p("ZodUnion",(e,n)=>{Mn.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Yi(e,i,o,t),e.options=n.options});function ln(e,n){return new ar({type:"union",options:e,..._.normalizeParams(n)})}var Bl=p("ZodXor",(e,n)=>{ar.init(e,n),gs.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Yi(e,i,o,t),e.options=n.options});function Kp(e,n){return new Bl({type:"union",options:e,inclusive:!1,..._.normalizeParams(n)})}var Wl=p("ZodDiscriminatedUnion",(e,n)=>{ar.init(e,n),hs.init(e,n)});function Xp(e,n,i){return new Wl({type:"union",options:n,discriminator:e,..._.normalizeParams(i)})}var Kl=p("ZodIntersection",(e,n)=>{$s.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>sl(e,i,o,t)});function Xl(e,n){return new Kl({type:"intersection",left:e,right:n})}var ql=p("ZodTuple",(e,n)=>{It(),di.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>ul(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(n=>new cr({type:"optional",innerType:n}))})}});function Hl(e,n,i){let o=n instanceof E,t=o?i:n,r=o?n:null;return new ql({type:"tuple",items:e,rest:r,..._.normalizeParams(t)})}var nn=p("ZodRecord",(e,n)=>{It(),ys.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>ll(e,i,o,t),e.keyType=n.keyType,e.valueType=n.valueType});function Yl(e,n,i){return!n||!n._zod?new nn({type:"record",keyType:er(),valueType:e,..._.normalizeParams(n)}):new nn({type:"record",keyType:e,valueType:n,..._.normalizeParams(i)})}function qp(e,n,i){return new nn({type:"record",keyType:e,valueType:n,..._.normalizeParams(i),partial:!0})}function Hp(e,n,i){return new nn({type:"record",keyType:e,valueType:n,mode:"loose",..._.normalizeParams(i)})}var Ql=p("ZodMap",(e,n)=>{It(),bs.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>il(e,i,o,t),e.keyType=n.keyType,e.valueType=n.valueType,e.min=(...i)=>e.check(Re(...i)),e.nonempty=i=>e.check(Re(1,i)),e.max=(...i)=>e.check(et(...i)),e.size=(...i)=>e.check(bt(...i))});function Yp(e,n,i){return new Ql({type:"map",keyType:e,valueType:n,..._.normalizeParams(i)})}var ed=p("ZodSet",(e,n)=>{It(),_s.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>ol(e,i,o,t),e.min=(...i)=>e.check(Re(...i)),e.nonempty=i=>e.check(Re(1,i)),e.max=(...i)=>e.check(et(...i)),e.size=(...i)=>e.check(bt(...i))});function Qp(e,n){return new ed({type:"set",valueType:e,..._.normalizeParams(n)})}var rn=p("ZodEnum",(e,n)=>{xs.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(o,t,r)=>Xu(e,o,t,r),e.enum=n.entries,e.options=Object.values(n.entries);let i=new Set(Object.keys(n.entries));e.extract=(o,t)=>{let r={};for(let a of o)if(i.has(a))r[a]=n.entries[a];else throw new Error(`Key ${a} not found in enum`);return new rn({...n,checks:[],..._.normalizeParams(t),entries:r})},e.exclude=(o,t)=>{let r={...n.entries};for(let a of o)if(i.has(a))delete r[a];else throw new Error(`Key ${a} not found in enum`);return new rn({...n,checks:[],..._.normalizeParams(t),entries:r})}});function zo(e,n){let i=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new rn({type:"enum",entries:i,..._.normalizeParams(n)})}function eg(e,n){return new rn({type:"enum",entries:e,..._.normalizeParams(n)})}var td=p("ZodLiteral",(e,n)=>{ks.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>qu(e,i,o,t),e.values=new Set(n.values),Object.defineProperty(e,"value",{get(){if(n.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return n.values[0]}})});function tg(e,n){return new td({type:"literal",values:Array.isArray(e)?e:[e],..._.normalizeParams(n)})}var nd=p("ZodFile",(e,n)=>{ws.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Qu(e,i,o,t),e.min=(i,o)=>e.check(Re(i,o)),e.max=(i,o)=>e.check(et(i,o)),e.mime=(i,o)=>e.check(Kt(Array.isArray(i)?i:[i],o))});function ng(e){return Su(nd,e)}var rd=p("ZodTransform",(e,n)=>{It(),Is.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>rl(e,i,o,t),e._zod.parse=(i,o)=>{if(o.direction==="backward")throw new He(e.constructor.name);i.addIssue=r=>{if(typeof r=="string")i.issues.push(_.issue(r,i.value,n));else{let a=r;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=n.transform(i.value,i);return t instanceof Promise?t.then(r=>(i.value=r,i)):(i.value=t,i)}});function Po(e){return new rd({type:"transform",transform:e})}var cr=p("ZodOptional",(e,n)=>{fi.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Qi(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function wt(e){return new cr({type:"optional",innerType:e})}var Do=p("ZodExactOptional",(e,n)=>{Ss.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Qi(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function id(e){return new Do({type:"optional",innerType:e})}var od=p("ZodNullable",(e,n)=>{zs.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>dl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function tr(e){return new od({type:"nullable",innerType:e})}function rg(e){return wt(tr(e))}var ad=p("ZodDefault",(e,n)=>{Ps.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>pl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function cd(e,n){return new ad({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():_.shallowClone(n)}})}var sd=p("ZodPrefault",(e,n)=>{Ds.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>gl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function ud(e,n){return new sd({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():_.shallowClone(n)}})}var Oo=p("ZodNonOptional",(e,n)=>{Os.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>fl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function ld(e,n){return new Oo({type:"nonoptional",innerType:e,..._.normalizeParams(n)})}var dd=p("ZodSuccess",(e,n)=>{js.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>el(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function ig(e){return new dd({type:"success",innerType:e})}var fd=p("ZodCatch",(e,n)=>{Ns.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>vl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function md(e,n){return new fd({type:"catch",innerType:e,catchValue:typeof n=="function"?n:_.constantCatch(n)})}var pd=p("ZodNaN",(e,n)=>{Us.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Hu(e,i,o,t)});function og(e){return wu(pd,e)}var sr=p("ZodPipe",(e,n)=>{mi.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>hl(e,i,o,t),e.in=n.in,e.out=n.out});function oo(e,n){return new sr({type:"pipe",in:e,out:n})}var ur=p("ZodCodec",(e,n)=>{sr.init(e,n),Rn.init(e,n)});function ag(e,n,i){return new ur({type:"pipe",in:e,out:n,transform:i.decode,reverseTransform:i.encode})}function cg(e){let n=e._zod.def;return new ur({type:"pipe",in:n.out,out:n.in,transform:n.reverseTransform,reverseTransform:n.transform})}var gd=p("ZodPreprocess",(e,n)=>{sr.init(e,n),Ts.init(e,n)}),vd=p("ZodReadonly",(e,n)=>{As.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>$l(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function hd(e){return new vd({type:"readonly",innerType:e})}var $d=p("ZodTemplateLiteral",(e,n)=>{Es.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Yu(e,i,o,t)});function sg(e,n){return new $d({type:"template_literal",parts:e,..._.normalizeParams(n)})}var yd=p("ZodLazy",(e,n)=>{Fn.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>bl(e,i,o,t),e.unwrap=()=>e._zod.def.getter()});function bd(e){return new yd({type:"lazy",getter:e})}var _d=p("ZodPromise",(e,n)=>{Zs.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>yl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function ug(e){return new _d({type:"promise",innerType:e})}var xd=p("ZodFunction",(e,n)=>{Cs.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>nl(e,i,o,t)});function lg(e){return new xd({type:"function",input:Array.isArray(e?.input)?Hl(e?.input):e?.input??ir(kt()),output:e?.output??kt()})}var lr=p("ZodCustom",(e,n)=>{Vs.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>tl(e,i,o,t)});function dg(e){let n=new H({check:"custom"});return n._zod.check=e,n}function fg(e,n){return zu(lr,e??(()=>!0),n)}function kd(e,n={}){return Pu(lr,e,n)}function wd(e,n){return Du(e,n)}var mg=Ou,pg=ju;function gg(e,n={}){let i=new lr({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,..._.normalizeParams(n)});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 vg=(...e)=>Nu({Codec:ur,Boolean:sn,String:on},...e);function hg(e){let n=bd(()=>ln([er(e),Al(),El(),Ll(),ir(n),Yl(er(),n)]));return n}function $g(e,n){return new gd({type:"pipe",in:Po(e),out:n})}var wb={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 Ib(e){ne({customError:e})}function Sb(){return ne().customError}var Id;Id||(Id={});var dr={};Ve(dr,{ZodISODate:()=>ot,ZodISODateTime:()=>it,ZodISODuration:()=>ct,ZodISOTime:()=>at,date:()=>Pb,datetime:()=>zb,duration:()=>Ob,time:()=>Db});function zb(e){return Kn(it,e)}function Pb(e){return Xn(ot,e)}function Db(e){return qn(at,e)}function Ob(e){return Hn(ct,e)}var S={...dn,...no,iso:dr},jb=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 Nb(e,n){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":n??"draft-2020-12"}function yg(e,n){return e.map((i,o)=>o<n?i:i.optional())}function Ub(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Tb(e,n){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 n.rootSchema;let o=n.version==="draft-2020-12"?"$defs":"definitions";if(i[0]===o){let t=i[1]===void 0?void 0:Ub(i[1]);if(!t||!n.defs[t])throw new Error(`Reference not found: ${e}`);return n.defs[t]}throw new Error(`Reference not found: ${e}`)}function Ab(e,n){return S.transform(o=>o).check(o=>{let t=o.value;if(!(typeof t!="object"||t===null||Array.isArray(t)))for(let r of Object.getOwnPropertyNames(t)){let a=n.safeParse(r);a.success||o.issues.push({code:"invalid_key",origin:"record",issues:a.error.issues,input:r,path:[r],continue:!0})}}).pipe(e)}function bg(e,n){if(e!==!1)return e===void 0||e===!0?S.any():$e(e,n)}var Eb=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function _g(e,n){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return S.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(n.refs.has(t))return n.refs.get(t);if(n.processing.has(t))return S.lazy(()=>{if(!n.refs.has(t))throw new Error(`Circular reference not resolved: ${t}`);return n.refs.get(t)});n.processing.add(t);let r=Tb(t,n),a=$e(r,n);return n.refs.set(t,a),n.processing.delete(t),a}if(e.enum!==void 0){let t=e.enum;if(n.version==="openapi-3.0"&&e.nullable===!0&&t.length===1&&t[0]===null)return S.null();if(t.length===0)return S.never();if(t.length===1)return S.literal(t[0]);if(t.every(a=>typeof a=="string"))return S.enum(t);let r=t.map(a=>S.literal(a));return r.length<2?r[0]:S.union([r[0],r[1],...r.slice(2)])}if(e.const!==void 0)return S.literal(e.const);let i=e.type;if(Array.isArray(i)){let t=i.map(r=>{let a={...e,type:r};return _g(a,n)});return t.length===0?S.never():t.length===1?t[0]:S.union(t)}if(!i)return S.any();let o;switch(i){case"string":{let t=S.string();if(e.format){let r=e.format;r==="email"?t=t.check(S.email()):r==="uri"||r==="uri-reference"?t=t.check(S.url()):r==="uuid"||r==="guid"?t=t.check(S.uuid()):r==="date-time"?t=t.check(S.iso.datetime({offset:!0})):r==="date"?t=t.check(S.iso.date()):r==="time"?t=t.check(S.regex(Eb)):r==="duration"?t=t.check(S.iso.duration()):r==="hostname"?t=t.check(S.hostname()):r==="ipv4"?t=t.check(S.ipv4()):r==="ipv6"?t=t.check(S.ipv6()):r==="mac"?t=t.check(S.mac()):r==="cidr"?t=t.check(S.cidrv4()):r==="cidr-v6"?t=t.check(S.cidrv6()):r==="base64"?t=t.check(S.base64()):r==="base64url"?t=t.check(S.base64url()):r==="e164"?t=t.check(S.e164()):r==="credit_card"?t=t.check(S.creditCard()):r==="jwt"?t=t.check(S.jwt()):r==="emoji"?t=t.check(S.emoji()):r==="nanoid"?t=t.check(S.nanoid()):r==="cuid"?t=t.check(S.cuid()):r==="cuid2"?t=t.check(S.cuid2()):r==="ulid"?t=t.check(S.ulid()):r==="xid"?t=t.check(S.xid()):r==="ksuid"&&(t=t.check(S.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"?S.number().int():S.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=S.boolean();break}case"null":{o=S.null();break}case"object":{let t={},r=e.properties||{},a=new Set(e.required||[]),c=typeof e.additionalProperties=="object"?$e(e.additionalProperties,n):void 0;for(let[s,u]of Object.entries(r)){let l=$e(u,n);ee(t,s,a.has(s)?l:l.optional())}if(e.patternProperties){let s=e.patternProperties,u=Object.keys(s),l=[];for(let f of u){let m=$e(s[f],n),v=S.string().regex(new RegExp(f));l.push(S.looseRecord(v,m))}let d=[];if(Object.keys(t).length>0&&d.push(S.object(t).passthrough()),d.push(...l),d.length===0)o=S.object({}).passthrough();else if(d.length===1)o=d[0];else{let f=S.intersection(d[0],d[1]);for(let m=2;m<d.length;m++)f=S.intersection(f,d[m]);o=f}if(e.additionalProperties===!1){let f=Object.keys(t),m=u.map(y=>new RegExp(y)),v=o;o=o.check(y=>{if(!ze(y.value))return;let x=[];for(let I of Object.keys(y.value))f.includes(I)||m.some(h=>h.test(I))||x.push(I);x.length&&y.issues.push({code:"unrecognized_keys",keys:x,input:y.value,inst:v})})}}else{let s=S.object(t);e.additionalProperties===!1?o=s.strict():c?o=s.catchall(c):o=s.passthrough()}if(e.propertyNames!==void 0&&e.propertyNames!==!0){let s=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;o=Ab(o,$e(s,n))}break}case"array":{let t=e.prefixItems,r=e.items;if(t&&Array.isArray(t)){let a=typeof e.minItems=="number"?e.minItems:0,c=t.map(d=>$e(d,n)),s=yg(c,a),u=Array.isArray(r)?void 0:bg(r,n),l=S.tuple(s);o=u?l.rest(u):l,typeof e.minItems=="number"&&(o=o.check(S.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(S.maxLength(e.maxItems)))}else if(Array.isArray(r)){let a=typeof e.minItems=="number"?e.minItems:0,c=r.map(d=>$e(d,n)),s=yg(c,a),u=bg(e.additionalItems,n),l=S.tuple(s);o=u?l.rest(u):l,typeof e.minItems=="number"&&(o=o.check(S.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(S.maxLength(e.maxItems)))}else if(r!==void 0){let a=$e(r,n),c=S.array(a);typeof e.minItems=="number"&&(c=c.min(e.minItems)),typeof e.maxItems=="number"&&(c=c.max(e.maxItems)),o=c}else o=S.array(S.any());break}default:throw new Error(`Unsupported type: ${i}`)}return o}function $e(e,n){if(typeof e=="boolean")return e?S.any():S.never();let i=_g(e,n),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let c=e.anyOf.map(u=>$e(u,n)),s=S.union(c);i=o?S.intersection(i,s):s}if(e.oneOf&&Array.isArray(e.oneOf)){let c=e.oneOf.map(u=>$e(u,n)),s=S.xor(c);i=o?S.intersection(i,s):s}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)i=o?i:S.any();else{let c=o?i:$e(e.allOf[0],n),s=o?0:1;for(let u=s;u<e.allOf.length;u++)c=S.intersection(c,$e(e.allOf[u],n));i=c}e.nullable===!0&&n.version==="openapi-3.0"&&(i=S.nullable(i)),e.readOnly===!0&&(i=S.readonly(i)),e.default!==void 0&&(i=i.default(e.default));let t={},r=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let c of r)c in e&&(t[c]=e[c]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let c of a)c in e&&(t[c]=e[c]);e.propertyNames!==void 0&&e.type==="object"&&e.$ref===void 0&&(t.propertyNames=e.propertyNames);for(let c of Object.keys(e))jb.has(c)||ee(t,c,e[c]);return Object.keys(t).length>0&&n.registry.add(i,t),e.description&&(i=i.describe(e.description)),i}function xg(e,n){if(typeof e=="boolean")return e?S.any():S.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=Nb(i,n?.defaultTarget),t=i.$defs||i.definitions||{},r={version:o,defs:t,refs:new Map,processing:new Set,rootSchema:i,registry:n?.registry??oe};return $e(i,r)}var kg=Symbol("z.visit/resolving");function fr(e,n){let i=typeof n=="function"?n:(a,c)=>{let s=n[a._zod.def.type];return s?s(a,c):a},o=new Map;function t(a){let c=o.get(a);if(c===kg)return new Fn({type:"lazy",getter:()=>o.get(a)});if(c!==void 0)return c;o.set(a,kg);let s=r(a),u=i(s,s!==a);return o.set(a,u),u}function r(a){let c=a._zod.def,s=c.type;switch(s){case"object":{let u=c.shape,l=Object.keys(u),d=!1,f={};for(let v of l){let y=t(u[v]);y!==u[v]&&(d=!0),f[v]=y}let m=c.catchall;return c.catchall&&(m=t(c.catchall),m!==c.catchall&&(d=!0)),d?B(a,{...c,shape:f,catchall:m}):a}case"array":{let u=t(c.element);return u===c.element?a:B(a,{...c,element:u})}case"tuple":{let u=c.items,l=!1,d=[];for(let m of u){let v=t(m);v!==m&&(l=!0),d.push(v)}let f=c.rest;return c.rest&&(f=t(c.rest),f!==c.rest&&(l=!0)),l?B(a,{...c,items:d,rest:f}):a}case"record":case"map":{let u=t(c.keyType),l=t(c.valueType);return u===c.keyType&&l===c.valueType?a:B(a,{...c,keyType:u,valueType:l})}case"set":{let u=t(c.valueType);return u===c.valueType?a:B(a,{...c,valueType:u})}case"union":{let u=c.options,l=!1,d=[];for(let f of u){let m=t(f);m!==f&&(l=!0),d.push(m)}return l?B(a,{...c,options:d}):a}case"intersection":{let u=t(c.left),l=t(c.right);return u===c.left&&l===c.right?a:B(a,{...c,left:u,right:l})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let u=t(c.innerType);return u===c.innerType?a:B(a,{...c,innerType:u})}case"pipe":{let u=t(c.in),l=t(c.out);return u===c.in&&l===c.out?a:B(a,{...c,in:u,out:l})}case"function":{let u=t(c.input),l=t(c.output);return u===c.input&&l===c.output?a:B(a,{...c,input:u,output:l})}case"lazy":{let u=c.getter,{_cachedInner:l,...d}=c;return B(a,{...d,getter:()=>t(u())})}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 wg(e){return fr(e,{object:n=>n.partial(),union:n=>{let i=n._zod.def;return i.discriminator===void 0?n:ln(i.options)}})}function Cb(e,n){if(!n?.length)return e;let i=e._zod.def;return B(e,Ae(i,{checks:[...i.checks??[],...n]}),{parent:!0})}function Ig(e){return Cb(e.out,e.checks)}function Zb(e){return e.in._zod.traits.has("$ZodTransform")?Ig(e):e.in}function Sg(e){return fr(e,{pipe:n=>Zb(n._zod.def),default:(n,i)=>i?wt(n._zod.def.innerType):n,catch:(n,i)=>i?n._zod.def.innerType:n})}function zg(e){return fr(e,{pipe:n=>Ig(n._zod.def),prefault:(n,i)=>i?n._zod.def.innerType:n})}var Sd={};Ve(Sd,{bigint:()=>Rb,boolean:()=>Mb,date:()=>Fb,number:()=>Lb,string:()=>Vb});function Vb(e){return Ys(on,e)}function Lb(e){return ru(cn,e)}function Mb(e){return lu(sn,e)}function Rb(e){return fu(un,e)}function Fb(e){return ku(rr,e)}var zt={maxBatchEvents:1e3,maxProjectIdLength:128,maxSessionIdLength:128,maxSdkVersionLength:64,maxUrlLength:2048,maxTitleLength:512,maxReferrerLength:2048,maxLanguageLength:35,maxMeshNameLength:256,maxAssetNameLength:1024,maxCustomNameLength:128,maxCustomPropValueLength:1024,maxCustomPropEntries:64,maxUserIdLength:128,maxUserTraitValueLength:1024,maxUserTraitEntries:64,maxSceneDescriptionLength:256,maxCameraNameLength:128,maxSceneProxyMeshNameLength:256,maxSceneProxyMeshPathLength:512,maxSceneProxyMeshes:1e4,maxNodeIdLength:128,maxBoneIdLength:128,maxChildPathLength:512,maxGraphicsDiagnosticMessageLength:1024,maxGraphicsDiagnosticCodeLength:64};var jo=C.tuple([C.number(),C.number(),C.number()]),zd=C.tuple([C.number(),C.number(),C.number(),C.number()]),Jb=C.tuple([C.number(),C.number()]),Gb=C.tuple([C.number().min(0).max(1),C.number().min(0).max(1)]),Pd=C.number().int().nonnegative(),fn=C.string().regex(/^[A-Za-z0-9._:-]{1,64}$/,"sceneId must be 1-64 chars of [A-Za-z0-9._:-]");var Dd=C.enum(["left","right"]),No=C.enum(["y","z"]),lI=C.object({handedness:Dd,upAxis:No.default("y"),unitScale:C.number().positive().default(1)}).passthrough();var Od=C.tuple([C.number(),C.number(),C.number(),C.number(),C.number(),C.number()]),Pg=C.literal("aabb"),Dg=C.object({position:jo,rotation:zd,scale:jo}),Og=C.object({name:C.string().max(zt.maxSceneProxyMeshNameLength),aabb:Od,triangles:C.number().int().nonnegative().optional(),path:C.string().min(1).max(zt.maxSceneProxyMeshPathLength).optional(),world:Dg.optional()}),mr=1,jd=C.object({version:C.literal(mr),sceneId:fn,kind:Pg,bounds:Od,upAxis:No,handedness:Dd.optional(),unitScale:C.number().positive(),meshes:C.array(Og).max(zt.maxSceneProxyMeshes),meshCount:C.number().int().nonnegative(),contentHash:C.string().min(1),capturedAt:Pd,sdkVersion:C.string().min(1)});var Uo=class{maxSize;items=[];constructor(n){this.maxSize=n}get size(){return this.items.length}enqueue(n){this.items.push(n),this.items.length>this.maxSize&&this.items.splice(0,this.items.length-this.maxSize)}drain(){let n=this.items;return this.items=[],n}prepend(n){this.items=[...n,...this.items],this.items.length>this.maxSize&&this.items.splice(0,this.items.length-this.maxSize)}};function Ng(){let e=globalThis.crypto;return e&&typeof e.randomUUID=="function"?e.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function Ug(e){let n=e.replace(/\/$/,"")+"/api/v1/collect";return{async send(i){let o=JSON.stringify(i),t=globalThis.navigator;if(t&&typeof t.sendBeacon=="function"){let a=new Blob([o],{type:"application/json"});return t.sendBeacon(n,a)}let r=globalThis.fetch;if(typeof r!="function")return!1;try{return(await r(n,{method:"POST",headers:{"content-type":"application/json"},body:o,keepalive:o.length<64e3})).ok}catch{return!1}}}}var Xb={};function Tg(e){return{process:n=>e.send(n),processUnload:n=>e.send(n),dispose:()=>{}}}var Bb="/api/v1/collect";function Wb(e){return e.replace(/\/$/,"")+Bb}function Kb(e){let n=new Set,i=[];for(let o of e.events)for(let t of Object.values(o)){let r;t instanceof ArrayBuffer?r=t:ArrayBuffer.isView(t)&&(r=t.buffer),r&&!n.has(r)&&(n.add(r),i.push(r))}return i}function Nd(){return new Worker(new URL("./offloadWorker.js",Xb.url),{type:"module"})}function Ag(e){let n=e.workerFactory??Nd,i;try{i=n()}catch{return null}let o=1,t=!1,r=new Map,a=c=>{for(let s of r.values())s(c);r.clear()};i.addEventListener("message",c=>{let s=c.data;if(!s||s.type!=="result")return;let u=r.get(s.id);u&&(r.delete(s.id),u(s.ok))}),i.addEventListener("error",()=>{a(!1)});try{i.postMessage({type:"init",url:Wb(e.endpoint)})}catch{return i.terminate?.(),null}return{process(c){if(t)return Promise.resolve(!1);let s=o++;return new Promise(u=>{r.set(s,u);try{i.postMessage({type:"batch",id:s,batch:c},Kb(c))}catch{r.delete(s),u(!1)}})},processUnload:c=>e.unloadTransport.send(c),dispose:()=>{t||(t=!0,a(!1),i.terminate?.())}}}var To={orbitDeg:1,rollDeg:1,zoom:.02,pan:.005},qb=180/Math.PI;function mn(e,n){return[e[0]-n[0],e[1]-n[1],e[2]-n[2]]}function Ie(e,n){return e[0]*n[0]+e[1]*n[1]+e[2]*n[2]}function gn(e){return Math.hypot(e[0],e[1],e[2])}function pn(e){let n=gn(e);return n>1e-9?[e[0]/n,e[1]/n,e[2]/n]:[0,0,0]}function Cg(e,n){let i=gn(e),o=gn(n);if(i<1e-9||o<1e-9)return 0;let t=Math.min(1,Math.max(-1,Ie(e,n)/(i*o)));return Math.acos(t)*qb}function Eg(e,n){let i=e.position,o=pn(e.forward),t=n.position,r=pn(n.forward),a=mn(i,t),c=Ie(o,o),s=Ie(o,r),u=Ie(r,r),l=Ie(o,a),d=Ie(r,a),f=c*u-s*s;if(f<1e-4)return null;let m=(s*d-u*l)/f,v=(c*d-s*l)/f;if(m<=0||v<=0)return null;let y=[i[0]+m*o[0],i[1]+m*o[1],i[2]+m*o[2]],x=[t[0]+v*r[0],t[1]+v*r[1],t[2]+v*r[2]];return{pivot:[(y[0]+x[0])/2,(y[1]+x[1])/2,(y[2]+x[2])/2],distance:(m+v)/2}}function Hb(e,n){if(!e.up||!n.up)return 0;let i=pn([e.forward[0]+n.forward[0],e.forward[1]+n.forward[1],e.forward[2]+n.forward[2]]);if(gn(i)<1e-6)return 0;let o=pn(mn(e.up,[i[0]*Ie(e.up,i),i[1]*Ie(e.up,i),i[2]*Ie(e.up,i)])),t=pn(mn(n.up,[i[0]*Ie(n.up,i),i[1]*Ie(n.up,i),i[2]*Ie(n.up,i)]));return Cg(o,t)}function Zg(e,n,i={}){let o=i.sensitivity&&i.sensitivity>0?i.sensitivity:1,t={orbitDeg:(i.thresholds?.orbitDeg??To.orbitDeg)*o,rollDeg:(i.thresholds?.rollDeg??To.rollDeg)*o,zoom:(i.thresholds?.zoom??To.zoom)*o,pan:(i.thresholds?.pan??To.pan)*o},r=e.pivot&&e.distance!==void 0?{pivot:e.pivot,distance:e.distance,explicit:!0}:null,a=r?null:Eg(e,n),c=r??(a?{...a,explicit:!1}:null),s=Cg(e.forward,n.forward),u=Hb(e,n),l,d=!1;e.fov!==void 0&&n.fov!==void 0&&n.fov>1e-6?l=e.fov/n.fov:r&&e.distance!==void 0&&n.distance!==void 0&&n.distance>1e-6&&(l=e.distance/n.distance,d=!0);let f=mn(n.position,e.position),m,v=!1;if(c){let U=r?n.pivot??c.pivot:Eg(n,e)?.pivot??c.pivot,j=mn(U,c.pivot),O=pn(e.forward),Y=Ie(j,O),ce=mn(j,[O[0]*Y,O[1]*Y,O[2]*Y]);m=gn(ce)}else m=gn(f),v=m>0;let y=c&&c.distance>1e-6?c.distance:i.sceneRadius&&i.sceneRadius>1e-6?i.sceneRadius:void 0,x=y?m/y:m,I=l!==void 0?Math.abs(l-1):0,h=[];if(s>t.orbitDeg&&h.push({kind:"orbit",ratio:s/t.orbitDeg}),u>t.rollDeg&&h.push({kind:"roll",ratio:u/t.rollDeg}),I>t.zoom&&h.push({kind:d?"dolly":"zoom",ratio:I/t.zoom}),x>t.pan&&h.push({kind:v?"fly":"pan",ratio:x/t.pan}),h.length===0)return null;h.sort((U,j)=>j.ratio-U.ratio);let A={kind:h[0].kind};return s>t.orbitDeg&&(A.orbitDeg=s),u>t.rollDeg&&(A.rollDeg=u),I>t.zoom&&l!==void 0&&(A.zoomRatio=l),x>t.pan&&(A.panDist=x),A}function Vg(e){let n=[e[12]??0,e[13]??0,e[14]??0],i=Math.hypot(e[0],e[1],e[2]),o=Math.hypot(e[4],e[5],e[6]),t=Math.hypot(e[8],e[9],e[10]);e[0]*(e[5]*e[10]-e[6]*e[9])-e[4]*(e[1]*e[10]-e[2]*e[9])+e[8]*(e[1]*e[6]-e[2]*e[5])<0&&(i=-i);let a=i!==0?1/i:0,c=o!==0?1/o:0,s=t!==0?1/t:0,u=e[0]*a,l=e[1]*a,d=e[2]*a,f=e[4]*c,m=e[5]*c,v=e[6]*c,y=e[8]*s,x=e[9]*s,I=e[10]*s,h=u+m+I,P,A,U,j;if(h>0){let O=.5/Math.sqrt(h+1);j=.25/O,P=(v-x)*O,A=(y-d)*O,U=(l-f)*O}else if(u>m&&u>I){let O=2*Math.sqrt(1+u-m-I);j=(v-x)/O,P=.25*O,A=(f+l)/O,U=(y+d)/O}else if(m>I){let O=2*Math.sqrt(1+m-u-I);j=(y-d)/O,P=(f+l)/O,A=.25*O,U=(x+v)/O}else{let O=2*Math.sqrt(1+I-u-m);j=(l-f)/O,P=(y+d)/O,A=(x+v)/O,U=.25*O}return{position:n,rotation:[P,A,U,j],scale:[i,o,t]}}function pr(e,n){if(e.length===0)return 0;let i=Math.ceil(n/100*e.length),o=Math.min(e.length,Math.max(1,i))-1;return e[o]??0}function Lg(e,n){return[e[0]-n[0],e[1]-n[1],e[2]-n[2]]}function Mg(e,n){return e[0]*n[0]+e[1]*n[1]+e[2]*n[2]}function Ao(e){return Math.hypot(e[0],e[1],e[2])}function Ud(e){return e<0?0:e>1?1:e}function Eo(e,n,i,o,t,r,a){let c=Lg(t,e),s=Ao(c)||1e-6,l=Mg(c,n)/(s*i)>=a,d=Math.atan2(r,s),f=Ud(d/(o||1e-6));return{centered:l,frac:f}}function Co(e,n,i){for(let o=0;o<6;o++)if(Math.abs((e[o]??0)-(n[o]??0))>i)return!1;return!0}function Zo(e){return[Math.round(e[0]*1e3)/1e3,Math.round(e[1]*1e3)/1e3,Math.round(e[2]*1e3)/1e3,Math.round(e[3]*1e3)/1e3,Math.round(e[4]*1e3)/1e3,Math.round(e[5]*1e3)/1e3]}function Pt(e,n,i){return Math.abs(e[0]-n[0])<=i&&Math.abs(e[1]-n[1])<=i&&Math.abs(e[2]-n[2])<=i}function Vo(e,n,i){return!(!Pt(e.position,n.position,i)||!Pt(e.direction,n.direction,i)||e.target===void 0!=(n.target===void 0)||e.target&&n.target&&!Pt(e.target,n.target,i)||e.fov===void 0!=(n.fov===void 0)||e.fov!==void 0&&n.fov!==void 0&&Math.abs(e.fov-n.fov)>i||e.aspect===void 0!=(n.aspect===void 0)||e.aspect!==void 0&&n.aspect!==void 0&&Math.abs(e.aspect-n.aspect)>i||e.near===void 0!=(n.near===void 0)||e.near!==void 0&&n.near!==void 0&&Math.abs(e.near-n.near)>i)}function Lo(e,n,i){return!(!Pt(e.position,n.position,i)||Math.abs(e.rotation[0]-n.rotation[0])>i||Math.abs(e.rotation[1]-n.rotation[1])>i||Math.abs(e.rotation[2]-n.rotation[2])>i||Math.abs(e.rotation[3]-n.rotation[3])>i||e.scale===void 0!=(n.scale===void 0)||e.scale&&n.scale&&!Pt(e.scale,n.scale,i))}function Td(e){let n=e.emit,i,o=new Map,t=new Map,r=new Map;function a(l){let d=l.frameTimes,f;if(d.length>0){let y=0;for(let I=0;I<d.length;I++)d[I]>l.jankFrameMs&&y++;let x=Array.from(d).sort((I,h)=>I-h);f={frameTimeP95Ms:pr(x,95),frameTimeP99Ms:pr(x,99),longFrames:y}}let m=e.perf?.suppressIdle??!1,v=e.perf?.fpsThreshold??0;m&&i!==void 0&&Math.abs(l.fps-i)<=v||(i=l.fps,n({type:"frame_perf",fps:l.fps,...f??{},...typeof l.dpr=="number"&&l.dpr>0?{dpr:l.dpr}:{},...l.renderScale!==void 0?{renderScale:l.renderScale}:{},...l.position?{position:l.position}:{}}))}function c(l){let d=l.decomposed??Yb(l.matrix,l.scaleEps),f=l.boneId?`${l.nodeId}\0bone\0${l.boneId}`:l.childPath!==void 0?`${l.nodeId}\0${l.childPath}`:l.nodeId,m=e.node?.suppressIdle??!1,v=o.get(f);m&&v&&Lo(v,d,l.scaleEps)||(o.set(f,d),n({type:"node_transform",nodeId:l.nodeId,...l.childPath!==void 0?{childPath:l.childPath}:{},...l.boneId!==void 0?{boneId:l.boneId}:{},position:d.position,rotation:d.rotation,...d.scale?{scale:d.scale}:{}}))}function s(l){if(l.stepMs<=0)return;let d=e.visibility?.centeredCos??1,f=e.visibility?.boundingBox??!1,m=Ao(l.forward)||1,v=(l.fov||.8)/2;for(let y of l.meshes){let{centered:x,frac:I}=Eo(l.camPos,l.forward,m,v,y.center,y.radius,d),h=t.get(y.mesh);h||(h={visibleMs:0,centeredMs:0,maxScreenFraction:0},t.set(y.mesh,h)),h.visibleMs+=l.stepMs,x&&(h.centeredMs+=l.stepMs),I>h.maxScreenFraction&&(h.maxScreenFraction=I),f&&y.aabb&&(h.bounds=y.aabb)}}function u(){if(t.size===0)return;let l=e.visibility?.boundsEps??.001,d=t;t=new Map;for(let[f,m]of d){if(m.visibleMs<=0)continue;let v;if(m.bounds){let y=r.get(f);(!y||!Co(y,m.bounds,l))&&(v=Zo(m.bounds),r.set(f,m.bounds))}n({type:"mesh_visibility",mesh:f,visibleMs:Math.round(m.visibleMs),...m.centeredMs>0?{centeredMs:Math.round(m.centeredMs)}:{},...m.maxScreenFraction>0?{maxScreenFraction:Math.round(m.maxScreenFraction*1e4)/1e4}:{},...v?{bounds:v}:{}})}}return{ingest(l){switch(l.channel){case"camera":n({type:"camera_sample",position:l.position,direction:l.direction,...l.target?{target:l.target}:{},...l.fov!==void 0?{fov:l.fov}:{},...l.aspect!==void 0?{aspect:l.aspect}:{},...l.near!==void 0?{near:l.near}:{},...l.hitPoint?{hitPoint:l.hitPoint}:{},...l.hitMesh?{hitMesh:l.hitMesh}:{}});return;case"perf":a(l);return;case"node":c(l);return;case"visibilityTick":s(l);return;case"visibilityFlush":u();return;case"gesture":{let d=Zg(l.start,l.end,l.options??{});if(!d)return;n({type:"camera_gesture",kind:d.kind,durationMs:l.durationMs,...d.orbitDeg!==void 0?{orbitDeg:d.orbitDeg}:{},...d.rollDeg!==void 0?{rollDeg:d.rollDeg}:{},...d.zoomRatio!==void 0?{zoomRatio:d.zoomRatio}:{},...d.panDist!==void 0?{panDist:d.panDist}:{},...l.source?{source:l.source}:{}});return}case"hover":n({type:"hover_dwell",mesh:l.mesh,dwellMs:l.dwellMs,...l.source?{source:l.source}:{},...l.uv?{uv:l.uv}:{}});return}},reset(){i=void 0,o.clear(),t=new Map,r.clear()}}}function Yb(e,n){if(!e||e.length<16)return{position:[0,0,0],rotation:[0,0,0,1]};let i=Vg(e),o={position:i.position,rotation:i.rotation},[t,r,a]=i.scale;return(Math.abs(t-1)>n||Math.abs(r-1)>n||Math.abs(a-1)>n)&&(o.scale=i.scale),o}function Ad(e){return e.channel==="perf"?[e.frameTimes.buffer]:e.channel==="node"&&e.matrix?[e.matrix.buffer]:[]}function Rg(e){return{ingest:n=>e.ingest(n),drain:()=>Promise.resolve(),dispose:()=>{}}}function Fg(e){let n=e.workerFactory??Nd,i;try{i=n()}catch{return null}let o=!1,t=1,r=new Map;i.addEventListener("message",a=>{let c=a.data;if(c){if(c.type==="events")e.onEvents(c.events,c.capturedAt);else if(c.type==="unloadDone"){let s=r.get(c.id);s&&(r.delete(c.id),s())}}}),i.addEventListener("error",()=>{for(let a of r.values())a();r.clear()});try{i.postMessage({type:"aggInit",config:e.config})}catch{return i.terminate?.(),null}return{ingest(a,c){if(!o)try{i.postMessage({type:"snapshot",capturedAt:c,snapshot:a},Ad(a))}catch{}},drain(){if(o)return Promise.resolve();let a=t++;return new Promise(c=>{r.set(a,c);try{i.postMessage({type:"flushUnload",id:a})}catch{r.delete(a),c()}})},dispose(){if(!o){o=!0;for(let a of r.values())a();r.clear(),i.terminate?.()}}}}var gr="0.1.0";var Mo={batchSize:20,flushIntervalMs:5e3,maxQueueSize:1e3,resizeDebounceMs:250};function Qb(e){return{projectId:e.projectId,endpoint:e.endpoint,sdkVersion:e.sdkVersion??gr,batchSize:e.batchSize??Mo.batchSize,flushIntervalMs:e.flushIntervalMs??Mo.flushIntervalMs,maxQueueSize:e.maxQueueSize??Mo.maxQueueSize,offload:e.offload??"main",disabled:e.disabled??!1,captureLifecycle:e.captureLifecycle??!0,resizeDebounceMs:e.resizeDebounceMs??Mo.resizeDebounceMs,captureErrors:e.captureErrors??!1,captureGraphicsDiagnostics:e.captureGraphicsDiagnostics??!1,captureShaderSource:e.captureShaderSource??!1,debug:e.debug??!1}}var vr=class e{config;sessionId;queue;transport;processor;beforeSend;collectors=[];handles=[];aggSinks=[];customTransport;createWorkerFn;started=!1;startedAt=0;url;currentScene=Pr;pageMeta;flushTimer;resizeTimer;errorCount=0;lastErrorKey;positionProvider;boundVisibility=()=>this.onVisibilityChange();boundPageHide=()=>{this.stop("hidden")};boundFocus=()=>this.onFocusChange(!0);boundBlur=()=>this.onFocusChange(!1);boundResize=()=>this.onResize();boundError=n=>this.onErrorEvent(n);boundRejection=n=>this.onUnhandledRejection(n);constructor(n){this.config=Qb(n),this.sessionId=Ng(),this.queue=new Uo(this.config.maxQueueSize),this.transport=n.transport??Ug(this.config.endpoint),this.customTransport=n.transport,this.createWorkerFn=n.createWorker,this.processor=this.createProcessor(n),this.beforeSend=n.beforeSend}use(n){return this.collectors.push(n),this.started&&this.startCollector(n),this}start(n={}){if(!(this.started||this.config.disabled)){if(this.started=!0,this.startedAt=this.now(),this.url=n.url??this.defaultUrl(),this.pageMeta=n.pageMeta,n.sceneId!=null){let i=fn.safeParse(n.sceneId);i.success?this.currentScene=i.data:this.log(`ignoring invalid initial sceneId: ${String(n.sceneId)}`)}this.emit({type:"session_start",...n.device?{device:n.device}:{},...n.graphics?{graphics:n.graphics}:{},...n.scene?{scene:n.scene}:{},...n.connector?{connector:n.connector}:{},...n.user?{user:n.user}:{}}),this.config.flushIntervalMs>0&&(this.flushTimer=setInterval(()=>{this.flush()},this.config.flushIntervalMs)),this.bindLifecycle();for(let i of this.collectors)this.startCollector(i)}}setScene(n){if(this.config.disabled)return;let i=fn.safeParse(n);if(!i.success){this.log(`ignoring invalid sceneId: ${String(n)}`);return}i.data!==this.currentScene&&(this.currentScene=i.data,this.started&&this.emit({type:"scene_change"}))}setPositionProvider(n){this.positionProvider=n}emit(n){!this.started||this.config.disabled||this.emitInternal(n,this.now())}emitInternal(n,i){if(this.config.disabled)return;let o={...n,projectId:this.config.projectId,sessionId:this.sessionId,ts:i,sdkVersion:this.config.sdkVersion,...this.url?{url:this.url}:{},...this.currentScene!==Pr?{sceneId:this.currentScene}:{},...this.pageMeta?{pageMeta:this.pageMeta}:{}};this.enrichPosition(o);let t=this.beforeSend?this.beforeSend(o):o;t&&(this.queue.enqueue(t),this.queue.size>=this.config.batchSize&&this.flush())}enrichPosition(n){if(!(n.type!=="runtime_error"&&n.type!=="graphics_diagnostic")&&!(this.positionProvider===void 0||n.position))try{let i=this.positionProvider();i&&(n.position=i)}catch(i){this.log("positionProvider threw; emitting without position",i)}}track(n,i){this.emit({type:"custom",name:n,...i?{props:i}:{}})}trackInput(n,i={}){n&&this.emit({type:"input_action",action:n,source:i.source??"keyboard",...i.code?{code:i.code}:{},...typeof i.button=="number"?{button:i.button}:{},...typeof i.pressed=="boolean"?{pressed:i.pressed}:{},...i.handedness?{handedness:i.handedness}:{},...i.sourceId?{sourceId:i.sourceId}:{}})}reportCapabilityChange(n){n.kind&&this.emit({type:"capability_change",kind:n.kind,...n.from?{from:n.from}:{},...n.to?{to:n.to}:{},...n.reason?{reason:n.reason}:{},...typeof n.durationMs=="number"?{durationMs:n.durationMs}:{},...n.source?{source:n.source}:{},...n.handedness?{handedness:n.handedness}:{}})}async flush(n){let i=this.queue.drain();if(i.length===0)return;let o={schemaVersion:"1.0",events:i};await(n?.unload?this.processor.processUnload(o):this.processor.process(o))||(this.queue.prepend(i),this.log("flush failed; re-queued",i.length))}async stop(n="manual"){if(this.started){this.emit({type:"session_end",durationMs:this.now()-this.startedAt,reason:n}),this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.unbindLifecycle();for(let i of this.handles.splice(0))i.stop();this.aggSinks.length>0&&await Promise.all(this.aggSinks.map(i=>i.drain())),this.started=!1,await this.flush({unload:!0});for(let i of this.aggSinks.splice(0))i.dispose();this.processor.dispose()}}now(){return Date.now()}createProcessor(n){if(this.config.offload==="worker")if(n.transport)this.log("custom transport set; worker offload disabled (transport runs on main thread)");else{let i=Ag({endpoint:this.config.endpoint,unloadTransport:this.transport,...n.createWorker?{workerFactory:n.createWorker}:{}});if(i)return i;this.log("worker offload unavailable; falling back to main-thread processor")}return Tg(this.transport)}createAggregation(n){if(this.config.offload==="worker"&&!this.customTransport){let t=Fg({config:n,onEvents:(r,a)=>{for(let c of r)this.emitInternal(c,a)},...this.createWorkerFn?{workerFactory:this.createWorkerFn}:{}});if(t)return this.aggSinks.push(t),r=>t.ingest(r,this.now());this.log("worker aggregation unavailable; falling back to main-thread aggregator")}let i=Td({...n,emit:t=>this.emit(t)}),o=Rg(i);return this.aggSinks.push(o),t=>o.ingest(t,this.now())}startCollector(n){let i={config:this.config,sessionId:this.sessionId,emit:o=>this.emit(o),track:(o,t)=>this.track(o,t),trackInput:(o,t)=>this.trackInput(o,t),reportCapabilityChange:o=>this.reportCapabilityChange(o),setScene:o=>this.setScene(o),setPositionProvider:o=>this.setPositionProvider(o),createAggregation:o=>this.createAggregation(o),now:()=>this.now()};try{let o=n.start(i);o&&this.handles.push(o)}catch(o){this.log(`collector "${n.name}" failed to start`,o)}}onVisibilityChange(){let n=globalThis.document,i=n?.visibilityState==="hidden";this.config.captureLifecycle&&n&&this.emit({type:"visibility_change",state:i?"hidden":"visible"}),i&&this.flush({unload:!0})}onFocusChange(n){this.config.captureLifecycle&&this.emit({type:"focus_change",focused:n})}onResize(){this.config.captureLifecycle&&(this.resizeTimer&&clearTimeout(this.resizeTimer),this.resizeTimer=setTimeout(()=>{this.resizeTimer=void 0,this.emitViewportResize()},this.config.resizeDebounceMs))}emitViewportResize(){let n=globalThis;typeof n.innerWidth!="number"||typeof n.innerHeight!="number"||n.innerWidth<=0||n.innerHeight<=0||this.emit({type:"viewport_resize",width:n.innerWidth,height:n.innerHeight,...typeof n.devicePixelRatio=="number"?{dpr:n.devicePixelRatio}:{}})}static MAX_ERRORS_PER_SESSION=50;onErrorEvent(n){this.emitError({kind:"error",message:n.message||"Unknown error",...n.filename?{source:n.filename}:{},...typeof n.lineno=="number"?{lineno:n.lineno}:{},...typeof n.colno=="number"?{colno:n.colno}:{},...n.error instanceof Error&&n.error.stack?{stack:n.error.stack}:{}})}onUnhandledRejection(n){let i=n.reason,o=i instanceof Error?i.message:typeof i=="string"?i:"Unhandled promise rejection";this.emitError({kind:"unhandledrejection",message:o||"Unhandled promise rejection",...i instanceof Error&&i.stack?{stack:i.stack}:{}})}emitError(n){if(this.errorCount>=e.MAX_ERRORS_PER_SESSION)return;let i=`${n.message}\0${n.stack??""}`;i!==this.lastErrorKey&&(this.lastErrorKey=i,this.errorCount+=1,this.emit({type:"runtime_error",kind:n.kind,message:n.message.slice(0,1024),...n.source?{source:n.source.slice(0,1024)}:{},...typeof n.lineno=="number"?{lineno:n.lineno}:{},...typeof n.colno=="number"?{colno:n.colno}:{},...n.stack?{stack:n.stack.slice(0,4096)}:{}}))}bindLifecycle(){let n=globalThis.document,i=globalThis.addEventListener?globalThis:void 0;n?.addEventListener("visibilitychange",this.boundVisibility),i?.addEventListener("pagehide",this.boundPageHide),this.config.captureLifecycle&&i&&(i.addEventListener("focus",this.boundFocus),i.addEventListener("blur",this.boundBlur),i.addEventListener("resize",this.boundResize),this.emitViewportResize()),this.config.captureErrors&&i&&(i.addEventListener("error",this.boundError),i.addEventListener("unhandledrejection",this.boundRejection))}unbindLifecycle(){let n=globalThis.document,i=globalThis.removeEventListener?globalThis:void 0;n?.removeEventListener("visibilitychange",this.boundVisibility),i?.removeEventListener("pagehide",this.boundPageHide),i?.removeEventListener("focus",this.boundFocus),i?.removeEventListener("blur",this.boundBlur),i?.removeEventListener("resize",this.boundResize),i?.removeEventListener("error",this.boundError),i?.removeEventListener("unhandledrejection",this.boundRejection),this.resizeTimer&&(clearTimeout(this.resizeTimer),this.resizeTimer=void 0)}defaultUrl(){return globalThis.location?.href}log(...n){this.config.debug&&console.debug("[uptimizr]",...n)}};function Dt(e,n){return e===void 0?{mode:"interval",ms:n}:e==="frame"?{mode:"frame"}:e<=0?{mode:"off"}:{mode:"interval",ms:1e3/e}}function ae(e){return e===0?0:e}function Je(e,n){return n==="left"?[e[0],e[1],e[2]]:[ae(e[0]),ae(e[1]),ae(-e[2])]}function hr(e,n){return n==="left"?[e[0],e[1],e[2]]:[ae(e[0]),ae(e[1]),ae(-e[2])]}function Ed(e,n){return n==="left"?[e[0],e[1],e[2],e[3],e[4],e[5]]:[ae(e[0]),ae(e[1]),ae(-e[5]),ae(e[3]),ae(e[4]),ae(-e[2])]}function vn(e,n){return n==="left"?[e[0],e[1],e[2],e[3]]:[ae(-e[0]),ae(-e[1]),ae(e[2]),ae(e[3])]}function $r(e){return[e.x,e.y,e.z]}function yr(e){return e<0?0:e>1?1:e}var De=aa("playcanvas"),Jg="uptimizr-";function Ro(e,n){let i=new De.Ray,o=new De.Vec3,t=new De.Vec3,r=new De.Vec3,a=new De.Vec3;return(c,s)=>{let u=n.camera,l=u?.camera;if(!u||!l)return;let d=e.graphicsDevice,f=d?.canvas,m=f?.clientWidth||f?.width||d?.width||1,v=f?.clientHeight||f?.height||d?.height||1,y=(c+1)/2*m,x=(1-s)/2*v,I=u.nearClip??.1,h=u.farClip??1e3;l.screenToWorld(y,x,I,m,v,o),l.screenToWorld(y,x,h,m,v,t),i.origin.copy(o),i.direction.copy(t).sub(o).normalize();let P=1/0,A;if(e.root?.forEach?.(j=>{let O=j;if(O.enabled===!1)return;let Y=O.render?.meshInstances??O.model?.meshInstances;if(Y)for(let ce of Y){if(ce.visible===!1)continue;let se=ce.node?.name??"";if(se.startsWith(Jg))continue;let je=ce.aabb;if(!je||typeof je.intersectsRay!="function"||!je.intersectsRay(i,r))continue;let Se=r.x-i.origin.x,Ne=r.y-i.origin.y,Ue=r.z-i.origin.z,st=Se*Se+Ne*Ne+Ue*Ue;st<P&&(P=st,A=se,a.copy(r))}}),A!==void 0)return{point:[a.x,a.y,a.z],name:A}}}function Fo(e,n,i={}){let o=new De.Ray,t=new De.Vec3,r=new De.Vec3,a=new De.Vec3,c=new De.Vec3,s=i.maxDistance??1e3,u=s*s,l=i.meshes&&i.meshes.length>0?new Set(i.meshes):null,d=i.predicate;return()=>{let f=n.camera,m=f?.camera;if(!f||!m)return;let v=e.graphicsDevice,y=v?.canvas,x=y?.clientWidth||y?.width||v?.width||1,I=y?.clientHeight||y?.height||v?.height||1,h=x/2,P=I/2,A=f.nearClip??.1,U=f.farClip??1e3;m.screenToWorld(h,P,A,x,I,t),m.screenToWorld(h,P,U,x,I,r),o.origin.copy(t),o.direction.copy(r).sub(t).normalize();let j=1/0,O;if(e.root?.forEach?.(ce=>{let se=ce;if(se.enabled===!1)return;let je=se.render?.meshInstances??se.model?.meshInstances;if(je)for(let Se of je){if(Se.visible===!1)continue;let Ne=Se.node?.name??"";if(Ne.startsWith(Jg)||l&&!l.has(Ne)||d&&Se.node&&!d(Se.node))continue;let Ue=Se.aabb;if(!Ue||typeof Ue.intersectsRay!="function"||!Ue.intersectsRay(o,a))continue;let st=a.x-o.origin.x,hn=a.y-o.origin.y,ea=a.z-o.origin.z,br=st*st+hn*hn+ea*ea;br<j&&(j=br,O=Ne,c.copy(a))}}),!(O===void 0||j>u))return{point:[c.x,c.y,c.z],name:O}}}function Gg(e){let n=e.pointerType;return n==="mouse"||n==="pen"||n==="touch"?n:typeof n=="string"&&n.length>0?"other":void 0}function e_(e){if(typeof document>"u")return!1;let n=document.pointerLockElement;return n!=null&&n===e()}var t_=zt.maxAssetNameLength;function n_(e,n){return[e[0]-n[0],e[1]-n[1],e[2]-n[2]]}function r_(e,n){return e[0]*n[0]+e[1]*n[1]+e[2]*n[2]}function i_(e){return e!==null&&typeof e=="object"?e.hz:e}function o_(e){if(e===null||typeof e!="object")return null;let n=e.include;return n==="*"||Array.isArray(n)&&n.length>0?{include:n,maxDepth:e.maxDepth??8,maxNodes:e.maxNodes??64,exclude:new Set(e.exclude??[])}:null}function a_(e,n){let i=[],o=n.include==="*",t=o?null:new Set(n.include),r=[];for(let a of e.children??[])r.push({node:a,path:a.name??"",depth:1});for(;r.length>0&&i.length<n.maxNodes;){let{node:a,path:c,depth:s}=r.shift(),u=a.name;if(!(typeof u!="string"||u.length===0)&&!n.exclude.has(u)&&!Kg(a)&&((o||t.has(u))&&i.push({childPath:c,node:a}),s<n.maxDepth))for(let l of a.children??[]){let d=l.name??"";r.push({node:l,path:c?`${c}/${d}`:d,depth:s+1})}}return i}function Kg(e){return e.camera!=null}function Bg(e,n){let i=e.getPosition?.()??{x:0,y:0,z:0},o=e.getRotation?.()??{x:0,y:0,z:0,w:1},t={position:Je([i.x,i.y,i.z],"right"),rotation:vn([o.x,o.y,o.z,o.w],"right")},r=e.getWorldTransform?.()?.getScale?.();return r&&(Math.abs(r.x-1)>n||Math.abs(r.y-1)>n||Math.abs(r.z-1)>n)&&(t.scale=$r(r)),t}function Wg(e,n){return typeof n=="function"?n()??null:typeof n=="string"?e.findByName?.(n)??null:n??null}function c_(e){let n=new Set,i=[],o=[...e.render?.meshInstances??[],...e.model?.meshInstances??[]];for(let t of o){let r=t.skinInstance?.bones;if(r)for(let a of r){let c=a?.name;typeof c!="string"||n.has(c)||(n.add(c),i.push(a))}}return i}function s_(e,n){let i=c_(e);if(i.length===0)return[];if(n==="*")return i;let o=new Map;for(let r of i)typeof r.name=="string"&&o.set(r.name,r);let t=[];for(let r of n){let a=o.get(r);a&&t.push(a)}return t}function u_(e,n){if(!e.getLocalPosition||!e.getLocalRotation)return null;let i=e.getLocalPosition(),o=e.getLocalRotation(),t={position:Je([i.x,i.y,i.z],"right"),rotation:vn([o.x,o.y,o.z,o.w],"right")},r=e.getLocalScale?.();return r&&(Math.abs(r.x-1)>n||Math.abs(r.y-1)>n||Math.abs(r.z-1)>n)&&(t.scale=$r(r)),t}function Xg(e){return e.render?.meshInstances??e.model?.meshInstances??[]}function l_(e){let n=1/0,i=1/0,o=1/0,t=-1/0,r=-1/0,a=-1/0,c=!1;for(let s of Xg(e)){let u=s.aabb;if(!u||typeof u.getMin!="function"||typeof u.getMax!="function")continue;let l=u.getMin(),d=u.getMax();c=!0,l.x<n&&(n=l.x),l.y<i&&(i=l.y),l.z<o&&(o=l.z),d.x>t&&(t=d.x),d.y>r&&(r=d.y),d.z>a&&(a=d.z)}return c?{center:[(n+t)/2,(i+r)/2,(o+a)/2],radius:.5*Math.hypot(t-n,r-i,a-o),aabb:[n,i,o,t,r,a]}:null}function d_(e,n,i,o){return r_(n_(e,i),o)+n>0}function Jo(e){let{app:n,camera:i,sampleCameraMs:o=1e3,samplePerfMs:t=2e3,pointerMoveThrottleMs:r=250,suppressIdleSamples:a=!0,suppressIdlePerfSamples:c=!1,cameraEpsilon:s=.001,perfFpsThreshold:u=1,cameraGestureSensitivity:l=1,capture:d={},sampling:f={}}=e,m=Dt(f.camera,o),v=Dt(f.perf,t),y=Dt(f.pointerMove,r),x=e.keyBindings??{},I=Object.keys(x).length>0,h={camera:(d.camera??!0)&&m.mode!=="off",pointerMove:(d.pointerMove??!0)&&y.mode!=="off",clicks:d.clicks??!0,buttons:d.buttons??!0,cameraGesture:d.cameraGesture??!0,meshPicks:d.meshPicks??!0,perf:(d.perf??!0)&&v.mode!=="off",contextLoss:d.contextLoss??!0,assetLoad:d.assetLoad??!0,meshVisibility:d.meshVisibility??!1,hoverDwell:d.hoverDwell??!1,resourceSample:d.resourceSample??!1,gaze:(d.gaze??!1)&&(d.camera??!0)&&m.mode!=="off",nodes:d.nodes??!0,bones:d.bones??!0,keyboard:(d.keyboard??!0)&&I},P=e.actors??{},A=h.nodes?Object.keys(f.nodes??{}).filter(K=>{let ye=Object.prototype.hasOwnProperty.call(P,K);return ye||console.warn(`[uptimizr] sampling.nodes["${K}"] has no matching entry in \`actors\`; ignoring. Declare the node in \`actors\` to capture its transform.`),ye}):[],U=A.length>0,j=h.bones?Object.keys(f.bones??{}).filter(K=>{if(!Object.prototype.hasOwnProperty.call(P,K))return console.warn(`[uptimizr] sampling.bones["${K}"] has no matching entry in \`actors\`; ignoring. Declare the node in \`actors\` to capture its bones.`),!1;let be=f.bones[K].include;return be!=="*"&&(!Array.isArray(be)||be.length===0)?(console.warn(`[uptimizr] sampling.bones["${K}"].include is empty; ignoring. Provide bone names or "*" to capture bones.`),!1):!0}):[],O=j.length>0,Y=e.meshVisibility??{},ce=Y.windowMs??5e3,se=Y.meshes&&Y.meshes.length>0?new Set(Y.meshes):void 0,je=Math.cos((Y.centeredAngleDeg??12)*Math.PI/180),Se=Y.maxMeshes??50,Ne=Y.boundingBox??!1,Ue=e.hoverDwell??{},st=Ue.minDwellMs??500,hn=Ue.meshes&&Ue.meshes.length>0?new Set(Ue.meshes):void 0,br=(e.resourceSample??{}).intervalMs??15e3,Vd=y.mode==="interval"?y.ms:0;return{name:"playcanvas",start(K){let ye=n,Ld={perf:{suppressIdle:c,fpsThreshold:u},node:{suppressIdle:a},visibility:{centeredCos:je,boundingBox:Ne,boundsEps:.001}},be=K.createAggregation(Ld),$n=[],yn=[],_r=[],bn=[],xr=!1,Md=!1,kr=0,ta,na=null,ev=()=>ye.stats?.frame?.fps??0,ra=w=>{if(!w||typeof w.fov!="number")return;let D=w.fov*Math.PI/180;if(w.horizontalFov){let z=typeof w.aspectRatio=="number"&&w.aspectRatio>0?w.aspectRatio:1;return 2*Math.atan(Math.tan(D/2)/z)}return D},tv=h.gaze?e.gaze?.probe??Fo(n,i,e.gaze??{}):void 0,Rd=()=>{let w=i,D=w.getPosition(),z=w.forward,V=Je([D.x,D.y,D.z],"right"),G=hr([z.x,z.y,z.z],"right"),L=ra(w.camera),F={position:V,direction:G,...L!==void 0?{fov:L}:{}};if(a&&ta&&Vo(ta,F,s))return;ta=F;let J=tv?.(),te=J?Je(J.point,"right"):void 0,_e=J&&J.name?J.name:void 0;be({channel:"camera",position:F.position,direction:F.direction,...F.fov!==void 0?{fov:F.fov}:{},...te?{hitPoint:te}:{},..._e?{hitMesh:_e}:{}})},Fd=()=>{let w=i,D=w.getPosition(),z=w.forward,V=w.up,G={position:Je([D.x,D.y,D.z],"right"),forward:hr([z.x,z.y,z.z],"right"),up:hr([V.x,V.y,V.z],"right")},L=ra(w.camera);return L!==void 0&&(G.fov=L),G},nv=()=>{let w=ev();w<=0||be({channel:"perf",frameTimes:new Float32Array(0),fps:w,jankFrameMs:0})},Jd=()=>{if(!Md)for(let w of _r)w()},Gd=()=>{xr||(ye.on("frameend",Jd),xr=!0)},wr=(w,D)=>{w.mode==="interval"?$n.push(setInterval(D,w.ms)):w.mode==="frame"&&(_r.push(D),Gd())};if(h.camera&&(Rd(),wr(m,Rd)),h.perf&&wr(v,nv),U){let w=ye.root,D=new Set;for(let z of A){let V=P[z],G=f.nodes?.[z],L=Dt(i_(G),o);if(L.mode==="off")continue;let F=o_(G),J=()=>{let te=Wg(w,V);if(te){if(Kg(te)){D.has(z)||(D.add(z),console.warn(`[uptimizr] actor "${z}" resolves to a camera; refusing node_transform capture. The visitor camera is already captured as camera_sample.`));return}if(be({channel:"node",nodeId:z,decomposed:Bg(te,s),scaleEps:s}),F)for(let{childPath:_e,node:Ze}of a_(te,F))be({channel:"node",nodeId:z,childPath:_e,decomposed:Bg(Ze,s),scaleEps:s})}};J(),wr(L,J)}}if(O){let w=ye.root,D=new Set;for(let z of j){let V=P[z],G=f.bones[z],L=Dt(G.hz,o);if(L.mode==="off")continue;let F=()=>{let J=Wg(w,V);if(!J)return;let te=s_(J,G.include);if(te.length===0){D.has(z)||(D.add(z),console.warn(`[uptimizr] actor "${z}" resolves to no matching skeleton bones; skipping Tier 2 capture. Declare the skinned entity and check the bone names.`));return}for(let _e of te){let Ze=_e.name;if(typeof Ze!="string")continue;let kn=u_(_e,s);kn&&be({channel:"node",nodeId:z,boneId:Ze,decomposed:kn,scaleEps:s})}};F(),wr(L,F)}}if(h.meshVisibility){let w=K.now(),D=()=>{let V=K.now(),G=V-w;if(w=V,G<=0)return;let L=i,F=L.getPosition(),J=L.forward,te=[F.x,F.y,F.z],_e=[J.x,J.y,J.z],Ze=ra(L.camera)??0,kn=0,ia=[];ye.root?.forEach?.(uv=>{let Sr=uv;if(Xg(Sr).length===0)return;let zr=Sr.name;if(!zr||zr.startsWith("uptimizr-"))return;if(se){if(!se.has(zr))return}else if(Sr.enabled===!1||kn>=Se)return;let Te=l_(Sr);Te&&(kn++,d_(Te.center,Te.radius,te,_e)&&ia.push({mesh:zr,center:Te.center,radius:Te.radius,...Ne?{aabb:[Te.aabb[0],Te.aabb[1],-Te.aabb[5],Te.aabb[3],Te.aabb[4],-Te.aabb[2]]}:{}}))}),ia.length!==0&&be({channel:"visibilityTick",stepMs:G,camPos:te,forward:_e,fov:Ze,meshes:ia})},z=()=>be({channel:"visibilityFlush"});_r.push(D),Gd(),$n.push(setInterval(z,ce)),bn.push(z)}let rv=h.pointerMove||h.clicks||h.buttons||h.meshPicks||h.hoverDwell,We=ye.graphicsDevice?.canvas,Bd=rv&&We?e.raycast??Ro(n,i):void 0,Ke=(w,D)=>{We&&(We.addEventListener(w,D),yn.push({target:We,type:w,handler:D}))},iv=w=>{if(e_(()=>We))return[.5,.5];let D=We&&typeof We.getBoundingClientRect=="function"?We.getBoundingClientRect():{left:0,top:0,width:0,height:0},z=D.width||1,V=D.height||1;return[yr((w.clientX-D.left)/z),yr((w.clientY-D.top)/V)]},ov=w=>{if(!Bd)return;let D=w[0]*2-1,z=1-w[1]*2;return Bd(D,z)},_n=w=>{let D=iv(w),z=ov(D),V=z?Je(z.point,"right"):void 0,G=z?.name?z.name:void 0,L=Gg(w);return{screen:D,...V?{hitPoint:V}:{},...G?{hitMesh:G}:{},...L?{source:L}:{},...z?{hit:z}:{}}},ut,Wd=0,xn=!1,Ir,Kd=w=>{if(ut!==void 0&&!xn){let D=w-Wd;D>=st&&be({channel:"hover",mesh:ut,dwellMs:D,...Ir?{source:Ir}:{}})}ut=void 0,xn=!1,Ir=void 0},av=(w,D,z)=>{let V=D!==void 0&&(!hn||hn.has(D))?D:void 0;V!==ut&&(Kd(w),V!==void 0&&(ut=V,Wd=w,xn=!1,Ir=z))},cv=w=>{let D=w;if(h.hoverDwell){let J=_n(D);if(av(K.now(),J.hitMesh,J.source),h.pointerMove){let te=K.now();te-kr>=Vd&&(kr=te,K.emit({type:"pointer_move",screen:J.screen,...J.hitPoint?{hitPoint:J.hitPoint}:{},...J.hitMesh?{hitMesh:J.hitMesh}:{},...J.source?{source:J.source}:{}}))}return}if(!h.pointerMove)return;let z=K.now();if(z-kr<Vd)return;kr=z;let{screen:V,hitPoint:G,hitMesh:L,source:F}=_n(D);K.emit({type:"pointer_move",screen:V,...G?{hitPoint:G}:{},...L?{hitMesh:L}:{},...F?{source:F}:{}})},Xd=(w,D)=>{let z=D;if(w==="pointer_down"&&h.hoverDwell){let{hitMesh:J}=_n(z);J!==void 0&&J===ut&&(xn=!0)}if(!h.buttons)return;let{screen:V,hitPoint:G,hitMesh:L,source:F}=_n(z);K.emit({type:w,screen:V,...G?{hitPoint:G}:{},...L?{hitMesh:L}:{},...typeof z.button=="number"?{button:z.button}:{},...F?{source:F}:{}})},sv=w=>{let D=w,{screen:z,hitPoint:V,hitMesh:G,source:L,hit:F}=_n(D);h.hoverDwell&&G!==void 0&&G===ut&&(xn=!0),h.clicks&&K.emit({type:"pointer_click",screen:z,...V?{hitPoint:V}:{},...G?{hitMesh:G}:{},...typeof D.button=="number"?{button:D.button}:{},...L?{source:L}:{}}),h.meshPicks&&F&&K.emit({type:"mesh_interaction",mesh:F.name,kind:"pick",...V?{point:V}:{},...L?{source:L}:{}})};if((h.pointerMove||h.hoverDwell)&&Ke("pointermove",cv),(h.buttons||h.hoverDwell)&&Ke("pointerdown",w=>Xd("pointer_down",w)),h.buttons&&Ke("pointerup",w=>Xd("pointer_up",w)),(h.clicks||h.meshPicks||h.hoverDwell)&&Ke("click",sv),h.cameraGesture){let w=z=>{na={sample:Fd(),ts:K.now(),source:Gg(z)}},D=()=>{let z=na;na=null,z&&be({channel:"gesture",start:z.sample,end:Fd(),durationMs:Math.max(0,Math.round(K.now()-z.ts)),options:{sensitivity:l},...z.source?{source:z.source}:{}})};Ke("pointerdown",w),Ke("pointerup",D)}h.hoverDwell&&bn.push(()=>Kd(K.now())),h.contextLoss&&(Ke("webglcontextlost",()=>K.emit({type:"context_lost"})),Ke("webglcontextrestored",()=>K.emit({type:"context_restored"})));let lt=ye.assets;if(h.assetLoad&<){let w=new Map,D=L=>L.id??L,z=L=>{w.set(D(L),K.now())},V=L=>{let F=L,J=D(F),te=w.get(J);if(te===void 0)return;w.delete(J);let _e={type:"asset_load",name:(F.name??"asset").slice(0,t_),loadMs:Math.max(0,Math.round(K.now()-te))},Ze=F.file?.size;typeof Ze=="number"&&Ze>0&&(_e.bytes=Ze),K.emit(_e)},G=(...L)=>{let F=L[1];F&&w.delete(D(F))};lt.on("load:start",z),lt.on("load",V),lt.on("error",G),bn.push(()=>{lt.off("load:start",z),lt.off("load",V),lt.off("error",G),w.clear()})}if(h.resourceSample){let w=()=>{let D={},z=ye.stats?.frame?.triangles;typeof z=="number"&&z>0&&(D.triangles=Math.round(z));let V=globalThis.performance?.memory;V&&typeof V.usedJSHeapSize=="number"&&V.usedJSHeapSize>0&&(D.jsHeapBytes=V.usedJSHeapSize),Object.keys(D).length!==0&&K.emit({type:"resource_sample",...D})};$n.push(setInterval(w,br))}if(h.keyboard&&typeof window<"u"){let w=window,D=G=>L=>{let F=L,J=F.code;if(!J||G&&F.repeat)return;let te=x[J];te&&K.trackInput(te,{source:"keyboard",code:J,pressed:G})},z=D(!0),V=D(!1);w.addEventListener("keydown",z),w.addEventListener("keyup",V),yn.push({target:w,type:"keydown",handler:z}),yn.push({target:w,type:"keyup",handler:V})}return{stop(){for(let w of bn)w();bn.length=0,Md=!0;for(let w of $n)clearInterval(w);$n.length=0,xr&&(ye.off("frameend",Jd),xr=!1),_r.length=0;for(let w of yn)w.target.removeEventListener(w.type,w.handler);yn.length=0}}}}}function Go(e){return e.isWebGPU===!0}function qg(e){let n=e.maxTextureSize;return typeof n=="number"?n:void 0}function Bo(e){let n=e;return n.isWebGPU?!1:n.isWebGL2!==!1}function Wo(e){let i=e.gl;if(!i)return{};let o=i,t={};try{let r=typeof o.getExtension=="function"?o.getExtension("WEBGL_debug_renderer_info"):null,a=r?r.UNMASKED_VENDOR_WEBGL:o.VENDOR,c=r?r.UNMASKED_RENDERER_WEBGL:o.RENDERER,s=o.getParameter(a),u=o.getParameter(c),l=o.getParameter(o.VERSION);typeof s=="string"&&s&&(t.vendor=s),typeof u=="string"&&u&&(t.renderer=u),typeof l=="string"&&l&&(t.version=l)}catch{}return t}function Ko(e){let n=e.graphicsDevice,i=Wo(n),o=typeof navigator<"u"?navigator:void 0,r={engine:Go(n)?"webgpu":Bo(n)?"webgl2":"webgl"};i.vendor&&(r.vendor=i.vendor),i.renderer&&(r.renderer=i.renderer);let a=qg(n);return typeof a=="number"&&(r.maxTextureSize=a),typeof o?.hardwareConcurrency=="number"&&(r.hardwareConcurrency=o.hardwareConcurrency),typeof o?.deviceMemory=="number"&&(r.deviceMemoryGb=o.deviceMemory),o?.userAgent&&(r.isMobile=/Mobi|Android|iPhone|iPad/i.test(o.userAgent)),r}function f_(e){if(e){if(/Direct3D11|D3D11/i.test(e))return"d3d11";if(/Direct3D12|D3D12/i.test(e))return"d3d12";if(/Metal/i.test(e))return"metal";if(/Vulkan/i.test(e))return"vulkan";if(/OpenGL ES/i.test(e))return"opengles";if(/OpenGL/i.test(e))return"opengl"}}function Xo(e){let n=e.graphicsDevice,i=Go(n),o=Wo(n),a={api:i?"webgpu":Bo(n)?"webgl2":"webgl",shadingLanguage:i?"wgsl":"glsl-es"},c=i?void 0:f_(o.renderer);return c&&(a.backend=c),o.version&&(a.apiVersion=o.version),a}var qo=aa("playcanvas");function Ho(){let e={name:"playcanvas",coordinateSystem:{handedness:"right",upAxis:"y",unitScale:1}};return typeof qo.version=="string"&&qo.version&&(e.version=qo.version),e}var Yo=aa("playcanvas");function Cd(e){let i=e?.camera?.projection;return i===Yo.PROJECTION_PERSPECTIVE?"free":i===Yo.PROJECTION_ORTHOGRAPHIC?"static":"other"}function Qo(e,n){let i={},o=n;o&&(i.cameraType=Cd(n),typeof o.name=="string"&&o.name&&(i.cameraName=o.name));let t=e.root;if(t&&typeof t.forEach=="function"){let r=0;t.forEach(a=>{let c=a,s=c.render?.meshInstances?.length??0,u=c.model?.meshInstances?.length??0;r+=s+u}),i.meshCount=r}return i}function Hg(e,n,i){let o=new vr({projectId:i.projectId,endpoint:i.endpoint,flushIntervalMs:i.flushIntervalMs,transport:i.transport,disabled:i.disabled,debug:i.debug});o.use(Jo({app:e,camera:n,sampleCameraMs:i.sampleCameraMs,samplePerfMs:i.samplePerfMs,pointerMoveThrottleMs:i.pointerMoveThrottleMs,suppressIdleSamples:i.suppressIdleSamples,suppressIdlePerfSamples:i.suppressIdlePerfSamples,cameraEpsilon:i.cameraEpsilon,perfFpsThreshold:i.perfFpsThreshold,capture:i.capture,...i.gaze?{gaze:i.gaze}:{},...i.sampling?{sampling:i.sampling}:{},...i.actors?{actors:i.actors}:{},...i.keyBindings?{keyBindings:i.keyBindings}:{}}));let t={...Qo(e,n),...i.sceneDescription?{description:i.sceneDescription}:{},...i.cameraType?{cameraType:i.cameraType}:{}};return o.start({device:Ko(e),graphics:Xo(e),connector:Ho(),scene:t,...i.user?{user:i.user}:{},...i.meta}),o}function m_(e,n){let i=[],o=e;for(;o&&o!==n;){let t=typeof o.name=="string"?o.name:"";if(!t)return;i.unshift(t),o=o.parent}return i.length>0?i.join("/"):void 0}function p_(e){let n=e.getPosition?.(),i=e.getRotation?.(),o=e.getWorldTransform?.()?.getScale?.();if(!(!n||!i||!o))return{position:Je([n.x,n.y,n.z],"right"),rotation:vn([i.x,i.y,i.z,i.w??1],"right"),scale:[o.x,o.y,o.z]}}var g_="uptimizr-";function Oe(e){return Math.round(e*1e4)/1e4}function v_(e){let n=2166136261;for(let i=0;i<e.length;i++)n^=e.charCodeAt(i),n=Math.imul(n,16777619);return(n>>>0).toString(16).padStart(8,"0")}function Yg(e){return Math.abs((e[3]-e[0])*(e[4]-e[1])*(e[5]-e[2]))}function Zd(e){return e.render?.meshInstances??e.model?.meshInstances??[]}function h_(e){let i=Zd(e);if(i.length===0)return;let o=1/0,t=1/0,r=1/0,a=-1/0,c=-1/0,s=-1/0,u=!1;for(let l of i){let d=l.aabb;if(!d||typeof d.getMin!="function"||typeof d.getMax!="function")continue;let f=d.getMin(),m=d.getMax();u=!0,f.x<o&&(o=f.x),f.y<t&&(t=f.y),f.z<r&&(r=f.z),m.x>a&&(a=m.x),m.y>c&&(c=m.y),m.z>s&&(s=m.z)}if(u)return[o,t,r,a,c,s]}function $_(e){let n=e,i=0;for(let o of Zd(n)){let t=o.mesh?.primitive;if(t)for(let r of t)typeof r.count=="number"&&r.count>0&&(i+=Math.floor(r.count/3))}return i}function Qg(e,n){let i=n.boundsOf??h_,o=n.trianglesOf??$_,t=[],r=1/0,a=1/0,c=1/0,s=-1/0,u=-1/0,l=-1/0,d=0,f=e.root;f&&typeof f.forEach=="function"&&f.forEach(I=>{let h=I;if(h.enabled===!1||Zd(h).length===0)return;let P=typeof h.name=="string"?h.name:"";if(P.startsWith(g_)||n.includeMesh&&!n.includeMesh(P))return;let A=i(h);if(!A)return;let U=Ed(A,"right");d++;let j=[Oe(U[0]),Oe(U[1]),Oe(U[2]),Oe(U[3]),Oe(U[4]),Oe(U[5])],O={name:P,aabb:j},Y=o(h);Y>0&&(O.triangles=Y);let ce=m_(h,f),se=p_(h);ce&&se&&(O.path=ce,O.world=se),t.push(O),r=Math.min(r,U[0]),a=Math.min(a,U[1]),c=Math.min(c,U[2]),s=Math.max(s,U[3]),u=Math.max(u,U[4]),l=Math.max(l,U[5])});let m=t;typeof n.maxMeshes=="number"&&n.maxMeshes>=0&&t.length>n.maxMeshes&&(m=[...t].sort((I,h)=>Yg(h.aabb)-Yg(I.aabb)).slice(0,n.maxMeshes));let v=d===0?[0,0,0,0,0,0]:[Oe(r),Oe(a),Oe(c),Oe(s),Oe(u),Oe(l)],y=JSON.stringify({v:mr,kind:"aabb",bounds:v,meshes:[...m].sort((I,h)=>I.name<h.name?-1:I.name>h.name?1:0).map(I=>I.path&&I.world?[I.name,I.aabb,I.path,I.world.position,I.world.rotation,I.world.scale]:[I.name,I.aabb])}),x={version:mr,sceneId:n.sceneId,kind:"aabb",bounds:v,upAxis:n.upAxis??"y",handedness:"right",unitScale:n.unitScale??1,meshes:m,meshCount:d,contentHash:v_(y),capturedAt:(n.now??Date.now)(),sdkVersion:n.sdkVersion??gr};return jd.parse(x)}return pv(y_);})();
|
|
58
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let c=a[1];if(n===a[0]){r(a);continue}if(e.external){let u=e.external.registry.get(a[0])?.id;if(n!==a[0]&&u){r(a);continue}}if(e.metadataRegistry.get(a[0])?.id){r(a);continue}if(c.cycle){r(a);continue}if(c.count>1&&e.reused==="ref"){r(a);continue}}e.external&&(e.sharedDefsExtractedFor=e.external)}function Hm(e){let n=e.anyOf;if(!Array.isArray(n)||n.length===0||e.type!==void 0)return;let i=[];for(let o of n){if(!o||typeof o!="object")return;Hm(o);let t=Object.keys(o);if(t.length!==1||t[0]!=="type")return;let r=o.type;for(let a of Array.isArray(r)?r:[r]){if(typeof a!="string")return;i.includes(a)||i.push(a)}}delete e.anyOf,e.type=i.length===1?i[0]:i}var Ym=new Set(["type","properties","required","additionalProperties"]),Xm=["oneOf","anyOf"];function qm(e){let n=e.additionalProperties;return n===void 0||n===!1||typeof n!="object"||n===null?null:Object.keys(n).length?n:null}function Uu(e){let n=[];for(let r of e){if(typeof r!="object"||r.type!=="object")return null;for(let a in r)if(!Ym.has(a))return null;n.push(r)}let i={},o=new Set;for(let r of n){for(let a in r.properties){if(Object.prototype.hasOwnProperty.call(i,a))continue;let c=[];for(let u of n){let l=u.properties?.[a]??qm(u);l!=null&&(c.some(d=>JSON.stringify(d)===JSON.stringify(l))||c.push(l))}let s=c.length===1?c[0]:Uu(c)??{allOf:c};ee(i,a,s)}for(let a of r.required??[])o.add(a)}let t={type:"object",properties:i};if(o.size&&(t.required=[...o]),n.every(r=>r.additionalProperties===!1))t.additionalProperties=!1;else{let r=[];for(let a of n){let c=qm(a);c&&!r.some(s=>JSON.stringify(s)===JSON.stringify(c))&&r.push(c)}r.length===1?t.additionalProperties=r[0]:r.length>1&&(t.additionalProperties={allOf:r})}return t}function hb(e){let n=e.allOf;if(!Array.isArray(n)||n.length<2)return;for(let t of Ym)if(t in e)return;let i=n.filter(t=>Xm.some(r=>Array.isArray(t[r]))),o=null;if(!i.length)o=Uu(n);else{let t=i[0],r=Xm.find(s=>Array.isArray(t[s]));if(Object.keys(t).length!==1)return;let a=n.filter(s=>s!==t),c=t[r].map(s=>Uu([...a,s]));if(c.some(s=>!s))return;o={[r]:c}}o&&(delete e.allOf,Yn(e,o))}function rt(e,n){let i=e.seen.get(n);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=c=>{let s=e.seen.get(c);if(s.ref===null)return;let u=s.def??s.schema,l={...u},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")?(u.allOf=u.allOf??[],u.allOf.push(v)):Yn(u,v),Yn(u,l),c._zod.parent===d)for(let x in u)x==="$ref"||x==="allOf"||x in l||delete u[x];if(v.$ref&&m.def)for(let x in u)x==="$ref"||x==="allOf"||x in m.def&&JSON.stringify(u[x])===JSON.stringify(m.def[x])&&delete u[x]}let f=c._zod.parent;if(f&&f!==d){o(f);let m=e.seen.get(f);if(m?.schema.$ref&&(u.$ref=m.schema.$ref,m.def))for(let v in u)v==="$ref"||v==="allOf"||v in m.def&&JSON.stringify(u[v])===JSON.stringify(m.def[v])&&delete u[v]}e.override({zodSchema:c,jsonSchema:u,path:s.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let c of[...e.seen.entries()].reverse())o(c[0]);if(e.target!=="openapi-3.0")for(let c of e.seen.entries())Hm(c[1].def??c[1].schema);for(let c of e.deferred)c();if(e.intersections.length){let c=new Map;for(let s of e.seen.values())for(let u of[s.schema,s.def]){let l=u?.allOf;if(!Array.isArray(l))continue;let d=c.get(l);d?d.push(u):c.set(l,[u])}for(let s of e.intersections)for(let u of c.get(s)??[])hb(u)}}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 c=e.external.registry.get(n)?.id;if(!c)throw new Error("Schema is missing an `id` property");t.$id=e.external.uri(c)}Yn(t,i.defId?i.schema:i.def??i.schema);let r=e.metadataRegistry.get(n)?.id;r!==void 0&&t.id===r&&delete t.id;let a=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let c of e.seen.entries()){let s=c[1];s.def&&s.defId&&(s.def.id===s.defId&&delete s.def.id,ee(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 c=JSON.parse(JSON.stringify(t));return Object.defineProperty(c,"~standard",{value:{...n["~standard"],jsonSchema:{input:tn(n,"input",e.processors),output:tn(n,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function de(e,n){let i=n??{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 de(o.element,i);if(o.type==="set")return de(o.valueType,i);if(o.type==="lazy")return de(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 de(o.innerType,i);if(o.type==="intersection")return de(o.left,i)||de(o.right,i);if(o.type==="record"||o.type==="map")return de(o.keyType,i)||de(o.valueType,i);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:de(o.in,i)||de(o.out,i);if(o.type==="object"){for(let t in o.shape)if(de(o.shape[t],i))return!0;return!1}if(o.type==="union"){for(let t of o.options)if(de(t,i))return!0;return!1}if(o.type==="tuple"){for(let t of o.items)if(de(t,i))return!0;return!!(o.rest&&de(o.rest,i))}return!1}var Tu=(e,n={})=>i=>{let o=tt({...i,processors:n});return W(e,o),nt(o,e),rt(o,e)},tn=(e,n,i={})=>o=>{let{libraryOptions:t,target:r}=o??{},a=tt({...t??{},target:r,io:n,processors:i});return W(e,a),nt(a,e),rt(a,e)};var $b={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Cu=(e,n,i,o)=>{let t=i;t.type="string";let{minimum:r,maximum:a,format:c,patterns:s,contentEncoding:u,laxFormat:l}=e._zod.bag;if(typeof r=="number"&&(t.minLength=r),typeof a=="number"&&(t.maxLength=a),c&&(t.format=$b[c]??c,t.format===""&&delete t.format,(c==="time"||l)&&delete t.format),u&&(t.contentEncoding=u),s&&s.size>0){let d=[...s];d.length===1?t.pattern=d[0].source:d.length>1&&(t.allOf=[...d.map(f=>({...n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},Zu=(e,n,i,o)=>{let t=i,{minimum:r,maximum:a,format:c,multipleOf:s,exclusiveMaximum:u,exclusiveMinimum:l}=e._zod.bag;typeof c=="string"&&c.includes("int")?t.type="integer":t.type="number";let d=typeof l=="number"&&l>=(r??Number.NEGATIVE_INFINITY),f=typeof u=="number"&&u<=(a??Number.POSITIVE_INFINITY),m=n.target==="draft-04"||n.target==="openapi-3.0";d?m?(t.minimum=l,t.exclusiveMinimum=!0):t.exclusiveMinimum=l:typeof r=="number"&&(t.minimum=r),f?m?(t.maximum=u,t.exclusiveMaximum=!0):t.exclusiveMaximum=u:typeof a=="number"&&(t.maximum=a),typeof s=="number"&&(Number.isFinite(s)&&s!==0?t.multipleOf=Math.abs(s):re(e,n,t,o,`A multipleOf divisor of ${s} cannot be represented in JSON Schema`))},Vu=(e,n,i,o)=>{i.type="boolean"},Lu=(e,n,i,o)=>{re(e,n,i,o,"BigInt cannot be represented in JSON Schema")},Mu=(e,n,i,o)=>{re(e,n,i,o,"Symbols cannot be represented in JSON Schema")},Ru=(e,n,i,o)=>{n.target==="openapi-3.0"?(i.type="string",i.nullable=!0,i.enum=[null]):i.type="null"},Fu=(e,n,i,o)=>{re(e,n,i,o,"Undefined cannot be represented in JSON Schema")},Ju=(e,n,i,o)=>{re(e,n,i,o,"Void cannot be represented in JSON Schema")},Gu=(e,n,i,o)=>{i.not={}},Bu=(e,n,i,o)=>{},Wu=(e,n,i,o)=>{},Ku=(e,n,i,o)=>{re(e,n,i,o,"Date cannot be represented in JSON Schema")},Xu=(e,n,i,o)=>{let t=e._zod.def,r=In(t.entries);if(r.length===0){i.not={};return}r.every(a=>typeof a=="number")&&(i.type="number"),r.every(a=>typeof a=="string")&&(i.type="string"),i.enum=r},qu=(e,n,i,o)=>{let t=e._zod.def;if(t.values.length===0){i.not={};return}let r=[];for(let a of t.values)if(a===void 0){if(re(e,n,i,o,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof a=="bigint"){if(re(e,n,i,o,"BigInt literals cannot be represented in JSON Schema"))return;r.push(Number(a))}else r.push(a);if(r.length!==0)if(r.length===1){let a=r[0];i.type=a===null?"null":typeof a,n.target==="draft-04"||n.target==="openapi-3.0"?i.enum=[a]:i.const=a}else r.every(a=>typeof a=="number")&&(i.type="number"),r.every(a=>typeof a=="string")&&(i.type="string"),r.every(a=>typeof a=="boolean")&&(i.type="boolean"),r.every(a=>a===null)&&(i.type="null"),i.enum=r},Hu=(e,n,i,o)=>{re(e,n,i,o,"NaN cannot be represented in JSON Schema")},Yu=(e,n,i,o)=>{let t=i,r=e._zod.pattern;if(!r)throw new Error("Pattern not found in template literal");t.type="string",t.pattern=r.source},Qu=(e,n,i,o)=>{let t=i,r={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:c,mime:s}=e._zod.bag;a!==void 0&&(r.minLength=a),c!==void 0&&(r.maxLength=c),s?s.length===1?(r.contentMediaType=s[0],Object.assign(t,r)):(Object.assign(t,r),t.anyOf=s.map(u=>({contentMediaType:u}))):Object.assign(t,r)},el=(e,n,i,o)=>{i.type="boolean"},tl=(e,n,i,o)=>{re(e,n,i,o,"Custom types cannot be represented in JSON Schema")},nl=(e,n,i,o)=>{re(e,n,i,o,"Function types cannot be represented in JSON Schema")},rl=(e,n,i,o)=>{re(e,n,i,o,"Transforms cannot be represented in JSON Schema")},il=(e,n,i,o)=>{re(e,n,i,o,"Map cannot be represented in JSON Schema")},ol=(e,n,i,o)=>{re(e,n,i,o,"Set cannot be represented in JSON Schema")},al=(e,n,i,o)=>{let t=i,r=e._zod.def,{minimum:a,maximum:c}=e._zod.bag;typeof a=="number"&&(t.minItems=a),typeof c=="number"&&(t.maxItems=c),t.type="array",t.items=W(r.element,n,{...o,path:[...o.path,"items"]})};function Qn(e){let n=e._zod.def;return n.type==="pipe"&&n.in._zod.traits.has("$ZodTransform")?Qn(n.out):n.type==="catch"?Qn(n.innerType):e._zod.optin}var cl=(e,n,i,o)=>{let t=i,r=e._zod.def,a=r.shape;if(Object.getOwnPropertySymbols(a).length&&re(e,n,t,o,"Symbol keys cannot be represented in JSON Schema"))return;t.type="object",t.properties={};for(let l in a)ee(t.properties,l,W(a[l],n,{...o,path:[...o.path,"properties",l]}));let s=new Set(Object.keys(a)),u=new Set([...s].filter(l=>{let d=r.shape[l];return n.io==="input"?Qn(d)===void 0:d._zod.optout===void 0}));u.size>0&&(t.required=Array.from(u)),r.catchall?._zod.def.type==="never"?t.additionalProperties=!1:r.catchall?r.catchall&&(t.additionalProperties=W(r.catchall,n,{...o,path:[...o.path,"additionalProperties"]})):n.io==="output"&&(t.additionalProperties=!1)},Yi=(e,n,i,o)=>{let t=e._zod.def,r=t.inclusive===!1,a=t.options.map((c,s)=>W(c,n,{...o,path:[...o.path,r?"oneOf":"anyOf",s]}));r?i.oneOf=a:i.anyOf=a},sl=(e,n,i,o)=>{let t=e._zod.def,r=W(t.left,n,{...o,path:[...o.path,"allOf",0]}),a=W(t.right,n,{...o,path:[...o.path,"allOf",1]}),c=u=>"allOf"in u&&Object.keys(u).length===1,s=[...c(r)?r.allOf:[r],...c(a)?a.allOf:[a]];i.allOf=s,n.intersections.push(s)},ul=(e,n,i,o)=>{let t=i,r=e._zod.def;t.type="array";let a=n.target==="draft-2020-12"?"prefixItems":"items",c=n.target==="draft-2020-12"||n.target==="openapi-3.0"?"items":"additionalItems",s=r.items.map((y,x)=>W(y,n,{...o,path:[...o.path,a,x]})),u=r.rest?W(r.rest,n,{...o,path:[...o.path,c,...n.target==="openapi-3.0"?[r.items.length]:[]]}):null,l=r.items.length;for(;l>0;){let y=r.items[l-1];if(!(n.io==="input"?Qn(y)!==void 0:y._zod.optout==="optional"))break;l--}let d=r.items.length,f=!r.rest;n.target==="draft-2020-12"?(t.prefixItems=s,f?t.items=!1:u&&(t.items=u),l>0&&(t.minItems=l),f&&(t.maxItems=d)):n.target==="openapi-3.0"?(t.items={anyOf:s},u&&t.items.anyOf.push(u),l>0&&(t.minItems=l),f&&(t.maxItems=d)):(t.items=s,f?t.additionalItems=!1:u&&(t.additionalItems=u),l>0&&(t.minItems=l),f&&(t.maxItems=d));let{minimum:m,maximum:v}=e._zod.bag;typeof m=="number"&&(t.minItems=m),typeof v=="number"&&(t.maxItems=v)};function Au(e,n,i){if(n.$ref){if(i.has(n))return n;i.add(n);let v=e.get(n)?.def;if(!v)return n;let y=Au(e,v,i);return y===v?n:y}for(let v of["anyOf","oneOf"]){let y=n[v];if(!Array.isArray(y))continue;let x=y.map(I=>Au(e,I,i));x.some((I,h)=>I!==y[h])&&(n={...n,[v]:x})}let o=Array.isArray(n.type)?n.type:[n.type],t=!o.includes("string")&&o.some(v=>v==="number"||v==="integer"),r=n.enum??(n.const!==void 0?[n.const]:void 0);if(!t&&!r?.some(v=>typeof v=="number"))return n;let{minimum:a,maximum:c,exclusiveMinimum:s,exclusiveMaximum:u,multipleOf:l,format:d,id:f,...m}=n;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",r||(m.pattern=(o.includes("number")?Ye:An).source)),m}var Eu=new WeakMap;function yb(e){let n=new Map;for(let o of e.seen.values())o.def&&!n.has(o.schema)&&n.set(o.schema,o);let i=new Map;for(let o of Eu.get(e)??[]){let t=e.seen.get(o),r=(t?.def??t?.schema)?.propertyNames;if(!r||r===!0||i.has(r))continue;let a=Au(n,r,new Set);a!==r&&i.set(r,a)}if(i.size)for(let o of e.seen.values())for(let t of[o.schema,o.def]){let r=t&&i.get(t.propertyNames);r&&(t.propertyNames=r)}}var ll=(e,n,i,o)=>{let t=i,r=e._zod.def;t.type="object";let a=r.keyType,s=a._zod.bag?.patterns;if(r.mode==="loose"&&s&&s.size>0){let d=W(r.valueType,n,{...o,path:[...o.path,"patternProperties","*"]});t.patternProperties={};for(let f of s)ee(t.patternProperties,f.source,d)}else{if(n.target==="draft-07"||n.target==="draft-2020-12"){t.propertyNames=W(r.keyType,n,{...o,path:[...o.path,"propertyNames"]});let d=Eu.get(n);d||(d=[],Eu.set(n,d),n.deferred.push(()=>yb(n))),d.push(e)}t.additionalProperties=W(r.valueType,n,{...o,path:[...o.path,"additionalProperties"]})}let u=a._zod.values,l=n.io==="input"&&Qn(r.valueType)!==void 0;if(u&&!r.partial&&!l){let d=[...u].filter(f=>typeof f=="string"||typeof f=="number");d.length>0&&(t.required=d.map(String))}},dl=(e,n,i,o)=>{let t=e._zod.def,r=W(t.innerType,n,o),a=n.seen.get(e);n.target==="openapi-3.0"?(a.ref=t.innerType,i.nullable=!0):i.anyOf=[r,{type:"null"}]},fl=(e,n,i,o)=>{let t=e._zod.def;W(t.innerType,n,o);let r=n.seen.get(e);r.ref=t.innerType},ml=Symbol();function Qm(e,n,i,o,t){let r=!1,a=JSON.stringify(e,(c,s)=>typeof s!="bigint"?s:(r=!0,null));return r?(re(n,i,o,t,"BigInt defaults cannot be represented in JSON Schema"),ml):JSON.parse(a)}var pl=(e,n,i,o)=>{let t=e._zod.def;W(t.innerType,n,o);let r=n.seen.get(e);r.ref=t.innerType;let a=Qm(t.defaultValue,e,n,i,o);a!==ml&&(i.default=a)},gl=(e,n,i,o)=>{let t=e._zod.def;W(t.innerType,n,o);let r=n.seen.get(e);if(r.ref=t.innerType,n.io!=="input")return;let a=Qm(t.defaultValue,e,n,i,o);a!==ml&&(i._prefault=a)},vl=(e,n,i,o)=>{let t=e._zod.def;W(t.innerType,n,o);let r=n.seen.get(e);r.ref=t.innerType;let a;try{a=t.catchValue(void 0)}catch{re(e,n,i,o,"Dynamic catch values are not supported in JSON Schema");return}i.default=a},hl=(e,n,i,o)=>{let t=e._zod.def,r=t.in._zod.traits.has("$ZodTransform"),a=n.io==="input"?r?t.out:t.in:t.out;W(a,n,o);let c=n.seen.get(e);c.ref=a},$l=(e,n,i,o)=>{let t=e._zod.def;W(t.innerType,n,o);let r=n.seen.get(e);r.ref=t.innerType,i.readOnly=!0},yl=(e,n,i,o)=>{let t=e._zod.def;W(t.innerType,n,o);let r=n.seen.get(e);r.ref=t.innerType},Qi=(e,n,i,o)=>{let t=e._zod.def;W(t.innerType,n,o);let r=n.seen.get(e);r.ref=t.innerType},bl=(e,n,i,o)=>{let t=e._zod.innerType;W(t,n,o);let r=n.seen.get(e);r.ref=t},Hi={string:Cu,number:Zu,boolean:Vu,bigint:Lu,symbol:Mu,null:Ru,undefined:Fu,void:Ju,never:Gu,any:Bu,unknown:Wu,date:Ku,enum:Xu,literal:qu,nan:Hu,template_literal:Yu,file:Qu,success:el,custom:tl,function:nl,transform:rl,map:il,set:ol,array:al,object:cl,union:Yi,intersection:sl,tuple:ul,record:ll,nullable:dl,nonoptional:fl,default:pl,prefault:gl,catch:vl,pipe:hl,readonly:$l,promise:yl,optional:Qi,lazy:bl};function eo(e,n){if("_idmap"in e){let o=e,t=tt({...n,processors:Hi}),r={};for(let s of o._idmap.entries()){let[u,l]=s;W(l,t)}let a={},c={registry:o,uri:n?.uri,defs:r};t.external=c;for(let s of o._idmap.entries()){let[u,l]=s;nt(t,l),ee(a,u,rt(t,l))}if(Object.keys(r).length>0){let s=t.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[s]:r}}return{schemas:a}}let i=tt({...n,processors:Hi});return W(e,i),nt(i,e),rt(i,e)}var to=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(n){this.ctx.counter=n}get seen(){return this.ctx.seen}constructor(n){let i=n?.target??"draft-2020-12";i==="draft-4"&&(i="draft-04"),i==="draft-7"&&(i="draft-07"),this.ctx=tt({processors:Hi,target:i,...n?.metadata&&{metadata:n.metadata},...n?.unrepresentable&&{unrepresentable:n.unrepresentable},...n?.override&&{override:n.override},...n?.io&&{io:n.io}})}process(n,i={path:[],schemaPath:[]}){return W(n,this.ctx,i)}emit(n,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,nt(this.ctx,n);let o=rt(this.ctx,n),{"~standard":t,...r}=o;return r}};var ep={};var dn={};Ve(dn,{ZodAny:()=>Ml,ZodArray:()=>Gl,ZodBase64:()=>_o,ZodBase64URL:()=>xo,ZodBigInt:()=>un,ZodBigIntFormat:()=>Io,ZodBoolean:()=>sn,ZodCIDRv4:()=>yo,ZodCIDRv6:()=>bo,ZodCUID:()=>fo,ZodCUID2:()=>mo,ZodCatch:()=>fd,ZodCodec:()=>ur,ZodCreditCard:()=>Tl,ZodCustom:()=>lr,ZodCustomStringFormat:()=>an,ZodDate:()=>rr,ZodDefault:()=>ad,ZodDiscriminatedUnion:()=>Wl,ZodE164:()=>ko,ZodEmail:()=>co,ZodEmoji:()=>uo,ZodEnum:()=>rn,ZodExactOptional:()=>Do,ZodFile:()=>nd,ZodFunction:()=>xd,ZodGUID:()=>so,ZodIPv4:()=>ho,ZodIPv6:()=>$o,ZodISODate:()=>ot,ZodISODateTime:()=>it,ZodISODuration:()=>ct,ZodISOTime:()=>at,ZodIntersection:()=>Kl,ZodJWT:()=>wo,ZodKSUID:()=>vo,ZodLazy:()=>yd,ZodLiteral:()=>td,ZodMAC:()=>Ul,ZodMap:()=>Ql,ZodNaN:()=>pd,ZodNanoID:()=>lo,ZodNever:()=>Fl,ZodNonOptional:()=>Oo,ZodNull:()=>Vl,ZodNullable:()=>od,ZodNumber:()=>cn,ZodNumberFormat:()=>St,ZodObject:()=>or,ZodOptional:()=>cr,ZodPipe:()=>sr,ZodPrefault:()=>sd,ZodPreprocess:()=>gd,ZodPromise:()=>_d,ZodReadonly:()=>vd,ZodRecord:()=>nn,ZodSet:()=>ed,ZodString:()=>on,ZodStringFormat:()=>q,ZodSuccess:()=>dd,ZodSymbol:()=>Cl,ZodTemplateLiteral:()=>$d,ZodTransform:()=>rd,ZodTuple:()=>ql,ZodType:()=>Z,ZodULID:()=>po,ZodURL:()=>nr,ZodUUID:()=>Fe,ZodUndefined:()=>Zl,ZodUnion:()=>ar,ZodUnknown:()=>Rl,ZodVoid:()=>Jl,ZodXID:()=>go,ZodXor:()=>Bl,_ZodString:()=>ao,_default:()=>cd,_function:()=>lg,any:()=>Mp,array:()=>ir,base64:()=>kp,base64url:()=>wp,bigint:()=>Ep,boolean:()=>El,catch:()=>md,check:()=>dg,cidrv4:()=>_p,cidrv6:()=>xp,codec:()=>ag,creditCard:()=>Sp,cuid:()=>mp,cuid2:()=>pp,custom:()=>fg,date:()=>Fp,describe:()=>mg,discriminatedUnion:()=>Xp,e164:()=>Ip,email:()=>rp,emoji:()=>dp,enum:()=>zo,exactOptional:()=>id,file:()=>ng,float32:()=>Np,float64:()=>Up,function:()=>lg,guid:()=>ip,hash:()=>jp,hex:()=>Op,hostname:()=>Dp,httpUrl:()=>lp,instanceof:()=>gg,int:()=>io,int32:()=>Tp,int64:()=>Cp,intersection:()=>Xl,invertCodec:()=>cg,ipv4:()=>$p,ipv6:()=>bp,json:()=>hg,jwt:()=>zp,keyof:()=>Jp,ksuid:()=>hp,lazy:()=>bd,literal:()=>tg,looseObject:()=>Wp,looseRecord:()=>Hp,mac:()=>yp,map:()=>Yp,meta:()=>pg,nan:()=>og,nanoid:()=>fp,nativeEnum:()=>eg,never:()=>So,nonoptional:()=>ld,null:()=>Ll,nullable:()=>tr,nullish:()=>rg,number:()=>Al,object:()=>Gp,optional:()=>wt,partialRecord:()=>qp,pipe:()=>oo,prefault:()=>ud,preprocess:()=>$g,promise:()=>ug,readonly:()=>hd,record:()=>Yl,refine:()=>kd,set:()=>Qp,strictObject:()=>Bp,string:()=>er,stringFormat:()=>Pp,stringbool:()=>vg,success:()=>ig,superRefine:()=>wd,symbol:()=>Vp,templateLiteral:()=>sg,transform:()=>Po,tuple:()=>Hl,uint32:()=>Ap,uint64:()=>Zp,ulid:()=>gp,undefined:()=>Lp,union:()=>ln,unknown:()=>kt,url:()=>up,uuid:()=>op,uuidv4:()=>ap,uuidv6:()=>cp,uuidv7:()=>sp,void:()=>Rp,xid:()=>vp,xor:()=>Kp});var no={};Ve(no,{endsWith:()=>Wt,gt:()=>Me,gte:()=>we,includes:()=>Gt,length:()=>xt,lowercase:()=>Ft,lt:()=>Le,lte:()=>ke,maxLength:()=>_t,maxSize:()=>et,mime:()=>Kt,minLength:()=>Ge,minSize:()=>Re,multipleOf:()=>Qe,negative:()=>Bi,nonnegative:()=>Ki,nonpositive:()=>Wi,normalize:()=>Xt,overwrite:()=>Ce,positive:()=>Gi,properties:()=>qi,property:()=>Xi,regex:()=>Rt,size:()=>bt,slugify:()=>Qt,startsWith:()=>Bt,toLowerCase:()=>Ht,toUpperCase:()=>Yt,trim:()=>qt,uppercase:()=>Jt});var tp=new WeakSet([Object.prototype,Error.prototype]);function ro(e,n,i){Object.defineProperty(e,n,{configurable:!0,enumerable:!1,get(){let o=i(this);return Object.defineProperty(this,n,{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,n,{value:o,configurable:!0,writable:!0})}})}var np=(e,n)=>{Nn.init(e,n),e.name="ZodError";let i=Object.getPrototypeOf(e);tp.has(i)||(tp.add(i),ro(i,"format",o=>t=>Tn(o,t)),ro(i,"flatten",o=>t=>Un(o,t)),ro(i,"addIssue",o=>t=>{o.issues.push(t),o.message=JSON.stringify(o.issues,Nt,2)}),ro(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}}))},_b=p("ZodError",np),he=p("ZodError",np,void 0,{Parent:Error});var _l=At(he),xl=Et(he),kl=Ct(he),wl=Zt(he),Il=Er(he),Sl=Cr(he),zl=Zr(he),Pl=Vr(he),Dl=Lr(he),Ol=Mr(he),jl=Rr(he),Nl=Fr(he);function kb(){ie.localeError||ne($i())}function It(){ie.memoizer||ne({memoizer:Jn()})}var Z=p("ZodType",(e,n)=>(kb(),E.init(e,n),e.def=n,e.type=n.type,e),{check(...e){let n=this.def;return this.clone(_.mergeDefs(n,{checks:[...n.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,n){return B(this,e,n)},brand(){return this},register(e,n){return e.add(this,n),this},refine(e,n){return this.check(kd(e,n))},superRefine(e,n){return this.check(wd(e,n))},overwrite(e){return this.check(Ce(e))},optional(){return wt(this)},exactOptional(){return id(this)},nullable(){return tr(this)},nullish(){return wt(tr(this))},nonoptional(e){return ld(this,e)},array(){return ir(this)},or(e){return ln([this,e])},and(e){return Xl(this,e)},transform(e){return oo(this,Po(e))},default(e){return cd(this,e)},prefault(e){return ud(this,e)},catch(e){return md(this,e)},pipe(e){return oo(this,e)},readonly(){return hd(this)},describe(e){let n=this.clone();return oe.add(n,{description:e}),n},meta(...e){if(e.length===0)return oe.get(this);let n=this.clone();return oe.add(n,e[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...n){return n.length===0?e(this):e(this,...n)},get"~standard"(){return _.hide(this,"~standard",{...ei(this),jsonSchema:{input:tn(this,"input"),output:tn(this,"output")}})},set"~standard"(e){_.own(this,"~standard",e)},parse:function e(n,i){return _l(this,n,i,{callee:e})},parseAsync:async function e(n,i){return await xl(this,n,i,{callee:e})},safeParse(e,n){return kl(this,e,n)},async safeParseAsync(e,n){return wl(this,e,n)},get spa(){return this?.safeParseAsync},set spa(e){_.own(this,"spa",e)},encode:function e(n,i){return Il(this,n,i,{callee:e})},decode:function e(n,i){return Sl(this,n,i,{callee:e})},encodeAsync:async function e(n,i){return await zl(this,n,i,{callee:e})},decodeAsync:async function e(n,i){return await Pl(this,n,i,{callee:e})},safeEncode(e,n){return Dl(this,e,n)},safeDecode(e,n){return Ol(this,e,n)},async safeEncodeAsync(e,n){return jl(this,e,n)},async safeDecodeAsync(e,n){return Nl(this,e,n)},toJSONSchema(e){return Tu(this,{})(e)},get description(){return oe.get(this)?.description},get _def(){return this._zod.def}}),ao=p("_ZodString",(e,n)=>{gt.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(o,t,r)=>Cu(e,o,t,r);let i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null},{regex(...e){return this.check(Rt(...e))},includes(...e){return this.check(Gt(...e))},startsWith(...e){return this.check(Bt(...e))},endsWith(...e){return this.check(Wt(...e))},min(...e){return this.check(Ge(...e))},max(...e){return this.check(_t(...e))},length(...e){return this.check(xt(...e))},nonempty(...e){return this.check(Ge(1,...e))},lowercase(e){return this.check(Ft(e))},uppercase(e){return this.check(Jt(e))},trim(){return this.check(qt())},normalize(...e){return this.check(Xt(...e))},toLowerCase(){return this.check(Ht())},toUpperCase(){return this.check(Yt())},slugify(){return this.check(Qt())}}),on=p("ZodString",(e,n)=>{gt.init(e,n),ao.init(e,n)},{email(e){return this.check(wi(co,e))},url(e){return this.check(Wn(nr,e))},jwt(e){return this.check(Ji(wo,e))},emoji(e){return this.check(Oi(uo,e))},guid(e){return this.check(Ii(so,e))},uuid(e){return this.check(Si(Fe,e))},uuidv4(e){return this.check(zi(Fe,e))},uuidv6(e){return this.check(Pi(Fe,e))},uuidv7(e){return this.check(Di(Fe,e))},nanoid(e){return this.check(ji(lo,e))},cuid(e){return this.check(Ni(fo,e))},cuid2(e){return this.check(Ui(mo,e))},ulid(e){return this.check(Ti(po,e))},base64(e){return this.check(Mi(_o,e))},base64url(e){return this.check(Ri(xo,e))},xid(e){return this.check(Ai(go,e))},ksuid(e){return this.check(Ei(vo,e))},ipv4(e){return this.check(Ci(ho,e))},ipv6(e){return this.check(Zi($o,e))},cidrv4(e){return this.check(Vi(yo,e))},cidrv6(e){return this.check(Li(bo,e))},e164(e){return this.check(Fi(ko,e))},datetime(e){return this.check(Kn(it,e))},date(e){return this.check(Xn(ot,e))},time(e){return this.check(qn(at,e))},duration(e){return this.check(Hn(ct,e))}});function er(e){return Hs(on,e)}var q=p("ZodStringFormat",(e,n)=>{X.init(e,n),ao.init(e,n)}),it=p("ZodISODateTime",(e,n)=>{Rc.init(e,n),q.init(e,n)}),ot=p("ZodISODate",(e,n)=>{Fc.init(e,n),q.init(e,n)}),at=p("ZodISOTime",(e,n)=>{Jc.init(e,n),q.init(e,n)}),ct=p("ZodISODuration",(e,n)=>{Gc.init(e,n),q.init(e,n)}),co=p("ZodEmail",(e,n)=>{jc.init(e,n),q.init(e,n)});function rp(e){return wi(co,e)}var so=p("ZodGUID",(e,n)=>{Dc.init(e,n),q.init(e,n)});function ip(e){return Ii(so,e)}var Fe=p("ZodUUID",(e,n)=>{Oc.init(e,n),q.init(e,n)});function op(e){return Si(Fe,e)}function ap(e){return zi(Fe,e)}function cp(e){return Pi(Fe,e)}function sp(e){return Di(Fe,e)}var nr=p("ZodURL",(e,n)=>{Tc.init(e,n),q.init(e,n)});function up(e){return Wn(nr,e)}function lp(e){return Wn(nr,{protocol:ue.httpProtocol,hostname:ue.domain,..._.normalizeParams(e)})}var uo=p("ZodEmoji",(e,n)=>{Ac.init(e,n),q.init(e,n)});function dp(e){return Oi(uo,e)}var lo=p("ZodNanoID",(e,n)=>{Ec.init(e,n),q.init(e,n)});function fp(e){return ji(lo,e)}var fo=p("ZodCUID",(e,n)=>{Cc.init(e,n),q.init(e,n)});function mp(e){return Ni(fo,e)}var mo=p("ZodCUID2",(e,n)=>{Zc.init(e,n),q.init(e,n)});function pp(e){return Ui(mo,e)}var po=p("ZodULID",(e,n)=>{Vc.init(e,n),q.init(e,n)});function gp(e){return Ti(po,e)}var go=p("ZodXID",(e,n)=>{Lc.init(e,n),q.init(e,n)});function vp(e){return Ai(go,e)}var vo=p("ZodKSUID",(e,n)=>{Mc.init(e,n),q.init(e,n)});function hp(e){return Ei(vo,e)}var ho=p("ZodIPv4",(e,n)=>{Bc.init(e,n),q.init(e,n)});function $p(e){return Ci(ho,e)}var Ul=p("ZodMAC",(e,n)=>{Kc.init(e,n),q.init(e,n)});function yp(e){return Qs(Ul,e)}var $o=p("ZodIPv6",(e,n)=>{Wc.init(e,n),q.init(e,n)});function bp(e){return Zi($o,e)}var yo=p("ZodCIDRv4",(e,n)=>{Xc.init(e,n),q.init(e,n)});function _p(e){return Vi(yo,e)}var bo=p("ZodCIDRv6",(e,n)=>{qc.init(e,n),q.init(e,n)});function xp(e){return Li(bo,e)}var _o=p("ZodBase64",(e,n)=>{Hc.init(e,n),q.init(e,n)});function kp(e){return Mi(_o,e)}var xo=p("ZodBase64URL",(e,n)=>{Yc.init(e,n),q.init(e,n)});function wp(e){return Ri(xo,e)}var ko=p("ZodE164",(e,n)=>{Qc.init(e,n),q.init(e,n)});function Ip(e){return Fi(ko,e)}var Tl=p("ZodCreditCard",(e,n)=>{es.init(e,n),q.init(e,n)});function Sp(e){return eu(Tl,e)}var wo=p("ZodJWT",(e,n)=>{ts.init(e,n),q.init(e,n)});function zp(e){return Ji(wo,e)}var an=p("ZodCustomStringFormat",(e,n)=>{ns.init(e,n),q.init(e,n)});function Pp(e,n,i={}){return en(an,e,n,i)}function Dp(e){return en(an,"hostname",ue.hostname,e)}function Op(e){return en(an,"hex",ue.hex,e)}function jp(e,n){let i=n?.enc??"hex",o=`${e}_${i}`,t=ue[o];if(!t)throw new Error(`Unrecognized hash format: ${o}`);return en(an,o,t,n)}var cn=p("ZodNumber",(e,n)=>{ui.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(o,t,r)=>Zu(e,o,t,r);let i=e._zod.bag;e.minValue=Math.max(i.minimum??Number.NEGATIVE_INFINITY,i.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(i.maximum??Number.POSITIVE_INFINITY,i.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(i.format??"").includes("int")||Number.isSafeInteger(i.multipleOf??.5),e.isFinite=!0,e.format=i.format??null},{gt(e,n){return this.check(Me(e,n))},gte(e,n){return this.check(we(e,n))},min(e,n){return this.check(we(e,n))},lt(e,n){return this.check(Le(e,n))},lte(e,n){return this.check(ke(e,n))},max(e,n){return this.check(ke(e,n))},int(e){return this.check(io(e))},safe(e){return this.check(io(e))},positive(e){return this.check(Me(0,e))},nonnegative(e){return this.check(we(0,e))},negative(e){return this.check(Le(0,e))},nonpositive(e){return this.check(ke(0,e))},multipleOf(e,n){return this.check(Qe(e,n))},step(e,n){return this.check(Qe(e,n))},finite(){return this}});function Al(e){return nu(cn,e)}var St=p("ZodNumberFormat",(e,n)=>{rs.init(e,n),cn.init(e,n)});function io(e){return iu(St,e)}function Np(e){return ou(St,e)}function Up(e){return au(St,e)}function Tp(e){return cu(St,e)}function Ap(e){return su(St,e)}var sn=p("ZodBoolean",(e,n)=>{Ln.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Vu(e,i,o,t)});function El(e){return uu(sn,e)}var un=p("ZodBigInt",(e,n)=>{li.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(o,t,r)=>Lu(e,o,t,r);let i=e._zod.bag;e.minValue=i.minimum??null,e.maxValue=i.maximum??null,e.format=i.format??null},{gte(e,n){return this.check(we(e,n))},min(e,n){return this.check(we(e,n))},gt(e,n){return this.check(Me(e,n))},lt(e,n){return this.check(Le(e,n))},lte(e,n){return this.check(ke(e,n))},max(e,n){return this.check(ke(e,n))},positive(e){return this.check(Me(BigInt(0),e))},negative(e){return this.check(Le(BigInt(0),e))},nonpositive(e){return this.check(ke(BigInt(0),e))},nonnegative(e){return this.check(we(BigInt(0),e))},multipleOf(e,n){return this.check(Qe(e,n))}});function Ep(e){return du(un,e)}var Io=p("ZodBigIntFormat",(e,n)=>{is.init(e,n),un.init(e,n)});function Cp(e){return mu(Io,e)}function Zp(e){return pu(Io,e)}var Cl=p("ZodSymbol",(e,n)=>{os.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Mu(e,i,o,t)});function Vp(e){return gu(Cl,e)}var Zl=p("ZodUndefined",(e,n)=>{as.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Fu(e,i,o,t)});function Lp(e){return vu(Zl,e)}var Vl=p("ZodNull",(e,n)=>{cs.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Ru(e,i,o,t)});function Ll(e){return hu(Vl,e)}var Ml=p("ZodAny",(e,n)=>{ss.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Bu(e,i,o,t)});function Mp(){return $u(Ml)}var Rl=p("ZodUnknown",(e,n)=>{us.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Wu(e,i,o,t)});function kt(){return yu(Rl)}var Fl=p("ZodNever",(e,n)=>{ls.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Gu(e,i,o,t)});function So(e){return bu(Fl,e)}var Jl=p("ZodVoid",(e,n)=>{ds.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Ju(e,i,o,t)});function Rp(e){return _u(Jl,e)}var rr=p("ZodDate",(e,n)=>{fs.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(o,t,r)=>Ku(e,o,t,r),e.min=(o,t)=>e.check(we(o,t)),e.max=(o,t)=>e.check(ke(o,t));let i=e._zod.bag;e.minDate=i.minimum?new Date(i.minimum):null,e.maxDate=i.maximum?new Date(i.maximum):null});function Fp(e){return xu(rr,e)}var Gl=p("ZodArray",(e,n)=>{It(),ms.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>al(e,i,o,t),e.element=n.element},{min(e,n){return this.check(Ge(e,n))},nonempty(e){return this.check(Ge(1,e))},max(e,n){return this.check(_t(e,n))},length(e,n){return this.check(xt(e,n))},unwrap(){return this.element}});function ir(e,n){return Iu(Gl,e,n)}function Jp(e){let n=e._zod.def.shape;return zo(Object.keys(n))}var or=p("ZodObject",(e,n)=>{It(),ps.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>cl(e,i,o,t),_.installLazyProp(e,"shape",i=>i._zod.def.shape,!1)},{keyof(){return zo(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:kt()})},loose(){return this.clone({...this._zod.def,catchall:kt()})},strict(){return this.clone({...this._zod.def,catchall:So()})},strip(){return this.clone({...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(cr,this,e[0])},exactPartial(...e){return _.partial(Do,this,e[0],"exactPartial")},required(...e){return _.required(Oo,this,e[0])}});function Gp(e,n){let i={type:"object",shape:e??{},..._.normalizeParams(n)};return new or(i)}function Bp(e,n){return new or({type:"object",shape:e,catchall:So(),..._.normalizeParams(n)})}function Wp(e,n){return new or({type:"object",shape:e,catchall:kt(),..._.normalizeParams(n)})}var ar=p("ZodUnion",(e,n)=>{Mn.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Yi(e,i,o,t),e.options=n.options});function ln(e,n){return new ar({type:"union",options:e,..._.normalizeParams(n)})}var Bl=p("ZodXor",(e,n)=>{ar.init(e,n),gs.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Yi(e,i,o,t),e.options=n.options});function Kp(e,n){return new Bl({type:"union",options:e,inclusive:!1,..._.normalizeParams(n)})}var Wl=p("ZodDiscriminatedUnion",(e,n)=>{ar.init(e,n),hs.init(e,n)});function Xp(e,n,i){return new Wl({type:"union",options:n,discriminator:e,..._.normalizeParams(i)})}var Kl=p("ZodIntersection",(e,n)=>{$s.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>sl(e,i,o,t)});function Xl(e,n){return new Kl({type:"intersection",left:e,right:n})}var ql=p("ZodTuple",(e,n)=>{It(),di.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>ul(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(n=>new cr({type:"optional",innerType:n}))})}});function Hl(e,n,i){let o=n instanceof E,t=o?i:n,r=o?n:null;return new ql({type:"tuple",items:e,rest:r,..._.normalizeParams(t)})}var nn=p("ZodRecord",(e,n)=>{It(),ys.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>ll(e,i,o,t),e.keyType=n.keyType,e.valueType=n.valueType});function Yl(e,n,i){return!n||!n._zod?new nn({type:"record",keyType:er(),valueType:e,..._.normalizeParams(n)}):new nn({type:"record",keyType:e,valueType:n,..._.normalizeParams(i)})}function qp(e,n,i){return new nn({type:"record",keyType:e,valueType:n,..._.normalizeParams(i),partial:!0})}function Hp(e,n,i){return new nn({type:"record",keyType:e,valueType:n,mode:"loose",..._.normalizeParams(i)})}var Ql=p("ZodMap",(e,n)=>{It(),bs.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>il(e,i,o,t),e.keyType=n.keyType,e.valueType=n.valueType,e.min=(...i)=>e.check(Re(...i)),e.nonempty=i=>e.check(Re(1,i)),e.max=(...i)=>e.check(et(...i)),e.size=(...i)=>e.check(bt(...i))});function Yp(e,n,i){return new Ql({type:"map",keyType:e,valueType:n,..._.normalizeParams(i)})}var ed=p("ZodSet",(e,n)=>{It(),_s.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>ol(e,i,o,t),e.min=(...i)=>e.check(Re(...i)),e.nonempty=i=>e.check(Re(1,i)),e.max=(...i)=>e.check(et(...i)),e.size=(...i)=>e.check(bt(...i))});function Qp(e,n){return new ed({type:"set",valueType:e,..._.normalizeParams(n)})}var rn=p("ZodEnum",(e,n)=>{xs.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(o,t,r)=>Xu(e,o,t,r),e.enum=n.entries,e.options=Object.values(n.entries);let i=new Set(Object.keys(n.entries));e.extract=(o,t)=>{let r={};for(let a of o)if(i.has(a))r[a]=n.entries[a];else throw new Error(`Key ${a} not found in enum`);return new rn({...n,checks:[],..._.normalizeParams(t),entries:r})},e.exclude=(o,t)=>{let r={...n.entries};for(let a of o)if(i.has(a))delete r[a];else throw new Error(`Key ${a} not found in enum`);return new rn({...n,checks:[],..._.normalizeParams(t),entries:r})}});function zo(e,n){let i=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new rn({type:"enum",entries:i,..._.normalizeParams(n)})}function eg(e,n){return new rn({type:"enum",entries:e,..._.normalizeParams(n)})}var td=p("ZodLiteral",(e,n)=>{ks.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>qu(e,i,o,t),e.values=new Set(n.values),Object.defineProperty(e,"value",{get(){if(n.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return n.values[0]}})});function tg(e,n){return new td({type:"literal",values:Array.isArray(e)?e:[e],..._.normalizeParams(n)})}var nd=p("ZodFile",(e,n)=>{ws.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Qu(e,i,o,t),e.min=(i,o)=>e.check(Re(i,o)),e.max=(i,o)=>e.check(et(i,o)),e.mime=(i,o)=>e.check(Kt(Array.isArray(i)?i:[i],o))});function ng(e){return Su(nd,e)}var rd=p("ZodTransform",(e,n)=>{It(),Is.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>rl(e,i,o,t),e._zod.parse=(i,o)=>{if(o.direction==="backward")throw new He(e.constructor.name);i.addIssue=r=>{if(typeof r=="string")i.issues.push(_.issue(r,i.value,n));else{let a=r;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=n.transform(i.value,i);return t instanceof Promise?t.then(r=>(i.value=r,i)):(i.value=t,i)}});function Po(e){return new rd({type:"transform",transform:e})}var cr=p("ZodOptional",(e,n)=>{fi.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Qi(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function wt(e){return new cr({type:"optional",innerType:e})}var Do=p("ZodExactOptional",(e,n)=>{Ss.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Qi(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function id(e){return new Do({type:"optional",innerType:e})}var od=p("ZodNullable",(e,n)=>{zs.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>dl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function tr(e){return new od({type:"nullable",innerType:e})}function rg(e){return wt(tr(e))}var ad=p("ZodDefault",(e,n)=>{Ps.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>pl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function cd(e,n){return new ad({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():_.shallowClone(n)}})}var sd=p("ZodPrefault",(e,n)=>{Ds.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>gl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function ud(e,n){return new sd({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():_.shallowClone(n)}})}var Oo=p("ZodNonOptional",(e,n)=>{Os.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>fl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function ld(e,n){return new Oo({type:"nonoptional",innerType:e,..._.normalizeParams(n)})}var dd=p("ZodSuccess",(e,n)=>{js.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>el(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function ig(e){return new dd({type:"success",innerType:e})}var fd=p("ZodCatch",(e,n)=>{Ns.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>vl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function md(e,n){return new fd({type:"catch",innerType:e,catchValue:typeof n=="function"?n:_.constantCatch(n)})}var pd=p("ZodNaN",(e,n)=>{Us.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Hu(e,i,o,t)});function og(e){return wu(pd,e)}var sr=p("ZodPipe",(e,n)=>{mi.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>hl(e,i,o,t),e.in=n.in,e.out=n.out});function oo(e,n){return new sr({type:"pipe",in:e,out:n})}var ur=p("ZodCodec",(e,n)=>{sr.init(e,n),Rn.init(e,n)});function ag(e,n,i){return new ur({type:"pipe",in:e,out:n,transform:i.decode,reverseTransform:i.encode})}function cg(e){let n=e._zod.def;return new ur({type:"pipe",in:n.out,out:n.in,transform:n.reverseTransform,reverseTransform:n.transform})}var gd=p("ZodPreprocess",(e,n)=>{sr.init(e,n),Ts.init(e,n)}),vd=p("ZodReadonly",(e,n)=>{As.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>$l(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function hd(e){return new vd({type:"readonly",innerType:e})}var $d=p("ZodTemplateLiteral",(e,n)=>{Es.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>Yu(e,i,o,t)});function sg(e,n){return new $d({type:"template_literal",parts:e,..._.normalizeParams(n)})}var yd=p("ZodLazy",(e,n)=>{Fn.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>bl(e,i,o,t),e.unwrap=()=>e._zod.def.getter()});function bd(e){return new yd({type:"lazy",getter:e})}var _d=p("ZodPromise",(e,n)=>{Zs.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>yl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function ug(e){return new _d({type:"promise",innerType:e})}var xd=p("ZodFunction",(e,n)=>{Cs.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>nl(e,i,o,t)});function lg(e){return new xd({type:"function",input:Array.isArray(e?.input)?Hl(e?.input):e?.input??ir(kt()),output:e?.output??kt()})}var lr=p("ZodCustom",(e,n)=>{Vs.init(e,n),Z.init(e,n),e._zod.processJSONSchema=(i,o,t)=>tl(e,i,o,t)});function dg(e){let n=new H({check:"custom"});return n._zod.check=e,n}function fg(e,n){return zu(lr,e??(()=>!0),n)}function kd(e,n={}){return Pu(lr,e,n)}function wd(e,n){return Du(e,n)}var mg=Ou,pg=ju;function gg(e,n={}){let i=new lr({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,..._.normalizeParams(n)});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 vg=(...e)=>Nu({Codec:ur,Boolean:sn,String:on},...e);function hg(e){let n=bd(()=>ln([er(e),Al(),El(),Ll(),ir(n),Yl(er(),n)]));return n}function $g(e,n){return new gd({type:"pipe",in:Po(e),out:n})}var wb={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 Ib(e){ne({customError:e})}function Sb(){return ne().customError}var Id;Id||(Id={});var dr={};Ve(dr,{ZodISODate:()=>ot,ZodISODateTime:()=>it,ZodISODuration:()=>ct,ZodISOTime:()=>at,date:()=>Pb,datetime:()=>zb,duration:()=>Ob,time:()=>Db});function zb(e){return Kn(it,e)}function Pb(e){return Xn(ot,e)}function Db(e){return qn(at,e)}function Ob(e){return Hn(ct,e)}var S={...dn,...no,iso:dr},jb=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 Nb(e,n){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":n??"draft-2020-12"}function yg(e,n){return e.map((i,o)=>o<n?i:i.optional())}function Ub(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Tb(e,n){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 n.rootSchema;let o=n.version==="draft-2020-12"?"$defs":"definitions";if(i[0]===o){let t=i[1]===void 0?void 0:Ub(i[1]);if(!t||!n.defs[t])throw new Error(`Reference not found: ${e}`);return n.defs[t]}throw new Error(`Reference not found: ${e}`)}function Ab(e,n){return S.transform(o=>o).check(o=>{let t=o.value;if(!(typeof t!="object"||t===null||Array.isArray(t)))for(let r of Object.getOwnPropertyNames(t)){let a=n.safeParse(r);a.success||o.issues.push({code:"invalid_key",origin:"record",issues:a.error.issues,input:r,path:[r],continue:!0})}}).pipe(e)}function bg(e,n){if(e!==!1)return e===void 0||e===!0?S.any():$e(e,n)}var Eb=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function _g(e,n){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return S.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(n.refs.has(t))return n.refs.get(t);if(n.processing.has(t))return S.lazy(()=>{if(!n.refs.has(t))throw new Error(`Circular reference not resolved: ${t}`);return n.refs.get(t)});n.processing.add(t);let r=Tb(t,n),a=$e(r,n);return n.refs.set(t,a),n.processing.delete(t),a}if(e.enum!==void 0){let t=e.enum;if(n.version==="openapi-3.0"&&e.nullable===!0&&t.length===1&&t[0]===null)return S.null();if(t.length===0)return S.never();if(t.length===1)return S.literal(t[0]);if(t.every(a=>typeof a=="string"))return S.enum(t);let r=t.map(a=>S.literal(a));return r.length<2?r[0]:S.union([r[0],r[1],...r.slice(2)])}if(e.const!==void 0)return S.literal(e.const);let i=e.type;if(Array.isArray(i)){let t=i.map(r=>{let a={...e,type:r};return _g(a,n)});return t.length===0?S.never():t.length===1?t[0]:S.union(t)}if(!i)return S.any();let o;switch(i){case"string":{let t=S.string();if(e.format){let r=e.format;r==="email"?t=t.check(S.email()):r==="uri"||r==="uri-reference"?t=t.check(S.url()):r==="uuid"||r==="guid"?t=t.check(S.uuid()):r==="date-time"?t=t.check(S.iso.datetime({offset:!0})):r==="date"?t=t.check(S.iso.date()):r==="time"?t=t.check(S.regex(Eb)):r==="duration"?t=t.check(S.iso.duration()):r==="hostname"?t=t.check(S.hostname()):r==="ipv4"?t=t.check(S.ipv4()):r==="ipv6"?t=t.check(S.ipv6()):r==="mac"?t=t.check(S.mac()):r==="cidr"?t=t.check(S.cidrv4()):r==="cidr-v6"?t=t.check(S.cidrv6()):r==="base64"?t=t.check(S.base64()):r==="base64url"?t=t.check(S.base64url()):r==="e164"?t=t.check(S.e164()):r==="credit_card"?t=t.check(S.creditCard()):r==="jwt"?t=t.check(S.jwt()):r==="emoji"?t=t.check(S.emoji()):r==="nanoid"?t=t.check(S.nanoid()):r==="cuid"?t=t.check(S.cuid()):r==="cuid2"?t=t.check(S.cuid2()):r==="ulid"?t=t.check(S.ulid()):r==="xid"?t=t.check(S.xid()):r==="ksuid"&&(t=t.check(S.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"?S.number().int():S.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=S.boolean();break}case"null":{o=S.null();break}case"object":{let t={},r=e.properties||{},a=new Set(e.required||[]),c=typeof e.additionalProperties=="object"?$e(e.additionalProperties,n):void 0;for(let[s,u]of Object.entries(r)){let l=$e(u,n);ee(t,s,a.has(s)?l:l.optional())}if(e.patternProperties){let s=e.patternProperties,u=Object.keys(s),l=[];for(let f of u){let m=$e(s[f],n),v=S.string().regex(new RegExp(f));l.push(S.looseRecord(v,m))}let d=[];if(Object.keys(t).length>0&&d.push(S.object(t).passthrough()),d.push(...l),d.length===0)o=S.object({}).passthrough();else if(d.length===1)o=d[0];else{let f=S.intersection(d[0],d[1]);for(let m=2;m<d.length;m++)f=S.intersection(f,d[m]);o=f}if(e.additionalProperties===!1){let f=Object.keys(t),m=u.map(y=>new RegExp(y)),v=o;o=o.check(y=>{if(!ze(y.value))return;let x=[];for(let I of Object.keys(y.value))f.includes(I)||m.some(h=>h.test(I))||x.push(I);x.length&&y.issues.push({code:"unrecognized_keys",keys:x,input:y.value,inst:v})})}}else{let s=S.object(t);e.additionalProperties===!1?o=s.strict():c?o=s.catchall(c):o=s.passthrough()}if(e.propertyNames!==void 0&&e.propertyNames!==!0){let s=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;o=Ab(o,$e(s,n))}break}case"array":{let t=e.prefixItems,r=e.items;if(t&&Array.isArray(t)){let a=typeof e.minItems=="number"?e.minItems:0,c=t.map(d=>$e(d,n)),s=yg(c,a),u=Array.isArray(r)?void 0:bg(r,n),l=S.tuple(s);o=u?l.rest(u):l,typeof e.minItems=="number"&&(o=o.check(S.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(S.maxLength(e.maxItems)))}else if(Array.isArray(r)){let a=typeof e.minItems=="number"?e.minItems:0,c=r.map(d=>$e(d,n)),s=yg(c,a),u=bg(e.additionalItems,n),l=S.tuple(s);o=u?l.rest(u):l,typeof e.minItems=="number"&&(o=o.check(S.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(S.maxLength(e.maxItems)))}else if(r!==void 0){let a=$e(r,n),c=S.array(a);typeof e.minItems=="number"&&(c=c.min(e.minItems)),typeof e.maxItems=="number"&&(c=c.max(e.maxItems)),o=c}else o=S.array(S.any());break}default:throw new Error(`Unsupported type: ${i}`)}return o}function $e(e,n){if(typeof e=="boolean")return e?S.any():S.never();let i=_g(e,n),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let c=e.anyOf.map(u=>$e(u,n)),s=S.union(c);i=o?S.intersection(i,s):s}if(e.oneOf&&Array.isArray(e.oneOf)){let c=e.oneOf.map(u=>$e(u,n)),s=S.xor(c);i=o?S.intersection(i,s):s}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)i=o?i:S.any();else{let c=o?i:$e(e.allOf[0],n),s=o?0:1;for(let u=s;u<e.allOf.length;u++)c=S.intersection(c,$e(e.allOf[u],n));i=c}e.nullable===!0&&n.version==="openapi-3.0"&&(i=S.nullable(i)),e.readOnly===!0&&(i=S.readonly(i)),e.default!==void 0&&(i=i.default(e.default));let t={},r=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let c of r)c in e&&(t[c]=e[c]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let c of a)c in e&&(t[c]=e[c]);e.propertyNames!==void 0&&e.type==="object"&&e.$ref===void 0&&(t.propertyNames=e.propertyNames);for(let c of Object.keys(e))jb.has(c)||ee(t,c,e[c]);return Object.keys(t).length>0&&n.registry.add(i,t),e.description&&(i=i.describe(e.description)),i}function xg(e,n){if(typeof e=="boolean")return e?S.any():S.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=Nb(i,n?.defaultTarget),t=i.$defs||i.definitions||{},r={version:o,defs:t,refs:new Map,processing:new Set,rootSchema:i,registry:n?.registry??oe};return $e(i,r)}var kg=Symbol("z.visit/resolving");function fr(e,n){let i=typeof n=="function"?n:(a,c)=>{let s=n[a._zod.def.type];return s?s(a,c):a},o=new Map;function t(a){let c=o.get(a);if(c===kg)return new Fn({type:"lazy",getter:()=>o.get(a)});if(c!==void 0)return c;o.set(a,kg);let s=r(a),u=i(s,s!==a);return o.set(a,u),u}function r(a){let c=a._zod.def,s=c.type;switch(s){case"object":{let u=c.shape,l=Object.keys(u),d=!1,f={};for(let v of l){let y=t(u[v]);y!==u[v]&&(d=!0),f[v]=y}let m=c.catchall;return c.catchall&&(m=t(c.catchall),m!==c.catchall&&(d=!0)),d?B(a,{...c,shape:f,catchall:m}):a}case"array":{let u=t(c.element);return u===c.element?a:B(a,{...c,element:u})}case"tuple":{let u=c.items,l=!1,d=[];for(let m of u){let v=t(m);v!==m&&(l=!0),d.push(v)}let f=c.rest;return c.rest&&(f=t(c.rest),f!==c.rest&&(l=!0)),l?B(a,{...c,items:d,rest:f}):a}case"record":case"map":{let u=t(c.keyType),l=t(c.valueType);return u===c.keyType&&l===c.valueType?a:B(a,{...c,keyType:u,valueType:l})}case"set":{let u=t(c.valueType);return u===c.valueType?a:B(a,{...c,valueType:u})}case"union":{let u=c.options,l=!1,d=[];for(let f of u){let m=t(f);m!==f&&(l=!0),d.push(m)}return l?B(a,{...c,options:d}):a}case"intersection":{let u=t(c.left),l=t(c.right);return u===c.left&&l===c.right?a:B(a,{...c,left:u,right:l})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let u=t(c.innerType);return u===c.innerType?a:B(a,{...c,innerType:u})}case"pipe":{let u=t(c.in),l=t(c.out);return u===c.in&&l===c.out?a:B(a,{...c,in:u,out:l})}case"function":{let u=t(c.input),l=t(c.output);return u===c.input&&l===c.output?a:B(a,{...c,input:u,output:l})}case"lazy":{let u=c.getter,{_cachedInner:l,...d}=c;return B(a,{...d,getter:()=>t(u())})}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 wg(e){return fr(e,{object:n=>n.partial(),union:n=>{let i=n._zod.def;return i.discriminator===void 0?n:ln(i.options)}})}function Cb(e,n){if(!n?.length)return e;let i=e._zod.def;return B(e,Ae(i,{checks:[...i.checks??[],...n]}),{parent:!0})}function Ig(e){return Cb(e.out,e.checks)}function Zb(e){return e.in._zod.traits.has("$ZodTransform")?Ig(e):e.in}function Sg(e){return fr(e,{pipe:n=>Zb(n._zod.def),default:(n,i)=>i?wt(n._zod.def.innerType):n,catch:(n,i)=>i?n._zod.def.innerType:n})}function zg(e){return fr(e,{pipe:n=>Ig(n._zod.def),prefault:(n,i)=>i?n._zod.def.innerType:n})}var Sd={};Ve(Sd,{bigint:()=>Rb,boolean:()=>Mb,date:()=>Fb,number:()=>Lb,string:()=>Vb});function Vb(e){return Ys(on,e)}function Lb(e){return ru(cn,e)}function Mb(e){return lu(sn,e)}function Rb(e){return fu(un,e)}function Fb(e){return ku(rr,e)}var zt={maxBatchEvents:1e3,maxProjectIdLength:128,maxSessionIdLength:128,maxSdkVersionLength:64,maxUrlLength:2048,maxTitleLength:512,maxReferrerLength:2048,maxLanguageLength:35,maxMeshNameLength:256,maxAssetNameLength:1024,maxCustomNameLength:128,maxCustomPropValueLength:1024,maxCustomPropEntries:64,maxUserIdLength:128,maxUserTraitValueLength:1024,maxUserTraitEntries:64,maxSceneDescriptionLength:256,maxCameraNameLength:128,maxSceneProxyMeshNameLength:256,maxSceneProxyMeshPathLength:512,maxSceneProxyMeshes:1e4,maxNodeIdLength:128,maxBoneIdLength:128,maxChildPathLength:512,maxGraphicsDiagnosticMessageLength:1024,maxGraphicsDiagnosticCodeLength:64};var jo=C.tuple([C.number(),C.number(),C.number()]),zd=C.tuple([C.number(),C.number(),C.number(),C.number()]),Jb=C.tuple([C.number(),C.number()]),Gb=C.tuple([C.number().min(0).max(1),C.number().min(0).max(1)]),Pd=C.number().int().nonnegative(),fn=C.string().regex(/^[A-Za-z0-9._:-]{1,64}$/,"sceneId must be 1-64 chars of [A-Za-z0-9._:-]");var Dd=C.enum(["left","right"]),No=C.enum(["y","z"]),dI=C.object({handedness:Dd,upAxis:No.default("y"),unitScale:C.number().positive().default(1)}).passthrough();var Od=C.tuple([C.number(),C.number(),C.number(),C.number(),C.number(),C.number()]),Pg=C.literal("aabb"),Dg=C.object({position:jo,rotation:zd,scale:jo}),Og=C.object({name:C.string().max(zt.maxSceneProxyMeshNameLength),aabb:Od,triangles:C.number().int().nonnegative().optional(),path:C.string().min(1).max(zt.maxSceneProxyMeshPathLength).optional(),world:Dg.optional()}),mr=1,jd=C.object({version:C.literal(mr),sceneId:fn,kind:Pg,bounds:Od,upAxis:No,handedness:Dd.optional(),unitScale:C.number().positive(),meshes:C.array(Og).max(zt.maxSceneProxyMeshes),meshCount:C.number().int().nonnegative(),contentHash:C.string().min(1),capturedAt:Pd,sdkVersion:C.string().min(1)});var Uo=class{maxSize;items=[];constructor(n){this.maxSize=n}get size(){return this.items.length}enqueue(n){this.items.push(n),this.items.length>this.maxSize&&this.items.splice(0,this.items.length-this.maxSize)}drain(){let n=this.items;return this.items=[],n}prepend(n){this.items=[...n,...this.items],this.items.length>this.maxSize&&this.items.splice(0,this.items.length-this.maxSize)}};function Ng(){let e=globalThis.crypto;return e&&typeof e.randomUUID=="function"?e.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function Ug(e){let n=e.replace(/\/$/,"")+"/api/v1/collect";return{async send(i){let o=JSON.stringify(i),t=globalThis.navigator;if(t&&typeof t.sendBeacon=="function"){let a=new Blob([o],{type:"application/json"});return t.sendBeacon(n,a)}let r=globalThis.fetch;if(typeof r!="function")return!1;try{let a=await r(n,{method:"POST",headers:{"content-type":"application/json"},body:o,keepalive:o.length<64e3});return a.ok?!0:a.status>=400&&a.status<500&&a.status!==408&&a.status!==429}catch{return!1}}}}var Xb={};function Tg(e){return{process:n=>e.send(n),processUnload:n=>e.send(n),dispose:()=>{}}}var Bb="/api/v1/collect";function Wb(e){return e.replace(/\/$/,"")+Bb}function Kb(e){let n=new Set,i=[];for(let o of e.events)for(let t of Object.values(o)){let r;t instanceof ArrayBuffer?r=t:ArrayBuffer.isView(t)&&(r=t.buffer),r&&!n.has(r)&&(n.add(r),i.push(r))}return i}function Nd(){return new Worker(new URL("./offloadWorker.js",Xb.url),{type:"module"})}function Ag(e){let n=e.workerFactory??Nd,i;try{i=n()}catch{return null}let o=1,t=!1,r=new Map,a=c=>{for(let s of r.values())s(c);r.clear()};i.addEventListener("message",c=>{let s=c.data;if(!s||s.type!=="result")return;let u=r.get(s.id);u&&(r.delete(s.id),u(s.ok))}),i.addEventListener("error",()=>{a(!1)});try{i.postMessage({type:"init",url:Wb(e.endpoint)})}catch{return i.terminate?.(),null}return{process(c){if(t)return Promise.resolve(!1);let s=o++;return new Promise(u=>{r.set(s,u);try{i.postMessage({type:"batch",id:s,batch:c},Kb(c))}catch{r.delete(s),u(!1)}})},processUnload:c=>e.unloadTransport.send(c),dispose:()=>{t||(t=!0,a(!1),i.terminate?.())}}}var To={orbitDeg:1,rollDeg:1,zoom:.02,pan:.005},qb=180/Math.PI;function mn(e,n){return[e[0]-n[0],e[1]-n[1],e[2]-n[2]]}function Ie(e,n){return e[0]*n[0]+e[1]*n[1]+e[2]*n[2]}function gn(e){return Math.hypot(e[0],e[1],e[2])}function pn(e){let n=gn(e);return n>1e-9?[e[0]/n,e[1]/n,e[2]/n]:[0,0,0]}function Cg(e,n){let i=gn(e),o=gn(n);if(i<1e-9||o<1e-9)return 0;let t=Math.min(1,Math.max(-1,Ie(e,n)/(i*o)));return Math.acos(t)*qb}function Eg(e,n){let i=e.position,o=pn(e.forward),t=n.position,r=pn(n.forward),a=mn(i,t),c=Ie(o,o),s=Ie(o,r),u=Ie(r,r),l=Ie(o,a),d=Ie(r,a),f=c*u-s*s;if(f<1e-4)return null;let m=(s*d-u*l)/f,v=(c*d-s*l)/f;if(m<=0||v<=0)return null;let y=[i[0]+m*o[0],i[1]+m*o[1],i[2]+m*o[2]],x=[t[0]+v*r[0],t[1]+v*r[1],t[2]+v*r[2]];return{pivot:[(y[0]+x[0])/2,(y[1]+x[1])/2,(y[2]+x[2])/2],distance:(m+v)/2}}function Hb(e,n){if(!e.up||!n.up)return 0;let i=pn([e.forward[0]+n.forward[0],e.forward[1]+n.forward[1],e.forward[2]+n.forward[2]]);if(gn(i)<1e-6)return 0;let o=pn(mn(e.up,[i[0]*Ie(e.up,i),i[1]*Ie(e.up,i),i[2]*Ie(e.up,i)])),t=pn(mn(n.up,[i[0]*Ie(n.up,i),i[1]*Ie(n.up,i),i[2]*Ie(n.up,i)]));return Cg(o,t)}function Zg(e,n,i={}){let o=i.sensitivity&&i.sensitivity>0?i.sensitivity:1,t={orbitDeg:(i.thresholds?.orbitDeg??To.orbitDeg)*o,rollDeg:(i.thresholds?.rollDeg??To.rollDeg)*o,zoom:(i.thresholds?.zoom??To.zoom)*o,pan:(i.thresholds?.pan??To.pan)*o},r=e.pivot&&e.distance!==void 0?{pivot:e.pivot,distance:e.distance,explicit:!0}:null,a=r?null:Eg(e,n),c=r??(a?{...a,explicit:!1}:null),s=Cg(e.forward,n.forward),u=Hb(e,n),l,d=!1;e.fov!==void 0&&n.fov!==void 0&&n.fov>1e-6?l=e.fov/n.fov:r&&e.distance!==void 0&&n.distance!==void 0&&n.distance>1e-6&&(l=e.distance/n.distance,d=!0);let f=mn(n.position,e.position),m,v=!1;if(c){let U=r?n.pivot??c.pivot:Eg(n,e)?.pivot??c.pivot,j=mn(U,c.pivot),O=pn(e.forward),Y=Ie(j,O),ce=mn(j,[O[0]*Y,O[1]*Y,O[2]*Y]);m=gn(ce)}else m=gn(f),v=m>0;let y=c&&c.distance>1e-6?c.distance:i.sceneRadius&&i.sceneRadius>1e-6?i.sceneRadius:void 0,x=y?m/y:m,I=l!==void 0?Math.abs(l-1):0,h=[];if(s>t.orbitDeg&&h.push({kind:"orbit",ratio:s/t.orbitDeg}),u>t.rollDeg&&h.push({kind:"roll",ratio:u/t.rollDeg}),I>t.zoom&&h.push({kind:d?"dolly":"zoom",ratio:I/t.zoom}),x>t.pan&&h.push({kind:v?"fly":"pan",ratio:x/t.pan}),h.length===0)return null;h.sort((U,j)=>j.ratio-U.ratio);let A={kind:h[0].kind};return s>t.orbitDeg&&(A.orbitDeg=s),u>t.rollDeg&&(A.rollDeg=u),I>t.zoom&&l!==void 0&&(A.zoomRatio=l),x>t.pan&&(A.panDist=x),A}function Vg(e){let n=[e[12]??0,e[13]??0,e[14]??0],i=Math.hypot(e[0],e[1],e[2]),o=Math.hypot(e[4],e[5],e[6]),t=Math.hypot(e[8],e[9],e[10]);e[0]*(e[5]*e[10]-e[6]*e[9])-e[4]*(e[1]*e[10]-e[2]*e[9])+e[8]*(e[1]*e[6]-e[2]*e[5])<0&&(i=-i);let a=i!==0?1/i:0,c=o!==0?1/o:0,s=t!==0?1/t:0,u=e[0]*a,l=e[1]*a,d=e[2]*a,f=e[4]*c,m=e[5]*c,v=e[6]*c,y=e[8]*s,x=e[9]*s,I=e[10]*s,h=u+m+I,P,A,U,j;if(h>0){let O=.5/Math.sqrt(h+1);j=.25/O,P=(v-x)*O,A=(y-d)*O,U=(l-f)*O}else if(u>m&&u>I){let O=2*Math.sqrt(1+u-m-I);j=(v-x)/O,P=.25*O,A=(f+l)/O,U=(y+d)/O}else if(m>I){let O=2*Math.sqrt(1+m-u-I);j=(y-d)/O,P=(f+l)/O,A=.25*O,U=(x+v)/O}else{let O=2*Math.sqrt(1+I-u-m);j=(l-f)/O,P=(y+d)/O,A=(x+v)/O,U=.25*O}return{position:n,rotation:[P,A,U,j],scale:[i,o,t]}}function pr(e,n){if(e.length===0)return 0;let i=Math.ceil(n/100*e.length),o=Math.min(e.length,Math.max(1,i))-1;return e[o]??0}function Lg(e,n){return[e[0]-n[0],e[1]-n[1],e[2]-n[2]]}function Mg(e,n){return e[0]*n[0]+e[1]*n[1]+e[2]*n[2]}function Ao(e){return Math.hypot(e[0],e[1],e[2])}function Ud(e){return e<0?0:e>1?1:e}function Eo(e,n,i,o,t,r,a){let c=Lg(t,e),s=Ao(c)||1e-6,l=Mg(c,n)/(s*i)>=a,d=Math.atan2(r,s),f=Ud(d/(o||1e-6));return{centered:l,frac:f}}function Co(e,n,i){for(let o=0;o<6;o++)if(Math.abs((e[o]??0)-(n[o]??0))>i)return!1;return!0}function Zo(e){return[Math.round(e[0]*1e3)/1e3,Math.round(e[1]*1e3)/1e3,Math.round(e[2]*1e3)/1e3,Math.round(e[3]*1e3)/1e3,Math.round(e[4]*1e3)/1e3,Math.round(e[5]*1e3)/1e3]}function Pt(e,n,i){return Math.abs(e[0]-n[0])<=i&&Math.abs(e[1]-n[1])<=i&&Math.abs(e[2]-n[2])<=i}function Vo(e,n,i){return!(!Pt(e.position,n.position,i)||!Pt(e.direction,n.direction,i)||e.target===void 0!=(n.target===void 0)||e.target&&n.target&&!Pt(e.target,n.target,i)||e.fov===void 0!=(n.fov===void 0)||e.fov!==void 0&&n.fov!==void 0&&Math.abs(e.fov-n.fov)>i||e.aspect===void 0!=(n.aspect===void 0)||e.aspect!==void 0&&n.aspect!==void 0&&Math.abs(e.aspect-n.aspect)>i||e.near===void 0!=(n.near===void 0)||e.near!==void 0&&n.near!==void 0&&Math.abs(e.near-n.near)>i)}function Lo(e,n,i){return!(!Pt(e.position,n.position,i)||Math.abs(e.rotation[0]-n.rotation[0])>i||Math.abs(e.rotation[1]-n.rotation[1])>i||Math.abs(e.rotation[2]-n.rotation[2])>i||Math.abs(e.rotation[3]-n.rotation[3])>i||e.scale===void 0!=(n.scale===void 0)||e.scale&&n.scale&&!Pt(e.scale,n.scale,i))}function Yb(e){for(let n=0;n<e.length;n++)if(!Number.isFinite(e[n]))return!1;return!0}function Td(e){let n=e.emit,i,o=new Map,t=new Map,r=new Map;function a(l){if(!Number.isFinite(l.fps)||l.fps<0)return;let d=l.frameTimes,f;if(d.length>0){let y=0;for(let I=0;I<d.length;I++)d[I]>l.jankFrameMs&&y++;let x=Array.from(d).sort((I,h)=>I-h);f={frameTimeP95Ms:pr(x,95),frameTimeP99Ms:pr(x,99),longFrames:y}}let m=e.perf?.suppressIdle??!1,v=e.perf?.fpsThreshold??0;m&&i!==void 0&&Math.abs(l.fps-i)<=v||(i=l.fps,n({type:"frame_perf",fps:l.fps,...f??{},...typeof l.dpr=="number"&&l.dpr>0?{dpr:l.dpr}:{},...l.renderScale!==void 0?{renderScale:l.renderScale}:{},...l.position?{position:l.position}:{}}))}function c(l){let d=l.decomposed??Qb(l.matrix,l.scaleEps),f=l.boneId?`${l.nodeId}\0bone\0${l.boneId}`:l.childPath!==void 0?`${l.nodeId}\0${l.childPath}`:l.nodeId,m=e.node?.suppressIdle??!1,v=o.get(f);m&&v&&Lo(v,d,l.scaleEps)||(o.set(f,d),n({type:"node_transform",nodeId:l.nodeId,...l.childPath!==void 0?{childPath:l.childPath}:{},...l.boneId!==void 0?{boneId:l.boneId}:{},position:d.position,rotation:d.rotation,...d.scale?{scale:d.scale}:{}}))}function s(l){if(l.stepMs<=0)return;let d=e.visibility?.centeredCos??1,f=e.visibility?.boundingBox??!1,m=Ao(l.forward)||1,v=(l.fov||.8)/2;for(let y of l.meshes){let{centered:x,frac:I}=Eo(l.camPos,l.forward,m,v,y.center,y.radius,d),h=t.get(y.mesh);h||(h={visibleMs:0,centeredMs:0,maxScreenFraction:0},t.set(y.mesh,h)),h.visibleMs+=l.stepMs,x&&(h.centeredMs+=l.stepMs),I>h.maxScreenFraction&&(h.maxScreenFraction=I),f&&y.aabb&&(h.bounds=y.aabb)}}function u(){if(t.size===0)return;let l=e.visibility?.boundsEps??.001,d=t;t=new Map;for(let[f,m]of d){if(m.visibleMs<=0)continue;let v;if(m.bounds&&Yb(m.bounds)){let y=r.get(f);(!y||!Co(y,m.bounds,l))&&(v=Zo(m.bounds),r.set(f,m.bounds))}n({type:"mesh_visibility",mesh:f,visibleMs:Math.round(m.visibleMs),...m.centeredMs>0?{centeredMs:Math.round(m.centeredMs)}:{},...m.maxScreenFraction>0?{maxScreenFraction:Math.round(m.maxScreenFraction*1e4)/1e4}:{},...v?{bounds:v}:{}})}}return{ingest(l){switch(l.channel){case"camera":n({type:"camera_sample",position:l.position,direction:l.direction,...l.target?{target:l.target}:{},...l.fov!==void 0?{fov:l.fov}:{},...l.aspect!==void 0?{aspect:l.aspect}:{},...l.near!==void 0?{near:l.near}:{},...l.hitPoint?{hitPoint:l.hitPoint}:{},...l.hitMesh?{hitMesh:l.hitMesh}:{}});return;case"perf":a(l);return;case"node":c(l);return;case"visibilityTick":s(l);return;case"visibilityFlush":u();return;case"gesture":{let d=Zg(l.start,l.end,l.options??{});if(!d)return;n({type:"camera_gesture",kind:d.kind,durationMs:l.durationMs,...d.orbitDeg!==void 0?{orbitDeg:d.orbitDeg}:{},...d.rollDeg!==void 0?{rollDeg:d.rollDeg}:{},...d.zoomRatio!==void 0?{zoomRatio:d.zoomRatio}:{},...d.panDist!==void 0?{panDist:d.panDist}:{},...l.source?{source:l.source}:{}});return}case"hover":n({type:"hover_dwell",mesh:l.mesh,dwellMs:l.dwellMs,...l.source?{source:l.source}:{},...l.uv?{uv:l.uv}:{}});return}},reset(){i=void 0,o.clear(),t=new Map,r.clear()}}}function Qb(e,n){if(!e||e.length<16)return{position:[0,0,0],rotation:[0,0,0,1]};let i=Vg(e),o={position:i.position,rotation:i.rotation},[t,r,a]=i.scale;return(Math.abs(t-1)>n||Math.abs(r-1)>n||Math.abs(a-1)>n)&&(o.scale=i.scale),o}function Ad(e){return e.channel==="perf"?[e.frameTimes.buffer]:e.channel==="node"&&e.matrix?[e.matrix.buffer]:[]}function Rg(e){return{ingest:n=>e.ingest(n),drain:()=>Promise.resolve(),dispose:()=>{}}}function Fg(e){let n=e.workerFactory??Nd,i;try{i=n()}catch{return null}let o=!1,t=1,r=new Map;i.addEventListener("message",a=>{let c=a.data;if(c){if(c.type==="events")e.onEvents(c.events,c.capturedAt);else if(c.type==="unloadDone"){let s=r.get(c.id);s&&(r.delete(c.id),s())}}}),i.addEventListener("error",()=>{for(let a of r.values())a();r.clear()});try{i.postMessage({type:"aggInit",config:e.config})}catch{return i.terminate?.(),null}return{ingest(a,c){if(!o)try{i.postMessage({type:"snapshot",capturedAt:c,snapshot:a},Ad(a))}catch{}},drain(){if(o)return Promise.resolve();let a=t++;return new Promise(c=>{r.set(a,c);try{i.postMessage({type:"flushUnload",id:a})}catch{r.delete(a),c()}})},dispose(){if(!o){o=!0;for(let a of r.values())a();r.clear(),i.terminate?.()}}}}var gr="0.1.0";var Mo={batchSize:20,flushIntervalMs:5e3,maxQueueSize:1e3,resizeDebounceMs:250};function e_(e){return{projectId:e.projectId,endpoint:e.endpoint,sdkVersion:e.sdkVersion??gr,batchSize:e.batchSize??Mo.batchSize,flushIntervalMs:e.flushIntervalMs??Mo.flushIntervalMs,maxQueueSize:e.maxQueueSize??Mo.maxQueueSize,offload:e.offload??"main",disabled:e.disabled??!1,captureLifecycle:e.captureLifecycle??!0,resizeDebounceMs:e.resizeDebounceMs??Mo.resizeDebounceMs,captureErrors:e.captureErrors??!1,captureGraphicsDiagnostics:e.captureGraphicsDiagnostics??!1,captureShaderSource:e.captureShaderSource??!1,debug:e.debug??!1}}var vr=class e{config;sessionId;queue;transport;processor;beforeSend;collectors=[];handles=[];aggSinks=[];customTransport;createWorkerFn;started=!1;startedAt=0;url;currentScene=Pr;pageMeta;flushTimer;resizeTimer;errorCount=0;lastErrorKey;positionProvider;boundVisibility=()=>this.onVisibilityChange();boundPageHide=()=>{this.stop("hidden")};boundFocus=()=>this.onFocusChange(!0);boundBlur=()=>this.onFocusChange(!1);boundResize=()=>this.onResize();boundError=n=>this.onErrorEvent(n);boundRejection=n=>this.onUnhandledRejection(n);constructor(n){this.config=e_(n),this.sessionId=Ng(),this.queue=new Uo(this.config.maxQueueSize),this.transport=n.transport??Ug(this.config.endpoint),this.customTransport=n.transport,this.createWorkerFn=n.createWorker,this.processor=this.createProcessor(n),this.beforeSend=n.beforeSend}use(n){return this.collectors.push(n),this.started&&this.startCollector(n),this}start(n={}){if(!(this.started||this.config.disabled)){if(this.started=!0,this.startedAt=this.now(),this.url=n.url??this.defaultUrl(),this.pageMeta=n.pageMeta,n.sceneId!=null){let i=fn.safeParse(n.sceneId);i.success?this.currentScene=i.data:this.log(`ignoring invalid initial sceneId: ${String(n.sceneId)}`)}this.emit({type:"session_start",...n.device?{device:n.device}:{},...n.graphics?{graphics:n.graphics}:{},...n.scene?{scene:n.scene}:{},...n.connector?{connector:n.connector}:{},...n.user?{user:n.user}:{}}),this.config.flushIntervalMs>0&&(this.flushTimer=setInterval(()=>{this.flush()},this.config.flushIntervalMs)),this.bindLifecycle();for(let i of this.collectors)this.startCollector(i)}}setScene(n){if(this.config.disabled)return;let i=fn.safeParse(n);if(!i.success){this.log(`ignoring invalid sceneId: ${String(n)}`);return}i.data!==this.currentScene&&(this.currentScene=i.data,this.started&&this.emit({type:"scene_change"}))}setPositionProvider(n){this.positionProvider=n}emit(n){!this.started||this.config.disabled||this.emitInternal(n,this.now())}emitInternal(n,i){if(this.config.disabled)return;let o={...n,projectId:this.config.projectId,sessionId:this.sessionId,ts:i,sdkVersion:this.config.sdkVersion,...this.url?{url:this.url}:{},...this.currentScene!==Pr?{sceneId:this.currentScene}:{},...this.pageMeta?{pageMeta:this.pageMeta}:{}};this.enrichPosition(o);let t=this.beforeSend?this.beforeSend(o):o;t&&(this.queue.enqueue(t),this.queue.size>=this.config.batchSize&&this.flush())}enrichPosition(n){if(!(n.type!=="runtime_error"&&n.type!=="graphics_diagnostic")&&!(this.positionProvider===void 0||n.position))try{let i=this.positionProvider();i&&(n.position=i)}catch(i){this.log("positionProvider threw; emitting without position",i)}}track(n,i){this.emit({type:"custom",name:n,...i?{props:i}:{}})}trackInput(n,i={}){n&&this.emit({type:"input_action",action:n,source:i.source??"keyboard",...i.code?{code:i.code}:{},...typeof i.button=="number"?{button:i.button}:{},...typeof i.pressed=="boolean"?{pressed:i.pressed}:{},...i.handedness?{handedness:i.handedness}:{},...i.sourceId?{sourceId:i.sourceId}:{}})}reportCapabilityChange(n){n.kind&&this.emit({type:"capability_change",kind:n.kind,...n.from?{from:n.from}:{},...n.to?{to:n.to}:{},...n.reason?{reason:n.reason}:{},...typeof n.durationMs=="number"?{durationMs:n.durationMs}:{},...n.source?{source:n.source}:{},...n.handedness?{handedness:n.handedness}:{}})}async flush(n){let i=this.queue.drain();if(i.length===0)return;let o={schemaVersion:"1.0",events:i};await(n?.unload?this.processor.processUnload(o):this.processor.process(o))||(this.queue.prepend(i),this.log("flush failed; re-queued",i.length))}async stop(n="manual"){if(this.started){this.emit({type:"session_end",durationMs:this.now()-this.startedAt,reason:n}),this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.unbindLifecycle();for(let i of this.handles.splice(0))i.stop();this.aggSinks.length>0&&await Promise.all(this.aggSinks.map(i=>i.drain())),this.started=!1,await this.flush({unload:!0});for(let i of this.aggSinks.splice(0))i.dispose();this.processor.dispose()}}now(){return Date.now()}createProcessor(n){if(this.config.offload==="worker")if(n.transport)this.log("custom transport set; worker offload disabled (transport runs on main thread)");else{let i=Ag({endpoint:this.config.endpoint,unloadTransport:this.transport,...n.createWorker?{workerFactory:n.createWorker}:{}});if(i)return i;this.log("worker offload unavailable; falling back to main-thread processor")}return Tg(this.transport)}createAggregation(n){if(this.config.offload==="worker"&&!this.customTransport){let t=Fg({config:n,onEvents:(r,a)=>{for(let c of r)this.emitInternal(c,a)},...this.createWorkerFn?{workerFactory:this.createWorkerFn}:{}});if(t)return this.aggSinks.push(t),r=>t.ingest(r,this.now());this.log("worker aggregation unavailable; falling back to main-thread aggregator")}let i=Td({...n,emit:t=>this.emit(t)}),o=Rg(i);return this.aggSinks.push(o),t=>o.ingest(t,this.now())}startCollector(n){let i={config:this.config,sessionId:this.sessionId,emit:o=>this.emit(o),track:(o,t)=>this.track(o,t),trackInput:(o,t)=>this.trackInput(o,t),reportCapabilityChange:o=>this.reportCapabilityChange(o),setScene:o=>this.setScene(o),setPositionProvider:o=>this.setPositionProvider(o),createAggregation:o=>this.createAggregation(o),now:()=>this.now()};try{let o=n.start(i);o&&this.handles.push(o)}catch(o){this.log(`collector "${n.name}" failed to start`,o)}}onVisibilityChange(){let n=globalThis.document,i=n?.visibilityState==="hidden";this.config.captureLifecycle&&n&&this.emit({type:"visibility_change",state:i?"hidden":"visible"}),i&&this.flush({unload:!0})}onFocusChange(n){this.config.captureLifecycle&&this.emit({type:"focus_change",focused:n})}onResize(){this.config.captureLifecycle&&(this.resizeTimer&&clearTimeout(this.resizeTimer),this.resizeTimer=setTimeout(()=>{this.resizeTimer=void 0,this.emitViewportResize()},this.config.resizeDebounceMs))}emitViewportResize(){let n=globalThis;typeof n.innerWidth!="number"||typeof n.innerHeight!="number"||n.innerWidth<=0||n.innerHeight<=0||this.emit({type:"viewport_resize",width:n.innerWidth,height:n.innerHeight,...typeof n.devicePixelRatio=="number"?{dpr:n.devicePixelRatio}:{}})}static MAX_ERRORS_PER_SESSION=50;onErrorEvent(n){this.emitError({kind:"error",message:n.message||"Unknown error",...n.filename?{source:n.filename}:{},...typeof n.lineno=="number"?{lineno:n.lineno}:{},...typeof n.colno=="number"?{colno:n.colno}:{},...n.error instanceof Error&&n.error.stack?{stack:n.error.stack}:{}})}onUnhandledRejection(n){let i=n.reason,o=i instanceof Error?i.message:typeof i=="string"?i:"Unhandled promise rejection";this.emitError({kind:"unhandledrejection",message:o||"Unhandled promise rejection",...i instanceof Error&&i.stack?{stack:i.stack}:{}})}emitError(n){if(this.errorCount>=e.MAX_ERRORS_PER_SESSION)return;let i=`${n.message}\0${n.stack??""}`;i!==this.lastErrorKey&&(this.lastErrorKey=i,this.errorCount+=1,this.emit({type:"runtime_error",kind:n.kind,message:n.message.slice(0,1024),...n.source?{source:n.source.slice(0,1024)}:{},...typeof n.lineno=="number"?{lineno:n.lineno}:{},...typeof n.colno=="number"?{colno:n.colno}:{},...n.stack?{stack:n.stack.slice(0,4096)}:{}}))}bindLifecycle(){let n=globalThis.document,i=globalThis.addEventListener?globalThis:void 0;n?.addEventListener("visibilitychange",this.boundVisibility),i?.addEventListener("pagehide",this.boundPageHide),this.config.captureLifecycle&&i&&(i.addEventListener("focus",this.boundFocus),i.addEventListener("blur",this.boundBlur),i.addEventListener("resize",this.boundResize),this.emitViewportResize()),this.config.captureErrors&&i&&(i.addEventListener("error",this.boundError),i.addEventListener("unhandledrejection",this.boundRejection))}unbindLifecycle(){let n=globalThis.document,i=globalThis.removeEventListener?globalThis:void 0;n?.removeEventListener("visibilitychange",this.boundVisibility),i?.removeEventListener("pagehide",this.boundPageHide),i?.removeEventListener("focus",this.boundFocus),i?.removeEventListener("blur",this.boundBlur),i?.removeEventListener("resize",this.boundResize),i?.removeEventListener("error",this.boundError),i?.removeEventListener("unhandledrejection",this.boundRejection),this.resizeTimer&&(clearTimeout(this.resizeTimer),this.resizeTimer=void 0)}defaultUrl(){return globalThis.location?.href}log(...n){this.config.debug&&console.debug("[uptimizr]",...n)}};function Dt(e,n){return e===void 0?{mode:"interval",ms:n}:e==="frame"?{mode:"frame"}:e<=0?{mode:"off"}:{mode:"interval",ms:1e3/e}}function ae(e){return e===0?0:e}function Je(e,n){return n==="left"?[e[0],e[1],e[2]]:[ae(e[0]),ae(e[1]),ae(-e[2])]}function hr(e,n){return n==="left"?[e[0],e[1],e[2]]:[ae(e[0]),ae(e[1]),ae(-e[2])]}function Ed(e,n){return n==="left"?[e[0],e[1],e[2],e[3],e[4],e[5]]:[ae(e[0]),ae(e[1]),ae(-e[5]),ae(e[3]),ae(e[4]),ae(-e[2])]}function vn(e,n){return n==="left"?[e[0],e[1],e[2],e[3]]:[ae(-e[0]),ae(-e[1]),ae(e[2]),ae(e[3])]}function $r(e){return[e.x,e.y,e.z]}function yr(e){return e<0?0:e>1?1:e}var De=aa("playcanvas"),Jg="uptimizr-";function Ro(e,n){let i=new De.Ray,o=new De.Vec3,t=new De.Vec3,r=new De.Vec3,a=new De.Vec3;return(c,s)=>{let u=n.camera,l=u?.camera;if(!u||!l)return;let d=e.graphicsDevice,f=d?.canvas,m=f?.clientWidth||f?.width||d?.width||1,v=f?.clientHeight||f?.height||d?.height||1,y=(c+1)/2*m,x=(1-s)/2*v,I=u.nearClip??.1,h=u.farClip??1e3;l.screenToWorld(y,x,I,m,v,o),l.screenToWorld(y,x,h,m,v,t),i.origin.copy(o),i.direction.copy(t).sub(o).normalize();let P=1/0,A;if(e.root?.forEach?.(j=>{let O=j;if(O.enabled===!1)return;let Y=O.render?.meshInstances??O.model?.meshInstances;if(Y)for(let ce of Y){if(ce.visible===!1)continue;let se=ce.node?.name??"";if(se.startsWith(Jg))continue;let je=ce.aabb;if(!je||typeof je.intersectsRay!="function"||!je.intersectsRay(i,r))continue;let Se=r.x-i.origin.x,Ne=r.y-i.origin.y,Ue=r.z-i.origin.z,st=Se*Se+Ne*Ne+Ue*Ue;st<P&&(P=st,A=se,a.copy(r))}}),A!==void 0)return{point:[a.x,a.y,a.z],name:A}}}function Fo(e,n,i={}){let o=new De.Ray,t=new De.Vec3,r=new De.Vec3,a=new De.Vec3,c=new De.Vec3,s=i.maxDistance??1e3,u=s*s,l=i.meshes&&i.meshes.length>0?new Set(i.meshes):null,d=i.predicate;return()=>{let f=n.camera,m=f?.camera;if(!f||!m)return;let v=e.graphicsDevice,y=v?.canvas,x=y?.clientWidth||y?.width||v?.width||1,I=y?.clientHeight||y?.height||v?.height||1,h=x/2,P=I/2,A=f.nearClip??.1,U=f.farClip??1e3;m.screenToWorld(h,P,A,x,I,t),m.screenToWorld(h,P,U,x,I,r),o.origin.copy(t),o.direction.copy(r).sub(t).normalize();let j=1/0,O;if(e.root?.forEach?.(ce=>{let se=ce;if(se.enabled===!1)return;let je=se.render?.meshInstances??se.model?.meshInstances;if(je)for(let Se of je){if(Se.visible===!1)continue;let Ne=Se.node?.name??"";if(Ne.startsWith(Jg)||l&&!l.has(Ne)||d&&Se.node&&!d(Se.node))continue;let Ue=Se.aabb;if(!Ue||typeof Ue.intersectsRay!="function"||!Ue.intersectsRay(o,a))continue;let st=a.x-o.origin.x,hn=a.y-o.origin.y,ea=a.z-o.origin.z,br=st*st+hn*hn+ea*ea;br<j&&(j=br,O=Ne,c.copy(a))}}),!(O===void 0||j>u))return{point:[c.x,c.y,c.z],name:O}}}function Gg(e){let n=e.pointerType;return n==="mouse"||n==="pen"||n==="touch"?n:typeof n=="string"&&n.length>0?"other":void 0}function t_(e){if(typeof document>"u")return!1;let n=document.pointerLockElement;return n!=null&&n===e()}var n_=zt.maxAssetNameLength;function r_(e,n){return[e[0]-n[0],e[1]-n[1],e[2]-n[2]]}function i_(e,n){return e[0]*n[0]+e[1]*n[1]+e[2]*n[2]}function o_(e){return e!==null&&typeof e=="object"?e.hz:e}function a_(e){if(e===null||typeof e!="object")return null;let n=e.include;return n==="*"||Array.isArray(n)&&n.length>0?{include:n,maxDepth:e.maxDepth??8,maxNodes:e.maxNodes??64,exclude:new Set(e.exclude??[])}:null}function c_(e,n){let i=[],o=n.include==="*",t=o?null:new Set(n.include),r=[];for(let a of e.children??[])r.push({node:a,path:a.name??"",depth:1});for(;r.length>0&&i.length<n.maxNodes;){let{node:a,path:c,depth:s}=r.shift(),u=a.name;if(!(typeof u!="string"||u.length===0)&&!n.exclude.has(u)&&!Kg(a)&&((o||t.has(u))&&i.push({childPath:c,node:a}),s<n.maxDepth))for(let l of a.children??[]){let d=l.name??"";r.push({node:l,path:c?`${c}/${d}`:d,depth:s+1})}}return i}function Kg(e){return e.camera!=null}function Bg(e,n){let i=e.getPosition?.()??{x:0,y:0,z:0},o=e.getRotation?.()??{x:0,y:0,z:0,w:1},t={position:Je([i.x,i.y,i.z],"right"),rotation:vn([o.x,o.y,o.z,o.w],"right")},r=e.getWorldTransform?.()?.getScale?.();return r&&(Math.abs(r.x-1)>n||Math.abs(r.y-1)>n||Math.abs(r.z-1)>n)&&(t.scale=$r(r)),t}function Wg(e,n){return typeof n=="function"?n()??null:typeof n=="string"?e.findByName?.(n)??null:n??null}function s_(e){let n=new Set,i=[],o=[...e.render?.meshInstances??[],...e.model?.meshInstances??[]];for(let t of o){let r=t.skinInstance?.bones;if(r)for(let a of r){let c=a?.name;typeof c!="string"||n.has(c)||(n.add(c),i.push(a))}}return i}function u_(e,n){let i=s_(e);if(i.length===0)return[];if(n==="*")return i;let o=new Map;for(let r of i)typeof r.name=="string"&&o.set(r.name,r);let t=[];for(let r of n){let a=o.get(r);a&&t.push(a)}return t}function l_(e,n){if(!e.getLocalPosition||!e.getLocalRotation)return null;let i=e.getLocalPosition(),o=e.getLocalRotation(),t={position:Je([i.x,i.y,i.z],"right"),rotation:vn([o.x,o.y,o.z,o.w],"right")},r=e.getLocalScale?.();return r&&(Math.abs(r.x-1)>n||Math.abs(r.y-1)>n||Math.abs(r.z-1)>n)&&(t.scale=$r(r)),t}function Xg(e){return e.render?.meshInstances??e.model?.meshInstances??[]}function d_(e){let n=1/0,i=1/0,o=1/0,t=-1/0,r=-1/0,a=-1/0,c=!1;for(let s of Xg(e)){let u=s.aabb;if(!u||typeof u.getMin!="function"||typeof u.getMax!="function")continue;let l=u.getMin(),d=u.getMax();c=!0,l.x<n&&(n=l.x),l.y<i&&(i=l.y),l.z<o&&(o=l.z),d.x>t&&(t=d.x),d.y>r&&(r=d.y),d.z>a&&(a=d.z)}return c?{center:[(n+t)/2,(i+r)/2,(o+a)/2],radius:.5*Math.hypot(t-n,r-i,a-o),aabb:[n,i,o,t,r,a]}:null}function f_(e,n,i,o){return i_(r_(e,i),o)+n>0}function Jo(e){let{app:n,camera:i,sampleCameraMs:o=1e3,samplePerfMs:t=2e3,pointerMoveThrottleMs:r=250,suppressIdleSamples:a=!0,suppressIdlePerfSamples:c=!1,cameraEpsilon:s=.001,perfFpsThreshold:u=1,cameraGestureSensitivity:l=1,capture:d={},sampling:f={}}=e,m=Dt(f.camera,o),v=Dt(f.perf,t),y=Dt(f.pointerMove,r),x=e.keyBindings??{},I=Object.keys(x).length>0,h={camera:(d.camera??!0)&&m.mode!=="off",pointerMove:(d.pointerMove??!0)&&y.mode!=="off",clicks:d.clicks??!0,buttons:d.buttons??!0,cameraGesture:d.cameraGesture??!0,meshPicks:d.meshPicks??!0,perf:(d.perf??!0)&&v.mode!=="off",contextLoss:d.contextLoss??!0,assetLoad:d.assetLoad??!0,meshVisibility:d.meshVisibility??!1,hoverDwell:d.hoverDwell??!1,resourceSample:d.resourceSample??!1,gaze:(d.gaze??!1)&&(d.camera??!0)&&m.mode!=="off",nodes:d.nodes??!0,bones:d.bones??!0,keyboard:(d.keyboard??!0)&&I},P=e.actors??{},A=h.nodes?Object.keys(f.nodes??{}).filter(K=>{let ye=Object.prototype.hasOwnProperty.call(P,K);return ye||console.warn(`[uptimizr] sampling.nodes["${K}"] has no matching entry in \`actors\`; ignoring. Declare the node in \`actors\` to capture its transform.`),ye}):[],U=A.length>0,j=h.bones?Object.keys(f.bones??{}).filter(K=>{if(!Object.prototype.hasOwnProperty.call(P,K))return console.warn(`[uptimizr] sampling.bones["${K}"] has no matching entry in \`actors\`; ignoring. Declare the node in \`actors\` to capture its bones.`),!1;let be=f.bones[K].include;return be!=="*"&&(!Array.isArray(be)||be.length===0)?(console.warn(`[uptimizr] sampling.bones["${K}"].include is empty; ignoring. Provide bone names or "*" to capture bones.`),!1):!0}):[],O=j.length>0,Y=e.meshVisibility??{},ce=Y.windowMs??5e3,se=Y.meshes&&Y.meshes.length>0?new Set(Y.meshes):void 0,je=Math.cos((Y.centeredAngleDeg??12)*Math.PI/180),Se=Y.maxMeshes??50,Ne=Y.boundingBox??!1,Ue=e.hoverDwell??{},st=Ue.minDwellMs??500,hn=Ue.meshes&&Ue.meshes.length>0?new Set(Ue.meshes):void 0,br=(e.resourceSample??{}).intervalMs??15e3,Vd=y.mode==="interval"?y.ms:0;return{name:"playcanvas",start(K){let ye=n,Ld={perf:{suppressIdle:c,fpsThreshold:u},node:{suppressIdle:a},visibility:{centeredCos:je,boundingBox:Ne,boundsEps:.001}},be=K.createAggregation(Ld),$n=[],yn=[],_r=[],bn=[],xr=!1,Md=!1,kr=0,ta,na=null,ev=()=>ye.stats?.frame?.fps??0,ra=w=>{if(!w||typeof w.fov!="number")return;let D=w.fov*Math.PI/180;if(w.horizontalFov){let z=typeof w.aspectRatio=="number"&&w.aspectRatio>0?w.aspectRatio:1;return 2*Math.atan(Math.tan(D/2)/z)}return D},tv=h.gaze?e.gaze?.probe??Fo(n,i,e.gaze??{}):void 0,Rd=()=>{let w=i,D=w.getPosition(),z=w.forward,V=Je([D.x,D.y,D.z],"right"),G=hr([z.x,z.y,z.z],"right"),L=ra(w.camera),F={position:V,direction:G,...L!==void 0?{fov:L}:{}};if(a&&ta&&Vo(ta,F,s))return;ta=F;let J=tv?.(),te=J?Je(J.point,"right"):void 0,_e=J&&J.name?J.name:void 0;be({channel:"camera",position:F.position,direction:F.direction,...F.fov!==void 0?{fov:F.fov}:{},...te?{hitPoint:te}:{},..._e?{hitMesh:_e}:{}})},Fd=()=>{let w=i,D=w.getPosition(),z=w.forward,V=w.up,G={position:Je([D.x,D.y,D.z],"right"),forward:hr([z.x,z.y,z.z],"right"),up:hr([V.x,V.y,V.z],"right")},L=ra(w.camera);return L!==void 0&&(G.fov=L),G},nv=()=>{let w=ev();w<=0||be({channel:"perf",frameTimes:new Float32Array(0),fps:w,jankFrameMs:0})},Jd=()=>{if(!Md)for(let w of _r)w()},Gd=()=>{xr||(ye.on("frameend",Jd),xr=!0)},wr=(w,D)=>{w.mode==="interval"?$n.push(setInterval(D,w.ms)):w.mode==="frame"&&(_r.push(D),Gd())};if(h.camera&&(Rd(),wr(m,Rd)),h.perf&&wr(v,nv),U){let w=ye.root,D=new Set;for(let z of A){let V=P[z],G=f.nodes?.[z],L=Dt(o_(G),o);if(L.mode==="off")continue;let F=a_(G),J=()=>{let te=Wg(w,V);if(te){if(Kg(te)){D.has(z)||(D.add(z),console.warn(`[uptimizr] actor "${z}" resolves to a camera; refusing node_transform capture. The visitor camera is already captured as camera_sample.`));return}if(be({channel:"node",nodeId:z,decomposed:Bg(te,s),scaleEps:s}),F)for(let{childPath:_e,node:Ze}of c_(te,F))be({channel:"node",nodeId:z,childPath:_e,decomposed:Bg(Ze,s),scaleEps:s})}};J(),wr(L,J)}}if(O){let w=ye.root,D=new Set;for(let z of j){let V=P[z],G=f.bones[z],L=Dt(G.hz,o);if(L.mode==="off")continue;let F=()=>{let J=Wg(w,V);if(!J)return;let te=u_(J,G.include);if(te.length===0){D.has(z)||(D.add(z),console.warn(`[uptimizr] actor "${z}" resolves to no matching skeleton bones; skipping Tier 2 capture. Declare the skinned entity and check the bone names.`));return}for(let _e of te){let Ze=_e.name;if(typeof Ze!="string")continue;let kn=l_(_e,s);kn&&be({channel:"node",nodeId:z,boneId:Ze,decomposed:kn,scaleEps:s})}};F(),wr(L,F)}}if(h.meshVisibility){let w=K.now(),D=()=>{let V=K.now(),G=V-w;if(w=V,G<=0)return;let L=i,F=L.getPosition(),J=L.forward,te=[F.x,F.y,F.z],_e=[J.x,J.y,J.z],Ze=ra(L.camera)??0,kn=0,ia=[];ye.root?.forEach?.(uv=>{let Sr=uv;if(Xg(Sr).length===0)return;let zr=Sr.name;if(!zr||zr.startsWith("uptimizr-"))return;if(se){if(!se.has(zr))return}else if(Sr.enabled===!1||kn>=Se)return;let Te=d_(Sr);Te&&(kn++,f_(Te.center,Te.radius,te,_e)&&ia.push({mesh:zr,center:Te.center,radius:Te.radius,...Ne?{aabb:[Te.aabb[0],Te.aabb[1],-Te.aabb[5],Te.aabb[3],Te.aabb[4],-Te.aabb[2]]}:{}}))}),ia.length!==0&&be({channel:"visibilityTick",stepMs:G,camPos:te,forward:_e,fov:Ze,meshes:ia})},z=()=>be({channel:"visibilityFlush"});_r.push(D),Gd(),$n.push(setInterval(z,ce)),bn.push(z)}let rv=h.pointerMove||h.clicks||h.buttons||h.meshPicks||h.hoverDwell,We=ye.graphicsDevice?.canvas,Bd=rv&&We?e.raycast??Ro(n,i):void 0,Ke=(w,D)=>{We&&(We.addEventListener(w,D),yn.push({target:We,type:w,handler:D}))},iv=w=>{if(t_(()=>We))return[.5,.5];let D=We&&typeof We.getBoundingClientRect=="function"?We.getBoundingClientRect():{left:0,top:0,width:0,height:0},z=D.width||1,V=D.height||1;return[yr((w.clientX-D.left)/z),yr((w.clientY-D.top)/V)]},ov=w=>{if(!Bd)return;let D=w[0]*2-1,z=1-w[1]*2;return Bd(D,z)},_n=w=>{let D=iv(w),z=ov(D),V=z?Je(z.point,"right"):void 0,G=z?.name?z.name:void 0,L=Gg(w);return{screen:D,...V?{hitPoint:V}:{},...G?{hitMesh:G}:{},...L?{source:L}:{},...z?{hit:z}:{}}},ut,Wd=0,xn=!1,Ir,Kd=w=>{if(ut!==void 0&&!xn){let D=w-Wd;D>=st&&be({channel:"hover",mesh:ut,dwellMs:D,...Ir?{source:Ir}:{}})}ut=void 0,xn=!1,Ir=void 0},av=(w,D,z)=>{let V=D!==void 0&&(!hn||hn.has(D))?D:void 0;V!==ut&&(Kd(w),V!==void 0&&(ut=V,Wd=w,xn=!1,Ir=z))},cv=w=>{let D=w;if(h.hoverDwell){let J=_n(D);if(av(K.now(),J.hitMesh,J.source),h.pointerMove){let te=K.now();te-kr>=Vd&&(kr=te,K.emit({type:"pointer_move",screen:J.screen,...J.hitPoint?{hitPoint:J.hitPoint}:{},...J.hitMesh?{hitMesh:J.hitMesh}:{},...J.source?{source:J.source}:{}}))}return}if(!h.pointerMove)return;let z=K.now();if(z-kr<Vd)return;kr=z;let{screen:V,hitPoint:G,hitMesh:L,source:F}=_n(D);K.emit({type:"pointer_move",screen:V,...G?{hitPoint:G}:{},...L?{hitMesh:L}:{},...F?{source:F}:{}})},Xd=(w,D)=>{let z=D;if(w==="pointer_down"&&h.hoverDwell){let{hitMesh:J}=_n(z);J!==void 0&&J===ut&&(xn=!0)}if(!h.buttons)return;let{screen:V,hitPoint:G,hitMesh:L,source:F}=_n(z);K.emit({type:w,screen:V,...G?{hitPoint:G}:{},...L?{hitMesh:L}:{},...typeof z.button=="number"?{button:z.button}:{},...F?{source:F}:{}})},sv=w=>{let D=w,{screen:z,hitPoint:V,hitMesh:G,source:L,hit:F}=_n(D);h.hoverDwell&&G!==void 0&&G===ut&&(xn=!0),h.clicks&&K.emit({type:"pointer_click",screen:z,...V?{hitPoint:V}:{},...G?{hitMesh:G}:{},...typeof D.button=="number"?{button:D.button}:{},...L?{source:L}:{}}),h.meshPicks&&F&&K.emit({type:"mesh_interaction",mesh:F.name,kind:"pick",...V?{point:V}:{},...L?{source:L}:{}})};if((h.pointerMove||h.hoverDwell)&&Ke("pointermove",cv),(h.buttons||h.hoverDwell)&&Ke("pointerdown",w=>Xd("pointer_down",w)),h.buttons&&Ke("pointerup",w=>Xd("pointer_up",w)),(h.clicks||h.meshPicks||h.hoverDwell)&&Ke("click",sv),h.cameraGesture){let w=z=>{na={sample:Fd(),ts:K.now(),source:Gg(z)}},D=()=>{let z=na;na=null,z&&be({channel:"gesture",start:z.sample,end:Fd(),durationMs:Math.max(0,Math.round(K.now()-z.ts)),options:{sensitivity:l},...z.source?{source:z.source}:{}})};Ke("pointerdown",w),Ke("pointerup",D)}h.hoverDwell&&bn.push(()=>Kd(K.now())),h.contextLoss&&(Ke("webglcontextlost",()=>K.emit({type:"context_lost"})),Ke("webglcontextrestored",()=>K.emit({type:"context_restored"})));let lt=ye.assets;if(h.assetLoad&<){let w=new Map,D=L=>L.id??L,z=L=>{w.set(D(L),K.now())},V=L=>{let F=L,J=D(F),te=w.get(J);if(te===void 0)return;w.delete(J);let _e={type:"asset_load",name:(F.name??"asset").slice(0,n_),loadMs:Math.max(0,Math.round(K.now()-te))},Ze=F.file?.size;typeof Ze=="number"&&Ze>0&&(_e.bytes=Ze),K.emit(_e)},G=(...L)=>{let F=L[1];F&&w.delete(D(F))};lt.on("load:start",z),lt.on("load",V),lt.on("error",G),bn.push(()=>{lt.off("load:start",z),lt.off("load",V),lt.off("error",G),w.clear()})}if(h.resourceSample){let w=()=>{let D={},z=ye.stats?.frame?.triangles;typeof z=="number"&&z>0&&(D.triangles=Math.round(z));let V=globalThis.performance?.memory;V&&typeof V.usedJSHeapSize=="number"&&V.usedJSHeapSize>0&&(D.jsHeapBytes=V.usedJSHeapSize),Object.keys(D).length!==0&&K.emit({type:"resource_sample",...D})};$n.push(setInterval(w,br))}if(h.keyboard&&typeof window<"u"){let w=window,D=G=>L=>{let F=L,J=F.code;if(!J||G&&F.repeat)return;let te=x[J];te&&K.trackInput(te,{source:"keyboard",code:J,pressed:G})},z=D(!0),V=D(!1);w.addEventListener("keydown",z),w.addEventListener("keyup",V),yn.push({target:w,type:"keydown",handler:z}),yn.push({target:w,type:"keyup",handler:V})}return{stop(){for(let w of bn)w();bn.length=0,Md=!0;for(let w of $n)clearInterval(w);$n.length=0,xr&&(ye.off("frameend",Jd),xr=!1),_r.length=0;for(let w of yn)w.target.removeEventListener(w.type,w.handler);yn.length=0}}}}}function Go(e){return e.isWebGPU===!0}function qg(e){let n=e.maxTextureSize;return typeof n=="number"?n:void 0}function Bo(e){let n=e;return n.isWebGPU?!1:n.isWebGL2!==!1}function Wo(e){let i=e.gl;if(!i)return{};let o=i,t={};try{let r=typeof o.getExtension=="function"?o.getExtension("WEBGL_debug_renderer_info"):null,a=r?r.UNMASKED_VENDOR_WEBGL:o.VENDOR,c=r?r.UNMASKED_RENDERER_WEBGL:o.RENDERER,s=o.getParameter(a),u=o.getParameter(c),l=o.getParameter(o.VERSION);typeof s=="string"&&s&&(t.vendor=s),typeof u=="string"&&u&&(t.renderer=u),typeof l=="string"&&l&&(t.version=l)}catch{}return t}function Ko(e){let n=e.graphicsDevice,i=Wo(n),o=typeof navigator<"u"?navigator:void 0,r={engine:Go(n)?"webgpu":Bo(n)?"webgl2":"webgl"};i.vendor&&(r.vendor=i.vendor),i.renderer&&(r.renderer=i.renderer);let a=qg(n);return typeof a=="number"&&(r.maxTextureSize=a),typeof o?.hardwareConcurrency=="number"&&(r.hardwareConcurrency=o.hardwareConcurrency),typeof o?.deviceMemory=="number"&&(r.deviceMemoryGb=o.deviceMemory),o?.userAgent&&(r.isMobile=/Mobi|Android|iPhone|iPad/i.test(o.userAgent)),r}function m_(e){if(e){if(/Direct3D11|D3D11/i.test(e))return"d3d11";if(/Direct3D12|D3D12/i.test(e))return"d3d12";if(/Metal/i.test(e))return"metal";if(/Vulkan/i.test(e))return"vulkan";if(/OpenGL ES/i.test(e))return"opengles";if(/OpenGL/i.test(e))return"opengl"}}function Xo(e){let n=e.graphicsDevice,i=Go(n),o=Wo(n),a={api:i?"webgpu":Bo(n)?"webgl2":"webgl",shadingLanguage:i?"wgsl":"glsl-es"},c=i?void 0:m_(o.renderer);return c&&(a.backend=c),o.version&&(a.apiVersion=o.version),a}var qo=aa("playcanvas");function Ho(){let e={name:"playcanvas",coordinateSystem:{handedness:"right",upAxis:"y",unitScale:1}};return typeof qo.version=="string"&&qo.version&&(e.version=qo.version),e}var Yo=aa("playcanvas");function Cd(e){let i=e?.camera?.projection;return i===Yo.PROJECTION_PERSPECTIVE?"free":i===Yo.PROJECTION_ORTHOGRAPHIC?"static":"other"}function Qo(e,n){let i={},o=n;o&&(i.cameraType=Cd(n),typeof o.name=="string"&&o.name&&(i.cameraName=o.name));let t=e.root;if(t&&typeof t.forEach=="function"){let r=0;t.forEach(a=>{let c=a,s=c.render?.meshInstances?.length??0,u=c.model?.meshInstances?.length??0;r+=s+u}),i.meshCount=r}return i}function Hg(e,n,i){let o=new vr({projectId:i.projectId,endpoint:i.endpoint,flushIntervalMs:i.flushIntervalMs,transport:i.transport,disabled:i.disabled,debug:i.debug});o.use(Jo({app:e,camera:n,sampleCameraMs:i.sampleCameraMs,samplePerfMs:i.samplePerfMs,pointerMoveThrottleMs:i.pointerMoveThrottleMs,suppressIdleSamples:i.suppressIdleSamples,suppressIdlePerfSamples:i.suppressIdlePerfSamples,cameraEpsilon:i.cameraEpsilon,perfFpsThreshold:i.perfFpsThreshold,capture:i.capture,...i.gaze?{gaze:i.gaze}:{},...i.sampling?{sampling:i.sampling}:{},...i.actors?{actors:i.actors}:{},...i.keyBindings?{keyBindings:i.keyBindings}:{}}));let t={...Qo(e,n),...i.sceneDescription?{description:i.sceneDescription}:{},...i.cameraType?{cameraType:i.cameraType}:{}};return o.start({device:Ko(e),graphics:Xo(e),connector:Ho(),scene:t,...i.user?{user:i.user}:{},...i.meta}),o}function p_(e,n){let i=[],o=e;for(;o&&o!==n;){let t=typeof o.name=="string"?o.name:"";if(!t)return;i.unshift(t),o=o.parent}return i.length>0?i.join("/"):void 0}function g_(e){let n=e.getPosition?.(),i=e.getRotation?.(),o=e.getWorldTransform?.()?.getScale?.();if(!(!n||!i||!o))return{position:Je([n.x,n.y,n.z],"right"),rotation:vn([i.x,i.y,i.z,i.w??1],"right"),scale:[o.x,o.y,o.z]}}var v_="uptimizr-";function Oe(e){return Math.round(e*1e4)/1e4}function h_(e){let n=2166136261;for(let i=0;i<e.length;i++)n^=e.charCodeAt(i),n=Math.imul(n,16777619);return(n>>>0).toString(16).padStart(8,"0")}function Yg(e){return Math.abs((e[3]-e[0])*(e[4]-e[1])*(e[5]-e[2]))}function Zd(e){return e.render?.meshInstances??e.model?.meshInstances??[]}function $_(e){let i=Zd(e);if(i.length===0)return;let o=1/0,t=1/0,r=1/0,a=-1/0,c=-1/0,s=-1/0,u=!1;for(let l of i){let d=l.aabb;if(!d||typeof d.getMin!="function"||typeof d.getMax!="function")continue;let f=d.getMin(),m=d.getMax();u=!0,f.x<o&&(o=f.x),f.y<t&&(t=f.y),f.z<r&&(r=f.z),m.x>a&&(a=m.x),m.y>c&&(c=m.y),m.z>s&&(s=m.z)}if(u)return[o,t,r,a,c,s]}function y_(e){let n=e,i=0;for(let o of Zd(n)){let t=o.mesh?.primitive;if(t)for(let r of t)typeof r.count=="number"&&r.count>0&&(i+=Math.floor(r.count/3))}return i}function Qg(e,n){let i=n.boundsOf??$_,o=n.trianglesOf??y_,t=[],r=1/0,a=1/0,c=1/0,s=-1/0,u=-1/0,l=-1/0,d=0,f=e.root;f&&typeof f.forEach=="function"&&f.forEach(I=>{let h=I;if(h.enabled===!1||Zd(h).length===0)return;let P=typeof h.name=="string"?h.name:"";if(P.startsWith(v_)||n.includeMesh&&!n.includeMesh(P))return;let A=i(h);if(!A)return;let U=Ed(A,"right");d++;let j=[Oe(U[0]),Oe(U[1]),Oe(U[2]),Oe(U[3]),Oe(U[4]),Oe(U[5])],O={name:P,aabb:j},Y=o(h);Y>0&&(O.triangles=Y);let ce=p_(h,f),se=g_(h);ce&&se&&(O.path=ce,O.world=se),t.push(O),r=Math.min(r,U[0]),a=Math.min(a,U[1]),c=Math.min(c,U[2]),s=Math.max(s,U[3]),u=Math.max(u,U[4]),l=Math.max(l,U[5])});let m=t;typeof n.maxMeshes=="number"&&n.maxMeshes>=0&&t.length>n.maxMeshes&&(m=[...t].sort((I,h)=>Yg(h.aabb)-Yg(I.aabb)).slice(0,n.maxMeshes));let v=d===0?[0,0,0,0,0,0]:[Oe(r),Oe(a),Oe(c),Oe(s),Oe(u),Oe(l)],y=JSON.stringify({v:mr,kind:"aabb",bounds:v,meshes:[...m].sort((I,h)=>I.name<h.name?-1:I.name>h.name?1:0).map(I=>I.path&&I.world?[I.name,I.aabb,I.path,I.world.position,I.world.rotation,I.world.scale]:[I.name,I.aabb])}),x={version:mr,sceneId:n.sceneId,kind:"aabb",bounds:v,upAxis:n.upAxis??"y",handedness:"right",unitScale:n.unitScale??1,meshes:m,meshCount:d,contentHash:h_(y),capturedAt:(n.now??Date.now)(),sdkVersion:n.sdkVersion??gr};return jd.parse(x)}return pv(b_);})();
|