@flowscripter/io-plugin-filesystem 1.1.7 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +26 -10
  2. package/dist/bundle.js +16 -16
  3. package/package.json +6 -6
package/README.md CHANGED
@@ -15,26 +15,38 @@
15
15
  - Implements the `IOProviderFactory`/`IOProvider` contract from
16
16
  [pluggable-io-framework-api](https://github.com/flowscripter/pluggable-io-framework-api)
17
17
  for the local filesystem - both source and sink.
18
+ - Factory for the `file` protocol with the `js` payload kind. Locations are
19
+ `file:` URLs (`file:///foo` or `file:/foo`) or bare paths, validated by
20
+ `filesystemLocationSchema` (`path`, plus an optional `filename` for a
21
+ single entry or a glob `pattern` for matching entries). `toProviderInputs`
22
+ joins `path` and `filename` with the OS path separator into a
23
+ `LocationTarget`.
18
24
  - Config: `{ rootPath?: string }` (validated with Zod) - `rootPath` is
19
25
  optional, defaulting to `""`. All paths passed to provider methods are
20
26
  resolved and sandboxed against `rootPath` - a path that would escape it is
21
27
  rejected. `rootPath: ""` (or omitted) is an explicit sentinel for "no
22
28
  restriction" (full filesystem access), since POSIX `"/"` isn't a
23
29
  meaningful "everything" root on Windows (multiple drive letters, no
24
- single filesystem root).
25
- - `list` (recursive, regex-filterable), `getProperties`/`setProperties`
26
- (size/lastModified/isFolder plus a `mode` extension property),
27
- `delete`, `createFolder`, plain readable/writable streams, and multipart
28
- read/write (concurrent byte-range parts written directly to file offsets
29
- via a single shared file handle) at a caller-supplied part size -
30
+ single filesystem root). Locations parsed from strings always use the
31
+ unrestricted config.
32
+ - `list` (recursive, regex-filterable), `getProperties`
33
+ (size/lastModified/isContainer plus a `mode` extension property),
34
+ `setProperties` (`lastModified` plus a `mode` property validated by
35
+ `filesystemSettablePropertySchema`), `delete`, `createContainer` and
36
+ `joinKey`.
37
+ - Readable handles implement `RangeReadable` (`readRange(start, end)` with
38
+ an exclusive `end`). Writable handles implement `ResumableWritable`:
39
+ resuming appends from the file's current size, reported as `startOffset`.
40
+ - Multipart writes (concurrent byte-range parts written directly to file
41
+ offsets via a single shared file handle) at a caller-supplied part size -
30
42
  `getPartSizeConstraints` reports unconstrained bounds with an 8MB default,
31
43
  since the local filesystem imposes no real part-size limits.
32
44
  - `canDirectTransfer`/`directCopy`/`directMove`: two `FilesystemIOProvider`
33
45
  instances with the same `rootPath` copy/move directly (`cp`/`rename`, with
34
46
  an `EXDEV` cross-device fallback to recursive copy+delete) instead of
35
- streaming. `supportsRecursiveDirectTransfer` is `true` - a folder
47
+ streaming. `supportsRecursiveDirectTransfer` is `true` - a directory
36
48
  `sourcePath` is copied/moved recursively in one `directCopy`/`directMove`
37
- call, preserving empty subfolders.
49
+ call, preserving empty subdirectories.
38
50
  - Bundled (`bun build --target bun`) as a single-file plugin, loaded by
39
51
  `dynamic-plugin-framework` via `import()` - proven end to end in this
40
52
  repo's tests via a real `LocalFolderPluginRepository`, not just
@@ -50,14 +62,18 @@
50
62
 
