@learncard/network-plugin 2.6.3 → 2.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- "use strict";var Gi=Object.defineProperty;var vl=Object.getOwnPropertyDescriptor;var bl=Object.getOwnPropertyNames;var _l=Object.prototype.hasOwnProperty;var b=(n,e)=>Gi(n,"name",{value:e,configurable:!0});var wl=(n,e)=>{for(var s in e)Gi(n,s,{get:e[s],enumerable:!0})},Cl=(n,e,s,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of bl(e))!_l.call(n,c)&&c!==s&&Gi(n,c,{get:()=>e[c],enumerable:!(l=vl(e,c))||l.enumerable});return n};var xl=n=>Cl(Gi({},"__esModule",{value:!0}),n);var Mp={};wl(Mp,{getLearnCardNetworkPlugin:()=>Np,getVerifyBoostPlugin:()=>Dp});module.exports=xl(Mp);function De(n){let e={subscribe(s){let l=null,c=!1,g=!1,y=!1;function v(){if(l===null){y=!0;return}g||(g=!0,typeof l=="function"?l():l&&l.unsubscribe())}return b(v,"unsubscribe"),l=n({next(h){c||s.next?.(h)},error(h){c||(c=!0,s.error?.(h),v())},complete(){c||(c=!0,s.complete?.(),v())}}),y&&v(),{unsubscribe:v}},pipe(...s){return s.reduce(El,e)}};return e}b(De,"observable");function El(n,e){return e(n)}b(El,"pipeReducer");function cs(n){let e=new AbortController;return new Promise((l,c)=>{let g=!1;function y(){g||(g=!0,v.unsubscribe())}b(y,"onDone"),e.signal.addEventListener("abort",()=>{c(e.signal.reason)});let v=n.subscribe({next(h){g=!0,l(h),y()},error(h){c(h)},complete(){e.abort(),y()}})})}b(cs,"observableToPromise");function ls(n){return e=>{let s=0,l=null,c=[];function g(){l||(l=e.subscribe({next(v){for(let h of c)h.next?.(v)},error(v){for(let h of c)h.error?.(v)},complete(){for(let v of c)v.complete?.()}}))}b(g,"startIfNeeded");function y(){if(s===0&&l){let v=l;l=null,v.unsubscribe()}}return b(y,"resetIfNeeded"),De(v=>(s++,c.push(v),g(),{unsubscribe(){s--,y();let h=c.findIndex(m=>m===v);h>-1&&c.splice(h,1)}}))}}b(ls,"share");var Bp=Symbol();function ra(n){let e=n,s=[],l=b(y=>{e!==void 0&&y.next(e),s.push(y)},"addObserver"),c=b(y=>{s.splice(s.indexOf(y),1)},"removeObserver"),g=De(y=>(l(y),()=>{c(y)}));return g.next=y=>{if(e!==y){e=y;for(let v of s)v.next(y)}},g.get=()=>e,g}b(ra,"behaviorSubject");function ds(n){return De(e=>{function s(c=0,g=n.op){let y=n.links[c];if(!y)throw new Error("No more links to execute - did you forget to add an ending link?");return y({op:g,next(h){return s(c+1,h)}})}return b(s,"execute"),s().subscribe(e)})}b(ds,"createChain");var Ks=b(()=>{},"noop"),Ys=b(n=>{Object.freeze&&Object.freeze(n)},"freezeIfAvailable");function Xs(n,e,s){var l,c;let g=e.join(".");return(l=s)[c=g]??(l[c]=new Proxy(Ks,{get(y,v){if(!(typeof v!="string"||v==="then"))return Xs(n,[...e,v],s)},apply(y,v,h){let m=e[e.length-1],E={args:h,path:e};return m==="call"?E={args:h.length>=2?[h[1]]:[],path:e.slice(0,-1)}:m==="apply"&&(E={args:h.length>=2?h[1]:[],path:e.slice(0,-1)}),Ys(E.args),Ys(E.path),n(E)}})),s[g]}b(Xs,"createInnerProxy");var na=b(n=>Xs(n,[],Object.create(null)),"createRecursiveProxy"),Ji=b(n=>new Proxy(Ks,{get(e,s){if(s!=="then")return n(s)}}),"createFlatProxy");var Dr=b(({shape:n})=>n,"defaultFormatter");var Mr={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 us=[Mr.BAD_GATEWAY,Mr.SERVICE_UNAVAILABLE,Mr.GATEWAY_TIMEOUT,Mr.INTERNAL_SERVER_ERROR];var ec=Symbol();function Ya(n,...e){let s=Object.assign(Object.create(null),n);for(let l of e)for(let c in l){if(c in s&&s[c]!==l[c])throw new Error(`Duplicate key ${c}`);s[c]=l[c]}return s}b(Ya,"mergeWithoutOverrides");function xe(n){return!!n&&!Array.isArray(n)&&typeof n=="object"}b(xe,"isObject");function Qi(n){return typeof n=="function"}b(Qi,"isFunction");function Ka(n){return Object.assign(Object.create(null),n)}b(Ka,"omitPrototype");function rc(n,e,s){return e in n?Object.defineProperty(n,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[e]=s,n}b(rc,"_define_property");var Yi=class extends Error{};b(Yi,"UnknownCauseError");function nc(n){if(n instanceof Error)return n;let e=typeof n;if(!(e==="undefined"||e==="function"||n===null)){if(e!=="object")return new Error(String(n));if(xe(n))return Object.assign(new Yi,n)}}b(nc,"getCauseFromUnknown");function or(n){if(n instanceof Le||n instanceof Error&&n.name==="TRPCError")return n;let e=new Le({code:"INTERNAL_SERVER_ERROR",cause:n});return n instanceof Error&&n.stack&&(e.stack=n.stack),e}b(or,"getTRPCErrorFromUnknown");var Le=class extends Error{constructor(e){let s=nc(e.cause),l=e.message??s?.message??e.code;super(l,{cause:s}),rc(this,"cause",void 0),rc(this,"code",void 0),this.code=e.code,this.name="TRPCError",this.cause??(this.cause=s)}};b(Le,"TRPCError");function ps(n){return"input"in n?n:{input:n,output:n}}b(ps,"getDataTransformer");var Lr={input:{serialize:n=>n,deserialize:n=>n},output:{serialize:n=>n,deserialize:n=>n}};function Pl(n,e){if("error"in n){let l=e.deserialize(n.error);return{ok:!1,error:{...n,error:l}}}let s={...n.result,...(!n.result.type||n.result.type==="data")&&{type:"data",data:e.deserialize(n.result.data)}};return{ok:!0,result:s}}b(Pl,"transformResultInner");var aa=class extends Error{constructor(){super("Unable to transform response from server")}};b(aa,"TransformResultError");function Xa(n,e){let s;try{s=Pl(n,e)}catch{throw new aa}if(!s.ok&&(!xe(s.error.error)||typeof s.error.error.code!="number"))throw new aa;if(s.ok&&!xe(s.result))throw new aa;return s}b(Xa,"transformResult");var Ol=Symbol("lazy");function jl(n){let e=Symbol(),s=e;return()=>(s===e&&(s=n()),s)}b(jl,"once");function Vl(n){return typeof n=="function"&&Ol in n}b(Vl,"isLazy");function Al(n){return xe(n)&&xe(n._def)&&"router"in n._def}b(Al,"isRouter");var Il={_ctx:null,_errorShape:null,_meta:null,queries:{},mutations:{},subscriptions:{},errorFormatter:Dr,transformer:Lr},Nl=["then","call","apply"];function Ki(n){function e(s){let l=new Set(Object.keys(s).filter(P=>Nl.includes(P)));if(l.size>0)throw new Error("Reserved words used in `router({})` call: "+Array.from(l).join(", "));let c=Ka({}),g=Ka({});function y(P){return{ref:P.ref,load:jl(async()=>{let z=await P.ref(),O=[...P.path,P.key],oe=O.join(".");P.aggregate[P.key]=v(z._def.record,O),delete g[oe];for(let[j,ke]of Object.entries(z._def.lazy)){let Re=[...O,j].join(".");g[Re]=y({ref:ke.ref,path:O,key:j,aggregate:P.aggregate[P.key]})}})}}b(y,"createLazyLoader");function v(P,z=[]){let O=Ka({});for(let[oe,j]of Object.entries(P??{})){if(Vl(j)){g[[...z,oe].join(".")]=y({path:z,ref:j,key:oe,aggregate:O});continue}if(Al(j)){O[oe]=v(j._def.record,[...z,oe]);continue}if(!Dl(j)){O[oe]=v(j,[...z,oe]);continue}let ke=[...z,oe].join(".");if(c[ke])throw new Error(`Duplicate key: ${ke}`);c[ke]=j,O[oe]=j}return O}b(v,"step");let h=v(s),m={_config:n,router:!0,procedures:c,lazy:g,...Il,record:h};return{...h,_def:m,createCaller:Xi()({_def:m})}}return b(e,"createRouterInner"),e}b(Ki,"createRouterFactory");function Dl(n){return typeof n=="function"}b(Dl,"isProcedure");async function fs(n,e){let{_def:s}=n,l=s.procedures[e];for(;!l;){let c=Object.keys(s.lazy).find(y=>e.startsWith(y));if(!c)return null;await s.lazy[c].load(),l=s.procedures[e]}return l}b(fs,"getProcedureAtPath");function Xi(){return b(function(e){let{_def:s}=e;return b(function(c,g){return na(async({path:y,args:v})=>{let h=y.join(".");if(y.length===1&&y[0]==="_def")return s;let m=await fs(e,h),E;try{if(!m)throw new Le({code:"NOT_FOUND",message:`No procedure found on path "${y}"`});return E=Qi(c)?await Promise.resolve(c()):c,await m({path:h,getRawInput:async()=>v[0],ctx:E,type:m._def.type,signal:g?.signal})}catch(P){throw g?.onError?.({ctx:E,error:or(P),input:v[0],path:h,type:m?._def.type??"unknown"}),P}})},"createCaller")},"createCallerInner")}b(Xi,"createCallerFactory");function hs(...n){let e=Ya({},...n.map(g=>g._def.record)),s=n.reduce((g,y)=>{if(y._def._config.errorFormatter&&y._def._config.errorFormatter!==Dr){if(g!==Dr&&g!==y._def._config.errorFormatter)throw new Error("You seem to have several error formatters");return y._def._config.errorFormatter}return g},Dr),l=n.reduce((g,y)=>{if(y._def._config.transformer&&y._def._config.transformer!==Lr){if(g!==Lr&&g!==y._def._config.transformer)throw new Error("You seem to have several transformers");return y._def._config.transformer}return g},Lr);return Ki({errorFormatter:s,transformer:l,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})(e)}b(hs,"mergeRouters");var Ll;Ll=Symbol.toStringTag;var ac,ic;(ac=Symbol).dispose??(ac.dispose=Symbol());(ic=Symbol).asyncDispose??(ic.asyncDispose=Symbol());var gs=Symbol();var cc=Symbol("ping");var oh=Symbol();var to="middlewareMarker";function Cs(){function n(s){return{_middlewares:s,unstable_pipe(l){let c="_middlewares"in l?l._middlewares:[l];return n([...s,...c])}}}b(n,"createMiddlewareInner");function e(s){return n([s])}return b(e,"createMiddleware"),e}b(Cs,"createMiddlewareFactory");function xs(n){let e=b(async function(l){let c,g=await l.getRawInput();try{c=await n(g)}catch(v){throw new Le({code:"BAD_REQUEST",cause:v})}let y=xe(l.input)&&xe(c)?{...l.input,...c}:c;return l.next({input:y})},"inputValidatorMiddleware");return e._type="input",e}b(xs,"createInputMiddleware");function Es(n){let e=b(async function({next:l}){let c=await l();if(!c.ok)return c;try{let g=await n(c.data);return{...c,data:g}}catch(g){throw new Le({message:"Output validation failed",code:"INTERNAL_SERVER_ERROR",cause:g})}},"outputValidatorMiddleware");return e._type="output",e}b(Es,"createOutputMiddleware");function Yl(n,e,s){return e in n?Object.defineProperty(n,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[e]=s,n}b(Yl,"_define_property");var kn=class extends Error{constructor(e){super(e[0]?.message),Yl(this,"issues",void 0),this.name="SchemaError",this.issues=e}};b(kn,"StandardSchemaV1Error");function ro(n){let e=n,s="~standard"in e;if(typeof e=="function"&&typeof e.assert=="function")return e.assert.bind(e);if(typeof e=="function"&&!s)return e;if(typeof e.parseAsync=="function")return e.parseAsync.bind(e);if(typeof e.parse=="function")return e.parse.bind(e);if(typeof e.validateSync=="function")return e.validateSync.bind(e);if(typeof e.create=="function")return e.create.bind(e);if(typeof e.assert=="function")return l=>(e.assert(l),l);if(s)return async l=>{let c=await e["~standard"].validate(l);if(c.issues)throw new kn(c.issues);return c.value};throw new Error("Could not find a validator fn")}b(ro,"getParseFn");function Zr(n,e){let{middlewares:s=[],inputs:l,meta:c,...g}=e;return no({...Ya(n,g),inputs:[...n.inputs,...l??[]],middlewares:[...n.middlewares,...s],meta:n.meta&&c?{...n.meta,...c}:c??n.meta})}b(Zr,"createNewBuilder");function no(n={}){let e={procedure:!0,inputs:[],middlewares:[],...n};return{_def:e,input(l){let c=ro(l);return Zr(e,{inputs:[l],middlewares:[xs(c)]})},output(l){let c=ro(l);return Zr(e,{output:l,middlewares:[Es(c)]})},meta(l){return Zr(e,{meta:l})},use(l){let c="_middlewares"in l?l._middlewares:[l];return Zr(e,{middlewares:c})},unstable_concat(l){return Zr(e,l._def)},concat(l){return Zr(e,l._def)},query(l){return Ts({...e,type:"query"},l)},mutation(l){return Ts({...e,type:"mutation"},l)},subscription(l){return Ts({...e,type:"subscription"},l)},experimental_caller(l){return Zr(e,{caller:l})}}}b(no,"createBuilder");function Ts(n,e){let s=Zr(n,{resolver:e,middlewares:[b(async function(h){let m=await e(h);return{marker:to,ok:!0,data:m,ctx:h.ctx}},"resolveMiddleware")]}),l={...s._def,type:n.type,experimental_caller:Boolean(s._def.caller),meta:s._def.meta,$types:null},c=Xl(s._def),g=s._def.caller;if(!g)return c;let y=b(async(...v)=>await g({args:v,invoke:c,_def:l}),"callerWrapper");return y._def=l,y}b(Ts,"createResolver");var Kl=`
1
+ "use strict";var Hi=Object.defineProperty;var vl=Object.getOwnPropertyDescriptor;var bl=Object.getOwnPropertyNames;var _l=Object.prototype.hasOwnProperty;var b=(n,e)=>Hi(n,"name",{value:e,configurable:!0});var wl=(n,e)=>{for(var s in e)Hi(n,s,{get:e[s],enumerable:!0})},Cl=(n,e,s,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of bl(e))!_l.call(n,c)&&c!==s&&Hi(n,c,{get:()=>e[c],enumerable:!(l=vl(e,c))||l.enumerable});return n};var xl=n=>Cl(Hi({},"__esModule",{value:!0}),n);var Mp={};wl(Mp,{getLearnCardNetworkPlugin:()=>Np,getVerifyBoostPlugin:()=>Dp});module.exports=xl(Mp);function De(n){let e={subscribe(s){let l=null,c=!1,g=!1,y=!1;function v(){if(l===null){y=!0;return}g||(g=!0,typeof l=="function"?l():l&&l.unsubscribe())}return b(v,"unsubscribe"),l=n({next(f){c||s.next?.(f)},error(f){c||(c=!0,s.error?.(f),v())},complete(){c||(c=!0,s.complete?.(),v())}}),y&&v(),{unsubscribe:v}},pipe(...s){return s.reduce(El,e)}};return e}b(De,"observable");function El(n,e){return e(n)}b(El,"pipeReducer");function cs(n){let e=new AbortController;return new Promise((l,c)=>{let g=!1;function y(){g||(g=!0,v.unsubscribe())}b(y,"onDone"),e.signal.addEventListener("abort",()=>{c(e.signal.reason)});let v=n.subscribe({next(f){g=!0,l(f),y()},error(f){c(f)},complete(){e.abort(),y()}})})}b(cs,"observableToPromise");function ls(n){return e=>{let s=0,l=null,c=[];function g(){l||(l=e.subscribe({next(v){for(let f of c)f.next?.(v)},error(v){for(let f of c)f.error?.(v)},complete(){for(let v of c)v.complete?.()}}))}b(g,"startIfNeeded");function y(){if(s===0&&l){let v=l;l=null,v.unsubscribe()}}return b(y,"resetIfNeeded"),De(v=>(s++,c.push(v),g(),{unsubscribe(){s--,y();let f=c.findIndex(m=>m===v);f>-1&&c.splice(f,1)}}))}}b(ls,"share");var Bp=Symbol();function ra(n){let e=n,s=[],l=b(y=>{e!==void 0&&y.next(e),s.push(y)},"addObserver"),c=b(y=>{s.splice(s.indexOf(y),1)},"removeObserver"),g=De(y=>(l(y),()=>{c(y)}));return g.next=y=>{if(e!==y){e=y;for(let v of s)v.next(y)}},g.get=()=>e,g}b(ra,"behaviorSubject");function ds(n){return De(e=>{function s(c=0,g=n.op){let y=n.links[c];if(!y)throw new Error("No more links to execute - did you forget to add an ending link?");return y({op:g,next(f){return s(c+1,f)}})}return b(s,"execute"),s().subscribe(e)})}b(ds,"createChain");var Ks=b(()=>{},"noop"),Ys=b(n=>{Object.freeze&&Object.freeze(n)},"freezeIfAvailable");function Xs(n,e,s){var l,c;let g=e.join(".");return(l=s)[c=g]??(l[c]=new Proxy(Ks,{get(y,v){if(!(typeof v!="string"||v==="then"))return Xs(n,[...e,v],s)},apply(y,v,f){let m=e[e.length-1],E={args:f,path:e};return m==="call"?E={args:f.length>=2?[f[1]]:[],path:e.slice(0,-1)}:m==="apply"&&(E={args:f.length>=2?f[1]:[],path:e.slice(0,-1)}),Ys(E.args),Ys(E.path),n(E)}})),s[g]}b(Xs,"createInnerProxy");var na=b(n=>Xs(n,[],Object.create(null)),"createRecursiveProxy"),Ji=b(n=>new Proxy(Ks,{get(e,s){if(s!=="then")return n(s)}}),"createFlatProxy");var Dr=b(({shape:n})=>n,"defaultFormatter");var Mr={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 us=[Mr.BAD_GATEWAY,Mr.SERVICE_UNAVAILABLE,Mr.GATEWAY_TIMEOUT,Mr.INTERNAL_SERVER_ERROR];var ec=Symbol();function Ya(n,...e){let s=Object.assign(Object.create(null),n);for(let l of e)for(let c in l){if(c in s&&s[c]!==l[c])throw new Error(`Duplicate key ${c}`);s[c]=l[c]}return s}b(Ya,"mergeWithoutOverrides");function xe(n){return!!n&&!Array.isArray(n)&&typeof n=="object"}b(xe,"isObject");function Qi(n){return typeof n=="function"}b(Qi,"isFunction");function Ka(n){return Object.assign(Object.create(null),n)}b(Ka,"omitPrototype");function rc(n,e,s){return e in n?Object.defineProperty(n,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[e]=s,n}b(rc,"_define_property");var Yi=class extends Error{};b(Yi,"UnknownCauseError");function nc(n){if(n instanceof Error)return n;let e=typeof n;if(!(e==="undefined"||e==="function"||n===null)){if(e!=="object")return new Error(String(n));if(xe(n))return Object.assign(new Yi,n)}}b(nc,"getCauseFromUnknown");function or(n){if(n instanceof Le||n instanceof Error&&n.name==="TRPCError")return n;let e=new Le({code:"INTERNAL_SERVER_ERROR",cause:n});return n instanceof Error&&n.stack&&(e.stack=n.stack),e}b(or,"getTRPCErrorFromUnknown");var Le=class extends Error{constructor(e){let s=nc(e.cause),l=e.message??s?.message??e.code;super(l,{cause:s}),rc(this,"cause",void 0),rc(this,"code",void 0),this.code=e.code,this.name="TRPCError",this.cause??(this.cause=s)}};b(Le,"TRPCError");function ps(n){return"input"in n?n:{input:n,output:n}}b(ps,"getDataTransformer");var Lr={input:{serialize:n=>n,deserialize:n=>n},output:{serialize:n=>n,deserialize:n=>n}};function Pl(n,e){if("error"in n){let l=e.deserialize(n.error);return{ok:!1,error:{...n,error:l}}}let s={...n.result,...(!n.result.type||n.result.type==="data")&&{type:"data",data:e.deserialize(n.result.data)}};return{ok:!0,result:s}}b(Pl,"transformResultInner");var aa=class extends Error{constructor(){super("Unable to transform response from server")}};b(aa,"TransformResultError");function Xa(n,e){let s;try{s=Pl(n,e)}catch{throw new aa}if(!s.ok&&(!xe(s.error.error)||typeof s.error.error.code!="number"))throw new aa;if(s.ok&&!xe(s.result))throw new aa;return s}b(Xa,"transformResult");var Ol=Symbol("lazy");function jl(n){let e=Symbol(),s=e;return()=>(s===e&&(s=n()),s)}b(jl,"once");function Vl(n){return typeof n=="function"&&Ol in n}b(Vl,"isLazy");function Al(n){return xe(n)&&xe(n._def)&&"router"in n._def}b(Al,"isRouter");var Il={_ctx:null,_errorShape:null,_meta:null,queries:{},mutations:{},subscriptions:{},errorFormatter:Dr,transformer:Lr},Nl=["then","call","apply"];function Ki(n){function e(s){let l=new Set(Object.keys(s).filter(P=>Nl.includes(P)));if(l.size>0)throw new Error("Reserved words used in `router({})` call: "+Array.from(l).join(", "));let c=Ka({}),g=Ka({});function y(P){return{ref:P.ref,load:jl(async()=>{let z=await P.ref(),O=[...P.path,P.key],oe=O.join(".");P.aggregate[P.key]=v(z._def.record,O),delete g[oe];for(let[j,ke]of Object.entries(z._def.lazy)){let Re=[...O,j].join(".");g[Re]=y({ref:ke.ref,path:O,key:j,aggregate:P.aggregate[P.key]})}})}}b(y,"createLazyLoader");function v(P,z=[]){let O=Ka({});for(let[oe,j]of Object.entries(P??{})){if(Vl(j)){g[[...z,oe].join(".")]=y({path:z,ref:j,key:oe,aggregate:O});continue}if(Al(j)){O[oe]=v(j._def.record,[...z,oe]);continue}if(!Dl(j)){O[oe]=v(j,[...z,oe]);continue}let ke=[...z,oe].join(".");if(c[ke])throw new Error(`Duplicate key: ${ke}`);c[ke]=j,O[oe]=j}return O}b(v,"step");let f=v(s),m={_config:n,router:!0,procedures:c,lazy:g,...Il,record:f};return{...f,_def:m,createCaller:Xi()({_def:m})}}return b(e,"createRouterInner"),e}b(Ki,"createRouterFactory");function Dl(n){return typeof n=="function"}b(Dl,"isProcedure");async function fs(n,e){let{_def:s}=n,l=s.procedures[e];for(;!l;){let c=Object.keys(s.lazy).find(y=>e.startsWith(y));if(!c)return null;await s.lazy[c].load(),l=s.procedures[e]}return l}b(fs,"getProcedureAtPath");function Xi(){return b(function(e){let{_def:s}=e;return b(function(c,g){return na(async({path:y,args:v})=>{let f=y.join(".");if(y.length===1&&y[0]==="_def")return s;let m=await fs(e,f),E;try{if(!m)throw new Le({code:"NOT_FOUND",message:`No procedure found on path "${y}"`});return E=Qi(c)?await Promise.resolve(c()):c,await m({path:f,getRawInput:async()=>v[0],ctx:E,type:m._def.type,signal:g?.signal})}catch(P){throw g?.onError?.({ctx:E,error:or(P),input:v[0],path:f,type:m?._def.type??"unknown"}),P}})},"createCaller")},"createCallerInner")}b(Xi,"createCallerFactory");function hs(...n){let e=Ya({},...n.map(g=>g._def.record)),s=n.reduce((g,y)=>{if(y._def._config.errorFormatter&&y._def._config.errorFormatter!==Dr){if(g!==Dr&&g!==y._def._config.errorFormatter)throw new Error("You seem to have several error formatters");return y._def._config.errorFormatter}return g},Dr),l=n.reduce((g,y)=>{if(y._def._config.transformer&&y._def._config.transformer!==Lr){if(g!==Lr&&g!==y._def._config.transformer)throw new Error("You seem to have several transformers");return y._def._config.transformer}return g},Lr);return Ki({errorFormatter:s,transformer:l,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})(e)}b(hs,"mergeRouters");var Ll;Ll=Symbol.toStringTag;var ac,ic;(ac=Symbol).dispose??(ac.dispose=Symbol());(ic=Symbol).asyncDispose??(ic.asyncDispose=Symbol());var gs=Symbol();var cc=Symbol("ping");var oh=Symbol();var to="middlewareMarker";function Cs(){function n(s){return{_middlewares:s,unstable_pipe(l){let c="_middlewares"in l?l._middlewares:[l];return n([...s,...c])}}}b(n,"createMiddlewareInner");function e(s){return n([s])}return b(e,"createMiddleware"),e}b(Cs,"createMiddlewareFactory");function xs(n){let e=b(async function(l){let c,g=await l.getRawInput();try{c=await n(g)}catch(v){throw new Le({code:"BAD_REQUEST",cause:v})}let y=xe(l.input)&&xe(c)?{...l.input,...c}:c;return l.next({input:y})},"inputValidatorMiddleware");return e._type="input",e}b(xs,"createInputMiddleware");function Es(n){let e=b(async function({next:l}){let c=await l();if(!c.ok)return c;try{let g=await n(c.data);return{...c,data:g}}catch(g){throw new Le({message:"Output validation failed",code:"INTERNAL_SERVER_ERROR",cause:g})}},"outputValidatorMiddleware");return e._type="output",e}b(Es,"createOutputMiddleware");function Yl(n,e,s){return e in n?Object.defineProperty(n,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[e]=s,n}b(Yl,"_define_property");var kn=class extends Error{constructor(e){super(e[0]?.message),Yl(this,"issues",void 0),this.name="SchemaError",this.issues=e}};b(kn,"StandardSchemaV1Error");function ro(n){let e=n,s="~standard"in e;if(typeof e=="function"&&typeof e.assert=="function")return e.assert.bind(e);if(typeof e=="function"&&!s)return e;if(typeof e.parseAsync=="function")return e.parseAsync.bind(e);if(typeof e.parse=="function")return e.parse.bind(e);if(typeof e.validateSync=="function")return e.validateSync.bind(e);if(typeof e.create=="function")return e.create.bind(e);if(typeof e.assert=="function")return l=>(e.assert(l),l);if(s)return async l=>{let c=await e["~standard"].validate(l);if(c.issues)throw new kn(c.issues);return c.value};throw new Error("Could not find a validator fn")}b(ro,"getParseFn");function Zr(n,e){let{middlewares:s=[],inputs:l,meta:c,...g}=e;return no({...Ya(n,g),inputs:[...n.inputs,...l??[]],middlewares:[...n.middlewares,...s],meta:n.meta&&c?{...n.meta,...c}:c??n.meta})}b(Zr,"createNewBuilder");function no(n={}){let e={procedure:!0,inputs:[],middlewares:[],...n};return{_def:e,input(l){let c=ro(l);return Zr(e,{inputs:[l],middlewares:[xs(c)]})},output(l){let c=ro(l);return Zr(e,{output:l,middlewares:[Es(c)]})},meta(l){return Zr(e,{meta:l})},use(l){let c="_middlewares"in l?l._middlewares:[l];return Zr(e,{middlewares:c})},unstable_concat(l){return Zr(e,l._def)},concat(l){return Zr(e,l._def)},query(l){return Ts({...e,type:"query"},l)},mutation(l){return Ts({...e,type:"mutation"},l)},subscription(l){return Ts({...e,type:"subscription"},l)},experimental_caller(l){return Zr(e,{caller:l})}}}b(no,"createBuilder");function Ts(n,e){let s=Zr(n,{resolver:e,middlewares:[b(async function(f){let m=await e(f);return{marker:to,ok:!0,data:m,ctx:f.ctx}},"resolveMiddleware")]}),l={...s._def,type:n.type,experimental_caller:Boolean(s._def.caller),meta:s._def.meta,$types:null},c=Xl(s._def),g=s._def.caller;if(!g)return c;let y=b(async(...v)=>await g({args:v,invoke:c,_def:l}),"callerWrapper");return y._def=l,y}b(Ts,"createResolver");var Kl=`
2
2
  This is a client-only function.
3
3
  If you want to call this function on the server, see https://trpc.io/docs/v11/server/server-side-calls
4
- `.trim();async function uc(n,e,s){try{let l=e.middlewares[n];return await l({...s,meta:e.meta,input:s.input,next(g){let y=g;return uc(n+1,e,{...s,ctx:y?.ctx?{...s.ctx,...y.ctx}:s.ctx,input:y&&"input"in y?y.input:s.input,getRawInput:y?.getRawInput??s.getRawInput})}})}catch(l){return{ok:!1,error:or(l),marker:to}}}b(uc,"callRecursive");function Xl(n){async function e(s){if(!s||!("getRawInput"in s))throw new Error(Kl);let l=await uc(0,n,s);if(!l)throw new Le({code:"INTERNAL_SERVER_ERROR",message:"No result from middlewares - did you forget to `return next()`?"});if(!l.ok)throw l.error;return l.data}return b(e,"procedure"),e._def=n,e.procedure=!0,e.meta=n.meta,e}b(Xl,"createProcedureCaller");var ao=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 Sn=class{context(){return new Sn}meta(){return new Sn}create(e){let s={...e,transformer:ps(e?.transformer??Lr),isDev:e?.isDev??globalThis.process?.env.NODE_ENV!=="production",allowOutsideOfServer:e?.allowOutsideOfServer??!1,errorFormatter:e?.errorFormatter??Dr,isServer:e?.isServer??ao,$types:null};if(!(e?.isServer??ao)&&e?.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:s,procedure:no({meta:e?.defaultMeta}),middleware:Cs(),router:Ki(s),mergeRouters:hs,createCallerFactory:Xi()}}};b(Sn,"TRPCBuilder");var pc=new Sn;function io(n,e,s){return e in n?Object.defineProperty(n,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[e]=s,n}b(io,"_define_property");function ks(n){return n instanceof je}b(ks,"isTRPCClientError");function sd(n){return xe(n)&&xe(n.error)&&typeof n.error.code=="number"&&typeof n.error.message=="string"}b(sd,"isTRPCErrorResponse");function cd(n,e){return typeof n=="string"?n:xe(n)&&typeof n.message=="string"?n.message:e}b(cd,"getMessageFromUnknownError");var je=class extends Error{static from(e,s={}){let l=e;return ks(l)?(s.meta&&(l.meta={...l.meta,...s.meta}),l):sd(l)?new je(l.error.message,{...s,result:l}):new je(cd(l,"Unknown error"),{...s,cause:l})}constructor(e,s){let l=s?.cause;super(e,{cause:l}),io(this,"cause",void 0),io(this,"shape",void 0),io(this,"data",void 0),io(this,"meta",void 0),this.meta=s?.meta,this.cause=l,this.shape=s?.result?.error,this.data=s?.result?.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,je.prototype)}};b(je,"TRPCClientError");function Ss(n,e,s){return e in n?Object.defineProperty(n,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[e]=s,n}b(Ss,"_define_property");var Rn=class{$request(e){return ds({links:this.links,op:{...e,context:e.context??{},id:++this.requestId}}).pipe(ls())}async requestAsPromise(e){try{let s=this.$request(e);return(await cs(s)).result.data}catch(s){throw je.from(s)}}query(e,s,l){return this.requestAsPromise({type:"query",path:e,input:s,context:l?.context,signal:l?.signal})}mutation(e,s,l){return this.requestAsPromise({type:"mutation",path:e,input:s,context:l?.context,signal:l?.signal})}subscription(e,s,l){return this.$request({type:"subscription",path:e,input:s,context:l.context,signal:l.signal}).subscribe({next(g){switch(g.result.type){case"state":{l.onConnectionStateChange?.(g.result);break}case"started":{l.onStarted?.({context:g.context});break}case"stopped":{l.onStopped?.();break}case"data":case void 0:{l.onData?.(g.result.data);break}}},error(g){l.onError?.(g)},complete(){l.onComplete?.()}})}constructor(e){Ss(this,"links",void 0),Ss(this,"runtime",void 0),Ss(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map(s=>s(this.runtime))}};b(Rn,"TRPCUntypedClient");var ld=Symbol.for("trpc_untypedClient"),dd={query:"query",mutate:"mutation",subscribe:"subscription"},gc=b(n=>dd[n],"clientCallTypeToProcedureType");function yc(n){let e=na(({path:s,args:l})=>{let c=[...s],g=gc(c.pop()),y=c.join(".");return n[g](y,...l)});return Ji(s=>s===ld?n:e[s])}b(yc,"createTRPCClientProxy");function oa(n){let e=new Rn(n);return yc(e)}b(oa,"createTRPCClient");var vc=b(n=>typeof n=="function","isFunction");function Rs(n){if(n)return n;if(typeof window<"u"&&vc(window.fetch))return window.fetch;if(typeof globalThis<"u"&&vc(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}b(Rs,"getFetch");var bc=b(()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")},"throwFatalError");function oo(n){let e=null,s=null,l=b(()=>{clearTimeout(s),s=null,e=null},"destroyTimerAndPendingItems");function c(v){let h=[[]],m=0;for(;;){let E=v[m];if(!E)break;let P=h[h.length-1];if(E.aborted){E.reject?.(new Error("Aborted")),m++;continue}if(n.validate(P.concat(E).map(O=>O.key))){P.push(E),m++;continue}if(P.length===0){E.reject?.(new Error("Input is too big for a single dispatch")),m++;continue}h.push([])}return h}b(c,"groupItems");function g(){let v=c(e);l();for(let h of v){if(!h.length)continue;let m={items:h};for(let P of h)P.batch=m;n.fetch(m.items.map(P=>P.key)).then(async P=>{await Promise.all(P.map(async(z,O)=>{let oe=m.items[O];try{let j=await Promise.resolve(z);oe.resolve?.(j)}catch(j){oe.reject?.(j)}oe.batch=null,oe.reject=null,oe.resolve=null}));for(let z of m.items)z.reject?.(new Error("Missing result")),z.batch=null}).catch(P=>{for(let z of m.items)z.reject?.(P),z.batch=null})}}b(g,"dispatch");function y(v){let h={aborted:!1,key:v,batch:null,resolve:bc,reject:bc},m=new Promise((E,P)=>{h.reject=P,h.resolve=E,e??(e=[]),e.push(h)});return s??(s=setTimeout(g)),m}return b(y,"load"),{load:y}}b(oo,"dataLoader");function Ps(...n){let e=new AbortController,s=n.length,l=0,c=b(()=>{++l===s&&e.abort()},"onAbort");for(let g of n)g?.aborted?c():g?.addEventListener("abort",c,{once:!0});return e.signal}b(Ps,"allAbortSignals");function ei(n){let e=n;return e?"input"in e?e:{input:e,output:e}:{input:{serialize:s=>s,deserialize:s=>s},output:{serialize:s=>s,deserialize:s=>s}}}b(ei,"getTransformer");function co(n){return{url:n.url.toString(),fetch:n.fetch,transformer:ei(n.transformer),methodOverride:n.methodOverride}}b(co,"resolveHTTPLinkOptions");function ud(n){let e={};for(let s=0;s<n.length;s++){let l=n[s];e[s]=l}return e}b(ud,"arrayToDict");var pd={query:"GET",mutation:"POST",subscription:"PATCH"};function _c(n){return"input"in n?n.transformer.input.serialize(n.input):ud(n.inputs.map(e=>n.transformer.input.serialize(e)))}b(_c,"getInput");var sa=b(n=>{let e=n.url.split("?"),l=e[0].replace(/\/$/,"")+"/"+n.path,c=[];if(e[1]&&c.push(e[1]),"inputs"in n&&c.push("batch=1"),n.type==="query"||n.type==="subscription"){let g=_c(n);g!==void 0&&n.methodOverride!=="POST"&&c.push(`input=${encodeURIComponent(JSON.stringify(g))}`)}return c.length&&(l+="?"+c.join("&")),l},"getUrl"),wc=b(n=>{if(n.type==="query"&&n.methodOverride!=="POST")return;let e=_c(n);return e!==void 0?JSON.stringify(e):void 0},"getBody"),Os=b(n=>xc({...n,contentTypeHeader:"application/json",getUrl:sa,getBody:wc}),"jsonHttpRequester"),so=class extends Error{constructor(){let e="AbortError";super(e),this.name=e,this.message=e}};b(so,"AbortError");var fd=b(n=>{if(!!n?.aborted)throw n.throwIfAborted?.(),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new so},"throwIfAborted");async function Cc(n){fd(n.signal);let e=n.getUrl(n),s=n.getBody(n),{type:l}=n,c=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,...c};return Rs(n.fetch)(e,{method:n.methodOverride??pd[l],signal:n.signal,body:s,headers:g})}b(Cc,"fetchHTTPResponse");async function xc(n){let e={},s=await Cc(n);e.response=s;let l=await s.json();return e.responseJSON=l,{json:l,meta:e}}b(xc,"httpRequest");function ti(n){let e=co(n),s=n.maxURLLength??1/0,l=n.maxItems??1/0;return()=>{let c=b(h=>({validate(m){if(s===1/0&&l===1/0)return!0;if(m.length>l)return!1;let E=m.map(O=>O.path).join(","),P=m.map(O=>O.input);return sa({...e,type:h,path:E,inputs:P,signal:null}).length<=s},async fetch(m){let E=m.map(ke=>ke.path).join(","),P=m.map(ke=>ke.input),z=Ps(...m.map(ke=>ke.signal)),O=await Os({...e,path:E,inputs:P,type:h,headers(){return n.headers?typeof n.headers=="function"?n.headers({opList:m}):n.headers:{}},signal:z});return(Array.isArray(O.json)?O.json:m.map(()=>O.json)).map(ke=>({meta:O.meta,json:ke}))}}),"batchLoader"),g=oo(c("query")),y=oo(c("mutation")),v={query:g,mutation:y};return({op:h})=>De(m=>{if(h.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");let P=v[h.type].load(h),z;return P.then(O=>{z=O;let oe=Xa(O.json,e.transformer.output);if(!oe.ok){m.error(je.from(oe.error,{meta:O.meta}));return}m.next({context:O.meta,result:oe.result}),m.complete()}).catch(O=>{m.error(je.from(O,{meta:z?.meta}))}),()=>{}})}}b(ti,"httpBatchLink");var lo=b((n,...e)=>typeof n=="function"?n(...e):n,"resultOf");function js(){let n,e;return{promise:new Promise((l,c)=>{n=l,e=c}),resolve:n,reject:e}}b(js,"withResolvers");async function Tc(n){let e=await lo(n.url);if(!n.connectionParams)return e;let l=`${e.includes("?")?"&":"?"}connectionParams=1`;return e+l}b(Tc,"prepareUrl");async function kc(n){let e={method:"connectionParams",data:await lo(n)};return JSON.stringify(e)}b(kc,"buildConnectionMessage");function Pn(n,e,s){return e in n?Object.defineProperty(n,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[e]=s,n}b(Pn,"_define_property");function gd(n){let{promise:e,resolve:s,reject:l}=js();return n.addEventListener("open",()=>{n.removeEventListener("error",l),s()}),n.addEventListener("error",l),e}b(gd,"asyncWsOpen");function yd(n,{intervalMs:e,pongTimeoutMs:s}){let l,c;function g(){l=setTimeout(()=>{n.send("PING"),c=setTimeout(()=>{n.close()},s)},e)}b(g,"start");function y(){clearTimeout(l),g()}b(y,"reset");function v(){clearTimeout(c),y()}b(v,"pong"),n.addEventListener("open",g),n.addEventListener("message",({data:h})=>{clearTimeout(l),g(),h==="PONG"&&v()}),n.addEventListener("close",()=>{clearTimeout(l),clearTimeout(c)})}b(yd,"setupPingInterval");var Ur=class{get ws(){return this.wsObservable.get()}set ws(e){this.wsObservable.next(e)}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=++Ur.connectCount;let e=Tc(this.urlOptions).then(s=>new this.WebSocketPonyfill(s));this.openPromise=e.then(async s=>{this.ws=s,s.addEventListener("message",function({data:l}){l==="PING"&&this.send("PONG")}),this.keepAliveOpts.enabled&&yd(s,this.keepAliveOpts),s.addEventListener("close",()=>{this.ws===s&&(this.ws=null)}),await gd(s),this.urlOptions.connectionParams&&s.send(await kc(this.urlOptions.connectionParams))});try{await this.openPromise}finally{this.openPromise=null}}async close(){try{await this.openPromise}finally{this.ws?.close()}}constructor(e){if(Pn(this,"id",++Ur.connectCount),Pn(this,"WebSocketPonyfill",void 0),Pn(this,"urlOptions",void 0),Pn(this,"keepAliveOpts",void 0),Pn(this,"wsObservable",ra(null)),Pn(this,"openPromise",null),this.WebSocketPonyfill=e.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=e.urlOptions,this.keepAliveOpts=e.keepAlive}};b(Ur,"WsConnection");Pn(Ur,"connectCount",0);function bd(n){return n}b(bd,"identity");function _d(n){return n.length===0?bd:n.length===1?n[0]:b(function(s){return n.reduce((l,c)=>c(l),s)},"piped")}b(_d,"pipeFromArray");function Vs(n){let e={subscribe(s){let l=null,c=!1,g=!1,y=!1;function v(){if(l===null){y=!0;return}g||(g=!0,typeof l=="function"?l():l&&l.unsubscribe())}return b(v,"unsubscribe"),l=n({next(h){c||s.next?.(h)},error(h){c||(c=!0,s.error?.(h),v())},complete(){c||(c=!0,s.complete?.(),v())}}),y&&v(),{unsubscribe:v}},pipe(...s){return _d(s)(e)}};return e}b(Vs,"observable");var wd=Object.create,Is=Object.defineProperty,Cd=Object.getOwnPropertyDescriptor,Rc=Object.getOwnPropertyNames,xd=Object.getPrototypeOf,Ed=Object.prototype.hasOwnProperty,ue=b((n,e)=>Is(n,"name",{value:e,configurable:!0}),"__name"),Pc=b((n,e)=>b(function(){return e||(0,n[Rc(n)[0]])((e={exports:{}}).exports,e),e.exports},"__require"),"__commonJS"),Td=b((n,e,s,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of Rc(e))!Ed.call(n,c)&&c!==s&&Is(n,c,{get:()=>e[c],enumerable:!(l=Cd(e,c))||l.enumerable});return n},"__copyProps"),kd=b((n,e,s)=>(s=n!=null?wd(xd(n)):{},Td(e||!n||!n.__esModule?Is(s,"default",{value:n,enumerable:!0}):s,n)),"__toESM"),Sd=Pc({"../../learn-card-helpers/dist/helpers.cjs.development.js"(n,e){var s=Object.create,l=Object.defineProperty,c=Object.getOwnPropertyDescriptor,g=Object.getOwnPropertyNames,y=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty,h=ue((de,ye)=>l(de,"name",{value:ye,configurable:!0}),"__name"),m=ue((de,ye)=>ue(b(function(){return ye||(0,de[g(de)[0]])((ye={exports:{}}).exports,ye),ye.exports},"__require"),"__require"),"__commonJS"),E=ue((de,ye)=>{for(var L in ye)l(de,L,{get:ye[L],enumerable:!0})},"__export"),P=ue((de,ye,L,be)=>{if(ye&&typeof ye=="object"||typeof ye=="function")for(let H of g(ye))!v.call(de,H)&&H!==L&&l(de,H,{get:()=>ye[H],enumerable:!(be=c(ye,H))||be.enumerable});return de},"__copyProps"),z=ue((de,ye,L)=>(L=de!=null?s(y(de)):{},P(ye||!de||!de.__esModule?l(L,"default",{value:de,enumerable:!0}):L,de)),"__toESM"),O=ue(de=>P(l({},"__esModule",{value:!0}),de),"__toCommonJS"),oe=m({"../learn-card-types/dist/types.cjs.development.js"(de,ye){"use strict";var L=Object.defineProperty,be=Object.getOwnPropertyDescriptor,H=Object.getOwnPropertyNames,fr=Object.prototype.hasOwnProperty,I=h((r,u)=>L(r,"name",{value:u,configurable:!0}),"__name"),ma=h((r,u)=>{for(var f in u)L(r,f,{get:u[f],enumerable:!0})},"__export"),ga=h((r,u,f,C)=>{if(u&&typeof u=="object"||typeof u=="function")for(let w of H(u))!fr.call(r,w)&&w!==f&&L(r,w,{get:()=>u[w],enumerable:!(C=be(u,w))||C.enumerable});return r},"__copyProps"),rn=h(r=>ga(L({},"__esModule",{value:!0}),r),"__toCommonJS"),hr={};ma(hr,{AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX:()=>p,AchievementCredentialValidator:()=>Uo,AchievementCriteriaValidator:()=>mi,AchievementSubjectValidator:()=>Da,AchievementTypeValidator:()=>_i,AchievementValidator:()=>pe,AddressValidator:()=>gi,AlignmentTargetTypeValidator:()=>vi,AlignmentValidator:()=>_n,AuthGrantQueryValidator:()=>T,AuthGrantStatusValidator:()=>k,AuthGrantValidator:()=>x,AutoBoostConfigValidator:()=>Ui,BoostPermissionsQueryValidator:()=>Ai,BoostPermissionsValidator:()=>Cn,BoostQueryValidator:()=>Jo,BoostRecipientValidator:()=>Li,BoostRecipientWithChildrenValidator:()=>En,BoostValidator:()=>Mi,ClaimHookQueryValidator:()=>Ni,ClaimHookTypeValidator:()=>xn,ClaimHookValidator:()=>Ii,ClaimTokenValidator:()=>yl,ConsentFlowContractDataForDidValidator:()=>Fa,ConsentFlowContractDataValidator:()=>$a,ConsentFlowContractDetailsValidator:()=>ir,ConsentFlowContractQueryValidator:()=>qi,ConsentFlowContractValidator:()=>za,ConsentFlowDataForDidQueryValidator:()=>zi,ConsentFlowDataQueryValidator:()=>ns,ConsentFlowTermValidator:()=>Wa,ConsentFlowTermsQueryValidator:()=>$i,ConsentFlowTermsStatusValidator:()=>qa,ConsentFlowTermsValidator:()=>ea,ConsentFlowTransactionActionValidator:()=>Nr,ConsentFlowTransactionValidator:()=>Ha,ConsentFlowTransactionsQueryValidator:()=>as,ContactMethodCreateValidator:()=>we,ContactMethodQueryValidator:()=>ta,ContactMethodValidator:()=>A,ContactMethodVerificationRequestValidator:()=>Qa,ContactMethodVerificationValidator:()=>ul,ContextValidator:()=>Vr,ContractCredentialValidator:()=>Ga,CredentialInfoValidator:()=>Ti,CredentialRecordValidator:()=>Yn,CredentialSchemaValidator:()=>$n,CredentialStatusValidator:()=>Ar,CredentialSubjectValidator:()=>yn,CriteriaValidator:()=>Oe,DidDocumentValidator:()=>Zo,EncryptedCredentialRecordValidator:()=>wn,EncryptedRecordValidator:()=>Kn,EndorsementCredentialValidator:()=>wi,EndorsementSubjectValidator:()=>Jn,EvidenceValidator:()=>Ei,FlatAuthGrantValidator:()=>_,FullClaimHookValidator:()=>Di,GeoCoordinatesValidator:()=>Ta,IdentifierEntryValidator:()=>rr,IdentifierTypeValidator:()=>ka,IdentityObjectValidator:()=>Na,ImageValidator:()=>et,InboxCredentialQueryValidator:()=>hl,InboxCredentialValidator:()=>Gs,IssueInboxCredentialResponseValidator:()=>gl,IssueInboxCredentialValidator:()=>ml,IssueInboxSigningAuthorityValidator:()=>Js,JWERecipientHeaderValidator:()=>Oa,JWERecipientValidator:()=>ja,JWEValidator:()=>yi,JWKValidator:()=>bn,JWKWithPrivateKeyValidator:()=>Pa,KnownAchievementTypeValidator:()=>bi,LCNBoostClaimLinkOptionsValidator:()=>Ko,LCNBoostClaimLinkSigningAuthorityValidator:()=>Ua,LCNBoostStatus:()=>Ir,LCNInboxContactMethodValidator:()=>Wi,LCNInboxStatusEnumValidator:()=>Tn,LCNNotificationDataValidator:()=>t,LCNNotificationInboxValidator:()=>Hi,LCNNotificationMessageValidator:()=>Ja,LCNNotificationTypeEnumValidator:()=>Fi,LCNNotificationValidator:()=>d,LCNProfileConnectionStatusEnum:()=>Wo,LCNProfileDisplayValidator:()=>Oi,LCNProfileManagerQueryValidator:()=>Go,LCNProfileManagerValidator:()=>Xn,LCNProfileQueryValidator:()=>$o,LCNProfileValidator:()=>ft,LCNSigningAuthorityForUserValidator:()=>Xo,LCNSigningAuthorityValidator:()=>Ba,PaginatedBoostRecipientsValidator:()=>Zi,PaginatedBoostRecipientsWithChildrenValidator:()=>Yo,PaginatedBoostsValidator:()=>Qo,PaginatedClaimHooksValidator:()=>Za,PaginatedConsentFlowContractsValidator:()=>Bi,PaginatedConsentFlowDataForDidValidator:()=>ts,PaginatedConsentFlowDataValidator:()=>es,PaginatedConsentFlowTermsValidator:()=>rs,PaginatedConsentFlowTransactionsValidator:()=>is,PaginatedContractCredentialsValidator:()=>os,PaginatedEncryptedCredentialRecordsValidator:()=>Si,PaginatedEncryptedRecordsValidator:()=>zo,PaginatedInboxCredentialsValidator:()=>fl,PaginatedLCNProfileManagersValidator:()=>Ho,PaginatedLCNProfilesAndManagersValidator:()=>ji,PaginatedLCNProfilesValidator:()=>Fo,PaginationOptionsValidator:()=>ki,PaginationResponseValidator:()=>Ne,ProfileValidator:()=>nr,ProofValidator:()=>tt,RefreshServiceValidator:()=>Fn,RegExpValidator:()=>Pi,RelatedValidator:()=>Va,ResultDescriptionValidator:()=>Ia,ResultStatusTypeValidator:()=>pt,ResultTypeValidator:()=>Ci,ResultValidator:()=>xi,RubricCriterionValidator:()=>Aa,SentCredentialInfoValidator:()=>Vi,ServiceValidator:()=>Gn,SetPrimaryContactMethodValidator:()=>pl,StringQuery:()=>fe,TermsOfUseValidator:()=>Wn,UnsignedAchievementCredentialValidator:()=>Qn,UnsignedVCValidator:()=>ar,UnsignedVPValidator:()=>Sa,VC2EvidenceValidator:()=>Hn,VCValidator:()=>vn,VPValidator:()=>Ra,VerificationCheckValidator:()=>Bo,VerificationItemValidator:()=>La,VerificationMethodValidator:()=>Bt,VerificationStatusEnum:()=>qo,VerificationStatusValidator:()=>Ma}),ye.exports=rn(hr);var le;(function(r){r.assertEqual=w=>w;function u(w){}b(u,"assertIs"),ue(u,"assertIs"),h(u,"assertIs"),I(u,"assertIs"),r.assertIs=u;function f(w){throw new Error}b(f,"assertNever"),ue(f,"assertNever"),h(f,"assertNever"),I(f,"assertNever"),r.assertNever=f,r.arrayToEnum=w=>{let R={};for(let S of w)R[S]=S;return R},r.getValidEnumValues=w=>{let R=r.objectKeys(w).filter(M=>typeof w[w[M]]!="number"),S={};for(let M of R)S[M]=w[M];return r.objectValues(S)},r.objectValues=w=>r.objectKeys(w).map(function(R){return w[R]}),r.objectKeys=typeof Object.keys=="function"?w=>Object.keys(w):w=>{let R=[];for(let S in w)Object.prototype.hasOwnProperty.call(w,S)&&R.push(S);return R},r.find=(w,R)=>{for(let S of w)if(R(S))return S},r.isInteger=typeof Number.isInteger=="function"?w=>Number.isInteger(w):w=>typeof w=="number"&&isFinite(w)&&Math.floor(w)===w;function C(w,R=" | "){return w.map(S=>typeof S=="string"?`'${S}'`:S).join(R)}b(C,"joinValues"),ue(C,"joinValues"),h(C,"joinValues"),I(C,"joinValues"),r.joinValues=C,r.jsonStringifyReplacer=(w,R)=>typeof R=="bigint"?R.toString():R})(le||(le={}));var mr;(function(r){r.mergeShapes=(u,f)=>({...u,...f})})(mr||(mr={}));var V=le.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Qe=I(r=>{switch(typeof r){case"undefined":return V.undefined;case"string":return V.string;case"number":return isNaN(r)?V.nan:V.number;case"boolean":return V.boolean;case"function":return V.function;case"bigint":return V.bigint;case"symbol":return V.symbol;case"object":return Array.isArray(r)?V.array:r===null?V.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?V.promise:typeof Map<"u"&&r instanceof Map?V.map:typeof Set<"u"&&r instanceof Set?V.set:typeof Date<"u"&&r instanceof Date?V.date:V.object;default:return V.unknown}},"getParsedType"),Z=le.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"]),it=I(r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),Ze=h(class extends Error{constructor(r){super(),this.issues=[],this.addIssue=f=>{this.issues=[...this.issues,f]},this.addIssues=(f=[])=>{this.issues=[...this.issues,...f]};let u=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,u):this.__proto__=u,this.name="ZodError",this.issues=r}get errors(){return this.issues}format(r){let u=r||function(w){return w.message},f={_errors:[]},C=I(w=>{for(let R of w.issues)if(R.code==="invalid_union")R.unionErrors.map(C);else if(R.code==="invalid_return_type")C(R.returnTypeError);else if(R.code==="invalid_arguments")C(R.argumentsError);else if(R.path.length===0)f._errors.push(u(R));else{let S=f,M=0;for(;M<R.path.length;){let N=R.path[M];M===R.path.length-1?(S[N]=S[N]||{_errors:[]},S[N]._errors.push(u(R))):S[N]=S[N]||{_errors:[]},S=S[N],M++}}},"processError");return C(this),f}static assert(r){if(!(r instanceof Ze))throw new Error(`Not a ZodError: ${r}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,le.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(r=u=>u.message){let u={},f=[];for(let C of this.issues)C.path.length>0?(u[C.path[0]]=u[C.path[0]]||[],u[C.path[0]].push(r(C))):f.push(r(C));return{formErrors:f,fieldErrors:u}}get formErrors(){return this.flatten()}},"ZodError");I(Ze,"ZodError"),Ze.create=r=>new Ze(r);var Y=I((r,u)=>{let f;switch(r.code){case Z.invalid_type:r.received===V.undefined?f="Required":f=`Expected ${r.expected}, received ${r.received}`;break;case Z.invalid_literal:f=`Invalid literal value, expected ${JSON.stringify(r.expected,le.jsonStringifyReplacer)}`;break;case Z.unrecognized_keys:f=`Unrecognized key(s) in object: ${le.joinValues(r.keys,", ")}`;break;case Z.invalid_union:f="Invalid input";break;case Z.invalid_union_discriminator:f=`Invalid discriminator value. Expected ${le.joinValues(r.options)}`;break;case Z.invalid_enum_value:f=`Invalid enum value. Expected ${le.joinValues(r.options)}, received '${r.received}'`;break;case Z.invalid_arguments:f="Invalid function arguments";break;case Z.invalid_return_type:f="Invalid function return type";break;case Z.invalid_date:f="Invalid date";break;case Z.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(f=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(f=`${f} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?f=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?f=`Invalid input: must end with "${r.validation.endsWith}"`:le.assertNever(r.validation):r.validation!=="regex"?f=`Invalid ${r.validation}`:f="Invalid";break;case Z.too_small:r.type==="array"?f=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?f=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?f=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?f=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:f="Invalid input";break;case Z.too_big:r.type==="array"?f=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?f=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?f=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?f=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?f=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:f="Invalid input";break;case Z.custom:f="Invalid input";break;case Z.invalid_intersection_types:f="Intersection results could not be merged";break;case Z.not_multiple_of:f=`Number must be a multiple of ${r.multipleOf}`;break;case Z.not_finite:f="Number must be finite";break;default:f=u.defaultError,le.assertNever(r)}return{message:f}},"errorMap"),ie=Y;function Ln(r){ie=r}b(Ln,"setErrorMap"),ue(Ln,"setErrorMap"),h(Ln,"setErrorMap"),I(Ln,"setErrorMap");function Wt(){return ie}b(Wt,"getErrorMap"),ue(Wt,"getErrorMap"),h(Wt,"getErrorMap"),I(Wt,"getErrorMap");var Zn=I(r=>{let{data:u,path:f,errorMaps:C,issueData:w}=r,R=[...f,...w.path||[]],S={...w,path:R};if(w.message!==void 0)return{...w,path:R,message:w.message};let M="",N=C.filter(ae=>!!ae).slice().reverse();for(let ae of N)M=ae(S,{data:u,defaultError:M}).message;return{...w,path:R,message:M}},"makeIssue"),wo=[];function B(r,u){let f=Wt(),C=Zn({issueData:u,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,f,f===Y?void 0:Y].filter(w=>!!w)});r.common.issues.push(C)}b(B,"addIssueToContext"),ue(B,"addIssueToContext"),h(B,"addIssueToContext"),I(B,"addIssueToContext");var Ae=h(class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(r,u){let f=[];for(let C of u){if(C.status==="aborted")return X;C.status==="dirty"&&r.dirty(),f.push(C.value)}return{status:r.value,value:f}}static async mergeObjectAsync(r,u){let f=[];for(let C of u){let w=await C.key,R=await C.value;f.push({key:w,value:R})}return Ae.mergeObjectSync(r,f)}static mergeObjectSync(r,u){let f={};for(let C of u){let{key:w,value:R}=C;if(w.status==="aborted"||R.status==="aborted")return X;w.status==="dirty"&&r.dirty(),R.status==="dirty"&&r.dirty(),w.value!=="__proto__"&&(typeof R.value<"u"||C.alwaysSet)&&(f[w.value]=R.value)}return{status:r.value,value:f}}},"ParseStatus");I(Ae,"ParseStatus");var X=Object.freeze({status:"aborted"}),gr=I(r=>({status:"dirty",value:r}),"DIRTY"),Pe=I(r=>({status:"valid",value:r}),"OK"),ya=I(r=>r.status==="aborted","isAborted"),va=I(r=>r.status==="dirty","isDirty"),nn=I(r=>r.status==="valid","isValid"),yr=I(r=>typeof Promise<"u"&&r instanceof Promise,"isAsync");function Ht(r,u,f,C){if(f==="a"&&!C)throw new TypeError("Private accessor was defined without a getter");if(typeof u=="function"?r!==u||!C:!u.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return f==="m"?C:f==="a"?C.call(r):C?C.value:u.get(r)}b(Ht,"__classPrivateFieldGet"),ue(Ht,"__classPrivateFieldGet"),h(Ht,"__classPrivateFieldGet"),I(Ht,"__classPrivateFieldGet");function Ot(r,u,f,C,w){if(C==="m")throw new TypeError("Private method is not writable");if(C==="a"&&!w)throw new TypeError("Private accessor was defined without a setter");if(typeof u=="function"?r!==u||!w:!u.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return C==="a"?w.call(r,f):w?w.value=f:u.set(r,f),f}b(Ot,"__classPrivateFieldSet"),ue(Ot,"__classPrivateFieldSet"),h(Ot,"__classPrivateFieldSet"),I(Ot,"__classPrivateFieldSet");var W;(function(r){r.errToObj=u=>typeof u=="string"?{message:u}:u||{},r.toString=u=>typeof u=="string"?u:u?.message})(W||(W={}));var jt,Gt,Ce=h(class{constructor(r,u,f,C){this._cachedPath=[],this.parent=r,this.data=u,this._path=f,this._key=C}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");I(Ce,"ParseInputLazyPath");var Un=I((r,u)=>{if(nn(u))return{success:!0,data:u.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let f=new Ze(r.common.issues);return this._error=f,this._error}}},"handleResult");function Q(r){if(!r)return{};let{errorMap:u,invalid_type_error:f,required_error:C,description:w}=r;if(u&&(f||C))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return u?{errorMap:u,description:w}:{errorMap:I((S,M)=>{var N,ae;let{message:Te}=r;return S.code==="invalid_enum_value"?{message:Te??M.defaultError}:typeof M.data>"u"?{message:(N=Te??C)!==null&&N!==void 0?N:M.defaultError}:S.code!=="invalid_type"?{message:M.defaultError}:{message:(ae=Te??f)!==null&&ae!==void 0?ae:M.defaultError}},"customMap"),description:w}}b(Q,"processCreateParams"),ue(Q,"processCreateParams"),h(Q,"processCreateParams"),I(Q,"processCreateParams");var ee=h(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 Qe(r.data)}_getOrReturnCtx(r,u){return u||{common:r.parent.common,data:r.data,parsedType:Qe(r.data),schemaErrorMap:this._def.errorMap,path:r.path,parent:r.parent}}_processInputParams(r){return{status:new Ae,ctx:{common:r.parent.common,data:r.data,parsedType:Qe(r.data),schemaErrorMap:this._def.errorMap,path:r.path,parent:r.parent}}}_parseSync(r){let u=this._parse(r);if(yr(u))throw new Error("Synchronous parse encountered promise.");return u}_parseAsync(r){let u=this._parse(r);return Promise.resolve(u)}parse(r,u){let f=this.safeParse(r,u);if(f.success)return f.data;throw f.error}safeParse(r,u){var f;let C={common:{issues:[],async:(f=u?.async)!==null&&f!==void 0?f:!1,contextualErrorMap:u?.errorMap},path:u?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:Qe(r)},w=this._parseSync({data:r,path:C.path,parent:C});return Un(C,w)}async parseAsync(r,u){let f=await this.safeParseAsync(r,u);if(f.success)return f.data;throw f.error}async safeParseAsync(r,u){let f={common:{issues:[],contextualErrorMap:u?.errorMap,async:!0},path:u?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:Qe(r)},C=this._parse({data:r,path:f.path,parent:f}),w=await(yr(C)?C:Promise.resolve(C));return Un(f,w)}refine(r,u){let f=I(C=>typeof u=="string"||typeof u>"u"?{message:u}:typeof u=="function"?u(C):u,"getIssueProperties");return this._refinement((C,w)=>{let R=r(C),S=I(()=>w.addIssue({code:Z.custom,...f(C)}),"setError");return typeof Promise<"u"&&R instanceof Promise?R.then(M=>M?!0:(S(),!1)):R?!0:(S(),!1)})}refinement(r,u){return this._refinement((f,C)=>r(f)?!0:(C.addIssue(typeof u=="function"?u(f,C):u),!1))}_refinement(r){return new Xe({schema:this,typeName:K.ZodEffects,effect:{type:"refinement",refinement:r}})}superRefine(r){return this._refinement(r)}optional(){return dt.create(this,this._def)}nullable(){return xt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ie.create(this,this._def)}promise(){return er.create(this,this._def)}or(r){return wr.create([this,r],this._def)}and(r){return Ct.create(this,r,this._def)}transform(r){return new Xe({...Q(this._def),schema:this,typeName:K.ZodEffects,effect:{type:"transform",transform:r}})}default(r){let u=typeof r=="function"?r:()=>r;return new kr({...Q(this._def),innerType:this,defaultValue:u,typeName:K.ZodDefault})}brand(){return new Bn({typeName:K.ZodBranded,type:this,...Q(this._def)})}catch(r){let u=typeof r=="function"?r:()=>r;return new Sr({...Q(this._def),innerType:this,catchValue:u,typeName:K.ZodCatch})}describe(r){let u=this.constructor;return new u({...this._def,description:r})}pipe(r){return cn.create(this,r)}readonly(){return Rr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},"ZodType");I(ee,"ZodType");var vr=/^c[^\s-]{8,}$/i,Jt=/^[0-9a-z]+$/,an=/^[0-9A-HJKMNP-TV-Z]{26}$/,br=/^[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,_r=/^[a-z0-9_-]{21}$/i,Qt=/^[-+]?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)?)??$/,Vt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,yt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Yt,ot=/^(?:(?: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])$/,At=/^(([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})))$/,_e=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Kt="((\\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])))",wt=new RegExp(`^${Kt}$`);function It(r){let u="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return r.precision?u=`${u}\\.\\d{${r.precision}}`:r.precision==null&&(u=`${u}(\\.\\d+)?`),u}b(It,"timeRegexSource"),ue(It,"timeRegexSource"),h(It,"timeRegexSource"),I(It,"timeRegexSource");function Nt(r){return new RegExp(`^${It(r)}$`)}b(Nt,"timeRegex"),ue(Nt,"timeRegex"),h(Nt,"timeRegex"),I(Nt,"timeRegex");function vt(r){let u=`${Kt}T${It(r)}`,f=[];return f.push(r.local?"Z?":"Z"),r.offset&&f.push("([+-]\\d{2}:?\\d{2})"),u=`${u}(${f.join("|")})`,new RegExp(`^${u}$`)}b(vt,"datetimeRegex"),ue(vt,"datetimeRegex"),h(vt,"datetimeRegex"),I(vt,"datetimeRegex");function ze(r,u){return!!((u==="v4"||!u)&&ot.test(r)||(u==="v6"||!u)&&At.test(r))}b(ze,"isValidIP"),ue(ze,"isValidIP"),h(ze,"isValidIP"),I(ze,"isValidIP");var Me=h(class extends ee{_parse(r){if(this._def.coerce&&(r.data=String(r.data)),this._getType(r)!==V.string){let w=this._getOrReturnCtx(r);return B(w,{code:Z.invalid_type,expected:V.string,received:w.parsedType}),X}let f=new Ae,C;for(let w of this._def.checks)if(w.kind==="min")r.data.length<w.value&&(C=this._getOrReturnCtx(r,C),B(C,{code:Z.too_small,minimum:w.value,type:"string",inclusive:!0,exact:!1,message:w.message}),f.dirty());else if(w.kind==="max")r.data.length>w.value&&(C=this._getOrReturnCtx(r,C),B(C,{code:Z.too_big,maximum:w.value,type:"string",inclusive:!0,exact:!1,message:w.message}),f.dirty());else if(w.kind==="length"){let R=r.data.length>w.value,S=r.data.length<w.value;(R||S)&&(C=this._getOrReturnCtx(r,C),R?B(C,{code:Z.too_big,maximum:w.value,type:"string",inclusive:!0,exact:!0,message:w.message}):S&&B(C,{code:Z.too_small,minimum:w.value,type:"string",inclusive:!0,exact:!0,message:w.message}),f.dirty())}else if(w.kind==="email")Vt.test(r.data)||(C=this._getOrReturnCtx(r,C),B(C,{validation:"email",code:Z.invalid_string,message:w.message}),f.dirty());else if(w.kind==="emoji")Yt||(Yt=new RegExp(yt,"u")),Yt.test(r.data)||(C=this._getOrReturnCtx(r,C),B(C,{validation:"emoji",code:Z.invalid_string,message:w.message}),f.dirty());else if(w.kind==="uuid")br.test(r.data)||(C=this._getOrReturnCtx(r,C),B(C,{validation:"uuid",code:Z.invalid_string,message:w.message}),f.dirty());else if(w.kind==="nanoid")_r.test(r.data)||(C=this._getOrReturnCtx(r,C),B(C,{validation:"nanoid",code:Z.invalid_string,message:w.message}),f.dirty());else if(w.kind==="cuid")vr.test(r.data)||(C=this._getOrReturnCtx(r,C),B(C,{validation:"cuid",code:Z.invalid_string,message:w.message}),f.dirty());else if(w.kind==="cuid2")Jt.test(r.data)||(C=this._getOrReturnCtx(r,C),B(C,{validation:"cuid2",code:Z.invalid_string,message:w.message}),f.dirty());else if(w.kind==="ulid")an.test(r.data)||(C=this._getOrReturnCtx(r,C),B(C,{validation:"ulid",code:Z.invalid_string,message:w.message}),f.dirty());else if(w.kind==="url")try{new URL(r.data)}catch{C=this._getOrReturnCtx(r,C),B(C,{validation:"url",code:Z.invalid_string,message:w.message}),f.dirty()}else w.kind==="regex"?(w.regex.lastIndex=0,w.regex.test(r.data)||(C=this._getOrReturnCtx(r,C),B(C,{validation:"regex",code:Z.invalid_string,message:w.message}),f.dirty())):w.kind==="trim"?r.data=r.data.trim():w.kind==="includes"?r.data.includes(w.value,w.position)||(C=this._getOrReturnCtx(r,C),B(C,{code:Z.invalid_string,validation:{includes:w.value,position:w.position},message:w.message}),f.dirty()):w.kind==="toLowerCase"?r.data=r.data.toLowerCase():w.kind==="toUpperCase"?r.data=r.data.toUpperCase():w.kind==="startsWith"?r.data.startsWith(w.value)||(C=this._getOrReturnCtx(r,C),B(C,{code:Z.invalid_string,validation:{startsWith:w.value},message:w.message}),f.dirty()):w.kind==="endsWith"?r.data.endsWith(w.value)||(C=this._getOrReturnCtx(r,C),B(C,{code:Z.invalid_string,validation:{endsWith:w.value},message:w.message}),f.dirty()):w.kind==="datetime"?vt(w).test(r.data)||(C=this._getOrReturnCtx(r,C),B(C,{code:Z.invalid_string,validation:"datetime",message:w.message}),f.dirty()):w.kind==="date"?wt.test(r.data)||(C=this._getOrReturnCtx(r,C),B(C,{code:Z.invalid_string,validation:"date",message:w.message}),f.dirty()):w.kind==="time"?Nt(w).test(r.data)||(C=this._getOrReturnCtx(r,C),B(C,{code:Z.invalid_string,validation:"time",message:w.message}),f.dirty()):w.kind==="duration"?Qt.test(r.data)||(C=this._getOrReturnCtx(r,C),B(C,{validation:"duration",code:Z.invalid_string,message:w.message}),f.dirty()):w.kind==="ip"?ze(r.data,w.version)||(C=this._getOrReturnCtx(r,C),B(C,{validation:"ip",code:Z.invalid_string,message:w.message}),f.dirty()):w.kind==="base64"?_e.test(r.data)||(C=this._getOrReturnCtx(r,C),B(C,{validation:"base64",code:Z.invalid_string,message:w.message}),f.dirty()):le.assertNever(w);return{status:f.value,value:r.data}}_regex(r,u,f){return this.refinement(C=>r.test(C),{validation:u,code:Z.invalid_string,...W.errToObj(f)})}_addCheck(r){return new Me({...this._def,checks:[...this._def.checks,r]})}email(r){return this._addCheck({kind:"email",...W.errToObj(r)})}url(r){return this._addCheck({kind:"url",...W.errToObj(r)})}emoji(r){return this._addCheck({kind:"emoji",...W.errToObj(r)})}uuid(r){return this._addCheck({kind:"uuid",...W.errToObj(r)})}nanoid(r){return this._addCheck({kind:"nanoid",...W.errToObj(r)})}cuid(r){return this._addCheck({kind:"cuid",...W.errToObj(r)})}cuid2(r){return this._addCheck({kind:"cuid2",...W.errToObj(r)})}ulid(r){return this._addCheck({kind:"ulid",...W.errToObj(r)})}base64(r){return this._addCheck({kind:"base64",...W.errToObj(r)})}ip(r){return this._addCheck({kind:"ip",...W.errToObj(r)})}datetime(r){var u,f;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:(u=r?.offset)!==null&&u!==void 0?u:!1,local:(f=r?.local)!==null&&f!==void 0?f:!1,...W.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,...W.errToObj(r?.message)})}duration(r){return this._addCheck({kind:"duration",...W.errToObj(r)})}regex(r,u){return this._addCheck({kind:"regex",regex:r,...W.errToObj(u)})}includes(r,u){return this._addCheck({kind:"includes",value:r,position:u?.position,...W.errToObj(u?.message)})}startsWith(r,u){return this._addCheck({kind:"startsWith",value:r,...W.errToObj(u)})}endsWith(r,u){return this._addCheck({kind:"endsWith",value:r,...W.errToObj(u)})}min(r,u){return this._addCheck({kind:"min",value:r,...W.errToObj(u)})}max(r,u){return this._addCheck({kind:"max",value:r,...W.errToObj(u)})}length(r,u){return this._addCheck({kind:"length",value:r,...W.errToObj(u)})}nonempty(r){return this.min(1,W.errToObj(r))}trim(){return new Me({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Me({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Me({...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 u of this._def.checks)u.kind==="min"&&(r===null||u.value>r)&&(r=u.value);return r}get maxLength(){let r=null;for(let u of this._def.checks)u.kind==="max"&&(r===null||u.value<r)&&(r=u.value);return r}},"ZodString");I(Me,"ZodString"),Me.create=r=>{var u;return new Me({checks:[],typeName:K.ZodString,coerce:(u=r?.coerce)!==null&&u!==void 0?u:!1,...Q(r)})};function Dt(r,u){let f=(r.toString().split(".")[1]||"").length,C=(u.toString().split(".")[1]||"").length,w=f>C?f:C,R=parseInt(r.toFixed(w).replace(".","")),S=parseInt(u.toFixed(w).replace(".",""));return R%S/Math.pow(10,w)}b(Dt,"floatSafeRemainder"),ue(Dt,"floatSafeRemainder"),h(Dt,"floatSafeRemainder"),I(Dt,"floatSafeRemainder");var Ue=h(class extends ee{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)!==V.number){let w=this._getOrReturnCtx(r);return B(w,{code:Z.invalid_type,expected:V.number,received:w.parsedType}),X}let f,C=new Ae;for(let w of this._def.checks)w.kind==="int"?le.isInteger(r.data)||(f=this._getOrReturnCtx(r,f),B(f,{code:Z.invalid_type,expected:"integer",received:"float",message:w.message}),C.dirty()):w.kind==="min"?(w.inclusive?r.data<w.value:r.data<=w.value)&&(f=this._getOrReturnCtx(r,f),B(f,{code:Z.too_small,minimum:w.value,type:"number",inclusive:w.inclusive,exact:!1,message:w.message}),C.dirty()):w.kind==="max"?(w.inclusive?r.data>w.value:r.data>=w.value)&&(f=this._getOrReturnCtx(r,f),B(f,{code:Z.too_big,maximum:w.value,type:"number",inclusive:w.inclusive,exact:!1,message:w.message}),C.dirty()):w.kind==="multipleOf"?Dt(r.data,w.value)!==0&&(f=this._getOrReturnCtx(r,f),B(f,{code:Z.not_multiple_of,multipleOf:w.value,message:w.message}),C.dirty()):w.kind==="finite"?Number.isFinite(r.data)||(f=this._getOrReturnCtx(r,f),B(f,{code:Z.not_finite,message:w.message}),C.dirty()):le.assertNever(w);return{status:C.value,value:r.data}}gte(r,u){return this.setLimit("min",r,!0,W.toString(u))}gt(r,u){return this.setLimit("min",r,!1,W.toString(u))}lte(r,u){return this.setLimit("max",r,!0,W.toString(u))}lt(r,u){return this.setLimit("max",r,!1,W.toString(u))}setLimit(r,u,f,C){return new Ue({...this._def,checks:[...this._def.checks,{kind:r,value:u,inclusive:f,message:W.toString(C)}]})}_addCheck(r){return new Ue({...this._def,checks:[...this._def.checks,r]})}int(r){return this._addCheck({kind:"int",message:W.toString(r)})}positive(r){return this._addCheck({kind:"min",value:0,inclusive:!1,message:W.toString(r)})}negative(r){return this._addCheck({kind:"max",value:0,inclusive:!1,message:W.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:0,inclusive:!0,message:W.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:0,inclusive:!0,message:W.toString(r)})}multipleOf(r,u){return this._addCheck({kind:"multipleOf",value:r,message:W.toString(u)})}finite(r){return this._addCheck({kind:"finite",message:W.toString(r)})}safe(r){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:W.toString(r)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:W.toString(r)})}get minValue(){let r=null;for(let u of this._def.checks)u.kind==="min"&&(r===null||u.value>r)&&(r=u.value);return r}get maxValue(){let r=null;for(let u of this._def.checks)u.kind==="max"&&(r===null||u.value<r)&&(r=u.value);return r}get isInt(){return!!this._def.checks.find(r=>r.kind==="int"||r.kind==="multipleOf"&&le.isInteger(r.value))}get isFinite(){let r=null,u=null;for(let f of this._def.checks){if(f.kind==="finite"||f.kind==="int"||f.kind==="multipleOf")return!0;f.kind==="min"?(u===null||f.value>u)&&(u=f.value):f.kind==="max"&&(r===null||f.value<r)&&(r=f.value)}return Number.isFinite(u)&&Number.isFinite(r)}},"ZodNumber");I(Ue,"ZodNumber"),Ue.create=r=>new Ue({checks:[],typeName:K.ZodNumber,coerce:r?.coerce||!1,...Q(r)});var $e=h(class extends ee{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)!==V.bigint){let w=this._getOrReturnCtx(r);return B(w,{code:Z.invalid_type,expected:V.bigint,received:w.parsedType}),X}let f,C=new Ae;for(let w of this._def.checks)w.kind==="min"?(w.inclusive?r.data<w.value:r.data<=w.value)&&(f=this._getOrReturnCtx(r,f),B(f,{code:Z.too_small,type:"bigint",minimum:w.value,inclusive:w.inclusive,message:w.message}),C.dirty()):w.kind==="max"?(w.inclusive?r.data>w.value:r.data>=w.value)&&(f=this._getOrReturnCtx(r,f),B(f,{code:Z.too_big,type:"bigint",maximum:w.value,inclusive:w.inclusive,message:w.message}),C.dirty()):w.kind==="multipleOf"?r.data%w.value!==BigInt(0)&&(f=this._getOrReturnCtx(r,f),B(f,{code:Z.not_multiple_of,multipleOf:w.value,message:w.message}),C.dirty()):le.assertNever(w);return{status:C.value,value:r.data}}gte(r,u){return this.setLimit("min",r,!0,W.toString(u))}gt(r,u){return this.setLimit("min",r,!1,W.toString(u))}lte(r,u){return this.setLimit("max",r,!0,W.toString(u))}lt(r,u){return this.setLimit("max",r,!1,W.toString(u))}setLimit(r,u,f,C){return new $e({...this._def,checks:[...this._def.checks,{kind:r,value:u,inclusive:f,message:W.toString(C)}]})}_addCheck(r){return new $e({...this._def,checks:[...this._def.checks,r]})}positive(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:W.toString(r)})}negative(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:W.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:W.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:W.toString(r)})}multipleOf(r,u){return this._addCheck({kind:"multipleOf",value:r,message:W.toString(u)})}get minValue(){let r=null;for(let u of this._def.checks)u.kind==="min"&&(r===null||u.value>r)&&(r=u.value);return r}get maxValue(){let r=null;for(let u of this._def.checks)u.kind==="max"&&(r===null||u.value<r)&&(r=u.value);return r}},"ZodBigInt");I($e,"ZodBigInt"),$e.create=r=>{var u;return new $e({checks:[],typeName:K.ZodBigInt,coerce:(u=r?.coerce)!==null&&u!==void 0?u:!1,...Q(r)})};var st=h(class extends ee{_parse(r){if(this._def.coerce&&(r.data=Boolean(r.data)),this._getType(r)!==V.boolean){let f=this._getOrReturnCtx(r);return B(f,{code:Z.invalid_type,expected:V.boolean,received:f.parsedType}),X}return Pe(r.data)}},"ZodBoolean");I(st,"ZodBoolean"),st.create=r=>new st({typeName:K.ZodBoolean,coerce:r?.coerce||!1,...Q(r)});var Ye=h(class extends ee{_parse(r){if(this._def.coerce&&(r.data=new Date(r.data)),this._getType(r)!==V.date){let w=this._getOrReturnCtx(r);return B(w,{code:Z.invalid_type,expected:V.date,received:w.parsedType}),X}if(isNaN(r.data.getTime())){let w=this._getOrReturnCtx(r);return B(w,{code:Z.invalid_date}),X}let f=new Ae,C;for(let w of this._def.checks)w.kind==="min"?r.data.getTime()<w.value&&(C=this._getOrReturnCtx(r,C),B(C,{code:Z.too_small,message:w.message,inclusive:!0,exact:!1,minimum:w.value,type:"date"}),f.dirty()):w.kind==="max"?r.data.getTime()>w.value&&(C=this._getOrReturnCtx(r,C),B(C,{code:Z.too_big,message:w.message,inclusive:!0,exact:!1,maximum:w.value,type:"date"}),f.dirty()):le.assertNever(w);return{status:f.value,value:new Date(r.data.getTime())}}_addCheck(r){return new Ye({...this._def,checks:[...this._def.checks,r]})}min(r,u){return this._addCheck({kind:"min",value:r.getTime(),message:W.toString(u)})}max(r,u){return this._addCheck({kind:"max",value:r.getTime(),message:W.toString(u)})}get minDate(){let r=null;for(let u of this._def.checks)u.kind==="min"&&(r===null||u.value>r)&&(r=u.value);return r!=null?new Date(r):null}get maxDate(){let r=null;for(let u of this._def.checks)u.kind==="max"&&(r===null||u.value<r)&&(r=u.value);return r!=null?new Date(r):null}},"ZodDate");I(Ye,"ZodDate"),Ye.create=r=>new Ye({checks:[],coerce:r?.coerce||!1,typeName:K.ZodDate,...Q(r)});var Mt=h(class extends ee{_parse(r){if(this._getType(r)!==V.symbol){let f=this._getOrReturnCtx(r);return B(f,{code:Z.invalid_type,expected:V.symbol,received:f.parsedType}),X}return Pe(r.data)}},"ZodSymbol");I(Mt,"ZodSymbol"),Mt.create=r=>new Mt({typeName:K.ZodSymbol,...Q(r)});var Fe=h(class extends ee{_parse(r){if(this._getType(r)!==V.undefined){let f=this._getOrReturnCtx(r);return B(f,{code:Z.invalid_type,expected:V.undefined,received:f.parsedType}),X}return Pe(r.data)}},"ZodUndefined");I(Fe,"ZodUndefined"),Fe.create=r=>new Fe({typeName:K.ZodUndefined,...Q(r)});var ct=h(class extends ee{_parse(r){if(this._getType(r)!==V.null){let f=this._getOrReturnCtx(r);return B(f,{code:Z.invalid_type,expected:V.null,received:f.parsedType}),X}return Pe(r.data)}},"ZodNull");I(ct,"ZodNull"),ct.create=r=>new ct({typeName:K.ZodNull,...Q(r)});var We=h(class extends ee{constructor(){super(...arguments),this._any=!0}_parse(r){return Pe(r.data)}},"ZodAny");I(We,"ZodAny"),We.create=r=>new We({typeName:K.ZodAny,...Q(r)});var Se=h(class extends ee{constructor(){super(...arguments),this._unknown=!0}_parse(r){return Pe(r.data)}},"ZodUnknown");I(Se,"ZodUnknown"),Se.create=r=>new Se({typeName:K.ZodUnknown,...Q(r)});var Ee=h(class extends ee{_parse(r){let u=this._getOrReturnCtx(r);return B(u,{code:Z.invalid_type,expected:V.never,received:u.parsedType}),X}},"ZodNever");I(Ee,"ZodNever"),Ee.create=r=>new Ee({typeName:K.ZodNever,...Q(r)});var He=h(class extends ee{_parse(r){if(this._getType(r)!==V.undefined){let f=this._getOrReturnCtx(r);return B(f,{code:Z.invalid_type,expected:V.void,received:f.parsedType}),X}return Pe(r.data)}},"ZodVoid");I(He,"ZodVoid"),He.create=r=>new He({typeName:K.ZodVoid,...Q(r)});var Ie=h(class extends ee{_parse(r){let{ctx:u,status:f}=this._processInputParams(r),C=this._def;if(u.parsedType!==V.array)return B(u,{code:Z.invalid_type,expected:V.array,received:u.parsedType}),X;if(C.exactLength!==null){let R=u.data.length>C.exactLength.value,S=u.data.length<C.exactLength.value;(R||S)&&(B(u,{code:R?Z.too_big:Z.too_small,minimum:S?C.exactLength.value:void 0,maximum:R?C.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:C.exactLength.message}),f.dirty())}if(C.minLength!==null&&u.data.length<C.minLength.value&&(B(u,{code:Z.too_small,minimum:C.minLength.value,type:"array",inclusive:!0,exact:!1,message:C.minLength.message}),f.dirty()),C.maxLength!==null&&u.data.length>C.maxLength.value&&(B(u,{code:Z.too_big,maximum:C.maxLength.value,type:"array",inclusive:!0,exact:!1,message:C.maxLength.message}),f.dirty()),u.common.async)return Promise.all([...u.data].map((R,S)=>C.type._parseAsync(new Ce(u,R,u.path,S)))).then(R=>Ae.mergeArray(f,R));let w=[...u.data].map((R,S)=>C.type._parseSync(new Ce(u,R,u.path,S)));return Ae.mergeArray(f,w)}get element(){return this._def.type}min(r,u){return new Ie({...this._def,minLength:{value:r,message:W.toString(u)}})}max(r,u){return new Ie({...this._def,maxLength:{value:r,message:W.toString(u)}})}length(r,u){return new Ie({...this._def,exactLength:{value:r,message:W.toString(u)}})}nonempty(r){return this.min(1,r)}},"ZodArray");I(Ie,"ZodArray"),Ie.create=(r,u)=>new Ie({type:r,minLength:null,maxLength:null,exactLength:null,typeName:K.ZodArray,...Q(u)});function Be(r){if(r instanceof ge){let u={};for(let f in r.shape){let C=r.shape[f];u[f]=dt.create(Be(C))}return new ge({...r._def,shape:()=>u})}else return r instanceof Ie?new Ie({...r._def,type:Be(r.element)}):r instanceof dt?dt.create(Be(r.unwrap())):r instanceof xt?xt.create(Be(r.unwrap())):r instanceof bt?bt.create(r.items.map(u=>Be(u))):r}b(Be,"deepPartialify"),ue(Be,"deepPartialify"),h(Be,"deepPartialify"),I(Be,"deepPartialify");var ge=h(class extends ee{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(),u=le.objectKeys(r);return this._cached={shape:r,keys:u}}_parse(r){if(this._getType(r)!==V.object){let N=this._getOrReturnCtx(r);return B(N,{code:Z.invalid_type,expected:V.object,received:N.parsedType}),X}let{status:f,ctx:C}=this._processInputParams(r),{shape:w,keys:R}=this._getCached(),S=[];if(!(this._def.catchall instanceof Ee&&this._def.unknownKeys==="strip"))for(let N in C.data)R.includes(N)||S.push(N);let M=[];for(let N of R){let ae=w[N],Te=C.data[N];M.push({key:{status:"valid",value:N},value:ae._parse(new Ce(C,Te,C.path,N)),alwaysSet:N in C.data})}if(this._def.catchall instanceof Ee){let N=this._def.unknownKeys;if(N==="passthrough")for(let ae of S)M.push({key:{status:"valid",value:ae},value:{status:"valid",value:C.data[ae]}});else if(N==="strict")S.length>0&&(B(C,{code:Z.unrecognized_keys,keys:S}),f.dirty());else if(N!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let N=this._def.catchall;for(let ae of S){let Te=C.data[ae];M.push({key:{status:"valid",value:ae},value:N._parse(new Ce(C,Te,C.path,ae)),alwaysSet:ae in C.data})}}return C.common.async?Promise.resolve().then(async()=>{let N=[];for(let ae of M){let Te=await ae.key,Qs=await ae.value;N.push({key:Te,value:Qs,alwaysSet:ae.alwaysSet})}return N}).then(N=>Ae.mergeObjectSync(f,N)):Ae.mergeObjectSync(f,M)}get shape(){return this._def.shape()}strict(r){return W.errToObj,new ge({...this._def,unknownKeys:"strict",...r!==void 0?{errorMap:(u,f)=>{var C,w,R,S;let M=(R=(w=(C=this._def).errorMap)===null||w===void 0?void 0:w.call(C,u,f).message)!==null&&R!==void 0?R:f.defaultError;return u.code==="unrecognized_keys"?{message:(S=W.errToObj(r).message)!==null&&S!==void 0?S:M}:{message:M}}}:{}})}strip(){return new ge({...this._def,unknownKeys:"strip"})}passthrough(){return new ge({...this._def,unknownKeys:"passthrough"})}extend(r){return new ge({...this._def,shape:()=>({...this._def.shape(),...r})})}merge(r){return new ge({unknownKeys:r._def.unknownKeys,catchall:r._def.catchall,shape:()=>({...this._def.shape(),...r._def.shape()}),typeName:K.ZodObject})}setKey(r,u){return this.augment({[r]:u})}catchall(r){return new ge({...this._def,catchall:r})}pick(r){let u={};return le.objectKeys(r).forEach(f=>{r[f]&&this.shape[f]&&(u[f]=this.shape[f])}),new ge({...this._def,shape:()=>u})}omit(r){let u={};return le.objectKeys(this.shape).forEach(f=>{r[f]||(u[f]=this.shape[f])}),new ge({...this._def,shape:()=>u})}deepPartial(){return Be(this)}partial(r){let u={};return le.objectKeys(this.shape).forEach(f=>{let C=this.shape[f];r&&!r[f]?u[f]=C:u[f]=C.optional()}),new ge({...this._def,shape:()=>u})}required(r){let u={};return le.objectKeys(this.shape).forEach(f=>{if(r&&!r[f])u[f]=this.shape[f];else{let w=this.shape[f];for(;w instanceof dt;)w=w._def.innerType;u[f]=w}}),new ge({...this._def,shape:()=>u})}keyof(){return Er(le.objectKeys(this.shape))}},"ZodObject");I(ge,"ZodObject"),ge.create=(r,u)=>new ge({shape:()=>r,unknownKeys:"strip",catchall:Ee.create(),typeName:K.ZodObject,...Q(u)}),ge.strictCreate=(r,u)=>new ge({shape:()=>r,unknownKeys:"strict",catchall:Ee.create(),typeName:K.ZodObject,...Q(u)}),ge.lazycreate=(r,u)=>new ge({shape:r,unknownKeys:"strip",catchall:Ee.create(),typeName:K.ZodObject,...Q(u)});var wr=h(class extends ee{_parse(r){let{ctx:u}=this._processInputParams(r),f=this._def.options;function C(w){for(let S of w)if(S.result.status==="valid")return S.result;for(let S of w)if(S.result.status==="dirty")return u.common.issues.push(...S.ctx.common.issues),S.result;let R=w.map(S=>new Ze(S.ctx.common.issues));return B(u,{code:Z.invalid_union,unionErrors:R}),X}if(b(C,"handleResults"),ue(C,"handleResults"),h(C,"handleResults"),I(C,"handleResults"),u.common.async)return Promise.all(f.map(async w=>{let R={...u,common:{...u.common,issues:[]},parent:null};return{result:await w._parseAsync({data:u.data,path:u.path,parent:R}),ctx:R}})).then(C);{let w,R=[];for(let M of f){let N={...u,common:{...u.common,issues:[]},parent:null},ae=M._parseSync({data:u.data,path:u.path,parent:N});if(ae.status==="valid")return ae;ae.status==="dirty"&&!w&&(w={result:ae,ctx:N}),N.common.issues.length&&R.push(N.common.issues)}if(w)return u.common.issues.push(...w.ctx.common.issues),w.result;let S=R.map(M=>new Ze(M));return B(u,{code:Z.invalid_union,unionErrors:S}),X}}get options(){return this._def.options}},"ZodUnion");I(wr,"ZodUnion"),wr.create=(r,u)=>new wr({options:r,typeName:K.ZodUnion,...Q(u)});var Ke=I(r=>r instanceof Cr?Ke(r.schema):r instanceof Xe?Ke(r.innerType()):r instanceof xr?[r.value]:r instanceof Ut?r.options:r instanceof Tr?le.objectValues(r.enum):r instanceof kr?Ke(r._def.innerType):r instanceof Fe?[void 0]:r instanceof ct?[null]:r instanceof dt?[void 0,...Ke(r.unwrap())]:r instanceof xt?[null,...Ke(r.unwrap())]:r instanceof Bn||r instanceof Rr?Ke(r.unwrap()):r instanceof Sr?Ke(r._def.innerType):[],"getDiscriminator"),Lt=h(class extends ee{_parse(r){let{ctx:u}=this._processInputParams(r);if(u.parsedType!==V.object)return B(u,{code:Z.invalid_type,expected:V.object,received:u.parsedType}),X;let f=this.discriminator,C=u.data[f],w=this.optionsMap.get(C);return w?u.common.async?w._parseAsync({data:u.data,path:u.path,parent:u}):w._parseSync({data:u.data,path:u.path,parent:u}):(B(u,{code:Z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[f]}),X)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(r,u,f){let C=new Map;for(let w of u){let R=Ke(w.shape[r]);if(!R.length)throw new Error(`A discriminator value for key \`${r}\` could not be extracted from all schema options`);for(let S of R){if(C.has(S))throw new Error(`Discriminator property ${String(r)} has duplicate value ${String(S)}`);C.set(S,w)}}return new Lt({typeName:K.ZodDiscriminatedUnion,discriminator:r,options:u,optionsMap:C,...Q(f)})}},"ZodDiscriminatedUnion");I(Lt,"ZodDiscriminatedUnion");function lt(r,u){let f=Qe(r),C=Qe(u);if(r===u)return{valid:!0,data:r};if(f===V.object&&C===V.object){let w=le.objectKeys(u),R=le.objectKeys(r).filter(M=>w.indexOf(M)!==-1),S={...r,...u};for(let M of R){let N=lt(r[M],u[M]);if(!N.valid)return{valid:!1};S[M]=N.data}return{valid:!0,data:S}}else if(f===V.array&&C===V.array){if(r.length!==u.length)return{valid:!1};let w=[];for(let R=0;R<r.length;R++){let S=r[R],M=u[R],N=lt(S,M);if(!N.valid)return{valid:!1};w.push(N.data)}return{valid:!0,data:w}}else return f===V.date&&C===V.date&&+r==+u?{valid:!0,data:r}:{valid:!1}}b(lt,"mergeValues"),ue(lt,"mergeValues"),h(lt,"mergeValues"),I(lt,"mergeValues");var Ct=h(class extends ee{_parse(r){let{status:u,ctx:f}=this._processInputParams(r),C=I((w,R)=>{if(ya(w)||ya(R))return X;let S=lt(w.value,R.value);return S.valid?((va(w)||va(R))&&u.dirty(),{status:u.value,value:S.data}):(B(f,{code:Z.invalid_intersection_types}),X)},"handleParsed");return f.common.async?Promise.all([this._def.left._parseAsync({data:f.data,path:f.path,parent:f}),this._def.right._parseAsync({data:f.data,path:f.path,parent:f})]).then(([w,R])=>C(w,R)):C(this._def.left._parseSync({data:f.data,path:f.path,parent:f}),this._def.right._parseSync({data:f.data,path:f.path,parent:f}))}},"ZodIntersection");I(Ct,"ZodIntersection"),Ct.create=(r,u,f)=>new Ct({left:r,right:u,typeName:K.ZodIntersection,...Q(f)});var bt=h(class extends ee{_parse(r){let{status:u,ctx:f}=this._processInputParams(r);if(f.parsedType!==V.array)return B(f,{code:Z.invalid_type,expected:V.array,received:f.parsedType}),X;if(f.data.length<this._def.items.length)return B(f,{code:Z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),X;!this._def.rest&&f.data.length>this._def.items.length&&(B(f,{code:Z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),u.dirty());let w=[...f.data].map((R,S)=>{let M=this._def.items[S]||this._def.rest;return M?M._parse(new Ce(f,R,f.path,S)):null}).filter(R=>!!R);return f.common.async?Promise.all(w).then(R=>Ae.mergeArray(u,R)):Ae.mergeArray(u,w)}get items(){return this._def.items}rest(r){return new bt({...this._def,rest:r})}},"ZodTuple");I(bt,"ZodTuple"),bt.create=(r,u)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new bt({items:r,typeName:K.ZodTuple,rest:null,...Q(u)})};var J=h(class extends ee{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){let{status:u,ctx:f}=this._processInputParams(r);if(f.parsedType!==V.object)return B(f,{code:Z.invalid_type,expected:V.object,received:f.parsedType}),X;let C=[],w=this._def.keyType,R=this._def.valueType;for(let S in f.data)C.push({key:w._parse(new Ce(f,S,f.path,S)),value:R._parse(new Ce(f,f.data[S],f.path,S)),alwaysSet:S in f.data});return f.common.async?Ae.mergeObjectAsync(u,C):Ae.mergeObjectSync(u,C)}get element(){return this._def.valueType}static create(r,u,f){return u instanceof ee?new J({keyType:r,valueType:u,typeName:K.ZodRecord,...Q(f)}):new J({keyType:Me.create(),valueType:r,typeName:K.ZodRecord,...Q(u)})}},"ZodRecord");I(J,"ZodRecord");var on=h(class extends ee{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){let{status:u,ctx:f}=this._processInputParams(r);if(f.parsedType!==V.map)return B(f,{code:Z.invalid_type,expected:V.map,received:f.parsedType}),X;let C=this._def.keyType,w=this._def.valueType,R=[...f.data.entries()].map(([S,M],N)=>({key:C._parse(new Ce(f,S,f.path,[N,"key"])),value:w._parse(new Ce(f,M,f.path,[N,"value"]))}));if(f.common.async){let S=new Map;return Promise.resolve().then(async()=>{for(let M of R){let N=await M.key,ae=await M.value;if(N.status==="aborted"||ae.status==="aborted")return X;(N.status==="dirty"||ae.status==="dirty")&&u.dirty(),S.set(N.value,ae.value)}return{status:u.value,value:S}})}else{let S=new Map;for(let M of R){let N=M.key,ae=M.value;if(N.status==="aborted"||ae.status==="aborted")return X;(N.status==="dirty"||ae.status==="dirty")&&u.dirty(),S.set(N.value,ae.value)}return{status:u.value,value:S}}}},"ZodMap");I(on,"ZodMap"),on.create=(r,u,f)=>new on({valueType:u,keyType:r,typeName:K.ZodMap,...Q(f)});var Zt=h(class extends ee{_parse(r){let{status:u,ctx:f}=this._processInputParams(r);if(f.parsedType!==V.set)return B(f,{code:Z.invalid_type,expected:V.set,received:f.parsedType}),X;let C=this._def;C.minSize!==null&&f.data.size<C.minSize.value&&(B(f,{code:Z.too_small,minimum:C.minSize.value,type:"set",inclusive:!0,exact:!1,message:C.minSize.message}),u.dirty()),C.maxSize!==null&&f.data.size>C.maxSize.value&&(B(f,{code:Z.too_big,maximum:C.maxSize.value,type:"set",inclusive:!0,exact:!1,message:C.maxSize.message}),u.dirty());let w=this._def.valueType;function R(M){let N=new Set;for(let ae of M){if(ae.status==="aborted")return X;ae.status==="dirty"&&u.dirty(),N.add(ae.value)}return{status:u.value,value:N}}b(R,"finalizeSet"),ue(R,"finalizeSet"),h(R,"finalizeSet"),I(R,"finalizeSet");let S=[...f.data.values()].map((M,N)=>w._parse(new Ce(f,M,f.path,N)));return f.common.async?Promise.all(S).then(M=>R(M)):R(S)}min(r,u){return new Zt({...this._def,minSize:{value:r,message:W.toString(u)}})}max(r,u){return new Zt({...this._def,maxSize:{value:r,message:W.toString(u)}})}size(r,u){return this.min(r,u).max(r,u)}nonempty(r){return this.min(1,r)}},"ZodSet");I(Zt,"ZodSet"),Zt.create=(r,u)=>new Zt({valueType:r,minSize:null,maxSize:null,typeName:K.ZodSet,...Q(u)});var Xt=h(class extends ee{constructor(){super(...arguments),this.validate=this.implement}_parse(r){let{ctx:u}=this._processInputParams(r);if(u.parsedType!==V.function)return B(u,{code:Z.invalid_type,expected:V.function,received:u.parsedType}),X;function f(S,M){return Zn({data:S,path:u.path,errorMaps:[u.common.contextualErrorMap,u.schemaErrorMap,Wt(),Y].filter(N=>!!N),issueData:{code:Z.invalid_arguments,argumentsError:M}})}b(f,"makeArgsIssue"),ue(f,"makeArgsIssue"),h(f,"makeArgsIssue"),I(f,"makeArgsIssue");function C(S,M){return Zn({data:S,path:u.path,errorMaps:[u.common.contextualErrorMap,u.schemaErrorMap,Wt(),Y].filter(N=>!!N),issueData:{code:Z.invalid_return_type,returnTypeError:M}})}b(C,"makeReturnsIssue"),ue(C,"makeReturnsIssue"),h(C,"makeReturnsIssue"),I(C,"makeReturnsIssue");let w={errorMap:u.common.contextualErrorMap},R=u.data;if(this._def.returns instanceof er){let S=this;return Pe(async function(...M){let N=new Ze([]),ae=await S._def.args.parseAsync(M,w).catch(ss=>{throw N.addIssue(f(M,ss)),N}),Te=await Reflect.apply(R,this,ae);return await S._def.returns._def.type.parseAsync(Te,w).catch(ss=>{throw N.addIssue(C(Te,ss)),N})})}else{let S=this;return Pe(function(...M){let N=S._def.args.safeParse(M,w);if(!N.success)throw new Ze([f(M,N.error)]);let ae=Reflect.apply(R,this,N.data),Te=S._def.returns.safeParse(ae,w);if(!Te.success)throw new Ze([C(ae,Te.error)]);return Te.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...r){return new Xt({...this._def,args:bt.create(r).rest(Se.create())})}returns(r){return new Xt({...this._def,returns:r})}implement(r){return this.parse(r)}strictImplement(r){return this.parse(r)}static create(r,u,f){return new Xt({args:r||bt.create([]).rest(Se.create()),returns:u||Se.create(),typeName:K.ZodFunction,...Q(f)})}},"ZodFunction");I(Xt,"ZodFunction");var Cr=h(class extends ee{get schema(){return this._def.getter()}_parse(r){let{ctx:u}=this._processInputParams(r);return this._def.getter()._parse({data:u.data,path:u.path,parent:u})}},"ZodLazy");I(Cr,"ZodLazy"),Cr.create=(r,u)=>new Cr({getter:r,typeName:K.ZodLazy,...Q(u)});var xr=h(class extends ee{_parse(r){if(r.data!==this._def.value){let u=this._getOrReturnCtx(r);return B(u,{received:u.data,code:Z.invalid_literal,expected:this._def.value}),X}return{status:"valid",value:r.data}}get value(){return this._def.value}},"ZodLiteral");I(xr,"ZodLiteral"),xr.create=(r,u)=>new xr({value:r,typeName:K.ZodLiteral,...Q(u)});function Er(r,u){return new Ut({values:r,typeName:K.ZodEnum,...Q(u)})}b(Er,"createZodEnum"),ue(Er,"createZodEnum"),h(Er,"createZodEnum"),I(Er,"createZodEnum");var Ut=h(class extends ee{constructor(){super(...arguments),jt.set(this,void 0)}_parse(r){if(typeof r.data!="string"){let u=this._getOrReturnCtx(r),f=this._def.values;return B(u,{expected:le.joinValues(f),received:u.parsedType,code:Z.invalid_type}),X}if(Ht(this,jt,"f")||Ot(this,jt,new Set(this._def.values),"f"),!Ht(this,jt,"f").has(r.data)){let u=this._getOrReturnCtx(r),f=this._def.values;return B(u,{received:u.data,code:Z.invalid_enum_value,options:f}),X}return Pe(r.data)}get options(){return this._def.values}get enum(){let r={};for(let u of this._def.values)r[u]=u;return r}get Values(){let r={};for(let u of this._def.values)r[u]=u;return r}get Enum(){let r={};for(let u of this._def.values)r[u]=u;return r}extract(r,u=this._def){return Ut.create(r,{...this._def,...u})}exclude(r,u=this._def){return Ut.create(this.options.filter(f=>!r.includes(f)),{...this._def,...u})}},"ZodEnum");I(Ut,"ZodEnum"),jt=new WeakMap,Ut.create=Er;var Tr=h(class extends ee{constructor(){super(...arguments),Gt.set(this,void 0)}_parse(r){let u=le.getValidEnumValues(this._def.values),f=this._getOrReturnCtx(r);if(f.parsedType!==V.string&&f.parsedType!==V.number){let C=le.objectValues(u);return B(f,{expected:le.joinValues(C),received:f.parsedType,code:Z.invalid_type}),X}if(Ht(this,Gt,"f")||Ot(this,Gt,new Set(le.getValidEnumValues(this._def.values)),"f"),!Ht(this,Gt,"f").has(r.data)){let C=le.objectValues(u);return B(f,{received:f.data,code:Z.invalid_enum_value,options:C}),X}return Pe(r.data)}get enum(){return this._def.values}},"ZodNativeEnum");I(Tr,"ZodNativeEnum"),Gt=new WeakMap,Tr.create=(r,u)=>new Tr({values:r,typeName:K.ZodNativeEnum,...Q(u)});var er=h(class extends ee{unwrap(){return this._def.type}_parse(r){let{ctx:u}=this._processInputParams(r);if(u.parsedType!==V.promise&&u.common.async===!1)return B(u,{code:Z.invalid_type,expected:V.promise,received:u.parsedType}),X;let f=u.parsedType===V.promise?u.data:Promise.resolve(u.data);return Pe(f.then(C=>this._def.type.parseAsync(C,{path:u.path,errorMap:u.common.contextualErrorMap})))}},"ZodPromise");I(er,"ZodPromise"),er.create=(r,u)=>new er({type:r,typeName:K.ZodPromise,...Q(u)});var Xe=h(class extends ee{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===K.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(r){let{status:u,ctx:f}=this._processInputParams(r),C=this._def.effect||null,w={addIssue:R=>{B(f,R),R.fatal?u.abort():u.dirty()},get path(){return f.path}};if(w.addIssue=w.addIssue.bind(w),C.type==="preprocess"){let R=C.transform(f.data,w);if(f.common.async)return Promise.resolve(R).then(async S=>{if(u.value==="aborted")return X;let M=await this._def.schema._parseAsync({data:S,path:f.path,parent:f});return M.status==="aborted"?X:M.status==="dirty"||u.value==="dirty"?gr(M.value):M});{if(u.value==="aborted")return X;let S=this._def.schema._parseSync({data:R,path:f.path,parent:f});return S.status==="aborted"?X:S.status==="dirty"||u.value==="dirty"?gr(S.value):S}}if(C.type==="refinement"){let R=I(S=>{let M=C.refinement(S,w);if(f.common.async)return Promise.resolve(M);if(M instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return S},"executeRefinement");if(f.common.async===!1){let S=this._def.schema._parseSync({data:f.data,path:f.path,parent:f});return S.status==="aborted"?X:(S.status==="dirty"&&u.dirty(),R(S.value),{status:u.value,value:S.value})}else return this._def.schema._parseAsync({data:f.data,path:f.path,parent:f}).then(S=>S.status==="aborted"?X:(S.status==="dirty"&&u.dirty(),R(S.value).then(()=>({status:u.value,value:S.value}))))}if(C.type==="transform")if(f.common.async===!1){let R=this._def.schema._parseSync({data:f.data,path:f.path,parent:f});if(!nn(R))return R;let S=C.transform(R.value,w);if(S instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:u.value,value:S}}else return this._def.schema._parseAsync({data:f.data,path:f.path,parent:f}).then(R=>nn(R)?Promise.resolve(C.transform(R.value,w)).then(S=>({status:u.value,value:S})):R);le.assertNever(C)}},"ZodEffects");I(Xe,"ZodEffects"),Xe.create=(r,u,f)=>new Xe({schema:r,typeName:K.ZodEffects,effect:u,...Q(f)}),Xe.createWithPreprocess=(r,u,f)=>new Xe({schema:u,effect:{type:"preprocess",transform:r},typeName:K.ZodEffects,...Q(f)});var dt=h(class extends ee{_parse(r){return this._getType(r)===V.undefined?Pe(void 0):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}},"ZodOptional");I(dt,"ZodOptional"),dt.create=(r,u)=>new dt({innerType:r,typeName:K.ZodOptional,...Q(u)});var xt=h(class extends ee{_parse(r){return this._getType(r)===V.null?Pe(null):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}},"ZodNullable");I(xt,"ZodNullable"),xt.create=(r,u)=>new xt({innerType:r,typeName:K.ZodNullable,...Q(u)});var kr=h(class extends ee{_parse(r){let{ctx:u}=this._processInputParams(r),f=u.data;return u.parsedType===V.undefined&&(f=this._def.defaultValue()),this._def.innerType._parse({data:f,path:u.path,parent:u})}removeDefault(){return this._def.innerType}},"ZodDefault");I(kr,"ZodDefault"),kr.create=(r,u)=>new kr({innerType:r,typeName:K.ZodDefault,defaultValue:typeof u.default=="function"?u.default:()=>u.default,...Q(u)});var Sr=h(class extends ee{_parse(r){let{ctx:u}=this._processInputParams(r),f={...u,common:{...u.common,issues:[]}},C=this._def.innerType._parse({data:f.data,path:f.path,parent:{...f}});return yr(C)?C.then(w=>({status:"valid",value:w.status==="valid"?w.value:this._def.catchValue({get error(){return new Ze(f.common.issues)},input:f.data})})):{status:"valid",value:C.status==="valid"?C.value:this._def.catchValue({get error(){return new Ze(f.common.issues)},input:f.data})}}removeCatch(){return this._def.innerType}},"ZodCatch");I(Sr,"ZodCatch"),Sr.create=(r,u)=>new Sr({innerType:r,typeName:K.ZodCatch,catchValue:typeof u.catch=="function"?u.catch:()=>u.catch,...Q(u)});var sn=h(class extends ee{_parse(r){if(this._getType(r)!==V.nan){let f=this._getOrReturnCtx(r);return B(f,{code:Z.invalid_type,expected:V.nan,received:f.parsedType}),X}return{status:"valid",value:r.data}}},"ZodNaN");I(sn,"ZodNaN"),sn.create=r=>new sn({typeName:K.ZodNaN,...Q(r)});var Co=Symbol("zod_brand"),Bn=h(class extends ee{_parse(r){let{ctx:u}=this._processInputParams(r),f=u.data;return this._def.type._parse({data:f,path:u.path,parent:u})}unwrap(){return this._def.type}},"ZodBranded");I(Bn,"ZodBranded");var cn=h(class extends ee{_parse(r){let{status:u,ctx:f}=this._processInputParams(r);if(f.common.async)return I(async()=>{let w=await this._def.in._parseAsync({data:f.data,path:f.path,parent:f});return w.status==="aborted"?X:w.status==="dirty"?(u.dirty(),gr(w.value)):this._def.out._parseAsync({data:w.value,path:f.path,parent:f})},"handleAsync")();{let C=this._def.in._parseSync({data:f.data,path:f.path,parent:f});return C.status==="aborted"?X:C.status==="dirty"?(u.dirty(),{status:"dirty",value:C.value}):this._def.out._parseSync({data:C.value,path:f.path,parent:f})}}static create(r,u){return new cn({in:r,out:u,typeName:K.ZodPipeline})}},"ZodPipeline");I(cn,"ZodPipeline");var Rr=h(class extends ee{_parse(r){let u=this._def.innerType._parse(r),f=I(C=>(nn(C)&&(C.value=Object.freeze(C.value)),C),"freeze");return yr(u)?u.then(C=>f(C)):f(u)}unwrap(){return this._def.innerType}},"ZodReadonly");I(Rr,"ZodReadonly"),Rr.create=(r,u)=>new Rr({innerType:r,typeName:K.ZodReadonly,...Q(u)});function ln(r,u={},f){return r?We.create().superRefine((C,w)=>{var R,S;if(!r(C)){let M=typeof u=="function"?u(C):typeof u=="string"?{message:u}:u,N=(S=(R=M.fatal)!==null&&R!==void 0?R:f)!==null&&S!==void 0?S:!0,ae=typeof M=="string"?{message:M}:M;w.addIssue({code:"custom",...ae,fatal:N})}}):We.create()}b(ln,"custom"),ue(ln,"custom"),h(ln,"custom"),I(ln,"custom");var xo={object:ge.lazycreate},K;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(K||(K={}));var Eo=I((r,u={message:`Input not instance of ${r.name}`})=>ln(f=>f instanceof r,u),"instanceOfType"),ci=Me.create,li=Ue.create,To=sn.create,ko=$e.create,di=st.create,So=Ye.create,Ro=Mt.create,ui=Fe.create,Po=ct.create,Oo=We.create,jo=Se.create,Vo=Ee.create,Ao=He.create,Io=Ie.create,No=ge.create,Do=ge.strictCreate,Mo=wr.create,o=Lt.create,dn=Ct.create,Pr=bt.create,un=J.create,ba=on.create,pn=Zt.create,Lo=Xt.create,fn=Cr.create,pi=xr.create,fi=Ut.create,hi=Tr.create,_a=er.create,tr=Xe.create,qn=dt.create,hn=xt.create,wa=Xe.createWithPreprocess,Ca=cn.create,xa=I(()=>ci().optional(),"ostring"),Ea=I(()=>li().optional(),"onumber"),Or=I(()=>di().optional(),"oboolean"),ut={string:r=>Me.create({...r,coerce:!0}),number:r=>Ue.create({...r,coerce:!0}),boolean:r=>st.create({...r,coerce:!0}),bigint:r=>$e.create({...r,coerce:!0}),date:r=>Ye.create({...r,coerce:!0})},zn=X,i=Object.freeze({__proto__:null,defaultErrorMap:Y,setErrorMap:Ln,getErrorMap:Wt,makeIssue:Zn,EMPTY_PATH:wo,addIssueToContext:B,ParseStatus:Ae,INVALID:X,DIRTY:gr,OK:Pe,isAborted:ya,isDirty:va,isValid:nn,isAsync:yr,get util(){return le},get objectUtil(){return mr},ZodParsedType:V,getParsedType:Qe,ZodType:ee,datetimeRegex:vt,ZodString:Me,ZodNumber:Ue,ZodBigInt:$e,ZodBoolean:st,ZodDate:Ye,ZodSymbol:Mt,ZodUndefined:Fe,ZodNull:ct,ZodAny:We,ZodUnknown:Se,ZodNever:Ee,ZodVoid:He,ZodArray:Ie,ZodObject:ge,ZodUnion:wr,ZodDiscriminatedUnion:Lt,ZodIntersection:Ct,ZodTuple:bt,ZodRecord:J,ZodMap:on,ZodSet:Zt,ZodFunction:Xt,ZodLazy:Cr,ZodLiteral:xr,ZodEnum:Ut,ZodNativeEnum:Tr,ZodPromise:er,ZodEffects:Xe,ZodTransformer:Xe,ZodOptional:dt,ZodNullable:xt,ZodDefault:kr,ZodCatch:Sr,ZodNaN:sn,BRAND:Co,ZodBranded:Bn,ZodPipeline:cn,ZodReadonly:Rr,custom:ln,Schema:ee,ZodSchema:ee,late:xo,get ZodFirstPartyTypeKind(){return K},coerce:ut,any:Oo,array:Io,bigint:ko,boolean:di,date:So,discriminatedUnion:o,effect:tr,enum:fi,function:Lo,instanceof:Eo,intersection:dn,lazy:fn,literal:pi,map:ba,nan:To,nativeEnum:hi,never:Vo,null:Po,nullable:hn,number:li,object:No,oboolean:Or,onumber:Ea,optional:qn,ostring:xa,pipeline:Ca,preprocess:wa,promise:_a,record:un,set:pn,strictObject:Do,string:ci,symbol:Ro,transformer:tr,tuple:Pr,undefined:ui,union:Mo,unknown:jo,void:Ao,NEVER:zn,ZodIssueCode:Z,quotelessJson:it,ZodError:Ze}),jr=Symbol("current"),Et=Symbol("previous"),mn=I((r,{ref:u,refType:f,param:C,header:w,...R}={})=>({...R,...r}),"mergeOpenApi");function gn(r){if(typeof r.ZodType.prototype.openapi<"u")return;r.ZodType.prototype.openapi=function(R){let{zodOpenApi:S,...M}=this._def,N=new this.constructor({...M,zodOpenApi:{openapi:mn(R,S?.openapi)}});return N._def.zodOpenApi[jr]=N,S&&(N._def.zodOpenApi[Et]=this),N};let u=r.ZodType.prototype.describe;r.ZodType.prototype.describe=function(...R){let S=u.apply(this,R),M=S._def;if(M.zodOpenApi){let N={...M.zodOpenApi};N.openapi=mn({description:R[0]},N.openapi),N[Et]=this,N[jr]=S,M.zodOpenApi=N}else M.zodOpenApi={openapi:{description:R[0]},[jr]:S};return S};let f=r.ZodObject.prototype.extend;r.ZodObject.prototype.extend=function(...R){let S=f.apply(this,R),M=S._def.zodOpenApi;if(M){let N={...M};N.openapi=mn({},N.openapi),N[Et]=this,S._def.zodOpenApi=N}else S._def.zodOpenApi={[Et]:this};return S};let C=r.ZodObject.prototype.omit;r.ZodObject.prototype.omit=function(...R){let S=C.apply(this,R),M=S._def.zodOpenApi;if(M){let N={...M};N.openapi=mn({},N.openapi),delete N[Et],delete N[jr],S._def.zodOpenApi=N}return S};let w=r.ZodObject.prototype.pick;r.ZodObject.prototype.pick=function(...R){let S=w.apply(this,R),M=S._def.zodOpenApi;if(M){let N={...M};N.openapi=mn({},N.openapi),delete N[Et],delete N[jr],S._def.zodOpenApi=N}return S}}b(gn,"extendZodWithOpenApi"),ue(gn,"extendZodWithOpenApi"),h(gn,"extendZodWithOpenApi"),I(gn,"extendZodWithOpenApi"),gn(i);var Vr=i.array(i.string().or(i.record(i.any()))),mi=i.object({type:i.string().optional(),narrative:i.string().optional()}),et=i.string().or(i.object({id:i.string(),type:i.string(),caption:i.string().optional()})),Ta=i.object({type:i.string().min(1).or(i.string().array().nonempty()),latitude:i.number(),longitude:i.number()}),gi=i.object({type:i.string().min(1).or(i.string().array().nonempty()),addressCountry:i.string().optional(),addressCountryCode:i.string().optional(),addressRegion:i.string().optional(),addressLocality:i.string().optional(),streetAddress:i.string().optional(),postOfficeBoxNumber:i.string().optional(),postalCode:i.string().optional(),geo:Ta.optional()}),ka=i.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(i.string()),rr=i.object({type:i.string().min(1).or(i.string().array().nonempty()),identifier:i.string(),identifierType:ka}),nr=i.string().or(i.object({id:i.string().optional(),type:i.string().or(i.string().array().nonempty().optional()),name:i.string().optional(),url:i.string().optional(),phone:i.string().optional(),description:i.string().optional(),endorsement:i.any().array().optional(),image:et.optional(),email:i.string().email().optional(),address:gi.optional(),otherIdentifier:rr.array().optional(),official:i.string().optional(),parentOrg:i.any().optional(),familyName:i.string().optional(),givenName:i.string().optional(),additionalName:i.string().optional(),patronymicName:i.string().optional(),honorificPrefix:i.string().optional(),honorificSuffix:i.string().optional(),familyNamePrefix:i.string().optional(),dateOfBirth:i.string().optional()}).catchall(i.any())),yn=i.object({id:i.string().optional()}).catchall(i.any()),Ar=i.object({type:i.string(),id:i.string()}).catchall(i.any()),$n=i.object({id:i.string(),type:i.string()}).catchall(i.any()),Fn=i.object({id:i.string().optional(),type:i.string()}).catchall(i.any()),Wn=i.object({type:i.string(),id:i.string().optional()}).catchall(i.any()),Hn=i.object({type:i.string().or(i.string().array().nonempty()),id:i.string().optional()}).catchall(i.any()),ar=i.object({"@context":Vr,id:i.string().optional(),type:i.string().array().nonempty(),issuer:nr,credentialSubject:yn.or(yn.array()),refreshService:Fn.or(Fn.array()).optional(),credentialSchema:$n.or($n.array()).optional(),issuanceDate:i.string().optional(),expirationDate:i.string().optional(),credentialStatus:Ar.or(Ar.array()).optional(),name:i.string().optional(),description:i.string().optional(),validFrom:i.string().optional(),validUntil:i.string().optional(),status:Ar.or(Ar.array()).optional(),termsOfUse:Wn.or(Wn.array()).optional(),evidence:Hn.or(Hn.array()).optional()}).catchall(i.any()),tt=i.object({type:i.string(),created:i.string(),challenge:i.string().optional(),domain:i.string().optional(),nonce:i.string().optional(),proofPurpose:i.string(),verificationMethod:i.string(),jws:i.string().optional()}).catchall(i.any()),vn=ar.extend({proof:tt.or(tt.array())}),Sa=i.object({"@context":Vr,id:i.string().optional(),type:i.string().or(i.string().array().nonempty()),verifiableCredential:vn.or(vn.array()).optional(),holder:i.string().optional()}).catchall(i.any()),Ra=Sa.extend({proof:tt.or(tt.array())}),bn=i.object({kty:i.string(),crv:i.string(),x:i.string(),y:i.string().optional(),n:i.string().optional(),d:i.string().optional()}),Pa=bn.omit({d:!0}).extend({d:i.string()}),Oa=i.object({alg:i.string(),iv:i.string(),tag:i.string(),epk:bn.partial().optional(),kid:i.string().optional(),apv:i.string().optional(),apu:i.string().optional()}),ja=i.object({header:Oa,encrypted_key:i.string()}),yi=i.object({protected:i.string(),iv:i.string(),ciphertext:i.string(),tag:i.string(),aad:i.string().optional(),recipients:ja.array().optional()}),Bt=i.string().or(i.object({"@context":Vr.optional(),id:i.string(),type:i.string(),controller:i.string(),publicKeyJwk:bn.optional(),publicKeyBase58:i.string().optional(),publicKeyMultibase:i.string().optional(),blockChainAccountId:i.string().optional()}).catchall(i.any())),Gn=i.object({id:i.string(),type:i.string().or(i.string().array().nonempty()),serviceEndpoint:i.any().or(i.any().array().nonempty())}).catchall(i.any()),Zo=i.object({"@context":Vr,id:i.string(),alsoKnownAs:i.string().optional(),controller:i.string().or(i.string().array().nonempty()).optional(),verificationMethod:Bt.array().optional(),authentication:Bt.array().optional(),assertionMethod:Bt.array().optional(),keyAgreement:Bt.array().optional(),capabilityInvocation:Bt.array().optional(),capabilityDelegation:Bt.array().optional(),publicKey:Bt.array().optional(),service:Gn.array().optional(),proof:tt.or(tt.array()).optional()}).catchall(i.any()),vi=i.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(i.string()),_n=i.object({type:i.string().array().nonempty(),targetCode:i.string().optional(),targetDescription:i.string().optional(),targetName:i.string(),targetFramework:i.string().optional(),targetType:vi.optional(),targetUrl:i.string()}),bi=i.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"]),_i=bi.or(i.string()),Oe=i.object({id:i.string().optional(),narrative:i.string().optional()}).catchall(i.any()),Jn=i.object({id:i.string(),type:i.string().array().nonempty(),endorsementComment:i.string().optional()}),wi=ar.extend({credentialSubject:Jn,proof:tt.or(tt.array()).optional()}),Va=i.object({id:i.string(),"@language":i.string().optional(),version:i.string().optional()}),Ci=i.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(i.string()),Aa=i.object({id:i.string(),type:i.string().array().nonempty(),alignment:_n.array().optional(),description:i.string().optional(),level:i.string().optional(),name:i.string(),points:i.string().optional()}).catchall(i.any()),Ia=i.object({id:i.string(),type:i.string().array().nonempty(),alignment:_n.array().optional(),allowedValue:i.string().array().optional(),name:i.string(),requiredLevel:i.string().optional(),requiredValue:i.string().optional(),resultType:Ci,rubricCriterionLevel:Aa.array().optional(),valueMax:i.string().optional(),valueMin:i.string().optional()}).catchall(i.any()),pe=i.object({id:i.string().optional(),type:i.string().array().nonempty(),alignment:_n.array().optional(),achievementType:_i.optional(),creator:nr.optional(),creditsAvailable:i.number().optional(),criteria:Oe,description:i.string(),endorsement:wi.array().optional(),fieldOfStudy:i.string().optional(),humanCode:i.string().optional(),image:et.optional(),"@language":i.string().optional(),name:i.string(),otherIdentifier:rr.array().optional(),related:Va.array().optional(),resultDescription:Ia.array().optional(),specialization:i.string().optional(),tag:i.string().array().optional(),version:i.string().optional()}).catchall(i.any()),Na=i.object({type:i.string(),hashed:i.boolean(),identityHash:i.string(),identityType:i.string(),salt:i.string().optional()}),pt=i.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),xi=i.object({type:i.string().array().nonempty(),achievedLevel:i.string().optional(),alignment:_n.array().optional(),resultDescription:i.string().optional(),status:pt.optional(),value:i.string().optional()}).catchall(i.any()),Da=i.object({id:i.string().optional(),type:i.string().array().nonempty(),activityEndDate:i.string().optional(),activityStartDate:i.string().optional(),creditsEarned:i.number().optional(),achievement:pe.optional(),identifier:Na.array().optional(),image:et.optional(),licenseNumber:i.string().optional(),narrative:i.string().optional(),result:xi.array().optional(),role:i.string().optional(),source:nr.optional(),term:i.string().optional()}).catchall(i.any()),Ei=i.object({id:i.string().optional(),type:i.string().or(i.string().array().nonempty()),narrative:i.string().optional(),name:i.string().optional(),description:i.string().optional(),genre:i.string().optional(),audience:i.string().optional()}).catchall(i.any()),Qn=ar.extend({name:i.string().optional(),description:i.string().optional(),image:et.optional(),credentialSubject:Da.or(Da.array()),endorsement:ar.array().optional(),evidence:Ei.array().optional()}),Uo=Qn.extend({proof:tt.or(tt.array())}),Bo=i.object({checks:i.string().array(),warnings:i.string().array(),errors:i.string().array()}),Ma=i.enum(["Success","Failed","Error"]),qo=Ma.enum,La=i.object({check:i.string(),status:Ma,message:i.string().optional(),details:i.string().optional()}),Ti=i.object({title:i.string().optional(),createdAt:i.string().optional(),issuer:nr.optional(),issuee:nr.optional(),credentialSubject:yn.optional()}),Yn=i.object({id:i.string(),uri:i.string()}).catchall(i.any()),ki=i.object({limit:i.number(),cursor:i.string().optional(),sort:i.string().optional()}),Ne=i.object({cursor:i.string().optional(),hasMore:i.boolean()}),Kn=i.object({encryptedRecord:yi,fields:i.string().array()}).catchall(i.any()),zo=Ne.extend({records:Kn.array()}),wn=Kn.extend({id:i.string()}),Si=Ne.extend({records:wn.array()}),Ri=I(r=>{let u=r.match(/^\/(.*)\/([gimsuy]*)$/);if(!u)throw new Error("Invalid RegExp string format");return{pattern:u[1],flags:u[2]}},"parseRegexString"),Pi=i.instanceof(RegExp).or(i.string().refine(r=>{try{return Ri(r),!0}catch{return!1}},{message:"Invalid RegExp string format. Must be in format '/pattern/flags'"}).transform(r=>{let{pattern:u,flags:f}=Ri(r);try{return new RegExp(u,f)}catch(C){throw new Error(`Invalid RegExp: ${C.message}`)}})),fe=i.string().or(i.object({$in:i.string().array()})).or(i.object({$regex:Pi})),Oi=i.object({backgroundColor:i.string().optional(),backgroundImage:i.string().optional(),fadeBackgroundImage:i.boolean().optional(),repeatBackgroundImage:i.boolean().optional(),fontColor:i.string().optional(),accentColor:i.string().optional(),accentFontColor:i.string().optional(),idBackgroundImage:i.string().optional(),fadeIdBackgroundImage:i.boolean().optional(),idBackgroundColor:i.string().optional(),repeatIdBackgroundImage:i.boolean().optional()}),ft=i.object({profileId:i.string().min(3).max(40).describe("Unique, URL-safe identifier for the profile."),displayName:i.string().default("").describe("Human-readable display name for the profile."),shortBio:i.string().default("").describe("Short bio for the profile."),bio:i.string().default("").describe("Longer bio for the profile."),did:i.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),isPrivate:i.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),email:i.string().optional().describe("Contact email address for the profile. (deprecated)"),image:i.string().optional().describe("Profile image URL for the profile."),heroImage:i.string().optional().describe("Hero image URL for the profile."),websiteLink:i.string().optional().describe("Website link for the profile."),isServiceProfile:i.boolean().default(!1).optional().describe("Whether the profile is a service profile or not."),type:i.string().optional().describe('Profile type: e.g. "person", "organization", "service".'),notificationsWebhook:i.string().url().startsWith("http").optional().describe("URL to send notifications to."),display:Oi.optional().describe("Display settings for the profile."),highlightedCredentials:i.array(i.string()).max(5).optional().describe("Up to 5 unique boost URIs to highlight on the profile."),role:i.string().default("").optional().describe('Role of the profile: e.g. "teacher", "student".'),dob:i.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".'),country:i.string().optional().describe("Country for the profile."),approved:i.boolean().optional().describe("Approval status for the profile.")}),$o=i.object({profileId:fe,displayName:fe,shortBio:fe,bio:fe,email:fe,websiteLink:fe,isServiceProfile:i.boolean(),type:fe}).partial(),Fo=Ne.extend({records:ft.array()}),Wo=i.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),Xn=i.object({id:i.string(),created:i.string(),displayName:i.string().default("").optional(),shortBio:i.string().default("").optional(),bio:i.string().default("").optional(),email:i.string().optional(),image:i.string().optional(),heroImage:i.string().optional()}),Ho=Ne.extend({records:Xn.extend({did:i.string()}).array()}),Go=i.object({id:fe,displayName:fe,shortBio:fe,bio:fe,email:fe}).partial(),ji=Ne.extend({records:i.object({profile:ft,manager:Xn.extend({did:i.string()}).optional()}).array()}),Vi=i.object({uri:i.string(),to:i.string(),from:i.string(),sent:i.string().datetime(),received:i.string().datetime().optional()}),Cn=i.object({role:i.string(),canEdit:i.boolean(),canIssue:i.boolean(),canRevoke:i.boolean(),canManagePermissions:i.boolean(),canIssueChildren:i.string(),canCreateChildren:i.string(),canEditChildren:i.string(),canRevokeChildren:i.string(),canManageChildrenPermissions:i.string(),canManageChildrenProfiles:i.boolean().default(!1).optional(),canViewAnalytics:i.boolean()}),Ai=i.object({role:fe,canEdit:i.boolean(),canIssue:i.boolean(),canRevoke:i.boolean(),canManagePermissions:i.boolean(),canIssueChildren:fe,canCreateChildren:fe,canEditChildren:fe,canRevokeChildren:fe,canManageChildrenPermissions:fe,canManageChildrenProfiles:i.boolean(),canViewAnalytics:i.boolean()}).partial(),xn=i.enum(["GRANT_PERMISSIONS","ADD_ADMIN","AUTO_CONNECT"]),Ii=i.discriminatedUnion("type",[i.object({type:i.literal(xn.Values.GRANT_PERMISSIONS),data:i.object({claimUri:i.string(),targetUri:i.string(),permissions:Cn.partial()})}),i.object({type:i.literal(xn.Values.ADD_ADMIN),data:i.object({claimUri:i.string(),targetUri:i.string()})}),i.object({type:i.literal(xn.Values.AUTO_CONNECT),data:i.object({claimUri:i.string(),targetUri:i.string()})})]),Ni=i.object({type:fe,data:i.object({claimUri:fe,targetUri:fe,permissions:Ai})}).deepPartial(),Di=i.object({id:i.string(),createdAt:i.string(),updatedAt:i.string()}).and(Ii),Za=Ne.extend({records:Di.array()}),Ir=i.enum(["DRAFT","LIVE"]),Mi=i.object({uri:i.string(),name:i.string().optional(),type:i.string().optional(),category:i.string().optional(),status:Ir.optional(),autoConnectRecipients:i.boolean().optional(),meta:i.record(i.any()).optional(),claimPermissions:Cn.optional(),allowAnyoneToCreateChildren:i.boolean().optional()}),Jo=i.object({uri:fe,name:fe,type:fe,category:fe,meta:i.record(fe),status:Ir.or(i.object({$in:Ir.array()})),autoConnectRecipients:i.boolean()}).partial(),Qo=Ne.extend({records:Mi.array()}),Li=i.object({to:ft,from:i.string(),received:i.string().optional(),uri:i.string().optional()}),Zi=Ne.extend({records:Li.array()}),En=i.object({to:ft,from:i.string(),received:i.string().optional(),boostUris:i.array(i.string()),credentialUris:i.array(i.string()).optional()}),Yo=Ne.extend({records:En.array()}),Ua=i.object({endpoint:i.string(),name:i.string(),did:i.string().optional()}),Ko=i.object({ttlSeconds:i.number().optional(),totalUses:i.number().optional()}),Ba=i.object({endpoint:i.string()}),Xo=i.object({signingAuthority:Ba,relationship:i.object({name:i.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:i.string(),isPrimary:i.boolean().optional()})}),Ui=i.object({boostUri:i.string(),signingAuthority:i.object({endpoint:i.string(),name:i.string()})}),qa=i.enum(["live","stale","withdrawn"]),za=i.object({read:i.object({anonymize:i.boolean().optional(),credentials:i.object({categories:i.record(i.object({required:i.boolean(),defaultEnabled:i.boolean().optional()})).default({})}).default({}),personal:i.record(i.object({required:i.boolean(),defaultEnabled:i.boolean().optional()})).default({})}).default({}),write:i.object({credentials:i.object({categories:i.record(i.object({required:i.boolean(),defaultEnabled:i.boolean().optional()})).default({})}).default({}),personal:i.record(i.object({required:i.boolean(),defaultEnabled:i.boolean().optional()})).default({})}).default({})}),ir=i.object({contract:za,owner:ft,name:i.string(),subtitle:i.string().optional(),description:i.string().optional(),reasonForAccessing:i.string().optional(),image:i.string().optional(),uri:i.string(),needsGuardianConsent:i.boolean().optional(),redirectUrl:i.string().optional(),frontDoorBoostUri:i.string().optional(),createdAt:i.string(),updatedAt:i.string(),expiresAt:i.string().optional(),autoBoosts:i.string().array().optional(),writers:i.array(ft).optional()}),Bi=Ne.extend({records:ir.omit({owner:!0}).array()}),$a=i.object({credentials:i.object({categories:i.record(i.string().array()).default({})}),personal:i.record(i.string()).default({}),date:i.string()}),es=Ne.extend({records:$a.array()}),Fa=i.object({credentials:i.object({category:i.string(),uri:i.string()}).array(),personal:i.record(i.string()).default({}),date:i.string(),contractUri:i.string()}),ts=Ne.extend({records:Fa.array()}),Wa=i.object({sharing:i.boolean().optional(),shared:i.string().array().optional(),shareAll:i.boolean().optional(),shareUntil:i.string().optional()}),ea=i.object({read:i.object({anonymize:i.boolean().optional(),credentials:i.object({shareAll:i.boolean().optional(),sharing:i.boolean().optional(),categories:i.record(Wa).default({})}).default({}),personal:i.record(i.string()).default({})}).default({}),write:i.object({credentials:i.object({categories:i.record(i.boolean()).default({})}).default({}),personal:i.record(i.boolean()).default({})}).default({}),deniedWriters:i.array(i.string()).optional()}),rs=Ne.extend({records:i.object({expiresAt:i.string().optional(),oneTime:i.boolean().optional(),terms:ea,contract:ir,uri:i.string(),consenter:ft,status:qa}).array()}),qi=i.object({read:i.object({anonymize:i.boolean().optional(),credentials:i.object({categories:i.record(i.object({required:i.boolean().optional()})).optional()}).optional(),personal:i.record(i.object({required:i.boolean().optional()})).optional()}).optional(),write:i.object({credentials:i.object({categories:i.record(i.object({required:i.boolean().optional()})).optional()}).optional(),personal:i.record(i.object({required:i.boolean().optional()})).optional()}).optional()}),ns=i.object({anonymize:i.boolean().optional(),credentials:i.object({categories:i.record(i.boolean()).optional()}).optional(),personal:i.record(i.boolean()).optional()}),zi=i.object({credentials:i.object({categories:i.record(i.boolean()).optional()}).optional(),personal:i.record(i.boolean()).optional(),id:fe.optional()}),$i=i.object({read:i.object({anonymize:i.boolean().optional(),credentials:i.object({shareAll:i.boolean().optional(),sharing:i.boolean().optional(),categories:i.record(Wa.optional()).optional()}).optional(),personal:i.record(i.string()).optional()}).optional(),write:i.object({credentials:i.object({categories:i.record(i.boolean()).optional()}).optional(),personal:i.record(i.boolean()).optional()}).optional()}),Nr=i.enum(["consent","update","sync","withdraw","write"]),as=i.object({terms:$i.optional(),action:Nr.or(Nr.array()).optional(),date:i.object({$gt:i.string()}).or(i.object({$lt:i.string()})).or(i.object({$eq:i.string()})).optional(),expiresAt:i.object({$gt:i.string()}).or(i.object({$lt:i.string()})).or(i.object({$eq:i.string()})).optional(),oneTime:i.boolean().optional()}),Ha=i.object({expiresAt:i.string().optional(),oneTime:i.boolean().optional(),terms:ea.optional(),id:i.string(),action:Nr,date:i.string(),uris:i.string().array().optional()}),is=Ne.extend({records:Ha.array()}),Ga=i.object({credentialUri:i.string(),termsUri:i.string(),contractUri:i.string(),boostUri:i.string(),category:i.string().optional(),date:i.string()}),os=Ne.extend({records:Ga.array()}),Fi=i.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"]),Ja=i.object({title:i.string().optional(),body:i.string().optional()}),Wi=i.object({type:i.string(),value:i.string()}),Tn=i.enum(["PENDING","DELIVERED","CLAIMED","EXPIRED"]),Hi=i.object({issuanceId:i.string(),status:Tn,recipient:i.object({contactMethod:Wi.optional(),learnCardId:i.string().optional()}),timestamp:i.string().datetime().optional()}),t=i.object({vcUris:i.array(i.string()).optional(),vpUris:i.array(i.string()).optional(),transaction:Ha.optional(),inbox:Hi.optional()}),d=i.object({type:Fi,to:ft.partial().and(i.object({did:i.string()})),from:ft.partial().and(i.object({did:i.string()})),message:Ja.optional(),data:t.optional(),sent:i.string().datetime().optional(),webhookUrl:i.string().optional()}),p="auth-grant:",x=i.object({id:i.string(),name:i.string(),description:i.string().optional(),challenge:i.string().startsWith(p).min(10,{message:"Challenge is too short"}).max(100,{message:"Challenge is too long"}),status:i.enum(["revoked","active"],{required_error:"Status is required",invalid_type_error:"Status must be either active or revoked"}),scope:i.string(),createdAt:i.string().datetime({message:"createdAt must be a valid ISO 8601 datetime string"}),expiresAt:i.string().datetime({message:"expiresAt must be a valid ISO 8601 datetime string"}).nullish().optional()}),_=i.object({id:i.string()}).catchall(i.any()),k=i.enum(["active","revoked"]),T=i.object({id:fe,name:fe,description:fe,status:k}).partial(),D=i.object({id:i.string(),isVerified:i.boolean(),verifiedAt:i.string().optional(),isPrimary:i.boolean(),createdAt:i.string()}),A=i.discriminatedUnion("type",[i.object({type:i.literal("email"),value:i.string().email()}).merge(D),i.object({type:i.literal("phone"),value:i.string()}).merge(D)]),te=i.object({isVerified:i.boolean().optional(),isPrimary:i.boolean().optional()}),we=i.discriminatedUnion("type",[i.object({type:i.literal("email"),value:i.string().email()}).merge(te),i.object({type:i.literal("phone"),value:i.string()}).merge(te)]),ta=i.discriminatedUnion("type",[i.object({type:i.literal("email"),value:i.string().email()}),i.object({type:i.literal("phone"),value:i.string()})]),Qa=i.object({value:i.string(),type:i.enum(["email","phone"])}),ul=i.object({token:i.string()}),pl=i.object({contactMethodId:i.string()}),Gs=i.object({id:i.string(),credential:i.string(),isSigned:i.boolean(),currentStatus:Tn,expiresAt:i.string(),createdAt:i.string(),issuerDid:i.string(),webhookUrl:i.string().optional(),signingAuthority:i.object({endpoint:i.string().optional(),name:i.string().optional()}).optional()}),fl=i.object({hasMore:i.boolean(),records:i.array(Gs),cursor:i.string().optional()}),hl=i.object({currentStatus:Tn,id:i.string(),isSigned:i.boolean(),issuerDid:i.string()}).partial(),Js=i.object({endpoint:i.string().url(),name:i.string()}),ml=i.object({recipient:ta.describe("The recipient of the credential"),credential:vn.passthrough().or(Ra.passthrough()).or(ar.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:i.object({signingAuthority:Js.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:i.string().url().optional().describe("The webhook URL to receive credential issuance events."),expiresInDays:i.number().min(1).max(365).optional().describe("The number of days the credential will be valid for."),delivery:i.object({suppress:i.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:i.object({id:i.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:i.object({issuer:i.object({name:i.string().optional().describe('The name of the organization (e.g., "State University").'),logoUrl:i.string().url().optional().describe("The URL of the organization's logo.")}).optional(),credential:i.object({name:i.string().optional().describe('The name of the credential (e.g., "Bachelor of Science").'),type:i.string().optional().describe('The type of the credential (e.g., "degree", "certificate").')}).optional(),recipient:i.object({name:i.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.")}),gl=i.object({issuanceId:i.string(),status:Tn,recipient:ta,claimUrl:i.string().url().optional(),recipientDid:i.string().optional()}),yl=i.object({token:i.string(),contactMethodId:i.string(),autoVerifyContactMethod:i.boolean().optional().default(!1),createdAt:i.string(),expiresAt:i.string(),used:i.boolean()})}}),j=m({"../learn-card-types/dist/index.js"(de,ye){"use strict";ye.exports=oe()}}),ke={};E(ke,{RegExpTransformer:()=>ha,isEncrypted:()=>Mn,isHex:()=>Pt,isVC2Format:()=>pr}),e.exports=O(ke);var Re=z(j()),Pt=h(de=>/^[0-9a-f]+$/i.test(de),"isHex"),Mn=h(de=>Re.JWEValidator.safeParse(de).success,"isEncrypted"),ha={serialize(de){return JSON.stringify(de,(ye,L)=>L instanceof RegExp?L.toString():L)},deserialize(de){return typeof de!="string"?de:JSON.parse(de,(ye,L)=>{if(typeof L=="string"){let be=L.match(/^\/(.*)\/([gimsuy]*)$/);if(be)try{return new RegExp(be[1],be[2])}catch(H){return console.warn(`Failed to parse RegExp: ${H}`),L}}return L})}},pr=h(de=>!de["@context"]||!Array.isArray(de["@context"])?!1:de["@context"].includes("https://www.w3.org/ns/credentials/v2"),"isVC2Format")}}),Rd=Pc({"../../learn-card-helpers/dist/index.js"(n,e){"use strict";e.exports=Sd()}}),As=kd(Rd()),Pd=ue(n=>()=>({next:e,op:s})=>Vs(l=>{let c=null,g=0,y=!1,v=ue(()=>{g+=1,c?.unsubscribe(),c=e(s).subscribe({error:async h=>{if(g>5||h.data?.httpStatus!==401)return l.error(h);await n(),v()},next:h=>l.next(h),complete:()=>{y&&l.complete()}})},"attempt");return v(),()=>{y=!0,c?.unsubscribe()}}),"callbackLink"),Oc=ue(async(n,e)=>{let s=[],l=oa({links:[ti({methodOverride:"POST",url:n,maxURLLength:3072,headers:{Authorization:`Bearer ${await e()}`},transformer:{input:As.RegExpTransformer,output:{serialize:y=>y,deserialize:y=>y}}})]}),c=ue(async(y=95+Math.round((Math.random()-.5)*5))=>l.utilities.getChallenges.query({amount:y}),"getChallenges");return c().then(y=>s=y),oa({links:[Pd(async()=>{s=await c()}),ti({methodOverride:"POST",maxURLLength:3072,url:n,headers:async()=>(s.length===0&&s.push(...await c()),{Authorization:`Bearer ${await e(s.pop())}`}),transformer:{input:As.RegExpTransformer,output:{serialize:y=>y,deserialize:y=>y}}})]})},"getClient"),jc=ue(async(n,e)=>oa({links:[ti({methodOverride:"POST",url:n,maxURLLength:3072,headers:{Authorization:`Bearer ${e}`},transformer:{input:As.RegExpTransformer,output:{serialize:l=>l,deserialize:l=>l}}})]}),"getApiTokenClient");var he;(function(n){n.assertEqual=c=>c;function e(c){}b(e,"assertIs"),n.assertIs=e;function s(c){throw new Error}b(s,"assertNever"),n.assertNever=s,n.arrayToEnum=c=>{let g={};for(let y of c)g[y]=y;return g},n.getValidEnumValues=c=>{let g=n.objectKeys(c).filter(v=>typeof c[c[v]]!="number"),y={};for(let v of g)y[v]=c[v];return n.objectValues(y)},n.objectValues=c=>n.objectKeys(c).map(function(g){return c[g]}),n.objectKeys=typeof Object.keys=="function"?c=>Object.keys(c):c=>{let g=[];for(let y in c)Object.prototype.hasOwnProperty.call(c,y)&&g.push(y);return g},n.find=(c,g)=>{for(let y of c)if(g(y))return y},n.isInteger=typeof Number.isInteger=="function"?c=>Number.isInteger(c):c=>typeof c=="number"&&isFinite(c)&&Math.floor(c)===c;function l(c,g=" | "){return c.map(y=>typeof y=="string"?`'${y}'`:y).join(g)}b(l,"joinValues"),n.joinValues=l,n.jsonStringifyReplacer=(c,g)=>typeof g=="bigint"?g.toString():g})(he||(he={}));var Ds;(function(n){n.mergeShapes=(e,s)=>({...e,...s})})(Ds||(Ds={}));var $=he.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Br=b(n=>{switch(typeof n){case"undefined":return $.undefined;case"string":return $.string;case"number":return isNaN(n)?$.nan:$.number;case"boolean":return $.boolean;case"function":return $.function;case"bigint":return $.bigint;case"symbol":return $.symbol;case"object":return Array.isArray(n)?$.array:n===null?$.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?$.promise:typeof Map<"u"&&n instanceof Map?$.map:typeof Set<"u"&&n instanceof Set?$.set:typeof Date<"u"&&n instanceof Date?$.date:$.object;default:return $.unknown}},"getParsedType"),U=he.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"]),Od=b(n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),qe=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=l=>{this.issues=[...this.issues,l]},this.addIssues=(l=[])=>{this.issues=[...this.issues,...l]};let s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let s=e||function(g){return g.message},l={_errors:[]},c=b(g=>{for(let y of g.issues)if(y.code==="invalid_union")y.unionErrors.map(c);else if(y.code==="invalid_return_type")c(y.returnTypeError);else if(y.code==="invalid_arguments")c(y.argumentsError);else if(y.path.length===0)l._errors.push(s(y));else{let v=l,h=0;for(;h<y.path.length;){let m=y.path[h];h===y.path.length-1?(v[m]=v[m]||{_errors:[]},v[m]._errors.push(s(y))):v[m]=v[m]||{_errors:[]},v=v[m],h++}}},"processError");return c(this),l}static assert(e){if(!(e instanceof qe))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,he.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=s=>s.message){let s={},l=[];for(let c of this.issues)c.path.length>0?(s[c.path[0]]=s[c.path[0]]||[],s[c.path[0]].push(e(c))):l.push(e(c));return{formErrors:l,fieldErrors:s}}get formErrors(){return this.flatten()}};b(qe,"ZodError");qe.create=n=>new qe(n);var ua=b((n,e)=>{let s;switch(n.code){case U.invalid_type:n.received===$.undefined?s="Required":s=`Expected ${n.expected}, received ${n.received}`;break;case U.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(n.expected,he.jsonStringifyReplacer)}`;break;case U.unrecognized_keys:s=`Unrecognized key(s) in object: ${he.joinValues(n.keys,", ")}`;break;case U.invalid_union:s="Invalid input";break;case U.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${he.joinValues(n.options)}`;break;case U.invalid_enum_value:s=`Invalid enum value. Expected ${he.joinValues(n.options)}, received '${n.received}'`;break;case U.invalid_arguments:s="Invalid function arguments";break;case U.invalid_return_type:s="Invalid function return type";break;case U.invalid_date:s="Invalid date";break;case U.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(s=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(s=`${s} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?s=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?s=`Invalid input: must end with "${n.validation.endsWith}"`:he.assertNever(n.validation):n.validation!=="regex"?s=`Invalid ${n.validation}`:s="Invalid";break;case U.too_small:n.type==="array"?s=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?s=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?s=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?s=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:s="Invalid input";break;case U.too_big:n.type==="array"?s=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?s=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?s=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?s=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?s=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:s="Invalid input";break;case U.custom:s="Invalid input";break;case U.invalid_intersection_types:s="Intersection results could not be merged";break;case U.not_multiple_of:s=`Number must be a multiple of ${n.multipleOf}`;break;case U.not_finite:s="Number must be finite";break;default:s=e.defaultError,he.assertNever(n)}return{message:s}},"errorMap"),Ic=ua;function jd(n){Ic=n}b(jd,"setErrorMap");function uo(){return Ic}b(uo,"getErrorMap");var po=b(n=>{let{data:e,path:s,errorMaps:l,issueData:c}=n,g=[...s,...c.path||[]],y={...c,path:g};if(c.message!==void 0)return{...c,path:g,message:c.message};let v="",h=l.filter(m=>!!m).slice().reverse();for(let m of h)v=m(y,{data:e,defaultError:v}).message;return{...c,path:g,message:v}},"makeIssue"),Vd=[];function q(n,e){let s=uo(),l=po({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,s,s===ua?void 0:ua].filter(c=>!!c)});n.common.issues.push(l)}b(q,"addIssueToContext");var Ve=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,s){let l=[];for(let c of s){if(c.status==="aborted")return ne;c.status==="dirty"&&e.dirty(),l.push(c.value)}return{status:e.value,value:l}}static async mergeObjectAsync(e,s){let l=[];for(let c of s){let g=await c.key,y=await c.value;l.push({key:g,value:y})}return Ve.mergeObjectSync(e,l)}static mergeObjectSync(e,s){let l={};for(let c of s){let{key:g,value:y}=c;if(g.status==="aborted"||y.status==="aborted")return ne;g.status==="dirty"&&e.dirty(),y.status==="dirty"&&e.dirty(),g.value!=="__proto__"&&(typeof y.value<"u"||c.alwaysSet)&&(l[g.value]=y.value)}return{status:e.value,value:l}}};b(Ve,"ParseStatus");var ne=Object.freeze({status:"aborted"}),la=b(n=>({status:"dirty",value:n}),"DIRTY"),Ge=b(n=>({status:"valid",value:n}),"OK"),Ms=b(n=>n.status==="aborted","isAborted"),Ls=b(n=>n.status==="dirty","isDirty"),ai=b(n=>n.status==="valid","isValid"),ii=b(n=>typeof Promise<"u"&&n instanceof Promise,"isAsync");function fo(n,e,s,l){if(s==="a"&&!l)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!l:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?l:s==="a"?l.call(n):l?l.value:e.get(n)}b(fo,"__classPrivateFieldGet");function Nc(n,e,s,l,c){if(l==="m")throw new TypeError("Private method is not writable");if(l==="a"&&!c)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!c:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return l==="a"?c.call(n,s):c?c.value=s:e.set(n,s),s}b(Nc,"__classPrivateFieldSet");var G;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e?.message})(G||(G={}));var ri,ni,ht=class{constructor(e,s,l,c){this._cachedPath=[],this.parent=e,this.data=s,this._path=l,this._key=c}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}};b(ht,"ParseInputLazyPath");var Vc=b((n,e)=>{if(ai(e))return{success:!0,data:e.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 s=new qe(n.common.issues);return this._error=s,this._error}}},"handleResult");function ce(n){if(!n)return{};let{errorMap:e,invalid_type_error:s,required_error:l,description:c}=n;if(e&&(s||l))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:c}:{errorMap:b((y,v)=>{var h,m;let{message:E}=n;return y.code==="invalid_enum_value"?{message:E??v.defaultError}:typeof v.data>"u"?{message:(h=E??l)!==null&&h!==void 0?h:v.defaultError}:y.code!=="invalid_type"?{message:v.defaultError}:{message:(m=E??s)!==null&&m!==void 0?m:v.defaultError}},"customMap"),description:c}}b(ce,"processCreateParams");var se=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,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(e){return Br(e.data)}_getOrReturnCtx(e,s){return s||{common:e.parent.common,data:e.data,parsedType:Br(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ve,ctx:{common:e.parent.common,data:e.data,parsedType:Br(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let s=this._parse(e);if(ii(s))throw new Error("Synchronous parse encountered promise.");return s}_parseAsync(e){let s=this._parse(e);return Promise.resolve(s)}parse(e,s){let l=this.safeParse(e,s);if(l.success)return l.data;throw l.error}safeParse(e,s){var l;let c={common:{issues:[],async:(l=s?.async)!==null&&l!==void 0?l:!1,contextualErrorMap:s?.errorMap},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Br(e)},g=this._parseSync({data:e,path:c.path,parent:c});return Vc(c,g)}async parseAsync(e,s){let l=await this.safeParseAsync(e,s);if(l.success)return l.data;throw l.error}async safeParseAsync(e,s){let l={common:{issues:[],contextualErrorMap:s?.errorMap,async:!0},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Br(e)},c=this._parse({data:e,path:l.path,parent:l}),g=await(ii(c)?c:Promise.resolve(c));return Vc(l,g)}refine(e,s){let l=b(c=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(c):s,"getIssueProperties");return this._refinement((c,g)=>{let y=e(c),v=b(()=>g.addIssue({code:U.custom,...l(c)}),"setError");return typeof Promise<"u"&&y instanceof Promise?y.then(h=>h?!0:(v(),!1)):y?!0:(v(),!1)})}refinement(e,s){return this._refinement((l,c)=>e(l)?!0:(c.addIssue(typeof s=="function"?s(l,c):s),!1))}_refinement(e){return new at({schema:this,typeName:re.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return gt.create(this,this._def)}nullable(){return Rt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return nt.create(this,this._def)}promise(){return dr.create(this,this._def)}or(e){return Fr.create([this,e],this._def)}and(e){return Wr.create(this,e,this._def)}transform(e){return new at({...ce(this._def),schema:this,typeName:re.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let s=typeof e=="function"?e:()=>e;return new Yr({...ce(this._def),innerType:this,defaultValue:s,typeName:re.ZodDefault})}brand(){return new da({typeName:re.ZodBranded,type:this,...ce(this._def)})}catch(e){let s=typeof e=="function"?e:()=>e;return new Kr({...ce(this._def),innerType:this,catchValue:s,typeName:re.ZodCatch})}describe(e){let s=this.constructor;return new s({...this._def,description:e})}pipe(e){return Xr.create(this,e)}readonly(){return en.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};b(se,"ZodType");var Ad=/^c[^\s-]{8,}$/i,Id=/^[0-9a-z]+$/,Nd=/^[0-9A-HJKMNP-TV-Z]{26}$/,Dd=/^[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,Md=/^[a-z0-9_-]{21}$/i,Ld=/^[-+]?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)?)??$/,Zd=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ud="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ns,Bd=/^(?:(?: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])$/,qd=/^(([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})))$/,zd=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Dc="((\\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])))",$d=new RegExp(`^${Dc}$`);function Mc(n){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`),e}b(Mc,"timeRegexSource");function Fd(n){return new RegExp(`^${Mc(n)}$`)}b(Fd,"timeRegex");function Lc(n){let e=`${Dc}T${Mc(n)}`,s=[];return s.push(n.local?"Z?":"Z"),n.offset&&s.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${s.join("|")})`,new RegExp(`^${e}$`)}b(Lc,"datetimeRegex");function Wd(n,e){return!!((e==="v4"||!e)&&Bd.test(n)||(e==="v6"||!e)&&qd.test(n))}b(Wd,"isValidIP");var rt=class extends se{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==$.string){let g=this._getOrReturnCtx(e);return q(g,{code:U.invalid_type,expected:$.string,received:g.parsedType}),ne}let l=new Ve,c;for(let g of this._def.checks)if(g.kind==="min")e.data.length<g.value&&(c=this._getOrReturnCtx(e,c),q(c,{code:U.too_small,minimum:g.value,type:"string",inclusive:!0,exact:!1,message:g.message}),l.dirty());else if(g.kind==="max")e.data.length>g.value&&(c=this._getOrReturnCtx(e,c),q(c,{code:U.too_big,maximum:g.value,type:"string",inclusive:!0,exact:!1,message:g.message}),l.dirty());else if(g.kind==="length"){let y=e.data.length>g.value,v=e.data.length<g.value;(y||v)&&(c=this._getOrReturnCtx(e,c),y?q(c,{code:U.too_big,maximum:g.value,type:"string",inclusive:!0,exact:!0,message:g.message}):v&&q(c,{code:U.too_small,minimum:g.value,type:"string",inclusive:!0,exact:!0,message:g.message}),l.dirty())}else if(g.kind==="email")Zd.test(e.data)||(c=this._getOrReturnCtx(e,c),q(c,{validation:"email",code:U.invalid_string,message:g.message}),l.dirty());else if(g.kind==="emoji")Ns||(Ns=new RegExp(Ud,"u")),Ns.test(e.data)||(c=this._getOrReturnCtx(e,c),q(c,{validation:"emoji",code:U.invalid_string,message:g.message}),l.dirty());else if(g.kind==="uuid")Dd.test(e.data)||(c=this._getOrReturnCtx(e,c),q(c,{validation:"uuid",code:U.invalid_string,message:g.message}),l.dirty());else if(g.kind==="nanoid")Md.test(e.data)||(c=this._getOrReturnCtx(e,c),q(c,{validation:"nanoid",code:U.invalid_string,message:g.message}),l.dirty());else if(g.kind==="cuid")Ad.test(e.data)||(c=this._getOrReturnCtx(e,c),q(c,{validation:"cuid",code:U.invalid_string,message:g.message}),l.dirty());else if(g.kind==="cuid2")Id.test(e.data)||(c=this._getOrReturnCtx(e,c),q(c,{validation:"cuid2",code:U.invalid_string,message:g.message}),l.dirty());else if(g.kind==="ulid")Nd.test(e.data)||(c=this._getOrReturnCtx(e,c),q(c,{validation:"ulid",code:U.invalid_string,message:g.message}),l.dirty());else if(g.kind==="url")try{new URL(e.data)}catch{c=this._getOrReturnCtx(e,c),q(c,{validation:"url",code:U.invalid_string,message:g.message}),l.dirty()}else g.kind==="regex"?(g.regex.lastIndex=0,g.regex.test(e.data)||(c=this._getOrReturnCtx(e,c),q(c,{validation:"regex",code:U.invalid_string,message:g.message}),l.dirty())):g.kind==="trim"?e.data=e.data.trim():g.kind==="includes"?e.data.includes(g.value,g.position)||(c=this._getOrReturnCtx(e,c),q(c,{code:U.invalid_string,validation:{includes:g.value,position:g.position},message:g.message}),l.dirty()):g.kind==="toLowerCase"?e.data=e.data.toLowerCase():g.kind==="toUpperCase"?e.data=e.data.toUpperCase():g.kind==="startsWith"?e.data.startsWith(g.value)||(c=this._getOrReturnCtx(e,c),q(c,{code:U.invalid_string,validation:{startsWith:g.value},message:g.message}),l.dirty()):g.kind==="endsWith"?e.data.endsWith(g.value)||(c=this._getOrReturnCtx(e,c),q(c,{code:U.invalid_string,validation:{endsWith:g.value},message:g.message}),l.dirty()):g.kind==="datetime"?Lc(g).test(e.data)||(c=this._getOrReturnCtx(e,c),q(c,{code:U.invalid_string,validation:"datetime",message:g.message}),l.dirty()):g.kind==="date"?$d.test(e.data)||(c=this._getOrReturnCtx(e,c),q(c,{code:U.invalid_string,validation:"date",message:g.message}),l.dirty()):g.kind==="time"?Fd(g).test(e.data)||(c=this._getOrReturnCtx(e,c),q(c,{code:U.invalid_string,validation:"time",message:g.message}),l.dirty()):g.kind==="duration"?Ld.test(e.data)||(c=this._getOrReturnCtx(e,c),q(c,{validation:"duration",code:U.invalid_string,message:g.message}),l.dirty()):g.kind==="ip"?Wd(e.data,g.version)||(c=this._getOrReturnCtx(e,c),q(c,{validation:"ip",code:U.invalid_string,message:g.message}),l.dirty()):g.kind==="base64"?zd.test(e.data)||(c=this._getOrReturnCtx(e,c),q(c,{validation:"base64",code:U.invalid_string,message:g.message}),l.dirty()):he.assertNever(g);return{status:l.value,value:e.data}}_regex(e,s,l){return this.refinement(c=>e.test(c),{validation:s,code:U.invalid_string,...G.errToObj(l)})}_addCheck(e){return new rt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...G.errToObj(e)})}url(e){return this._addCheck({kind:"url",...G.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...G.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...G.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...G.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...G.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...G.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...G.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...G.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...G.errToObj(e)})}datetime(e){var s,l;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(s=e?.offset)!==null&&s!==void 0?s:!1,local:(l=e?.local)!==null&&l!==void 0?l:!1,...G.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...G.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...G.errToObj(e)})}regex(e,s){return this._addCheck({kind:"regex",regex:e,...G.errToObj(s)})}includes(e,s){return this._addCheck({kind:"includes",value:e,position:s?.position,...G.errToObj(s?.message)})}startsWith(e,s){return this._addCheck({kind:"startsWith",value:e,...G.errToObj(s)})}endsWith(e,s){return this._addCheck({kind:"endsWith",value:e,...G.errToObj(s)})}min(e,s){return this._addCheck({kind:"min",value:e,...G.errToObj(s)})}max(e,s){return this._addCheck({kind:"max",value:e,...G.errToObj(s)})}length(e,s){return this._addCheck({kind:"length",value:e,...G.errToObj(s)})}nonempty(e){return this.min(1,G.errToObj(e))}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(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(let s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxLength(){let e=null;for(let s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}};b(rt,"ZodString");rt.create=n=>{var e;return new rt({checks:[],typeName:re.ZodString,coerce:(e=n?.coerce)!==null&&e!==void 0?e:!1,...ce(n)})};function Hd(n,e){let s=(n.toString().split(".")[1]||"").length,l=(e.toString().split(".")[1]||"").length,c=s>l?s:l,g=parseInt(n.toFixed(c).replace(".","")),y=parseInt(e.toFixed(c).replace(".",""));return g%y/Math.pow(10,c)}b(Hd,"floatSafeRemainder");var Tt=class extends se{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==$.number){let g=this._getOrReturnCtx(e);return q(g,{code:U.invalid_type,expected:$.number,received:g.parsedType}),ne}let l,c=new Ve;for(let g of this._def.checks)g.kind==="int"?he.isInteger(e.data)||(l=this._getOrReturnCtx(e,l),q(l,{code:U.invalid_type,expected:"integer",received:"float",message:g.message}),c.dirty()):g.kind==="min"?(g.inclusive?e.data<g.value:e.data<=g.value)&&(l=this._getOrReturnCtx(e,l),q(l,{code:U.too_small,minimum:g.value,type:"number",inclusive:g.inclusive,exact:!1,message:g.message}),c.dirty()):g.kind==="max"?(g.inclusive?e.data>g.value:e.data>=g.value)&&(l=this._getOrReturnCtx(e,l),q(l,{code:U.too_big,maximum:g.value,type:"number",inclusive:g.inclusive,exact:!1,message:g.message}),c.dirty()):g.kind==="multipleOf"?Hd(e.data,g.value)!==0&&(l=this._getOrReturnCtx(e,l),q(l,{code:U.not_multiple_of,multipleOf:g.value,message:g.message}),c.dirty()):g.kind==="finite"?Number.isFinite(e.data)||(l=this._getOrReturnCtx(e,l),q(l,{code:U.not_finite,message:g.message}),c.dirty()):he.assertNever(g);return{status:c.value,value:e.data}}gte(e,s){return this.setLimit("min",e,!0,G.toString(s))}gt(e,s){return this.setLimit("min",e,!1,G.toString(s))}lte(e,s){return this.setLimit("max",e,!0,G.toString(s))}lt(e,s){return this.setLimit("max",e,!1,G.toString(s))}setLimit(e,s,l,c){return new Tt({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:l,message:G.toString(c)}]})}_addCheck(e){return new Tt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:G.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:G.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:G.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:G.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:G.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:G.toString(s)})}finite(e){return this._addCheck({kind:"finite",message:G.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:G.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:G.toString(e)})}get minValue(){let e=null;for(let s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxValue(){let e=null;for(let s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&he.isInteger(e.value))}get isFinite(){let e=null,s=null;for(let l of this._def.checks){if(l.kind==="finite"||l.kind==="int"||l.kind==="multipleOf")return!0;l.kind==="min"?(s===null||l.value>s)&&(s=l.value):l.kind==="max"&&(e===null||l.value<e)&&(e=l.value)}return Number.isFinite(s)&&Number.isFinite(e)}};b(Tt,"ZodNumber");Tt.create=n=>new Tt({checks:[],typeName:re.ZodNumber,coerce:n?.coerce||!1,...ce(n)});var kt=class extends se{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==$.bigint){let g=this._getOrReturnCtx(e);return q(g,{code:U.invalid_type,expected:$.bigint,received:g.parsedType}),ne}let l,c=new Ve;for(let g of this._def.checks)g.kind==="min"?(g.inclusive?e.data<g.value:e.data<=g.value)&&(l=this._getOrReturnCtx(e,l),q(l,{code:U.too_small,type:"bigint",minimum:g.value,inclusive:g.inclusive,message:g.message}),c.dirty()):g.kind==="max"?(g.inclusive?e.data>g.value:e.data>=g.value)&&(l=this._getOrReturnCtx(e,l),q(l,{code:U.too_big,type:"bigint",maximum:g.value,inclusive:g.inclusive,message:g.message}),c.dirty()):g.kind==="multipleOf"?e.data%g.value!==BigInt(0)&&(l=this._getOrReturnCtx(e,l),q(l,{code:U.not_multiple_of,multipleOf:g.value,message:g.message}),c.dirty()):he.assertNever(g);return{status:c.value,value:e.data}}gte(e,s){return this.setLimit("min",e,!0,G.toString(s))}gt(e,s){return this.setLimit("min",e,!1,G.toString(s))}lte(e,s){return this.setLimit("max",e,!0,G.toString(s))}lt(e,s){return this.setLimit("max",e,!1,G.toString(s))}setLimit(e,s,l,c){return new kt({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:l,message:G.toString(c)}]})}_addCheck(e){return new kt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:G.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:G.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:G.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:G.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:G.toString(s)})}get minValue(){let e=null;for(let s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxValue(){let e=null;for(let s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}};b(kt,"ZodBigInt");kt.create=n=>{var e;return new kt({checks:[],typeName:re.ZodBigInt,coerce:(e=n?.coerce)!==null&&e!==void 0?e:!1,...ce(n)})};var qr=class extends se{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==$.boolean){let l=this._getOrReturnCtx(e);return q(l,{code:U.invalid_type,expected:$.boolean,received:l.parsedType}),ne}return Ge(e.data)}};b(qr,"ZodBoolean");qr.create=n=>new qr({typeName:re.ZodBoolean,coerce:n?.coerce||!1,...ce(n)});var qt=class extends se{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==$.date){let g=this._getOrReturnCtx(e);return q(g,{code:U.invalid_type,expected:$.date,received:g.parsedType}),ne}if(isNaN(e.data.getTime())){let g=this._getOrReturnCtx(e);return q(g,{code:U.invalid_date}),ne}let l=new Ve,c;for(let g of this._def.checks)g.kind==="min"?e.data.getTime()<g.value&&(c=this._getOrReturnCtx(e,c),q(c,{code:U.too_small,message:g.message,inclusive:!0,exact:!1,minimum:g.value,type:"date"}),l.dirty()):g.kind==="max"?e.data.getTime()>g.value&&(c=this._getOrReturnCtx(e,c),q(c,{code:U.too_big,message:g.message,inclusive:!0,exact:!1,maximum:g.value,type:"date"}),l.dirty()):he.assertNever(g);return{status:l.value,value:new Date(e.data.getTime())}}_addCheck(e){return new qt({...this._def,checks:[...this._def.checks,e]})}min(e,s){return this._addCheck({kind:"min",value:e.getTime(),message:G.toString(s)})}max(e,s){return this._addCheck({kind:"max",value:e.getTime(),message:G.toString(s)})}get minDate(){let e=null;for(let s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e!=null?new Date(e):null}};b(qt,"ZodDate");qt.create=n=>new qt({checks:[],coerce:n?.coerce||!1,typeName:re.ZodDate,...ce(n)});var On=class extends se{_parse(e){if(this._getType(e)!==$.symbol){let l=this._getOrReturnCtx(e);return q(l,{code:U.invalid_type,expected:$.symbol,received:l.parsedType}),ne}return Ge(e.data)}};b(On,"ZodSymbol");On.create=n=>new On({typeName:re.ZodSymbol,...ce(n)});var zr=class extends se{_parse(e){if(this._getType(e)!==$.undefined){let l=this._getOrReturnCtx(e);return q(l,{code:U.invalid_type,expected:$.undefined,received:l.parsedType}),ne}return Ge(e.data)}};b(zr,"ZodUndefined");zr.create=n=>new zr({typeName:re.ZodUndefined,...ce(n)});var $r=class extends se{_parse(e){if(this._getType(e)!==$.null){let l=this._getOrReturnCtx(e);return q(l,{code:U.invalid_type,expected:$.null,received:l.parsedType}),ne}return Ge(e.data)}};b($r,"ZodNull");$r.create=n=>new $r({typeName:re.ZodNull,...ce(n)});var cr=class extends se{constructor(){super(...arguments),this._any=!0}_parse(e){return Ge(e.data)}};b(cr,"ZodAny");cr.create=n=>new cr({typeName:re.ZodAny,...ce(n)});var zt=class extends se{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ge(e.data)}};b(zt,"ZodUnknown");zt.create=n=>new zt({typeName:re.ZodUnknown,...ce(n)});var _t=class extends se{_parse(e){let s=this._getOrReturnCtx(e);return q(s,{code:U.invalid_type,expected:$.never,received:s.parsedType}),ne}};b(_t,"ZodNever");_t.create=n=>new _t({typeName:re.ZodNever,...ce(n)});var jn=class extends se{_parse(e){if(this._getType(e)!==$.undefined){let l=this._getOrReturnCtx(e);return q(l,{code:U.invalid_type,expected:$.void,received:l.parsedType}),ne}return Ge(e.data)}};b(jn,"ZodVoid");jn.create=n=>new jn({typeName:re.ZodVoid,...ce(n)});var nt=class extends se{_parse(e){let{ctx:s,status:l}=this._processInputParams(e),c=this._def;if(s.parsedType!==$.array)return q(s,{code:U.invalid_type,expected:$.array,received:s.parsedType}),ne;if(c.exactLength!==null){let y=s.data.length>c.exactLength.value,v=s.data.length<c.exactLength.value;(y||v)&&(q(s,{code:y?U.too_big:U.too_small,minimum:v?c.exactLength.value:void 0,maximum:y?c.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:c.exactLength.message}),l.dirty())}if(c.minLength!==null&&s.data.length<c.minLength.value&&(q(s,{code:U.too_small,minimum:c.minLength.value,type:"array",inclusive:!0,exact:!1,message:c.minLength.message}),l.dirty()),c.maxLength!==null&&s.data.length>c.maxLength.value&&(q(s,{code:U.too_big,maximum:c.maxLength.value,type:"array",inclusive:!0,exact:!1,message:c.maxLength.message}),l.dirty()),s.common.async)return Promise.all([...s.data].map((y,v)=>c.type._parseAsync(new ht(s,y,s.path,v)))).then(y=>Ve.mergeArray(l,y));let g=[...s.data].map((y,v)=>c.type._parseSync(new ht(s,y,s.path,v)));return Ve.mergeArray(l,g)}get element(){return this._def.type}min(e,s){return new nt({...this._def,minLength:{value:e,message:G.toString(s)}})}max(e,s){return new nt({...this._def,maxLength:{value:e,message:G.toString(s)}})}length(e,s){return new nt({...this._def,exactLength:{value:e,message:G.toString(s)}})}nonempty(e){return this.min(1,e)}};b(nt,"ZodArray");nt.create=(n,e)=>new nt({type:n,minLength:null,maxLength:null,exactLength:null,typeName:re.ZodArray,...ce(e)});function ca(n){if(n instanceof ve){let e={};for(let s in n.shape){let l=n.shape[s];e[s]=gt.create(ca(l))}return new ve({...n._def,shape:()=>e})}else return n instanceof nt?new nt({...n._def,type:ca(n.element)}):n instanceof gt?gt.create(ca(n.unwrap())):n instanceof Rt?Rt.create(ca(n.unwrap())):n instanceof mt?mt.create(n.items.map(e=>ca(e))):n}b(ca,"deepPartialify");var ve=class extends se{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),s=he.objectKeys(e);return this._cached={shape:e,keys:s}}_parse(e){if(this._getType(e)!==$.object){let m=this._getOrReturnCtx(e);return q(m,{code:U.invalid_type,expected:$.object,received:m.parsedType}),ne}let{status:l,ctx:c}=this._processInputParams(e),{shape:g,keys:y}=this._getCached(),v=[];if(!(this._def.catchall instanceof _t&&this._def.unknownKeys==="strip"))for(let m in c.data)y.includes(m)||v.push(m);let h=[];for(let m of y){let E=g[m],P=c.data[m];h.push({key:{status:"valid",value:m},value:E._parse(new ht(c,P,c.path,m)),alwaysSet:m in c.data})}if(this._def.catchall instanceof _t){let m=this._def.unknownKeys;if(m==="passthrough")for(let E of v)h.push({key:{status:"valid",value:E},value:{status:"valid",value:c.data[E]}});else if(m==="strict")v.length>0&&(q(c,{code:U.unrecognized_keys,keys:v}),l.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let m=this._def.catchall;for(let E of v){let P=c.data[E];h.push({key:{status:"valid",value:E},value:m._parse(new ht(c,P,c.path,E)),alwaysSet:E in c.data})}}return c.common.async?Promise.resolve().then(async()=>{let m=[];for(let E of h){let P=await E.key,z=await E.value;m.push({key:P,value:z,alwaysSet:E.alwaysSet})}return m}).then(m=>Ve.mergeObjectSync(l,m)):Ve.mergeObjectSync(l,h)}get shape(){return this._def.shape()}strict(e){return G.errToObj,new ve({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(s,l)=>{var c,g,y,v;let h=(y=(g=(c=this._def).errorMap)===null||g===void 0?void 0:g.call(c,s,l).message)!==null&&y!==void 0?y:l.defaultError;return s.code==="unrecognized_keys"?{message:(v=G.errToObj(e).message)!==null&&v!==void 0?v:h}:{message:h}}}:{}})}strip(){return new ve({...this._def,unknownKeys:"strip"})}passthrough(){return new ve({...this._def,unknownKeys:"passthrough"})}extend(e){return new ve({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ve({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:re.ZodObject})}setKey(e,s){return this.augment({[e]:s})}catchall(e){return new ve({...this._def,catchall:e})}pick(e){let s={};return he.objectKeys(e).forEach(l=>{e[l]&&this.shape[l]&&(s[l]=this.shape[l])}),new ve({...this._def,shape:()=>s})}omit(e){let s={};return he.objectKeys(this.shape).forEach(l=>{e[l]||(s[l]=this.shape[l])}),new ve({...this._def,shape:()=>s})}deepPartial(){return ca(this)}partial(e){let s={};return he.objectKeys(this.shape).forEach(l=>{let c=this.shape[l];e&&!e[l]?s[l]=c:s[l]=c.optional()}),new ve({...this._def,shape:()=>s})}required(e){let s={};return he.objectKeys(this.shape).forEach(l=>{if(e&&!e[l])s[l]=this.shape[l];else{let g=this.shape[l];for(;g instanceof gt;)g=g._def.innerType;s[l]=g}}),new ve({...this._def,shape:()=>s})}keyof(){return Zc(he.objectKeys(this.shape))}};b(ve,"ZodObject");ve.create=(n,e)=>new ve({shape:()=>n,unknownKeys:"strip",catchall:_t.create(),typeName:re.ZodObject,...ce(e)});ve.strictCreate=(n,e)=>new ve({shape:()=>n,unknownKeys:"strict",catchall:_t.create(),typeName:re.ZodObject,...ce(e)});ve.lazycreate=(n,e)=>new ve({shape:n,unknownKeys:"strip",catchall:_t.create(),typeName:re.ZodObject,...ce(e)});var Fr=class extends se{_parse(e){let{ctx:s}=this._processInputParams(e),l=this._def.options;function c(g){for(let v of g)if(v.result.status==="valid")return v.result;for(let v of g)if(v.result.status==="dirty")return s.common.issues.push(...v.ctx.common.issues),v.result;let y=g.map(v=>new qe(v.ctx.common.issues));return q(s,{code:U.invalid_union,unionErrors:y}),ne}if(b(c,"handleResults"),s.common.async)return Promise.all(l.map(async g=>{let y={...s,common:{...s.common,issues:[]},parent:null};return{result:await g._parseAsync({data:s.data,path:s.path,parent:y}),ctx:y}})).then(c);{let g,y=[];for(let h of l){let m={...s,common:{...s.common,issues:[]},parent:null},E=h._parseSync({data:s.data,path:s.path,parent:m});if(E.status==="valid")return E;E.status==="dirty"&&!g&&(g={result:E,ctx:m}),m.common.issues.length&&y.push(m.common.issues)}if(g)return s.common.issues.push(...g.ctx.common.issues),g.result;let v=y.map(h=>new qe(h));return q(s,{code:U.invalid_union,unionErrors:v}),ne}}get options(){return this._def.options}};b(Fr,"ZodUnion");Fr.create=(n,e)=>new Fr({options:n,typeName:re.ZodUnion,...ce(e)});var sr=b(n=>n instanceof Gr?sr(n.schema):n instanceof at?sr(n.innerType()):n instanceof Jr?[n.value]:n instanceof St?n.options:n instanceof Qr?he.objectValues(n.enum):n instanceof Yr?sr(n._def.innerType):n instanceof zr?[void 0]:n instanceof $r?[null]:n instanceof gt?[void 0,...sr(n.unwrap())]:n instanceof Rt?[null,...sr(n.unwrap())]:n instanceof da||n instanceof en?sr(n.unwrap()):n instanceof Kr?sr(n._def.innerType):[],"getDiscriminator"),Vn=class extends se{_parse(e){let{ctx:s}=this._processInputParams(e);if(s.parsedType!==$.object)return q(s,{code:U.invalid_type,expected:$.object,received:s.parsedType}),ne;let l=this.discriminator,c=s.data[l],g=this.optionsMap.get(c);return g?s.common.async?g._parseAsync({data:s.data,path:s.path,parent:s}):g._parseSync({data:s.data,path:s.path,parent:s}):(q(s,{code:U.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[l]}),ne)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,s,l){let c=new Map;for(let g of s){let y=sr(g.shape[e]);if(!y.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let v of y){if(c.has(v))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(v)}`);c.set(v,g)}}return new Vn({typeName:re.ZodDiscriminatedUnion,discriminator:e,options:s,optionsMap:c,...ce(l)})}};b(Vn,"ZodDiscriminatedUnion");function Zs(n,e){let s=Br(n),l=Br(e);if(n===e)return{valid:!0,data:n};if(s===$.object&&l===$.object){let c=he.objectKeys(e),g=he.objectKeys(n).filter(v=>c.indexOf(v)!==-1),y={...n,...e};for(let v of g){let h=Zs(n[v],e[v]);if(!h.valid)return{valid:!1};y[v]=h.data}return{valid:!0,data:y}}else if(s===$.array&&l===$.array){if(n.length!==e.length)return{valid:!1};let c=[];for(let g=0;g<n.length;g++){let y=n[g],v=e[g],h=Zs(y,v);if(!h.valid)return{valid:!1};c.push(h.data)}return{valid:!0,data:c}}else return s===$.date&&l===$.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}b(Zs,"mergeValues");var Wr=class extends se{_parse(e){let{status:s,ctx:l}=this._processInputParams(e),c=b((g,y)=>{if(Ms(g)||Ms(y))return ne;let v=Zs(g.value,y.value);return v.valid?((Ls(g)||Ls(y))&&s.dirty(),{status:s.value,value:v.data}):(q(l,{code:U.invalid_intersection_types}),ne)},"handleParsed");return l.common.async?Promise.all([this._def.left._parseAsync({data:l.data,path:l.path,parent:l}),this._def.right._parseAsync({data:l.data,path:l.path,parent:l})]).then(([g,y])=>c(g,y)):c(this._def.left._parseSync({data:l.data,path:l.path,parent:l}),this._def.right._parseSync({data:l.data,path:l.path,parent:l}))}};b(Wr,"ZodIntersection");Wr.create=(n,e,s)=>new Wr({left:n,right:e,typeName:re.ZodIntersection,...ce(s)});var mt=class extends se{_parse(e){let{status:s,ctx:l}=this._processInputParams(e);if(l.parsedType!==$.array)return q(l,{code:U.invalid_type,expected:$.array,received:l.parsedType}),ne;if(l.data.length<this._def.items.length)return q(l,{code:U.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ne;!this._def.rest&&l.data.length>this._def.items.length&&(q(l,{code:U.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());let g=[...l.data].map((y,v)=>{let h=this._def.items[v]||this._def.rest;return h?h._parse(new ht(l,y,l.path,v)):null}).filter(y=>!!y);return l.common.async?Promise.all(g).then(y=>Ve.mergeArray(s,y)):Ve.mergeArray(s,g)}get items(){return this._def.items}rest(e){return new mt({...this._def,rest:e})}};b(mt,"ZodTuple");mt.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new mt({items:n,typeName:re.ZodTuple,rest:null,...ce(e)})};var Hr=class extends se{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:s,ctx:l}=this._processInputParams(e);if(l.parsedType!==$.object)return q(l,{code:U.invalid_type,expected:$.object,received:l.parsedType}),ne;let c=[],g=this._def.keyType,y=this._def.valueType;for(let v in l.data)c.push({key:g._parse(new ht(l,v,l.path,v)),value:y._parse(new ht(l,l.data[v],l.path,v)),alwaysSet:v in l.data});return l.common.async?Ve.mergeObjectAsync(s,c):Ve.mergeObjectSync(s,c)}get element(){return this._def.valueType}static create(e,s,l){return s instanceof se?new Hr({keyType:e,valueType:s,typeName:re.ZodRecord,...ce(l)}):new Hr({keyType:rt.create(),valueType:e,typeName:re.ZodRecord,...ce(s)})}};b(Hr,"ZodRecord");var An=class extends se{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:s,ctx:l}=this._processInputParams(e);if(l.parsedType!==$.map)return q(l,{code:U.invalid_type,expected:$.map,received:l.parsedType}),ne;let c=this._def.keyType,g=this._def.valueType,y=[...l.data.entries()].map(([v,h],m)=>({key:c._parse(new ht(l,v,l.path,[m,"key"])),value:g._parse(new ht(l,h,l.path,[m,"value"]))}));if(l.common.async){let v=new Map;return Promise.resolve().then(async()=>{for(let h of y){let m=await h.key,E=await h.value;if(m.status==="aborted"||E.status==="aborted")return ne;(m.status==="dirty"||E.status==="dirty")&&s.dirty(),v.set(m.value,E.value)}return{status:s.value,value:v}})}else{let v=new Map;for(let h of y){let m=h.key,E=h.value;if(m.status==="aborted"||E.status==="aborted")return ne;(m.status==="dirty"||E.status==="dirty")&&s.dirty(),v.set(m.value,E.value)}return{status:s.value,value:v}}}};b(An,"ZodMap");An.create=(n,e,s)=>new An({valueType:e,keyType:n,typeName:re.ZodMap,...ce(s)});var $t=class extends se{_parse(e){let{status:s,ctx:l}=this._processInputParams(e);if(l.parsedType!==$.set)return q(l,{code:U.invalid_type,expected:$.set,received:l.parsedType}),ne;let c=this._def;c.minSize!==null&&l.data.size<c.minSize.value&&(q(l,{code:U.too_small,minimum:c.minSize.value,type:"set",inclusive:!0,exact:!1,message:c.minSize.message}),s.dirty()),c.maxSize!==null&&l.data.size>c.maxSize.value&&(q(l,{code:U.too_big,maximum:c.maxSize.value,type:"set",inclusive:!0,exact:!1,message:c.maxSize.message}),s.dirty());let g=this._def.valueType;function y(h){let m=new Set;for(let E of h){if(E.status==="aborted")return ne;E.status==="dirty"&&s.dirty(),m.add(E.value)}return{status:s.value,value:m}}b(y,"finalizeSet");let v=[...l.data.values()].map((h,m)=>g._parse(new ht(l,h,l.path,m)));return l.common.async?Promise.all(v).then(h=>y(h)):y(v)}min(e,s){return new $t({...this._def,minSize:{value:e,message:G.toString(s)}})}max(e,s){return new $t({...this._def,maxSize:{value:e,message:G.toString(s)}})}size(e,s){return this.min(e,s).max(e,s)}nonempty(e){return this.min(1,e)}};b($t,"ZodSet");$t.create=(n,e)=>new $t({valueType:n,minSize:null,maxSize:null,typeName:re.ZodSet,...ce(e)});var lr=class extends se{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:s}=this._processInputParams(e);if(s.parsedType!==$.function)return q(s,{code:U.invalid_type,expected:$.function,received:s.parsedType}),ne;function l(v,h){return po({data:v,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,uo(),ua].filter(m=>!!m),issueData:{code:U.invalid_arguments,argumentsError:h}})}b(l,"makeArgsIssue");function c(v,h){return po({data:v,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,uo(),ua].filter(m=>!!m),issueData:{code:U.invalid_return_type,returnTypeError:h}})}b(c,"makeReturnsIssue");let g={errorMap:s.common.contextualErrorMap},y=s.data;if(this._def.returns instanceof dr){let v=this;return Ge(async function(...h){let m=new qe([]),E=await v._def.args.parseAsync(h,g).catch(O=>{throw m.addIssue(l(h,O)),m}),P=await Reflect.apply(y,this,E);return await v._def.returns._def.type.parseAsync(P,g).catch(O=>{throw m.addIssue(c(P,O)),m})})}else{let v=this;return Ge(function(...h){let m=v._def.args.safeParse(h,g);if(!m.success)throw new qe([l(h,m.error)]);let E=Reflect.apply(y,this,m.data),P=v._def.returns.safeParse(E,g);if(!P.success)throw new qe([c(E,P.error)]);return P.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new lr({...this._def,args:mt.create(e).rest(zt.create())})}returns(e){return new lr({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,s,l){return new lr({args:e||mt.create([]).rest(zt.create()),returns:s||zt.create(),typeName:re.ZodFunction,...ce(l)})}};b(lr,"ZodFunction");var Gr=class extends se{get schema(){return this._def.getter()}_parse(e){let{ctx:s}=this._processInputParams(e);return this._def.getter()._parse({data:s.data,path:s.path,parent:s})}};b(Gr,"ZodLazy");Gr.create=(n,e)=>new Gr({getter:n,typeName:re.ZodLazy,...ce(e)});var Jr=class extends se{_parse(e){if(e.data!==this._def.value){let s=this._getOrReturnCtx(e);return q(s,{received:s.data,code:U.invalid_literal,expected:this._def.value}),ne}return{status:"valid",value:e.data}}get value(){return this._def.value}};b(Jr,"ZodLiteral");Jr.create=(n,e)=>new Jr({value:n,typeName:re.ZodLiteral,...ce(e)});function Zc(n,e){return new St({values:n,typeName:re.ZodEnum,...ce(e)})}b(Zc,"createZodEnum");var St=class extends se{constructor(){super(...arguments),ri.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let s=this._getOrReturnCtx(e),l=this._def.values;return q(s,{expected:he.joinValues(l),received:s.parsedType,code:U.invalid_type}),ne}if(fo(this,ri,"f")||Nc(this,ri,new Set(this._def.values),"f"),!fo(this,ri,"f").has(e.data)){let s=this._getOrReturnCtx(e),l=this._def.values;return q(s,{received:s.data,code:U.invalid_enum_value,options:l}),ne}return Ge(e.data)}get options(){return this._def.values}get enum(){let e={};for(let s of this._def.values)e[s]=s;return e}get Values(){let e={};for(let s of this._def.values)e[s]=s;return e}get Enum(){let e={};for(let s of this._def.values)e[s]=s;return e}extract(e,s=this._def){return St.create(e,{...this._def,...s})}exclude(e,s=this._def){return St.create(this.options.filter(l=>!e.includes(l)),{...this._def,...s})}};b(St,"ZodEnum");ri=new WeakMap;St.create=Zc;var Qr=class extends se{constructor(){super(...arguments),ni.set(this,void 0)}_parse(e){let s=he.getValidEnumValues(this._def.values),l=this._getOrReturnCtx(e);if(l.parsedType!==$.string&&l.parsedType!==$.number){let c=he.objectValues(s);return q(l,{expected:he.joinValues(c),received:l.parsedType,code:U.invalid_type}),ne}if(fo(this,ni,"f")||Nc(this,ni,new Set(he.getValidEnumValues(this._def.values)),"f"),!fo(this,ni,"f").has(e.data)){let c=he.objectValues(s);return q(l,{received:l.data,code:U.invalid_enum_value,options:c}),ne}return Ge(e.data)}get enum(){return this._def.values}};b(Qr,"ZodNativeEnum");ni=new WeakMap;Qr.create=(n,e)=>new Qr({values:n,typeName:re.ZodNativeEnum,...ce(e)});var dr=class extends se{unwrap(){return this._def.type}_parse(e){let{ctx:s}=this._processInputParams(e);if(s.parsedType!==$.promise&&s.common.async===!1)return q(s,{code:U.invalid_type,expected:$.promise,received:s.parsedType}),ne;let l=s.parsedType===$.promise?s.data:Promise.resolve(s.data);return Ge(l.then(c=>this._def.type.parseAsync(c,{path:s.path,errorMap:s.common.contextualErrorMap})))}};b(dr,"ZodPromise");dr.create=(n,e)=>new dr({type:n,typeName:re.ZodPromise,...ce(e)});var at=class extends se{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===re.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:s,ctx:l}=this._processInputParams(e),c=this._def.effect||null,g={addIssue:y=>{q(l,y),y.fatal?s.abort():s.dirty()},get path(){return l.path}};if(g.addIssue=g.addIssue.bind(g),c.type==="preprocess"){let y=c.transform(l.data,g);if(l.common.async)return Promise.resolve(y).then(async v=>{if(s.value==="aborted")return ne;let h=await this._def.schema._parseAsync({data:v,path:l.path,parent:l});return h.status==="aborted"?ne:h.status==="dirty"||s.value==="dirty"?la(h.value):h});{if(s.value==="aborted")return ne;let v=this._def.schema._parseSync({data:y,path:l.path,parent:l});return v.status==="aborted"?ne:v.status==="dirty"||s.value==="dirty"?la(v.value):v}}if(c.type==="refinement"){let y=b(v=>{let h=c.refinement(v,g);if(l.common.async)return Promise.resolve(h);if(h instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return v},"executeRefinement");if(l.common.async===!1){let v=this._def.schema._parseSync({data:l.data,path:l.path,parent:l});return v.status==="aborted"?ne:(v.status==="dirty"&&s.dirty(),y(v.value),{status:s.value,value:v.value})}else return this._def.schema._parseAsync({data:l.data,path:l.path,parent:l}).then(v=>v.status==="aborted"?ne:(v.status==="dirty"&&s.dirty(),y(v.value).then(()=>({status:s.value,value:v.value}))))}if(c.type==="transform")if(l.common.async===!1){let y=this._def.schema._parseSync({data:l.data,path:l.path,parent:l});if(!ai(y))return y;let v=c.transform(y.value,g);if(v instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:v}}else return this._def.schema._parseAsync({data:l.data,path:l.path,parent:l}).then(y=>ai(y)?Promise.resolve(c.transform(y.value,g)).then(v=>({status:s.value,value:v})):y);he.assertNever(c)}};b(at,"ZodEffects");at.create=(n,e,s)=>new at({schema:n,typeName:re.ZodEffects,effect:e,...ce(s)});at.createWithPreprocess=(n,e,s)=>new at({schema:e,effect:{type:"preprocess",transform:n},typeName:re.ZodEffects,...ce(s)});var gt=class extends se{_parse(e){return this._getType(e)===$.undefined?Ge(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};b(gt,"ZodOptional");gt.create=(n,e)=>new gt({innerType:n,typeName:re.ZodOptional,...ce(e)});var Rt=class extends se{_parse(e){return this._getType(e)===$.null?Ge(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};b(Rt,"ZodNullable");Rt.create=(n,e)=>new Rt({innerType:n,typeName:re.ZodNullable,...ce(e)});var Yr=class extends se{_parse(e){let{ctx:s}=this._processInputParams(e),l=s.data;return s.parsedType===$.undefined&&(l=this._def.defaultValue()),this._def.innerType._parse({data:l,path:s.path,parent:s})}removeDefault(){return this._def.innerType}};b(Yr,"ZodDefault");Yr.create=(n,e)=>new Yr({innerType:n,typeName:re.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ce(e)});var Kr=class extends se{_parse(e){let{ctx:s}=this._processInputParams(e),l={...s,common:{...s.common,issues:[]}},c=this._def.innerType._parse({data:l.data,path:l.path,parent:{...l}});return ii(c)?c.then(g=>({status:"valid",value:g.status==="valid"?g.value:this._def.catchValue({get error(){return new qe(l.common.issues)},input:l.data})})):{status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new qe(l.common.issues)},input:l.data})}}removeCatch(){return this._def.innerType}};b(Kr,"ZodCatch");Kr.create=(n,e)=>new Kr({innerType:n,typeName:re.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ce(e)});var In=class extends se{_parse(e){if(this._getType(e)!==$.nan){let l=this._getOrReturnCtx(e);return q(l,{code:U.invalid_type,expected:$.nan,received:l.parsedType}),ne}return{status:"valid",value:e.data}}};b(In,"ZodNaN");In.create=n=>new In({typeName:re.ZodNaN,...ce(n)});var Gd=Symbol("zod_brand"),da=class extends se{_parse(e){let{ctx:s}=this._processInputParams(e),l=s.data;return this._def.type._parse({data:l,path:s.path,parent:s})}unwrap(){return this._def.type}};b(da,"ZodBranded");var Xr=class extends se{_parse(e){let{status:s,ctx:l}=this._processInputParams(e);if(l.common.async)return b(async()=>{let g=await this._def.in._parseAsync({data:l.data,path:l.path,parent:l});return g.status==="aborted"?ne:g.status==="dirty"?(s.dirty(),la(g.value)):this._def.out._parseAsync({data:g.value,path:l.path,parent:l})},"handleAsync")();{let c=this._def.in._parseSync({data:l.data,path:l.path,parent:l});return c.status==="aborted"?ne:c.status==="dirty"?(s.dirty(),{status:"dirty",value:c.value}):this._def.out._parseSync({data:c.value,path:l.path,parent:l})}}static create(e,s){return new Xr({in:e,out:s,typeName:re.ZodPipeline})}};b(Xr,"ZodPipeline");var en=class extends se{_parse(e){let s=this._def.innerType._parse(e),l=b(c=>(ai(c)&&(c.value=Object.freeze(c.value)),c),"freeze");return ii(s)?s.then(c=>l(c)):l(s)}unwrap(){return this._def.innerType}};b(en,"ZodReadonly");en.create=(n,e)=>new en({innerType:n,typeName:re.ZodReadonly,...ce(e)});function Uc(n,e={},s){return n?cr.create().superRefine((l,c)=>{var g,y;if(!n(l)){let v=typeof e=="function"?e(l):typeof e=="string"?{message:e}:e,h=(y=(g=v.fatal)!==null&&g!==void 0?g:s)!==null&&y!==void 0?y:!0,m=typeof v=="string"?{message:v}:v;c.addIssue({code:"custom",...m,fatal:h})}}):cr.create()}b(Uc,"custom");var Jd={object:ve.lazycreate},re;(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"})(re||(re={}));var Qd=b((n,e={message:`Input not instance of ${n.name}`})=>Uc(s=>s instanceof n,e),"instanceOfType"),Bc=rt.create,qc=Tt.create,Yd=In.create,Kd=kt.create,zc=qr.create,Xd=qt.create,eu=On.create,tu=zr.create,ru=$r.create,nu=cr.create,au=zt.create,iu=_t.create,ou=jn.create,su=nt.create,cu=ve.create,lu=ve.strictCreate,du=Fr.create,uu=Vn.create,pu=Wr.create,fu=mt.create,hu=Hr.create,mu=An.create,gu=$t.create,yu=lr.create,vu=Gr.create,bu=Jr.create,_u=St.create,wu=Qr.create,Cu=dr.create,Ac=at.create,xu=gt.create,Eu=Rt.create,Tu=at.createWithPreprocess,ku=Xr.create,Su=b(()=>Bc().optional(),"ostring"),Ru=b(()=>qc().optional(),"onumber"),Pu=b(()=>zc().optional(),"oboolean"),Ou={string:n=>rt.create({...n,coerce:!0}),number:n=>Tt.create({...n,coerce:!0}),boolean:n=>qr.create({...n,coerce:!0}),bigint:n=>kt.create({...n,coerce:!0}),date:n=>qt.create({...n,coerce:!0})},ju=ne,a=Object.freeze({__proto__:null,defaultErrorMap:ua,setErrorMap:jd,getErrorMap:uo,makeIssue:po,EMPTY_PATH:Vd,addIssueToContext:q,ParseStatus:Ve,INVALID:ne,DIRTY:la,OK:Ge,isAborted:Ms,isDirty:Ls,isValid:ai,isAsync:ii,get util(){return he},get objectUtil(){return Ds},ZodParsedType:$,getParsedType:Br,ZodType:se,datetimeRegex:Lc,ZodString:rt,ZodNumber:Tt,ZodBigInt:kt,ZodBoolean:qr,ZodDate:qt,ZodSymbol:On,ZodUndefined:zr,ZodNull:$r,ZodAny:cr,ZodUnknown:zt,ZodNever:_t,ZodVoid:jn,ZodArray:nt,ZodObject:ve,ZodUnion:Fr,ZodDiscriminatedUnion:Vn,ZodIntersection:Wr,ZodTuple:mt,ZodRecord:Hr,ZodMap:An,ZodSet:$t,ZodFunction:lr,ZodLazy:Gr,ZodLiteral:Jr,ZodEnum:St,ZodNativeEnum:Qr,ZodPromise:dr,ZodEffects:at,ZodTransformer:at,ZodOptional:gt,ZodNullable:Rt,ZodDefault:Yr,ZodCatch:Kr,ZodNaN:In,BRAND:Gd,ZodBranded:da,ZodPipeline:Xr,ZodReadonly:en,custom:Uc,Schema:se,ZodSchema:se,late:Jd,get ZodFirstPartyTypeKind(){return re},coerce:Ou,any:nu,array:su,bigint:Kd,boolean:zc,date:Xd,discriminatedUnion:uu,effect:Ac,enum:_u,function:yu,instanceof:Qd,intersection:pu,lazy:vu,literal:bu,map:mu,nan:Yd,nativeEnum:wu,never:iu,null:ru,nullable:Eu,number:qc,object:cu,oboolean:Pu,onumber:Ru,optional:xu,ostring:Su,pipeline:ku,preprocess:Tu,promise:Cu,record:hu,set:gu,strictObject:lu,string:Bc,symbol:eu,transformer:Ac,tuple:fu,undefined:tu,union:du,unknown:au,void:ou,NEVER:ju,ZodIssueCode:U,quotelessJson:Od,ZodError:qe});var pa=Symbol("current"),Nn=Symbol("previous");var oi=b((n,{ref:e,refType:s,param:l,header:c,...g}={})=>({...g,...n}),"mergeOpenApi");function $c(n){if(typeof n.ZodType.prototype.openapi<"u")return;n.ZodType.prototype.openapi=function(g){let{zodOpenApi:y,...v}=this._def,h=new this.constructor({...v,zodOpenApi:{openapi:oi(g,y?.openapi)}});return h._def.zodOpenApi[pa]=h,y&&(h._def.zodOpenApi[Nn]=this),h};let e=n.ZodType.prototype.describe;n.ZodType.prototype.describe=function(...g){let y=e.apply(this,g),v=y._def;if(v.zodOpenApi){let h={...v.zodOpenApi};h.openapi=oi({description:g[0]},h.openapi),h[Nn]=this,h[pa]=y,v.zodOpenApi=h}else v.zodOpenApi={openapi:{description:g[0]},[pa]:y};return y};let s=n.ZodObject.prototype.extend;n.ZodObject.prototype.extend=function(...g){let y=s.apply(this,g),v=y._def.zodOpenApi;if(v){let h={...v};h.openapi=oi({},h.openapi),h[Nn]=this,y._def.zodOpenApi=h}else y._def.zodOpenApi={[Nn]:this};return y};let l=n.ZodObject.prototype.omit;n.ZodObject.prototype.omit=function(...g){let y=l.apply(this,g),v=y._def.zodOpenApi;if(v){let h={...v};h.openapi=oi({},h.openapi),delete h[Nn],delete h[pa],y._def.zodOpenApi=h}return y};let c=n.ZodObject.prototype.pick;n.ZodObject.prototype.pick=function(...g){let y=c.apply(this,g),v=y._def.zodOpenApi;if(v){let h={...v};h.openapi=oi({},h.openapi),delete h[Nn],delete h[pa],y._def.zodOpenApi=h}return y}}b($c,"extendZodWithOpenApi");$c(a);var Vu=Object.defineProperty,Au=b((n,e)=>Vu(n,"name",{value:e,configurable:!0}),"__name"),mo=a.array(a.string().or(a.record(a.any()))),Sb=a.object({type:a.string().optional(),narrative:a.string().optional()}),go=a.string().or(a.object({id:a.string(),type:a.string(),caption:a.string().optional()})),Iu=a.object({type:a.string().min(1).or(a.string().array().nonempty()),latitude:a.number(),longitude:a.number()}),Nu=a.object({type:a.string().min(1).or(a.string().array().nonempty()),addressCountry:a.string().optional(),addressCountryCode:a.string().optional(),addressRegion:a.string().optional(),addressLocality:a.string().optional(),streetAddress:a.string().optional(),postOfficeBoxNumber:a.string().optional(),postalCode:a.string().optional(),geo:Iu.optional()}),Du=a.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(a.string()),Xc=a.object({type:a.string().min(1).or(a.string().array().nonempty()),identifier:a.string(),identifierType:Du}),si=a.string().or(a.object({id:a.string().optional(),type:a.string().or(a.string().array().nonempty().optional()),name:a.string().optional(),url:a.string().optional(),phone:a.string().optional(),description:a.string().optional(),endorsement:a.any().array().optional(),image:go.optional(),email:a.string().email().optional(),address:Nu.optional(),otherIdentifier:Xc.array().optional(),official:a.string().optional(),parentOrg:a.any().optional(),familyName:a.string().optional(),givenName:a.string().optional(),additionalName:a.string().optional(),patronymicName:a.string().optional(),honorificPrefix:a.string().optional(),honorificSuffix:a.string().optional(),familyNamePrefix:a.string().optional(),dateOfBirth:a.string().optional()}).catchall(a.any())),Bs=a.object({id:a.string().optional()}).catchall(a.any()),ho=a.object({type:a.string(),id:a.string()}).catchall(a.any()),Fc=a.object({id:a.string(),type:a.string()}).catchall(a.any()),Wc=a.object({id:a.string().optional(),type:a.string()}).catchall(a.any()),Hc=a.object({type:a.string(),id:a.string().optional()}).catchall(a.any()),Gc=a.object({type:a.string().or(a.string().array().nonempty()),id:a.string().optional()}).catchall(a.any()),tn=a.object({"@context":mo,id:a.string().optional(),type:a.string().array().nonempty(),issuer:si,credentialSubject:Bs.or(Bs.array()),refreshService:Wc.or(Wc.array()).optional(),credentialSchema:Fc.or(Fc.array()).optional(),issuanceDate:a.string().optional(),expirationDate:a.string().optional(),credentialStatus:ho.or(ho.array()).optional(),name:a.string().optional(),description:a.string().optional(),validFrom:a.string().optional(),validUntil:a.string().optional(),status:ho.or(ho.array()).optional(),termsOfUse:Hc.or(Hc.array()).optional(),evidence:Gc.or(Gc.array()).optional()}).catchall(a.any()),Ft=a.object({type:a.string(),created:a.string(),challenge:a.string().optional(),domain:a.string().optional(),nonce:a.string().optional(),proofPurpose:a.string(),verificationMethod:a.string(),jws:a.string().optional()}).catchall(a.any()),fa=tn.extend({proof:Ft.or(Ft.array())}),Mu=a.object({"@context":mo,id:a.string().optional(),type:a.string().or(a.string().array().nonempty()),verifiableCredential:fa.or(fa.array()).optional(),holder:a.string().optional()}).catchall(a.any()),yo=Mu.extend({proof:Ft.or(Ft.array())}),$s=a.object({kty:a.string(),crv:a.string(),x:a.string(),y:a.string().optional(),n:a.string().optional(),d:a.string().optional()}),Ob=$s.omit({d:!0}).extend({d:a.string()}),Lu=a.object({alg:a.string(),iv:a.string(),tag:a.string(),epk:$s.partial().optional(),kid:a.string().optional(),apv:a.string().optional(),apu:a.string().optional()}),Zu=a.object({header:Lu,encrypted_key:a.string()}),Fs=a.object({protected:a.string(),iv:a.string(),ciphertext:a.string(),tag:a.string(),aad:a.string().optional(),recipients:Zu.array().optional()}),Dn=a.string().or(a.object({"@context":mo.optional(),id:a.string(),type:a.string(),controller:a.string(),publicKeyJwk:$s.optional(),publicKeyBase58:a.string().optional(),publicKeyMultibase:a.string().optional(),blockChainAccountId:a.string().optional()}).catchall(a.any())),Uu=a.object({id:a.string(),type:a.string().or(a.string().array().nonempty()),serviceEndpoint:a.any().or(a.any().array().nonempty())}).catchall(a.any()),jb=a.object({"@context":mo,id:a.string(),alsoKnownAs:a.string().optional(),controller:a.string().or(a.string().array().nonempty()).optional(),verificationMethod:Dn.array().optional(),authentication:Dn.array().optional(),assertionMethod:Dn.array().optional(),keyAgreement:Dn.array().optional(),capabilityInvocation:Dn.array().optional(),capabilityDelegation:Dn.array().optional(),publicKey:Dn.array().optional(),service:Uu.array().optional(),proof:Ft.or(Ft.array()).optional()}).catchall(a.any()),Bu=a.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(a.string()),vo=a.object({type:a.string().array().nonempty(),targetCode:a.string().optional(),targetDescription:a.string().optional(),targetName:a.string(),targetFramework:a.string().optional(),targetType:Bu.optional(),targetUrl:a.string()}),qu=a.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"]),zu=qu.or(a.string()),$u=a.object({id:a.string().optional(),narrative:a.string().optional()}).catchall(a.any()),Fu=a.object({id:a.string(),type:a.string().array().nonempty(),endorsementComment:a.string().optional()}),Wu=tn.extend({credentialSubject:Fu,proof:Ft.or(Ft.array()).optional()}),Hu=a.object({id:a.string(),"@language":a.string().optional(),version:a.string().optional()}),Gu=a.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(a.string()),Ju=a.object({id:a.string(),type:a.string().array().nonempty(),alignment:vo.array().optional(),description:a.string().optional(),level:a.string().optional(),name:a.string(),points:a.string().optional()}).catchall(a.any()),Qu=a.object({id:a.string(),type:a.string().array().nonempty(),alignment:vo.array().optional(),allowedValue:a.string().array().optional(),name:a.string(),requiredLevel:a.string().optional(),requiredValue:a.string().optional(),resultType:Gu,rubricCriterionLevel:Ju.array().optional(),valueMax:a.string().optional(),valueMin:a.string().optional()}).catchall(a.any()),Yu=a.object({id:a.string().optional(),type:a.string().array().nonempty(),alignment:vo.array().optional(),achievementType:zu.optional(),creator:si.optional(),creditsAvailable:a.number().optional(),criteria:$u,description:a.string(),endorsement:Wu.array().optional(),fieldOfStudy:a.string().optional(),humanCode:a.string().optional(),image:go.optional(),"@language":a.string().optional(),name:a.string(),otherIdentifier:Xc.array().optional(),related:Hu.array().optional(),resultDescription:Qu.array().optional(),specialization:a.string().optional(),tag:a.string().array().optional(),version:a.string().optional()}).catchall(a.any()),Ku=a.object({type:a.string(),hashed:a.boolean(),identityHash:a.string(),identityType:a.string(),salt:a.string().optional()}),Xu=a.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),ep=a.object({type:a.string().array().nonempty(),achievedLevel:a.string().optional(),alignment:vo.array().optional(),resultDescription:a.string().optional(),status:Xu.optional(),value:a.string().optional()}).catchall(a.any()),Jc=a.object({id:a.string().optional(),type:a.string().array().nonempty(),activityEndDate:a.string().optional(),activityStartDate:a.string().optional(),creditsEarned:a.number().optional(),achievement:Yu.optional(),identifier:Ku.array().optional(),image:go.optional(),licenseNumber:a.string().optional(),narrative:a.string().optional(),result:ep.array().optional(),role:a.string().optional(),source:si.optional(),term:a.string().optional()}).catchall(a.any()),tp=a.object({id:a.string().optional(),type:a.string().or(a.string().array().nonempty()),narrative:a.string().optional(),name:a.string().optional(),description:a.string().optional(),genre:a.string().optional(),audience:a.string().optional()}).catchall(a.any()),rp=tn.extend({name:a.string().optional(),description:a.string().optional(),image:go.optional(),credentialSubject:Jc.or(Jc.array()),endorsement:tn.array().optional(),evidence:tp.array().optional()}),Ab=rp.extend({proof:Ft.or(Ft.array())}),Nb=a.object({checks:a.string().array(),warnings:a.string().array(),errors:a.string().array()}),el=a.enum(["Success","Failed","Error"]),Db=el.enum,Mb=a.object({check:a.string(),status:el,message:a.string().optional(),details:a.string().optional()}),Lb=a.object({title:a.string().optional(),createdAt:a.string().optional(),issuer:si.optional(),issuee:si.optional(),credentialSubject:Bs.optional()}),Zb=a.object({id:a.string(),uri:a.string()}).catchall(a.any()),qb=a.object({limit:a.number(),cursor:a.string().optional(),sort:a.string().optional()}),Je=a.object({cursor:a.string().optional(),hasMore:a.boolean()}),tl=a.object({encryptedRecord:Fs,fields:a.string().array()}).catchall(a.any()),zb=Je.extend({records:tl.array()}),np=tl.extend({id:a.string()}),$b=Je.extend({records:np.array()}),Qc=Au(n=>{let e=n.match(/^\/(.*)\/([gimsuy]*)$/);if(!e)throw new Error("Invalid RegExp string format");return{pattern:e[1],flags:e[2]}},"parseRegexString"),ap=a.instanceof(RegExp).or(a.string().refine(n=>{try{return Qc(n),!0}catch{return!1}},{message:"Invalid RegExp string format. Must be in format '/pattern/flags'"}).transform(n=>{let{pattern:e,flags:s}=Qc(n);try{return new RegExp(e,s)}catch(l){throw new Error(`Invalid RegExp: ${l.message}`)}})),me=a.string().or(a.object({$in:a.string().array()})).or(a.object({$regex:ap})),ip=a.object({backgroundColor:a.string().optional(),backgroundImage:a.string().optional(),fadeBackgroundImage:a.boolean().optional(),repeatBackgroundImage:a.boolean().optional(),fontColor:a.string().optional(),accentColor:a.string().optional(),accentFontColor:a.string().optional(),idBackgroundImage:a.string().optional(),fadeIdBackgroundImage:a.boolean().optional(),idBackgroundColor:a.string().optional(),repeatIdBackgroundImage:a.boolean().optional()}),ur=a.object({profileId:a.string().min(3).max(40).describe("Unique, URL-safe identifier for the profile."),displayName:a.string().default("").describe("Human-readable display name for the profile."),shortBio:a.string().default("").describe("Short bio for the profile."),bio:a.string().default("").describe("Longer bio for the profile."),did:a.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),isPrivate:a.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),email:a.string().optional().describe("Contact email address for the profile. (deprecated)"),image:a.string().optional().describe("Profile image URL for the profile."),heroImage:a.string().optional().describe("Hero image URL for the profile."),websiteLink:a.string().optional().describe("Website link for the profile."),isServiceProfile:a.boolean().default(!1).optional().describe("Whether the profile is a service profile or not."),type:a.string().optional().describe('Profile type: e.g. "person", "organization", "service".'),notificationsWebhook:a.string().url().startsWith("http").optional().describe("URL to send notifications to."),display:ip.optional().describe("Display settings for the profile."),highlightedCredentials:a.array(a.string()).max(5).optional().describe("Up to 5 unique boost URIs to highlight on the profile."),role:a.string().default("").optional().describe('Role of the profile: e.g. "teacher", "student".'),dob:a.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".'),country:a.string().optional().describe("Country for the profile."),approved:a.boolean().optional().describe("Approval status for the profile.")}),Hb=a.object({profileId:me,displayName:me,shortBio:me,bio:me,email:me,websiteLink:me,isServiceProfile:a.boolean(),type:me}).partial(),Gb=Je.extend({records:ur.array()}),Jb=a.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),rl=a.object({id:a.string(),created:a.string(),displayName:a.string().default("").optional(),shortBio:a.string().default("").optional(),bio:a.string().default("").optional(),email:a.string().optional(),image:a.string().optional(),heroImage:a.string().optional()}),Qb=Je.extend({records:rl.extend({did:a.string()}).array()}),Yb=a.object({id:me,displayName:me,shortBio:me,bio:me,email:me}).partial(),Kb=Je.extend({records:a.object({profile:ur,manager:rl.extend({did:a.string()}).optional()}).array()}),Xb=a.object({uri:a.string(),to:a.string(),from:a.string(),sent:a.string().datetime(),received:a.string().datetime().optional()}),nl=a.object({role:a.string(),canEdit:a.boolean(),canIssue:a.boolean(),canRevoke:a.boolean(),canManagePermissions:a.boolean(),canIssueChildren:a.string(),canCreateChildren:a.string(),canEditChildren:a.string(),canRevokeChildren:a.string(),canManageChildrenPermissions:a.string(),canManageChildrenProfiles:a.boolean().default(!1).optional(),canViewAnalytics:a.boolean()}),op=a.object({role:me,canEdit:a.boolean(),canIssue:a.boolean(),canRevoke:a.boolean(),canManagePermissions:a.boolean(),canIssueChildren:me,canCreateChildren:me,canEditChildren:me,canRevokeChildren:me,canManageChildrenPermissions:me,canManageChildrenProfiles:a.boolean(),canViewAnalytics:a.boolean()}).partial(),Us=a.enum(["GRANT_PERMISSIONS","ADD_ADMIN","AUTO_CONNECT"]),sp=a.discriminatedUnion("type",[a.object({type:a.literal(Us.Values.GRANT_PERMISSIONS),data:a.object({claimUri:a.string(),targetUri:a.string(),permissions:nl.partial()})}),a.object({type:a.literal(Us.Values.ADD_ADMIN),data:a.object({claimUri:a.string(),targetUri:a.string()})}),a.object({type:a.literal(Us.Values.AUTO_CONNECT),data:a.object({claimUri:a.string(),targetUri:a.string()})})]),e_=a.object({type:me,data:a.object({claimUri:me,targetUri:me,permissions:op})}).deepPartial(),cp=a.object({id:a.string(),createdAt:a.string(),updatedAt:a.string()}).and(sp),t_=Je.extend({records:cp.array()}),qs=a.enum(["DRAFT","LIVE"]),lp=a.object({uri:a.string(),name:a.string().optional(),type:a.string().optional(),category:a.string().optional(),status:qs.optional(),autoConnectRecipients:a.boolean().optional(),meta:a.record(a.any()).optional(),claimPermissions:nl.optional(),allowAnyoneToCreateChildren:a.boolean().optional()}),r_=a.object({uri:me,name:me,type:me,category:me,meta:a.record(me),status:qs.or(a.object({$in:qs.array()})),autoConnectRecipients:a.boolean()}).partial(),n_=Je.extend({records:lp.array()}),dp=a.object({to:ur,from:a.string(),received:a.string().optional(),uri:a.string().optional()}),a_=Je.extend({records:dp.array()}),up=a.object({to:ur,from:a.string(),received:a.string().optional(),boostUris:a.array(a.string()),credentialUris:a.array(a.string()).optional()}),i_=Je.extend({records:up.array()}),o_=a.object({endpoint:a.string(),name:a.string(),did:a.string().optional()}),s_=a.object({ttlSeconds:a.number().optional(),totalUses:a.number().optional()}),pp=a.object({endpoint:a.string()}),c_=a.object({signingAuthority:pp,relationship:a.object({name:a.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:a.string(),isPrimary:a.boolean().optional()})}),l_=a.object({boostUri:a.string(),signingAuthority:a.object({endpoint:a.string(),name:a.string()})}),fp=a.enum(["live","stale","withdrawn"]),Ws=a.object({read:a.object({anonymize:a.boolean().optional(),credentials:a.object({categories:a.record(a.object({required:a.boolean(),defaultEnabled:a.boolean().optional()})).default({})}).default({}),personal:a.record(a.object({required:a.boolean(),defaultEnabled:a.boolean().optional()})).default({})}).default({}),write:a.object({credentials:a.object({categories:a.record(a.object({required:a.boolean(),defaultEnabled:a.boolean().optional()})).default({})}).default({}),personal:a.record(a.object({required:a.boolean(),defaultEnabled:a.boolean().optional()})).default({})}).default({})}),al=a.object({contract:Ws,owner:ur,name:a.string(),subtitle:a.string().optional(),description:a.string().optional(),reasonForAccessing:a.string().optional(),image:a.string().optional(),uri:a.string(),needsGuardianConsent:a.boolean().optional(),redirectUrl:a.string().optional(),frontDoorBoostUri:a.string().optional(),createdAt:a.string(),updatedAt:a.string(),expiresAt:a.string().optional(),autoBoosts:a.string().array().optional(),writers:a.array(ur).optional()}),d_=Je.extend({records:al.omit({owner:!0}).array()}),hp=a.object({credentials:a.object({categories:a.record(a.string().array()).default({})}),personal:a.record(a.string()).default({}),date:a.string()}),u_=Je.extend({records:hp.array()}),mp=a.object({credentials:a.object({category:a.string(),uri:a.string()}).array(),personal:a.record(a.string()).default({}),date:a.string(),contractUri:a.string()}),p_=Je.extend({records:mp.array()}),il=a.object({sharing:a.boolean().optional(),shared:a.string().array().optional(),shareAll:a.boolean().optional(),shareUntil:a.string().optional()}),bo=a.object({read:a.object({anonymize:a.boolean().optional(),credentials:a.object({shareAll:a.boolean().optional(),sharing:a.boolean().optional(),categories:a.record(il).default({})}).default({}),personal:a.record(a.string()).default({})}).default({}),write:a.object({credentials:a.object({categories:a.record(a.boolean()).default({})}).default({}),personal:a.record(a.boolean()).default({})}).default({}),deniedWriters:a.array(a.string()).optional()}),f_=Je.extend({records:a.object({expiresAt:a.string().optional(),oneTime:a.boolean().optional(),terms:bo,contract:al,uri:a.string(),consenter:ur,status:fp}).array()}),h_=a.object({read:a.object({anonymize:a.boolean().optional(),credentials:a.object({categories:a.record(a.object({required:a.boolean().optional()})).optional()}).optional(),personal:a.record(a.object({required:a.boolean().optional()})).optional()}).optional(),write:a.object({credentials:a.object({categories:a.record(a.object({required:a.boolean().optional()})).optional()}).optional(),personal:a.record(a.object({required:a.boolean().optional()})).optional()}).optional()}),m_=a.object({anonymize:a.boolean().optional(),credentials:a.object({categories:a.record(a.boolean()).optional()}).optional(),personal:a.record(a.boolean()).optional()}),g_=a.object({credentials:a.object({categories:a.record(a.boolean()).optional()}).optional(),personal:a.record(a.boolean()).optional(),id:me.optional()}),gp=a.object({read:a.object({anonymize:a.boolean().optional(),credentials:a.object({shareAll:a.boolean().optional(),sharing:a.boolean().optional(),categories:a.record(il.optional()).optional()}).optional(),personal:a.record(a.string()).optional()}).optional(),write:a.object({credentials:a.object({categories:a.record(a.boolean()).optional()}).optional(),personal:a.record(a.boolean()).optional()}).optional()}),zs=a.enum(["consent","update","sync","withdraw","write"]),y_=a.object({terms:gp.optional(),action:zs.or(zs.array()).optional(),date:a.object({$gt:a.string()}).or(a.object({$lt:a.string()})).or(a.object({$eq:a.string()})).optional(),expiresAt:a.object({$gt:a.string()}).or(a.object({$lt:a.string()})).or(a.object({$eq:a.string()})).optional(),oneTime:a.boolean().optional()}),ol=a.object({expiresAt:a.string().optional(),oneTime:a.boolean().optional(),terms:bo.optional(),id:a.string(),action:zs,date:a.string(),uris:a.string().array().optional()}),v_=Je.extend({records:ol.array()}),yp=a.object({credentialUri:a.string(),termsUri:a.string(),contractUri:a.string(),boostUri:a.string(),category:a.string().optional(),date:a.string()}),b_=Je.extend({records:yp.array()}),vp=a.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"]),bp=a.object({title:a.string().optional(),body:a.string().optional()}),_p=a.object({type:a.string(),value:a.string()}),_o=a.enum(["PENDING","DELIVERED","CLAIMED","EXPIRED"]),wp=a.object({issuanceId:a.string(),status:_o,recipient:a.object({contactMethod:_p.optional(),learnCardId:a.string().optional()}),timestamp:a.string().datetime().optional()}),Cp=a.object({vcUris:a.array(a.string()).optional(),vpUris:a.array(a.string()).optional(),transaction:ol.optional(),inbox:wp.optional()}),__=a.object({type:vp,to:ur.partial().and(a.object({did:a.string()})),from:ur.partial().and(a.object({did:a.string()})),message:bp.optional(),data:Cp.optional(),sent:a.string().datetime().optional(),webhookUrl:a.string().optional()}),xp="auth-grant:",w_=a.object({id:a.string(),name:a.string(),description:a.string().optional(),challenge:a.string().startsWith(xp).min(10,{message:"Challenge is too short"}).max(100,{message:"Challenge is too long"}),status:a.enum(["revoked","active"],{required_error:"Status is required",invalid_type_error:"Status must be either active or revoked"}),scope:a.string(),createdAt:a.string().datetime({message:"createdAt must be a valid ISO 8601 datetime string"}),expiresAt:a.string().datetime({message:"expiresAt must be a valid ISO 8601 datetime string"}).nullish().optional()}),C_=a.object({id:a.string()}).catchall(a.any()),Ep=a.enum(["active","revoked"]),x_=a.object({id:me,name:me,description:me,status:Ep}).partial(),Yc=a.object({id:a.string(),isVerified:a.boolean(),verifiedAt:a.string().optional(),isPrimary:a.boolean(),createdAt:a.string()}),E_=a.discriminatedUnion("type",[a.object({type:a.literal("email"),value:a.string().email()}).merge(Yc),a.object({type:a.literal("phone"),value:a.string()}).merge(Yc)]),Kc=a.object({isVerified:a.boolean().optional(),isPrimary:a.boolean().optional()}),T_=a.discriminatedUnion("type",[a.object({type:a.literal("email"),value:a.string().email()}).merge(Kc),a.object({type:a.literal("phone"),value:a.string()}).merge(Kc)]),sl=a.discriminatedUnion("type",[a.object({type:a.literal("email"),value:a.string().email()}),a.object({type:a.literal("phone"),value:a.string()})]),k_=a.object({value:a.string(),type:a.enum(["email","phone"])}),S_=a.object({token:a.string()}),R_=a.object({contactMethodId:a.string()}),Tp=a.object({id:a.string(),credential:a.string(),isSigned:a.boolean(),currentStatus:_o,expiresAt:a.string(),createdAt:a.string(),issuerDid:a.string(),webhookUrl:a.string().optional(),signingAuthority:a.object({endpoint:a.string().optional(),name:a.string().optional()}).optional()}),P_=a.object({hasMore:a.boolean(),records:a.array(Tp),cursor:a.string().optional()}),O_=a.object({currentStatus:_o,id:a.string(),isSigned:a.boolean(),issuerDid:a.string()}).partial(),kp=a.object({endpoint:a.string().url(),name:a.string()}),j_=a.object({recipient:sl.describe("The recipient of the credential"),credential:fa.passthrough().or(yo.passthrough()).or(tn.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:a.object({signingAuthority:kp.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:a.string().url().optional().describe("The webhook URL to receive credential issuance events."),expiresInDays:a.number().min(1).max(365).optional().describe("The number of days the credential will be valid for."),delivery:a.object({suppress:a.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:a.object({id:a.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:a.object({issuer:a.object({name:a.string().optional().describe('The name of the organization (e.g., "State University").'),logoUrl:a.string().url().optional().describe("The URL of the organization's logo.")}).optional(),credential:a.object({name:a.string().optional().describe('The name of the credential (e.g., "Bachelor of Science").'),type:a.string().optional().describe('The type of the credential (e.g., "degree", "certificate").')}).optional(),recipient:a.object({name:a.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.")}),V_=a.object({issuanceId:a.string(),status:_o,recipient:sl,claimUrl:a.string().url().optional(),recipientDid:a.string().optional()}),A_=a.object({token:a.string(),contactMethodId:a.string(),autoVerifyContactMethod:a.boolean().optional().default(!1),createdAt:a.string(),expiresAt:a.string(),used:a.boolean()});var Sp=Object.create,Hs=Object.defineProperty,Rp=Object.getOwnPropertyDescriptor,cl=Object.getOwnPropertyNames,Pp=Object.getPrototypeOf,Op=Object.prototype.hasOwnProperty,F=b((n,e)=>Hs(n,"name",{value:e,configurable:!0}),"__name"),ll=b((n,e)=>b(function(){return e||(0,n[cl(n)[0]])((e={exports:{}}).exports,e),e.exports},"__require"),"__commonJS"),jp=b((n,e,s,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of cl(e))!Op.call(n,c)&&c!==s&&Hs(n,c,{get:()=>e[c],enumerable:!(l=Rp(e,c))||l.enumerable});return n},"__copyProps"),Vp=b((n,e,s)=>(s=n!=null?Sp(Pp(n)):{},jp(e||!n||!n.__esModule?Hs(s,"default",{value:n,enumerable:!0}):s,n)),"__toESM"),Ap=ll({"../learn-card-types/dist/types.cjs.development.js"(n,e){"use strict";var s=Object.defineProperty,l=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,y=F((t,d)=>s(t,"name",{value:d,configurable:!0}),"__name"),v=F((t,d)=>{for(var p in d)s(t,p,{get:d[p],enumerable:!0})},"__export"),h=F((t,d,p,x)=>{if(d&&typeof d=="object"||typeof d=="function")for(let _ of c(d))!g.call(t,_)&&_!==p&&s(t,_,{get:()=>d[_],enumerable:!(x=l(d,_))||x.enumerable});return t},"__copyProps"),m=F(t=>h(s({},"__esModule",{value:!0}),t),"__toCommonJS"),E={};v(E,{AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX:()=>Fa,AchievementCredentialValidator:()=>yi,AchievementCriteriaValidator:()=>Lo,AchievementSubjectValidator:()=>Pa,AchievementTypeValidator:()=>yn,AchievementValidator:()=>vn,AddressValidator:()=>fi,AlignmentTargetTypeValidator:()=>ka,AlignmentValidator:()=>rr,AuthGrantQueryValidator:()=>rs,AuthGrantStatusValidator:()=>ea,AuthGrantValidator:()=>ts,AutoBoostConfigValidator:()=>Go,BoostPermissionsQueryValidator:()=>Ti,BoostPermissionsValidator:()=>La,BoostQueryValidator:()=>Ri,BoostRecipientValidator:()=>fe,BoostRecipientWithChildrenValidator:()=>ft,BoostValidator:()=>Si,ClaimHookQueryValidator:()=>Ne,ClaimHookTypeValidator:()=>Yn,ClaimHookValidator:()=>ki,ClaimTokenValidator:()=>Hi,ConsentFlowContractDataForDidValidator:()=>Ni,ConsentFlowContractDataValidator:()=>xn,ConsentFlowContractDetailsValidator:()=>Cn,ConsentFlowContractQueryValidator:()=>Jo,ConsentFlowContractValidator:()=>Vi,ConsentFlowDataForDidQueryValidator:()=>Li,ConsentFlowDataQueryValidator:()=>Qo,ConsentFlowTermValidator:()=>Za,ConsentFlowTermsQueryValidator:()=>Zi,ConsentFlowTermsStatusValidator:()=>ji,ConsentFlowTermsValidator:()=>Ir,ConsentFlowTransactionActionValidator:()=>En,ConsentFlowTransactionValidator:()=>Ua,ConsentFlowTransactionsQueryValidator:()=>Yo,ContactMethodCreateValidator:()=>$i,ContactMethodQueryValidator:()=>Nr,ContactMethodValidator:()=>ns,ContactMethodVerificationRequestValidator:()=>as,ContactMethodVerificationValidator:()=>Ha,ContextValidator:()=>pn,ContractCredentialValidator:()=>Ba,CredentialInfoValidator:()=>_n,CredentialRecordValidator:()=>bi,CredentialSchemaValidator:()=>wa,CredentialStatusValidator:()=>hn,CredentialSubjectValidator:()=>qn,CriteriaValidator:()=>Ar,DidDocumentValidator:()=>gi,EncryptedCredentialRecordValidator:()=>Va,EncryptedRecordValidator:()=>Jn,EndorsementCredentialValidator:()=>Fn,EndorsementSubjectValidator:()=>$n,EvidenceValidator:()=>Oa,FlatAuthGrantValidator:()=>Wa,FullClaimHookValidator:()=>Kn,GeoCoordinatesValidator:()=>pi,IdentifierEntryValidator:()=>_a,IdentifierTypeValidator:()=>hi,IdentityObjectValidator:()=>Sa,ImageValidator:()=>fn,InboxCredentialQueryValidator:()=>Fi,InboxCredentialValidator:()=>Ga,IssueInboxCredentialResponseValidator:()=>Tn,IssueInboxCredentialValidator:()=>Wi,IssueInboxSigningAuthorityValidator:()=>Ja,JWERecipientHeaderValidator:()=>gn,JWERecipientValidator:()=>Vr,JWEValidator:()=>mi,JWKValidator:()=>Et,JWKWithPrivateKeyValidator:()=>mn,KnownAchievementTypeValidator:()=>nr,LCNBoostClaimLinkOptionsValidator:()=>Wo,LCNBoostClaimLinkSigningAuthorityValidator:()=>Fo,LCNBoostStatus:()=>wn,LCNInboxContactMethodValidator:()=>za,LCNInboxStatusEnumValidator:()=>ir,LCNNotificationDataValidator:()=>$a,LCNNotificationInboxValidator:()=>Bi,LCNNotificationMessageValidator:()=>qa,LCNNotificationTypeEnumValidator:()=>Ui,LCNNotificationValidator:()=>es,LCNProfileConnectionStatusEnum:()=>Ei,LCNProfileDisplayValidator:()=>Na,LCNProfileManagerQueryValidator:()=>Bo,LCNProfileManagerValidator:()=>Qn,LCNProfileQueryValidator:()=>xi,LCNProfileValidator:()=>pt,LCNSigningAuthorityForUserValidator:()=>Ho,LCNSigningAuthorityValidator:()=>Xn,PaginatedBoostRecipientsValidator:()=>Oi,PaginatedBoostRecipientsWithChildrenValidator:()=>$o,PaginatedBoostsValidator:()=>Pi,PaginatedClaimHooksValidator:()=>zo,PaginatedConsentFlowContractsValidator:()=>Ai,PaginatedConsentFlowDataForDidValidator:()=>Di,PaginatedConsentFlowDataValidator:()=>Ii,PaginatedConsentFlowTermsValidator:()=>Mi,PaginatedConsentFlowTransactionsValidator:()=>Ko,PaginatedContractCredentialsValidator:()=>Xo,PaginatedEncryptedCredentialRecordsValidator:()=>Ci,PaginatedEncryptedRecordsValidator:()=>wi,PaginatedInboxCredentialsValidator:()=>os,PaginatedLCNProfileManagersValidator:()=>Uo,PaginatedLCNProfilesAndManagersValidator:()=>Ma,PaginatedLCNProfilesValidator:()=>Da,PaginationOptionsValidator:()=>_i,PaginationResponseValidator:()=>Oe,ProfileValidator:()=>tr,ProofValidator:()=>ut,RefreshServiceValidator:()=>Ca,RegExpValidator:()=>Ia,RelatedValidator:()=>Wn,ResultDescriptionValidator:()=>tt,ResultStatusTypeValidator:()=>Ra,ResultTypeValidator:()=>Hn,ResultValidator:()=>bn,RubricCriterionValidator:()=>ar,SentCredentialInfoValidator:()=>qo,ServiceValidator:()=>Ta,SetPrimaryContactMethodValidator:()=>is,StringQuery:()=>pe,TermsOfUseValidator:()=>xa,UnsignedAchievementCredentialValidator:()=>ja,UnsignedVCValidator:()=>Or,UnsignedVPValidator:()=>i,VC2EvidenceValidator:()=>Ea,VCValidator:()=>zn,VPValidator:()=>jr,VerificationCheckValidator:()=>Bt,VerificationItemValidator:()=>vi,VerificationMethodValidator:()=>et,VerificationStatusEnum:()=>Zo,VerificationStatusValidator:()=>Gn}),e.exports=m(E);var P;(function(t){t.assertEqual=_=>_;function d(_){}b(d,"assertIs"),F(d,"assertIs"),y(d,"assertIs"),t.assertIs=d;function p(_){throw new Error}b(p,"assertNever"),F(p,"assertNever"),y(p,"assertNever"),t.assertNever=p,t.arrayToEnum=_=>{let k={};for(let T of _)k[T]=T;return k},t.getValidEnumValues=_=>{let k=t.objectKeys(_).filter(D=>typeof _[_[D]]!="number"),T={};for(let D of k)T[D]=_[D];return t.objectValues(T)},t.objectValues=_=>t.objectKeys(_).map(function(k){return _[k]}),t.objectKeys=typeof Object.keys=="function"?_=>Object.keys(_):_=>{let k=[];for(let T in _)Object.prototype.hasOwnProperty.call(_,T)&&k.push(T);return k},t.find=(_,k)=>{for(let T of _)if(k(T))return T},t.isInteger=typeof Number.isInteger=="function"?_=>Number.isInteger(_):_=>typeof _=="number"&&isFinite(_)&&Math.floor(_)===_;function x(_,k=" | "){return _.map(T=>typeof T=="string"?`'${T}'`:T).join(k)}b(x,"joinValues"),F(x,"joinValues"),y(x,"joinValues"),t.joinValues=x,t.jsonStringifyReplacer=(_,k)=>typeof k=="bigint"?k.toString():k})(P||(P={}));var z;(function(t){t.mergeShapes=(d,p)=>({...d,...p})})(z||(z={}));var O=P.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),oe=y(t=>{switch(typeof t){case"undefined":return O.undefined;case"string":return O.string;case"number":return isNaN(t)?O.nan:O.number;case"boolean":return O.boolean;case"function":return O.function;case"bigint":return O.bigint;case"symbol":return O.symbol;case"object":return Array.isArray(t)?O.array:t===null?O.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?O.promise:typeof Map<"u"&&t instanceof Map?O.map:typeof Set<"u"&&t instanceof Set?O.set:typeof Date<"u"&&t instanceof Date?O.date:O.object;default:return O.unknown}},"getParsedType"),j=P.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"]),ke=y(t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),Re=F(class extends Error{constructor(t){super(),this.issues=[],this.addIssue=p=>{this.issues=[...this.issues,p]},this.addIssues=(p=[])=>{this.issues=[...this.issues,...p]};let d=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,d):this.__proto__=d,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){let d=t||function(_){return _.message},p={_errors:[]},x=y(_=>{for(let k of _.issues)if(k.code==="invalid_union")k.unionErrors.map(x);else if(k.code==="invalid_return_type")x(k.returnTypeError);else if(k.code==="invalid_arguments")x(k.argumentsError);else if(k.path.length===0)p._errors.push(d(k));else{let T=p,D=0;for(;D<k.path.length;){let A=k.path[D];D===k.path.length-1?(T[A]=T[A]||{_errors:[]},T[A]._errors.push(d(k))):T[A]=T[A]||{_errors:[]},T=T[A],D++}}},"processError");return x(this),p}static assert(t){if(!(t instanceof Re))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,P.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=d=>d.message){let d={},p=[];for(let x of this.issues)x.path.length>0?(d[x.path[0]]=d[x.path[0]]||[],d[x.path[0]].push(t(x))):p.push(t(x));return{formErrors:p,fieldErrors:d}}get formErrors(){return this.flatten()}},"ZodError");y(Re,"ZodError"),Re.create=t=>new Re(t);var Pt=y((t,d)=>{let p;switch(t.code){case j.invalid_type:t.received===O.undefined?p="Required":p=`Expected ${t.expected}, received ${t.received}`;break;case j.invalid_literal:p=`Invalid literal value, expected ${JSON.stringify(t.expected,P.jsonStringifyReplacer)}`;break;case j.unrecognized_keys:p=`Unrecognized key(s) in object: ${P.joinValues(t.keys,", ")}`;break;case j.invalid_union:p="Invalid input";break;case j.invalid_union_discriminator:p=`Invalid discriminator value. Expected ${P.joinValues(t.options)}`;break;case j.invalid_enum_value:p=`Invalid enum value. Expected ${P.joinValues(t.options)}, received '${t.received}'`;break;case j.invalid_arguments:p="Invalid function arguments";break;case j.invalid_return_type:p="Invalid function return type";break;case j.invalid_date:p="Invalid date";break;case j.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(p=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(p=`${p} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?p=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?p=`Invalid input: must end with "${t.validation.endsWith}"`:P.assertNever(t.validation):t.validation!=="regex"?p=`Invalid ${t.validation}`:p="Invalid";break;case j.too_small:t.type==="array"?p=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?p=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?p=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?p=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:p="Invalid input";break;case j.too_big:t.type==="array"?p=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?p=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?p=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?p=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?p=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:p="Invalid input";break;case j.custom:p="Invalid input";break;case j.invalid_intersection_types:p="Intersection results could not be merged";break;case j.not_multiple_of:p=`Number must be a multiple of ${t.multipleOf}`;break;case j.not_finite:p="Number must be finite";break;default:p=d.defaultError,P.assertNever(t)}return{message:p}},"errorMap"),Mn=Pt;function ha(t){Mn=t}b(ha,"setErrorMap"),F(ha,"setErrorMap"),y(ha,"setErrorMap");function pr(){return Mn}b(pr,"getErrorMap"),F(pr,"getErrorMap"),y(pr,"getErrorMap");var de=y(t=>{let{data:d,path:p,errorMaps:x,issueData:_}=t,k=[...p,..._.path||[]],T={..._,path:k};if(_.message!==void 0)return{..._,path:k,message:_.message};let D="",A=x.filter(te=>!!te).slice().reverse();for(let te of A)D=te(T,{data:d,defaultError:D}).message;return{..._,path:k,message:D}},"makeIssue"),ye=[];function L(t,d){let p=pr(),x=de({issueData:d,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,p,p===Pt?void 0:Pt].filter(_=>!!_)});t.common.issues.push(x)}b(L,"addIssueToContext"),F(L,"addIssueToContext"),y(L,"addIssueToContext");var be=F(class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,d){let p=[];for(let x of d){if(x.status==="aborted")return H;x.status==="dirty"&&t.dirty(),p.push(x.value)}return{status:t.value,value:p}}static async mergeObjectAsync(t,d){let p=[];for(let x of d){let _=await x.key,k=await x.value;p.push({key:_,value:k})}return be.mergeObjectSync(t,p)}static mergeObjectSync(t,d){let p={};for(let x of d){let{key:_,value:k}=x;if(_.status==="aborted"||k.status==="aborted")return H;_.status==="dirty"&&t.dirty(),k.status==="dirty"&&t.dirty(),_.value!=="__proto__"&&(typeof k.value<"u"||x.alwaysSet)&&(p[_.value]=k.value)}return{status:t.value,value:p}}},"ParseStatus");y(be,"ParseStatus");var H=Object.freeze({status:"aborted"}),fr=y(t=>({status:"dirty",value:t}),"DIRTY"),I=y(t=>({status:"valid",value:t}),"OK"),ma=y(t=>t.status==="aborted","isAborted"),ga=y(t=>t.status==="dirty","isDirty"),rn=y(t=>t.status==="valid","isValid"),hr=y(t=>typeof Promise<"u"&&t instanceof Promise,"isAsync");function le(t,d,p,x){if(p==="a"&&!x)throw new TypeError("Private accessor was defined without a getter");if(typeof d=="function"?t!==d||!x:!d.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return p==="m"?x:p==="a"?x.call(t):x?x.value:d.get(t)}b(le,"__classPrivateFieldGet"),F(le,"__classPrivateFieldGet"),y(le,"__classPrivateFieldGet");function mr(t,d,p,x,_){if(x==="m")throw new TypeError("Private method is not writable");if(x==="a"&&!_)throw new TypeError("Private accessor was defined without a setter");if(typeof d=="function"?t!==d||!_:!d.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return x==="a"?_.call(t,p):_?_.value=p:d.set(t,p),p}b(mr,"__classPrivateFieldSet"),F(mr,"__classPrivateFieldSet"),y(mr,"__classPrivateFieldSet");var V;(function(t){t.errToObj=d=>typeof d=="string"?{message:d}:d||{},t.toString=d=>typeof d=="string"?d:d?.message})(V||(V={}));var Qe,Z,it=F(class{constructor(t,d,p,x){this._cachedPath=[],this.parent=t,this.data=d,this._path=p,this._key=x}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 Ze=y((t,d)=>{if(rn(d))return{success:!0,data:d.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let p=new Re(t.common.issues);return this._error=p,this._error}}},"handleResult");function Y(t){if(!t)return{};let{errorMap:d,invalid_type_error:p,required_error:x,description:_}=t;if(d&&(p||x))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return d?{errorMap:d,description:_}:{errorMap:y((T,D)=>{var A,te;let{message:we}=t;return T.code==="invalid_enum_value"?{message:we??D.defaultError}:typeof D.data>"u"?{message:(A=we??x)!==null&&A!==void 0?A:D.defaultError}:T.code!=="invalid_type"?{message:D.defaultError}:{message:(te=we??p)!==null&&te!==void 0?te:D.defaultError}},"customMap"),description:_}}b(Y,"processCreateParams"),F(Y,"processCreateParams"),y(Y,"processCreateParams");var ie=F(class{constructor(t){this.spa=this.safeParseAsync,this._def=t,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(t){return oe(t.data)}_getOrReturnCtx(t,d){return d||{common:t.parent.common,data:t.data,parsedType:oe(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new be,ctx:{common:t.parent.common,data:t.data,parsedType:oe(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let d=this._parse(t);if(hr(d))throw new Error("Synchronous parse encountered promise.");return d}_parseAsync(t){let d=this._parse(t);return Promise.resolve(d)}parse(t,d){let p=this.safeParse(t,d);if(p.success)return p.data;throw p.error}safeParse(t,d){var p;let x={common:{issues:[],async:(p=d?.async)!==null&&p!==void 0?p:!1,contextualErrorMap:d?.errorMap},path:d?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:oe(t)},_=this._parseSync({data:t,path:x.path,parent:x});return Ze(x,_)}async parseAsync(t,d){let p=await this.safeParseAsync(t,d);if(p.success)return p.data;throw p.error}async safeParseAsync(t,d){let p={common:{issues:[],contextualErrorMap:d?.errorMap,async:!0},path:d?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:oe(t)},x=this._parse({data:t,path:p.path,parent:p}),_=await(hr(x)?x:Promise.resolve(x));return Ze(p,_)}refine(t,d){let p=y(x=>typeof d=="string"||typeof d>"u"?{message:d}:typeof d=="function"?d(x):d,"getIssueProperties");return this._refinement((x,_)=>{let k=t(x),T=y(()=>_.addIssue({code:j.custom,...p(x)}),"setError");return typeof Promise<"u"&&k instanceof Promise?k.then(D=>D?!0:(T(),!1)):k?!0:(T(),!1)})}refinement(t,d){return this._refinement((p,x)=>t(p)?!0:(x.addIssue(typeof d=="function"?d(p,x):d),!1))}_refinement(t){return new Se({schema:this,typeName:J.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Ee.create(this,this._def)}nullable(){return He.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ot.create(this,this._def)}promise(){return We.create(this,this._def)}or(t){return Kt.create([this,t],this._def)}and(t){return vt.create(this,t,this._def)}transform(t){return new Se({...Y(this._def),schema:this,typeName:J.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let d=typeof t=="function"?t:()=>t;return new Ie({...Y(this._def),innerType:this,defaultValue:d,typeName:J.ZodDefault})}brand(){return new Ke({typeName:J.ZodBranded,type:this,...Y(this._def)})}catch(t){let d=typeof t=="function"?t:()=>t;return new Be({...Y(this._def),innerType:this,catchValue:d,typeName:J.ZodCatch})}describe(t){let d=this.constructor;return new d({...this._def,description:t})}pipe(t){return Lt.create(this,t)}readonly(){return lt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},"ZodType");y(ie,"ZodType");var Ln=/^c[^\s-]{8,}$/i,Wt=/^[0-9a-z]+$/,Zn=/^[0-9A-HJKMNP-TV-Z]{26}$/,wo=/^[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,B=/^[a-z0-9_-]{21}$/i,Ae=/^[-+]?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)?)??$/,X=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,gr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Pe,ya=/^(?:(?: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])$/,va=/^(([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})))$/,nn=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,yr="((\\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])))",Ht=new RegExp(`^${yr}$`);function Ot(t){let d="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?d=`${d}\\.\\d{${t.precision}}`:t.precision==null&&(d=`${d}(\\.\\d+)?`),d}b(Ot,"timeRegexSource"),F(Ot,"timeRegexSource"),y(Ot,"timeRegexSource");function W(t){return new RegExp(`^${Ot(t)}$`)}b(W,"timeRegex"),F(W,"timeRegex"),y(W,"timeRegex");function jt(t){let d=`${yr}T${Ot(t)}`,p=[];return p.push(t.local?"Z?":"Z"),t.offset&&p.push("([+-]\\d{2}:?\\d{2})"),d=`${d}(${p.join("|")})`,new RegExp(`^${d}$`)}b(jt,"datetimeRegex"),F(jt,"datetimeRegex"),y(jt,"datetimeRegex");function Gt(t,d){return!!((d==="v4"||!d)&&ya.test(t)||(d==="v6"||!d)&&va.test(t))}b(Gt,"isValidIP"),F(Gt,"isValidIP"),y(Gt,"isValidIP");var Ce=F(class extends ie{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==O.string){let _=this._getOrReturnCtx(t);return L(_,{code:j.invalid_type,expected:O.string,received:_.parsedType}),H}let p=new be,x;for(let _ of this._def.checks)if(_.kind==="min")t.data.length<_.value&&(x=this._getOrReturnCtx(t,x),L(x,{code:j.too_small,minimum:_.value,type:"string",inclusive:!0,exact:!1,message:_.message}),p.dirty());else if(_.kind==="max")t.data.length>_.value&&(x=this._getOrReturnCtx(t,x),L(x,{code:j.too_big,maximum:_.value,type:"string",inclusive:!0,exact:!1,message:_.message}),p.dirty());else if(_.kind==="length"){let k=t.data.length>_.value,T=t.data.length<_.value;(k||T)&&(x=this._getOrReturnCtx(t,x),k?L(x,{code:j.too_big,maximum:_.value,type:"string",inclusive:!0,exact:!0,message:_.message}):T&&L(x,{code:j.too_small,minimum:_.value,type:"string",inclusive:!0,exact:!0,message:_.message}),p.dirty())}else if(_.kind==="email")X.test(t.data)||(x=this._getOrReturnCtx(t,x),L(x,{validation:"email",code:j.invalid_string,message:_.message}),p.dirty());else if(_.kind==="emoji")Pe||(Pe=new RegExp(gr,"u")),Pe.test(t.data)||(x=this._getOrReturnCtx(t,x),L(x,{validation:"emoji",code:j.invalid_string,message:_.message}),p.dirty());else if(_.kind==="uuid")wo.test(t.data)||(x=this._getOrReturnCtx(t,x),L(x,{validation:"uuid",code:j.invalid_string,message:_.message}),p.dirty());else if(_.kind==="nanoid")B.test(t.data)||(x=this._getOrReturnCtx(t,x),L(x,{validation:"nanoid",code:j.invalid_string,message:_.message}),p.dirty());else if(_.kind==="cuid")Ln.test(t.data)||(x=this._getOrReturnCtx(t,x),L(x,{validation:"cuid",code:j.invalid_string,message:_.message}),p.dirty());else if(_.kind==="cuid2")Wt.test(t.data)||(x=this._getOrReturnCtx(t,x),L(x,{validation:"cuid2",code:j.invalid_string,message:_.message}),p.dirty());else if(_.kind==="ulid")Zn.test(t.data)||(x=this._getOrReturnCtx(t,x),L(x,{validation:"ulid",code:j.invalid_string,message:_.message}),p.dirty());else if(_.kind==="url")try{new URL(t.data)}catch{x=this._getOrReturnCtx(t,x),L(x,{validation:"url",code:j.invalid_string,message:_.message}),p.dirty()}else _.kind==="regex"?(_.regex.lastIndex=0,_.regex.test(t.data)||(x=this._getOrReturnCtx(t,x),L(x,{validation:"regex",code:j.invalid_string,message:_.message}),p.dirty())):_.kind==="trim"?t.data=t.data.trim():_.kind==="includes"?t.data.includes(_.value,_.position)||(x=this._getOrReturnCtx(t,x),L(x,{code:j.invalid_string,validation:{includes:_.value,position:_.position},message:_.message}),p.dirty()):_.kind==="toLowerCase"?t.data=t.data.toLowerCase():_.kind==="toUpperCase"?t.data=t.data.toUpperCase():_.kind==="startsWith"?t.data.startsWith(_.value)||(x=this._getOrReturnCtx(t,x),L(x,{code:j.invalid_string,validation:{startsWith:_.value},message:_.message}),p.dirty()):_.kind==="endsWith"?t.data.endsWith(_.value)||(x=this._getOrReturnCtx(t,x),L(x,{code:j.invalid_string,validation:{endsWith:_.value},message:_.message}),p.dirty()):_.kind==="datetime"?jt(_).test(t.data)||(x=this._getOrReturnCtx(t,x),L(x,{code:j.invalid_string,validation:"datetime",message:_.message}),p.dirty()):_.kind==="date"?Ht.test(t.data)||(x=this._getOrReturnCtx(t,x),L(x,{code:j.invalid_string,validation:"date",message:_.message}),p.dirty()):_.kind==="time"?W(_).test(t.data)||(x=this._getOrReturnCtx(t,x),L(x,{code:j.invalid_string,validation:"time",message:_.message}),p.dirty()):_.kind==="duration"?Ae.test(t.data)||(x=this._getOrReturnCtx(t,x),L(x,{validation:"duration",code:j.invalid_string,message:_.message}),p.dirty()):_.kind==="ip"?Gt(t.data,_.version)||(x=this._getOrReturnCtx(t,x),L(x,{validation:"ip",code:j.invalid_string,message:_.message}),p.dirty()):_.kind==="base64"?nn.test(t.data)||(x=this._getOrReturnCtx(t,x),L(x,{validation:"base64",code:j.invalid_string,message:_.message}),p.dirty()):P.assertNever(_);return{status:p.value,value:t.data}}_regex(t,d,p){return this.refinement(x=>t.test(x),{validation:d,code:j.invalid_string,...V.errToObj(p)})}_addCheck(t){return new Ce({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...V.errToObj(t)})}url(t){return this._addCheck({kind:"url",...V.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...V.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...V.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...V.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...V.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...V.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...V.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...V.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...V.errToObj(t)})}datetime(t){var d,p;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:(d=t?.offset)!==null&&d!==void 0?d:!1,local:(p=t?.local)!==null&&p!==void 0?p:!1,...V.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...V.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...V.errToObj(t)})}regex(t,d){return this._addCheck({kind:"regex",regex:t,...V.errToObj(d)})}includes(t,d){return this._addCheck({kind:"includes",value:t,position:d?.position,...V.errToObj(d?.message)})}startsWith(t,d){return this._addCheck({kind:"startsWith",value:t,...V.errToObj(d)})}endsWith(t,d){return this._addCheck({kind:"endsWith",value:t,...V.errToObj(d)})}min(t,d){return this._addCheck({kind:"min",value:t,...V.errToObj(d)})}max(t,d){return this._addCheck({kind:"max",value:t,...V.errToObj(d)})}length(t,d){return this._addCheck({kind:"length",value:t,...V.errToObj(d)})}nonempty(t){return this.min(1,V.errToObj(t))}trim(){return new Ce({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ce({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ce({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(let d of this._def.checks)d.kind==="min"&&(t===null||d.value>t)&&(t=d.value);return t}get maxLength(){let t=null;for(let d of this._def.checks)d.kind==="max"&&(t===null||d.value<t)&&(t=d.value);return t}},"ZodString");y(Ce,"ZodString"),Ce.create=t=>{var d;return new Ce({checks:[],typeName:J.ZodString,coerce:(d=t?.coerce)!==null&&d!==void 0?d:!1,...Y(t)})};function Un(t,d){let p=(t.toString().split(".")[1]||"").length,x=(d.toString().split(".")[1]||"").length,_=p>x?p:x,k=parseInt(t.toFixed(_).replace(".","")),T=parseInt(d.toFixed(_).replace(".",""));return k%T/Math.pow(10,_)}b(Un,"floatSafeRemainder"),F(Un,"floatSafeRemainder"),y(Un,"floatSafeRemainder");var Q=F(class extends ie{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==O.number){let _=this._getOrReturnCtx(t);return L(_,{code:j.invalid_type,expected:O.number,received:_.parsedType}),H}let p,x=new be;for(let _ of this._def.checks)_.kind==="int"?P.isInteger(t.data)||(p=this._getOrReturnCtx(t,p),L(p,{code:j.invalid_type,expected:"integer",received:"float",message:_.message}),x.dirty()):_.kind==="min"?(_.inclusive?t.data<_.value:t.data<=_.value)&&(p=this._getOrReturnCtx(t,p),L(p,{code:j.too_small,minimum:_.value,type:"number",inclusive:_.inclusive,exact:!1,message:_.message}),x.dirty()):_.kind==="max"?(_.inclusive?t.data>_.value:t.data>=_.value)&&(p=this._getOrReturnCtx(t,p),L(p,{code:j.too_big,maximum:_.value,type:"number",inclusive:_.inclusive,exact:!1,message:_.message}),x.dirty()):_.kind==="multipleOf"?Un(t.data,_.value)!==0&&(p=this._getOrReturnCtx(t,p),L(p,{code:j.not_multiple_of,multipleOf:_.value,message:_.message}),x.dirty()):_.kind==="finite"?Number.isFinite(t.data)||(p=this._getOrReturnCtx(t,p),L(p,{code:j.not_finite,message:_.message}),x.dirty()):P.assertNever(_);return{status:x.value,value:t.data}}gte(t,d){return this.setLimit("min",t,!0,V.toString(d))}gt(t,d){return this.setLimit("min",t,!1,V.toString(d))}lte(t,d){return this.setLimit("max",t,!0,V.toString(d))}lt(t,d){return this.setLimit("max",t,!1,V.toString(d))}setLimit(t,d,p,x){return new Q({...this._def,checks:[...this._def.checks,{kind:t,value:d,inclusive:p,message:V.toString(x)}]})}_addCheck(t){return new Q({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:V.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:V.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:V.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:V.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:V.toString(t)})}multipleOf(t,d){return this._addCheck({kind:"multipleOf",value:t,message:V.toString(d)})}finite(t){return this._addCheck({kind:"finite",message:V.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:V.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:V.toString(t)})}get minValue(){let t=null;for(let d of this._def.checks)d.kind==="min"&&(t===null||d.value>t)&&(t=d.value);return t}get maxValue(){let t=null;for(let d of this._def.checks)d.kind==="max"&&(t===null||d.value<t)&&(t=d.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&P.isInteger(t.value))}get isFinite(){let t=null,d=null;for(let p of this._def.checks){if(p.kind==="finite"||p.kind==="int"||p.kind==="multipleOf")return!0;p.kind==="min"?(d===null||p.value>d)&&(d=p.value):p.kind==="max"&&(t===null||p.value<t)&&(t=p.value)}return Number.isFinite(d)&&Number.isFinite(t)}},"ZodNumber");y(Q,"ZodNumber"),Q.create=t=>new Q({checks:[],typeName:J.ZodNumber,coerce:t?.coerce||!1,...Y(t)});var ee=F(class extends ie{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==O.bigint){let _=this._getOrReturnCtx(t);return L(_,{code:j.invalid_type,expected:O.bigint,received:_.parsedType}),H}let p,x=new be;for(let _ of this._def.checks)_.kind==="min"?(_.inclusive?t.data<_.value:t.data<=_.value)&&(p=this._getOrReturnCtx(t,p),L(p,{code:j.too_small,type:"bigint",minimum:_.value,inclusive:_.inclusive,message:_.message}),x.dirty()):_.kind==="max"?(_.inclusive?t.data>_.value:t.data>=_.value)&&(p=this._getOrReturnCtx(t,p),L(p,{code:j.too_big,type:"bigint",maximum:_.value,inclusive:_.inclusive,message:_.message}),x.dirty()):_.kind==="multipleOf"?t.data%_.value!==BigInt(0)&&(p=this._getOrReturnCtx(t,p),L(p,{code:j.not_multiple_of,multipleOf:_.value,message:_.message}),x.dirty()):P.assertNever(_);return{status:x.value,value:t.data}}gte(t,d){return this.setLimit("min",t,!0,V.toString(d))}gt(t,d){return this.setLimit("min",t,!1,V.toString(d))}lte(t,d){return this.setLimit("max",t,!0,V.toString(d))}lt(t,d){return this.setLimit("max",t,!1,V.toString(d))}setLimit(t,d,p,x){return new ee({...this._def,checks:[...this._def.checks,{kind:t,value:d,inclusive:p,message:V.toString(x)}]})}_addCheck(t){return new ee({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:V.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:V.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:V.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:V.toString(t)})}multipleOf(t,d){return this._addCheck({kind:"multipleOf",value:t,message:V.toString(d)})}get minValue(){let t=null;for(let d of this._def.checks)d.kind==="min"&&(t===null||d.value>t)&&(t=d.value);return t}get maxValue(){let t=null;for(let d of this._def.checks)d.kind==="max"&&(t===null||d.value<t)&&(t=d.value);return t}},"ZodBigInt");y(ee,"ZodBigInt"),ee.create=t=>{var d;return new ee({checks:[],typeName:J.ZodBigInt,coerce:(d=t?.coerce)!==null&&d!==void 0?d:!1,...Y(t)})};var vr=F(class extends ie{_parse(t){if(this._def.coerce&&(t.data=Boolean(t.data)),this._getType(t)!==O.boolean){let p=this._getOrReturnCtx(t);return L(p,{code:j.invalid_type,expected:O.boolean,received:p.parsedType}),H}return I(t.data)}},"ZodBoolean");y(vr,"ZodBoolean"),vr.create=t=>new vr({typeName:J.ZodBoolean,coerce:t?.coerce||!1,...Y(t)});var Jt=F(class extends ie{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==O.date){let _=this._getOrReturnCtx(t);return L(_,{code:j.invalid_type,expected:O.date,received:_.parsedType}),H}if(isNaN(t.data.getTime())){let _=this._getOrReturnCtx(t);return L(_,{code:j.invalid_date}),H}let p=new be,x;for(let _ of this._def.checks)_.kind==="min"?t.data.getTime()<_.value&&(x=this._getOrReturnCtx(t,x),L(x,{code:j.too_small,message:_.message,inclusive:!0,exact:!1,minimum:_.value,type:"date"}),p.dirty()):_.kind==="max"?t.data.getTime()>_.value&&(x=this._getOrReturnCtx(t,x),L(x,{code:j.too_big,message:_.message,inclusive:!0,exact:!1,maximum:_.value,type:"date"}),p.dirty()):P.assertNever(_);return{status:p.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Jt({...this._def,checks:[...this._def.checks,t]})}min(t,d){return this._addCheck({kind:"min",value:t.getTime(),message:V.toString(d)})}max(t,d){return this._addCheck({kind:"max",value:t.getTime(),message:V.toString(d)})}get minDate(){let t=null;for(let d of this._def.checks)d.kind==="min"&&(t===null||d.value>t)&&(t=d.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let d of this._def.checks)d.kind==="max"&&(t===null||d.value<t)&&(t=d.value);return t!=null?new Date(t):null}},"ZodDate");y(Jt,"ZodDate"),Jt.create=t=>new Jt({checks:[],coerce:t?.coerce||!1,typeName:J.ZodDate,...Y(t)});var an=F(class extends ie{_parse(t){if(this._getType(t)!==O.symbol){let p=this._getOrReturnCtx(t);return L(p,{code:j.invalid_type,expected:O.symbol,received:p.parsedType}),H}return I(t.data)}},"ZodSymbol");y(an,"ZodSymbol"),an.create=t=>new an({typeName:J.ZodSymbol,...Y(t)});var br=F(class extends ie{_parse(t){if(this._getType(t)!==O.undefined){let p=this._getOrReturnCtx(t);return L(p,{code:j.invalid_type,expected:O.undefined,received:p.parsedType}),H}return I(t.data)}},"ZodUndefined");y(br,"ZodUndefined"),br.create=t=>new br({typeName:J.ZodUndefined,...Y(t)});var _r=F(class extends ie{_parse(t){if(this._getType(t)!==O.null){let p=this._getOrReturnCtx(t);return L(p,{code:j.invalid_type,expected:O.null,received:p.parsedType}),H}return I(t.data)}},"ZodNull");y(_r,"ZodNull"),_r.create=t=>new _r({typeName:J.ZodNull,...Y(t)});var Qt=F(class extends ie{constructor(){super(...arguments),this._any=!0}_parse(t){return I(t.data)}},"ZodAny");y(Qt,"ZodAny"),Qt.create=t=>new Qt({typeName:J.ZodAny,...Y(t)});var Vt=F(class extends ie{constructor(){super(...arguments),this._unknown=!0}_parse(t){return I(t.data)}},"ZodUnknown");y(Vt,"ZodUnknown"),Vt.create=t=>new Vt({typeName:J.ZodUnknown,...Y(t)});var yt=F(class extends ie{_parse(t){let d=this._getOrReturnCtx(t);return L(d,{code:j.invalid_type,expected:O.never,received:d.parsedType}),H}},"ZodNever");y(yt,"ZodNever"),yt.create=t=>new yt({typeName:J.ZodNever,...Y(t)});var Yt=F(class extends ie{_parse(t){if(this._getType(t)!==O.undefined){let p=this._getOrReturnCtx(t);return L(p,{code:j.invalid_type,expected:O.void,received:p.parsedType}),H}return I(t.data)}},"ZodVoid");y(Yt,"ZodVoid"),Yt.create=t=>new Yt({typeName:J.ZodVoid,...Y(t)});var ot=F(class extends ie{_parse(t){let{ctx:d,status:p}=this._processInputParams(t),x=this._def;if(d.parsedType!==O.array)return L(d,{code:j.invalid_type,expected:O.array,received:d.parsedType}),H;if(x.exactLength!==null){let k=d.data.length>x.exactLength.value,T=d.data.length<x.exactLength.value;(k||T)&&(L(d,{code:k?j.too_big:j.too_small,minimum:T?x.exactLength.value:void 0,maximum:k?x.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:x.exactLength.message}),p.dirty())}if(x.minLength!==null&&d.data.length<x.minLength.value&&(L(d,{code:j.too_small,minimum:x.minLength.value,type:"array",inclusive:!0,exact:!1,message:x.minLength.message}),p.dirty()),x.maxLength!==null&&d.data.length>x.maxLength.value&&(L(d,{code:j.too_big,maximum:x.maxLength.value,type:"array",inclusive:!0,exact:!1,message:x.maxLength.message}),p.dirty()),d.common.async)return Promise.all([...d.data].map((k,T)=>x.type._parseAsync(new it(d,k,d.path,T)))).then(k=>be.mergeArray(p,k));let _=[...d.data].map((k,T)=>x.type._parseSync(new it(d,k,d.path,T)));return be.mergeArray(p,_)}get element(){return this._def.type}min(t,d){return new ot({...this._def,minLength:{value:t,message:V.toString(d)}})}max(t,d){return new ot({...this._def,maxLength:{value:t,message:V.toString(d)}})}length(t,d){return new ot({...this._def,exactLength:{value:t,message:V.toString(d)}})}nonempty(t){return this.min(1,t)}},"ZodArray");y(ot,"ZodArray"),ot.create=(t,d)=>new ot({type:t,minLength:null,maxLength:null,exactLength:null,typeName:J.ZodArray,...Y(d)});function At(t){if(t instanceof _e){let d={};for(let p in t.shape){let x=t.shape[p];d[p]=Ee.create(At(x))}return new _e({...t._def,shape:()=>d})}else return t instanceof ot?new ot({...t._def,type:At(t.element)}):t instanceof Ee?Ee.create(At(t.unwrap())):t instanceof He?He.create(At(t.unwrap())):t instanceof ze?ze.create(t.items.map(d=>At(d))):t}b(At,"deepPartialify"),F(At,"deepPartialify"),y(At,"deepPartialify");var _e=F(class extends ie{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),d=P.objectKeys(t);return this._cached={shape:t,keys:d}}_parse(t){if(this._getType(t)!==O.object){let A=this._getOrReturnCtx(t);return L(A,{code:j.invalid_type,expected:O.object,received:A.parsedType}),H}let{status:p,ctx:x}=this._processInputParams(t),{shape:_,keys:k}=this._getCached(),T=[];if(!(this._def.catchall instanceof yt&&this._def.unknownKeys==="strip"))for(let A in x.data)k.includes(A)||T.push(A);let D=[];for(let A of k){let te=_[A],we=x.data[A];D.push({key:{status:"valid",value:A},value:te._parse(new it(x,we,x.path,A)),alwaysSet:A in x.data})}if(this._def.catchall instanceof yt){let A=this._def.unknownKeys;if(A==="passthrough")for(let te of T)D.push({key:{status:"valid",value:te},value:{status:"valid",value:x.data[te]}});else if(A==="strict")T.length>0&&(L(x,{code:j.unrecognized_keys,keys:T}),p.dirty());else if(A!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let A=this._def.catchall;for(let te of T){let we=x.data[te];D.push({key:{status:"valid",value:te},value:A._parse(new it(x,we,x.path,te)),alwaysSet:te in x.data})}}return x.common.async?Promise.resolve().then(async()=>{let A=[];for(let te of D){let we=await te.key,ta=await te.value;A.push({key:we,value:ta,alwaysSet:te.alwaysSet})}return A}).then(A=>be.mergeObjectSync(p,A)):be.mergeObjectSync(p,D)}get shape(){return this._def.shape()}strict(t){return V.errToObj,new _e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(d,p)=>{var x,_,k,T;let D=(k=(_=(x=this._def).errorMap)===null||_===void 0?void 0:_.call(x,d,p).message)!==null&&k!==void 0?k:p.defaultError;return d.code==="unrecognized_keys"?{message:(T=V.errToObj(t).message)!==null&&T!==void 0?T:D}:{message:D}}}:{}})}strip(){return new _e({...this._def,unknownKeys:"strip"})}passthrough(){return new _e({...this._def,unknownKeys:"passthrough"})}extend(t){return new _e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new _e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:J.ZodObject})}setKey(t,d){return this.augment({[t]:d})}catchall(t){return new _e({...this._def,catchall:t})}pick(t){let d={};return P.objectKeys(t).forEach(p=>{t[p]&&this.shape[p]&&(d[p]=this.shape[p])}),new _e({...this._def,shape:()=>d})}omit(t){let d={};return P.objectKeys(this.shape).forEach(p=>{t[p]||(d[p]=this.shape[p])}),new _e({...this._def,shape:()=>d})}deepPartial(){return At(this)}partial(t){let d={};return P.objectKeys(this.shape).forEach(p=>{let x=this.shape[p];t&&!t[p]?d[p]=x:d[p]=x.optional()}),new _e({...this._def,shape:()=>d})}required(t){let d={};return P.objectKeys(this.shape).forEach(p=>{if(t&&!t[p])d[p]=this.shape[p];else{let _=this.shape[p];for(;_ instanceof Ee;)_=_._def.innerType;d[p]=_}}),new _e({...this._def,shape:()=>d})}keyof(){return Mt(P.objectKeys(this.shape))}},"ZodObject");y(_e,"ZodObject"),_e.create=(t,d)=>new _e({shape:()=>t,unknownKeys:"strip",catchall:yt.create(),typeName:J.ZodObject,...Y(d)}),_e.strictCreate=(t,d)=>new _e({shape:()=>t,unknownKeys:"strict",catchall:yt.create(),typeName:J.ZodObject,...Y(d)}),_e.lazycreate=(t,d)=>new _e({shape:t,unknownKeys:"strip",catchall:yt.create(),typeName:J.ZodObject,...Y(d)});var Kt=F(class extends ie{_parse(t){let{ctx:d}=this._processInputParams(t),p=this._def.options;function x(_){for(let T of _)if(T.result.status==="valid")return T.result;for(let T of _)if(T.result.status==="dirty")return d.common.issues.push(...T.ctx.common.issues),T.result;let k=_.map(T=>new Re(T.ctx.common.issues));return L(d,{code:j.invalid_union,unionErrors:k}),H}if(b(x,"handleResults"),F(x,"handleResults"),y(x,"handleResults"),d.common.async)return Promise.all(p.map(async _=>{let k={...d,common:{...d.common,issues:[]},parent:null};return{result:await _._parseAsync({data:d.data,path:d.path,parent:k}),ctx:k}})).then(x);{let _,k=[];for(let D of p){let A={...d,common:{...d.common,issues:[]},parent:null},te=D._parseSync({data:d.data,path:d.path,parent:A});if(te.status==="valid")return te;te.status==="dirty"&&!_&&(_={result:te,ctx:A}),A.common.issues.length&&k.push(A.common.issues)}if(_)return d.common.issues.push(..._.ctx.common.issues),_.result;let T=k.map(D=>new Re(D));return L(d,{code:j.invalid_union,unionErrors:T}),H}}get options(){return this._def.options}},"ZodUnion");y(Kt,"ZodUnion"),Kt.create=(t,d)=>new Kt({options:t,typeName:J.ZodUnion,...Y(d)});var wt=y(t=>t instanceof st?wt(t.schema):t instanceof Se?wt(t.innerType()):t instanceof Ye?[t.value]:t instanceof Fe?t.options:t instanceof ct?P.objectValues(t.enum):t instanceof Ie?wt(t._def.innerType):t instanceof br?[void 0]:t instanceof _r?[null]:t instanceof Ee?[void 0,...wt(t.unwrap())]:t instanceof He?[null,...wt(t.unwrap())]:t instanceof Ke||t instanceof lt?wt(t.unwrap()):t instanceof Be?wt(t._def.innerType):[],"getDiscriminator"),It=F(class extends ie{_parse(t){let{ctx:d}=this._processInputParams(t);if(d.parsedType!==O.object)return L(d,{code:j.invalid_type,expected:O.object,received:d.parsedType}),H;let p=this.discriminator,x=d.data[p],_=this.optionsMap.get(x);return _?d.common.async?_._parseAsync({data:d.data,path:d.path,parent:d}):_._parseSync({data:d.data,path:d.path,parent:d}):(L(d,{code:j.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[p]}),H)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,d,p){let x=new Map;for(let _ of d){let k=wt(_.shape[t]);if(!k.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let T of k){if(x.has(T))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(T)}`);x.set(T,_)}}return new It({typeName:J.ZodDiscriminatedUnion,discriminator:t,options:d,optionsMap:x,...Y(p)})}},"ZodDiscriminatedUnion");y(It,"ZodDiscriminatedUnion");function Nt(t,d){let p=oe(t),x=oe(d);if(t===d)return{valid:!0,data:t};if(p===O.object&&x===O.object){let _=P.objectKeys(d),k=P.objectKeys(t).filter(D=>_.indexOf(D)!==-1),T={...t,...d};for(let D of k){let A=Nt(t[D],d[D]);if(!A.valid)return{valid:!1};T[D]=A.data}return{valid:!0,data:T}}else if(p===O.array&&x===O.array){if(t.length!==d.length)return{valid:!1};let _=[];for(let k=0;k<t.length;k++){let T=t[k],D=d[k],A=Nt(T,D);if(!A.valid)return{valid:!1};_.push(A.data)}return{valid:!0,data:_}}else return p===O.date&&x===O.date&&+t==+d?{valid:!0,data:t}:{valid:!1}}b(Nt,"mergeValues"),F(Nt,"mergeValues"),y(Nt,"mergeValues");var vt=F(class extends ie{_parse(t){let{status:d,ctx:p}=this._processInputParams(t),x=y((_,k)=>{if(ma(_)||ma(k))return H;let T=Nt(_.value,k.value);return T.valid?((ga(_)||ga(k))&&d.dirty(),{status:d.value,value:T.data}):(L(p,{code:j.invalid_intersection_types}),H)},"handleParsed");return p.common.async?Promise.all([this._def.left._parseAsync({data:p.data,path:p.path,parent:p}),this._def.right._parseAsync({data:p.data,path:p.path,parent:p})]).then(([_,k])=>x(_,k)):x(this._def.left._parseSync({data:p.data,path:p.path,parent:p}),this._def.right._parseSync({data:p.data,path:p.path,parent:p}))}},"ZodIntersection");y(vt,"ZodIntersection"),vt.create=(t,d,p)=>new vt({left:t,right:d,typeName:J.ZodIntersection,...Y(p)});var ze=F(class extends ie{_parse(t){let{status:d,ctx:p}=this._processInputParams(t);if(p.parsedType!==O.array)return L(p,{code:j.invalid_type,expected:O.array,received:p.parsedType}),H;if(p.data.length<this._def.items.length)return L(p,{code:j.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),H;!this._def.rest&&p.data.length>this._def.items.length&&(L(p,{code:j.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),d.dirty());let _=[...p.data].map((k,T)=>{let D=this._def.items[T]||this._def.rest;return D?D._parse(new it(p,k,p.path,T)):null}).filter(k=>!!k);return p.common.async?Promise.all(_).then(k=>be.mergeArray(d,k)):be.mergeArray(d,_)}get items(){return this._def.items}rest(t){return new ze({...this._def,rest:t})}},"ZodTuple");y(ze,"ZodTuple"),ze.create=(t,d)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ze({items:t,typeName:J.ZodTuple,rest:null,...Y(d)})};var Me=F(class extends ie{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:d,ctx:p}=this._processInputParams(t);if(p.parsedType!==O.object)return L(p,{code:j.invalid_type,expected:O.object,received:p.parsedType}),H;let x=[],_=this._def.keyType,k=this._def.valueType;for(let T in p.data)x.push({key:_._parse(new it(p,T,p.path,T)),value:k._parse(new it(p,p.data[T],p.path,T)),alwaysSet:T in p.data});return p.common.async?be.mergeObjectAsync(d,x):be.mergeObjectSync(d,x)}get element(){return this._def.valueType}static create(t,d,p){return d instanceof ie?new Me({keyType:t,valueType:d,typeName:J.ZodRecord,...Y(p)}):new Me({keyType:Ce.create(),valueType:t,typeName:J.ZodRecord,...Y(d)})}},"ZodRecord");y(Me,"ZodRecord");var Dt=F(class extends ie{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:d,ctx:p}=this._processInputParams(t);if(p.parsedType!==O.map)return L(p,{code:j.invalid_type,expected:O.map,received:p.parsedType}),H;let x=this._def.keyType,_=this._def.valueType,k=[...p.data.entries()].map(([T,D],A)=>({key:x._parse(new it(p,T,p.path,[A,"key"])),value:_._parse(new it(p,D,p.path,[A,"value"]))}));if(p.common.async){let T=new Map;return Promise.resolve().then(async()=>{for(let D of k){let A=await D.key,te=await D.value;if(A.status==="aborted"||te.status==="aborted")return H;(A.status==="dirty"||te.status==="dirty")&&d.dirty(),T.set(A.value,te.value)}return{status:d.value,value:T}})}else{let T=new Map;for(let D of k){let A=D.key,te=D.value;if(A.status==="aborted"||te.status==="aborted")return H;(A.status==="dirty"||te.status==="dirty")&&d.dirty(),T.set(A.value,te.value)}return{status:d.value,value:T}}}},"ZodMap");y(Dt,"ZodMap"),Dt.create=(t,d,p)=>new Dt({valueType:d,keyType:t,typeName:J.ZodMap,...Y(p)});var Ue=F(class extends ie{_parse(t){let{status:d,ctx:p}=this._processInputParams(t);if(p.parsedType!==O.set)return L(p,{code:j.invalid_type,expected:O.set,received:p.parsedType}),H;let x=this._def;x.minSize!==null&&p.data.size<x.minSize.value&&(L(p,{code:j.too_small,minimum:x.minSize.value,type:"set",inclusive:!0,exact:!1,message:x.minSize.message}),d.dirty()),x.maxSize!==null&&p.data.size>x.maxSize.value&&(L(p,{code:j.too_big,maximum:x.maxSize.value,type:"set",inclusive:!0,exact:!1,message:x.maxSize.message}),d.dirty());let _=this._def.valueType;function k(D){let A=new Set;for(let te of D){if(te.status==="aborted")return H;te.status==="dirty"&&d.dirty(),A.add(te.value)}return{status:d.value,value:A}}b(k,"finalizeSet"),F(k,"finalizeSet"),y(k,"finalizeSet");let T=[...p.data.values()].map((D,A)=>_._parse(new it(p,D,p.path,A)));return p.common.async?Promise.all(T).then(D=>k(D)):k(T)}min(t,d){return new Ue({...this._def,minSize:{value:t,message:V.toString(d)}})}max(t,d){return new Ue({...this._def,maxSize:{value:t,message:V.toString(d)}})}size(t,d){return this.min(t,d).max(t,d)}nonempty(t){return this.min(1,t)}},"ZodSet");y(Ue,"ZodSet"),Ue.create=(t,d)=>new Ue({valueType:t,minSize:null,maxSize:null,typeName:J.ZodSet,...Y(d)});var $e=F(class extends ie{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:d}=this._processInputParams(t);if(d.parsedType!==O.function)return L(d,{code:j.invalid_type,expected:O.function,received:d.parsedType}),H;function p(T,D){return de({data:T,path:d.path,errorMaps:[d.common.contextualErrorMap,d.schemaErrorMap,pr(),Pt].filter(A=>!!A),issueData:{code:j.invalid_arguments,argumentsError:D}})}b(p,"makeArgsIssue"),F(p,"makeArgsIssue"),y(p,"makeArgsIssue");function x(T,D){return de({data:T,path:d.path,errorMaps:[d.common.contextualErrorMap,d.schemaErrorMap,pr(),Pt].filter(A=>!!A),issueData:{code:j.invalid_return_type,returnTypeError:D}})}b(x,"makeReturnsIssue"),F(x,"makeReturnsIssue"),y(x,"makeReturnsIssue");let _={errorMap:d.common.contextualErrorMap},k=d.data;if(this._def.returns instanceof We){let T=this;return I(async function(...D){let A=new Re([]),te=await T._def.args.parseAsync(D,_).catch(Qa=>{throw A.addIssue(p(D,Qa)),A}),we=await Reflect.apply(k,this,te);return await T._def.returns._def.type.parseAsync(we,_).catch(Qa=>{throw A.addIssue(x(we,Qa)),A})})}else{let T=this;return I(function(...D){let A=T._def.args.safeParse(D,_);if(!A.success)throw new Re([p(D,A.error)]);let te=Reflect.apply(k,this,A.data),we=T._def.returns.safeParse(te,_);if(!we.success)throw new Re([x(te,we.error)]);return we.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new $e({...this._def,args:ze.create(t).rest(Vt.create())})}returns(t){return new $e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,d,p){return new $e({args:t||ze.create([]).rest(Vt.create()),returns:d||Vt.create(),typeName:J.ZodFunction,...Y(p)})}},"ZodFunction");y($e,"ZodFunction");var st=F(class extends ie{get schema(){return this._def.getter()}_parse(t){let{ctx:d}=this._processInputParams(t);return this._def.getter()._parse({data:d.data,path:d.path,parent:d})}},"ZodLazy");y(st,"ZodLazy"),st.create=(t,d)=>new st({getter:t,typeName:J.ZodLazy,...Y(d)});var Ye=F(class extends ie{_parse(t){if(t.data!==this._def.value){let d=this._getOrReturnCtx(t);return L(d,{received:d.data,code:j.invalid_literal,expected:this._def.value}),H}return{status:"valid",value:t.data}}get value(){return this._def.value}},"ZodLiteral");y(Ye,"ZodLiteral"),Ye.create=(t,d)=>new Ye({value:t,typeName:J.ZodLiteral,...Y(d)});function Mt(t,d){return new Fe({values:t,typeName:J.ZodEnum,...Y(d)})}b(Mt,"createZodEnum"),F(Mt,"createZodEnum"),y(Mt,"createZodEnum");var Fe=F(class extends ie{constructor(){super(...arguments),Qe.set(this,void 0)}_parse(t){if(typeof t.data!="string"){let d=this._getOrReturnCtx(t),p=this._def.values;return L(d,{expected:P.joinValues(p),received:d.parsedType,code:j.invalid_type}),H}if(le(this,Qe,"f")||mr(this,Qe,new Set(this._def.values),"f"),!le(this,Qe,"f").has(t.data)){let d=this._getOrReturnCtx(t),p=this._def.values;return L(d,{received:d.data,code:j.invalid_enum_value,options:p}),H}return I(t.data)}get options(){return this._def.values}get enum(){let t={};for(let d of this._def.values)t[d]=d;return t}get Values(){let t={};for(let d of this._def.values)t[d]=d;return t}get Enum(){let t={};for(let d of this._def.values)t[d]=d;return t}extract(t,d=this._def){return Fe.create(t,{...this._def,...d})}exclude(t,d=this._def){return Fe.create(this.options.filter(p=>!t.includes(p)),{...this._def,...d})}},"ZodEnum");y(Fe,"ZodEnum"),Qe=new WeakMap,Fe.create=Mt;var ct=F(class extends ie{constructor(){super(...arguments),Z.set(this,void 0)}_parse(t){let d=P.getValidEnumValues(this._def.values),p=this._getOrReturnCtx(t);if(p.parsedType!==O.string&&p.parsedType!==O.number){let x=P.objectValues(d);return L(p,{expected:P.joinValues(x),received:p.parsedType,code:j.invalid_type}),H}if(le(this,Z,"f")||mr(this,Z,new Set(P.getValidEnumValues(this._def.values)),"f"),!le(this,Z,"f").has(t.data)){let x=P.objectValues(d);return L(p,{received:p.data,code:j.invalid_enum_value,options:x}),H}return I(t.data)}get enum(){return this._def.values}},"ZodNativeEnum");y(ct,"ZodNativeEnum"),Z=new WeakMap,ct.create=(t,d)=>new ct({values:t,typeName:J.ZodNativeEnum,...Y(d)});var We=F(class extends ie{unwrap(){return this._def.type}_parse(t){let{ctx:d}=this._processInputParams(t);if(d.parsedType!==O.promise&&d.common.async===!1)return L(d,{code:j.invalid_type,expected:O.promise,received:d.parsedType}),H;let p=d.parsedType===O.promise?d.data:Promise.resolve(d.data);return I(p.then(x=>this._def.type.parseAsync(x,{path:d.path,errorMap:d.common.contextualErrorMap})))}},"ZodPromise");y(We,"ZodPromise"),We.create=(t,d)=>new We({type:t,typeName:J.ZodPromise,...Y(d)});var Se=F(class extends ie{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===J.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:d,ctx:p}=this._processInputParams(t),x=this._def.effect||null,_={addIssue:k=>{L(p,k),k.fatal?d.abort():d.dirty()},get path(){return p.path}};if(_.addIssue=_.addIssue.bind(_),x.type==="preprocess"){let k=x.transform(p.data,_);if(p.common.async)return Promise.resolve(k).then(async T=>{if(d.value==="aborted")return H;let D=await this._def.schema._parseAsync({data:T,path:p.path,parent:p});return D.status==="aborted"?H:D.status==="dirty"||d.value==="dirty"?fr(D.value):D});{if(d.value==="aborted")return H;let T=this._def.schema._parseSync({data:k,path:p.path,parent:p});return T.status==="aborted"?H:T.status==="dirty"||d.value==="dirty"?fr(T.value):T}}if(x.type==="refinement"){let k=y(T=>{let D=x.refinement(T,_);if(p.common.async)return Promise.resolve(D);if(D instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return T},"executeRefinement");if(p.common.async===!1){let T=this._def.schema._parseSync({data:p.data,path:p.path,parent:p});return T.status==="aborted"?H:(T.status==="dirty"&&d.dirty(),k(T.value),{status:d.value,value:T.value})}else return this._def.schema._parseAsync({data:p.data,path:p.path,parent:p}).then(T=>T.status==="aborted"?H:(T.status==="dirty"&&d.dirty(),k(T.value).then(()=>({status:d.value,value:T.value}))))}if(x.type==="transform")if(p.common.async===!1){let k=this._def.schema._parseSync({data:p.data,path:p.path,parent:p});if(!rn(k))return k;let T=x.transform(k.value,_);if(T instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:d.value,value:T}}else return this._def.schema._parseAsync({data:p.data,path:p.path,parent:p}).then(k=>rn(k)?Promise.resolve(x.transform(k.value,_)).then(T=>({status:d.value,value:T})):k);P.assertNever(x)}},"ZodEffects");y(Se,"ZodEffects"),Se.create=(t,d,p)=>new Se({schema:t,typeName:J.ZodEffects,effect:d,...Y(p)}),Se.createWithPreprocess=(t,d,p)=>new Se({schema:d,effect:{type:"preprocess",transform:t},typeName:J.ZodEffects,...Y(p)});var Ee=F(class extends ie{_parse(t){return this._getType(t)===O.undefined?I(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}},"ZodOptional");y(Ee,"ZodOptional"),Ee.create=(t,d)=>new Ee({innerType:t,typeName:J.ZodOptional,...Y(d)});var He=F(class extends ie{_parse(t){return this._getType(t)===O.null?I(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}},"ZodNullable");y(He,"ZodNullable"),He.create=(t,d)=>new He({innerType:t,typeName:J.ZodNullable,...Y(d)});var Ie=F(class extends ie{_parse(t){let{ctx:d}=this._processInputParams(t),p=d.data;return d.parsedType===O.undefined&&(p=this._def.defaultValue()),this._def.innerType._parse({data:p,path:d.path,parent:d})}removeDefault(){return this._def.innerType}},"ZodDefault");y(Ie,"ZodDefault"),Ie.create=(t,d)=>new Ie({innerType:t,typeName:J.ZodDefault,defaultValue:typeof d.default=="function"?d.default:()=>d.default,...Y(d)});var Be=F(class extends ie{_parse(t){let{ctx:d}=this._processInputParams(t),p={...d,common:{...d.common,issues:[]}},x=this._def.innerType._parse({data:p.data,path:p.path,parent:{...p}});return hr(x)?x.then(_=>({status:"valid",value:_.status==="valid"?_.value:this._def.catchValue({get error(){return new Re(p.common.issues)},input:p.data})})):{status:"valid",value:x.status==="valid"?x.value:this._def.catchValue({get error(){return new Re(p.common.issues)},input:p.data})}}removeCatch(){return this._def.innerType}},"ZodCatch");y(Be,"ZodCatch"),Be.create=(t,d)=>new Be({innerType:t,typeName:J.ZodCatch,catchValue:typeof d.catch=="function"?d.catch:()=>d.catch,...Y(d)});var ge=F(class extends ie{_parse(t){if(this._getType(t)!==O.nan){let p=this._getOrReturnCtx(t);return L(p,{code:j.invalid_type,expected:O.nan,received:p.parsedType}),H}return{status:"valid",value:t.data}}},"ZodNaN");y(ge,"ZodNaN"),ge.create=t=>new ge({typeName:J.ZodNaN,...Y(t)});var wr=Symbol("zod_brand"),Ke=F(class extends ie{_parse(t){let{ctx:d}=this._processInputParams(t),p=d.data;return this._def.type._parse({data:p,path:d.path,parent:d})}unwrap(){return this._def.type}},"ZodBranded");y(Ke,"ZodBranded");var Lt=F(class extends ie{_parse(t){let{status:d,ctx:p}=this._processInputParams(t);if(p.common.async)return y(async()=>{let _=await this._def.in._parseAsync({data:p.data,path:p.path,parent:p});return _.status==="aborted"?H:_.status==="dirty"?(d.dirty(),fr(_.value)):this._def.out._parseAsync({data:_.value,path:p.path,parent:p})},"handleAsync")();{let x=this._def.in._parseSync({data:p.data,path:p.path,parent:p});return x.status==="aborted"?H:x.status==="dirty"?(d.dirty(),{status:"dirty",value:x.value}):this._def.out._parseSync({data:x.value,path:p.path,parent:p})}}static create(t,d){return new Lt({in:t,out:d,typeName:J.ZodPipeline})}},"ZodPipeline");y(Lt,"ZodPipeline");var lt=F(class extends ie{_parse(t){let d=this._def.innerType._parse(t),p=y(x=>(rn(x)&&(x.value=Object.freeze(x.value)),x),"freeze");return hr(d)?d.then(x=>p(x)):p(d)}unwrap(){return this._def.innerType}},"ZodReadonly");y(lt,"ZodReadonly"),lt.create=(t,d)=>new lt({innerType:t,typeName:J.ZodReadonly,...Y(d)});function Ct(t,d={},p){return t?Qt.create().superRefine((x,_)=>{var k,T;if(!t(x)){let D=typeof d=="function"?d(x):typeof d=="string"?{message:d}:d,A=(T=(k=D.fatal)!==null&&k!==void 0?k:p)!==null&&T!==void 0?T:!0,te=typeof D=="string"?{message:D}:D;_.addIssue({code:"custom",...te,fatal:A})}}):Qt.create()}b(Ct,"custom"),F(Ct,"custom"),y(Ct,"custom");var bt={object:_e.lazycreate},J;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(J||(J={}));var on=y((t,d={message:`Input not instance of ${t.name}`})=>Ct(p=>p instanceof t,d),"instanceOfType"),Zt=Ce.create,Xt=Q.create,Cr=ge.create,xr=ee.create,Er=vr.create,Ut=Jt.create,Tr=an.create,er=br.create,Xe=_r.create,dt=Qt.create,xt=Vt.create,kr=yt.create,Sr=Yt.create,sn=ot.create,Co=_e.create,Bn=_e.strictCreate,cn=Kt.create,Rr=It.create,ln=vt.create,xo=ze.create,K=Me.create,Eo=Dt.create,ci=Ue.create,li=$e.create,To=st.create,ko=Ye.create,di=Fe.create,So=ct.create,Ro=We.create,ui=Se.create,Po=Ee.create,Oo=He.create,jo=Se.createWithPreprocess,Vo=Lt.create,Ao=y(()=>Zt().optional(),"ostring"),Io=y(()=>Xt().optional(),"onumber"),No=y(()=>Er().optional(),"oboolean"),Do={string:t=>Ce.create({...t,coerce:!0}),number:t=>Q.create({...t,coerce:!0}),boolean:t=>vr.create({...t,coerce:!0}),bigint:t=>ee.create({...t,coerce:!0}),date:t=>Jt.create({...t,coerce:!0})},Mo=H,o=Object.freeze({__proto__:null,defaultErrorMap:Pt,setErrorMap:ha,getErrorMap:pr,makeIssue:de,EMPTY_PATH:ye,addIssueToContext:L,ParseStatus:be,INVALID:H,DIRTY:fr,OK:I,isAborted:ma,isDirty:ga,isValid:rn,isAsync:hr,get util(){return P},get objectUtil(){return z},ZodParsedType:O,getParsedType:oe,ZodType:ie,datetimeRegex:jt,ZodString:Ce,ZodNumber:Q,ZodBigInt:ee,ZodBoolean:vr,ZodDate:Jt,ZodSymbol:an,ZodUndefined:br,ZodNull:_r,ZodAny:Qt,ZodUnknown:Vt,ZodNever:yt,ZodVoid:Yt,ZodArray:ot,ZodObject:_e,ZodUnion:Kt,ZodDiscriminatedUnion:It,ZodIntersection:vt,ZodTuple:ze,ZodRecord:Me,ZodMap:Dt,ZodSet:Ue,ZodFunction:$e,ZodLazy:st,ZodLiteral:Ye,ZodEnum:Fe,ZodNativeEnum:ct,ZodPromise:We,ZodEffects:Se,ZodTransformer:Se,ZodOptional:Ee,ZodNullable:He,ZodDefault:Ie,ZodCatch:Be,ZodNaN:ge,BRAND:wr,ZodBranded:Ke,ZodPipeline:Lt,ZodReadonly:lt,custom:Ct,Schema:ie,ZodSchema:ie,late:bt,get ZodFirstPartyTypeKind(){return J},coerce:Do,any:dt,array:sn,bigint:xr,boolean:Er,date:Ut,discriminatedUnion:Rr,effect:ui,enum:di,function:li,instanceof:on,intersection:ln,lazy:To,literal:ko,map:Eo,nan:Cr,nativeEnum:So,never:kr,null:Xe,nullable:Oo,number:Xt,object:Co,oboolean:No,onumber:Io,optional:Po,ostring:Ao,pipeline:Vo,preprocess:jo,promise:Ro,record:K,set:ci,strictObject:Bn,string:Zt,symbol:Tr,transformer:ui,tuple:xo,undefined:er,union:cn,unknown:xt,void:Sr,NEVER:Mo,ZodIssueCode:j,quotelessJson:ke,ZodError:Re}),dn=Symbol("current"),Pr=Symbol("previous"),un=y((t,{ref:d,refType:p,param:x,header:_,...k}={})=>({...k,...t}),"mergeOpenApi");function ba(t){if(typeof t.ZodType.prototype.openapi<"u")return;t.ZodType.prototype.openapi=function(k){let{zodOpenApi:T,...D}=this._def,A=new this.constructor({...D,zodOpenApi:{openapi:un(k,T?.openapi)}});return A._def.zodOpenApi[dn]=A,T&&(A._def.zodOpenApi[Pr]=this),A};let d=t.ZodType.prototype.describe;t.ZodType.prototype.describe=function(...k){let T=d.apply(this,k),D=T._def;if(D.zodOpenApi){let A={...D.zodOpenApi};A.openapi=un({description:k[0]},A.openapi),A[Pr]=this,A[dn]=T,D.zodOpenApi=A}else D.zodOpenApi={openapi:{description:k[0]},[dn]:T};return T};let p=t.ZodObject.prototype.extend;t.ZodObject.prototype.extend=function(...k){let T=p.apply(this,k),D=T._def.zodOpenApi;if(D){let A={...D};A.openapi=un({},A.openapi),A[Pr]=this,T._def.zodOpenApi=A}else T._def.zodOpenApi={[Pr]:this};return T};let x=t.ZodObject.prototype.omit;t.ZodObject.prototype.omit=function(...k){let T=x.apply(this,k),D=T._def.zodOpenApi;if(D){let A={...D};A.openapi=un({},A.openapi),delete A[Pr],delete A[dn],T._def.zodOpenApi=A}return T};let _=t.ZodObject.prototype.pick;t.ZodObject.prototype.pick=function(...k){let T=_.apply(this,k),D=T._def.zodOpenApi;if(D){let A={...D};A.openapi=un({},A.openapi),delete A[Pr],delete A[dn],T._def.zodOpenApi=A}return T}}b(ba,"extendZodWithOpenApi"),F(ba,"extendZodWithOpenApi"),y(ba,"extendZodWithOpenApi"),ba(o);var pn=o.array(o.string().or(o.record(o.any()))),Lo=o.object({type:o.string().optional(),narrative:o.string().optional()}),fn=o.string().or(o.object({id:o.string(),type:o.string(),caption:o.string().optional()})),pi=o.object({type:o.string().min(1).or(o.string().array().nonempty()),latitude:o.number(),longitude:o.number()}),fi=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:pi.optional()}),hi=o.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(o.string()),_a=o.object({type:o.string().min(1).or(o.string().array().nonempty()),identifier:o.string(),identifierType:hi}),tr=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:fn.optional(),email:o.string().email().optional(),address:fi.optional(),otherIdentifier:_a.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())),qn=o.object({id:o.string().optional()}).catchall(o.any()),hn=o.object({type:o.string(),id:o.string()}).catchall(o.any()),wa=o.object({id:o.string(),type:o.string()}).catchall(o.any()),Ca=o.object({id:o.string().optional(),type:o.string()}).catchall(o.any()),xa=o.object({type:o.string(),id:o.string().optional()}).catchall(o.any()),Ea=o.object({type:o.string().or(o.string().array().nonempty()),id:o.string().optional()}).catchall(o.any()),Or=o.object({"@context":pn,id:o.string().optional(),type:o.string().array().nonempty(),issuer:tr,credentialSubject:qn.or(qn.array()),refreshService:Ca.or(Ca.array()).optional(),credentialSchema:wa.or(wa.array()).optional(),issuanceDate:o.string().optional(),expirationDate:o.string().optional(),credentialStatus:hn.or(hn.array()).optional(),name:o.string().optional(),description:o.string().optional(),validFrom:o.string().optional(),validUntil:o.string().optional(),status:hn.or(hn.array()).optional(),termsOfUse:xa.or(xa.array()).optional(),evidence:Ea.or(Ea.array()).optional()}).catchall(o.any()),ut=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()),zn=Or.extend({proof:ut.or(ut.array())}),i=o.object({"@context":pn,id:o.string().optional(),type:o.string().or(o.string().array().nonempty()),verifiableCredential:zn.or(zn.array()).optional(),holder:o.string().optional()}).catchall(o.any()),jr=i.extend({proof:ut.or(ut.array())}),Et=o.object({kty:o.string(),crv:o.string(),x:o.string(),y:o.string().optional(),n:o.string().optional(),d:o.string().optional()}),mn=Et.omit({d:!0}).extend({d:o.string()}),gn=o.object({alg:o.string(),iv:o.string(),tag:o.string(),epk:Et.partial().optional(),kid:o.string().optional(),apv:o.string().optional(),apu:o.string().optional()}),Vr=o.object({header:gn,encrypted_key:o.string()}),mi=o.object({protected:o.string(),iv:o.string(),ciphertext:o.string(),tag:o.string(),aad:o.string().optional(),recipients:Vr.array().optional()}),et=o.string().or(o.object({"@context":pn.optional(),id:o.string(),type:o.string(),controller:o.string(),publicKeyJwk:Et.optional(),publicKeyBase58:o.string().optional(),publicKeyMultibase:o.string().optional(),blockChainAccountId:o.string().optional()}).catchall(o.any())),Ta=o.object({id:o.string(),type:o.string().or(o.string().array().nonempty()),serviceEndpoint:o.any().or(o.any().array().nonempty())}).catchall(o.any()),gi=o.object({"@context":pn,id:o.string(),alsoKnownAs:o.string().optional(),controller:o.string().or(o.string().array().nonempty()).optional(),verificationMethod:et.array().optional(),authentication:et.array().optional(),assertionMethod:et.array().optional(),keyAgreement:et.array().optional(),capabilityInvocation:et.array().optional(),capabilityDelegation:et.array().optional(),publicKey:et.array().optional(),service:Ta.array().optional(),proof:ut.or(ut.array()).optional()}).catchall(o.any()),ka=o.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(o.string()),rr=o.object({type:o.string().array().nonempty(),targetCode:o.string().optional(),targetDescription:o.string().optional(),targetName:o.string(),targetFramework:o.string().optional(),targetType:ka.optional(),targetUrl:o.string()}),nr=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"]),yn=nr.or(o.string()),Ar=o.object({id:o.string().optional(),narrative:o.string().optional()}).catchall(o.any()),$n=o.object({id:o.string(),type:o.string().array().nonempty(),endorsementComment:o.string().optional()}),Fn=Or.extend({credentialSubject:$n,proof:ut.or(ut.array()).optional()}),Wn=o.object({id:o.string(),"@language":o.string().optional(),version:o.string().optional()}),Hn=o.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(o.string()),ar=o.object({id:o.string(),type:o.string().array().nonempty(),alignment:rr.array().optional(),description:o.string().optional(),level:o.string().optional(),name:o.string(),points:o.string().optional()}).catchall(o.any()),tt=o.object({id:o.string(),type:o.string().array().nonempty(),alignment:rr.array().optional(),allowedValue:o.string().array().optional(),name:o.string(),requiredLevel:o.string().optional(),requiredValue:o.string().optional(),resultType:Hn,rubricCriterionLevel:ar.array().optional(),valueMax:o.string().optional(),valueMin:o.string().optional()}).catchall(o.any()),vn=o.object({id:o.string().optional(),type:o.string().array().nonempty(),alignment:rr.array().optional(),achievementType:yn.optional(),creator:tr.optional(),creditsAvailable:o.number().optional(),criteria:Ar,description:o.string(),endorsement:Fn.array().optional(),fieldOfStudy:o.string().optional(),humanCode:o.string().optional(),image:fn.optional(),"@language":o.string().optional(),name:o.string(),otherIdentifier:_a.array().optional(),related:Wn.array().optional(),resultDescription:tt.array().optional(),specialization:o.string().optional(),tag:o.string().array().optional(),version:o.string().optional()}).catchall(o.any()),Sa=o.object({type:o.string(),hashed:o.boolean(),identityHash:o.string(),identityType:o.string(),salt:o.string().optional()}),Ra=o.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),bn=o.object({type:o.string().array().nonempty(),achievedLevel:o.string().optional(),alignment:rr.array().optional(),resultDescription:o.string().optional(),status:Ra.optional(),value:o.string().optional()}).catchall(o.any()),Pa=o.object({id:o.string().optional(),type:o.string().array().nonempty(),activityEndDate:o.string().optional(),activityStartDate:o.string().optional(),creditsEarned:o.number().optional(),achievement:vn.optional(),identifier:Sa.array().optional(),image:fn.optional(),licenseNumber:o.string().optional(),narrative:o.string().optional(),result:bn.array().optional(),role:o.string().optional(),source:tr.optional(),term:o.string().optional()}).catchall(o.any()),Oa=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()),ja=Or.extend({name:o.string().optional(),description:o.string().optional(),image:fn.optional(),credentialSubject:Pa.or(Pa.array()),endorsement:Or.array().optional(),evidence:Oa.array().optional()}),yi=ja.extend({proof:ut.or(ut.array())}),Bt=o.object({checks:o.string().array(),warnings:o.string().array(),errors:o.string().array()}),Gn=o.enum(["Success","Failed","Error"]),Zo=Gn.enum,vi=o.object({check:o.string(),status:Gn,message:o.string().optional(),details:o.string().optional()}),_n=o.object({title:o.string().optional(),createdAt:o.string().optional(),issuer:tr.optional(),issuee:tr.optional(),credentialSubject:qn.optional()}),bi=o.object({id:o.string(),uri:o.string()}).catchall(o.any()),_i=o.object({limit:o.number(),cursor:o.string().optional(),sort:o.string().optional()}),Oe=o.object({cursor:o.string().optional(),hasMore:o.boolean()}),Jn=o.object({encryptedRecord:mi,fields:o.string().array()}).catchall(o.any()),wi=Oe.extend({records:Jn.array()}),Va=Jn.extend({id:o.string()}),Ci=Oe.extend({records:Va.array()}),Aa=y(t=>{let d=t.match(/^\/(.*)\/([gimsuy]*)$/);if(!d)throw new Error("Invalid RegExp string format");return{pattern:d[1],flags:d[2]}},"parseRegexString"),Ia=o.instanceof(RegExp).or(o.string().refine(t=>{try{return Aa(t),!0}catch{return!1}},{message:"Invalid RegExp string format. Must be in format '/pattern/flags'"}).transform(t=>{let{pattern:d,flags:p}=Aa(t);try{return new RegExp(d,p)}catch(x){throw new Error(`Invalid RegExp: ${x.message}`)}})),pe=o.string().or(o.object({$in:o.string().array()})).or(o.object({$regex:Ia})),Na=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()}),pt=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:Na.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.")}),xi=o.object({profileId:pe,displayName:pe,shortBio:pe,bio:pe,email:pe,websiteLink:pe,isServiceProfile:o.boolean(),type:pe}).partial(),Da=Oe.extend({records:pt.array()}),Ei=o.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),Qn=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()}),Uo=Oe.extend({records:Qn.extend({did:o.string()}).array()}),Bo=o.object({id:pe,displayName:pe,shortBio:pe,bio:pe,email:pe}).partial(),Ma=Oe.extend({records:o.object({profile:pt,manager:Qn.extend({did:o.string()}).optional()}).array()}),qo=o.object({uri:o.string(),to:o.string(),from:o.string(),sent:o.string().datetime(),received:o.string().datetime().optional()}),La=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()}),Ti=o.object({role:pe,canEdit:o.boolean(),canIssue:o.boolean(),canRevoke:o.boolean(),canManagePermissions:o.boolean(),canIssueChildren:pe,canCreateChildren:pe,canEditChildren:pe,canRevokeChildren:pe,canManageChildrenPermissions:pe,canManageChildrenProfiles:o.boolean(),canViewAnalytics:o.boolean()}).partial(),Yn=o.enum(["GRANT_PERMISSIONS","ADD_ADMIN","AUTO_CONNECT"]),ki=o.discriminatedUnion("type",[o.object({type:o.literal(Yn.Values.GRANT_PERMISSIONS),data:o.object({claimUri:o.string(),targetUri:o.string(),permissions:La.partial()})}),o.object({type:o.literal(Yn.Values.ADD_ADMIN),data:o.object({claimUri:o.string(),targetUri:o.string()})}),o.object({type:o.literal(Yn.Values.AUTO_CONNECT),data:o.object({claimUri:o.string(),targetUri:o.string()})})]),Ne=o.object({type:pe,data:o.object({claimUri:pe,targetUri:pe,permissions:Ti})}).deepPartial(),Kn=o.object({id:o.string(),createdAt:o.string(),updatedAt:o.string()}).and(ki),zo=Oe.extend({records:Kn.array()}),wn=o.enum(["DRAFT","LIVE"]),Si=o.object({uri:o.string(),name:o.string().optional(),type:o.string().optional(),category:o.string().optional(),status:wn.optional(),autoConnectRecipients:o.boolean().optional(),meta:o.record(o.any()).optional(),claimPermissions:La.optional(),allowAnyoneToCreateChildren:o.boolean().optional()}),Ri=o.object({uri:pe,name:pe,type:pe,category:pe,meta:o.record(pe),status:wn.or(o.object({$in:wn.array()})),autoConnectRecipients:o.boolean()}).partial(),Pi=Oe.extend({records:Si.array()}),fe=o.object({to:pt,from:o.string(),received:o.string().optional(),uri:o.string().optional()}),Oi=Oe.extend({records:fe.array()}),ft=o.object({to:pt,from:o.string(),received:o.string().optional(),boostUris:o.array(o.string()),credentialUris:o.array(o.string()).optional()}),$o=Oe.extend({records:ft.array()}),Fo=o.object({endpoint:o.string(),name:o.string(),did:o.string().optional()}),Wo=o.object({ttlSeconds:o.number().optional(),totalUses:o.number().optional()}),Xn=o.object({endpoint:o.string()}),Ho=o.object({signingAuthority:Xn,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()})}),Go=o.object({boostUri:o.string(),signingAuthority:o.object({endpoint:o.string(),name:o.string()})}),ji=o.enum(["live","stale","withdrawn"]),Vi=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({})}),Cn=o.object({contract:Vi,owner:pt,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(pt).optional()}),Ai=Oe.extend({records:Cn.omit({owner:!0}).array()}),xn=o.object({credentials:o.object({categories:o.record(o.string().array()).default({})}),personal:o.record(o.string()).default({}),date:o.string()}),Ii=Oe.extend({records:xn.array()}),Ni=o.object({credentials:o.object({category:o.string(),uri:o.string()}).array(),personal:o.record(o.string()).default({}),date:o.string(),contractUri:o.string()}),Di=Oe.extend({records:Ni.array()}),Za=o.object({sharing:o.boolean().optional(),shared:o.string().array().optional(),shareAll:o.boolean().optional(),shareUntil:o.string().optional()}),Ir=o.object({read:o.object({anonymize:o.boolean().optional(),credentials:o.object({shareAll:o.boolean().optional(),sharing:o.boolean().optional(),categories:o.record(Za).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()}),Mi=Oe.extend({records:o.object({expiresAt:o.string().optional(),oneTime:o.boolean().optional(),terms:Ir,contract:Cn,uri:o.string(),consenter:pt,status:ji}).array()}),Jo=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()}),Qo=o.object({anonymize:o.boolean().optional(),credentials:o.object({categories:o.record(o.boolean()).optional()}).optional(),personal:o.record(o.boolean()).optional()}),Li=o.object({credentials:o.object({categories:o.record(o.boolean()).optional()}).optional(),personal:o.record(o.boolean()).optional(),id:pe.optional()}),Zi=o.object({read:o.object({anonymize:o.boolean().optional(),credentials:o.object({shareAll:o.boolean().optional(),sharing:o.boolean().optional(),categories:o.record(Za.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()}),En=o.enum(["consent","update","sync","withdraw","write"]),Yo=o.object({terms:Zi.optional(),action:En.or(En.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()}),Ua=o.object({expiresAt:o.string().optional(),oneTime:o.boolean().optional(),terms:Ir.optional(),id:o.string(),action:En,date:o.string(),uris:o.string().array().optional()}),Ko=Oe.extend({records:Ua.array()}),Ba=o.object({credentialUri:o.string(),termsUri:o.string(),contractUri:o.string(),boostUri:o.string(),category:o.string().optional(),date:o.string()}),Xo=Oe.extend({records:Ba.array()}),Ui=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"]),qa=o.object({title:o.string().optional(),body:o.string().optional()}),za=o.object({type:o.string(),value:o.string()}),ir=o.enum(["PENDING","DELIVERED","CLAIMED","EXPIRED"]),Bi=o.object({issuanceId:o.string(),status:ir,recipient:o.object({contactMethod:za.optional(),learnCardId:o.string().optional()}),timestamp:o.string().datetime().optional()}),$a=o.object({vcUris:o.array(o.string()).optional(),vpUris:o.array(o.string()).optional(),transaction:Ua.optional(),inbox:Bi.optional()}),es=o.object({type:Ui,to:pt.partial().and(o.object({did:o.string()})),from:pt.partial().and(o.object({did:o.string()})),message:qa.optional(),data:$a.optional(),sent:o.string().datetime().optional(),webhookUrl:o.string().optional()}),Fa="auth-grant:",ts=o.object({id:o.string(),name:o.string(),description:o.string().optional(),challenge:o.string().startsWith(Fa).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()}),Wa=o.object({id:o.string()}).catchall(o.any()),ea=o.enum(["active","revoked"]),rs=o.object({id:pe,name:pe,description:pe,status:ea}).partial(),qi=o.object({id:o.string(),isVerified:o.boolean(),verifiedAt:o.string().optional(),isPrimary:o.boolean(),createdAt:o.string()}),ns=o.discriminatedUnion("type",[o.object({type:o.literal("email"),value:o.string().email()}).merge(qi),o.object({type:o.literal("phone"),value:o.string()}).merge(qi)]),zi=o.object({isVerified:o.boolean().optional(),isPrimary:o.boolean().optional()}),$i=o.discriminatedUnion("type",[o.object({type:o.literal("email"),value:o.string().email()}).merge(zi),o.object({type:o.literal("phone"),value:o.string()}).merge(zi)]),Nr=o.discriminatedUnion("type",[o.object({type:o.literal("email"),value:o.string().email()}),o.object({type:o.literal("phone"),value:o.string()})]),as=o.object({value:o.string(),type:o.enum(["email","phone"])}),Ha=o.object({token:o.string()}),is=o.object({contactMethodId:o.string()}),Ga=o.object({id:o.string(),credential:o.string(),isSigned:o.boolean(),currentStatus:ir,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()}),os=o.object({hasMore:o.boolean(),records:o.array(Ga),cursor:o.string().optional()}),Fi=o.object({currentStatus:ir,id:o.string(),isSigned:o.boolean(),issuerDid:o.string()}).partial(),Ja=o.object({endpoint:o.string().url(),name:o.string()}),Wi=o.object({recipient:Nr.describe("The recipient of the credential"),credential:zn.passthrough().or(jr.passthrough()).or(Or.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:Ja.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.")}),Tn=o.object({issuanceId:o.string(),status:ir,recipient:Nr,claimUrl:o.string().url().optional(),recipientDid:o.string().optional()}),Hi=o.object({token:o.string(),contactMethodId:o.string(),autoVerifyContactMethod:o.boolean().optional().default(!1),createdAt:o.string(),expiresAt:o.string(),used:o.boolean()})}}),Ip=ll({"../learn-card-types/dist/index.js"(n,e){"use strict";e.exports=Ap()}}),N_=Vp(Ip());var dl=F(n=>!n["@context"]||!Array.isArray(n["@context"])?!1:n["@context"].includes("https://www.w3.org/ns/credentials/v2"),"isVC2Format");async function Np(n,e,s){let l="";try{let h=n?.id;h&&typeof h.did=="function"&&(l=h.did())}catch{n?.debug?.("LCN: no local DID available at init; will fetch from profile")}n?.debug?.("Adding LearnCardNetwork Plugin");let c=s?await jc(e,s):await Oc(e,async h=>{let m=await n.invoke.getDidAuthVp({proofFormat:"jwt",challenge:h});if(typeof m!="string")throw new Error("Error getting DID-Auth-JWT!");return m}),g;n?.debug?.("LCN: initial getProfile query starting",{apiToken:!!s});let y=c.profile.getProfile.query().then(h=>(g=h,g?.did&&(l=g.did),n?.debug?.("LCN: initial getProfile success",{did:l}),h)).catch(h=>{n?.debug?.("LCN: getProfile failed (non-fatal)",h)}),v=b(async()=>{try{await y}catch{}if(!g&&s)try{n?.debug?.("LCN ensureUser: retrying getProfile with apiToken"),g=await c.profile.getProfile.query(),g?.did&&(l=g.did),n?.debug?.("LCN ensureUser: retry success",{did:l})}catch(h){n?.debug?.("LCN ensureUser: retry failed",h)}if(!g)throw new Error("Please make an account first!");return g},"ensureUser");return{name:"LearnCard Network",displayName:"LearnCard Network",description:"LearnCard Network Integration",id:{did:(h,m)=>!m||m==="web"?l:n.id?.did?.(m),keypair:(h,m)=>n.id?.keypair?.(m)},read:{get:async(h,m)=>{if(h.debug?.("learnCard.read['LearnCard Network'].get"),!m)return;let E=m.split(":");if(E.length!==5)return;let[P,z]=E;if(!(P!=="lc"||z!=="network"))try{let O=await c.storage.resolve.query({uri:m});if("ciphertext"in O)try{let oe=h.id.keypair();O=await h.invoke.decryptDagJwe(O,[oe])}catch(oe){h.debug?.("LCN read.get: skipping decryption (no keypair?)",oe);return}return await fa.or(yo).parseAsync(O)}catch(O){h.debug?.(O);return}}},store:{upload:async(h,m)=>(h.debug?.("learnCard.store['LearnCard Network'].upload"),c.storage.store.mutate({item:m})),uploadEncrypted:async(h,m,{recipients:E=[]}={recipients:[]})=>{h.debug?.("learnCard.store['LearnCard Network'].upload"),await v();let z=[l||g?.did||"",...E].filter(Boolean);if(z.length===0)throw new Error("No recipients specified for encrypted upload; provide at least one DID");let O=await h.invoke.createDagJwe(m,z);return c.storage.store.mutate({item:O})}},methods:{createProfile:async(h,m)=>{try{await v()}catch{}if(g)throw new Error("Account already exists!");let E=await c.profile.createProfile.mutate(m);return g=await c.profile.getProfile.query(),l=E,E},createServiceProfile:async(h,m)=>{try{await v()}catch{}let E=await c.profile.createServiceProfile.mutate(m);return g=await c.profile.getProfile.query(),l=E,E},createManagedProfile:async(h,m)=>await c.profileManager.createManagedProfile.mutate(m),createProfileManager:async(h,m)=>(await v(),await c.profileManager.createProfileManager.mutate(m)),createChildProfileManager:async(h,m,E)=>(await v(),await c.profileManager.createChildProfileManager.mutate({parentUri:m,profile:E})),createManagedServiceProfile:async(h,m)=>(await v(),await c.profile.createManagedServiceProfile.mutate(m)),getAvailableProfiles:async(h,m={})=>(await v(),c.profile.getAvailableProfiles.query(m)),getManagedProfiles:async(h,m={})=>c.profileManager.getManagedProfiles.query(m),getManagedServiceProfiles:async(h,m={})=>(await v(),c.profile.getManagedServiceProfiles.query(m)),updateProfile:async(h,m)=>(await v(),await c.profile.updateProfile.mutate(m)?(g=await c.profile.getProfile.query(),!0):!1),updateProfileManagerProfile:async(h,m)=>c.profileManager.updateProfileManager.mutate(m),deleteProfile:async()=>{if(!g)throw new Error("Account does not exist!");return await c.profile.deleteProfile.mutate()?(g=void 0,!0):!1},getProfile:async(h,m)=>{try{await v()}catch{}return m?c.profile.getOtherProfile.query({profileId:m}):g},getProfileManagerProfile:async(h,m)=>m?c.profileManager.getOtherProfileManager.query({id:m}):c.profileManager.getProfileManager.query(),searchProfiles:async(h,m="",{limit:E=25,includeSelf:P=!1,includeConnectionStatus:z=!1,includeServiceProfiles:O=!1}={})=>c.profile.searchProfiles.query({input:m,limit:E,includeSelf:P,includeConnectionStatus:z,includeServiceProfiles:O}),connectWith:async(h,m)=>(await v(),c.profile.connectWith.mutate({profileId:m})),cancelConnectionRequest:async(h,m)=>(await v(),c.profile.cancelConnectionRequest.mutate({profileId:m})),connectWithInvite:async(h,m,E)=>(await v(),c.profile.connectWithInvite.mutate({profileId:m,challenge:E})),disconnectWith:async(h,m)=>(await v(),c.profile.disconnectWith.mutate({profileId:m})),acceptConnectionRequest:async(h,m)=>(await v(),c.profile.acceptConnectionRequest.mutate({profileId:m})),getConnections:async h=>(console.warn("The getConnections method is deprecated! Please use getPaginatedConnections instead!"),await v(),c.profile.connections.query()),getPaginatedConnections:async(h,m)=>(await v(),c.profile.paginatedConnections.query(m)),getPendingConnections:async h=>(console.warn("The getPendingConnections method is deprecated! Please use getPaginatedPendingConnections instead!"),await v(),c.profile.pendingConnections.query()),getPaginatedPendingConnections:async(h,m)=>(await v(),c.profile.paginatedPendingConnections.query(m)),getConnectionRequests:async h=>(console.warn("The getConnectionRequests method is deprecated! Please use getPaginatedConnectionRequests instead!"),await v(),c.profile.connectionRequests.query()),getPaginatedConnectionRequests:async(h,m)=>(await v(),c.profile.paginatedConnectionRequests.query(m)),generateInvite:async(h,m,E,P)=>(await v(),c.profile.generateInvite.mutate({challenge:m,expiration:E,maxUses:P})),listInvites:async()=>(await v(),c.profile.listInvites.query()),invalidateInvite:async(h,m)=>(await v(),c.profile.invalidateInvite.mutate({challenge:m})),blockProfile:async(h,m)=>(await v(),c.profile.blockProfile.mutate({profileId:m})),unblockProfile:async(h,m)=>(await v(),c.profile.unblockProfile.mutate({profileId:m})),getBlockedProfiles:async()=>(await v(),c.profile.blocked.query()),sendCredential:async(h,m,E,P=!0)=>{if(await v(),!P)return c.credential.sendCredential.mutate({profileId:m,credential:E});let z=await h.invoke.getProfile(m);if(!z)throw new Error("Could not find target account");let O=await h.invoke.createDagJwe(E,[h.id.did(),z.did]);return c.credential.sendCredential.mutate({profileId:m,credential:O})},acceptCredential:async(h,m,E)=>(await v(),c.credential.acceptCredential.mutate({uri:m,options:E})),getReceivedCredentials:async(h,m)=>(await v(),c.credential.receivedCredentials.query({from:m})),getSentCredentials:async(h,m)=>(await v(),c.credential.sentCredentials.query({to:m})),getIncomingCredentials:async(h,m)=>(await v(),c.credential.incomingCredentials.query({from:m})),deleteCredential:async(h,m)=>(await v(),c.credential.deleteCredential.mutate({uri:m})),sendPresentation:async(h,m,E,P=!0)=>{if(await v(),!P)return c.presentation.sendPresentation.mutate({profileId:m,presentation:E});let z=await h.invoke.getProfile(m);if(!z)throw new Error("Could not find target account");let O=await h.invoke.createDagJwe(E,[h.id.did(),z.did]);return c.presentation.sendPresentation.mutate({profileId:m,presentation:O})},acceptPresentation:async(h,m)=>(await v(),c.presentation.acceptPresentation.mutate({uri:m})),getReceivedPresentations:async(h,m)=>(await v(),c.presentation.receivedPresentations.query({from:m})),getSentPresentations:async(h,m)=>(await v(),c.presentation.sentPresentations.query({to:m})),getIncomingPresentations:async(h,m)=>(await v(),c.presentation.incomingPresentations.query({from:m})),deletePresentation:async(h,m)=>(await v(),c.presentation.deletePresentation.mutate({uri:m})),createBoost:async(h,m,E)=>(await v(),c.boost.createBoost.mutate({credential:m,...E})),createChildBoost:async(h,m,E,P)=>(await v(),c.boost.createChildBoost.mutate({parentUri:m,boost:{credential:E,...P}})),getBoost:async(h,m)=>(await v(),c.boost.getBoost.query({uri:m})),getBoosts:async(h,m)=>(console.warn("The getBoosts method is deprecated! Please use getPaginatedBoosts instead!"),await v(),c.boost.getBoosts.query({query:m})),countBoosts:async(h,m)=>(await v(),c.boost.countBoosts.query({query:m})),getPaginatedBoosts:async(h,m)=>(await v(),c.boost.getPaginatedBoosts.query(m)),getBoostChildren:async(h,m,E)=>(await v(),c.boost.getBoostChildren.query({uri:m,...E})),countBoostChildren:async(h,m,E)=>(await v(),c.boost.countBoostChildren.query({uri:m,...E})),getBoostSiblings:async(h,m,E)=>(await v(),c.boost.getBoostSiblings.query({uri:m,...E})),countBoostSiblings:async(h,m,E)=>(await v(),c.boost.countBoostSiblings.query({uri:m,...E})),getFamilialBoosts:async(h,m,E)=>(await v(),c.boost.getFamilialBoosts.query({uri:m,...E})),countFamilialBoosts:async(h,m,E)=>(await v(),c.boost.countFamilialBoosts.query({uri:m,...E})),getBoostParents:async(h,m,E)=>(await v(),c.boost.getBoostParents.query({uri:m,...E})),countBoostParents:async(h,m,E)=>(await v(),c.boost.countBoostParents.query({uri:m,...E})),makeBoostParent:async(h,m)=>(await v(),c.boost.makeBoostParent.mutate(m)),removeBoostParent:async(h,m)=>(await v(),c.boost.removeBoostParent.mutate(m)),getBoostRecipients:async(h,m,E=25,P=void 0,z=!0)=>(console.warn("The getBoostRecipients method is deprecated! Please use getPaginatedBoostRecipients instead!"),await v(),c.boost.getBoostRecipients.query({uri:m,limit:E,skip:P,includeUnacceptedBoosts:z})),getPaginatedBoostRecipients:async(h,m,E=25,P=void 0,z=!0,O)=>(await v(),c.boost.getPaginatedBoostRecipients.query({uri:m,limit:E,cursor:P,includeUnacceptedBoosts:z,query:O})),getPaginatedBoostRecipientsWithChildren:async(h,m,E=25,P=void 0,z=!0,O,oe,j=1)=>(await v(),c.boost.getPaginatedBoostRecipientsWithChildren.query({uri:m,limit:E,cursor:P,includeUnacceptedBoosts:z,boostQuery:O,profileQuery:oe,numberOfGenerations:j})),countBoostRecipientsWithChildren:async(h,m,E=!0,P,z,O=1)=>{if(!g)throw new Error("Please make an account first!");return c.boost.getBoostRecipientsWithChildrenCount.query({uri:m,includeUnacceptedBoosts:E,boostQuery:P,profileQuery:z,numberOfGenerations:O})},countBoostRecipients:async(h,m,E=!0)=>(await v(),c.boost.getBoostRecipientCount.query({uri:m,includeUnacceptedBoosts:E})),getConnectedBoostRecipients:async(h,m,{limit:E=25,cursor:P=void 0,includeUnacceptedBoosts:z=!0,query:O}={})=>(await v(),c.boost.getConnectedBoostRecipients.query({uri:m,limit:E,cursor:P,includeUnacceptedBoosts:z,query:O})),countConnectedBoostRecipients:async(h,m,E=!0)=>(await v(),c.boost.getConnectedBoostRecipientCount.query({uri:m,includeUnacceptedBoosts:E})),getBoostChildrenProfileManagers:async(h,m,E)=>(await v(),c.boost.getChildrenProfileManagers.query({uri:m,...E})),updateBoost:async(h,m,E,P)=>(await v(),c.boost.updateBoost.mutate({uri:m,updates:{...P&&{credential:P},...E}})),getBoostAdmins:async(h,m,E={})=>(await v(),c.boost.getBoostAdmins.query({uri:m,...E})),getBoostPermissions:async(h,m,E)=>(await v(),E?c.boost.getOtherBoostPermissions.query({uri:m,profileId:E}):c.boost.getBoostPermissions.query({uri:m})),updateBoostPermissions:async(h,m,E,P)=>{if(await v(),!P)return c.boost.updateBoostPermissions.query({uri:m,updates:E});let z=await c.boost.updateOtherBoostPermissions.query({uri:m,profileId:P,updates:E});return z&&await h.invoke.clearDidWebCache?.(),z},addBoostAdmin:async(h,m,E)=>{await v();let P=await c.boost.addBoostAdmin.mutate({uri:m,profileId:E});return P&&await h.invoke.clearDidWebCache?.(),P},removeBoostAdmin:async(h,m,E)=>{await v();let P=await c.boost.removeBoostAdmin.mutate({uri:m,profileId:E});return P&&await h.invoke.clearDidWebCache?.(),P},deleteBoost:async(h,m)=>(await v(),c.boost.deleteBoost.mutate({uri:m})),sendBoost:async(h,m,E,P={encrypt:!0,skipNotification:!1})=>{await v();let z=await h.invoke.resolveFromLCN(E),O=await tn.spa(z);if(!O.success)throw new Error("Did not get a valid boost from URI");let oe=await h.invoke.getProfile(m);if(!oe)throw new Error("Target profile not found");let j=O.data;dl(j)?j.validFrom=new Date().toISOString():j.issuanceDate=new Date().toISOString(),j.issuer=h.id.did(),Array.isArray(j.credentialSubject)?j.credentialSubject=j.credentialSubject.map(Mn=>({...Mn,id:oe.did})):j.credentialSubject.id=oe.did,j?.type?.includes("BoostCredential")&&(j.boostId=E),typeof P=="object"&&P.overideFn&&(j=P.overideFn(j));let ke=await h.invoke.issueCredential(j);if(typeof P=="object"&&!P.encrypt||!P)return c.boost.sendBoost.mutate({profileId:m,uri:E,credential:ke,options:{skipNotification:typeof P=="object"&&P.skipNotification}});let Re=await c.utilities.getDid.query(),Pt=await h.invoke.createDagJwe(ke,[h.id.did(),oe.did,Re]);return c.boost.sendBoost.mutate({profileId:m,uri:E,credential:Pt,options:{skipNotification:typeof P=="object"&&P.skipNotification}})},registerSigningAuthority:async(h,m,E,P)=>(await v(),c.profile.registerSigningAuthority.mutate({endpoint:m,name:E,did:P})),getRegisteredSigningAuthorities:async h=>(await v(),c.profile.signingAuthorities.query()),getRegisteredSigningAuthority:async(h,m,E)=>(await v(),c.profile.signingAuthority.query({endpoint:m,name:E})),setPrimaryRegisteredSigningAuthority:async(h,m,E)=>(await v(),c.profile.setPrimarySigningAuthority.mutate({endpoint:m,name:E})),getPrimaryRegisteredSigningAuthority:async h=>(await v(),c.profile.primarySigningAuthority.query()),generateClaimLink:async(h,m,E,P,z)=>(await v(),c.boost.generateClaimLink.mutate({boostUri:m,claimLinkSA:E,options:P,challenge:z})),claimBoostWithLink:async(h,m,E)=>(await v(),c.boost.claimBoostWithLink.mutate({boostUri:m,challenge:E})),createContract:async(h,m)=>(await v(),c.contracts.createConsentFlowContract.mutate(m)),addAutoBoostsToContract:async(h,m,E)=>(await v(),c.contracts.addAutoBoostsToContract.mutate({contractUri:m,autoboosts:E})),removeAutoBoostsFromContract:async(h,m,E)=>(await v(),c.contracts.removeAutoBoostsFromContract.mutate({contractUri:m,boostUris:E})),getContract:async(h,m)=>c.contracts.getConsentFlowContract.query({uri:m}),getContracts:async(h,m)=>(await v(),c.contracts.getConsentFlowContracts.query(m)),deleteContract:async(h,m)=>(await v(),c.contracts.deleteConsentFlowContract.mutate({uri:m})),getConsentFlowData:async(h,m,E={})=>(await v(),c.contracts.getConsentedDataForContract.query({uri:m,...E})),getConsentFlowDataForDid:async(h,m,E={})=>(await v(),c.contracts.getConsentedDataForDid.query({did:m,...E})),getAllConsentFlowData:async(h,m={},E={})=>(await v(),c.contracts.getConsentedData.query({query:m,...E})),writeCredentialToContract:async(h,m,E,P,z)=>(await v(),c.contracts.writeCredentialToContract.mutate({did:m,contractUri:E,credential:P,boostUri:z})),consentToContract:async(h,m,{terms:E,expiresAt:P,oneTime:z},O)=>(await v(),c.contracts.consentToContract.mutate({contractUri:m,terms:E,expiresAt:P,oneTime:z,recipientToken:O})),getConsentedContracts:async(h,m)=>(await v(),c.contracts.getConsentedContracts.query(m)),updateContractTerms:async(h,m,{terms:E,expiresAt:P,oneTime:z})=>(await v(),c.contracts.updateConsentedContractTerms.mutate({uri:m,terms:E,expiresAt:P,oneTime:z})),withdrawConsent:async(h,m)=>(await v(),c.contracts.withdrawConsent.mutate({uri:m})),getConsentFlowTransactions:async(h,m,E)=>(await v(),c.contracts.getTermsTransactionHistory.query({uri:m,...E})),getCredentialsForContract:async(h,m,E={})=>(await v(),c.contracts.getCredentialsForContract.query({termsUri:m,...E})),getConsentFlowCredentials:async(h,m={})=>(await v(),c.contracts.getAllCredentialsForTerms.query(m)),verifyConsent:async(h,m,E)=>(await v(),c.contracts.verifyConsent.query({uri:m,profileId:E})),syncCredentialsToContract:async(h,m,E)=>(await v(),c.contracts.syncCredentialsToContract.mutate({termsUri:m,categories:E})),addDidMetadata:async(h,m)=>{await v();let E=await c.didMetadata.addDidMetadata.mutate(m);return E&&await h.invoke.clearDidWebCache?.(),E},getDidMetadata:async(h,m)=>(await v(),c.didMetadata.getDidMetadata.query({id:m})),getMyDidMetadata:async()=>(await v(),c.didMetadata.getMyDidMetadata.query()),updateDidMetadata:async(h,m,E)=>{await v();let P=await c.didMetadata.updateDidMetadata.mutate({id:m,updates:E});return P&&await h.invoke.clearDidWebCache?.(),P},deleteDidMetadata:async(h,m)=>{await v();let E=await c.didMetadata.deleteDidMetadata.mutate({id:m});return E&&await h.invoke.clearDidWebCache?.(),E},createClaimHook:async(h,m)=>(await v(),c.claimHook.createClaimHook.mutate({hook:m})),getClaimHooksForBoost:async(h,m)=>(await v(),c.claimHook.getClaimHooksForBoost.query(m)),deleteClaimHook:async(h,m)=>(await v(),c.claimHook.deleteClaimHook.mutate({id:m})),addAuthGrant:async(h,m)=>(await v(),c.authGrants.addAuthGrant.mutate(m)),revokeAuthGrant:async(h,m)=>(await v(),c.authGrants.revokeAuthGrant.mutate({id:m})),deleteAuthGrant:async(h,m)=>(await v(),c.authGrants.deleteAuthGrant.mutate({id:m})),updateAuthGrant:async(h,m,E)=>(await v(),c.authGrants.updateAuthGrant.mutate({id:m,updates:E})),getAuthGrant:async(h,m)=>(await v(),c.authGrants.getAuthGrant.query({id:m})),getAuthGrants:async(h,m)=>(await v(),c.authGrants.getAuthGrants.query(m)),getAPITokenForAuthGrant:async(h,m)=>{await v();let E=await c.authGrants.getAuthGrant.query({id:m});if(!E)throw new Error("Auth grant not found");if(E.status!=="active")throw new Error("Auth grant is not active");if(!E.challenge)throw new Error("Auth grant has no challenge");if(!E.scope)throw new Error("Auth grant has no scope");if(E.expiresAt&&new Date(E.expiresAt)<new Date)throw new Error("Auth grant is expired");let P=await h.invoke.getDidAuthVp({challenge:E.challenge,proofFormat:"jwt"});if(!P)throw new Error("Failed to get API Token for auth grant");return P},sendCredentialViaInbox:async(h,m)=>(await v(),c.inbox.issue.mutate(m)),getMySentInboxCredentials:async(h,m)=>(await v(),c.inbox.getMyIssuedCredentials.query(m)),getInboxCredential:async(h,m)=>(await v(),c.inbox.getInboxCredential.query({credentialId:m})),addContactMethod:async(h,m)=>(await v(),c.contactMethods.addContactMethod.mutate(m)),getMyContactMethods:async h=>(await v(),c.contactMethods.getMyContactMethods.query()),setPrimaryContactMethod:async(h,m)=>(await v(),c.contactMethods.setPrimaryContactMethod.mutate({contactMethodId:m})),verifyContactMethod:async(h,m)=>(await v(),c.contactMethods.verifyContactMethod.mutate({token:m})),removeContactMethod:async(h,m)=>(await v(),c.contactMethods.removeContactMethod.mutate({id:m})),resolveFromLCN:async(h,m)=>{let E=await c.storage.resolve.query({uri:m});return tn.or(fa).or(yo).or(Fs).or(Ws).or(bo).parseAsync(E)},getLCNClient:()=>c}}}b(Np,"getLearnCardNetworkPlugin");var Dp=b(async(n,e)=>{let s=[{id:"LearnCard Network",url:"https://network.learncard.com",did:"did:web:network.learncard.com"}],l;if(e){let y=await fetch(e);y.status===200?l=JSON.parse(await y.text()):l=s}else l=s;let c=b(y=>{if(!!y)return typeof y=="string"?y:"id"in y&&typeof y.id=="string"?y.id:void 0},"getIssuerDID"),g=b(y=>{let v=c(y);if(!!v)return l.find(h=>h.did===v)},"getTrustedBoostVerifier");return{name:"VerifyBoost",displayName:"Verify Boost Extension",description:"Adds a check for validating Boost Credentials.",methods:{verifyCredential:async(y,v,h)=>{let m=await n.invoke.verifyCredential(v,h),E=v?.boostCredential;try{if(E){let P=await n.invoke.verifyCredential(E);if(!E?.boostId&&!v?.boostId&&m.warnings.push("Boost Authenticity could not be verified: Boost ID metadata is missing."),P.errors?.length>0)m.errors=[...P.errors||[],...m.errors||[],"Boost Credential could not be verified."];else if(E?.boostId!==v?.boostId)m.errors.push("Boost Authenticity could not be verified: Boost ID metadata is mismatched.");else{let z=g(v?.issuer);z?m.checks.push(`Boost is Authentic. Verified by ${z.id}.`):m.warnings.push(`Boost Authenticity could not be verified. Issuer is outside of trust network: ${c(v?.issuer)}`)}}}catch{m.errors.push("Boost authenticity could not be verified.")}return m}}}},"getVerifyBoostPlugin");
4
+ `.trim();async function uc(n,e,s){try{let l=e.middlewares[n];return await l({...s,meta:e.meta,input:s.input,next(g){let y=g;return uc(n+1,e,{...s,ctx:y?.ctx?{...s.ctx,...y.ctx}:s.ctx,input:y&&"input"in y?y.input:s.input,getRawInput:y?.getRawInput??s.getRawInput})}})}catch(l){return{ok:!1,error:or(l),marker:to}}}b(uc,"callRecursive");function Xl(n){async function e(s){if(!s||!("getRawInput"in s))throw new Error(Kl);let l=await uc(0,n,s);if(!l)throw new Le({code:"INTERNAL_SERVER_ERROR",message:"No result from middlewares - did you forget to `return next()`?"});if(!l.ok)throw l.error;return l.data}return b(e,"procedure"),e._def=n,e.procedure=!0,e.meta=n.meta,e}b(Xl,"createProcedureCaller");var ao=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 Sn=class{context(){return new Sn}meta(){return new Sn}create(e){let s={...e,transformer:ps(e?.transformer??Lr),isDev:e?.isDev??globalThis.process?.env.NODE_ENV!=="production",allowOutsideOfServer:e?.allowOutsideOfServer??!1,errorFormatter:e?.errorFormatter??Dr,isServer:e?.isServer??ao,$types:null};if(!(e?.isServer??ao)&&e?.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:s,procedure:no({meta:e?.defaultMeta}),middleware:Cs(),router:Ki(s),mergeRouters:hs,createCallerFactory:Xi()}}};b(Sn,"TRPCBuilder");var pc=new Sn;function io(n,e,s){return e in n?Object.defineProperty(n,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[e]=s,n}b(io,"_define_property");function ks(n){return n instanceof je}b(ks,"isTRPCClientError");function sd(n){return xe(n)&&xe(n.error)&&typeof n.error.code=="number"&&typeof n.error.message=="string"}b(sd,"isTRPCErrorResponse");function cd(n,e){return typeof n=="string"?n:xe(n)&&typeof n.message=="string"?n.message:e}b(cd,"getMessageFromUnknownError");var je=class extends Error{static from(e,s={}){let l=e;return ks(l)?(s.meta&&(l.meta={...l.meta,...s.meta}),l):sd(l)?new je(l.error.message,{...s,result:l}):new je(cd(l,"Unknown error"),{...s,cause:l})}constructor(e,s){let l=s?.cause;super(e,{cause:l}),io(this,"cause",void 0),io(this,"shape",void 0),io(this,"data",void 0),io(this,"meta",void 0),this.meta=s?.meta,this.cause=l,this.shape=s?.result?.error,this.data=s?.result?.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,je.prototype)}};b(je,"TRPCClientError");function Ss(n,e,s){return e in n?Object.defineProperty(n,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[e]=s,n}b(Ss,"_define_property");var Rn=class{$request(e){return ds({links:this.links,op:{...e,context:e.context??{},id:++this.requestId}}).pipe(ls())}async requestAsPromise(e){try{let s=this.$request(e);return(await cs(s)).result.data}catch(s){throw je.from(s)}}query(e,s,l){return this.requestAsPromise({type:"query",path:e,input:s,context:l?.context,signal:l?.signal})}mutation(e,s,l){return this.requestAsPromise({type:"mutation",path:e,input:s,context:l?.context,signal:l?.signal})}subscription(e,s,l){return this.$request({type:"subscription",path:e,input:s,context:l.context,signal:l.signal}).subscribe({next(g){switch(g.result.type){case"state":{l.onConnectionStateChange?.(g.result);break}case"started":{l.onStarted?.({context:g.context});break}case"stopped":{l.onStopped?.();break}case"data":case void 0:{l.onData?.(g.result.data);break}}},error(g){l.onError?.(g)},complete(){l.onComplete?.()}})}constructor(e){Ss(this,"links",void 0),Ss(this,"runtime",void 0),Ss(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map(s=>s(this.runtime))}};b(Rn,"TRPCUntypedClient");var ld=Symbol.for("trpc_untypedClient"),dd={query:"query",mutate:"mutation",subscribe:"subscription"},gc=b(n=>dd[n],"clientCallTypeToProcedureType");function yc(n){let e=na(({path:s,args:l})=>{let c=[...s],g=gc(c.pop()),y=c.join(".");return n[g](y,...l)});return Ji(s=>s===ld?n:e[s])}b(yc,"createTRPCClientProxy");function oa(n){let e=new Rn(n);return yc(e)}b(oa,"createTRPCClient");var vc=b(n=>typeof n=="function","isFunction");function Rs(n){if(n)return n;if(typeof window<"u"&&vc(window.fetch))return window.fetch;if(typeof globalThis<"u"&&vc(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}b(Rs,"getFetch");var bc=b(()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")},"throwFatalError");function oo(n){let e=null,s=null,l=b(()=>{clearTimeout(s),s=null,e=null},"destroyTimerAndPendingItems");function c(v){let f=[[]],m=0;for(;;){let E=v[m];if(!E)break;let P=f[f.length-1];if(E.aborted){E.reject?.(new Error("Aborted")),m++;continue}if(n.validate(P.concat(E).map(O=>O.key))){P.push(E),m++;continue}if(P.length===0){E.reject?.(new Error("Input is too big for a single dispatch")),m++;continue}f.push([])}return f}b(c,"groupItems");function g(){let v=c(e);l();for(let f of v){if(!f.length)continue;let m={items:f};for(let P of f)P.batch=m;n.fetch(m.items.map(P=>P.key)).then(async P=>{await Promise.all(P.map(async(z,O)=>{let oe=m.items[O];try{let j=await Promise.resolve(z);oe.resolve?.(j)}catch(j){oe.reject?.(j)}oe.batch=null,oe.reject=null,oe.resolve=null}));for(let z of m.items)z.reject?.(new Error("Missing result")),z.batch=null}).catch(P=>{for(let z of m.items)z.reject?.(P),z.batch=null})}}b(g,"dispatch");function y(v){let f={aborted:!1,key:v,batch:null,resolve:bc,reject:bc},m=new Promise((E,P)=>{f.reject=P,f.resolve=E,e??(e=[]),e.push(f)});return s??(s=setTimeout(g)),m}return b(y,"load"),{load:y}}b(oo,"dataLoader");function Ps(...n){let e=new AbortController,s=n.length,l=0,c=b(()=>{++l===s&&e.abort()},"onAbort");for(let g of n)g?.aborted?c():g?.addEventListener("abort",c,{once:!0});return e.signal}b(Ps,"allAbortSignals");function ei(n){let e=n;return e?"input"in e?e:{input:e,output:e}:{input:{serialize:s=>s,deserialize:s=>s},output:{serialize:s=>s,deserialize:s=>s}}}b(ei,"getTransformer");function co(n){return{url:n.url.toString(),fetch:n.fetch,transformer:ei(n.transformer),methodOverride:n.methodOverride}}b(co,"resolveHTTPLinkOptions");function ud(n){let e={};for(let s=0;s<n.length;s++){let l=n[s];e[s]=l}return e}b(ud,"arrayToDict");var pd={query:"GET",mutation:"POST",subscription:"PATCH"};function _c(n){return"input"in n?n.transformer.input.serialize(n.input):ud(n.inputs.map(e=>n.transformer.input.serialize(e)))}b(_c,"getInput");var sa=b(n=>{let e=n.url.split("?"),l=e[0].replace(/\/$/,"")+"/"+n.path,c=[];if(e[1]&&c.push(e[1]),"inputs"in n&&c.push("batch=1"),n.type==="query"||n.type==="subscription"){let g=_c(n);g!==void 0&&n.methodOverride!=="POST"&&c.push(`input=${encodeURIComponent(JSON.stringify(g))}`)}return c.length&&(l+="?"+c.join("&")),l},"getUrl"),wc=b(n=>{if(n.type==="query"&&n.methodOverride!=="POST")return;let e=_c(n);return e!==void 0?JSON.stringify(e):void 0},"getBody"),Os=b(n=>xc({...n,contentTypeHeader:"application/json",getUrl:sa,getBody:wc}),"jsonHttpRequester"),so=class extends Error{constructor(){let e="AbortError";super(e),this.name=e,this.message=e}};b(so,"AbortError");var fd=b(n=>{if(!!n?.aborted)throw n.throwIfAborted?.(),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new so},"throwIfAborted");async function Cc(n){fd(n.signal);let e=n.getUrl(n),s=n.getBody(n),{type:l}=n,c=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,...c};return Rs(n.fetch)(e,{method:n.methodOverride??pd[l],signal:n.signal,body:s,headers:g})}b(Cc,"fetchHTTPResponse");async function xc(n){let e={},s=await Cc(n);e.response=s;let l=await s.json();return e.responseJSON=l,{json:l,meta:e}}b(xc,"httpRequest");function ti(n){let e=co(n),s=n.maxURLLength??1/0,l=n.maxItems??1/0;return()=>{let c=b(f=>({validate(m){if(s===1/0&&l===1/0)return!0;if(m.length>l)return!1;let E=m.map(O=>O.path).join(","),P=m.map(O=>O.input);return sa({...e,type:f,path:E,inputs:P,signal:null}).length<=s},async fetch(m){let E=m.map(ke=>ke.path).join(","),P=m.map(ke=>ke.input),z=Ps(...m.map(ke=>ke.signal)),O=await Os({...e,path:E,inputs:P,type:f,headers(){return n.headers?typeof n.headers=="function"?n.headers({opList:m}):n.headers:{}},signal:z});return(Array.isArray(O.json)?O.json:m.map(()=>O.json)).map(ke=>({meta:O.meta,json:ke}))}}),"batchLoader"),g=oo(c("query")),y=oo(c("mutation")),v={query:g,mutation:y};return({op:f})=>De(m=>{if(f.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");let P=v[f.type].load(f),z;return P.then(O=>{z=O;let oe=Xa(O.json,e.transformer.output);if(!oe.ok){m.error(je.from(oe.error,{meta:O.meta}));return}m.next({context:O.meta,result:oe.result}),m.complete()}).catch(O=>{m.error(je.from(O,{meta:z?.meta}))}),()=>{}})}}b(ti,"httpBatchLink");var lo=b((n,...e)=>typeof n=="function"?n(...e):n,"resultOf");function js(){let n,e;return{promise:new Promise((l,c)=>{n=l,e=c}),resolve:n,reject:e}}b(js,"withResolvers");async function Tc(n){let e=await lo(n.url);if(!n.connectionParams)return e;let l=`${e.includes("?")?"&":"?"}connectionParams=1`;return e+l}b(Tc,"prepareUrl");async function kc(n){let e={method:"connectionParams",data:await lo(n)};return JSON.stringify(e)}b(kc,"buildConnectionMessage");function Pn(n,e,s){return e in n?Object.defineProperty(n,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[e]=s,n}b(Pn,"_define_property");function gd(n){let{promise:e,resolve:s,reject:l}=js();return n.addEventListener("open",()=>{n.removeEventListener("error",l),s()}),n.addEventListener("error",l),e}b(gd,"asyncWsOpen");function yd(n,{intervalMs:e,pongTimeoutMs:s}){let l,c;function g(){l=setTimeout(()=>{n.send("PING"),c=setTimeout(()=>{n.close()},s)},e)}b(g,"start");function y(){clearTimeout(l),g()}b(y,"reset");function v(){clearTimeout(c),y()}b(v,"pong"),n.addEventListener("open",g),n.addEventListener("message",({data:f})=>{clearTimeout(l),g(),f==="PONG"&&v()}),n.addEventListener("close",()=>{clearTimeout(l),clearTimeout(c)})}b(yd,"setupPingInterval");var Ur=class{get ws(){return this.wsObservable.get()}set ws(e){this.wsObservable.next(e)}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=++Ur.connectCount;let e=Tc(this.urlOptions).then(s=>new this.WebSocketPonyfill(s));this.openPromise=e.then(async s=>{this.ws=s,s.addEventListener("message",function({data:l}){l==="PING"&&this.send("PONG")}),this.keepAliveOpts.enabled&&yd(s,this.keepAliveOpts),s.addEventListener("close",()=>{this.ws===s&&(this.ws=null)}),await gd(s),this.urlOptions.connectionParams&&s.send(await kc(this.urlOptions.connectionParams))});try{await this.openPromise}finally{this.openPromise=null}}async close(){try{await this.openPromise}finally{this.ws?.close()}}constructor(e){if(Pn(this,"id",++Ur.connectCount),Pn(this,"WebSocketPonyfill",void 0),Pn(this,"urlOptions",void 0),Pn(this,"keepAliveOpts",void 0),Pn(this,"wsObservable",ra(null)),Pn(this,"openPromise",null),this.WebSocketPonyfill=e.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=e.urlOptions,this.keepAliveOpts=e.keepAlive}};b(Ur,"WsConnection");Pn(Ur,"connectCount",0);function bd(n){return n}b(bd,"identity");function _d(n){return n.length===0?bd:n.length===1?n[0]:b(function(s){return n.reduce((l,c)=>c(l),s)},"piped")}b(_d,"pipeFromArray");function Vs(n){let e={subscribe(s){let l=null,c=!1,g=!1,y=!1;function v(){if(l===null){y=!0;return}g||(g=!0,typeof l=="function"?l():l&&l.unsubscribe())}return b(v,"unsubscribe"),l=n({next(f){c||s.next?.(f)},error(f){c||(c=!0,s.error?.(f),v())},complete(){c||(c=!0,s.complete?.(),v())}}),y&&v(),{unsubscribe:v}},pipe(...s){return _d(s)(e)}};return e}b(Vs,"observable");var wd=Object.create,Is=Object.defineProperty,Cd=Object.getOwnPropertyDescriptor,Rc=Object.getOwnPropertyNames,xd=Object.getPrototypeOf,Ed=Object.prototype.hasOwnProperty,ue=b((n,e)=>Is(n,"name",{value:e,configurable:!0}),"__name"),Pc=b((n,e)=>b(function(){return e||(0,n[Rc(n)[0]])((e={exports:{}}).exports,e),e.exports},"__require"),"__commonJS"),Td=b((n,e,s,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of Rc(e))!Ed.call(n,c)&&c!==s&&Is(n,c,{get:()=>e[c],enumerable:!(l=Cd(e,c))||l.enumerable});return n},"__copyProps"),kd=b((n,e,s)=>(s=n!=null?wd(xd(n)):{},Td(e||!n||!n.__esModule?Is(s,"default",{value:n,enumerable:!0}):s,n)),"__toESM"),Sd=Pc({"../../learn-card-helpers/dist/helpers.cjs.development.js"(n,e){var s=Object.create,l=Object.defineProperty,c=Object.getOwnPropertyDescriptor,g=Object.getOwnPropertyNames,y=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty,f=ue((de,ye)=>l(de,"name",{value:ye,configurable:!0}),"__name"),m=ue((de,ye)=>ue(b(function(){return ye||(0,de[g(de)[0]])((ye={exports:{}}).exports,ye),ye.exports},"__require"),"__require"),"__commonJS"),E=ue((de,ye)=>{for(var L in ye)l(de,L,{get:ye[L],enumerable:!0})},"__export"),P=ue((de,ye,L,be)=>{if(ye&&typeof ye=="object"||typeof ye=="function")for(let G of g(ye))!v.call(de,G)&&G!==L&&l(de,G,{get:()=>ye[G],enumerable:!(be=c(ye,G))||be.enumerable});return de},"__copyProps"),z=ue((de,ye,L)=>(L=de!=null?s(y(de)):{},P(ye||!de||!de.__esModule?l(L,"default",{value:de,enumerable:!0}):L,de)),"__toESM"),O=ue(de=>P(l({},"__esModule",{value:!0}),de),"__toCommonJS"),oe=m({"../learn-card-types/dist/types.cjs.development.js"(de,ye){"use strict";var L=Object.defineProperty,be=Object.getOwnPropertyDescriptor,G=Object.getOwnPropertyNames,fr=Object.prototype.hasOwnProperty,I=f((r,u)=>L(r,"name",{value:u,configurable:!0}),"__name"),ma=f((r,u)=>{for(var h in u)L(r,h,{get:u[h],enumerable:!0})},"__export"),ga=f((r,u,h,C)=>{if(u&&typeof u=="object"||typeof u=="function")for(let w of G(u))!fr.call(r,w)&&w!==h&&L(r,w,{get:()=>u[w],enumerable:!(C=be(u,w))||C.enumerable});return r},"__copyProps"),rn=f(r=>ga(L({},"__esModule",{value:!0}),r),"__toCommonJS"),hr={};ma(hr,{AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX:()=>p,AchievementCredentialValidator:()=>Uo,AchievementCriteriaValidator:()=>mi,AchievementSubjectValidator:()=>Da,AchievementTypeValidator:()=>_i,AchievementValidator:()=>pe,AddressValidator:()=>gi,AlignmentTargetTypeValidator:()=>vi,AlignmentValidator:()=>_n,AuthGrantQueryValidator:()=>T,AuthGrantStatusValidator:()=>k,AuthGrantValidator:()=>x,AutoBoostConfigValidator:()=>Ui,BoostPermissionsQueryValidator:()=>Ai,BoostPermissionsValidator:()=>Cn,BoostQueryValidator:()=>Jo,BoostRecipientValidator:()=>Li,BoostRecipientWithChildrenValidator:()=>En,BoostValidator:()=>Mi,ClaimHookQueryValidator:()=>Ni,ClaimHookTypeValidator:()=>xn,ClaimHookValidator:()=>Ii,ClaimTokenValidator:()=>yl,ConsentFlowContractDataForDidValidator:()=>Fa,ConsentFlowContractDataValidator:()=>$a,ConsentFlowContractDetailsValidator:()=>ir,ConsentFlowContractQueryValidator:()=>qi,ConsentFlowContractValidator:()=>za,ConsentFlowDataForDidQueryValidator:()=>zi,ConsentFlowDataQueryValidator:()=>ns,ConsentFlowTermValidator:()=>Wa,ConsentFlowTermsQueryValidator:()=>$i,ConsentFlowTermsStatusValidator:()=>qa,ConsentFlowTermsValidator:()=>ea,ConsentFlowTransactionActionValidator:()=>Nr,ConsentFlowTransactionValidator:()=>Ga,ConsentFlowTransactionsQueryValidator:()=>as,ContactMethodCreateValidator:()=>we,ContactMethodQueryValidator:()=>ta,ContactMethodValidator:()=>A,ContactMethodVerificationRequestValidator:()=>Qa,ContactMethodVerificationValidator:()=>ul,ContextValidator:()=>Vr,ContractCredentialValidator:()=>Ha,CredentialInfoValidator:()=>Ti,CredentialRecordValidator:()=>Yn,CredentialSchemaValidator:()=>$n,CredentialStatusValidator:()=>Ar,CredentialSubjectValidator:()=>yn,CriteriaValidator:()=>Oe,DidDocumentValidator:()=>Zo,EncryptedCredentialRecordValidator:()=>wn,EncryptedRecordValidator:()=>Kn,EndorsementCredentialValidator:()=>wi,EndorsementSubjectValidator:()=>Jn,EvidenceValidator:()=>Ei,FlatAuthGrantValidator:()=>_,FullClaimHookValidator:()=>Di,GeoCoordinatesValidator:()=>Ta,IdentifierEntryValidator:()=>rr,IdentifierTypeValidator:()=>ka,IdentityObjectValidator:()=>Na,ImageValidator:()=>et,InboxCredentialQueryValidator:()=>hl,InboxCredentialValidator:()=>Hs,IssueInboxCredentialResponseValidator:()=>gl,IssueInboxCredentialValidator:()=>ml,IssueInboxSigningAuthorityValidator:()=>Js,JWERecipientHeaderValidator:()=>Oa,JWERecipientValidator:()=>ja,JWEValidator:()=>yi,JWKValidator:()=>bn,JWKWithPrivateKeyValidator:()=>Pa,KnownAchievementTypeValidator:()=>bi,LCNBoostClaimLinkOptionsValidator:()=>Ko,LCNBoostClaimLinkSigningAuthorityValidator:()=>Ua,LCNBoostStatus:()=>Ir,LCNInboxContactMethodValidator:()=>Wi,LCNInboxStatusEnumValidator:()=>Tn,LCNNotificationDataValidator:()=>t,LCNNotificationInboxValidator:()=>Gi,LCNNotificationMessageValidator:()=>Ja,LCNNotificationTypeEnumValidator:()=>Fi,LCNNotificationValidator:()=>d,LCNProfileConnectionStatusEnum:()=>Wo,LCNProfileDisplayValidator:()=>Oi,LCNProfileManagerQueryValidator:()=>Ho,LCNProfileManagerValidator:()=>Xn,LCNProfileQueryValidator:()=>$o,LCNProfileValidator:()=>ft,LCNSigningAuthorityForUserValidator:()=>Xo,LCNSigningAuthorityValidator:()=>Ba,PaginatedBoostRecipientsValidator:()=>Zi,PaginatedBoostRecipientsWithChildrenValidator:()=>Yo,PaginatedBoostsValidator:()=>Qo,PaginatedClaimHooksValidator:()=>Za,PaginatedConsentFlowContractsValidator:()=>Bi,PaginatedConsentFlowDataForDidValidator:()=>ts,PaginatedConsentFlowDataValidator:()=>es,PaginatedConsentFlowTermsValidator:()=>rs,PaginatedConsentFlowTransactionsValidator:()=>is,PaginatedContractCredentialsValidator:()=>os,PaginatedEncryptedCredentialRecordsValidator:()=>Si,PaginatedEncryptedRecordsValidator:()=>zo,PaginatedInboxCredentialsValidator:()=>fl,PaginatedLCNProfileManagersValidator:()=>Go,PaginatedLCNProfilesAndManagersValidator:()=>ji,PaginatedLCNProfilesValidator:()=>Fo,PaginationOptionsValidator:()=>ki,PaginationResponseValidator:()=>Ne,ProfileValidator:()=>nr,ProofValidator:()=>tt,RefreshServiceValidator:()=>Fn,RegExpValidator:()=>Pi,RelatedValidator:()=>Va,ResultDescriptionValidator:()=>Ia,ResultStatusTypeValidator:()=>pt,ResultTypeValidator:()=>Ci,ResultValidator:()=>xi,RubricCriterionValidator:()=>Aa,SentCredentialInfoValidator:()=>Vi,ServiceValidator:()=>Hn,SetPrimaryContactMethodValidator:()=>pl,StringQuery:()=>fe,TermsOfUseValidator:()=>Wn,UnsignedAchievementCredentialValidator:()=>Qn,UnsignedVCValidator:()=>ar,UnsignedVPValidator:()=>Sa,VC2EvidenceValidator:()=>Gn,VCValidator:()=>vn,VPValidator:()=>Ra,VerificationCheckValidator:()=>Bo,VerificationItemValidator:()=>La,VerificationMethodValidator:()=>Bt,VerificationStatusEnum:()=>qo,VerificationStatusValidator:()=>Ma}),ye.exports=rn(hr);var le;(function(r){r.assertEqual=w=>w;function u(w){}b(u,"assertIs"),ue(u,"assertIs"),f(u,"assertIs"),I(u,"assertIs"),r.assertIs=u;function h(w){throw new Error}b(h,"assertNever"),ue(h,"assertNever"),f(h,"assertNever"),I(h,"assertNever"),r.assertNever=h,r.arrayToEnum=w=>{let R={};for(let S of w)R[S]=S;return R},r.getValidEnumValues=w=>{let R=r.objectKeys(w).filter(M=>typeof w[w[M]]!="number"),S={};for(let M of R)S[M]=w[M];return r.objectValues(S)},r.objectValues=w=>r.objectKeys(w).map(function(R){return w[R]}),r.objectKeys=typeof Object.keys=="function"?w=>Object.keys(w):w=>{let R=[];for(let S in w)Object.prototype.hasOwnProperty.call(w,S)&&R.push(S);return R},r.find=(w,R)=>{for(let S of w)if(R(S))return S},r.isInteger=typeof Number.isInteger=="function"?w=>Number.isInteger(w):w=>typeof w=="number"&&isFinite(w)&&Math.floor(w)===w;function C(w,R=" | "){return w.map(S=>typeof S=="string"?`'${S}'`:S).join(R)}b(C,"joinValues"),ue(C,"joinValues"),f(C,"joinValues"),I(C,"joinValues"),r.joinValues=C,r.jsonStringifyReplacer=(w,R)=>typeof R=="bigint"?R.toString():R})(le||(le={}));var mr;(function(r){r.mergeShapes=(u,h)=>({...u,...h})})(mr||(mr={}));var V=le.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Qe=I(r=>{switch(typeof r){case"undefined":return V.undefined;case"string":return V.string;case"number":return isNaN(r)?V.nan:V.number;case"boolean":return V.boolean;case"function":return V.function;case"bigint":return V.bigint;case"symbol":return V.symbol;case"object":return Array.isArray(r)?V.array:r===null?V.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?V.promise:typeof Map<"u"&&r instanceof Map?V.map:typeof Set<"u"&&r instanceof Set?V.set:typeof Date<"u"&&r instanceof Date?V.date:V.object;default:return V.unknown}},"getParsedType"),Z=le.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"]),it=I(r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),Ze=f(class extends Error{constructor(r){super(),this.issues=[],this.addIssue=h=>{this.issues=[...this.issues,h]},this.addIssues=(h=[])=>{this.issues=[...this.issues,...h]};let u=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,u):this.__proto__=u,this.name="ZodError",this.issues=r}get errors(){return this.issues}format(r){let u=r||function(w){return w.message},h={_errors:[]},C=I(w=>{for(let R of w.issues)if(R.code==="invalid_union")R.unionErrors.map(C);else if(R.code==="invalid_return_type")C(R.returnTypeError);else if(R.code==="invalid_arguments")C(R.argumentsError);else if(R.path.length===0)h._errors.push(u(R));else{let S=h,M=0;for(;M<R.path.length;){let N=R.path[M];M===R.path.length-1?(S[N]=S[N]||{_errors:[]},S[N]._errors.push(u(R))):S[N]=S[N]||{_errors:[]},S=S[N],M++}}},"processError");return C(this),h}static assert(r){if(!(r instanceof Ze))throw new Error(`Not a ZodError: ${r}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,le.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(r=u=>u.message){let u={},h=[];for(let C of this.issues)C.path.length>0?(u[C.path[0]]=u[C.path[0]]||[],u[C.path[0]].push(r(C))):h.push(r(C));return{formErrors:h,fieldErrors:u}}get formErrors(){return this.flatten()}},"ZodError");I(Ze,"ZodError"),Ze.create=r=>new Ze(r);var Y=I((r,u)=>{let h;switch(r.code){case Z.invalid_type:r.received===V.undefined?h="Required":h=`Expected ${r.expected}, received ${r.received}`;break;case Z.invalid_literal:h=`Invalid literal value, expected ${JSON.stringify(r.expected,le.jsonStringifyReplacer)}`;break;case Z.unrecognized_keys:h=`Unrecognized key(s) in object: ${le.joinValues(r.keys,", ")}`;break;case Z.invalid_union:h="Invalid input";break;case Z.invalid_union_discriminator:h=`Invalid discriminator value. Expected ${le.joinValues(r.options)}`;break;case Z.invalid_enum_value:h=`Invalid enum value. Expected ${le.joinValues(r.options)}, received '${r.received}'`;break;case Z.invalid_arguments:h="Invalid function arguments";break;case Z.invalid_return_type:h="Invalid function return type";break;case Z.invalid_date:h="Invalid date";break;case Z.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(h=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(h=`${h} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?h=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?h=`Invalid input: must end with "${r.validation.endsWith}"`:le.assertNever(r.validation):r.validation!=="regex"?h=`Invalid ${r.validation}`:h="Invalid";break;case Z.too_small:r.type==="array"?h=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?h=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?h=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?h=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:h="Invalid input";break;case Z.too_big:r.type==="array"?h=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?h=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?h=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?h=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?h=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:h="Invalid input";break;case Z.custom:h="Invalid input";break;case Z.invalid_intersection_types:h="Intersection results could not be merged";break;case Z.not_multiple_of:h=`Number must be a multiple of ${r.multipleOf}`;break;case Z.not_finite:h="Number must be finite";break;default:h=u.defaultError,le.assertNever(r)}return{message:h}},"errorMap"),ie=Y;function Ln(r){ie=r}b(Ln,"setErrorMap"),ue(Ln,"setErrorMap"),f(Ln,"setErrorMap"),I(Ln,"setErrorMap");function Wt(){return ie}b(Wt,"getErrorMap"),ue(Wt,"getErrorMap"),f(Wt,"getErrorMap"),I(Wt,"getErrorMap");var Zn=I(r=>{let{data:u,path:h,errorMaps:C,issueData:w}=r,R=[...h,...w.path||[]],S={...w,path:R};if(w.message!==void 0)return{...w,path:R,message:w.message};let M="",N=C.filter(ae=>!!ae).slice().reverse();for(let ae of N)M=ae(S,{data:u,defaultError:M}).message;return{...w,path:R,message:M}},"makeIssue"),wo=[];function B(r,u){let h=Wt(),C=Zn({issueData:u,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,h,h===Y?void 0:Y].filter(w=>!!w)});r.common.issues.push(C)}b(B,"addIssueToContext"),ue(B,"addIssueToContext"),f(B,"addIssueToContext"),I(B,"addIssueToContext");var Ae=f(class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(r,u){let h=[];for(let C of u){if(C.status==="aborted")return X;C.status==="dirty"&&r.dirty(),h.push(C.value)}return{status:r.value,value:h}}static async mergeObjectAsync(r,u){let h=[];for(let C of u){let w=await C.key,R=await C.value;h.push({key:w,value:R})}return Ae.mergeObjectSync(r,h)}static mergeObjectSync(r,u){let h={};for(let C of u){let{key:w,value:R}=C;if(w.status==="aborted"||R.status==="aborted")return X;w.status==="dirty"&&r.dirty(),R.status==="dirty"&&r.dirty(),w.value!=="__proto__"&&(typeof R.value<"u"||C.alwaysSet)&&(h[w.value]=R.value)}return{status:r.value,value:h}}},"ParseStatus");I(Ae,"ParseStatus");var X=Object.freeze({status:"aborted"}),gr=I(r=>({status:"dirty",value:r}),"DIRTY"),Pe=I(r=>({status:"valid",value:r}),"OK"),ya=I(r=>r.status==="aborted","isAborted"),va=I(r=>r.status==="dirty","isDirty"),nn=I(r=>r.status==="valid","isValid"),yr=I(r=>typeof Promise<"u"&&r instanceof Promise,"isAsync");function Gt(r,u,h,C){if(h==="a"&&!C)throw new TypeError("Private accessor was defined without a getter");if(typeof u=="function"?r!==u||!C:!u.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return h==="m"?C:h==="a"?C.call(r):C?C.value:u.get(r)}b(Gt,"__classPrivateFieldGet"),ue(Gt,"__classPrivateFieldGet"),f(Gt,"__classPrivateFieldGet"),I(Gt,"__classPrivateFieldGet");function Ot(r,u,h,C,w){if(C==="m")throw new TypeError("Private method is not writable");if(C==="a"&&!w)throw new TypeError("Private accessor was defined without a setter");if(typeof u=="function"?r!==u||!w:!u.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return C==="a"?w.call(r,h):w?w.value=h:u.set(r,h),h}b(Ot,"__classPrivateFieldSet"),ue(Ot,"__classPrivateFieldSet"),f(Ot,"__classPrivateFieldSet"),I(Ot,"__classPrivateFieldSet");var W;(function(r){r.errToObj=u=>typeof u=="string"?{message:u}:u||{},r.toString=u=>typeof u=="string"?u:u?.message})(W||(W={}));var jt,Ht,Ce=f(class{constructor(r,u,h,C){this._cachedPath=[],this.parent=r,this.data=u,this._path=h,this._key=C}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");I(Ce,"ParseInputLazyPath");var Un=I((r,u)=>{if(nn(u))return{success:!0,data:u.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let h=new Ze(r.common.issues);return this._error=h,this._error}}},"handleResult");function Q(r){if(!r)return{};let{errorMap:u,invalid_type_error:h,required_error:C,description:w}=r;if(u&&(h||C))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return u?{errorMap:u,description:w}:{errorMap:I((S,M)=>{var N,ae;let{message:Te}=r;return S.code==="invalid_enum_value"?{message:Te??M.defaultError}:typeof M.data>"u"?{message:(N=Te??C)!==null&&N!==void 0?N:M.defaultError}:S.code!=="invalid_type"?{message:M.defaultError}:{message:(ae=Te??h)!==null&&ae!==void 0?ae:M.defaultError}},"customMap"),description:w}}b(Q,"processCreateParams"),ue(Q,"processCreateParams"),f(Q,"processCreateParams"),I(Q,"processCreateParams");var ee=f(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 Qe(r.data)}_getOrReturnCtx(r,u){return u||{common:r.parent.common,data:r.data,parsedType:Qe(r.data),schemaErrorMap:this._def.errorMap,path:r.path,parent:r.parent}}_processInputParams(r){return{status:new Ae,ctx:{common:r.parent.common,data:r.data,parsedType:Qe(r.data),schemaErrorMap:this._def.errorMap,path:r.path,parent:r.parent}}}_parseSync(r){let u=this._parse(r);if(yr(u))throw new Error("Synchronous parse encountered promise.");return u}_parseAsync(r){let u=this._parse(r);return Promise.resolve(u)}parse(r,u){let h=this.safeParse(r,u);if(h.success)return h.data;throw h.error}safeParse(r,u){var h;let C={common:{issues:[],async:(h=u?.async)!==null&&h!==void 0?h:!1,contextualErrorMap:u?.errorMap},path:u?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:Qe(r)},w=this._parseSync({data:r,path:C.path,parent:C});return Un(C,w)}async parseAsync(r,u){let h=await this.safeParseAsync(r,u);if(h.success)return h.data;throw h.error}async safeParseAsync(r,u){let h={common:{issues:[],contextualErrorMap:u?.errorMap,async:!0},path:u?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:Qe(r)},C=this._parse({data:r,path:h.path,parent:h}),w=await(yr(C)?C:Promise.resolve(C));return Un(h,w)}refine(r,u){let h=I(C=>typeof u=="string"||typeof u>"u"?{message:u}:typeof u=="function"?u(C):u,"getIssueProperties");return this._refinement((C,w)=>{let R=r(C),S=I(()=>w.addIssue({code:Z.custom,...h(C)}),"setError");return typeof Promise<"u"&&R instanceof Promise?R.then(M=>M?!0:(S(),!1)):R?!0:(S(),!1)})}refinement(r,u){return this._refinement((h,C)=>r(h)?!0:(C.addIssue(typeof u=="function"?u(h,C):u),!1))}_refinement(r){return new Xe({schema:this,typeName:K.ZodEffects,effect:{type:"refinement",refinement:r}})}superRefine(r){return this._refinement(r)}optional(){return dt.create(this,this._def)}nullable(){return xt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ie.create(this,this._def)}promise(){return er.create(this,this._def)}or(r){return wr.create([this,r],this._def)}and(r){return Ct.create(this,r,this._def)}transform(r){return new Xe({...Q(this._def),schema:this,typeName:K.ZodEffects,effect:{type:"transform",transform:r}})}default(r){let u=typeof r=="function"?r:()=>r;return new kr({...Q(this._def),innerType:this,defaultValue:u,typeName:K.ZodDefault})}brand(){return new Bn({typeName:K.ZodBranded,type:this,...Q(this._def)})}catch(r){let u=typeof r=="function"?r:()=>r;return new Sr({...Q(this._def),innerType:this,catchValue:u,typeName:K.ZodCatch})}describe(r){let u=this.constructor;return new u({...this._def,description:r})}pipe(r){return cn.create(this,r)}readonly(){return Rr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},"ZodType");I(ee,"ZodType");var vr=/^c[^\s-]{8,}$/i,Jt=/^[0-9a-z]+$/,an=/^[0-9A-HJKMNP-TV-Z]{26}$/,br=/^[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,_r=/^[a-z0-9_-]{21}$/i,Qt=/^[-+]?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)?)??$/,Vt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,yt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Yt,ot=/^(?:(?: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])$/,At=/^(([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})))$/,_e=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Kt="((\\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])))",wt=new RegExp(`^${Kt}$`);function It(r){let u="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return r.precision?u=`${u}\\.\\d{${r.precision}}`:r.precision==null&&(u=`${u}(\\.\\d+)?`),u}b(It,"timeRegexSource"),ue(It,"timeRegexSource"),f(It,"timeRegexSource"),I(It,"timeRegexSource");function Nt(r){return new RegExp(`^${It(r)}$`)}b(Nt,"timeRegex"),ue(Nt,"timeRegex"),f(Nt,"timeRegex"),I(Nt,"timeRegex");function vt(r){let u=`${Kt}T${It(r)}`,h=[];return h.push(r.local?"Z?":"Z"),r.offset&&h.push("([+-]\\d{2}:?\\d{2})"),u=`${u}(${h.join("|")})`,new RegExp(`^${u}$`)}b(vt,"datetimeRegex"),ue(vt,"datetimeRegex"),f(vt,"datetimeRegex"),I(vt,"datetimeRegex");function ze(r,u){return!!((u==="v4"||!u)&&ot.test(r)||(u==="v6"||!u)&&At.test(r))}b(ze,"isValidIP"),ue(ze,"isValidIP"),f(ze,"isValidIP"),I(ze,"isValidIP");var Me=f(class extends ee{_parse(r){if(this._def.coerce&&(r.data=String(r.data)),this._getType(r)!==V.string){let w=this._getOrReturnCtx(r);return B(w,{code:Z.invalid_type,expected:V.string,received:w.parsedType}),X}let h=new Ae,C;for(let w of this._def.checks)if(w.kind==="min")r.data.length<w.value&&(C=this._getOrReturnCtx(r,C),B(C,{code:Z.too_small,minimum:w.value,type:"string",inclusive:!0,exact:!1,message:w.message}),h.dirty());else if(w.kind==="max")r.data.length>w.value&&(C=this._getOrReturnCtx(r,C),B(C,{code:Z.too_big,maximum:w.value,type:"string",inclusive:!0,exact:!1,message:w.message}),h.dirty());else if(w.kind==="length"){let R=r.data.length>w.value,S=r.data.length<w.value;(R||S)&&(C=this._getOrReturnCtx(r,C),R?B(C,{code:Z.too_big,maximum:w.value,type:"string",inclusive:!0,exact:!0,message:w.message}):S&&B(C,{code:Z.too_small,minimum:w.value,type:"string",inclusive:!0,exact:!0,message:w.message}),h.dirty())}else if(w.kind==="email")Vt.test(r.data)||(C=this._getOrReturnCtx(r,C),B(C,{validation:"email",code:Z.invalid_string,message:w.message}),h.dirty());else if(w.kind==="emoji")Yt||(Yt=new RegExp(yt,"u")),Yt.test(r.data)||(C=this._getOrReturnCtx(r,C),B(C,{validation:"emoji",code:Z.invalid_string,message:w.message}),h.dirty());else if(w.kind==="uuid")br.test(r.data)||(C=this._getOrReturnCtx(r,C),B(C,{validation:"uuid",code:Z.invalid_string,message:w.message}),h.dirty());else if(w.kind==="nanoid")_r.test(r.data)||(C=this._getOrReturnCtx(r,C),B(C,{validation:"nanoid",code:Z.invalid_string,message:w.message}),h.dirty());else if(w.kind==="cuid")vr.test(r.data)||(C=this._getOrReturnCtx(r,C),B(C,{validation:"cuid",code:Z.invalid_string,message:w.message}),h.dirty());else if(w.kind==="cuid2")Jt.test(r.data)||(C=this._getOrReturnCtx(r,C),B(C,{validation:"cuid2",code:Z.invalid_string,message:w.message}),h.dirty());else if(w.kind==="ulid")an.test(r.data)||(C=this._getOrReturnCtx(r,C),B(C,{validation:"ulid",code:Z.invalid_string,message:w.message}),h.dirty());else if(w.kind==="url")try{new URL(r.data)}catch{C=this._getOrReturnCtx(r,C),B(C,{validation:"url",code:Z.invalid_string,message:w.message}),h.dirty()}else w.kind==="regex"?(w.regex.lastIndex=0,w.regex.test(r.data)||(C=this._getOrReturnCtx(r,C),B(C,{validation:"regex",code:Z.invalid_string,message:w.message}),h.dirty())):w.kind==="trim"?r.data=r.data.trim():w.kind==="includes"?r.data.includes(w.value,w.position)||(C=this._getOrReturnCtx(r,C),B(C,{code:Z.invalid_string,validation:{includes:w.value,position:w.position},message:w.message}),h.dirty()):w.kind==="toLowerCase"?r.data=r.data.toLowerCase():w.kind==="toUpperCase"?r.data=r.data.toUpperCase():w.kind==="startsWith"?r.data.startsWith(w.value)||(C=this._getOrReturnCtx(r,C),B(C,{code:Z.invalid_string,validation:{startsWith:w.value},message:w.message}),h.dirty()):w.kind==="endsWith"?r.data.endsWith(w.value)||(C=this._getOrReturnCtx(r,C),B(C,{code:Z.invalid_string,validation:{endsWith:w.value},message:w.message}),h.dirty()):w.kind==="datetime"?vt(w).test(r.data)||(C=this._getOrReturnCtx(r,C),B(C,{code:Z.invalid_string,validation:"datetime",message:w.message}),h.dirty()):w.kind==="date"?wt.test(r.data)||(C=this._getOrReturnCtx(r,C),B(C,{code:Z.invalid_string,validation:"date",message:w.message}),h.dirty()):w.kind==="time"?Nt(w).test(r.data)||(C=this._getOrReturnCtx(r,C),B(C,{code:Z.invalid_string,validation:"time",message:w.message}),h.dirty()):w.kind==="duration"?Qt.test(r.data)||(C=this._getOrReturnCtx(r,C),B(C,{validation:"duration",code:Z.invalid_string,message:w.message}),h.dirty()):w.kind==="ip"?ze(r.data,w.version)||(C=this._getOrReturnCtx(r,C),B(C,{validation:"ip",code:Z.invalid_string,message:w.message}),h.dirty()):w.kind==="base64"?_e.test(r.data)||(C=this._getOrReturnCtx(r,C),B(C,{validation:"base64",code:Z.invalid_string,message:w.message}),h.dirty()):le.assertNever(w);return{status:h.value,value:r.data}}_regex(r,u,h){return this.refinement(C=>r.test(C),{validation:u,code:Z.invalid_string,...W.errToObj(h)})}_addCheck(r){return new Me({...this._def,checks:[...this._def.checks,r]})}email(r){return this._addCheck({kind:"email",...W.errToObj(r)})}url(r){return this._addCheck({kind:"url",...W.errToObj(r)})}emoji(r){return this._addCheck({kind:"emoji",...W.errToObj(r)})}uuid(r){return this._addCheck({kind:"uuid",...W.errToObj(r)})}nanoid(r){return this._addCheck({kind:"nanoid",...W.errToObj(r)})}cuid(r){return this._addCheck({kind:"cuid",...W.errToObj(r)})}cuid2(r){return this._addCheck({kind:"cuid2",...W.errToObj(r)})}ulid(r){return this._addCheck({kind:"ulid",...W.errToObj(r)})}base64(r){return this._addCheck({kind:"base64",...W.errToObj(r)})}ip(r){return this._addCheck({kind:"ip",...W.errToObj(r)})}datetime(r){var u,h;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:(u=r?.offset)!==null&&u!==void 0?u:!1,local:(h=r?.local)!==null&&h!==void 0?h:!1,...W.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,...W.errToObj(r?.message)})}duration(r){return this._addCheck({kind:"duration",...W.errToObj(r)})}regex(r,u){return this._addCheck({kind:"regex",regex:r,...W.errToObj(u)})}includes(r,u){return this._addCheck({kind:"includes",value:r,position:u?.position,...W.errToObj(u?.message)})}startsWith(r,u){return this._addCheck({kind:"startsWith",value:r,...W.errToObj(u)})}endsWith(r,u){return this._addCheck({kind:"endsWith",value:r,...W.errToObj(u)})}min(r,u){return this._addCheck({kind:"min",value:r,...W.errToObj(u)})}max(r,u){return this._addCheck({kind:"max",value:r,...W.errToObj(u)})}length(r,u){return this._addCheck({kind:"length",value:r,...W.errToObj(u)})}nonempty(r){return this.min(1,W.errToObj(r))}trim(){return new Me({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Me({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Me({...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 u of this._def.checks)u.kind==="min"&&(r===null||u.value>r)&&(r=u.value);return r}get maxLength(){let r=null;for(let u of this._def.checks)u.kind==="max"&&(r===null||u.value<r)&&(r=u.value);return r}},"ZodString");I(Me,"ZodString"),Me.create=r=>{var u;return new Me({checks:[],typeName:K.ZodString,coerce:(u=r?.coerce)!==null&&u!==void 0?u:!1,...Q(r)})};function Dt(r,u){let h=(r.toString().split(".")[1]||"").length,C=(u.toString().split(".")[1]||"").length,w=h>C?h:C,R=parseInt(r.toFixed(w).replace(".","")),S=parseInt(u.toFixed(w).replace(".",""));return R%S/Math.pow(10,w)}b(Dt,"floatSafeRemainder"),ue(Dt,"floatSafeRemainder"),f(Dt,"floatSafeRemainder"),I(Dt,"floatSafeRemainder");var Ue=f(class extends ee{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)!==V.number){let w=this._getOrReturnCtx(r);return B(w,{code:Z.invalid_type,expected:V.number,received:w.parsedType}),X}let h,C=new Ae;for(let w of this._def.checks)w.kind==="int"?le.isInteger(r.data)||(h=this._getOrReturnCtx(r,h),B(h,{code:Z.invalid_type,expected:"integer",received:"float",message:w.message}),C.dirty()):w.kind==="min"?(w.inclusive?r.data<w.value:r.data<=w.value)&&(h=this._getOrReturnCtx(r,h),B(h,{code:Z.too_small,minimum:w.value,type:"number",inclusive:w.inclusive,exact:!1,message:w.message}),C.dirty()):w.kind==="max"?(w.inclusive?r.data>w.value:r.data>=w.value)&&(h=this._getOrReturnCtx(r,h),B(h,{code:Z.too_big,maximum:w.value,type:"number",inclusive:w.inclusive,exact:!1,message:w.message}),C.dirty()):w.kind==="multipleOf"?Dt(r.data,w.value)!==0&&(h=this._getOrReturnCtx(r,h),B(h,{code:Z.not_multiple_of,multipleOf:w.value,message:w.message}),C.dirty()):w.kind==="finite"?Number.isFinite(r.data)||(h=this._getOrReturnCtx(r,h),B(h,{code:Z.not_finite,message:w.message}),C.dirty()):le.assertNever(w);return{status:C.value,value:r.data}}gte(r,u){return this.setLimit("min",r,!0,W.toString(u))}gt(r,u){return this.setLimit("min",r,!1,W.toString(u))}lte(r,u){return this.setLimit("max",r,!0,W.toString(u))}lt(r,u){return this.setLimit("max",r,!1,W.toString(u))}setLimit(r,u,h,C){return new Ue({...this._def,checks:[...this._def.checks,{kind:r,value:u,inclusive:h,message:W.toString(C)}]})}_addCheck(r){return new Ue({...this._def,checks:[...this._def.checks,r]})}int(r){return this._addCheck({kind:"int",message:W.toString(r)})}positive(r){return this._addCheck({kind:"min",value:0,inclusive:!1,message:W.toString(r)})}negative(r){return this._addCheck({kind:"max",value:0,inclusive:!1,message:W.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:0,inclusive:!0,message:W.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:0,inclusive:!0,message:W.toString(r)})}multipleOf(r,u){return this._addCheck({kind:"multipleOf",value:r,message:W.toString(u)})}finite(r){return this._addCheck({kind:"finite",message:W.toString(r)})}safe(r){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:W.toString(r)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:W.toString(r)})}get minValue(){let r=null;for(let u of this._def.checks)u.kind==="min"&&(r===null||u.value>r)&&(r=u.value);return r}get maxValue(){let r=null;for(let u of this._def.checks)u.kind==="max"&&(r===null||u.value<r)&&(r=u.value);return r}get isInt(){return!!this._def.checks.find(r=>r.kind==="int"||r.kind==="multipleOf"&&le.isInteger(r.value))}get isFinite(){let r=null,u=null;for(let h of this._def.checks){if(h.kind==="finite"||h.kind==="int"||h.kind==="multipleOf")return!0;h.kind==="min"?(u===null||h.value>u)&&(u=h.value):h.kind==="max"&&(r===null||h.value<r)&&(r=h.value)}return Number.isFinite(u)&&Number.isFinite(r)}},"ZodNumber");I(Ue,"ZodNumber"),Ue.create=r=>new Ue({checks:[],typeName:K.ZodNumber,coerce:r?.coerce||!1,...Q(r)});var $e=f(class extends ee{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)!==V.bigint){let w=this._getOrReturnCtx(r);return B(w,{code:Z.invalid_type,expected:V.bigint,received:w.parsedType}),X}let h,C=new Ae;for(let w of this._def.checks)w.kind==="min"?(w.inclusive?r.data<w.value:r.data<=w.value)&&(h=this._getOrReturnCtx(r,h),B(h,{code:Z.too_small,type:"bigint",minimum:w.value,inclusive:w.inclusive,message:w.message}),C.dirty()):w.kind==="max"?(w.inclusive?r.data>w.value:r.data>=w.value)&&(h=this._getOrReturnCtx(r,h),B(h,{code:Z.too_big,type:"bigint",maximum:w.value,inclusive:w.inclusive,message:w.message}),C.dirty()):w.kind==="multipleOf"?r.data%w.value!==BigInt(0)&&(h=this._getOrReturnCtx(r,h),B(h,{code:Z.not_multiple_of,multipleOf:w.value,message:w.message}),C.dirty()):le.assertNever(w);return{status:C.value,value:r.data}}gte(r,u){return this.setLimit("min",r,!0,W.toString(u))}gt(r,u){return this.setLimit("min",r,!1,W.toString(u))}lte(r,u){return this.setLimit("max",r,!0,W.toString(u))}lt(r,u){return this.setLimit("max",r,!1,W.toString(u))}setLimit(r,u,h,C){return new $e({...this._def,checks:[...this._def.checks,{kind:r,value:u,inclusive:h,message:W.toString(C)}]})}_addCheck(r){return new $e({...this._def,checks:[...this._def.checks,r]})}positive(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:W.toString(r)})}negative(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:W.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:W.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:W.toString(r)})}multipleOf(r,u){return this._addCheck({kind:"multipleOf",value:r,message:W.toString(u)})}get minValue(){let r=null;for(let u of this._def.checks)u.kind==="min"&&(r===null||u.value>r)&&(r=u.value);return r}get maxValue(){let r=null;for(let u of this._def.checks)u.kind==="max"&&(r===null||u.value<r)&&(r=u.value);return r}},"ZodBigInt");I($e,"ZodBigInt"),$e.create=r=>{var u;return new $e({checks:[],typeName:K.ZodBigInt,coerce:(u=r?.coerce)!==null&&u!==void 0?u:!1,...Q(r)})};var st=f(class extends ee{_parse(r){if(this._def.coerce&&(r.data=Boolean(r.data)),this._getType(r)!==V.boolean){let h=this._getOrReturnCtx(r);return B(h,{code:Z.invalid_type,expected:V.boolean,received:h.parsedType}),X}return Pe(r.data)}},"ZodBoolean");I(st,"ZodBoolean"),st.create=r=>new st({typeName:K.ZodBoolean,coerce:r?.coerce||!1,...Q(r)});var Ye=f(class extends ee{_parse(r){if(this._def.coerce&&(r.data=new Date(r.data)),this._getType(r)!==V.date){let w=this._getOrReturnCtx(r);return B(w,{code:Z.invalid_type,expected:V.date,received:w.parsedType}),X}if(isNaN(r.data.getTime())){let w=this._getOrReturnCtx(r);return B(w,{code:Z.invalid_date}),X}let h=new Ae,C;for(let w of this._def.checks)w.kind==="min"?r.data.getTime()<w.value&&(C=this._getOrReturnCtx(r,C),B(C,{code:Z.too_small,message:w.message,inclusive:!0,exact:!1,minimum:w.value,type:"date"}),h.dirty()):w.kind==="max"?r.data.getTime()>w.value&&(C=this._getOrReturnCtx(r,C),B(C,{code:Z.too_big,message:w.message,inclusive:!0,exact:!1,maximum:w.value,type:"date"}),h.dirty()):le.assertNever(w);return{status:h.value,value:new Date(r.data.getTime())}}_addCheck(r){return new Ye({...this._def,checks:[...this._def.checks,r]})}min(r,u){return this._addCheck({kind:"min",value:r.getTime(),message:W.toString(u)})}max(r,u){return this._addCheck({kind:"max",value:r.getTime(),message:W.toString(u)})}get minDate(){let r=null;for(let u of this._def.checks)u.kind==="min"&&(r===null||u.value>r)&&(r=u.value);return r!=null?new Date(r):null}get maxDate(){let r=null;for(let u of this._def.checks)u.kind==="max"&&(r===null||u.value<r)&&(r=u.value);return r!=null?new Date(r):null}},"ZodDate");I(Ye,"ZodDate"),Ye.create=r=>new Ye({checks:[],coerce:r?.coerce||!1,typeName:K.ZodDate,...Q(r)});var Mt=f(class extends ee{_parse(r){if(this._getType(r)!==V.symbol){let h=this._getOrReturnCtx(r);return B(h,{code:Z.invalid_type,expected:V.symbol,received:h.parsedType}),X}return Pe(r.data)}},"ZodSymbol");I(Mt,"ZodSymbol"),Mt.create=r=>new Mt({typeName:K.ZodSymbol,...Q(r)});var Fe=f(class extends ee{_parse(r){if(this._getType(r)!==V.undefined){let h=this._getOrReturnCtx(r);return B(h,{code:Z.invalid_type,expected:V.undefined,received:h.parsedType}),X}return Pe(r.data)}},"ZodUndefined");I(Fe,"ZodUndefined"),Fe.create=r=>new Fe({typeName:K.ZodUndefined,...Q(r)});var ct=f(class extends ee{_parse(r){if(this._getType(r)!==V.null){let h=this._getOrReturnCtx(r);return B(h,{code:Z.invalid_type,expected:V.null,received:h.parsedType}),X}return Pe(r.data)}},"ZodNull");I(ct,"ZodNull"),ct.create=r=>new ct({typeName:K.ZodNull,...Q(r)});var We=f(class extends ee{constructor(){super(...arguments),this._any=!0}_parse(r){return Pe(r.data)}},"ZodAny");I(We,"ZodAny"),We.create=r=>new We({typeName:K.ZodAny,...Q(r)});var Se=f(class extends ee{constructor(){super(...arguments),this._unknown=!0}_parse(r){return Pe(r.data)}},"ZodUnknown");I(Se,"ZodUnknown"),Se.create=r=>new Se({typeName:K.ZodUnknown,...Q(r)});var Ee=f(class extends ee{_parse(r){let u=this._getOrReturnCtx(r);return B(u,{code:Z.invalid_type,expected:V.never,received:u.parsedType}),X}},"ZodNever");I(Ee,"ZodNever"),Ee.create=r=>new Ee({typeName:K.ZodNever,...Q(r)});var Ge=f(class extends ee{_parse(r){if(this._getType(r)!==V.undefined){let h=this._getOrReturnCtx(r);return B(h,{code:Z.invalid_type,expected:V.void,received:h.parsedType}),X}return Pe(r.data)}},"ZodVoid");I(Ge,"ZodVoid"),Ge.create=r=>new Ge({typeName:K.ZodVoid,...Q(r)});var Ie=f(class extends ee{_parse(r){let{ctx:u,status:h}=this._processInputParams(r),C=this._def;if(u.parsedType!==V.array)return B(u,{code:Z.invalid_type,expected:V.array,received:u.parsedType}),X;if(C.exactLength!==null){let R=u.data.length>C.exactLength.value,S=u.data.length<C.exactLength.value;(R||S)&&(B(u,{code:R?Z.too_big:Z.too_small,minimum:S?C.exactLength.value:void 0,maximum:R?C.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:C.exactLength.message}),h.dirty())}if(C.minLength!==null&&u.data.length<C.minLength.value&&(B(u,{code:Z.too_small,minimum:C.minLength.value,type:"array",inclusive:!0,exact:!1,message:C.minLength.message}),h.dirty()),C.maxLength!==null&&u.data.length>C.maxLength.value&&(B(u,{code:Z.too_big,maximum:C.maxLength.value,type:"array",inclusive:!0,exact:!1,message:C.maxLength.message}),h.dirty()),u.common.async)return Promise.all([...u.data].map((R,S)=>C.type._parseAsync(new Ce(u,R,u.path,S)))).then(R=>Ae.mergeArray(h,R));let w=[...u.data].map((R,S)=>C.type._parseSync(new Ce(u,R,u.path,S)));return Ae.mergeArray(h,w)}get element(){return this._def.type}min(r,u){return new Ie({...this._def,minLength:{value:r,message:W.toString(u)}})}max(r,u){return new Ie({...this._def,maxLength:{value:r,message:W.toString(u)}})}length(r,u){return new Ie({...this._def,exactLength:{value:r,message:W.toString(u)}})}nonempty(r){return this.min(1,r)}},"ZodArray");I(Ie,"ZodArray"),Ie.create=(r,u)=>new Ie({type:r,minLength:null,maxLength:null,exactLength:null,typeName:K.ZodArray,...Q(u)});function Be(r){if(r instanceof ge){let u={};for(let h in r.shape){let C=r.shape[h];u[h]=dt.create(Be(C))}return new ge({...r._def,shape:()=>u})}else return r instanceof Ie?new Ie({...r._def,type:Be(r.element)}):r instanceof dt?dt.create(Be(r.unwrap())):r instanceof xt?xt.create(Be(r.unwrap())):r instanceof bt?bt.create(r.items.map(u=>Be(u))):r}b(Be,"deepPartialify"),ue(Be,"deepPartialify"),f(Be,"deepPartialify"),I(Be,"deepPartialify");var ge=f(class extends ee{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(),u=le.objectKeys(r);return this._cached={shape:r,keys:u}}_parse(r){if(this._getType(r)!==V.object){let N=this._getOrReturnCtx(r);return B(N,{code:Z.invalid_type,expected:V.object,received:N.parsedType}),X}let{status:h,ctx:C}=this._processInputParams(r),{shape:w,keys:R}=this._getCached(),S=[];if(!(this._def.catchall instanceof Ee&&this._def.unknownKeys==="strip"))for(let N in C.data)R.includes(N)||S.push(N);let M=[];for(let N of R){let ae=w[N],Te=C.data[N];M.push({key:{status:"valid",value:N},value:ae._parse(new Ce(C,Te,C.path,N)),alwaysSet:N in C.data})}if(this._def.catchall instanceof Ee){let N=this._def.unknownKeys;if(N==="passthrough")for(let ae of S)M.push({key:{status:"valid",value:ae},value:{status:"valid",value:C.data[ae]}});else if(N==="strict")S.length>0&&(B(C,{code:Z.unrecognized_keys,keys:S}),h.dirty());else if(N!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let N=this._def.catchall;for(let ae of S){let Te=C.data[ae];M.push({key:{status:"valid",value:ae},value:N._parse(new Ce(C,Te,C.path,ae)),alwaysSet:ae in C.data})}}return C.common.async?Promise.resolve().then(async()=>{let N=[];for(let ae of M){let Te=await ae.key,Qs=await ae.value;N.push({key:Te,value:Qs,alwaysSet:ae.alwaysSet})}return N}).then(N=>Ae.mergeObjectSync(h,N)):Ae.mergeObjectSync(h,M)}get shape(){return this._def.shape()}strict(r){return W.errToObj,new ge({...this._def,unknownKeys:"strict",...r!==void 0?{errorMap:(u,h)=>{var C,w,R,S;let M=(R=(w=(C=this._def).errorMap)===null||w===void 0?void 0:w.call(C,u,h).message)!==null&&R!==void 0?R:h.defaultError;return u.code==="unrecognized_keys"?{message:(S=W.errToObj(r).message)!==null&&S!==void 0?S:M}:{message:M}}}:{}})}strip(){return new ge({...this._def,unknownKeys:"strip"})}passthrough(){return new ge({...this._def,unknownKeys:"passthrough"})}extend(r){return new ge({...this._def,shape:()=>({...this._def.shape(),...r})})}merge(r){return new ge({unknownKeys:r._def.unknownKeys,catchall:r._def.catchall,shape:()=>({...this._def.shape(),...r._def.shape()}),typeName:K.ZodObject})}setKey(r,u){return this.augment({[r]:u})}catchall(r){return new ge({...this._def,catchall:r})}pick(r){let u={};return le.objectKeys(r).forEach(h=>{r[h]&&this.shape[h]&&(u[h]=this.shape[h])}),new ge({...this._def,shape:()=>u})}omit(r){let u={};return le.objectKeys(this.shape).forEach(h=>{r[h]||(u[h]=this.shape[h])}),new ge({...this._def,shape:()=>u})}deepPartial(){return Be(this)}partial(r){let u={};return le.objectKeys(this.shape).forEach(h=>{let C=this.shape[h];r&&!r[h]?u[h]=C:u[h]=C.optional()}),new ge({...this._def,shape:()=>u})}required(r){let u={};return le.objectKeys(this.shape).forEach(h=>{if(r&&!r[h])u[h]=this.shape[h];else{let w=this.shape[h];for(;w instanceof dt;)w=w._def.innerType;u[h]=w}}),new ge({...this._def,shape:()=>u})}keyof(){return Er(le.objectKeys(this.shape))}},"ZodObject");I(ge,"ZodObject"),ge.create=(r,u)=>new ge({shape:()=>r,unknownKeys:"strip",catchall:Ee.create(),typeName:K.ZodObject,...Q(u)}),ge.strictCreate=(r,u)=>new ge({shape:()=>r,unknownKeys:"strict",catchall:Ee.create(),typeName:K.ZodObject,...Q(u)}),ge.lazycreate=(r,u)=>new ge({shape:r,unknownKeys:"strip",catchall:Ee.create(),typeName:K.ZodObject,...Q(u)});var wr=f(class extends ee{_parse(r){let{ctx:u}=this._processInputParams(r),h=this._def.options;function C(w){for(let S of w)if(S.result.status==="valid")return S.result;for(let S of w)if(S.result.status==="dirty")return u.common.issues.push(...S.ctx.common.issues),S.result;let R=w.map(S=>new Ze(S.ctx.common.issues));return B(u,{code:Z.invalid_union,unionErrors:R}),X}if(b(C,"handleResults"),ue(C,"handleResults"),f(C,"handleResults"),I(C,"handleResults"),u.common.async)return Promise.all(h.map(async w=>{let R={...u,common:{...u.common,issues:[]},parent:null};return{result:await w._parseAsync({data:u.data,path:u.path,parent:R}),ctx:R}})).then(C);{let w,R=[];for(let M of h){let N={...u,common:{...u.common,issues:[]},parent:null},ae=M._parseSync({data:u.data,path:u.path,parent:N});if(ae.status==="valid")return ae;ae.status==="dirty"&&!w&&(w={result:ae,ctx:N}),N.common.issues.length&&R.push(N.common.issues)}if(w)return u.common.issues.push(...w.ctx.common.issues),w.result;let S=R.map(M=>new Ze(M));return B(u,{code:Z.invalid_union,unionErrors:S}),X}}get options(){return this._def.options}},"ZodUnion");I(wr,"ZodUnion"),wr.create=(r,u)=>new wr({options:r,typeName:K.ZodUnion,...Q(u)});var Ke=I(r=>r instanceof Cr?Ke(r.schema):r instanceof Xe?Ke(r.innerType()):r instanceof xr?[r.value]:r instanceof Ut?r.options:r instanceof Tr?le.objectValues(r.enum):r instanceof kr?Ke(r._def.innerType):r instanceof Fe?[void 0]:r instanceof ct?[null]:r instanceof dt?[void 0,...Ke(r.unwrap())]:r instanceof xt?[null,...Ke(r.unwrap())]:r instanceof Bn||r instanceof Rr?Ke(r.unwrap()):r instanceof Sr?Ke(r._def.innerType):[],"getDiscriminator"),Lt=f(class extends ee{_parse(r){let{ctx:u}=this._processInputParams(r);if(u.parsedType!==V.object)return B(u,{code:Z.invalid_type,expected:V.object,received:u.parsedType}),X;let h=this.discriminator,C=u.data[h],w=this.optionsMap.get(C);return w?u.common.async?w._parseAsync({data:u.data,path:u.path,parent:u}):w._parseSync({data:u.data,path:u.path,parent:u}):(B(u,{code:Z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[h]}),X)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(r,u,h){let C=new Map;for(let w of u){let R=Ke(w.shape[r]);if(!R.length)throw new Error(`A discriminator value for key \`${r}\` could not be extracted from all schema options`);for(let S of R){if(C.has(S))throw new Error(`Discriminator property ${String(r)} has duplicate value ${String(S)}`);C.set(S,w)}}return new Lt({typeName:K.ZodDiscriminatedUnion,discriminator:r,options:u,optionsMap:C,...Q(h)})}},"ZodDiscriminatedUnion");I(Lt,"ZodDiscriminatedUnion");function lt(r,u){let h=Qe(r),C=Qe(u);if(r===u)return{valid:!0,data:r};if(h===V.object&&C===V.object){let w=le.objectKeys(u),R=le.objectKeys(r).filter(M=>w.indexOf(M)!==-1),S={...r,...u};for(let M of R){let N=lt(r[M],u[M]);if(!N.valid)return{valid:!1};S[M]=N.data}return{valid:!0,data:S}}else if(h===V.array&&C===V.array){if(r.length!==u.length)return{valid:!1};let w=[];for(let R=0;R<r.length;R++){let S=r[R],M=u[R],N=lt(S,M);if(!N.valid)return{valid:!1};w.push(N.data)}return{valid:!0,data:w}}else return h===V.date&&C===V.date&&+r==+u?{valid:!0,data:r}:{valid:!1}}b(lt,"mergeValues"),ue(lt,"mergeValues"),f(lt,"mergeValues"),I(lt,"mergeValues");var Ct=f(class extends ee{_parse(r){let{status:u,ctx:h}=this._processInputParams(r),C=I((w,R)=>{if(ya(w)||ya(R))return X;let S=lt(w.value,R.value);return S.valid?((va(w)||va(R))&&u.dirty(),{status:u.value,value:S.data}):(B(h,{code:Z.invalid_intersection_types}),X)},"handleParsed");return h.common.async?Promise.all([this._def.left._parseAsync({data:h.data,path:h.path,parent:h}),this._def.right._parseAsync({data:h.data,path:h.path,parent:h})]).then(([w,R])=>C(w,R)):C(this._def.left._parseSync({data:h.data,path:h.path,parent:h}),this._def.right._parseSync({data:h.data,path:h.path,parent:h}))}},"ZodIntersection");I(Ct,"ZodIntersection"),Ct.create=(r,u,h)=>new Ct({left:r,right:u,typeName:K.ZodIntersection,...Q(h)});var bt=f(class extends ee{_parse(r){let{status:u,ctx:h}=this._processInputParams(r);if(h.parsedType!==V.array)return B(h,{code:Z.invalid_type,expected:V.array,received:h.parsedType}),X;if(h.data.length<this._def.items.length)return B(h,{code:Z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),X;!this._def.rest&&h.data.length>this._def.items.length&&(B(h,{code:Z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),u.dirty());let w=[...h.data].map((R,S)=>{let M=this._def.items[S]||this._def.rest;return M?M._parse(new Ce(h,R,h.path,S)):null}).filter(R=>!!R);return h.common.async?Promise.all(w).then(R=>Ae.mergeArray(u,R)):Ae.mergeArray(u,w)}get items(){return this._def.items}rest(r){return new bt({...this._def,rest:r})}},"ZodTuple");I(bt,"ZodTuple"),bt.create=(r,u)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new bt({items:r,typeName:K.ZodTuple,rest:null,...Q(u)})};var J=f(class extends ee{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){let{status:u,ctx:h}=this._processInputParams(r);if(h.parsedType!==V.object)return B(h,{code:Z.invalid_type,expected:V.object,received:h.parsedType}),X;let C=[],w=this._def.keyType,R=this._def.valueType;for(let S in h.data)C.push({key:w._parse(new Ce(h,S,h.path,S)),value:R._parse(new Ce(h,h.data[S],h.path,S)),alwaysSet:S in h.data});return h.common.async?Ae.mergeObjectAsync(u,C):Ae.mergeObjectSync(u,C)}get element(){return this._def.valueType}static create(r,u,h){return u instanceof ee?new J({keyType:r,valueType:u,typeName:K.ZodRecord,...Q(h)}):new J({keyType:Me.create(),valueType:r,typeName:K.ZodRecord,...Q(u)})}},"ZodRecord");I(J,"ZodRecord");var on=f(class extends ee{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){let{status:u,ctx:h}=this._processInputParams(r);if(h.parsedType!==V.map)return B(h,{code:Z.invalid_type,expected:V.map,received:h.parsedType}),X;let C=this._def.keyType,w=this._def.valueType,R=[...h.data.entries()].map(([S,M],N)=>({key:C._parse(new Ce(h,S,h.path,[N,"key"])),value:w._parse(new Ce(h,M,h.path,[N,"value"]))}));if(h.common.async){let S=new Map;return Promise.resolve().then(async()=>{for(let M of R){let N=await M.key,ae=await M.value;if(N.status==="aborted"||ae.status==="aborted")return X;(N.status==="dirty"||ae.status==="dirty")&&u.dirty(),S.set(N.value,ae.value)}return{status:u.value,value:S}})}else{let S=new Map;for(let M of R){let N=M.key,ae=M.value;if(N.status==="aborted"||ae.status==="aborted")return X;(N.status==="dirty"||ae.status==="dirty")&&u.dirty(),S.set(N.value,ae.value)}return{status:u.value,value:S}}}},"ZodMap");I(on,"ZodMap"),on.create=(r,u,h)=>new on({valueType:u,keyType:r,typeName:K.ZodMap,...Q(h)});var Zt=f(class extends ee{_parse(r){let{status:u,ctx:h}=this._processInputParams(r);if(h.parsedType!==V.set)return B(h,{code:Z.invalid_type,expected:V.set,received:h.parsedType}),X;let C=this._def;C.minSize!==null&&h.data.size<C.minSize.value&&(B(h,{code:Z.too_small,minimum:C.minSize.value,type:"set",inclusive:!0,exact:!1,message:C.minSize.message}),u.dirty()),C.maxSize!==null&&h.data.size>C.maxSize.value&&(B(h,{code:Z.too_big,maximum:C.maxSize.value,type:"set",inclusive:!0,exact:!1,message:C.maxSize.message}),u.dirty());let w=this._def.valueType;function R(M){let N=new Set;for(let ae of M){if(ae.status==="aborted")return X;ae.status==="dirty"&&u.dirty(),N.add(ae.value)}return{status:u.value,value:N}}b(R,"finalizeSet"),ue(R,"finalizeSet"),f(R,"finalizeSet"),I(R,"finalizeSet");let S=[...h.data.values()].map((M,N)=>w._parse(new Ce(h,M,h.path,N)));return h.common.async?Promise.all(S).then(M=>R(M)):R(S)}min(r,u){return new Zt({...this._def,minSize:{value:r,message:W.toString(u)}})}max(r,u){return new Zt({...this._def,maxSize:{value:r,message:W.toString(u)}})}size(r,u){return this.min(r,u).max(r,u)}nonempty(r){return this.min(1,r)}},"ZodSet");I(Zt,"ZodSet"),Zt.create=(r,u)=>new Zt({valueType:r,minSize:null,maxSize:null,typeName:K.ZodSet,...Q(u)});var Xt=f(class extends ee{constructor(){super(...arguments),this.validate=this.implement}_parse(r){let{ctx:u}=this._processInputParams(r);if(u.parsedType!==V.function)return B(u,{code:Z.invalid_type,expected:V.function,received:u.parsedType}),X;function h(S,M){return Zn({data:S,path:u.path,errorMaps:[u.common.contextualErrorMap,u.schemaErrorMap,Wt(),Y].filter(N=>!!N),issueData:{code:Z.invalid_arguments,argumentsError:M}})}b(h,"makeArgsIssue"),ue(h,"makeArgsIssue"),f(h,"makeArgsIssue"),I(h,"makeArgsIssue");function C(S,M){return Zn({data:S,path:u.path,errorMaps:[u.common.contextualErrorMap,u.schemaErrorMap,Wt(),Y].filter(N=>!!N),issueData:{code:Z.invalid_return_type,returnTypeError:M}})}b(C,"makeReturnsIssue"),ue(C,"makeReturnsIssue"),f(C,"makeReturnsIssue"),I(C,"makeReturnsIssue");let w={errorMap:u.common.contextualErrorMap},R=u.data;if(this._def.returns instanceof er){let S=this;return Pe(async function(...M){let N=new Ze([]),ae=await S._def.args.parseAsync(M,w).catch(ss=>{throw N.addIssue(h(M,ss)),N}),Te=await Reflect.apply(R,this,ae);return await S._def.returns._def.type.parseAsync(Te,w).catch(ss=>{throw N.addIssue(C(Te,ss)),N})})}else{let S=this;return Pe(function(...M){let N=S._def.args.safeParse(M,w);if(!N.success)throw new Ze([h(M,N.error)]);let ae=Reflect.apply(R,this,N.data),Te=S._def.returns.safeParse(ae,w);if(!Te.success)throw new Ze([C(ae,Te.error)]);return Te.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...r){return new Xt({...this._def,args:bt.create(r).rest(Se.create())})}returns(r){return new Xt({...this._def,returns:r})}implement(r){return this.parse(r)}strictImplement(r){return this.parse(r)}static create(r,u,h){return new Xt({args:r||bt.create([]).rest(Se.create()),returns:u||Se.create(),typeName:K.ZodFunction,...Q(h)})}},"ZodFunction");I(Xt,"ZodFunction");var Cr=f(class extends ee{get schema(){return this._def.getter()}_parse(r){let{ctx:u}=this._processInputParams(r);return this._def.getter()._parse({data:u.data,path:u.path,parent:u})}},"ZodLazy");I(Cr,"ZodLazy"),Cr.create=(r,u)=>new Cr({getter:r,typeName:K.ZodLazy,...Q(u)});var xr=f(class extends ee{_parse(r){if(r.data!==this._def.value){let u=this._getOrReturnCtx(r);return B(u,{received:u.data,code:Z.invalid_literal,expected:this._def.value}),X}return{status:"valid",value:r.data}}get value(){return this._def.value}},"ZodLiteral");I(xr,"ZodLiteral"),xr.create=(r,u)=>new xr({value:r,typeName:K.ZodLiteral,...Q(u)});function Er(r,u){return new Ut({values:r,typeName:K.ZodEnum,...Q(u)})}b(Er,"createZodEnum"),ue(Er,"createZodEnum"),f(Er,"createZodEnum"),I(Er,"createZodEnum");var Ut=f(class extends ee{constructor(){super(...arguments),jt.set(this,void 0)}_parse(r){if(typeof r.data!="string"){let u=this._getOrReturnCtx(r),h=this._def.values;return B(u,{expected:le.joinValues(h),received:u.parsedType,code:Z.invalid_type}),X}if(Gt(this,jt,"f")||Ot(this,jt,new Set(this._def.values),"f"),!Gt(this,jt,"f").has(r.data)){let u=this._getOrReturnCtx(r),h=this._def.values;return B(u,{received:u.data,code:Z.invalid_enum_value,options:h}),X}return Pe(r.data)}get options(){return this._def.values}get enum(){let r={};for(let u of this._def.values)r[u]=u;return r}get Values(){let r={};for(let u of this._def.values)r[u]=u;return r}get Enum(){let r={};for(let u of this._def.values)r[u]=u;return r}extract(r,u=this._def){return Ut.create(r,{...this._def,...u})}exclude(r,u=this._def){return Ut.create(this.options.filter(h=>!r.includes(h)),{...this._def,...u})}},"ZodEnum");I(Ut,"ZodEnum"),jt=new WeakMap,Ut.create=Er;var Tr=f(class extends ee{constructor(){super(...arguments),Ht.set(this,void 0)}_parse(r){let u=le.getValidEnumValues(this._def.values),h=this._getOrReturnCtx(r);if(h.parsedType!==V.string&&h.parsedType!==V.number){let C=le.objectValues(u);return B(h,{expected:le.joinValues(C),received:h.parsedType,code:Z.invalid_type}),X}if(Gt(this,Ht,"f")||Ot(this,Ht,new Set(le.getValidEnumValues(this._def.values)),"f"),!Gt(this,Ht,"f").has(r.data)){let C=le.objectValues(u);return B(h,{received:h.data,code:Z.invalid_enum_value,options:C}),X}return Pe(r.data)}get enum(){return this._def.values}},"ZodNativeEnum");I(Tr,"ZodNativeEnum"),Ht=new WeakMap,Tr.create=(r,u)=>new Tr({values:r,typeName:K.ZodNativeEnum,...Q(u)});var er=f(class extends ee{unwrap(){return this._def.type}_parse(r){let{ctx:u}=this._processInputParams(r);if(u.parsedType!==V.promise&&u.common.async===!1)return B(u,{code:Z.invalid_type,expected:V.promise,received:u.parsedType}),X;let h=u.parsedType===V.promise?u.data:Promise.resolve(u.data);return Pe(h.then(C=>this._def.type.parseAsync(C,{path:u.path,errorMap:u.common.contextualErrorMap})))}},"ZodPromise");I(er,"ZodPromise"),er.create=(r,u)=>new er({type:r,typeName:K.ZodPromise,...Q(u)});var Xe=f(class extends ee{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===K.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(r){let{status:u,ctx:h}=this._processInputParams(r),C=this._def.effect||null,w={addIssue:R=>{B(h,R),R.fatal?u.abort():u.dirty()},get path(){return h.path}};if(w.addIssue=w.addIssue.bind(w),C.type==="preprocess"){let R=C.transform(h.data,w);if(h.common.async)return Promise.resolve(R).then(async S=>{if(u.value==="aborted")return X;let M=await this._def.schema._parseAsync({data:S,path:h.path,parent:h});return M.status==="aborted"?X:M.status==="dirty"||u.value==="dirty"?gr(M.value):M});{if(u.value==="aborted")return X;let S=this._def.schema._parseSync({data:R,path:h.path,parent:h});return S.status==="aborted"?X:S.status==="dirty"||u.value==="dirty"?gr(S.value):S}}if(C.type==="refinement"){let R=I(S=>{let M=C.refinement(S,w);if(h.common.async)return Promise.resolve(M);if(M instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return S},"executeRefinement");if(h.common.async===!1){let S=this._def.schema._parseSync({data:h.data,path:h.path,parent:h});return S.status==="aborted"?X:(S.status==="dirty"&&u.dirty(),R(S.value),{status:u.value,value:S.value})}else return this._def.schema._parseAsync({data:h.data,path:h.path,parent:h}).then(S=>S.status==="aborted"?X:(S.status==="dirty"&&u.dirty(),R(S.value).then(()=>({status:u.value,value:S.value}))))}if(C.type==="transform")if(h.common.async===!1){let R=this._def.schema._parseSync({data:h.data,path:h.path,parent:h});if(!nn(R))return R;let S=C.transform(R.value,w);if(S instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:u.value,value:S}}else return this._def.schema._parseAsync({data:h.data,path:h.path,parent:h}).then(R=>nn(R)?Promise.resolve(C.transform(R.value,w)).then(S=>({status:u.value,value:S})):R);le.assertNever(C)}},"ZodEffects");I(Xe,"ZodEffects"),Xe.create=(r,u,h)=>new Xe({schema:r,typeName:K.ZodEffects,effect:u,...Q(h)}),Xe.createWithPreprocess=(r,u,h)=>new Xe({schema:u,effect:{type:"preprocess",transform:r},typeName:K.ZodEffects,...Q(h)});var dt=f(class extends ee{_parse(r){return this._getType(r)===V.undefined?Pe(void 0):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}},"ZodOptional");I(dt,"ZodOptional"),dt.create=(r,u)=>new dt({innerType:r,typeName:K.ZodOptional,...Q(u)});var xt=f(class extends ee{_parse(r){return this._getType(r)===V.null?Pe(null):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}},"ZodNullable");I(xt,"ZodNullable"),xt.create=(r,u)=>new xt({innerType:r,typeName:K.ZodNullable,...Q(u)});var kr=f(class extends ee{_parse(r){let{ctx:u}=this._processInputParams(r),h=u.data;return u.parsedType===V.undefined&&(h=this._def.defaultValue()),this._def.innerType._parse({data:h,path:u.path,parent:u})}removeDefault(){return this._def.innerType}},"ZodDefault");I(kr,"ZodDefault"),kr.create=(r,u)=>new kr({innerType:r,typeName:K.ZodDefault,defaultValue:typeof u.default=="function"?u.default:()=>u.default,...Q(u)});var Sr=f(class extends ee{_parse(r){let{ctx:u}=this._processInputParams(r),h={...u,common:{...u.common,issues:[]}},C=this._def.innerType._parse({data:h.data,path:h.path,parent:{...h}});return yr(C)?C.then(w=>({status:"valid",value:w.status==="valid"?w.value:this._def.catchValue({get error(){return new Ze(h.common.issues)},input:h.data})})):{status:"valid",value:C.status==="valid"?C.value:this._def.catchValue({get error(){return new Ze(h.common.issues)},input:h.data})}}removeCatch(){return this._def.innerType}},"ZodCatch");I(Sr,"ZodCatch"),Sr.create=(r,u)=>new Sr({innerType:r,typeName:K.ZodCatch,catchValue:typeof u.catch=="function"?u.catch:()=>u.catch,...Q(u)});var sn=f(class extends ee{_parse(r){if(this._getType(r)!==V.nan){let h=this._getOrReturnCtx(r);return B(h,{code:Z.invalid_type,expected:V.nan,received:h.parsedType}),X}return{status:"valid",value:r.data}}},"ZodNaN");I(sn,"ZodNaN"),sn.create=r=>new sn({typeName:K.ZodNaN,...Q(r)});var Co=Symbol("zod_brand"),Bn=f(class extends ee{_parse(r){let{ctx:u}=this._processInputParams(r),h=u.data;return this._def.type._parse({data:h,path:u.path,parent:u})}unwrap(){return this._def.type}},"ZodBranded");I(Bn,"ZodBranded");var cn=f(class extends ee{_parse(r){let{status:u,ctx:h}=this._processInputParams(r);if(h.common.async)return I(async()=>{let w=await this._def.in._parseAsync({data:h.data,path:h.path,parent:h});return w.status==="aborted"?X:w.status==="dirty"?(u.dirty(),gr(w.value)):this._def.out._parseAsync({data:w.value,path:h.path,parent:h})},"handleAsync")();{let C=this._def.in._parseSync({data:h.data,path:h.path,parent:h});return C.status==="aborted"?X:C.status==="dirty"?(u.dirty(),{status:"dirty",value:C.value}):this._def.out._parseSync({data:C.value,path:h.path,parent:h})}}static create(r,u){return new cn({in:r,out:u,typeName:K.ZodPipeline})}},"ZodPipeline");I(cn,"ZodPipeline");var Rr=f(class extends ee{_parse(r){let u=this._def.innerType._parse(r),h=I(C=>(nn(C)&&(C.value=Object.freeze(C.value)),C),"freeze");return yr(u)?u.then(C=>h(C)):h(u)}unwrap(){return this._def.innerType}},"ZodReadonly");I(Rr,"ZodReadonly"),Rr.create=(r,u)=>new Rr({innerType:r,typeName:K.ZodReadonly,...Q(u)});function ln(r,u={},h){return r?We.create().superRefine((C,w)=>{var R,S;if(!r(C)){let M=typeof u=="function"?u(C):typeof u=="string"?{message:u}:u,N=(S=(R=M.fatal)!==null&&R!==void 0?R:h)!==null&&S!==void 0?S:!0,ae=typeof M=="string"?{message:M}:M;w.addIssue({code:"custom",...ae,fatal:N})}}):We.create()}b(ln,"custom"),ue(ln,"custom"),f(ln,"custom"),I(ln,"custom");var xo={object:ge.lazycreate},K;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(K||(K={}));var Eo=I((r,u={message:`Input not instance of ${r.name}`})=>ln(h=>h instanceof r,u),"instanceOfType"),ci=Me.create,li=Ue.create,To=sn.create,ko=$e.create,di=st.create,So=Ye.create,Ro=Mt.create,ui=Fe.create,Po=ct.create,Oo=We.create,jo=Se.create,Vo=Ee.create,Ao=Ge.create,Io=Ie.create,No=ge.create,Do=ge.strictCreate,Mo=wr.create,o=Lt.create,dn=Ct.create,Pr=bt.create,un=J.create,ba=on.create,pn=Zt.create,Lo=Xt.create,fn=Cr.create,pi=xr.create,fi=Ut.create,hi=Tr.create,_a=er.create,tr=Xe.create,qn=dt.create,hn=xt.create,wa=Xe.createWithPreprocess,Ca=cn.create,xa=I(()=>ci().optional(),"ostring"),Ea=I(()=>li().optional(),"onumber"),Or=I(()=>di().optional(),"oboolean"),ut={string:r=>Me.create({...r,coerce:!0}),number:r=>Ue.create({...r,coerce:!0}),boolean:r=>st.create({...r,coerce:!0}),bigint:r=>$e.create({...r,coerce:!0}),date:r=>Ye.create({...r,coerce:!0})},zn=X,i=Object.freeze({__proto__:null,defaultErrorMap:Y,setErrorMap:Ln,getErrorMap:Wt,makeIssue:Zn,EMPTY_PATH:wo,addIssueToContext:B,ParseStatus:Ae,INVALID:X,DIRTY:gr,OK:Pe,isAborted:ya,isDirty:va,isValid:nn,isAsync:yr,get util(){return le},get objectUtil(){return mr},ZodParsedType:V,getParsedType:Qe,ZodType:ee,datetimeRegex:vt,ZodString:Me,ZodNumber:Ue,ZodBigInt:$e,ZodBoolean:st,ZodDate:Ye,ZodSymbol:Mt,ZodUndefined:Fe,ZodNull:ct,ZodAny:We,ZodUnknown:Se,ZodNever:Ee,ZodVoid:Ge,ZodArray:Ie,ZodObject:ge,ZodUnion:wr,ZodDiscriminatedUnion:Lt,ZodIntersection:Ct,ZodTuple:bt,ZodRecord:J,ZodMap:on,ZodSet:Zt,ZodFunction:Xt,ZodLazy:Cr,ZodLiteral:xr,ZodEnum:Ut,ZodNativeEnum:Tr,ZodPromise:er,ZodEffects:Xe,ZodTransformer:Xe,ZodOptional:dt,ZodNullable:xt,ZodDefault:kr,ZodCatch:Sr,ZodNaN:sn,BRAND:Co,ZodBranded:Bn,ZodPipeline:cn,ZodReadonly:Rr,custom:ln,Schema:ee,ZodSchema:ee,late:xo,get ZodFirstPartyTypeKind(){return K},coerce:ut,any:Oo,array:Io,bigint:ko,boolean:di,date:So,discriminatedUnion:o,effect:tr,enum:fi,function:Lo,instanceof:Eo,intersection:dn,lazy:fn,literal:pi,map:ba,nan:To,nativeEnum:hi,never:Vo,null:Po,nullable:hn,number:li,object:No,oboolean:Or,onumber:Ea,optional:qn,ostring:xa,pipeline:Ca,preprocess:wa,promise:_a,record:un,set:pn,strictObject:Do,string:ci,symbol:Ro,transformer:tr,tuple:Pr,undefined:ui,union:Mo,unknown:jo,void:Ao,NEVER:zn,ZodIssueCode:Z,quotelessJson:it,ZodError:Ze}),jr=Symbol("current"),Et=Symbol("previous"),mn=I((r,{ref:u,refType:h,param:C,header:w,...R}={})=>({...R,...r}),"mergeOpenApi");function gn(r){if(typeof r.ZodType.prototype.openapi<"u")return;r.ZodType.prototype.openapi=function(R){let{zodOpenApi:S,...M}=this._def,N=new this.constructor({...M,zodOpenApi:{openapi:mn(R,S?.openapi)}});return N._def.zodOpenApi[jr]=N,S&&(N._def.zodOpenApi[Et]=this),N};let u=r.ZodType.prototype.describe;r.ZodType.prototype.describe=function(...R){let S=u.apply(this,R),M=S._def;if(M.zodOpenApi){let N={...M.zodOpenApi};N.openapi=mn({description:R[0]},N.openapi),N[Et]=this,N[jr]=S,M.zodOpenApi=N}else M.zodOpenApi={openapi:{description:R[0]},[jr]:S};return S};let h=r.ZodObject.prototype.extend;r.ZodObject.prototype.extend=function(...R){let S=h.apply(this,R),M=S._def.zodOpenApi;if(M){let N={...M};N.openapi=mn({},N.openapi),N[Et]=this,S._def.zodOpenApi=N}else S._def.zodOpenApi={[Et]:this};return S};let C=r.ZodObject.prototype.omit;r.ZodObject.prototype.omit=function(...R){let S=C.apply(this,R),M=S._def.zodOpenApi;if(M){let N={...M};N.openapi=mn({},N.openapi),delete N[Et],delete N[jr],S._def.zodOpenApi=N}return S};let w=r.ZodObject.prototype.pick;r.ZodObject.prototype.pick=function(...R){let S=w.apply(this,R),M=S._def.zodOpenApi;if(M){let N={...M};N.openapi=mn({},N.openapi),delete N[Et],delete N[jr],S._def.zodOpenApi=N}return S}}b(gn,"extendZodWithOpenApi"),ue(gn,"extendZodWithOpenApi"),f(gn,"extendZodWithOpenApi"),I(gn,"extendZodWithOpenApi"),gn(i);var Vr=i.array(i.string().or(i.record(i.any()))),mi=i.object({type:i.string().optional(),narrative:i.string().optional()}),et=i.string().or(i.object({id:i.string(),type:i.string(),caption:i.string().optional()})),Ta=i.object({type:i.string().min(1).or(i.string().array().nonempty()),latitude:i.number(),longitude:i.number()}),gi=i.object({type:i.string().min(1).or(i.string().array().nonempty()),addressCountry:i.string().optional(),addressCountryCode:i.string().optional(),addressRegion:i.string().optional(),addressLocality:i.string().optional(),streetAddress:i.string().optional(),postOfficeBoxNumber:i.string().optional(),postalCode:i.string().optional(),geo:Ta.optional()}),ka=i.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(i.string()),rr=i.object({type:i.string().min(1).or(i.string().array().nonempty()),identifier:i.string(),identifierType:ka}),nr=i.string().or(i.object({id:i.string().optional(),type:i.string().or(i.string().array().nonempty().optional()),name:i.string().optional(),url:i.string().optional(),phone:i.string().optional(),description:i.string().optional(),endorsement:i.any().array().optional(),image:et.optional(),email:i.string().email().optional(),address:gi.optional(),otherIdentifier:rr.array().optional(),official:i.string().optional(),parentOrg:i.any().optional(),familyName:i.string().optional(),givenName:i.string().optional(),additionalName:i.string().optional(),patronymicName:i.string().optional(),honorificPrefix:i.string().optional(),honorificSuffix:i.string().optional(),familyNamePrefix:i.string().optional(),dateOfBirth:i.string().optional()}).catchall(i.any())),yn=i.object({id:i.string().optional()}).catchall(i.any()),Ar=i.object({type:i.string(),id:i.string()}).catchall(i.any()),$n=i.object({id:i.string(),type:i.string()}).catchall(i.any()),Fn=i.object({id:i.string().optional(),type:i.string()}).catchall(i.any()),Wn=i.object({type:i.string(),id:i.string().optional()}).catchall(i.any()),Gn=i.object({type:i.string().or(i.string().array().nonempty()),id:i.string().optional()}).catchall(i.any()),ar=i.object({"@context":Vr,id:i.string().optional(),type:i.string().array().nonempty(),issuer:nr,credentialSubject:yn.or(yn.array()),refreshService:Fn.or(Fn.array()).optional(),credentialSchema:$n.or($n.array()).optional(),issuanceDate:i.string().optional(),expirationDate:i.string().optional(),credentialStatus:Ar.or(Ar.array()).optional(),name:i.string().optional(),description:i.string().optional(),validFrom:i.string().optional(),validUntil:i.string().optional(),status:Ar.or(Ar.array()).optional(),termsOfUse:Wn.or(Wn.array()).optional(),evidence:Gn.or(Gn.array()).optional()}).catchall(i.any()),tt=i.object({type:i.string(),created:i.string(),challenge:i.string().optional(),domain:i.string().optional(),nonce:i.string().optional(),proofPurpose:i.string(),verificationMethod:i.string(),jws:i.string().optional()}).catchall(i.any()),vn=ar.extend({proof:tt.or(tt.array())}),Sa=i.object({"@context":Vr,id:i.string().optional(),type:i.string().or(i.string().array().nonempty()),verifiableCredential:vn.or(vn.array()).optional(),holder:i.string().optional()}).catchall(i.any()),Ra=Sa.extend({proof:tt.or(tt.array())}),bn=i.object({kty:i.string(),crv:i.string(),x:i.string(),y:i.string().optional(),n:i.string().optional(),d:i.string().optional()}),Pa=bn.omit({d:!0}).extend({d:i.string()}),Oa=i.object({alg:i.string(),iv:i.string(),tag:i.string(),epk:bn.partial().optional(),kid:i.string().optional(),apv:i.string().optional(),apu:i.string().optional()}),ja=i.object({header:Oa,encrypted_key:i.string()}),yi=i.object({protected:i.string(),iv:i.string(),ciphertext:i.string(),tag:i.string(),aad:i.string().optional(),recipients:ja.array().optional()}),Bt=i.string().or(i.object({"@context":Vr.optional(),id:i.string(),type:i.string(),controller:i.string(),publicKeyJwk:bn.optional(),publicKeyBase58:i.string().optional(),publicKeyMultibase:i.string().optional(),blockChainAccountId:i.string().optional()}).catchall(i.any())),Hn=i.object({id:i.string(),type:i.string().or(i.string().array().nonempty()),serviceEndpoint:i.any().or(i.any().array().nonempty())}).catchall(i.any()),Zo=i.object({"@context":Vr,id:i.string(),alsoKnownAs:i.string().optional(),controller:i.string().or(i.string().array().nonempty()).optional(),verificationMethod:Bt.array().optional(),authentication:Bt.array().optional(),assertionMethod:Bt.array().optional(),keyAgreement:Bt.array().optional(),capabilityInvocation:Bt.array().optional(),capabilityDelegation:Bt.array().optional(),publicKey:Bt.array().optional(),service:Hn.array().optional(),proof:tt.or(tt.array()).optional()}).catchall(i.any()),vi=i.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(i.string()),_n=i.object({type:i.string().array().nonempty(),targetCode:i.string().optional(),targetDescription:i.string().optional(),targetName:i.string(),targetFramework:i.string().optional(),targetType:vi.optional(),targetUrl:i.string()}),bi=i.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"]),_i=bi.or(i.string()),Oe=i.object({id:i.string().optional(),narrative:i.string().optional()}).catchall(i.any()),Jn=i.object({id:i.string(),type:i.string().array().nonempty(),endorsementComment:i.string().optional()}),wi=ar.extend({credentialSubject:Jn,proof:tt.or(tt.array()).optional()}),Va=i.object({id:i.string(),"@language":i.string().optional(),version:i.string().optional()}),Ci=i.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(i.string()),Aa=i.object({id:i.string(),type:i.string().array().nonempty(),alignment:_n.array().optional(),description:i.string().optional(),level:i.string().optional(),name:i.string(),points:i.string().optional()}).catchall(i.any()),Ia=i.object({id:i.string(),type:i.string().array().nonempty(),alignment:_n.array().optional(),allowedValue:i.string().array().optional(),name:i.string(),requiredLevel:i.string().optional(),requiredValue:i.string().optional(),resultType:Ci,rubricCriterionLevel:Aa.array().optional(),valueMax:i.string().optional(),valueMin:i.string().optional()}).catchall(i.any()),pe=i.object({id:i.string().optional(),type:i.string().array().nonempty(),alignment:_n.array().optional(),achievementType:_i.optional(),creator:nr.optional(),creditsAvailable:i.number().optional(),criteria:Oe,description:i.string(),endorsement:wi.array().optional(),fieldOfStudy:i.string().optional(),humanCode:i.string().optional(),image:et.optional(),"@language":i.string().optional(),name:i.string(),otherIdentifier:rr.array().optional(),related:Va.array().optional(),resultDescription:Ia.array().optional(),specialization:i.string().optional(),tag:i.string().array().optional(),version:i.string().optional()}).catchall(i.any()),Na=i.object({type:i.string(),hashed:i.boolean(),identityHash:i.string(),identityType:i.string(),salt:i.string().optional()}),pt=i.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),xi=i.object({type:i.string().array().nonempty(),achievedLevel:i.string().optional(),alignment:_n.array().optional(),resultDescription:i.string().optional(),status:pt.optional(),value:i.string().optional()}).catchall(i.any()),Da=i.object({id:i.string().optional(),type:i.string().array().nonempty(),activityEndDate:i.string().optional(),activityStartDate:i.string().optional(),creditsEarned:i.number().optional(),achievement:pe.optional(),identifier:Na.array().optional(),image:et.optional(),licenseNumber:i.string().optional(),narrative:i.string().optional(),result:xi.array().optional(),role:i.string().optional(),source:nr.optional(),term:i.string().optional()}).catchall(i.any()),Ei=i.object({id:i.string().optional(),type:i.string().or(i.string().array().nonempty()),narrative:i.string().optional(),name:i.string().optional(),description:i.string().optional(),genre:i.string().optional(),audience:i.string().optional()}).catchall(i.any()),Qn=ar.extend({name:i.string().optional(),description:i.string().optional(),image:et.optional(),credentialSubject:Da.or(Da.array()),endorsement:ar.array().optional(),evidence:Ei.array().optional()}),Uo=Qn.extend({proof:tt.or(tt.array())}),Bo=i.object({checks:i.string().array(),warnings:i.string().array(),errors:i.string().array()}),Ma=i.enum(["Success","Failed","Error"]),qo=Ma.enum,La=i.object({check:i.string(),status:Ma,message:i.string().optional(),details:i.string().optional()}),Ti=i.object({title:i.string().optional(),createdAt:i.string().optional(),issuer:nr.optional(),issuee:nr.optional(),credentialSubject:yn.optional()}),Yn=i.object({id:i.string(),uri:i.string()}).catchall(i.any()),ki=i.object({limit:i.number(),cursor:i.string().optional(),sort:i.string().optional()}),Ne=i.object({cursor:i.string().optional(),hasMore:i.boolean()}),Kn=i.object({encryptedRecord:yi,fields:i.string().array()}).catchall(i.any()),zo=Ne.extend({records:Kn.array()}),wn=Kn.extend({id:i.string()}),Si=Ne.extend({records:wn.array()}),Ri=I(r=>{let u=r.match(/^\/(.*)\/([gimsuy]*)$/);if(!u)throw new Error("Invalid RegExp string format");return{pattern:u[1],flags:u[2]}},"parseRegexString"),Pi=i.instanceof(RegExp).or(i.string().refine(r=>{try{return Ri(r),!0}catch{return!1}},{message:"Invalid RegExp string format. Must be in format '/pattern/flags'"}).transform(r=>{let{pattern:u,flags:h}=Ri(r);try{return new RegExp(u,h)}catch(C){throw new Error(`Invalid RegExp: ${C.message}`)}})),fe=i.string().or(i.object({$in:i.string().array()})).or(i.object({$regex:Pi})),Oi=i.object({backgroundColor:i.string().optional(),backgroundImage:i.string().optional(),fadeBackgroundImage:i.boolean().optional(),repeatBackgroundImage:i.boolean().optional(),fontColor:i.string().optional(),accentColor:i.string().optional(),accentFontColor:i.string().optional(),idBackgroundImage:i.string().optional(),fadeIdBackgroundImage:i.boolean().optional(),idBackgroundColor:i.string().optional(),repeatIdBackgroundImage:i.boolean().optional()}),ft=i.object({profileId:i.string().min(3).max(40).describe("Unique, URL-safe identifier for the profile."),displayName:i.string().default("").describe("Human-readable display name for the profile."),shortBio:i.string().default("").describe("Short bio for the profile."),bio:i.string().default("").describe("Longer bio for the profile."),did:i.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),isPrivate:i.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),email:i.string().optional().describe("Contact email address for the profile. (deprecated)"),image:i.string().optional().describe("Profile image URL for the profile."),heroImage:i.string().optional().describe("Hero image URL for the profile."),websiteLink:i.string().optional().describe("Website link for the profile."),isServiceProfile:i.boolean().default(!1).optional().describe("Whether the profile is a service profile or not."),type:i.string().optional().describe('Profile type: e.g. "person", "organization", "service".'),notificationsWebhook:i.string().url().startsWith("http").optional().describe("URL to send notifications to."),display:Oi.optional().describe("Display settings for the profile."),highlightedCredentials:i.array(i.string()).max(5).optional().describe("Up to 5 unique boost URIs to highlight on the profile."),role:i.string().default("").optional().describe('Role of the profile: e.g. "teacher", "student".'),dob:i.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".'),country:i.string().optional().describe("Country for the profile."),approved:i.boolean().optional().describe("Approval status for the profile.")}),$o=i.object({profileId:fe,displayName:fe,shortBio:fe,bio:fe,email:fe,websiteLink:fe,isServiceProfile:i.boolean(),type:fe}).partial(),Fo=Ne.extend({records:ft.array()}),Wo=i.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),Xn=i.object({id:i.string(),created:i.string(),displayName:i.string().default("").optional(),shortBio:i.string().default("").optional(),bio:i.string().default("").optional(),email:i.string().optional(),image:i.string().optional(),heroImage:i.string().optional()}),Go=Ne.extend({records:Xn.extend({did:i.string()}).array()}),Ho=i.object({id:fe,displayName:fe,shortBio:fe,bio:fe,email:fe}).partial(),ji=Ne.extend({records:i.object({profile:ft,manager:Xn.extend({did:i.string()}).optional()}).array()}),Vi=i.object({uri:i.string(),to:i.string(),from:i.string(),sent:i.string().datetime(),received:i.string().datetime().optional()}),Cn=i.object({role:i.string(),canEdit:i.boolean(),canIssue:i.boolean(),canRevoke:i.boolean(),canManagePermissions:i.boolean(),canIssueChildren:i.string(),canCreateChildren:i.string(),canEditChildren:i.string(),canRevokeChildren:i.string(),canManageChildrenPermissions:i.string(),canManageChildrenProfiles:i.boolean().default(!1).optional(),canViewAnalytics:i.boolean()}),Ai=i.object({role:fe,canEdit:i.boolean(),canIssue:i.boolean(),canRevoke:i.boolean(),canManagePermissions:i.boolean(),canIssueChildren:fe,canCreateChildren:fe,canEditChildren:fe,canRevokeChildren:fe,canManageChildrenPermissions:fe,canManageChildrenProfiles:i.boolean(),canViewAnalytics:i.boolean()}).partial(),xn=i.enum(["GRANT_PERMISSIONS","ADD_ADMIN","AUTO_CONNECT"]),Ii=i.discriminatedUnion("type",[i.object({type:i.literal(xn.Values.GRANT_PERMISSIONS),data:i.object({claimUri:i.string(),targetUri:i.string(),permissions:Cn.partial()})}),i.object({type:i.literal(xn.Values.ADD_ADMIN),data:i.object({claimUri:i.string(),targetUri:i.string()})}),i.object({type:i.literal(xn.Values.AUTO_CONNECT),data:i.object({claimUri:i.string(),targetUri:i.string()})})]),Ni=i.object({type:fe,data:i.object({claimUri:fe,targetUri:fe,permissions:Ai})}).deepPartial(),Di=i.object({id:i.string(),createdAt:i.string(),updatedAt:i.string()}).and(Ii),Za=Ne.extend({records:Di.array()}),Ir=i.enum(["DRAFT","LIVE"]),Mi=i.object({uri:i.string(),name:i.string().optional(),type:i.string().optional(),category:i.string().optional(),status:Ir.optional(),autoConnectRecipients:i.boolean().optional(),meta:i.record(i.any()).optional(),claimPermissions:Cn.optional(),allowAnyoneToCreateChildren:i.boolean().optional()}),Jo=i.object({uri:fe,name:fe,type:fe,category:fe,meta:i.record(fe),status:Ir.or(i.object({$in:Ir.array()})),autoConnectRecipients:i.boolean()}).partial(),Qo=Ne.extend({records:Mi.array()}),Li=i.object({to:ft,from:i.string(),received:i.string().optional(),uri:i.string().optional()}),Zi=Ne.extend({records:Li.array()}),En=i.object({to:ft,from:i.string(),received:i.string().optional(),boostUris:i.array(i.string()),credentialUris:i.array(i.string()).optional()}),Yo=Ne.extend({records:En.array()}),Ua=i.object({endpoint:i.string(),name:i.string(),did:i.string().optional()}),Ko=i.object({ttlSeconds:i.number().optional(),totalUses:i.number().optional()}),Ba=i.object({endpoint:i.string()}),Xo=i.object({signingAuthority:Ba,relationship:i.object({name:i.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:i.string(),isPrimary:i.boolean().optional()})}),Ui=i.object({boostUri:i.string(),signingAuthority:i.object({endpoint:i.string(),name:i.string()})}),qa=i.enum(["live","stale","withdrawn"]),za=i.object({read:i.object({anonymize:i.boolean().optional(),credentials:i.object({categories:i.record(i.object({required:i.boolean(),defaultEnabled:i.boolean().optional()})).default({})}).default({}),personal:i.record(i.object({required:i.boolean(),defaultEnabled:i.boolean().optional()})).default({})}).default({}),write:i.object({credentials:i.object({categories:i.record(i.object({required:i.boolean(),defaultEnabled:i.boolean().optional()})).default({})}).default({}),personal:i.record(i.object({required:i.boolean(),defaultEnabled:i.boolean().optional()})).default({})}).default({})}),ir=i.object({contract:za,owner:ft,name:i.string(),subtitle:i.string().optional(),description:i.string().optional(),reasonForAccessing:i.string().optional(),image:i.string().optional(),uri:i.string(),needsGuardianConsent:i.boolean().optional(),redirectUrl:i.string().optional(),frontDoorBoostUri:i.string().optional(),createdAt:i.string(),updatedAt:i.string(),expiresAt:i.string().optional(),autoBoosts:i.string().array().optional(),writers:i.array(ft).optional()}),Bi=Ne.extend({records:ir.omit({owner:!0}).array()}),$a=i.object({credentials:i.object({categories:i.record(i.string().array()).default({})}),personal:i.record(i.string()).default({}),date:i.string()}),es=Ne.extend({records:$a.array()}),Fa=i.object({credentials:i.object({category:i.string(),uri:i.string()}).array(),personal:i.record(i.string()).default({}),date:i.string(),contractUri:i.string()}),ts=Ne.extend({records:Fa.array()}),Wa=i.object({sharing:i.boolean().optional(),shared:i.string().array().optional(),shareAll:i.boolean().optional(),shareUntil:i.string().optional()}),ea=i.object({read:i.object({anonymize:i.boolean().optional(),credentials:i.object({shareAll:i.boolean().optional(),sharing:i.boolean().optional(),categories:i.record(Wa).default({})}).default({}),personal:i.record(i.string()).default({})}).default({}),write:i.object({credentials:i.object({categories:i.record(i.boolean()).default({})}).default({}),personal:i.record(i.boolean()).default({})}).default({}),deniedWriters:i.array(i.string()).optional()}),rs=Ne.extend({records:i.object({expiresAt:i.string().optional(),oneTime:i.boolean().optional(),terms:ea,contract:ir,uri:i.string(),consenter:ft,status:qa}).array()}),qi=i.object({read:i.object({anonymize:i.boolean().optional(),credentials:i.object({categories:i.record(i.object({required:i.boolean().optional()})).optional()}).optional(),personal:i.record(i.object({required:i.boolean().optional()})).optional()}).optional(),write:i.object({credentials:i.object({categories:i.record(i.object({required:i.boolean().optional()})).optional()}).optional(),personal:i.record(i.object({required:i.boolean().optional()})).optional()}).optional()}),ns=i.object({anonymize:i.boolean().optional(),credentials:i.object({categories:i.record(i.boolean()).optional()}).optional(),personal:i.record(i.boolean()).optional()}),zi=i.object({credentials:i.object({categories:i.record(i.boolean()).optional()}).optional(),personal:i.record(i.boolean()).optional(),id:fe.optional()}),$i=i.object({read:i.object({anonymize:i.boolean().optional(),credentials:i.object({shareAll:i.boolean().optional(),sharing:i.boolean().optional(),categories:i.record(Wa.optional()).optional()}).optional(),personal:i.record(i.string()).optional()}).optional(),write:i.object({credentials:i.object({categories:i.record(i.boolean()).optional()}).optional(),personal:i.record(i.boolean()).optional()}).optional()}),Nr=i.enum(["consent","update","sync","withdraw","write"]),as=i.object({terms:$i.optional(),action:Nr.or(Nr.array()).optional(),date:i.object({$gt:i.string()}).or(i.object({$lt:i.string()})).or(i.object({$eq:i.string()})).optional(),expiresAt:i.object({$gt:i.string()}).or(i.object({$lt:i.string()})).or(i.object({$eq:i.string()})).optional(),oneTime:i.boolean().optional()}),Ga=i.object({expiresAt:i.string().optional(),oneTime:i.boolean().optional(),terms:ea.optional(),id:i.string(),action:Nr,date:i.string(),uris:i.string().array().optional()}),is=Ne.extend({records:Ga.array()}),Ha=i.object({credentialUri:i.string(),termsUri:i.string(),contractUri:i.string(),boostUri:i.string(),category:i.string().optional(),date:i.string()}),os=Ne.extend({records:Ha.array()}),Fi=i.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"]),Ja=i.object({title:i.string().optional(),body:i.string().optional()}),Wi=i.object({type:i.string(),value:i.string()}),Tn=i.enum(["PENDING","DELIVERED","CLAIMED","EXPIRED"]),Gi=i.object({issuanceId:i.string(),status:Tn,recipient:i.object({contactMethod:Wi.optional(),learnCardId:i.string().optional()}),timestamp:i.string().datetime().optional()}),t=i.object({vcUris:i.array(i.string()).optional(),vpUris:i.array(i.string()).optional(),transaction:Ga.optional(),inbox:Gi.optional()}),d=i.object({type:Fi,to:ft.partial().and(i.object({did:i.string()})),from:ft.partial().and(i.object({did:i.string()})),message:Ja.optional(),data:t.optional(),sent:i.string().datetime().optional(),webhookUrl:i.string().optional()}),p="auth-grant:",x=i.object({id:i.string(),name:i.string(),description:i.string().optional(),challenge:i.string().startsWith(p).min(10,{message:"Challenge is too short"}).max(100,{message:"Challenge is too long"}),status:i.enum(["revoked","active"],{required_error:"Status is required",invalid_type_error:"Status must be either active or revoked"}),scope:i.string(),createdAt:i.string().datetime({message:"createdAt must be a valid ISO 8601 datetime string"}),expiresAt:i.string().datetime({message:"expiresAt must be a valid ISO 8601 datetime string"}).nullish().optional()}),_=i.object({id:i.string()}).catchall(i.any()),k=i.enum(["active","revoked"]),T=i.object({id:fe,name:fe,description:fe,status:k}).partial(),D=i.object({id:i.string(),isVerified:i.boolean(),verifiedAt:i.string().optional(),isPrimary:i.boolean(),createdAt:i.string()}),A=i.discriminatedUnion("type",[i.object({type:i.literal("email"),value:i.string().email()}).merge(D),i.object({type:i.literal("phone"),value:i.string()}).merge(D)]),te=i.object({isVerified:i.boolean().optional(),isPrimary:i.boolean().optional()}),we=i.discriminatedUnion("type",[i.object({type:i.literal("email"),value:i.string().email()}).merge(te),i.object({type:i.literal("phone"),value:i.string()}).merge(te)]),ta=i.discriminatedUnion("type",[i.object({type:i.literal("email"),value:i.string().email()}),i.object({type:i.literal("phone"),value:i.string()})]),Qa=i.object({value:i.string(),type:i.enum(["email","phone"])}),ul=i.object({token:i.string()}),pl=i.object({contactMethodId:i.string()}),Hs=i.object({id:i.string(),credential:i.string(),isSigned:i.boolean(),currentStatus:Tn,expiresAt:i.string(),createdAt:i.string(),issuerDid:i.string(),webhookUrl:i.string().optional(),signingAuthority:i.object({endpoint:i.string().optional(),name:i.string().optional()}).optional()}),fl=i.object({hasMore:i.boolean(),records:i.array(Hs),cursor:i.string().optional()}),hl=i.object({currentStatus:Tn,id:i.string(),isSigned:i.boolean(),issuerDid:i.string()}).partial(),Js=i.object({endpoint:i.string().url(),name:i.string()}),ml=i.object({recipient:ta.describe("The recipient of the credential"),credential:vn.passthrough().or(Ra.passthrough()).or(ar.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:i.object({signingAuthority:Js.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:i.string().url().optional().describe("The webhook URL to receive credential issuance events."),expiresInDays:i.number().min(1).max(365).optional().describe("The number of days the credential will be valid for."),delivery:i.object({suppress:i.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:i.object({id:i.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:i.object({issuer:i.object({name:i.string().optional().describe('The name of the organization (e.g., "State University").'),logoUrl:i.string().url().optional().describe("The URL of the organization's logo.")}).optional(),credential:i.object({name:i.string().optional().describe('The name of the credential (e.g., "Bachelor of Science").'),type:i.string().optional().describe('The type of the credential (e.g., "degree", "certificate").')}).optional(),recipient:i.object({name:i.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.")}),gl=i.object({issuanceId:i.string(),status:Tn,recipient:ta,claimUrl:i.string().url().optional(),recipientDid:i.string().optional()}),yl=i.object({token:i.string(),contactMethodId:i.string(),autoVerifyContactMethod:i.boolean().optional().default(!1),createdAt:i.string(),expiresAt:i.string(),used:i.boolean()})}}),j=m({"../learn-card-types/dist/index.js"(de,ye){"use strict";ye.exports=oe()}}),ke={};E(ke,{RegExpTransformer:()=>ha,isEncrypted:()=>Mn,isHex:()=>Pt,isVC2Format:()=>pr}),e.exports=O(ke);var Re=z(j()),Pt=f(de=>/^[0-9a-f]+$/i.test(de),"isHex"),Mn=f(de=>Re.JWEValidator.safeParse(de).success,"isEncrypted"),ha={serialize(de){return JSON.stringify(de,(ye,L)=>L instanceof RegExp?L.toString():L)},deserialize(de){return typeof de!="string"?de:JSON.parse(de,(ye,L)=>{if(typeof L=="string"){let be=L.match(/^\/(.*)\/([gimsuy]*)$/);if(be)try{return new RegExp(be[1],be[2])}catch(G){return console.warn(`Failed to parse RegExp: ${G}`),L}}return L})}},pr=f(de=>!de["@context"]||!Array.isArray(de["@context"])?!1:de["@context"].includes("https://www.w3.org/ns/credentials/v2"),"isVC2Format")}}),Rd=Pc({"../../learn-card-helpers/dist/index.js"(n,e){"use strict";e.exports=Sd()}}),As=kd(Rd()),Pd=ue(n=>()=>({next:e,op:s})=>Vs(l=>{let c=null,g=0,y=!1,v=ue(()=>{g+=1,c?.unsubscribe(),c=e(s).subscribe({error:async f=>{if(g>5||f.data?.httpStatus!==401)return l.error(f);await n(),v()},next:f=>l.next(f),complete:()=>{y&&l.complete()}})},"attempt");return v(),()=>{y=!0,c?.unsubscribe()}}),"callbackLink"),Oc=ue(async(n,e)=>{let s=[],l=oa({links:[ti({methodOverride:"POST",url:n,maxURLLength:3072,headers:{Authorization:`Bearer ${await e()}`},transformer:{input:As.RegExpTransformer,output:{serialize:y=>y,deserialize:y=>y}}})]}),c=ue(async(y=95+Math.round((Math.random()-.5)*5))=>l.utilities.getChallenges.query({amount:y}),"getChallenges");return c().then(y=>s=y),oa({links:[Pd(async()=>{s=await c()}),ti({methodOverride:"POST",maxURLLength:3072,url:n,headers:async()=>(s.length===0&&s.push(...await c()),{Authorization:`Bearer ${await e(s.pop())}`}),transformer:{input:As.RegExpTransformer,output:{serialize:y=>y,deserialize:y=>y}}})]})},"getClient"),jc=ue(async(n,e)=>oa({links:[ti({methodOverride:"POST",url:n,maxURLLength:3072,headers:{Authorization:`Bearer ${e}`},transformer:{input:As.RegExpTransformer,output:{serialize:l=>l,deserialize:l=>l}}})]}),"getApiTokenClient");var he;(function(n){n.assertEqual=c=>c;function e(c){}b(e,"assertIs"),n.assertIs=e;function s(c){throw new Error}b(s,"assertNever"),n.assertNever=s,n.arrayToEnum=c=>{let g={};for(let y of c)g[y]=y;return g},n.getValidEnumValues=c=>{let g=n.objectKeys(c).filter(v=>typeof c[c[v]]!="number"),y={};for(let v of g)y[v]=c[v];return n.objectValues(y)},n.objectValues=c=>n.objectKeys(c).map(function(g){return c[g]}),n.objectKeys=typeof Object.keys=="function"?c=>Object.keys(c):c=>{let g=[];for(let y in c)Object.prototype.hasOwnProperty.call(c,y)&&g.push(y);return g},n.find=(c,g)=>{for(let y of c)if(g(y))return y},n.isInteger=typeof Number.isInteger=="function"?c=>Number.isInteger(c):c=>typeof c=="number"&&isFinite(c)&&Math.floor(c)===c;function l(c,g=" | "){return c.map(y=>typeof y=="string"?`'${y}'`:y).join(g)}b(l,"joinValues"),n.joinValues=l,n.jsonStringifyReplacer=(c,g)=>typeof g=="bigint"?g.toString():g})(he||(he={}));var Ds;(function(n){n.mergeShapes=(e,s)=>({...e,...s})})(Ds||(Ds={}));var $=he.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Br=b(n=>{switch(typeof n){case"undefined":return $.undefined;case"string":return $.string;case"number":return isNaN(n)?$.nan:$.number;case"boolean":return $.boolean;case"function":return $.function;case"bigint":return $.bigint;case"symbol":return $.symbol;case"object":return Array.isArray(n)?$.array:n===null?$.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?$.promise:typeof Map<"u"&&n instanceof Map?$.map:typeof Set<"u"&&n instanceof Set?$.set:typeof Date<"u"&&n instanceof Date?$.date:$.object;default:return $.unknown}},"getParsedType"),U=he.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"]),Od=b(n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),qe=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=l=>{this.issues=[...this.issues,l]},this.addIssues=(l=[])=>{this.issues=[...this.issues,...l]};let s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let s=e||function(g){return g.message},l={_errors:[]},c=b(g=>{for(let y of g.issues)if(y.code==="invalid_union")y.unionErrors.map(c);else if(y.code==="invalid_return_type")c(y.returnTypeError);else if(y.code==="invalid_arguments")c(y.argumentsError);else if(y.path.length===0)l._errors.push(s(y));else{let v=l,f=0;for(;f<y.path.length;){let m=y.path[f];f===y.path.length-1?(v[m]=v[m]||{_errors:[]},v[m]._errors.push(s(y))):v[m]=v[m]||{_errors:[]},v=v[m],f++}}},"processError");return c(this),l}static assert(e){if(!(e instanceof qe))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,he.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=s=>s.message){let s={},l=[];for(let c of this.issues)c.path.length>0?(s[c.path[0]]=s[c.path[0]]||[],s[c.path[0]].push(e(c))):l.push(e(c));return{formErrors:l,fieldErrors:s}}get formErrors(){return this.flatten()}};b(qe,"ZodError");qe.create=n=>new qe(n);var ua=b((n,e)=>{let s;switch(n.code){case U.invalid_type:n.received===$.undefined?s="Required":s=`Expected ${n.expected}, received ${n.received}`;break;case U.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(n.expected,he.jsonStringifyReplacer)}`;break;case U.unrecognized_keys:s=`Unrecognized key(s) in object: ${he.joinValues(n.keys,", ")}`;break;case U.invalid_union:s="Invalid input";break;case U.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${he.joinValues(n.options)}`;break;case U.invalid_enum_value:s=`Invalid enum value. Expected ${he.joinValues(n.options)}, received '${n.received}'`;break;case U.invalid_arguments:s="Invalid function arguments";break;case U.invalid_return_type:s="Invalid function return type";break;case U.invalid_date:s="Invalid date";break;case U.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(s=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(s=`${s} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?s=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?s=`Invalid input: must end with "${n.validation.endsWith}"`:he.assertNever(n.validation):n.validation!=="regex"?s=`Invalid ${n.validation}`:s="Invalid";break;case U.too_small:n.type==="array"?s=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?s=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?s=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?s=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:s="Invalid input";break;case U.too_big:n.type==="array"?s=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?s=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?s=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?s=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?s=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:s="Invalid input";break;case U.custom:s="Invalid input";break;case U.invalid_intersection_types:s="Intersection results could not be merged";break;case U.not_multiple_of:s=`Number must be a multiple of ${n.multipleOf}`;break;case U.not_finite:s="Number must be finite";break;default:s=e.defaultError,he.assertNever(n)}return{message:s}},"errorMap"),Ic=ua;function jd(n){Ic=n}b(jd,"setErrorMap");function uo(){return Ic}b(uo,"getErrorMap");var po=b(n=>{let{data:e,path:s,errorMaps:l,issueData:c}=n,g=[...s,...c.path||[]],y={...c,path:g};if(c.message!==void 0)return{...c,path:g,message:c.message};let v="",f=l.filter(m=>!!m).slice().reverse();for(let m of f)v=m(y,{data:e,defaultError:v}).message;return{...c,path:g,message:v}},"makeIssue"),Vd=[];function q(n,e){let s=uo(),l=po({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,s,s===ua?void 0:ua].filter(c=>!!c)});n.common.issues.push(l)}b(q,"addIssueToContext");var Ve=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,s){let l=[];for(let c of s){if(c.status==="aborted")return ne;c.status==="dirty"&&e.dirty(),l.push(c.value)}return{status:e.value,value:l}}static async mergeObjectAsync(e,s){let l=[];for(let c of s){let g=await c.key,y=await c.value;l.push({key:g,value:y})}return Ve.mergeObjectSync(e,l)}static mergeObjectSync(e,s){let l={};for(let c of s){let{key:g,value:y}=c;if(g.status==="aborted"||y.status==="aborted")return ne;g.status==="dirty"&&e.dirty(),y.status==="dirty"&&e.dirty(),g.value!=="__proto__"&&(typeof y.value<"u"||c.alwaysSet)&&(l[g.value]=y.value)}return{status:e.value,value:l}}};b(Ve,"ParseStatus");var ne=Object.freeze({status:"aborted"}),la=b(n=>({status:"dirty",value:n}),"DIRTY"),He=b(n=>({status:"valid",value:n}),"OK"),Ms=b(n=>n.status==="aborted","isAborted"),Ls=b(n=>n.status==="dirty","isDirty"),ai=b(n=>n.status==="valid","isValid"),ii=b(n=>typeof Promise<"u"&&n instanceof Promise,"isAsync");function fo(n,e,s,l){if(s==="a"&&!l)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!l:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?l:s==="a"?l.call(n):l?l.value:e.get(n)}b(fo,"__classPrivateFieldGet");function Nc(n,e,s,l,c){if(l==="m")throw new TypeError("Private method is not writable");if(l==="a"&&!c)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!c:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return l==="a"?c.call(n,s):c?c.value=s:e.set(n,s),s}b(Nc,"__classPrivateFieldSet");var H;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e?.message})(H||(H={}));var ri,ni,ht=class{constructor(e,s,l,c){this._cachedPath=[],this.parent=e,this.data=s,this._path=l,this._key=c}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}};b(ht,"ParseInputLazyPath");var Vc=b((n,e)=>{if(ai(e))return{success:!0,data:e.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 s=new qe(n.common.issues);return this._error=s,this._error}}},"handleResult");function ce(n){if(!n)return{};let{errorMap:e,invalid_type_error:s,required_error:l,description:c}=n;if(e&&(s||l))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:c}:{errorMap:b((y,v)=>{var f,m;let{message:E}=n;return y.code==="invalid_enum_value"?{message:E??v.defaultError}:typeof v.data>"u"?{message:(f=E??l)!==null&&f!==void 0?f:v.defaultError}:y.code!=="invalid_type"?{message:v.defaultError}:{message:(m=E??s)!==null&&m!==void 0?m:v.defaultError}},"customMap"),description:c}}b(ce,"processCreateParams");var se=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,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(e){return Br(e.data)}_getOrReturnCtx(e,s){return s||{common:e.parent.common,data:e.data,parsedType:Br(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ve,ctx:{common:e.parent.common,data:e.data,parsedType:Br(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let s=this._parse(e);if(ii(s))throw new Error("Synchronous parse encountered promise.");return s}_parseAsync(e){let s=this._parse(e);return Promise.resolve(s)}parse(e,s){let l=this.safeParse(e,s);if(l.success)return l.data;throw l.error}safeParse(e,s){var l;let c={common:{issues:[],async:(l=s?.async)!==null&&l!==void 0?l:!1,contextualErrorMap:s?.errorMap},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Br(e)},g=this._parseSync({data:e,path:c.path,parent:c});return Vc(c,g)}async parseAsync(e,s){let l=await this.safeParseAsync(e,s);if(l.success)return l.data;throw l.error}async safeParseAsync(e,s){let l={common:{issues:[],contextualErrorMap:s?.errorMap,async:!0},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Br(e)},c=this._parse({data:e,path:l.path,parent:l}),g=await(ii(c)?c:Promise.resolve(c));return Vc(l,g)}refine(e,s){let l=b(c=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(c):s,"getIssueProperties");return this._refinement((c,g)=>{let y=e(c),v=b(()=>g.addIssue({code:U.custom,...l(c)}),"setError");return typeof Promise<"u"&&y instanceof Promise?y.then(f=>f?!0:(v(),!1)):y?!0:(v(),!1)})}refinement(e,s){return this._refinement((l,c)=>e(l)?!0:(c.addIssue(typeof s=="function"?s(l,c):s),!1))}_refinement(e){return new at({schema:this,typeName:re.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return gt.create(this,this._def)}nullable(){return Rt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return nt.create(this,this._def)}promise(){return dr.create(this,this._def)}or(e){return Fr.create([this,e],this._def)}and(e){return Wr.create(this,e,this._def)}transform(e){return new at({...ce(this._def),schema:this,typeName:re.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let s=typeof e=="function"?e:()=>e;return new Yr({...ce(this._def),innerType:this,defaultValue:s,typeName:re.ZodDefault})}brand(){return new da({typeName:re.ZodBranded,type:this,...ce(this._def)})}catch(e){let s=typeof e=="function"?e:()=>e;return new Kr({...ce(this._def),innerType:this,catchValue:s,typeName:re.ZodCatch})}describe(e){let s=this.constructor;return new s({...this._def,description:e})}pipe(e){return Xr.create(this,e)}readonly(){return en.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};b(se,"ZodType");var Ad=/^c[^\s-]{8,}$/i,Id=/^[0-9a-z]+$/,Nd=/^[0-9A-HJKMNP-TV-Z]{26}$/,Dd=/^[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,Md=/^[a-z0-9_-]{21}$/i,Ld=/^[-+]?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)?)??$/,Zd=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ud="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ns,Bd=/^(?:(?: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])$/,qd=/^(([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})))$/,zd=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Dc="((\\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])))",$d=new RegExp(`^${Dc}$`);function Mc(n){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`),e}b(Mc,"timeRegexSource");function Fd(n){return new RegExp(`^${Mc(n)}$`)}b(Fd,"timeRegex");function Lc(n){let e=`${Dc}T${Mc(n)}`,s=[];return s.push(n.local?"Z?":"Z"),n.offset&&s.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${s.join("|")})`,new RegExp(`^${e}$`)}b(Lc,"datetimeRegex");function Wd(n,e){return!!((e==="v4"||!e)&&Bd.test(n)||(e==="v6"||!e)&&qd.test(n))}b(Wd,"isValidIP");var rt=class extends se{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==$.string){let g=this._getOrReturnCtx(e);return q(g,{code:U.invalid_type,expected:$.string,received:g.parsedType}),ne}let l=new Ve,c;for(let g of this._def.checks)if(g.kind==="min")e.data.length<g.value&&(c=this._getOrReturnCtx(e,c),q(c,{code:U.too_small,minimum:g.value,type:"string",inclusive:!0,exact:!1,message:g.message}),l.dirty());else if(g.kind==="max")e.data.length>g.value&&(c=this._getOrReturnCtx(e,c),q(c,{code:U.too_big,maximum:g.value,type:"string",inclusive:!0,exact:!1,message:g.message}),l.dirty());else if(g.kind==="length"){let y=e.data.length>g.value,v=e.data.length<g.value;(y||v)&&(c=this._getOrReturnCtx(e,c),y?q(c,{code:U.too_big,maximum:g.value,type:"string",inclusive:!0,exact:!0,message:g.message}):v&&q(c,{code:U.too_small,minimum:g.value,type:"string",inclusive:!0,exact:!0,message:g.message}),l.dirty())}else if(g.kind==="email")Zd.test(e.data)||(c=this._getOrReturnCtx(e,c),q(c,{validation:"email",code:U.invalid_string,message:g.message}),l.dirty());else if(g.kind==="emoji")Ns||(Ns=new RegExp(Ud,"u")),Ns.test(e.data)||(c=this._getOrReturnCtx(e,c),q(c,{validation:"emoji",code:U.invalid_string,message:g.message}),l.dirty());else if(g.kind==="uuid")Dd.test(e.data)||(c=this._getOrReturnCtx(e,c),q(c,{validation:"uuid",code:U.invalid_string,message:g.message}),l.dirty());else if(g.kind==="nanoid")Md.test(e.data)||(c=this._getOrReturnCtx(e,c),q(c,{validation:"nanoid",code:U.invalid_string,message:g.message}),l.dirty());else if(g.kind==="cuid")Ad.test(e.data)||(c=this._getOrReturnCtx(e,c),q(c,{validation:"cuid",code:U.invalid_string,message:g.message}),l.dirty());else if(g.kind==="cuid2")Id.test(e.data)||(c=this._getOrReturnCtx(e,c),q(c,{validation:"cuid2",code:U.invalid_string,message:g.message}),l.dirty());else if(g.kind==="ulid")Nd.test(e.data)||(c=this._getOrReturnCtx(e,c),q(c,{validation:"ulid",code:U.invalid_string,message:g.message}),l.dirty());else if(g.kind==="url")try{new URL(e.data)}catch{c=this._getOrReturnCtx(e,c),q(c,{validation:"url",code:U.invalid_string,message:g.message}),l.dirty()}else g.kind==="regex"?(g.regex.lastIndex=0,g.regex.test(e.data)||(c=this._getOrReturnCtx(e,c),q(c,{validation:"regex",code:U.invalid_string,message:g.message}),l.dirty())):g.kind==="trim"?e.data=e.data.trim():g.kind==="includes"?e.data.includes(g.value,g.position)||(c=this._getOrReturnCtx(e,c),q(c,{code:U.invalid_string,validation:{includes:g.value,position:g.position},message:g.message}),l.dirty()):g.kind==="toLowerCase"?e.data=e.data.toLowerCase():g.kind==="toUpperCase"?e.data=e.data.toUpperCase():g.kind==="startsWith"?e.data.startsWith(g.value)||(c=this._getOrReturnCtx(e,c),q(c,{code:U.invalid_string,validation:{startsWith:g.value},message:g.message}),l.dirty()):g.kind==="endsWith"?e.data.endsWith(g.value)||(c=this._getOrReturnCtx(e,c),q(c,{code:U.invalid_string,validation:{endsWith:g.value},message:g.message}),l.dirty()):g.kind==="datetime"?Lc(g).test(e.data)||(c=this._getOrReturnCtx(e,c),q(c,{code:U.invalid_string,validation:"datetime",message:g.message}),l.dirty()):g.kind==="date"?$d.test(e.data)||(c=this._getOrReturnCtx(e,c),q(c,{code:U.invalid_string,validation:"date",message:g.message}),l.dirty()):g.kind==="time"?Fd(g).test(e.data)||(c=this._getOrReturnCtx(e,c),q(c,{code:U.invalid_string,validation:"time",message:g.message}),l.dirty()):g.kind==="duration"?Ld.test(e.data)||(c=this._getOrReturnCtx(e,c),q(c,{validation:"duration",code:U.invalid_string,message:g.message}),l.dirty()):g.kind==="ip"?Wd(e.data,g.version)||(c=this._getOrReturnCtx(e,c),q(c,{validation:"ip",code:U.invalid_string,message:g.message}),l.dirty()):g.kind==="base64"?zd.test(e.data)||(c=this._getOrReturnCtx(e,c),q(c,{validation:"base64",code:U.invalid_string,message:g.message}),l.dirty()):he.assertNever(g);return{status:l.value,value:e.data}}_regex(e,s,l){return this.refinement(c=>e.test(c),{validation:s,code:U.invalid_string,...H.errToObj(l)})}_addCheck(e){return new rt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...H.errToObj(e)})}url(e){return this._addCheck({kind:"url",...H.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...H.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...H.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...H.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...H.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...H.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...H.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...H.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...H.errToObj(e)})}datetime(e){var s,l;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(s=e?.offset)!==null&&s!==void 0?s:!1,local:(l=e?.local)!==null&&l!==void 0?l:!1,...H.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...H.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...H.errToObj(e)})}regex(e,s){return this._addCheck({kind:"regex",regex:e,...H.errToObj(s)})}includes(e,s){return this._addCheck({kind:"includes",value:e,position:s?.position,...H.errToObj(s?.message)})}startsWith(e,s){return this._addCheck({kind:"startsWith",value:e,...H.errToObj(s)})}endsWith(e,s){return this._addCheck({kind:"endsWith",value:e,...H.errToObj(s)})}min(e,s){return this._addCheck({kind:"min",value:e,...H.errToObj(s)})}max(e,s){return this._addCheck({kind:"max",value:e,...H.errToObj(s)})}length(e,s){return this._addCheck({kind:"length",value:e,...H.errToObj(s)})}nonempty(e){return this.min(1,H.errToObj(e))}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(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(let s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxLength(){let e=null;for(let s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}};b(rt,"ZodString");rt.create=n=>{var e;return new rt({checks:[],typeName:re.ZodString,coerce:(e=n?.coerce)!==null&&e!==void 0?e:!1,...ce(n)})};function Gd(n,e){let s=(n.toString().split(".")[1]||"").length,l=(e.toString().split(".")[1]||"").length,c=s>l?s:l,g=parseInt(n.toFixed(c).replace(".","")),y=parseInt(e.toFixed(c).replace(".",""));return g%y/Math.pow(10,c)}b(Gd,"floatSafeRemainder");var Tt=class extends se{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==$.number){let g=this._getOrReturnCtx(e);return q(g,{code:U.invalid_type,expected:$.number,received:g.parsedType}),ne}let l,c=new Ve;for(let g of this._def.checks)g.kind==="int"?he.isInteger(e.data)||(l=this._getOrReturnCtx(e,l),q(l,{code:U.invalid_type,expected:"integer",received:"float",message:g.message}),c.dirty()):g.kind==="min"?(g.inclusive?e.data<g.value:e.data<=g.value)&&(l=this._getOrReturnCtx(e,l),q(l,{code:U.too_small,minimum:g.value,type:"number",inclusive:g.inclusive,exact:!1,message:g.message}),c.dirty()):g.kind==="max"?(g.inclusive?e.data>g.value:e.data>=g.value)&&(l=this._getOrReturnCtx(e,l),q(l,{code:U.too_big,maximum:g.value,type:"number",inclusive:g.inclusive,exact:!1,message:g.message}),c.dirty()):g.kind==="multipleOf"?Gd(e.data,g.value)!==0&&(l=this._getOrReturnCtx(e,l),q(l,{code:U.not_multiple_of,multipleOf:g.value,message:g.message}),c.dirty()):g.kind==="finite"?Number.isFinite(e.data)||(l=this._getOrReturnCtx(e,l),q(l,{code:U.not_finite,message:g.message}),c.dirty()):he.assertNever(g);return{status:c.value,value:e.data}}gte(e,s){return this.setLimit("min",e,!0,H.toString(s))}gt(e,s){return this.setLimit("min",e,!1,H.toString(s))}lte(e,s){return this.setLimit("max",e,!0,H.toString(s))}lt(e,s){return this.setLimit("max",e,!1,H.toString(s))}setLimit(e,s,l,c){return new Tt({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:l,message:H.toString(c)}]})}_addCheck(e){return new Tt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:H.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:H.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:H.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:H.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:H.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:H.toString(s)})}finite(e){return this._addCheck({kind:"finite",message:H.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:H.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:H.toString(e)})}get minValue(){let e=null;for(let s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxValue(){let e=null;for(let s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&he.isInteger(e.value))}get isFinite(){let e=null,s=null;for(let l of this._def.checks){if(l.kind==="finite"||l.kind==="int"||l.kind==="multipleOf")return!0;l.kind==="min"?(s===null||l.value>s)&&(s=l.value):l.kind==="max"&&(e===null||l.value<e)&&(e=l.value)}return Number.isFinite(s)&&Number.isFinite(e)}};b(Tt,"ZodNumber");Tt.create=n=>new Tt({checks:[],typeName:re.ZodNumber,coerce:n?.coerce||!1,...ce(n)});var kt=class extends se{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==$.bigint){let g=this._getOrReturnCtx(e);return q(g,{code:U.invalid_type,expected:$.bigint,received:g.parsedType}),ne}let l,c=new Ve;for(let g of this._def.checks)g.kind==="min"?(g.inclusive?e.data<g.value:e.data<=g.value)&&(l=this._getOrReturnCtx(e,l),q(l,{code:U.too_small,type:"bigint",minimum:g.value,inclusive:g.inclusive,message:g.message}),c.dirty()):g.kind==="max"?(g.inclusive?e.data>g.value:e.data>=g.value)&&(l=this._getOrReturnCtx(e,l),q(l,{code:U.too_big,type:"bigint",maximum:g.value,inclusive:g.inclusive,message:g.message}),c.dirty()):g.kind==="multipleOf"?e.data%g.value!==BigInt(0)&&(l=this._getOrReturnCtx(e,l),q(l,{code:U.not_multiple_of,multipleOf:g.value,message:g.message}),c.dirty()):he.assertNever(g);return{status:c.value,value:e.data}}gte(e,s){return this.setLimit("min",e,!0,H.toString(s))}gt(e,s){return this.setLimit("min",e,!1,H.toString(s))}lte(e,s){return this.setLimit("max",e,!0,H.toString(s))}lt(e,s){return this.setLimit("max",e,!1,H.toString(s))}setLimit(e,s,l,c){return new kt({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:l,message:H.toString(c)}]})}_addCheck(e){return new kt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:H.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:H.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:H.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:H.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:H.toString(s)})}get minValue(){let e=null;for(let s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxValue(){let e=null;for(let s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}};b(kt,"ZodBigInt");kt.create=n=>{var e;return new kt({checks:[],typeName:re.ZodBigInt,coerce:(e=n?.coerce)!==null&&e!==void 0?e:!1,...ce(n)})};var qr=class extends se{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==$.boolean){let l=this._getOrReturnCtx(e);return q(l,{code:U.invalid_type,expected:$.boolean,received:l.parsedType}),ne}return He(e.data)}};b(qr,"ZodBoolean");qr.create=n=>new qr({typeName:re.ZodBoolean,coerce:n?.coerce||!1,...ce(n)});var qt=class extends se{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==$.date){let g=this._getOrReturnCtx(e);return q(g,{code:U.invalid_type,expected:$.date,received:g.parsedType}),ne}if(isNaN(e.data.getTime())){let g=this._getOrReturnCtx(e);return q(g,{code:U.invalid_date}),ne}let l=new Ve,c;for(let g of this._def.checks)g.kind==="min"?e.data.getTime()<g.value&&(c=this._getOrReturnCtx(e,c),q(c,{code:U.too_small,message:g.message,inclusive:!0,exact:!1,minimum:g.value,type:"date"}),l.dirty()):g.kind==="max"?e.data.getTime()>g.value&&(c=this._getOrReturnCtx(e,c),q(c,{code:U.too_big,message:g.message,inclusive:!0,exact:!1,maximum:g.value,type:"date"}),l.dirty()):he.assertNever(g);return{status:l.value,value:new Date(e.data.getTime())}}_addCheck(e){return new qt({...this._def,checks:[...this._def.checks,e]})}min(e,s){return this._addCheck({kind:"min",value:e.getTime(),message:H.toString(s)})}max(e,s){return this._addCheck({kind:"max",value:e.getTime(),message:H.toString(s)})}get minDate(){let e=null;for(let s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e!=null?new Date(e):null}};b(qt,"ZodDate");qt.create=n=>new qt({checks:[],coerce:n?.coerce||!1,typeName:re.ZodDate,...ce(n)});var On=class extends se{_parse(e){if(this._getType(e)!==$.symbol){let l=this._getOrReturnCtx(e);return q(l,{code:U.invalid_type,expected:$.symbol,received:l.parsedType}),ne}return He(e.data)}};b(On,"ZodSymbol");On.create=n=>new On({typeName:re.ZodSymbol,...ce(n)});var zr=class extends se{_parse(e){if(this._getType(e)!==$.undefined){let l=this._getOrReturnCtx(e);return q(l,{code:U.invalid_type,expected:$.undefined,received:l.parsedType}),ne}return He(e.data)}};b(zr,"ZodUndefined");zr.create=n=>new zr({typeName:re.ZodUndefined,...ce(n)});var $r=class extends se{_parse(e){if(this._getType(e)!==$.null){let l=this._getOrReturnCtx(e);return q(l,{code:U.invalid_type,expected:$.null,received:l.parsedType}),ne}return He(e.data)}};b($r,"ZodNull");$r.create=n=>new $r({typeName:re.ZodNull,...ce(n)});var cr=class extends se{constructor(){super(...arguments),this._any=!0}_parse(e){return He(e.data)}};b(cr,"ZodAny");cr.create=n=>new cr({typeName:re.ZodAny,...ce(n)});var zt=class extends se{constructor(){super(...arguments),this._unknown=!0}_parse(e){return He(e.data)}};b(zt,"ZodUnknown");zt.create=n=>new zt({typeName:re.ZodUnknown,...ce(n)});var _t=class extends se{_parse(e){let s=this._getOrReturnCtx(e);return q(s,{code:U.invalid_type,expected:$.never,received:s.parsedType}),ne}};b(_t,"ZodNever");_t.create=n=>new _t({typeName:re.ZodNever,...ce(n)});var jn=class extends se{_parse(e){if(this._getType(e)!==$.undefined){let l=this._getOrReturnCtx(e);return q(l,{code:U.invalid_type,expected:$.void,received:l.parsedType}),ne}return He(e.data)}};b(jn,"ZodVoid");jn.create=n=>new jn({typeName:re.ZodVoid,...ce(n)});var nt=class extends se{_parse(e){let{ctx:s,status:l}=this._processInputParams(e),c=this._def;if(s.parsedType!==$.array)return q(s,{code:U.invalid_type,expected:$.array,received:s.parsedType}),ne;if(c.exactLength!==null){let y=s.data.length>c.exactLength.value,v=s.data.length<c.exactLength.value;(y||v)&&(q(s,{code:y?U.too_big:U.too_small,minimum:v?c.exactLength.value:void 0,maximum:y?c.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:c.exactLength.message}),l.dirty())}if(c.minLength!==null&&s.data.length<c.minLength.value&&(q(s,{code:U.too_small,minimum:c.minLength.value,type:"array",inclusive:!0,exact:!1,message:c.minLength.message}),l.dirty()),c.maxLength!==null&&s.data.length>c.maxLength.value&&(q(s,{code:U.too_big,maximum:c.maxLength.value,type:"array",inclusive:!0,exact:!1,message:c.maxLength.message}),l.dirty()),s.common.async)return Promise.all([...s.data].map((y,v)=>c.type._parseAsync(new ht(s,y,s.path,v)))).then(y=>Ve.mergeArray(l,y));let g=[...s.data].map((y,v)=>c.type._parseSync(new ht(s,y,s.path,v)));return Ve.mergeArray(l,g)}get element(){return this._def.type}min(e,s){return new nt({...this._def,minLength:{value:e,message:H.toString(s)}})}max(e,s){return new nt({...this._def,maxLength:{value:e,message:H.toString(s)}})}length(e,s){return new nt({...this._def,exactLength:{value:e,message:H.toString(s)}})}nonempty(e){return this.min(1,e)}};b(nt,"ZodArray");nt.create=(n,e)=>new nt({type:n,minLength:null,maxLength:null,exactLength:null,typeName:re.ZodArray,...ce(e)});function ca(n){if(n instanceof ve){let e={};for(let s in n.shape){let l=n.shape[s];e[s]=gt.create(ca(l))}return new ve({...n._def,shape:()=>e})}else return n instanceof nt?new nt({...n._def,type:ca(n.element)}):n instanceof gt?gt.create(ca(n.unwrap())):n instanceof Rt?Rt.create(ca(n.unwrap())):n instanceof mt?mt.create(n.items.map(e=>ca(e))):n}b(ca,"deepPartialify");var ve=class extends se{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),s=he.objectKeys(e);return this._cached={shape:e,keys:s}}_parse(e){if(this._getType(e)!==$.object){let m=this._getOrReturnCtx(e);return q(m,{code:U.invalid_type,expected:$.object,received:m.parsedType}),ne}let{status:l,ctx:c}=this._processInputParams(e),{shape:g,keys:y}=this._getCached(),v=[];if(!(this._def.catchall instanceof _t&&this._def.unknownKeys==="strip"))for(let m in c.data)y.includes(m)||v.push(m);let f=[];for(let m of y){let E=g[m],P=c.data[m];f.push({key:{status:"valid",value:m},value:E._parse(new ht(c,P,c.path,m)),alwaysSet:m in c.data})}if(this._def.catchall instanceof _t){let m=this._def.unknownKeys;if(m==="passthrough")for(let E of v)f.push({key:{status:"valid",value:E},value:{status:"valid",value:c.data[E]}});else if(m==="strict")v.length>0&&(q(c,{code:U.unrecognized_keys,keys:v}),l.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let m=this._def.catchall;for(let E of v){let P=c.data[E];f.push({key:{status:"valid",value:E},value:m._parse(new ht(c,P,c.path,E)),alwaysSet:E in c.data})}}return c.common.async?Promise.resolve().then(async()=>{let m=[];for(let E of f){let P=await E.key,z=await E.value;m.push({key:P,value:z,alwaysSet:E.alwaysSet})}return m}).then(m=>Ve.mergeObjectSync(l,m)):Ve.mergeObjectSync(l,f)}get shape(){return this._def.shape()}strict(e){return H.errToObj,new ve({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(s,l)=>{var c,g,y,v;let f=(y=(g=(c=this._def).errorMap)===null||g===void 0?void 0:g.call(c,s,l).message)!==null&&y!==void 0?y:l.defaultError;return s.code==="unrecognized_keys"?{message:(v=H.errToObj(e).message)!==null&&v!==void 0?v:f}:{message:f}}}:{}})}strip(){return new ve({...this._def,unknownKeys:"strip"})}passthrough(){return new ve({...this._def,unknownKeys:"passthrough"})}extend(e){return new ve({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ve({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:re.ZodObject})}setKey(e,s){return this.augment({[e]:s})}catchall(e){return new ve({...this._def,catchall:e})}pick(e){let s={};return he.objectKeys(e).forEach(l=>{e[l]&&this.shape[l]&&(s[l]=this.shape[l])}),new ve({...this._def,shape:()=>s})}omit(e){let s={};return he.objectKeys(this.shape).forEach(l=>{e[l]||(s[l]=this.shape[l])}),new ve({...this._def,shape:()=>s})}deepPartial(){return ca(this)}partial(e){let s={};return he.objectKeys(this.shape).forEach(l=>{let c=this.shape[l];e&&!e[l]?s[l]=c:s[l]=c.optional()}),new ve({...this._def,shape:()=>s})}required(e){let s={};return he.objectKeys(this.shape).forEach(l=>{if(e&&!e[l])s[l]=this.shape[l];else{let g=this.shape[l];for(;g instanceof gt;)g=g._def.innerType;s[l]=g}}),new ve({...this._def,shape:()=>s})}keyof(){return Zc(he.objectKeys(this.shape))}};b(ve,"ZodObject");ve.create=(n,e)=>new ve({shape:()=>n,unknownKeys:"strip",catchall:_t.create(),typeName:re.ZodObject,...ce(e)});ve.strictCreate=(n,e)=>new ve({shape:()=>n,unknownKeys:"strict",catchall:_t.create(),typeName:re.ZodObject,...ce(e)});ve.lazycreate=(n,e)=>new ve({shape:n,unknownKeys:"strip",catchall:_t.create(),typeName:re.ZodObject,...ce(e)});var Fr=class extends se{_parse(e){let{ctx:s}=this._processInputParams(e),l=this._def.options;function c(g){for(let v of g)if(v.result.status==="valid")return v.result;for(let v of g)if(v.result.status==="dirty")return s.common.issues.push(...v.ctx.common.issues),v.result;let y=g.map(v=>new qe(v.ctx.common.issues));return q(s,{code:U.invalid_union,unionErrors:y}),ne}if(b(c,"handleResults"),s.common.async)return Promise.all(l.map(async g=>{let y={...s,common:{...s.common,issues:[]},parent:null};return{result:await g._parseAsync({data:s.data,path:s.path,parent:y}),ctx:y}})).then(c);{let g,y=[];for(let f of l){let m={...s,common:{...s.common,issues:[]},parent:null},E=f._parseSync({data:s.data,path:s.path,parent:m});if(E.status==="valid")return E;E.status==="dirty"&&!g&&(g={result:E,ctx:m}),m.common.issues.length&&y.push(m.common.issues)}if(g)return s.common.issues.push(...g.ctx.common.issues),g.result;let v=y.map(f=>new qe(f));return q(s,{code:U.invalid_union,unionErrors:v}),ne}}get options(){return this._def.options}};b(Fr,"ZodUnion");Fr.create=(n,e)=>new Fr({options:n,typeName:re.ZodUnion,...ce(e)});var sr=b(n=>n instanceof Hr?sr(n.schema):n instanceof at?sr(n.innerType()):n instanceof Jr?[n.value]:n instanceof St?n.options:n instanceof Qr?he.objectValues(n.enum):n instanceof Yr?sr(n._def.innerType):n instanceof zr?[void 0]:n instanceof $r?[null]:n instanceof gt?[void 0,...sr(n.unwrap())]:n instanceof Rt?[null,...sr(n.unwrap())]:n instanceof da||n instanceof en?sr(n.unwrap()):n instanceof Kr?sr(n._def.innerType):[],"getDiscriminator"),Vn=class extends se{_parse(e){let{ctx:s}=this._processInputParams(e);if(s.parsedType!==$.object)return q(s,{code:U.invalid_type,expected:$.object,received:s.parsedType}),ne;let l=this.discriminator,c=s.data[l],g=this.optionsMap.get(c);return g?s.common.async?g._parseAsync({data:s.data,path:s.path,parent:s}):g._parseSync({data:s.data,path:s.path,parent:s}):(q(s,{code:U.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[l]}),ne)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,s,l){let c=new Map;for(let g of s){let y=sr(g.shape[e]);if(!y.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let v of y){if(c.has(v))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(v)}`);c.set(v,g)}}return new Vn({typeName:re.ZodDiscriminatedUnion,discriminator:e,options:s,optionsMap:c,...ce(l)})}};b(Vn,"ZodDiscriminatedUnion");function Zs(n,e){let s=Br(n),l=Br(e);if(n===e)return{valid:!0,data:n};if(s===$.object&&l===$.object){let c=he.objectKeys(e),g=he.objectKeys(n).filter(v=>c.indexOf(v)!==-1),y={...n,...e};for(let v of g){let f=Zs(n[v],e[v]);if(!f.valid)return{valid:!1};y[v]=f.data}return{valid:!0,data:y}}else if(s===$.array&&l===$.array){if(n.length!==e.length)return{valid:!1};let c=[];for(let g=0;g<n.length;g++){let y=n[g],v=e[g],f=Zs(y,v);if(!f.valid)return{valid:!1};c.push(f.data)}return{valid:!0,data:c}}else return s===$.date&&l===$.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}b(Zs,"mergeValues");var Wr=class extends se{_parse(e){let{status:s,ctx:l}=this._processInputParams(e),c=b((g,y)=>{if(Ms(g)||Ms(y))return ne;let v=Zs(g.value,y.value);return v.valid?((Ls(g)||Ls(y))&&s.dirty(),{status:s.value,value:v.data}):(q(l,{code:U.invalid_intersection_types}),ne)},"handleParsed");return l.common.async?Promise.all([this._def.left._parseAsync({data:l.data,path:l.path,parent:l}),this._def.right._parseAsync({data:l.data,path:l.path,parent:l})]).then(([g,y])=>c(g,y)):c(this._def.left._parseSync({data:l.data,path:l.path,parent:l}),this._def.right._parseSync({data:l.data,path:l.path,parent:l}))}};b(Wr,"ZodIntersection");Wr.create=(n,e,s)=>new Wr({left:n,right:e,typeName:re.ZodIntersection,...ce(s)});var mt=class extends se{_parse(e){let{status:s,ctx:l}=this._processInputParams(e);if(l.parsedType!==$.array)return q(l,{code:U.invalid_type,expected:$.array,received:l.parsedType}),ne;if(l.data.length<this._def.items.length)return q(l,{code:U.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ne;!this._def.rest&&l.data.length>this._def.items.length&&(q(l,{code:U.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());let g=[...l.data].map((y,v)=>{let f=this._def.items[v]||this._def.rest;return f?f._parse(new ht(l,y,l.path,v)):null}).filter(y=>!!y);return l.common.async?Promise.all(g).then(y=>Ve.mergeArray(s,y)):Ve.mergeArray(s,g)}get items(){return this._def.items}rest(e){return new mt({...this._def,rest:e})}};b(mt,"ZodTuple");mt.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new mt({items:n,typeName:re.ZodTuple,rest:null,...ce(e)})};var Gr=class extends se{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:s,ctx:l}=this._processInputParams(e);if(l.parsedType!==$.object)return q(l,{code:U.invalid_type,expected:$.object,received:l.parsedType}),ne;let c=[],g=this._def.keyType,y=this._def.valueType;for(let v in l.data)c.push({key:g._parse(new ht(l,v,l.path,v)),value:y._parse(new ht(l,l.data[v],l.path,v)),alwaysSet:v in l.data});return l.common.async?Ve.mergeObjectAsync(s,c):Ve.mergeObjectSync(s,c)}get element(){return this._def.valueType}static create(e,s,l){return s instanceof se?new Gr({keyType:e,valueType:s,typeName:re.ZodRecord,...ce(l)}):new Gr({keyType:rt.create(),valueType:e,typeName:re.ZodRecord,...ce(s)})}};b(Gr,"ZodRecord");var An=class extends se{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:s,ctx:l}=this._processInputParams(e);if(l.parsedType!==$.map)return q(l,{code:U.invalid_type,expected:$.map,received:l.parsedType}),ne;let c=this._def.keyType,g=this._def.valueType,y=[...l.data.entries()].map(([v,f],m)=>({key:c._parse(new ht(l,v,l.path,[m,"key"])),value:g._parse(new ht(l,f,l.path,[m,"value"]))}));if(l.common.async){let v=new Map;return Promise.resolve().then(async()=>{for(let f of y){let m=await f.key,E=await f.value;if(m.status==="aborted"||E.status==="aborted")return ne;(m.status==="dirty"||E.status==="dirty")&&s.dirty(),v.set(m.value,E.value)}return{status:s.value,value:v}})}else{let v=new Map;for(let f of y){let m=f.key,E=f.value;if(m.status==="aborted"||E.status==="aborted")return ne;(m.status==="dirty"||E.status==="dirty")&&s.dirty(),v.set(m.value,E.value)}return{status:s.value,value:v}}}};b(An,"ZodMap");An.create=(n,e,s)=>new An({valueType:e,keyType:n,typeName:re.ZodMap,...ce(s)});var $t=class extends se{_parse(e){let{status:s,ctx:l}=this._processInputParams(e);if(l.parsedType!==$.set)return q(l,{code:U.invalid_type,expected:$.set,received:l.parsedType}),ne;let c=this._def;c.minSize!==null&&l.data.size<c.minSize.value&&(q(l,{code:U.too_small,minimum:c.minSize.value,type:"set",inclusive:!0,exact:!1,message:c.minSize.message}),s.dirty()),c.maxSize!==null&&l.data.size>c.maxSize.value&&(q(l,{code:U.too_big,maximum:c.maxSize.value,type:"set",inclusive:!0,exact:!1,message:c.maxSize.message}),s.dirty());let g=this._def.valueType;function y(f){let m=new Set;for(let E of f){if(E.status==="aborted")return ne;E.status==="dirty"&&s.dirty(),m.add(E.value)}return{status:s.value,value:m}}b(y,"finalizeSet");let v=[...l.data.values()].map((f,m)=>g._parse(new ht(l,f,l.path,m)));return l.common.async?Promise.all(v).then(f=>y(f)):y(v)}min(e,s){return new $t({...this._def,minSize:{value:e,message:H.toString(s)}})}max(e,s){return new $t({...this._def,maxSize:{value:e,message:H.toString(s)}})}size(e,s){return this.min(e,s).max(e,s)}nonempty(e){return this.min(1,e)}};b($t,"ZodSet");$t.create=(n,e)=>new $t({valueType:n,minSize:null,maxSize:null,typeName:re.ZodSet,...ce(e)});var lr=class extends se{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:s}=this._processInputParams(e);if(s.parsedType!==$.function)return q(s,{code:U.invalid_type,expected:$.function,received:s.parsedType}),ne;function l(v,f){return po({data:v,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,uo(),ua].filter(m=>!!m),issueData:{code:U.invalid_arguments,argumentsError:f}})}b(l,"makeArgsIssue");function c(v,f){return po({data:v,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,uo(),ua].filter(m=>!!m),issueData:{code:U.invalid_return_type,returnTypeError:f}})}b(c,"makeReturnsIssue");let g={errorMap:s.common.contextualErrorMap},y=s.data;if(this._def.returns instanceof dr){let v=this;return He(async function(...f){let m=new qe([]),E=await v._def.args.parseAsync(f,g).catch(O=>{throw m.addIssue(l(f,O)),m}),P=await Reflect.apply(y,this,E);return await v._def.returns._def.type.parseAsync(P,g).catch(O=>{throw m.addIssue(c(P,O)),m})})}else{let v=this;return He(function(...f){let m=v._def.args.safeParse(f,g);if(!m.success)throw new qe([l(f,m.error)]);let E=Reflect.apply(y,this,m.data),P=v._def.returns.safeParse(E,g);if(!P.success)throw new qe([c(E,P.error)]);return P.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new lr({...this._def,args:mt.create(e).rest(zt.create())})}returns(e){return new lr({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,s,l){return new lr({args:e||mt.create([]).rest(zt.create()),returns:s||zt.create(),typeName:re.ZodFunction,...ce(l)})}};b(lr,"ZodFunction");var Hr=class extends se{get schema(){return this._def.getter()}_parse(e){let{ctx:s}=this._processInputParams(e);return this._def.getter()._parse({data:s.data,path:s.path,parent:s})}};b(Hr,"ZodLazy");Hr.create=(n,e)=>new Hr({getter:n,typeName:re.ZodLazy,...ce(e)});var Jr=class extends se{_parse(e){if(e.data!==this._def.value){let s=this._getOrReturnCtx(e);return q(s,{received:s.data,code:U.invalid_literal,expected:this._def.value}),ne}return{status:"valid",value:e.data}}get value(){return this._def.value}};b(Jr,"ZodLiteral");Jr.create=(n,e)=>new Jr({value:n,typeName:re.ZodLiteral,...ce(e)});function Zc(n,e){return new St({values:n,typeName:re.ZodEnum,...ce(e)})}b(Zc,"createZodEnum");var St=class extends se{constructor(){super(...arguments),ri.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let s=this._getOrReturnCtx(e),l=this._def.values;return q(s,{expected:he.joinValues(l),received:s.parsedType,code:U.invalid_type}),ne}if(fo(this,ri,"f")||Nc(this,ri,new Set(this._def.values),"f"),!fo(this,ri,"f").has(e.data)){let s=this._getOrReturnCtx(e),l=this._def.values;return q(s,{received:s.data,code:U.invalid_enum_value,options:l}),ne}return He(e.data)}get options(){return this._def.values}get enum(){let e={};for(let s of this._def.values)e[s]=s;return e}get Values(){let e={};for(let s of this._def.values)e[s]=s;return e}get Enum(){let e={};for(let s of this._def.values)e[s]=s;return e}extract(e,s=this._def){return St.create(e,{...this._def,...s})}exclude(e,s=this._def){return St.create(this.options.filter(l=>!e.includes(l)),{...this._def,...s})}};b(St,"ZodEnum");ri=new WeakMap;St.create=Zc;var Qr=class extends se{constructor(){super(...arguments),ni.set(this,void 0)}_parse(e){let s=he.getValidEnumValues(this._def.values),l=this._getOrReturnCtx(e);if(l.parsedType!==$.string&&l.parsedType!==$.number){let c=he.objectValues(s);return q(l,{expected:he.joinValues(c),received:l.parsedType,code:U.invalid_type}),ne}if(fo(this,ni,"f")||Nc(this,ni,new Set(he.getValidEnumValues(this._def.values)),"f"),!fo(this,ni,"f").has(e.data)){let c=he.objectValues(s);return q(l,{received:l.data,code:U.invalid_enum_value,options:c}),ne}return He(e.data)}get enum(){return this._def.values}};b(Qr,"ZodNativeEnum");ni=new WeakMap;Qr.create=(n,e)=>new Qr({values:n,typeName:re.ZodNativeEnum,...ce(e)});var dr=class extends se{unwrap(){return this._def.type}_parse(e){let{ctx:s}=this._processInputParams(e);if(s.parsedType!==$.promise&&s.common.async===!1)return q(s,{code:U.invalid_type,expected:$.promise,received:s.parsedType}),ne;let l=s.parsedType===$.promise?s.data:Promise.resolve(s.data);return He(l.then(c=>this._def.type.parseAsync(c,{path:s.path,errorMap:s.common.contextualErrorMap})))}};b(dr,"ZodPromise");dr.create=(n,e)=>new dr({type:n,typeName:re.ZodPromise,...ce(e)});var at=class extends se{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===re.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:s,ctx:l}=this._processInputParams(e),c=this._def.effect||null,g={addIssue:y=>{q(l,y),y.fatal?s.abort():s.dirty()},get path(){return l.path}};if(g.addIssue=g.addIssue.bind(g),c.type==="preprocess"){let y=c.transform(l.data,g);if(l.common.async)return Promise.resolve(y).then(async v=>{if(s.value==="aborted")return ne;let f=await this._def.schema._parseAsync({data:v,path:l.path,parent:l});return f.status==="aborted"?ne:f.status==="dirty"||s.value==="dirty"?la(f.value):f});{if(s.value==="aborted")return ne;let v=this._def.schema._parseSync({data:y,path:l.path,parent:l});return v.status==="aborted"?ne:v.status==="dirty"||s.value==="dirty"?la(v.value):v}}if(c.type==="refinement"){let y=b(v=>{let f=c.refinement(v,g);if(l.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return v},"executeRefinement");if(l.common.async===!1){let v=this._def.schema._parseSync({data:l.data,path:l.path,parent:l});return v.status==="aborted"?ne:(v.status==="dirty"&&s.dirty(),y(v.value),{status:s.value,value:v.value})}else return this._def.schema._parseAsync({data:l.data,path:l.path,parent:l}).then(v=>v.status==="aborted"?ne:(v.status==="dirty"&&s.dirty(),y(v.value).then(()=>({status:s.value,value:v.value}))))}if(c.type==="transform")if(l.common.async===!1){let y=this._def.schema._parseSync({data:l.data,path:l.path,parent:l});if(!ai(y))return y;let v=c.transform(y.value,g);if(v instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:v}}else return this._def.schema._parseAsync({data:l.data,path:l.path,parent:l}).then(y=>ai(y)?Promise.resolve(c.transform(y.value,g)).then(v=>({status:s.value,value:v})):y);he.assertNever(c)}};b(at,"ZodEffects");at.create=(n,e,s)=>new at({schema:n,typeName:re.ZodEffects,effect:e,...ce(s)});at.createWithPreprocess=(n,e,s)=>new at({schema:e,effect:{type:"preprocess",transform:n},typeName:re.ZodEffects,...ce(s)});var gt=class extends se{_parse(e){return this._getType(e)===$.undefined?He(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};b(gt,"ZodOptional");gt.create=(n,e)=>new gt({innerType:n,typeName:re.ZodOptional,...ce(e)});var Rt=class extends se{_parse(e){return this._getType(e)===$.null?He(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};b(Rt,"ZodNullable");Rt.create=(n,e)=>new Rt({innerType:n,typeName:re.ZodNullable,...ce(e)});var Yr=class extends se{_parse(e){let{ctx:s}=this._processInputParams(e),l=s.data;return s.parsedType===$.undefined&&(l=this._def.defaultValue()),this._def.innerType._parse({data:l,path:s.path,parent:s})}removeDefault(){return this._def.innerType}};b(Yr,"ZodDefault");Yr.create=(n,e)=>new Yr({innerType:n,typeName:re.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ce(e)});var Kr=class extends se{_parse(e){let{ctx:s}=this._processInputParams(e),l={...s,common:{...s.common,issues:[]}},c=this._def.innerType._parse({data:l.data,path:l.path,parent:{...l}});return ii(c)?c.then(g=>({status:"valid",value:g.status==="valid"?g.value:this._def.catchValue({get error(){return new qe(l.common.issues)},input:l.data})})):{status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new qe(l.common.issues)},input:l.data})}}removeCatch(){return this._def.innerType}};b(Kr,"ZodCatch");Kr.create=(n,e)=>new Kr({innerType:n,typeName:re.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ce(e)});var In=class extends se{_parse(e){if(this._getType(e)!==$.nan){let l=this._getOrReturnCtx(e);return q(l,{code:U.invalid_type,expected:$.nan,received:l.parsedType}),ne}return{status:"valid",value:e.data}}};b(In,"ZodNaN");In.create=n=>new In({typeName:re.ZodNaN,...ce(n)});var Hd=Symbol("zod_brand"),da=class extends se{_parse(e){let{ctx:s}=this._processInputParams(e),l=s.data;return this._def.type._parse({data:l,path:s.path,parent:s})}unwrap(){return this._def.type}};b(da,"ZodBranded");var Xr=class extends se{_parse(e){let{status:s,ctx:l}=this._processInputParams(e);if(l.common.async)return b(async()=>{let g=await this._def.in._parseAsync({data:l.data,path:l.path,parent:l});return g.status==="aborted"?ne:g.status==="dirty"?(s.dirty(),la(g.value)):this._def.out._parseAsync({data:g.value,path:l.path,parent:l})},"handleAsync")();{let c=this._def.in._parseSync({data:l.data,path:l.path,parent:l});return c.status==="aborted"?ne:c.status==="dirty"?(s.dirty(),{status:"dirty",value:c.value}):this._def.out._parseSync({data:c.value,path:l.path,parent:l})}}static create(e,s){return new Xr({in:e,out:s,typeName:re.ZodPipeline})}};b(Xr,"ZodPipeline");var en=class extends se{_parse(e){let s=this._def.innerType._parse(e),l=b(c=>(ai(c)&&(c.value=Object.freeze(c.value)),c),"freeze");return ii(s)?s.then(c=>l(c)):l(s)}unwrap(){return this._def.innerType}};b(en,"ZodReadonly");en.create=(n,e)=>new en({innerType:n,typeName:re.ZodReadonly,...ce(e)});function Uc(n,e={},s){return n?cr.create().superRefine((l,c)=>{var g,y;if(!n(l)){let v=typeof e=="function"?e(l):typeof e=="string"?{message:e}:e,f=(y=(g=v.fatal)!==null&&g!==void 0?g:s)!==null&&y!==void 0?y:!0,m=typeof v=="string"?{message:v}:v;c.addIssue({code:"custom",...m,fatal:f})}}):cr.create()}b(Uc,"custom");var Jd={object:ve.lazycreate},re;(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"})(re||(re={}));var Qd=b((n,e={message:`Input not instance of ${n.name}`})=>Uc(s=>s instanceof n,e),"instanceOfType"),Bc=rt.create,qc=Tt.create,Yd=In.create,Kd=kt.create,zc=qr.create,Xd=qt.create,eu=On.create,tu=zr.create,ru=$r.create,nu=cr.create,au=zt.create,iu=_t.create,ou=jn.create,su=nt.create,cu=ve.create,lu=ve.strictCreate,du=Fr.create,uu=Vn.create,pu=Wr.create,fu=mt.create,hu=Gr.create,mu=An.create,gu=$t.create,yu=lr.create,vu=Hr.create,bu=Jr.create,_u=St.create,wu=Qr.create,Cu=dr.create,Ac=at.create,xu=gt.create,Eu=Rt.create,Tu=at.createWithPreprocess,ku=Xr.create,Su=b(()=>Bc().optional(),"ostring"),Ru=b(()=>qc().optional(),"onumber"),Pu=b(()=>zc().optional(),"oboolean"),Ou={string:n=>rt.create({...n,coerce:!0}),number:n=>Tt.create({...n,coerce:!0}),boolean:n=>qr.create({...n,coerce:!0}),bigint:n=>kt.create({...n,coerce:!0}),date:n=>qt.create({...n,coerce:!0})},ju=ne,a=Object.freeze({__proto__:null,defaultErrorMap:ua,setErrorMap:jd,getErrorMap:uo,makeIssue:po,EMPTY_PATH:Vd,addIssueToContext:q,ParseStatus:Ve,INVALID:ne,DIRTY:la,OK:He,isAborted:Ms,isDirty:Ls,isValid:ai,isAsync:ii,get util(){return he},get objectUtil(){return Ds},ZodParsedType:$,getParsedType:Br,ZodType:se,datetimeRegex:Lc,ZodString:rt,ZodNumber:Tt,ZodBigInt:kt,ZodBoolean:qr,ZodDate:qt,ZodSymbol:On,ZodUndefined:zr,ZodNull:$r,ZodAny:cr,ZodUnknown:zt,ZodNever:_t,ZodVoid:jn,ZodArray:nt,ZodObject:ve,ZodUnion:Fr,ZodDiscriminatedUnion:Vn,ZodIntersection:Wr,ZodTuple:mt,ZodRecord:Gr,ZodMap:An,ZodSet:$t,ZodFunction:lr,ZodLazy:Hr,ZodLiteral:Jr,ZodEnum:St,ZodNativeEnum:Qr,ZodPromise:dr,ZodEffects:at,ZodTransformer:at,ZodOptional:gt,ZodNullable:Rt,ZodDefault:Yr,ZodCatch:Kr,ZodNaN:In,BRAND:Hd,ZodBranded:da,ZodPipeline:Xr,ZodReadonly:en,custom:Uc,Schema:se,ZodSchema:se,late:Jd,get ZodFirstPartyTypeKind(){return re},coerce:Ou,any:nu,array:su,bigint:Kd,boolean:zc,date:Xd,discriminatedUnion:uu,effect:Ac,enum:_u,function:yu,instanceof:Qd,intersection:pu,lazy:vu,literal:bu,map:mu,nan:Yd,nativeEnum:wu,never:iu,null:ru,nullable:Eu,number:qc,object:cu,oboolean:Pu,onumber:Ru,optional:xu,ostring:Su,pipeline:ku,preprocess:Tu,promise:Cu,record:hu,set:gu,strictObject:lu,string:Bc,symbol:eu,transformer:Ac,tuple:fu,undefined:tu,union:du,unknown:au,void:ou,NEVER:ju,ZodIssueCode:U,quotelessJson:Od,ZodError:qe});var pa=Symbol("current"),Nn=Symbol("previous");var oi=b((n,{ref:e,refType:s,param:l,header:c,...g}={})=>({...g,...n}),"mergeOpenApi");function $c(n){if(typeof n.ZodType.prototype.openapi<"u")return;n.ZodType.prototype.openapi=function(g){let{zodOpenApi:y,...v}=this._def,f=new this.constructor({...v,zodOpenApi:{openapi:oi(g,y?.openapi)}});return f._def.zodOpenApi[pa]=f,y&&(f._def.zodOpenApi[Nn]=this),f};let e=n.ZodType.prototype.describe;n.ZodType.prototype.describe=function(...g){let y=e.apply(this,g),v=y._def;if(v.zodOpenApi){let f={...v.zodOpenApi};f.openapi=oi({description:g[0]},f.openapi),f[Nn]=this,f[pa]=y,v.zodOpenApi=f}else v.zodOpenApi={openapi:{description:g[0]},[pa]:y};return y};let s=n.ZodObject.prototype.extend;n.ZodObject.prototype.extend=function(...g){let y=s.apply(this,g),v=y._def.zodOpenApi;if(v){let f={...v};f.openapi=oi({},f.openapi),f[Nn]=this,y._def.zodOpenApi=f}else y._def.zodOpenApi={[Nn]:this};return y};let l=n.ZodObject.prototype.omit;n.ZodObject.prototype.omit=function(...g){let y=l.apply(this,g),v=y._def.zodOpenApi;if(v){let f={...v};f.openapi=oi({},f.openapi),delete f[Nn],delete f[pa],y._def.zodOpenApi=f}return y};let c=n.ZodObject.prototype.pick;n.ZodObject.prototype.pick=function(...g){let y=c.apply(this,g),v=y._def.zodOpenApi;if(v){let f={...v};f.openapi=oi({},f.openapi),delete f[Nn],delete f[pa],y._def.zodOpenApi=f}return y}}b($c,"extendZodWithOpenApi");$c(a);var Vu=Object.defineProperty,Au=b((n,e)=>Vu(n,"name",{value:e,configurable:!0}),"__name"),mo=a.array(a.string().or(a.record(a.any()))),Sb=a.object({type:a.string().optional(),narrative:a.string().optional()}),go=a.string().or(a.object({id:a.string(),type:a.string(),caption:a.string().optional()})),Iu=a.object({type:a.string().min(1).or(a.string().array().nonempty()),latitude:a.number(),longitude:a.number()}),Nu=a.object({type:a.string().min(1).or(a.string().array().nonempty()),addressCountry:a.string().optional(),addressCountryCode:a.string().optional(),addressRegion:a.string().optional(),addressLocality:a.string().optional(),streetAddress:a.string().optional(),postOfficeBoxNumber:a.string().optional(),postalCode:a.string().optional(),geo:Iu.optional()}),Du=a.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(a.string()),Xc=a.object({type:a.string().min(1).or(a.string().array().nonempty()),identifier:a.string(),identifierType:Du}),si=a.string().or(a.object({id:a.string().optional(),type:a.string().or(a.string().array().nonempty().optional()),name:a.string().optional(),url:a.string().optional(),phone:a.string().optional(),description:a.string().optional(),endorsement:a.any().array().optional(),image:go.optional(),email:a.string().email().optional(),address:Nu.optional(),otherIdentifier:Xc.array().optional(),official:a.string().optional(),parentOrg:a.any().optional(),familyName:a.string().optional(),givenName:a.string().optional(),additionalName:a.string().optional(),patronymicName:a.string().optional(),honorificPrefix:a.string().optional(),honorificSuffix:a.string().optional(),familyNamePrefix:a.string().optional(),dateOfBirth:a.string().optional()}).catchall(a.any())),Bs=a.object({id:a.string().optional()}).catchall(a.any()),ho=a.object({type:a.string(),id:a.string()}).catchall(a.any()),Fc=a.object({id:a.string(),type:a.string()}).catchall(a.any()),Wc=a.object({id:a.string().optional(),type:a.string()}).catchall(a.any()),Gc=a.object({type:a.string(),id:a.string().optional()}).catchall(a.any()),Hc=a.object({type:a.string().or(a.string().array().nonempty()),id:a.string().optional()}).catchall(a.any()),tn=a.object({"@context":mo,id:a.string().optional(),type:a.string().array().nonempty(),issuer:si,credentialSubject:Bs.or(Bs.array()),refreshService:Wc.or(Wc.array()).optional(),credentialSchema:Fc.or(Fc.array()).optional(),issuanceDate:a.string().optional(),expirationDate:a.string().optional(),credentialStatus:ho.or(ho.array()).optional(),name:a.string().optional(),description:a.string().optional(),validFrom:a.string().optional(),validUntil:a.string().optional(),status:ho.or(ho.array()).optional(),termsOfUse:Gc.or(Gc.array()).optional(),evidence:Hc.or(Hc.array()).optional()}).catchall(a.any()),Ft=a.object({type:a.string(),created:a.string(),challenge:a.string().optional(),domain:a.string().optional(),nonce:a.string().optional(),proofPurpose:a.string(),verificationMethod:a.string(),jws:a.string().optional()}).catchall(a.any()),fa=tn.extend({proof:Ft.or(Ft.array())}),Mu=a.object({"@context":mo,id:a.string().optional(),type:a.string().or(a.string().array().nonempty()),verifiableCredential:fa.or(fa.array()).optional(),holder:a.string().optional()}).catchall(a.any()),yo=Mu.extend({proof:Ft.or(Ft.array())}),$s=a.object({kty:a.string(),crv:a.string(),x:a.string(),y:a.string().optional(),n:a.string().optional(),d:a.string().optional()}),Ob=$s.omit({d:!0}).extend({d:a.string()}),Lu=a.object({alg:a.string(),iv:a.string(),tag:a.string(),epk:$s.partial().optional(),kid:a.string().optional(),apv:a.string().optional(),apu:a.string().optional()}),Zu=a.object({header:Lu,encrypted_key:a.string()}),Fs=a.object({protected:a.string(),iv:a.string(),ciphertext:a.string(),tag:a.string(),aad:a.string().optional(),recipients:Zu.array().optional()}),Dn=a.string().or(a.object({"@context":mo.optional(),id:a.string(),type:a.string(),controller:a.string(),publicKeyJwk:$s.optional(),publicKeyBase58:a.string().optional(),publicKeyMultibase:a.string().optional(),blockChainAccountId:a.string().optional()}).catchall(a.any())),Uu=a.object({id:a.string(),type:a.string().or(a.string().array().nonempty()),serviceEndpoint:a.any().or(a.any().array().nonempty())}).catchall(a.any()),jb=a.object({"@context":mo,id:a.string(),alsoKnownAs:a.string().optional(),controller:a.string().or(a.string().array().nonempty()).optional(),verificationMethod:Dn.array().optional(),authentication:Dn.array().optional(),assertionMethod:Dn.array().optional(),keyAgreement:Dn.array().optional(),capabilityInvocation:Dn.array().optional(),capabilityDelegation:Dn.array().optional(),publicKey:Dn.array().optional(),service:Uu.array().optional(),proof:Ft.or(Ft.array()).optional()}).catchall(a.any()),Bu=a.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(a.string()),vo=a.object({type:a.string().array().nonempty(),targetCode:a.string().optional(),targetDescription:a.string().optional(),targetName:a.string(),targetFramework:a.string().optional(),targetType:Bu.optional(),targetUrl:a.string()}),qu=a.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"]),zu=qu.or(a.string()),$u=a.object({id:a.string().optional(),narrative:a.string().optional()}).catchall(a.any()),Fu=a.object({id:a.string(),type:a.string().array().nonempty(),endorsementComment:a.string().optional()}),Wu=tn.extend({credentialSubject:Fu,proof:Ft.or(Ft.array()).optional()}),Gu=a.object({id:a.string(),"@language":a.string().optional(),version:a.string().optional()}),Hu=a.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(a.string()),Ju=a.object({id:a.string(),type:a.string().array().nonempty(),alignment:vo.array().optional(),description:a.string().optional(),level:a.string().optional(),name:a.string(),points:a.string().optional()}).catchall(a.any()),Qu=a.object({id:a.string(),type:a.string().array().nonempty(),alignment:vo.array().optional(),allowedValue:a.string().array().optional(),name:a.string(),requiredLevel:a.string().optional(),requiredValue:a.string().optional(),resultType:Hu,rubricCriterionLevel:Ju.array().optional(),valueMax:a.string().optional(),valueMin:a.string().optional()}).catchall(a.any()),Yu=a.object({id:a.string().optional(),type:a.string().array().nonempty(),alignment:vo.array().optional(),achievementType:zu.optional(),creator:si.optional(),creditsAvailable:a.number().optional(),criteria:$u,description:a.string(),endorsement:Wu.array().optional(),fieldOfStudy:a.string().optional(),humanCode:a.string().optional(),image:go.optional(),"@language":a.string().optional(),name:a.string(),otherIdentifier:Xc.array().optional(),related:Gu.array().optional(),resultDescription:Qu.array().optional(),specialization:a.string().optional(),tag:a.string().array().optional(),version:a.string().optional()}).catchall(a.any()),Ku=a.object({type:a.string(),hashed:a.boolean(),identityHash:a.string(),identityType:a.string(),salt:a.string().optional()}),Xu=a.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),ep=a.object({type:a.string().array().nonempty(),achievedLevel:a.string().optional(),alignment:vo.array().optional(),resultDescription:a.string().optional(),status:Xu.optional(),value:a.string().optional()}).catchall(a.any()),Jc=a.object({id:a.string().optional(),type:a.string().array().nonempty(),activityEndDate:a.string().optional(),activityStartDate:a.string().optional(),creditsEarned:a.number().optional(),achievement:Yu.optional(),identifier:Ku.array().optional(),image:go.optional(),licenseNumber:a.string().optional(),narrative:a.string().optional(),result:ep.array().optional(),role:a.string().optional(),source:si.optional(),term:a.string().optional()}).catchall(a.any()),tp=a.object({id:a.string().optional(),type:a.string().or(a.string().array().nonempty()),narrative:a.string().optional(),name:a.string().optional(),description:a.string().optional(),genre:a.string().optional(),audience:a.string().optional()}).catchall(a.any()),rp=tn.extend({name:a.string().optional(),description:a.string().optional(),image:go.optional(),credentialSubject:Jc.or(Jc.array()),endorsement:tn.array().optional(),evidence:tp.array().optional()}),Ab=rp.extend({proof:Ft.or(Ft.array())}),Nb=a.object({checks:a.string().array(),warnings:a.string().array(),errors:a.string().array()}),el=a.enum(["Success","Failed","Error"]),Db=el.enum,Mb=a.object({check:a.string(),status:el,message:a.string().optional(),details:a.string().optional()}),Lb=a.object({title:a.string().optional(),createdAt:a.string().optional(),issuer:si.optional(),issuee:si.optional(),credentialSubject:Bs.optional()}),Zb=a.object({id:a.string(),uri:a.string()}).catchall(a.any()),qb=a.object({limit:a.number(),cursor:a.string().optional(),sort:a.string().optional()}),Je=a.object({cursor:a.string().optional(),hasMore:a.boolean()}),tl=a.object({encryptedRecord:Fs,fields:a.string().array()}).catchall(a.any()),zb=Je.extend({records:tl.array()}),np=tl.extend({id:a.string()}),$b=Je.extend({records:np.array()}),Qc=Au(n=>{let e=n.match(/^\/(.*)\/([gimsuy]*)$/);if(!e)throw new Error("Invalid RegExp string format");return{pattern:e[1],flags:e[2]}},"parseRegexString"),ap=a.instanceof(RegExp).or(a.string().refine(n=>{try{return Qc(n),!0}catch{return!1}},{message:"Invalid RegExp string format. Must be in format '/pattern/flags'"}).transform(n=>{let{pattern:e,flags:s}=Qc(n);try{return new RegExp(e,s)}catch(l){throw new Error(`Invalid RegExp: ${l.message}`)}})),me=a.string().or(a.object({$in:a.string().array()})).or(a.object({$regex:ap})),ip=a.object({backgroundColor:a.string().optional(),backgroundImage:a.string().optional(),fadeBackgroundImage:a.boolean().optional(),repeatBackgroundImage:a.boolean().optional(),fontColor:a.string().optional(),accentColor:a.string().optional(),accentFontColor:a.string().optional(),idBackgroundImage:a.string().optional(),fadeIdBackgroundImage:a.boolean().optional(),idBackgroundColor:a.string().optional(),repeatIdBackgroundImage:a.boolean().optional()}),ur=a.object({profileId:a.string().min(3).max(40).describe("Unique, URL-safe identifier for the profile."),displayName:a.string().default("").describe("Human-readable display name for the profile."),shortBio:a.string().default("").describe("Short bio for the profile."),bio:a.string().default("").describe("Longer bio for the profile."),did:a.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),isPrivate:a.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),email:a.string().optional().describe("Contact email address for the profile. (deprecated)"),image:a.string().optional().describe("Profile image URL for the profile."),heroImage:a.string().optional().describe("Hero image URL for the profile."),websiteLink:a.string().optional().describe("Website link for the profile."),isServiceProfile:a.boolean().default(!1).optional().describe("Whether the profile is a service profile or not."),type:a.string().optional().describe('Profile type: e.g. "person", "organization", "service".'),notificationsWebhook:a.string().url().startsWith("http").optional().describe("URL to send notifications to."),display:ip.optional().describe("Display settings for the profile."),highlightedCredentials:a.array(a.string()).max(5).optional().describe("Up to 5 unique boost URIs to highlight on the profile."),role:a.string().default("").optional().describe('Role of the profile: e.g. "teacher", "student".'),dob:a.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".'),country:a.string().optional().describe("Country for the profile."),approved:a.boolean().optional().describe("Approval status for the profile.")}),Gb=a.object({profileId:me,displayName:me,shortBio:me,bio:me,email:me,websiteLink:me,isServiceProfile:a.boolean(),type:me}).partial(),Hb=Je.extend({records:ur.array()}),Jb=a.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),rl=a.object({id:a.string(),created:a.string(),displayName:a.string().default("").optional(),shortBio:a.string().default("").optional(),bio:a.string().default("").optional(),email:a.string().optional(),image:a.string().optional(),heroImage:a.string().optional()}),Qb=Je.extend({records:rl.extend({did:a.string()}).array()}),Yb=a.object({id:me,displayName:me,shortBio:me,bio:me,email:me}).partial(),Kb=Je.extend({records:a.object({profile:ur,manager:rl.extend({did:a.string()}).optional()}).array()}),Xb=a.object({uri:a.string(),to:a.string(),from:a.string(),sent:a.string().datetime(),received:a.string().datetime().optional()}),nl=a.object({role:a.string(),canEdit:a.boolean(),canIssue:a.boolean(),canRevoke:a.boolean(),canManagePermissions:a.boolean(),canIssueChildren:a.string(),canCreateChildren:a.string(),canEditChildren:a.string(),canRevokeChildren:a.string(),canManageChildrenPermissions:a.string(),canManageChildrenProfiles:a.boolean().default(!1).optional(),canViewAnalytics:a.boolean()}),op=a.object({role:me,canEdit:a.boolean(),canIssue:a.boolean(),canRevoke:a.boolean(),canManagePermissions:a.boolean(),canIssueChildren:me,canCreateChildren:me,canEditChildren:me,canRevokeChildren:me,canManageChildrenPermissions:me,canManageChildrenProfiles:a.boolean(),canViewAnalytics:a.boolean()}).partial(),Us=a.enum(["GRANT_PERMISSIONS","ADD_ADMIN","AUTO_CONNECT"]),sp=a.discriminatedUnion("type",[a.object({type:a.literal(Us.Values.GRANT_PERMISSIONS),data:a.object({claimUri:a.string(),targetUri:a.string(),permissions:nl.partial()})}),a.object({type:a.literal(Us.Values.ADD_ADMIN),data:a.object({claimUri:a.string(),targetUri:a.string()})}),a.object({type:a.literal(Us.Values.AUTO_CONNECT),data:a.object({claimUri:a.string(),targetUri:a.string()})})]),e_=a.object({type:me,data:a.object({claimUri:me,targetUri:me,permissions:op})}).deepPartial(),cp=a.object({id:a.string(),createdAt:a.string(),updatedAt:a.string()}).and(sp),t_=Je.extend({records:cp.array()}),qs=a.enum(["DRAFT","LIVE"]),lp=a.object({uri:a.string(),name:a.string().optional(),type:a.string().optional(),category:a.string().optional(),status:qs.optional(),autoConnectRecipients:a.boolean().optional(),meta:a.record(a.any()).optional(),claimPermissions:nl.optional(),allowAnyoneToCreateChildren:a.boolean().optional()}),r_=a.object({uri:me,name:me,type:me,category:me,meta:a.record(me),status:qs.or(a.object({$in:qs.array()})),autoConnectRecipients:a.boolean()}).partial(),n_=Je.extend({records:lp.array()}),dp=a.object({to:ur,from:a.string(),received:a.string().optional(),uri:a.string().optional()}),a_=Je.extend({records:dp.array()}),up=a.object({to:ur,from:a.string(),received:a.string().optional(),boostUris:a.array(a.string()),credentialUris:a.array(a.string()).optional()}),i_=Je.extend({records:up.array()}),o_=a.object({endpoint:a.string(),name:a.string(),did:a.string().optional()}),s_=a.object({ttlSeconds:a.number().optional(),totalUses:a.number().optional()}),pp=a.object({endpoint:a.string()}),c_=a.object({signingAuthority:pp,relationship:a.object({name:a.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:a.string(),isPrimary:a.boolean().optional()})}),l_=a.object({boostUri:a.string(),signingAuthority:a.object({endpoint:a.string(),name:a.string()})}),fp=a.enum(["live","stale","withdrawn"]),Ws=a.object({read:a.object({anonymize:a.boolean().optional(),credentials:a.object({categories:a.record(a.object({required:a.boolean(),defaultEnabled:a.boolean().optional()})).default({})}).default({}),personal:a.record(a.object({required:a.boolean(),defaultEnabled:a.boolean().optional()})).default({})}).default({}),write:a.object({credentials:a.object({categories:a.record(a.object({required:a.boolean(),defaultEnabled:a.boolean().optional()})).default({})}).default({}),personal:a.record(a.object({required:a.boolean(),defaultEnabled:a.boolean().optional()})).default({})}).default({})}),al=a.object({contract:Ws,owner:ur,name:a.string(),subtitle:a.string().optional(),description:a.string().optional(),reasonForAccessing:a.string().optional(),image:a.string().optional(),uri:a.string(),needsGuardianConsent:a.boolean().optional(),redirectUrl:a.string().optional(),frontDoorBoostUri:a.string().optional(),createdAt:a.string(),updatedAt:a.string(),expiresAt:a.string().optional(),autoBoosts:a.string().array().optional(),writers:a.array(ur).optional()}),d_=Je.extend({records:al.omit({owner:!0}).array()}),hp=a.object({credentials:a.object({categories:a.record(a.string().array()).default({})}),personal:a.record(a.string()).default({}),date:a.string()}),u_=Je.extend({records:hp.array()}),mp=a.object({credentials:a.object({category:a.string(),uri:a.string()}).array(),personal:a.record(a.string()).default({}),date:a.string(),contractUri:a.string()}),p_=Je.extend({records:mp.array()}),il=a.object({sharing:a.boolean().optional(),shared:a.string().array().optional(),shareAll:a.boolean().optional(),shareUntil:a.string().optional()}),bo=a.object({read:a.object({anonymize:a.boolean().optional(),credentials:a.object({shareAll:a.boolean().optional(),sharing:a.boolean().optional(),categories:a.record(il).default({})}).default({}),personal:a.record(a.string()).default({})}).default({}),write:a.object({credentials:a.object({categories:a.record(a.boolean()).default({})}).default({}),personal:a.record(a.boolean()).default({})}).default({}),deniedWriters:a.array(a.string()).optional()}),f_=Je.extend({records:a.object({expiresAt:a.string().optional(),oneTime:a.boolean().optional(),terms:bo,contract:al,uri:a.string(),consenter:ur,status:fp}).array()}),h_=a.object({read:a.object({anonymize:a.boolean().optional(),credentials:a.object({categories:a.record(a.object({required:a.boolean().optional()})).optional()}).optional(),personal:a.record(a.object({required:a.boolean().optional()})).optional()}).optional(),write:a.object({credentials:a.object({categories:a.record(a.object({required:a.boolean().optional()})).optional()}).optional(),personal:a.record(a.object({required:a.boolean().optional()})).optional()}).optional()}),m_=a.object({anonymize:a.boolean().optional(),credentials:a.object({categories:a.record(a.boolean()).optional()}).optional(),personal:a.record(a.boolean()).optional()}),g_=a.object({credentials:a.object({categories:a.record(a.boolean()).optional()}).optional(),personal:a.record(a.boolean()).optional(),id:me.optional()}),gp=a.object({read:a.object({anonymize:a.boolean().optional(),credentials:a.object({shareAll:a.boolean().optional(),sharing:a.boolean().optional(),categories:a.record(il.optional()).optional()}).optional(),personal:a.record(a.string()).optional()}).optional(),write:a.object({credentials:a.object({categories:a.record(a.boolean()).optional()}).optional(),personal:a.record(a.boolean()).optional()}).optional()}),zs=a.enum(["consent","update","sync","withdraw","write"]),y_=a.object({terms:gp.optional(),action:zs.or(zs.array()).optional(),date:a.object({$gt:a.string()}).or(a.object({$lt:a.string()})).or(a.object({$eq:a.string()})).optional(),expiresAt:a.object({$gt:a.string()}).or(a.object({$lt:a.string()})).or(a.object({$eq:a.string()})).optional(),oneTime:a.boolean().optional()}),ol=a.object({expiresAt:a.string().optional(),oneTime:a.boolean().optional(),terms:bo.optional(),id:a.string(),action:zs,date:a.string(),uris:a.string().array().optional()}),v_=Je.extend({records:ol.array()}),yp=a.object({credentialUri:a.string(),termsUri:a.string(),contractUri:a.string(),boostUri:a.string(),category:a.string().optional(),date:a.string()}),b_=Je.extend({records:yp.array()}),vp=a.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"]),bp=a.object({title:a.string().optional(),body:a.string().optional()}),_p=a.object({type:a.string(),value:a.string()}),_o=a.enum(["PENDING","DELIVERED","CLAIMED","EXPIRED"]),wp=a.object({issuanceId:a.string(),status:_o,recipient:a.object({contactMethod:_p.optional(),learnCardId:a.string().optional()}),timestamp:a.string().datetime().optional()}),Cp=a.object({vcUris:a.array(a.string()).optional(),vpUris:a.array(a.string()).optional(),transaction:ol.optional(),inbox:wp.optional()}),__=a.object({type:vp,to:ur.partial().and(a.object({did:a.string()})),from:ur.partial().and(a.object({did:a.string()})),message:bp.optional(),data:Cp.optional(),sent:a.string().datetime().optional(),webhookUrl:a.string().optional()}),xp="auth-grant:",w_=a.object({id:a.string(),name:a.string(),description:a.string().optional(),challenge:a.string().startsWith(xp).min(10,{message:"Challenge is too short"}).max(100,{message:"Challenge is too long"}),status:a.enum(["revoked","active"],{required_error:"Status is required",invalid_type_error:"Status must be either active or revoked"}),scope:a.string(),createdAt:a.string().datetime({message:"createdAt must be a valid ISO 8601 datetime string"}),expiresAt:a.string().datetime({message:"expiresAt must be a valid ISO 8601 datetime string"}).nullish().optional()}),C_=a.object({id:a.string()}).catchall(a.any()),Ep=a.enum(["active","revoked"]),x_=a.object({id:me,name:me,description:me,status:Ep}).partial(),Yc=a.object({id:a.string(),isVerified:a.boolean(),verifiedAt:a.string().optional(),isPrimary:a.boolean(),createdAt:a.string()}),E_=a.discriminatedUnion("type",[a.object({type:a.literal("email"),value:a.string().email()}).merge(Yc),a.object({type:a.literal("phone"),value:a.string()}).merge(Yc)]),Kc=a.object({isVerified:a.boolean().optional(),isPrimary:a.boolean().optional()}),T_=a.discriminatedUnion("type",[a.object({type:a.literal("email"),value:a.string().email()}).merge(Kc),a.object({type:a.literal("phone"),value:a.string()}).merge(Kc)]),sl=a.discriminatedUnion("type",[a.object({type:a.literal("email"),value:a.string().email()}),a.object({type:a.literal("phone"),value:a.string()})]),k_=a.object({value:a.string(),type:a.enum(["email","phone"])}),S_=a.object({token:a.string()}),R_=a.object({contactMethodId:a.string()}),Tp=a.object({id:a.string(),credential:a.string(),isSigned:a.boolean(),currentStatus:_o,expiresAt:a.string(),createdAt:a.string(),issuerDid:a.string(),webhookUrl:a.string().optional(),signingAuthority:a.object({endpoint:a.string().optional(),name:a.string().optional()}).optional()}),P_=a.object({hasMore:a.boolean(),records:a.array(Tp),cursor:a.string().optional()}),O_=a.object({currentStatus:_o,id:a.string(),isSigned:a.boolean(),issuerDid:a.string()}).partial(),kp=a.object({endpoint:a.string().url(),name:a.string()}),j_=a.object({recipient:sl.describe("The recipient of the credential"),credential:fa.passthrough().or(yo.passthrough()).or(tn.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:a.object({signingAuthority:kp.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:a.string().url().optional().describe("The webhook URL to receive credential issuance events."),expiresInDays:a.number().min(1).max(365).optional().describe("The number of days the credential will be valid for."),delivery:a.object({suppress:a.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:a.object({id:a.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:a.object({issuer:a.object({name:a.string().optional().describe('The name of the organization (e.g., "State University").'),logoUrl:a.string().url().optional().describe("The URL of the organization's logo.")}).optional(),credential:a.object({name:a.string().optional().describe('The name of the credential (e.g., "Bachelor of Science").'),type:a.string().optional().describe('The type of the credential (e.g., "degree", "certificate").')}).optional(),recipient:a.object({name:a.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.")}),V_=a.object({issuanceId:a.string(),status:_o,recipient:sl,claimUrl:a.string().url().optional(),recipientDid:a.string().optional()}),A_=a.object({token:a.string(),contactMethodId:a.string(),autoVerifyContactMethod:a.boolean().optional().default(!1),createdAt:a.string(),expiresAt:a.string(),used:a.boolean()});var Sp=Object.create,Gs=Object.defineProperty,Rp=Object.getOwnPropertyDescriptor,cl=Object.getOwnPropertyNames,Pp=Object.getPrototypeOf,Op=Object.prototype.hasOwnProperty,F=b((n,e)=>Gs(n,"name",{value:e,configurable:!0}),"__name"),ll=b((n,e)=>b(function(){return e||(0,n[cl(n)[0]])((e={exports:{}}).exports,e),e.exports},"__require"),"__commonJS"),jp=b((n,e,s,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of cl(e))!Op.call(n,c)&&c!==s&&Gs(n,c,{get:()=>e[c],enumerable:!(l=Rp(e,c))||l.enumerable});return n},"__copyProps"),Vp=b((n,e,s)=>(s=n!=null?Sp(Pp(n)):{},jp(e||!n||!n.__esModule?Gs(s,"default",{value:n,enumerable:!0}):s,n)),"__toESM"),Ap=ll({"../learn-card-types/dist/types.cjs.development.js"(n,e){"use strict";var s=Object.defineProperty,l=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,y=F((t,d)=>s(t,"name",{value:d,configurable:!0}),"__name"),v=F((t,d)=>{for(var p in d)s(t,p,{get:d[p],enumerable:!0})},"__export"),f=F((t,d,p,x)=>{if(d&&typeof d=="object"||typeof d=="function")for(let _ of c(d))!g.call(t,_)&&_!==p&&s(t,_,{get:()=>d[_],enumerable:!(x=l(d,_))||x.enumerable});return t},"__copyProps"),m=F(t=>f(s({},"__esModule",{value:!0}),t),"__toCommonJS"),E={};v(E,{AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX:()=>Fa,AchievementCredentialValidator:()=>yi,AchievementCriteriaValidator:()=>Lo,AchievementSubjectValidator:()=>Pa,AchievementTypeValidator:()=>yn,AchievementValidator:()=>vn,AddressValidator:()=>fi,AlignmentTargetTypeValidator:()=>ka,AlignmentValidator:()=>rr,AuthGrantQueryValidator:()=>rs,AuthGrantStatusValidator:()=>ea,AuthGrantValidator:()=>ts,AutoBoostConfigValidator:()=>Ho,BoostPermissionsQueryValidator:()=>Ti,BoostPermissionsValidator:()=>La,BoostQueryValidator:()=>Ri,BoostRecipientValidator:()=>fe,BoostRecipientWithChildrenValidator:()=>ft,BoostValidator:()=>Si,ClaimHookQueryValidator:()=>Ne,ClaimHookTypeValidator:()=>Yn,ClaimHookValidator:()=>ki,ClaimTokenValidator:()=>Gi,ConsentFlowContractDataForDidValidator:()=>Ni,ConsentFlowContractDataValidator:()=>xn,ConsentFlowContractDetailsValidator:()=>Cn,ConsentFlowContractQueryValidator:()=>Jo,ConsentFlowContractValidator:()=>Vi,ConsentFlowDataForDidQueryValidator:()=>Li,ConsentFlowDataQueryValidator:()=>Qo,ConsentFlowTermValidator:()=>Za,ConsentFlowTermsQueryValidator:()=>Zi,ConsentFlowTermsStatusValidator:()=>ji,ConsentFlowTermsValidator:()=>Ir,ConsentFlowTransactionActionValidator:()=>En,ConsentFlowTransactionValidator:()=>Ua,ConsentFlowTransactionsQueryValidator:()=>Yo,ContactMethodCreateValidator:()=>$i,ContactMethodQueryValidator:()=>Nr,ContactMethodValidator:()=>ns,ContactMethodVerificationRequestValidator:()=>as,ContactMethodVerificationValidator:()=>Ga,ContextValidator:()=>pn,ContractCredentialValidator:()=>Ba,CredentialInfoValidator:()=>_n,CredentialRecordValidator:()=>bi,CredentialSchemaValidator:()=>wa,CredentialStatusValidator:()=>hn,CredentialSubjectValidator:()=>qn,CriteriaValidator:()=>Ar,DidDocumentValidator:()=>gi,EncryptedCredentialRecordValidator:()=>Va,EncryptedRecordValidator:()=>Jn,EndorsementCredentialValidator:()=>Fn,EndorsementSubjectValidator:()=>$n,EvidenceValidator:()=>Oa,FlatAuthGrantValidator:()=>Wa,FullClaimHookValidator:()=>Kn,GeoCoordinatesValidator:()=>pi,IdentifierEntryValidator:()=>_a,IdentifierTypeValidator:()=>hi,IdentityObjectValidator:()=>Sa,ImageValidator:()=>fn,InboxCredentialQueryValidator:()=>Fi,InboxCredentialValidator:()=>Ha,IssueInboxCredentialResponseValidator:()=>Tn,IssueInboxCredentialValidator:()=>Wi,IssueInboxSigningAuthorityValidator:()=>Ja,JWERecipientHeaderValidator:()=>gn,JWERecipientValidator:()=>Vr,JWEValidator:()=>mi,JWKValidator:()=>Et,JWKWithPrivateKeyValidator:()=>mn,KnownAchievementTypeValidator:()=>nr,LCNBoostClaimLinkOptionsValidator:()=>Wo,LCNBoostClaimLinkSigningAuthorityValidator:()=>Fo,LCNBoostStatus:()=>wn,LCNInboxContactMethodValidator:()=>za,LCNInboxStatusEnumValidator:()=>ir,LCNNotificationDataValidator:()=>$a,LCNNotificationInboxValidator:()=>Bi,LCNNotificationMessageValidator:()=>qa,LCNNotificationTypeEnumValidator:()=>Ui,LCNNotificationValidator:()=>es,LCNProfileConnectionStatusEnum:()=>Ei,LCNProfileDisplayValidator:()=>Na,LCNProfileManagerQueryValidator:()=>Bo,LCNProfileManagerValidator:()=>Qn,LCNProfileQueryValidator:()=>xi,LCNProfileValidator:()=>pt,LCNSigningAuthorityForUserValidator:()=>Go,LCNSigningAuthorityValidator:()=>Xn,PaginatedBoostRecipientsValidator:()=>Oi,PaginatedBoostRecipientsWithChildrenValidator:()=>$o,PaginatedBoostsValidator:()=>Pi,PaginatedClaimHooksValidator:()=>zo,PaginatedConsentFlowContractsValidator:()=>Ai,PaginatedConsentFlowDataForDidValidator:()=>Di,PaginatedConsentFlowDataValidator:()=>Ii,PaginatedConsentFlowTermsValidator:()=>Mi,PaginatedConsentFlowTransactionsValidator:()=>Ko,PaginatedContractCredentialsValidator:()=>Xo,PaginatedEncryptedCredentialRecordsValidator:()=>Ci,PaginatedEncryptedRecordsValidator:()=>wi,PaginatedInboxCredentialsValidator:()=>os,PaginatedLCNProfileManagersValidator:()=>Uo,PaginatedLCNProfilesAndManagersValidator:()=>Ma,PaginatedLCNProfilesValidator:()=>Da,PaginationOptionsValidator:()=>_i,PaginationResponseValidator:()=>Oe,ProfileValidator:()=>tr,ProofValidator:()=>ut,RefreshServiceValidator:()=>Ca,RegExpValidator:()=>Ia,RelatedValidator:()=>Wn,ResultDescriptionValidator:()=>tt,ResultStatusTypeValidator:()=>Ra,ResultTypeValidator:()=>Gn,ResultValidator:()=>bn,RubricCriterionValidator:()=>ar,SentCredentialInfoValidator:()=>qo,ServiceValidator:()=>Ta,SetPrimaryContactMethodValidator:()=>is,StringQuery:()=>pe,TermsOfUseValidator:()=>xa,UnsignedAchievementCredentialValidator:()=>ja,UnsignedVCValidator:()=>Or,UnsignedVPValidator:()=>i,VC2EvidenceValidator:()=>Ea,VCValidator:()=>zn,VPValidator:()=>jr,VerificationCheckValidator:()=>Bt,VerificationItemValidator:()=>vi,VerificationMethodValidator:()=>et,VerificationStatusEnum:()=>Zo,VerificationStatusValidator:()=>Hn}),e.exports=m(E);var P;(function(t){t.assertEqual=_=>_;function d(_){}b(d,"assertIs"),F(d,"assertIs"),y(d,"assertIs"),t.assertIs=d;function p(_){throw new Error}b(p,"assertNever"),F(p,"assertNever"),y(p,"assertNever"),t.assertNever=p,t.arrayToEnum=_=>{let k={};for(let T of _)k[T]=T;return k},t.getValidEnumValues=_=>{let k=t.objectKeys(_).filter(D=>typeof _[_[D]]!="number"),T={};for(let D of k)T[D]=_[D];return t.objectValues(T)},t.objectValues=_=>t.objectKeys(_).map(function(k){return _[k]}),t.objectKeys=typeof Object.keys=="function"?_=>Object.keys(_):_=>{let k=[];for(let T in _)Object.prototype.hasOwnProperty.call(_,T)&&k.push(T);return k},t.find=(_,k)=>{for(let T of _)if(k(T))return T},t.isInteger=typeof Number.isInteger=="function"?_=>Number.isInteger(_):_=>typeof _=="number"&&isFinite(_)&&Math.floor(_)===_;function x(_,k=" | "){return _.map(T=>typeof T=="string"?`'${T}'`:T).join(k)}b(x,"joinValues"),F(x,"joinValues"),y(x,"joinValues"),t.joinValues=x,t.jsonStringifyReplacer=(_,k)=>typeof k=="bigint"?k.toString():k})(P||(P={}));var z;(function(t){t.mergeShapes=(d,p)=>({...d,...p})})(z||(z={}));var O=P.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),oe=y(t=>{switch(typeof t){case"undefined":return O.undefined;case"string":return O.string;case"number":return isNaN(t)?O.nan:O.number;case"boolean":return O.boolean;case"function":return O.function;case"bigint":return O.bigint;case"symbol":return O.symbol;case"object":return Array.isArray(t)?O.array:t===null?O.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?O.promise:typeof Map<"u"&&t instanceof Map?O.map:typeof Set<"u"&&t instanceof Set?O.set:typeof Date<"u"&&t instanceof Date?O.date:O.object;default:return O.unknown}},"getParsedType"),j=P.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"]),ke=y(t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),Re=F(class extends Error{constructor(t){super(),this.issues=[],this.addIssue=p=>{this.issues=[...this.issues,p]},this.addIssues=(p=[])=>{this.issues=[...this.issues,...p]};let d=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,d):this.__proto__=d,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){let d=t||function(_){return _.message},p={_errors:[]},x=y(_=>{for(let k of _.issues)if(k.code==="invalid_union")k.unionErrors.map(x);else if(k.code==="invalid_return_type")x(k.returnTypeError);else if(k.code==="invalid_arguments")x(k.argumentsError);else if(k.path.length===0)p._errors.push(d(k));else{let T=p,D=0;for(;D<k.path.length;){let A=k.path[D];D===k.path.length-1?(T[A]=T[A]||{_errors:[]},T[A]._errors.push(d(k))):T[A]=T[A]||{_errors:[]},T=T[A],D++}}},"processError");return x(this),p}static assert(t){if(!(t instanceof Re))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,P.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=d=>d.message){let d={},p=[];for(let x of this.issues)x.path.length>0?(d[x.path[0]]=d[x.path[0]]||[],d[x.path[0]].push(t(x))):p.push(t(x));return{formErrors:p,fieldErrors:d}}get formErrors(){return this.flatten()}},"ZodError");y(Re,"ZodError"),Re.create=t=>new Re(t);var Pt=y((t,d)=>{let p;switch(t.code){case j.invalid_type:t.received===O.undefined?p="Required":p=`Expected ${t.expected}, received ${t.received}`;break;case j.invalid_literal:p=`Invalid literal value, expected ${JSON.stringify(t.expected,P.jsonStringifyReplacer)}`;break;case j.unrecognized_keys:p=`Unrecognized key(s) in object: ${P.joinValues(t.keys,", ")}`;break;case j.invalid_union:p="Invalid input";break;case j.invalid_union_discriminator:p=`Invalid discriminator value. Expected ${P.joinValues(t.options)}`;break;case j.invalid_enum_value:p=`Invalid enum value. Expected ${P.joinValues(t.options)}, received '${t.received}'`;break;case j.invalid_arguments:p="Invalid function arguments";break;case j.invalid_return_type:p="Invalid function return type";break;case j.invalid_date:p="Invalid date";break;case j.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(p=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(p=`${p} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?p=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?p=`Invalid input: must end with "${t.validation.endsWith}"`:P.assertNever(t.validation):t.validation!=="regex"?p=`Invalid ${t.validation}`:p="Invalid";break;case j.too_small:t.type==="array"?p=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?p=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?p=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?p=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:p="Invalid input";break;case j.too_big:t.type==="array"?p=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?p=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?p=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?p=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?p=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:p="Invalid input";break;case j.custom:p="Invalid input";break;case j.invalid_intersection_types:p="Intersection results could not be merged";break;case j.not_multiple_of:p=`Number must be a multiple of ${t.multipleOf}`;break;case j.not_finite:p="Number must be finite";break;default:p=d.defaultError,P.assertNever(t)}return{message:p}},"errorMap"),Mn=Pt;function ha(t){Mn=t}b(ha,"setErrorMap"),F(ha,"setErrorMap"),y(ha,"setErrorMap");function pr(){return Mn}b(pr,"getErrorMap"),F(pr,"getErrorMap"),y(pr,"getErrorMap");var de=y(t=>{let{data:d,path:p,errorMaps:x,issueData:_}=t,k=[...p,..._.path||[]],T={..._,path:k};if(_.message!==void 0)return{..._,path:k,message:_.message};let D="",A=x.filter(te=>!!te).slice().reverse();for(let te of A)D=te(T,{data:d,defaultError:D}).message;return{..._,path:k,message:D}},"makeIssue"),ye=[];function L(t,d){let p=pr(),x=de({issueData:d,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,p,p===Pt?void 0:Pt].filter(_=>!!_)});t.common.issues.push(x)}b(L,"addIssueToContext"),F(L,"addIssueToContext"),y(L,"addIssueToContext");var be=F(class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,d){let p=[];for(let x of d){if(x.status==="aborted")return G;x.status==="dirty"&&t.dirty(),p.push(x.value)}return{status:t.value,value:p}}static async mergeObjectAsync(t,d){let p=[];for(let x of d){let _=await x.key,k=await x.value;p.push({key:_,value:k})}return be.mergeObjectSync(t,p)}static mergeObjectSync(t,d){let p={};for(let x of d){let{key:_,value:k}=x;if(_.status==="aborted"||k.status==="aborted")return G;_.status==="dirty"&&t.dirty(),k.status==="dirty"&&t.dirty(),_.value!=="__proto__"&&(typeof k.value<"u"||x.alwaysSet)&&(p[_.value]=k.value)}return{status:t.value,value:p}}},"ParseStatus");y(be,"ParseStatus");var G=Object.freeze({status:"aborted"}),fr=y(t=>({status:"dirty",value:t}),"DIRTY"),I=y(t=>({status:"valid",value:t}),"OK"),ma=y(t=>t.status==="aborted","isAborted"),ga=y(t=>t.status==="dirty","isDirty"),rn=y(t=>t.status==="valid","isValid"),hr=y(t=>typeof Promise<"u"&&t instanceof Promise,"isAsync");function le(t,d,p,x){if(p==="a"&&!x)throw new TypeError("Private accessor was defined without a getter");if(typeof d=="function"?t!==d||!x:!d.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return p==="m"?x:p==="a"?x.call(t):x?x.value:d.get(t)}b(le,"__classPrivateFieldGet"),F(le,"__classPrivateFieldGet"),y(le,"__classPrivateFieldGet");function mr(t,d,p,x,_){if(x==="m")throw new TypeError("Private method is not writable");if(x==="a"&&!_)throw new TypeError("Private accessor was defined without a setter");if(typeof d=="function"?t!==d||!_:!d.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return x==="a"?_.call(t,p):_?_.value=p:d.set(t,p),p}b(mr,"__classPrivateFieldSet"),F(mr,"__classPrivateFieldSet"),y(mr,"__classPrivateFieldSet");var V;(function(t){t.errToObj=d=>typeof d=="string"?{message:d}:d||{},t.toString=d=>typeof d=="string"?d:d?.message})(V||(V={}));var Qe,Z,it=F(class{constructor(t,d,p,x){this._cachedPath=[],this.parent=t,this.data=d,this._path=p,this._key=x}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 Ze=y((t,d)=>{if(rn(d))return{success:!0,data:d.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let p=new Re(t.common.issues);return this._error=p,this._error}}},"handleResult");function Y(t){if(!t)return{};let{errorMap:d,invalid_type_error:p,required_error:x,description:_}=t;if(d&&(p||x))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return d?{errorMap:d,description:_}:{errorMap:y((T,D)=>{var A,te;let{message:we}=t;return T.code==="invalid_enum_value"?{message:we??D.defaultError}:typeof D.data>"u"?{message:(A=we??x)!==null&&A!==void 0?A:D.defaultError}:T.code!=="invalid_type"?{message:D.defaultError}:{message:(te=we??p)!==null&&te!==void 0?te:D.defaultError}},"customMap"),description:_}}b(Y,"processCreateParams"),F(Y,"processCreateParams"),y(Y,"processCreateParams");var ie=F(class{constructor(t){this.spa=this.safeParseAsync,this._def=t,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(t){return oe(t.data)}_getOrReturnCtx(t,d){return d||{common:t.parent.common,data:t.data,parsedType:oe(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new be,ctx:{common:t.parent.common,data:t.data,parsedType:oe(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let d=this._parse(t);if(hr(d))throw new Error("Synchronous parse encountered promise.");return d}_parseAsync(t){let d=this._parse(t);return Promise.resolve(d)}parse(t,d){let p=this.safeParse(t,d);if(p.success)return p.data;throw p.error}safeParse(t,d){var p;let x={common:{issues:[],async:(p=d?.async)!==null&&p!==void 0?p:!1,contextualErrorMap:d?.errorMap},path:d?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:oe(t)},_=this._parseSync({data:t,path:x.path,parent:x});return Ze(x,_)}async parseAsync(t,d){let p=await this.safeParseAsync(t,d);if(p.success)return p.data;throw p.error}async safeParseAsync(t,d){let p={common:{issues:[],contextualErrorMap:d?.errorMap,async:!0},path:d?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:oe(t)},x=this._parse({data:t,path:p.path,parent:p}),_=await(hr(x)?x:Promise.resolve(x));return Ze(p,_)}refine(t,d){let p=y(x=>typeof d=="string"||typeof d>"u"?{message:d}:typeof d=="function"?d(x):d,"getIssueProperties");return this._refinement((x,_)=>{let k=t(x),T=y(()=>_.addIssue({code:j.custom,...p(x)}),"setError");return typeof Promise<"u"&&k instanceof Promise?k.then(D=>D?!0:(T(),!1)):k?!0:(T(),!1)})}refinement(t,d){return this._refinement((p,x)=>t(p)?!0:(x.addIssue(typeof d=="function"?d(p,x):d),!1))}_refinement(t){return new Se({schema:this,typeName:J.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Ee.create(this,this._def)}nullable(){return Ge.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ot.create(this,this._def)}promise(){return We.create(this,this._def)}or(t){return Kt.create([this,t],this._def)}and(t){return vt.create(this,t,this._def)}transform(t){return new Se({...Y(this._def),schema:this,typeName:J.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let d=typeof t=="function"?t:()=>t;return new Ie({...Y(this._def),innerType:this,defaultValue:d,typeName:J.ZodDefault})}brand(){return new Ke({typeName:J.ZodBranded,type:this,...Y(this._def)})}catch(t){let d=typeof t=="function"?t:()=>t;return new Be({...Y(this._def),innerType:this,catchValue:d,typeName:J.ZodCatch})}describe(t){let d=this.constructor;return new d({...this._def,description:t})}pipe(t){return Lt.create(this,t)}readonly(){return lt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},"ZodType");y(ie,"ZodType");var Ln=/^c[^\s-]{8,}$/i,Wt=/^[0-9a-z]+$/,Zn=/^[0-9A-HJKMNP-TV-Z]{26}$/,wo=/^[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,B=/^[a-z0-9_-]{21}$/i,Ae=/^[-+]?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)?)??$/,X=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,gr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Pe,ya=/^(?:(?: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])$/,va=/^(([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})))$/,nn=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,yr="((\\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])))",Gt=new RegExp(`^${yr}$`);function Ot(t){let d="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?d=`${d}\\.\\d{${t.precision}}`:t.precision==null&&(d=`${d}(\\.\\d+)?`),d}b(Ot,"timeRegexSource"),F(Ot,"timeRegexSource"),y(Ot,"timeRegexSource");function W(t){return new RegExp(`^${Ot(t)}$`)}b(W,"timeRegex"),F(W,"timeRegex"),y(W,"timeRegex");function jt(t){let d=`${yr}T${Ot(t)}`,p=[];return p.push(t.local?"Z?":"Z"),t.offset&&p.push("([+-]\\d{2}:?\\d{2})"),d=`${d}(${p.join("|")})`,new RegExp(`^${d}$`)}b(jt,"datetimeRegex"),F(jt,"datetimeRegex"),y(jt,"datetimeRegex");function Ht(t,d){return!!((d==="v4"||!d)&&ya.test(t)||(d==="v6"||!d)&&va.test(t))}b(Ht,"isValidIP"),F(Ht,"isValidIP"),y(Ht,"isValidIP");var Ce=F(class extends ie{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==O.string){let _=this._getOrReturnCtx(t);return L(_,{code:j.invalid_type,expected:O.string,received:_.parsedType}),G}let p=new be,x;for(let _ of this._def.checks)if(_.kind==="min")t.data.length<_.value&&(x=this._getOrReturnCtx(t,x),L(x,{code:j.too_small,minimum:_.value,type:"string",inclusive:!0,exact:!1,message:_.message}),p.dirty());else if(_.kind==="max")t.data.length>_.value&&(x=this._getOrReturnCtx(t,x),L(x,{code:j.too_big,maximum:_.value,type:"string",inclusive:!0,exact:!1,message:_.message}),p.dirty());else if(_.kind==="length"){let k=t.data.length>_.value,T=t.data.length<_.value;(k||T)&&(x=this._getOrReturnCtx(t,x),k?L(x,{code:j.too_big,maximum:_.value,type:"string",inclusive:!0,exact:!0,message:_.message}):T&&L(x,{code:j.too_small,minimum:_.value,type:"string",inclusive:!0,exact:!0,message:_.message}),p.dirty())}else if(_.kind==="email")X.test(t.data)||(x=this._getOrReturnCtx(t,x),L(x,{validation:"email",code:j.invalid_string,message:_.message}),p.dirty());else if(_.kind==="emoji")Pe||(Pe=new RegExp(gr,"u")),Pe.test(t.data)||(x=this._getOrReturnCtx(t,x),L(x,{validation:"emoji",code:j.invalid_string,message:_.message}),p.dirty());else if(_.kind==="uuid")wo.test(t.data)||(x=this._getOrReturnCtx(t,x),L(x,{validation:"uuid",code:j.invalid_string,message:_.message}),p.dirty());else if(_.kind==="nanoid")B.test(t.data)||(x=this._getOrReturnCtx(t,x),L(x,{validation:"nanoid",code:j.invalid_string,message:_.message}),p.dirty());else if(_.kind==="cuid")Ln.test(t.data)||(x=this._getOrReturnCtx(t,x),L(x,{validation:"cuid",code:j.invalid_string,message:_.message}),p.dirty());else if(_.kind==="cuid2")Wt.test(t.data)||(x=this._getOrReturnCtx(t,x),L(x,{validation:"cuid2",code:j.invalid_string,message:_.message}),p.dirty());else if(_.kind==="ulid")Zn.test(t.data)||(x=this._getOrReturnCtx(t,x),L(x,{validation:"ulid",code:j.invalid_string,message:_.message}),p.dirty());else if(_.kind==="url")try{new URL(t.data)}catch{x=this._getOrReturnCtx(t,x),L(x,{validation:"url",code:j.invalid_string,message:_.message}),p.dirty()}else _.kind==="regex"?(_.regex.lastIndex=0,_.regex.test(t.data)||(x=this._getOrReturnCtx(t,x),L(x,{validation:"regex",code:j.invalid_string,message:_.message}),p.dirty())):_.kind==="trim"?t.data=t.data.trim():_.kind==="includes"?t.data.includes(_.value,_.position)||(x=this._getOrReturnCtx(t,x),L(x,{code:j.invalid_string,validation:{includes:_.value,position:_.position},message:_.message}),p.dirty()):_.kind==="toLowerCase"?t.data=t.data.toLowerCase():_.kind==="toUpperCase"?t.data=t.data.toUpperCase():_.kind==="startsWith"?t.data.startsWith(_.value)||(x=this._getOrReturnCtx(t,x),L(x,{code:j.invalid_string,validation:{startsWith:_.value},message:_.message}),p.dirty()):_.kind==="endsWith"?t.data.endsWith(_.value)||(x=this._getOrReturnCtx(t,x),L(x,{code:j.invalid_string,validation:{endsWith:_.value},message:_.message}),p.dirty()):_.kind==="datetime"?jt(_).test(t.data)||(x=this._getOrReturnCtx(t,x),L(x,{code:j.invalid_string,validation:"datetime",message:_.message}),p.dirty()):_.kind==="date"?Gt.test(t.data)||(x=this._getOrReturnCtx(t,x),L(x,{code:j.invalid_string,validation:"date",message:_.message}),p.dirty()):_.kind==="time"?W(_).test(t.data)||(x=this._getOrReturnCtx(t,x),L(x,{code:j.invalid_string,validation:"time",message:_.message}),p.dirty()):_.kind==="duration"?Ae.test(t.data)||(x=this._getOrReturnCtx(t,x),L(x,{validation:"duration",code:j.invalid_string,message:_.message}),p.dirty()):_.kind==="ip"?Ht(t.data,_.version)||(x=this._getOrReturnCtx(t,x),L(x,{validation:"ip",code:j.invalid_string,message:_.message}),p.dirty()):_.kind==="base64"?nn.test(t.data)||(x=this._getOrReturnCtx(t,x),L(x,{validation:"base64",code:j.invalid_string,message:_.message}),p.dirty()):P.assertNever(_);return{status:p.value,value:t.data}}_regex(t,d,p){return this.refinement(x=>t.test(x),{validation:d,code:j.invalid_string,...V.errToObj(p)})}_addCheck(t){return new Ce({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...V.errToObj(t)})}url(t){return this._addCheck({kind:"url",...V.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...V.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...V.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...V.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...V.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...V.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...V.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...V.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...V.errToObj(t)})}datetime(t){var d,p;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:(d=t?.offset)!==null&&d!==void 0?d:!1,local:(p=t?.local)!==null&&p!==void 0?p:!1,...V.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...V.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...V.errToObj(t)})}regex(t,d){return this._addCheck({kind:"regex",regex:t,...V.errToObj(d)})}includes(t,d){return this._addCheck({kind:"includes",value:t,position:d?.position,...V.errToObj(d?.message)})}startsWith(t,d){return this._addCheck({kind:"startsWith",value:t,...V.errToObj(d)})}endsWith(t,d){return this._addCheck({kind:"endsWith",value:t,...V.errToObj(d)})}min(t,d){return this._addCheck({kind:"min",value:t,...V.errToObj(d)})}max(t,d){return this._addCheck({kind:"max",value:t,...V.errToObj(d)})}length(t,d){return this._addCheck({kind:"length",value:t,...V.errToObj(d)})}nonempty(t){return this.min(1,V.errToObj(t))}trim(){return new Ce({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ce({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ce({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(let d of this._def.checks)d.kind==="min"&&(t===null||d.value>t)&&(t=d.value);return t}get maxLength(){let t=null;for(let d of this._def.checks)d.kind==="max"&&(t===null||d.value<t)&&(t=d.value);return t}},"ZodString");y(Ce,"ZodString"),Ce.create=t=>{var d;return new Ce({checks:[],typeName:J.ZodString,coerce:(d=t?.coerce)!==null&&d!==void 0?d:!1,...Y(t)})};function Un(t,d){let p=(t.toString().split(".")[1]||"").length,x=(d.toString().split(".")[1]||"").length,_=p>x?p:x,k=parseInt(t.toFixed(_).replace(".","")),T=parseInt(d.toFixed(_).replace(".",""));return k%T/Math.pow(10,_)}b(Un,"floatSafeRemainder"),F(Un,"floatSafeRemainder"),y(Un,"floatSafeRemainder");var Q=F(class extends ie{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==O.number){let _=this._getOrReturnCtx(t);return L(_,{code:j.invalid_type,expected:O.number,received:_.parsedType}),G}let p,x=new be;for(let _ of this._def.checks)_.kind==="int"?P.isInteger(t.data)||(p=this._getOrReturnCtx(t,p),L(p,{code:j.invalid_type,expected:"integer",received:"float",message:_.message}),x.dirty()):_.kind==="min"?(_.inclusive?t.data<_.value:t.data<=_.value)&&(p=this._getOrReturnCtx(t,p),L(p,{code:j.too_small,minimum:_.value,type:"number",inclusive:_.inclusive,exact:!1,message:_.message}),x.dirty()):_.kind==="max"?(_.inclusive?t.data>_.value:t.data>=_.value)&&(p=this._getOrReturnCtx(t,p),L(p,{code:j.too_big,maximum:_.value,type:"number",inclusive:_.inclusive,exact:!1,message:_.message}),x.dirty()):_.kind==="multipleOf"?Un(t.data,_.value)!==0&&(p=this._getOrReturnCtx(t,p),L(p,{code:j.not_multiple_of,multipleOf:_.value,message:_.message}),x.dirty()):_.kind==="finite"?Number.isFinite(t.data)||(p=this._getOrReturnCtx(t,p),L(p,{code:j.not_finite,message:_.message}),x.dirty()):P.assertNever(_);return{status:x.value,value:t.data}}gte(t,d){return this.setLimit("min",t,!0,V.toString(d))}gt(t,d){return this.setLimit("min",t,!1,V.toString(d))}lte(t,d){return this.setLimit("max",t,!0,V.toString(d))}lt(t,d){return this.setLimit("max",t,!1,V.toString(d))}setLimit(t,d,p,x){return new Q({...this._def,checks:[...this._def.checks,{kind:t,value:d,inclusive:p,message:V.toString(x)}]})}_addCheck(t){return new Q({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:V.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:V.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:V.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:V.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:V.toString(t)})}multipleOf(t,d){return this._addCheck({kind:"multipleOf",value:t,message:V.toString(d)})}finite(t){return this._addCheck({kind:"finite",message:V.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:V.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:V.toString(t)})}get minValue(){let t=null;for(let d of this._def.checks)d.kind==="min"&&(t===null||d.value>t)&&(t=d.value);return t}get maxValue(){let t=null;for(let d of this._def.checks)d.kind==="max"&&(t===null||d.value<t)&&(t=d.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&P.isInteger(t.value))}get isFinite(){let t=null,d=null;for(let p of this._def.checks){if(p.kind==="finite"||p.kind==="int"||p.kind==="multipleOf")return!0;p.kind==="min"?(d===null||p.value>d)&&(d=p.value):p.kind==="max"&&(t===null||p.value<t)&&(t=p.value)}return Number.isFinite(d)&&Number.isFinite(t)}},"ZodNumber");y(Q,"ZodNumber"),Q.create=t=>new Q({checks:[],typeName:J.ZodNumber,coerce:t?.coerce||!1,...Y(t)});var ee=F(class extends ie{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==O.bigint){let _=this._getOrReturnCtx(t);return L(_,{code:j.invalid_type,expected:O.bigint,received:_.parsedType}),G}let p,x=new be;for(let _ of this._def.checks)_.kind==="min"?(_.inclusive?t.data<_.value:t.data<=_.value)&&(p=this._getOrReturnCtx(t,p),L(p,{code:j.too_small,type:"bigint",minimum:_.value,inclusive:_.inclusive,message:_.message}),x.dirty()):_.kind==="max"?(_.inclusive?t.data>_.value:t.data>=_.value)&&(p=this._getOrReturnCtx(t,p),L(p,{code:j.too_big,type:"bigint",maximum:_.value,inclusive:_.inclusive,message:_.message}),x.dirty()):_.kind==="multipleOf"?t.data%_.value!==BigInt(0)&&(p=this._getOrReturnCtx(t,p),L(p,{code:j.not_multiple_of,multipleOf:_.value,message:_.message}),x.dirty()):P.assertNever(_);return{status:x.value,value:t.data}}gte(t,d){return this.setLimit("min",t,!0,V.toString(d))}gt(t,d){return this.setLimit("min",t,!1,V.toString(d))}lte(t,d){return this.setLimit("max",t,!0,V.toString(d))}lt(t,d){return this.setLimit("max",t,!1,V.toString(d))}setLimit(t,d,p,x){return new ee({...this._def,checks:[...this._def.checks,{kind:t,value:d,inclusive:p,message:V.toString(x)}]})}_addCheck(t){return new ee({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:V.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:V.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:V.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:V.toString(t)})}multipleOf(t,d){return this._addCheck({kind:"multipleOf",value:t,message:V.toString(d)})}get minValue(){let t=null;for(let d of this._def.checks)d.kind==="min"&&(t===null||d.value>t)&&(t=d.value);return t}get maxValue(){let t=null;for(let d of this._def.checks)d.kind==="max"&&(t===null||d.value<t)&&(t=d.value);return t}},"ZodBigInt");y(ee,"ZodBigInt"),ee.create=t=>{var d;return new ee({checks:[],typeName:J.ZodBigInt,coerce:(d=t?.coerce)!==null&&d!==void 0?d:!1,...Y(t)})};var vr=F(class extends ie{_parse(t){if(this._def.coerce&&(t.data=Boolean(t.data)),this._getType(t)!==O.boolean){let p=this._getOrReturnCtx(t);return L(p,{code:j.invalid_type,expected:O.boolean,received:p.parsedType}),G}return I(t.data)}},"ZodBoolean");y(vr,"ZodBoolean"),vr.create=t=>new vr({typeName:J.ZodBoolean,coerce:t?.coerce||!1,...Y(t)});var Jt=F(class extends ie{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==O.date){let _=this._getOrReturnCtx(t);return L(_,{code:j.invalid_type,expected:O.date,received:_.parsedType}),G}if(isNaN(t.data.getTime())){let _=this._getOrReturnCtx(t);return L(_,{code:j.invalid_date}),G}let p=new be,x;for(let _ of this._def.checks)_.kind==="min"?t.data.getTime()<_.value&&(x=this._getOrReturnCtx(t,x),L(x,{code:j.too_small,message:_.message,inclusive:!0,exact:!1,minimum:_.value,type:"date"}),p.dirty()):_.kind==="max"?t.data.getTime()>_.value&&(x=this._getOrReturnCtx(t,x),L(x,{code:j.too_big,message:_.message,inclusive:!0,exact:!1,maximum:_.value,type:"date"}),p.dirty()):P.assertNever(_);return{status:p.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Jt({...this._def,checks:[...this._def.checks,t]})}min(t,d){return this._addCheck({kind:"min",value:t.getTime(),message:V.toString(d)})}max(t,d){return this._addCheck({kind:"max",value:t.getTime(),message:V.toString(d)})}get minDate(){let t=null;for(let d of this._def.checks)d.kind==="min"&&(t===null||d.value>t)&&(t=d.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let d of this._def.checks)d.kind==="max"&&(t===null||d.value<t)&&(t=d.value);return t!=null?new Date(t):null}},"ZodDate");y(Jt,"ZodDate"),Jt.create=t=>new Jt({checks:[],coerce:t?.coerce||!1,typeName:J.ZodDate,...Y(t)});var an=F(class extends ie{_parse(t){if(this._getType(t)!==O.symbol){let p=this._getOrReturnCtx(t);return L(p,{code:j.invalid_type,expected:O.symbol,received:p.parsedType}),G}return I(t.data)}},"ZodSymbol");y(an,"ZodSymbol"),an.create=t=>new an({typeName:J.ZodSymbol,...Y(t)});var br=F(class extends ie{_parse(t){if(this._getType(t)!==O.undefined){let p=this._getOrReturnCtx(t);return L(p,{code:j.invalid_type,expected:O.undefined,received:p.parsedType}),G}return I(t.data)}},"ZodUndefined");y(br,"ZodUndefined"),br.create=t=>new br({typeName:J.ZodUndefined,...Y(t)});var _r=F(class extends ie{_parse(t){if(this._getType(t)!==O.null){let p=this._getOrReturnCtx(t);return L(p,{code:j.invalid_type,expected:O.null,received:p.parsedType}),G}return I(t.data)}},"ZodNull");y(_r,"ZodNull"),_r.create=t=>new _r({typeName:J.ZodNull,...Y(t)});var Qt=F(class extends ie{constructor(){super(...arguments),this._any=!0}_parse(t){return I(t.data)}},"ZodAny");y(Qt,"ZodAny"),Qt.create=t=>new Qt({typeName:J.ZodAny,...Y(t)});var Vt=F(class extends ie{constructor(){super(...arguments),this._unknown=!0}_parse(t){return I(t.data)}},"ZodUnknown");y(Vt,"ZodUnknown"),Vt.create=t=>new Vt({typeName:J.ZodUnknown,...Y(t)});var yt=F(class extends ie{_parse(t){let d=this._getOrReturnCtx(t);return L(d,{code:j.invalid_type,expected:O.never,received:d.parsedType}),G}},"ZodNever");y(yt,"ZodNever"),yt.create=t=>new yt({typeName:J.ZodNever,...Y(t)});var Yt=F(class extends ie{_parse(t){if(this._getType(t)!==O.undefined){let p=this._getOrReturnCtx(t);return L(p,{code:j.invalid_type,expected:O.void,received:p.parsedType}),G}return I(t.data)}},"ZodVoid");y(Yt,"ZodVoid"),Yt.create=t=>new Yt({typeName:J.ZodVoid,...Y(t)});var ot=F(class extends ie{_parse(t){let{ctx:d,status:p}=this._processInputParams(t),x=this._def;if(d.parsedType!==O.array)return L(d,{code:j.invalid_type,expected:O.array,received:d.parsedType}),G;if(x.exactLength!==null){let k=d.data.length>x.exactLength.value,T=d.data.length<x.exactLength.value;(k||T)&&(L(d,{code:k?j.too_big:j.too_small,minimum:T?x.exactLength.value:void 0,maximum:k?x.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:x.exactLength.message}),p.dirty())}if(x.minLength!==null&&d.data.length<x.minLength.value&&(L(d,{code:j.too_small,minimum:x.minLength.value,type:"array",inclusive:!0,exact:!1,message:x.minLength.message}),p.dirty()),x.maxLength!==null&&d.data.length>x.maxLength.value&&(L(d,{code:j.too_big,maximum:x.maxLength.value,type:"array",inclusive:!0,exact:!1,message:x.maxLength.message}),p.dirty()),d.common.async)return Promise.all([...d.data].map((k,T)=>x.type._parseAsync(new it(d,k,d.path,T)))).then(k=>be.mergeArray(p,k));let _=[...d.data].map((k,T)=>x.type._parseSync(new it(d,k,d.path,T)));return be.mergeArray(p,_)}get element(){return this._def.type}min(t,d){return new ot({...this._def,minLength:{value:t,message:V.toString(d)}})}max(t,d){return new ot({...this._def,maxLength:{value:t,message:V.toString(d)}})}length(t,d){return new ot({...this._def,exactLength:{value:t,message:V.toString(d)}})}nonempty(t){return this.min(1,t)}},"ZodArray");y(ot,"ZodArray"),ot.create=(t,d)=>new ot({type:t,minLength:null,maxLength:null,exactLength:null,typeName:J.ZodArray,...Y(d)});function At(t){if(t instanceof _e){let d={};for(let p in t.shape){let x=t.shape[p];d[p]=Ee.create(At(x))}return new _e({...t._def,shape:()=>d})}else return t instanceof ot?new ot({...t._def,type:At(t.element)}):t instanceof Ee?Ee.create(At(t.unwrap())):t instanceof Ge?Ge.create(At(t.unwrap())):t instanceof ze?ze.create(t.items.map(d=>At(d))):t}b(At,"deepPartialify"),F(At,"deepPartialify"),y(At,"deepPartialify");var _e=F(class extends ie{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),d=P.objectKeys(t);return this._cached={shape:t,keys:d}}_parse(t){if(this._getType(t)!==O.object){let A=this._getOrReturnCtx(t);return L(A,{code:j.invalid_type,expected:O.object,received:A.parsedType}),G}let{status:p,ctx:x}=this._processInputParams(t),{shape:_,keys:k}=this._getCached(),T=[];if(!(this._def.catchall instanceof yt&&this._def.unknownKeys==="strip"))for(let A in x.data)k.includes(A)||T.push(A);let D=[];for(let A of k){let te=_[A],we=x.data[A];D.push({key:{status:"valid",value:A},value:te._parse(new it(x,we,x.path,A)),alwaysSet:A in x.data})}if(this._def.catchall instanceof yt){let A=this._def.unknownKeys;if(A==="passthrough")for(let te of T)D.push({key:{status:"valid",value:te},value:{status:"valid",value:x.data[te]}});else if(A==="strict")T.length>0&&(L(x,{code:j.unrecognized_keys,keys:T}),p.dirty());else if(A!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let A=this._def.catchall;for(let te of T){let we=x.data[te];D.push({key:{status:"valid",value:te},value:A._parse(new it(x,we,x.path,te)),alwaysSet:te in x.data})}}return x.common.async?Promise.resolve().then(async()=>{let A=[];for(let te of D){let we=await te.key,ta=await te.value;A.push({key:we,value:ta,alwaysSet:te.alwaysSet})}return A}).then(A=>be.mergeObjectSync(p,A)):be.mergeObjectSync(p,D)}get shape(){return this._def.shape()}strict(t){return V.errToObj,new _e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(d,p)=>{var x,_,k,T;let D=(k=(_=(x=this._def).errorMap)===null||_===void 0?void 0:_.call(x,d,p).message)!==null&&k!==void 0?k:p.defaultError;return d.code==="unrecognized_keys"?{message:(T=V.errToObj(t).message)!==null&&T!==void 0?T:D}:{message:D}}}:{}})}strip(){return new _e({...this._def,unknownKeys:"strip"})}passthrough(){return new _e({...this._def,unknownKeys:"passthrough"})}extend(t){return new _e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new _e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:J.ZodObject})}setKey(t,d){return this.augment({[t]:d})}catchall(t){return new _e({...this._def,catchall:t})}pick(t){let d={};return P.objectKeys(t).forEach(p=>{t[p]&&this.shape[p]&&(d[p]=this.shape[p])}),new _e({...this._def,shape:()=>d})}omit(t){let d={};return P.objectKeys(this.shape).forEach(p=>{t[p]||(d[p]=this.shape[p])}),new _e({...this._def,shape:()=>d})}deepPartial(){return At(this)}partial(t){let d={};return P.objectKeys(this.shape).forEach(p=>{let x=this.shape[p];t&&!t[p]?d[p]=x:d[p]=x.optional()}),new _e({...this._def,shape:()=>d})}required(t){let d={};return P.objectKeys(this.shape).forEach(p=>{if(t&&!t[p])d[p]=this.shape[p];else{let _=this.shape[p];for(;_ instanceof Ee;)_=_._def.innerType;d[p]=_}}),new _e({...this._def,shape:()=>d})}keyof(){return Mt(P.objectKeys(this.shape))}},"ZodObject");y(_e,"ZodObject"),_e.create=(t,d)=>new _e({shape:()=>t,unknownKeys:"strip",catchall:yt.create(),typeName:J.ZodObject,...Y(d)}),_e.strictCreate=(t,d)=>new _e({shape:()=>t,unknownKeys:"strict",catchall:yt.create(),typeName:J.ZodObject,...Y(d)}),_e.lazycreate=(t,d)=>new _e({shape:t,unknownKeys:"strip",catchall:yt.create(),typeName:J.ZodObject,...Y(d)});var Kt=F(class extends ie{_parse(t){let{ctx:d}=this._processInputParams(t),p=this._def.options;function x(_){for(let T of _)if(T.result.status==="valid")return T.result;for(let T of _)if(T.result.status==="dirty")return d.common.issues.push(...T.ctx.common.issues),T.result;let k=_.map(T=>new Re(T.ctx.common.issues));return L(d,{code:j.invalid_union,unionErrors:k}),G}if(b(x,"handleResults"),F(x,"handleResults"),y(x,"handleResults"),d.common.async)return Promise.all(p.map(async _=>{let k={...d,common:{...d.common,issues:[]},parent:null};return{result:await _._parseAsync({data:d.data,path:d.path,parent:k}),ctx:k}})).then(x);{let _,k=[];for(let D of p){let A={...d,common:{...d.common,issues:[]},parent:null},te=D._parseSync({data:d.data,path:d.path,parent:A});if(te.status==="valid")return te;te.status==="dirty"&&!_&&(_={result:te,ctx:A}),A.common.issues.length&&k.push(A.common.issues)}if(_)return d.common.issues.push(..._.ctx.common.issues),_.result;let T=k.map(D=>new Re(D));return L(d,{code:j.invalid_union,unionErrors:T}),G}}get options(){return this._def.options}},"ZodUnion");y(Kt,"ZodUnion"),Kt.create=(t,d)=>new Kt({options:t,typeName:J.ZodUnion,...Y(d)});var wt=y(t=>t instanceof st?wt(t.schema):t instanceof Se?wt(t.innerType()):t instanceof Ye?[t.value]:t instanceof Fe?t.options:t instanceof ct?P.objectValues(t.enum):t instanceof Ie?wt(t._def.innerType):t instanceof br?[void 0]:t instanceof _r?[null]:t instanceof Ee?[void 0,...wt(t.unwrap())]:t instanceof Ge?[null,...wt(t.unwrap())]:t instanceof Ke||t instanceof lt?wt(t.unwrap()):t instanceof Be?wt(t._def.innerType):[],"getDiscriminator"),It=F(class extends ie{_parse(t){let{ctx:d}=this._processInputParams(t);if(d.parsedType!==O.object)return L(d,{code:j.invalid_type,expected:O.object,received:d.parsedType}),G;let p=this.discriminator,x=d.data[p],_=this.optionsMap.get(x);return _?d.common.async?_._parseAsync({data:d.data,path:d.path,parent:d}):_._parseSync({data:d.data,path:d.path,parent:d}):(L(d,{code:j.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[p]}),G)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,d,p){let x=new Map;for(let _ of d){let k=wt(_.shape[t]);if(!k.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let T of k){if(x.has(T))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(T)}`);x.set(T,_)}}return new It({typeName:J.ZodDiscriminatedUnion,discriminator:t,options:d,optionsMap:x,...Y(p)})}},"ZodDiscriminatedUnion");y(It,"ZodDiscriminatedUnion");function Nt(t,d){let p=oe(t),x=oe(d);if(t===d)return{valid:!0,data:t};if(p===O.object&&x===O.object){let _=P.objectKeys(d),k=P.objectKeys(t).filter(D=>_.indexOf(D)!==-1),T={...t,...d};for(let D of k){let A=Nt(t[D],d[D]);if(!A.valid)return{valid:!1};T[D]=A.data}return{valid:!0,data:T}}else if(p===O.array&&x===O.array){if(t.length!==d.length)return{valid:!1};let _=[];for(let k=0;k<t.length;k++){let T=t[k],D=d[k],A=Nt(T,D);if(!A.valid)return{valid:!1};_.push(A.data)}return{valid:!0,data:_}}else return p===O.date&&x===O.date&&+t==+d?{valid:!0,data:t}:{valid:!1}}b(Nt,"mergeValues"),F(Nt,"mergeValues"),y(Nt,"mergeValues");var vt=F(class extends ie{_parse(t){let{status:d,ctx:p}=this._processInputParams(t),x=y((_,k)=>{if(ma(_)||ma(k))return G;let T=Nt(_.value,k.value);return T.valid?((ga(_)||ga(k))&&d.dirty(),{status:d.value,value:T.data}):(L(p,{code:j.invalid_intersection_types}),G)},"handleParsed");return p.common.async?Promise.all([this._def.left._parseAsync({data:p.data,path:p.path,parent:p}),this._def.right._parseAsync({data:p.data,path:p.path,parent:p})]).then(([_,k])=>x(_,k)):x(this._def.left._parseSync({data:p.data,path:p.path,parent:p}),this._def.right._parseSync({data:p.data,path:p.path,parent:p}))}},"ZodIntersection");y(vt,"ZodIntersection"),vt.create=(t,d,p)=>new vt({left:t,right:d,typeName:J.ZodIntersection,...Y(p)});var ze=F(class extends ie{_parse(t){let{status:d,ctx:p}=this._processInputParams(t);if(p.parsedType!==O.array)return L(p,{code:j.invalid_type,expected:O.array,received:p.parsedType}),G;if(p.data.length<this._def.items.length)return L(p,{code:j.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),G;!this._def.rest&&p.data.length>this._def.items.length&&(L(p,{code:j.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),d.dirty());let _=[...p.data].map((k,T)=>{let D=this._def.items[T]||this._def.rest;return D?D._parse(new it(p,k,p.path,T)):null}).filter(k=>!!k);return p.common.async?Promise.all(_).then(k=>be.mergeArray(d,k)):be.mergeArray(d,_)}get items(){return this._def.items}rest(t){return new ze({...this._def,rest:t})}},"ZodTuple");y(ze,"ZodTuple"),ze.create=(t,d)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ze({items:t,typeName:J.ZodTuple,rest:null,...Y(d)})};var Me=F(class extends ie{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:d,ctx:p}=this._processInputParams(t);if(p.parsedType!==O.object)return L(p,{code:j.invalid_type,expected:O.object,received:p.parsedType}),G;let x=[],_=this._def.keyType,k=this._def.valueType;for(let T in p.data)x.push({key:_._parse(new it(p,T,p.path,T)),value:k._parse(new it(p,p.data[T],p.path,T)),alwaysSet:T in p.data});return p.common.async?be.mergeObjectAsync(d,x):be.mergeObjectSync(d,x)}get element(){return this._def.valueType}static create(t,d,p){return d instanceof ie?new Me({keyType:t,valueType:d,typeName:J.ZodRecord,...Y(p)}):new Me({keyType:Ce.create(),valueType:t,typeName:J.ZodRecord,...Y(d)})}},"ZodRecord");y(Me,"ZodRecord");var Dt=F(class extends ie{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:d,ctx:p}=this._processInputParams(t);if(p.parsedType!==O.map)return L(p,{code:j.invalid_type,expected:O.map,received:p.parsedType}),G;let x=this._def.keyType,_=this._def.valueType,k=[...p.data.entries()].map(([T,D],A)=>({key:x._parse(new it(p,T,p.path,[A,"key"])),value:_._parse(new it(p,D,p.path,[A,"value"]))}));if(p.common.async){let T=new Map;return Promise.resolve().then(async()=>{for(let D of k){let A=await D.key,te=await D.value;if(A.status==="aborted"||te.status==="aborted")return G;(A.status==="dirty"||te.status==="dirty")&&d.dirty(),T.set(A.value,te.value)}return{status:d.value,value:T}})}else{let T=new Map;for(let D of k){let A=D.key,te=D.value;if(A.status==="aborted"||te.status==="aborted")return G;(A.status==="dirty"||te.status==="dirty")&&d.dirty(),T.set(A.value,te.value)}return{status:d.value,value:T}}}},"ZodMap");y(Dt,"ZodMap"),Dt.create=(t,d,p)=>new Dt({valueType:d,keyType:t,typeName:J.ZodMap,...Y(p)});var Ue=F(class extends ie{_parse(t){let{status:d,ctx:p}=this._processInputParams(t);if(p.parsedType!==O.set)return L(p,{code:j.invalid_type,expected:O.set,received:p.parsedType}),G;let x=this._def;x.minSize!==null&&p.data.size<x.minSize.value&&(L(p,{code:j.too_small,minimum:x.minSize.value,type:"set",inclusive:!0,exact:!1,message:x.minSize.message}),d.dirty()),x.maxSize!==null&&p.data.size>x.maxSize.value&&(L(p,{code:j.too_big,maximum:x.maxSize.value,type:"set",inclusive:!0,exact:!1,message:x.maxSize.message}),d.dirty());let _=this._def.valueType;function k(D){let A=new Set;for(let te of D){if(te.status==="aborted")return G;te.status==="dirty"&&d.dirty(),A.add(te.value)}return{status:d.value,value:A}}b(k,"finalizeSet"),F(k,"finalizeSet"),y(k,"finalizeSet");let T=[...p.data.values()].map((D,A)=>_._parse(new it(p,D,p.path,A)));return p.common.async?Promise.all(T).then(D=>k(D)):k(T)}min(t,d){return new Ue({...this._def,minSize:{value:t,message:V.toString(d)}})}max(t,d){return new Ue({...this._def,maxSize:{value:t,message:V.toString(d)}})}size(t,d){return this.min(t,d).max(t,d)}nonempty(t){return this.min(1,t)}},"ZodSet");y(Ue,"ZodSet"),Ue.create=(t,d)=>new Ue({valueType:t,minSize:null,maxSize:null,typeName:J.ZodSet,...Y(d)});var $e=F(class extends ie{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:d}=this._processInputParams(t);if(d.parsedType!==O.function)return L(d,{code:j.invalid_type,expected:O.function,received:d.parsedType}),G;function p(T,D){return de({data:T,path:d.path,errorMaps:[d.common.contextualErrorMap,d.schemaErrorMap,pr(),Pt].filter(A=>!!A),issueData:{code:j.invalid_arguments,argumentsError:D}})}b(p,"makeArgsIssue"),F(p,"makeArgsIssue"),y(p,"makeArgsIssue");function x(T,D){return de({data:T,path:d.path,errorMaps:[d.common.contextualErrorMap,d.schemaErrorMap,pr(),Pt].filter(A=>!!A),issueData:{code:j.invalid_return_type,returnTypeError:D}})}b(x,"makeReturnsIssue"),F(x,"makeReturnsIssue"),y(x,"makeReturnsIssue");let _={errorMap:d.common.contextualErrorMap},k=d.data;if(this._def.returns instanceof We){let T=this;return I(async function(...D){let A=new Re([]),te=await T._def.args.parseAsync(D,_).catch(Qa=>{throw A.addIssue(p(D,Qa)),A}),we=await Reflect.apply(k,this,te);return await T._def.returns._def.type.parseAsync(we,_).catch(Qa=>{throw A.addIssue(x(we,Qa)),A})})}else{let T=this;return I(function(...D){let A=T._def.args.safeParse(D,_);if(!A.success)throw new Re([p(D,A.error)]);let te=Reflect.apply(k,this,A.data),we=T._def.returns.safeParse(te,_);if(!we.success)throw new Re([x(te,we.error)]);return we.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new $e({...this._def,args:ze.create(t).rest(Vt.create())})}returns(t){return new $e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,d,p){return new $e({args:t||ze.create([]).rest(Vt.create()),returns:d||Vt.create(),typeName:J.ZodFunction,...Y(p)})}},"ZodFunction");y($e,"ZodFunction");var st=F(class extends ie{get schema(){return this._def.getter()}_parse(t){let{ctx:d}=this._processInputParams(t);return this._def.getter()._parse({data:d.data,path:d.path,parent:d})}},"ZodLazy");y(st,"ZodLazy"),st.create=(t,d)=>new st({getter:t,typeName:J.ZodLazy,...Y(d)});var Ye=F(class extends ie{_parse(t){if(t.data!==this._def.value){let d=this._getOrReturnCtx(t);return L(d,{received:d.data,code:j.invalid_literal,expected:this._def.value}),G}return{status:"valid",value:t.data}}get value(){return this._def.value}},"ZodLiteral");y(Ye,"ZodLiteral"),Ye.create=(t,d)=>new Ye({value:t,typeName:J.ZodLiteral,...Y(d)});function Mt(t,d){return new Fe({values:t,typeName:J.ZodEnum,...Y(d)})}b(Mt,"createZodEnum"),F(Mt,"createZodEnum"),y(Mt,"createZodEnum");var Fe=F(class extends ie{constructor(){super(...arguments),Qe.set(this,void 0)}_parse(t){if(typeof t.data!="string"){let d=this._getOrReturnCtx(t),p=this._def.values;return L(d,{expected:P.joinValues(p),received:d.parsedType,code:j.invalid_type}),G}if(le(this,Qe,"f")||mr(this,Qe,new Set(this._def.values),"f"),!le(this,Qe,"f").has(t.data)){let d=this._getOrReturnCtx(t),p=this._def.values;return L(d,{received:d.data,code:j.invalid_enum_value,options:p}),G}return I(t.data)}get options(){return this._def.values}get enum(){let t={};for(let d of this._def.values)t[d]=d;return t}get Values(){let t={};for(let d of this._def.values)t[d]=d;return t}get Enum(){let t={};for(let d of this._def.values)t[d]=d;return t}extract(t,d=this._def){return Fe.create(t,{...this._def,...d})}exclude(t,d=this._def){return Fe.create(this.options.filter(p=>!t.includes(p)),{...this._def,...d})}},"ZodEnum");y(Fe,"ZodEnum"),Qe=new WeakMap,Fe.create=Mt;var ct=F(class extends ie{constructor(){super(...arguments),Z.set(this,void 0)}_parse(t){let d=P.getValidEnumValues(this._def.values),p=this._getOrReturnCtx(t);if(p.parsedType!==O.string&&p.parsedType!==O.number){let x=P.objectValues(d);return L(p,{expected:P.joinValues(x),received:p.parsedType,code:j.invalid_type}),G}if(le(this,Z,"f")||mr(this,Z,new Set(P.getValidEnumValues(this._def.values)),"f"),!le(this,Z,"f").has(t.data)){let x=P.objectValues(d);return L(p,{received:p.data,code:j.invalid_enum_value,options:x}),G}return I(t.data)}get enum(){return this._def.values}},"ZodNativeEnum");y(ct,"ZodNativeEnum"),Z=new WeakMap,ct.create=(t,d)=>new ct({values:t,typeName:J.ZodNativeEnum,...Y(d)});var We=F(class extends ie{unwrap(){return this._def.type}_parse(t){let{ctx:d}=this._processInputParams(t);if(d.parsedType!==O.promise&&d.common.async===!1)return L(d,{code:j.invalid_type,expected:O.promise,received:d.parsedType}),G;let p=d.parsedType===O.promise?d.data:Promise.resolve(d.data);return I(p.then(x=>this._def.type.parseAsync(x,{path:d.path,errorMap:d.common.contextualErrorMap})))}},"ZodPromise");y(We,"ZodPromise"),We.create=(t,d)=>new We({type:t,typeName:J.ZodPromise,...Y(d)});var Se=F(class extends ie{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===J.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:d,ctx:p}=this._processInputParams(t),x=this._def.effect||null,_={addIssue:k=>{L(p,k),k.fatal?d.abort():d.dirty()},get path(){return p.path}};if(_.addIssue=_.addIssue.bind(_),x.type==="preprocess"){let k=x.transform(p.data,_);if(p.common.async)return Promise.resolve(k).then(async T=>{if(d.value==="aborted")return G;let D=await this._def.schema._parseAsync({data:T,path:p.path,parent:p});return D.status==="aborted"?G:D.status==="dirty"||d.value==="dirty"?fr(D.value):D});{if(d.value==="aborted")return G;let T=this._def.schema._parseSync({data:k,path:p.path,parent:p});return T.status==="aborted"?G:T.status==="dirty"||d.value==="dirty"?fr(T.value):T}}if(x.type==="refinement"){let k=y(T=>{let D=x.refinement(T,_);if(p.common.async)return Promise.resolve(D);if(D instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return T},"executeRefinement");if(p.common.async===!1){let T=this._def.schema._parseSync({data:p.data,path:p.path,parent:p});return T.status==="aborted"?G:(T.status==="dirty"&&d.dirty(),k(T.value),{status:d.value,value:T.value})}else return this._def.schema._parseAsync({data:p.data,path:p.path,parent:p}).then(T=>T.status==="aborted"?G:(T.status==="dirty"&&d.dirty(),k(T.value).then(()=>({status:d.value,value:T.value}))))}if(x.type==="transform")if(p.common.async===!1){let k=this._def.schema._parseSync({data:p.data,path:p.path,parent:p});if(!rn(k))return k;let T=x.transform(k.value,_);if(T instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:d.value,value:T}}else return this._def.schema._parseAsync({data:p.data,path:p.path,parent:p}).then(k=>rn(k)?Promise.resolve(x.transform(k.value,_)).then(T=>({status:d.value,value:T})):k);P.assertNever(x)}},"ZodEffects");y(Se,"ZodEffects"),Se.create=(t,d,p)=>new Se({schema:t,typeName:J.ZodEffects,effect:d,...Y(p)}),Se.createWithPreprocess=(t,d,p)=>new Se({schema:d,effect:{type:"preprocess",transform:t},typeName:J.ZodEffects,...Y(p)});var Ee=F(class extends ie{_parse(t){return this._getType(t)===O.undefined?I(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}},"ZodOptional");y(Ee,"ZodOptional"),Ee.create=(t,d)=>new Ee({innerType:t,typeName:J.ZodOptional,...Y(d)});var Ge=F(class extends ie{_parse(t){return this._getType(t)===O.null?I(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}},"ZodNullable");y(Ge,"ZodNullable"),Ge.create=(t,d)=>new Ge({innerType:t,typeName:J.ZodNullable,...Y(d)});var Ie=F(class extends ie{_parse(t){let{ctx:d}=this._processInputParams(t),p=d.data;return d.parsedType===O.undefined&&(p=this._def.defaultValue()),this._def.innerType._parse({data:p,path:d.path,parent:d})}removeDefault(){return this._def.innerType}},"ZodDefault");y(Ie,"ZodDefault"),Ie.create=(t,d)=>new Ie({innerType:t,typeName:J.ZodDefault,defaultValue:typeof d.default=="function"?d.default:()=>d.default,...Y(d)});var Be=F(class extends ie{_parse(t){let{ctx:d}=this._processInputParams(t),p={...d,common:{...d.common,issues:[]}},x=this._def.innerType._parse({data:p.data,path:p.path,parent:{...p}});return hr(x)?x.then(_=>({status:"valid",value:_.status==="valid"?_.value:this._def.catchValue({get error(){return new Re(p.common.issues)},input:p.data})})):{status:"valid",value:x.status==="valid"?x.value:this._def.catchValue({get error(){return new Re(p.common.issues)},input:p.data})}}removeCatch(){return this._def.innerType}},"ZodCatch");y(Be,"ZodCatch"),Be.create=(t,d)=>new Be({innerType:t,typeName:J.ZodCatch,catchValue:typeof d.catch=="function"?d.catch:()=>d.catch,...Y(d)});var ge=F(class extends ie{_parse(t){if(this._getType(t)!==O.nan){let p=this._getOrReturnCtx(t);return L(p,{code:j.invalid_type,expected:O.nan,received:p.parsedType}),G}return{status:"valid",value:t.data}}},"ZodNaN");y(ge,"ZodNaN"),ge.create=t=>new ge({typeName:J.ZodNaN,...Y(t)});var wr=Symbol("zod_brand"),Ke=F(class extends ie{_parse(t){let{ctx:d}=this._processInputParams(t),p=d.data;return this._def.type._parse({data:p,path:d.path,parent:d})}unwrap(){return this._def.type}},"ZodBranded");y(Ke,"ZodBranded");var Lt=F(class extends ie{_parse(t){let{status:d,ctx:p}=this._processInputParams(t);if(p.common.async)return y(async()=>{let _=await this._def.in._parseAsync({data:p.data,path:p.path,parent:p});return _.status==="aborted"?G:_.status==="dirty"?(d.dirty(),fr(_.value)):this._def.out._parseAsync({data:_.value,path:p.path,parent:p})},"handleAsync")();{let x=this._def.in._parseSync({data:p.data,path:p.path,parent:p});return x.status==="aborted"?G:x.status==="dirty"?(d.dirty(),{status:"dirty",value:x.value}):this._def.out._parseSync({data:x.value,path:p.path,parent:p})}}static create(t,d){return new Lt({in:t,out:d,typeName:J.ZodPipeline})}},"ZodPipeline");y(Lt,"ZodPipeline");var lt=F(class extends ie{_parse(t){let d=this._def.innerType._parse(t),p=y(x=>(rn(x)&&(x.value=Object.freeze(x.value)),x),"freeze");return hr(d)?d.then(x=>p(x)):p(d)}unwrap(){return this._def.innerType}},"ZodReadonly");y(lt,"ZodReadonly"),lt.create=(t,d)=>new lt({innerType:t,typeName:J.ZodReadonly,...Y(d)});function Ct(t,d={},p){return t?Qt.create().superRefine((x,_)=>{var k,T;if(!t(x)){let D=typeof d=="function"?d(x):typeof d=="string"?{message:d}:d,A=(T=(k=D.fatal)!==null&&k!==void 0?k:p)!==null&&T!==void 0?T:!0,te=typeof D=="string"?{message:D}:D;_.addIssue({code:"custom",...te,fatal:A})}}):Qt.create()}b(Ct,"custom"),F(Ct,"custom"),y(Ct,"custom");var bt={object:_e.lazycreate},J;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(J||(J={}));var on=y((t,d={message:`Input not instance of ${t.name}`})=>Ct(p=>p instanceof t,d),"instanceOfType"),Zt=Ce.create,Xt=Q.create,Cr=ge.create,xr=ee.create,Er=vr.create,Ut=Jt.create,Tr=an.create,er=br.create,Xe=_r.create,dt=Qt.create,xt=Vt.create,kr=yt.create,Sr=Yt.create,sn=ot.create,Co=_e.create,Bn=_e.strictCreate,cn=Kt.create,Rr=It.create,ln=vt.create,xo=ze.create,K=Me.create,Eo=Dt.create,ci=Ue.create,li=$e.create,To=st.create,ko=Ye.create,di=Fe.create,So=ct.create,Ro=We.create,ui=Se.create,Po=Ee.create,Oo=Ge.create,jo=Se.createWithPreprocess,Vo=Lt.create,Ao=y(()=>Zt().optional(),"ostring"),Io=y(()=>Xt().optional(),"onumber"),No=y(()=>Er().optional(),"oboolean"),Do={string:t=>Ce.create({...t,coerce:!0}),number:t=>Q.create({...t,coerce:!0}),boolean:t=>vr.create({...t,coerce:!0}),bigint:t=>ee.create({...t,coerce:!0}),date:t=>Jt.create({...t,coerce:!0})},Mo=G,o=Object.freeze({__proto__:null,defaultErrorMap:Pt,setErrorMap:ha,getErrorMap:pr,makeIssue:de,EMPTY_PATH:ye,addIssueToContext:L,ParseStatus:be,INVALID:G,DIRTY:fr,OK:I,isAborted:ma,isDirty:ga,isValid:rn,isAsync:hr,get util(){return P},get objectUtil(){return z},ZodParsedType:O,getParsedType:oe,ZodType:ie,datetimeRegex:jt,ZodString:Ce,ZodNumber:Q,ZodBigInt:ee,ZodBoolean:vr,ZodDate:Jt,ZodSymbol:an,ZodUndefined:br,ZodNull:_r,ZodAny:Qt,ZodUnknown:Vt,ZodNever:yt,ZodVoid:Yt,ZodArray:ot,ZodObject:_e,ZodUnion:Kt,ZodDiscriminatedUnion:It,ZodIntersection:vt,ZodTuple:ze,ZodRecord:Me,ZodMap:Dt,ZodSet:Ue,ZodFunction:$e,ZodLazy:st,ZodLiteral:Ye,ZodEnum:Fe,ZodNativeEnum:ct,ZodPromise:We,ZodEffects:Se,ZodTransformer:Se,ZodOptional:Ee,ZodNullable:Ge,ZodDefault:Ie,ZodCatch:Be,ZodNaN:ge,BRAND:wr,ZodBranded:Ke,ZodPipeline:Lt,ZodReadonly:lt,custom:Ct,Schema:ie,ZodSchema:ie,late:bt,get ZodFirstPartyTypeKind(){return J},coerce:Do,any:dt,array:sn,bigint:xr,boolean:Er,date:Ut,discriminatedUnion:Rr,effect:ui,enum:di,function:li,instanceof:on,intersection:ln,lazy:To,literal:ko,map:Eo,nan:Cr,nativeEnum:So,never:kr,null:Xe,nullable:Oo,number:Xt,object:Co,oboolean:No,onumber:Io,optional:Po,ostring:Ao,pipeline:Vo,preprocess:jo,promise:Ro,record:K,set:ci,strictObject:Bn,string:Zt,symbol:Tr,transformer:ui,tuple:xo,undefined:er,union:cn,unknown:xt,void:Sr,NEVER:Mo,ZodIssueCode:j,quotelessJson:ke,ZodError:Re}),dn=Symbol("current"),Pr=Symbol("previous"),un=y((t,{ref:d,refType:p,param:x,header:_,...k}={})=>({...k,...t}),"mergeOpenApi");function ba(t){if(typeof t.ZodType.prototype.openapi<"u")return;t.ZodType.prototype.openapi=function(k){let{zodOpenApi:T,...D}=this._def,A=new this.constructor({...D,zodOpenApi:{openapi:un(k,T?.openapi)}});return A._def.zodOpenApi[dn]=A,T&&(A._def.zodOpenApi[Pr]=this),A};let d=t.ZodType.prototype.describe;t.ZodType.prototype.describe=function(...k){let T=d.apply(this,k),D=T._def;if(D.zodOpenApi){let A={...D.zodOpenApi};A.openapi=un({description:k[0]},A.openapi),A[Pr]=this,A[dn]=T,D.zodOpenApi=A}else D.zodOpenApi={openapi:{description:k[0]},[dn]:T};return T};let p=t.ZodObject.prototype.extend;t.ZodObject.prototype.extend=function(...k){let T=p.apply(this,k),D=T._def.zodOpenApi;if(D){let A={...D};A.openapi=un({},A.openapi),A[Pr]=this,T._def.zodOpenApi=A}else T._def.zodOpenApi={[Pr]:this};return T};let x=t.ZodObject.prototype.omit;t.ZodObject.prototype.omit=function(...k){let T=x.apply(this,k),D=T._def.zodOpenApi;if(D){let A={...D};A.openapi=un({},A.openapi),delete A[Pr],delete A[dn],T._def.zodOpenApi=A}return T};let _=t.ZodObject.prototype.pick;t.ZodObject.prototype.pick=function(...k){let T=_.apply(this,k),D=T._def.zodOpenApi;if(D){let A={...D};A.openapi=un({},A.openapi),delete A[Pr],delete A[dn],T._def.zodOpenApi=A}return T}}b(ba,"extendZodWithOpenApi"),F(ba,"extendZodWithOpenApi"),y(ba,"extendZodWithOpenApi"),ba(o);var pn=o.array(o.string().or(o.record(o.any()))),Lo=o.object({type:o.string().optional(),narrative:o.string().optional()}),fn=o.string().or(o.object({id:o.string(),type:o.string(),caption:o.string().optional()})),pi=o.object({type:o.string().min(1).or(o.string().array().nonempty()),latitude:o.number(),longitude:o.number()}),fi=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:pi.optional()}),hi=o.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(o.string()),_a=o.object({type:o.string().min(1).or(o.string().array().nonempty()),identifier:o.string(),identifierType:hi}),tr=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:fn.optional(),email:o.string().email().optional(),address:fi.optional(),otherIdentifier:_a.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())),qn=o.object({id:o.string().optional()}).catchall(o.any()),hn=o.object({type:o.string(),id:o.string()}).catchall(o.any()),wa=o.object({id:o.string(),type:o.string()}).catchall(o.any()),Ca=o.object({id:o.string().optional(),type:o.string()}).catchall(o.any()),xa=o.object({type:o.string(),id:o.string().optional()}).catchall(o.any()),Ea=o.object({type:o.string().or(o.string().array().nonempty()),id:o.string().optional()}).catchall(o.any()),Or=o.object({"@context":pn,id:o.string().optional(),type:o.string().array().nonempty(),issuer:tr,credentialSubject:qn.or(qn.array()),refreshService:Ca.or(Ca.array()).optional(),credentialSchema:wa.or(wa.array()).optional(),issuanceDate:o.string().optional(),expirationDate:o.string().optional(),credentialStatus:hn.or(hn.array()).optional(),name:o.string().optional(),description:o.string().optional(),validFrom:o.string().optional(),validUntil:o.string().optional(),status:hn.or(hn.array()).optional(),termsOfUse:xa.or(xa.array()).optional(),evidence:Ea.or(Ea.array()).optional()}).catchall(o.any()),ut=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()),zn=Or.extend({proof:ut.or(ut.array())}),i=o.object({"@context":pn,id:o.string().optional(),type:o.string().or(o.string().array().nonempty()),verifiableCredential:zn.or(zn.array()).optional(),holder:o.string().optional()}).catchall(o.any()),jr=i.extend({proof:ut.or(ut.array())}),Et=o.object({kty:o.string(),crv:o.string(),x:o.string(),y:o.string().optional(),n:o.string().optional(),d:o.string().optional()}),mn=Et.omit({d:!0}).extend({d:o.string()}),gn=o.object({alg:o.string(),iv:o.string(),tag:o.string(),epk:Et.partial().optional(),kid:o.string().optional(),apv:o.string().optional(),apu:o.string().optional()}),Vr=o.object({header:gn,encrypted_key:o.string()}),mi=o.object({protected:o.string(),iv:o.string(),ciphertext:o.string(),tag:o.string(),aad:o.string().optional(),recipients:Vr.array().optional()}),et=o.string().or(o.object({"@context":pn.optional(),id:o.string(),type:o.string(),controller:o.string(),publicKeyJwk:Et.optional(),publicKeyBase58:o.string().optional(),publicKeyMultibase:o.string().optional(),blockChainAccountId:o.string().optional()}).catchall(o.any())),Ta=o.object({id:o.string(),type:o.string().or(o.string().array().nonempty()),serviceEndpoint:o.any().or(o.any().array().nonempty())}).catchall(o.any()),gi=o.object({"@context":pn,id:o.string(),alsoKnownAs:o.string().optional(),controller:o.string().or(o.string().array().nonempty()).optional(),verificationMethod:et.array().optional(),authentication:et.array().optional(),assertionMethod:et.array().optional(),keyAgreement:et.array().optional(),capabilityInvocation:et.array().optional(),capabilityDelegation:et.array().optional(),publicKey:et.array().optional(),service:Ta.array().optional(),proof:ut.or(ut.array()).optional()}).catchall(o.any()),ka=o.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(o.string()),rr=o.object({type:o.string().array().nonempty(),targetCode:o.string().optional(),targetDescription:o.string().optional(),targetName:o.string(),targetFramework:o.string().optional(),targetType:ka.optional(),targetUrl:o.string()}),nr=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"]),yn=nr.or(o.string()),Ar=o.object({id:o.string().optional(),narrative:o.string().optional()}).catchall(o.any()),$n=o.object({id:o.string(),type:o.string().array().nonempty(),endorsementComment:o.string().optional()}),Fn=Or.extend({credentialSubject:$n,proof:ut.or(ut.array()).optional()}),Wn=o.object({id:o.string(),"@language":o.string().optional(),version:o.string().optional()}),Gn=o.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(o.string()),ar=o.object({id:o.string(),type:o.string().array().nonempty(),alignment:rr.array().optional(),description:o.string().optional(),level:o.string().optional(),name:o.string(),points:o.string().optional()}).catchall(o.any()),tt=o.object({id:o.string(),type:o.string().array().nonempty(),alignment:rr.array().optional(),allowedValue:o.string().array().optional(),name:o.string(),requiredLevel:o.string().optional(),requiredValue:o.string().optional(),resultType:Gn,rubricCriterionLevel:ar.array().optional(),valueMax:o.string().optional(),valueMin:o.string().optional()}).catchall(o.any()),vn=o.object({id:o.string().optional(),type:o.string().array().nonempty(),alignment:rr.array().optional(),achievementType:yn.optional(),creator:tr.optional(),creditsAvailable:o.number().optional(),criteria:Ar,description:o.string(),endorsement:Fn.array().optional(),fieldOfStudy:o.string().optional(),humanCode:o.string().optional(),image:fn.optional(),"@language":o.string().optional(),name:o.string(),otherIdentifier:_a.array().optional(),related:Wn.array().optional(),resultDescription:tt.array().optional(),specialization:o.string().optional(),tag:o.string().array().optional(),version:o.string().optional()}).catchall(o.any()),Sa=o.object({type:o.string(),hashed:o.boolean(),identityHash:o.string(),identityType:o.string(),salt:o.string().optional()}),Ra=o.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),bn=o.object({type:o.string().array().nonempty(),achievedLevel:o.string().optional(),alignment:rr.array().optional(),resultDescription:o.string().optional(),status:Ra.optional(),value:o.string().optional()}).catchall(o.any()),Pa=o.object({id:o.string().optional(),type:o.string().array().nonempty(),activityEndDate:o.string().optional(),activityStartDate:o.string().optional(),creditsEarned:o.number().optional(),achievement:vn.optional(),identifier:Sa.array().optional(),image:fn.optional(),licenseNumber:o.string().optional(),narrative:o.string().optional(),result:bn.array().optional(),role:o.string().optional(),source:tr.optional(),term:o.string().optional()}).catchall(o.any()),Oa=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()),ja=Or.extend({name:o.string().optional(),description:o.string().optional(),image:fn.optional(),credentialSubject:Pa.or(Pa.array()),endorsement:Or.array().optional(),evidence:Oa.array().optional()}),yi=ja.extend({proof:ut.or(ut.array())}),Bt=o.object({checks:o.string().array(),warnings:o.string().array(),errors:o.string().array()}),Hn=o.enum(["Success","Failed","Error"]),Zo=Hn.enum,vi=o.object({check:o.string(),status:Hn,message:o.string().optional(),details:o.string().optional()}),_n=o.object({title:o.string().optional(),createdAt:o.string().optional(),issuer:tr.optional(),issuee:tr.optional(),credentialSubject:qn.optional()}),bi=o.object({id:o.string(),uri:o.string()}).catchall(o.any()),_i=o.object({limit:o.number(),cursor:o.string().optional(),sort:o.string().optional()}),Oe=o.object({cursor:o.string().optional(),hasMore:o.boolean()}),Jn=o.object({encryptedRecord:mi,fields:o.string().array()}).catchall(o.any()),wi=Oe.extend({records:Jn.array()}),Va=Jn.extend({id:o.string()}),Ci=Oe.extend({records:Va.array()}),Aa=y(t=>{let d=t.match(/^\/(.*)\/([gimsuy]*)$/);if(!d)throw new Error("Invalid RegExp string format");return{pattern:d[1],flags:d[2]}},"parseRegexString"),Ia=o.instanceof(RegExp).or(o.string().refine(t=>{try{return Aa(t),!0}catch{return!1}},{message:"Invalid RegExp string format. Must be in format '/pattern/flags'"}).transform(t=>{let{pattern:d,flags:p}=Aa(t);try{return new RegExp(d,p)}catch(x){throw new Error(`Invalid RegExp: ${x.message}`)}})),pe=o.string().or(o.object({$in:o.string().array()})).or(o.object({$regex:Ia})),Na=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()}),pt=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:Na.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.")}),xi=o.object({profileId:pe,displayName:pe,shortBio:pe,bio:pe,email:pe,websiteLink:pe,isServiceProfile:o.boolean(),type:pe}).partial(),Da=Oe.extend({records:pt.array()}),Ei=o.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),Qn=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()}),Uo=Oe.extend({records:Qn.extend({did:o.string()}).array()}),Bo=o.object({id:pe,displayName:pe,shortBio:pe,bio:pe,email:pe}).partial(),Ma=Oe.extend({records:o.object({profile:pt,manager:Qn.extend({did:o.string()}).optional()}).array()}),qo=o.object({uri:o.string(),to:o.string(),from:o.string(),sent:o.string().datetime(),received:o.string().datetime().optional()}),La=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()}),Ti=o.object({role:pe,canEdit:o.boolean(),canIssue:o.boolean(),canRevoke:o.boolean(),canManagePermissions:o.boolean(),canIssueChildren:pe,canCreateChildren:pe,canEditChildren:pe,canRevokeChildren:pe,canManageChildrenPermissions:pe,canManageChildrenProfiles:o.boolean(),canViewAnalytics:o.boolean()}).partial(),Yn=o.enum(["GRANT_PERMISSIONS","ADD_ADMIN","AUTO_CONNECT"]),ki=o.discriminatedUnion("type",[o.object({type:o.literal(Yn.Values.GRANT_PERMISSIONS),data:o.object({claimUri:o.string(),targetUri:o.string(),permissions:La.partial()})}),o.object({type:o.literal(Yn.Values.ADD_ADMIN),data:o.object({claimUri:o.string(),targetUri:o.string()})}),o.object({type:o.literal(Yn.Values.AUTO_CONNECT),data:o.object({claimUri:o.string(),targetUri:o.string()})})]),Ne=o.object({type:pe,data:o.object({claimUri:pe,targetUri:pe,permissions:Ti})}).deepPartial(),Kn=o.object({id:o.string(),createdAt:o.string(),updatedAt:o.string()}).and(ki),zo=Oe.extend({records:Kn.array()}),wn=o.enum(["DRAFT","LIVE"]),Si=o.object({uri:o.string(),name:o.string().optional(),type:o.string().optional(),category:o.string().optional(),status:wn.optional(),autoConnectRecipients:o.boolean().optional(),meta:o.record(o.any()).optional(),claimPermissions:La.optional(),allowAnyoneToCreateChildren:o.boolean().optional()}),Ri=o.object({uri:pe,name:pe,type:pe,category:pe,meta:o.record(pe),status:wn.or(o.object({$in:wn.array()})),autoConnectRecipients:o.boolean()}).partial(),Pi=Oe.extend({records:Si.array()}),fe=o.object({to:pt,from:o.string(),received:o.string().optional(),uri:o.string().optional()}),Oi=Oe.extend({records:fe.array()}),ft=o.object({to:pt,from:o.string(),received:o.string().optional(),boostUris:o.array(o.string()),credentialUris:o.array(o.string()).optional()}),$o=Oe.extend({records:ft.array()}),Fo=o.object({endpoint:o.string(),name:o.string(),did:o.string().optional()}),Wo=o.object({ttlSeconds:o.number().optional(),totalUses:o.number().optional()}),Xn=o.object({endpoint:o.string()}),Go=o.object({signingAuthority:Xn,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()})}),Ho=o.object({boostUri:o.string(),signingAuthority:o.object({endpoint:o.string(),name:o.string()})}),ji=o.enum(["live","stale","withdrawn"]),Vi=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({})}),Cn=o.object({contract:Vi,owner:pt,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(pt).optional()}),Ai=Oe.extend({records:Cn.omit({owner:!0}).array()}),xn=o.object({credentials:o.object({categories:o.record(o.string().array()).default({})}),personal:o.record(o.string()).default({}),date:o.string()}),Ii=Oe.extend({records:xn.array()}),Ni=o.object({credentials:o.object({category:o.string(),uri:o.string()}).array(),personal:o.record(o.string()).default({}),date:o.string(),contractUri:o.string()}),Di=Oe.extend({records:Ni.array()}),Za=o.object({sharing:o.boolean().optional(),shared:o.string().array().optional(),shareAll:o.boolean().optional(),shareUntil:o.string().optional()}),Ir=o.object({read:o.object({anonymize:o.boolean().optional(),credentials:o.object({shareAll:o.boolean().optional(),sharing:o.boolean().optional(),categories:o.record(Za).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()}),Mi=Oe.extend({records:o.object({expiresAt:o.string().optional(),oneTime:o.boolean().optional(),terms:Ir,contract:Cn,uri:o.string(),consenter:pt,status:ji}).array()}),Jo=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()}),Qo=o.object({anonymize:o.boolean().optional(),credentials:o.object({categories:o.record(o.boolean()).optional()}).optional(),personal:o.record(o.boolean()).optional()}),Li=o.object({credentials:o.object({categories:o.record(o.boolean()).optional()}).optional(),personal:o.record(o.boolean()).optional(),id:pe.optional()}),Zi=o.object({read:o.object({anonymize:o.boolean().optional(),credentials:o.object({shareAll:o.boolean().optional(),sharing:o.boolean().optional(),categories:o.record(Za.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()}),En=o.enum(["consent","update","sync","withdraw","write"]),Yo=o.object({terms:Zi.optional(),action:En.or(En.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()}),Ua=o.object({expiresAt:o.string().optional(),oneTime:o.boolean().optional(),terms:Ir.optional(),id:o.string(),action:En,date:o.string(),uris:o.string().array().optional()}),Ko=Oe.extend({records:Ua.array()}),Ba=o.object({credentialUri:o.string(),termsUri:o.string(),contractUri:o.string(),boostUri:o.string(),category:o.string().optional(),date:o.string()}),Xo=Oe.extend({records:Ba.array()}),Ui=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"]),qa=o.object({title:o.string().optional(),body:o.string().optional()}),za=o.object({type:o.string(),value:o.string()}),ir=o.enum(["PENDING","DELIVERED","CLAIMED","EXPIRED"]),Bi=o.object({issuanceId:o.string(),status:ir,recipient:o.object({contactMethod:za.optional(),learnCardId:o.string().optional()}),timestamp:o.string().datetime().optional()}),$a=o.object({vcUris:o.array(o.string()).optional(),vpUris:o.array(o.string()).optional(),transaction:Ua.optional(),inbox:Bi.optional()}),es=o.object({type:Ui,to:pt.partial().and(o.object({did:o.string()})),from:pt.partial().and(o.object({did:o.string()})),message:qa.optional(),data:$a.optional(),sent:o.string().datetime().optional(),webhookUrl:o.string().optional()}),Fa="auth-grant:",ts=o.object({id:o.string(),name:o.string(),description:o.string().optional(),challenge:o.string().startsWith(Fa).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()}),Wa=o.object({id:o.string()}).catchall(o.any()),ea=o.enum(["active","revoked"]),rs=o.object({id:pe,name:pe,description:pe,status:ea}).partial(),qi=o.object({id:o.string(),isVerified:o.boolean(),verifiedAt:o.string().optional(),isPrimary:o.boolean(),createdAt:o.string()}),ns=o.discriminatedUnion("type",[o.object({type:o.literal("email"),value:o.string().email()}).merge(qi),o.object({type:o.literal("phone"),value:o.string()}).merge(qi)]),zi=o.object({isVerified:o.boolean().optional(),isPrimary:o.boolean().optional()}),$i=o.discriminatedUnion("type",[o.object({type:o.literal("email"),value:o.string().email()}).merge(zi),o.object({type:o.literal("phone"),value:o.string()}).merge(zi)]),Nr=o.discriminatedUnion("type",[o.object({type:o.literal("email"),value:o.string().email()}),o.object({type:o.literal("phone"),value:o.string()})]),as=o.object({value:o.string(),type:o.enum(["email","phone"])}),Ga=o.object({token:o.string()}),is=o.object({contactMethodId:o.string()}),Ha=o.object({id:o.string(),credential:o.string(),isSigned:o.boolean(),currentStatus:ir,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()}),os=o.object({hasMore:o.boolean(),records:o.array(Ha),cursor:o.string().optional()}),Fi=o.object({currentStatus:ir,id:o.string(),isSigned:o.boolean(),issuerDid:o.string()}).partial(),Ja=o.object({endpoint:o.string().url(),name:o.string()}),Wi=o.object({recipient:Nr.describe("The recipient of the credential"),credential:zn.passthrough().or(jr.passthrough()).or(Or.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:Ja.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.")}),Tn=o.object({issuanceId:o.string(),status:ir,recipient:Nr,claimUrl:o.string().url().optional(),recipientDid:o.string().optional()}),Gi=o.object({token:o.string(),contactMethodId:o.string(),autoVerifyContactMethod:o.boolean().optional().default(!1),createdAt:o.string(),expiresAt:o.string(),used:o.boolean()})}}),Ip=ll({"../learn-card-types/dist/index.js"(n,e){"use strict";e.exports=Ap()}}),N_=Vp(Ip());var dl=F(n=>!n["@context"]||!Array.isArray(n["@context"])?!1:n["@context"].includes("https://www.w3.org/ns/credentials/v2"),"isVC2Format");async function Np(n,e,s){let l="";try{let f=n?.id;f&&typeof f.did=="function"&&(l=f.did())}catch{n?.debug?.("LCN: no local DID available at init; will fetch from profile")}n?.debug?.("Adding LearnCardNetwork Plugin");let c=s?await jc(e,s):await Oc(e,async f=>{let m=await n.invoke.getDidAuthVp({proofFormat:"jwt",challenge:f});if(typeof m!="string")throw new Error("Error getting DID-Auth-JWT!");return m}),g;n?.debug?.("LCN: initial getProfile query starting",{apiToken:!!s});let y=c.profile.getProfile.query().then(f=>(g=f,g?.did&&(l=g.did),n?.debug?.("LCN: initial getProfile success",{did:l}),f)).catch(f=>{n?.debug?.("LCN: getProfile failed (non-fatal)",f)}),v=b(async()=>{try{await y}catch{}if(!g&&s)try{n?.debug?.("LCN ensureUser: retrying getProfile with apiToken"),g=await c.profile.getProfile.query(),g?.did&&(l=g.did),n?.debug?.("LCN ensureUser: retry success",{did:l})}catch(f){n?.debug?.("LCN ensureUser: retry failed",f)}if(!g)throw new Error("Please make an account first!");return g},"ensureUser");return{name:"LearnCard Network",displayName:"LearnCard Network",description:"LearnCard Network Integration",id:{did:(f,m)=>!m||m==="web"?l:n.id?.did?.(m),keypair:(f,m)=>n.id?.keypair?.(m)},read:{get:async(f,m)=>{if(f.debug?.("learnCard.read['LearnCard Network'].get"),!m)return;let E=m.split(":");if(E.length!==5)return;let[P,z]=E;if(!(P!=="lc"||z!=="network"))try{let O=await c.storage.resolve.query({uri:m});if("ciphertext"in O)try{let oe=f.id.keypair();O=await f.invoke.decryptDagJwe(O,[oe])}catch(oe){f.debug?.("LCN read.get: skipping decryption (no keypair?)",oe);return}return await fa.or(yo).parseAsync(O)}catch(O){f.debug?.(O);return}}},store:{upload:async(f,m)=>(f.debug?.("learnCard.store['LearnCard Network'].upload"),c.storage.store.mutate({item:m})),uploadEncrypted:async(f,m,{recipients:E=[]}={recipients:[]})=>{f.debug?.("learnCard.store['LearnCard Network'].upload"),await v();let z=[l||g?.did||"",...E].filter(Boolean);if(z.length===0)throw new Error("No recipients specified for encrypted upload; provide at least one DID");let O=await f.invoke.createDagJwe(m,z);return c.storage.store.mutate({item:O})}},methods:{createProfile:async(f,m)=>{try{await v()}catch{}if(g)throw new Error("Account already exists!");let E=await c.profile.createProfile.mutate(m);return g=await c.profile.getProfile.query(),l=E,E},createServiceProfile:async(f,m)=>{try{await v()}catch{}let E=await c.profile.createServiceProfile.mutate(m);return g=await c.profile.getProfile.query(),l=E,E},createManagedProfile:async(f,m)=>await c.profileManager.createManagedProfile.mutate(m),createProfileManager:async(f,m)=>(await v(),await c.profileManager.createProfileManager.mutate(m)),createChildProfileManager:async(f,m,E)=>(await v(),await c.profileManager.createChildProfileManager.mutate({parentUri:m,profile:E})),createManagedServiceProfile:async(f,m)=>(await v(),await c.profile.createManagedServiceProfile.mutate(m)),getAvailableProfiles:async(f,m={})=>(await v(),c.profile.getAvailableProfiles.query(m)),getManagedProfiles:async(f,m={})=>c.profileManager.getManagedProfiles.query(m),getManagedServiceProfiles:async(f,m={})=>(await v(),c.profile.getManagedServiceProfiles.query(m)),updateProfile:async(f,m)=>(await v(),await c.profile.updateProfile.mutate(m)?(g=await c.profile.getProfile.query(),!0):!1),updateProfileManagerProfile:async(f,m)=>c.profileManager.updateProfileManager.mutate(m),deleteProfile:async()=>{if(!g)throw new Error("Account does not exist!");return await c.profile.deleteProfile.mutate()?(g=void 0,!0):!1},getProfile:async(f,m)=>{try{await v()}catch{}return m?c.profile.getOtherProfile.query({profileId:m}):g},getProfileManagerProfile:async(f,m)=>m?c.profileManager.getOtherProfileManager.query({id:m}):c.profileManager.getProfileManager.query(),searchProfiles:async(f,m="",{limit:E=25,includeSelf:P=!1,includeConnectionStatus:z=!1,includeServiceProfiles:O=!1}={})=>c.profile.searchProfiles.query({input:m,limit:E,includeSelf:P,includeConnectionStatus:z,includeServiceProfiles:O}),connectWith:async(f,m)=>(await v(),c.profile.connectWith.mutate({profileId:m})),cancelConnectionRequest:async(f,m)=>(await v(),c.profile.cancelConnectionRequest.mutate({profileId:m})),connectWithInvite:async(f,m,E)=>(await v(),c.profile.connectWithInvite.mutate({profileId:m,challenge:E})),disconnectWith:async(f,m)=>(await v(),c.profile.disconnectWith.mutate({profileId:m})),acceptConnectionRequest:async(f,m)=>(await v(),c.profile.acceptConnectionRequest.mutate({profileId:m})),getConnections:async f=>(console.warn("The getConnections method is deprecated! Please use getPaginatedConnections instead!"),await v(),c.profile.connections.query()),getPaginatedConnections:async(f,m)=>(await v(),c.profile.paginatedConnections.query(m)),getPendingConnections:async f=>(console.warn("The getPendingConnections method is deprecated! Please use getPaginatedPendingConnections instead!"),await v(),c.profile.pendingConnections.query()),getPaginatedPendingConnections:async(f,m)=>(await v(),c.profile.paginatedPendingConnections.query(m)),getConnectionRequests:async f=>(console.warn("The getConnectionRequests method is deprecated! Please use getPaginatedConnectionRequests instead!"),await v(),c.profile.connectionRequests.query()),getPaginatedConnectionRequests:async(f,m)=>(await v(),c.profile.paginatedConnectionRequests.query(m)),generateInvite:async(f,m,E,P)=>(await v(),c.profile.generateInvite.mutate({challenge:m,expiration:E,maxUses:P})),listInvites:async()=>(await v(),c.profile.listInvites.query()),invalidateInvite:async(f,m)=>(await v(),c.profile.invalidateInvite.mutate({challenge:m})),blockProfile:async(f,m)=>(await v(),c.profile.blockProfile.mutate({profileId:m})),unblockProfile:async(f,m)=>(await v(),c.profile.unblockProfile.mutate({profileId:m})),getBlockedProfiles:async()=>(await v(),c.profile.blocked.query()),sendCredential:async(f,m,E,P=!0)=>{if(await v(),!P)return c.credential.sendCredential.mutate({profileId:m,credential:E});let z=await f.invoke.getProfile(m);if(!z)throw new Error("Could not find target account");let O=await f.invoke.createDagJwe(E,[f.id.did(),z.did]);return c.credential.sendCredential.mutate({profileId:m,credential:O})},acceptCredential:async(f,m,E)=>(await v(),c.credential.acceptCredential.mutate({uri:m,options:E})),getReceivedCredentials:async(f,m)=>(await v(),c.credential.receivedCredentials.query({from:m})),getSentCredentials:async(f,m)=>(await v(),c.credential.sentCredentials.query({to:m})),getIncomingCredentials:async(f,m)=>(await v(),c.credential.incomingCredentials.query({from:m})),deleteCredential:async(f,m)=>(await v(),c.credential.deleteCredential.mutate({uri:m})),sendPresentation:async(f,m,E,P=!0)=>{if(await v(),!P)return c.presentation.sendPresentation.mutate({profileId:m,presentation:E});let z=await f.invoke.getProfile(m);if(!z)throw new Error("Could not find target account");let O=await f.invoke.createDagJwe(E,[f.id.did(),z.did]);return c.presentation.sendPresentation.mutate({profileId:m,presentation:O})},acceptPresentation:async(f,m)=>(await v(),c.presentation.acceptPresentation.mutate({uri:m})),getReceivedPresentations:async(f,m)=>(await v(),c.presentation.receivedPresentations.query({from:m})),getSentPresentations:async(f,m)=>(await v(),c.presentation.sentPresentations.query({to:m})),getIncomingPresentations:async(f,m)=>(await v(),c.presentation.incomingPresentations.query({from:m})),deletePresentation:async(f,m)=>(await v(),c.presentation.deletePresentation.mutate({uri:m})),createBoost:async(f,m,E)=>(await v(),c.boost.createBoost.mutate({credential:m,...E})),createChildBoost:async(f,m,E,P)=>(await v(),c.boost.createChildBoost.mutate({parentUri:m,boost:{credential:E,...P}})),getBoost:async(f,m)=>(await v(),c.boost.getBoost.query({uri:m})),getBoosts:async(f,m)=>(console.warn("The getBoosts method is deprecated! Please use getPaginatedBoosts instead!"),await v(),c.boost.getBoosts.query({query:m})),countBoosts:async(f,m)=>(await v(),c.boost.countBoosts.query({query:m})),getPaginatedBoosts:async(f,m)=>(await v(),c.boost.getPaginatedBoosts.query(m)),getBoostChildren:async(f,m,E)=>(await v(),c.boost.getBoostChildren.query({uri:m,...E})),countBoostChildren:async(f,m,E)=>(await v(),c.boost.countBoostChildren.query({uri:m,...E})),getBoostSiblings:async(f,m,E)=>(await v(),c.boost.getBoostSiblings.query({uri:m,...E})),countBoostSiblings:async(f,m,E)=>(await v(),c.boost.countBoostSiblings.query({uri:m,...E})),getFamilialBoosts:async(f,m,E)=>(await v(),c.boost.getFamilialBoosts.query({uri:m,...E})),countFamilialBoosts:async(f,m,E)=>(await v(),c.boost.countFamilialBoosts.query({uri:m,...E})),getBoostParents:async(f,m,E)=>(await v(),c.boost.getBoostParents.query({uri:m,...E})),countBoostParents:async(f,m,E)=>(await v(),c.boost.countBoostParents.query({uri:m,...E})),makeBoostParent:async(f,m)=>(await v(),c.boost.makeBoostParent.mutate(m)),removeBoostParent:async(f,m)=>(await v(),c.boost.removeBoostParent.mutate(m)),getBoostRecipients:async(f,m,E=25,P=void 0,z=!0)=>(console.warn("The getBoostRecipients method is deprecated! Please use getPaginatedBoostRecipients instead!"),await v(),c.boost.getBoostRecipients.query({uri:m,limit:E,skip:P,includeUnacceptedBoosts:z})),getPaginatedBoostRecipients:async(f,m,E=25,P=void 0,z=!0,O)=>(await v(),c.boost.getPaginatedBoostRecipients.query({uri:m,limit:E,cursor:P,includeUnacceptedBoosts:z,query:O})),getPaginatedBoostRecipientsWithChildren:async(f,m,E=25,P=void 0,z=!0,O,oe,j=1)=>(await v(),c.boost.getPaginatedBoostRecipientsWithChildren.query({uri:m,limit:E,cursor:P,includeUnacceptedBoosts:z,boostQuery:O,profileQuery:oe,numberOfGenerations:j})),countBoostRecipientsWithChildren:async(f,m,E=!0,P,z,O=1)=>{if(!g)throw new Error("Please make an account first!");return c.boost.getBoostRecipientsWithChildrenCount.query({uri:m,includeUnacceptedBoosts:E,boostQuery:P,profileQuery:z,numberOfGenerations:O})},countBoostRecipients:async(f,m,E=!0)=>(await v(),c.boost.getBoostRecipientCount.query({uri:m,includeUnacceptedBoosts:E})),getConnectedBoostRecipients:async(f,m,{limit:E=25,cursor:P=void 0,includeUnacceptedBoosts:z=!0,query:O}={})=>(await v(),c.boost.getConnectedBoostRecipients.query({uri:m,limit:E,cursor:P,includeUnacceptedBoosts:z,query:O})),countConnectedBoostRecipients:async(f,m,E=!0)=>(await v(),c.boost.getConnectedBoostRecipientCount.query({uri:m,includeUnacceptedBoosts:E})),getBoostChildrenProfileManagers:async(f,m,E)=>(await v(),c.boost.getChildrenProfileManagers.query({uri:m,...E})),updateBoost:async(f,m,E,P)=>(await v(),c.boost.updateBoost.mutate({uri:m,updates:{...P&&{credential:P},...E}})),getBoostAdmins:async(f,m,E={})=>(await v(),c.boost.getBoostAdmins.query({uri:m,...E})),getBoostPermissions:async(f,m,E)=>(await v(),E?c.boost.getOtherBoostPermissions.query({uri:m,profileId:E}):c.boost.getBoostPermissions.query({uri:m})),updateBoostPermissions:async(f,m,E,P)=>{if(await v(),!P)return c.boost.updateBoostPermissions.query({uri:m,updates:E});let z=await c.boost.updateOtherBoostPermissions.query({uri:m,profileId:P,updates:E});return z&&await f.invoke.clearDidWebCache?.(),z},addBoostAdmin:async(f,m,E)=>{await v();let P=await c.boost.addBoostAdmin.mutate({uri:m,profileId:E});return P&&await f.invoke.clearDidWebCache?.(),P},removeBoostAdmin:async(f,m,E)=>{await v();let P=await c.boost.removeBoostAdmin.mutate({uri:m,profileId:E});return P&&await f.invoke.clearDidWebCache?.(),P},deleteBoost:async(f,m)=>(await v(),c.boost.deleteBoost.mutate({uri:m})),sendBoost:async(f,m,E,P={encrypt:!0,skipNotification:!1})=>{await v();let z=await f.invoke.resolveFromLCN(E),O=await tn.spa(z);if(!O.success)throw new Error("Did not get a valid boost from URI");let oe=await f.invoke.getProfile(m);if(!oe)throw new Error("Target profile not found");let j=O.data;dl(j)?j.validFrom=new Date().toISOString():j.issuanceDate=new Date().toISOString(),j.issuer=f.id.did(),Array.isArray(j.credentialSubject)?j.credentialSubject=j.credentialSubject.map(Mn=>({...Mn,id:oe.did})):j.credentialSubject.id=oe.did,j?.type?.includes("BoostCredential")&&(j.boostId=E),typeof P=="object"&&P.overideFn&&(j=P.overideFn(j));let ke=await f.invoke.issueCredential(j);if(typeof P=="object"&&!P.encrypt||!P)return c.boost.sendBoost.mutate({profileId:m,uri:E,credential:ke,options:{skipNotification:typeof P=="object"&&P.skipNotification}});let Re=await c.utilities.getDid.query(),Pt=await f.invoke.createDagJwe(ke,[f.id.did(),oe.did,Re]);return c.boost.sendBoost.mutate({profileId:m,uri:E,credential:Pt,options:{skipNotification:typeof P=="object"&&P.skipNotification}})},registerSigningAuthority:async(f,m,E,P)=>(await v(),c.profile.registerSigningAuthority.mutate({endpoint:m,name:E,did:P})),getRegisteredSigningAuthorities:async f=>(await v(),c.profile.signingAuthorities.query()),getRegisteredSigningAuthority:async(f,m,E)=>(await v(),c.profile.signingAuthority.query({endpoint:m,name:E})),setPrimaryRegisteredSigningAuthority:async(f,m,E)=>(await v(),c.profile.setPrimarySigningAuthority.mutate({endpoint:m,name:E})),getPrimaryRegisteredSigningAuthority:async f=>(await v(),c.profile.primarySigningAuthority.query()),generateClaimLink:async(f,m,E,P,z)=>(await v(),c.boost.generateClaimLink.mutate({boostUri:m,claimLinkSA:E,options:P,challenge:z})),claimBoostWithLink:async(f,m,E)=>(await v(),c.boost.claimBoostWithLink.mutate({boostUri:m,challenge:E})),createContract:async(f,m)=>(await v(),c.contracts.createConsentFlowContract.mutate(m)),addAutoBoostsToContract:async(f,m,E)=>(await v(),c.contracts.addAutoBoostsToContract.mutate({contractUri:m,autoboosts:E})),removeAutoBoostsFromContract:async(f,m,E)=>(await v(),c.contracts.removeAutoBoostsFromContract.mutate({contractUri:m,boostUris:E})),getContract:async(f,m)=>c.contracts.getConsentFlowContract.query({uri:m}),getContracts:async(f,m)=>(await v(),c.contracts.getConsentFlowContracts.query(m)),deleteContract:async(f,m)=>(await v(),c.contracts.deleteConsentFlowContract.mutate({uri:m})),getConsentFlowData:async(f,m,E={})=>(await v(),c.contracts.getConsentedDataForContract.query({uri:m,...E})),getConsentFlowDataForDid:async(f,m,E={})=>(await v(),c.contracts.getConsentedDataForDid.query({did:m,...E})),getAllConsentFlowData:async(f,m={},E={})=>(await v(),c.contracts.getConsentedData.query({query:m,...E})),writeCredentialToContract:async(f,m,E,P,z)=>(await v(),c.contracts.writeCredentialToContract.mutate({did:m,contractUri:E,credential:P,boostUri:z})),consentToContract:async(f,m,{terms:E,expiresAt:P,oneTime:z},O)=>(await v(),c.contracts.consentToContract.mutate({contractUri:m,terms:E,expiresAt:P,oneTime:z,recipientToken:O})),getConsentedContracts:async(f,m)=>(await v(),c.contracts.getConsentedContracts.query(m)),updateContractTerms:async(f,m,{terms:E,expiresAt:P,oneTime:z})=>(await v(),c.contracts.updateConsentedContractTerms.mutate({uri:m,terms:E,expiresAt:P,oneTime:z})),withdrawConsent:async(f,m)=>(await v(),c.contracts.withdrawConsent.mutate({uri:m})),getConsentFlowTransactions:async(f,m,E)=>(await v(),c.contracts.getTermsTransactionHistory.query({uri:m,...E})),getCredentialsForContract:async(f,m,E={})=>(await v(),c.contracts.getCredentialsForContract.query({termsUri:m,...E})),getConsentFlowCredentials:async(f,m={})=>(await v(),c.contracts.getAllCredentialsForTerms.query(m)),verifyConsent:async(f,m,E)=>(await v(),c.contracts.verifyConsent.query({uri:m,profileId:E})),syncCredentialsToContract:async(f,m,E)=>(await v(),c.contracts.syncCredentialsToContract.mutate({termsUri:m,categories:E})),addDidMetadata:async(f,m)=>{await v();let E=await c.didMetadata.addDidMetadata.mutate(m);return E&&await f.invoke.clearDidWebCache?.(),E},getDidMetadata:async(f,m)=>(await v(),c.didMetadata.getDidMetadata.query({id:m})),getMyDidMetadata:async()=>(await v(),c.didMetadata.getMyDidMetadata.query()),updateDidMetadata:async(f,m,E)=>{await v();let P=await c.didMetadata.updateDidMetadata.mutate({id:m,updates:E});return P&&await f.invoke.clearDidWebCache?.(),P},deleteDidMetadata:async(f,m)=>{await v();let E=await c.didMetadata.deleteDidMetadata.mutate({id:m});return E&&await f.invoke.clearDidWebCache?.(),E},createClaimHook:async(f,m)=>(await v(),c.claimHook.createClaimHook.mutate({hook:m})),getClaimHooksForBoost:async(f,m)=>(await v(),c.claimHook.getClaimHooksForBoost.query(m)),deleteClaimHook:async(f,m)=>(await v(),c.claimHook.deleteClaimHook.mutate({id:m})),addAuthGrant:async(f,m)=>(await v(),c.authGrants.addAuthGrant.mutate(m)),revokeAuthGrant:async(f,m)=>(await v(),c.authGrants.revokeAuthGrant.mutate({id:m})),deleteAuthGrant:async(f,m)=>(await v(),c.authGrants.deleteAuthGrant.mutate({id:m})),updateAuthGrant:async(f,m,E)=>(await v(),c.authGrants.updateAuthGrant.mutate({id:m,updates:E})),getAuthGrant:async(f,m)=>(await v(),c.authGrants.getAuthGrant.query({id:m})),getAuthGrants:async(f,m)=>(await v(),c.authGrants.getAuthGrants.query(m)),getAPITokenForAuthGrant:async(f,m)=>{await v();let E=await c.authGrants.getAuthGrant.query({id:m});if(!E)throw new Error("Auth grant not found");if(E.status!=="active")throw new Error("Auth grant is not active");if(!E.challenge)throw new Error("Auth grant has no challenge");if(!E.scope)throw new Error("Auth grant has no scope");if(E.expiresAt&&new Date(E.expiresAt)<new Date)throw new Error("Auth grant is expired");let P=await f.invoke.getDidAuthVp({challenge:E.challenge,proofFormat:"jwt"});if(!P)throw new Error("Failed to get API Token for auth grant");return P},sendCredentialViaInbox:async(f,m)=>(await v(),c.inbox.issue.mutate(m)),getMySentInboxCredentials:async(f,m)=>(await v(),c.inbox.getMyIssuedCredentials.query(m)),getInboxCredential:async(f,m)=>(await v(),c.inbox.getInboxCredential.query({credentialId:m})),sendGuardianApprovalEmail:async(f,m)=>(await v(),c.inbox.sendGuardianApprovalEmail.mutate(m)),approveGuardianRequest:async(f,m)=>c.inbox.approveGuardianRequest.mutate({token:m}),approveGuardianRequestByPath:async(f,m)=>c.inbox.approveGuardianRequestByPath.query({token:m}),addContactMethod:async(f,m)=>(await v(),c.contactMethods.addContactMethod.mutate(m)),getMyContactMethods:async f=>(await v(),c.contactMethods.getMyContactMethods.query()),setPrimaryContactMethod:async(f,m)=>(await v(),c.contactMethods.setPrimaryContactMethod.mutate({contactMethodId:m})),verifyContactMethod:async(f,m)=>(await v(),c.contactMethods.verifyContactMethod.mutate({token:m})),removeContactMethod:async(f,m)=>(await v(),c.contactMethods.removeContactMethod.mutate({id:m})),resolveFromLCN:async(f,m)=>{let E=await c.storage.resolve.query({uri:m});return tn.or(fa).or(yo).or(Fs).or(Ws).or(bo).parseAsync(E)},getLCNClient:()=>c}}}b(Np,"getLearnCardNetworkPlugin");var Dp=b(async(n,e)=>{let s=[{id:"LearnCard Network",url:"https://network.learncard.com",did:"did:web:network.learncard.com"}],l;if(e){let y=await fetch(e);y.status===200?l=JSON.parse(await y.text()):l=s}else l=s;let c=b(y=>{if(!!y)return typeof y=="string"?y:"id"in y&&typeof y.id=="string"?y.id:void 0},"getIssuerDID"),g=b(y=>{let v=c(y);if(!!v)return l.find(f=>f.did===v)},"getTrustedBoostVerifier");return{name:"VerifyBoost",displayName:"Verify Boost Extension",description:"Adds a check for validating Boost Credentials.",methods:{verifyCredential:async(y,v,f)=>{let m=await n.invoke.verifyCredential(v,f),E=v?.boostCredential;try{if(E){let P=await n.invoke.verifyCredential(E);if(!E?.boostId&&!v?.boostId&&m.warnings.push("Boost Authenticity could not be verified: Boost ID metadata is missing."),P.errors?.length>0)m.errors=[...P.errors||[],...m.errors||[],"Boost Credential could not be verified."];else if(E?.boostId!==v?.boostId)m.errors.push("Boost Authenticity could not be verified: Boost ID metadata is mismatched.");else{let z=g(v?.issuer);z?m.checks.push(`Boost is Authentic. Verified by ${z.id}.`):m.warnings.push(`Boost Authenticity could not be verified. Issuer is outside of trust network: ${c(v?.issuer)}`)}}}catch{m.errors.push("Boost authenticity could not be verified.")}return m}}}},"getVerifyBoostPlugin");
5
5
  /* istanbul ignore file -- @preserve */
6
6
  /* istanbul ignore if -- @preserve */
7
7
  /* istanbul ignore next -- @preserve */