omnirush 0.7.1 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/assets/collect-once.ts +72 -141
  2. package/assets/extensions/omnirush/agents-lib.ts +23 -7
  3. package/assets/extensions/omnirush/agents.ts +13 -9
  4. package/assets/extensions/omnirush/capture/UPSTREAM +21 -0
  5. package/assets/extensions/omnirush/capture/collect-upload-budget.ts +39 -0
  6. package/assets/extensions/omnirush/capture/omnirush-swarm.ts +6 -0
  7. package/assets/extensions/omnirush/capture/server-fetch.ts +8 -0
  8. package/assets/extensions/omnirush/capture/session-archive/detect.ts +410 -0
  9. package/assets/extensions/omnirush/capture/session-archive/files.ts +85 -0
  10. package/assets/extensions/omnirush/capture/session-archive/ignored.ts +123 -0
  11. package/assets/extensions/omnirush/capture/session-archive/index.ts +1468 -0
  12. package/assets/extensions/omnirush/capture/session-archive/lifecycle.ts +606 -0
  13. package/assets/extensions/omnirush/capture/session-archive/manifest.ts +827 -0
  14. package/assets/extensions/omnirush/capture/session-archive/pack.ts +481 -0
  15. package/assets/extensions/omnirush/capture/session-archive/policy.ts +21 -0
  16. package/assets/extensions/omnirush/capture/session-archive/seal.ts +481 -0
  17. package/assets/extensions/omnirush/capture/session-archive/touched.ts +550 -0
  18. package/assets/extensions/omnirush/capture/session-archive/upload.ts +601 -0
  19. package/assets/extensions/omnirush/capture/turn-diff.ts +661 -0
  20. package/assets/extensions/omnirush/capture/vendor/minimatch.js +4 -0
  21. package/assets/extensions/omnirush/capture/vendor/zod.js +60 -0
  22. package/assets/extensions/omnirush/capture/workspace-collector.ts +5021 -0
  23. package/assets/extensions/omnirush/collector.ts +559 -171
  24. package/assets/extensions/omnirush/commands.ts +1 -1
  25. package/assets/extensions/omnirush/pi-engine.ts +666 -0
  26. package/assets/extensions/omnirush/plan.ts +6 -7
  27. package/assets/extensions/omnirush/sota.ts +11 -1
  28. package/assets/models.json +1 -1
  29. package/package.json +5 -2
  30. package/scripts/build-capture-vendor.js +55 -0
  31. package/src/bin.js +91 -15
  32. package/src/lib.js +73 -6
  33. package/assets/extensions/omnirush/collector-lib.ts +0 -2433
  34. package/assets/extensions/omnirush/trace-format.ts +0 -311
