${n.message}`:m,E=[g,t,e].filter(Boolean).join("\n");return v?(n.originalMessage=n.message,n.message=E):n=Error(E),n.shortMessage=g,n.command=s,n.escapedCommand=a,n.exitCode=o,n.signal=i,n.signalDescription=d,n.stdout=e,n.stderr=t,void 0!==r&&(n.all=r),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!l,n.isCanceled=c,n.killed=u&&!l,n;};var eX={};"use strict";const ez=["stdin","stdout","stderr"],eW=e=>ez.some(t=>void 0!==e[t]),eK=e=>{if(!e)return;let{stdio:t}=e;if(void 0===t)return ez.map(t=>e[t]);if(eW(e))throw Error(`It'snotpossibletoprovide\`stdio\` in combination with one of ${ez.map(e=>`\`${e}\``).join(", ")}`);if("string"==typeoft)returnt;if(!Array.isArray(t))throwTypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeoft}\``);letr=Math.max(t.length,ez.length);returnArray.from({length:r},(e,r)=>t[r]);};(eX=eK).node=e=>{lett=eK(e);return"ipc"===t?"ipc":void0===t||"string"==typeoft?[t,t,t,"ipc"]:t.includes("ipc")?t:[...t,"ipc"];};vareY={},eJ={},eQ=U.process;consteZ=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(eZ(eQ)){vare0,e1,e2=F("2dWxz"),e4=/^win/i.test(eQ.platform),e3=g;"function"!=typeofe3&&(e3=e3.EventEmitter),eQ.__signal_exit_emitter__?e1=eQ.__signal_exit_emitter__:((e1=eQ.__signal_exit_emitter__=newe3()).count=0,e1.emitted={}),e1.infinite||(e1.setMaxListeners(1/0),e1.infinite=!0);vare6=function(){e9&&eZ(U.process)&&(e9=!1,e2.forEach(function(e){try{eQ.removeListener(e,e5[e]);}catch(e){}}),eQ.emit=tr,eQ.reallyExit=te,e1.count-=1);};(eJ=function(e,t){if(!eZ(U.process))returnfunction(){};E.equal(typeofe,"function","a callback must be provided for exit handler"),!1===e9&&e7();varr="exit";returnt&&t.alwaysLast&&(r="afterexit"),e1.on(r,e),function(){e1.removeListener(r,e),0===e1.listeners("exit").length&&0===e1.listeners("afterexit").length&&e6();};}).unload=e6;vare8=function(e,t,r){e1.emitted[e]||(e1.emitted[e]=!0,e1.emit(e,t,r));},e5={};e2.forEach(function(e){e5[e]=function(){eZ(U.process)&&eQ.listeners(e).length===e1.count&&(e6(),e8("exit",null,e),e8("afterexit",null,e),e4&&"SIGHUP"===e&&(e="SIGINT"),eQ.kill(eQ.pid,e));};}),eJ.signals=function(){returne2;};vare9=!1,e7=function(){!e9&&eZ(U.process)&&(e9=!0,e1.count+=1,e2=e2.filter(function(e){try{returneQ.on(e,e5[e]),!0;}catch(e){return!1;}}),eQ.emit=tn,eQ.reallyExit=tt);};eJ.load=e7;varte=eQ.reallyExit,tt=function(e){eZ(U.process)&&(eQ.exitCode=e||0,e8("exit",eQ.exitCode,null),e8("afterexit",eQ.exitCode,null),te.call(eQ,eQ.exitCode));},tr=eQ.emit,tn=function(e,t){if(!("exit"===e&&eZ(U.process)))returntr.apply(this,arguments);void0!==t&&(eQ.exitCode=t);varr=tr.apply(this,arguments);returne8("exit",eQ.exitCode,null),e8("afterexit",eQ.exitCode,null),r;};}elseeJ=function(){returnfunction(){};};"use strict";"use strict";constti=(e,t,r,n)=>{if(!to(t,r,n))return;leti=ta(r),o=setTimeout(()=>{e("SIGKILL");},i);o.unref&&o.unref();},to=(e,{forceKillAfterTimeout:t},r)=>ts(e)&&!1!==t&&r,ts=e=>e===u.constants.signals.SIGTERM||"string"==typeofe&&"SIGTERM"===e.toUpperCase(),ta=({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;},tl=(e,t,r)=>{e.kill(t),r(Object.assign(Error("Timed out"),{timedOut:!0,signal:t}));},tc=async(e,{cleanup:t,detached:r},n)=>{if(!t||r)returnn;leti=eJ(()=>{e.kill();});returnn.finally(()=>{i();});};vartu=(eY={spawnedKill:(e,t="SIGTERM",r={})=>{letn=e(t);returnti(e,t,r,n),n;},spawnedCancel:(e,t)=>{letr=e.kill();r&&(t.isCanceled=!0);},setupTimeout:(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{leti;if(0===t||void0===t)returnn;leto=newPromise((n,o)=>{i=setTimeout(()=>{tl(e,r,o);},t);}),s=n.finally(()=>{clearTimeout(i);});returnPromise.race([o,s]);},validateTimeout:({timeout:e})=>{if(void0!==e&&(!Number.isFin
${t}`,rx=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),rb=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),rS=(e,t,r)=>{let n=""===r?"":`with${r.trim()}()`,i=rw.bind(null,n,t.toString());Object.defineProperty(i,"name",rb),Object.defineProperty(e,"toString",{...rx,value:i});},rI=new WeakMap(),rO=(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(rI.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;};returnfunction(e,t,{ignoreNonConfigurable:r=!1}={}){let{name:n}=e;for(letnofReflect.ownKeys(t))rg(e,t,n,r);ry(e,t),rS(e,t,n);}(o,e),rI.set(o,n),o;};rO.callCount=e=>{if(!rI.has(e))throwError(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);returnrI.get(e);};constrR=()=>Array.from({length:rC-rT+1},r$),r$=(e,t)=>({name:`SIGRT${t+1}`,number:rT+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),rT=34,rC=64,rA=[{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:"termina
${n.message}`:m,E=[g,t,e].filter(Boolean).join("\n");return v?(n.originalMessage=n.message,n.message=E):n=Error(E),n.shortMessage=g,n.command=s,n.escapedCommand=a,n.exitCode=o,n.signal=i,n.signalDescription=d,n.stdout=e,n.stderr=t,void 0!==r&&(n.all=r),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!l,n.isCanceled=c,n.killed=u&&!l,n;},rM=["stdin","stdout","stderr"],rF=e=>rM.some(t=>void 0!==e[t]),rG=e=>{if(!e)return;let{stdio:t}=e;if(void 0===t)return rM.map(t=>e[t]);if(rF(e))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${rM.map(e=>`\`${e}\``).join(", ")}`);if("string"==typeof t)return t;if(!Array.isArray(t))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,rM.length);return Array.from({length:r},(e,r)=>t[r]);},rB=(e,t="SIGTERM",r={})=>{let n=e(t);return rH(e,t,r,n),n;},rH=(e,t,r,n)=>{if(!rq(t,r,n))return;let i=rX(r),o=setTimeout(()=>{e("SIGKILL");},i);o.unref&&o.unref();},rq=(e,{forceKillAfterTimeout:t},r)=>rV(e)&&!1!==t&&r,rV=e=>e===k(P).constants.signals.SIGTERM||"string"==typeof e&&"SIGTERM"===e.toUpperCase(),rX=({forceKillAfterTimeout:e=!0})=>{if(!0===e)return 5e3;if(!Number.isFinite(e)||e<0)throw TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e;},rz=(e,t)=>{let r=e.kill();r&&(t.isCanceled=!0);},rW=(e,t,r)=>{e.kill(t),r(Object.assign(Error("Timed out"),{timedOut:!0,signal:t}));},rK=(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{let i;if(0===t||void 0===t)return n;let o=new Promise((n,o)=>{i=setTimeout(()=>{rW(e,r,o);},t);}),s=n.finally(()=>{clearTimeout(i);});return Promise.race([o,s]);},rY=({timeout:e})=>{if(void 0!==e&&(!Number.isFinite(e)||e<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);},rJ=async(e,{cleanup:t,detached:r},n)=>{if(!t||r)return n;let i=k(eJ)(()=>{e.kill();});return n.finally(()=>{i();});};function rQ(e){return null!==e&&"object"==typeof e&&"function"==typeof e.pipe;}function rZ(e){return rQ(e)&&!1!==e.writable&&"function"==typeof e._write&&"object"==typeof e._writableState;}const r0=e=>e instanceof C.ChildProcess&&"function"==typeof e.then,r1=(e,t,r)=>{if("string"==typeof r)return e[t].pipe((0,w.createWriteStream)(r)),e;if(rZ(r))return e[t].pipe(r),e;if(!r0(r))throw TypeError("The second argument must be a string, a stream or an Execa child process.");if(!rZ(r.stdin))throw TypeError("The target child process'sstdinmustbeavailable.");return e[t].pipe(r.stdin),r;},r2=e=>{null!==e.stdout&&(e.pipeStdout=r1.bind(void 0,e,"stdout")),null!==e.stderr&&(e.pipeStderr=r1.bind(void 0,e,"stderr")),void 0!==e.all&&(e.pipeAll=r1.bind(void 0,e,"all"));},r4=e=>{if(void 0!==e)throw TypeError("The`input`and`inputFile`optionscannotbebothset.");},r3=({input:e,inputFile:t})=>"string"!=typeof t?e:(r4(e),(0,w.readFileSync)(t)),r6=e=>{let t=r3(e);if(rQ(t))throw TypeError("The`input`optioncannotbeastreaminsyncmode");return t;},r8=({input:e,inputFile:t})=>"string"!=typeof t?e:(r4(e),(0,w.createReadStream)(t)),r5=(e,t)=>{let r=r8(t);void 0!==r&&(rQ(r)?r.pipe(e.stdin):e.stdin.end(r));},r9=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;let r=k(tR)();return e.stdout&&r.add(e.stdout),e.stderr&&r.add(e.stderr),r;},r7=async(e,t)=>{if(e&&void 0!==t){e.destroy();try{return await t;}catch(e){return e.bufferedData;}}},ne=(e,{encoding:t,buffer:r,maxBuffer:n})=>{if(e&&r)return t?k(tE)(e,{encoding:t,maxBuffer:n}):k(tE).buffer(e,{maxBuffer:n});},nt=async({stdout:e,stderr:t,all:r},{encoding:n,buffer:i,maxBuffer:o},s)=>{let a=ne(e,{encoding:n,buffer:i,maxBuffer:o}),l=ne(t,{encoding:n,buffer:i,maxBuffer:o}),c=ne(r,{encoding:n,buffer:i,maxBuffer:2*o});try{return await Promise.all([s,a,l,c]);}catch(n){return Promise.all([{error:n,signal:n.signal,timedOut:n.timedOut},r7(e,a),r7(t,l),r7(r,c)]);}},nr=(async()=>{})().constructor.prototype,nn=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(nr,e)]),ni=(e,t)=>{for(let[r,n]of nn){let i="function"==typ
`),(0,rf.info)(`${e}="${n}"wasaddedto"${nF}`));return;}process.env[e]=n;}async function nB(e){switch(process.platform){case"win32":await nT(`$USER_PATH=([Environment]::GetEnvironmentVariable("PATH", "User")); [Environment]::SetEnvironmentVariable("PATH", "${e};$USER_PATH", "User")`),(0,rf.info)(`"${e}" was added to the PATH.`);return;case"linux":case"darwin":awaitnq(),(0,d.appendFileSync)(nF,`
`),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:"--cppcache, --sccache"},documentation:{tools:"--doxygen, --graphviz"},coverage:{tools:"--gcovr, --opencppcoverage, --kcov"},other:{tools:"--python, --powershell, --sevenzip"}},["tools"]));let a=null!==(t=s.architecture)&&void 0!==t?t:process.arch,l=null!==(r=process.env.SETUP_CPP_DIR)&&void 0!==r?r:t2(""),c=[],u=[],p=V.create({autoloadLocales:!0});V.addLocale(k(X)),H.addLocale(k(q));let d=await o0();if(!function(e,t){let r=t.filter(t=>void 0!==e[t]),n=r.filter(t=>!oY(e[t])),i=n.length>=1?e[n[0]]:"true";return!n.some(t=>e[t]!==i)&&(r.forEach(t=>{e[t]=i;}),!0);}(s,["llvm","clangtidy","clangformat"]))return(0,B.error)("The same version must be used for llvm, clangformat and clangtidy"),1;ig()&&"string"==typeof s.cppcheck&&"string"==typeof s.gcovr&&((0,B.info)("installing python-pygments to avoid conflicts with cppcheck and gcovr on Arch linux"),await iO("python-pygments"));let f=!1;for(let e of aI){let t=s[e];void 0!==t&&(n=Date.now(),f=await ab(e,t,d,a,l,c,u),i=Date.now(),(0,B.info)(`took${p.format(n,i)||"0 seconds"}`));}let h=s.compiler;if(void 0!==h){let e=Date.now();await a$(h,d,l,a,c,f,u);let t=Date.now();(0,B.info)(`took${p.format(e,t)||"0 seconds"}`);}if(await nV(),0===c.length&&0===u.length)return(0,B.warning)("setup-cpp was called without any arguments. Nothing to do."),0;if(c.forEach(e=>(0,B.success)(e)),u.forEach(e=>(0,B.error)(e)),(0,B.info)("setup-cpp finished"),!G.GITHUB_ACTIONS)switch(process.platform){case"win32":(0,B.warning)("Run `RefreshEnv.cmd` or restart your shell to update the environment.");break;case"linux":case"darwin":(0,B.warning)("Run `source~/.cpprc`orrestartyourshelltoupdatetheenvironment.");}returnawaito,0===u.length?0:1;})(process.argv).then(e=>{process.exitCode=e;}).catch(e=>{(0,B.error)("main()panicked!"),(0,B.error)(e),process.exitCode=1;});