lete,t,r,n,i,o,s,a;functionl(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0});}functionc(e){returne&&e.__esModule?e.default:e;}functionu(e,t,r){if("function"==typeoft&&(r=t,t={}),!r){if("function"!=typeofPromise)throwTypeError("callback not provided");returnnewPromise(function(r,n){u(e,t||{},function(e,t){e?n(e):r(t);});});}rz(e,t||{},function(e,n){e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,n=!1),r(e,n);});}functionp(e,t){letr;letn=e.options.env||process.env,i=process.cwd(),o=null!=e.options.cwd,s=o&&void0!==process.chdir&&!process.chdir.disabled;if(s)try{process.chdir(e.options.cwd);}catch(e){}try{r=rH.sync(e.command,{path:n[rV({env:n})],pathExt:t?iV.delimiter:void0});}catch(e){}finally{s&&process.chdir(i);}returnr&&(r=iV.resolve(o?e.options.cwd:"",r)),r;}functionf(e,t){returnObject.assign(Error(`${t}${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t}${e.command}`,path:e.command,spawnargs:e.args});}functiond(e,t){returni4&&1===e&&!t.file?f(t.original,"spawn"):null;}functionh(e,t,r){letn=rG(e,t,r),i=rg.spawn(n.command,n.args,n.options);returnrZ.hookChildProcess(i,n),i;}functionm(e={}){let{env:t=process.env,platform:r=process.platform}=e;return"win32"!==r?"PATH":Object.keys(t).reverse().find(e=>"PATH"===e.toUpperCase())||"Path";}functionv(e){returnnull!==e&&"object"==typeofe&&"function"==typeofe.pipe;}functiong(e){returnv(e)&&!1!==e.writable&&"function"==typeofe._write&&"object"==typeofe._writableState;}asyncfunctiony(e,t){if(!e)throwError("Expected a stream");let{maxBuffer:r}=t={maxBuffer:1/0,...t},n=r6(t);returnawaitnewPromise((t,i)=>{leto=e=>{e&&n.getBufferedLength()<=r3.MAX_LENGTH&&(e.bufferedData=n.getBufferedValue()),i(e);};(async()=>{try{awaitoJ(e,n),t();}catch(e){o(e);}})(),n.on("data",()=>{n.getBufferedLength()>r&&o(newoZ());});}),n.getBufferedValue();}functionE(e,t,r){letn;leti=sv(e,t,r),o=si(e,t),s=so(e,t);sh(s,i.options),oV(i.options);try{n=c(rb).spawn(i.file,i.args,i.options);}catch(t){lete=new(c(rb).ChildProcess)();returnse(e,Promise.reject(oE({error:t,stdout:"",stderr:"",all:"",command:o,escapedCommand:s,parsed:i,timedOut:!1,isCanceled:!1,killed:!1}))),e;}leta=st(n),l=oz(n,i.options,a),u=oX(n,i.options,l),p={isCanceled:!1};n.kill=oF.bind(null,n.kill.bind(n)),n.cancel=oH.bind(null,n,p);letf=rQ(async()=>{let[{error:e,exitCode:t,signal:r,timedOut:a},l,c,f]=awaito5(n,i.options,u),d=sg(i.options,l),h=sg(i.options,c),m=sg(i.options,f);if(e||0!==t||null!==r){letl=oE({error:e,exitCode:t,signal:r,stdout:d,stderr:h,all:m,command:o,escapedCommand:s,parsed:i,timedOut:a,isCanceled:p.isCanceled||!!i.options.signal&&i.options.signal.aborted,killed:n.killed});if(!i.options.reject)returnl;throwl;}return{command:o,escapedCommand:s,exitCode:0,stdout:d,stderr:h,all:m,failed:!1,timedOut:!1,isCanceled:!1,killed:!1};});returno3(n,i.options),n.all=o4(n,i.options),oK(n),se(n,f),n;}functionw(e,t,r){letn;leti=sv(e,t,r),o=si(e,t),s=so(e,t);sh(s,i.options);leta=o1(i.options);try{n=c(rb).spawnSync(i.file,i.args,{...i.options,input:a});}catch(e){throwoE({error:e,stdout:"",stderr:"",all:"",command:o,escapedCommand:s,parsed:i,timedOut:!1,isCanceled:!1,killed:!1});}letl=sg(i.options,n.stdout,n.error),u=sg(i.options,n.stderr,n.error);if(n.error||0!==n.status||null!==n.signal){lete=oE({stdout:l,stderr:u,error:n.error,signal:n.signal,exitCode:n.status,command:o,escapedCommand:s,parsed:i,timedOut:n.error&&"ETIMEDOUT"===n.error.code,isCanceled:!1,killed:null!==n.signal});if(!i.options.reject)returne;throwe;}return{command:o,escapedCommand:s,exitCode:0,stdout:l,stderr:u,failed:!1,timedOut:!1,isCanceled:!1,killed:!1};}function_(t,r=["-NoProfile","-NoLogo","-NonInteractive"],n={stdio:"inherit"}){returnE(function(){if(void0===e){lett=c(r7).sync("pwsh",{nothrow:!0});null!==t&&(e=t);letr=c(r7).sync("powershell",{nothrow:!0});null!==r&&(e=r);}if(void0===e)throwError("Could not find powershell");returne;}(),[...r,"-c",t],n);}functionb(){vare,t;return((null===(e=(t=process).getuid)||void0===e?void0:e.call(t))===0||!!process.en
`;try{await Promise.all([N(e),A(t,T("~/.bashrc")),A(t,T("~/.profile"))]);}catch(e){(0,rF.warning)(`Failedtoadd${t}to.profileor.bashrc.Youshouldadditmanually:${e}`);}}async function N(e){let t=void 0===e.guard?"\n# Automatically Generated by envosman\n":`
apt-getupdate-o${sZ}-y`),a=r,c=1===o?s.replace(/ -y \$PKG/g," -y clang-format-"+a):s,l=c=await tz(c),c=V()?l.replace(/apt-get/g,"nala"):l,await(0,nt.writeFile)(t,c),[{name:"lsb-release"},{name:"wget"},{name:"software-properties-common"},{name:"gnupg"}];}async function tz(e){let t=e.replace(/apt-get install -y/g,`apt-getinstall-oDpkg::Options::="--force-overwrite"-o${sZ}-y--fix-broken`);return await Promise.all(["libc++-$LLVM_VERSION-dev","libc++abi-$LLVM_VERSION-dev","libunwind-$LLVM_VERSION-dev"].map(async e=>{let r=e.replace("$LLVM_VERSION","*");(await Y(r))&&((0,rA.info)("Removing conflicting package "+r),t=t.replace(e,""));})),t;}function tV(e,t,r){let n=`${t}${e}${r}`;return`https://github.com/llvm/llvm-project/releases/download/llvmorg-${e}/${n}`;}function tX(e,t,r){let n=`${t}${e}${r}`;return`https://releases.llvm.org/${e}/${n}`;}async function tW(e){let t;if(a1.has(e))return null;let r="LLVM-",n=c(ih)(e,"3.7.0")?"-win32.exe":"-win64.exe",i=c(ih)(e,"9.0.1"),o=!1;return i&&(t=tX(e,r,n),(await i$(t))||(o=!0)),(o||!i)&&(t=tV(e,r,n)),t;}function tY(e,t){switch(e){case"darwin":return function(e){if(a2.has(e))return null;let t="9.0.0"===e?"-darwin-apple":"-apple-darwin",r="clang+llvm-",n=`-x86_64${t}.tar.xz`;return c(ih)(e,"9.0.1")?tX(e,r,n):tV(e,r,n);}(t);case"linux":return function(e){let t,r,n=e,i=a3.get(n);if(void 0!==i&&(n=i),n.includes("ubuntu")){let e=n.replace(/-ubuntu-.*/,"");if(!a0.has(e))throw Error("Unsupported Ubuntu version: "+e);t=n.replace(e,""),n=eW(a0,e)[0];}else""!==n&&n in a4?t=a4[n]:(t=a4[a6],(0,rF.warning)(`Falling back to LLVM version ${a6} ${t} for the Ubuntu.`));let o="clang+llvm-";return(r="5.0.0"===n?`-linux-x86_64${t}.tar.xz`:t.includes("-rhel86")?`-x86_64-unknown-linux-gnu${t}.tar.xz`:`-x86_64-linux-gnu${t}.tar.xz`,c(ih)(n,"9.0.1"))?tX(n,o,r):tV(n,o,r);}(t);case"win32":return tW(t);default:return null;}}async function tK(e,t,r){let[n,i]=await eY(a0,t,e,tY);return(0,rF.info)("specific llvm version: "+n),{url:i,extractedFolderName:"",binRelativeDir:"bin",binFileName:(0,ip.addExeExt)("clang"),extractFunction:"win32"===t?ej:(e,t)=>eU(e,t,1)};}async function tJ(e,t,r){var n;let i=await a8(e,t,r);return await t2(null!==(n=i.installDir)&&void 0!==n?n:t),i;}async function tZ(e,t,r){let[n,i]=await Promise.all([tQ(e,t,r),t3()]);return await a9(r),n;}async function tQ(e,t,r,n=iB.All){let i=Number.parseInt(function(e){if(null===c(iL)(e))try{let t=c(id)(e);if(null!==t)return(0,rF.info)(`Coerced version '${e}' to '${t}'`),t.version;}catch(e){}return e;}(e).split(".")[0],10);try{if(em())return await tH(i,n);}catch(e){(0,rF.info)("Failed to install llvm via system package manager "+e);}let o=await eG("llvm",e,tK,t,r);return await a5(i),o;}async function t0(e){em()&&(e<=10?await en([{name:"libtinfo5"}]):await en([{name:"libtinfo-dev"}]));}async function t1(e){"linux"===process.platform&&(await tR(tr("gcc",void 0,await aD()),"",e,40));}async function t2(e){var t,r;let n=null!==(t=process.env.LD_LIBRARY_PATH)&&void 0!==t?t:"",i=null!==(r=process.env.DYLD_LIBRARY_PATH)&&void 0!==r?r:"",o=[C("LLVM_PATH",e,ln),C("LD_LIBRARY_PATH",`${e}/lib${iV.delimiter}${n}`,ln),C("DYLD_LIBRARY_PATH",`${e}/lib${iV.delimiter}${i}`,ln),C("LDFLAGS",`-L"${e}/lib"`,ln),C("CPPFLAGS",`-I"${e}/include"`,ln),C("CC",(0,ip.addExeExt)(`${e}/bin/clang`),ln),C("CXX",(0,ip.addExeExt)(`${e}/bin/clang++`),ln),C("LIBRARY_PATH",`${e}/lib`,ln),tS()];em()&&o.push(q("cc",`${e}/bin/clang`,ln,60),q("cxx",`${e}/bin/clang++`,ln,60),q("clang",`${e}/bin/clang`,ln),q("clang++",`${e}/bin/clang++`,ln),q("lld",`${e}/bin/lld`,ln),q("ld.lld",`${e}/bin/ld.lld`,ln),q("llvm-ar",`${e}/bin/llvm-ar`,ln)),await Promise.all(o);}async function t3(){if(rj.GITHUB_ACTIONS){let e=(0,ip.join)(iH,"llvm_matcher.json");if(!(await(0,nF.pathExists)(e)))return(0,rF.warning)("the llvm_matcher.json file does not exist in the same folder as setup-cpp.js");(0,rF.info)("::add-matcher::"+e);}}async function t4(e,t,r){switch(process.platform){case"win32":return eg("make",e);case"darwin":return await ef("make",e),await k("/usr/local/opt/make/libexec/gnubin",ln),{binDir:"/usr/l
`),console.table({"compiler and analyzer":{tools:"--llvm, --gcc, --msvc, --vcvarsall, --cppcheck, --clangtidy, --clangformat"},"build system":{tools:"--cmake, --ninja, --meson, --make, --task, --bazel"},"package manager":{tools:"--vcpkg, --conan, --choco, --brew, --nala"},cache:{tools:"--ccache, --sccache"},documentation:{tools:"--doxygen, --graphviz"},coverage:{tools:"--gcovr, --opencppcoverage, --kcov"},other:{tools:"--python, --powershell, --sevenzip"}},["tools"]));let l=null!==(t=a.architecture)&&void 0!==t?t:process.arch,u=null!==(r=process.env.SETUP_CPP_DIR)&&void 0!==r?r:T("~"),p=[],f=[],d=nH.create({autoloadLocales:!0});nH.addLocale(c(nq)),nG.addLocale(c(nB));let h=await aD();if(!function(e,t){let r=t.filter(t=>void 0!==e[t]),n=r.filter(t=>!tn(e[t])),i=n.length>=1?e[n[0]]:"true";if(n.some(t=>e[t]!==i))return!1;for(let t of r)e[t]=i;return!0;}(a,["llvm","clangtidy","clangformat"]))return(0,rF.error)("The same version must be used for llvm, clangformat and clangtidy"),1;eh()&&"string"==typeof a.cppcheck&&"string"==typeof a.gcovr&&((0,rF.info)("installing python-pygments to avoid conflicts with cppcheck and gcovr on Arch linux"),await e_("python-pygments"));let m=!1,v=!1;for(let e of lt){if(rj.isCI&&0!==f.length){v=!0;break;}let t=a[e];void 0!==t&&(i=Date.now(),m=await tG(e,t,h,l,u,p,f,6e4*Number.parseFloat(null!==(n=a.timeout)&&void 0!==n?n:"20")),o=Date.now(),(0,rF.info)("took "+(d.format(i,o)||"0 seconds")));}if(!v){let e=a.compiler;if(void 0!==e){let t=Date.now();await ra(e,h,u,l,p,m,f);let r=Date.now();(0,rF.info)("took "+(d.format(t,r)||"0 seconds"));}}if(await $(ln),0===p.length&&0===f.length)return(0,rF.warning)("setup-cpp was called without any arguments. Nothing to do."),0;for(let e of p)(0,rF.success)(e);for(let e of f)(0,rF.error)(e);if((0,rF.info)("setup-cpp finished"),!rj.GITHUB_ACTIONS)switch(process.platform){case"win32":(0,rF.warning)("Run `RefreshEnv.cmd` or restart your shell to update the environment.");break;case"linux":case"darwin":(0,rF.warning)("Run `source~/.cpprc`orrestartyourshelltoupdatetheenvironment.");}returnawaits,0===f.length?0:1;}varrc,ru,rp,rf,rd,rh,rm,rv,rg,ry,rE,rw,r_,rb,rx,rS,rO,rR,rI,rT,rP,rN,rA,r$,rC,rL,rk,rD,rj,rF,rU,rM,rG,rB,rH,rq,rz,rV,rX,rW,rY,rK,rJ,rZ,rQ,r0,r1,r2,r3,r4,r6,r8,r5,r9,r7,ne,nt,nr,nn,ni,no,ns,na,nl,nc,nu,np,nf,nd,nh,nm,nv,ng,ny,nE,nw,n_,nb,nx,nS,nO,nR,nI,nT,nP,nN,nA,n$,nC,nL,nk,nD,nj,nF,nU,nM,nG,nB,nH,nq,nz,nV,nX,nW,nY,nK,nJ,nZ,nQ,n0,n1,n2,n3,n4,n6,n8,n5,n9,n7,ie,it,ir,ii,io,is,ia,il,ic,iu,ip,id,ih,im,iv,ig,iy,iE,iw,i_,ib,ix,iS,iO,iR,iI,iT,iP,iN,iA,i$,iC,iL,ik,iD,ij,iF,iU,iM,iG,iB,iH,iq,iz=require("os"),iV=require("path"),iX=require("fs"),iW=require("crypto"),iY=require("http"),iK=require("https");require("net"),rf=require("tls"),rd=require("events"),rh=require("assert"),rm=require("util"),rv=require("fs"),rg=require("child_process"),ry=require("string_decoder"),rE=require("timers"),rw=require("buffer"),r_=require("path"),rb=require("child_process"),rx=require("process"),rS=require("url"),rO=require("os"),rR=require("buffer"),rI=require("stream"),rT=require("util"),rP=require("process"),rN=require("url"),rA=require("console"),rC={},rL={},null==(rk=(r$=globalThis).parcelRequire810d)&&((rk=function(e){if(einrC)returnrC[e].exports;if(einrL){vart=rL[e];deleterL[e];varr={id:e,exports:{}};returnrC[e]=r,t.call(r.exports,r,r.exports),r.exports;}varn=Error("Cannotfindmodule'"+e+"'");thrown.code="MODULE_NOT_FOUND",n;}).register=function(e,t){rL[e]=t;},r$.parcelRequire810d=rk),(rD=rk.register)("dKklS",function(e,t){varr;functionn(e){return"string"==typeofe?!!i[e]:"env"ine?i[e.env]&&i[e.env].includes(e.includes):"any"ine?e.any.some(function(e){return!!i[e];}):Object.keys(e).every(function(t){returni[t]===e[t];});}r=rk("ksAXT");leti=process.env;Object.defineProperty(e.exports,"_vendors",{value:r.map(function(e){returne.constant;})}),e.exports.name=null,e.exports.isPR=null,r.forEach(function(t){letr=(Array.isArray(t.env)?t.env:[t.env]).every(function(e){returnn(e);});if(e.exports[t.constant]=r,r)switch(e.exports.name=t.name,typeoft.pr){
${t}`,on=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),oi=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),oo=(e,t,r)=>{let n=""===r?"":`with${r.trim()}()`,i=or.bind(null,n,t.toString());Object.defineProperty(i,"name",oi),Object.defineProperty(e,"toString",{...on,value:i});},os=new WeakMap(),oa=(e,t={})=>{let r;if("function"!=typeof e)throw TypeError("Expected a function");let n=0,i=e.displayName||e.name||"<anonymous>",o=function(...s){if(os.set(o,++n),1===n)r=e.apply(this,s),e=null;else if(!0===t.throw)throw Error(`Function\`${i}\` can only be called once`);returnr;};return!function(e,t,{ignoreNonConfigurable:r=!1}={}){let{name:n}=e;for(letnofReflect.ownKeys(t))i7(e,t,n,r);ot(e,t),oo(e,t,n);}(o,e),os.set(o,n),o;};oa.callCount=e=>{if(!os.has(e))throwError(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);returnos.get(e);},rQ=oa;constol=()=>Array.from({length:op-ou+1},oc),oc=(e,t)=>({name:"SIGRT"+(t+1),number:ou+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),ou=34,op=64,of=[{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:"t
${n.message}`:v,E=[y,t,e].filter(Boolean).join("\n");return g?(n.originalMessage=n.message,n.message=E):n=Error(E),n.shortMessage=y,n.command=s,n.escapedCommand=a,n.exitCode=o,n.signal=i,n.signalDescription=h,n.stdout=e,n.stderr=t,n.cwd=d,void 0!==r&&(n.all=r),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!l,n.isCanceled=u,n.killed=p&&!l,n;},ow=["stdin","stdout","stderr"],o_=e=>ow.some(t=>void 0!==e[t]),ob=e=>{if(!e)return;let{stdio:t}=e;if(void 0===t)return ow.map(t=>e[t]);if(o_(e))throw Error("It's not possible to provide `stdio` in combination with one of "+ow.map(e=>`\`${e}\``).join(", "));if("string"==typeoft)returnt;if(!Array.isArray(t))throwTypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeoft}\``);returnArray.from({length:Math.max(t.length,ow.length)},(e,r)=>t[r]);};r0={};constox=function(e){returne&&"object"==typeofe&&"function"==typeofe.removeListener&&"function"==typeofe.emit&&"function"==typeofe.reallyExit&&"function"==typeofe.listeners&&"function"==typeofe.kill&&"number"==typeofe.pid&&"function"==typeofe.on;};if(ox(r1=r$.process)){varoS,oO=rh,oR=rk("bJALw"),oI=/^win/i.test(r1.platform),oT=rd;"function"!=typeofoT&&(oT=oT.EventEmitter),r1.__signal_exit_emitter__?oS=r1.__signal_exit_emitter__:((oS=r1.__signal_exit_emitter__=newoT()).count=0,oS.emitted={}),oS.infinite||(oS.setMaxListeners(1/0),oS.infinite=!0);varoP=function(){o$&&ox(r$.process)&&(o$=!1,oR.forEach(function(e){try{r1.removeListener(e,oA[e]);}catch(e){}}),r1.emit=oD,r1.reallyExit=oL,oS.count-=1);};(r0=function(e,t){if(!ox(r$.process))returnfunction(){};oO.equal(typeofe,"function","a callback must be provided for exit handler"),!1===o$&&oC();varr="exit";returnt&&t.alwaysLast&&(r="afterexit"),oS.on(r,e),function(){oS.removeListener(r,e),0===oS.listeners("exit").length&&0===oS.listeners("afterexit").length&&oP();};}).unload=oP;varoN=function(e,t,r){oS.emitted[e]||(oS.emitted[e]=!0,oS.emit(e,t,r));},oA={};oR.forEach(function(e){oA[e]=function(){ox(r$.process)&&r1.listeners(e).length===oS.count&&(oP(),oN("exit",null,e),oN("afterexit",null,e),oI&&"SIGHUP"===e&&(e="SIGINT"),r1.kill(r1.pid,e));};}),r0.signals=function(){returnoR;};varo$=!1,oC=function(){!o$&&ox(r$.process)&&(o$=!0,oS.count+=1,oR=oR.filter(function(e){try{returnr1.on(e,oA[e]),!0;}catch(e){return!1;}}),r1.emit=oj,r1.reallyExit=ok);};r0.load=oC;varoL=r1.reallyExit,ok=function(e){ox(r$.process)&&(r1.exitCode=e||0,oN("exit",r1.exitCode,null),oN("afterexit",r1.exitCode,null),oL.call(r1,r1.exitCode));},oD=r1.emit,oj=function(e,t){if(!("exit"===e&&ox(r$.process)))returnoD.apply(this,arguments);void0!==t&&(r1.exitCode=t);varr=oD.apply(this,arguments);returnoN("exit",r1.exitCode,null),oN("afterexit",r1.exitCode,null),r;};}elser0=function(){returnfunction(){};};constoF=(e,t="SIGTERM",r={})=>{letn=e(t);returnoU(e,t,r,n),n;},oU=(e,t,r,n)=>{if(!oM(t,r,n))return;leti=setTimeout(()=>{e("SIGKILL");},oB(r));i.unref&&i.unref();},oM=(e,{forceKillAfterTimeout:t},r)=>oG(e)&&!1!==t&&r,oG=e=>e===c(rO).constants.signals.SIGTERM||"string"==typeofe&&"SIGTERM"===e.toUpperCase(),oB=({forceKillAfterTimeout:e=!0})=>{if(!0===e)return5e3;if(!Number.isFinite(e)||e<0)throwTypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeofe})`);returne;},oH=(e,t)=>{e.kill()&&(t.isCanceled=!0);},oq=(e,t,r)=>{e.kill(t),r(Object.assign(Error("Timed out"),{timedOut:!0,signal:t}));},oz=(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{leti;return0===t||void0===t?n:Promise.race([newPromise((n,o)=>{i=setTimeout(()=>{oq(e,r,o);},t);}),n.finally(()=>{clearTimeout(i);})]);},oV=({timeout:e})=>{if(void0!==e&&(!Number.isFinite(e)||e<0))throwTypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeofe})`);},oX=async(e,{cleanup:t,detached:r},n)=>{if(!t||r)returnn;leti=c(r0)(()=>{e.kill();});returnn.finally(()=>{i();});},oW=e=>einstanceofrb.ChildProcess&&"function"==typeofe.then,oY=(e,t,r)=>{if("string"==typeofr)returne[t].pipe((0,rv.createWriteStream)(r)),e;if(g