takumi
Version:
A coding agent CLI to enhance your development workflow.
6 lines • 6.4 MB
JavaScript
#!/usr/bin/env -S node --no-warnings=ExperimentalWarning
import{createRequire as km0}from"node:module";var Tm0=Object.create;var{getPrototypeOf:jm0,defineProperty:Lo,getOwnPropertyNames:ym0}=Object;var vm0=Object.prototype.hasOwnProperty;var r0=(A,Q,B)=>{B=A!=null?Tm0(jm0(A)):{};let D=Q||!A||!A.__esModule?Lo(B,"default",{value:A,enumerable:!0}):B;for(let _ of ym0(A))if(!vm0.call(D,_))Lo(D,_,{get:()=>A[_],enumerable:!0});return D};var m=(A,Q)=>()=>(Q||A((Q={exports:{}}).exports,Q),Q.exports);var L_=(A,Q)=>{for(var B in Q)Lo(A,B,{get:Q[B],enumerable:!0,configurable:!0,set:(D)=>Q[B]=()=>D})};var d=(A,Q)=>()=>(A&&(Q=A(A=0)),Q);var P0=km0(import.meta.url);var qF=m((ITB,fo)=>{var tj=process||{},ZZA=tj.argv||[],sj=tj.env||{},xm0=!(!!sj.NO_COLOR||ZZA.includes("--no-color"))&&(!!sj.FORCE_COLOR||ZZA.includes("--color")||tj.platform==="win32"||(tj.stdout||{}).isTTY&&sj.TERM!=="dumb"||!!sj.CI),Sm0=(A,Q,B=A)=>(D)=>{let _=""+D,w=_.indexOf(Q,A.length);return~w?A+bm0(_,Q,B,w)+Q:A+_+Q},bm0=(A,Q,B,D)=>{let _="",w=0;do _+=A.substring(w,D)+B,w=D+Q.length,D=A.indexOf(Q,w);while(~D);return _+A.substring(w)},KZA=(A=xm0)=>{let Q=A?Sm0:()=>String;return{isColorSupported:A,reset:Q("\x1B[0m","\x1B[0m"),bold:Q("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:Q("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:Q("\x1B[3m","\x1B[23m"),underline:Q("\x1B[4m","\x1B[24m"),inverse:Q("\x1B[7m","\x1B[27m"),hidden:Q("\x1B[8m","\x1B[28m"),strikethrough:Q("\x1B[9m","\x1B[29m"),black:Q("\x1B[30m","\x1B[39m"),red:Q("\x1B[31m","\x1B[39m"),green:Q("\x1B[32m","\x1B[39m"),yellow:Q("\x1B[33m","\x1B[39m"),blue:Q("\x1B[34m","\x1B[39m"),magenta:Q("\x1B[35m","\x1B[39m"),cyan:Q("\x1B[36m","\x1B[39m"),white:Q("\x1B[37m","\x1B[39m"),gray:Q("\x1B[90m","\x1B[39m"),bgBlack:Q("\x1B[40m","\x1B[49m"),bgRed:Q("\x1B[41m","\x1B[49m"),bgGreen:Q("\x1B[42m","\x1B[49m"),bgYellow:Q("\x1B[43m","\x1B[49m"),bgBlue:Q("\x1B[44m","\x1B[49m"),bgMagenta:Q("\x1B[45m","\x1B[49m"),bgCyan:Q("\x1B[46m","\x1B[49m"),bgWhite:Q("\x1B[47m","\x1B[49m"),blackBright:Q("\x1B[90m","\x1B[39m"),redBright:Q("\x1B[91m","\x1B[39m"),greenBright:Q("\x1B[92m","\x1B[39m"),yellowBright:Q("\x1B[93m","\x1B[39m"),blueBright:Q("\x1B[94m","\x1B[39m"),magentaBright:Q("\x1B[95m","\x1B[39m"),cyanBright:Q("\x1B[96m","\x1B[39m"),whiteBright:Q("\x1B[97m","\x1B[39m"),bgBlackBright:Q("\x1B[100m","\x1B[49m"),bgRedBright:Q("\x1B[101m","\x1B[49m"),bgGreenBright:Q("\x1B[102m","\x1B[49m"),bgYellowBright:Q("\x1B[103m","\x1B[49m"),bgBlueBright:Q("\x1B[104m","\x1B[49m"),bgMagentaBright:Q("\x1B[105m","\x1B[49m"),bgCyanBright:Q("\x1B[106m","\x1B[49m"),bgWhiteBright:Q("\x1B[107m","\x1B[49m")}};fo.exports=KZA();fo.exports.createColors=KZA});var WZA=m((XTB,qZA)=>{var JK=1000,EK=JK*60,IK=EK*60,dz=IK*24,um0=dz*7,hm0=dz*365.25;qZA.exports=function(A,Q){Q=Q||{};var B=typeof A;if(B==="string"&&A.length>0)return mm0(A);else if(B==="number"&&isFinite(A))return Q.long?im0(A):cm0(A);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(A))};function mm0(A){if(A=String(A),A.length>100)return;var Q=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(A);if(!Q)return;var B=parseFloat(Q[1]),D=(Q[2]||"ms").toLowerCase();switch(D){case"years":case"year":case"yrs":case"yr":case"y":return B*hm0;case"weeks":case"week":case"w":return B*um0;case"days":case"day":case"d":return B*dz;case"hours":case"hour":case"hrs":case"hr":case"h":return B*IK;case"minutes":case"minute":case"mins":case"min":case"m":return B*EK;case"seconds":case"second":case"secs":case"sec":case"s":return B*JK;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return B;default:return}}function cm0(A){var Q=Math.abs(A);if(Q>=dz)return Math.round(A/dz)+"d";if(Q>=IK)return Math.round(A/IK)+"h";if(Q>=EK)return Math.round(A/EK)+"m";if(Q>=JK)return Math.round(A/JK)+"s";return A+"ms"}function im0(A){var Q=Math.abs(A);if(Q>=dz)return ej(A,Q,dz,"day");if(Q>=IK)return ej(A,Q,IK,"hour");if(Q>=EK)return ej(A,Q,EK,"minute");if(Q>=JK)return ej(A,Q,JK,"second");return A+" ms"}function ej(A,Q,B,D){var _=Q>=B*1.5;return Math.round(A/B)+" "+D+(_?"s":"")}});var Oo=m((zTB,UZA)=>{function dm0(A){B.debug=B,B.default=B,B.coerce=J,B.disable=G,B.enable=_,B.enabled=C,B.humanize=WZA(),B.destroy=I,Object.keys(A).forEach((F)=>{B[F]=A[F]}),B.names=[],B.skips=[],B.formatters={};function Q(F){let E=0;for(let z=0;z<F.length;z++)E=(E<<5)-E+F.charCodeAt(z),E|=0;return B.colors[Math.abs(E)%B.colors.length]}B.selectColor=Q;function B(F){let E,z=null,Y,K;function q(...H){if(!q.enabled)return;let W=q,$=Number(new Date),U=$-(E||$);if(W.diff=U,W.prev=E,W.curr=$,E=$,H[0]=B.coerce(H[0]),typeof H[0]!=="string")H.unshift("%O");let M=0;H[0]=H[0].replace(/%([a-zA-Z%])/g,(j,g)=>{if(j==="%%")return"%";M++;let y=B.formatters[g];if(typeof y==="function"){let v=H[M];j=y.call(W,v),H.splice(M,1),M--}return j}),B.formatArgs.call(W,H),(W.log||B.log).apply(W,H)}if(q.namespace=F,q.useColors=B.useColors(),q.color=B.selectColor(F),q.extend=D,q.destroy=B.destroy,Object.defineProperty(q,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(z!==null)return z;if(Y!==B.namespaces)Y=B.namespaces,K=B.enabled(F);return K},set:(H)=>{z=H}}),typeof B.init==="function")B.init(q);return q}function D(F,E){let z=B(this.namespace+(typeof E==="undefined"?":":E)+F);return z.log=this.log,z}function _(F){B.save(F),B.namespaces=F,B.names=[],B.skips=[];let E=(typeof F==="string"?F:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let z of E)if(z[0]==="-")B.skips.push(z.slice(1));else B.names.push(z)}function w(F,E){let z=0,Y=0,K=-1,q=0;while(z<F.length)if(Y<E.length&&(E[Y]===F[z]||E[Y]==="*"))if(E[Y]==="*")K=Y,q=z,Y++;else z++,Y++;else if(K!==-1)Y=K+1,q++,z=q;else return!1;while(Y<E.length&&E[Y]==="*")Y++;return Y===E.length}function G(){let F=[...B.names,...B.skips.map((E)=>"-"+E)].join(",");return B.enable(""),F}function C(F){for(let E of B.skips)if(w(F,E))return!1;for(let E of B.names)if(w(F,E))return!0;return!1}function J(F){if(F instanceof Error)return F.stack||F.message;return F}function I(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return B.enable(B.load()),B}UZA.exports=dm0});var VZA=m(($ZA,Ay)=>{$ZA.formatArgs=pm0;$ZA.save=nm0;$ZA.load=am0;$ZA.useColors=lm0;$ZA.storage=om0();$ZA.destroy=(()=>{let A=!1;return()=>{if(!A)A=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();$ZA.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function lm0(){if(typeof window!=="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let A;return typeof document!=="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!=="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!=="undefined"&&navigator.userAgent&&(A=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(A[1],10)>=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function pm0(A){if(A[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+A[0]+(this.useColors?"%c ":" ")+"+"+Ay.exports.humanize(this.diff),!this.useColors)return;let Q="color: "+this.color;A.splice(1,0,Q,"color: inherit");let B=0,D=0;A[0].replace(/%[a-zA-Z%]/g,(_)=>{if(_==="%%")return;if(B++,_==="%c")D=B}),A.splice(D,0,Q)}$ZA.log=console.debug||console.log||(()=>{});function nm0(A){try{if(A)$ZA.storage.setItem("debug",A);else $ZA.storage.removeItem("debug")}catch(Q){}}function am0(){let A;try{A=$ZA.storage.getItem("debug")||$ZA.storage.getItem("DEBUG")}catch(Q){}if(!A&&typeof process!=="undefined"&&"env"in process)A=process.env.DEBUG;return A}function om0(){try{return localStorage}catch(A){}}Ay.exports=Oo()($ZA);var{formatters:rm0}=Ay.exports;rm0.j=function(A){try{return JSON.stringify(A)}catch(Q){return"[UnexpectedJSONParseError]: "+Q.message}}});var Qy=m((HTB,MZA)=>{MZA.exports=(A,Q=process.argv)=>{let B=A.startsWith("-")?"":A.length===1?"-":"--",D=Q.indexOf(B+A),_=Q.indexOf("--");return D!==-1&&(_===-1||D<_)}});var fZA=m((ZTB,LZA)=>{var _c0=P0("os"),NZA=P0("tty"),v7=Qy(),{env:Sw}=process,By;if(v7("no-color")||v7("no-colors")||v7("color=false")||v7("color=never"))By=0;else if(v7("color")||v7("colors")||v7("color=true")||v7("color=always"))By=1;function wc0(){if("FORCE_COLOR"in Sw){if(Sw.FORCE_COLOR==="true")return 1;if(Sw.FORCE_COLOR==="false")return 0;return Sw.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Sw.FORCE_COLOR,10),3)}}function Cc0(A){if(A===0)return!1;return{level:A,hasBasic:!0,has256:A>=2,has16m:A>=3}}function Gc0(A,{streamIsTTY:Q,sniffFlags:B=!0}={}){let D=wc0();if(D!==void 0)By=D;let _=B?By:D;if(_===0)return 0;if(B){if(v7("color=16m")||v7("color=full")||v7("color=truecolor"))return 3;if(v7("color=256"))return 2}if(A&&!Q&&_===void 0)return 0;let w=_||0;if(Sw.TERM==="dumb")return w;if(process.platform==="win32"){let G=_c0.release().split(".");if(Number(G[0])>=10&&Number(G[2])>=10586)return Number(G[2])>=14931?3:2;return 1}if("CI"in Sw){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some((G)=>(G in Sw))||Sw.CI_NAME==="codeship")return 1;return w}if("TEAMCITY_VERSION"in Sw)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Sw.TEAMCITY_VERSION)?1:0;if(Sw.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Sw){let G=Number.parseInt((Sw.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Sw.TERM_PROGRAM){case"iTerm.app":return G>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(Sw.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Sw.TERM))return 1;if("COLORTERM"in Sw)return 1;return w}function go(A,Q={}){let B=Gc0(A,{streamIsTTY:A&&A.isTTY,...Q});return Cc0(B)}LZA.exports={supportsColor:go,stdout:go({isTTY:NZA.isatty(1)}),stderr:go({isTTY:NZA.isatty(2)})}});var PZA=m((gZA,_y)=>{var Fc0=P0("tty"),Dy=P0("util");gZA.init=Hc0;gZA.log=Xc0;gZA.formatArgs=Ec0;gZA.save=zc0;gZA.load=Yc0;gZA.useColors=Jc0;gZA.destroy=Dy.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");gZA.colors=[6,2,3,4,5,1];try{let A=fZA();if(A&&(A.stderr||A).level>=2)gZA.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(A){}gZA.inspectOpts=Object.keys(process.env).filter((A)=>{return/^debug_/i.test(A)}).reduce((A,Q)=>{let B=Q.substring(6).toLowerCase().replace(/_([a-z])/g,(_,w)=>{return w.toUpperCase()}),D=process.env[Q];if(/^(yes|on|true|enabled)$/i.test(D))D=!0;else if(/^(no|off|false|disabled)$/i.test(D))D=!1;else if(D==="null")D=null;else D=Number(D);return A[B]=D,A},{});function Jc0(){return"colors"in gZA.inspectOpts?Boolean(gZA.inspectOpts.colors):Fc0.isatty(process.stderr.fd)}function Ec0(A){let{namespace:Q,useColors:B}=this;if(B){let D=this.color,_="\x1B[3"+(D<8?D:"8;5;"+D),w=` ${_};1m${Q} \x1B[0m`;A[0]=w+A[0].split(`
`).join(`
`+w),A.push(_+"m+"+_y.exports.humanize(this.diff)+"\x1B[0m")}else A[0]=Ic0()+Q+" "+A[0]}function Ic0(){if(gZA.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function Xc0(...A){return process.stderr.write(Dy.formatWithOptions(gZA.inspectOpts,...A)+`
`)}function zc0(A){if(A)process.env.DEBUG=A;else delete process.env.DEBUG}function Yc0(){return process.env.DEBUG}function Hc0(A){A.inspectOpts={};let Q=Object.keys(gZA.inspectOpts);for(let B=0;B<Q.length;B++)A.inspectOpts[Q[B]]=gZA.inspectOpts[Q[B]]}_y.exports=Oo()(gZA);var{formatters:OZA}=_y.exports;OZA.o=function(A){return this.inspectOpts.colors=this.useColors,Dy.inspect(A,this.inspectOpts).split(`
`).map((Q)=>Q.trim()).join(" ")};OZA.O=function(A){return this.inspectOpts.colors=this.useColors,Dy.inspect(A,this.inspectOpts)}});var f_=m((qTB,Ro)=>{if(typeof process==="undefined"||process.type==="renderer"||!1||process.__nwjs)Ro.exports=VZA();else Ro.exports=PZA()});var pz="TAKUMI";async function XK(A){try{return[null,await A()]}catch(Q){return[Q,null]}}function gM(A){return typeof A==="object"&&A!==null&&(("name"in A)&&A.name==="AbortError"||("message"in A)&&String(A.message).includes("FetchRequestCanceledException"))}var RM=(A)=>{if(A instanceof Error)return A;if(typeof A==="object"&&A!==null){try{if(Object.prototype.toString.call(A)==="[object Error]"){let Q=new Error(A.message,A.cause?{cause:A.cause}:{});if(A.stack)Q.stack=A.stack;if(A.cause&&!Q.cause)Q.cause=A.cause;if(A.name)Q.name=A.name;return Q}}catch{}try{return new Error(JSON.stringify(A))}catch{}}return new Error(A)};var MB,Bw,Vw,nz,az,PM,TM,jM,yM,vM,kM,xM,SM,bM,uM,WF;var P5=d(()=>{MB=class MB extends Error{};Bw=class Bw extends MB{constructor(A,Q,B,D){super(`${Bw.makeMessage(A,Q,B)}`);this.status=A,this.headers=D,this.requestID=D?.get("x-request-id"),this.error=Q;let _=Q;this.code=_?.code,this.param=_?.param,this.type=_?.type}static makeMessage(A,Q,B){let D=Q?.message?typeof Q.message==="string"?Q.message:JSON.stringify(Q.message):Q?JSON.stringify(Q):B;if(A&&D)return`${A} ${D}`;if(A)return`${A} status code (no body)`;if(D)return D;return"(no status code or body)"}static generate(A,Q,B,D){if(!A||!D)return new nz({message:B,cause:RM(Q)});let _=Q?.error;if(A===400)return new PM(A,_,B,D);if(A===401)return new TM(A,_,B,D);if(A===403)return new jM(A,_,B,D);if(A===404)return new yM(A,_,B,D);if(A===409)return new vM(A,_,B,D);if(A===422)return new kM(A,_,B,D);if(A===429)return new xM(A,_,B,D);if(A>=500)return new SM(A,_,B,D);return new Bw(A,_,B,D)}};Vw=class Vw extends Bw{constructor({message:A}={}){super(void 0,void 0,A||"Request was aborted.",void 0)}};nz=class nz extends Bw{constructor({message:A,cause:Q}){super(void 0,void 0,A||"Connection error.",void 0);if(Q)this.cause=Q}};az=class az extends nz{constructor({message:A}={}){super({message:A??"Request timed out."})}};PM=class PM extends Bw{};TM=class TM extends Bw{};jM=class jM extends Bw{};yM=class yM extends Bw{};vM=class vM extends Bw{};kM=class kM extends Bw{};xM=class xM extends Bw{};SM=class SM extends Bw{};bM=class bM extends MB{constructor(){super("Could not parse response content as the length limit was reached")}};uM=class uM extends MB{constructor(){super("Could not parse response content as the request was rejected by the content filter")}};WF=class WF extends Error{constructor(A){super(A)}}});var Q9=d(()=>{P5()});function TZA(A,Q){let B={...A};return Object.defineProperties(B,{$brand:{value:"auto-parseable-response-format",enumerable:!1},$parseRaw:{value:Q,enumerable:!1}}),B}function hM(A){return A?.$brand==="auto-parseable-response-format"}function oz(A){return A?.$brand==="auto-parseable-tool"}function jZA(A,Q){if(!Q||!Po(Q))return{...A,choices:A.choices.map((B)=>({...B,message:{...B.message,parsed:null,...B.message.tool_calls?{tool_calls:B.message.tool_calls}:void 0}}))};return mM(A,Q)}function mM(A,Q){let B=A.choices.map((D)=>{if(D.finish_reason==="length")throw new bM;if(D.finish_reason==="content_filter")throw new uM;return{...D,message:{...D.message,...D.message.tool_calls?{tool_calls:D.message.tool_calls?.map((_)=>fc0(Q,_))??void 0}:void 0,parsed:D.message.content&&!D.message.refusal?Lc0(Q,D.message.content):null}}});return{...A,choices:B}}function Lc0(A,Q){if(A.response_format?.type!=="json_schema")return null;if(A.response_format?.type==="json_schema"){if("$parseRaw"in A.response_format)return A.response_format.$parseRaw(Q);return JSON.parse(Q)}return null}function fc0(A,Q){let B=A.tools?.find((D)=>D.function?.name===Q.function.name);return{...Q,function:{...Q.function,parsed_arguments:oz(B)?B.$parseRaw(Q.function.arguments):B?.function.strict?JSON.parse(Q.function.arguments):null}}}function yZA(A,Q){if(!A)return!1;let B=A.tools?.find((D)=>D.function?.name===Q.function.name);return oz(B)||B?.function.strict||!1}function Po(A){if(hM(A.response_format))return!0;return A.tools?.some((Q)=>oz(Q)||Q.type==="function"&&Q.function.strict===!0)??!1}function vZA(A){for(let Q of A??[]){if(Q.type!=="function")throw new MB(`Currently only \`function\` tool types support auto-parsing; Received \`${Q.type}\``);if(Q.function.strict!==!0)throw new MB(`The \`${Q.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`)}}var zK=d(()=>{Q9()});var xZA,kZA,SZA=(A)=>{return typeof A==="string"?{...kZA,basePath:["#"],definitions:{},name:A}:{...kZA,basePath:["#"],definitions:{},...A}};var wy=d(()=>{xZA=Symbol("Let zodToJsonSchema decide on which parser to use"),kZA={name:void 0,$refStrategy:"root",effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",nullableStrategy:"from-target",removeAdditionalStrategy:"passthrough",definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"}});function bZA(A){if(!A)return!0;for(let Q in A)return!1;return!0}var cM=(A)=>{return"_def"in A?A._def:A};var uZA=(A)=>{let Q=SZA(A),B=Q.name!==void 0?[...Q.basePath,Q.definitionPath,Q.name]:Q.basePath;return{...Q,currentPath:B,propertyPath:void 0,seenRefs:new Set,seen:new Map(Object.entries(Q.definitions).map(([D,_])=>[cM(_),{def:cM(_),path:[...Q.basePath,Q.definitionPath,D],jsonSchema:void 0}]))}};var To=d(()=>{wy()});function jo(A,Q,B,D){if(!D?.errorMessages)return;if(B)A.errorMessage={...A.errorMessage,[Q]:B}}function w1(A,Q,B,D,_){A[Q]=B,jo(A,Q,D,_)}var cD,yo,rQ,T5=(A)=>{switch(typeof A){case"undefined":return rQ.undefined;case"string":return rQ.string;case"number":return Number.isNaN(A)?rQ.nan:rQ.number;case"boolean":return rQ.boolean;case"function":return rQ.function;case"bigint":return rQ.bigint;case"symbol":return rQ.symbol;case"object":if(Array.isArray(A))return rQ.array;if(A===null)return rQ.null;if(A.then&&typeof A.then==="function"&&A.catch&&typeof A.catch==="function")return rQ.promise;if(typeof Map!=="undefined"&&A instanceof Map)return rQ.map;if(typeof Set!=="undefined"&&A instanceof Set)return rQ.set;if(typeof Date!=="undefined"&&A instanceof Date)return rQ.date;return rQ.object;default:return rQ.unknown}};var iM=d(()=>{(function(A){A.assertEqual=(_)=>{};function Q(_){}A.assertIs=Q;function B(_){throw new Error}A.assertNever=B,A.arrayToEnum=(_)=>{let w={};for(let G of _)w[G]=G;return w},A.getValidEnumValues=(_)=>{let w=A.objectKeys(_).filter((C)=>typeof _[_[C]]!=="number"),G={};for(let C of w)G[C]=_[C];return A.objectValues(G)},A.objectValues=(_)=>{return A.objectKeys(_).map(function(w){return _[w]})},A.objectKeys=typeof Object.keys==="function"?(_)=>Object.keys(_):(_)=>{let w=[];for(let G in _)if(Object.prototype.hasOwnProperty.call(_,G))w.push(G);return w},A.find=(_,w)=>{for(let G of _)if(w(G))return G;return},A.isInteger=typeof Number.isInteger==="function"?(_)=>Number.isInteger(_):(_)=>typeof _==="number"&&Number.isFinite(_)&&Math.floor(_)===_;function D(_,w=" | "){return _.map((G)=>typeof G==="string"?`'${G}'`:G).join(w)}A.joinValues=D,A.jsonStringifyReplacer=(_,w)=>{if(typeof w==="bigint")return w.toString();return w}})(cD||(cD={}));(function(A){A.mergeShapes=(Q,B)=>{return{...Q,...B}}})(yo||(yo={}));rQ=cD.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var jQ,Oc0=(A)=>{return JSON.stringify(A,null,2).replace(/"([^"]+)":/g,"$1:")},_4;var Cy=d(()=>{iM();jQ=cD.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);_4=class _4 extends Error{get errors(){return this.issues}constructor(A){super();this.issues=[],this.addIssue=(B)=>{this.issues=[...this.issues,B]},this.addIssues=(B=[])=>{this.issues=[...this.issues,...B]};let Q=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,Q);else this.__proto__=Q;this.name="ZodError",this.issues=A}format(A){let Q=A||function(_){return _.message},B={_errors:[]},D=(_)=>{for(let w of _.issues)if(w.code==="invalid_union")w.unionErrors.map(D);else if(w.code==="invalid_return_type")D(w.returnTypeError);else if(w.code==="invalid_arguments")D(w.argumentsError);else if(w.path.length===0)B._errors.push(Q(w));else{let G=B,C=0;while(C<w.path.length){let J=w.path[C];if(C!==w.path.length-1)G[J]=G[J]||{_errors:[]};else G[J]=G[J]||{_errors:[]},G[J]._errors.push(Q(w));G=G[J],C++}}};return D(this),B}static assert(A){if(!(A instanceof _4))throw new Error(`Not a ZodError: ${A}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,cD.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(A=(Q)=>Q.message){let Q={},B=[];for(let D of this.issues)if(D.path.length>0){let _=D.path[0];Q[_]=Q[_]||[],Q[_].push(A(D))}else B.push(A(D));return{formErrors:B,fieldErrors:Q}}get formErrors(){return this.flatten()}};_4.create=(A)=>{return new _4(A)}});var gc0=(A,Q)=>{let B;switch(A.code){case jQ.invalid_type:if(A.received===rQ.undefined)B="Required";else B=`Expected ${A.expected}, received ${A.received}`;break;case jQ.invalid_literal:B=`Invalid literal value, expected ${JSON.stringify(A.expected,cD.jsonStringifyReplacer)}`;break;case jQ.unrecognized_keys:B=`Unrecognized key(s) in object: ${cD.joinValues(A.keys,", ")}`;break;case jQ.invalid_union:B="Invalid input";break;case jQ.invalid_union_discriminator:B=`Invalid discriminator value. Expected ${cD.joinValues(A.options)}`;break;case jQ.invalid_enum_value:B=`Invalid enum value. Expected ${cD.joinValues(A.options)}, received '${A.received}'`;break;case jQ.invalid_arguments:B="Invalid function arguments";break;case jQ.invalid_return_type:B="Invalid function return type";break;case jQ.invalid_date:B="Invalid date";break;case jQ.invalid_string:if(typeof A.validation==="object")if("includes"in A.validation){if(B=`Invalid input: must include "${A.validation.includes}"`,typeof A.validation.position==="number")B=`${B} at one or more positions greater than or equal to ${A.validation.position}`}else if("startsWith"in A.validation)B=`Invalid input: must start with "${A.validation.startsWith}"`;else if("endsWith"in A.validation)B=`Invalid input: must end with "${A.validation.endsWith}"`;else cD.assertNever(A.validation);else if(A.validation!=="regex")B=`Invalid ${A.validation}`;else B="Invalid";break;case jQ.too_small:if(A.type==="array")B=`Array must contain ${A.exact?"exactly":A.inclusive?"at least":"more than"} ${A.minimum} element(s)`;else if(A.type==="string")B=`String must contain ${A.exact?"exactly":A.inclusive?"at least":"over"} ${A.minimum} character(s)`;else if(A.type==="number")B=`Number must be ${A.exact?"exactly equal to ":A.inclusive?"greater than or equal to ":"greater than "}${A.minimum}`;else if(A.type==="bigint")B=`Number must be ${A.exact?"exactly equal to ":A.inclusive?"greater than or equal to ":"greater than "}${A.minimum}`;else if(A.type==="date")B=`Date must be ${A.exact?"exactly equal to ":A.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(A.minimum))}`;else B="Invalid input";break;case jQ.too_big:if(A.type==="array")B=`Array must contain ${A.exact?"exactly":A.inclusive?"at most":"less than"} ${A.maximum} element(s)`;else if(A.type==="string")B=`String must contain ${A.exact?"exactly":A.inclusive?"at most":"under"} ${A.maximum} character(s)`;else if(A.type==="number")B=`Number must be ${A.exact?"exactly":A.inclusive?"less than or equal to":"less than"} ${A.maximum}`;else if(A.type==="bigint")B=`BigInt must be ${A.exact?"exactly":A.inclusive?"less than or equal to":"less than"} ${A.maximum}`;else if(A.type==="date")B=`Date must be ${A.exact?"exactly":A.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(A.maximum))}`;else B="Invalid input";break;case jQ.custom:B="Invalid input";break;case jQ.invalid_intersection_types:B="Intersection results could not be merged";break;case jQ.not_multiple_of:B=`Number must be a multiple of ${A.multipleOf}`;break;case jQ.not_finite:B="Number must be finite";break;default:B=Q.defaultError,cD.assertNever(A)}return{message:B}},UF;var vo=d(()=>{Cy();iM();UF=gc0});function Rc0(A){hZA=A}function YK(){return hZA}var hZA;var Gy=d(()=>{vo();hZA=UF});function _B(A,Q){let B=YK(),D=dM({issueData:Q,data:A.data,path:A.path,errorMaps:[A.common.contextualErrorMap,A.schemaErrorMap,B,B===UF?void 0:UF].filter((_)=>!!_)});A.common.issues.push(D)}class J6{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(A,Q){let B=[];for(let D of Q){if(D.status==="aborted")return oB;if(D.status==="dirty")A.dirty();B.push(D.value)}return{status:A.value,value:B}}static async mergeObjectAsync(A,Q){let B=[];for(let D of Q){let _=await D.key,w=await D.value;B.push({key:_,value:w})}return J6.mergeObjectSync(A,B)}static mergeObjectSync(A,Q){let B={};for(let D of Q){let{key:_,value:w}=D;if(_.status==="aborted")return oB;if(w.status==="aborted")return oB;if(_.status==="dirty")A.dirty();if(w.status==="dirty")A.dirty();if(_.value!=="__proto__"&&(typeof w.value!=="undefined"||D.alwaysSet))B[_.value]=w.value}return{status:A.value,value:B}}}var dM=(A)=>{let{data:Q,path:B,errorMaps:D,issueData:_}=A,w=[...B,..._.path||[]],G={..._,path:w};if(_.message!==void 0)return{..._,path:w,message:_.message};let C="",J=D.filter((I)=>!!I).slice().reverse();for(let I of J)C=I(G,{data:Q,defaultError:C}).message;return{..._,path:w,message:C}},Pc0,oB,rz=(A)=>({status:"dirty",value:A}),i6=(A)=>({status:"valid",value:A}),Fy=(A)=>A.status==="aborted",Jy=(A)=>A.status==="dirty",TE=(A)=>A.status==="valid",HK=(A)=>typeof Promise!=="undefined"&&A instanceof Promise;var ko=d(()=>{Gy();vo();Pc0=[];oB=Object.freeze({status:"aborted"})});var mZA=()=>{};var gB;var cZA=d(()=>{(function(A){A.errToObj=(Q)=>typeof Q==="string"?{message:Q}:Q||{},A.toString=(Q)=>typeof Q==="string"?Q:Q?.message})(gB||(gB={}))});class _9{constructor(A,Q,B,D){this._cachedPath=[],this.parent=A,this.data=Q,this._path=B,this._key=D}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}function UD(A){if(!A)return{};let{errorMap:Q,invalid_type_error:B,required_error:D,description:_}=A;if(Q&&(B||D))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(Q)return{errorMap:Q,description:_};return{errorMap:(G,C)=>{let{message:J}=A;if(G.code==="invalid_enum_value")return{message:J??C.defaultError};if(typeof C.data==="undefined")return{message:J??D??C.defaultError};if(G.code!=="invalid_type")return{message:C.defaultError};return{message:J??B??C.defaultError}},description:_}}class vD{get description(){return this._def.description}_getType(A){return T5(A.data)}_getOrReturnCtx(A,Q){return Q||{common:A.parent.common,data:A.data,parsedType:T5(A.data),schemaErrorMap:this._def.errorMap,path:A.path,parent:A.parent}}_processInputParams(A){return{status:new J6,ctx:{common:A.parent.common,data:A.data,parsedType:T5(A.data),schemaErrorMap:this._def.errorMap,path:A.path,parent:A.parent}}}_parseSync(A){let Q=this._parse(A);if(HK(Q))throw new Error("Synchronous parse encountered promise.");return Q}_parseAsync(A){let Q=this._parse(A);return Promise.resolve(Q)}parse(A,Q){let B=this.safeParse(A,Q);if(B.success)return B.data;throw B.error}safeParse(A,Q){let B={common:{issues:[],async:Q?.async??!1,contextualErrorMap:Q?.errorMap},path:Q?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:A,parsedType:T5(A)},D=this._parseSync({data:A,path:B.path,parent:B});return iZA(B,D)}"~validate"(A){let Q={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:A,parsedType:T5(A)};if(!this["~standard"].async)try{let B=this._parseSync({data:A,path:[],parent:Q});return TE(B)?{value:B.value}:{issues:Q.common.issues}}catch(B){if(B?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;Q.common={issues:[],async:!0}}return this._parseAsync({data:A,path:[],parent:Q}).then((B)=>TE(B)?{value:B.value}:{issues:Q.common.issues})}async parseAsync(A,Q){let B=await this.safeParseAsync(A,Q);if(B.success)return B.data;throw B.error}async safeParseAsync(A,Q){let B={common:{issues:[],contextualErrorMap:Q?.errorMap,async:!0},path:Q?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:A,parsedType:T5(A)},D=this._parse({data:A,path:B.path,parent:B}),_=await(HK(D)?D:Promise.resolve(D));return iZA(B,_)}refine(A,Q){let B=(D)=>{if(typeof Q==="string"||typeof Q==="undefined")return{message:Q};else if(typeof Q==="function")return Q(D);else return Q};return this._refinement((D,_)=>{let w=A(D),G=()=>_.addIssue({code:jQ.custom,...B(D)});if(typeof Promise!=="undefined"&&w instanceof Promise)return w.then((C)=>{if(!C)return G(),!1;else return!0});if(!w)return G(),!1;else return!0})}refinement(A,Q){return this._refinement((B,D)=>{if(!A(B))return D.addIssue(typeof Q==="function"?Q(B,D):Q),!1;else return!0})}_refinement(A){return new w9({schema:this,typeName:DQ.ZodEffects,effect:{type:"refinement",refinement:A}})}superRefine(A){return this._refinement(A)}constructor(A){this.spa=this.safeParseAsync,this._def=A,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(Q)=>this["~validate"](Q)}}optional(){return u4.create(this,this._def)}nullable(){return VF.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return D9.create(this)}promise(){return AY.create(this,this._def)}or(A){return $K.create([this,A],this._def)}and(A){return VK.create(this,A,this._def)}transform(A){return new w9({...UD(this._def),schema:this,typeName:DQ.ZodEffects,effect:{type:"transform",transform:A}})}default(A){let Q=typeof A==="function"?A:()=>A;return new fK({...UD(this._def),innerType:this,defaultValue:Q,typeName:DQ.ZodDefault})}brand(){return new Iy({typeName:DQ.ZodBranded,type:this,...UD(this._def)})}catch(A){let Q=typeof A==="function"?A:()=>A;return new OK({...UD(this._def),innerType:this,catchValue:Q,typeName:DQ.ZodCatch})}describe(A){return new this.constructor({...this._def,description:A})}pipe(A){return rM.create(this,A)}readonly(){return gK.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function pZA(A){let Q="[0-5]\\d";if(A.precision)Q=`${Q}\\.\\d{${A.precision}}`;else if(A.precision==null)Q=`${Q}(\\.\\d+)?`;let B=A.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${Q})${B}`}function nc0(A){return new RegExp(`^${pZA(A)}$`)}function nZA(A){let Q=`${lZA}T${pZA(A)}`,B=[];if(B.push(A.local?"Z?":"Z"),A.offset)B.push("([+-]\\d{2}:?\\d{2})");return Q=`${Q}(${B.join("|")})`,new RegExp(`^${Q}$`)}function ac0(A,Q){if((Q==="v4"||!Q)&&hc0.test(A))return!0;if((Q==="v6"||!Q)&&cc0.test(A))return!0;return!1}function oc0(A,Q){if(!xc0.test(A))return!1;try{let[B]=A.split(".");if(!B)return!1;let D=B.replace(/-/g,"+").replace(/_/g,"/").padEnd(B.length+(4-B.length%4)%4,"="),_=JSON.parse(atob(D));if(typeof _!=="object"||_===null)return!1;if("typ"in _&&_?.typ!=="JWT")return!1;if(!_.alg)return!1;if(Q&&_.alg!==Q)return!1;return!0}catch{return!1}}function rc0(A,Q){if((Q==="v4"||!Q)&&mc0.test(A))return!0;if((Q==="v6"||!Q)&&ic0.test(A))return!0;return!1}function sc0(A,Q){let B=(A.toString().split(".")[1]||"").length,D=(Q.toString().split(".")[1]||"").length,_=B>D?B:D,w=Number.parseInt(A.toFixed(_).replace(".","")),G=Number.parseInt(Q.toFixed(_).replace(".",""));return w%G/10**_}function ZK(A){if(A instanceof F8){let Q={};for(let B in A.shape){let D=A.shape[B];Q[B]=u4.create(ZK(D))}return new F8({...A._def,shape:()=>Q})}else if(A instanceof D9)return new D9({...A._def,type:ZK(A.element)});else if(A instanceof u4)return u4.create(ZK(A.unwrap()));else if(A instanceof VF)return VF.create(ZK(A.unwrap()));else if(A instanceof y5)return y5.create(A.items.map((Q)=>ZK(Q)));else return A}function So(A,Q){let B=T5(A),D=T5(Q);if(A===Q)return{valid:!0,data:A};else if(B===rQ.object&&D===rQ.object){let _=cD.objectKeys(Q),w=cD.objectKeys(A).filter((C)=>_.indexOf(C)!==-1),G={...A,...Q};for(let C of w){let J=So(A[C],Q[C]);if(!J.valid)return{valid:!1};G[C]=J.data}return{valid:!0,data:G}}else if(B===rQ.array&&D===rQ.array){if(A.length!==Q.length)return{valid:!1};let _=[];for(let w=0;w<A.length;w++){let G=A[w],C=Q[w],J=So(G,C);if(!J.valid)return{valid:!1};_.push(J.data)}return{valid:!0,data:_}}else if(B===rQ.date&&D===rQ.date&&+A===+Q)return{valid:!0,data:A};else return{valid:!1}}function aZA(A,Q){return new kE({values:A,typeName:DQ.ZodEnum,...UD(Q)})}function dZA(A,Q){let B=typeof A==="function"?A(Q):typeof A==="string"?{message:A}:A;return typeof B==="string"?{message:B}:B}function oZA(A,Q={},B){if(A)return tz.create().superRefine((D,_)=>{let w=A(D);if(w instanceof Promise)return w.then((G)=>{if(!G){let C=dZA(Q,D),J=C.fatal??B??!0;_.addIssue({code:"custom",...C,fatal:J})}});if(!w){let G=dZA(Q,D),C=G.fatal??B??!0;_.addIssue({code:"custom",...G,fatal:C})}return});return tz.create()}var iZA=(A,Q)=>{if(TE(Q))return{success:!0,data:Q.value};else{if(!A.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let B=new _4(A.common.issues);return this._error=B,this._error}}}},Tc0,jc0,yc0,vc0,kc0,xc0,Sc0,bc0,uc0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",xo,hc0,mc0,cc0,ic0,dc0,lc0,lZA="((\\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])))",pc0,B9,yE,vE,qK,sz,lM,WK,UK,tz,jE,j5,pM,D9,F8,$K,$F=(A)=>{if(A instanceof MK)return $F(A.schema);else if(A instanceof w9)return $F(A.innerType());else if(A instanceof NK)return[A.value];else if(A instanceof kE)return A.options;else if(A instanceof LK)return cD.objectValues(A.enum);else if(A instanceof fK)return $F(A._def.innerType);else if(A instanceof WK)return[void 0];else if(A instanceof UK)return[null];else if(A instanceof u4)return[void 0,...$F(A.unwrap())];else if(A instanceof VF)return[null,...$F(A.unwrap())];else if(A instanceof Iy)return $F(A.unwrap());else if(A instanceof gK)return $F(A.unwrap());else if(A instanceof OK)return $F(A._def.innerType);else return[]},Ey,VK,y5,nM,aM,ez,KK,MK,NK,kE,LK,AY,w9,u4,VF,fK,OK,oM,tc0,Iy,rM,gK,ec0,DQ,Ai0=(A,Q={message:`Input not instance of ${A.name}`})=>oZA((B)=>B instanceof A,Q),rZA,sZA,Qi0,Bi0,tZA,Di0,_i0,wi0,Ci0,Gi0,Fi0,Ji0,Ei0,Ii0,Xi0,zi0,Yi0,Hi0,Zi0,Ki0,qi0,Wi0,Ui0,$i0,Vi0,Mi0,Ni0,Li0,fi0,Oi0,gi0,Ri0,Pi0,Ti0,ji0=()=>rZA().optional(),yi0=()=>sZA().optional(),vi0=()=>tZA().optional(),ki0,xi0;var eZA=d(()=>{Cy();Gy();cZA();ko();iM();Tc0=/^c[^\s-]{8,}$/i,jc0=/^[0-9a-z]+$/,yc0=/^[0-9A-HJKMNP-TV-Z]{26}$/i,vc0=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,kc0=/^[a-z0-9_-]{21}$/i,xc0=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Sc0=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,bc0=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,hc0=/^(?:(?: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])$/,mc0=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,cc0=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ic0=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,dc0=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,lc0=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,pc0=new RegExp(`^${lZA}$`);B9=class B9 extends vD{_parse(A){if(this._def.coerce)A.data=String(A.data);if(this._getType(A)!==rQ.string){let _=this._getOrReturnCtx(A);return _B(_,{code:jQ.invalid_type,expected:rQ.string,received:_.parsedType}),oB}let B=new J6,D=void 0;for(let _ of this._def.checks)if(_.kind==="min"){if(A.data.length<_.value)D=this._getOrReturnCtx(A,D),_B(D,{code:jQ.too_small,minimum:_.value,type:"string",inclusive:!0,exact:!1,message:_.message}),B.dirty()}else if(_.kind==="max"){if(A.data.length>_.value)D=this._getOrReturnCtx(A,D),_B(D,{code:jQ.too_big,maximum:_.value,type:"string",inclusive:!0,exact:!1,message:_.message}),B.dirty()}else if(_.kind==="length"){let w=A.data.length>_.value,G=A.data.length<_.value;if(w||G){if(D=this._getOrReturnCtx(A,D),w)_B(D,{code:jQ.too_big,maximum:_.value,type:"string",inclusive:!0,exact:!0,message:_.message});else if(G)_B(D,{code:jQ.too_small,minimum:_.value,type:"string",inclusive:!0,exact:!0,message:_.message});B.dirty()}}else if(_.kind==="email"){if(!bc0.test(A.data))D=this._getOrReturnCtx(A,D),_B(D,{validation:"email",code:jQ.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="emoji"){if(!xo)xo=new RegExp(uc0,"u");if(!xo.test(A.data))D=this._getOrReturnCtx(A,D),_B(D,{validation:"emoji",code:jQ.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="uuid"){if(!vc0.test(A.data))D=this._getOrReturnCtx(A,D),_B(D,{validation:"uuid",code:jQ.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="nanoid"){if(!kc0.test(A.data))D=this._getOrReturnCtx(A,D),_B(D,{validation:"nanoid",code:jQ.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="cuid"){if(!Tc0.test(A.data))D=this._getOrReturnCtx(A,D),_B(D,{validation:"cuid",code:jQ.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="cuid2"){if(!jc0.test(A.data))D=this._getOrReturnCtx(A,D),_B(D,{validation:"cuid2",code:jQ.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="ulid"){if(!yc0.test(A.data))D=this._getOrReturnCtx(A,D),_B(D,{validation:"ulid",code:jQ.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="url")try{new URL(A.data)}catch{D=this._getOrReturnCtx(A,D),_B(D,{validation:"url",code:jQ.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="regex"){if(_.regex.lastIndex=0,!_.regex.test(A.data))D=this._getOrReturnCtx(A,D),_B(D,{validation:"regex",code:jQ.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="trim")A.data=A.data.trim();else if(_.kind==="includes"){if(!A.data.includes(_.value,_.position))D=this._getOrReturnCtx(A,D),_B(D,{code:jQ.invalid_string,validation:{includes:_.value,position:_.position},message:_.message}),B.dirty()}else if(_.kind==="toLowerCase")A.data=A.data.toLowerCase();else if(_.kind==="toUpperCase")A.data=A.data.toUpperCase();else if(_.kind==="startsWith"){if(!A.data.startsWith(_.value))D=this._getOrReturnCtx(A,D),_B(D,{code:jQ.invalid_string,validation:{startsWith:_.value},message:_.message}),B.dirty()}else if(_.kind==="endsWith"){if(!A.data.endsWith(_.value))D=this._getOrReturnCtx(A,D),_B(D,{code:jQ.invalid_string,validation:{endsWith:_.value},message:_.message}),B.dirty()}else if(_.kind==="datetime"){if(!nZA(_).test(A.data))D=this._getOrReturnCtx(A,D),_B(D,{code:jQ.invalid_string,validation:"datetime",message:_.message}),B.dirty()}else if(_.kind==="date"){if(!pc0.test(A.data))D=this._getOrReturnCtx(A,D),_B(D,{code:jQ.invalid_string,validation:"date",message:_.message}),B.dirty()}else if(_.kind==="time"){if(!nc0(_).test(A.data))D=this._getOrReturnCtx(A,D),_B(D,{code:jQ.invalid_string,validation:"time",message:_.message}),B.dirty()}else if(_.kind==="duration"){if(!Sc0.test(A.data))D=this._getOrReturnCtx(A,D),_B(D,{validation:"duration",code:jQ.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="ip"){if(!ac0(A.data,_.version))D=this._getOrReturnCtx(A,D),_B(D,{validation:"ip",code:jQ.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="jwt"){if(!oc0(A.data,_.alg))D=this._getOrReturnCtx(A,D),_B(D,{validation:"jwt",code:jQ.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="cidr"){if(!rc0(A.data,_.version))D=this._getOrReturnCtx(A,D),_B(D,{validation:"cidr",code:jQ.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="base64"){if(!dc0.test(A.data))D=this._getOrReturnCtx(A,D),_B(D,{validation:"base64",code:jQ.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="base64url"){if(!lc0.test(A.data))D=this._getOrReturnCtx(A,D),_B(D,{validation:"base64url",code:jQ.invalid_string,message:_.message}),B.dirty()}else cD.assertNever(_);return{status:B.value,value:A.data}}_regex(A,Q,B){return this.refinement((D)=>A.test(D),{validation:Q,code:jQ.invalid_string,...gB.errToObj(B)})}_addCheck(A){return new B9({...this._def,checks:[...this._def.checks,A]})}email(A){return this._addCheck({kind:"email",...gB.errToObj(A)})}url(A){return this._addCheck({kind:"url",...gB.errToObj(A)})}emoji(A){return this._addCheck({kind:"emoji",...gB.errToObj(A)})}uuid(A){return this._addCheck({kind:"uuid",...gB.errToObj(A)})}nanoid(A){return this._addCheck({kind:"nanoid",...gB.errToObj(A)})}cuid(A){return this._addCheck({kind:"cuid",...gB.errToObj(A)})}cuid2(A){return this._addCheck({kind:"cuid2",...gB.errToObj(A)})}ulid(A){return this._addCheck({kind:"ulid",...gB.errToObj(A)})}base64(A){return this._addCheck({kind:"base64",...gB.errToObj(A)})}base64url(A){return this._addCheck({kind:"base64url",...gB.errToObj(A)})}jwt(A){return this._addCheck({kind:"jwt",...gB.errToObj(A)})}ip(A){return this._addCheck({kind:"ip",...gB.errToObj(A)})}cidr(A){return this._addCheck({kind:"cidr",...gB.errToObj(A)})}datetime(A){if(typeof A==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:A});return this._addCheck({kind:"datetime",precision:typeof A?.precision==="undefined"?null:A?.precision,offset:A?.offset??!1,local:A?.local??!1,...gB.errToObj(A?.message)})}date(A){return this._addCheck({kind:"date",message:A})}time(A){if(typeof A==="string")return this._addCheck({kind:"time",precision:null,message:A});return this._addCheck({kind:"time",precision:typeof A?.precision==="undefined"?null:A?.precision,...gB.errToObj(A?.message)})}duration(A){return this._addCheck({kind:"duration",...gB.errToObj(A)})}regex(A,Q){return this._addCheck({kind:"regex",regex:A,...gB.errToObj(Q)})}includes(A,Q){return this._addCheck({kind:"includes",value:A,position:Q?.position,...gB.errToObj(Q?.message)})}startsWith(A,Q){return this._addCheck({kind:"startsWith",value:A,...gB.errToObj(Q)})}endsWith(A,Q){return this._addCheck({kind:"endsWith",value:A,...gB.errToObj(Q)})}min(A,Q){return this._addCheck({kind:"min",value:A,...gB.errToObj(Q)})}max(A,Q){return this._addCheck({kind:"max",value:A,...gB.errToObj(Q)})}length(A,Q){return this._addCheck({kind:"length",value:A,...gB.errToObj(Q)})}nonempty(A){return this.min(1,gB.errToObj(A))}trim(){return new B9({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new B9({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new B9({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((A)=>A.kind==="datetime")}get isDate(){return!!this._def.checks.find((A)=>A.kind==="date")}get isTime(){return!!this._def.checks.find((A)=>A.kind==="time")}get isDuration(){return!!this._def.checks.find((A)=>A.kind==="duration")}get isEmail(){return!!this._def.checks.find((A)=>A.kind==="email")}get isURL(){return!!this._def.checks.find((A)=>A.kind==="url")}get isEmoji(){return!!this._def.checks.find((A)=>A.kind==="emoji")}get isUUID(){return!!this._def.checks.find((A)=>A.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((A)=>A.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((A)=>A.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((A)=>A.kind==="cuid2")}get isULID(){return!!this._def.checks.find((A)=>A.kind==="ulid")}get isIP(){return!!this._def.checks.find((A)=>A.kind==="ip")}get isCIDR(){return!!this._def.checks.find((A)=>A.kind==="cidr")}get isBase64(){return!!this._def.checks.find((A)=>A.kind==="base64")}get isBase64url(){return!!this._def.checks.find((A)=>A.kind==="base64url")}get minLength(){let A=null;for(let Q of this._def.checks)if(Q.kind==="min"){if(A===null||Q.value>A)A=Q.value}return A}get maxLength(){let A=null;for(let Q of this._def.checks)if(Q.kind==="max"){if(A===null||Q.value<A)A=Q.value}return A}};B9.create=(A)=>{return new B9({checks:[],typeName:DQ.ZodString,coerce:A?.coerce??!1,...UD(A)})};yE=class yE extends vD{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(A){if(this._def.coerce)A.data=Number(A.data);if(this._getType(A)!==rQ.number){let _=this._getOrReturnCtx(A);return _B(_,{code:jQ.invalid_type,expected:rQ.number,received:_.parsedType}),oB}let B=void 0,D=new J6;for(let _ of this._def.checks)if(_.kind==="int"){if(!cD.isInteger(A.data))B=this._getOrReturnCtx(A,B),_B(B,{code:jQ.invalid_type,expected:"integer",received:"float",message:_.message}),D.dirty()}else if(_.kind==="min"){if(_.inclusive?A.data<_.value:A.data<=_.value)B=this._getOrReturnCtx(A,B),_B(B,{code:jQ.too_small,minimum:_.value,type:"number",inclusive:_.inclusive,exact:!1,message:_.message}),D.dirty()}else if(_.kind==="max"){if(_.inclusive?A.data>_.value:A.data>=_.value)B=this._getOrReturnCtx(A,B),_B(B,{code:jQ.too_big,maximum:_.value,type:"number",inclusive:_.inclusive,exact:!1,message:_.message}),D.dirty()}else if(_.kind==="multipleOf"){if(sc0(A.data,_.value)!==0)B=this._getOrReturnCtx(A,B),_B(B,{code:jQ.not_multiple_of,multipleOf:_.value,message:_.message}),D.dirty()}else if(_.kind==="finite"){if(!Number.isFinite(A.data))B=this._getOrReturnCtx(A,B),_B(B,{code:jQ.not_finite,message:_.message}),D.dirty()}else cD.assertNever(_);return{status:D.value,value:A.data}}gte(A,Q){return this.setLimit("min",A,!0,gB.toString(Q))}gt(A,Q){return this.setLimit("min",A,!1,gB.toString(Q))}lte(A,Q){return this.setLimit("max",A,!0,gB.toString(Q))}lt(A,Q){return this.setLimit("max",A,!1,gB.toString(Q))}setLimit(A,Q,B,D){return new yE({...this._def,checks:[...this._def.checks,{kind:A,value:Q,inclusive:B,message:gB.toString(D)}]})}_addCheck(A){return new yE({...this._def,checks:[...this._def.checks,A]})}int(A){return this._addCheck({kind:"int",message:gB.toString(A)})}positive(A){return this._addCheck({kind:"min",value:0,inclusive:!1,message:gB.toString(A)})}negative(A){return this._addChe