filecoin 0.0.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +139 -10
- package/bin/filecoin.js +7 -0
- package/dist/chunks/_esm-BBXTTBLC.js +9 -0
- package/dist/chunks/_esm-BBXTTBLC.js.map +7 -0
- package/dist/chunks/ccip-TGFMQFIR.js +3 -0
- package/dist/chunks/ccip-TGFMQFIR.js.map +7 -0
- package/dist/chunks/chunk-2VZELE36.js +124 -0
- package/dist/chunks/chunk-2VZELE36.js.map +7 -0
- package/dist/chunks/chunk-35V77X3C.js +12 -0
- package/dist/chunks/chunk-35V77X3C.js.map +7 -0
- package/dist/chunks/chunk-3TJUKWFC.js +6 -0
- package/dist/chunks/chunk-3TJUKWFC.js.map +7 -0
- package/dist/chunks/chunk-63JLHZEK.js +4 -0
- package/dist/chunks/chunk-63JLHZEK.js.map +7 -0
- package/dist/chunks/chunk-72RYXITT.js +186 -0
- package/dist/chunks/chunk-72RYXITT.js.map +7 -0
- package/dist/chunks/chunk-7MEK5RQ7.js +11 -0
- package/dist/chunks/chunk-7MEK5RQ7.js.map +7 -0
- package/dist/chunks/chunk-AKXAQJ6H.js +3 -0
- package/dist/chunks/chunk-AKXAQJ6H.js.map +7 -0
- package/dist/chunks/chunk-ASZ5KTWE.js +4 -0
- package/dist/chunks/chunk-ASZ5KTWE.js.map +7 -0
- package/dist/chunks/chunk-BFBNDHQG.js +3 -0
- package/dist/chunks/chunk-BFBNDHQG.js.map +7 -0
- package/dist/chunks/chunk-BZITZ3BI.js +3 -0
- package/dist/chunks/chunk-BZITZ3BI.js.map +7 -0
- package/dist/chunks/chunk-CIVQHT3F.js +5 -0
- package/dist/chunks/chunk-CIVQHT3F.js.map +7 -0
- package/dist/chunks/chunk-DHTPICN4.js +4 -0
- package/dist/chunks/chunk-DHTPICN4.js.map +7 -0
- package/dist/chunks/chunk-FCVBKUS5.js +4 -0
- package/dist/chunks/chunk-FCVBKUS5.js.map +7 -0
- package/dist/chunks/chunk-GCPUMM4E.js +3 -0
- package/dist/chunks/chunk-GCPUMM4E.js.map +7 -0
- package/dist/chunks/chunk-IAJFQYLN.js +4 -0
- package/dist/chunks/chunk-IAJFQYLN.js.map +7 -0
- package/dist/chunks/chunk-JFBUOLJ3.js +3 -0
- package/dist/chunks/chunk-JFBUOLJ3.js.map +7 -0
- package/dist/chunks/chunk-JUFFOBKU.js +59 -0
- package/dist/chunks/chunk-JUFFOBKU.js.map +7 -0
- package/dist/chunks/chunk-K63EJUGU.js +4 -0
- package/dist/chunks/chunk-K63EJUGU.js.map +7 -0
- package/dist/chunks/chunk-MWVOEA6K.js +4 -0
- package/dist/chunks/chunk-MWVOEA6K.js.map +7 -0
- package/dist/chunks/chunk-QRFSFJOZ.js +3 -0
- package/dist/chunks/chunk-QRFSFJOZ.js.map +7 -0
- package/dist/chunks/chunk-RK6JJQZL.js +41 -0
- package/dist/chunks/chunk-RK6JJQZL.js.map +7 -0
- package/dist/chunks/chunk-YIAP3JO3.js +3 -0
- package/dist/chunks/chunk-YIAP3JO3.js.map +7 -0
- package/dist/chunks/chunk-YVRWI5E3.js +3 -0
- package/dist/chunks/chunk-YVRWI5E3.js.map +7 -0
- package/dist/chunks/chunk-Z6O5SHUU.js +3 -0
- package/dist/chunks/chunk-Z6O5SHUU.js.map +7 -0
- package/dist/chunks/delete-BO7K4456.js +3 -0
- package/dist/chunks/delete-BO7K4456.js.map +7 -0
- package/dist/chunks/doctor-NF75MDBO.js +3 -0
- package/dist/chunks/doctor-NF75MDBO.js.map +7 -0
- package/dist/chunks/get-3EC2XCFH.js +3 -0
- package/dist/chunks/get-3EC2XCFH.js.map +7 -0
- package/dist/chunks/inspect-FDI442BE.js +3 -0
- package/dist/chunks/inspect-FDI442BE.js.map +7 -0
- package/dist/chunks/inspect-RJCGSGKG.js +3 -0
- package/dist/chunks/inspect-RJCGSGKG.js.map +7 -0
- package/dist/chunks/login-NNTYQ37I.js +4 -0
- package/dist/chunks/login-NNTYQ37I.js.map +7 -0
- package/dist/chunks/logout-3RWZFH2E.js +3 -0
- package/dist/chunks/logout-3RWZFH2E.js.map +7 -0
- package/dist/chunks/ls-F546AXRG.js +3 -0
- package/dist/chunks/ls-F546AXRG.js.map +7 -0
- package/dist/chunks/ls-GNEVBKRP.js +3 -0
- package/dist/chunks/ls-GNEVBKRP.js.map +7 -0
- package/dist/chunks/map-error-QLS3CQMO.js +3 -0
- package/dist/chunks/map-error-QLS3CQMO.js.map +7 -0
- package/dist/chunks/put-FXMGPSU6.js +3 -0
- package/dist/chunks/put-FXMGPSU6.js.map +7 -0
- package/dist/chunks/resume-G5PS246S.js +3 -0
- package/dist/chunks/resume-G5PS246S.js.map +7 -0
- package/dist/chunks/secp256k1-2OHXXNYZ.js +3 -0
- package/dist/chunks/secp256k1-2OHXXNYZ.js.map +7 -0
- package/dist/chunks/skills.run-E7FJPXEM.js +5 -0
- package/dist/chunks/skills.run-E7FJPXEM.js.map +7 -0
- package/dist/chunks/status-HOLDXKMR.js +3 -0
- package/dist/chunks/status-HOLDXKMR.js.map +7 -0
- package/dist/main.js +3 -0
- package/dist/main.js.map +7 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +49 -10
- package/skills/filecoin/SKILL.md +41 -0
- package/basic_types.md +0 -94
- package/chain.md +0 -280
- package/index.js +0 -1
- package/messages.md +0 -1684
- package/state.md +0 -1415
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
|
+
import{p as ge,q as gr}from"./chunk-3TJUKWFC.js";import{c as Us}from"./chunk-YIAP3JO3.js";var x={};Us(x,{BIGINT_FORMAT_RANGES:()=>Re,CONSTANT_CATCH:()=>Pr,Class:()=>ht,NUMBER_FORMAT_RANGES:()=>be,aborted:()=>M,allowsEval:()=>bt,assert:()=>Gs,assertEqual:()=>Bs,assertIs:()=>Vs,assertNever:()=>Ws,assertNotEqual:()=>Js,assignProp:()=>j,attachSchema:()=>je,base64ToUint8Array:()=>kr,base64urlToUint8Array:()=>dc,cached:()=>_e,captureStackTrace:()=>Ne,cleanEnum:()=>fc,cleanRegex:()=>xe,clone:()=>F,cloneDef:()=>qs,codePointLength:()=>ve,constantCatch:()=>Sr,createTransparentProxy:()=>nc,defineLazy:()=>xr,defineLazyInternal:()=>v,derived:()=>_c,esc:()=>xt,escapeRegex:()=>X,explicitlyAborted:()=>$t,extend:()=>sc,finalizeIssue:()=>U,floatSafeRemainder:()=>_t,getElementAtPath:()=>Hs,getEnumValues:()=>ce,getLengthableOrigin:()=>ze,getParsedType:()=>rc,getSizableOrigin:()=>wr,hexToUint8Array:()=>hc,hide:()=>Le,installLazyProp:()=>vc,isObject:()=>se,isPlainObject:()=>ee,issue:()=>ae,joinValues:()=>Te,jsonStringifyReplacer:()=>ue,members:()=>kt,merge:()=>uc,mergeDefs:()=>G,normalizeParams:()=>g,nullish:()=>gt,numKeys:()=>tc,objectClone:()=>Xs,omit:()=>ic,optionalKeys:()=>zt,own:()=>Q,parsedType:()=>wt,partial:()=>ac,pick:()=>oc,prefixIssues:()=>Y,primitiveTypes:()=>zr,promiseAllObject:()=>Qs,propertyKeyTypes:()=>vt,randomString:()=>ec,rawShape:()=>ye,required:()=>lc,safeExtend:()=>cc,shallowClone:()=>vr,slugify:()=>yt,stringifyPrimitive:()=>Ce,toZod:()=>Ks,uint8ArrayToBase64:()=>Zr,uint8ArrayToBase64url:()=>mc,uint8ArrayToHex:()=>gc,unwrapMessage:()=>ie});function Bs(e){return e}function Js(e){return e}function Ks(){return e=>e}function Vs(e){}function Ws(e){throw new Error("Unexpected value in exhaustive check")}function Gs(e){}function ce(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function Te(e,t="|"){return e.map(r=>Ce(r)).join(t)}function ue(e,t){return typeof t=="bigint"?t.toString():t}var mt=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function _e(e){return new mt(e)}function gt(e){return e==null}function xe(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function _t(e,t){let r=e/t,n=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<o?0:r-n}var _r=Symbol("evaluating");function xr(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==_r)return n===void 0&&(n=_r,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Xs(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function j(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ye(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function W(e){return ye(e._zod.def)??e._zod.def.shape}function yr(e,t,r){Object.defineProperty(e,t,{get(){let n=r();return j(this,t,n),n},enumerable:!0,configurable:!0})}function br(e,t,r){t in e?j(e,t,r):e[t]=r}function re(e,t,r,n){let o=W(t);for(let i of r){let s=Object.getOwnPropertyDescriptor(o,i);s.enumerable&&(s.get?yr(e,i,()=>{let c=t._zod.def.shape[i];return n?n(c,i):c}):br(e,i,n?n(s.value,i):s.value))}}function Ys(e,t){for(let r of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,r);n.enumerable&&(n.get?yr(e,r,()=>t[r]):br(e,r,n.value))}}function G(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function qs(e){return G(e._zod.def)}function Hs(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function Qs(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let o={};for(let i=0;i<t.length;i++)o[t[i]]=n[i];return o})}function ec(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function xt(e){return JSON.stringify(e)}function yt(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Ne="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function se(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var bt=_e(()=>{if(T.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function ee(e){if(se(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(se(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function vr(e){return ee(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function tc(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var rc=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},vt=new Set(["string","number","symbol"]),zr=new Set(["string","number","bigint","boolean","symbol","undefined"]);function X(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function F(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function g(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function nc(e){let t;return new Proxy({},{get(r,n,o){return t??(t=e()),Reflect.get(t,n,o)},set(r,n,o,i){return t??(t=e()),Reflect.set(t,n,o,i)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,o){return t??(t=e()),Reflect.defineProperty(t,n,o)}})}function Ce(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function zt(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var be={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Re={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function oc(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i={};return re(i,e,De(e,t)),F(e,G(r,{shape:i,checks:[]}))}function De(e,t){let r=W(e),n=[];for(let o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,o)?.enumerable)throw new Error(`Unrecognized key: "${String(o)}"`);t[o]&&n.push(o)}return n}function ic(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(De(e,t)),s={};return re(s,e,Reflect.ownKeys(W(e)).filter(c=>!i.has(c))),F(e,G(r,{shape:s,checks:[]}))}function sc(e,t){if(!ee(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=W(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return F(e,G(e._zod.def,{shape:$r(e,t)}))}function $r(e,t){let r={};return re(r,e,Reflect.ownKeys(W(e))),Ys(r,t),r}function cc(e,t){if(!ee(t))throw new Error("Invalid input to safeExtend: expected a plain object");return F(e,G(e._zod.def,{shape:$r(e,t)}))}function uc(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};re(r,e,Reflect.ownKeys(W(e))),re(r,t,Reflect.ownKeys(W(t)));let n=G(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return F(e,n)}function ac(e,t,r,n="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw new Error(`.${n}() cannot be used on object schemas containing refinements`);let c=r?new Set(De(t,r)):void 0,u={};return re(u,t,Reflect.ownKeys(W(t)),e&&((a,l)=>c&&!c.has(l)?a:new e({type:"optional",innerType:a}))),F(t,G(t._zod.def,{shape:u,checks:[]}))}function lc(e,t,r){let n=r?new Set(De(t,r)):void 0,o={};return re(o,t,Reflect.ownKeys(W(t)),(i,s)=>n&&!n.has(s)?i:new e({type:"nonoptional",innerType:i})),F(t,G(t._zod.def,{shape:o}))}function M(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function $t(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function Y(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function ie(e){return typeof e=="string"?e:e?.message}function je(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r)}function U(e,t,r){var n;let o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?(n=e).schema??(n.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:ie(e.inst?._zod.def?.error?.(e))??ie(i?.(e))??ie(t?.error?.(e))??ie(r.customError?.(e))??ie(r.localeError?.(e))??"Invalid input",c={};for(let u of Object.keys(e))u==="inst"||u==="schema"||u==="continue"||u==="input"||u==="__proto__"||(c[u]=e[u]);return c.path??(c.path=[]),c.message=s,t?.reportInput&&(c.input=e.input),c}function wr(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var pc=/[\uD800-\uDBFF]/;function ve(e){let t=e.length;if(!pc.test(e))return t;let r=t;for(let n=0;n<t-1;n++)(e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320&&(r--,n++);return r}function ze(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function wt(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function ae(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function fc(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function kr(e){let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function Zr(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function dc(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return kr(t+r)}function mc(e){return Zr(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function hc(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)r[n/2]=Number.parseInt(t.slice(n,n+2),16);return r}function gc(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var ht=class{constructor(...t){}};function kt(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);n.get?Object.defineProperty(e,r,{...n,enumerable:!1}):xc(e,r,n.value)}}function Q(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function Le(e,t,r){return Q(e,t,r,!1)}function _c(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return Q(this,r,n(this))},set(o){Q(this,r,o)}})}return t}function xc(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:Q(this,t,r.bind(this))},set(n){Q(this,t,n)}})}function yc(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var dt,H=!1,bc={configurable:!0,get(){H=!0}};function v(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&dt!==e._zod){dt=void 0;return}dt=e._zod,Object.defineProperty(n,t,{configurable:!0,get(){Object.defineProperty(this,t,bc);let o=H;H=!1;try{let i=r(this);return H?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i}),H=H||o,i}catch(i){throw delete this[t],H=H||o,i}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function vc(e,t,r,n){let o=yc(e,t);o&&Object.defineProperty(o,t,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,i),i.value=r(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:i})}})}var Pr="~constantCatch";function Sr(e){let t=()=>e;return t[Pr]=!0,t}var Or;var Zt={value:void 0,enumerable:!1},Ir="captureStackTrace"in Error?Error:null;function zc(e){let t=Ir;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return Ir=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function p(e,t,r,n){let o={};function i(m){this.def=m,this.constr=f,this.traits=new Set}i.prototype=o;let s=r,c=s&&new WeakSet;function u(m,d){if(m._zod){if(m._zod.traits.has(e))return}else{Zt.value=new i(d);try{Object.defineProperty(m,"_zod",Zt)}finally{Zt.value=void 0}}if(m._zod.traits.add(e),t(m,d),c){let _=Object.getPrototypeOf(m),y=m._zod.constr.prototype,z=_;for(;z&&z!==y;)z=Object.getPrototypeOf(z);let D=z??_;c.has(D)||(c.add(D),kt(D,s))}let h=f.prototype;for(let _ in h)Object.prototype.hasOwnProperty.call(h,_)&&(_ in m||(m[_]=h[_].bind(m)))}let a=n?.Parent??Object;class l extends a{}Object.defineProperty(l,"name",{value:e});function f(m){let d=n?.Parent?zc(l):this;u(d,m);let h=d._zod.deferred;if(h){for(let y of h)y();d._zod.deferred=void 0}let _=globalThis.__zod_globalConfig?.postProcessor;return _&&_(d),d}return Object.defineProperty(f,"init",{value:u}),Object.defineProperty(f,Symbol.hasInstance,{value:m=>n?.Parent&&m instanceof n.Parent?!0:m?._zod?.traits?.has(e)}),Object.defineProperty(f,"name",{value:e}),f}var B=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},le=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Or=globalThis).__zod_globalConfig??(Or.__zod_globalConfig={});var T=globalThis.__zod_globalConfig;function C(e){return e&&Object.assign(T,e),T}function $c(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,ue,2)),e.message}function wc(e){this._zod.message=e}var kc={get:$c,set:wc,enumerable:!0,configurable:!0},St={value:void 0,enumerable:!1},Er=new WeakSet([Object.prototype,Error.prototype]),Ar=(e,t)=>{e.name="$ZodError",St.value=t,Object.defineProperty(e,"issues",St),St.value=void 0,Object.defineProperty(e,"message",kc);let r=Object.getPrototypeOf(e);Er.has(r)||(Er.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0})}}))},Tr=p("$ZodError",Ar),ba=p("$ZodError",Ar,void 0,{Parent:Error});function Zc(e,t,r){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0}):e[t]=r()),e[t]}function Nr(e,t=r=>r.message){let r={},n=[];for(let o of e.issues)o.path.length>0?Zc(r,o.path[0],()=>[]).push(t(o)):n.push(t(o));return{formErrors:n,fieldErrors:r}}function Cr(e,t=r=>r.message){let r={_errors:[]},n=(o,i=[])=>{for(let s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(c=>n({issues:c},[...i,...s.path]));else if(s.code==="invalid_key")n({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")n({issues:s.issues},[...i,...s.path]);else{let c=[...i,...s.path];if(c.length===0)r._errors.push(t(s));else{let u=r,a=0;for(;a<c.length;){let l=c[a],f=a===c.length-1;if(l==="_errors"){f&&u._errors.push(t(s)),a++;continue}Object.prototype.hasOwnProperty.call(u,l)||Object.defineProperty(u,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let m=u[l];f&&m._errors.push(t(s)),u=m,a++}}}};return n(e),r}function Fe(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Me=e=>{let t=(r,n,o,i)=>{let s=o?{...o,async:!1}:{async:!1},c=r._zod.run({value:n,issues:[]},s);if(c instanceof Promise)throw new B;if(c.issues.length){let u=new(i?.Err??e)(c.issues.map(a=>U(a,s,C())));throw Ne(u,i?.callee??t),u}return c.value};return t};var Ue=e=>{let t=async(r,n,o,i)=>{let s=o?{...o,async:!0}:{async:!0},c=r._zod.run({value:n,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let u=new(i?.Err??e)(c.issues.map(a=>U(a,s,C())));throw Ne(u,i?.callee??t),u}return c.value};return t};var Be=e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new B;return i.issues.length?Rr(e,i.issues,o):{success:!0,data:i.value}};function Rr(e,t,r){let n;return{success:!1,get error(){return n||(n=new e(t.map(o=>U(o,r,C()))),t=void 0,r=void 0),n},set error(o){n=o,t=void 0,r=void 0}}}var Je=e=>async(t,r,n)=>{let o=n?{...n,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?Rr(e,i.issues,o):{success:!0,data:i.value}};var Pc=Symbol.for("zod.compile.invalid"),Sc=Symbol.for("zod.compile.fallback"),Ot=((e,t,r)=>{let n=e._zod.bag.validator;if(n!==void 0){if(n(t)!==Pc)return!0;if(n.definite===!0&&r===void 0)return!1}return Oc(e,t,r)});function Oc(e,t,r){let n=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun,i;if(o?(n[Sc]=!0,i=o({value:t,issues:[]},n)):i=e._zod.run({value:t,issues:[]},n),i instanceof Promise)throw new B;return i.issues.length===0}var It=async(e,t,r)=>{let n=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},o=e._zod.run({value:t,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length===0},Dr=e=>{let t=Me(e),r=(n,o,i,s)=>{let c=i?{...i,direction:"backward"}:{direction:"backward"};return t(n,o,c,Fe(r,s))};return r};var jr=e=>{let t=Me(e),r=(n,o,i,s)=>t(n,o,i,Fe(r,s));return r};var Lr=e=>{let t=Ue(e),r=async(n,o,i,s)=>{let c=i?{...i,direction:"backward"}:{direction:"backward"};return await t(n,o,c,Fe(r,s))};return r};var Fr=e=>{let t=Ue(e),r=async(n,o,i,s)=>await t(n,o,i,Fe(r,s));return r};var Mr=e=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Be(e)(t,r,o)};var Ur=e=>(t,r,n)=>Be(e)(t,r,n);var Br=e=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Je(e)(t,r,o)};var Jr=e=>async(t,r,n)=>Je(e)(t,r,n);var Kr=/^[cC][0-9a-z]{6,}$/,Vr=/^[0-9a-z]+$/,Wr=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Gr=/^[0-9a-vA-V]{20}$/,Xr=/^[A-Za-z0-9]{27}$/,Yr=/^[a-zA-Z0-9_-]{21}$/;function qr(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Hr=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Qr=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,At=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;var en=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var Ic="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function tn(){return new RegExp(Ic,"u")}var rn=/^(?:(?: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])$/,nn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var on=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,sn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,cn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,un=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var an=/^https?$/,ln=/^\+[1-9]\d{6,14}$/;var pn="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function Ec(e){return new RegExp(`^${e}$`)}var fn=Ec(pn);function Et(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function dn(e){return new RegExp(`^${Et(e)}$`)}function mn(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${Et({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,n=e.local?`${r}|${Et({precision:e.precision})}`:r;return new RegExp(`^${pn}T(?:${n})$`)}var hn=/^[\s\S]{0,}$/;var Tt=/^-?\d+$/,$e=/^-?\d+(?:\.\d+)?$/,gn=/^(?:true|false)$/i;var _n=/^[^A-Z]*$/,xn=/^[^a-z]*$/;var E=p("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var Nt=e=>{let t=e.value;return!gt(t)&&t.length!==void 0},Ke={number:"number",bigint:"bigint",object:"date"},Ct=p("$ZodCheckLessThan",(e,t)=>{E.init(e,t);let r=Ke[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:Ke[typeof n.value]??r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Rt=p("$ZodCheckGreaterThan",(e,t)=>{E.init(e,t);let r=Ke[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:Ke[typeof n.value]??r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),yn=p("$ZodCheckMultipleOf",(e,t)=>{E.init(e,t),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):_t(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),bn=p("$ZodCheckNumberFormat",(e,t)=>{E.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=be[t.format];e._zod.check=s=>{let c=s.value;if(r){if(!Number.isInteger(c)){s.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?s.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):s.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}c<o&&s.issues.push({origin:"number",input:c,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),c>i&&s.issues.push({origin:"number",input:c,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}});var vn=p("$ZodCheckMaxLength",(e,t)=>{var r;E.init(e,t),(r=e._zod.def).when??(r.when=Nt),e._zod.check=n=>{let o=n.value,i=o.length;if((typeof o=="string"&&i>t.maximum?ve(o):i)<=t.maximum)return;let c=ze(o);n.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),zn=p("$ZodCheckMinLength",(e,t)=>{var r;E.init(e,t),(r=e._zod.def).when??(r.when=Nt),e._zod.check=n=>{let o=n.value,i=o.length;if((typeof o=="string"&&i>=t.minimum&&i<t.minimum*2?ve(o):i)>=t.minimum)return;let c=ze(o);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),$n=p("$ZodCheckLengthEquals",(e,t)=>{var r;E.init(e,t),(r=e._zod.def).when??(r.when=Nt),e._zod.check=n=>{let o=n.value,i=o.length,s=typeof o=="string"&&i>=t.length&&i<=t.length*2?ve(o):i;if(s===t.length)return;let c=ze(o),u=s>t.length;n.issues.push({origin:c,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ke=p("$ZodCheckStringFormat",(e,t)=>{var r,n;E.init(e,t),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),wn=p("$ZodCheckRegex",(e,t)=>{ke.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),kn=p("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=_n),ke.init(e,t)}),Zn=p("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=xn),ke.init(e,t)}),Pn=p("$ZodCheckIncludes",(e,t)=>{E.init(e,t);let r=X(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Sn=p("$ZodCheckStartsWith",(e,t)=>{E.init(e,t);let r=new RegExp(`^${X(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),On=p("$ZodCheckEndsWith",(e,t)=>{E.init(e,t);let r=new RegExp(`.*${X(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});var In=p("$ZodCheckOverwrite",(e,t)=>{E.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var Ve=class{constructor(t=[],r={}){this.content=[],this.indent=0,this.args=t,this.closed=r}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let n=t.split(`
|
|
3
|
+
`).filter(s=>s),o=Math.min(...n.map(s=>s.length-s.trimStart().length)),i=n.map(s=>s.slice(o)).map(s=>" ".repeat(this.indent*2)+s);for(let s of i)this.content.push(s)}compile(){let t=Function,r=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
4
|
+
${r.join(`
|
|
5
|
+
`)}
|
|
6
|
+
};`)(...Object.values(this.closed))}};var An={major:4,minor:6,patch:5};var Z=p("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=An;let n=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(let i of o)for(let s of i._zod.onattach)s(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=(c,u,a)=>{if(c.memo)return c;let l=M(c),f;for(let m of u){if(m._zod.def.when){if($t(c)||!m._zod.def.when(c))continue}else if(l)continue;let d=c.issues.length,h=m._zod.check(c);if(h instanceof Promise&&a?.async===!1)throw new B;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await h,c.issues.length!==d&&(je(c.issues,d,e),l||(l=M(c,d)))});else{if(c.issues.length===d)continue;je(c.issues,d,e),l||(l=M(c,d))}}return f?f.then(()=>c):c},s=(c,u,a)=>{if(M(c))return c.aborted=!0,c;let l=i(u,o,a);if(l instanceof Promise){if(a.async===!1)throw new B;return l.then(f=>e._zod.parse(f,a))}return e._zod.parse(l,a)};e._zod.run=(c,u)=>{if(u.skipChecks)return e._zod.parse(c,u);if(u.direction==="backward"){let l=e._zod.parse({value:c.value,issues:[]},{...u,skipChecks:!0});return l instanceof Promise?l.then(f=>s(f,c,u)):s(l,c,u)}let a=e._zod.parse(c,u);if(a instanceof Promise){if(u.async===!1)throw new B;return a.then(l=>i(l,o,u))}return i(a,o,u)}}},{get"~standard"(){return Le(this,"~standard",jt(this))},set"~standard"(e){Q(this,"~standard",e)}}),Bn=(e,t)=>e.issues.length?{issues:e.issues.map(r=>U(r,t,C()))}:{value:e.value};async function Ac(e,t){let r={async:!0};return Bn(await e._zod.run({value:t,issues:[]},r),r)}function jt(e){return{validate:t=>{let r={async:!1};try{let n=e._zod.run({value:t,issues:[]},r);if(!(n instanceof Promise))return Bn(n,r)}catch{}return Ac(e,t)},vendor:"zod",version:1}}var Ye=p("$ZodString",(e,t)=>{Z.init(e,t),e._zod.pattern=t.pattern??hn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),k=p("$ZodStringFormat",(e,t)=>{ke.init(e,t),Ye.init(e,t)}),Jn=p("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Qr),k.init(e,t)}),Kn=p("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=At(n))}else t.pattern??(t.pattern=At());k.init(e,t)}),Vn=p("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=en),k.init(e,t)}),Wn=1,Ge=2;function Gn(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Tc(e,t){return!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?Gn(e)||Ge:Nc(e,t)}function Nc(e,t){if(!t.normalize&&t.protocol?.source===an.source&&!/^https?:\/\//i.test(e))return Wn;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse=="function")return r.parse(e)??Ge}return new URL(e)}catch{return Ge}}var Cc=/[\t\n\r]/g;function Tn(e){return e.replace(Cc,"")}function Rc(e,t){return t.lastIndex=0,t.test(e.hostname)}function Dc(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var Xn=p("$ZodURL",(e,t)=>{k.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),o=Tc(n,t);if(o===Wn){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(o===Ge){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(o===!0){r.value=Tn(n);return}t.hostname&&!Rc(o,t.hostname)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort}),t.protocol&&!Dc(o,t.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}),r.value=t.normalize?o.href:Tn(n);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Yn=p("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=tn()),k.init(e,t)}),qn=p("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?Yr:qr(t.length)),k.init(e,t)}),Hn=p("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Kr),k.init(e,t)}),Qn=p("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Vr),k.init(e,t)}),eo=p("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Wr),k.init(e,t)}),to=p("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Gr),k.init(e,t)}),ro=p("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Xr),k.init(e,t)}),no=p("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=mn(t)),k.init(e,t)}),oo=p("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=fn),k.init(e,t)}),io=p("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=dn(t)),k.init(e,t)}),so=p("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Hr),k.init(e,t)}),co=p("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=rn),k.init(e,t)}),jc=/^[0-9a-fA-F:.]+$/;function uo(e){return jc.test(e)?Gn(`http://[${e}]`):!1}var ao=p("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=nn),k.init(e,t),e._zod.check=r=>{uo(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}});var lo=p("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=on),k.init(e,t)});function Lc(e){let t=e.split("/");if(t.length!==2)return!1;let[r,n]=t;if(!n)return!1;let o=Number(n);return`${o}`!==n||o<0||o>128?!1:uo(r)}var po=p("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=sn),k.init(e,t),e._zod.check=r=>{Lc(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function fo(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Lt=/^[0-9a-zA-Z+/]*={0,2}$/,mo=p("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Lt),k.init(e,t),e._zod.check=r=>{fo(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),qe=/^[A-Za-z0-9_-]*$/;function Fc(e){if(!qe.test(e))return!1;let t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return fo(r)}var ho=p("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=qe),k.init(e,t),e._zod.check=r=>{Fc(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),go=p("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ln),k.init(e,t)});function Mc(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}var _o=p("$ZodJWT",(e,t)=>{k.init(e,t),e._zod.check=r=>{Mc(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var Ft=p("$ZodNumber",(e,t)=>{Z.init(e,t),e._zod.pattern=$e,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:String(o):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),r}}),xo=p("$ZodNumberFormat",(e,t)=>{bn.init(e,t),Ft.init(e,t)}),yo=p("$ZodBoolean",(e,t)=>{Z.init(e,t),e._zod.pattern=gn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}});var bo=p("$ZodUnknown",(e,t)=>{Z.init(e,t),e._zod.parse=r=>r}),vo=p("$ZodNever",(e,t)=>{Z.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Nn(e,t,r){e.issues.length&&t.issues.push(...Y(r,e.issues)),t.value[r]=e.value}var zo=p("$ZodArray",(e,t)=>{Z.init(e,t);let r=T.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=r?r.alloc(e,n,Array(i.length),o):Array(i.length);let s=[],c=o?.abortEarly;for(let u=0;u<i.length;u++){let a=i[u],l=t.element._zod.run({value:a,issues:[]},o);if(l instanceof Promise)s.push(l.then(f=>Nn(f,n,u)));else if(Nn(l,n,u),c&&l.issues.length!==0&&M(l))break}return s.length?Promise.all(s).then(()=>n):n}});function Xe(e,t,r,n,o,i){let s=r in n,c=i==="optional";if(!(!s&&c&&o==="optional")){if(e.issues.length){if(o!==void 0&&c&&!s)return;t.issues.push(...Y(r,e.issues))}if(!s&&o===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?(s||o==="defaulted"&&!c)&&(t.value[r]=void 0):t.value[r]=e.value}}var Uc=[];function $o(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:Uc,o=n.length?[...t,...n]:t;for(let s of o)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(s)}": expected a Zod schema`);let i=zt(e.shape);return{...e,allKeys:o,symbolKeys:n,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function wo(e,t,r,n,o,i,s){let c=[],u=o.keySet,a=o.catchall._zod,l=a.def.type,f=a.optin,m=a.optout,d=0;for(let h in t){if(s&&r.issues.length!==d){if(M(r,d))break;d=r.issues.length}if(u.has(h))continue;if(h==="__proto__"){l==="never"&&c.push(h);continue}if(l==="never"){c.push(h);continue}let _=a.run({value:t[h],issues:[]},n);_ instanceof Promise?e.push(_.then(y=>Xe(y,r,h,t,f,m))):Xe(_,r,h,t,f,m)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:i,continue:!0}),e.length?Promise.all(e).then(()=>r):r}var Bc=p("$ZodObject",(e,t)=>{Z.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),n=r?.get?r.get.raw:t.shape??{};if(n){let a=()=>{let l={...n};return Object.defineProperty(t,"shape",{value:l}),a.raw=l,l};a.raw=n,Object.defineProperty(t,"shape",{get:a})}let o=_e(()=>$o(t));v(e,"propValues",a=>{let l=a.def.shape,f={};for(let m in l){let d=l[m]._zod;if(d.values){Object.prototype.hasOwnProperty.call(f,m)||j(f,m,new Set);for(let h of d.values)f[m].add(h);d.optin!==void 0&&f[m].add(void 0)}}return f});let i=se,s=t.catchall,c,u=T.memoizer;u?.attach(e),e._zod.parse=(a,l)=>{c??(c=o.value);let f=a.value;if(!i(f))return a.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),a;a.value=u?u.alloc(e,a,{},l):{};let m=[],d=c.shape,h=l?.abortEarly,_=a.issues.length;for(let y of c.allKeys){if(h&&a.issues.length!==_){if(M(a,_))break;_=a.issues.length}if(y==="__proto__")continue;let z=d[y],D=z._zod.optin,me=z._zod.optout,he=z._zod.run({value:f[y],issues:[]},l);he instanceof Promise?m.push(he.then(I=>Xe(I,a,y,f,D,me))):Xe(he,a,y,f,D,me)}return s?wo(m,f,a,l,o.value,e,h===!0):m.length?Promise.all(m).then(()=>a):a}}),ko=p("$ZodObjectJIT",(e,t)=>{Bc.init(e,t);let r=e._zod.parse,n=_e(()=>$o(t)),o=T.memoizer,i=d=>{let h=n.value,_=h.symbolKeys,y=new Ve(["payload","ctx"],{shape:d,inst:e,memo:o,syms:_}),z=I=>`shape[${I}]._zod.run({ value: input[${I}], issues: [] }, ctx)`,D=(I,w)=>`
|
|
7
|
+
let ${I}_ab = false;
|
|
8
|
+
for (let i = 0; i < ${I}.issues.length; i++) {
|
|
9
|
+
const iss = ${I}.issues[i];
|
|
10
|
+
iss.path = iss.path ? [${w}, ...iss.path] : [${w}];
|
|
11
|
+
payload.issues.push(iss);
|
|
12
|
+
if (iss.continue !== true) ${I}_ab = true;
|
|
13
|
+
}
|
|
14
|
+
if (${I}_ab && ctx && ctx.abortEarly) {
|
|
15
|
+
payload.value = newResult;
|
|
16
|
+
return payload;
|
|
17
|
+
}`;y.write("const input = payload.value;");let me=Object.create(null),he=0;for(let I of h.allKeys)me[I]=`key_${he++}`;y.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let I of h.allKeys){if(I==="__proto__")continue;let w=me[I],K=typeof I=="symbol"?`syms[${_.indexOf(I)}]`:xt(I),pt=`${K} in input`,mr=d[I],ft=mr?._zod?.optin,hr=ft!==void 0,Fs=mr?._zod?.optout==="optional";if(y.write(`const ${w} = ${z(K)};`),hr&&Fs){let Ms=ft==="optional"?`${w}_present`:`${w}.value !== undefined || ${w}_present`;y.write(`
|
|
18
|
+
const ${w}_present = ${pt};
|
|
19
|
+
if (!${w}.issues.length || ${w}_present) {
|
|
20
|
+
if (${w}.issues.length) {${D(w,K)}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (${Ms}) {
|
|
24
|
+
newResult[${K}] = ${w}.value;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
`)}else hr?(y.write(`
|
|
29
|
+
if (${w}.issues.length) {${D(w,K)}
|
|
30
|
+
}
|
|
31
|
+
`),ft==="defaulted"?y.write(`newResult[${K}] = ${w}.value;`):y.write(`
|
|
32
|
+
if (${w}.value !== undefined || ${pt}) {
|
|
33
|
+
newResult[${K}] = ${w}.value;
|
|
34
|
+
}
|
|
35
|
+
`)):y.write(`
|
|
36
|
+
const ${w}_present = ${pt};
|
|
37
|
+
if (${w}.issues.length) {${D(w,K)}
|
|
38
|
+
}
|
|
39
|
+
if (!${w}_present && !${w}.issues.length) {
|
|
40
|
+
payload.issues.push({
|
|
41
|
+
code: "invalid_type",
|
|
42
|
+
expected: "nonoptional",
|
|
43
|
+
input: undefined,
|
|
44
|
+
path: [${K}]
|
|
45
|
+
});
|
|
46
|
+
if (ctx && ctx.abortEarly) {
|
|
47
|
+
payload.value = newResult;
|
|
48
|
+
return payload;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (${w}_present) {
|
|
53
|
+
newResult[${K}] = ${w}.value;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
`)}return y.write("payload.value = newResult;"),y.write("return payload;"),y.compile()},s,c=se,u=!T.jitless,l=u&&bt.value,f=t.catchall,m;e._zod.parse=(d,h)=>{m??(m=n.value);let _=d.value;return c(_)?u&&l&&h?.async===!1&&h.jitless!==!0?(s||(s=i(t.shape)),d=s(d,h),f?wo([],_,d,h,m,e,h?.abortEarly===!0):d):r(d,h):(d.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),d)}});function Cn(e,t,r,n){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let o=e.filter(i=>!M(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(s=>U(s,n,C())))}),t)}var Zo=p("$ZodUnion",(e,t)=>{Z.init(e,t),v(e,"optin",n=>n.def.options.some(o=>o._zod.optin==="defaulted")?"defaulted":n.def.options.some(o=>o._zod.optin!==void 0)?"optional":void 0),v(e,"optout",n=>n.def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),v(e,"values",n=>{if(n.def.options.every(o=>o._zod.values))return new Set(n.def.options.flatMap(o=>Array.from(o._zod.values)))}),v(e,"pattern",n=>{if(n.def.options.every(o=>o._zod.pattern)){let o=n.def.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>xe(i.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let i=!1,s=[];for(let c of t.options){let u=c._zod.run({value:n.value,issues:[]},o);if(u instanceof Promise)s.push(u),i=!0;else{if(u.issues.length===0)return u;s.push(u)}}return i?Promise.all(s).then(c=>Cn(c,n,e,o)):Cn(s,n,e,o)}});var Po=p("$ZodIntersection",(e,t)=>{Z.init(e,t),e._zod.parse=(r,n)=>{let o=r.value,i=t.left._zod.run({value:o,issues:[]},n),s=t.right._zod.run({value:o,issues:[]},n);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([u,a])=>Rn(r,u,a)):Rn(r,i,s)}});function Dt(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ee(e)&&ee(t)){let r=Object.keys(t),n=Object.keys(e).filter(i=>r.indexOf(i)!==-1),o={...e,...t};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(let i of n){if(i==="__proto__")continue;let s=Dt(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let o=e[n],i=t[n],s=Dt(o,i);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Rn(e,t,r){let n=new Map,o,i=new Map,s=(a,l)=>{let f;if(a.code==="unrecognized_keys"&&!a.path?.length)o??(o=a),f=a.keys;else if(a.code==="invalid_key"&&a.origin==="record"&&a.path?.length===1){let m=String(a.path[0]);i.has(m)||i.set(m,a),f=[m]}else return!1;for(let m of f)n.has(m)||n.set(m,{}),n.get(m)[l]=!0;return!0};for(let a of t.issues)s(a,"l")||e.issues.push(a);for(let a of r.issues)s(a,"r")||e.issues.push(a);let c=[...n].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(c.length){let a=o?c.filter(l=>o.keys.includes(l)):[];a.length&&e.issues.push({...o,keys:a});for(let l of c)!a.includes(l)&&i.has(l)&&e.issues.push(i.get(l))}let u=Dt(t.value,r.value);if(!u.valid){if(M(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`)}return e.value=u.data,e}var So=p("$ZodRecord",(e,t)=>{Z.init(e,t);let r=T.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!ee(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;let s=[],c=t.keyType._zod.values;if(c&&!t.partial){n.value=r?r.alloc(e,n,{},o):{};let u=new Set;for(let l of c)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){if(u.add(typeof l=="number"?l.toString():l),l==="__proto__")continue;let f=t.keyType._zod.run({value:l,issues:[]},o);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(f.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(h=>U(h,o,C())),input:l,path:[l],inst:e});continue}let m=f.value;if(m==="__proto__")continue;let d=t.valueType._zod.run({value:i[l],issues:[]},o);d instanceof Promise?s.push(d.then(h=>{h.issues.length&&n.issues.push(...Y(l,h.issues)),n.value[m]=h.value})):(d.issues.length&&n.issues.push(...Y(l,d.issues)),n.value[m]=d.value)}let a;for(let l in i)if(!u.has(l))if(t.mode==="loose"){if(l==="__proto__")continue;n.value[l]=i[l]}else a=a??[],a.push(l);a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:a,continue:!0})}else{n.value=r?r.alloc(e,n,{},o):{};let u;for(let a of Reflect.ownKeys(i)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,a))continue;let l=t.keyType._zod.run({value:a,issues:[]},o);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&$e.test(a)&&l.issues.length){let h=t.keyType._zod.run({value:Number(a),issues:[]},o);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(l=h)}if(l.issues.length){t.mode==="loose"?n.value[a]=i[a]:c?(u=u??[],u.push(a)):n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(h=>U(h,o,C())),input:a,path:[a],inst:e});continue}let m=l.value;if(m==="__proto__")continue;let d=t.valueType._zod.run({value:i[a],issues:[]},o);d instanceof Promise?s.push(d.then(h=>{h.issues.length&&n.issues.push(...Y(a,h.issues)),n.value[m]=h.value})):(d.issues.length&&n.issues.push(...Y(a,d.issues)),n.value[m]=d.value)}u&&u.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:u,continue:!0})}return s.length?Promise.all(s).then(()=>n):n}});var Oo=p("$ZodEnum",(e,t)=>{Z.init(e,t);let r=ce(t.entries),n=new Set(r);e._zod.values=n,v(e,"pattern",o=>{let i=ce(o.def.entries).filter(s=>vt.has(typeof s));return new RegExp(i.length?`^(${i.map(s=>X(s.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,i)=>{let s=o.value;return n.has(s)||o.issues.push({code:"invalid_value",values:r,input:s,inst:e}),o}}),Io=p("$ZodLiteral",(e,t)=>{Z.init(e,t);let r=new Set(t.values);e._zod.values=r,v(e,"pattern",n=>{let o=n.def.values;return new RegExp(o.length?`^(${o.map(i=>typeof i=="string"?X(i):i?X(i.toString()):String(i)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,o)=>{let i=n.value;return r.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}});var Eo=p("$ZodTransform",(e,t)=>{Z.init(e,t),e._zod.optin="optional",T.memoizer?.guard(e),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new le(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(r.value=s,r));if(o instanceof Promise)throw new B;return r.value=o,r}});function Dn(e,t){return e.value=t.issues.length?void 0:t.value,e}var Mt=p("$ZodOptional",(e,t)=>{Z.init(e,t),v(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",v(e,"values",r=>{let n=r.def.innerType._zod.values;return n?new Set([...n,void 0]):void 0}),v(e,"pattern",r=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${xe(n.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let o=t.innerType._zod.run({value:r.value,issues:[]},n);return o instanceof Promise?o.then(i=>Dn(r,i)):Dn(r,o)}return t.innerType._zod.run(r,n)}}),Ao=p("$ZodExactOptional",(e,t)=>{Mt.init(e,t),v(e,"values",r=>r.def.innerType._zod.values),v(e,"pattern",r=>r.def.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),To=p("$ZodNullable",(e,t)=>{Z.init(e,t),v(e,"optin",r=>r.def.innerType._zod.optin),v(e,"optout",r=>r.def.innerType._zod.optout),v(e,"pattern",r=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${xe(n.source)}|null)$`):void 0}),v(e,"values",r=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),No=p("$ZodDefault",(e,t)=>{Z.init(e,t),e._zod.optin="defaulted",v(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>jn(i,t)):jn(o,t)}});function jn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Co=p("$ZodPrefault",(e,t)=>{Z.init(e,t),e._zod.optin="defaulted",v(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),Ro=p("$ZodNonOptional",(e,t)=>{Z.init(e,t),v(e,"values",r=>{let n=r.def.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>Ln(i,e)):Ln(o,e)}});function Ln(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function Fn(e,t,r,n){return t.issues.length?(e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(o=>U(o,n,C()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var Do=p("$ZodCatch",(e,t)=>{Z.init(e,t),v(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),v(e,"optout",r=>r.def.innerType._zod.optout),v(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run({value:r.value,issues:[]},n);return o instanceof Promise?o.then(i=>Fn(r,i,t,n)):Fn(r,o,t,n)}});var jo=p("$ZodPipe",(e,t)=>{Z.init(e,t),v(e,"values",r=>r.def.in._zod.values),v(e,"optin",r=>r.def.in._zod.optin),v(e,"optout",r=>r.def.out._zod.optout),v(e,"propValues",r=>r.def.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let i=t.out._zod.run(r,n);return i instanceof Promise?i.then(s=>We(s,t.in,n)):We(i,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>We(i,t.out,n)):We(o,t.out,n)}});function We(e,t,r){return e.issues.some(n=>n.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}var Lo=p("$ZodReadonly",(e,t)=>{Z.init(e,t),v(e,"propValues",r=>r.def.innerType._zod.propValues),v(e,"values",r=>r.def.innerType._zod.values),v(e,"optin",r=>r.def.innerType?._zod?.optin),v(e,"optout",r=>r.def.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(Mn):Mn(o)}});function Mn(e){return e.memo||(e.value=Object.freeze(e.value)),e}var Fo=p("$ZodCustom",(e,t)=>{E.init(e,t),Z.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(i=>Un(i,r,n,e));Un(o,r,n,e)}});function Un(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(ae(o))}}var Bt=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},Jt="~memo",Mo=[];function Uo(e){return e!==null&&typeof e=="object"}function Ut(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}var Bo=new WeakMap,Ze=0,et=1,Pe=2;function tt(e,t,r){let n=Bo.get(e);if(n!==void 0)return n?Pe:Ze;if(t.has(e))return Pe;t.add(e);let o=Ze,i=l=>{if(o!==Pe&&l?._zod){let f=tt(l,t,r);f>o&&(o=f)}},s=(l,f)=>{let m=Ze;for(let d of Reflect.ownKeys(l)){let h=Object.getOwnPropertyDescriptor(l,d);if(f&&!h.enumerable)continue;let _=h.get?et:h.value?._zod?tt(h.value,t,r):Ze;_>m&&(m=_)}return m},c=l=>{l>o&&(o=l)},u=e._zod.def,a=u.type;switch(a){case"object":{let l=ye(u);c(l?s(l,!0):et),i(u.catchall);break}case"array":i(u.element);break;case"tuple":for(let l of u.items)i(l);i(u.rest);break;case"record":case"map":i(u.keyType),i(u.valueType);break;case"set":i(u.valueType);break;case"union":for(let l of u.options)i(l);break;case"intersection":i(u.left),i(u.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":i(u.innerType);break;case"pipe":i(u.in),i(u.out);break;case"function":i(u.input),i(u.output);break;case"lazy":{let l=u._cachedInner??(r?e._zod.innerType:void 0);c(l?tt(l,t,!1):et);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let l in u){let f=Object.getOwnPropertyDescriptor(u,l);if(!f||f.get)continue;let m=f.value;if(!(!m||typeof m!="object")){if(m._zod)i(m);else if(Array.isArray(m))for(let d of m)i(d)}}}return t.delete(e),Jc(e,o)}function Jc(e,t){return t!==et&&Bo.set(e,t===Pe),t}function Kc(e,t){let r=e.buckets.get(t);return r||(r=new WeakMap,e.buckets.set(t,r)),r}var He,Qe=[],Vc={alloc(e,t,r){let n=He;if(!n)return r;He=void 0;let o={value:r,issues:null};return n.set(t.value,o),Qe.push(o),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,n=(o,i)=>{if(i.direction!=="backward"&&Wc(i,o.value))throw new Bt;return r(o,i)};e._zod.parse=n,e._zod.run===r&&(e._zod.run=n)})},attach(e){var t;let r,n=!1,o,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let s=e._zod.parse,c=(u,a)=>{if(r===void 0){let z=tt(e,new Set,!1);if(z===Ze)return e._zod.parse=s,e._zod.run===c&&(e._zod.run=s),s(u,a);z===Pe||n?r=!0:n=!0}let l=u.value;if(!Uo(l))return s(u,a);let f=a[Jt];f||(f={buckets:new WeakMap,backEdges:void 0},a[Jt]=f);let m;o===a?m=i:(m=Kc(f,e),o=a,i=m);let d=m.get(l);if(d)return u.value=d.value,d.issues?d.issues.length&&u.issues.push(...Ut(d.issues)):(u.memo=!0,f.backEdges??(f.backEdges=new WeakSet),f.backEdges.add(d.value)),u;He=m;let h=Qe.length,_=s(u,a);He=void 0;let y=Qe.length>h?Qe.pop():void 0;return _ instanceof Promise?_.then(z=>(y&&(y.issues=z.issues.length?Ut(z.issues):Mo),z)):(y&&(y.issues=_.issues.length?Ut(_.issues):Mo),_)};e._zod.parse=c,e._zod.run===s&&(e._zod.run=c)})}};function Jo(){return Vc}function Wc(e,t){let r=e[Jt]?.backEdges;return r!==void 0&&Uo(t)&&r.has(t)}var Gc=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(i){return e[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};function o(i,s){return i==="number"&&typeof s=="number"&&!Number.isFinite(s)?String(s):n[i]??i}return i=>{switch(i.code){case"invalid_type":{let s=o(i.expected),c=wt(i.input),u=o(c,i.input);return`Invalid input: expected ${s}, received ${u}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${Ce(i.values[0])}`:`Invalid option: expected one of ${Te(i.values,"|")}`;case"too_big":{let s=i.exact?"exactly ":i.inclusive?"<=":"<",c=t(i.origin);return c?`Too big: expected ${i.origin??"value"} to have ${s}${i.maximum.toString()} ${c.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${s}${i.maximum.toString()}`}case"too_small":{let s=i.exact?"exactly ":i.inclusive?">=":">",c=t(i.origin);return c?`Too small: expected ${i.origin} to have ${s}${i.minimum.toString()} ${c.unit}`:`Too small: expected ${i.origin} to be ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${r[s.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${Te(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`Invalid discriminator value. Expected ${i.options.map(c=>`'${c}'`).join(" | ")}`:i.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function Ko(){return{localeError:Gc()}}var Vo;var Kt=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function Xc(){return new Kt}(Vo=globalThis).__zod_globalRegistry??(Vo.__zod_globalRegistry=Xc());var ne=globalThis.__zod_globalRegistry;function Wo(e){return e.checks&&(e.checks=[...e.checks]),e}function Go(e,t){return new e(Wo({type:"string",...g(t)}))}function Xo(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...g(t)})}function Yo(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...g(t)})}function qo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...g(t)})}function Ho(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...g(t)})}function Qo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...g(t)})}function ei(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...g(t)})}function ti(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...g(t)})}function ri(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...g(t)})}function ni(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...g(t)})}function oi(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...g(t)})}function ii(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...g(t)})}function si(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...g(t)})}function ci(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...g(t)})}function ui(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...g(t)})}function ai(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...g(t)})}function li(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...g(t)})}function pi(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...g(t)})}function fi(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...g(t)})}function di(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...g(t)})}function mi(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...g(t)})}function hi(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...g(t)})}function gi(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...g(t)})}function _i(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...g(t)})}function xi(e,t){return new e({type:"string",format:"date",check:"string_format",...g(t)})}function yi(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...g(t)})}function bi(e,t){return new e({type:"string",format:"duration",check:"string_format",...g(t)})}function vi(e,t){return new e(Wo({type:"number",checks:[],...g(t)}))}function zi(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...g(t)})}function $i(e,t){return new e({type:"boolean",...g(t)})}function wi(e){return new e({type:"unknown"})}function ki(e,t){return new e({type:"never",...g(t)})}function rt(e,t){return new Ct({check:"less_than",...g(t),value:e,inclusive:!1})}function Se(e,t){return new Ct({check:"less_than",...g(t),value:e,inclusive:!0})}function nt(e,t){return new Rt({check:"greater_than",...g(t),value:e,inclusive:!1})}function Oe(e,t){return new Rt({check:"greater_than",...g(t),value:e,inclusive:!0})}function ot(e,t){return new yn({check:"multiple_of",...g(t),value:e})}function it(e,t){return new vn({check:"max_length",...g(t),maximum:e})}function pe(e,t){return new zn({check:"min_length",...g(t),minimum:e})}function st(e,t){return new $n({check:"length_equals",...g(t),length:e})}function Vt(e,t){return new wn({check:"string_format",format:"regex",...g(t),pattern:e})}function Wt(e){return new kn({check:"string_format",format:"lowercase",...g(e)})}function Gt(e){return new Zn({check:"string_format",format:"uppercase",...g(e)})}function Xt(e,t){return new Pn({check:"string_format",format:"includes",...g(t),includes:e})}function Yt(e,t){return new Sn({check:"string_format",format:"starts_with",...g(t),prefix:e})}function qt(e,t){return new On({check:"string_format",format:"ends_with",...g(t),suffix:e})}function te(e){return new In({check:"overwrite",tx:e})}function Ht(e){return te(t=>t.normalize(e))}function Qt(){return te(e=>e.trim())}function er(){return te(e=>e.toLowerCase())}function tr(){return te(e=>e.toUpperCase())}function rr(){return te(e=>yt(e))}function Zi(e,t,r){return new e({type:"array",element:t,...g(r)})}function Pi(e,t,r){return new e({type:"custom",check:"custom",fn:t,...g(r)})}function Si(e,t){let r=Yc(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(ae(o,n.value,r._zod.def));else{let i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=n.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),n.issues.push(ae(i))}},e(n.value,n)),t);return r}function Yc(e,t){let r=new E({check:"custom",...g(t)});return r._zod.check=e,r}function Ie(e,...t){for(let r of t)for(let n of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,n)&&j(e,n,r[n]);return e}function or(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??ne,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function q(e,t,r,n,o){let i=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:n.path,message:o}):t.unrepresentable;if(i==="any")return!1;if(i===void 0||i==="throw")throw new Error(o);return Object.assign(r,i),!0}function O(e,t,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let c=e._zod.toJSONSchema?.();if(c)s.schema=c;else{let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,l);else{let m=s.schema,d=t.processors[o.type];if(!d)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);d(e,t,m,l)}let f=e._zod.parent;f&&(s.ref||(s.ref=f),O(f,t,l),t.seen.get(f).isParent=!0)}let u=t.metadataRegistry.get(e);return u&&Ie(s.schema,u),t.io==="input"&&A(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&"_prefault"in s.schema&&((n=s.schema).default??(n.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function Oi(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function ir(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let n=new Map;for(let s of e.seen.entries()){let c=e.metadataRegistry.get(s[0])?.id;if(c){let u=n.get(c);if(u&&u!==s[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(c,s[0])}}let o=s=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let f=e.external.registry.get(s[0])?.id,m=e.external.uri??(h=>h);if(f)return{ref:m(f)};let d=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=d,{defId:d,ref:`${m("__shared")}#/${c}/${Oi(d)}`}}let u="#",a=`${u}/${c}/`;if(s[1]===r&&!s[1].schema.id)return{ref:u};let l=s[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:a+Oi(l)}},i=s=>{if(s[1].schema.$ref)return;let c=s[1],{ref:u,defId:a}=o(s);c.def={...c.schema},a&&(c.defId=a);let l=c.schema;for(let f in l)delete l[f];l.$ref=u};if(e.cycles==="throw")for(let s of e.seen.entries()){let c=s[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
57
|
+
|
|
58
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let c=s[1];if(t===s[0]){i(s);continue}if(e.external){let a=e.external.registry.get(s[0])?.id;if(t!==s[0]&&a){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(c.cycle){i(s);continue}c.count>1&&e.reused==="ref"&&i(s)}e.external&&(e.sharedDefsExtractedFor=e.external)}function Ai(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let n of t){if(!n||typeof n!="object")return;Ai(n);let o=Object.keys(n);if(o.length!==1||o[0]!=="type")return;let i=n.type;for(let s of Array.isArray(i)?i:[i]){if(typeof s!="string")return;r.includes(s)||r.push(s)}}delete e.anyOf,e.type=r.length===1?r[0]:r}var Ti=new Set(["type","properties","required","additionalProperties"]),Ii=["oneOf","anyOf"];function Ei(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function nr(e){let t=[];for(let i of e){if(typeof i!="object"||i.type!=="object")return null;for(let s in i)if(!Ti.has(s))return null;t.push(i)}let r={},n=new Set;for(let i of t){for(let s in i.properties){if(Object.prototype.hasOwnProperty.call(r,s))continue;let c=[];for(let a of t){let l=a.properties?.[s]??Ei(a);l!=null&&(c.some(f=>JSON.stringify(f)===JSON.stringify(l))||c.push(l))}let u=c.length===1?c[0]:nr(c)??{allOf:c};j(r,s,u)}for(let s of i.required??[])n.add(s)}let o={type:"object",properties:r};if(n.size&&(o.required=[...n]),t.every(i=>i.additionalProperties===!1))o.additionalProperties=!1;else{let i=[];for(let s of t){let c=Ei(s);c&&!i.some(u=>JSON.stringify(u)===JSON.stringify(c))&&i.push(c)}i.length===1?o.additionalProperties=i[0]:i.length>1&&(o.additionalProperties={allOf:i})}return o}function qc(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let o of Ti)if(o in e)return;let r=t.filter(o=>Ii.some(i=>Array.isArray(o[i]))),n=null;if(!r.length)n=nr(t);else{let o=r[0],i=Ii.find(u=>Array.isArray(o[u]));if(Object.keys(o).length!==1)return;let s=t.filter(u=>u!==o),c=o[i].map(u=>nr([...s,u]));if(c.some(u=>!u))return;n={[i]:c}}n&&(delete e.allOf,Ie(e,n))}function sr(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=c=>{let u=e.seen.get(c);if(u.ref===null)return;let a=u.def??u.schema,l={...a},f=u.ref;if(u.ref=null,f){n(f);let d=e.seen.get(f),h=d.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(a.allOf=a.allOf??[],a.allOf.push(h)):Ie(a,h),Ie(a,l),c._zod.parent===f)for(let y in a)y==="$ref"||y==="allOf"||y in l||delete a[y];if(h.$ref&&d.def)for(let y in a)y==="$ref"||y==="allOf"||y in d.def&&JSON.stringify(a[y])===JSON.stringify(d.def[y])&&delete a[y]}let m=c._zod.parent;if(m&&m!==f){n(m);let d=e.seen.get(m);if(d?.schema.$ref&&(a.$ref=d.schema.$ref,d.def))for(let h in a)h==="$ref"||h==="allOf"||h in d.def&&JSON.stringify(a[h])===JSON.stringify(d.def[h])&&delete a[h]}e.override({zodSchema:c,jsonSchema:a,path:u.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let c of[...e.seen.entries()].reverse())n(c[0]);if(e.target!=="openapi-3.0")for(let c of e.seen.entries())Ai(c[1].def??c[1].schema);for(let c of e.deferred)c();if(e.intersections.length){let c=new Map;for(let u of e.seen.values())for(let a of[u.schema,u.def]){let l=a?.allOf;if(!Array.isArray(l))continue;let f=c.get(l);f?f.push(a):c.set(l,[a])}for(let u of e.intersections)for(let a of c.get(u)??[])qc(a)}}let o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let c=e.external.registry.get(t)?.id;if(!c)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(c)}Ie(o,r.defId?r.schema:r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&o.id===i&&delete o.id;let s=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let c of e.seen.entries()){let u=c[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,j(s,u.defId,u.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{let c=JSON.parse(JSON.stringify(o));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:Ee(t,"input",e.processors),output:Ee(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function A(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return A(n.element,r);if(n.type==="set")return A(n.valueType,r);if(n.type==="lazy")return A(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault"||n.type==="catch")return A(n.innerType,r);if(n.type==="intersection")return A(n.left,r)||A(n.right,r);if(n.type==="record"||n.type==="map")return A(n.keyType,r)||A(n.valueType,r);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:A(n.in,r)||A(n.out,r);if(n.type==="object"){for(let o in n.shape)if(A(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(let o of n.options)if(A(o,r))return!0;return!1}if(n.type==="tuple"){for(let o of n.items)if(A(o,r))return!0;return!!(n.rest&&A(n.rest,r))}return!1}var Ni=(e,t={})=>r=>{let n=or({...r,processors:t});return O(e,n),ir(n,e),sr(n,e)},Ee=(e,t,r={})=>n=>{let{libraryOptions:o,target:i}=n??{},s=or({...o??{},target:i,io:t,processors:r});return O(e,s),ir(s,e),sr(s,e)};var fe=(e,t,r)=>{(e[t]===void 0||r>e[t])&&(e[t]=r)},de=(e,t,r)=>{(e[t]===void 0||r<e[t])&&(e[t]=r)},Ci=(e,t)=>{fe(e,"minimum",t),de(e,"maximum",t)},Li=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},Fi=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},Mi=(e,t)=>{e.mime=e.mime?e.mime.filter(r=>t.includes(r)):[...t]},Ui=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},Ri=(e,t)=>fe(e,"minimum",t.minimum),Di=(e,t)=>de(e,"maximum",t.maximum),ji=e=>(t,r)=>{Ui(t,r.format);let[n,o]=e[r.format];fe(t,"minimum",n),de(t,"maximum",o)},Hc={greater_than:(e,t)=>fe(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>de(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>Li(e,t.value),number_format:ji(be),bigint_format:ji(Re),min_length:Ri,max_length:Di,length_equals:(e,t)=>Ci(e,t.length),min_size:Ri,max_size:Di,size_equals:(e,t)=>Ci(e,t.size),string_format:(e,t)=>{Ui(e,t.format),t.pattern&&Fi(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Mi(e,t.mime)};function L(e){let t={},r=e._zod.def,n=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let i of n)Hc[i._zod.def.check]?.(t,i._zod.def);let o=e._zod.bag;o.minimum!==void 0&&fe(t,"minimum",o.minimum),o.exclusiveMinimum!==void 0&&fe(t,"exclusiveMinimum",o.exclusiveMinimum),o.maximum!==void 0&&de(t,"maximum",o.maximum),o.exclusiveMaximum!==void 0&&de(t,"exclusiveMaximum",o.exclusiveMaximum),o.multipleOf!==void 0&&Li(t,o.multipleOf),o.format!==void 0&&(t.format??(t.format=o.format),o.format.includes("int")&&(t.isInt=!0)),o.mime&&Mi(t,o.mime);for(let i of o.patterns??[])Fi(t,i);return t}var Qc={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},eu=new Map([[Lt,cn],[qe,un]]),Bi=e=>eu.get(e)??e,Ji=(e,t,r,n)=>{let o=r;o.type="string";let{minimum:i,maximum:s,format:c,patterns:u,contentEncoding:a,laxFormat:l}=L(e);if(typeof i=="number"&&(o.minLength=i),typeof s=="number"&&(o.maxLength=s),c&&(o.format=Qc[c]??c,o.format===""&&delete o.format,(c==="time"||l)&&delete o.format),a&&(o.contentEncoding=a),u&&u.size>0){let f=[...u].map(Bi);f.length===1?o.pattern=f[0].source:f.length>1&&(o.allOf=[...f.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},Ki=(e,t,r,n)=>{let o=r,{minimum:i,maximum:s,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:a,isInt:l}=L(e);o.type=l?"integer":"number";let f=typeof a=="number"&&a>=(i??Number.NEGATIVE_INFINITY),m=typeof u=="number"&&u<=(s??Number.POSITIVE_INFINITY),d=t.target==="draft-04"||t.target==="openapi-3.0";if(f?d?(o.minimum=a,o.exclusiveMinimum=!0):o.exclusiveMinimum=a:typeof i=="number"&&(o.minimum=i),m?d?(o.maximum=u,o.exclusiveMaximum=!0):o.exclusiveMaximum=u:typeof s=="number"&&(o.maximum=s),c){let h=new Set;for(let z of c)Number.isFinite(z)&&z!==0?h.add(Math.abs(z)):q(e,t,o,n,`A multipleOf divisor of ${z} cannot be represented in JSON Schema`);let[_,...y]=h;_!==void 0&&(o.multipleOf=_),y.length&&(o.allOf=[...o.allOf??[],...y.map(z=>({multipleOf:z}))])}},Vi=(e,t,r,n)=>{r.type="boolean"};var Wi=(e,t,r,n)=>{r.not={}};var Gi=(e,t,r,n)=>{};var Xi=(e,t,r,n)=>{let o=e._zod.def,i=ce(o.entries);if(i.length===0){r.not={};return}i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),r.enum=i},Yi=(e,t,r,n)=>{let o=e._zod.def;if(o.values.length===0){r.not={};return}let i=[];for(let s of o.values)if(s===void 0){if(q(e,t,r,n,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof s=="bigint"){if(q(e,t,r,n,"BigInt literals cannot be represented in JSON Schema"))return;i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){let s=i[0];r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[s]:r.const=s}else i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),i.every(s=>typeof s=="boolean")&&(r.type="boolean"),i.every(s=>s===null)&&(r.type="null"),r.enum=i};var qi=(e,t,r,n)=>{q(e,t,r,n,"Custom types cannot be represented in JSON Schema")};var Hi=(e,t,r,n)=>{q(e,t,r,n,"Transforms cannot be represented in JSON Schema")};var Qi=(e,t,r,n)=>{let o=r,i=e._zod.def,{minimum:s,maximum:c}=L(e);typeof s=="number"&&(o.minItems=s),typeof c=="number"&&(o.maxItems=c),o.type="array",o.items=O(i.element,t,{...n,path:[...n.path,"items"]})};function ct(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?ct(t.out):t.type==="catch"?ct(t.innerType):e._zod.optin}var es=(e,t,r,n)=>{let o=r,i=e._zod.def,s=i.shape;if(Object.getOwnPropertySymbols(s).length&&q(e,t,o,n,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(let a in s)j(o.properties,a,O(s[a],t,{...n,path:[...n.path,"properties",a]}));let u=[];for(let a of Object.keys(s)){let l=i.shape[a];(t.io==="input"?ct(l)===void 0:l._zod.optout===void 0)&&u.push(a)}u.length>0&&(o.required=u),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=O(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},ts=(e,t,r,n)=>{let o=e._zod.def,i=o.inclusive===!1,s=o.options.map((c,u)=>O(c,t,{...n,path:[...n.path,i?"oneOf":"anyOf",u]}));i?r.oneOf=s:r.anyOf=s},rs=(e,t,r,n)=>{let o=e._zod.def,i=O(o.left,t,{...n,path:[...n.path,"allOf",0]}),s=O(o.right,t,{...n,path:[...n.path,"allOf",1]}),c=a=>"allOf"in a&&Object.keys(a).length===1,u=[...c(i)?i.allOf:[i],...c(s)?s.allOf:[s]];r.allOf=u,t.intersections.push(u)};function cr(e,t,r){if(t.$ref){if(r.has(t))return t;r.add(t);let h=e.get(t)?.def;if(!h)return t;let _=cr(e,h,r);return _===h?t:_}for(let h of["anyOf","oneOf"]){let _=t[h];if(!Array.isArray(_))continue;let y=_.map(z=>cr(e,z,r));y.some((z,D)=>z!==_[D])&&(t={...t,[h]:y})}let n=Array.isArray(t.type)?t.type:[t.type],o=!n.includes("string")&&n.some(h=>h==="number"||h==="integer"),i=t.enum??(t.const!==void 0?[t.const]:void 0);if(!o&&!i?.some(h=>typeof h=="number"))return t;let{minimum:s,maximum:c,exclusiveMinimum:u,exclusiveMaximum:a,multipleOf:l,format:f,id:m,...d}=t;return d.enum?d.enum=d.enum.map(h=>typeof h=="number"?String(h):h):typeof d.const=="number"&&(d.const=String(d.const)),o&&(d.type="string",i||(d.pattern=(n.includes("number")?$e:Tt).source)),d}var ur=new WeakMap;function tu(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let r=new Map;for(let n of ur.get(e)??[]){let o=e.seen.get(n),i=(o?.def??o?.schema)?.propertyNames;if(!i||i===!0||r.has(i))continue;let s=cr(t,i,new Set);s!==i&&r.set(i,s)}if(r.size)for(let n of e.seen.values())for(let o of[n.schema,n.def]){let i=o&&r.get(o.propertyNames);i&&(o.propertyNames=i)}}var ns=(e,t,r,n)=>{let o=r,i=e._zod.def;o.type="object";let s=i.keyType,c=L(s).patterns;if(i.mode==="loose"&&c&&c.size>0){let l=O(i.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(let f of c)j(o.patternProperties,Bi(f).source,l)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){o.propertyNames=O(i.keyType,t,{...n,path:[...n.path,"propertyNames"]});let l=ur.get(t);l||(l=[],ur.set(t,l),t.deferred.push(()=>tu(t))),l.push(e)}o.additionalProperties=O(i.valueType,t,{...n,path:[...n.path,"additionalProperties"]})}let u=s._zod.values,a=t.io==="input"&&ct(i.valueType)!==void 0;if(u&&!i.partial&&!a){let l=[...u].filter(f=>typeof f=="string"||typeof f=="number");l.length>0&&(o.required=l.map(String))}},os=(e,t,r,n)=>{let o=e._zod.def,i=O(o.innerType,t,n),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=o.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},is=(e,t,r,n)=>{let o=e._zod.def;O(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType},ar=Symbol();function ss(e,t,r,n,o){let i=!1,s=JSON.stringify(e,(c,u)=>typeof u!="bigint"?u:(i=!0,null));return i?(q(t,r,n,o,"BigInt defaults cannot be represented in JSON Schema"),ar):JSON.parse(s)}var cs=(e,t,r,n)=>{let o=e._zod.def;O(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s=ss(o.defaultValue,e,t,r,n);s!==ar&&(r.default=s)},us=(e,t,r,n)=>{let o=e._zod.def;O(o.innerType,t,n);let i=t.seen.get(e);if(i.ref=o.innerType,t.io!=="input")return;let s=ss(o.defaultValue,e,t,r,n);s!==ar&&(r._prefault=s)},as=(e,t,r,n)=>{let o=e._zod.def;O(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0)}catch{q(e,t,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=s},ls=(e,t,r,n)=>{let o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?i?o.out:o.in:o.out;O(s,t,n);let c=t.seen.get(e);c.ref=s},ps=(e,t,r,n)=>{let o=e._zod.def;O(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType,r.readOnly=!0};var lr=(e,t,r,n)=>{let o=e._zod.def;O(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType};var fs=new WeakSet([Object.prototype,Error.prototype]);function ut(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let n=r(this);return Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0})}})}var au=(e,t)=>{Tr.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);fs.has(r)||(fs.add(r),ut(r,"format",n=>o=>Cr(n,o)),ut(r,"flatten",n=>o=>Nr(n,o)),ut(r,"addIssue",n=>o=>{n.issues.push(o),n.message=JSON.stringify(n.issues,ue,2)}),ut(r,"addIssues",n=>o=>{n.issues.push(...o),n.message=JSON.stringify(n.issues,ue,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))};var R=p("ZodError",au,void 0,{Parent:Error});var ds=Me(R),ms=Ue(R),hs=Be(R),gs=Je(R),_s=Dr(R),xs=jr(R),ys=Lr(R),bs=Fr(R),vs=Mr(R),zs=Ur(R),$s=Br(R),ws=Jr(R);function pu(){T.localeError||C(Ko())}function lt(){T.memoizer||C({memoizer:Jo()})}var P=p("ZodType",(e,t)=>(pu(),Z.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(x.mergeDefs(t,{checks:[...t.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return F(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(sa(e,t))},superRefine(e,t){return this.check(ca(e,t))},overwrite(e){return this.check(te(e))},optional(){return Ss(this)},exactOptional(){return Wu(this)},nullable(){return Os(this)},nullish(){return Ss(Os(this))},nonoptional(e){return Qu(this,e)},array(){return oe(this)},or(e){return Mu([this,e])},and(e){return Bu(this,e)},transform(e){return Is(this,Vu(e))},default(e){return Yu(this,e)},prefault(e){return Hu(this,e)},catch(e){return ta(this,e)},pipe(e){return Is(this,e)},readonly(){return oa(this)},describe(e){let t=this.clone();return ne.add(t,{description:e}),t},meta(...e){if(e.length===0)return ne.get(this);let t=this.clone();return ne.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return x.hide(this,"~standard",{...jt(this),jsonSchema:{input:Ee(this,"input"),output:Ee(this,"output")}})},set"~standard"(e){x.own(this,"~standard",e)},parse:function e(t,r){return ds(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await ms(this,t,r,{callee:e})},safeParse(e,t){return hs(this,e,t)},async safeParseAsync(e,t){return gs(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){x.own(this,"spa",e)},validate(e,t){return Ot(this,e,t)},validateAsync(e,t){return It(this,e,t)},encode:function e(t,r){return _s(this,t,r,{callee:e})},decode:function e(t,r){return xs(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await ys(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await bs(this,t,r,{callee:e})},safeEncode(e,t){return vs(this,e,t)},safeDecode(e,t){return zs(this,e,t)},async safeEncodeAsync(e,t){return $s(this,e,t)},async safeDecodeAsync(e,t){return ws(this,e,t)},toJSONSchema(e){return Ni(this,{})(e)},get description(){return ne.get(this)?.description},get _def(){return this._zod.def}}),Es=p("_ZodString",(e,t)=>{Ye.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ji(e,r,n,o)},x.derived({format:e=>L(e).format??null,minLength:e=>L(e).minimum??null,maxLength:e=>L(e).maximum??null},{regex(...e){return this.check(Vt(...e))},includes(...e){return this.check(Xt(...e))},startsWith(...e){return this.check(Yt(...e))},endsWith(...e){return this.check(qt(...e))},min(...e){return this.check(pe(...e))},max(...e){return this.check(it(...e))},length(...e){return this.check(st(...e))},nonempty(...e){return this.check(pe(1,...e))},lowercase(e){return this.check(Wt(e))},uppercase(e){return this.check(Gt(e))},trim(){return this.check(Qt())},normalize(...e){return this.check(Ht(...e))},toLowerCase(){return this.check(er())},toUpperCase(){return this.check(tr())},slugify(){return this.check(rr())}})),fu=p("ZodString",(e,t)=>{Ye.init(e,t),Es.init(e,t)},{email(e){return this.check(Xo(_u,e))},url(e){return this.check(ti(yu,e))},jwt(e){return this.check(gi(Nu,e))},emoji(e){return this.check(ri(bu,e))},guid(e){return this.check(Yo(xu,e))},uuid(e){return this.check(qo(at,e))},uuidv4(e){return this.check(Ho(at,e))},uuidv6(e){return this.check(Qo(at,e))},uuidv7(e){return this.check(ei(at,e))},nanoid(e){return this.check(ni(vu,e))},cuid(e){return this.check(oi(zu,e))},cuid2(e){return this.check(ii($u,e))},ulid(e){return this.check(si(wu,e))},base64(e){return this.check(di(Eu,e))},base64url(e){return this.check(mi(Au,e))},xid(e){return this.check(ci(ku,e))},ksuid(e){return this.check(ui(Zu,e))},ipv4(e){return this.check(ai(Pu,e))},ipv6(e){return this.check(li(Su,e))},cidrv4(e){return this.check(pi(Ou,e))},cidrv6(e){return this.check(fi(Iu,e))},e164(e){return this.check(hi(Tu,e))},datetime(e){return this.check(_i(du,e))},date(e){return this.check(xi(mu,e))},time(e){return this.check(yi(hu,e))},duration(e){return this.check(bi(gu,e))}});function b(e){return Go(fu,e)}var S=p("ZodStringFormat",(e,t)=>{k.init(e,t),Es.init(e,t)}),du=p("ZodISODateTime",(e,t)=>{no.init(e,t),S.init(e,t)}),mu=p("ZodISODate",(e,t)=>{oo.init(e,t),S.init(e,t)}),hu=p("ZodISOTime",(e,t)=>{io.init(e,t),S.init(e,t)}),gu=p("ZodISODuration",(e,t)=>{so.init(e,t),S.init(e,t)}),_u=p("ZodEmail",(e,t)=>{Vn.init(e,t),S.init(e,t)});var xu=p("ZodGUID",(e,t)=>{Jn.init(e,t),S.init(e,t)});var at=p("ZodUUID",(e,t)=>{Kn.init(e,t),S.init(e,t)});var yu=p("ZodURL",(e,t)=>{Xn.init(e,t),S.init(e,t)});var bu=p("ZodEmoji",(e,t)=>{Yn.init(e,t),S.init(e,t)});var vu=p("ZodNanoID",(e,t)=>{qn.init(e,t),S.init(e,t)});var zu=p("ZodCUID",(e,t)=>{Hn.init(e,t),S.init(e,t)});var $u=p("ZodCUID2",(e,t)=>{Qn.init(e,t),S.init(e,t)});var wu=p("ZodULID",(e,t)=>{eo.init(e,t),S.init(e,t)});var ku=p("ZodXID",(e,t)=>{to.init(e,t),S.init(e,t)});var Zu=p("ZodKSUID",(e,t)=>{ro.init(e,t),S.init(e,t)});var Pu=p("ZodIPv4",(e,t)=>{co.init(e,t),S.init(e,t)});var Su=p("ZodIPv6",(e,t)=>{ao.init(e,t),S.init(e,t)});var Ou=p("ZodCIDRv4",(e,t)=>{lo.init(e,t),S.init(e,t)});var Iu=p("ZodCIDRv6",(e,t)=>{po.init(e,t),S.init(e,t)});var Eu=p("ZodBase64",(e,t)=>{mo.init(e,t),S.init(e,t)});var Au=p("ZodBase64URL",(e,t)=>{ho.init(e,t),S.init(e,t)});var Tu=p("ZodE164",(e,t)=>{go.init(e,t),S.init(e,t)});var Nu=p("ZodJWT",(e,t)=>{_o.init(e,t),S.init(e,t)});var As=p("ZodNumber",(e,t)=>{Ft.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ki(e,r,n,o),e.isFinite=!0},x.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:r}=L(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:r}=L(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:r}=L(e);return!!t||!!r?.some(Number.isSafeInteger)},format:e=>L(e).format??null},{gt(e,t){return this.check(nt(e,t))},gte(e,t){return this.check(Oe(e,t))},min(e,t){return this.check(Oe(e,t))},lt(e,t){return this.check(rt(e,t))},lte(e,t){return this.check(Se(e,t))},max(e,t){return this.check(Se(e,t))},int(e){return this.check(ks(e))},safe(e){return this.check(ks(e))},positive(e){return this.check(nt(0,e))},nonnegative(e){return this.check(Oe(0,e))},negative(e){return this.check(rt(0,e))},nonpositive(e){return this.check(Se(0,e))},multipleOf(e,t){return this.check(ot(e,t))},step(e,t){return this.check(ot(e,t))},finite(){return this}}));function dr(e){return vi(As,e)}var Cu=p("ZodNumberFormat",(e,t)=>{xo.init(e,t),As.init(e,t)});function ks(e){return zi(Cu,e)}var Ru=p("ZodBoolean",(e,t)=>{yo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Vi(e,r,n,o)});function Ts(e){return $i(Ru,e)}var Du=p("ZodUnknown",(e,t)=>{bo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Gi(e,r,n,o)});function Zs(){return wi(Du)}var ju=p("ZodNever",(e,t)=>{vo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Wi(e,r,n,o)});function Ns(e){return ki(ju,e)}var Lu=p("ZodArray",(e,t)=>{lt(),zo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Qi(e,r,n,o),e.element=t.element},{min(e,t){return this.check(pe(e,t))},nonempty(e){return this.check(pe(1,e))},max(e,t){return this.check(it(e,t))},length(e,t){return this.check(st(e,t))},unwrap(){return this.element}});function oe(e,t){return Zi(Lu,e,t)}var Cs=p("ZodObject",(e,t)=>{lt(),ko.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>es(e,r,n,o),x.installLazyProp(e,"shape",r=>r._zod.def.shape,!1)},{keyof(){return V(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(x.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(x.mergeDefs(this._zod.def,{catchall:Zs()}))},loose(){return this.clone(x.mergeDefs(this._zod.def,{catchall:Zs()}))},strict(){return this.clone(x.mergeDefs(this._zod.def,{catchall:Ns()}))},strip(){return this.clone(x.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return x.extend(this,e)},safeExtend(e){return x.safeExtend(this,e)},merge(e){return x.merge(this,e)},pick(e){return x.pick(this,e)},omit(e){return x.omit(this,e)},partial(...e){return x.partial(Rs,this,e[0])},exactPartial(...e){return x.partial(Ds,this,e[0],"exactPartial")},required(...e){return x.required(js,this,e[0])}});function Ae(e,t){let r={type:"object",shape:e??{},...x.normalizeParams(t)};return new Cs(r)}function N(e,t){return new Cs({type:"object",shape:e,catchall:Ns(),...x.normalizeParams(t)})}var Fu=p("ZodUnion",(e,t)=>{Zo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ts(e,r,n,o),e.options=t.options});function Mu(e,t){return new Fu({type:"union",options:e,...x.normalizeParams(t)})}var Uu=p("ZodIntersection",(e,t)=>{Po.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>rs(e,r,n,o)});function Bu(e,t){return new Uu({type:"intersection",left:e,right:t})}var Ps=p("ZodRecord",(e,t)=>{lt(),So.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ns(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType});function jp(e,t,r){return!t||!t._zod?new Ps({type:"record",keyType:b(),valueType:e,...x.normalizeParams(t)}):new Ps({type:"record",keyType:e,valueType:t,...x.normalizeParams(r)})}var fr=p("ZodEnum",(e,t)=>{Oo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(n,o,i)=>Xi(e,n,o,i),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{let i={};for(let s of n)if(r.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new fr({...t,checks:[],...x.normalizeParams(o),entries:i})},e.exclude=(n,o)=>{let i={...t.entries};for(let s of n)if(r.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new fr({...t,checks:[],...x.normalizeParams(o),entries:i})}});function V(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new fr({type:"enum",entries:r,...x.normalizeParams(t)})}var Ju=p("ZodLiteral",(e,t)=>{Io.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Yi(e,r,n,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Lp(e,t){return new Ju({type:"literal",values:Array.isArray(e)?e:[e],...x.normalizeParams(t)})}var Ku=p("ZodTransform",(e,t)=>{lt(),Eo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Hi(e,r,n,o),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new le(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(x.issue(i,r.value,t));else{let s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=r.value),s.inst??(s.inst=e),r.issues.push(x.issue(s))}};let o=t.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r)):(r.value=o,r)}});function Vu(e){return new Ku({type:"transform",transform:e})}var Rs=p("ZodOptional",(e,t)=>{Mt.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>lr(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Ss(e){return new Rs({type:"optional",innerType:e})}var Ds=p("ZodExactOptional",(e,t)=>{Ao.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>lr(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Wu(e){return new Ds({type:"optional",innerType:e})}var Gu=p("ZodNullable",(e,t)=>{To.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>os(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Os(e){return new Gu({type:"nullable",innerType:e})}var Xu=p("ZodDefault",(e,t)=>{No.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>cs(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Yu(e,t){return new Xu({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():x.shallowClone(t)}})}var qu=p("ZodPrefault",(e,t)=>{Co.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>us(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Hu(e,t){return new qu({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():x.shallowClone(t)}})}var js=p("ZodNonOptional",(e,t)=>{Ro.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>is(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Qu(e,t){return new js({type:"nonoptional",innerType:e,...x.normalizeParams(t)})}var ea=p("ZodCatch",(e,t)=>{Do.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>as(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ta(e,t){return new ea({type:"catch",innerType:e,catchValue:typeof t=="function"?t:x.constantCatch(t)})}var ra=p("ZodPipe",(e,t)=>{jo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ls(e,r,n,o),e.in=t.in,e.out=t.out});function Is(e,t){return new ra({type:"pipe",in:e,out:t})}var na=p("ZodReadonly",(e,t)=>{Lo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ps(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function oa(e){return new na({type:"readonly",innerType:e})}var ia=p("ZodCustom",(e,t)=>{Fo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>qi(e,r,n,o)});function sa(e,t={}){return Pi(ia,e,t)}function ca(e,t){return Si(e,t)}var $={authRequired:"auth_required",loginPending:"login_pending",sessionExpired:"session_expired",permissionDenied:"permission_denied",sessionConflict:"session_conflict",insufficientFunds:"insufficient_funds",notFound:"not_found",outputExists:"output_exists",verificationFailed:"verification_failed",unsafePath:"unsafe_path",operationRunning:"operation_running",operationFailed:"operation_failed",sourceChanged:"source_changed",stagingMissing:"staging_missing",commitRejected:"commit_rejected",removalReverted:"removal_reverted"},J={operationId:b().optional().describe("Set on put and delete errors; resume it with filecoin operations resume")},aa={[$.authRequired]:{description:"No session key for the network; run filecoin login.",details:N(J)},[$.loginPending]:{description:"A session key waits for approval in the console.",details:N({url:b().describe("Console page that approves the key"),...J})},[$.sessionExpired]:{description:"The session key lacks a scope the command needs, or it expired.",details:N({missing:oe(b()).describe("Scopes to authorize"),...J})},[$.permissionDenied]:{description:"The wallet owner approved fewer scopes than requested.",details:N({missing:oe(b()).describe("Scopes not granted")})},[$.sessionConflict]:{description:"filecoin login would replace a saved key that is pending or still valid.",details:N({address:b().describe("Saved session key address"),state:V(["pending","approved"]).describe("Whether the owner has approved the saved key"),scopes:oe(b()).describe("Scopes of the saved key"),url:b().optional().describe("Console page that approves the saved key, while pending")})},[$.insufficientFunds]:{description:"The payer cannot cover the upload.",details:N({fundingUrl:b().describe("Console page that funds the payer"),depositNeeded:b().describe("USDFC base units to deposit first"),needsApproval:Ts().describe("The payer must approve Warm Storage first"),...J})},[$.notFound]:{description:"No managed resource, operation, provider, or piece has that name.",details:N(J)},[$.outputExists]:{description:"filecoin get would overwrite an existing path."},[$.verificationFailed]:{description:"Retrieved bytes or blocks do not match their CIDs."},[$.unsafePath]:{description:"A retrieved archive tried to write outside the output directory."},[$.operationRunning]:{description:"Another process is running the operation.",details:N(J)},[$.operationFailed]:{description:"A put or delete stopped; resume it.",details:N(J)},[$.sourceChanged]:{description:"A resumed put found its source file changed.",details:N(J)},[$.stagingMissing]:{description:"A resumed put lost its staged CAR.",details:N(J)},[$.commitRejected]:{description:"The provider rejected the commit transaction.",details:N(J)},[$.removalReverted]:{description:"The removal transaction reverted.",details:N(J)}},la=[$.authRequired,$.loginPending,$.sessionExpired],Up=[...la,$.notFound,$.insufficientFunds,$.operationRunning,$.operationFailed,$.sourceChanged,$.stagingMissing,$.commitRejected,$.removalReverted];function pa(e){return{by:"agent",command:`filecoin operations resume ${e}`,description:"Continue this operation with its saved input"}}var fa=new Set(Object.entries(aa).filter(([,e])=>"details"in e&&"operationId"in e.details.shape).map(([e])=>e));function Bp(e,t){let r=pa(t);if(gr(e)){if(e.next?.some(i=>i.command===r.command))return e;let o=fa.has(e.code)?{...e.details,operationId:t}:e.details;return new ge({code:e.code,message:e.message,retryable:!1,...e.retryAfterSeconds===void 0?{}:{retryAfterSeconds:e.retryAfterSeconds},...o===void 0?{}:{details:o},next:[...e.next??[],r],cause:e.cause??e})}let n=e instanceof Error?e.message:String(e);return new ge({code:$.operationFailed,message:`Operation ${t} stopped: ${n}`,retryable:!1,details:{operationId:t},next:[r],cause:e})}function Jp(e,t){return new ge({code:"invalid_input",message:e,...t?{details:[{path:t,message:e}]}:{}})}function Kp(e,t){return new ge({code:$.notFound,message:e,...t?{next:[t]}:{}})}function Vp(e,t){return t?t.aborted?(e.catch(()=>{}),Promise.reject(t.reason)):new Promise((r,n)=>{let o=()=>n(t.reason);t.addEventListener("abort",o,{once:!0}),e.then(i=>{t.removeEventListener("abort",o),r(i)},i=>{t.removeEventListener("abort",o),n(i)})}):e}var Gp=["createDataSet","addPieces","schedulePieceRemovals","terminateService"],Xp=["createDataSet","addPieces","schedulePieceRemovals"],Yp="filecoin-cli";var Ls=["mainnet","calibration"],Hp="calibration";var tf={network:V(Ls).optional().describe("Network (default: FILECOIN_NETWORK, then the config file, then calibration)"),sessionKey:b().regex(/^0x[0-9a-fA-F]{64}$/,"Expected a 32-byte hex private key").optional().describe("Session key for CI, instead of the one saved by filecoin login"),rootAddress:b().regex(/^0x[0-9a-fA-F]{40}$/,"Expected a 20-byte hex address").optional().describe("Wallet that authorized FILECOIN_SESSION_KEY")},rf={network:"FILECOIN_NETWORK",sessionKey:"FILECOIN_SESSION_KEY",rootAddress:"FILECOIN_ROOT_ADDRESS"},nf={limit:dr().int().min(1).max(100).default(20).describe("Maximum results per page"),cursor:b().optional().describe("nextCursor of the previous page")},da=Ae({providerId:b(),dataSetId:b(),pieceId:b(),serviceURL:b()}),ma=Ae({ref:b(),kind:V(["file","folder"]),name:b(),chainId:b(),payer:b(),pieceCid:b(),rootCid:b().optional(),size:dr().int().describe("Stored bytes"),copies:oe(da),url:b().optional(),status:V(["active","removal_pending"]),createdAt:b()}),ha=Ae({piece:b().describe("Exact stored bytes"),browser:b().describe("Link a browser renders: a folder through inbrowser.link")}),of={operationId:b(),state:V(["ready","removal_pending"]),resource:ma,urls:ha},ga=V(["pending","running","failed","completed"]),sf=Ae({id:b(),action:V(["put","delete"]),resourceRef:b(),phase:b(),executionStatus:ga,updatedAt:b(),error:b().optional()});function cf(e){let t=["B","KiB","MiB","GiB"],r=e,n=0;for(;r>=1024&&n<t.length-1;)r/=1024,n++;return`${n===0?r:r.toFixed(1)} ${t[n]}`}export{b as a,dr as b,Ts as c,Zs as d,oe as e,Ae as f,N as g,jp as h,V as i,Lp as j,$ as k,aa as l,Up as m,pa as n,Bp as o,Jp as p,Kp as q,Vp as r,Ls as s,Hp as t,tf as u,rf as v,nf as w,ma as x,ha as y,of as z,ga as A,sf as B,cf as C,Gp as D,Xp as E,Yp as F};
|
|
59
|
+
//# sourceMappingURL=chunk-JUFFOBKU.js.map
|