@sebbo2002/semantic-release-docker 5.0.3-develop.2 → 5.0.3-develop.4

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