@seed-design/codemod 0.0.12-rc.3 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/index.mjs CHANGED
@@ -1,16 +1,73 @@
1
1
  #!/usr/bin/env node
2
- import{cac as O}from"cac";import{execaNode as P}from"execa";import{readdirSync as I}from"fs";import{createRequire as G}from"module";import{dirname as S,resolve as f}from"path";import{minVersion as C,satisfies as N}from"semver";import{z as s}from"zod";var u=s.object({list:s.boolean().optional(),log:s.boolean().optional(),track:s.boolean(),reporter:s.boolean().optional(),parser:s.enum(["babel","babylon","flow","ts","tsx"]).optional(),extensions:s.string().optional(),ignoreConfig:s.string().optional()});import{simpleGit as y}from"simple-git";async function b(){let o=y();try{let{current:e}=await o.branchLocal(),r=(await o.getRemotes(!0)).map(({name:t,refs:{fetch:a}})=>({name:t,url:a})),n=r.find(({name:t})=>t==="origin")??r[0];return{possibleRepositoryName:n?n.url.split("/").slice(-2).join("/").replace(/\.git$/,""):(await o.revparse(["--show-toplevel"])).split("/").pop(),branch:e,remotes:r}}catch{return null}}import R from"picocolors";var p=R.bold("@seed-design/codemod"),x=o=>({event:e,properties:r})=>console.log(p,e,r,o);var $=f(S(import.meta.filename),"transforms"),h=O(),v=G(import.meta.url),c=v("../package.json"),k=await b(),j=x({...k});z();h.version(c.version).help().command("[transformName] [...paths]","\uCF54\uB4DC \uBCC0\uD658 (codemod)").option("-l, --list","\uC0AC\uC6A9 \uAC00\uB2A5\uD55C transform \uBAA9\uB85D\uC744 \uBCF4\uC5EC\uC918\uC694").option("--log","\uB85C\uADF8\uB97C \uD30C\uC77C\uB85C \uC800\uC7A5\uD574\uC694").option("--no-track","\uC0AC\uC6A9 \uD1B5\uACC4\uB97C \uC218\uC9D1\uD558\uC9C0 \uC54A\uC544\uC694").option("-p, --parser <parser>","jscodeshift\uAC00 \uC0AC\uC6A9\uD560 \uD30C\uC11C\uB97C \uC9C0\uC815\uD574\uC694 (babel|babylon|flow|ts|tsx)",{default:"tsx"}).option("--reporter","\uBCC0\uD658 \uACB0\uACFC\uB97C \uD30C\uC77C\uB85C \uC800\uC7A5\uD574\uC694").option("--extensions <extensions>","\uBCC0\uD658\uD560 \uD30C\uC77C \uD655\uC7A5\uC790").option("--ignore-config <ignoreConfig>","Ignore config").example(" $ npx @seed-design/codemod migrate-icons src/ui").action(async(o,e,r)=>{let n=u.parse(r);n.track&&j?.({event:"\uC2E4\uD589",properties:{transformName:o,paths:e}});let i=F();n.list&&(l(i),process.exit(0)),o||(console.error("transform \uC774\uB984\uC744 \uC785\uB825\uD574\uC8FC\uC138\uC694"),l(i),process.exit(1)),i.includes(o)||(console.error(`\uC774\uB984\uC774 ${o}\uC778 transform\uC774 \uC5C6\uC5B4\uC694`),l(i),process.exit(1)),e.length===0&&(console.error("\uD30C\uC77C \uACBD\uB85C\uB97C \uC785\uB825\uD574\uC8FC\uC138\uC694"),process.exit(1));let t=f($,o,"index.mjs");console.log(p,`${e.join(", ")}\uC5D0 ${o} transform\uC744 \uC2E4\uD589\uD574\uC694.`),await A(t,e,n)});h.parse();function z(){N(process.versions.node,c.engines.node)===!1&&(console.error(`Node.js \uBC84\uC804 \uC694\uAD6C\uC0AC\uD56D\uC744 \uB9CC\uC871\uC2DC\uD0A4\uC9C0 \uC54A\uC544\uC694: "${c.engines.node}"
2
+ var cw=Object.create;var vc=Object.defineProperty;var uw=Object.getOwnPropertyDescriptor;var lw=Object.getOwnPropertyNames;var fw=Object.getPrototypeOf,dw=Object.prototype.hasOwnProperty;var pe=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var w=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var pw=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of lw(t))!dw.call(e,s)&&s!==r&&vc(e,s,{get:()=>t[s],enumerable:!(n=uw(t,s))||n.enumerable});return e};var gt=(e,t,r)=>(r=e!=null?cw(fw(e)):{},pw(t||!e||!e.__esModule?vc(r,"default",{value:e,enumerable:!0}):r,e));var ou=w((NL,su)=>{su.exports=nu;nu.sync=TS;var tu=pe("fs");function ES(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var s=r[n].toLowerCase();if(s&&e.substr(-s.length).toLowerCase()===s)return!0}return!1}function ru(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:ES(t,r)}function nu(e,t,r){tu.stat(e,function(n,s){r(n,n?!1:ru(s,e,t))})}function TS(e,t){return ru(tu.statSync(e),e,t)}});var lu=w((PL,uu)=>{uu.exports=au;au.sync=OS;var iu=pe("fs");function au(e,t,r){iu.stat(e,function(n,s){r(n,n?!1:cu(s,t))})}function OS(e,t){return cu(iu.statSync(e),t)}function cu(e,t){return e.isFile()&&RS(e,t)}function RS(e,t){var r=e.mode,n=e.uid,s=e.gid,o=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),i=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),u=parseInt("001",8),l=a|c,f=r&u||r&c&&s===i||r&a&&n===o||r&l&&o===0;return f}});var du=w((FL,fu)=>{var ML=pe("fs"),kn;process.platform==="win32"||global.TESTING_WINDOWS?kn=ou():kn=lu();fu.exports=$o;$o.sync=kS;function $o(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,s){$o(e,t||{},function(o,i){o?s(o):n(i)})})}kn(e,t||{},function(n,s){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,s=!1),r(n,s)})}function kS(e,t){try{return kn.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var wu=w((jL,bu)=>{var Yt=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",pu=pe("path"),CS=Yt?";":":",mu=du(),hu=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),gu=(e,t)=>{let r=t.colon||CS,n=e.match(/\//)||Yt&&e.match(/\\/)?[""]:[...Yt?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],s=Yt?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=Yt?s.split(r):[""];return Yt&&e.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:s}},yu=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:s,pathExtExe:o}=gu(e,t),i=[],a=u=>new Promise((l,f)=>{if(u===n.length)return t.all&&i.length?l(i):f(hu(e));let p=n[u],d=/^".*"$/.test(p)?p.slice(1,-1):p,b=pu.join(d,e),T=!d&&/^\.[\\\/]/.test(e)?e.slice(0,2)+b:b;l(c(T,u,0))}),c=(u,l,f)=>new Promise((p,d)=>{if(f===s.length)return p(a(l+1));let b=s[f];mu(u+b,{pathExt:o},(T,N)=>{if(!T&&N)if(t.all)i.push(u+b);else return p(u+b);return p(c(u,l,f+1))})});return r?a(0).then(u=>r(null,u),r):a(0)},AS=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:n,pathExtExe:s}=gu(e,t),o=[];for(let i=0;i<r.length;i++){let a=r[i],c=/^".*"$/.test(a)?a.slice(1,-1):a,u=pu.join(c,e),l=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let f=0;f<n.length;f++){let p=l+n[f];try{if(mu.sync(p,{pathExt:s}))if(t.all)o.push(p);else return p}catch{}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw hu(e)};bu.exports=yu;yu.sync=AS});var xu=w((BL,Do)=>{"use strict";var Su=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};Do.exports=Su;Do.exports.default=Su});var Tu=w((UL,Eu)=>{"use strict";var vu=pe("path"),IS=wu(),$S=xu();function _u(e,t){let r=e.options.env||process.env,n=process.cwd(),s=e.options.cwd!=null,o=s&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(e.options.cwd)}catch{}let i;try{i=IS.sync(e.command,{path:r[$S({env:r})],pathExt:t?vu.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return i&&(i=vu.resolve(s?e.options.cwd:"",i)),i}function DS(e){return _u(e)||_u(e,!0)}Eu.exports=DS});var Ou=w((GL,No)=>{"use strict";var Lo=/([()\][%!^"`<>&|;, *?])/g;function LS(e){return e=e.replace(Lo,"^$1"),e}function NS(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(Lo,"^$1"),t&&(e=e.replace(Lo,"^$1")),e}No.exports.command=LS;No.exports.argument=NS});var ku=w((qL,Ru)=>{"use strict";Ru.exports=/^#!(.*)/});var Au=w((VL,Cu)=>{"use strict";var PS=ku();Cu.exports=(e="")=>{let t=e.match(PS);if(!t)return null;let[r,n]=t[0].replace(/#! ?/,"").split(" "),s=r.split("/").pop();return s==="env"?n:n?`${s} ${n}`:s}});var $u=w((zL,Iu)=>{"use strict";var Po=pe("fs"),MS=Au();function FS(e){let r=Buffer.alloc(150),n;try{n=Po.openSync(e,"r"),Po.readSync(n,r,0,150,0),Po.closeSync(n)}catch{}return MS(r.toString())}Iu.exports=FS});var Pu=w((WL,Nu)=>{"use strict";var jS=pe("path"),Du=Tu(),Lu=Ou(),BS=$u(),US=process.platform==="win32",GS=/\.(?:com|exe)$/i,qS=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function VS(e){e.file=Du(e);let t=e.file&&BS(e.file);return t?(e.args.unshift(e.file),e.command=t,Du(e)):e.file}function zS(e){if(!US)return e;let t=VS(e),r=!GS.test(t);if(e.options.forceShell||r){let n=qS.test(t);e.command=jS.normalize(e.command),e.command=Lu.command(e.command),e.args=e.args.map(o=>Lu.argument(o,n));let s=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${s}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function WS(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let n={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?n:zS(n)}Nu.exports=WS});var ju=w((ZL,Fu)=>{"use strict";var Mo=process.platform==="win32";function Fo(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function ZS(e,t){if(!Mo)return;let r=e.emit;e.emit=function(n,s){if(n==="exit"){let o=Mu(s,t);if(o)return r.call(e,"error",o)}return r.apply(e,arguments)}}function Mu(e,t){return Mo&&e===1&&!t.file?Fo(t.original,"spawn"):null}function HS(e,t){return Mo&&e===1&&!t.file?Fo(t.original,"spawnSync"):null}Fu.exports={hookChildProcess:ZS,verifyENOENT:Mu,verifyENOENTSync:HS,notFoundError:Fo}});var Gu=w((HL,Xt)=>{"use strict";var Bu=pe("child_process"),jo=Pu(),Bo=ju();function Uu(e,t,r){let n=jo(e,t,r),s=Bu.spawn(n.command,n.args,n.options);return Bo.hookChildProcess(s,n),s}function YS(e,t,r){let n=jo(e,t,r),s=Bu.spawnSync(n.command,n.args,n.options);return s.error=s.error||Bo.verifyENOENTSync(s.status,n),s}Xt.exports=Uu;Xt.exports.spawn=Uu;Xt.exports.sync=YS;Xt.exports._parse=jo;Xt.exports._enoent=Bo});var Gr=w((Q9,Lp)=>{var XT="2.0.0",KT=Number.MAX_SAFE_INTEGER||9007199254740991,JT=16,QT=250,eO=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Lp.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:JT,MAX_SAFE_BUILD_LENGTH:QT,MAX_SAFE_INTEGER:KT,RELEASE_TYPES:eO,SEMVER_SPEC_VERSION:XT,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var qr=w((e3,Np)=>{var tO=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};Np.exports=tO});var ar=w((Ve,Pp)=>{var{MAX_SAFE_COMPONENT_LENGTH:Qi,MAX_SAFE_BUILD_LENGTH:rO,MAX_LENGTH:nO}=Gr(),sO=qr();Ve=Pp.exports={};var oO=Ve.re=[],iO=Ve.safeRe=[],x=Ve.src=[],aO=Ve.safeSrc=[],v=Ve.t={},cO=0,ea="[a-zA-Z0-9-]",uO=[["\\s",1],["\\d",nO],[ea,rO]],lO=e=>{for(let[t,r]of uO)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},A=(e,t,r)=>{let n=lO(t),s=cO++;sO(e,s,t),v[e]=s,x[s]=t,aO[s]=n,oO[s]=new RegExp(t,r?"g":void 0),iO[s]=new RegExp(n,r?"g":void 0)};A("NUMERICIDENTIFIER","0|[1-9]\\d*");A("NUMERICIDENTIFIERLOOSE","\\d+");A("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${ea}*`);A("MAINVERSION",`(${x[v.NUMERICIDENTIFIER]})\\.(${x[v.NUMERICIDENTIFIER]})\\.(${x[v.NUMERICIDENTIFIER]})`);A("MAINVERSIONLOOSE",`(${x[v.NUMERICIDENTIFIERLOOSE]})\\.(${x[v.NUMERICIDENTIFIERLOOSE]})\\.(${x[v.NUMERICIDENTIFIERLOOSE]})`);A("PRERELEASEIDENTIFIER",`(?:${x[v.NUMERICIDENTIFIER]}|${x[v.NONNUMERICIDENTIFIER]})`);A("PRERELEASEIDENTIFIERLOOSE",`(?:${x[v.NUMERICIDENTIFIERLOOSE]}|${x[v.NONNUMERICIDENTIFIER]})`);A("PRERELEASE",`(?:-(${x[v.PRERELEASEIDENTIFIER]}(?:\\.${x[v.PRERELEASEIDENTIFIER]})*))`);A("PRERELEASELOOSE",`(?:-?(${x[v.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${x[v.PRERELEASEIDENTIFIERLOOSE]})*))`);A("BUILDIDENTIFIER",`${ea}+`);A("BUILD",`(?:\\+(${x[v.BUILDIDENTIFIER]}(?:\\.${x[v.BUILDIDENTIFIER]})*))`);A("FULLPLAIN",`v?${x[v.MAINVERSION]}${x[v.PRERELEASE]}?${x[v.BUILD]}?`);A("FULL",`^${x[v.FULLPLAIN]}$`);A("LOOSEPLAIN",`[v=\\s]*${x[v.MAINVERSIONLOOSE]}${x[v.PRERELEASELOOSE]}?${x[v.BUILD]}?`);A("LOOSE",`^${x[v.LOOSEPLAIN]}$`);A("GTLT","((?:<|>)?=?)");A("XRANGEIDENTIFIERLOOSE",`${x[v.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);A("XRANGEIDENTIFIER",`${x[v.NUMERICIDENTIFIER]}|x|X|\\*`);A("XRANGEPLAIN",`[v=\\s]*(${x[v.XRANGEIDENTIFIER]})(?:\\.(${x[v.XRANGEIDENTIFIER]})(?:\\.(${x[v.XRANGEIDENTIFIER]})(?:${x[v.PRERELEASE]})?${x[v.BUILD]}?)?)?`);A("XRANGEPLAINLOOSE",`[v=\\s]*(${x[v.XRANGEIDENTIFIERLOOSE]})(?:\\.(${x[v.XRANGEIDENTIFIERLOOSE]})(?:\\.(${x[v.XRANGEIDENTIFIERLOOSE]})(?:${x[v.PRERELEASELOOSE]})?${x[v.BUILD]}?)?)?`);A("XRANGE",`^${x[v.GTLT]}\\s*${x[v.XRANGEPLAIN]}$`);A("XRANGELOOSE",`^${x[v.GTLT]}\\s*${x[v.XRANGEPLAINLOOSE]}$`);A("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Qi}})(?:\\.(\\d{1,${Qi}}))?(?:\\.(\\d{1,${Qi}}))?`);A("COERCE",`${x[v.COERCEPLAIN]}(?:$|[^\\d])`);A("COERCEFULL",x[v.COERCEPLAIN]+`(?:${x[v.PRERELEASE]})?(?:${x[v.BUILD]})?(?:$|[^\\d])`);A("COERCERTL",x[v.COERCE],!0);A("COERCERTLFULL",x[v.COERCEFULL],!0);A("LONETILDE","(?:~>?)");A("TILDETRIM",`(\\s*)${x[v.LONETILDE]}\\s+`,!0);Ve.tildeTrimReplace="$1~";A("TILDE",`^${x[v.LONETILDE]}${x[v.XRANGEPLAIN]}$`);A("TILDELOOSE",`^${x[v.LONETILDE]}${x[v.XRANGEPLAINLOOSE]}$`);A("LONECARET","(?:\\^)");A("CARETTRIM",`(\\s*)${x[v.LONECARET]}\\s+`,!0);Ve.caretTrimReplace="$1^";A("CARET",`^${x[v.LONECARET]}${x[v.XRANGEPLAIN]}$`);A("CARETLOOSE",`^${x[v.LONECARET]}${x[v.XRANGEPLAINLOOSE]}$`);A("COMPARATORLOOSE",`^${x[v.GTLT]}\\s*(${x[v.LOOSEPLAIN]})$|^$`);A("COMPARATOR",`^${x[v.GTLT]}\\s*(${x[v.FULLPLAIN]})$|^$`);A("COMPARATORTRIM",`(\\s*)${x[v.GTLT]}\\s*(${x[v.LOOSEPLAIN]}|${x[v.XRANGEPLAIN]})`,!0);Ve.comparatorTrimReplace="$1$2$3";A("HYPHENRANGE",`^\\s*(${x[v.XRANGEPLAIN]})\\s+-\\s+(${x[v.XRANGEPLAIN]})\\s*$`);A("HYPHENRANGELOOSE",`^\\s*(${x[v.XRANGEPLAINLOOSE]})\\s+-\\s+(${x[v.XRANGEPLAINLOOSE]})\\s*$`);A("STAR","(<|>)?=?\\s*\\*");A("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");A("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Es=w((t3,Mp)=>{var fO=Object.freeze({loose:!0}),dO=Object.freeze({}),pO=e=>e?typeof e!="object"?fO:e:dO;Mp.exports=pO});var ta=w((r3,Bp)=>{var Fp=/^[0-9]+$/,jp=(e,t)=>{let r=Fp.test(e),n=Fp.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},mO=(e,t)=>jp(t,e);Bp.exports={compareIdentifiers:jp,rcompareIdentifiers:mO}});var Q=w((n3,Vp)=>{var Ts=qr(),{MAX_LENGTH:Up,MAX_SAFE_INTEGER:Os}=Gr(),{safeRe:Gp,safeSrc:qp,t:Rs}=ar(),hO=Es(),{compareIdentifiers:cr}=ta(),ra=class e{constructor(t,r){if(r=hO(r),t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>Up)throw new TypeError(`version is longer than ${Up} characters`);Ts("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=t.trim().match(r.loose?Gp[Rs.LOOSE]:Gp[Rs.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Os||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Os||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Os||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){let o=+s;if(o>=0&&o<Os)return o}return s}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(Ts("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if(typeof t=="string"&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),cr(this.major,t.major)||cr(this.minor,t.minor)||cr(this.patch,t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],s=t.prerelease[r];if(Ts("prerelease compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return cr(n,s)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let n=this.build[r],s=t.build[r];if(Ts("build compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return cr(n,s)}while(++r)}inc(t,r,n){if(t.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let s=new RegExp(`^${this.options.loose?qp[Rs.PRERELEASELOOSE]:qp[Rs.PRERELEASE]}$`),o=`-${r}`.match(s);if(!o||o[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let s=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[s];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(r){let o=[r,s];n===!1&&(o=[r]),cr(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};Vp.exports=ra});var Et=w((s3,Wp)=>{var zp=Q(),gO=(e,t,r=!1)=>{if(e instanceof zp)return e;try{return new zp(e,t)}catch(n){if(!r)return null;throw n}};Wp.exports=gO});var Hp=w((o3,Zp)=>{var yO=Et(),bO=(e,t)=>{let r=yO(e,t);return r?r.version:null};Zp.exports=bO});var Xp=w((i3,Yp)=>{var wO=Et(),SO=(e,t)=>{let r=wO(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};Yp.exports=SO});var Qp=w((a3,Jp)=>{var Kp=Q(),xO=(e,t,r,n,s)=>{typeof r=="string"&&(s=n,n=r,r=void 0);try{return new Kp(e instanceof Kp?e.version:e,r).inc(t,n,s).version}catch{return null}};Jp.exports=xO});var rm=w((c3,tm)=>{var em=Et(),vO=(e,t)=>{let r=em(e,null,!0),n=em(t,null,!0),s=r.compare(n);if(s===0)return null;let o=s>0,i=o?r:n,a=o?n:r,c=!!i.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(i)===0)return a.minor&&!a.patch?"minor":"patch"}let l=c?"pre":"";return r.major!==n.major?l+"major":r.minor!==n.minor?l+"minor":r.patch!==n.patch?l+"patch":"prerelease"};tm.exports=vO});var sm=w((u3,nm)=>{var _O=Q(),EO=(e,t)=>new _O(e,t).major;nm.exports=EO});var im=w((l3,om)=>{var TO=Q(),OO=(e,t)=>new TO(e,t).minor;om.exports=OO});var cm=w((f3,am)=>{var RO=Q(),kO=(e,t)=>new RO(e,t).patch;am.exports=kO});var lm=w((d3,um)=>{var CO=Et(),AO=(e,t)=>{let r=CO(e,t);return r&&r.prerelease.length?r.prerelease:null};um.exports=AO});var Ee=w((p3,dm)=>{var fm=Q(),IO=(e,t,r)=>new fm(e,r).compare(new fm(t,r));dm.exports=IO});var mm=w((m3,pm)=>{var $O=Ee(),DO=(e,t,r)=>$O(t,e,r);pm.exports=DO});var gm=w((h3,hm)=>{var LO=Ee(),NO=(e,t)=>LO(e,t,!0);hm.exports=NO});var ks=w((g3,bm)=>{var ym=Q(),PO=(e,t,r)=>{let n=new ym(e,r),s=new ym(t,r);return n.compare(s)||n.compareBuild(s)};bm.exports=PO});var Sm=w((y3,wm)=>{var MO=ks(),FO=(e,t)=>e.sort((r,n)=>MO(r,n,t));wm.exports=FO});var vm=w((b3,xm)=>{var jO=ks(),BO=(e,t)=>e.sort((r,n)=>jO(n,r,t));xm.exports=BO});var Vr=w((w3,_m)=>{var UO=Ee(),GO=(e,t,r)=>UO(e,t,r)>0;_m.exports=GO});var Cs=w((S3,Em)=>{var qO=Ee(),VO=(e,t,r)=>qO(e,t,r)<0;Em.exports=VO});var na=w((x3,Tm)=>{var zO=Ee(),WO=(e,t,r)=>zO(e,t,r)===0;Tm.exports=WO});var sa=w((v3,Om)=>{var ZO=Ee(),HO=(e,t,r)=>ZO(e,t,r)!==0;Om.exports=HO});var As=w((_3,Rm)=>{var YO=Ee(),XO=(e,t,r)=>YO(e,t,r)>=0;Rm.exports=XO});var Is=w((E3,km)=>{var KO=Ee(),JO=(e,t,r)=>KO(e,t,r)<=0;km.exports=JO});var oa=w((T3,Cm)=>{var QO=na(),eR=sa(),tR=Vr(),rR=As(),nR=Cs(),sR=Is(),oR=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return QO(e,r,n);case"!=":return eR(e,r,n);case">":return tR(e,r,n);case">=":return rR(e,r,n);case"<":return nR(e,r,n);case"<=":return sR(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};Cm.exports=oR});var Im=w((O3,Am)=>{var iR=Q(),aR=Et(),{safeRe:$s,t:Ds}=ar(),cR=(e,t)=>{if(e instanceof iR)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?$s[Ds.COERCEFULL]:$s[Ds.COERCE]);else{let c=t.includePrerelease?$s[Ds.COERCERTLFULL]:$s[Ds.COERCERTL],u;for(;(u=c.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||u.index+u[0].length!==r.index+r[0].length)&&(r=u),c.lastIndex=u.index+u[1].length+u[2].length;c.lastIndex=-1}if(r===null)return null;let n=r[2],s=r[3]||"0",o=r[4]||"0",i=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return aR(`${n}.${s}.${o}${i}${a}`,t)};Am.exports=cR});var Dm=w((R3,$m)=>{var ia=class{constructor(){this.max=1e3,this.map=new Map}get(t){let r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){let s=this.map.keys().next().value;this.delete(s)}this.map.set(t,r)}return this}};$m.exports=ia});var Te=w((k3,Mm)=>{var uR=/\s+/g,aa=class e{constructor(t,r){if(r=fR(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof ca)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(uR," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(s=>!Nm(s[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let s of this.set)if(s.length===1&&bR(s[0])){this.set=[s];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t<this.set.length;t++){t>0&&(this.formatted+="||");let r=this.set[t];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){let n=((this.options.includePrerelease&&gR)|(this.options.loose&&yR))+":"+t,s=Lm.get(n);if(s)return s;let o=this.options.loose,i=o?ce[ne.HYPHENRANGELOOSE]:ce[ne.HYPHENRANGE];t=t.replace(i,kR(this.options.includePrerelease)),G("hyphen replace",t),t=t.replace(ce[ne.COMPARATORTRIM],pR),G("comparator trim",t),t=t.replace(ce[ne.TILDETRIM],mR),G("tilde trim",t),t=t.replace(ce[ne.CARETTRIM],hR),G("caret trim",t);let a=t.split(" ").map(f=>wR(f,this.options)).join(" ").split(/\s+/).map(f=>RR(f,this.options));o&&(a=a.filter(f=>(G("loose invalid filter",f,this.options),!!f.match(ce[ne.COMPARATORLOOSE])))),G("range list",a);let c=new Map,u=a.map(f=>new ca(f,this.options));for(let f of u){if(Nm(f))return[f];c.set(f.value,f)}c.size>1&&c.has("")&&c.delete("");let l=[...c.values()];return Lm.set(n,l),l}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(n=>Pm(n,r)&&t.set.some(s=>Pm(s,r)&&n.every(o=>s.every(i=>o.intersects(i,r)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new dR(t,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(CR(this.set[r],t,this.options))return!0;return!1}};Mm.exports=aa;var lR=Dm(),Lm=new lR,fR=Es(),ca=zr(),G=qr(),dR=Q(),{safeRe:ce,t:ne,comparatorTrimReplace:pR,tildeTrimReplace:mR,caretTrimReplace:hR}=ar(),{FLAG_INCLUDE_PRERELEASE:gR,FLAG_LOOSE:yR}=Gr(),Nm=e=>e.value==="<0.0.0-0",bR=e=>e.value==="",Pm=(e,t)=>{let r=!0,n=e.slice(),s=n.pop();for(;r&&n.length;)r=n.every(o=>s.intersects(o,t)),s=n.pop();return r},wR=(e,t)=>(G("comp",e,t),e=vR(e,t),G("caret",e),e=SR(e,t),G("tildes",e),e=ER(e,t),G("xrange",e),e=OR(e,t),G("stars",e),e),se=e=>!e||e.toLowerCase()==="x"||e==="*",SR=(e,t)=>e.trim().split(/\s+/).map(r=>xR(r,t)).join(" "),xR=(e,t)=>{let r=t.loose?ce[ne.TILDELOOSE]:ce[ne.TILDE];return e.replace(r,(n,s,o,i,a)=>{G("tilde",e,n,s,o,i,a);let c;return se(s)?c="":se(o)?c=`>=${s}.0.0 <${+s+1}.0.0-0`:se(i)?c=`>=${s}.${o}.0 <${s}.${+o+1}.0-0`:a?(G("replaceTilde pr",a),c=`>=${s}.${o}.${i}-${a} <${s}.${+o+1}.0-0`):c=`>=${s}.${o}.${i} <${s}.${+o+1}.0-0`,G("tilde return",c),c})},vR=(e,t)=>e.trim().split(/\s+/).map(r=>_R(r,t)).join(" "),_R=(e,t)=>{G("caret",e,t);let r=t.loose?ce[ne.CARETLOOSE]:ce[ne.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(s,o,i,a,c)=>{G("caret",e,s,o,i,a,c);let u;return se(o)?u="":se(i)?u=`>=${o}.0.0${n} <${+o+1}.0.0-0`:se(a)?o==="0"?u=`>=${o}.${i}.0${n} <${o}.${+i+1}.0-0`:u=`>=${o}.${i}.0${n} <${+o+1}.0.0-0`:c?(G("replaceCaret pr",c),o==="0"?i==="0"?u=`>=${o}.${i}.${a}-${c} <${o}.${i}.${+a+1}-0`:u=`>=${o}.${i}.${a}-${c} <${o}.${+i+1}.0-0`:u=`>=${o}.${i}.${a}-${c} <${+o+1}.0.0-0`):(G("no pr"),o==="0"?i==="0"?u=`>=${o}.${i}.${a}${n} <${o}.${i}.${+a+1}-0`:u=`>=${o}.${i}.${a}${n} <${o}.${+i+1}.0-0`:u=`>=${o}.${i}.${a} <${+o+1}.0.0-0`),G("caret return",u),u})},ER=(e,t)=>(G("replaceXRanges",e,t),e.split(/\s+/).map(r=>TR(r,t)).join(" ")),TR=(e,t)=>{e=e.trim();let r=t.loose?ce[ne.XRANGELOOSE]:ce[ne.XRANGE];return e.replace(r,(n,s,o,i,a,c)=>{G("xRange",e,n,s,o,i,a,c);let u=se(o),l=u||se(i),f=l||se(a),p=f;return s==="="&&p&&(s=""),c=t.includePrerelease?"-0":"",u?s===">"||s==="<"?n="<0.0.0-0":n="*":s&&p?(l&&(i=0),a=0,s===">"?(s=">=",l?(o=+o+1,i=0,a=0):(i=+i+1,a=0)):s==="<="&&(s="<",l?o=+o+1:i=+i+1),s==="<"&&(c="-0"),n=`${s+o}.${i}.${a}${c}`):l?n=`>=${o}.0.0${c} <${+o+1}.0.0-0`:f&&(n=`>=${o}.${i}.0${c} <${o}.${+i+1}.0-0`),G("xRange return",n),n})},OR=(e,t)=>(G("replaceStars",e,t),e.trim().replace(ce[ne.STAR],"")),RR=(e,t)=>(G("replaceGTE0",e,t),e.trim().replace(ce[t.includePrerelease?ne.GTE0PRE:ne.GTE0],"")),kR=e=>(t,r,n,s,o,i,a,c,u,l,f,p)=>(se(n)?r="":se(s)?r=`>=${n}.0.0${e?"-0":""}`:se(o)?r=`>=${n}.${s}.0${e?"-0":""}`:i?r=`>=${r}`:r=`>=${r}${e?"-0":""}`,se(u)?c="":se(l)?c=`<${+u+1}.0.0-0`:se(f)?c=`<${u}.${+l+1}.0-0`:p?c=`<=${u}.${l}.${f}-${p}`:e?c=`<${u}.${l}.${+f+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),CR=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++)if(G(e[n].semver),e[n].semver!==ca.ANY&&e[n].semver.prerelease.length>0){let s=e[n].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}return!1}return!0}});var zr=w((C3,qm)=>{var Wr=Symbol("SemVer ANY"),fa=class e{static get ANY(){return Wr}constructor(t,r){if(r=Fm(r),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),la("comparator",t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===Wr?this.value="":this.value=this.operator+this.semver.version,la("comp",this)}parse(t){let r=this.options.loose?jm[Bm.COMPARATORLOOSE]:jm[Bm.COMPARATOR],n=t.match(r);if(!n)throw new TypeError(`Invalid comparator: ${t}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new Um(n[2],this.options.loose):this.semver=Wr}toString(){return this.value}test(t){if(la("Comparator.test",t,this.options.loose),this.semver===Wr||t===Wr)return!0;if(typeof t=="string")try{t=new Um(t,this.options)}catch{return!1}return ua(t,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Gm(t.value,r).test(this.value):t.operator===""?t.value===""?!0:new Gm(this.value,r).test(t.semver):(r=Fm(r),r.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||ua(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||ua(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};qm.exports=fa;var Fm=Es(),{safeRe:jm,t:Bm}=ar(),ua=oa(),la=qr(),Um=Q(),Gm=Te()});var Zr=w((A3,Vm)=>{var AR=Te(),IR=(e,t,r)=>{try{t=new AR(t,r)}catch{return!1}return t.test(e)};Vm.exports=IR});var Wm=w((I3,zm)=>{var $R=Te(),DR=(e,t)=>new $R(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));zm.exports=DR});var Hm=w(($3,Zm)=>{var LR=Q(),NR=Te(),PR=(e,t,r)=>{let n=null,s=null,o=null;try{o=new NR(t,r)}catch{return null}return e.forEach(i=>{o.test(i)&&(!n||s.compare(i)===-1)&&(n=i,s=new LR(n,r))}),n};Zm.exports=PR});var Xm=w((D3,Ym)=>{var MR=Q(),FR=Te(),jR=(e,t,r)=>{let n=null,s=null,o=null;try{o=new FR(t,r)}catch{return null}return e.forEach(i=>{o.test(i)&&(!n||s.compare(i)===1)&&(n=i,s=new MR(n,r))}),n};Ym.exports=jR});var Qm=w((L3,Jm)=>{var da=Q(),BR=Te(),Km=Vr(),UR=(e,t)=>{e=new BR(e,t);let r=new da("0.0.0");if(e.test(r)||(r=new da("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n<e.set.length;++n){let s=e.set[n],o=null;s.forEach(i=>{let a=new da(i.semver.version);switch(i.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||Km(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${i.operator}`)}}),o&&(!r||Km(r,o))&&(r=o)}return r&&e.test(r)?r:null};Jm.exports=UR});var th=w((N3,eh)=>{var GR=Te(),qR=(e,t)=>{try{return new GR(e,t).range||"*"}catch{return null}};eh.exports=qR});var Ls=w((P3,oh)=>{var VR=Q(),sh=zr(),{ANY:zR}=sh,WR=Te(),ZR=Zr(),rh=Vr(),nh=Cs(),HR=Is(),YR=As(),XR=(e,t,r,n)=>{e=new VR(e,n),t=new WR(t,n);let s,o,i,a,c;switch(r){case">":s=rh,o=HR,i=nh,a=">",c=">=";break;case"<":s=nh,o=YR,i=rh,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(ZR(e,t,n))return!1;for(let u=0;u<t.set.length;++u){let l=t.set[u],f=null,p=null;if(l.forEach(d=>{d.semver===zR&&(d=new sh(">=0.0.0")),f=f||d,p=p||d,s(d.semver,f.semver,n)?f=d:i(d.semver,p.semver,n)&&(p=d)}),f.operator===a||f.operator===c||(!p.operator||p.operator===a)&&o(e,p.semver))return!1;if(p.operator===c&&i(e,p.semver))return!1}return!0};oh.exports=XR});var ah=w((M3,ih)=>{var KR=Ls(),JR=(e,t,r)=>KR(e,t,">",r);ih.exports=JR});var uh=w((F3,ch)=>{var QR=Ls(),ek=(e,t,r)=>QR(e,t,"<",r);ch.exports=ek});var dh=w((j3,fh)=>{var lh=Te(),tk=(e,t,r)=>(e=new lh(e,r),t=new lh(t,r),e.intersects(t,r));fh.exports=tk});var mh=w((B3,ph)=>{var rk=Zr(),nk=Ee();ph.exports=(e,t,r)=>{let n=[],s=null,o=null,i=e.sort((l,f)=>nk(l,f,r));for(let l of i)rk(l,t,r)?(o=l,s||(s=l)):(o&&n.push([s,o]),o=null,s=null);s&&n.push([s,null]);let a=[];for(let[l,f]of n)l===f?a.push(l):!f&&l===i[0]?a.push("*"):f?l===i[0]?a.push(`<=${f}`):a.push(`${l} - ${f}`):a.push(`>=${l}`);let c=a.join(" || "),u=typeof t.raw=="string"?t.raw:String(t);return c.length<u.length?c:t}});var Sh=w((U3,wh)=>{var hh=Te(),ma=zr(),{ANY:pa}=ma,Hr=Zr(),ha=Ee(),sk=(e,t,r={})=>{if(e===t)return!0;e=new hh(e,r),t=new hh(t,r);let n=!1;e:for(let s of e.set){for(let o of t.set){let i=ik(s,o,r);if(n=n||i!==null,i)continue e}if(n)return!1}return!0},ok=[new ma(">=0.0.0-0")],gh=[new ma(">=0.0.0")],ik=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===pa){if(t.length===1&&t[0].semver===pa)return!0;r.includePrerelease?e=ok:e=gh}if(t.length===1&&t[0].semver===pa){if(r.includePrerelease)return!0;t=gh}let n=new Set,s,o;for(let d of e)d.operator===">"||d.operator===">="?s=yh(s,d,r):d.operator==="<"||d.operator==="<="?o=bh(o,d,r):n.add(d.semver);if(n.size>1)return null;let i;if(s&&o){if(i=ha(s.semver,o.semver,r),i>0)return null;if(i===0&&(s.operator!==">="||o.operator!=="<="))return null}for(let d of n){if(s&&!Hr(d,String(s),r)||o&&!Hr(d,String(o),r))return null;for(let b of t)if(!Hr(d,String(b),r))return!1;return!0}let a,c,u,l,f=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,p=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;f&&f.prerelease.length===1&&o.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let d of t){if(l=l||d.operator===">"||d.operator===">=",u=u||d.operator==="<"||d.operator==="<=",s){if(p&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===p.major&&d.semver.minor===p.minor&&d.semver.patch===p.patch&&(p=!1),d.operator===">"||d.operator===">="){if(a=yh(s,d,r),a===d&&a!==s)return!1}else if(s.operator===">="&&!Hr(s.semver,String(d),r))return!1}if(o){if(f&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===f.major&&d.semver.minor===f.minor&&d.semver.patch===f.patch&&(f=!1),d.operator==="<"||d.operator==="<="){if(c=bh(o,d,r),c===d&&c!==o)return!1}else if(o.operator==="<="&&!Hr(o.semver,String(d),r))return!1}if(!d.operator&&(o||s)&&i!==0)return!1}return!(s&&u&&!o&&i!==0||o&&l&&!s&&i!==0||p||f)},yh=(e,t,r)=>{if(!e)return t;let n=ha(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},bh=(e,t,r)=>{if(!e)return t;let n=ha(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};wh.exports=sk});var Eh=w((G3,_h)=>{var ga=ar(),xh=Gr(),ak=Q(),vh=ta(),ck=Et(),uk=Hp(),lk=Xp(),fk=Qp(),dk=rm(),pk=sm(),mk=im(),hk=cm(),gk=lm(),yk=Ee(),bk=mm(),wk=gm(),Sk=ks(),xk=Sm(),vk=vm(),_k=Vr(),Ek=Cs(),Tk=na(),Ok=sa(),Rk=As(),kk=Is(),Ck=oa(),Ak=Im(),Ik=zr(),$k=Te(),Dk=Zr(),Lk=Wm(),Nk=Hm(),Pk=Xm(),Mk=Qm(),Fk=th(),jk=Ls(),Bk=ah(),Uk=uh(),Gk=dh(),qk=mh(),Vk=Sh();_h.exports={parse:ck,valid:uk,clean:lk,inc:fk,diff:dk,major:pk,minor:mk,patch:hk,prerelease:gk,compare:yk,rcompare:bk,compareLoose:wk,compareBuild:Sk,sort:xk,rsort:vk,gt:_k,lt:Ek,eq:Tk,neq:Ok,gte:Rk,lte:kk,cmp:Ck,coerce:Ak,Comparator:Ik,Range:$k,satisfies:Dk,toComparators:Lk,maxSatisfying:Nk,minSatisfying:Pk,minVersion:Mk,validRange:Fk,outside:jk,gtr:Bk,ltr:Uk,intersects:Gk,simplifyRange:qk,subset:Vk,SemVer:ak,re:ga.re,src:ga.src,tokens:ga.t,SEMVER_SPEC_VERSION:xh.SEMVER_SPEC_VERSION,RELEASE_TYPES:xh.RELEASE_TYPES,compareIdentifiers:vh.compareIdentifiers,rcompareIdentifiers:vh.rcompareIdentifiers}});var Bh=w((W3,jh)=>{var yr=1e3,br=yr*60,wr=br*60,Ut=wr*24,QC=Ut*7,eA=Ut*365.25;jh.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return tA(e);if(r==="number"&&isFinite(e))return t.long?nA(e):rA(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function tA(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*eA;case"weeks":case"week":case"w":return r*QC;case"days":case"day":case"d":return r*Ut;case"hours":case"hour":case"hrs":case"hr":case"h":return r*wr;case"minutes":case"minute":case"mins":case"min":case"m":return r*br;case"seconds":case"second":case"secs":case"sec":case"s":return r*yr;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function rA(e){var t=Math.abs(e);return t>=Ut?Math.round(e/Ut)+"d":t>=wr?Math.round(e/wr)+"h":t>=br?Math.round(e/br)+"m":t>=yr?Math.round(e/yr)+"s":e+"ms"}function nA(e){var t=Math.abs(e);return t>=Ut?Us(e,t,Ut,"day"):t>=wr?Us(e,t,wr,"hour"):t>=br?Us(e,t,br,"minute"):t>=yr?Us(e,t,yr,"second"):e+" ms"}function Us(e,t,r,n){var s=t>=r*1.5;return Math.round(e/r)+" "+n+(s?"s":"")}});var va=w((Z3,Uh)=>{function sA(e){r.debug=r,r.default=r,r.coerce=c,r.disable=i,r.enable=s,r.enabled=a,r.humanize=Bh(),r.destroy=u,Object.keys(e).forEach(l=>{r[l]=e[l]}),r.names=[],r.skips=[],r.formatters={};function t(l){let f=0;for(let p=0;p<l.length;p++)f=(f<<5)-f+l.charCodeAt(p),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=t;function r(l){let f,p=null,d,b;function T(...N){if(!T.enabled)return;let P=T,U=Number(new Date),H=U-(f||U);P.diff=H,P.prev=f,P.curr=U,f=U,N[0]=r.coerce(N[0]),typeof N[0]!="string"&&N.unshift("%O");let Y=0;N[0]=N[0].replace(/%([a-zA-Z%])/g,(ae,Ae)=>{if(ae==="%%")return"%";Y++;let Ie=r.formatters[Ae];if(typeof Ie=="function"){let xe=N[Y];ae=Ie.call(P,xe),N.splice(Y,1),Y--}return ae}),r.formatArgs.call(P,N),(P.log||r.log).apply(P,N)}return T.namespace=l,T.useColors=r.useColors(),T.color=r.selectColor(l),T.extend=n,T.destroy=r.destroy,Object.defineProperty(T,"enabled",{enumerable:!0,configurable:!1,get:()=>p!==null?p:(d!==r.namespaces&&(d=r.namespaces,b=r.enabled(l)),b),set:N=>{p=N}}),typeof r.init=="function"&&r.init(T),T}function n(l,f){let p=r(this.namespace+(typeof f>"u"?":":f)+l);return p.log=this.log,p}function s(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f=(typeof l=="string"?l:"").trim().replace(" ",",").split(",").filter(Boolean);for(let p of f)p[0]==="-"?r.skips.push(p.slice(1)):r.names.push(p)}function o(l,f){let p=0,d=0,b=-1,T=0;for(;p<l.length;)if(d<f.length&&(f[d]===l[p]||f[d]==="*"))f[d]==="*"?(b=d,T=p,d++):(p++,d++);else if(b!==-1)d=b+1,T++,p=T;else return!1;for(;d<f.length&&f[d]==="*";)d++;return d===f.length}function i(){let l=[...r.names,...r.skips.map(f=>"-"+f)].join(",");return r.enable(""),l}function a(l){for(let f of r.skips)if(o(l,f))return!1;for(let f of r.names)if(o(l,f))return!0;return!1}function c(l){return l instanceof Error?l.stack||l.message:l}function u(){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 r.enable(r.load()),r}Uh.exports=sA});var Gh=w((ye,Gs)=>{ye.formatArgs=iA;ye.save=aA;ye.load=cA;ye.useColors=oA;ye.storage=uA();ye.destroy=(()=>{let e=!1;return()=>{e||(e=!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`."))}})();ye.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 oA(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function iA(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+Gs.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(r++,s==="%c"&&(n=r))}),e.splice(n,0,t)}ye.log=console.debug||console.log||(()=>{});function aA(e){try{e?ye.storage.setItem("debug",e):ye.storage.removeItem("debug")}catch{}}function cA(){let e;try{e=ye.storage.getItem("debug")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function uA(){try{return localStorage}catch{}}Gs.exports=va()(ye);var{formatters:lA}=Gs.exports;lA.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var Vh=w((H3,qh)=>{"use strict";qh.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),s=t.indexOf("--");return n!==-1&&(s===-1||n<s)}});var Zh=w((Y3,Wh)=>{"use strict";var fA=pe("os"),zh=pe("tty"),ke=Vh(),{env:K}=process,qs;ke("no-color")||ke("no-colors")||ke("color=false")||ke("color=never")?qs=0:(ke("color")||ke("colors")||ke("color=true")||ke("color=always"))&&(qs=1);function dA(){if("FORCE_COLOR"in K)return K.FORCE_COLOR==="true"?1:K.FORCE_COLOR==="false"?0:K.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(K.FORCE_COLOR,10),3)}function pA(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function mA(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=dA();n!==void 0&&(qs=n);let s=r?qs:n;if(s===0)return 0;if(r){if(ke("color=16m")||ke("color=full")||ke("color=truecolor"))return 3;if(ke("color=256"))return 2}if(e&&!t&&s===void 0)return 0;let o=s||0;if(K.TERM==="dumb")return o;if(process.platform==="win32"){let i=fA.release().split(".");return Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in K)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(i=>i in K)||K.CI_NAME==="codeship"?1:o;if("TEAMCITY_VERSION"in K)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(K.TEAMCITY_VERSION)?1:0;if(K.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in K){let i=Number.parseInt((K.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(K.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(K.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(K.TERM)||"COLORTERM"in K?1:o}function _a(e,t={}){let r=mA(e,{streamIsTTY:e&&e.isTTY,...t});return pA(r)}Wh.exports={supportsColor:_a,stdout:_a({isTTY:zh.isatty(1)}),stderr:_a({isTTY:zh.isatty(2)})}});var Yh=w((J,zs)=>{var hA=pe("tty"),Vs=pe("util");J.init=vA;J.log=wA;J.formatArgs=yA;J.save=SA;J.load=xA;J.useColors=gA;J.destroy=Vs.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");J.colors=[6,2,3,4,5,1];try{let e=Zh();e&&(e.stderr||e).level>=2&&(J.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{}J.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(s,o)=>o.toUpperCase()),n=process.env[t];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),e[r]=n,e},{});function gA(){return"colors"in J.inspectOpts?!!J.inspectOpts.colors:hA.isatty(process.stderr.fd)}function yA(e){let{namespace:t,useColors:r}=this;if(r){let n=this.color,s="\x1B[3"+(n<8?n:"8;5;"+n),o=` ${s};1m${t} \x1B[0m`;e[0]=o+e[0].split(`
3
+ `).join(`
4
+ `+o),e.push(s+"m+"+zs.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=bA()+t+" "+e[0]}function bA(){return J.inspectOpts.hideDate?"":new Date().toISOString()+" "}function wA(...e){return process.stderr.write(Vs.formatWithOptions(J.inspectOpts,...e)+`
5
+ `)}function SA(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function xA(){return process.env.DEBUG}function vA(e){e.inspectOpts={};let t=Object.keys(J.inspectOpts);for(let r=0;r<t.length;r++)e.inspectOpts[t[r]]=J.inspectOpts[t[r]]}zs.exports=va()(J);var{formatters:Hh}=zs.exports;Hh.o=function(e){return this.inspectOpts.colors=this.useColors,Vs.inspect(e,this.inspectOpts).split(`
6
+ `).map(t=>t.trim()).join(" ")};Hh.O=function(e){return this.inspectOpts.colors=this.useColors,Vs.inspect(e,this.inspectOpts)}});var Ta=w((X3,Ea)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Ea.exports=Gh():Ea.exports=Yh()});var Xh=w(be=>{"use strict";var _A=be&&be.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(be,"__esModule",{value:!0});var EA=pe("fs"),TA=_A(Ta()),Sr=TA.default("@kwsites/file-exists");function OA(e,t,r){Sr("checking %s",e);try{let n=EA.statSync(e);return n.isFile()&&t?(Sr("[OK] path represents a file"),!0):n.isDirectory()&&r?(Sr("[OK] path represents a directory"),!0):(Sr("[FAIL] path represents something other than a file or directory"),!1)}catch(n){if(n.code==="ENOENT")return Sr("[FAIL] path is not accessible: %o",n),!1;throw Sr("[FATAL] %o",n),n}}function RA(e,t=be.READABLE){return OA(e,(t&be.FILE)>0,(t&be.FOLDER)>0)}be.exists=RA;be.FILE=1;be.FOLDER=2;be.READABLE=be.FILE+be.FOLDER});var Kh=w(Ws=>{"use strict";function kA(e){for(var t in e)Ws.hasOwnProperty(t)||(Ws[t]=e[t])}Object.defineProperty(Ws,"__esModule",{value:!0});kA(Xh())});var Ra=w(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.createDeferred=Gt.deferred=void 0;function Oa(){let e,t,r="pending";return{promise:new Promise((s,o)=>{e=s,t=o}),done(s){r==="pending"&&(r="resolved",e(s))},fail(s){r==="pending"&&(r="rejected",t(s))},get fulfilled(){return r!=="pending"},get status(){return r}}}Gt.deferred=Oa;Gt.createDeferred=Oa;Gt.default=Oa});var Nb=w((Lq,yc)=>{var ho=process||{},Db=ho.argv||[],mo=ho.env||{},U$=!(mo.NO_COLOR||Db.includes("--no-color"))&&(!!mo.FORCE_COLOR||Db.includes("--color")||ho.platform==="win32"||(ho.stdout||{}).isTTY&&mo.TERM!=="dumb"||!!mo.CI),G$=(e,t,r=e)=>n=>{let s=""+n,o=s.indexOf(t,e.length);return~o?e+q$(s,t,r,o)+t:e+s+t},q$=(e,t,r,n)=>{let s="",o=0;do s+=e.substring(o,n)+r,o=n+t.length,n=e.indexOf(t,o);while(~n);return s+e.substring(o)},Lb=(e=U$)=>{let t=e?G$:()=>String;return{isColorSupported:e,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};yc.exports=Lb();yc.exports.createColors=Lb});import{EventEmitter as mw}from"events";function wo(e){return e==null?[]:Array.isArray(e)?e:[e]}function hw(e,t,r,n){var s,o=e[t],i=~n.string.indexOf(t)?r==null||r===!0?"":String(r):typeof r=="boolean"?r:~n.boolean.indexOf(t)?r==="false"?!1:r==="true"||(e._.push((s=+r,s*0===0?s:r)),!!r):(s=+r,s*0===0?s:r);e[t]=o==null?i:Array.isArray(o)?o.concat(i):[o,i]}function gw(e,t){e=e||[],t=t||{};var r,n,s,o,i,a={_:[]},c=0,u=0,l=0,f=e.length;let p=t.alias!==void 0,d=t.unknown!==void 0,b=t.default!==void 0;if(t.alias=t.alias||{},t.string=wo(t.string),t.boolean=wo(t.boolean),p)for(r in t.alias)for(n=t.alias[r]=wo(t.alias[r]),c=0;c<n.length;c++)(t.alias[n[c]]=n.concat(r)).splice(c,1);for(c=t.boolean.length;c-- >0;)for(n=t.alias[t.boolean[c]]||[],u=n.length;u-- >0;)t.boolean.push(n[u]);for(c=t.string.length;c-- >0;)for(n=t.alias[t.string[c]]||[],u=n.length;u-- >0;)t.string.push(n[u]);if(b){for(r in t.default)if(o=typeof t.default[r],n=t.alias[r]=t.alias[r]||[],t[o]!==void 0)for(t[o].push(r),c=0;c<n.length;c++)t[o].push(n[c])}let T=d?Object.keys(t.alias):[];for(c=0;c<f;c++){if(s=e[c],s==="--"){a._=a._.concat(e.slice(++c));break}for(u=0;u<s.length&&s.charCodeAt(u)===45;u++);if(u===0)a._.push(s);else if(s.substring(u,u+3)==="no-"){if(o=s.substring(u+3),d&&!~T.indexOf(o))return t.unknown(s);a[o]=!1}else{for(l=u+1;l<s.length&&s.charCodeAt(l)!==61;l++);for(o=s.substring(u,l),i=s.substring(++l)||c+1===f||(""+e[c+1]).charCodeAt(0)===45||e[++c],n=u===2?[o]:o,l=0;l<n.length;l++){if(o=n[l],d&&!~T.indexOf(o))return t.unknown("-".repeat(u)+o);hw(a,o,l+1<n.length||i,t)}}}if(b)for(r in t.default)a[r]===void 0&&(a[r]=t.default[r]);if(p)for(r in a)for(n=t.alias[r]||[];n.length>0;)a[n.shift()]=a[r];return a}var Tc=e=>e.replace(/[<[].+/,"").trim(),yw=e=>{let t=/<([^>]+)>/g,r=/\[([^\]]+)\]/g,n=[],s=a=>{let c=!1,u=a[1];return u.startsWith("...")&&(u=u.slice(3),c=!0),{required:a[0].startsWith("<"),value:u,variadic:c}},o;for(;o=t.exec(e);)n.push(s(o));let i;for(;i=r.exec(e);)n.push(s(i));return n},bw=e=>{let t={alias:{},boolean:[]};for(let[r,n]of e.entries())n.names.length>1&&(t.alias[n.names[0]]=n.names.slice(1)),n.isBoolean&&(n.negated&&e.some((o,i)=>i!==r&&o.names.some(a=>n.names.includes(a))&&typeof o.required=="boolean")||t.boolean.push(n.names[0]));return t},_c=e=>e.sort((t,r)=>t.length>r.length?-1:1)[0],Ec=(e,t)=>e.length>=t?e:`${e}${" ".repeat(t-e.length)}`,ww=e=>e.replace(/([a-z])-([a-z])/g,(t,r,n)=>r+n.toUpperCase()),Sw=(e,t,r)=>{let n=0,s=t.length,o=e,i;for(;n<s;++n)i=o[t[n]],o=o[t[n]]=n===s-1?r:i??(~t[n+1].indexOf(".")||!(+t[n+1]>-1)?{}:[])},xw=(e,t)=>{for(let r of Object.keys(t)){let n=t[r];n.shouldTransform&&(e[r]=Array.prototype.concat.call([],e[r]),typeof n.transformFunction=="function"&&(e[r]=e[r].map(n.transformFunction)))}},vw=e=>{let t=/([^\\\/]+)$/.exec(e);return t?t[1]:""},Oc=e=>e.split(".").map((t,r)=>r===0?ww(t):t).join("."),Tr=class extends Error{constructor(t){super(t),this.name=this.constructor.name,typeof Error.captureStackTrace=="function"?Error.captureStackTrace(this,this.constructor):this.stack=new Error(t).stack}},So=class{constructor(t,r,n){this.rawName=t,this.description=r,this.config=Object.assign({},n),t=t.replace(/\.\*/g,""),this.negated=!1,this.names=Tc(t).split(",").map(s=>{let o=s.trim().replace(/^-{1,2}/,"");return o.startsWith("no-")&&(this.negated=!0,o=o.replace(/^no-/,"")),Oc(o)}).sort((s,o)=>s.length>o.length?1:-1),this.name=this.names[this.names.length-1],this.negated&&this.config.default==null&&(this.config.default=!0),t.includes("<")?this.required=!0:t.includes("[")?this.required=!1:this.isBoolean=!0}},_w=process.argv,Ew=`${process.platform}-${process.arch} node-${process.version}`,mn=class{constructor(t,r,n={},s){this.rawName=t,this.description=r,this.config=n,this.cli=s,this.options=[],this.aliasNames=[],this.name=Tc(t),this.args=yw(t),this.examples=[]}usage(t){return this.usageText=t,this}allowUnknownOptions(){return this.config.allowUnknownOptions=!0,this}ignoreOptionDefaultValue(){return this.config.ignoreOptionDefaultValue=!0,this}version(t,r="-v, --version"){return this.versionNumber=t,this.option(r,"Display version number"),this}example(t){return this.examples.push(t),this}option(t,r,n){let s=new So(t,r,n);return this.options.push(s),this}alias(t){return this.aliasNames.push(t),this}action(t){return this.commandAction=t,this}isMatched(t){return this.name===t||this.aliasNames.includes(t)}get isDefaultCommand(){return this.name===""||this.aliasNames.includes("!")}get isGlobalCommand(){return this instanceof hn}hasOption(t){return t=t.split(".")[0],this.options.find(r=>r.names.includes(t))}outputHelp(){let{name:t,commands:r}=this.cli,{versionNumber:n,options:s,helpCallback:o}=this.cli.globalCommand,i=[{body:`${t}${n?`/${n}`:""}`}];if(i.push({title:"Usage",body:` $ ${t} ${this.usageText||this.rawName}`}),(this.isGlobalCommand||this.isDefaultCommand)&&r.length>0){let u=_c(r.map(l=>l.rawName));i.push({title:"Commands",body:r.map(l=>` ${Ec(l.rawName,u.length)} ${l.description}`).join(`
7
+ `)}),i.push({title:"For more info, run any command with the `--help` flag",body:r.map(l=>` $ ${t}${l.name===""?"":` ${l.name}`} --help`).join(`
8
+ `)})}let c=this.isGlobalCommand?s:[...this.options,...s||[]];if(!this.isGlobalCommand&&!this.isDefaultCommand&&(c=c.filter(u=>u.name!=="version")),c.length>0){let u=_c(c.map(l=>l.rawName));i.push({title:"Options",body:c.map(l=>` ${Ec(l.rawName,u.length)} ${l.description} ${l.config.default===void 0?"":`(default: ${l.config.default})`}`).join(`
9
+ `)})}this.examples.length>0&&i.push({title:"Examples",body:this.examples.map(u=>typeof u=="function"?u(t):u).join(`
10
+ `)}),o&&(i=o(i)||i),console.log(i.map(u=>u.title?`${u.title}:
11
+ ${u.body}`:u.body).join(`
12
+
13
+ `))}outputVersion(){let{name:t}=this.cli,{versionNumber:r}=this.cli.globalCommand;r&&console.log(`${t}/${r} ${Ew}`)}checkRequiredArgs(){let t=this.args.filter(r=>r.required).length;if(this.cli.args.length<t)throw new Tr(`missing required args for command \`${this.rawName}\``)}checkUnknownOptions(){let{options:t,globalCommand:r}=this.cli;if(!this.config.allowUnknownOptions){for(let n of Object.keys(t))if(n!=="--"&&!this.hasOption(n)&&!r.hasOption(n))throw new Tr(`Unknown option \`${n.length>1?`--${n}`:`-${n}`}\``)}}checkOptionValue(){let{options:t,globalCommand:r}=this.cli,n=[...r.options,...this.options];for(let s of n){let o=t[s.name.split(".")[0]];if(s.required){let i=n.some(a=>a.negated&&a.names.includes(s.name));if(o===!0||o===!1&&!i)throw new Tr(`option \`${s.rawName}\` value is missing`)}}}},hn=class extends mn{constructor(t){super("@@global@@","",{},t)}},pn=Object.assign,xo=class extends mw{constructor(t=""){super(),this.name=t,this.commands=[],this.rawArgs=[],this.args=[],this.options={},this.globalCommand=new hn(this),this.globalCommand.usage("<command> [options]")}usage(t){return this.globalCommand.usage(t),this}command(t,r,n){let s=new mn(t,r||"",n,this);return s.globalCommand=this.globalCommand,this.commands.push(s),s}option(t,r,n){return this.globalCommand.option(t,r,n),this}help(t){return this.globalCommand.option("-h, --help","Display this message"),this.globalCommand.helpCallback=t,this.showHelpOnExit=!0,this}version(t,r="-v, --version"){return this.globalCommand.version(t,r),this.showVersionOnExit=!0,this}example(t){return this.globalCommand.example(t),this}outputHelp(){this.matchedCommand?this.matchedCommand.outputHelp():this.globalCommand.outputHelp()}outputVersion(){this.globalCommand.outputVersion()}setParsedInfo({args:t,options:r},n,s){return this.args=t,this.options=r,n&&(this.matchedCommand=n),s&&(this.matchedCommandName=s),this}unsetMatchedCommand(){this.matchedCommand=void 0,this.matchedCommandName=void 0}parse(t=_w,{run:r=!0}={}){this.rawArgs=t,this.name||(this.name=t[1]?vw(t[1]):"cli");let n=!0;for(let o of this.commands){let i=this.mri(t.slice(2),o),a=i.args[0];if(o.isMatched(a)){n=!1;let c=pn(pn({},i),{args:i.args.slice(1)});this.setParsedInfo(c,o,a),this.emit(`command:${a}`,o)}}if(n){for(let o of this.commands)if(o.name===""){n=!1;let i=this.mri(t.slice(2),o);this.setParsedInfo(i,o),this.emit("command:!",o)}}if(n){let o=this.mri(t.slice(2));this.setParsedInfo(o)}this.options.help&&this.showHelpOnExit&&(this.outputHelp(),r=!1,this.unsetMatchedCommand()),this.options.version&&this.showVersionOnExit&&this.matchedCommandName==null&&(this.outputVersion(),r=!1,this.unsetMatchedCommand());let s={args:this.args,options:this.options};return r&&this.runMatchedCommand(),!this.matchedCommand&&this.args[0]&&this.emit("command:*"),s}mri(t,r){let n=[...this.globalCommand.options,...r?r.options:[]],s=bw(n),o=[],i=t.indexOf("--");i>-1&&(o=t.slice(i+1),t=t.slice(0,i));let a=gw(t,s);a=Object.keys(a).reduce((p,d)=>pn(pn({},p),{[Oc(d)]:a[d]}),{_:[]});let c=a._,u={"--":o},l=r&&r.config.ignoreOptionDefaultValue?r.config.ignoreOptionDefaultValue:this.globalCommand.config.ignoreOptionDefaultValue,f=Object.create(null);for(let p of n){if(!l&&p.config.default!==void 0)for(let d of p.names)u[d]=p.config.default;Array.isArray(p.config.type)&&f[p.name]===void 0&&(f[p.name]=Object.create(null),f[p.name].shouldTransform=!0,f[p.name].transformFunction=p.config.type[0])}for(let p of Object.keys(a))if(p!=="_"){let d=p.split(".");Sw(u,d,a[p]),xw(u,f)}return{args:c,options:u}}runMatchedCommand(){let{args:t,options:r,matchedCommand:n}=this;if(!n||!n.commandAction)return;n.checkUnknownOptions(),n.checkOptionValue(),n.checkRequiredArgs();let s=[];return n.args.forEach((o,i)=>{o.variadic?s.push(t.slice(i)):s.push(t[i])}),s.push(r),n.commandAction.apply(this,s)}},Rc=(e="")=>new xo(e);function z(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}import{fileURLToPath as Tw}from"node:url";var Wt=(e,t)=>{let r=_o(Ow(e));if(typeof r!="string")throw new TypeError(`${t} must be a string or a file URL: ${r}.`);return r},Ow=e=>vo(e)?e.toString():e,vo=e=>typeof e!="string"&&e&&Object.getPrototypeOf(e)===String.prototype,_o=e=>e instanceof URL?Tw(e):e;var gn=(e,t=[],r={})=>{let n=Wt(e,"First argument"),[s,o]=z(t)?[[],t]:[t,r];if(!Array.isArray(s))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${s}`);if(s.some(c=>typeof c=="object"&&c!==null))throw new TypeError(`Second argument must be an array of strings: ${s}`);let i=s.map(String),a=i.find(c=>c.includes("\0"));if(a!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!z(o))throw new TypeError(`Last argument must be an options object: ${o}`);return[n,i,o]};import{ChildProcess as Dw}from"node:child_process";import{StringDecoder as Rw}from"node:string_decoder";var{toString:kc}=Object.prototype,Cc=e=>kc.call(e)==="[object ArrayBuffer]",X=e=>kc.call(e)==="[object Uint8Array]",Ye=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),kw=new TextEncoder,Ac=e=>kw.encode(e),Cw=new TextDecoder,yn=e=>Cw.decode(e),Ic=(e,t)=>Aw(e,t).join(""),Aw=(e,t)=>{if(t==="utf8"&&e.every(o=>typeof o=="string"))return e;let r=new Rw(t),n=e.map(o=>typeof o=="string"?Ac(o):o).map(o=>r.write(o)),s=r.end();return s===""?n:[...n,s]},Or=e=>e.length===1&&X(e[0])?e[0]:Eo(Iw(e)),Iw=e=>e.map(t=>typeof t=="string"?Ac(t):t),Eo=e=>{let t=new Uint8Array($w(e)),r=0;for(let n of e)t.set(n,r),r+=n.length;return t},$w=e=>{let t=0;for(let r of e)t+=r.length;return t};var Nc=e=>Array.isArray(e)&&Array.isArray(e.raw),Pc=(e,t)=>{let r=[];for(let[o,i]of e.entries())r=Lw({templates:e,expressions:t,tokens:r,index:o,template:i});if(r.length===0)throw new TypeError("Template script must not be empty");let[n,...s]=r;return[n,s,{}]},Lw=({templates:e,expressions:t,tokens:r,index:n,template:s})=>{if(s===void 0)throw new TypeError(`Invalid backslash sequence: ${e.raw[n]}`);let{nextTokens:o,leadingWhitespaces:i,trailingWhitespaces:a}=Nw(s,e.raw[n]),c=Dc(r,o,i);if(n===t.length)return c;let u=t[n],l=Array.isArray(u)?u.map(f=>Lc(f)):[Lc(u)];return Dc(c,l,a)},Nw=(e,t)=>{if(t.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],n=0,s=$c.has(t[0]);for(let i=0,a=0;i<e.length;i+=1,a+=1){let c=t[a];if($c.has(c))n!==i&&r.push(e.slice(n,i)),n=i+1;else if(c==="\\"){let u=t[a+1];u===`
14
+ `?(i-=1,a+=1):u==="u"&&t[a+2]==="{"?a=t.indexOf("}",a+3):a+=Pw[u]??1}}let o=n===e.length;return o||r.push(e.slice(n)),{nextTokens:r,leadingWhitespaces:s,trailingWhitespaces:o}},$c=new Set([" "," ","\r",`
15
+ `]),Pw={x:3,u:5},Dc=(e,t,r)=>r||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],Lc=e=>{let t=typeof e;if(t==="string")return e;if(t==="number")return String(e);if(z(e)&&("stdout"in e||"isMaxBuffer"in e))return Mw(e);throw e instanceof Dw||Object.prototype.toString.call(e)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${t}" in template expression`)},Mw=({stdout:e})=>{if(typeof e=="string")return e;if(X(e))return yn(e);throw e===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof e}" stdout in template expression`)};import{spawnSync as UE}from"node:child_process";import{debuglog as Fw}from"node:util";import To from"node:process";var De=e=>bn.includes(e),bn=[To.stdin,To.stdout,To.stderr],ve=["stdin","stdout","stderr"],wn=e=>ve[e]??`stdio[${e}]`;var Fc=e=>{let t={...e};for(let r of ko)t[r]=Oo(e,r);return t},Oo=(e,t)=>{let r=Array.from({length:jw(e)+1}),n=Bw(e[t],r,t);return zw(n,t)},jw=({stdio:e})=>Array.isArray(e)?Math.max(e.length,ve.length):ve.length,Bw=(e,t,r)=>z(e)?Uw(e,t,r):t.fill(e),Uw=(e,t,r)=>{for(let n of Object.keys(e).sort(Gw))for(let s of qw(n,r,t))t[s]=e[n];return t},Gw=(e,t)=>Mc(e)<Mc(t)?1:-1,Mc=e=>e==="stdout"||e==="stderr"?0:e==="all"?2:1,qw=(e,t,r)=>{if(e==="ipc")return[r.length-1];let n=Ro(e);if(n===void 0||n===0)throw new TypeError(`"${t}.${e}" is invalid.
16
+ It must be "${t}.stdout", "${t}.stderr", "${t}.all", "${t}.ipc", or "${t}.fd3", "${t}.fd4" (and so on).`);if(n>=r.length)throw new TypeError(`"${t}.${e}" is invalid: that file descriptor does not exist.
17
+ Please set the "stdio" option to ensure that file descriptor exists.`);return n==="all"?[1,2]:[n]},Ro=e=>{if(e==="all")return e;if(ve.includes(e))return ve.indexOf(e);let t=Vw.exec(e);if(t!==null)return Number(t[1])},Vw=/^fd(\d+)$/,zw=(e,t)=>e.map(r=>r===void 0?Zw[t]:r),Ww=Fw("execa").enabled?"full":"none",Zw={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:Ww,stripFinalNewline:!0},ko=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],Xe=(e,t)=>t==="ipc"?e.at(-1):e[t];var Zt=({verbose:e},t)=>Co(e,t)!=="none",Ht=({verbose:e},t)=>!["none","short"].includes(Co(e,t)),jc=({verbose:e},t)=>{let r=Co(e,t);return Sn(r)?r:void 0},Co=(e,t)=>t===void 0?Hw(e):Xe(e,t),Hw=e=>e.find(t=>Sn(t))??xn.findLast(t=>e.includes(t)),Sn=e=>typeof e=="function",xn=["none","short","full"];import{inspect as gS}from"node:util";import{platform as Yw}from"node:process";import{stripVTControlCharacters as Xw}from"node:util";var Bc=(e,t)=>{let r=[e,...t],n=r.join(" "),s=r.map(o=>rS(Uc(o))).join(" ");return{command:n,escapedCommand:s}},Rr=e=>Xw(e).split(`
18
+ `).map(t=>Uc(t)).join(`
19
+ `),Uc=e=>e.replaceAll(Qw,t=>Kw(t)),Kw=e=>{let t=eS[e];if(t!==void 0)return t;let r=e.codePointAt(0),n=r.toString(16);return r<=tS?`\\u${n.padStart(4,"0")}`:`\\U${n}`},Jw=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},Qw=Jw(),eS={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},tS=65535,rS=e=>nS.test(e)?e:Yw==="win32"?`"${e.replaceAll('"','""')}"`:`'${e.replaceAll("'","'\\''")}'`,nS=/^[\w./-]+$/;import Gc from"node:process";function Ao(){let{env:e}=Gc,{TERM:t,TERM_PROGRAM:r}=e;return Gc.platform!=="win32"?t!=="linux":!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||t==="xterm-256color"||t==="alacritty"||t==="rxvt-unicode"||t==="rxvt-unicode-256color"||e.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var qc={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},Vc={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},sS={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},oS={...qc,...Vc},iS={...qc,...sS},aS=Ao(),cS=aS?oS:iS,vn=cS,TD=Object.entries(Vc);import uS from"node:tty";var lS=uS?.WriteStream?.prototype?.hasColors?.()??!1,L=(e,t)=>{if(!lS)return s=>s;let r=`\x1B[${e}m`,n=`\x1B[${t}m`;return s=>{let o=s+"",i=o.indexOf(n);if(i===-1)return r+o+n;let a=r,c=0;for(;i!==-1;)a+=o.slice(c,i)+r,c=i+n.length,i=o.indexOf(n,c);return a+=o.slice(c)+n,a}},kD=L(0,0),zc=L(1,22),CD=L(2,22),AD=L(3,23),ID=L(4,24),$D=L(53,55),DD=L(7,27),LD=L(8,28),ND=L(9,29),PD=L(30,39),MD=L(31,39),FD=L(32,39),jD=L(33,39),BD=L(34,39),UD=L(35,39),GD=L(36,39),qD=L(37,39),_n=L(90,39),VD=L(40,49),zD=L(41,49),WD=L(42,49),ZD=L(43,49),HD=L(44,49),YD=L(45,49),XD=L(46,49),KD=L(47,49),JD=L(100,49),Wc=L(91,39),QD=L(92,39),Zc=L(93,39),eL=L(94,39),tL=L(95,39),rL=L(96,39),nL=L(97,39),sL=L(101,49),oL=L(102,49),iL=L(103,49),aL=L(104,49),cL=L(105,49),uL=L(106,49),lL=L(107,49);var Xc=({type:e,message:t,timestamp:r,piped:n,commandId:s,result:{failed:o=!1}={},options:{reject:i=!0}})=>{let a=fS(r),c=dS[e]({failed:o,reject:i,piped:n}),u=pS[e]({reject:i});return`${_n(`[${a}]`)} ${_n(`[${s}]`)} ${u(c)} ${u(t)}`},fS=e=>`${En(e.getHours(),2)}:${En(e.getMinutes(),2)}:${En(e.getSeconds(),2)}.${En(e.getMilliseconds(),3)}`,En=(e,t)=>String(e).padStart(t,"0"),Hc=({failed:e,reject:t})=>e?t?vn.cross:vn.warning:vn.tick,dS={command:({piped:e})=>e?"|":"$",output:()=>" ",ipc:()=>"*",error:Hc,duration:Hc},Yc=e=>e,pS={command:()=>zc,output:()=>Yc,ipc:()=>Yc,error:({reject:e})=>e?Wc:Zc,duration:()=>_n};var Kc=(e,t,r)=>{let n=jc(t,r);return e.map(({verboseLine:s,verboseObject:o})=>mS(s,o,n)).filter(s=>s!==void 0).map(s=>hS(s)).join("")},mS=(e,t,r)=>{if(r===void 0)return e;let n=r(e,t);if(typeof n=="string")return n},hS=e=>e.endsWith(`
20
+ `)?e:`${e}
21
+ `;var je=({type:e,verboseMessage:t,fdNumber:r,verboseInfo:n,result:s})=>{let o=yS({type:e,result:s,verboseInfo:n}),i=bS(t,o),a=Kc(i,n,r);a!==""&&console.warn(a.slice(0,-1))},yS=({type:e,result:t,verboseInfo:{escapedCommand:r,commandId:n,rawOptions:{piped:s=!1,...o}}})=>({type:e,escapedCommand:r,commandId:`${n}`,timestamp:new Date,piped:s,result:t,options:o}),bS=(e,t)=>e.split(`
22
+ `).map(r=>wS({...t,message:r})),wS=e=>({verboseLine:Xc(e),verboseObject:e}),Tn=e=>{let t=typeof e=="string"?e:gS(e);return Rr(t).replaceAll(" "," ".repeat(SS))},SS=2;var Jc=(e,t)=>{Zt(t)&&je({type:"command",verboseMessage:e,verboseInfo:t})};var Qc=(e,t,r)=>{_S(e);let n=xS(e);return{verbose:e,escapedCommand:t,commandId:n,rawOptions:r}},xS=e=>Zt({verbose:e})?vS++:void 0,vS=0n,_S=e=>{for(let t of e){if(t===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(t===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!xn.includes(t)&&!Sn(t)){let r=xn.map(n=>`'${n}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${r} or a function.`)}}};import{hrtime as eu}from"node:process";var On=()=>eu.bigint(),Io=e=>Number(eu.bigint()-e)/1e6;var Rn=(e,t,r)=>{let n=On(),{command:s,escapedCommand:o}=Bc(e,t),i=Oo(r,"verbose"),a=Qc(i,o,{...r});return Jc(o,a),{command:s,escapedCommand:o,startTime:n,verboseInfo:a}};var Ql=gt(Gu(),1);import iv from"node:path";import Jl from"node:process";import In from"node:process";import yt from"node:path";function Cn(e={}){let{env:t=process.env,platform:r=process.platform}=e;return r!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"}import{promisify as XS}from"node:util";import{execFile as KS,execFileSync as JL}from"node:child_process";import qu from"node:path";import{fileURLToPath as JS}from"node:url";var tN=XS(KS);function An(e){return e instanceof URL?JS(e):e}function Vu(e){return{*[Symbol.iterator](){let t=qu.resolve(An(e)),r;for(;r!==t;)yield t,r=t,t=qu.resolve(t,"..")}}}var rN=10*1024*1024;var QS=({cwd:e=In.cwd(),path:t=In.env[Cn()],preferLocal:r=!0,execPath:n=In.execPath,addExecPath:s=!0}={})=>{let o=yt.resolve(An(e)),i=[],a=t.split(yt.delimiter);return r&&ex(i,a,o),s&&tx(i,a,n,o),t===""||t===yt.delimiter?`${i.join(yt.delimiter)}${t}`:[...i,t].join(yt.delimiter)},ex=(e,t,r)=>{for(let n of Vu(r)){let s=yt.join(n,"node_modules/.bin");t.includes(s)||e.push(s)}},tx=(e,t,r,n)=>{let s=yt.resolve(n,An(r),"..");t.includes(s)||e.push(s)},zu=({env:e=In.env,...t}={})=>{e={...e};let r=Cn({env:e});return t.path=e[r],e[r]=QS(t),e};import{setTimeout as gx}from"node:timers/promises";var Wu=(e,t,r)=>{let n=r?Cr:kr,s=e instanceof Le?{}:{cause:e};return new n(t,s)},Le=class extends Error{},Zu=(e,t)=>{Object.defineProperty(e.prototype,"name",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,Yu,{value:!0,writable:!1,enumerable:!1,configurable:!1})},Hu=e=>$n(e)&&Yu in e,Yu=Symbol("isExecaError"),$n=e=>Object.prototype.toString.call(e)==="[object Error]",kr=class extends Error{};Zu(kr,kr.name);var Cr=class extends Error{};Zu(Cr,Cr.name);import{constants as Ar}from"node:os";import{constants as ox}from"node:os";var Xu=()=>{let e=Ju-Ku+1;return Array.from({length:e},rx)},rx=(e,t)=>({name:`SIGRT${t+1}`,number:Ku+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Ku=34,Ju=64;import{constants as nx}from"node:os";var Qu=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var Uo=()=>{let e=Xu();return[...Qu,...e].map(sx)},sx=({name:e,number:t,description:r,action:n,forced:s=!1,standard:o})=>{let{signals:{[e]:i}}=nx,a=i!==void 0;return{name:e,number:a?i:t,description:r,supported:a,action:n,forced:s,standard:o}};var ix=()=>{let e=Uo();return Object.fromEntries(e.map(ax))},ax=({name:e,number:t,description:r,supported:n,action:s,forced:o,standard:i})=>[e,{name:e,number:t,description:r,supported:n,action:s,forced:o,standard:i}],el=ix(),cx=()=>{let e=Uo(),t=65,r=Array.from({length:t},(n,s)=>ux(s,e));return Object.assign({},...r)},ux=(e,t)=>{let r=lx(e,t);if(r===void 0)return{};let{name:n,description:s,supported:o,action:i,forced:a,standard:c}=r;return{[e]:{name:n,number:e,description:s,supported:o,action:i,forced:a,standard:c}}},lx=(e,t)=>{let r=t.find(({name:n})=>ox.signals[n]===e);return r!==void 0?r:t.find(n=>n.number===e)},wN=cx();var rl=e=>{let t="option `killSignal`";if(e===0)throw new TypeError(`Invalid ${t}: 0 cannot be used.`);return sl(e,t)},nl=e=>e===0?e:sl(e,"`subprocess.kill()`'s argument"),sl=(e,t)=>{if(Number.isInteger(e))return fx(e,t);if(typeof e=="string")return px(e,t);throw new TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.
23
+ ${Go()}`)},fx=(e,t)=>{if(tl.has(e))return tl.get(e);throw new TypeError(`Invalid ${t} ${e}: this signal integer does not exist.
24
+ ${Go()}`)},dx=()=>new Map(Object.entries(Ar.signals).reverse().map(([e,t])=>[t,e])),tl=dx(),px=(e,t)=>{if(e in Ar.signals)return e;throw e.toUpperCase()in Ar.signals?new TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`):new TypeError(`Invalid ${t} '${e}': this signal name does not exist.
25
+ ${Go()}`)},Go=()=>`Available signal names: ${mx()}.
26
+ Available signal numbers: ${hx()}.`,mx=()=>Object.keys(Ar.signals).sort().map(e=>`'${e}'`).join(", "),hx=()=>[...new Set(Object.values(Ar.signals).sort((e,t)=>e-t))].join(", "),Dn=e=>el[e].description;var ol=e=>{if(e===!1)return e;if(e===!0)return yx;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},yx=1e3*5,il=({kill:e,options:{forceKillAfterDelay:t,killSignal:r},onInternalError:n,context:s,controller:o},i,a)=>{let{signal:c,error:u}=bx(i,a,r);wx(u,n);let l=e(c);return Sx({kill:e,signal:c,forceKillAfterDelay:t,killSignal:r,killResult:l,context:s,controller:o}),l},bx=(e,t,r)=>{let[n=r,s]=$n(e)?[void 0,e]:[e,t];if(typeof n!="string"&&!Number.isInteger(n))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(n)}`);if(s!==void 0&&!$n(s))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${s}`);return{signal:nl(n),error:s}},wx=(e,t)=>{e!==void 0&&t.reject(e)},Sx=async({kill:e,signal:t,forceKillAfterDelay:r,killSignal:n,killResult:s,context:o,controller:i})=>{t===n&&s&&qo({kill:e,forceKillAfterDelay:r,context:o,controllerSignal:i.signal})},qo=async({kill:e,forceKillAfterDelay:t,context:r,controllerSignal:n})=>{if(t!==!1)try{await gx(t,void 0,{signal:n}),e("SIGKILL")&&(r.isForcefullyTerminated??=!0)}catch{}};import{once as xx}from"node:events";var Ln=async(e,t)=>{e.aborted||await xx(e,"abort",{signal:t})};var al=({cancelSignal:e})=>{if(e!==void 0&&Object.prototype.toString.call(e)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(e)}`)},cl=({subprocess:e,cancelSignal:t,gracefulCancel:r,context:n,controller:s})=>t===void 0||r?[]:[vx(e,t,n,s)],vx=async(e,t,r,{signal:n})=>{throw await Ln(t,n),r.terminationReason??="cancel",e.kill(),t.reason};import{scheduler as qx}from"node:timers/promises";import{promisify as Bx}from"node:util";var Kt=({methodName:e,isSubprocess:t,ipc:r,isConnected:n})=>{_x(e,t,r),Vo(e,t,n)},_x=(e,t,r)=>{if(!r)throw new Error(`${Ne(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},Vo=(e,t,r)=>{if(!r)throw new Error(`${Ne(e,t)} cannot be used: the ${it(t)} has already exited or disconnected.`)},ul=e=>{throw new Error(`${Ne("getOneMessage",e)} could not complete: the ${it(e)} exited or disconnected.`)},ll=e=>{throw new Error(`${Ne("sendMessage",e)} failed: the ${it(e)} is sending a message too, instead of listening to incoming messages.
27
+ This can be fixed by both sending a message and listening to incoming messages at the same time:
28
+
29
+ const [receivedMessage] = await Promise.all([
30
+ ${Ne("getOneMessage",e)},
31
+ ${Ne("sendMessage",e,"message, {strict: true}")},
32
+ ]);`)},Nn=(e,t)=>new Error(`${Ne("sendMessage",t)} failed when sending an acknowledgment response to the ${it(t)}.`,{cause:e}),fl=e=>{throw new Error(`${Ne("sendMessage",e)} failed: the ${it(e)} is not listening to incoming messages.`)},dl=e=>{throw new Error(`${Ne("sendMessage",e)} failed: the ${it(e)} exited without listening to incoming messages.`)},pl=()=>new Error(`\`cancelSignal\` aborted: the ${it(!0)} disconnected.`),ml=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},hl=({error:e,methodName:t,isSubprocess:r})=>{if(e.code==="EPIPE")throw new Error(`${Ne(t,r)} cannot be used: the ${it(r)} is disconnecting.`,{cause:e})},gl=({error:e,methodName:t,isSubprocess:r,message:n})=>{if(Ex(e))throw new Error(`${Ne(t,r)}'s argument type is invalid: the message cannot be serialized: ${String(n)}.`,{cause:e})},Ex=({code:e,message:t})=>Tx.has(e)||Ox.some(r=>t.includes(r)),Tx=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),Ox=["could not be cloned","circular structure","call stack size exceeded"],Ne=(e,t,r="")=>e==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${Rx(t)}${e}(${r})`,Rx=e=>e?"":"subprocess.",it=e=>e?"parent process":"subprocess",Jt=e=>{e.connected&&e.disconnect()};var Be=()=>{let e={},t=new Promise((r,n)=>{Object.assign(e,{resolve:r,reject:n})});return Object.assign(t,e)};var Mn=(e,t="stdin")=>{let{options:n,fileDescriptors:s}=Ue.get(e),o=yl(s,t,!0),i=e.stdio[o];if(i===null)throw new TypeError(bl(o,t,n,!0));return i},Qt=(e,t="stdout")=>{let{options:n,fileDescriptors:s}=Ue.get(e),o=yl(s,t,!1),i=o==="all"?e.all:e.stdio[o];if(i==null)throw new TypeError(bl(o,t,n,!1));return i},Ue=new WeakMap,yl=(e,t,r)=>{let n=kx(t,r);return Cx(n,t,r,e),n},kx=(e,t)=>{let r=Ro(e);if(r!==void 0)return r;let{validOptions:n,defaultValue:s}=t?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${Ir(t)}" must not be "${e}".
33
+ It must be ${n} or "fd3", "fd4" (and so on).
34
+ It is optional and defaults to "${s}".`)},Cx=(e,t,r,n)=>{let s=n[wl(e)];if(s===void 0)throw new TypeError(`"${Ir(r)}" must not be ${t}. That file descriptor does not exist.
35
+ Please set the "stdio" option to ensure that file descriptor exists.`);if(s.direction==="input"&&!r)throw new TypeError(`"${Ir(r)}" must not be ${t}. It must be a readable stream, not writable.`);if(s.direction!=="input"&&r)throw new TypeError(`"${Ir(r)}" must not be ${t}. It must be a writable stream, not readable.`)},bl=(e,t,r,n)=>{if(e==="all"&&!r.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:s,optionValue:o}=Ax(e,r);return`The "${s}: ${Pn(o)}" option is incompatible with using "${Ir(n)}: ${Pn(t)}".
36
+ Please set this option with "pipe" instead.`},Ax=(e,{stdin:t,stdout:r,stderr:n,stdio:s})=>{let o=wl(e);return o===0&&t!==void 0?{optionName:"stdin",optionValue:t}:o===1&&r!==void 0?{optionName:"stdout",optionValue:r}:o===2&&n!==void 0?{optionName:"stderr",optionValue:n}:{optionName:`stdio[${o}]`,optionValue:s[o]}},wl=e=>e==="all"?1:e,Ir=e=>e?"to":"from",Pn=e=>typeof e=="string"?`'${e}'`:typeof e=="number"?`${e}`:"Stream";import{once as Px}from"node:events";import{addAbortListener as Ix}from"node:events";var bt=(e,t,r)=>{let n=e.getMaxListeners();n===0||n===Number.POSITIVE_INFINITY||(e.setMaxListeners(n+t),Ix(r,()=>{e.setMaxListeners(e.getMaxListeners()-t)}))};import{EventEmitter as Lx}from"node:events";import{once as $x}from"node:events";import{scheduler as Dx}from"node:timers/promises";var Fn=(e,t)=>{t&&zo(e)},zo=e=>{e.refCounted()},jn=(e,t)=>{t&&Wo(e)},Wo=e=>{e.unrefCounted()},Sl=(e,t)=>{t&&(Wo(e),Wo(e))},xl=(e,t)=>{t&&(zo(e),zo(e))};var vl=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n},s)=>{if(Tl(s)||Rl(s))return;Bn.has(e)||Bn.set(e,[]);let o=Bn.get(e);if(o.push(s),!(o.length>1))for(;o.length>0;){await Ol(e,n,s),await Dx.yield();let i=await El({wrappedMessage:o[0],anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n});o.shift(),n.emit("message",i),n.emit("message:done")}},_l=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n,boundOnMessage:s})=>{Zo();let o=Bn.get(e);for(;o?.length>0;)await $x(n,"message:done");e.removeListener("message",s),xl(t,r),n.connected=!1,n.emit("disconnect")},Bn=new WeakMap;var at=(e,t,r)=>{if(Un.has(e))return Un.get(e);let n=new Lx;return n.connected=!0,Un.set(e,n),Nx({ipcEmitter:n,anyProcess:e,channel:t,isSubprocess:r}),n},Un=new WeakMap,Nx=({ipcEmitter:e,anyProcess:t,channel:r,isSubprocess:n})=>{let s=vl.bind(void 0,{anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:e});t.on("message",s),t.once("disconnect",_l.bind(void 0,{anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:e,boundOnMessage:s})),Sl(r,n)},Gn=e=>{let t=Un.get(e);return t===void 0?e.channel!==null:t.connected};var kl=({anyProcess:e,channel:t,isSubprocess:r,message:n,strict:s})=>{if(!s)return n;let o=at(e,t,r),i=zn(e,o);return{id:Mx++,type:Vn,message:n,hasListeners:i}},Mx=0n,Cl=(e,t)=>{if(!(t?.type!==Vn||t.hasListeners))for(let{id:r}of e)r!==void 0&&qn[r].resolve({isDeadlock:!0,hasListeners:!1})},El=async({wrappedMessage:e,anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:s})=>{if(e?.type!==Vn||!t.connected)return e;let{id:o,message:i}=e,a={id:o,type:Il,message:zn(t,s)};try{await Wn({anyProcess:t,channel:r,isSubprocess:n,ipc:!0},a)}catch(c){s.emit("strict:error",c)}return i},Tl=e=>{if(e?.type!==Il)return!1;let{id:t,message:r}=e;return qn[t]?.resolve({isDeadlock:!1,hasListeners:r}),!0},Al=async(e,t,r)=>{if(e?.type!==Vn)return;let n=Be();qn[e.id]=n;let s=new AbortController;try{let{isDeadlock:o,hasListeners:i}=await Promise.race([n,Fx(t,r,s)]);o&&ll(r),i||fl(r)}finally{s.abort(),delete qn[e.id]}},qn={},Fx=async(e,t,{signal:r})=>{bt(e,1,r),await Px(e,"disconnect",{signal:r}),dl(t)},Vn="execa:ipc:request",Il="execa:ipc:response";var $l=(e,t,r)=>{$r.has(e)||$r.set(e,new Set);let n=$r.get(e),s=Be(),o=r?t.id:void 0,i={onMessageSent:s,id:o};return n.add(i),{outgoingMessages:n,outgoingMessage:i}},Dl=({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()},Ol=async(e,t,r)=>{for(;!zn(e,t)&&$r.get(e)?.size>0;){let n=[...$r.get(e)];Cl(n,r),await Promise.all(n.map(({onMessageSent:s})=>s))}},$r=new WeakMap,zn=(e,t)=>t.listenerCount("message")>jx(e),jx=e=>Ue.has(e)&&!Xe(Ue.get(e).options.buffer,"ipc")?1:0;var Wn=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},s,{strict:o=!1}={})=>{let i="sendMessage";return Kt({methodName:i,isSubprocess:r,ipc:n,isConnected:e.connected}),Ux({anyProcess:e,channel:t,methodName:i,isSubprocess:r,message:s,strict:o})},Ux=async({anyProcess:e,channel:t,methodName:r,isSubprocess:n,message:s,strict:o})=>{let i=kl({anyProcess:e,channel:t,isSubprocess:n,message:s,strict:o}),a=$l(e,i,o);try{await Yo({anyProcess:e,methodName:r,isSubprocess:n,wrappedMessage:i,message:s})}catch(c){throw Jt(e),c}finally{Dl(a)}},Yo=async({anyProcess:e,methodName:t,isSubprocess:r,wrappedMessage:n,message:s})=>{let o=Gx(e);try{await Promise.all([Al(n,e,r),o(n)])}catch(i){throw hl({error:i,methodName:t,isSubprocess:r}),gl({error:i,methodName:t,isSubprocess:r,message:s}),i}},Gx=e=>{if(Ho.has(e))return Ho.get(e);let t=Bx(e.send.bind(e));return Ho.set(e,t),t},Ho=new WeakMap;var Nl=(e,t)=>{let r="cancelSignal";return Vo(r,!1,e.connected),Yo({anyProcess:e,methodName:r,isSubprocess:!1,wrappedMessage:{type:Ml,message:t},message:t})},Pl=async({anyProcess:e,channel:t,isSubprocess:r,ipc:n})=>(await Vx({anyProcess:e,channel:t,isSubprocess:r,ipc:n}),Xo.signal),Vx=async({anyProcess:e,channel:t,isSubprocess:r,ipc:n})=>{if(!Ll){if(Ll=!0,!n){ml();return}if(t===null){Zo();return}at(e,t,r),await qx.yield()}},Ll=!1,Rl=e=>e?.type!==Ml?!1:(Xo.abort(e.message),!0),Ml="execa:ipc:cancel",Zo=()=>{Xo.abort(pl())},Xo=new AbortController;var Fl=({gracefulCancel:e,cancelSignal:t,ipc:r,serialization:n})=>{if(e){if(t===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(n==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},jl=({subprocess:e,cancelSignal:t,gracefulCancel:r,forceKillAfterDelay:n,context:s,controller:o})=>r?[zx({subprocess:e,cancelSignal:t,forceKillAfterDelay:n,context:s,controller:o})]:[],zx=async({subprocess:e,cancelSignal:t,forceKillAfterDelay:r,context:n,controller:{signal:s}})=>{await Ln(t,s);let o=Wx(t);throw await Nl(e,o),qo({kill:e.kill,forceKillAfterDelay:r,context:n,controllerSignal:s}),n.terminationReason??="gracefulCancel",t.reason},Wx=({reason:e})=>{if(!(e instanceof DOMException))return e;let t=new Error(e.message);return Object.defineProperty(t,"stack",{value:e.stack,enumerable:!1,configurable:!0,writable:!0}),t};import{setTimeout as Zx}from"node:timers/promises";var Bl=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},Ul=(e,t,r,n)=>t===0||t===void 0?[]:[Hx(e,t,r,n)],Hx=async(e,t,r,{signal:n})=>{throw await Zx(t,void 0,{signal:n}),r.terminationReason??="timeout",e.kill(),new Le};import{execPath as Yx,execArgv as Xx}from"node:process";import Gl from"node:path";var ql=({options:e})=>{if(e.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}},Vl=(e,t,{node:r=!1,nodePath:n=Yx,nodeOptions:s=Xx.filter(c=>!c.startsWith("--inspect")),cwd:o,execPath:i,...a})=>{if(i!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let c=Wt(n,'The "nodePath" option'),u=Gl.resolve(o,c),l={...a,nodePath:u,node:r,cwd:o};if(!r)return[e,t,l];if(Gl.basename(e,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[u,[...s,e,...t],{ipc:!0,...l,shell:!1}]};import{serialize as Kx}from"node:v8";var zl=({ipcInput:e,ipc:t,serialization:r})=>{if(e!==void 0){if(!t)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");ev[r](e)}},Jx=e=>{try{Kx(e)}catch(t){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:t})}},Qx=e=>{try{JSON.stringify(e)}catch(t){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:t})}},ev={advanced:Jx,json:Qx},Wl=async(e,t)=>{t!==void 0&&await e.sendMessage(t)};var Hl=({encoding:e})=>{if(Ko.has(e))return;let t=rv(e);if(t!==void 0)throw new TypeError(`Invalid option \`encoding: ${Zn(e)}\`.
37
+ Please rename it to ${Zn(t)}.`);let r=[...Ko].map(n=>Zn(n)).join(", ");throw new TypeError(`Invalid option \`encoding: ${Zn(e)}\`.
38
+ Please rename it to one of: ${r}.`)},tv=new Set(["utf8","utf16le"]),me=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),Ko=new Set([...tv,...me]),rv=e=>{if(e===null)return"buffer";if(typeof e!="string")return;let t=e.toLowerCase();if(t in Zl)return Zl[t];if(Ko.has(t))return t},Zl={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},Zn=e=>typeof e=="string"?`"${e}"`:String(e);import{statSync as nv}from"node:fs";import sv from"node:path";import ov from"node:process";var Yl=(e=Xl())=>{let t=Wt(e,'The "cwd" option');return sv.resolve(t)},Xl=()=>{try{return ov.cwd()}catch(e){throw e.message=`The current directory does not exist.
39
+ ${e.message}`,e}},Kl=(e,t)=>{if(t===Xl())return e;let r;try{r=nv(t)}catch(n){return`The "cwd" option is invalid: ${t}.
40
+ ${n.message}
41
+ ${e}`}return r.isDirectory()?e:`The "cwd" option is not a directory: ${t}.
42
+ ${e}`};var Hn=(e,t,r)=>{r.cwd=Yl(r.cwd);let[n,s,o]=Vl(e,t,r),{command:i,args:a,options:c}=Ql.default._parse(n,s,o),u=Fc(c),l=av(u);return Bl(l),Hl(l),zl(l),al(l),Fl(l),l.shell=_o(l.shell),l.env=cv(l),l.killSignal=rl(l.killSignal),l.forceKillAfterDelay=ol(l.forceKillAfterDelay),l.lines=l.lines.map((f,p)=>f&&!me.has(l.encoding)&&l.buffer[p]),Jl.platform==="win32"&&iv.basename(i,".exe")==="cmd"&&a.unshift("/q"),{file:i,commandArguments:a,options:l}},av=({extendEnv:e=!0,preferLocal:t=!1,cwd:r,localDir:n=r,encoding:s="utf8",reject:o=!0,cleanup:i=!0,all:a=!1,windowsHide:c=!0,killSignal:u="SIGTERM",forceKillAfterDelay:l=!0,gracefulCancel:f=!1,ipcInput:p,ipc:d=p!==void 0||f,serialization:b="advanced",...T})=>({...T,extendEnv:e,preferLocal:t,cwd:r,localDirectory:n,encoding:s,reject:o,cleanup:i,all:a,windowsHide:c,killSignal:u,forceKillAfterDelay:l,gracefulCancel:f,ipcInput:p,ipc:d,serialization:b}),cv=({env:e,extendEnv:t,preferLocal:r,node:n,localDirectory:s,nodePath:o})=>{let i=t?{...Jl.env,...e}:e;return r||n?zu({env:i,cwd:s,execPath:o,preferLocal:r,addExecPath:n}):i};import{inspect as Gv}from"node:util";function er(e){if(typeof e=="string")return uv(e);if(!(ArrayBuffer.isView(e)&&e.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return lv(e)}var uv=e=>e.at(-1)===ef?e.slice(0,e.at(-2)===tf?-2:-1):e,lv=e=>e.at(-1)===fv?e.subarray(0,e.at(-2)===dv?-2:-1):e,ef=`
43
+ `,fv=ef.codePointAt(0),tf="\r",dv=tf.codePointAt(0);import{on as Fv}from"node:events";import{finished as jv}from"node:stream/promises";function Pe(e,{checkOpen:t=!0}={}){return e!==null&&typeof e=="object"&&(e.writable||e.readable||!t||e.writable===void 0&&e.readable===void 0)&&typeof e.pipe=="function"}function Jo(e,{checkOpen:t=!0}={}){return Pe(e,{checkOpen:t})&&(e.writable||!t)&&typeof e.write=="function"&&typeof e.end=="function"&&typeof e.writable=="boolean"&&typeof e.writableObjectMode=="boolean"&&typeof e.destroy=="function"&&typeof e.destroyed=="boolean"}function wt(e,{checkOpen:t=!0}={}){return Pe(e,{checkOpen:t})&&(e.readable||!t)&&typeof e.read=="function"&&typeof e.readable=="boolean"&&typeof e.readableObjectMode=="boolean"&&typeof e.destroy=="function"&&typeof e.destroyed=="boolean"}function Qo(e,t){return Jo(e,t)&&wt(e,t)}var pv=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),ei=class{#t;#r;#e=!1;#n=void 0;constructor(t,r){this.#t=t,this.#r=r}next(){let t=()=>this.#o();return this.#n=this.#n?this.#n.then(t,t):t(),this.#n}return(t){let r=()=>this.#s(t);return this.#n?this.#n.then(r,r):r()}async#o(){if(this.#e)return{done:!0,value:void 0};let t;try{t=await this.#t.read()}catch(r){throw this.#n=void 0,this.#e=!0,this.#t.releaseLock(),r}return t.done&&(this.#n=void 0,this.#e=!0,this.#t.releaseLock()),t}async#s(t){if(this.#e)return{done:!0,value:t};if(this.#e=!0,!this.#r){let r=this.#t.cancel(t);return this.#t.releaseLock(),await r,{done:!0,value:t}}return this.#t.releaseLock(),{done:!0,value:t}}},ti=Symbol();function rf(){return this[ti].next()}Object.defineProperty(rf,"name",{value:"next"});function nf(e){return this[ti].return(e)}Object.defineProperty(nf,"name",{value:"return"});var mv=Object.create(pv,{next:{enumerable:!0,configurable:!0,writable:!0,value:rf},return:{enumerable:!0,configurable:!0,writable:!0,value:nf}});function ri({preventCancel:e=!1}={}){let t=this.getReader(),r=new ei(t,e),n=Object.create(mv);return n[ti]=r,n}var sf=e=>{if(wt(e,{checkOpen:!1})&&Dr.on!==void 0)return gv(e);if(typeof e?.[Symbol.asyncIterator]=="function")return e;if(hv.call(e)==="[object ReadableStream]")return ri.call(e);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:hv}=Object.prototype,gv=async function*(e){let t=new AbortController,r={};yv(e,t,r);try{for await(let[n]of Dr.on(e,"data",{signal:t.signal}))yield n}catch(n){if(r.error!==void 0)throw r.error;if(!t.signal.aborted)throw n}finally{e.destroy()}},yv=async(e,t,r)=>{try{await Dr.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(n){r.error=n}finally{t.abort()}},Dr={};var tr=async(e,{init:t,convertChunk:r,getSize:n,truncateChunk:s,addChunk:o,getFinalChunk:i,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{let u=sf(e),l=t();l.length=0;try{for await(let f of u){let p=wv(f),d=r[p](f,l);cf({convertedChunk:d,state:l,getSize:n,truncateChunk:s,addChunk:o,maxBuffer:c})}return bv({state:l,convertChunk:r,getSize:n,truncateChunk:s,addChunk:o,getFinalChunk:i,maxBuffer:c}),a(l)}catch(f){let p=typeof f=="object"&&f!==null?f:new Error(f);throw p.bufferedData=a(l),p}},bv=({state:e,getSize:t,truncateChunk:r,addChunk:n,getFinalChunk:s,maxBuffer:o})=>{let i=s(e);i!==void 0&&cf({convertedChunk:i,state:e,getSize:t,truncateChunk:r,addChunk:n,maxBuffer:o})},cf=({convertedChunk:e,state:t,getSize:r,truncateChunk:n,addChunk:s,maxBuffer:o})=>{let i=r(e),a=t.length+i;if(a<=o){of(e,t,s,a);return}let c=n(e,o-t.length);throw c!==void 0&&of(c,t,s,o),new Ge},of=(e,t,r,n)=>{t.contents=r(e,t,n),t.length=n},wv=e=>{let t=typeof e;if(t==="string")return"string";if(t!=="object"||e===null)return"others";if(globalThis.Buffer?.isBuffer(e))return"buffer";let r=af.call(e);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&af.call(e.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:af}=Object.prototype,Ge=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}};var Ke=e=>e,Lr=()=>{},Yn=({contents:e})=>e,Xn=e=>{throw new Error(`Streams in object mode are not supported: ${String(e)}`)},Kn=e=>e.length;async function Jn(e,t){return tr(e,_v,t)}var Sv=()=>({contents:[]}),xv=()=>1,vv=(e,{contents:t})=>(t.push(e),t),_v={init:Sv,convertChunk:{string:Ke,buffer:Ke,arrayBuffer:Ke,dataView:Ke,typedArray:Ke,others:Ke},getSize:xv,truncateChunk:Lr,addChunk:vv,getFinalChunk:Lr,finalize:Yn};async function Qn(e,t){return tr(e,$v,t)}var Ev=()=>({contents:new ArrayBuffer(0)}),Tv=e=>Ov.encode(e),Ov=new TextEncoder,uf=e=>new Uint8Array(e),lf=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Rv=(e,t)=>e.slice(0,t),kv=(e,{contents:t,length:r},n)=>{let s=pf()?Av(t,n):Cv(t,n);return new Uint8Array(s).set(e,r),s},Cv=(e,t)=>{if(t<=e.byteLength)return e;let r=new ArrayBuffer(df(t));return new Uint8Array(r).set(new Uint8Array(e),0),r},Av=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let r=new ArrayBuffer(t,{maxByteLength:df(t)});return new Uint8Array(r).set(new Uint8Array(e),0),r},df=e=>ff**Math.ceil(Math.log(e)/Math.log(ff)),ff=2,Iv=({contents:e,length:t})=>pf()?e:e.slice(0,t),pf=()=>"resize"in ArrayBuffer.prototype,$v={init:Ev,convertChunk:{string:Tv,buffer:uf,arrayBuffer:uf,dataView:lf,typedArray:lf,others:Xn},getSize:Kn,truncateChunk:Rv,addChunk:kv,getFinalChunk:Lr,finalize:Iv};async function ts(e,t){return tr(e,Mv,t)}var Dv=()=>({contents:"",textDecoder:new TextDecoder}),es=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),Lv=(e,{contents:t})=>t+e,Nv=(e,t)=>e.slice(0,t),Pv=({textDecoder:e})=>{let t=e.decode();return t===""?void 0:t},Mv={init:Dv,convertChunk:{string:Ke,buffer:es,arrayBuffer:es,dataView:es,typedArray:es,others:Xn},getSize:Kn,truncateChunk:Nv,addChunk:Lv,getFinalChunk:Pv,finalize:Yn};Object.assign(Dr,{on:Fv,finished:jv});var mf=({error:e,stream:t,readableObjectMode:r,lines:n,encoding:s,fdNumber:o})=>{if(!(e instanceof Ge))throw e;if(o==="all")return e;let i=Bv(r,n,s);throw e.maxBufferInfo={fdNumber:o,unit:i},t.destroy(),e},Bv=(e,t,r)=>e?"objects":t?"lines":r==="buffer"?"bytes":"characters",hf=(e,t,r)=>{if(t.length!==r)return;let n=new Ge;throw n.maxBufferInfo={fdNumber:"ipc"},n},gf=(e,t)=>{let{streamName:r,threshold:n,unit:s}=Uv(e,t);return`Command's ${r} was larger than ${n} ${s}`},Uv=(e,t)=>{if(e?.maxBufferInfo===void 0)return{streamName:"output",threshold:t[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:n}}=e;delete e.maxBufferInfo;let s=Xe(t,r);return r==="ipc"?{streamName:"IPC output",threshold:s,unit:"messages"}:{streamName:wn(r),threshold:s,unit:n}},yf=(e,t,r)=>e?.code==="ENOBUFS"&&t!==null&&t.some(n=>n!==null&&n.length>rs(r)),bf=(e,t,r)=>{if(!t)return e;let n=rs(r);return e.length>n?e.slice(0,n):e},rs=([,e])=>e;var Sf=({stdio:e,all:t,ipcOutput:r,originalError:n,signal:s,signalDescription:o,exitCode:i,escapedCommand:a,timedOut:c,isCanceled:u,isGracefullyCanceled:l,isMaxBuffer:f,isForcefullyTerminated:p,forceKillAfterDelay:d,killSignal:b,maxBuffer:T,timeout:N,cwd:P})=>{let U=n?.code,H=qv({originalError:n,timedOut:c,timeout:N,isMaxBuffer:f,maxBuffer:T,errorCode:U,signal:s,signalDescription:o,exitCode:i,isCanceled:u,isGracefullyCanceled:l,isForcefullyTerminated:p,forceKillAfterDelay:d,killSignal:b}),Y=zv(n,P),Se=Y===void 0?"":`
44
+ ${Y}`,ae=`${H}: ${a}${Se}`,Ae=t===void 0?[e[2],e[1]]:[t],Ie=[ae,...Ae,...e.slice(3),r.map(xe=>Wv(xe)).join(`
45
+ `)].map(xe=>Rr(er(Zv(xe)))).filter(Boolean).join(`
46
+
47
+ `);return{originalMessage:Y,shortMessage:ae,message:Ie}},qv=({originalError:e,timedOut:t,timeout:r,isMaxBuffer:n,maxBuffer:s,errorCode:o,signal:i,signalDescription:a,exitCode:c,isCanceled:u,isGracefullyCanceled:l,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:d})=>{let b=Vv(f,p);return t?`Command timed out after ${r} milliseconds${b}`:l?i===void 0?`Command was gracefully canceled with exit code ${c}`:f?`Command was gracefully canceled${b}`:`Command was gracefully canceled with ${i} (${a})`:u?`Command was canceled${b}`:n?`${gf(e,s)}${b}`:o!==void 0?`Command failed with ${o}${b}`:f?`Command was killed with ${d} (${Dn(d)})${b}`:i!==void 0?`Command was killed with ${i} (${a})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},Vv=(e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:"",zv=(e,t)=>{if(e instanceof Le)return;let r=Hu(e)?e.originalMessage:String(e?.message??e),n=Rr(Kl(r,t));return n===""?void 0:n},Wv=e=>typeof e=="string"?e:Gv(e),Zv=e=>Array.isArray(e)?e.map(t=>er(wf(t))).filter(Boolean).join(`
48
+ `):wf(e),wf=e=>typeof e=="string"?e:X(e)?yn(e):"";var ns=({command:e,escapedCommand:t,stdio:r,all:n,ipcOutput:s,options:{cwd:o},startTime:i})=>xf({command:e,escapedCommand:t,cwd:o,durationMs:Io(i),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:n,stdio:r,ipcOutput:s,pipedFrom:[]}),rr=({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:s,startTime:o,isSync:i})=>Nr({error:e,command:t,escapedCommand:r,startTime:o,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:s,isSync:i}),Nr=({error:e,command:t,escapedCommand:r,startTime:n,timedOut:s,isCanceled:o,isGracefullyCanceled:i,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:u,signal:l,stdio:f,all:p,ipcOutput:d,options:{timeoutDuration:b,timeout:T=b,forceKillAfterDelay:N,killSignal:P,cwd:U,maxBuffer:H},isSync:Y})=>{let{exitCode:Se,signal:ae,signalDescription:Ae}=Yv(u,l),{originalMessage:Ie,shortMessage:xe,message:Er}=Sf({stdio:f,all:p,ipcOutput:d,originalError:e,signal:ae,signalDescription:Ae,exitCode:Se,escapedCommand:r,timedOut:s,isCanceled:o,isGracefullyCanceled:i,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:N,killSignal:P,maxBuffer:H,timeout:T,cwd:U}),ht=Wu(e,Er,Y);return Object.assign(ht,Hv({error:ht,command:t,escapedCommand:r,startTime:n,timedOut:s,isCanceled:o,isGracefullyCanceled:i,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:Se,signal:ae,signalDescription:Ae,stdio:f,all:p,ipcOutput:d,cwd:U,originalMessage:Ie,shortMessage:xe})),ht},Hv=({error:e,command:t,escapedCommand:r,startTime:n,timedOut:s,isCanceled:o,isGracefullyCanceled:i,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:u,signal:l,signalDescription:f,stdio:p,all:d,ipcOutput:b,cwd:T,originalMessage:N,shortMessage:P})=>xf({shortMessage:P,originalMessage:N,command:t,escapedCommand:r,cwd:T,durationMs:Io(n),failed:!0,timedOut:s,isCanceled:o,isGracefullyCanceled:i,isTerminated:l!==void 0,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:u,signal:l,signalDescription:f,code:e.cause?.code,stdout:p[1],stderr:p[2],all:d,stdio:p,ipcOutput:b,pipedFrom:[]}),xf=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0)),Yv=(e,t)=>{let r=e===null?void 0:e,n=t===null?void 0:t,s=n===void 0?void 0:Dn(t);return{exitCode:r,signal:n,signalDescription:s}};var vf=e=>Number.isFinite(e)?e:0;function Xv(e){return{days:Math.trunc(e/864e5),hours:Math.trunc(e/36e5%24),minutes:Math.trunc(e/6e4%60),seconds:Math.trunc(e/1e3%60),milliseconds:Math.trunc(e%1e3),microseconds:Math.trunc(vf(e*1e3)%1e3),nanoseconds:Math.trunc(vf(e*1e6)%1e3)}}function Kv(e){return{days:e/86400000n,hours:e/3600000n%24n,minutes:e/60000n%60n,seconds:e/1000n%60n,milliseconds:e%1000n,microseconds:0n,nanoseconds:0n}}function ni(e){switch(typeof e){case"number":{if(Number.isFinite(e))return Xv(e);break}case"bigint":return Kv(e)}throw new TypeError("Expected a finite number or bigint")}var Jv=e=>e===0||e===0n,Qv=(e,t)=>t===1||t===1n?e:`${e}s`,e_=1e-7,t_=24n*60n*60n*1000n;function si(e,t){let r=typeof e=="bigint";if(!r&&!Number.isFinite(e))throw new TypeError("Expected a finite number or bigint");t={...t};let n=e<0?"-":"";e=e<0?-e:e,t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.unitCount=1,t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);let s=[],o=(l,f)=>{let p=Math.floor(l*10**f+e_);return(Math.round(p)/10**f).toFixed(f)},i=(l,f,p,d)=>{if(!((s.length===0||!t.colonNotation)&&Jv(l)&&!(t.colonNotation&&p==="m"))){if(d??=String(l),t.colonNotation){let b=d.includes(".")?d.split(".")[0].length:d.length,T=s.length>0?2:1;d="0".repeat(Math.max(0,T-b))+d}else d+=t.verbose?" "+Qv(f,l):p;s.push(d)}},a=ni(e),c=BigInt(a.days);if(t.hideYearAndDays?i(BigInt(c)*24n+BigInt(a.hours),"hour","h"):(t.hideYear?i(c,"day","d"):(i(c/365n,"year","y"),i(c%365n,"day","d")),i(Number(a.hours),"hour","h")),i(Number(a.minutes),"minute","m"),!t.hideSeconds)if(t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3){let l=Number(a.seconds),f=Number(a.milliseconds),p=Number(a.microseconds),d=Number(a.nanoseconds);if(i(l,"second","s"),t.formatSubMilliseconds)i(f,"millisecond","ms"),i(p,"microsecond","\xB5s"),i(d,"nanosecond","ns");else{let b=f+p/1e3+d/1e6,T=typeof t.millisecondsDecimalDigits=="number"?t.millisecondsDecimalDigits:0,N=b>=1?Math.round(b):Math.ceil(b),P=T?b.toFixed(T):N;i(Number.parseFloat(P),"millisecond","ms",P)}}else{let l=(r?Number(e%t_):e)/1e3%60,f=typeof t.secondsDecimalDigits=="number"?t.secondsDecimalDigits:1,p=o(l,f),d=t.keepDecimalsOnWholeSeconds?p:p.replace(/\.0+$/,"");i(Number.parseFloat(d),"second","s",d)}if(s.length===0)return n+"0"+(t.verbose?" milliseconds":"ms");let u=t.colonNotation?":":" ";return typeof t.unitCount=="number"&&(s=s.slice(0,Math.max(t.unitCount,1))),n+s.join(u)}var _f=(e,t)=>{e.failed&&je({type:"error",verboseMessage:e.shortMessage,verboseInfo:t,result:e})};var Ef=(e,t)=>{Zt(t)&&(_f(e,t),r_(e,t))},r_=(e,t)=>{let r=`(done in ${si(e.durationMs)})`;je({type:"duration",verboseMessage:r,verboseInfo:t,result:e})};var nr=(e,t,{reject:r})=>{if(Ef(e,t),e.failed&&r)throw e;return e};import{readFileSync as Kf}from"node:fs";var Rf=(e,t)=>St(e)?"asyncGenerator":Af(e)?"generator":ss(e)?"fileUrl":a_(e)?"filePath":l_(e)?"webStream":Pe(e,{checkOpen:!1})?"native":X(e)?"uint8Array":f_(e)?"asyncIterable":d_(e)?"iterable":ai(e)?kf({transform:e},t):i_(e)?n_(e,t):"native",n_=(e,t)=>Qo(e.transform,{checkOpen:!1})?s_(e,t):ai(e.transform)?kf(e,t):o_(e,t),s_=(e,t)=>(Cf(e,t,"Duplex stream"),"duplex"),kf=(e,t)=>(Cf(e,t,"web TransformStream"),"webTransform"),Cf=({final:e,binary:t,objectMode:r},n,s)=>{Tf(e,`${n}.final`,s),Tf(t,`${n}.binary`,s),oi(r,`${n}.objectMode`)},Tf=(e,t,r)=>{if(e!==void 0)throw new TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${r}.`)},o_=({transform:e,final:t,binary:r,objectMode:n},s)=>{if(e!==void 0&&!Of(e))throw new TypeError(`The \`${s}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(Qo(t,{checkOpen:!1}))throw new TypeError(`The \`${s}.final\` option must not be a Duplex stream.`);if(ai(t))throw new TypeError(`The \`${s}.final\` option must not be a web TransformStream.`);if(t!==void 0&&!Of(t))throw new TypeError(`The \`${s}.final\` option must be a generator.`);return oi(r,`${s}.binary`),oi(n,`${s}.objectMode`),St(e)||St(t)?"asyncGenerator":"generator"},oi=(e,t)=>{if(e!==void 0&&typeof e!="boolean")throw new TypeError(`The \`${t}\` option must use a boolean.`)},Of=e=>St(e)||Af(e),St=e=>Object.prototype.toString.call(e)==="[object AsyncGeneratorFunction]",Af=e=>Object.prototype.toString.call(e)==="[object GeneratorFunction]",i_=e=>z(e)&&(e.transform!==void 0||e.final!==void 0),ss=e=>Object.prototype.toString.call(e)==="[object URL]",If=e=>ss(e)&&e.protocol!=="file:",a_=e=>z(e)&&Object.keys(e).length>0&&Object.keys(e).every(t=>c_.has(t))&&ii(e.file),c_=new Set(["file","append"]),ii=e=>typeof e=="string",$f=(e,t)=>e==="native"&&typeof t=="string"&&!u_.has(t),u_=new Set(["ipc","ignore","inherit","overlapped","pipe"]),Df=e=>Object.prototype.toString.call(e)==="[object ReadableStream]",os=e=>Object.prototype.toString.call(e)==="[object WritableStream]",l_=e=>Df(e)||os(e),ai=e=>Df(e?.readable)&&os(e?.writable),f_=e=>Lf(e)&&typeof e[Symbol.asyncIterator]=="function",d_=e=>Lf(e)&&typeof e[Symbol.iterator]=="function",Lf=e=>typeof e=="object"&&e!==null,_e=new Set(["generator","asyncGenerator","duplex","webTransform"]),is=new Set(["fileUrl","filePath","fileNumber"]),ci=new Set(["fileUrl","filePath"]),Nf=new Set([...ci,"webStream","nodeStream"]),Pf=new Set(["webTransform","duplex"]),ct={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};var ui=(e,t,r,n)=>n==="output"?p_(e,t,r):m_(e,t,r),p_=(e,t,r)=>{let n=t!==0&&r[t-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:e??n}},m_=(e,t,r)=>{let n=t===0?e===!0:r[t-1].value.readableObjectMode,s=t!==r.length-1&&(e??n);return{writableObjectMode:n,readableObjectMode:s}},Mf=(e,t)=>{let r=e.findLast(({type:n})=>_e.has(n));return r===void 0?!1:t==="input"?r.value.writableObjectMode:r.value.readableObjectMode};var Ff=(e,t,r,n)=>[...e.filter(({type:s})=>!_e.has(s)),...h_(e,t,r,n)],h_=(e,t,r,{encoding:n})=>{let s=e.filter(({type:i})=>_e.has(i)),o=Array.from({length:s.length});for(let[i,a]of Object.entries(s))o[i]=g_({stdioItem:a,index:Number(i),newTransforms:o,optionName:t,direction:r,encoding:n});return S_(o,r)},g_=({stdioItem:e,stdioItem:{type:t},index:r,newTransforms:n,optionName:s,direction:o,encoding:i})=>t==="duplex"?y_({stdioItem:e,optionName:s}):t==="webTransform"?b_({stdioItem:e,index:r,newTransforms:n,direction:o}):w_({stdioItem:e,index:r,newTransforms:n,direction:o,encoding:i}),y_=({stdioItem:e,stdioItem:{value:{transform:t,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:s=n}},optionName:o})=>{if(s&&!n)throw new TypeError(`The \`${o}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!s&&n)throw new TypeError(`The \`${o}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...e,value:{transform:t,writableObjectMode:r,readableObjectMode:n}}},b_=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:n,direction:s})=>{let{transform:o,objectMode:i}=z(t)?t:{transform:t},{writableObjectMode:a,readableObjectMode:c}=ui(i,r,n,s);return{...e,value:{transform:o,writableObjectMode:a,readableObjectMode:c}}},w_=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:n,direction:s,encoding:o})=>{let{transform:i,final:a,binary:c=!1,preserveNewlines:u=!1,objectMode:l}=z(t)?t:{transform:t},f=c||me.has(o),{writableObjectMode:p,readableObjectMode:d}=ui(l,r,n,s);return{...e,value:{transform:i,final:a,binary:f,preserveNewlines:u,writableObjectMode:p,readableObjectMode:d}}},S_=(e,t)=>t==="input"?e.reverse():e;import li from"node:process";var jf=(e,t,r)=>{let n=e.map(s=>x_(s,t));if(n.includes("input")&&n.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return n.find(Boolean)??E_},x_=({type:e,value:t},r)=>v_[r]??Bf[e](t),v_=["input","output","output"],sr=()=>{},fi=()=>"input",Bf={generator:sr,asyncGenerator:sr,fileUrl:sr,filePath:sr,iterable:fi,asyncIterable:fi,uint8Array:fi,webStream:e=>os(e)?"output":"input",nodeStream(e){return wt(e,{checkOpen:!1})?Jo(e,{checkOpen:!1})?void 0:"input":"output"},webTransform:sr,duplex:sr,native(e){let t=__(e);if(t!==void 0)return t;if(Pe(e,{checkOpen:!1}))return Bf.nodeStream(e)}},__=e=>{if([0,li.stdin].includes(e))return"input";if([1,2,li.stdout,li.stderr].includes(e))return"output"},E_="output";var Uf=(e,t)=>t&&!e.includes("ipc")?[...e,"ipc"]:e;var Gf=({stdio:e,ipc:t,buffer:r,...n},s,o)=>{let i=T_(e,n).map((a,c)=>qf(a,c));return o?R_(i,r,s):Uf(i,t)},T_=(e,t)=>{if(e===void 0)return ve.map(n=>t[n]);if(O_(t))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${ve.map(n=>`\`${n}\``).join(", ")}`);if(typeof e=="string")return[e,e,e];if(!Array.isArray(e))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);let r=Math.max(e.length,ve.length);return Array.from({length:r},(n,s)=>e[s])},O_=e=>ve.some(t=>e[t]!==void 0),qf=(e,t)=>Array.isArray(e)?e.map(r=>qf(r,t)):e??(t>=ve.length?"ignore":"pipe"),R_=(e,t,r)=>e.map((n,s)=>!t[s]&&s!==0&&!Ht(r,s)&&k_(n)?"ignore":n),k_=e=>e==="pipe"||Array.isArray(e)&&e.every(t=>t==="pipe");import{readFileSync as C_}from"node:fs";import A_ from"node:tty";var zf=({stdioItem:e,stdioItem:{type:t},isStdioArray:r,fdNumber:n,direction:s,isSync:o})=>!r||t!=="native"?e:o?I_({stdioItem:e,fdNumber:n,direction:s}):L_({stdioItem:e,fdNumber:n}),I_=({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:n,direction:s})=>{let o=$_({value:t,optionName:r,fdNumber:n,direction:s});if(o!==void 0)return o;if(Pe(t,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e},$_=({value:e,optionName:t,fdNumber:r,direction:n})=>{let s=D_(e,r);if(s!==void 0){if(n==="output")return{type:"fileNumber",value:s,optionName:t};if(A_.isatty(s))throw new TypeError(`The \`${t}: ${Pn(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:Ye(C_(s)),optionName:t}}},D_=(e,t)=>{if(e==="inherit")return t;if(typeof e=="number")return e;let r=bn.indexOf(e);if(r!==-1)return r},L_=({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:n})=>t==="inherit"?{type:"nodeStream",value:Vf(n,t,r),optionName:r}:typeof t=="number"?{type:"nodeStream",value:Vf(t,t,r),optionName:r}:Pe(t,{checkOpen:!1})?{type:"nodeStream",value:t,optionName:r}:e,Vf=(e,t,r)=>{let n=bn[e];if(n===void 0)throw new TypeError(`The \`${r}: ${t}\` option is invalid: no such standard stream.`);return n};var Wf=({input:e,inputFile:t},r)=>r===0?[...N_(e),...M_(t)]:[],N_=e=>e===void 0?[]:[{type:P_(e),value:e,optionName:"input"}],P_=e=>{if(wt(e,{checkOpen:!1}))return"nodeStream";if(typeof e=="string")return"string";if(X(e))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},M_=e=>e===void 0?[]:[{...F_(e),optionName:"inputFile"}],F_=e=>{if(ss(e))return{type:"fileUrl",value:e};if(ii(e))return{type:"filePath",value:{file:e}};throw new Error("The `inputFile` option must be a file path string or a file URL.")};var Zf=e=>e.filter((t,r)=>e.every((n,s)=>t.value!==n.value||r>=s||t.type==="generator"||t.type==="asyncGenerator")),Hf=({stdioItem:{type:e,value:t,optionName:r},direction:n,fileDescriptors:s,isSync:o})=>{let i=j_(s,e);if(i.length!==0){if(o){B_({otherStdioItems:i,type:e,value:t,optionName:r,direction:n});return}if(Nf.has(e))return Yf({otherStdioItems:i,type:e,value:t,optionName:r,direction:n});Pf.has(e)&&G_({otherStdioItems:i,type:e,value:t,optionName:r})}},j_=(e,t)=>e.flatMap(({direction:r,stdioItems:n})=>n.filter(s=>s.type===t).map(s=>({...s,direction:r}))),B_=({otherStdioItems:e,type:t,value:r,optionName:n,direction:s})=>{ci.has(t)&&Yf({otherStdioItems:e,type:t,value:r,optionName:n,direction:s})},Yf=({otherStdioItems:e,type:t,value:r,optionName:n,direction:s})=>{let o=e.filter(a=>U_(a,r));if(o.length===0)return;let i=o.find(a=>a.direction!==s);return Xf(i,n,t),s==="output"?o[0].stream:void 0},U_=({type:e,value:t},r)=>e==="filePath"?t.file===r.file:e==="fileUrl"?t.href===r.href:t===r,G_=({otherStdioItems:e,type:t,value:r,optionName:n})=>{let s=e.find(({value:{transform:o}})=>o===r.transform);Xf(s,n,t)},Xf=(e,t,r)=>{if(e!==void 0)throw new TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${ct[r]} that is the same.`)};var as=(e,t,r,n)=>{let o=Gf(t,r,n).map((a,c)=>q_({stdioOption:a,fdNumber:c,options:t,isSync:n})),i=K_({initialFileDescriptors:o,addProperties:e,options:t,isSync:n});return t.stdio=i.map(({stdioItems:a})=>eE(a)),i},q_=({stdioOption:e,fdNumber:t,options:r,isSync:n})=>{let s=wn(t),{stdioItems:o,isStdioArray:i}=V_({stdioOption:e,fdNumber:t,options:r,optionName:s}),a=jf(o,t,s),c=o.map(f=>zf({stdioItem:f,isStdioArray:i,fdNumber:t,direction:a,isSync:n})),u=Ff(c,s,a,r),l=Mf(u,a);return X_(u,l),{direction:a,objectMode:l,stdioItems:u}},V_=({stdioOption:e,fdNumber:t,options:r,optionName:n})=>{let o=[...(Array.isArray(e)?e:[e]).map(c=>z_(c,n)),...Wf(r,t)],i=Zf(o),a=i.length>1;return W_(i,a,n),H_(i),{stdioItems:i,isStdioArray:a}},z_=(e,t)=>({type:Rf(e,t),value:e,optionName:t}),W_=(e,t,r)=>{if(e.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(t){for(let{value:n,optionName:s}of e)if(Z_.has(n))throw new Error(`The \`${s}\` option must not include \`${n}\`.`)}},Z_=new Set(["ignore","ipc"]),H_=e=>{for(let t of e)Y_(t)},Y_=({type:e,value:t,optionName:r})=>{if(If(t))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme.
49
+ For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if($f(e,t))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},X_=(e,t)=>{if(!t)return;let r=e.find(({type:n})=>is.has(n));if(r!==void 0)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},K_=({initialFileDescriptors:e,addProperties:t,options:r,isSync:n})=>{let s=[];try{for(let o of e)s.push(J_({fileDescriptor:o,fileDescriptors:s,addProperties:t,options:r,isSync:n}));return s}catch(o){throw di(s),o}},J_=({fileDescriptor:{direction:e,objectMode:t,stdioItems:r},fileDescriptors:n,addProperties:s,options:o,isSync:i})=>{let a=r.map(c=>Q_({stdioItem:c,addProperties:s,direction:e,options:o,fileDescriptors:n,isSync:i}));return{direction:e,objectMode:t,stdioItems:a}},Q_=({stdioItem:e,addProperties:t,direction:r,options:n,fileDescriptors:s,isSync:o})=>{let i=Hf({stdioItem:e,direction:r,fileDescriptors:s,isSync:o});return i!==void 0?{...e,stream:i}:{...e,...t[r][e.type](e,n)}},di=e=>{for(let{stdioItems:t}of e)for(let{stream:r}of t)r!==void 0&&!De(r)&&r.destroy()},eE=e=>{if(e.length>1)return e.some(({value:n})=>n==="overlapped")?"overlapped":"pipe";let[{type:t,value:r}]=e;return t==="native"?r:"pipe"};var Qf=(e,t)=>as(rE,e,t,!0),qe=({type:e,optionName:t})=>{ed(t,ct[e])},tE=({optionName:e,value:t})=>((t==="ipc"||t==="overlapped")&&ed(e,`"${t}"`),{}),ed=(e,t)=>{throw new TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},Jf={generator(){},asyncGenerator:qe,webStream:qe,nodeStream:qe,webTransform:qe,duplex:qe,asyncIterable:qe,native:tE},rE={input:{...Jf,fileUrl:({value:e})=>({contents:[Ye(Kf(e))]}),filePath:({value:{file:e}})=>({contents:[Ye(Kf(e))]}),fileNumber:qe,iterable:({value:e})=>({contents:[...e]}),string:({value:e})=>({contents:[e]}),uint8Array:({value:e})=>({contents:[e]})},output:{...Jf,fileUrl:({value:e})=>({path:e}),filePath:({value:{file:e,append:t}})=>({path:e,append:t}),fileNumber:({value:e})=>({path:e}),iterable:qe,string:qe,uint8Array:qe}};var Je=(e,{stripFinalNewline:t},r)=>pi(t,r)&&e!==void 0&&!Array.isArray(e)?er(e):e,pi=(e,t)=>t==="all"?e[1]||e[2]:e[t];import{Transform as _E,getDefaultHighWaterMark as fd}from"node:stream";var cs=(e,t,r,n)=>e||r?void 0:rd(t,n),hi=(e,t,r)=>r?e.flatMap(n=>td(n,t)):td(e,t),td=(e,t)=>{let{transform:r,final:n}=rd(t,{});return[...r(e),...n()]},rd=(e,t)=>(t.previousChunks="",{transform:nE.bind(void 0,t,e),final:oE.bind(void 0,t)}),nE=function*(e,t,r){if(typeof r!="string"){yield r;return}let{previousChunks:n}=e,s=-1;for(let o=0;o<r.length;o+=1)if(r[o]===`
50
+ `){let i=sE(r,o,t,e),a=r.slice(s+1,o+1-i);n.length>0&&(a=mi(n,a),n=""),yield a,s=o}s!==r.length-1&&(n=mi(n,r.slice(s+1))),e.previousChunks=n},sE=(e,t,r,n)=>r?0:(n.isWindowsNewline=t!==0&&e[t-1]==="\r",n.isWindowsNewline?2:1),oE=function*({previousChunks:e}){e.length>0&&(yield e)},nd=({binary:e,preserveNewlines:t,readableObjectMode:r,state:n})=>e||t||r?void 0:{transform:iE.bind(void 0,n)},iE=function*({isWindowsNewline:e=!1},t){let{unixNewline:r,windowsNewline:n,LF:s,concatBytes:o}=typeof t=="string"?aE:uE;if(t.at(-1)===s){yield t;return}yield o(t,e?n:r)},mi=(e,t)=>`${e}${t}`,aE={windowsNewline:`\r
51
+ `,unixNewline:`
52
+ `,LF:`
53
+ `,concatBytes:mi},cE=(e,t)=>{let r=new Uint8Array(e.length+t.length);return r.set(e,0),r.set(t,e.length),r},uE={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:cE};import{Buffer as lE}from"node:buffer";var sd=(e,t)=>e?void 0:fE.bind(void 0,t),fE=function*(e,t){if(typeof t!="string"&&!X(t)&&!lE.isBuffer(t))throw new TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},od=(e,t)=>e?dE.bind(void 0,t):pE.bind(void 0,t),dE=function*(e,t){id(e,t),yield t},pE=function*(e,t){if(id(e,t),typeof t!="string"&&!X(t))throw new TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},id=(e,t)=>{if(t==null)throw new TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.
54
+ Instead, \`yield\` should either be called with a value, or not be called at all. For example:
55
+ if (condition) { yield value; }`)};import{Buffer as mE}from"node:buffer";import{StringDecoder as hE}from"node:string_decoder";var us=(e,t,r)=>{if(r)return;if(e)return{transform:gE.bind(void 0,new TextEncoder)};let n=new hE(t);return{transform:yE.bind(void 0,n),final:bE.bind(void 0,n)}},gE=function*(e,t){mE.isBuffer(t)?yield Ye(t):typeof t=="string"?yield e.encode(t):yield t},yE=function*(e,t){yield X(t)?e.write(t):t},bE=function*(e){let t=e.end();t!==""&&(yield t)};import{callbackify as ad}from"node:util";var gi=ad(async(e,t,r,n)=>{t.currentIterable=e(...r);try{for await(let s of t.currentIterable)n.push(s)}finally{delete t.currentIterable}}),ls=async function*(e,t,r){if(r===t.length){yield e;return}let{transform:n=SE}=t[r];for await(let s of n(e))yield*ls(s,t,r+1)},cd=async function*(e){for(let[t,{final:r}]of Object.entries(e))yield*wE(r,Number(t),e)},wE=async function*(e,t,r){if(e!==void 0)for await(let n of e())yield*ls(n,r,t+1)},ud=ad(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),SE=function*(e){yield e};var yi=(e,t,r,n)=>{try{for(let s of e(...t))r.push(s);n()}catch(s){n(s)}},ld=(e,t)=>[...t.flatMap(r=>[...xt(r,e,0)]),...Pr(e)],xt=function*(e,t,r){if(r===t.length){yield e;return}let{transform:n=vE}=t[r];for(let s of n(e))yield*xt(s,t,r+1)},Pr=function*(e){for(let[t,{final:r}]of Object.entries(e))yield*xE(r,Number(t),e)},xE=function*(e,t,r){if(e!==void 0)for(let n of e())yield*xt(n,r,t+1)},vE=function*(e){yield e};var bi=({value:e,value:{transform:t,final:r,writableObjectMode:n,readableObjectMode:s},optionName:o},{encoding:i})=>{let a={},c=dd(e,i,o),u=St(t),l=St(r),f=u?gi.bind(void 0,ls,a):yi.bind(void 0,xt),p=u||l?gi.bind(void 0,cd,a):yi.bind(void 0,Pr),d=u||l?ud.bind(void 0,a):void 0;return{stream:new _E({writableObjectMode:n,writableHighWaterMark:fd(n),readableObjectMode:s,readableHighWaterMark:fd(s),transform(T,N,P){f([T,c,0],this,P)},flush(T){p([c],this,T)},destroy:d})}},fs=(e,t,r,n)=>{let s=t.filter(({type:i})=>i==="generator"),o=n?s.reverse():s;for(let{value:i,optionName:a}of o){let c=dd(i,r,a);e=ld(c,e)}return e},dd=({transform:e,final:t,binary:r,writableObjectMode:n,readableObjectMode:s,preserveNewlines:o},i,a)=>{let c={};return[{transform:sd(n,a)},us(r,i,n),cs(r,o,n,c),{transform:e,final:t},{transform:od(s,a)},nd({binary:r,preserveNewlines:o,readableObjectMode:s,state:c})].filter(Boolean)};var pd=(e,t)=>{for(let r of EE(e))TE(e,r,t)},EE=e=>new Set(Object.entries(e).filter(([,{direction:t}])=>t==="input").map(([t])=>Number(t))),TE=(e,t,r)=>{let{stdioItems:n}=e[t],s=n.filter(({contents:a})=>a!==void 0);if(s.length===0)return;if(t!==0){let[{type:a,optionName:c}]=s;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${ct[a]} with synchronous methods.`)}let i=s.map(({contents:a})=>a).map(a=>OE(a,n));r.input=Or(i)},OE=(e,t)=>{let r=fs(e,t,"utf8",!0);return RE(r),Or(r)},RE=e=>{let t=e.find(r=>typeof r!="string"&&!X(r));if(t!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)};import{writeFileSync as IE,appendFileSync as $E}from"node:fs";var ds=({stdioItems:e,encoding:t,verboseInfo:r,fdNumber:n})=>n!=="all"&&Ht(r,n)&&!me.has(t)&&kE(n)&&(e.some(({type:s,value:o})=>s==="native"&&CE.has(o))||e.every(({type:s})=>_e.has(s))),kE=e=>e===1||e===2,CE=new Set(["pipe","overlapped"]),md=async(e,t,r,n)=>{for await(let s of e)AE(t)||gd(s,r,n)},hd=(e,t,r)=>{for(let n of e)gd(n,t,r)},AE=e=>e._readableState.pipes.length>0,gd=(e,t,r)=>{let n=Tn(e);je({type:"output",verboseMessage:n,fdNumber:t,verboseInfo:r})};var yd=({fileDescriptors:e,syncResult:{output:t},options:r,isMaxBuffer:n,verboseInfo:s})=>{if(t===null)return{output:Array.from({length:3})};let o={},i=new Set([]);return{output:t.map((c,u)=>DE({result:c,fileDescriptors:e,fdNumber:u,state:o,outputFiles:i,isMaxBuffer:n,verboseInfo:s},r)),...o}},DE=({result:e,fileDescriptors:t,fdNumber:r,state:n,outputFiles:s,isMaxBuffer:o,verboseInfo:i},{buffer:a,encoding:c,lines:u,stripFinalNewline:l,maxBuffer:f})=>{if(e===null)return;let p=bf(e,o,f),d=Ye(p),{stdioItems:b,objectMode:T}=t[r],N=LE([d],b,c,n),{serializedResult:P,finalResult:U=P}=NE({chunks:N,objectMode:T,encoding:c,lines:u,stripFinalNewline:l,fdNumber:r});PE({serializedResult:P,fdNumber:r,state:n,verboseInfo:i,encoding:c,stdioItems:b,objectMode:T});let H=a[r]?U:void 0;try{return n.error===void 0&&ME(P,b,s),H}catch(Y){return n.error=Y,H}},LE=(e,t,r,n)=>{try{return fs(e,t,r,!1)}catch(s){return n.error=s,e}},NE=({chunks:e,objectMode:t,encoding:r,lines:n,stripFinalNewline:s,fdNumber:o})=>{if(t)return{serializedResult:e};if(r==="buffer")return{serializedResult:Or(e)};let i=Ic(e,r);return n[o]?{serializedResult:i,finalResult:hi(i,!s[o],t)}:{serializedResult:i}},PE=({serializedResult:e,fdNumber:t,state:r,verboseInfo:n,encoding:s,stdioItems:o,objectMode:i})=>{if(!ds({stdioItems:o,encoding:s,verboseInfo:n,fdNumber:t}))return;let a=hi(e,!1,i);try{hd(a,t,n)}catch(c){r.error??=c}},ME=(e,t,r)=>{for(let{path:n,append:s}of t.filter(({type:o})=>is.has(o))){let o=typeof n=="string"?n:n.toString();s||r.has(o)?$E(n,e):(r.add(o),IE(n,e))}};var bd=([,e,t],r)=>{if(r.all)return e===void 0?t:t===void 0?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,Je(t,r,"all")]:Array.isArray(t)?[Je(e,r,"all"),...t]:X(e)&&X(t)?Eo([e,t]):`${e}${t}`};import{once as wi}from"node:events";var wd=async(e,t)=>{let[r,n]=await FE(e);return t.isForcefullyTerminated??=!1,[r,n]},FE=async e=>{let[t,r]=await Promise.allSettled([wi(e,"spawn"),wi(e,"exit")]);return t.status==="rejected"?[]:r.status==="rejected"?Sd(e):r.value},Sd=async e=>{try{return await wi(e,"exit")}catch{return Sd(e)}},xd=async e=>{let[t,r]=await e;if(!jE(t,r)&&Si(t,r))throw new Le;return[t,r]},jE=(e,t)=>e===void 0&&t===void 0,Si=(e,t)=>e!==0||t!==null;var vd=({error:e,status:t,signal:r,output:n},{maxBuffer:s})=>{let o=BE(e,t,r),i=o?.code==="ETIMEDOUT",a=yf(o,n,s);return{resultError:o,exitCode:t,signal:r,timedOut:i,isMaxBuffer:a}},BE=(e,t,r)=>e!==void 0?e:Si(t,r)?new Le:void 0;var _d=(e,t,r)=>{let{file:n,commandArguments:s,command:o,escapedCommand:i,startTime:a,verboseInfo:c,options:u,fileDescriptors:l}=GE(e,t,r),f=zE({file:n,commandArguments:s,options:u,command:o,escapedCommand:i,verboseInfo:c,fileDescriptors:l,startTime:a});return nr(f,c,u)},GE=(e,t,r)=>{let{command:n,escapedCommand:s,startTime:o,verboseInfo:i}=Rn(e,t,r),a=qE(r),{file:c,commandArguments:u,options:l}=Hn(e,t,a);VE(l);let f=Qf(l,i);return{file:c,commandArguments:u,command:n,escapedCommand:s,startTime:o,verboseInfo:i,options:l,fileDescriptors:f}},qE=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,VE=({ipc:e,ipcInput:t,detached:r,cancelSignal:n})=>{t&&ps("ipcInput"),e&&ps("ipc: true"),r&&ps("detached: true"),n&&ps("cancelSignal")},ps=e=>{throw new TypeError(`The "${e}" option cannot be used with synchronous methods.`)},zE=({file:e,commandArguments:t,options:r,command:n,escapedCommand:s,verboseInfo:o,fileDescriptors:i,startTime:a})=>{let c=WE({file:e,commandArguments:t,options:r,command:n,escapedCommand:s,fileDescriptors:i,startTime:a});if(c.failed)return c;let{resultError:u,exitCode:l,signal:f,timedOut:p,isMaxBuffer:d}=vd(c,r),{output:b,error:T=u}=yd({fileDescriptors:i,syncResult:c,options:r,isMaxBuffer:d,verboseInfo:o}),N=b.map((U,H)=>Je(U,r,H)),P=Je(bd(b,r),r,"all");return HE({error:T,exitCode:l,signal:f,timedOut:p,isMaxBuffer:d,stdio:N,all:P,options:r,command:n,escapedCommand:s,startTime:a})},WE=({file:e,commandArguments:t,options:r,command:n,escapedCommand:s,fileDescriptors:o,startTime:i})=>{try{pd(o,r);let a=ZE(r);return UE(e,t,a)}catch(a){return rr({error:a,command:n,escapedCommand:s,fileDescriptors:o,options:r,startTime:i,isSync:!0})}},ZE=({encoding:e,maxBuffer:t,...r})=>({...r,encoding:"buffer",maxBuffer:rs(t)}),HE=({error:e,exitCode:t,signal:r,timedOut:n,isMaxBuffer:s,stdio:o,all:i,options:a,command:c,escapedCommand:u,startTime:l})=>e===void 0?ns({command:c,escapedCommand:u,stdio:o,all:i,ipcOutput:[],options:a,startTime:l}):Nr({error:e,command:c,escapedCommand:u,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:s,isForcefullyTerminated:!1,exitCode:t,signal:r,stdio:o,all:i,ipcOutput:[],options:a,startTime:l,isSync:!0});import{setMaxListeners as NT}from"node:events";import{spawn as PT}from"node:child_process";import kd from"node:process";import{once as xi,on as YE}from"node:events";var Ed=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},{reference:s=!0,filter:o}={})=>(Kt({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:Gn(e)}),XE({anyProcess:e,channel:t,isSubprocess:r,filter:o,reference:s})),XE=async({anyProcess:e,channel:t,isSubprocess:r,filter:n,reference:s})=>{Fn(t,s);let o=at(e,t,r),i=new AbortController;try{return await Promise.race([KE(o,n,i),JE(o,r,i),QE(o,r,i)])}catch(a){throw Jt(e),a}finally{i.abort(),jn(t,s)}},KE=async(e,t,{signal:r})=>{if(t===void 0){let[n]=await xi(e,"message",{signal:r});return n}for await(let[n]of YE(e,"message",{signal:r}))if(t(n))return n},JE=async(e,t,{signal:r})=>{await xi(e,"disconnect",{signal:r}),ul(t)},QE=async(e,t,{signal:r})=>{let[n]=await xi(e,"strict:error",{signal:r});throw Nn(n,t)};import{once as Od,on as e0}from"node:events";var Rd=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},{reference:s=!0}={})=>vi({anyProcess:e,channel:t,isSubprocess:r,ipc:n,shouldAwait:!r,reference:s}),vi=({anyProcess:e,channel:t,isSubprocess:r,ipc:n,shouldAwait:s,reference:o})=>{Kt({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:Gn(e)}),Fn(t,o);let i=at(e,t,r),a=new AbortController,c={};return t0(e,i,a),r0({ipcEmitter:i,isSubprocess:r,controller:a,state:c}),n0({anyProcess:e,channel:t,ipcEmitter:i,isSubprocess:r,shouldAwait:s,controller:a,state:c,reference:o})},t0=async(e,t,r)=>{try{await Od(t,"disconnect",{signal:r.signal}),r.abort()}catch{}},r0=async({ipcEmitter:e,isSubprocess:t,controller:r,state:n})=>{try{let[s]=await Od(e,"strict:error",{signal:r.signal});n.error=Nn(s,t),r.abort()}catch{}},n0=async function*({anyProcess:e,channel:t,ipcEmitter:r,isSubprocess:n,shouldAwait:s,controller:o,state:i,reference:a}){try{for await(let[c]of e0(r,"message",{signal:o.signal}))Td(i),yield c}catch{Td(i)}finally{o.abort(),jn(t,a),n||Jt(e),s&&await e}},Td=({error:e})=>{if(e)throw e};var Cd=(e,{ipc:t})=>{Object.assign(e,Id(e,!1,t))},Ad=()=>{let e=kd,t=!0,r=kd.channel!==void 0;return{...Id(e,t,r),getCancelSignal:Pl.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})}},Id=(e,t,r)=>({sendMessage:Wn.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getOneMessage:Ed.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getEachMessage:Rd.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})});import{ChildProcess as s0}from"node:child_process";import{PassThrough as o0,Readable as i0,Writable as a0,Duplex as c0}from"node:stream";var $d=({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:s,startTime:o,verboseInfo:i})=>{di(n);let a=new s0;u0(a,n),Object.assign(a,{readable:l0,writable:f0,duplex:d0});let c=rr({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:s,startTime:o,isSync:!1}),u=p0(c,i,s);return{subprocess:a,promise:u}},u0=(e,t)=>{let r=Mr(),n=Mr(),s=Mr(),o=Array.from({length:t.length-3},Mr),i=Mr(),a=[r,n,s,...o];Object.assign(e,{stdin:r,stdout:n,stderr:s,all:i,stdio:a})},Mr=()=>{let e=new o0;return e.end(),e},l0=()=>new i0({read(){}}),f0=()=>new a0({write(){}}),d0=()=>new c0({read(){},write(){}}),p0=async(e,t,r)=>nr(e,t,r);import{createReadStream as Dd,createWriteStream as Ld}from"node:fs";import{Buffer as m0}from"node:buffer";import{Readable as Fr,Writable as h0,Duplex as g0}from"node:stream";var Pd=(e,t)=>as(y0,e,t,!1),jr=({type:e,optionName:t})=>{throw new TypeError(`The \`${t}\` option cannot be ${ct[e]}.`)},Nd={fileNumber:jr,generator:bi,asyncGenerator:bi,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:r}}){let n=t||r;return{stream:g0.fromWeb(e,{objectMode:n})}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},y0={input:{...Nd,fileUrl:({value:e})=>({stream:Dd(e)}),filePath:({value:{file:e}})=>({stream:Dd(e)}),webStream:({value:e})=>({stream:Fr.fromWeb(e)}),iterable:({value:e})=>({stream:Fr.from(e)}),asyncIterable:({value:e})=>({stream:Fr.from(e)}),string:({value:e})=>({stream:Fr.from(e)}),uint8Array:({value:e})=>({stream:Fr.from(m0.from(e))})},output:{...Nd,fileUrl:({value:e})=>({stream:Ld(e)}),filePath:({value:{file:e,append:t}})=>({stream:Ld(e,t?{flags:"a"}:{})}),webStream:({value:e})=>({stream:h0.fromWeb(e)}),iterable:jr,asyncIterable:jr,string:jr,uint8Array:jr}};import{on as b0,once as Md}from"node:events";import{PassThrough as w0,getDefaultHighWaterMark as S0}from"node:stream";import{finished as Bd}from"node:stream/promises";function vt(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(let s of e)Ei(s);let t=e.some(({readableObjectMode:s})=>s),r=x0(e,t),n=new _i({objectMode:t,writableHighWaterMark:r,readableHighWaterMark:r});for(let s of e)n.add(s);return n}var x0=(e,t)=>{if(e.length===0)return S0(t);let r=e.filter(({readableObjectMode:n})=>n===t).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},_i=class extends w0{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#o=Symbol("unpipe");#s=new WeakMap;add(t){if(Ei(t),this.#t.has(t))return;this.#t.add(t),this.#n??=v0(this,this.#t,this.#o);let r=T0({passThroughStream:this,stream:t,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#n,unpipeEvent:this.#o});this.#s.set(t,r),t.pipe(this,{end:!1})}async remove(t){if(Ei(t),!this.#t.has(t))return!1;let r=this.#s.get(t);return r===void 0?!1:(this.#s.delete(t),t.unpipe(this),await r,!0)}},v0=async(e,t,r)=>{ms(e,Fd);let n=new AbortController;try{await Promise.race([_0(e,n),E0(e,t,r,n)])}finally{n.abort(),ms(e,-Fd)}},_0=async(e,{signal:t})=>{try{await Bd(e,{signal:t,cleanup:!0})}catch(r){throw Ud(e,r),r}},E0=async(e,t,r,{signal:n})=>{for await(let[s]of b0(e,"unpipe",{signal:n}))t.has(s)&&s.emit(r)},Ei=e=>{if(typeof e?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},T0=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:s,onFinished:o,unpipeEvent:i})=>{ms(e,jd);let a=new AbortController;try{await Promise.race([O0(o,t,a),R0({passThroughStream:e,stream:t,streams:r,ended:n,aborted:s,controller:a}),k0({stream:t,streams:r,ended:n,aborted:s,unpipeEvent:i,controller:a})])}finally{a.abort(),ms(e,-jd)}r.size>0&&r.size===n.size+s.size&&(n.size===0&&s.size>0?Ti(e):C0(e))},O0=async(e,t,{signal:r})=>{try{await e,r.aborted||Ti(t)}catch(n){r.aborted||Ud(t,n)}},R0=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:s,controller:{signal:o}})=>{try{await Bd(t,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(t)&&n.add(t)}catch(i){if(o.aborted||!r.has(t))return;Gd(i)?s.add(t):qd(e,i)}},k0=async({stream:e,streams:t,ended:r,aborted:n,unpipeEvent:s,controller:{signal:o}})=>{if(await Md(e,s,{signal:o}),!e.readable)return Md(o,"abort",{signal:o});t.delete(e),r.delete(e),n.delete(e)},C0=e=>{e.writable&&e.end()},Ud=(e,t)=>{Gd(t)?Ti(e):qd(e,t)},Gd=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",Ti=e=>{(e.readable||e.writable)&&e.destroy()},qd=(e,t)=>{e.destroyed||(e.once("error",A0),e.destroy(t))},A0=()=>{},ms=(e,t)=>{let r=e.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&e.setMaxListeners(r+t)},Fd=2,jd=1;import{finished as Vd}from"node:stream/promises";var or=(e,t)=>{e.pipe(t),I0(e,t),$0(e,t)},I0=async(e,t)=>{if(!(De(e)||De(t))){try{await Vd(e,{cleanup:!0,readable:!0,writable:!1})}catch{}Oi(t)}},Oi=e=>{e.writable&&e.end()},$0=async(e,t)=>{if(!(De(e)||De(t))){try{await Vd(t,{cleanup:!0,readable:!1,writable:!0})}catch{}Ri(e)}},Ri=e=>{e.readable&&e.destroy()};var zd=(e,t,r)=>{let n=new Map;for(let[s,{stdioItems:o,direction:i}]of Object.entries(t)){for(let{stream:a}of o.filter(({type:c})=>_e.has(c)))D0(e,a,i,s);for(let{stream:a}of o.filter(({type:c})=>!_e.has(c)))N0({subprocess:e,stream:a,direction:i,fdNumber:s,pipeGroups:n,controller:r})}for(let[s,o]of n.entries()){let i=o.length===1?o[0]:vt(o);or(i,s)}},D0=(e,t,r,n)=>{r==="output"?or(e.stdio[n],t):or(t,e.stdio[n]);let s=L0[n];s!==void 0&&(e[s]=t),e.stdio[n]=t},L0=["stdin","stdout","stderr"],N0=({subprocess:e,stream:t,direction:r,fdNumber:n,pipeGroups:s,controller:o})=>{if(t===void 0)return;P0(t,o);let[i,a]=r==="output"?[t,e.stdio[n]]:[e.stdio[n],t],c=s.get(i)??[];s.set(i,[...c,a])},P0=(e,{signal:t})=>{De(e)&&bt(e,M0,t)},M0=2;import{addAbortListener as B0}from"node:events";var _t=[];_t.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&_t.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&_t.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var hs=e=>!!e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function",ki=Symbol.for("signal-exit emitter"),Ci=globalThis,F0=Object.defineProperty.bind(Object),Ai=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Ci[ki])return Ci[ki];F0(Ci,ki,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,r){this.listeners[t].push(r)}removeListener(t,r){let n=this.listeners[t],s=n.indexOf(r);s!==-1&&(s===0&&n.length===1?n.length=0:n.splice(s,1))}emit(t,r,n){if(this.emitted[t])return!1;this.emitted[t]=!0;let s=!1;for(let o of this.listeners[t])s=o(r,n)===!0||s;return t==="exit"&&(s=this.emit("afterExit",r,n)||s),s}},gs=class{},j0=e=>({onExit(t,r){return e.onExit(t,r)},load(){return e.load()},unload(){return e.unload()}}),Ii=class extends gs{onExit(){return()=>{}}load(){}unload(){}},$i=class extends gs{#t=Di.platform==="win32"?"SIGINT":"SIGHUP";#r=new Ai;#e;#n;#o;#s={};#i=!1;constructor(t){super(),this.#e=t,this.#s={};for(let r of _t)this.#s[r]=()=>{let n=this.#e.listeners(r),{count:s}=this.#r,o=t;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(s+=o.__signal_exit_emitter__.count),n.length===s){this.unload();let i=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;i||t.kill(t.pid,a)}};this.#o=t.reallyExit,this.#n=t.emit}onExit(t,r){if(!hs(this.#e))return()=>{};this.#i===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,t),()=>{this.#r.removeListener(n,t),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#i){this.#i=!0,this.#r.count+=1;for(let t of _t)try{let r=this.#s[t];r&&this.#e.on(t,r)}catch{}this.#e.emit=(t,...r)=>this.#c(t,...r),this.#e.reallyExit=t=>this.#a(t)}}unload(){this.#i&&(this.#i=!1,_t.forEach(t=>{let r=this.#s[t];if(!r)throw new Error("Listener not defined for signal: "+t);try{this.#e.removeListener(t,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#o,this.#r.count-=1)}#a(t){return hs(this.#e)?(this.#e.exitCode=t||0,this.#r.emit("exit",this.#e.exitCode,null),this.#o.call(this.#e,this.#e.exitCode)):0}#c(t,...r){let n=this.#n;if(t==="exit"&&hs(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let s=n.call(this.#e,t,...r);return this.#r.emit("exit",this.#e.exitCode,null),s}else return n.call(this.#e,t,...r)}},Di=globalThis.process,{onExit:Wd,load:eU,unload:tU}=j0(hs(Di)?new $i(Di):new Ii);var Zd=(e,{cleanup:t,detached:r},{signal:n})=>{if(!t||r)return;let s=Wd(()=>{e.kill()});B0(n,()=>{s()})};var Yd=({source:e,sourcePromise:t,boundOptions:r,createNested:n},...s)=>{let o=On(),{destination:i,destinationStream:a,destinationError:c,from:u,unpipeSignal:l}=U0(r,n,s),{sourceStream:f,sourceError:p}=q0(e,u),{options:d,fileDescriptors:b}=Ue.get(e);return{sourcePromise:t,sourceStream:f,sourceOptions:d,sourceError:p,destination:i,destinationStream:a,destinationError:c,unpipeSignal:l,fileDescriptors:b,startTime:o}},U0=(e,t,r)=>{try{let{destination:n,pipeOptions:{from:s,to:o,unpipeSignal:i}={}}=G0(e,t,...r),a=Mn(n,o);return{destination:n,destinationStream:a,from:s,unpipeSignal:i}}catch(n){return{destinationError:n}}},G0=(e,t,r,...n)=>{if(Array.isArray(r))return{destination:t(Hd,e)(r,...n),pipeOptions:e};if(typeof r=="string"||r instanceof URL||vo(r)){if(Object.keys(e).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[s,o,i]=gn(r,...n);return{destination:t(Hd)(s,o,i),pipeOptions:i}}if(Ue.has(r)){if(Object.keys(e).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},Hd=({options:e})=>({options:{...e,stdin:"pipe",piped:!0}}),q0=(e,t)=>{try{return{sourceStream:Qt(e,t)}}catch(r){return{sourceError:r}}};var Kd=({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n,fileDescriptors:s,sourceOptions:o,startTime:i})=>{let a=V0({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n});if(a!==void 0)throw Li({error:a,fileDescriptors:s,sourceOptions:o,startTime:i})},V0=({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n})=>{if(t!==void 0&&n!==void 0)return n;if(n!==void 0)return Ri(e),n;if(t!==void 0)return Oi(r),t},Li=({error:e,fileDescriptors:t,sourceOptions:r,startTime:n})=>rr({error:e,command:Xd,escapedCommand:Xd,fileDescriptors:t,options:r,startTime:n,isSync:!1}),Xd="source.pipe(destination)";var Jd=async e=>{let[{status:t,reason:r,value:n=r},{status:s,reason:o,value:i=o}]=await e;if(i.pipedFrom.includes(n)||i.pipedFrom.push(n),s==="rejected")throw i;if(t==="rejected")throw n;return i};import{finished as z0}from"node:stream/promises";var Qd=(e,t,r)=>{let n=ys.has(t)?Z0(e,t):W0(e,t);return bt(e,Y0,r.signal),bt(t,X0,r.signal),H0(t),n},W0=(e,t)=>{let r=vt([e]);return or(r,t),ys.set(t,r),r},Z0=(e,t)=>{let r=ys.get(t);return r.add(e),r},H0=async e=>{try{await z0(e,{cleanup:!0,readable:!1,writable:!0})}catch{}ys.delete(e)},ys=new WeakMap,Y0=2,X0=1;import{aborted as K0}from"node:util";var ep=(e,t)=>e===void 0?[]:[J0(e,t)],J0=async(e,{sourceStream:t,mergedStream:r,fileDescriptors:n,sourceOptions:s,startTime:o})=>{await K0(e,t),await r.remove(t);let i=new Error("Pipe canceled by `unpipeSignal` option.");throw Li({error:i,fileDescriptors:n,sourceOptions:s,startTime:o})};var bs=(e,...t)=>{if(z(t[0]))return bs.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:r,...n}=Yd(e,...t),s=Q0({...n,destination:r});return s.pipe=bs.bind(void 0,{...e,source:r,sourcePromise:s,boundOptions:{}}),s},Q0=async({sourcePromise:e,sourceStream:t,sourceOptions:r,sourceError:n,destination:s,destinationStream:o,destinationError:i,unpipeSignal:a,fileDescriptors:c,startTime:u})=>{let l=eT(e,s);Kd({sourceStream:t,sourceError:n,destinationStream:o,destinationError:i,fileDescriptors:c,sourceOptions:r,startTime:u});let f=new AbortController;try{let p=Qd(t,o,f);return await Promise.race([Jd(l),...ep(a,{sourceStream:t,mergedStream:p,sourceOptions:r,fileDescriptors:c,startTime:u})])}finally{f.abort()}},eT=(e,t)=>Promise.allSettled([e,t]);import{setImmediate as aT}from"node:timers/promises";import{on as tT}from"node:events";import{getDefaultHighWaterMark as rT}from"node:stream";var ws=({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:n,encoding:s,preserveNewlines:o})=>{let i=new AbortController;return nT(t,i),rp({stream:e,controller:i,binary:r,shouldEncode:!e.readableObjectMode&&n,encoding:s,shouldSplit:!e.readableObjectMode,preserveNewlines:o})},nT=async(e,t)=>{try{await e}catch{}finally{t.abort()}},Ni=({stream:e,onStreamEnd:t,lines:r,encoding:n,stripFinalNewline:s,allMixed:o})=>{let i=new AbortController;sT(t,i,e);let a=e.readableObjectMode&&!o;return rp({stream:e,controller:i,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!s})},sT=async(e,t,r)=>{try{await e}catch{r.destroy()}finally{t.abort()}},rp=({stream:e,controller:t,binary:r,shouldEncode:n,encoding:s,shouldSplit:o,preserveNewlines:i})=>{let a=tT(e,"data",{signal:t.signal,highWaterMark:tp,highWatermark:tp});return oT({onStdoutChunk:a,controller:t,binary:r,shouldEncode:n,encoding:s,shouldSplit:o,preserveNewlines:i})},Pi=rT(!0),tp=Pi,oT=async function*({onStdoutChunk:e,controller:t,binary:r,shouldEncode:n,encoding:s,shouldSplit:o,preserveNewlines:i}){let a=iT({binary:r,shouldEncode:n,encoding:s,shouldSplit:o,preserveNewlines:i});try{for await(let[c]of e)yield*xt(c,a,0)}catch(c){if(!t.signal.aborted)throw c}finally{yield*Pr(a)}},iT=({binary:e,shouldEncode:t,encoding:r,shouldSplit:n,preserveNewlines:s})=>[us(e,r,!t),cs(e,s,!n,{})].filter(Boolean);var np=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,buffer:s,maxBuffer:o,lines:i,allMixed:a,stripFinalNewline:c,verboseInfo:u,streamInfo:l})=>{let f=cT({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,allMixed:a,verboseInfo:u,streamInfo:l});if(!s){await Promise.all([uT(e),f]);return}let p=pi(c,r),d=Ni({stream:e,onStreamEnd:t,lines:i,encoding:n,stripFinalNewline:p,allMixed:a}),[b]=await Promise.all([lT({stream:e,iterable:d,fdNumber:r,encoding:n,maxBuffer:o,lines:i}),f]);return b},cT=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,allMixed:s,verboseInfo:o,streamInfo:{fileDescriptors:i}})=>{if(!ds({stdioItems:i[r]?.stdioItems,encoding:n,verboseInfo:o,fdNumber:r}))return;let a=Ni({stream:e,onStreamEnd:t,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:s});await md(a,e,r,o)},uT=async e=>{await aT(),e.readableFlowing===null&&e.resume()},lT=async({stream:e,stream:{readableObjectMode:t},iterable:r,fdNumber:n,encoding:s,maxBuffer:o,lines:i})=>{try{return t||i?await Jn(r,{maxBuffer:o}):s==="buffer"?new Uint8Array(await Qn(r,{maxBuffer:o})):await ts(r,{maxBuffer:o})}catch(a){return sp(mf({error:a,stream:e,readableObjectMode:t,lines:i,encoding:s,fdNumber:n}))}},Mi=async e=>{try{return await e}catch(t){return sp(t)}},sp=({bufferedData:e})=>Cc(e)?new Uint8Array(e):e;import{finished as fT}from"node:stream/promises";var Br=async(e,t,r,{isSameDirection:n,stopOnExit:s=!1}={})=>{let o=dT(e,r),i=new AbortController;try{await Promise.race([...s?[r.exitPromise]:[],fT(e,{cleanup:!0,signal:i.signal})])}catch(a){o.stdinCleanedUp||hT(a,t,r,n)}finally{i.abort()}},dT=(e,{originalStreams:[t],subprocess:r})=>{let n={stdinCleanedUp:!1};return e===t&&pT(e,r,n),n},pT=(e,t,r)=>{let{_destroy:n}=e;e._destroy=(...s)=>{mT(t,r),n.call(e,...s)}},mT=({exitCode:e,signalCode:t},r)=>{(e!==null||t!==null)&&(r.stdinCleanedUp=!0)},hT=(e,t,r,n)=>{if(!gT(e,t,r,n))throw e},gT=(e,t,r,n=!0)=>r.propagating?op(e)||Ss(e):(r.propagating=!0,Fi(r,t)===n?op(e):Ss(e)),Fi=({fileDescriptors:e},t)=>t!=="all"&&e[t].direction==="input",Ss=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",op=e=>e?.code==="EPIPE";var ip=({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:s,stripFinalNewline:o,verboseInfo:i,streamInfo:a})=>e.stdio.map((c,u)=>ji({stream:c,fdNumber:u,encoding:t,buffer:r[u],maxBuffer:n[u],lines:s[u],allMixed:!1,stripFinalNewline:o,verboseInfo:i,streamInfo:a})),ji=async({stream:e,fdNumber:t,encoding:r,buffer:n,maxBuffer:s,lines:o,allMixed:i,stripFinalNewline:a,verboseInfo:c,streamInfo:u})=>{if(!e)return;let l=Br(e,t,u);if(Fi(u,t)){await l;return}let[f]=await Promise.all([np({stream:e,onStreamEnd:l,fdNumber:t,encoding:r,buffer:n,maxBuffer:s,lines:o,allMixed:i,stripFinalNewline:a,verboseInfo:c,streamInfo:u}),l]);return f};var ap=({stdout:e,stderr:t},{all:r})=>r&&(e||t)?vt([e,t].filter(Boolean)):void 0,cp=({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:s,stripFinalNewline:o,verboseInfo:i,streamInfo:a})=>ji({...yT(e,r),fdNumber:"all",encoding:t,maxBuffer:n[1]+n[2],lines:s[1]||s[2],allMixed:bT(e),stripFinalNewline:o,verboseInfo:i,streamInfo:a}),yT=({stdout:e,stderr:t,all:r},[,n,s])=>{let o=n||s;return o?n?s?{stream:r,buffer:o}:{stream:e,buffer:o}:{stream:t,buffer:o}:{stream:r,buffer:o}},bT=({all:e,stdout:t,stderr:r})=>e&&t&&r&&t.readableObjectMode!==r.readableObjectMode;import{once as wT}from"node:events";var up=e=>Ht(e,"ipc"),lp=(e,t)=>{let r=Tn(e);je({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:t})};var fp=async({subprocess:e,buffer:t,maxBuffer:r,ipc:n,ipcOutput:s,verboseInfo:o})=>{if(!n)return s;let i=up(o),a=Xe(t,"ipc"),c=Xe(r,"ipc");for await(let u of vi({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(hf(e,s,c),s.push(u)),i&&lp(u,o);return s},dp=async(e,t)=>(await Promise.allSettled([e]),t);var pp=async({subprocess:e,options:{encoding:t,buffer:r,maxBuffer:n,lines:s,timeoutDuration:o,cancelSignal:i,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:u,ipc:l,ipcInput:f},context:p,verboseInfo:d,fileDescriptors:b,originalStreams:T,onInternalError:N,controller:P})=>{let U=wd(e,p),H={originalStreams:T,fileDescriptors:b,subprocess:e,exitPromise:U,propagating:!1},Y=ip({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:s,stripFinalNewline:u,verboseInfo:d,streamInfo:H}),Se=cp({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:s,stripFinalNewline:u,verboseInfo:d,streamInfo:H}),ae=[],Ae=fp({subprocess:e,buffer:r,maxBuffer:n,ipc:l,ipcOutput:ae,verboseInfo:d}),Ie=ST(T,e,H),xe=xT(b,H);try{return await Promise.race([Promise.all([{},xd(U),Promise.all(Y),Se,Ae,Wl(e,f),...Ie,...xe]),N,vT(e,P),...Ul(e,o,p,P),...cl({subprocess:e,cancelSignal:i,gracefulCancel:a,context:p,controller:P}),...jl({subprocess:e,cancelSignal:i,gracefulCancel:a,forceKillAfterDelay:c,context:p,controller:P})])}catch(Er){return p.terminationReason??="other",Promise.all([{error:Er},U,Promise.all(Y.map(ht=>Mi(ht))),Mi(Se),dp(Ae,ae),Promise.allSettled(Ie),Promise.allSettled(xe)])}},ST=(e,t,r)=>e.map((n,s)=>n===t.stdio[s]?void 0:Br(n,s,r)),xT=(e,t)=>e.flatMap(({stdioItems:r},n)=>r.filter(({value:s,stream:o=s})=>Pe(o,{checkOpen:!1})&&!De(o)).map(({type:s,value:o,stream:i=o})=>Br(i,n,t,{isSameDirection:_e.has(s),stopOnExit:s==="native"}))),vT=async(e,{signal:t})=>{let[r]=await wT(e,"error",{signal:t});throw r};var mp=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),Ur=(e,t,r)=>{let n=e[r];n.has(t)||n.set(t,[]);let s=n.get(t),o=Be();return s.push(o),{resolve:o.resolve.bind(o),promises:s}},ir=async({resolve:e,promises:t},r)=>{e();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...t])]);return!n};import{Readable as _T}from"node:stream";import{callbackify as ET}from"node:util";import{finished as hp}from"node:stream/promises";var Bi=async e=>{if(e!==void 0)try{await Ui(e)}catch{}},gp=async e=>{if(e!==void 0)try{await Gi(e)}catch{}},Ui=async e=>{await hp(e,{cleanup:!0,readable:!1,writable:!0})},Gi=async e=>{await hp(e,{cleanup:!0,readable:!0,writable:!1})},xs=async(e,t)=>{if(await e,t)throw t},vs=(e,t,r)=>{r&&!Ss(r)?e.destroy(r):t&&e.destroy()};var yp=({subprocess:e,concurrentStreams:t,encoding:r},{from:n,binary:s=!0,preserveNewlines:o=!0}={})=>{let i=s||me.has(r),{subprocessStdout:a,waitReadableDestroy:c}=qi(e,n,t),{readableEncoding:u,readableObjectMode:l,readableHighWaterMark:f}=Vi(a,i),{read:p,onStdoutDataDone:d}=zi({subprocessStdout:a,subprocess:e,binary:i,encoding:r,preserveNewlines:o}),b=new _T({read:p,destroy:ET(Zi.bind(void 0,{subprocessStdout:a,subprocess:e,waitReadableDestroy:c})),highWaterMark:f,objectMode:l,encoding:u});return Wi({subprocessStdout:a,onStdoutDataDone:d,readable:b,subprocess:e}),b},qi=(e,t,r)=>{let n=Qt(e,t),s=Ur(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:s}},Vi=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r},n)=>n?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:Pi},zi=({subprocessStdout:e,subprocess:t,binary:r,encoding:n,preserveNewlines:s})=>{let o=Be(),i=ws({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:s});return{read(){TT(this,i,o)},onStdoutDataDone:o}},TT=async(e,t,r)=>{try{let{value:n,done:s}=await t.next();s?r.resolve():e.push(n)}catch{}},Wi=async({subprocessStdout:e,onStdoutDataDone:t,readable:r,subprocess:n,subprocessStdin:s})=>{try{await Gi(e),await n,await Bi(s),await t,r.readable&&r.push(null)}catch(o){await Bi(s),bp(r,o)}},Zi=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:r},n)=>{await ir(r,t)&&(bp(e,n),await xs(t,n))},bp=(e,t)=>{vs(e,e.readable,t)};import{Writable as OT}from"node:stream";import{callbackify as wp}from"node:util";var Sp=({subprocess:e,concurrentStreams:t},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:s,waitWritableDestroy:o}=Hi(e,r,t),i=new OT({...Yi(n,e,s),destroy:wp(Ki.bind(void 0,{subprocessStdin:n,subprocess:e,waitWritableFinal:s,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return Xi(n,i),i},Hi=(e,t,r)=>{let n=Mn(e,t),s=Ur(r,n,"writableFinal"),o=Ur(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:s,waitWritableDestroy:o}},Yi=(e,t,r)=>({write:RT.bind(void 0,e),final:wp(kT.bind(void 0,e,t,r))}),RT=(e,t,r,n)=>{e.write(t,r)?n():e.once("drain",n)},kT=async(e,t,r)=>{await ir(r,t)&&(e.writable&&e.end(),await t)},Xi=async(e,t,r)=>{try{await Ui(e),t.writable&&t.end()}catch(n){await gp(r),xp(t,n)}},Ki=async({subprocessStdin:e,subprocess:t,waitWritableFinal:r,waitWritableDestroy:n},s)=>{await ir(r,t),await ir(n,t)&&(xp(e,s),await xs(t,s))},xp=(e,t)=>{vs(e,e.writable,t)};import{Duplex as CT}from"node:stream";import{callbackify as AT}from"node:util";var vp=({subprocess:e,concurrentStreams:t,encoding:r},{from:n,to:s,binary:o=!0,preserveNewlines:i=!0}={})=>{let a=o||me.has(r),{subprocessStdout:c,waitReadableDestroy:u}=qi(e,n,t),{subprocessStdin:l,waitWritableFinal:f,waitWritableDestroy:p}=Hi(e,s,t),{readableEncoding:d,readableObjectMode:b,readableHighWaterMark:T}=Vi(c,a),{read:N,onStdoutDataDone:P}=zi({subprocessStdout:c,subprocess:e,binary:a,encoding:r,preserveNewlines:i}),U=new CT({read:N,...Yi(l,e,f),destroy:AT(IT.bind(void 0,{subprocessStdout:c,subprocessStdin:l,subprocess:e,waitReadableDestroy:u,waitWritableFinal:f,waitWritableDestroy:p})),readableHighWaterMark:T,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:b,writableObjectMode:l.writableObjectMode,encoding:d});return Wi({subprocessStdout:c,onStdoutDataDone:P,readable:U,subprocess:e,subprocessStdin:l}),Xi(l,U,c),U},IT=async({subprocessStdout:e,subprocessStdin:t,subprocess:r,waitReadableDestroy:n,waitWritableFinal:s,waitWritableDestroy:o},i)=>{await Promise.all([Zi({subprocessStdout:e,subprocess:r,waitReadableDestroy:n},i),Ki({subprocessStdin:t,subprocess:r,waitWritableFinal:s,waitWritableDestroy:o},i)])};var Ji=(e,t,{from:r,binary:n=!1,preserveNewlines:s=!1}={})=>{let o=n||me.has(t),i=Qt(e,r),a=ws({subprocessStdout:i,subprocess:e,binary:o,shouldEncode:!0,encoding:t,preserveNewlines:s});return $T(a,i,e)},$T=async function*(e,t,r){try{yield*e}finally{t.readable&&t.destroy(),await r}};var _p=(e,{encoding:t})=>{let r=mp();e.readable=yp.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.writable=Sp.bind(void 0,{subprocess:e,concurrentStreams:r}),e.duplex=vp.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.iterable=Ji.bind(void 0,e,t),e[Symbol.asyncIterator]=Ji.bind(void 0,e,t,{})};var Ep=(e,t)=>{for(let[r,n]of LT){let s=n.value.bind(t);Reflect.defineProperty(e,r,{...n,value:s})}},DT=(async()=>{})().constructor.prototype,LT=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(DT,e)]);var Tp=(e,t,r,n)=>{let{file:s,commandArguments:o,command:i,escapedCommand:a,startTime:c,verboseInfo:u,options:l,fileDescriptors:f}=MT(e,t,r),{subprocess:p,promise:d}=jT({file:s,commandArguments:o,options:l,startTime:c,verboseInfo:u,command:i,escapedCommand:a,fileDescriptors:f});return p.pipe=bs.bind(void 0,{source:p,sourcePromise:d,boundOptions:{},createNested:n}),Ep(p,d),Ue.set(p,{options:l,fileDescriptors:f}),p},MT=(e,t,r)=>{let{command:n,escapedCommand:s,startTime:o,verboseInfo:i}=Rn(e,t,r),{file:a,commandArguments:c,options:u}=Hn(e,t,r),l=FT(u),f=Pd(l,i);return{file:a,commandArguments:c,command:n,escapedCommand:s,startTime:o,verboseInfo:i,options:l,fileDescriptors:f}},FT=({timeout:e,signal:t,...r})=>{if(t!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:e}},jT=({file:e,commandArguments:t,options:r,startTime:n,verboseInfo:s,command:o,escapedCommand:i,fileDescriptors:a})=>{let c;try{c=PT(e,t,r)}catch(b){return $d({error:b,command:o,escapedCommand:i,fileDescriptors:a,options:r,startTime:n,verboseInfo:s})}let u=new AbortController;NT(Number.POSITIVE_INFINITY,u.signal);let l=[...c.stdio];zd(c,a,u),Zd(c,r,u);let f={},p=Be();c.kill=il.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:p,context:f,controller:u}),c.all=ap(c,r),_p(c,r),Cd(c,r);let d=BT({subprocess:c,options:r,startTime:n,verboseInfo:s,fileDescriptors:a,originalStreams:l,command:o,escapedCommand:i,context:f,onInternalError:p,controller:u});return{subprocess:c,promise:d}},BT=async({subprocess:e,options:t,startTime:r,verboseInfo:n,fileDescriptors:s,originalStreams:o,command:i,escapedCommand:a,context:c,onInternalError:u,controller:l})=>{let[f,[p,d],b,T,N]=await pp({subprocess:e,options:t,context:c,verboseInfo:n,fileDescriptors:s,originalStreams:o,onInternalError:u,controller:l});l.abort(),u.resolve();let P=b.map((Y,Se)=>Je(Y,t,Se)),U=Je(T,t,"all"),H=UT({errorInfo:f,exitCode:p,signal:d,stdio:P,all:U,ipcOutput:N,context:c,options:t,command:i,escapedCommand:a,startTime:r});return nr(H,n,t)},UT=({errorInfo:e,exitCode:t,signal:r,stdio:n,all:s,ipcOutput:o,context:i,options:a,command:c,escapedCommand:u,startTime:l})=>"error"in e?Nr({error:e.error,command:c,escapedCommand:u,timedOut:i.terminationReason==="timeout",isCanceled:i.terminationReason==="cancel"||i.terminationReason==="gracefulCancel",isGracefullyCanceled:i.terminationReason==="gracefulCancel",isMaxBuffer:e.error instanceof Ge,isForcefullyTerminated:i.isForcefullyTerminated,exitCode:t,signal:r,stdio:n,all:s,ipcOutput:o,options:a,startTime:l,isSync:!1}):ns({command:c,escapedCommand:u,stdio:n,all:s,ipcOutput:o,options:a,startTime:l});var _s=(e,t)=>{let r=Object.fromEntries(Object.entries(t).map(([n,s])=>[n,GT(n,e[n],s)]));return{...e,...r}},GT=(e,t,r)=>qT.has(e)&&z(t)&&z(r)?{...t,...r}:r,qT=new Set(["env",...ko]);var ut=(e,t,r,n)=>{let s=(i,a,c)=>ut(i,a,r,c),o=(...i)=>VT({mapArguments:e,deepOptions:r,boundOptions:t,setBoundExeca:n,createNested:s},...i);return n!==void 0&&n(o,s,t),o},VT=({mapArguments:e,deepOptions:t={},boundOptions:r={},setBoundExeca:n,createNested:s},o,...i)=>{if(z(o))return s(e,_s(r,o),n);let{file:a,commandArguments:c,options:u,isSync:l}=zT({mapArguments:e,firstArgument:o,nextArguments:i,deepOptions:t,boundOptions:r});return l?_d(a,c,u):Tp(a,c,u,s)},zT=({mapArguments:e,firstArgument:t,nextArguments:r,deepOptions:n,boundOptions:s})=>{let o=Nc(t)?Pc(t,r):[t,...r],[i,a,c]=gn(...o),u=_s(_s(n,s),c),{file:l=i,commandArguments:f=a,options:p=u,isSync:d=!1}=e({file:i,commandArguments:a,options:u});return{file:l,commandArguments:f,options:p,isSync:d}};var Op=({file:e,commandArguments:t})=>kp(e,t),Rp=({file:e,commandArguments:t})=>({...kp(e,t),isSync:!0}),kp=(e,t)=>{if(t.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${e} ${t}.`);let[r,...n]=WT(e);return{file:r,commandArguments:n}},WT=e=>{if(typeof e!="string")throw new TypeError(`The command must be a string: ${String(e)}.`);let t=e.trim();if(t==="")return[];let r=[];for(let n of t.split(ZT)){let s=r.at(-1);s&&s.endsWith("\\")?r[r.length-1]=`${s.slice(0,-1)} ${n}`:r.push(n)}return r},ZT=/ +/g;var Cp=(e,t,r)=>{e.sync=t(HT,r),e.s=e.sync},Ap=({options:e})=>Ip(e),HT=({options:e})=>({...Ip(e),isSync:!0}),Ip=e=>({options:{...YT(e),...e}}),YT=({input:e,inputFile:t,stdio:r})=>e===void 0&&t===void 0&&r===void 0?{stdin:"inherit"}:{},$p={preferLocal:!0};var q9=ut(()=>({})),V9=ut(()=>({isSync:!0})),z9=ut(Op),W9=ut(Rp),Dp=ut(ql),Z9=ut(Ap,{},$p,Cp),{sendMessage:H9,getOneMessage:Y9,getEachMessage:X9,getCancelSignal:K9}=Ad();var yo=gt(Eh(),1);import{readdirSync as V$}from"fs";import{createRequire as z$}from"module";import{dirname as W$,resolve as Sc}from"path";var M;(function(e){e.assertEqual=s=>s;function t(s){}e.assertIs=t;function r(s){throw new Error}e.assertNever=r,e.arrayToEnum=s=>{let o={};for(let i of s)o[i]=i;return o},e.getValidEnumValues=s=>{let o=e.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),i={};for(let a of o)i[a]=s[a];return e.objectValues(i)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let o=[];for(let i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},e.find=(s,o)=>{for(let i of s)if(o(i))return i},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(M||(M={}));var ba;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(ba||(ba={}));var S=M.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),et=e=>{switch(typeof e){case"undefined":return S.undefined;case"string":return S.string;case"number":return isNaN(e)?S.nan:S.number;case"boolean":return S.boolean;case"function":return S.function;case"bigint":return S.bigint;case"symbol":return S.symbol;case"object":return Array.isArray(e)?S.array:e===null?S.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?S.promise:typeof Map<"u"&&e instanceof Map?S.map:typeof Set<"u"&&e instanceof Set?S.set:typeof Date<"u"&&e instanceof Date?S.date:S.object;default:return S.unknown}},m=M.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"]),zk=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),he=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(o){return o.message},n={_errors:[]},s=o=>{for(let i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let a=n,c=0;for(;c<i.path.length;){let u=i.path[c];c===i.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(i))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return s(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,M.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let s of this.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(t(s))):n.push(t(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};he.create=e=>new he(e);var fr=(e,t)=>{let r;switch(e.code){case m.invalid_type:e.received===S.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case m.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,M.jsonStringifyReplacer)}`;break;case m.unrecognized_keys:r=`Unrecognized key(s) in object: ${M.joinValues(e.keys,", ")}`;break;case m.invalid_union:r="Invalid input";break;case m.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${M.joinValues(e.options)}`;break;case m.invalid_enum_value:r=`Invalid enum value. Expected ${M.joinValues(e.options)}, received '${e.received}'`;break;case m.invalid_arguments:r="Invalid function arguments";break;case m.invalid_return_type:r="Invalid function return type";break;case m.invalid_date:r="Invalid date";break;case m.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:M.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case m.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case m.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case m.custom:r="Invalid input";break;case m.invalid_intersection_types:r="Intersection results could not be merged";break;case m.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case m.not_finite:r="Number must be finite";break;default:r=t.defaultError,M.assertNever(e)}return{message:r}},kh=fr;function Wk(e){kh=e}function Ns(){return kh}var Ps=e=>{let{data:t,path:r,errorMaps:n,issueData:s}=e,o=[...r,...s.path||[]],i={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let a="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)a=u(i,{data:t,defaultError:a}).message;return{...s,path:o,message:a}},Zk=[];function y(e,t){let r=Ns(),n=Ps({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===fr?void 0:fr].filter(s=>!!s)});e.common.issues.push(n)}var ee=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let s of r){if(s.status==="aborted")return k;s.status==="dirty"&&t.dirty(),n.push(s.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let s of r){let o=await s.key,i=await s.value;n.push({key:o,value:i})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let s of r){let{key:o,value:i}=s;if(o.status==="aborted"||i.status==="aborted")return k;o.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[o.value]=i.value)}return{status:t.value,value:n}}},k=Object.freeze({status:"aborted"}),lr=e=>({status:"dirty",value:e}),oe=e=>({status:"valid",value:e}),wa=e=>e.status==="aborted",Sa=e=>e.status==="dirty",Tt=e=>e.status==="valid",Kr=e=>typeof Promise<"u"&&e instanceof Promise;function Ms(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function Ch(e,t,r,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(e,r):s?s.value=r:t.set(e,r),r}var _;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(_||(_={}));var Yr,Xr,Re=class{constructor(t,r,n,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Th=(e,t)=>{if(Tt(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new he(e.common.issues);return this._error=r,this._error}}};function $(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(i,a)=>{var c,u;let{message:l}=e;return i.code==="invalid_enum_value"?{message:l??a.defaultError}:typeof a.data>"u"?{message:(c=l??n)!==null&&c!==void 0?c:a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:(u=l??r)!==null&&u!==void 0?u:a.defaultError}},description:s}}var D=class{get description(){return this._def.description}_getType(t){return et(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:et(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ee,ctx:{common:t.parent.common,data:t.data,parsedType:et(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(Kr(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var n;let s={common:{issues:[],async:(n=r?.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:et(t)},o=this._parseSync({data:t,path:s.path,parent:s});return Th(s,o)}"~validate"(t){var r,n;let s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:et(t)};if(!this["~standard"].async)try{let o=this._parseSync({data:t,path:[],parent:s});return Tt(o)?{value:o.value}:{issues:s.common.issues}}catch(o){!((n=(r=o?.message)===null||r===void 0?void 0:r.toLowerCase())===null||n===void 0)&&n.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:s}).then(o=>Tt(o)?{value:o.value}:{issues:s.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:et(t)},s=this._parse({data:t,path:n.path,parent:n}),o=await(Kr(s)?s:Promise.resolve(s));return Th(n,o)}refine(t,r){let n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,o)=>{let i=t(s),a=()=>o.addIssue({code:m.custom,...n(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(t,r){return this._refinement((n,s)=>t(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(t){return new ge({schema:this,typeName:R.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,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:r=>this["~validate"](r)}}optional(){return Oe.create(this,this._def)}nullable(){return We.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return rt.create(this)}promise(){return dt.create(this,this._def)}or(t){return $t.create([this,t],this._def)}and(t){return Dt.create(this,t,this._def)}transform(t){return new ge({...$(this._def),schema:this,typeName:R.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Ft({...$(this._def),innerType:this,defaultValue:r,typeName:R.ZodDefault})}brand(){return new Jr({typeName:R.ZodBranded,type:this,...$(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new jt({...$(this._def),innerType:this,catchValue:r,typeName:R.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Qr.create(this,t)}readonly(){return Bt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Hk=/^c[^\s-]{8,}$/i,Yk=/^[0-9a-z]+$/,Xk=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Kk=/^[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,Jk=/^[a-z0-9_-]{21}$/i,Qk=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,eC=/^[-+]?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)?)??$/,tC=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,rC="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",ya,nC=/^(?:(?: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])$/,sC=/^(?:(?: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])$/,oC=/^(([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]))$/,iC=/^(([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])$/,aC=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,cC=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ah="((\\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])))",uC=new RegExp(`^${Ah}$`);function Ih(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function lC(e){return new RegExp(`^${Ih(e)}$`)}function $h(e){let t=`${Ah}T${Ih(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function fC(e,t){return!!((t==="v4"||!t)&&nC.test(e)||(t==="v6"||!t)&&oC.test(e))}function dC(e,t){if(!Qk.test(e))return!1;try{let[r]=e.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||!s.typ||!s.alg||t&&s.alg!==t)}catch{return!1}}function pC(e,t){return!!((t==="v4"||!t)&&sC.test(e)||(t==="v6"||!t)&&iC.test(e))}var lt=class e extends D{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==S.string){let o=this._getOrReturnCtx(t);return y(o,{code:m.invalid_type,expected:S.string,received:o.parsedType}),k}let n=new ee,s;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(s=this._getOrReturnCtx(t,s),y(s,{code:m.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")t.data.length>o.value&&(s=this._getOrReturnCtx(t,s),y(s,{code:m.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let i=t.data.length>o.value,a=t.data.length<o.value;(i||a)&&(s=this._getOrReturnCtx(t,s),i?y(s,{code:m.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&y(s,{code:m.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")tC.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"email",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")ya||(ya=new RegExp(rC,"u")),ya.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"emoji",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")Kk.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"uuid",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")Jk.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"nanoid",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")Hk.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"cuid",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")Yk.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"cuid2",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")Xk.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"ulid",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),y(s,{validation:"url",code:m.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"regex",code:m.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(s=this._getOrReturnCtx(t,s),y(s,{code:m.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(s=this._getOrReturnCtx(t,s),y(s,{code:m.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(s=this._getOrReturnCtx(t,s),y(s,{code:m.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?$h(o).test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{code:m.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?uC.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{code:m.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?lC(o).test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{code:m.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?eC.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"duration",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?fC(t.data,o.version)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"ip",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?dC(t.data,o.alg)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"jwt",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?pC(t.data,o.version)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"cidr",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?aC.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"base64",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?cC.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"base64url",code:m.invalid_string,message:o.message}),n.dirty()):M.assertNever(o);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(s=>t.test(s),{validation:r,code:m.invalid_string,..._.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",..._.errToObj(t)})}url(t){return this._addCheck({kind:"url",..._.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",..._.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",..._.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",..._.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",..._.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",..._.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",..._.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",..._.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",..._.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",..._.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",..._.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",..._.errToObj(t)})}datetime(t){var r,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:(r=t?.offset)!==null&&r!==void 0?r:!1,local:(n=t?.local)!==null&&n!==void 0?n:!1,..._.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,..._.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",..._.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,..._.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,..._.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,..._.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,..._.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,..._.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,..._.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,..._.errToObj(r)})}nonempty(t){return this.min(1,_.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};lt.create=e=>{var t;return new lt({checks:[],typeName:R.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...$(e)})};function mC(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,o=parseInt(e.toFixed(s).replace(".","")),i=parseInt(t.toFixed(s).replace(".",""));return o%i/Math.pow(10,s)}var Ot=class e extends D{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==S.number){let o=this._getOrReturnCtx(t);return y(o,{code:m.invalid_type,expected:S.number,received:o.parsedType}),k}let n,s=new ee;for(let o of this._def.checks)o.kind==="int"?M.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),y(n,{code:m.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),y(n,{code:m.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),y(n,{code:m.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?mC(t.data,o.value)!==0&&(n=this._getOrReturnCtx(t,n),y(n,{code:m.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),y(n,{code:m.not_finite,message:o.message}),s.dirty()):M.assertNever(o);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,_.toString(r))}gt(t,r){return this.setLimit("min",t,!1,_.toString(r))}lte(t,r){return this.setLimit("max",t,!0,_.toString(r))}lt(t,r){return this.setLimit("max",t,!1,_.toString(r))}setLimit(t,r,n,s){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:_.toString(s)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:_.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:_.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:_.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:_.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:_.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:_.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:_.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:_.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:_.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&M.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};Ot.create=e=>new Ot({checks:[],typeName:R.ZodNumber,coerce:e?.coerce||!1,...$(e)});var Rt=class e extends D{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==S.bigint)return this._getInvalidInput(t);let n,s=new ee;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),y(n,{code:m.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),y(n,{code:m.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),y(n,{code:m.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):M.assertNever(o);return{status:s.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return y(r,{code:m.invalid_type,expected:S.bigint,received:r.parsedType}),k}gte(t,r){return this.setLimit("min",t,!0,_.toString(r))}gt(t,r){return this.setLimit("min",t,!1,_.toString(r))}lte(t,r){return this.setLimit("max",t,!0,_.toString(r))}lt(t,r){return this.setLimit("max",t,!1,_.toString(r))}setLimit(t,r,n,s){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:_.toString(s)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:_.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:_.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:_.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:_.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:_.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Rt.create=e=>{var t;return new Rt({checks:[],typeName:R.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...$(e)})};var kt=class extends D{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==S.boolean){let n=this._getOrReturnCtx(t);return y(n,{code:m.invalid_type,expected:S.boolean,received:n.parsedType}),k}return oe(t.data)}};kt.create=e=>new kt({typeName:R.ZodBoolean,coerce:e?.coerce||!1,...$(e)});var Ct=class e extends D{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==S.date){let o=this._getOrReturnCtx(t);return y(o,{code:m.invalid_type,expected:S.date,received:o.parsedType}),k}if(isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return y(o,{code:m.invalid_date}),k}let n=new ee,s;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(s=this._getOrReturnCtx(t,s),y(s,{code:m.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(s=this._getOrReturnCtx(t,s),y(s,{code:m.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):M.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:_.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:_.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};Ct.create=e=>new Ct({checks:[],coerce:e?.coerce||!1,typeName:R.ZodDate,...$(e)});var dr=class extends D{_parse(t){if(this._getType(t)!==S.symbol){let n=this._getOrReturnCtx(t);return y(n,{code:m.invalid_type,expected:S.symbol,received:n.parsedType}),k}return oe(t.data)}};dr.create=e=>new dr({typeName:R.ZodSymbol,...$(e)});var At=class extends D{_parse(t){if(this._getType(t)!==S.undefined){let n=this._getOrReturnCtx(t);return y(n,{code:m.invalid_type,expected:S.undefined,received:n.parsedType}),k}return oe(t.data)}};At.create=e=>new At({typeName:R.ZodUndefined,...$(e)});var It=class extends D{_parse(t){if(this._getType(t)!==S.null){let n=this._getOrReturnCtx(t);return y(n,{code:m.invalid_type,expected:S.null,received:n.parsedType}),k}return oe(t.data)}};It.create=e=>new It({typeName:R.ZodNull,...$(e)});var ft=class extends D{constructor(){super(...arguments),this._any=!0}_parse(t){return oe(t.data)}};ft.create=e=>new ft({typeName:R.ZodAny,...$(e)});var tt=class extends D{constructor(){super(...arguments),this._unknown=!0}_parse(t){return oe(t.data)}};tt.create=e=>new tt({typeName:R.ZodUnknown,...$(e)});var Me=class extends D{_parse(t){let r=this._getOrReturnCtx(t);return y(r,{code:m.invalid_type,expected:S.never,received:r.parsedType}),k}};Me.create=e=>new Me({typeName:R.ZodNever,...$(e)});var pr=class extends D{_parse(t){if(this._getType(t)!==S.undefined){let n=this._getOrReturnCtx(t);return y(n,{code:m.invalid_type,expected:S.void,received:n.parsedType}),k}return oe(t.data)}};pr.create=e=>new pr({typeName:R.ZodVoid,...$(e)});var rt=class e extends D{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==S.array)return y(r,{code:m.invalid_type,expected:S.array,received:r.parsedType}),k;if(s.exactLength!==null){let i=r.data.length>s.exactLength.value,a=r.data.length<s.exactLength.value;(i||a)&&(y(r,{code:i?m.too_big:m.too_small,minimum:a?s.exactLength.value:void 0,maximum:i?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(y(r,{code:m.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(y(r,{code:m.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,a)=>s.type._parseAsync(new Re(r,i,r.path,a)))).then(i=>ee.mergeArray(n,i));let o=[...r.data].map((i,a)=>s.type._parseSync(new Re(r,i,r.path,a)));return ee.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:_.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:_.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:_.toString(r)}})}nonempty(t){return this.min(1,t)}};rt.create=(e,t)=>new rt({type:e,minLength:null,maxLength:null,exactLength:null,typeName:R.ZodArray,...$(t)});function ur(e){if(e instanceof ue){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Oe.create(ur(n))}return new ue({...e._def,shape:()=>t})}else return e instanceof rt?new rt({...e._def,type:ur(e.element)}):e instanceof Oe?Oe.create(ur(e.unwrap())):e instanceof We?We.create(ur(e.unwrap())):e instanceof ze?ze.create(e.items.map(t=>ur(t))):e}var ue=class e extends D{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=M.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==S.object){let u=this._getOrReturnCtx(t);return y(u,{code:m.invalid_type,expected:S.object,received:u.parsedType}),k}let{status:n,ctx:s}=this._processInputParams(t),{shape:o,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof Me&&this._def.unknownKeys==="strip"))for(let u in s.data)i.includes(u)||a.push(u);let c=[];for(let u of i){let l=o[u],f=s.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Re(s,f,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof Me){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of a)c.push({key:{status:"valid",value:l},value:{status:"valid",value:s.data[l]}});else if(u==="strict")a.length>0&&(y(s,{code:m.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let l of a){let f=s.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Re(s,f,s.path,l)),alwaysSet:l in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let f=await l.key,p=await l.value;u.push({key:f,value:p,alwaysSet:l.alwaysSet})}return u}).then(u=>ee.mergeObjectSync(n,u)):ee.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return _.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var s,o,i,a;let c=(i=(o=(s=this._def).errorMap)===null||o===void 0?void 0:o.call(s,r,n).message)!==null&&i!==void 0?i:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=_.errToObj(t).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:R.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};return M.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new e({...this._def,shape:()=>r})}omit(t){let r={};return M.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new e({...this._def,shape:()=>r})}deepPartial(){return ur(this)}partial(t){let r={};return M.objectKeys(this.shape).forEach(n=>{let s=this.shape[n];t&&!t[n]?r[n]=s:r[n]=s.optional()}),new e({...this._def,shape:()=>r})}required(t){let r={};return M.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof Oe;)o=o._def.innerType;r[n]=o}}),new e({...this._def,shape:()=>r})}keyof(){return Dh(M.objectKeys(this.shape))}};ue.create=(e,t)=>new ue({shape:()=>e,unknownKeys:"strip",catchall:Me.create(),typeName:R.ZodObject,...$(t)});ue.strictCreate=(e,t)=>new ue({shape:()=>e,unknownKeys:"strict",catchall:Me.create(),typeName:R.ZodObject,...$(t)});ue.lazycreate=(e,t)=>new ue({shape:e,unknownKeys:"strip",catchall:Me.create(),typeName:R.ZodObject,...$(t)});var $t=class extends D{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function s(o){for(let a of o)if(a.result.status==="valid")return a.result;for(let a of o)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let i=o.map(a=>new he(a.ctx.common.issues));return y(r,{code:m.invalid_union,unionErrors:i}),k}if(r.common.async)return Promise.all(n.map(async o=>{let i={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(s);{let o,i=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},l=c._parseSync({data:r.data,path:r.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!o&&(o={result:l,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let a=i.map(c=>new he(c));return y(r,{code:m.invalid_union,unionErrors:a}),k}}get options(){return this._def.options}};$t.create=(e,t)=>new $t({options:e,typeName:R.ZodUnion,...$(t)});var Qe=e=>e instanceof Lt?Qe(e.schema):e instanceof ge?Qe(e.innerType()):e instanceof Nt?[e.value]:e instanceof Pt?e.options:e instanceof Mt?M.objectValues(e.enum):e instanceof Ft?Qe(e._def.innerType):e instanceof At?[void 0]:e instanceof It?[null]:e instanceof Oe?[void 0,...Qe(e.unwrap())]:e instanceof We?[null,...Qe(e.unwrap())]:e instanceof Jr||e instanceof Bt?Qe(e.unwrap()):e instanceof jt?Qe(e._def.innerType):[],Fs=class e extends D{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==S.object)return y(r,{code:m.invalid_type,expected:S.object,received:r.parsedType}),k;let n=this.discriminator,s=r.data[n],o=this.optionsMap.get(s);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(y(r,{code:m.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),k)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let s=new Map;for(let o of r){let i=Qe(o.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let a of i){if(s.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);s.set(a,o)}}return new e({typeName:R.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:s,...$(n)})}};function xa(e,t){let r=et(e),n=et(t);if(e===t)return{valid:!0,data:e};if(r===S.object&&n===S.object){let s=M.objectKeys(t),o=M.objectKeys(e).filter(a=>s.indexOf(a)!==-1),i={...e,...t};for(let a of o){let c=xa(e[a],t[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(r===S.array&&n===S.array){if(e.length!==t.length)return{valid:!1};let s=[];for(let o=0;o<e.length;o++){let i=e[o],a=t[o],c=xa(i,a);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return r===S.date&&n===S.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Dt=class extends D{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),s=(o,i)=>{if(wa(o)||wa(i))return k;let a=xa(o.value,i.value);return a.valid?((Sa(o)||Sa(i))&&r.dirty(),{status:r.value,value:a.data}):(y(n,{code:m.invalid_intersection_types}),k)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,i])=>s(o,i)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Dt.create=(e,t,r)=>new Dt({left:e,right:t,typeName:R.ZodIntersection,...$(r)});var ze=class e extends D{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==S.array)return y(n,{code:m.invalid_type,expected:S.array,received:n.parsedType}),k;if(n.data.length<this._def.items.length)return y(n,{code:m.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),k;!this._def.rest&&n.data.length>this._def.items.length&&(y(n,{code:m.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((i,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new Re(n,i,n.path,a)):null}).filter(i=>!!i);return n.common.async?Promise.all(o).then(i=>ee.mergeArray(r,i)):ee.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};ze.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ze({items:e,typeName:R.ZodTuple,rest:null,...$(t)})};var js=class e extends D{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==S.object)return y(n,{code:m.invalid_type,expected:S.object,received:n.parsedType}),k;let s=[],o=this._def.keyType,i=this._def.valueType;for(let a in n.data)s.push({key:o._parse(new Re(n,a,n.path,a)),value:i._parse(new Re(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?ee.mergeObjectAsync(r,s):ee.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof D?new e({keyType:t,valueType:r,typeName:R.ZodRecord,...$(n)}):new e({keyType:lt.create(),valueType:t,typeName:R.ZodRecord,...$(r)})}},mr=class extends D{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==S.map)return y(n,{code:m.invalid_type,expected:S.map,received:n.parsedType}),k;let s=this._def.keyType,o=this._def.valueType,i=[...n.data.entries()].map(([a,c],u)=>({key:s._parse(new Re(n,a,n.path,[u,"key"])),value:o._parse(new Re(n,c,n.path,[u,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of i){let u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return k;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of i){let u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return k;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}}}};mr.create=(e,t,r)=>new mr({valueType:t,keyType:e,typeName:R.ZodMap,...$(r)});var hr=class e extends D{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==S.set)return y(n,{code:m.invalid_type,expected:S.set,received:n.parsedType}),k;let s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(y(n,{code:m.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(y(n,{code:m.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());let o=this._def.valueType;function i(c){let u=new Set;for(let l of c){if(l.status==="aborted")return k;l.status==="dirty"&&r.dirty(),u.add(l.value)}return{status:r.value,value:u}}let a=[...n.data.values()].map((c,u)=>o._parse(new Re(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>i(c)):i(a)}min(t,r){return new e({...this._def,minSize:{value:t,message:_.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:_.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};hr.create=(e,t)=>new hr({valueType:e,minSize:null,maxSize:null,typeName:R.ZodSet,...$(t)});var Bs=class e extends D{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==S.function)return y(r,{code:m.invalid_type,expected:S.function,received:r.parsedType}),k;function n(a,c){return Ps({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ns(),fr].filter(u=>!!u),issueData:{code:m.invalid_arguments,argumentsError:c}})}function s(a,c){return Ps({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ns(),fr].filter(u=>!!u),issueData:{code:m.invalid_return_type,returnTypeError:c}})}let o={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof dt){let a=this;return oe(async function(...c){let u=new he([]),l=await a._def.args.parseAsync(c,o).catch(d=>{throw u.addIssue(n(c,d)),u}),f=await Reflect.apply(i,this,l);return await a._def.returns._def.type.parseAsync(f,o).catch(d=>{throw u.addIssue(s(f,d)),u})})}else{let a=this;return oe(function(...c){let u=a._def.args.safeParse(c,o);if(!u.success)throw new he([n(c,u.error)]);let l=Reflect.apply(i,this,u.data),f=a._def.returns.safeParse(l,o);if(!f.success)throw new he([s(l,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:ze.create(t).rest(tt.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||ze.create([]).rest(tt.create()),returns:r||tt.create(),typeName:R.ZodFunction,...$(n)})}},Lt=class extends D{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Lt.create=(e,t)=>new Lt({getter:e,typeName:R.ZodLazy,...$(t)});var Nt=class extends D{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return y(r,{received:r.data,code:m.invalid_literal,expected:this._def.value}),k}return{status:"valid",value:t.data}}get value(){return this._def.value}};Nt.create=(e,t)=>new Nt({value:e,typeName:R.ZodLiteral,...$(t)});function Dh(e,t){return new Pt({values:e,typeName:R.ZodEnum,...$(t)})}var Pt=class e extends D{constructor(){super(...arguments),Yr.set(this,void 0)}_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return y(r,{expected:M.joinValues(n),received:r.parsedType,code:m.invalid_type}),k}if(Ms(this,Yr,"f")||Ch(this,Yr,new Set(this._def.values),"f"),!Ms(this,Yr,"f").has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return y(r,{received:r.data,code:m.invalid_enum_value,options:n}),k}return oe(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};Yr=new WeakMap;Pt.create=Dh;var Mt=class extends D{constructor(){super(...arguments),Xr.set(this,void 0)}_parse(t){let r=M.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==S.string&&n.parsedType!==S.number){let s=M.objectValues(r);return y(n,{expected:M.joinValues(s),received:n.parsedType,code:m.invalid_type}),k}if(Ms(this,Xr,"f")||Ch(this,Xr,new Set(M.getValidEnumValues(this._def.values)),"f"),!Ms(this,Xr,"f").has(t.data)){let s=M.objectValues(r);return y(n,{received:n.data,code:m.invalid_enum_value,options:s}),k}return oe(t.data)}get enum(){return this._def.values}};Xr=new WeakMap;Mt.create=(e,t)=>new Mt({values:e,typeName:R.ZodNativeEnum,...$(t)});var dt=class extends D{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==S.promise&&r.common.async===!1)return y(r,{code:m.invalid_type,expected:S.promise,received:r.parsedType}),k;let n=r.parsedType===S.promise?r.data:Promise.resolve(r.data);return oe(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}};dt.create=(e,t)=>new dt({type:e,typeName:R.ZodPromise,...$(t)});var ge=class extends D{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===R.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),s=this._def.effect||null,o={addIssue:i=>{y(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){let i=s.transform(n.data,o);if(n.common.async)return Promise.resolve(i).then(async a=>{if(r.value==="aborted")return k;let c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?k:c.status==="dirty"||r.value==="dirty"?lr(c.value):c});{if(r.value==="aborted")return k;let a=this._def.schema._parseSync({data:i,path:n.path,parent:n});return a.status==="aborted"?k:a.status==="dirty"||r.value==="dirty"?lr(a.value):a}}if(s.type==="refinement"){let i=a=>{let c=s.refinement(a,o);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?k:(a.status==="dirty"&&r.dirty(),i(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?k:(a.status==="dirty"&&r.dirty(),i(a.value).then(()=>({status:r.value,value:a.value}))))}if(s.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Tt(i))return i;let a=s.transform(i.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>Tt(i)?Promise.resolve(s.transform(i.value,o)).then(a=>({status:r.value,value:a})):i);M.assertNever(s)}};ge.create=(e,t,r)=>new ge({schema:e,typeName:R.ZodEffects,effect:t,...$(r)});ge.createWithPreprocess=(e,t,r)=>new ge({schema:t,effect:{type:"preprocess",transform:e},typeName:R.ZodEffects,...$(r)});var Oe=class extends D{_parse(t){return this._getType(t)===S.undefined?oe(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Oe.create=(e,t)=>new Oe({innerType:e,typeName:R.ZodOptional,...$(t)});var We=class extends D{_parse(t){return this._getType(t)===S.null?oe(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};We.create=(e,t)=>new We({innerType:e,typeName:R.ZodNullable,...$(t)});var Ft=class extends D{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===S.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Ft.create=(e,t)=>new Ft({innerType:e,typeName:R.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...$(t)});var jt=class extends D{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Kr(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new he(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new he(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};jt.create=(e,t)=>new jt({innerType:e,typeName:R.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...$(t)});var gr=class extends D{_parse(t){if(this._getType(t)!==S.nan){let n=this._getOrReturnCtx(t);return y(n,{code:m.invalid_type,expected:S.nan,received:n.parsedType}),k}return{status:"valid",value:t.data}}};gr.create=e=>new gr({typeName:R.ZodNaN,...$(e)});var hC=Symbol("zod_brand"),Jr=class extends D{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Qr=class e extends D{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?k:o.status==="dirty"?(r.dirty(),lr(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?k:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:R.ZodPipeline})}},Bt=class extends D{_parse(t){let r=this._def.innerType._parse(t),n=s=>(Tt(s)&&(s.value=Object.freeze(s.value)),s);return Kr(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}};Bt.create=(e,t)=>new Bt({innerType:e,typeName:R.ZodReadonly,...$(t)});function Oh(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function Lh(e,t={},r){return e?ft.create().superRefine((n,s)=>{var o,i;let a=e(n);if(a instanceof Promise)return a.then(c=>{var u,l;if(!c){let f=Oh(t,n),p=(l=(u=f.fatal)!==null&&u!==void 0?u:r)!==null&&l!==void 0?l:!0;s.addIssue({code:"custom",...f,fatal:p})}});if(!a){let c=Oh(t,n),u=(i=(o=c.fatal)!==null&&o!==void 0?o:r)!==null&&i!==void 0?i:!0;s.addIssue({code:"custom",...c,fatal:u})}}):ft.create()}var gC={object:ue.lazycreate},R;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(R||(R={}));var yC=(e,t={message:`Input not instance of ${e.name}`})=>Lh(r=>r instanceof e,t),Nh=lt.create,Ph=Ot.create,bC=gr.create,wC=Rt.create,Mh=kt.create,SC=Ct.create,xC=dr.create,vC=At.create,_C=It.create,EC=ft.create,TC=tt.create,OC=Me.create,RC=pr.create,kC=rt.create,CC=ue.create,AC=ue.strictCreate,IC=$t.create,$C=Fs.create,DC=Dt.create,LC=ze.create,NC=js.create,PC=mr.create,MC=hr.create,FC=Bs.create,jC=Lt.create,BC=Nt.create,UC=Pt.create,GC=Mt.create,qC=dt.create,Rh=ge.create,VC=Oe.create,zC=We.create,WC=ge.createWithPreprocess,ZC=Qr.create,HC=()=>Nh().optional(),YC=()=>Ph().optional(),XC=()=>Mh().optional(),KC={string:e=>lt.create({...e,coerce:!0}),number:e=>Ot.create({...e,coerce:!0}),boolean:e=>kt.create({...e,coerce:!0}),bigint:e=>Rt.create({...e,coerce:!0}),date:e=>Ct.create({...e,coerce:!0})},JC=k,nt=Object.freeze({__proto__:null,defaultErrorMap:fr,setErrorMap:Wk,getErrorMap:Ns,makeIssue:Ps,EMPTY_PATH:Zk,addIssueToContext:y,ParseStatus:ee,INVALID:k,DIRTY:lr,OK:oe,isAborted:wa,isDirty:Sa,isValid:Tt,isAsync:Kr,get util(){return M},get objectUtil(){return ba},ZodParsedType:S,getParsedType:et,ZodType:D,datetimeRegex:$h,ZodString:lt,ZodNumber:Ot,ZodBigInt:Rt,ZodBoolean:kt,ZodDate:Ct,ZodSymbol:dr,ZodUndefined:At,ZodNull:It,ZodAny:ft,ZodUnknown:tt,ZodNever:Me,ZodVoid:pr,ZodArray:rt,ZodObject:ue,ZodUnion:$t,ZodDiscriminatedUnion:Fs,ZodIntersection:Dt,ZodTuple:ze,ZodRecord:js,ZodMap:mr,ZodSet:hr,ZodFunction:Bs,ZodLazy:Lt,ZodLiteral:Nt,ZodEnum:Pt,ZodNativeEnum:Mt,ZodPromise:dt,ZodEffects:ge,ZodTransformer:ge,ZodOptional:Oe,ZodNullable:We,ZodDefault:Ft,ZodCatch:jt,ZodNaN:gr,BRAND:hC,ZodBranded:Jr,ZodPipeline:Qr,ZodReadonly:Bt,custom:Lh,Schema:D,ZodSchema:D,late:gC,get ZodFirstPartyTypeKind(){return R},coerce:KC,any:EC,array:kC,bigint:wC,boolean:Mh,date:SC,discriminatedUnion:$C,effect:Rh,enum:UC,function:FC,instanceof:yC,intersection:DC,lazy:jC,literal:BC,map:PC,nan:bC,nativeEnum:GC,never:OC,null:_C,nullable:zC,number:Ph,object:CC,oboolean:XC,onumber:YC,optional:VC,ostring:HC,pipeline:ZC,preprocess:WC,promise:qC,record:NC,set:MC,strictObject:AC,string:Nh,symbol:xC,transformer:Rh,tuple:LC,undefined:vC,union:IC,unknown:TC,void:RC,NEVER:JC,ZodIssueCode:m,quotelessJson:zk,ZodError:he});var Fh=nt.object({list:nt.boolean().optional(),log:nt.boolean().optional(),track:nt.boolean(),reporter:nt.boolean().optional(),parser:nt.enum(["babel","babylon","flow","ts","tsx"]).optional(),extensions:nt.string().optional(),ignoreConfig:nt.string().optional()});var oo=gt(Kh(),1),to=gt(Ta(),1),ob=gt(Ra(),1),xr=gt(Ra(),1);import{spawn as gI}from"child_process";import{EventEmitter as $$}from"node:events";var no=Object.defineProperty,CA=Object.defineProperties,AA=Object.getOwnPropertyDescriptor,IA=Object.getOwnPropertyDescriptors,Za=Object.getOwnPropertyNames,Jh=Object.getOwnPropertySymbols,Ig=Object.prototype.hasOwnProperty,$A=Object.prototype.propertyIsEnumerable,Qh=(e,t,r)=>t in e?no(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ce=(e,t)=>{for(var r in t||(t={}))Ig.call(t,r)&&Qh(e,r,t[r]);if(Jh)for(var r of Jh(t))$A.call(t,r)&&Qh(e,r,t[r]);return e},rn=(e,t)=>CA(e,IA(t)),g=(e,t)=>function(){return e&&(t=(0,e[Za(e)[0]])(e=0)),t},DA=(e,t)=>function(){return t||(0,e[Za(e)[0]])((t={exports:{}}).exports,t),t.exports},Z=(e,t)=>{for(var r in t)no(e,r,{get:t[r],enumerable:!0})},LA=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Za(t))!Ig.call(e,s)&&s!==r&&no(e,s,{get:()=>t[s],enumerable:!(n=AA(t,s))||n.enumerable});return e},q=e=>LA(no({},"__esModule",{value:!0}),e),tn=(e,t,r)=>new Promise((n,s)=>{var o=c=>{try{a(r.next(c))}catch(u){s(u)}},i=c=>{try{a(r.throw(c))}catch(u){s(u)}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(o,i);a((r=r.apply(e,t)).next())});function NA(...e){let t=new String(e);return so.set(t,e),t}function Qs(e){return e instanceof String&&so.has(e)}function eg(e){return so.get(e)||[]}var so,an=g({"src/lib/args/pathspec.ts"(){"use strict";so=new WeakMap}}),ot,mt=g({"src/lib/errors/git-error.ts"(){"use strict";ot=class extends Error{constructor(e,t){super(t),this.task=e,Object.setPrototypeOf(this,new.target.prototype)}}}}),cn,_r=g({"src/lib/errors/git-response-error.ts"(){"use strict";mt(),cn=class extends ot{constructor(e,t){super(void 0,t||String(e)),this.git=e}}}}),$g,Dg=g({"src/lib/errors/task-configuration-error.ts"(){"use strict";mt(),$g=class extends ot{constructor(e){super(void 0,e)}}}});function Lg(e){return typeof e=="function"?e:zt}function Ng(e){return typeof e=="function"&&e!==zt}function Pg(e,t){let r=e.indexOf(t);return r<=0?[e,""]:[e.substr(0,r),e.substr(r+1)]}function Mg(e,t=0){return Fg(e)&&e.length>t?e[t]:void 0}function Vt(e,t=0){if(Fg(e)&&e.length>t)return e[e.length-1-t]}function Fg(e){return!!(e&&typeof e.length=="number")}function un(e="",t=!0,r=`
56
+ `){return e.split(r).reduce((n,s)=>{let o=t?s.trim():s;return o&&n.push(o),n},[])}function Ha(e,t){return un(e,!0).map(r=>t(r))}function Ya(e){return(0,oo.exists)(e,oo.FOLDER)}function F(e,t){return Array.isArray(e)?e.includes(t)||e.push(t):e.add(t),t}function jg(e,t){return Array.isArray(e)&&!e.includes(t)&&e.push(t),e}function io(e,t){if(Array.isArray(e)){let r=e.indexOf(t);r>=0&&e.splice(r,1)}else e.delete(t);return t}function Ze(e){return Array.isArray(e)?e:[e]}function Bg(e){return e.replace(/[\s-]+(.)/g,(t,r)=>r.toUpperCase())}function Ug(e){return Ze(e).map(String)}function B(e,t=0){if(e==null)return t;let r=parseInt(e,10);return isNaN(r)?t:r}function nn(e,t){let r=[];for(let n=0,s=e.length;n<s;n++)r.push(t,e[n]);return r}function sn(e){return(Array.isArray(e)?Buffer.concat(e):e).toString("utf-8")}function Gg(e,t){return Object.assign({},...t.map(r=>r in e?{[r]:e[r]}:{}))}function La(e=0){return new Promise(t=>setTimeout(t,e))}function Na(e){if(e!==!1)return e}var vr,zt,ln,ao=g({"src/lib/utils/util.ts"(){"use strict";vr="\0",zt=()=>{},ln=Object.prototype.toString.call.bind(Object.prototype.toString)}});function He(e,t,r){return t(e)?e:arguments.length>2?r:void 0}function Xa(e,t){let r=Qs(e)?"string":typeof e;return/number|string|boolean/.test(r)&&(!t||!t.includes(r))}function Ka(e){return!!e&&ln(e)==="[object Object]"}function qg(e){return typeof e=="function"}var fn,te,Vg,eo,Ja,zg=g({"src/lib/utils/argument-filters.ts"(){"use strict";ao(),an(),fn=e=>Array.isArray(e),te=e=>typeof e=="string",Vg=e=>Array.isArray(e)&&e.every(te),eo=e=>te(e)||Array.isArray(e)&&e.every(te),Ja=e=>e==null||"number|boolean|function".includes(typeof e)?!1:Array.isArray(e)||typeof e=="string"||typeof e.length=="number"}}),Pa,PA=g({"src/lib/utils/exit-codes.ts"(){"use strict";Pa=(e=>(e[e.SUCCESS=0]="SUCCESS",e[e.ERROR=1]="ERROR",e[e.NOT_FOUND=-2]="NOT_FOUND",e[e.UNCLEAN=128]="UNCLEAN",e))(Pa||{})}}),on,MA=g({"src/lib/utils/git-output-streams.ts"(){"use strict";on=class{constructor(e,t){this.stdOut=e,this.stdErr=t}asStrings(){return new on(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}}),I,pt,FA=g({"src/lib/utils/line-parser.ts"(){"use strict";I=class{constructor(e,t){this.matches=[],this.parse=(r,n)=>(this.resetMatches(),this._regExp.every((s,o)=>this.addMatch(s,o,r(o)))?this.useMatches(n,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(e)?e:[e],t&&(this.useMatches=t)}useMatches(e,t){throw new Error("LineParser:useMatches not implemented")}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(e,t,r){let n=r&&e.exec(r);return n&&this.pushMatch(t,n),!!n}pushMatch(e,t){this.matches.push(...t.slice(1))}},pt=class extends I{addMatch(e,t,r){return/^remote:\s/.test(String(r))&&super.addMatch(e,t,r)}pushMatch(e,t){(e>0||t.length>1)&&super.pushMatch(e,t)}}}});function Wg(...e){let t=process.cwd(),r=Object.assign(Ce({baseDir:t},Zg),...e.filter(n=>typeof n=="object"&&n));return r.baseDir=r.baseDir||t,r.trimmed=r.trimmed===!0,r}var Zg,jA=g({"src/lib/utils/simple-git-options.ts"(){"use strict";Zg={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function Qa(e,t=[]){return Ka(e)?Object.keys(e).reduce((r,n)=>{let s=e[n];return Qs(s)?r.push(s):Xa(s,["boolean"])?r.push(n+"="+s):r.push(n),r},t):t}function le(e,t=0,r=!1){let n=[];for(let s=0,o=t<0?e.length:t;s<o;s++)"string|number".includes(typeof e[s])&&n.push(String(e[s]));return Qa(ec(e),n),r||n.push(...BA(e)),n}function BA(e){let t=typeof Vt(e)=="function";return He(Vt(e,t?1:0),fn,[])}function ec(e){let t=qg(Vt(e));return He(Vt(e,t?1:0),Ka)}function V(e,t=!0){let r=Lg(Vt(e));return t||Ng(r)?r:void 0}var UA=g({"src/lib/utils/task-options.ts"(){"use strict";zg(),ao(),an()}});function Ma(e,t){return e(t.stdOut,t.stdErr)}function de(e,t,r,n=!0){return Ze(r).forEach(s=>{for(let o=un(s,n),i=0,a=o.length;i<a;i++){let c=(u=0)=>{if(!(i+u>=a))return o[i+u]};t.some(({parse:u})=>u(c,e))}}),e}var GA=g({"src/lib/utils/task-parser.ts"(){"use strict";ao()}}),Hg={};Z(Hg,{ExitCodes:()=>Pa,GitOutputStreams:()=>on,LineParser:()=>I,NOOP:()=>zt,NULL:()=>vr,RemoteLineParser:()=>pt,append:()=>F,appendTaskOptions:()=>Qa,asArray:()=>Ze,asCamelCase:()=>Bg,asFunction:()=>Lg,asNumber:()=>B,asStringArray:()=>Ug,bufferToString:()=>sn,callTaskParser:()=>Ma,createInstanceConfig:()=>Wg,delay:()=>La,filterArray:()=>fn,filterFunction:()=>qg,filterHasLength:()=>Ja,filterPlainObject:()=>Ka,filterPrimitives:()=>Xa,filterString:()=>te,filterStringArray:()=>Vg,filterStringOrStringArray:()=>eo,filterType:()=>He,first:()=>Mg,folderExists:()=>Ya,forEachLineWithContent:()=>Ha,getTrailingOptions:()=>le,including:()=>jg,isUserFunction:()=>Ng,last:()=>Vt,objectToString:()=>ln,orVoid:()=>Na,parseStringResponse:()=>de,pick:()=>Gg,prefixedArray:()=>nn,remove:()=>io,splitOn:()=>Pg,toLinesWithContent:()=>un,trailingFunctionArgument:()=>V,trailingOptionsArgument:()=>ec});var C=g({"src/lib/utils/index.ts"(){"use strict";zg(),PA(),MA(),FA(),jA(),UA(),GA(),ao()}}),Yg={};Z(Yg,{CheckRepoActions:()=>Fa,checkIsBareRepoTask:()=>Kg,checkIsRepoRootTask:()=>Xg,checkIsRepoTask:()=>qA});function qA(e){switch(e){case"bare":return Kg();case"root":return Xg()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:co,parser:tc}}function Xg(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:co,parser(t){return/^\.(git)?$/.test(t.trim())}}}function Kg(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:co,parser:tc}}function VA(e){return/(Not a git repository|Kein Git-Repository)/i.test(String(e))}var Fa,co,tc,Jg=g({"src/lib/tasks/check-is-repo.ts"(){"use strict";C(),Fa=(e=>(e.BARE="bare",e.IN_TREE="tree",e.IS_REPO_ROOT="root",e))(Fa||{}),co=({exitCode:e},t,r,n)=>{if(e===128&&VA(t))return r(Buffer.from("false"));n(t)},tc=e=>e.trim()==="true"}});function zA(e,t){let r=new Qg(e),n=e?ty:ey;return un(t).forEach(s=>{let o=s.replace(n,"");r.paths.push(o),(ry.test(o)?r.folders:r.files).push(o)}),r}var Qg,ey,ty,ry,WA=g({"src/lib/responses/CleanSummary.ts"(){"use strict";C(),Qg=class{constructor(e){this.dryRun=e,this.paths=[],this.files=[],this.folders=[]}},ey=/^[a-z]+\s*/i,ty=/^[a-z]+\s+[a-z]+\s*/i,ry=/\/$/}}),ja={};Z(ja,{EMPTY_COMMANDS:()=>uo,adhocExecTask:()=>ny,configurationErrorTask:()=>fe,isBufferTask:()=>oy,isEmptyTask:()=>iy,straightThroughBufferTask:()=>sy,straightThroughStringTask:()=>ie});function ny(e){return{commands:uo,format:"empty",parser:e}}function fe(e){return{commands:uo,format:"empty",parser(){throw typeof e=="string"?new $g(e):e}}}function ie(e,t=!1){return{commands:e,format:"utf-8",parser(r){return t?String(r).trim():r}}}function sy(e){return{commands:e,format:"buffer",parser(t){return t}}}function oy(e){return e.format==="buffer"}function iy(e){return e.format==="empty"||!e.commands.length}var uo,W=g({"src/lib/tasks/task.ts"(){"use strict";Dg(),uo=[]}}),ay={};Z(ay,{CONFIG_ERROR_INTERACTIVE_MODE:()=>rc,CONFIG_ERROR_MODE_REQUIRED:()=>nc,CONFIG_ERROR_UNKNOWN_OPTION:()=>sc,CleanOptions:()=>Ys,cleanTask:()=>cy,cleanWithOptionsTask:()=>ZA,isCleanOptionsArray:()=>HA});function ZA(e,t){let{cleanMode:r,options:n,valid:s}=YA(e);return r?s.options?(n.push(...t),n.some(JA)?fe(rc):cy(r,n)):fe(sc+JSON.stringify(e)):fe(nc)}function cy(e,t){return{commands:["clean",`-${e}`,...t],format:"utf-8",parser(n){return zA(e==="n",n)}}}function HA(e){return Array.isArray(e)&&e.every(t=>oc.has(t))}function YA(e){let t,r=[],n={cleanMode:!1,options:!0};return e.replace(/[^a-z]i/g,"").split("").forEach(s=>{XA(s)?(t=s,n.cleanMode=!0):n.options=n.options&&KA(r[r.length]=`-${s}`)}),{cleanMode:t,options:r,valid:n}}function XA(e){return e==="f"||e==="n"}function KA(e){return/^-[a-z]$/i.test(e)&&oc.has(e.charAt(1))}function JA(e){return/^-[^\-]/.test(e)?e.indexOf("i")>0:e==="--interactive"}var rc,nc,sc,Ys,oc,uy=g({"src/lib/tasks/clean.ts"(){"use strict";WA(),C(),W(),rc="Git clean interactive mode is not supported",nc='Git clean mode parameter ("n" or "f") is required',sc="Git clean unknown option found in: ",Ys=(e=>(e.DRY_RUN="n",e.FORCE="f",e.IGNORED_INCLUDED="x",e.IGNORED_ONLY="X",e.EXCLUDING="e",e.QUIET="q",e.RECURSIVE="d",e))(Ys||{}),oc=new Set(["i",...Ug(Object.values(Ys))])}});function QA(e){let t=new fy;for(let r of ly(e))t.addValue(r.file,String(r.key),r.value);return t}function eI(e,t){let r=null,n=[],s=new Map;for(let o of ly(e,t))o.key===t&&(n.push(r=o.value),s.has(o.file)||s.set(o.file,[]),s.get(o.file).push(r));return{key:t,paths:Array.from(s.keys()),scopes:s,value:r,values:n}}function tI(e){return e.replace(/^(file):/,"")}function*ly(e,t=null){let r=e.split("\0");for(let n=0,s=r.length-1;n<s;){let o=tI(r[n++]),i=r[n++],a=t;if(i.includes(`
57
+ `)){let c=Pg(i,`
58
+ `);a=c[0],i=c[1]}yield{file:o,key:a,value:i}}}var fy,rI=g({"src/lib/responses/ConfigList.ts"(){"use strict";C(),fy=class{constructor(){this.files=[],this.values=Object.create(null)}get all(){return this._all||(this._all=this.files.reduce((e,t)=>Object.assign(e,this.values[t]),{})),this._all}addFile(e){if(!(e in this.values)){let t=Vt(this.files);this.values[e]=t?Object.create(this.values[t]):{},this.files.push(e)}return this.values[e]}addValue(e,t,r){let n=this.addFile(e);n.hasOwnProperty(t)?Array.isArray(n[t])?n[t].push(r):n[t]=[n[t],r]:n[t]=r,this._all=void 0}}}});function ka(e,t){return typeof e=="string"&&Ba.hasOwnProperty(e)?e:t}function nI(e,t,r,n){let s=["config",`--${n}`];return r&&s.push("--add"),s.push(e,t),{commands:s,format:"utf-8",parser(o){return o}}}function sI(e,t){let r=["config","--null","--show-origin","--get-all",e];return t&&r.splice(1,0,`--${t}`),{commands:r,format:"utf-8",parser(n){return eI(n,e)}}}function oI(e){let t=["config","--list","--show-origin","--null"];return e&&t.push(`--${e}`),{commands:t,format:"utf-8",parser(r){return QA(r)}}}function iI(){return{addConfig(e,t,...r){return this._runTask(nI(e,t,r[0]===!0,ka(r[1],"local")),V(arguments))},getConfig(e,t){return this._runTask(sI(e,ka(t,void 0)),V(arguments))},listConfig(...e){return this._runTask(oI(ka(e[0],void 0)),V(arguments))}}}var Ba,dy=g({"src/lib/tasks/config.ts"(){"use strict";rI(),C(),Ba=(e=>(e.system="system",e.global="global",e.local="local",e.worktree="worktree",e))(Ba||{})}});function aI(e){return py.has(e)}var Ca,py,my=g({"src/lib/tasks/diff-name-status.ts"(){"use strict";Ca=(e=>(e.ADDED="A",e.COPIED="C",e.DELETED="D",e.MODIFIED="M",e.RENAMED="R",e.CHANGED="T",e.UNMERGED="U",e.UNKNOWN="X",e.BROKEN="B",e))(Ca||{}),py=new Set(Object.values(Ca))}});function cI(...e){return new gy().param(...e)}function uI(e){let t=new Set,r={};return Ha(e,n=>{let[s,o,i]=n.split(vr);t.add(s),(r[s]=r[s]||[]).push({line:B(o),path:s,preview:i})}),{paths:t,results:r}}function lI(){return{grep(e){let t=V(arguments),r=le(arguments);for(let s of hy)if(r.includes(s))return this._runTask(fe(`git.grep: use of "${s}" is not supported.`),t);typeof e=="string"&&(e=cI().param(e));let n=["grep","--null","-n","--full-name",...r,...e];return this._runTask({commands:n,format:"utf-8",parser(s){return uI(s)}},t)}}}var hy,en,tg,gy,yy=g({"src/lib/tasks/grep.ts"(){"use strict";C(),W(),hy=["-h"],en=Symbol("grepQuery"),gy=class{constructor(){this[tg]=[]}*[(tg=en,Symbol.iterator)](){for(let e of this[en])yield e}and(...e){return e.length&&this[en].push("--and","(",...nn(e,"-e"),")"),this}param(...e){return this[en].push(...nn(e,"-e")),this}}}}),by={};Z(by,{ResetMode:()=>Xs,getResetMode:()=>dI,resetTask:()=>fI});function fI(e,t){let r=["reset"];return wy(e)&&r.push(`--${e}`),r.push(...t),ie(r)}function dI(e){if(wy(e))return e;switch(typeof e){case"string":case"undefined":return"soft"}}function wy(e){return Sy.includes(e)}var Xs,Sy,xy=g({"src/lib/tasks/reset.ts"(){"use strict";W(),Xs=(e=>(e.MIXED="mixed",e.SOFT="soft",e.HARD="hard",e.MERGE="merge",e.KEEP="keep",e))(Xs||{}),Sy=Array.from(Object.values(Xs))}});function pI(){return(0,to.default)("simple-git")}function rg(e,t,r){return!t||!String(t).replace(/\s*/,"")?r?(n,...s)=>{e(n,...s),r(n,...s)}:e:(n,...s)=>{e(`%s ${n}`,t,...s),r&&r(n,...s)}}function mI(e,t,{namespace:r}){if(typeof e=="string")return e;let n=t&&t.namespace||"";return n.startsWith(r)?n.substr(r.length+1):n||r}function ic(e,t,r,n=pI()){let s=e&&`[${e}]`||"",o=[],i=typeof t=="string"?n.extend(t):t,a=mI(He(t,te),i,n);return u(r);function c(l,f){return F(o,ic(e,a.replace(/^[^:]+/,l),f,n))}function u(l){let f=l&&`[${l}]`||"",p=i&&rg(i,f)||zt,d=rg(n,`${s} ${f}`,p);return Object.assign(i?p:d,{label:e,sibling:c,info:d,step:u})}}var vy=g({"src/lib/git-logger.ts"(){"use strict";C(),to.default.formatters.L=e=>String(Ja(e)?e.length:"-"),to.default.formatters.B=e=>Buffer.isBuffer(e)?e.toString("utf8"):ln(e)}}),Zs,Ua,hI=g({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";mt(),vy(),Zs=class{constructor(e="GitExecutor"){this.logLabel=e,this._queue=new Map}withProgress(e){return this._queue.get(e)}createProgress(e){let t=Zs.getName(e.commands[0]),r=ic(this.logLabel,t);return{task:e,logger:r,name:t}}push(e){let t=this.createProgress(e);return t.logger("Adding task to the queue, commands = %o",e.commands),this._queue.set(e,t),t}fatal(e){for(let[t,{logger:r}]of Array.from(this._queue.entries()))t===e.task?(r.info("Failed %o",e),r("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):r.info("A fatal exception occurred in a previous task, the queue has been purged: %o",e.message),this.complete(t);if(this._queue.size!==0)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(e){this.withProgress(e)&&this._queue.delete(e)}attempt(e){let t=this.withProgress(e);if(!t)throw new ot(void 0,"TasksPendingQueue: attempt called for an unknown task");return t.logger("Starting task"),t}static getName(e="empty"){return`task:${e}:${++Zs.counter}`}},Ua=Zs,Ua.counter=0}});function qt(e,t){return{method:Mg(e.commands)||"",commands:t}}function yI(e,t){return r=>{t("[ERROR] child process exception %o",r),e.push(Buffer.from(String(r.stack),"ascii"))}}function ng(e,t,r,n){return s=>{r("%s received %L bytes",t,s),n("%B",s),e.push(s)}}var Ga,bI=g({"src/lib/runners/git-executor-chain.ts"(){"use strict";mt(),W(),C(),hI(),Ga=class{constructor(e,t,r){this._executor=e,this._scheduler=t,this._plugins=r,this._chain=Promise.resolve(),this._queue=new Ua}get cwd(){return this._cwd||this._executor.cwd}set cwd(e){this._cwd=e}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(e){return this._queue.push(e),this._chain=this._chain.then(()=>this.attemptTask(e))}attemptTask(e){return tn(this,null,function*(){let t=yield this._scheduler.next(),r=()=>this._queue.complete(e);try{let{logger:n}=this._queue.attempt(e);return yield iy(e)?this.attemptEmptyTask(e,n):this.attemptRemoteTask(e,n)}catch(n){throw this.onFatalException(e,n)}finally{r(),t()}})}onFatalException(e,t){let r=t instanceof ot?Object.assign(t,{task:e}):new ot(e,t&&String(t));return this._chain=Promise.resolve(),this._queue.fatal(r),r}attemptRemoteTask(e,t){return tn(this,null,function*(){let r=this._plugins.exec("spawn.binary","",qt(e,e.commands)),n=this._plugins.exec("spawn.args",[...e.commands],qt(e,e.commands)),s=yield this.gitResponse(e,r,n,this.outputHandler,t.step("SPAWN")),o=yield this.handleTaskData(e,n,s,t.step("HANDLE"));return t("passing response to task's parser as a %s",e.format),oy(e)?Ma(e.parser,o):Ma(e.parser,o.asStrings())})}attemptEmptyTask(e,t){return tn(this,null,function*(){return t("empty task bypassing child process to call to task's parser"),e.parser(this)})}handleTaskData(e,t,r,n){let{exitCode:s,rejection:o,stdOut:i,stdErr:a}=r;return new Promise((c,u)=>{n("Preparing to handle process response exitCode=%d stdOut=",s);let{error:l}=this._plugins.exec("task.error",{error:o},Ce(Ce({},qt(e,t)),r));if(l&&e.onError)return n.info("exitCode=%s handling with custom error handler"),e.onError(r,l,f=>{n.info("custom error handler treated as success"),n("custom error returned a %s",ln(f)),c(new on(Array.isArray(f)?Buffer.concat(f):f,Buffer.concat(a)))},u);if(l)return n.info("handling as error: exitCode=%s stdErr=%s rejection=%o",s,a.length,o),u(l);n.info("retrieving task output complete"),c(new on(Buffer.concat(i),Buffer.concat(a)))})}gitResponse(e,t,r,n,s){return tn(this,null,function*(){let o=s.sibling("output"),i=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},qt(e,e.commands));return new Promise(a=>{let c=[],u=[];s.info("%s %o",t,r),s("%O",i);let l=this._beforeSpawn(e,r);if(l)return a({stdOut:c,stdErr:u,exitCode:9901,rejection:l});this._plugins.exec("spawn.before",void 0,rn(Ce({},qt(e,r)),{kill(p){l=p||l}}));let f=gI(t,r,i);f.stdout.on("data",ng(c,"stdOut",s,o.step("stdOut"))),f.stderr.on("data",ng(u,"stdErr",s,o.step("stdErr"))),f.on("error",yI(u,s)),n&&(s("Passing child process stdOut/stdErr to custom outputHandler"),n(t,f.stdout,f.stderr,[...r])),this._plugins.exec("spawn.after",void 0,rn(Ce({},qt(e,r)),{spawned:f,close(p,d){a({stdOut:c,stdErr:u,exitCode:p,rejection:l||d})},kill(p){f.killed||(l=p,f.kill("SIGINT"))}}))})})}_beforeSpawn(e,t){let r;return this._plugins.exec("spawn.before",void 0,rn(Ce({},qt(e,t)),{kill(n){r=n||r}})),r}}}}),_y={};Z(_y,{GitExecutor:()=>Ey});var Ey,wI=g({"src/lib/runners/git-executor.ts"(){"use strict";bI(),Ey=class{constructor(e,t,r){this.cwd=e,this._scheduler=t,this._plugins=r,this._chain=new Ga(this,this._scheduler,this._plugins)}chain(){return new Ga(this,this._scheduler,this._plugins)}push(e){return this._chain.push(e)}}}});function SI(e,t,r=zt){let n=o=>{r(null,o)},s=o=>{o?.task===e&&r(o instanceof cn?xI(o):o,void 0)};t.then(n,s)}function xI(e){let t=n=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${n} should be GitResponseError.git.${n}, this will no longer be available in version 3`),t=zt};return Object.create(e,Object.getOwnPropertyNames(e.git).reduce(r,{}));function r(n,s){return s in e||(n[s]={enumerable:!1,configurable:!1,get(){return t(s),e.git[s]}}),n}}var vI=g({"src/lib/task-callback.ts"(){"use strict";_r(),C()}});function sg(e,t){return ny(r=>{if(!Ya(e))throw new Error(`Git.cwd: cannot change to non-directory "${e}"`);return(t||r).cwd=e})}var _I=g({"src/lib/tasks/change-working-directory.ts"(){"use strict";C(),W()}});function Aa(e){let t=["checkout",...e];return t[1]==="-b"&&t.includes("-B")&&(t[1]=io(t,"-B")),ie(t)}function EI(){return{checkout(){return this._runTask(Aa(le(arguments,1)),V(arguments))},checkoutBranch(e,t){return this._runTask(Aa(["-b",e,t,...le(arguments)]),V(arguments))},checkoutLocalBranch(e){return this._runTask(Aa(["-b",e,...le(arguments)]),V(arguments))}}}var TI=g({"src/lib/tasks/checkout.ts"(){"use strict";C(),W()}});function OI(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function RI(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(e){return de(OI(),[Ty],e)}})}}}var Ty,kI=g({"src/lib/tasks/count-objects.ts"(){"use strict";C(),Ty=new I(/([a-z-]+): (\d+)$/,(e,[t,r])=>{let n=Bg(t);e.hasOwnProperty(n)&&(e[n]=B(r))})}});function CI(e){return de({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},Oy,e)}var Oy,AI=g({"src/lib/parsers/parse-commit.ts"(){"use strict";C(),Oy=[new I(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(e,[t,r,n])=>{e.branch=t,e.commit=n,e.root=!!r}),new I(/\s*Author:\s(.+)/i,(e,[t])=>{let r=t.split("<"),n=r.pop();!n||!n.includes("@")||(e.author={email:n.substr(0,n.length-1),name:r.join("<").trim()})}),new I(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(e,[t,r,n])=>{e.summary.changes=parseInt(t,10)||0,e.summary.insertions=parseInt(r,10)||0,e.summary.deletions=parseInt(n,10)||0}),new I(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(e,[t,r,n])=>{e.summary.changes=parseInt(t,10)||0;let s=parseInt(r,10)||0;n==="-"?e.summary.deletions=s:n==="+"&&(e.summary.insertions=s)})]}});function II(e,t,r){return{commands:["-c","core.abbrev=40","commit",...nn(e,"-m"),...t,...r],format:"utf-8",parser:CI}}function $I(){return{commit(t,...r){let n=V(arguments),s=e(t)||II(Ze(t),Ze(He(r[0],eo,[])),[...He(r[1],fn,[]),...le(arguments,0,!0)]);return this._runTask(s,n)}};function e(t){return!eo(t)&&fe("git.commit: requires the commit message to be supplied as a string/string[]")}}var DI=g({"src/lib/tasks/commit.ts"(){"use strict";AI(),C(),W()}});function LI(){return{firstCommit(){return this._runTask(ie(["rev-list","--max-parents=0","HEAD"],!0),V(arguments))}}}var NI=g({"src/lib/tasks/first-commit.ts"(){"use strict";C(),W()}});function PI(e,t){let r=["hash-object",e];return t&&r.push("-w"),ie(r,!0)}var MI=g({"src/lib/tasks/hash-object.ts"(){"use strict";W()}});function FI(e,t,r){let n=String(r).trim(),s;if(s=Ry.exec(n))return new Ks(e,t,!1,s[1]);if(s=ky.exec(n))return new Ks(e,t,!0,s[1]);let o="",i=n.split(" ");for(;i.length;)if(i.shift()==="in"){o=i.join(" ");break}return new Ks(e,t,/^re/i.test(n),o)}var Ks,Ry,ky,jI=g({"src/lib/responses/InitSummary.ts"(){"use strict";Ks=class{constructor(e,t,r,n){this.bare=e,this.path=t,this.existing=r,this.gitDir=n}},Ry=/^Init.+ repository in (.+)$/,ky=/^Rein.+ in (.+)$/}});function BI(e){return e.includes(ac)}function UI(e=!1,t,r){let n=["init",...r];return e&&!BI(n)&&n.splice(1,0,ac),{commands:n,format:"utf-8",parser(s){return FI(n.includes("--bare"),t,s)}}}var ac,GI=g({"src/lib/tasks/init.ts"(){"use strict";jI(),ac="--bare"}});function cc(e){for(let t=0;t<e.length;t++){let r=uc.exec(e[t]);if(r)return`--${r[1]}`}return""}function qI(e){return uc.test(e)}var uc,dn=g({"src/lib/args/log-format.ts"(){"use strict";uc=/^--(stat|numstat|name-only|name-status)(=|$)/}}),Cy,VI=g({"src/lib/responses/DiffSummary.ts"(){"use strict";Cy=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function Ay(e=""){let t=Iy[e];return r=>de(new Cy,t,r,!1)}var Ia,og,ig,ag,Iy,$y=g({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";dn(),VI(),my(),C(),Ia=[new I(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(e,[t,r,n=""])=>{e.files.push({file:t.trim(),changes:B(r),insertions:n.replace(/[^+]/g,"").length,deletions:n.replace(/[^-]/g,"").length,binary:!1})}),new I(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(e,[t,r,n])=>{e.files.push({file:t.trim(),before:B(r),after:B(n),binary:!0})}),new I(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(e,[t,r])=>{let n=/(\d+) i/.exec(r),s=/(\d+) d/.exec(r);e.changed=B(t),e.insertions=B(n?.[1]),e.deletions=B(s?.[1])})],og=[new I(/(\d+)\t(\d+)\t(.+)$/,(e,[t,r,n])=>{let s=B(t),o=B(r);e.changed++,e.insertions+=s,e.deletions+=o,e.files.push({file:n,changes:s+o,insertions:s,deletions:o,binary:!1})}),new I(/-\t-\t(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,after:0,before:0,binary:!0})})],ig=[new I(/(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,changes:0,insertions:0,deletions:0,binary:!1})})],ag=[new I(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(e,[t,r,n,s,o])=>{e.changed++,e.files.push({file:o??n,changes:0,insertions:0,deletions:0,binary:!1,status:Na(aI(t)&&t),from:Na(!!o&&n!==o&&n),similarity:B(r)})})],Iy={"":Ia,"--stat":Ia,"--numstat":og,"--name-status":ag,"--name-only":ig}}});function zI(e,t){return t.reduce((r,n,s)=>(r[n]=e[s]||"",r),Object.create({diff:null}))}function Dy(e=dc,t=Ly,r=""){let n=Ay(r);return function(s){let o=un(s.trim(),!1,lc).map(function(i){let a=i.split(fc),c=zI(a[0].split(e),t);return a.length>1&&a[1].trim()&&(c.diff=n(a[1])),c});return{all:o,latest:o.length&&o[0]||null,total:o.length}}}var lc,fc,dc,Ly,Ny=g({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";C(),$y(),dn(),lc="\xF2\xF2\xF2\xF2\xF2\xF2 ",fc=" \xF2\xF2",dc=" \xF2 ",Ly=["hash","date","message","refs","author_name","author_email"]}}),Py={};Z(Py,{diffSummaryTask:()=>WI,validateLogFormatConfig:()=>lo});function WI(e){let t=cc(e),r=["diff"];return t===""&&(t="--stat",r.push("--stat=4096")),r.push(...e),lo(r)||{commands:r,format:"utf-8",parser:Ay(t)}}function lo(e){let t=e.filter(qI);if(t.length>1)return fe(`Summary flags are mutually exclusive - pick one of ${t.join(",")}`);if(t.length&&e.includes("-z"))return fe(`Summary flag ${t} parsing is not compatible with null termination option '-z'`)}var pc=g({"src/lib/tasks/diff.ts"(){"use strict";dn(),$y(),W()}});function ZI(e,t){let r=[],n=[];return Object.keys(e).forEach(s=>{r.push(s),n.push(String(e[s]))}),[r,n.join(t)]}function HI(e){return Object.keys(e).reduce((t,r)=>(r in qa||(t[r]=e[r]),t),{})}function My(e={},t=[]){let r=He(e.splitter,te,dc),n=!Xa(e.format)&&e.format?e.format:{hash:"%H",date:e.strictDate===!1?"%ai":"%aI",message:"%s",refs:"%D",body:e.multiLine?"%B":"%b",author_name:e.mailMap!==!1?"%aN":"%an",author_email:e.mailMap!==!1?"%aE":"%ae"},[s,o]=ZI(n,r),i=[],a=[`--pretty=format:${lc}${o}${fc}`,...t],c=e.n||e["max-count"]||e.maxCount;if(c&&a.push(`--max-count=${c}`),e.from||e.to){let u=e.symmetric!==!1?"...":"..";i.push(`${e.from||""}${u}${e.to||""}`)}return te(e.file)&&a.push("--follow",NA(e.file)),Qa(HI(e),a),{fields:s,splitter:r,commands:[...a,...i]}}function YI(e,t,r){let n=Dy(e,t,cc(r));return{commands:["log",...r],format:"utf-8",parser:n}}function XI(){return{log(...r){let n=V(arguments),s=My(ec(arguments),He(arguments[0],fn)),o=t(...r)||lo(s.commands)||e(s);return this._runTask(o,n)}};function e(r){return YI(r.splitter,r.fields,r.commands)}function t(r,n){return te(r)&&te(n)&&fe("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}var qa,Fy=g({"src/lib/tasks/log.ts"(){"use strict";dn(),an(),Ny(),C(),W(),pc(),qa=(e=>(e[e["--pretty"]=0]="--pretty",e[e["max-count"]=1]="max-count",e[e.maxCount=2]="maxCount",e[e.n=3]="n",e[e.file=4]="file",e[e.format=5]="format",e[e.from=6]="from",e[e.to=7]="to",e[e.splitter=8]="splitter",e[e.symmetric=9]="symmetric",e[e.mailMap=10]="mailMap",e[e.multiLine=11]="multiLine",e[e.strictDate=12]="strictDate",e))(qa||{})}}),Js,jy,KI=g({"src/lib/responses/MergeSummary.ts"(){"use strict";Js=class{constructor(e,t=null,r){this.reason=e,this.file=t,this.meta=r}toString(){return`${this.file}:${this.reason}`}},jy=class{constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(", ")}`:"OK"}}}}),Va,By,JI=g({"src/lib/responses/PullSummary.ts"(){"use strict";Va=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},By=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function $a(e){return e.objects=e.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function cg(e){let t=/^\s*(\d+)/.exec(e),r=/delta (\d+)/i.exec(e);return{count:B(t&&t[1]||"0"),delta:B(r&&r[1]||"0")}}var Uy,QI=g({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";C(),Uy=[new pt(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(e,[t,r])=>{let n=t.toLowerCase(),s=$a(e.remoteMessages);Object.assign(s,{[n]:B(r)})}),new pt(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(e,[t,r])=>{let n=t.toLowerCase(),s=$a(e.remoteMessages);Object.assign(s,{[n]:B(r)})}),new pt(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(e,[t,r,n])=>{let s=$a(e.remoteMessages);s.total=cg(t),s.reused=cg(r),s.packReused=B(n)})]}});function Gy(e,t){return de({remoteMessages:new Vy},qy,t)}var qy,Vy,zy=g({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";C(),QI(),qy=[new pt(/^remote:\s*(.+)$/,(e,[t])=>(e.remoteMessages.all.push(t.trim()),!1)),...Uy,new pt([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(e,[t])=>{e.remoteMessages.pullRequestUrl=t}),new pt([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(e,[t,r,n])=>{e.remoteMessages.vulnerabilities={count:B(t),summary:r,url:n}})],Vy=class{constructor(){this.all=[]}}}});function e1(e,t){let r=de(new By,Wy,[e,t]);return r.message&&r}var ug,lg,fg,dg,Wy,pg,mc,Zy=g({"src/lib/parsers/parse-pull.ts"(){"use strict";JI(),C(),zy(),ug=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,lg=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,fg=/^(create|delete) mode \d+ (.+)/,dg=[new I(ug,(e,[t,r,n])=>{e.files.push(t),r&&(e.insertions[t]=r.length),n&&(e.deletions[t]=n.length)}),new I(lg,(e,[t,,r,,n])=>r!==void 0||n!==void 0?(e.summary.changes=+t||0,e.summary.insertions=+r||0,e.summary.deletions=+n||0,!0):!1),new I(fg,(e,[t,r])=>{F(e.files,r),F(t==="create"?e.created:e.deleted,r)})],Wy=[new I(/^from\s(.+)$/i,(e,[t])=>void(e.remote=t)),new I(/^fatal:\s(.+)$/,(e,[t])=>void(e.message=t)),new I(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(e,[t,r,n,s])=>{e.branch.local=n,e.hash.local=t,e.branch.remote=s,e.hash.remote=r})],pg=(e,t)=>de(new Va,dg,[e,t]),mc=(e,t)=>Object.assign(new Va,pg(e,t),Gy(e,t))}}),mg,Hy,hg,t1=g({"src/lib/parsers/parse-merge.ts"(){"use strict";KI(),C(),Zy(),mg=[new I(/^Auto-merging\s+(.+)$/,(e,[t])=>{e.merges.push(t)}),new I(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(e,[t,r])=>{e.conflicts.push(new Js(t,r))}),new I(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(e,[t,r,n])=>{e.conflicts.push(new Js(t,r,{deleteRef:n}))}),new I(/^CONFLICT\s+\((.+)\):/,(e,[t])=>{e.conflicts.push(new Js(t,null))}),new I(/^Automatic merge failed;\s+(.+)$/,(e,[t])=>{e.result=t})],Hy=(e,t)=>Object.assign(hg(e,t),mc(e,t)),hg=e=>de(new jy,mg,e)}});function gg(e){return e.length?{commands:["merge",...e],format:"utf-8",parser(t,r){let n=Hy(t,r);if(n.failed)throw new cn(n);return n}}:fe("Git.merge requires at least one option")}var r1=g({"src/lib/tasks/merge.ts"(){"use strict";_r(),t1(),W()}});function n1(e,t,r){let n=r.includes("deleted"),s=r.includes("tag")||/^refs\/tags/.test(e),o=!r.includes("new");return{deleted:n,tag:s,branch:!s,new:!o,alreadyUpdated:o,local:e,remote:t}}var yg,Yy,bg,s1=g({"src/lib/parsers/parse-push.ts"(){"use strict";C(),zy(),yg=[new I(/^Pushing to (.+)$/,(e,[t])=>{e.repo=t}),new I(/^updating local tracking ref '(.+)'/,(e,[t])=>{e.ref=rn(Ce({},e.ref||{}),{local:t})}),new I(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(e,[t,r,n])=>{e.pushed.push(n1(t,r,n))}),new I(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(e,[t,r,n])=>{e.branch=rn(Ce({},e.branch||{}),{local:t,remote:r,remoteName:n})}),new I(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(e,[t,r,n,s])=>{e.update={head:{local:t,remote:r},hash:{from:n,to:s}}})],Yy=(e,t)=>{let r=bg(e,t),n=Gy(e,t);return Ce(Ce({},r),n)},bg=(e,t)=>de({pushed:[]},yg,[e,t])}}),Xy={};Z(Xy,{pushTagsTask:()=>o1,pushTask:()=>hc});function o1(e={},t){return F(t,"--tags"),hc(e,t)}function hc(e={},t){let r=["push",...t];return e.branch&&r.splice(1,0,e.branch),e.remote&&r.splice(1,0,e.remote),io(r,"-v"),F(r,"--verbose"),F(r,"--porcelain"),{commands:r,format:"utf-8",parser:Yy}}var Ky=g({"src/lib/tasks/push.ts"(){"use strict";s1(),C()}});function i1(){return{showBuffer(){let e=["show",...le(arguments,1)];return e.includes("--binary")||e.splice(1,0,"--binary"),this._runTask(sy(e),V(arguments))},show(){let e=["show",...le(arguments,1)];return this._runTask(ie(e),V(arguments))}}}var a1=g({"src/lib/tasks/show.ts"(){"use strict";C(),W()}}),wg,Jy,c1=g({"src/lib/responses/FileStatusSummary.ts"(){"use strict";wg=/^(.+)\0(.+)$/,Jy=class{constructor(e,t,r){if(this.path=e,this.index=t,this.working_dir=r,t==="R"||r==="R"){let n=wg.exec(e)||[null,e,e];this.from=n[2]||"",this.path=n[1]||""}}}}});function Sg(e){let[t,r]=e.split(vr);return{from:r||t,to:t}}function we(e,t,r){return[`${e}${t}`,r]}function Da(e,...t){return t.map(r=>we(e,r,(n,s)=>F(n.conflicted,s)))}function u1(e,t){let r=t.trim();switch(" "){case r.charAt(2):return n(r.charAt(0),r.charAt(1),r.substr(3));case r.charAt(1):return n(" ",r.charAt(0),r.substr(2));default:return}function n(s,o,i){let a=`${s}${o}`,c=Qy.get(a);c&&c(e,i),a!=="##"&&a!=="!!"&&e.files.push(new Jy(i,s,o))}}var xg,Qy,eb,l1=g({"src/lib/responses/StatusSummary.ts"(){"use strict";C(),c1(),xg=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},Qy=new Map([we(" ","A",(e,t)=>F(e.created,t)),we(" ","D",(e,t)=>F(e.deleted,t)),we(" ","M",(e,t)=>F(e.modified,t)),we("A"," ",(e,t)=>F(e.created,t)&&F(e.staged,t)),we("A","M",(e,t)=>F(e.created,t)&&F(e.staged,t)&&F(e.modified,t)),we("D"," ",(e,t)=>F(e.deleted,t)&&F(e.staged,t)),we("M"," ",(e,t)=>F(e.modified,t)&&F(e.staged,t)),we("M","M",(e,t)=>F(e.modified,t)&&F(e.staged,t)),we("R"," ",(e,t)=>{F(e.renamed,Sg(t))}),we("R","M",(e,t)=>{let r=Sg(t);F(e.renamed,r),F(e.modified,r.to)}),we("!","!",(e,t)=>{F(e.ignored=e.ignored||[],t)}),we("?","?",(e,t)=>F(e.not_added,t)),...Da("A","A","U"),...Da("D","D","U"),...Da("U","A","D","U"),["##",(e,t)=>{let r=/ahead (\d+)/,n=/behind (\d+)/,s=/^(.+?(?=(?:\.{3}|\s|$)))/,o=/\.{3}(\S*)/,i=/\son\s([\S]+)$/,a;a=r.exec(t),e.ahead=a&&+a[1]||0,a=n.exec(t),e.behind=a&&+a[1]||0,a=s.exec(t),e.current=a&&a[1],a=o.exec(t),e.tracking=a&&a[1],a=i.exec(t),e.current=a&&a[1]||e.current,e.detached=/\(no branch\)/.test(t)}]]),eb=function(e){let t=e.split(vr),r=new xg;for(let n=0,s=t.length;n<s;){let o=t[n++].trim();o&&(o.charAt(0)==="R"&&(o+=vr+(t[n++]||"")),u1(r,o))}return r}}});function f1(e){return{format:"utf-8",commands:["status","--porcelain","-b","-u","--null",...e.filter(r=>!tb.includes(r))],parser(r){return eb(r)}}}var tb,d1=g({"src/lib/tasks/status.ts"(){"use strict";l1(),tb=["--null","-z"]}});function ro(e=0,t=0,r=0,n="",s=!0){return Object.defineProperty({major:e,minor:t,patch:r,agent:n,installed:s},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function p1(){return ro(0,0,0,"",!1)}function m1(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:h1,onError(e,t,r,n){if(e.exitCode===-2)return r(Buffer.from(gc));n(t)}})}}}function h1(e){return e===gc?p1():de(ro(0,0,0,e),rb,e)}var gc,rb,g1=g({"src/lib/tasks/version.ts"(){"use strict";C(),gc="installed=false",rb=[new I(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(e,[t,r,n,s=""])=>{Object.assign(e,ro(B(t),B(r),B(n),s))}),new I(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(e,[t,r,n,s=""])=>{Object.assign(e,ro(B(t),B(r),n,s))})]}}),nb={};Z(nb,{SimpleGitApi:()=>za});var za,y1=g({"src/lib/simple-git-api.ts"(){"use strict";vI(),_I(),TI(),kI(),DI(),dy(),NI(),yy(),MI(),GI(),Fy(),r1(),Ky(),a1(),d1(),W(),g1(),C(),za=class{constructor(e){this._executor=e}_runTask(e,t){let r=this._executor.chain(),n=r.push(e);return t&&SI(e,n,t),Object.create(this,{then:{value:n.then.bind(n)},catch:{value:n.catch.bind(n)},_executor:{value:r}})}add(e){return this._runTask(ie(["add",...Ze(e)]),V(arguments))}cwd(e){let t=V(arguments);return typeof e=="string"?this._runTask(sg(e,this._executor),t):typeof e?.path=="string"?this._runTask(sg(e.path,e.root&&this._executor||void 0),t):this._runTask(fe("Git.cwd: workingDirectory must be supplied as a string"),t)}hashObject(e,t){return this._runTask(PI(e,t===!0),V(arguments))}init(e){return this._runTask(UI(e===!0,this._executor.cwd,le(arguments)),V(arguments))}merge(){return this._runTask(gg(le(arguments)),V(arguments))}mergeFromTo(e,t){return te(e)&&te(t)?this._runTask(gg([e,t,...le(arguments)]),V(arguments,!1)):this._runTask(fe("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(e){return this._executor.outputHandler=e,this}push(){let e=hc({remote:He(arguments[0],te),branch:He(arguments[1],te)},le(arguments));return this._runTask(e,V(arguments))}stash(){return this._runTask(ie(["stash",...le(arguments)]),V(arguments))}status(){return this._runTask(f1(le(arguments)),V(arguments))}},Object.assign(za.prototype,EI(),$I(),iI(),RI(),LI(),lI(),XI(),i1(),m1())}}),sb={};Z(sb,{Scheduler:()=>ib});var vg,ib,b1=g({"src/lib/runners/scheduler.ts"(){"use strict";C(),vy(),vg=(()=>{let e=0;return()=>{e++;let{promise:t,done:r}=(0,ob.createDeferred)();return{promise:t,done:r,id:e}}})(),ib=class{constructor(e=2){this.concurrency=e,this.logger=ic("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",e)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger("Schedule attempt ignored, pending=%s running=%s concurrency=%s",this.pending.length,this.running.length,this.concurrency);return}let e=F(this.running,this.pending.shift());this.logger("Attempting id=%s",e.id),e.done(()=>{this.logger("Completing id=",e.id),io(this.running,e),this.schedule()})}next(){let{promise:e,id:t}=F(this.pending,vg());return this.logger("Scheduling id=%s",t),this.schedule(),e}}}}),ab={};Z(ab,{applyPatchTask:()=>w1});function w1(e,t){return ie(["apply",...t,...e])}var S1=g({"src/lib/tasks/apply-patch.ts"(){"use strict";W()}});function x1(e,t){return{branch:e,hash:t,success:!0}}function v1(e){return{branch:e,hash:null,success:!1}}var cb,_1=g({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";cb=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function ub(e,t){return t===1&&Wa.test(e)}var _g,Wa,Eg,fo,E1=g({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";_1(),C(),_g=/(\S+)\s+\(\S+\s([^)]+)\)/,Wa=/^error[^']+'([^']+)'/m,Eg=[new I(_g,(e,[t,r])=>{let n=x1(t,r);e.all.push(n),e.branches[t]=n}),new I(Wa,(e,[t])=>{let r=v1(t);e.errors.push(r),e.all.push(r),e.branches[t]=r})],fo=(e,t)=>de(new cb,Eg,[e,t])}}),lb,T1=g({"src/lib/responses/BranchSummary.ts"(){"use strict";lb=class{constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(e,t,r,n,s){e==="*"&&(this.detached=t,this.current=r),this.all.push(r),this.branches[r]={current:e==="*",linkedWorkTree:e==="+",name:r,commit:n,label:s}}}}});function Tg(e){return e?e.charAt(0):""}function fb(e){return de(new lb,db,e)}var db,O1=g({"src/lib/parsers/parse-branch.ts"(){"use strict";T1(),C(),db=[new I(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(e,[t,r,n,s])=>{e.push(Tg(t),!0,r,n,s)}),new I(new RegExp("^([*+]\\s)?(\\S+)\\s+([a-z0-9]+)\\s?(.*)$","s"),(e,[t,r,n,s])=>{e.push(Tg(t),!1,r,n,s)})]}}),pb={};Z(pb,{branchLocalTask:()=>k1,branchTask:()=>R1,containsDeleteBranchCommand:()=>mb,deleteBranchTask:()=>A1,deleteBranchesTask:()=>C1});function mb(e){let t=["-d","-D","--delete"];return e.some(r=>t.includes(r))}function R1(e){let t=mb(e),r=["branch",...e];return r.length===1&&r.push("-a"),r.includes("-v")||r.splice(1,0,"-v"),{format:"utf-8",commands:r,parser(n,s){return t?fo(n,s).all[0]:fb(n)}}}function k1(){return{format:"utf-8",commands:["branch","-v"],parser:fb}}function C1(e,t=!1){return{format:"utf-8",commands:["branch","-v",t?"-D":"-d",...e],parser(r,n){return fo(r,n)},onError({exitCode:r,stdOut:n},s,o,i){if(!ub(String(s),r))return i(s);o(n)}}}function A1(e,t=!1){let r={format:"utf-8",commands:["branch","-v",t?"-D":"-d",e],parser(n,s){return fo(n,s).branches[e]},onError({exitCode:n,stdErr:s,stdOut:o},i,a,c){if(!ub(String(i),n))return c(i);throw new cn(r.parser(sn(o),sn(s)),String(i))}};return r}var I1=g({"src/lib/tasks/branch.ts"(){"use strict";_r(),E1(),O1(),C()}}),hb,$1=g({"src/lib/responses/CheckIgnore.ts"(){"use strict";hb=e=>e.split(/\n/g).map(t=>t.trim()).filter(t=>!!t)}}),gb={};Z(gb,{checkIgnoreTask:()=>D1});function D1(e){return{commands:["check-ignore",...e],format:"utf-8",parser:hb}}var L1=g({"src/lib/tasks/check-ignore.ts"(){"use strict";$1()}}),yb={};Z(yb,{cloneMirrorTask:()=>P1,cloneTask:()=>bb});function N1(e){return/^--upload-pack(=|$)/.test(e)}function bb(e,t,r){let n=["clone",...r];return te(e)&&n.push(e),te(t)&&n.push(t),n.find(N1)?fe("git.fetch: potential exploit argument blocked."):ie(n)}function P1(e,t,r){return F(r,"--mirror"),bb(e,t,r)}var M1=g({"src/lib/tasks/clone.ts"(){"use strict";W(),C()}});function F1(e,t){return de({raw:e,remote:null,branches:[],tags:[],updated:[],deleted:[]},wb,[e,t])}var wb,j1=g({"src/lib/parsers/parse-fetch.ts"(){"use strict";C(),wb=[new I(/From (.+)$/,(e,[t])=>{e.remote=t}),new I(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.branches.push({name:t,tracking:r})}),new I(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.tags.push({name:t,tracking:r})}),new I(/- \[deleted]\s+\S+\s*-> (.+)$/,(e,[t])=>{e.deleted.push({tracking:t})}),new I(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(e,[t,r,n,s])=>{e.updated.push({name:n,tracking:s,to:r,from:t})})]}}),Sb={};Z(Sb,{fetchTask:()=>U1});function B1(e){return/^--upload-pack(=|$)/.test(e)}function U1(e,t,r){let n=["fetch",...r];return e&&t&&n.push(e,t),n.find(B1)?fe("git.fetch: potential exploit argument blocked."):{commands:n,format:"utf-8",parser:F1}}var G1=g({"src/lib/tasks/fetch.ts"(){"use strict";j1(),W()}});function q1(e){return de({moves:[]},xb,e)}var xb,V1=g({"src/lib/parsers/parse-move.ts"(){"use strict";C(),xb=[new I(/^Renaming (.+) to (.+)$/,(e,[t,r])=>{e.moves.push({from:t,to:r})})]}}),vb={};Z(vb,{moveTask:()=>z1});function z1(e,t){return{commands:["mv","-v",...Ze(e),t],format:"utf-8",parser:q1}}var W1=g({"src/lib/tasks/move.ts"(){"use strict";V1(),C()}}),_b={};Z(_b,{pullTask:()=>Z1});function Z1(e,t,r){let n=["pull",...r];return e&&t&&n.splice(1,0,e,t),{commands:n,format:"utf-8",parser(s,o){return mc(s,o)},onError(s,o,i,a){let c=e1(sn(s.stdOut),sn(s.stdErr));if(c)return a(new cn(c));a(o)}}}var H1=g({"src/lib/tasks/pull.ts"(){"use strict";_r(),Zy(),C()}});function Y1(e){let t={};return Eb(e,([r])=>t[r]={name:r}),Object.values(t)}function X1(e){let t={};return Eb(e,([r,n,s])=>{t.hasOwnProperty(r)||(t[r]={name:r,refs:{fetch:"",push:""}}),s&&n&&(t[r].refs[s.replace(/[^a-z]/g,"")]=n)}),Object.values(t)}function Eb(e,t){Ha(e,r=>t(r.split(/\s+/)))}var K1=g({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";C()}}),Tb={};Z(Tb,{addRemoteTask:()=>J1,getRemotesTask:()=>Q1,listRemotesTask:()=>e$,remoteTask:()=>t$,removeRemoteTask:()=>r$});function J1(e,t,r){return ie(["remote","add",...r,e,t])}function Q1(e){let t=["remote"];return e&&t.push("-v"),{commands:t,format:"utf-8",parser:e?X1:Y1}}function e$(e){let t=[...e];return t[0]!=="ls-remote"&&t.unshift("ls-remote"),ie(t)}function t$(e){let t=[...e];return t[0]!=="remote"&&t.unshift("remote"),ie(t)}function r$(e){return ie(["remote","remove",e])}var n$=g({"src/lib/tasks/remote.ts"(){"use strict";K1(),W()}}),Ob={};Z(Ob,{stashListTask:()=>s$});function s$(e={},t){let r=My(e),n=["stash","list",...r.commands,...t],s=Dy(r.splitter,r.fields,cc(n));return lo(n)||{commands:n,format:"utf-8",parser:s}}var o$=g({"src/lib/tasks/stash-list.ts"(){"use strict";dn(),Ny(),pc(),Fy()}}),Rb={};Z(Rb,{addSubModuleTask:()=>i$,initSubModuleTask:()=>a$,subModuleTask:()=>po,updateSubModuleTask:()=>c$});function i$(e,t){return po(["add",e,t])}function a$(e){return po(["init",...e])}function po(e){let t=[...e];return t[0]!=="submodule"&&t.unshift("submodule"),ie(t)}function c$(e){return po(["update",...e])}var u$=g({"src/lib/tasks/sub-module.ts"(){"use strict";W()}});function l$(e,t){let r=isNaN(e),n=isNaN(t);return r!==n?r?1:-1:r?kb(e,t):0}function kb(e,t){return e===t?0:e>t?1:-1}function f$(e){return e.trim()}function Hs(e){return typeof e=="string"&&parseInt(e.replace(/^\D+/g,""),10)||0}var Og,Cb,d$=g({"src/lib/responses/TagList.ts"(){"use strict";Og=class{constructor(e,t){this.all=e,this.latest=t}},Cb=function(e,t=!1){let r=e.split(`
59
+ `).map(f$).filter(Boolean);t||r.sort(function(s,o){let i=s.split("."),a=o.split(".");if(i.length===1||a.length===1)return l$(Hs(i[0]),Hs(a[0]));for(let c=0,u=Math.max(i.length,a.length);c<u;c++){let l=kb(Hs(i[c]),Hs(a[c]));if(l)return l}return 0});let n=t?r[0]:[...r].reverse().find(s=>s.indexOf(".")>=0);return new Og(r,n)}}}),Ab={};Z(Ab,{addAnnotatedTagTask:()=>h$,addTagTask:()=>m$,tagListTask:()=>p$});function p$(e=[]){let t=e.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...e],parser(r){return Cb(r,t)}}}function m$(e){return{format:"utf-8",commands:["tag",e],parser(){return{name:e}}}}function h$(e,t){return{format:"utf-8",commands:["tag","-a","-m",t,e],parser(){return{name:e}}}}var g$=g({"src/lib/tasks/tag.ts"(){"use strict";d$()}}),y$=DA({"src/git.js"(e,t){"use strict";var{GitExecutor:r}=(wI(),q(_y)),{SimpleGitApi:n}=(y1(),q(nb)),{Scheduler:s}=(b1(),q(sb)),{configurationErrorTask:o}=(W(),q(ja)),{asArray:i,filterArray:a,filterPrimitives:c,filterString:u,filterStringOrStringArray:l,filterType:f,getTrailingOptions:p,trailingFunctionArgument:d,trailingOptionsArgument:b}=(C(),q(Hg)),{applyPatchTask:T}=(S1(),q(ab)),{branchTask:N,branchLocalTask:P,deleteBranchesTask:U,deleteBranchTask:H}=(I1(),q(pb)),{checkIgnoreTask:Y}=(L1(),q(gb)),{checkIsRepoTask:Se}=(Jg(),q(Yg)),{cloneTask:ae,cloneMirrorTask:Ae}=(M1(),q(yb)),{cleanWithOptionsTask:Ie,isCleanOptionsArray:xe}=(uy(),q(ay)),{diffSummaryTask:Er}=(pc(),q(Py)),{fetchTask:ht}=(G1(),q(Sb)),{moveTask:qb}=(W1(),q(vb)),{pullTask:Vb}=(H1(),q(_b)),{pushTagsTask:zb}=(Ky(),q(Xy)),{addRemoteTask:Wb,getRemotesTask:Zb,listRemotesTask:Hb,remoteTask:Yb,removeRemoteTask:Xb}=(n$(),q(Tb)),{getResetMode:Kb,resetTask:Jb}=(xy(),q(by)),{stashListTask:Qb}=(o$(),q(Ob)),{addSubModuleTask:ew,initSubModuleTask:tw,subModuleTask:rw,updateSubModuleTask:nw}=(u$(),q(Rb)),{addAnnotatedTagTask:sw,addTagTask:ow,tagListTask:iw}=(g$(),q(Ab)),{straightThroughBufferTask:aw,straightThroughStringTask:Fe}=(W(),q(ja));function O(h,E){this._plugins=E,this._executor=new r(h.baseDir,new s(h.maxConcurrentProcesses),E),this._trimmed=h.trimmed}(O.prototype=Object.create(n.prototype)).constructor=O,O.prototype.customBinary=function(h){return this._plugins.reconfigure("binary",h),this},O.prototype.env=function(h,E){return arguments.length===1&&typeof h=="object"?this._executor.env=h:(this._executor.env=this._executor.env||{})[h]=E,this},O.prototype.stashList=function(h){return this._runTask(Qb(b(arguments)||{},a(h)&&h||[]),d(arguments))};function xc(h,E,j,re){return typeof j!="string"?o(`git.${h}() requires a string 'repoPath'`):E(j,f(re,u),p(arguments))}O.prototype.clone=function(){return this._runTask(xc("clone",ae,...arguments),d(arguments))},O.prototype.mirror=function(){return this._runTask(xc("mirror",Ae,...arguments),d(arguments))},O.prototype.mv=function(h,E){return this._runTask(qb(h,E),d(arguments))},O.prototype.checkoutLatestTag=function(h){var E=this;return this.pull(function(){E.tags(function(j,re){E.checkout(re.latest,h)})})},O.prototype.pull=function(h,E,j,re){return this._runTask(Vb(f(h,u),f(E,u),p(arguments)),d(arguments))},O.prototype.fetch=function(h,E){return this._runTask(ht(f(h,u),f(E,u),p(arguments)),d(arguments))},O.prototype.silent=function(h){return console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3"),this},O.prototype.tags=function(h,E){return this._runTask(iw(p(arguments)),d(arguments))},O.prototype.rebase=function(){return this._runTask(Fe(["rebase",...p(arguments)]),d(arguments))},O.prototype.reset=function(h){return this._runTask(Jb(Kb(h),p(arguments)),d(arguments))},O.prototype.revert=function(h){let E=d(arguments);return typeof h!="string"?this._runTask(o("Commit must be a string"),E):this._runTask(Fe(["revert",...p(arguments,0,!0),h]),E)},O.prototype.addTag=function(h){let E=typeof h=="string"?ow(h):o("Git.addTag requires a tag name");return this._runTask(E,d(arguments))},O.prototype.addAnnotatedTag=function(h,E){return this._runTask(sw(h,E),d(arguments))},O.prototype.deleteLocalBranch=function(h,E,j){return this._runTask(H(h,typeof E=="boolean"?E:!1),d(arguments))},O.prototype.deleteLocalBranches=function(h,E,j){return this._runTask(U(h,typeof E=="boolean"?E:!1),d(arguments))},O.prototype.branch=function(h,E){return this._runTask(N(p(arguments)),d(arguments))},O.prototype.branchLocal=function(h){return this._runTask(P(),d(arguments))},O.prototype.raw=function(h){let E=!Array.isArray(h),j=[].slice.call(E?arguments:h,0);for(let $e=0;$e<j.length&&E;$e++)if(!c(j[$e])){j.splice($e,j.length-$e);break}j.push(...p(arguments,0,!0));var re=d(arguments);return j.length?this._runTask(Fe(j,this._trimmed),re):this._runTask(o("Raw: must supply one or more command to execute"),re)},O.prototype.submoduleAdd=function(h,E,j){return this._runTask(ew(h,E),d(arguments))},O.prototype.submoduleUpdate=function(h,E){return this._runTask(nw(p(arguments,!0)),d(arguments))},O.prototype.submoduleInit=function(h,E){return this._runTask(tw(p(arguments,!0)),d(arguments))},O.prototype.subModule=function(h,E){return this._runTask(rw(p(arguments)),d(arguments))},O.prototype.listRemote=function(){return this._runTask(Hb(p(arguments)),d(arguments))},O.prototype.addRemote=function(h,E,j){return this._runTask(Wb(h,E,p(arguments)),d(arguments))},O.prototype.removeRemote=function(h,E){return this._runTask(Xb(h),d(arguments))},O.prototype.getRemotes=function(h,E){return this._runTask(Zb(h===!0),d(arguments))},O.prototype.remote=function(h,E){return this._runTask(Yb(p(arguments)),d(arguments))},O.prototype.tag=function(h,E){let j=p(arguments);return j[0]!=="tag"&&j.unshift("tag"),this._runTask(Fe(j),d(arguments))},O.prototype.updateServerInfo=function(h){return this._runTask(Fe(["update-server-info"]),d(arguments))},O.prototype.pushTags=function(h,E){let j=zb({remote:f(h,u)},p(arguments));return this._runTask(j,d(arguments))},O.prototype.rm=function(h){return this._runTask(Fe(["rm","-f",...i(h)]),d(arguments))},O.prototype.rmKeepLocal=function(h){return this._runTask(Fe(["rm","--cached",...i(h)]),d(arguments))},O.prototype.catFile=function(h,E){return this._catFile("utf-8",arguments)},O.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)},O.prototype._catFile=function(h,E){var j=d(E),re=["cat-file"],$e=E[0];if(typeof $e=="string")return this._runTask(o("Git.catFile: options must be supplied as an array of strings"),j);Array.isArray($e)&&re.push.apply(re,$e);let bo=h==="buffer"?aw(re):Fe(re);return this._runTask(bo,j)},O.prototype.diff=function(h,E){let j=u(h)?o("git.diff: supplying options as a single string is no longer supported, switch to an array of strings"):Fe(["diff",...p(arguments)]);return this._runTask(j,d(arguments))},O.prototype.diffSummary=function(){return this._runTask(Er(p(arguments,1)),d(arguments))},O.prototype.applyPatch=function(h){let E=l(h)?T(i(h),p([].slice.call(arguments,1))):o("git.applyPatch requires one or more string patches as the first argument");return this._runTask(E,d(arguments))},O.prototype.revparse=function(){let h=["rev-parse",...p(arguments,!0)];return this._runTask(Fe(h,!0),d(arguments))},O.prototype.clean=function(h,E,j){let re=xe(h),$e=re&&h.join("")||f(h,u)||"",bo=p([].slice.call(arguments,re?1:0));return this._runTask(Ie($e,bo),d(arguments))},O.prototype.exec=function(h){let E={commands:[],format:"utf-8",parser(){typeof h=="function"&&h()}};return this._runTask(E)},O.prototype.clearQueue=function(){return this},O.prototype.checkIgnore=function(h,E){return this._runTask(Y(i(f(h,l,[]))),d(arguments))},O.prototype.checkIsRepo=function(h,E){return this._runTask(Se(f(h,u)),d(arguments))},t.exports=O}});an();mt();var b$=class extends ot{constructor(e,t){super(void 0,t),this.config=e}};mt();mt();var st=class extends ot{constructor(e,t,r){super(e,r),this.task=e,this.plugin=t,Object.setPrototypeOf(this,new.target.prototype)}};_r();Dg();Jg();uy();dy();my();yy();xy();function w$(e){return e?[{type:"spawn.before",action(n,s){e.aborted&&s.kill(new st(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,s){function o(){s.kill(new st(void 0,"abort","Abort signal received"))}e.addEventListener("abort",o),s.spawned.on("close",()=>e.removeEventListener("abort",o))}}]:void 0}function S$(e){return typeof e=="string"&&e.trim().toLowerCase()==="-c"}function x$(e,t){if(S$(e)&&/^\s*protocol(.[a-z]+)?.allow/.test(t))throw new st(void 0,"unsafe","Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol")}function v$(e,t){if(/^\s*--(upload|receive)-pack/.test(e))throw new st(void 0,"unsafe","Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack");if(t==="clone"&&/^\s*-u\b/.test(e))throw new st(void 0,"unsafe","Use of clone with option -u is not permitted without enabling allowUnsafePack");if(t==="push"&&/^\s*--exec\b/.test(e))throw new st(void 0,"unsafe","Use of push with option --exec is not permitted without enabling allowUnsafePack")}function _$({allowUnsafeProtocolOverride:e=!1,allowUnsafePack:t=!1}={}){return{type:"spawn.args",action(r,n){return r.forEach((s,o)=>{let i=o<r.length?r[o+1]:"";e||x$(s,i),t||v$(s,n.method)}),r}}}C();function E$(e){let t=nn(e,"-c");return{type:"spawn.args",action(r){return[...t,...r]}}}C();var Rg=(0,xr.deferred)().promise;function T$({onClose:e=!0,onExit:t=50}={}){function r(){let s=-1,o={close:(0,xr.deferred)(),closeTimeout:(0,xr.deferred)(),exit:(0,xr.deferred)(),exitTimeout:(0,xr.deferred)()},i=Promise.race([e===!1?Rg:o.closeTimeout.promise,t===!1?Rg:o.exitTimeout.promise]);return n(e,o.close,o.closeTimeout),n(t,o.exit,o.exitTimeout),{close(a){s=a,o.close.done()},exit(a){s=a,o.exit.done()},get exitCode(){return s},result:i}}function n(s,o,i){s!==!1&&(s===!0?o.promise:o.promise.then(()=>La(s))).then(i.done)}return{type:"spawn.after",action(s,o){return tn(this,arguments,function*(i,{spawned:a,close:c}){var u,l;let f=r(),p=!0,d=()=>void(p=!1);(u=a.stdout)==null||u.on("data",d),(l=a.stderr)==null||l.on("data",d),a.on("error",d),a.on("close",b=>f.close(b)),a.on("exit",b=>f.exit(b));try{yield f.result,p&&(yield La(50)),c(f.exitCode)}catch(b){c(f.exitCode,b)}})}}}C();var O$="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",kg="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function R$(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(e)}function Cg(e,t){if(e.length<1||e.length>2)throw new st(void 0,"binary",O$);if(e.some(R$))if(t)console.warn(kg);else throw new st(void 0,"binary",kg);let[n,s]=e;return{binary:n,prefix:s}}function k$(e,t=["git"],r=!1){let n=Cg(Ze(t),r);e.on("binary",s=>{n=Cg(Ze(s),r)}),e.append("spawn.binary",()=>n.binary),e.append("spawn.args",s=>n.prefix?[n.prefix,...s]:s)}mt();function C$(e){return!!(e.exitCode&&e.stdErr.length)}function A$(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function I$(e=!1,t=C$,r=A$){return(n,s)=>!e&&n||!t(s)?n:r(s)}function Ag(e){return{type:"task.error",action(t,r){let n=e(t.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});return Buffer.isBuffer(n)?{error:new ot(void 0,n.toString("utf-8"))}:{error:n}}}}C();var D$=class{constructor(){this.plugins=new Set,this.events=new $$}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){let r=F(this.plugins,{type:e,action:t});return()=>this.plugins.delete(r)}add(e){let t=[];return Ze(e).forEach(r=>r&&this.plugins.add(F(t,r))),()=>{t.forEach(r=>this.plugins.delete(r))}}exec(e,t,r){let n=t,s=Object.freeze(Object.create(r));for(let o of this.plugins)o.type===e&&(n=o.action(n,s));return n}};C();function L$(e){let t="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(o,i){return r.includes(i.method)?jg(o,t):o}},{type:"spawn.after",action(o,i){var a;i.commands.includes(t)&&((a=i.spawned.stderr)==null||a.on("data",c=>{let u=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(c.toString("utf8"));u&&e({method:i.method,stage:N$(u[1]),progress:B(u[2]),processed:B(u[3]),total:B(u[4])})}))}}]}function N$(e){return String(e.toLowerCase().split(" ",1))||"unknown"}C();function P$(e){let t=Gg(e,["uid","gid"]);return{type:"spawn.options",action(r){return Ce(Ce({},t),r)}}}function M$({block:e,stdErr:t=!0,stdOut:r=!0}){if(e>0)return{type:"spawn.after",action(n,s){var o,i;let a;function c(){a&&clearTimeout(a),a=setTimeout(l,e)}function u(){var f,p;(f=s.spawned.stdout)==null||f.off("data",c),(p=s.spawned.stderr)==null||p.off("data",c),s.spawned.off("exit",u),s.spawned.off("close",u),a&&clearTimeout(a)}function l(){u(),s.kill(new st(void 0,"timeout","block timeout reached"))}r&&((o=s.spawned.stdout)==null||o.on("data",c)),t&&((i=s.spawned.stderr)==null||i.on("data",c)),s.spawned.on("exit",u),s.spawned.on("close",u),c()}}}an();function F$(){return{type:"spawn.args",action(e){let t=[],r;function n(s){(r=r||[]).push(...s)}for(let s=0;s<e.length;s++){let o=e[s];if(Qs(o)){n(eg(o));continue}if(o==="--"){n(e.slice(s+1).flatMap(i=>Qs(i)&&eg(i)||i));break}t.push(o)}return r?[...t,"--",...r.map(String)]:t}}}C();var j$=y$();function B$(e,t){var r;let n=new D$,s=Wg(e&&(typeof e=="string"?{baseDir:e}:e)||{},t);if(!Ya(s.baseDir))throw new b$(s,"Cannot use simple-git on a directory that does not exist");return Array.isArray(s.config)&&n.add(E$(s.config)),n.add(_$(s.unsafe)),n.add(F$()),n.add(T$(s.completion)),s.abort&&n.add(w$(s.abort)),s.progress&&n.add(L$(s.progress)),s.timeout&&n.add(M$(s.timeout)),s.spawnOptions&&n.add(P$(s.spawnOptions)),n.add(Ag(I$(!0))),s.errors&&n.add(Ag(s.errors)),k$(n,s.binary,(r=s.unsafe)==null?void 0:r.allowUnsafeCustomBinary),new j$(s,n)}_r();var Ib=B$;async function $b(){let e=Ib();try{let{current:t}=await e.branchLocal(),r=(await e.getRemotes(!0)).map(({name:o,refs:{fetch:i}})=>({name:o,url:i})),n=r.find(({name:o})=>o==="origin")??r[0];return{possibleRepositoryName:n?n.url.split("/").slice(-2).join("/").replace(/\.git$/,""):(await e.revparse(["--show-toplevel"])).split("/").pop(),branch:t,remotes:r}}catch{return null}}var Pb=gt(Nb(),1),bc=Pb.default.bold("@seed-design/codemod"),Mb=e=>({event:t,properties:r})=>console.log(bc,t,r,e);var Fb=Sc(W$(import.meta.filename),"transforms"),jb=Rc(),Bb=z$(import.meta.url),go=Bb("../package.json"),Ub=await $b(),Gb=Mb({...Ub});Z$();jb.version(go.version).help().command("[transformName] [...paths]","\uCF54\uB4DC \uBCC0\uD658 (codemod)").option("-l, --list","\uC0AC\uC6A9 \uAC00\uB2A5\uD55C transform \uBAA9\uB85D\uC744 \uBCF4\uC5EC\uC918\uC694").option("--log","\uB85C\uADF8\uB97C \uD30C\uC77C\uB85C \uC800\uC7A5\uD574\uC694").option("--no-track","\uC0AC\uC6A9 \uD1B5\uACC4\uB97C \uC218\uC9D1\uD558\uC9C0 \uC54A\uC544\uC694").option("-p, --parser <parser>","jscodeshift\uAC00 \uC0AC\uC6A9\uD560 \uD30C\uC11C\uB97C \uC9C0\uC815\uD574\uC694 (babel|babylon|flow|ts|tsx)",{default:"tsx"}).option("--reporter","\uBCC0\uD658 \uACB0\uACFC\uB97C \uD30C\uC77C\uB85C \uC800\uC7A5\uD574\uC694").option("--extensions <extensions>","\uBCC0\uD658\uD560 \uD30C\uC77C \uD655\uC7A5\uC790").option("--ignore-config <ignoreConfig>","Ignore config").example(" $ npx @seed-design/codemod migrate-icons src/ui").action(async(e,t,r)=>{let n=Fh.parse(r);n.track&&Gb?.({event:"\uC2E4\uD589",properties:{transformName:e,paths:t}});let s=Y$();n.list&&(wc(s),process.exit(0)),e||(console.error("transform \uC774\uB984\uC744 \uC785\uB825\uD574\uC8FC\uC138\uC694"),wc(s),process.exit(1)),s.includes(e)||(console.error(`\uC774\uB984\uC774 ${e}\uC778 transform\uC774 \uC5C6\uC5B4\uC694`),wc(s),process.exit(1)),t.length===0&&(console.error("\uD30C\uC77C \uACBD\uB85C\uB97C \uC785\uB825\uD574\uC8FC\uC138\uC694"),process.exit(1));let o=Sc(Fb,e,"index.mjs");console.log(bc,`${t.join(", ")}\uC5D0 ${e} transform\uC744 \uC2E4\uD589\uD574\uC694.`),await H$(o,t,n)});jb.parse();function Z$(){(0,yo.satisfies)(process.versions.node,go.engines.node)===!1&&(console.error(`Node.js \uBC84\uC804 \uC694\uAD6C\uC0AC\uD56D\uC744 \uB9CC\uC871\uC2DC\uD0A4\uC9C0 \uC54A\uC544\uC694: "${go.engines.node}"
3
60
  Node.js \uBC84\uC804\uC744 \uC5C5\uADF8\uB808\uC774\uB4DC\uD574\uC8FC\uC138\uC694.
4
61
  \uD604\uC7AC \uBC84\uC804: ${process.versions.node}
5
62
 
6
- $ nvm install ${C(c.engines.node)}`),process.exit(1))}async function A(o,e,r){let{log:n,parser:i,extensions:t,ignoreConfig:a,reporter:m,track:g}=r,T=v.resolve("jscodeshift/bin/jscodeshift"),d=e.map(w=>f(process.cwd(),w)).join(" ");g&&j?.({event:"transform \uC2E4\uD589",properties:{transformPath:o,fixedPathsCombined:d,options:r}}),await P({stdout:"inherit",env:{LOG:`${n}`,TRACK:`${g}`,GIT_INFO:JSON.stringify(k)}})`
7
- ${T} ${d}
8
- -t ${o}
9
- --parser=${i}
63
+ $ nvm install ${(0,yo.minVersion)(go.engines.node)}`),process.exit(1))}async function H$(e,t,r){let{log:n,parser:s,extensions:o,ignoreConfig:i,reporter:a,track:c}=r,u=Bb.resolve("jscodeshift/bin/jscodeshift"),f=t.map(p=>Sc(process.cwd(),p)).join(" ");c&&Gb?.({event:"transform \uC2E4\uD589",properties:{transformPath:e,fixedPathsCombined:f,options:r}}),await Dp({stdout:"inherit",env:{LOG:`${n}`,TRACK:`${c}`,GIT_INFO:JSON.stringify(Ub)}})`
64
+ ${u} ${f}
65
+ -t ${e}
66
+ --parser=${s}
10
67
  --ignore-pattern=**/*.d.ts
11
- ${m?`--reporter=${m}`:""}
12
- ${t?`--extensions=${t}`:""}
13
- ${a?`--ignore-config=${a}`:""}`}function F(){return I($)}function l(o){console.log(`
68
+ ${a?`--reporter=${a}`:""}
69
+ ${o?`--extensions=${o}`:""}
70
+ ${i?`--ignore-config=${i}`:""}`}function Y$(){return V$(Fb)}function wc(e){console.log(`
14
71
  \uC0AC\uC6A9 \uAC00\uB2A5\uD55C transform \uBAA9\uB85D:
15
- `,o.join(`
72
+ `,e.join(`
16
73
  `))}