51
63
  Loaded as a [dynamic-plugin-framework](https://github.com/flowscripter/dynamic-plugin-framework)
52
64
  plugin - see that project's docs for how a host application discovers and
53
- instantiates plugins. Direct usage of the bundle:
65
+ instantiates plugins. Direct usage of the bundle, where `registry` is a
66
+ pluggable-io-framework `ProviderRegistry` (or any `ProviderResolver`):
54
67
 
55
68
  ```typescript
56
69
  import filesystemPlugin, {
57
70
  filesystemIOProviderFactory,
58
71
  } from "https://unpkg.com/@flowscripter/io-plugin-filesystem/dist/bundle.js";
59
72
 
60
- const provider = await filesystemIOProviderFactory.createProvider({ rootPath: "/data" });
73
+ const provider = await filesystemIOProviderFactory.createProvider(
74
+ { rootPath: "/data" },
75
+ { resolver: registry },
76
+ );
61
77
  ```
62
78
 
63
79
  ## Development
package/dist/bundle.js CHANGED
@@ -1,9 +1,9 @@
1
1
  // @bun
2
- function rt(e){let t=e.getReader();return new ReadableStream({async pull(r){let{done:n,value:o}=await t.read();if(n){r.close();return}r.enqueue({kind:"js",data:o})},cancel(r){return t.cancel(r)}})}var tr="@flowscripter/pluggable-io-framework/provider-factory";function ae(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 ot(e,t="|"){return e.map((r)=>ct(r)).join(t)}function le(e,t){if(typeof t==="bigint")return t.toString();return t}class rr{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;if(e!==void 0)this._value=e(),this._getter=void 0;return this._value}}function ze(e){return new rr(e)}function nr(e){return e===null||e===void 0}function $e(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function or(e,t){let r=e/t,n=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);if(Math.abs(r-n)<o)return 0;return r-n}function F(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ke(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function J(e){return ke(e._zod.def)??e._zod.def.shape}function ir(e,t,r){Object.defineProperty(e,t,{get(){let n=r();return F(this,t,n),n},enumerable:!0,configurable:!0})}function sr(e,t,r){if(t in e)F(e,t,r);else e[t]=r}function H(e,t,r,n){let o=J(t);for(let i of r){let s=Object.getOwnPropertyDescriptor(o,i);if(!s.enumerable)continue;if(s.get)ir(e,i,()=>{let c=t._zod.def.shape[i];return n?n(c,i):c});else sr(e,i,n?n(s.value,i):s.value)}}function Is(e,t){for(let r of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,r);if(!n.enumerable)continue;if(n.get)ir(e,r,()=>t[r]);else sr(e,r,n.value)}}function E(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function cr(e){return JSON.stringify(e)}function ur(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var it="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ue(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var ar=ze(()=>{if(A.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Q(e){if(ue(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let r=t.prototype;if(ue(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function st(e){if(Q(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}var lr=new Set(["string","number","symbol"]);function ee(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function M(e,t,r){let n=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)n._zod.parent=e;return 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 Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function ct(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function pr(e){return Object.keys(e).filter((t)=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var we=(()=>({safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]}))(),ut={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Cs(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i={};return H(i,e,Pe(e,t)),M(e,E(r,{shape:i,checks:[]}))}function Pe(e,t){let r=J(e),n=[];for(let o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,o)?.enumerable)throw Error(`Unrecognized key: "${String(o)}"`);if(t[o])n.push(o)}return n}function Es(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(Pe(e,t)),s={};return H(s,e,Reflect.ownKeys(J(e)).filter((c)=>!i.has(c))),M(e,E(r,{shape:s,checks:[]}))}function As(e,t){if(!Q(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=J(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return M(e,E(e._zod.def,{shape:fr(e,t)}))}function fr(e,t){let r={};return H(r,e,Reflect.ownKeys(J(e))),Is(r,t),r}function Ts(e,t){if(!Q(t))throw Error("Invalid input to safeExtend: expected a plain object");return M(e,E(e._zod.def,{shape:fr(e,t)}))}function Rs(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};H(r,e,Reflect.ownKeys(J(e))),H(r,t,Reflect.ownKeys(J(t)));let n=E(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return M(e,n)}function dr(e,t,r,n="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${n}() cannot be used on object schemas containing refinements`);let c=r?new Set(Pe(t,r)):void 0,u={};return H(u,t,Reflect.ownKeys(J(t)),e&&((a,p)=>c&&!c.has(p)?a:new e({type:"optional",innerType:a}))),M(t,E(t._zod.def,{shape:u,checks:[]}))}function Ns(e,t,r){let n=r?new Set(Pe(t,r)):void 0,o={};return H(o,t,Reflect.ownKeys(J(t)),(i,s)=>n&&!n.has(s)?i:new e({type:"nonoptional",innerType:i})),M(t,E(t._zod.def,{shape:o}))}function U(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 mr(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 Se(e,t){return t.map((r)=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function ce(e){return typeof e==="string"?e:e?.message}function at(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r)}function W(e,t,r){var n;let o=e.inst?._zod?.traits;if(o?.has("$ZodType"))if(o.has("$ZodCheck"))(n=e).schema??(n.schema=e.inst);else e.schema=e.inst;let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:ce(e.inst?._zod.def?.error?.(e))??ce(i?.(e))??ce(t?.error?.(e))??ce(r.customError?.(e))??ce(r.localeError?.(e))??"Invalid input",c={};for(let u of Object.keys(e)){if(u==="inst"||u==="schema"||u==="continue"||u==="input"||u==="__proto__")continue;c[u]=e[u]}if(c.path??(c.path=[]),c.message=s,t?.reportInput)c.input=e.input;return c}var Ds=/[\uD800-\uDBFF]/;function Ze(e){let t=e.length;if(!Ds.test(e))return t;let r=t;for(let n=0;n<t-1;n++)if((e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320)r--,n++;return r}function Oe(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function hr(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 X(...e){let[t,r,n]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:n};return{...t}}function gr(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);if(n.get)Object.defineProperty(e,r,{...n,enumerable:!1});else js(e,r,n.value)}}function B(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function Ie(e,t,r){return B(e,t,r,!1)}function _r(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return B(this,r,n(this))},set(o){B(this,r,o)}})}return t}function js(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:B(this,t,r.bind(this))},set(n){B(this,t,n)}})}function Ls(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var nt,V=!1,Fs={configurable:!0,get(){V=!0;return}};function x(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&nt!==e._zod){nt=void 0;return}nt=e._zod,Object.defineProperty(n,t,{configurable:!0,get(){Object.defineProperty(this,t,Fs);let o=V;V=!1;try{let i=r(this);if(V)delete this[t];else Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i});return V=V||o,i}catch(i){throw delete this[t],V=V||o,i}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function Ms(e,t,r,n){let o=Ls(e,t);if(!o)return;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 Us="~constantCatch";function yr(e){let t=()=>e;return t[Us]=!0,t}var xr;var lt={value:void 0,enumerable:!1},br="captureStackTrace"in Error?Error:null;function Ks(e){let t=br;if(t){let r=t.stackTraceLimit;if(typeof r==="number"){try{t.stackTraceLimit=0}catch{return br=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function l(e,t,r,n){let o={};function i(d){this.def=d,this.constr=f,this.traits=new Set}i.prototype=o;let s=r,c=s&&new WeakSet;function u(d,m){if(!d._zod){lt.value=new i(m);try{Object.defineProperty(d,"_zod",lt)}finally{lt.value=void 0}}else if(d._zod.traits.has(e))return;if(d._zod.traits.add(e),t(d,m),c){let y=Object.getPrototypeOf(d),_=d._zod.constr.prototype,b=y;while(b&&b!==_)b=Object.getPrototypeOf(b);let j=b??y;if(!c.has(j))c.add(j),gr(j,s)}let h=f.prototype;for(let y in h){if(!Object.prototype.hasOwnProperty.call(h,y))continue;if(!(y in d))d[y]=h[y].bind(d)}}let a=n?.Parent??Object;class p extends a{}Object.defineProperty(p,"name",{value:e});function f(d){let m=n?.Parent?Ks(p):this;u(m,d);let h=m._zod.deferred;if(h){for(let _ of h)_();m._zod.deferred=void 0}let y=globalThis.__zod_globalConfig?.postProcessor;if(y)y(m);return m}return Object.defineProperty(f,"init",{value:u}),Object.defineProperty(f,Symbol.hasInstance,{value:(d)=>{if(n?.Parent&&d instanceof n.Parent)return!0;return d?._zod?.traits?.has(e)}}),Object.defineProperty(f,"name",{value:e}),f}class K extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class pe extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(xr=globalThis).__zod_globalConfig??(xr.__zod_globalConfig={});var A=globalThis.__zod_globalConfig;function N(e){if(e)Object.assign(A,e);return A}function Js(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,le,2)),e.message}function Bs(e){this._zod.message=e}var Vs={get:Js,set:Bs,enumerable:!0,configurable:!0},ft={value:void 0,enumerable:!1},vr=new WeakSet([Object.prototype,Error.prototype]),zr=(e,t)=>{e.name="$ZodError",ft.value=t,Object.defineProperty(e,"issues",ft),ft.value=void 0,Object.defineProperty(e,"message",Vs);let r=Object.getPrototypeOf(e);if(!vr.has(r))vr.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})}})},$r=l("$ZodError",zr),aa=l("$ZodError",zr,void 0,{Parent:Error});function Ws(e,t,r){if(!Object.prototype.hasOwnProperty.call(e,t))if(t==="__proto__")Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0});else e[t]=r();return e[t]}function kr(e,t=(r)=>r.message){let r={},n=[];for(let o of e.issues)if(o.path.length>0)Ws(r,o.path[0],()=>[]).push(t(o));else n.push(t(o));return{formErrors:n,fieldErrors:r}}function wr(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;while(a<c.length){let p=c[a],f=a===c.length-1;if(p==="_errors"){if(f)u._errors.push(t(s));a++;continue}if(!Object.prototype.hasOwnProperty.call(u,p))Object.defineProperty(u,p,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let d=u[p];if(f)d._errors.push(t(s));u=d,a++}}}};return n(e),r}function Ce(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Ee=(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 K;if(c.issues.length){let u=new(i?.Err??e)(c.issues.map((a)=>W(a,s,N())));throw it(u,i?.callee??t),u}return c.value};return t};var Ae=(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;if(c.issues.length){let u=new(i?.Err??e)(c.issues.map((a)=>W(a,s,N())));throw it(u,i?.callee??t),u}return c.value};return t};var Te=(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 K;return i.issues.length?Pr(e,i.issues,o):{success:!0,data:i.value}};function Pr(e,t,r){let n;return{success:!1,get error(){if(!n)n=new e(t.map((o)=>W(o,r,N()))),t=void 0,r=void 0;return n},set error(o){n=o,t=void 0,r=void 0}}}var Re=(e)=>async(t,r,n)=>{let o=n?{...n,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)i=await i;return i.issues.length?Pr(e,i.issues,o):{success:!0,data:i.value}};var Gs=Symbol.for("zod.compile.invalid"),Hs=Symbol.for("zod.compile.fallback"),dt=(e,t,r)=>{let n=e._zod.bag.validator;if(n!==void 0){if(n(t)!==Gs)return!0;if(n.definite===!0&&r===void 0)return!1}return Xs(e,t,r)};function Xs(e,t,r){let n=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun,i;if(o)n[Hs]=!0,i=o({value:t,issues:[]},n);else i=e._zod.run({value:t,issues:[]},n);if(i instanceof Promise)throw new K;return i.issues.length===0}var mt=async(e,t,r)=>{let n=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},o=e._zod.run({value:t,issues:[]},n);if(o instanceof Promise)o=await o;return o.issues.length===0},Sr=(e)=>{let t=Ee(e),r=(n,o,i,s)=>{let c=i?{...i,direction:"backward"}:{direction:"backward"};return t(n,o,c,Ce(r,s))};return r};var Zr=(e)=>{let t=Ee(e),r=(n,o,i,s)=>t(n,o,i,Ce(r,s));return r};var Or=(e)=>{let t=Ae(e),r=async(n,o,i,s)=>{let c=i?{...i,direction:"backward"}:{direction:"backward"};return await t(n,o,c,Ce(r,s))};return r};var Ir=(e)=>{let t=Ae(e),r=async(n,o,i,s)=>await t(n,o,i,Ce(r,s));return r};var Cr=(e)=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Te(e)(t,r,o)};var Er=(e)=>(t,r,n)=>Te(e)(t,r,n);var Ar=(e)=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Re(e)(t,r,o)};var Tr=(e)=>async(t,r,n)=>Re(e)(t,r,n);var Rr=/^[cC][0-9a-z]{6,}$/,Nr=/^[0-9a-z]+$/,Dr=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,jr=/^[0-9a-vA-V]{20}$/,Lr=/^[A-Za-z0-9]{27}$/,Fr=/^[a-zA-Z0-9_-]{21}$/;function Mr(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Ur=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Kr=/^([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})$/,gt=(e)=>{if(!e)return/^([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)$/;return 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})$`)};var Jr=/^(?:[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 Ys="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Br(){return new RegExp(Ys,"u")}var Vr=/^(?:(?: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])$/,Wr=/^(([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 Gr=/^((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])$/,Hr=/^(([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])$/,Xr=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Yr=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var qr=/^https?$/,Qr=/^\+[1-9]\d{6,14}$/;var en="(?:(?:\\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 qs(e){return new RegExp(`^${e}$`)}var tn=qs(en);function ht(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?":"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function rn(e){return new RegExp(`^${ht(e)}$`)}function nn(e){let t=["Z"];if(e.offset)t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${ht({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,n=e.local?`${r}|${ht({precision:e.precision})}`:r;return new RegExp(`^${en}T(?:${n})$`)}var on=/^[\s\S]{0,}$/;var _t=/^-?\d+(?:\.\d+)?$/;var sn=/^[^A-Z]*$/,cn=/^[^a-z]*$/;var O=l("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var yt=(e)=>{let t=e.value;return!nr(t)&&t.length!==void 0},Ne={number:"number",bigint:"bigint",object:"date"},xt=l("$ZodCheckLessThan",(e,t)=>{O.init(e,t);let r=Ne[typeof t.value];e._zod.check=(n)=>{if(t.inclusive?n.value<=t.value:n.value<t.value)return;n.issues.push({origin:Ne[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})}}),bt=l("$ZodCheckGreaterThan",(e,t)=>{O.init(e,t);let r=Ne[typeof t.value];e._zod.check=(n)=>{if(t.inclusive?n.value>=t.value:n.value>t.value)return;n.issues.push({origin:Ne[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})}}),un=l("$ZodCheckMultipleOf",(e,t)=>{O.init(e,t),e._zod.check=(r)=>{if(typeof r.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof r.value==="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):or(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),an=l("$ZodCheckNumberFormat",(e,t)=>{O.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=we[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)){if(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});else 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}}if(c<o)s.issues.push({origin:"number",input:c,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort});if(c>i)s.issues.push({origin:"number",input:c,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}});var ln=l("$ZodCheckMaxLength",(e,t)=>{var r;O.init(e,t),(r=e._zod.def).when??(r.when=yt),e._zod.check=(n)=>{let o=n.value,i=o.length;if((typeof o==="string"&&i>t.maximum?Ze(o):i)<=t.maximum)return;let c=Oe(o);n.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),pn=l("$ZodCheckMinLength",(e,t)=>{var r;O.init(e,t),(r=e._zod.def).when??(r.when=yt),e._zod.check=(n)=>{let o=n.value,i=o.length;if((typeof o==="string"&&i>=t.minimum&&i<t.minimum*2?Ze(o):i)>=t.minimum)return;let c=Oe(o);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),fn=l("$ZodCheckLengthEquals",(e,t)=>{var r;O.init(e,t),(r=e._zod.def).when??(r.when=yt),e._zod.check=(n)=>{let o=n.value,i=o.length,s=typeof o==="string"&&i>=t.length&&i<=t.length*2?Ze(o):i;if(s===t.length)return;let c=Oe(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})}}),de=l("$ZodCheckStringFormat",(e,t)=>{var r,n;if(O.init(e,t),t.pattern)(r=e._zod).check??(r.check=(o)=>{if(t.pattern.lastIndex=0,t.pattern.test(o.value))return;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})});else(n=e._zod).check??(n.check=()=>{})}),dn=l("$ZodCheckRegex",(e,t)=>{de.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),mn=l("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=sn),de.init(e,t)}),hn=l("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=cn),de.init(e,t)}),gn=l("$ZodCheckIncludes",(e,t)=>{O.init(e,t);let r=ee(t.includes),n=new RegExp(typeof t.position==="number"?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.check=(o)=>{if(o.value.includes(t.includes,t.position))return;o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),_n=l("$ZodCheckStartsWith",(e,t)=>{O.init(e,t);let r=new RegExp(`^${ee(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=(n)=>{if(n.value.startsWith(t.prefix))return;n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),yn=l("$ZodCheckEndsWith",(e,t)=>{O.init(e,t);let r=new RegExp(`.*${ee(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=(n)=>{if(n.value.endsWith(t.suffix))return;n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});var xn=l("$ZodCheckOverwrite",(e,t)=>{O.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class vt{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
3
- `).filter((i)=>i),n=Math.min(...r.map((i)=>i.length-i.trimStart().length)),o=r.map((i)=>i.slice(n)).map((i)=>" ".repeat(this.indent*2)+i);for(let i of o)this.content.push(i)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
2
+ var pr="@flowscripter/pluggable-io-framework/provider-factory";function fr(e){let t=e.getReader();return new ReadableStream({async pull(r){let{done:o,value:n}=await t.read();if(o){r.close();return}r.enqueue({payload:{kind:"js",data:n}})},cancel(r){return t.cancel(r)}})}import{chmod as Qa,cp as Rs,mkdir as rr,rename as eu,rm as Cs,utimes as tu}from"fs/promises";import{join as rt,resolve as ru}from"path";import{resolve as it,sep as dr}from"path";function E(e,t){if(e==="")return it(t);let r=it(e),o=it(r,t),n=r.endsWith(dr)?r:r+dr;if(o!==r&&!o.startsWith(n))throw Error(`Path "${t}" resolves outside provider root "${e}"`);return o}function ue(e){let t=Object.values(e).filter((o)=>typeof o==="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function ct(e,t="|"){return e.map((r)=>lt(r)).join(t)}function le(e,t){if(typeof t==="bigint")return t.toString();return t}class mr{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;if(e!==void 0)this._value=e(),this._getter=void 0;return this._value}}function Pe(e){return new mr(e)}function hr(e){return e===null||e===void 0}function ze(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function yr(e,t){let r=e/t,o=Math.round(r),n=4*Number.EPSILON*Math.max(Math.abs(r),1);if(Math.abs(r-o)<n)return 0;return r-o}function j(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function $e(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function J(e){return $e(e._zod.def)??e._zod.def.shape}function gr(e,t,r){Object.defineProperty(e,t,{get(){let o=r();return j(this,t,o),o},enumerable:!0,configurable:!0})}function _r(e,t,r){if(t in e)j(e,t,r);else e[t]=r}function G(e,t,r,o){let n=J(t);for(let i of r){let s=Object.getOwnPropertyDescriptor(n,i);if(!s.enumerable)continue;if(s.get)gr(e,i,()=>{let c=t._zod.def.shape[i];return o?o(c,i):c});else _r(e,i,o?o(s.value,i):s.value)}}function Ks(e,t){for(let r of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,r);if(!o.enumerable)continue;if(o.get)gr(e,r,()=>t[r]);else _r(e,r,o.value)}}function T(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function xr(e){return JSON.stringify(e)}function br(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var at="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ae(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var vr=Pe(()=>{if(A.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function ee(e){if(ae(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let r=t.prototype;if(ae(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function ut(e){if(ee(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}var Pr=new Set(["string","number","symbol"]);function te(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function F(e,t,r){let o=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)o._zod.parent=e;return o}function y(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 Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function lt(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function zr(e){return Object.keys(e).filter((t)=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var we=(()=>({safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]}))(),pt={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Ls(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i={};return G(i,e,ke(e,t)),F(e,T(r,{shape:i,checks:[]}))}function ke(e,t){let r=J(e),o=[];for(let n of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,n)?.enumerable)throw Error(`Unrecognized key: "${String(n)}"`);if(t[n])o.push(n)}return o}function js(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(ke(e,t)),s={};return G(s,e,Reflect.ownKeys(J(e)).filter((c)=>!i.has(c))),F(e,T(r,{shape:s,checks:[]}))}function Fs(e,t){if(!ee(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let n=J(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,i)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return F(e,T(e._zod.def,{shape:$r(e,t)}))}function $r(e,t){let r={};return G(r,e,Reflect.ownKeys(J(e))),Ks(r,t),r}function Ms(e,t){if(!ee(t))throw Error("Invalid input to safeExtend: expected a plain object");return F(e,T(e._zod.def,{shape:$r(e,t)}))}function Us(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};G(r,e,Reflect.ownKeys(J(e))),G(r,t,Reflect.ownKeys(J(t)));let o=T(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return F(e,o)}function wr(e,t,r,o="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${o}() cannot be used on object schemas containing refinements`);let c=r?new Set(ke(t,r)):void 0,a={};return G(a,t,Reflect.ownKeys(J(t)),e&&((u,p)=>c&&!c.has(p)?u:new e({type:"optional",innerType:u}))),F(t,T(t._zod.def,{shape:a,checks:[]}))}function Js(e,t,r){let o=r?new Set(ke(t,r)):void 0,n={};return G(n,t,Reflect.ownKeys(J(t)),(i,s)=>o&&!o.has(s)?i:new e({type:"nonoptional",innerType:i})),F(t,T(t._zod.def,{shape:n}))}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 kr(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 Se(e,t){return t.map((r)=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function ce(e){return typeof e==="string"?e:e?.message}function ft(e,t,r){var o;for(let n=t;n<e.length;n++)(o=e[n]).schema??(o.schema=r)}function V(e,t,r){var o;let n=e.inst?._zod?.traits;if(n?.has("$ZodType"))if(n.has("$ZodCheck"))(o=e).schema??(o.schema=e.inst);else e.schema=e.inst;let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:ce(e.inst?._zod.def?.error?.(e))??ce(i?.(e))??ce(t?.error?.(e))??ce(r.customError?.(e))??ce(r.localeError?.(e))??"Invalid input",c={};for(let a of Object.keys(e)){if(a==="inst"||a==="schema"||a==="continue"||a==="input"||a==="__proto__")continue;c[a]=e[a]}if(c.path??(c.path=[]),c.message=s,t?.reportInput)c.input=e.input;return c}var Bs=/[\uD800-\uDBFF]/;function Ze(e){let t=e.length;if(!Bs.test(e))return t;let r=t;for(let o=0;o<t-1;o++)if((e.charCodeAt(o)&64512)===55296&&(e.charCodeAt(o+1)&64512)===56320)r--,o++;return r}function Oe(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function Sr(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 X(...e){let[t,r,o]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:o};return{...t}}function Zr(e,t){for(let r in t){let o=Object.getOwnPropertyDescriptor(t,r);if(o.get)Object.defineProperty(e,r,{...o,enumerable:!1});else Ws(e,r,o.value)}}function B(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function Ie(e,t,r){return B(e,t,r,!1)}function Or(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return B(this,r,o(this))},set(n){B(this,r,n)}})}return t}function Ws(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:B(this,t,r.bind(this))},set(o){B(this,t,o)}})}function Vs(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var st,W=!1,Hs={configurable:!0,get(){W=!0;return}};function x(e,t,r){let o=Object.getPrototypeOf(e._zod);if(t in o&&st!==e._zod){st=void 0;return}st=e._zod,Object.defineProperty(o,t,{configurable:!0,get(){Object.defineProperty(this,t,Hs);let n=W;W=!1;try{let i=r(this);if(W)delete this[t];else Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i});return W=W||n,i}catch(i){throw delete this[t],W=W||n,i}},set(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})}function Gs(e,t,r,o){let n=Vs(e,t);if(!n)return;Object.defineProperty(n,t,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:o,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:o,value:i})}})}var Xs="~constantCatch";function Ir(e){let t=()=>e;return t[Xs]=!0,t}var Er;var dt={value:void 0,enumerable:!1},Tr="captureStackTrace"in Error?Error:null;function Ys(e){let t=Tr;if(t){let r=t.stackTraceLimit;if(typeof r==="number"){try{t.stackTraceLimit=0}catch{return Tr=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function l(e,t,r,o){let n={};function i(d){this.def=d,this.constr=f,this.traits=new Set}i.prototype=n;let s=r,c=s&&new WeakSet;function a(d,m){if(!d._zod){dt.value=new i(m);try{Object.defineProperty(d,"_zod",dt)}finally{dt.value=void 0}}else if(d._zod.traits.has(e))return;if(d._zod.traits.add(e),t(d,m),c){let _=Object.getPrototypeOf(d),g=d._zod.constr.prototype,b=_;while(b&&b!==g)b=Object.getPrototypeOf(b);let K=b??_;if(!c.has(K))c.add(K),Zr(K,s)}let h=f.prototype;for(let _ in h){if(!Object.prototype.hasOwnProperty.call(h,_))continue;if(!(_ in d))d[_]=h[_].bind(d)}}let u=o?.Parent??Object;class p extends u{}Object.defineProperty(p,"name",{value:e});function f(d){let m=o?.Parent?Ys(p):this;a(m,d);let h=m._zod.deferred;if(h){for(let g of h)g();m._zod.deferred=void 0}let _=globalThis.__zod_globalConfig?.postProcessor;if(_)_(m);return m}return Object.defineProperty(f,"init",{value:a}),Object.defineProperty(f,Symbol.hasInstance,{value:(d)=>{if(o?.Parent&&d instanceof o.Parent)return!0;return d?._zod?.traits?.has(e)}}),Object.defineProperty(f,"name",{value:e}),f}class U extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class pe extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(Er=globalThis).__zod_globalConfig??(Er.__zod_globalConfig={});var A=globalThis.__zod_globalConfig;function N(e){if(e)Object.assign(A,e);return A}function qs(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,le,2)),e.message}function Qs(e){this._zod.message=e}var ec={get:qs,set:Qs,enumerable:!0,configurable:!0},ht={value:void 0,enumerable:!1},Ar=new WeakSet([Object.prototype,Error.prototype]),Rr=(e,t)=>{e.name="$ZodError",ht.value=t,Object.defineProperty(e,"issues",ht),ht.value=void 0,Object.defineProperty(e,"message",ec);let r=Object.getPrototypeOf(e);if(!Ar.has(r))Ar.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let o=()=>this.message;return Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0})}})},Cr=l("$ZodError",Rr),dl=l("$ZodError",Rr,void 0,{Parent:Error});function tc(e,t,r){if(!Object.prototype.hasOwnProperty.call(e,t))if(t==="__proto__")Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0});else e[t]=r();return e[t]}function Nr(e,t=(r)=>r.message){let r={},o=[];for(let n of e.issues)if(n.path.length>0)tc(r,n.path[0],()=>[]).push(t(n));else o.push(t(n));return{formErrors:o,fieldErrors:r}}function Dr(e,t=(r)=>r.message){let r={_errors:[]},o=(n,i=[])=>{for(let s of n.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map((c)=>o({issues:c},[...i,...s.path]));else if(s.code==="invalid_key")o({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")o({issues:s.issues},[...i,...s.path]);else{let c=[...i,...s.path];if(c.length===0)r._errors.push(t(s));else{let a=r,u=0;while(u<c.length){let p=c[u],f=u===c.length-1;if(p==="_errors"){if(f)a._errors.push(t(s));u++;continue}if(!Object.prototype.hasOwnProperty.call(a,p))Object.defineProperty(a,p,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let d=a[p];if(f)d._errors.push(t(s));a=d,u++}}}};return o(e),r}function Ee(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Te=(e)=>{let t=(r,o,n,i)=>{let s=n?{...n,async:!1}:{async:!1},c=r._zod.run({value:o,issues:[]},s);if(c instanceof Promise)throw new U;if(c.issues.length){let a=new(i?.Err??e)(c.issues.map((u)=>V(u,s,N())));throw at(a,i?.callee??t),a}return c.value};return t};var Ae=(e)=>{let t=async(r,o,n,i)=>{let s=n?{...n,async:!0}:{async:!0},c=r._zod.run({value:o,issues:[]},s);if(c instanceof Promise)c=await c;if(c.issues.length){let a=new(i?.Err??e)(c.issues.map((u)=>V(u,s,N())));throw at(a,i?.callee??t),a}return c.value};return t};var Re=(e)=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new U;return i.issues.length?Kr(e,i.issues,n):{success:!0,data:i.value}};function Kr(e,t,r){let o;return{success:!1,get error(){if(!o)o=new e(t.map((n)=>V(n,r,N()))),t=void 0,r=void 0;return o},set error(n){o=n,t=void 0,r=void 0}}}var Ce=(e)=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)i=await i;return i.issues.length?Kr(e,i.issues,n):{success:!0,data:i.value}};var rc=Symbol.for("zod.compile.invalid"),oc=Symbol.for("zod.compile.fallback"),yt=(e,t,r)=>{let o=e._zod.bag.validator;if(o!==void 0){if(o(t)!==rc)return!0;if(o.definite===!0&&r===void 0)return!1}return nc(e,t,r)};function nc(e,t,r){let o=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},n=e._zod.bag.fallbackRun,i;if(n)o[oc]=!0,i=n({value:t,issues:[]},o);else i=e._zod.run({value:t,issues:[]},o);if(i instanceof Promise)throw new U;return i.issues.length===0}var gt=async(e,t,r)=>{let o=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},n=e._zod.run({value:t,issues:[]},o);if(n instanceof Promise)n=await n;return n.issues.length===0},Lr=(e)=>{let t=Te(e),r=(o,n,i,s)=>{let c=i?{...i,direction:"backward"}:{direction:"backward"};return t(o,n,c,Ee(r,s))};return r};var jr=(e)=>{let t=Te(e),r=(o,n,i,s)=>t(o,n,i,Ee(r,s));return r};var Fr=(e)=>{let t=Ae(e),r=async(o,n,i,s)=>{let c=i?{...i,direction:"backward"}:{direction:"backward"};return await t(o,n,c,Ee(r,s))};return r};var Mr=(e)=>{let t=Ae(e),r=async(o,n,i,s)=>await t(o,n,i,Ee(r,s));return r};var Ur=(e)=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Re(e)(t,r,n)};var Jr=(e)=>(t,r,o)=>Re(e)(t,r,o);var Br=(e)=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Ce(e)(t,r,n)};var Wr=(e)=>async(t,r,o)=>Ce(e)(t,r,o);var Vr=/^[cC][0-9a-z]{6,}$/,Hr=/^[0-9a-z]+$/,Gr=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Xr=/^[0-9a-vA-V]{20}$/,Yr=/^[A-Za-z0-9]{27}$/,qr=/^[a-zA-Z0-9_-]{21}$/;function Qr(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var eo=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var to=/^([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})$/,xt=(e)=>{if(!e)return/^([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)$/;return 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})$`)};var ro=/^(?:[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 oo(){return new RegExp(ic,"u")}var no=/^(?:(?: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])$/,io=/^(([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 so=/^((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])$/,co=/^(([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])$/,ao=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,uo=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var lo=/^https?$/,po=/^\+[1-9]\d{6,14}$/;var fo="(?:(?:\\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 sc(e){return new RegExp(`^${e}$`)}var mo=sc(fo);function _t(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?":"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function ho(e){return new RegExp(`^${_t(e)}$`)}function yo(e){let t=["Z"];if(e.offset)t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${_t({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,o=e.local?`${r}|${_t({precision:e.precision})}`:r;return new RegExp(`^${fo}T(?:${o})$`)}var go=/^[\s\S]{0,}$/;var bt=/^-?\d+(?:\.\d+)?$/;var _o=/^[^A-Z]*$/,xo=/^[^a-z]*$/;var O=l("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var vt=(e)=>{let t=e.value;return!hr(t)&&t.length!==void 0},Ne={number:"number",bigint:"bigint",object:"date"},Pt=l("$ZodCheckLessThan",(e,t)=>{O.init(e,t);let r=Ne[typeof t.value];e._zod.check=(o)=>{if(t.inclusive?o.value<=t.value:o.value<t.value)return;o.issues.push({origin:Ne[typeof o.value]??r,code:"too_big",maximum:typeof t.value==="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),zt=l("$ZodCheckGreaterThan",(e,t)=>{O.init(e,t);let r=Ne[typeof t.value];e._zod.check=(o)=>{if(t.inclusive?o.value>=t.value:o.value>t.value)return;o.issues.push({origin:Ne[typeof o.value]??r,code:"too_small",minimum:typeof t.value==="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),bo=l("$ZodCheckMultipleOf",(e,t)=>{O.init(e,t),e._zod.check=(r)=>{if(typeof r.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof r.value==="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):yr(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),vo=l("$ZodCheckNumberFormat",(e,t)=>{O.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,i]=we[t.format];e._zod.check=(s)=>{let c=s.value;if(r){if(!Number.isInteger(c)){s.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){if(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:o,inclusive:!0,continue:!t.abort});else 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:o,inclusive:!0,continue:!t.abort});return}}if(c<n)s.issues.push({origin:"number",input:c,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort});if(c>i)s.issues.push({origin:"number",input:c,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}});var Po=l("$ZodCheckMaxLength",(e,t)=>{var r;O.init(e,t),(r=e._zod.def).when??(r.when=vt),e._zod.check=(o)=>{let n=o.value,i=n.length;if((typeof n==="string"&&i>t.maximum?Ze(n):i)<=t.maximum)return;let c=Oe(n);o.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),zo=l("$ZodCheckMinLength",(e,t)=>{var r;O.init(e,t),(r=e._zod.def).when??(r.when=vt),e._zod.check=(o)=>{let n=o.value,i=n.length;if((typeof n==="string"&&i>=t.minimum&&i<t.minimum*2?Ze(n):i)>=t.minimum)return;let c=Oe(n);o.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),$o=l("$ZodCheckLengthEquals",(e,t)=>{var r;O.init(e,t),(r=e._zod.def).when??(r.when=vt),e._zod.check=(o)=>{let n=o.value,i=n.length,s=typeof n==="string"&&i>=t.length&&i<=t.length*2?Ze(n):i;if(s===t.length)return;let c=Oe(n),a=s>t.length;o.issues.push({origin:c,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),de=l("$ZodCheckStringFormat",(e,t)=>{var r,o;if(O.init(e,t),t.pattern)(r=e._zod).check??(r.check=(n)=>{if(t.pattern.lastIndex=0,t.pattern.test(n.value))return;n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(o=e._zod).check??(o.check=()=>{})}),wo=l("$ZodCheckRegex",(e,t)=>{de.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ko=l("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=_o),de.init(e,t)}),So=l("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=xo),de.init(e,t)}),Zo=l("$ZodCheckIncludes",(e,t)=>{O.init(e,t);let r=te(t.includes),o=new RegExp(typeof t.position==="number"?`^.{${t.position},}${r}`:r);t.pattern=o,e._zod.check=(n)=>{if(n.value.includes(t.includes,t.position))return;n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Oo=l("$ZodCheckStartsWith",(e,t)=>{O.init(e,t);let r=new RegExp(`^${te(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=(o)=>{if(o.value.startsWith(t.prefix))return;o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Io=l("$ZodCheckEndsWith",(e,t)=>{O.init(e,t);let r=new RegExp(`.*${te(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=(o)=>{if(o.value.endsWith(t.suffix))return;o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var Eo=l("$ZodCheckOverwrite",(e,t)=>{O.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class $t{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
3
+ `).filter((i)=>i),o=Math.min(...r.map((i)=>i.length-i.trimStart().length)),n=r.map((i)=>i.slice(o)).map((i)=>" ".repeat(this.indent*2)+i);for(let i of n)this.content.push(i)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
4
4
  ${t.join(`
5
5
  `)}
6
- };`)(...Object.values(this.closed))}}var vn={major:4,minor:6,patch:5};var w=l("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=vn;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 p=U(c),f;for(let d of u){if(d._zod.def.when){if(mr(c))continue;if(!d._zod.def.when(c))continue}else if(p)continue;let m=c.issues.length,h=d._zod.check(c);if(h instanceof Promise&&a?.async===!1)throw new K;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{if(await h,c.issues.length===m)return;if(at(c.issues,m,e),!p)p=U(c,m)});else{if(c.issues.length===m)continue;if(at(c.issues,m,e),!p)p=U(c,m)}}if(f)return f.then(()=>c);return c},s=(c,u,a)=>{if(U(c))return c.aborted=!0,c;let p=i(u,o,a);if(p instanceof Promise){if(a.async===!1)throw new K;return p.then((f)=>e._zod.parse(f,a))}return e._zod.parse(p,a)};e._zod.run=(c,u)=>{if(u.skipChecks)return e._zod.parse(c,u);if(u.direction==="backward"){let p=e._zod.parse({value:c.value,issues:[]},{...u,skipChecks:!0});if(p instanceof Promise)return p.then((f)=>s(f,c,u));return s(p,c,u)}let a=e._zod.parse(c,u);if(a instanceof Promise){if(u.async===!1)throw new K;return a.then((p)=>i(p,o,u))}return i(a,o,u)}}},{get "~standard"(){return Ie(this,"~standard",$t(this))},set "~standard"(e){B(this,"~standard",e)}}),En=(e,t)=>e.issues.length?{issues:e.issues.map((r)=>W(r,t,N()))}:{value:e.value};async function ec(e,t){let r={async:!0};return En(await e._zod.run({value:t,issues:[]},r),r)}function $t(e){return{validate:(t)=>{let r={async:!1};try{let n=e._zod.run({value:t,issues:[]},r);if(!(n instanceof Promise))return En(n,r)}catch(n){}return ec(e,t)},vendor:"zod",version:1}}var Fe=l("$ZodString",(e,t)=>{w.init(e,t),e._zod.pattern=t.pattern??on,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(o){}if(typeof r.value==="string")return r;return r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),z=l("$ZodStringFormat",(e,t)=>{de.init(e,t),Fe.init(e,t)}),An=l("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Kr),z.init(e,t)}),Tn=l("$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 Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=gt(n))}else t.pattern??(t.pattern=gt());z.init(e,t)}),Rn=l("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Jr),z.init(e,t)}),Nn=1,je=2;function Dn(e){try{if(typeof URL<"u"&&typeof URL.canParse==="function")return URL.canParse(e);return new URL(e),!0}catch{return!1}}function tc(e,t){if(!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t))return Dn(e)||je;return rc(e,t)}function rc(e,t){if(!t.normalize&&t.protocol?.source===qr.source&&!/^https?:\/\//i.test(e))return Nn;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse==="function")return r.parse(e)??je}return new URL(e)}catch{return je}}var nc=/[\t\n\r]/g;function zn(e){return e.replace(nc,"")}function oc(e,t){return t.lastIndex=0,t.test(e.hostname)}function ic(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var jn=l("$ZodURL",(e,t)=>{z.init(e,t),e._zod.check=(r)=>{try{let n=r.value.trim(),o=tc(n,t);if(o===Nn){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(o===je){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(o===!0){r.value=zn(n);return}if(t.hostname&&!oc(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});if(t.protocol&&!ic(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:zn(n);return}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Ln=l("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Br()),z.init(e,t)}),Fn=l("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?Fr:Mr(t.length)),z.init(e,t)}),Mn=l("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Rr),z.init(e,t)}),Un=l("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Nr),z.init(e,t)}),Kn=l("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Dr),z.init(e,t)}),Jn=l("$ZodXID",(e,t)=>{t.pattern??(t.pattern=jr),z.init(e,t)}),Bn=l("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Lr),z.init(e,t)}),Vn=l("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=nn(t)),z.init(e,t)}),Wn=l("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=tn),z.init(e,t)}),Gn=l("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=rn(t)),z.init(e,t)}),Hn=l("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ur),z.init(e,t)}),Xn=l("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Vr),z.init(e,t)}),sc=/^[0-9a-fA-F:.]+$/;function Yn(e){if(!sc.test(e))return!1;return Dn(`http://[${e}]`)}var qn=l("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Wr),z.init(e,t),e._zod.check=(r)=>{if(!Yn(r.value))r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}});var Qn=l("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Gr),z.init(e,t)});function cc(e){let t=e.split("/");if(t.length!==2)return!1;let[r,n]=t;if(!n)return!1;let o=Number(n);if(`${o}`!==n)return!1;if(o<0||o>128)return!1;return Yn(r)}var eo=l("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Hr),z.init(e,t),e._zod.check=(r)=>{if(!cc(r.value))r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function to(e){if(e==="")return!0;if(/\s/.test(e))return!1;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var kt=/^[0-9a-zA-Z+/]*={0,2}$/,ro=l("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=kt),z.init(e,t),e._zod.check=(r)=>{if(to(r.value))return;r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),Me=/^[A-Za-z0-9_-]*$/;function uc(e){if(!Me.test(e))return!1;let t=e.replace(/[-_]/g,(n)=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return to(r)}var no=l("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Me),z.init(e,t),e._zod.check=(r)=>{if(uc(r.value))return;r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),oo=l("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Qr),z.init(e,t)});function ac(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));if("typ"in o&&o?.typ!=="JWT")return!1;if(!o.alg)return!1;if(t&&(!("alg"in o)||o.alg!==t))return!1;return!0}catch{return!1}}var io=l("$ZodJWT",(e,t)=>{z.init(e,t),e._zod.check=(r)=>{if(ac(r.value,t.alg))return;r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var wt=l("$ZodNumber",(e,t)=>{w.init(e,t),e._zod.pattern=_t,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch(s){}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)?String(o):void 0:void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),r}}),so=l("$ZodNumberFormat",(e,t)=>{an.init(e,t),wt.init(e,t)});var co=l("$ZodUnknown",(e,t)=>{w.init(e,t),e._zod.parse=(r)=>r}),uo=l("$ZodNever",(e,t)=>{w.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function $n(e,t,r){if(e.issues.length)t.issues.push(...Se(r,e.issues));t.value[r]=e.value}var ao=l("$ZodArray",(e,t)=>{w.init(e,t);let r=A.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],p=t.element._zod.run({value:a,issues:[]},o);if(p instanceof Promise)s.push(p.then((f)=>$n(f,n,u)));else if($n(p,n,u),c&&p.issues.length!==0&&U(p))break}if(s.length)return Promise.all(s).then(()=>n);return n}});function Le(e,t,r,n,o,i){let s=r in n,c=i==="optional";if(!s&&c&&o==="optional")return;if(e.issues.length){if(o!==void 0&&c&&!s)return;t.issues.push(...Se(r,e.issues))}if(!s&&o===void 0){if(!e.issues.length)t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}if(e.value===void 0){if(s||o==="defaulted"&&!c)t.value[r]=void 0}else t.value[r]=e.value}var lc=[];function lo(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:lc,o=n.length?[...t,...n]:t;for(let s of o)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(s)}": expected a Zod schema`);let i=pr(e.shape);return{...e,allKeys:o,symbolKeys:n,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function po(e,t,r,n,o,i,s){let c=[],u=o.keySet,a=o.catchall._zod,p=a.def.type,{optin:f,optout:d}=a,m=0;for(let h in t){if(s&&r.issues.length!==m){if(U(r,m))break;m=r.issues.length}if(u.has(h))continue;if(h==="__proto__"){if(p==="never")c.push(h);continue}if(p==="never"){c.push(h);continue}let y=a.run({value:t[h],issues:[]},n);if(y instanceof Promise)e.push(y.then((_)=>Le(_,r,h,t,f,d)));else Le(y,r,h,t,f,d)}if(c.length)r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:i,continue:!0});if(!e.length)return r;return Promise.all(e).then(()=>r)}var pc=l("$ZodObject",(e,t)=>{w.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),n=r?.get?r.get.raw:t.shape??{};if(n){let a=()=>{let p={...n};return Object.defineProperty(t,"shape",{value:p}),a.raw=p,p};a.raw=n,Object.defineProperty(t,"shape",{get:a})}let o=ze(()=>lo(t));x(e,"propValues",(a)=>{let p=a.def.shape,f={};for(let d in p){let m=p[d]._zod;if(m.values){if(!Object.prototype.hasOwnProperty.call(f,d))F(f,d,new Set);for(let h of m.values)f[d].add(h);if(m.optin!==void 0)f[d].add(void 0)}}return f});let i=ue,s=t.catchall,c,u=A.memoizer;u?.attach(e),e._zod.parse=(a,p)=>{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,{},p):{};let d=[],m=c.shape,h=p?.abortEarly,y=a.issues.length;for(let _ of c.allKeys){if(h&&a.issues.length!==y){if(U(a,y))break;y=a.issues.length}if(_==="__proto__")continue;let b=m[_],j=b._zod.optin,ie=b._zod.optout,se=b._zod.run({value:f[_],issues:[]},p);if(se instanceof Promise)d.push(se.then((S)=>Le(S,a,_,f,j,ie)));else Le(se,a,_,f,j,ie)}if(!s)return d.length?Promise.all(d).then(()=>a):a;return po(d,f,a,p,o.value,e,h===!0)}}),fo=l("$ZodObjectJIT",(e,t)=>{pc.init(e,t);let r=e._zod.parse,n=ze(()=>lo(t)),o=A.memoizer,i=(m)=>{let h=n.value,y=h.symbolKeys,_=new vt(["payload","ctx"],{shape:m,inst:e,memo:o,syms:y}),b=(S)=>`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`,j=(S,v)=>`
6
+ };`)(...Object.values(this.closed))}}var Ao={major:4,minor:6,patch:5};var w=l("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ao;let o=e._zod.def.checks,n=e._zod.traits.has("$ZodCheck")?[e,...o??[]]:o?.length?[...o]:[];for(let i of n)for(let s of i._zod.onattach)s(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=(c,a,u)=>{if(c.memo)return c;let p=M(c),f;for(let d of a){if(d._zod.def.when){if(kr(c))continue;if(!d._zod.def.when(c))continue}else if(p)continue;let m=c.issues.length,h=d._zod.check(c);if(h instanceof Promise&&u?.async===!1)throw new U;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{if(await h,c.issues.length===m)return;if(ft(c.issues,m,e),!p)p=M(c,m)});else{if(c.issues.length===m)continue;if(ft(c.issues,m,e),!p)p=M(c,m)}}if(f)return f.then(()=>c);return c},s=(c,a,u)=>{if(M(c))return c.aborted=!0,c;let p=i(a,n,u);if(p instanceof Promise){if(u.async===!1)throw new U;return p.then((f)=>e._zod.parse(f,u))}return e._zod.parse(p,u)};e._zod.run=(c,a)=>{if(a.skipChecks)return e._zod.parse(c,a);if(a.direction==="backward"){let p=e._zod.parse({value:c.value,issues:[]},{...a,skipChecks:!0});if(p instanceof Promise)return p.then((f)=>s(f,c,a));return s(p,c,a)}let u=e._zod.parse(c,a);if(u instanceof Promise){if(a.async===!1)throw new U;return u.then((p)=>i(p,n,a))}return i(u,n,a)}}},{get "~standard"(){return Ie(this,"~standard",kt(this))},set "~standard"(e){B(this,"~standard",e)}}),Jo=(e,t)=>e.issues.length?{issues:e.issues.map((r)=>V(r,t,N()))}:{value:e.value};async function ac(e,t){let r={async:!0};return Jo(await e._zod.run({value:t,issues:[]},r),r)}function kt(e){return{validate:(t)=>{let r={async:!1};try{let o=e._zod.run({value:t,issues:[]},r);if(!(o instanceof Promise))return Jo(o,r)}catch(o){}return ac(e,t)},vendor:"zod",version:1}}var je=l("$ZodString",(e,t)=>{w.init(e,t),e._zod.pattern=t.pattern??go,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch(n){}if(typeof r.value==="string")return r;return r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),P=l("$ZodStringFormat",(e,t)=>{de.init(e,t),je.init(e,t)}),Bo=l("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=to),P.init(e,t)}),Wo=l("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=xt(o))}else t.pattern??(t.pattern=xt());P.init(e,t)}),Vo=l("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=ro),P.init(e,t)}),Ho=1,Ke=2;function Go(e){try{if(typeof URL<"u"&&typeof URL.canParse==="function")return URL.canParse(e);return new URL(e),!0}catch{return!1}}function uc(e,t){if(!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t))return Go(e)||Ke;return lc(e,t)}function lc(e,t){if(!t.normalize&&t.protocol?.source===lo.source&&!/^https?:\/\//i.test(e))return Ho;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse==="function")return r.parse(e)??Ke}return new URL(e)}catch{return Ke}}var pc=/[\t\n\r]/g;function Ro(e){return e.replace(pc,"")}function fc(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 Xo=l("$ZodURL",(e,t)=>{P.init(e,t),e._zod.check=(r)=>{try{let o=r.value.trim(),n=uc(o,t);if(n===Ho){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(n===Ke){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(n===!0){r.value=Ro(o);return}if(t.hostname&&!fc(n,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});if(t.protocol&&!dc(n,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?n.href:Ro(o);return}catch(o){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Yo=l("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=oo()),P.init(e,t)}),qo=l("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?qr:Qr(t.length)),P.init(e,t)}),Qo=l("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Vr),P.init(e,t)}),en=l("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Hr),P.init(e,t)}),tn=l("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Gr),P.init(e,t)}),rn=l("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Xr),P.init(e,t)}),on=l("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Yr),P.init(e,t)}),nn=l("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=yo(t)),P.init(e,t)}),sn=l("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=mo),P.init(e,t)}),cn=l("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=ho(t)),P.init(e,t)}),an=l("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=eo),P.init(e,t)}),un=l("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=no),P.init(e,t)}),mc=/^[0-9a-fA-F:.]+$/;function ln(e){if(!mc.test(e))return!1;return Go(`http://[${e}]`)}var pn=l("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=io),P.init(e,t),e._zod.check=(r)=>{if(!ln(r.value))r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}});var fn=l("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=so),P.init(e,t)});function hc(e){let t=e.split("/");if(t.length!==2)return!1;let[r,o]=t;if(!o)return!1;let n=Number(o);if(`${n}`!==o)return!1;if(n<0||n>128)return!1;return ln(r)}var dn=l("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=co),P.init(e,t),e._zod.check=(r)=>{if(!hc(r.value))r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function mn(e){if(e==="")return!0;if(/\s/.test(e))return!1;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var St=/^[0-9a-zA-Z+/]*={0,2}$/,hn=l("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=St),P.init(e,t),e._zod.check=(r)=>{if(mn(r.value))return;r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),Fe=/^[A-Za-z0-9_-]*$/;function yc(e){if(!Fe.test(e))return!1;let t=e.replace(/[-_]/g,(o)=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return mn(r)}var yn=l("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Fe),P.init(e,t),e._zod.check=(r)=>{if(yc(r.value))return;r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),gn=l("$ZodE164",(e,t)=>{t.pattern??(t.pattern=po),P.init(e,t)});function gc(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));if("typ"in n&&n?.typ!=="JWT")return!1;if(!n.alg)return!1;if(t&&(!("alg"in n)||n.alg!==t))return!1;return!0}catch{return!1}}var _n=l("$ZodJWT",(e,t)=>{P.init(e,t),e._zod.check=(r)=>{if(gc(r.value,t.alg))return;r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var Zt=l("$ZodNumber",(e,t)=>{w.init(e,t),e._zod.pattern=bt,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch(s){}let n=r.value;if(typeof n==="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let i=typeof n==="number"?Number.isNaN(n)?"NaN":!Number.isFinite(n)?String(n):void 0:void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...i?{received:i}:{}}),r}}),xn=l("$ZodNumberFormat",(e,t)=>{vo.init(e,t),Zt.init(e,t)});var bn=l("$ZodUnknown",(e,t)=>{w.init(e,t),e._zod.parse=(r)=>r}),vn=l("$ZodNever",(e,t)=>{w.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Co(e,t,r){if(e.issues.length)t.issues.push(...Se(r,e.issues));t.value[r]=e.value}var Pn=l("$ZodArray",(e,t)=>{w.init(e,t);let r=A.memoizer;r?.attach(e),e._zod.parse=(o,n)=>{let i=o.value;if(!Array.isArray(i))return o.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),o;o.value=r?r.alloc(e,o,Array(i.length),n):Array(i.length);let s=[],c=n?.abortEarly;for(let a=0;a<i.length;a++){let u=i[a],p=t.element._zod.run({value:u,issues:[]},n);if(p instanceof Promise)s.push(p.then((f)=>Co(f,o,a)));else if(Co(p,o,a),c&&p.issues.length!==0&&M(p))break}if(s.length)return Promise.all(s).then(()=>o);return o}});function Le(e,t,r,o,n,i){let s=r in o,c=i==="optional";if(!s&&c&&n==="optional")return;if(e.issues.length){if(n!==void 0&&c&&!s)return;t.issues.push(...Se(r,e.issues))}if(!s&&n===void 0){if(!e.issues.length)t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}if(e.value===void 0){if(s||n==="defaulted"&&!c)t.value[r]=void 0}else t.value[r]=e.value}var _c=[];function zn(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),o=r.length?r:_c,n=o.length?[...t,...o]:t;for(let s of n)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(s)}": expected a Zod schema`);let i=zr(e.shape);return{...e,allKeys:n,symbolKeys:o,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function $n(e,t,r,o,n,i,s){let c=[],a=n.keySet,u=n.catchall._zod,p=u.def.type,{optin:f,optout:d}=u,m=0;for(let h in t){if(s&&r.issues.length!==m){if(M(r,m))break;m=r.issues.length}if(a.has(h))continue;if(h==="__proto__"){if(p==="never")c.push(h);continue}if(p==="never"){c.push(h);continue}let _=u.run({value:t[h],issues:[]},o);if(_ instanceof Promise)e.push(_.then((g)=>Le(g,r,h,t,f,d)));else Le(_,r,h,t,f,d)}if(c.length)r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:i,continue:!0});if(!e.length)return r;return Promise.all(e).then(()=>r)}var xc=l("$ZodObject",(e,t)=>{w.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),o=r?.get?r.get.raw:t.shape??{};if(o){let u=()=>{let p={...o};return Object.defineProperty(t,"shape",{value:p}),u.raw=p,p};u.raw=o,Object.defineProperty(t,"shape",{get:u})}let n=Pe(()=>zn(t));x(e,"propValues",(u)=>{let p=u.def.shape,f={};for(let d in p){let m=p[d]._zod;if(m.values){if(!Object.prototype.hasOwnProperty.call(f,d))j(f,d,new Set);for(let h of m.values)f[d].add(h);if(m.optin!==void 0)f[d].add(void 0)}}return f});let i=ae,s=t.catchall,c,a=A.memoizer;a?.attach(e),e._zod.parse=(u,p)=>{c??(c=n.value);let f=u.value;if(!i(f))return u.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),u;u.value=a?a.alloc(e,u,{},p):{};let d=[],m=c.shape,h=p?.abortEarly,_=u.issues.length;for(let g of c.allKeys){if(h&&u.issues.length!==_){if(M(u,_))break;_=u.issues.length}if(g==="__proto__")continue;let b=m[g],K=b._zod.optin,ie=b._zod.optout,se=b._zod.run({value:f[g],issues:[]},p);if(se instanceof Promise)d.push(se.then((S)=>Le(S,u,g,f,K,ie)));else Le(se,u,g,f,K,ie)}if(!s)return d.length?Promise.all(d).then(()=>u):u;return $n(d,f,u,p,n.value,e,h===!0)}}),wn=l("$ZodObjectJIT",(e,t)=>{xc.init(e,t);let r=e._zod.parse,o=Pe(()=>zn(t)),n=A.memoizer,i=(m)=>{let h=o.value,_=h.symbolKeys,g=new $t(["payload","ctx"],{shape:m,inst:e,memo:n,syms:_}),b=(S)=>`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`,K=(S,v)=>`
7
7
  let ${S}_ab = false;
8
8
  for (let i = 0; i < ${S}.issues.length; i++) {
9
9
  const iss = ${S}.issues[i];
@@ -14,20 +14,20 @@ ${t.join(`
14
14
  if (${S}_ab && ctx && ctx.abortEarly) {
15
15
  payload.value = newResult;
16
16
  return payload;
17
- }`;_.write("const input = payload.value;");let ie=Object.create(null),se=0;for(let S of h.allKeys)ie[S]=`key_${se++}`;_.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let S of h.allKeys){if(S==="__proto__")continue;let v=ie[S],L=typeof S==="symbol"?`syms[${y.indexOf(S)}]`:cr(S),et=`${L} in input`,Qt=m[S],tt=Qt?._zod?.optin,er=tt!==void 0,Zs=Qt?._zod?.optout==="optional";if(_.write(`const ${v} = ${b(L)};`),er&&Zs){let Os=tt==="optional"?`${v}_present`:`${v}.value !== undefined || ${v}_present`;_.write(`
18
- const ${v}_present = ${et};
17
+ }`;g.write("const input = payload.value;");let ie=Object.create(null),se=0;for(let S of h.allKeys)ie[S]=`key_${se++}`;g.write(n?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let S of h.allKeys){if(S==="__proto__")continue;let v=ie[S],L=typeof S==="symbol"?`syms[${_.indexOf(S)}]`:xr(S),ot=`${L} in input`,ur=m[S],nt=ur?._zod?.optin,lr=nt!==void 0,Ns=ur?._zod?.optout==="optional";if(g.write(`const ${v} = ${b(L)};`),lr&&Ns){let Ds=nt==="optional"?`${v}_present`:`${v}.value !== undefined || ${v}_present`;g.write(`
18
+ const ${v}_present = ${ot};
19
19
  if (!${v}.issues.length || ${v}_present) {
20
- if (${v}.issues.length) {${j(v,L)}
20
+ if (${v}.issues.length) {${K(v,L)}
21
21
  }
22
22
 
23
- if (${Os}) {
23
+ if (${Ds}) {
24
24
  newResult[${L}] = ${v}.value;
25
25
  }
26
26
  }
27
27
 
28
- `)}else if(!er)_.write(`
29
- const ${v}_present = ${et};
30
- if (${v}.issues.length) {${j(v,L)}
28
+ `)}else if(!lr)g.write(`
29
+ const ${v}_present = ${ot};
30
+ if (${v}.issues.length) {${K(v,L)}
31
31
  }
32
32
  if (!${v}_present && !${v}.issues.length) {
33
33
  payload.issues.push({
@@ -46,13 +46,13 @@ ${t.join(`
46
46
  newResult[${L}] = ${v}.value;
47
47
  }
48
48
 
49
- `);else if(_.write(`
50
- if (${v}.issues.length) {${j(v,L)}
49
+ `);else if(g.write(`
50
+ if (${v}.issues.length) {${K(v,L)}
51
51
  }
52
- `),tt==="defaulted")_.write(`newResult[${L}] = ${v}.value;`);else _.write(`
53
- if (${v}.value !== undefined || ${et}) {
52
+ `),nt==="defaulted")g.write(`newResult[${L}] = ${v}.value;`);else g.write(`
53
+ if (${v}.value !== undefined || ${ot}) {
54
54
  newResult[${L}] = ${v}.value;
55
55
  }
56
- `)}return _.write("payload.value = newResult;"),_.write("return payload;"),_.compile()},s,c=ue,u=!A.jitless,p=u&&ar.value,f=t.catchall,d;e._zod.parse=(m,h)=>{d??(d=n.value);let y=m.value;if(!c(y))return m.issues.push({expected:"object",code:"invalid_type",input:y,inst:e}),m;if(u&&p&&h?.async===!1&&h.jitless!==!0){if(!s)s=i(t.shape);if(m=s(m,h),!f)return m;return po([],y,m,h,d,e,h?.abortEarly===!0)}return r(m,h)}});function kn(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)=>!U(i));if(o.length===1)return t.value=o[0].value,o[0];return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map((i)=>i.issues.map((s)=>W(s,n,N())))}),t}var mo=l("$ZodUnion",(e,t)=>{w.init(e,t),x(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),x(e,"optout",(n)=>n.def.options.some((o)=>o._zod.optout==="optional")?"optional":void 0),x(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)));return}),x(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)=>$e(i.source)).join("|")})$`)}return});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)}}if(!i)return kn(s,n,e,o);return Promise.all(s).then((c)=>kn(c,n,e,o))}});var ho=l("$ZodIntersection",(e,t)=>{w.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);if(i instanceof Promise||s instanceof Promise)return Promise.all([i,s]).then(([u,a])=>wn(r,u,a));return wn(r,i,s)}});function zt(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(Q(e)&&Q(t)){let r=Object.keys(t),n=Object.keys(e).filter((i)=>r.indexOf(i)!==-1),o={...e,...t};if(Object.prototype.hasOwnProperty.call(o,"__proto__"))delete o.__proto__;for(let i of n){if(i==="__proto__")continue;let s=zt(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=zt(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 wn(e,t,r){let n=new Map,o,i=new Map,s=(a,p)=>{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 d=String(a.path[0]);if(!i.has(d))i.set(d,a);f=[d]}else return!1;for(let d of f){if(!n.has(d))n.set(d,{});n.get(d)[p]=!0}return!0};for(let a of t.issues)if(!s(a,"l"))e.issues.push(a);for(let a of r.issues)if(!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((p)=>o.keys.includes(p)):[];if(a.length)e.issues.push({...o,keys:a});for(let p of c)if(!a.includes(p)&&i.has(p))e.issues.push(i.get(p))}let u=zt(t.value,r.value);if(!u.valid){if(U(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`)}return e.value=u.data,e}var go=l("$ZodEnum",(e,t)=>{w.init(e,t);let r=ae(t.entries),n=new Set(r);e._zod.values=n,x(e,"pattern",(o)=>{let i=ae(o.def.entries).filter((s)=>lr.has(typeof s));return new RegExp(i.length?`^(${i.map((s)=>ee(s.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,i)=>{let s=o.value;if(n.has(s))return o;return o.issues.push({code:"invalid_value",values:r,input:s,inst:e}),o}});var _o=l("$ZodTransform",(e,t)=>{w.init(e,t),e._zod.optin="optional",A.memoizer?.guard(e),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new pe(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 K;return r.value=o,r}});function Pn(e,t){return e.value=t.issues.length?void 0:t.value,e}var Pt=l("$ZodOptional",(e,t)=>{w.init(e,t),x(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",x(e,"values",(r)=>{let n=r.def.innerType._zod.values;return n?new Set([...n,void 0]):void 0}),x(e,"pattern",(r)=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${$e(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);if(o instanceof Promise)return o.then((i)=>Pn(r,i));return Pn(r,o)}return t.innerType._zod.run(r,n)}}),yo=l("$ZodExactOptional",(e,t)=>{Pt.init(e,t),x(e,"values",(r)=>r.def.innerType._zod.values),x(e,"pattern",(r)=>r.def.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),xo=l("$ZodNullable",(e,t)=>{w.init(e,t),x(e,"optin",(r)=>r.def.innerType._zod.optin),x(e,"optout",(r)=>r.def.innerType._zod.optout),x(e,"pattern",(r)=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${$e(n.source)}|null)$`):void 0}),x(e,"values",(r)=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>{if(r.value===null)return r;return t.innerType._zod.run(r,n)}}),bo=l("$ZodDefault",(e,t)=>{w.init(e,t),e._zod.optin="defaulted",x(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);if(o instanceof Promise)return o.then((i)=>Sn(i,t));return Sn(o,t)}});function Sn(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var vo=l("$ZodPrefault",(e,t)=>{w.init(e,t),e._zod.optin="defaulted",x(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)r.value=t.defaultValue;return t.innerType._zod.run(r,n)}}),zo=l("$ZodNonOptional",(e,t)=>{w.init(e,t),x(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);if(o instanceof Promise)return o.then((i)=>Zn(i,e));return Zn(o,e)}});function Zn(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}function On(e,t,r,n){if(!t.issues.length){if(e.value=t.value,t.memo)e.memo=!0;return e}return e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map((o)=>W(o,n,N()))},input:e.value}),e}var $o=l("$ZodCatch",(e,t)=>{w.init(e,t),x(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),x(e,"optout",(r)=>r.def.innerType._zod.optout),x(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);if(o instanceof Promise)return o.then((i)=>On(r,i,t,n));return On(r,o,t,n)}});var ko=l("$ZodPipe",(e,t)=>{w.init(e,t),x(e,"values",(r)=>r.def.in._zod.values),x(e,"optin",(r)=>r.def.in._zod.optin),x(e,"optout",(r)=>r.def.out._zod.optout),x(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);if(i instanceof Promise)return i.then((s)=>De(s,t.in,n));return De(i,t.in,n)}let o=t.in._zod.run(r,n);if(o instanceof Promise)return o.then((i)=>De(i,t.out,n));return De(o,t.out,n)}});function De(e,t,r){if(e.issues.some((n)=>n.code!=="unrecognized_keys"))return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues},r)}var wo=l("$ZodReadonly",(e,t)=>{w.init(e,t),x(e,"propValues",(r)=>r.def.innerType._zod.propValues),x(e,"values",(r)=>r.def.innerType._zod.values),x(e,"optin",(r)=>r.def.innerType?._zod?.optin),x(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);if(o instanceof Promise)return o.then(In);return In(o)}});function In(e){if(!e.memo)e.value=Object.freeze(e.value);return e}var Po=l("$ZodCustom",(e,t)=>{O.init(e,t),w.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)=>Cn(i,r,n,e));Cn(o,r,n,e);return}});function Cn(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};if(n._zod.def.params)o.params=n._zod.def.params;t.issues.push(X(o))}}class Zo extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform");this.name="ZodCyclicError"}}var Zt="~memo",So=[];function Oo(e){return e!==null&&typeof e==="object"}function St(e){return e.map((t)=>t.path?{...t,path:t.path.slice()}:{...t})}var Io=new WeakMap,me=0,Je=1,he=2;function Be(e,t,r){let n=Io.get(e);if(n!==void 0)return n?he:me;if(t.has(e))return he;t.add(e);let o=me,i=(p)=>{if(o!==he&&p?._zod){let f=Be(p,t,r);if(f>o)o=f}},s=(p,f)=>{let d=me;for(let m of Reflect.ownKeys(p)){let h=Object.getOwnPropertyDescriptor(p,m);if(f&&!h.enumerable)continue;let y=h.get?Je:h.value?._zod?Be(h.value,t,r):me;if(y>d)d=y}return d},c=(p)=>{if(p>o)o=p},u=e._zod.def,a=u.type;switch(a){case"object":{let p=ke(u);c(p?s(p,!0):Je),i(u.catchall);break}case"array":i(u.element);break;case"tuple":for(let p of u.items)i(p);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 p of u.options)i(p);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 p=u._cachedInner??(r?e._zod.innerType:void 0);c(p?Be(p,t,!1):Je);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 p in u){let f=Object.getOwnPropertyDescriptor(u,p);if(!f||f.get)continue;let d=f.value;if(!d||typeof d!=="object")continue;if(d._zod)i(d);else if(Array.isArray(d))for(let m of d)i(m)}}return t.delete(e),fc(e,o)}function fc(e,t){if(t!==Je)Io.set(e,t===he);return t}function dc(e,t){let r=e.buckets.get(t);if(!r)r=new WeakMap,e.buckets.set(t,r);return r}var Ue,Ke=[],mc={alloc(e,t,r){let n=Ue;if(!n)return r;Ue=void 0;let o={value:r,issues:null};return n.set(t.value,o),Ke.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"&&hc(i,o.value))throw new Zo;return r(o,i)};if(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 b=Be(e,new Set,!1);if(b===me){if(e._zod.parse=s,e._zod.run===c)e._zod.run=s;return s(u,a)}if(b===he||n)r=!0;else n=!0}let p=u.value;if(!Oo(p))return s(u,a);let f=a[Zt];if(!f)f={buckets:new WeakMap,backEdges:void 0},a[Zt]=f;let d;if(o===a)d=i;else d=dc(f,e),o=a,i=d;let m=d.get(p);if(m){if(u.value=m.value,m.issues){if(m.issues.length)u.issues.push(...St(m.issues))}else u.memo=!0,f.backEdges??(f.backEdges=new WeakSet),f.backEdges.add(m.value);return u}Ue=d;let h=Ke.length,y=s(u,a);Ue=void 0;let _=Ke.length>h?Ke.pop():void 0;if(y instanceof Promise)return y.then((b)=>{if(_)_.issues=b.issues.length?St(b.issues):So;return b});if(_)_.issues=y.issues.length?St(y.issues):So;return y};if(e._zod.parse=c,e._zod.run===s)e._zod.run=c})}};function Co(){return mc}function hc(e,t){let r=e[Zt]?.backEdges;return r!==void 0&&Oo(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){if(i==="number"&&typeof s==="number"&&!Number.isFinite(s))return String(s);return n[i]??i}return(i)=>{switch(i.code){case"invalid_type":{let s=o(i.expected),c=hr(i.input),u=o(c,i.input);return`Invalid input: expected ${s}, received ${u}`}case"invalid_value":if(i.values.length===1)return`Invalid input: expected ${ct(i.values[0])}`;return`Invalid option: expected one of ${ot(i.values,"|")}`;case"too_big":{let s=i.exact?"exactly ":i.inclusive?"<=":"<",c=t(i.origin);if(c)return`Too big: expected ${i.origin??"value"} to have ${s}${i.maximum.toString()} ${c.unit??"elements"}`;return`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);if(c)return`Too small: expected ${i.origin} to have ${s}${i.minimum.toString()} ${c.unit}`;return`Too small: expected ${i.origin} to be ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;if(s.format==="starts_with")return`Invalid string: must start with "${s.prefix}"`;if(s.format==="ends_with")return`Invalid string: must end with "${s.suffix}"`;if(s.format==="includes")return`Invalid string: must include "${s.includes}"`;if(s.format==="regex")return`Invalid string: must match pattern ${s.pattern}`;return`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":""}: ${ot(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":if(i.options&&Array.isArray(i.options)&&i.options.length>0)return`Invalid discriminator value. Expected ${i.options.map((c)=>`'${c}'`).join(" | ")}`;if(i.inclusive===!1)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function Ot(){return{localeError:gc()}}var Eo;class Ao{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&typeof r==="object"&&"id"in r)this._idmap.set(r.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function _c(){return new Ao}(Eo=globalThis).__zod_globalRegistry??(Eo.__zod_globalRegistry=_c());var Y=globalThis.__zod_globalRegistry;function To(e){if(e.checks)e.checks=[...e.checks];return e}function Ro(e,t){return new e(To({type:"string",...g(t)}))}function No(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...g(t)})}function Do(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...g(t)})}function jo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...g(t)})}function Lo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...g(t)})}function Fo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...g(t)})}function Mo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...g(t)})}function Uo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...g(t)})}function Ko(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...g(t)})}function Jo(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...g(t)})}function Bo(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...g(t)})}function Vo(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...g(t)})}function Wo(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...g(t)})}function Go(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...g(t)})}function Ho(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...g(t)})}function Xo(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...g(t)})}function Yo(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...g(t)})}function qo(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...g(t)})}function Qo(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...g(t)})}function ei(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...g(t)})}function ti(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...g(t)})}function ri(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...g(t)})}function ni(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...g(t)})}function oi(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...g(t)})}function ii(e,t){return new e({type:"string",format:"date",check:"string_format",...g(t)})}function si(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...g(t)})}function ci(e,t){return new e({type:"string",format:"duration",check:"string_format",...g(t)})}function ui(e,t){return new e(To({type:"number",checks:[],...g(t)}))}function ai(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...g(t)})}function li(e){return new e({type:"unknown"})}function pi(e,t){return new e({type:"never",...g(t)})}function Ve(e,t){return new xt({check:"less_than",...g(t),value:e,inclusive:!1})}function ge(e,t){return new xt({check:"less_than",...g(t),value:e,inclusive:!0})}function We(e,t){return new bt({check:"greater_than",...g(t),value:e,inclusive:!1})}function _e(e,t){return new bt({check:"greater_than",...g(t),value:e,inclusive:!0})}function Ge(e,t){return new un({check:"multiple_of",...g(t),value:e})}function He(e,t){return new ln({check:"max_length",...g(t),maximum:e})}function te(e,t){return new pn({check:"min_length",...g(t),minimum:e})}function Xe(e,t){return new fn({check:"length_equals",...g(t),length:e})}function It(e,t){return new dn({check:"string_format",format:"regex",...g(t),pattern:e})}function Ct(e){return new mn({check:"string_format",format:"lowercase",...g(e)})}function Et(e){return new hn({check:"string_format",format:"uppercase",...g(e)})}function At(e,t){return new gn({check:"string_format",format:"includes",...g(t),includes:e})}function Tt(e,t){return new _n({check:"string_format",format:"starts_with",...g(t),prefix:e})}function Rt(e,t){return new yn({check:"string_format",format:"ends_with",...g(t),suffix:e})}function G(e){return new xn({check:"overwrite",tx:e})}function Nt(e){return G((t)=>t.normalize(e))}function Dt(){return G((e)=>e.trim())}function jt(){return G((e)=>e.toLowerCase())}function Lt(){return G((e)=>e.toUpperCase())}function Ft(){return G((e)=>ur(e))}function fi(e,t,r){return new e({type:"array",element:t,...g(r)})}function di(e,t,r){return new e({type:"custom",check:"custom",fn:t,...g(r)})}function mi(e,t){let r=yc((n)=>(n.addIssue=(o)=>{if(typeof o==="string")n.issues.push(X(o,n.value,r._zod.def));else{let i=o;if(i.fatal)i.continue=!1;if(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(X(i))}},e(n.value,n)),t);return r}function yc(e,t){let r=new O({check:"custom",...g(t)});return r._zod.check=e,r}function ye(e,...t){for(let r of t)for(let n of Reflect.ownKeys(r))if(Object.prototype.propertyIsEnumerable.call(r,n))F(e,n,r[n]);return e}function Ut(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:e.processors??{},metadataRegistry:e?.metadata??Y,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 Error(o);return Object.assign(r,i),!0}function Z(e,t,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,i=t.seen.get(e);if(i){if(i.count++,r.schemaPath.includes(e))i.cycle=r.path;return 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 p={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,p);else{let d=s.schema,m=t.processors[o.type];if(!m)throw Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);m(e,t,d,p)}let f=e._zod.parent;if(f){if(!s.ref)s.ref=f;Z(f,t,p),t.seen.get(f).isParent=!0}}let u=t.metadataRegistry.get(e);if(u)ye(s.schema,u);if(t.io==="input"&&I(e))delete s.schema.examples,delete s.schema.default;if(t.io==="input"&&"_prefault"in s.schema)(n=s.schema).default??(n.default=s.schema._prefault);return delete s.schema._prefault,t.seen.get(e).schema}function hi(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Kt(e,t){let r=e.seen.get(t);if(!r)throw 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 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,d=e.external.uri??((h)=>h);if(f)return{ref:d(f)};let m=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=m,{defId:m,ref:`${d("__shared")}#/${c}/${hi(m)}`}}let u="#",a=`${u}/${c}/`;if(s[1]===r&&!s[1].schema.id)return{ref:u};let p=s[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:a+hi(p)}},i=(s)=>{if(s[1].schema.$ref)return;let c=s[1],{ref:u,defId:a}=o(s);if(c.def={...c.schema},a)c.defId=a;let p=c.schema;for(let f in p)delete p[f];p.$ref=u};if(e.cycles==="throw")for(let s of e.seen.entries()){let c=s[1];if(c.cycle)throw Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
56
+ `)}return g.write("payload.value = newResult;"),g.write("return payload;"),g.compile()},s,c=ae,a=!A.jitless,p=a&&vr.value,f=t.catchall,d;e._zod.parse=(m,h)=>{d??(d=o.value);let _=m.value;if(!c(_))return m.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),m;if(a&&p&&h?.async===!1&&h.jitless!==!0){if(!s)s=i(t.shape);if(m=s(m,h),!f)return m;return $n([],_,m,h,d,e,h?.abortEarly===!0)}return r(m,h)}});function No(e,t,r,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let n=e.filter((i)=>!M(i));if(n.length===1)return t.value=n[0].value,n[0];return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map((i)=>i.issues.map((s)=>V(s,o,N())))}),t}var kn=l("$ZodUnion",(e,t)=>{w.init(e,t),x(e,"optin",(o)=>o.def.options.some((n)=>n._zod.optin==="defaulted")?"defaulted":o.def.options.some((n)=>n._zod.optin!==void 0)?"optional":void 0),x(e,"optout",(o)=>o.def.options.some((n)=>n._zod.optout==="optional")?"optional":void 0),x(e,"values",(o)=>{if(o.def.options.every((n)=>n._zod.values))return new Set(o.def.options.flatMap((n)=>Array.from(n._zod.values)));return}),x(e,"pattern",(o)=>{if(o.def.options.every((n)=>n._zod.pattern)){let n=o.def.options.map((i)=>i._zod.pattern);return new RegExp(`^(${n.map((i)=>ze(i.source)).join("|")})$`)}return});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,s=[];for(let c of t.options){let a=c._zod.run({value:o.value,issues:[]},n);if(a instanceof Promise)s.push(a),i=!0;else{if(a.issues.length===0)return a;s.push(a)}}if(!i)return No(s,o,e,n);return Promise.all(s).then((c)=>No(c,o,e,n))}});var Sn=l("$ZodIntersection",(e,t)=>{w.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,i=t.left._zod.run({value:n,issues:[]},o),s=t.right._zod.run({value:n,issues:[]},o);if(i instanceof Promise||s instanceof Promise)return Promise.all([i,s]).then(([a,u])=>Do(r,a,u));return Do(r,i,s)}});function wt(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),o=Object.keys(e).filter((i)=>r.indexOf(i)!==-1),n={...e,...t};if(Object.prototype.hasOwnProperty.call(n,"__proto__"))delete n.__proto__;for(let i of o){if(i==="__proto__")continue;let s=wt(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};n[i]=s.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],i=t[o],s=wt(n,i);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Do(e,t,r){let o=new Map,n,i=new Map,s=(u,p)=>{let f;if(u.code==="unrecognized_keys"&&!u.path?.length)n??(n=u),f=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&u.path?.length===1){let d=String(u.path[0]);if(!i.has(d))i.set(d,u);f=[d]}else return!1;for(let d of f){if(!o.has(d))o.set(d,{});o.get(d)[p]=!0}return!0};for(let u of t.issues)if(!s(u,"l"))e.issues.push(u);for(let u of r.issues)if(!s(u,"r"))e.issues.push(u);let c=[...o].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(c.length){let u=n?c.filter((p)=>n.keys.includes(p)):[];if(u.length)e.issues.push({...n,keys:u});for(let p of c)if(!u.includes(p)&&i.has(p))e.issues.push(i.get(p))}let a=wt(t.value,r.value);if(!a.valid){if(M(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`)}return e.value=a.data,e}var Zn=l("$ZodEnum",(e,t)=>{w.init(e,t);let r=ue(t.entries),o=new Set(r);e._zod.values=o,x(e,"pattern",(n)=>{let i=ue(n.def.entries).filter((s)=>Pr.has(typeof s));return new RegExp(i.length?`^(${i.map((s)=>te(s.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,i)=>{let s=n.value;if(o.has(s))return n;return n.issues.push({code:"invalid_value",values:r,input:s,inst:e}),n}});var On=l("$ZodTransform",(e,t)=>{w.init(e,t),e._zod.optin="optional",A.memoizer?.guard(e),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new pe(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then((s)=>(r.value=s,r));if(n instanceof Promise)throw new U;return r.value=n,r}});function Ko(e,t){return e.value=t.issues.length?void 0:t.value,e}var Ot=l("$ZodOptional",(e,t)=>{w.init(e,t),x(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",x(e,"values",(r)=>{let o=r.def.innerType._zod.values;return o?new Set([...o,void 0]):void 0}),x(e,"pattern",(r)=>{let o=r.def.innerType._zod.pattern;return o?new RegExp(`^(${ze(o.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let n=t.innerType._zod.run({value:r.value,issues:[]},o);if(n instanceof Promise)return n.then((i)=>Ko(r,i));return Ko(r,n)}return t.innerType._zod.run(r,o)}}),In=l("$ZodExactOptional",(e,t)=>{Ot.init(e,t),x(e,"values",(r)=>r.def.innerType._zod.values),x(e,"pattern",(r)=>r.def.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),En=l("$ZodNullable",(e,t)=>{w.init(e,t),x(e,"optin",(r)=>r.def.innerType._zod.optin),x(e,"optout",(r)=>r.def.innerType._zod.optout),x(e,"pattern",(r)=>{let o=r.def.innerType._zod.pattern;return o?new RegExp(`^(${ze(o.source)}|null)$`):void 0}),x(e,"values",(r)=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>{if(r.value===null)return r;return t.innerType._zod.run(r,o)}}),Tn=l("$ZodDefault",(e,t)=>{w.init(e,t),e._zod.optin="defaulted",x(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then((i)=>Lo(i,t));return Lo(n,t)}});function Lo(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var An=l("$ZodPrefault",(e,t)=>{w.init(e,t),e._zod.optin="defaulted",x(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)r.value=t.defaultValue;return t.innerType._zod.run(r,o)}}),Rn=l("$ZodNonOptional",(e,t)=>{w.init(e,t),x(e,"values",(r)=>{let o=r.def.innerType._zod.values;return o?new Set([...o].filter((n)=>n!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then((i)=>jo(i,e));return jo(n,e)}});function jo(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}function Fo(e,t,r,o){if(!t.issues.length){if(e.value=t.value,t.memo)e.memo=!0;return e}return e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map((n)=>V(n,o,N()))},input:e.value}),e}var Cn=l("$ZodCatch",(e,t)=>{w.init(e,t),x(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),x(e,"optout",(r)=>r.def.innerType._zod.optout),x(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run({value:r.value,issues:[]},o);if(n instanceof Promise)return n.then((i)=>Fo(r,i,t,o));return Fo(r,n,t,o)}});var Nn=l("$ZodPipe",(e,t)=>{w.init(e,t),x(e,"values",(r)=>r.def.in._zod.values),x(e,"optin",(r)=>r.def.in._zod.optin),x(e,"optout",(r)=>r.def.out._zod.optout),x(e,"propValues",(r)=>r.def.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let i=t.out._zod.run(r,o);if(i instanceof Promise)return i.then((s)=>De(s,t.in,o));return De(i,t.in,o)}let n=t.in._zod.run(r,o);if(n instanceof Promise)return n.then((i)=>De(i,t.out,o));return De(n,t.out,o)}});function De(e,t,r){if(e.issues.some((o)=>o.code!=="unrecognized_keys"))return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues},r)}var Dn=l("$ZodReadonly",(e,t)=>{w.init(e,t),x(e,"propValues",(r)=>r.def.innerType._zod.propValues),x(e,"values",(r)=>r.def.innerType._zod.values),x(e,"optin",(r)=>r.def.innerType?._zod?.optin),x(e,"optout",(r)=>r.def.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then(Mo);return Mo(n)}});function Mo(e){if(!e.memo)e.value=Object.freeze(e.value);return e}var Kn=l("$ZodCustom",(e,t)=>{O.init(e,t),w.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=(r)=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then((i)=>Uo(i,r,o,e));Uo(n,r,o,e);return}});function Uo(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};if(o._zod.def.params)n.params=o._zod.def.params;t.issues.push(X(n))}}class jn extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform");this.name="ZodCyclicError"}}var Et="~memo",Ln=[];function Fn(e){return e!==null&&typeof e==="object"}function It(e){return e.map((t)=>t.path?{...t,path:t.path.slice()}:{...t})}var Mn=new WeakMap,me=0,Je=1,he=2;function Be(e,t,r){let o=Mn.get(e);if(o!==void 0)return o?he:me;if(t.has(e))return he;t.add(e);let n=me,i=(p)=>{if(n!==he&&p?._zod){let f=Be(p,t,r);if(f>n)n=f}},s=(p,f)=>{let d=me;for(let m of Reflect.ownKeys(p)){let h=Object.getOwnPropertyDescriptor(p,m);if(f&&!h.enumerable)continue;let _=h.get?Je:h.value?._zod?Be(h.value,t,r):me;if(_>d)d=_}return d},c=(p)=>{if(p>n)n=p},a=e._zod.def,u=a.type;switch(u){case"object":{let p=$e(a);c(p?s(p,!0):Je),i(a.catchall);break}case"array":i(a.element);break;case"tuple":for(let p of a.items)i(p);i(a.rest);break;case"record":case"map":i(a.keyType),i(a.valueType);break;case"set":i(a.valueType);break;case"union":for(let p of a.options)i(p);break;case"intersection":i(a.left),i(a.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":i(a.innerType);break;case"pipe":i(a.in),i(a.out);break;case"function":i(a.input),i(a.output);break;case"lazy":{let p=a._cachedInner??(r?e._zod.innerType:void 0);c(p?Be(p,t,!1):Je);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 p in a){let f=Object.getOwnPropertyDescriptor(a,p);if(!f||f.get)continue;let d=f.value;if(!d||typeof d!=="object")continue;if(d._zod)i(d);else if(Array.isArray(d))for(let m of d)i(m)}}return t.delete(e),bc(e,n)}function bc(e,t){if(t!==Je)Mn.set(e,t===he);return t}function vc(e,t){let r=e.buckets.get(t);if(!r)r=new WeakMap,e.buckets.set(t,r);return r}var Me,Ue=[],Pc={alloc(e,t,r){let o=Me;if(!o)return r;Me=void 0;let n={value:r,issues:null};return o.set(t.value,n),Ue.push(n),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,o=(n,i)=>{if(i.direction!=="backward"&&zc(i,n.value))throw new jn;return r(n,i)};if(e._zod.parse=o,e._zod.run===r)e._zod.run=o})},attach(e){var t;let r,o=!1,n,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let s=e._zod.parse,c=(a,u)=>{if(r===void 0){let b=Be(e,new Set,!1);if(b===me){if(e._zod.parse=s,e._zod.run===c)e._zod.run=s;return s(a,u)}if(b===he||o)r=!0;else o=!0}let p=a.value;if(!Fn(p))return s(a,u);let f=u[Et];if(!f)f={buckets:new WeakMap,backEdges:void 0},u[Et]=f;let d;if(n===u)d=i;else d=vc(f,e),n=u,i=d;let m=d.get(p);if(m){if(a.value=m.value,m.issues){if(m.issues.length)a.issues.push(...It(m.issues))}else a.memo=!0,f.backEdges??(f.backEdges=new WeakSet),f.backEdges.add(m.value);return a}Me=d;let h=Ue.length,_=s(a,u);Me=void 0;let g=Ue.length>h?Ue.pop():void 0;if(_ instanceof Promise)return _.then((b)=>{if(g)g.issues=b.issues.length?It(b.issues):Ln;return b});if(g)g.issues=_.issues.length?It(_.issues):Ln;return _};if(e._zod.parse=c,e._zod.run===s)e._zod.run=c})}};function Un(){return Pc}function zc(e,t){let r=e[Et]?.backEdges;return r!==void 0&&Fn(t)&&r.has(t)}var $c=()=>{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"},o={nan:"NaN"};function n(i,s){if(i==="number"&&typeof s==="number"&&!Number.isFinite(s))return String(s);return o[i]??i}return(i)=>{switch(i.code){case"invalid_type":{let s=n(i.expected),c=Sr(i.input),a=n(c,i.input);return`Invalid input: expected ${s}, received ${a}`}case"invalid_value":if(i.values.length===1)return`Invalid input: expected ${lt(i.values[0])}`;return`Invalid option: expected one of ${ct(i.values,"|")}`;case"too_big":{let s=i.exact?"exactly ":i.inclusive?"<=":"<",c=t(i.origin);if(c)return`Too big: expected ${i.origin??"value"} to have ${s}${i.maximum.toString()} ${c.unit??"elements"}`;return`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);if(c)return`Too small: expected ${i.origin} to have ${s}${i.minimum.toString()} ${c.unit}`;return`Too small: expected ${i.origin} to be ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;if(s.format==="starts_with")return`Invalid string: must start with "${s.prefix}"`;if(s.format==="ends_with")return`Invalid string: must end with "${s.suffix}"`;if(s.format==="includes")return`Invalid string: must include "${s.includes}"`;if(s.format==="regex")return`Invalid string: must match pattern ${s.pattern}`;return`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":""}: ${ct(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":if(i.options&&Array.isArray(i.options)&&i.options.length>0)return`Invalid discriminator value. Expected ${i.options.map((c)=>`'${c}'`).join(" | ")}`;if(i.inclusive===!1)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function Tt(){return{localeError:$c()}}var Jn;class Bn{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&typeof r==="object"&&"id"in r)this._idmap.set(r.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let o={...r,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function wc(){return new Bn}(Jn=globalThis).__zod_globalRegistry??(Jn.__zod_globalRegistry=wc());var Y=globalThis.__zod_globalRegistry;function Wn(e){if(e.checks)e.checks=[...e.checks];return e}function Vn(e,t){return new e(Wn({type:"string",...y(t)}))}function Hn(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...y(t)})}function Gn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...y(t)})}function Xn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...y(t)})}function Yn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...y(t)})}function qn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...y(t)})}function Qn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...y(t)})}function ei(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...y(t)})}function ti(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...y(t)})}function ri(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...y(t)})}function oi(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...y(t)})}function ni(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...y(t)})}function ii(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...y(t)})}function si(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...y(t)})}function ci(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...y(t)})}function ai(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...y(t)})}function ui(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...y(t)})}function li(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...y(t)})}function pi(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...y(t)})}function fi(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...y(t)})}function di(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...y(t)})}function mi(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...y(t)})}function hi(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...y(t)})}function yi(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...y(t)})}function gi(e,t){return new e({type:"string",format:"date",check:"string_format",...y(t)})}function _i(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...y(t)})}function xi(e,t){return new e({type:"string",format:"duration",check:"string_format",...y(t)})}function bi(e,t){return new e(Wn({type:"number",checks:[],...y(t)}))}function vi(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...y(t)})}function Pi(e){return new e({type:"unknown"})}function zi(e,t){return new e({type:"never",...y(t)})}function We(e,t){return new Pt({check:"less_than",...y(t),value:e,inclusive:!1})}function ye(e,t){return new Pt({check:"less_than",...y(t),value:e,inclusive:!0})}function Ve(e,t){return new zt({check:"greater_than",...y(t),value:e,inclusive:!1})}function ge(e,t){return new zt({check:"greater_than",...y(t),value:e,inclusive:!0})}function He(e,t){return new bo({check:"multiple_of",...y(t),value:e})}function Ge(e,t){return new Po({check:"max_length",...y(t),maximum:e})}function re(e,t){return new zo({check:"min_length",...y(t),minimum:e})}function Xe(e,t){return new $o({check:"length_equals",...y(t),length:e})}function At(e,t){return new wo({check:"string_format",format:"regex",...y(t),pattern:e})}function Rt(e){return new ko({check:"string_format",format:"lowercase",...y(e)})}function Ct(e){return new So({check:"string_format",format:"uppercase",...y(e)})}function Nt(e,t){return new Zo({check:"string_format",format:"includes",...y(t),includes:e})}function Dt(e,t){return new Oo({check:"string_format",format:"starts_with",...y(t),prefix:e})}function Kt(e,t){return new Io({check:"string_format",format:"ends_with",...y(t),suffix:e})}function H(e){return new Eo({check:"overwrite",tx:e})}function Lt(e){return H((t)=>t.normalize(e))}function jt(){return H((e)=>e.trim())}function Ft(){return H((e)=>e.toLowerCase())}function Mt(){return H((e)=>e.toUpperCase())}function Ut(){return H((e)=>br(e))}function $i(e,t,r){return new e({type:"array",element:t,...y(r)})}function wi(e,t,r){return new e({type:"custom",check:"custom",fn:t,...y(r)})}function ki(e,t){let r=kc((o)=>(o.addIssue=(n)=>{if(typeof n==="string")o.issues.push(X(n,o.value,r._zod.def));else{let i=n;if(i.fatal)i.continue=!1;if(i.code??(i.code="custom"),!("input"in i))i.input=o.value;i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),o.issues.push(X(i))}},e(o.value,o)),t);return r}function kc(e,t){let r=new O({check:"custom",...y(t)});return r._zod.check=e,r}function _e(e,...t){for(let r of t)for(let o of Reflect.ownKeys(r))if(Object.prototype.propertyIsEnumerable.call(r,o))j(e,o,r[o]);return e}function Bt(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:e.processors??{},metadataRegistry:e?.metadata??Y,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,o,n){let i=typeof t.unrepresentable==="function"?t.unrepresentable({zodSchema:e,path:o.path,message:n}):t.unrepresentable;if(i==="any")return!1;if(i===void 0||i==="throw")throw Error(n);return Object.assign(r,i),!0}function Z(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,i=t.seen.get(e);if(i){if(i.count++,r.schemaPath.includes(e))i.cycle=r.path;return 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 p={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,p);else{let d=s.schema,m=t.processors[n.type];if(!m)throw Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);m(e,t,d,p)}let f=e._zod.parent;if(f){if(!s.ref)s.ref=f;Z(f,t,p),t.seen.get(f).isParent=!0}}let a=t.metadataRegistry.get(e);if(a)_e(s.schema,a);if(t.io==="input"&&I(e))delete s.schema.examples,delete s.schema.default;if(t.io==="input"&&"_prefault"in s.schema)(o=s.schema).default??(o.default=s.schema._prefault);return delete s.schema._prefault,t.seen.get(e).schema}function Si(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Wt(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let o=new Map;for(let s of e.seen.entries()){let c=e.metadataRegistry.get(s[0])?.id;if(c){let a=o.get(c);if(a&&a!==s[0])throw Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(c,s[0])}}let n=(s)=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let f=e.external.registry.get(s[0])?.id,d=e.external.uri??((h)=>h);if(f)return{ref:d(f)};let m=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=m,{defId:m,ref:`${d("__shared")}#/${c}/${Si(m)}`}}let a="#",u=`${a}/${c}/`;if(s[1]===r&&!s[1].schema.id)return{ref:a};let p=s[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:u+Si(p)}},i=(s)=>{if(s[1].schema.$ref)return;let c=s[1],{ref:a,defId:u}=n(s);if(c.def={...c.schema},u)c.defId=u;let p=c.schema;for(let f in p)delete p[f];p.$ref=a};if(e.cycles==="throw")for(let s of e.seen.entries()){let c=s[1];if(c.cycle)throw Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
57
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}if(c.count>1){if(e.reused==="ref")i(s)}}if(e.external)e.sharedDefsExtractedFor=e.external}function yi(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;yi(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;if(!r.includes(s))r.push(s)}}delete e.anyOf,e.type=r.length===1?r[0]:r}var xi=new Set(["type","properties","required","additionalProperties"]),gi=["oneOf","anyOf"];function _i(e){let t=e.additionalProperties;if(t===void 0||t===!1||typeof t!=="object"||t===null)return null;return Object.keys(t).length?t:null}function Mt(e){let t=[];for(let i of e){if(typeof i!=="object"||i.type!=="object")return null;for(let s in i)if(!xi.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 p=a.properties?.[s]??_i(a);if(p===null||p===void 0)continue;if(!c.some((f)=>JSON.stringify(f)===JSON.stringify(p)))c.push(p)}let u=c.length===1?c[0]:Mt(c)??{allOf:c};F(r,s,u)}for(let s of i.required??[])n.add(s)}let o={type:"object",properties:r};if(n.size)o.required=[...n];if(t.every((i)=>i.additionalProperties===!1))o.additionalProperties=!1;else{let i=[];for(let s of t){let c=_i(s);if(c&&!i.some((u)=>JSON.stringify(u)===JSON.stringify(c)))i.push(c)}if(i.length===1)o.additionalProperties=i[0];else if(i.length>1)o.additionalProperties={allOf:i}}return o}function xc(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let o of xi)if(o in e)return;let r=t.filter((o)=>gi.some((i)=>Array.isArray(o[i]))),n=null;if(!r.length)n=Mt(t);else{let o=r[0],i=gi.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)=>Mt([...s,u]));if(c.some((u)=>!u))return;n={[i]:c}}if(!n)return;delete e.allOf,ye(e,n)}function Jt(e,t){let r=e.seen.get(t);if(!r)throw 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,p={...a},f=u.ref;if(u.ref=null,f){n(f);let m=e.seen.get(f),h=m.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);else ye(a,h);if(ye(a,p),c._zod.parent===f)for(let _ in a){if(_==="$ref"||_==="allOf")continue;if(!(_ in p))delete a[_]}if(h.$ref&&m.def)for(let _ in a){if(_==="$ref"||_==="allOf")continue;if(_ in m.def&&JSON.stringify(a[_])===JSON.stringify(m.def[_]))delete a[_]}}let d=c._zod.parent;if(d&&d!==f){n(d);let m=e.seen.get(d);if(m?.schema.$ref){if(a.$ref=m.schema.$ref,m.def)for(let h in a){if(h==="$ref"||h==="allOf")continue;if(h in m.def&&JSON.stringify(a[h])===JSON.stringify(m.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())yi(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 p=a?.allOf;if(!Array.isArray(p))continue;let f=c.get(p);if(f)f.push(a);else c.set(p,[a])}for(let u of e.intersections)for(let a of c.get(u)??[])xc(a)}}let o={};if(e.target==="draft-2020-12")o.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")o.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")o.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let c=e.external.registry.get(t)?.id;if(!c)throw Error("Schema is missing an `id` property");o.$id=e.external.uri(c)}ye(o,r.defId?r.schema:r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;if(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];if(u.def&&u.defId){if(u.def.id===u.defId)delete u.def.id;F(s,u.defId,u.def)}}if(e.external)e.sharedEmitDoneFor=e.external;if(e.external);else if(Object.keys(s).length>0)if(e.target==="draft-2020-12")o.$defs=s;else o.definitions=s;try{let c=JSON.parse(JSON.stringify(o));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:xe(t,"input",e.processors),output:xe(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch(c){throw Error("Error converting schema to JSON.")}}function I(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 I(n.element,r);if(n.type==="set")return I(n.valueType,r);if(n.type==="lazy")return I(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 I(n.innerType,r);if(n.type==="intersection")return I(n.left,r)||I(n.right,r);if(n.type==="record"||n.type==="map")return I(n.keyType,r)||I(n.valueType,r);if(n.type==="pipe"){if(e._zod.traits.has("$ZodCodec"))return!0;return I(n.in,r)||I(n.out,r)}if(n.type==="object"){for(let o in n.shape)if(I(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(let o of n.options)if(I(o,r))return!0;return!1}if(n.type==="tuple"){for(let o of n.items)if(I(o,r))return!0;if(n.rest&&I(n.rest,r))return!0;return!1}return!1}var bi=(e,t={})=>(r)=>{let n=Ut({...r,processors:t});return Z(e,n),Kt(n,e),Jt(n,e)},xe=(e,t,r={})=>(n)=>{let{libraryOptions:o,target:i}=n??{},s=Ut({...o??{},target:i,io:t,processors:r});return Z(e,s),Kt(s,e),Jt(s,e)};var re=(e,t,r)=>{if(e[t]===void 0||r>e[t])e[t]=r},ne=(e,t,r)=>{if(e[t]===void 0||r<e[t])e[t]=r},vi=(e,t)=>{re(e,"minimum",t),ne(e,"maximum",t)},wi=(e,t)=>{if(e.multipleOf??(e.multipleOf=[]),!e.multipleOf.includes(t))e.multipleOf.push(t)},Pi=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},Si=(e,t)=>{e.mime=e.mime?e.mime.filter((r)=>t.includes(r)):[...t]},Zi=(e,t)=>{if(e.format=t,t.includes("int"))e.isInt=!0},zi=(e,t)=>re(e,"minimum",t.minimum),$i=(e,t)=>ne(e,"maximum",t.maximum),ki=(e)=>(t,r)=>{Zi(t,r.format);let[n,o]=e[r.format];re(t,"minimum",n),ne(t,"maximum",o)},bc={greater_than:(e,t)=>re(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>ne(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>wi(e,t.value),number_format:ki(we),bigint_format:ki(ut),min_length:zi,max_length:$i,length_equals:(e,t)=>vi(e,t.length),min_size:zi,max_size:$i,size_equals:(e,t)=>vi(e,t.size),string_format:(e,t)=>{if(Zi(e,t.format),t.pattern)Pi(e,t.pattern);if(t.format==="base64"||t.format==="base64url")e.contentEncoding=t.format;if(t.local||t.precision===-1)e.laxFormat=!0},mime_type:(e,t)=>Si(e,t.mime)};function D(e){let t={},r=e._zod.def,n=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let i of n)bc[i._zod.def.check]?.(t,i._zod.def);let o=e._zod.bag;if(o.minimum!==void 0)re(t,"minimum",o.minimum);if(o.exclusiveMinimum!==void 0)re(t,"exclusiveMinimum",o.exclusiveMinimum);if(o.maximum!==void 0)ne(t,"maximum",o.maximum);if(o.exclusiveMaximum!==void 0)ne(t,"exclusiveMaximum",o.exclusiveMaximum);if(o.multipleOf!==void 0)wi(t,o.multipleOf);if(o.format!==void 0){if(t.format??(t.format=o.format),o.format.includes("int"))t.isInt=!0}if(o.mime)Si(t,o.mime);for(let i of o.patterns??[])Pi(t,i);return t}var vc={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},zc=new Map([[kt,Xr],[Me,Yr]]),$c=(e)=>zc.get(e)??e,Oi=(e,t,r,n)=>{let o=r;o.type="string";let{minimum:i,maximum:s,format:c,patterns:u,contentEncoding:a,laxFormat:p}=D(e);if(typeof i==="number")o.minLength=i;if(typeof s==="number")o.maxLength=s;if(c){if(o.format=vc[c]??c,o.format==="")delete o.format;if(c==="time"||p)delete o.format}if(a)o.contentEncoding=a;if(u&&u.size>0){let f=[...u].map($c);if(f.length===1)o.pattern=f[0].source;else if(f.length>1)o.allOf=[...f.map((d)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))]}},Ii=(e,t,r,n)=>{let o=r,{minimum:i,maximum:s,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:a,isInt:p}=D(e);o.type=p?"integer":"number";let f=typeof a==="number"&&a>=(i??Number.NEGATIVE_INFINITY),d=typeof u==="number"&&u<=(s??Number.POSITIVE_INFINITY),m=t.target==="draft-04"||t.target==="openapi-3.0";if(f)if(m)o.minimum=a,o.exclusiveMinimum=!0;else o.exclusiveMinimum=a;else if(typeof i==="number")o.minimum=i;if(d)if(m)o.maximum=u,o.exclusiveMaximum=!0;else o.exclusiveMaximum=u;else if(typeof s==="number")o.maximum=s;if(c){let h=new Set;for(let b of c)if(Number.isFinite(b)&&b!==0)h.add(Math.abs(b));else q(e,t,o,n,`A multipleOf divisor of ${b} cannot be represented in JSON Schema`);let[y,..._]=h;if(y!==void 0)o.multipleOf=y;if(_.length)o.allOf=[...o.allOf??[],..._.map((b)=>({multipleOf:b}))]}};var Ci=(e,t,r,n)=>{r.not={}};var Ei=(e,t,r,n)=>{};var Ai=(e,t,r,n)=>{let o=e._zod.def,i=ae(o.entries);if(i.length===0){r.not={};return}if(i.every((s)=>typeof s==="number"))r.type="number";if(i.every((s)=>typeof s==="string"))r.type="string";r.enum=i};var Ti=(e,t,r,n)=>{q(e,t,r,n,"Custom types cannot be represented in JSON Schema")};var Ri=(e,t,r,n)=>{q(e,t,r,n,"Transforms cannot be represented in JSON Schema")};var Ni=(e,t,r,n)=>{let o=r,i=e._zod.def,{minimum:s,maximum:c}=D(e);if(typeof s==="number")o.minItems=s;if(typeof c==="number")o.maxItems=c;o.type="array",o.items=Z(i.element,t,{...n,path:[...n.path,"items"]})};function Bt(e){let t=e._zod.def;if(t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform"))return Bt(t.out);if(t.type==="catch")return Bt(t.innerType);return e._zod.optin}var Di=(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)F(o.properties,a,Z(s[a],t,{...n,path:[...n.path,"properties",a]}));let u=[];for(let a of Object.keys(s)){let p=i.shape[a];if(t.io==="input"?Bt(p)===void 0:p._zod.optout===void 0)u.push(a)}if(u.length>0)o.required=u;if(i.catchall?._zod.def.type==="never")o.additionalProperties=!1;else if(!i.catchall){if(t.io==="output")o.additionalProperties=!1}else if(i.catchall)o.additionalProperties=Z(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})},ji=(e,t,r,n)=>{let o=e._zod.def,i=o.inclusive===!1,s=o.options.map((c,u)=>Z(c,t,{...n,path:[...n.path,i?"oneOf":"anyOf",u]}));if(i)r.oneOf=s;else r.anyOf=s},Li=(e,t,r,n)=>{let o=e._zod.def,i=Z(o.left,t,{...n,path:[...n.path,"allOf",0]}),s=Z(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)};var Fi=(e,t,r,n)=>{let o=e._zod.def,i=Z(o.innerType,t,n),s=t.seen.get(e);if(t.target==="openapi-3.0")s.ref=o.innerType,r.nullable=!0;else r.anyOf=[i,{type:"null"}]},Mi=(e,t,r,n)=>{let o=e._zod.def;Z(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType},Vt=Symbol();function Ui(e,t,r,n,o){let i=!1,s=JSON.stringify(e,(c,u)=>{if(typeof u!=="bigint")return u;return i=!0,null});if(!i)return JSON.parse(s);return q(t,r,n,o,"BigInt defaults cannot be represented in JSON Schema"),Vt}var Ki=(e,t,r,n)=>{let o=e._zod.def;Z(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s=Ui(o.defaultValue,e,t,r,n);if(s!==Vt)r.default=s},Ji=(e,t,r,n)=>{let o=e._zod.def;Z(o.innerType,t,n);let i=t.seen.get(e);if(i.ref=o.innerType,t.io!=="input")return;let s=Ui(o.defaultValue,e,t,r,n);if(s!==Vt)r._prefault=s},Bi=(e,t,r,n)=>{let o=e._zod.def;Z(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},Vi=(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;Z(s,t,n);let c=t.seen.get(e);c.ref=s},Wi=(e,t,r,n)=>{let o=e._zod.def;Z(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType,r.readOnly=!0};var Wt=(e,t,r,n)=>{let o=e._zod.def;Z(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType};var Gi=new WeakSet([Object.prototype,Error.prototype]);function Ye(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 Cc=(e,t)=>{$r.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);if(Gi.has(r))return;Gi.add(r),Ye(r,"format",(n)=>(o)=>wr(n,o)),Ye(r,"flatten",(n)=>(o)=>kr(n,o)),Ye(r,"addIssue",(n)=>(o)=>{n.issues.push(o),n.message=JSON.stringify(n.issues,le,2)}),Ye(r,"addIssues",(n)=>(o)=>{n.issues.push(...o),n.message=JSON.stringify(n.issues,le,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}})};var T=l("ZodError",Cc,void 0,{Parent:Error});var Hi=Ee(T),Xi=Ae(T),Yi=Te(T),qi=Re(T),Qi=Sr(T),es=Zr(T),ts=Or(T),rs=Ir(T),ns=Cr(T),os=Er(T),is=Ar(T),ss=Tr(T);function Ac(){if(!A.localeError)N(Ot())}function Xt(){if(!A.memoizer)N({memoizer:Co()})}var P=l("ZodType",(e,t)=>(Ac(),w.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(E(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 M(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Eu(e,t))},superRefine(e,t){return this.check(Au(e,t))},overwrite(e){return this.check(G(e))},optional(){return as(this)},exactOptional(){return xu(this)},nullable(){return ls(this)},nullish(){return as(ls(this))},nonoptional(e){return wu(this,e)},array(){return lu(this)},or(e){return du([this,e])},and(e){return hu(this,e)},transform(e){return ps(this,yu(e))},default(e){return zu(this,e)},prefault(e){return ku(this,e)},catch(e){return Su(this,e)},pipe(e){return ps(this,e)},readonly(){return Iu(this)},describe(e){let t=this.clone();return Y.add(t,{description:e}),t},meta(...e){if(e.length===0)return Y.get(this);let t=this.clone();return Y.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 Ie(this,"~standard",{...$t(this),jsonSchema:{input:xe(this,"input"),output:xe(this,"output")}})},set "~standard"(e){B(this,"~standard",e)},parse:function e(t,r){return Hi(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await Xi(this,t,r,{callee:e})},safeParse(e,t){return Yi(this,e,t)},async safeParseAsync(e,t){return qi(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){B(this,"spa",e)},validate(e,t){return dt(this,e,t)},validateAsync(e,t){return mt(this,e,t)},encode:function e(t,r){return Qi(this,t,r,{callee:e})},decode:function e(t,r){return es(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await ts(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await rs(this,t,r,{callee:e})},safeEncode(e,t){return ns(this,e,t)},safeDecode(e,t){return os(this,e,t)},async safeEncodeAsync(e,t){return is(this,e,t)},async safeDecodeAsync(e,t){return ss(this,e,t)},toJSONSchema(e){return bi(this,{})(e)},get description(){return Y.get(this)?.description},get _def(){return this._zod.def}}),fs=l("_ZodString",(e,t)=>{Fe.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Oi(e,r,n,o)},_r({format:(e)=>D(e).format??null,minLength:(e)=>D(e).minimum??null,maxLength:(e)=>D(e).maximum??null},{regex(...e){return this.check(It(...e))},includes(...e){return this.check(At(...e))},startsWith(...e){return this.check(Tt(...e))},endsWith(...e){return this.check(Rt(...e))},min(...e){return this.check(te(...e))},max(...e){return this.check(He(...e))},length(...e){return this.check(Xe(...e))},nonempty(...e){return this.check(te(1,...e))},lowercase(e){return this.check(Ct(e))},uppercase(e){return this.check(Et(e))},trim(){return this.check(Dt())},normalize(...e){return this.check(Nt(...e))},toLowerCase(){return this.check(jt())},toUpperCase(){return this.check(Lt())},slugify(){return this.check(Ft())}})),Tc=l("ZodString",(e,t)=>{Fe.init(e,t),fs.init(e,t)},{email(e){return this.check(No(Fc,e))},url(e){return this.check(Uo(Uc,e))},jwt(e){return this.check(ni(nu,e))},emoji(e){return this.check(Ko(Kc,e))},guid(e){return this.check(Do(Mc,e))},uuid(e){return this.check(jo(qe,e))},uuidv4(e){return this.check(Lo(qe,e))},uuidv6(e){return this.check(Fo(qe,e))},uuidv7(e){return this.check(Mo(qe,e))},nanoid(e){return this.check(Jo(Jc,e))},cuid(e){return this.check(Bo(Bc,e))},cuid2(e){return this.check(Vo(Vc,e))},ulid(e){return this.check(Wo(Wc,e))},base64(e){return this.check(ei(eu,e))},base64url(e){return this.check(ti(tu,e))},xid(e){return this.check(Go(Gc,e))},ksuid(e){return this.check(Ho(Hc,e))},ipv4(e){return this.check(Xo(Xc,e))},ipv6(e){return this.check(Yo(Yc,e))},cidrv4(e){return this.check(qo(qc,e))},cidrv6(e){return this.check(Qo(Qc,e))},e164(e){return this.check(ri(ru,e))},datetime(e){return this.check(oi(Nc,e))},date(e){return this.check(ii(Dc,e))},time(e){return this.check(si(jc,e))},duration(e){return this.check(ci(Lc,e))}});function Rc(e){return Ro(Tc,e)}var k=l("ZodStringFormat",(e,t)=>{z.init(e,t),fs.init(e,t)}),Nc=l("ZodISODateTime",(e,t)=>{Vn.init(e,t),k.init(e,t)}),Dc=l("ZodISODate",(e,t)=>{Wn.init(e,t),k.init(e,t)}),jc=l("ZodISOTime",(e,t)=>{Gn.init(e,t),k.init(e,t)}),Lc=l("ZodISODuration",(e,t)=>{Hn.init(e,t),k.init(e,t)}),Fc=l("ZodEmail",(e,t)=>{Rn.init(e,t),k.init(e,t)});var Mc=l("ZodGUID",(e,t)=>{An.init(e,t),k.init(e,t)});var qe=l("ZodUUID",(e,t)=>{Tn.init(e,t),k.init(e,t)});var Uc=l("ZodURL",(e,t)=>{jn.init(e,t),k.init(e,t)});var Kc=l("ZodEmoji",(e,t)=>{Ln.init(e,t),k.init(e,t)});var Jc=l("ZodNanoID",(e,t)=>{Fn.init(e,t),k.init(e,t)});var Bc=l("ZodCUID",(e,t)=>{Mn.init(e,t),k.init(e,t)});var Vc=l("ZodCUID2",(e,t)=>{Un.init(e,t),k.init(e,t)});var Wc=l("ZodULID",(e,t)=>{Kn.init(e,t),k.init(e,t)});var Gc=l("ZodXID",(e,t)=>{Jn.init(e,t),k.init(e,t)});var Hc=l("ZodKSUID",(e,t)=>{Bn.init(e,t),k.init(e,t)});var Xc=l("ZodIPv4",(e,t)=>{Xn.init(e,t),k.init(e,t)});var Yc=l("ZodIPv6",(e,t)=>{qn.init(e,t),k.init(e,t)});var qc=l("ZodCIDRv4",(e,t)=>{Qn.init(e,t),k.init(e,t)});var Qc=l("ZodCIDRv6",(e,t)=>{eo.init(e,t),k.init(e,t)});var eu=l("ZodBase64",(e,t)=>{ro.init(e,t),k.init(e,t)});var tu=l("ZodBase64URL",(e,t)=>{no.init(e,t),k.init(e,t)});var ru=l("ZodE164",(e,t)=>{oo.init(e,t),k.init(e,t)});var nu=l("ZodJWT",(e,t)=>{io.init(e,t),k.init(e,t)});var ds=l("ZodNumber",(e,t)=>{wt.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ii(e,r,n,o),e.isFinite=!0},_r({minValue:(e)=>{let{minimum:t,exclusiveMinimum:r}=D(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:(e)=>{let{maximum:t,exclusiveMaximum:r}=D(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:(e)=>{let{isInt:t,multipleOf:r}=D(e);return!!t||!!r?.some(Number.isSafeInteger)},format:(e)=>D(e).format??null},{gt(e,t){return this.check(We(e,t))},gte(e,t){return this.check(_e(e,t))},min(e,t){return this.check(_e(e,t))},lt(e,t){return this.check(Ve(e,t))},lte(e,t){return this.check(ge(e,t))},max(e,t){return this.check(ge(e,t))},int(e){return this.check(cs(e))},safe(e){return this.check(cs(e))},positive(e){return this.check(We(0,e))},nonnegative(e){return this.check(_e(0,e))},negative(e){return this.check(Ve(0,e))},nonpositive(e){return this.check(ge(0,e))},multipleOf(e,t){return this.check(Ge(e,t))},step(e,t){return this.check(Ge(e,t))},finite(){return this}}));function ou(e){return ui(ds,e)}var iu=l("ZodNumberFormat",(e,t)=>{so.init(e,t),ds.init(e,t)});function cs(e){return ai(iu,e)}var su=l("ZodUnknown",(e,t)=>{co.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ei(e,r,n,o)});function us(){return li(su)}var cu=l("ZodNever",(e,t)=>{uo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ci(e,r,n,o)});function uu(e){return pi(cu,e)}var au=l("ZodArray",(e,t)=>{Xt(),ao.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ni(e,r,n,o),e.element=t.element},{min(e,t){return this.check(te(e,t))},nonempty(e){return this.check(te(1,e))},max(e,t){return this.check(He(e,t))},length(e,t){return this.check(Xe(e,t))},unwrap(){return this.element}});function lu(e,t){return fi(au,e,t)}var pu=l("ZodObject",(e,t)=>{Xt(),fo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Di(e,r,n,o),Ms(e,"shape",(r)=>r._zod.def.shape,!1)},{keyof(){return gu(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(E(this._zod.def,{catchall:e}))},passthrough(){return this.clone(E(this._zod.def,{catchall:us()}))},loose(){return this.clone(E(this._zod.def,{catchall:us()}))},strict(){return this.clone(E(this._zod.def,{catchall:uu()}))},strip(){return this.clone(E(this._zod.def,{catchall:void 0}))},extend(e){return As(this,e)},safeExtend(e){return Ts(this,e)},merge(e){return Rs(this,e)},pick(e){return Cs(this,e)},omit(e){return Es(this,e)},partial(...e){return dr(hs,this,e[0])},exactPartial(...e){return dr(gs,this,e[0],"exactPartial")},required(...e){return Ns(_s,this,e[0])}});function ms(e,t){let r={type:"object",shape:e??{},...g(t)};return new pu(r)}var fu=l("ZodUnion",(e,t)=>{mo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ji(e,r,n,o),e.options=t.options});function du(e,t){return new fu({type:"union",options:e,...g(t)})}var mu=l("ZodIntersection",(e,t)=>{ho.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Li(e,r,n,o)});function hu(e,t){return new mu({type:"intersection",left:e,right:t})}var Ht=l("ZodEnum",(e,t)=>{go.init(e,t),P.init(e,t),e._zod.processJSONSchema=(n,o,i)=>Ai(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 Error(`Key ${s} not found in enum`);return new Ht({...t,checks:[],...g(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 Error(`Key ${s} not found in enum`);return new Ht({...t,checks:[],...g(o),entries:i})}});function gu(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((n)=>[n,n])):e;return new Ht({type:"enum",entries:r,...g(t)})}var _u=l("ZodTransform",(e,t)=>{Xt(),_o.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ri(e,r,n,o),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new pe(e.constructor.name);r.addIssue=(i)=>{if(typeof i==="string")r.issues.push(X(i,r.value,t));else{let s=i;if(s.fatal)s.continue=!1;if(s.code??(s.code="custom"),!("input"in s))s.input=r.value;s.inst??(s.inst=e),r.issues.push(X(s))}};let o=t.transform(r.value,r);if(o instanceof Promise)return o.then((i)=>(r.value=i,r));return r.value=o,r}});function yu(e){return new _u({type:"transform",transform:e})}var hs=l("ZodOptional",(e,t)=>{Pt.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Wt(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function as(e){return new hs({type:"optional",innerType:e})}var gs=l("ZodExactOptional",(e,t)=>{yo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Wt(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function xu(e){return new gs({type:"optional",innerType:e})}var bu=l("ZodNullable",(e,t)=>{xo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Fi(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function ls(e){return new bu({type:"nullable",innerType:e})}var vu=l("ZodDefault",(e,t)=>{bo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ki(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function zu(e,t){return new vu({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():st(t)}})}var $u=l("ZodPrefault",(e,t)=>{vo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ji(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function ku(e,t){return new $u({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():st(t)}})}var _s=l("ZodNonOptional",(e,t)=>{zo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Mi(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function wu(e,t){return new _s({type:"nonoptional",innerType:e,...g(t)})}var Pu=l("ZodCatch",(e,t)=>{$o.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Bi(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Su(e,t){return new Pu({type:"catch",innerType:e,catchValue:typeof t==="function"?t:yr(t)})}var Zu=l("ZodPipe",(e,t)=>{ko.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Vi(e,r,n,o),e.in=t.in,e.out=t.out});function ps(e,t){return new Zu({type:"pipe",in:e,out:t})}var Ou=l("ZodReadonly",(e,t)=>{wo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Wi(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Iu(e){return new Ou({type:"readonly",innerType:e})}var Cu=l("ZodCustom",(e,t)=>{Po.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ti(e,r,n,o)});function Eu(e,t={}){return di(Cu,e,t)}function Au(e,t){return mi(e,t)}import{createReadStream as bs,createWriteStream as Tu}from"fs";import{chmod as Ru,cp as vs,mkdir as be,open as Nu,readdir as Du,rename as ju,rm as zs,stat as ws,utimes as Lu}from"fs/promises";import{join as oe,resolve as Fu}from"path";import{Readable as $s}from"stream";import{resolve as Yt,sep as xs}from"path";function C(e,t){if(e==="")return Yt(t);let r=Yt(e),n=Yt(r,t),o=r.endsWith(xs)?r:r+xs;if(n!==r&&!n.startsWith(o))throw Error(`Path "${t}" resolves outside provider root "${e}"`);return n}var Qe=ms({mode:ou().optional()}),Mu=8388608;async function ks(e){let t=await ws(e),r=t.isDirectory();return{size:r?void 0:t.size,lastModified:t.mtime,isFolder:r,properties:{mode:t.mode}}}async function*Ps(e,t,r){let n=await Du(oe(e,t),{withFileTypes:!0});for(let o of n){let i=t?`${t}/${o.name}`:o.name;if(yield i,o.isDirectory()&&r)yield*Ps(e,i,r)}}class ve{kind="js";rootPath;constructor(e=""){this.rootPath=e===""?"":Fu(e)}async[Symbol.asyncDispose](){}async createFolder(e){await be(C(this.rootPath,e),{recursive:!0})}list(e,t){let r=this.rootPath,n=C(r,e);async function*o(){for await(let i of Ps(n,"",t?.recursive??!1)){if(t?.regex&&!t.regex.test(i))continue;let s=await ks(oe(n,i));yield{path:i,properties:s}}}return o()}async getProperties(e){return ks(C(this.rootPath,e))}async setProperties(e,t){let r=C(this.rootPath,e),n=Qe.partial().parse(t);if(n.mode!==void 0)await Ru(r,n.mode);if(t.lastModified instanceof Date)await Lu(r,t.lastModified,t.lastModified)}async delete(e){await zs(C(this.rootPath,e),{recursive:!0,force:!1})}async getReadableStream(e){let t=C(this.rootPath,e),r=$s.toWeb(bs(t));return{kind:"js",stream:rt(r)}}async getWritableStream(e){let t=C(this.rootPath,e);await be(oe(t,".."),{recursive:!0});let r=Tu(t),n=new WritableStream({write(o){return new Promise((i,s)=>{r.write(o.data,(c)=>c?s(c):i())})},close(){return new Promise((o,i)=>{r.end((s)=>s?i(s):o())})},abort(o){r.destroy(o instanceof Error?o:Error(String(o)))}});return{kind:"js",stream:n}}getPartSizeConstraints(e){return{minPartSize:0,maxPartSize:1/0,maxParts:1/0,defaultPartSize:Mu}}getMultipartReader(e,t){let r=C(this.rootPath,e);async function*n(){let o=await ws(r),i=Math.max(1,Math.ceil(o.size/t));for(let s=0;s<i;s+=1){let c=s*t,u=Math.min(c+t,o.size)-1,a=$s.toWeb(bs(r,{start:c,end:Math.max(c,u)}));yield{index:s,offset:c,kind:"js",stream:rt(a),complete:async()=>{}}}}return n()}getMultipartWriter(e,t){let r=C(this.rootPath,e);return{async write(n){await be(oe(r,".."),{recursive:!0});let o=await Nu(r,"w");try{let i=[];for await(let s of n)i.push((async()=>{let c=s.stream.getReader(),u=s.offset;for(;;){let{done:a,value:p}=await c.read();if(a)break;await o.write(p.data,0,p.data.byteLength,u),u+=p.data.byteLength}await s.complete()})());await Promise.all(i)}finally{await o.close()}}}}canDirectTransfer(e){return e instanceof ve&&e.rootPath===this.rootPath}supportsRecursiveDirectTransfer=!0;async directCopy(e,t,r){let n=C(this.rootPath,t);await be(oe(n,".."),{recursive:!0}),await vs(C(this.rootPath,e),n,{recursive:!0})}async directMove(e,t,r){let n=C(this.rootPath,e),o=C(this.rootPath,t);await be(oe(o,".."),{recursive:!0});try{await ju(n,o)}catch(i){if(i.code==="EXDEV"){await vs(n,o,{recursive:!0}),await zs(n,{recursive:!0,force:!1});return}throw i}}}var Ss=ms({rootPath:Rc().optional()}),qt={configSchema:Ss,propertySchema:Qe,async createProvider(e){return new ve(e.rootPath)}};var Uu={create:()=>Promise.resolve(qt)},Ku={extensionPoint:tr,factory:Uu},Ju={extensionDescriptors:[Ku]},Bu=Ju;export{ve as FilesystemIOProvider,Bu as default,Ss as filesystemConfigSchema,qt as filesystemIOProviderFactory,Qe as filesystemPropertySchema};
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 u=e.external.registry.get(s[0])?.id;if(t!==s[0]&&u){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(c.cycle){i(s);continue}if(c.count>1){if(e.reused==="ref")i(s)}}if(e.external)e.sharedDefsExtractedFor=e.external}function Ii(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let o of t){if(!o||typeof o!=="object")return;Ii(o);let n=Object.keys(o);if(n.length!==1||n[0]!=="type")return;let i=o.type;for(let s of Array.isArray(i)?i:[i]){if(typeof s!=="string")return;if(!r.includes(s))r.push(s)}}delete e.anyOf,e.type=r.length===1?r[0]:r}var Ei=new Set(["type","properties","required","additionalProperties"]),Zi=["oneOf","anyOf"];function Oi(e){let t=e.additionalProperties;if(t===void 0||t===!1||typeof t!=="object"||t===null)return null;return Object.keys(t).length?t:null}function Jt(e){let t=[];for(let i of e){if(typeof i!=="object"||i.type!=="object")return null;for(let s in i)if(!Ei.has(s))return null;t.push(i)}let r={},o=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 u of t){let p=u.properties?.[s]??Oi(u);if(p===null||p===void 0)continue;if(!c.some((f)=>JSON.stringify(f)===JSON.stringify(p)))c.push(p)}let a=c.length===1?c[0]:Jt(c)??{allOf:c};j(r,s,a)}for(let s of i.required??[])o.add(s)}let n={type:"object",properties:r};if(o.size)n.required=[...o];if(t.every((i)=>i.additionalProperties===!1))n.additionalProperties=!1;else{let i=[];for(let s of t){let c=Oi(s);if(c&&!i.some((a)=>JSON.stringify(a)===JSON.stringify(c)))i.push(c)}if(i.length===1)n.additionalProperties=i[0];else if(i.length>1)n.additionalProperties={allOf:i}}return n}function Sc(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let n of Ei)if(n in e)return;let r=t.filter((n)=>Zi.some((i)=>Array.isArray(n[i]))),o=null;if(!r.length)o=Jt(t);else{let n=r[0],i=Zi.find((a)=>Array.isArray(n[a]));if(Object.keys(n).length!==1)return;let s=t.filter((a)=>a!==n),c=n[i].map((a)=>Jt([...s,a]));if(c.some((a)=>!a))return;o={[i]:c}}if(!o)return;delete e.allOf,_e(e,o)}function Vt(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let o=(c)=>{let a=e.seen.get(c);if(a.ref===null)return;let u=a.def??a.schema,p={...u},f=a.ref;if(a.ref=null,f){o(f);let m=e.seen.get(f),h=m.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))u.allOf=u.allOf??[],u.allOf.push(h);else _e(u,h);if(_e(u,p),c._zod.parent===f)for(let g in u){if(g==="$ref"||g==="allOf")continue;if(!(g in p))delete u[g]}if(h.$ref&&m.def)for(let g in u){if(g==="$ref"||g==="allOf")continue;if(g in m.def&&JSON.stringify(u[g])===JSON.stringify(m.def[g]))delete u[g]}}let d=c._zod.parent;if(d&&d!==f){o(d);let m=e.seen.get(d);if(m?.schema.$ref){if(u.$ref=m.schema.$ref,m.def)for(let h in u){if(h==="$ref"||h==="allOf")continue;if(h in m.def&&JSON.stringify(u[h])===JSON.stringify(m.def[h]))delete u[h]}}}e.override({zodSchema:c,jsonSchema:u,path:a.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let c of[...e.seen.entries()].reverse())o(c[0]);if(e.target!=="openapi-3.0")for(let c of e.seen.entries())Ii(c[1].def??c[1].schema);for(let c of e.deferred)c();if(e.intersections.length){let c=new Map;for(let a of e.seen.values())for(let u of[a.schema,a.def]){let p=u?.allOf;if(!Array.isArray(p))continue;let f=c.get(p);if(f)f.push(u);else c.set(p,[u])}for(let a of e.intersections)for(let u of c.get(a)??[])Sc(u)}}let n={};if(e.target==="draft-2020-12")n.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")n.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")n.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let c=e.external.registry.get(t)?.id;if(!c)throw Error("Schema is missing an `id` property");n.$id=e.external.uri(c)}_e(n,r.defId?r.schema:r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;if(i!==void 0&&n.id===i)delete n.id;let s=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let c of e.seen.entries()){let a=c[1];if(a.def&&a.defId){if(a.def.id===a.defId)delete a.def.id;j(s,a.defId,a.def)}}if(e.external)e.sharedEmitDoneFor=e.external;if(e.external);else if(Object.keys(s).length>0)if(e.target==="draft-2020-12")n.$defs=s;else n.definitions=s;try{let c=JSON.parse(JSON.stringify(n));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:xe(t,"input",e.processors),output:xe(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch(c){throw Error("Error converting schema to JSON.")}}function I(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return I(o.element,r);if(o.type==="set")return I(o.valueType,r);if(o.type==="lazy")return I(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault"||o.type==="catch")return I(o.innerType,r);if(o.type==="intersection")return I(o.left,r)||I(o.right,r);if(o.type==="record"||o.type==="map")return I(o.keyType,r)||I(o.valueType,r);if(o.type==="pipe"){if(e._zod.traits.has("$ZodCodec"))return!0;return I(o.in,r)||I(o.out,r)}if(o.type==="object"){for(let n in o.shape)if(I(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(I(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(I(n,r))return!0;if(o.rest&&I(o.rest,r))return!0;return!1}return!1}var Ti=(e,t={})=>(r)=>{let o=Bt({...r,processors:t});return Z(e,o),Wt(o,e),Vt(o,e)},xe=(e,t,r={})=>(o)=>{let{libraryOptions:n,target:i}=o??{},s=Bt({...n??{},target:i,io:t,processors:r});return Z(e,s),Wt(s,e),Vt(s,e)};var oe=(e,t,r)=>{if(e[t]===void 0||r>e[t])e[t]=r},ne=(e,t,r)=>{if(e[t]===void 0||r<e[t])e[t]=r},Ai=(e,t)=>{oe(e,"minimum",t),ne(e,"maximum",t)},Di=(e,t)=>{if(e.multipleOf??(e.multipleOf=[]),!e.multipleOf.includes(t))e.multipleOf.push(t)},Ki=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},Li=(e,t)=>{e.mime=e.mime?e.mime.filter((r)=>t.includes(r)):[...t]},ji=(e,t)=>{if(e.format=t,t.includes("int"))e.isInt=!0},Ri=(e,t)=>oe(e,"minimum",t.minimum),Ci=(e,t)=>ne(e,"maximum",t.maximum),Ni=(e)=>(t,r)=>{ji(t,r.format);let[o,n]=e[r.format];oe(t,"minimum",o),ne(t,"maximum",n)},Zc={greater_than:(e,t)=>oe(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>ne(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>Di(e,t.value),number_format:Ni(we),bigint_format:Ni(pt),min_length:Ri,max_length:Ci,length_equals:(e,t)=>Ai(e,t.length),min_size:Ri,max_size:Ci,size_equals:(e,t)=>Ai(e,t.size),string_format:(e,t)=>{if(ji(e,t.format),t.pattern)Ki(e,t.pattern);if(t.format==="base64"||t.format==="base64url")e.contentEncoding=t.format;if(t.local||t.precision===-1)e.laxFormat=!0},mime_type:(e,t)=>Li(e,t.mime)};function D(e){let t={},r=e._zod.def,o=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let i of o)Zc[i._zod.def.check]?.(t,i._zod.def);let n=e._zod.bag;if(n.minimum!==void 0)oe(t,"minimum",n.minimum);if(n.exclusiveMinimum!==void 0)oe(t,"exclusiveMinimum",n.exclusiveMinimum);if(n.maximum!==void 0)ne(t,"maximum",n.maximum);if(n.exclusiveMaximum!==void 0)ne(t,"exclusiveMaximum",n.exclusiveMaximum);if(n.multipleOf!==void 0)Di(t,n.multipleOf);if(n.format!==void 0){if(t.format??(t.format=n.format),n.format.includes("int"))t.isInt=!0}if(n.mime)Li(t,n.mime);for(let i of n.patterns??[])Ki(t,i);return t}var Oc={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Ic=new Map([[St,ao],[Fe,uo]]),Ec=(e)=>Ic.get(e)??e,Fi=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:i,maximum:s,format:c,patterns:a,contentEncoding:u,laxFormat:p}=D(e);if(typeof i==="number")n.minLength=i;if(typeof s==="number")n.maxLength=s;if(c){if(n.format=Oc[c]??c,n.format==="")delete n.format;if(c==="time"||p)delete n.format}if(u)n.contentEncoding=u;if(a&&a.size>0){let f=[...a].map(Ec);if(f.length===1)n.pattern=f[0].source;else if(f.length>1)n.allOf=[...f.map((d)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))]}},Mi=(e,t,r,o)=>{let n=r,{minimum:i,maximum:s,multipleOf:c,exclusiveMaximum:a,exclusiveMinimum:u,isInt:p}=D(e);n.type=p?"integer":"number";let f=typeof u==="number"&&u>=(i??Number.NEGATIVE_INFINITY),d=typeof a==="number"&&a<=(s??Number.POSITIVE_INFINITY),m=t.target==="draft-04"||t.target==="openapi-3.0";if(f)if(m)n.minimum=u,n.exclusiveMinimum=!0;else n.exclusiveMinimum=u;else if(typeof i==="number")n.minimum=i;if(d)if(m)n.maximum=a,n.exclusiveMaximum=!0;else n.exclusiveMaximum=a;else if(typeof s==="number")n.maximum=s;if(c){let h=new Set;for(let b of c)if(Number.isFinite(b)&&b!==0)h.add(Math.abs(b));else q(e,t,n,o,`A multipleOf divisor of ${b} cannot be represented in JSON Schema`);let[_,...g]=h;if(_!==void 0)n.multipleOf=_;if(g.length)n.allOf=[...n.allOf??[],...g.map((b)=>({multipleOf:b}))]}};var Ui=(e,t,r,o)=>{r.not={}};var Ji=(e,t,r,o)=>{};var Bi=(e,t,r,o)=>{let n=e._zod.def,i=ue(n.entries);if(i.length===0){r.not={};return}if(i.every((s)=>typeof s==="number"))r.type="number";if(i.every((s)=>typeof s==="string"))r.type="string";r.enum=i};var Wi=(e,t,r,o)=>{q(e,t,r,o,"Custom types cannot be represented in JSON Schema")};var Vi=(e,t,r,o)=>{q(e,t,r,o,"Transforms cannot be represented in JSON Schema")};var Hi=(e,t,r,o)=>{let n=r,i=e._zod.def,{minimum:s,maximum:c}=D(e);if(typeof s==="number")n.minItems=s;if(typeof c==="number")n.maxItems=c;n.type="array",n.items=Z(i.element,t,{...o,path:[...o.path,"items"]})};function Ht(e){let t=e._zod.def;if(t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform"))return Ht(t.out);if(t.type==="catch")return Ht(t.innerType);return e._zod.optin}var Gi=(e,t,r,o)=>{let n=r,i=e._zod.def,s=i.shape;if(Object.getOwnPropertySymbols(s).length&&q(e,t,n,o,"Symbol keys cannot be represented in JSON Schema"))return;n.type="object",n.properties={};for(let u in s)j(n.properties,u,Z(s[u],t,{...o,path:[...o.path,"properties",u]}));let a=[];for(let u of Object.keys(s)){let p=i.shape[u];if(t.io==="input"?Ht(p)===void 0:p._zod.optout===void 0)a.push(u)}if(a.length>0)n.required=a;if(i.catchall?._zod.def.type==="never")n.additionalProperties=!1;else if(!i.catchall){if(t.io==="output")n.additionalProperties=!1}else if(i.catchall)n.additionalProperties=Z(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})},Xi=(e,t,r,o)=>{let n=e._zod.def,i=n.inclusive===!1,s=n.options.map((c,a)=>Z(c,t,{...o,path:[...o.path,i?"oneOf":"anyOf",a]}));if(i)r.oneOf=s;else r.anyOf=s},Yi=(e,t,r,o)=>{let n=e._zod.def,i=Z(n.left,t,{...o,path:[...o.path,"allOf",0]}),s=Z(n.right,t,{...o,path:[...o.path,"allOf",1]}),c=(u)=>("allOf"in u)&&Object.keys(u).length===1,a=[...c(i)?i.allOf:[i],...c(s)?s.allOf:[s]];r.allOf=a,t.intersections.push(a)};var qi=(e,t,r,o)=>{let n=e._zod.def,i=Z(n.innerType,t,o),s=t.seen.get(e);if(t.target==="openapi-3.0")s.ref=n.innerType,r.nullable=!0;else r.anyOf=[i,{type:"null"}]},Qi=(e,t,r,o)=>{let n=e._zod.def;Z(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},Gt=Symbol();function es(e,t,r,o,n){let i=!1,s=JSON.stringify(e,(c,a)=>{if(typeof a!=="bigint")return a;return i=!0,null});if(!i)return JSON.parse(s);return q(t,r,o,n,"BigInt defaults cannot be represented in JSON Schema"),Gt}var ts=(e,t,r,o)=>{let n=e._zod.def;Z(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType;let s=es(n.defaultValue,e,t,r,o);if(s!==Gt)r.default=s},rs=(e,t,r,o)=>{let n=e._zod.def;Z(n.innerType,t,o);let i=t.seen.get(e);if(i.ref=n.innerType,t.io!=="input")return;let s=es(n.defaultValue,e,t,r,o);if(s!==Gt)r._prefault=s},os=(e,t,r,o)=>{let n=e._zod.def;Z(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType;let s;try{s=n.catchValue(void 0)}catch{q(e,t,r,o,"Dynamic catch values are not supported in JSON Schema");return}r.default=s},ns=(e,t,r,o)=>{let n=e._zod.def,i=n.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?i?n.out:n.in:n.out;Z(s,t,o);let c=t.seen.get(e);c.ref=s},is=(e,t,r,o)=>{let n=e._zod.def;Z(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.readOnly=!0};var Xt=(e,t,r,o)=>{let n=e._zod.def;Z(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType};var ss=new WeakSet([Object.prototype,Error.prototype]);function Ye(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let o=r(this);return Object.defineProperty(this,t,{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,t,{value:o,configurable:!0,writable:!0})}})}var Lc=(e,t)=>{Cr.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);if(ss.has(r))return;ss.add(r),Ye(r,"format",(o)=>(n)=>Dr(o,n)),Ye(r,"flatten",(o)=>(n)=>Nr(o,n)),Ye(r,"addIssue",(o)=>(n)=>{o.issues.push(n),o.message=JSON.stringify(o.issues,le,2)}),Ye(r,"addIssues",(o)=>(n)=>{o.issues.push(...n),o.message=JSON.stringify(o.issues,le,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}})};var R=l("ZodError",Lc,void 0,{Parent:Error});var cs=Te(R),as=Ae(R),us=Re(R),ls=Ce(R),ps=Lr(R),fs=jr(R),ds=Fr(R),ms=Mr(R),hs=Ur(R),ys=Jr(R),gs=Br(R),_s=Wr(R);function Fc(){if(!A.localeError)N(Tt())}function Qt(){if(!A.memoizer)N({memoizer:Un()})}var k=l("ZodType",(e,t)=>(Fc(),w.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(T(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(Ka(e,t))},superRefine(e,t){return this.check(La(e,t))},overwrite(e){return this.check(H(e))},optional(){return vs(this)},exactOptional(){return wa(this)},nullable(){return Ps(this)},nullish(){return vs(Ps(this))},nonoptional(e){return Ea(this,e)},array(){return ya(this)},or(e){return xa([this,e])},and(e){return va(this,e)},transform(e){return zs(this,$a(e))},default(e){return Za(this,e)},prefault(e){return Ia(this,e)},catch(e){return Aa(this,e)},pipe(e){return zs(this,e)},readonly(){return Na(this)},describe(e){let t=this.clone();return Y.add(t,{description:e}),t},meta(...e){if(e.length===0)return Y.get(this);let t=this.clone();return Y.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 Ie(this,"~standard",{...kt(this),jsonSchema:{input:xe(this,"input"),output:xe(this,"output")}})},set "~standard"(e){B(this,"~standard",e)},parse:function e(t,r){return cs(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await as(this,t,r,{callee:e})},safeParse(e,t){return us(this,e,t)},async safeParseAsync(e,t){return ls(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){B(this,"spa",e)},validate(e,t){return yt(this,e,t)},validateAsync(e,t){return gt(this,e,t)},encode:function e(t,r){return ps(this,t,r,{callee:e})},decode:function e(t,r){return fs(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await ds(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await ms(this,t,r,{callee:e})},safeEncode(e,t){return hs(this,e,t)},safeDecode(e,t){return ys(this,e,t)},async safeEncodeAsync(e,t){return gs(this,e,t)},async safeDecodeAsync(e,t){return _s(this,e,t)},toJSONSchema(e){return Ti(this,{})(e)},get description(){return Y.get(this)?.description},get _def(){return this._zod.def}}),$s=l("_ZodString",(e,t)=>{je.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Fi(e,r,o,n)},Or({format:(e)=>D(e).format??null,minLength:(e)=>D(e).minimum??null,maxLength:(e)=>D(e).maximum??null},{regex(...e){return this.check(At(...e))},includes(...e){return this.check(Nt(...e))},startsWith(...e){return this.check(Dt(...e))},endsWith(...e){return this.check(Kt(...e))},min(...e){return this.check(re(...e))},max(...e){return this.check(Ge(...e))},length(...e){return this.check(Xe(...e))},nonempty(...e){return this.check(re(1,...e))},lowercase(e){return this.check(Rt(e))},uppercase(e){return this.check(Ct(e))},trim(){return this.check(jt())},normalize(...e){return this.check(Lt(...e))},toLowerCase(){return this.check(Ft())},toUpperCase(){return this.check(Mt())},slugify(){return this.check(Ut())}})),Mc=l("ZodString",(e,t)=>{je.init(e,t),$s.init(e,t)},{email(e){return this.check(Hn(Vc,e))},url(e){return this.check(ei(Gc,e))},jwt(e){return this.check(hi(la,e))},emoji(e){return this.check(ti(Xc,e))},guid(e){return this.check(Gn(Hc,e))},uuid(e){return this.check(Xn(qe,e))},uuidv4(e){return this.check(Yn(qe,e))},uuidv6(e){return this.check(qn(qe,e))},uuidv7(e){return this.check(Qn(qe,e))},nanoid(e){return this.check(ri(Yc,e))},cuid(e){return this.check(oi(qc,e))},cuid2(e){return this.check(ni(Qc,e))},ulid(e){return this.check(ii(ea,e))},base64(e){return this.check(fi(ca,e))},base64url(e){return this.check(di(aa,e))},xid(e){return this.check(si(ta,e))},ksuid(e){return this.check(ci(ra,e))},ipv4(e){return this.check(ai(oa,e))},ipv6(e){return this.check(ui(na,e))},cidrv4(e){return this.check(li(ia,e))},cidrv6(e){return this.check(pi(sa,e))},e164(e){return this.check(mi(ua,e))},datetime(e){return this.check(yi(Uc,e))},date(e){return this.check(gi(Jc,e))},time(e){return this.check(_i(Bc,e))},duration(e){return this.check(xi(Wc,e))}});function Qe(e){return Vn(Mc,e)}var z=l("ZodStringFormat",(e,t)=>{P.init(e,t),$s.init(e,t)}),Uc=l("ZodISODateTime",(e,t)=>{nn.init(e,t),z.init(e,t)}),Jc=l("ZodISODate",(e,t)=>{sn.init(e,t),z.init(e,t)}),Bc=l("ZodISOTime",(e,t)=>{cn.init(e,t),z.init(e,t)}),Wc=l("ZodISODuration",(e,t)=>{an.init(e,t),z.init(e,t)}),Vc=l("ZodEmail",(e,t)=>{Vo.init(e,t),z.init(e,t)});var Hc=l("ZodGUID",(e,t)=>{Bo.init(e,t),z.init(e,t)});var qe=l("ZodUUID",(e,t)=>{Wo.init(e,t),z.init(e,t)});var Gc=l("ZodURL",(e,t)=>{Xo.init(e,t),z.init(e,t)});var Xc=l("ZodEmoji",(e,t)=>{Yo.init(e,t),z.init(e,t)});var Yc=l("ZodNanoID",(e,t)=>{qo.init(e,t),z.init(e,t)});var qc=l("ZodCUID",(e,t)=>{Qo.init(e,t),z.init(e,t)});var Qc=l("ZodCUID2",(e,t)=>{en.init(e,t),z.init(e,t)});var ea=l("ZodULID",(e,t)=>{tn.init(e,t),z.init(e,t)});var ta=l("ZodXID",(e,t)=>{rn.init(e,t),z.init(e,t)});var ra=l("ZodKSUID",(e,t)=>{on.init(e,t),z.init(e,t)});var oa=l("ZodIPv4",(e,t)=>{un.init(e,t),z.init(e,t)});var na=l("ZodIPv6",(e,t)=>{pn.init(e,t),z.init(e,t)});var ia=l("ZodCIDRv4",(e,t)=>{fn.init(e,t),z.init(e,t)});var sa=l("ZodCIDRv6",(e,t)=>{dn.init(e,t),z.init(e,t)});var ca=l("ZodBase64",(e,t)=>{hn.init(e,t),z.init(e,t)});var aa=l("ZodBase64URL",(e,t)=>{yn.init(e,t),z.init(e,t)});var ua=l("ZodE164",(e,t)=>{gn.init(e,t),z.init(e,t)});var la=l("ZodJWT",(e,t)=>{_n.init(e,t),z.init(e,t)});var ws=l("ZodNumber",(e,t)=>{Zt.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Mi(e,r,o,n),e.isFinite=!0},Or({minValue:(e)=>{let{minimum:t,exclusiveMinimum:r}=D(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:(e)=>{let{maximum:t,exclusiveMaximum:r}=D(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:(e)=>{let{isInt:t,multipleOf:r}=D(e);return!!t||!!r?.some(Number.isSafeInteger)},format:(e)=>D(e).format??null},{gt(e,t){return this.check(Ve(e,t))},gte(e,t){return this.check(ge(e,t))},min(e,t){return this.check(ge(e,t))},lt(e,t){return this.check(We(e,t))},lte(e,t){return this.check(ye(e,t))},max(e,t){return this.check(ye(e,t))},int(e){return this.check(xs(e))},safe(e){return this.check(xs(e))},positive(e){return this.check(Ve(0,e))},nonnegative(e){return this.check(ge(0,e))},negative(e){return this.check(We(0,e))},nonpositive(e){return this.check(ye(0,e))},multipleOf(e,t){return this.check(He(e,t))},step(e,t){return this.check(He(e,t))},finite(){return this}}));function ks(e){return bi(ws,e)}var pa=l("ZodNumberFormat",(e,t)=>{xn.init(e,t),ws.init(e,t)});function xs(e){return vi(pa,e)}var fa=l("ZodUnknown",(e,t)=>{bn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ji(e,r,o,n)});function bs(){return Pi(fa)}var da=l("ZodNever",(e,t)=>{vn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ui(e,r,o,n)});function ma(e){return zi(da,e)}var ha=l("ZodArray",(e,t)=>{Qt(),Pn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hi(e,r,o,n),e.element=t.element},{min(e,t){return this.check(re(e,t))},nonempty(e){return this.check(re(1,e))},max(e,t){return this.check(Ge(e,t))},length(e,t){return this.check(Xe(e,t))},unwrap(){return this.element}});function ya(e,t){return $i(ha,e,t)}var ga=l("ZodObject",(e,t)=>{Qt(),wn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Gi(e,r,o,n),Gs(e,"shape",(r)=>r._zod.def.shape,!1)},{keyof(){return Pa(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(T(this._zod.def,{catchall:e}))},passthrough(){return this.clone(T(this._zod.def,{catchall:bs()}))},loose(){return this.clone(T(this._zod.def,{catchall:bs()}))},strict(){return this.clone(T(this._zod.def,{catchall:ma()}))},strip(){return this.clone(T(this._zod.def,{catchall:void 0}))},extend(e){return Fs(this,e)},safeExtend(e){return Ms(this,e)},merge(e){return Us(this,e)},pick(e){return Ls(this,e)},omit(e){return js(this,e)},partial(...e){return wr(Ss,this,e[0])},exactPartial(...e){return wr(Zs,this,e[0],"exactPartial")},required(...e){return Js(Os,this,e[0])}});function et(e,t){let r={type:"object",shape:e??{},...y(t)};return new ga(r)}var _a=l("ZodUnion",(e,t)=>{kn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Xi(e,r,o,n),e.options=t.options});function xa(e,t){return new _a({type:"union",options:e,...y(t)})}var ba=l("ZodIntersection",(e,t)=>{Sn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Yi(e,r,o,n)});function va(e,t){return new ba({type:"intersection",left:e,right:t})}var qt=l("ZodEnum",(e,t)=>{Zn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Bi(e,o,n,i),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let i={};for(let s of o)if(r.has(s))i[s]=t.entries[s];else throw Error(`Key ${s} not found in enum`);return new qt({...t,checks:[],...y(n),entries:i})},e.exclude=(o,n)=>{let i={...t.entries};for(let s of o)if(r.has(s))delete i[s];else throw Error(`Key ${s} not found in enum`);return new qt({...t,checks:[],...y(n),entries:i})}});function Pa(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((o)=>[o,o])):e;return new qt({type:"enum",entries:r,...y(t)})}var za=l("ZodTransform",(e,t)=>{Qt(),On.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vi(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new pe(e.constructor.name);r.addIssue=(i)=>{if(typeof i==="string")r.issues.push(X(i,r.value,t));else{let s=i;if(s.fatal)s.continue=!1;if(s.code??(s.code="custom"),!("input"in s))s.input=r.value;s.inst??(s.inst=e),r.issues.push(X(s))}};let n=t.transform(r.value,r);if(n instanceof Promise)return n.then((i)=>(r.value=i,r));return r.value=n,r}});function $a(e){return new za({type:"transform",transform:e})}var Ss=l("ZodOptional",(e,t)=>{Ot.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Xt(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function vs(e){return new Ss({type:"optional",innerType:e})}var Zs=l("ZodExactOptional",(e,t)=>{In.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Xt(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function wa(e){return new Zs({type:"optional",innerType:e})}var ka=l("ZodNullable",(e,t)=>{En.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qi(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Ps(e){return new ka({type:"nullable",innerType:e})}var Sa=l("ZodDefault",(e,t)=>{Tn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ts(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Za(e,t){return new Sa({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():ut(t)}})}var Oa=l("ZodPrefault",(e,t)=>{An.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>rs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Ia(e,t){return new Oa({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():ut(t)}})}var Os=l("ZodNonOptional",(e,t)=>{Rn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Qi(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Ea(e,t){return new Os({type:"nonoptional",innerType:e,...y(t)})}var Ta=l("ZodCatch",(e,t)=>{Cn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>os(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Aa(e,t){return new Ta({type:"catch",innerType:e,catchValue:typeof t==="function"?t:Ir(t)})}var Ra=l("ZodPipe",(e,t)=>{Nn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ns(e,r,o,n),e.in=t.in,e.out=t.out});function zs(e,t){return new Ra({type:"pipe",in:e,out:t})}var Ca=l("ZodReadonly",(e,t)=>{Dn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>is(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Na(e){return new Ca({type:"readonly",innerType:e})}var Da=l("ZodCustom",(e,t)=>{Kn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Wi(e,r,o,n)});function Ka(e,t={}){return wi(Da,e,t)}function La(e,t){return ki(e,t)}var be=et({mode:ks().optional()});import{mkdir as ja,open as Fa}from"fs/promises";import{dirname as Ma}from"path";function Is(e){return{async write(t){await ja(Ma(e),{recursive:!0});let r=await Fa(e,"w");try{let o=[];for await(let n of t)o.push((async()=>{let i=n.stream.getReader(),s=n.offset;for(;;){let{done:c,value:a}=await i.read();if(c)break;let u=a.payload.data;await r.write(u,0,u.byteLength,s),s+=u.byteLength}await n.complete()})());await Promise.all(o)}finally{await r.close()}}}}import{createReadStream as Ua}from"fs";import{Readable as Ja}from"stream";function Es(e,t,r){if(r!==void 0&&r<=t)return new ReadableStream({start(n){n.close()}});let o=Ua(e,{start:t,end:r===void 0?void 0:r-1});return fr(Ja.toWeb(o))}function Ts(e){return{kind:"js",stream:Es(e,0),async readRange(t,r){return Es(e,t,r)}}}import{createWriteStream as Ba}from"fs";import{mkdir as Wa,stat as Va}from"fs/promises";import{dirname as Ha}from"path";async function Ga(e){try{return(await Va(e)).size}catch(t){if(t.code==="ENOENT")return 0;throw t}}async function As(e,t){await Wa(Ha(e),{recursive:!0});let r=t?await Ga(e):0,o=Ba(e,{flags:t?"a":"w"});o.on("error",()=>{});let n=r,i=new WritableStream({write(s){return new Promise((c,a)=>{o.write(s.payload.data,(u)=>{if(u){a(u);return}n+=s.payload.data.byteLength,c()})})},close(){return new Promise((s,c)=>{o.end((a)=>a?c(a):s())})},abort(){return new Promise((s)=>{o.once("close",()=>s()),o.destroy()})}});return{kind:"js",stream:i,startOffset:r,resumeToken:()=>({offset:n})}}import{stat as Xa}from"fs/promises";async function er(e){let t=await Xa(e),r=t.isDirectory();return{size:r?void 0:t.size,lastModified:t.mtime,isContainer:r,properties:{mode:t.mode}}}import{readdir as Ya}from"fs/promises";import{join as qa}from"path";async function*tr(e,t,r){let o=await Ya(qa(e,t),{withFileTypes:!0});for(let n of o){let i=t?`${t}/${n.name}`:n.name;if(yield i,n.isDirectory()&&r)yield*tr(e,i,r)}}var ou=8388608;class ve{kind="js";rootPath;constructor(e=""){this.rootPath=e===""?"":ru(e)}async[Symbol.asyncDispose](){}async createContainer(e){await rr(E(this.rootPath,e),{recursive:!0})}joinKey(e,t){return rt(e,t)}list(e,t){let r=this.rootPath,o=E(r,e);async function*n(){for await(let i of tr(o,"",t?.recursive??!1)){if(t?.regex&&!t.regex.test(i))continue;let s=await er(rt(o,i));yield{path:i,properties:s}}}return n()}async getProperties(e){return er(E(this.rootPath,e))}async setProperties(e,t){let r=E(this.rootPath,e),o=be.parse(t.properties??{});if(o.mode!==void 0)await Qa(r,o.mode);if(t.lastModified!==void 0)await tu(r,t.lastModified,t.lastModified)}async delete(e){await Cs(E(this.rootPath,e),{recursive:!0,force:!1})}async getReadableStream(e){return Ts(E(this.rootPath,e))}async getWritableStream(e,t){return As(E(this.rootPath,e),t?.resume)}getPartSizeConstraints(e){return{minPartSize:0,maxPartSize:1/0,maxParts:1/0,defaultPartSize:ou}}getMultipartWriter(e,t){return Is(E(this.rootPath,e))}canDirectTransfer(e){return e instanceof ve&&e.rootPath===this.rootPath}supportsRecursiveDirectTransfer=!0;async directCopy(e,t,r){let o=E(this.rootPath,t);await rr(rt(o,".."),{recursive:!0}),await Rs(E(this.rootPath,e),o,{recursive:!0})}async directMove(e,t,r){let o=E(this.rootPath,e),n=E(this.rootPath,t);await rr(rt(n,".."),{recursive:!0});try{await eu(o,n)}catch(i){if(i.code==="EXDEV"){await Rs(o,n,{recursive:!0}),await Cs(o,{recursive:!0,force:!1});return}throw i}}}import{fileURLToPath as nu}from"url";function or(e){if(/^file:/i.test(e))return{path:nu(new URL(e))};return{path:e}}import{join as iu}from"path";function nr(e){let t={rootPath:""};if(e.filename!==void 0)return{config:t,target:{kind:"entry",key:iu(e.path,e.filename)}};if(e.pattern!==void 0)return{config:t,target:{kind:"pattern",containerKey:e.path,pattern:e.pattern}};return{config:t,target:{kind:"container",key:e.path}}}var ir=et({rootPath:Qe().optional()});var sr=et({path:Qe().default("/"),filename:Qe().optional(),pattern:Qe().optional()}).refine((e)=>e.filename===void 0||e.pattern===void 0,{message:"filename and pattern are mutually exclusive"});var cr=et({mode:ks().optional()});var ar={protocol:"file",kind:"js",configSchema:ir,locationSchema:sr,propertySchema:cr,settablePropertySchema:be,parseLocationString:or,toProviderInputs:nr,async createProvider(e){return new ve(e.rootPath)}};var su={create:()=>Promise.resolve(ar)},cu={extensionPoint:pr,factory:su},au={extensionDescriptors:[cu]},uu=au;export{ve as FilesystemIOProvider,uu as default,ir as filesystemConfigSchema,ar as filesystemIOProviderFactory,sr as filesystemLocationSchema,cr as filesystemPropertySchema,be as filesystemSettablePropertySchema,or as parseFileLocationString,nr as toFileProviderInputs};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowscripter/io-plugin-filesystem",
3
- "version": "1.1.7",
3
+ "version": "2.0.1",
4
4
  "description": "Local filesystem source/sink plugin for https://github.com/flowscripter/pluggable-io-framework",
5
5
  "keywords": [
6
6
  "bun",
@@ -36,15 +36,15 @@
36
36
  "test": "bun test"
37
37
  },
38
38
  "dependencies": {
39
- "@flowscripter/pluggable-io-framework-api": "^1.1.6",
39
+ "@flowscripter/pluggable-io-framework-api": "^3.1.1",
40
40
  "zod": "^4.6.5"
41
41
  },
42
42
  "devDependencies": {
43
- "@flowscripter/dynamic-plugin-framework": "^2.2.15",
43
+ "@flowscripter/dynamic-plugin-framework": "^2.2.19",
44
44
  "@types/bun": "^1.4.2",
45
- "@types/node": "^26.6.3",
46
- "oxfmt": "0.71.0",
47
- "oxlint": "1.86.0"
45
+ "@types/node": "^26.6.4",
46
+ "oxfmt": "0.72.0",
47
+ "oxlint": "1.87.0"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "@flowscripter/dynamic-plugin-framework": "*",