@learncard/learn-cloud-plugin 2.2.8 → 2.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/learn-cloud-plugin.cjs.development.js +10 -6
- package/dist/learn-cloud-plugin.cjs.development.js.map +2 -2
- package/dist/learn-cloud-plugin.cjs.production.min.js +1 -1
- package/dist/learn-cloud-plugin.cjs.production.min.js.map +2 -2
- package/dist/learn-cloud-plugin.esm.js +10 -6
- package/dist/learn-cloud-plugin.esm.js.map +2 -2
- package/package.json +7 -7
|
@@ -21,7 +21,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
21
21
|
`+new Array(O+1).join(c):"",Z=c?": ":":";if(j=mE(j),j=p.call(V,q,j),j!==void 0){if(!uE(j)||j===null)return g(j);if(dE(j)){let A=[];for(let X=0;X<j.length;X++){let K=T(j,X,j[X],O+1)||g(null);A.push(R+c+K)}return"["+A.join(",")+R+"]"}else{if(d){if(E.indexOf(j)!==-1)return g("[Circular]");E.push(j)}let A=hE(j).sort(y&&y(j)),X=[];for(let K=0;K<A.length;K++){let ne=A[K],ke=T(j,ne,j[ne],O+1);if(!ke)continue;let xe=g(ne)+Z+ke;X.push(R+c+xe)}return E.splice(E.indexOf(j),1),"{"+X.join(",")+R+"}"}}},"_deterministic")({"":n},"",n,0)}l(gE,"stringifyDeterministic");Sh.exports=gE});var bE={};Gb(bE,{getLearnCloudPlugin:()=>vE});module.exports=Jb(bE);var Oh=ip(ap());function rt(n){let r={subscribe(c){let d=null,p=!1,g=!1,y=!1;function E(){if(d===null){y=!0;return}g||(g=!0,typeof d=="function"?d():d&&d.unsubscribe())}return l(E,"unsubscribe"),d=n({next(T){p||c.next?.(T)},error(T){p||(p=!0,c.error?.(T),E())},complete(){p||(p=!0,c.complete?.(),E())}}),y&&E(),{unsubscribe:E}},pipe(...c){return c.reduce(Qb,r)}};return r}l(rt,"observable");function Qb(n,r){return r(n)}l(Qb,"pipeReducer");function Mu(n){let r=new AbortController;return new Promise((d,p)=>{let g=!1;function y(){g||(g=!0,E.unsubscribe())}l(y,"onDone"),r.signal.addEventListener("abort",()=>{p(r.signal.reason)});let E=n.subscribe({next(T){g=!0,d(T),y()},error(T){p(T)},complete(){r.abort(),y()}})})}l(Mu,"observableToPromise");function Uu(n){return r=>{let c=0,d=null,p=[];function g(){d||(d=r.subscribe({next(E){for(let T of p)T.next?.(E)},error(E){for(let T of p)T.error?.(E)},complete(){for(let E of p)E.complete?.()}}))}l(g,"startIfNeeded");function y(){if(c===0&&d){let E=d;d=null,E.unsubscribe()}}return l(y,"resetIfNeeded"),rt(E=>(c++,p.push(E),g(),{unsubscribe(){c--,y();let T=p.findIndex(V=>V===E);T>-1&&p.splice(T,1)}}))}}l(Uu,"share");var EE=Symbol();function Ua(n){let r=n,c=[],d=l(y=>{r!==void 0&&y.next(r),c.push(y)},"addObserver"),p=l(y=>{c.splice(c.indexOf(y),1)},"removeObserver"),g=rt(y=>(d(y),()=>{p(y)}));return g.next=y=>{if(r!==y){r=y;for(let E of c)E.next(y)}},g.get=()=>r,g}l(Ua,"behaviorSubject");function Bu(n){return rt(r=>{function c(p=0,g=n.op){let y=n.links[p];if(!y)throw new Error("No more links to execute - did you forget to add an ending link?");return y({op:g,next(T){return c(p+1,T)}})}return l(c,"execute"),c().subscribe(r)})}l(Bu,"createChain");var sp=l(()=>{},"noop"),op=l(n=>{Object.freeze&&Object.freeze(n)},"freezeIfAvailable");function lp(n,r,c){var d,p;let g=r.join(".");return(d=c)[p=g]??(d[p]=new Proxy(sp,{get(y,E){if(!(typeof E!="string"||E==="then"))return lp(n,[...r,E],c)},apply(y,E,T){let V=r[r.length-1],q={args:T,path:r};return V==="call"?q={args:T.length>=2?[T[1]]:[],path:r.slice(0,-1)}:V==="apply"&&(q={args:T.length>=2?T[1]:[],path:r.slice(0,-1)}),op(q.args),op(q.path),n(q)}})),c[g]}l(lp,"createInnerProxy");var Ba=l(n=>lp(n,[],Object.create(null)),"createRecursiveProxy"),Al=l(n=>new Proxy(sp,{get(r,c){if(c!=="then")return n(c)}}),"createFlatProxy");var Wn=l(({shape:n})=>n,"defaultFormatter");var Hn={PARSE_ERROR:-32700,BAD_REQUEST:-32600,INTERNAL_SERVER_ERROR:-32603,NOT_IMPLEMENTED:-32603,BAD_GATEWAY:-32603,SERVICE_UNAVAILABLE:-32603,GATEWAY_TIMEOUT:-32603,UNAUTHORIZED:-32001,PAYMENT_REQUIRED:-32002,FORBIDDEN:-32003,NOT_FOUND:-32004,METHOD_NOT_SUPPORTED:-32005,TIMEOUT:-32008,CONFLICT:-32009,PRECONDITION_FAILED:-32012,PAYLOAD_TOO_LARGE:-32013,UNSUPPORTED_MEDIA_TYPE:-32015,UNPROCESSABLE_CONTENT:-32022,TOO_MANY_REQUESTS:-32029,CLIENT_CLOSED_REQUEST:-32099};var Fu=[Hn.BAD_GATEWAY,Hn.SERVICE_UNAVAILABLE,Hn.GATEWAY_TIMEOUT,Hn.INTERNAL_SERVER_ERROR];var cp=Symbol();function qo(n,...r){let c=Object.assign(Object.create(null),n);for(let d of r)for(let p in d){if(p in c&&c[p]!==d[p])throw new Error(`Duplicate key ${p}`);c[p]=d[p]}return c}l(qo,"mergeWithoutOverrides");function Ze(n){return!!n&&!Array.isArray(n)&&typeof n=="object"}l(Ze,"isObject");function Ol(n){return typeof n=="function"}l(Ol,"isFunction");function $o(n){return Object.assign(Object.create(null),n)}l($o,"omitPrototype");function dp(n,r,c){return r in n?Object.defineProperty(n,r,{value:c,enumerable:!0,configurable:!0,writable:!0}):n[r]=c,n}l(dp,"_define_property");var Il=class extends Error{};l(Il,"UnknownCauseError");function fp(n){if(n instanceof Error)return n;let r=typeof n;if(!(r==="undefined"||r==="function"||n===null)){if(r!=="object")return new Error(String(n));if(Ze(n))return Object.assign(new Il,n)}}l(fp,"getCauseFromUnknown");function pn(n){if(n instanceof at||n instanceof Error&&n.name==="TRPCError")return n;let r=new at({code:"INTERNAL_SERVER_ERROR",cause:n});return n instanceof Error&&n.stack&&(r.stack=n.stack),r}l(pn,"getTRPCErrorFromUnknown");var at=class extends Error{constructor(r){let c=fp(r.cause),d=r.message??c?.message??r.code;super(d,{cause:c}),dp(this,"cause",void 0),dp(this,"code",void 0),this.code=r.code,this.name="TRPCError",this.cause??(this.cause=c)}};l(at,"TRPCError");function Zu(n){return"input"in n?n:{input:n,output:n}}l(Zu,"getDataTransformer");var Gn={input:{serialize:n=>n,deserialize:n=>n},output:{serialize:n=>n,deserialize:n=>n}};function t_(n,r){if("error"in n){let d=r.deserialize(n.error);return{ok:!1,error:{...n,error:d}}}let c={...n.result,...(!n.result.type||n.result.type==="data")&&{type:"data",data:r.deserialize(n.result.data)}};return{ok:!0,result:c}}l(t_,"transformResultInner");var Fa=class extends Error{constructor(){super("Unable to transform response from server")}};l(Fa,"TransformResultError");function zo(n,r){let c;try{c=t_(n,r)}catch{throw new Fa}if(!c.ok&&(!Ze(c.error.error)||typeof c.error.error.code!="number"))throw new Fa;if(c.ok&&!Ze(c.result))throw new Fa;return c}l(zo,"transformResult");var r_=Symbol("lazy");function n_(n){let r=Symbol(),c=r;return()=>(c===r&&(c=n()),c)}l(n_,"once");function i_(n){return typeof n=="function"&&r_ in n}l(i_,"isLazy");function a_(n){return Ze(n)&&Ze(n._def)&&"router"in n._def}l(a_,"isRouter");var o_={_ctx:null,_errorShape:null,_meta:null,queries:{},mutations:{},subscriptions:{},errorFormatter:Wn,transformer:Gn},s_=["then","call","apply"];function Pl(n){function r(c){let d=new Set(Object.keys(c).filter(j=>s_.includes(j)));if(d.size>0)throw new Error("Reserved words used in `router({})` call: "+Array.from(d).join(", "));let p=$o({}),g=$o({});function y(j){return{ref:j.ref,load:n_(async()=>{let O=await j.ref(),R=[...j.path,j.key],Z=R.join(".");j.aggregate[j.key]=E(O._def.record,R),delete g[Z];for(let[A,X]of Object.entries(O._def.lazy)){let K=[...R,A].join(".");g[K]=y({ref:X.ref,path:R,key:A,aggregate:j.aggregate[j.key]})}})}}l(y,"createLazyLoader");function E(j,O=[]){let R=$o({});for(let[Z,A]of Object.entries(j??{})){if(i_(A)){g[[...O,Z].join(".")]=y({path:O,ref:A,key:Z,aggregate:R});continue}if(a_(A)){R[Z]=E(A._def.record,[...O,Z]);continue}if(!l_(A)){R[Z]=E(A,[...O,Z]);continue}let X=[...O,Z].join(".");if(p[X])throw new Error(`Duplicate key: ${X}`);p[X]=A,R[Z]=A}return R}l(E,"step");let T=E(c),V={_config:n,router:!0,procedures:p,lazy:g,...o_,record:T};return{...T,_def:V,createCaller:Vl()({_def:V})}}return l(r,"createRouterInner"),r}l(Pl,"createRouterFactory");function l_(n){return typeof n=="function"}l(l_,"isProcedure");async function qu(n,r){let{_def:c}=n,d=c.procedures[r];for(;!d;){let p=Object.keys(c.lazy).find(y=>r.startsWith(y));if(!p)return null;await c.lazy[p].load(),d=c.procedures[r]}return d}l(qu,"getProcedureAtPath");function Vl(){return l(function(r){let{_def:c}=r;return l(function(p,g){return Ba(async({path:y,args:E})=>{let T=y.join(".");if(y.length===1&&y[0]==="_def")return c;let V=await qu(r,T),q;try{if(!V)throw new at({code:"NOT_FOUND",message:`No procedure found on path "${y}"`});return q=Ol(p)?await Promise.resolve(p()):p,await V({path:T,getRawInput:async()=>E[0],ctx:q,type:V._def.type,signal:g?.signal})}catch(j){throw g?.onError?.({ctx:q,error:pn(j),input:E[0],path:T,type:V?._def.type??"unknown"}),j}})},"createCaller")},"createCallerInner")}l(Vl,"createCallerFactory");function $u(...n){let r=qo({},...n.map(g=>g._def.record)),c=n.reduce((g,y)=>{if(y._def._config.errorFormatter&&y._def._config.errorFormatter!==Wn){if(g!==Wn&&g!==y._def._config.errorFormatter)throw new Error("You seem to have several error formatters");return y._def._config.errorFormatter}return g},Wn),d=n.reduce((g,y)=>{if(y._def._config.transformer&&y._def._config.transformer!==Gn){if(g!==Gn&&g!==y._def._config.transformer)throw new Error("You seem to have several transformers");return y._def._config.transformer}return g},Gn);return Pl({errorFormatter:c,transformer:d,isDev:n.every(g=>g._def._config.isDev),allowOutsideOfServer:n.every(g=>g._def._config.allowOutsideOfServer),isServer:n.every(g=>g._def._config.isServer),$types:n[0]?._def._config.$types})(r)}l($u,"mergeRouters");var u_;u_=Symbol.toStringTag;var pp,hp;(pp=Symbol).dispose??(pp.dispose=Symbol());(hp=Symbol).asyncDispose??(hp.asyncDispose=Symbol());var Wu=Symbol();var yp=Symbol("ping");var FC=Symbol();var jl="middlewareMarker";function Ku(){function n(c){return{_middlewares:c,unstable_pipe(d){let p="_middlewares"in d?d._middlewares:[d];return n([...c,...p])}}}l(n,"createMiddlewareInner");function r(c){return n([c])}return l(r,"createMiddleware"),r}l(Ku,"createMiddlewareFactory");function Xu(n){let r=l(async function(d){let p,g=await d.getRawInput();try{p=await n(g)}catch(E){throw new at({code:"BAD_REQUEST",cause:E})}let y=Ze(d.input)&&Ze(p)?{...d.input,...p}:p;return d.next({input:y})},"inputValidatorMiddleware");return r._type="input",r}l(Xu,"createInputMiddleware");function ed(n){let r=l(async function({next:d}){let p=await d();if(!p.ok)return p;try{let g=await n(p.data);return{...p,data:g}}catch(g){throw new at({message:"Output validation failed",code:"INTERNAL_SERVER_ERROR",cause:g})}},"outputValidatorMiddleware");return r._type="output",r}l(ed,"createOutputMiddleware");function E_(n,r,c){return r in n?Object.defineProperty(n,r,{value:c,enumerable:!0,configurable:!0,writable:!0}):n[r]=c,n}l(E_,"_define_property");var Fi=class extends Error{constructor(r){super(r[0]?.message),E_(this,"issues",void 0),this.name="SchemaError",this.issues=r}};l(Fi,"StandardSchemaV1Error");function Dl(n){let r=n,c="~standard"in r;if(typeof r=="function"&&typeof r.assert=="function")return r.assert.bind(r);if(typeof r=="function"&&!c)return r;if(typeof r.parseAsync=="function")return r.parseAsync.bind(r);if(typeof r.parse=="function")return r.parse.bind(r);if(typeof r.validateSync=="function")return r.validateSync.bind(r);if(typeof r.create=="function")return r.create.bind(r);if(typeof r.assert=="function")return d=>(r.assert(d),d);if(c)return async d=>{let p=await r["~standard"].validate(d);if(p.issues)throw new Fi(p.issues);return p.value};throw new Error("Could not find a validator fn")}l(Dl,"getParseFn");function Jn(n,r){let{middlewares:c=[],inputs:d,meta:p,...g}=r;return Ll({...qo(n,g),inputs:[...n.inputs,...d??[]],middlewares:[...n.middlewares,...c],meta:n.meta&&p?{...n.meta,...p}:p??n.meta})}l(Jn,"createNewBuilder");function Ll(n={}){let r={procedure:!0,inputs:[],middlewares:[],...n};return{_def:r,input(d){let p=Dl(d);return Jn(r,{inputs:[d],middlewares:[Xu(p)]})},output(d){let p=Dl(d);return Jn(r,{output:d,middlewares:[ed(p)]})},meta(d){return Jn(r,{meta:d})},use(d){let p="_middlewares"in d?d._middlewares:[d];return Jn(r,{middlewares:p})},unstable_concat(d){return Jn(r,d._def)},concat(d){return Jn(r,d._def)},query(d){return td({...r,type:"query"},d)},mutation(d){return td({...r,type:"mutation"},d)},subscription(d){return td({...r,type:"subscription"},d)},experimental_caller(d){return Jn(r,{caller:d})}}}l(Ll,"createBuilder");function td(n,r){let c=Jn(n,{resolver:r,middlewares:[l(async function(T){let V=await r(T);return{marker:jl,ok:!0,data:V,ctx:T.ctx}},"resolveMiddleware")]}),d={...c._def,type:n.type,experimental_caller:Boolean(c._def.caller),meta:c._def.meta,$types:null},p=S_(c._def),g=c._def.caller;if(!g)return p;let y=l(async(...E)=>await g({args:E,invoke:p,_def:d}),"callerWrapper");return y._def=d,y}l(td,"createResolver");var C_=`
|
|
22
22
|
This is a client-only function.
|
|
23
23
|
If you want to call this function on the server, see https://trpc.io/docs/v11/server/server-side-calls
|
|
24
|
-
`.trim();async function _p(n,r,c){try{let d=r.middlewares[n];return await d({...c,meta:r.meta,input:c.input,next(g){let y=g;return _p(n+1,r,{...c,ctx:y?.ctx?{...c.ctx,...y.ctx}:c.ctx,input:y&&"input"in y?y.input:c.input,getRawInput:y?.getRawInput??c.getRawInput})}})}catch(d){return{ok:!1,error:pn(d),marker:jl}}}l(_p,"callRecursive");function S_(n){async function r(c){if(!c||!("getRawInput"in c))throw new Error(C_);let d=await _p(0,n,c);if(!d)throw new at({code:"INTERNAL_SERVER_ERROR",message:"No result from middlewares - did you forget to `return next()`?"});if(!d.ok)throw d.error;return d.data}return l(r,"procedure"),r._def=n,r.procedure=!0,r.meta=n.meta,r}l(S_,"createProcedureCaller");var Ml=typeof window>"u"||"Deno"in window||globalThis.process?.env?.NODE_ENV==="test"||!!globalThis.process?.env?.JEST_WORKER_ID||!!globalThis.process?.env?.VITEST_WORKER_ID;var Zi=class{context(){return new Zi}meta(){return new Zi}create(r){let c={...r,transformer:Zu(r?.transformer??Gn),isDev:r?.isDev??globalThis.process?.env.NODE_ENV!=="production",allowOutsideOfServer:r?.allowOutsideOfServer??!1,errorFormatter:r?.errorFormatter??Wn,isServer:r?.isServer??Ml,$types:null};if(!(r?.isServer??Ml)&&r?.allowOutsideOfServer!==!0)throw new Error("You're trying to use @trpc/server in a non-server environment. This is not supported by default.");return{_config:c,procedure:Ll({meta:r?.defaultMeta}),middleware:Ku(),router:Pl(c),mergeRouters:$u,createCallerFactory:Vl()}}};l(Zi,"TRPCBuilder");var wp=new Zi;function Ul(n,r,c){return r in n?Object.defineProperty(n,r,{value:c,enumerable:!0,configurable:!0,writable:!0}):n[r]=c,n}l(Ul,"_define_property");function rd(n){return n instanceof Ye}l(rd,"isTRPCClientError");function V_(n){return Ze(n)&&Ze(n.error)&&typeof n.error.code=="number"&&typeof n.error.message=="string"}l(V_,"isTRPCErrorResponse");function N_(n,r){return typeof n=="string"?n:Ze(n)&&typeof n.message=="string"?n.message:r}l(N_,"getMessageFromUnknownError");var Ye=class extends Error{static from(r,c={}){let d=r;return rd(d)?(c.meta&&(d.meta={...d.meta,...c.meta}),d):V_(d)?new Ye(d.error.message,{...c,result:d}):new Ye(N_(d,"Unknown error"),{...c,cause:d})}constructor(r,c){let d=c?.cause;super(r,{cause:d}),Ul(this,"cause",void 0),Ul(this,"shape",void 0),Ul(this,"data",void 0),Ul(this,"meta",void 0),this.meta=c?.meta,this.cause=d,this.shape=c?.result?.error,this.data=c?.result?.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,Ye.prototype)}};l(Ye,"TRPCClientError");function nd(n,r,c){return r in n?Object.defineProperty(n,r,{value:c,enumerable:!0,configurable:!0,writable:!0}):n[r]=c,n}l(nd,"_define_property");var qi=class{$request(r){return Bu({links:this.links,op:{...r,context:r.context??{},id:++this.requestId}}).pipe(Uu())}async requestAsPromise(r){try{let c=this.$request(r);return(await Mu(c)).result.data}catch(c){throw Ye.from(c)}}query(r,c,d){return this.requestAsPromise({type:"query",path:r,input:c,context:d?.context,signal:d?.signal})}mutation(r,c,d){return this.requestAsPromise({type:"mutation",path:r,input:c,context:d?.context,signal:d?.signal})}subscription(r,c,d){return this.$request({type:"subscription",path:r,input:c,context:d.context,signal:d.signal}).subscribe({next(g){switch(g.result.type){case"state":{d.onConnectionStateChange?.(g.result);break}case"started":{d.onStarted?.({context:g.context});break}case"stopped":{d.onStopped?.();break}case"data":case void 0:{d.onData?.(g.result.data);break}}},error(g){d.onError?.(g)},complete(){d.onComplete?.()}})}constructor(r){nd(this,"links",void 0),nd(this,"runtime",void 0),nd(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=r.links.map(c=>c(this.runtime))}};l(qi,"TRPCUntypedClient");var j_=Symbol.for("trpc_untypedClient"),D_={query:"query",mutate:"mutation",subscribe:"subscription"},Sp=l(n=>D_[n],"clientCallTypeToProcedureType");function Tp(n){let r=Ba(({path:c,args:d})=>{let p=[...c],g=Sp(p.pop()),y=p.join(".");return n[g](y,...d)});return Al(c=>c===j_?n:r[c])}l(Tp,"createTRPCClientProxy");function Wo(n){let r=new qi(n);return Tp(r)}l(Wo,"createTRPCClient");var Rp=l(n=>typeof n=="function","isFunction");function id(n){if(n)return n;if(typeof window<"u"&&Rp(window.fetch))return window.fetch;if(typeof globalThis<"u"&&Rp(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}l(id,"getFetch");var kp=l(()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")},"throwFatalError");function Bl(n){let r=null,c=null,d=l(()=>{clearTimeout(c),c=null,r=null},"destroyTimerAndPendingItems");function p(E){let T=[[]],V=0;for(;;){let q=E[V];if(!q)break;let j=T[T.length-1];if(q.aborted){q.reject?.(new Error("Aborted")),V++;continue}if(n.validate(j.concat(q).map(R=>R.key))){j.push(q),V++;continue}if(j.length===0){q.reject?.(new Error("Input is too big for a single dispatch")),V++;continue}T.push([])}return T}l(p,"groupItems");function g(){let E=p(r);d();for(let T of E){if(!T.length)continue;let V={items:T};for(let j of T)j.batch=V;n.fetch(V.items.map(j=>j.key)).then(async j=>{await Promise.all(j.map(async(O,R)=>{let Z=V.items[R];try{let A=await Promise.resolve(O);Z.resolve?.(A)}catch(A){Z.reject?.(A)}Z.batch=null,Z.reject=null,Z.resolve=null}));for(let O of V.items)O.reject?.(new Error("Missing result")),O.batch=null}).catch(j=>{for(let O of V.items)O.reject?.(j),O.batch=null})}}l(g,"dispatch");function y(E){let T={aborted:!1,key:E,batch:null,resolve:kp,reject:kp},V=new Promise((q,j)=>{T.reject=j,T.resolve=q,r??(r=[]),r.push(T)});return c??(c=setTimeout(g)),V}return l(y,"load"),{load:y}}l(Bl,"dataLoader");function ad(...n){let r=new AbortController,c=n.length,d=0,p=l(()=>{++d===c&&r.abort()},"onAbort");for(let g of n)g?.aborted?p():g?.addEventListener("abort",p,{once:!0});return r.signal}l(ad,"allAbortSignals");function Ho(n){let r=n;return r?"input"in r?r:{input:r,output:r}:{input:{serialize:c=>c,deserialize:c=>c},output:{serialize:c=>c,deserialize:c=>c}}}l(Ho,"getTransformer");function Zl(n){return{url:n.url.toString(),fetch:n.fetch,transformer:Ho(n.transformer),methodOverride:n.methodOverride}}l(Zl,"resolveHTTPLinkOptions");function L_(n){let r={};for(let c=0;c<n.length;c++){let d=n[c];r[c]=d}return r}l(L_,"arrayToDict");var M_={query:"GET",mutation:"POST",subscription:"PATCH"};function Ap(n){return"input"in n?n.transformer.input.serialize(n.input):L_(n.inputs.map(r=>n.transformer.input.serialize(r)))}l(Ap,"getInput");var qa=l(n=>{let r=n.url.split("?"),d=r[0].replace(/\/$/,"")+"/"+n.path,p=[];if(r[1]&&p.push(r[1]),"inputs"in n&&p.push("batch=1"),n.type==="query"||n.type==="subscription"){let g=Ap(n);g!==void 0&&n.methodOverride!=="POST"&&p.push(`input=${encodeURIComponent(JSON.stringify(g))}`)}return p.length&&(d+="?"+p.join("&")),d},"getUrl"),Op=l(n=>{if(n.type==="query"&&n.methodOverride!=="POST")return;let r=Ap(n);return r!==void 0?JSON.stringify(r):void 0},"getBody"),od=l(n=>Pp({...n,contentTypeHeader:"application/json",getUrl:qa,getBody:Op}),"jsonHttpRequester"),Fl=class extends Error{constructor(){let r="AbortError";super(r),this.name=r,this.message=r}};l(Fl,"AbortError");var U_=l(n=>{if(!!n?.aborted)throw n.throwIfAborted?.(),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new Fl},"throwIfAborted");async function Ip(n){U_(n.signal);let r=n.getUrl(n),c=n.getBody(n),{type:d}=n,p=await(async()=>{let y=await n.headers();return Symbol.iterator in y?Object.fromEntries(y):y})(),g={...n.contentTypeHeader?{"content-type":n.contentTypeHeader}:{},...n.trpcAcceptHeader?{"trpc-accept":n.trpcAcceptHeader}:void 0,...p};return id(n.fetch)(r,{method:n.methodOverride??M_[d],signal:n.signal,body:c,headers:g})}l(Ip,"fetchHTTPResponse");async function Pp(n){let r={},c=await Ip(n);r.response=c;let d=await c.json();return r.responseJSON=d,{json:d,meta:r}}l(Pp,"httpRequest");function ql(n){let r=Zl(n),c=n.maxURLLength??1/0,d=n.maxItems??1/0;return()=>{let p=l(T=>({validate(V){if(c===1/0&&d===1/0)return!0;if(V.length>d)return!1;let q=V.map(R=>R.path).join(","),j=V.map(R=>R.input);return qa({...r,type:T,path:q,inputs:j,signal:null}).length<=c},async fetch(V){let q=V.map(X=>X.path).join(","),j=V.map(X=>X.input),O=ad(...V.map(X=>X.signal)),R=await od({...r,path:q,inputs:j,type:T,headers(){return n.headers?typeof n.headers=="function"?n.headers({opList:V}):n.headers:{}},signal:O});return(Array.isArray(R.json)?R.json:V.map(()=>R.json)).map(X=>({meta:R.meta,json:X}))}}),"batchLoader"),g=Bl(p("query")),y=Bl(p("mutation")),E={query:g,mutation:y};return({op:T})=>rt(V=>{if(T.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");let j=E[T.type].load(T),O;return j.then(R=>{O=R;let Z=zo(R.json,r.transformer.output);if(!Z.ok){V.error(Ye.from(Z.error,{meta:R.meta}));return}V.next({context:R.meta,result:Z.result}),V.complete()}).catch(R=>{V.error(Ye.from(R,{meta:O?.meta}))}),()=>{}})}}l(ql,"httpBatchLink");var $l=l((n,...r)=>typeof n=="function"?n(...r):n,"resultOf");function sd(){let n,r;return{promise:new Promise((d,p)=>{n=d,r=p}),resolve:n,reject:r}}l(sd,"withResolvers");async function Np(n){let r=await $l(n.url);if(!n.connectionParams)return r;let d=`${r.includes("?")?"&":"?"}connectionParams=1`;return r+d}l(Np,"prepareUrl");async function jp(n){let r={method:"connectionParams",data:await $l(n)};return JSON.stringify(r)}l(jp,"buildConnectionMessage");function $i(n,r,c){return r in n?Object.defineProperty(n,r,{value:c,enumerable:!0,configurable:!0,writable:!0}):n[r]=c,n}l($i,"_define_property");function Z_(n){let{promise:r,resolve:c,reject:d}=sd();return n.addEventListener("open",()=>{n.removeEventListener("error",d),c()}),n.addEventListener("error",d),r}l(Z_,"asyncWsOpen");function q_(n,{intervalMs:r,pongTimeoutMs:c}){let d,p;function g(){d=setTimeout(()=>{n.send("PING"),p=setTimeout(()=>{n.close()},c)},r)}l(g,"start");function y(){clearTimeout(d),g()}l(y,"reset");function E(){clearTimeout(p),y()}l(E,"pong"),n.addEventListener("open",g),n.addEventListener("message",({data:T})=>{clearTimeout(d),g(),T==="PONG"&&E()}),n.addEventListener("close",()=>{clearTimeout(d),clearTimeout(p)})}l(q_,"setupPingInterval");var Qn=class{get ws(){return this.wsObservable.get()}set ws(r){this.wsObservable.next(r)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){if(this.openPromise)return this.openPromise;this.id=++Qn.connectCount;let r=Np(this.urlOptions).then(c=>new this.WebSocketPonyfill(c));this.openPromise=r.then(async c=>{this.ws=c,c.addEventListener("message",function({data:d}){d==="PING"&&this.send("PONG")}),this.keepAliveOpts.enabled&&q_(c,this.keepAliveOpts),c.addEventListener("close",()=>{this.ws===c&&(this.ws=null)}),await Z_(c),this.urlOptions.connectionParams&&c.send(await jp(this.urlOptions.connectionParams))});try{await this.openPromise}finally{this.openPromise=null}}async close(){try{await this.openPromise}finally{this.ws?.close()}}constructor(r){if($i(this,"id",++Qn.connectCount),$i(this,"WebSocketPonyfill",void 0),$i(this,"urlOptions",void 0),$i(this,"keepAliveOpts",void 0),$i(this,"wsObservable",Ua(null)),$i(this,"openPromise",null),this.WebSocketPonyfill=r.WebSocketPonyfill??WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=r.urlOptions,this.keepAliveOpts=r.keepAlive}};l(Qn,"WsConnection");$i(Qn,"connectCount",0);function z_(n){return n}l(z_,"identity");function W_(n){return n.length===0?z_:n.length===1?n[0]:l(function(c){return n.reduce((d,p)=>p(d),c)},"piped")}l(W_,"pipeFromArray");function ld(n){let r={subscribe(c){let d=null,p=!1,g=!1,y=!1;function E(){if(d===null){y=!0;return}g||(g=!0,typeof d=="function"?d():d&&d.unsubscribe())}return l(E,"unsubscribe"),d=n({next(T){p||c.next?.(T)},error(T){p||(p=!0,c.error?.(T),E())},complete(){p||(p=!0,c.complete?.(),E())}}),y&&E(),{unsubscribe:E}},pipe(...c){return W_(c)(r)}};return r}l(ld,"observable");var H_=Object.defineProperty,zl=l((n,r)=>H_(n,"name",{value:r,configurable:!0}),"__name"),G_=zl(n=>()=>({next:r,op:c})=>ld(d=>{let p=null,g=0,y=!1,E=zl(()=>{g+=1,p?.unsubscribe(),p=r(c).subscribe({error:async T=>{if(g>5||T.data?.httpStatus!==401)return d.error(T);await n(),E()},next:T=>d.next(T),complete:()=>{y&&d.complete()}})},"attempt");return E(),()=>{y=!0,p?.unsubscribe()}}),"callbackLink"),Lp=zl(async(n,r)=>{let c=[],d=Wo({links:[ql({methodOverride:"POST",url:n,maxURLLength:3072,maxItems:50,headers:{Authorization:`Bearer ${await r()}`}})]}),p=zl(async(y=95+Math.round((Math.random()-.5)*5))=>d.utilities.getChallenges.query({amount:y}),"getChallenges");return p().then(y=>c=y),Wo({links:[G_(async()=>{c=await p()}),ql({methodOverride:"POST",url:n,maxItems:50,maxURLLength:3072,headers:async()=>(c.length===0&&c.push(...await p()),{Authorization:`Bearer ${await r(c.pop())}`})})]})},"getClient");var J_=Object.create,cd=Object.defineProperty,Q_=Object.getOwnPropertyDescriptor,Mp=Object.getOwnPropertyNames,Y_=Object.getPrototypeOf,K_=Object.prototype.hasOwnProperty,Y=l((n,r)=>cd(n,"name",{value:r,configurable:!0}),"__name"),Up=l((n,r)=>l(function(){return r||(0,n[Mp(n)[0]])((r={exports:{}}).exports,r),r.exports},"__require"),"__commonJS"),X_=l((n,r,c,d)=>{if(r&&typeof r=="object"||typeof r=="function")for(let p of Mp(r))!K_.call(n,p)&&p!==c&&cd(n,p,{get:()=>r[p],enumerable:!(d=Q_(r,p))||d.enumerable});return n},"__copyProps"),ew=l((n,r,c)=>(c=n!=null?J_(Y_(n)):{},X_(r||!n||!n.__esModule?cd(c,"default",{value:n,enumerable:!0}):c,n)),"__toESM"),tw=Up({"../learn-card-types/dist/types.cjs.development.js"(n,r){"use strict";var c=Object.defineProperty,d=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,y=Y((i,f)=>c(i,"name",{value:f,configurable:!0}),"__name"),E=Y((i,f)=>{for(var m in f)c(i,m,{get:f[m],enumerable:!0})},"__export"),T=Y((i,f,m,w)=>{if(f&&typeof f=="object"||typeof f=="function")for(let _ of p(f))!g.call(i,_)&&_!==m&&c(i,_,{get:()=>f[_],enumerable:!(w=d(f,_))||w.enumerable});return i},"__copyProps"),V=Y(i=>T(c({},"__esModule",{value:!0}),i),"__toCommonJS"),q={};E(q,{AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX:()=>Vi,AchievementCredentialValidator:()=>gc,AchievementCriteriaValidator:()=>mc,AchievementSubjectValidator:()=>ya,AchievementTypeValidator:()=>go,AchievementValidator:()=>ga,AddTagInputValidator:()=>mr,AddressValidator:()=>je,AlignmentTargetTypeValidator:()=>Rs,AlignmentValidator:()=>Xe,AuthGrantQueryValidator:()=>Ks,AuthGrantStatusValidator:()=>Ys,AuthGrantValidator:()=>Ta,AutoBoostConfigValidator:()=>Ve,BoostPermissionsQueryValidator:()=>Ms,BoostPermissionsValidator:()=>Pn,BoostQueryValidator:()=>wc,BoostRecipientValidator:()=>pr,BoostRecipientWithChildrenValidator:()=>D,BoostValidator:()=>Fs,ClaimHookQueryValidator:()=>Vn,ClaimHookTypeValidator:()=>ba,ClaimHookValidator:()=>Us,ClaimInboxCredentialValidator:()=>kc,ClaimTokenValidator:()=>nl,ConsentFlowContractDataForDidValidator:()=>Ii,ConsentFlowContractDataValidator:()=>$s,ConsentFlowContractDetailsValidator:()=>lt,ConsentFlowContractQueryValidator:()=>Ca,ConsentFlowContractValidator:()=>qs,ConsentFlowDataForDidQueryValidator:()=>Cc,ConsentFlowDataQueryValidator:()=>Ec,ConsentFlowTermValidator:()=>Ae,ConsentFlowTermsQueryValidator:()=>Ws,ConsentFlowTermsStatusValidator:()=>wa,ConsentFlowTermsValidator:()=>To,ConsentFlowTransactionActionValidator:()=>nn,ConsentFlowTransactionValidator:()=>jn,ConsentFlowTransactionsQueryValidator:()=>Nr,ContactMethodCreateValidator:()=>et,ContactMethodQueryValidator:()=>Oo,ContactMethodValidator:()=>Tc,ContactMethodVerificationRequestValidator:()=>el,ContactMethodVerificationValidator:()=>tl,ContextValidator:()=>Si,ContractCredentialValidator:()=>Ro,CountSkillsInputValidator:()=>$c,CountSkillsResultValidator:()=>Ft,CreateContactMethodSessionResponseValidator:()=>Ni,CreateContactMethodSessionValidator:()=>Io,CreateManagedFrameworkBatchInputValidator:()=>Nc,CreateManagedFrameworkInputValidator:()=>al,CreateSkillInputValidator:()=>Uc,CreateSkillsBatchInputValidator:()=>Zc,CredentialInfoValidator:()=>Ns,CredentialRecordValidator:()=>yc,CredentialSchemaValidator:()=>so,CredentialStatusValidator:()=>Ri,CredentialSubjectValidator:()=>fa,CriteriaValidator:()=>dr,DeleteFrameworkInputValidator:()=>hr,DeleteSkillInputValidator:()=>Fc,DidDocumentValidator:()=>pt,EncryptedCredentialRecordValidator:()=>st,EncryptedRecordValidator:()=>_o,EndorsementCredentialValidator:()=>ha,EndorsementSubjectValidator:()=>Ai,EvidenceValidator:()=>Oi,FlatAuthGrantValidator:()=>Ao,FrameworkWithSkillsValidator:()=>Jc,FullClaimHookValidator:()=>xt,GeoCoordinatesValidator:()=>Ss,GetFullSkillTreeInputValidator:()=>zc,GetFullSkillTreeResultValidator:()=>Wc,GetSkillPathInputValidator:()=>Hc,GetSkillPathResultValidator:()=>Gc,IdentifierEntryValidator:()=>oo,IdentifierTypeValidator:()=>Pe,IdentityObjectValidator:()=>Os,ImageValidator:()=>Ti,InboxCredentialQueryValidator:()=>ji,InboxCredentialValidator:()=>Ra,IssueInboxCredentialResponseValidator:()=>Un,IssueInboxCredentialValidator:()=>ka,IssueInboxSigningAuthorityValidator:()=>Mn,JWERecipientHeaderValidator:()=>fo,JWERecipientValidator:()=>po,JWEValidator:()=>ho,JWKValidator:()=>nt,JWKWithPrivateKeyValidator:()=>Ts,KnownAchievementTypeValidator:()=>ks,LCNBoostClaimLinkOptionsValidator:()=>pe,LCNBoostClaimLinkSigningAuthorityValidator:()=>G,LCNBoostStatus:()=>_a,LCNDomainOrOriginValidator:()=>Aa,LCNInboxContactMethodValidator:()=>jr,LCNInboxStatusEnumValidator:()=>Dr,LCNIntegrationCreateValidator:()=>Ac,LCNIntegrationQueryValidator:()=>Oa,LCNIntegrationUpdateValidator:()=>Oc,LCNIntegrationValidator:()=>rl,LCNNotificationDataValidator:()=>Qs,LCNNotificationInboxValidator:()=>Js,LCNNotificationMessageValidator:()=>Dn,LCNNotificationTypeEnumValidator:()=>ko,LCNNotificationValidator:()=>Sc,LCNProfileConnectionStatusEnum:()=>In,LCNProfileDisplayValidator:()=>Ds,LCNProfileManagerQueryValidator:()=>So,LCNProfileManagerValidator:()=>Co,LCNProfileQueryValidator:()=>vc,LCNProfileValidator:()=>Ut,LCNSigningAuthorityForUserValidator:()=>He,LCNSigningAuthorityValidator:()=>Te,LinkProviderFrameworkInputValidator:()=>Pc,PaginatedBoostRecipientsValidator:()=>S,PaginatedBoostRecipientsWithChildrenValidator:()=>N,PaginatedBoostsValidator:()=>xc,PaginatedClaimHooksValidator:()=>Bs,PaginatedConsentFlowContractsValidator:()=>xa,PaginatedConsentFlowDataForDidValidator:()=>Ea,PaginatedConsentFlowDataValidator:()=>Nn,PaginatedConsentFlowTermsValidator:()=>zs,PaginatedConsentFlowTransactionsValidator:()=>Hs,PaginatedContractCredentialsValidator:()=>Sa,PaginatedEncryptedCredentialRecordsValidator:()=>wo,PaginatedEncryptedRecordsValidator:()=>js,PaginatedInboxCredentialsValidator:()=>Ln,PaginatedLCNIntegrationsValidator:()=>Di,PaginatedLCNProfileManagersValidator:()=>_c,PaginatedLCNProfilesAndManagersValidator:()=>Ls,PaginatedLCNProfilesValidator:()=>bc,PaginatedSkillFrameworksValidator:()=>Ic,PaginatedSkillTreeValidator:()=>il,PaginationOptionsValidator:()=>bo,PaginationResponseValidator:()=>$e,ProfileValidator:()=>An,ProofValidator:()=>ft,RefreshServiceValidator:()=>lo,RegExpValidator:()=>xo,RelatedValidator:()=>De,ReplaceSkillFrameworkSkillsInputValidator:()=>on,ReplaceSkillFrameworkSkillsResultValidator:()=>qc,ResultDescriptionValidator:()=>As,ResultStatusTypeValidator:()=>Is,ResultTypeValidator:()=>fr,ResultValidator:()=>Ps,RubricCriterionValidator:()=>ma,SentCredentialInfoValidator:()=>Vr,ServiceValidator:()=>mo,SetPrimaryContactMethodValidator:()=>Rc,SkillDeletionStrategyValidator:()=>ol,SkillFrameworkAdminInputValidator:()=>jc,SkillFrameworkAdminsValidator:()=>Lc,SkillFrameworkIdInputValidator:()=>Dc,SkillFrameworkQueryValidator:()=>Gs,SkillFrameworkStatusEnum:()=>Ia,SkillFrameworkValidator:()=>Po,SkillQueryValidator:()=>Ee,SkillStatusEnum:()=>Bt,SkillTreeNodeInputValidator:()=>an,SkillTreeNodeValidator:()=>Xt,SkillValidator:()=>Bn,StringQuery:()=>fe,SyncFrameworkInputValidator:()=>Mc,TagValidator:()=>v,TermsOfUseValidator:()=>pa,UnsignedAchievementCredentialValidator:()=>rn,UnsignedVCValidator:()=>Me,UnsignedVPValidator:()=>uo,UpdateFrameworkInputValidator:()=>Vc,UpdateSkillInputValidator:()=>Bc,VC2EvidenceValidator:()=>co,VCValidator:()=>Mt,VPValidator:()=>ki,VerificationCheckValidator:()=>Vs,VerificationItemValidator:()=>vo,VerificationMethodValidator:()=>ur,VerificationStatusEnum:()=>yo,VerificationStatusValidator:()=>va}),r.exports=V(q);var j;(function(i){i.assertEqual=_=>_;function f(_){}l(f,"assertIs"),Y(f,"assertIs"),y(f,"assertIs"),i.assertIs=f;function m(_){throw new Error}l(m,"assertNever"),Y(m,"assertNever"),y(m,"assertNever"),i.assertNever=m,i.arrayToEnum=_=>{let P={};for(let I of _)P[I]=I;return P},i.getValidEnumValues=_=>{let P=i.objectKeys(_).filter(F=>typeof _[_[F]]!="number"),I={};for(let F of P)I[F]=_[F];return i.objectValues(I)},i.objectValues=_=>i.objectKeys(_).map(function(P){return _[P]}),i.objectKeys=typeof Object.keys=="function"?_=>Object.keys(_):_=>{let P=[];for(let I in _)Object.prototype.hasOwnProperty.call(_,I)&&P.push(I);return P},i.find=(_,P)=>{for(let I of _)if(P(I))return I},i.isInteger=typeof Number.isInteger=="function"?_=>Number.isInteger(_):_=>typeof _=="number"&&isFinite(_)&&Math.floor(_)===_;function w(_,P=" | "){return _.map(I=>typeof I=="string"?`'${I}'`:I).join(P)}l(w,"joinValues"),Y(w,"joinValues"),y(w,"joinValues"),i.joinValues=w,i.jsonStringifyReplacer=(_,P)=>typeof P=="bigint"?P.toString():P})(j||(j={}));var O;(function(i){i.mergeShapes=(f,m)=>({...f,...m})})(O||(O={}));var R=j.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Z=y(i=>{switch(typeof i){case"undefined":return R.undefined;case"string":return R.string;case"number":return isNaN(i)?R.nan:R.number;case"boolean":return R.boolean;case"function":return R.function;case"bigint":return R.bigint;case"symbol":return R.symbol;case"object":return Array.isArray(i)?R.array:i===null?R.null:i.then&&typeof i.then=="function"&&i.catch&&typeof i.catch=="function"?R.promise:typeof Map<"u"&&i instanceof Map?R.map:typeof Set<"u"&&i instanceof Set?R.set:typeof Date<"u"&&i instanceof Date?R.date:R.object;default:return R.unknown}},"getParsedType"),A=j.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),X=y(i=>JSON.stringify(i,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),K=Y(class extends Error{constructor(i){super(),this.issues=[],this.addIssue=m=>{this.issues=[...this.issues,m]},this.addIssues=(m=[])=>{this.issues=[...this.issues,...m]};let f=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,f):this.__proto__=f,this.name="ZodError",this.issues=i}get errors(){return this.issues}format(i){let f=i||function(_){return _.message},m={_errors:[]},w=y(_=>{for(let P of _.issues)if(P.code==="invalid_union")P.unionErrors.map(w);else if(P.code==="invalid_return_type")w(P.returnTypeError);else if(P.code==="invalid_arguments")w(P.argumentsError);else if(P.path.length===0)m._errors.push(f(P));else{let I=m,F=0;for(;F<P.path.length;){let U=P.path[F];F===P.path.length-1?(I[U]=I[U]||{_errors:[]},I[U]._errors.push(f(P))):I[U]=I[U]||{_errors:[]},I=I[U],F++}}},"processError");return w(this),m}static assert(i){if(!(i instanceof K))throw new Error(`Not a ZodError: ${i}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,j.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(i=f=>f.message){let f={},m=[];for(let w of this.issues)w.path.length>0?(f[w.path[0]]=f[w.path[0]]||[],f[w.path[0]].push(i(w))):m.push(i(w));return{formErrors:m,fieldErrors:f}}get formErrors(){return this.flatten()}},"ZodError");y(K,"ZodError"),K.create=i=>new K(i);var ne=y((i,f)=>{let m;switch(i.code){case A.invalid_type:i.received===R.undefined?m="Required":m=`Expected ${i.expected}, received ${i.received}`;break;case A.invalid_literal:m=`Invalid literal value, expected ${JSON.stringify(i.expected,j.jsonStringifyReplacer)}`;break;case A.unrecognized_keys:m=`Unrecognized key(s) in object: ${j.joinValues(i.keys,", ")}`;break;case A.invalid_union:m="Invalid input";break;case A.invalid_union_discriminator:m=`Invalid discriminator value. Expected ${j.joinValues(i.options)}`;break;case A.invalid_enum_value:m=`Invalid enum value. Expected ${j.joinValues(i.options)}, received '${i.received}'`;break;case A.invalid_arguments:m="Invalid function arguments";break;case A.invalid_return_type:m="Invalid function return type";break;case A.invalid_date:m="Invalid date";break;case A.invalid_string:typeof i.validation=="object"?"includes"in i.validation?(m=`Invalid input: must include "${i.validation.includes}"`,typeof i.validation.position=="number"&&(m=`${m} at one or more positions greater than or equal to ${i.validation.position}`)):"startsWith"in i.validation?m=`Invalid input: must start with "${i.validation.startsWith}"`:"endsWith"in i.validation?m=`Invalid input: must end with "${i.validation.endsWith}"`:j.assertNever(i.validation):i.validation!=="regex"?m=`Invalid ${i.validation}`:m="Invalid";break;case A.too_small:i.type==="array"?m=`Array must contain ${i.exact?"exactly":i.inclusive?"at least":"more than"} ${i.minimum} element(s)`:i.type==="string"?m=`String must contain ${i.exact?"exactly":i.inclusive?"at least":"over"} ${i.minimum} character(s)`:i.type==="number"?m=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="date"?m=`Date must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(i.minimum))}`:m="Invalid input";break;case A.too_big:i.type==="array"?m=`Array must contain ${i.exact?"exactly":i.inclusive?"at most":"less than"} ${i.maximum} element(s)`:i.type==="string"?m=`String must contain ${i.exact?"exactly":i.inclusive?"at most":"under"} ${i.maximum} character(s)`:i.type==="number"?m=`Number must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="bigint"?m=`BigInt must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="date"?m=`Date must be ${i.exact?"exactly":i.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(i.maximum))}`:m="Invalid input";break;case A.custom:m="Invalid input";break;case A.invalid_intersection_types:m="Intersection results could not be merged";break;case A.not_multiple_of:m=`Number must be a multiple of ${i.multipleOf}`;break;case A.not_finite:m="Number must be finite";break;default:m=f.defaultError,j.assertNever(i)}return{message:m}},"errorMap"),ke=ne;function xe(i){ke=i}l(xe,"setErrorMap"),Y(xe,"setErrorMap"),y(xe,"setErrorMap");function Ne(){return ke}l(Ne,"getErrorMap"),Y(Ne,"getErrorMap"),y(Ne,"getErrorMap");var Be=y(i=>{let{data:f,path:m,errorMaps:w,issueData:_}=i,P=[...m,..._.path||[]],I={..._,path:P};if(_.message!==void 0)return{..._,path:P,message:_.message};let F="",U=w.filter(ue=>!!ue).slice().reverse();for(let ue of U)F=ue(I,{data:f,defaultError:F}).message;return{..._,path:P,message:F}},"makeIssue"),zr=[];function z(i,f){let m=Ne(),w=Be({issueData:f,data:i.data,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,m,m===ne?void 0:ne].filter(_=>!!_)});i.common.issues.push(w)}l(z,"addIssueToContext"),Y(z,"addIssueToContext"),y(z,"addIssueToContext");var Qe=Y(class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(i,f){let m=[];for(let w of f){if(w.status==="aborted")return re;w.status==="dirty"&&i.dirty(),m.push(w.value)}return{status:i.value,value:m}}static async mergeObjectAsync(i,f){let m=[];for(let w of f){let _=await w.key,P=await w.value;m.push({key:_,value:P})}return Qe.mergeObjectSync(i,m)}static mergeObjectSync(i,f){let m={};for(let w of f){let{key:_,value:P}=w;if(_.status==="aborted"||P.status==="aborted")return re;_.status==="dirty"&&i.dirty(),P.status==="dirty"&&i.dirty(),_.value!=="__proto__"&&(typeof P.value<"u"||w.alwaysSet)&&(m[_.value]=P.value)}return{status:i.value,value:m}}},"ParseStatus");y(Qe,"ParseStatus");var re=Object.freeze({status:"aborted"}),Qt=y(i=>({status:"dirty",value:i}),"DIRTY"),qe=y(i=>({status:"valid",value:i}),"OK"),Cr=y(i=>i.status==="aborted","isAborted"),vn=y(i=>i.status==="dirty","isDirty"),Ot=y(i=>i.status==="valid","isValid"),bt=y(i=>typeof Promise<"u"&&i instanceof Promise,"isAsync");function bn(i,f,m,w){if(m==="a"&&!w)throw new TypeError("Private accessor was defined without a getter");if(typeof f=="function"?i!==f||!w:!f.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return m==="m"?w:m==="a"?w.call(i):w?w.value:f.get(i)}l(bn,"__classPrivateFieldGet"),Y(bn,"__classPrivateFieldGet"),y(bn,"__classPrivateFieldGet");function Wr(i,f,m,w,_){if(w==="m")throw new TypeError("Private method is not writable");if(w==="a"&&!_)throw new TypeError("Private accessor was defined without a setter");if(typeof f=="function"?i!==f||!_:!f.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return w==="a"?_.call(i,m):_?_.value=m:f.set(i,m),m}l(Wr,"__classPrivateFieldSet"),Y(Wr,"__classPrivateFieldSet"),y(Wr,"__classPrivateFieldSet");var Q;(function(i){i.errToObj=f=>typeof f=="string"?{message:f}:f||{},i.toString=f=>typeof f=="string"?f:f?.message})(Q||(Q={}));var pi,hi,It=Y(class{constructor(i,f,m,w){this._cachedPath=[],this.parent=i,this.data=f,this._path=m,this._key=w}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},"ParseInputLazyPath");y(It,"ParseInputLazyPath");var Hr=y((i,f)=>{if(Ot(f))return{success:!0,data:f.value};if(!i.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let m=new K(i.common.issues);return this._error=m,this._error}}},"handleResult");function le(i){if(!i)return{};let{errorMap:f,invalid_type_error:m,required_error:w,description:_}=i;if(f&&(m||w))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return f?{errorMap:f,description:_}:{errorMap:y((I,F)=>{var U,ue;let{message:Oe}=i;return I.code==="invalid_enum_value"?{message:Oe??F.defaultError}:typeof F.data>"u"?{message:(U=Oe??w)!==null&&U!==void 0?U:F.defaultError}:I.code!=="invalid_type"?{message:F.defaultError}:{message:(ue=Oe??m)!==null&&ue!==void 0?ue:F.defaultError}},"customMap"),description:_}}l(le,"processCreateParams"),Y(le,"processCreateParams"),y(le,"processCreateParams");var he=Y(class{constructor(i){this.spa=this.safeParseAsync,this._def=i,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(i){return Z(i.data)}_getOrReturnCtx(i,f){return f||{common:i.parent.common,data:i.data,parsedType:Z(i.data),schemaErrorMap:this._def.errorMap,path:i.path,parent:i.parent}}_processInputParams(i){return{status:new Qe,ctx:{common:i.parent.common,data:i.data,parsedType:Z(i.data),schemaErrorMap:this._def.errorMap,path:i.path,parent:i.parent}}}_parseSync(i){let f=this._parse(i);if(bt(f))throw new Error("Synchronous parse encountered promise.");return f}_parseAsync(i){let f=this._parse(i);return Promise.resolve(f)}parse(i,f){let m=this.safeParse(i,f);if(m.success)return m.data;throw m.error}safeParse(i,f){var m;let w={common:{issues:[],async:(m=f?.async)!==null&&m!==void 0?m:!1,contextualErrorMap:f?.errorMap},path:f?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:i,parsedType:Z(i)},_=this._parseSync({data:i,path:w.path,parent:w});return Hr(w,_)}async parseAsync(i,f){let m=await this.safeParseAsync(i,f);if(m.success)return m.data;throw m.error}async safeParseAsync(i,f){let m={common:{issues:[],contextualErrorMap:f?.errorMap,async:!0},path:f?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:i,parsedType:Z(i)},w=this._parse({data:i,path:m.path,parent:m}),_=await(bt(w)?w:Promise.resolve(w));return Hr(m,_)}refine(i,f){let m=y(w=>typeof f=="string"||typeof f>"u"?{message:f}:typeof f=="function"?f(w):f,"getIssueProperties");return this._refinement((w,_)=>{let P=i(w),I=y(()=>_.addIssue({code:A.custom,...m(w)}),"setError");return typeof Promise<"u"&&P instanceof Promise?P.then(F=>F?!0:(I(),!1)):P?!0:(I(),!1)})}refinement(i,f){return this._refinement((m,w)=>i(m)?!0:(w.addIssue(typeof f=="function"?f(m,w):f),!1))}_refinement(i){return new wt({schema:this,typeName:ie.ZodEffects,effect:{type:"refinement",refinement:i}})}superRefine(i){return this._refinement(i)}optional(){return Lt.create(this,this._def)}nullable(){return cr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return jt.create(this,this._def)}promise(){return Xr.create(this,this._def)}or(i){return Yr.create([this,i],this._def)}and(i){return xn.create(this,i,this._def)}transform(i){return new wt({...le(this._def),schema:this,typeName:ie.ZodEffects,effect:{type:"transform",transform:i}})}default(i){let f=typeof i=="function"?i:()=>i;return new Sn({...le(this._def),innerType:this,defaultValue:f,typeName:ie.ZodDefault})}brand(){return new oa({typeName:ie.ZodBranded,type:this,...le(this._def)})}catch(i){let f=typeof i=="function"?i:()=>i;return new en({...le(this._def),innerType:this,catchValue:f,typeName:ie.ZodCatch})}describe(i){let f=this.constructor;return new f({...this._def,description:i})}pipe(i){return Ei.create(this,i)}readonly(){return Tn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},"ZodType");y(he,"ZodType");var mi=/^c[^\s-]{8,}$/i,gi=/^[0-9a-z]+$/,ec=/^[0-9A-HJKMNP-TV-Z]{26}$/,ta=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ra=/^[a-z0-9_-]{21}$/i,ns=/^[-+]?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)?)??$/,Pt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,yi="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",eo,ar=/^(?:(?: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])$/,is=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,tc=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,_n="((\\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])))",Vt=new RegExp(`^${_n}$`);function Sr(i){let f="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return i.precision?f=`${f}\\.\\d{${i.precision}}`:i.precision==null&&(f=`${f}(\\.\\d+)?`),f}l(Sr,"timeRegexSource"),Y(Sr,"timeRegexSource"),y(Sr,"timeRegexSource");function wn(i){return new RegExp(`^${Sr(i)}$`)}l(wn,"timeRegex"),Y(wn,"timeRegex"),y(wn,"timeRegex");function na(i){let f=`${_n}T${Sr(i)}`,m=[];return m.push(i.local?"Z?":"Z"),i.offset&&m.push("([+-]\\d{2}:?\\d{2})"),f=`${f}(${m.join("|")})`,new RegExp(`^${f}$`)}l(na,"datetimeRegex"),Y(na,"datetimeRegex"),y(na,"datetimeRegex");function Gr(i,f){return!!((f==="v4"||!f)&&ar.test(i)||(f==="v6"||!f)&&is.test(i))}l(Gr,"isValidIP"),Y(Gr,"isValidIP"),y(Gr,"isValidIP");var Nt=Y(class extends he{_parse(i){if(this._def.coerce&&(i.data=String(i.data)),this._getType(i)!==R.string){let _=this._getOrReturnCtx(i);return z(_,{code:A.invalid_type,expected:R.string,received:_.parsedType}),re}let m=new Qe,w;for(let _ of this._def.checks)if(_.kind==="min")i.data.length<_.value&&(w=this._getOrReturnCtx(i,w),z(w,{code:A.too_small,minimum:_.value,type:"string",inclusive:!0,exact:!1,message:_.message}),m.dirty());else if(_.kind==="max")i.data.length>_.value&&(w=this._getOrReturnCtx(i,w),z(w,{code:A.too_big,maximum:_.value,type:"string",inclusive:!0,exact:!1,message:_.message}),m.dirty());else if(_.kind==="length"){let P=i.data.length>_.value,I=i.data.length<_.value;(P||I)&&(w=this._getOrReturnCtx(i,w),P?z(w,{code:A.too_big,maximum:_.value,type:"string",inclusive:!0,exact:!0,message:_.message}):I&&z(w,{code:A.too_small,minimum:_.value,type:"string",inclusive:!0,exact:!0,message:_.message}),m.dirty())}else if(_.kind==="email")Pt.test(i.data)||(w=this._getOrReturnCtx(i,w),z(w,{validation:"email",code:A.invalid_string,message:_.message}),m.dirty());else if(_.kind==="emoji")eo||(eo=new RegExp(yi,"u")),eo.test(i.data)||(w=this._getOrReturnCtx(i,w),z(w,{validation:"emoji",code:A.invalid_string,message:_.message}),m.dirty());else if(_.kind==="uuid")ta.test(i.data)||(w=this._getOrReturnCtx(i,w),z(w,{validation:"uuid",code:A.invalid_string,message:_.message}),m.dirty());else if(_.kind==="nanoid")ra.test(i.data)||(w=this._getOrReturnCtx(i,w),z(w,{validation:"nanoid",code:A.invalid_string,message:_.message}),m.dirty());else if(_.kind==="cuid")mi.test(i.data)||(w=this._getOrReturnCtx(i,w),z(w,{validation:"cuid",code:A.invalid_string,message:_.message}),m.dirty());else if(_.kind==="cuid2")gi.test(i.data)||(w=this._getOrReturnCtx(i,w),z(w,{validation:"cuid2",code:A.invalid_string,message:_.message}),m.dirty());else if(_.kind==="ulid")ec.test(i.data)||(w=this._getOrReturnCtx(i,w),z(w,{validation:"ulid",code:A.invalid_string,message:_.message}),m.dirty());else if(_.kind==="url")try{new URL(i.data)}catch{w=this._getOrReturnCtx(i,w),z(w,{validation:"url",code:A.invalid_string,message:_.message}),m.dirty()}else _.kind==="regex"?(_.regex.lastIndex=0,_.regex.test(i.data)||(w=this._getOrReturnCtx(i,w),z(w,{validation:"regex",code:A.invalid_string,message:_.message}),m.dirty())):_.kind==="trim"?i.data=i.data.trim():_.kind==="includes"?i.data.includes(_.value,_.position)||(w=this._getOrReturnCtx(i,w),z(w,{code:A.invalid_string,validation:{includes:_.value,position:_.position},message:_.message}),m.dirty()):_.kind==="toLowerCase"?i.data=i.data.toLowerCase():_.kind==="toUpperCase"?i.data=i.data.toUpperCase():_.kind==="startsWith"?i.data.startsWith(_.value)||(w=this._getOrReturnCtx(i,w),z(w,{code:A.invalid_string,validation:{startsWith:_.value},message:_.message}),m.dirty()):_.kind==="endsWith"?i.data.endsWith(_.value)||(w=this._getOrReturnCtx(i,w),z(w,{code:A.invalid_string,validation:{endsWith:_.value},message:_.message}),m.dirty()):_.kind==="datetime"?na(_).test(i.data)||(w=this._getOrReturnCtx(i,w),z(w,{code:A.invalid_string,validation:"datetime",message:_.message}),m.dirty()):_.kind==="date"?Vt.test(i.data)||(w=this._getOrReturnCtx(i,w),z(w,{code:A.invalid_string,validation:"date",message:_.message}),m.dirty()):_.kind==="time"?wn(_).test(i.data)||(w=this._getOrReturnCtx(i,w),z(w,{code:A.invalid_string,validation:"time",message:_.message}),m.dirty()):_.kind==="duration"?ns.test(i.data)||(w=this._getOrReturnCtx(i,w),z(w,{validation:"duration",code:A.invalid_string,message:_.message}),m.dirty()):_.kind==="ip"?Gr(i.data,_.version)||(w=this._getOrReturnCtx(i,w),z(w,{validation:"ip",code:A.invalid_string,message:_.message}),m.dirty()):_.kind==="base64"?tc.test(i.data)||(w=this._getOrReturnCtx(i,w),z(w,{validation:"base64",code:A.invalid_string,message:_.message}),m.dirty()):j.assertNever(_);return{status:m.value,value:i.data}}_regex(i,f,m){return this.refinement(w=>i.test(w),{validation:f,code:A.invalid_string,...Q.errToObj(m)})}_addCheck(i){return new Nt({...this._def,checks:[...this._def.checks,i]})}email(i){return this._addCheck({kind:"email",...Q.errToObj(i)})}url(i){return this._addCheck({kind:"url",...Q.errToObj(i)})}emoji(i){return this._addCheck({kind:"emoji",...Q.errToObj(i)})}uuid(i){return this._addCheck({kind:"uuid",...Q.errToObj(i)})}nanoid(i){return this._addCheck({kind:"nanoid",...Q.errToObj(i)})}cuid(i){return this._addCheck({kind:"cuid",...Q.errToObj(i)})}cuid2(i){return this._addCheck({kind:"cuid2",...Q.errToObj(i)})}ulid(i){return this._addCheck({kind:"ulid",...Q.errToObj(i)})}base64(i){return this._addCheck({kind:"base64",...Q.errToObj(i)})}ip(i){return this._addCheck({kind:"ip",...Q.errToObj(i)})}datetime(i){var f,m;return typeof i=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:i}):this._addCheck({kind:"datetime",precision:typeof i?.precision>"u"?null:i?.precision,offset:(f=i?.offset)!==null&&f!==void 0?f:!1,local:(m=i?.local)!==null&&m!==void 0?m:!1,...Q.errToObj(i?.message)})}date(i){return this._addCheck({kind:"date",message:i})}time(i){return typeof i=="string"?this._addCheck({kind:"time",precision:null,message:i}):this._addCheck({kind:"time",precision:typeof i?.precision>"u"?null:i?.precision,...Q.errToObj(i?.message)})}duration(i){return this._addCheck({kind:"duration",...Q.errToObj(i)})}regex(i,f){return this._addCheck({kind:"regex",regex:i,...Q.errToObj(f)})}includes(i,f){return this._addCheck({kind:"includes",value:i,position:f?.position,...Q.errToObj(f?.message)})}startsWith(i,f){return this._addCheck({kind:"startsWith",value:i,...Q.errToObj(f)})}endsWith(i,f){return this._addCheck({kind:"endsWith",value:i,...Q.errToObj(f)})}min(i,f){return this._addCheck({kind:"min",value:i,...Q.errToObj(f)})}max(i,f){return this._addCheck({kind:"max",value:i,...Q.errToObj(f)})}length(i,f){return this._addCheck({kind:"length",value:i,...Q.errToObj(f)})}nonempty(i){return this.min(1,Q.errToObj(i))}trim(){return new Nt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Nt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Nt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(i=>i.kind==="datetime")}get isDate(){return!!this._def.checks.find(i=>i.kind==="date")}get isTime(){return!!this._def.checks.find(i=>i.kind==="time")}get isDuration(){return!!this._def.checks.find(i=>i.kind==="duration")}get isEmail(){return!!this._def.checks.find(i=>i.kind==="email")}get isURL(){return!!this._def.checks.find(i=>i.kind==="url")}get isEmoji(){return!!this._def.checks.find(i=>i.kind==="emoji")}get isUUID(){return!!this._def.checks.find(i=>i.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(i=>i.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(i=>i.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(i=>i.kind==="cuid2")}get isULID(){return!!this._def.checks.find(i=>i.kind==="ulid")}get isIP(){return!!this._def.checks.find(i=>i.kind==="ip")}get isBase64(){return!!this._def.checks.find(i=>i.kind==="base64")}get minLength(){let i=null;for(let f of this._def.checks)f.kind==="min"&&(i===null||f.value>i)&&(i=f.value);return i}get maxLength(){let i=null;for(let f of this._def.checks)f.kind==="max"&&(i===null||f.value<i)&&(i=f.value);return i}},"ZodString");y(Nt,"ZodString"),Nt.create=i=>{var f;return new Nt({checks:[],typeName:ie.ZodString,coerce:(f=i?.coerce)!==null&&f!==void 0?f:!1,...le(i)})};function Jr(i,f){let m=(i.toString().split(".")[1]||"").length,w=(f.toString().split(".")[1]||"").length,_=m>w?m:w,P=parseInt(i.toFixed(_).replace(".","")),I=parseInt(f.toFixed(_).replace(".",""));return P%I/Math.pow(10,_)}l(Jr,"floatSafeRemainder"),Y(Jr,"floatSafeRemainder"),y(Jr,"floatSafeRemainder");var dt=Y(class extends he{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(i){if(this._def.coerce&&(i.data=Number(i.data)),this._getType(i)!==R.number){let _=this._getOrReturnCtx(i);return z(_,{code:A.invalid_type,expected:R.number,received:_.parsedType}),re}let m,w=new Qe;for(let _ of this._def.checks)_.kind==="int"?j.isInteger(i.data)||(m=this._getOrReturnCtx(i,m),z(m,{code:A.invalid_type,expected:"integer",received:"float",message:_.message}),w.dirty()):_.kind==="min"?(_.inclusive?i.data<_.value:i.data<=_.value)&&(m=this._getOrReturnCtx(i,m),z(m,{code:A.too_small,minimum:_.value,type:"number",inclusive:_.inclusive,exact:!1,message:_.message}),w.dirty()):_.kind==="max"?(_.inclusive?i.data>_.value:i.data>=_.value)&&(m=this._getOrReturnCtx(i,m),z(m,{code:A.too_big,maximum:_.value,type:"number",inclusive:_.inclusive,exact:!1,message:_.message}),w.dirty()):_.kind==="multipleOf"?Jr(i.data,_.value)!==0&&(m=this._getOrReturnCtx(i,m),z(m,{code:A.not_multiple_of,multipleOf:_.value,message:_.message}),w.dirty()):_.kind==="finite"?Number.isFinite(i.data)||(m=this._getOrReturnCtx(i,m),z(m,{code:A.not_finite,message:_.message}),w.dirty()):j.assertNever(_);return{status:w.value,value:i.data}}gte(i,f){return this.setLimit("min",i,!0,Q.toString(f))}gt(i,f){return this.setLimit("min",i,!1,Q.toString(f))}lte(i,f){return this.setLimit("max",i,!0,Q.toString(f))}lt(i,f){return this.setLimit("max",i,!1,Q.toString(f))}setLimit(i,f,m,w){return new dt({...this._def,checks:[...this._def.checks,{kind:i,value:f,inclusive:m,message:Q.toString(w)}]})}_addCheck(i){return new dt({...this._def,checks:[...this._def.checks,i]})}int(i){return this._addCheck({kind:"int",message:Q.toString(i)})}positive(i){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Q.toString(i)})}negative(i){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Q.toString(i)})}nonpositive(i){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Q.toString(i)})}nonnegative(i){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Q.toString(i)})}multipleOf(i,f){return this._addCheck({kind:"multipleOf",value:i,message:Q.toString(f)})}finite(i){return this._addCheck({kind:"finite",message:Q.toString(i)})}safe(i){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Q.toString(i)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Q.toString(i)})}get minValue(){let i=null;for(let f of this._def.checks)f.kind==="min"&&(i===null||f.value>i)&&(i=f.value);return i}get maxValue(){let i=null;for(let f of this._def.checks)f.kind==="max"&&(i===null||f.value<i)&&(i=f.value);return i}get isInt(){return!!this._def.checks.find(i=>i.kind==="int"||i.kind==="multipleOf"&&j.isInteger(i.value))}get isFinite(){let i=null,f=null;for(let m of this._def.checks){if(m.kind==="finite"||m.kind==="int"||m.kind==="multipleOf")return!0;m.kind==="min"?(f===null||m.value>f)&&(f=m.value):m.kind==="max"&&(i===null||m.value<i)&&(i=m.value)}return Number.isFinite(f)&&Number.isFinite(i)}},"ZodNumber");y(dt,"ZodNumber"),dt.create=i=>new dt({checks:[],typeName:ie.ZodNumber,coerce:i?.coerce||!1,...le(i)});var Yt=Y(class extends he{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(i){if(this._def.coerce&&(i.data=BigInt(i.data)),this._getType(i)!==R.bigint){let _=this._getOrReturnCtx(i);return z(_,{code:A.invalid_type,expected:R.bigint,received:_.parsedType}),re}let m,w=new Qe;for(let _ of this._def.checks)_.kind==="min"?(_.inclusive?i.data<_.value:i.data<=_.value)&&(m=this._getOrReturnCtx(i,m),z(m,{code:A.too_small,type:"bigint",minimum:_.value,inclusive:_.inclusive,message:_.message}),w.dirty()):_.kind==="max"?(_.inclusive?i.data>_.value:i.data>=_.value)&&(m=this._getOrReturnCtx(i,m),z(m,{code:A.too_big,type:"bigint",maximum:_.value,inclusive:_.inclusive,message:_.message}),w.dirty()):_.kind==="multipleOf"?i.data%_.value!==BigInt(0)&&(m=this._getOrReturnCtx(i,m),z(m,{code:A.not_multiple_of,multipleOf:_.value,message:_.message}),w.dirty()):j.assertNever(_);return{status:w.value,value:i.data}}gte(i,f){return this.setLimit("min",i,!0,Q.toString(f))}gt(i,f){return this.setLimit("min",i,!1,Q.toString(f))}lte(i,f){return this.setLimit("max",i,!0,Q.toString(f))}lt(i,f){return this.setLimit("max",i,!1,Q.toString(f))}setLimit(i,f,m,w){return new Yt({...this._def,checks:[...this._def.checks,{kind:i,value:f,inclusive:m,message:Q.toString(w)}]})}_addCheck(i){return new Yt({...this._def,checks:[...this._def.checks,i]})}positive(i){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Q.toString(i)})}negative(i){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Q.toString(i)})}nonpositive(i){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Q.toString(i)})}nonnegative(i){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Q.toString(i)})}multipleOf(i,f){return this._addCheck({kind:"multipleOf",value:i,message:Q.toString(f)})}get minValue(){let i=null;for(let f of this._def.checks)f.kind==="min"&&(i===null||f.value>i)&&(i=f.value);return i}get maxValue(){let i=null;for(let f of this._def.checks)f.kind==="max"&&(i===null||f.value<i)&&(i=f.value);return i}},"ZodBigInt");y(Yt,"ZodBigInt"),Yt.create=i=>{var f;return new Yt({checks:[],typeName:ie.ZodBigInt,coerce:(f=i?.coerce)!==null&&f!==void 0?f:!1,...le(i)})};var Tr=Y(class extends he{_parse(i){if(this._def.coerce&&(i.data=Boolean(i.data)),this._getType(i)!==R.boolean){let m=this._getOrReturnCtx(i);return z(m,{code:A.invalid_type,expected:R.boolean,received:m.parsedType}),re}return qe(i.data)}},"ZodBoolean");y(Tr,"ZodBoolean"),Tr.create=i=>new Tr({typeName:ie.ZodBoolean,coerce:i?.coerce||!1,...le(i)});var or=Y(class extends he{_parse(i){if(this._def.coerce&&(i.data=new Date(i.data)),this._getType(i)!==R.date){let _=this._getOrReturnCtx(i);return z(_,{code:A.invalid_type,expected:R.date,received:_.parsedType}),re}if(isNaN(i.data.getTime())){let _=this._getOrReturnCtx(i);return z(_,{code:A.invalid_date}),re}let m=new Qe,w;for(let _ of this._def.checks)_.kind==="min"?i.data.getTime()<_.value&&(w=this._getOrReturnCtx(i,w),z(w,{code:A.too_small,message:_.message,inclusive:!0,exact:!1,minimum:_.value,type:"date"}),m.dirty()):_.kind==="max"?i.data.getTime()>_.value&&(w=this._getOrReturnCtx(i,w),z(w,{code:A.too_big,message:_.message,inclusive:!0,exact:!1,maximum:_.value,type:"date"}),m.dirty()):j.assertNever(_);return{status:m.value,value:new Date(i.data.getTime())}}_addCheck(i){return new or({...this._def,checks:[...this._def.checks,i]})}min(i,f){return this._addCheck({kind:"min",value:i.getTime(),message:Q.toString(f)})}max(i,f){return this._addCheck({kind:"max",value:i.getTime(),message:Q.toString(f)})}get minDate(){let i=null;for(let f of this._def.checks)f.kind==="min"&&(i===null||f.value>i)&&(i=f.value);return i!=null?new Date(i):null}get maxDate(){let i=null;for(let f of this._def.checks)f.kind==="max"&&(i===null||f.value<i)&&(i=f.value);return i!=null?new Date(i):null}},"ZodDate");y(or,"ZodDate"),or.create=i=>new or({checks:[],coerce:i?.coerce||!1,typeName:ie.ZodDate,...le(i)});var Qr=Y(class extends he{_parse(i){if(this._getType(i)!==R.symbol){let m=this._getOrReturnCtx(i);return z(m,{code:A.invalid_type,expected:R.symbol,received:m.parsedType}),re}return qe(i.data)}},"ZodSymbol");y(Qr,"ZodSymbol"),Qr.create=i=>new Qr({typeName:ie.ZodSymbol,...le(i)});var Rr=Y(class extends he{_parse(i){if(this._getType(i)!==R.undefined){let m=this._getOrReturnCtx(i);return z(m,{code:A.invalid_type,expected:R.undefined,received:m.parsedType}),re}return qe(i.data)}},"ZodUndefined");y(Rr,"ZodUndefined"),Rr.create=i=>new Rr({typeName:ie.ZodUndefined,...le(i)});var kr=Y(class extends he{_parse(i){if(this._getType(i)!==R.null){let m=this._getOrReturnCtx(i);return z(m,{code:A.invalid_type,expected:R.null,received:m.parsedType}),re}return qe(i.data)}},"ZodNull");y(kr,"ZodNull"),kr.create=i=>new kr({typeName:ie.ZodNull,...le(i)});var sr=Y(class extends he{constructor(){super(...arguments),this._any=!0}_parse(i){return qe(i.data)}},"ZodAny");y(sr,"ZodAny"),sr.create=i=>new sr({typeName:ie.ZodAny,...le(i)});var Kt=Y(class extends he{constructor(){super(...arguments),this._unknown=!0}_parse(i){return qe(i.data)}},"ZodUnknown");y(Kt,"ZodUnknown"),Kt.create=i=>new Kt({typeName:ie.ZodUnknown,...le(i)});var _t=Y(class extends he{_parse(i){let f=this._getOrReturnCtx(i);return z(f,{code:A.invalid_type,expected:R.never,received:f.parsedType}),re}},"ZodNever");y(_t,"ZodNever"),_t.create=i=>new _t({typeName:ie.ZodNever,...le(i)});var vi=Y(class extends he{_parse(i){if(this._getType(i)!==R.undefined){let m=this._getOrReturnCtx(i);return z(m,{code:A.invalid_type,expected:R.void,received:m.parsedType}),re}return qe(i.data)}},"ZodVoid");y(vi,"ZodVoid"),vi.create=i=>new vi({typeName:ie.ZodVoid,...le(i)});var jt=Y(class extends he{_parse(i){let{ctx:f,status:m}=this._processInputParams(i),w=this._def;if(f.parsedType!==R.array)return z(f,{code:A.invalid_type,expected:R.array,received:f.parsedType}),re;if(w.exactLength!==null){let P=f.data.length>w.exactLength.value,I=f.data.length<w.exactLength.value;(P||I)&&(z(f,{code:P?A.too_big:A.too_small,minimum:I?w.exactLength.value:void 0,maximum:P?w.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:w.exactLength.message}),m.dirty())}if(w.minLength!==null&&f.data.length<w.minLength.value&&(z(f,{code:A.too_small,minimum:w.minLength.value,type:"array",inclusive:!0,exact:!1,message:w.minLength.message}),m.dirty()),w.maxLength!==null&&f.data.length>w.maxLength.value&&(z(f,{code:A.too_big,maximum:w.maxLength.value,type:"array",inclusive:!0,exact:!1,message:w.maxLength.message}),m.dirty()),f.common.async)return Promise.all([...f.data].map((P,I)=>w.type._parseAsync(new It(f,P,f.path,I)))).then(P=>Qe.mergeArray(m,P));let _=[...f.data].map((P,I)=>w.type._parseSync(new It(f,P,f.path,I)));return Qe.mergeArray(m,_)}get element(){return this._def.type}min(i,f){return new jt({...this._def,minLength:{value:i,message:Q.toString(f)}})}max(i,f){return new jt({...this._def,maxLength:{value:i,message:Q.toString(f)}})}length(i,f){return new jt({...this._def,exactLength:{value:i,message:Q.toString(f)}})}nonempty(i){return this.min(1,i)}},"ZodArray");y(jt,"ZodArray"),jt.create=(i,f)=>new jt({type:i,minLength:null,maxLength:null,exactLength:null,typeName:ie.ZodArray,...le(f)});function Ar(i){if(i instanceof Le){let f={};for(let m in i.shape){let w=i.shape[m];f[m]=Lt.create(Ar(w))}return new Le({...i._def,shape:()=>f})}else return i instanceof jt?new jt({...i._def,type:Ar(i.element)}):i instanceof Lt?Lt.create(Ar(i.unwrap())):i instanceof cr?cr.create(Ar(i.unwrap())):i instanceof Dt?Dt.create(i.items.map(f=>Ar(f))):i}l(Ar,"deepPartialify"),Y(Ar,"deepPartialify"),y(Ar,"deepPartialify");var Le=Y(class extends he{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let i=this._def.shape(),f=j.objectKeys(i);return this._cached={shape:i,keys:f}}_parse(i){if(this._getType(i)!==R.object){let U=this._getOrReturnCtx(i);return z(U,{code:A.invalid_type,expected:R.object,received:U.parsedType}),re}let{status:m,ctx:w}=this._processInputParams(i),{shape:_,keys:P}=this._getCached(),I=[];if(!(this._def.catchall instanceof _t&&this._def.unknownKeys==="strip"))for(let U in w.data)P.includes(U)||I.push(U);let F=[];for(let U of P){let ue=_[U],Oe=w.data[U];F.push({key:{status:"valid",value:U},value:ue._parse(new It(w,Oe,w.path,U)),alwaysSet:U in w.data})}if(this._def.catchall instanceof _t){let U=this._def.unknownKeys;if(U==="passthrough")for(let ue of I)F.push({key:{status:"valid",value:ue},value:{status:"valid",value:w.data[ue]}});else if(U==="strict")I.length>0&&(z(w,{code:A.unrecognized_keys,keys:I}),m.dirty());else if(U!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let U=this._def.catchall;for(let ue of I){let Oe=w.data[ue];F.push({key:{status:"valid",value:ue},value:U._parse(new It(w,Oe,w.path,ue)),alwaysSet:ue in w.data})}}return w.common.async?Promise.resolve().then(async()=>{let U=[];for(let ue of F){let Oe=await ue.key,Pa=await ue.value;U.push({key:Oe,value:Pa,alwaysSet:ue.alwaysSet})}return U}).then(U=>Qe.mergeObjectSync(m,U)):Qe.mergeObjectSync(m,F)}get shape(){return this._def.shape()}strict(i){return Q.errToObj,new Le({...this._def,unknownKeys:"strict",...i!==void 0?{errorMap:(f,m)=>{var w,_,P,I;let F=(P=(_=(w=this._def).errorMap)===null||_===void 0?void 0:_.call(w,f,m).message)!==null&&P!==void 0?P:m.defaultError;return f.code==="unrecognized_keys"?{message:(I=Q.errToObj(i).message)!==null&&I!==void 0?I:F}:{message:F}}}:{}})}strip(){return new Le({...this._def,unknownKeys:"strip"})}passthrough(){return new Le({...this._def,unknownKeys:"passthrough"})}extend(i){return new Le({...this._def,shape:()=>({...this._def.shape(),...i})})}merge(i){return new Le({unknownKeys:i._def.unknownKeys,catchall:i._def.catchall,shape:()=>({...this._def.shape(),...i._def.shape()}),typeName:ie.ZodObject})}setKey(i,f){return this.augment({[i]:f})}catchall(i){return new Le({...this._def,catchall:i})}pick(i){let f={};return j.objectKeys(i).forEach(m=>{i[m]&&this.shape[m]&&(f[m]=this.shape[m])}),new Le({...this._def,shape:()=>f})}omit(i){let f={};return j.objectKeys(this.shape).forEach(m=>{i[m]||(f[m]=this.shape[m])}),new Le({...this._def,shape:()=>f})}deepPartial(){return Ar(this)}partial(i){let f={};return j.objectKeys(this.shape).forEach(m=>{let w=this.shape[m];i&&!i[m]?f[m]=w:f[m]=w.optional()}),new Le({...this._def,shape:()=>f})}required(i){let f={};return j.objectKeys(this.shape).forEach(m=>{if(i&&!i[m])f[m]=this.shape[m];else{let _=this.shape[m];for(;_ instanceof Lt;)_=_._def.innerType;f[m]=_}}),new Le({...this._def,shape:()=>f})}keyof(){return aa(j.objectKeys(this.shape))}},"ZodObject");y(Le,"ZodObject"),Le.create=(i,f)=>new Le({shape:()=>i,unknownKeys:"strip",catchall:_t.create(),typeName:ie.ZodObject,...le(f)}),Le.strictCreate=(i,f)=>new Le({shape:()=>i,unknownKeys:"strict",catchall:_t.create(),typeName:ie.ZodObject,...le(f)}),Le.lazycreate=(i,f)=>new Le({shape:i,unknownKeys:"strip",catchall:_t.create(),typeName:ie.ZodObject,...le(f)});var Yr=Y(class extends he{_parse(i){let{ctx:f}=this._processInputParams(i),m=this._def.options;function w(_){for(let I of _)if(I.result.status==="valid")return I.result;for(let I of _)if(I.result.status==="dirty")return f.common.issues.push(...I.ctx.common.issues),I.result;let P=_.map(I=>new K(I.ctx.common.issues));return z(f,{code:A.invalid_union,unionErrors:P}),re}if(l(w,"handleResults"),Y(w,"handleResults"),y(w,"handleResults"),f.common.async)return Promise.all(m.map(async _=>{let P={...f,common:{...f.common,issues:[]},parent:null};return{result:await _._parseAsync({data:f.data,path:f.path,parent:P}),ctx:P}})).then(w);{let _,P=[];for(let F of m){let U={...f,common:{...f.common,issues:[]},parent:null},ue=F._parseSync({data:f.data,path:f.path,parent:U});if(ue.status==="valid")return ue;ue.status==="dirty"&&!_&&(_={result:ue,ctx:U}),U.common.issues.length&&P.push(U.common.issues)}if(_)return f.common.issues.push(..._.ctx.common.issues),_.result;let I=P.map(F=>new K(F));return z(f,{code:A.invalid_union,unionErrors:I}),re}}get options(){return this._def.options}},"ZodUnion");y(Yr,"ZodUnion"),Yr.create=(i,f)=>new Yr({options:i,typeName:ie.ZodUnion,...le(f)});var lr=y(i=>i instanceof En?lr(i.schema):i instanceof wt?lr(i.innerType()):i instanceof Ir?[i.value]:i instanceof Pr?i.options:i instanceof Cn?j.objectValues(i.enum):i instanceof Sn?lr(i._def.innerType):i instanceof Rr?[void 0]:i instanceof kr?[null]:i instanceof Lt?[void 0,...lr(i.unwrap())]:i instanceof cr?[null,...lr(i.unwrap())]:i instanceof oa||i instanceof Tn?lr(i.unwrap()):i instanceof en?lr(i._def.innerType):[],"getDiscriminator"),ia=Y(class extends he{_parse(i){let{ctx:f}=this._processInputParams(i);if(f.parsedType!==R.object)return z(f,{code:A.invalid_type,expected:R.object,received:f.parsedType}),re;let m=this.discriminator,w=f.data[m],_=this.optionsMap.get(w);return _?f.common.async?_._parseAsync({data:f.data,path:f.path,parent:f}):_._parseSync({data:f.data,path:f.path,parent:f}):(z(f,{code:A.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[m]}),re)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(i,f,m){let w=new Map;for(let _ of f){let P=lr(_.shape[i]);if(!P.length)throw new Error(`A discriminator value for key \`${i}\` could not be extracted from all schema options`);for(let I of P){if(w.has(I))throw new Error(`Discriminator property ${String(i)} has duplicate value ${String(I)}`);w.set(I,_)}}return new ia({typeName:ie.ZodDiscriminatedUnion,discriminator:i,options:f,optionsMap:w,...le(m)})}},"ZodDiscriminatedUnion");y(ia,"ZodDiscriminatedUnion");function bi(i,f){let m=Z(i),w=Z(f);if(i===f)return{valid:!0,data:i};if(m===R.object&&w===R.object){let _=j.objectKeys(f),P=j.objectKeys(i).filter(F=>_.indexOf(F)!==-1),I={...i,...f};for(let F of P){let U=bi(i[F],f[F]);if(!U.valid)return{valid:!1};I[F]=U.data}return{valid:!0,data:I}}else if(m===R.array&&w===R.array){if(i.length!==f.length)return{valid:!1};let _=[];for(let P=0;P<i.length;P++){let I=i[P],F=f[P],U=bi(I,F);if(!U.valid)return{valid:!1};_.push(U.data)}return{valid:!0,data:_}}else return m===R.date&&w===R.date&&+i==+f?{valid:!0,data:i}:{valid:!1}}l(bi,"mergeValues"),Y(bi,"mergeValues"),y(bi,"mergeValues");var xn=Y(class extends he{_parse(i){let{status:f,ctx:m}=this._processInputParams(i),w=y((_,P)=>{if(Cr(_)||Cr(P))return re;let I=bi(_.value,P.value);return I.valid?((vn(_)||vn(P))&&f.dirty(),{status:f.value,value:I.data}):(z(m,{code:A.invalid_intersection_types}),re)},"handleParsed");return m.common.async?Promise.all([this._def.left._parseAsync({data:m.data,path:m.path,parent:m}),this._def.right._parseAsync({data:m.data,path:m.path,parent:m})]).then(([_,P])=>w(_,P)):w(this._def.left._parseSync({data:m.data,path:m.path,parent:m}),this._def.right._parseSync({data:m.data,path:m.path,parent:m}))}},"ZodIntersection");y(xn,"ZodIntersection"),xn.create=(i,f,m)=>new xn({left:i,right:f,typeName:ie.ZodIntersection,...le(m)});var Dt=Y(class extends he{_parse(i){let{status:f,ctx:m}=this._processInputParams(i);if(m.parsedType!==R.array)return z(m,{code:A.invalid_type,expected:R.array,received:m.parsedType}),re;if(m.data.length<this._def.items.length)return z(m,{code:A.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),re;!this._def.rest&&m.data.length>this._def.items.length&&(z(m,{code:A.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),f.dirty());let _=[...m.data].map((P,I)=>{let F=this._def.items[I]||this._def.rest;return F?F._parse(new It(m,P,m.path,I)):null}).filter(P=>!!P);return m.common.async?Promise.all(_).then(P=>Qe.mergeArray(f,P)):Qe.mergeArray(f,_)}get items(){return this._def.items}rest(i){return new Dt({...this._def,rest:i})}},"ZodTuple");y(Dt,"ZodTuple"),Dt.create=(i,f)=>{if(!Array.isArray(i))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Dt({items:i,typeName:ie.ZodTuple,rest:null,...le(f)})};var _i=Y(class extends he{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(i){let{status:f,ctx:m}=this._processInputParams(i);if(m.parsedType!==R.object)return z(m,{code:A.invalid_type,expected:R.object,received:m.parsedType}),re;let w=[],_=this._def.keyType,P=this._def.valueType;for(let I in m.data)w.push({key:_._parse(new It(m,I,m.path,I)),value:P._parse(new It(m,m.data[I],m.path,I)),alwaysSet:I in m.data});return m.common.async?Qe.mergeObjectAsync(f,w):Qe.mergeObjectSync(f,w)}get element(){return this._def.valueType}static create(i,f,m){return f instanceof he?new _i({keyType:i,valueType:f,typeName:ie.ZodRecord,...le(m)}):new _i({keyType:Nt.create(),valueType:i,typeName:ie.ZodRecord,...le(f)})}},"ZodRecord");y(_i,"ZodRecord");var wi=Y(class extends he{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(i){let{status:f,ctx:m}=this._processInputParams(i);if(m.parsedType!==R.map)return z(m,{code:A.invalid_type,expected:R.map,received:m.parsedType}),re;let w=this._def.keyType,_=this._def.valueType,P=[...m.data.entries()].map(([I,F],U)=>({key:w._parse(new It(m,I,m.path,[U,"key"])),value:_._parse(new It(m,F,m.path,[U,"value"]))}));if(m.common.async){let I=new Map;return Promise.resolve().then(async()=>{for(let F of P){let U=await F.key,ue=await F.value;if(U.status==="aborted"||ue.status==="aborted")return re;(U.status==="dirty"||ue.status==="dirty")&&f.dirty(),I.set(U.value,ue.value)}return{status:f.value,value:I}})}else{let I=new Map;for(let F of P){let U=F.key,ue=F.value;if(U.status==="aborted"||ue.status==="aborted")return re;(U.status==="dirty"||ue.status==="dirty")&&f.dirty(),I.set(U.value,ue.value)}return{status:f.value,value:I}}}},"ZodMap");y(wi,"ZodMap"),wi.create=(i,f,m)=>new wi({valueType:f,keyType:i,typeName:ie.ZodMap,...le(m)});var Kr=Y(class extends he{_parse(i){let{status:f,ctx:m}=this._processInputParams(i);if(m.parsedType!==R.set)return z(m,{code:A.invalid_type,expected:R.set,received:m.parsedType}),re;let w=this._def;w.minSize!==null&&m.data.size<w.minSize.value&&(z(m,{code:A.too_small,minimum:w.minSize.value,type:"set",inclusive:!0,exact:!1,message:w.minSize.message}),f.dirty()),w.maxSize!==null&&m.data.size>w.maxSize.value&&(z(m,{code:A.too_big,maximum:w.maxSize.value,type:"set",inclusive:!0,exact:!1,message:w.maxSize.message}),f.dirty());let _=this._def.valueType;function P(F){let U=new Set;for(let ue of F){if(ue.status==="aborted")return re;ue.status==="dirty"&&f.dirty(),U.add(ue.value)}return{status:f.value,value:U}}l(P,"finalizeSet"),Y(P,"finalizeSet"),y(P,"finalizeSet");let I=[...m.data.values()].map((F,U)=>_._parse(new It(m,F,m.path,U)));return m.common.async?Promise.all(I).then(F=>P(F)):P(I)}min(i,f){return new Kr({...this._def,minSize:{value:i,message:Q.toString(f)}})}max(i,f){return new Kr({...this._def,maxSize:{value:i,message:Q.toString(f)}})}size(i,f){return this.min(i,f).max(i,f)}nonempty(i){return this.min(1,i)}},"ZodSet");y(Kr,"ZodSet"),Kr.create=(i,f)=>new Kr({valueType:i,minSize:null,maxSize:null,typeName:ie.ZodSet,...le(f)});var Or=Y(class extends he{constructor(){super(...arguments),this.validate=this.implement}_parse(i){let{ctx:f}=this._processInputParams(i);if(f.parsedType!==R.function)return z(f,{code:A.invalid_type,expected:R.function,received:f.parsedType}),re;function m(I,F){return Be({data:I,path:f.path,errorMaps:[f.common.contextualErrorMap,f.schemaErrorMap,Ne(),ne].filter(U=>!!U),issueData:{code:A.invalid_arguments,argumentsError:F}})}l(m,"makeArgsIssue"),Y(m,"makeArgsIssue"),y(m,"makeArgsIssue");function w(I,F){return Be({data:I,path:f.path,errorMaps:[f.common.contextualErrorMap,f.schemaErrorMap,Ne(),ne].filter(U=>!!U),issueData:{code:A.invalid_return_type,returnTypeError:F}})}l(w,"makeReturnsIssue"),Y(w,"makeReturnsIssue"),y(w,"makeReturnsIssue");let _={errorMap:f.common.contextualErrorMap},P=f.data;if(this._def.returns instanceof Xr){let I=this;return qe(async function(...F){let U=new K([]),ue=await I._def.args.parseAsync(F,_).catch(gr=>{throw U.addIssue(m(F,gr)),U}),Oe=await Reflect.apply(P,this,ue);return await I._def.returns._def.type.parseAsync(Oe,_).catch(gr=>{throw U.addIssue(w(Oe,gr)),U})})}else{let I=this;return qe(function(...F){let U=I._def.args.safeParse(F,_);if(!U.success)throw new K([m(F,U.error)]);let ue=Reflect.apply(P,this,U.data),Oe=I._def.returns.safeParse(ue,_);if(!Oe.success)throw new K([w(ue,Oe.error)]);return Oe.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...i){return new Or({...this._def,args:Dt.create(i).rest(Kt.create())})}returns(i){return new Or({...this._def,returns:i})}implement(i){return this.parse(i)}strictImplement(i){return this.parse(i)}static create(i,f,m){return new Or({args:i||Dt.create([]).rest(Kt.create()),returns:f||Kt.create(),typeName:ie.ZodFunction,...le(m)})}},"ZodFunction");y(Or,"ZodFunction");var En=Y(class extends he{get schema(){return this._def.getter()}_parse(i){let{ctx:f}=this._processInputParams(i);return this._def.getter()._parse({data:f.data,path:f.path,parent:f})}},"ZodLazy");y(En,"ZodLazy"),En.create=(i,f)=>new En({getter:i,typeName:ie.ZodLazy,...le(f)});var Ir=Y(class extends he{_parse(i){if(i.data!==this._def.value){let f=this._getOrReturnCtx(i);return z(f,{received:f.data,code:A.invalid_literal,expected:this._def.value}),re}return{status:"valid",value:i.data}}get value(){return this._def.value}},"ZodLiteral");y(Ir,"ZodLiteral"),Ir.create=(i,f)=>new Ir({value:i,typeName:ie.ZodLiteral,...le(f)});function aa(i,f){return new Pr({values:i,typeName:ie.ZodEnum,...le(f)})}l(aa,"createZodEnum"),Y(aa,"createZodEnum"),y(aa,"createZodEnum");var Pr=Y(class extends he{constructor(){super(...arguments),pi.set(this,void 0)}_parse(i){if(typeof i.data!="string"){let f=this._getOrReturnCtx(i),m=this._def.values;return z(f,{expected:j.joinValues(m),received:f.parsedType,code:A.invalid_type}),re}if(bn(this,pi,"f")||Wr(this,pi,new Set(this._def.values),"f"),!bn(this,pi,"f").has(i.data)){let f=this._getOrReturnCtx(i),m=this._def.values;return z(f,{received:f.data,code:A.invalid_enum_value,options:m}),re}return qe(i.data)}get options(){return this._def.values}get enum(){let i={};for(let f of this._def.values)i[f]=f;return i}get Values(){let i={};for(let f of this._def.values)i[f]=f;return i}get Enum(){let i={};for(let f of this._def.values)i[f]=f;return i}extract(i,f=this._def){return Pr.create(i,{...this._def,...f})}exclude(i,f=this._def){return Pr.create(this.options.filter(m=>!i.includes(m)),{...this._def,...f})}},"ZodEnum");y(Pr,"ZodEnum"),pi=new WeakMap,Pr.create=aa;var Cn=Y(class extends he{constructor(){super(...arguments),hi.set(this,void 0)}_parse(i){let f=j.getValidEnumValues(this._def.values),m=this._getOrReturnCtx(i);if(m.parsedType!==R.string&&m.parsedType!==R.number){let w=j.objectValues(f);return z(m,{expected:j.joinValues(w),received:m.parsedType,code:A.invalid_type}),re}if(bn(this,hi,"f")||Wr(this,hi,new Set(j.getValidEnumValues(this._def.values)),"f"),!bn(this,hi,"f").has(i.data)){let w=j.objectValues(f);return z(m,{received:m.data,code:A.invalid_enum_value,options:w}),re}return qe(i.data)}get enum(){return this._def.values}},"ZodNativeEnum");y(Cn,"ZodNativeEnum"),hi=new WeakMap,Cn.create=(i,f)=>new Cn({values:i,typeName:ie.ZodNativeEnum,...le(f)});var Xr=Y(class extends he{unwrap(){return this._def.type}_parse(i){let{ctx:f}=this._processInputParams(i);if(f.parsedType!==R.promise&&f.common.async===!1)return z(f,{code:A.invalid_type,expected:R.promise,received:f.parsedType}),re;let m=f.parsedType===R.promise?f.data:Promise.resolve(f.data);return qe(m.then(w=>this._def.type.parseAsync(w,{path:f.path,errorMap:f.common.contextualErrorMap})))}},"ZodPromise");y(Xr,"ZodPromise"),Xr.create=(i,f)=>new Xr({type:i,typeName:ie.ZodPromise,...le(f)});var wt=Y(class extends he{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ie.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(i){let{status:f,ctx:m}=this._processInputParams(i),w=this._def.effect||null,_={addIssue:P=>{z(m,P),P.fatal?f.abort():f.dirty()},get path(){return m.path}};if(_.addIssue=_.addIssue.bind(_),w.type==="preprocess"){let P=w.transform(m.data,_);if(m.common.async)return Promise.resolve(P).then(async I=>{if(f.value==="aborted")return re;let F=await this._def.schema._parseAsync({data:I,path:m.path,parent:m});return F.status==="aborted"?re:F.status==="dirty"||f.value==="dirty"?Qt(F.value):F});{if(f.value==="aborted")return re;let I=this._def.schema._parseSync({data:P,path:m.path,parent:m});return I.status==="aborted"?re:I.status==="dirty"||f.value==="dirty"?Qt(I.value):I}}if(w.type==="refinement"){let P=y(I=>{let F=w.refinement(I,_);if(m.common.async)return Promise.resolve(F);if(F instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return I},"executeRefinement");if(m.common.async===!1){let I=this._def.schema._parseSync({data:m.data,path:m.path,parent:m});return I.status==="aborted"?re:(I.status==="dirty"&&f.dirty(),P(I.value),{status:f.value,value:I.value})}else return this._def.schema._parseAsync({data:m.data,path:m.path,parent:m}).then(I=>I.status==="aborted"?re:(I.status==="dirty"&&f.dirty(),P(I.value).then(()=>({status:f.value,value:I.value}))))}if(w.type==="transform")if(m.common.async===!1){let P=this._def.schema._parseSync({data:m.data,path:m.path,parent:m});if(!Ot(P))return P;let I=w.transform(P.value,_);if(I instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:f.value,value:I}}else return this._def.schema._parseAsync({data:m.data,path:m.path,parent:m}).then(P=>Ot(P)?Promise.resolve(w.transform(P.value,_)).then(I=>({status:f.value,value:I})):P);j.assertNever(w)}},"ZodEffects");y(wt,"ZodEffects"),wt.create=(i,f,m)=>new wt({schema:i,typeName:ie.ZodEffects,effect:f,...le(m)}),wt.createWithPreprocess=(i,f,m)=>new wt({schema:f,effect:{type:"preprocess",transform:i},typeName:ie.ZodEffects,...le(m)});var Lt=Y(class extends he{_parse(i){return this._getType(i)===R.undefined?qe(void 0):this._def.innerType._parse(i)}unwrap(){return this._def.innerType}},"ZodOptional");y(Lt,"ZodOptional"),Lt.create=(i,f)=>new Lt({innerType:i,typeName:ie.ZodOptional,...le(f)});var cr=Y(class extends he{_parse(i){return this._getType(i)===R.null?qe(null):this._def.innerType._parse(i)}unwrap(){return this._def.innerType}},"ZodNullable");y(cr,"ZodNullable"),cr.create=(i,f)=>new cr({innerType:i,typeName:ie.ZodNullable,...le(f)});var Sn=Y(class extends he{_parse(i){let{ctx:f}=this._processInputParams(i),m=f.data;return f.parsedType===R.undefined&&(m=this._def.defaultValue()),this._def.innerType._parse({data:m,path:f.path,parent:f})}removeDefault(){return this._def.innerType}},"ZodDefault");y(Sn,"ZodDefault"),Sn.create=(i,f)=>new Sn({innerType:i,typeName:ie.ZodDefault,defaultValue:typeof f.default=="function"?f.default:()=>f.default,...le(f)});var en=Y(class extends he{_parse(i){let{ctx:f}=this._processInputParams(i),m={...f,common:{...f.common,issues:[]}},w=this._def.innerType._parse({data:m.data,path:m.path,parent:{...m}});return bt(w)?w.then(_=>({status:"valid",value:_.status==="valid"?_.value:this._def.catchValue({get error(){return new K(m.common.issues)},input:m.data})})):{status:"valid",value:w.status==="valid"?w.value:this._def.catchValue({get error(){return new K(m.common.issues)},input:m.data})}}removeCatch(){return this._def.innerType}},"ZodCatch");y(en,"ZodCatch"),en.create=(i,f)=>new en({innerType:i,typeName:ie.ZodCatch,catchValue:typeof f.catch=="function"?f.catch:()=>f.catch,...le(f)});var xi=Y(class extends he{_parse(i){if(this._getType(i)!==R.nan){let m=this._getOrReturnCtx(i);return z(m,{code:A.invalid_type,expected:R.nan,received:m.parsedType}),re}return{status:"valid",value:i.data}}},"ZodNaN");y(xi,"ZodNaN"),xi.create=i=>new xi({typeName:ie.ZodNaN,...le(i)});var rc=Symbol("zod_brand"),oa=Y(class extends he{_parse(i){let{ctx:f}=this._processInputParams(i),m=f.data;return this._def.type._parse({data:m,path:f.path,parent:f})}unwrap(){return this._def.type}},"ZodBranded");y(oa,"ZodBranded");var Ei=Y(class extends he{_parse(i){let{status:f,ctx:m}=this._processInputParams(i);if(m.common.async)return y(async()=>{let _=await this._def.in._parseAsync({data:m.data,path:m.path,parent:m});return _.status==="aborted"?re:_.status==="dirty"?(f.dirty(),Qt(_.value)):this._def.out._parseAsync({data:_.value,path:m.path,parent:m})},"handleAsync")();{let w=this._def.in._parseSync({data:m.data,path:m.path,parent:m});return w.status==="aborted"?re:w.status==="dirty"?(f.dirty(),{status:"dirty",value:w.value}):this._def.out._parseSync({data:w.value,path:m.path,parent:m})}}static create(i,f){return new Ei({in:i,out:f,typeName:ie.ZodPipeline})}},"ZodPipeline");y(Ei,"ZodPipeline");var Tn=Y(class extends he{_parse(i){let f=this._def.innerType._parse(i),m=y(w=>(Ot(w)&&(w.value=Object.freeze(w.value)),w),"freeze");return bt(f)?f.then(w=>m(w)):m(f)}unwrap(){return this._def.innerType}},"ZodReadonly");y(Tn,"ZodReadonly"),Tn.create=(i,f)=>new Tn({innerType:i,typeName:ie.ZodReadonly,...le(f)});function sa(i,f={},m){return i?sr.create().superRefine((w,_)=>{var P,I;if(!i(w)){let F=typeof f=="function"?f(w):typeof f=="string"?{message:f}:f,U=(I=(P=F.fatal)!==null&&P!==void 0?P:m)!==null&&I!==void 0?I:!0,ue=typeof F=="string"?{message:F}:F;_.addIssue({code:"custom",...ue,fatal:U})}}):sr.create()}l(sa,"custom"),Y(sa,"custom"),y(sa,"custom");var la={object:Le.lazycreate},ie;(function(i){i.ZodString="ZodString",i.ZodNumber="ZodNumber",i.ZodNaN="ZodNaN",i.ZodBigInt="ZodBigInt",i.ZodBoolean="ZodBoolean",i.ZodDate="ZodDate",i.ZodSymbol="ZodSymbol",i.ZodUndefined="ZodUndefined",i.ZodNull="ZodNull",i.ZodAny="ZodAny",i.ZodUnknown="ZodUnknown",i.ZodNever="ZodNever",i.ZodVoid="ZodVoid",i.ZodArray="ZodArray",i.ZodObject="ZodObject",i.ZodUnion="ZodUnion",i.ZodDiscriminatedUnion="ZodDiscriminatedUnion",i.ZodIntersection="ZodIntersection",i.ZodTuple="ZodTuple",i.ZodRecord="ZodRecord",i.ZodMap="ZodMap",i.ZodSet="ZodSet",i.ZodFunction="ZodFunction",i.ZodLazy="ZodLazy",i.ZodLiteral="ZodLiteral",i.ZodEnum="ZodEnum",i.ZodEffects="ZodEffects",i.ZodNativeEnum="ZodNativeEnum",i.ZodOptional="ZodOptional",i.ZodNullable="ZodNullable",i.ZodDefault="ZodDefault",i.ZodCatch="ZodCatch",i.ZodPromise="ZodPromise",i.ZodBranded="ZodBranded",i.ZodPipeline="ZodPipeline",i.ZodReadonly="ZodReadonly"})(ie||(ie={}));var ca=y((i,f={message:`Input not instance of ${i.name}`})=>sa(m=>m instanceof i,f),"instanceOfType"),as=Nt.create,os=dt.create,nc=xi.create,ss=Yt.create,to=Tr.create,ls=or.create,ic=Qr.create,ac=Rr.create,oc=kr.create,sc=sr.create,cs=Kt.create,us=_t.create,ds=vi.create,ro=jt.create,lc=Le.create,fs=Le.strictCreate,ua=Yr.create,ps=ia.create,cc=xn.create,hs=Dt.create,ms=_i.create,no=wi.create,uc=Kr.create,gs=Or.create,io=En.create,ao=Ir.create,Rn=Pr.create,ys=Cn.create,vs=Xr.create,bs=wt.create,_s=Lt.create,ws=cr.create,xs=wt.createWithPreprocess,Es=Ei.create,dc=y(()=>as().optional(),"ostring"),fc=y(()=>os().optional(),"onumber"),pc=y(()=>to().optional(),"oboolean"),Cs={string:i=>Nt.create({...i,coerce:!0}),number:i=>dt.create({...i,coerce:!0}),boolean:i=>Tr.create({...i,coerce:!0}),bigint:i=>Yt.create({...i,coerce:!0}),date:i=>or.create({...i,coerce:!0})},hc=re,s=Object.freeze({__proto__:null,defaultErrorMap:ne,setErrorMap:xe,getErrorMap:Ne,makeIssue:Be,EMPTY_PATH:zr,addIssueToContext:z,ParseStatus:Qe,INVALID:re,DIRTY:Qt,OK:qe,isAborted:Cr,isDirty:vn,isValid:Ot,isAsync:bt,get util(){return j},get objectUtil(){return O},ZodParsedType:R,getParsedType:Z,ZodType:he,datetimeRegex:na,ZodString:Nt,ZodNumber:dt,ZodBigInt:Yt,ZodBoolean:Tr,ZodDate:or,ZodSymbol:Qr,ZodUndefined:Rr,ZodNull:kr,ZodAny:sr,ZodUnknown:Kt,ZodNever:_t,ZodVoid:vi,ZodArray:jt,ZodObject:Le,ZodUnion:Yr,ZodDiscriminatedUnion:ia,ZodIntersection:xn,ZodTuple:Dt,ZodRecord:_i,ZodMap:wi,ZodSet:Kr,ZodFunction:Or,ZodLazy:En,ZodLiteral:Ir,ZodEnum:Pr,ZodNativeEnum:Cn,ZodPromise:Xr,ZodEffects:wt,ZodTransformer:wt,ZodOptional:Lt,ZodNullable:cr,ZodDefault:Sn,ZodCatch:en,ZodNaN:xi,BRAND:rc,ZodBranded:oa,ZodPipeline:Ei,ZodReadonly:Tn,custom:sa,Schema:he,ZodSchema:he,late:la,get ZodFirstPartyTypeKind(){return ie},coerce:Cs,any:sc,array:ro,bigint:ss,boolean:to,date:ls,discriminatedUnion:ps,effect:bs,enum:Rn,function:gs,instanceof:ca,intersection:cc,lazy:io,literal:ao,map:no,nan:nc,nativeEnum:ys,never:us,null:oc,nullable:ws,number:os,object:lc,oboolean:pc,onumber:fc,optional:_s,ostring:dc,pipeline:Es,preprocess:xs,promise:vs,record:ms,set:uc,strictObject:fs,string:as,symbol:ic,transformer:bs,tuple:hs,undefined:ac,union:ua,unknown:cs,void:ds,NEVER:hc,ZodIssueCode:A,quotelessJson:X,ZodError:K}),Ci=Symbol("current"),kn=Symbol("previous"),tn=y((i,{ref:f,refType:m,param:w,header:_,...P}={})=>({...P,...i}),"mergeOpenApi");function da(i){if(typeof i.ZodType.prototype.openapi<"u")return;i.ZodType.prototype.openapi=function(P){let{zodOpenApi:I,...F}=this._def,U=new this.constructor({...F,zodOpenApi:{openapi:tn(P,I?.openapi)}});return U._def.zodOpenApi[Ci]=U,I&&(U._def.zodOpenApi[kn]=this),U};let f=i.ZodType.prototype.describe;i.ZodType.prototype.describe=function(...P){let I=f.apply(this,P),F=I._def;if(F.zodOpenApi){let U={...F.zodOpenApi};U.openapi=tn({description:P[0]},U.openapi),U[kn]=this,U[Ci]=I,F.zodOpenApi=U}else F.zodOpenApi={openapi:{description:P[0]},[Ci]:I};return I};let m=i.ZodObject.prototype.extend;i.ZodObject.prototype.extend=function(...P){let I=m.apply(this,P),F=I._def.zodOpenApi;if(F){let U={...F};U.openapi=tn({},U.openapi),U[kn]=this,I._def.zodOpenApi=U}else I._def.zodOpenApi={[kn]:this};return I};let w=i.ZodObject.prototype.omit;i.ZodObject.prototype.omit=function(...P){let I=w.apply(this,P),F=I._def.zodOpenApi;if(F){let U={...F};U.openapi=tn({},U.openapi),delete U[kn],delete U[Ci],I._def.zodOpenApi=U}return I};let _=i.ZodObject.prototype.pick;i.ZodObject.prototype.pick=function(...P){let I=_.apply(this,P),F=I._def.zodOpenApi;if(F){let U={...F};U.openapi=tn({},U.openapi),delete U[kn],delete U[Ci],I._def.zodOpenApi=U}return I}}l(da,"extendZodWithOpenApi"),Y(da,"extendZodWithOpenApi"),y(da,"extendZodWithOpenApi"),da(s);var Si=s.array(s.string().or(s.record(s.any()))),mc=s.object({type:s.string().optional(),narrative:s.string().optional()}),Ti=s.string().or(s.object({id:s.string(),type:s.string(),caption:s.string().optional()})),Ss=s.object({type:s.string().min(1).or(s.string().array().nonempty()),latitude:s.number(),longitude:s.number()}),je=s.object({type:s.string().min(1).or(s.string().array().nonempty()),addressCountry:s.string().optional(),addressCountryCode:s.string().optional(),addressRegion:s.string().optional(),addressLocality:s.string().optional(),streetAddress:s.string().optional(),postOfficeBoxNumber:s.string().optional(),postalCode:s.string().optional(),geo:Ss.optional()}),Pe=s.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(s.string()),oo=s.object({type:s.string().min(1).or(s.string().array().nonempty()),identifier:s.string(),identifierType:Pe}),An=s.string().or(s.object({id:s.string().optional(),type:s.string().or(s.string().array().nonempty().optional()),name:s.string().optional(),url:s.string().optional(),phone:s.string().optional(),description:s.string().optional(),endorsement:s.any().array().optional(),image:Ti.optional(),email:s.string().email().optional(),address:je.optional(),otherIdentifier:oo.array().optional(),official:s.string().optional(),parentOrg:s.any().optional(),familyName:s.string().optional(),givenName:s.string().optional(),additionalName:s.string().optional(),patronymicName:s.string().optional(),honorificPrefix:s.string().optional(),honorificSuffix:s.string().optional(),familyNamePrefix:s.string().optional(),dateOfBirth:s.string().optional()}).catchall(s.any())),fa=s.object({id:s.string().optional()}).catchall(s.any()),Ri=s.object({type:s.string(),id:s.string()}).catchall(s.any()),so=s.object({id:s.string(),type:s.string()}).catchall(s.any()),lo=s.object({id:s.string().optional(),type:s.string()}).catchall(s.any()),pa=s.object({type:s.string(),id:s.string().optional()}).catchall(s.any()),co=s.object({type:s.string().or(s.string().array().nonempty()),id:s.string().optional()}).catchall(s.any()),Me=s.object({"@context":Si,id:s.string().optional(),type:s.string().array().nonempty(),issuer:An,credentialSubject:fa.or(fa.array()),refreshService:lo.or(lo.array()).optional(),credentialSchema:so.or(so.array()).optional(),issuanceDate:s.string().optional(),expirationDate:s.string().optional(),credentialStatus:Ri.or(Ri.array()).optional(),name:s.string().optional(),description:s.string().optional(),validFrom:s.string().optional(),validUntil:s.string().optional(),status:Ri.or(Ri.array()).optional(),termsOfUse:pa.or(pa.array()).optional(),evidence:co.or(co.array()).optional()}).catchall(s.any()),ft=s.object({type:s.string(),created:s.string(),challenge:s.string().optional(),domain:s.string().optional(),nonce:s.string().optional(),proofPurpose:s.string(),verificationMethod:s.string(),jws:s.string().optional()}).catchall(s.any()),Mt=Me.extend({proof:ft.or(ft.array())}),uo=s.object({"@context":Si,id:s.string().optional(),type:s.string().or(s.string().array().nonempty()),verifiableCredential:Mt.or(Mt.array()).optional(),holder:s.string().optional()}).catchall(s.any()),ki=uo.extend({proof:ft.or(ft.array())}),nt=s.object({kty:s.string(),crv:s.string(),x:s.string(),y:s.string().optional(),n:s.string().optional(),d:s.string().optional()}),Ts=nt.omit({d:!0}).extend({d:s.string()}),fo=s.object({alg:s.string(),iv:s.string(),tag:s.string(),epk:nt.partial().optional(),kid:s.string().optional(),apv:s.string().optional(),apu:s.string().optional()}),po=s.object({header:fo,encrypted_key:s.string()}),ho=s.object({protected:s.string(),iv:s.string(),ciphertext:s.string(),tag:s.string(),aad:s.string().optional(),recipients:po.array().optional()}),ur=s.string().or(s.object({"@context":Si.optional(),id:s.string(),type:s.string(),controller:s.string(),publicKeyJwk:nt.optional(),publicKeyBase58:s.string().optional(),publicKeyMultibase:s.string().optional(),blockChainAccountId:s.string().optional()}).catchall(s.any())),mo=s.object({id:s.string(),type:s.string().or(s.string().array().nonempty()),serviceEndpoint:s.any().or(s.any().array().nonempty())}).catchall(s.any()),pt=s.object({"@context":Si,id:s.string(),alsoKnownAs:s.string().optional(),controller:s.string().or(s.string().array().nonempty()).optional(),verificationMethod:ur.array().optional(),authentication:ur.array().optional(),assertionMethod:ur.array().optional(),keyAgreement:ur.array().optional(),capabilityInvocation:ur.array().optional(),capabilityDelegation:ur.array().optional(),publicKey:ur.array().optional(),service:mo.array().optional(),proof:ft.or(ft.array()).optional()}).catchall(s.any()),Rs=s.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(s.string()),Xe=s.object({type:s.string().array().nonempty(),targetCode:s.string().optional(),targetDescription:s.string().optional(),targetName:s.string(),targetFramework:s.string().optional(),targetType:Rs.optional(),targetUrl:s.string()}),ks=s.enum(["Achievement","ApprenticeshipCertificate","Assessment","Assignment","AssociateDegree","Award","Badge","BachelorDegree","Certificate","CertificateOfCompletion","Certification","CommunityService","Competency","Course","CoCurricular","Degree","Diploma","DoctoralDegree","Fieldwork","GeneralEducationDevelopment","JourneymanCertificate","LearningProgram","License","Membership","ProfessionalDoctorate","QualityAssuranceCredential","MasterCertificate","MasterDegree","MicroCredential","ResearchDoctorate","SecondarySchoolDiploma"]),go=ks.or(s.string()),dr=s.object({id:s.string().optional(),narrative:s.string().optional()}).catchall(s.any()),Ai=s.object({id:s.string(),type:s.string().array().nonempty(),endorsementComment:s.string().optional()}),ha=Me.extend({credentialSubject:Ai,proof:ft.or(ft.array()).optional()}),De=s.object({id:s.string(),"@language":s.string().optional(),version:s.string().optional()}),fr=s.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(s.string()),ma=s.object({id:s.string(),type:s.string().array().nonempty(),alignment:Xe.array().optional(),description:s.string().optional(),level:s.string().optional(),name:s.string(),points:s.string().optional()}).catchall(s.any()),As=s.object({id:s.string(),type:s.string().array().nonempty(),alignment:Xe.array().optional(),allowedValue:s.string().array().optional(),name:s.string(),requiredLevel:s.string().optional(),requiredValue:s.string().optional(),resultType:fr,rubricCriterionLevel:ma.array().optional(),valueMax:s.string().optional(),valueMin:s.string().optional()}).catchall(s.any()),ga=s.object({id:s.string().optional(),type:s.string().array().nonempty(),alignment:Xe.array().optional(),achievementType:go.optional(),creator:An.optional(),creditsAvailable:s.number().optional(),criteria:dr,description:s.string(),endorsement:ha.array().optional(),fieldOfStudy:s.string().optional(),humanCode:s.string().optional(),image:Ti.optional(),"@language":s.string().optional(),name:s.string(),otherIdentifier:oo.array().optional(),related:De.array().optional(),resultDescription:As.array().optional(),specialization:s.string().optional(),tag:s.string().array().optional(),version:s.string().optional()}).catchall(s.any()),Os=s.object({type:s.string(),hashed:s.boolean(),identityHash:s.string(),identityType:s.string(),salt:s.string().optional()}),Is=s.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),Ps=s.object({type:s.string().array().nonempty(),achievedLevel:s.string().optional(),alignment:Xe.array().optional(),resultDescription:s.string().optional(),status:Is.optional(),value:s.string().optional()}).catchall(s.any()),ya=s.object({id:s.string().optional(),type:s.string().array().nonempty(),activityEndDate:s.string().optional(),activityStartDate:s.string().optional(),creditsEarned:s.number().optional(),achievement:ga.optional(),identifier:Os.array().optional(),image:Ti.optional(),licenseNumber:s.string().optional(),narrative:s.string().optional(),result:Ps.array().optional(),role:s.string().optional(),source:An.optional(),term:s.string().optional()}).catchall(s.any()),Oi=s.object({id:s.string().optional(),type:s.string().or(s.string().array().nonempty()),narrative:s.string().optional(),name:s.string().optional(),description:s.string().optional(),genre:s.string().optional(),audience:s.string().optional()}).catchall(s.any()),rn=Me.extend({name:s.string().optional(),description:s.string().optional(),image:Ti.optional(),credentialSubject:ya.or(ya.array()),endorsement:Me.array().optional(),evidence:Oi.array().optional()}),gc=rn.extend({proof:ft.or(ft.array())}),Vs=s.object({checks:s.string().array(),warnings:s.string().array(),errors:s.string().array()}),va=s.enum(["Success","Failed","Error"]),yo=va.enum,vo=s.object({check:s.string(),status:va,message:s.string().optional(),details:s.string().optional()}),Ns=s.object({title:s.string().optional(),createdAt:s.string().optional(),issuer:An.optional(),issuee:An.optional(),credentialSubject:fa.optional()}),yc=s.object({id:s.string(),uri:s.string()}).catchall(s.any()),bo=s.object({limit:s.number(),cursor:s.string().optional(),sort:s.string().optional()}),$e=s.object({cursor:s.string().optional(),hasMore:s.boolean()}),_o=s.object({encryptedRecord:ho,fields:s.string().array()}).catchall(s.any()),js=$e.extend({records:_o.array()}),st=_o.extend({id:s.string()}),wo=$e.extend({records:st.array()}),On=y(i=>{let f=i.match(/^\/(.*)\/([gimsuy]*)$/);if(!f)throw new Error("Invalid RegExp string format");return{pattern:f[1],flags:f[2]}},"parseRegexString"),xo=s.instanceof(RegExp).or(s.string().refine(i=>{try{return On(i),!0}catch{return!1}},{message:"Invalid RegExp string format. Must be in format '/pattern/flags'"}).transform(i=>{let{pattern:f,flags:m}=On(i);try{return new RegExp(f,m)}catch(w){throw new Error(`Invalid RegExp: ${w.message}`)}})),Eo=s.string().or(s.object({$in:s.string().array()})).or(s.object({$regex:xo})),fe=s.union([Eo,s.object({$or:Eo.array()})]);da(s);var Ds=s.object({backgroundColor:s.string().optional(),backgroundImage:s.string().optional(),fadeBackgroundImage:s.boolean().optional(),repeatBackgroundImage:s.boolean().optional(),fontColor:s.string().optional(),accentColor:s.string().optional(),accentFontColor:s.string().optional(),idBackgroundImage:s.string().optional(),fadeIdBackgroundImage:s.boolean().optional(),idBackgroundColor:s.string().optional(),repeatIdBackgroundImage:s.boolean().optional()}),Ut=s.object({profileId:s.string().min(3).max(40).describe("Unique, URL-safe identifier for the profile."),displayName:s.string().default("").describe("Human-readable display name for the profile."),shortBio:s.string().default("").describe("Short bio for the profile."),bio:s.string().default("").describe("Longer bio for the profile."),did:s.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),isPrivate:s.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),email:s.string().optional().describe("Contact email address for the profile. (deprecated)"),image:s.string().optional().describe("Profile image URL for the profile."),heroImage:s.string().optional().describe("Hero image URL for the profile."),websiteLink:s.string().optional().describe("Website link for the profile."),isServiceProfile:s.boolean().default(!1).optional().describe("Whether the profile is a service profile or not."),type:s.string().optional().describe('Profile type: e.g. "person", "organization", "service".'),notificationsWebhook:s.string().url().startsWith("http").optional().describe("URL to send notifications to."),display:Ds.optional().describe("Display settings for the profile."),highlightedCredentials:s.array(s.string()).max(5).optional().describe("Up to 5 unique boost URIs to highlight on the profile."),role:s.string().default("").optional().describe('Role of the profile: e.g. "teacher", "student".'),dob:s.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".'),country:s.string().optional().describe("Country for the profile."),approved:s.boolean().optional().describe("Approval status for the profile.")}),vc=s.object({profileId:fe,displayName:fe,shortBio:fe,bio:fe,email:fe,websiteLink:fe,isServiceProfile:s.boolean(),type:fe}).partial(),bc=$e.extend({records:Ut.array()}),In=s.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),Co=s.object({id:s.string(),created:s.string(),displayName:s.string().default("").optional(),shortBio:s.string().default("").optional(),bio:s.string().default("").optional(),email:s.string().optional(),image:s.string().optional(),heroImage:s.string().optional()}),_c=$e.extend({records:Co.extend({did:s.string()}).array()}),So=s.object({id:fe,displayName:fe,shortBio:fe,bio:fe,email:fe}).partial(),Ls=$e.extend({records:s.object({profile:Ut,manager:Co.extend({did:s.string()}).optional()}).array()}),Vr=s.object({uri:s.string(),to:s.string(),from:s.string(),sent:s.string().datetime(),received:s.string().datetime().optional()}),Pn=s.object({role:s.string(),canEdit:s.boolean(),canIssue:s.boolean(),canRevoke:s.boolean(),canManagePermissions:s.boolean(),canIssueChildren:s.string(),canCreateChildren:s.string(),canEditChildren:s.string(),canRevokeChildren:s.string(),canManageChildrenPermissions:s.string(),canManageChildrenProfiles:s.boolean().default(!1).optional(),canViewAnalytics:s.boolean()}),Ms=s.object({role:fe,canEdit:s.boolean(),canIssue:s.boolean(),canRevoke:s.boolean(),canManagePermissions:s.boolean(),canIssueChildren:fe,canCreateChildren:fe,canEditChildren:fe,canRevokeChildren:fe,canManageChildrenPermissions:fe,canManageChildrenProfiles:s.boolean(),canViewAnalytics:s.boolean()}).partial(),ba=s.enum(["GRANT_PERMISSIONS","ADD_ADMIN","AUTO_CONNECT"]),Us=s.discriminatedUnion("type",[s.object({type:s.literal(ba.Values.GRANT_PERMISSIONS),data:s.object({claimUri:s.string(),targetUri:s.string(),permissions:Pn.partial()})}),s.object({type:s.literal(ba.Values.ADD_ADMIN),data:s.object({claimUri:s.string(),targetUri:s.string()})}),s.object({type:s.literal(ba.Values.AUTO_CONNECT),data:s.object({claimUri:s.string(),targetUri:s.string()})})]),Vn=s.object({type:fe,data:s.object({claimUri:fe,targetUri:fe,permissions:Ms})}).deepPartial(),xt=s.object({id:s.string(),createdAt:s.string(),updatedAt:s.string()}).and(Us),Bs=$e.extend({records:xt.array()}),_a=s.enum(["DRAFT","LIVE"]),Fs=s.object({uri:s.string(),name:s.string().optional(),type:s.string().optional(),category:s.string().optional(),status:_a.optional(),autoConnectRecipients:s.boolean().optional(),meta:s.record(s.any()).optional(),claimPermissions:Pn.optional(),allowAnyoneToCreateChildren:s.boolean().optional()}),Zs=s.object({uri:fe,name:fe,type:fe,category:fe,meta:s.record(fe),status:_a.or(s.object({$in:_a.array()})),autoConnectRecipients:s.boolean()}).partial(),wc=s.union([s.object({$or:Zs.array()}),Zs]),xc=$e.extend({records:Fs.array()}),pr=s.object({to:Ut,from:s.string(),received:s.string().optional(),uri:s.string().optional()}),S=$e.extend({records:pr.array()}),D=s.object({to:Ut,from:s.string(),received:s.string().optional(),boostUris:s.array(s.string()),credentialUris:s.array(s.string()).optional()}),N=$e.extend({records:D.array()}),G=s.object({endpoint:s.string(),name:s.string(),did:s.string().optional()}),pe=s.object({ttlSeconds:s.number().optional(),totalUses:s.number().optional()}),Te=s.object({endpoint:s.string()}),He=s.object({signingAuthority:Te,relationship:s.object({name:s.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:s.string(),isPrimary:s.boolean().optional()})}),Ve=s.object({boostUri:s.string(),signingAuthority:s.object({endpoint:s.string(),name:s.string()})}),wa=s.enum(["live","stale","withdrawn"]),qs=s.object({read:s.object({anonymize:s.boolean().optional(),credentials:s.object({categories:s.record(s.object({required:s.boolean(),defaultEnabled:s.boolean().optional()})).default({})}).default({}),personal:s.record(s.object({required:s.boolean(),defaultEnabled:s.boolean().optional()})).default({})}).default({}),write:s.object({credentials:s.object({categories:s.record(s.object({required:s.boolean(),defaultEnabled:s.boolean().optional()})).default({})}).default({}),personal:s.record(s.object({required:s.boolean(),defaultEnabled:s.boolean().optional()})).default({})}).default({})}),lt=s.object({contract:qs,owner:Ut,name:s.string(),subtitle:s.string().optional(),description:s.string().optional(),reasonForAccessing:s.string().optional(),image:s.string().optional(),uri:s.string(),needsGuardianConsent:s.boolean().optional(),redirectUrl:s.string().optional(),frontDoorBoostUri:s.string().optional(),createdAt:s.string(),updatedAt:s.string(),expiresAt:s.string().optional(),autoBoosts:s.string().array().optional(),writers:s.array(Ut).optional()}),xa=$e.extend({records:lt.omit({owner:!0}).array()}),$s=s.object({credentials:s.object({categories:s.record(s.string().array()).default({})}),personal:s.record(s.string()).default({}),date:s.string()}),Nn=$e.extend({records:$s.array()}),Ii=s.object({credentials:s.object({category:s.string(),uri:s.string()}).array(),personal:s.record(s.string()).default({}),date:s.string(),contractUri:s.string()}),Ea=$e.extend({records:Ii.array()}),Ae=s.object({sharing:s.boolean().optional(),shared:s.string().array().optional(),shareAll:s.boolean().optional(),shareUntil:s.string().optional()}),To=s.object({read:s.object({anonymize:s.boolean().optional(),credentials:s.object({shareAll:s.boolean().optional(),sharing:s.boolean().optional(),categories:s.record(Ae).default({})}).default({}),personal:s.record(s.string()).default({})}).default({}),write:s.object({credentials:s.object({categories:s.record(s.boolean()).default({})}).default({}),personal:s.record(s.boolean()).default({})}).default({}),deniedWriters:s.array(s.string()).optional()}),zs=$e.extend({records:s.object({expiresAt:s.string().optional(),oneTime:s.boolean().optional(),terms:To,contract:lt,uri:s.string(),consenter:Ut,status:wa}).array()}),Ca=s.object({read:s.object({anonymize:s.boolean().optional(),credentials:s.object({categories:s.record(s.object({required:s.boolean().optional()})).optional()}).optional(),personal:s.record(s.object({required:s.boolean().optional()})).optional()}).optional(),write:s.object({credentials:s.object({categories:s.record(s.object({required:s.boolean().optional()})).optional()}).optional(),personal:s.record(s.object({required:s.boolean().optional()})).optional()}).optional()}),Ec=s.object({anonymize:s.boolean().optional(),credentials:s.object({categories:s.record(s.boolean()).optional()}).optional(),personal:s.record(s.boolean()).optional()}),Cc=s.object({credentials:s.object({categories:s.record(s.boolean()).optional()}).optional(),personal:s.record(s.boolean()).optional(),id:fe.optional()}),Ws=s.object({read:s.object({anonymize:s.boolean().optional(),credentials:s.object({shareAll:s.boolean().optional(),sharing:s.boolean().optional(),categories:s.record(Ae.optional()).optional()}).optional(),personal:s.record(s.string()).optional()}).optional(),write:s.object({credentials:s.object({categories:s.record(s.boolean()).optional()}).optional(),personal:s.record(s.boolean()).optional()}).optional()}),nn=s.enum(["consent","update","sync","withdraw","write"]),Nr=s.object({terms:Ws.optional(),action:nn.or(nn.array()).optional(),date:s.object({$gt:s.string()}).or(s.object({$lt:s.string()})).or(s.object({$eq:s.string()})).optional(),expiresAt:s.object({$gt:s.string()}).or(s.object({$lt:s.string()})).or(s.object({$eq:s.string()})).optional(),oneTime:s.boolean().optional()}),jn=s.object({expiresAt:s.string().optional(),oneTime:s.boolean().optional(),terms:To.optional(),id:s.string(),action:nn,date:s.string(),uris:s.string().array().optional()}),Hs=$e.extend({records:jn.array()}),Pi=s.object({id:fe,name:fe,description:fe,sourceURI:fe,status:fe}).partial(),Gs=s.union([s.object({$or:Pi.array()}),Pi]),Ro=s.object({credentialUri:s.string(),termsUri:s.string(),contractUri:s.string(),boostUri:s.string(),category:s.string().optional(),date:s.string()}),Sa=$e.extend({records:Ro.array()}),ko=s.enum(["CONNECTION_REQUEST","CONNECTION_ACCEPTED","CREDENTIAL_RECEIVED","CREDENTIAL_ACCEPTED","BOOST_RECEIVED","BOOST_ACCEPTED","PRESENTATION_REQUEST","PRESENTATION_RECEIVED","CONSENT_FLOW_TRANSACTION","ISSUANCE_CLAIMED","ISSUANCE_DELIVERED","ISSUANCE_ERROR","PROFILE_PARENT_APPROVED"]),Dn=s.object({title:s.string().optional(),body:s.string().optional()}),jr=s.object({type:s.string(),value:s.string()}),Dr=s.enum(["PENDING","ISSUED","EXPIRED","DELIVERED","CLAIMED"]),Js=s.object({issuanceId:s.string(),status:Dr,recipient:s.object({contactMethod:jr.optional(),learnCardId:s.string().optional()}),timestamp:s.string().datetime().optional()}),Qs=s.object({vcUris:s.array(s.string()).optional(),vpUris:s.array(s.string()).optional(),transaction:jn.optional(),inbox:Js.optional()}),Sc=s.object({type:ko,to:Ut.partial().and(s.object({did:s.string()})),from:Ut.partial().and(s.object({did:s.string()})),message:Dn.optional(),data:Qs.optional(),sent:s.string().datetime().optional(),webhookUrl:s.string().optional()}),Vi="auth-grant:",Ta=s.object({id:s.string(),name:s.string(),description:s.string().optional(),challenge:s.string().startsWith(Vi).min(10,{message:"Challenge is too short"}).max(100,{message:"Challenge is too long"}),status:s.enum(["revoked","active"],{required_error:"Status is required",invalid_type_error:"Status must be either active or revoked"}),scope:s.string(),createdAt:s.string().datetime({message:"createdAt must be a valid ISO 8601 datetime string"}),expiresAt:s.string().datetime({message:"expiresAt must be a valid ISO 8601 datetime string"}).nullish().optional()}),Ao=s.object({id:s.string()}).catchall(s.any()),Ys=s.enum(["active","revoked"]),Ks=s.object({id:fe,name:fe,description:fe,status:Ys}).partial(),Xs=s.object({id:s.string(),isVerified:s.boolean(),verifiedAt:s.string().optional(),isPrimary:s.boolean(),createdAt:s.string()}),Tc=s.discriminatedUnion("type",[s.object({type:s.literal("email"),value:s.string().email()}).merge(Xs),s.object({type:s.literal("phone"),value:s.string()}).merge(Xs)]),ze=s.object({isVerified:s.boolean().optional(),isPrimary:s.boolean().optional()}),et=s.discriminatedUnion("type",[s.object({type:s.literal("email"),value:s.string().email()}).merge(ze),s.object({type:s.literal("phone"),value:s.string()}).merge(ze)]),Oo=s.discriminatedUnion("type",[s.object({type:s.literal("email"),value:s.string().email()}),s.object({type:s.literal("phone"),value:s.string()})]),el=s.object({value:s.string(),type:s.enum(["email","phone"])}),tl=s.object({token:s.string()}),Rc=s.object({contactMethodId:s.string()}),Io=s.object({contactMethod:el,otpChallenge:s.string()}),Ni=s.object({sessionJwt:s.string()}),Ra=s.object({id:s.string(),credential:s.string(),isSigned:s.boolean(),currentStatus:Dr,isAccepted:s.boolean().optional(),expiresAt:s.string(),createdAt:s.string(),issuerDid:s.string(),webhookUrl:s.string().optional(),signingAuthority:s.object({endpoint:s.string().optional(),name:s.string().optional()}).optional()}),Ln=s.object({hasMore:s.boolean(),records:s.array(Ra),cursor:s.string().optional()}),ji=s.object({currentStatus:Dr,id:s.string(),isSigned:s.boolean(),isAccepted:s.boolean().optional(),issuerDid:s.string()}).partial(),Mn=s.object({endpoint:s.string().url(),name:s.string()}),ka=s.object({recipient:Oo.describe("The recipient of the credential"),credential:Mt.passthrough().or(ki.passthrough()).or(Me.passthrough()).describe("The credential to issue. If not signed, the users default signing authority will be used, or the specified signing authority in the configuration."),configuration:s.object({signingAuthority:Mn.optional().describe("The signing authority to use for the credential. If not provided, the users default signing authority will be used if the credential is not signed."),webhookUrl:s.string().url().optional().describe("The webhook URL to receive credential issuance events."),expiresInDays:s.number().min(1).max(365).optional().describe("The number of days the credential will be valid for."),delivery:s.object({suppress:s.boolean().optional().default(!1).describe("Whether to suppress delivery of the credential to the recipient. If true, the email/sms will not be sent to the recipient. Useful if you would like to manually send claim link to your users."),template:s.object({id:s.enum(["universal-inbox-claim"]).optional().describe("The template ID to use for the credential delivery. If not provided, the default template will be used."),model:s.object({issuer:s.object({name:s.string().optional().describe('The name of the organization (e.g., "State University").'),logoUrl:s.string().url().optional().describe("The URL of the organization's logo.")}).optional(),credential:s.object({name:s.string().optional().describe('The name of the credential (e.g., "Bachelor of Science").'),type:s.string().optional().describe('The type of the credential (e.g., "degree", "certificate").')}).optional(),recipient:s.object({name:s.string().optional().describe('The name of the recipient (e.g., "John Doe").')}).optional()}).describe("The template model to use for the credential delivery. Injects via template variables into email/sms templates. If not provided, the default template will be used.")}).optional().describe("The template to use for the credential delivery. If not provided, the default template will be used.")}).optional().describe("Configuration for the credential delivery i.e. email or SMS. When credentials are sent to a user who has a verified email or phone associated with their account, delivery is skipped, and the credential will be sent using in-app notifications. If not provided, the default configuration will be used.")}).optional().describe("Configuration for the credential issuance. If not provided, the default configuration will be used.")}),Un=s.object({issuanceId:s.string(),status:Dr,recipient:Oo,claimUrl:s.string().url().optional(),recipientDid:s.string().optional()}),kc=s.object({credential:Mt.passthrough().or(ki.passthrough()).or(Me.passthrough()).describe("The credential to issue."),configuration:s.object({publishableKey:s.string(),signingAuthorityName:s.string().optional()}).optional()}),Aa=s.union([s.string().regex(/^(?:(?:[a-zA-Z0-9-]{1,63}\.)+[a-zA-Z]{2,63}|localhost|\d{1,3}(?:\.\d{1,3}){3})(?::\d{1,5})?$/,{message:"Must be a valid domain (incl. subdomains), localhost, or IPv4, optionally with port"}),s.string().regex(/^https?:\/\/(?:(?:[a-zA-Z0-9-]{1,63}\.)+[a-zA-Z]{2,63}|localhost|\d{1,3}(?:\.\d{1,3}){3})(?::\d{1,5})?$/,{message:"Must be a valid http(s) origin"})]),rl=s.object({id:s.string(),name:s.string(),description:s.string().optional(),publishableKey:s.string(),whitelistedDomains:s.array(Aa).default([])}),Ac=s.object({name:s.string(),description:s.string().optional(),whitelistedDomains:s.array(Aa).default([])}),Oc=s.object({name:s.string().optional(),description:s.string().optional(),whitelistedDomains:s.array(Aa).optional(),rotatePublishableKey:s.boolean().optional()}),Oa=s.object({id:fe,name:fe,description:fe}).partial(),Di=$e.extend({records:rl.array()}),nl=s.object({token:s.string(),contactMethodId:s.string(),autoVerifyContactMethod:s.boolean().optional().default(!1),createdAt:s.string(),expiresAt:s.string(),used:s.boolean()}),v=s.object({id:s.string(),name:s.string().min(1),slug:s.string().min(1),createdAt:s.string().optional(),updatedAt:s.string().optional()}),Bt=s.enum(["active","archived"]),Bn=s.object({id:s.string(),statement:s.string(),description:s.string().optional(),code:s.string().optional(),icon:s.string().optional(),type:s.string().default("skill"),status:Bt.default("active"),frameworkId:s.string().optional(),createdAt:s.string().optional(),updatedAt:s.string().optional()}),ht=s.object({id:fe,statement:fe,description:fe,code:fe,type:fe,status:Bt.or(s.object({$in:Bt.array()}))}).partial(),Ee=s.union([s.object({$or:ht.array()}),ht]),Ia=s.enum(["active","archived"]),Po=s.object({id:s.string(),name:s.string(),description:s.string().optional(),image:s.string().optional(),sourceURI:s.string().url().optional(),status:Ia.default("active"),createdAt:s.string().optional(),updatedAt:s.string().optional()}),Ic=$e.extend({records:Po.array()}),Xt=Bn.extend({children:s.array(s.lazy(()=>Xt)),hasChildren:s.boolean(),childrenCursor:s.string().nullable().optional()}).openapi({ref:"SkillTreeNode"}),il=s.object({hasMore:s.boolean(),cursor:s.string().nullable(),records:s.array(Xt)}),an=s.lazy(()=>s.object({id:s.string().optional(),statement:s.string(),description:s.string().optional(),code:s.string().optional(),icon:s.string().optional(),type:s.string().optional(),status:Bt.optional(),children:s.array(an).optional()})).openapi({ref:"SkillTreeNodeInput"}),Pc=s.object({frameworkId:s.string()}),al=s.object({id:s.string().optional(),name:s.string().min(1),description:s.string().optional(),image:s.string().optional(),sourceURI:s.string().url().optional(),status:Ia.optional(),skills:s.array(an).optional(),boostUris:s.array(s.string()).optional()}),Vc=s.object({id:s.string(),name:s.string().min(1).optional(),description:s.string().optional(),image:s.string().optional(),sourceURI:s.string().url().optional(),status:Ia.optional()}).refine(i=>i.name!==void 0||i.description!==void 0||i.image!==void 0||i.sourceURI!==void 0||i.status!==void 0,{message:"At least one field must be provided to update",path:["name"]}),hr=s.object({id:s.string()}),Nc=s.object({frameworks:s.array(al.extend({skills:s.array(an).optional()})).min(1)}),jc=s.object({frameworkId:s.string(),profileId:s.string()}),Dc=s.object({frameworkId:s.string()}),Lc=Ut.array(),Mc=s.object({id:s.string()}),mr=s.object({slug:s.string().min(1),name:s.string().min(1)}),Uc=s.object({frameworkId:s.string(),skill:an,parentId:s.string().nullable().optional()}),Bc=s.object({frameworkId:s.string(),id:s.string(),statement:s.string().optional(),description:s.string().optional(),code:s.string().optional(),icon:s.string().optional(),type:s.string().optional(),status:Bt.optional()}).refine(i=>i.statement!==void 0||i.description!==void 0||i.code!==void 0||i.icon!==void 0||i.type!==void 0||i.status!==void 0,{message:"At least one field must be provided to update a skill",path:["statement"]}),ol=s.enum(["recursive","reparent"]),Fc=s.object({frameworkId:s.string(),id:s.string(),strategy:ol.optional().default("reparent")}),Zc=s.object({frameworkId:s.string(),skills:s.array(an).min(1),parentId:s.string().nullable().optional()}),on=s.object({frameworkId:s.string(),skills:s.array(an).min(0)}),qc=s.object({created:s.number().int().min(0),updated:s.number().int().min(0),deleted:s.number().int().min(0),unchanged:s.number().int().min(0),total:s.number().int().min(0)}),$c=s.object({frameworkId:s.string(),skillId:s.string().optional(),recursive:s.boolean().optional().default(!1),onlyCountCompetencies:s.boolean().optional().default(!1)}),Ft=s.object({count:s.number().int().min(0)}),zc=s.object({frameworkId:s.string()}),Wc=s.object({skills:s.array(Xt)}),Hc=s.object({frameworkId:s.string(),skillId:s.string()}),Gc=s.object({path:s.array(Bn)}),Jc=s.object({framework:Po,skills:il})}}),rw=Up({"../learn-card-types/dist/index.js"(n,r){"use strict";r.exports=tw()}}),nw=ew(rw());var zi=Y(n=>nw.JWEValidator.safeParse(n).success,"isEncrypted");var Re;(function(n){n.assertEqual=p=>p;function r(p){}l(r,"assertIs"),n.assertIs=r;function c(p){throw new Error}l(c,"assertNever"),n.assertNever=c,n.arrayToEnum=p=>{let g={};for(let y of p)g[y]=y;return g},n.getValidEnumValues=p=>{let g=n.objectKeys(p).filter(E=>typeof p[p[E]]!="number"),y={};for(let E of g)y[E]=p[E];return n.objectValues(y)},n.objectValues=p=>n.objectKeys(p).map(function(g){return p[g]}),n.objectKeys=typeof Object.keys=="function"?p=>Object.keys(p):p=>{let g=[];for(let y in p)Object.prototype.hasOwnProperty.call(p,y)&&g.push(y);return g},n.find=(p,g)=>{for(let y of p)if(g(y))return y},n.isInteger=typeof Number.isInteger=="function"?p=>Number.isInteger(p):p=>typeof p=="number"&&isFinite(p)&&Math.floor(p)===p;function d(p,g=" | "){return p.map(y=>typeof y=="string"?`'${y}'`:y).join(g)}l(d,"joinValues"),n.joinValues=d,n.jsonStringifyReplacer=(p,g)=>typeof g=="bigint"?g.toString():g})(Re||(Re={}));var dd;(function(n){n.mergeShapes=(r,c)=>({...r,...c})})(dd||(dd={}));var J=Re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Yn=l(n=>{switch(typeof n){case"undefined":return J.undefined;case"string":return J.string;case"number":return isNaN(n)?J.nan:J.number;case"boolean":return J.boolean;case"function":return J.function;case"bigint":return J.bigint;case"symbol":return J.symbol;case"object":return Array.isArray(n)?J.array:n===null?J.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?J.promise:typeof Map<"u"&&n instanceof Map?J.map:typeof Set<"u"&&n instanceof Set?J.set:typeof Date<"u"&&n instanceof Date?J.date:J.object;default:return J.unknown}},"getParsedType"),$=Re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),iw=l(n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),ut=class extends Error{constructor(r){super(),this.issues=[],this.addIssue=d=>{this.issues=[...this.issues,d]},this.addIssues=(d=[])=>{this.issues=[...this.issues,...d]};let c=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,c):this.__proto__=c,this.name="ZodError",this.issues=r}get errors(){return this.issues}format(r){let c=r||function(g){return g.message},d={_errors:[]},p=l(g=>{for(let y of g.issues)if(y.code==="invalid_union")y.unionErrors.map(p);else if(y.code==="invalid_return_type")p(y.returnTypeError);else if(y.code==="invalid_arguments")p(y.argumentsError);else if(y.path.length===0)d._errors.push(c(y));else{let E=d,T=0;for(;T<y.path.length;){let V=y.path[T];T===y.path.length-1?(E[V]=E[V]||{_errors:[]},E[V]._errors.push(c(y))):E[V]=E[V]||{_errors:[]},E=E[V],T++}}},"processError");return p(this),d}static assert(r){if(!(r instanceof ut))throw new Error(`Not a ZodError: ${r}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(r=c=>c.message){let c={},d=[];for(let p of this.issues)p.path.length>0?(c[p.path[0]]=c[p.path[0]]||[],c[p.path[0]].push(r(p))):d.push(r(p));return{formErrors:d,fieldErrors:c}}get formErrors(){return this.flatten()}};l(ut,"ZodError");ut.create=n=>new ut(n);var Ha=l((n,r)=>{let c;switch(n.code){case $.invalid_type:n.received===J.undefined?c="Required":c=`Expected ${n.expected}, received ${n.received}`;break;case $.invalid_literal:c=`Invalid literal value, expected ${JSON.stringify(n.expected,Re.jsonStringifyReplacer)}`;break;case $.unrecognized_keys:c=`Unrecognized key(s) in object: ${Re.joinValues(n.keys,", ")}`;break;case $.invalid_union:c="Invalid input";break;case $.invalid_union_discriminator:c=`Invalid discriminator value. Expected ${Re.joinValues(n.options)}`;break;case $.invalid_enum_value:c=`Invalid enum value. Expected ${Re.joinValues(n.options)}, received '${n.received}'`;break;case $.invalid_arguments:c="Invalid function arguments";break;case $.invalid_return_type:c="Invalid function return type";break;case $.invalid_date:c="Invalid date";break;case $.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(c=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(c=`${c} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?c=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?c=`Invalid input: must end with "${n.validation.endsWith}"`:Re.assertNever(n.validation):n.validation!=="regex"?c=`Invalid ${n.validation}`:c="Invalid";break;case $.too_small:n.type==="array"?c=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?c=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?c=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?c=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:c="Invalid input";break;case $.too_big:n.type==="array"?c=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?c=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?c=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?c=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?c=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:c="Invalid input";break;case $.custom:c="Invalid input";break;case $.invalid_intersection_types:c="Intersection results could not be merged";break;case $.not_multiple_of:c=`Number must be a multiple of ${n.multipleOf}`;break;case $.not_finite:c="Number must be finite";break;default:c=r.defaultError,Re.assertNever(n)}return{message:c}},"errorMap"),Zp=Ha;function aw(n){Zp=n}l(aw,"setErrorMap");function Wl(){return Zp}l(Wl,"getErrorMap");var Hl=l(n=>{let{data:r,path:c,errorMaps:d,issueData:p}=n,g=[...c,...p.path||[]],y={...p,path:g};if(p.message!==void 0)return{...p,path:g,message:p.message};let E="",T=d.filter(V=>!!V).slice().reverse();for(let V of T)E=V(y,{data:r,defaultError:E}).message;return{...p,path:g,message:E}},"makeIssue"),ow=[];function H(n,r){let c=Wl(),d=Hl({issueData:r,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,c,c===Ha?void 0:Ha].filter(p=>!!p)});n.common.issues.push(d)}l(H,"addIssueToContext");var Ke=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(r,c){let d=[];for(let p of c){if(p.status==="aborted")return de;p.status==="dirty"&&r.dirty(),d.push(p.value)}return{status:r.value,value:d}}static async mergeObjectAsync(r,c){let d=[];for(let p of c){let g=await p.key,y=await p.value;d.push({key:g,value:y})}return Ke.mergeObjectSync(r,d)}static mergeObjectSync(r,c){let d={};for(let p of c){let{key:g,value:y}=p;if(g.status==="aborted"||y.status==="aborted")return de;g.status==="dirty"&&r.dirty(),y.status==="dirty"&&r.dirty(),g.value!=="__proto__"&&(typeof y.value<"u"||p.alwaysSet)&&(d[g.value]=y.value)}return{status:r.value,value:d}}};l(Ke,"ParseStatus");var de=Object.freeze({status:"aborted"}),za=l(n=>({status:"dirty",value:n}),"DIRTY"),vt=l(n=>({status:"valid",value:n}),"OK"),fd=l(n=>n.status==="aborted","isAborted"),pd=l(n=>n.status==="dirty","isDirty"),Qo=l(n=>n.status==="valid","isValid"),Yo=l(n=>typeof Promise<"u"&&n instanceof Promise,"isAsync");function Gl(n,r,c,d){if(c==="a"&&!d)throw new TypeError("Private accessor was defined without a getter");if(typeof r=="function"?n!==r||!d:!r.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return c==="m"?d:c==="a"?d.call(n):d?d.value:r.get(n)}l(Gl,"__classPrivateFieldGet");function qp(n,r,c,d,p){if(d==="m")throw new TypeError("Private method is not writable");if(d==="a"&&!p)throw new TypeError("Private accessor was defined without a setter");if(typeof r=="function"?n!==r||!p:!r.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return d==="a"?p.call(n,c):p?p.value=c:r.set(n,c),c}l(qp,"__classPrivateFieldSet");var te;(function(n){n.errToObj=r=>typeof r=="string"?{message:r}:r||{},n.toString=r=>typeof r=="string"?r:r?.message})(te||(te={}));var Go,Jo,Wt=class{constructor(r,c,d,p){this._cachedPath=[],this.parent=r,this.data=c,this._path=d,this._key=p}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};l(Wt,"ParseInputLazyPath");var Bp=l((n,r)=>{if(Qo(r))return{success:!0,data:r.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let c=new ut(n.common.issues);return this._error=c,this._error}}},"handleResult");function ve(n){if(!n)return{};let{errorMap:r,invalid_type_error:c,required_error:d,description:p}=n;if(r&&(c||d))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return r?{errorMap:r,description:p}:{errorMap:l((y,E)=>{var T,V;let{message:q}=n;return y.code==="invalid_enum_value"?{message:q??E.defaultError}:typeof E.data>"u"?{message:(T=q??d)!==null&&T!==void 0?T:E.defaultError}:y.code!=="invalid_type"?{message:E.defaultError}:{message:(V=q??c)!==null&&V!==void 0?V:E.defaultError}},"customMap"),description:p}}l(ve,"processCreateParams");var ge=class{constructor(r){this.spa=this.safeParseAsync,this._def=r,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(r){return Yn(r.data)}_getOrReturnCtx(r,c){return c||{common:r.parent.common,data:r.data,parsedType:Yn(r.data),schemaErrorMap:this._def.errorMap,path:r.path,parent:r.parent}}_processInputParams(r){return{status:new Ke,ctx:{common:r.parent.common,data:r.data,parsedType:Yn(r.data),schemaErrorMap:this._def.errorMap,path:r.path,parent:r.parent}}}_parseSync(r){let c=this._parse(r);if(Yo(c))throw new Error("Synchronous parse encountered promise.");return c}_parseAsync(r){let c=this._parse(r);return Promise.resolve(c)}parse(r,c){let d=this.safeParse(r,c);if(d.success)return d.data;throw d.error}safeParse(r,c){var d;let p={common:{issues:[],async:(d=c?.async)!==null&&d!==void 0?d:!1,contextualErrorMap:c?.errorMap},path:c?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:Yn(r)},g=this._parseSync({data:r,path:p.path,parent:p});return Bp(p,g)}async parseAsync(r,c){let d=await this.safeParseAsync(r,c);if(d.success)return d.data;throw d.error}async safeParseAsync(r,c){let d={common:{issues:[],contextualErrorMap:c?.errorMap,async:!0},path:c?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:Yn(r)},p=this._parse({data:r,path:d.path,parent:d}),g=await(Yo(p)?p:Promise.resolve(p));return Bp(d,g)}refine(r,c){let d=l(p=>typeof c=="string"||typeof c>"u"?{message:c}:typeof c=="function"?c(p):c,"getIssueProperties");return this._refinement((p,g)=>{let y=r(p),E=l(()=>g.addIssue({code:$.custom,...d(p)}),"setError");return typeof Promise<"u"&&y instanceof Promise?y.then(T=>T?!0:(E(),!1)):y?!0:(E(),!1)})}refinement(r,c){return this._refinement((d,p)=>r(d)?!0:(p.addIssue(typeof c=="function"?c(d,p):c),!1))}_refinement(r){return new At({schema:this,typeName:ce.ZodEffects,effect:{type:"refinement",refinement:r}})}superRefine(r){return this._refinement(r)}optional(){return Gt.create(this,this._def)}nullable(){return xr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return kt.create(this,this._def)}promise(){return yn.create(this,this._def)}or(r){return ti.create([this,r],this._def)}and(r){return ri.create(this,r,this._def)}transform(r){return new At({...ve(this._def),schema:this,typeName:ce.ZodEffects,effect:{type:"transform",transform:r}})}default(r){let c=typeof r=="function"?r:()=>r;return new si({...ve(this._def),innerType:this,defaultValue:c,typeName:ce.ZodDefault})}brand(){return new Wa({typeName:ce.ZodBranded,type:this,...ve(this._def)})}catch(r){let c=typeof r=="function"?r:()=>r;return new li({...ve(this._def),innerType:this,catchValue:c,typeName:ce.ZodCatch})}describe(r){let c=this.constructor;return new c({...this._def,description:r})}pipe(r){return ci.create(this,r)}readonly(){return ui.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};l(ge,"ZodType");var sw=/^c[^\s-]{8,}$/i,lw=/^[0-9a-z]+$/,cw=/^[0-9A-HJKMNP-TV-Z]{26}$/,uw=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,dw=/^[a-z0-9_-]{21}$/i,fw=/^[-+]?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)?)??$/,pw=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,hw="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",ud,mw=/^(?:(?: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])$/,gw=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,yw=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,$p="((\\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])))",vw=new RegExp(`^${$p}$`);function zp(n){let r="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return n.precision?r=`${r}\\.\\d{${n.precision}}`:n.precision==null&&(r=`${r}(\\.\\d+)?`),r}l(zp,"timeRegexSource");function bw(n){return new RegExp(`^${zp(n)}$`)}l(bw,"timeRegex");function Wp(n){let r=`${$p}T${zp(n)}`,c=[];return c.push(n.local?"Z?":"Z"),n.offset&&c.push("([+-]\\d{2}:?\\d{2})"),r=`${r}(${c.join("|")})`,new RegExp(`^${r}$`)}l(Wp,"datetimeRegex");function _w(n,r){return!!((r==="v4"||!r)&&mw.test(n)||(r==="v6"||!r)&&gw.test(n))}l(_w,"isValidIP");var Rt=class extends ge{_parse(r){if(this._def.coerce&&(r.data=String(r.data)),this._getType(r)!==J.string){let g=this._getOrReturnCtx(r);return H(g,{code:$.invalid_type,expected:J.string,received:g.parsedType}),de}let d=new Ke,p;for(let g of this._def.checks)if(g.kind==="min")r.data.length<g.value&&(p=this._getOrReturnCtx(r,p),H(p,{code:$.too_small,minimum:g.value,type:"string",inclusive:!0,exact:!1,message:g.message}),d.dirty());else if(g.kind==="max")r.data.length>g.value&&(p=this._getOrReturnCtx(r,p),H(p,{code:$.too_big,maximum:g.value,type:"string",inclusive:!0,exact:!1,message:g.message}),d.dirty());else if(g.kind==="length"){let y=r.data.length>g.value,E=r.data.length<g.value;(y||E)&&(p=this._getOrReturnCtx(r,p),y?H(p,{code:$.too_big,maximum:g.value,type:"string",inclusive:!0,exact:!0,message:g.message}):E&&H(p,{code:$.too_small,minimum:g.value,type:"string",inclusive:!0,exact:!0,message:g.message}),d.dirty())}else if(g.kind==="email")pw.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"email",code:$.invalid_string,message:g.message}),d.dirty());else if(g.kind==="emoji")ud||(ud=new RegExp(hw,"u")),ud.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"emoji",code:$.invalid_string,message:g.message}),d.dirty());else if(g.kind==="uuid")uw.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"uuid",code:$.invalid_string,message:g.message}),d.dirty());else if(g.kind==="nanoid")dw.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"nanoid",code:$.invalid_string,message:g.message}),d.dirty());else if(g.kind==="cuid")sw.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"cuid",code:$.invalid_string,message:g.message}),d.dirty());else if(g.kind==="cuid2")lw.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"cuid2",code:$.invalid_string,message:g.message}),d.dirty());else if(g.kind==="ulid")cw.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"ulid",code:$.invalid_string,message:g.message}),d.dirty());else if(g.kind==="url")try{new URL(r.data)}catch{p=this._getOrReturnCtx(r,p),H(p,{validation:"url",code:$.invalid_string,message:g.message}),d.dirty()}else g.kind==="regex"?(g.regex.lastIndex=0,g.regex.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"regex",code:$.invalid_string,message:g.message}),d.dirty())):g.kind==="trim"?r.data=r.data.trim():g.kind==="includes"?r.data.includes(g.value,g.position)||(p=this._getOrReturnCtx(r,p),H(p,{code:$.invalid_string,validation:{includes:g.value,position:g.position},message:g.message}),d.dirty()):g.kind==="toLowerCase"?r.data=r.data.toLowerCase():g.kind==="toUpperCase"?r.data=r.data.toUpperCase():g.kind==="startsWith"?r.data.startsWith(g.value)||(p=this._getOrReturnCtx(r,p),H(p,{code:$.invalid_string,validation:{startsWith:g.value},message:g.message}),d.dirty()):g.kind==="endsWith"?r.data.endsWith(g.value)||(p=this._getOrReturnCtx(r,p),H(p,{code:$.invalid_string,validation:{endsWith:g.value},message:g.message}),d.dirty()):g.kind==="datetime"?Wp(g).test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{code:$.invalid_string,validation:"datetime",message:g.message}),d.dirty()):g.kind==="date"?vw.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{code:$.invalid_string,validation:"date",message:g.message}),d.dirty()):g.kind==="time"?bw(g).test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{code:$.invalid_string,validation:"time",message:g.message}),d.dirty()):g.kind==="duration"?fw.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"duration",code:$.invalid_string,message:g.message}),d.dirty()):g.kind==="ip"?_w(r.data,g.version)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"ip",code:$.invalid_string,message:g.message}),d.dirty()):g.kind==="base64"?yw.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"base64",code:$.invalid_string,message:g.message}),d.dirty()):Re.assertNever(g);return{status:d.value,value:r.data}}_regex(r,c,d){return this.refinement(p=>r.test(p),{validation:c,code:$.invalid_string,...te.errToObj(d)})}_addCheck(r){return new Rt({...this._def,checks:[...this._def.checks,r]})}email(r){return this._addCheck({kind:"email",...te.errToObj(r)})}url(r){return this._addCheck({kind:"url",...te.errToObj(r)})}emoji(r){return this._addCheck({kind:"emoji",...te.errToObj(r)})}uuid(r){return this._addCheck({kind:"uuid",...te.errToObj(r)})}nanoid(r){return this._addCheck({kind:"nanoid",...te.errToObj(r)})}cuid(r){return this._addCheck({kind:"cuid",...te.errToObj(r)})}cuid2(r){return this._addCheck({kind:"cuid2",...te.errToObj(r)})}ulid(r){return this._addCheck({kind:"ulid",...te.errToObj(r)})}base64(r){return this._addCheck({kind:"base64",...te.errToObj(r)})}ip(r){return this._addCheck({kind:"ip",...te.errToObj(r)})}datetime(r){var c,d;return typeof r=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:r}):this._addCheck({kind:"datetime",precision:typeof r?.precision>"u"?null:r?.precision,offset:(c=r?.offset)!==null&&c!==void 0?c:!1,local:(d=r?.local)!==null&&d!==void 0?d:!1,...te.errToObj(r?.message)})}date(r){return this._addCheck({kind:"date",message:r})}time(r){return typeof r=="string"?this._addCheck({kind:"time",precision:null,message:r}):this._addCheck({kind:"time",precision:typeof r?.precision>"u"?null:r?.precision,...te.errToObj(r?.message)})}duration(r){return this._addCheck({kind:"duration",...te.errToObj(r)})}regex(r,c){return this._addCheck({kind:"regex",regex:r,...te.errToObj(c)})}includes(r,c){return this._addCheck({kind:"includes",value:r,position:c?.position,...te.errToObj(c?.message)})}startsWith(r,c){return this._addCheck({kind:"startsWith",value:r,...te.errToObj(c)})}endsWith(r,c){return this._addCheck({kind:"endsWith",value:r,...te.errToObj(c)})}min(r,c){return this._addCheck({kind:"min",value:r,...te.errToObj(c)})}max(r,c){return this._addCheck({kind:"max",value:r,...te.errToObj(c)})}length(r,c){return this._addCheck({kind:"length",value:r,...te.errToObj(c)})}nonempty(r){return this.min(1,te.errToObj(r))}trim(){return new Rt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Rt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Rt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(r=>r.kind==="datetime")}get isDate(){return!!this._def.checks.find(r=>r.kind==="date")}get isTime(){return!!this._def.checks.find(r=>r.kind==="time")}get isDuration(){return!!this._def.checks.find(r=>r.kind==="duration")}get isEmail(){return!!this._def.checks.find(r=>r.kind==="email")}get isURL(){return!!this._def.checks.find(r=>r.kind==="url")}get isEmoji(){return!!this._def.checks.find(r=>r.kind==="emoji")}get isUUID(){return!!this._def.checks.find(r=>r.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(r=>r.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(r=>r.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(r=>r.kind==="cuid2")}get isULID(){return!!this._def.checks.find(r=>r.kind==="ulid")}get isIP(){return!!this._def.checks.find(r=>r.kind==="ip")}get isBase64(){return!!this._def.checks.find(r=>r.kind==="base64")}get minLength(){let r=null;for(let c of this._def.checks)c.kind==="min"&&(r===null||c.value>r)&&(r=c.value);return r}get maxLength(){let r=null;for(let c of this._def.checks)c.kind==="max"&&(r===null||c.value<r)&&(r=c.value);return r}};l(Rt,"ZodString");Rt.create=n=>{var r;return new Rt({checks:[],typeName:ce.ZodString,coerce:(r=n?.coerce)!==null&&r!==void 0?r:!1,...ve(n)})};function ww(n,r){let c=(n.toString().split(".")[1]||"").length,d=(r.toString().split(".")[1]||"").length,p=c>d?c:d,g=parseInt(n.toFixed(p).replace(".","")),y=parseInt(r.toFixed(p).replace(".",""));return g%y/Math.pow(10,p)}l(ww,"floatSafeRemainder");var br=class extends ge{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(r){if(this._def.coerce&&(r.data=Number(r.data)),this._getType(r)!==J.number){let g=this._getOrReturnCtx(r);return H(g,{code:$.invalid_type,expected:J.number,received:g.parsedType}),de}let d,p=new Ke;for(let g of this._def.checks)g.kind==="int"?Re.isInteger(r.data)||(d=this._getOrReturnCtx(r,d),H(d,{code:$.invalid_type,expected:"integer",received:"float",message:g.message}),p.dirty()):g.kind==="min"?(g.inclusive?r.data<g.value:r.data<=g.value)&&(d=this._getOrReturnCtx(r,d),H(d,{code:$.too_small,minimum:g.value,type:"number",inclusive:g.inclusive,exact:!1,message:g.message}),p.dirty()):g.kind==="max"?(g.inclusive?r.data>g.value:r.data>=g.value)&&(d=this._getOrReturnCtx(r,d),H(d,{code:$.too_big,maximum:g.value,type:"number",inclusive:g.inclusive,exact:!1,message:g.message}),p.dirty()):g.kind==="multipleOf"?ww(r.data,g.value)!==0&&(d=this._getOrReturnCtx(r,d),H(d,{code:$.not_multiple_of,multipleOf:g.value,message:g.message}),p.dirty()):g.kind==="finite"?Number.isFinite(r.data)||(d=this._getOrReturnCtx(r,d),H(d,{code:$.not_finite,message:g.message}),p.dirty()):Re.assertNever(g);return{status:p.value,value:r.data}}gte(r,c){return this.setLimit("min",r,!0,te.toString(c))}gt(r,c){return this.setLimit("min",r,!1,te.toString(c))}lte(r,c){return this.setLimit("max",r,!0,te.toString(c))}lt(r,c){return this.setLimit("max",r,!1,te.toString(c))}setLimit(r,c,d,p){return new br({...this._def,checks:[...this._def.checks,{kind:r,value:c,inclusive:d,message:te.toString(p)}]})}_addCheck(r){return new br({...this._def,checks:[...this._def.checks,r]})}int(r){return this._addCheck({kind:"int",message:te.toString(r)})}positive(r){return this._addCheck({kind:"min",value:0,inclusive:!1,message:te.toString(r)})}negative(r){return this._addCheck({kind:"max",value:0,inclusive:!1,message:te.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:0,inclusive:!0,message:te.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:0,inclusive:!0,message:te.toString(r)})}multipleOf(r,c){return this._addCheck({kind:"multipleOf",value:r,message:te.toString(c)})}finite(r){return this._addCheck({kind:"finite",message:te.toString(r)})}safe(r){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:te.toString(r)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:te.toString(r)})}get minValue(){let r=null;for(let c of this._def.checks)c.kind==="min"&&(r===null||c.value>r)&&(r=c.value);return r}get maxValue(){let r=null;for(let c of this._def.checks)c.kind==="max"&&(r===null||c.value<r)&&(r=c.value);return r}get isInt(){return!!this._def.checks.find(r=>r.kind==="int"||r.kind==="multipleOf"&&Re.isInteger(r.value))}get isFinite(){let r=null,c=null;for(let d of this._def.checks){if(d.kind==="finite"||d.kind==="int"||d.kind==="multipleOf")return!0;d.kind==="min"?(c===null||d.value>c)&&(c=d.value):d.kind==="max"&&(r===null||d.value<r)&&(r=d.value)}return Number.isFinite(c)&&Number.isFinite(r)}};l(br,"ZodNumber");br.create=n=>new br({checks:[],typeName:ce.ZodNumber,coerce:n?.coerce||!1,...ve(n)});var _r=class extends ge{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(r){if(this._def.coerce&&(r.data=BigInt(r.data)),this._getType(r)!==J.bigint){let g=this._getOrReturnCtx(r);return H(g,{code:$.invalid_type,expected:J.bigint,received:g.parsedType}),de}let d,p=new Ke;for(let g of this._def.checks)g.kind==="min"?(g.inclusive?r.data<g.value:r.data<=g.value)&&(d=this._getOrReturnCtx(r,d),H(d,{code:$.too_small,type:"bigint",minimum:g.value,inclusive:g.inclusive,message:g.message}),p.dirty()):g.kind==="max"?(g.inclusive?r.data>g.value:r.data>=g.value)&&(d=this._getOrReturnCtx(r,d),H(d,{code:$.too_big,type:"bigint",maximum:g.value,inclusive:g.inclusive,message:g.message}),p.dirty()):g.kind==="multipleOf"?r.data%g.value!==BigInt(0)&&(d=this._getOrReturnCtx(r,d),H(d,{code:$.not_multiple_of,multipleOf:g.value,message:g.message}),p.dirty()):Re.assertNever(g);return{status:p.value,value:r.data}}gte(r,c){return this.setLimit("min",r,!0,te.toString(c))}gt(r,c){return this.setLimit("min",r,!1,te.toString(c))}lte(r,c){return this.setLimit("max",r,!0,te.toString(c))}lt(r,c){return this.setLimit("max",r,!1,te.toString(c))}setLimit(r,c,d,p){return new _r({...this._def,checks:[...this._def.checks,{kind:r,value:c,inclusive:d,message:te.toString(p)}]})}_addCheck(r){return new _r({...this._def,checks:[...this._def.checks,r]})}positive(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:te.toString(r)})}negative(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:te.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:te.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:te.toString(r)})}multipleOf(r,c){return this._addCheck({kind:"multipleOf",value:r,message:te.toString(c)})}get minValue(){let r=null;for(let c of this._def.checks)c.kind==="min"&&(r===null||c.value>r)&&(r=c.value);return r}get maxValue(){let r=null;for(let c of this._def.checks)c.kind==="max"&&(r===null||c.value<r)&&(r=c.value);return r}};l(_r,"ZodBigInt");_r.create=n=>{var r;return new _r({checks:[],typeName:ce.ZodBigInt,coerce:(r=n?.coerce)!==null&&r!==void 0?r:!1,...ve(n)})};var Kn=class extends ge{_parse(r){if(this._def.coerce&&(r.data=Boolean(r.data)),this._getType(r)!==J.boolean){let d=this._getOrReturnCtx(r);return H(d,{code:$.invalid_type,expected:J.boolean,received:d.parsedType}),de}return vt(r.data)}};l(Kn,"ZodBoolean");Kn.create=n=>new Kn({typeName:ce.ZodBoolean,coerce:n?.coerce||!1,...ve(n)});var Br=class extends ge{_parse(r){if(this._def.coerce&&(r.data=new Date(r.data)),this._getType(r)!==J.date){let g=this._getOrReturnCtx(r);return H(g,{code:$.invalid_type,expected:J.date,received:g.parsedType}),de}if(isNaN(r.data.getTime())){let g=this._getOrReturnCtx(r);return H(g,{code:$.invalid_date}),de}let d=new Ke,p;for(let g of this._def.checks)g.kind==="min"?r.data.getTime()<g.value&&(p=this._getOrReturnCtx(r,p),H(p,{code:$.too_small,message:g.message,inclusive:!0,exact:!1,minimum:g.value,type:"date"}),d.dirty()):g.kind==="max"?r.data.getTime()>g.value&&(p=this._getOrReturnCtx(r,p),H(p,{code:$.too_big,message:g.message,inclusive:!0,exact:!1,maximum:g.value,type:"date"}),d.dirty()):Re.assertNever(g);return{status:d.value,value:new Date(r.data.getTime())}}_addCheck(r){return new Br({...this._def,checks:[...this._def.checks,r]})}min(r,c){return this._addCheck({kind:"min",value:r.getTime(),message:te.toString(c)})}max(r,c){return this._addCheck({kind:"max",value:r.getTime(),message:te.toString(c)})}get minDate(){let r=null;for(let c of this._def.checks)c.kind==="min"&&(r===null||c.value>r)&&(r=c.value);return r!=null?new Date(r):null}get maxDate(){let r=null;for(let c of this._def.checks)c.kind==="max"&&(r===null||c.value<r)&&(r=c.value);return r!=null?new Date(r):null}};l(Br,"ZodDate");Br.create=n=>new Br({checks:[],coerce:n?.coerce||!1,typeName:ce.ZodDate,...ve(n)});var Wi=class extends ge{_parse(r){if(this._getType(r)!==J.symbol){let d=this._getOrReturnCtx(r);return H(d,{code:$.invalid_type,expected:J.symbol,received:d.parsedType}),de}return vt(r.data)}};l(Wi,"ZodSymbol");Wi.create=n=>new Wi({typeName:ce.ZodSymbol,...ve(n)});var Xn=class extends ge{_parse(r){if(this._getType(r)!==J.undefined){let d=this._getOrReturnCtx(r);return H(d,{code:$.invalid_type,expected:J.undefined,received:d.parsedType}),de}return vt(r.data)}};l(Xn,"ZodUndefined");Xn.create=n=>new Xn({typeName:ce.ZodUndefined,...ve(n)});var ei=class extends ge{_parse(r){if(this._getType(r)!==J.null){let d=this._getOrReturnCtx(r);return H(d,{code:$.invalid_type,expected:J.null,received:d.parsedType}),de}return vt(r.data)}};l(ei,"ZodNull");ei.create=n=>new ei({typeName:ce.ZodNull,...ve(n)});var mn=class extends ge{constructor(){super(...arguments),this._any=!0}_parse(r){return vt(r.data)}};l(mn,"ZodAny");mn.create=n=>new mn({typeName:ce.ZodAny,...ve(n)});var Fr=class extends ge{constructor(){super(...arguments),this._unknown=!0}_parse(r){return vt(r.data)}};l(Fr,"ZodUnknown");Fr.create=n=>new Fr({typeName:ce.ZodUnknown,...ve(n)});var ir=class extends ge{_parse(r){let c=this._getOrReturnCtx(r);return H(c,{code:$.invalid_type,expected:J.never,received:c.parsedType}),de}};l(ir,"ZodNever");ir.create=n=>new ir({typeName:ce.ZodNever,...ve(n)});var Hi=class extends ge{_parse(r){if(this._getType(r)!==J.undefined){let d=this._getOrReturnCtx(r);return H(d,{code:$.invalid_type,expected:J.void,received:d.parsedType}),de}return vt(r.data)}};l(Hi,"ZodVoid");Hi.create=n=>new Hi({typeName:ce.ZodVoid,...ve(n)});var kt=class extends ge{_parse(r){let{ctx:c,status:d}=this._processInputParams(r),p=this._def;if(c.parsedType!==J.array)return H(c,{code:$.invalid_type,expected:J.array,received:c.parsedType}),de;if(p.exactLength!==null){let y=c.data.length>p.exactLength.value,E=c.data.length<p.exactLength.value;(y||E)&&(H(c,{code:y?$.too_big:$.too_small,minimum:E?p.exactLength.value:void 0,maximum:y?p.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:p.exactLength.message}),d.dirty())}if(p.minLength!==null&&c.data.length<p.minLength.value&&(H(c,{code:$.too_small,minimum:p.minLength.value,type:"array",inclusive:!0,exact:!1,message:p.minLength.message}),d.dirty()),p.maxLength!==null&&c.data.length>p.maxLength.value&&(H(c,{code:$.too_big,maximum:p.maxLength.value,type:"array",inclusive:!0,exact:!1,message:p.maxLength.message}),d.dirty()),c.common.async)return Promise.all([...c.data].map((y,E)=>p.type._parseAsync(new Wt(c,y,c.path,E)))).then(y=>Ke.mergeArray(d,y));let g=[...c.data].map((y,E)=>p.type._parseSync(new Wt(c,y,c.path,E)));return Ke.mergeArray(d,g)}get element(){return this._def.type}min(r,c){return new kt({...this._def,minLength:{value:r,message:te.toString(c)}})}max(r,c){return new kt({...this._def,maxLength:{value:r,message:te.toString(c)}})}length(r,c){return new kt({...this._def,exactLength:{value:r,message:te.toString(c)}})}nonempty(r){return this.min(1,r)}};l(kt,"ZodArray");kt.create=(n,r)=>new kt({type:n,minLength:null,maxLength:null,exactLength:null,typeName:ce.ZodArray,...ve(r)});function $a(n){if(n instanceof Ue){let r={};for(let c in n.shape){let d=n.shape[c];r[c]=Gt.create($a(d))}return new Ue({...n._def,shape:()=>r})}else return n instanceof kt?new kt({...n._def,type:$a(n.element)}):n instanceof Gt?Gt.create($a(n.unwrap())):n instanceof xr?xr.create($a(n.unwrap())):n instanceof Ht?Ht.create(n.items.map(r=>$a(r))):n}l($a,"deepPartialify");var Ue=class extends ge{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let r=this._def.shape(),c=Re.objectKeys(r);return this._cached={shape:r,keys:c}}_parse(r){if(this._getType(r)!==J.object){let V=this._getOrReturnCtx(r);return H(V,{code:$.invalid_type,expected:J.object,received:V.parsedType}),de}let{status:d,ctx:p}=this._processInputParams(r),{shape:g,keys:y}=this._getCached(),E=[];if(!(this._def.catchall instanceof ir&&this._def.unknownKeys==="strip"))for(let V in p.data)y.includes(V)||E.push(V);let T=[];for(let V of y){let q=g[V],j=p.data[V];T.push({key:{status:"valid",value:V},value:q._parse(new Wt(p,j,p.path,V)),alwaysSet:V in p.data})}if(this._def.catchall instanceof ir){let V=this._def.unknownKeys;if(V==="passthrough")for(let q of E)T.push({key:{status:"valid",value:q},value:{status:"valid",value:p.data[q]}});else if(V==="strict")E.length>0&&(H(p,{code:$.unrecognized_keys,keys:E}),d.dirty());else if(V!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let V=this._def.catchall;for(let q of E){let j=p.data[q];T.push({key:{status:"valid",value:q},value:V._parse(new Wt(p,j,p.path,q)),alwaysSet:q in p.data})}}return p.common.async?Promise.resolve().then(async()=>{let V=[];for(let q of T){let j=await q.key,O=await q.value;V.push({key:j,value:O,alwaysSet:q.alwaysSet})}return V}).then(V=>Ke.mergeObjectSync(d,V)):Ke.mergeObjectSync(d,T)}get shape(){return this._def.shape()}strict(r){return te.errToObj,new Ue({...this._def,unknownKeys:"strict",...r!==void 0?{errorMap:(c,d)=>{var p,g,y,E;let T=(y=(g=(p=this._def).errorMap)===null||g===void 0?void 0:g.call(p,c,d).message)!==null&&y!==void 0?y:d.defaultError;return c.code==="unrecognized_keys"?{message:(E=te.errToObj(r).message)!==null&&E!==void 0?E:T}:{message:T}}}:{}})}strip(){return new Ue({...this._def,unknownKeys:"strip"})}passthrough(){return new Ue({...this._def,unknownKeys:"passthrough"})}extend(r){return new Ue({...this._def,shape:()=>({...this._def.shape(),...r})})}merge(r){return new Ue({unknownKeys:r._def.unknownKeys,catchall:r._def.catchall,shape:()=>({...this._def.shape(),...r._def.shape()}),typeName:ce.ZodObject})}setKey(r,c){return this.augment({[r]:c})}catchall(r){return new Ue({...this._def,catchall:r})}pick(r){let c={};return Re.objectKeys(r).forEach(d=>{r[d]&&this.shape[d]&&(c[d]=this.shape[d])}),new Ue({...this._def,shape:()=>c})}omit(r){let c={};return Re.objectKeys(this.shape).forEach(d=>{r[d]||(c[d]=this.shape[d])}),new Ue({...this._def,shape:()=>c})}deepPartial(){return $a(this)}partial(r){let c={};return Re.objectKeys(this.shape).forEach(d=>{let p=this.shape[d];r&&!r[d]?c[d]=p:c[d]=p.optional()}),new Ue({...this._def,shape:()=>c})}required(r){let c={};return Re.objectKeys(this.shape).forEach(d=>{if(r&&!r[d])c[d]=this.shape[d];else{let g=this.shape[d];for(;g instanceof Gt;)g=g._def.innerType;c[d]=g}}),new Ue({...this._def,shape:()=>c})}keyof(){return Hp(Re.objectKeys(this.shape))}};l(Ue,"ZodObject");Ue.create=(n,r)=>new Ue({shape:()=>n,unknownKeys:"strip",catchall:ir.create(),typeName:ce.ZodObject,...ve(r)});Ue.strictCreate=(n,r)=>new Ue({shape:()=>n,unknownKeys:"strict",catchall:ir.create(),typeName:ce.ZodObject,...ve(r)});Ue.lazycreate=(n,r)=>new Ue({shape:n,unknownKeys:"strip",catchall:ir.create(),typeName:ce.ZodObject,...ve(r)});var ti=class extends ge{_parse(r){let{ctx:c}=this._processInputParams(r),d=this._def.options;function p(g){for(let E of g)if(E.result.status==="valid")return E.result;for(let E of g)if(E.result.status==="dirty")return c.common.issues.push(...E.ctx.common.issues),E.result;let y=g.map(E=>new ut(E.ctx.common.issues));return H(c,{code:$.invalid_union,unionErrors:y}),de}if(l(p,"handleResults"),c.common.async)return Promise.all(d.map(async g=>{let y={...c,common:{...c.common,issues:[]},parent:null};return{result:await g._parseAsync({data:c.data,path:c.path,parent:y}),ctx:y}})).then(p);{let g,y=[];for(let T of d){let V={...c,common:{...c.common,issues:[]},parent:null},q=T._parseSync({data:c.data,path:c.path,parent:V});if(q.status==="valid")return q;q.status==="dirty"&&!g&&(g={result:q,ctx:V}),V.common.issues.length&&y.push(V.common.issues)}if(g)return c.common.issues.push(...g.ctx.common.issues),g.result;let E=y.map(T=>new ut(T));return H(c,{code:$.invalid_union,unionErrors:E}),de}}get options(){return this._def.options}};l(ti,"ZodUnion");ti.create=(n,r)=>new ti({options:n,typeName:ce.ZodUnion,...ve(r)});var hn=l(n=>n instanceof ii?hn(n.schema):n instanceof At?hn(n.innerType()):n instanceof ai?[n.value]:n instanceof wr?n.options:n instanceof oi?Re.objectValues(n.enum):n instanceof si?hn(n._def.innerType):n instanceof Xn?[void 0]:n instanceof ei?[null]:n instanceof Gt?[void 0,...hn(n.unwrap())]:n instanceof xr?[null,...hn(n.unwrap())]:n instanceof Wa||n instanceof ui?hn(n.unwrap()):n instanceof li?hn(n._def.innerType):[],"getDiscriminator"),Gi=class extends ge{_parse(r){let{ctx:c}=this._processInputParams(r);if(c.parsedType!==J.object)return H(c,{code:$.invalid_type,expected:J.object,received:c.parsedType}),de;let d=this.discriminator,p=c.data[d],g=this.optionsMap.get(p);return g?c.common.async?g._parseAsync({data:c.data,path:c.path,parent:c}):g._parseSync({data:c.data,path:c.path,parent:c}):(H(c,{code:$.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[d]}),de)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(r,c,d){let p=new Map;for(let g of c){let y=hn(g.shape[r]);if(!y.length)throw new Error(`A discriminator value for key \`${r}\` could not be extracted from all schema options`);for(let E of y){if(p.has(E))throw new Error(`Discriminator property ${String(r)} has duplicate value ${String(E)}`);p.set(E,g)}}return new Gi({typeName:ce.ZodDiscriminatedUnion,discriminator:r,options:c,optionsMap:p,...ve(d)})}};l(Gi,"ZodDiscriminatedUnion");function hd(n,r){let c=Yn(n),d=Yn(r);if(n===r)return{valid:!0,data:n};if(c===J.object&&d===J.object){let p=Re.objectKeys(r),g=Re.objectKeys(n).filter(E=>p.indexOf(E)!==-1),y={...n,...r};for(let E of g){let T=hd(n[E],r[E]);if(!T.valid)return{valid:!1};y[E]=T.data}return{valid:!0,data:y}}else if(c===J.array&&d===J.array){if(n.length!==r.length)return{valid:!1};let p=[];for(let g=0;g<n.length;g++){let y=n[g],E=r[g],T=hd(y,E);if(!T.valid)return{valid:!1};p.push(T.data)}return{valid:!0,data:p}}else return c===J.date&&d===J.date&&+n==+r?{valid:!0,data:n}:{valid:!1}}l(hd,"mergeValues");var ri=class extends ge{_parse(r){let{status:c,ctx:d}=this._processInputParams(r),p=l((g,y)=>{if(fd(g)||fd(y))return de;let E=hd(g.value,y.value);return E.valid?((pd(g)||pd(y))&&c.dirty(),{status:c.value,value:E.data}):(H(d,{code:$.invalid_intersection_types}),de)},"handleParsed");return d.common.async?Promise.all([this._def.left._parseAsync({data:d.data,path:d.path,parent:d}),this._def.right._parseAsync({data:d.data,path:d.path,parent:d})]).then(([g,y])=>p(g,y)):p(this._def.left._parseSync({data:d.data,path:d.path,parent:d}),this._def.right._parseSync({data:d.data,path:d.path,parent:d}))}};l(ri,"ZodIntersection");ri.create=(n,r,c)=>new ri({left:n,right:r,typeName:ce.ZodIntersection,...ve(c)});var Ht=class extends ge{_parse(r){let{status:c,ctx:d}=this._processInputParams(r);if(d.parsedType!==J.array)return H(d,{code:$.invalid_type,expected:J.array,received:d.parsedType}),de;if(d.data.length<this._def.items.length)return H(d,{code:$.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),de;!this._def.rest&&d.data.length>this._def.items.length&&(H(d,{code:$.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),c.dirty());let g=[...d.data].map((y,E)=>{let T=this._def.items[E]||this._def.rest;return T?T._parse(new Wt(d,y,d.path,E)):null}).filter(y=>!!y);return d.common.async?Promise.all(g).then(y=>Ke.mergeArray(c,y)):Ke.mergeArray(c,g)}get items(){return this._def.items}rest(r){return new Ht({...this._def,rest:r})}};l(Ht,"ZodTuple");Ht.create=(n,r)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ht({items:n,typeName:ce.ZodTuple,rest:null,...ve(r)})};var ni=class extends ge{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){let{status:c,ctx:d}=this._processInputParams(r);if(d.parsedType!==J.object)return H(d,{code:$.invalid_type,expected:J.object,received:d.parsedType}),de;let p=[],g=this._def.keyType,y=this._def.valueType;for(let E in d.data)p.push({key:g._parse(new Wt(d,E,d.path,E)),value:y._parse(new Wt(d,d.data[E],d.path,E)),alwaysSet:E in d.data});return d.common.async?Ke.mergeObjectAsync(c,p):Ke.mergeObjectSync(c,p)}get element(){return this._def.valueType}static create(r,c,d){return c instanceof ge?new ni({keyType:r,valueType:c,typeName:ce.ZodRecord,...ve(d)}):new ni({keyType:Rt.create(),valueType:r,typeName:ce.ZodRecord,...ve(c)})}};l(ni,"ZodRecord");var Ji=class extends ge{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){let{status:c,ctx:d}=this._processInputParams(r);if(d.parsedType!==J.map)return H(d,{code:$.invalid_type,expected:J.map,received:d.parsedType}),de;let p=this._def.keyType,g=this._def.valueType,y=[...d.data.entries()].map(([E,T],V)=>({key:p._parse(new Wt(d,E,d.path,[V,"key"])),value:g._parse(new Wt(d,T,d.path,[V,"value"]))}));if(d.common.async){let E=new Map;return Promise.resolve().then(async()=>{for(let T of y){let V=await T.key,q=await T.value;if(V.status==="aborted"||q.status==="aborted")return de;(V.status==="dirty"||q.status==="dirty")&&c.dirty(),E.set(V.value,q.value)}return{status:c.value,value:E}})}else{let E=new Map;for(let T of y){let V=T.key,q=T.value;if(V.status==="aborted"||q.status==="aborted")return de;(V.status==="dirty"||q.status==="dirty")&&c.dirty(),E.set(V.value,q.value)}return{status:c.value,value:E}}}};l(Ji,"ZodMap");Ji.create=(n,r,c)=>new Ji({valueType:r,keyType:n,typeName:ce.ZodMap,...ve(c)});var Zr=class extends ge{_parse(r){let{status:c,ctx:d}=this._processInputParams(r);if(d.parsedType!==J.set)return H(d,{code:$.invalid_type,expected:J.set,received:d.parsedType}),de;let p=this._def;p.minSize!==null&&d.data.size<p.minSize.value&&(H(d,{code:$.too_small,minimum:p.minSize.value,type:"set",inclusive:!0,exact:!1,message:p.minSize.message}),c.dirty()),p.maxSize!==null&&d.data.size>p.maxSize.value&&(H(d,{code:$.too_big,maximum:p.maxSize.value,type:"set",inclusive:!0,exact:!1,message:p.maxSize.message}),c.dirty());let g=this._def.valueType;function y(T){let V=new Set;for(let q of T){if(q.status==="aborted")return de;q.status==="dirty"&&c.dirty(),V.add(q.value)}return{status:c.value,value:V}}l(y,"finalizeSet");let E=[...d.data.values()].map((T,V)=>g._parse(new Wt(d,T,d.path,V)));return d.common.async?Promise.all(E).then(T=>y(T)):y(E)}min(r,c){return new Zr({...this._def,minSize:{value:r,message:te.toString(c)}})}max(r,c){return new Zr({...this._def,maxSize:{value:r,message:te.toString(c)}})}size(r,c){return this.min(r,c).max(r,c)}nonempty(r){return this.min(1,r)}};l(Zr,"ZodSet");Zr.create=(n,r)=>new Zr({valueType:n,minSize:null,maxSize:null,typeName:ce.ZodSet,...ve(r)});var gn=class extends ge{constructor(){super(...arguments),this.validate=this.implement}_parse(r){let{ctx:c}=this._processInputParams(r);if(c.parsedType!==J.function)return H(c,{code:$.invalid_type,expected:J.function,received:c.parsedType}),de;function d(E,T){return Hl({data:E,path:c.path,errorMaps:[c.common.contextualErrorMap,c.schemaErrorMap,Wl(),Ha].filter(V=>!!V),issueData:{code:$.invalid_arguments,argumentsError:T}})}l(d,"makeArgsIssue");function p(E,T){return Hl({data:E,path:c.path,errorMaps:[c.common.contextualErrorMap,c.schemaErrorMap,Wl(),Ha].filter(V=>!!V),issueData:{code:$.invalid_return_type,returnTypeError:T}})}l(p,"makeReturnsIssue");let g={errorMap:c.common.contextualErrorMap},y=c.data;if(this._def.returns instanceof yn){let E=this;return vt(async function(...T){let V=new ut([]),q=await E._def.args.parseAsync(T,g).catch(R=>{throw V.addIssue(d(T,R)),V}),j=await Reflect.apply(y,this,q);return await E._def.returns._def.type.parseAsync(j,g).catch(R=>{throw V.addIssue(p(j,R)),V})})}else{let E=this;return vt(function(...T){let V=E._def.args.safeParse(T,g);if(!V.success)throw new ut([d(T,V.error)]);let q=Reflect.apply(y,this,V.data),j=E._def.returns.safeParse(q,g);if(!j.success)throw new ut([p(q,j.error)]);return j.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...r){return new gn({...this._def,args:Ht.create(r).rest(Fr.create())})}returns(r){return new gn({...this._def,returns:r})}implement(r){return this.parse(r)}strictImplement(r){return this.parse(r)}static create(r,c,d){return new gn({args:r||Ht.create([]).rest(Fr.create()),returns:c||Fr.create(),typeName:ce.ZodFunction,...ve(d)})}};l(gn,"ZodFunction");var ii=class extends ge{get schema(){return this._def.getter()}_parse(r){let{ctx:c}=this._processInputParams(r);return this._def.getter()._parse({data:c.data,path:c.path,parent:c})}};l(ii,"ZodLazy");ii.create=(n,r)=>new ii({getter:n,typeName:ce.ZodLazy,...ve(r)});var ai=class extends ge{_parse(r){if(r.data!==this._def.value){let c=this._getOrReturnCtx(r);return H(c,{received:c.data,code:$.invalid_literal,expected:this._def.value}),de}return{status:"valid",value:r.data}}get value(){return this._def.value}};l(ai,"ZodLiteral");ai.create=(n,r)=>new ai({value:n,typeName:ce.ZodLiteral,...ve(r)});function Hp(n,r){return new wr({values:n,typeName:ce.ZodEnum,...ve(r)})}l(Hp,"createZodEnum");var wr=class extends ge{constructor(){super(...arguments),Go.set(this,void 0)}_parse(r){if(typeof r.data!="string"){let c=this._getOrReturnCtx(r),d=this._def.values;return H(c,{expected:Re.joinValues(d),received:c.parsedType,code:$.invalid_type}),de}if(Gl(this,Go,"f")||qp(this,Go,new Set(this._def.values),"f"),!Gl(this,Go,"f").has(r.data)){let c=this._getOrReturnCtx(r),d=this._def.values;return H(c,{received:c.data,code:$.invalid_enum_value,options:d}),de}return vt(r.data)}get options(){return this._def.values}get enum(){let r={};for(let c of this._def.values)r[c]=c;return r}get Values(){let r={};for(let c of this._def.values)r[c]=c;return r}get Enum(){let r={};for(let c of this._def.values)r[c]=c;return r}extract(r,c=this._def){return wr.create(r,{...this._def,...c})}exclude(r,c=this._def){return wr.create(this.options.filter(d=>!r.includes(d)),{...this._def,...c})}};l(wr,"ZodEnum");Go=new WeakMap;wr.create=Hp;var oi=class extends ge{constructor(){super(...arguments),Jo.set(this,void 0)}_parse(r){let c=Re.getValidEnumValues(this._def.values),d=this._getOrReturnCtx(r);if(d.parsedType!==J.string&&d.parsedType!==J.number){let p=Re.objectValues(c);return H(d,{expected:Re.joinValues(p),received:d.parsedType,code:$.invalid_type}),de}if(Gl(this,Jo,"f")||qp(this,Jo,new Set(Re.getValidEnumValues(this._def.values)),"f"),!Gl(this,Jo,"f").has(r.data)){let p=Re.objectValues(c);return H(d,{received:d.data,code:$.invalid_enum_value,options:p}),de}return vt(r.data)}get enum(){return this._def.values}};l(oi,"ZodNativeEnum");Jo=new WeakMap;oi.create=(n,r)=>new oi({values:n,typeName:ce.ZodNativeEnum,...ve(r)});var yn=class extends ge{unwrap(){return this._def.type}_parse(r){let{ctx:c}=this._processInputParams(r);if(c.parsedType!==J.promise&&c.common.async===!1)return H(c,{code:$.invalid_type,expected:J.promise,received:c.parsedType}),de;let d=c.parsedType===J.promise?c.data:Promise.resolve(c.data);return vt(d.then(p=>this._def.type.parseAsync(p,{path:c.path,errorMap:c.common.contextualErrorMap})))}};l(yn,"ZodPromise");yn.create=(n,r)=>new yn({type:n,typeName:ce.ZodPromise,...ve(r)});var At=class extends ge{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ce.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(r){let{status:c,ctx:d}=this._processInputParams(r),p=this._def.effect||null,g={addIssue:y=>{H(d,y),y.fatal?c.abort():c.dirty()},get path(){return d.path}};if(g.addIssue=g.addIssue.bind(g),p.type==="preprocess"){let y=p.transform(d.data,g);if(d.common.async)return Promise.resolve(y).then(async E=>{if(c.value==="aborted")return de;let T=await this._def.schema._parseAsync({data:E,path:d.path,parent:d});return T.status==="aborted"?de:T.status==="dirty"||c.value==="dirty"?za(T.value):T});{if(c.value==="aborted")return de;let E=this._def.schema._parseSync({data:y,path:d.path,parent:d});return E.status==="aborted"?de:E.status==="dirty"||c.value==="dirty"?za(E.value):E}}if(p.type==="refinement"){let y=l(E=>{let T=p.refinement(E,g);if(d.common.async)return Promise.resolve(T);if(T instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return E},"executeRefinement");if(d.common.async===!1){let E=this._def.schema._parseSync({data:d.data,path:d.path,parent:d});return E.status==="aborted"?de:(E.status==="dirty"&&c.dirty(),y(E.value),{status:c.value,value:E.value})}else return this._def.schema._parseAsync({data:d.data,path:d.path,parent:d}).then(E=>E.status==="aborted"?de:(E.status==="dirty"&&c.dirty(),y(E.value).then(()=>({status:c.value,value:E.value}))))}if(p.type==="transform")if(d.common.async===!1){let y=this._def.schema._parseSync({data:d.data,path:d.path,parent:d});if(!Qo(y))return y;let E=p.transform(y.value,g);if(E instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:c.value,value:E}}else return this._def.schema._parseAsync({data:d.data,path:d.path,parent:d}).then(y=>Qo(y)?Promise.resolve(p.transform(y.value,g)).then(E=>({status:c.value,value:E})):y);Re.assertNever(p)}};l(At,"ZodEffects");At.create=(n,r,c)=>new At({schema:n,typeName:ce.ZodEffects,effect:r,...ve(c)});At.createWithPreprocess=(n,r,c)=>new At({schema:r,effect:{type:"preprocess",transform:n},typeName:ce.ZodEffects,...ve(c)});var Gt=class extends ge{_parse(r){return this._getType(r)===J.undefined?vt(void 0):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}};l(Gt,"ZodOptional");Gt.create=(n,r)=>new Gt({innerType:n,typeName:ce.ZodOptional,...ve(r)});var xr=class extends ge{_parse(r){return this._getType(r)===J.null?vt(null):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}};l(xr,"ZodNullable");xr.create=(n,r)=>new xr({innerType:n,typeName:ce.ZodNullable,...ve(r)});var si=class extends ge{_parse(r){let{ctx:c}=this._processInputParams(r),d=c.data;return c.parsedType===J.undefined&&(d=this._def.defaultValue()),this._def.innerType._parse({data:d,path:c.path,parent:c})}removeDefault(){return this._def.innerType}};l(si,"ZodDefault");si.create=(n,r)=>new si({innerType:n,typeName:ce.ZodDefault,defaultValue:typeof r.default=="function"?r.default:()=>r.default,...ve(r)});var li=class extends ge{_parse(r){let{ctx:c}=this._processInputParams(r),d={...c,common:{...c.common,issues:[]}},p=this._def.innerType._parse({data:d.data,path:d.path,parent:{...d}});return Yo(p)?p.then(g=>({status:"valid",value:g.status==="valid"?g.value:this._def.catchValue({get error(){return new ut(d.common.issues)},input:d.data})})):{status:"valid",value:p.status==="valid"?p.value:this._def.catchValue({get error(){return new ut(d.common.issues)},input:d.data})}}removeCatch(){return this._def.innerType}};l(li,"ZodCatch");li.create=(n,r)=>new li({innerType:n,typeName:ce.ZodCatch,catchValue:typeof r.catch=="function"?r.catch:()=>r.catch,...ve(r)});var Qi=class extends ge{_parse(r){if(this._getType(r)!==J.nan){let d=this._getOrReturnCtx(r);return H(d,{code:$.invalid_type,expected:J.nan,received:d.parsedType}),de}return{status:"valid",value:r.data}}};l(Qi,"ZodNaN");Qi.create=n=>new Qi({typeName:ce.ZodNaN,...ve(n)});var xw=Symbol("zod_brand"),Wa=class extends ge{_parse(r){let{ctx:c}=this._processInputParams(r),d=c.data;return this._def.type._parse({data:d,path:c.path,parent:c})}unwrap(){return this._def.type}};l(Wa,"ZodBranded");var ci=class extends ge{_parse(r){let{status:c,ctx:d}=this._processInputParams(r);if(d.common.async)return l(async()=>{let g=await this._def.in._parseAsync({data:d.data,path:d.path,parent:d});return g.status==="aborted"?de:g.status==="dirty"?(c.dirty(),za(g.value)):this._def.out._parseAsync({data:g.value,path:d.path,parent:d})},"handleAsync")();{let p=this._def.in._parseSync({data:d.data,path:d.path,parent:d});return p.status==="aborted"?de:p.status==="dirty"?(c.dirty(),{status:"dirty",value:p.value}):this._def.out._parseSync({data:p.value,path:d.path,parent:d})}}static create(r,c){return new ci({in:r,out:c,typeName:ce.ZodPipeline})}};l(ci,"ZodPipeline");var ui=class extends ge{_parse(r){let c=this._def.innerType._parse(r),d=l(p=>(Qo(p)&&(p.value=Object.freeze(p.value)),p),"freeze");return Yo(c)?c.then(p=>d(p)):d(c)}unwrap(){return this._def.innerType}};l(ui,"ZodReadonly");ui.create=(n,r)=>new ui({innerType:n,typeName:ce.ZodReadonly,...ve(r)});function Gp(n,r={},c){return n?mn.create().superRefine((d,p)=>{var g,y;if(!n(d)){let E=typeof r=="function"?r(d):typeof r=="string"?{message:r}:r,T=(y=(g=E.fatal)!==null&&g!==void 0?g:c)!==null&&y!==void 0?y:!0,V=typeof E=="string"?{message:E}:E;p.addIssue({code:"custom",...V,fatal:T})}}):mn.create()}l(Gp,"custom");var Ew={object:Ue.lazycreate},ce;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(ce||(ce={}));var Cw=l((n,r={message:`Input not instance of ${n.name}`})=>Gp(c=>c instanceof n,r),"instanceOfType"),Jp=Rt.create,Qp=br.create,Sw=Qi.create,Tw=_r.create,Yp=Kn.create,Rw=Br.create,kw=Wi.create,Aw=Xn.create,Ow=ei.create,Iw=mn.create,Pw=Fr.create,Vw=ir.create,Nw=Hi.create,jw=kt.create,Dw=Ue.create,Lw=Ue.strictCreate,Mw=ti.create,Uw=Gi.create,Bw=ri.create,Fw=Ht.create,Zw=ni.create,qw=Ji.create,$w=Zr.create,zw=gn.create,Ww=ii.create,Hw=ai.create,Gw=wr.create,Jw=oi.create,Qw=yn.create,Fp=At.create,Yw=Gt.create,Kw=xr.create,Xw=At.createWithPreprocess,ex=ci.create,tx=l(()=>Jp().optional(),"ostring"),rx=l(()=>Qp().optional(),"onumber"),nx=l(()=>Yp().optional(),"oboolean"),ix={string:n=>Rt.create({...n,coerce:!0}),number:n=>br.create({...n,coerce:!0}),boolean:n=>Kn.create({...n,coerce:!0}),bigint:n=>_r.create({...n,coerce:!0}),date:n=>Br.create({...n,coerce:!0})},ax=de,o=Object.freeze({__proto__:null,defaultErrorMap:Ha,setErrorMap:aw,getErrorMap:Wl,makeIssue:Hl,EMPTY_PATH:ow,addIssueToContext:H,ParseStatus:Ke,INVALID:de,DIRTY:za,OK:vt,isAborted:fd,isDirty:pd,isValid:Qo,isAsync:Yo,get util(){return Re},get objectUtil(){return dd},ZodParsedType:J,getParsedType:Yn,ZodType:ge,datetimeRegex:Wp,ZodString:Rt,ZodNumber:br,ZodBigInt:_r,ZodBoolean:Kn,ZodDate:Br,ZodSymbol:Wi,ZodUndefined:Xn,ZodNull:ei,ZodAny:mn,ZodUnknown:Fr,ZodNever:ir,ZodVoid:Hi,ZodArray:kt,ZodObject:Ue,ZodUnion:ti,ZodDiscriminatedUnion:Gi,ZodIntersection:ri,ZodTuple:Ht,ZodRecord:ni,ZodMap:Ji,ZodSet:Zr,ZodFunction:gn,ZodLazy:ii,ZodLiteral:ai,ZodEnum:wr,ZodNativeEnum:oi,ZodPromise:yn,ZodEffects:At,ZodTransformer:At,ZodOptional:Gt,ZodNullable:xr,ZodDefault:si,ZodCatch:li,ZodNaN:Qi,BRAND:xw,ZodBranded:Wa,ZodPipeline:ci,ZodReadonly:ui,custom:Gp,Schema:ge,ZodSchema:ge,late:Ew,get ZodFirstPartyTypeKind(){return ce},coerce:ix,any:Iw,array:jw,bigint:Tw,boolean:Yp,date:Rw,discriminatedUnion:Uw,effect:Fp,enum:Gw,function:zw,instanceof:Cw,intersection:Bw,lazy:Ww,literal:Hw,map:qw,nan:Sw,nativeEnum:Jw,never:Vw,null:Ow,nullable:Kw,number:Qp,object:Dw,oboolean:nx,onumber:rx,optional:Yw,ostring:tx,pipeline:ex,preprocess:Xw,promise:Qw,record:Zw,set:$w,strictObject:Lw,string:Jp,symbol:kw,transformer:Fp,tuple:Fw,undefined:Aw,union:Mw,unknown:Pw,void:Nw,NEVER:ax,ZodIssueCode:$,quotelessJson:iw,ZodError:ut});var Ga=Symbol("current"),Yi=Symbol("previous");var Ko=l((n,{ref:r,refType:c,param:d,header:p,...g}={})=>({...g,...n}),"mergeOpenApi");function Xo(n){if(typeof n.ZodType.prototype.openapi<"u")return;n.ZodType.prototype.openapi=function(g){let{zodOpenApi:y,...E}=this._def,T=new this.constructor({...E,zodOpenApi:{openapi:Ko(g,y?.openapi)}});return T._def.zodOpenApi[Ga]=T,y&&(T._def.zodOpenApi[Yi]=this),T};let r=n.ZodType.prototype.describe;n.ZodType.prototype.describe=function(...g){let y=r.apply(this,g),E=y._def;if(E.zodOpenApi){let T={...E.zodOpenApi};T.openapi=Ko({description:g[0]},T.openapi),T[Yi]=this,T[Ga]=y,E.zodOpenApi=T}else E.zodOpenApi={openapi:{description:g[0]},[Ga]:y};return y};let c=n.ZodObject.prototype.extend;n.ZodObject.prototype.extend=function(...g){let y=c.apply(this,g),E=y._def.zodOpenApi;if(E){let T={...E};T.openapi=Ko({},T.openapi),T[Yi]=this,y._def.zodOpenApi=T}else y._def.zodOpenApi={[Yi]:this};return y};let d=n.ZodObject.prototype.omit;n.ZodObject.prototype.omit=function(...g){let y=d.apply(this,g),E=y._def.zodOpenApi;if(E){let T={...E};T.openapi=Ko({},T.openapi),delete T[Yi],delete T[Ga],y._def.zodOpenApi=T}return y};let p=n.ZodObject.prototype.pick;n.ZodObject.prototype.pick=function(...g){let y=p.apply(this,g),E=y._def.zodOpenApi;if(E){let T={...E};T.openapi=Ko({},T.openapi),delete T[Yi],delete T[Ga],y._def.zodOpenApi=T}return y}}l(Xo,"extendZodWithOpenApi");Xo(o);var ox=Object.defineProperty,sx=l((n,r)=>ox(n,"name",{value:r,configurable:!0}),"__name"),Ql=o.array(o.string().or(o.record(o.any()))),dA=o.object({type:o.string().optional(),narrative:o.string().optional()}),Yl=o.string().or(o.object({id:o.string(),type:o.string(),caption:o.string().optional()})),lx=o.object({type:o.string().min(1).or(o.string().array().nonempty()),latitude:o.number(),longitude:o.number()}),cx=o.object({type:o.string().min(1).or(o.string().array().nonempty()),addressCountry:o.string().optional(),addressCountryCode:o.string().optional(),addressRegion:o.string().optional(),addressLocality:o.string().optional(),streetAddress:o.string().optional(),postOfficeBoxNumber:o.string().optional(),postalCode:o.string().optional(),geo:lx.optional()}),ux=o.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(o.string()),uh=o.object({type:o.string().min(1).or(o.string().array().nonempty()),identifier:o.string(),identifierType:ux}),es=o.string().or(o.object({id:o.string().optional(),type:o.string().or(o.string().array().nonempty().optional()),name:o.string().optional(),url:o.string().optional(),phone:o.string().optional(),description:o.string().optional(),endorsement:o.any().array().optional(),image:Yl.optional(),email:o.string().email().optional(),address:cx.optional(),otherIdentifier:uh.array().optional(),official:o.string().optional(),parentOrg:o.any().optional(),familyName:o.string().optional(),givenName:o.string().optional(),additionalName:o.string().optional(),patronymicName:o.string().optional(),honorificPrefix:o.string().optional(),honorificSuffix:o.string().optional(),familyNamePrefix:o.string().optional(),dateOfBirth:o.string().optional()}).catchall(o.any())),gd=o.object({id:o.string().optional()}).catchall(o.any()),Jl=o.object({type:o.string(),id:o.string()}).catchall(o.any()),Kp=o.object({id:o.string(),type:o.string()}).catchall(o.any()),Xp=o.object({id:o.string().optional(),type:o.string()}).catchall(o.any()),eh=o.object({type:o.string(),id:o.string().optional()}).catchall(o.any()),th=o.object({type:o.string().or(o.string().array().nonempty()),id:o.string().optional()}).catchall(o.any()),Ja=o.object({"@context":Ql,id:o.string().optional(),type:o.string().array().nonempty(),issuer:es,credentialSubject:gd.or(gd.array()),refreshService:Xp.or(Xp.array()).optional(),credentialSchema:Kp.or(Kp.array()).optional(),issuanceDate:o.string().optional(),expirationDate:o.string().optional(),credentialStatus:Jl.or(Jl.array()).optional(),name:o.string().optional(),description:o.string().optional(),validFrom:o.string().optional(),validUntil:o.string().optional(),status:Jl.or(Jl.array()).optional(),termsOfUse:eh.or(eh.array()).optional(),evidence:th.or(th.array()).optional()}).catchall(o.any()),qr=o.object({type:o.string(),created:o.string(),challenge:o.string().optional(),domain:o.string().optional(),nonce:o.string().optional(),proofPurpose:o.string(),verificationMethod:o.string(),jws:o.string().optional()}).catchall(o.any()),di=Ja.extend({proof:qr.or(qr.array())}),dx=o.object({"@context":Ql,id:o.string().optional(),type:o.string().or(o.string().array().nonempty()),verifiableCredential:di.or(di.array()).optional(),holder:o.string().optional()}).catchall(o.any()),Qa=dx.extend({proof:qr.or(qr.array())}),bd=o.object({kty:o.string(),crv:o.string(),x:o.string(),y:o.string().optional(),n:o.string().optional(),d:o.string().optional()}),hA=bd.omit({d:!0}).extend({d:o.string()}),fx=o.object({alg:o.string(),iv:o.string(),tag:o.string(),epk:bd.partial().optional(),kid:o.string().optional(),apv:o.string().optional(),apu:o.string().optional()}),px=o.object({header:fx,encrypted_key:o.string()}),hx=o.object({protected:o.string(),iv:o.string(),ciphertext:o.string(),tag:o.string(),aad:o.string().optional(),recipients:px.array().optional()}),Ki=o.string().or(o.object({"@context":Ql.optional(),id:o.string(),type:o.string(),controller:o.string(),publicKeyJwk:bd.optional(),publicKeyBase58:o.string().optional(),publicKeyMultibase:o.string().optional(),blockChainAccountId:o.string().optional()}).catchall(o.any())),mx=o.object({id:o.string(),type:o.string().or(o.string().array().nonempty()),serviceEndpoint:o.any().or(o.any().array().nonempty())}).catchall(o.any()),mA=o.object({"@context":Ql,id:o.string(),alsoKnownAs:o.string().optional(),controller:o.string().or(o.string().array().nonempty()).optional(),verificationMethod:Ki.array().optional(),authentication:Ki.array().optional(),assertionMethod:Ki.array().optional(),keyAgreement:Ki.array().optional(),capabilityInvocation:Ki.array().optional(),capabilityDelegation:Ki.array().optional(),publicKey:Ki.array().optional(),service:mx.array().optional(),proof:qr.or(qr.array()).optional()}).catchall(o.any()),gx=o.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(o.string()),Kl=o.object({type:o.string().array().nonempty(),targetCode:o.string().optional(),targetDescription:o.string().optional(),targetName:o.string(),targetFramework:o.string().optional(),targetType:gx.optional(),targetUrl:o.string()}),yx=o.enum(["Achievement","ApprenticeshipCertificate","Assessment","Assignment","AssociateDegree","Award","Badge","BachelorDegree","Certificate","CertificateOfCompletion","Certification","CommunityService","Competency","Course","CoCurricular","Degree","Diploma","DoctoralDegree","Fieldwork","GeneralEducationDevelopment","JourneymanCertificate","LearningProgram","License","Membership","ProfessionalDoctorate","QualityAssuranceCredential","MasterCertificate","MasterDegree","MicroCredential","ResearchDoctorate","SecondarySchoolDiploma"]),vx=yx.or(o.string()),bx=o.object({id:o.string().optional(),narrative:o.string().optional()}).catchall(o.any()),_x=o.object({id:o.string(),type:o.string().array().nonempty(),endorsementComment:o.string().optional()}),wx=Ja.extend({credentialSubject:_x,proof:qr.or(qr.array()).optional()}),xx=o.object({id:o.string(),"@language":o.string().optional(),version:o.string().optional()}),Ex=o.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(o.string()),Cx=o.object({id:o.string(),type:o.string().array().nonempty(),alignment:Kl.array().optional(),description:o.string().optional(),level:o.string().optional(),name:o.string(),points:o.string().optional()}).catchall(o.any()),Sx=o.object({id:o.string(),type:o.string().array().nonempty(),alignment:Kl.array().optional(),allowedValue:o.string().array().optional(),name:o.string(),requiredLevel:o.string().optional(),requiredValue:o.string().optional(),resultType:Ex,rubricCriterionLevel:Cx.array().optional(),valueMax:o.string().optional(),valueMin:o.string().optional()}).catchall(o.any()),Tx=o.object({id:o.string().optional(),type:o.string().array().nonempty(),alignment:Kl.array().optional(),achievementType:vx.optional(),creator:es.optional(),creditsAvailable:o.number().optional(),criteria:bx,description:o.string(),endorsement:wx.array().optional(),fieldOfStudy:o.string().optional(),humanCode:o.string().optional(),image:Yl.optional(),"@language":o.string().optional(),name:o.string(),otherIdentifier:uh.array().optional(),related:xx.array().optional(),resultDescription:Sx.array().optional(),specialization:o.string().optional(),tag:o.string().array().optional(),version:o.string().optional()}).catchall(o.any()),Rx=o.object({type:o.string(),hashed:o.boolean(),identityHash:o.string(),identityType:o.string(),salt:o.string().optional()}),kx=o.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),Ax=o.object({type:o.string().array().nonempty(),achievedLevel:o.string().optional(),alignment:Kl.array().optional(),resultDescription:o.string().optional(),status:kx.optional(),value:o.string().optional()}).catchall(o.any()),rh=o.object({id:o.string().optional(),type:o.string().array().nonempty(),activityEndDate:o.string().optional(),activityStartDate:o.string().optional(),creditsEarned:o.number().optional(),achievement:Tx.optional(),identifier:Rx.array().optional(),image:Yl.optional(),licenseNumber:o.string().optional(),narrative:o.string().optional(),result:Ax.array().optional(),role:o.string().optional(),source:es.optional(),term:o.string().optional()}).catchall(o.any()),Ox=o.object({id:o.string().optional(),type:o.string().or(o.string().array().nonempty()),narrative:o.string().optional(),name:o.string().optional(),description:o.string().optional(),genre:o.string().optional(),audience:o.string().optional()}).catchall(o.any()),Ix=Ja.extend({name:o.string().optional(),description:o.string().optional(),image:Yl.optional(),credentialSubject:rh.or(rh.array()),endorsement:Ja.array().optional(),evidence:Ox.array().optional()}),yA=Ix.extend({proof:qr.or(qr.array())}),bA=o.object({checks:o.string().array(),warnings:o.string().array(),errors:o.string().array()}),dh=o.enum(["Success","Failed","Error"]),_A=dh.enum,wA=o.object({check:o.string(),status:dh,message:o.string().optional(),details:o.string().optional()}),xA=o.object({title:o.string().optional(),createdAt:o.string().optional(),issuer:es.optional(),issuee:es.optional(),credentialSubject:gd.optional()}),EA=o.object({id:o.string(),uri:o.string()}).catchall(o.any()),TA=o.object({limit:o.number(),cursor:o.string().optional(),sort:o.string().optional()}),ot=o.object({cursor:o.string().optional(),hasMore:o.boolean()}),fh=o.object({encryptedRecord:hx,fields:o.string().array()}).catchall(o.any()),RA=ot.extend({records:fh.array()}),Px=fh.extend({id:o.string()}),kA=ot.extend({records:Px.array()}),nh=sx(n=>{let r=n.match(/^\/(.*)\/([gimsuy]*)$/);if(!r)throw new Error("Invalid RegExp string format");return{pattern:r[1],flags:r[2]}},"parseRegexString"),Vx=o.instanceof(RegExp).or(o.string().refine(n=>{try{return nh(n),!0}catch{return!1}},{message:"Invalid RegExp string format. Must be in format '/pattern/flags'"}).transform(n=>{let{pattern:r,flags:c}=nh(n);try{return new RegExp(r,c)}catch(d){throw new Error(`Invalid RegExp: ${d.message}`)}})),ih=o.string().or(o.object({$in:o.string().array()})).or(o.object({$regex:Vx})),ye=o.union([ih,o.object({$or:ih.array()})]);Xo(o);var Nx=o.object({backgroundColor:o.string().optional(),backgroundImage:o.string().optional(),fadeBackgroundImage:o.boolean().optional(),repeatBackgroundImage:o.boolean().optional(),fontColor:o.string().optional(),accentColor:o.string().optional(),accentFontColor:o.string().optional(),idBackgroundImage:o.string().optional(),fadeIdBackgroundImage:o.boolean().optional(),idBackgroundColor:o.string().optional(),repeatIdBackgroundImage:o.boolean().optional()}),$r=o.object({profileId:o.string().min(3).max(40).describe("Unique, URL-safe identifier for the profile."),displayName:o.string().default("").describe("Human-readable display name for the profile."),shortBio:o.string().default("").describe("Short bio for the profile."),bio:o.string().default("").describe("Longer bio for the profile."),did:o.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),isPrivate:o.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),email:o.string().optional().describe("Contact email address for the profile. (deprecated)"),image:o.string().optional().describe("Profile image URL for the profile."),heroImage:o.string().optional().describe("Hero image URL for the profile."),websiteLink:o.string().optional().describe("Website link for the profile."),isServiceProfile:o.boolean().default(!1).optional().describe("Whether the profile is a service profile or not."),type:o.string().optional().describe('Profile type: e.g. "person", "organization", "service".'),notificationsWebhook:o.string().url().startsWith("http").optional().describe("URL to send notifications to."),display:Nx.optional().describe("Display settings for the profile."),highlightedCredentials:o.array(o.string()).max(5).optional().describe("Up to 5 unique boost URIs to highlight on the profile."),role:o.string().default("").optional().describe('Role of the profile: e.g. "teacher", "student".'),dob:o.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".'),country:o.string().optional().describe("Country for the profile."),approved:o.boolean().optional().describe("Approval status for the profile.")}),PA=o.object({profileId:ye,displayName:ye,shortBio:ye,bio:ye,email:ye,websiteLink:ye,isServiceProfile:o.boolean(),type:ye}).partial(),VA=ot.extend({records:$r.array()}),NA=o.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),ph=o.object({id:o.string(),created:o.string(),displayName:o.string().default("").optional(),shortBio:o.string().default("").optional(),bio:o.string().default("").optional(),email:o.string().optional(),image:o.string().optional(),heroImage:o.string().optional()}),jA=ot.extend({records:ph.extend({did:o.string()}).array()}),DA=o.object({id:ye,displayName:ye,shortBio:ye,bio:ye,email:ye}).partial(),LA=ot.extend({records:o.object({profile:$r,manager:ph.extend({did:o.string()}).optional()}).array()}),MA=o.object({uri:o.string(),to:o.string(),from:o.string(),sent:o.string().datetime(),received:o.string().datetime().optional()}),hh=o.object({role:o.string(),canEdit:o.boolean(),canIssue:o.boolean(),canRevoke:o.boolean(),canManagePermissions:o.boolean(),canIssueChildren:o.string(),canCreateChildren:o.string(),canEditChildren:o.string(),canRevokeChildren:o.string(),canManageChildrenPermissions:o.string(),canManageChildrenProfiles:o.boolean().default(!1).optional(),canViewAnalytics:o.boolean()}),jx=o.object({role:ye,canEdit:o.boolean(),canIssue:o.boolean(),canRevoke:o.boolean(),canManagePermissions:o.boolean(),canIssueChildren:ye,canCreateChildren:ye,canEditChildren:ye,canRevokeChildren:ye,canManageChildrenPermissions:ye,canManageChildrenProfiles:o.boolean(),canViewAnalytics:o.boolean()}).partial(),md=o.enum(["GRANT_PERMISSIONS","ADD_ADMIN","AUTO_CONNECT"]),Dx=o.discriminatedUnion("type",[o.object({type:o.literal(md.Values.GRANT_PERMISSIONS),data:o.object({claimUri:o.string(),targetUri:o.string(),permissions:hh.partial()})}),o.object({type:o.literal(md.Values.ADD_ADMIN),data:o.object({claimUri:o.string(),targetUri:o.string()})}),o.object({type:o.literal(md.Values.AUTO_CONNECT),data:o.object({claimUri:o.string(),targetUri:o.string()})})]),UA=o.object({type:ye,data:o.object({claimUri:ye,targetUri:ye,permissions:jx})}).deepPartial(),Lx=o.object({id:o.string(),createdAt:o.string(),updatedAt:o.string()}).and(Dx),BA=ot.extend({records:Lx.array()}),yd=o.enum(["DRAFT","LIVE"]),Mx=o.object({uri:o.string(),name:o.string().optional(),type:o.string().optional(),category:o.string().optional(),status:yd.optional(),autoConnectRecipients:o.boolean().optional(),meta:o.record(o.any()).optional(),claimPermissions:hh.optional(),allowAnyoneToCreateChildren:o.boolean().optional()}),ah=o.object({uri:ye,name:ye,type:ye,category:ye,meta:o.record(ye),status:yd.or(o.object({$in:yd.array()})),autoConnectRecipients:o.boolean()}).partial(),FA=o.union([o.object({$or:ah.array()}),ah]),ZA=ot.extend({records:Mx.array()}),Ux=o.object({to:$r,from:o.string(),received:o.string().optional(),uri:o.string().optional()}),qA=ot.extend({records:Ux.array()}),Bx=o.object({to:$r,from:o.string(),received:o.string().optional(),boostUris:o.array(o.string()),credentialUris:o.array(o.string()).optional()}),$A=ot.extend({records:Bx.array()}),zA=o.object({endpoint:o.string(),name:o.string(),did:o.string().optional()}),WA=o.object({ttlSeconds:o.number().optional(),totalUses:o.number().optional()}),Fx=o.object({endpoint:o.string()}),HA=o.object({signingAuthority:Fx,relationship:o.object({name:o.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:o.string(),isPrimary:o.boolean().optional()})}),GA=o.object({boostUri:o.string(),signingAuthority:o.object({endpoint:o.string(),name:o.string()})}),Zx=o.enum(["live","stale","withdrawn"]),qx=o.object({read:o.object({anonymize:o.boolean().optional(),credentials:o.object({categories:o.record(o.object({required:o.boolean(),defaultEnabled:o.boolean().optional()})).default({})}).default({}),personal:o.record(o.object({required:o.boolean(),defaultEnabled:o.boolean().optional()})).default({})}).default({}),write:o.object({credentials:o.object({categories:o.record(o.object({required:o.boolean(),defaultEnabled:o.boolean().optional()})).default({})}).default({}),personal:o.record(o.object({required:o.boolean(),defaultEnabled:o.boolean().optional()})).default({})}).default({})}),mh=o.object({contract:qx,owner:$r,name:o.string(),subtitle:o.string().optional(),description:o.string().optional(),reasonForAccessing:o.string().optional(),image:o.string().optional(),uri:o.string(),needsGuardianConsent:o.boolean().optional(),redirectUrl:o.string().optional(),frontDoorBoostUri:o.string().optional(),createdAt:o.string(),updatedAt:o.string(),expiresAt:o.string().optional(),autoBoosts:o.string().array().optional(),writers:o.array($r).optional()}),JA=ot.extend({records:mh.omit({owner:!0}).array()}),$x=o.object({credentials:o.object({categories:o.record(o.string().array()).default({})}),personal:o.record(o.string()).default({}),date:o.string()}),QA=ot.extend({records:$x.array()}),zx=o.object({credentials:o.object({category:o.string(),uri:o.string()}).array(),personal:o.record(o.string()).default({}),date:o.string(),contractUri:o.string()}),YA=ot.extend({records:zx.array()}),gh=o.object({sharing:o.boolean().optional(),shared:o.string().array().optional(),shareAll:o.boolean().optional(),shareUntil:o.string().optional()}),yh=o.object({read:o.object({anonymize:o.boolean().optional(),credentials:o.object({shareAll:o.boolean().optional(),sharing:o.boolean().optional(),categories:o.record(gh).default({})}).default({}),personal:o.record(o.string()).default({})}).default({}),write:o.object({credentials:o.object({categories:o.record(o.boolean()).default({})}).default({}),personal:o.record(o.boolean()).default({})}).default({}),deniedWriters:o.array(o.string()).optional()}),KA=ot.extend({records:o.object({expiresAt:o.string().optional(),oneTime:o.boolean().optional(),terms:yh,contract:mh,uri:o.string(),consenter:$r,status:Zx}).array()}),XA=o.object({read:o.object({anonymize:o.boolean().optional(),credentials:o.object({categories:o.record(o.object({required:o.boolean().optional()})).optional()}).optional(),personal:o.record(o.object({required:o.boolean().optional()})).optional()}).optional(),write:o.object({credentials:o.object({categories:o.record(o.object({required:o.boolean().optional()})).optional()}).optional(),personal:o.record(o.object({required:o.boolean().optional()})).optional()}).optional()}),eO=o.object({anonymize:o.boolean().optional(),credentials:o.object({categories:o.record(o.boolean()).optional()}).optional(),personal:o.record(o.boolean()).optional()}),tO=o.object({credentials:o.object({categories:o.record(o.boolean()).optional()}).optional(),personal:o.record(o.boolean()).optional(),id:ye.optional()}),Wx=o.object({read:o.object({anonymize:o.boolean().optional(),credentials:o.object({shareAll:o.boolean().optional(),sharing:o.boolean().optional(),categories:o.record(gh.optional()).optional()}).optional(),personal:o.record(o.string()).optional()}).optional(),write:o.object({credentials:o.object({categories:o.record(o.boolean()).optional()}).optional(),personal:o.record(o.boolean()).optional()}).optional()}),vd=o.enum(["consent","update","sync","withdraw","write"]),rO=o.object({terms:Wx.optional(),action:vd.or(vd.array()).optional(),date:o.object({$gt:o.string()}).or(o.object({$lt:o.string()})).or(o.object({$eq:o.string()})).optional(),expiresAt:o.object({$gt:o.string()}).or(o.object({$lt:o.string()})).or(o.object({$eq:o.string()})).optional(),oneTime:o.boolean().optional()}),vh=o.object({expiresAt:o.string().optional(),oneTime:o.boolean().optional(),terms:yh.optional(),id:o.string(),action:vd,date:o.string(),uris:o.string().array().optional()}),nO=ot.extend({records:vh.array()}),oh=o.object({id:ye,name:ye,description:ye,sourceURI:ye,status:ye}).partial(),iO=o.union([o.object({$or:oh.array()}),oh]),Hx=o.object({credentialUri:o.string(),termsUri:o.string(),contractUri:o.string(),boostUri:o.string(),category:o.string().optional(),date:o.string()}),aO=ot.extend({records:Hx.array()}),Gx=o.enum(["CONNECTION_REQUEST","CONNECTION_ACCEPTED","CREDENTIAL_RECEIVED","CREDENTIAL_ACCEPTED","BOOST_RECEIVED","BOOST_ACCEPTED","PRESENTATION_REQUEST","PRESENTATION_RECEIVED","CONSENT_FLOW_TRANSACTION","ISSUANCE_CLAIMED","ISSUANCE_DELIVERED","ISSUANCE_ERROR","PROFILE_PARENT_APPROVED"]),Jx=o.object({title:o.string().optional(),body:o.string().optional()}),Qx=o.object({type:o.string(),value:o.string()}),Xl=o.enum(["PENDING","ISSUED","EXPIRED","DELIVERED","CLAIMED"]),Yx=o.object({issuanceId:o.string(),status:Xl,recipient:o.object({contactMethod:Qx.optional(),learnCardId:o.string().optional()}),timestamp:o.string().datetime().optional()}),Kx=o.object({vcUris:o.array(o.string()).optional(),vpUris:o.array(o.string()).optional(),transaction:vh.optional(),inbox:Yx.optional()}),oO=o.object({type:Gx,to:$r.partial().and(o.object({did:o.string()})),from:$r.partial().and(o.object({did:o.string()})),message:Jx.optional(),data:Kx.optional(),sent:o.string().datetime().optional(),webhookUrl:o.string().optional()}),Xx="auth-grant:",sO=o.object({id:o.string(),name:o.string(),description:o.string().optional(),challenge:o.string().startsWith(Xx).min(10,{message:"Challenge is too short"}).max(100,{message:"Challenge is too long"}),status:o.enum(["revoked","active"],{required_error:"Status is required",invalid_type_error:"Status must be either active or revoked"}),scope:o.string(),createdAt:o.string().datetime({message:"createdAt must be a valid ISO 8601 datetime string"}),expiresAt:o.string().datetime({message:"expiresAt must be a valid ISO 8601 datetime string"}).nullish().optional()}),lO=o.object({id:o.string()}).catchall(o.any()),eE=o.enum(["active","revoked"]),cO=o.object({id:ye,name:ye,description:ye,status:eE}).partial(),sh=o.object({id:o.string(),isVerified:o.boolean(),verifiedAt:o.string().optional(),isPrimary:o.boolean(),createdAt:o.string()}),uO=o.discriminatedUnion("type",[o.object({type:o.literal("email"),value:o.string().email()}).merge(sh),o.object({type:o.literal("phone"),value:o.string()}).merge(sh)]),lh=o.object({isVerified:o.boolean().optional(),isPrimary:o.boolean().optional()}),dO=o.discriminatedUnion("type",[o.object({type:o.literal("email"),value:o.string().email()}).merge(lh),o.object({type:o.literal("phone"),value:o.string()}).merge(lh)]),bh=o.discriminatedUnion("type",[o.object({type:o.literal("email"),value:o.string().email()}),o.object({type:o.literal("phone"),value:o.string()})]),tE=o.object({value:o.string(),type:o.enum(["email","phone"])}),fO=o.object({token:o.string()}),pO=o.object({contactMethodId:o.string()}),hO=o.object({contactMethod:tE,otpChallenge:o.string()}),mO=o.object({sessionJwt:o.string()}),rE=o.object({id:o.string(),credential:o.string(),isSigned:o.boolean(),currentStatus:Xl,isAccepted:o.boolean().optional(),expiresAt:o.string(),createdAt:o.string(),issuerDid:o.string(),webhookUrl:o.string().optional(),signingAuthority:o.object({endpoint:o.string().optional(),name:o.string().optional()}).optional()}),gO=o.object({hasMore:o.boolean(),records:o.array(rE),cursor:o.string().optional()}),yO=o.object({currentStatus:Xl,id:o.string(),isSigned:o.boolean(),isAccepted:o.boolean().optional(),issuerDid:o.string()}).partial(),nE=o.object({endpoint:o.string().url(),name:o.string()}),vO=o.object({recipient:bh.describe("The recipient of the credential"),credential:di.passthrough().or(Qa.passthrough()).or(Ja.passthrough()).describe("The credential to issue. If not signed, the users default signing authority will be used, or the specified signing authority in the configuration."),configuration:o.object({signingAuthority:nE.optional().describe("The signing authority to use for the credential. If not provided, the users default signing authority will be used if the credential is not signed."),webhookUrl:o.string().url().optional().describe("The webhook URL to receive credential issuance events."),expiresInDays:o.number().min(1).max(365).optional().describe("The number of days the credential will be valid for."),delivery:o.object({suppress:o.boolean().optional().default(!1).describe("Whether to suppress delivery of the credential to the recipient. If true, the email/sms will not be sent to the recipient. Useful if you would like to manually send claim link to your users."),template:o.object({id:o.enum(["universal-inbox-claim"]).optional().describe("The template ID to use for the credential delivery. If not provided, the default template will be used."),model:o.object({issuer:o.object({name:o.string().optional().describe('The name of the organization (e.g., "State University").'),logoUrl:o.string().url().optional().describe("The URL of the organization's logo.")}).optional(),credential:o.object({name:o.string().optional().describe('The name of the credential (e.g., "Bachelor of Science").'),type:o.string().optional().describe('The type of the credential (e.g., "degree", "certificate").')}).optional(),recipient:o.object({name:o.string().optional().describe('The name of the recipient (e.g., "John Doe").')}).optional()}).describe("The template model to use for the credential delivery. Injects via template variables into email/sms templates. If not provided, the default template will be used.")}).optional().describe("The template to use for the credential delivery. If not provided, the default template will be used.")}).optional().describe("Configuration for the credential delivery i.e. email or SMS. When credentials are sent to a user who has a verified email or phone associated with their account, delivery is skipped, and the credential will be sent using in-app notifications. If not provided, the default configuration will be used.")}).optional().describe("Configuration for the credential issuance. If not provided, the default configuration will be used.")}),bO=o.object({issuanceId:o.string(),status:Xl,recipient:bh,claimUrl:o.string().url().optional(),recipientDid:o.string().optional()}),_O=o.object({credential:di.passthrough().or(Qa.passthrough()).or(Ja.passthrough()).describe("The credential to issue."),configuration:o.object({publishableKey:o.string(),signingAuthorityName:o.string().optional()}).optional()}),_d=o.union([o.string().regex(/^(?:(?:[a-zA-Z0-9-]{1,63}\.)+[a-zA-Z]{2,63}|localhost|\d{1,3}(?:\.\d{1,3}){3})(?::\d{1,5})?$/,{message:"Must be a valid domain (incl. subdomains), localhost, or IPv4, optionally with port"}),o.string().regex(/^https?:\/\/(?:(?:[a-zA-Z0-9-]{1,63}\.)+[a-zA-Z]{2,63}|localhost|\d{1,3}(?:\.\d{1,3}){3})(?::\d{1,5})?$/,{message:"Must be a valid http(s) origin"})]),iE=o.object({id:o.string(),name:o.string(),description:o.string().optional(),publishableKey:o.string(),whitelistedDomains:o.array(_d).default([])}),wO=o.object({name:o.string(),description:o.string().optional(),whitelistedDomains:o.array(_d).default([])}),xO=o.object({name:o.string().optional(),description:o.string().optional(),whitelistedDomains:o.array(_d).optional(),rotatePublishableKey:o.boolean().optional()}),EO=o.object({id:ye,name:ye,description:ye}).partial(),CO=ot.extend({records:iE.array()}),SO=o.object({token:o.string(),contactMethodId:o.string(),autoVerifyContactMethod:o.boolean().optional().default(!1),createdAt:o.string(),expiresAt:o.string(),used:o.boolean()}),TO=o.object({id:o.string(),name:o.string().min(1),slug:o.string().min(1),createdAt:o.string().optional(),updatedAt:o.string().optional()}),ts=o.enum(["active","archived"]),_h=o.object({id:o.string(),statement:o.string(),description:o.string().optional(),code:o.string().optional(),icon:o.string().optional(),type:o.string().default("skill"),status:ts.default("active"),frameworkId:o.string().optional(),createdAt:o.string().optional(),updatedAt:o.string().optional()}),ch=o.object({id:ye,statement:ye,description:ye,code:ye,type:ye,status:ts.or(o.object({$in:ts.array()}))}).partial(),RO=o.union([o.object({$or:ch.array()}),ch]),wd=o.enum(["active","archived"]),wh=o.object({id:o.string(),name:o.string(),description:o.string().optional(),image:o.string().optional(),sourceURI:o.string().url().optional(),status:wd.default("active"),createdAt:o.string().optional(),updatedAt:o.string().optional()}),kO=ot.extend({records:wh.array()}),xd=_h.extend({children:o.array(o.lazy(()=>xd)),hasChildren:o.boolean(),childrenCursor:o.string().nullable().optional()}).openapi({ref:"SkillTreeNode"}),aE=o.object({hasMore:o.boolean(),cursor:o.string().nullable(),records:o.array(xd)}),Ya=o.lazy(()=>o.object({id:o.string().optional(),statement:o.string(),description:o.string().optional(),code:o.string().optional(),icon:o.string().optional(),type:o.string().optional(),status:ts.optional(),children:o.array(Ya).optional()})).openapi({ref:"SkillTreeNodeInput"}),AO=o.object({frameworkId:o.string()}),oE=o.object({id:o.string().optional(),name:o.string().min(1),description:o.string().optional(),image:o.string().optional(),sourceURI:o.string().url().optional(),status:wd.optional(),skills:o.array(Ya).optional(),boostUris:o.array(o.string()).optional()}),OO=o.object({id:o.string(),name:o.string().min(1).optional(),description:o.string().optional(),image:o.string().optional(),sourceURI:o.string().url().optional(),status:wd.optional()}).refine(n=>n.name!==void 0||n.description!==void 0||n.image!==void 0||n.sourceURI!==void 0||n.status!==void 0,{message:"At least one field must be provided to update",path:["name"]}),IO=o.object({id:o.string()}),PO=o.object({frameworks:o.array(oE.extend({skills:o.array(Ya).optional()})).min(1)}),VO=o.object({frameworkId:o.string(),profileId:o.string()}),NO=o.object({frameworkId:o.string()}),jO=$r.array(),DO=o.object({id:o.string()}),LO=o.object({slug:o.string().min(1),name:o.string().min(1)}),MO=o.object({frameworkId:o.string(),skill:Ya,parentId:o.string().nullable().optional()}),UO=o.object({frameworkId:o.string(),id:o.string(),statement:o.string().optional(),description:o.string().optional(),code:o.string().optional(),icon:o.string().optional(),type:o.string().optional(),status:ts.optional()}).refine(n=>n.statement!==void 0||n.description!==void 0||n.code!==void 0||n.icon!==void 0||n.type!==void 0||n.status!==void 0,{message:"At least one field must be provided to update a skill",path:["statement"]}),sE=o.enum(["recursive","reparent"]),BO=o.object({frameworkId:o.string(),id:o.string(),strategy:sE.optional().default("reparent")}),FO=o.object({frameworkId:o.string(),skills:o.array(Ya).min(1),parentId:o.string().nullable().optional()}),ZO=o.object({frameworkId:o.string(),skills:o.array(Ya).min(0)}),qO=o.object({created:o.number().int().min(0),updated:o.number().int().min(0),deleted:o.number().int().min(0),unchanged:o.number().int().min(0),total:o.number().int().min(0)}),$O=o.object({frameworkId:o.string(),skillId:o.string().optional(),recursive:o.boolean().optional().default(!1),onlyCountCompetencies:o.boolean().optional().default(!1)}),zO=o.object({count:o.number().int().min(0)}),WO=o.object({frameworkId:o.string()}),HO=o.object({skills:o.array(xd)}),GO=o.object({frameworkId:o.string(),skillId:o.string()}),JO=o.object({path:o.array(_h)}),QO=o.object({framework:wh,skills:aE});var Ah=ip(Th());var Ka={"SHA-1":{outputLength:20,blockSize:64},"SHA-256":{outputLength:32,blockSize:64},"SHA-384":{outputLength:48,blockSize:128},"SHA-512":{outputLength:64,blockSize:128}};function kh(n,r,c,d,p="SHA-256"){return new Promise((g,y)=>{p in Ka||y(new RangeError(`Valid hash algorithm values are any of ${Object.keys(Ka).toString()}`)),typeof n=="string"?n=new TextEncoder().encode(n):n instanceof ArrayBuffer?n=new Uint8Array(n):ArrayBuffer.isView(n)||y(RangeError("P should be string, ArrayBuffer, TypedArray, DataView")),typeof r=="string"?r=new TextEncoder().encode(r):r instanceof ArrayBuffer?r=new Uint8Array(r):ArrayBuffer.isView(r)?r=new Uint8Array(r.buffer,r.byteOffset,r.byteLength):y(RangeError("S should be string, ArrayBuffer, TypedArray, DataView")),crypto.subtle.importKey("raw",n,"PBKDF2",!1,["deriveBits"]).then(E=>{let T={name:"PBKDF2",hash:p,salt:r,iterations:c};crypto.subtle.deriveBits(T,E,8*d).then(V=>g(V),V=>{(async function(q,j,O,R,Z){if(!(Z in Ka))throw new RangeError(`Valid hash algorithm values are any of ${Object.keys(Ka).toString()}`);if(!Number.isInteger(O)||O<=0)throw new RangeError("c must be a positive integer");let A=Ka[Z].outputLength;if(!Number.isInteger(R)||R<=0||R>=(2**32-1)*A)throw new RangeError("dkLen must be a positive integer < (2 ** 32 - 1) * hLen");let X=Math.ceil(R/A),K=R-(X-1)*A,ne=new Array(X);q.byteLength===0&&(q=new Uint8Array(Ka[Z].blockSize));let ke=await crypto.subtle.importKey("raw",q,{name:"HMAC",hash:{name:Z}},!0,["sign"]),xe=l(async function(Be,zr){let z=await crypto.subtle.sign("HMAC",Be,zr);return new Uint8Array(z)},"g");for(let Be=0;Be<X;Be++)ne[Be]=await Ne(ke,j,O,Be+1);async function Ne(Be,zr,z,Qe){function re(Cr){let vn=new ArrayBuffer(4);return new DataView(vn).setUint32(0,Cr,!1),new Uint8Array(vn)}l(re,"i");let Qt=await xe(Be,Rh(zr,re(Qe))),qe=Qt;for(let Cr=1;Cr<z;Cr++)qe=await xe(Be,qe),yE(Qt,qe);return Qt}return l(Ne,"h"),ne[X-1]=ne[X-1].slice(0,K),Rh(...ne).buffer})(n,r,c,d,p).then(q=>g(q),q=>y(q))})},E=>y(E))})}l(kh,"t");function Rh(...n){let r=n.reduce((p,g)=>p+g.length,0);if(n.length===0)throw new RangeError("Cannot concat no arrays");let c=new Uint8Array(r),d=0;for(let p of n)c.set(p,d),d+=p.length;return c}l(Rh,"r");function yE(n,r){for(let c=0;c<n.length;c++)n[c]^=r[c]}l(yE,"n");var Xa=l(async(n,r)=>{let c=await n.invoke.hash?.(r,"PBKDF2-HMAC-SHA256");if(c)return c;let d=n.invoke.crypto(),p=new TextEncoder().encode(r),g=n.id.keypair("secp256k1").d,y=await kh(g,"salt",1e3,32),E=await d.subtle.importKey("raw",y,{name:"HMAC",hash:"SHA-256"},!1,["sign"]),T=await d.subtle.sign("HMAC",E,p);return Array.from(new Uint8Array(T)).map(q=>q.toString(16).padStart(2,"0")).join("")},"hash"),Jt=l(async(n,r,c)=>n.invoke.createDagJwe(c,[r]),"generateJWE"),Er=l(async(n,r)=>n.invoke.decryptDagJwe(r),"decryptJWE"),Xi=l(async(n,r,c=[])=>{let d=Object.entries(r);return(await Promise.all(d.map(async([p,g])=>c.includes(p)?"":await Xa(n,`${p}:${(0,Ah.default)(g)}`)))).filter(Boolean)},"generateEncryptedFieldsArray"),ea=l(async(n,r,c=[])=>{let d=await n.invoke.createDagJwe(r),p=await Xi(n,r,c);return{...Object.fromEntries(Object.entries(r).filter(([y])=>c.includes(y))),encryptedRecord:d,fields:p}},"generateEncryptedRecord");var Ed=l(async(n,r)=>Lp(n,async c=>{let d=await r.invoke.getDidAuthVp({proofFormat:"jwt",challenge:c});if(typeof d!="string")throw new Error("Error getting DID-Auth-JWT!");return d}),"getLearnCloudClient"),vE=l(async(n,r,c=[],d=[],p=!0)=>{let g=n;g.debug?.("Adding LearnCloud Plugin");let y=await Ed(r,g),E=[g.id.did()];y.user.getDids.query().then(O=>E=O);let T={},V=y.utilities.getDid.query(),q=l(async O=>(T[O]||(T[O]=await Ed(O,g)),T[O]),"getOtherClient"),j=l(async O=>{let R=g.id.did(),Z=O.id.did();if(R!==Z){if(!E.includes(Z)&&p){let A=await O.invoke.getDidAuthVp();await y.user.addDid.mutate({presentation:A}),Z.split(":")[1]==="web"&&await y.user.setPrimaryDid.mutate({presentation:A}),E=await y.user.getDids.query()}y=await Ed(r,O)}g=O},"updateLearnCard");return{name:"LearnCloud",displayName:"LearnCloud",description:"LearnCloud Integration",methods:{learnCloudCreate:async(O,R)=>{await j(O);let Z=await ea(O,R,d);return y.customStorage.create.mutate({item:await Jt(O,await V,Z)})},learnCloudCreateMany:async(O,R)=>{await j(O);let Z=await Promise.all(R.map(async A=>ea(O,A,d)));return y.customStorage.createMany.mutate({items:await Jt(O,await V,Z)})},learnCloudRead:async(O,R,Z)=>{await j(O);let A=[],X=await O.invoke.learnCloudReadPage(R,{},Z);for(A.push(...X.records);X.hasMore;)X=await O.invoke.learnCloudReadPage(R,{},Z),A.push(...X.records);return A},learnCloudReadPage:async(O,R,Z,A)=>{if(await j(O),!R){let xe=await y.customStorage.read.query({includeAssociatedDids:A,...Z}),Ne=zi(xe)?await Er(O,xe):xe;return{...Ne,records:await Promise.all(Ne.records.map(async Be=>({...await Er(O,Be.encryptedRecord),_id:Be._id})))}}let X=await Xi(O,R,[...d,"_id"]),K=Object.fromEntries(Object.entries(R).filter(([xe])=>[...d,"_id"].includes(xe))),ne=await y.customStorage.read.query({query:await Jt(O,await V,{...K,...X.length>0?{fields:{$in:X}}:{}}),...Z,includeAssociatedDids:A}),ke=zi(ne)?await Er(O,ne):ne;return{...ke,records:await Promise.all(ke.records.map(async xe=>({...await Er(O,xe.encryptedRecord),_id:xe._id})))}},learnCloudCount:async(O,R,Z)=>{if(await j(O),!R)return y.customStorage.count.query({includeAssociatedDids:Z});let A=await Xi(O,R,[...d,"_id"]),X=Object.fromEntries(Object.entries(R).filter(([K])=>[...d,"_id"].includes(K)));return y.customStorage.count.query({query:await Jt(O,await V,{...X,...A.length>0?{fields:{$in:A}}:{}}),includeAssociatedDids:Z})},learnCloudUpdate:async(O,R,Z)=>{await j(O);let A=await O.invoke.learnCloudRead(R);return(await Promise.all(A.map(async K=>y.customStorage.update.mutate({query:await Jt(O,await V,{_id:K._id}),update:await Jt(O,await V,await ea(O,{...K,...Z},d))})))).reduce((K,ne)=>ne+K,0)},learnCloudDelete:async(O,R,Z)=>{if(await j(O),!R)return y.customStorage.delete.mutate({includeAssociatedDids:Z});let A=await Xi(O,R,[...d,"_id"]),X=Object.fromEntries(Object.entries(R).filter(([K])=>[...d,"_id"].includes(K)));return y.customStorage.delete.mutate({query:await Jt(O,await V,{...X,...A.length>0?{fields:{$in:A}}:{}}),includeAssociatedDids:Z})},learnCloudBatchResolve:async(O,R)=>{let Z=await y.storage.batchResolve.query({uris:R});return Promise.all(Z.map(async A=>{if(!A)return null;try{let X=await O.invoke.decryptDagJwe(A);return await di.or(Qa).parseAsync(X)}catch(X){return O.debug?.(X),null}}))}},read:{get:async(O,R)=>{if(g.debug?.("LearnCloud read.get",R),!R)return;let Z=R.split(":");if(g.debug?.("LearnCloud read.get parts:",Z),Z.length!==5)return;let[A,X,K]=Z;if(A!=="lc"||X!=="cloud"){g.debug?.("LearnCloud read.get not cloud URI!",{lc:A,method:X});return}if(K.replace(/https?:\/\//g,"")!==r.replace(/https?:\/\//g,"").replace(/:/g,"%3A")){let ne=(K.startsWith("http")?K:`http${K.includes("http")||K.includes("localhost")?"":"s"}://${K}`).replaceAll("%3A",":");g.debug?.("LearnCloud read.get different LearnCloud!",{uriUrl:K,url:r,fullUrl:ne,comparison:{a:K.replace(/https?:\/\//g,""),b:r.replace(/https?:\/\//g,"").replace(/:/g,"%3A")}});let ke=await q(ne);try{let xe=await ke.storage.resolve.query({uri:R});g.debug?.("LearnCloud read.get result",xe);let Ne=await O.invoke.decryptDagJwe(xe);return g.debug?.("LearnCloud read.get decryptedResult",Ne),await di.or(Qa).parseAsync(Ne)}catch(xe){O.debug?.(xe);return}}try{let ne=await y.storage.resolve.query({uri:R});g.debug?.("LearnCloud read.get result",ne);let ke=await O.invoke.decryptDagJwe(ne);return g.debug?.("LearnCloud read.get decryptedResult",ke),await di.or(Qa).parseAsync(ke)}catch(ne){O.debug?.(ne);return}}},store:{upload:async(O,R)=>(O.debug?.("learnCard.store['LearnCard Network'].upload"),y.storage.store.mutate({item:R})),uploadEncrypted:async(O,R,{recipients:Z=[]}={recipients:[]})=>{O.debug?.("learnCard.store['LearnCard Network'].upload");let A=await O.invoke.createDagJwe(R,[O.id.did(),...Z]);return y.storage.store.mutate({item:A})}},index:{get:async(O,R)=>{await j(O);let Z=[],A=await O.index.LearnCloud.getPage(R);for(Z.push(...A.records);A.hasMore;)A=await O.index.LearnCloud.getPage(R,{cursor:A.cursor}),Z.push(...A.records);return Z},getPage:async(O,R,Z)=>{await j(O),O.debug?.("LearnCloud index.getPaginated",R,Z);let A={...Z,sort:["newestFirst","oldestFirst"].includes(Z?.sort??"")?Z?.sort:void 0};if(!R){O.debug?.("LearnCloud index.get (no query)");let xe=await y.index.get.query(A);O.debug?.("LearnCloud index.get (no query response)",xe);let Ne=zi(xe)?await Er(O,xe):xe;return O.debug?.("LearnCloud index.get (no query encryptedRecords)",Ne),{...Ne,records:await Promise.all(Ne.records.map(async Be=>Er(O,Be.encryptedRecord)))}}O.debug?.("LearnCloud index.get (query)");let X=await Xi(O,R,c);O.debug?.("LearnCloud index.get (query fields)",X);let K=Object.fromEntries(Object.entries(R).filter(([xe])=>c.includes(xe)));O.debug?.("LearnCloud index.get (query unencryptedEntries)",K);let ne=await y.index.get.query({query:await Jt(O,await V,{...K,...X.length>0?{fields:{$in:X}}:{}}),...A});O.debug?.("LearnCloud index.get (query jwe)",ne);let ke=zi(ne)?await Er(O,ne):ne;return O.debug?.("LearnCloud index.get (query encryptedRecords)",ke),{...ke,records:await Promise.all(ke.records.map(async xe=>Er(O,xe.encryptedRecord)))}},getCount:async(O,R)=>{if(await j(O),!R){O.debug?.("LearnCloud index.count (no query)");let ne=await y.index.count.query();O.debug?.("LearnCloud index.count (no query response)",ne);let ke=zi(ne)?await Er(O,ne):ne;return O.debug?.("LearnCloud index.count (no query count)",ke),ke}O.debug?.("LearnCloud index.getCount (query)");let Z=await Xi(O,R,c);O.debug?.("LearnCloud index.getCount (query fields)",Z);let A=Object.fromEntries(Object.entries(R).filter(([ne])=>c.includes(ne)));O.debug?.("LearnCloud index.getCount (query unencryptedEntries)",A);let X=await y.index.count.query({query:await Jt(O,await V,{...A,...Z.length>0?{fields:{$in:Z}}:{}})});O.debug?.("LearnCloud index.count (query response)",X);let K=zi(X)?await Er(O,X):X;return O.debug?.("LearnCloud index.count (query count)",K),K},add:async(O,R)=>{await j(O);let Z=R.id||O.invoke.crypto().randomUUID();return y.index.add.mutate({record:await Jt(O,await V,{...await ea(O,{...R,id:Z},c),id:await Xa(O,Z)})})},addMany:async(O,R)=>(await j(O),(await Promise.all((0,Oh.chunk)(R,25).map(async A=>{let X=await Promise.all(A.map(async K=>{let ne=K.id||O.invoke.crypto().randomUUID();return{...await ea(O,{...K,id:ne},c),id:await Xa(O,ne)}}));return y.index.addMany.mutate({records:await Jt(O,await V,X)})}))).every(Boolean)),update:async(O,R,Z)=>{await j(O);let A=await O.index.LearnCloud.get({id:R});if(A.length!==1)return!1;let K={...A[0],...Z};return y.index.update.mutate({id:await Xa(O,R),updates:await Jt(O,await V,await ea(O,K,c))})},remove:async(O,R)=>(await j(O),y.index.remove.mutate({id:await Xa(O,R)})),removeAll:async O=>(await j(O),y.index.removeAll.mutate())}}},"getLearnCloudPlugin");
|
|
24
|
+
`.trim();async function _p(n,r,c){try{let d=r.middlewares[n];return await d({...c,meta:r.meta,input:c.input,next(g){let y=g;return _p(n+1,r,{...c,ctx:y?.ctx?{...c.ctx,...y.ctx}:c.ctx,input:y&&"input"in y?y.input:c.input,getRawInput:y?.getRawInput??c.getRawInput})}})}catch(d){return{ok:!1,error:pn(d),marker:jl}}}l(_p,"callRecursive");function S_(n){async function r(c){if(!c||!("getRawInput"in c))throw new Error(C_);let d=await _p(0,n,c);if(!d)throw new at({code:"INTERNAL_SERVER_ERROR",message:"No result from middlewares - did you forget to `return next()`?"});if(!d.ok)throw d.error;return d.data}return l(r,"procedure"),r._def=n,r.procedure=!0,r.meta=n.meta,r}l(S_,"createProcedureCaller");var Ml=typeof window>"u"||"Deno"in window||globalThis.process?.env?.NODE_ENV==="test"||!!globalThis.process?.env?.JEST_WORKER_ID||!!globalThis.process?.env?.VITEST_WORKER_ID;var Zi=class{context(){return new Zi}meta(){return new Zi}create(r){let c={...r,transformer:Zu(r?.transformer??Gn),isDev:r?.isDev??globalThis.process?.env.NODE_ENV!=="production",allowOutsideOfServer:r?.allowOutsideOfServer??!1,errorFormatter:r?.errorFormatter??Wn,isServer:r?.isServer??Ml,$types:null};if(!(r?.isServer??Ml)&&r?.allowOutsideOfServer!==!0)throw new Error("You're trying to use @trpc/server in a non-server environment. This is not supported by default.");return{_config:c,procedure:Ll({meta:r?.defaultMeta}),middleware:Ku(),router:Pl(c),mergeRouters:$u,createCallerFactory:Vl()}}};l(Zi,"TRPCBuilder");var wp=new Zi;function Ul(n,r,c){return r in n?Object.defineProperty(n,r,{value:c,enumerable:!0,configurable:!0,writable:!0}):n[r]=c,n}l(Ul,"_define_property");function rd(n){return n instanceof Ye}l(rd,"isTRPCClientError");function V_(n){return Ze(n)&&Ze(n.error)&&typeof n.error.code=="number"&&typeof n.error.message=="string"}l(V_,"isTRPCErrorResponse");function N_(n,r){return typeof n=="string"?n:Ze(n)&&typeof n.message=="string"?n.message:r}l(N_,"getMessageFromUnknownError");var Ye=class extends Error{static from(r,c={}){let d=r;return rd(d)?(c.meta&&(d.meta={...d.meta,...c.meta}),d):V_(d)?new Ye(d.error.message,{...c,result:d}):new Ye(N_(d,"Unknown error"),{...c,cause:d})}constructor(r,c){let d=c?.cause;super(r,{cause:d}),Ul(this,"cause",void 0),Ul(this,"shape",void 0),Ul(this,"data",void 0),Ul(this,"meta",void 0),this.meta=c?.meta,this.cause=d,this.shape=c?.result?.error,this.data=c?.result?.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,Ye.prototype)}};l(Ye,"TRPCClientError");function nd(n,r,c){return r in n?Object.defineProperty(n,r,{value:c,enumerable:!0,configurable:!0,writable:!0}):n[r]=c,n}l(nd,"_define_property");var qi=class{$request(r){return Bu({links:this.links,op:{...r,context:r.context??{},id:++this.requestId}}).pipe(Uu())}async requestAsPromise(r){try{let c=this.$request(r);return(await Mu(c)).result.data}catch(c){throw Ye.from(c)}}query(r,c,d){return this.requestAsPromise({type:"query",path:r,input:c,context:d?.context,signal:d?.signal})}mutation(r,c,d){return this.requestAsPromise({type:"mutation",path:r,input:c,context:d?.context,signal:d?.signal})}subscription(r,c,d){return this.$request({type:"subscription",path:r,input:c,context:d.context,signal:d.signal}).subscribe({next(g){switch(g.result.type){case"state":{d.onConnectionStateChange?.(g.result);break}case"started":{d.onStarted?.({context:g.context});break}case"stopped":{d.onStopped?.();break}case"data":case void 0:{d.onData?.(g.result.data);break}}},error(g){d.onError?.(g)},complete(){d.onComplete?.()}})}constructor(r){nd(this,"links",void 0),nd(this,"runtime",void 0),nd(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=r.links.map(c=>c(this.runtime))}};l(qi,"TRPCUntypedClient");var j_=Symbol.for("trpc_untypedClient"),D_={query:"query",mutate:"mutation",subscribe:"subscription"},Sp=l(n=>D_[n],"clientCallTypeToProcedureType");function Tp(n){let r=Ba(({path:c,args:d})=>{let p=[...c],g=Sp(p.pop()),y=p.join(".");return n[g](y,...d)});return Al(c=>c===j_?n:r[c])}l(Tp,"createTRPCClientProxy");function Wo(n){let r=new qi(n);return Tp(r)}l(Wo,"createTRPCClient");var Rp=l(n=>typeof n=="function","isFunction");function id(n){if(n)return n;if(typeof window<"u"&&Rp(window.fetch))return window.fetch;if(typeof globalThis<"u"&&Rp(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}l(id,"getFetch");var kp=l(()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")},"throwFatalError");function Bl(n){let r=null,c=null,d=l(()=>{clearTimeout(c),c=null,r=null},"destroyTimerAndPendingItems");function p(E){let T=[[]],V=0;for(;;){let q=E[V];if(!q)break;let j=T[T.length-1];if(q.aborted){q.reject?.(new Error("Aborted")),V++;continue}if(n.validate(j.concat(q).map(R=>R.key))){j.push(q),V++;continue}if(j.length===0){q.reject?.(new Error("Input is too big for a single dispatch")),V++;continue}T.push([])}return T}l(p,"groupItems");function g(){let E=p(r);d();for(let T of E){if(!T.length)continue;let V={items:T};for(let j of T)j.batch=V;n.fetch(V.items.map(j=>j.key)).then(async j=>{await Promise.all(j.map(async(O,R)=>{let Z=V.items[R];try{let A=await Promise.resolve(O);Z.resolve?.(A)}catch(A){Z.reject?.(A)}Z.batch=null,Z.reject=null,Z.resolve=null}));for(let O of V.items)O.reject?.(new Error("Missing result")),O.batch=null}).catch(j=>{for(let O of V.items)O.reject?.(j),O.batch=null})}}l(g,"dispatch");function y(E){let T={aborted:!1,key:E,batch:null,resolve:kp,reject:kp},V=new Promise((q,j)=>{T.reject=j,T.resolve=q,r??(r=[]),r.push(T)});return c??(c=setTimeout(g)),V}return l(y,"load"),{load:y}}l(Bl,"dataLoader");function ad(...n){let r=new AbortController,c=n.length,d=0,p=l(()=>{++d===c&&r.abort()},"onAbort");for(let g of n)g?.aborted?p():g?.addEventListener("abort",p,{once:!0});return r.signal}l(ad,"allAbortSignals");function Ho(n){let r=n;return r?"input"in r?r:{input:r,output:r}:{input:{serialize:c=>c,deserialize:c=>c},output:{serialize:c=>c,deserialize:c=>c}}}l(Ho,"getTransformer");function Zl(n){return{url:n.url.toString(),fetch:n.fetch,transformer:Ho(n.transformer),methodOverride:n.methodOverride}}l(Zl,"resolveHTTPLinkOptions");function L_(n){let r={};for(let c=0;c<n.length;c++){let d=n[c];r[c]=d}return r}l(L_,"arrayToDict");var M_={query:"GET",mutation:"POST",subscription:"PATCH"};function Ap(n){return"input"in n?n.transformer.input.serialize(n.input):L_(n.inputs.map(r=>n.transformer.input.serialize(r)))}l(Ap,"getInput");var qa=l(n=>{let r=n.url.split("?"),d=r[0].replace(/\/$/,"")+"/"+n.path,p=[];if(r[1]&&p.push(r[1]),"inputs"in n&&p.push("batch=1"),n.type==="query"||n.type==="subscription"){let g=Ap(n);g!==void 0&&n.methodOverride!=="POST"&&p.push(`input=${encodeURIComponent(JSON.stringify(g))}`)}return p.length&&(d+="?"+p.join("&")),d},"getUrl"),Op=l(n=>{if(n.type==="query"&&n.methodOverride!=="POST")return;let r=Ap(n);return r!==void 0?JSON.stringify(r):void 0},"getBody"),od=l(n=>Pp({...n,contentTypeHeader:"application/json",getUrl:qa,getBody:Op}),"jsonHttpRequester"),Fl=class extends Error{constructor(){let r="AbortError";super(r),this.name=r,this.message=r}};l(Fl,"AbortError");var U_=l(n=>{if(!!n?.aborted)throw n.throwIfAborted?.(),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new Fl},"throwIfAborted");async function Ip(n){U_(n.signal);let r=n.getUrl(n),c=n.getBody(n),{type:d}=n,p=await(async()=>{let y=await n.headers();return Symbol.iterator in y?Object.fromEntries(y):y})(),g={...n.contentTypeHeader?{"content-type":n.contentTypeHeader}:{},...n.trpcAcceptHeader?{"trpc-accept":n.trpcAcceptHeader}:void 0,...p};return id(n.fetch)(r,{method:n.methodOverride??M_[d],signal:n.signal,body:c,headers:g})}l(Ip,"fetchHTTPResponse");async function Pp(n){let r={},c=await Ip(n);r.response=c;let d=await c.json();return r.responseJSON=d,{json:d,meta:r}}l(Pp,"httpRequest");function ql(n){let r=Zl(n),c=n.maxURLLength??1/0,d=n.maxItems??1/0;return()=>{let p=l(T=>({validate(V){if(c===1/0&&d===1/0)return!0;if(V.length>d)return!1;let q=V.map(R=>R.path).join(","),j=V.map(R=>R.input);return qa({...r,type:T,path:q,inputs:j,signal:null}).length<=c},async fetch(V){let q=V.map(X=>X.path).join(","),j=V.map(X=>X.input),O=ad(...V.map(X=>X.signal)),R=await od({...r,path:q,inputs:j,type:T,headers(){return n.headers?typeof n.headers=="function"?n.headers({opList:V}):n.headers:{}},signal:O});return(Array.isArray(R.json)?R.json:V.map(()=>R.json)).map(X=>({meta:R.meta,json:X}))}}),"batchLoader"),g=Bl(p("query")),y=Bl(p("mutation")),E={query:g,mutation:y};return({op:T})=>rt(V=>{if(T.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");let j=E[T.type].load(T),O;return j.then(R=>{O=R;let Z=zo(R.json,r.transformer.output);if(!Z.ok){V.error(Ye.from(Z.error,{meta:R.meta}));return}V.next({context:R.meta,result:Z.result}),V.complete()}).catch(R=>{V.error(Ye.from(R,{meta:O?.meta}))}),()=>{}})}}l(ql,"httpBatchLink");var $l=l((n,...r)=>typeof n=="function"?n(...r):n,"resultOf");function sd(){let n,r;return{promise:new Promise((d,p)=>{n=d,r=p}),resolve:n,reject:r}}l(sd,"withResolvers");async function Np(n){let r=await $l(n.url);if(!n.connectionParams)return r;let d=`${r.includes("?")?"&":"?"}connectionParams=1`;return r+d}l(Np,"prepareUrl");async function jp(n){let r={method:"connectionParams",data:await $l(n)};return JSON.stringify(r)}l(jp,"buildConnectionMessage");function $i(n,r,c){return r in n?Object.defineProperty(n,r,{value:c,enumerable:!0,configurable:!0,writable:!0}):n[r]=c,n}l($i,"_define_property");function Z_(n){let{promise:r,resolve:c,reject:d}=sd();return n.addEventListener("open",()=>{n.removeEventListener("error",d),c()}),n.addEventListener("error",d),r}l(Z_,"asyncWsOpen");function q_(n,{intervalMs:r,pongTimeoutMs:c}){let d,p;function g(){d=setTimeout(()=>{n.send("PING"),p=setTimeout(()=>{n.close()},c)},r)}l(g,"start");function y(){clearTimeout(d),g()}l(y,"reset");function E(){clearTimeout(p),y()}l(E,"pong"),n.addEventListener("open",g),n.addEventListener("message",({data:T})=>{clearTimeout(d),g(),T==="PONG"&&E()}),n.addEventListener("close",()=>{clearTimeout(d),clearTimeout(p)})}l(q_,"setupPingInterval");var Qn=class{get ws(){return this.wsObservable.get()}set ws(r){this.wsObservable.next(r)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){if(this.openPromise)return this.openPromise;this.id=++Qn.connectCount;let r=Np(this.urlOptions).then(c=>new this.WebSocketPonyfill(c));this.openPromise=r.then(async c=>{this.ws=c,c.addEventListener("message",function({data:d}){d==="PING"&&this.send("PONG")}),this.keepAliveOpts.enabled&&q_(c,this.keepAliveOpts),c.addEventListener("close",()=>{this.ws===c&&(this.ws=null)}),await Z_(c),this.urlOptions.connectionParams&&c.send(await jp(this.urlOptions.connectionParams))});try{await this.openPromise}finally{this.openPromise=null}}async close(){try{await this.openPromise}finally{this.ws?.close()}}constructor(r){if($i(this,"id",++Qn.connectCount),$i(this,"WebSocketPonyfill",void 0),$i(this,"urlOptions",void 0),$i(this,"keepAliveOpts",void 0),$i(this,"wsObservable",Ua(null)),$i(this,"openPromise",null),this.WebSocketPonyfill=r.WebSocketPonyfill??WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=r.urlOptions,this.keepAliveOpts=r.keepAlive}};l(Qn,"WsConnection");$i(Qn,"connectCount",0);function z_(n){return n}l(z_,"identity");function W_(n){return n.length===0?z_:n.length===1?n[0]:l(function(c){return n.reduce((d,p)=>p(d),c)},"piped")}l(W_,"pipeFromArray");function ld(n){let r={subscribe(c){let d=null,p=!1,g=!1,y=!1;function E(){if(d===null){y=!0;return}g||(g=!0,typeof d=="function"?d():d&&d.unsubscribe())}return l(E,"unsubscribe"),d=n({next(T){p||c.next?.(T)},error(T){p||(p=!0,c.error?.(T),E())},complete(){p||(p=!0,c.complete?.(),E())}}),y&&E(),{unsubscribe:E}},pipe(...c){return W_(c)(r)}};return r}l(ld,"observable");var H_=Object.defineProperty,zl=l((n,r)=>H_(n,"name",{value:r,configurable:!0}),"__name"),G_=zl(n=>()=>({next:r,op:c})=>ld(d=>{let p=null,g=0,y=!1,E=zl(()=>{g+=1,p?.unsubscribe(),p=r(c).subscribe({error:async T=>{if(g>5||T.data?.httpStatus!==401)return d.error(T);await n(),E()},next:T=>d.next(T),complete:()=>{y&&d.complete()}})},"attempt");return E(),()=>{y=!0,p?.unsubscribe()}}),"callbackLink"),Lp=zl(async(n,r)=>{let c=[],d=Wo({links:[ql({methodOverride:"POST",url:n,maxURLLength:3072,maxItems:50,headers:{Authorization:`Bearer ${await r()}`}})]}),p=zl(async(y=95+Math.round((Math.random()-.5)*5))=>d.utilities.getChallenges.query({amount:y}),"getChallenges");return p().then(y=>c=y),Wo({links:[G_(async()=>{c=await p()}),ql({methodOverride:"POST",url:n,maxItems:50,maxURLLength:3072,headers:async()=>(c.length===0&&c.push(...await p()),{Authorization:`Bearer ${await r(c.pop())}`})})]})},"getClient");var J_=Object.create,cd=Object.defineProperty,Q_=Object.getOwnPropertyDescriptor,Mp=Object.getOwnPropertyNames,Y_=Object.getPrototypeOf,K_=Object.prototype.hasOwnProperty,Y=l((n,r)=>cd(n,"name",{value:r,configurable:!0}),"__name"),Up=l((n,r)=>l(function(){return r||(0,n[Mp(n)[0]])((r={exports:{}}).exports,r),r.exports},"__require"),"__commonJS"),X_=l((n,r,c,d)=>{if(r&&typeof r=="object"||typeof r=="function")for(let p of Mp(r))!K_.call(n,p)&&p!==c&&cd(n,p,{get:()=>r[p],enumerable:!(d=Q_(r,p))||d.enumerable});return n},"__copyProps"),ew=l((n,r,c)=>(c=n!=null?J_(Y_(n)):{},X_(r||!n||!n.__esModule?cd(c,"default",{value:n,enumerable:!0}):c,n)),"__toESM"),tw=Up({"../learn-card-types/dist/types.cjs.development.js"(n,r){"use strict";var c=Object.defineProperty,d=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,y=Y((i,f)=>c(i,"name",{value:f,configurable:!0}),"__name"),E=Y((i,f)=>{for(var m in f)c(i,m,{get:f[m],enumerable:!0})},"__export"),T=Y((i,f,m,w)=>{if(f&&typeof f=="object"||typeof f=="function")for(let _ of p(f))!g.call(i,_)&&_!==m&&c(i,_,{get:()=>f[_],enumerable:!(w=d(f,_))||w.enumerable});return i},"__copyProps"),V=Y(i=>T(c({},"__esModule",{value:!0}),i),"__toCommonJS"),q={};E(q,{AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX:()=>Vi,AchievementCredentialValidator:()=>gc,AchievementCriteriaValidator:()=>mc,AchievementSubjectValidator:()=>ya,AchievementTypeValidator:()=>go,AchievementValidator:()=>ga,AddTagInputValidator:()=>mr,AddressValidator:()=>je,AlignmentTargetTypeValidator:()=>Rs,AlignmentValidator:()=>Xe,AuthGrantQueryValidator:()=>Ks,AuthGrantStatusValidator:()=>Ys,AuthGrantValidator:()=>Ta,AutoBoostConfigValidator:()=>Ve,BoostPermissionsQueryValidator:()=>Ms,BoostPermissionsValidator:()=>Pn,BoostQueryValidator:()=>wc,BoostRecipientValidator:()=>pr,BoostRecipientWithChildrenValidator:()=>D,BoostValidator:()=>Fs,ClaimHookQueryValidator:()=>Vn,ClaimHookTypeValidator:()=>ba,ClaimHookValidator:()=>Us,ClaimInboxCredentialValidator:()=>kc,ClaimTokenValidator:()=>nl,ConsentFlowContractDataForDidValidator:()=>Ii,ConsentFlowContractDataValidator:()=>$s,ConsentFlowContractDetailsValidator:()=>lt,ConsentFlowContractQueryValidator:()=>Ca,ConsentFlowContractValidator:()=>qs,ConsentFlowDataForDidQueryValidator:()=>Cc,ConsentFlowDataQueryValidator:()=>Ec,ConsentFlowTermValidator:()=>Ae,ConsentFlowTermsQueryValidator:()=>Ws,ConsentFlowTermsStatusValidator:()=>wa,ConsentFlowTermsValidator:()=>To,ConsentFlowTransactionActionValidator:()=>nn,ConsentFlowTransactionValidator:()=>jn,ConsentFlowTransactionsQueryValidator:()=>Nr,ContactMethodCreateValidator:()=>et,ContactMethodQueryValidator:()=>Oo,ContactMethodValidator:()=>Tc,ContactMethodVerificationRequestValidator:()=>el,ContactMethodVerificationValidator:()=>tl,ContextValidator:()=>Si,ContractCredentialValidator:()=>Ro,CountSkillsInputValidator:()=>$c,CountSkillsResultValidator:()=>Ft,CreateContactMethodSessionResponseValidator:()=>Ni,CreateContactMethodSessionValidator:()=>Io,CreateManagedFrameworkBatchInputValidator:()=>Nc,CreateManagedFrameworkInputValidator:()=>al,CreateSkillInputValidator:()=>Uc,CreateSkillsBatchInputValidator:()=>Zc,CredentialInfoValidator:()=>Ns,CredentialRecordValidator:()=>yc,CredentialSchemaValidator:()=>so,CredentialStatusValidator:()=>Ri,CredentialSubjectValidator:()=>fa,CriteriaValidator:()=>dr,DeleteFrameworkInputValidator:()=>hr,DeleteSkillInputValidator:()=>Fc,DidDocumentValidator:()=>pt,EncryptedCredentialRecordValidator:()=>st,EncryptedRecordValidator:()=>_o,EndorsementCredentialValidator:()=>ha,EndorsementSubjectValidator:()=>Ai,EvidenceValidator:()=>Oi,FlatAuthGrantValidator:()=>Ao,FrameworkWithSkillsValidator:()=>Jc,FullClaimHookValidator:()=>xt,GeoCoordinatesValidator:()=>Ss,GetFullSkillTreeInputValidator:()=>zc,GetFullSkillTreeResultValidator:()=>Wc,GetSkillPathInputValidator:()=>Hc,GetSkillPathResultValidator:()=>Gc,IdentifierEntryValidator:()=>oo,IdentifierTypeValidator:()=>Pe,IdentityObjectValidator:()=>Os,ImageValidator:()=>Ti,InboxCredentialQueryValidator:()=>ji,InboxCredentialValidator:()=>Ra,IssueInboxCredentialResponseValidator:()=>Un,IssueInboxCredentialValidator:()=>ka,IssueInboxSigningAuthorityValidator:()=>Mn,JWERecipientHeaderValidator:()=>fo,JWERecipientValidator:()=>po,JWEValidator:()=>ho,JWKValidator:()=>nt,JWKWithPrivateKeyValidator:()=>Ts,KnownAchievementTypeValidator:()=>ks,LCNBoostClaimLinkOptionsValidator:()=>pe,LCNBoostClaimLinkSigningAuthorityValidator:()=>G,LCNBoostStatus:()=>_a,LCNDomainOrOriginValidator:()=>Aa,LCNInboxContactMethodValidator:()=>jr,LCNInboxStatusEnumValidator:()=>Dr,LCNIntegrationCreateValidator:()=>Ac,LCNIntegrationQueryValidator:()=>Oa,LCNIntegrationUpdateValidator:()=>Oc,LCNIntegrationValidator:()=>rl,LCNNotificationDataValidator:()=>Qs,LCNNotificationInboxValidator:()=>Js,LCNNotificationMessageValidator:()=>Dn,LCNNotificationTypeEnumValidator:()=>ko,LCNNotificationValidator:()=>Sc,LCNProfileConnectionStatusEnum:()=>In,LCNProfileDisplayValidator:()=>Ds,LCNProfileManagerQueryValidator:()=>So,LCNProfileManagerValidator:()=>Co,LCNProfileQueryValidator:()=>vc,LCNProfileValidator:()=>Ut,LCNSigningAuthorityForUserValidator:()=>He,LCNSigningAuthorityValidator:()=>Te,LinkProviderFrameworkInputValidator:()=>Pc,PaginatedBoostRecipientsValidator:()=>S,PaginatedBoostRecipientsWithChildrenValidator:()=>N,PaginatedBoostsValidator:()=>xc,PaginatedClaimHooksValidator:()=>Bs,PaginatedConsentFlowContractsValidator:()=>xa,PaginatedConsentFlowDataForDidValidator:()=>Ea,PaginatedConsentFlowDataValidator:()=>Nn,PaginatedConsentFlowTermsValidator:()=>zs,PaginatedConsentFlowTransactionsValidator:()=>Hs,PaginatedContractCredentialsValidator:()=>Sa,PaginatedEncryptedCredentialRecordsValidator:()=>wo,PaginatedEncryptedRecordsValidator:()=>js,PaginatedInboxCredentialsValidator:()=>Ln,PaginatedLCNIntegrationsValidator:()=>Di,PaginatedLCNProfileManagersValidator:()=>_c,PaginatedLCNProfilesAndManagersValidator:()=>Ls,PaginatedLCNProfilesValidator:()=>bc,PaginatedSkillFrameworksValidator:()=>Ic,PaginatedSkillTreeValidator:()=>il,PaginationOptionsValidator:()=>bo,PaginationResponseValidator:()=>$e,ProfileValidator:()=>An,ProofValidator:()=>ft,RefreshServiceValidator:()=>lo,RegExpValidator:()=>xo,RelatedValidator:()=>De,ReplaceSkillFrameworkSkillsInputValidator:()=>on,ReplaceSkillFrameworkSkillsResultValidator:()=>qc,ResultDescriptionValidator:()=>As,ResultStatusTypeValidator:()=>Is,ResultTypeValidator:()=>fr,ResultValidator:()=>Ps,RubricCriterionValidator:()=>ma,SentCredentialInfoValidator:()=>Vr,ServiceValidator:()=>mo,SetPrimaryContactMethodValidator:()=>Rc,SkillDeletionStrategyValidator:()=>ol,SkillFrameworkAdminInputValidator:()=>jc,SkillFrameworkAdminsValidator:()=>Lc,SkillFrameworkIdInputValidator:()=>Dc,SkillFrameworkQueryValidator:()=>Gs,SkillFrameworkStatusEnum:()=>Ia,SkillFrameworkValidator:()=>Po,SkillQueryValidator:()=>Ee,SkillStatusEnum:()=>Bt,SkillTreeNodeInputValidator:()=>an,SkillTreeNodeValidator:()=>Xt,SkillValidator:()=>Bn,StringQuery:()=>fe,SyncFrameworkInputValidator:()=>Mc,TagValidator:()=>v,TermsOfUseValidator:()=>pa,UnsignedAchievementCredentialValidator:()=>rn,UnsignedVCValidator:()=>Me,UnsignedVPValidator:()=>uo,UpdateFrameworkInputValidator:()=>Vc,UpdateSkillInputValidator:()=>Bc,VC2EvidenceValidator:()=>co,VCValidator:()=>Mt,VPValidator:()=>ki,VerificationCheckValidator:()=>Vs,VerificationItemValidator:()=>vo,VerificationMethodValidator:()=>ur,VerificationStatusEnum:()=>yo,VerificationStatusValidator:()=>va}),r.exports=V(q);var j;(function(i){i.assertEqual=_=>_;function f(_){}l(f,"assertIs"),Y(f,"assertIs"),y(f,"assertIs"),i.assertIs=f;function m(_){throw new Error}l(m,"assertNever"),Y(m,"assertNever"),y(m,"assertNever"),i.assertNever=m,i.arrayToEnum=_=>{let P={};for(let I of _)P[I]=I;return P},i.getValidEnumValues=_=>{let P=i.objectKeys(_).filter(F=>typeof _[_[F]]!="number"),I={};for(let F of P)I[F]=_[F];return i.objectValues(I)},i.objectValues=_=>i.objectKeys(_).map(function(P){return _[P]}),i.objectKeys=typeof Object.keys=="function"?_=>Object.keys(_):_=>{let P=[];for(let I in _)Object.prototype.hasOwnProperty.call(_,I)&&P.push(I);return P},i.find=(_,P)=>{for(let I of _)if(P(I))return I},i.isInteger=typeof Number.isInteger=="function"?_=>Number.isInteger(_):_=>typeof _=="number"&&isFinite(_)&&Math.floor(_)===_;function w(_,P=" | "){return _.map(I=>typeof I=="string"?`'${I}'`:I).join(P)}l(w,"joinValues"),Y(w,"joinValues"),y(w,"joinValues"),i.joinValues=w,i.jsonStringifyReplacer=(_,P)=>typeof P=="bigint"?P.toString():P})(j||(j={}));var O;(function(i){i.mergeShapes=(f,m)=>({...f,...m})})(O||(O={}));var R=j.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Z=y(i=>{switch(typeof i){case"undefined":return R.undefined;case"string":return R.string;case"number":return isNaN(i)?R.nan:R.number;case"boolean":return R.boolean;case"function":return R.function;case"bigint":return R.bigint;case"symbol":return R.symbol;case"object":return Array.isArray(i)?R.array:i===null?R.null:i.then&&typeof i.then=="function"&&i.catch&&typeof i.catch=="function"?R.promise:typeof Map<"u"&&i instanceof Map?R.map:typeof Set<"u"&&i instanceof Set?R.set:typeof Date<"u"&&i instanceof Date?R.date:R.object;default:return R.unknown}},"getParsedType"),A=j.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),X=y(i=>JSON.stringify(i,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),K=Y(class extends Error{constructor(i){super(),this.issues=[],this.addIssue=m=>{this.issues=[...this.issues,m]},this.addIssues=(m=[])=>{this.issues=[...this.issues,...m]};let f=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,f):this.__proto__=f,this.name="ZodError",this.issues=i}get errors(){return this.issues}format(i){let f=i||function(_){return _.message},m={_errors:[]},w=y(_=>{for(let P of _.issues)if(P.code==="invalid_union")P.unionErrors.map(w);else if(P.code==="invalid_return_type")w(P.returnTypeError);else if(P.code==="invalid_arguments")w(P.argumentsError);else if(P.path.length===0)m._errors.push(f(P));else{let I=m,F=0;for(;F<P.path.length;){let U=P.path[F];F===P.path.length-1?(I[U]=I[U]||{_errors:[]},I[U]._errors.push(f(P))):I[U]=I[U]||{_errors:[]},I=I[U],F++}}},"processError");return w(this),m}static assert(i){if(!(i instanceof K))throw new Error(`Not a ZodError: ${i}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,j.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(i=f=>f.message){let f={},m=[];for(let w of this.issues)w.path.length>0?(f[w.path[0]]=f[w.path[0]]||[],f[w.path[0]].push(i(w))):m.push(i(w));return{formErrors:m,fieldErrors:f}}get formErrors(){return this.flatten()}},"ZodError");y(K,"ZodError"),K.create=i=>new K(i);var ne=y((i,f)=>{let m;switch(i.code){case A.invalid_type:i.received===R.undefined?m="Required":m=`Expected ${i.expected}, received ${i.received}`;break;case A.invalid_literal:m=`Invalid literal value, expected ${JSON.stringify(i.expected,j.jsonStringifyReplacer)}`;break;case A.unrecognized_keys:m=`Unrecognized key(s) in object: ${j.joinValues(i.keys,", ")}`;break;case A.invalid_union:m="Invalid input";break;case A.invalid_union_discriminator:m=`Invalid discriminator value. Expected ${j.joinValues(i.options)}`;break;case A.invalid_enum_value:m=`Invalid enum value. Expected ${j.joinValues(i.options)}, received '${i.received}'`;break;case A.invalid_arguments:m="Invalid function arguments";break;case A.invalid_return_type:m="Invalid function return type";break;case A.invalid_date:m="Invalid date";break;case A.invalid_string:typeof i.validation=="object"?"includes"in i.validation?(m=`Invalid input: must include "${i.validation.includes}"`,typeof i.validation.position=="number"&&(m=`${m} at one or more positions greater than or equal to ${i.validation.position}`)):"startsWith"in i.validation?m=`Invalid input: must start with "${i.validation.startsWith}"`:"endsWith"in i.validation?m=`Invalid input: must end with "${i.validation.endsWith}"`:j.assertNever(i.validation):i.validation!=="regex"?m=`Invalid ${i.validation}`:m="Invalid";break;case A.too_small:i.type==="array"?m=`Array must contain ${i.exact?"exactly":i.inclusive?"at least":"more than"} ${i.minimum} element(s)`:i.type==="string"?m=`String must contain ${i.exact?"exactly":i.inclusive?"at least":"over"} ${i.minimum} character(s)`:i.type==="number"?m=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="date"?m=`Date must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(i.minimum))}`:m="Invalid input";break;case A.too_big:i.type==="array"?m=`Array must contain ${i.exact?"exactly":i.inclusive?"at most":"less than"} ${i.maximum} element(s)`:i.type==="string"?m=`String must contain ${i.exact?"exactly":i.inclusive?"at most":"under"} ${i.maximum} character(s)`:i.type==="number"?m=`Number must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="bigint"?m=`BigInt must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="date"?m=`Date must be ${i.exact?"exactly":i.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(i.maximum))}`:m="Invalid input";break;case A.custom:m="Invalid input";break;case A.invalid_intersection_types:m="Intersection results could not be merged";break;case A.not_multiple_of:m=`Number must be a multiple of ${i.multipleOf}`;break;case A.not_finite:m="Number must be finite";break;default:m=f.defaultError,j.assertNever(i)}return{message:m}},"errorMap"),ke=ne;function xe(i){ke=i}l(xe,"setErrorMap"),Y(xe,"setErrorMap"),y(xe,"setErrorMap");function Ne(){return ke}l(Ne,"getErrorMap"),Y(Ne,"getErrorMap"),y(Ne,"getErrorMap");var Be=y(i=>{let{data:f,path:m,errorMaps:w,issueData:_}=i,P=[...m,..._.path||[]],I={..._,path:P};if(_.message!==void 0)return{..._,path:P,message:_.message};let F="",U=w.filter(ue=>!!ue).slice().reverse();for(let ue of U)F=ue(I,{data:f,defaultError:F}).message;return{..._,path:P,message:F}},"makeIssue"),zr=[];function z(i,f){let m=Ne(),w=Be({issueData:f,data:i.data,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,m,m===ne?void 0:ne].filter(_=>!!_)});i.common.issues.push(w)}l(z,"addIssueToContext"),Y(z,"addIssueToContext"),y(z,"addIssueToContext");var Qe=Y(class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(i,f){let m=[];for(let w of f){if(w.status==="aborted")return re;w.status==="dirty"&&i.dirty(),m.push(w.value)}return{status:i.value,value:m}}static async mergeObjectAsync(i,f){let m=[];for(let w of f){let _=await w.key,P=await w.value;m.push({key:_,value:P})}return Qe.mergeObjectSync(i,m)}static mergeObjectSync(i,f){let m={};for(let w of f){let{key:_,value:P}=w;if(_.status==="aborted"||P.status==="aborted")return re;_.status==="dirty"&&i.dirty(),P.status==="dirty"&&i.dirty(),_.value!=="__proto__"&&(typeof P.value<"u"||w.alwaysSet)&&(m[_.value]=P.value)}return{status:i.value,value:m}}},"ParseStatus");y(Qe,"ParseStatus");var re=Object.freeze({status:"aborted"}),Qt=y(i=>({status:"dirty",value:i}),"DIRTY"),qe=y(i=>({status:"valid",value:i}),"OK"),Cr=y(i=>i.status==="aborted","isAborted"),vn=y(i=>i.status==="dirty","isDirty"),Ot=y(i=>i.status==="valid","isValid"),bt=y(i=>typeof Promise<"u"&&i instanceof Promise,"isAsync");function bn(i,f,m,w){if(m==="a"&&!w)throw new TypeError("Private accessor was defined without a getter");if(typeof f=="function"?i!==f||!w:!f.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return m==="m"?w:m==="a"?w.call(i):w?w.value:f.get(i)}l(bn,"__classPrivateFieldGet"),Y(bn,"__classPrivateFieldGet"),y(bn,"__classPrivateFieldGet");function Wr(i,f,m,w,_){if(w==="m")throw new TypeError("Private method is not writable");if(w==="a"&&!_)throw new TypeError("Private accessor was defined without a setter");if(typeof f=="function"?i!==f||!_:!f.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return w==="a"?_.call(i,m):_?_.value=m:f.set(i,m),m}l(Wr,"__classPrivateFieldSet"),Y(Wr,"__classPrivateFieldSet"),y(Wr,"__classPrivateFieldSet");var Q;(function(i){i.errToObj=f=>typeof f=="string"?{message:f}:f||{},i.toString=f=>typeof f=="string"?f:f?.message})(Q||(Q={}));var pi,hi,It=Y(class{constructor(i,f,m,w){this._cachedPath=[],this.parent=i,this.data=f,this._path=m,this._key=w}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},"ParseInputLazyPath");y(It,"ParseInputLazyPath");var Hr=y((i,f)=>{if(Ot(f))return{success:!0,data:f.value};if(!i.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let m=new K(i.common.issues);return this._error=m,this._error}}},"handleResult");function le(i){if(!i)return{};let{errorMap:f,invalid_type_error:m,required_error:w,description:_}=i;if(f&&(m||w))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return f?{errorMap:f,description:_}:{errorMap:y((I,F)=>{var U,ue;let{message:Oe}=i;return I.code==="invalid_enum_value"?{message:Oe??F.defaultError}:typeof F.data>"u"?{message:(U=Oe??w)!==null&&U!==void 0?U:F.defaultError}:I.code!=="invalid_type"?{message:F.defaultError}:{message:(ue=Oe??m)!==null&&ue!==void 0?ue:F.defaultError}},"customMap"),description:_}}l(le,"processCreateParams"),Y(le,"processCreateParams"),y(le,"processCreateParams");var he=Y(class{constructor(i){this.spa=this.safeParseAsync,this._def=i,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(i){return Z(i.data)}_getOrReturnCtx(i,f){return f||{common:i.parent.common,data:i.data,parsedType:Z(i.data),schemaErrorMap:this._def.errorMap,path:i.path,parent:i.parent}}_processInputParams(i){return{status:new Qe,ctx:{common:i.parent.common,data:i.data,parsedType:Z(i.data),schemaErrorMap:this._def.errorMap,path:i.path,parent:i.parent}}}_parseSync(i){let f=this._parse(i);if(bt(f))throw new Error("Synchronous parse encountered promise.");return f}_parseAsync(i){let f=this._parse(i);return Promise.resolve(f)}parse(i,f){let m=this.safeParse(i,f);if(m.success)return m.data;throw m.error}safeParse(i,f){var m;let w={common:{issues:[],async:(m=f?.async)!==null&&m!==void 0?m:!1,contextualErrorMap:f?.errorMap},path:f?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:i,parsedType:Z(i)},_=this._parseSync({data:i,path:w.path,parent:w});return Hr(w,_)}async parseAsync(i,f){let m=await this.safeParseAsync(i,f);if(m.success)return m.data;throw m.error}async safeParseAsync(i,f){let m={common:{issues:[],contextualErrorMap:f?.errorMap,async:!0},path:f?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:i,parsedType:Z(i)},w=this._parse({data:i,path:m.path,parent:m}),_=await(bt(w)?w:Promise.resolve(w));return Hr(m,_)}refine(i,f){let m=y(w=>typeof f=="string"||typeof f>"u"?{message:f}:typeof f=="function"?f(w):f,"getIssueProperties");return this._refinement((w,_)=>{let P=i(w),I=y(()=>_.addIssue({code:A.custom,...m(w)}),"setError");return typeof Promise<"u"&&P instanceof Promise?P.then(F=>F?!0:(I(),!1)):P?!0:(I(),!1)})}refinement(i,f){return this._refinement((m,w)=>i(m)?!0:(w.addIssue(typeof f=="function"?f(m,w):f),!1))}_refinement(i){return new wt({schema:this,typeName:ie.ZodEffects,effect:{type:"refinement",refinement:i}})}superRefine(i){return this._refinement(i)}optional(){return Lt.create(this,this._def)}nullable(){return cr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return jt.create(this,this._def)}promise(){return Xr.create(this,this._def)}or(i){return Yr.create([this,i],this._def)}and(i){return xn.create(this,i,this._def)}transform(i){return new wt({...le(this._def),schema:this,typeName:ie.ZodEffects,effect:{type:"transform",transform:i}})}default(i){let f=typeof i=="function"?i:()=>i;return new Sn({...le(this._def),innerType:this,defaultValue:f,typeName:ie.ZodDefault})}brand(){return new oa({typeName:ie.ZodBranded,type:this,...le(this._def)})}catch(i){let f=typeof i=="function"?i:()=>i;return new en({...le(this._def),innerType:this,catchValue:f,typeName:ie.ZodCatch})}describe(i){let f=this.constructor;return new f({...this._def,description:i})}pipe(i){return Ei.create(this,i)}readonly(){return Tn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},"ZodType");y(he,"ZodType");var mi=/^c[^\s-]{8,}$/i,gi=/^[0-9a-z]+$/,ec=/^[0-9A-HJKMNP-TV-Z]{26}$/,ta=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ra=/^[a-z0-9_-]{21}$/i,ns=/^[-+]?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)?)??$/,Pt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,yi="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",eo,ar=/^(?:(?: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])$/,is=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,tc=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,_n="((\\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])))",Vt=new RegExp(`^${_n}$`);function Sr(i){let f="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return i.precision?f=`${f}\\.\\d{${i.precision}}`:i.precision==null&&(f=`${f}(\\.\\d+)?`),f}l(Sr,"timeRegexSource"),Y(Sr,"timeRegexSource"),y(Sr,"timeRegexSource");function wn(i){return new RegExp(`^${Sr(i)}$`)}l(wn,"timeRegex"),Y(wn,"timeRegex"),y(wn,"timeRegex");function na(i){let f=`${_n}T${Sr(i)}`,m=[];return m.push(i.local?"Z?":"Z"),i.offset&&m.push("([+-]\\d{2}:?\\d{2})"),f=`${f}(${m.join("|")})`,new RegExp(`^${f}$`)}l(na,"datetimeRegex"),Y(na,"datetimeRegex"),y(na,"datetimeRegex");function Gr(i,f){return!!((f==="v4"||!f)&&ar.test(i)||(f==="v6"||!f)&&is.test(i))}l(Gr,"isValidIP"),Y(Gr,"isValidIP"),y(Gr,"isValidIP");var Nt=Y(class extends he{_parse(i){if(this._def.coerce&&(i.data=String(i.data)),this._getType(i)!==R.string){let _=this._getOrReturnCtx(i);return z(_,{code:A.invalid_type,expected:R.string,received:_.parsedType}),re}let m=new Qe,w;for(let _ of this._def.checks)if(_.kind==="min")i.data.length<_.value&&(w=this._getOrReturnCtx(i,w),z(w,{code:A.too_small,minimum:_.value,type:"string",inclusive:!0,exact:!1,message:_.message}),m.dirty());else if(_.kind==="max")i.data.length>_.value&&(w=this._getOrReturnCtx(i,w),z(w,{code:A.too_big,maximum:_.value,type:"string",inclusive:!0,exact:!1,message:_.message}),m.dirty());else if(_.kind==="length"){let P=i.data.length>_.value,I=i.data.length<_.value;(P||I)&&(w=this._getOrReturnCtx(i,w),P?z(w,{code:A.too_big,maximum:_.value,type:"string",inclusive:!0,exact:!0,message:_.message}):I&&z(w,{code:A.too_small,minimum:_.value,type:"string",inclusive:!0,exact:!0,message:_.message}),m.dirty())}else if(_.kind==="email")Pt.test(i.data)||(w=this._getOrReturnCtx(i,w),z(w,{validation:"email",code:A.invalid_string,message:_.message}),m.dirty());else if(_.kind==="emoji")eo||(eo=new RegExp(yi,"u")),eo.test(i.data)||(w=this._getOrReturnCtx(i,w),z(w,{validation:"emoji",code:A.invalid_string,message:_.message}),m.dirty());else if(_.kind==="uuid")ta.test(i.data)||(w=this._getOrReturnCtx(i,w),z(w,{validation:"uuid",code:A.invalid_string,message:_.message}),m.dirty());else if(_.kind==="nanoid")ra.test(i.data)||(w=this._getOrReturnCtx(i,w),z(w,{validation:"nanoid",code:A.invalid_string,message:_.message}),m.dirty());else if(_.kind==="cuid")mi.test(i.data)||(w=this._getOrReturnCtx(i,w),z(w,{validation:"cuid",code:A.invalid_string,message:_.message}),m.dirty());else if(_.kind==="cuid2")gi.test(i.data)||(w=this._getOrReturnCtx(i,w),z(w,{validation:"cuid2",code:A.invalid_string,message:_.message}),m.dirty());else if(_.kind==="ulid")ec.test(i.data)||(w=this._getOrReturnCtx(i,w),z(w,{validation:"ulid",code:A.invalid_string,message:_.message}),m.dirty());else if(_.kind==="url")try{new URL(i.data)}catch{w=this._getOrReturnCtx(i,w),z(w,{validation:"url",code:A.invalid_string,message:_.message}),m.dirty()}else _.kind==="regex"?(_.regex.lastIndex=0,_.regex.test(i.data)||(w=this._getOrReturnCtx(i,w),z(w,{validation:"regex",code:A.invalid_string,message:_.message}),m.dirty())):_.kind==="trim"?i.data=i.data.trim():_.kind==="includes"?i.data.includes(_.value,_.position)||(w=this._getOrReturnCtx(i,w),z(w,{code:A.invalid_string,validation:{includes:_.value,position:_.position},message:_.message}),m.dirty()):_.kind==="toLowerCase"?i.data=i.data.toLowerCase():_.kind==="toUpperCase"?i.data=i.data.toUpperCase():_.kind==="startsWith"?i.data.startsWith(_.value)||(w=this._getOrReturnCtx(i,w),z(w,{code:A.invalid_string,validation:{startsWith:_.value},message:_.message}),m.dirty()):_.kind==="endsWith"?i.data.endsWith(_.value)||(w=this._getOrReturnCtx(i,w),z(w,{code:A.invalid_string,validation:{endsWith:_.value},message:_.message}),m.dirty()):_.kind==="datetime"?na(_).test(i.data)||(w=this._getOrReturnCtx(i,w),z(w,{code:A.invalid_string,validation:"datetime",message:_.message}),m.dirty()):_.kind==="date"?Vt.test(i.data)||(w=this._getOrReturnCtx(i,w),z(w,{code:A.invalid_string,validation:"date",message:_.message}),m.dirty()):_.kind==="time"?wn(_).test(i.data)||(w=this._getOrReturnCtx(i,w),z(w,{code:A.invalid_string,validation:"time",message:_.message}),m.dirty()):_.kind==="duration"?ns.test(i.data)||(w=this._getOrReturnCtx(i,w),z(w,{validation:"duration",code:A.invalid_string,message:_.message}),m.dirty()):_.kind==="ip"?Gr(i.data,_.version)||(w=this._getOrReturnCtx(i,w),z(w,{validation:"ip",code:A.invalid_string,message:_.message}),m.dirty()):_.kind==="base64"?tc.test(i.data)||(w=this._getOrReturnCtx(i,w),z(w,{validation:"base64",code:A.invalid_string,message:_.message}),m.dirty()):j.assertNever(_);return{status:m.value,value:i.data}}_regex(i,f,m){return this.refinement(w=>i.test(w),{validation:f,code:A.invalid_string,...Q.errToObj(m)})}_addCheck(i){return new Nt({...this._def,checks:[...this._def.checks,i]})}email(i){return this._addCheck({kind:"email",...Q.errToObj(i)})}url(i){return this._addCheck({kind:"url",...Q.errToObj(i)})}emoji(i){return this._addCheck({kind:"emoji",...Q.errToObj(i)})}uuid(i){return this._addCheck({kind:"uuid",...Q.errToObj(i)})}nanoid(i){return this._addCheck({kind:"nanoid",...Q.errToObj(i)})}cuid(i){return this._addCheck({kind:"cuid",...Q.errToObj(i)})}cuid2(i){return this._addCheck({kind:"cuid2",...Q.errToObj(i)})}ulid(i){return this._addCheck({kind:"ulid",...Q.errToObj(i)})}base64(i){return this._addCheck({kind:"base64",...Q.errToObj(i)})}ip(i){return this._addCheck({kind:"ip",...Q.errToObj(i)})}datetime(i){var f,m;return typeof i=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:i}):this._addCheck({kind:"datetime",precision:typeof i?.precision>"u"?null:i?.precision,offset:(f=i?.offset)!==null&&f!==void 0?f:!1,local:(m=i?.local)!==null&&m!==void 0?m:!1,...Q.errToObj(i?.message)})}date(i){return this._addCheck({kind:"date",message:i})}time(i){return typeof i=="string"?this._addCheck({kind:"time",precision:null,message:i}):this._addCheck({kind:"time",precision:typeof i?.precision>"u"?null:i?.precision,...Q.errToObj(i?.message)})}duration(i){return this._addCheck({kind:"duration",...Q.errToObj(i)})}regex(i,f){return this._addCheck({kind:"regex",regex:i,...Q.errToObj(f)})}includes(i,f){return this._addCheck({kind:"includes",value:i,position:f?.position,...Q.errToObj(f?.message)})}startsWith(i,f){return this._addCheck({kind:"startsWith",value:i,...Q.errToObj(f)})}endsWith(i,f){return this._addCheck({kind:"endsWith",value:i,...Q.errToObj(f)})}min(i,f){return this._addCheck({kind:"min",value:i,...Q.errToObj(f)})}max(i,f){return this._addCheck({kind:"max",value:i,...Q.errToObj(f)})}length(i,f){return this._addCheck({kind:"length",value:i,...Q.errToObj(f)})}nonempty(i){return this.min(1,Q.errToObj(i))}trim(){return new Nt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Nt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Nt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(i=>i.kind==="datetime")}get isDate(){return!!this._def.checks.find(i=>i.kind==="date")}get isTime(){return!!this._def.checks.find(i=>i.kind==="time")}get isDuration(){return!!this._def.checks.find(i=>i.kind==="duration")}get isEmail(){return!!this._def.checks.find(i=>i.kind==="email")}get isURL(){return!!this._def.checks.find(i=>i.kind==="url")}get isEmoji(){return!!this._def.checks.find(i=>i.kind==="emoji")}get isUUID(){return!!this._def.checks.find(i=>i.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(i=>i.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(i=>i.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(i=>i.kind==="cuid2")}get isULID(){return!!this._def.checks.find(i=>i.kind==="ulid")}get isIP(){return!!this._def.checks.find(i=>i.kind==="ip")}get isBase64(){return!!this._def.checks.find(i=>i.kind==="base64")}get minLength(){let i=null;for(let f of this._def.checks)f.kind==="min"&&(i===null||f.value>i)&&(i=f.value);return i}get maxLength(){let i=null;for(let f of this._def.checks)f.kind==="max"&&(i===null||f.value<i)&&(i=f.value);return i}},"ZodString");y(Nt,"ZodString"),Nt.create=i=>{var f;return new Nt({checks:[],typeName:ie.ZodString,coerce:(f=i?.coerce)!==null&&f!==void 0?f:!1,...le(i)})};function Jr(i,f){let m=(i.toString().split(".")[1]||"").length,w=(f.toString().split(".")[1]||"").length,_=m>w?m:w,P=parseInt(i.toFixed(_).replace(".","")),I=parseInt(f.toFixed(_).replace(".",""));return P%I/Math.pow(10,_)}l(Jr,"floatSafeRemainder"),Y(Jr,"floatSafeRemainder"),y(Jr,"floatSafeRemainder");var dt=Y(class extends he{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(i){if(this._def.coerce&&(i.data=Number(i.data)),this._getType(i)!==R.number){let _=this._getOrReturnCtx(i);return z(_,{code:A.invalid_type,expected:R.number,received:_.parsedType}),re}let m,w=new Qe;for(let _ of this._def.checks)_.kind==="int"?j.isInteger(i.data)||(m=this._getOrReturnCtx(i,m),z(m,{code:A.invalid_type,expected:"integer",received:"float",message:_.message}),w.dirty()):_.kind==="min"?(_.inclusive?i.data<_.value:i.data<=_.value)&&(m=this._getOrReturnCtx(i,m),z(m,{code:A.too_small,minimum:_.value,type:"number",inclusive:_.inclusive,exact:!1,message:_.message}),w.dirty()):_.kind==="max"?(_.inclusive?i.data>_.value:i.data>=_.value)&&(m=this._getOrReturnCtx(i,m),z(m,{code:A.too_big,maximum:_.value,type:"number",inclusive:_.inclusive,exact:!1,message:_.message}),w.dirty()):_.kind==="multipleOf"?Jr(i.data,_.value)!==0&&(m=this._getOrReturnCtx(i,m),z(m,{code:A.not_multiple_of,multipleOf:_.value,message:_.message}),w.dirty()):_.kind==="finite"?Number.isFinite(i.data)||(m=this._getOrReturnCtx(i,m),z(m,{code:A.not_finite,message:_.message}),w.dirty()):j.assertNever(_);return{status:w.value,value:i.data}}gte(i,f){return this.setLimit("min",i,!0,Q.toString(f))}gt(i,f){return this.setLimit("min",i,!1,Q.toString(f))}lte(i,f){return this.setLimit("max",i,!0,Q.toString(f))}lt(i,f){return this.setLimit("max",i,!1,Q.toString(f))}setLimit(i,f,m,w){return new dt({...this._def,checks:[...this._def.checks,{kind:i,value:f,inclusive:m,message:Q.toString(w)}]})}_addCheck(i){return new dt({...this._def,checks:[...this._def.checks,i]})}int(i){return this._addCheck({kind:"int",message:Q.toString(i)})}positive(i){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Q.toString(i)})}negative(i){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Q.toString(i)})}nonpositive(i){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Q.toString(i)})}nonnegative(i){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Q.toString(i)})}multipleOf(i,f){return this._addCheck({kind:"multipleOf",value:i,message:Q.toString(f)})}finite(i){return this._addCheck({kind:"finite",message:Q.toString(i)})}safe(i){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Q.toString(i)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Q.toString(i)})}get minValue(){let i=null;for(let f of this._def.checks)f.kind==="min"&&(i===null||f.value>i)&&(i=f.value);return i}get maxValue(){let i=null;for(let f of this._def.checks)f.kind==="max"&&(i===null||f.value<i)&&(i=f.value);return i}get isInt(){return!!this._def.checks.find(i=>i.kind==="int"||i.kind==="multipleOf"&&j.isInteger(i.value))}get isFinite(){let i=null,f=null;for(let m of this._def.checks){if(m.kind==="finite"||m.kind==="int"||m.kind==="multipleOf")return!0;m.kind==="min"?(f===null||m.value>f)&&(f=m.value):m.kind==="max"&&(i===null||m.value<i)&&(i=m.value)}return Number.isFinite(f)&&Number.isFinite(i)}},"ZodNumber");y(dt,"ZodNumber"),dt.create=i=>new dt({checks:[],typeName:ie.ZodNumber,coerce:i?.coerce||!1,...le(i)});var Yt=Y(class extends he{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(i){if(this._def.coerce&&(i.data=BigInt(i.data)),this._getType(i)!==R.bigint){let _=this._getOrReturnCtx(i);return z(_,{code:A.invalid_type,expected:R.bigint,received:_.parsedType}),re}let m,w=new Qe;for(let _ of this._def.checks)_.kind==="min"?(_.inclusive?i.data<_.value:i.data<=_.value)&&(m=this._getOrReturnCtx(i,m),z(m,{code:A.too_small,type:"bigint",minimum:_.value,inclusive:_.inclusive,message:_.message}),w.dirty()):_.kind==="max"?(_.inclusive?i.data>_.value:i.data>=_.value)&&(m=this._getOrReturnCtx(i,m),z(m,{code:A.too_big,type:"bigint",maximum:_.value,inclusive:_.inclusive,message:_.message}),w.dirty()):_.kind==="multipleOf"?i.data%_.value!==BigInt(0)&&(m=this._getOrReturnCtx(i,m),z(m,{code:A.not_multiple_of,multipleOf:_.value,message:_.message}),w.dirty()):j.assertNever(_);return{status:w.value,value:i.data}}gte(i,f){return this.setLimit("min",i,!0,Q.toString(f))}gt(i,f){return this.setLimit("min",i,!1,Q.toString(f))}lte(i,f){return this.setLimit("max",i,!0,Q.toString(f))}lt(i,f){return this.setLimit("max",i,!1,Q.toString(f))}setLimit(i,f,m,w){return new Yt({...this._def,checks:[...this._def.checks,{kind:i,value:f,inclusive:m,message:Q.toString(w)}]})}_addCheck(i){return new Yt({...this._def,checks:[...this._def.checks,i]})}positive(i){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Q.toString(i)})}negative(i){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Q.toString(i)})}nonpositive(i){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Q.toString(i)})}nonnegative(i){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Q.toString(i)})}multipleOf(i,f){return this._addCheck({kind:"multipleOf",value:i,message:Q.toString(f)})}get minValue(){let i=null;for(let f of this._def.checks)f.kind==="min"&&(i===null||f.value>i)&&(i=f.value);return i}get maxValue(){let i=null;for(let f of this._def.checks)f.kind==="max"&&(i===null||f.value<i)&&(i=f.value);return i}},"ZodBigInt");y(Yt,"ZodBigInt"),Yt.create=i=>{var f;return new Yt({checks:[],typeName:ie.ZodBigInt,coerce:(f=i?.coerce)!==null&&f!==void 0?f:!1,...le(i)})};var Tr=Y(class extends he{_parse(i){if(this._def.coerce&&(i.data=Boolean(i.data)),this._getType(i)!==R.boolean){let m=this._getOrReturnCtx(i);return z(m,{code:A.invalid_type,expected:R.boolean,received:m.parsedType}),re}return qe(i.data)}},"ZodBoolean");y(Tr,"ZodBoolean"),Tr.create=i=>new Tr({typeName:ie.ZodBoolean,coerce:i?.coerce||!1,...le(i)});var or=Y(class extends he{_parse(i){if(this._def.coerce&&(i.data=new Date(i.data)),this._getType(i)!==R.date){let _=this._getOrReturnCtx(i);return z(_,{code:A.invalid_type,expected:R.date,received:_.parsedType}),re}if(isNaN(i.data.getTime())){let _=this._getOrReturnCtx(i);return z(_,{code:A.invalid_date}),re}let m=new Qe,w;for(let _ of this._def.checks)_.kind==="min"?i.data.getTime()<_.value&&(w=this._getOrReturnCtx(i,w),z(w,{code:A.too_small,message:_.message,inclusive:!0,exact:!1,minimum:_.value,type:"date"}),m.dirty()):_.kind==="max"?i.data.getTime()>_.value&&(w=this._getOrReturnCtx(i,w),z(w,{code:A.too_big,message:_.message,inclusive:!0,exact:!1,maximum:_.value,type:"date"}),m.dirty()):j.assertNever(_);return{status:m.value,value:new Date(i.data.getTime())}}_addCheck(i){return new or({...this._def,checks:[...this._def.checks,i]})}min(i,f){return this._addCheck({kind:"min",value:i.getTime(),message:Q.toString(f)})}max(i,f){return this._addCheck({kind:"max",value:i.getTime(),message:Q.toString(f)})}get minDate(){let i=null;for(let f of this._def.checks)f.kind==="min"&&(i===null||f.value>i)&&(i=f.value);return i!=null?new Date(i):null}get maxDate(){let i=null;for(let f of this._def.checks)f.kind==="max"&&(i===null||f.value<i)&&(i=f.value);return i!=null?new Date(i):null}},"ZodDate");y(or,"ZodDate"),or.create=i=>new or({checks:[],coerce:i?.coerce||!1,typeName:ie.ZodDate,...le(i)});var Qr=Y(class extends he{_parse(i){if(this._getType(i)!==R.symbol){let m=this._getOrReturnCtx(i);return z(m,{code:A.invalid_type,expected:R.symbol,received:m.parsedType}),re}return qe(i.data)}},"ZodSymbol");y(Qr,"ZodSymbol"),Qr.create=i=>new Qr({typeName:ie.ZodSymbol,...le(i)});var Rr=Y(class extends he{_parse(i){if(this._getType(i)!==R.undefined){let m=this._getOrReturnCtx(i);return z(m,{code:A.invalid_type,expected:R.undefined,received:m.parsedType}),re}return qe(i.data)}},"ZodUndefined");y(Rr,"ZodUndefined"),Rr.create=i=>new Rr({typeName:ie.ZodUndefined,...le(i)});var kr=Y(class extends he{_parse(i){if(this._getType(i)!==R.null){let m=this._getOrReturnCtx(i);return z(m,{code:A.invalid_type,expected:R.null,received:m.parsedType}),re}return qe(i.data)}},"ZodNull");y(kr,"ZodNull"),kr.create=i=>new kr({typeName:ie.ZodNull,...le(i)});var sr=Y(class extends he{constructor(){super(...arguments),this._any=!0}_parse(i){return qe(i.data)}},"ZodAny");y(sr,"ZodAny"),sr.create=i=>new sr({typeName:ie.ZodAny,...le(i)});var Kt=Y(class extends he{constructor(){super(...arguments),this._unknown=!0}_parse(i){return qe(i.data)}},"ZodUnknown");y(Kt,"ZodUnknown"),Kt.create=i=>new Kt({typeName:ie.ZodUnknown,...le(i)});var _t=Y(class extends he{_parse(i){let f=this._getOrReturnCtx(i);return z(f,{code:A.invalid_type,expected:R.never,received:f.parsedType}),re}},"ZodNever");y(_t,"ZodNever"),_t.create=i=>new _t({typeName:ie.ZodNever,...le(i)});var vi=Y(class extends he{_parse(i){if(this._getType(i)!==R.undefined){let m=this._getOrReturnCtx(i);return z(m,{code:A.invalid_type,expected:R.void,received:m.parsedType}),re}return qe(i.data)}},"ZodVoid");y(vi,"ZodVoid"),vi.create=i=>new vi({typeName:ie.ZodVoid,...le(i)});var jt=Y(class extends he{_parse(i){let{ctx:f,status:m}=this._processInputParams(i),w=this._def;if(f.parsedType!==R.array)return z(f,{code:A.invalid_type,expected:R.array,received:f.parsedType}),re;if(w.exactLength!==null){let P=f.data.length>w.exactLength.value,I=f.data.length<w.exactLength.value;(P||I)&&(z(f,{code:P?A.too_big:A.too_small,minimum:I?w.exactLength.value:void 0,maximum:P?w.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:w.exactLength.message}),m.dirty())}if(w.minLength!==null&&f.data.length<w.minLength.value&&(z(f,{code:A.too_small,minimum:w.minLength.value,type:"array",inclusive:!0,exact:!1,message:w.minLength.message}),m.dirty()),w.maxLength!==null&&f.data.length>w.maxLength.value&&(z(f,{code:A.too_big,maximum:w.maxLength.value,type:"array",inclusive:!0,exact:!1,message:w.maxLength.message}),m.dirty()),f.common.async)return Promise.all([...f.data].map((P,I)=>w.type._parseAsync(new It(f,P,f.path,I)))).then(P=>Qe.mergeArray(m,P));let _=[...f.data].map((P,I)=>w.type._parseSync(new It(f,P,f.path,I)));return Qe.mergeArray(m,_)}get element(){return this._def.type}min(i,f){return new jt({...this._def,minLength:{value:i,message:Q.toString(f)}})}max(i,f){return new jt({...this._def,maxLength:{value:i,message:Q.toString(f)}})}length(i,f){return new jt({...this._def,exactLength:{value:i,message:Q.toString(f)}})}nonempty(i){return this.min(1,i)}},"ZodArray");y(jt,"ZodArray"),jt.create=(i,f)=>new jt({type:i,minLength:null,maxLength:null,exactLength:null,typeName:ie.ZodArray,...le(f)});function Ar(i){if(i instanceof Le){let f={};for(let m in i.shape){let w=i.shape[m];f[m]=Lt.create(Ar(w))}return new Le({...i._def,shape:()=>f})}else return i instanceof jt?new jt({...i._def,type:Ar(i.element)}):i instanceof Lt?Lt.create(Ar(i.unwrap())):i instanceof cr?cr.create(Ar(i.unwrap())):i instanceof Dt?Dt.create(i.items.map(f=>Ar(f))):i}l(Ar,"deepPartialify"),Y(Ar,"deepPartialify"),y(Ar,"deepPartialify");var Le=Y(class extends he{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let i=this._def.shape(),f=j.objectKeys(i);return this._cached={shape:i,keys:f}}_parse(i){if(this._getType(i)!==R.object){let U=this._getOrReturnCtx(i);return z(U,{code:A.invalid_type,expected:R.object,received:U.parsedType}),re}let{status:m,ctx:w}=this._processInputParams(i),{shape:_,keys:P}=this._getCached(),I=[];if(!(this._def.catchall instanceof _t&&this._def.unknownKeys==="strip"))for(let U in w.data)P.includes(U)||I.push(U);let F=[];for(let U of P){let ue=_[U],Oe=w.data[U];F.push({key:{status:"valid",value:U},value:ue._parse(new It(w,Oe,w.path,U)),alwaysSet:U in w.data})}if(this._def.catchall instanceof _t){let U=this._def.unknownKeys;if(U==="passthrough")for(let ue of I)F.push({key:{status:"valid",value:ue},value:{status:"valid",value:w.data[ue]}});else if(U==="strict")I.length>0&&(z(w,{code:A.unrecognized_keys,keys:I}),m.dirty());else if(U!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let U=this._def.catchall;for(let ue of I){let Oe=w.data[ue];F.push({key:{status:"valid",value:ue},value:U._parse(new It(w,Oe,w.path,ue)),alwaysSet:ue in w.data})}}return w.common.async?Promise.resolve().then(async()=>{let U=[];for(let ue of F){let Oe=await ue.key,Pa=await ue.value;U.push({key:Oe,value:Pa,alwaysSet:ue.alwaysSet})}return U}).then(U=>Qe.mergeObjectSync(m,U)):Qe.mergeObjectSync(m,F)}get shape(){return this._def.shape()}strict(i){return Q.errToObj,new Le({...this._def,unknownKeys:"strict",...i!==void 0?{errorMap:(f,m)=>{var w,_,P,I;let F=(P=(_=(w=this._def).errorMap)===null||_===void 0?void 0:_.call(w,f,m).message)!==null&&P!==void 0?P:m.defaultError;return f.code==="unrecognized_keys"?{message:(I=Q.errToObj(i).message)!==null&&I!==void 0?I:F}:{message:F}}}:{}})}strip(){return new Le({...this._def,unknownKeys:"strip"})}passthrough(){return new Le({...this._def,unknownKeys:"passthrough"})}extend(i){return new Le({...this._def,shape:()=>({...this._def.shape(),...i})})}merge(i){return new Le({unknownKeys:i._def.unknownKeys,catchall:i._def.catchall,shape:()=>({...this._def.shape(),...i._def.shape()}),typeName:ie.ZodObject})}setKey(i,f){return this.augment({[i]:f})}catchall(i){return new Le({...this._def,catchall:i})}pick(i){let f={};return j.objectKeys(i).forEach(m=>{i[m]&&this.shape[m]&&(f[m]=this.shape[m])}),new Le({...this._def,shape:()=>f})}omit(i){let f={};return j.objectKeys(this.shape).forEach(m=>{i[m]||(f[m]=this.shape[m])}),new Le({...this._def,shape:()=>f})}deepPartial(){return Ar(this)}partial(i){let f={};return j.objectKeys(this.shape).forEach(m=>{let w=this.shape[m];i&&!i[m]?f[m]=w:f[m]=w.optional()}),new Le({...this._def,shape:()=>f})}required(i){let f={};return j.objectKeys(this.shape).forEach(m=>{if(i&&!i[m])f[m]=this.shape[m];else{let _=this.shape[m];for(;_ instanceof Lt;)_=_._def.innerType;f[m]=_}}),new Le({...this._def,shape:()=>f})}keyof(){return aa(j.objectKeys(this.shape))}},"ZodObject");y(Le,"ZodObject"),Le.create=(i,f)=>new Le({shape:()=>i,unknownKeys:"strip",catchall:_t.create(),typeName:ie.ZodObject,...le(f)}),Le.strictCreate=(i,f)=>new Le({shape:()=>i,unknownKeys:"strict",catchall:_t.create(),typeName:ie.ZodObject,...le(f)}),Le.lazycreate=(i,f)=>new Le({shape:i,unknownKeys:"strip",catchall:_t.create(),typeName:ie.ZodObject,...le(f)});var Yr=Y(class extends he{_parse(i){let{ctx:f}=this._processInputParams(i),m=this._def.options;function w(_){for(let I of _)if(I.result.status==="valid")return I.result;for(let I of _)if(I.result.status==="dirty")return f.common.issues.push(...I.ctx.common.issues),I.result;let P=_.map(I=>new K(I.ctx.common.issues));return z(f,{code:A.invalid_union,unionErrors:P}),re}if(l(w,"handleResults"),Y(w,"handleResults"),y(w,"handleResults"),f.common.async)return Promise.all(m.map(async _=>{let P={...f,common:{...f.common,issues:[]},parent:null};return{result:await _._parseAsync({data:f.data,path:f.path,parent:P}),ctx:P}})).then(w);{let _,P=[];for(let F of m){let U={...f,common:{...f.common,issues:[]},parent:null},ue=F._parseSync({data:f.data,path:f.path,parent:U});if(ue.status==="valid")return ue;ue.status==="dirty"&&!_&&(_={result:ue,ctx:U}),U.common.issues.length&&P.push(U.common.issues)}if(_)return f.common.issues.push(..._.ctx.common.issues),_.result;let I=P.map(F=>new K(F));return z(f,{code:A.invalid_union,unionErrors:I}),re}}get options(){return this._def.options}},"ZodUnion");y(Yr,"ZodUnion"),Yr.create=(i,f)=>new Yr({options:i,typeName:ie.ZodUnion,...le(f)});var lr=y(i=>i instanceof En?lr(i.schema):i instanceof wt?lr(i.innerType()):i instanceof Ir?[i.value]:i instanceof Pr?i.options:i instanceof Cn?j.objectValues(i.enum):i instanceof Sn?lr(i._def.innerType):i instanceof Rr?[void 0]:i instanceof kr?[null]:i instanceof Lt?[void 0,...lr(i.unwrap())]:i instanceof cr?[null,...lr(i.unwrap())]:i instanceof oa||i instanceof Tn?lr(i.unwrap()):i instanceof en?lr(i._def.innerType):[],"getDiscriminator"),ia=Y(class extends he{_parse(i){let{ctx:f}=this._processInputParams(i);if(f.parsedType!==R.object)return z(f,{code:A.invalid_type,expected:R.object,received:f.parsedType}),re;let m=this.discriminator,w=f.data[m],_=this.optionsMap.get(w);return _?f.common.async?_._parseAsync({data:f.data,path:f.path,parent:f}):_._parseSync({data:f.data,path:f.path,parent:f}):(z(f,{code:A.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[m]}),re)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(i,f,m){let w=new Map;for(let _ of f){let P=lr(_.shape[i]);if(!P.length)throw new Error(`A discriminator value for key \`${i}\` could not be extracted from all schema options`);for(let I of P){if(w.has(I))throw new Error(`Discriminator property ${String(i)} has duplicate value ${String(I)}`);w.set(I,_)}}return new ia({typeName:ie.ZodDiscriminatedUnion,discriminator:i,options:f,optionsMap:w,...le(m)})}},"ZodDiscriminatedUnion");y(ia,"ZodDiscriminatedUnion");function bi(i,f){let m=Z(i),w=Z(f);if(i===f)return{valid:!0,data:i};if(m===R.object&&w===R.object){let _=j.objectKeys(f),P=j.objectKeys(i).filter(F=>_.indexOf(F)!==-1),I={...i,...f};for(let F of P){let U=bi(i[F],f[F]);if(!U.valid)return{valid:!1};I[F]=U.data}return{valid:!0,data:I}}else if(m===R.array&&w===R.array){if(i.length!==f.length)return{valid:!1};let _=[];for(let P=0;P<i.length;P++){let I=i[P],F=f[P],U=bi(I,F);if(!U.valid)return{valid:!1};_.push(U.data)}return{valid:!0,data:_}}else return m===R.date&&w===R.date&&+i==+f?{valid:!0,data:i}:{valid:!1}}l(bi,"mergeValues"),Y(bi,"mergeValues"),y(bi,"mergeValues");var xn=Y(class extends he{_parse(i){let{status:f,ctx:m}=this._processInputParams(i),w=y((_,P)=>{if(Cr(_)||Cr(P))return re;let I=bi(_.value,P.value);return I.valid?((vn(_)||vn(P))&&f.dirty(),{status:f.value,value:I.data}):(z(m,{code:A.invalid_intersection_types}),re)},"handleParsed");return m.common.async?Promise.all([this._def.left._parseAsync({data:m.data,path:m.path,parent:m}),this._def.right._parseAsync({data:m.data,path:m.path,parent:m})]).then(([_,P])=>w(_,P)):w(this._def.left._parseSync({data:m.data,path:m.path,parent:m}),this._def.right._parseSync({data:m.data,path:m.path,parent:m}))}},"ZodIntersection");y(xn,"ZodIntersection"),xn.create=(i,f,m)=>new xn({left:i,right:f,typeName:ie.ZodIntersection,...le(m)});var Dt=Y(class extends he{_parse(i){let{status:f,ctx:m}=this._processInputParams(i);if(m.parsedType!==R.array)return z(m,{code:A.invalid_type,expected:R.array,received:m.parsedType}),re;if(m.data.length<this._def.items.length)return z(m,{code:A.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),re;!this._def.rest&&m.data.length>this._def.items.length&&(z(m,{code:A.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),f.dirty());let _=[...m.data].map((P,I)=>{let F=this._def.items[I]||this._def.rest;return F?F._parse(new It(m,P,m.path,I)):null}).filter(P=>!!P);return m.common.async?Promise.all(_).then(P=>Qe.mergeArray(f,P)):Qe.mergeArray(f,_)}get items(){return this._def.items}rest(i){return new Dt({...this._def,rest:i})}},"ZodTuple");y(Dt,"ZodTuple"),Dt.create=(i,f)=>{if(!Array.isArray(i))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Dt({items:i,typeName:ie.ZodTuple,rest:null,...le(f)})};var _i=Y(class extends he{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(i){let{status:f,ctx:m}=this._processInputParams(i);if(m.parsedType!==R.object)return z(m,{code:A.invalid_type,expected:R.object,received:m.parsedType}),re;let w=[],_=this._def.keyType,P=this._def.valueType;for(let I in m.data)w.push({key:_._parse(new It(m,I,m.path,I)),value:P._parse(new It(m,m.data[I],m.path,I)),alwaysSet:I in m.data});return m.common.async?Qe.mergeObjectAsync(f,w):Qe.mergeObjectSync(f,w)}get element(){return this._def.valueType}static create(i,f,m){return f instanceof he?new _i({keyType:i,valueType:f,typeName:ie.ZodRecord,...le(m)}):new _i({keyType:Nt.create(),valueType:i,typeName:ie.ZodRecord,...le(f)})}},"ZodRecord");y(_i,"ZodRecord");var wi=Y(class extends he{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(i){let{status:f,ctx:m}=this._processInputParams(i);if(m.parsedType!==R.map)return z(m,{code:A.invalid_type,expected:R.map,received:m.parsedType}),re;let w=this._def.keyType,_=this._def.valueType,P=[...m.data.entries()].map(([I,F],U)=>({key:w._parse(new It(m,I,m.path,[U,"key"])),value:_._parse(new It(m,F,m.path,[U,"value"]))}));if(m.common.async){let I=new Map;return Promise.resolve().then(async()=>{for(let F of P){let U=await F.key,ue=await F.value;if(U.status==="aborted"||ue.status==="aborted")return re;(U.status==="dirty"||ue.status==="dirty")&&f.dirty(),I.set(U.value,ue.value)}return{status:f.value,value:I}})}else{let I=new Map;for(let F of P){let U=F.key,ue=F.value;if(U.status==="aborted"||ue.status==="aborted")return re;(U.status==="dirty"||ue.status==="dirty")&&f.dirty(),I.set(U.value,ue.value)}return{status:f.value,value:I}}}},"ZodMap");y(wi,"ZodMap"),wi.create=(i,f,m)=>new wi({valueType:f,keyType:i,typeName:ie.ZodMap,...le(m)});var Kr=Y(class extends he{_parse(i){let{status:f,ctx:m}=this._processInputParams(i);if(m.parsedType!==R.set)return z(m,{code:A.invalid_type,expected:R.set,received:m.parsedType}),re;let w=this._def;w.minSize!==null&&m.data.size<w.minSize.value&&(z(m,{code:A.too_small,minimum:w.minSize.value,type:"set",inclusive:!0,exact:!1,message:w.minSize.message}),f.dirty()),w.maxSize!==null&&m.data.size>w.maxSize.value&&(z(m,{code:A.too_big,maximum:w.maxSize.value,type:"set",inclusive:!0,exact:!1,message:w.maxSize.message}),f.dirty());let _=this._def.valueType;function P(F){let U=new Set;for(let ue of F){if(ue.status==="aborted")return re;ue.status==="dirty"&&f.dirty(),U.add(ue.value)}return{status:f.value,value:U}}l(P,"finalizeSet"),Y(P,"finalizeSet"),y(P,"finalizeSet");let I=[...m.data.values()].map((F,U)=>_._parse(new It(m,F,m.path,U)));return m.common.async?Promise.all(I).then(F=>P(F)):P(I)}min(i,f){return new Kr({...this._def,minSize:{value:i,message:Q.toString(f)}})}max(i,f){return new Kr({...this._def,maxSize:{value:i,message:Q.toString(f)}})}size(i,f){return this.min(i,f).max(i,f)}nonempty(i){return this.min(1,i)}},"ZodSet");y(Kr,"ZodSet"),Kr.create=(i,f)=>new Kr({valueType:i,minSize:null,maxSize:null,typeName:ie.ZodSet,...le(f)});var Or=Y(class extends he{constructor(){super(...arguments),this.validate=this.implement}_parse(i){let{ctx:f}=this._processInputParams(i);if(f.parsedType!==R.function)return z(f,{code:A.invalid_type,expected:R.function,received:f.parsedType}),re;function m(I,F){return Be({data:I,path:f.path,errorMaps:[f.common.contextualErrorMap,f.schemaErrorMap,Ne(),ne].filter(U=>!!U),issueData:{code:A.invalid_arguments,argumentsError:F}})}l(m,"makeArgsIssue"),Y(m,"makeArgsIssue"),y(m,"makeArgsIssue");function w(I,F){return Be({data:I,path:f.path,errorMaps:[f.common.contextualErrorMap,f.schemaErrorMap,Ne(),ne].filter(U=>!!U),issueData:{code:A.invalid_return_type,returnTypeError:F}})}l(w,"makeReturnsIssue"),Y(w,"makeReturnsIssue"),y(w,"makeReturnsIssue");let _={errorMap:f.common.contextualErrorMap},P=f.data;if(this._def.returns instanceof Xr){let I=this;return qe(async function(...F){let U=new K([]),ue=await I._def.args.parseAsync(F,_).catch(gr=>{throw U.addIssue(m(F,gr)),U}),Oe=await Reflect.apply(P,this,ue);return await I._def.returns._def.type.parseAsync(Oe,_).catch(gr=>{throw U.addIssue(w(Oe,gr)),U})})}else{let I=this;return qe(function(...F){let U=I._def.args.safeParse(F,_);if(!U.success)throw new K([m(F,U.error)]);let ue=Reflect.apply(P,this,U.data),Oe=I._def.returns.safeParse(ue,_);if(!Oe.success)throw new K([w(ue,Oe.error)]);return Oe.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...i){return new Or({...this._def,args:Dt.create(i).rest(Kt.create())})}returns(i){return new Or({...this._def,returns:i})}implement(i){return this.parse(i)}strictImplement(i){return this.parse(i)}static create(i,f,m){return new Or({args:i||Dt.create([]).rest(Kt.create()),returns:f||Kt.create(),typeName:ie.ZodFunction,...le(m)})}},"ZodFunction");y(Or,"ZodFunction");var En=Y(class extends he{get schema(){return this._def.getter()}_parse(i){let{ctx:f}=this._processInputParams(i);return this._def.getter()._parse({data:f.data,path:f.path,parent:f})}},"ZodLazy");y(En,"ZodLazy"),En.create=(i,f)=>new En({getter:i,typeName:ie.ZodLazy,...le(f)});var Ir=Y(class extends he{_parse(i){if(i.data!==this._def.value){let f=this._getOrReturnCtx(i);return z(f,{received:f.data,code:A.invalid_literal,expected:this._def.value}),re}return{status:"valid",value:i.data}}get value(){return this._def.value}},"ZodLiteral");y(Ir,"ZodLiteral"),Ir.create=(i,f)=>new Ir({value:i,typeName:ie.ZodLiteral,...le(f)});function aa(i,f){return new Pr({values:i,typeName:ie.ZodEnum,...le(f)})}l(aa,"createZodEnum"),Y(aa,"createZodEnum"),y(aa,"createZodEnum");var Pr=Y(class extends he{constructor(){super(...arguments),pi.set(this,void 0)}_parse(i){if(typeof i.data!="string"){let f=this._getOrReturnCtx(i),m=this._def.values;return z(f,{expected:j.joinValues(m),received:f.parsedType,code:A.invalid_type}),re}if(bn(this,pi,"f")||Wr(this,pi,new Set(this._def.values),"f"),!bn(this,pi,"f").has(i.data)){let f=this._getOrReturnCtx(i),m=this._def.values;return z(f,{received:f.data,code:A.invalid_enum_value,options:m}),re}return qe(i.data)}get options(){return this._def.values}get enum(){let i={};for(let f of this._def.values)i[f]=f;return i}get Values(){let i={};for(let f of this._def.values)i[f]=f;return i}get Enum(){let i={};for(let f of this._def.values)i[f]=f;return i}extract(i,f=this._def){return Pr.create(i,{...this._def,...f})}exclude(i,f=this._def){return Pr.create(this.options.filter(m=>!i.includes(m)),{...this._def,...f})}},"ZodEnum");y(Pr,"ZodEnum"),pi=new WeakMap,Pr.create=aa;var Cn=Y(class extends he{constructor(){super(...arguments),hi.set(this,void 0)}_parse(i){let f=j.getValidEnumValues(this._def.values),m=this._getOrReturnCtx(i);if(m.parsedType!==R.string&&m.parsedType!==R.number){let w=j.objectValues(f);return z(m,{expected:j.joinValues(w),received:m.parsedType,code:A.invalid_type}),re}if(bn(this,hi,"f")||Wr(this,hi,new Set(j.getValidEnumValues(this._def.values)),"f"),!bn(this,hi,"f").has(i.data)){let w=j.objectValues(f);return z(m,{received:m.data,code:A.invalid_enum_value,options:w}),re}return qe(i.data)}get enum(){return this._def.values}},"ZodNativeEnum");y(Cn,"ZodNativeEnum"),hi=new WeakMap,Cn.create=(i,f)=>new Cn({values:i,typeName:ie.ZodNativeEnum,...le(f)});var Xr=Y(class extends he{unwrap(){return this._def.type}_parse(i){let{ctx:f}=this._processInputParams(i);if(f.parsedType!==R.promise&&f.common.async===!1)return z(f,{code:A.invalid_type,expected:R.promise,received:f.parsedType}),re;let m=f.parsedType===R.promise?f.data:Promise.resolve(f.data);return qe(m.then(w=>this._def.type.parseAsync(w,{path:f.path,errorMap:f.common.contextualErrorMap})))}},"ZodPromise");y(Xr,"ZodPromise"),Xr.create=(i,f)=>new Xr({type:i,typeName:ie.ZodPromise,...le(f)});var wt=Y(class extends he{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ie.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(i){let{status:f,ctx:m}=this._processInputParams(i),w=this._def.effect||null,_={addIssue:P=>{z(m,P),P.fatal?f.abort():f.dirty()},get path(){return m.path}};if(_.addIssue=_.addIssue.bind(_),w.type==="preprocess"){let P=w.transform(m.data,_);if(m.common.async)return Promise.resolve(P).then(async I=>{if(f.value==="aborted")return re;let F=await this._def.schema._parseAsync({data:I,path:m.path,parent:m});return F.status==="aborted"?re:F.status==="dirty"||f.value==="dirty"?Qt(F.value):F});{if(f.value==="aborted")return re;let I=this._def.schema._parseSync({data:P,path:m.path,parent:m});return I.status==="aborted"?re:I.status==="dirty"||f.value==="dirty"?Qt(I.value):I}}if(w.type==="refinement"){let P=y(I=>{let F=w.refinement(I,_);if(m.common.async)return Promise.resolve(F);if(F instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return I},"executeRefinement");if(m.common.async===!1){let I=this._def.schema._parseSync({data:m.data,path:m.path,parent:m});return I.status==="aborted"?re:(I.status==="dirty"&&f.dirty(),P(I.value),{status:f.value,value:I.value})}else return this._def.schema._parseAsync({data:m.data,path:m.path,parent:m}).then(I=>I.status==="aborted"?re:(I.status==="dirty"&&f.dirty(),P(I.value).then(()=>({status:f.value,value:I.value}))))}if(w.type==="transform")if(m.common.async===!1){let P=this._def.schema._parseSync({data:m.data,path:m.path,parent:m});if(!Ot(P))return P;let I=w.transform(P.value,_);if(I instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:f.value,value:I}}else return this._def.schema._parseAsync({data:m.data,path:m.path,parent:m}).then(P=>Ot(P)?Promise.resolve(w.transform(P.value,_)).then(I=>({status:f.value,value:I})):P);j.assertNever(w)}},"ZodEffects");y(wt,"ZodEffects"),wt.create=(i,f,m)=>new wt({schema:i,typeName:ie.ZodEffects,effect:f,...le(m)}),wt.createWithPreprocess=(i,f,m)=>new wt({schema:f,effect:{type:"preprocess",transform:i},typeName:ie.ZodEffects,...le(m)});var Lt=Y(class extends he{_parse(i){return this._getType(i)===R.undefined?qe(void 0):this._def.innerType._parse(i)}unwrap(){return this._def.innerType}},"ZodOptional");y(Lt,"ZodOptional"),Lt.create=(i,f)=>new Lt({innerType:i,typeName:ie.ZodOptional,...le(f)});var cr=Y(class extends he{_parse(i){return this._getType(i)===R.null?qe(null):this._def.innerType._parse(i)}unwrap(){return this._def.innerType}},"ZodNullable");y(cr,"ZodNullable"),cr.create=(i,f)=>new cr({innerType:i,typeName:ie.ZodNullable,...le(f)});var Sn=Y(class extends he{_parse(i){let{ctx:f}=this._processInputParams(i),m=f.data;return f.parsedType===R.undefined&&(m=this._def.defaultValue()),this._def.innerType._parse({data:m,path:f.path,parent:f})}removeDefault(){return this._def.innerType}},"ZodDefault");y(Sn,"ZodDefault"),Sn.create=(i,f)=>new Sn({innerType:i,typeName:ie.ZodDefault,defaultValue:typeof f.default=="function"?f.default:()=>f.default,...le(f)});var en=Y(class extends he{_parse(i){let{ctx:f}=this._processInputParams(i),m={...f,common:{...f.common,issues:[]}},w=this._def.innerType._parse({data:m.data,path:m.path,parent:{...m}});return bt(w)?w.then(_=>({status:"valid",value:_.status==="valid"?_.value:this._def.catchValue({get error(){return new K(m.common.issues)},input:m.data})})):{status:"valid",value:w.status==="valid"?w.value:this._def.catchValue({get error(){return new K(m.common.issues)},input:m.data})}}removeCatch(){return this._def.innerType}},"ZodCatch");y(en,"ZodCatch"),en.create=(i,f)=>new en({innerType:i,typeName:ie.ZodCatch,catchValue:typeof f.catch=="function"?f.catch:()=>f.catch,...le(f)});var xi=Y(class extends he{_parse(i){if(this._getType(i)!==R.nan){let m=this._getOrReturnCtx(i);return z(m,{code:A.invalid_type,expected:R.nan,received:m.parsedType}),re}return{status:"valid",value:i.data}}},"ZodNaN");y(xi,"ZodNaN"),xi.create=i=>new xi({typeName:ie.ZodNaN,...le(i)});var rc=Symbol("zod_brand"),oa=Y(class extends he{_parse(i){let{ctx:f}=this._processInputParams(i),m=f.data;return this._def.type._parse({data:m,path:f.path,parent:f})}unwrap(){return this._def.type}},"ZodBranded");y(oa,"ZodBranded");var Ei=Y(class extends he{_parse(i){let{status:f,ctx:m}=this._processInputParams(i);if(m.common.async)return y(async()=>{let _=await this._def.in._parseAsync({data:m.data,path:m.path,parent:m});return _.status==="aborted"?re:_.status==="dirty"?(f.dirty(),Qt(_.value)):this._def.out._parseAsync({data:_.value,path:m.path,parent:m})},"handleAsync")();{let w=this._def.in._parseSync({data:m.data,path:m.path,parent:m});return w.status==="aborted"?re:w.status==="dirty"?(f.dirty(),{status:"dirty",value:w.value}):this._def.out._parseSync({data:w.value,path:m.path,parent:m})}}static create(i,f){return new Ei({in:i,out:f,typeName:ie.ZodPipeline})}},"ZodPipeline");y(Ei,"ZodPipeline");var Tn=Y(class extends he{_parse(i){let f=this._def.innerType._parse(i),m=y(w=>(Ot(w)&&(w.value=Object.freeze(w.value)),w),"freeze");return bt(f)?f.then(w=>m(w)):m(f)}unwrap(){return this._def.innerType}},"ZodReadonly");y(Tn,"ZodReadonly"),Tn.create=(i,f)=>new Tn({innerType:i,typeName:ie.ZodReadonly,...le(f)});function sa(i,f={},m){return i?sr.create().superRefine((w,_)=>{var P,I;if(!i(w)){let F=typeof f=="function"?f(w):typeof f=="string"?{message:f}:f,U=(I=(P=F.fatal)!==null&&P!==void 0?P:m)!==null&&I!==void 0?I:!0,ue=typeof F=="string"?{message:F}:F;_.addIssue({code:"custom",...ue,fatal:U})}}):sr.create()}l(sa,"custom"),Y(sa,"custom"),y(sa,"custom");var la={object:Le.lazycreate},ie;(function(i){i.ZodString="ZodString",i.ZodNumber="ZodNumber",i.ZodNaN="ZodNaN",i.ZodBigInt="ZodBigInt",i.ZodBoolean="ZodBoolean",i.ZodDate="ZodDate",i.ZodSymbol="ZodSymbol",i.ZodUndefined="ZodUndefined",i.ZodNull="ZodNull",i.ZodAny="ZodAny",i.ZodUnknown="ZodUnknown",i.ZodNever="ZodNever",i.ZodVoid="ZodVoid",i.ZodArray="ZodArray",i.ZodObject="ZodObject",i.ZodUnion="ZodUnion",i.ZodDiscriminatedUnion="ZodDiscriminatedUnion",i.ZodIntersection="ZodIntersection",i.ZodTuple="ZodTuple",i.ZodRecord="ZodRecord",i.ZodMap="ZodMap",i.ZodSet="ZodSet",i.ZodFunction="ZodFunction",i.ZodLazy="ZodLazy",i.ZodLiteral="ZodLiteral",i.ZodEnum="ZodEnum",i.ZodEffects="ZodEffects",i.ZodNativeEnum="ZodNativeEnum",i.ZodOptional="ZodOptional",i.ZodNullable="ZodNullable",i.ZodDefault="ZodDefault",i.ZodCatch="ZodCatch",i.ZodPromise="ZodPromise",i.ZodBranded="ZodBranded",i.ZodPipeline="ZodPipeline",i.ZodReadonly="ZodReadonly"})(ie||(ie={}));var ca=y((i,f={message:`Input not instance of ${i.name}`})=>sa(m=>m instanceof i,f),"instanceOfType"),as=Nt.create,os=dt.create,nc=xi.create,ss=Yt.create,to=Tr.create,ls=or.create,ic=Qr.create,ac=Rr.create,oc=kr.create,sc=sr.create,cs=Kt.create,us=_t.create,ds=vi.create,ro=jt.create,lc=Le.create,fs=Le.strictCreate,ua=Yr.create,ps=ia.create,cc=xn.create,hs=Dt.create,ms=_i.create,no=wi.create,uc=Kr.create,gs=Or.create,io=En.create,ao=Ir.create,Rn=Pr.create,ys=Cn.create,vs=Xr.create,bs=wt.create,_s=Lt.create,ws=cr.create,xs=wt.createWithPreprocess,Es=Ei.create,dc=y(()=>as().optional(),"ostring"),fc=y(()=>os().optional(),"onumber"),pc=y(()=>to().optional(),"oboolean"),Cs={string:i=>Nt.create({...i,coerce:!0}),number:i=>dt.create({...i,coerce:!0}),boolean:i=>Tr.create({...i,coerce:!0}),bigint:i=>Yt.create({...i,coerce:!0}),date:i=>or.create({...i,coerce:!0})},hc=re,s=Object.freeze({__proto__:null,defaultErrorMap:ne,setErrorMap:xe,getErrorMap:Ne,makeIssue:Be,EMPTY_PATH:zr,addIssueToContext:z,ParseStatus:Qe,INVALID:re,DIRTY:Qt,OK:qe,isAborted:Cr,isDirty:vn,isValid:Ot,isAsync:bt,get util(){return j},get objectUtil(){return O},ZodParsedType:R,getParsedType:Z,ZodType:he,datetimeRegex:na,ZodString:Nt,ZodNumber:dt,ZodBigInt:Yt,ZodBoolean:Tr,ZodDate:or,ZodSymbol:Qr,ZodUndefined:Rr,ZodNull:kr,ZodAny:sr,ZodUnknown:Kt,ZodNever:_t,ZodVoid:vi,ZodArray:jt,ZodObject:Le,ZodUnion:Yr,ZodDiscriminatedUnion:ia,ZodIntersection:xn,ZodTuple:Dt,ZodRecord:_i,ZodMap:wi,ZodSet:Kr,ZodFunction:Or,ZodLazy:En,ZodLiteral:Ir,ZodEnum:Pr,ZodNativeEnum:Cn,ZodPromise:Xr,ZodEffects:wt,ZodTransformer:wt,ZodOptional:Lt,ZodNullable:cr,ZodDefault:Sn,ZodCatch:en,ZodNaN:xi,BRAND:rc,ZodBranded:oa,ZodPipeline:Ei,ZodReadonly:Tn,custom:sa,Schema:he,ZodSchema:he,late:la,get ZodFirstPartyTypeKind(){return ie},coerce:Cs,any:sc,array:ro,bigint:ss,boolean:to,date:ls,discriminatedUnion:ps,effect:bs,enum:Rn,function:gs,instanceof:ca,intersection:cc,lazy:io,literal:ao,map:no,nan:nc,nativeEnum:ys,never:us,null:oc,nullable:ws,number:os,object:lc,oboolean:pc,onumber:fc,optional:_s,ostring:dc,pipeline:Es,preprocess:xs,promise:vs,record:ms,set:uc,strictObject:fs,string:as,symbol:ic,transformer:bs,tuple:hs,undefined:ac,union:ua,unknown:cs,void:ds,NEVER:hc,ZodIssueCode:A,quotelessJson:X,ZodError:K}),Ci=Symbol("current"),kn=Symbol("previous"),tn=y((i,{ref:f,refType:m,param:w,header:_,...P}={})=>({...P,...i}),"mergeOpenApi");function da(i){if(typeof i.ZodType.prototype.openapi<"u")return;i.ZodType.prototype.openapi=function(P){let{zodOpenApi:I,...F}=this._def,U=new this.constructor({...F,zodOpenApi:{openapi:tn(P,I?.openapi)}});return U._def.zodOpenApi[Ci]=U,I&&(U._def.zodOpenApi[kn]=this),U};let f=i.ZodType.prototype.describe;i.ZodType.prototype.describe=function(...P){let I=f.apply(this,P),F=I._def;if(F.zodOpenApi){let U={...F.zodOpenApi};U.openapi=tn({description:P[0]},U.openapi),U[kn]=this,U[Ci]=I,F.zodOpenApi=U}else F.zodOpenApi={openapi:{description:P[0]},[Ci]:I};return I};let m=i.ZodObject.prototype.extend;i.ZodObject.prototype.extend=function(...P){let I=m.apply(this,P),F=I._def.zodOpenApi;if(F){let U={...F};U.openapi=tn({},U.openapi),U[kn]=this,I._def.zodOpenApi=U}else I._def.zodOpenApi={[kn]:this};return I};let w=i.ZodObject.prototype.omit;i.ZodObject.prototype.omit=function(...P){let I=w.apply(this,P),F=I._def.zodOpenApi;if(F){let U={...F};U.openapi=tn({},U.openapi),delete U[kn],delete U[Ci],I._def.zodOpenApi=U}return I};let _=i.ZodObject.prototype.pick;i.ZodObject.prototype.pick=function(...P){let I=_.apply(this,P),F=I._def.zodOpenApi;if(F){let U={...F};U.openapi=tn({},U.openapi),delete U[kn],delete U[Ci],I._def.zodOpenApi=U}return I}}l(da,"extendZodWithOpenApi"),Y(da,"extendZodWithOpenApi"),y(da,"extendZodWithOpenApi"),da(s);var Si=s.array(s.string().or(s.record(s.any()))),mc=s.object({type:s.string().optional(),narrative:s.string().optional()}),Ti=s.string().or(s.object({id:s.string(),type:s.string(),caption:s.string().optional()})),Ss=s.object({type:s.string().min(1).or(s.string().array().nonempty()),latitude:s.number(),longitude:s.number()}),je=s.object({type:s.string().min(1).or(s.string().array().nonempty()),addressCountry:s.string().optional(),addressCountryCode:s.string().optional(),addressRegion:s.string().optional(),addressLocality:s.string().optional(),streetAddress:s.string().optional(),postOfficeBoxNumber:s.string().optional(),postalCode:s.string().optional(),geo:Ss.optional()}),Pe=s.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(s.string()),oo=s.object({type:s.string().min(1).or(s.string().array().nonempty()),identifier:s.string(),identifierType:Pe}),An=s.string().or(s.object({id:s.string().optional(),type:s.string().or(s.string().array().nonempty().optional()),name:s.string().optional(),url:s.string().optional(),phone:s.string().optional(),description:s.string().optional(),endorsement:s.any().array().optional(),image:Ti.optional(),email:s.string().email().optional(),address:je.optional(),otherIdentifier:oo.array().optional(),official:s.string().optional(),parentOrg:s.any().optional(),familyName:s.string().optional(),givenName:s.string().optional(),additionalName:s.string().optional(),patronymicName:s.string().optional(),honorificPrefix:s.string().optional(),honorificSuffix:s.string().optional(),familyNamePrefix:s.string().optional(),dateOfBirth:s.string().optional()}).catchall(s.any())),fa=s.object({id:s.string().optional()}).catchall(s.any()),Ri=s.object({type:s.string(),id:s.string()}).catchall(s.any()),so=s.object({id:s.string(),type:s.string()}).catchall(s.any()),lo=s.object({id:s.string().optional(),type:s.string()}).catchall(s.any()),pa=s.object({type:s.string(),id:s.string().optional()}).catchall(s.any()),co=s.object({type:s.string().or(s.string().array().nonempty()),id:s.string().optional()}).catchall(s.any()),Me=s.object({"@context":Si,id:s.string().optional(),type:s.string().array().nonempty(),issuer:An,credentialSubject:fa.or(fa.array()),refreshService:lo.or(lo.array()).optional(),credentialSchema:so.or(so.array()).optional(),issuanceDate:s.string().optional(),expirationDate:s.string().optional(),credentialStatus:Ri.or(Ri.array()).optional(),name:s.string().optional(),description:s.string().optional(),validFrom:s.string().optional(),validUntil:s.string().optional(),status:Ri.or(Ri.array()).optional(),termsOfUse:pa.or(pa.array()).optional(),evidence:co.or(co.array()).optional()}).catchall(s.any()),ft=s.object({type:s.string(),created:s.string(),challenge:s.string().optional(),domain:s.string().optional(),nonce:s.string().optional(),proofPurpose:s.string(),verificationMethod:s.string(),jws:s.string().optional()}).catchall(s.any()),Mt=Me.extend({proof:ft.or(ft.array())}),uo=s.object({"@context":Si,id:s.string().optional(),type:s.string().or(s.string().array().nonempty()),verifiableCredential:Mt.or(Mt.array()).optional(),holder:s.string().optional()}).catchall(s.any()),ki=uo.extend({proof:ft.or(ft.array())}),nt=s.object({kty:s.string(),crv:s.string(),x:s.string(),y:s.string().optional(),n:s.string().optional(),d:s.string().optional()}),Ts=nt.omit({d:!0}).extend({d:s.string()}),fo=s.object({alg:s.string(),iv:s.string(),tag:s.string(),epk:nt.partial().optional(),kid:s.string().optional(),apv:s.string().optional(),apu:s.string().optional()}),po=s.object({header:fo,encrypted_key:s.string()}),ho=s.object({protected:s.string(),iv:s.string(),ciphertext:s.string(),tag:s.string(),aad:s.string().optional(),recipients:po.array().optional()}),ur=s.string().or(s.object({"@context":Si.optional(),id:s.string(),type:s.string(),controller:s.string(),publicKeyJwk:nt.optional(),publicKeyBase58:s.string().optional(),publicKeyMultibase:s.string().optional(),blockChainAccountId:s.string().optional()}).catchall(s.any())),mo=s.object({id:s.string(),type:s.string().or(s.string().array().nonempty()),serviceEndpoint:s.any().or(s.any().array().nonempty())}).catchall(s.any()),pt=s.object({"@context":Si,id:s.string(),alsoKnownAs:s.string().optional(),controller:s.string().or(s.string().array().nonempty()).optional(),verificationMethod:ur.array().optional(),authentication:ur.array().optional(),assertionMethod:ur.array().optional(),keyAgreement:ur.array().optional(),capabilityInvocation:ur.array().optional(),capabilityDelegation:ur.array().optional(),publicKey:ur.array().optional(),service:mo.array().optional(),proof:ft.or(ft.array()).optional()}).catchall(s.any()),Rs=s.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(s.string()),Xe=s.object({type:s.string().array().nonempty(),targetCode:s.string().optional(),targetDescription:s.string().optional(),targetName:s.string(),targetFramework:s.string().optional(),targetType:Rs.optional(),targetUrl:s.string()}),ks=s.enum(["Achievement","ApprenticeshipCertificate","Assessment","Assignment","AssociateDegree","Award","Badge","BachelorDegree","Certificate","CertificateOfCompletion","Certification","CommunityService","Competency","Course","CoCurricular","Degree","Diploma","DoctoralDegree","Fieldwork","GeneralEducationDevelopment","JourneymanCertificate","LearningProgram","License","Membership","ProfessionalDoctorate","QualityAssuranceCredential","MasterCertificate","MasterDegree","MicroCredential","ResearchDoctorate","SecondarySchoolDiploma"]),go=ks.or(s.string()),dr=s.object({id:s.string().optional(),narrative:s.string().optional()}).catchall(s.any()),Ai=s.object({id:s.string(),type:s.string().array().nonempty(),endorsementComment:s.string().optional()}),ha=Me.extend({credentialSubject:Ai,proof:ft.or(ft.array()).optional()}),De=s.object({id:s.string(),"@language":s.string().optional(),version:s.string().optional()}),fr=s.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(s.string()),ma=s.object({id:s.string(),type:s.string().array().nonempty(),alignment:Xe.array().optional(),description:s.string().optional(),level:s.string().optional(),name:s.string(),points:s.string().optional()}).catchall(s.any()),As=s.object({id:s.string(),type:s.string().array().nonempty(),alignment:Xe.array().optional(),allowedValue:s.string().array().optional(),name:s.string(),requiredLevel:s.string().optional(),requiredValue:s.string().optional(),resultType:fr,rubricCriterionLevel:ma.array().optional(),valueMax:s.string().optional(),valueMin:s.string().optional()}).catchall(s.any()),ga=s.object({id:s.string().optional(),type:s.string().array().nonempty(),alignment:Xe.array().optional(),achievementType:go.optional(),creator:An.optional(),creditsAvailable:s.number().optional(),criteria:dr,description:s.string(),endorsement:ha.array().optional(),fieldOfStudy:s.string().optional(),humanCode:s.string().optional(),image:Ti.optional(),"@language":s.string().optional(),name:s.string(),otherIdentifier:oo.array().optional(),related:De.array().optional(),resultDescription:As.array().optional(),specialization:s.string().optional(),tag:s.string().array().optional(),version:s.string().optional()}).catchall(s.any()),Os=s.object({type:s.string(),hashed:s.boolean(),identityHash:s.string(),identityType:s.string(),salt:s.string().optional()}),Is=s.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),Ps=s.object({type:s.string().array().nonempty(),achievedLevel:s.string().optional(),alignment:Xe.array().optional(),resultDescription:s.string().optional(),status:Is.optional(),value:s.string().optional()}).catchall(s.any()),ya=s.object({id:s.string().optional(),type:s.string().array().nonempty(),activityEndDate:s.string().optional(),activityStartDate:s.string().optional(),creditsEarned:s.number().optional(),achievement:ga.optional(),identifier:Os.array().optional(),image:Ti.optional(),licenseNumber:s.string().optional(),narrative:s.string().optional(),result:Ps.array().optional(),role:s.string().optional(),source:An.optional(),term:s.string().optional()}).catchall(s.any()),Oi=s.object({id:s.string().optional(),type:s.string().or(s.string().array().nonempty()),narrative:s.string().optional(),name:s.string().optional(),description:s.string().optional(),genre:s.string().optional(),audience:s.string().optional()}).catchall(s.any()),rn=Me.extend({name:s.string().optional(),description:s.string().optional(),image:Ti.optional(),credentialSubject:ya.or(ya.array()),endorsement:Me.array().optional(),evidence:Oi.array().optional()}),gc=rn.extend({proof:ft.or(ft.array())}),Vs=s.object({checks:s.string().array(),warnings:s.string().array(),errors:s.string().array()}),va=s.enum(["Success","Failed","Error"]),yo=va.enum,vo=s.object({check:s.string(),status:va,message:s.string().optional(),details:s.string().optional()}),Ns=s.object({title:s.string().optional(),createdAt:s.string().optional(),issuer:An.optional(),issuee:An.optional(),credentialSubject:fa.optional()}),yc=s.object({id:s.string(),uri:s.string()}).catchall(s.any()),bo=s.object({limit:s.number(),cursor:s.string().optional(),sort:s.string().optional()}),$e=s.object({cursor:s.string().optional(),hasMore:s.boolean()}),_o=s.object({encryptedRecord:ho,fields:s.string().array()}).catchall(s.any()),js=$e.extend({records:_o.array()}),st=_o.extend({id:s.string()}),wo=$e.extend({records:st.array()}),On=y(i=>{let f=i.match(/^\/(.*)\/([gimsuy]*)$/);if(!f)throw new Error("Invalid RegExp string format");return{pattern:f[1],flags:f[2]}},"parseRegexString"),xo=s.instanceof(RegExp).or(s.string().refine(i=>{try{return On(i),!0}catch{return!1}},{message:"Invalid RegExp string format. Must be in format '/pattern/flags'"}).transform(i=>{let{pattern:f,flags:m}=On(i);try{return new RegExp(f,m)}catch(w){throw new Error(`Invalid RegExp: ${w.message}`)}})),Eo=s.string().or(s.object({$in:s.string().array()})).or(s.object({$regex:xo})),fe=s.union([Eo,s.object({$or:Eo.array()})]);da(s);var Ds=s.object({backgroundColor:s.string().optional(),backgroundImage:s.string().optional(),fadeBackgroundImage:s.boolean().optional(),repeatBackgroundImage:s.boolean().optional(),fontColor:s.string().optional(),accentColor:s.string().optional(),accentFontColor:s.string().optional(),idBackgroundImage:s.string().optional(),fadeIdBackgroundImage:s.boolean().optional(),idBackgroundColor:s.string().optional(),repeatIdBackgroundImage:s.boolean().optional()}),Ut=s.object({profileId:s.string().min(3).max(40).describe("Unique, URL-safe identifier for the profile."),displayName:s.string().default("").describe("Human-readable display name for the profile."),shortBio:s.string().default("").describe("Short bio for the profile."),bio:s.string().default("").describe("Longer bio for the profile."),did:s.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),isPrivate:s.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),email:s.string().optional().describe("Contact email address for the profile. (deprecated)"),image:s.string().optional().describe("Profile image URL for the profile."),heroImage:s.string().optional().describe("Hero image URL for the profile."),websiteLink:s.string().optional().describe("Website link for the profile."),isServiceProfile:s.boolean().default(!1).optional().describe("Whether the profile is a service profile or not."),type:s.string().optional().describe('Profile type: e.g. "person", "organization", "service".'),notificationsWebhook:s.string().url().startsWith("http").optional().describe("URL to send notifications to."),display:Ds.optional().describe("Display settings for the profile."),highlightedCredentials:s.array(s.string()).max(5).optional().describe("Up to 5 unique boost URIs to highlight on the profile."),role:s.string().default("").optional().describe('Role of the profile: e.g. "teacher", "student".'),dob:s.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".'),country:s.string().optional().describe("Country for the profile."),approved:s.boolean().optional().describe("Approval status for the profile.")}),vc=s.object({profileId:fe,displayName:fe,shortBio:fe,bio:fe,email:fe,websiteLink:fe,isServiceProfile:s.boolean(),type:fe}).partial(),bc=$e.extend({records:Ut.array()}),In=s.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),Co=s.object({id:s.string(),created:s.string(),displayName:s.string().default("").optional(),shortBio:s.string().default("").optional(),bio:s.string().default("").optional(),email:s.string().optional(),image:s.string().optional(),heroImage:s.string().optional()}),_c=$e.extend({records:Co.extend({did:s.string()}).array()}),So=s.object({id:fe,displayName:fe,shortBio:fe,bio:fe,email:fe}).partial(),Ls=$e.extend({records:s.object({profile:Ut,manager:Co.extend({did:s.string()}).optional()}).array()}),Vr=s.object({uri:s.string(),to:s.string(),from:s.string(),sent:s.string().datetime(),received:s.string().datetime().optional(),metadata:s.record(s.unknown()).optional()}),Pn=s.object({role:s.string(),canEdit:s.boolean(),canIssue:s.boolean(),canRevoke:s.boolean(),canManagePermissions:s.boolean(),canIssueChildren:s.string(),canCreateChildren:s.string(),canEditChildren:s.string(),canRevokeChildren:s.string(),canManageChildrenPermissions:s.string(),canManageChildrenProfiles:s.boolean().default(!1).optional(),canViewAnalytics:s.boolean()}),Ms=s.object({role:fe,canEdit:s.boolean(),canIssue:s.boolean(),canRevoke:s.boolean(),canManagePermissions:s.boolean(),canIssueChildren:fe,canCreateChildren:fe,canEditChildren:fe,canRevokeChildren:fe,canManageChildrenPermissions:fe,canManageChildrenProfiles:s.boolean(),canViewAnalytics:s.boolean()}).partial(),ba=s.enum(["GRANT_PERMISSIONS","ADD_ADMIN","AUTO_CONNECT"]),Us=s.discriminatedUnion("type",[s.object({type:s.literal(ba.Values.GRANT_PERMISSIONS),data:s.object({claimUri:s.string(),targetUri:s.string(),permissions:Pn.partial()})}),s.object({type:s.literal(ba.Values.ADD_ADMIN),data:s.object({claimUri:s.string(),targetUri:s.string()})}),s.object({type:s.literal(ba.Values.AUTO_CONNECT),data:s.object({claimUri:s.string(),targetUri:s.string()})})]),Vn=s.object({type:fe,data:s.object({claimUri:fe,targetUri:fe,permissions:Ms})}).deepPartial(),xt=s.object({id:s.string(),createdAt:s.string(),updatedAt:s.string()}).and(Us),Bs=$e.extend({records:xt.array()}),_a=s.enum(["DRAFT","LIVE"]),Fs=s.object({uri:s.string(),name:s.string().optional(),type:s.string().optional(),category:s.string().optional(),status:_a.optional(),autoConnectRecipients:s.boolean().optional(),meta:s.record(s.any()).optional(),claimPermissions:Pn.optional(),allowAnyoneToCreateChildren:s.boolean().optional()}),Zs=s.object({uri:fe,name:fe,type:fe,category:fe,meta:s.record(fe),status:_a.or(s.object({$in:_a.array()})),autoConnectRecipients:s.boolean()}).partial(),wc=s.union([s.object({$or:Zs.array()}),Zs]),xc=$e.extend({records:Fs.array()}),pr=s.object({to:Ut,from:s.string(),received:s.string().optional(),uri:s.string().optional()}),S=$e.extend({records:pr.array()}),D=s.object({to:Ut,from:s.string(),received:s.string().optional(),boostUris:s.array(s.string()),credentialUris:s.array(s.string()).optional()}),N=$e.extend({records:D.array()}),G=s.object({endpoint:s.string(),name:s.string(),did:s.string().optional()}),pe=s.object({ttlSeconds:s.number().optional(),totalUses:s.number().optional()}),Te=s.object({endpoint:s.string()}),He=s.object({signingAuthority:Te,relationship:s.object({name:s.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:s.string(),isPrimary:s.boolean().optional()})}),Ve=s.object({boostUri:s.string(),signingAuthority:s.object({endpoint:s.string(),name:s.string()})}),wa=s.enum(["live","stale","withdrawn"]),qs=s.object({read:s.object({anonymize:s.boolean().optional(),credentials:s.object({categories:s.record(s.object({required:s.boolean(),defaultEnabled:s.boolean().optional()})).default({})}).default({}),personal:s.record(s.object({required:s.boolean(),defaultEnabled:s.boolean().optional()})).default({})}).default({}),write:s.object({credentials:s.object({categories:s.record(s.object({required:s.boolean(),defaultEnabled:s.boolean().optional()})).default({})}).default({}),personal:s.record(s.object({required:s.boolean(),defaultEnabled:s.boolean().optional()})).default({})}).default({})}),lt=s.object({contract:qs,owner:Ut,name:s.string(),subtitle:s.string().optional(),description:s.string().optional(),reasonForAccessing:s.string().optional(),image:s.string().optional(),uri:s.string(),needsGuardianConsent:s.boolean().optional(),redirectUrl:s.string().optional(),frontDoorBoostUri:s.string().optional(),createdAt:s.string(),updatedAt:s.string(),expiresAt:s.string().optional(),autoBoosts:s.string().array().optional(),writers:s.array(Ut).optional()}),xa=$e.extend({records:lt.omit({owner:!0}).array()}),$s=s.object({credentials:s.object({categories:s.record(s.string().array()).default({})}),personal:s.record(s.string()).default({}),date:s.string()}),Nn=$e.extend({records:$s.array()}),Ii=s.object({credentials:s.object({category:s.string(),uri:s.string()}).array(),personal:s.record(s.string()).default({}),date:s.string(),contractUri:s.string()}),Ea=$e.extend({records:Ii.array()}),Ae=s.object({sharing:s.boolean().optional(),shared:s.string().array().optional(),shareAll:s.boolean().optional(),shareUntil:s.string().optional()}),To=s.object({read:s.object({anonymize:s.boolean().optional(),credentials:s.object({shareAll:s.boolean().optional(),sharing:s.boolean().optional(),categories:s.record(Ae).default({})}).default({}),personal:s.record(s.string()).default({})}).default({}),write:s.object({credentials:s.object({categories:s.record(s.boolean()).default({})}).default({}),personal:s.record(s.boolean()).default({})}).default({}),deniedWriters:s.array(s.string()).optional()}),zs=$e.extend({records:s.object({expiresAt:s.string().optional(),oneTime:s.boolean().optional(),terms:To,contract:lt,uri:s.string(),consenter:Ut,status:wa}).array()}),Ca=s.object({read:s.object({anonymize:s.boolean().optional(),credentials:s.object({categories:s.record(s.object({required:s.boolean().optional()})).optional()}).optional(),personal:s.record(s.object({required:s.boolean().optional()})).optional()}).optional(),write:s.object({credentials:s.object({categories:s.record(s.object({required:s.boolean().optional()})).optional()}).optional(),personal:s.record(s.object({required:s.boolean().optional()})).optional()}).optional()}),Ec=s.object({anonymize:s.boolean().optional(),credentials:s.object({categories:s.record(s.boolean()).optional()}).optional(),personal:s.record(s.boolean()).optional()}),Cc=s.object({credentials:s.object({categories:s.record(s.boolean()).optional()}).optional(),personal:s.record(s.boolean()).optional(),id:fe.optional()}),Ws=s.object({read:s.object({anonymize:s.boolean().optional(),credentials:s.object({shareAll:s.boolean().optional(),sharing:s.boolean().optional(),categories:s.record(Ae.optional()).optional()}).optional(),personal:s.record(s.string()).optional()}).optional(),write:s.object({credentials:s.object({categories:s.record(s.boolean()).optional()}).optional(),personal:s.record(s.boolean()).optional()}).optional()}),nn=s.enum(["consent","update","sync","withdraw","write"]),Nr=s.object({terms:Ws.optional(),action:nn.or(nn.array()).optional(),date:s.object({$gt:s.string()}).or(s.object({$lt:s.string()})).or(s.object({$eq:s.string()})).optional(),expiresAt:s.object({$gt:s.string()}).or(s.object({$lt:s.string()})).or(s.object({$eq:s.string()})).optional(),oneTime:s.boolean().optional()}),jn=s.object({expiresAt:s.string().optional(),oneTime:s.boolean().optional(),terms:To.optional(),id:s.string(),action:nn,date:s.string(),uris:s.string().array().optional()}),Hs=$e.extend({records:jn.array()}),Pi=s.object({id:fe,name:fe,description:fe,sourceURI:fe,status:fe}).partial(),Gs=s.union([s.object({$or:Pi.array()}),Pi]),Ro=s.object({credentialUri:s.string(),termsUri:s.string(),contractUri:s.string(),boostUri:s.string(),category:s.string().optional(),date:s.string()}),Sa=$e.extend({records:Ro.array()}),ko=s.enum(["CONNECTION_REQUEST","CONNECTION_ACCEPTED","CREDENTIAL_RECEIVED","CREDENTIAL_ACCEPTED","BOOST_RECEIVED","BOOST_ACCEPTED","PRESENTATION_REQUEST","PRESENTATION_RECEIVED","CONSENT_FLOW_TRANSACTION","ISSUANCE_CLAIMED","ISSUANCE_DELIVERED","ISSUANCE_ERROR","PROFILE_PARENT_APPROVED"]),Dn=s.object({title:s.string().optional(),body:s.string().optional()}),jr=s.object({type:s.string(),value:s.string()}),Dr=s.enum(["PENDING","ISSUED","EXPIRED","DELIVERED","CLAIMED"]),Js=s.object({issuanceId:s.string(),status:Dr,recipient:s.object({contactMethod:jr.optional(),learnCardId:s.string().optional()}),timestamp:s.string().datetime().optional()}),Qs=s.object({vcUris:s.array(s.string()).optional(),vpUris:s.array(s.string()).optional(),transaction:jn.optional(),inbox:Js.optional(),metadata:s.record(s.unknown()).optional()}).passthrough(),Sc=s.object({type:ko,to:Ut.partial().and(s.object({did:s.string()})),from:Ut.partial().and(s.object({did:s.string()})),message:Dn.optional(),data:Qs.optional(),sent:s.string().datetime().optional(),webhookUrl:s.string().optional()}),Vi="auth-grant:",Ta=s.object({id:s.string(),name:s.string(),description:s.string().optional(),challenge:s.string().startsWith(Vi).min(10,{message:"Challenge is too short"}).max(100,{message:"Challenge is too long"}),status:s.enum(["revoked","active"],{required_error:"Status is required",invalid_type_error:"Status must be either active or revoked"}),scope:s.string(),createdAt:s.string().datetime({message:"createdAt must be a valid ISO 8601 datetime string"}),expiresAt:s.string().datetime({message:"expiresAt must be a valid ISO 8601 datetime string"}).nullish().optional()}),Ao=s.object({id:s.string()}).catchall(s.any()),Ys=s.enum(["active","revoked"]),Ks=s.object({id:fe,name:fe,description:fe,status:Ys}).partial(),Xs=s.object({id:s.string(),isVerified:s.boolean(),verifiedAt:s.string().optional(),isPrimary:s.boolean(),createdAt:s.string()}),Tc=s.discriminatedUnion("type",[s.object({type:s.literal("email"),value:s.string().email()}).merge(Xs),s.object({type:s.literal("phone"),value:s.string()}).merge(Xs)]),ze=s.object({isVerified:s.boolean().optional(),isPrimary:s.boolean().optional()}),et=s.discriminatedUnion("type",[s.object({type:s.literal("email"),value:s.string().email()}).merge(ze),s.object({type:s.literal("phone"),value:s.string()}).merge(ze)]),Oo=s.discriminatedUnion("type",[s.object({type:s.literal("email"),value:s.string().email()}),s.object({type:s.literal("phone"),value:s.string()})]),el=s.object({value:s.string(),type:s.enum(["email","phone"])}),tl=s.object({token:s.string()}),Rc=s.object({contactMethodId:s.string()}),Io=s.object({contactMethod:el,otpChallenge:s.string()}),Ni=s.object({sessionJwt:s.string()}),Ra=s.object({id:s.string(),credential:s.string(),isSigned:s.boolean(),currentStatus:Dr,isAccepted:s.boolean().optional(),expiresAt:s.string(),createdAt:s.string(),issuerDid:s.string(),webhookUrl:s.string().optional(),signingAuthority:s.object({endpoint:s.string().optional(),name:s.string().optional()}).optional()}),Ln=s.object({hasMore:s.boolean(),records:s.array(Ra),cursor:s.string().optional()}),ji=s.object({currentStatus:Dr,id:s.string(),isSigned:s.boolean(),isAccepted:s.boolean().optional(),issuerDid:s.string()}).partial(),Mn=s.object({endpoint:s.string().url(),name:s.string()}),ka=s.object({recipient:Oo.describe("The recipient of the credential"),credential:Mt.passthrough().or(ki.passthrough()).or(Me.passthrough()).describe("The credential to issue. If not signed, the users default signing authority will be used, or the specified signing authority in the configuration."),configuration:s.object({signingAuthority:Mn.optional().describe("The signing authority to use for the credential. If not provided, the users default signing authority will be used if the credential is not signed."),webhookUrl:s.string().url().optional().describe("The webhook URL to receive credential issuance events."),expiresInDays:s.number().min(1).max(365).optional().describe("The number of days the credential will be valid for."),delivery:s.object({suppress:s.boolean().optional().default(!1).describe("Whether to suppress delivery of the credential to the recipient. If true, the email/sms will not be sent to the recipient. Useful if you would like to manually send claim link to your users."),template:s.object({id:s.enum(["universal-inbox-claim"]).optional().describe("The template ID to use for the credential delivery. If not provided, the default template will be used."),model:s.object({issuer:s.object({name:s.string().optional().describe('The name of the organization (e.g., "State University").'),logoUrl:s.string().url().optional().describe("The URL of the organization's logo.")}).optional(),credential:s.object({name:s.string().optional().describe('The name of the credential (e.g., "Bachelor of Science").'),type:s.string().optional().describe('The type of the credential (e.g., "degree", "certificate").')}).optional(),recipient:s.object({name:s.string().optional().describe('The name of the recipient (e.g., "John Doe").')}).optional()}).describe("The template model to use for the credential delivery. Injects via template variables into email/sms templates. If not provided, the default template will be used.")}).optional().describe("The template to use for the credential delivery. If not provided, the default template will be used.")}).optional().describe("Configuration for the credential delivery i.e. email or SMS. When credentials are sent to a user who has a verified email or phone associated with their account, delivery is skipped, and the credential will be sent using in-app notifications. If not provided, the default configuration will be used.")}).optional().describe("Configuration for the credential issuance. If not provided, the default configuration will be used.")}),Un=s.object({issuanceId:s.string(),status:Dr,recipient:Oo,claimUrl:s.string().url().optional(),recipientDid:s.string().optional()}),kc=s.object({credential:Mt.passthrough().or(ki.passthrough()).or(Me.passthrough()).describe("The credential to issue."),configuration:s.object({publishableKey:s.string(),signingAuthorityName:s.string().optional()}).optional()}),Aa=s.union([s.string().regex(/^(?:(?:[a-zA-Z0-9-]{1,63}\.)+[a-zA-Z]{2,63}|localhost|\d{1,3}(?:\.\d{1,3}){3})(?::\d{1,5})?$/,{message:"Must be a valid domain (incl. subdomains), localhost, or IPv4, optionally with port"}),s.string().regex(/^https?:\/\/(?:(?:[a-zA-Z0-9-]{1,63}\.)+[a-zA-Z]{2,63}|localhost|\d{1,3}(?:\.\d{1,3}){3})(?::\d{1,5})?$/,{message:"Must be a valid http(s) origin"})]),rl=s.object({id:s.string(),name:s.string(),description:s.string().optional(),publishableKey:s.string(),whitelistedDomains:s.array(Aa).default([])}),Ac=s.object({name:s.string(),description:s.string().optional(),whitelistedDomains:s.array(Aa).default([])}),Oc=s.object({name:s.string().optional(),description:s.string().optional(),whitelistedDomains:s.array(Aa).optional(),rotatePublishableKey:s.boolean().optional()}),Oa=s.object({id:fe,name:fe,description:fe}).partial(),Di=$e.extend({records:rl.array()}),nl=s.object({token:s.string(),contactMethodId:s.string(),autoVerifyContactMethod:s.boolean().optional().default(!1),createdAt:s.string(),expiresAt:s.string(),used:s.boolean()}),v=s.object({id:s.string(),name:s.string().min(1),slug:s.string().min(1),createdAt:s.string().optional(),updatedAt:s.string().optional()}),Bt=s.enum(["active","archived"]),Bn=s.object({id:s.string(),statement:s.string(),description:s.string().optional(),code:s.string().optional(),icon:s.string().optional(),type:s.string().default("skill"),status:Bt.default("active"),frameworkId:s.string().optional(),createdAt:s.string().optional(),updatedAt:s.string().optional()}),ht=s.object({id:fe,statement:fe,description:fe,code:fe,type:fe,status:Bt.or(s.object({$in:Bt.array()}))}).partial(),Ee=s.union([s.object({$or:ht.array()}),ht]),Ia=s.enum(["active","archived"]),Po=s.object({id:s.string(),name:s.string(),description:s.string().optional(),image:s.string().optional(),sourceURI:s.string().url().optional(),status:Ia.default("active"),createdAt:s.string().optional(),updatedAt:s.string().optional()}),Ic=$e.extend({records:Po.array()}),Xt=Bn.extend({children:s.array(s.lazy(()=>Xt)),hasChildren:s.boolean(),childrenCursor:s.string().nullable().optional()}).openapi({ref:"SkillTreeNode"}),il=s.object({hasMore:s.boolean(),cursor:s.string().nullable(),records:s.array(Xt)}),an=s.lazy(()=>s.object({id:s.string().optional(),statement:s.string(),description:s.string().optional(),code:s.string().optional(),icon:s.string().optional(),type:s.string().optional(),status:Bt.optional(),children:s.array(an).optional()})).openapi({ref:"SkillTreeNodeInput"}),Pc=s.object({frameworkId:s.string()}),al=s.object({id:s.string().optional(),name:s.string().min(1),description:s.string().optional(),image:s.string().optional(),sourceURI:s.string().url().optional(),status:Ia.optional(),skills:s.array(an).optional(),boostUris:s.array(s.string()).optional()}),Vc=s.object({id:s.string(),name:s.string().min(1).optional(),description:s.string().optional(),image:s.string().optional(),sourceURI:s.string().url().optional(),status:Ia.optional()}).refine(i=>i.name!==void 0||i.description!==void 0||i.image!==void 0||i.sourceURI!==void 0||i.status!==void 0,{message:"At least one field must be provided to update",path:["name"]}),hr=s.object({id:s.string()}),Nc=s.object({frameworks:s.array(al.extend({skills:s.array(an).optional()})).min(1)}),jc=s.object({frameworkId:s.string(),profileId:s.string()}),Dc=s.object({frameworkId:s.string()}),Lc=Ut.array(),Mc=s.object({id:s.string()}),mr=s.object({slug:s.string().min(1),name:s.string().min(1)}),Uc=s.object({frameworkId:s.string(),skill:an,parentId:s.string().nullable().optional()}),Bc=s.object({frameworkId:s.string(),id:s.string(),statement:s.string().optional(),description:s.string().optional(),code:s.string().optional(),icon:s.string().optional(),type:s.string().optional(),status:Bt.optional()}).refine(i=>i.statement!==void 0||i.description!==void 0||i.code!==void 0||i.icon!==void 0||i.type!==void 0||i.status!==void 0,{message:"At least one field must be provided to update a skill",path:["statement"]}),ol=s.enum(["recursive","reparent"]),Fc=s.object({frameworkId:s.string(),id:s.string(),strategy:ol.optional().default("reparent")}),Zc=s.object({frameworkId:s.string(),skills:s.array(an).min(1),parentId:s.string().nullable().optional()}),on=s.object({frameworkId:s.string(),skills:s.array(an).min(0)}),qc=s.object({created:s.number().int().min(0),updated:s.number().int().min(0),deleted:s.number().int().min(0),unchanged:s.number().int().min(0),total:s.number().int().min(0)}),$c=s.object({frameworkId:s.string(),skillId:s.string().optional(),recursive:s.boolean().optional().default(!1),onlyCountCompetencies:s.boolean().optional().default(!1)}),Ft=s.object({count:s.number().int().min(0)}),zc=s.object({frameworkId:s.string()}),Wc=s.object({skills:s.array(Xt)}),Hc=s.object({frameworkId:s.string(),skillId:s.string()}),Gc=s.object({path:s.array(Bn)}),Jc=s.object({framework:Po,skills:il})}}),rw=Up({"../learn-card-types/dist/index.js"(n,r){"use strict";r.exports=tw()}}),nw=ew(rw());var zi=Y(n=>nw.JWEValidator.safeParse(n).success,"isEncrypted");var Re;(function(n){n.assertEqual=p=>p;function r(p){}l(r,"assertIs"),n.assertIs=r;function c(p){throw new Error}l(c,"assertNever"),n.assertNever=c,n.arrayToEnum=p=>{let g={};for(let y of p)g[y]=y;return g},n.getValidEnumValues=p=>{let g=n.objectKeys(p).filter(E=>typeof p[p[E]]!="number"),y={};for(let E of g)y[E]=p[E];return n.objectValues(y)},n.objectValues=p=>n.objectKeys(p).map(function(g){return p[g]}),n.objectKeys=typeof Object.keys=="function"?p=>Object.keys(p):p=>{let g=[];for(let y in p)Object.prototype.hasOwnProperty.call(p,y)&&g.push(y);return g},n.find=(p,g)=>{for(let y of p)if(g(y))return y},n.isInteger=typeof Number.isInteger=="function"?p=>Number.isInteger(p):p=>typeof p=="number"&&isFinite(p)&&Math.floor(p)===p;function d(p,g=" | "){return p.map(y=>typeof y=="string"?`'${y}'`:y).join(g)}l(d,"joinValues"),n.joinValues=d,n.jsonStringifyReplacer=(p,g)=>typeof g=="bigint"?g.toString():g})(Re||(Re={}));var dd;(function(n){n.mergeShapes=(r,c)=>({...r,...c})})(dd||(dd={}));var J=Re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Yn=l(n=>{switch(typeof n){case"undefined":return J.undefined;case"string":return J.string;case"number":return isNaN(n)?J.nan:J.number;case"boolean":return J.boolean;case"function":return J.function;case"bigint":return J.bigint;case"symbol":return J.symbol;case"object":return Array.isArray(n)?J.array:n===null?J.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?J.promise:typeof Map<"u"&&n instanceof Map?J.map:typeof Set<"u"&&n instanceof Set?J.set:typeof Date<"u"&&n instanceof Date?J.date:J.object;default:return J.unknown}},"getParsedType"),$=Re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),iw=l(n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),ut=class extends Error{constructor(r){super(),this.issues=[],this.addIssue=d=>{this.issues=[...this.issues,d]},this.addIssues=(d=[])=>{this.issues=[...this.issues,...d]};let c=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,c):this.__proto__=c,this.name="ZodError",this.issues=r}get errors(){return this.issues}format(r){let c=r||function(g){return g.message},d={_errors:[]},p=l(g=>{for(let y of g.issues)if(y.code==="invalid_union")y.unionErrors.map(p);else if(y.code==="invalid_return_type")p(y.returnTypeError);else if(y.code==="invalid_arguments")p(y.argumentsError);else if(y.path.length===0)d._errors.push(c(y));else{let E=d,T=0;for(;T<y.path.length;){let V=y.path[T];T===y.path.length-1?(E[V]=E[V]||{_errors:[]},E[V]._errors.push(c(y))):E[V]=E[V]||{_errors:[]},E=E[V],T++}}},"processError");return p(this),d}static assert(r){if(!(r instanceof ut))throw new Error(`Not a ZodError: ${r}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(r=c=>c.message){let c={},d=[];for(let p of this.issues)p.path.length>0?(c[p.path[0]]=c[p.path[0]]||[],c[p.path[0]].push(r(p))):d.push(r(p));return{formErrors:d,fieldErrors:c}}get formErrors(){return this.flatten()}};l(ut,"ZodError");ut.create=n=>new ut(n);var Ha=l((n,r)=>{let c;switch(n.code){case $.invalid_type:n.received===J.undefined?c="Required":c=`Expected ${n.expected}, received ${n.received}`;break;case $.invalid_literal:c=`Invalid literal value, expected ${JSON.stringify(n.expected,Re.jsonStringifyReplacer)}`;break;case $.unrecognized_keys:c=`Unrecognized key(s) in object: ${Re.joinValues(n.keys,", ")}`;break;case $.invalid_union:c="Invalid input";break;case $.invalid_union_discriminator:c=`Invalid discriminator value. Expected ${Re.joinValues(n.options)}`;break;case $.invalid_enum_value:c=`Invalid enum value. Expected ${Re.joinValues(n.options)}, received '${n.received}'`;break;case $.invalid_arguments:c="Invalid function arguments";break;case $.invalid_return_type:c="Invalid function return type";break;case $.invalid_date:c="Invalid date";break;case $.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(c=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(c=`${c} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?c=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?c=`Invalid input: must end with "${n.validation.endsWith}"`:Re.assertNever(n.validation):n.validation!=="regex"?c=`Invalid ${n.validation}`:c="Invalid";break;case $.too_small:n.type==="array"?c=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?c=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?c=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?c=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:c="Invalid input";break;case $.too_big:n.type==="array"?c=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?c=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?c=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?c=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?c=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:c="Invalid input";break;case $.custom:c="Invalid input";break;case $.invalid_intersection_types:c="Intersection results could not be merged";break;case $.not_multiple_of:c=`Number must be a multiple of ${n.multipleOf}`;break;case $.not_finite:c="Number must be finite";break;default:c=r.defaultError,Re.assertNever(n)}return{message:c}},"errorMap"),Zp=Ha;function aw(n){Zp=n}l(aw,"setErrorMap");function Wl(){return Zp}l(Wl,"getErrorMap");var Hl=l(n=>{let{data:r,path:c,errorMaps:d,issueData:p}=n,g=[...c,...p.path||[]],y={...p,path:g};if(p.message!==void 0)return{...p,path:g,message:p.message};let E="",T=d.filter(V=>!!V).slice().reverse();for(let V of T)E=V(y,{data:r,defaultError:E}).message;return{...p,path:g,message:E}},"makeIssue"),ow=[];function H(n,r){let c=Wl(),d=Hl({issueData:r,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,c,c===Ha?void 0:Ha].filter(p=>!!p)});n.common.issues.push(d)}l(H,"addIssueToContext");var Ke=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(r,c){let d=[];for(let p of c){if(p.status==="aborted")return de;p.status==="dirty"&&r.dirty(),d.push(p.value)}return{status:r.value,value:d}}static async mergeObjectAsync(r,c){let d=[];for(let p of c){let g=await p.key,y=await p.value;d.push({key:g,value:y})}return Ke.mergeObjectSync(r,d)}static mergeObjectSync(r,c){let d={};for(let p of c){let{key:g,value:y}=p;if(g.status==="aborted"||y.status==="aborted")return de;g.status==="dirty"&&r.dirty(),y.status==="dirty"&&r.dirty(),g.value!=="__proto__"&&(typeof y.value<"u"||p.alwaysSet)&&(d[g.value]=y.value)}return{status:r.value,value:d}}};l(Ke,"ParseStatus");var de=Object.freeze({status:"aborted"}),za=l(n=>({status:"dirty",value:n}),"DIRTY"),vt=l(n=>({status:"valid",value:n}),"OK"),fd=l(n=>n.status==="aborted","isAborted"),pd=l(n=>n.status==="dirty","isDirty"),Qo=l(n=>n.status==="valid","isValid"),Yo=l(n=>typeof Promise<"u"&&n instanceof Promise,"isAsync");function Gl(n,r,c,d){if(c==="a"&&!d)throw new TypeError("Private accessor was defined without a getter");if(typeof r=="function"?n!==r||!d:!r.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return c==="m"?d:c==="a"?d.call(n):d?d.value:r.get(n)}l(Gl,"__classPrivateFieldGet");function qp(n,r,c,d,p){if(d==="m")throw new TypeError("Private method is not writable");if(d==="a"&&!p)throw new TypeError("Private accessor was defined without a setter");if(typeof r=="function"?n!==r||!p:!r.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return d==="a"?p.call(n,c):p?p.value=c:r.set(n,c),c}l(qp,"__classPrivateFieldSet");var te;(function(n){n.errToObj=r=>typeof r=="string"?{message:r}:r||{},n.toString=r=>typeof r=="string"?r:r?.message})(te||(te={}));var Go,Jo,Wt=class{constructor(r,c,d,p){this._cachedPath=[],this.parent=r,this.data=c,this._path=d,this._key=p}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};l(Wt,"ParseInputLazyPath");var Bp=l((n,r)=>{if(Qo(r))return{success:!0,data:r.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let c=new ut(n.common.issues);return this._error=c,this._error}}},"handleResult");function ve(n){if(!n)return{};let{errorMap:r,invalid_type_error:c,required_error:d,description:p}=n;if(r&&(c||d))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return r?{errorMap:r,description:p}:{errorMap:l((y,E)=>{var T,V;let{message:q}=n;return y.code==="invalid_enum_value"?{message:q??E.defaultError}:typeof E.data>"u"?{message:(T=q??d)!==null&&T!==void 0?T:E.defaultError}:y.code!=="invalid_type"?{message:E.defaultError}:{message:(V=q??c)!==null&&V!==void 0?V:E.defaultError}},"customMap"),description:p}}l(ve,"processCreateParams");var ge=class{constructor(r){this.spa=this.safeParseAsync,this._def=r,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(r){return Yn(r.data)}_getOrReturnCtx(r,c){return c||{common:r.parent.common,data:r.data,parsedType:Yn(r.data),schemaErrorMap:this._def.errorMap,path:r.path,parent:r.parent}}_processInputParams(r){return{status:new Ke,ctx:{common:r.parent.common,data:r.data,parsedType:Yn(r.data),schemaErrorMap:this._def.errorMap,path:r.path,parent:r.parent}}}_parseSync(r){let c=this._parse(r);if(Yo(c))throw new Error("Synchronous parse encountered promise.");return c}_parseAsync(r){let c=this._parse(r);return Promise.resolve(c)}parse(r,c){let d=this.safeParse(r,c);if(d.success)return d.data;throw d.error}safeParse(r,c){var d;let p={common:{issues:[],async:(d=c?.async)!==null&&d!==void 0?d:!1,contextualErrorMap:c?.errorMap},path:c?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:Yn(r)},g=this._parseSync({data:r,path:p.path,parent:p});return Bp(p,g)}async parseAsync(r,c){let d=await this.safeParseAsync(r,c);if(d.success)return d.data;throw d.error}async safeParseAsync(r,c){let d={common:{issues:[],contextualErrorMap:c?.errorMap,async:!0},path:c?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:Yn(r)},p=this._parse({data:r,path:d.path,parent:d}),g=await(Yo(p)?p:Promise.resolve(p));return Bp(d,g)}refine(r,c){let d=l(p=>typeof c=="string"||typeof c>"u"?{message:c}:typeof c=="function"?c(p):c,"getIssueProperties");return this._refinement((p,g)=>{let y=r(p),E=l(()=>g.addIssue({code:$.custom,...d(p)}),"setError");return typeof Promise<"u"&&y instanceof Promise?y.then(T=>T?!0:(E(),!1)):y?!0:(E(),!1)})}refinement(r,c){return this._refinement((d,p)=>r(d)?!0:(p.addIssue(typeof c=="function"?c(d,p):c),!1))}_refinement(r){return new At({schema:this,typeName:ce.ZodEffects,effect:{type:"refinement",refinement:r}})}superRefine(r){return this._refinement(r)}optional(){return Gt.create(this,this._def)}nullable(){return xr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return kt.create(this,this._def)}promise(){return yn.create(this,this._def)}or(r){return ti.create([this,r],this._def)}and(r){return ri.create(this,r,this._def)}transform(r){return new At({...ve(this._def),schema:this,typeName:ce.ZodEffects,effect:{type:"transform",transform:r}})}default(r){let c=typeof r=="function"?r:()=>r;return new si({...ve(this._def),innerType:this,defaultValue:c,typeName:ce.ZodDefault})}brand(){return new Wa({typeName:ce.ZodBranded,type:this,...ve(this._def)})}catch(r){let c=typeof r=="function"?r:()=>r;return new li({...ve(this._def),innerType:this,catchValue:c,typeName:ce.ZodCatch})}describe(r){let c=this.constructor;return new c({...this._def,description:r})}pipe(r){return ci.create(this,r)}readonly(){return ui.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};l(ge,"ZodType");var sw=/^c[^\s-]{8,}$/i,lw=/^[0-9a-z]+$/,cw=/^[0-9A-HJKMNP-TV-Z]{26}$/,uw=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,dw=/^[a-z0-9_-]{21}$/i,fw=/^[-+]?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)?)??$/,pw=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,hw="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",ud,mw=/^(?:(?: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])$/,gw=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,yw=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,$p="((\\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])))",vw=new RegExp(`^${$p}$`);function zp(n){let r="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return n.precision?r=`${r}\\.\\d{${n.precision}}`:n.precision==null&&(r=`${r}(\\.\\d+)?`),r}l(zp,"timeRegexSource");function bw(n){return new RegExp(`^${zp(n)}$`)}l(bw,"timeRegex");function Wp(n){let r=`${$p}T${zp(n)}`,c=[];return c.push(n.local?"Z?":"Z"),n.offset&&c.push("([+-]\\d{2}:?\\d{2})"),r=`${r}(${c.join("|")})`,new RegExp(`^${r}$`)}l(Wp,"datetimeRegex");function _w(n,r){return!!((r==="v4"||!r)&&mw.test(n)||(r==="v6"||!r)&&gw.test(n))}l(_w,"isValidIP");var Rt=class extends ge{_parse(r){if(this._def.coerce&&(r.data=String(r.data)),this._getType(r)!==J.string){let g=this._getOrReturnCtx(r);return H(g,{code:$.invalid_type,expected:J.string,received:g.parsedType}),de}let d=new Ke,p;for(let g of this._def.checks)if(g.kind==="min")r.data.length<g.value&&(p=this._getOrReturnCtx(r,p),H(p,{code:$.too_small,minimum:g.value,type:"string",inclusive:!0,exact:!1,message:g.message}),d.dirty());else if(g.kind==="max")r.data.length>g.value&&(p=this._getOrReturnCtx(r,p),H(p,{code:$.too_big,maximum:g.value,type:"string",inclusive:!0,exact:!1,message:g.message}),d.dirty());else if(g.kind==="length"){let y=r.data.length>g.value,E=r.data.length<g.value;(y||E)&&(p=this._getOrReturnCtx(r,p),y?H(p,{code:$.too_big,maximum:g.value,type:"string",inclusive:!0,exact:!0,message:g.message}):E&&H(p,{code:$.too_small,minimum:g.value,type:"string",inclusive:!0,exact:!0,message:g.message}),d.dirty())}else if(g.kind==="email")pw.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"email",code:$.invalid_string,message:g.message}),d.dirty());else if(g.kind==="emoji")ud||(ud=new RegExp(hw,"u")),ud.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"emoji",code:$.invalid_string,message:g.message}),d.dirty());else if(g.kind==="uuid")uw.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"uuid",code:$.invalid_string,message:g.message}),d.dirty());else if(g.kind==="nanoid")dw.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"nanoid",code:$.invalid_string,message:g.message}),d.dirty());else if(g.kind==="cuid")sw.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"cuid",code:$.invalid_string,message:g.message}),d.dirty());else if(g.kind==="cuid2")lw.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"cuid2",code:$.invalid_string,message:g.message}),d.dirty());else if(g.kind==="ulid")cw.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"ulid",code:$.invalid_string,message:g.message}),d.dirty());else if(g.kind==="url")try{new URL(r.data)}catch{p=this._getOrReturnCtx(r,p),H(p,{validation:"url",code:$.invalid_string,message:g.message}),d.dirty()}else g.kind==="regex"?(g.regex.lastIndex=0,g.regex.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"regex",code:$.invalid_string,message:g.message}),d.dirty())):g.kind==="trim"?r.data=r.data.trim():g.kind==="includes"?r.data.includes(g.value,g.position)||(p=this._getOrReturnCtx(r,p),H(p,{code:$.invalid_string,validation:{includes:g.value,position:g.position},message:g.message}),d.dirty()):g.kind==="toLowerCase"?r.data=r.data.toLowerCase():g.kind==="toUpperCase"?r.data=r.data.toUpperCase():g.kind==="startsWith"?r.data.startsWith(g.value)||(p=this._getOrReturnCtx(r,p),H(p,{code:$.invalid_string,validation:{startsWith:g.value},message:g.message}),d.dirty()):g.kind==="endsWith"?r.data.endsWith(g.value)||(p=this._getOrReturnCtx(r,p),H(p,{code:$.invalid_string,validation:{endsWith:g.value},message:g.message}),d.dirty()):g.kind==="datetime"?Wp(g).test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{code:$.invalid_string,validation:"datetime",message:g.message}),d.dirty()):g.kind==="date"?vw.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{code:$.invalid_string,validation:"date",message:g.message}),d.dirty()):g.kind==="time"?bw(g).test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{code:$.invalid_string,validation:"time",message:g.message}),d.dirty()):g.kind==="duration"?fw.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"duration",code:$.invalid_string,message:g.message}),d.dirty()):g.kind==="ip"?_w(r.data,g.version)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"ip",code:$.invalid_string,message:g.message}),d.dirty()):g.kind==="base64"?yw.test(r.data)||(p=this._getOrReturnCtx(r,p),H(p,{validation:"base64",code:$.invalid_string,message:g.message}),d.dirty()):Re.assertNever(g);return{status:d.value,value:r.data}}_regex(r,c,d){return this.refinement(p=>r.test(p),{validation:c,code:$.invalid_string,...te.errToObj(d)})}_addCheck(r){return new Rt({...this._def,checks:[...this._def.checks,r]})}email(r){return this._addCheck({kind:"email",...te.errToObj(r)})}url(r){return this._addCheck({kind:"url",...te.errToObj(r)})}emoji(r){return this._addCheck({kind:"emoji",...te.errToObj(r)})}uuid(r){return this._addCheck({kind:"uuid",...te.errToObj(r)})}nanoid(r){return this._addCheck({kind:"nanoid",...te.errToObj(r)})}cuid(r){return this._addCheck({kind:"cuid",...te.errToObj(r)})}cuid2(r){return this._addCheck({kind:"cuid2",...te.errToObj(r)})}ulid(r){return this._addCheck({kind:"ulid",...te.errToObj(r)})}base64(r){return this._addCheck({kind:"base64",...te.errToObj(r)})}ip(r){return this._addCheck({kind:"ip",...te.errToObj(r)})}datetime(r){var c,d;return typeof r=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:r}):this._addCheck({kind:"datetime",precision:typeof r?.precision>"u"?null:r?.precision,offset:(c=r?.offset)!==null&&c!==void 0?c:!1,local:(d=r?.local)!==null&&d!==void 0?d:!1,...te.errToObj(r?.message)})}date(r){return this._addCheck({kind:"date",message:r})}time(r){return typeof r=="string"?this._addCheck({kind:"time",precision:null,message:r}):this._addCheck({kind:"time",precision:typeof r?.precision>"u"?null:r?.precision,...te.errToObj(r?.message)})}duration(r){return this._addCheck({kind:"duration",...te.errToObj(r)})}regex(r,c){return this._addCheck({kind:"regex",regex:r,...te.errToObj(c)})}includes(r,c){return this._addCheck({kind:"includes",value:r,position:c?.position,...te.errToObj(c?.message)})}startsWith(r,c){return this._addCheck({kind:"startsWith",value:r,...te.errToObj(c)})}endsWith(r,c){return this._addCheck({kind:"endsWith",value:r,...te.errToObj(c)})}min(r,c){return this._addCheck({kind:"min",value:r,...te.errToObj(c)})}max(r,c){return this._addCheck({kind:"max",value:r,...te.errToObj(c)})}length(r,c){return this._addCheck({kind:"length",value:r,...te.errToObj(c)})}nonempty(r){return this.min(1,te.errToObj(r))}trim(){return new Rt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Rt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Rt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(r=>r.kind==="datetime")}get isDate(){return!!this._def.checks.find(r=>r.kind==="date")}get isTime(){return!!this._def.checks.find(r=>r.kind==="time")}get isDuration(){return!!this._def.checks.find(r=>r.kind==="duration")}get isEmail(){return!!this._def.checks.find(r=>r.kind==="email")}get isURL(){return!!this._def.checks.find(r=>r.kind==="url")}get isEmoji(){return!!this._def.checks.find(r=>r.kind==="emoji")}get isUUID(){return!!this._def.checks.find(r=>r.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(r=>r.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(r=>r.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(r=>r.kind==="cuid2")}get isULID(){return!!this._def.checks.find(r=>r.kind==="ulid")}get isIP(){return!!this._def.checks.find(r=>r.kind==="ip")}get isBase64(){return!!this._def.checks.find(r=>r.kind==="base64")}get minLength(){let r=null;for(let c of this._def.checks)c.kind==="min"&&(r===null||c.value>r)&&(r=c.value);return r}get maxLength(){let r=null;for(let c of this._def.checks)c.kind==="max"&&(r===null||c.value<r)&&(r=c.value);return r}};l(Rt,"ZodString");Rt.create=n=>{var r;return new Rt({checks:[],typeName:ce.ZodString,coerce:(r=n?.coerce)!==null&&r!==void 0?r:!1,...ve(n)})};function ww(n,r){let c=(n.toString().split(".")[1]||"").length,d=(r.toString().split(".")[1]||"").length,p=c>d?c:d,g=parseInt(n.toFixed(p).replace(".","")),y=parseInt(r.toFixed(p).replace(".",""));return g%y/Math.pow(10,p)}l(ww,"floatSafeRemainder");var br=class extends ge{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(r){if(this._def.coerce&&(r.data=Number(r.data)),this._getType(r)!==J.number){let g=this._getOrReturnCtx(r);return H(g,{code:$.invalid_type,expected:J.number,received:g.parsedType}),de}let d,p=new Ke;for(let g of this._def.checks)g.kind==="int"?Re.isInteger(r.data)||(d=this._getOrReturnCtx(r,d),H(d,{code:$.invalid_type,expected:"integer",received:"float",message:g.message}),p.dirty()):g.kind==="min"?(g.inclusive?r.data<g.value:r.data<=g.value)&&(d=this._getOrReturnCtx(r,d),H(d,{code:$.too_small,minimum:g.value,type:"number",inclusive:g.inclusive,exact:!1,message:g.message}),p.dirty()):g.kind==="max"?(g.inclusive?r.data>g.value:r.data>=g.value)&&(d=this._getOrReturnCtx(r,d),H(d,{code:$.too_big,maximum:g.value,type:"number",inclusive:g.inclusive,exact:!1,message:g.message}),p.dirty()):g.kind==="multipleOf"?ww(r.data,g.value)!==0&&(d=this._getOrReturnCtx(r,d),H(d,{code:$.not_multiple_of,multipleOf:g.value,message:g.message}),p.dirty()):g.kind==="finite"?Number.isFinite(r.data)||(d=this._getOrReturnCtx(r,d),H(d,{code:$.not_finite,message:g.message}),p.dirty()):Re.assertNever(g);return{status:p.value,value:r.data}}gte(r,c){return this.setLimit("min",r,!0,te.toString(c))}gt(r,c){return this.setLimit("min",r,!1,te.toString(c))}lte(r,c){return this.setLimit("max",r,!0,te.toString(c))}lt(r,c){return this.setLimit("max",r,!1,te.toString(c))}setLimit(r,c,d,p){return new br({...this._def,checks:[...this._def.checks,{kind:r,value:c,inclusive:d,message:te.toString(p)}]})}_addCheck(r){return new br({...this._def,checks:[...this._def.checks,r]})}int(r){return this._addCheck({kind:"int",message:te.toString(r)})}positive(r){return this._addCheck({kind:"min",value:0,inclusive:!1,message:te.toString(r)})}negative(r){return this._addCheck({kind:"max",value:0,inclusive:!1,message:te.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:0,inclusive:!0,message:te.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:0,inclusive:!0,message:te.toString(r)})}multipleOf(r,c){return this._addCheck({kind:"multipleOf",value:r,message:te.toString(c)})}finite(r){return this._addCheck({kind:"finite",message:te.toString(r)})}safe(r){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:te.toString(r)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:te.toString(r)})}get minValue(){let r=null;for(let c of this._def.checks)c.kind==="min"&&(r===null||c.value>r)&&(r=c.value);return r}get maxValue(){let r=null;for(let c of this._def.checks)c.kind==="max"&&(r===null||c.value<r)&&(r=c.value);return r}get isInt(){return!!this._def.checks.find(r=>r.kind==="int"||r.kind==="multipleOf"&&Re.isInteger(r.value))}get isFinite(){let r=null,c=null;for(let d of this._def.checks){if(d.kind==="finite"||d.kind==="int"||d.kind==="multipleOf")return!0;d.kind==="min"?(c===null||d.value>c)&&(c=d.value):d.kind==="max"&&(r===null||d.value<r)&&(r=d.value)}return Number.isFinite(c)&&Number.isFinite(r)}};l(br,"ZodNumber");br.create=n=>new br({checks:[],typeName:ce.ZodNumber,coerce:n?.coerce||!1,...ve(n)});var _r=class extends ge{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(r){if(this._def.coerce&&(r.data=BigInt(r.data)),this._getType(r)!==J.bigint){let g=this._getOrReturnCtx(r);return H(g,{code:$.invalid_type,expected:J.bigint,received:g.parsedType}),de}let d,p=new Ke;for(let g of this._def.checks)g.kind==="min"?(g.inclusive?r.data<g.value:r.data<=g.value)&&(d=this._getOrReturnCtx(r,d),H(d,{code:$.too_small,type:"bigint",minimum:g.value,inclusive:g.inclusive,message:g.message}),p.dirty()):g.kind==="max"?(g.inclusive?r.data>g.value:r.data>=g.value)&&(d=this._getOrReturnCtx(r,d),H(d,{code:$.too_big,type:"bigint",maximum:g.value,inclusive:g.inclusive,message:g.message}),p.dirty()):g.kind==="multipleOf"?r.data%g.value!==BigInt(0)&&(d=this._getOrReturnCtx(r,d),H(d,{code:$.not_multiple_of,multipleOf:g.value,message:g.message}),p.dirty()):Re.assertNever(g);return{status:p.value,value:r.data}}gte(r,c){return this.setLimit("min",r,!0,te.toString(c))}gt(r,c){return this.setLimit("min",r,!1,te.toString(c))}lte(r,c){return this.setLimit("max",r,!0,te.toString(c))}lt(r,c){return this.setLimit("max",r,!1,te.toString(c))}setLimit(r,c,d,p){return new _r({...this._def,checks:[...this._def.checks,{kind:r,value:c,inclusive:d,message:te.toString(p)}]})}_addCheck(r){return new _r({...this._def,checks:[...this._def.checks,r]})}positive(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:te.toString(r)})}negative(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:te.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:te.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:te.toString(r)})}multipleOf(r,c){return this._addCheck({kind:"multipleOf",value:r,message:te.toString(c)})}get minValue(){let r=null;for(let c of this._def.checks)c.kind==="min"&&(r===null||c.value>r)&&(r=c.value);return r}get maxValue(){let r=null;for(let c of this._def.checks)c.kind==="max"&&(r===null||c.value<r)&&(r=c.value);return r}};l(_r,"ZodBigInt");_r.create=n=>{var r;return new _r({checks:[],typeName:ce.ZodBigInt,coerce:(r=n?.coerce)!==null&&r!==void 0?r:!1,...ve(n)})};var Kn=class extends ge{_parse(r){if(this._def.coerce&&(r.data=Boolean(r.data)),this._getType(r)!==J.boolean){let d=this._getOrReturnCtx(r);return H(d,{code:$.invalid_type,expected:J.boolean,received:d.parsedType}),de}return vt(r.data)}};l(Kn,"ZodBoolean");Kn.create=n=>new Kn({typeName:ce.ZodBoolean,coerce:n?.coerce||!1,...ve(n)});var Br=class extends ge{_parse(r){if(this._def.coerce&&(r.data=new Date(r.data)),this._getType(r)!==J.date){let g=this._getOrReturnCtx(r);return H(g,{code:$.invalid_type,expected:J.date,received:g.parsedType}),de}if(isNaN(r.data.getTime())){let g=this._getOrReturnCtx(r);return H(g,{code:$.invalid_date}),de}let d=new Ke,p;for(let g of this._def.checks)g.kind==="min"?r.data.getTime()<g.value&&(p=this._getOrReturnCtx(r,p),H(p,{code:$.too_small,message:g.message,inclusive:!0,exact:!1,minimum:g.value,type:"date"}),d.dirty()):g.kind==="max"?r.data.getTime()>g.value&&(p=this._getOrReturnCtx(r,p),H(p,{code:$.too_big,message:g.message,inclusive:!0,exact:!1,maximum:g.value,type:"date"}),d.dirty()):Re.assertNever(g);return{status:d.value,value:new Date(r.data.getTime())}}_addCheck(r){return new Br({...this._def,checks:[...this._def.checks,r]})}min(r,c){return this._addCheck({kind:"min",value:r.getTime(),message:te.toString(c)})}max(r,c){return this._addCheck({kind:"max",value:r.getTime(),message:te.toString(c)})}get minDate(){let r=null;for(let c of this._def.checks)c.kind==="min"&&(r===null||c.value>r)&&(r=c.value);return r!=null?new Date(r):null}get maxDate(){let r=null;for(let c of this._def.checks)c.kind==="max"&&(r===null||c.value<r)&&(r=c.value);return r!=null?new Date(r):null}};l(Br,"ZodDate");Br.create=n=>new Br({checks:[],coerce:n?.coerce||!1,typeName:ce.ZodDate,...ve(n)});var Wi=class extends ge{_parse(r){if(this._getType(r)!==J.symbol){let d=this._getOrReturnCtx(r);return H(d,{code:$.invalid_type,expected:J.symbol,received:d.parsedType}),de}return vt(r.data)}};l(Wi,"ZodSymbol");Wi.create=n=>new Wi({typeName:ce.ZodSymbol,...ve(n)});var Xn=class extends ge{_parse(r){if(this._getType(r)!==J.undefined){let d=this._getOrReturnCtx(r);return H(d,{code:$.invalid_type,expected:J.undefined,received:d.parsedType}),de}return vt(r.data)}};l(Xn,"ZodUndefined");Xn.create=n=>new Xn({typeName:ce.ZodUndefined,...ve(n)});var ei=class extends ge{_parse(r){if(this._getType(r)!==J.null){let d=this._getOrReturnCtx(r);return H(d,{code:$.invalid_type,expected:J.null,received:d.parsedType}),de}return vt(r.data)}};l(ei,"ZodNull");ei.create=n=>new ei({typeName:ce.ZodNull,...ve(n)});var mn=class extends ge{constructor(){super(...arguments),this._any=!0}_parse(r){return vt(r.data)}};l(mn,"ZodAny");mn.create=n=>new mn({typeName:ce.ZodAny,...ve(n)});var Fr=class extends ge{constructor(){super(...arguments),this._unknown=!0}_parse(r){return vt(r.data)}};l(Fr,"ZodUnknown");Fr.create=n=>new Fr({typeName:ce.ZodUnknown,...ve(n)});var ir=class extends ge{_parse(r){let c=this._getOrReturnCtx(r);return H(c,{code:$.invalid_type,expected:J.never,received:c.parsedType}),de}};l(ir,"ZodNever");ir.create=n=>new ir({typeName:ce.ZodNever,...ve(n)});var Hi=class extends ge{_parse(r){if(this._getType(r)!==J.undefined){let d=this._getOrReturnCtx(r);return H(d,{code:$.invalid_type,expected:J.void,received:d.parsedType}),de}return vt(r.data)}};l(Hi,"ZodVoid");Hi.create=n=>new Hi({typeName:ce.ZodVoid,...ve(n)});var kt=class extends ge{_parse(r){let{ctx:c,status:d}=this._processInputParams(r),p=this._def;if(c.parsedType!==J.array)return H(c,{code:$.invalid_type,expected:J.array,received:c.parsedType}),de;if(p.exactLength!==null){let y=c.data.length>p.exactLength.value,E=c.data.length<p.exactLength.value;(y||E)&&(H(c,{code:y?$.too_big:$.too_small,minimum:E?p.exactLength.value:void 0,maximum:y?p.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:p.exactLength.message}),d.dirty())}if(p.minLength!==null&&c.data.length<p.minLength.value&&(H(c,{code:$.too_small,minimum:p.minLength.value,type:"array",inclusive:!0,exact:!1,message:p.minLength.message}),d.dirty()),p.maxLength!==null&&c.data.length>p.maxLength.value&&(H(c,{code:$.too_big,maximum:p.maxLength.value,type:"array",inclusive:!0,exact:!1,message:p.maxLength.message}),d.dirty()),c.common.async)return Promise.all([...c.data].map((y,E)=>p.type._parseAsync(new Wt(c,y,c.path,E)))).then(y=>Ke.mergeArray(d,y));let g=[...c.data].map((y,E)=>p.type._parseSync(new Wt(c,y,c.path,E)));return Ke.mergeArray(d,g)}get element(){return this._def.type}min(r,c){return new kt({...this._def,minLength:{value:r,message:te.toString(c)}})}max(r,c){return new kt({...this._def,maxLength:{value:r,message:te.toString(c)}})}length(r,c){return new kt({...this._def,exactLength:{value:r,message:te.toString(c)}})}nonempty(r){return this.min(1,r)}};l(kt,"ZodArray");kt.create=(n,r)=>new kt({type:n,minLength:null,maxLength:null,exactLength:null,typeName:ce.ZodArray,...ve(r)});function $a(n){if(n instanceof Ue){let r={};for(let c in n.shape){let d=n.shape[c];r[c]=Gt.create($a(d))}return new Ue({...n._def,shape:()=>r})}else return n instanceof kt?new kt({...n._def,type:$a(n.element)}):n instanceof Gt?Gt.create($a(n.unwrap())):n instanceof xr?xr.create($a(n.unwrap())):n instanceof Ht?Ht.create(n.items.map(r=>$a(r))):n}l($a,"deepPartialify");var Ue=class extends ge{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let r=this._def.shape(),c=Re.objectKeys(r);return this._cached={shape:r,keys:c}}_parse(r){if(this._getType(r)!==J.object){let V=this._getOrReturnCtx(r);return H(V,{code:$.invalid_type,expected:J.object,received:V.parsedType}),de}let{status:d,ctx:p}=this._processInputParams(r),{shape:g,keys:y}=this._getCached(),E=[];if(!(this._def.catchall instanceof ir&&this._def.unknownKeys==="strip"))for(let V in p.data)y.includes(V)||E.push(V);let T=[];for(let V of y){let q=g[V],j=p.data[V];T.push({key:{status:"valid",value:V},value:q._parse(new Wt(p,j,p.path,V)),alwaysSet:V in p.data})}if(this._def.catchall instanceof ir){let V=this._def.unknownKeys;if(V==="passthrough")for(let q of E)T.push({key:{status:"valid",value:q},value:{status:"valid",value:p.data[q]}});else if(V==="strict")E.length>0&&(H(p,{code:$.unrecognized_keys,keys:E}),d.dirty());else if(V!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let V=this._def.catchall;for(let q of E){let j=p.data[q];T.push({key:{status:"valid",value:q},value:V._parse(new Wt(p,j,p.path,q)),alwaysSet:q in p.data})}}return p.common.async?Promise.resolve().then(async()=>{let V=[];for(let q of T){let j=await q.key,O=await q.value;V.push({key:j,value:O,alwaysSet:q.alwaysSet})}return V}).then(V=>Ke.mergeObjectSync(d,V)):Ke.mergeObjectSync(d,T)}get shape(){return this._def.shape()}strict(r){return te.errToObj,new Ue({...this._def,unknownKeys:"strict",...r!==void 0?{errorMap:(c,d)=>{var p,g,y,E;let T=(y=(g=(p=this._def).errorMap)===null||g===void 0?void 0:g.call(p,c,d).message)!==null&&y!==void 0?y:d.defaultError;return c.code==="unrecognized_keys"?{message:(E=te.errToObj(r).message)!==null&&E!==void 0?E:T}:{message:T}}}:{}})}strip(){return new Ue({...this._def,unknownKeys:"strip"})}passthrough(){return new Ue({...this._def,unknownKeys:"passthrough"})}extend(r){return new Ue({...this._def,shape:()=>({...this._def.shape(),...r})})}merge(r){return new Ue({unknownKeys:r._def.unknownKeys,catchall:r._def.catchall,shape:()=>({...this._def.shape(),...r._def.shape()}),typeName:ce.ZodObject})}setKey(r,c){return this.augment({[r]:c})}catchall(r){return new Ue({...this._def,catchall:r})}pick(r){let c={};return Re.objectKeys(r).forEach(d=>{r[d]&&this.shape[d]&&(c[d]=this.shape[d])}),new Ue({...this._def,shape:()=>c})}omit(r){let c={};return Re.objectKeys(this.shape).forEach(d=>{r[d]||(c[d]=this.shape[d])}),new Ue({...this._def,shape:()=>c})}deepPartial(){return $a(this)}partial(r){let c={};return Re.objectKeys(this.shape).forEach(d=>{let p=this.shape[d];r&&!r[d]?c[d]=p:c[d]=p.optional()}),new Ue({...this._def,shape:()=>c})}required(r){let c={};return Re.objectKeys(this.shape).forEach(d=>{if(r&&!r[d])c[d]=this.shape[d];else{let g=this.shape[d];for(;g instanceof Gt;)g=g._def.innerType;c[d]=g}}),new Ue({...this._def,shape:()=>c})}keyof(){return Hp(Re.objectKeys(this.shape))}};l(Ue,"ZodObject");Ue.create=(n,r)=>new Ue({shape:()=>n,unknownKeys:"strip",catchall:ir.create(),typeName:ce.ZodObject,...ve(r)});Ue.strictCreate=(n,r)=>new Ue({shape:()=>n,unknownKeys:"strict",catchall:ir.create(),typeName:ce.ZodObject,...ve(r)});Ue.lazycreate=(n,r)=>new Ue({shape:n,unknownKeys:"strip",catchall:ir.create(),typeName:ce.ZodObject,...ve(r)});var ti=class extends ge{_parse(r){let{ctx:c}=this._processInputParams(r),d=this._def.options;function p(g){for(let E of g)if(E.result.status==="valid")return E.result;for(let E of g)if(E.result.status==="dirty")return c.common.issues.push(...E.ctx.common.issues),E.result;let y=g.map(E=>new ut(E.ctx.common.issues));return H(c,{code:$.invalid_union,unionErrors:y}),de}if(l(p,"handleResults"),c.common.async)return Promise.all(d.map(async g=>{let y={...c,common:{...c.common,issues:[]},parent:null};return{result:await g._parseAsync({data:c.data,path:c.path,parent:y}),ctx:y}})).then(p);{let g,y=[];for(let T of d){let V={...c,common:{...c.common,issues:[]},parent:null},q=T._parseSync({data:c.data,path:c.path,parent:V});if(q.status==="valid")return q;q.status==="dirty"&&!g&&(g={result:q,ctx:V}),V.common.issues.length&&y.push(V.common.issues)}if(g)return c.common.issues.push(...g.ctx.common.issues),g.result;let E=y.map(T=>new ut(T));return H(c,{code:$.invalid_union,unionErrors:E}),de}}get options(){return this._def.options}};l(ti,"ZodUnion");ti.create=(n,r)=>new ti({options:n,typeName:ce.ZodUnion,...ve(r)});var hn=l(n=>n instanceof ii?hn(n.schema):n instanceof At?hn(n.innerType()):n instanceof ai?[n.value]:n instanceof wr?n.options:n instanceof oi?Re.objectValues(n.enum):n instanceof si?hn(n._def.innerType):n instanceof Xn?[void 0]:n instanceof ei?[null]:n instanceof Gt?[void 0,...hn(n.unwrap())]:n instanceof xr?[null,...hn(n.unwrap())]:n instanceof Wa||n instanceof ui?hn(n.unwrap()):n instanceof li?hn(n._def.innerType):[],"getDiscriminator"),Gi=class extends ge{_parse(r){let{ctx:c}=this._processInputParams(r);if(c.parsedType!==J.object)return H(c,{code:$.invalid_type,expected:J.object,received:c.parsedType}),de;let d=this.discriminator,p=c.data[d],g=this.optionsMap.get(p);return g?c.common.async?g._parseAsync({data:c.data,path:c.path,parent:c}):g._parseSync({data:c.data,path:c.path,parent:c}):(H(c,{code:$.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[d]}),de)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(r,c,d){let p=new Map;for(let g of c){let y=hn(g.shape[r]);if(!y.length)throw new Error(`A discriminator value for key \`${r}\` could not be extracted from all schema options`);for(let E of y){if(p.has(E))throw new Error(`Discriminator property ${String(r)} has duplicate value ${String(E)}`);p.set(E,g)}}return new Gi({typeName:ce.ZodDiscriminatedUnion,discriminator:r,options:c,optionsMap:p,...ve(d)})}};l(Gi,"ZodDiscriminatedUnion");function hd(n,r){let c=Yn(n),d=Yn(r);if(n===r)return{valid:!0,data:n};if(c===J.object&&d===J.object){let p=Re.objectKeys(r),g=Re.objectKeys(n).filter(E=>p.indexOf(E)!==-1),y={...n,...r};for(let E of g){let T=hd(n[E],r[E]);if(!T.valid)return{valid:!1};y[E]=T.data}return{valid:!0,data:y}}else if(c===J.array&&d===J.array){if(n.length!==r.length)return{valid:!1};let p=[];for(let g=0;g<n.length;g++){let y=n[g],E=r[g],T=hd(y,E);if(!T.valid)return{valid:!1};p.push(T.data)}return{valid:!0,data:p}}else return c===J.date&&d===J.date&&+n==+r?{valid:!0,data:n}:{valid:!1}}l(hd,"mergeValues");var ri=class extends ge{_parse(r){let{status:c,ctx:d}=this._processInputParams(r),p=l((g,y)=>{if(fd(g)||fd(y))return de;let E=hd(g.value,y.value);return E.valid?((pd(g)||pd(y))&&c.dirty(),{status:c.value,value:E.data}):(H(d,{code:$.invalid_intersection_types}),de)},"handleParsed");return d.common.async?Promise.all([this._def.left._parseAsync({data:d.data,path:d.path,parent:d}),this._def.right._parseAsync({data:d.data,path:d.path,parent:d})]).then(([g,y])=>p(g,y)):p(this._def.left._parseSync({data:d.data,path:d.path,parent:d}),this._def.right._parseSync({data:d.data,path:d.path,parent:d}))}};l(ri,"ZodIntersection");ri.create=(n,r,c)=>new ri({left:n,right:r,typeName:ce.ZodIntersection,...ve(c)});var Ht=class extends ge{_parse(r){let{status:c,ctx:d}=this._processInputParams(r);if(d.parsedType!==J.array)return H(d,{code:$.invalid_type,expected:J.array,received:d.parsedType}),de;if(d.data.length<this._def.items.length)return H(d,{code:$.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),de;!this._def.rest&&d.data.length>this._def.items.length&&(H(d,{code:$.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),c.dirty());let g=[...d.data].map((y,E)=>{let T=this._def.items[E]||this._def.rest;return T?T._parse(new Wt(d,y,d.path,E)):null}).filter(y=>!!y);return d.common.async?Promise.all(g).then(y=>Ke.mergeArray(c,y)):Ke.mergeArray(c,g)}get items(){return this._def.items}rest(r){return new Ht({...this._def,rest:r})}};l(Ht,"ZodTuple");Ht.create=(n,r)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ht({items:n,typeName:ce.ZodTuple,rest:null,...ve(r)})};var ni=class extends ge{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){let{status:c,ctx:d}=this._processInputParams(r);if(d.parsedType!==J.object)return H(d,{code:$.invalid_type,expected:J.object,received:d.parsedType}),de;let p=[],g=this._def.keyType,y=this._def.valueType;for(let E in d.data)p.push({key:g._parse(new Wt(d,E,d.path,E)),value:y._parse(new Wt(d,d.data[E],d.path,E)),alwaysSet:E in d.data});return d.common.async?Ke.mergeObjectAsync(c,p):Ke.mergeObjectSync(c,p)}get element(){return this._def.valueType}static create(r,c,d){return c instanceof ge?new ni({keyType:r,valueType:c,typeName:ce.ZodRecord,...ve(d)}):new ni({keyType:Rt.create(),valueType:r,typeName:ce.ZodRecord,...ve(c)})}};l(ni,"ZodRecord");var Ji=class extends ge{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){let{status:c,ctx:d}=this._processInputParams(r);if(d.parsedType!==J.map)return H(d,{code:$.invalid_type,expected:J.map,received:d.parsedType}),de;let p=this._def.keyType,g=this._def.valueType,y=[...d.data.entries()].map(([E,T],V)=>({key:p._parse(new Wt(d,E,d.path,[V,"key"])),value:g._parse(new Wt(d,T,d.path,[V,"value"]))}));if(d.common.async){let E=new Map;return Promise.resolve().then(async()=>{for(let T of y){let V=await T.key,q=await T.value;if(V.status==="aborted"||q.status==="aborted")return de;(V.status==="dirty"||q.status==="dirty")&&c.dirty(),E.set(V.value,q.value)}return{status:c.value,value:E}})}else{let E=new Map;for(let T of y){let V=T.key,q=T.value;if(V.status==="aborted"||q.status==="aborted")return de;(V.status==="dirty"||q.status==="dirty")&&c.dirty(),E.set(V.value,q.value)}return{status:c.value,value:E}}}};l(Ji,"ZodMap");Ji.create=(n,r,c)=>new Ji({valueType:r,keyType:n,typeName:ce.ZodMap,...ve(c)});var Zr=class extends ge{_parse(r){let{status:c,ctx:d}=this._processInputParams(r);if(d.parsedType!==J.set)return H(d,{code:$.invalid_type,expected:J.set,received:d.parsedType}),de;let p=this._def;p.minSize!==null&&d.data.size<p.minSize.value&&(H(d,{code:$.too_small,minimum:p.minSize.value,type:"set",inclusive:!0,exact:!1,message:p.minSize.message}),c.dirty()),p.maxSize!==null&&d.data.size>p.maxSize.value&&(H(d,{code:$.too_big,maximum:p.maxSize.value,type:"set",inclusive:!0,exact:!1,message:p.maxSize.message}),c.dirty());let g=this._def.valueType;function y(T){let V=new Set;for(let q of T){if(q.status==="aborted")return de;q.status==="dirty"&&c.dirty(),V.add(q.value)}return{status:c.value,value:V}}l(y,"finalizeSet");let E=[...d.data.values()].map((T,V)=>g._parse(new Wt(d,T,d.path,V)));return d.common.async?Promise.all(E).then(T=>y(T)):y(E)}min(r,c){return new Zr({...this._def,minSize:{value:r,message:te.toString(c)}})}max(r,c){return new Zr({...this._def,maxSize:{value:r,message:te.toString(c)}})}size(r,c){return this.min(r,c).max(r,c)}nonempty(r){return this.min(1,r)}};l(Zr,"ZodSet");Zr.create=(n,r)=>new Zr({valueType:n,minSize:null,maxSize:null,typeName:ce.ZodSet,...ve(r)});var gn=class extends ge{constructor(){super(...arguments),this.validate=this.implement}_parse(r){let{ctx:c}=this._processInputParams(r);if(c.parsedType!==J.function)return H(c,{code:$.invalid_type,expected:J.function,received:c.parsedType}),de;function d(E,T){return Hl({data:E,path:c.path,errorMaps:[c.common.contextualErrorMap,c.schemaErrorMap,Wl(),Ha].filter(V=>!!V),issueData:{code:$.invalid_arguments,argumentsError:T}})}l(d,"makeArgsIssue");function p(E,T){return Hl({data:E,path:c.path,errorMaps:[c.common.contextualErrorMap,c.schemaErrorMap,Wl(),Ha].filter(V=>!!V),issueData:{code:$.invalid_return_type,returnTypeError:T}})}l(p,"makeReturnsIssue");let g={errorMap:c.common.contextualErrorMap},y=c.data;if(this._def.returns instanceof yn){let E=this;return vt(async function(...T){let V=new ut([]),q=await E._def.args.parseAsync(T,g).catch(R=>{throw V.addIssue(d(T,R)),V}),j=await Reflect.apply(y,this,q);return await E._def.returns._def.type.parseAsync(j,g).catch(R=>{throw V.addIssue(p(j,R)),V})})}else{let E=this;return vt(function(...T){let V=E._def.args.safeParse(T,g);if(!V.success)throw new ut([d(T,V.error)]);let q=Reflect.apply(y,this,V.data),j=E._def.returns.safeParse(q,g);if(!j.success)throw new ut([p(q,j.error)]);return j.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...r){return new gn({...this._def,args:Ht.create(r).rest(Fr.create())})}returns(r){return new gn({...this._def,returns:r})}implement(r){return this.parse(r)}strictImplement(r){return this.parse(r)}static create(r,c,d){return new gn({args:r||Ht.create([]).rest(Fr.create()),returns:c||Fr.create(),typeName:ce.ZodFunction,...ve(d)})}};l(gn,"ZodFunction");var ii=class extends ge{get schema(){return this._def.getter()}_parse(r){let{ctx:c}=this._processInputParams(r);return this._def.getter()._parse({data:c.data,path:c.path,parent:c})}};l(ii,"ZodLazy");ii.create=(n,r)=>new ii({getter:n,typeName:ce.ZodLazy,...ve(r)});var ai=class extends ge{_parse(r){if(r.data!==this._def.value){let c=this._getOrReturnCtx(r);return H(c,{received:c.data,code:$.invalid_literal,expected:this._def.value}),de}return{status:"valid",value:r.data}}get value(){return this._def.value}};l(ai,"ZodLiteral");ai.create=(n,r)=>new ai({value:n,typeName:ce.ZodLiteral,...ve(r)});function Hp(n,r){return new wr({values:n,typeName:ce.ZodEnum,...ve(r)})}l(Hp,"createZodEnum");var wr=class extends ge{constructor(){super(...arguments),Go.set(this,void 0)}_parse(r){if(typeof r.data!="string"){let c=this._getOrReturnCtx(r),d=this._def.values;return H(c,{expected:Re.joinValues(d),received:c.parsedType,code:$.invalid_type}),de}if(Gl(this,Go,"f")||qp(this,Go,new Set(this._def.values),"f"),!Gl(this,Go,"f").has(r.data)){let c=this._getOrReturnCtx(r),d=this._def.values;return H(c,{received:c.data,code:$.invalid_enum_value,options:d}),de}return vt(r.data)}get options(){return this._def.values}get enum(){let r={};for(let c of this._def.values)r[c]=c;return r}get Values(){let r={};for(let c of this._def.values)r[c]=c;return r}get Enum(){let r={};for(let c of this._def.values)r[c]=c;return r}extract(r,c=this._def){return wr.create(r,{...this._def,...c})}exclude(r,c=this._def){return wr.create(this.options.filter(d=>!r.includes(d)),{...this._def,...c})}};l(wr,"ZodEnum");Go=new WeakMap;wr.create=Hp;var oi=class extends ge{constructor(){super(...arguments),Jo.set(this,void 0)}_parse(r){let c=Re.getValidEnumValues(this._def.values),d=this._getOrReturnCtx(r);if(d.parsedType!==J.string&&d.parsedType!==J.number){let p=Re.objectValues(c);return H(d,{expected:Re.joinValues(p),received:d.parsedType,code:$.invalid_type}),de}if(Gl(this,Jo,"f")||qp(this,Jo,new Set(Re.getValidEnumValues(this._def.values)),"f"),!Gl(this,Jo,"f").has(r.data)){let p=Re.objectValues(c);return H(d,{received:d.data,code:$.invalid_enum_value,options:p}),de}return vt(r.data)}get enum(){return this._def.values}};l(oi,"ZodNativeEnum");Jo=new WeakMap;oi.create=(n,r)=>new oi({values:n,typeName:ce.ZodNativeEnum,...ve(r)});var yn=class extends ge{unwrap(){return this._def.type}_parse(r){let{ctx:c}=this._processInputParams(r);if(c.parsedType!==J.promise&&c.common.async===!1)return H(c,{code:$.invalid_type,expected:J.promise,received:c.parsedType}),de;let d=c.parsedType===J.promise?c.data:Promise.resolve(c.data);return vt(d.then(p=>this._def.type.parseAsync(p,{path:c.path,errorMap:c.common.contextualErrorMap})))}};l(yn,"ZodPromise");yn.create=(n,r)=>new yn({type:n,typeName:ce.ZodPromise,...ve(r)});var At=class extends ge{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ce.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(r){let{status:c,ctx:d}=this._processInputParams(r),p=this._def.effect||null,g={addIssue:y=>{H(d,y),y.fatal?c.abort():c.dirty()},get path(){return d.path}};if(g.addIssue=g.addIssue.bind(g),p.type==="preprocess"){let y=p.transform(d.data,g);if(d.common.async)return Promise.resolve(y).then(async E=>{if(c.value==="aborted")return de;let T=await this._def.schema._parseAsync({data:E,path:d.path,parent:d});return T.status==="aborted"?de:T.status==="dirty"||c.value==="dirty"?za(T.value):T});{if(c.value==="aborted")return de;let E=this._def.schema._parseSync({data:y,path:d.path,parent:d});return E.status==="aborted"?de:E.status==="dirty"||c.value==="dirty"?za(E.value):E}}if(p.type==="refinement"){let y=l(E=>{let T=p.refinement(E,g);if(d.common.async)return Promise.resolve(T);if(T instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return E},"executeRefinement");if(d.common.async===!1){let E=this._def.schema._parseSync({data:d.data,path:d.path,parent:d});return E.status==="aborted"?de:(E.status==="dirty"&&c.dirty(),y(E.value),{status:c.value,value:E.value})}else return this._def.schema._parseAsync({data:d.data,path:d.path,parent:d}).then(E=>E.status==="aborted"?de:(E.status==="dirty"&&c.dirty(),y(E.value).then(()=>({status:c.value,value:E.value}))))}if(p.type==="transform")if(d.common.async===!1){let y=this._def.schema._parseSync({data:d.data,path:d.path,parent:d});if(!Qo(y))return y;let E=p.transform(y.value,g);if(E instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:c.value,value:E}}else return this._def.schema._parseAsync({data:d.data,path:d.path,parent:d}).then(y=>Qo(y)?Promise.resolve(p.transform(y.value,g)).then(E=>({status:c.value,value:E})):y);Re.assertNever(p)}};l(At,"ZodEffects");At.create=(n,r,c)=>new At({schema:n,typeName:ce.ZodEffects,effect:r,...ve(c)});At.createWithPreprocess=(n,r,c)=>new At({schema:r,effect:{type:"preprocess",transform:n},typeName:ce.ZodEffects,...ve(c)});var Gt=class extends ge{_parse(r){return this._getType(r)===J.undefined?vt(void 0):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}};l(Gt,"ZodOptional");Gt.create=(n,r)=>new Gt({innerType:n,typeName:ce.ZodOptional,...ve(r)});var xr=class extends ge{_parse(r){return this._getType(r)===J.null?vt(null):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}};l(xr,"ZodNullable");xr.create=(n,r)=>new xr({innerType:n,typeName:ce.ZodNullable,...ve(r)});var si=class extends ge{_parse(r){let{ctx:c}=this._processInputParams(r),d=c.data;return c.parsedType===J.undefined&&(d=this._def.defaultValue()),this._def.innerType._parse({data:d,path:c.path,parent:c})}removeDefault(){return this._def.innerType}};l(si,"ZodDefault");si.create=(n,r)=>new si({innerType:n,typeName:ce.ZodDefault,defaultValue:typeof r.default=="function"?r.default:()=>r.default,...ve(r)});var li=class extends ge{_parse(r){let{ctx:c}=this._processInputParams(r),d={...c,common:{...c.common,issues:[]}},p=this._def.innerType._parse({data:d.data,path:d.path,parent:{...d}});return Yo(p)?p.then(g=>({status:"valid",value:g.status==="valid"?g.value:this._def.catchValue({get error(){return new ut(d.common.issues)},input:d.data})})):{status:"valid",value:p.status==="valid"?p.value:this._def.catchValue({get error(){return new ut(d.common.issues)},input:d.data})}}removeCatch(){return this._def.innerType}};l(li,"ZodCatch");li.create=(n,r)=>new li({innerType:n,typeName:ce.ZodCatch,catchValue:typeof r.catch=="function"?r.catch:()=>r.catch,...ve(r)});var Qi=class extends ge{_parse(r){if(this._getType(r)!==J.nan){let d=this._getOrReturnCtx(r);return H(d,{code:$.invalid_type,expected:J.nan,received:d.parsedType}),de}return{status:"valid",value:r.data}}};l(Qi,"ZodNaN");Qi.create=n=>new Qi({typeName:ce.ZodNaN,...ve(n)});var xw=Symbol("zod_brand"),Wa=class extends ge{_parse(r){let{ctx:c}=this._processInputParams(r),d=c.data;return this._def.type._parse({data:d,path:c.path,parent:c})}unwrap(){return this._def.type}};l(Wa,"ZodBranded");var ci=class extends ge{_parse(r){let{status:c,ctx:d}=this._processInputParams(r);if(d.common.async)return l(async()=>{let g=await this._def.in._parseAsync({data:d.data,path:d.path,parent:d});return g.status==="aborted"?de:g.status==="dirty"?(c.dirty(),za(g.value)):this._def.out._parseAsync({data:g.value,path:d.path,parent:d})},"handleAsync")();{let p=this._def.in._parseSync({data:d.data,path:d.path,parent:d});return p.status==="aborted"?de:p.status==="dirty"?(c.dirty(),{status:"dirty",value:p.value}):this._def.out._parseSync({data:p.value,path:d.path,parent:d})}}static create(r,c){return new ci({in:r,out:c,typeName:ce.ZodPipeline})}};l(ci,"ZodPipeline");var ui=class extends ge{_parse(r){let c=this._def.innerType._parse(r),d=l(p=>(Qo(p)&&(p.value=Object.freeze(p.value)),p),"freeze");return Yo(c)?c.then(p=>d(p)):d(c)}unwrap(){return this._def.innerType}};l(ui,"ZodReadonly");ui.create=(n,r)=>new ui({innerType:n,typeName:ce.ZodReadonly,...ve(r)});function Gp(n,r={},c){return n?mn.create().superRefine((d,p)=>{var g,y;if(!n(d)){let E=typeof r=="function"?r(d):typeof r=="string"?{message:r}:r,T=(y=(g=E.fatal)!==null&&g!==void 0?g:c)!==null&&y!==void 0?y:!0,V=typeof E=="string"?{message:E}:E;p.addIssue({code:"custom",...V,fatal:T})}}):mn.create()}l(Gp,"custom");var Ew={object:Ue.lazycreate},ce;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(ce||(ce={}));var Cw=l((n,r={message:`Input not instance of ${n.name}`})=>Gp(c=>c instanceof n,r),"instanceOfType"),Jp=Rt.create,Qp=br.create,Sw=Qi.create,Tw=_r.create,Yp=Kn.create,Rw=Br.create,kw=Wi.create,Aw=Xn.create,Ow=ei.create,Iw=mn.create,Pw=Fr.create,Vw=ir.create,Nw=Hi.create,jw=kt.create,Dw=Ue.create,Lw=Ue.strictCreate,Mw=ti.create,Uw=Gi.create,Bw=ri.create,Fw=Ht.create,Zw=ni.create,qw=Ji.create,$w=Zr.create,zw=gn.create,Ww=ii.create,Hw=ai.create,Gw=wr.create,Jw=oi.create,Qw=yn.create,Fp=At.create,Yw=Gt.create,Kw=xr.create,Xw=At.createWithPreprocess,ex=ci.create,tx=l(()=>Jp().optional(),"ostring"),rx=l(()=>Qp().optional(),"onumber"),nx=l(()=>Yp().optional(),"oboolean"),ix={string:n=>Rt.create({...n,coerce:!0}),number:n=>br.create({...n,coerce:!0}),boolean:n=>Kn.create({...n,coerce:!0}),bigint:n=>_r.create({...n,coerce:!0}),date:n=>Br.create({...n,coerce:!0})},ax=de,o=Object.freeze({__proto__:null,defaultErrorMap:Ha,setErrorMap:aw,getErrorMap:Wl,makeIssue:Hl,EMPTY_PATH:ow,addIssueToContext:H,ParseStatus:Ke,INVALID:de,DIRTY:za,OK:vt,isAborted:fd,isDirty:pd,isValid:Qo,isAsync:Yo,get util(){return Re},get objectUtil(){return dd},ZodParsedType:J,getParsedType:Yn,ZodType:ge,datetimeRegex:Wp,ZodString:Rt,ZodNumber:br,ZodBigInt:_r,ZodBoolean:Kn,ZodDate:Br,ZodSymbol:Wi,ZodUndefined:Xn,ZodNull:ei,ZodAny:mn,ZodUnknown:Fr,ZodNever:ir,ZodVoid:Hi,ZodArray:kt,ZodObject:Ue,ZodUnion:ti,ZodDiscriminatedUnion:Gi,ZodIntersection:ri,ZodTuple:Ht,ZodRecord:ni,ZodMap:Ji,ZodSet:Zr,ZodFunction:gn,ZodLazy:ii,ZodLiteral:ai,ZodEnum:wr,ZodNativeEnum:oi,ZodPromise:yn,ZodEffects:At,ZodTransformer:At,ZodOptional:Gt,ZodNullable:xr,ZodDefault:si,ZodCatch:li,ZodNaN:Qi,BRAND:xw,ZodBranded:Wa,ZodPipeline:ci,ZodReadonly:ui,custom:Gp,Schema:ge,ZodSchema:ge,late:Ew,get ZodFirstPartyTypeKind(){return ce},coerce:ix,any:Iw,array:jw,bigint:Tw,boolean:Yp,date:Rw,discriminatedUnion:Uw,effect:Fp,enum:Gw,function:zw,instanceof:Cw,intersection:Bw,lazy:Ww,literal:Hw,map:qw,nan:Sw,nativeEnum:Jw,never:Vw,null:Ow,nullable:Kw,number:Qp,object:Dw,oboolean:nx,onumber:rx,optional:Yw,ostring:tx,pipeline:ex,preprocess:Xw,promise:Qw,record:Zw,set:$w,strictObject:Lw,string:Jp,symbol:kw,transformer:Fp,tuple:Fw,undefined:Aw,union:Mw,unknown:Pw,void:Nw,NEVER:ax,ZodIssueCode:$,quotelessJson:iw,ZodError:ut});var Ga=Symbol("current"),Yi=Symbol("previous");var Ko=l((n,{ref:r,refType:c,param:d,header:p,...g}={})=>({...g,...n}),"mergeOpenApi");function Xo(n){if(typeof n.ZodType.prototype.openapi<"u")return;n.ZodType.prototype.openapi=function(g){let{zodOpenApi:y,...E}=this._def,T=new this.constructor({...E,zodOpenApi:{openapi:Ko(g,y?.openapi)}});return T._def.zodOpenApi[Ga]=T,y&&(T._def.zodOpenApi[Yi]=this),T};let r=n.ZodType.prototype.describe;n.ZodType.prototype.describe=function(...g){let y=r.apply(this,g),E=y._def;if(E.zodOpenApi){let T={...E.zodOpenApi};T.openapi=Ko({description:g[0]},T.openapi),T[Yi]=this,T[Ga]=y,E.zodOpenApi=T}else E.zodOpenApi={openapi:{description:g[0]},[Ga]:y};return y};let c=n.ZodObject.prototype.extend;n.ZodObject.prototype.extend=function(...g){let y=c.apply(this,g),E=y._def.zodOpenApi;if(E){let T={...E};T.openapi=Ko({},T.openapi),T[Yi]=this,y._def.zodOpenApi=T}else y._def.zodOpenApi={[Yi]:this};return y};let d=n.ZodObject.prototype.omit;n.ZodObject.prototype.omit=function(...g){let y=d.apply(this,g),E=y._def.zodOpenApi;if(E){let T={...E};T.openapi=Ko({},T.openapi),delete T[Yi],delete T[Ga],y._def.zodOpenApi=T}return y};let p=n.ZodObject.prototype.pick;n.ZodObject.prototype.pick=function(...g){let y=p.apply(this,g),E=y._def.zodOpenApi;if(E){let T={...E};T.openapi=Ko({},T.openapi),delete T[Yi],delete T[Ga],y._def.zodOpenApi=T}return y}}l(Xo,"extendZodWithOpenApi");Xo(o);var ox=Object.defineProperty,sx=l((n,r)=>ox(n,"name",{value:r,configurable:!0}),"__name"),Ql=o.array(o.string().or(o.record(o.any()))),dA=o.object({type:o.string().optional(),narrative:o.string().optional()}),Yl=o.string().or(o.object({id:o.string(),type:o.string(),caption:o.string().optional()})),lx=o.object({type:o.string().min(1).or(o.string().array().nonempty()),latitude:o.number(),longitude:o.number()}),cx=o.object({type:o.string().min(1).or(o.string().array().nonempty()),addressCountry:o.string().optional(),addressCountryCode:o.string().optional(),addressRegion:o.string().optional(),addressLocality:o.string().optional(),streetAddress:o.string().optional(),postOfficeBoxNumber:o.string().optional(),postalCode:o.string().optional(),geo:lx.optional()}),ux=o.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(o.string()),uh=o.object({type:o.string().min(1).or(o.string().array().nonempty()),identifier:o.string(),identifierType:ux}),es=o.string().or(o.object({id:o.string().optional(),type:o.string().or(o.string().array().nonempty().optional()),name:o.string().optional(),url:o.string().optional(),phone:o.string().optional(),description:o.string().optional(),endorsement:o.any().array().optional(),image:Yl.optional(),email:o.string().email().optional(),address:cx.optional(),otherIdentifier:uh.array().optional(),official:o.string().optional(),parentOrg:o.any().optional(),familyName:o.string().optional(),givenName:o.string().optional(),additionalName:o.string().optional(),patronymicName:o.string().optional(),honorificPrefix:o.string().optional(),honorificSuffix:o.string().optional(),familyNamePrefix:o.string().optional(),dateOfBirth:o.string().optional()}).catchall(o.any())),gd=o.object({id:o.string().optional()}).catchall(o.any()),Jl=o.object({type:o.string(),id:o.string()}).catchall(o.any()),Kp=o.object({id:o.string(),type:o.string()}).catchall(o.any()),Xp=o.object({id:o.string().optional(),type:o.string()}).catchall(o.any()),eh=o.object({type:o.string(),id:o.string().optional()}).catchall(o.any()),th=o.object({type:o.string().or(o.string().array().nonempty()),id:o.string().optional()}).catchall(o.any()),Ja=o.object({"@context":Ql,id:o.string().optional(),type:o.string().array().nonempty(),issuer:es,credentialSubject:gd.or(gd.array()),refreshService:Xp.or(Xp.array()).optional(),credentialSchema:Kp.or(Kp.array()).optional(),issuanceDate:o.string().optional(),expirationDate:o.string().optional(),credentialStatus:Jl.or(Jl.array()).optional(),name:o.string().optional(),description:o.string().optional(),validFrom:o.string().optional(),validUntil:o.string().optional(),status:Jl.or(Jl.array()).optional(),termsOfUse:eh.or(eh.array()).optional(),evidence:th.or(th.array()).optional()}).catchall(o.any()),qr=o.object({type:o.string(),created:o.string(),challenge:o.string().optional(),domain:o.string().optional(),nonce:o.string().optional(),proofPurpose:o.string(),verificationMethod:o.string(),jws:o.string().optional()}).catchall(o.any()),di=Ja.extend({proof:qr.or(qr.array())}),dx=o.object({"@context":Ql,id:o.string().optional(),type:o.string().or(o.string().array().nonempty()),verifiableCredential:di.or(di.array()).optional(),holder:o.string().optional()}).catchall(o.any()),Qa=dx.extend({proof:qr.or(qr.array())}),bd=o.object({kty:o.string(),crv:o.string(),x:o.string(),y:o.string().optional(),n:o.string().optional(),d:o.string().optional()}),hA=bd.omit({d:!0}).extend({d:o.string()}),fx=o.object({alg:o.string(),iv:o.string(),tag:o.string(),epk:bd.partial().optional(),kid:o.string().optional(),apv:o.string().optional(),apu:o.string().optional()}),px=o.object({header:fx,encrypted_key:o.string()}),hx=o.object({protected:o.string(),iv:o.string(),ciphertext:o.string(),tag:o.string(),aad:o.string().optional(),recipients:px.array().optional()}),Ki=o.string().or(o.object({"@context":Ql.optional(),id:o.string(),type:o.string(),controller:o.string(),publicKeyJwk:bd.optional(),publicKeyBase58:o.string().optional(),publicKeyMultibase:o.string().optional(),blockChainAccountId:o.string().optional()}).catchall(o.any())),mx=o.object({id:o.string(),type:o.string().or(o.string().array().nonempty()),serviceEndpoint:o.any().or(o.any().array().nonempty())}).catchall(o.any()),mA=o.object({"@context":Ql,id:o.string(),alsoKnownAs:o.string().optional(),controller:o.string().or(o.string().array().nonempty()).optional(),verificationMethod:Ki.array().optional(),authentication:Ki.array().optional(),assertionMethod:Ki.array().optional(),keyAgreement:Ki.array().optional(),capabilityInvocation:Ki.array().optional(),capabilityDelegation:Ki.array().optional(),publicKey:Ki.array().optional(),service:mx.array().optional(),proof:qr.or(qr.array()).optional()}).catchall(o.any()),gx=o.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(o.string()),Kl=o.object({type:o.string().array().nonempty(),targetCode:o.string().optional(),targetDescription:o.string().optional(),targetName:o.string(),targetFramework:o.string().optional(),targetType:gx.optional(),targetUrl:o.string()}),yx=o.enum(["Achievement","ApprenticeshipCertificate","Assessment","Assignment","AssociateDegree","Award","Badge","BachelorDegree","Certificate","CertificateOfCompletion","Certification","CommunityService","Competency","Course","CoCurricular","Degree","Diploma","DoctoralDegree","Fieldwork","GeneralEducationDevelopment","JourneymanCertificate","LearningProgram","License","Membership","ProfessionalDoctorate","QualityAssuranceCredential","MasterCertificate","MasterDegree","MicroCredential","ResearchDoctorate","SecondarySchoolDiploma"]),vx=yx.or(o.string()),bx=o.object({id:o.string().optional(),narrative:o.string().optional()}).catchall(o.any()),_x=o.object({id:o.string(),type:o.string().array().nonempty(),endorsementComment:o.string().optional()}),wx=Ja.extend({credentialSubject:_x,proof:qr.or(qr.array()).optional()}),xx=o.object({id:o.string(),"@language":o.string().optional(),version:o.string().optional()}),Ex=o.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(o.string()),Cx=o.object({id:o.string(),type:o.string().array().nonempty(),alignment:Kl.array().optional(),description:o.string().optional(),level:o.string().optional(),name:o.string(),points:o.string().optional()}).catchall(o.any()),Sx=o.object({id:o.string(),type:o.string().array().nonempty(),alignment:Kl.array().optional(),allowedValue:o.string().array().optional(),name:o.string(),requiredLevel:o.string().optional(),requiredValue:o.string().optional(),resultType:Ex,rubricCriterionLevel:Cx.array().optional(),valueMax:o.string().optional(),valueMin:o.string().optional()}).catchall(o.any()),Tx=o.object({id:o.string().optional(),type:o.string().array().nonempty(),alignment:Kl.array().optional(),achievementType:vx.optional(),creator:es.optional(),creditsAvailable:o.number().optional(),criteria:bx,description:o.string(),endorsement:wx.array().optional(),fieldOfStudy:o.string().optional(),humanCode:o.string().optional(),image:Yl.optional(),"@language":o.string().optional(),name:o.string(),otherIdentifier:uh.array().optional(),related:xx.array().optional(),resultDescription:Sx.array().optional(),specialization:o.string().optional(),tag:o.string().array().optional(),version:o.string().optional()}).catchall(o.any()),Rx=o.object({type:o.string(),hashed:o.boolean(),identityHash:o.string(),identityType:o.string(),salt:o.string().optional()}),kx=o.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),Ax=o.object({type:o.string().array().nonempty(),achievedLevel:o.string().optional(),alignment:Kl.array().optional(),resultDescription:o.string().optional(),status:kx.optional(),value:o.string().optional()}).catchall(o.any()),rh=o.object({id:o.string().optional(),type:o.string().array().nonempty(),activityEndDate:o.string().optional(),activityStartDate:o.string().optional(),creditsEarned:o.number().optional(),achievement:Tx.optional(),identifier:Rx.array().optional(),image:Yl.optional(),licenseNumber:o.string().optional(),narrative:o.string().optional(),result:Ax.array().optional(),role:o.string().optional(),source:es.optional(),term:o.string().optional()}).catchall(o.any()),Ox=o.object({id:o.string().optional(),type:o.string().or(o.string().array().nonempty()),narrative:o.string().optional(),name:o.string().optional(),description:o.string().optional(),genre:o.string().optional(),audience:o.string().optional()}).catchall(o.any()),Ix=Ja.extend({name:o.string().optional(),description:o.string().optional(),image:Yl.optional(),credentialSubject:rh.or(rh.array()),endorsement:Ja.array().optional(),evidence:Ox.array().optional()}),yA=Ix.extend({proof:qr.or(qr.array())}),bA=o.object({checks:o.string().array(),warnings:o.string().array(),errors:o.string().array()}),dh=o.enum(["Success","Failed","Error"]),_A=dh.enum,wA=o.object({check:o.string(),status:dh,message:o.string().optional(),details:o.string().optional()}),xA=o.object({title:o.string().optional(),createdAt:o.string().optional(),issuer:es.optional(),issuee:es.optional(),credentialSubject:gd.optional()}),EA=o.object({id:o.string(),uri:o.string()}).catchall(o.any()),TA=o.object({limit:o.number(),cursor:o.string().optional(),sort:o.string().optional()}),ot=o.object({cursor:o.string().optional(),hasMore:o.boolean()}),fh=o.object({encryptedRecord:hx,fields:o.string().array()}).catchall(o.any()),RA=ot.extend({records:fh.array()}),Px=fh.extend({id:o.string()}),kA=ot.extend({records:Px.array()}),nh=sx(n=>{let r=n.match(/^\/(.*)\/([gimsuy]*)$/);if(!r)throw new Error("Invalid RegExp string format");return{pattern:r[1],flags:r[2]}},"parseRegexString"),Vx=o.instanceof(RegExp).or(o.string().refine(n=>{try{return nh(n),!0}catch{return!1}},{message:"Invalid RegExp string format. Must be in format '/pattern/flags'"}).transform(n=>{let{pattern:r,flags:c}=nh(n);try{return new RegExp(r,c)}catch(d){throw new Error(`Invalid RegExp: ${d.message}`)}})),ih=o.string().or(o.object({$in:o.string().array()})).or(o.object({$regex:Vx})),ye=o.union([ih,o.object({$or:ih.array()})]);Xo(o);var Nx=o.object({backgroundColor:o.string().optional(),backgroundImage:o.string().optional(),fadeBackgroundImage:o.boolean().optional(),repeatBackgroundImage:o.boolean().optional(),fontColor:o.string().optional(),accentColor:o.string().optional(),accentFontColor:o.string().optional(),idBackgroundImage:o.string().optional(),fadeIdBackgroundImage:o.boolean().optional(),idBackgroundColor:o.string().optional(),repeatIdBackgroundImage:o.boolean().optional()}),$r=o.object({profileId:o.string().min(3).max(40).describe("Unique, URL-safe identifier for the profile."),displayName:o.string().default("").describe("Human-readable display name for the profile."),shortBio:o.string().default("").describe("Short bio for the profile."),bio:o.string().default("").describe("Longer bio for the profile."),did:o.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),isPrivate:o.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),email:o.string().optional().describe("Contact email address for the profile. (deprecated)"),image:o.string().optional().describe("Profile image URL for the profile."),heroImage:o.string().optional().describe("Hero image URL for the profile."),websiteLink:o.string().optional().describe("Website link for the profile."),isServiceProfile:o.boolean().default(!1).optional().describe("Whether the profile is a service profile or not."),type:o.string().optional().describe('Profile type: e.g. "person", "organization", "service".'),notificationsWebhook:o.string().url().startsWith("http").optional().describe("URL to send notifications to."),display:Nx.optional().describe("Display settings for the profile."),highlightedCredentials:o.array(o.string()).max(5).optional().describe("Up to 5 unique boost URIs to highlight on the profile."),role:o.string().default("").optional().describe('Role of the profile: e.g. "teacher", "student".'),dob:o.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".'),country:o.string().optional().describe("Country for the profile."),approved:o.boolean().optional().describe("Approval status for the profile.")}),PA=o.object({profileId:ye,displayName:ye,shortBio:ye,bio:ye,email:ye,websiteLink:ye,isServiceProfile:o.boolean(),type:ye}).partial(),VA=ot.extend({records:$r.array()}),NA=o.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),ph=o.object({id:o.string(),created:o.string(),displayName:o.string().default("").optional(),shortBio:o.string().default("").optional(),bio:o.string().default("").optional(),email:o.string().optional(),image:o.string().optional(),heroImage:o.string().optional()}),jA=ot.extend({records:ph.extend({did:o.string()}).array()}),DA=o.object({id:ye,displayName:ye,shortBio:ye,bio:ye,email:ye}).partial(),LA=ot.extend({records:o.object({profile:$r,manager:ph.extend({did:o.string()}).optional()}).array()}),MA=o.object({uri:o.string(),to:o.string(),from:o.string(),sent:o.string().datetime(),received:o.string().datetime().optional(),metadata:o.record(o.unknown()).optional()}),hh=o.object({role:o.string(),canEdit:o.boolean(),canIssue:o.boolean(),canRevoke:o.boolean(),canManagePermissions:o.boolean(),canIssueChildren:o.string(),canCreateChildren:o.string(),canEditChildren:o.string(),canRevokeChildren:o.string(),canManageChildrenPermissions:o.string(),canManageChildrenProfiles:o.boolean().default(!1).optional(),canViewAnalytics:o.boolean()}),jx=o.object({role:ye,canEdit:o.boolean(),canIssue:o.boolean(),canRevoke:o.boolean(),canManagePermissions:o.boolean(),canIssueChildren:ye,canCreateChildren:ye,canEditChildren:ye,canRevokeChildren:ye,canManageChildrenPermissions:ye,canManageChildrenProfiles:o.boolean(),canViewAnalytics:o.boolean()}).partial(),md=o.enum(["GRANT_PERMISSIONS","ADD_ADMIN","AUTO_CONNECT"]),Dx=o.discriminatedUnion("type",[o.object({type:o.literal(md.Values.GRANT_PERMISSIONS),data:o.object({claimUri:o.string(),targetUri:o.string(),permissions:hh.partial()})}),o.object({type:o.literal(md.Values.ADD_ADMIN),data:o.object({claimUri:o.string(),targetUri:o.string()})}),o.object({type:o.literal(md.Values.AUTO_CONNECT),data:o.object({claimUri:o.string(),targetUri:o.string()})})]),UA=o.object({type:ye,data:o.object({claimUri:ye,targetUri:ye,permissions:jx})}).deepPartial(),Lx=o.object({id:o.string(),createdAt:o.string(),updatedAt:o.string()}).and(Dx),BA=ot.extend({records:Lx.array()}),yd=o.enum(["DRAFT","LIVE"]),Mx=o.object({uri:o.string(),name:o.string().optional(),type:o.string().optional(),category:o.string().optional(),status:yd.optional(),autoConnectRecipients:o.boolean().optional(),meta:o.record(o.any()).optional(),claimPermissions:hh.optional(),allowAnyoneToCreateChildren:o.boolean().optional()}),ah=o.object({uri:ye,name:ye,type:ye,category:ye,meta:o.record(ye),status:yd.or(o.object({$in:yd.array()})),autoConnectRecipients:o.boolean()}).partial(),FA=o.union([o.object({$or:ah.array()}),ah]),ZA=ot.extend({records:Mx.array()}),Ux=o.object({to:$r,from:o.string(),received:o.string().optional(),uri:o.string().optional()}),qA=ot.extend({records:Ux.array()}),Bx=o.object({to:$r,from:o.string(),received:o.string().optional(),boostUris:o.array(o.string()),credentialUris:o.array(o.string()).optional()}),$A=ot.extend({records:Bx.array()}),zA=o.object({endpoint:o.string(),name:o.string(),did:o.string().optional()}),WA=o.object({ttlSeconds:o.number().optional(),totalUses:o.number().optional()}),Fx=o.object({endpoint:o.string()}),HA=o.object({signingAuthority:Fx,relationship:o.object({name:o.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:o.string(),isPrimary:o.boolean().optional()})}),GA=o.object({boostUri:o.string(),signingAuthority:o.object({endpoint:o.string(),name:o.string()})}),Zx=o.enum(["live","stale","withdrawn"]),qx=o.object({read:o.object({anonymize:o.boolean().optional(),credentials:o.object({categories:o.record(o.object({required:o.boolean(),defaultEnabled:o.boolean().optional()})).default({})}).default({}),personal:o.record(o.object({required:o.boolean(),defaultEnabled:o.boolean().optional()})).default({})}).default({}),write:o.object({credentials:o.object({categories:o.record(o.object({required:o.boolean(),defaultEnabled:o.boolean().optional()})).default({})}).default({}),personal:o.record(o.object({required:o.boolean(),defaultEnabled:o.boolean().optional()})).default({})}).default({})}),mh=o.object({contract:qx,owner:$r,name:o.string(),subtitle:o.string().optional(),description:o.string().optional(),reasonForAccessing:o.string().optional(),image:o.string().optional(),uri:o.string(),needsGuardianConsent:o.boolean().optional(),redirectUrl:o.string().optional(),frontDoorBoostUri:o.string().optional(),createdAt:o.string(),updatedAt:o.string(),expiresAt:o.string().optional(),autoBoosts:o.string().array().optional(),writers:o.array($r).optional()}),JA=ot.extend({records:mh.omit({owner:!0}).array()}),$x=o.object({credentials:o.object({categories:o.record(o.string().array()).default({})}),personal:o.record(o.string()).default({}),date:o.string()}),QA=ot.extend({records:$x.array()}),zx=o.object({credentials:o.object({category:o.string(),uri:o.string()}).array(),personal:o.record(o.string()).default({}),date:o.string(),contractUri:o.string()}),YA=ot.extend({records:zx.array()}),gh=o.object({sharing:o.boolean().optional(),shared:o.string().array().optional(),shareAll:o.boolean().optional(),shareUntil:o.string().optional()}),yh=o.object({read:o.object({anonymize:o.boolean().optional(),credentials:o.object({shareAll:o.boolean().optional(),sharing:o.boolean().optional(),categories:o.record(gh).default({})}).default({}),personal:o.record(o.string()).default({})}).default({}),write:o.object({credentials:o.object({categories:o.record(o.boolean()).default({})}).default({}),personal:o.record(o.boolean()).default({})}).default({}),deniedWriters:o.array(o.string()).optional()}),KA=ot.extend({records:o.object({expiresAt:o.string().optional(),oneTime:o.boolean().optional(),terms:yh,contract:mh,uri:o.string(),consenter:$r,status:Zx}).array()}),XA=o.object({read:o.object({anonymize:o.boolean().optional(),credentials:o.object({categories:o.record(o.object({required:o.boolean().optional()})).optional()}).optional(),personal:o.record(o.object({required:o.boolean().optional()})).optional()}).optional(),write:o.object({credentials:o.object({categories:o.record(o.object({required:o.boolean().optional()})).optional()}).optional(),personal:o.record(o.object({required:o.boolean().optional()})).optional()}).optional()}),eO=o.object({anonymize:o.boolean().optional(),credentials:o.object({categories:o.record(o.boolean()).optional()}).optional(),personal:o.record(o.boolean()).optional()}),tO=o.object({credentials:o.object({categories:o.record(o.boolean()).optional()}).optional(),personal:o.record(o.boolean()).optional(),id:ye.optional()}),Wx=o.object({read:o.object({anonymize:o.boolean().optional(),credentials:o.object({shareAll:o.boolean().optional(),sharing:o.boolean().optional(),categories:o.record(gh.optional()).optional()}).optional(),personal:o.record(o.string()).optional()}).optional(),write:o.object({credentials:o.object({categories:o.record(o.boolean()).optional()}).optional(),personal:o.record(o.boolean()).optional()}).optional()}),vd=o.enum(["consent","update","sync","withdraw","write"]),rO=o.object({terms:Wx.optional(),action:vd.or(vd.array()).optional(),date:o.object({$gt:o.string()}).or(o.object({$lt:o.string()})).or(o.object({$eq:o.string()})).optional(),expiresAt:o.object({$gt:o.string()}).or(o.object({$lt:o.string()})).or(o.object({$eq:o.string()})).optional(),oneTime:o.boolean().optional()}),vh=o.object({expiresAt:o.string().optional(),oneTime:o.boolean().optional(),terms:yh.optional(),id:o.string(),action:vd,date:o.string(),uris:o.string().array().optional()}),nO=ot.extend({records:vh.array()}),oh=o.object({id:ye,name:ye,description:ye,sourceURI:ye,status:ye}).partial(),iO=o.union([o.object({$or:oh.array()}),oh]),Hx=o.object({credentialUri:o.string(),termsUri:o.string(),contractUri:o.string(),boostUri:o.string(),category:o.string().optional(),date:o.string()}),aO=ot.extend({records:Hx.array()}),Gx=o.enum(["CONNECTION_REQUEST","CONNECTION_ACCEPTED","CREDENTIAL_RECEIVED","CREDENTIAL_ACCEPTED","BOOST_RECEIVED","BOOST_ACCEPTED","PRESENTATION_REQUEST","PRESENTATION_RECEIVED","CONSENT_FLOW_TRANSACTION","ISSUANCE_CLAIMED","ISSUANCE_DELIVERED","ISSUANCE_ERROR","PROFILE_PARENT_APPROVED"]),Jx=o.object({title:o.string().optional(),body:o.string().optional()}),Qx=o.object({type:o.string(),value:o.string()}),Xl=o.enum(["PENDING","ISSUED","EXPIRED","DELIVERED","CLAIMED"]),Yx=o.object({issuanceId:o.string(),status:Xl,recipient:o.object({contactMethod:Qx.optional(),learnCardId:o.string().optional()}),timestamp:o.string().datetime().optional()}),Kx=o.object({vcUris:o.array(o.string()).optional(),vpUris:o.array(o.string()).optional(),transaction:vh.optional(),inbox:Yx.optional(),metadata:o.record(o.unknown()).optional()}).passthrough(),oO=o.object({type:Gx,to:$r.partial().and(o.object({did:o.string()})),from:$r.partial().and(o.object({did:o.string()})),message:Jx.optional(),data:Kx.optional(),sent:o.string().datetime().optional(),webhookUrl:o.string().optional()}),Xx="auth-grant:",sO=o.object({id:o.string(),name:o.string(),description:o.string().optional(),challenge:o.string().startsWith(Xx).min(10,{message:"Challenge is too short"}).max(100,{message:"Challenge is too long"}),status:o.enum(["revoked","active"],{required_error:"Status is required",invalid_type_error:"Status must be either active or revoked"}),scope:o.string(),createdAt:o.string().datetime({message:"createdAt must be a valid ISO 8601 datetime string"}),expiresAt:o.string().datetime({message:"expiresAt must be a valid ISO 8601 datetime string"}).nullish().optional()}),lO=o.object({id:o.string()}).catchall(o.any()),eE=o.enum(["active","revoked"]),cO=o.object({id:ye,name:ye,description:ye,status:eE}).partial(),sh=o.object({id:o.string(),isVerified:o.boolean(),verifiedAt:o.string().optional(),isPrimary:o.boolean(),createdAt:o.string()}),uO=o.discriminatedUnion("type",[o.object({type:o.literal("email"),value:o.string().email()}).merge(sh),o.object({type:o.literal("phone"),value:o.string()}).merge(sh)]),lh=o.object({isVerified:o.boolean().optional(),isPrimary:o.boolean().optional()}),dO=o.discriminatedUnion("type",[o.object({type:o.literal("email"),value:o.string().email()}).merge(lh),o.object({type:o.literal("phone"),value:o.string()}).merge(lh)]),bh=o.discriminatedUnion("type",[o.object({type:o.literal("email"),value:o.string().email()}),o.object({type:o.literal("phone"),value:o.string()})]),tE=o.object({value:o.string(),type:o.enum(["email","phone"])}),fO=o.object({token:o.string()}),pO=o.object({contactMethodId:o.string()}),hO=o.object({contactMethod:tE,otpChallenge:o.string()}),mO=o.object({sessionJwt:o.string()}),rE=o.object({id:o.string(),credential:o.string(),isSigned:o.boolean(),currentStatus:Xl,isAccepted:o.boolean().optional(),expiresAt:o.string(),createdAt:o.string(),issuerDid:o.string(),webhookUrl:o.string().optional(),signingAuthority:o.object({endpoint:o.string().optional(),name:o.string().optional()}).optional()}),gO=o.object({hasMore:o.boolean(),records:o.array(rE),cursor:o.string().optional()}),yO=o.object({currentStatus:Xl,id:o.string(),isSigned:o.boolean(),isAccepted:o.boolean().optional(),issuerDid:o.string()}).partial(),nE=o.object({endpoint:o.string().url(),name:o.string()}),vO=o.object({recipient:bh.describe("The recipient of the credential"),credential:di.passthrough().or(Qa.passthrough()).or(Ja.passthrough()).describe("The credential to issue. If not signed, the users default signing authority will be used, or the specified signing authority in the configuration."),configuration:o.object({signingAuthority:nE.optional().describe("The signing authority to use for the credential. If not provided, the users default signing authority will be used if the credential is not signed."),webhookUrl:o.string().url().optional().describe("The webhook URL to receive credential issuance events."),expiresInDays:o.number().min(1).max(365).optional().describe("The number of days the credential will be valid for."),delivery:o.object({suppress:o.boolean().optional().default(!1).describe("Whether to suppress delivery of the credential to the recipient. If true, the email/sms will not be sent to the recipient. Useful if you would like to manually send claim link to your users."),template:o.object({id:o.enum(["universal-inbox-claim"]).optional().describe("The template ID to use for the credential delivery. If not provided, the default template will be used."),model:o.object({issuer:o.object({name:o.string().optional().describe('The name of the organization (e.g., "State University").'),logoUrl:o.string().url().optional().describe("The URL of the organization's logo.")}).optional(),credential:o.object({name:o.string().optional().describe('The name of the credential (e.g., "Bachelor of Science").'),type:o.string().optional().describe('The type of the credential (e.g., "degree", "certificate").')}).optional(),recipient:o.object({name:o.string().optional().describe('The name of the recipient (e.g., "John Doe").')}).optional()}).describe("The template model to use for the credential delivery. Injects via template variables into email/sms templates. If not provided, the default template will be used.")}).optional().describe("The template to use for the credential delivery. If not provided, the default template will be used.")}).optional().describe("Configuration for the credential delivery i.e. email or SMS. When credentials are sent to a user who has a verified email or phone associated with their account, delivery is skipped, and the credential will be sent using in-app notifications. If not provided, the default configuration will be used.")}).optional().describe("Configuration for the credential issuance. If not provided, the default configuration will be used.")}),bO=o.object({issuanceId:o.string(),status:Xl,recipient:bh,claimUrl:o.string().url().optional(),recipientDid:o.string().optional()}),_O=o.object({credential:di.passthrough().or(Qa.passthrough()).or(Ja.passthrough()).describe("The credential to issue."),configuration:o.object({publishableKey:o.string(),signingAuthorityName:o.string().optional()}).optional()}),_d=o.union([o.string().regex(/^(?:(?:[a-zA-Z0-9-]{1,63}\.)+[a-zA-Z]{2,63}|localhost|\d{1,3}(?:\.\d{1,3}){3})(?::\d{1,5})?$/,{message:"Must be a valid domain (incl. subdomains), localhost, or IPv4, optionally with port"}),o.string().regex(/^https?:\/\/(?:(?:[a-zA-Z0-9-]{1,63}\.)+[a-zA-Z]{2,63}|localhost|\d{1,3}(?:\.\d{1,3}){3})(?::\d{1,5})?$/,{message:"Must be a valid http(s) origin"})]),iE=o.object({id:o.string(),name:o.string(),description:o.string().optional(),publishableKey:o.string(),whitelistedDomains:o.array(_d).default([])}),wO=o.object({name:o.string(),description:o.string().optional(),whitelistedDomains:o.array(_d).default([])}),xO=o.object({name:o.string().optional(),description:o.string().optional(),whitelistedDomains:o.array(_d).optional(),rotatePublishableKey:o.boolean().optional()}),EO=o.object({id:ye,name:ye,description:ye}).partial(),CO=ot.extend({records:iE.array()}),SO=o.object({token:o.string(),contactMethodId:o.string(),autoVerifyContactMethod:o.boolean().optional().default(!1),createdAt:o.string(),expiresAt:o.string(),used:o.boolean()}),TO=o.object({id:o.string(),name:o.string().min(1),slug:o.string().min(1),createdAt:o.string().optional(),updatedAt:o.string().optional()}),ts=o.enum(["active","archived"]),_h=o.object({id:o.string(),statement:o.string(),description:o.string().optional(),code:o.string().optional(),icon:o.string().optional(),type:o.string().default("skill"),status:ts.default("active"),frameworkId:o.string().optional(),createdAt:o.string().optional(),updatedAt:o.string().optional()}),ch=o.object({id:ye,statement:ye,description:ye,code:ye,type:ye,status:ts.or(o.object({$in:ts.array()}))}).partial(),RO=o.union([o.object({$or:ch.array()}),ch]),wd=o.enum(["active","archived"]),wh=o.object({id:o.string(),name:o.string(),description:o.string().optional(),image:o.string().optional(),sourceURI:o.string().url().optional(),status:wd.default("active"),createdAt:o.string().optional(),updatedAt:o.string().optional()}),kO=ot.extend({records:wh.array()}),xd=_h.extend({children:o.array(o.lazy(()=>xd)),hasChildren:o.boolean(),childrenCursor:o.string().nullable().optional()}).openapi({ref:"SkillTreeNode"}),aE=o.object({hasMore:o.boolean(),cursor:o.string().nullable(),records:o.array(xd)}),Ya=o.lazy(()=>o.object({id:o.string().optional(),statement:o.string(),description:o.string().optional(),code:o.string().optional(),icon:o.string().optional(),type:o.string().optional(),status:ts.optional(),children:o.array(Ya).optional()})).openapi({ref:"SkillTreeNodeInput"}),AO=o.object({frameworkId:o.string()}),oE=o.object({id:o.string().optional(),name:o.string().min(1),description:o.string().optional(),image:o.string().optional(),sourceURI:o.string().url().optional(),status:wd.optional(),skills:o.array(Ya).optional(),boostUris:o.array(o.string()).optional()}),OO=o.object({id:o.string(),name:o.string().min(1).optional(),description:o.string().optional(),image:o.string().optional(),sourceURI:o.string().url().optional(),status:wd.optional()}).refine(n=>n.name!==void 0||n.description!==void 0||n.image!==void 0||n.sourceURI!==void 0||n.status!==void 0,{message:"At least one field must be provided to update",path:["name"]}),IO=o.object({id:o.string()}),PO=o.object({frameworks:o.array(oE.extend({skills:o.array(Ya).optional()})).min(1)}),VO=o.object({frameworkId:o.string(),profileId:o.string()}),NO=o.object({frameworkId:o.string()}),jO=$r.array(),DO=o.object({id:o.string()}),LO=o.object({slug:o.string().min(1),name:o.string().min(1)}),MO=o.object({frameworkId:o.string(),skill:Ya,parentId:o.string().nullable().optional()}),UO=o.object({frameworkId:o.string(),id:o.string(),statement:o.string().optional(),description:o.string().optional(),code:o.string().optional(),icon:o.string().optional(),type:o.string().optional(),status:ts.optional()}).refine(n=>n.statement!==void 0||n.description!==void 0||n.code!==void 0||n.icon!==void 0||n.type!==void 0||n.status!==void 0,{message:"At least one field must be provided to update a skill",path:["statement"]}),sE=o.enum(["recursive","reparent"]),BO=o.object({frameworkId:o.string(),id:o.string(),strategy:sE.optional().default("reparent")}),FO=o.object({frameworkId:o.string(),skills:o.array(Ya).min(1),parentId:o.string().nullable().optional()}),ZO=o.object({frameworkId:o.string(),skills:o.array(Ya).min(0)}),qO=o.object({created:o.number().int().min(0),updated:o.number().int().min(0),deleted:o.number().int().min(0),unchanged:o.number().int().min(0),total:o.number().int().min(0)}),$O=o.object({frameworkId:o.string(),skillId:o.string().optional(),recursive:o.boolean().optional().default(!1),onlyCountCompetencies:o.boolean().optional().default(!1)}),zO=o.object({count:o.number().int().min(0)}),WO=o.object({frameworkId:o.string()}),HO=o.object({skills:o.array(xd)}),GO=o.object({frameworkId:o.string(),skillId:o.string()}),JO=o.object({path:o.array(_h)}),QO=o.object({framework:wh,skills:aE});var Ah=ip(Th());var Ka={"SHA-1":{outputLength:20,blockSize:64},"SHA-256":{outputLength:32,blockSize:64},"SHA-384":{outputLength:48,blockSize:128},"SHA-512":{outputLength:64,blockSize:128}};function kh(n,r,c,d,p="SHA-256"){return new Promise((g,y)=>{p in Ka||y(new RangeError(`Valid hash algorithm values are any of ${Object.keys(Ka).toString()}`)),typeof n=="string"?n=new TextEncoder().encode(n):n instanceof ArrayBuffer?n=new Uint8Array(n):ArrayBuffer.isView(n)||y(RangeError("P should be string, ArrayBuffer, TypedArray, DataView")),typeof r=="string"?r=new TextEncoder().encode(r):r instanceof ArrayBuffer?r=new Uint8Array(r):ArrayBuffer.isView(r)?r=new Uint8Array(r.buffer,r.byteOffset,r.byteLength):y(RangeError("S should be string, ArrayBuffer, TypedArray, DataView")),crypto.subtle.importKey("raw",n,"PBKDF2",!1,["deriveBits"]).then(E=>{let T={name:"PBKDF2",hash:p,salt:r,iterations:c};crypto.subtle.deriveBits(T,E,8*d).then(V=>g(V),V=>{(async function(q,j,O,R,Z){if(!(Z in Ka))throw new RangeError(`Valid hash algorithm values are any of ${Object.keys(Ka).toString()}`);if(!Number.isInteger(O)||O<=0)throw new RangeError("c must be a positive integer");let A=Ka[Z].outputLength;if(!Number.isInteger(R)||R<=0||R>=(2**32-1)*A)throw new RangeError("dkLen must be a positive integer < (2 ** 32 - 1) * hLen");let X=Math.ceil(R/A),K=R-(X-1)*A,ne=new Array(X);q.byteLength===0&&(q=new Uint8Array(Ka[Z].blockSize));let ke=await crypto.subtle.importKey("raw",q,{name:"HMAC",hash:{name:Z}},!0,["sign"]),xe=l(async function(Be,zr){let z=await crypto.subtle.sign("HMAC",Be,zr);return new Uint8Array(z)},"g");for(let Be=0;Be<X;Be++)ne[Be]=await Ne(ke,j,O,Be+1);async function Ne(Be,zr,z,Qe){function re(Cr){let vn=new ArrayBuffer(4);return new DataView(vn).setUint32(0,Cr,!1),new Uint8Array(vn)}l(re,"i");let Qt=await xe(Be,Rh(zr,re(Qe))),qe=Qt;for(let Cr=1;Cr<z;Cr++)qe=await xe(Be,qe),yE(Qt,qe);return Qt}return l(Ne,"h"),ne[X-1]=ne[X-1].slice(0,K),Rh(...ne).buffer})(n,r,c,d,p).then(q=>g(q),q=>y(q))})},E=>y(E))})}l(kh,"t");function Rh(...n){let r=n.reduce((p,g)=>p+g.length,0);if(n.length===0)throw new RangeError("Cannot concat no arrays");let c=new Uint8Array(r),d=0;for(let p of n)c.set(p,d),d+=p.length;return c}l(Rh,"r");function yE(n,r){for(let c=0;c<n.length;c++)n[c]^=r[c]}l(yE,"n");var Xa=l(async(n,r)=>{let c=await n.invoke.hash?.(r,"PBKDF2-HMAC-SHA256");if(c)return c;let d=n.invoke.crypto(),p=new TextEncoder().encode(r),g=n.id.keypair("secp256k1").d,y=await kh(g,"salt",1e3,32),E=await d.subtle.importKey("raw",y,{name:"HMAC",hash:"SHA-256"},!1,["sign"]),T=await d.subtle.sign("HMAC",E,p);return Array.from(new Uint8Array(T)).map(q=>q.toString(16).padStart(2,"0")).join("")},"hash"),Jt=l(async(n,r,c)=>n.invoke.createDagJwe(c,[r]),"generateJWE"),Er=l(async(n,r)=>n.invoke.decryptDagJwe(r),"decryptJWE"),Xi=l(async(n,r,c=[])=>{let d=Object.entries(r);return(await Promise.all(d.map(async([p,g])=>c.includes(p)?"":await Xa(n,`${p}:${(0,Ah.default)(g)}`)))).filter(Boolean)},"generateEncryptedFieldsArray"),ea=l(async(n,r,c=[])=>{let d=await n.invoke.createDagJwe(r),p=await Xi(n,r,c);return{...Object.fromEntries(Object.entries(r).filter(([y])=>c.includes(y))),encryptedRecord:d,fields:p}},"generateEncryptedRecord");var Ed=l(async(n,r)=>Lp(n,async c=>{let d=await r.invoke.getDidAuthVp({proofFormat:"jwt",challenge:c});if(typeof d!="string")throw new Error("Error getting DID-Auth-JWT!");return d}),"getLearnCloudClient"),vE=l(async(n,r,c=[],d=[],p=!0)=>{let g=n;g.debug?.("Adding LearnCloud Plugin");let y=await Ed(r,g),E=[g.id.did()];y.user.getDids.query().then(O=>E=O);let T={},V=y.utilities.getDid.query(),q=l(async O=>(T[O]||(T[O]=await Ed(O,g)),T[O]),"getOtherClient"),j=l(async O=>{let R=g.id.did(),Z=O.id.did();if(R!==Z){if(!E.includes(Z)&&p){let A=await O.invoke.getDidAuthVp();await y.user.addDid.mutate({presentation:A}),Z.split(":")[1]==="web"&&await y.user.setPrimaryDid.mutate({presentation:A}),E=await y.user.getDids.query()}y=await Ed(r,O)}g=O},"updateLearnCard");return{name:"LearnCloud",displayName:"LearnCloud",description:"LearnCloud Integration",methods:{learnCloudCreate:async(O,R)=>{await j(O);let Z=await ea(O,R,d);return y.customStorage.create.mutate({item:await Jt(O,await V,Z)})},learnCloudCreateMany:async(O,R)=>{await j(O);let Z=await Promise.all(R.map(async A=>ea(O,A,d)));return y.customStorage.createMany.mutate({items:await Jt(O,await V,Z)})},learnCloudRead:async(O,R,Z)=>{await j(O);let A=[],X=await O.invoke.learnCloudReadPage(R,{},Z);for(A.push(...X.records);X.hasMore;)X=await O.invoke.learnCloudReadPage(R,{},Z),A.push(...X.records);return A},learnCloudReadPage:async(O,R,Z,A)=>{if(await j(O),!R){let xe=await y.customStorage.read.query({includeAssociatedDids:A,...Z}),Ne=zi(xe)?await Er(O,xe):xe;return{...Ne,records:await Promise.all(Ne.records.map(async Be=>({...await Er(O,Be.encryptedRecord),_id:Be._id})))}}let X=await Xi(O,R,[...d,"_id"]),K=Object.fromEntries(Object.entries(R).filter(([xe])=>[...d,"_id"].includes(xe))),ne=await y.customStorage.read.query({query:await Jt(O,await V,{...K,...X.length>0?{fields:{$in:X}}:{}}),...Z,includeAssociatedDids:A}),ke=zi(ne)?await Er(O,ne):ne;return{...ke,records:await Promise.all(ke.records.map(async xe=>({...await Er(O,xe.encryptedRecord),_id:xe._id})))}},learnCloudCount:async(O,R,Z)=>{if(await j(O),!R)return y.customStorage.count.query({includeAssociatedDids:Z});let A=await Xi(O,R,[...d,"_id"]),X=Object.fromEntries(Object.entries(R).filter(([K])=>[...d,"_id"].includes(K)));return y.customStorage.count.query({query:await Jt(O,await V,{...X,...A.length>0?{fields:{$in:A}}:{}}),includeAssociatedDids:Z})},learnCloudUpdate:async(O,R,Z)=>{await j(O);let A=await O.invoke.learnCloudRead(R);return(await Promise.all(A.map(async K=>y.customStorage.update.mutate({query:await Jt(O,await V,{_id:K._id}),update:await Jt(O,await V,await ea(O,{...K,...Z},d))})))).reduce((K,ne)=>ne+K,0)},learnCloudDelete:async(O,R,Z)=>{if(await j(O),!R)return y.customStorage.delete.mutate({includeAssociatedDids:Z});let A=await Xi(O,R,[...d,"_id"]),X=Object.fromEntries(Object.entries(R).filter(([K])=>[...d,"_id"].includes(K)));return y.customStorage.delete.mutate({query:await Jt(O,await V,{...X,...A.length>0?{fields:{$in:A}}:{}}),includeAssociatedDids:Z})},learnCloudBatchResolve:async(O,R)=>{let Z=await y.storage.batchResolve.query({uris:R});return Promise.all(Z.map(async A=>{if(!A)return null;try{let X=await O.invoke.decryptDagJwe(A);return await di.or(Qa).parseAsync(X)}catch(X){return O.debug?.(X),null}}))}},read:{get:async(O,R)=>{if(g.debug?.("LearnCloud read.get",R),!R)return;let Z=R.split(":");if(g.debug?.("LearnCloud read.get parts:",Z),Z.length!==5)return;let[A,X,K]=Z;if(A!=="lc"||X!=="cloud"){g.debug?.("LearnCloud read.get not cloud URI!",{lc:A,method:X});return}if(K.replace(/https?:\/\//g,"")!==r.replace(/https?:\/\//g,"").replace(/:/g,"%3A")){let ne=(K.startsWith("http")?K:`http${K.includes("http")||K.includes("localhost")?"":"s"}://${K}`).replaceAll("%3A",":");g.debug?.("LearnCloud read.get different LearnCloud!",{uriUrl:K,url:r,fullUrl:ne,comparison:{a:K.replace(/https?:\/\//g,""),b:r.replace(/https?:\/\//g,"").replace(/:/g,"%3A")}});let ke=await q(ne);try{let xe=await ke.storage.resolve.query({uri:R});g.debug?.("LearnCloud read.get result",xe);let Ne=await O.invoke.decryptDagJwe(xe);return g.debug?.("LearnCloud read.get decryptedResult",Ne),await di.or(Qa).parseAsync(Ne)}catch(xe){O.debug?.(xe);return}}try{let ne=await y.storage.resolve.query({uri:R});g.debug?.("LearnCloud read.get result",ne);let ke=await O.invoke.decryptDagJwe(ne);return g.debug?.("LearnCloud read.get decryptedResult",ke),await di.or(Qa).parseAsync(ke)}catch(ne){O.debug?.(ne);return}}},store:{upload:async(O,R)=>(O.debug?.("learnCard.store['LearnCard Network'].upload"),y.storage.store.mutate({item:R})),uploadEncrypted:async(O,R,{recipients:Z=[]}={recipients:[]})=>{O.debug?.("learnCard.store['LearnCard Network'].upload");let A=await O.invoke.createDagJwe(R,[O.id.did(),...Z]);return y.storage.store.mutate({item:A})}},index:{get:async(O,R)=>{await j(O);let Z=[],A=await O.index.LearnCloud.getPage(R);for(Z.push(...A.records);A.hasMore;)A=await O.index.LearnCloud.getPage(R,{cursor:A.cursor}),Z.push(...A.records);return Z},getPage:async(O,R,Z)=>{await j(O),O.debug?.("LearnCloud index.getPaginated",R,Z);let A={...Z,sort:["newestFirst","oldestFirst"].includes(Z?.sort??"")?Z?.sort:void 0};if(!R){O.debug?.("LearnCloud index.get (no query)");let xe=await y.index.get.query(A);O.debug?.("LearnCloud index.get (no query response)",xe);let Ne=zi(xe)?await Er(O,xe):xe;return O.debug?.("LearnCloud index.get (no query encryptedRecords)",Ne),{...Ne,records:await Promise.all(Ne.records.map(async Be=>Er(O,Be.encryptedRecord)))}}O.debug?.("LearnCloud index.get (query)");let X=await Xi(O,R,c);O.debug?.("LearnCloud index.get (query fields)",X);let K=Object.fromEntries(Object.entries(R).filter(([xe])=>c.includes(xe)));O.debug?.("LearnCloud index.get (query unencryptedEntries)",K);let ne=await y.index.get.query({query:await Jt(O,await V,{...K,...X.length>0?{fields:{$in:X}}:{}}),...A});O.debug?.("LearnCloud index.get (query jwe)",ne);let ke=zi(ne)?await Er(O,ne):ne;return O.debug?.("LearnCloud index.get (query encryptedRecords)",ke),{...ke,records:await Promise.all(ke.records.map(async xe=>Er(O,xe.encryptedRecord)))}},getCount:async(O,R)=>{if(await j(O),!R){O.debug?.("LearnCloud index.count (no query)");let ne=await y.index.count.query();O.debug?.("LearnCloud index.count (no query response)",ne);let ke=zi(ne)?await Er(O,ne):ne;return O.debug?.("LearnCloud index.count (no query count)",ke),ke}O.debug?.("LearnCloud index.getCount (query)");let Z=await Xi(O,R,c);O.debug?.("LearnCloud index.getCount (query fields)",Z);let A=Object.fromEntries(Object.entries(R).filter(([ne])=>c.includes(ne)));O.debug?.("LearnCloud index.getCount (query unencryptedEntries)",A);let X=await y.index.count.query({query:await Jt(O,await V,{...A,...Z.length>0?{fields:{$in:Z}}:{}})});O.debug?.("LearnCloud index.count (query response)",X);let K=zi(X)?await Er(O,X):X;return O.debug?.("LearnCloud index.count (query count)",K),K},add:async(O,R)=>{await j(O);let Z=R.id||O.invoke.crypto().randomUUID();return y.index.add.mutate({record:await Jt(O,await V,{...await ea(O,{...R,id:Z},c),id:await Xa(O,Z)})})},addMany:async(O,R)=>(await j(O),(await Promise.all((0,Oh.chunk)(R,25).map(async A=>{let X=await Promise.all(A.map(async K=>{let ne=K.id||O.invoke.crypto().randomUUID();return{...await ea(O,{...K,id:ne},c),id:await Xa(O,ne)}}));return y.index.addMany.mutate({records:await Jt(O,await V,X)})}))).every(Boolean)),update:async(O,R,Z)=>{await j(O);let A=await O.index.LearnCloud.get({id:R});if(A.length!==1)return!1;let K={...A[0],...Z};return y.index.update.mutate({id:await Xa(O,R),updates:await Jt(O,await V,await ea(O,K,c))})},remove:async(O,R)=>(await j(O),y.index.remove.mutate({id:await Xa(O,R)})),removeAll:async O=>(await j(O),y.index.removeAll.mutate())}}},"getLearnCloudPlugin");
|
|
25
25
|
/* istanbul ignore file -- @preserve */
|
|
26
26
|
/* istanbul ignore if -- @preserve */
|
|
27
27
|
/* istanbul ignore next -- @preserve */
|