@sebbo2002/semantic-release-docker 6.0.1-develop.5 → 6.0.1-develop.7

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/dist/index.js CHANGED
@@ -1,18 +1,18 @@
1
1
  import { createRequire as topLevelCreateRequire } from 'module';const require = topLevelCreateRequire(import.meta.url);
2
- var vc=Object.create;var Pn=Object.defineProperty;var Nc=Object.getOwnPropertyDescriptor;var _c=Object.getOwnPropertyNames;var jc=Object.getPrototypeOf,kc=Object.prototype.hasOwnProperty;var H=(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 Gc=(e,t)=>()=>(e&&(t=e(e=0)),t);var I=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var zc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of _c(t))!kc.call(e,o)&&o!==r&&Pn(e,o,{get:()=>t[o],enumerable:!(n=Nc(t,o))||n.enumerable});return e};var Wc=(e,t,r)=>(r=e!=null?vc(jc(e)):{},zc(t||!e||!e.__esModule?Pn(r,"default",{value:e,enumerable:!0}):r,e));import Cg from"path";import{fileURLToPath as Pg}from"url";var a=Gc(()=>{"use strict"});var co=I(($S,ao)=>{"use strict";a();ao.exports=so;so.sync=Vl;var oo=H("fs");function Wl(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 o=r[n].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}function io(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:Wl(t,r)}function so(e,t,r){oo.stat(e,function(n,o){r(n,n?!1:io(o,e,t))})}function Vl(e,t){return io(oo.statSync(e),e,t)}});var mo=I((US,po)=>{"use strict";a();po.exports=fo;fo.sync=Yl;var lo=H("fs");function fo(e,t,r){lo.stat(e,function(n,o){r(n,n?!1:uo(o,t))})}function Yl(e,t){return uo(lo.statSync(e),t)}function uo(e,t){return e.isFile()&&ql(e,t)}function ql(e,t){var r=e.mode,n=e.uid,o=e.gid,i=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),s=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),c=parseInt("100",8),l=parseInt("010",8),p=parseInt("001",8),d=c|l,m=r&p||r&l&&o===s||r&c&&n===i||r&d&&i===0;return m}});var go=I((_S,ho)=>{"use strict";a();var NS=H("fs"),Je;process.platform==="win32"||global.TESTING_WINDOWS?Je=co():Je=mo();ho.exports=ar;ar.sync=Hl;function ar(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,o){ar(e,t||{},function(i,s){i?o(i):n(s)})})}Je(e,t||{},function(n,o){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,o=!1),r(n,o)})}function Hl(e,t){try{return Je.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var To=I((kS,Eo)=>{"use strict";a();var ue=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",yo=H("path"),Kl=ue?";":":",So=go(),bo=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),wo=(e,t)=>{let r=t.colon||Kl,n=e.match(/\//)||ue&&e.match(/\\/)?[""]:[...ue?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],o=ue?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=ue?o.split(r):[""];return ue&&e.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:n,pathExt:i,pathExtExe:o}},xo=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:o,pathExtExe:i}=wo(e,t),s=[],c=p=>new Promise((d,m)=>{if(p===n.length)return t.all&&s.length?d(s):m(bo(e));let h=n[p],g=/^".*"$/.test(h)?h.slice(1,-1):h,y=yo.join(g,e),b=!g&&/^\.[\\\/]/.test(e)?e.slice(0,2)+y:y;d(l(b,p,0))}),l=(p,d,m)=>new Promise((h,g)=>{if(m===o.length)return h(c(d+1));let y=o[m];So(p+y,{pathExt:i},(b,x)=>{if(!b&&x)if(t.all)s.push(p+y);else return h(p+y);return h(l(p,d,m+1))})});return r?c(0).then(p=>r(null,p),r):c(0)},Xl=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=wo(e,t),i=[];for(let s=0;s<r.length;s++){let c=r[s],l=/^".*"$/.test(c)?c.slice(1,-1):c,p=yo.join(l,e),d=!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+p:p;for(let m=0;m<n.length;m++){let h=d+n[m];try{if(So.sync(h,{pathExt:o}))if(t.all)i.push(h);else return h}catch{}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw bo(e)};Eo.exports=xo;xo.sync=Xl});var Ao=I((zS,cr)=>{"use strict";a();var Oo=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};cr.exports=Oo;cr.exports.default=Oo});var Co=I((VS,Ro)=>{"use strict";a();var Io=H("path"),Zl=To(),Jl=Ao();function Do(e,t){let r=e.options.env||process.env,n=process.cwd(),o=e.options.cwd!=null,i=o&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd)}catch{}let s;try{s=Zl.sync(e.command,{path:r[Jl({env:r})],pathExt:t?Io.delimiter:void 0})}catch{}finally{i&&process.chdir(n)}return s&&(s=Io.resolve(o?e.options.cwd:"",s)),s}function Ql(e){return Do(e)||Do(e,!0)}Ro.exports=Ql});var Mo=I((qS,fr)=>{"use strict";a();var lr=/([()\][%!^"`<>&|;, *?])/g;function ef(e){return e=e.replace(lr,"^$1"),e}function tf(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(lr,"^$1"),t&&(e=e.replace(lr,"^$1")),e}fr.exports.command=ef;fr.exports.argument=tf});var Bo=I((KS,Po)=>{"use strict";a();Po.exports=/^#!(.*)/});var $o=I((ZS,Lo)=>{"use strict";a();var rf=Bo();Lo.exports=(e="")=>{let t=e.match(rf);if(!t)return null;let[r,n]=t[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var Uo=I((QS,Fo)=>{"use strict";a();var ur=H("fs"),nf=$o();function of(e){let r=Buffer.alloc(150),n;try{n=ur.openSync(e,"r"),ur.readSync(n,r,0,150,0),ur.closeSync(n)}catch{}return nf(r.toString())}Fo.exports=of});var jo=I((tb,_o)=>{"use strict";a();var sf=H("path"),vo=Co(),No=Mo(),af=Uo(),cf=process.platform==="win32",lf=/\.(?:com|exe)$/i,ff=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function uf(e){e.file=vo(e);let t=e.file&&af(e.file);return t?(e.args.unshift(e.file),e.command=t,vo(e)):e.file}function pf(e){if(!cf)return e;let t=uf(e),r=!lf.test(t);if(e.options.forceShell||r){let n=ff.test(t);e.command=sf.normalize(e.command),e.command=No.command(e.command),e.args=e.args.map(i=>No.argument(i,n));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function df(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:pf(n)}_o.exports=df});var zo=I((nb,Go)=>{"use strict";a();var pr=process.platform==="win32";function dr(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 mf(e,t){if(!pr)return;let r=e.emit;e.emit=function(n,o){if(n==="exit"){let i=ko(o,t);if(i)return r.call(e,"error",i)}return r.apply(e,arguments)}}function ko(e,t){return pr&&e===1&&!t.file?dr(t.original,"spawn"):null}function hf(e,t){return pr&&e===1&&!t.file?dr(t.original,"spawnSync"):null}Go.exports={hookChildProcess:mf,verifyENOENT:ko,verifyENOENTSync:hf,notFoundError:dr}});var Yo=I((ib,pe)=>{"use strict";a();var Wo=H("child_process"),mr=jo(),hr=zo();function Vo(e,t,r){let n=mr(e,t,r),o=Wo.spawn(n.command,n.args,n.options);return hr.hookChildProcess(o,n),o}function gf(e,t,r){let n=mr(e,t,r),o=Wo.spawnSync(n.command,n.args,n.options);return o.error=o.error||hr.verifyENOENTSync(o.status,n),o}pe.exports=Vo;pe.exports.spawn=Vo;pe.exports.sync=gf;pe.exports._parse=mr;pe.exports._enoent=hr});a();a();a();a();function E(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)}a();a();import{fileURLToPath as Vc}from"url";var ce=(e,t)=>{let r=Jt(Yc(e));if(typeof r!="string")throw new TypeError(`${t} must be a string or a file URL: ${r}.`);return r},Yc=e=>Zt(e)?e.toString():e,Zt=e=>typeof e!="string"&&e&&Object.getPrototypeOf(e)===String.prototype,Jt=e=>e instanceof URL?Vc(e):e;var je=(e,t=[],r={})=>{let n=ce(e,"First argument"),[o,i]=E(t)?[[],t]:[t,r];if(!Array.isArray(o))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${o}`);if(o.some(l=>typeof l=="object"&&l!==null))throw new TypeError(`Second argument must be an array of strings: ${o}`);let s=o.map(String),c=s.find(l=>l.includes("\0"));if(c!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${c}`);if(!E(i))throw new TypeError(`Last argument must be an options object: ${i}`);return[n,s,i]};a();import{ChildProcess as Qc}from"child_process";a();import{StringDecoder as qc}from"string_decoder";var{toString:Bn}=Object.prototype,Ln=e=>Bn.call(e)==="[object ArrayBuffer]",T=e=>Bn.call(e)==="[object Uint8Array]",G=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Hc=new TextEncoder,$n=e=>Hc.encode(e),Kc=new TextDecoder,ke=e=>Kc.decode(e),Fn=(e,t)=>Xc(e,t).join(""),Xc=(e,t)=>{if(t==="utf8"&&e.every(i=>typeof i=="string"))return e;let r=new qc(t),n=e.map(i=>typeof i=="string"?$n(i):i).map(i=>r.write(i)),o=r.end();return o===""?n:[...n,o]},Oe=e=>e.length===1&&T(e[0])?e[0]:Qt(Zc(e)),Zc=e=>e.map(t=>typeof t=="string"?$n(t):t),Qt=e=>{let t=new Uint8Array(Jc(e)),r=0;for(let n of e)t.set(n,r),r+=n.length;return t},Jc=e=>{let t=0;for(let r of e)t+=r.length;return t};var _n=e=>Array.isArray(e)&&Array.isArray(e.raw),jn=(e,t)=>{let r=[];for(let[i,s]of e.entries())r=el({templates:e,expressions:t,tokens:r,index:i,template:s});if(r.length===0)throw new TypeError("Template script must not be empty");let[n,...o]=r;return[n,o,{}]},el=({templates:e,expressions:t,tokens:r,index:n,template:o})=>{if(o===void 0)throw new TypeError(`Invalid backslash sequence: ${e.raw[n]}`);let{nextTokens:i,leadingWhitespaces:s,trailingWhitespaces:c}=tl(o,e.raw[n]),l=vn(r,i,s);if(n===t.length)return l;let p=t[n],d=Array.isArray(p)?p.map(m=>Nn(m)):[Nn(p)];return vn(l,d,c)},tl=(e,t)=>{if(t.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],n=0,o=Un.has(t[0]);for(let s=0,c=0;s<e.length;s+=1,c+=1){let l=t[c];if(Un.has(l))n!==s&&r.push(e.slice(n,s)),n=s+1;else if(l==="\\"){let p=t[c+1];p===`
3
- `?(s-=1,c+=1):p==="u"&&t[c+2]==="{"?c=t.indexOf("}",c+3):c+=rl[p]??1}}let i=n===e.length;return i||r.push(e.slice(n)),{nextTokens:r,leadingWhitespaces:o,trailingWhitespaces:i}},Un=new Set([" "," ","\r",`
4
- `]),rl={x:3,u:5},vn=(e,t,r)=>r||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],Nn=e=>{let t=typeof e;if(t==="string")return e;if(t==="number")return String(e);if(E(e)&&("stdout"in e||"isMaxBuffer"in e))return nl(e);throw e instanceof Qc||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`)},nl=({stdout:e})=>{if(typeof e=="string")return e;if(T(e))return ke(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`)};a();import{spawnSync as cm}from"child_process";a();a();a();a();import{debuglog as ol}from"util";a();import er from"process";var P=e=>Ge.includes(e),Ge=[er.stdin,er.stdout,er.stderr],C=["stdin","stdout","stderr"],ze=e=>C[e]??`stdio[${e}]`;var Gn=e=>{let t={...e};for(let r of nr)t[r]=tr(e,r);return t},tr=(e,t)=>{let r=Array.from({length:il(e)+1}),n=sl(e[t],r,t);return ul(n,t)},il=({stdio:e})=>Array.isArray(e)?Math.max(e.length,C.length):C.length,sl=(e,t,r)=>E(e)?al(e,t,r):t.fill(e),al=(e,t,r)=>{for(let n of Object.keys(e).sort(cl))for(let o of ll(n,r,t))t[o]=e[n];return t},cl=(e,t)=>kn(e)<kn(t)?1:-1,kn=e=>e==="stdout"||e==="stderr"?0:e==="all"?2:1,ll=(e,t,r)=>{if(e==="ipc")return[r.length-1];let n=rr(e);if(n===void 0||n===0)throw new TypeError(`"${t}.${e}" is invalid.
2
+ var vc=Object.create;var Pn=Object.defineProperty;var Nc=Object.getOwnPropertyDescriptor;var _c=Object.getOwnPropertyNames;var jc=Object.getPrototypeOf,kc=Object.prototype.hasOwnProperty;var H=(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 Gc=(e,t)=>()=>(e&&(t=e(e=0)),t);var I=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var zc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of _c(t))!kc.call(e,o)&&o!==r&&Pn(e,o,{get:()=>t[o],enumerable:!(n=Nc(t,o))||n.enumerable});return e};var Wc=(e,t,r)=>(r=e!=null?vc(jc(e)):{},zc(t||!e||!e.__esModule?Pn(r,"default",{value:e,enumerable:!0}):r,e));import Cg from"path";import{fileURLToPath as Pg}from"url";var a=Gc(()=>{"use strict"});var co=I(($S,ao)=>{"use strict";a();ao.exports=so;so.sync=Vl;var oo=H("fs");function Wl(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 o=r[n].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}function io(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:Wl(t,r)}function so(e,t,r){oo.stat(e,function(n,o){r(n,n?!1:io(o,e,t))})}function Vl(e,t){return io(oo.statSync(e),e,t)}});var mo=I((US,po)=>{"use strict";a();po.exports=fo;fo.sync=Yl;var lo=H("fs");function fo(e,t,r){lo.stat(e,function(n,o){r(n,n?!1:uo(o,t))})}function Yl(e,t){return uo(lo.statSync(e),t)}function uo(e,t){return e.isFile()&&ql(e,t)}function ql(e,t){var r=e.mode,n=e.uid,o=e.gid,i=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),s=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),c=parseInt("100",8),l=parseInt("010",8),d=parseInt("001",8),p=c|l,m=r&d||r&l&&o===s||r&c&&n===i||r&p&&i===0;return m}});var go=I((_S,ho)=>{"use strict";a();var NS=H("fs"),Je;process.platform==="win32"||global.TESTING_WINDOWS?Je=co():Je=mo();ho.exports=ar;ar.sync=Hl;function ar(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,o){ar(e,t||{},function(i,s){i?o(i):n(s)})})}Je(e,t||{},function(n,o){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,o=!1),r(n,o)})}function Hl(e,t){try{return Je.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var To=I((kS,Eo)=>{"use strict";a();var ue=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",yo=H("path"),Kl=ue?";":":",So=go(),bo=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),wo=(e,t)=>{let r=t.colon||Kl,n=e.match(/\//)||ue&&e.match(/\\/)?[""]:[...ue?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],o=ue?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=ue?o.split(r):[""];return ue&&e.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:n,pathExt:i,pathExtExe:o}},xo=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:o,pathExtExe:i}=wo(e,t),s=[],c=d=>new Promise((p,m)=>{if(d===n.length)return t.all&&s.length?p(s):m(bo(e));let h=n[d],g=/^".*"$/.test(h)?h.slice(1,-1):h,y=yo.join(g,e),b=!g&&/^\.[\\\/]/.test(e)?e.slice(0,2)+y:y;p(l(b,d,0))}),l=(d,p,m)=>new Promise((h,g)=>{if(m===o.length)return h(c(p+1));let y=o[m];So(d+y,{pathExt:i},(b,E)=>{if(!b&&E)if(t.all)s.push(d+y);else return h(d+y);return h(l(d,p,m+1))})});return r?c(0).then(d=>r(null,d),r):c(0)},Xl=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=wo(e,t),i=[];for(let s=0;s<r.length;s++){let c=r[s],l=/^".*"$/.test(c)?c.slice(1,-1):c,d=yo.join(l,e),p=!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let m=0;m<n.length;m++){let h=p+n[m];try{if(So.sync(h,{pathExt:o}))if(t.all)i.push(h);else return h}catch{}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw bo(e)};Eo.exports=xo;xo.sync=Xl});var Ao=I((zS,cr)=>{"use strict";a();var Oo=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};cr.exports=Oo;cr.exports.default=Oo});var Co=I((VS,Ro)=>{"use strict";a();var Io=H("path"),Zl=To(),Jl=Ao();function Do(e,t){let r=e.options.env||process.env,n=process.cwd(),o=e.options.cwd!=null,i=o&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd)}catch{}let s;try{s=Zl.sync(e.command,{path:r[Jl({env:r})],pathExt:t?Io.delimiter:void 0})}catch{}finally{i&&process.chdir(n)}return s&&(s=Io.resolve(o?e.options.cwd:"",s)),s}function Ql(e){return Do(e)||Do(e,!0)}Ro.exports=Ql});var Mo=I((qS,fr)=>{"use strict";a();var lr=/([()\][%!^"`<>&|;, *?])/g;function ef(e){return e=e.replace(lr,"^$1"),e}function tf(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(lr,"^$1"),t&&(e=e.replace(lr,"^$1")),e}fr.exports.command=ef;fr.exports.argument=tf});var Bo=I((KS,Po)=>{"use strict";a();Po.exports=/^#!(.*)/});var $o=I((ZS,Lo)=>{"use strict";a();var rf=Bo();Lo.exports=(e="")=>{let t=e.match(rf);if(!t)return null;let[r,n]=t[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var Uo=I((QS,Fo)=>{"use strict";a();var ur=H("fs"),nf=$o();function of(e){let r=Buffer.alloc(150),n;try{n=ur.openSync(e,"r"),ur.readSync(n,r,0,150,0),ur.closeSync(n)}catch{}return nf(r.toString())}Fo.exports=of});var jo=I((tb,_o)=>{"use strict";a();var sf=H("path"),vo=Co(),No=Mo(),af=Uo(),cf=process.platform==="win32",lf=/\.(?:com|exe)$/i,ff=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function uf(e){e.file=vo(e);let t=e.file&&af(e.file);return t?(e.args.unshift(e.file),e.command=t,vo(e)):e.file}function pf(e){if(!cf)return e;let t=uf(e),r=!lf.test(t);if(e.options.forceShell||r){let n=ff.test(t);e.command=sf.normalize(e.command),e.command=No.command(e.command),e.args=e.args.map(i=>No.argument(i,n));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function df(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:pf(n)}_o.exports=df});var zo=I((nb,Go)=>{"use strict";a();var pr=process.platform==="win32";function dr(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 mf(e,t){if(!pr)return;let r=e.emit;e.emit=function(n,o){if(n==="exit"){let i=ko(o,t);if(i)return r.call(e,"error",i)}return r.apply(e,arguments)}}function ko(e,t){return pr&&e===1&&!t.file?dr(t.original,"spawn"):null}function hf(e,t){return pr&&e===1&&!t.file?dr(t.original,"spawnSync"):null}Go.exports={hookChildProcess:mf,verifyENOENT:ko,verifyENOENTSync:hf,notFoundError:dr}});var Yo=I((ib,pe)=>{"use strict";a();var Wo=H("child_process"),mr=jo(),hr=zo();function Vo(e,t,r){let n=mr(e,t,r),o=Wo.spawn(n.command,n.args,n.options);return hr.hookChildProcess(o,n),o}function gf(e,t,r){let n=mr(e,t,r),o=Wo.spawnSync(n.command,n.args,n.options);return o.error=o.error||hr.verifyENOENTSync(o.status,n),o}pe.exports=Vo;pe.exports.spawn=Vo;pe.exports.sync=gf;pe.exports._parse=mr;pe.exports._enoent=hr});a();a();a();a();function x(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)}a();a();import{fileURLToPath as Vc}from"url";var ce=(e,t)=>{let r=Jt(Yc(e));if(typeof r!="string")throw new TypeError(`${t} must be a string or a file URL: ${r}.`);return r},Yc=e=>Zt(e)?e.toString():e,Zt=e=>typeof e!="string"&&e&&Object.getPrototypeOf(e)===String.prototype,Jt=e=>e instanceof URL?Vc(e):e;var je=(e,t=[],r={})=>{let n=ce(e,"First argument"),[o,i]=x(t)?[[],t]:[t,r];if(!Array.isArray(o))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${o}`);if(o.some(l=>typeof l=="object"&&l!==null))throw new TypeError(`Second argument must be an array of strings: ${o}`);let s=o.map(String),c=s.find(l=>l.includes("\0"));if(c!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${c}`);if(!x(i))throw new TypeError(`Last argument must be an options object: ${i}`);return[n,s,i]};a();import{ChildProcess as Qc}from"child_process";a();import{StringDecoder as qc}from"string_decoder";var{toString:Bn}=Object.prototype,Ln=e=>Bn.call(e)==="[object ArrayBuffer]",T=e=>Bn.call(e)==="[object Uint8Array]",G=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Hc=new TextEncoder,$n=e=>Hc.encode(e),Kc=new TextDecoder,ke=e=>Kc.decode(e),Fn=(e,t)=>Xc(e,t).join(""),Xc=(e,t)=>{if(t==="utf8"&&e.every(i=>typeof i=="string"))return e;let r=new qc(t),n=e.map(i=>typeof i=="string"?$n(i):i).map(i=>r.write(i)),o=r.end();return o===""?n:[...n,o]},Oe=e=>e.length===1&&T(e[0])?e[0]:Qt(Zc(e)),Zc=e=>e.map(t=>typeof t=="string"?$n(t):t),Qt=e=>{let t=new Uint8Array(Jc(e)),r=0;for(let n of e)t.set(n,r),r+=n.length;return t},Jc=e=>{let t=0;for(let r of e)t+=r.length;return t};var _n=e=>Array.isArray(e)&&Array.isArray(e.raw),jn=(e,t)=>{let r=[];for(let[i,s]of e.entries())r=el({templates:e,expressions:t,tokens:r,index:i,template:s});if(r.length===0)throw new TypeError("Template script must not be empty");let[n,...o]=r;return[n,o,{}]},el=({templates:e,expressions:t,tokens:r,index:n,template:o})=>{if(o===void 0)throw new TypeError(`Invalid backslash sequence: ${e.raw[n]}`);let{nextTokens:i,leadingWhitespaces:s,trailingWhitespaces:c}=tl(o,e.raw[n]),l=vn(r,i,s);if(n===t.length)return l;let d=t[n],p=Array.isArray(d)?d.map(m=>Nn(m)):[Nn(d)];return vn(l,p,c)},tl=(e,t)=>{if(t.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],n=0,o=Un.has(t[0]);for(let s=0,c=0;s<e.length;s+=1,c+=1){let l=t[c];if(Un.has(l))n!==s&&r.push(e.slice(n,s)),n=s+1;else if(l==="\\"){let d=t[c+1];d===`
3
+ `?(s-=1,c+=1):d==="u"&&t[c+2]==="{"?c=t.indexOf("}",c+3):c+=rl[d]??1}}let i=n===e.length;return i||r.push(e.slice(n)),{nextTokens:r,leadingWhitespaces:o,trailingWhitespaces:i}},Un=new Set([" "," ","\r",`
4
+ `]),rl={x:3,u:5},vn=(e,t,r)=>r||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],Nn=e=>{let t=typeof e;if(t==="string")return e;if(t==="number")return String(e);if(x(e)&&("stdout"in e||"isMaxBuffer"in e))return nl(e);throw e instanceof Qc||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`)},nl=({stdout:e})=>{if(typeof e=="string")return e;if(T(e))return ke(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`)};a();import{spawnSync as cm}from"child_process";a();a();a();a();import{debuglog as ol}from"util";a();import er from"process";var P=e=>Ge.includes(e),Ge=[er.stdin,er.stdout,er.stderr],C=["stdin","stdout","stderr"],ze=e=>C[e]??`stdio[${e}]`;var Gn=e=>{let t={...e};for(let r of nr)t[r]=tr(e,r);return t},tr=(e,t)=>{let r=Array.from({length:il(e)+1}),n=sl(e[t],r,t);return ul(n,t)},il=({stdio:e})=>Array.isArray(e)?Math.max(e.length,C.length):C.length,sl=(e,t,r)=>x(e)?al(e,t,r):t.fill(e),al=(e,t,r)=>{for(let n of Object.keys(e).sort(cl))for(let o of ll(n,r,t))t[o]=e[n];return t},cl=(e,t)=>kn(e)<kn(t)?1:-1,kn=e=>e==="stdout"||e==="stderr"?0:e==="all"?2:1,ll=(e,t,r)=>{if(e==="ipc")return[r.length-1];let n=rr(e);if(n===void 0||n===0)throw new TypeError(`"${t}.${e}" is invalid.
5
5
  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.
6
6
  Please set the "stdio" option to ensure that file descriptor exists.`);return n==="all"?[1,2]:[n]},rr=e=>{if(e==="all")return e;if(C.includes(e))return C.indexOf(e);let t=fl.exec(e);if(t!==null)return Number(t[1])},fl=/^fd(\d+)$/,ul=(e,t)=>e.map(r=>r===void 0?dl[t]:r),pl=ol("execa").enabled?"full":"none",dl={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:pl,stripFinalNewline:!0},nr=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],z=(e,t)=>t==="ipc"?e.at(-1):e[t];var le=({verbose:e},t)=>or(e,t)!=="none",fe=({verbose:e},t)=>!["none","short"].includes(or(e,t)),zn=({verbose:e},t)=>{let r=or(e,t);return We(r)?r:void 0},or=(e,t)=>t===void 0?ml(e):z(e,t),ml=e=>e.find(t=>We(t))??Ve.findLast(t=>e.includes(t)),We=e=>typeof e=="function",Ve=["none","short","full"];a();import{inspect as Ul}from"util";a();import{platform as hl}from"process";import{stripVTControlCharacters as gl}from"util";var Wn=(e,t)=>{let r=[e,...t],n=r.join(" "),o=r.map(i=>El(Vn(i))).join(" ");return{command:n,escapedCommand:o}},Ae=e=>gl(e).split(`
7
7
  `).map(t=>Vn(t)).join(`
8
- `),Vn=e=>e.replaceAll(bl,t=>yl(t)),yl=e=>{let t=wl[e];if(t!==void 0)return t;let r=e.codePointAt(0),n=r.toString(16);return r<=xl?`\\u${n.padStart(4,"0")}`:`\\U${n}`},Sl=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},bl=Sl(),wl={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},xl=65535,El=e=>Tl.test(e)?e:hl==="win32"?`"${e.replaceAll('"','""')}"`:`'${e.replaceAll("'","'\\''")}'`,Tl=/^[\w./-]+$/;a();a();a();import F from"process";function ir(){return F.platform!=="win32"?F.env.TERM!=="linux":!!F.env.WT_SESSION||!!F.env.TERMINUS_SUBLIME||F.env.ConEmuTask==="{cmd::Cmder}"||F.env.TERM_PROGRAM==="Terminus-Sublime"||F.env.TERM_PROGRAM==="vscode"||F.env.TERM==="xterm-256color"||F.env.TERM==="alacritty"||F.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Yn={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"},qn={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"},Ol={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"},Al={...Yn,...qn},Il={...Yn,...Ol},Dl=ir(),Rl=Dl?Al:Il,Ye=Rl,hy=Object.entries(qn);a();import Cl from"tty";var Ml=Cl.WriteStream.prototype.hasColors(),S=(e,t)=>{if(!Ml)return o=>o;let r=`\x1B[${e}m`,n=`\x1B[${t}m`;return o=>{let i=o+"",s=i.indexOf(n);if(s===-1)return r+i+n;let c=r,l=0;for(;s!==-1;)c+=i.slice(l,s)+r,l=s+n.length,s=i.indexOf(n,l);return c+=i.slice(l)+n,c}},by=S(0,0),Hn=S(1,22),wy=S(2,22),xy=S(3,23),Ey=S(4,24),Ty=S(53,55),Oy=S(7,27),Ay=S(8,28),Iy=S(9,29),Dy=S(30,39),Ry=S(31,39),Cy=S(32,39),My=S(33,39),Py=S(34,39),By=S(35,39),Ly=S(36,39),$y=S(37,39),qe=S(90,39),Fy=S(40,49),Uy=S(41,49),vy=S(42,49),Ny=S(43,49),_y=S(44,49),jy=S(45,49),ky=S(46,49),Gy=S(47,49),zy=S(100,49),Kn=S(91,39),Wy=S(92,39),Xn=S(93,39),Vy=S(94,39),Yy=S(95,39),qy=S(96,39),Hy=S(97,39),Ky=S(101,49),Xy=S(102,49),Zy=S(103,49),Jy=S(104,49),Qy=S(105,49),eS=S(106,49),tS=S(107,49);var Qn=({type:e,message:t,timestamp:r,piped:n,commandId:o,result:{failed:i=!1}={},options:{reject:s=!0}})=>{let c=Pl(r),l=Bl[e]({failed:i,reject:s,piped:n}),p=Ll[e]({reject:s});return`${qe(`[${c}]`)} ${qe(`[${o}]`)} ${p(l)} ${p(t)}`},Pl=e=>`${He(e.getHours(),2)}:${He(e.getMinutes(),2)}:${He(e.getSeconds(),2)}.${He(e.getMilliseconds(),3)}`,He=(e,t)=>String(e).padStart(t,"0"),Zn=({failed:e,reject:t})=>e?t?Ye.cross:Ye.warning:Ye.tick,Bl={command:({piped:e})=>e?"|":"$",output:()=>" ",ipc:()=>"*",error:Zn,duration:Zn},Jn=e=>e,Ll={command:()=>Hn,output:()=>Jn,ipc:()=>Jn,error:({reject:e})=>e?Kn:Xn,duration:()=>qe};a();var eo=(e,t,r)=>{let n=zn(t,r);return e.map(({verboseLine:o,verboseObject:i})=>$l(o,i,n)).filter(o=>o!==void 0).map(o=>Fl(o)).join("")},$l=(e,t,r)=>{if(r===void 0)return e;let n=r(e,t);if(typeof n=="string")return n},Fl=e=>e.endsWith(`
8
+ `),Vn=e=>e.replaceAll(bl,t=>yl(t)),yl=e=>{let t=wl[e];if(t!==void 0)return t;let r=e.codePointAt(0),n=r.toString(16);return r<=xl?`\\u${n.padStart(4,"0")}`:`\\U${n}`},Sl=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},bl=Sl(),wl={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},xl=65535,El=e=>Tl.test(e)?e:hl==="win32"?`"${e.replaceAll('"','""')}"`:`'${e.replaceAll("'","'\\''")}'`,Tl=/^[\w./-]+$/;a();a();a();import F from"process";function ir(){return F.platform!=="win32"?F.env.TERM!=="linux":!!F.env.WT_SESSION||!!F.env.TERMINUS_SUBLIME||F.env.ConEmuTask==="{cmd::Cmder}"||F.env.TERM_PROGRAM==="Terminus-Sublime"||F.env.TERM_PROGRAM==="vscode"||F.env.TERM==="xterm-256color"||F.env.TERM==="alacritty"||F.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Yn={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"},qn={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"},Ol={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"},Al={...Yn,...qn},Il={...Yn,...Ol},Dl=ir(),Rl=Dl?Al:Il,Ye=Rl,hy=Object.entries(qn);a();import Cl from"tty";var Ml=Cl?.WriteStream?.prototype?.hasColors?.()??!1,S=(e,t)=>{if(!Ml)return o=>o;let r=`\x1B[${e}m`,n=`\x1B[${t}m`;return o=>{let i=o+"",s=i.indexOf(n);if(s===-1)return r+i+n;let c=r,l=0;for(;s!==-1;)c+=i.slice(l,s)+r,l=s+n.length,s=i.indexOf(n,l);return c+=i.slice(l)+n,c}},by=S(0,0),Hn=S(1,22),wy=S(2,22),xy=S(3,23),Ey=S(4,24),Ty=S(53,55),Oy=S(7,27),Ay=S(8,28),Iy=S(9,29),Dy=S(30,39),Ry=S(31,39),Cy=S(32,39),My=S(33,39),Py=S(34,39),By=S(35,39),Ly=S(36,39),$y=S(37,39),qe=S(90,39),Fy=S(40,49),Uy=S(41,49),vy=S(42,49),Ny=S(43,49),_y=S(44,49),jy=S(45,49),ky=S(46,49),Gy=S(47,49),zy=S(100,49),Kn=S(91,39),Wy=S(92,39),Xn=S(93,39),Vy=S(94,39),Yy=S(95,39),qy=S(96,39),Hy=S(97,39),Ky=S(101,49),Xy=S(102,49),Zy=S(103,49),Jy=S(104,49),Qy=S(105,49),eS=S(106,49),tS=S(107,49);var Qn=({type:e,message:t,timestamp:r,piped:n,commandId:o,result:{failed:i=!1}={},options:{reject:s=!0}})=>{let c=Pl(r),l=Bl[e]({failed:i,reject:s,piped:n}),d=Ll[e]({reject:s});return`${qe(`[${c}]`)} ${qe(`[${o}]`)} ${d(l)} ${d(t)}`},Pl=e=>`${He(e.getHours(),2)}:${He(e.getMinutes(),2)}:${He(e.getSeconds(),2)}.${He(e.getMilliseconds(),3)}`,He=(e,t)=>String(e).padStart(t,"0"),Zn=({failed:e,reject:t})=>e?t?Ye.cross:Ye.warning:Ye.tick,Bl={command:({piped:e})=>e?"|":"$",output:()=>" ",ipc:()=>"*",error:Zn,duration:Zn},Jn=e=>e,Ll={command:()=>Hn,output:()=>Jn,ipc:()=>Jn,error:({reject:e})=>e?Kn:Xn,duration:()=>qe};a();var eo=(e,t,r)=>{let n=zn(t,r);return e.map(({verboseLine:o,verboseObject:i})=>$l(o,i,n)).filter(o=>o!==void 0).map(o=>Fl(o)).join("")},$l=(e,t,r)=>{if(r===void 0)return e;let n=r(e,t);if(typeof n=="string")return n},Fl=e=>e.endsWith(`
9
9
  `)?e:`${e}
10
10
  `;var U=({type:e,verboseMessage:t,fdNumber:r,verboseInfo:n,result:o})=>{let i=vl({type:e,result:o,verboseInfo:n}),s=Nl(t,i),c=eo(s,n,r);c!==""&&console.warn(c.slice(0,-1))},vl=({type:e,result:t,verboseInfo:{escapedCommand:r,commandId:n,rawOptions:{piped:o=!1,...i}}})=>({type:e,escapedCommand:r,commandId:`${n}`,timestamp:new Date,piped:o,result:t,options:i}),Nl=(e,t)=>e.split(`
11
11
  `).map(r=>_l({...t,message:r})),_l=e=>({verboseLine:Qn(e),verboseObject:e}),Ke=e=>{let t=typeof e=="string"?e:Ul(e);return Ae(t).replaceAll(" "," ".repeat(jl))},jl=2;var to=(e,t)=>{le(t)&&U({type:"command",verboseMessage:e,verboseInfo:t})};a();var ro=(e,t,r)=>{zl(e);let n=kl(e);return{verbose:e,escapedCommand:t,commandId:n,rawOptions:r}},kl=e=>le({verbose:e})?Gl++:void 0,Gl=0n,zl=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(!Ve.includes(t)&&!We(t)){let r=Ve.map(n=>`'${n}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${r} or a function.`)}}};a();import{hrtime as no}from"process";var Xe=()=>no.bigint(),sr=e=>Number(no.bigint()-e)/1e6;var Ze=(e,t,r)=>{let n=Xe(),{command:o,escapedCommand:i}=Wn(e,t),s=tr(r,"verbose"),c=ro(s,i,{...r});return to(i,c),{command:o,escapedCommand:i,startTime:n,verboseInfo:c}};a();var ns=Wc(Yo(),1);import Du from"path";import rs from"process";a();import tt from"process";import ee from"path";a();function Qe(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"}a();import{promisify as yf}from"util";import{execFile as Sf,execFileSync as ub}from"child_process";import qo from"path";import{fileURLToPath as bf}from"url";var mb=yf(Sf);function et(e){return e instanceof URL?bf(e):e}function Ho(e){return{*[Symbol.iterator](){let t=qo.resolve(et(e)),r;for(;r!==t;)yield t,r=t,t=qo.resolve(t,"..")}}}var hb=10*1024*1024;var wf=({cwd:e=tt.cwd(),path:t=tt.env[Qe()],preferLocal:r=!0,execPath:n=tt.execPath,addExecPath:o=!0}={})=>{let i=ee.resolve(et(e)),s=[],c=t.split(ee.delimiter);return r&&xf(s,c,i),o&&Ef(s,c,n,i),t===""||t===ee.delimiter?`${s.join(ee.delimiter)}${t}`:[...s,t].join(ee.delimiter)},xf=(e,t,r)=>{for(let n of Ho(r)){let o=ee.join(n,"node_modules/.bin");t.includes(o)||e.push(o)}},Ef=(e,t,r,n)=>{let o=ee.resolve(n,et(r),"..");t.includes(o)||e.push(o)},Ko=({env:e=tt.env,...t}={})=>{e={...e};let r=Qe({env:e});return t.path=e[r],e[r]=wf(t),e};a();import{setTimeout as vf}from"timers/promises";a();var Xo=(e,t,r)=>{let n=r?De:Ie,o=e instanceof B?{}:{cause:e};return new n(t,o)},B=class extends Error{},Zo=(e,t)=>{Object.defineProperty(e.prototype,"name",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,Qo,{value:!0,writable:!1,enumerable:!1,configurable:!1})},Jo=e=>rt(e)&&Qo in e,Qo=Symbol("isExecaError"),rt=e=>Object.prototype.toString.call(e)==="[object Error]",Ie=class extends Error{};Zo(Ie,Ie.name);var De=class extends Error{};Zo(De,De.name);a();import{constants as Re}from"os";a();import{constants as If}from"os";a();var ei=()=>{let e=ri-ti+1;return Array.from({length:e},Tf)},Tf=(e,t)=>({name:`SIGRT${t+1}`,number:ti+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),ti=34,ri=64;a();import{constants as Of}from"os";a();var ni=[{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 gr=()=>{let e=ei();return[...ni,...e].map(Af)},Af=({name:e,number:t,description:r,action:n,forced:o=!1,standard:i})=>{let{signals:{[e]:s}}=Of,c=s!==void 0;return{name:e,number:c?s:t,description:r,supported:c,action:n,forced:o,standard:i}};var Df=()=>{let e=gr();return Object.fromEntries(e.map(Rf))},Rf=({name:e,number:t,description:r,supported:n,action:o,forced:i,standard:s})=>[e,{name:e,number:t,description:r,supported:n,action:o,forced:i,standard:s}],oi=Df(),Cf=()=>{let e=gr(),t=65,r=Array.from({length:t},(n,o)=>Mf(o,e));return Object.assign({},...r)},Mf=(e,t)=>{let r=Pf(e,t);if(r===void 0)return{};let{name:n,description:o,supported:i,action:s,forced:c,standard:l}=r;return{[e]:{name:n,number:e,description:o,supported:i,action:s,forced:c,standard:l}}},Pf=(e,t)=>{let r=t.find(({name:n})=>If.signals[n]===e);return r!==void 0?r:t.find(n=>n.number===e)},Nb=Cf();var si=e=>{let t="option `killSignal`";if(e===0)throw new TypeError(`Invalid ${t}: 0 cannot be used.`);return ci(e,t)},ai=e=>e===0?e:ci(e,"`subprocess.kill()`'s argument"),ci=(e,t)=>{if(Number.isInteger(e))return Bf(e,t);if(typeof e=="string")return $f(e,t);throw new TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.
12
12
  ${yr()}`)},Bf=(e,t)=>{if(ii.has(e))return ii.get(e);throw new TypeError(`Invalid ${t} ${e}: this signal integer does not exist.
13
13
  ${yr()}`)},Lf=()=>new Map(Object.entries(Re.signals).reverse().map(([e,t])=>[t,e])),ii=Lf(),$f=(e,t)=>{if(e in Re.signals)return e;throw e.toUpperCase()in Re.signals?new TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`):new TypeError(`Invalid ${t} '${e}': this signal name does not exist.
14
14
  ${yr()}`)},yr=()=>`Available signal names: ${Ff()}.
15
- Available signal numbers: ${Uf()}.`,Ff=()=>Object.keys(Re.signals).sort().map(e=>`'${e}'`).join(", "),Uf=()=>[...new Set(Object.values(Re.signals).sort((e,t)=>e-t))].join(", "),nt=e=>oi[e].description;var li=e=>{if(e===!1)return e;if(e===!0)return Nf;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},Nf=1e3*5,fi=({kill:e,options:{forceKillAfterDelay:t,killSignal:r},onInternalError:n,context:o,controller:i},s,c)=>{let{signal:l,error:p}=_f(s,c,r);jf(p,n);let d=e(l);return kf({kill:e,signal:l,forceKillAfterDelay:t,killSignal:r,killResult:d,context:o,controller:i}),d},_f=(e,t,r)=>{let[n=r,o]=rt(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(o!==void 0&&!rt(o))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${o}`);return{signal:ai(n),error:o}},jf=(e,t)=>{e!==void 0&&t.reject(e)},kf=async({kill:e,signal:t,forceKillAfterDelay:r,killSignal:n,killResult:o,context:i,controller:s})=>{t===n&&o&&Sr({kill:e,forceKillAfterDelay:r,context:i,controllerSignal:s.signal})},Sr=async({kill:e,forceKillAfterDelay:t,context:r,controllerSignal:n})=>{if(t!==!1)try{await vf(t,void 0,{signal:n}),e("SIGKILL")&&(r.isForcefullyTerminated??=!0)}catch{}};a();a();import{once as Gf}from"events";var ot=async(e,t)=>{e.aborted||await Gf(e,"abort",{signal:t})};var ui=({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)}`)},pi=({subprocess:e,cancelSignal:t,gracefulCancel:r,context:n,controller:o})=>t===void 0||r?[]:[zf(e,t,n,o)],zf=async(e,t,r,{signal:n})=>{throw await ot(t,n),r.terminationReason??="cancel",e.kill(),t.reason};a();a();import{scheduler as fu}from"timers/promises";a();import{promisify as au}from"util";a();var de=({methodName:e,isSubprocess:t,ipc:r,isConnected:n})=>{Wf(e,t,r),br(e,t,n)},Wf=(e,t,r)=>{if(!r)throw new Error(`${L(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},br=(e,t,r)=>{if(!r)throw new Error(`${L(e,t)} cannot be used: the ${K(t)} has already exited or disconnected.`)},di=e=>{throw new Error(`${L("getOneMessage",e)} could not complete: the ${K(e)} exited or disconnected.`)},mi=e=>{throw new Error(`${L("sendMessage",e)} failed: the ${K(e)} is sending a message too, instead of listening to incoming messages.
15
+ Available signal numbers: ${Uf()}.`,Ff=()=>Object.keys(Re.signals).sort().map(e=>`'${e}'`).join(", "),Uf=()=>[...new Set(Object.values(Re.signals).sort((e,t)=>e-t))].join(", "),nt=e=>oi[e].description;var li=e=>{if(e===!1)return e;if(e===!0)return Nf;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},Nf=1e3*5,fi=({kill:e,options:{forceKillAfterDelay:t,killSignal:r},onInternalError:n,context:o,controller:i},s,c)=>{let{signal:l,error:d}=_f(s,c,r);jf(d,n);let p=e(l);return kf({kill:e,signal:l,forceKillAfterDelay:t,killSignal:r,killResult:p,context:o,controller:i}),p},_f=(e,t,r)=>{let[n=r,o]=rt(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(o!==void 0&&!rt(o))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${o}`);return{signal:ai(n),error:o}},jf=(e,t)=>{e!==void 0&&t.reject(e)},kf=async({kill:e,signal:t,forceKillAfterDelay:r,killSignal:n,killResult:o,context:i,controller:s})=>{t===n&&o&&Sr({kill:e,forceKillAfterDelay:r,context:i,controllerSignal:s.signal})},Sr=async({kill:e,forceKillAfterDelay:t,context:r,controllerSignal:n})=>{if(t!==!1)try{await vf(t,void 0,{signal:n}),e("SIGKILL")&&(r.isForcefullyTerminated??=!0)}catch{}};a();a();import{once as Gf}from"events";var ot=async(e,t)=>{e.aborted||await Gf(e,"abort",{signal:t})};var ui=({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)}`)},pi=({subprocess:e,cancelSignal:t,gracefulCancel:r,context:n,controller:o})=>t===void 0||r?[]:[zf(e,t,n,o)],zf=async(e,t,r,{signal:n})=>{throw await ot(t,n),r.terminationReason??="cancel",e.kill(),t.reason};a();a();import{scheduler as fu}from"timers/promises";a();import{promisify as au}from"util";a();var de=({methodName:e,isSubprocess:t,ipc:r,isConnected:n})=>{Wf(e,t,r),br(e,t,n)},Wf=(e,t,r)=>{if(!r)throw new Error(`${L(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},br=(e,t,r)=>{if(!r)throw new Error(`${L(e,t)} cannot be used: the ${K(t)} has already exited or disconnected.`)},di=e=>{throw new Error(`${L("getOneMessage",e)} could not complete: the ${K(e)} exited or disconnected.`)},mi=e=>{throw new Error(`${L("sendMessage",e)} failed: the ${K(e)} is sending a message too, instead of listening to incoming messages.
16
16
  This can be fixed by both sending a message and listening to incoming messages at the same time:
17
17
 
18
18
  const [receivedMessage] = await Promise.all([
@@ -22,24 +22,24 @@ const [receivedMessage] = await Promise.all([
22
22
  It must be ${n} or "fd3", "fd4" (and so on).
23
23
  It is optional and defaults to "${o}".`)},Xf=(e,t,r,n)=>{let o=n[Ti(e)];if(o===void 0)throw new TypeError(`"${Ce(r)}" must not be ${t}. That file descriptor does not exist.
24
24
  Please set the "stdio" option to ensure that file descriptor exists.`);if(o.direction==="input"&&!r)throw new TypeError(`"${Ce(r)}" must not be ${t}. It must be a readable stream, not writable.`);if(o.direction!=="input"&&r)throw new TypeError(`"${Ce(r)}" must not be ${t}. It must be a writable stream, not readable.`)},Ei=(e,t,r,n)=>{if(e==="all"&&!r.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:o,optionValue:i}=Zf(e,r);return`The "${o}: ${st(i)}" option is incompatible with using "${Ce(n)}: ${st(t)}".
25
- Please set this option with "pipe" instead.`},Zf=(e,{stdin:t,stdout:r,stderr:n,stdio:o})=>{let i=Ti(e);return i===0&&t!==void 0?{optionName:"stdin",optionValue:t}:i===1&&r!==void 0?{optionName:"stdout",optionValue:r}:i===2&&n!==void 0?{optionName:"stderr",optionValue:n}:{optionName:`stdio[${i}]`,optionValue:o[i]}},Ti=e=>e==="all"?1:e,Ce=e=>e?"to":"from",st=e=>typeof e=="string"?`'${e}'`:typeof e=="number"?`${e}`:"Stream";a();import{once as nu}from"events";a();import{addAbortListener as Jf}from"events";var te=(e,t,r)=>{let n=e.getMaxListeners();n===0||n===Number.POSITIVE_INFINITY||(e.setMaxListeners(n+t),Jf(r,()=>{e.setMaxListeners(e.getMaxListeners()-t)}))};a();import{EventEmitter as tu}from"events";a();import{once as Qf}from"events";import{scheduler as eu}from"timers/promises";a();var ct=(e,t)=>{t&&wr(e)},wr=e=>{e.refCounted()},lt=(e,t)=>{t&&xr(e)},xr=e=>{e.unrefCounted()},Oi=(e,t)=>{t&&(xr(e),xr(e))},Ai=(e,t)=>{t&&(wr(e),wr(e))};var Ii=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n},o)=>{if(Ci(o)||Pi(o))return;ft.has(e)||ft.set(e,[]);let i=ft.get(e);if(i.push(o),!(i.length>1))for(;i.length>0;){await Mi(e,n,o),await eu.yield();let s=await Ri({wrappedMessage:i[0],anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n});i.shift(),n.emit("message",s),n.emit("message:done")}},Di=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n,boundOnMessage:o})=>{Er();let i=ft.get(e);for(;i?.length>0;)await Qf(n,"message:done");e.removeListener("message",o),Ai(t,r),n.connected=!1,n.emit("disconnect")},ft=new WeakMap;var X=(e,t,r)=>{if(ut.has(e))return ut.get(e);let n=new tu;return n.connected=!0,ut.set(e,n),ru({ipcEmitter:n,anyProcess:e,channel:t,isSubprocess:r}),n},ut=new WeakMap,ru=({ipcEmitter:e,anyProcess:t,channel:r,isSubprocess:n})=>{let o=Ii.bind(void 0,{anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:e});t.on("message",o),t.once("disconnect",Di.bind(void 0,{anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:e,boundOnMessage:o})),Oi(r,n)},pt=e=>{let t=ut.get(e);return t===void 0?e.channel!==null:t.connected};var Bi=({anyProcess:e,channel:t,isSubprocess:r,message:n,strict:o})=>{if(!o)return n;let i=X(e,t,r),s=ht(e,i);return{id:ou++,type:mt,message:n,hasListeners:s}},ou=0n,Li=(e,t)=>{if(!(t?.type!==mt||t.hasListeners))for(let{id:r}of e)r!==void 0&&dt[r].resolve({isDeadlock:!0,hasListeners:!1})},Ri=async({wrappedMessage:e,anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:o})=>{if(e?.type!==mt||!t.connected)return e;let{id:i,message:s}=e,c={id:i,type:Fi,message:ht(t,o)};try{await gt({anyProcess:t,channel:r,isSubprocess:n,ipc:!0},c)}catch(l){o.emit("strict:error",l)}return s},Ci=e=>{if(e?.type!==Fi)return!1;let{id:t,message:r}=e;return dt[t]?.resolve({isDeadlock:!1,hasListeners:r}),!0},$i=async(e,t,r)=>{if(e?.type!==mt)return;let n=v();dt[e.id]=n;let o=new AbortController;try{let{isDeadlock:i,hasListeners:s}=await Promise.race([n,iu(t,r,o)]);i&&mi(r),s||hi(r)}finally{o.abort(),delete dt[e.id]}},dt={},iu=async(e,t,{signal:r})=>{te(e,1,r),await nu(e,"disconnect",{signal:r}),gi(t)},mt="execa:ipc:request",Fi="execa:ipc:response";var Ui=(e,t,r)=>{Me.has(e)||Me.set(e,new Set);let n=Me.get(e),o=v(),i=r?t.id:void 0,s={onMessageSent:o,id:i};return n.add(s),{outgoingMessages:n,outgoingMessage:s}},vi=({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()},Mi=async(e,t,r)=>{for(;!ht(e,t)&&Me.get(e)?.size>0;){let n=[...Me.get(e)];Li(n,r),await Promise.all(n.map(({onMessageSent:o})=>o))}},Me=new WeakMap,ht=(e,t)=>t.listenerCount("message")>su(e),su=e=>N.has(e)&&!z(N.get(e).options.buffer,"ipc")?1:0;var gt=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},o,{strict:i=!1}={})=>{let s="sendMessage";return de({methodName:s,isSubprocess:r,ipc:n,isConnected:e.connected}),cu({anyProcess:e,channel:t,methodName:s,isSubprocess:r,message:o,strict:i})},cu=async({anyProcess:e,channel:t,methodName:r,isSubprocess:n,message:o,strict:i})=>{let s=Bi({anyProcess:e,channel:t,isSubprocess:n,message:o,strict:i}),c=Ui(e,s,i);try{await Or({anyProcess:e,methodName:r,isSubprocess:n,wrappedMessage:s,message:o})}catch(l){throw me(e),l}finally{vi(c)}},Or=async({anyProcess:e,methodName:t,isSubprocess:r,wrappedMessage:n,message:o})=>{let i=lu(e);try{await Promise.all([$i(n,e,r),i(n)])}catch(s){throw bi({error:s,methodName:t,isSubprocess:r}),wi({error:s,methodName:t,isSubprocess:r,message:o}),s}},lu=e=>{if(Tr.has(e))return Tr.get(e);let t=au(e.send.bind(e));return Tr.set(e,t),t},Tr=new WeakMap;var _i=(e,t)=>{let r="cancelSignal";return br(r,!1,e.connected),Or({anyProcess:e,methodName:r,isSubprocess:!1,wrappedMessage:{type:ki,message:t},message:t})},ji=async({anyProcess:e,channel:t,isSubprocess:r,ipc:n})=>(await uu({anyProcess:e,channel:t,isSubprocess:r,ipc:n}),Ar.signal),uu=async({anyProcess:e,channel:t,isSubprocess:r,ipc:n})=>{if(!Ni){if(Ni=!0,!n){Si();return}if(t===null){Er();return}X(e,t,r),await fu.yield()}},Ni=!1,Pi=e=>e?.type!==ki?!1:(Ar.abort(e.message),!0),ki="execa:ipc:cancel",Er=()=>{Ar.abort(yi())},Ar=new AbortController;var Gi=({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.")}},zi=({subprocess:e,cancelSignal:t,gracefulCancel:r,forceKillAfterDelay:n,context:o,controller:i})=>r?[pu({subprocess:e,cancelSignal:t,forceKillAfterDelay:n,context:o,controller:i})]:[],pu=async({subprocess:e,cancelSignal:t,forceKillAfterDelay:r,context:n,controller:{signal:o}})=>{await ot(t,o);let i=du(t);throw await _i(e,i),Sr({kill:e.kill,forceKillAfterDelay:r,context:n,controllerSignal:o}),n.terminationReason??="gracefulCancel",t.reason},du=({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};a();import{setTimeout as mu}from"timers/promises";var Wi=({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})`)},Vi=(e,t,r,n)=>t===0||t===void 0?[]:[hu(e,t,r,n)],hu=async(e,t,r,{signal:n})=>{throw await mu(t,void 0,{signal:n}),r.terminationReason??="timeout",e.kill(),new B};a();import{execPath as gu,execArgv as yu}from"process";import Yi from"path";var qi=({options:e})=>{if(e.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}},Hi=(e,t,{node:r=!1,nodePath:n=gu,nodeOptions:o=yu.filter(l=>!l.startsWith("--inspect")),cwd:i,execPath:s,...c})=>{if(s!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let l=ce(n,'The "nodePath" option'),p=Yi.resolve(i,l),d={...c,nodePath:p,node:r,cwd:i};if(!r)return[e,t,d];if(Yi.basename(e,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[p,[...o,e,...t],{ipc:!0,...d,shell:!1}]};a();import{serialize as Su}from"v8";var Ki=({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`.");xu[r](e)}},bu=e=>{try{Su(e)}catch(t){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:t})}},wu=e=>{try{JSON.stringify(e)}catch(t){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:t})}},xu={advanced:bu,json:wu},Xi=async(e,t)=>{t!==void 0&&await e.sendMessage(t)};a();var Ji=({encoding:e})=>{if(Ir.has(e))return;let t=Tu(e);if(t!==void 0)throw new TypeError(`Invalid option \`encoding: ${yt(e)}\`.
25
+ Please set this option with "pipe" instead.`},Zf=(e,{stdin:t,stdout:r,stderr:n,stdio:o})=>{let i=Ti(e);return i===0&&t!==void 0?{optionName:"stdin",optionValue:t}:i===1&&r!==void 0?{optionName:"stdout",optionValue:r}:i===2&&n!==void 0?{optionName:"stderr",optionValue:n}:{optionName:`stdio[${i}]`,optionValue:o[i]}},Ti=e=>e==="all"?1:e,Ce=e=>e?"to":"from",st=e=>typeof e=="string"?`'${e}'`:typeof e=="number"?`${e}`:"Stream";a();import{once as nu}from"events";a();import{addAbortListener as Jf}from"events";var te=(e,t,r)=>{let n=e.getMaxListeners();n===0||n===Number.POSITIVE_INFINITY||(e.setMaxListeners(n+t),Jf(r,()=>{e.setMaxListeners(e.getMaxListeners()-t)}))};a();import{EventEmitter as tu}from"events";a();import{once as Qf}from"events";import{scheduler as eu}from"timers/promises";a();var ct=(e,t)=>{t&&wr(e)},wr=e=>{e.refCounted()},lt=(e,t)=>{t&&xr(e)},xr=e=>{e.unrefCounted()},Oi=(e,t)=>{t&&(xr(e),xr(e))},Ai=(e,t)=>{t&&(wr(e),wr(e))};var Ii=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n},o)=>{if(Ci(o)||Pi(o))return;ft.has(e)||ft.set(e,[]);let i=ft.get(e);if(i.push(o),!(i.length>1))for(;i.length>0;){await Mi(e,n,o),await eu.yield();let s=await Ri({wrappedMessage:i[0],anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n});i.shift(),n.emit("message",s),n.emit("message:done")}},Di=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n,boundOnMessage:o})=>{Er();let i=ft.get(e);for(;i?.length>0;)await Qf(n,"message:done");e.removeListener("message",o),Ai(t,r),n.connected=!1,n.emit("disconnect")},ft=new WeakMap;var X=(e,t,r)=>{if(ut.has(e))return ut.get(e);let n=new tu;return n.connected=!0,ut.set(e,n),ru({ipcEmitter:n,anyProcess:e,channel:t,isSubprocess:r}),n},ut=new WeakMap,ru=({ipcEmitter:e,anyProcess:t,channel:r,isSubprocess:n})=>{let o=Ii.bind(void 0,{anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:e});t.on("message",o),t.once("disconnect",Di.bind(void 0,{anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:e,boundOnMessage:o})),Oi(r,n)},pt=e=>{let t=ut.get(e);return t===void 0?e.channel!==null:t.connected};var Bi=({anyProcess:e,channel:t,isSubprocess:r,message:n,strict:o})=>{if(!o)return n;let i=X(e,t,r),s=ht(e,i);return{id:ou++,type:mt,message:n,hasListeners:s}},ou=0n,Li=(e,t)=>{if(!(t?.type!==mt||t.hasListeners))for(let{id:r}of e)r!==void 0&&dt[r].resolve({isDeadlock:!0,hasListeners:!1})},Ri=async({wrappedMessage:e,anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:o})=>{if(e?.type!==mt||!t.connected)return e;let{id:i,message:s}=e,c={id:i,type:Fi,message:ht(t,o)};try{await gt({anyProcess:t,channel:r,isSubprocess:n,ipc:!0},c)}catch(l){o.emit("strict:error",l)}return s},Ci=e=>{if(e?.type!==Fi)return!1;let{id:t,message:r}=e;return dt[t]?.resolve({isDeadlock:!1,hasListeners:r}),!0},$i=async(e,t,r)=>{if(e?.type!==mt)return;let n=v();dt[e.id]=n;let o=new AbortController;try{let{isDeadlock:i,hasListeners:s}=await Promise.race([n,iu(t,r,o)]);i&&mi(r),s||hi(r)}finally{o.abort(),delete dt[e.id]}},dt={},iu=async(e,t,{signal:r})=>{te(e,1,r),await nu(e,"disconnect",{signal:r}),gi(t)},mt="execa:ipc:request",Fi="execa:ipc:response";var Ui=(e,t,r)=>{Me.has(e)||Me.set(e,new Set);let n=Me.get(e),o=v(),i=r?t.id:void 0,s={onMessageSent:o,id:i};return n.add(s),{outgoingMessages:n,outgoingMessage:s}},vi=({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()},Mi=async(e,t,r)=>{for(;!ht(e,t)&&Me.get(e)?.size>0;){let n=[...Me.get(e)];Li(n,r),await Promise.all(n.map(({onMessageSent:o})=>o))}},Me=new WeakMap,ht=(e,t)=>t.listenerCount("message")>su(e),su=e=>N.has(e)&&!z(N.get(e).options.buffer,"ipc")?1:0;var gt=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},o,{strict:i=!1}={})=>{let s="sendMessage";return de({methodName:s,isSubprocess:r,ipc:n,isConnected:e.connected}),cu({anyProcess:e,channel:t,methodName:s,isSubprocess:r,message:o,strict:i})},cu=async({anyProcess:e,channel:t,methodName:r,isSubprocess:n,message:o,strict:i})=>{let s=Bi({anyProcess:e,channel:t,isSubprocess:n,message:o,strict:i}),c=Ui(e,s,i);try{await Or({anyProcess:e,methodName:r,isSubprocess:n,wrappedMessage:s,message:o})}catch(l){throw me(e),l}finally{vi(c)}},Or=async({anyProcess:e,methodName:t,isSubprocess:r,wrappedMessage:n,message:o})=>{let i=lu(e);try{await Promise.all([$i(n,e,r),i(n)])}catch(s){throw bi({error:s,methodName:t,isSubprocess:r}),wi({error:s,methodName:t,isSubprocess:r,message:o}),s}},lu=e=>{if(Tr.has(e))return Tr.get(e);let t=au(e.send.bind(e));return Tr.set(e,t),t},Tr=new WeakMap;var _i=(e,t)=>{let r="cancelSignal";return br(r,!1,e.connected),Or({anyProcess:e,methodName:r,isSubprocess:!1,wrappedMessage:{type:ki,message:t},message:t})},ji=async({anyProcess:e,channel:t,isSubprocess:r,ipc:n})=>(await uu({anyProcess:e,channel:t,isSubprocess:r,ipc:n}),Ar.signal),uu=async({anyProcess:e,channel:t,isSubprocess:r,ipc:n})=>{if(!Ni){if(Ni=!0,!n){Si();return}if(t===null){Er();return}X(e,t,r),await fu.yield()}},Ni=!1,Pi=e=>e?.type!==ki?!1:(Ar.abort(e.message),!0),ki="execa:ipc:cancel",Er=()=>{Ar.abort(yi())},Ar=new AbortController;var Gi=({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.")}},zi=({subprocess:e,cancelSignal:t,gracefulCancel:r,forceKillAfterDelay:n,context:o,controller:i})=>r?[pu({subprocess:e,cancelSignal:t,forceKillAfterDelay:n,context:o,controller:i})]:[],pu=async({subprocess:e,cancelSignal:t,forceKillAfterDelay:r,context:n,controller:{signal:o}})=>{await ot(t,o);let i=du(t);throw await _i(e,i),Sr({kill:e.kill,forceKillAfterDelay:r,context:n,controllerSignal:o}),n.terminationReason??="gracefulCancel",t.reason},du=({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};a();import{setTimeout as mu}from"timers/promises";var Wi=({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})`)},Vi=(e,t,r,n)=>t===0||t===void 0?[]:[hu(e,t,r,n)],hu=async(e,t,r,{signal:n})=>{throw await mu(t,void 0,{signal:n}),r.terminationReason??="timeout",e.kill(),new B};a();import{execPath as gu,execArgv as yu}from"process";import Yi from"path";var qi=({options:e})=>{if(e.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}},Hi=(e,t,{node:r=!1,nodePath:n=gu,nodeOptions:o=yu.filter(l=>!l.startsWith("--inspect")),cwd:i,execPath:s,...c})=>{if(s!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let l=ce(n,'The "nodePath" option'),d=Yi.resolve(i,l),p={...c,nodePath:d,node:r,cwd:i};if(!r)return[e,t,p];if(Yi.basename(e,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[d,[...o,e,...t],{ipc:!0,...p,shell:!1}]};a();import{serialize as Su}from"v8";var Ki=({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`.");xu[r](e)}},bu=e=>{try{Su(e)}catch(t){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:t})}},wu=e=>{try{JSON.stringify(e)}catch(t){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:t})}},xu={advanced:bu,json:wu},Xi=async(e,t)=>{t!==void 0&&await e.sendMessage(t)};a();var Ji=({encoding:e})=>{if(Ir.has(e))return;let t=Tu(e);if(t!==void 0)throw new TypeError(`Invalid option \`encoding: ${yt(e)}\`.
26
26
  Please rename it to ${yt(t)}.`);let r=[...Ir].map(n=>yt(n)).join(", ");throw new TypeError(`Invalid option \`encoding: ${yt(e)}\`.
27
27
  Please rename it to one of: ${r}.`)},Eu=new Set(["utf8","utf16le"]),D=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),Ir=new Set([...Eu,...D]),Tu=e=>{if(e===null)return"buffer";if(typeof e!="string")return;let t=e.toLowerCase();if(t in Zi)return Zi[t];if(Ir.has(t))return t},Zi={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},yt=e=>typeof e=="string"?`"${e}"`:String(e);a();import{statSync as Ou}from"fs";import Au from"path";import Iu from"process";var Qi=(e=es())=>{let t=ce(e,'The "cwd" option');return Au.resolve(t)},es=()=>{try{return Iu.cwd()}catch(e){throw e.message=`The current directory does not exist.
28
28
  ${e.message}`,e}},ts=(e,t)=>{if(t===es())return e;let r;try{r=Ou(t)}catch(n){return`The "cwd" option is invalid: ${t}.
29
29
  ${n.message}
30
30
  ${e}`}return r.isDirectory()?e:`The "cwd" option is not a directory: ${t}.
31
- ${e}`};var St=(e,t,r)=>{r.cwd=Qi(r.cwd);let[n,o,i]=Hi(e,t,r),{command:s,args:c,options:l}=ns.default._parse(n,o,i),p=Gn(l),d=Ru(p);return Wi(d),Ji(d),Ki(d),ui(d),Gi(d),d.shell=Jt(d.shell),d.env=Cu(d),d.killSignal=si(d.killSignal),d.forceKillAfterDelay=li(d.forceKillAfterDelay),d.lines=d.lines.map((m,h)=>m&&!D.has(d.encoding)&&d.buffer[h]),rs.platform==="win32"&&Du.basename(s,".exe")==="cmd"&&c.unshift("/q"),{file:s,commandArguments:c,options:d}},Ru=({extendEnv:e=!0,preferLocal:t=!1,cwd:r,localDir:n=r,encoding:o="utf8",reject:i=!0,cleanup:s=!0,all:c=!1,windowsHide:l=!0,killSignal:p="SIGTERM",forceKillAfterDelay:d=!0,gracefulCancel:m=!1,ipcInput:h,ipc:g=h!==void 0||m,serialization:y="advanced",...b})=>({...b,extendEnv:e,preferLocal:t,cwd:r,localDirectory:n,encoding:o,reject:i,cleanup:s,all:c,windowsHide:l,killSignal:p,forceKillAfterDelay:d,gracefulCancel:m,ipcInput:h,ipc:g,serialization:y}),Cu=({env:e,extendEnv:t,preferLocal:r,node:n,localDirectory:o,nodePath:i})=>{let s=t?{...rs.env,...e}:e;return r||n?Ko({env:s,cwd:o,execPath:i,preferLocal:r,addExecPath:n}):s};a();var bt=(e,t,r)=>r.shell&&t.length>0?[[e,...t].join(" "),[],r]:[e,t,r];a();a();import{inspect as lp}from"util";a();function ge(e){if(typeof e=="string")return Mu(e);if(!(ArrayBuffer.isView(e)&&e.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return Pu(e)}var Mu=e=>e.at(-1)===os?e.slice(0,e.at(-2)===is?-2:-1):e,Pu=e=>e.at(-1)===Bu?e.subarray(0,e.at(-2)===Lu?-2:-1):e,os=`
32
- `,Bu=os.codePointAt(0),is="\r",Lu=is.codePointAt(0);a();a();import{on as ip}from"events";import{finished as sp}from"stream/promises";a();a();function $(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 Dr(e,{checkOpen:t=!0}={}){return $(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 re(e,{checkOpen:t=!0}={}){return $(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 Rr(e,t){return Dr(e,t)&&re(e,t)}a();a();var $u=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),Cr=class{#t;#r;#e=!1;#n=void 0;constructor(t,r){this.#t=t,this.#r=r}next(){let t=()=>this.#i();return this.#n=this.#n?this.#n.then(t,t):t(),this.#n}return(t){let r=()=>this.#o(t);return this.#n?this.#n.then(r,r):r()}async#i(){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#o(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}}},Mr=Symbol();function ss(){return this[Mr].next()}Object.defineProperty(ss,"name",{value:"next"});function as(e){return this[Mr].return(e)}Object.defineProperty(as,"name",{value:"return"});var Fu=Object.create($u,{next:{enumerable:!0,configurable:!0,writable:!0,value:ss},return:{enumerable:!0,configurable:!0,writable:!0,value:as}});function Pr({preventCancel:e=!1}={}){let t=this.getReader(),r=new Cr(t,e),n=Object.create(Fu);return n[Mr]=r,n}a();var cs=e=>{if(re(e,{checkOpen:!1})&&Pe.on!==void 0)return vu(e);if(typeof e?.[Symbol.asyncIterator]=="function")return e;if(Uu.call(e)==="[object ReadableStream]")return Pr.call(e);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:Uu}=Object.prototype,vu=async function*(e){let t=new AbortController,r={};Nu(e,t,r);try{for await(let[n]of Pe.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()}},Nu=async(e,t,r)=>{try{await Pe.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(n){r.error=n}finally{t.abort()}},Pe={};a();a();a();var ye=async(e,{init:t,convertChunk:r,getSize:n,truncateChunk:o,addChunk:i,getFinalChunk:s,finalize:c},{maxBuffer:l=Number.POSITIVE_INFINITY}={})=>{let p=cs(e),d=t();d.length=0;try{for await(let m of p){let h=ju(m),g=r[h](m,d);us({convertedChunk:g,state:d,getSize:n,truncateChunk:o,addChunk:i,maxBuffer:l})}return _u({state:d,convertChunk:r,getSize:n,truncateChunk:o,addChunk:i,getFinalChunk:s,maxBuffer:l}),c(d)}catch(m){let h=typeof m=="object"&&m!==null?m:new Error(m);throw h.bufferedData=c(d),h}},_u=({state:e,getSize:t,truncateChunk:r,addChunk:n,getFinalChunk:o,maxBuffer:i})=>{let s=o(e);s!==void 0&&us({convertedChunk:s,state:e,getSize:t,truncateChunk:r,addChunk:n,maxBuffer:i})},us=({convertedChunk:e,state:t,getSize:r,truncateChunk:n,addChunk:o,maxBuffer:i})=>{let s=r(e),c=t.length+s;if(c<=i){ls(e,t,o,c);return}let l=n(e,i-t.length);throw l!==void 0&&ls(l,t,o,i),new _},ls=(e,t,r,n)=>{t.contents=r(e,t,n),t.length=n},ju=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=fs.call(e);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&fs.call(e.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:fs}=Object.prototype,_=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}};a();var W=e=>e,Be=()=>{},wt=({contents:e})=>e,xt=e=>{throw new Error(`Streams in object mode are not supported: ${String(e)}`)},Et=e=>e.length;async function Tt(e,t){return ye(e,Wu,t)}var ku=()=>({contents:[]}),Gu=()=>1,zu=(e,{contents:t})=>(t.push(e),t),Wu={init:ku,convertChunk:{string:W,buffer:W,arrayBuffer:W,dataView:W,typedArray:W,others:W},getSize:Gu,truncateChunk:Be,addChunk:zu,getFinalChunk:Be,finalize:wt};a();async function Ot(e,t){return ye(e,Qu,t)}var Vu=()=>({contents:new ArrayBuffer(0)}),Yu=e=>qu.encode(e),qu=new TextEncoder,ps=e=>new Uint8Array(e),ds=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Hu=(e,t)=>e.slice(0,t),Ku=(e,{contents:t,length:r},n)=>{let o=gs()?Zu(t,n):Xu(t,n);return new Uint8Array(o).set(e,r),o},Xu=(e,t)=>{if(t<=e.byteLength)return e;let r=new ArrayBuffer(hs(t));return new Uint8Array(r).set(new Uint8Array(e),0),r},Zu=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let r=new ArrayBuffer(t,{maxByteLength:hs(t)});return new Uint8Array(r).set(new Uint8Array(e),0),r},hs=e=>ms**Math.ceil(Math.log(e)/Math.log(ms)),ms=2,Ju=({contents:e,length:t})=>gs()?e:e.slice(0,t),gs=()=>"resize"in ArrayBuffer.prototype,Qu={init:Vu,convertChunk:{string:Yu,buffer:ps,arrayBuffer:ps,dataView:ds,typedArray:ds,others:xt},getSize:Et,truncateChunk:Hu,addChunk:Ku,getFinalChunk:Be,finalize:Ju};a();async function It(e,t){return ye(e,op,t)}var ep=()=>({contents:"",textDecoder:new TextDecoder}),At=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),tp=(e,{contents:t})=>t+e,rp=(e,t)=>e.slice(0,t),np=({textDecoder:e})=>{let t=e.decode();return t===""?void 0:t},op={init:ep,convertChunk:{string:W,buffer:At,arrayBuffer:At,dataView:At,typedArray:At,others:xt},getSize:Et,truncateChunk:rp,addChunk:tp,getFinalChunk:np,finalize:wt};Object.assign(Pe,{on:ip,finished:sp});var ys=({error:e,stream:t,readableObjectMode:r,lines:n,encoding:o,fdNumber:i})=>{if(!(e instanceof _))throw e;if(i==="all")return e;let s=ap(r,n,o);throw e.maxBufferInfo={fdNumber:i,unit:s},t.destroy(),e},ap=(e,t,r)=>e?"objects":t?"lines":r==="buffer"?"bytes":"characters",Ss=(e,t,r)=>{if(t.length!==r)return;let n=new _;throw n.maxBufferInfo={fdNumber:"ipc"},n},bs=(e,t)=>{let{streamName:r,threshold:n,unit:o}=cp(e,t);return`Command's ${r} was larger than ${n} ${o}`},cp=(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 o=z(t,r);return r==="ipc"?{streamName:"IPC output",threshold:o,unit:"messages"}:{streamName:ze(r),threshold:o,unit:n}},ws=(e,t,r)=>e?.code==="ENOBUFS"&&t!==null&&t.some(n=>n!==null&&n.length>Dt(r)),xs=(e,t,r)=>{if(!t)return e;let n=Dt(r);return e.length>n?e.slice(0,n):e},Dt=([,e])=>e;var Ts=({stdio:e,all:t,ipcOutput:r,originalError:n,signal:o,signalDescription:i,exitCode:s,escapedCommand:c,timedOut:l,isCanceled:p,isGracefullyCanceled:d,isMaxBuffer:m,isForcefullyTerminated:h,forceKillAfterDelay:g,killSignal:y,maxBuffer:b,timeout:x,cwd:w})=>{let O=n?.code,A=fp({originalError:n,timedOut:l,timeout:x,isMaxBuffer:m,maxBuffer:b,errorCode:O,signal:o,signalDescription:i,exitCode:s,isCanceled:p,isGracefullyCanceled:d,isForcefullyTerminated:h,forceKillAfterDelay:g,killSignal:y}),R=pp(n,w),k=R===void 0?"":`
31
+ ${e}`};var St=(e,t,r)=>{r.cwd=Qi(r.cwd);let[n,o,i]=Hi(e,t,r),{command:s,args:c,options:l}=ns.default._parse(n,o,i),d=Gn(l),p=Ru(d);return Wi(p),Ji(p),Ki(p),ui(p),Gi(p),p.shell=Jt(p.shell),p.env=Cu(p),p.killSignal=si(p.killSignal),p.forceKillAfterDelay=li(p.forceKillAfterDelay),p.lines=p.lines.map((m,h)=>m&&!D.has(p.encoding)&&p.buffer[h]),rs.platform==="win32"&&Du.basename(s,".exe")==="cmd"&&c.unshift("/q"),{file:s,commandArguments:c,options:p}},Ru=({extendEnv:e=!0,preferLocal:t=!1,cwd:r,localDir:n=r,encoding:o="utf8",reject:i=!0,cleanup:s=!0,all:c=!1,windowsHide:l=!0,killSignal:d="SIGTERM",forceKillAfterDelay:p=!0,gracefulCancel:m=!1,ipcInput:h,ipc:g=h!==void 0||m,serialization:y="advanced",...b})=>({...b,extendEnv:e,preferLocal:t,cwd:r,localDirectory:n,encoding:o,reject:i,cleanup:s,all:c,windowsHide:l,killSignal:d,forceKillAfterDelay:p,gracefulCancel:m,ipcInput:h,ipc:g,serialization:y}),Cu=({env:e,extendEnv:t,preferLocal:r,node:n,localDirectory:o,nodePath:i})=>{let s=t?{...rs.env,...e}:e;return r||n?Ko({env:s,cwd:o,execPath:i,preferLocal:r,addExecPath:n}):s};a();var bt=(e,t,r)=>r.shell&&t.length>0?[[e,...t].join(" "),[],r]:[e,t,r];a();a();import{inspect as lp}from"util";a();function ge(e){if(typeof e=="string")return Mu(e);if(!(ArrayBuffer.isView(e)&&e.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return Pu(e)}var Mu=e=>e.at(-1)===os?e.slice(0,e.at(-2)===is?-2:-1):e,Pu=e=>e.at(-1)===Bu?e.subarray(0,e.at(-2)===Lu?-2:-1):e,os=`
32
+ `,Bu=os.codePointAt(0),is="\r",Lu=is.codePointAt(0);a();a();import{on as ip}from"events";import{finished as sp}from"stream/promises";a();a();function $(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 Dr(e,{checkOpen:t=!0}={}){return $(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 re(e,{checkOpen:t=!0}={}){return $(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 Rr(e,t){return Dr(e,t)&&re(e,t)}a();a();var $u=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),Cr=class{#t;#r;#e=!1;#n=void 0;constructor(t,r){this.#t=t,this.#r=r}next(){let t=()=>this.#i();return this.#n=this.#n?this.#n.then(t,t):t(),this.#n}return(t){let r=()=>this.#o(t);return this.#n?this.#n.then(r,r):r()}async#i(){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#o(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}}},Mr=Symbol();function ss(){return this[Mr].next()}Object.defineProperty(ss,"name",{value:"next"});function as(e){return this[Mr].return(e)}Object.defineProperty(as,"name",{value:"return"});var Fu=Object.create($u,{next:{enumerable:!0,configurable:!0,writable:!0,value:ss},return:{enumerable:!0,configurable:!0,writable:!0,value:as}});function Pr({preventCancel:e=!1}={}){let t=this.getReader(),r=new Cr(t,e),n=Object.create(Fu);return n[Mr]=r,n}a();var cs=e=>{if(re(e,{checkOpen:!1})&&Pe.on!==void 0)return vu(e);if(typeof e?.[Symbol.asyncIterator]=="function")return e;if(Uu.call(e)==="[object ReadableStream]")return Pr.call(e);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:Uu}=Object.prototype,vu=async function*(e){let t=new AbortController,r={};Nu(e,t,r);try{for await(let[n]of Pe.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()}},Nu=async(e,t,r)=>{try{await Pe.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(n){r.error=n}finally{t.abort()}},Pe={};a();a();a();var ye=async(e,{init:t,convertChunk:r,getSize:n,truncateChunk:o,addChunk:i,getFinalChunk:s,finalize:c},{maxBuffer:l=Number.POSITIVE_INFINITY}={})=>{let d=cs(e),p=t();p.length=0;try{for await(let m of d){let h=ju(m),g=r[h](m,p);us({convertedChunk:g,state:p,getSize:n,truncateChunk:o,addChunk:i,maxBuffer:l})}return _u({state:p,convertChunk:r,getSize:n,truncateChunk:o,addChunk:i,getFinalChunk:s,maxBuffer:l}),c(p)}catch(m){let h=typeof m=="object"&&m!==null?m:new Error(m);throw h.bufferedData=c(p),h}},_u=({state:e,getSize:t,truncateChunk:r,addChunk:n,getFinalChunk:o,maxBuffer:i})=>{let s=o(e);s!==void 0&&us({convertedChunk:s,state:e,getSize:t,truncateChunk:r,addChunk:n,maxBuffer:i})},us=({convertedChunk:e,state:t,getSize:r,truncateChunk:n,addChunk:o,maxBuffer:i})=>{let s=r(e),c=t.length+s;if(c<=i){ls(e,t,o,c);return}let l=n(e,i-t.length);throw l!==void 0&&ls(l,t,o,i),new _},ls=(e,t,r,n)=>{t.contents=r(e,t,n),t.length=n},ju=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=fs.call(e);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&fs.call(e.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:fs}=Object.prototype,_=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}};a();var W=e=>e,Be=()=>{},wt=({contents:e})=>e,xt=e=>{throw new Error(`Streams in object mode are not supported: ${String(e)}`)},Et=e=>e.length;async function Tt(e,t){return ye(e,Wu,t)}var ku=()=>({contents:[]}),Gu=()=>1,zu=(e,{contents:t})=>(t.push(e),t),Wu={init:ku,convertChunk:{string:W,buffer:W,arrayBuffer:W,dataView:W,typedArray:W,others:W},getSize:Gu,truncateChunk:Be,addChunk:zu,getFinalChunk:Be,finalize:wt};a();async function Ot(e,t){return ye(e,Qu,t)}var Vu=()=>({contents:new ArrayBuffer(0)}),Yu=e=>qu.encode(e),qu=new TextEncoder,ps=e=>new Uint8Array(e),ds=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Hu=(e,t)=>e.slice(0,t),Ku=(e,{contents:t,length:r},n)=>{let o=gs()?Zu(t,n):Xu(t,n);return new Uint8Array(o).set(e,r),o},Xu=(e,t)=>{if(t<=e.byteLength)return e;let r=new ArrayBuffer(hs(t));return new Uint8Array(r).set(new Uint8Array(e),0),r},Zu=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let r=new ArrayBuffer(t,{maxByteLength:hs(t)});return new Uint8Array(r).set(new Uint8Array(e),0),r},hs=e=>ms**Math.ceil(Math.log(e)/Math.log(ms)),ms=2,Ju=({contents:e,length:t})=>gs()?e:e.slice(0,t),gs=()=>"resize"in ArrayBuffer.prototype,Qu={init:Vu,convertChunk:{string:Yu,buffer:ps,arrayBuffer:ps,dataView:ds,typedArray:ds,others:xt},getSize:Et,truncateChunk:Hu,addChunk:Ku,getFinalChunk:Be,finalize:Ju};a();async function It(e,t){return ye(e,op,t)}var ep=()=>({contents:"",textDecoder:new TextDecoder}),At=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),tp=(e,{contents:t})=>t+e,rp=(e,t)=>e.slice(0,t),np=({textDecoder:e})=>{let t=e.decode();return t===""?void 0:t},op={init:ep,convertChunk:{string:W,buffer:At,arrayBuffer:At,dataView:At,typedArray:At,others:xt},getSize:Et,truncateChunk:rp,addChunk:tp,getFinalChunk:np,finalize:wt};Object.assign(Pe,{on:ip,finished:sp});var ys=({error:e,stream:t,readableObjectMode:r,lines:n,encoding:o,fdNumber:i})=>{if(!(e instanceof _))throw e;if(i==="all")return e;let s=ap(r,n,o);throw e.maxBufferInfo={fdNumber:i,unit:s},t.destroy(),e},ap=(e,t,r)=>e?"objects":t?"lines":r==="buffer"?"bytes":"characters",Ss=(e,t,r)=>{if(t.length!==r)return;let n=new _;throw n.maxBufferInfo={fdNumber:"ipc"},n},bs=(e,t)=>{let{streamName:r,threshold:n,unit:o}=cp(e,t);return`Command's ${r} was larger than ${n} ${o}`},cp=(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 o=z(t,r);return r==="ipc"?{streamName:"IPC output",threshold:o,unit:"messages"}:{streamName:ze(r),threshold:o,unit:n}},ws=(e,t,r)=>e?.code==="ENOBUFS"&&t!==null&&t.some(n=>n!==null&&n.length>Dt(r)),xs=(e,t,r)=>{if(!t)return e;let n=Dt(r);return e.length>n?e.slice(0,n):e},Dt=([,e])=>e;var Ts=({stdio:e,all:t,ipcOutput:r,originalError:n,signal:o,signalDescription:i,exitCode:s,escapedCommand:c,timedOut:l,isCanceled:d,isGracefullyCanceled:p,isMaxBuffer:m,isForcefullyTerminated:h,forceKillAfterDelay:g,killSignal:y,maxBuffer:b,timeout:E,cwd:w})=>{let O=n?.code,A=fp({originalError:n,timedOut:l,timeout:E,isMaxBuffer:m,maxBuffer:b,errorCode:O,signal:o,signalDescription:i,exitCode:s,isCanceled:d,isGracefullyCanceled:p,isForcefullyTerminated:h,forceKillAfterDelay:g,killSignal:y}),R=pp(n,w),k=R===void 0?"":`
33
33
  ${R}`,Y=`${A}: ${c}${k}`,Q=t===void 0?[e[2],e[1]]:[t],ae=[Y,...Q,...e.slice(3),r.map(q=>dp(q)).join(`
34
34
  `)].map(q=>Ae(ge(mp(q)))).filter(Boolean).join(`
35
35
 
36
- `);return{originalMessage:R,shortMessage:Y,message:ae}},fp=({originalError:e,timedOut:t,timeout:r,isMaxBuffer:n,maxBuffer:o,errorCode:i,signal:s,signalDescription:c,exitCode:l,isCanceled:p,isGracefullyCanceled:d,isForcefullyTerminated:m,forceKillAfterDelay:h,killSignal:g})=>{let y=up(m,h);return t?`Command timed out after ${r} milliseconds${y}`:d?s===void 0?`Command was gracefully canceled with exit code ${l}`:m?`Command was gracefully canceled${y}`:`Command was gracefully canceled with ${s} (${c})`:p?`Command was canceled${y}`:n?`${bs(e,o)}${y}`:i!==void 0?`Command failed with ${i}${y}`:m?`Command was killed with ${g} (${nt(g)})${y}`:s!==void 0?`Command was killed with ${s} (${c})`:l!==void 0?`Command failed with exit code ${l}`:"Command failed"},up=(e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:"",pp=(e,t)=>{if(e instanceof B)return;let r=Jo(e)?e.originalMessage:String(e?.message??e),n=Ae(ts(r,t));return n===""?void 0:n},dp=e=>typeof e=="string"?e:lp(e),mp=e=>Array.isArray(e)?e.map(t=>ge(Es(t))).filter(Boolean).join(`
37
- `):Es(e),Es=e=>typeof e=="string"?e:T(e)?ke(e):"";var Rt=({command:e,escapedCommand:t,stdio:r,all:n,ipcOutput:o,options:{cwd:i},startTime:s})=>Os({command:e,escapedCommand:t,cwd:i,durationMs:sr(s),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:o,pipedFrom:[]}),Se=({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:o,startTime:i,isSync:s})=>Le({error:e,command:t,escapedCommand:r,startTime:i,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:o,isSync:s}),Le=({error:e,command:t,escapedCommand:r,startTime:n,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:c,isForcefullyTerminated:l,exitCode:p,signal:d,stdio:m,all:h,ipcOutput:g,options:{timeoutDuration:y,timeout:b=y,forceKillAfterDelay:x,killSignal:w,cwd:O,maxBuffer:A},isSync:R})=>{let{exitCode:k,signal:Y,signalDescription:Q}=gp(p,d),{originalMessage:ae,shortMessage:q,message:Xt}=Ts({stdio:m,all:h,ipcOutput:g,originalError:e,signal:Y,signalDescription:Q,exitCode:k,escapedCommand:r,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:c,isForcefullyTerminated:l,forceKillAfterDelay:x,killSignal:w,maxBuffer:A,timeout:b,cwd:O}),Te=Xo(e,Xt,R);return Object.assign(Te,hp({error:Te,command:t,escapedCommand:r,startTime:n,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:c,isForcefullyTerminated:l,exitCode:k,signal:Y,signalDescription:Q,stdio:m,all:h,ipcOutput:g,cwd:O,originalMessage:ae,shortMessage:q})),Te},hp=({error:e,command:t,escapedCommand:r,startTime:n,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:c,isForcefullyTerminated:l,exitCode:p,signal:d,signalDescription:m,stdio:h,all:g,ipcOutput:y,cwd:b,originalMessage:x,shortMessage:w})=>Os({shortMessage:w,originalMessage:x,command:t,escapedCommand:r,cwd:b,durationMs:sr(n),failed:!0,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isTerminated:d!==void 0,isMaxBuffer:c,isForcefullyTerminated:l,exitCode:p,signal:d,signalDescription:m,code:e.cause?.code,stdout:h[1],stderr:h[2],all:g,stdio:h,ipcOutput:y,pipedFrom:[]}),Os=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0)),gp=(e,t)=>{let r=e===null?void 0:e,n=t===null?void 0:t,o=n===void 0?void 0:nt(t);return{exitCode:r,signal:n,signalDescription:o}};a();a();a();a();var As=e=>Number.isFinite(e)?e:0;function yp(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(As(e*1e3)%1e3),nanoseconds:Math.trunc(As(e*1e6)%1e3)}}function Sp(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 Br(e){switch(typeof e){case"number":{if(Number.isFinite(e))return yp(e);break}case"bigint":return Sp(e)}throw new TypeError("Expected a finite number or bigint")}var bp=e=>e===0||e===0n,wp=(e,t)=>t===1||t===1n?e:`${e}s`,xp=1e-7,Ep=24n*60n*60n*1000n;function Lr(e,t){let r=typeof e=="bigint";if(!r&&!Number.isFinite(e))throw new TypeError("Expected a finite number or bigint");t={...t},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 n=[],o=(p,d)=>{let m=Math.floor(p*10**d+xp);return(Math.round(m)/10**d).toFixed(d)},i=(p,d,m,h)=>{if(!((n.length===0||!t.colonNotation)&&bp(p)&&!(t.colonNotation&&m==="m"))){if(h=h??String(p),t.colonNotation){let g=h.includes(".")?h.split(".")[0].length:h.length,y=n.length>0?2:1;h="0".repeat(Math.max(0,y-g))+h}else h+=t.verbose?" "+wp(d,p):m;n.push(h)}},s=Br(e),c=BigInt(s.days);if(i(c/365n,"year","y"),i(c%365n,"day","d"),i(Number(s.hours),"hour","h"),i(Number(s.minutes),"minute","m"),t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3){let p=Number(s.seconds),d=Number(s.milliseconds),m=Number(s.microseconds),h=Number(s.nanoseconds);if(i(p,"second","s"),t.formatSubMilliseconds)i(d,"millisecond","ms"),i(m,"microsecond","\xB5s"),i(h,"nanosecond","ns");else{let g=d+m/1e3+h/1e6,y=typeof t.millisecondsDecimalDigits=="number"?t.millisecondsDecimalDigits:0,b=g>=1?Math.round(g):Math.ceil(g),x=y?g.toFixed(y):b;i(Number.parseFloat(x),"millisecond","ms",x)}}else{let p=(r?Number(e%Ep):e)/1e3%60,d=typeof t.secondsDecimalDigits=="number"?t.secondsDecimalDigits:1,m=o(p,d),h=t.keepDecimalsOnWholeSeconds?m:m.replace(/\.0+$/,"");i(Number.parseFloat(h),"second","s",h)}if(n.length===0)return"0"+(t.verbose?" milliseconds":"ms");let l=t.colonNotation?":":" ";return typeof t.unitCount=="number"&&(n=n.slice(0,Math.max(t.unitCount,1))),n.join(l)}a();var Is=(e,t)=>{e.failed&&U({type:"error",verboseMessage:e.shortMessage,verboseInfo:t,result:e})};var Ds=(e,t)=>{le(t)&&(Is(e,t),Tp(e,t))},Tp=(e,t)=>{let r=`(done in ${Lr(e.durationMs)})`;U({type:"duration",verboseMessage:r,verboseInfo:t,result:e})};var be=(e,t,{reject:r})=>{if(Ds(e,t),e.failed&&r)throw e;return e};a();import{readFileSync as ea}from"fs";a();a();a();var Ms=(e,t)=>ne(e)?"asyncGenerator":Ls(e)?"generator":Ct(e)?"fileUrl":Rp(e)?"filePath":Pp(e)?"webStream":$(e,{checkOpen:!1})?"native":T(e)?"uint8Array":Bp(e)?"asyncIterable":Lp(e)?"iterable":Ur(e)?Ps({transform:e},t):Dp(e)?Op(e,t):"native",Op=(e,t)=>Rr(e.transform,{checkOpen:!1})?Ap(e,t):Ur(e.transform)?Ps(e,t):Ip(e,t),Ap=(e,t)=>(Bs(e,t,"Duplex stream"),"duplex"),Ps=(e,t)=>(Bs(e,t,"web TransformStream"),"webTransform"),Bs=({final:e,binary:t,objectMode:r},n,o)=>{Rs(e,`${n}.final`,o),Rs(t,`${n}.binary`,o),$r(r,`${n}.objectMode`)},Rs=(e,t,r)=>{if(e!==void 0)throw new TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${r}.`)},Ip=({transform:e,final:t,binary:r,objectMode:n},o)=>{if(e!==void 0&&!Cs(e))throw new TypeError(`The \`${o}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(Rr(t,{checkOpen:!1}))throw new TypeError(`The \`${o}.final\` option must not be a Duplex stream.`);if(Ur(t))throw new TypeError(`The \`${o}.final\` option must not be a web TransformStream.`);if(t!==void 0&&!Cs(t))throw new TypeError(`The \`${o}.final\` option must be a generator.`);return $r(r,`${o}.binary`),$r(n,`${o}.objectMode`),ne(e)||ne(t)?"asyncGenerator":"generator"},$r=(e,t)=>{if(e!==void 0&&typeof e!="boolean")throw new TypeError(`The \`${t}\` option must use a boolean.`)},Cs=e=>ne(e)||Ls(e),ne=e=>Object.prototype.toString.call(e)==="[object AsyncGeneratorFunction]",Ls=e=>Object.prototype.toString.call(e)==="[object GeneratorFunction]",Dp=e=>E(e)&&(e.transform!==void 0||e.final!==void 0),Ct=e=>Object.prototype.toString.call(e)==="[object URL]",$s=e=>Ct(e)&&e.protocol!=="file:",Rp=e=>E(e)&&Object.keys(e).length>0&&Object.keys(e).every(t=>Cp.has(t))&&Fr(e.file),Cp=new Set(["file","append"]),Fr=e=>typeof e=="string",Fs=(e,t)=>e==="native"&&typeof t=="string"&&!Mp.has(t),Mp=new Set(["ipc","ignore","inherit","overlapped","pipe"]),Us=e=>Object.prototype.toString.call(e)==="[object ReadableStream]",Mt=e=>Object.prototype.toString.call(e)==="[object WritableStream]",Pp=e=>Us(e)||Mt(e),Ur=e=>Us(e?.readable)&&Mt(e?.writable),Bp=e=>vs(e)&&typeof e[Symbol.asyncIterator]=="function",Lp=e=>vs(e)&&typeof e[Symbol.iterator]=="function",vs=e=>typeof e=="object"&&e!==null,M=new Set(["generator","asyncGenerator","duplex","webTransform"]),Pt=new Set(["fileUrl","filePath","fileNumber"]),vr=new Set(["fileUrl","filePath"]),Ns=new Set([...vr,"webStream","nodeStream"]),_s=new Set(["webTransform","duplex"]),Z={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"};a();var Nr=(e,t,r,n)=>n==="output"?$p(e,t,r):Fp(e,t,r),$p=(e,t,r)=>{let n=t!==0&&r[t-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:e??n}},Fp=(e,t,r)=>{let n=t===0?e===!0:r[t-1].value.readableObjectMode,o=t!==r.length-1&&(e??n);return{writableObjectMode:n,readableObjectMode:o}},js=(e,t)=>{let r=e.findLast(({type:n})=>M.has(n));return r===void 0?!1:t==="input"?r.value.writableObjectMode:r.value.readableObjectMode};var ks=(e,t,r,n)=>[...e.filter(({type:o})=>!M.has(o)),...Up(e,t,r,n)],Up=(e,t,r,{encoding:n})=>{let o=e.filter(({type:s})=>M.has(s)),i=Array.from({length:o.length});for(let[s,c]of Object.entries(o))i[s]=vp({stdioItem:c,index:Number(s),newTransforms:i,optionName:t,direction:r,encoding:n});return kp(i,r)},vp=({stdioItem:e,stdioItem:{type:t},index:r,newTransforms:n,optionName:o,direction:i,encoding:s})=>t==="duplex"?Np({stdioItem:e,optionName:o}):t==="webTransform"?_p({stdioItem:e,index:r,newTransforms:n,direction:i}):jp({stdioItem:e,index:r,newTransforms:n,direction:i,encoding:s}),Np=({stdioItem:e,stdioItem:{value:{transform:t,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:o=n}},optionName:i})=>{if(o&&!n)throw new TypeError(`The \`${i}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!o&&n)throw new TypeError(`The \`${i}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...e,value:{transform:t,writableObjectMode:r,readableObjectMode:n}}},_p=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:n,direction:o})=>{let{transform:i,objectMode:s}=E(t)?t:{transform:t},{writableObjectMode:c,readableObjectMode:l}=Nr(s,r,n,o);return{...e,value:{transform:i,writableObjectMode:c,readableObjectMode:l}}},jp=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:n,direction:o,encoding:i})=>{let{transform:s,final:c,binary:l=!1,preserveNewlines:p=!1,objectMode:d}=E(t)?t:{transform:t},m=l||D.has(i),{writableObjectMode:h,readableObjectMode:g}=Nr(d,r,n,o);return{...e,value:{transform:s,final:c,binary:m,preserveNewlines:p,writableObjectMode:h,readableObjectMode:g}}},kp=(e,t)=>t==="input"?e.reverse():e;a();import _r from"process";var Gs=(e,t,r)=>{let n=e.map(o=>Gp(o,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)??Vp},Gp=({type:e,value:t},r)=>zp[r]??zs[e](t),zp=["input","output","output"],we=()=>{},jr=()=>"input",zs={generator:we,asyncGenerator:we,fileUrl:we,filePath:we,iterable:jr,asyncIterable:jr,uint8Array:jr,webStream:e=>Mt(e)?"output":"input",nodeStream(e){return re(e,{checkOpen:!1})?Dr(e,{checkOpen:!1})?void 0:"input":"output"},webTransform:we,duplex:we,native(e){let t=Wp(e);if(t!==void 0)return t;if($(e,{checkOpen:!1}))return zs.nodeStream(e)}},Wp=e=>{if([0,_r.stdin].includes(e))return"input";if([1,2,_r.stdout,_r.stderr].includes(e))return"output"},Vp="output";a();a();var Ws=(e,t)=>t&&!e.includes("ipc")?[...e,"ipc"]:e;var Vs=({stdio:e,ipc:t,buffer:r,...n},o,i)=>{let s=Yp(e,n).map((c,l)=>Ys(c,l));return i?Hp(s,r,o):Ws(s,t)},Yp=(e,t)=>{if(e===void 0)return C.map(n=>t[n]);if(qp(t))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${C.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,C.length);return Array.from({length:r},(n,o)=>e[o])},qp=e=>C.some(t=>e[t]!==void 0),Ys=(e,t)=>Array.isArray(e)?e.map(r=>Ys(r,t)):e??(t>=C.length?"ignore":"pipe"),Hp=(e,t,r)=>e.map((n,o)=>!t[o]&&o!==0&&!fe(r,o)&&Kp(n)?"ignore":n),Kp=e=>e==="pipe"||Array.isArray(e)&&e.every(t=>t==="pipe");a();import{readFileSync as Xp}from"fs";import Zp from"tty";var Hs=({stdioItem:e,stdioItem:{type:t},isStdioArray:r,fdNumber:n,direction:o,isSync:i})=>!r||t!=="native"?e:i?Jp({stdioItem:e,fdNumber:n,direction:o}):td({stdioItem:e,fdNumber:n}),Jp=({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:n,direction:o})=>{let i=Qp({value:t,optionName:r,fdNumber:n,direction:o});if(i!==void 0)return i;if($(t,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e},Qp=({value:e,optionName:t,fdNumber:r,direction:n})=>{let o=ed(e,r);if(o!==void 0){if(n==="output")return{type:"fileNumber",value:o,optionName:t};if(Zp.isatty(o))throw new TypeError(`The \`${t}: ${st(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:G(Xp(o)),optionName:t}}},ed=(e,t)=>{if(e==="inherit")return t;if(typeof e=="number")return e;let r=Ge.indexOf(e);if(r!==-1)return r},td=({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:n})=>t==="inherit"?{type:"nodeStream",value:qs(n,t,r),optionName:r}:typeof t=="number"?{type:"nodeStream",value:qs(t,t,r),optionName:r}:$(t,{checkOpen:!1})?{type:"nodeStream",value:t,optionName:r}:e,qs=(e,t,r)=>{let n=Ge[e];if(n===void 0)throw new TypeError(`The \`${r}: ${t}\` option is invalid: no such standard stream.`);return n};a();var Ks=({input:e,inputFile:t},r)=>r===0?[...rd(e),...od(t)]:[],rd=e=>e===void 0?[]:[{type:nd(e),value:e,optionName:"input"}],nd=e=>{if(re(e,{checkOpen:!1}))return"nodeStream";if(typeof e=="string")return"string";if(T(e))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},od=e=>e===void 0?[]:[{...id(e),optionName:"inputFile"}],id=e=>{if(Ct(e))return{type:"fileUrl",value:e};if(Fr(e))return{type:"filePath",value:{file:e}};throw new Error("The `inputFile` option must be a file path string or a file URL.")};a();var Xs=e=>e.filter((t,r)=>e.every((n,o)=>t.value!==n.value||r>=o||t.type==="generator"||t.type==="asyncGenerator")),Zs=({stdioItem:{type:e,value:t,optionName:r},direction:n,fileDescriptors:o,isSync:i})=>{let s=sd(o,e);if(s.length!==0){if(i){ad({otherStdioItems:s,type:e,value:t,optionName:r,direction:n});return}if(Ns.has(e))return Js({otherStdioItems:s,type:e,value:t,optionName:r,direction:n});_s.has(e)&&ld({otherStdioItems:s,type:e,value:t,optionName:r})}},sd=(e,t)=>e.flatMap(({direction:r,stdioItems:n})=>n.filter(o=>o.type===t).map(o=>({...o,direction:r}))),ad=({otherStdioItems:e,type:t,value:r,optionName:n,direction:o})=>{vr.has(t)&&Js({otherStdioItems:e,type:t,value:r,optionName:n,direction:o})},Js=({otherStdioItems:e,type:t,value:r,optionName:n,direction:o})=>{let i=e.filter(c=>cd(c,r));if(i.length===0)return;let s=i.find(c=>c.direction!==o);return Qs(s,n,t),o==="output"?i[0].stream:void 0},cd=({type:e,value:t},r)=>e==="filePath"?t.file===r.file:e==="fileUrl"?t.href===r.href:t===r,ld=({otherStdioItems:e,type:t,value:r,optionName:n})=>{let o=e.find(({value:{transform:i}})=>i===r.transform);Qs(o,n,t)},Qs=(e,t,r)=>{if(e!==void 0)throw new TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${Z[r]} that is the same.`)};var Bt=(e,t,r,n)=>{let i=Vs(t,r,n).map((c,l)=>fd({stdioOption:c,fdNumber:l,options:t,isSync:n})),s=Sd({initialFileDescriptors:i,addProperties:e,options:t,isSync:n});return t.stdio=s.map(({stdioItems:c})=>xd(c)),s},fd=({stdioOption:e,fdNumber:t,options:r,isSync:n})=>{let o=ze(t),{stdioItems:i,isStdioArray:s}=ud({stdioOption:e,fdNumber:t,options:r,optionName:o}),c=Gs(i,t,o),l=i.map(m=>Hs({stdioItem:m,isStdioArray:s,fdNumber:t,direction:c,isSync:n})),p=ks(l,o,c,r),d=js(p,c);return yd(p,d),{direction:c,objectMode:d,stdioItems:p}},ud=({stdioOption:e,fdNumber:t,options:r,optionName:n})=>{let i=[...(Array.isArray(e)?e:[e]).map(l=>pd(l,n)),...Ks(r,t)],s=Xs(i),c=s.length>1;return dd(s,c,n),hd(s),{stdioItems:s,isStdioArray:c}},pd=(e,t)=>({type:Ms(e,t),value:e,optionName:t}),dd=(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:o}of e)if(md.has(n))throw new Error(`The \`${o}\` option must not include \`${n}\`.`)}},md=new Set(["ignore","ipc"]),hd=e=>{for(let t of e)gd(t)},gd=({type:e,value:t,optionName:r})=>{if($s(t))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme.
36
+ `);return{originalMessage:R,shortMessage:Y,message:ae}},fp=({originalError:e,timedOut:t,timeout:r,isMaxBuffer:n,maxBuffer:o,errorCode:i,signal:s,signalDescription:c,exitCode:l,isCanceled:d,isGracefullyCanceled:p,isForcefullyTerminated:m,forceKillAfterDelay:h,killSignal:g})=>{let y=up(m,h);return t?`Command timed out after ${r} milliseconds${y}`:p?s===void 0?`Command was gracefully canceled with exit code ${l}`:m?`Command was gracefully canceled${y}`:`Command was gracefully canceled with ${s} (${c})`:d?`Command was canceled${y}`:n?`${bs(e,o)}${y}`:i!==void 0?`Command failed with ${i}${y}`:m?`Command was killed with ${g} (${nt(g)})${y}`:s!==void 0?`Command was killed with ${s} (${c})`:l!==void 0?`Command failed with exit code ${l}`:"Command failed"},up=(e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:"",pp=(e,t)=>{if(e instanceof B)return;let r=Jo(e)?e.originalMessage:String(e?.message??e),n=Ae(ts(r,t));return n===""?void 0:n},dp=e=>typeof e=="string"?e:lp(e),mp=e=>Array.isArray(e)?e.map(t=>ge(Es(t))).filter(Boolean).join(`
37
+ `):Es(e),Es=e=>typeof e=="string"?e:T(e)?ke(e):"";var Rt=({command:e,escapedCommand:t,stdio:r,all:n,ipcOutput:o,options:{cwd:i},startTime:s})=>Os({command:e,escapedCommand:t,cwd:i,durationMs:sr(s),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:o,pipedFrom:[]}),Se=({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:o,startTime:i,isSync:s})=>Le({error:e,command:t,escapedCommand:r,startTime:i,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:o,isSync:s}),Le=({error:e,command:t,escapedCommand:r,startTime:n,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:c,isForcefullyTerminated:l,exitCode:d,signal:p,stdio:m,all:h,ipcOutput:g,options:{timeoutDuration:y,timeout:b=y,forceKillAfterDelay:E,killSignal:w,cwd:O,maxBuffer:A},isSync:R})=>{let{exitCode:k,signal:Y,signalDescription:Q}=gp(d,p),{originalMessage:ae,shortMessage:q,message:Xt}=Ts({stdio:m,all:h,ipcOutput:g,originalError:e,signal:Y,signalDescription:Q,exitCode:k,escapedCommand:r,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:c,isForcefullyTerminated:l,forceKillAfterDelay:E,killSignal:w,maxBuffer:A,timeout:b,cwd:O}),Te=Xo(e,Xt,R);return Object.assign(Te,hp({error:Te,command:t,escapedCommand:r,startTime:n,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:c,isForcefullyTerminated:l,exitCode:k,signal:Y,signalDescription:Q,stdio:m,all:h,ipcOutput:g,cwd:O,originalMessage:ae,shortMessage:q})),Te},hp=({error:e,command:t,escapedCommand:r,startTime:n,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:c,isForcefullyTerminated:l,exitCode:d,signal:p,signalDescription:m,stdio:h,all:g,ipcOutput:y,cwd:b,originalMessage:E,shortMessage:w})=>Os({shortMessage:w,originalMessage:E,command:t,escapedCommand:r,cwd:b,durationMs:sr(n),failed:!0,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isTerminated:p!==void 0,isMaxBuffer:c,isForcefullyTerminated:l,exitCode:d,signal:p,signalDescription:m,code:e.cause?.code,stdout:h[1],stderr:h[2],all:g,stdio:h,ipcOutput:y,pipedFrom:[]}),Os=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0)),gp=(e,t)=>{let r=e===null?void 0:e,n=t===null?void 0:t,o=n===void 0?void 0:nt(t);return{exitCode:r,signal:n,signalDescription:o}};a();a();a();a();var As=e=>Number.isFinite(e)?e:0;function yp(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(As(e*1e3)%1e3),nanoseconds:Math.trunc(As(e*1e6)%1e3)}}function Sp(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 Br(e){switch(typeof e){case"number":{if(Number.isFinite(e))return yp(e);break}case"bigint":return Sp(e)}throw new TypeError("Expected a finite number or bigint")}var bp=e=>e===0||e===0n,wp=(e,t)=>t===1||t===1n?e:`${e}s`,xp=1e-7,Ep=24n*60n*60n*1000n;function Lr(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 o=[],i=(p,m)=>{let h=Math.floor(p*10**m+xp);return(Math.round(h)/10**m).toFixed(m)},s=(p,m,h,g)=>{if(!((o.length===0||!t.colonNotation)&&bp(p)&&!(t.colonNotation&&h==="m"))){if(g??=String(p),t.colonNotation){let y=g.includes(".")?g.split(".")[0].length:g.length,b=o.length>0?2:1;g="0".repeat(Math.max(0,b-y))+g}else g+=t.verbose?" "+wp(m,p):h;o.push(g)}},c=Br(e),l=BigInt(c.days);if(t.hideYearAndDays?s(BigInt(l)*24n+BigInt(c.hours),"hour","h"):(t.hideYear?s(l,"day","d"):(s(l/365n,"year","y"),s(l%365n,"day","d")),s(Number(c.hours),"hour","h")),s(Number(c.minutes),"minute","m"),!t.hideSeconds)if(t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3){let p=Number(c.seconds),m=Number(c.milliseconds),h=Number(c.microseconds),g=Number(c.nanoseconds);if(s(p,"second","s"),t.formatSubMilliseconds)s(m,"millisecond","ms"),s(h,"microsecond","\xB5s"),s(g,"nanosecond","ns");else{let y=m+h/1e3+g/1e6,b=typeof t.millisecondsDecimalDigits=="number"?t.millisecondsDecimalDigits:0,E=y>=1?Math.round(y):Math.ceil(y),w=b?y.toFixed(b):E;s(Number.parseFloat(w),"millisecond","ms",w)}}else{let p=(r?Number(e%Ep):e)/1e3%60,m=typeof t.secondsDecimalDigits=="number"?t.secondsDecimalDigits:1,h=i(p,m),g=t.keepDecimalsOnWholeSeconds?h:h.replace(/\.0+$/,"");s(Number.parseFloat(g),"second","s",g)}if(o.length===0)return n+"0"+(t.verbose?" milliseconds":"ms");let d=t.colonNotation?":":" ";return typeof t.unitCount=="number"&&(o=o.slice(0,Math.max(t.unitCount,1))),n+o.join(d)}a();var Is=(e,t)=>{e.failed&&U({type:"error",verboseMessage:e.shortMessage,verboseInfo:t,result:e})};var Ds=(e,t)=>{le(t)&&(Is(e,t),Tp(e,t))},Tp=(e,t)=>{let r=`(done in ${Lr(e.durationMs)})`;U({type:"duration",verboseMessage:r,verboseInfo:t,result:e})};var be=(e,t,{reject:r})=>{if(Ds(e,t),e.failed&&r)throw e;return e};a();import{readFileSync as ea}from"fs";a();a();a();var Ms=(e,t)=>ne(e)?"asyncGenerator":Ls(e)?"generator":Ct(e)?"fileUrl":Rp(e)?"filePath":Pp(e)?"webStream":$(e,{checkOpen:!1})?"native":T(e)?"uint8Array":Bp(e)?"asyncIterable":Lp(e)?"iterable":Ur(e)?Ps({transform:e},t):Dp(e)?Op(e,t):"native",Op=(e,t)=>Rr(e.transform,{checkOpen:!1})?Ap(e,t):Ur(e.transform)?Ps(e,t):Ip(e,t),Ap=(e,t)=>(Bs(e,t,"Duplex stream"),"duplex"),Ps=(e,t)=>(Bs(e,t,"web TransformStream"),"webTransform"),Bs=({final:e,binary:t,objectMode:r},n,o)=>{Rs(e,`${n}.final`,o),Rs(t,`${n}.binary`,o),$r(r,`${n}.objectMode`)},Rs=(e,t,r)=>{if(e!==void 0)throw new TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${r}.`)},Ip=({transform:e,final:t,binary:r,objectMode:n},o)=>{if(e!==void 0&&!Cs(e))throw new TypeError(`The \`${o}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(Rr(t,{checkOpen:!1}))throw new TypeError(`The \`${o}.final\` option must not be a Duplex stream.`);if(Ur(t))throw new TypeError(`The \`${o}.final\` option must not be a web TransformStream.`);if(t!==void 0&&!Cs(t))throw new TypeError(`The \`${o}.final\` option must be a generator.`);return $r(r,`${o}.binary`),$r(n,`${o}.objectMode`),ne(e)||ne(t)?"asyncGenerator":"generator"},$r=(e,t)=>{if(e!==void 0&&typeof e!="boolean")throw new TypeError(`The \`${t}\` option must use a boolean.`)},Cs=e=>ne(e)||Ls(e),ne=e=>Object.prototype.toString.call(e)==="[object AsyncGeneratorFunction]",Ls=e=>Object.prototype.toString.call(e)==="[object GeneratorFunction]",Dp=e=>x(e)&&(e.transform!==void 0||e.final!==void 0),Ct=e=>Object.prototype.toString.call(e)==="[object URL]",$s=e=>Ct(e)&&e.protocol!=="file:",Rp=e=>x(e)&&Object.keys(e).length>0&&Object.keys(e).every(t=>Cp.has(t))&&Fr(e.file),Cp=new Set(["file","append"]),Fr=e=>typeof e=="string",Fs=(e,t)=>e==="native"&&typeof t=="string"&&!Mp.has(t),Mp=new Set(["ipc","ignore","inherit","overlapped","pipe"]),Us=e=>Object.prototype.toString.call(e)==="[object ReadableStream]",Mt=e=>Object.prototype.toString.call(e)==="[object WritableStream]",Pp=e=>Us(e)||Mt(e),Ur=e=>Us(e?.readable)&&Mt(e?.writable),Bp=e=>vs(e)&&typeof e[Symbol.asyncIterator]=="function",Lp=e=>vs(e)&&typeof e[Symbol.iterator]=="function",vs=e=>typeof e=="object"&&e!==null,M=new Set(["generator","asyncGenerator","duplex","webTransform"]),Pt=new Set(["fileUrl","filePath","fileNumber"]),vr=new Set(["fileUrl","filePath"]),Ns=new Set([...vr,"webStream","nodeStream"]),_s=new Set(["webTransform","duplex"]),Z={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"};a();var Nr=(e,t,r,n)=>n==="output"?$p(e,t,r):Fp(e,t,r),$p=(e,t,r)=>{let n=t!==0&&r[t-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:e??n}},Fp=(e,t,r)=>{let n=t===0?e===!0:r[t-1].value.readableObjectMode,o=t!==r.length-1&&(e??n);return{writableObjectMode:n,readableObjectMode:o}},js=(e,t)=>{let r=e.findLast(({type:n})=>M.has(n));return r===void 0?!1:t==="input"?r.value.writableObjectMode:r.value.readableObjectMode};var ks=(e,t,r,n)=>[...e.filter(({type:o})=>!M.has(o)),...Up(e,t,r,n)],Up=(e,t,r,{encoding:n})=>{let o=e.filter(({type:s})=>M.has(s)),i=Array.from({length:o.length});for(let[s,c]of Object.entries(o))i[s]=vp({stdioItem:c,index:Number(s),newTransforms:i,optionName:t,direction:r,encoding:n});return kp(i,r)},vp=({stdioItem:e,stdioItem:{type:t},index:r,newTransforms:n,optionName:o,direction:i,encoding:s})=>t==="duplex"?Np({stdioItem:e,optionName:o}):t==="webTransform"?_p({stdioItem:e,index:r,newTransforms:n,direction:i}):jp({stdioItem:e,index:r,newTransforms:n,direction:i,encoding:s}),Np=({stdioItem:e,stdioItem:{value:{transform:t,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:o=n}},optionName:i})=>{if(o&&!n)throw new TypeError(`The \`${i}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!o&&n)throw new TypeError(`The \`${i}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...e,value:{transform:t,writableObjectMode:r,readableObjectMode:n}}},_p=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:n,direction:o})=>{let{transform:i,objectMode:s}=x(t)?t:{transform:t},{writableObjectMode:c,readableObjectMode:l}=Nr(s,r,n,o);return{...e,value:{transform:i,writableObjectMode:c,readableObjectMode:l}}},jp=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:n,direction:o,encoding:i})=>{let{transform:s,final:c,binary:l=!1,preserveNewlines:d=!1,objectMode:p}=x(t)?t:{transform:t},m=l||D.has(i),{writableObjectMode:h,readableObjectMode:g}=Nr(p,r,n,o);return{...e,value:{transform:s,final:c,binary:m,preserveNewlines:d,writableObjectMode:h,readableObjectMode:g}}},kp=(e,t)=>t==="input"?e.reverse():e;a();import _r from"process";var Gs=(e,t,r)=>{let n=e.map(o=>Gp(o,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)??Vp},Gp=({type:e,value:t},r)=>zp[r]??zs[e](t),zp=["input","output","output"],we=()=>{},jr=()=>"input",zs={generator:we,asyncGenerator:we,fileUrl:we,filePath:we,iterable:jr,asyncIterable:jr,uint8Array:jr,webStream:e=>Mt(e)?"output":"input",nodeStream(e){return re(e,{checkOpen:!1})?Dr(e,{checkOpen:!1})?void 0:"input":"output"},webTransform:we,duplex:we,native(e){let t=Wp(e);if(t!==void 0)return t;if($(e,{checkOpen:!1}))return zs.nodeStream(e)}},Wp=e=>{if([0,_r.stdin].includes(e))return"input";if([1,2,_r.stdout,_r.stderr].includes(e))return"output"},Vp="output";a();a();var Ws=(e,t)=>t&&!e.includes("ipc")?[...e,"ipc"]:e;var Vs=({stdio:e,ipc:t,buffer:r,...n},o,i)=>{let s=Yp(e,n).map((c,l)=>Ys(c,l));return i?Hp(s,r,o):Ws(s,t)},Yp=(e,t)=>{if(e===void 0)return C.map(n=>t[n]);if(qp(t))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${C.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,C.length);return Array.from({length:r},(n,o)=>e[o])},qp=e=>C.some(t=>e[t]!==void 0),Ys=(e,t)=>Array.isArray(e)?e.map(r=>Ys(r,t)):e??(t>=C.length?"ignore":"pipe"),Hp=(e,t,r)=>e.map((n,o)=>!t[o]&&o!==0&&!fe(r,o)&&Kp(n)?"ignore":n),Kp=e=>e==="pipe"||Array.isArray(e)&&e.every(t=>t==="pipe");a();import{readFileSync as Xp}from"fs";import Zp from"tty";var Hs=({stdioItem:e,stdioItem:{type:t},isStdioArray:r,fdNumber:n,direction:o,isSync:i})=>!r||t!=="native"?e:i?Jp({stdioItem:e,fdNumber:n,direction:o}):td({stdioItem:e,fdNumber:n}),Jp=({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:n,direction:o})=>{let i=Qp({value:t,optionName:r,fdNumber:n,direction:o});if(i!==void 0)return i;if($(t,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e},Qp=({value:e,optionName:t,fdNumber:r,direction:n})=>{let o=ed(e,r);if(o!==void 0){if(n==="output")return{type:"fileNumber",value:o,optionName:t};if(Zp.isatty(o))throw new TypeError(`The \`${t}: ${st(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:G(Xp(o)),optionName:t}}},ed=(e,t)=>{if(e==="inherit")return t;if(typeof e=="number")return e;let r=Ge.indexOf(e);if(r!==-1)return r},td=({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:n})=>t==="inherit"?{type:"nodeStream",value:qs(n,t,r),optionName:r}:typeof t=="number"?{type:"nodeStream",value:qs(t,t,r),optionName:r}:$(t,{checkOpen:!1})?{type:"nodeStream",value:t,optionName:r}:e,qs=(e,t,r)=>{let n=Ge[e];if(n===void 0)throw new TypeError(`The \`${r}: ${t}\` option is invalid: no such standard stream.`);return n};a();var Ks=({input:e,inputFile:t},r)=>r===0?[...rd(e),...od(t)]:[],rd=e=>e===void 0?[]:[{type:nd(e),value:e,optionName:"input"}],nd=e=>{if(re(e,{checkOpen:!1}))return"nodeStream";if(typeof e=="string")return"string";if(T(e))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},od=e=>e===void 0?[]:[{...id(e),optionName:"inputFile"}],id=e=>{if(Ct(e))return{type:"fileUrl",value:e};if(Fr(e))return{type:"filePath",value:{file:e}};throw new Error("The `inputFile` option must be a file path string or a file URL.")};a();var Xs=e=>e.filter((t,r)=>e.every((n,o)=>t.value!==n.value||r>=o||t.type==="generator"||t.type==="asyncGenerator")),Zs=({stdioItem:{type:e,value:t,optionName:r},direction:n,fileDescriptors:o,isSync:i})=>{let s=sd(o,e);if(s.length!==0){if(i){ad({otherStdioItems:s,type:e,value:t,optionName:r,direction:n});return}if(Ns.has(e))return Js({otherStdioItems:s,type:e,value:t,optionName:r,direction:n});_s.has(e)&&ld({otherStdioItems:s,type:e,value:t,optionName:r})}},sd=(e,t)=>e.flatMap(({direction:r,stdioItems:n})=>n.filter(o=>o.type===t).map(o=>({...o,direction:r}))),ad=({otherStdioItems:e,type:t,value:r,optionName:n,direction:o})=>{vr.has(t)&&Js({otherStdioItems:e,type:t,value:r,optionName:n,direction:o})},Js=({otherStdioItems:e,type:t,value:r,optionName:n,direction:o})=>{let i=e.filter(c=>cd(c,r));if(i.length===0)return;let s=i.find(c=>c.direction!==o);return Qs(s,n,t),o==="output"?i[0].stream:void 0},cd=({type:e,value:t},r)=>e==="filePath"?t.file===r.file:e==="fileUrl"?t.href===r.href:t===r,ld=({otherStdioItems:e,type:t,value:r,optionName:n})=>{let o=e.find(({value:{transform:i}})=>i===r.transform);Qs(o,n,t)},Qs=(e,t,r)=>{if(e!==void 0)throw new TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${Z[r]} that is the same.`)};var Bt=(e,t,r,n)=>{let i=Vs(t,r,n).map((c,l)=>fd({stdioOption:c,fdNumber:l,options:t,isSync:n})),s=Sd({initialFileDescriptors:i,addProperties:e,options:t,isSync:n});return t.stdio=s.map(({stdioItems:c})=>xd(c)),s},fd=({stdioOption:e,fdNumber:t,options:r,isSync:n})=>{let o=ze(t),{stdioItems:i,isStdioArray:s}=ud({stdioOption:e,fdNumber:t,options:r,optionName:o}),c=Gs(i,t,o),l=i.map(m=>Hs({stdioItem:m,isStdioArray:s,fdNumber:t,direction:c,isSync:n})),d=ks(l,o,c,r),p=js(d,c);return yd(d,p),{direction:c,objectMode:p,stdioItems:d}},ud=({stdioOption:e,fdNumber:t,options:r,optionName:n})=>{let i=[...(Array.isArray(e)?e:[e]).map(l=>pd(l,n)),...Ks(r,t)],s=Xs(i),c=s.length>1;return dd(s,c,n),hd(s),{stdioItems:s,isStdioArray:c}},pd=(e,t)=>({type:Ms(e,t),value:e,optionName:t}),dd=(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:o}of e)if(md.has(n))throw new Error(`The \`${o}\` option must not include \`${n}\`.`)}},md=new Set(["ignore","ipc"]),hd=e=>{for(let t of e)gd(t)},gd=({type:e,value:t,optionName:r})=>{if($s(t))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme.
38
38
  For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(Fs(e,t))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},yd=(e,t)=>{if(!t)return;let r=e.find(({type:n})=>Pt.has(n));if(r!==void 0)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},Sd=({initialFileDescriptors:e,addProperties:t,options:r,isSync:n})=>{let o=[];try{for(let i of e)o.push(bd({fileDescriptor:i,fileDescriptors:o,addProperties:t,options:r,isSync:n}));return o}catch(i){throw kr(o),i}},bd=({fileDescriptor:{direction:e,objectMode:t,stdioItems:r},fileDescriptors:n,addProperties:o,options:i,isSync:s})=>{let c=r.map(l=>wd({stdioItem:l,addProperties:o,direction:e,options:i,fileDescriptors:n,isSync:s}));return{direction:e,objectMode:t,stdioItems:c}},wd=({stdioItem:e,addProperties:t,direction:r,options:n,fileDescriptors:o,isSync:i})=>{let s=Zs({stdioItem:e,direction:r,fileDescriptors:o,isSync:i});return s!==void 0?{...e,stream:s}:{...e,...t[r][e.type](e,n)}},kr=e=>{for(let{stdioItems:t}of e)for(let{stream:r}of t)r!==void 0&&!P(r)&&r.destroy()},xd=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 ra=(e,t)=>Bt(Td,e,t,!0),j=({type:e,optionName:t})=>{na(t,Z[e])},Ed=({optionName:e,value:t})=>((t==="ipc"||t==="overlapped")&&na(e,`"${t}"`),{}),na=(e,t)=>{throw new TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},ta={generator(){},asyncGenerator:j,webStream:j,nodeStream:j,webTransform:j,duplex:j,asyncIterable:j,native:Ed},Td={input:{...ta,fileUrl:({value:e})=>({contents:[G(ea(e))]}),filePath:({value:{file:e}})=>({contents:[G(ea(e))]}),fileNumber:j,iterable:({value:e})=>({contents:[...e]}),string:({value:e})=>({contents:[e]}),uint8Array:({value:e})=>({contents:[e]})},output:{...ta,fileUrl:({value:e})=>({path:e}),filePath:({value:{file:e,append:t}})=>({path:e,append:t}),fileNumber:({value:e})=>({path:e}),iterable:j,string:j,uint8Array:j}};a();var V=(e,{stripFinalNewline:t},r)=>Gr(t,r)&&e!==void 0&&!Array.isArray(e)?ge(e):e,Gr=(e,t)=>t==="all"?e[1]||e[2]:e[t];a();a();import{Transform as Wd,getDefaultHighWaterMark as ma}from"stream";a();var Lt=(e,t,r,n)=>e||r?void 0:ia(t,n),Wr=(e,t,r)=>r?e.flatMap(n=>oa(n,t)):oa(e,t),oa=(e,t)=>{let{transform:r,final:n}=ia(t,{});return[...r(e),...n()]},ia=(e,t)=>(t.previousChunks="",{transform:Od.bind(void 0,t,e),final:Id.bind(void 0,t)}),Od=function*(e,t,r){if(typeof r!="string"){yield r;return}let{previousChunks:n}=e,o=-1;for(let i=0;i<r.length;i+=1)if(r[i]===`
39
39
  `){let s=Ad(r,i,t,e),c=r.slice(o+1,i+1-s);n.length>0&&(c=zr(n,c),n=""),yield c,o=i}o!==r.length-1&&(n=zr(n,r.slice(o+1))),e.previousChunks=n},Ad=(e,t,r,n)=>r?0:(n.isWindowsNewline=t!==0&&e[t-1]==="\r",n.isWindowsNewline?2:1),Id=function*({previousChunks:e}){e.length>0&&(yield e)},sa=({binary:e,preserveNewlines:t,readableObjectMode:r,state:n})=>e||t||r?void 0:{transform:Dd.bind(void 0,n)},Dd=function*({isWindowsNewline:e=!1},t){let{unixNewline:r,windowsNewline:n,LF:o,concatBytes:i}=typeof t=="string"?Rd:Md;if(t.at(-1)===o){yield t;return}yield i(t,e?n:r)},zr=(e,t)=>`${e}${t}`,Rd={windowsNewline:`\r
40
40
  `,unixNewline:`
41
41
  `,LF:`
42
42
  `,concatBytes:zr},Cd=(e,t)=>{let r=new Uint8Array(e.length+t.length);return r.set(e,0),r.set(t,e.length),r},Md={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:Cd};a();import{Buffer as Pd}from"buffer";var aa=(e,t)=>e?void 0:Bd.bind(void 0,t),Bd=function*(e,t){if(typeof t!="string"&&!T(t)&&!Pd.isBuffer(t))throw new TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},ca=(e,t)=>e?Ld.bind(void 0,t):$d.bind(void 0,t),Ld=function*(e,t){la(e,t),yield t},$d=function*(e,t){if(la(e,t),typeof t!="string"&&!T(t))throw new TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},la=(e,t)=>{if(t==null)throw new TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.
43
43
  Instead, \`yield\` should either be called with a value, or not be called at all. For example:
44
- if (condition) { yield value; }`)};a();import{Buffer as Fd}from"buffer";import{StringDecoder as Ud}from"string_decoder";var $t=(e,t,r)=>{if(r)return;if(e)return{transform:vd.bind(void 0,new TextEncoder)};let n=new Ud(t);return{transform:Nd.bind(void 0,n),final:_d.bind(void 0,n)}},vd=function*(e,t){Fd.isBuffer(t)?yield G(t):typeof t=="string"?yield e.encode(t):yield t},Nd=function*(e,t){yield T(t)?e.write(t):t},_d=function*(e){let t=e.end();t!==""&&(yield t)};a();import{callbackify as fa}from"util";var Vr=fa(async(e,t,r,n)=>{t.currentIterable=e(...r);try{for await(let o of t.currentIterable)n.push(o)}finally{delete t.currentIterable}}),Ft=async function*(e,t,r){if(r===t.length){yield e;return}let{transform:n=kd}=t[r];for await(let o of n(e))yield*Ft(o,t,r+1)},ua=async function*(e){for(let[t,{final:r}]of Object.entries(e))yield*jd(r,Number(t),e)},jd=async function*(e,t,r){if(e!==void 0)for await(let n of e())yield*Ft(n,r,t+1)},pa=fa(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),kd=function*(e){yield e};a();var Yr=(e,t,r,n)=>{try{for(let o of e(...t))r.push(o);n()}catch(o){n(o)}},da=(e,t)=>[...t.flatMap(r=>[...oe(r,e,0)]),...$e(e)],oe=function*(e,t,r){if(r===t.length){yield e;return}let{transform:n=zd}=t[r];for(let o of n(e))yield*oe(o,t,r+1)},$e=function*(e){for(let[t,{final:r}]of Object.entries(e))yield*Gd(r,Number(t),e)},Gd=function*(e,t,r){if(e!==void 0)for(let n of e())yield*oe(n,r,t+1)},zd=function*(e){yield e};var qr=({value:e,value:{transform:t,final:r,writableObjectMode:n,readableObjectMode:o},optionName:i},{encoding:s})=>{let c={},l=ha(e,s,i),p=ne(t),d=ne(r),m=p?Vr.bind(void 0,Ft,c):Yr.bind(void 0,oe),h=p||d?Vr.bind(void 0,ua,c):Yr.bind(void 0,$e),g=p||d?pa.bind(void 0,c):void 0;return{stream:new Wd({writableObjectMode:n,writableHighWaterMark:ma(n),readableObjectMode:o,readableHighWaterMark:ma(o),transform(b,x,w){m([b,l,0],this,w)},flush(b){h([l],this,b)},destroy:g})}},Ut=(e,t,r,n)=>{let o=t.filter(({type:s})=>s==="generator"),i=n?o.reverse():o;for(let{value:s,optionName:c}of i){let l=ha(s,r,c);e=da(l,e)}return e},ha=({transform:e,final:t,binary:r,writableObjectMode:n,readableObjectMode:o,preserveNewlines:i},s,c)=>{let l={};return[{transform:aa(n,c)},$t(r,s,n),Lt(r,i,n,l),{transform:e,final:t},{transform:ca(o,c)},sa({binary:r,preserveNewlines:i,readableObjectMode:o,state:l})].filter(Boolean)};var ga=(e,t)=>{for(let r of Vd(e))Yd(e,r,t)},Vd=e=>new Set(Object.entries(e).filter(([,{direction:t}])=>t==="input").map(([t])=>Number(t))),Yd=(e,t,r)=>{let{stdioItems:n}=e[t],o=n.filter(({contents:c})=>c!==void 0);if(o.length===0)return;if(t!==0){let[{type:c,optionName:l}]=o;throw new TypeError(`Only the \`stdin\` option, not \`${l}\`, can be ${Z[c]} with synchronous methods.`)}let s=o.map(({contents:c})=>c).map(c=>qd(c,n));r.input=Oe(s)},qd=(e,t)=>{let r=Ut(e,t,"utf8",!0);return Hd(r),Oe(r)},Hd=e=>{let t=e.find(r=>typeof r!="string"&&!T(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}.`)};a();import{writeFileSync as Jd,appendFileSync as Qd}from"fs";a();var vt=({stdioItems:e,encoding:t,verboseInfo:r,fdNumber:n})=>n!=="all"&&fe(r,n)&&!D.has(t)&&Kd(n)&&(e.some(({type:o,value:i})=>o==="native"&&Xd.has(i))||e.every(({type:o})=>M.has(o))),Kd=e=>e===1||e===2,Xd=new Set(["pipe","overlapped"]),ya=async(e,t,r,n)=>{for await(let o of e)Zd(t)||ba(o,r,n)},Sa=(e,t,r)=>{for(let n of e)ba(n,t,r)},Zd=e=>e._readableState.pipes.length>0,ba=(e,t,r)=>{let n=Ke(e);U({type:"output",verboseMessage:n,fdNumber:t,verboseInfo:r})};var wa=({fileDescriptors:e,syncResult:{output:t},options:r,isMaxBuffer:n,verboseInfo:o})=>{if(t===null)return{output:Array.from({length:3})};let i={},s=new Set([]);return{output:t.map((l,p)=>em({result:l,fileDescriptors:e,fdNumber:p,state:i,outputFiles:s,isMaxBuffer:n,verboseInfo:o},r)),...i}},em=({result:e,fileDescriptors:t,fdNumber:r,state:n,outputFiles:o,isMaxBuffer:i,verboseInfo:s},{buffer:c,encoding:l,lines:p,stripFinalNewline:d,maxBuffer:m})=>{if(e===null)return;let h=xs(e,i,m),g=G(h),{stdioItems:y,objectMode:b}=t[r],x=tm([g],y,l,n),{serializedResult:w,finalResult:O=w}=rm({chunks:x,objectMode:b,encoding:l,lines:p,stripFinalNewline:d,fdNumber:r});nm({serializedResult:w,fdNumber:r,state:n,verboseInfo:s,encoding:l,stdioItems:y,objectMode:b});let A=c[r]?O:void 0;try{return n.error===void 0&&om(w,y,o),A}catch(R){return n.error=R,A}},tm=(e,t,r,n)=>{try{return Ut(e,t,r,!1)}catch(o){return n.error=o,e}},rm=({chunks:e,objectMode:t,encoding:r,lines:n,stripFinalNewline:o,fdNumber:i})=>{if(t)return{serializedResult:e};if(r==="buffer")return{serializedResult:Oe(e)};let s=Fn(e,r);return n[i]?{serializedResult:s,finalResult:Wr(s,!o[i],t)}:{serializedResult:s}},nm=({serializedResult:e,fdNumber:t,state:r,verboseInfo:n,encoding:o,stdioItems:i,objectMode:s})=>{if(!vt({stdioItems:i,encoding:o,verboseInfo:n,fdNumber:t}))return;let c=Wr(e,!1,s);try{Sa(c,t,n)}catch(l){r.error??=l}},om=(e,t,r)=>{for(let{path:n,append:o}of t.filter(({type:i})=>Pt.has(i))){let i=typeof n=="string"?n:n.toString();o||r.has(i)?Qd(n,e):(r.add(i),Jd(n,e))}};a();var xa=([,e,t],r)=>{if(r.all)return e===void 0?t:t===void 0?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,V(t,r,"all")]:Array.isArray(t)?[V(e,r,"all"),...t]:T(e)&&T(t)?Qt([e,t]):`${e}${t}`};a();a();import{once as Hr}from"events";var Ea=async(e,t)=>{let[r,n]=await im(e);return t.isForcefullyTerminated??=!1,[r,n]},im=async e=>{let[t,r]=await Promise.allSettled([Hr(e,"spawn"),Hr(e,"exit")]);return t.status==="rejected"?[]:r.status==="rejected"?Ta(e):r.value},Ta=async e=>{try{return await Hr(e,"exit")}catch{return Ta(e)}},Oa=async e=>{let[t,r]=await e;if(!sm(t,r)&&Kr(t,r))throw new B;return[t,r]},sm=(e,t)=>e===void 0&&t===void 0,Kr=(e,t)=>e!==0||t!==null;var Aa=({error:e,status:t,signal:r,output:n},{maxBuffer:o})=>{let i=am(e,t,r),s=i?.code==="ETIMEDOUT",c=ws(i,n,o);return{resultError:i,exitCode:t,signal:r,timedOut:s,isMaxBuffer:c}},am=(e,t,r)=>e!==void 0?e:Kr(t,r)?new B:void 0;var Ia=(e,t,r)=>{let{file:n,commandArguments:o,command:i,escapedCommand:s,startTime:c,verboseInfo:l,options:p,fileDescriptors:d}=lm(e,t,r),m=pm({file:n,commandArguments:o,options:p,command:i,escapedCommand:s,verboseInfo:l,fileDescriptors:d,startTime:c});return be(m,l,p)},lm=(e,t,r)=>{let{command:n,escapedCommand:o,startTime:i,verboseInfo:s}=Ze(e,t,r),c=fm(r),{file:l,commandArguments:p,options:d}=St(e,t,c);um(d);let m=ra(d,s);return{file:l,commandArguments:p,command:n,escapedCommand:o,startTime:i,verboseInfo:s,options:d,fileDescriptors:m}},fm=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,um=({ipc:e,ipcInput:t,detached:r,cancelSignal:n})=>{t&&Nt("ipcInput"),e&&Nt("ipc: true"),r&&Nt("detached: true"),n&&Nt("cancelSignal")},Nt=e=>{throw new TypeError(`The "${e}" option cannot be used with synchronous methods.`)},pm=({file:e,commandArguments:t,options:r,command:n,escapedCommand:o,verboseInfo:i,fileDescriptors:s,startTime:c})=>{let l=dm({file:e,commandArguments:t,options:r,command:n,escapedCommand:o,fileDescriptors:s,startTime:c});if(l.failed)return l;let{resultError:p,exitCode:d,signal:m,timedOut:h,isMaxBuffer:g}=Aa(l,r),{output:y,error:b=p}=wa({fileDescriptors:s,syncResult:l,options:r,isMaxBuffer:g,verboseInfo:i}),x=y.map((O,A)=>V(O,r,A)),w=V(xa(y,r),r,"all");return hm({error:b,exitCode:d,signal:m,timedOut:h,isMaxBuffer:g,stdio:x,all:w,options:r,command:n,escapedCommand:o,startTime:c})},dm=({file:e,commandArguments:t,options:r,command:n,escapedCommand:o,fileDescriptors:i,startTime:s})=>{try{ga(i,r);let c=mm(r);return cm(...bt(e,t,c))}catch(c){return Se({error:c,command:n,escapedCommand:o,fileDescriptors:i,options:r,startTime:s,isSync:!0})}},mm=({encoding:e,maxBuffer:t,...r})=>({...r,encoding:"buffer",maxBuffer:Dt(t)}),hm=({error:e,exitCode:t,signal:r,timedOut:n,isMaxBuffer:o,stdio:i,all:s,options:c,command:l,escapedCommand:p,startTime:d})=>e===void 0?Rt({command:l,escapedCommand:p,stdio:i,all:s,ipcOutput:[],options:c,startTime:d}):Le({error:e,command:l,escapedCommand:p,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:o,isForcefullyTerminated:!1,exitCode:t,signal:r,stdio:i,all:s,ipcOutput:[],options:c,startTime:d,isSync:!0});a();import{setMaxListeners as rg}from"events";import{spawn as ng}from"child_process";a();import Pa from"process";a();import{once as Xr,on as gm}from"events";var Da=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},{reference:o=!0,filter:i}={})=>(de({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:pt(e)}),ym({anyProcess:e,channel:t,isSubprocess:r,filter:i,reference:o})),ym=async({anyProcess:e,channel:t,isSubprocess:r,filter:n,reference:o})=>{ct(t,o);let i=X(e,t,r),s=new AbortController;try{return await Promise.race([Sm(i,n,s),bm(i,r,s),wm(i,r,s)])}catch(c){throw me(e),c}finally{s.abort(),lt(t,o)}},Sm=async(e,t,{signal:r})=>{if(t===void 0){let[n]=await Xr(e,"message",{signal:r});return n}for await(let[n]of gm(e,"message",{signal:r}))if(t(n))return n},bm=async(e,t,{signal:r})=>{await Xr(e,"disconnect",{signal:r}),di(t)},wm=async(e,t,{signal:r})=>{let[n]=await Xr(e,"strict:error",{signal:r});throw it(n,t)};a();import{once as Ca,on as xm}from"events";var Ma=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},{reference:o=!0}={})=>Zr({anyProcess:e,channel:t,isSubprocess:r,ipc:n,shouldAwait:!r,reference:o}),Zr=({anyProcess:e,channel:t,isSubprocess:r,ipc:n,shouldAwait:o,reference:i})=>{de({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:pt(e)}),ct(t,i);let s=X(e,t,r),c=new AbortController,l={};return Em(e,s,c),Tm({ipcEmitter:s,isSubprocess:r,controller:c,state:l}),Om({anyProcess:e,channel:t,ipcEmitter:s,isSubprocess:r,shouldAwait:o,controller:c,state:l,reference:i})},Em=async(e,t,r)=>{try{await Ca(t,"disconnect",{signal:r.signal}),r.abort()}catch{}},Tm=async({ipcEmitter:e,isSubprocess:t,controller:r,state:n})=>{try{let[o]=await Ca(e,"strict:error",{signal:r.signal});n.error=it(o,t),r.abort()}catch{}},Om=async function*({anyProcess:e,channel:t,ipcEmitter:r,isSubprocess:n,shouldAwait:o,controller:i,state:s,reference:c}){try{for await(let[l]of xm(r,"message",{signal:i.signal}))Ra(s),yield l}catch{Ra(s)}finally{i.abort(),lt(t,c),n||me(e),o&&await e}},Ra=({error:e})=>{if(e)throw e};var Ba=(e,{ipc:t})=>{Object.assign(e,$a(e,!1,t))},La=()=>{let e=Pa,t=!0,r=Pa.channel!==void 0;return{...$a(e,t,r),getCancelSignal:ji.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})}},$a=(e,t,r)=>({sendMessage:gt.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getOneMessage:Da.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getEachMessage:Ma.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})});a();import{ChildProcess as Am}from"child_process";import{PassThrough as Im,Readable as Dm,Writable as Rm,Duplex as Cm}from"stream";var Fa=({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:o,startTime:i,verboseInfo:s})=>{kr(n);let c=new Am;Mm(c,n),Object.assign(c,{readable:Pm,writable:Bm,duplex:Lm});let l=Se({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:o,startTime:i,isSync:!1}),p=$m(l,s,o);return{subprocess:c,promise:p}},Mm=(e,t)=>{let r=Fe(),n=Fe(),o=Fe(),i=Array.from({length:t.length-3},Fe),s=Fe(),c=[r,n,o,...i];Object.assign(e,{stdin:r,stdout:n,stderr:o,all:s,stdio:c})},Fe=()=>{let e=new Im;return e.end(),e},Pm=()=>new Dm({read(){}}),Bm=()=>new Rm({write(){}}),Lm=()=>new Cm({read(){},write(){}}),$m=async(e,t,r)=>be(e,t,r);a();import{createReadStream as Ua,createWriteStream as va}from"fs";import{Buffer as Fm}from"buffer";import{Readable as Ue,Writable as Um,Duplex as vm}from"stream";var _a=(e,t)=>Bt(Nm,e,t,!1),ve=({type:e,optionName:t})=>{throw new TypeError(`The \`${t}\` option cannot be ${Z[e]}.`)},Na={fileNumber:ve,generator:qr,asyncGenerator:qr,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:r}}){let n=t||r;return{stream:vm.fromWeb(e,{objectMode:n})}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},Nm={input:{...Na,fileUrl:({value:e})=>({stream:Ua(e)}),filePath:({value:{file:e}})=>({stream:Ua(e)}),webStream:({value:e})=>({stream:Ue.fromWeb(e)}),iterable:({value:e})=>({stream:Ue.from(e)}),asyncIterable:({value:e})=>({stream:Ue.from(e)}),string:({value:e})=>({stream:Ue.from(e)}),uint8Array:({value:e})=>({stream:Ue.from(Fm.from(e))})},output:{...Na,fileUrl:({value:e})=>({stream:va(e)}),filePath:({value:{file:e,append:t}})=>({stream:va(e,t?{flags:"a"}:{})}),webStream:({value:e})=>({stream:Um.fromWeb(e)}),iterable:ve,asyncIterable:ve,string:ve,uint8Array:ve}};a();a();import{on as _m,once as ja}from"events";import{PassThrough as jm,getDefaultHighWaterMark as km}from"stream";import{finished as za}from"stream/promises";function ie(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(let o of e)Qr(o);let t=e.some(({readableObjectMode:o})=>o),r=Gm(e,t),n=new Jr({objectMode:t,writableHighWaterMark:r,readableHighWaterMark:r});for(let o of e)n.add(o);return n}var Gm=(e,t)=>{if(e.length===0)return km(t);let r=e.filter(({readableObjectMode:n})=>n===t).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},Jr=class extends jm{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#i=Symbol("unpipe");#o=new WeakMap;add(t){if(Qr(t),this.#t.has(t))return;this.#t.add(t),this.#n??=zm(this,this.#t,this.#i);let r=Ym({passThroughStream:this,stream:t,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#n,unpipeEvent:this.#i});this.#o.set(t,r),t.pipe(this,{end:!1})}async remove(t){if(Qr(t),!this.#t.has(t))return!1;let r=this.#o.get(t);return r===void 0?!1:(this.#o.delete(t),t.unpipe(this),await r,!0)}},zm=async(e,t,r)=>{_t(e,ka);let n=new AbortController;try{await Promise.race([Wm(e,n),Vm(e,t,r,n)])}finally{n.abort(),_t(e,-ka)}},Wm=async(e,{signal:t})=>{try{await za(e,{signal:t,cleanup:!0})}catch(r){throw Wa(e,r),r}},Vm=async(e,t,r,{signal:n})=>{for await(let[o]of _m(e,"unpipe",{signal:n}))t.has(o)&&o.emit(r)},Qr=e=>{if(typeof e?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},Ym=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,onFinished:i,unpipeEvent:s})=>{_t(e,Ga);let c=new AbortController;try{await Promise.race([qm(i,t,c),Hm({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:c}),Km({stream:t,streams:r,ended:n,aborted:o,unpipeEvent:s,controller:c})])}finally{c.abort(),_t(e,-Ga)}r.size>0&&r.size===n.size+o.size&&(n.size===0&&o.size>0?en(e):Xm(e))},qm=async(e,t,{signal:r})=>{try{await e,r.aborted||en(t)}catch(n){r.aborted||Wa(t,n)}},Hm=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:{signal:i}})=>{try{await za(t,{signal:i,cleanup:!0,readable:!0,writable:!1}),r.has(t)&&n.add(t)}catch(s){if(i.aborted||!r.has(t))return;Va(s)?o.add(t):Ya(e,s)}},Km=async({stream:e,streams:t,ended:r,aborted:n,unpipeEvent:o,controller:{signal:i}})=>{if(await ja(e,o,{signal:i}),!e.readable)return ja(i,"abort",{signal:i});t.delete(e),r.delete(e),n.delete(e)},Xm=e=>{e.writable&&e.end()},Wa=(e,t)=>{Va(t)?en(e):Ya(e,t)},Va=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",en=e=>{(e.readable||e.writable)&&e.destroy()},Ya=(e,t)=>{e.destroyed||(e.once("error",Zm),e.destroy(t))},Zm=()=>{},_t=(e,t)=>{let r=e.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&e.setMaxListeners(r+t)},ka=2,Ga=1;a();import{finished as qa}from"stream/promises";var xe=(e,t)=>{e.pipe(t),Jm(e,t),Qm(e,t)},Jm=async(e,t)=>{if(!(P(e)||P(t))){try{await qa(e,{cleanup:!0,readable:!0,writable:!1})}catch{}tn(t)}},tn=e=>{e.writable&&e.end()},Qm=async(e,t)=>{if(!(P(e)||P(t))){try{await qa(t,{cleanup:!0,readable:!1,writable:!0})}catch{}rn(e)}},rn=e=>{e.readable&&e.destroy()};var Ha=(e,t,r)=>{let n=new Map;for(let[o,{stdioItems:i,direction:s}]of Object.entries(t)){for(let{stream:c}of i.filter(({type:l})=>M.has(l)))eh(e,c,s,o);for(let{stream:c}of i.filter(({type:l})=>!M.has(l)))rh({subprocess:e,stream:c,direction:s,fdNumber:o,pipeGroups:n,controller:r})}for(let[o,i]of n.entries()){let s=i.length===1?i[0]:ie(i);xe(s,o)}},eh=(e,t,r,n)=>{r==="output"?xe(e.stdio[n],t):xe(t,e.stdio[n]);let o=th[n];o!==void 0&&(e[o]=t),e.stdio[n]=t},th=["stdin","stdout","stderr"],rh=({subprocess:e,stream:t,direction:r,fdNumber:n,pipeGroups:o,controller:i})=>{if(t===void 0)return;nh(t,i);let[s,c]=r==="output"?[t,e.stdio[n]]:[e.stdio[n],t],l=o.get(s)??[];o.set(s,[...l,c])},nh=(e,{signal:t})=>{P(e)&&te(e,oh,t)},oh=2;a();import{addAbortListener as ah}from"events";a();a();var se=[];se.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&se.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&se.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var jt=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",nn=Symbol.for("signal-exit emitter"),on=globalThis,ih=Object.defineProperty.bind(Object),sn=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(on[nn])return on[nn];ih(on,nn,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,r){this.listeners[t].push(r)}removeListener(t,r){let n=this.listeners[t],o=n.indexOf(r);o!==-1&&(o===0&&n.length===1?n.length=0:n.splice(o,1))}emit(t,r,n){if(this.emitted[t])return!1;this.emitted[t]=!0;let o=!1;for(let i of this.listeners[t])o=i(r,n)===!0||o;return t==="exit"&&(o=this.emit("afterExit",r,n)||o),o}},kt=class{},sh=e=>({onExit(t,r){return e.onExit(t,r)},load(){return e.load()},unload(){return e.unload()}}),an=class extends kt{onExit(){return()=>{}}load(){}unload(){}},cn=class extends kt{#t=ln.platform==="win32"?"SIGINT":"SIGHUP";#r=new sn;#e;#n;#i;#o={};#s=!1;constructor(t){super(),this.#e=t,this.#o={};for(let r of se)this.#o[r]=()=>{let n=this.#e.listeners(r),{count:o}=this.#r,i=t;if(typeof i.__signal_exit_emitter__=="object"&&typeof i.__signal_exit_emitter__.count=="number"&&(o+=i.__signal_exit_emitter__.count),n.length===o){this.unload();let s=this.#r.emit("exit",null,r),c=r==="SIGHUP"?this.#t:r;s||t.kill(t.pid,c)}};this.#i=t.reallyExit,this.#n=t.emit}onExit(t,r){if(!jt(this.#e))return()=>{};this.#s===!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.#s){this.#s=!0,this.#r.count+=1;for(let t of se)try{let r=this.#o[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.#s&&(this.#s=!1,se.forEach(t=>{let r=this.#o[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.#i,this.#r.count-=1)}#a(t){return jt(this.#e)?(this.#e.exitCode=t||0,this.#r.emit("exit",this.#e.exitCode,null),this.#i.call(this.#e,this.#e.exitCode)):0}#c(t,...r){let n=this.#n;if(t==="exit"&&jt(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let o=n.call(this.#e,t,...r);return this.#r.emit("exit",this.#e.exitCode,null),o}else return n.call(this.#e,t,...r)}},ln=globalThis.process,{onExit:Ka,load:YI,unload:qI}=sh(jt(ln)?new cn(ln):new an);var Xa=(e,{cleanup:t,detached:r},{signal:n})=>{if(!t||r)return;let o=Ka(()=>{e.kill()});ah(n,()=>{o()})};a();a();var Ja=({source:e,sourcePromise:t,boundOptions:r,createNested:n},...o)=>{let i=Xe(),{destination:s,destinationStream:c,destinationError:l,from:p,unpipeSignal:d}=ch(r,n,o),{sourceStream:m,sourceError:h}=fh(e,p),{options:g,fileDescriptors:y}=N.get(e);return{sourcePromise:t,sourceStream:m,sourceOptions:g,sourceError:h,destination:s,destinationStream:c,destinationError:l,unpipeSignal:d,fileDescriptors:y,startTime:i}},ch=(e,t,r)=>{try{let{destination:n,pipeOptions:{from:o,to:i,unpipeSignal:s}={}}=lh(e,t,...r),c=at(n,i);return{destination:n,destinationStream:c,from:o,unpipeSignal:s}}catch(n){return{destinationError:n}}},lh=(e,t,r,...n)=>{if(Array.isArray(r))return{destination:t(Za,e)(r,...n),pipeOptions:e};if(typeof r=="string"||r instanceof URL||Zt(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[o,i,s]=je(r,...n);return{destination:t(Za)(o,i,s),pipeOptions:s}}if(N.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}`)},Za=({options:e})=>({options:{...e,stdin:"pipe",piped:!0}}),fh=(e,t)=>{try{return{sourceStream:he(e,t)}}catch(r){return{sourceError:r}}};a();var ec=({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n,fileDescriptors:o,sourceOptions:i,startTime:s})=>{let c=uh({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n});if(c!==void 0)throw fn({error:c,fileDescriptors:o,sourceOptions:i,startTime:s})},uh=({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n})=>{if(t!==void 0&&n!==void 0)return n;if(n!==void 0)return rn(e),n;if(t!==void 0)return tn(r),t},fn=({error:e,fileDescriptors:t,sourceOptions:r,startTime:n})=>Se({error:e,command:Qa,escapedCommand:Qa,fileDescriptors:t,options:r,startTime:n,isSync:!1}),Qa="source.pipe(destination)";a();var tc=async e=>{let[{status:t,reason:r,value:n=r},{status:o,reason:i,value:s=i}]=await e;if(s.pipedFrom.includes(n)||s.pipedFrom.push(n),o==="rejected")throw s;if(t==="rejected")throw n;return s};a();import{finished as ph}from"stream/promises";var rc=(e,t,r)=>{let n=Gt.has(t)?mh(e,t):dh(e,t);return te(e,gh,r.signal),te(t,yh,r.signal),hh(t),n},dh=(e,t)=>{let r=ie([e]);return xe(r,t),Gt.set(t,r),r},mh=(e,t)=>{let r=Gt.get(t);return r.add(e),r},hh=async e=>{try{await ph(e,{cleanup:!0,readable:!1,writable:!0})}catch{}Gt.delete(e)},Gt=new WeakMap,gh=2,yh=1;a();import{aborted as Sh}from"util";var nc=(e,t)=>e===void 0?[]:[bh(e,t)],bh=async(e,{sourceStream:t,mergedStream:r,fileDescriptors:n,sourceOptions:o,startTime:i})=>{await Sh(e,t),await r.remove(t);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw fn({error:s,fileDescriptors:n,sourceOptions:o,startTime:i})};var zt=(e,...t)=>{if(E(t[0]))return zt.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:r,...n}=Ja(e,...t),o=wh({...n,destination:r});return o.pipe=zt.bind(void 0,{...e,source:r,sourcePromise:o,boundOptions:{}}),o},wh=async({sourcePromise:e,sourceStream:t,sourceOptions:r,sourceError:n,destination:o,destinationStream:i,destinationError:s,unpipeSignal:c,fileDescriptors:l,startTime:p})=>{let d=xh(e,o);ec({sourceStream:t,sourceError:n,destinationStream:i,destinationError:s,fileDescriptors:l,sourceOptions:r,startTime:p});let m=new AbortController;try{let h=rc(t,i,m);return await Promise.race([tc(d),...nc(c,{sourceStream:t,mergedStream:h,sourceOptions:r,fileDescriptors:l,startTime:p})])}finally{m.abort()}},xh=(e,t)=>Promise.allSettled([e,t]);a();a();a();import{setImmediate as Rh}from"timers/promises";a();import{on as Eh}from"events";import{getDefaultHighWaterMark as Th}from"stream";var Wt=({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:n,encoding:o,preserveNewlines:i})=>{let s=new AbortController;return Oh(t,s),ic({stream:e,controller:s,binary:r,shouldEncode:!e.readableObjectMode&&n,encoding:o,shouldSplit:!e.readableObjectMode,preserveNewlines:i})},Oh=async(e,t)=>{try{await e}catch{}finally{t.abort()}},un=({stream:e,onStreamEnd:t,lines:r,encoding:n,stripFinalNewline:o,allMixed:i})=>{let s=new AbortController;Ah(t,s,e);let c=e.readableObjectMode&&!i;return ic({stream:e,controller:s,binary:n==="buffer",shouldEncode:!c,encoding:n,shouldSplit:!c&&r,preserveNewlines:!o})},Ah=async(e,t,r)=>{try{await e}catch{r.destroy()}finally{t.abort()}},ic=({stream:e,controller:t,binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s})=>{let c=Eh(e,"data",{signal:t.signal,highWaterMark:oc,highWatermark:oc});return Ih({onStdoutChunk:c,controller:t,binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s})},pn=Th(!0),oc=pn,Ih=async function*({onStdoutChunk:e,controller:t,binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s}){let c=Dh({binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s});try{for await(let[l]of e)yield*oe(l,c,0)}catch(l){if(!t.signal.aborted)throw l}finally{yield*$e(c)}},Dh=({binary:e,shouldEncode:t,encoding:r,shouldSplit:n,preserveNewlines:o})=>[$t(e,r,!t),Lt(e,o,!n,{})].filter(Boolean);var sc=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,buffer:o,maxBuffer:i,lines:s,allMixed:c,stripFinalNewline:l,verboseInfo:p,streamInfo:d})=>{let m=Ch({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,allMixed:c,verboseInfo:p,streamInfo:d});if(!o){await Promise.all([Mh(e),m]);return}let h=Gr(l,r),g=un({stream:e,onStreamEnd:t,lines:s,encoding:n,stripFinalNewline:h,allMixed:c}),[y]=await Promise.all([Ph({stream:e,iterable:g,fdNumber:r,encoding:n,maxBuffer:i,lines:s}),m]);return y},Ch=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,allMixed:o,verboseInfo:i,streamInfo:{fileDescriptors:s}})=>{if(!vt({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:i,fdNumber:r}))return;let c=un({stream:e,onStreamEnd:t,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:o});await ya(c,e,r,i)},Mh=async e=>{await Rh(),e.readableFlowing===null&&e.resume()},Ph=async({stream:e,stream:{readableObjectMode:t},iterable:r,fdNumber:n,encoding:o,maxBuffer:i,lines:s})=>{try{return t||s?await Tt(r,{maxBuffer:i}):o==="buffer"?new Uint8Array(await Ot(r,{maxBuffer:i})):await It(r,{maxBuffer:i})}catch(c){return ac(ys({error:c,stream:e,readableObjectMode:t,lines:s,encoding:o,fdNumber:n}))}},dn=async e=>{try{return await e}catch(t){return ac(t)}},ac=({bufferedData:e})=>Ln(e)?new Uint8Array(e):e;a();import{finished as Bh}from"stream/promises";var Ne=async(e,t,r,{isSameDirection:n,stopOnExit:o=!1}={})=>{let i=Lh(e,r),s=new AbortController;try{await Promise.race([...o?[r.exitPromise]:[],Bh(e,{cleanup:!0,signal:s.signal})])}catch(c){i.stdinCleanedUp||Uh(c,t,r,n)}finally{s.abort()}},Lh=(e,{originalStreams:[t],subprocess:r})=>{let n={stdinCleanedUp:!1};return e===t&&$h(e,r,n),n},$h=(e,t,r)=>{let{_destroy:n}=e;e._destroy=(...o)=>{Fh(t,r),n.call(e,...o)}},Fh=({exitCode:e,signalCode:t},r)=>{(e!==null||t!==null)&&(r.stdinCleanedUp=!0)},Uh=(e,t,r,n)=>{if(!vh(e,t,r,n))throw e},vh=(e,t,r,n=!0)=>r.propagating?cc(e)||Vt(e):(r.propagating=!0,mn(r,t)===n?cc(e):Vt(e)),mn=({fileDescriptors:e},t)=>t!=="all"&&e[t].direction==="input",Vt=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",cc=e=>e?.code==="EPIPE";var lc=({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:i,verboseInfo:s,streamInfo:c})=>e.stdio.map((l,p)=>hn({stream:l,fdNumber:p,encoding:t,buffer:r[p],maxBuffer:n[p],lines:o[p],allMixed:!1,stripFinalNewline:i,verboseInfo:s,streamInfo:c})),hn=async({stream:e,fdNumber:t,encoding:r,buffer:n,maxBuffer:o,lines:i,allMixed:s,stripFinalNewline:c,verboseInfo:l,streamInfo:p})=>{if(!e)return;let d=Ne(e,t,p);if(mn(p,t)){await d;return}let[m]=await Promise.all([sc({stream:e,onStreamEnd:d,fdNumber:t,encoding:r,buffer:n,maxBuffer:o,lines:i,allMixed:s,stripFinalNewline:c,verboseInfo:l,streamInfo:p}),d]);return m};var fc=({stdout:e,stderr:t},{all:r})=>r&&(e||t)?ie([e,t].filter(Boolean)):void 0,uc=({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:i,verboseInfo:s,streamInfo:c})=>hn({...Nh(e,r),fdNumber:"all",encoding:t,maxBuffer:n[1]+n[2],lines:o[1]||o[2],allMixed:_h(e),stripFinalNewline:i,verboseInfo:s,streamInfo:c}),Nh=({stdout:e,stderr:t,all:r},[,n,o])=>{let i=n||o;return i?n?o?{stream:r,buffer:i}:{stream:e,buffer:i}:{stream:t,buffer:i}:{stream:r,buffer:i}},_h=({all:e,stdout:t,stderr:r})=>e&&t&&r&&t.readableObjectMode!==r.readableObjectMode;a();import{once as jh}from"events";a();a();var pc=e=>fe(e,"ipc"),dc=(e,t)=>{let r=Ke(e);U({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:t})};var mc=async({subprocess:e,buffer:t,maxBuffer:r,ipc:n,ipcOutput:o,verboseInfo:i})=>{if(!n)return o;let s=pc(i),c=z(t,"ipc"),l=z(r,"ipc");for await(let p of Zr({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))c&&(Ss(e,o,l),o.push(p)),s&&dc(p,i);return o},hc=async(e,t)=>(await Promise.allSettled([e]),t);var gc=async({subprocess:e,options:{encoding:t,buffer:r,maxBuffer:n,lines:o,timeoutDuration:i,cancelSignal:s,gracefulCancel:c,forceKillAfterDelay:l,stripFinalNewline:p,ipc:d,ipcInput:m},context:h,verboseInfo:g,fileDescriptors:y,originalStreams:b,onInternalError:x,controller:w})=>{let O=Ea(e,h),A={originalStreams:b,fileDescriptors:y,subprocess:e,exitPromise:O,propagating:!1},R=lc({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:p,verboseInfo:g,streamInfo:A}),k=uc({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:p,verboseInfo:g,streamInfo:A}),Y=[],Q=mc({subprocess:e,buffer:r,maxBuffer:n,ipc:d,ipcOutput:Y,verboseInfo:g}),ae=kh(b,e,A),q=Gh(y,A);try{return await Promise.race([Promise.all([{},Oa(O),Promise.all(R),k,Q,Xi(e,m),...ae,...q]),x,zh(e,w),...Vi(e,i,h,w),...pi({subprocess:e,cancelSignal:s,gracefulCancel:c,context:h,controller:w}),...zi({subprocess:e,cancelSignal:s,gracefulCancel:c,forceKillAfterDelay:l,context:h,controller:w})])}catch(Xt){return h.terminationReason??="other",Promise.all([{error:Xt},O,Promise.all(R.map(Te=>dn(Te))),dn(k),hc(Q,Y),Promise.allSettled(ae),Promise.allSettled(q)])}},kh=(e,t,r)=>e.map((n,o)=>n===t.stdio[o]?void 0:Ne(n,o,r)),Gh=(e,t)=>e.flatMap(({stdioItems:r},n)=>r.filter(({value:o,stream:i=o})=>$(i,{checkOpen:!1})&&!P(i)).map(({type:o,value:i,stream:s=i})=>Ne(s,n,t,{isSameDirection:M.has(o),stopOnExit:o==="native"}))),zh=async(e,{signal:t})=>{let[r]=await jh(e,"error",{signal:t});throw r};a();a();var yc=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),_e=(e,t,r)=>{let n=e[r];n.has(t)||n.set(t,[]);let o=n.get(t),i=v();return o.push(i),{resolve:i.resolve.bind(i),promises:o}},Ee=async({resolve:e,promises:t},r)=>{e();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...t])]);return!n};a();import{Readable as Wh}from"stream";import{callbackify as Vh}from"util";a();import{finished as Sc}from"stream/promises";var gn=async e=>{if(e!==void 0)try{await yn(e)}catch{}},bc=async e=>{if(e!==void 0)try{await Sn(e)}catch{}},yn=async e=>{await Sc(e,{cleanup:!0,readable:!1,writable:!0})},Sn=async e=>{await Sc(e,{cleanup:!0,readable:!0,writable:!1})},Yt=async(e,t)=>{if(await e,t)throw t},qt=(e,t,r)=>{r&&!Vt(r)?e.destroy(r):t&&e.destroy()};var wc=({subprocess:e,concurrentStreams:t,encoding:r},{from:n,binary:o=!0,preserveNewlines:i=!0}={})=>{let s=o||D.has(r),{subprocessStdout:c,waitReadableDestroy:l}=bn(e,n,t),{readableEncoding:p,readableObjectMode:d,readableHighWaterMark:m}=wn(c,s),{read:h,onStdoutDataDone:g}=xn({subprocessStdout:c,subprocess:e,binary:s,encoding:r,preserveNewlines:i}),y=new Wh({read:h,destroy:Vh(Tn.bind(void 0,{subprocessStdout:c,subprocess:e,waitReadableDestroy:l})),highWaterMark:m,objectMode:d,encoding:p});return En({subprocessStdout:c,onStdoutDataDone:g,readable:y,subprocess:e}),y},bn=(e,t,r)=>{let n=he(e,t),o=_e(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:o}},wn=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r},n)=>n?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:pn},xn=({subprocessStdout:e,subprocess:t,binary:r,encoding:n,preserveNewlines:o})=>{let i=v(),s=Wt({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:o});return{read(){Yh(this,s,i)},onStdoutDataDone:i}},Yh=async(e,t,r)=>{try{let{value:n,done:o}=await t.next();o?r.resolve():e.push(n)}catch{}},En=async({subprocessStdout:e,onStdoutDataDone:t,readable:r,subprocess:n,subprocessStdin:o})=>{try{await Sn(e),await n,await gn(o),await t,r.readable&&r.push(null)}catch(i){await gn(o),xc(r,i)}},Tn=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:r},n)=>{await Ee(r,t)&&(xc(e,n),await Yt(t,n))},xc=(e,t)=>{qt(e,e.readable,t)};a();import{Writable as qh}from"stream";import{callbackify as Ec}from"util";var Tc=({subprocess:e,concurrentStreams:t},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:o,waitWritableDestroy:i}=On(e,r,t),s=new qh({...An(n,e,o),destroy:Ec(Dn.bind(void 0,{subprocessStdin:n,subprocess:e,waitWritableFinal:o,waitWritableDestroy:i})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return In(n,s),s},On=(e,t,r)=>{let n=at(e,t),o=_e(r,n,"writableFinal"),i=_e(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:o,waitWritableDestroy:i}},An=(e,t,r)=>({write:Hh.bind(void 0,e),final:Ec(Kh.bind(void 0,e,t,r))}),Hh=(e,t,r,n)=>{e.write(t,r)?n():e.once("drain",n)},Kh=async(e,t,r)=>{await Ee(r,t)&&(e.writable&&e.end(),await t)},In=async(e,t,r)=>{try{await yn(e),t.writable&&t.end()}catch(n){await bc(r),Oc(t,n)}},Dn=async({subprocessStdin:e,subprocess:t,waitWritableFinal:r,waitWritableDestroy:n},o)=>{await Ee(r,t),await Ee(n,t)&&(Oc(e,o),await Yt(t,o))},Oc=(e,t)=>{qt(e,e.writable,t)};a();import{Duplex as Xh}from"stream";import{callbackify as Zh}from"util";var Ac=({subprocess:e,concurrentStreams:t,encoding:r},{from:n,to:o,binary:i=!0,preserveNewlines:s=!0}={})=>{let c=i||D.has(r),{subprocessStdout:l,waitReadableDestroy:p}=bn(e,n,t),{subprocessStdin:d,waitWritableFinal:m,waitWritableDestroy:h}=On(e,o,t),{readableEncoding:g,readableObjectMode:y,readableHighWaterMark:b}=wn(l,c),{read:x,onStdoutDataDone:w}=xn({subprocessStdout:l,subprocess:e,binary:c,encoding:r,preserveNewlines:s}),O=new Xh({read:x,...An(d,e,m),destroy:Zh(Jh.bind(void 0,{subprocessStdout:l,subprocessStdin:d,subprocess:e,waitReadableDestroy:p,waitWritableFinal:m,waitWritableDestroy:h})),readableHighWaterMark:b,writableHighWaterMark:d.writableHighWaterMark,readableObjectMode:y,writableObjectMode:d.writableObjectMode,encoding:g});return En({subprocessStdout:l,onStdoutDataDone:w,readable:O,subprocess:e,subprocessStdin:d}),In(d,O,l),O},Jh=async({subprocessStdout:e,subprocessStdin:t,subprocess:r,waitReadableDestroy:n,waitWritableFinal:o,waitWritableDestroy:i},s)=>{await Promise.all([Tn({subprocessStdout:e,subprocess:r,waitReadableDestroy:n},s),Dn({subprocessStdin:t,subprocess:r,waitWritableFinal:o,waitWritableDestroy:i},s)])};a();var Rn=(e,t,{from:r,binary:n=!1,preserveNewlines:o=!1}={})=>{let i=n||D.has(t),s=he(e,r),c=Wt({subprocessStdout:s,subprocess:e,binary:i,shouldEncode:!0,encoding:t,preserveNewlines:o});return Qh(c,s,e)},Qh=async function*(e,t,r){try{yield*e}finally{t.readable&&t.destroy(),await r}};var Ic=(e,{encoding:t})=>{let r=yc();e.readable=wc.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.writable=Tc.bind(void 0,{subprocess:e,concurrentStreams:r}),e.duplex=Ac.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.iterable=Rn.bind(void 0,e,t),e[Symbol.asyncIterator]=Rn.bind(void 0,e,t,{})};a();var Dc=(e,t)=>{for(let[r,n]of tg){let o=n.value.bind(t);Reflect.defineProperty(e,r,{...n,value:o})}},eg=(async()=>{})().constructor.prototype,tg=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(eg,e)]);var Rc=(e,t,r,n)=>{let{file:o,commandArguments:i,command:s,escapedCommand:c,startTime:l,verboseInfo:p,options:d,fileDescriptors:m}=og(e,t,r),{subprocess:h,promise:g}=sg({file:o,commandArguments:i,options:d,startTime:l,verboseInfo:p,command:s,escapedCommand:c,fileDescriptors:m});return h.pipe=zt.bind(void 0,{source:h,sourcePromise:g,boundOptions:{},createNested:n}),Dc(h,g),N.set(h,{options:d,fileDescriptors:m}),h},og=(e,t,r)=>{let{command:n,escapedCommand:o,startTime:i,verboseInfo:s}=Ze(e,t,r),{file:c,commandArguments:l,options:p}=St(e,t,r),d=ig(p),m=_a(d,s);return{file:c,commandArguments:l,command:n,escapedCommand:o,startTime:i,verboseInfo:s,options:d,fileDescriptors:m}},ig=({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}},sg=({file:e,commandArguments:t,options:r,startTime:n,verboseInfo:o,command:i,escapedCommand:s,fileDescriptors:c})=>{let l;try{l=ng(...bt(e,t,r))}catch(y){return Fa({error:y,command:i,escapedCommand:s,fileDescriptors:c,options:r,startTime:n,verboseInfo:o})}let p=new AbortController;rg(Number.POSITIVE_INFINITY,p.signal);let d=[...l.stdio];Ha(l,c,p),Xa(l,r,p);let m={},h=v();l.kill=fi.bind(void 0,{kill:l.kill.bind(l),options:r,onInternalError:h,context:m,controller:p}),l.all=fc(l,r),Ic(l,r),Ba(l,r);let g=ag({subprocess:l,options:r,startTime:n,verboseInfo:o,fileDescriptors:c,originalStreams:d,command:i,escapedCommand:s,context:m,onInternalError:h,controller:p});return{subprocess:l,promise:g}},ag=async({subprocess:e,options:t,startTime:r,verboseInfo:n,fileDescriptors:o,originalStreams:i,command:s,escapedCommand:c,context:l,onInternalError:p,controller:d})=>{let[m,[h,g],y,b,x]=await gc({subprocess:e,options:t,context:l,verboseInfo:n,fileDescriptors:o,originalStreams:i,onInternalError:p,controller:d});d.abort(),p.resolve();let w=y.map((R,k)=>V(R,t,k)),O=V(b,t,"all"),A=cg({errorInfo:m,exitCode:h,signal:g,stdio:w,all:O,ipcOutput:x,context:l,options:t,command:s,escapedCommand:c,startTime:r});return be(A,n,t)},cg=({errorInfo:e,exitCode:t,signal:r,stdio:n,all:o,ipcOutput:i,context:s,options:c,command:l,escapedCommand:p,startTime:d})=>"error"in e?Le({error:e.error,command:l,escapedCommand:p,timedOut:s.terminationReason==="timeout",isCanceled:s.terminationReason==="cancel"||s.terminationReason==="gracefulCancel",isGracefullyCanceled:s.terminationReason==="gracefulCancel",isMaxBuffer:e.error instanceof _,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:t,signal:r,stdio:n,all:o,ipcOutput:i,options:c,startTime:d,isSync:!1}):Rt({command:l,escapedCommand:p,stdio:n,all:o,ipcOutput:i,options:c,startTime:d});a();var Ht=(e,t)=>{let r=Object.fromEntries(Object.entries(t).map(([n,o])=>[n,lg(n,e[n],o)]));return{...e,...r}},lg=(e,t,r)=>fg.has(e)&&E(t)&&E(r)?{...t,...r}:r,fg=new Set(["env",...nr]);var J=(e,t,r,n)=>{let o=(s,c,l)=>J(s,c,r,l),i=(...s)=>ug({mapArguments:e,deepOptions:r,boundOptions:t,setBoundExeca:n,createNested:o},...s);return n!==void 0&&n(i,o,t),i},ug=({mapArguments:e,deepOptions:t={},boundOptions:r={},setBoundExeca:n,createNested:o},i,...s)=>{if(E(i))return o(e,Ht(r,i),n);let{file:c,commandArguments:l,options:p,isSync:d}=pg({mapArguments:e,firstArgument:i,nextArguments:s,deepOptions:t,boundOptions:r});return d?Ia(c,l,p):Rc(c,l,p,o)},pg=({mapArguments:e,firstArgument:t,nextArguments:r,deepOptions:n,boundOptions:o})=>{let i=_n(t)?jn(t,r):[t,...r],[s,c,l]=je(...i),p=Ht(Ht(n,o),l),{file:d=s,commandArguments:m=c,options:h=p,isSync:g=!1}=e({file:s,commandArguments:c,options:p});return{file:d,commandArguments:m,options:h,isSync:g}};a();var Cc=({file:e,commandArguments:t})=>Pc(e,t),Mc=({file:e,commandArguments:t})=>({...Pc(e,t),isSync:!0}),Pc=(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]=dg(e);return{file:r,commandArguments:n}},dg=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(mg)){let o=r.at(-1);o&&o.endsWith("\\")?r[r.length-1]=`${o.slice(0,-1)} ${n}`:r.push(n)}return r},mg=/ +/g;a();var Bc=(e,t,r)=>{e.sync=t(hg,r),e.s=e.sync},Lc=({options:e})=>$c(e),hg=({options:e})=>({...$c(e),isSync:!0}),$c=e=>({options:{...gg(e),...e}}),gg=({input:e,inputFile:t,stdio:r})=>e===void 0&&t===void 0&&r===void 0?{stdin:"inherit"}:{},Fc={preferLocal:!0};var Cn=J(()=>({})),uM=J(()=>({isSync:!0})),pM=J(Cc),dM=J(Mc),mM=J(qi),hM=J(Lc,{},Fc,Bc),{sendMessage:gM,getOneMessage:yM,getEachMessage:SM,getCancelSignal:bM}=La();import"semantic-release";a();var Kt;async function yg(e,t){await Mn("regctl",["image","copy",e,t])}async function Mn(e,t){try{await Cn(e,t)}catch(r){throw typeof r=="object"&&r!==null&&"command"in r&&"message"in r?new Error(`Unable to run "${r.command}": ${r.message}`):new Error(`Unable to run "${t.join(" ")}": ${r}`)}}function Uc(e){let t=e.split("@")[0].split(":");return t[1]&&t[1].includes("/")&&(t=[t[0]+":"+t[1],t[2]]),t[0]}function Sg(e){if(!e)return{major:null,minor:null};let t=e.split(".",2);return{major:t[0],minor:t[1]}}function bg(e,t){let r=[];if(!t.nextRelease)return[];let n=t.nextRelease.version;return e.images.forEach(o=>{let i=Uc(o);if(e.tag.version&&n&&r.push({input:o,output:`${i}:${n}`}),!xg(t)){let{major:c,minor:l}=Sg(n);e.tag.latest&&r.push({input:o,output:`${i}:latest`}),e.tag.major&&c&&r.push({input:o,output:`${i}:${c}`}),e.tag.minor&&c&&l&&r.push({input:o,output:`${i}:${c}.${l}`})}let s=t.nextRelease?.channel;e.tag.channel&&s&&r.push({input:o,output:`${i}:${s}`})}),r}function wg(e){let t=Uc(e).split("/");if(t[0]==="ghcr.io"&&t.length===3)return`https://github.com/${t[1]}/${t[2]}/pkgs/container/${t[2]}`;if(t[0]==="registry.gitlab.com"&&t.length>=3)return`https://gitlab.com/${t[1]}/${t[2]}/container_registry`;let r=t[0].includes(".");if(!r&&t.length===2)return`https://hub.docker.com/r/${t[0]}/${t[1]}/tags`;if(!r&&t.length===1)return`https://hub.docker.com/_/${t[0]}/tags`}function xg(e){return!!(e.nextRelease&&e.nextRelease.version.includes("-"))}async function Eg(){if(Kt!==void 0)return Kt;try{return await Cn("which",["regctl"]),Kt=!0,!0}catch{return Kt=!1,!1}}function Tg(e){let t={images:[],tag:{channel:!0,latest:!0,major:!0,minor:!0,version:!0}};if(typeof e.images=="string")t.images.push(e.images);else if(Array.isArray(e.images))e.images.filter(n=>typeof n=="string").forEach(n=>t.images.push(n));else throw new Error("Configuration invalid: No image defined!");return Object.keys(t.tag).forEach(n=>{let o=e.tag?e.tag[n]:void 0;(o===!0||o===!1)&&(t.tag[n]=o)}),t}async function Og(e,t){if(!t.nextRelease)return t.logger.log("No release schedules, so no images to tag."),!1;let r=Tg(e),n=bg(r,t);if(!n.length)return!1;for(let s of n){if(await Eg()){t.logger.log(`Copy with regctl ${s.input} \u2192 ${s.output}`);try{await yg(s.input,s.output);continue}catch(c){t.logger.error(c),t.logger.log("Retry without regctl\u2026")}}t.logger.log(`Tag ${s.input} \u2192 ${s.output}`),await Ig(s.input,s.output),t.logger.log(`Push ${s.output}`),await Ag(s.output)}let o=t.nextRelease?.channel,i=n[0];return{channel:o,name:`Docker container (${i.output})`,url:wg(i.output)}}async function Ag(e){await Mn("docker",["push",e])}async function Ig(e,t){await Mn("docker",["tag",e,t])}var IM={publish:Og};export{yg as copyImage,IM as default,Mn as exec,Uc as getBaseImage,Sg as getMajorAndMinorPart,bg as getTagTasks,wg as getUrlFromImage,xg as isPreRelease,Eg as isRegCtlAvailable,Tg as parseConfig,Og as publish,Ag as pushImage,Ig as tagImage};
44
+ if (condition) { yield value; }`)};a();import{Buffer as Fd}from"buffer";import{StringDecoder as Ud}from"string_decoder";var $t=(e,t,r)=>{if(r)return;if(e)return{transform:vd.bind(void 0,new TextEncoder)};let n=new Ud(t);return{transform:Nd.bind(void 0,n),final:_d.bind(void 0,n)}},vd=function*(e,t){Fd.isBuffer(t)?yield G(t):typeof t=="string"?yield e.encode(t):yield t},Nd=function*(e,t){yield T(t)?e.write(t):t},_d=function*(e){let t=e.end();t!==""&&(yield t)};a();import{callbackify as fa}from"util";var Vr=fa(async(e,t,r,n)=>{t.currentIterable=e(...r);try{for await(let o of t.currentIterable)n.push(o)}finally{delete t.currentIterable}}),Ft=async function*(e,t,r){if(r===t.length){yield e;return}let{transform:n=kd}=t[r];for await(let o of n(e))yield*Ft(o,t,r+1)},ua=async function*(e){for(let[t,{final:r}]of Object.entries(e))yield*jd(r,Number(t),e)},jd=async function*(e,t,r){if(e!==void 0)for await(let n of e())yield*Ft(n,r,t+1)},pa=fa(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),kd=function*(e){yield e};a();var Yr=(e,t,r,n)=>{try{for(let o of e(...t))r.push(o);n()}catch(o){n(o)}},da=(e,t)=>[...t.flatMap(r=>[...oe(r,e,0)]),...$e(e)],oe=function*(e,t,r){if(r===t.length){yield e;return}let{transform:n=zd}=t[r];for(let o of n(e))yield*oe(o,t,r+1)},$e=function*(e){for(let[t,{final:r}]of Object.entries(e))yield*Gd(r,Number(t),e)},Gd=function*(e,t,r){if(e!==void 0)for(let n of e())yield*oe(n,r,t+1)},zd=function*(e){yield e};var qr=({value:e,value:{transform:t,final:r,writableObjectMode:n,readableObjectMode:o},optionName:i},{encoding:s})=>{let c={},l=ha(e,s,i),d=ne(t),p=ne(r),m=d?Vr.bind(void 0,Ft,c):Yr.bind(void 0,oe),h=d||p?Vr.bind(void 0,ua,c):Yr.bind(void 0,$e),g=d||p?pa.bind(void 0,c):void 0;return{stream:new Wd({writableObjectMode:n,writableHighWaterMark:ma(n),readableObjectMode:o,readableHighWaterMark:ma(o),transform(b,E,w){m([b,l,0],this,w)},flush(b){h([l],this,b)},destroy:g})}},Ut=(e,t,r,n)=>{let o=t.filter(({type:s})=>s==="generator"),i=n?o.reverse():o;for(let{value:s,optionName:c}of i){let l=ha(s,r,c);e=da(l,e)}return e},ha=({transform:e,final:t,binary:r,writableObjectMode:n,readableObjectMode:o,preserveNewlines:i},s,c)=>{let l={};return[{transform:aa(n,c)},$t(r,s,n),Lt(r,i,n,l),{transform:e,final:t},{transform:ca(o,c)},sa({binary:r,preserveNewlines:i,readableObjectMode:o,state:l})].filter(Boolean)};var ga=(e,t)=>{for(let r of Vd(e))Yd(e,r,t)},Vd=e=>new Set(Object.entries(e).filter(([,{direction:t}])=>t==="input").map(([t])=>Number(t))),Yd=(e,t,r)=>{let{stdioItems:n}=e[t],o=n.filter(({contents:c})=>c!==void 0);if(o.length===0)return;if(t!==0){let[{type:c,optionName:l}]=o;throw new TypeError(`Only the \`stdin\` option, not \`${l}\`, can be ${Z[c]} with synchronous methods.`)}let s=o.map(({contents:c})=>c).map(c=>qd(c,n));r.input=Oe(s)},qd=(e,t)=>{let r=Ut(e,t,"utf8",!0);return Hd(r),Oe(r)},Hd=e=>{let t=e.find(r=>typeof r!="string"&&!T(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}.`)};a();import{writeFileSync as Jd,appendFileSync as Qd}from"fs";a();var vt=({stdioItems:e,encoding:t,verboseInfo:r,fdNumber:n})=>n!=="all"&&fe(r,n)&&!D.has(t)&&Kd(n)&&(e.some(({type:o,value:i})=>o==="native"&&Xd.has(i))||e.every(({type:o})=>M.has(o))),Kd=e=>e===1||e===2,Xd=new Set(["pipe","overlapped"]),ya=async(e,t,r,n)=>{for await(let o of e)Zd(t)||ba(o,r,n)},Sa=(e,t,r)=>{for(let n of e)ba(n,t,r)},Zd=e=>e._readableState.pipes.length>0,ba=(e,t,r)=>{let n=Ke(e);U({type:"output",verboseMessage:n,fdNumber:t,verboseInfo:r})};var wa=({fileDescriptors:e,syncResult:{output:t},options:r,isMaxBuffer:n,verboseInfo:o})=>{if(t===null)return{output:Array.from({length:3})};let i={},s=new Set([]);return{output:t.map((l,d)=>em({result:l,fileDescriptors:e,fdNumber:d,state:i,outputFiles:s,isMaxBuffer:n,verboseInfo:o},r)),...i}},em=({result:e,fileDescriptors:t,fdNumber:r,state:n,outputFiles:o,isMaxBuffer:i,verboseInfo:s},{buffer:c,encoding:l,lines:d,stripFinalNewline:p,maxBuffer:m})=>{if(e===null)return;let h=xs(e,i,m),g=G(h),{stdioItems:y,objectMode:b}=t[r],E=tm([g],y,l,n),{serializedResult:w,finalResult:O=w}=rm({chunks:E,objectMode:b,encoding:l,lines:d,stripFinalNewline:p,fdNumber:r});nm({serializedResult:w,fdNumber:r,state:n,verboseInfo:s,encoding:l,stdioItems:y,objectMode:b});let A=c[r]?O:void 0;try{return n.error===void 0&&om(w,y,o),A}catch(R){return n.error=R,A}},tm=(e,t,r,n)=>{try{return Ut(e,t,r,!1)}catch(o){return n.error=o,e}},rm=({chunks:e,objectMode:t,encoding:r,lines:n,stripFinalNewline:o,fdNumber:i})=>{if(t)return{serializedResult:e};if(r==="buffer")return{serializedResult:Oe(e)};let s=Fn(e,r);return n[i]?{serializedResult:s,finalResult:Wr(s,!o[i],t)}:{serializedResult:s}},nm=({serializedResult:e,fdNumber:t,state:r,verboseInfo:n,encoding:o,stdioItems:i,objectMode:s})=>{if(!vt({stdioItems:i,encoding:o,verboseInfo:n,fdNumber:t}))return;let c=Wr(e,!1,s);try{Sa(c,t,n)}catch(l){r.error??=l}},om=(e,t,r)=>{for(let{path:n,append:o}of t.filter(({type:i})=>Pt.has(i))){let i=typeof n=="string"?n:n.toString();o||r.has(i)?Qd(n,e):(r.add(i),Jd(n,e))}};a();var xa=([,e,t],r)=>{if(r.all)return e===void 0?t:t===void 0?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,V(t,r,"all")]:Array.isArray(t)?[V(e,r,"all"),...t]:T(e)&&T(t)?Qt([e,t]):`${e}${t}`};a();a();import{once as Hr}from"events";var Ea=async(e,t)=>{let[r,n]=await im(e);return t.isForcefullyTerminated??=!1,[r,n]},im=async e=>{let[t,r]=await Promise.allSettled([Hr(e,"spawn"),Hr(e,"exit")]);return t.status==="rejected"?[]:r.status==="rejected"?Ta(e):r.value},Ta=async e=>{try{return await Hr(e,"exit")}catch{return Ta(e)}},Oa=async e=>{let[t,r]=await e;if(!sm(t,r)&&Kr(t,r))throw new B;return[t,r]},sm=(e,t)=>e===void 0&&t===void 0,Kr=(e,t)=>e!==0||t!==null;var Aa=({error:e,status:t,signal:r,output:n},{maxBuffer:o})=>{let i=am(e,t,r),s=i?.code==="ETIMEDOUT",c=ws(i,n,o);return{resultError:i,exitCode:t,signal:r,timedOut:s,isMaxBuffer:c}},am=(e,t,r)=>e!==void 0?e:Kr(t,r)?new B:void 0;var Ia=(e,t,r)=>{let{file:n,commandArguments:o,command:i,escapedCommand:s,startTime:c,verboseInfo:l,options:d,fileDescriptors:p}=lm(e,t,r),m=pm({file:n,commandArguments:o,options:d,command:i,escapedCommand:s,verboseInfo:l,fileDescriptors:p,startTime:c});return be(m,l,d)},lm=(e,t,r)=>{let{command:n,escapedCommand:o,startTime:i,verboseInfo:s}=Ze(e,t,r),c=fm(r),{file:l,commandArguments:d,options:p}=St(e,t,c);um(p);let m=ra(p,s);return{file:l,commandArguments:d,command:n,escapedCommand:o,startTime:i,verboseInfo:s,options:p,fileDescriptors:m}},fm=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,um=({ipc:e,ipcInput:t,detached:r,cancelSignal:n})=>{t&&Nt("ipcInput"),e&&Nt("ipc: true"),r&&Nt("detached: true"),n&&Nt("cancelSignal")},Nt=e=>{throw new TypeError(`The "${e}" option cannot be used with synchronous methods.`)},pm=({file:e,commandArguments:t,options:r,command:n,escapedCommand:o,verboseInfo:i,fileDescriptors:s,startTime:c})=>{let l=dm({file:e,commandArguments:t,options:r,command:n,escapedCommand:o,fileDescriptors:s,startTime:c});if(l.failed)return l;let{resultError:d,exitCode:p,signal:m,timedOut:h,isMaxBuffer:g}=Aa(l,r),{output:y,error:b=d}=wa({fileDescriptors:s,syncResult:l,options:r,isMaxBuffer:g,verboseInfo:i}),E=y.map((O,A)=>V(O,r,A)),w=V(xa(y,r),r,"all");return hm({error:b,exitCode:p,signal:m,timedOut:h,isMaxBuffer:g,stdio:E,all:w,options:r,command:n,escapedCommand:o,startTime:c})},dm=({file:e,commandArguments:t,options:r,command:n,escapedCommand:o,fileDescriptors:i,startTime:s})=>{try{ga(i,r);let c=mm(r);return cm(...bt(e,t,c))}catch(c){return Se({error:c,command:n,escapedCommand:o,fileDescriptors:i,options:r,startTime:s,isSync:!0})}},mm=({encoding:e,maxBuffer:t,...r})=>({...r,encoding:"buffer",maxBuffer:Dt(t)}),hm=({error:e,exitCode:t,signal:r,timedOut:n,isMaxBuffer:o,stdio:i,all:s,options:c,command:l,escapedCommand:d,startTime:p})=>e===void 0?Rt({command:l,escapedCommand:d,stdio:i,all:s,ipcOutput:[],options:c,startTime:p}):Le({error:e,command:l,escapedCommand:d,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:o,isForcefullyTerminated:!1,exitCode:t,signal:r,stdio:i,all:s,ipcOutput:[],options:c,startTime:p,isSync:!0});a();import{setMaxListeners as rg}from"events";import{spawn as ng}from"child_process";a();import Pa from"process";a();import{once as Xr,on as gm}from"events";var Da=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},{reference:o=!0,filter:i}={})=>(de({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:pt(e)}),ym({anyProcess:e,channel:t,isSubprocess:r,filter:i,reference:o})),ym=async({anyProcess:e,channel:t,isSubprocess:r,filter:n,reference:o})=>{ct(t,o);let i=X(e,t,r),s=new AbortController;try{return await Promise.race([Sm(i,n,s),bm(i,r,s),wm(i,r,s)])}catch(c){throw me(e),c}finally{s.abort(),lt(t,o)}},Sm=async(e,t,{signal:r})=>{if(t===void 0){let[n]=await Xr(e,"message",{signal:r});return n}for await(let[n]of gm(e,"message",{signal:r}))if(t(n))return n},bm=async(e,t,{signal:r})=>{await Xr(e,"disconnect",{signal:r}),di(t)},wm=async(e,t,{signal:r})=>{let[n]=await Xr(e,"strict:error",{signal:r});throw it(n,t)};a();import{once as Ca,on as xm}from"events";var Ma=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},{reference:o=!0}={})=>Zr({anyProcess:e,channel:t,isSubprocess:r,ipc:n,shouldAwait:!r,reference:o}),Zr=({anyProcess:e,channel:t,isSubprocess:r,ipc:n,shouldAwait:o,reference:i})=>{de({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:pt(e)}),ct(t,i);let s=X(e,t,r),c=new AbortController,l={};return Em(e,s,c),Tm({ipcEmitter:s,isSubprocess:r,controller:c,state:l}),Om({anyProcess:e,channel:t,ipcEmitter:s,isSubprocess:r,shouldAwait:o,controller:c,state:l,reference:i})},Em=async(e,t,r)=>{try{await Ca(t,"disconnect",{signal:r.signal}),r.abort()}catch{}},Tm=async({ipcEmitter:e,isSubprocess:t,controller:r,state:n})=>{try{let[o]=await Ca(e,"strict:error",{signal:r.signal});n.error=it(o,t),r.abort()}catch{}},Om=async function*({anyProcess:e,channel:t,ipcEmitter:r,isSubprocess:n,shouldAwait:o,controller:i,state:s,reference:c}){try{for await(let[l]of xm(r,"message",{signal:i.signal}))Ra(s),yield l}catch{Ra(s)}finally{i.abort(),lt(t,c),n||me(e),o&&await e}},Ra=({error:e})=>{if(e)throw e};var Ba=(e,{ipc:t})=>{Object.assign(e,$a(e,!1,t))},La=()=>{let e=Pa,t=!0,r=Pa.channel!==void 0;return{...$a(e,t,r),getCancelSignal:ji.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})}},$a=(e,t,r)=>({sendMessage:gt.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getOneMessage:Da.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getEachMessage:Ma.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})});a();import{ChildProcess as Am}from"child_process";import{PassThrough as Im,Readable as Dm,Writable as Rm,Duplex as Cm}from"stream";var Fa=({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:o,startTime:i,verboseInfo:s})=>{kr(n);let c=new Am;Mm(c,n),Object.assign(c,{readable:Pm,writable:Bm,duplex:Lm});let l=Se({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:o,startTime:i,isSync:!1}),d=$m(l,s,o);return{subprocess:c,promise:d}},Mm=(e,t)=>{let r=Fe(),n=Fe(),o=Fe(),i=Array.from({length:t.length-3},Fe),s=Fe(),c=[r,n,o,...i];Object.assign(e,{stdin:r,stdout:n,stderr:o,all:s,stdio:c})},Fe=()=>{let e=new Im;return e.end(),e},Pm=()=>new Dm({read(){}}),Bm=()=>new Rm({write(){}}),Lm=()=>new Cm({read(){},write(){}}),$m=async(e,t,r)=>be(e,t,r);a();import{createReadStream as Ua,createWriteStream as va}from"fs";import{Buffer as Fm}from"buffer";import{Readable as Ue,Writable as Um,Duplex as vm}from"stream";var _a=(e,t)=>Bt(Nm,e,t,!1),ve=({type:e,optionName:t})=>{throw new TypeError(`The \`${t}\` option cannot be ${Z[e]}.`)},Na={fileNumber:ve,generator:qr,asyncGenerator:qr,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:r}}){let n=t||r;return{stream:vm.fromWeb(e,{objectMode:n})}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},Nm={input:{...Na,fileUrl:({value:e})=>({stream:Ua(e)}),filePath:({value:{file:e}})=>({stream:Ua(e)}),webStream:({value:e})=>({stream:Ue.fromWeb(e)}),iterable:({value:e})=>({stream:Ue.from(e)}),asyncIterable:({value:e})=>({stream:Ue.from(e)}),string:({value:e})=>({stream:Ue.from(e)}),uint8Array:({value:e})=>({stream:Ue.from(Fm.from(e))})},output:{...Na,fileUrl:({value:e})=>({stream:va(e)}),filePath:({value:{file:e,append:t}})=>({stream:va(e,t?{flags:"a"}:{})}),webStream:({value:e})=>({stream:Um.fromWeb(e)}),iterable:ve,asyncIterable:ve,string:ve,uint8Array:ve}};a();a();import{on as _m,once as ja}from"events";import{PassThrough as jm,getDefaultHighWaterMark as km}from"stream";import{finished as za}from"stream/promises";function ie(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(let o of e)Qr(o);let t=e.some(({readableObjectMode:o})=>o),r=Gm(e,t),n=new Jr({objectMode:t,writableHighWaterMark:r,readableHighWaterMark:r});for(let o of e)n.add(o);return n}var Gm=(e,t)=>{if(e.length===0)return km(t);let r=e.filter(({readableObjectMode:n})=>n===t).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},Jr=class extends jm{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#i=Symbol("unpipe");#o=new WeakMap;add(t){if(Qr(t),this.#t.has(t))return;this.#t.add(t),this.#n??=zm(this,this.#t,this.#i);let r=Ym({passThroughStream:this,stream:t,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#n,unpipeEvent:this.#i});this.#o.set(t,r),t.pipe(this,{end:!1})}async remove(t){if(Qr(t),!this.#t.has(t))return!1;let r=this.#o.get(t);return r===void 0?!1:(this.#o.delete(t),t.unpipe(this),await r,!0)}},zm=async(e,t,r)=>{_t(e,ka);let n=new AbortController;try{await Promise.race([Wm(e,n),Vm(e,t,r,n)])}finally{n.abort(),_t(e,-ka)}},Wm=async(e,{signal:t})=>{try{await za(e,{signal:t,cleanup:!0})}catch(r){throw Wa(e,r),r}},Vm=async(e,t,r,{signal:n})=>{for await(let[o]of _m(e,"unpipe",{signal:n}))t.has(o)&&o.emit(r)},Qr=e=>{if(typeof e?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},Ym=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,onFinished:i,unpipeEvent:s})=>{_t(e,Ga);let c=new AbortController;try{await Promise.race([qm(i,t,c),Hm({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:c}),Km({stream:t,streams:r,ended:n,aborted:o,unpipeEvent:s,controller:c})])}finally{c.abort(),_t(e,-Ga)}r.size>0&&r.size===n.size+o.size&&(n.size===0&&o.size>0?en(e):Xm(e))},qm=async(e,t,{signal:r})=>{try{await e,r.aborted||en(t)}catch(n){r.aborted||Wa(t,n)}},Hm=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:{signal:i}})=>{try{await za(t,{signal:i,cleanup:!0,readable:!0,writable:!1}),r.has(t)&&n.add(t)}catch(s){if(i.aborted||!r.has(t))return;Va(s)?o.add(t):Ya(e,s)}},Km=async({stream:e,streams:t,ended:r,aborted:n,unpipeEvent:o,controller:{signal:i}})=>{if(await ja(e,o,{signal:i}),!e.readable)return ja(i,"abort",{signal:i});t.delete(e),r.delete(e),n.delete(e)},Xm=e=>{e.writable&&e.end()},Wa=(e,t)=>{Va(t)?en(e):Ya(e,t)},Va=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",en=e=>{(e.readable||e.writable)&&e.destroy()},Ya=(e,t)=>{e.destroyed||(e.once("error",Zm),e.destroy(t))},Zm=()=>{},_t=(e,t)=>{let r=e.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&e.setMaxListeners(r+t)},ka=2,Ga=1;a();import{finished as qa}from"stream/promises";var xe=(e,t)=>{e.pipe(t),Jm(e,t),Qm(e,t)},Jm=async(e,t)=>{if(!(P(e)||P(t))){try{await qa(e,{cleanup:!0,readable:!0,writable:!1})}catch{}tn(t)}},tn=e=>{e.writable&&e.end()},Qm=async(e,t)=>{if(!(P(e)||P(t))){try{await qa(t,{cleanup:!0,readable:!1,writable:!0})}catch{}rn(e)}},rn=e=>{e.readable&&e.destroy()};var Ha=(e,t,r)=>{let n=new Map;for(let[o,{stdioItems:i,direction:s}]of Object.entries(t)){for(let{stream:c}of i.filter(({type:l})=>M.has(l)))eh(e,c,s,o);for(let{stream:c}of i.filter(({type:l})=>!M.has(l)))rh({subprocess:e,stream:c,direction:s,fdNumber:o,pipeGroups:n,controller:r})}for(let[o,i]of n.entries()){let s=i.length===1?i[0]:ie(i);xe(s,o)}},eh=(e,t,r,n)=>{r==="output"?xe(e.stdio[n],t):xe(t,e.stdio[n]);let o=th[n];o!==void 0&&(e[o]=t),e.stdio[n]=t},th=["stdin","stdout","stderr"],rh=({subprocess:e,stream:t,direction:r,fdNumber:n,pipeGroups:o,controller:i})=>{if(t===void 0)return;nh(t,i);let[s,c]=r==="output"?[t,e.stdio[n]]:[e.stdio[n],t],l=o.get(s)??[];o.set(s,[...l,c])},nh=(e,{signal:t})=>{P(e)&&te(e,oh,t)},oh=2;a();import{addAbortListener as ah}from"events";a();a();var se=[];se.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&se.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&se.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var jt=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",nn=Symbol.for("signal-exit emitter"),on=globalThis,ih=Object.defineProperty.bind(Object),sn=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(on[nn])return on[nn];ih(on,nn,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,r){this.listeners[t].push(r)}removeListener(t,r){let n=this.listeners[t],o=n.indexOf(r);o!==-1&&(o===0&&n.length===1?n.length=0:n.splice(o,1))}emit(t,r,n){if(this.emitted[t])return!1;this.emitted[t]=!0;let o=!1;for(let i of this.listeners[t])o=i(r,n)===!0||o;return t==="exit"&&(o=this.emit("afterExit",r,n)||o),o}},kt=class{},sh=e=>({onExit(t,r){return e.onExit(t,r)},load(){return e.load()},unload(){return e.unload()}}),an=class extends kt{onExit(){return()=>{}}load(){}unload(){}},cn=class extends kt{#t=ln.platform==="win32"?"SIGINT":"SIGHUP";#r=new sn;#e;#n;#i;#o={};#s=!1;constructor(t){super(),this.#e=t,this.#o={};for(let r of se)this.#o[r]=()=>{let n=this.#e.listeners(r),{count:o}=this.#r,i=t;if(typeof i.__signal_exit_emitter__=="object"&&typeof i.__signal_exit_emitter__.count=="number"&&(o+=i.__signal_exit_emitter__.count),n.length===o){this.unload();let s=this.#r.emit("exit",null,r),c=r==="SIGHUP"?this.#t:r;s||t.kill(t.pid,c)}};this.#i=t.reallyExit,this.#n=t.emit}onExit(t,r){if(!jt(this.#e))return()=>{};this.#s===!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.#s){this.#s=!0,this.#r.count+=1;for(let t of se)try{let r=this.#o[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.#s&&(this.#s=!1,se.forEach(t=>{let r=this.#o[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.#i,this.#r.count-=1)}#a(t){return jt(this.#e)?(this.#e.exitCode=t||0,this.#r.emit("exit",this.#e.exitCode,null),this.#i.call(this.#e,this.#e.exitCode)):0}#c(t,...r){let n=this.#n;if(t==="exit"&&jt(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let o=n.call(this.#e,t,...r);return this.#r.emit("exit",this.#e.exitCode,null),o}else return n.call(this.#e,t,...r)}},ln=globalThis.process,{onExit:Ka,load:YI,unload:qI}=sh(jt(ln)?new cn(ln):new an);var Xa=(e,{cleanup:t,detached:r},{signal:n})=>{if(!t||r)return;let o=Ka(()=>{e.kill()});ah(n,()=>{o()})};a();a();var Ja=({source:e,sourcePromise:t,boundOptions:r,createNested:n},...o)=>{let i=Xe(),{destination:s,destinationStream:c,destinationError:l,from:d,unpipeSignal:p}=ch(r,n,o),{sourceStream:m,sourceError:h}=fh(e,d),{options:g,fileDescriptors:y}=N.get(e);return{sourcePromise:t,sourceStream:m,sourceOptions:g,sourceError:h,destination:s,destinationStream:c,destinationError:l,unpipeSignal:p,fileDescriptors:y,startTime:i}},ch=(e,t,r)=>{try{let{destination:n,pipeOptions:{from:o,to:i,unpipeSignal:s}={}}=lh(e,t,...r),c=at(n,i);return{destination:n,destinationStream:c,from:o,unpipeSignal:s}}catch(n){return{destinationError:n}}},lh=(e,t,r,...n)=>{if(Array.isArray(r))return{destination:t(Za,e)(r,...n),pipeOptions:e};if(typeof r=="string"||r instanceof URL||Zt(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[o,i,s]=je(r,...n);return{destination:t(Za)(o,i,s),pipeOptions:s}}if(N.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}`)},Za=({options:e})=>({options:{...e,stdin:"pipe",piped:!0}}),fh=(e,t)=>{try{return{sourceStream:he(e,t)}}catch(r){return{sourceError:r}}};a();var ec=({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n,fileDescriptors:o,sourceOptions:i,startTime:s})=>{let c=uh({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n});if(c!==void 0)throw fn({error:c,fileDescriptors:o,sourceOptions:i,startTime:s})},uh=({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n})=>{if(t!==void 0&&n!==void 0)return n;if(n!==void 0)return rn(e),n;if(t!==void 0)return tn(r),t},fn=({error:e,fileDescriptors:t,sourceOptions:r,startTime:n})=>Se({error:e,command:Qa,escapedCommand:Qa,fileDescriptors:t,options:r,startTime:n,isSync:!1}),Qa="source.pipe(destination)";a();var tc=async e=>{let[{status:t,reason:r,value:n=r},{status:o,reason:i,value:s=i}]=await e;if(s.pipedFrom.includes(n)||s.pipedFrom.push(n),o==="rejected")throw s;if(t==="rejected")throw n;return s};a();import{finished as ph}from"stream/promises";var rc=(e,t,r)=>{let n=Gt.has(t)?mh(e,t):dh(e,t);return te(e,gh,r.signal),te(t,yh,r.signal),hh(t),n},dh=(e,t)=>{let r=ie([e]);return xe(r,t),Gt.set(t,r),r},mh=(e,t)=>{let r=Gt.get(t);return r.add(e),r},hh=async e=>{try{await ph(e,{cleanup:!0,readable:!1,writable:!0})}catch{}Gt.delete(e)},Gt=new WeakMap,gh=2,yh=1;a();import{aborted as Sh}from"util";var nc=(e,t)=>e===void 0?[]:[bh(e,t)],bh=async(e,{sourceStream:t,mergedStream:r,fileDescriptors:n,sourceOptions:o,startTime:i})=>{await Sh(e,t),await r.remove(t);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw fn({error:s,fileDescriptors:n,sourceOptions:o,startTime:i})};var zt=(e,...t)=>{if(x(t[0]))return zt.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:r,...n}=Ja(e,...t),o=wh({...n,destination:r});return o.pipe=zt.bind(void 0,{...e,source:r,sourcePromise:o,boundOptions:{}}),o},wh=async({sourcePromise:e,sourceStream:t,sourceOptions:r,sourceError:n,destination:o,destinationStream:i,destinationError:s,unpipeSignal:c,fileDescriptors:l,startTime:d})=>{let p=xh(e,o);ec({sourceStream:t,sourceError:n,destinationStream:i,destinationError:s,fileDescriptors:l,sourceOptions:r,startTime:d});let m=new AbortController;try{let h=rc(t,i,m);return await Promise.race([tc(p),...nc(c,{sourceStream:t,mergedStream:h,sourceOptions:r,fileDescriptors:l,startTime:d})])}finally{m.abort()}},xh=(e,t)=>Promise.allSettled([e,t]);a();a();a();import{setImmediate as Rh}from"timers/promises";a();import{on as Eh}from"events";import{getDefaultHighWaterMark as Th}from"stream";var Wt=({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:n,encoding:o,preserveNewlines:i})=>{let s=new AbortController;return Oh(t,s),ic({stream:e,controller:s,binary:r,shouldEncode:!e.readableObjectMode&&n,encoding:o,shouldSplit:!e.readableObjectMode,preserveNewlines:i})},Oh=async(e,t)=>{try{await e}catch{}finally{t.abort()}},un=({stream:e,onStreamEnd:t,lines:r,encoding:n,stripFinalNewline:o,allMixed:i})=>{let s=new AbortController;Ah(t,s,e);let c=e.readableObjectMode&&!i;return ic({stream:e,controller:s,binary:n==="buffer",shouldEncode:!c,encoding:n,shouldSplit:!c&&r,preserveNewlines:!o})},Ah=async(e,t,r)=>{try{await e}catch{r.destroy()}finally{t.abort()}},ic=({stream:e,controller:t,binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s})=>{let c=Eh(e,"data",{signal:t.signal,highWaterMark:oc,highWatermark:oc});return Ih({onStdoutChunk:c,controller:t,binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s})},pn=Th(!0),oc=pn,Ih=async function*({onStdoutChunk:e,controller:t,binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s}){let c=Dh({binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s});try{for await(let[l]of e)yield*oe(l,c,0)}catch(l){if(!t.signal.aborted)throw l}finally{yield*$e(c)}},Dh=({binary:e,shouldEncode:t,encoding:r,shouldSplit:n,preserveNewlines:o})=>[$t(e,r,!t),Lt(e,o,!n,{})].filter(Boolean);var sc=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,buffer:o,maxBuffer:i,lines:s,allMixed:c,stripFinalNewline:l,verboseInfo:d,streamInfo:p})=>{let m=Ch({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,allMixed:c,verboseInfo:d,streamInfo:p});if(!o){await Promise.all([Mh(e),m]);return}let h=Gr(l,r),g=un({stream:e,onStreamEnd:t,lines:s,encoding:n,stripFinalNewline:h,allMixed:c}),[y]=await Promise.all([Ph({stream:e,iterable:g,fdNumber:r,encoding:n,maxBuffer:i,lines:s}),m]);return y},Ch=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,allMixed:o,verboseInfo:i,streamInfo:{fileDescriptors:s}})=>{if(!vt({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:i,fdNumber:r}))return;let c=un({stream:e,onStreamEnd:t,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:o});await ya(c,e,r,i)},Mh=async e=>{await Rh(),e.readableFlowing===null&&e.resume()},Ph=async({stream:e,stream:{readableObjectMode:t},iterable:r,fdNumber:n,encoding:o,maxBuffer:i,lines:s})=>{try{return t||s?await Tt(r,{maxBuffer:i}):o==="buffer"?new Uint8Array(await Ot(r,{maxBuffer:i})):await It(r,{maxBuffer:i})}catch(c){return ac(ys({error:c,stream:e,readableObjectMode:t,lines:s,encoding:o,fdNumber:n}))}},dn=async e=>{try{return await e}catch(t){return ac(t)}},ac=({bufferedData:e})=>Ln(e)?new Uint8Array(e):e;a();import{finished as Bh}from"stream/promises";var Ne=async(e,t,r,{isSameDirection:n,stopOnExit:o=!1}={})=>{let i=Lh(e,r),s=new AbortController;try{await Promise.race([...o?[r.exitPromise]:[],Bh(e,{cleanup:!0,signal:s.signal})])}catch(c){i.stdinCleanedUp||Uh(c,t,r,n)}finally{s.abort()}},Lh=(e,{originalStreams:[t],subprocess:r})=>{let n={stdinCleanedUp:!1};return e===t&&$h(e,r,n),n},$h=(e,t,r)=>{let{_destroy:n}=e;e._destroy=(...o)=>{Fh(t,r),n.call(e,...o)}},Fh=({exitCode:e,signalCode:t},r)=>{(e!==null||t!==null)&&(r.stdinCleanedUp=!0)},Uh=(e,t,r,n)=>{if(!vh(e,t,r,n))throw e},vh=(e,t,r,n=!0)=>r.propagating?cc(e)||Vt(e):(r.propagating=!0,mn(r,t)===n?cc(e):Vt(e)),mn=({fileDescriptors:e},t)=>t!=="all"&&e[t].direction==="input",Vt=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",cc=e=>e?.code==="EPIPE";var lc=({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:i,verboseInfo:s,streamInfo:c})=>e.stdio.map((l,d)=>hn({stream:l,fdNumber:d,encoding:t,buffer:r[d],maxBuffer:n[d],lines:o[d],allMixed:!1,stripFinalNewline:i,verboseInfo:s,streamInfo:c})),hn=async({stream:e,fdNumber:t,encoding:r,buffer:n,maxBuffer:o,lines:i,allMixed:s,stripFinalNewline:c,verboseInfo:l,streamInfo:d})=>{if(!e)return;let p=Ne(e,t,d);if(mn(d,t)){await p;return}let[m]=await Promise.all([sc({stream:e,onStreamEnd:p,fdNumber:t,encoding:r,buffer:n,maxBuffer:o,lines:i,allMixed:s,stripFinalNewline:c,verboseInfo:l,streamInfo:d}),p]);return m};var fc=({stdout:e,stderr:t},{all:r})=>r&&(e||t)?ie([e,t].filter(Boolean)):void 0,uc=({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:i,verboseInfo:s,streamInfo:c})=>hn({...Nh(e,r),fdNumber:"all",encoding:t,maxBuffer:n[1]+n[2],lines:o[1]||o[2],allMixed:_h(e),stripFinalNewline:i,verboseInfo:s,streamInfo:c}),Nh=({stdout:e,stderr:t,all:r},[,n,o])=>{let i=n||o;return i?n?o?{stream:r,buffer:i}:{stream:e,buffer:i}:{stream:t,buffer:i}:{stream:r,buffer:i}},_h=({all:e,stdout:t,stderr:r})=>e&&t&&r&&t.readableObjectMode!==r.readableObjectMode;a();import{once as jh}from"events";a();a();var pc=e=>fe(e,"ipc"),dc=(e,t)=>{let r=Ke(e);U({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:t})};var mc=async({subprocess:e,buffer:t,maxBuffer:r,ipc:n,ipcOutput:o,verboseInfo:i})=>{if(!n)return o;let s=pc(i),c=z(t,"ipc"),l=z(r,"ipc");for await(let d of Zr({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))c&&(Ss(e,o,l),o.push(d)),s&&dc(d,i);return o},hc=async(e,t)=>(await Promise.allSettled([e]),t);var gc=async({subprocess:e,options:{encoding:t,buffer:r,maxBuffer:n,lines:o,timeoutDuration:i,cancelSignal:s,gracefulCancel:c,forceKillAfterDelay:l,stripFinalNewline:d,ipc:p,ipcInput:m},context:h,verboseInfo:g,fileDescriptors:y,originalStreams:b,onInternalError:E,controller:w})=>{let O=Ea(e,h),A={originalStreams:b,fileDescriptors:y,subprocess:e,exitPromise:O,propagating:!1},R=lc({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:d,verboseInfo:g,streamInfo:A}),k=uc({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:d,verboseInfo:g,streamInfo:A}),Y=[],Q=mc({subprocess:e,buffer:r,maxBuffer:n,ipc:p,ipcOutput:Y,verboseInfo:g}),ae=kh(b,e,A),q=Gh(y,A);try{return await Promise.race([Promise.all([{},Oa(O),Promise.all(R),k,Q,Xi(e,m),...ae,...q]),E,zh(e,w),...Vi(e,i,h,w),...pi({subprocess:e,cancelSignal:s,gracefulCancel:c,context:h,controller:w}),...zi({subprocess:e,cancelSignal:s,gracefulCancel:c,forceKillAfterDelay:l,context:h,controller:w})])}catch(Xt){return h.terminationReason??="other",Promise.all([{error:Xt},O,Promise.all(R.map(Te=>dn(Te))),dn(k),hc(Q,Y),Promise.allSettled(ae),Promise.allSettled(q)])}},kh=(e,t,r)=>e.map((n,o)=>n===t.stdio[o]?void 0:Ne(n,o,r)),Gh=(e,t)=>e.flatMap(({stdioItems:r},n)=>r.filter(({value:o,stream:i=o})=>$(i,{checkOpen:!1})&&!P(i)).map(({type:o,value:i,stream:s=i})=>Ne(s,n,t,{isSameDirection:M.has(o),stopOnExit:o==="native"}))),zh=async(e,{signal:t})=>{let[r]=await jh(e,"error",{signal:t});throw r};a();a();var yc=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),_e=(e,t,r)=>{let n=e[r];n.has(t)||n.set(t,[]);let o=n.get(t),i=v();return o.push(i),{resolve:i.resolve.bind(i),promises:o}},Ee=async({resolve:e,promises:t},r)=>{e();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...t])]);return!n};a();import{Readable as Wh}from"stream";import{callbackify as Vh}from"util";a();import{finished as Sc}from"stream/promises";var gn=async e=>{if(e!==void 0)try{await yn(e)}catch{}},bc=async e=>{if(e!==void 0)try{await Sn(e)}catch{}},yn=async e=>{await Sc(e,{cleanup:!0,readable:!1,writable:!0})},Sn=async e=>{await Sc(e,{cleanup:!0,readable:!0,writable:!1})},Yt=async(e,t)=>{if(await e,t)throw t},qt=(e,t,r)=>{r&&!Vt(r)?e.destroy(r):t&&e.destroy()};var wc=({subprocess:e,concurrentStreams:t,encoding:r},{from:n,binary:o=!0,preserveNewlines:i=!0}={})=>{let s=o||D.has(r),{subprocessStdout:c,waitReadableDestroy:l}=bn(e,n,t),{readableEncoding:d,readableObjectMode:p,readableHighWaterMark:m}=wn(c,s),{read:h,onStdoutDataDone:g}=xn({subprocessStdout:c,subprocess:e,binary:s,encoding:r,preserveNewlines:i}),y=new Wh({read:h,destroy:Vh(Tn.bind(void 0,{subprocessStdout:c,subprocess:e,waitReadableDestroy:l})),highWaterMark:m,objectMode:p,encoding:d});return En({subprocessStdout:c,onStdoutDataDone:g,readable:y,subprocess:e}),y},bn=(e,t,r)=>{let n=he(e,t),o=_e(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:o}},wn=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r},n)=>n?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:pn},xn=({subprocessStdout:e,subprocess:t,binary:r,encoding:n,preserveNewlines:o})=>{let i=v(),s=Wt({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:o});return{read(){Yh(this,s,i)},onStdoutDataDone:i}},Yh=async(e,t,r)=>{try{let{value:n,done:o}=await t.next();o?r.resolve():e.push(n)}catch{}},En=async({subprocessStdout:e,onStdoutDataDone:t,readable:r,subprocess:n,subprocessStdin:o})=>{try{await Sn(e),await n,await gn(o),await t,r.readable&&r.push(null)}catch(i){await gn(o),xc(r,i)}},Tn=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:r},n)=>{await Ee(r,t)&&(xc(e,n),await Yt(t,n))},xc=(e,t)=>{qt(e,e.readable,t)};a();import{Writable as qh}from"stream";import{callbackify as Ec}from"util";var Tc=({subprocess:e,concurrentStreams:t},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:o,waitWritableDestroy:i}=On(e,r,t),s=new qh({...An(n,e,o),destroy:Ec(Dn.bind(void 0,{subprocessStdin:n,subprocess:e,waitWritableFinal:o,waitWritableDestroy:i})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return In(n,s),s},On=(e,t,r)=>{let n=at(e,t),o=_e(r,n,"writableFinal"),i=_e(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:o,waitWritableDestroy:i}},An=(e,t,r)=>({write:Hh.bind(void 0,e),final:Ec(Kh.bind(void 0,e,t,r))}),Hh=(e,t,r,n)=>{e.write(t,r)?n():e.once("drain",n)},Kh=async(e,t,r)=>{await Ee(r,t)&&(e.writable&&e.end(),await t)},In=async(e,t,r)=>{try{await yn(e),t.writable&&t.end()}catch(n){await bc(r),Oc(t,n)}},Dn=async({subprocessStdin:e,subprocess:t,waitWritableFinal:r,waitWritableDestroy:n},o)=>{await Ee(r,t),await Ee(n,t)&&(Oc(e,o),await Yt(t,o))},Oc=(e,t)=>{qt(e,e.writable,t)};a();import{Duplex as Xh}from"stream";import{callbackify as Zh}from"util";var Ac=({subprocess:e,concurrentStreams:t,encoding:r},{from:n,to:o,binary:i=!0,preserveNewlines:s=!0}={})=>{let c=i||D.has(r),{subprocessStdout:l,waitReadableDestroy:d}=bn(e,n,t),{subprocessStdin:p,waitWritableFinal:m,waitWritableDestroy:h}=On(e,o,t),{readableEncoding:g,readableObjectMode:y,readableHighWaterMark:b}=wn(l,c),{read:E,onStdoutDataDone:w}=xn({subprocessStdout:l,subprocess:e,binary:c,encoding:r,preserveNewlines:s}),O=new Xh({read:E,...An(p,e,m),destroy:Zh(Jh.bind(void 0,{subprocessStdout:l,subprocessStdin:p,subprocess:e,waitReadableDestroy:d,waitWritableFinal:m,waitWritableDestroy:h})),readableHighWaterMark:b,writableHighWaterMark:p.writableHighWaterMark,readableObjectMode:y,writableObjectMode:p.writableObjectMode,encoding:g});return En({subprocessStdout:l,onStdoutDataDone:w,readable:O,subprocess:e,subprocessStdin:p}),In(p,O,l),O},Jh=async({subprocessStdout:e,subprocessStdin:t,subprocess:r,waitReadableDestroy:n,waitWritableFinal:o,waitWritableDestroy:i},s)=>{await Promise.all([Tn({subprocessStdout:e,subprocess:r,waitReadableDestroy:n},s),Dn({subprocessStdin:t,subprocess:r,waitWritableFinal:o,waitWritableDestroy:i},s)])};a();var Rn=(e,t,{from:r,binary:n=!1,preserveNewlines:o=!1}={})=>{let i=n||D.has(t),s=he(e,r),c=Wt({subprocessStdout:s,subprocess:e,binary:i,shouldEncode:!0,encoding:t,preserveNewlines:o});return Qh(c,s,e)},Qh=async function*(e,t,r){try{yield*e}finally{t.readable&&t.destroy(),await r}};var Ic=(e,{encoding:t})=>{let r=yc();e.readable=wc.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.writable=Tc.bind(void 0,{subprocess:e,concurrentStreams:r}),e.duplex=Ac.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.iterable=Rn.bind(void 0,e,t),e[Symbol.asyncIterator]=Rn.bind(void 0,e,t,{})};a();var Dc=(e,t)=>{for(let[r,n]of tg){let o=n.value.bind(t);Reflect.defineProperty(e,r,{...n,value:o})}},eg=(async()=>{})().constructor.prototype,tg=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(eg,e)]);var Rc=(e,t,r,n)=>{let{file:o,commandArguments:i,command:s,escapedCommand:c,startTime:l,verboseInfo:d,options:p,fileDescriptors:m}=og(e,t,r),{subprocess:h,promise:g}=sg({file:o,commandArguments:i,options:p,startTime:l,verboseInfo:d,command:s,escapedCommand:c,fileDescriptors:m});return h.pipe=zt.bind(void 0,{source:h,sourcePromise:g,boundOptions:{},createNested:n}),Dc(h,g),N.set(h,{options:p,fileDescriptors:m}),h},og=(e,t,r)=>{let{command:n,escapedCommand:o,startTime:i,verboseInfo:s}=Ze(e,t,r),{file:c,commandArguments:l,options:d}=St(e,t,r),p=ig(d),m=_a(p,s);return{file:c,commandArguments:l,command:n,escapedCommand:o,startTime:i,verboseInfo:s,options:p,fileDescriptors:m}},ig=({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}},sg=({file:e,commandArguments:t,options:r,startTime:n,verboseInfo:o,command:i,escapedCommand:s,fileDescriptors:c})=>{let l;try{l=ng(...bt(e,t,r))}catch(y){return Fa({error:y,command:i,escapedCommand:s,fileDescriptors:c,options:r,startTime:n,verboseInfo:o})}let d=new AbortController;rg(Number.POSITIVE_INFINITY,d.signal);let p=[...l.stdio];Ha(l,c,d),Xa(l,r,d);let m={},h=v();l.kill=fi.bind(void 0,{kill:l.kill.bind(l),options:r,onInternalError:h,context:m,controller:d}),l.all=fc(l,r),Ic(l,r),Ba(l,r);let g=ag({subprocess:l,options:r,startTime:n,verboseInfo:o,fileDescriptors:c,originalStreams:p,command:i,escapedCommand:s,context:m,onInternalError:h,controller:d});return{subprocess:l,promise:g}},ag=async({subprocess:e,options:t,startTime:r,verboseInfo:n,fileDescriptors:o,originalStreams:i,command:s,escapedCommand:c,context:l,onInternalError:d,controller:p})=>{let[m,[h,g],y,b,E]=await gc({subprocess:e,options:t,context:l,verboseInfo:n,fileDescriptors:o,originalStreams:i,onInternalError:d,controller:p});p.abort(),d.resolve();let w=y.map((R,k)=>V(R,t,k)),O=V(b,t,"all"),A=cg({errorInfo:m,exitCode:h,signal:g,stdio:w,all:O,ipcOutput:E,context:l,options:t,command:s,escapedCommand:c,startTime:r});return be(A,n,t)},cg=({errorInfo:e,exitCode:t,signal:r,stdio:n,all:o,ipcOutput:i,context:s,options:c,command:l,escapedCommand:d,startTime:p})=>"error"in e?Le({error:e.error,command:l,escapedCommand:d,timedOut:s.terminationReason==="timeout",isCanceled:s.terminationReason==="cancel"||s.terminationReason==="gracefulCancel",isGracefullyCanceled:s.terminationReason==="gracefulCancel",isMaxBuffer:e.error instanceof _,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:t,signal:r,stdio:n,all:o,ipcOutput:i,options:c,startTime:p,isSync:!1}):Rt({command:l,escapedCommand:d,stdio:n,all:o,ipcOutput:i,options:c,startTime:p});a();var Ht=(e,t)=>{let r=Object.fromEntries(Object.entries(t).map(([n,o])=>[n,lg(n,e[n],o)]));return{...e,...r}},lg=(e,t,r)=>fg.has(e)&&x(t)&&x(r)?{...t,...r}:r,fg=new Set(["env",...nr]);var J=(e,t,r,n)=>{let o=(s,c,l)=>J(s,c,r,l),i=(...s)=>ug({mapArguments:e,deepOptions:r,boundOptions:t,setBoundExeca:n,createNested:o},...s);return n!==void 0&&n(i,o,t),i},ug=({mapArguments:e,deepOptions:t={},boundOptions:r={},setBoundExeca:n,createNested:o},i,...s)=>{if(x(i))return o(e,Ht(r,i),n);let{file:c,commandArguments:l,options:d,isSync:p}=pg({mapArguments:e,firstArgument:i,nextArguments:s,deepOptions:t,boundOptions:r});return p?Ia(c,l,d):Rc(c,l,d,o)},pg=({mapArguments:e,firstArgument:t,nextArguments:r,deepOptions:n,boundOptions:o})=>{let i=_n(t)?jn(t,r):[t,...r],[s,c,l]=je(...i),d=Ht(Ht(n,o),l),{file:p=s,commandArguments:m=c,options:h=d,isSync:g=!1}=e({file:s,commandArguments:c,options:d});return{file:p,commandArguments:m,options:h,isSync:g}};a();var Cc=({file:e,commandArguments:t})=>Pc(e,t),Mc=({file:e,commandArguments:t})=>({...Pc(e,t),isSync:!0}),Pc=(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]=dg(e);return{file:r,commandArguments:n}},dg=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(mg)){let o=r.at(-1);o&&o.endsWith("\\")?r[r.length-1]=`${o.slice(0,-1)} ${n}`:r.push(n)}return r},mg=/ +/g;a();var Bc=(e,t,r)=>{e.sync=t(hg,r),e.s=e.sync},Lc=({options:e})=>$c(e),hg=({options:e})=>({...$c(e),isSync:!0}),$c=e=>({options:{...gg(e),...e}}),gg=({input:e,inputFile:t,stdio:r})=>e===void 0&&t===void 0&&r===void 0?{stdin:"inherit"}:{},Fc={preferLocal:!0};var Cn=J(()=>({})),uM=J(()=>({isSync:!0})),pM=J(Cc),dM=J(Mc),mM=J(qi),hM=J(Lc,{},Fc,Bc),{sendMessage:gM,getOneMessage:yM,getEachMessage:SM,getCancelSignal:bM}=La();import"semantic-release";a();var Kt;async function yg(e,t){await Mn("regctl",["image","copy",e,t])}async function Mn(e,t){try{await Cn(e,t)}catch(r){throw typeof r=="object"&&r!==null&&"command"in r&&"message"in r?new Error(`Unable to run "${r.command}": ${r.message}`):new Error(`Unable to run "${t.join(" ")}": ${r}`)}}function Uc(e){let t=e.split("@")[0].split(":");return t[1]&&t[1].includes("/")&&(t=[t[0]+":"+t[1],t[2]]),t[0]}function Sg(e){if(!e)return{major:null,minor:null};let t=e.split(".",2);return{major:t[0],minor:t[1]}}function bg(e,t){let r=[];if(!t.nextRelease)return[];let n=t.nextRelease.version;return e.images.forEach(o=>{let i=Uc(o);if(e.tag.version&&n&&r.push({input:o,output:`${i}:${n}`}),!xg(t)){let{major:c,minor:l}=Sg(n);e.tag.latest&&r.push({input:o,output:`${i}:latest`}),e.tag.major&&c&&r.push({input:o,output:`${i}:${c}`}),e.tag.minor&&c&&l&&r.push({input:o,output:`${i}:${c}.${l}`})}let s=t.nextRelease?.channel;e.tag.channel&&s&&r.push({input:o,output:`${i}:${s}`})}),r}function wg(e){let t=Uc(e).split("/");if(t[0]==="ghcr.io"&&t.length===3)return`https://github.com/${t[1]}/${t[2]}/pkgs/container/${t[2]}`;if(t[0]==="registry.gitlab.com"&&t.length>=3)return`https://gitlab.com/${t[1]}/${t[2]}/container_registry`;let r=t[0].includes(".");if(!r&&t.length===2)return`https://hub.docker.com/r/${t[0]}/${t[1]}/tags`;if(!r&&t.length===1)return`https://hub.docker.com/_/${t[0]}/tags`}function xg(e){return!!(e.nextRelease&&e.nextRelease.version.includes("-"))}async function Eg(){if(Kt!==void 0)return Kt;try{return await Cn("which",["regctl"]),Kt=!0,!0}catch{return Kt=!1,!1}}function Tg(e){let t={images:[],tag:{channel:!0,latest:!0,major:!0,minor:!0,version:!0}};if(typeof e.images=="string")t.images.push(e.images);else if(Array.isArray(e.images))e.images.filter(n=>typeof n=="string").forEach(n=>t.images.push(n));else throw new Error("Configuration invalid: No image defined!");return Object.keys(t.tag).forEach(n=>{let o=e.tag?e.tag[n]:void 0;(o===!0||o===!1)&&(t.tag[n]=o)}),t}async function Og(e,t){if(!t.nextRelease)return t.logger.log("No release schedules, so no images to tag."),!1;let r=Tg(e),n=bg(r,t);if(!n.length)return!1;for(let s of n){if(await Eg()){t.logger.log(`Copy with regctl ${s.input} \u2192 ${s.output}`);try{await yg(s.input,s.output);continue}catch(c){t.logger.error(c),t.logger.log("Retry without regctl\u2026")}}t.logger.log(`Tag ${s.input} \u2192 ${s.output}`),await Ig(s.input,s.output),t.logger.log(`Push ${s.output}`),await Ag(s.output)}let o=t.nextRelease?.channel,i=n[0];return{channel:o,name:`Docker container (${i.output})`,url:wg(i.output)}}async function Ag(e){await Mn("docker",["push",e])}async function Ig(e,t){await Mn("docker",["tag",e,t])}var IM={publish:Og};export{yg as copyImage,IM as default,Mn as exec,Uc as getBaseImage,Sg as getMajorAndMinorPart,bg as getTagTasks,wg as getUrlFromImage,xg as isPreRelease,Eg as isRegCtlAvailable,Tg as parseConfig,Og as publish,Ag as pushImage,Ig as tagImage};
45
45
  //# sourceMappingURL=index.js.map