@mintlify/cli 4.1.66 → 4.1.67

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.
@@ -0,0 +1,9 @@
1
+ import { createRequire as __mintCreateRequire } from 'node:module';
2
+ import { fileURLToPath as __mintFileURLToPath } from 'node:url';
3
+ import { dirname as __mintDirname } from 'node:path';
4
+ const require = __mintCreateRequire(import.meta.url);
5
+ const __filename = __mintFileURLToPath(import.meta.url);
6
+ const __dirname = __mintDirname(__filename);
7
+ import{f as e,g as t,i as n,l as r,n as i,o as a,t as o,u as s,y as c}from"./esm-BtDK7B-d.js";import{n as l,t as u}from"./agent-Da2kI1tZ.js";import{a as d,i as f,n as p,o as m,r as h,s as g}from"./multi-repo-config-BdcKgu6I.js";import{link as _,mkdir as v,readFile as y,readdir as b,rename as x,rm as S,writeFile as C}from"node:fs/promises";import w from"node:path";import{execFile as T}from"node:child_process";import{randomUUID as E}from"node:crypto";import{promisify as D}from"node:util";function O(e,t){let n=t!==!1;return/^(y|yes)/i.test(e)?n=!0:/^(n|no)/i.test(e)&&(n=!1),n}function k(e){return e?`Yes`:`No`}var A=n((n,i)=>{let{transformer:o=k}=n,[l,u]=e(`idle`),[d,f]=e(``),p=s(n.theme),m=r({status:l,theme:p});a((e,r)=>{if(l===`idle`){if(t(e)){let e=O(d,n.default);f(o(e)),u(`done`),i(e)}else if(c(e)){let e=k(!O(d,n.default));r.clearLine(0),r.write(e),f(e)}else f(r.line)}});let h=d,g=``;return l===`done`?h=p.style.answer(d):g=` ${p.style.defaultAnswer(n.default===!1?`y/N`:`Y/n`)}`,`${m} ${p.style.message(n.message,l)}${g} ${h}`}),j=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const M={text:(e,t)=>i({message:e,default:t}),confirm:(e,t)=>A({message:e,default:t}),folder:(e,t)=>o({message:e+` (type a path to see matching folders)`,source:e=>j(void 0,void 0,void 0,function*(){let n=d(e?.trim()||t,process.cwd()),r=w.dirname(n),i=w.basename(n),a=(yield b(r,{withFileTypes:!0}).catch(()=>[])).filter(e=>e.isDirectory()&&e.name.startsWith(i)).slice(0,30).map(e=>w.join(r,e.name));return(e?.endsWith(`/`)||e?.endsWith(w.sep))&&a.push(...(yield b(n,{withFileTypes:!0}).catch(()=>[])).filter(e=>e.isDirectory()).slice(0,30).map(e=>w.join(n,e.name))),[.../* @__PURE__ */ new Set([n,...a])].map(e=>({name:e,value:e}))}),validate:e=>j(void 0,void 0,void 0,function*(){return(yield f(w.join(e,`docs.json`)))||`Select a folder containing docs.json.`})})};function N(e){return j(this,void 0,void 0,function*(){try{let{stdout:t}=yield D(T)(`git`,[`-C`,e,`config`,`--get`,`remote.origin.url`],{timeout:2e3}),n=t.trim().replace(/\.git$/,``).match(/[:/]([^/:]+\/[^/]+)$/);if(n?.[1])return n[1]}catch{}return`local/${w.basename(e)}`})}function P(e){return Array.isArray(e)?e.flatMap(P):e&&typeof e==`object`?Object.entries(e).flatMap(([e,t])=>e===`sourceRef`&&typeof t==`string`?[t]:P(t)):[]}function F(e,t){return j(this,arguments,void 0,function*(e,t,n=M){let r=(yield f(e))?yield y(e,`utf8`):void 0,i;if(r)try{i=yield m(e)}catch{console.log(`The existing config is invalid. It will remain unchanged unless you confirm a valid replacement.`)}console.log(`Choose the base repo, then secondary repos and their URL mounts. The base supplies theme and global styles.`);let a=i?.sources.find(e=>e.base),o=yield n.folder(`Base repository folder`,a?d(a.directory,w.dirname(e)):t),s=[{repo:yield n.text(`Base repository identifier (owner/repo)`,a?.repo??(yield N(o))),directory:w.relative(w.dirname(e),o)||`.`,mountPath:``,base:!0}],c=JSON.parse(yield y(w.join(o,`docs.json`),`utf8`)),l=[...new Set(P(c))],u=i?.sources.filter(e=>!e.base)??[],p=0;for(;yield n.confirm(p===0?`Add a secondary repository?`:`Add another secondary repository?`,p<u.length||l.some(e=>!s.some(t=>t.repo===e)));){let t=u[p++],r=yield n.folder(`Secondary repository folder`,t?d(t.directory,w.dirname(e)):w.dirname(o)),i=t?.repo??l.find(e=>!s.some(t=>t.repo===e))??(yield N(r)),a=yield n.text(`Repository identifier (match navigation sourceRef when present)`,i),c=(yield n.text(`URL mount path (for example api serves /api)`,t?.mountPath??w.basename(r))).replace(/^\/+|\/+$/g,``);s.push({repo:a,directory:w.relative(w.dirname(e),r)||`.`,mountPath:c})}let h={sources:s};yield g(h,e),console.log(`
8
+ Workspace mapping:`);for(let t of s)console.log(` ${t.repo}${t.base?` (base)`:``}: ${d(t.directory,w.dirname(e))} → /${t.mountPath}`);if(!(yield n.confirm(`Save ${e} and start preview?`,!0)))throw Error(`Setup cancelled. No config was changed.`);if(yield v(w.dirname(e),{recursive:!0}),((yield f(e))?yield y(e,`utf8`):void 0)!==r)throw Error(`The config changed during setup. Nothing was overwritten; run --setup again.`);let b=`${e}.${E()}.tmp`;try{yield C(b,JSON.stringify(h,null,2)+`
9
+ `,{flag:`wx`}),r===void 0?yield _(b,e):yield x(b,e)}finally{yield S(b,{force:!0})}return e})}function I(e,t){return j(this,void 0,void 0,function*(){var n;let r=(yield h(e.cwd,e.workspace))??w.join(e.cwd,p);if((yield f(r))&&!e.setup)return yield g(yield m(r),r),r;let i=t||process.stdin.isTTY&&process.stdout.isTTY&&!u()&&!l();if(e.nonInteractive||!i)throw Error(`${e.setup?`--setup requires an interactive human terminal.`:`No local multi-repo config found at ${r}.`} Create or update ${r}, then run mint dev --multi-repo --workspace "${r}" --non-interactive. Run mint dev --multi-repo --help for the complete example and field explanations.`);let a=yield F(r,e.cwd,t);return(n=e.onSaved)==null||n.call(e,a),a})}export{F as configureWorkspace,I as resolveWorkspace};
@@ -41,62 +41,62 @@ function e(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{val
41
41
  newResult[${o}] = ${n}.value;
42
42
  }
43
43
 
44
- `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},o,c=h,l=!r.jitless,u=l&&re.value,d=t.catchall,f;e._zod.parse=(r,s)=>{f??=i.value;let p=r.value;return c(p)?l&&u&&s?.async===!1&&s.jitless!==!0?(o||=a(t.shape),r=o(r,s),d?nn([],p,r,s,f,e):r):n(r,s):(r.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),r)}});function on(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let a=e.filter(e=>!b(e));return a.length===1?(t.value=a[0].value,a[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>C(e,r,i())))}),t)}const sn=/*@__PURE__*/ e(`$ZodUnion`,(e,t)=>{M.init(e,t),f(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),f(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),f(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),f(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>l(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>on(t,i,e,a)):on(s,i,e,a)}}),cn=/*@__PURE__*/ e(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,sn.init(e,t);let n=e._zod.parse;f(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=/* @__PURE__ */ new Set);for(let r of n)e[t].add(r)}}return e});let r=s(()=>{let e=t.options,n=/* @__PURE__ */ new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!h(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),ln=/*@__PURE__*/ e(`$ZodIntersection`,(e,t)=>{M.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>un(e,t,n)):un(e,i,a)}});function I(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(g(e)&&g(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=I(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=I(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function un(e,t,n){let r=/* @__PURE__ */ new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),b(e))return e;let o=I(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const dn=/*@__PURE__*/ e(`$ZodRecord`,(e,t)=>{M.init(e,t),e._zod.parse=(n,r)=>{let a=n.value;if(!g(a))return n.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),n;let o=[],s=t.keyType._zod.values;if(s){n.value={};let i=/* @__PURE__ */ new Set;for(let e of s)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){i.add(typeof e==`number`?e.toString():e);let s=t.valueType._zod.run({value:a[e],issues:[]},r);s instanceof Promise?o.push(s.then(t=>{t.issues.length&&n.issues.push(...x(e,t.issues)),n.value[e]=t.value})):(s.issues.length&&n.issues.push(...x(e,s.issues)),n.value[e]=s.value)}let c;for(let e in a)i.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c})}else{n.value={};for(let s of Reflect.ownKeys(a)){if(s===`__proto__`)continue;let c=t.keyType._zod.run({value:s,issues:[]},r);if(c instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof s==`string`&&tt.test(s)&&c.issues.length){let e=t.keyType._zod.run({value:Number(s),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(c=e)}if(c.issues.length){t.mode===`loose`?n.value[s]=a[s]:n.issues.push({code:`invalid_key`,origin:`record`,issues:c.issues.map(e=>C(e,r,i())),input:s,path:[s],inst:e});continue}let l=t.valueType._zod.run({value:a[s],issues:[]},r);l instanceof Promise?o.push(l.then(e=>{e.issues.length&&n.issues.push(...x(s,e.issues)),n.value[c.value]=e.value})):(l.issues.length&&n.issues.push(...x(s,l.issues)),n.value[c.value]=l.value)}}return o.length?Promise.all(o).then(()=>n):n}}),fn=/*@__PURE__*/ e(`$ZodEnum`,(e,t)=>{M.init(e,t);let n=a(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>ae.has(typeof e)).map(e=>typeof e==`string`?_(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),pn=/*@__PURE__*/ e(`$ZodLiteral`,(e,t)=>{if(M.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?_(e):e?_(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),mn=/*@__PURE__*/ e(`$ZodTransform`,(e,r)=>{M.init(e,r),e._zod.parse=(i,a)=>{if(a.direction===`backward`)throw new n(e.constructor.name);let o=r.transform(i.value,i);if(a.async)return(o instanceof Promise?o:Promise.resolve(o)).then(e=>(i.value=e,i));if(o instanceof Promise)throw new t;return i.value=o,i}});function hn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const gn=/*@__PURE__*/ e(`$ZodOptional`,(e,t)=>{M.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,f(e._zod,`values`,()=>t.innerType._zod.values?/* @__PURE__ */ new Set([...t.innerType._zod.values,void 0]):void 0),f(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${l(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>hn(t,e.value)):hn(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),_n=/*@__PURE__*/ e(`$ZodExactOptional`,(e,t)=>{gn.init(e,t),f(e._zod,`values`,()=>t.innerType._zod.values),f(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),vn=/*@__PURE__*/ e(`$ZodNullable`,(e,t)=>{M.init(e,t),f(e._zod,`optin`,()=>t.innerType._zod.optin),f(e._zod,`optout`,()=>t.innerType._zod.optout),f(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${l(e.source)}|null)$`):void 0}),f(e._zod,`values`,()=>t.innerType._zod.values?/* @__PURE__ */ new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),yn=/*@__PURE__*/ e(`$ZodDefault`,(e,t)=>{M.init(e,t),e._zod.optin=`optional`,f(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>bn(e,t)):bn(r,t)}});function bn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const xn=/*@__PURE__*/ e(`$ZodPrefault`,(e,t)=>{M.init(e,t),e._zod.optin=`optional`,f(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Sn=/*@__PURE__*/ e(`$ZodNonOptional`,(e,t)=>{M.init(e,t),f(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Cn(t,e)):Cn(i,e)}});function Cn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}const wn=/*@__PURE__*/ e(`$ZodCatch`,(e,t)=>{M.init(e,t),f(e._zod,`optin`,()=>t.innerType._zod.optin),f(e._zod,`optout`,()=>t.innerType._zod.optout),f(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>C(e,n,i()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>C(e,n,i()))},input:e.value}),e.issues=[]),e)}}),Tn=/*@__PURE__*/ e(`$ZodPipe`,(e,t)=>{M.init(e,t),f(e._zod,`values`,()=>t.in._zod.values),f(e._zod,`optin`,()=>t.in._zod.optin),f(e._zod,`optout`,()=>t.out._zod.optout),f(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>L(e,t.in,n)):L(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>L(e,t.out,n)):L(r,t.out,n)}});function L(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const En=/*@__PURE__*/ e(`$ZodReadonly`,(e,t)=>{M.init(e,t),f(e._zod,`propValues`,()=>t.innerType._zod.propValues),f(e._zod,`values`,()=>t.innerType._zod.values),f(e._zod,`optin`,()=>t.innerType?._zod?.optin),f(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Dn):Dn(r)}});function Dn(e){return e.value=Object.freeze(e.value),e}const On=/*@__PURE__*/ e(`$ZodCustom`,(e,t)=>{A.init(e,t),M.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>kn(t,n,r,e));kn(i,n,r,e)}});function kn(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(T(e))}}var An,jn=class{constructor(){this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Mn(){return new jn}(An=globalThis).__zod_globalRegistry??(An.__zod_globalRegistry=Mn());const R=globalThis.__zod_globalRegistry;// @__NO_SIDE_EFFECTS__
45
- function Nn(e,t){return new e({type:`string`,...y(t)})}// @__NO_SIDE_EFFECTS__
46
- function z(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
47
- function Pn(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
48
- function Fn(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
49
- function In(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...y(t)})}// @__NO_SIDE_EFFECTS__
50
- function Ln(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...y(t)})}// @__NO_SIDE_EFFECTS__
51
- function Rn(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...y(t)})}// @__NO_SIDE_EFFECTS__
52
- function zn(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
53
- function Bn(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
54
- function Vn(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
55
- function Hn(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
56
- function Un(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
57
- function Wn(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
58
- function Gn(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
59
- function Kn(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
60
- function qn(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
61
- function Jn(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
62
- function Yn(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
63
- function Xn(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
64
- function Zn(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
65
- function Qn(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
66
- function $n(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
67
- function er(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
68
- function tr(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...y(t)})}// @__NO_SIDE_EFFECTS__
69
- function nr(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...y(t)})}// @__NO_SIDE_EFFECTS__
70
- function rr(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...y(t)})}// @__NO_SIDE_EFFECTS__
71
- function ir(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...y(t)})}// @__NO_SIDE_EFFECTS__
72
- function ar(e,t){return new e({type:`number`,checks:[],...y(t)})}// @__NO_SIDE_EFFECTS__
73
- function or(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...y(t)})}// @__NO_SIDE_EFFECTS__
74
- function sr(e,t){return new e({type:`boolean`,...y(t)})}// @__NO_SIDE_EFFECTS__
75
- function cr(e){return new e({type:`unknown`})}// @__NO_SIDE_EFFECTS__
76
- function lr(e,t){return new e({type:`never`,...y(t)})}// @__NO_SIDE_EFFECTS__
77
- function ur(e,t){return new ot({check:`less_than`,...y(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
44
+ `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},o,c=h,l=!r.jitless,u=l&&re.value,d=t.catchall,f;e._zod.parse=(r,s)=>{f??=i.value;let p=r.value;return c(p)?l&&u&&s?.async===!1&&s.jitless!==!0?(o||=a(t.shape),r=o(r,s),d?nn([],p,r,s,f,e):r):n(r,s):(r.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),r)}});function on(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let a=e.filter(e=>!b(e));return a.length===1?(t.value=a[0].value,a[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>C(e,r,i())))}),t)}const sn=/*@__PURE__*/ e(`$ZodUnion`,(e,t)=>{M.init(e,t),f(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),f(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),f(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),f(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>l(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>on(t,i,e,a)):on(s,i,e,a)}}),cn=/*@__PURE__*/ e(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,sn.init(e,t);let n=e._zod.parse;f(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=/* @__PURE__ */ new Set);for(let r of n)e[t].add(r)}}return e});let r=s(()=>{let e=t.options,n=/* @__PURE__ */ new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!h(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),ln=/*@__PURE__*/ e(`$ZodIntersection`,(e,t)=>{M.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>un(e,t,n)):un(e,i,a)}});function I(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(g(e)&&g(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=I(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=I(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function un(e,t,n){let r=/* @__PURE__ */ new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),b(e))return e;let o=I(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const dn=/*@__PURE__*/ e(`$ZodTuple`,(e,t)=>{M.init(e,t);let n=t.items;e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({input:a,inst:e,expected:`tuple`,code:`invalid_type`}),r;r.value=[];let o=[],s=[...n].reverse().findIndex(e=>e._zod.optin!==`optional`),c=s===-1?0:n.length-s;if(!t.rest){let t=a.length>n.length,i=a.length<c-1;if(t||i)return r.issues.push({...t?{code:`too_big`,maximum:n.length,inclusive:!0}:{code:`too_small`,minimum:n.length},input:a,inst:e,origin:`array`}),r}let l=-1;for(let e of n){if(l++,l>=a.length&&l>=c)continue;let t=e._zod.run({value:a[l],issues:[]},i);t instanceof Promise?o.push(t.then(e=>L(e,r,l))):L(t,r,l)}if(t.rest){let e=a.slice(n.length);for(let n of e){l++;let e=t.rest._zod.run({value:n,issues:[]},i);e instanceof Promise?o.push(e.then(e=>L(e,r,l))):L(e,r,l)}}return o.length?Promise.all(o).then(()=>r):r}});function L(e,t,n){e.issues.length&&t.issues.push(...x(n,e.issues)),t.value[n]=e.value}const fn=/*@__PURE__*/ e(`$ZodRecord`,(e,t)=>{M.init(e,t),e._zod.parse=(n,r)=>{let a=n.value;if(!g(a))return n.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),n;let o=[],s=t.keyType._zod.values;if(s){n.value={};let i=/* @__PURE__ */ new Set;for(let e of s)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){i.add(typeof e==`number`?e.toString():e);let s=t.valueType._zod.run({value:a[e],issues:[]},r);s instanceof Promise?o.push(s.then(t=>{t.issues.length&&n.issues.push(...x(e,t.issues)),n.value[e]=t.value})):(s.issues.length&&n.issues.push(...x(e,s.issues)),n.value[e]=s.value)}let c;for(let e in a)i.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c})}else{n.value={};for(let s of Reflect.ownKeys(a)){if(s===`__proto__`)continue;let c=t.keyType._zod.run({value:s,issues:[]},r);if(c instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof s==`string`&&tt.test(s)&&c.issues.length){let e=t.keyType._zod.run({value:Number(s),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(c=e)}if(c.issues.length){t.mode===`loose`?n.value[s]=a[s]:n.issues.push({code:`invalid_key`,origin:`record`,issues:c.issues.map(e=>C(e,r,i())),input:s,path:[s],inst:e});continue}let l=t.valueType._zod.run({value:a[s],issues:[]},r);l instanceof Promise?o.push(l.then(e=>{e.issues.length&&n.issues.push(...x(s,e.issues)),n.value[c.value]=e.value})):(l.issues.length&&n.issues.push(...x(s,l.issues)),n.value[c.value]=l.value)}}return o.length?Promise.all(o).then(()=>n):n}}),pn=/*@__PURE__*/ e(`$ZodEnum`,(e,t)=>{M.init(e,t);let n=a(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>ae.has(typeof e)).map(e=>typeof e==`string`?_(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),mn=/*@__PURE__*/ e(`$ZodLiteral`,(e,t)=>{if(M.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?_(e):e?_(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),hn=/*@__PURE__*/ e(`$ZodTransform`,(e,r)=>{M.init(e,r),e._zod.parse=(i,a)=>{if(a.direction===`backward`)throw new n(e.constructor.name);let o=r.transform(i.value,i);if(a.async)return(o instanceof Promise?o:Promise.resolve(o)).then(e=>(i.value=e,i));if(o instanceof Promise)throw new t;return i.value=o,i}});function gn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const _n=/*@__PURE__*/ e(`$ZodOptional`,(e,t)=>{M.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,f(e._zod,`values`,()=>t.innerType._zod.values?/* @__PURE__ */ new Set([...t.innerType._zod.values,void 0]):void 0),f(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${l(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>gn(t,e.value)):gn(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),vn=/*@__PURE__*/ e(`$ZodExactOptional`,(e,t)=>{_n.init(e,t),f(e._zod,`values`,()=>t.innerType._zod.values),f(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),yn=/*@__PURE__*/ e(`$ZodNullable`,(e,t)=>{M.init(e,t),f(e._zod,`optin`,()=>t.innerType._zod.optin),f(e._zod,`optout`,()=>t.innerType._zod.optout),f(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${l(e.source)}|null)$`):void 0}),f(e._zod,`values`,()=>t.innerType._zod.values?/* @__PURE__ */ new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),bn=/*@__PURE__*/ e(`$ZodDefault`,(e,t)=>{M.init(e,t),e._zod.optin=`optional`,f(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>xn(e,t)):xn(r,t)}});function xn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Sn=/*@__PURE__*/ e(`$ZodPrefault`,(e,t)=>{M.init(e,t),e._zod.optin=`optional`,f(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Cn=/*@__PURE__*/ e(`$ZodNonOptional`,(e,t)=>{M.init(e,t),f(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>wn(t,e)):wn(i,e)}});function wn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}const Tn=/*@__PURE__*/ e(`$ZodCatch`,(e,t)=>{M.init(e,t),f(e._zod,`optin`,()=>t.innerType._zod.optin),f(e._zod,`optout`,()=>t.innerType._zod.optout),f(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>C(e,n,i()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>C(e,n,i()))},input:e.value}),e.issues=[]),e)}}),En=/*@__PURE__*/ e(`$ZodPipe`,(e,t)=>{M.init(e,t),f(e._zod,`values`,()=>t.in._zod.values),f(e._zod,`optin`,()=>t.in._zod.optin),f(e._zod,`optout`,()=>t.out._zod.optout),f(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>R(e,t.in,n)):R(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>R(e,t.out,n)):R(r,t.out,n)}});function R(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Dn=/*@__PURE__*/ e(`$ZodReadonly`,(e,t)=>{M.init(e,t),f(e._zod,`propValues`,()=>t.innerType._zod.propValues),f(e._zod,`values`,()=>t.innerType._zod.values),f(e._zod,`optin`,()=>t.innerType?._zod?.optin),f(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(On):On(r)}});function On(e){return e.value=Object.freeze(e.value),e}const kn=/*@__PURE__*/ e(`$ZodCustom`,(e,t)=>{A.init(e,t),M.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>An(t,n,r,e));An(i,n,r,e)}});function An(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(T(e))}}var jn,Mn=class{constructor(){this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Nn(){return new Mn}(jn=globalThis).__zod_globalRegistry??(jn.__zod_globalRegistry=Nn());const z=globalThis.__zod_globalRegistry;// @__NO_SIDE_EFFECTS__
45
+ function Pn(e,t){return new e({type:`string`,...y(t)})}// @__NO_SIDE_EFFECTS__
46
+ function Fn(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
47
+ function In(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
48
+ function Ln(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
49
+ function Rn(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...y(t)})}// @__NO_SIDE_EFFECTS__
50
+ function zn(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...y(t)})}// @__NO_SIDE_EFFECTS__
51
+ function Bn(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...y(t)})}// @__NO_SIDE_EFFECTS__
52
+ function Vn(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
53
+ function Hn(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
54
+ function Un(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
55
+ function Wn(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
56
+ function Gn(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
57
+ function Kn(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
58
+ function qn(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
59
+ function Jn(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
60
+ function Yn(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
61
+ function Xn(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
62
+ function Zn(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
63
+ function Qn(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
64
+ function $n(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
65
+ function er(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
66
+ function tr(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
67
+ function nr(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
68
+ function rr(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...y(t)})}// @__NO_SIDE_EFFECTS__
69
+ function ir(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...y(t)})}// @__NO_SIDE_EFFECTS__
70
+ function ar(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...y(t)})}// @__NO_SIDE_EFFECTS__
71
+ function or(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...y(t)})}// @__NO_SIDE_EFFECTS__
72
+ function sr(e,t){return new e({type:`number`,checks:[],...y(t)})}// @__NO_SIDE_EFFECTS__
73
+ function cr(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...y(t)})}// @__NO_SIDE_EFFECTS__
74
+ function lr(e,t){return new e({type:`boolean`,...y(t)})}// @__NO_SIDE_EFFECTS__
75
+ function ur(e){return new e({type:`unknown`})}// @__NO_SIDE_EFFECTS__
76
+ function dr(e,t){return new e({type:`never`,...y(t)})}// @__NO_SIDE_EFFECTS__
77
+ function fr(e,t){return new ot({check:`less_than`,...y(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
78
78
  function B(e,t){return new ot({check:`less_than`,...y(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
79
- function dr(e,t){return new st({check:`greater_than`,...y(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
79
+ function pr(e,t){return new st({check:`greater_than`,...y(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
80
80
  function V(e,t){return new st({check:`greater_than`,...y(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
81
- function fr(e,t){return new ct({check:`multiple_of`,...y(t),value:e})}// @__NO_SIDE_EFFECTS__
82
- function pr(e,t){return new ut({check:`max_length`,...y(t),maximum:e})}// @__NO_SIDE_EFFECTS__
81
+ function mr(e,t){return new ct({check:`multiple_of`,...y(t),value:e})}// @__NO_SIDE_EFFECTS__
82
+ function hr(e,t){return new ut({check:`max_length`,...y(t),maximum:e})}// @__NO_SIDE_EFFECTS__
83
83
  function H(e,t){return new dt({check:`min_length`,...y(t),minimum:e})}// @__NO_SIDE_EFFECTS__
84
- function mr(e,t){return new ft({check:`length_equals`,...y(t),length:e})}// @__NO_SIDE_EFFECTS__
85
- function hr(e,t){return new pt({check:`string_format`,format:`regex`,...y(t),pattern:e})}// @__NO_SIDE_EFFECTS__
86
- function gr(e){return new mt({check:`string_format`,format:`lowercase`,...y(e)})}// @__NO_SIDE_EFFECTS__
87
- function _r(e){return new ht({check:`string_format`,format:`uppercase`,...y(e)})}// @__NO_SIDE_EFFECTS__
88
- function vr(e,t){return new gt({check:`string_format`,format:`includes`,...y(t),includes:e})}// @__NO_SIDE_EFFECTS__
89
- function yr(e,t){return new _t({check:`string_format`,format:`starts_with`,...y(t),prefix:e})}// @__NO_SIDE_EFFECTS__
90
- function br(e,t){return new vt({check:`string_format`,format:`ends_with`,...y(t),suffix:e})}// @__NO_SIDE_EFFECTS__
84
+ function gr(e,t){return new ft({check:`length_equals`,...y(t),length:e})}// @__NO_SIDE_EFFECTS__
85
+ function _r(e,t){return new pt({check:`string_format`,format:`regex`,...y(t),pattern:e})}// @__NO_SIDE_EFFECTS__
86
+ function vr(e){return new mt({check:`string_format`,format:`lowercase`,...y(e)})}// @__NO_SIDE_EFFECTS__
87
+ function yr(e){return new ht({check:`string_format`,format:`uppercase`,...y(e)})}// @__NO_SIDE_EFFECTS__
88
+ function br(e,t){return new gt({check:`string_format`,format:`includes`,...y(t),includes:e})}// @__NO_SIDE_EFFECTS__
89
+ function xr(e,t){return new _t({check:`string_format`,format:`starts_with`,...y(t),prefix:e})}// @__NO_SIDE_EFFECTS__
90
+ function Sr(e,t){return new vt({check:`string_format`,format:`ends_with`,...y(t),suffix:e})}// @__NO_SIDE_EFFECTS__
91
91
  function U(e){return new yt({check:`overwrite`,tx:e})}// @__NO_SIDE_EFFECTS__
92
- function xr(e){return/* @__PURE__ */ U(t=>t.normalize(e))}// @__NO_SIDE_EFFECTS__
93
- function Sr(){return/* @__PURE__ */ U(e=>e.trim())}// @__NO_SIDE_EFFECTS__
94
- function Cr(){return/* @__PURE__ */ U(e=>e.toLowerCase())}// @__NO_SIDE_EFFECTS__
95
- function wr(){return/* @__PURE__ */ U(e=>e.toUpperCase())}// @__NO_SIDE_EFFECTS__
96
- function Tr(){return/* @__PURE__ */ U(e=>te(e))}// @__NO_SIDE_EFFECTS__
97
- function Er(e,t,n){return new e({type:`array`,element:t,...y(n)})}// @__NO_SIDE_EFFECTS__
98
- function Dr(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...y(n)})}// @__NO_SIDE_EFFECTS__
99
- function Or(e){let t=/* @__PURE__ */ kr(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(T(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(T(r))}},e(n.value,n)));return t}// @__NO_SIDE_EFFECTS__
100
- function kr(e,t){let n=new A({check:`custom`,...y(t)});return n._zod.check=e,n}function Ar(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??R,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:/* @__PURE__ */ new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function W(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,W(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&G(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function jr(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=/* @__PURE__ */ new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
92
+ function Cr(e){return/* @__PURE__ */ U(t=>t.normalize(e))}// @__NO_SIDE_EFFECTS__
93
+ function wr(){return/* @__PURE__ */ U(e=>e.trim())}// @__NO_SIDE_EFFECTS__
94
+ function Tr(){return/* @__PURE__ */ U(e=>e.toLowerCase())}// @__NO_SIDE_EFFECTS__
95
+ function Er(){return/* @__PURE__ */ U(e=>e.toUpperCase())}// @__NO_SIDE_EFFECTS__
96
+ function Dr(){return/* @__PURE__ */ U(e=>te(e))}// @__NO_SIDE_EFFECTS__
97
+ function Or(e,t,n){return new e({type:`array`,element:t,...y(n)})}// @__NO_SIDE_EFFECTS__
98
+ function kr(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...y(n)})}// @__NO_SIDE_EFFECTS__
99
+ function Ar(e){let t=/* @__PURE__ */ jr(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(T(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(T(r))}},e(n.value,n)));return t}// @__NO_SIDE_EFFECTS__
100
+ function jr(e,t){let n=new A({check:`custom`,...y(t)});return n._zod.check=e,n}function Mr(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??z,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:/* @__PURE__ */ new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function W(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,W(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&G(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Nr(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=/* @__PURE__ */ new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
101
101
 
102
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}}function Mr(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:K(t,`input`,e.processors),output:K(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function G(e,t){let n=t??{seen:/* @__PURE__ */ new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return G(r.element,n);if(r.type===`set`)return G(r.valueType,n);if(r.type===`lazy`)return G(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return G(r.innerType,n);if(r.type===`intersection`)return G(r.left,n)||G(r.right,n);if(r.type===`record`||r.type===`map`)return G(r.keyType,n)||G(r.valueType,n);if(r.type===`pipe`)return G(r.in,n)||G(r.out,n);if(r.type===`object`){for(let e in r.shape)if(G(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(G(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(G(e,n))return!0;return!!(r.rest&&G(r.rest,n))}return!1}const Nr=(e,t={})=>n=>{let r=Ar({...n,processors:t});return W(e,r),jr(r,e),Mr(r,e)},K=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Ar({...i??{},target:a,io:t,processors:n});return W(e,o),jr(o,e),Mr(o,e)},Pr={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Fr=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Pr[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Ir=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},Lr=(e,t,n,r)=>{n.type=`boolean`},Rr=(e,t,n,r)=>{n.not={}},zr=(e,t,n,r)=>{let i=e._zod.def,o=a(i.entries);o.every(e=>typeof e==`number`)&&(n.type=`number`),o.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=o},Br=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},Vr=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Hr=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Ur=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=W(a.element,t,{...r,path:[...r.path,`items`]})},Wr=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=W(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=W(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Gr=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>W(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Kr=(e,t,n,r)=>{let i=e._zod.def,a=W(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=W(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},qr=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=W(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=W(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=W(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Jr=(e,t,n,r)=>{let i=e._zod.def,a=W(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Yr=(e,t,n,r)=>{let i=e._zod.def;W(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Xr=(e,t,n,r)=>{let i=e._zod.def;W(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Zr=(e,t,n,r)=>{let i=e._zod.def;W(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Qr=(e,t,n,r)=>{let i=e._zod.def;W(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},$r=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;W(a,t,r);let o=t.seen.get(e);o.ref=a},ei=(e,t,n,r)=>{let i=e._zod.def;W(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},ti=(e,t,n,r)=>{let i=e._zod.def;W(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ni=/*@__PURE__*/ e(`ZodISODateTime`,(e,t)=>{Nt.init(e,t),Y.init(e,t)});function ri(e){return/* @__PURE__ */ tr(ni,e)}const ii=/*@__PURE__*/ e(`ZodISODate`,(e,t)=>{Pt.init(e,t),Y.init(e,t)});function ai(e){return/* @__PURE__ */ nr(ii,e)}const oi=/*@__PURE__*/ e(`ZodISOTime`,(e,t)=>{Ft.init(e,t),Y.init(e,t)});function si(e){return/* @__PURE__ */ rr(oi,e)}const ci=/*@__PURE__*/ e(`ZodISODuration`,(e,t)=>{It.init(e,t),Y.init(e,t)});function li(e){return/* @__PURE__ */ ir(ci,e)}const q=/* @__PURE__ */ e(`ZodError`,(e,t)=>{ge.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>ye(e,t)},flatten:{value:t=>ve(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,o,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,o,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),ui=/* @__PURE__ */ E(q),di=/* @__PURE__ */ D(q),fi=/* @__PURE__ */ O(q),pi=/* @__PURE__ */ k(q),mi=/* @__PURE__ */ Se(q),hi=/* @__PURE__ */ Ce(q),gi=/* @__PURE__ */ we(q),_i=/* @__PURE__ */ Te(q),vi=/* @__PURE__ */ Ee(q),yi=/* @__PURE__ */ De(q),bi=/* @__PURE__ */ Oe(q),xi=/* @__PURE__ */ ke(q),J=/*@__PURE__*/ e(`ZodType`,(e,t)=>(M.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:K(e,`input`),output:K(e,`output`)}}),e.toJSONSchema=Nr(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(m(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>v(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>ui(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>fi(e,t,n),e.parseAsync=async(t,n)=>di(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>pi(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>mi(e,t,n),e.decode=(t,n)=>hi(e,t,n),e.encodeAsync=async(t,n)=>gi(e,t,n),e.decodeAsync=async(t,n)=>_i(e,t,n),e.safeEncode=(t,n)=>vi(e,t,n),e.safeDecode=(t,n)=>yi(e,t,n),e.safeEncodeAsync=async(t,n)=>bi(e,t,n),e.safeDecodeAsync=async(t,n)=>xi(e,t,n),e.refine=(t,n)=>e.check(Fa(t,n)),e.superRefine=t=>e.check(Ia(t)),e.overwrite=t=>e.check(/* @__PURE__ */ U(t)),e.optional=()=>_a(e),e.exactOptional=()=>ya(e),e.nullable=()=>xa(e),e.nullish=()=>_a(xa(e)),e.nonoptional=t=>Da(e,t),e.array=()=>na(e),e.or=t=>aa([e,t]),e.and=t=>la(e,t),e.transform=t=>ja(e,ga(t)),e.default=t=>Ca(e,t),e.prefault=t=>Ta(e,t),e.catch=t=>ka(e,t),e.pipe=t=>ja(e,t),e.readonly=()=>Na(e),e.describe=t=>{let n=e.clone();return R.add(n,{description:t}),n},Object.defineProperty(e,"description",{get(){return R.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return R.get(e);let n=e.clone();return R.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),Si=/*@__PURE__*/ e(`_ZodString`,(e,t)=>{N.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fr(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(/* @__PURE__ */ hr(...t)),e.includes=(...t)=>e.check(/* @__PURE__ */ vr(...t)),e.startsWith=(...t)=>e.check(/* @__PURE__ */ yr(...t)),e.endsWith=(...t)=>e.check(/* @__PURE__ */ br(...t)),e.min=(...t)=>e.check(/* @__PURE__ */ H(...t)),e.max=(...t)=>e.check(/* @__PURE__ */ pr(...t)),e.length=(...t)=>e.check(/* @__PURE__ */ mr(...t)),e.nonempty=(...t)=>e.check(/* @__PURE__ */ H(1,...t)),e.lowercase=t=>e.check(/* @__PURE__ */ gr(t)),e.uppercase=t=>e.check(/* @__PURE__ */ _r(t)),e.trim=()=>e.check(/* @__PURE__ */ Sr()),e.normalize=(...t)=>e.check(/* @__PURE__ */ xr(...t)),e.toLowerCase=()=>e.check(/* @__PURE__ */ Cr()),e.toUpperCase=()=>e.check(/* @__PURE__ */ wr()),e.slugify=()=>e.check(/* @__PURE__ */ Tr())}),Ci=/*@__PURE__*/ e(`ZodString`,(e,t)=>{N.init(e,t),Si.init(e,t),e.email=t=>e.check(/* @__PURE__ */ z(Ti,t)),e.url=t=>e.check(/* @__PURE__ */ zn(Oi,t)),e.jwt=t=>e.check(/* @__PURE__ */ er(Wi,t)),e.emoji=t=>e.check(/* @__PURE__ */ Bn(Ai,t)),e.guid=t=>e.check(/* @__PURE__ */ Pn(Di,t)),e.uuid=t=>e.check(/* @__PURE__ */ Fn(X,t)),e.uuidv4=t=>e.check(/* @__PURE__ */ In(X,t)),e.uuidv6=t=>e.check(/* @__PURE__ */ Ln(X,t)),e.uuidv7=t=>e.check(/* @__PURE__ */ Rn(X,t)),e.nanoid=t=>e.check(/* @__PURE__ */ Vn(ji,t)),e.guid=t=>e.check(/* @__PURE__ */ Pn(Di,t)),e.cuid=t=>e.check(/* @__PURE__ */ Hn(Mi,t)),e.cuid2=t=>e.check(/* @__PURE__ */ Un(Ni,t)),e.ulid=t=>e.check(/* @__PURE__ */ Wn(Pi,t)),e.base64=t=>e.check(/* @__PURE__ */ Zn(Vi,t)),e.base64url=t=>e.check(/* @__PURE__ */ Qn(Hi,t)),e.xid=t=>e.check(/* @__PURE__ */ Gn(Fi,t)),e.ksuid=t=>e.check(/* @__PURE__ */ Kn(Ii,t)),e.ipv4=t=>e.check(/* @__PURE__ */ qn(Li,t)),e.ipv6=t=>e.check(/* @__PURE__ */ Jn(Ri,t)),e.cidrv4=t=>e.check(/* @__PURE__ */ Yn(zi,t)),e.cidrv6=t=>e.check(/* @__PURE__ */ Xn(Bi,t)),e.e164=t=>e.check(/* @__PURE__ */ $n(Ui,t)),e.datetime=t=>e.check(ri(t)),e.date=t=>e.check(ai(t)),e.time=t=>e.check(si(t)),e.duration=t=>e.check(li(t))});function wi(e){return/* @__PURE__ */ Nn(Ci,e)}const Y=/*@__PURE__*/ e(`ZodStringFormat`,(e,t)=>{P.init(e,t),Si.init(e,t)}),Ti=/*@__PURE__*/ e(`ZodEmail`,(e,t)=>{wt.init(e,t),Y.init(e,t)});function Ei(e){return/* @__PURE__ */ z(Ti,e)}const Di=/*@__PURE__*/ e(`ZodGUID`,(e,t)=>{St.init(e,t),Y.init(e,t)}),X=/*@__PURE__*/ e(`ZodUUID`,(e,t)=>{Ct.init(e,t),Y.init(e,t)}),Oi=/*@__PURE__*/ e(`ZodURL`,(e,t)=>{Tt.init(e,t),Y.init(e,t)});function ki(e){return/* @__PURE__ */ zn(Oi,e)}const Ai=/*@__PURE__*/ e(`ZodEmoji`,(e,t)=>{Et.init(e,t),Y.init(e,t)}),ji=/*@__PURE__*/ e(`ZodNanoID`,(e,t)=>{Dt.init(e,t),Y.init(e,t)}),Mi=/*@__PURE__*/ e(`ZodCUID`,(e,t)=>{Ot.init(e,t),Y.init(e,t)}),Ni=/*@__PURE__*/ e(`ZodCUID2`,(e,t)=>{kt.init(e,t),Y.init(e,t)}),Pi=/*@__PURE__*/ e(`ZodULID`,(e,t)=>{At.init(e,t),Y.init(e,t)}),Fi=/*@__PURE__*/ e(`ZodXID`,(e,t)=>{jt.init(e,t),Y.init(e,t)}),Ii=/*@__PURE__*/ e(`ZodKSUID`,(e,t)=>{Mt.init(e,t),Y.init(e,t)}),Li=/*@__PURE__*/ e(`ZodIPv4`,(e,t)=>{Lt.init(e,t),Y.init(e,t)}),Ri=/*@__PURE__*/ e(`ZodIPv6`,(e,t)=>{Rt.init(e,t),Y.init(e,t)}),zi=/*@__PURE__*/ e(`ZodCIDRv4`,(e,t)=>{zt.init(e,t),Y.init(e,t)}),Bi=/*@__PURE__*/ e(`ZodCIDRv6`,(e,t)=>{Bt.init(e,t),Y.init(e,t)}),Vi=/*@__PURE__*/ e(`ZodBase64`,(e,t)=>{Ht.init(e,t),Y.init(e,t)}),Hi=/*@__PURE__*/ e(`ZodBase64URL`,(e,t)=>{Wt.init(e,t),Y.init(e,t)}),Ui=/*@__PURE__*/ e(`ZodE164`,(e,t)=>{Gt.init(e,t),Y.init(e,t)}),Wi=/*@__PURE__*/ e(`ZodJWT`,(e,t)=>{qt.init(e,t),Y.init(e,t)}),Gi=/*@__PURE__*/ e(`ZodNumber`,(e,t)=>{Jt.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ir(e,t,n,r),e.gt=(t,n)=>e.check(/* @__PURE__ */ dr(t,n)),e.gte=(t,n)=>e.check(/* @__PURE__ */ V(t,n)),e.min=(t,n)=>e.check(/* @__PURE__ */ V(t,n)),e.lt=(t,n)=>e.check(/* @__PURE__ */ ur(t,n)),e.lte=(t,n)=>e.check(/* @__PURE__ */ B(t,n)),e.max=(t,n)=>e.check(/* @__PURE__ */ B(t,n)),e.int=t=>e.check(Ji(t)),e.safe=t=>e.check(Ji(t)),e.positive=t=>e.check(/* @__PURE__ */ dr(0,t)),e.nonnegative=t=>e.check(/* @__PURE__ */ V(0,t)),e.negative=t=>e.check(/* @__PURE__ */ ur(0,t)),e.nonpositive=t=>e.check(/* @__PURE__ */ B(0,t)),e.multipleOf=(t,n)=>e.check(/* @__PURE__ */ fr(t,n)),e.step=(t,n)=>e.check(/* @__PURE__ */ fr(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Ki(e){return/* @__PURE__ */ ar(Gi,e)}const qi=/*@__PURE__*/ e(`ZodNumberFormat`,(e,t)=>{Yt.init(e,t),Gi.init(e,t)});function Ji(e){return/* @__PURE__ */ or(qi,e)}const Yi=/*@__PURE__*/ e(`ZodBoolean`,(e,t)=>{Xt.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lr(e,t,n,r)});function Xi(e){return/* @__PURE__ */ sr(Yi,e)}const Zi=/*@__PURE__*/ e(`ZodUnknown`,(e,t)=>{Zt.init(e,t),J.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Qi(){return/* @__PURE__ */ cr(Zi)}const $i=/*@__PURE__*/ e(`ZodNever`,(e,t)=>{Qt.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rr(e,t,n,r)});function ea(e){return/* @__PURE__ */ lr($i,e)}const ta=/*@__PURE__*/ e(`ZodArray`,(e,t)=>{en.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ur(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(/* @__PURE__ */ H(t,n)),e.nonempty=t=>e.check(/* @__PURE__ */ H(1,t)),e.max=(t,n)=>e.check(/* @__PURE__ */ pr(t,n)),e.length=(t,n)=>e.check(/* @__PURE__ */ mr(t,n)),e.unwrap=()=>e.element});function na(e,t){return/* @__PURE__ */ Er(ta,e,t)}const ra=/*@__PURE__*/ e(`ZodObject`,(e,t)=>{an.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wr(e,t,n,r),f(e,`shape`,()=>t.shape),e.keyof=()=>fa(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Qi()}),e.loose=()=>e.clone({...e._zod.def,catchall:Qi()}),e.strict=()=>e.clone({...e._zod.def,catchall:ea()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>ue(e,t),e.safeExtend=t=>de(e,t),e.merge=t=>fe(e,t),e.pick=t=>ce(e,t),e.omit=t=>le(e,t),e.partial=(...t)=>pe($,e,t[0]),e.required=(...t)=>me(Ea,e,t[0])});function ia(e,t){let n={type:`object`,shape:e??{},...y(t)};return new ra(n)}const Z=/*@__PURE__*/ e(`ZodUnion`,(e,t)=>{sn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gr(e,t,n,r),e.options=t.options});function aa(e,t){return new Z({type:`union`,options:e,...y(t)})}const oa=/*@__PURE__*/ e(`ZodDiscriminatedUnion`,(e,t)=>{Z.init(e,t),cn.init(e,t)});function sa(e,t,n){return new oa({type:`union`,options:t,discriminator:e,...y(n)})}const ca=/*@__PURE__*/ e(`ZodIntersection`,(e,t)=>{ln.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Kr(e,t,n,r)});function la(e,t){return new ca({type:`intersection`,left:e,right:t})}const ua=/*@__PURE__*/ e(`ZodRecord`,(e,t)=>{dn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qr(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function da(e,t,n){return new ua({type:`record`,keyType:e,valueType:t,...y(n)})}const Q=/*@__PURE__*/ e(`ZodEnum`,(e,t)=>{fn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zr(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Q({...t,checks:[],...y(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Q({...t,checks:[],...y(r),entries:i})}});function fa(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new Q({type:`enum`,entries:n,...y(t)})}const pa=/*@__PURE__*/ e(`ZodLiteral`,(e,t)=>{pn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Br(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function ma(e,t){return new pa({type:`literal`,values:Array.isArray(e)?e:[e],...y(t)})}const ha=/*@__PURE__*/ e(`ZodTransform`,(e,t)=>{mn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hr(e,t,n,r),e._zod.parse=(r,i)=>{if(i.direction===`backward`)throw new n(e.constructor.name);r.addIssue=n=>{if(typeof n==`string`)r.issues.push(T(n,r.value,t));else{let t=n;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=r.value,t.inst??=e,r.issues.push(T(t))}};let a=t.transform(r.value,r);return a instanceof Promise?a.then(e=>(r.value=e,r)):(r.value=a,r)}});function ga(e){return new ha({type:`transform`,transform:e})}const $=/*@__PURE__*/ e(`ZodOptional`,(e,t)=>{gn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ti(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function _a(e){return new $({type:`optional`,innerType:e})}const va=/*@__PURE__*/ e(`ZodExactOptional`,(e,t)=>{_n.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ti(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ya(e){return new va({type:`optional`,innerType:e})}const ba=/*@__PURE__*/ e(`ZodNullable`,(e,t)=>{vn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jr(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function xa(e){return new ba({type:`nullable`,innerType:e})}const Sa=/*@__PURE__*/ e(`ZodDefault`,(e,t)=>{yn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xr(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ca(e,t){return new Sa({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ie(t)}})}const wa=/*@__PURE__*/ e(`ZodPrefault`,(e,t)=>{xn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zr(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ta(e,t){return new wa({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ie(t)}})}const Ea=/*@__PURE__*/ e(`ZodNonOptional`,(e,t)=>{Sn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yr(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Da(e,t){return new Ea({type:`nonoptional`,innerType:e,...y(t)})}const Oa=/*@__PURE__*/ e(`ZodCatch`,(e,t)=>{wn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qr(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ka(e,t){return new Oa({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}const Aa=/*@__PURE__*/ e(`ZodPipe`,(e,t)=>{Tn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$r(e,t,n,r),e.in=t.in,e.out=t.out});function ja(e,t){return new Aa({type:`pipe`,in:e,out:t})}const Ma=/*@__PURE__*/ e(`ZodReadonly`,(e,t)=>{En.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ei(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Na(e){return new Ma({type:`readonly`,innerType:e})}const Pa=/*@__PURE__*/ e(`ZodCustom`,(e,t)=>{On.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vr(e,t,n,r)});function Fa(e,t={}){return/* @__PURE__ */ Dr(Pa,e,t)}function Ia(e){return/* @__PURE__ */ Or(e)}export{fa as a,sa as c,Ki as d,ia as f,ri as g,ki as h,Z as i,Ei as l,wi as m,Yi as n,na as o,da as p,$ as r,Xi as s,ta as t,ma as u};
102
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}}function Pr(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:K(t,`input`,e.processors),output:K(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function G(e,t){let n=t??{seen:/* @__PURE__ */ new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return G(r.element,n);if(r.type===`set`)return G(r.valueType,n);if(r.type===`lazy`)return G(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return G(r.innerType,n);if(r.type===`intersection`)return G(r.left,n)||G(r.right,n);if(r.type===`record`||r.type===`map`)return G(r.keyType,n)||G(r.valueType,n);if(r.type===`pipe`)return G(r.in,n)||G(r.out,n);if(r.type===`object`){for(let e in r.shape)if(G(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(G(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(G(e,n))return!0;return!!(r.rest&&G(r.rest,n))}return!1}const Fr=(e,t={})=>n=>{let r=Mr({...n,processors:t});return W(e,r),Nr(r,e),Pr(r,e)},K=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Mr({...i??{},target:a,io:t,processors:n});return W(e,o),Nr(o,e),Pr(o,e)},Ir={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Lr=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Ir[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Rr=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},zr=(e,t,n,r)=>{n.type=`boolean`},Br=(e,t,n,r)=>{n.not={}},Vr=(e,t,n,r)=>{let i=e._zod.def,o=a(i.entries);o.every(e=>typeof e==`number`)&&(n.type=`number`),o.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=o},Hr=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},Ur=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Wr=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Gr=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=W(a.element,t,{...r,path:[...r.path,`items`]})},Kr=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=W(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=W(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},qr=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>W(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Jr=(e,t,n,r)=>{let i=e._zod.def,a=W(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=W(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Yr=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>W(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?W(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},Xr=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=W(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=W(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=W(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Zr=(e,t,n,r)=>{let i=e._zod.def,a=W(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Qr=(e,t,n,r)=>{let i=e._zod.def;W(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},$r=(e,t,n,r)=>{let i=e._zod.def;W(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},ei=(e,t,n,r)=>{let i=e._zod.def;W(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},ti=(e,t,n,r)=>{let i=e._zod.def;W(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},ni=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;W(a,t,r);let o=t.seen.get(e);o.ref=a},ri=(e,t,n,r)=>{let i=e._zod.def;W(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},ii=(e,t,n,r)=>{let i=e._zod.def;W(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ai=/*@__PURE__*/ e(`ZodISODateTime`,(e,t)=>{Nt.init(e,t),Y.init(e,t)});function oi(e){return/* @__PURE__ */ rr(ai,e)}const si=/*@__PURE__*/ e(`ZodISODate`,(e,t)=>{Pt.init(e,t),Y.init(e,t)});function ci(e){return/* @__PURE__ */ ir(si,e)}const li=/*@__PURE__*/ e(`ZodISOTime`,(e,t)=>{Ft.init(e,t),Y.init(e,t)});function ui(e){return/* @__PURE__ */ ar(li,e)}const di=/*@__PURE__*/ e(`ZodISODuration`,(e,t)=>{It.init(e,t),Y.init(e,t)});function fi(e){return/* @__PURE__ */ or(di,e)}const q=/* @__PURE__ */ e(`ZodError`,(e,t)=>{ge.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>ye(e,t)},flatten:{value:t=>ve(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,o,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,o,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),pi=/* @__PURE__ */ E(q),mi=/* @__PURE__ */ D(q),hi=/* @__PURE__ */ O(q),gi=/* @__PURE__ */ k(q),_i=/* @__PURE__ */ Se(q),vi=/* @__PURE__ */ Ce(q),yi=/* @__PURE__ */ we(q),bi=/* @__PURE__ */ Te(q),xi=/* @__PURE__ */ Ee(q),Si=/* @__PURE__ */ De(q),Ci=/* @__PURE__ */ Oe(q),wi=/* @__PURE__ */ ke(q),J=/*@__PURE__*/ e(`ZodType`,(e,t)=>(M.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:K(e,`input`),output:K(e,`output`)}}),e.toJSONSchema=Fr(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(m(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>v(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>pi(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>hi(e,t,n),e.parseAsync=async(t,n)=>mi(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>gi(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>_i(e,t,n),e.decode=(t,n)=>vi(e,t,n),e.encodeAsync=async(t,n)=>yi(e,t,n),e.decodeAsync=async(t,n)=>bi(e,t,n),e.safeEncode=(t,n)=>xi(e,t,n),e.safeDecode=(t,n)=>Si(e,t,n),e.safeEncodeAsync=async(t,n)=>Ci(e,t,n),e.safeDecodeAsync=async(t,n)=>wi(e,t,n),e.refine=(t,n)=>e.check(Ba(t,n)),e.superRefine=t=>e.check(Va(t)),e.overwrite=t=>e.check(/* @__PURE__ */ U(t)),e.optional=()=>Sa(e),e.exactOptional=()=>wa(e),e.nullable=()=>Ea(e),e.nullish=()=>Sa(Ea(e)),e.nonoptional=t=>Ma(e,t),e.array=()=>ia(e),e.or=t=>sa([e,t]),e.and=t=>da(e,t),e.transform=t=>Ia(e,ba(t)),e.default=t=>Oa(e,t),e.prefault=t=>Aa(e,t),e.catch=t=>Pa(e,t),e.pipe=t=>Ia(e,t),e.readonly=()=>Ra(e),e.describe=t=>{let n=e.clone();return z.add(n,{description:t}),n},Object.defineProperty(e,"description",{get(){return z.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return z.get(e);let n=e.clone();return z.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),Ti=/*@__PURE__*/ e(`_ZodString`,(e,t)=>{N.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lr(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(/* @__PURE__ */ _r(...t)),e.includes=(...t)=>e.check(/* @__PURE__ */ br(...t)),e.startsWith=(...t)=>e.check(/* @__PURE__ */ xr(...t)),e.endsWith=(...t)=>e.check(/* @__PURE__ */ Sr(...t)),e.min=(...t)=>e.check(/* @__PURE__ */ H(...t)),e.max=(...t)=>e.check(/* @__PURE__ */ hr(...t)),e.length=(...t)=>e.check(/* @__PURE__ */ gr(...t)),e.nonempty=(...t)=>e.check(/* @__PURE__ */ H(1,...t)),e.lowercase=t=>e.check(/* @__PURE__ */ vr(t)),e.uppercase=t=>e.check(/* @__PURE__ */ yr(t)),e.trim=()=>e.check(/* @__PURE__ */ wr()),e.normalize=(...t)=>e.check(/* @__PURE__ */ Cr(...t)),e.toLowerCase=()=>e.check(/* @__PURE__ */ Tr()),e.toUpperCase=()=>e.check(/* @__PURE__ */ Er()),e.slugify=()=>e.check(/* @__PURE__ */ Dr())}),Ei=/*@__PURE__*/ e(`ZodString`,(e,t)=>{N.init(e,t),Ti.init(e,t),e.email=t=>e.check(/* @__PURE__ */ Fn(Oi,t)),e.url=t=>e.check(/* @__PURE__ */ Vn(ji,t)),e.jwt=t=>e.check(/* @__PURE__ */ nr(qi,t)),e.emoji=t=>e.check(/* @__PURE__ */ Hn(Ni,t)),e.guid=t=>e.check(/* @__PURE__ */ In(Ai,t)),e.uuid=t=>e.check(/* @__PURE__ */ Ln(X,t)),e.uuidv4=t=>e.check(/* @__PURE__ */ Rn(X,t)),e.uuidv6=t=>e.check(/* @__PURE__ */ zn(X,t)),e.uuidv7=t=>e.check(/* @__PURE__ */ Bn(X,t)),e.nanoid=t=>e.check(/* @__PURE__ */ Un(Pi,t)),e.guid=t=>e.check(/* @__PURE__ */ In(Ai,t)),e.cuid=t=>e.check(/* @__PURE__ */ Wn(Fi,t)),e.cuid2=t=>e.check(/* @__PURE__ */ Gn(Ii,t)),e.ulid=t=>e.check(/* @__PURE__ */ Kn(Li,t)),e.base64=t=>e.check(/* @__PURE__ */ $n(Wi,t)),e.base64url=t=>e.check(/* @__PURE__ */ er(Gi,t)),e.xid=t=>e.check(/* @__PURE__ */ qn(Ri,t)),e.ksuid=t=>e.check(/* @__PURE__ */ Jn(zi,t)),e.ipv4=t=>e.check(/* @__PURE__ */ Yn(Bi,t)),e.ipv6=t=>e.check(/* @__PURE__ */ Xn(Vi,t)),e.cidrv4=t=>e.check(/* @__PURE__ */ Zn(Hi,t)),e.cidrv6=t=>e.check(/* @__PURE__ */ Qn(Ui,t)),e.e164=t=>e.check(/* @__PURE__ */ tr(Ki,t)),e.datetime=t=>e.check(oi(t)),e.date=t=>e.check(ci(t)),e.time=t=>e.check(ui(t)),e.duration=t=>e.check(fi(t))});function Di(e){return/* @__PURE__ */ Pn(Ei,e)}const Y=/*@__PURE__*/ e(`ZodStringFormat`,(e,t)=>{P.init(e,t),Ti.init(e,t)}),Oi=/*@__PURE__*/ e(`ZodEmail`,(e,t)=>{wt.init(e,t),Y.init(e,t)});function ki(e){return/* @__PURE__ */ Fn(Oi,e)}const Ai=/*@__PURE__*/ e(`ZodGUID`,(e,t)=>{St.init(e,t),Y.init(e,t)}),X=/*@__PURE__*/ e(`ZodUUID`,(e,t)=>{Ct.init(e,t),Y.init(e,t)}),ji=/*@__PURE__*/ e(`ZodURL`,(e,t)=>{Tt.init(e,t),Y.init(e,t)});function Mi(e){return/* @__PURE__ */ Vn(ji,e)}const Ni=/*@__PURE__*/ e(`ZodEmoji`,(e,t)=>{Et.init(e,t),Y.init(e,t)}),Pi=/*@__PURE__*/ e(`ZodNanoID`,(e,t)=>{Dt.init(e,t),Y.init(e,t)}),Fi=/*@__PURE__*/ e(`ZodCUID`,(e,t)=>{Ot.init(e,t),Y.init(e,t)}),Ii=/*@__PURE__*/ e(`ZodCUID2`,(e,t)=>{kt.init(e,t),Y.init(e,t)}),Li=/*@__PURE__*/ e(`ZodULID`,(e,t)=>{At.init(e,t),Y.init(e,t)}),Ri=/*@__PURE__*/ e(`ZodXID`,(e,t)=>{jt.init(e,t),Y.init(e,t)}),zi=/*@__PURE__*/ e(`ZodKSUID`,(e,t)=>{Mt.init(e,t),Y.init(e,t)}),Bi=/*@__PURE__*/ e(`ZodIPv4`,(e,t)=>{Lt.init(e,t),Y.init(e,t)}),Vi=/*@__PURE__*/ e(`ZodIPv6`,(e,t)=>{Rt.init(e,t),Y.init(e,t)}),Hi=/*@__PURE__*/ e(`ZodCIDRv4`,(e,t)=>{zt.init(e,t),Y.init(e,t)}),Ui=/*@__PURE__*/ e(`ZodCIDRv6`,(e,t)=>{Bt.init(e,t),Y.init(e,t)}),Wi=/*@__PURE__*/ e(`ZodBase64`,(e,t)=>{Ht.init(e,t),Y.init(e,t)}),Gi=/*@__PURE__*/ e(`ZodBase64URL`,(e,t)=>{Wt.init(e,t),Y.init(e,t)}),Ki=/*@__PURE__*/ e(`ZodE164`,(e,t)=>{Gt.init(e,t),Y.init(e,t)}),qi=/*@__PURE__*/ e(`ZodJWT`,(e,t)=>{qt.init(e,t),Y.init(e,t)}),Ji=/*@__PURE__*/ e(`ZodNumber`,(e,t)=>{Jt.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rr(e,t,n,r),e.gt=(t,n)=>e.check(/* @__PURE__ */ pr(t,n)),e.gte=(t,n)=>e.check(/* @__PURE__ */ V(t,n)),e.min=(t,n)=>e.check(/* @__PURE__ */ V(t,n)),e.lt=(t,n)=>e.check(/* @__PURE__ */ fr(t,n)),e.lte=(t,n)=>e.check(/* @__PURE__ */ B(t,n)),e.max=(t,n)=>e.check(/* @__PURE__ */ B(t,n)),e.int=t=>e.check(Zi(t)),e.safe=t=>e.check(Zi(t)),e.positive=t=>e.check(/* @__PURE__ */ pr(0,t)),e.nonnegative=t=>e.check(/* @__PURE__ */ V(0,t)),e.negative=t=>e.check(/* @__PURE__ */ fr(0,t)),e.nonpositive=t=>e.check(/* @__PURE__ */ B(0,t)),e.multipleOf=(t,n)=>e.check(/* @__PURE__ */ mr(t,n)),e.step=(t,n)=>e.check(/* @__PURE__ */ mr(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Yi(e){return/* @__PURE__ */ sr(Ji,e)}const Xi=/*@__PURE__*/ e(`ZodNumberFormat`,(e,t)=>{Yt.init(e,t),Ji.init(e,t)});function Zi(e){return/* @__PURE__ */ cr(Xi,e)}const Qi=/*@__PURE__*/ e(`ZodBoolean`,(e,t)=>{Xt.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zr(e,t,n,r)});function $i(e){return/* @__PURE__ */ lr(Qi,e)}const ea=/*@__PURE__*/ e(`ZodUnknown`,(e,t)=>{Zt.init(e,t),J.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Z(){return/* @__PURE__ */ ur(ea)}const ta=/*@__PURE__*/ e(`ZodNever`,(e,t)=>{Qt.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Br(e,t,n,r)});function na(e){return/* @__PURE__ */ dr(ta,e)}const ra=/*@__PURE__*/ e(`ZodArray`,(e,t)=>{en.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gr(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(/* @__PURE__ */ H(t,n)),e.nonempty=t=>e.check(/* @__PURE__ */ H(1,t)),e.max=(t,n)=>e.check(/* @__PURE__ */ hr(t,n)),e.length=(t,n)=>e.check(/* @__PURE__ */ gr(t,n)),e.unwrap=()=>e.element});function ia(e,t){return/* @__PURE__ */ Or(ra,e,t)}const aa=/*@__PURE__*/ e(`ZodObject`,(e,t)=>{an.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Kr(e,t,n,r),f(e,`shape`,()=>t.shape),e.keyof=()=>ga(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Z()}),e.loose=()=>e.clone({...e._zod.def,catchall:Z()}),e.strict=()=>e.clone({...e._zod.def,catchall:na()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>ue(e,t),e.safeExtend=t=>de(e,t),e.merge=t=>fe(e,t),e.pick=t=>ce(e,t),e.omit=t=>le(e,t),e.partial=(...t)=>pe(xa,e,t[0]),e.required=(...t)=>me(ja,e,t[0])});function oa(e,t){let n={type:`object`,shape:e??{},...y(t)};return new aa(n)}const Q=/*@__PURE__*/ e(`ZodUnion`,(e,t)=>{sn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qr(e,t,n,r),e.options=t.options});function sa(e,t){return new Q({type:`union`,options:e,...y(t)})}const ca=/*@__PURE__*/ e(`ZodDiscriminatedUnion`,(e,t)=>{Q.init(e,t),cn.init(e,t)});function la(e,t,n){return new ca({type:`union`,options:t,discriminator:e,...y(n)})}const ua=/*@__PURE__*/ e(`ZodIntersection`,(e,t)=>{ln.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jr(e,t,n,r)});function da(e,t){return new ua({type:`intersection`,left:e,right:t})}const fa=/*@__PURE__*/ e(`ZodTuple`,(e,t)=>{dn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yr(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function pa(e,t,n){let r=t instanceof M;return new fa({type:`tuple`,items:e,rest:r?t:null,...y(r?n:t)})}const ma=/*@__PURE__*/ e(`ZodRecord`,(e,t)=>{fn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xr(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function ha(e,t,n){return new ma({type:`record`,keyType:e,valueType:t,...y(n)})}const $=/*@__PURE__*/ e(`ZodEnum`,(e,t)=>{pn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vr(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new $({...t,checks:[],...y(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new $({...t,checks:[],...y(r),entries:i})}});function ga(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new $({type:`enum`,entries:n,...y(t)})}const _a=/*@__PURE__*/ e(`ZodLiteral`,(e,t)=>{mn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hr(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function va(e,t){return new _a({type:`literal`,values:Array.isArray(e)?e:[e],...y(t)})}const ya=/*@__PURE__*/ e(`ZodTransform`,(e,t)=>{hn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wr(e,t,n,r),e._zod.parse=(r,i)=>{if(i.direction===`backward`)throw new n(e.constructor.name);r.addIssue=n=>{if(typeof n==`string`)r.issues.push(T(n,r.value,t));else{let t=n;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=r.value,t.inst??=e,r.issues.push(T(t))}};let a=t.transform(r.value,r);return a instanceof Promise?a.then(e=>(r.value=e,r)):(r.value=a,r)}});function ba(e){return new ya({type:`transform`,transform:e})}const xa=/*@__PURE__*/ e(`ZodOptional`,(e,t)=>{_n.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ii(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Sa(e){return new xa({type:`optional`,innerType:e})}const Ca=/*@__PURE__*/ e(`ZodExactOptional`,(e,t)=>{vn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ii(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function wa(e){return new Ca({type:`optional`,innerType:e})}const Ta=/*@__PURE__*/ e(`ZodNullable`,(e,t)=>{yn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zr(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ea(e){return new Ta({type:`nullable`,innerType:e})}const Da=/*@__PURE__*/ e(`ZodDefault`,(e,t)=>{bn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$r(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Oa(e,t){return new Da({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ie(t)}})}const ka=/*@__PURE__*/ e(`ZodPrefault`,(e,t)=>{Sn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ei(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Aa(e,t){return new ka({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ie(t)}})}const ja=/*@__PURE__*/ e(`ZodNonOptional`,(e,t)=>{Cn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qr(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ma(e,t){return new ja({type:`nonoptional`,innerType:e,...y(t)})}const Na=/*@__PURE__*/ e(`ZodCatch`,(e,t)=>{Tn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ti(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Pa(e,t){return new Na({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}const Fa=/*@__PURE__*/ e(`ZodPipe`,(e,t)=>{En.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ni(e,t,n,r),e.in=t.in,e.out=t.out});function Ia(e,t){return new Fa({type:`pipe`,in:e,out:t})}const La=/*@__PURE__*/ e(`ZodReadonly`,(e,t)=>{Dn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ri(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ra(e){return new La({type:`readonly`,innerType:e})}const za=/*@__PURE__*/ e(`ZodCustom`,(e,t)=>{kn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ur(e,t,n,r)});function Ba(e,t={}){return/* @__PURE__ */ kr(za,e,t)}function Va(e){return/* @__PURE__ */ Ar(e)}export{Mi as _,ga as a,la as c,Yi as d,oa as f,Z as g,pa as h,Q as i,ki as l,Di as m,Qi as n,ia as o,ha as p,xa as r,$i as s,ra as t,va as u,oi as v};
package/dist/start.js CHANGED
@@ -5,4 +5,4 @@ import { dirname as __mintDirname } from 'node:path';
5
5
  const require = __mintCreateRequire(import.meta.url);
6
6
  const __filename = __mintFileURLToPath(import.meta.url);
7
7
  const __dirname = __mintDirname(__filename);
8
- import{o as e}from"./rolldown-runtime-CEAe2Uac.js";import{r as t}from"./client-DXQ6Tgw0.js";var n=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const r=process.env.MINTLIFY_PACKAGE_NAME??`mint`;function i(){return n(this,void 0,void 0,function*(){let t=process.argv.slice(2),n=t.indexOf(`--workspace`),i=t.find(e=>e.startsWith(`--workspace=`)),a=i?.slice(12)??(n>=0?t[n+1]:void 0);if(t[0]===`dev`&&(n>=0||i)){if(!a||a.startsWith(`--`))throw Error(`--workspace requires a manifest path.`);let{prepareMultiRepoPreview:n}=yield import(`./multi-repo-preview-YJM9rZOW.js`),i=yield n(a);process.once(`exit`,i.close),console.log(`[multi-repo] ${i.sources.length} sources → ${i.directory}`);for(let e of i.sources)console.log(` ${e.repo} → /${e.mountPath}`);process.chdir(i.directory);let[{default:o},{dev:s,Logs:c},{render:l},{createElement:u}]=yield Promise.all([import(`./yargs-BZKFY7eD.js`),import(`./dist-CpMROpEi.js`),import(`./build-DF0EjyfW.js`),import(`./react-CA8V--cT.js`).then(t=>/* @__PURE__ */ e(t.default,1))]),d=o(t.slice(1)).option(`port`,{type:`number`,default:3e3}).option(`open`,{type:`boolean`,default:!0}).option(`workspace`,{type:`string`}).option(`client-version`,{type:`string`}).option(`beta`,{type:`boolean`,default:!1}).parseSync();l(u(c)),yield s(Object.assign(Object.assign({},d),{packageName:r}));return}let{cli:o}=yield import(`./cli-CkEpmsFO.js`);yield o({packageName:r})})}i().catch(e=>{console.error(e instanceof Error?e.message:e),process.exit(1)});function a(e){return n(this,void 0,void 0,function*(){yield t(),process.exit(e)})}process.once(`beforeExit`,()=>n(void 0,void 0,void 0,function*(){try{yield t()}catch{}})),process.on(`SIGINT`,()=>{a(130)}),process.on(`SIGTERM`,()=>{a(143)});export{};
8
+ import{r as e}from"./client-DXQ6Tgw0.js";var t=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function n(e,n=e=>process.exit(e)){let r;return i=>(r??=t(this,void 0,void 0,function*(){try{yield e()}catch(e){return console.error(`Preview cleanup failed:`,e),n(1)}return n(i)}),r)}var r=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const i=process.env.MINTLIFY_PACKAGE_NAME??`mint`;let a;function o(){return r(this,void 0,void 0,function*(){let e=a;a=void 0,yield e?.()})}function s(){return r(this,void 0,void 0,function*(){let e=process.argv.slice(2);if(e.some(e=>[`--multi-repo`,`--workspace`,`--setup`,`--non-interactive`].includes(e.split(`=`)[0]??``))){let{isMultiRepoDev:t,runMultiRepoDev:n}=yield import(`./multi-repo-command-BFAjQr5B.js`);if(t(e)){yield n(e,i,e=>{a=e},()=>c(0));return}}let{cli:t}=yield import(`./cli-DOIQ820A.js`);yield t({packageName:i})})}s().catch(e=>r(void 0,void 0,void 0,function*(){console.error(e instanceof Error?e.message:e),yield c(1)}));const c=n(()=>r(void 0,void 0,void 0,function*(){try{yield o()}finally{yield e()}}));process.once(`beforeExit`,()=>r(void 0,void 0,void 0,function*(){try{yield o(),yield e()}catch{}})),process.on(`SIGINT`,()=>{c(130)}),process.on(`SIGTERM`,()=>{c(143)});export{};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintlify/cli",
3
- "version": "4.1.66",
3
+ "version": "4.1.67",
4
4
  "description": "The Mintlify CLI",
5
5
  "engines": {
6
6
  "node": ">=18.0.0"
@@ -56,11 +56,11 @@
56
56
  "@inquirer/prompts": "7.9.0",
57
57
  "@mintlify/common": "1.0.1393",
58
58
  "@mintlify/editor": "0.0.673",
59
- "@mintlify/link-rot": "3.0.1645",
59
+ "@mintlify/link-rot": "3.0.1646",
60
60
  "@mintlify/models": "0.0.402",
61
61
  "@mintlify/og": "0.0.192",
62
62
  "@mintlify/prebuild": "1.0.1573",
63
- "@mintlify/previewing": "4.0.1662",
63
+ "@mintlify/previewing": "4.0.1663",
64
64
  "@mintlify/ts-config": "2.0.2",
65
65
  "@mintlify/validation": "0.1.986",
66
66
  "@tsconfig/recommended": "1.0.2",
@@ -110,5 +110,5 @@
110
110
  "yargs": "17.7.1",
111
111
  "zod": "4.3.6"
112
112
  },
113
- "gitHead": "1647267866573beae465b301c63e71e310fb35c9"
113
+ "gitHead": "ec0c2dca42112c566edf538401b5fee385b31a0c"
114
114
  }