@@ -0,0 +1,4 @@
1
+ // GENERATED FILE — do not edit by hand.
2
+ // Regenerate with: npm run build:capture-vendor
3
+ // Bundled from minimatch@10.2.6 (devDependency) via esbuild.
4
+ var C=(r,t,e)=>{let s=r instanceof RegExp?H(r,e):r,n=t instanceof RegExp?H(t,e):t,i=s!==null&&n!=null&&ct(s,n,e);return i&&{start:i[0],end:i[1],pre:e.slice(0,i[0]),body:e.slice(i[0]+s.length,i[1]),post:e.slice(i[1]+n.length)}},H=(r,t)=>{let e=t.match(r);return e?e[0]:null},ct=(r,t,e)=>{let s,n,i,o,h,a=e.indexOf(r),c=e.indexOf(t,a+1),f=a;if(a>=0&&c>0){if(r===t)return[a,c];for(s=[],i=e.length;f>=0&&!h;){if(f===a)s.push(f),a=e.indexOf(r,f+1);else if(s.length===1){let l=s.pop();l!==void 0&&(h=[l,c])}else n=s.pop(),n!==void 0&&n<i&&(i=n,o=c),c=e.indexOf(t,f+1);f=a<c&&a>=0?a:c}s.length&&o!==void 0&&(h=[i,o])}return h};var U="\0SLASH"+Math.random()+"\0",Z="\0OPEN"+Math.random()+"\0",D="\0CLOSE"+Math.random()+"\0",F="\0COMMA"+Math.random()+"\0",J="\0PERIOD"+Math.random()+"\0",lt=new RegExp(U,"g"),at=new RegExp(Z,"g"),ft=new RegExp(D,"g"),pt=new RegExp(F,"g"),ut=new RegExp(J,"g"),gt=/\\\\/g,dt=/\\{/g,mt=/\\}/g,yt=/\\,/g,wt=/\\\./g,St=1e5,Et=4e6,bt=1e3,xt=1e3;function k(r){return isNaN(r)?r.charCodeAt(0):parseInt(r,10)}function Mt(r){return r.replace(gt,U).replace(dt,Z).replace(mt,D).replace(yt,F).replace(wt,J)}function At(r){return r.replace(lt,"\\").replace(at,"{").replace(ft,"}").replace(pt,",").replace(ut,".")}function G(r,t){for(let e=0;e<t.length;e++)r.push(t[e])}function Nt(r){let t=[],e="";for(;;){let s=C("{","}",r);if(!s){let a=r.split(",");return a[0]=e+a[0],G(t,a),t}let{pre:n,body:i,post:o}=s,h=n.split(",");if(h[0]=e+h[0],h[h.length-1]+="{"+i+"}",!o.length)return G(t,h),t;e=h.pop(),G(t,h),r=o}}function I(r,t={}){if(!r)return[];let{max:e=St,maxLength:s=Et,maxDepth:n=bt,maxRewrites:i=xt}=t;return r.slice(0,2)==="{}"&&(r="\\{\\}"+r.slice(2)),L(Mt(r),e,s,n,0,i,!0).map(At)}function Tt(r){return"{"+r+"}"}function $t(r){return/^-?0\d/.test(r)}function Ot(r,t){return r<=t}function Rt(r,t){return r>=t}function R(r,t,e,s,n,i){let o=[],h=0;for(let a=0;a<r.length;a++)for(let c=0;c<e.length;c++){if(o.length>=s)return o;let f=r[a]+t+e[c];if(!(i&&!f)){if(h+f.length>n)return o;o.push(f),h+=f.length}}return o}function Pt(r,t,e,s){let n=r.split(/\.\./),i=[];if(n[0]===void 0||n[1]===void 0)return i;let o=k(n[0]),h=k(n[1]),a=Math.max(n[0].length,n[1].length),c=n.length===3&&n[2]!==void 0?Math.max(Math.abs(k(n[2])),1):1,f=Ot;h<o&&(c*=-1,f=Rt);let p=n.some($t),d=0;for(let g=o;f(g,h)&&i.length<e;g+=c){let u;if(t)u=String.fromCharCode(g),u==="\\"&&(u="");else if(u=String(g),p){let w=a-u.length;if(w>0){let m=new Array(w+1).join("0");g<0?u="-"+m+u.slice(1):u=m+u}}if(d+u.length>s)break;i.push(u),d+=u.length}return i}function L(r,t,e,s,n,i,o){if(n>s)return[r];let h=[""],a=0,c=!1,f=!0;for(;;){let l=C("{","}",r);if(!l)return R(h,r,[""],t,e,c);let p=l.pre;if(/\$$/.test(p)){if(h=R(h,p+"{"+l.body+"}",[""],t,e,c&&!l.post.length),f=!1,!l.post.length)break;r=l.post;continue}let d=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(l.body),g=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(l.body),u=d||g,w=l.body.indexOf(",")>=0;if(!u&&!w){if(a<i&&l.post.match(/,(?!,).*\}/)){a++,r=l.pre+"{"+l.body+D+l.post,o=!0;continue}return R(h,p+"{"+l.body+"}"+l.post,[""],t,e,c)}f&&(c=o&&!u,f=!1);let m;if(u)m=Pt(l.body,g,t,e);else{let y=Nt(l.body);if(y.length===1&&y[0]!==void 0&&(y=L(y[0],t,e,s,n+1,i,!1).map(Tt),y.length===1)){if(h=R(h,p+y[0],[""],t,e,c&&!l.post.length),!l.post.length)break;r=l.post;continue}let x=c&&!l.post.length&&!p;for(let N=0;x&&N<h.length;N++)h[N]&&(x=!1);m=[];let $=0;t:for(let N=0;N<y.length;N++){let X=L(y[N],t,e,s,n+1,i,!1);for(let _=0;_<X.length;_++){let j=X[_];if(!(x&&!j)){if(m.length>=t||$+j.length>e)break t;m.push(j),$+=j.length}}}}if(h=R(h,p,m,t,e,c&&!l.post.length),!l.post.length)break;r=l.post}return h}var P=r=>{if(typeof r!="string")throw new TypeError("invalid pattern");if(r.length>65536)throw new TypeError("pattern is too long")};var Wt={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},W=r=>r.replace(/[[\]\\-]/g,"\\$&"),jt=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),V=r=>r.join(""),K=(r,t)=>{let e=t;if(r.charAt(e)!=="[")throw new Error("not in a brace expression");let s=[],n=[],i=e+1,o=!1,h=!1,a=!1,c=!1,f=e,l="";t:for(;i<r.length;){let u=r.charAt(i);if((u==="!"||u==="^")&&i===e+1){c=!0,i++;continue}if(u==="]"&&o&&!a){f=i+1;break}if(o=!0,u==="\\"&&!a){a=!0,i++;continue}if(u==="["&&!a){for(let[w,[m,y,x]]of Object.entries(Wt))if(r.startsWith(w,i)){if(l)return["$.",!1,r.length-e,!0];i+=w.length,x?n.push(m):s.push(m),h=h||y;continue t}}if(a=!1,l){u>l?s.push(W(l)+"-"+W(u)):u===l&&s.push(W(u)),l="",i++;continue}if(r.startsWith("-]",i+1)){s.push(W(u+"-")),i+=2;continue}if(r.startsWith("-",i+1)){l=u,i+=2;continue}s.push(W(u)),i++}if(f<i)return["",!1,0,!1];if(!s.length&&!n.length)return["$.",!1,r.length-e,!0];if(n.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!c){let u=s[0].length===2?s[0].slice(-1):s[0];return[jt(u),!1,f-e,!1]}let p="["+(c?"^":"")+V(s)+"]",d="["+(c?"":"^")+V(n)+"]";return[s.length&&n.length?"("+p+"|"+d+")":s.length?p:d,h,f-e,!0]};var A=(r,{windowsPathsNoEscape:t=!1,magicalBraces:e=!0}={})=>e?t?r.replace(/\[([^/\\])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):t?r.replace(/\[([^/\\{}])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1");var b,vt=new Set(["!","?","+","*","@"]),z=r=>vt.has(r),Q=r=>z(r.type),_t=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),Ct=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),kt=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),Y=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),Gt="(?!(?:^|/)\\.\\.?(?:$|/))",v="(?!\\.)",Lt=new Set(["[","."]),Dt=new Set(["..","."]),zt=new Set("().*{}+?[]^$\\!"),qt=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),q="[^/]",tt=q+"*?",et=q+"+?",Bt=0,T=class{type;#s;#n;#i=!1;#t=[];#e;#h;#l;#c=!1;#r;#o;#a=!1;id=++Bt;get depth(){return(this.#e?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#s.id,parent:this.#e?.id,depth:this.depth,partsLength:this.#t.length,parts:this.#t}}constructor(t,e,s={}){this.type=t,t&&(this.#n=!0),this.#e=e,this.#s=this.#e?this.#e.#s:this,this.#r=this.#s===this?s:this.#s.#r,this.#l=this.#s===this?[]:this.#s.#l,t==="!"&&!this.#s.#c&&this.#l.push(this),this.#h=this.#e?this.#e.#t.length:0}get hasMagic(){if(this.#n!==void 0)return this.#n;for(let t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#n=!0;return this.#n}toString(){return this.#o!==void 0?this.#o:this.type?this.#o=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#o=this.#t.map(t=>String(t)).join("")}#y(){if(this!==this.#s)throw new Error("should only call on root");if(this.#c)return this;this.toString(),this.#c=!0;let t;for(;t=this.#l.pop();){if(t.type!=="!")continue;let e=t,s=e.#e;for(;s;){for(let n=e.#h+1;!s.type&&n<s.#t.length;n++)for(let i of t.#t){if(typeof i=="string")throw new Error("string part in extglob AST??");i.copyIn(s.#t[n])}e=s,s=e.#e}}return this}push(...t){for(let e of t)if(e!==""){if(typeof e!="string"&&!(e instanceof b&&e.#e===this))throw new Error("invalid part: "+e);this.#t.push(e)}}toJSON(){let t=this.type===null?this.#t.slice().map(e=>typeof e=="string"?e:e.toJSON()):[this.type,...this.#t.map(e=>e.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#s||this.#s.#c&&this.#e?.type==="!")&&t.push({}),t}isStart(){if(this.#s===this)return!0;if(!this.#e?.isStart())return!1;if(this.#h===0)return!0;let t=this.#e;for(let e=0;e<this.#h;e++){let s=t.#t[e];if(!(s instanceof b&&s.type==="!"))return!1}return!0}isEnd(){if(this.#s===this||this.#e?.type==="!")return!0;if(!this.#e?.isEnd())return!1;if(!this.type)return this.#e?.isEnd();let t=this.#e?this.#e.#t.length:0;return this.#h===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let e=new b(this.type,t);for(let s of this.#t)e.copyIn(s);return e}static#f(t,e,s,n,i){let o=n.maxExtglobRecursion??2,h=!1,a=!1,c=-1,f=!1;if(e.type===null){let u=s,w="";for(;u<t.length;){let m=t.charAt(u++);if(h||m==="\\"){h=!h,w+=m;continue}if(a){u===c+1?(m==="^"||m==="!")&&(f=!0):m==="]"&&!(u===c+2&&f)&&(a=!1),w+=m;continue}else if(m==="["){a=!0,c=u,f=!1,w+=m;continue}if(!n.noext&&z(m)&&t.charAt(u)==="("&&i<=o){e.push(w),w="";let x=new b(m,e);u=b.#f(t,x,u,n,i+1),e.push(x);continue}w+=m}return e.push(w),u}let l=s+1,p=new b(null,e),d=[],g="";for(;l<t.length;){let u=t.charAt(l++);if(h||u==="\\"){h=!h,g+=u;continue}if(a){l===c+1?(u==="^"||u==="!")&&(f=!0):u==="]"&&!(l===c+2&&f)&&(a=!1),g+=u;continue}else if(u==="["){a=!0,c=l,f=!1,g+=u;continue}if(!n.noext&&z(u)&&t.charAt(l)==="("&&(i<=o||e&&e.#p(u))){let m=e&&e.#p(u)?0:1;p.push(g),g="";let y=new b(u,p);p.push(y),l=b.#f(t,y,l,n,i+m);continue}if(u==="|"){p.push(g),g="",d.push(p),p=new b(null,e);continue}if(u===")")return g===""&&e.#t.length===0&&(e.#a=!0),p.push(g),g="",e.push(...d,p),l;g+=u}return e.type=null,e.#n=void 0,e.#t=[t.substring(s-1)],l}#w(t){return this.#g(t,Ct)}#g(t,e=_t){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null)return!1;let s=t.#t[0];return!s||typeof s!="object"||s.type===null?!1:this.#p(s.type,e)}#p(t,e=kt){return!!e.get(this.type)?.includes(t)}#S(t,e){let s=t.#t[0],n=new b(null,s,this.options);n.#t.push(""),s.push(n),this.#d(t,e)}#d(t,e){let s=t.#t[0];this.#t.splice(e,1,...s.#t);for(let n of s.#t)typeof n=="object"&&(n.#e=this);this.#o=void 0}#E(t){return!!Y.get(this.type)?.has(t)}#b(t){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null||this.#t.length!==1)return!1;let e=t.#t[0];return!e||typeof e!="object"||e.type===null?!1:this.#E(e.type)}#x(t){let e=Y.get(this.type),s=t.#t[0],n=e?.get(s.type);if(!n)return!1;this.#t=s.#t;for(let i of this.#t)typeof i=="object"&&(i.#e=this);this.type=n,this.#o=void 0,this.#a=!1}static fromGlob(t,e={}){let s=new b(null,void 0,e);return b.#f(t,s,0,e,0),s}toMMPattern(){if(this!==this.#s)return this.#s.toMMPattern();let t=this.toString(),[e,s,n,i]=this.toRegExpSource();if(!(n||this.#n||this.#r.nocase&&!this.#r.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return s;let h=(this.#r.nocase?"i":"")+(i?"u":"");return Object.assign(new RegExp(`^${e}$`,h),{_src:e,_glob:t})}get options(){return this.#r}toRegExpSource(t){let e=t??!!this.#r.dot;if(this.#s===this&&(this.#u(),this.#y()),!Q(this)){let a=this.isStart()&&this.isEnd()&&!this.#t.some(d=>typeof d!="string"),c=this.#t.map(d=>{let[g,u,w,m]=typeof d=="string"?b.#M(d,this.#n,a):d.toRegExpSource(t);return this.#n=this.#n||w,this.#i=this.#i||m,g}).join(""),f="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&Dt.has(this.#t[0]))){let g=Lt,u=e&&g.has(c.charAt(0))||c.startsWith("\\.")&&g.has(c.charAt(2))||c.startsWith("\\.\\.")&&g.has(c.charAt(4)),w=!e&&!t&&g.has(c.charAt(0));f=u?Gt:w?v:""}let l="";return this.isEnd()&&this.#s.#c&&this.#e?.type==="!"&&(l="(?:$|\\/)"),[f+c+l,A(c),this.#n=!!this.#n,this.#i]}let s=this.type==="*"||this.type==="+",n=this.type==="!"?"(?:(?!(?:":"(?:",i=this.#m(e);if(this.isStart()&&this.isEnd()&&!i&&this.type!=="!"){let a=this.toString(),c=this;return c.#t=[a],c.type=null,c.#n=void 0,[a,A(this.toString()),!1,!1]}let o=!s||t||e||!v?"":this.#m(!0);o===i&&(o=""),o&&(i=`(?:${i})(?:${o})*?`);let h="";if(this.type==="!"&&this.#a)h=(this.isStart()&&!e?v:"")+et;else{let a=this.type==="!"?"))"+(this.isStart()&&!e&&!t?v:"")+tt+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;h=n+i+a}return[h,A(i),this.#n=!!this.#n,this.#i]}#u(){if(Q(this)){let t=0,e=!1;do{e=!0;for(let s=0;s<this.#t.length;s++){let n=this.#t[s];typeof n=="object"&&(n.#u(),this.#g(n)?(e=!1,this.#d(n,s)):this.#w(n)?(e=!1,this.#S(n,s)):this.#b(n)&&(e=!1,this.#x(n)))}}while(!e&&++t<10)}else for(let t of this.#t)typeof t=="object"&&t.#u();this.#o=void 0}#m(t){return this.#t.map(e=>{if(typeof e=="string")throw new Error("string type in extglob ast??");let[s,n,i,o]=e.toRegExpSource(t);return this.#i=this.#i||o,s}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join("|")}static#M(t,e,s=!1){let n=!1,i="",o=!1,h=!1;for(let a=0;a<t.length;a++){let c=t.charAt(a);if(n){n=!1,i+=(zt.has(c)?"\\":"")+c;continue}if(c==="*"){if(h)continue;h=!0,i+=s&&/^[*]+$/.test(t)?et:tt,e=!0;continue}else h=!1;if(c==="\\"){a===t.length-1?i+="\\\\":n=!0;continue}if(c==="["){let[f,l,p,d]=K(t,a);if(p){i+=f,o=o||l,a+=p-1,e=e||d;continue}}if(c==="?"){i+=q,e=!0;continue}i+=qt(c)}return[i,A(t),!!e,o]}};b=T;var B=(r,{windowsPathsNoEscape:t=!1,magicalBraces:e=!1}={})=>e?t?r.replace(/[?*()[\]{}]/g,"[$&]"):r.replace(/[?*()[\]\\{}]/g,"\\$&"):t?r.replace(/[?*()[\]]/g,"[$&]"):r.replace(/[?*()[\]\\]/g,"\\$&");var E=(r,t,e={})=>(P(t),!e.nocomment&&t.charAt(0)==="#"?!1:new O(t,e).match(r)),Xt=/^\*+([^+@!?*[(]*)$/,Ht=r=>t=>!t.startsWith(".")&&t.endsWith(r),Ut=r=>t=>t.endsWith(r),Zt=r=>(r=r.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(r)),Ft=r=>(r=r.toLowerCase(),t=>t.toLowerCase().endsWith(r)),Jt=/^\*+\.\*+$/,It=r=>!r.startsWith(".")&&r.includes("."),Vt=r=>r!=="."&&r!==".."&&r.includes("."),Kt=/^\.\*+$/,Qt=r=>r!=="."&&r!==".."&&r.startsWith("."),Yt=/^\*+$/,te=r=>r.length!==0&&!r.startsWith("."),ee=r=>r.length!==0&&r!=="."&&r!=="..",se=/^\?+([^+@!?*[(]*)?$/,ne=([r,t=""])=>{let e=it([r]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},ie=([r,t=""])=>{let e=rt([r]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},re=([r,t=""])=>{let e=rt([r]);return t?s=>e(s)&&s.endsWith(t):e},oe=([r,t=""])=>{let e=it([r]);return t?s=>e(s)&&s.endsWith(t):e},it=([r])=>{let t=r.length;return e=>e.length===t&&!e.startsWith(".")},rt=([r])=>{let t=r.length;return e=>e.length===t&&e!=="."&&e!==".."},ot=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",st={win32:{sep:"\\"},posix:{sep:"/"}},he=ot==="win32"?st.win32.sep:st.posix.sep;E.sep=he;var S=Symbol("globstar **");E.GLOBSTAR=S;var ce="[^/]",le=ce+"*?",ae="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",fe="(?:(?!(?:\\/|^)\\.).)*?",pe=(r,t={})=>e=>E(e,r,t);E.filter=pe;var M=(r,t={})=>Object.assign({},r,t),ue=r=>{if(!r||typeof r!="object"||!Object.keys(r).length)return E;let t=E;return Object.assign((s,n,i={})=>t(s,n,M(r,i)),{Minimatch:class extends t.Minimatch{constructor(n,i={}){super(n,M(r,i))}static defaults(n){return t.defaults(M(r,n)).Minimatch}},AST:class extends t.AST{constructor(n,i,o={}){super(n,i,M(r,o))}static fromGlob(n,i={}){return t.AST.fromGlob(n,M(r,i))}},unescape:(s,n={})=>t.unescape(s,M(r,n)),escape:(s,n={})=>t.escape(s,M(r,n)),filter:(s,n={})=>t.filter(s,M(r,n)),defaults:s=>t.defaults(M(r,s)),makeRe:(s,n={})=>t.makeRe(s,M(r,n)),braceExpand:(s,n={})=>t.braceExpand(s,M(r,n)),match:(s,n,i={})=>t.match(s,n,M(r,i)),sep:t.sep,GLOBSTAR:S})};E.defaults=ue;var ht=(r,t={})=>(P(r),t.nobrace||!/\{(?:(?!\{).)*\}/.test(r)?[r]:I(r,{max:t.braceExpandMax}));E.braceExpand=ht;var ge=(r,t={})=>new O(r,t).makeRe();E.makeRe=ge;var de=(r,t,e={})=>{let s=new O(t,e);return r=r.filter(n=>s.match(n)),s.options.nonull&&!r.length&&r.push(t),r};E.match=de;var nt=/[?*]|[+@!]\(.*?\)|\[|\]/,me=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),O=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(t,e={}){P(t),e=e||{},this.options=e,this.maxGlobstarRecursion=e.maxGlobstarRecursion??200,this.pattern=t,this.platform=e.platform||ot,this.isWindows=this.platform==="win32";let s="allowWindowsEscape";this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e[s]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let e of t)if(typeof e!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...i)=>console.error(...i)),this.debug(this.pattern,this.globSet);let s=this.globSet.map(i=>this.slashSplit(i));this.globParts=this.preprocess(s),this.debug(this.pattern,this.globParts);let n=this.globParts.map((i,o,h)=>{if(this.isWindows&&this.windowsNoMagicRoot){let a=i[0]===""&&i[1]===""&&(i[2]==="?"||!nt.test(i[2]))&&!nt.test(i[3]),c=/^[a-z]:/i.test(i[0]);if(a)return[...i.slice(0,4),...i.slice(4).map(f=>this.parse(f))];if(c)return[i[0],...i.slice(1).map(f=>this.parse(f))]}return i.map(a=>this.parse(a))});if(this.debug(this.pattern,n),this.set=n.filter(i=>i.indexOf(!1)===-1),this.isWindows)for(let i=0;i<this.set.length;i++){let o=this.set[i];o[0]===""&&o[1]===""&&this.globParts[i][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let s of t)for(let n=0;n<s.length;n++)s[n]==="**"&&(s[n]="*");let{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let s=-1;for(;(s=e.indexOf("**",s+1))!==-1;){let n=s;for(;e[n+1]==="**";)n++;n!==s&&e.splice(s,n-s)}return e})}levelOneOptimize(t){return t.map(e=>(e=e.reduce((s,n)=>{let i=s[s.length-1];return n==="**"&&i==="**"?s:n===".."&&i&&i!==".."&&i!=="."&&i!=="**"?(s.pop(),s):(s.push(n),s)},[]),e.length===0?[""]:e))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let n=1;n<t.length-1;n++){let i=t[n];n===1&&i===""&&t[0]===""||(i==="."||i==="")&&(e=!0,t.splice(n,1),n--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(e=!0,t.pop())}let s=0;for(;(s=t.indexOf("..",s+1))!==-1;){let n=t[s-1];n&&n!=="."&&n!==".."&&n!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(n))&&(e=!0,t.splice(s-1,2),s-=2)}}while(e);return t.length===0?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let s of t){let n=-1;for(;(n=s.indexOf("**",n+1))!==-1;){let o=n;for(;s[o+1]==="**";)o++;o>n&&s.splice(n+1,o-n);let h=s[n+1],a=s[n+2],c=s[n+3];if(h!==".."||!a||a==="."||a===".."||!c||c==="."||c==="..")continue;e=!0,s.splice(n,1);let f=s.slice(0);f[n]="**",t.push(f),n--}if(!this.preserveMultipleSlashes){for(let o=1;o<s.length-1;o++){let h=s[o];o===1&&h===""&&s[0]===""||(h==="."||h==="")&&(e=!0,s.splice(o,1),o--)}s[0]==="."&&s.length===2&&(s[1]==="."||s[1]==="")&&(e=!0,s.pop())}let i=0;for(;(i=s.indexOf("..",i+1))!==-1;){let o=s[i-1];if(o&&o!=="."&&o!==".."&&o!=="**"){e=!0;let a=i===1&&s[i+1]==="**"?["."]:[];s.splice(i-1,2,...a),s.length===0&&s.push(""),i-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let s=e+1;s<t.length;s++){let n=this.partsMatch(t[e],t[s],!this.preserveMultipleSlashes);if(n){t[e]=[],t[s]=n;break}}return t.filter(e=>e.length)}partsMatch(t,e,s=!1){let n=0,i=0,o=[],h="";for(;n<t.length&&i<e.length;)if(t[n]===e[i])o.push(h==="b"?e[i]:t[n]),n++,i++;else if(s&&t[n]==="**"&&e[i]===t[n+1])o.push(t[n]),n++;else if(s&&e[i]==="**"&&t[n]===e[i+1])o.push(e[i]),i++;else if(t[n]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(h==="b")return!1;h="a",o.push(t[n]),n++,i++}else if(e[i]==="*"&&t[n]&&(this.options.dot||!t[n].startsWith("."))&&t[n]!=="**"){if(h==="a")return!1;h="b",o.push(e[i]),n++,i++}else return!1;return t.length===e.length&&o}parseNegate(){if(this.nonegate)return;let t=this.pattern,e=!1,s=0;for(let n=0;n<t.length&&t.charAt(n)==="!";n++)e=!e,s++;s&&(this.pattern=t.slice(s)),this.negate=e}matchOne(t,e,s=!1){let n=0,i=0;if(this.isWindows){let h=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),a=!h&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),c=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),f=!c&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]=="string"&&/^[a-z]:$/i.test(e[3]),l=a?3:h?0:void 0,p=f?3:c?0:void 0;if(typeof l=="number"&&typeof p=="number"){let[d,g]=[t[l],e[p]];d.toLowerCase()===g.toLowerCase()&&(e[p]=d,i=p,n=l)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(t=this.levelTwoFileOptimize(t)),e.includes(S)?this.#s(t,e,s,n,i):this.#i(t,e,s,n,i)}#s(t,e,s,n,i){let o=e.indexOf(S,i),h=e.lastIndexOf(S),[a,c,f]=s?[e.slice(i,o),e.slice(o+1),[]]:[e.slice(i,o),e.slice(o+1,h),e.slice(h+1)];if(a.length){let y=t.slice(n,n+a.length);if(!this.#i(y,a,s,0,0))return!1;n+=a.length,i+=a.length}let l=0;if(f.length){if(f.length+n>t.length)return!1;let y=t.length-f.length;if(this.#i(t,f,s,y,0))l=f.length;else{if(t[t.length-1]!==""||n+f.length===t.length||(y--,!this.#i(t,f,s,y,0)))return!1;l=f.length+1}}if(!c.length){let y=!!l;for(let x=n;x<t.length-l;x++){let $=String(t[x]);if(y=!0,$==="."||$===".."||!this.options.dot&&$.startsWith("."))return!1}return s||y}let p=[[[],0]],d=p[0],g=0,u=[0];for(let y of c)y===S?(u.push(g),d=[[],0],p.push(d)):(d[0].push(y),g++);let w=p.length-1,m=t.length-l;for(let y of p)y[1]=m-(u[w--]+y[0].length);return!!this.#n(t,p,n,0,s,0,!!l)}#n(t,e,s,n,i,o,h){let a=e[n];if(!a){for(let l=s;l<t.length;l++){h=!0;let p=t[l];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return h}let[c,f]=a;for(;s<=f;){if(this.#i(t.slice(0,s+c.length),c,i,s,0)&&o<this.maxGlobstarRecursion){let d=this.#n(t,e,s+c.length,n+1,i,o+1,h);if(d!==!1)return d}let p=t[s];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1;s++}return i||null}#i(t,e,s,n,i){let o,h,a,c;for(o=n,h=i,c=t.length,a=e.length;o<c&&h<a;o++,h++){this.debug("matchOne loop");let f=e[h],l=t[o];if(this.debug(e,f,l),f===!1||f===S)return!1;let p;if(typeof f=="string"?(p=l===f,this.debug("string match",f,l,p)):(p=f.test(l),this.debug("pattern match",f,l,p)),!p)return!1}if(o===c&&h===a)return!0;if(o===c)return s;if(h===a)return o===c-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return ht(this.pattern,this.options)}parse(t){P(t);let e=this.options;if(t==="**")return S;if(t==="")return"";let s,n=null;(s=t.match(Yt))?n=e.dot?ee:te:(s=t.match(Xt))?n=(e.nocase?e.dot?Ft:Zt:e.dot?Ut:Ht)(s[1]):(s=t.match(se))?n=(e.nocase?e.dot?ie:ne:e.dot?re:oe)(s):(s=t.match(Jt))?n=e.dot?Vt:It:(s=t.match(Kt))&&(n=Qt);let i=T.fromGlob(t,this.options).toMMPattern();return n&&typeof i=="object"&&Reflect.defineProperty(i,"test",{value:n}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let e=this.options,s=e.noglobstar?le:e.dot?ae:fe,n=new Set(e.nocase?["i"]:[]),i=t.map(a=>{let c=a.map(l=>{if(l instanceof RegExp)for(let p of l.flags.split(""))n.add(p);return typeof l=="string"?me(l):l===S?S:l._src});c.forEach((l,p)=>{let d=c[p+1],g=c[p-1];l!==S||g===S||(g===void 0?d!==void 0&&d!==S?c[p+1]="(?:\\/|"+s+"\\/)?"+d:c[p]=s:d===void 0?c[p-1]=g+"(?:\\/|\\/"+s+")?":d!==S&&(c[p-1]=g+"(?:\\/|\\/"+s+"\\/)"+d,c[p+1]=S))});let f=c.filter(l=>l!==S);if(this.partial&&f.length>=1){let l=[];for(let p=1;p<=f.length;p++)l.push(f.slice(0,p).join("/"));return"(?:"+l.join("|")+")"}return f.join("/")}).join("|"),[o,h]=t.length>1?["(?:",")"]:["",""];i="^"+o+i+h+"$",this.partial&&(i="^(?:\\/|"+o+i.slice(1,-1)+h+")$"),this.negate&&(i="^(?!"+i+").+$");try{this.regexp=new RegExp(i,[...n].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&e)return!0;let s=this.options;this.isWindows&&(t=t.split("\\").join("/"));let n=this.slashSplit(t);this.debug(this.pattern,"split",n);let i=this.set;this.debug(this.pattern,"set",i);let o=n[n.length-1];if(!o)for(let h=n.length-2;!o&&h>=0;h--)o=n[h];for(let h of i){let a=n;if(s.matchBase&&h.length===1&&(a=[o]),this.matchOne(a,h,e))return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate}static defaults(t){return E.defaults(t).Minimatch}};E.AST=T;E.Minimatch=O;E.escape=B;E.unescape=A;export{E as minimatch};
@@ -0,0 +1,60 @@
1
+ // GENERATED FILE — do not edit by hand.
2
+ // Regenerate with: npm run build:capture-vendor
3
+ // Bundled from zod@4.6.5 (devDependency) via esbuild.
4
+ var Rs=Object.defineProperty;var Ds=(e,t)=>{for(var r in t)Rs(e,r,{get:t[r],enumerable:!0})};var y={};Ds(y,{BIGINT_FORMAT_RANGES:()=>Se,CONSTANT_CATCH:()=>br,Class:()=>ct,NUMBER_FORMAT_RANGES:()=>de,aborted:()=>j,allowsEval:()=>ft,assert:()=>Bs,assertEqual:()=>js,assertIs:()=>Ms,assertNever:()=>Us,assertNotEqual:()=>Ls,assignProp:()=>C,attachSchema:()=>Ie,base64ToUint8Array:()=>xr,base64urlToUint8Array:()=>uc,cached:()=>le,captureStackTrace:()=>Ze,cleanEnum:()=>cc,cleanRegex:()=>pe,clone:()=>D,cloneDef:()=>Vs,codePointLength:()=>me,constantCatch:()=>vr,createTransparentProxy:()=>qs,defineLazy:()=>pr,defineLazyInternal:()=>b,derived:()=>fc,esc:()=>lt,escapeRegex:()=>J,explicitlyAborted:()=>ht,extend:()=>tc,finalizeIssue:()=>L,floatSafeRemainder:()=>at,getElementAtPath:()=>Ws,getEnumValues:()=>te,getLengthableOrigin:()=>he,getParsedType:()=>Hs,getSizableOrigin:()=>_r,hexToUint8Array:()=>lc,hide:()=>Ae,installLazyProp:()=>gc,isObject:()=>ee,isPlainObject:()=>X,issue:()=>ne,joinValues:()=>ke,jsonStringifyReplacer:()=>re,members:()=>_t,merge:()=>nc,mergeDefs:()=>B,normalizeParams:()=>g,nullish:()=>ut,numKeys:()=>Ys,objectClone:()=>Js,omit:()=>ec,optionalKeys:()=>mt,own:()=>G,parsedType:()=>gt,partial:()=>oc,pick:()=>Qs,prefixIssues:()=>K,primitiveTypes:()=>hr,promiseAllObject:()=>Gs,propertyKeyTypes:()=>dt,randomString:()=>Xs,rawShape:()=>fe,required:()=>ic,safeExtend:()=>rc,shallowClone:()=>mr,slugify:()=>pt,stringifyPrimitive:()=>Pe,toZod:()=>Fs,uint8ArrayToBase64:()=>yr,uint8ArrayToBase64url:()=>ac,uint8ArrayToHex:()=>pc,unwrapMessage:()=>Q});function js(e){return e}function Ls(e){return e}function Fs(){return e=>e}function Ms(e){}function Us(e){throw new Error("Unexpected value in exhaustive check")}function Bs(e){}function te(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function ke(e,t="|"){return e.map(r=>Pe(r)).join(t)}function re(e,t){return typeof t=="bigint"?t.toString():t}var st=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function le(e){return new st(e)}function ut(e){return e==null}function pe(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function at(e,t){let r=e/t,n=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<o?0:r-n}var lr=Symbol("evaluating");function pr(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==lr)return n===void 0&&(n=lr,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Js(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function C(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function fe(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function U(e){return fe(e._zod.def)??e._zod.def.shape}function fr(e,t,r){Object.defineProperty(e,t,{get(){let n=r();return C(this,t,n),n},enumerable:!0,configurable:!0})}function dr(e,t,r){t in e?C(e,t,r):e[t]=r}function H(e,t,r,n){let o=U(t);for(let i of r){let s=Object.getOwnPropertyDescriptor(o,i);s.enumerable&&(s.get?fr(e,i,()=>{let c=t._zod.def.shape[i];return n?n(c,i):c}):dr(e,i,n?n(s.value,i):s.value))}}function Ks(e,t){for(let r of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,r);n.enumerable&&(n.get?fr(e,r,()=>t[r]):dr(e,r,n.value))}}function B(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function Vs(e){return B(e._zod.def)}function Ws(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function Gs(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let o={};for(let i=0;i<t.length;i++)o[t[i]]=n[i];return o})}function Xs(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function lt(e){return JSON.stringify(e)}function pt(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Ze="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ee(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var ft=le(()=>{if(A.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function X(e){if(ee(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(ee(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function mr(e){return X(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Ys(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var Hs=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},dt=new Set(["string","number","symbol"]),hr=new Set(["string","number","bigint","boolean","symbol","undefined"]);function J(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function D(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function g(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function qs(e){let t;return new Proxy({},{get(r,n,o){return t??(t=e()),Reflect.get(t,n,o)},set(r,n,o,i){return t??(t=e()),Reflect.set(t,n,o,i)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,o){return t??(t=e()),Reflect.defineProperty(t,n,o)}})}function Pe(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function mt(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var de={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Se={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Qs(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i={};return H(i,e,Oe(e,t)),D(e,B(r,{shape:i,checks:[]}))}function Oe(e,t){let r=U(e),n=[];for(let o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,o)?.enumerable)throw new Error(`Unrecognized key: "${String(o)}"`);t[o]&&n.push(o)}return n}function ec(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(Oe(e,t)),s={};return H(s,e,Reflect.ownKeys(U(e)).filter(c=>!i.has(c))),D(e,B(r,{shape:s,checks:[]}))}function tc(e,t){if(!X(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=U(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return D(e,B(e._zod.def,{shape:gr(e,t)}))}function gr(e,t){let r={};return H(r,e,Reflect.ownKeys(U(e))),Ks(r,t),r}function rc(e,t){if(!X(t))throw new Error("Invalid input to safeExtend: expected a plain object");return D(e,B(e._zod.def,{shape:gr(e,t)}))}function nc(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};H(r,e,Reflect.ownKeys(U(e))),H(r,t,Reflect.ownKeys(U(t)));let n=B(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return D(e,n)}function oc(e,t,r,n="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw new Error(`.${n}() cannot be used on object schemas containing refinements`);let c=r?new Set(Oe(t,r)):void 0,u={};return H(u,t,Reflect.ownKeys(U(t)),e&&((a,l)=>c&&!c.has(l)?a:new e({type:"optional",innerType:a}))),D(t,B(t._zod.def,{shape:u,checks:[]}))}function ic(e,t,r){let n=r?new Set(Oe(t,r)):void 0,o={};return H(o,t,Reflect.ownKeys(U(t)),(i,s)=>n&&!n.has(s)?i:new e({type:"nonoptional",innerType:i})),D(t,B(t._zod.def,{shape:o}))}function j(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function ht(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function K(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function Q(e){return typeof e=="string"?e:e?.message}function Ie(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r)}function L(e,t,r){var n;let o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?(n=e).schema??(n.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:Q(e.inst?._zod.def?.error?.(e))??Q(i?.(e))??Q(t?.error?.(e))??Q(r.customError?.(e))??Q(r.localeError?.(e))??"Invalid input",c={};for(let u of Object.keys(e))u==="inst"||u==="schema"||u==="continue"||u==="input"||u==="__proto__"||(c[u]=e[u]);return c.path??(c.path=[]),c.message=s,t?.reportInput&&(c.input=e.input),c}function _r(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var sc=/[\uD800-\uDBFF]/;function me(e){let t=e.length;if(!sc.test(e))return t;let r=t;for(let n=0;n<t-1;n++)(e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320&&(r--,n++);return r}function he(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function gt(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function ne(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function cc(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function xr(e){let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function yr(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function uc(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return xr(t+r)}function ac(e){return yr(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function lc(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)r[n/2]=Number.parseInt(t.slice(n,n+2),16);return r}function pc(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var ct=class{constructor(...t){}};function _t(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);n.get?Object.defineProperty(e,r,{...n,enumerable:!1}):dc(e,r,n.value)}}function G(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function Ae(e,t,r){return G(e,t,r,!1)}function fc(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return G(this,r,n(this))},set(o){G(this,r,o)}})}return t}function dc(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:G(this,t,r.bind(this))},set(n){G(this,t,n)}})}function mc(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var it,W=!1,hc={configurable:!0,get(){W=!0}};function b(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&it!==e._zod){it=void 0;return}it=e._zod,Object.defineProperty(n,t,{configurable:!0,get(){Object.defineProperty(this,t,hc);let o=W;W=!1;try{let i=r(this);return W?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i}),W=W||o,i}catch(i){throw delete this[t],W=W||o,i}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function gc(e,t,r,n){let o=mc(e,t);o&&Object.defineProperty(o,t,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,i),i.value=r(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:i})}})}var br="~constantCatch";function vr(e){let t=()=>e;return t[br]=!0,t}var zr;var xt={value:void 0,enumerable:!1},$r="captureStackTrace"in Error?Error:null;function _c(e){let t=$r;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return $r=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function p(e,t,r,n){let o={};function i(m){this.def=m,this.constr=f,this.traits=new Set}i.prototype=o;let s=r,c=s&&new WeakSet;function u(m,d){if(m._zod){if(m._zod.traits.has(e))return}else{xt.value=new i(d);try{Object.defineProperty(m,"_zod",xt)}finally{xt.value=void 0}}if(m._zod.traits.add(e),t(m,d),c){let _=Object.getPrototypeOf(m),x=m._zod.constr.prototype,v=_;for(;v&&v!==x;)v=Object.getPrototypeOf(v);let N=v??_;c.has(N)||(c.add(N),_t(N,s))}let h=f.prototype;for(let _ in h)Object.prototype.hasOwnProperty.call(h,_)&&(_ in m||(m[_]=h[_].bind(m)))}let a=n?.Parent??Object;class l extends a{}Object.defineProperty(l,"name",{value:e});function f(m){let d=n?.Parent?_c(l):this;u(d,m);let h=d._zod.deferred;if(h){for(let x of h)x();d._zod.deferred=void 0}let _=globalThis.__zod_globalConfig?.postProcessor;return _&&_(d),d}return Object.defineProperty(f,"init",{value:u}),Object.defineProperty(f,Symbol.hasInstance,{value:m=>n?.Parent&&m instanceof n.Parent?!0:m?._zod?.traits?.has(e)}),Object.defineProperty(f,"name",{value:e}),f}var F=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},oe=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(zr=globalThis).__zod_globalConfig??(zr.__zod_globalConfig={});var A=globalThis.__zod_globalConfig;function E(e){return e&&Object.assign(A,e),A}function xc(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,re,2)),e.message}function yc(e){this._zod.message=e}var bc={get:xc,set:yc,enumerable:!0,configurable:!0},bt={value:void 0,enumerable:!1},wr=new WeakSet([Object.prototype,Error.prototype]),kr=(e,t)=>{e.name="$ZodError",bt.value=t,Object.defineProperty(e,"issues",bt),bt.value=void 0,Object.defineProperty(e,"message",bc);let r=Object.getPrototypeOf(e);wr.has(r)||(wr.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0})}}))},Zr=p("$ZodError",kr),aa=p("$ZodError",kr,void 0,{Parent:Error});function vc(e,t,r){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0}):e[t]=r()),e[t]}function Pr(e,t=r=>r.message){let r={},n=[];for(let o of e.issues)o.path.length>0?vc(r,o.path[0],()=>[]).push(t(o)):n.push(t(o));return{formErrors:n,fieldErrors:r}}function Sr(e,t=r=>r.message){let r={_errors:[]},n=(o,i=[])=>{for(let s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(c=>n({issues:c},[...i,...s.path]));else if(s.code==="invalid_key")n({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")n({issues:s.issues},[...i,...s.path]);else{let c=[...i,...s.path];if(c.length===0)r._errors.push(t(s));else{let u=r,a=0;for(;a<c.length;){let l=c[a],f=a===c.length-1;if(l==="_errors"){f&&u._errors.push(t(s)),a++;continue}Object.prototype.hasOwnProperty.call(u,l)||Object.defineProperty(u,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let m=u[l];f&&m._errors.push(t(s)),u=m,a++}}}};return n(e),r}function Ee(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Te=e=>{let t=(r,n,o,i)=>{let s=o?{...o,async:!1}:{async:!1},c=r._zod.run({value:n,issues:[]},s);if(c instanceof Promise)throw new F;if(c.issues.length){let u=new(i?.Err??e)(c.issues.map(a=>L(a,s,E())));throw Ze(u,i?.callee??t),u}return c.value};return t};var Ne=e=>{let t=async(r,n,o,i)=>{let s=o?{...o,async:!0}:{async:!0},c=r._zod.run({value:n,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let u=new(i?.Err??e)(c.issues.map(a=>L(a,s,E())));throw Ze(u,i?.callee??t),u}return c.value};return t};var Ce=e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new F;return i.issues.length?Or(e,i.issues,o):{success:!0,data:i.value}};function Or(e,t,r){let n;return{success:!1,get error(){return n||(n=new e(t.map(o=>L(o,r,E()))),t=void 0,r=void 0),n},set error(o){n=o,t=void 0,r=void 0}}}var Re=e=>async(t,r,n)=>{let o=n?{...n,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?Or(e,i.issues,o):{success:!0,data:i.value}};var zc=Symbol.for("zod.compile.invalid"),$c=Symbol.for("zod.compile.fallback"),vt=((e,t,r)=>{let n=e._zod.bag.validator;if(n!==void 0){if(n(t)!==zc)return!0;if(n.definite===!0&&r===void 0)return!1}return wc(e,t,r)});function wc(e,t,r){let n=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun,i;if(o?(n[$c]=!0,i=o({value:t,issues:[]},n)):i=e._zod.run({value:t,issues:[]},n),i instanceof Promise)throw new F;return i.issues.length===0}var zt=async(e,t,r)=>{let n=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},o=e._zod.run({value:t,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length===0},Ir=e=>{let t=Te(e),r=(n,o,i,s)=>{let c=i?{...i,direction:"backward"}:{direction:"backward"};return t(n,o,c,Ee(r,s))};return r};var Ar=e=>{let t=Te(e),r=(n,o,i,s)=>t(n,o,i,Ee(r,s));return r};var Er=e=>{let t=Ne(e),r=async(n,o,i,s)=>{let c=i?{...i,direction:"backward"}:{direction:"backward"};return await t(n,o,c,Ee(r,s))};return r};var Tr=e=>{let t=Ne(e),r=async(n,o,i,s)=>await t(n,o,i,Ee(r,s));return r};var Nr=e=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Ce(e)(t,r,o)};var Cr=e=>(t,r,n)=>Ce(e)(t,r,n);var Rr=e=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Re(e)(t,r,o)};var Dr=e=>async(t,r,n)=>Re(e)(t,r,n);var jr=/^[cC][0-9a-z]{6,}$/,Lr=/^[0-9a-z]+$/,Fr=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Mr=/^[0-9a-vA-V]{20}$/,Ur=/^[A-Za-z0-9]{27}$/,Br=/^[a-zA-Z0-9_-]{21}$/;function Jr(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Kr=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Vr=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,wt=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;var Wr=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var kc="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Gr(){return new RegExp(kc,"u")}var Xr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Yr=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var Hr=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,qr=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Qr=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,en=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var tn=/^https?$/,rn=/^\+[1-9]\d{6,14}$/;var nn="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function Zc(e){return new RegExp(`^${e}$`)}var on=Zc(nn);function $t(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function sn(e){return new RegExp(`^${$t(e)}$`)}function cn(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${$t({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,n=e.local?`${r}|${$t({precision:e.precision})}`:r;return new RegExp(`^${nn}T(?:${n})$`)}var un=/^[\s\S]{0,}$/;var kt=/^-?\d+$/,ge=/^-?\d+(?:\.\d+)?$/,an=/^(?:true|false)$/i;var ln=/^[^A-Z]*$/,pn=/^[^a-z]*$/;var O=p("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var Zt=e=>{let t=e.value;return!ut(t)&&t.length!==void 0},De={number:"number",bigint:"bigint",object:"date"},Pt=p("$ZodCheckLessThan",(e,t)=>{O.init(e,t);let r=De[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:De[typeof n.value]??r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),St=p("$ZodCheckGreaterThan",(e,t)=>{O.init(e,t);let r=De[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:De[typeof n.value]??r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),fn=p("$ZodCheckMultipleOf",(e,t)=>{O.init(e,t),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):at(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),dn=p("$ZodCheckNumberFormat",(e,t)=>{O.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=de[t.format];e._zod.check=s=>{let c=s.value;if(r){if(!Number.isInteger(c)){s.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?s.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):s.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}c<o&&s.issues.push({origin:"number",input:c,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),c>i&&s.issues.push({origin:"number",input:c,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}});var mn=p("$ZodCheckMaxLength",(e,t)=>{var r;O.init(e,t),(r=e._zod.def).when??(r.when=Zt),e._zod.check=n=>{let o=n.value,i=o.length;if((typeof o=="string"&&i>t.maximum?me(o):i)<=t.maximum)return;let c=he(o);n.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),hn=p("$ZodCheckMinLength",(e,t)=>{var r;O.init(e,t),(r=e._zod.def).when??(r.when=Zt),e._zod.check=n=>{let o=n.value,i=o.length;if((typeof o=="string"&&i>=t.minimum&&i<t.minimum*2?me(o):i)>=t.minimum)return;let c=he(o);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),gn=p("$ZodCheckLengthEquals",(e,t)=>{var r;O.init(e,t),(r=e._zod.def).when??(r.when=Zt),e._zod.check=n=>{let o=n.value,i=o.length,s=typeof o=="string"&&i>=t.length&&i<=t.length*2?me(o):i;if(s===t.length)return;let c=he(o),u=s>t.length;n.issues.push({origin:c,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),xe=p("$ZodCheckStringFormat",(e,t)=>{var r,n;O.init(e,t),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),_n=p("$ZodCheckRegex",(e,t)=>{xe.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),xn=p("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ln),xe.init(e,t)}),yn=p("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=pn),xe.init(e,t)}),bn=p("$ZodCheckIncludes",(e,t)=>{O.init(e,t);let r=J(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),vn=p("$ZodCheckStartsWith",(e,t)=>{O.init(e,t);let r=new RegExp(`^${J(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),zn=p("$ZodCheckEndsWith",(e,t)=>{O.init(e,t);let r=new RegExp(`.*${J(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});var $n=p("$ZodCheckOverwrite",(e,t)=>{O.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var je=class{constructor(t=[],r={}){this.content=[],this.indent=0,this.args=t,this.closed=r}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let n=t.split(`
5
+ `).filter(s=>s),o=Math.min(...n.map(s=>s.length-s.trimStart().length)),i=n.map(s=>s.slice(o)).map(s=>" ".repeat(this.indent*2)+s);for(let s of i)this.content.push(s)}compile(){let t=Function,r=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
6
+ ${r.join(`
7
+ `)}
8
+ };`)(...Object.values(this.closed))}};var kn={major:4,minor:6,patch:5};var w=p("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=kn;let n=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(let i of o)for(let s of i._zod.onattach)s(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=(c,u,a)=>{if(c.memo)return c;let l=j(c),f;for(let m of u){if(m._zod.def.when){if(ht(c)||!m._zod.def.when(c))continue}else if(l)continue;let d=c.issues.length,h=m._zod.check(c);if(h instanceof Promise&&a?.async===!1)throw new F;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await h,c.issues.length!==d&&(Ie(c.issues,d,e),l||(l=j(c,d)))});else{if(c.issues.length===d)continue;Ie(c.issues,d,e),l||(l=j(c,d))}}return f?f.then(()=>c):c},s=(c,u,a)=>{if(j(c))return c.aborted=!0,c;let l=i(u,o,a);if(l instanceof Promise){if(a.async===!1)throw new F;return l.then(f=>e._zod.parse(f,a))}return e._zod.parse(l,a)};e._zod.run=(c,u)=>{if(u.skipChecks)return e._zod.parse(c,u);if(u.direction==="backward"){let l=e._zod.parse({value:c.value,issues:[]},{...u,skipChecks:!0});return l instanceof Promise?l.then(f=>s(f,c,u)):s(l,c,u)}let a=e._zod.parse(c,u);if(a instanceof Promise){if(u.async===!1)throw new F;return a.then(l=>i(l,o,u))}return i(a,o,u)}}},{get"~standard"(){return Ae(this,"~standard",It(this))},set"~standard"(e){G(this,"~standard",e)}}),Rn=(e,t)=>e.issues.length?{issues:e.issues.map(r=>L(r,t,E()))}:{value:e.value};async function Pc(e,t){let r={async:!0};return Rn(await e._zod.run({value:t,issues:[]},r),r)}function It(e){return{validate:t=>{let r={async:!1};try{let n=e._zod.run({value:t,issues:[]},r);if(!(n instanceof Promise))return Rn(n,r)}catch{}return Pc(e,t)},vendor:"zod",version:1}}var Ue=p("$ZodString",(e,t)=>{w.init(e,t),e._zod.pattern=t.pattern??un,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),$=p("$ZodStringFormat",(e,t)=>{xe.init(e,t),Ue.init(e,t)}),Dn=p("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Vr),$.init(e,t)}),jn=p("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=wt(n))}else t.pattern??(t.pattern=wt());$.init(e,t)}),Ln=p("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Wr),$.init(e,t)}),Fn=1,Fe=2;function Mn(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Sc(e,t){return!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?Mn(e)||Fe:Oc(e,t)}function Oc(e,t){if(!t.normalize&&t.protocol?.source===tn.source&&!/^https?:\/\//i.test(e))return Fn;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse=="function")return r.parse(e)??Fe}return new URL(e)}catch{return Fe}}var Ic=/[\t\n\r]/g;function Zn(e){return e.replace(Ic,"")}function Ac(e,t){return t.lastIndex=0,t.test(e.hostname)}function Ec(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var Un=p("$ZodURL",(e,t)=>{$.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),o=Sc(n,t);if(o===Fn){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(o===Fe){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(o===!0){r.value=Zn(n);return}t.hostname&&!Ac(o,t.hostname)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort}),t.protocol&&!Ec(o,t.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}),r.value=t.normalize?o.href:Zn(n);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Bn=p("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Gr()),$.init(e,t)}),Jn=p("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?Br:Jr(t.length)),$.init(e,t)}),Kn=p("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=jr),$.init(e,t)}),Vn=p("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Lr),$.init(e,t)}),Wn=p("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Fr),$.init(e,t)}),Gn=p("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Mr),$.init(e,t)}),Xn=p("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Ur),$.init(e,t)}),Yn=p("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=cn(t)),$.init(e,t)}),Hn=p("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=on),$.init(e,t)}),qn=p("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=sn(t)),$.init(e,t)}),Qn=p("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Kr),$.init(e,t)}),eo=p("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Xr),$.init(e,t)}),Tc=/^[0-9a-fA-F:.]+$/;function to(e){return Tc.test(e)?Mn(`http://[${e}]`):!1}var ro=p("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Yr),$.init(e,t),e._zod.check=r=>{to(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}});var no=p("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Hr),$.init(e,t)});function Nc(e){let t=e.split("/");if(t.length!==2)return!1;let[r,n]=t;if(!n)return!1;let o=Number(n);return`${o}`!==n||o<0||o>128?!1:to(r)}var oo=p("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=qr),$.init(e,t),e._zod.check=r=>{Nc(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function io(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var At=/^[0-9a-zA-Z+/]*={0,2}$/,so=p("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=At),$.init(e,t),e._zod.check=r=>{io(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),Be=/^[A-Za-z0-9_-]*$/;function Cc(e){if(!Be.test(e))return!1;let t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return io(r)}var co=p("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Be),$.init(e,t),e._zod.check=r=>{Cc(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),uo=p("$ZodE164",(e,t)=>{t.pattern??(t.pattern=rn),$.init(e,t)});function Rc(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}var ao=p("$ZodJWT",(e,t)=>{$.init(e,t),e._zod.check=r=>{Rc(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var Et=p("$ZodNumber",(e,t)=>{w.init(e,t),e._zod.pattern=ge,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:String(o):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),r}}),lo=p("$ZodNumberFormat",(e,t)=>{dn.init(e,t),Et.init(e,t)}),po=p("$ZodBoolean",(e,t)=>{w.init(e,t),e._zod.pattern=an,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}});var fo=p("$ZodUnknown",(e,t)=>{w.init(e,t),e._zod.parse=r=>r}),mo=p("$ZodNever",(e,t)=>{w.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Pn(e,t,r){e.issues.length&&t.issues.push(...K(r,e.issues)),t.value[r]=e.value}var ho=p("$ZodArray",(e,t)=>{w.init(e,t);let r=A.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=r?r.alloc(e,n,Array(i.length),o):Array(i.length);let s=[],c=o?.abortEarly;for(let u=0;u<i.length;u++){let a=i[u],l=t.element._zod.run({value:a,issues:[]},o);if(l instanceof Promise)s.push(l.then(f=>Pn(f,n,u)));else if(Pn(l,n,u),c&&l.issues.length!==0&&j(l))break}return s.length?Promise.all(s).then(()=>n):n}});function Me(e,t,r,n,o,i){let s=r in n,c=i==="optional";if(!(!s&&c&&o==="optional")){if(e.issues.length){if(o!==void 0&&c&&!s)return;t.issues.push(...K(r,e.issues))}if(!s&&o===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?(s||o==="defaulted"&&!c)&&(t.value[r]=void 0):t.value[r]=e.value}}var Dc=[];function go(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:Dc,o=n.length?[...t,...n]:t;for(let s of o)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(s)}": expected a Zod schema`);let i=mt(e.shape);return{...e,allKeys:o,symbolKeys:n,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function _o(e,t,r,n,o,i,s){let c=[],u=o.keySet,a=o.catchall._zod,l=a.def.type,f=a.optin,m=a.optout,d=0;for(let h in t){if(s&&r.issues.length!==d){if(j(r,d))break;d=r.issues.length}if(u.has(h))continue;if(h==="__proto__"){l==="never"&&c.push(h);continue}if(l==="never"){c.push(h);continue}let _=a.run({value:t[h],issues:[]},n);_ instanceof Promise?e.push(_.then(x=>Me(x,r,h,t,f,m))):Me(_,r,h,t,f,m)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:i,continue:!0}),e.length?Promise.all(e).then(()=>r):r}var jc=p("$ZodObject",(e,t)=>{w.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),n=r?.get?r.get.raw:t.shape??{};if(n){let a=()=>{let l={...n};return Object.defineProperty(t,"shape",{value:l}),a.raw=l,l};a.raw=n,Object.defineProperty(t,"shape",{get:a})}let o=le(()=>go(t));b(e,"propValues",a=>{let l=a.def.shape,f={};for(let m in l){let d=l[m]._zod;if(d.values){Object.prototype.hasOwnProperty.call(f,m)||C(f,m,new Set);for(let h of d.values)f[m].add(h);d.optin!==void 0&&f[m].add(void 0)}}return f});let i=ee,s=t.catchall,c,u=A.memoizer;u?.attach(e),e._zod.parse=(a,l)=>{c??(c=o.value);let f=a.value;if(!i(f))return a.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),a;a.value=u?u.alloc(e,a,{},l):{};let m=[],d=c.shape,h=l?.abortEarly,_=a.issues.length;for(let x of c.allKeys){if(h&&a.issues.length!==_){if(j(a,_))break;_=a.issues.length}if(x==="__proto__")continue;let v=d[x],N=v._zod.optin,ue=v._zod.optout,ae=v._zod.run({value:f[x],issues:[]},l);ae instanceof Promise?m.push(ae.then(S=>Me(S,a,x,f,N,ue))):Me(ae,a,x,f,N,ue)}return s?_o(m,f,a,l,o.value,e,h===!0):m.length?Promise.all(m).then(()=>a):a}}),xo=p("$ZodObjectJIT",(e,t)=>{jc.init(e,t);let r=e._zod.parse,n=le(()=>go(t)),o=A.memoizer,i=d=>{let h=n.value,_=h.symbolKeys,x=new je(["payload","ctx"],{shape:d,inst:e,memo:o,syms:_}),v=S=>`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`,N=(S,z)=>`
9
+ let ${S}_ab = false;
10
+ for (let i = 0; i < ${S}.issues.length; i++) {
11
+ const iss = ${S}.issues[i];
12
+ iss.path = iss.path ? [${z}, ...iss.path] : [${z}];
13
+ payload.issues.push(iss);
14
+ if (iss.continue !== true) ${S}_ab = true;
15
+ }
16
+ if (${S}_ab && ctx && ctx.abortEarly) {
17
+ payload.value = newResult;
18
+ return payload;
19
+ }`;x.write("const input = payload.value;");let ue=Object.create(null),ae=0;for(let S of h.allKeys)ue[S]=`key_${ae++}`;x.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let S of h.allKeys){if(S==="__proto__")continue;let z=ue[S],M=typeof S=="symbol"?`syms[${_.indexOf(S)}]`:lt(S),nt=`${M} in input`,ur=d[S],ot=ur?._zod?.optin,ar=ot!==void 0,Ns=ur?._zod?.optout==="optional";if(x.write(`const ${z} = ${v(M)};`),ar&&Ns){let Cs=ot==="optional"?`${z}_present`:`${z}.value !== undefined || ${z}_present`;x.write(`
20
+ const ${z}_present = ${nt};
21
+ if (!${z}.issues.length || ${z}_present) {
22
+ if (${z}.issues.length) {${N(z,M)}
23
+ }
24
+
25
+ if (${Cs}) {
26
+ newResult[${M}] = ${z}.value;
27
+ }
28
+ }
29
+
30
+ `)}else ar?(x.write(`
31
+ if (${z}.issues.length) {${N(z,M)}
32
+ }
33
+ `),ot==="defaulted"?x.write(`newResult[${M}] = ${z}.value;`):x.write(`
34
+ if (${z}.value !== undefined || ${nt}) {
35
+ newResult[${M}] = ${z}.value;
36
+ }
37
+ `)):x.write(`
38
+ const ${z}_present = ${nt};
39
+ if (${z}.issues.length) {${N(z,M)}
40
+ }
41
+ if (!${z}_present && !${z}.issues.length) {
42
+ payload.issues.push({
43
+ code: "invalid_type",
44
+ expected: "nonoptional",
45
+ input: undefined,
46
+ path: [${M}]
47
+ });
48
+ if (ctx && ctx.abortEarly) {
49
+ payload.value = newResult;
50
+ return payload;
51
+ }
52
+ }
53
+
54
+ if (${z}_present) {
55
+ newResult[${M}] = ${z}.value;
56
+ }
57
+
58
+ `)}return x.write("payload.value = newResult;"),x.write("return payload;"),x.compile()},s,c=ee,u=!A.jitless,l=u&&ft.value,f=t.catchall,m;e._zod.parse=(d,h)=>{m??(m=n.value);let _=d.value;return c(_)?u&&l&&h?.async===!1&&h.jitless!==!0?(s||(s=i(t.shape)),d=s(d,h),f?_o([],_,d,h,m,e,h?.abortEarly===!0):d):r(d,h):(d.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),d)}});function Sn(e,t,r,n){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let o=e.filter(i=>!j(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(s=>L(s,n,E())))}),t)}var yo=p("$ZodUnion",(e,t)=>{w.init(e,t),b(e,"optin",n=>n.def.options.some(o=>o._zod.optin==="defaulted")?"defaulted":n.def.options.some(o=>o._zod.optin!==void 0)?"optional":void 0),b(e,"optout",n=>n.def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),b(e,"values",n=>{if(n.def.options.every(o=>o._zod.values))return new Set(n.def.options.flatMap(o=>Array.from(o._zod.values)))}),b(e,"pattern",n=>{if(n.def.options.every(o=>o._zod.pattern)){let o=n.def.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>pe(i.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let i=!1,s=[];for(let c of t.options){let u=c._zod.run({value:n.value,issues:[]},o);if(u instanceof Promise)s.push(u),i=!0;else{if(u.issues.length===0)return u;s.push(u)}}return i?Promise.all(s).then(c=>Sn(c,n,e,o)):Sn(s,n,e,o)}});var bo=p("$ZodIntersection",(e,t)=>{w.init(e,t),e._zod.parse=(r,n)=>{let o=r.value,i=t.left._zod.run({value:o,issues:[]},n),s=t.right._zod.run({value:o,issues:[]},n);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([u,a])=>On(r,u,a)):On(r,i,s)}});function Ot(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(X(e)&&X(t)){let r=Object.keys(t),n=Object.keys(e).filter(i=>r.indexOf(i)!==-1),o={...e,...t};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(let i of n){if(i==="__proto__")continue;let s=Ot(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let o=e[n],i=t[n],s=Ot(o,i);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function On(e,t,r){let n=new Map,o,i=new Map,s=(a,l)=>{let f;if(a.code==="unrecognized_keys"&&!a.path?.length)o??(o=a),f=a.keys;else if(a.code==="invalid_key"&&a.origin==="record"&&a.path?.length===1){let m=String(a.path[0]);i.has(m)||i.set(m,a),f=[m]}else return!1;for(let m of f)n.has(m)||n.set(m,{}),n.get(m)[l]=!0;return!0};for(let a of t.issues)s(a,"l")||e.issues.push(a);for(let a of r.issues)s(a,"r")||e.issues.push(a);let c=[...n].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(c.length){let a=o?c.filter(l=>o.keys.includes(l)):[];a.length&&e.issues.push({...o,keys:a});for(let l of c)!a.includes(l)&&i.has(l)&&e.issues.push(i.get(l))}let u=Ot(t.value,r.value);if(!u.valid){if(j(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`)}return e.value=u.data,e}var vo=p("$ZodRecord",(e,t)=>{w.init(e,t);let r=A.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!X(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;let s=[],c=t.keyType._zod.values;if(c&&!t.partial){n.value=r?r.alloc(e,n,{},o):{};let u=new Set;for(let l of c)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){if(u.add(typeof l=="number"?l.toString():l),l==="__proto__")continue;let f=t.keyType._zod.run({value:l,issues:[]},o);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(f.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(h=>L(h,o,E())),input:l,path:[l],inst:e});continue}let m=f.value;if(m==="__proto__")continue;let d=t.valueType._zod.run({value:i[l],issues:[]},o);d instanceof Promise?s.push(d.then(h=>{h.issues.length&&n.issues.push(...K(l,h.issues)),n.value[m]=h.value})):(d.issues.length&&n.issues.push(...K(l,d.issues)),n.value[m]=d.value)}let a;for(let l in i)if(!u.has(l))if(t.mode==="loose"){if(l==="__proto__")continue;n.value[l]=i[l]}else a=a??[],a.push(l);a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:a,continue:!0})}else{n.value=r?r.alloc(e,n,{},o):{};let u;for(let a of Reflect.ownKeys(i)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,a))continue;let l=t.keyType._zod.run({value:a,issues:[]},o);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&ge.test(a)&&l.issues.length){let h=t.keyType._zod.run({value:Number(a),issues:[]},o);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(l=h)}if(l.issues.length){t.mode==="loose"?n.value[a]=i[a]:c?(u=u??[],u.push(a)):n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(h=>L(h,o,E())),input:a,path:[a],inst:e});continue}let m=l.value;if(m==="__proto__")continue;let d=t.valueType._zod.run({value:i[a],issues:[]},o);d instanceof Promise?s.push(d.then(h=>{h.issues.length&&n.issues.push(...K(a,h.issues)),n.value[m]=h.value})):(d.issues.length&&n.issues.push(...K(a,d.issues)),n.value[m]=d.value)}u&&u.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:u,continue:!0})}return s.length?Promise.all(s).then(()=>n):n}});var zo=p("$ZodEnum",(e,t)=>{w.init(e,t);let r=te(t.entries),n=new Set(r);e._zod.values=n,b(e,"pattern",o=>{let i=te(o.def.entries).filter(s=>dt.has(typeof s));return new RegExp(i.length?`^(${i.map(s=>J(s.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,i)=>{let s=o.value;return n.has(s)||o.issues.push({code:"invalid_value",values:r,input:s,inst:e}),o}}),$o=p("$ZodLiteral",(e,t)=>{w.init(e,t);let r=new Set(t.values);e._zod.values=r,b(e,"pattern",n=>{let o=n.def.values;return new RegExp(o.length?`^(${o.map(i=>typeof i=="string"?J(i):i?J(i.toString()):String(i)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,o)=>{let i=n.value;return r.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}});var wo=p("$ZodTransform",(e,t)=>{w.init(e,t),e._zod.optin="optional",A.memoizer?.guard(e),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new oe(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(r.value=s,r));if(o instanceof Promise)throw new F;return r.value=o,r}});function In(e,t){return e.value=t.issues.length?void 0:t.value,e}var Tt=p("$ZodOptional",(e,t)=>{w.init(e,t),b(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",b(e,"values",r=>{let n=r.def.innerType._zod.values;return n?new Set([...n,void 0]):void 0}),b(e,"pattern",r=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${pe(n.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let o=t.innerType._zod.run({value:r.value,issues:[]},n);return o instanceof Promise?o.then(i=>In(r,i)):In(r,o)}return t.innerType._zod.run(r,n)}}),ko=p("$ZodExactOptional",(e,t)=>{Tt.init(e,t),b(e,"values",r=>r.def.innerType._zod.values),b(e,"pattern",r=>r.def.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),Zo=p("$ZodNullable",(e,t)=>{w.init(e,t),b(e,"optin",r=>r.def.innerType._zod.optin),b(e,"optout",r=>r.def.innerType._zod.optout),b(e,"pattern",r=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${pe(n.source)}|null)$`):void 0}),b(e,"values",r=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),Po=p("$ZodDefault",(e,t)=>{w.init(e,t),e._zod.optin="defaulted",b(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>An(i,t)):An(o,t)}});function An(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var So=p("$ZodPrefault",(e,t)=>{w.init(e,t),e._zod.optin="defaulted",b(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),Oo=p("$ZodNonOptional",(e,t)=>{w.init(e,t),b(e,"values",r=>{let n=r.def.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>En(i,e)):En(o,e)}});function En(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function Tn(e,t,r,n){return t.issues.length?(e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(o=>L(o,n,E()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var Io=p("$ZodCatch",(e,t)=>{w.init(e,t),b(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),b(e,"optout",r=>r.def.innerType._zod.optout),b(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run({value:r.value,issues:[]},n);return o instanceof Promise?o.then(i=>Tn(r,i,t,n)):Tn(r,o,t,n)}});var Ao=p("$ZodPipe",(e,t)=>{w.init(e,t),b(e,"values",r=>r.def.in._zod.values),b(e,"optin",r=>r.def.in._zod.optin),b(e,"optout",r=>r.def.out._zod.optout),b(e,"propValues",r=>r.def.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let i=t.out._zod.run(r,n);return i instanceof Promise?i.then(s=>Le(s,t.in,n)):Le(i,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>Le(i,t.out,n)):Le(o,t.out,n)}});function Le(e,t,r){return e.issues.some(n=>n.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}var Eo=p("$ZodReadonly",(e,t)=>{w.init(e,t),b(e,"propValues",r=>r.def.innerType._zod.propValues),b(e,"values",r=>r.def.innerType._zod.values),b(e,"optin",r=>r.def.innerType?._zod?.optin),b(e,"optout",r=>r.def.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(Nn):Nn(o)}});function Nn(e){return e.memo||(e.value=Object.freeze(e.value)),e}var To=p("$ZodCustom",(e,t)=>{O.init(e,t),w.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(i=>Cn(i,r,n,e));Cn(o,r,n,e)}});function Cn(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(ne(o))}}var Ct=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},Rt="~memo",No=[];function Co(e){return e!==null&&typeof e=="object"}function Nt(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}var Ro=new WeakMap,ye=0,Ve=1,be=2;function We(e,t,r){let n=Ro.get(e);if(n!==void 0)return n?be:ye;if(t.has(e))return be;t.add(e);let o=ye,i=l=>{if(o!==be&&l?._zod){let f=We(l,t,r);f>o&&(o=f)}},s=(l,f)=>{let m=ye;for(let d of Reflect.ownKeys(l)){let h=Object.getOwnPropertyDescriptor(l,d);if(f&&!h.enumerable)continue;let _=h.get?Ve:h.value?._zod?We(h.value,t,r):ye;_>m&&(m=_)}return m},c=l=>{l>o&&(o=l)},u=e._zod.def,a=u.type;switch(a){case"object":{let l=fe(u);c(l?s(l,!0):Ve),i(u.catchall);break}case"array":i(u.element);break;case"tuple":for(let l of u.items)i(l);i(u.rest);break;case"record":case"map":i(u.keyType),i(u.valueType);break;case"set":i(u.valueType);break;case"union":for(let l of u.options)i(l);break;case"intersection":i(u.left),i(u.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":i(u.innerType);break;case"pipe":i(u.in),i(u.out);break;case"function":i(u.input),i(u.output);break;case"lazy":{let l=u._cachedInner??(r?e._zod.innerType:void 0);c(l?We(l,t,!1):Ve);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let l in u){let f=Object.getOwnPropertyDescriptor(u,l);if(!f||f.get)continue;let m=f.value;if(!(!m||typeof m!="object")){if(m._zod)i(m);else if(Array.isArray(m))for(let d of m)i(d)}}}return t.delete(e),Lc(e,o)}function Lc(e,t){return t!==Ve&&Ro.set(e,t===be),t}function Fc(e,t){let r=e.buckets.get(t);return r||(r=new WeakMap,e.buckets.set(t,r)),r}var Je,Ke=[],Mc={alloc(e,t,r){let n=Je;if(!n)return r;Je=void 0;let o={value:r,issues:null};return n.set(t.value,o),Ke.push(o),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,n=(o,i)=>{if(i.direction!=="backward"&&Uc(i,o.value))throw new Ct;return r(o,i)};e._zod.parse=n,e._zod.run===r&&(e._zod.run=n)})},attach(e){var t;let r,n=!1,o,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let s=e._zod.parse,c=(u,a)=>{if(r===void 0){let v=We(e,new Set,!1);if(v===ye)return e._zod.parse=s,e._zod.run===c&&(e._zod.run=s),s(u,a);v===be||n?r=!0:n=!0}let l=u.value;if(!Co(l))return s(u,a);let f=a[Rt];f||(f={buckets:new WeakMap,backEdges:void 0},a[Rt]=f);let m;o===a?m=i:(m=Fc(f,e),o=a,i=m);let d=m.get(l);if(d)return u.value=d.value,d.issues?d.issues.length&&u.issues.push(...Nt(d.issues)):(u.memo=!0,f.backEdges??(f.backEdges=new WeakSet),f.backEdges.add(d.value)),u;Je=m;let h=Ke.length,_=s(u,a);Je=void 0;let x=Ke.length>h?Ke.pop():void 0;return _ instanceof Promise?_.then(v=>(x&&(x.issues=v.issues.length?Nt(v.issues):No),v)):(x&&(x.issues=_.issues.length?Nt(_.issues):No),_)};e._zod.parse=c,e._zod.run===s&&(e._zod.run=c)})}};function Do(){return Mc}function Uc(e,t){let r=e[Rt]?.backEdges;return r!==void 0&&Co(t)&&r.has(t)}var Bc=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(i){return e[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};function o(i,s){return i==="number"&&typeof s=="number"&&!Number.isFinite(s)?String(s):n[i]??i}return i=>{switch(i.code){case"invalid_type":{let s=o(i.expected),c=gt(i.input),u=o(c,i.input);return`Invalid input: expected ${s}, received ${u}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${Pe(i.values[0])}`:`Invalid option: expected one of ${ke(i.values,"|")}`;case"too_big":{let s=i.exact?"exactly ":i.inclusive?"<=":"<",c=t(i.origin);return c?`Too big: expected ${i.origin??"value"} to have ${s}${i.maximum.toString()} ${c.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${s}${i.maximum.toString()}`}case"too_small":{let s=i.exact?"exactly ":i.inclusive?">=":">",c=t(i.origin);return c?`Too small: expected ${i.origin} to have ${s}${i.minimum.toString()} ${c.unit}`:`Too small: expected ${i.origin} to be ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${r[s.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${ke(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`Invalid discriminator value. Expected ${i.options.map(c=>`'${c}'`).join(" | ")}`:i.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function jo(){return{localeError:Bc()}}var Lo;var Dt=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function Jc(){return new Dt}(Lo=globalThis).__zod_globalRegistry??(Lo.__zod_globalRegistry=Jc());var q=globalThis.__zod_globalRegistry;function Fo(e){return e.checks&&(e.checks=[...e.checks]),e}function Mo(e,t){return new e(Fo({type:"string",...g(t)}))}function Uo(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...g(t)})}function Bo(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...g(t)})}function Jo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...g(t)})}function Ko(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...g(t)})}function Vo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...g(t)})}function Wo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...g(t)})}function Go(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...g(t)})}function Xo(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...g(t)})}function Yo(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...g(t)})}function Ho(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...g(t)})}function qo(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...g(t)})}function Qo(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...g(t)})}function ei(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...g(t)})}function ti(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...g(t)})}function ri(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...g(t)})}function ni(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...g(t)})}function oi(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...g(t)})}function ii(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...g(t)})}function si(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...g(t)})}function ci(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...g(t)})}function ui(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...g(t)})}function ai(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...g(t)})}function li(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...g(t)})}function pi(e,t){return new e({type:"string",format:"date",check:"string_format",...g(t)})}function fi(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...g(t)})}function di(e,t){return new e({type:"string",format:"duration",check:"string_format",...g(t)})}function mi(e,t){return new e(Fo({type:"number",checks:[],...g(t)}))}function hi(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...g(t)})}function gi(e,t){return new e({type:"boolean",...g(t)})}function _i(e){return new e({type:"unknown"})}function xi(e,t){return new e({type:"never",...g(t)})}function Ge(e,t){return new Pt({check:"less_than",...g(t),value:e,inclusive:!1})}function ve(e,t){return new Pt({check:"less_than",...g(t),value:e,inclusive:!0})}function Xe(e,t){return new St({check:"greater_than",...g(t),value:e,inclusive:!1})}function ze(e,t){return new St({check:"greater_than",...g(t),value:e,inclusive:!0})}function Ye(e,t){return new fn({check:"multiple_of",...g(t),value:e})}function He(e,t){return new mn({check:"max_length",...g(t),maximum:e})}function ie(e,t){return new hn({check:"min_length",...g(t),minimum:e})}function qe(e,t){return new gn({check:"length_equals",...g(t),length:e})}function jt(e,t){return new _n({check:"string_format",format:"regex",...g(t),pattern:e})}function Lt(e){return new xn({check:"string_format",format:"lowercase",...g(e)})}function Ft(e){return new yn({check:"string_format",format:"uppercase",...g(e)})}function Mt(e,t){return new bn({check:"string_format",format:"includes",...g(t),includes:e})}function Ut(e,t){return new vn({check:"string_format",format:"starts_with",...g(t),prefix:e})}function Bt(e,t){return new zn({check:"string_format",format:"ends_with",...g(t),suffix:e})}function Y(e){return new $n({check:"overwrite",tx:e})}function Jt(e){return Y(t=>t.normalize(e))}function Kt(){return Y(e=>e.trim())}function Vt(){return Y(e=>e.toLowerCase())}function Wt(){return Y(e=>e.toUpperCase())}function Gt(){return Y(e=>pt(e))}function yi(e,t,r){return new e({type:"array",element:t,...g(r)})}function bi(e,t,r){return new e({type:"custom",check:"custom",fn:t,...g(r)})}function vi(e,t){let r=Kc(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(ne(o,n.value,r._zod.def));else{let i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=n.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),n.issues.push(ne(i))}},e(n.value,n)),t);return r}function Kc(e,t){let r=new O({check:"custom",...g(t)});return r._zod.check=e,r}function $e(e,...t){for(let r of t)for(let n of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,n)&&C(e,n,r[n]);return e}function Yt(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??q,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function V(e,t,r,n,o){let i=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:n.path,message:o}):t.unrepresentable;if(i==="any")return!1;if(i===void 0||i==="throw")throw new Error(o);return Object.assign(r,i),!0}function P(e,t,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let c=e._zod.toJSONSchema?.();if(c)s.schema=c;else{let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,l);else{let m=s.schema,d=t.processors[o.type];if(!d)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);d(e,t,m,l)}let f=e._zod.parent;f&&(s.ref||(s.ref=f),P(f,t,l),t.seen.get(f).isParent=!0)}let u=t.metadataRegistry.get(e);return u&&$e(s.schema,u),t.io==="input"&&I(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&"_prefault"in s.schema&&((n=s.schema).default??(n.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function zi(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Ht(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let n=new Map;for(let s of e.seen.entries()){let c=e.metadataRegistry.get(s[0])?.id;if(c){let u=n.get(c);if(u&&u!==s[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(c,s[0])}}let o=s=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let f=e.external.registry.get(s[0])?.id,m=e.external.uri??(h=>h);if(f)return{ref:m(f)};let d=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=d,{defId:d,ref:`${m("__shared")}#/${c}/${zi(d)}`}}let u="#",a=`${u}/${c}/`;if(s[1]===r&&!s[1].schema.id)return{ref:u};let l=s[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:a+zi(l)}},i=s=>{if(s[1].schema.$ref)return;let c=s[1],{ref:u,defId:a}=o(s);c.def={...c.schema},a&&(c.defId=a);let l=c.schema;for(let f in l)delete l[f];l.$ref=u};if(e.cycles==="throw")for(let s of e.seen.entries()){let c=s[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
59
+
60
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let c=s[1];if(t===s[0]){i(s);continue}if(e.external){let a=e.external.registry.get(s[0])?.id;if(t!==s[0]&&a){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(c.cycle){i(s);continue}c.count>1&&e.reused==="ref"&&i(s)}e.external&&(e.sharedDefsExtractedFor=e.external)}function ki(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let n of t){if(!n||typeof n!="object")return;ki(n);let o=Object.keys(n);if(o.length!==1||o[0]!=="type")return;let i=n.type;for(let s of Array.isArray(i)?i:[i]){if(typeof s!="string")return;r.includes(s)||r.push(s)}}delete e.anyOf,e.type=r.length===1?r[0]:r}var Zi=new Set(["type","properties","required","additionalProperties"]),$i=["oneOf","anyOf"];function wi(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function Xt(e){let t=[];for(let i of e){if(typeof i!="object"||i.type!=="object")return null;for(let s in i)if(!Zi.has(s))return null;t.push(i)}let r={},n=new Set;for(let i of t){for(let s in i.properties){if(Object.prototype.hasOwnProperty.call(r,s))continue;let c=[];for(let a of t){let l=a.properties?.[s]??wi(a);l!=null&&(c.some(f=>JSON.stringify(f)===JSON.stringify(l))||c.push(l))}let u=c.length===1?c[0]:Xt(c)??{allOf:c};C(r,s,u)}for(let s of i.required??[])n.add(s)}let o={type:"object",properties:r};if(n.size&&(o.required=[...n]),t.every(i=>i.additionalProperties===!1))o.additionalProperties=!1;else{let i=[];for(let s of t){let c=wi(s);c&&!i.some(u=>JSON.stringify(u)===JSON.stringify(c))&&i.push(c)}i.length===1?o.additionalProperties=i[0]:i.length>1&&(o.additionalProperties={allOf:i})}return o}function Vc(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let o of Zi)if(o in e)return;let r=t.filter(o=>$i.some(i=>Array.isArray(o[i]))),n=null;if(!r.length)n=Xt(t);else{let o=r[0],i=$i.find(u=>Array.isArray(o[u]));if(Object.keys(o).length!==1)return;let s=t.filter(u=>u!==o),c=o[i].map(u=>Xt([...s,u]));if(c.some(u=>!u))return;n={[i]:c}}n&&(delete e.allOf,$e(e,n))}function qt(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=c=>{let u=e.seen.get(c);if(u.ref===null)return;let a=u.def??u.schema,l={...a},f=u.ref;if(u.ref=null,f){n(f);let d=e.seen.get(f),h=d.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(a.allOf=a.allOf??[],a.allOf.push(h)):$e(a,h),$e(a,l),c._zod.parent===f)for(let x in a)x==="$ref"||x==="allOf"||x in l||delete a[x];if(h.$ref&&d.def)for(let x in a)x==="$ref"||x==="allOf"||x in d.def&&JSON.stringify(a[x])===JSON.stringify(d.def[x])&&delete a[x]}let m=c._zod.parent;if(m&&m!==f){n(m);let d=e.seen.get(m);if(d?.schema.$ref&&(a.$ref=d.schema.$ref,d.def))for(let h in a)h==="$ref"||h==="allOf"||h in d.def&&JSON.stringify(a[h])===JSON.stringify(d.def[h])&&delete a[h]}e.override({zodSchema:c,jsonSchema:a,path:u.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let c of[...e.seen.entries()].reverse())n(c[0]);if(e.target!=="openapi-3.0")for(let c of e.seen.entries())ki(c[1].def??c[1].schema);for(let c of e.deferred)c();if(e.intersections.length){let c=new Map;for(let u of e.seen.values())for(let a of[u.schema,u.def]){let l=a?.allOf;if(!Array.isArray(l))continue;let f=c.get(l);f?f.push(a):c.set(l,[a])}for(let u of e.intersections)for(let a of c.get(u)??[])Vc(a)}}let o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let c=e.external.registry.get(t)?.id;if(!c)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(c)}$e(o,r.defId?r.schema:r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&o.id===i&&delete o.id;let s=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let c of e.seen.entries()){let u=c[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,C(s,u.defId,u.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{let c=JSON.parse(JSON.stringify(o));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:we(t,"input",e.processors),output:we(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function I(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return I(n.element,r);if(n.type==="set")return I(n.valueType,r);if(n.type==="lazy")return I(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault"||n.type==="catch")return I(n.innerType,r);if(n.type==="intersection")return I(n.left,r)||I(n.right,r);if(n.type==="record"||n.type==="map")return I(n.keyType,r)||I(n.valueType,r);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:I(n.in,r)||I(n.out,r);if(n.type==="object"){for(let o in n.shape)if(I(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(let o of n.options)if(I(o,r))return!0;return!1}if(n.type==="tuple"){for(let o of n.items)if(I(o,r))return!0;return!!(n.rest&&I(n.rest,r))}return!1}var Pi=(e,t={})=>r=>{let n=Yt({...r,processors:t});return P(e,n),Ht(n,e),qt(n,e)},we=(e,t,r={})=>n=>{let{libraryOptions:o,target:i}=n??{},s=Yt({...o??{},target:i,io:t,processors:r});return P(e,s),Ht(s,e),qt(s,e)};var se=(e,t,r)=>{(e[t]===void 0||r>e[t])&&(e[t]=r)},ce=(e,t,r)=>{(e[t]===void 0||r<e[t])&&(e[t]=r)},Si=(e,t)=>{se(e,"minimum",t),ce(e,"maximum",t)},Ei=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},Ti=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},Ni=(e,t)=>{e.mime=e.mime?e.mime.filter(r=>t.includes(r)):[...t]},Ci=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},Oi=(e,t)=>se(e,"minimum",t.minimum),Ii=(e,t)=>ce(e,"maximum",t.maximum),Ai=e=>(t,r)=>{Ci(t,r.format);let[n,o]=e[r.format];se(t,"minimum",n),ce(t,"maximum",o)},Wc={greater_than:(e,t)=>se(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>ce(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>Ei(e,t.value),number_format:Ai(de),bigint_format:Ai(Se),min_length:Oi,max_length:Ii,length_equals:(e,t)=>Si(e,t.length),min_size:Oi,max_size:Ii,size_equals:(e,t)=>Si(e,t.size),string_format:(e,t)=>{Ci(e,t.format),t.pattern&&Ti(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Ni(e,t.mime)};function R(e){let t={},r=e._zod.def,n=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let i of n)Wc[i._zod.def.check]?.(t,i._zod.def);let o=e._zod.bag;o.minimum!==void 0&&se(t,"minimum",o.minimum),o.exclusiveMinimum!==void 0&&se(t,"exclusiveMinimum",o.exclusiveMinimum),o.maximum!==void 0&&ce(t,"maximum",o.maximum),o.exclusiveMaximum!==void 0&&ce(t,"exclusiveMaximum",o.exclusiveMaximum),o.multipleOf!==void 0&&Ei(t,o.multipleOf),o.format!==void 0&&(t.format??(t.format=o.format),o.format.includes("int")&&(t.isInt=!0)),o.mime&&Ni(t,o.mime);for(let i of o.patterns??[])Ti(t,i);return t}var Gc={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Xc=new Map([[At,Qr],[Be,en]]),Ri=e=>Xc.get(e)??e,Di=(e,t,r,n)=>{let o=r;o.type="string";let{minimum:i,maximum:s,format:c,patterns:u,contentEncoding:a,laxFormat:l}=R(e);if(typeof i=="number"&&(o.minLength=i),typeof s=="number"&&(o.maxLength=s),c&&(o.format=Gc[c]??c,o.format===""&&delete o.format,(c==="time"||l)&&delete o.format),a&&(o.contentEncoding=a),u&&u.size>0){let f=[...u].map(Ri);f.length===1?o.pattern=f[0].source:f.length>1&&(o.allOf=[...f.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},ji=(e,t,r,n)=>{let o=r,{minimum:i,maximum:s,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:a,isInt:l}=R(e);o.type=l?"integer":"number";let f=typeof a=="number"&&a>=(i??Number.NEGATIVE_INFINITY),m=typeof u=="number"&&u<=(s??Number.POSITIVE_INFINITY),d=t.target==="draft-04"||t.target==="openapi-3.0";if(f?d?(o.minimum=a,o.exclusiveMinimum=!0):o.exclusiveMinimum=a:typeof i=="number"&&(o.minimum=i),m?d?(o.maximum=u,o.exclusiveMaximum=!0):o.exclusiveMaximum=u:typeof s=="number"&&(o.maximum=s),c){let h=new Set;for(let v of c)Number.isFinite(v)&&v!==0?h.add(Math.abs(v)):V(e,t,o,n,`A multipleOf divisor of ${v} cannot be represented in JSON Schema`);let[_,...x]=h;_!==void 0&&(o.multipleOf=_),x.length&&(o.allOf=[...o.allOf??[],...x.map(v=>({multipleOf:v}))])}},Li=(e,t,r,n)=>{r.type="boolean"};var Fi=(e,t,r,n)=>{r.not={}};var Mi=(e,t,r,n)=>{};var Ui=(e,t,r,n)=>{let o=e._zod.def,i=te(o.entries);if(i.length===0){r.not={};return}i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),r.enum=i},Bi=(e,t,r,n)=>{let o=e._zod.def;if(o.values.length===0){r.not={};return}let i=[];for(let s of o.values)if(s===void 0){if(V(e,t,r,n,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof s=="bigint"){if(V(e,t,r,n,"BigInt literals cannot be represented in JSON Schema"))return;i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){let s=i[0];r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[s]:r.const=s}else i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),i.every(s=>typeof s=="boolean")&&(r.type="boolean"),i.every(s=>s===null)&&(r.type="null"),r.enum=i};var Ji=(e,t,r,n)=>{V(e,t,r,n,"Custom types cannot be represented in JSON Schema")};var Ki=(e,t,r,n)=>{V(e,t,r,n,"Transforms cannot be represented in JSON Schema")};var Vi=(e,t,r,n)=>{let o=r,i=e._zod.def,{minimum:s,maximum:c}=R(e);typeof s=="number"&&(o.minItems=s),typeof c=="number"&&(o.maxItems=c),o.type="array",o.items=P(i.element,t,{...n,path:[...n.path,"items"]})};function Qe(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?Qe(t.out):t.type==="catch"?Qe(t.innerType):e._zod.optin}var Wi=(e,t,r,n)=>{let o=r,i=e._zod.def,s=i.shape;if(Object.getOwnPropertySymbols(s).length&&V(e,t,o,n,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(let a in s)C(o.properties,a,P(s[a],t,{...n,path:[...n.path,"properties",a]}));let u=[];for(let a of Object.keys(s)){let l=i.shape[a];(t.io==="input"?Qe(l)===void 0:l._zod.optout===void 0)&&u.push(a)}u.length>0&&(o.required=u),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=P(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},Gi=(e,t,r,n)=>{let o=e._zod.def,i=o.inclusive===!1,s=o.options.map((c,u)=>P(c,t,{...n,path:[...n.path,i?"oneOf":"anyOf",u]}));i?r.oneOf=s:r.anyOf=s},Xi=(e,t,r,n)=>{let o=e._zod.def,i=P(o.left,t,{...n,path:[...n.path,"allOf",0]}),s=P(o.right,t,{...n,path:[...n.path,"allOf",1]}),c=a=>"allOf"in a&&Object.keys(a).length===1,u=[...c(i)?i.allOf:[i],...c(s)?s.allOf:[s]];r.allOf=u,t.intersections.push(u)};function Qt(e,t,r){if(t.$ref){if(r.has(t))return t;r.add(t);let h=e.get(t)?.def;if(!h)return t;let _=Qt(e,h,r);return _===h?t:_}for(let h of["anyOf","oneOf"]){let _=t[h];if(!Array.isArray(_))continue;let x=_.map(v=>Qt(e,v,r));x.some((v,N)=>v!==_[N])&&(t={...t,[h]:x})}let n=Array.isArray(t.type)?t.type:[t.type],o=!n.includes("string")&&n.some(h=>h==="number"||h==="integer"),i=t.enum??(t.const!==void 0?[t.const]:void 0);if(!o&&!i?.some(h=>typeof h=="number"))return t;let{minimum:s,maximum:c,exclusiveMinimum:u,exclusiveMaximum:a,multipleOf:l,format:f,id:m,...d}=t;return d.enum?d.enum=d.enum.map(h=>typeof h=="number"?String(h):h):typeof d.const=="number"&&(d.const=String(d.const)),o&&(d.type="string",i||(d.pattern=(n.includes("number")?ge:kt).source)),d}var er=new WeakMap;function Yc(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let r=new Map;for(let n of er.get(e)??[]){let o=e.seen.get(n),i=(o?.def??o?.schema)?.propertyNames;if(!i||i===!0||r.has(i))continue;let s=Qt(t,i,new Set);s!==i&&r.set(i,s)}if(r.size)for(let n of e.seen.values())for(let o of[n.schema,n.def]){let i=o&&r.get(o.propertyNames);i&&(o.propertyNames=i)}}var Yi=(e,t,r,n)=>{let o=r,i=e._zod.def;o.type="object";let s=i.keyType,c=R(s).patterns;if(i.mode==="loose"&&c&&c.size>0){let l=P(i.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(let f of c)C(o.patternProperties,Ri(f).source,l)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){o.propertyNames=P(i.keyType,t,{...n,path:[...n.path,"propertyNames"]});let l=er.get(t);l||(l=[],er.set(t,l),t.deferred.push(()=>Yc(t))),l.push(e)}o.additionalProperties=P(i.valueType,t,{...n,path:[...n.path,"additionalProperties"]})}let u=s._zod.values,a=t.io==="input"&&Qe(i.valueType)!==void 0;if(u&&!i.partial&&!a){let l=[...u].filter(f=>typeof f=="string"||typeof f=="number");l.length>0&&(o.required=l.map(String))}},Hi=(e,t,r,n)=>{let o=e._zod.def,i=P(o.innerType,t,n),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=o.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},qi=(e,t,r,n)=>{let o=e._zod.def;P(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType},tr=Symbol();function Qi(e,t,r,n,o){let i=!1,s=JSON.stringify(e,(c,u)=>typeof u!="bigint"?u:(i=!0,null));return i?(V(t,r,n,o,"BigInt defaults cannot be represented in JSON Schema"),tr):JSON.parse(s)}var es=(e,t,r,n)=>{let o=e._zod.def;P(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s=Qi(o.defaultValue,e,t,r,n);s!==tr&&(r.default=s)},ts=(e,t,r,n)=>{let o=e._zod.def;P(o.innerType,t,n);let i=t.seen.get(e);if(i.ref=o.innerType,t.io!=="input")return;let s=Qi(o.defaultValue,e,t,r,n);s!==tr&&(r._prefault=s)},rs=(e,t,r,n)=>{let o=e._zod.def;P(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0)}catch{V(e,t,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=s},ns=(e,t,r,n)=>{let o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?i?o.out:o.in:o.out;P(s,t,n);let c=t.seen.get(e);c.ref=s},os=(e,t,r,n)=>{let o=e._zod.def;P(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType,r.readOnly=!0};var rr=(e,t,r,n)=>{let o=e._zod.def;P(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType};var is=new WeakSet([Object.prototype,Error.prototype]);function et(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let n=r(this);return Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0})}})}var ou=(e,t)=>{Zr.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);is.has(r)||(is.add(r),et(r,"format",n=>o=>Sr(n,o)),et(r,"flatten",n=>o=>Pr(n,o)),et(r,"addIssue",n=>o=>{n.issues.push(o),n.message=JSON.stringify(n.issues,re,2)}),et(r,"addIssues",n=>o=>{n.issues.push(...o),n.message=JSON.stringify(n.issues,re,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))};var T=p("ZodError",ou,void 0,{Parent:Error});var ss=Te(T),cs=Ne(T),us=Ce(T),as=Re(T),ls=Ir(T),ps=Ar(T),fs=Er(T),ds=Tr(T),ms=Nr(T),hs=Cr(T),gs=Rr(T),_s=Dr(T);function su(){A.localeError||E(jo())}function rt(){A.memoizer||E({memoizer:Do()})}var k=p("ZodType",(e,t)=>(su(),w.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(y.mergeDefs(t,{checks:[...t.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return D(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(na(e,t))},superRefine(e,t){return this.check(oa(e,t))},overwrite(e){return this.check(Y(e))},optional(){return vs(this)},exactOptional(){return Ju(this)},nullable(){return zs(this)},nullish(){return vs(zs(this))},nonoptional(e){return Yu(this,e)},array(){return sr(this)},or(e){return ju([this,e])},and(e){return Fu(this,e)},transform(e){return $s(this,Bu(e))},default(e){return Wu(this,e)},prefault(e){return Xu(this,e)},catch(e){return qu(this,e)},pipe(e){return $s(this,e)},readonly(){return ta(this)},describe(e){let t=this.clone();return q.add(t,{description:e}),t},meta(...e){if(e.length===0)return q.get(this);let t=this.clone();return q.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return y.hide(this,"~standard",{...It(this),jsonSchema:{input:we(this,"input"),output:we(this,"output")}})},set"~standard"(e){y.own(this,"~standard",e)},parse:function e(t,r){return ss(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await cs(this,t,r,{callee:e})},safeParse(e,t){return us(this,e,t)},async safeParseAsync(e,t){return as(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){y.own(this,"spa",e)},validate(e,t){return vt(this,e,t)},validateAsync(e,t){return zt(this,e,t)},encode:function e(t,r){return ls(this,t,r,{callee:e})},decode:function e(t,r){return ps(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await fs(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await ds(this,t,r,{callee:e})},safeEncode(e,t){return ms(this,e,t)},safeDecode(e,t){return hs(this,e,t)},async safeEncodeAsync(e,t){return gs(this,e,t)},async safeDecodeAsync(e,t){return _s(this,e,t)},toJSONSchema(e){return Pi(this,{})(e)},get description(){return q.get(this)?.description},get _def(){return this._zod.def}}),ws=p("_ZodString",(e,t)=>{Ue.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Di(e,r,n,o)},y.derived({format:e=>R(e).format??null,minLength:e=>R(e).minimum??null,maxLength:e=>R(e).maximum??null},{regex(...e){return this.check(jt(...e))},includes(...e){return this.check(Mt(...e))},startsWith(...e){return this.check(Ut(...e))},endsWith(...e){return this.check(Bt(...e))},min(...e){return this.check(ie(...e))},max(...e){return this.check(He(...e))},length(...e){return this.check(qe(...e))},nonempty(...e){return this.check(ie(1,...e))},lowercase(e){return this.check(Lt(e))},uppercase(e){return this.check(Ft(e))},trim(){return this.check(Kt())},normalize(...e){return this.check(Jt(...e))},toLowerCase(){return this.check(Vt())},toUpperCase(){return this.check(Wt())},slugify(){return this.check(Gt())}})),cu=p("ZodString",(e,t)=>{Ue.init(e,t),ws.init(e,t)},{email(e){return this.check(Uo(fu,e))},url(e){return this.check(Go(mu,e))},jwt(e){return this.check(ai(Ou,e))},emoji(e){return this.check(Xo(hu,e))},guid(e){return this.check(Bo(du,e))},uuid(e){return this.check(Jo(tt,e))},uuidv4(e){return this.check(Ko(tt,e))},uuidv6(e){return this.check(Vo(tt,e))},uuidv7(e){return this.check(Wo(tt,e))},nanoid(e){return this.check(Yo(gu,e))},cuid(e){return this.check(Ho(_u,e))},cuid2(e){return this.check(qo(xu,e))},ulid(e){return this.check(Qo(yu,e))},base64(e){return this.check(si(Zu,e))},base64url(e){return this.check(ci(Pu,e))},xid(e){return this.check(ei(bu,e))},ksuid(e){return this.check(ti(vu,e))},ipv4(e){return this.check(ri(zu,e))},ipv6(e){return this.check(ni($u,e))},cidrv4(e){return this.check(oi(wu,e))},cidrv6(e){return this.check(ii(ku,e))},e164(e){return this.check(ui(Su,e))},datetime(e){return this.check(li(uu,e))},date(e){return this.check(pi(au,e))},time(e){return this.check(fi(lu,e))},duration(e){return this.check(di(pu,e))}});function ir(e){return Mo(cu,e)}var Z=p("ZodStringFormat",(e,t)=>{$.init(e,t),ws.init(e,t)}),uu=p("ZodISODateTime",(e,t)=>{Yn.init(e,t),Z.init(e,t)}),au=p("ZodISODate",(e,t)=>{Hn.init(e,t),Z.init(e,t)}),lu=p("ZodISOTime",(e,t)=>{qn.init(e,t),Z.init(e,t)}),pu=p("ZodISODuration",(e,t)=>{Qn.init(e,t),Z.init(e,t)}),fu=p("ZodEmail",(e,t)=>{Ln.init(e,t),Z.init(e,t)});var du=p("ZodGUID",(e,t)=>{Dn.init(e,t),Z.init(e,t)});var tt=p("ZodUUID",(e,t)=>{jn.init(e,t),Z.init(e,t)});var mu=p("ZodURL",(e,t)=>{Un.init(e,t),Z.init(e,t)});var hu=p("ZodEmoji",(e,t)=>{Bn.init(e,t),Z.init(e,t)});var gu=p("ZodNanoID",(e,t)=>{Jn.init(e,t),Z.init(e,t)});var _u=p("ZodCUID",(e,t)=>{Kn.init(e,t),Z.init(e,t)});var xu=p("ZodCUID2",(e,t)=>{Vn.init(e,t),Z.init(e,t)});var yu=p("ZodULID",(e,t)=>{Wn.init(e,t),Z.init(e,t)});var bu=p("ZodXID",(e,t)=>{Gn.init(e,t),Z.init(e,t)});var vu=p("ZodKSUID",(e,t)=>{Xn.init(e,t),Z.init(e,t)});var zu=p("ZodIPv4",(e,t)=>{eo.init(e,t),Z.init(e,t)});var $u=p("ZodIPv6",(e,t)=>{ro.init(e,t),Z.init(e,t)});var wu=p("ZodCIDRv4",(e,t)=>{no.init(e,t),Z.init(e,t)});var ku=p("ZodCIDRv6",(e,t)=>{oo.init(e,t),Z.init(e,t)});var Zu=p("ZodBase64",(e,t)=>{so.init(e,t),Z.init(e,t)});var Pu=p("ZodBase64URL",(e,t)=>{co.init(e,t),Z.init(e,t)});var Su=p("ZodE164",(e,t)=>{uo.init(e,t),Z.init(e,t)});var Ou=p("ZodJWT",(e,t)=>{ao.init(e,t),Z.init(e,t)});var ks=p("ZodNumber",(e,t)=>{Et.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ji(e,r,n,o),e.isFinite=!0},y.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:r}=R(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:r}=R(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:r}=R(e);return!!t||!!r?.some(Number.isSafeInteger)},format:e=>R(e).format??null},{gt(e,t){return this.check(Xe(e,t))},gte(e,t){return this.check(ze(e,t))},min(e,t){return this.check(ze(e,t))},lt(e,t){return this.check(Ge(e,t))},lte(e,t){return this.check(ve(e,t))},max(e,t){return this.check(ve(e,t))},int(e){return this.check(xs(e))},safe(e){return this.check(xs(e))},positive(e){return this.check(Xe(0,e))},nonnegative(e){return this.check(ze(0,e))},negative(e){return this.check(Ge(0,e))},nonpositive(e){return this.check(ve(0,e))},multipleOf(e,t){return this.check(Ye(e,t))},step(e,t){return this.check(Ye(e,t))},finite(){return this}}));function Zs(e){return mi(ks,e)}var Iu=p("ZodNumberFormat",(e,t)=>{lo.init(e,t),ks.init(e,t)});function xs(e){return hi(Iu,e)}var Au=p("ZodBoolean",(e,t)=>{po.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Li(e,r,n,o)});function Ps(e){return gi(Au,e)}var Eu=p("ZodUnknown",(e,t)=>{fo.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Mi(e,r,n,o)});function ys(){return _i(Eu)}var Tu=p("ZodNever",(e,t)=>{mo.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Fi(e,r,n,o)});function Nu(e){return xi(Tu,e)}var Cu=p("ZodArray",(e,t)=>{rt(),ho.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Vi(e,r,n,o),e.element=t.element},{min(e,t){return this.check(ie(e,t))},nonempty(e){return this.check(ie(1,e))},max(e,t){return this.check(He(e,t))},length(e,t){return this.check(qe(e,t))},unwrap(){return this.element}});function sr(e,t){return yi(Cu,e,t)}var Ru=p("ZodObject",(e,t)=>{rt(),xo.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Wi(e,r,n,o),y.installLazyProp(e,"shape",r=>r._zod.def.shape,!1)},{keyof(){return cr(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(y.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(y.mergeDefs(this._zod.def,{catchall:ys()}))},loose(){return this.clone(y.mergeDefs(this._zod.def,{catchall:ys()}))},strict(){return this.clone(y.mergeDefs(this._zod.def,{catchall:Nu()}))},strip(){return this.clone(y.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return y.extend(this,e)},safeExtend(e){return y.safeExtend(this,e)},merge(e){return y.merge(this,e)},pick(e){return y.pick(this,e)},omit(e){return y.omit(this,e)},partial(...e){return y.partial(As,this,e[0])},exactPartial(...e){return y.partial(Es,this,e[0],"exactPartial")},required(...e){return y.required(Ts,this,e[0])}});function Ss(e,t){let r={type:"object",shape:e??{},...y.normalizeParams(t)};return new Ru(r)}var Du=p("ZodUnion",(e,t)=>{yo.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Gi(e,r,n,o),e.options=t.options});function ju(e,t){return new Du({type:"union",options:e,...y.normalizeParams(t)})}var Lu=p("ZodIntersection",(e,t)=>{bo.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Xi(e,r,n,o)});function Fu(e,t){return new Lu({type:"intersection",left:e,right:t})}var bs=p("ZodRecord",(e,t)=>{rt(),vo.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Yi(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType});function Os(e,t,r){return!t||!t._zod?new bs({type:"record",keyType:ir(),valueType:e,...y.normalizeParams(t)}):new bs({type:"record",keyType:e,valueType:t,...y.normalizeParams(r)})}var or=p("ZodEnum",(e,t)=>{zo.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,i)=>Ui(e,n,o,i),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{let i={};for(let s of n)if(r.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new or({...t,checks:[],...y.normalizeParams(o),entries:i})},e.exclude=(n,o)=>{let i={...t.entries};for(let s of n)if(r.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new or({...t,checks:[],...y.normalizeParams(o),entries:i})}});function cr(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new or({type:"enum",entries:r,...y.normalizeParams(t)})}var Mu=p("ZodLiteral",(e,t)=>{$o.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Bi(e,r,n,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Is(e,t){return new Mu({type:"literal",values:Array.isArray(e)?e:[e],...y.normalizeParams(t)})}var Uu=p("ZodTransform",(e,t)=>{rt(),wo.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ki(e,r,n,o),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new oe(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(y.issue(i,r.value,t));else{let s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=r.value),s.inst??(s.inst=e),r.issues.push(y.issue(s))}};let o=t.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r)):(r.value=o,r)}});function Bu(e){return new Uu({type:"transform",transform:e})}var As=p("ZodOptional",(e,t)=>{Tt.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,o)=>rr(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function vs(e){return new As({type:"optional",innerType:e})}var Es=p("ZodExactOptional",(e,t)=>{ko.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,o)=>rr(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Ju(e){return new Es({type:"optional",innerType:e})}var Ku=p("ZodNullable",(e,t)=>{Zo.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Hi(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function zs(e){return new Ku({type:"nullable",innerType:e})}var Vu=p("ZodDefault",(e,t)=>{Po.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,o)=>es(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Wu(e,t){return new Vu({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():y.shallowClone(t)}})}var Gu=p("ZodPrefault",(e,t)=>{So.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ts(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Xu(e,t){return new Gu({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():y.shallowClone(t)}})}var Ts=p("ZodNonOptional",(e,t)=>{Oo.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,o)=>qi(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Yu(e,t){return new Ts({type:"nonoptional",innerType:e,...y.normalizeParams(t)})}var Hu=p("ZodCatch",(e,t)=>{Io.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,o)=>rs(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function qu(e,t){return new Hu({type:"catch",innerType:e,catchValue:typeof t=="function"?t:y.constantCatch(t)})}var Qu=p("ZodPipe",(e,t)=>{Ao.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ns(e,r,n,o),e.in=t.in,e.out=t.out});function $s(e,t){return new Qu({type:"pipe",in:e,out:t})}var ea=p("ZodReadonly",(e,t)=>{Eo.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,o)=>os(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function ta(e){return new ea({type:"readonly",innerType:e})}var ra=p("ZodCustom",(e,t)=>{To.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ji(e,r,n,o)});function na(e,t={}){return bi(ra,e,t)}function oa(e,t){return vi(e,t)}var Op={object:Ss,string:ir,number:Zs,literal:Is,enum:cr,array:sr,record:Os,boolean:Ps};export{Op as z};