From 9d702fc9741a38ef0e9d138abd6d2930072fdebe Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Fri, 20 Sep 2024 16:44:43 -0700 Subject: [PATCH] fix: downgrade execa to 7 --- .github/renovate.json | 2 +- ...DomaW1UO.js => actions_python-B7InDb2U.js} | 4 +- ....js.map => actions_python-B7InDb2U.js.map} | 2 +- dist/legacy/setup-cpp.js | 2 +- dist/legacy/setup-cpp.js.map | 2 +- ...BafgEv.mjs => actions_python-Dr1ce8ZD.mjs} | 4 +- ...js.map => actions_python-Dr1ce8ZD.mjs.map} | 2 +- dist/modern/setup-cpp.mjs | 2 +- dist/modern/setup-cpp.mjs.map | 2 +- package.json | 8 +- packages/exec-powershell/package.json | 2 +- packages/exec-powershell/src/index.ts | 4 +- packages/setup-apt/package.json | 2 +- packages/setup-brew/package.json | 2 +- pnpm-lock.yaml | 234 +++++++++--------- 15 files changed, 139 insertions(+), 135 deletions(-) rename dist/legacy/assets/{actions_python-DomaW1UO.js => actions_python-B7InDb2U.js} (86%) rename dist/legacy/assets/{actions_python-DomaW1UO.js.map => actions_python-B7InDb2U.js.map} (99%) rename dist/modern/assets/{actions_python-DEBafgEv.mjs => actions_python-Dr1ce8ZD.mjs} (75%) rename dist/modern/assets/{actions_python-DEBafgEv.mjs.map => actions_python-Dr1ce8ZD.mjs.map} (68%) diff --git a/.github/renovate.json b/.github/renovate.json index 437a3e1d..1db322d3 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -9,7 +9,7 @@ "groupName": "devDependencies", "semanticCommitType": "chore", "automerge": true, - "ignoreDeps": ["eslint", "numerous"] + "ignoreDeps": ["eslint", "numerous", "execa"] }, { "matchDepTypes": ["dependencies"], diff --git a/dist/legacy/assets/actions_python-DomaW1UO.js b/dist/legacy/assets/actions_python-B7InDb2U.js similarity index 86% rename from dist/legacy/assets/actions_python-DomaW1UO.js rename to dist/legacy/assets/actions_python-B7InDb2U.js index e978d2d9..4413b89a 100644 --- a/dist/legacy/assets/actions_python-DomaW1UO.js +++ b/dist/legacy/assets/actions_python-B7InDb2U.js @@ -1,2 +1,2 @@ -"use strict";function _interopNamespaceDefault(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const r in t)if("default"!==r){const s=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,s.get?s:{enumerable:!0,get:()=>t[r]})}return e.default=t,Object.freeze(e)}function isDigit(t){return t>=CHAR_0&&CHAR_9>=t}function isHexit(t){return t>=CHAR_A&&CHAR_F>=t||t>=CHAR_a&&CHAR_f>=t||t>=CHAR_0&&CHAR_9>=t}function isBit(t){return t===CHAR_1||t===CHAR_0}function isOctit(t){return t>=CHAR_0&&CHAR_7>=t}function isAlphaNumQuoteHyphen(t){return t>=CHAR_A&&CHAR_Z>=t||t>=CHAR_a&&CHAR_z>=t||t>=CHAR_0&&CHAR_9>=t||t===CHAR_APOS||t===CHAR_QUOT||t===CHAR_LOWBAR||t===CHAR_HYPHEN}function isAlphaNumHyphen(t){return t>=CHAR_A&&CHAR_Z>=t||t>=CHAR_a&&CHAR_z>=t||t>=CHAR_0&&CHAR_9>=t||t===CHAR_LOWBAR||t===CHAR_HYPHEN}function hasKey(t,e){return!!hasOwnProperty.call(t,e)||("__proto__"===e&&defineProperty(t,"__proto__",descriptor),!1)}function InlineTable(){return Object.defineProperties({},{[_type]:{value:INLINE_TABLE}})}function isInlineTable(t){return null!==t&&"object"==typeof t&&t[_type]===INLINE_TABLE}function Table(){return Object.defineProperties({},{[_type]:{value:TABLE},[_declared]:{value:!1,writable:!0}})}function isTable(t){return null!==t&&"object"==typeof t&&t[_type]===TABLE}function InlineList(t){return Object.defineProperties([],{[_type]:{value:INLINE_LIST},[_contentType]:{value:t}})}function isInlineList(t){return null!==t&&"object"==typeof t&&t[_type]===INLINE_LIST}function List(){return Object.defineProperties([],{[_type]:{value:LIST}})}function isList(t){return null!==t&&"object"==typeof t&&t[_type]===LIST}function Integer(t){let e=Number(t);return Object.is(e,-0)&&(e=0),setupCpp.commonjsGlobal.BigInt&&!Number.isSafeInteger(e)?new BoxedBigInt(t):Object.defineProperties(new Number(e),{isNaN:{value:function(){return isNaN(this)}},[_type]:{value:INTEGER},[_inspect]:{value:()=>`[Integer: ${t}]`}})}function isInteger(t){return null!==t&&"object"==typeof t&&t[_type]===INTEGER}function Float(t){return Object.defineProperties(new Number(t),{[_type]:{value:FLOAT},[_inspect]:{value:()=>`[Float: ${t}]`}})}function isFloat(t){return null!==t&&"object"==typeof t&&t[_type]===FLOAT}function tomlType$1(t){const e=typeof t;if("object"===e){if(null===t)return"null";if(t instanceof Date)return"datetime";if(_type in t)switch(t[_type]){case INLINE_TABLE:return"inline-table";case INLINE_LIST:return"inline-list";case TABLE:return"table";case LIST:return"list";case FLOAT:return"float";case INTEGER:return"integer"}}return e}function makeParserClass(t){return class extends t{constructor(){super(),this.ctx=this.obj=Table()}atEndOfWord(){return this.char===CHAR_NUM||this.char===CTRL_I||this.char===CHAR_SP||this.atEndOfLine()}atEndOfLine(){return this.char===t.END||this.char===CTRL_J||this.char===CTRL_M}parseStart(){if(this.char===t.END)return null;if(this.char===CHAR_LSQB)return this.call(this.parseTableOrList);if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(isAlphaNumQuoteHyphen(this.char))return this.callNow(this.parseAssignStatement);throw this.error(new TomlError(`Unknown character "${this.char}"`))}parseWhitespaceToEOL(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(this.char===CHAR_NUM)return this.goto(this.parseComment);if(this.char===t.END||this.char===CTRL_J)return this.return();throw this.error(new TomlError("Unexpected character, expected only whitespace or comments till end of line"))}parseAssignStatement(){return this.callNow(this.parseAssign,this.recordAssignStatement)}recordAssignStatement(t){let e=this.ctx,r=t.key.pop();for(let s of t.key){if(hasKey(e,s)&&!isTable(e[s]))throw this.error(new TomlError("Can't redefine existing key"));e=e[s]=e[s]||Table()}if(hasKey(e,r))throw this.error(new TomlError("Can't redefine existing key"));return e[_declared]=!0,e[r]=isInteger(t.value)||isFloat(t.value)?t.value.valueOf():t.value,this.goto(this.parseWhitespaceToEOL)}parseAssign(){return this.callNow(this.parseKeyword,this.recordAssignKeyword)}recordAssignKeyword(t){return this.state.resultTable?this.state.resultTable.push(t):this.state.resultTable=[t],this.goto(this.parseAssignKeywordPreDot)}parseAssignKeywordPreDot(){return this.char===CHAR_PERIOD?this.next(this.parseAssignKeywordPostDot):this.char!==CHAR_SP&&this.char!==CTRL_I?this.goto(this.parseAssignEqual):void 0}parseAssignKeywordPostDot(){if(this.char!==CHAR_SP&&this.char!==CTRL_I)return this.callNow(this.parseKeyword,this.recordAssignKeyword)}parseAssignEqual(){if(this.char===CHAR_EQUALS)return this.next(this.parseAssignPreValue);throw this.error(new TomlError('Invalid character, expected "="'))}parseAssignPreValue(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseValue,this.recordAssignValue)}recordAssignValue(t){return this.returnNow({key:this.state.resultTable,value:t})}parseComment(){do{if(this.char===t.END||this.char===CTRL_J)return this.return();if(this.char===CHAR_DEL||CTRL_CHAR_BOUNDARY>=this.char&&this.char!==CTRL_I)throw this.errorControlCharIn("comments")}while(this.nextChar())}parseTableOrList(){if(this.char!==CHAR_LSQB)return this.goto(this.parseTable);this.next(this.parseList)}parseTable(){return this.ctx=this.obj,this.goto(this.parseTableNext)}parseTableNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseTableMore)}parseTableMore(t){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,t)&&(!isTable(this.ctx[t])||this.ctx[t][_declared]))throw this.error(new TomlError("Can't redefine existing key"));return this.ctx=this.ctx[t]=this.ctx[t]||Table(),this.ctx[_declared]=!0,this.next(this.parseWhitespaceToEOL)}if(this.char===CHAR_PERIOD){if(hasKey(this.ctx,t))if(isTable(this.ctx[t]))this.ctx=this.ctx[t];else{if(!isList(this.ctx[t]))throw this.error(new TomlError("Can't redefine existing key"));this.ctx=this.ctx[t][this.ctx[t].length-1]}else this.ctx=this.ctx[t]=Table();return this.next(this.parseTableNext)}throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseList(){return this.ctx=this.obj,this.goto(this.parseListNext)}parseListNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseListMore)}parseListMore(t){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,t)||(this.ctx[t]=List()),isInlineList(this.ctx[t]))throw this.error(new TomlError("Can't extend an inline array"));if(!isList(this.ctx[t]))throw this.error(new TomlError("Can't redefine an existing key"));{const e=Table();this.ctx[t].push(e),this.ctx=e}return this.next(this.parseListEnd)}if(this.char===CHAR_PERIOD){if(hasKey(this.ctx,t)){if(isInlineList(this.ctx[t]))throw this.error(new TomlError("Can't extend an inline array"));if(isInlineTable(this.ctx[t]))throw this.error(new TomlError("Can't extend an inline table"));if(isList(this.ctx[t]))this.ctx=this.ctx[t][this.ctx[t].length-1];else{if(!isTable(this.ctx[t]))throw this.error(new TomlError("Can't redefine an existing key"));this.ctx=this.ctx[t]}}else this.ctx=this.ctx[t]=Table();return this.next(this.parseListNext)}throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseListEnd(t){if(this.char===CHAR_RSQB)return this.next(this.parseWhitespaceToEOL);throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseValue(){if(this.char===t.END)throw this.error(new TomlError("Key without value"));if(this.char===CHAR_QUOT)return this.next(this.parseDoubleString);if(this.char===CHAR_APOS)return this.next(this.parseSingleString);if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)return this.goto(this.parseNumberSign);if(this.char===CHAR_i)return this.next(this.parseInf);if(this.char===CHAR_n)return this.next(this.parseNan);if(isDigit(this.char))return this.goto(this.parseNumberOrDateTime);if(this.char===CHAR_t||this.char===CHAR_f)return this.goto(this.parseBoolean);if(this.char===CHAR_LSQB)return this.call(this.parseInlineList,this.recordValue);if(this.char===CHAR_LCUB)return this.call(this.parseInlineTable,this.recordValue);throw this.error(new TomlError("Unexpected character, expecting string, number, datetime, boolean, inline array or inline table"))}recordValue(t){return this.returnNow(t)}parseInf(){if(this.char===CHAR_n)return this.next(this.parseInf2);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseInf2(){if(this.char===CHAR_f)return this.return("-"===this.state.buf?-1/0:1/0);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseNan(){if(this.char===CHAR_a)return this.next(this.parseNan2);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseNan2(){if(this.char===CHAR_n)return this.return(NaN);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseKeyword(){return this.char===CHAR_QUOT?this.next(this.parseBasicString):this.char===CHAR_APOS?this.next(this.parseLiteralString):this.goto(this.parseBareKey)}parseBareKey(){do{if(this.char===t.END)throw this.error(new TomlError("Key ended without value"));if(!isAlphaNumHyphen(this.char)){if(0===this.state.buf.length)throw this.error(new TomlError("Empty bare keys are not allowed"));return this.returnNow()}this.consume()}while(this.nextChar())}parseSingleString(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiStringMaybe):this.goto(this.parseLiteralString)}parseLiteralString(){do{if(this.char===CHAR_APOS)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));if(this.char===CHAR_DEL||CTRL_CHAR_BOUNDARY>=this.char&&this.char!==CTRL_I)throw this.errorControlCharIn("strings");this.consume()}while(this.nextChar())}parseLiteralMultiStringMaybe(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiString):this.returnNow()}parseLiteralMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseLiteralMultiStringContent):this.goto(this.parseLiteralMultiStringContent)}parseLiteralMultiStringContent(){do{if(this.char===CHAR_APOS)return this.next(this.parseLiteralMultiEnd);if(this.char===t.END)throw this.error(new TomlError("Unterminated multi-line string"));if(this.char===CHAR_DEL||CTRL_CHAR_BOUNDARY>=this.char&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharIn("strings");this.consume()}while(this.nextChar())}parseLiteralMultiEnd(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiEnd2):(this.state.buf+="'",this.goto(this.parseLiteralMultiStringContent))}parseLiteralMultiEnd2(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiEnd3):(this.state.buf+="''",this.goto(this.parseLiteralMultiStringContent))}parseLiteralMultiEnd3(){return this.char===CHAR_APOS?(this.state.buf+="'",this.next(this.parseLiteralMultiEnd4)):this.returnNow()}parseLiteralMultiEnd4(){return this.char===CHAR_APOS?(this.state.buf+="'",this.return()):this.returnNow()}parseDoubleString(){return this.char===CHAR_QUOT?this.next(this.parseMultiStringMaybe):this.goto(this.parseBasicString)}parseBasicString(){do{if(this.char===CHAR_BSOL)return this.call(this.parseEscape,this.recordEscapeReplacement);if(this.char===CHAR_QUOT)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));if(this.char===CHAR_DEL||CTRL_CHAR_BOUNDARY>=this.char&&this.char!==CTRL_I)throw this.errorControlCharIn("strings");this.consume()}while(this.nextChar())}recordEscapeReplacement(t){return this.state.buf+=t,this.goto(this.parseBasicString)}parseMultiStringMaybe(){return this.char===CHAR_QUOT?this.next(this.parseMultiString):this.returnNow()}parseMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseMultiStringContent):this.goto(this.parseMultiStringContent)}parseMultiStringContent(){do{if(this.char===CHAR_BSOL)return this.call(this.parseMultiEscape,this.recordMultiEscapeReplacement);if(this.char===CHAR_QUOT)return this.next(this.parseMultiEnd);if(this.char===t.END)throw this.error(new TomlError("Unterminated multi-line string"));if(this.char===CHAR_DEL||CTRL_CHAR_BOUNDARY>=this.char&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharIn("strings");this.consume()}while(this.nextChar())}errorControlCharIn(t){let e="\\u00";return 16>this.char&&(e+="0"),e+=this.char.toString(16),this.error(new TomlError(`Control characters (codes < 0x1f and 0x7f) are not allowed in ${t}, use ${e} instead`))}recordMultiEscapeReplacement(t){return this.state.buf+=t,this.goto(this.parseMultiStringContent)}parseMultiEnd(){return this.char===CHAR_QUOT?this.next(this.parseMultiEnd2):(this.state.buf+='"',this.goto(this.parseMultiStringContent))}parseMultiEnd2(){return this.char===CHAR_QUOT?this.next(this.parseMultiEnd3):(this.state.buf+='""',this.goto(this.parseMultiStringContent))}parseMultiEnd3(){return this.char===CHAR_QUOT?(this.state.buf+='"',this.next(this.parseMultiEnd4)):this.returnNow()}parseMultiEnd4(){return this.char===CHAR_QUOT?(this.state.buf+='"',this.return()):this.returnNow()}parseMultiEscape(){return this.char===CTRL_M||this.char===CTRL_J?this.next(this.parseMultiTrim):this.char===CHAR_SP||this.char===CTRL_I?this.next(this.parsePreMultiTrim):this.goto(this.parseEscape)}parsePreMultiTrim(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CTRL_M||this.char===CTRL_J)return this.next(this.parseMultiTrim);throw this.error(new TomlError("Can't escape whitespace"))}parseMultiTrim(){return this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M?null:this.returnNow()}parseEscape(){if(this.char in escapes)return this.return(escapes[this.char]);if(this.char===CHAR_u)return this.call(this.parseSmallUnicode,this.parseUnicodeReturn);if(this.char===CHAR_U)return this.call(this.parseLargeUnicode,this.parseUnicodeReturn);throw this.error(new TomlError("Unknown escape character: "+this.char))}parseUnicodeReturn(t){try{const e=parseInt(t,16);if(e>=SURROGATE_FIRST&&SURROGATE_LAST>=e)throw this.error(new TomlError("Invalid unicode, character in range 0xD800 - 0xDFFF is reserved"));return this.returnNow(String.fromCodePoint(e))}catch(e){throw this.error(TomlError.wrap(e))}}parseSmallUnicode(){if(!isHexit(this.char))throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"));if(this.consume(),this.state.buf.length>=4)return this.return()}parseLargeUnicode(){if(!isHexit(this.char))throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"));if(this.consume(),this.state.buf.length>=8)return this.return()}parseNumberSign(){return this.consume(),this.next(this.parseMaybeSignedInfOrNan)}parseMaybeSignedInfOrNan(){return this.char===CHAR_i?this.next(this.parseInf):this.char===CHAR_n?this.next(this.parseNan):this.callNow(this.parseNoUnder,this.parseNumberIntegerStart)}parseNumberIntegerStart(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberIntegerExponentOrDecimal)):this.goto(this.parseNumberInteger)}parseNumberIntegerExponentOrDecimal(){return this.char===CHAR_PERIOD?(this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat)):this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.returnNow(Integer(this.state.buf))}parseNumberInteger(){if(!isDigit(this.char)){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder);if(this.char===CHAR_E||this.char===CHAR_e)return this.consume(),this.next(this.parseNumberExponentSign);if(this.char===CHAR_PERIOD)return this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat);{const t=Integer(this.state.buf);if(t.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(t)}}this.consume()}parseNoUnder(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD||this.char===CHAR_E||this.char===CHAR_e)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNoUnderHexOctBinLiteral(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNumberFloat(){return this.char===CHAR_LOWBAR?this.call(this.parseNoUnder,this.parseNumberFloat):isDigit(this.char)?void this.consume():this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.returnNow(Float(this.state.buf))}parseNumberExponentSign(){if(isDigit(this.char))return this.goto(this.parseNumberExponent);if(this.char!==CHAR_HYPHEN&&this.char!==CHAR_PLUS)throw this.error(new TomlError("Unexpected character, expected -, + or digit"));this.consume(),this.call(this.parseNoUnder,this.parseNumberExponent)}parseNumberExponent(){if(!isDigit(this.char))return this.char===CHAR_LOWBAR?this.call(this.parseNoUnder):this.returnNow(Float(this.state.buf));this.consume()}parseNumberOrDateTime(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberBaseOrDateTime)):this.goto(this.parseNumberOrDateTimeOnly)}parseNumberOrDateTimeOnly(){return this.char===CHAR_LOWBAR?this.call(this.parseNoUnder,this.parseNumberInteger):isDigit(this.char)?(this.consume(),void(this.state.buf.length>4&&this.next(this.parseNumberInteger))):this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.char===CHAR_PERIOD?(this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat)):this.char===CHAR_HYPHEN?this.goto(this.parseDateTime):this.char===CHAR_COLON?this.goto(this.parseOnlyTimeHour):this.returnNow(Integer(this.state.buf))}parseDateTimeOnly(){if(4>this.state.buf.length){if(isDigit(this.char))return this.consume();if(this.char===CHAR_COLON)return this.goto(this.parseOnlyTimeHour);throw this.error(new TomlError("Expected digit while parsing year part of a date"))}if(this.char===CHAR_HYPHEN)return this.goto(this.parseDateTime);throw this.error(new TomlError("Expected hyphen (-) while parsing year part of date"))}parseNumberBaseOrDateTime(){return this.char===CHAR_b?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerBin)):this.char===CHAR_o?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerOct)):this.char===CHAR_x?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerHex)):this.char===CHAR_PERIOD?this.goto(this.parseNumberInteger):isDigit(this.char)?this.goto(this.parseDateTimeOnly):this.returnNow(Integer(this.state.buf))}parseIntegerHex(){if(!isHexit(this.char)){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{const t=Integer(this.state.buf);if(t.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(t)}}this.consume()}parseIntegerOct(){if(!isOctit(this.char)){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{const t=Integer(this.state.buf);if(t.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(t)}}this.consume()}parseIntegerBin(){if(!isBit(this.char)){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{const t=Integer(this.state.buf);if(t.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(t)}}this.consume()}parseDateTime(){if(4>this.state.buf.length)throw this.error(new TomlError("Years less than 1000 must be zero padded to four characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseDateMonth)}parseDateMonth(){if(this.char===CHAR_HYPHEN){if(2>this.state.buf.length)throw this.error(new TomlError("Months less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseDateDay)}if(!isDigit(this.char))throw this.error(new TomlError("Incomplete datetime"));this.consume()}parseDateDay(){if(this.char===CHAR_T||this.char===CHAR_SP){if(2>this.state.buf.length)throw this.error(new TomlError("Days less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseStartTimeHour)}if(this.atEndOfWord())return this.returnNow(createDate(this.state.result+"-"+this.state.buf));if(!isDigit(this.char))throw this.error(new TomlError("Incomplete datetime"));this.consume()}parseStartTimeHour(){return this.atEndOfWord()?this.returnNow(createDate(this.state.result)):this.goto(this.parseTimeHour)}parseTimeHour(){if(this.char===CHAR_COLON){if(2>this.state.buf.length)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result+="T"+this.state.buf,this.state.buf="",this.next(this.parseTimeMin)}if(!isDigit(this.char))throw this.error(new TomlError("Incomplete datetime"));this.consume()}parseTimeMin(){if(this.state.buf.length>=2||!isDigit(this.char)){if(2===this.state.buf.length&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeSec);throw this.error(new TomlError("Incomplete datetime"))}this.consume()}parseTimeSec(){if(!isDigit(this.char))throw this.error(new TomlError("Incomplete datetime"));if(this.consume(),2===this.state.buf.length)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeZoneOrFraction)}parseOnlyTimeHour(){if(this.char===CHAR_COLON){if(2>this.state.buf.length)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeMin)}throw this.error(new TomlError("Incomplete time"))}parseOnlyTimeMin(){if(this.state.buf.length>=2||!isDigit(this.char)){if(2===this.state.buf.length&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeSec);throw this.error(new TomlError("Incomplete time"))}this.consume()}parseOnlyTimeSec(){if(!isDigit(this.char))throw this.error(new TomlError("Incomplete time"));if(this.consume(),2===this.state.buf.length)return this.next(this.parseOnlyTimeFractionMaybe)}parseOnlyTimeFractionMaybe(){if(this.state.result+=":"+this.state.buf,this.char!==CHAR_PERIOD)return this.return(createTime(this.state.result));this.state.buf="",this.next(this.parseOnlyTimeFraction)}parseOnlyTimeFraction(){if(!isDigit(this.char)){if(this.atEndOfWord()){if(0===this.state.buf.length)throw this.error(new TomlError("Expected digit in milliseconds"));return this.returnNow(createTime(this.state.result+"."+this.state.buf))}throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}this.consume()}parseTimeZoneOrFraction(){if(this.char===CHAR_PERIOD)this.consume(),this.next(this.parseDateTimeFraction);else{if(this.char!==CHAR_HYPHEN&&this.char!==CHAR_PLUS){if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}this.consume(),this.next(this.parseTimeZoneHour)}}parseDateTimeFraction(){if(isDigit(this.char))this.consume();else{if(1===this.state.buf.length)throw this.error(new TomlError("Expected digit in milliseconds"));if(this.char!==CHAR_HYPHEN&&this.char!==CHAR_PLUS){if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}this.consume(),this.next(this.parseTimeZoneHour)}}parseTimeZoneHour(){if(!isDigit(this.char))throw this.error(new TomlError("Unexpected character in datetime, expected digit"));if(this.consume(),/\d\d$/.test(this.state.buf))return this.next(this.parseTimeZoneSep)}parseTimeZoneSep(){if(this.char!==CHAR_COLON)throw this.error(new TomlError("Unexpected character in datetime, expected colon"));this.consume(),this.next(this.parseTimeZoneMin)}parseTimeZoneMin(){if(!isDigit(this.char))throw this.error(new TomlError("Unexpected character in datetime, expected digit"));if(this.consume(),/\d\d$/.test(this.state.buf))return this.return(createDateTime(this.state.result+this.state.buf))}parseBoolean(){return this.char===CHAR_t?(this.consume(),this.next(this.parseTrue_r)):this.char===CHAR_f?(this.consume(),this.next(this.parseFalse_a)):void 0}parseTrue_r(){if(this.char===CHAR_r)return this.consume(),this.next(this.parseTrue_u);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_u(){if(this.char===CHAR_u)return this.consume(),this.next(this.parseTrue_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_e(){if(this.char===CHAR_e)return this.return(!0);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_a(){if(this.char===CHAR_a)return this.consume(),this.next(this.parseFalse_l);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_l(){if(this.char===CHAR_l)return this.consume(),this.next(this.parseFalse_s);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_s(){if(this.char===CHAR_s)return this.consume(),this.next(this.parseFalse_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_e(){if(this.char===CHAR_e)return this.return(!1);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseInlineList(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===t.END)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_NUM?this.call(this.parseComment):this.char===CHAR_RSQB?this.return(this.state.resultArr||InlineList()):this.callNow(this.parseValue,this.recordInlineListValue)}recordInlineListValue(t){return this.state.resultArr||(this.state.resultArr=InlineList(tomlType$1(t))),isFloat(t)||isInteger(t)?this.state.resultArr.push(t.valueOf()):this.state.resultArr.push(t),this.goto(this.parseInlineListNext)}parseInlineListNext(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CHAR_COMMA)return this.next(this.parseInlineList);if(this.char===CHAR_RSQB)return this.goto(this.parseInlineList);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}parseInlineTable(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===t.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_RCUB?this.return(this.state.resultTable||InlineTable()):(this.state.resultTable||(this.state.resultTable=InlineTable()),this.callNow(this.parseAssign,this.recordInlineTableValue))}recordInlineTableValue(t){let e=this.state.resultTable,r=t.key.pop();for(let s of t.key){if(hasKey(e,s)&&(!isTable(e[s])||e[s][_declared]))throw this.error(new TomlError("Can't redefine existing key"));e=e[s]=e[s]||Table()}if(hasKey(e,r))throw this.error(new TomlError("Can't redefine existing key"));return e[r]=isInteger(t.value)||isFloat(t.value)?t.value.valueOf():t.value,this.goto(this.parseInlineTableNext)}parseInlineTableNext(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===t.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));if(this.char===CHAR_COMMA)return this.next(this.parseInlineTablePostComma);if(this.char===CHAR_RCUB)return this.goto(this.parseInlineTable);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}parseInlineTablePostComma(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===t.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));if(this.char===CHAR_COMMA)throw this.error(new TomlError("Empty elements in inline tables are not permitted"));if(this.char===CHAR_RCUB)throw this.error(new TomlError("Trailing commas in inline tables are not permitted"));return this.goto(this.parseInlineTable)}}}function prettyError$2(t,e){if(null==t.pos||null==t.line)return t;let r=t.message;if(r+=` at row ${t.line+1}, col ${t.col+1}, pos ${t.pos}:\n`,e&&e.split){const s=e.split(/\n/),i=(Math.min(s.length,t.line+3)+"").length;let n=" ";for(;i>n.length;)n+=" ";for(let e=Math.max(0,t.line-1);Math.min(s.length,t.line+2)>e;++e){let a=e+1+"";if(i>a.length&&(a=" "+a),t.line===e){r+=a+"> "+s[e]+"\n",r+=n+" ";for(let e=0;t.col>e;++e)r+=" ";r+="^\n"}else r+=a+": "+s[e]+"\n"}}return t.message=r+"\n",t}function parseString(t){setupCpp.commonjsGlobal.Buffer&&setupCpp.commonjsGlobal.Buffer.isBuffer(t)&&(t=t.toString("utf8"));const e=new TOMLParser$2;try{return e.parse(t),e.finish()}catch(r){throw prettyError$1(r,t)}}function parseAsync(t,e){function r(e,s,n,a){if(e>=t.length)try{return n(i.finish())}catch(o){return a(prettyError(o,t))}try{i.parse(t.slice(e,e+s)),setImmediate(r,e+s,s,n,a)}catch(o){a(prettyError(o,t))}}e||(e={});const s=e.blocksize||40960,i=new TOMLParser$1;return new Promise(((t,e)=>{setImmediate(r,0,s,t,e)}))}function parseStream(t){return t?parseReadable(t):parseTransform()}function parseReadable(t){const e=new TOMLParser;return t.setEncoding("utf8"),new Promise(((r,s)=>{function i(){if(o=!0,!a)try{r(e.finish())}catch(t){s(t)}}function n(t){h=!0,s(t)}let a,o=!1,h=!1;t.once("end",i),t.once("error",n),function r(){let s;for(a=!0;null!==(s=t.read());)try{e.parse(s)}catch(c){return n(c)}if(a=!1,o)return i();h||t.once("readable",r)}()}))}function parseTransform(){const t=new TOMLParser;return new stream.Transform({objectMode:!0,transform(e,r,s){try{t.parse(e.toString(r))}catch(i){this.emit("error",i)}s()},flush(e){try{this.push(t.finish())}catch(r){this.emit("error",r)}e()}})}function stringify(t){if(null===t)throw typeError("null");if(void 0===t)throw typeError("undefined");if("object"!=typeof t)throw typeError(typeof t);if("function"==typeof t.toJSON&&(t=t.toJSON()),null==t)return null;const e=tomlType(t);if("table"!==e)throw typeError(e);return stringifyObject("","",t)}function typeError(t){return Error("Can only stringify objects, not "+t)}function getInlineKeys(t){return Object.keys(t).filter((e=>isInline(t[e])))}function getComplexKeys(t){return Object.keys(t).filter((e=>!isInline(t[e])))}function toJSON(t){let e=Array.isArray(t)?[]:{}.hasOwnProperty.call(t,"__proto__")?{["__proto__"]:void 0}:{};for(let r of Object.keys(t))e[r]=t[r]&&"function"==typeof t[r].toJSON&&!("toISOString"in t[r])?t[r].toJSON():t[r];return e}function stringifyObject(t,e,r){let s,i;s=getInlineKeys(r=toJSON(r)),i=getComplexKeys(r);const n=[],a=e||"";s.forEach((t=>{var e=tomlType(r[t]);"undefined"!==e&&"null"!==e&&n.push(a+stringifyKey(t)+" = "+stringifyAnyInline(r[t],!0))})),n.length>0&&n.push("");const o=t&&s.length>0?e+" ":"";return i.forEach((e=>{n.push(stringifyComplex(t,o,e,r[e]))})),n.join("\n")}function isInline(t){switch(tomlType(t)){case"undefined":case"null":case"integer":case"nan":case"float":case"boolean":case"string":case"datetime":return!0;case"array":return 0===t.length||"table"!==tomlType(t[0]);case"table":return 0===Object.keys(t).length;default:return!1}}function tomlType(t){return void 0===t?"undefined":null===t?"null":"bigint"==typeof t||Number.isInteger(t)&&!Object.is(t,-0)?"integer":"number"==typeof t?"float":"boolean"==typeof t?"boolean":"string"==typeof t?"string":"toISOString"in t?isNaN(t)?"undefined":"datetime":Array.isArray(t)?"array":"table"}function stringifyKey(t){const e=t+"";return/^[-A-Za-z0-9_]+$/.test(e)?e:stringifyBasicString(e)}function stringifyBasicString(t){return'"'+escapeString(t).replace(/"/g,'\\"')+'"'}function stringifyLiteralString(t){return"'"+t+"'"}function numpad(t,e){for(;t>e.length;)e="0"+e;return e}function escapeString(t){return t.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/([\u0000-\u001f\u007f])/,(t=>"\\u"+numpad(4,t.codePointAt(0).toString(16))))}function stringifyMultilineString(t){let e=t.split(/\n/).map((t=>escapeString(t).replace(/"(?="")/g,'\\"'))).join("\n");return'"'===e.slice(-1)&&(e+="\\\n"),'"""\n'+e+'"""'}function stringifyAnyInline(t,e){let r=tomlType(t);return"string"===r&&(e&&/\n/.test(t)?r="string-multiline":!/[\b\t\n\f\r']/.test(t)&&/"/.test(t)&&(r="string-literal")),stringifyInline(t,r)}function stringifyInline(t,e){switch(e||(e=tomlType(t)),e){case"string-multiline":return stringifyMultilineString(t);case"string":return stringifyBasicString(t);case"string-literal":return stringifyLiteralString(t);case"integer":return stringifyInteger(t);case"float":return stringifyFloat(t);case"boolean":return stringifyBoolean(t);case"datetime":return stringifyDatetime(t);case"array":return stringifyInlineArray(t.filter((t=>"null"!==tomlType(t)&&"undefined"!==tomlType(t)&&"nan"!==tomlType(t))));case"table":return stringifyInlineTable(t);default:throw typeError(e)}}function stringifyInteger(t){return(t+"").replace(/\B(?=(\d{3})+(?!\d))/g,"_")}function stringifyFloat(t){if(t===1/0)return"inf";if(t===-1/0)return"-inf";if(Object.is(t,NaN))return"nan";if(Object.is(t,-0))return"-0.0";const[e,r]=(t+"").split(".");return stringifyInteger(e)+"."+r}function stringifyBoolean(t){return t+""}function stringifyDatetime(t){return t.toISOString()}function stringifyInlineArray(t){let e="[";const r=(t=toJSON(t)).map((t=>stringifyInline(t)));return r.join(", ").length>60||/\n/.test(r)?e+="\n "+r.join(",\n ")+"\n":e+=" "+r.join(", ")+(r.length>0?" ":""),e+"]"}function stringifyInlineTable(t){t=toJSON(t);const e=[];return Object.keys(t).forEach((r=>{e.push(stringifyKey(r)+" = "+stringifyAnyInline(t[r],!1))})),"{ "+e.join(", ")+(e.length>0?" ":"")+"}"}function stringifyComplex(t,e,r,s){const i=tomlType(s);if("array"===i)return stringifyArrayOfTables(t,e,r,s);if("table"===i)return stringifyComplexTable(t,e,r,s);throw typeError(i)}function stringifyArrayOfTables(t,e,r,s){const i=tomlType((s=toJSON(s))[0]);if("table"!==i)throw typeError(i);const n=t+stringifyKey(r);let a="";return s.forEach((t=>{a.length>0&&(a+="\n"),a+=e+"[["+n+"]]\n",a+=stringifyObject(n+".",e,t)})),a}function stringifyComplexTable(t,e,r,s){const i=t+stringifyKey(r);let n="";return getInlineKeys(s).length>0&&(n+=e+"["+i+"]\n"),n+stringifyObject(i+".",e,s)}function createSymlinkInFolder(t,e,r,s=!1){const i=path__namespace.join(t,e),n=path__namespace.join(t,r);fs.existsSync(n)||(fs.symlinkSync(i,n),!IS_WINDOWS&&s&&fs.chmodSync(n,"755"))}function validateVersion(t){return isNightlyKeyword(t)||!!setupCpp.semver.validRange(t)}function isNightlyKeyword(t){return"nightly"===t}function getPyPyVersionFromPath(t){return path__namespace.basename(path__namespace.dirname(t))}function readExactPyPyVersionFile(t){let e="";const r=path__namespace.join(t,PYPY_VERSION_FILE);return fs.existsSync(r)&&(e=(""+fs.readFileSync(r)).trim()),e}function writeExactPyPyVersionFile(t,e){const r=path__namespace.join(t,PYPY_VERSION_FILE);fs.writeFileSync(r,e)}function validatePythonVersionFormatForPyPy(t){return/^\d+\.\d+$/.test(t)}async function getWindowsInfo(){const{stdout:t}=await setupCpp.getExecOutput_1('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"',void 0,{silent:!0});return{osName:"Windows",osVersion:t.trim().split(" ")[3]}}async function getMacOSInfo(){const{stdout:t}=await setupCpp.getExecOutput_1("sw_vers",["-productVersion"],{silent:!0});return{osName:"macOS",osVersion:t.trim()}}async function getLinuxInfo(){const{stdout:t}=await setupCpp.getExecOutput_1("lsb_release",["-i","-r","-s"],{silent:!0}),[e,r]=t.trim().split("\n");return setupCpp.coreExports.debug(`OS Name: ${e}, Version: ${r}`),{osName:e,osVersion:r}}async function getOSInfo(){let t;try{IS_WINDOWS?t=await getWindowsInfo():IS_LINUX?t=await getLinuxInfo():IS_MAC&&(t=await getMacOSInfo())}catch(e){setupCpp.coreExports.debug(e.message)}finally{return t}}function getBinaryDirectory(t){return IS_WINDOWS?t:path__namespace.join(t,"bin")}function getDownloadFileName(t){const e=process.env.RUNNER_TEMP||".";return IS_WINDOWS?path__namespace.join(e,path__namespace.basename(t)):void 0}async function installPyPy(t,e,r,s,i){let n;if(!(i=null!=i?i:await getAvailablePyPyVersions())||0===i.length)throw Error("No release was found in PyPy version.json");let a=findRelease(i,e,t,r,!1);if(!a||!a.foundAsset)throw Error(`PyPy version ${e} (${t}) with arch ${r} not found`);const{foundAsset:o,resolvedPythonVersion:h,resolvedPyPyVersion:c}=a,p=""+o.download_url;setupCpp.coreExports.info(`Downloading PyPy from "${p}" ...`);try{const t=getDownloadFileName(p),e=await setupCpp.downloadTool_1(p,t);setupCpp.coreExports.info("Extracting downloaded archive..."),n=IS_WINDOWS?await setupCpp.extractZip_1(e):await setupCpp.extractTar_1(e,void 0,"x");const s=fs.readdirSync(n)[0],i=path__namespace.join(n,s);let a=i;isNightlyKeyword(c)||(a=await setupCpp.cacheDir_1(i,"PyPy",h,r)),writeExactPyPyVersionFile(a,c);const o=getBinaryDirectory(a);return await createPyPySymlink(o,h),await installPip(o),{installDir:a,resolvedPythonVersion:h,resolvedPyPyVersion:c}}catch(l){throw l instanceof Error&&(setupCpp.coreExports.info(l instanceof setupCpp.HTTPError_1&&(403===l.httpStatusCode||429===l.httpStatusCode)?`Received HTTP status code ${l.httpStatusCode}. This usually indicates the rate limit has been exceeded`:l.message),void 0!==l.stack&&setupCpp.coreExports.debug(l.stack)),l}}async function getAvailablePyPyVersions(){const t="https://downloads.python.org/pypy/versions.json",e=new setupCpp.HttpClient("tool-cache"),r=await e.getJson(t);if(!r.result)throw Error(`Unable to retrieve the list of available PyPy versions from '${t}'`);return r.result}async function createPyPySymlink(t,e){const r=setupCpp.semver.coerce(e),s=setupCpp.semver.major(r),i=2===s?"":"3",n=`${s}.${setupCpp.semver.minor(r)}`,a=IS_WINDOWS?".exe":"";setupCpp.coreExports.info("Creating symlinks..."),createSymlinkInFolder(t,`pypy${i}${a}`,`python${s}${a}`,!0),createSymlinkInFolder(t,`pypy${i}${a}`,"python"+a,!0),createSymlinkInFolder(t,`pypy${i}${a}`,`pypy${n}${a}`,!0)}async function installPip(t){setupCpp.coreExports.info("Installing and updating pip");const e=path__namespace.join(t,"python");await setupCpp.exec_2(e+" -m ensurepip"),await setupCpp.exec_2(t+"/python -m pip install --ignore-installed pip")}function findRelease(t,e,r,s,i){const n={includePrerelease:i},a=t.filter((t=>{const i=setupCpp.semver.satisfies(setupCpp.semver.coerce(t.python_version),e),a=isNightlyKeyword(r)&&isNightlyKeyword(t.pypy_version)||setupCpp.semver.satisfies(pypyVersionToSemantic(t.pypy_version),r,n),o=t.files&&(IS_WINDOWS?isArchPresentForWindows(t,s):isArchPresentForMacOrLinux(t,s,process.platform));return i&&a&&o}));if(0===a.length)return null;const o=a.sort(((t,e)=>setupCpp.semver.compare(setupCpp.semver.coerce(pypyVersionToSemantic(e.pypy_version)),setupCpp.semver.coerce(pypyVersionToSemantic(t.pypy_version)))||setupCpp.semver.compare(setupCpp.semver.coerce(e.python_version),setupCpp.semver.coerce(t.python_version))))[0];return{foundAsset:IS_WINDOWS?findAssetForWindows(o,s):findAssetForMacOrLinux(o,s,process.platform),resolvedPythonVersion:o.python_version,resolvedPyPyVersion:o.pypy_version.trim()}}function pypyVersionToSemantic(t){return t.replace(/(\d+\.\d+\.\d+)((?:a|b|rc))(\d*)/g,"$1-$2.$3")}function isArchPresentForWindows(t,e){return e=replaceX32toX86(e),t.files.some((t=>WINDOWS_PLATFORMS.includes(t.platform)&&t.arch===e))}function isArchPresentForMacOrLinux(t,e,r){return t.files.some((t=>t.arch===e&&t.platform===r))}function findAssetForWindows(t,e){return e=replaceX32toX86(e),t.files.find((t=>WINDOWS_PLATFORMS.includes(t.platform)&&t.arch===e))}function findAssetForMacOrLinux(t,e,r){return t.files.find((t=>t.arch===e&&t.platform===r))}function replaceX32toX86(t){return"x32"===t&&(t="x86"),t}async function findPyPyVersion(t,e,r,s,i){let n,a="",o="";const h=parsePyPyVersion(t);({installDir:n,resolvedPythonVersion:o,resolvedPyPyVersion:a}=findPyPyToolCache(h.pythonVersion,h.pypyVersion,e)),n||({installDir:n,resolvedPythonVersion:o,resolvedPyPyVersion:a}=await installPyPy(h.pypyVersion,h.pythonVersion,e,i,void 0));const c=path__namespace.join(n,IS_WINDOWS?"Scripts":"bin"),p=path__namespace.join(IS_WINDOWS?n:c,"python"+(IS_WINDOWS?".exe":"")),l=getBinaryDirectory(n);return setupCpp.coreExports.exportVariable("pythonLocation",n),setupCpp.coreExports.exportVariable("Python_ROOT_DIR",n),setupCpp.coreExports.exportVariable("Python2_ROOT_DIR",n),setupCpp.coreExports.exportVariable("Python3_ROOT_DIR",n),setupCpp.coreExports.exportVariable("PKG_CONFIG_PATH",l+"/lib/pkgconfig"),setupCpp.coreExports.addPath(l),setupCpp.coreExports.addPath(c),setupCpp.coreExports.setOutput("python-version","pypy"+a),setupCpp.coreExports.setOutput("python-path",p),{resolvedPyPyVersion:a,resolvedPythonVersion:o}}function findPyPyToolCache(t,e,r){let s="",i="",n=IS_WINDOWS?findPyPyInstallDirForWindows(t):setupCpp.find_1("PyPy",t,r);return n&&(i=getPyPyVersionFromPath(n),s=readExactPyPyVersionFile(n),setupCpp.semver.satisfies(s,e)||(n=null,s="",i="")),n||setupCpp.coreExports.info(`PyPy version ${t} (${e}) was not found in the local cache`),{installDir:n,resolvedPythonVersion:i,resolvedPyPyVersion:s}}function parsePyPyVersion(t){const e=t.split("-").filter((t=>!!t));if(/^(pypy)(.+)/.test(e[0])){const t=e[0].replace("pypy","");e.splice(0,1,"pypy",t)}if(2>e.length||"pypy"!=e[0])throw Error("Invalid 'version' property for PyPy. PyPy version should be specified as 'pypy' or 'pypy-'. See README for examples and documentation.");const r=e[1];let s;if(s=e.length>2?pypyVersionToSemantic(e[2]):"x",!validateVersion(r)||!validateVersion(s))throw Error("Invalid 'version' property for PyPy. Both Python version and PyPy versions should satisfy SemVer notation. See README for examples and documentation.");if(!validatePythonVersionFormatForPyPy(r))throw Error("Invalid format of Python version for PyPy. Python version should be specified in format 'x.y'. See README for examples and documentation.");return{pypyVersion:s,pythonVersion:r}}function findPyPyInstallDirForWindows(t){let e="";return WINDOWS_ARCHS.forEach((r=>e=e||setupCpp.find_1("PyPy",t,r))),e}async function findReleaseFromManifest(t,e,r){return r||(r=await getManifest()),await setupCpp.findFromManifest_1(t,!1,r,e)}async function getManifest(){try{return await getManifestFromRepo()}catch(t){setupCpp.coreExports.debug("Fetching the manifest via the API failed."),t instanceof Error&&setupCpp.coreExports.debug(t.message)}return await getManifestFromURL()}function getManifestFromRepo(){return setupCpp.coreExports.debug(`Getting manifest from ${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}@${MANIFEST_REPO_BRANCH}`),setupCpp.getManifestFromRepo_1(MANIFEST_REPO_OWNER,MANIFEST_REPO_NAME,AUTH,MANIFEST_REPO_BRANCH)}async function getManifestFromURL(){setupCpp.coreExports.debug("Falling back to fetching the manifest using raw URL.");const t=new setupCpp.HttpClient("tool-cache"),e=await t.getJson(MANIFEST_URL);if(!e.result)throw Error("Unable to get manifest from "+MANIFEST_URL);return e.result}async function installPython(t){const e={cwd:t,env:{...process.env,...IS_LINUX&&{LD_LIBRARY_PATH:path__namespace.join(t,"lib")}},silent:!0,listeners:{stdout:t=>{setupCpp.coreExports.info((""+t).trim())},stderr:t=>{setupCpp.coreExports.error((""+t).trim())}}};IS_WINDOWS?await setupCpp.exec_2("powershell",["./setup.ps1"],e):await setupCpp.exec_2("bash",["./setup.sh"],e)}async function installCpythonFromRelease(t){const e=t.files[0].download_url;setupCpp.coreExports.info(`Download from "${e}"`);let r="";try{const t=getDownloadFileName(e);let s;r=await setupCpp.downloadTool_1(e,t,AUTH),setupCpp.coreExports.info("Extract downloaded archive"),s=IS_WINDOWS?await setupCpp.extractZip_1(r):await setupCpp.extractTar_1(r),setupCpp.coreExports.info("Execute installation script"),await installPython(s)}catch(s){throw s instanceof setupCpp.HTTPError_1&&(setupCpp.coreExports.info(403===s.httpStatusCode||429===s.httpStatusCode?`Received HTTP status code ${s.httpStatusCode}. This usually indicates the rate limit has been exceeded`:s.message),s.stack&&setupCpp.coreExports.debug(s.stack)),s}}function binDir(t){return path__namespace.join(t,IS_WINDOWS?"Scripts":"bin")}async function useCpythonVersion(t,e,r,s,i){let n=pythonVersionToSemantic(desugarDevVersion(t));setupCpp.coreExports.debug(`Semantic version spec of ${t} is ${n}`);let a=setupCpp.find_1("Python",n,e);if(!a){setupCpp.coreExports.info(`Version ${n} was not found in the local cache`);const t=await findReleaseFromManifest(n,e,null);t&&t.files&&t.files.length>0&&(setupCpp.coreExports.info(`Version ${n} is available for downloading`),await installCpythonFromRelease(t),a=setupCpp.find_1("Python",n,e))}if(!a){const r=await getOSInfo();throw Error([`The version '${t}' with architecture '${e}' was not found for ${r?`${r.osName} ${r.osVersion}`:"this operating system"}.`,"The list of all available versions can be found here: "+MANIFEST_URL].join(os__namespace.EOL))}const o=binDir(a),h=path__namespace.join(IS_WINDOWS?a:o,"python"+(IS_WINDOWS?".exe":""));if(setupCpp.coreExports.exportVariable("pythonLocation",a),setupCpp.coreExports.exportVariable("PKG_CONFIG_PATH",a+"/lib/pkgconfig"),setupCpp.coreExports.exportVariable("pythonLocation",a),setupCpp.coreExports.exportVariable("Python_ROOT_DIR",a),setupCpp.coreExports.exportVariable("Python2_ROOT_DIR",a),setupCpp.coreExports.exportVariable("Python3_ROOT_DIR",a),setupCpp.coreExports.exportVariable("PKG_CONFIG_PATH",a+"/lib/pkgconfig"),IS_LINUX){const t=process.env.LD_LIBRARY_PATH?":"+process.env.LD_LIBRARY_PATH:"",e=path__namespace.join(a,"lib");t.split(":").includes(e)||setupCpp.coreExports.exportVariable("LD_LIBRARY_PATH",e+t)}if(setupCpp.coreExports.addPath(a),setupCpp.coreExports.addPath(o),IS_WINDOWS){const t=path__namespace.basename(path__namespace.dirname(a)),e=setupCpp.semver.major(t),r=setupCpp.semver.minor(t),s=path__namespace.join(process.env.APPDATA||"","Python",`Python${e}${r}`,"Scripts");setupCpp.coreExports.addPath(s)}const c=versionFromPath(a);return setupCpp.coreExports.setOutput("python-version",c),setupCpp.coreExports.setOutput("python-path",h),{impl:"CPython",version:c}}function desugarDevVersion(t){return t.replace(/^(\d+)\.(\d+)-dev$/,"~$1.$2.0-0")}function versionFromPath(t){const e=t.split(path__namespace.sep),r=e.findIndex((t=>"PyPy"===t||"Python"===t));return e[r+1]||""}function pythonVersionToSemantic(t,e){return t.replace(/(\d+\.\d+\.\d+)((?:a|b|rc)\d*)/g,"$1-$2")}function isPyPyVersion(t){return t.startsWith("pypy")}async function setupActionsPython(t,e,r){var s;IS_MAC&&(process.env.AGENT_TOOLSDIRECTORY="/Users/runner/hostedtoolcache");const i=null==(s=process.env.AGENT_TOOLSDIRECTORY)?void 0:s.trim();if("string"==typeof i&&""!==i&&(process.env.RUNNER_TOOL_CACHE=process.env.AGENT_TOOLSDIRECTORY),setupCpp.coreExports.debug("Python is expected to be installed into "+process.env.RUNNER_TOOL_CACHE),t){let e;if(isPyPyVersion(t)){const s=await findPyPyVersion(t,r,!0,checkLatest,!1);e=`${s.resolvedPyPyVersion}-${s.resolvedPythonVersion}`,setupCpp.info(`Successfully set up PyPy ${s.resolvedPyPyVersion} with Python (${s.resolvedPythonVersion})`)}else{const s=await useCpythonVersion(t,r);e=s.version,setupCpp.info(`Successfully set up ${s.impl} (${e})`)}}setupCpp.ciInfo.GITHUB_ACTIONS&&await addPythonLoggingMatcher()}async function addPythonLoggingMatcher(){const t=path.join(dirname,"python_matcher.json");if(!(await setupCpp.pathExists(t)))return setupCpp.warning("the python_matcher.json file does not exist in the same folder as setup-cpp.js");setupCpp.info("::add-matcher::"+t)}Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const path=require("path"),require$$1=require("url"),setupCpp=require("../setup-cpp.js"),fs=require("fs"),stream$1=require("stream"),os=require("os");require("crypto"),require("http"),require("https"),require("net"),require("tls"),require("events"),require("util"),require("child_process"),require("string_decoder"),require("process"),require("tty"),require("v8"),require("buffer"),require("assert"),require("timers"),require("console");var _documentCurrentScript="undefined"!=typeof document?document.currentScript:null;const path__namespace=_interopNamespaceDefault(path),os__namespace=_interopNamespaceDefault(os);var parse={exports:{}},tomlParser={exports:{}};const ParserEND=1114112;class ParserError extends Error{constructor(t,e,r){super("[ParserError] "+t,e,r),this.name="ParserError",this.code="ParserError",Error.captureStackTrace&&Error.captureStackTrace(this,ParserError)}}class State{constructor(t){this.parser=t,this.buf="",this.returned=null,this.result=null,this.resultTable=null,this.resultArr=null}}class Parser{constructor(){this.pos=0,this.col=0,this.line=0,this.obj={},this.ctx=this.obj,this.stack=[],this._buf="",this.char=null,this.ii=0,this.state=new State(this.parseStart)}parse(t){if(0===t.length||null==t.length)return;let e;for(this._buf=t+"",this.ii=-1,this.char=-1;!1===e||this.nextChar();)e=this.runOne();this._buf=null}nextChar(){return 10===this.char&&(++this.line,this.col=-1),++this.ii,this.char=this._buf.codePointAt(this.ii),++this.pos,++this.col,this.haveBuffer()}haveBuffer(){return this._buf.length>this.ii}runOne(){return this.state.parser.call(this,this.state.returned)}finish(){let t;this.char=ParserEND;do{t=this.state.parser,this.runOne()}while(this.state.parser!==t);return this.ctx=null,this.state=null,this._buf=null,this.obj}next(t){if("function"!=typeof t)throw new ParserError("Tried to set state to non-existent state: "+JSON.stringify(t));this.state.parser=t}goto(t){return this.next(t),this.runOne()}call(t,e){e&&this.next(e),this.stack.push(this.state),this.state=new State(t)}callNow(t,e){return this.call(t,e),this.runOne()}return(t){if(0===this.stack.length)throw this.error(new ParserError("Stack underflow"));void 0===t&&(t=this.state.buf),this.state=this.stack.pop(),this.state.returned=t}returnNow(t){return this.return(t),this.runOne()}consume(){if(this.char===ParserEND)throw this.error(new ParserError("Unexpected end-of-buffer"));this.state.buf+=this._buf[this.ii]}error(t){return t.line=this.line,t.col=this.col,t.pos=this.pos,t}parseStart(){throw new ParserError("Must declare a parseStart method")}}Parser.END=ParserEND,Parser.Error=ParserError;var parser=Parser,createDatetime=t=>{const e=new Date(t);if(isNaN(e))throw new TypeError("Invalid Datetime");return e},formatNum=(t,e)=>{for(e+="";t>e.length;)e="0"+e;return e};const f$2=formatNum;class FloatingDateTime extends Date{constructor(t){super(t+"Z"),this.isFloating=!0}toISOString(){return`${this.getUTCFullYear()}-${f$2(2,this.getUTCMonth()+1)}-${f$2(2,this.getUTCDate())}T${f$2(2,this.getUTCHours())}:${f$2(2,this.getUTCMinutes())}:${f$2(2,this.getUTCSeconds())}.${f$2(3,this.getUTCMilliseconds())}`}}var createDatetimeFloat=t=>{const e=new FloatingDateTime(t);if(isNaN(e))throw new TypeError("Invalid Datetime");return e};const f$1=formatNum,DateTime=setupCpp.commonjsGlobal.Date;let Date$1=class extends DateTime{constructor(t){super(t),this.isDate=!0}toISOString(){return`${this.getUTCFullYear()}-${f$1(2,this.getUTCMonth()+1)}-${f$1(2,this.getUTCDate())}`}};var createDate$1=t=>{const e=new Date$1(t);if(isNaN(e))throw new TypeError("Invalid Datetime");return e};const f=formatNum;class Time extends Date{constructor(t){super(`0000-01-01T${t}Z`),this.isTime=!0}toISOString(){return`${f(2,this.getUTCHours())}:${f(2,this.getUTCMinutes())}:${f(2,this.getUTCSeconds())}.${f(3,this.getUTCMilliseconds())}`}}var createTime$1=t=>{const e=new Time(t);if(isNaN(e))throw new TypeError("Invalid Datetime");return e};tomlParser.exports=makeParserClass(parser),tomlParser.exports.makeParserClass=makeParserClass;class TomlError extends Error{constructor(t){super(t),this.name="TomlError",Error.captureStackTrace&&Error.captureStackTrace(this,TomlError),this.fromTOML=!0,this.wrapped=null}}TomlError.wrap=t=>{const e=new TomlError(t.message);return e.code=t.code,e.wrapped=t,e},tomlParser.exports.TomlError=TomlError;const createDateTime=createDatetime,createDateTimeFloat=createDatetimeFloat,createDate=createDate$1,createTime=createTime$1,CTRL_I=9,CTRL_J=10,CTRL_M=13,CTRL_CHAR_BOUNDARY=31,CHAR_SP=32,CHAR_QUOT=34,CHAR_NUM=35,CHAR_APOS=39,CHAR_PLUS=43,CHAR_COMMA=44,CHAR_HYPHEN=45,CHAR_PERIOD=46,CHAR_0=48,CHAR_1=49,CHAR_7=55,CHAR_9=57,CHAR_COLON=58,CHAR_EQUALS=61,CHAR_A=65,CHAR_E=69,CHAR_F=70,CHAR_T=84,CHAR_U=85,CHAR_Z=90,CHAR_LOWBAR=95,CHAR_a=97,CHAR_b=98,CHAR_e=101,CHAR_f=102,CHAR_i=105,CHAR_l=108,CHAR_n=110,CHAR_o=111,CHAR_r=114,CHAR_s=115,CHAR_t=116,CHAR_u=117,CHAR_x=120,CHAR_z=122,CHAR_LCUB=123,CHAR_RCUB=125,CHAR_LSQB=91,CHAR_BSOL=92,CHAR_RSQB=93,CHAR_DEL=127,SURROGATE_FIRST=55296,SURROGATE_LAST=57343,escapes={[CHAR_b]:"\b",[CHAR_t]:"\t",[CHAR_n]:"\n",[CHAR_f]:"\f",[CHAR_r]:"\r",[CHAR_QUOT]:'"',[CHAR_BSOL]:"\\"},_type=Symbol(),_declared=Symbol(),hasOwnProperty={}.hasOwnProperty,defineProperty=Object.defineProperty,descriptor={configurable:!0,enumerable:!0,writable:!0,value:void 0},INLINE_TABLE=Symbol(),TABLE=Symbol(),_contentType=Symbol(),INLINE_LIST=Symbol(),LIST=Symbol();let _custom;try{const utilInspect=eval("require('util').inspect");_custom=utilInspect.custom}catch(_){}const _inspect=_custom||"inspect";class BoxedBigInt{constructor(t){try{this.value=setupCpp.commonjsGlobal.BigInt.asIntN(64,t)}catch(_){this.value=null}Object.defineProperty(this,_type,{value:INTEGER})}isNaN(){return null===this.value}toString(){return this.value+""}[_inspect](){return`[BigInt: ${""+this}]}`}valueOf(){return this.value}}const INTEGER=Symbol(),FLOAT=Symbol();var tomlParserExports=tomlParser.exports,parsePrettyError=prettyError$2,parseString_1=parseString;const TOMLParser$2=tomlParserExports,prettyError$1=parsePrettyError;var parseAsync_1=parseAsync;const TOMLParser$1=tomlParserExports,prettyError=parsePrettyError;var parseStream_1=parseStream;const stream=stream$1,TOMLParser=tomlParserExports;parse.exports=parseString_1,parse.exports.async=parseAsync_1,parse.exports.stream=parseStream_1,parse.exports.prettyError=parsePrettyError;var stringify$1={exports:{}};stringify$1.exports=stringify,stringify$1.exports.value=stringifyInline;const IS_WINDOWS="win32"===process.platform,IS_LINUX="linux"===process.platform,IS_MAC="darwin"===process.platform,WINDOWS_ARCHS=["x86","x64"],WINDOWS_PLATFORMS=["win32","win64"],PYPY_VERSION_FILE="PYPY_VERSION",TOKEN=setupCpp.coreExports.getInput("token"),AUTH=TOKEN?"token "+TOKEN:void 0,MANIFEST_REPO_OWNER="actions",MANIFEST_REPO_NAME="python-versions",MANIFEST_REPO_BRANCH="main",MANIFEST_URL=`https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/${MANIFEST_REPO_BRANCH}/versions-manifest.json`,dirname="string"==typeof __dirname?__dirname:path.dirname(require$$1.fileURLToPath("undefined"==typeof document?require("url").pathToFileURL(__filename).href:_documentCurrentScript&&_documentCurrentScript.src||new URL("assets/actions_python-DomaW1UO.js",document.baseURI).href)),checkLatest=!1;exports.setupActionsPython=setupActionsPython; -//# sourceMappingURL=actions_python-DomaW1UO.js.map +"use strict";function _interopNamespaceDefault(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const r in t)if("default"!==r){const s=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,s.get?s:{enumerable:!0,get:()=>t[r]})}return e.default=t,Object.freeze(e)}function isDigit(t){return t>=CHAR_0&&CHAR_9>=t}function isHexit(t){return t>=CHAR_A&&CHAR_F>=t||t>=CHAR_a&&CHAR_f>=t||t>=CHAR_0&&CHAR_9>=t}function isBit(t){return t===CHAR_1||t===CHAR_0}function isOctit(t){return t>=CHAR_0&&CHAR_7>=t}function isAlphaNumQuoteHyphen(t){return t>=CHAR_A&&CHAR_Z>=t||t>=CHAR_a&&CHAR_z>=t||t>=CHAR_0&&CHAR_9>=t||t===CHAR_APOS||t===CHAR_QUOT||t===CHAR_LOWBAR||t===CHAR_HYPHEN}function isAlphaNumHyphen(t){return t>=CHAR_A&&CHAR_Z>=t||t>=CHAR_a&&CHAR_z>=t||t>=CHAR_0&&CHAR_9>=t||t===CHAR_LOWBAR||t===CHAR_HYPHEN}function hasKey(t,e){return!!hasOwnProperty.call(t,e)||("__proto__"===e&&defineProperty(t,"__proto__",descriptor),!1)}function InlineTable(){return Object.defineProperties({},{[_type]:{value:INLINE_TABLE}})}function isInlineTable(t){return null!==t&&"object"==typeof t&&t[_type]===INLINE_TABLE}function Table(){return Object.defineProperties({},{[_type]:{value:TABLE},[_declared]:{value:!1,writable:!0}})}function isTable(t){return null!==t&&"object"==typeof t&&t[_type]===TABLE}function InlineList(t){return Object.defineProperties([],{[_type]:{value:INLINE_LIST},[_contentType]:{value:t}})}function isInlineList(t){return null!==t&&"object"==typeof t&&t[_type]===INLINE_LIST}function List(){return Object.defineProperties([],{[_type]:{value:LIST}})}function isList(t){return null!==t&&"object"==typeof t&&t[_type]===LIST}function Integer(t){let e=Number(t);return Object.is(e,-0)&&(e=0),setupCpp.commonjsGlobal.BigInt&&!Number.isSafeInteger(e)?new BoxedBigInt(t):Object.defineProperties(new Number(e),{isNaN:{value:function(){return isNaN(this)}},[_type]:{value:INTEGER},[_inspect]:{value:()=>`[Integer: ${t}]`}})}function isInteger(t){return null!==t&&"object"==typeof t&&t[_type]===INTEGER}function Float(t){return Object.defineProperties(new Number(t),{[_type]:{value:FLOAT},[_inspect]:{value:()=>`[Float: ${t}]`}})}function isFloat(t){return null!==t&&"object"==typeof t&&t[_type]===FLOAT}function tomlType$1(t){const e=typeof t;if("object"===e){if(null===t)return"null";if(t instanceof Date)return"datetime";if(_type in t)switch(t[_type]){case INLINE_TABLE:return"inline-table";case INLINE_LIST:return"inline-list";case TABLE:return"table";case LIST:return"list";case FLOAT:return"float";case INTEGER:return"integer"}}return e}function makeParserClass(t){return class extends t{constructor(){super(),this.ctx=this.obj=Table()}atEndOfWord(){return this.char===CHAR_NUM||this.char===CTRL_I||this.char===CHAR_SP||this.atEndOfLine()}atEndOfLine(){return this.char===t.END||this.char===CTRL_J||this.char===CTRL_M}parseStart(){if(this.char===t.END)return null;if(this.char===CHAR_LSQB)return this.call(this.parseTableOrList);if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(isAlphaNumQuoteHyphen(this.char))return this.callNow(this.parseAssignStatement);throw this.error(new TomlError(`Unknown character "${this.char}"`))}parseWhitespaceToEOL(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(this.char===CHAR_NUM)return this.goto(this.parseComment);if(this.char===t.END||this.char===CTRL_J)return this.return();throw this.error(new TomlError("Unexpected character, expected only whitespace or comments till end of line"))}parseAssignStatement(){return this.callNow(this.parseAssign,this.recordAssignStatement)}recordAssignStatement(t){let e=this.ctx,r=t.key.pop();for(let s of t.key){if(hasKey(e,s)&&!isTable(e[s]))throw this.error(new TomlError("Can't redefine existing key"));e=e[s]=e[s]||Table()}if(hasKey(e,r))throw this.error(new TomlError("Can't redefine existing key"));return e[_declared]=!0,e[r]=isInteger(t.value)||isFloat(t.value)?t.value.valueOf():t.value,this.goto(this.parseWhitespaceToEOL)}parseAssign(){return this.callNow(this.parseKeyword,this.recordAssignKeyword)}recordAssignKeyword(t){return this.state.resultTable?this.state.resultTable.push(t):this.state.resultTable=[t],this.goto(this.parseAssignKeywordPreDot)}parseAssignKeywordPreDot(){return this.char===CHAR_PERIOD?this.next(this.parseAssignKeywordPostDot):this.char!==CHAR_SP&&this.char!==CTRL_I?this.goto(this.parseAssignEqual):void 0}parseAssignKeywordPostDot(){if(this.char!==CHAR_SP&&this.char!==CTRL_I)return this.callNow(this.parseKeyword,this.recordAssignKeyword)}parseAssignEqual(){if(this.char===CHAR_EQUALS)return this.next(this.parseAssignPreValue);throw this.error(new TomlError('Invalid character, expected "="'))}parseAssignPreValue(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseValue,this.recordAssignValue)}recordAssignValue(t){return this.returnNow({key:this.state.resultTable,value:t})}parseComment(){do{if(this.char===t.END||this.char===CTRL_J)return this.return();if(this.char===CHAR_DEL||CTRL_CHAR_BOUNDARY>=this.char&&this.char!==CTRL_I)throw this.errorControlCharIn("comments")}while(this.nextChar())}parseTableOrList(){if(this.char!==CHAR_LSQB)return this.goto(this.parseTable);this.next(this.parseList)}parseTable(){return this.ctx=this.obj,this.goto(this.parseTableNext)}parseTableNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseTableMore)}parseTableMore(t){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,t)&&(!isTable(this.ctx[t])||this.ctx[t][_declared]))throw this.error(new TomlError("Can't redefine existing key"));return this.ctx=this.ctx[t]=this.ctx[t]||Table(),this.ctx[_declared]=!0,this.next(this.parseWhitespaceToEOL)}if(this.char===CHAR_PERIOD){if(hasKey(this.ctx,t))if(isTable(this.ctx[t]))this.ctx=this.ctx[t];else{if(!isList(this.ctx[t]))throw this.error(new TomlError("Can't redefine existing key"));this.ctx=this.ctx[t][this.ctx[t].length-1]}else this.ctx=this.ctx[t]=Table();return this.next(this.parseTableNext)}throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseList(){return this.ctx=this.obj,this.goto(this.parseListNext)}parseListNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseListMore)}parseListMore(t){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,t)||(this.ctx[t]=List()),isInlineList(this.ctx[t]))throw this.error(new TomlError("Can't extend an inline array"));if(!isList(this.ctx[t]))throw this.error(new TomlError("Can't redefine an existing key"));{const e=Table();this.ctx[t].push(e),this.ctx=e}return this.next(this.parseListEnd)}if(this.char===CHAR_PERIOD){if(hasKey(this.ctx,t)){if(isInlineList(this.ctx[t]))throw this.error(new TomlError("Can't extend an inline array"));if(isInlineTable(this.ctx[t]))throw this.error(new TomlError("Can't extend an inline table"));if(isList(this.ctx[t]))this.ctx=this.ctx[t][this.ctx[t].length-1];else{if(!isTable(this.ctx[t]))throw this.error(new TomlError("Can't redefine an existing key"));this.ctx=this.ctx[t]}}else this.ctx=this.ctx[t]=Table();return this.next(this.parseListNext)}throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseListEnd(t){if(this.char===CHAR_RSQB)return this.next(this.parseWhitespaceToEOL);throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseValue(){if(this.char===t.END)throw this.error(new TomlError("Key without value"));if(this.char===CHAR_QUOT)return this.next(this.parseDoubleString);if(this.char===CHAR_APOS)return this.next(this.parseSingleString);if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)return this.goto(this.parseNumberSign);if(this.char===CHAR_i)return this.next(this.parseInf);if(this.char===CHAR_n)return this.next(this.parseNan);if(isDigit(this.char))return this.goto(this.parseNumberOrDateTime);if(this.char===CHAR_t||this.char===CHAR_f)return this.goto(this.parseBoolean);if(this.char===CHAR_LSQB)return this.call(this.parseInlineList,this.recordValue);if(this.char===CHAR_LCUB)return this.call(this.parseInlineTable,this.recordValue);throw this.error(new TomlError("Unexpected character, expecting string, number, datetime, boolean, inline array or inline table"))}recordValue(t){return this.returnNow(t)}parseInf(){if(this.char===CHAR_n)return this.next(this.parseInf2);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseInf2(){if(this.char===CHAR_f)return this.return("-"===this.state.buf?-1/0:1/0);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseNan(){if(this.char===CHAR_a)return this.next(this.parseNan2);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseNan2(){if(this.char===CHAR_n)return this.return(NaN);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseKeyword(){return this.char===CHAR_QUOT?this.next(this.parseBasicString):this.char===CHAR_APOS?this.next(this.parseLiteralString):this.goto(this.parseBareKey)}parseBareKey(){do{if(this.char===t.END)throw this.error(new TomlError("Key ended without value"));if(!isAlphaNumHyphen(this.char)){if(0===this.state.buf.length)throw this.error(new TomlError("Empty bare keys are not allowed"));return this.returnNow()}this.consume()}while(this.nextChar())}parseSingleString(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiStringMaybe):this.goto(this.parseLiteralString)}parseLiteralString(){do{if(this.char===CHAR_APOS)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));if(this.char===CHAR_DEL||CTRL_CHAR_BOUNDARY>=this.char&&this.char!==CTRL_I)throw this.errorControlCharIn("strings");this.consume()}while(this.nextChar())}parseLiteralMultiStringMaybe(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiString):this.returnNow()}parseLiteralMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseLiteralMultiStringContent):this.goto(this.parseLiteralMultiStringContent)}parseLiteralMultiStringContent(){do{if(this.char===CHAR_APOS)return this.next(this.parseLiteralMultiEnd);if(this.char===t.END)throw this.error(new TomlError("Unterminated multi-line string"));if(this.char===CHAR_DEL||CTRL_CHAR_BOUNDARY>=this.char&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharIn("strings");this.consume()}while(this.nextChar())}parseLiteralMultiEnd(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiEnd2):(this.state.buf+="'",this.goto(this.parseLiteralMultiStringContent))}parseLiteralMultiEnd2(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiEnd3):(this.state.buf+="''",this.goto(this.parseLiteralMultiStringContent))}parseLiteralMultiEnd3(){return this.char===CHAR_APOS?(this.state.buf+="'",this.next(this.parseLiteralMultiEnd4)):this.returnNow()}parseLiteralMultiEnd4(){return this.char===CHAR_APOS?(this.state.buf+="'",this.return()):this.returnNow()}parseDoubleString(){return this.char===CHAR_QUOT?this.next(this.parseMultiStringMaybe):this.goto(this.parseBasicString)}parseBasicString(){do{if(this.char===CHAR_BSOL)return this.call(this.parseEscape,this.recordEscapeReplacement);if(this.char===CHAR_QUOT)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));if(this.char===CHAR_DEL||CTRL_CHAR_BOUNDARY>=this.char&&this.char!==CTRL_I)throw this.errorControlCharIn("strings");this.consume()}while(this.nextChar())}recordEscapeReplacement(t){return this.state.buf+=t,this.goto(this.parseBasicString)}parseMultiStringMaybe(){return this.char===CHAR_QUOT?this.next(this.parseMultiString):this.returnNow()}parseMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseMultiStringContent):this.goto(this.parseMultiStringContent)}parseMultiStringContent(){do{if(this.char===CHAR_BSOL)return this.call(this.parseMultiEscape,this.recordMultiEscapeReplacement);if(this.char===CHAR_QUOT)return this.next(this.parseMultiEnd);if(this.char===t.END)throw this.error(new TomlError("Unterminated multi-line string"));if(this.char===CHAR_DEL||CTRL_CHAR_BOUNDARY>=this.char&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharIn("strings");this.consume()}while(this.nextChar())}errorControlCharIn(t){let e="\\u00";return 16>this.char&&(e+="0"),e+=this.char.toString(16),this.error(new TomlError(`Control characters (codes < 0x1f and 0x7f) are not allowed in ${t}, use ${e} instead`))}recordMultiEscapeReplacement(t){return this.state.buf+=t,this.goto(this.parseMultiStringContent)}parseMultiEnd(){return this.char===CHAR_QUOT?this.next(this.parseMultiEnd2):(this.state.buf+='"',this.goto(this.parseMultiStringContent))}parseMultiEnd2(){return this.char===CHAR_QUOT?this.next(this.parseMultiEnd3):(this.state.buf+='""',this.goto(this.parseMultiStringContent))}parseMultiEnd3(){return this.char===CHAR_QUOT?(this.state.buf+='"',this.next(this.parseMultiEnd4)):this.returnNow()}parseMultiEnd4(){return this.char===CHAR_QUOT?(this.state.buf+='"',this.return()):this.returnNow()}parseMultiEscape(){return this.char===CTRL_M||this.char===CTRL_J?this.next(this.parseMultiTrim):this.char===CHAR_SP||this.char===CTRL_I?this.next(this.parsePreMultiTrim):this.goto(this.parseEscape)}parsePreMultiTrim(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CTRL_M||this.char===CTRL_J)return this.next(this.parseMultiTrim);throw this.error(new TomlError("Can't escape whitespace"))}parseMultiTrim(){return this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M?null:this.returnNow()}parseEscape(){if(this.char in escapes)return this.return(escapes[this.char]);if(this.char===CHAR_u)return this.call(this.parseSmallUnicode,this.parseUnicodeReturn);if(this.char===CHAR_U)return this.call(this.parseLargeUnicode,this.parseUnicodeReturn);throw this.error(new TomlError("Unknown escape character: "+this.char))}parseUnicodeReturn(t){try{const e=parseInt(t,16);if(e>=SURROGATE_FIRST&&SURROGATE_LAST>=e)throw this.error(new TomlError("Invalid unicode, character in range 0xD800 - 0xDFFF is reserved"));return this.returnNow(String.fromCodePoint(e))}catch(e){throw this.error(TomlError.wrap(e))}}parseSmallUnicode(){if(!isHexit(this.char))throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"));if(this.consume(),this.state.buf.length>=4)return this.return()}parseLargeUnicode(){if(!isHexit(this.char))throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"));if(this.consume(),this.state.buf.length>=8)return this.return()}parseNumberSign(){return this.consume(),this.next(this.parseMaybeSignedInfOrNan)}parseMaybeSignedInfOrNan(){return this.char===CHAR_i?this.next(this.parseInf):this.char===CHAR_n?this.next(this.parseNan):this.callNow(this.parseNoUnder,this.parseNumberIntegerStart)}parseNumberIntegerStart(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberIntegerExponentOrDecimal)):this.goto(this.parseNumberInteger)}parseNumberIntegerExponentOrDecimal(){return this.char===CHAR_PERIOD?(this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat)):this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.returnNow(Integer(this.state.buf))}parseNumberInteger(){if(!isDigit(this.char)){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder);if(this.char===CHAR_E||this.char===CHAR_e)return this.consume(),this.next(this.parseNumberExponentSign);if(this.char===CHAR_PERIOD)return this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat);{const t=Integer(this.state.buf);if(t.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(t)}}this.consume()}parseNoUnder(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD||this.char===CHAR_E||this.char===CHAR_e)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNoUnderHexOctBinLiteral(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNumberFloat(){return this.char===CHAR_LOWBAR?this.call(this.parseNoUnder,this.parseNumberFloat):isDigit(this.char)?void this.consume():this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.returnNow(Float(this.state.buf))}parseNumberExponentSign(){if(isDigit(this.char))return this.goto(this.parseNumberExponent);if(this.char!==CHAR_HYPHEN&&this.char!==CHAR_PLUS)throw this.error(new TomlError("Unexpected character, expected -, + or digit"));this.consume(),this.call(this.parseNoUnder,this.parseNumberExponent)}parseNumberExponent(){if(!isDigit(this.char))return this.char===CHAR_LOWBAR?this.call(this.parseNoUnder):this.returnNow(Float(this.state.buf));this.consume()}parseNumberOrDateTime(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberBaseOrDateTime)):this.goto(this.parseNumberOrDateTimeOnly)}parseNumberOrDateTimeOnly(){return this.char===CHAR_LOWBAR?this.call(this.parseNoUnder,this.parseNumberInteger):isDigit(this.char)?(this.consume(),void(this.state.buf.length>4&&this.next(this.parseNumberInteger))):this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.char===CHAR_PERIOD?(this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat)):this.char===CHAR_HYPHEN?this.goto(this.parseDateTime):this.char===CHAR_COLON?this.goto(this.parseOnlyTimeHour):this.returnNow(Integer(this.state.buf))}parseDateTimeOnly(){if(4>this.state.buf.length){if(isDigit(this.char))return this.consume();if(this.char===CHAR_COLON)return this.goto(this.parseOnlyTimeHour);throw this.error(new TomlError("Expected digit while parsing year part of a date"))}if(this.char===CHAR_HYPHEN)return this.goto(this.parseDateTime);throw this.error(new TomlError("Expected hyphen (-) while parsing year part of date"))}parseNumberBaseOrDateTime(){return this.char===CHAR_b?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerBin)):this.char===CHAR_o?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerOct)):this.char===CHAR_x?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerHex)):this.char===CHAR_PERIOD?this.goto(this.parseNumberInteger):isDigit(this.char)?this.goto(this.parseDateTimeOnly):this.returnNow(Integer(this.state.buf))}parseIntegerHex(){if(!isHexit(this.char)){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{const t=Integer(this.state.buf);if(t.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(t)}}this.consume()}parseIntegerOct(){if(!isOctit(this.char)){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{const t=Integer(this.state.buf);if(t.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(t)}}this.consume()}parseIntegerBin(){if(!isBit(this.char)){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{const t=Integer(this.state.buf);if(t.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(t)}}this.consume()}parseDateTime(){if(4>this.state.buf.length)throw this.error(new TomlError("Years less than 1000 must be zero padded to four characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseDateMonth)}parseDateMonth(){if(this.char===CHAR_HYPHEN){if(2>this.state.buf.length)throw this.error(new TomlError("Months less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseDateDay)}if(!isDigit(this.char))throw this.error(new TomlError("Incomplete datetime"));this.consume()}parseDateDay(){if(this.char===CHAR_T||this.char===CHAR_SP){if(2>this.state.buf.length)throw this.error(new TomlError("Days less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseStartTimeHour)}if(this.atEndOfWord())return this.returnNow(createDate(this.state.result+"-"+this.state.buf));if(!isDigit(this.char))throw this.error(new TomlError("Incomplete datetime"));this.consume()}parseStartTimeHour(){return this.atEndOfWord()?this.returnNow(createDate(this.state.result)):this.goto(this.parseTimeHour)}parseTimeHour(){if(this.char===CHAR_COLON){if(2>this.state.buf.length)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result+="T"+this.state.buf,this.state.buf="",this.next(this.parseTimeMin)}if(!isDigit(this.char))throw this.error(new TomlError("Incomplete datetime"));this.consume()}parseTimeMin(){if(this.state.buf.length>=2||!isDigit(this.char)){if(2===this.state.buf.length&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeSec);throw this.error(new TomlError("Incomplete datetime"))}this.consume()}parseTimeSec(){if(!isDigit(this.char))throw this.error(new TomlError("Incomplete datetime"));if(this.consume(),2===this.state.buf.length)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeZoneOrFraction)}parseOnlyTimeHour(){if(this.char===CHAR_COLON){if(2>this.state.buf.length)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeMin)}throw this.error(new TomlError("Incomplete time"))}parseOnlyTimeMin(){if(this.state.buf.length>=2||!isDigit(this.char)){if(2===this.state.buf.length&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeSec);throw this.error(new TomlError("Incomplete time"))}this.consume()}parseOnlyTimeSec(){if(!isDigit(this.char))throw this.error(new TomlError("Incomplete time"));if(this.consume(),2===this.state.buf.length)return this.next(this.parseOnlyTimeFractionMaybe)}parseOnlyTimeFractionMaybe(){if(this.state.result+=":"+this.state.buf,this.char!==CHAR_PERIOD)return this.return(createTime(this.state.result));this.state.buf="",this.next(this.parseOnlyTimeFraction)}parseOnlyTimeFraction(){if(!isDigit(this.char)){if(this.atEndOfWord()){if(0===this.state.buf.length)throw this.error(new TomlError("Expected digit in milliseconds"));return this.returnNow(createTime(this.state.result+"."+this.state.buf))}throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}this.consume()}parseTimeZoneOrFraction(){if(this.char===CHAR_PERIOD)this.consume(),this.next(this.parseDateTimeFraction);else{if(this.char!==CHAR_HYPHEN&&this.char!==CHAR_PLUS){if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}this.consume(),this.next(this.parseTimeZoneHour)}}parseDateTimeFraction(){if(isDigit(this.char))this.consume();else{if(1===this.state.buf.length)throw this.error(new TomlError("Expected digit in milliseconds"));if(this.char!==CHAR_HYPHEN&&this.char!==CHAR_PLUS){if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}this.consume(),this.next(this.parseTimeZoneHour)}}parseTimeZoneHour(){if(!isDigit(this.char))throw this.error(new TomlError("Unexpected character in datetime, expected digit"));if(this.consume(),/\d\d$/.test(this.state.buf))return this.next(this.parseTimeZoneSep)}parseTimeZoneSep(){if(this.char!==CHAR_COLON)throw this.error(new TomlError("Unexpected character in datetime, expected colon"));this.consume(),this.next(this.parseTimeZoneMin)}parseTimeZoneMin(){if(!isDigit(this.char))throw this.error(new TomlError("Unexpected character in datetime, expected digit"));if(this.consume(),/\d\d$/.test(this.state.buf))return this.return(createDateTime(this.state.result+this.state.buf))}parseBoolean(){return this.char===CHAR_t?(this.consume(),this.next(this.parseTrue_r)):this.char===CHAR_f?(this.consume(),this.next(this.parseFalse_a)):void 0}parseTrue_r(){if(this.char===CHAR_r)return this.consume(),this.next(this.parseTrue_u);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_u(){if(this.char===CHAR_u)return this.consume(),this.next(this.parseTrue_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_e(){if(this.char===CHAR_e)return this.return(!0);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_a(){if(this.char===CHAR_a)return this.consume(),this.next(this.parseFalse_l);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_l(){if(this.char===CHAR_l)return this.consume(),this.next(this.parseFalse_s);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_s(){if(this.char===CHAR_s)return this.consume(),this.next(this.parseFalse_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_e(){if(this.char===CHAR_e)return this.return(!1);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseInlineList(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===t.END)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_NUM?this.call(this.parseComment):this.char===CHAR_RSQB?this.return(this.state.resultArr||InlineList()):this.callNow(this.parseValue,this.recordInlineListValue)}recordInlineListValue(t){return this.state.resultArr||(this.state.resultArr=InlineList(tomlType$1(t))),isFloat(t)||isInteger(t)?this.state.resultArr.push(t.valueOf()):this.state.resultArr.push(t),this.goto(this.parseInlineListNext)}parseInlineListNext(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CHAR_COMMA)return this.next(this.parseInlineList);if(this.char===CHAR_RSQB)return this.goto(this.parseInlineList);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}parseInlineTable(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===t.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_RCUB?this.return(this.state.resultTable||InlineTable()):(this.state.resultTable||(this.state.resultTable=InlineTable()),this.callNow(this.parseAssign,this.recordInlineTableValue))}recordInlineTableValue(t){let e=this.state.resultTable,r=t.key.pop();for(let s of t.key){if(hasKey(e,s)&&(!isTable(e[s])||e[s][_declared]))throw this.error(new TomlError("Can't redefine existing key"));e=e[s]=e[s]||Table()}if(hasKey(e,r))throw this.error(new TomlError("Can't redefine existing key"));return e[r]=isInteger(t.value)||isFloat(t.value)?t.value.valueOf():t.value,this.goto(this.parseInlineTableNext)}parseInlineTableNext(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===t.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));if(this.char===CHAR_COMMA)return this.next(this.parseInlineTablePostComma);if(this.char===CHAR_RCUB)return this.goto(this.parseInlineTable);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}parseInlineTablePostComma(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===t.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));if(this.char===CHAR_COMMA)throw this.error(new TomlError("Empty elements in inline tables are not permitted"));if(this.char===CHAR_RCUB)throw this.error(new TomlError("Trailing commas in inline tables are not permitted"));return this.goto(this.parseInlineTable)}}}function prettyError$2(t,e){if(null==t.pos||null==t.line)return t;let r=t.message;if(r+=` at row ${t.line+1}, col ${t.col+1}, pos ${t.pos}:\n`,e&&e.split){const s=e.split(/\n/),i=(Math.min(s.length,t.line+3)+"").length;let n=" ";for(;i>n.length;)n+=" ";for(let e=Math.max(0,t.line-1);Math.min(s.length,t.line+2)>e;++e){let a=e+1+"";if(i>a.length&&(a=" "+a),t.line===e){r+=a+"> "+s[e]+"\n",r+=n+" ";for(let e=0;t.col>e;++e)r+=" ";r+="^\n"}else r+=a+": "+s[e]+"\n"}}return t.message=r+"\n",t}function parseString(t){setupCpp.commonjsGlobal.Buffer&&setupCpp.commonjsGlobal.Buffer.isBuffer(t)&&(t=t.toString("utf8"));const e=new TOMLParser$2;try{return e.parse(t),e.finish()}catch(r){throw prettyError$1(r,t)}}function parseAsync(t,e){function r(e,s,n,a){if(e>=t.length)try{return n(i.finish())}catch(o){return a(prettyError(o,t))}try{i.parse(t.slice(e,e+s)),setImmediate(r,e+s,s,n,a)}catch(o){a(prettyError(o,t))}}e||(e={});const s=e.blocksize||40960,i=new TOMLParser$1;return new Promise(((t,e)=>{setImmediate(r,0,s,t,e)}))}function parseStream(t){return t?parseReadable(t):parseTransform()}function parseReadable(t){const e=new TOMLParser;return t.setEncoding("utf8"),new Promise(((r,s)=>{function i(){if(o=!0,!a)try{r(e.finish())}catch(t){s(t)}}function n(t){h=!0,s(t)}let a,o=!1,h=!1;t.once("end",i),t.once("error",n),function r(){let s;for(a=!0;null!==(s=t.read());)try{e.parse(s)}catch(c){return n(c)}if(a=!1,o)return i();h||t.once("readable",r)}()}))}function parseTransform(){const t=new TOMLParser;return new stream.Transform({objectMode:!0,transform(e,r,s){try{t.parse(e.toString(r))}catch(i){this.emit("error",i)}s()},flush(e){try{this.push(t.finish())}catch(r){this.emit("error",r)}e()}})}function stringify(t){if(null===t)throw typeError("null");if(void 0===t)throw typeError("undefined");if("object"!=typeof t)throw typeError(typeof t);if("function"==typeof t.toJSON&&(t=t.toJSON()),null==t)return null;const e=tomlType(t);if("table"!==e)throw typeError(e);return stringifyObject("","",t)}function typeError(t){return Error("Can only stringify objects, not "+t)}function getInlineKeys(t){return Object.keys(t).filter((e=>isInline(t[e])))}function getComplexKeys(t){return Object.keys(t).filter((e=>!isInline(t[e])))}function toJSON(t){let e=Array.isArray(t)?[]:{}.hasOwnProperty.call(t,"__proto__")?{["__proto__"]:void 0}:{};for(let r of Object.keys(t))e[r]=t[r]&&"function"==typeof t[r].toJSON&&!("toISOString"in t[r])?t[r].toJSON():t[r];return e}function stringifyObject(t,e,r){let s,i;s=getInlineKeys(r=toJSON(r)),i=getComplexKeys(r);const n=[],a=e||"";s.forEach((t=>{var e=tomlType(r[t]);"undefined"!==e&&"null"!==e&&n.push(a+stringifyKey(t)+" = "+stringifyAnyInline(r[t],!0))})),n.length>0&&n.push("");const o=t&&s.length>0?e+" ":"";return i.forEach((e=>{n.push(stringifyComplex(t,o,e,r[e]))})),n.join("\n")}function isInline(t){switch(tomlType(t)){case"undefined":case"null":case"integer":case"nan":case"float":case"boolean":case"string":case"datetime":return!0;case"array":return 0===t.length||"table"!==tomlType(t[0]);case"table":return 0===Object.keys(t).length;default:return!1}}function tomlType(t){return void 0===t?"undefined":null===t?"null":"bigint"==typeof t||Number.isInteger(t)&&!Object.is(t,-0)?"integer":"number"==typeof t?"float":"boolean"==typeof t?"boolean":"string"==typeof t?"string":"toISOString"in t?isNaN(t)?"undefined":"datetime":Array.isArray(t)?"array":"table"}function stringifyKey(t){const e=t+"";return/^[-A-Za-z0-9_]+$/.test(e)?e:stringifyBasicString(e)}function stringifyBasicString(t){return'"'+escapeString(t).replace(/"/g,'\\"')+'"'}function stringifyLiteralString(t){return"'"+t+"'"}function numpad(t,e){for(;t>e.length;)e="0"+e;return e}function escapeString(t){return t.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/([\u0000-\u001f\u007f])/,(t=>"\\u"+numpad(4,t.codePointAt(0).toString(16))))}function stringifyMultilineString(t){let e=t.split(/\n/).map((t=>escapeString(t).replace(/"(?="")/g,'\\"'))).join("\n");return'"'===e.slice(-1)&&(e+="\\\n"),'"""\n'+e+'"""'}function stringifyAnyInline(t,e){let r=tomlType(t);return"string"===r&&(e&&/\n/.test(t)?r="string-multiline":!/[\b\t\n\f\r']/.test(t)&&/"/.test(t)&&(r="string-literal")),stringifyInline(t,r)}function stringifyInline(t,e){switch(e||(e=tomlType(t)),e){case"string-multiline":return stringifyMultilineString(t);case"string":return stringifyBasicString(t);case"string-literal":return stringifyLiteralString(t);case"integer":return stringifyInteger(t);case"float":return stringifyFloat(t);case"boolean":return stringifyBoolean(t);case"datetime":return stringifyDatetime(t);case"array":return stringifyInlineArray(t.filter((t=>"null"!==tomlType(t)&&"undefined"!==tomlType(t)&&"nan"!==tomlType(t))));case"table":return stringifyInlineTable(t);default:throw typeError(e)}}function stringifyInteger(t){return(t+"").replace(/\B(?=(\d{3})+(?!\d))/g,"_")}function stringifyFloat(t){if(t===1/0)return"inf";if(t===-1/0)return"-inf";if(Object.is(t,NaN))return"nan";if(Object.is(t,-0))return"-0.0";const[e,r]=(t+"").split(".");return stringifyInteger(e)+"."+r}function stringifyBoolean(t){return t+""}function stringifyDatetime(t){return t.toISOString()}function stringifyInlineArray(t){let e="[";const r=(t=toJSON(t)).map((t=>stringifyInline(t)));return r.join(", ").length>60||/\n/.test(r)?e+="\n "+r.join(",\n ")+"\n":e+=" "+r.join(", ")+(r.length>0?" ":""),e+"]"}function stringifyInlineTable(t){t=toJSON(t);const e=[];return Object.keys(t).forEach((r=>{e.push(stringifyKey(r)+" = "+stringifyAnyInline(t[r],!1))})),"{ "+e.join(", ")+(e.length>0?" ":"")+"}"}function stringifyComplex(t,e,r,s){const i=tomlType(s);if("array"===i)return stringifyArrayOfTables(t,e,r,s);if("table"===i)return stringifyComplexTable(t,e,r,s);throw typeError(i)}function stringifyArrayOfTables(t,e,r,s){const i=tomlType((s=toJSON(s))[0]);if("table"!==i)throw typeError(i);const n=t+stringifyKey(r);let a="";return s.forEach((t=>{a.length>0&&(a+="\n"),a+=e+"[["+n+"]]\n",a+=stringifyObject(n+".",e,t)})),a}function stringifyComplexTable(t,e,r,s){const i=t+stringifyKey(r);let n="";return getInlineKeys(s).length>0&&(n+=e+"["+i+"]\n"),n+stringifyObject(i+".",e,s)}function createSymlinkInFolder(t,e,r,s=!1){const i=path__namespace.join(t,e),n=path__namespace.join(t,r);fs.existsSync(n)||(fs.symlinkSync(i,n),!IS_WINDOWS&&s&&fs.chmodSync(n,"755"))}function validateVersion(t){return isNightlyKeyword(t)||!!setupCpp.semver.validRange(t)}function isNightlyKeyword(t){return"nightly"===t}function getPyPyVersionFromPath(t){return path__namespace.basename(path__namespace.dirname(t))}function readExactPyPyVersionFile(t){let e="";const r=path__namespace.join(t,PYPY_VERSION_FILE);return fs.existsSync(r)&&(e=(""+fs.readFileSync(r)).trim()),e}function writeExactPyPyVersionFile(t,e){const r=path__namespace.join(t,PYPY_VERSION_FILE);fs.writeFileSync(r,e)}function validatePythonVersionFormatForPyPy(t){return/^\d+\.\d+$/.test(t)}async function getWindowsInfo(){const{stdout:t}=await setupCpp.getExecOutput_1('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"',void 0,{silent:!0});return{osName:"Windows",osVersion:t.trim().split(" ")[3]}}async function getMacOSInfo(){const{stdout:t}=await setupCpp.getExecOutput_1("sw_vers",["-productVersion"],{silent:!0});return{osName:"macOS",osVersion:t.trim()}}async function getLinuxInfo(){const{stdout:t}=await setupCpp.getExecOutput_1("lsb_release",["-i","-r","-s"],{silent:!0}),[e,r]=t.trim().split("\n");return setupCpp.coreExports.debug(`OS Name: ${e}, Version: ${r}`),{osName:e,osVersion:r}}async function getOSInfo(){let t;try{IS_WINDOWS?t=await getWindowsInfo():IS_LINUX?t=await getLinuxInfo():IS_MAC&&(t=await getMacOSInfo())}catch(e){setupCpp.coreExports.debug(e.message)}finally{return t}}function getBinaryDirectory(t){return IS_WINDOWS?t:path__namespace.join(t,"bin")}function getDownloadFileName(t){const e=process.env.RUNNER_TEMP||".";return IS_WINDOWS?path__namespace.join(e,path__namespace.basename(t)):void 0}async function installPyPy(t,e,r,s,i){let n;if(!(i=null!=i?i:await getAvailablePyPyVersions())||0===i.length)throw Error("No release was found in PyPy version.json");let a=findRelease(i,e,t,r,!1);if(!a||!a.foundAsset)throw Error(`PyPy version ${e} (${t}) with arch ${r} not found`);const{foundAsset:o,resolvedPythonVersion:h,resolvedPyPyVersion:c}=a,p=""+o.download_url;setupCpp.coreExports.info(`Downloading PyPy from "${p}" ...`);try{const t=getDownloadFileName(p),e=await setupCpp.downloadTool_1(p,t);setupCpp.coreExports.info("Extracting downloaded archive..."),n=IS_WINDOWS?await setupCpp.extractZip_1(e):await setupCpp.extractTar_1(e,void 0,"x");const s=fs.readdirSync(n)[0],i=path__namespace.join(n,s);let a=i;isNightlyKeyword(c)||(a=await setupCpp.cacheDir_1(i,"PyPy",h,r)),writeExactPyPyVersionFile(a,c);const o=getBinaryDirectory(a);return await createPyPySymlink(o,h),await installPip(o),{installDir:a,resolvedPythonVersion:h,resolvedPyPyVersion:c}}catch(l){throw l instanceof Error&&(setupCpp.coreExports.info(l instanceof setupCpp.HTTPError_1&&(403===l.httpStatusCode||429===l.httpStatusCode)?`Received HTTP status code ${l.httpStatusCode}. This usually indicates the rate limit has been exceeded`:l.message),void 0!==l.stack&&setupCpp.coreExports.debug(l.stack)),l}}async function getAvailablePyPyVersions(){const t="https://downloads.python.org/pypy/versions.json",e=new setupCpp.HttpClient("tool-cache"),r=await e.getJson(t);if(!r.result)throw Error(`Unable to retrieve the list of available PyPy versions from '${t}'`);return r.result}async function createPyPySymlink(t,e){const r=setupCpp.semver.coerce(e),s=setupCpp.semver.major(r),i=2===s?"":"3",n=`${s}.${setupCpp.semver.minor(r)}`,a=IS_WINDOWS?".exe":"";setupCpp.coreExports.info("Creating symlinks..."),createSymlinkInFolder(t,`pypy${i}${a}`,`python${s}${a}`,!0),createSymlinkInFolder(t,`pypy${i}${a}`,"python"+a,!0),createSymlinkInFolder(t,`pypy${i}${a}`,`pypy${n}${a}`,!0)}async function installPip(t){setupCpp.coreExports.info("Installing and updating pip");const e=path__namespace.join(t,"python");await setupCpp.exec_2(e+" -m ensurepip"),await setupCpp.exec_2(t+"/python -m pip install --ignore-installed pip")}function findRelease(t,e,r,s,i){const n={includePrerelease:i},a=t.filter((t=>{const i=setupCpp.semver.satisfies(setupCpp.semver.coerce(t.python_version),e),a=isNightlyKeyword(r)&&isNightlyKeyword(t.pypy_version)||setupCpp.semver.satisfies(pypyVersionToSemantic(t.pypy_version),r,n),o=t.files&&(IS_WINDOWS?isArchPresentForWindows(t,s):isArchPresentForMacOrLinux(t,s,process.platform));return i&&a&&o}));if(0===a.length)return null;const o=a.sort(((t,e)=>setupCpp.semver.compare(setupCpp.semver.coerce(pypyVersionToSemantic(e.pypy_version)),setupCpp.semver.coerce(pypyVersionToSemantic(t.pypy_version)))||setupCpp.semver.compare(setupCpp.semver.coerce(e.python_version),setupCpp.semver.coerce(t.python_version))))[0];return{foundAsset:IS_WINDOWS?findAssetForWindows(o,s):findAssetForMacOrLinux(o,s,process.platform),resolvedPythonVersion:o.python_version,resolvedPyPyVersion:o.pypy_version.trim()}}function pypyVersionToSemantic(t){return t.replace(/(\d+\.\d+\.\d+)((?:a|b|rc))(\d*)/g,"$1-$2.$3")}function isArchPresentForWindows(t,e){return e=replaceX32toX86(e),t.files.some((t=>WINDOWS_PLATFORMS.includes(t.platform)&&t.arch===e))}function isArchPresentForMacOrLinux(t,e,r){return t.files.some((t=>t.arch===e&&t.platform===r))}function findAssetForWindows(t,e){return e=replaceX32toX86(e),t.files.find((t=>WINDOWS_PLATFORMS.includes(t.platform)&&t.arch===e))}function findAssetForMacOrLinux(t,e,r){return t.files.find((t=>t.arch===e&&t.platform===r))}function replaceX32toX86(t){return"x32"===t&&(t="x86"),t}async function findPyPyVersion(t,e,r,s,i){let n,a="",o="";const h=parsePyPyVersion(t);({installDir:n,resolvedPythonVersion:o,resolvedPyPyVersion:a}=findPyPyToolCache(h.pythonVersion,h.pypyVersion,e)),n||({installDir:n,resolvedPythonVersion:o,resolvedPyPyVersion:a}=await installPyPy(h.pypyVersion,h.pythonVersion,e,i,void 0));const c=path__namespace.join(n,IS_WINDOWS?"Scripts":"bin"),p=path__namespace.join(IS_WINDOWS?n:c,"python"+(IS_WINDOWS?".exe":"")),l=getBinaryDirectory(n);return setupCpp.coreExports.exportVariable("pythonLocation",n),setupCpp.coreExports.exportVariable("Python_ROOT_DIR",n),setupCpp.coreExports.exportVariable("Python2_ROOT_DIR",n),setupCpp.coreExports.exportVariable("Python3_ROOT_DIR",n),setupCpp.coreExports.exportVariable("PKG_CONFIG_PATH",l+"/lib/pkgconfig"),setupCpp.coreExports.addPath(l),setupCpp.coreExports.addPath(c),setupCpp.coreExports.setOutput("python-version","pypy"+a),setupCpp.coreExports.setOutput("python-path",p),{resolvedPyPyVersion:a,resolvedPythonVersion:o}}function findPyPyToolCache(t,e,r){let s="",i="",n=IS_WINDOWS?findPyPyInstallDirForWindows(t):setupCpp.find_1("PyPy",t,r);return n&&(i=getPyPyVersionFromPath(n),s=readExactPyPyVersionFile(n),setupCpp.semver.satisfies(s,e)||(n=null,s="",i="")),n||setupCpp.coreExports.info(`PyPy version ${t} (${e}) was not found in the local cache`),{installDir:n,resolvedPythonVersion:i,resolvedPyPyVersion:s}}function parsePyPyVersion(t){const e=t.split("-").filter((t=>!!t));if(/^(pypy)(.+)/.test(e[0])){const t=e[0].replace("pypy","");e.splice(0,1,"pypy",t)}if(2>e.length||"pypy"!=e[0])throw Error("Invalid 'version' property for PyPy. PyPy version should be specified as 'pypy' or 'pypy-'. See README for examples and documentation.");const r=e[1];let s;if(s=e.length>2?pypyVersionToSemantic(e[2]):"x",!validateVersion(r)||!validateVersion(s))throw Error("Invalid 'version' property for PyPy. Both Python version and PyPy versions should satisfy SemVer notation. See README for examples and documentation.");if(!validatePythonVersionFormatForPyPy(r))throw Error("Invalid format of Python version for PyPy. Python version should be specified in format 'x.y'. See README for examples and documentation.");return{pypyVersion:s,pythonVersion:r}}function findPyPyInstallDirForWindows(t){let e="";return WINDOWS_ARCHS.forEach((r=>e=e||setupCpp.find_1("PyPy",t,r))),e}async function findReleaseFromManifest(t,e,r){return r||(r=await getManifest()),await setupCpp.findFromManifest_1(t,!1,r,e)}async function getManifest(){try{return await getManifestFromRepo()}catch(t){setupCpp.coreExports.debug("Fetching the manifest via the API failed."),t instanceof Error&&setupCpp.coreExports.debug(t.message)}return await getManifestFromURL()}function getManifestFromRepo(){return setupCpp.coreExports.debug(`Getting manifest from ${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}@${MANIFEST_REPO_BRANCH}`),setupCpp.getManifestFromRepo_1(MANIFEST_REPO_OWNER,MANIFEST_REPO_NAME,AUTH,MANIFEST_REPO_BRANCH)}async function getManifestFromURL(){setupCpp.coreExports.debug("Falling back to fetching the manifest using raw URL.");const t=new setupCpp.HttpClient("tool-cache"),e=await t.getJson(MANIFEST_URL);if(!e.result)throw Error("Unable to get manifest from "+MANIFEST_URL);return e.result}async function installPython(t){const e={cwd:t,env:{...process.env,...IS_LINUX&&{LD_LIBRARY_PATH:path__namespace.join(t,"lib")}},silent:!0,listeners:{stdout:t=>{setupCpp.coreExports.info((""+t).trim())},stderr:t=>{setupCpp.coreExports.error((""+t).trim())}}};IS_WINDOWS?await setupCpp.exec_2("powershell",["./setup.ps1"],e):await setupCpp.exec_2("bash",["./setup.sh"],e)}async function installCpythonFromRelease(t){const e=t.files[0].download_url;setupCpp.coreExports.info(`Download from "${e}"`);let r="";try{const t=getDownloadFileName(e);let s;r=await setupCpp.downloadTool_1(e,t,AUTH),setupCpp.coreExports.info("Extract downloaded archive"),s=IS_WINDOWS?await setupCpp.extractZip_1(r):await setupCpp.extractTar_1(r),setupCpp.coreExports.info("Execute installation script"),await installPython(s)}catch(s){throw s instanceof setupCpp.HTTPError_1&&(setupCpp.coreExports.info(403===s.httpStatusCode||429===s.httpStatusCode?`Received HTTP status code ${s.httpStatusCode}. This usually indicates the rate limit has been exceeded`:s.message),s.stack&&setupCpp.coreExports.debug(s.stack)),s}}function binDir(t){return path__namespace.join(t,IS_WINDOWS?"Scripts":"bin")}async function useCpythonVersion(t,e,r,s,i){let n=pythonVersionToSemantic(desugarDevVersion(t));setupCpp.coreExports.debug(`Semantic version spec of ${t} is ${n}`);let a=setupCpp.find_1("Python",n,e);if(!a){setupCpp.coreExports.info(`Version ${n} was not found in the local cache`);const t=await findReleaseFromManifest(n,e,null);t&&t.files&&t.files.length>0&&(setupCpp.coreExports.info(`Version ${n} is available for downloading`),await installCpythonFromRelease(t),a=setupCpp.find_1("Python",n,e))}if(!a){const r=await getOSInfo();throw Error([`The version '${t}' with architecture '${e}' was not found for ${r?`${r.osName} ${r.osVersion}`:"this operating system"}.`,"The list of all available versions can be found here: "+MANIFEST_URL].join(os__namespace.EOL))}const o=binDir(a),h=path__namespace.join(IS_WINDOWS?a:o,"python"+(IS_WINDOWS?".exe":""));if(setupCpp.coreExports.exportVariable("pythonLocation",a),setupCpp.coreExports.exportVariable("PKG_CONFIG_PATH",a+"/lib/pkgconfig"),setupCpp.coreExports.exportVariable("pythonLocation",a),setupCpp.coreExports.exportVariable("Python_ROOT_DIR",a),setupCpp.coreExports.exportVariable("Python2_ROOT_DIR",a),setupCpp.coreExports.exportVariable("Python3_ROOT_DIR",a),setupCpp.coreExports.exportVariable("PKG_CONFIG_PATH",a+"/lib/pkgconfig"),IS_LINUX){const t=process.env.LD_LIBRARY_PATH?":"+process.env.LD_LIBRARY_PATH:"",e=path__namespace.join(a,"lib");t.split(":").includes(e)||setupCpp.coreExports.exportVariable("LD_LIBRARY_PATH",e+t)}if(setupCpp.coreExports.addPath(a),setupCpp.coreExports.addPath(o),IS_WINDOWS){const t=path__namespace.basename(path__namespace.dirname(a)),e=setupCpp.semver.major(t),r=setupCpp.semver.minor(t),s=path__namespace.join(process.env.APPDATA||"","Python",`Python${e}${r}`,"Scripts");setupCpp.coreExports.addPath(s)}const c=versionFromPath(a);return setupCpp.coreExports.setOutput("python-version",c),setupCpp.coreExports.setOutput("python-path",h),{impl:"CPython",version:c}}function desugarDevVersion(t){return t.replace(/^(\d+)\.(\d+)-dev$/,"~$1.$2.0-0")}function versionFromPath(t){const e=t.split(path__namespace.sep),r=e.findIndex((t=>"PyPy"===t||"Python"===t));return e[r+1]||""}function pythonVersionToSemantic(t,e){return t.replace(/(\d+\.\d+\.\d+)((?:a|b|rc)\d*)/g,"$1-$2")}function isPyPyVersion(t){return t.startsWith("pypy")}async function setupActionsPython(t,e,r){var s;IS_MAC&&(process.env.AGENT_TOOLSDIRECTORY="/Users/runner/hostedtoolcache");const i=null==(s=process.env.AGENT_TOOLSDIRECTORY)?void 0:s.trim();if("string"==typeof i&&""!==i&&(process.env.RUNNER_TOOL_CACHE=process.env.AGENT_TOOLSDIRECTORY),setupCpp.coreExports.debug("Python is expected to be installed into "+process.env.RUNNER_TOOL_CACHE),t){let e;if(isPyPyVersion(t)){const s=await findPyPyVersion(t,r,!0,checkLatest,!1);e=`${s.resolvedPyPyVersion}-${s.resolvedPythonVersion}`,setupCpp.info(`Successfully set up PyPy ${s.resolvedPyPyVersion} with Python (${s.resolvedPythonVersion})`)}else{const s=await useCpythonVersion(t,r);e=s.version,setupCpp.info(`Successfully set up ${s.impl} (${e})`)}}setupCpp.ciInfo.GITHUB_ACTIONS&&await addPythonLoggingMatcher()}async function addPythonLoggingMatcher(){const t=path.join(dirname,"python_matcher.json");if(!(await setupCpp.pathExists(t)))return setupCpp.warning("the python_matcher.json file does not exist in the same folder as setup-cpp.js");setupCpp.info("::add-matcher::"+t)}Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const path=require("path"),require$$1=require("url"),setupCpp=require("../setup-cpp.js"),fs=require("fs"),require$$0=require("stream"),os=require("os");require("crypto"),require("http"),require("https"),require("net"),require("tls"),require("events"),require("util"),require("buffer"),require("process"),require("child_process"),require("assert"),require("string_decoder"),require("timers"),require("console");var _documentCurrentScript="undefined"!=typeof document?document.currentScript:null;const path__namespace=_interopNamespaceDefault(path),os__namespace=_interopNamespaceDefault(os);var parse={exports:{}},tomlParser={exports:{}};const ParserEND=1114112;class ParserError extends Error{constructor(t,e,r){super("[ParserError] "+t,e,r),this.name="ParserError",this.code="ParserError",Error.captureStackTrace&&Error.captureStackTrace(this,ParserError)}}class State{constructor(t){this.parser=t,this.buf="",this.returned=null,this.result=null,this.resultTable=null,this.resultArr=null}}class Parser{constructor(){this.pos=0,this.col=0,this.line=0,this.obj={},this.ctx=this.obj,this.stack=[],this._buf="",this.char=null,this.ii=0,this.state=new State(this.parseStart)}parse(t){if(0===t.length||null==t.length)return;let e;for(this._buf=t+"",this.ii=-1,this.char=-1;!1===e||this.nextChar();)e=this.runOne();this._buf=null}nextChar(){return 10===this.char&&(++this.line,this.col=-1),++this.ii,this.char=this._buf.codePointAt(this.ii),++this.pos,++this.col,this.haveBuffer()}haveBuffer(){return this._buf.length>this.ii}runOne(){return this.state.parser.call(this,this.state.returned)}finish(){let t;this.char=ParserEND;do{t=this.state.parser,this.runOne()}while(this.state.parser!==t);return this.ctx=null,this.state=null,this._buf=null,this.obj}next(t){if("function"!=typeof t)throw new ParserError("Tried to set state to non-existent state: "+JSON.stringify(t));this.state.parser=t}goto(t){return this.next(t),this.runOne()}call(t,e){e&&this.next(e),this.stack.push(this.state),this.state=new State(t)}callNow(t,e){return this.call(t,e),this.runOne()}return(t){if(0===this.stack.length)throw this.error(new ParserError("Stack underflow"));void 0===t&&(t=this.state.buf),this.state=this.stack.pop(),this.state.returned=t}returnNow(t){return this.return(t),this.runOne()}consume(){if(this.char===ParserEND)throw this.error(new ParserError("Unexpected end-of-buffer"));this.state.buf+=this._buf[this.ii]}error(t){return t.line=this.line,t.col=this.col,t.pos=this.pos,t}parseStart(){throw new ParserError("Must declare a parseStart method")}}Parser.END=ParserEND,Parser.Error=ParserError;var parser=Parser,createDatetime=t=>{const e=new Date(t);if(isNaN(e))throw new TypeError("Invalid Datetime");return e},formatNum=(t,e)=>{for(e+="";t>e.length;)e="0"+e;return e};const f$2=formatNum;class FloatingDateTime extends Date{constructor(t){super(t+"Z"),this.isFloating=!0}toISOString(){return`${this.getUTCFullYear()}-${f$2(2,this.getUTCMonth()+1)}-${f$2(2,this.getUTCDate())}T${f$2(2,this.getUTCHours())}:${f$2(2,this.getUTCMinutes())}:${f$2(2,this.getUTCSeconds())}.${f$2(3,this.getUTCMilliseconds())}`}}var createDatetimeFloat=t=>{const e=new FloatingDateTime(t);if(isNaN(e))throw new TypeError("Invalid Datetime");return e};const f$1=formatNum,DateTime=setupCpp.commonjsGlobal.Date;let Date$1=class extends DateTime{constructor(t){super(t),this.isDate=!0}toISOString(){return`${this.getUTCFullYear()}-${f$1(2,this.getUTCMonth()+1)}-${f$1(2,this.getUTCDate())}`}};var createDate$1=t=>{const e=new Date$1(t);if(isNaN(e))throw new TypeError("Invalid Datetime");return e};const f=formatNum;class Time extends Date{constructor(t){super(`0000-01-01T${t}Z`),this.isTime=!0}toISOString(){return`${f(2,this.getUTCHours())}:${f(2,this.getUTCMinutes())}:${f(2,this.getUTCSeconds())}.${f(3,this.getUTCMilliseconds())}`}}var createTime$1=t=>{const e=new Time(t);if(isNaN(e))throw new TypeError("Invalid Datetime");return e};tomlParser.exports=makeParserClass(parser),tomlParser.exports.makeParserClass=makeParserClass;class TomlError extends Error{constructor(t){super(t),this.name="TomlError",Error.captureStackTrace&&Error.captureStackTrace(this,TomlError),this.fromTOML=!0,this.wrapped=null}}TomlError.wrap=t=>{const e=new TomlError(t.message);return e.code=t.code,e.wrapped=t,e},tomlParser.exports.TomlError=TomlError;const createDateTime=createDatetime,createDateTimeFloat=createDatetimeFloat,createDate=createDate$1,createTime=createTime$1,CTRL_I=9,CTRL_J=10,CTRL_M=13,CTRL_CHAR_BOUNDARY=31,CHAR_SP=32,CHAR_QUOT=34,CHAR_NUM=35,CHAR_APOS=39,CHAR_PLUS=43,CHAR_COMMA=44,CHAR_HYPHEN=45,CHAR_PERIOD=46,CHAR_0=48,CHAR_1=49,CHAR_7=55,CHAR_9=57,CHAR_COLON=58,CHAR_EQUALS=61,CHAR_A=65,CHAR_E=69,CHAR_F=70,CHAR_T=84,CHAR_U=85,CHAR_Z=90,CHAR_LOWBAR=95,CHAR_a=97,CHAR_b=98,CHAR_e=101,CHAR_f=102,CHAR_i=105,CHAR_l=108,CHAR_n=110,CHAR_o=111,CHAR_r=114,CHAR_s=115,CHAR_t=116,CHAR_u=117,CHAR_x=120,CHAR_z=122,CHAR_LCUB=123,CHAR_RCUB=125,CHAR_LSQB=91,CHAR_BSOL=92,CHAR_RSQB=93,CHAR_DEL=127,SURROGATE_FIRST=55296,SURROGATE_LAST=57343,escapes={[CHAR_b]:"\b",[CHAR_t]:"\t",[CHAR_n]:"\n",[CHAR_f]:"\f",[CHAR_r]:"\r",[CHAR_QUOT]:'"',[CHAR_BSOL]:"\\"},_type=Symbol(),_declared=Symbol(),hasOwnProperty={}.hasOwnProperty,defineProperty=Object.defineProperty,descriptor={configurable:!0,enumerable:!0,writable:!0,value:void 0},INLINE_TABLE=Symbol(),TABLE=Symbol(),_contentType=Symbol(),INLINE_LIST=Symbol(),LIST=Symbol();let _custom;try{const utilInspect=eval("require('util').inspect");_custom=utilInspect.custom}catch(_){}const _inspect=_custom||"inspect";class BoxedBigInt{constructor(t){try{this.value=setupCpp.commonjsGlobal.BigInt.asIntN(64,t)}catch(_){this.value=null}Object.defineProperty(this,_type,{value:INTEGER})}isNaN(){return null===this.value}toString(){return this.value+""}[_inspect](){return`[BigInt: ${""+this}]}`}valueOf(){return this.value}}const INTEGER=Symbol(),FLOAT=Symbol();var tomlParserExports=tomlParser.exports,parsePrettyError=prettyError$2,parseString_1=parseString;const TOMLParser$2=tomlParserExports,prettyError$1=parsePrettyError;var parseAsync_1=parseAsync;const TOMLParser$1=tomlParserExports,prettyError=parsePrettyError;var parseStream_1=parseStream;const stream=require$$0,TOMLParser=tomlParserExports;parse.exports=parseString_1,parse.exports.async=parseAsync_1,parse.exports.stream=parseStream_1,parse.exports.prettyError=parsePrettyError;var stringify$1={exports:{}};stringify$1.exports=stringify,stringify$1.exports.value=stringifyInline;const IS_WINDOWS="win32"===process.platform,IS_LINUX="linux"===process.platform,IS_MAC="darwin"===process.platform,WINDOWS_ARCHS=["x86","x64"],WINDOWS_PLATFORMS=["win32","win64"],PYPY_VERSION_FILE="PYPY_VERSION",TOKEN=setupCpp.coreExports.getInput("token"),AUTH=TOKEN?"token "+TOKEN:void 0,MANIFEST_REPO_OWNER="actions",MANIFEST_REPO_NAME="python-versions",MANIFEST_REPO_BRANCH="main",MANIFEST_URL=`https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/${MANIFEST_REPO_BRANCH}/versions-manifest.json`,dirname="string"==typeof __dirname?__dirname:path.dirname(require$$1.fileURLToPath("undefined"==typeof document?require("url").pathToFileURL(__filename).href:_documentCurrentScript&&_documentCurrentScript.src||new URL("assets/actions_python-B7InDb2U.js",document.baseURI).href)),checkLatest=!1;exports.setupActionsPython=setupActionsPython; +//# sourceMappingURL=actions_python-B7InDb2U.js.map diff --git a/dist/legacy/assets/actions_python-DomaW1UO.js.map b/dist/legacy/assets/actions_python-B7InDb2U.js.map similarity index 99% rename from dist/legacy/assets/actions_python-DomaW1UO.js.map rename to dist/legacy/assets/actions_python-B7InDb2U.js.map index 5a140b16..2bcb3781 100644 --- a/dist/legacy/assets/actions_python-DomaW1UO.js.map +++ b/dist/legacy/assets/actions_python-B7InDb2U.js.map @@ -1 +1 @@ -{"version":3,"file":"actions_python-DomaW1UO.js","sources":["../../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/toml-parser.js","../../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse-pretty-error.js","../../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse-string.js","../../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse-async.js","../../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse-stream.js","../../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/stringify.js","../../../node_modules/.pnpm/setup-python@https+++codeload.github.com+aminya+setup-python+tar.gz+9700887_encoding@0.1.13/node_modules/setup-python/src/utils.ts","../../../node_modules/.pnpm/setup-python@https+++codeload.github.com+aminya+setup-python+tar.gz+9700887_encoding@0.1.13/node_modules/setup-python/src/install-pypy.ts","../../../node_modules/.pnpm/setup-python@https+++codeload.github.com+aminya+setup-python+tar.gz+9700887_encoding@0.1.13/node_modules/setup-python/src/find-pypy.ts","../../../node_modules/.pnpm/setup-python@https+++codeload.github.com+aminya+setup-python+tar.gz+9700887_encoding@0.1.13/node_modules/setup-python/src/install-python.ts","../../../node_modules/.pnpm/setup-python@https+++codeload.github.com+aminya+setup-python+tar.gz+9700887_encoding@0.1.13/node_modules/setup-python/src/find-python.ts","../../../src/python/actions_python.ts","../../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/parser.js","../../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/create-datetime.js","../../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/format-num.js","../../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/create-datetime-float.js","../../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/create-date.js","../../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/create-time.js","../../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse.js"],"sourcesContent":["'use strict'\n/* eslint-disable no-new-wrappers, no-eval, camelcase, operator-linebreak */\nmodule.exports = makeParserClass(require('./parser.js'))\nmodule.exports.makeParserClass = makeParserClass\n\nclass TomlError extends Error {\n constructor (msg) {\n super(msg)\n this.name = 'TomlError'\n /* istanbul ignore next */\n if (Error.captureStackTrace) Error.captureStackTrace(this, TomlError)\n this.fromTOML = true\n this.wrapped = null\n }\n}\nTomlError.wrap = err => {\n const terr = new TomlError(err.message)\n terr.code = err.code\n terr.wrapped = err\n return terr\n}\nmodule.exports.TomlError = TomlError\n\nconst createDateTime = require('./create-datetime.js')\nconst createDateTimeFloat = require('./create-datetime-float.js')\nconst createDate = require('./create-date.js')\nconst createTime = require('./create-time.js')\n\nconst CTRL_I = 0x09\nconst CTRL_J = 0x0A\nconst CTRL_M = 0x0D\nconst CTRL_CHAR_BOUNDARY = 0x1F // the last non-character in the latin1 region of unicode, except DEL\nconst CHAR_SP = 0x20\nconst CHAR_QUOT = 0x22\nconst CHAR_NUM = 0x23\nconst CHAR_APOS = 0x27\nconst CHAR_PLUS = 0x2B\nconst CHAR_COMMA = 0x2C\nconst CHAR_HYPHEN = 0x2D\nconst CHAR_PERIOD = 0x2E\nconst CHAR_0 = 0x30\nconst CHAR_1 = 0x31\nconst CHAR_7 = 0x37\nconst CHAR_9 = 0x39\nconst CHAR_COLON = 0x3A\nconst CHAR_EQUALS = 0x3D\nconst CHAR_A = 0x41\nconst CHAR_E = 0x45\nconst CHAR_F = 0x46\nconst CHAR_T = 0x54\nconst CHAR_U = 0x55\nconst CHAR_Z = 0x5A\nconst CHAR_LOWBAR = 0x5F\nconst CHAR_a = 0x61\nconst CHAR_b = 0x62\nconst CHAR_e = 0x65\nconst CHAR_f = 0x66\nconst CHAR_i = 0x69\nconst CHAR_l = 0x6C\nconst CHAR_n = 0x6E\nconst CHAR_o = 0x6F\nconst CHAR_r = 0x72\nconst CHAR_s = 0x73\nconst CHAR_t = 0x74\nconst CHAR_u = 0x75\nconst CHAR_x = 0x78\nconst CHAR_z = 0x7A\nconst CHAR_LCUB = 0x7B\nconst CHAR_RCUB = 0x7D\nconst CHAR_LSQB = 0x5B\nconst CHAR_BSOL = 0x5C\nconst CHAR_RSQB = 0x5D\nconst CHAR_DEL = 0x7F\nconst SURROGATE_FIRST = 0xD800\nconst SURROGATE_LAST = 0xDFFF\n\nconst escapes = {\n [CHAR_b]: '\\u0008',\n [CHAR_t]: '\\u0009',\n [CHAR_n]: '\\u000A',\n [CHAR_f]: '\\u000C',\n [CHAR_r]: '\\u000D',\n [CHAR_QUOT]: '\\u0022',\n [CHAR_BSOL]: '\\u005C'\n}\n\nfunction isDigit (cp) {\n return cp >= CHAR_0 && cp <= CHAR_9\n}\nfunction isHexit (cp) {\n return (cp >= CHAR_A && cp <= CHAR_F) || (cp >= CHAR_a && cp <= CHAR_f) || (cp >= CHAR_0 && cp <= CHAR_9)\n}\nfunction isBit (cp) {\n return cp === CHAR_1 || cp === CHAR_0\n}\nfunction isOctit (cp) {\n return (cp >= CHAR_0 && cp <= CHAR_7)\n}\nfunction isAlphaNumQuoteHyphen (cp) {\n return (cp >= CHAR_A && cp <= CHAR_Z)\n || (cp >= CHAR_a && cp <= CHAR_z)\n || (cp >= CHAR_0 && cp <= CHAR_9)\n || cp === CHAR_APOS\n || cp === CHAR_QUOT\n || cp === CHAR_LOWBAR\n || cp === CHAR_HYPHEN\n}\nfunction isAlphaNumHyphen (cp) {\n return (cp >= CHAR_A && cp <= CHAR_Z)\n || (cp >= CHAR_a && cp <= CHAR_z)\n || (cp >= CHAR_0 && cp <= CHAR_9)\n || cp === CHAR_LOWBAR\n || cp === CHAR_HYPHEN\n}\nconst _type = Symbol('type')\nconst _declared = Symbol('declared')\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty\nconst defineProperty = Object.defineProperty\nconst descriptor = {configurable: true, enumerable: true, writable: true, value: undefined}\n\nfunction hasKey (obj, key) {\n if (hasOwnProperty.call(obj, key)) return true\n if (key === '__proto__') defineProperty(obj, '__proto__', descriptor)\n return false\n}\n\nconst INLINE_TABLE = Symbol('inline-table')\nfunction InlineTable () {\n return Object.defineProperties({}, {\n [_type]: {value: INLINE_TABLE}\n })\n}\nfunction isInlineTable (obj) {\n if (obj === null || typeof (obj) !== 'object') return false\n return obj[_type] === INLINE_TABLE\n}\n\nconst TABLE = Symbol('table')\nfunction Table () {\n return Object.defineProperties({}, {\n [_type]: {value: TABLE},\n [_declared]: {value: false, writable: true}\n })\n}\nfunction isTable (obj) {\n if (obj === null || typeof (obj) !== 'object') return false\n return obj[_type] === TABLE\n}\n\nconst _contentType = Symbol('content-type')\nconst INLINE_LIST = Symbol('inline-list')\nfunction InlineList (type) {\n return Object.defineProperties([], {\n [_type]: {value: INLINE_LIST},\n [_contentType]: {value: type}\n })\n}\nfunction isInlineList (obj) {\n if (obj === null || typeof (obj) !== 'object') return false\n return obj[_type] === INLINE_LIST\n}\n\nconst LIST = Symbol('list')\nfunction List () {\n return Object.defineProperties([], {\n [_type]: {value: LIST}\n })\n}\nfunction isList (obj) {\n if (obj === null || typeof (obj) !== 'object') return false\n return obj[_type] === LIST\n}\n\n// in an eval, to let bundlers not slurp in a util proxy\nlet _custom\ntry {\n const utilInspect = eval(\"require('util').inspect\")\n _custom = utilInspect.custom\n} catch (_) {\n /* eval require not available in transpiled bundle */\n}\n/* istanbul ignore next */\nconst _inspect = _custom || 'inspect'\n\nclass BoxedBigInt {\n constructor (value) {\n try {\n this.value = global.BigInt.asIntN(64, value)\n } catch (_) {\n /* istanbul ignore next */\n this.value = null\n }\n Object.defineProperty(this, _type, {value: INTEGER})\n }\n isNaN () {\n return this.value === null\n }\n /* istanbul ignore next */\n toString () {\n return String(this.value)\n }\n /* istanbul ignore next */\n [_inspect] () {\n return `[BigInt: ${this.toString()}]}`\n }\n valueOf () {\n return this.value\n }\n}\n\nconst INTEGER = Symbol('integer')\nfunction Integer (value) {\n let num = Number(value)\n // -0 is a float thing, not an int thing\n if (Object.is(num, -0)) num = 0\n /* istanbul ignore else */\n if (global.BigInt && !Number.isSafeInteger(num)) {\n return new BoxedBigInt(value)\n } else {\n /* istanbul ignore next */\n return Object.defineProperties(new Number(num), {\n isNaN: {value: function () { return isNaN(this) }},\n [_type]: {value: INTEGER},\n [_inspect]: {value: () => `[Integer: ${value}]`}\n })\n }\n}\nfunction isInteger (obj) {\n if (obj === null || typeof (obj) !== 'object') return false\n return obj[_type] === INTEGER\n}\n\nconst FLOAT = Symbol('float')\nfunction Float (value) {\n /* istanbul ignore next */\n return Object.defineProperties(new Number(value), {\n [_type]: {value: FLOAT},\n [_inspect]: {value: () => `[Float: ${value}]`}\n })\n}\nfunction isFloat (obj) {\n if (obj === null || typeof (obj) !== 'object') return false\n return obj[_type] === FLOAT\n}\n\nfunction tomlType (value) {\n const type = typeof value\n if (type === 'object') {\n /* istanbul ignore if */\n if (value === null) return 'null'\n if (value instanceof Date) return 'datetime'\n /* istanbul ignore else */\n if (_type in value) {\n switch (value[_type]) {\n case INLINE_TABLE: return 'inline-table'\n case INLINE_LIST: return 'inline-list'\n /* istanbul ignore next */\n case TABLE: return 'table'\n /* istanbul ignore next */\n case LIST: return 'list'\n case FLOAT: return 'float'\n case INTEGER: return 'integer'\n }\n }\n }\n return type\n}\n\nfunction makeParserClass (Parser) {\n class TOMLParser extends Parser {\n constructor () {\n super()\n this.ctx = this.obj = Table()\n }\n\n /* MATCH HELPER */\n atEndOfWord () {\n return this.char === CHAR_NUM || this.char === CTRL_I || this.char === CHAR_SP || this.atEndOfLine()\n }\n atEndOfLine () {\n return this.char === Parser.END || this.char === CTRL_J || this.char === CTRL_M\n }\n\n parseStart () {\n if (this.char === Parser.END) {\n return null\n } else if (this.char === CHAR_LSQB) {\n return this.call(this.parseTableOrList)\n } else if (this.char === CHAR_NUM) {\n return this.call(this.parseComment)\n } else if (this.char === CTRL_J || this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M) {\n return null\n } else if (isAlphaNumQuoteHyphen(this.char)) {\n return this.callNow(this.parseAssignStatement)\n } else {\n throw this.error(new TomlError(`Unknown character \"${this.char}\"`))\n }\n }\n\n // HELPER, this strips any whitespace and comments to the end of the line\n // then RETURNS. Last state in a production.\n parseWhitespaceToEOL () {\n if (this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M) {\n return null\n } else if (this.char === CHAR_NUM) {\n return this.goto(this.parseComment)\n } else if (this.char === Parser.END || this.char === CTRL_J) {\n return this.return()\n } else {\n throw this.error(new TomlError('Unexpected character, expected only whitespace or comments till end of line'))\n }\n }\n\n /* ASSIGNMENT: key = value */\n parseAssignStatement () {\n return this.callNow(this.parseAssign, this.recordAssignStatement)\n }\n recordAssignStatement (kv) {\n let target = this.ctx\n let finalKey = kv.key.pop()\n for (let kw of kv.key) {\n if (hasKey(target, kw) && !isTable(target[kw])) {\n throw this.error(new TomlError(\"Can't redefine existing key\"))\n }\n target = target[kw] = target[kw] || Table()\n }\n if (hasKey(target, finalKey)) {\n throw this.error(new TomlError(\"Can't redefine existing key\"))\n }\n target[_declared] = true\n // unbox our numbers\n if (isInteger(kv.value) || isFloat(kv.value)) {\n target[finalKey] = kv.value.valueOf()\n } else {\n target[finalKey] = kv.value\n }\n return this.goto(this.parseWhitespaceToEOL)\n }\n\n /* ASSSIGNMENT expression, key = value possibly inside an inline table */\n parseAssign () {\n return this.callNow(this.parseKeyword, this.recordAssignKeyword)\n }\n recordAssignKeyword (key) {\n if (this.state.resultTable) {\n this.state.resultTable.push(key)\n } else {\n this.state.resultTable = [key]\n }\n return this.goto(this.parseAssignKeywordPreDot)\n }\n parseAssignKeywordPreDot () {\n if (this.char === CHAR_PERIOD) {\n return this.next(this.parseAssignKeywordPostDot)\n } else if (this.char !== CHAR_SP && this.char !== CTRL_I) {\n return this.goto(this.parseAssignEqual)\n }\n }\n parseAssignKeywordPostDot () {\n if (this.char !== CHAR_SP && this.char !== CTRL_I) {\n return this.callNow(this.parseKeyword, this.recordAssignKeyword)\n }\n }\n\n parseAssignEqual () {\n if (this.char === CHAR_EQUALS) {\n return this.next(this.parseAssignPreValue)\n } else {\n throw this.error(new TomlError('Invalid character, expected \"=\"'))\n }\n }\n parseAssignPreValue () {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else {\n return this.callNow(this.parseValue, this.recordAssignValue)\n }\n }\n recordAssignValue (value) {\n return this.returnNow({key: this.state.resultTable, value: value})\n }\n\n /* COMMENTS: #...eol */\n parseComment () {\n do {\n if (this.char === Parser.END || this.char === CTRL_J) {\n return this.return()\n } else if (this.char === CHAR_DEL || (this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I)) {\n throw this.errorControlCharIn('comments')\n }\n } while (this.nextChar())\n }\n\n /* TABLES AND LISTS, [foo] and [[foo]] */\n parseTableOrList () {\n if (this.char === CHAR_LSQB) {\n this.next(this.parseList)\n } else {\n return this.goto(this.parseTable)\n }\n }\n\n /* TABLE [foo.bar.baz] */\n parseTable () {\n this.ctx = this.obj\n return this.goto(this.parseTableNext)\n }\n parseTableNext () {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else {\n return this.callNow(this.parseKeyword, this.parseTableMore)\n }\n }\n parseTableMore (keyword) {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else if (this.char === CHAR_RSQB) {\n if (hasKey(this.ctx, keyword) && (!isTable(this.ctx[keyword]) || this.ctx[keyword][_declared])) {\n throw this.error(new TomlError(\"Can't redefine existing key\"))\n } else {\n this.ctx = this.ctx[keyword] = this.ctx[keyword] || Table()\n this.ctx[_declared] = true\n }\n return this.next(this.parseWhitespaceToEOL)\n } else if (this.char === CHAR_PERIOD) {\n if (!hasKey(this.ctx, keyword)) {\n this.ctx = this.ctx[keyword] = Table()\n } else if (isTable(this.ctx[keyword])) {\n this.ctx = this.ctx[keyword]\n } else if (isList(this.ctx[keyword])) {\n this.ctx = this.ctx[keyword][this.ctx[keyword].length - 1]\n } else {\n throw this.error(new TomlError(\"Can't redefine existing key\"))\n }\n return this.next(this.parseTableNext)\n } else {\n throw this.error(new TomlError('Unexpected character, expected whitespace, . or ]'))\n }\n }\n\n /* LIST [[a.b.c]] */\n parseList () {\n this.ctx = this.obj\n return this.goto(this.parseListNext)\n }\n parseListNext () {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else {\n return this.callNow(this.parseKeyword, this.parseListMore)\n }\n }\n parseListMore (keyword) {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else if (this.char === CHAR_RSQB) {\n if (!hasKey(this.ctx, keyword)) {\n this.ctx[keyword] = List()\n }\n if (isInlineList(this.ctx[keyword])) {\n throw this.error(new TomlError(\"Can't extend an inline array\"))\n } else if (isList(this.ctx[keyword])) {\n const next = Table()\n this.ctx[keyword].push(next)\n this.ctx = next\n } else {\n throw this.error(new TomlError(\"Can't redefine an existing key\"))\n }\n return this.next(this.parseListEnd)\n } else if (this.char === CHAR_PERIOD) {\n if (!hasKey(this.ctx, keyword)) {\n this.ctx = this.ctx[keyword] = Table()\n } else if (isInlineList(this.ctx[keyword])) {\n throw this.error(new TomlError(\"Can't extend an inline array\"))\n } else if (isInlineTable(this.ctx[keyword])) {\n throw this.error(new TomlError(\"Can't extend an inline table\"))\n } else if (isList(this.ctx[keyword])) {\n this.ctx = this.ctx[keyword][this.ctx[keyword].length - 1]\n } else if (isTable(this.ctx[keyword])) {\n this.ctx = this.ctx[keyword]\n } else {\n throw this.error(new TomlError(\"Can't redefine an existing key\"))\n }\n return this.next(this.parseListNext)\n } else {\n throw this.error(new TomlError('Unexpected character, expected whitespace, . or ]'))\n }\n }\n parseListEnd (keyword) {\n if (this.char === CHAR_RSQB) {\n return this.next(this.parseWhitespaceToEOL)\n } else {\n throw this.error(new TomlError('Unexpected character, expected whitespace, . or ]'))\n }\n }\n\n /* VALUE string, number, boolean, inline list, inline object */\n parseValue () {\n if (this.char === Parser.END) {\n throw this.error(new TomlError('Key without value'))\n } else if (this.char === CHAR_QUOT) {\n return this.next(this.parseDoubleString)\n } if (this.char === CHAR_APOS) {\n return this.next(this.parseSingleString)\n } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {\n return this.goto(this.parseNumberSign)\n } else if (this.char === CHAR_i) {\n return this.next(this.parseInf)\n } else if (this.char === CHAR_n) {\n return this.next(this.parseNan)\n } else if (isDigit(this.char)) {\n return this.goto(this.parseNumberOrDateTime)\n } else if (this.char === CHAR_t || this.char === CHAR_f) {\n return this.goto(this.parseBoolean)\n } else if (this.char === CHAR_LSQB) {\n return this.call(this.parseInlineList, this.recordValue)\n } else if (this.char === CHAR_LCUB) {\n return this.call(this.parseInlineTable, this.recordValue)\n } else {\n throw this.error(new TomlError('Unexpected character, expecting string, number, datetime, boolean, inline array or inline table'))\n }\n }\n recordValue (value) {\n return this.returnNow(value)\n }\n\n parseInf () {\n if (this.char === CHAR_n) {\n return this.next(this.parseInf2)\n } else {\n throw this.error(new TomlError('Unexpected character, expected \"inf\", \"+inf\" or \"-inf\"'))\n }\n }\n parseInf2 () {\n if (this.char === CHAR_f) {\n if (this.state.buf === '-') {\n return this.return(-Infinity)\n } else {\n return this.return(Infinity)\n }\n } else {\n throw this.error(new TomlError('Unexpected character, expected \"inf\", \"+inf\" or \"-inf\"'))\n }\n }\n\n parseNan () {\n if (this.char === CHAR_a) {\n return this.next(this.parseNan2)\n } else {\n throw this.error(new TomlError('Unexpected character, expected \"nan\"'))\n }\n }\n parseNan2 () {\n if (this.char === CHAR_n) {\n return this.return(NaN)\n } else {\n throw this.error(new TomlError('Unexpected character, expected \"nan\"'))\n }\n }\n\n /* KEYS, barewords or basic, literal, or dotted */\n parseKeyword () {\n if (this.char === CHAR_QUOT) {\n return this.next(this.parseBasicString)\n } else if (this.char === CHAR_APOS) {\n return this.next(this.parseLiteralString)\n } else {\n return this.goto(this.parseBareKey)\n }\n }\n\n /* KEYS: barewords */\n parseBareKey () {\n do {\n if (this.char === Parser.END) {\n throw this.error(new TomlError('Key ended without value'))\n } else if (isAlphaNumHyphen(this.char)) {\n this.consume()\n } else if (this.state.buf.length === 0) {\n throw this.error(new TomlError('Empty bare keys are not allowed'))\n } else {\n return this.returnNow()\n }\n } while (this.nextChar())\n }\n\n /* STRINGS, single quoted (literal) */\n parseSingleString () {\n if (this.char === CHAR_APOS) {\n return this.next(this.parseLiteralMultiStringMaybe)\n } else {\n return this.goto(this.parseLiteralString)\n }\n }\n parseLiteralString () {\n do {\n if (this.char === CHAR_APOS) {\n return this.return()\n } else if (this.atEndOfLine()) {\n throw this.error(new TomlError('Unterminated string'))\n } else if (this.char === CHAR_DEL || (this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I)) {\n throw this.errorControlCharIn('strings')\n } else {\n this.consume()\n }\n } while (this.nextChar())\n }\n parseLiteralMultiStringMaybe () {\n if (this.char === CHAR_APOS) {\n return this.next(this.parseLiteralMultiString)\n } else {\n return this.returnNow()\n }\n }\n parseLiteralMultiString () {\n if (this.char === CTRL_M) {\n return null\n } else if (this.char === CTRL_J) {\n return this.next(this.parseLiteralMultiStringContent)\n } else {\n return this.goto(this.parseLiteralMultiStringContent)\n }\n }\n parseLiteralMultiStringContent () {\n do {\n if (this.char === CHAR_APOS) {\n return this.next(this.parseLiteralMultiEnd)\n } else if (this.char === Parser.END) {\n throw this.error(new TomlError('Unterminated multi-line string'))\n } else if (this.char === CHAR_DEL || (this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I && this.char !== CTRL_J && this.char !== CTRL_M)) {\n throw this.errorControlCharIn('strings')\n } else {\n this.consume()\n }\n } while (this.nextChar())\n }\n parseLiteralMultiEnd () {\n if (this.char === CHAR_APOS) {\n return this.next(this.parseLiteralMultiEnd2)\n } else {\n this.state.buf += \"'\"\n return this.goto(this.parseLiteralMultiStringContent)\n }\n }\n parseLiteralMultiEnd2 () {\n if (this.char === CHAR_APOS) {\n return this.next(this.parseLiteralMultiEnd3)\n } else {\n this.state.buf += \"''\"\n return this.goto(this.parseLiteralMultiStringContent)\n }\n }\n parseLiteralMultiEnd3 () {\n if (this.char === CHAR_APOS) {\n this.state.buf += \"'\"\n return this.next(this.parseLiteralMultiEnd4)\n } else {\n return this.returnNow()\n }\n }\n parseLiteralMultiEnd4 () {\n if (this.char === CHAR_APOS) {\n this.state.buf += \"'\"\n return this.return()\n } else {\n return this.returnNow()\n }\n }\n\n /* STRINGS double quoted */\n parseDoubleString () {\n if (this.char === CHAR_QUOT) {\n return this.next(this.parseMultiStringMaybe)\n } else {\n return this.goto(this.parseBasicString)\n }\n }\n parseBasicString () {\n do {\n if (this.char === CHAR_BSOL) {\n return this.call(this.parseEscape, this.recordEscapeReplacement)\n } else if (this.char === CHAR_QUOT) {\n return this.return()\n } else if (this.atEndOfLine()) {\n throw this.error(new TomlError('Unterminated string'))\n } else if (this.char === CHAR_DEL || (this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I)) {\n throw this.errorControlCharIn('strings')\n } else {\n this.consume()\n }\n } while (this.nextChar())\n }\n recordEscapeReplacement (replacement) {\n this.state.buf += replacement\n return this.goto(this.parseBasicString)\n }\n parseMultiStringMaybe () {\n if (this.char === CHAR_QUOT) {\n return this.next(this.parseMultiString)\n } else {\n return this.returnNow()\n }\n }\n parseMultiString () {\n if (this.char === CTRL_M) {\n return null\n } else if (this.char === CTRL_J) {\n return this.next(this.parseMultiStringContent)\n } else {\n return this.goto(this.parseMultiStringContent)\n }\n }\n parseMultiStringContent () {\n do {\n if (this.char === CHAR_BSOL) {\n return this.call(this.parseMultiEscape, this.recordMultiEscapeReplacement)\n } else if (this.char === CHAR_QUOT) {\n return this.next(this.parseMultiEnd)\n } else if (this.char === Parser.END) {\n throw this.error(new TomlError('Unterminated multi-line string'))\n } else if (this.char === CHAR_DEL || (this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I && this.char !== CTRL_J && this.char !== CTRL_M)) {\n throw this.errorControlCharIn('strings')\n } else {\n this.consume()\n }\n } while (this.nextChar())\n }\n errorControlCharIn (type) {\n let displayCode = '\\\\u00'\n if (this.char < 16) {\n displayCode += '0'\n }\n displayCode += this.char.toString(16)\n\n return this.error(new TomlError(`Control characters (codes < 0x1f and 0x7f) are not allowed in ${type}, use ${displayCode} instead`))\n }\n recordMultiEscapeReplacement (replacement) {\n this.state.buf += replacement\n return this.goto(this.parseMultiStringContent)\n }\n parseMultiEnd () {\n if (this.char === CHAR_QUOT) {\n return this.next(this.parseMultiEnd2)\n } else {\n this.state.buf += '\"'\n return this.goto(this.parseMultiStringContent)\n }\n }\n parseMultiEnd2 () {\n if (this.char === CHAR_QUOT) {\n return this.next(this.parseMultiEnd3)\n } else {\n this.state.buf += '\"\"'\n return this.goto(this.parseMultiStringContent)\n }\n }\n parseMultiEnd3 () {\n if (this.char === CHAR_QUOT) {\n this.state.buf += '\"'\n return this.next(this.parseMultiEnd4)\n } else {\n return this.returnNow()\n }\n }\n parseMultiEnd4 () {\n if (this.char === CHAR_QUOT) {\n this.state.buf += '\"'\n return this.return()\n } else {\n return this.returnNow()\n }\n }\n parseMultiEscape () {\n if (this.char === CTRL_M || this.char === CTRL_J) {\n return this.next(this.parseMultiTrim)\n } else if (this.char === CHAR_SP || this.char === CTRL_I) {\n return this.next(this.parsePreMultiTrim)\n } else {\n return this.goto(this.parseEscape)\n }\n }\n parsePreMultiTrim () {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else if (this.char === CTRL_M || this.char === CTRL_J) {\n return this.next(this.parseMultiTrim)\n } else {\n throw this.error(new TomlError(\"Can't escape whitespace\"))\n }\n }\n parseMultiTrim () {\n // explicitly whitespace here, END should follow the same path as chars\n if (this.char === CTRL_J || this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M) {\n return null\n } else {\n return this.returnNow()\n }\n }\n parseEscape () {\n if (this.char in escapes) {\n return this.return(escapes[this.char])\n } else if (this.char === CHAR_u) {\n return this.call(this.parseSmallUnicode, this.parseUnicodeReturn)\n } else if (this.char === CHAR_U) {\n return this.call(this.parseLargeUnicode, this.parseUnicodeReturn)\n } else {\n throw this.error(new TomlError('Unknown escape character: ' + this.char))\n }\n }\n parseUnicodeReturn (char) {\n try {\n const codePoint = parseInt(char, 16)\n if (codePoint >= SURROGATE_FIRST && codePoint <= SURROGATE_LAST) {\n throw this.error(new TomlError('Invalid unicode, character in range 0xD800 - 0xDFFF is reserved'))\n }\n return this.returnNow(String.fromCodePoint(codePoint))\n } catch (err) {\n throw this.error(TomlError.wrap(err))\n }\n }\n parseSmallUnicode () {\n if (!isHexit(this.char)) {\n throw this.error(new TomlError('Invalid character in unicode sequence, expected hex'))\n } else {\n this.consume()\n if (this.state.buf.length >= 4) return this.return()\n }\n }\n parseLargeUnicode () {\n if (!isHexit(this.char)) {\n throw this.error(new TomlError('Invalid character in unicode sequence, expected hex'))\n } else {\n this.consume()\n if (this.state.buf.length >= 8) return this.return()\n }\n }\n\n /* NUMBERS */\n parseNumberSign () {\n this.consume()\n return this.next(this.parseMaybeSignedInfOrNan)\n }\n parseMaybeSignedInfOrNan () {\n if (this.char === CHAR_i) {\n return this.next(this.parseInf)\n } else if (this.char === CHAR_n) {\n return this.next(this.parseNan)\n } else {\n return this.callNow(this.parseNoUnder, this.parseNumberIntegerStart)\n }\n }\n parseNumberIntegerStart () {\n if (this.char === CHAR_0) {\n this.consume()\n return this.next(this.parseNumberIntegerExponentOrDecimal)\n } else {\n return this.goto(this.parseNumberInteger)\n }\n }\n parseNumberIntegerExponentOrDecimal () {\n if (this.char === CHAR_PERIOD) {\n this.consume()\n return this.call(this.parseNoUnder, this.parseNumberFloat)\n } else if (this.char === CHAR_E || this.char === CHAR_e) {\n this.consume()\n return this.next(this.parseNumberExponentSign)\n } else {\n return this.returnNow(Integer(this.state.buf))\n }\n }\n parseNumberInteger () {\n if (isDigit(this.char)) {\n this.consume()\n } else if (this.char === CHAR_LOWBAR) {\n return this.call(this.parseNoUnder)\n } else if (this.char === CHAR_E || this.char === CHAR_e) {\n this.consume()\n return this.next(this.parseNumberExponentSign)\n } else if (this.char === CHAR_PERIOD) {\n this.consume()\n return this.call(this.parseNoUnder, this.parseNumberFloat)\n } else {\n const result = Integer(this.state.buf)\n /* istanbul ignore if */\n if (result.isNaN()) {\n throw this.error(new TomlError('Invalid number'))\n } else {\n return this.returnNow(result)\n }\n }\n }\n parseNoUnder () {\n if (this.char === CHAR_LOWBAR || this.char === CHAR_PERIOD || this.char === CHAR_E || this.char === CHAR_e) {\n throw this.error(new TomlError('Unexpected character, expected digit'))\n } else if (this.atEndOfWord()) {\n throw this.error(new TomlError('Incomplete number'))\n }\n return this.returnNow()\n }\n parseNoUnderHexOctBinLiteral () {\n if (this.char === CHAR_LOWBAR || this.char === CHAR_PERIOD) {\n throw this.error(new TomlError('Unexpected character, expected digit'))\n } else if (this.atEndOfWord()) {\n throw this.error(new TomlError('Incomplete number'))\n }\n return this.returnNow()\n }\n parseNumberFloat () {\n if (this.char === CHAR_LOWBAR) {\n return this.call(this.parseNoUnder, this.parseNumberFloat)\n } else if (isDigit(this.char)) {\n this.consume()\n } else if (this.char === CHAR_E || this.char === CHAR_e) {\n this.consume()\n return this.next(this.parseNumberExponentSign)\n } else {\n return this.returnNow(Float(this.state.buf))\n }\n }\n parseNumberExponentSign () {\n if (isDigit(this.char)) {\n return this.goto(this.parseNumberExponent)\n } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {\n this.consume()\n this.call(this.parseNoUnder, this.parseNumberExponent)\n } else {\n throw this.error(new TomlError('Unexpected character, expected -, + or digit'))\n }\n }\n parseNumberExponent () {\n if (isDigit(this.char)) {\n this.consume()\n } else if (this.char === CHAR_LOWBAR) {\n return this.call(this.parseNoUnder)\n } else {\n return this.returnNow(Float(this.state.buf))\n }\n }\n\n /* NUMBERS or DATETIMES */\n parseNumberOrDateTime () {\n if (this.char === CHAR_0) {\n this.consume()\n return this.next(this.parseNumberBaseOrDateTime)\n } else {\n return this.goto(this.parseNumberOrDateTimeOnly)\n }\n }\n parseNumberOrDateTimeOnly () {\n // note, if two zeros are in a row then it MUST be a date\n if (this.char === CHAR_LOWBAR) {\n return this.call(this.parseNoUnder, this.parseNumberInteger)\n } else if (isDigit(this.char)) {\n this.consume()\n if (this.state.buf.length > 4) this.next(this.parseNumberInteger)\n } else if (this.char === CHAR_E || this.char === CHAR_e) {\n this.consume()\n return this.next(this.parseNumberExponentSign)\n } else if (this.char === CHAR_PERIOD) {\n this.consume()\n return this.call(this.parseNoUnder, this.parseNumberFloat)\n } else if (this.char === CHAR_HYPHEN) {\n return this.goto(this.parseDateTime)\n } else if (this.char === CHAR_COLON) {\n return this.goto(this.parseOnlyTimeHour)\n } else {\n return this.returnNow(Integer(this.state.buf))\n }\n }\n parseDateTimeOnly () {\n if (this.state.buf.length < 4) {\n if (isDigit(this.char)) {\n return this.consume()\n } else if (this.char === CHAR_COLON) {\n return this.goto(this.parseOnlyTimeHour)\n } else {\n throw this.error(new TomlError('Expected digit while parsing year part of a date'))\n }\n } else {\n if (this.char === CHAR_HYPHEN) {\n return this.goto(this.parseDateTime)\n } else {\n throw this.error(new TomlError('Expected hyphen (-) while parsing year part of date'))\n }\n }\n }\n parseNumberBaseOrDateTime () {\n if (this.char === CHAR_b) {\n this.consume()\n return this.call(this.parseNoUnderHexOctBinLiteral, this.parseIntegerBin)\n } else if (this.char === CHAR_o) {\n this.consume()\n return this.call(this.parseNoUnderHexOctBinLiteral, this.parseIntegerOct)\n } else if (this.char === CHAR_x) {\n this.consume()\n return this.call(this.parseNoUnderHexOctBinLiteral, this.parseIntegerHex)\n } else if (this.char === CHAR_PERIOD) {\n return this.goto(this.parseNumberInteger)\n } else if (isDigit(this.char)) {\n return this.goto(this.parseDateTimeOnly)\n } else {\n return this.returnNow(Integer(this.state.buf))\n }\n }\n parseIntegerHex () {\n if (isHexit(this.char)) {\n this.consume()\n } else if (this.char === CHAR_LOWBAR) {\n return this.call(this.parseNoUnderHexOctBinLiteral)\n } else {\n const result = Integer(this.state.buf)\n /* istanbul ignore if */\n if (result.isNaN()) {\n throw this.error(new TomlError('Invalid number'))\n } else {\n return this.returnNow(result)\n }\n }\n }\n parseIntegerOct () {\n if (isOctit(this.char)) {\n this.consume()\n } else if (this.char === CHAR_LOWBAR) {\n return this.call(this.parseNoUnderHexOctBinLiteral)\n } else {\n const result = Integer(this.state.buf)\n /* istanbul ignore if */\n if (result.isNaN()) {\n throw this.error(new TomlError('Invalid number'))\n } else {\n return this.returnNow(result)\n }\n }\n }\n parseIntegerBin () {\n if (isBit(this.char)) {\n this.consume()\n } else if (this.char === CHAR_LOWBAR) {\n return this.call(this.parseNoUnderHexOctBinLiteral)\n } else {\n const result = Integer(this.state.buf)\n /* istanbul ignore if */\n if (result.isNaN()) {\n throw this.error(new TomlError('Invalid number'))\n } else {\n return this.returnNow(result)\n }\n }\n }\n\n /* DATETIME */\n parseDateTime () {\n // we enter here having just consumed the year and about to consume the hyphen\n if (this.state.buf.length < 4) {\n throw this.error(new TomlError('Years less than 1000 must be zero padded to four characters'))\n }\n this.state.result = this.state.buf\n this.state.buf = ''\n return this.next(this.parseDateMonth)\n }\n parseDateMonth () {\n if (this.char === CHAR_HYPHEN) {\n if (this.state.buf.length < 2) {\n throw this.error(new TomlError('Months less than 10 must be zero padded to two characters'))\n }\n this.state.result += '-' + this.state.buf\n this.state.buf = ''\n return this.next(this.parseDateDay)\n } else if (isDigit(this.char)) {\n this.consume()\n } else {\n throw this.error(new TomlError('Incomplete datetime'))\n }\n }\n parseDateDay () {\n if (this.char === CHAR_T || this.char === CHAR_SP) {\n if (this.state.buf.length < 2) {\n throw this.error(new TomlError('Days less than 10 must be zero padded to two characters'))\n }\n this.state.result += '-' + this.state.buf\n this.state.buf = ''\n return this.next(this.parseStartTimeHour)\n } else if (this.atEndOfWord()) {\n return this.returnNow(createDate(this.state.result + '-' + this.state.buf))\n } else if (isDigit(this.char)) {\n this.consume()\n } else {\n throw this.error(new TomlError('Incomplete datetime'))\n }\n }\n parseStartTimeHour () {\n if (this.atEndOfWord()) {\n return this.returnNow(createDate(this.state.result))\n } else {\n return this.goto(this.parseTimeHour)\n }\n }\n parseTimeHour () {\n if (this.char === CHAR_COLON) {\n if (this.state.buf.length < 2) {\n throw this.error(new TomlError('Hours less than 10 must be zero padded to two characters'))\n }\n this.state.result += 'T' + this.state.buf\n this.state.buf = ''\n return this.next(this.parseTimeMin)\n } else if (isDigit(this.char)) {\n this.consume()\n } else {\n throw this.error(new TomlError('Incomplete datetime'))\n }\n }\n parseTimeMin () {\n if (this.state.buf.length < 2 && isDigit(this.char)) {\n this.consume()\n } else if (this.state.buf.length === 2 && this.char === CHAR_COLON) {\n this.state.result += ':' + this.state.buf\n this.state.buf = ''\n return this.next(this.parseTimeSec)\n } else {\n throw this.error(new TomlError('Incomplete datetime'))\n }\n }\n parseTimeSec () {\n if (isDigit(this.char)) {\n this.consume()\n if (this.state.buf.length === 2) {\n this.state.result += ':' + this.state.buf\n this.state.buf = ''\n return this.next(this.parseTimeZoneOrFraction)\n }\n } else {\n throw this.error(new TomlError('Incomplete datetime'))\n }\n }\n\n parseOnlyTimeHour () {\n /* istanbul ignore else */\n if (this.char === CHAR_COLON) {\n if (this.state.buf.length < 2) {\n throw this.error(new TomlError('Hours less than 10 must be zero padded to two characters'))\n }\n this.state.result = this.state.buf\n this.state.buf = ''\n return this.next(this.parseOnlyTimeMin)\n } else {\n throw this.error(new TomlError('Incomplete time'))\n }\n }\n parseOnlyTimeMin () {\n if (this.state.buf.length < 2 && isDigit(this.char)) {\n this.consume()\n } else if (this.state.buf.length === 2 && this.char === CHAR_COLON) {\n this.state.result += ':' + this.state.buf\n this.state.buf = ''\n return this.next(this.parseOnlyTimeSec)\n } else {\n throw this.error(new TomlError('Incomplete time'))\n }\n }\n parseOnlyTimeSec () {\n if (isDigit(this.char)) {\n this.consume()\n if (this.state.buf.length === 2) {\n return this.next(this.parseOnlyTimeFractionMaybe)\n }\n } else {\n throw this.error(new TomlError('Incomplete time'))\n }\n }\n parseOnlyTimeFractionMaybe () {\n this.state.result += ':' + this.state.buf\n if (this.char === CHAR_PERIOD) {\n this.state.buf = ''\n this.next(this.parseOnlyTimeFraction)\n } else {\n return this.return(createTime(this.state.result))\n }\n }\n parseOnlyTimeFraction () {\n if (isDigit(this.char)) {\n this.consume()\n } else if (this.atEndOfWord()) {\n if (this.state.buf.length === 0) throw this.error(new TomlError('Expected digit in milliseconds'))\n return this.returnNow(createTime(this.state.result + '.' + this.state.buf))\n } else {\n throw this.error(new TomlError('Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z'))\n }\n }\n\n parseTimeZoneOrFraction () {\n if (this.char === CHAR_PERIOD) {\n this.consume()\n this.next(this.parseDateTimeFraction)\n } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {\n this.consume()\n this.next(this.parseTimeZoneHour)\n } else if (this.char === CHAR_Z) {\n this.consume()\n return this.return(createDateTime(this.state.result + this.state.buf))\n } else if (this.atEndOfWord()) {\n return this.returnNow(createDateTimeFloat(this.state.result + this.state.buf))\n } else {\n throw this.error(new TomlError('Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z'))\n }\n }\n parseDateTimeFraction () {\n if (isDigit(this.char)) {\n this.consume()\n } else if (this.state.buf.length === 1) {\n throw this.error(new TomlError('Expected digit in milliseconds'))\n } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {\n this.consume()\n this.next(this.parseTimeZoneHour)\n } else if (this.char === CHAR_Z) {\n this.consume()\n return this.return(createDateTime(this.state.result + this.state.buf))\n } else if (this.atEndOfWord()) {\n return this.returnNow(createDateTimeFloat(this.state.result + this.state.buf))\n } else {\n throw this.error(new TomlError('Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z'))\n }\n }\n parseTimeZoneHour () {\n if (isDigit(this.char)) {\n this.consume()\n // FIXME: No more regexps\n if (/\\d\\d$/.test(this.state.buf)) return this.next(this.parseTimeZoneSep)\n } else {\n throw this.error(new TomlError('Unexpected character in datetime, expected digit'))\n }\n }\n parseTimeZoneSep () {\n if (this.char === CHAR_COLON) {\n this.consume()\n this.next(this.parseTimeZoneMin)\n } else {\n throw this.error(new TomlError('Unexpected character in datetime, expected colon'))\n }\n }\n parseTimeZoneMin () {\n if (isDigit(this.char)) {\n this.consume()\n if (/\\d\\d$/.test(this.state.buf)) return this.return(createDateTime(this.state.result + this.state.buf))\n } else {\n throw this.error(new TomlError('Unexpected character in datetime, expected digit'))\n }\n }\n\n /* BOOLEAN */\n parseBoolean () {\n /* istanbul ignore else */\n if (this.char === CHAR_t) {\n this.consume()\n return this.next(this.parseTrue_r)\n } else if (this.char === CHAR_f) {\n this.consume()\n return this.next(this.parseFalse_a)\n }\n }\n parseTrue_r () {\n if (this.char === CHAR_r) {\n this.consume()\n return this.next(this.parseTrue_u)\n } else {\n throw this.error(new TomlError('Invalid boolean, expected true or false'))\n }\n }\n parseTrue_u () {\n if (this.char === CHAR_u) {\n this.consume()\n return this.next(this.parseTrue_e)\n } else {\n throw this.error(new TomlError('Invalid boolean, expected true or false'))\n }\n }\n parseTrue_e () {\n if (this.char === CHAR_e) {\n return this.return(true)\n } else {\n throw this.error(new TomlError('Invalid boolean, expected true or false'))\n }\n }\n\n parseFalse_a () {\n if (this.char === CHAR_a) {\n this.consume()\n return this.next(this.parseFalse_l)\n } else {\n throw this.error(new TomlError('Invalid boolean, expected true or false'))\n }\n }\n\n parseFalse_l () {\n if (this.char === CHAR_l) {\n this.consume()\n return this.next(this.parseFalse_s)\n } else {\n throw this.error(new TomlError('Invalid boolean, expected true or false'))\n }\n }\n\n parseFalse_s () {\n if (this.char === CHAR_s) {\n this.consume()\n return this.next(this.parseFalse_e)\n } else {\n throw this.error(new TomlError('Invalid boolean, expected true or false'))\n }\n }\n\n parseFalse_e () {\n if (this.char === CHAR_e) {\n return this.return(false)\n } else {\n throw this.error(new TomlError('Invalid boolean, expected true or false'))\n }\n }\n\n /* INLINE LISTS */\n parseInlineList () {\n if (this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M || this.char === CTRL_J) {\n return null\n } else if (this.char === Parser.END) {\n throw this.error(new TomlError('Unterminated inline array'))\n } else if (this.char === CHAR_NUM) {\n return this.call(this.parseComment)\n } else if (this.char === CHAR_RSQB) {\n return this.return(this.state.resultArr || InlineList())\n } else {\n return this.callNow(this.parseValue, this.recordInlineListValue)\n }\n }\n recordInlineListValue (value) {\n if (!this.state.resultArr) {\n this.state.resultArr = InlineList(tomlType(value))\n }\n if (isFloat(value) || isInteger(value)) {\n // unbox now that we've verified they're ok\n this.state.resultArr.push(value.valueOf())\n } else {\n this.state.resultArr.push(value)\n }\n return this.goto(this.parseInlineListNext)\n }\n parseInlineListNext () {\n if (this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M || this.char === CTRL_J) {\n return null\n } else if (this.char === CHAR_NUM) {\n return this.call(this.parseComment)\n } else if (this.char === CHAR_COMMA) {\n return this.next(this.parseInlineList)\n } else if (this.char === CHAR_RSQB) {\n return this.goto(this.parseInlineList)\n } else {\n throw this.error(new TomlError('Invalid character, expected whitespace, comma (,) or close bracket (])'))\n }\n }\n\n /* INLINE TABLE */\n parseInlineTable () {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else if (this.char === Parser.END || this.char === CHAR_NUM || this.char === CTRL_J || this.char === CTRL_M) {\n throw this.error(new TomlError('Unterminated inline array'))\n } else if (this.char === CHAR_RCUB) {\n return this.return(this.state.resultTable || InlineTable())\n } else {\n if (!this.state.resultTable) this.state.resultTable = InlineTable()\n return this.callNow(this.parseAssign, this.recordInlineTableValue)\n }\n }\n recordInlineTableValue (kv) {\n let target = this.state.resultTable\n let finalKey = kv.key.pop()\n for (let kw of kv.key) {\n if (hasKey(target, kw) && (!isTable(target[kw]) || target[kw][_declared])) {\n throw this.error(new TomlError(\"Can't redefine existing key\"))\n }\n target = target[kw] = target[kw] || Table()\n }\n if (hasKey(target, finalKey)) {\n throw this.error(new TomlError(\"Can't redefine existing key\"))\n }\n if (isInteger(kv.value) || isFloat(kv.value)) {\n target[finalKey] = kv.value.valueOf()\n } else {\n target[finalKey] = kv.value\n }\n return this.goto(this.parseInlineTableNext)\n }\n parseInlineTableNext () {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else if (this.char === Parser.END || this.char === CHAR_NUM || this.char === CTRL_J || this.char === CTRL_M) {\n throw this.error(new TomlError('Unterminated inline array'))\n } else if (this.char === CHAR_COMMA) {\n return this.next(this.parseInlineTablePostComma)\n } else if (this.char === CHAR_RCUB) {\n return this.goto(this.parseInlineTable)\n } else {\n throw this.error(new TomlError('Invalid character, expected whitespace, comma (,) or close bracket (])'))\n }\n }\n parseInlineTablePostComma () {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else if (this.char === Parser.END || this.char === CHAR_NUM || this.char === CTRL_J || this.char === CTRL_M) {\n throw this.error(new TomlError('Unterminated inline array'))\n } else if (this.char === CHAR_COMMA) {\n throw this.error(new TomlError('Empty elements in inline tables are not permitted'))\n } else if (this.char === CHAR_RCUB) {\n throw this.error(new TomlError('Trailing commas in inline tables are not permitted'))\n } else {\n return this.goto(this.parseInlineTable)\n }\n }\n }\n return TOMLParser\n}\n","'use strict'\nmodule.exports = prettyError\n\nfunction prettyError (err, buf) {\n /* istanbul ignore if */\n if (err.pos == null || err.line == null) return err\n let msg = err.message\n msg += ` at row ${err.line + 1}, col ${err.col + 1}, pos ${err.pos}:\\n`\n\n /* istanbul ignore else */\n if (buf && buf.split) {\n const lines = buf.split(/\\n/)\n const lineNumWidth = String(Math.min(lines.length, err.line + 3)).length\n let linePadding = ' '\n while (linePadding.length < lineNumWidth) linePadding += ' '\n for (let ii = Math.max(0, err.line - 1); ii < Math.min(lines.length, err.line + 2); ++ii) {\n let lineNum = String(ii + 1)\n if (lineNum.length < lineNumWidth) lineNum = ' ' + lineNum\n if (err.line === ii) {\n msg += lineNum + '> ' + lines[ii] + '\\n'\n msg += linePadding + ' '\n for (let hh = 0; hh < err.col; ++hh) {\n msg += ' '\n }\n msg += '^\\n'\n } else {\n msg += lineNum + ': ' + lines[ii] + '\\n'\n }\n }\n }\n err.message = msg + '\\n'\n return err\n}\n","'use strict'\nmodule.exports = parseString\n\nconst TOMLParser = require('./lib/toml-parser.js')\nconst prettyError = require('./parse-pretty-error.js')\n\nfunction parseString (str) {\n if (global.Buffer && global.Buffer.isBuffer(str)) {\n str = str.toString('utf8')\n }\n const parser = new TOMLParser()\n try {\n parser.parse(str)\n return parser.finish()\n } catch (err) {\n throw prettyError(err, str)\n }\n}\n","'use strict'\nmodule.exports = parseAsync\n\nconst TOMLParser = require('./lib/toml-parser.js')\nconst prettyError = require('./parse-pretty-error.js')\n\nfunction parseAsync (str, opts) {\n if (!opts) opts = {}\n const index = 0\n const blocksize = opts.blocksize || 40960\n const parser = new TOMLParser()\n return new Promise((resolve, reject) => {\n setImmediate(parseAsyncNext, index, blocksize, resolve, reject)\n })\n function parseAsyncNext (index, blocksize, resolve, reject) {\n if (index >= str.length) {\n try {\n return resolve(parser.finish())\n } catch (err) {\n return reject(prettyError(err, str))\n }\n }\n try {\n parser.parse(str.slice(index, index + blocksize))\n setImmediate(parseAsyncNext, index + blocksize, blocksize, resolve, reject)\n } catch (err) {\n reject(prettyError(err, str))\n }\n }\n}\n","'use strict'\nmodule.exports = parseStream\n\nconst stream = require('stream')\nconst TOMLParser = require('./lib/toml-parser.js')\n\nfunction parseStream (stm) {\n if (stm) {\n return parseReadable(stm)\n } else {\n return parseTransform(stm)\n }\n}\n\nfunction parseReadable (stm) {\n const parser = new TOMLParser()\n stm.setEncoding('utf8')\n return new Promise((resolve, reject) => {\n let readable\n let ended = false\n let errored = false\n function finish () {\n ended = true\n if (readable) return\n try {\n resolve(parser.finish())\n } catch (err) {\n reject(err)\n }\n }\n function error (err) {\n errored = true\n reject(err)\n }\n stm.once('end', finish)\n stm.once('error', error)\n readNext()\n\n function readNext () {\n readable = true\n let data\n while ((data = stm.read()) !== null) {\n try {\n parser.parse(data)\n } catch (err) {\n return error(err)\n }\n }\n readable = false\n /* istanbul ignore if */\n if (ended) return finish()\n /* istanbul ignore if */\n if (errored) return\n stm.once('readable', readNext)\n }\n })\n}\n\nfunction parseTransform () {\n const parser = new TOMLParser()\n return new stream.Transform({\n objectMode: true,\n transform (chunk, encoding, cb) {\n try {\n parser.parse(chunk.toString(encoding))\n } catch (err) {\n this.emit('error', err)\n }\n cb()\n },\n flush (cb) {\n try {\n this.push(parser.finish())\n } catch (err) {\n this.emit('error', err)\n }\n cb()\n }\n })\n}\n","'use strict'\nmodule.exports = stringify\nmodule.exports.value = stringifyInline\n\nfunction stringify (obj) {\n if (obj === null) throw typeError('null')\n if (obj === void (0)) throw typeError('undefined')\n if (typeof obj !== 'object') throw typeError(typeof obj)\n\n if (typeof obj.toJSON === 'function') obj = obj.toJSON()\n if (obj == null) return null\n const type = tomlType(obj)\n if (type !== 'table') throw typeError(type)\n return stringifyObject('', '', obj)\n}\n\nfunction typeError (type) {\n return new Error('Can only stringify objects, not ' + type)\n}\n\nfunction getInlineKeys (obj) {\n return Object.keys(obj).filter(key => isInline(obj[key]))\n}\nfunction getComplexKeys (obj) {\n return Object.keys(obj).filter(key => !isInline(obj[key]))\n}\n\nfunction toJSON (obj) {\n let nobj = Array.isArray(obj) ? [] : Object.prototype.hasOwnProperty.call(obj, '__proto__') ? {['__proto__']: undefined} : {}\n for (let prop of Object.keys(obj)) {\n if (obj[prop] && typeof obj[prop].toJSON === 'function' && !('toISOString' in obj[prop])) {\n nobj[prop] = obj[prop].toJSON()\n } else {\n nobj[prop] = obj[prop]\n }\n }\n return nobj\n}\n\nfunction stringifyObject (prefix, indent, obj) {\n obj = toJSON(obj)\n let inlineKeys\n let complexKeys\n inlineKeys = getInlineKeys(obj)\n complexKeys = getComplexKeys(obj)\n const result = []\n const inlineIndent = indent || ''\n inlineKeys.forEach(key => {\n var type = tomlType(obj[key])\n if (type !== 'undefined' && type !== 'null') {\n result.push(inlineIndent + stringifyKey(key) + ' = ' + stringifyAnyInline(obj[key], true))\n }\n })\n if (result.length > 0) result.push('')\n const complexIndent = prefix && inlineKeys.length > 0 ? indent + ' ' : ''\n complexKeys.forEach(key => {\n result.push(stringifyComplex(prefix, complexIndent, key, obj[key]))\n })\n return result.join('\\n')\n}\n\nfunction isInline (value) {\n switch (tomlType(value)) {\n case 'undefined':\n case 'null':\n case 'integer':\n case 'nan':\n case 'float':\n case 'boolean':\n case 'string':\n case 'datetime':\n return true\n case 'array':\n return value.length === 0 || tomlType(value[0]) !== 'table'\n case 'table':\n return Object.keys(value).length === 0\n /* istanbul ignore next */\n default:\n return false\n }\n}\n\nfunction tomlType (value) {\n if (value === undefined) {\n return 'undefined'\n } else if (value === null) {\n return 'null'\n /* eslint-disable valid-typeof */\n } else if (typeof value === 'bigint' || (Number.isInteger(value) && !Object.is(value, -0))) {\n return 'integer'\n } else if (typeof value === 'number') {\n return 'float'\n } else if (typeof value === 'boolean') {\n return 'boolean'\n } else if (typeof value === 'string') {\n return 'string'\n } else if ('toISOString' in value) {\n return isNaN(value) ? 'undefined' : 'datetime'\n } else if (Array.isArray(value)) {\n return 'array'\n } else {\n return 'table'\n }\n}\n\nfunction stringifyKey (key) {\n const keyStr = String(key)\n if (/^[-A-Za-z0-9_]+$/.test(keyStr)) {\n return keyStr\n } else {\n return stringifyBasicString(keyStr)\n }\n}\n\nfunction stringifyBasicString (str) {\n return '\"' + escapeString(str).replace(/\"/g, '\\\\\"') + '\"'\n}\n\nfunction stringifyLiteralString (str) {\n return \"'\" + str + \"'\"\n}\n\nfunction numpad (num, str) {\n while (str.length < num) str = '0' + str\n return str\n}\n\nfunction escapeString (str) {\n return str.replace(/\\\\/g, '\\\\\\\\')\n .replace(/[\\b]/g, '\\\\b')\n .replace(/\\t/g, '\\\\t')\n .replace(/\\n/g, '\\\\n')\n .replace(/\\f/g, '\\\\f')\n .replace(/\\r/g, '\\\\r')\n /* eslint-disable no-control-regex */\n .replace(/([\\u0000-\\u001f\\u007f])/, c => '\\\\u' + numpad(4, c.codePointAt(0).toString(16)))\n /* eslint-enable no-control-regex */\n}\n\nfunction stringifyMultilineString (str) {\n let escaped = str.split(/\\n/).map(str => {\n return escapeString(str).replace(/\"(?=\"\")/g, '\\\\\"')\n }).join('\\n')\n if (escaped.slice(-1) === '\"') escaped += '\\\\\\n'\n return '\"\"\"\\n' + escaped + '\"\"\"'\n}\n\nfunction stringifyAnyInline (value, multilineOk) {\n let type = tomlType(value)\n if (type === 'string') {\n if (multilineOk && /\\n/.test(value)) {\n type = 'string-multiline'\n } else if (!/[\\b\\t\\n\\f\\r']/.test(value) && /\"/.test(value)) {\n type = 'string-literal'\n }\n }\n return stringifyInline(value, type)\n}\n\nfunction stringifyInline (value, type) {\n /* istanbul ignore if */\n if (!type) type = tomlType(value)\n switch (type) {\n case 'string-multiline':\n return stringifyMultilineString(value)\n case 'string':\n return stringifyBasicString(value)\n case 'string-literal':\n return stringifyLiteralString(value)\n case 'integer':\n return stringifyInteger(value)\n case 'float':\n return stringifyFloat(value)\n case 'boolean':\n return stringifyBoolean(value)\n case 'datetime':\n return stringifyDatetime(value)\n case 'array':\n return stringifyInlineArray(value.filter(_ => tomlType(_) !== 'null' && tomlType(_) !== 'undefined' && tomlType(_) !== 'nan'))\n case 'table':\n return stringifyInlineTable(value)\n /* istanbul ignore next */\n default:\n throw typeError(type)\n }\n}\n\nfunction stringifyInteger (value) {\n /* eslint-disable security/detect-unsafe-regex */\n return String(value).replace(/\\B(?=(\\d{3})+(?!\\d))/g, '_')\n}\n\nfunction stringifyFloat (value) {\n if (value === Infinity) {\n return 'inf'\n } else if (value === -Infinity) {\n return '-inf'\n } else if (Object.is(value, NaN)) {\n return 'nan'\n } else if (Object.is(value, -0)) {\n return '-0.0'\n }\n const [int, dec] = String(value).split('.')\n return stringifyInteger(int) + '.' + dec\n}\n\nfunction stringifyBoolean (value) {\n return String(value)\n}\n\nfunction stringifyDatetime (value) {\n return value.toISOString()\n}\n\nfunction stringifyInlineArray (values) {\n values = toJSON(values)\n let result = '['\n const stringified = values.map(_ => stringifyInline(_))\n if (stringified.join(', ').length > 60 || /\\n/.test(stringified)) {\n result += '\\n ' + stringified.join(',\\n ') + '\\n'\n } else {\n result += ' ' + stringified.join(', ') + (stringified.length > 0 ? ' ' : '')\n }\n return result + ']'\n}\n\nfunction stringifyInlineTable (value) {\n value = toJSON(value)\n const result = []\n Object.keys(value).forEach(key => {\n result.push(stringifyKey(key) + ' = ' + stringifyAnyInline(value[key], false))\n })\n return '{ ' + result.join(', ') + (result.length > 0 ? ' ' : '') + '}'\n}\n\nfunction stringifyComplex (prefix, indent, key, value) {\n const valueType = tomlType(value)\n /* istanbul ignore else */\n if (valueType === 'array') {\n return stringifyArrayOfTables(prefix, indent, key, value)\n } else if (valueType === 'table') {\n return stringifyComplexTable(prefix, indent, key, value)\n } else {\n throw typeError(valueType)\n }\n}\n\nfunction stringifyArrayOfTables (prefix, indent, key, values) {\n values = toJSON(values)\n const firstValueType = tomlType(values[0])\n /* istanbul ignore if */\n if (firstValueType !== 'table') throw typeError(firstValueType)\n const fullKey = prefix + stringifyKey(key)\n let result = ''\n values.forEach(table => {\n if (result.length > 0) result += '\\n'\n result += indent + '[[' + fullKey + ']]\\n'\n result += stringifyObject(fullKey + '.', indent, table)\n })\n return result\n}\n\nfunction stringifyComplexTable (prefix, indent, key, value) {\n const fullKey = prefix + stringifyKey(key)\n let result = ''\n if (getInlineKeys(value).length > 0) {\n result += indent + '[' + fullKey + ']\\n'\n }\n return result + stringifyObject(fullKey + '.', indent, value)\n}\n","/* eslint no-unsafe-finally: \"off\" */\nimport * as core from '@actions/core';\nimport fs from 'fs';\nimport * as path from 'path';\nimport * as semver from 'semver';\nimport * as toml from '@iarna/toml';\nimport * as exec from '@actions/exec';\nimport * as ifm from '@actions/http-client/lib/interfaces';\n\nimport * as http from 'http';\n\nexport const IS_WINDOWS = process.platform === 'win32';\nexport const IS_LINUX = process.platform === 'linux';\nexport const IS_MAC = process.platform === 'darwin';\nexport const WINDOWS_ARCHS = ['x86', 'x64'];\nexport const WINDOWS_PLATFORMS = ['win32', 'win64'];\nconst PYPY_VERSION_FILE = 'PYPY_VERSION';\n\nexport interface IPyPyManifestAsset {\n filename: string;\n arch: string;\n platform: string;\n download_url: string;\n}\n\nexport interface IPyPyManifestRelease {\n pypy_version: string;\n python_version: string;\n stable: boolean;\n latest_pypy: boolean;\n files: IPyPyManifestAsset[];\n}\n\nexport interface IGraalPyManifestAsset {\n name: string;\n browser_download_url: string;\n}\n\nexport interface IGraalPyManifestRelease {\n tag_name: string;\n assets: IGraalPyManifestAsset[];\n}\n\n/** create Symlinks for downloaded PyPy\n * It should be executed only for downloaded versions in runtime, because\n * toolcache versions have this setup.\n */\nexport function createSymlinkInFolder(\n folderPath: string,\n sourceName: string,\n targetName: string,\n setExecutable = false\n) {\n const sourcePath = path.join(folderPath, sourceName);\n const targetPath = path.join(folderPath, targetName);\n if (fs.existsSync(targetPath)) {\n return;\n }\n\n fs.symlinkSync(sourcePath, targetPath);\n if (!IS_WINDOWS && setExecutable) {\n fs.chmodSync(targetPath, '755');\n }\n}\n\nexport function validateVersion(version: string) {\n return isNightlyKeyword(version) || Boolean(semver.validRange(version));\n}\n\nexport function isNightlyKeyword(pypyVersion: string) {\n return pypyVersion === 'nightly';\n}\n\nexport function getPyPyVersionFromPath(installDir: string) {\n return path.basename(path.dirname(installDir));\n}\n\n/**\n * In tool-cache, we put PyPy to '/PyPy//x64'\n * There is no easy way to determine what PyPy version is located in specific folder\n * 'pypy --version' is not reliable enough since it is not set properly for preview versions\n * \"7.3.3rc1\" is marked as '7.3.3' in 'pypy --version'\n * so we put PYPY_VERSION file to PyPy directory when install it to VM and read it when we need to know version\n * PYPY_VERSION contains exact version from 'versions.json'\n */\nexport function readExactPyPyVersionFile(installDir: string) {\n let pypyVersion = '';\n const fileVersion = path.join(installDir, PYPY_VERSION_FILE);\n if (fs.existsSync(fileVersion)) {\n pypyVersion = fs.readFileSync(fileVersion).toString().trim();\n }\n\n return pypyVersion;\n}\n\nexport function writeExactPyPyVersionFile(\n installDir: string,\n resolvedPyPyVersion: string\n) {\n const pypyFilePath = path.join(installDir, PYPY_VERSION_FILE);\n fs.writeFileSync(pypyFilePath, resolvedPyPyVersion);\n}\n\n/**\n * Python version should be specified explicitly like \"x.y\" (3.10, 3.11, etc)\n * \"3.x\" or \"3\" are not supported\n * because it could cause ambiguity when both PyPy version and Python version are not precise\n */\nexport function validatePythonVersionFormatForPyPy(version: string) {\n const re = /^\\d+\\.\\d+$/;\n return re.test(version);\n}\n\nexport function logWarning(message: string): void {\n const warningPrefix = '[warning]';\n core.info(`${warningPrefix}${message}`);\n}\n\nasync function getWindowsInfo() {\n const {stdout} = await exec.getExecOutput(\n 'powershell -command \"(Get-CimInstance -ClassName Win32_OperatingSystem).Caption\"',\n undefined,\n {\n silent: true\n }\n );\n\n const windowsVersion = stdout.trim().split(' ')[3];\n\n return {osName: 'Windows', osVersion: windowsVersion};\n}\n\nasync function getMacOSInfo() {\n const {stdout} = await exec.getExecOutput('sw_vers', ['-productVersion'], {\n silent: true\n });\n\n const macOSVersion = stdout.trim();\n\n return {osName: 'macOS', osVersion: macOSVersion};\n}\n\nexport async function getLinuxInfo() {\n const {stdout} = await exec.getExecOutput('lsb_release', ['-i', '-r', '-s'], {\n silent: true\n });\n\n const [osName, osVersion] = stdout.trim().split('\\n');\n\n core.debug(`OS Name: ${osName}, Version: ${osVersion}`);\n\n return {osName: osName, osVersion: osVersion};\n}\n\nexport async function getOSInfo() {\n let osInfo;\n try {\n if (IS_WINDOWS) {\n osInfo = await getWindowsInfo();\n } else if (IS_LINUX) {\n osInfo = await getLinuxInfo();\n } else if (IS_MAC) {\n osInfo = await getMacOSInfo();\n }\n } catch (err) {\n const error = err as Error;\n core.debug(error.message);\n } finally {\n return osInfo;\n }\n}\n\n/**\n * Extract a value from an object by following the keys path provided.\n * If the value is present, it is returned. Otherwise undefined is returned.\n */\nfunction extractValue(obj: any, keys: string[]): string | undefined {\n if (keys.length > 0) {\n const value = obj[keys[0]];\n if (keys.length > 1 && value !== undefined) {\n return extractValue(value, keys.slice(1));\n } else {\n return value;\n }\n } else {\n return;\n }\n}\n\n/**\n * Python version extracted from the TOML file.\n * If the `project` key is present at the root level, the version is assumed to\n * be specified according to PEP 621 in `project.requires-python`.\n * Otherwise, if the `tool` key is present at the root level, the version is\n * assumed to be specified using poetry under `tool.poetry.dependencies.python`.\n * If none is present, returns an empty list.\n */\nexport function getVersionInputFromTomlFile(versionFile: string): string[] {\n core.debug(`Trying to resolve version form ${versionFile}`);\n\n let pyprojectFile = fs.readFileSync(versionFile, 'utf8');\n // Normalize the line endings in the pyprojectFile\n pyprojectFile = pyprojectFile.replace(/\\r\\n/g, '\\n');\n\n const pyprojectConfig = toml.parse(pyprojectFile);\n let keys = [];\n\n if ('project' in pyprojectConfig) {\n // standard project metadata (PEP 621)\n keys = ['project', 'requires-python'];\n } else {\n // python poetry\n keys = ['tool', 'poetry', 'dependencies', 'python'];\n }\n const versions = [];\n const version = extractValue(pyprojectConfig, keys);\n if (version !== undefined) {\n versions.push(version);\n }\n\n core.info(`Extracted ${versions} from ${versionFile}`);\n const rawVersions = Array.from(versions, version =>\n version.split(',').join(' ')\n );\n const validatedVersions = rawVersions\n .map(item => semver.validRange(item, true))\n .filter((versionRange, index) => {\n if (!versionRange) {\n core.debug(\n `The version ${rawVersions[index]} is not valid SemVer range`\n );\n }\n\n return !!versionRange;\n }) as string[];\n return validatedVersions;\n}\n\n/**\n * Python version extracted from a plain text file.\n */\nexport function getVersionInputFromPlainFile(versionFile: string): string[] {\n core.debug(`Trying to resolve version form ${versionFile}`);\n const version = fs.readFileSync(versionFile, 'utf8').trim();\n core.info(`Resolved ${versionFile} as ${version}`);\n return [version];\n}\n\n/**\n * Python version extracted from a plain or TOML file.\n */\nexport function getVersionInputFromFile(versionFile: string): string[] {\n if (versionFile.endsWith('.toml')) {\n return getVersionInputFromTomlFile(versionFile);\n } else {\n return getVersionInputFromPlainFile(versionFile);\n }\n}\n\n/**\n * Get the directory containing interpreter binary from installation directory of PyPy or GraalPy\n * - On Linux and macOS, the Python interpreter is in 'bin'.\n * - On Windows, it is in the installation root.\n */\nexport function getBinaryDirectory(installDir: string) {\n return IS_WINDOWS ? installDir : path.join(installDir, 'bin');\n}\n\n/**\n * Extract next page URL from a HTTP response \"link\" header. Such headers are used in GitHub APIs.\n */\nexport function getNextPageUrl(response: ifm.TypedResponse) {\n const responseHeaders = response.headers;\n const linkHeader = responseHeaders.link;\n if (typeof linkHeader === 'string') {\n for (const link of linkHeader.split(/\\s*,\\s*/)) {\n const match = link.match(/<([^>]+)>(.*)/);\n if (match) {\n const url = match[1];\n for (const param of match[2].split(/\\s*;\\s*/)) {\n if (param.match(/rel=\"?next\"?/)) {\n return url;\n }\n }\n }\n }\n }\n return null;\n}\n\n/**\n * Add temporary fix for Windows\n * On Windows, it is necessary to retain the .zip extension for proper extraction.\n * because the tc.extractZip() failure due to tc.downloadTool() not adding .zip extension.\n * Related issue: https://github.com/actions/toolkit/issues/1179\n * Related issue: https://github.com/actions/setup-python/issues/819\n */\nexport function getDownloadFileName(downloadUrl: string): string | undefined {\n const tempDir = process.env.RUNNER_TEMP || '.';\n return IS_WINDOWS\n ? path.join(tempDir, path.basename(downloadUrl))\n : undefined;\n}\n","import * as os from 'os';\nimport * as path from 'path';\nimport * as core from '@actions/core';\nimport * as tc from '@actions/tool-cache';\nimport * as semver from 'semver';\nimport * as httpm from '@actions/http-client';\nimport * as exec from '@actions/exec';\nimport fs from 'fs';\n\nimport {\n IS_WINDOWS,\n WINDOWS_PLATFORMS,\n IPyPyManifestRelease,\n createSymlinkInFolder,\n isNightlyKeyword,\n writeExactPyPyVersionFile,\n getBinaryDirectory,\n getDownloadFileName\n} from './utils';\n\nexport async function installPyPy(\n pypyVersion: string,\n pythonVersion: string,\n architecture: string,\n allowPreReleases: boolean,\n releases: IPyPyManifestRelease[] | undefined\n) {\n let downloadDir;\n\n releases = releases ?? (await getAvailablePyPyVersions());\n\n if (!releases || releases.length === 0) {\n throw new Error('No release was found in PyPy version.json');\n }\n\n let releaseData = findRelease(\n releases,\n pythonVersion,\n pypyVersion,\n architecture,\n false\n );\n\n if (allowPreReleases && (!releaseData || !releaseData.foundAsset)) {\n // check for pre-release\n core.info(\n [\n `Stable PyPy version ${pythonVersion} (${pypyVersion}) with arch ${architecture} not found`,\n `Trying pre-release versions`\n ].join(os.EOL)\n );\n releaseData = findRelease(\n releases,\n pythonVersion,\n pypyVersion,\n architecture,\n true\n );\n }\n\n if (!releaseData || !releaseData.foundAsset) {\n throw new Error(\n `PyPy version ${pythonVersion} (${pypyVersion}) with arch ${architecture} not found`\n );\n }\n\n const {foundAsset, resolvedPythonVersion, resolvedPyPyVersion} = releaseData;\n const downloadUrl = `${foundAsset.download_url}`;\n\n core.info(`Downloading PyPy from \"${downloadUrl}\" ...`);\n\n try {\n const fileName = getDownloadFileName(downloadUrl);\n const pypyPath = await tc.downloadTool(downloadUrl, fileName);\n\n core.info('Extracting downloaded archive...');\n if (IS_WINDOWS) {\n downloadDir = await tc.extractZip(pypyPath);\n } else {\n downloadDir = await tc.extractTar(pypyPath, undefined, 'x');\n }\n\n // root folder in archive can have unpredictable name so just take the first folder\n // downloadDir is unique folder under TEMP and can't contain any other folders\n const archiveName = fs.readdirSync(downloadDir)[0];\n\n const toolDir = path.join(downloadDir, archiveName);\n let installDir = toolDir;\n if (!isNightlyKeyword(resolvedPyPyVersion)) {\n installDir = await tc.cacheDir(\n toolDir,\n 'PyPy',\n resolvedPythonVersion,\n architecture\n );\n }\n\n writeExactPyPyVersionFile(installDir, resolvedPyPyVersion);\n\n const binaryPath = getBinaryDirectory(installDir);\n await createPyPySymlink(binaryPath, resolvedPythonVersion);\n await installPip(binaryPath);\n\n return {installDir, resolvedPythonVersion, resolvedPyPyVersion};\n } catch (err) {\n if (err instanceof Error) {\n // Rate limit?\n if (\n err instanceof tc.HTTPError &&\n (err.httpStatusCode === 403 || err.httpStatusCode === 429)\n ) {\n core.info(\n `Received HTTP status code ${err.httpStatusCode}. This usually indicates the rate limit has been exceeded`\n );\n } else {\n core.info(err.message);\n }\n if (err.stack !== undefined) {\n core.debug(err.stack);\n }\n }\n throw err;\n }\n}\n\nexport async function getAvailablePyPyVersions() {\n const url = 'https://downloads.python.org/pypy/versions.json';\n const http: httpm.HttpClient = new httpm.HttpClient('tool-cache');\n\n const response = await http.getJson(url);\n if (!response.result) {\n throw new Error(\n `Unable to retrieve the list of available PyPy versions from '${url}'`\n );\n }\n\n return response.result;\n}\n\nasync function createPyPySymlink(\n pypyBinaryPath: string,\n pythonVersion: string\n) {\n const version = semver.coerce(pythonVersion)!;\n const pythonBinaryPostfix = semver.major(version);\n const pythonMinor = semver.minor(version);\n const pypyBinaryPostfix = pythonBinaryPostfix === 2 ? '' : '3';\n const pypyMajorMinorBinaryPostfix = `${pythonBinaryPostfix}.${pythonMinor}`;\n const binaryExtension = IS_WINDOWS ? '.exe' : '';\n\n core.info('Creating symlinks...');\n createSymlinkInFolder(\n pypyBinaryPath,\n `pypy${pypyBinaryPostfix}${binaryExtension}`,\n `python${pythonBinaryPostfix}${binaryExtension}`,\n true\n );\n\n createSymlinkInFolder(\n pypyBinaryPath,\n `pypy${pypyBinaryPostfix}${binaryExtension}`,\n `python${binaryExtension}`,\n true\n );\n\n createSymlinkInFolder(\n pypyBinaryPath,\n `pypy${pypyBinaryPostfix}${binaryExtension}`,\n `pypy${pypyMajorMinorBinaryPostfix}${binaryExtension}`,\n true\n );\n}\n\nasync function installPip(pythonLocation: string) {\n core.info('Installing and updating pip');\n const pythonBinary = path.join(pythonLocation, 'python');\n await exec.exec(`${pythonBinary} -m ensurepip`);\n\n await exec.exec(\n `${pythonLocation}/python -m pip install --ignore-installed pip`\n );\n}\n\nexport function findRelease(\n releases: IPyPyManifestRelease[],\n pythonVersion: string,\n pypyVersion: string,\n architecture: string,\n includePrerelease: boolean\n) {\n const options = {includePrerelease: includePrerelease};\n const filterReleases = releases.filter(item => {\n const isPythonVersionSatisfied = semver.satisfies(\n semver.coerce(item.python_version)!,\n pythonVersion\n );\n const isPyPyNightly =\n isNightlyKeyword(pypyVersion) && isNightlyKeyword(item.pypy_version);\n const isPyPyVersionSatisfied =\n isPyPyNightly ||\n semver.satisfies(\n pypyVersionToSemantic(item.pypy_version),\n pypyVersion,\n options\n );\n const isArchPresent =\n item.files &&\n (IS_WINDOWS\n ? isArchPresentForWindows(item, architecture)\n : isArchPresentForMacOrLinux(item, architecture, process.platform));\n return isPythonVersionSatisfied && isPyPyVersionSatisfied && isArchPresent;\n });\n\n if (filterReleases.length === 0) {\n return null;\n }\n\n const sortedReleases = filterReleases.sort((previous, current) => {\n return (\n semver.compare(\n semver.coerce(pypyVersionToSemantic(current.pypy_version))!,\n semver.coerce(pypyVersionToSemantic(previous.pypy_version))!\n ) ||\n semver.compare(\n semver.coerce(current.python_version)!,\n semver.coerce(previous.python_version)!\n )\n );\n });\n\n const foundRelease = sortedReleases[0];\n const foundAsset = IS_WINDOWS\n ? findAssetForWindows(foundRelease, architecture)\n : findAssetForMacOrLinux(foundRelease, architecture, process.platform);\n\n return {\n foundAsset,\n resolvedPythonVersion: foundRelease.python_version,\n resolvedPyPyVersion: foundRelease.pypy_version.trim()\n };\n}\n\nexport function pypyVersionToSemantic(versionSpec: string) {\n const prereleaseVersion = /(\\d+\\.\\d+\\.\\d+)((?:a|b|rc))(\\d*)/g;\n return versionSpec.replace(prereleaseVersion, '$1-$2.$3');\n}\n\nexport function isArchPresentForWindows(item: any, architecture: string) {\n architecture = replaceX32toX86(architecture);\n return item.files.some(\n (file: any) =>\n WINDOWS_PLATFORMS.includes(file.platform) && file.arch === architecture\n );\n}\n\nexport function isArchPresentForMacOrLinux(\n item: any,\n architecture: string,\n platform: string\n) {\n return item.files.some(\n (file: any) => file.arch === architecture && file.platform === platform\n );\n}\n\nexport function findAssetForWindows(releases: any, architecture: string) {\n architecture = replaceX32toX86(architecture);\n return releases.files.find(\n (item: any) =>\n WINDOWS_PLATFORMS.includes(item.platform) && item.arch === architecture\n );\n}\n\nexport function findAssetForMacOrLinux(\n releases: any,\n architecture: string,\n platform: string\n) {\n return releases.files.find(\n (item: any) => item.arch === architecture && item.platform === platform\n );\n}\n\nfunction replaceX32toX86(architecture: string): string {\n // convert x32 to x86 because os.arch() returns x32 for 32-bit systems but PyPy releases json has x86 arch value.\n if (architecture === 'x32') {\n architecture = 'x86';\n }\n return architecture;\n}\n","import * as path from 'path';\nimport * as pypyInstall from './install-pypy';\nimport {\n IS_WINDOWS,\n WINDOWS_ARCHS,\n validateVersion,\n getPyPyVersionFromPath,\n readExactPyPyVersionFile,\n validatePythonVersionFormatForPyPy,\n IPyPyManifestRelease,\n getBinaryDirectory\n} from './utils';\n\nimport * as semver from 'semver';\nimport * as core from '@actions/core';\nimport * as tc from '@actions/tool-cache';\n\ninterface IPyPyVersionSpec {\n pypyVersion: string;\n pythonVersion: string;\n}\n\nexport async function findPyPyVersion(\n versionSpec: string,\n architecture: string,\n updateEnvironment: boolean,\n checkLatest: boolean,\n allowPreReleases: boolean\n): Promise<{resolvedPyPyVersion: string; resolvedPythonVersion: string}> {\n let resolvedPyPyVersion = '';\n let resolvedPythonVersion = '';\n let installDir: string | null;\n let releases: IPyPyManifestRelease[] | undefined;\n\n const pypyVersionSpec = parsePyPyVersion(versionSpec);\n\n if (checkLatest) {\n releases = await pypyInstall.getAvailablePyPyVersions();\n if (releases && releases.length > 0) {\n const releaseData = pypyInstall.findRelease(\n releases,\n pypyVersionSpec.pythonVersion,\n pypyVersionSpec.pypyVersion,\n architecture,\n false\n );\n\n if (releaseData) {\n core.info(\n `Resolved as PyPy ${releaseData.resolvedPyPyVersion} with Python (${releaseData.resolvedPythonVersion})`\n );\n pypyVersionSpec.pythonVersion = releaseData.resolvedPythonVersion;\n pypyVersionSpec.pypyVersion = releaseData.resolvedPyPyVersion;\n } else {\n core.info(\n `Failed to resolve PyPy ${pypyVersionSpec.pypyVersion} with Python (${pypyVersionSpec.pythonVersion}) from manifest`\n );\n }\n }\n }\n\n ({installDir, resolvedPythonVersion, resolvedPyPyVersion} = findPyPyToolCache(\n pypyVersionSpec.pythonVersion,\n pypyVersionSpec.pypyVersion,\n architecture\n ));\n\n if (!installDir) {\n ({installDir, resolvedPythonVersion, resolvedPyPyVersion} =\n await pypyInstall.installPyPy(\n pypyVersionSpec.pypyVersion,\n pypyVersionSpec.pythonVersion,\n architecture,\n allowPreReleases,\n releases\n ));\n }\n\n const pipDir = IS_WINDOWS ? 'Scripts' : 'bin';\n const _binDir = path.join(installDir, pipDir);\n const binaryExtension = IS_WINDOWS ? '.exe' : '';\n const pythonPath = path.join(\n IS_WINDOWS ? installDir : _binDir,\n `python${binaryExtension}`\n );\n const pythonLocation = getBinaryDirectory(installDir);\n if (updateEnvironment) {\n core.exportVariable('pythonLocation', installDir);\n // https://cmake.org/cmake/help/latest/module/FindPython.html#module:FindPython\n core.exportVariable('Python_ROOT_DIR', installDir);\n // https://cmake.org/cmake/help/latest/module/FindPython2.html#module:FindPython2\n core.exportVariable('Python2_ROOT_DIR', installDir);\n // https://cmake.org/cmake/help/latest/module/FindPython3.html#module:FindPython3\n core.exportVariable('Python3_ROOT_DIR', installDir);\n core.exportVariable('PKG_CONFIG_PATH', pythonLocation + '/lib/pkgconfig');\n core.addPath(pythonLocation);\n core.addPath(_binDir);\n }\n core.setOutput('python-version', 'pypy' + resolvedPyPyVersion);\n core.setOutput('python-path', pythonPath);\n\n return {resolvedPyPyVersion, resolvedPythonVersion};\n}\n\nexport function findPyPyToolCache(\n pythonVersion: string,\n pypyVersion: string,\n architecture: string\n) {\n let resolvedPyPyVersion = '';\n let resolvedPythonVersion = '';\n let installDir: string | null = IS_WINDOWS\n ? findPyPyInstallDirForWindows(pythonVersion)\n : tc.find('PyPy', pythonVersion, architecture);\n\n if (installDir) {\n // 'tc.find' finds tool based on Python version but we also need to check\n // whether PyPy version satisfies requested version.\n resolvedPythonVersion = getPyPyVersionFromPath(installDir);\n resolvedPyPyVersion = readExactPyPyVersionFile(installDir);\n\n const isPyPyVersionSatisfies = semver.satisfies(\n resolvedPyPyVersion,\n pypyVersion\n );\n if (!isPyPyVersionSatisfies) {\n installDir = null;\n resolvedPyPyVersion = '';\n resolvedPythonVersion = '';\n }\n }\n\n if (!installDir) {\n core.info(\n `PyPy version ${pythonVersion} (${pypyVersion}) was not found in the local cache`\n );\n }\n\n return {installDir, resolvedPythonVersion, resolvedPyPyVersion};\n}\n\nexport function parsePyPyVersion(versionSpec: string): IPyPyVersionSpec {\n const versions = versionSpec.split('-').filter(item => !!item);\n\n if (/^(pypy)(.+)/.test(versions[0])) {\n const pythonVersion = versions[0].replace('pypy', '');\n versions.splice(0, 1, 'pypy', pythonVersion);\n }\n\n if (versions.length < 2 || versions[0] != 'pypy') {\n throw new Error(\n \"Invalid 'version' property for PyPy. PyPy version should be specified as 'pypy' or 'pypy-'. See README for examples and documentation.\"\n );\n }\n\n const pythonVersion = versions[1];\n let pypyVersion: string;\n if (versions.length > 2) {\n pypyVersion = pypyInstall.pypyVersionToSemantic(versions[2]);\n } else {\n pypyVersion = 'x';\n }\n\n if (!validateVersion(pythonVersion) || !validateVersion(pypyVersion)) {\n throw new Error(\n \"Invalid 'version' property for PyPy. Both Python version and PyPy versions should satisfy SemVer notation. See README for examples and documentation.\"\n );\n }\n\n if (!validatePythonVersionFormatForPyPy(pythonVersion)) {\n throw new Error(\n \"Invalid format of Python version for PyPy. Python version should be specified in format 'x.y'. See README for examples and documentation.\"\n );\n }\n\n return {\n pypyVersion: pypyVersion,\n pythonVersion: pythonVersion\n };\n}\n\nexport function findPyPyInstallDirForWindows(pythonVersion: string): string {\n let installDir = '';\n\n WINDOWS_ARCHS.forEach(\n architecture =>\n (installDir = installDir || tc.find('PyPy', pythonVersion, architecture))\n );\n\n return installDir;\n}\n","import * as path from 'path';\nimport * as core from '@actions/core';\nimport * as tc from '@actions/tool-cache';\nimport * as exec from '@actions/exec';\nimport * as httpm from '@actions/http-client';\nimport {ExecOptions} from '@actions/exec/lib/interfaces';\nimport {IS_WINDOWS, IS_LINUX, getDownloadFileName} from './utils';\n\nconst TOKEN = core.getInput('token');\nconst AUTH = !TOKEN ? undefined : `token ${TOKEN}`;\nconst MANIFEST_REPO_OWNER = 'actions';\nconst MANIFEST_REPO_NAME = 'python-versions';\nconst MANIFEST_REPO_BRANCH = 'main';\nexport const MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/${MANIFEST_REPO_BRANCH}/versions-manifest.json`;\n\nexport async function findReleaseFromManifest(\n semanticVersionSpec: string,\n architecture: string,\n manifest: tc.IToolRelease[] | null\n): Promise {\n if (!manifest) {\n manifest = await getManifest();\n }\n\n const foundRelease = await tc.findFromManifest(\n semanticVersionSpec,\n false,\n manifest,\n architecture\n );\n\n return foundRelease;\n}\n\nexport async function getManifest(): Promise {\n try {\n return await getManifestFromRepo();\n } catch (err) {\n core.debug('Fetching the manifest via the API failed.');\n if (err instanceof Error) {\n core.debug(err.message);\n }\n }\n return await getManifestFromURL();\n}\n\nexport function getManifestFromRepo(): Promise {\n core.debug(\n `Getting manifest from ${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}@${MANIFEST_REPO_BRANCH}`\n );\n return tc.getManifestFromRepo(\n MANIFEST_REPO_OWNER,\n MANIFEST_REPO_NAME,\n AUTH,\n MANIFEST_REPO_BRANCH\n );\n}\n\nexport async function getManifestFromURL(): Promise {\n core.debug('Falling back to fetching the manifest using raw URL.');\n\n const http: httpm.HttpClient = new httpm.HttpClient('tool-cache');\n const response = await http.getJson(MANIFEST_URL);\n if (!response.result) {\n throw new Error(`Unable to get manifest from ${MANIFEST_URL}`);\n }\n return response.result;\n}\n\nasync function installPython(workingDirectory: string) {\n const options: ExecOptions = {\n cwd: workingDirectory,\n env: {\n ...process.env,\n ...(IS_LINUX && {LD_LIBRARY_PATH: path.join(workingDirectory, 'lib')})\n },\n silent: true,\n listeners: {\n stdout: (data: Buffer) => {\n core.info(data.toString().trim());\n },\n stderr: (data: Buffer) => {\n core.error(data.toString().trim());\n }\n }\n };\n\n if (IS_WINDOWS) {\n await exec.exec('powershell', ['./setup.ps1'], options);\n } else {\n await exec.exec('bash', ['./setup.sh'], options);\n }\n}\n\nexport async function installCpythonFromRelease(release: tc.IToolRelease) {\n const downloadUrl = release.files[0].download_url;\n\n core.info(`Download from \"${downloadUrl}\"`);\n let pythonPath = '';\n try {\n const fileName = getDownloadFileName(downloadUrl);\n pythonPath = await tc.downloadTool(downloadUrl, fileName, AUTH);\n core.info('Extract downloaded archive');\n let pythonExtractedFolder;\n if (IS_WINDOWS) {\n pythonExtractedFolder = await tc.extractZip(pythonPath);\n } else {\n pythonExtractedFolder = await tc.extractTar(pythonPath);\n }\n\n core.info('Execute installation script');\n await installPython(pythonExtractedFolder);\n } catch (err) {\n if (err instanceof tc.HTTPError) {\n // Rate limit?\n if (err.httpStatusCode === 403 || err.httpStatusCode === 429) {\n core.info(\n `Received HTTP status code ${err.httpStatusCode}. This usually indicates the rate limit has been exceeded`\n );\n } else {\n core.info(err.message);\n }\n if (err.stack) {\n core.debug(err.stack);\n }\n }\n throw err;\n }\n}\n","import * as os from 'os';\nimport * as path from 'path';\nimport {IS_WINDOWS, IS_LINUX, getOSInfo} from './utils';\n\nimport * as semver from 'semver';\n\nimport * as installer from './install-python';\n\nimport * as core from '@actions/core';\nimport * as tc from '@actions/tool-cache';\n\n// Python has \"scripts\" or \"bin\" directories where command-line tools that come with packages are installed.\n// This is where pip is, along with anything that pip installs.\n// There is a separate directory for `pip install --user`.\n//\n// For reference, these directories are as follows:\n// macOS / Linux:\n// /bin (by default /usr/local/bin, but not on hosted agents -- see the `else`)\n// (--user) ~/.local/bin\n// Windows:\n// \\Scripts\n// (--user) %APPDATA%\\Python\\PythonXY\\Scripts\n// See https://docs.python.org/3/library/sysconfig.html\n\nfunction binDir(installDir: string): string {\n if (IS_WINDOWS) {\n return path.join(installDir, 'Scripts');\n } else {\n return path.join(installDir, 'bin');\n }\n}\n\nexport async function useCpythonVersion(\n version: string,\n architecture: string,\n updateEnvironment: boolean,\n checkLatest: boolean,\n allowPreReleases: boolean\n): Promise {\n let manifest: tc.IToolRelease[] | null = null;\n const desugaredVersionSpec = desugarDevVersion(version);\n let semanticVersionSpec = pythonVersionToSemantic(\n desugaredVersionSpec,\n allowPreReleases\n );\n core.debug(`Semantic version spec of ${version} is ${semanticVersionSpec}`);\n\n if (checkLatest) {\n manifest = await installer.getManifest();\n const resolvedVersion = (\n await installer.findReleaseFromManifest(\n semanticVersionSpec,\n architecture,\n manifest\n )\n )?.version;\n\n if (resolvedVersion) {\n semanticVersionSpec = resolvedVersion;\n core.info(`Resolved as '${semanticVersionSpec}'`);\n } else {\n core.info(\n `Failed to resolve version ${semanticVersionSpec} from manifest`\n );\n }\n }\n\n let installDir: string | null = tc.find(\n 'Python',\n semanticVersionSpec,\n architecture\n );\n if (!installDir) {\n core.info(\n `Version ${semanticVersionSpec} was not found in the local cache`\n );\n const foundRelease = await installer.findReleaseFromManifest(\n semanticVersionSpec,\n architecture,\n manifest\n );\n\n if (foundRelease && foundRelease.files && foundRelease.files.length > 0) {\n core.info(`Version ${semanticVersionSpec} is available for downloading`);\n await installer.installCpythonFromRelease(foundRelease);\n\n installDir = tc.find('Python', semanticVersionSpec, architecture);\n }\n }\n\n if (!installDir) {\n const osInfo = await getOSInfo();\n throw new Error(\n [\n `The version '${version}' with architecture '${architecture}' was not found for ${\n osInfo\n ? `${osInfo.osName} ${osInfo.osVersion}`\n : 'this operating system'\n }.`,\n `The list of all available versions can be found here: ${installer.MANIFEST_URL}`\n ].join(os.EOL)\n );\n }\n\n const _binDir = binDir(installDir);\n const binaryExtension = IS_WINDOWS ? '.exe' : '';\n const pythonPath = path.join(\n IS_WINDOWS ? installDir : _binDir,\n `python${binaryExtension}`\n );\n if (updateEnvironment) {\n core.exportVariable('pythonLocation', installDir);\n core.exportVariable('PKG_CONFIG_PATH', installDir + '/lib/pkgconfig');\n core.exportVariable('pythonLocation', installDir);\n // https://cmake.org/cmake/help/latest/module/FindPython.html#module:FindPython\n core.exportVariable('Python_ROOT_DIR', installDir);\n // https://cmake.org/cmake/help/latest/module/FindPython2.html#module:FindPython2\n core.exportVariable('Python2_ROOT_DIR', installDir);\n // https://cmake.org/cmake/help/latest/module/FindPython3.html#module:FindPython3\n core.exportVariable('Python3_ROOT_DIR', installDir);\n core.exportVariable('PKG_CONFIG_PATH', installDir + '/lib/pkgconfig');\n\n if (IS_LINUX) {\n const libPath = process.env.LD_LIBRARY_PATH\n ? `:${process.env.LD_LIBRARY_PATH}`\n : '';\n const pyLibPath = path.join(installDir, 'lib');\n\n if (!libPath.split(':').includes(pyLibPath)) {\n core.exportVariable('LD_LIBRARY_PATH', pyLibPath + libPath);\n }\n }\n core.addPath(installDir);\n core.addPath(_binDir);\n\n if (IS_WINDOWS) {\n // Add --user directory\n // `installDir` from tool cache should look like $RUNNER_TOOL_CACHE/Python//x64/\n // So if `findLocalTool` succeeded above, we must have a conformant `installDir`\n const version = path.basename(path.dirname(installDir));\n const major = semver.major(version);\n const minor = semver.minor(version);\n\n const userScriptsDir = path.join(\n process.env['APPDATA'] || '',\n 'Python',\n `Python${major}${minor}`,\n 'Scripts'\n );\n core.addPath(userScriptsDir);\n }\n // On Linux and macOS, pip will create the --user directory and add it to PATH as needed.\n }\n\n const installed = versionFromPath(installDir);\n core.setOutput('python-version', installed);\n core.setOutput('python-path', pythonPath);\n\n return {impl: 'CPython', version: installed};\n}\n\n/** Convert versions like `3.8-dev` to a version like `~3.8.0-0`. */\nfunction desugarDevVersion(versionSpec: string) {\n const devVersion = /^(\\d+)\\.(\\d+)-dev$/;\n return versionSpec.replace(devVersion, '~$1.$2.0-0');\n}\n\n/** Extracts python version from install path from hosted tool cache as described in README.md */\nfunction versionFromPath(installDir: string) {\n const parts = installDir.split(path.sep);\n const idx = parts.findIndex(part => part === 'PyPy' || part === 'Python');\n\n return parts[idx + 1] || '';\n}\n\ninterface InstalledVersion {\n impl: string;\n version: string;\n}\n\n/**\n * Python's prelease versions look like `3.7.0b2`.\n * This is the one part of Python versioning that does not look like semantic versioning, which specifies `3.7.0-b2`.\n * If the version spec contains prerelease versions, we need to convert them to the semantic version equivalent.\n *\n * For easier use of the action, we also map 'x.y' to allow pre-release before 'x.y.0' release if allowPreReleases is true\n */\nexport function pythonVersionToSemantic(\n versionSpec: string,\n allowPreReleases: boolean\n) {\n const prereleaseVersion = /(\\d+\\.\\d+\\.\\d+)((?:a|b|rc)\\d*)/g;\n const majorMinor = /^(\\d+)\\.(\\d+)$/;\n let result = versionSpec.replace(prereleaseVersion, '$1-$2');\n if (allowPreReleases) {\n result = result.replace(majorMinor, '~$1.$2.0-0');\n }\n return result;\n}\n","import path, { join } from \"path\"\nimport { fileURLToPath } from \"url\"\nimport { debug } from \"@actions/core\"\nimport { GITHUB_ACTIONS } from \"ci-info\"\nimport { info, warning } from \"ci-log\"\nimport { pathExists } from \"path-exists\"\nimport { findPyPyVersion } from \"setup-python/src/find-pypy.js\"\nimport { useCpythonVersion } from \"setup-python/src/find-python.js\"\nimport { IS_MAC } from \"setup-python/src/utils.js\"\n\nconst dirname = typeof __dirname === \"string\" ? __dirname : path.dirname(fileURLToPath(import.meta.url))\n\nfunction isPyPyVersion(versionSpec: string) {\n return versionSpec.startsWith(\"pypy\")\n}\n\nconst checkLatest = false\n\nexport async function setupActionsPython(version: string, _setupDir: string, arch: string) {\n if (IS_MAC) {\n process.env.AGENT_TOOLSDIRECTORY = \"/Users/runner/hostedtoolcache\"\n }\n\n const agent_toolsdirectory = process.env.AGENT_TOOLSDIRECTORY?.trim()\n if (typeof agent_toolsdirectory === \"string\" && agent_toolsdirectory !== \"\") {\n process.env.RUNNER_TOOL_CACHE = process.env.AGENT_TOOLSDIRECTORY\n }\n\n debug(`Python is expected to be installed into ${process.env.RUNNER_TOOL_CACHE}`)\n\n if (version) {\n let pythonVersion: string\n if (isPyPyVersion(version)) {\n const installed = await findPyPyVersion(version, arch, true, checkLatest, false)\n pythonVersion = `${installed.resolvedPyPyVersion}-${installed.resolvedPythonVersion}`\n info(`Successfully set up PyPy ${installed.resolvedPyPyVersion} with Python (${installed.resolvedPythonVersion})`)\n } else {\n const installed = await useCpythonVersion(version, arch, true, checkLatest, false)\n pythonVersion = installed.version\n info(`Successfully set up ${installed.impl} (${pythonVersion})`)\n }\n\n // const cache = false\n // if (cache) {\n // const { cacheDependencies } = await import(\"setup-python/src/cache-dependencies\")\n // await cacheDependencies(\"pip\", pythonVersion)\n // }\n }\n\n if (GITHUB_ACTIONS) {\n await addPythonLoggingMatcher()\n }\n\n return undefined\n}\n\nasync function addPythonLoggingMatcher() {\n const matcherPath = join(dirname, \"python_matcher.json\")\n if (!(await pathExists(matcherPath))) {\n return warning(\"the python_matcher.json file does not exist in the same folder as setup-cpp.js\")\n }\n info(`::add-matcher::${matcherPath}`)\n}\n","'use strict'\nconst ParserEND = 0x110000\nclass ParserError extends Error {\n /* istanbul ignore next */\n constructor (msg, filename, linenumber) {\n super('[ParserError] ' + msg, filename, linenumber)\n this.name = 'ParserError'\n this.code = 'ParserError'\n if (Error.captureStackTrace) Error.captureStackTrace(this, ParserError)\n }\n}\nclass State {\n constructor (parser) {\n this.parser = parser\n this.buf = ''\n this.returned = null\n this.result = null\n this.resultTable = null\n this.resultArr = null\n }\n}\nclass Parser {\n constructor () {\n this.pos = 0\n this.col = 0\n this.line = 0\n this.obj = {}\n this.ctx = this.obj\n this.stack = []\n this._buf = ''\n this.char = null\n this.ii = 0\n this.state = new State(this.parseStart)\n }\n\n parse (str) {\n /* istanbul ignore next */\n if (str.length === 0 || str.length == null) return\n\n this._buf = String(str)\n this.ii = -1\n this.char = -1\n let getNext\n while (getNext === false || this.nextChar()) {\n getNext = this.runOne()\n }\n this._buf = null\n }\n nextChar () {\n if (this.char === 0x0A) {\n ++this.line\n this.col = -1\n }\n ++this.ii\n this.char = this._buf.codePointAt(this.ii)\n ++this.pos\n ++this.col\n return this.haveBuffer()\n }\n haveBuffer () {\n return this.ii < this._buf.length\n }\n runOne () {\n return this.state.parser.call(this, this.state.returned)\n }\n finish () {\n this.char = ParserEND\n let last\n do {\n last = this.state.parser\n this.runOne()\n } while (this.state.parser !== last)\n\n this.ctx = null\n this.state = null\n this._buf = null\n\n return this.obj\n }\n next (fn) {\n /* istanbul ignore next */\n if (typeof fn !== 'function') throw new ParserError('Tried to set state to non-existent state: ' + JSON.stringify(fn))\n this.state.parser = fn\n }\n goto (fn) {\n this.next(fn)\n return this.runOne()\n }\n call (fn, returnWith) {\n if (returnWith) this.next(returnWith)\n this.stack.push(this.state)\n this.state = new State(fn)\n }\n callNow (fn, returnWith) {\n this.call(fn, returnWith)\n return this.runOne()\n }\n return (value) {\n /* istanbul ignore next */\n if (this.stack.length === 0) throw this.error(new ParserError('Stack underflow'))\n if (value === undefined) value = this.state.buf\n this.state = this.stack.pop()\n this.state.returned = value\n }\n returnNow (value) {\n this.return(value)\n return this.runOne()\n }\n consume () {\n /* istanbul ignore next */\n if (this.char === ParserEND) throw this.error(new ParserError('Unexpected end-of-buffer'))\n this.state.buf += this._buf[this.ii]\n }\n error (err) {\n err.line = this.line\n err.col = this.col\n err.pos = this.pos\n return err\n }\n /* istanbul ignore next */\n parseStart () {\n throw new ParserError('Must declare a parseStart method')\n }\n}\nParser.END = ParserEND\nParser.Error = ParserError\nmodule.exports = Parser\n","'use strict'\nmodule.exports = value => {\n const date = new Date(value)\n /* istanbul ignore if */\n if (isNaN(date)) {\n throw new TypeError('Invalid Datetime')\n } else {\n return date\n }\n}\n","'use strict'\nmodule.exports = (d, num) => {\n num = String(num)\n while (num.length < d) num = '0' + num\n return num\n}\n","'use strict'\nconst f = require('./format-num.js')\n\nclass FloatingDateTime extends Date {\n constructor (value) {\n super(value + 'Z')\n this.isFloating = true\n }\n toISOString () {\n const date = `${this.getUTCFullYear()}-${f(2, this.getUTCMonth() + 1)}-${f(2, this.getUTCDate())}`\n const time = `${f(2, this.getUTCHours())}:${f(2, this.getUTCMinutes())}:${f(2, this.getUTCSeconds())}.${f(3, this.getUTCMilliseconds())}`\n return `${date}T${time}`\n }\n}\n\nmodule.exports = value => {\n const date = new FloatingDateTime(value)\n /* istanbul ignore if */\n if (isNaN(date)) {\n throw new TypeError('Invalid Datetime')\n } else {\n return date\n }\n}\n","'use strict'\nconst f = require('./format-num.js')\nconst DateTime = global.Date\n\nclass Date extends DateTime {\n constructor (value) {\n super(value)\n this.isDate = true\n }\n toISOString () {\n return `${this.getUTCFullYear()}-${f(2, this.getUTCMonth() + 1)}-${f(2, this.getUTCDate())}`\n }\n}\n\nmodule.exports = value => {\n const date = new Date(value)\n /* istanbul ignore if */\n if (isNaN(date)) {\n throw new TypeError('Invalid Datetime')\n } else {\n return date\n }\n}\n","'use strict'\nconst f = require('./format-num.js')\n\nclass Time extends Date {\n constructor (value) {\n super(`0000-01-01T${value}Z`)\n this.isTime = true\n }\n toISOString () {\n return `${f(2, this.getUTCHours())}:${f(2, this.getUTCMinutes())}:${f(2, this.getUTCSeconds())}.${f(3, this.getUTCMilliseconds())}`\n }\n}\n\nmodule.exports = value => {\n const date = new Time(value)\n /* istanbul ignore if */\n if (isNaN(date)) {\n throw new TypeError('Invalid Datetime')\n } else {\n return date\n }\n}\n","'use strict'\nmodule.exports = require('./parse-string.js')\nmodule.exports.async = require('./parse-async.js')\nmodule.exports.stream = require('./parse-stream.js')\nmodule.exports.prettyError = require('./parse-pretty-error.js')\n"],"names":["isDigit","cp","CHAR_0","CHAR_9","isHexit","CHAR_A","CHAR_F","CHAR_a","CHAR_f","isBit","CHAR_1","isOctit","CHAR_7","isAlphaNumQuoteHyphen","CHAR_Z","CHAR_z","CHAR_APOS","CHAR_QUOT","CHAR_LOWBAR","CHAR_HYPHEN","isAlphaNumHyphen","hasKey","obj","key","hasOwnProperty","call","descriptor","InlineTable","Object","defineProperties","_type","value","INLINE_TABLE","isInlineTable","Table","TABLE","_declared","writable","isTable","InlineList","type","INLINE_LIST","_contentType","isInlineList","List","LIST","isList","Integer","num","Number","is","global","BigInt","isSafeInteger","BoxedBigInt","isNaN","this","INTEGER","_inspect","isInteger","Float","FLOAT","isFloat","tomlType","Date","makeParserClass","Parser","TOMLParser","constructor","ctx","atEndOfWord","char","CHAR_NUM","CTRL_I","CHAR_SP","atEndOfLine","END","CTRL_J","CTRL_M","parseStart","CHAR_LSQB","parseTableOrList","parseComment","callNow","parseAssignStatement","error","TomlError","parseWhitespaceToEOL","goto","return","parseAssign","recordAssignStatement","kv","target","finalKey","pop","kw","valueOf","parseKeyword","recordAssignKeyword","state","resultTable","push","parseAssignKeywordPreDot","CHAR_PERIOD","next","parseAssignKeywordPostDot","parseAssignEqual","CHAR_EQUALS","parseAssignPreValue","parseValue","recordAssignValue","returnNow","CHAR_DEL","CTRL_CHAR_BOUNDARY","errorControlCharIn","nextChar","parseTable","parseList","parseTableNext","parseTableMore","keyword","CHAR_RSQB","length","parseListNext","parseListMore","parseListEnd","parseDoubleString","parseSingleString","CHAR_PLUS","parseNumberSign","CHAR_i","parseInf","CHAR_n","parseNan","parseNumberOrDateTime","CHAR_t","parseBoolean","parseInlineList","recordValue","CHAR_LCUB","parseInlineTable","parseInf2","buf","Infinity","parseNan2","NaN","parseBasicString","parseLiteralString","parseBareKey","consume","parseLiteralMultiStringMaybe","parseLiteralMultiString","parseLiteralMultiStringContent","parseLiteralMultiEnd","parseLiteralMultiEnd2","parseLiteralMultiEnd3","parseLiteralMultiEnd4","parseMultiStringMaybe","CHAR_BSOL","parseEscape","recordEscapeReplacement","replacement","parseMultiString","parseMultiStringContent","parseMultiEscape","recordMultiEscapeReplacement","parseMultiEnd","displayCode","toString","parseMultiEnd2","parseMultiEnd3","parseMultiEnd4","parseMultiTrim","parsePreMultiTrim","escapes","CHAR_u","parseSmallUnicode","parseUnicodeReturn","CHAR_U","parseLargeUnicode","codePoint","parseInt","SURROGATE_FIRST","SURROGATE_LAST","String","fromCodePoint","err","wrap","parseMaybeSignedInfOrNan","parseNoUnder","parseNumberIntegerStart","parseNumberIntegerExponentOrDecimal","parseNumberInteger","parseNumberFloat","CHAR_E","CHAR_e","parseNumberExponentSign","result","parseNoUnderHexOctBinLiteral","parseNumberExponent","parseNumberBaseOrDateTime","parseNumberOrDateTimeOnly","parseDateTime","CHAR_COLON","parseOnlyTimeHour","parseDateTimeOnly","CHAR_b","parseIntegerBin","CHAR_o","parseIntegerOct","CHAR_x","parseIntegerHex","parseDateMonth","parseDateDay","CHAR_T","parseStartTimeHour","createDate","parseTimeHour","parseTimeMin","parseTimeSec","parseTimeZoneOrFraction","parseOnlyTimeMin","parseOnlyTimeSec","parseOnlyTimeFractionMaybe","createTime","parseOnlyTimeFraction","parseDateTimeFraction","createDateTime","createDateTimeFloat","parseTimeZoneHour","test","parseTimeZoneSep","parseTimeZoneMin","parseTrue_r","parseFalse_a","CHAR_r","parseTrue_u","parseTrue_e","parseFalse_l","CHAR_l","parseFalse_s","CHAR_s","parseFalse_e","resultArr","recordInlineListValue","parseInlineListNext","CHAR_COMMA","CHAR_RCUB","recordInlineTableValue","parseInlineTableNext","parseInlineTablePostComma","prettyError","pos","line","msg","message","col","split","lines","lineNumWidth","Math","min","linePadding","ii","max","lineNum","hh","parseString","str","Buffer","isBuffer","parser","parse","finish","parseAsync","opts","parseAsyncNext","index","blocksize","resolve","reject","slice","setImmediate","Promise","parseStream","stm","parseReadable","parseTransform","setEncoding","ended","readable","errored","once","readNext","data","read","stream","Transform","objectMode","transform","chunk","encoding","cb","emit","flush","stringify","typeError","toJSON","stringifyObject","Error","getInlineKeys","keys","filter","isInline","getComplexKeys","nobj","Array","isArray","prototype","undefined","prop","prefix","indent","inlineKeys","complexKeys","inlineIndent","forEach","stringifyKey","stringifyAnyInline","complexIndent","stringifyComplex","join","keyStr","stringifyBasicString","escapeString","replace","stringifyLiteralString","numpad","c","codePointAt","stringifyMultilineString","escaped","map","multilineOk","stringifyInline","stringifyInteger","stringifyFloat","stringifyBoolean","stringifyDatetime","stringifyInlineArray","_","stringifyInlineTable","int","dec","toISOString","values","stringified","valueType","stringifyArrayOfTables","stringifyComplexTable","firstValueType","fullKey","table","createSymlinkInFolder","folderPath","sourceName","targetName","setExecutable","sourcePath","path","targetPath","fs","existsSync","symlinkSync","IS_WINDOWS","chmodSync","validateVersion","version","isNightlyKeyword","semver.validRange","semver","validRange","pypyVersion","getPyPyVersionFromPath","installDir","basename","dirname","readExactPyPyVersionFile","fileVersion","PYPY_VERSION_FILE","readFileSync","trim","writeExactPyPyVersionFile","resolvedPyPyVersion","pypyFilePath","writeFileSync","validatePythonVersionFormatForPyPy","async","getWindowsInfo","stdout","exec.getExecOutput","getExecOutput_1","silent","osName","osVersion","getMacOSInfo","getLinuxInfo","core.debug","coreExports","debug","getOSInfo","osInfo","IS_LINUX","IS_MAC","getBinaryDirectory","getDownloadFileName","downloadUrl","tempDir","process","env","RUNNER_TEMP","installPyPy","pythonVersion","architecture","allowPreReleases","releases","downloadDir","getAvailablePyPyVersions","releaseData","findRelease","foundAsset","resolvedPythonVersion","download_url","core.info","fileName","pypyPath","tc.downloadTool","tc.extractZip","tc.extractTar","archiveName","readdirSync","toolDir","tc.cacheDir","cacheDir_1","binaryPath","createPyPySymlink","installPip","info","tc.HTTPError","HTTPError_1","httpStatusCode","stack","url","http","httpm.HttpClient","response","getJson","pypyBinaryPath","semver.coerce","pythonBinaryPostfix","semver.major","pypyBinaryPostfix","pypyMajorMinorBinaryPostfix","semver.minor","binaryExtension","pythonLocation","pythonBinary","exec.exec","exec_2","includePrerelease","options","filterReleases","item","isPythonVersionSatisfied","semver.satisfies","satisfies","coerce","python_version","isPyPyVersionSatisfied","pypy_version","pypyVersionToSemantic","isArchPresent","files","isArchPresentForWindows","isArchPresentForMacOrLinux","platform","foundRelease","sort","previous","current","semver.compare","compare","findAssetForWindows","findAssetForMacOrLinux","versionSpec","replaceX32toX86","some","file","WINDOWS_PLATFORMS","includes","arch","find","findPyPyVersion","updateEnvironment","checkLatest","pypyVersionSpec","parsePyPyVersion","findPyPyToolCache","pypyInstall.installPyPy","_binDir","pythonPath","core.exportVariable","core.setOutput","findPyPyInstallDirForWindows","tc.find","versions","splice","pypyInstall.pypyVersionToSemantic","WINDOWS_ARCHS","find_1","findReleaseFromManifest","semanticVersionSpec","manifest","getManifest","tc.findFromManifest","findFromManifest_1","getManifestFromRepo","getManifestFromURL","MANIFEST_REPO_OWNER","MANIFEST_REPO_NAME","MANIFEST_REPO_BRANCH","tc.getManifestFromRepo","getManifestFromRepo_1","AUTH","MANIFEST_URL","installPython","workingDirectory","cwd","LD_LIBRARY_PATH","listeners","stderr","core.error","installCpythonFromRelease","release","pythonExtractedFolder","downloadTool_1","binDir","useCpythonVersion","pythonVersionToSemantic","desugarDevVersion","installer.findReleaseFromManifest","installer.installCpythonFromRelease","installer.MANIFEST_URL","os","EOL","libPath","pyLibPath","major","minor","userScriptsDir","installed","versionFromPath","impl","parts","sep","idx","findIndex","part","isPyPyVersion","startsWith","setupActionsPython","_setupDir","AGENT_TOOLSDIRECTORY","agent_toolsdirectory","_a","RUNNER_TOOL_CACHE","GITHUB_ACTIONS","addPythonLoggingMatcher","matcherPath","pathExists","warning","ParserEND","ParserError","filename","linenumber","super","name","code","captureStackTrace","State","returned","_buf","getNext","runOne","haveBuffer","last","fn","JSON","returnWith","module","date","TypeError","d","f","require","FloatingDateTime","isFloating","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","DateTime","commonjsGlobal","isDate","Time","isTime","tomlParserModule","exports","fromTOML","wrapped","terr","Symbol","defineProperty","configurable","enumerable","_custom","utilInspect","eval","custom","asIntN","parseModule","stringifyModule","TOKEN","core.getInput","__dirname","fileURLToPath","document","pathToFileURL","__filename","href","_documentCurrentScript","src","URL","baseURI"],"mappings":"+SAsFA,SAASA,QAASC,GACTA,OAAAA,GAAMC,QAAgBC,QAANF,CACzB,CACA,SAASG,QAASH,GACRA,OAAAA,GAAMI,QAAgBC,QAANL,GAAkBA,GAAMM,QAAgBC,QAANP,GAAkBA,GAAMC,QAAgBC,QAANF,CAC9F,CACA,SAASQ,MAAOR,GACPA,OAAAA,IAAOS,QAAUT,IAAOC,MACjC,CACA,SAASS,QAASV,GACRA,OAAAA,GAAMC,QAAgBU,QAANX,CAC1B,CACA,SAASY,sBAAuBZ,GAC9B,OAAQA,GAAMI,QAAgBS,QAANb,GAChBA,GAAMM,QAAgBQ,QAANd,GAChBA,GAAMC,QAAgBC,QAANF,GACjBA,IAAOe,WACPf,IAAOgB,WACPhB,IAAOiB,aACPjB,IAAOkB,WAChB,CACA,SAASC,iBAAkBnB,GACzB,OAAQA,GAAMI,QAAgBS,QAANb,GAChBA,GAAMM,QAAgBQ,QAANd,GAChBA,GAAMC,QAAgBC,QAANF,GACjBA,IAAOiB,aACPjB,IAAOkB,WAChB,CAQA,SAASE,OAAQC,EAAKC,GACpB,QAAIC,eAAeC,KAAKH,EAAKC,KACjB,cAARA,GAAoCD,eAAAA,EAAK,YAAaI,aACnD,EACT,CAGA,SAASC,cACAC,OAAAA,OAAOC,iBAAiB,GAAI,CACjCC,CAACA,OAAQ,CAACC,MAAOC,eAErB,CACA,SAASC,cAAeX,GACtB,OAAY,OAARA,GAAiC,iBAATA,GACrBA,EAAIQ,SAAWE,YACxB,CAGA,SAASE,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AZ0J,EACT,CAEA,CAAC/H,YACQ,MAAA,YAAYF,WACrB,CACAyC,OAAAA,GACE,OAAOzC,KAAKzB,KACd,EAGF,MAAM0B,QAAUwjB,SAsBVpjB,MAAQojB,kDCxOdzB,iBAAiB5V,cCAjB4V,cAAiB5U,YAEjB,MAAMzM,aAAa0hB,kBACbjW,cAAciW,qBCHpBL,aAAiBrU,WAEjB,MAAMhN,aAAa0hB,kBACbjW,YAAciW,qBCHpBL,cAAiB3T,YAEjB,MAAMY,OAASoT,SACT1hB,WAAa0hB,kBcHnBL,MAAcqB,QAAGhB,cACG6B,MAAAb,QAAA/N,MAAG+M,aACF6B,MAAAb,QAAApU,OAAGoT,cACxBL,MAAAA,QAAAA,YAA6BK,8CbH7BL,YAAcqB,QAAG3T,UACGyU,YAAAd,QAAA9kB,MAAG0T,gBCSV,MAAA8B,WAAkC,UAArB4C,QAAQmE,SACrBzE,SAAgC,UAArBM,QAAQmE,SACnBxE,OAA8B,WAArBK,QAAQmE,SACjBiC,cAAgB,CAAC,MAAO,OACxBpB,kBAAoB,CAAC,QAAS,SACrC7G,kBAAoB,eGRpBsP,MAAQC,SAAAA,YAAAA,SAAc,SACtBvG,KAAQsG,MAAoB,SAASA,WAArB,EAChB3G,oBAAsB,UACtBC,mBAAqB,kBACrBC,qBAAuB,OAChBI,aAAe,qCAAqCN,uBAAuBC,sBAAsBC,8CEHxGhJ,QAA+B,iBAAd2P,UAAyBA,UAAY5Q,KAAKiB,QAAQ4P,WAAAA,cAA6B,oBAAAC,SAAAnC,QAAA,OAAAoC,cAAAC,YAAAC,KAAAC,wBAAAA,uBAAAC,KAAA,IAAAC,IAAA,oCAAAN,SAAAO,SAAAJ,OAMhG1I,aAAc","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,12,13,14,15,16,17,18]} \ No newline at end of file +{"version":3,"file":"actions_python-B7InDb2U.js","sources":["../../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/toml-parser.js","../../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse-pretty-error.js","../../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse-string.js","../../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse-async.js","../../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse-stream.js","../../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/stringify.js","../../../node_modules/.pnpm/setup-python@https+++codeload.github.com+aminya+setup-python+tar.gz+9700887_encoding@0.1.13/node_modules/setup-python/src/utils.ts","../../../node_modules/.pnpm/setup-python@https+++codeload.github.com+aminya+setup-python+tar.gz+9700887_encoding@0.1.13/node_modules/setup-python/src/install-pypy.ts","../../../node_modules/.pnpm/setup-python@https+++codeload.github.com+aminya+setup-python+tar.gz+9700887_encoding@0.1.13/node_modules/setup-python/src/find-pypy.ts","../../../node_modules/.pnpm/setup-python@https+++codeload.github.com+aminya+setup-python+tar.gz+9700887_encoding@0.1.13/node_modules/setup-python/src/install-python.ts","../../../node_modules/.pnpm/setup-python@https+++codeload.github.com+aminya+setup-python+tar.gz+9700887_encoding@0.1.13/node_modules/setup-python/src/find-python.ts","../../../src/python/actions_python.ts","../../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/parser.js","../../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/create-datetime.js","../../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/format-num.js","../../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/create-datetime-float.js","../../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/create-date.js","../../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/create-time.js","../../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse.js"],"sourcesContent":["'use strict'\n/* eslint-disable no-new-wrappers, no-eval, camelcase, operator-linebreak */\nmodule.exports = makeParserClass(require('./parser.js'))\nmodule.exports.makeParserClass = makeParserClass\n\nclass TomlError extends Error {\n constructor (msg) {\n super(msg)\n this.name = 'TomlError'\n /* istanbul ignore next */\n if (Error.captureStackTrace) Error.captureStackTrace(this, TomlError)\n this.fromTOML = true\n this.wrapped = null\n }\n}\nTomlError.wrap = err => {\n const terr = new TomlError(err.message)\n terr.code = err.code\n terr.wrapped = err\n return terr\n}\nmodule.exports.TomlError = TomlError\n\nconst createDateTime = require('./create-datetime.js')\nconst createDateTimeFloat = require('./create-datetime-float.js')\nconst createDate = require('./create-date.js')\nconst createTime = require('./create-time.js')\n\nconst CTRL_I = 0x09\nconst CTRL_J = 0x0A\nconst CTRL_M = 0x0D\nconst CTRL_CHAR_BOUNDARY = 0x1F // the last non-character in the latin1 region of unicode, except DEL\nconst CHAR_SP = 0x20\nconst CHAR_QUOT = 0x22\nconst CHAR_NUM = 0x23\nconst CHAR_APOS = 0x27\nconst CHAR_PLUS = 0x2B\nconst CHAR_COMMA = 0x2C\nconst CHAR_HYPHEN = 0x2D\nconst CHAR_PERIOD = 0x2E\nconst CHAR_0 = 0x30\nconst CHAR_1 = 0x31\nconst CHAR_7 = 0x37\nconst CHAR_9 = 0x39\nconst CHAR_COLON = 0x3A\nconst CHAR_EQUALS = 0x3D\nconst CHAR_A = 0x41\nconst CHAR_E = 0x45\nconst CHAR_F = 0x46\nconst CHAR_T = 0x54\nconst CHAR_U = 0x55\nconst CHAR_Z = 0x5A\nconst CHAR_LOWBAR = 0x5F\nconst CHAR_a = 0x61\nconst CHAR_b = 0x62\nconst CHAR_e = 0x65\nconst CHAR_f = 0x66\nconst CHAR_i = 0x69\nconst CHAR_l = 0x6C\nconst CHAR_n = 0x6E\nconst CHAR_o = 0x6F\nconst CHAR_r = 0x72\nconst CHAR_s = 0x73\nconst CHAR_t = 0x74\nconst CHAR_u = 0x75\nconst CHAR_x = 0x78\nconst CHAR_z = 0x7A\nconst CHAR_LCUB = 0x7B\nconst CHAR_RCUB = 0x7D\nconst CHAR_LSQB = 0x5B\nconst CHAR_BSOL = 0x5C\nconst CHAR_RSQB = 0x5D\nconst CHAR_DEL = 0x7F\nconst SURROGATE_FIRST = 0xD800\nconst SURROGATE_LAST = 0xDFFF\n\nconst escapes = {\n [CHAR_b]: '\\u0008',\n [CHAR_t]: '\\u0009',\n [CHAR_n]: '\\u000A',\n [CHAR_f]: '\\u000C',\n [CHAR_r]: '\\u000D',\n [CHAR_QUOT]: '\\u0022',\n [CHAR_BSOL]: '\\u005C'\n}\n\nfunction isDigit (cp) {\n return cp >= CHAR_0 && cp <= CHAR_9\n}\nfunction isHexit (cp) {\n return (cp >= CHAR_A && cp <= CHAR_F) || (cp >= CHAR_a && cp <= CHAR_f) || (cp >= CHAR_0 && cp <= CHAR_9)\n}\nfunction isBit (cp) {\n return cp === CHAR_1 || cp === CHAR_0\n}\nfunction isOctit (cp) {\n return (cp >= CHAR_0 && cp <= CHAR_7)\n}\nfunction isAlphaNumQuoteHyphen (cp) {\n return (cp >= CHAR_A && cp <= CHAR_Z)\n || (cp >= CHAR_a && cp <= CHAR_z)\n || (cp >= CHAR_0 && cp <= CHAR_9)\n || cp === CHAR_APOS\n || cp === CHAR_QUOT\n || cp === CHAR_LOWBAR\n || cp === CHAR_HYPHEN\n}\nfunction isAlphaNumHyphen (cp) {\n return (cp >= CHAR_A && cp <= CHAR_Z)\n || (cp >= CHAR_a && cp <= CHAR_z)\n || (cp >= CHAR_0 && cp <= CHAR_9)\n || cp === CHAR_LOWBAR\n || cp === CHAR_HYPHEN\n}\nconst _type = Symbol('type')\nconst _declared = Symbol('declared')\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty\nconst defineProperty = Object.defineProperty\nconst descriptor = {configurable: true, enumerable: true, writable: true, value: undefined}\n\nfunction hasKey (obj, key) {\n if (hasOwnProperty.call(obj, key)) return true\n if (key === '__proto__') defineProperty(obj, '__proto__', descriptor)\n return false\n}\n\nconst INLINE_TABLE = Symbol('inline-table')\nfunction InlineTable () {\n return Object.defineProperties({}, {\n [_type]: {value: INLINE_TABLE}\n })\n}\nfunction isInlineTable (obj) {\n if (obj === null || typeof (obj) !== 'object') return false\n return obj[_type] === INLINE_TABLE\n}\n\nconst TABLE = Symbol('table')\nfunction Table () {\n return Object.defineProperties({}, {\n [_type]: {value: TABLE},\n [_declared]: {value: false, writable: true}\n })\n}\nfunction isTable (obj) {\n if (obj === null || typeof (obj) !== 'object') return false\n return obj[_type] === TABLE\n}\n\nconst _contentType = Symbol('content-type')\nconst INLINE_LIST = Symbol('inline-list')\nfunction InlineList (type) {\n return Object.defineProperties([], {\n [_type]: {value: INLINE_LIST},\n [_contentType]: {value: type}\n })\n}\nfunction isInlineList (obj) {\n if (obj === null || typeof (obj) !== 'object') return false\n return obj[_type] === INLINE_LIST\n}\n\nconst LIST = Symbol('list')\nfunction List () {\n return Object.defineProperties([], {\n [_type]: {value: LIST}\n })\n}\nfunction isList (obj) {\n if (obj === null || typeof (obj) !== 'object') return false\n return obj[_type] === LIST\n}\n\n// in an eval, to let bundlers not slurp in a util proxy\nlet _custom\ntry {\n const utilInspect = eval(\"require('util').inspect\")\n _custom = utilInspect.custom\n} catch (_) {\n /* eval require not available in transpiled bundle */\n}\n/* istanbul ignore next */\nconst _inspect = _custom || 'inspect'\n\nclass BoxedBigInt {\n constructor (value) {\n try {\n this.value = global.BigInt.asIntN(64, value)\n } catch (_) {\n /* istanbul ignore next */\n this.value = null\n }\n Object.defineProperty(this, _type, {value: INTEGER})\n }\n isNaN () {\n return this.value === null\n }\n /* istanbul ignore next */\n toString () {\n return String(this.value)\n }\n /* istanbul ignore next */\n [_inspect] () {\n return `[BigInt: ${this.toString()}]}`\n }\n valueOf () {\n return this.value\n }\n}\n\nconst INTEGER = Symbol('integer')\nfunction Integer (value) {\n let num = Number(value)\n // -0 is a float thing, not an int thing\n if (Object.is(num, -0)) num = 0\n /* istanbul ignore else */\n if (global.BigInt && !Number.isSafeInteger(num)) {\n return new BoxedBigInt(value)\n } else {\n /* istanbul ignore next */\n return Object.defineProperties(new Number(num), {\n isNaN: {value: function () { return isNaN(this) }},\n [_type]: {value: INTEGER},\n [_inspect]: {value: () => `[Integer: ${value}]`}\n })\n }\n}\nfunction isInteger (obj) {\n if (obj === null || typeof (obj) !== 'object') return false\n return obj[_type] === INTEGER\n}\n\nconst FLOAT = Symbol('float')\nfunction Float (value) {\n /* istanbul ignore next */\n return Object.defineProperties(new Number(value), {\n [_type]: {value: FLOAT},\n [_inspect]: {value: () => `[Float: ${value}]`}\n })\n}\nfunction isFloat (obj) {\n if (obj === null || typeof (obj) !== 'object') return false\n return obj[_type] === FLOAT\n}\n\nfunction tomlType (value) {\n const type = typeof value\n if (type === 'object') {\n /* istanbul ignore if */\n if (value === null) return 'null'\n if (value instanceof Date) return 'datetime'\n /* istanbul ignore else */\n if (_type in value) {\n switch (value[_type]) {\n case INLINE_TABLE: return 'inline-table'\n case INLINE_LIST: return 'inline-list'\n /* istanbul ignore next */\n case TABLE: return 'table'\n /* istanbul ignore next */\n case LIST: return 'list'\n case FLOAT: return 'float'\n case INTEGER: return 'integer'\n }\n }\n }\n return type\n}\n\nfunction makeParserClass (Parser) {\n class TOMLParser extends Parser {\n constructor () {\n super()\n this.ctx = this.obj = Table()\n }\n\n /* MATCH HELPER */\n atEndOfWord () {\n return this.char === CHAR_NUM || this.char === CTRL_I || this.char === CHAR_SP || this.atEndOfLine()\n }\n atEndOfLine () {\n return this.char === Parser.END || this.char === CTRL_J || this.char === CTRL_M\n }\n\n parseStart () {\n if (this.char === Parser.END) {\n return null\n } else if (this.char === CHAR_LSQB) {\n return this.call(this.parseTableOrList)\n } else if (this.char === CHAR_NUM) {\n return this.call(this.parseComment)\n } else if (this.char === CTRL_J || this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M) {\n return null\n } else if (isAlphaNumQuoteHyphen(this.char)) {\n return this.callNow(this.parseAssignStatement)\n } else {\n throw this.error(new TomlError(`Unknown character \"${this.char}\"`))\n }\n }\n\n // HELPER, this strips any whitespace and comments to the end of the line\n // then RETURNS. Last state in a production.\n parseWhitespaceToEOL () {\n if (this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M) {\n return null\n } else if (this.char === CHAR_NUM) {\n return this.goto(this.parseComment)\n } else if (this.char === Parser.END || this.char === CTRL_J) {\n return this.return()\n } else {\n throw this.error(new TomlError('Unexpected character, expected only whitespace or comments till end of line'))\n }\n }\n\n /* ASSIGNMENT: key = value */\n parseAssignStatement () {\n return this.callNow(this.parseAssign, this.recordAssignStatement)\n }\n recordAssignStatement (kv) {\n let target = this.ctx\n let finalKey = kv.key.pop()\n for (let kw of kv.key) {\n if (hasKey(target, kw) && !isTable(target[kw])) {\n throw this.error(new TomlError(\"Can't redefine existing key\"))\n }\n target = target[kw] = target[kw] || Table()\n }\n if (hasKey(target, finalKey)) {\n throw this.error(new TomlError(\"Can't redefine existing key\"))\n }\n target[_declared] = true\n // unbox our numbers\n if (isInteger(kv.value) || isFloat(kv.value)) {\n target[finalKey] = kv.value.valueOf()\n } else {\n target[finalKey] = kv.value\n }\n return this.goto(this.parseWhitespaceToEOL)\n }\n\n /* ASSSIGNMENT expression, key = value possibly inside an inline table */\n parseAssign () {\n return this.callNow(this.parseKeyword, this.recordAssignKeyword)\n }\n recordAssignKeyword (key) {\n if (this.state.resultTable) {\n this.state.resultTable.push(key)\n } else {\n this.state.resultTable = [key]\n }\n return this.goto(this.parseAssignKeywordPreDot)\n }\n parseAssignKeywordPreDot () {\n if (this.char === CHAR_PERIOD) {\n return this.next(this.parseAssignKeywordPostDot)\n } else if (this.char !== CHAR_SP && this.char !== CTRL_I) {\n return this.goto(this.parseAssignEqual)\n }\n }\n parseAssignKeywordPostDot () {\n if (this.char !== CHAR_SP && this.char !== CTRL_I) {\n return this.callNow(this.parseKeyword, this.recordAssignKeyword)\n }\n }\n\n parseAssignEqual () {\n if (this.char === CHAR_EQUALS) {\n return this.next(this.parseAssignPreValue)\n } else {\n throw this.error(new TomlError('Invalid character, expected \"=\"'))\n }\n }\n parseAssignPreValue () {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else {\n return this.callNow(this.parseValue, this.recordAssignValue)\n }\n }\n recordAssignValue (value) {\n return this.returnNow({key: this.state.resultTable, value: value})\n }\n\n /* COMMENTS: #...eol */\n parseComment () {\n do {\n if (this.char === Parser.END || this.char === CTRL_J) {\n return this.return()\n } else if (this.char === CHAR_DEL || (this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I)) {\n throw this.errorControlCharIn('comments')\n }\n } while (this.nextChar())\n }\n\n /* TABLES AND LISTS, [foo] and [[foo]] */\n parseTableOrList () {\n if (this.char === CHAR_LSQB) {\n this.next(this.parseList)\n } else {\n return this.goto(this.parseTable)\n }\n }\n\n /* TABLE [foo.bar.baz] */\n parseTable () {\n this.ctx = this.obj\n return this.goto(this.parseTableNext)\n }\n parseTableNext () {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else {\n return this.callNow(this.parseKeyword, this.parseTableMore)\n }\n }\n parseTableMore (keyword) {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else if (this.char === CHAR_RSQB) {\n if (hasKey(this.ctx, keyword) && (!isTable(this.ctx[keyword]) || this.ctx[keyword][_declared])) {\n throw this.error(new TomlError(\"Can't redefine existing key\"))\n } else {\n this.ctx = this.ctx[keyword] = this.ctx[keyword] || Table()\n this.ctx[_declared] = true\n }\n return this.next(this.parseWhitespaceToEOL)\n } else if (this.char === CHAR_PERIOD) {\n if (!hasKey(this.ctx, keyword)) {\n this.ctx = this.ctx[keyword] = Table()\n } else if (isTable(this.ctx[keyword])) {\n this.ctx = this.ctx[keyword]\n } else if (isList(this.ctx[keyword])) {\n this.ctx = this.ctx[keyword][this.ctx[keyword].length - 1]\n } else {\n throw this.error(new TomlError(\"Can't redefine existing key\"))\n }\n return this.next(this.parseTableNext)\n } else {\n throw this.error(new TomlError('Unexpected character, expected whitespace, . or ]'))\n }\n }\n\n /* LIST [[a.b.c]] */\n parseList () {\n this.ctx = this.obj\n return this.goto(this.parseListNext)\n }\n parseListNext () {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else {\n return this.callNow(this.parseKeyword, this.parseListMore)\n }\n }\n parseListMore (keyword) {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else if (this.char === CHAR_RSQB) {\n if (!hasKey(this.ctx, keyword)) {\n this.ctx[keyword] = List()\n }\n if (isInlineList(this.ctx[keyword])) {\n throw this.error(new TomlError(\"Can't extend an inline array\"))\n } else if (isList(this.ctx[keyword])) {\n const next = Table()\n this.ctx[keyword].push(next)\n this.ctx = next\n } else {\n throw this.error(new TomlError(\"Can't redefine an existing key\"))\n }\n return this.next(this.parseListEnd)\n } else if (this.char === CHAR_PERIOD) {\n if (!hasKey(this.ctx, keyword)) {\n this.ctx = this.ctx[keyword] = Table()\n } else if (isInlineList(this.ctx[keyword])) {\n throw this.error(new TomlError(\"Can't extend an inline array\"))\n } else if (isInlineTable(this.ctx[keyword])) {\n throw this.error(new TomlError(\"Can't extend an inline table\"))\n } else if (isList(this.ctx[keyword])) {\n this.ctx = this.ctx[keyword][this.ctx[keyword].length - 1]\n } else if (isTable(this.ctx[keyword])) {\n this.ctx = this.ctx[keyword]\n } else {\n throw this.error(new TomlError(\"Can't redefine an existing key\"))\n }\n return this.next(this.parseListNext)\n } else {\n throw this.error(new TomlError('Unexpected character, expected whitespace, . or ]'))\n }\n }\n parseListEnd (keyword) {\n if (this.char === CHAR_RSQB) {\n return this.next(this.parseWhitespaceToEOL)\n } else {\n throw this.error(new TomlError('Unexpected character, expected whitespace, . or ]'))\n }\n }\n\n /* VALUE string, number, boolean, inline list, inline object */\n parseValue () {\n if (this.char === Parser.END) {\n throw this.error(new TomlError('Key without value'))\n } else if (this.char === CHAR_QUOT) {\n return this.next(this.parseDoubleString)\n } if (this.char === CHAR_APOS) {\n return this.next(this.parseSingleString)\n } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {\n return this.goto(this.parseNumberSign)\n } else if (this.char === CHAR_i) {\n return this.next(this.parseInf)\n } else if (this.char === CHAR_n) {\n return this.next(this.parseNan)\n } else if (isDigit(this.char)) {\n return this.goto(this.parseNumberOrDateTime)\n } else if (this.char === CHAR_t || this.char === CHAR_f) {\n return this.goto(this.parseBoolean)\n } else if (this.char === CHAR_LSQB) {\n return this.call(this.parseInlineList, this.recordValue)\n } else if (this.char === CHAR_LCUB) {\n return this.call(this.parseInlineTable, this.recordValue)\n } else {\n throw this.error(new TomlError('Unexpected character, expecting string, number, datetime, boolean, inline array or inline table'))\n }\n }\n recordValue (value) {\n return this.returnNow(value)\n }\n\n parseInf () {\n if (this.char === CHAR_n) {\n return this.next(this.parseInf2)\n } else {\n throw this.error(new TomlError('Unexpected character, expected \"inf\", \"+inf\" or \"-inf\"'))\n }\n }\n parseInf2 () {\n if (this.char === CHAR_f) {\n if (this.state.buf === '-') {\n return this.return(-Infinity)\n } else {\n return this.return(Infinity)\n }\n } else {\n throw this.error(new TomlError('Unexpected character, expected \"inf\", \"+inf\" or \"-inf\"'))\n }\n }\n\n parseNan () {\n if (this.char === CHAR_a) {\n return this.next(this.parseNan2)\n } else {\n throw this.error(new TomlError('Unexpected character, expected \"nan\"'))\n }\n }\n parseNan2 () {\n if (this.char === CHAR_n) {\n return this.return(NaN)\n } else {\n throw this.error(new TomlError('Unexpected character, expected \"nan\"'))\n }\n }\n\n /* KEYS, barewords or basic, literal, or dotted */\n parseKeyword () {\n if (this.char === CHAR_QUOT) {\n return this.next(this.parseBasicString)\n } else if (this.char === CHAR_APOS) {\n return this.next(this.parseLiteralString)\n } else {\n return this.goto(this.parseBareKey)\n }\n }\n\n /* KEYS: barewords */\n parseBareKey () {\n do {\n if (this.char === Parser.END) {\n throw this.error(new TomlError('Key ended without value'))\n } else if (isAlphaNumHyphen(this.char)) {\n this.consume()\n } else if (this.state.buf.length === 0) {\n throw this.error(new TomlError('Empty bare keys are not allowed'))\n } else {\n return this.returnNow()\n }\n } while (this.nextChar())\n }\n\n /* STRINGS, single quoted (literal) */\n parseSingleString () {\n if (this.char === CHAR_APOS) {\n return this.next(this.parseLiteralMultiStringMaybe)\n } else {\n return this.goto(this.parseLiteralString)\n }\n }\n parseLiteralString () {\n do {\n if (this.char === CHAR_APOS) {\n return this.return()\n } else if (this.atEndOfLine()) {\n throw this.error(new TomlError('Unterminated string'))\n } else if (this.char === CHAR_DEL || (this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I)) {\n throw this.errorControlCharIn('strings')\n } else {\n this.consume()\n }\n } while (this.nextChar())\n }\n parseLiteralMultiStringMaybe () {\n if (this.char === CHAR_APOS) {\n return this.next(this.parseLiteralMultiString)\n } else {\n return this.returnNow()\n }\n }\n parseLiteralMultiString () {\n if (this.char === CTRL_M) {\n return null\n } else if (this.char === CTRL_J) {\n return this.next(this.parseLiteralMultiStringContent)\n } else {\n return this.goto(this.parseLiteralMultiStringContent)\n }\n }\n parseLiteralMultiStringContent () {\n do {\n if (this.char === CHAR_APOS) {\n return this.next(this.parseLiteralMultiEnd)\n } else if (this.char === Parser.END) {\n throw this.error(new TomlError('Unterminated multi-line string'))\n } else if (this.char === CHAR_DEL || (this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I && this.char !== CTRL_J && this.char !== CTRL_M)) {\n throw this.errorControlCharIn('strings')\n } else {\n this.consume()\n }\n } while (this.nextChar())\n }\n parseLiteralMultiEnd () {\n if (this.char === CHAR_APOS) {\n return this.next(this.parseLiteralMultiEnd2)\n } else {\n this.state.buf += \"'\"\n return this.goto(this.parseLiteralMultiStringContent)\n }\n }\n parseLiteralMultiEnd2 () {\n if (this.char === CHAR_APOS) {\n return this.next(this.parseLiteralMultiEnd3)\n } else {\n this.state.buf += \"''\"\n return this.goto(this.parseLiteralMultiStringContent)\n }\n }\n parseLiteralMultiEnd3 () {\n if (this.char === CHAR_APOS) {\n this.state.buf += \"'\"\n return this.next(this.parseLiteralMultiEnd4)\n } else {\n return this.returnNow()\n }\n }\n parseLiteralMultiEnd4 () {\n if (this.char === CHAR_APOS) {\n this.state.buf += \"'\"\n return this.return()\n } else {\n return this.returnNow()\n }\n }\n\n /* STRINGS double quoted */\n parseDoubleString () {\n if (this.char === CHAR_QUOT) {\n return this.next(this.parseMultiStringMaybe)\n } else {\n return this.goto(this.parseBasicString)\n }\n }\n parseBasicString () {\n do {\n if (this.char === CHAR_BSOL) {\n return this.call(this.parseEscape, this.recordEscapeReplacement)\n } else if (this.char === CHAR_QUOT) {\n return this.return()\n } else if (this.atEndOfLine()) {\n throw this.error(new TomlError('Unterminated string'))\n } else if (this.char === CHAR_DEL || (this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I)) {\n throw this.errorControlCharIn('strings')\n } else {\n this.consume()\n }\n } while (this.nextChar())\n }\n recordEscapeReplacement (replacement) {\n this.state.buf += replacement\n return this.goto(this.parseBasicString)\n }\n parseMultiStringMaybe () {\n if (this.char === CHAR_QUOT) {\n return this.next(this.parseMultiString)\n } else {\n return this.returnNow()\n }\n }\n parseMultiString () {\n if (this.char === CTRL_M) {\n return null\n } else if (this.char === CTRL_J) {\n return this.next(this.parseMultiStringContent)\n } else {\n return this.goto(this.parseMultiStringContent)\n }\n }\n parseMultiStringContent () {\n do {\n if (this.char === CHAR_BSOL) {\n return this.call(this.parseMultiEscape, this.recordMultiEscapeReplacement)\n } else if (this.char === CHAR_QUOT) {\n return this.next(this.parseMultiEnd)\n } else if (this.char === Parser.END) {\n throw this.error(new TomlError('Unterminated multi-line string'))\n } else if (this.char === CHAR_DEL || (this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I && this.char !== CTRL_J && this.char !== CTRL_M)) {\n throw this.errorControlCharIn('strings')\n } else {\n this.consume()\n }\n } while (this.nextChar())\n }\n errorControlCharIn (type) {\n let displayCode = '\\\\u00'\n if (this.char < 16) {\n displayCode += '0'\n }\n displayCode += this.char.toString(16)\n\n return this.error(new TomlError(`Control characters (codes < 0x1f and 0x7f) are not allowed in ${type}, use ${displayCode} instead`))\n }\n recordMultiEscapeReplacement (replacement) {\n this.state.buf += replacement\n return this.goto(this.parseMultiStringContent)\n }\n parseMultiEnd () {\n if (this.char === CHAR_QUOT) {\n return this.next(this.parseMultiEnd2)\n } else {\n this.state.buf += '\"'\n return this.goto(this.parseMultiStringContent)\n }\n }\n parseMultiEnd2 () {\n if (this.char === CHAR_QUOT) {\n return this.next(this.parseMultiEnd3)\n } else {\n this.state.buf += '\"\"'\n return this.goto(this.parseMultiStringContent)\n }\n }\n parseMultiEnd3 () {\n if (this.char === CHAR_QUOT) {\n this.state.buf += '\"'\n return this.next(this.parseMultiEnd4)\n } else {\n return this.returnNow()\n }\n }\n parseMultiEnd4 () {\n if (this.char === CHAR_QUOT) {\n this.state.buf += '\"'\n return this.return()\n } else {\n return this.returnNow()\n }\n }\n parseMultiEscape () {\n if (this.char === CTRL_M || this.char === CTRL_J) {\n return this.next(this.parseMultiTrim)\n } else if (this.char === CHAR_SP || this.char === CTRL_I) {\n return this.next(this.parsePreMultiTrim)\n } else {\n return this.goto(this.parseEscape)\n }\n }\n parsePreMultiTrim () {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else if (this.char === CTRL_M || this.char === CTRL_J) {\n return this.next(this.parseMultiTrim)\n } else {\n throw this.error(new TomlError(\"Can't escape whitespace\"))\n }\n }\n parseMultiTrim () {\n // explicitly whitespace here, END should follow the same path as chars\n if (this.char === CTRL_J || this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M) {\n return null\n } else {\n return this.returnNow()\n }\n }\n parseEscape () {\n if (this.char in escapes) {\n return this.return(escapes[this.char])\n } else if (this.char === CHAR_u) {\n return this.call(this.parseSmallUnicode, this.parseUnicodeReturn)\n } else if (this.char === CHAR_U) {\n return this.call(this.parseLargeUnicode, this.parseUnicodeReturn)\n } else {\n throw this.error(new TomlError('Unknown escape character: ' + this.char))\n }\n }\n parseUnicodeReturn (char) {\n try {\n const codePoint = parseInt(char, 16)\n if (codePoint >= SURROGATE_FIRST && codePoint <= SURROGATE_LAST) {\n throw this.error(new TomlError('Invalid unicode, character in range 0xD800 - 0xDFFF is reserved'))\n }\n return this.returnNow(String.fromCodePoint(codePoint))\n } catch (err) {\n throw this.error(TomlError.wrap(err))\n }\n }\n parseSmallUnicode () {\n if (!isHexit(this.char)) {\n throw this.error(new TomlError('Invalid character in unicode sequence, expected hex'))\n } else {\n this.consume()\n if (this.state.buf.length >= 4) return this.return()\n }\n }\n parseLargeUnicode () {\n if (!isHexit(this.char)) {\n throw this.error(new TomlError('Invalid character in unicode sequence, expected hex'))\n } else {\n this.consume()\n if (this.state.buf.length >= 8) return this.return()\n }\n }\n\n /* NUMBERS */\n parseNumberSign () {\n this.consume()\n return this.next(this.parseMaybeSignedInfOrNan)\n }\n parseMaybeSignedInfOrNan () {\n if (this.char === CHAR_i) {\n return this.next(this.parseInf)\n } else if (this.char === CHAR_n) {\n return this.next(this.parseNan)\n } else {\n return this.callNow(this.parseNoUnder, this.parseNumberIntegerStart)\n }\n }\n parseNumberIntegerStart () {\n if (this.char === CHAR_0) {\n this.consume()\n return this.next(this.parseNumberIntegerExponentOrDecimal)\n } else {\n return this.goto(this.parseNumberInteger)\n }\n }\n parseNumberIntegerExponentOrDecimal () {\n if (this.char === CHAR_PERIOD) {\n this.consume()\n return this.call(this.parseNoUnder, this.parseNumberFloat)\n } else if (this.char === CHAR_E || this.char === CHAR_e) {\n this.consume()\n return this.next(this.parseNumberExponentSign)\n } else {\n return this.returnNow(Integer(this.state.buf))\n }\n }\n parseNumberInteger () {\n if (isDigit(this.char)) {\n this.consume()\n } else if (this.char === CHAR_LOWBAR) {\n return this.call(this.parseNoUnder)\n } else if (this.char === CHAR_E || this.char === CHAR_e) {\n this.consume()\n return this.next(this.parseNumberExponentSign)\n } else if (this.char === CHAR_PERIOD) {\n this.consume()\n return this.call(this.parseNoUnder, this.parseNumberFloat)\n } else {\n const result = Integer(this.state.buf)\n /* istanbul ignore if */\n if (result.isNaN()) {\n throw this.error(new TomlError('Invalid number'))\n } else {\n return this.returnNow(result)\n }\n }\n }\n parseNoUnder () {\n if (this.char === CHAR_LOWBAR || this.char === CHAR_PERIOD || this.char === CHAR_E || this.char === CHAR_e) {\n throw this.error(new TomlError('Unexpected character, expected digit'))\n } else if (this.atEndOfWord()) {\n throw this.error(new TomlError('Incomplete number'))\n }\n return this.returnNow()\n }\n parseNoUnderHexOctBinLiteral () {\n if (this.char === CHAR_LOWBAR || this.char === CHAR_PERIOD) {\n throw this.error(new TomlError('Unexpected character, expected digit'))\n } else if (this.atEndOfWord()) {\n throw this.error(new TomlError('Incomplete number'))\n }\n return this.returnNow()\n }\n parseNumberFloat () {\n if (this.char === CHAR_LOWBAR) {\n return this.call(this.parseNoUnder, this.parseNumberFloat)\n } else if (isDigit(this.char)) {\n this.consume()\n } else if (this.char === CHAR_E || this.char === CHAR_e) {\n this.consume()\n return this.next(this.parseNumberExponentSign)\n } else {\n return this.returnNow(Float(this.state.buf))\n }\n }\n parseNumberExponentSign () {\n if (isDigit(this.char)) {\n return this.goto(this.parseNumberExponent)\n } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {\n this.consume()\n this.call(this.parseNoUnder, this.parseNumberExponent)\n } else {\n throw this.error(new TomlError('Unexpected character, expected -, + or digit'))\n }\n }\n parseNumberExponent () {\n if (isDigit(this.char)) {\n this.consume()\n } else if (this.char === CHAR_LOWBAR) {\n return this.call(this.parseNoUnder)\n } else {\n return this.returnNow(Float(this.state.buf))\n }\n }\n\n /* NUMBERS or DATETIMES */\n parseNumberOrDateTime () {\n if (this.char === CHAR_0) {\n this.consume()\n return this.next(this.parseNumberBaseOrDateTime)\n } else {\n return this.goto(this.parseNumberOrDateTimeOnly)\n }\n }\n parseNumberOrDateTimeOnly () {\n // note, if two zeros are in a row then it MUST be a date\n if (this.char === CHAR_LOWBAR) {\n return this.call(this.parseNoUnder, this.parseNumberInteger)\n } else if (isDigit(this.char)) {\n this.consume()\n if (this.state.buf.length > 4) this.next(this.parseNumberInteger)\n } else if (this.char === CHAR_E || this.char === CHAR_e) {\n this.consume()\n return this.next(this.parseNumberExponentSign)\n } else if (this.char === CHAR_PERIOD) {\n this.consume()\n return this.call(this.parseNoUnder, this.parseNumberFloat)\n } else if (this.char === CHAR_HYPHEN) {\n return this.goto(this.parseDateTime)\n } else if (this.char === CHAR_COLON) {\n return this.goto(this.parseOnlyTimeHour)\n } else {\n return this.returnNow(Integer(this.state.buf))\n }\n }\n parseDateTimeOnly () {\n if (this.state.buf.length < 4) {\n if (isDigit(this.char)) {\n return this.consume()\n } else if (this.char === CHAR_COLON) {\n return this.goto(this.parseOnlyTimeHour)\n } else {\n throw this.error(new TomlError('Expected digit while parsing year part of a date'))\n }\n } else {\n if (this.char === CHAR_HYPHEN) {\n return this.goto(this.parseDateTime)\n } else {\n throw this.error(new TomlError('Expected hyphen (-) while parsing year part of date'))\n }\n }\n }\n parseNumberBaseOrDateTime () {\n if (this.char === CHAR_b) {\n this.consume()\n return this.call(this.parseNoUnderHexOctBinLiteral, this.parseIntegerBin)\n } else if (this.char === CHAR_o) {\n this.consume()\n return this.call(this.parseNoUnderHexOctBinLiteral, this.parseIntegerOct)\n } else if (this.char === CHAR_x) {\n this.consume()\n return this.call(this.parseNoUnderHexOctBinLiteral, this.parseIntegerHex)\n } else if (this.char === CHAR_PERIOD) {\n return this.goto(this.parseNumberInteger)\n } else if (isDigit(this.char)) {\n return this.goto(this.parseDateTimeOnly)\n } else {\n return this.returnNow(Integer(this.state.buf))\n }\n }\n parseIntegerHex () {\n if (isHexit(this.char)) {\n this.consume()\n } else if (this.char === CHAR_LOWBAR) {\n return this.call(this.parseNoUnderHexOctBinLiteral)\n } else {\n const result = Integer(this.state.buf)\n /* istanbul ignore if */\n if (result.isNaN()) {\n throw this.error(new TomlError('Invalid number'))\n } else {\n return this.returnNow(result)\n }\n }\n }\n parseIntegerOct () {\n if (isOctit(this.char)) {\n this.consume()\n } else if (this.char === CHAR_LOWBAR) {\n return this.call(this.parseNoUnderHexOctBinLiteral)\n } else {\n const result = Integer(this.state.buf)\n /* istanbul ignore if */\n if (result.isNaN()) {\n throw this.error(new TomlError('Invalid number'))\n } else {\n return this.returnNow(result)\n }\n }\n }\n parseIntegerBin () {\n if (isBit(this.char)) {\n this.consume()\n } else if (this.char === CHAR_LOWBAR) {\n return this.call(this.parseNoUnderHexOctBinLiteral)\n } else {\n const result = Integer(this.state.buf)\n /* istanbul ignore if */\n if (result.isNaN()) {\n throw this.error(new TomlError('Invalid number'))\n } else {\n return this.returnNow(result)\n }\n }\n }\n\n /* DATETIME */\n parseDateTime () {\n // we enter here having just consumed the year and about to consume the hyphen\n if (this.state.buf.length < 4) {\n throw this.error(new TomlError('Years less than 1000 must be zero padded to four characters'))\n }\n this.state.result = this.state.buf\n this.state.buf = ''\n return this.next(this.parseDateMonth)\n }\n parseDateMonth () {\n if (this.char === CHAR_HYPHEN) {\n if (this.state.buf.length < 2) {\n throw this.error(new TomlError('Months less than 10 must be zero padded to two characters'))\n }\n this.state.result += '-' + this.state.buf\n this.state.buf = ''\n return this.next(this.parseDateDay)\n } else if (isDigit(this.char)) {\n this.consume()\n } else {\n throw this.error(new TomlError('Incomplete datetime'))\n }\n }\n parseDateDay () {\n if (this.char === CHAR_T || this.char === CHAR_SP) {\n if (this.state.buf.length < 2) {\n throw this.error(new TomlError('Days less than 10 must be zero padded to two characters'))\n }\n this.state.result += '-' + this.state.buf\n this.state.buf = ''\n return this.next(this.parseStartTimeHour)\n } else if (this.atEndOfWord()) {\n return this.returnNow(createDate(this.state.result + '-' + this.state.buf))\n } else if (isDigit(this.char)) {\n this.consume()\n } else {\n throw this.error(new TomlError('Incomplete datetime'))\n }\n }\n parseStartTimeHour () {\n if (this.atEndOfWord()) {\n return this.returnNow(createDate(this.state.result))\n } else {\n return this.goto(this.parseTimeHour)\n }\n }\n parseTimeHour () {\n if (this.char === CHAR_COLON) {\n if (this.state.buf.length < 2) {\n throw this.error(new TomlError('Hours less than 10 must be zero padded to two characters'))\n }\n this.state.result += 'T' + this.state.buf\n this.state.buf = ''\n return this.next(this.parseTimeMin)\n } else if (isDigit(this.char)) {\n this.consume()\n } else {\n throw this.error(new TomlError('Incomplete datetime'))\n }\n }\n parseTimeMin () {\n if (this.state.buf.length < 2 && isDigit(this.char)) {\n this.consume()\n } else if (this.state.buf.length === 2 && this.char === CHAR_COLON) {\n this.state.result += ':' + this.state.buf\n this.state.buf = ''\n return this.next(this.parseTimeSec)\n } else {\n throw this.error(new TomlError('Incomplete datetime'))\n }\n }\n parseTimeSec () {\n if (isDigit(this.char)) {\n this.consume()\n if (this.state.buf.length === 2) {\n this.state.result += ':' + this.state.buf\n this.state.buf = ''\n return this.next(this.parseTimeZoneOrFraction)\n }\n } else {\n throw this.error(new TomlError('Incomplete datetime'))\n }\n }\n\n parseOnlyTimeHour () {\n /* istanbul ignore else */\n if (this.char === CHAR_COLON) {\n if (this.state.buf.length < 2) {\n throw this.error(new TomlError('Hours less than 10 must be zero padded to two characters'))\n }\n this.state.result = this.state.buf\n this.state.buf = ''\n return this.next(this.parseOnlyTimeMin)\n } else {\n throw this.error(new TomlError('Incomplete time'))\n }\n }\n parseOnlyTimeMin () {\n if (this.state.buf.length < 2 && isDigit(this.char)) {\n this.consume()\n } else if (this.state.buf.length === 2 && this.char === CHAR_COLON) {\n this.state.result += ':' + this.state.buf\n this.state.buf = ''\n return this.next(this.parseOnlyTimeSec)\n } else {\n throw this.error(new TomlError('Incomplete time'))\n }\n }\n parseOnlyTimeSec () {\n if (isDigit(this.char)) {\n this.consume()\n if (this.state.buf.length === 2) {\n return this.next(this.parseOnlyTimeFractionMaybe)\n }\n } else {\n throw this.error(new TomlError('Incomplete time'))\n }\n }\n parseOnlyTimeFractionMaybe () {\n this.state.result += ':' + this.state.buf\n if (this.char === CHAR_PERIOD) {\n this.state.buf = ''\n this.next(this.parseOnlyTimeFraction)\n } else {\n return this.return(createTime(this.state.result))\n }\n }\n parseOnlyTimeFraction () {\n if (isDigit(this.char)) {\n this.consume()\n } else if (this.atEndOfWord()) {\n if (this.state.buf.length === 0) throw this.error(new TomlError('Expected digit in milliseconds'))\n return this.returnNow(createTime(this.state.result + '.' + this.state.buf))\n } else {\n throw this.error(new TomlError('Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z'))\n }\n }\n\n parseTimeZoneOrFraction () {\n if (this.char === CHAR_PERIOD) {\n this.consume()\n this.next(this.parseDateTimeFraction)\n } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {\n this.consume()\n this.next(this.parseTimeZoneHour)\n } else if (this.char === CHAR_Z) {\n this.consume()\n return this.return(createDateTime(this.state.result + this.state.buf))\n } else if (this.atEndOfWord()) {\n return this.returnNow(createDateTimeFloat(this.state.result + this.state.buf))\n } else {\n throw this.error(new TomlError('Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z'))\n }\n }\n parseDateTimeFraction () {\n if (isDigit(this.char)) {\n this.consume()\n } else if (this.state.buf.length === 1) {\n throw this.error(new TomlError('Expected digit in milliseconds'))\n } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {\n this.consume()\n this.next(this.parseTimeZoneHour)\n } else if (this.char === CHAR_Z) {\n this.consume()\n return this.return(createDateTime(this.state.result + this.state.buf))\n } else if (this.atEndOfWord()) {\n return this.returnNow(createDateTimeFloat(this.state.result + this.state.buf))\n } else {\n throw this.error(new TomlError('Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z'))\n }\n }\n parseTimeZoneHour () {\n if (isDigit(this.char)) {\n this.consume()\n // FIXME: No more regexps\n if (/\\d\\d$/.test(this.state.buf)) return this.next(this.parseTimeZoneSep)\n } else {\n throw this.error(new TomlError('Unexpected character in datetime, expected digit'))\n }\n }\n parseTimeZoneSep () {\n if (this.char === CHAR_COLON) {\n this.consume()\n this.next(this.parseTimeZoneMin)\n } else {\n throw this.error(new TomlError('Unexpected character in datetime, expected colon'))\n }\n }\n parseTimeZoneMin () {\n if (isDigit(this.char)) {\n this.consume()\n if (/\\d\\d$/.test(this.state.buf)) return this.return(createDateTime(this.state.result + this.state.buf))\n } else {\n throw this.error(new TomlError('Unexpected character in datetime, expected digit'))\n }\n }\n\n /* BOOLEAN */\n parseBoolean () {\n /* istanbul ignore else */\n if (this.char === CHAR_t) {\n this.consume()\n return this.next(this.parseTrue_r)\n } else if (this.char === CHAR_f) {\n this.consume()\n return this.next(this.parseFalse_a)\n }\n }\n parseTrue_r () {\n if (this.char === CHAR_r) {\n this.consume()\n return this.next(this.parseTrue_u)\n } else {\n throw this.error(new TomlError('Invalid boolean, expected true or false'))\n }\n }\n parseTrue_u () {\n if (this.char === CHAR_u) {\n this.consume()\n return this.next(this.parseTrue_e)\n } else {\n throw this.error(new TomlError('Invalid boolean, expected true or false'))\n }\n }\n parseTrue_e () {\n if (this.char === CHAR_e) {\n return this.return(true)\n } else {\n throw this.error(new TomlError('Invalid boolean, expected true or false'))\n }\n }\n\n parseFalse_a () {\n if (this.char === CHAR_a) {\n this.consume()\n return this.next(this.parseFalse_l)\n } else {\n throw this.error(new TomlError('Invalid boolean, expected true or false'))\n }\n }\n\n parseFalse_l () {\n if (this.char === CHAR_l) {\n this.consume()\n return this.next(this.parseFalse_s)\n } else {\n throw this.error(new TomlError('Invalid boolean, expected true or false'))\n }\n }\n\n parseFalse_s () {\n if (this.char === CHAR_s) {\n this.consume()\n return this.next(this.parseFalse_e)\n } else {\n throw this.error(new TomlError('Invalid boolean, expected true or false'))\n }\n }\n\n parseFalse_e () {\n if (this.char === CHAR_e) {\n return this.return(false)\n } else {\n throw this.error(new TomlError('Invalid boolean, expected true or false'))\n }\n }\n\n /* INLINE LISTS */\n parseInlineList () {\n if (this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M || this.char === CTRL_J) {\n return null\n } else if (this.char === Parser.END) {\n throw this.error(new TomlError('Unterminated inline array'))\n } else if (this.char === CHAR_NUM) {\n return this.call(this.parseComment)\n } else if (this.char === CHAR_RSQB) {\n return this.return(this.state.resultArr || InlineList())\n } else {\n return this.callNow(this.parseValue, this.recordInlineListValue)\n }\n }\n recordInlineListValue (value) {\n if (!this.state.resultArr) {\n this.state.resultArr = InlineList(tomlType(value))\n }\n if (isFloat(value) || isInteger(value)) {\n // unbox now that we've verified they're ok\n this.state.resultArr.push(value.valueOf())\n } else {\n this.state.resultArr.push(value)\n }\n return this.goto(this.parseInlineListNext)\n }\n parseInlineListNext () {\n if (this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M || this.char === CTRL_J) {\n return null\n } else if (this.char === CHAR_NUM) {\n return this.call(this.parseComment)\n } else if (this.char === CHAR_COMMA) {\n return this.next(this.parseInlineList)\n } else if (this.char === CHAR_RSQB) {\n return this.goto(this.parseInlineList)\n } else {\n throw this.error(new TomlError('Invalid character, expected whitespace, comma (,) or close bracket (])'))\n }\n }\n\n /* INLINE TABLE */\n parseInlineTable () {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else if (this.char === Parser.END || this.char === CHAR_NUM || this.char === CTRL_J || this.char === CTRL_M) {\n throw this.error(new TomlError('Unterminated inline array'))\n } else if (this.char === CHAR_RCUB) {\n return this.return(this.state.resultTable || InlineTable())\n } else {\n if (!this.state.resultTable) this.state.resultTable = InlineTable()\n return this.callNow(this.parseAssign, this.recordInlineTableValue)\n }\n }\n recordInlineTableValue (kv) {\n let target = this.state.resultTable\n let finalKey = kv.key.pop()\n for (let kw of kv.key) {\n if (hasKey(target, kw) && (!isTable(target[kw]) || target[kw][_declared])) {\n throw this.error(new TomlError(\"Can't redefine existing key\"))\n }\n target = target[kw] = target[kw] || Table()\n }\n if (hasKey(target, finalKey)) {\n throw this.error(new TomlError(\"Can't redefine existing key\"))\n }\n if (isInteger(kv.value) || isFloat(kv.value)) {\n target[finalKey] = kv.value.valueOf()\n } else {\n target[finalKey] = kv.value\n }\n return this.goto(this.parseInlineTableNext)\n }\n parseInlineTableNext () {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else if (this.char === Parser.END || this.char === CHAR_NUM || this.char === CTRL_J || this.char === CTRL_M) {\n throw this.error(new TomlError('Unterminated inline array'))\n } else if (this.char === CHAR_COMMA) {\n return this.next(this.parseInlineTablePostComma)\n } else if (this.char === CHAR_RCUB) {\n return this.goto(this.parseInlineTable)\n } else {\n throw this.error(new TomlError('Invalid character, expected whitespace, comma (,) or close bracket (])'))\n }\n }\n parseInlineTablePostComma () {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else if (this.char === Parser.END || this.char === CHAR_NUM || this.char === CTRL_J || this.char === CTRL_M) {\n throw this.error(new TomlError('Unterminated inline array'))\n } else if (this.char === CHAR_COMMA) {\n throw this.error(new TomlError('Empty elements in inline tables are not permitted'))\n } else if (this.char === CHAR_RCUB) {\n throw this.error(new TomlError('Trailing commas in inline tables are not permitted'))\n } else {\n return this.goto(this.parseInlineTable)\n }\n }\n }\n return TOMLParser\n}\n","'use strict'\nmodule.exports = prettyError\n\nfunction prettyError (err, buf) {\n /* istanbul ignore if */\n if (err.pos == null || err.line == null) return err\n let msg = err.message\n msg += ` at row ${err.line + 1}, col ${err.col + 1}, pos ${err.pos}:\\n`\n\n /* istanbul ignore else */\n if (buf && buf.split) {\n const lines = buf.split(/\\n/)\n const lineNumWidth = String(Math.min(lines.length, err.line + 3)).length\n let linePadding = ' '\n while (linePadding.length < lineNumWidth) linePadding += ' '\n for (let ii = Math.max(0, err.line - 1); ii < Math.min(lines.length, err.line + 2); ++ii) {\n let lineNum = String(ii + 1)\n if (lineNum.length < lineNumWidth) lineNum = ' ' + lineNum\n if (err.line === ii) {\n msg += lineNum + '> ' + lines[ii] + '\\n'\n msg += linePadding + ' '\n for (let hh = 0; hh < err.col; ++hh) {\n msg += ' '\n }\n msg += '^\\n'\n } else {\n msg += lineNum + ': ' + lines[ii] + '\\n'\n }\n }\n }\n err.message = msg + '\\n'\n return err\n}\n","'use strict'\nmodule.exports = parseString\n\nconst TOMLParser = require('./lib/toml-parser.js')\nconst prettyError = require('./parse-pretty-error.js')\n\nfunction parseString (str) {\n if (global.Buffer && global.Buffer.isBuffer(str)) {\n str = str.toString('utf8')\n }\n const parser = new TOMLParser()\n try {\n parser.parse(str)\n return parser.finish()\n } catch (err) {\n throw prettyError(err, str)\n }\n}\n","'use strict'\nmodule.exports = parseAsync\n\nconst TOMLParser = require('./lib/toml-parser.js')\nconst prettyError = require('./parse-pretty-error.js')\n\nfunction parseAsync (str, opts) {\n if (!opts) opts = {}\n const index = 0\n const blocksize = opts.blocksize || 40960\n const parser = new TOMLParser()\n return new Promise((resolve, reject) => {\n setImmediate(parseAsyncNext, index, blocksize, resolve, reject)\n })\n function parseAsyncNext (index, blocksize, resolve, reject) {\n if (index >= str.length) {\n try {\n return resolve(parser.finish())\n } catch (err) {\n return reject(prettyError(err, str))\n }\n }\n try {\n parser.parse(str.slice(index, index + blocksize))\n setImmediate(parseAsyncNext, index + blocksize, blocksize, resolve, reject)\n } catch (err) {\n reject(prettyError(err, str))\n }\n }\n}\n","'use strict'\nmodule.exports = parseStream\n\nconst stream = require('stream')\nconst TOMLParser = require('./lib/toml-parser.js')\n\nfunction parseStream (stm) {\n if (stm) {\n return parseReadable(stm)\n } else {\n return parseTransform(stm)\n }\n}\n\nfunction parseReadable (stm) {\n const parser = new TOMLParser()\n stm.setEncoding('utf8')\n return new Promise((resolve, reject) => {\n let readable\n let ended = false\n let errored = false\n function finish () {\n ended = true\n if (readable) return\n try {\n resolve(parser.finish())\n } catch (err) {\n reject(err)\n }\n }\n function error (err) {\n errored = true\n reject(err)\n }\n stm.once('end', finish)\n stm.once('error', error)\n readNext()\n\n function readNext () {\n readable = true\n let data\n while ((data = stm.read()) !== null) {\n try {\n parser.parse(data)\n } catch (err) {\n return error(err)\n }\n }\n readable = false\n /* istanbul ignore if */\n if (ended) return finish()\n /* istanbul ignore if */\n if (errored) return\n stm.once('readable', readNext)\n }\n })\n}\n\nfunction parseTransform () {\n const parser = new TOMLParser()\n return new stream.Transform({\n objectMode: true,\n transform (chunk, encoding, cb) {\n try {\n parser.parse(chunk.toString(encoding))\n } catch (err) {\n this.emit('error', err)\n }\n cb()\n },\n flush (cb) {\n try {\n this.push(parser.finish())\n } catch (err) {\n this.emit('error', err)\n }\n cb()\n }\n })\n}\n","'use strict'\nmodule.exports = stringify\nmodule.exports.value = stringifyInline\n\nfunction stringify (obj) {\n if (obj === null) throw typeError('null')\n if (obj === void (0)) throw typeError('undefined')\n if (typeof obj !== 'object') throw typeError(typeof obj)\n\n if (typeof obj.toJSON === 'function') obj = obj.toJSON()\n if (obj == null) return null\n const type = tomlType(obj)\n if (type !== 'table') throw typeError(type)\n return stringifyObject('', '', obj)\n}\n\nfunction typeError (type) {\n return new Error('Can only stringify objects, not ' + type)\n}\n\nfunction getInlineKeys (obj) {\n return Object.keys(obj).filter(key => isInline(obj[key]))\n}\nfunction getComplexKeys (obj) {\n return Object.keys(obj).filter(key => !isInline(obj[key]))\n}\n\nfunction toJSON (obj) {\n let nobj = Array.isArray(obj) ? [] : Object.prototype.hasOwnProperty.call(obj, '__proto__') ? {['__proto__']: undefined} : {}\n for (let prop of Object.keys(obj)) {\n if (obj[prop] && typeof obj[prop].toJSON === 'function' && !('toISOString' in obj[prop])) {\n nobj[prop] = obj[prop].toJSON()\n } else {\n nobj[prop] = obj[prop]\n }\n }\n return nobj\n}\n\nfunction stringifyObject (prefix, indent, obj) {\n obj = toJSON(obj)\n let inlineKeys\n let complexKeys\n inlineKeys = getInlineKeys(obj)\n complexKeys = getComplexKeys(obj)\n const result = []\n const inlineIndent = indent || ''\n inlineKeys.forEach(key => {\n var type = tomlType(obj[key])\n if (type !== 'undefined' && type !== 'null') {\n result.push(inlineIndent + stringifyKey(key) + ' = ' + stringifyAnyInline(obj[key], true))\n }\n })\n if (result.length > 0) result.push('')\n const complexIndent = prefix && inlineKeys.length > 0 ? indent + ' ' : ''\n complexKeys.forEach(key => {\n result.push(stringifyComplex(prefix, complexIndent, key, obj[key]))\n })\n return result.join('\\n')\n}\n\nfunction isInline (value) {\n switch (tomlType(value)) {\n case 'undefined':\n case 'null':\n case 'integer':\n case 'nan':\n case 'float':\n case 'boolean':\n case 'string':\n case 'datetime':\n return true\n case 'array':\n return value.length === 0 || tomlType(value[0]) !== 'table'\n case 'table':\n return Object.keys(value).length === 0\n /* istanbul ignore next */\n default:\n return false\n }\n}\n\nfunction tomlType (value) {\n if (value === undefined) {\n return 'undefined'\n } else if (value === null) {\n return 'null'\n /* eslint-disable valid-typeof */\n } else if (typeof value === 'bigint' || (Number.isInteger(value) && !Object.is(value, -0))) {\n return 'integer'\n } else if (typeof value === 'number') {\n return 'float'\n } else if (typeof value === 'boolean') {\n return 'boolean'\n } else if (typeof value === 'string') {\n return 'string'\n } else if ('toISOString' in value) {\n return isNaN(value) ? 'undefined' : 'datetime'\n } else if (Array.isArray(value)) {\n return 'array'\n } else {\n return 'table'\n }\n}\n\nfunction stringifyKey (key) {\n const keyStr = String(key)\n if (/^[-A-Za-z0-9_]+$/.test(keyStr)) {\n return keyStr\n } else {\n return stringifyBasicString(keyStr)\n }\n}\n\nfunction stringifyBasicString (str) {\n return '\"' + escapeString(str).replace(/\"/g, '\\\\\"') + '\"'\n}\n\nfunction stringifyLiteralString (str) {\n return \"'\" + str + \"'\"\n}\n\nfunction numpad (num, str) {\n while (str.length < num) str = '0' + str\n return str\n}\n\nfunction escapeString (str) {\n return str.replace(/\\\\/g, '\\\\\\\\')\n .replace(/[\\b]/g, '\\\\b')\n .replace(/\\t/g, '\\\\t')\n .replace(/\\n/g, '\\\\n')\n .replace(/\\f/g, '\\\\f')\n .replace(/\\r/g, '\\\\r')\n /* eslint-disable no-control-regex */\n .replace(/([\\u0000-\\u001f\\u007f])/, c => '\\\\u' + numpad(4, c.codePointAt(0).toString(16)))\n /* eslint-enable no-control-regex */\n}\n\nfunction stringifyMultilineString (str) {\n let escaped = str.split(/\\n/).map(str => {\n return escapeString(str).replace(/\"(?=\"\")/g, '\\\\\"')\n }).join('\\n')\n if (escaped.slice(-1) === '\"') escaped += '\\\\\\n'\n return '\"\"\"\\n' + escaped + '\"\"\"'\n}\n\nfunction stringifyAnyInline (value, multilineOk) {\n let type = tomlType(value)\n if (type === 'string') {\n if (multilineOk && /\\n/.test(value)) {\n type = 'string-multiline'\n } else if (!/[\\b\\t\\n\\f\\r']/.test(value) && /\"/.test(value)) {\n type = 'string-literal'\n }\n }\n return stringifyInline(value, type)\n}\n\nfunction stringifyInline (value, type) {\n /* istanbul ignore if */\n if (!type) type = tomlType(value)\n switch (type) {\n case 'string-multiline':\n return stringifyMultilineString(value)\n case 'string':\n return stringifyBasicString(value)\n case 'string-literal':\n return stringifyLiteralString(value)\n case 'integer':\n return stringifyInteger(value)\n case 'float':\n return stringifyFloat(value)\n case 'boolean':\n return stringifyBoolean(value)\n case 'datetime':\n return stringifyDatetime(value)\n case 'array':\n return stringifyInlineArray(value.filter(_ => tomlType(_) !== 'null' && tomlType(_) !== 'undefined' && tomlType(_) !== 'nan'))\n case 'table':\n return stringifyInlineTable(value)\n /* istanbul ignore next */\n default:\n throw typeError(type)\n }\n}\n\nfunction stringifyInteger (value) {\n /* eslint-disable security/detect-unsafe-regex */\n return String(value).replace(/\\B(?=(\\d{3})+(?!\\d))/g, '_')\n}\n\nfunction stringifyFloat (value) {\n if (value === Infinity) {\n return 'inf'\n } else if (value === -Infinity) {\n return '-inf'\n } else if (Object.is(value, NaN)) {\n return 'nan'\n } else if (Object.is(value, -0)) {\n return '-0.0'\n }\n const [int, dec] = String(value).split('.')\n return stringifyInteger(int) + '.' + dec\n}\n\nfunction stringifyBoolean (value) {\n return String(value)\n}\n\nfunction stringifyDatetime (value) {\n return value.toISOString()\n}\n\nfunction stringifyInlineArray (values) {\n values = toJSON(values)\n let result = '['\n const stringified = values.map(_ => stringifyInline(_))\n if (stringified.join(', ').length > 60 || /\\n/.test(stringified)) {\n result += '\\n ' + stringified.join(',\\n ') + '\\n'\n } else {\n result += ' ' + stringified.join(', ') + (stringified.length > 0 ? ' ' : '')\n }\n return result + ']'\n}\n\nfunction stringifyInlineTable (value) {\n value = toJSON(value)\n const result = []\n Object.keys(value).forEach(key => {\n result.push(stringifyKey(key) + ' = ' + stringifyAnyInline(value[key], false))\n })\n return '{ ' + result.join(', ') + (result.length > 0 ? ' ' : '') + '}'\n}\n\nfunction stringifyComplex (prefix, indent, key, value) {\n const valueType = tomlType(value)\n /* istanbul ignore else */\n if (valueType === 'array') {\n return stringifyArrayOfTables(prefix, indent, key, value)\n } else if (valueType === 'table') {\n return stringifyComplexTable(prefix, indent, key, value)\n } else {\n throw typeError(valueType)\n }\n}\n\nfunction stringifyArrayOfTables (prefix, indent, key, values) {\n values = toJSON(values)\n const firstValueType = tomlType(values[0])\n /* istanbul ignore if */\n if (firstValueType !== 'table') throw typeError(firstValueType)\n const fullKey = prefix + stringifyKey(key)\n let result = ''\n values.forEach(table => {\n if (result.length > 0) result += '\\n'\n result += indent + '[[' + fullKey + ']]\\n'\n result += stringifyObject(fullKey + '.', indent, table)\n })\n return result\n}\n\nfunction stringifyComplexTable (prefix, indent, key, value) {\n const fullKey = prefix + stringifyKey(key)\n let result = ''\n if (getInlineKeys(value).length > 0) {\n result += indent + '[' + fullKey + ']\\n'\n }\n return result + stringifyObject(fullKey + '.', indent, value)\n}\n","/* eslint no-unsafe-finally: \"off\" */\nimport * as core from '@actions/core';\nimport fs from 'fs';\nimport * as path from 'path';\nimport * as semver from 'semver';\nimport * as toml from '@iarna/toml';\nimport * as exec from '@actions/exec';\nimport * as ifm from '@actions/http-client/lib/interfaces';\n\nimport * as http from 'http';\n\nexport const IS_WINDOWS = process.platform === 'win32';\nexport const IS_LINUX = process.platform === 'linux';\nexport const IS_MAC = process.platform === 'darwin';\nexport const WINDOWS_ARCHS = ['x86', 'x64'];\nexport const WINDOWS_PLATFORMS = ['win32', 'win64'];\nconst PYPY_VERSION_FILE = 'PYPY_VERSION';\n\nexport interface IPyPyManifestAsset {\n filename: string;\n arch: string;\n platform: string;\n download_url: string;\n}\n\nexport interface IPyPyManifestRelease {\n pypy_version: string;\n python_version: string;\n stable: boolean;\n latest_pypy: boolean;\n files: IPyPyManifestAsset[];\n}\n\nexport interface IGraalPyManifestAsset {\n name: string;\n browser_download_url: string;\n}\n\nexport interface IGraalPyManifestRelease {\n tag_name: string;\n assets: IGraalPyManifestAsset[];\n}\n\n/** create Symlinks for downloaded PyPy\n * It should be executed only for downloaded versions in runtime, because\n * toolcache versions have this setup.\n */\nexport function createSymlinkInFolder(\n folderPath: string,\n sourceName: string,\n targetName: string,\n setExecutable = false\n) {\n const sourcePath = path.join(folderPath, sourceName);\n const targetPath = path.join(folderPath, targetName);\n if (fs.existsSync(targetPath)) {\n return;\n }\n\n fs.symlinkSync(sourcePath, targetPath);\n if (!IS_WINDOWS && setExecutable) {\n fs.chmodSync(targetPath, '755');\n }\n}\n\nexport function validateVersion(version: string) {\n return isNightlyKeyword(version) || Boolean(semver.validRange(version));\n}\n\nexport function isNightlyKeyword(pypyVersion: string) {\n return pypyVersion === 'nightly';\n}\n\nexport function getPyPyVersionFromPath(installDir: string) {\n return path.basename(path.dirname(installDir));\n}\n\n/**\n * In tool-cache, we put PyPy to '/PyPy//x64'\n * There is no easy way to determine what PyPy version is located in specific folder\n * 'pypy --version' is not reliable enough since it is not set properly for preview versions\n * \"7.3.3rc1\" is marked as '7.3.3' in 'pypy --version'\n * so we put PYPY_VERSION file to PyPy directory when install it to VM and read it when we need to know version\n * PYPY_VERSION contains exact version from 'versions.json'\n */\nexport function readExactPyPyVersionFile(installDir: string) {\n let pypyVersion = '';\n const fileVersion = path.join(installDir, PYPY_VERSION_FILE);\n if (fs.existsSync(fileVersion)) {\n pypyVersion = fs.readFileSync(fileVersion).toString().trim();\n }\n\n return pypyVersion;\n}\n\nexport function writeExactPyPyVersionFile(\n installDir: string,\n resolvedPyPyVersion: string\n) {\n const pypyFilePath = path.join(installDir, PYPY_VERSION_FILE);\n fs.writeFileSync(pypyFilePath, resolvedPyPyVersion);\n}\n\n/**\n * Python version should be specified explicitly like \"x.y\" (3.10, 3.11, etc)\n * \"3.x\" or \"3\" are not supported\n * because it could cause ambiguity when both PyPy version and Python version are not precise\n */\nexport function validatePythonVersionFormatForPyPy(version: string) {\n const re = /^\\d+\\.\\d+$/;\n return re.test(version);\n}\n\nexport function logWarning(message: string): void {\n const warningPrefix = '[warning]';\n core.info(`${warningPrefix}${message}`);\n}\n\nasync function getWindowsInfo() {\n const {stdout} = await exec.getExecOutput(\n 'powershell -command \"(Get-CimInstance -ClassName Win32_OperatingSystem).Caption\"',\n undefined,\n {\n silent: true\n }\n );\n\n const windowsVersion = stdout.trim().split(' ')[3];\n\n return {osName: 'Windows', osVersion: windowsVersion};\n}\n\nasync function getMacOSInfo() {\n const {stdout} = await exec.getExecOutput('sw_vers', ['-productVersion'], {\n silent: true\n });\n\n const macOSVersion = stdout.trim();\n\n return {osName: 'macOS', osVersion: macOSVersion};\n}\n\nexport async function getLinuxInfo() {\n const {stdout} = await exec.getExecOutput('lsb_release', ['-i', '-r', '-s'], {\n silent: true\n });\n\n const [osName, osVersion] = stdout.trim().split('\\n');\n\n core.debug(`OS Name: ${osName}, Version: ${osVersion}`);\n\n return {osName: osName, osVersion: osVersion};\n}\n\nexport async function getOSInfo() {\n let osInfo;\n try {\n if (IS_WINDOWS) {\n osInfo = await getWindowsInfo();\n } else if (IS_LINUX) {\n osInfo = await getLinuxInfo();\n } else if (IS_MAC) {\n osInfo = await getMacOSInfo();\n }\n } catch (err) {\n const error = err as Error;\n core.debug(error.message);\n } finally {\n return osInfo;\n }\n}\n\n/**\n * Extract a value from an object by following the keys path provided.\n * If the value is present, it is returned. Otherwise undefined is returned.\n */\nfunction extractValue(obj: any, keys: string[]): string | undefined {\n if (keys.length > 0) {\n const value = obj[keys[0]];\n if (keys.length > 1 && value !== undefined) {\n return extractValue(value, keys.slice(1));\n } else {\n return value;\n }\n } else {\n return;\n }\n}\n\n/**\n * Python version extracted from the TOML file.\n * If the `project` key is present at the root level, the version is assumed to\n * be specified according to PEP 621 in `project.requires-python`.\n * Otherwise, if the `tool` key is present at the root level, the version is\n * assumed to be specified using poetry under `tool.poetry.dependencies.python`.\n * If none is present, returns an empty list.\n */\nexport function getVersionInputFromTomlFile(versionFile: string): string[] {\n core.debug(`Trying to resolve version form ${versionFile}`);\n\n let pyprojectFile = fs.readFileSync(versionFile, 'utf8');\n // Normalize the line endings in the pyprojectFile\n pyprojectFile = pyprojectFile.replace(/\\r\\n/g, '\\n');\n\n const pyprojectConfig = toml.parse(pyprojectFile);\n let keys = [];\n\n if ('project' in pyprojectConfig) {\n // standard project metadata (PEP 621)\n keys = ['project', 'requires-python'];\n } else {\n // python poetry\n keys = ['tool', 'poetry', 'dependencies', 'python'];\n }\n const versions = [];\n const version = extractValue(pyprojectConfig, keys);\n if (version !== undefined) {\n versions.push(version);\n }\n\n core.info(`Extracted ${versions} from ${versionFile}`);\n const rawVersions = Array.from(versions, version =>\n version.split(',').join(' ')\n );\n const validatedVersions = rawVersions\n .map(item => semver.validRange(item, true))\n .filter((versionRange, index) => {\n if (!versionRange) {\n core.debug(\n `The version ${rawVersions[index]} is not valid SemVer range`\n );\n }\n\n return !!versionRange;\n }) as string[];\n return validatedVersions;\n}\n\n/**\n * Python version extracted from a plain text file.\n */\nexport function getVersionInputFromPlainFile(versionFile: string): string[] {\n core.debug(`Trying to resolve version form ${versionFile}`);\n const version = fs.readFileSync(versionFile, 'utf8').trim();\n core.info(`Resolved ${versionFile} as ${version}`);\n return [version];\n}\n\n/**\n * Python version extracted from a plain or TOML file.\n */\nexport function getVersionInputFromFile(versionFile: string): string[] {\n if (versionFile.endsWith('.toml')) {\n return getVersionInputFromTomlFile(versionFile);\n } else {\n return getVersionInputFromPlainFile(versionFile);\n }\n}\n\n/**\n * Get the directory containing interpreter binary from installation directory of PyPy or GraalPy\n * - On Linux and macOS, the Python interpreter is in 'bin'.\n * - On Windows, it is in the installation root.\n */\nexport function getBinaryDirectory(installDir: string) {\n return IS_WINDOWS ? installDir : path.join(installDir, 'bin');\n}\n\n/**\n * Extract next page URL from a HTTP response \"link\" header. Such headers are used in GitHub APIs.\n */\nexport function getNextPageUrl(response: ifm.TypedResponse) {\n const responseHeaders = response.headers;\n const linkHeader = responseHeaders.link;\n if (typeof linkHeader === 'string') {\n for (const link of linkHeader.split(/\\s*,\\s*/)) {\n const match = link.match(/<([^>]+)>(.*)/);\n if (match) {\n const url = match[1];\n for (const param of match[2].split(/\\s*;\\s*/)) {\n if (param.match(/rel=\"?next\"?/)) {\n return url;\n }\n }\n }\n }\n }\n return null;\n}\n\n/**\n * Add temporary fix for Windows\n * On Windows, it is necessary to retain the .zip extension for proper extraction.\n * because the tc.extractZip() failure due to tc.downloadTool() not adding .zip extension.\n * Related issue: https://github.com/actions/toolkit/issues/1179\n * Related issue: https://github.com/actions/setup-python/issues/819\n */\nexport function getDownloadFileName(downloadUrl: string): string | undefined {\n const tempDir = process.env.RUNNER_TEMP || '.';\n return IS_WINDOWS\n ? path.join(tempDir, path.basename(downloadUrl))\n : undefined;\n}\n","import * as os from 'os';\nimport * as path from 'path';\nimport * as core from '@actions/core';\nimport * as tc from '@actions/tool-cache';\nimport * as semver from 'semver';\nimport * as httpm from '@actions/http-client';\nimport * as exec from '@actions/exec';\nimport fs from 'fs';\n\nimport {\n IS_WINDOWS,\n WINDOWS_PLATFORMS,\n IPyPyManifestRelease,\n createSymlinkInFolder,\n isNightlyKeyword,\n writeExactPyPyVersionFile,\n getBinaryDirectory,\n getDownloadFileName\n} from './utils';\n\nexport async function installPyPy(\n pypyVersion: string,\n pythonVersion: string,\n architecture: string,\n allowPreReleases: boolean,\n releases: IPyPyManifestRelease[] | undefined\n) {\n let downloadDir;\n\n releases = releases ?? (await getAvailablePyPyVersions());\n\n if (!releases || releases.length === 0) {\n throw new Error('No release was found in PyPy version.json');\n }\n\n let releaseData = findRelease(\n releases,\n pythonVersion,\n pypyVersion,\n architecture,\n false\n );\n\n if (allowPreReleases && (!releaseData || !releaseData.foundAsset)) {\n // check for pre-release\n core.info(\n [\n `Stable PyPy version ${pythonVersion} (${pypyVersion}) with arch ${architecture} not found`,\n `Trying pre-release versions`\n ].join(os.EOL)\n );\n releaseData = findRelease(\n releases,\n pythonVersion,\n pypyVersion,\n architecture,\n true\n );\n }\n\n if (!releaseData || !releaseData.foundAsset) {\n throw new Error(\n `PyPy version ${pythonVersion} (${pypyVersion}) with arch ${architecture} not found`\n );\n }\n\n const {foundAsset, resolvedPythonVersion, resolvedPyPyVersion} = releaseData;\n const downloadUrl = `${foundAsset.download_url}`;\n\n core.info(`Downloading PyPy from \"${downloadUrl}\" ...`);\n\n try {\n const fileName = getDownloadFileName(downloadUrl);\n const pypyPath = await tc.downloadTool(downloadUrl, fileName);\n\n core.info('Extracting downloaded archive...');\n if (IS_WINDOWS) {\n downloadDir = await tc.extractZip(pypyPath);\n } else {\n downloadDir = await tc.extractTar(pypyPath, undefined, 'x');\n }\n\n // root folder in archive can have unpredictable name so just take the first folder\n // downloadDir is unique folder under TEMP and can't contain any other folders\n const archiveName = fs.readdirSync(downloadDir)[0];\n\n const toolDir = path.join(downloadDir, archiveName);\n let installDir = toolDir;\n if (!isNightlyKeyword(resolvedPyPyVersion)) {\n installDir = await tc.cacheDir(\n toolDir,\n 'PyPy',\n resolvedPythonVersion,\n architecture\n );\n }\n\n writeExactPyPyVersionFile(installDir, resolvedPyPyVersion);\n\n const binaryPath = getBinaryDirectory(installDir);\n await createPyPySymlink(binaryPath, resolvedPythonVersion);\n await installPip(binaryPath);\n\n return {installDir, resolvedPythonVersion, resolvedPyPyVersion};\n } catch (err) {\n if (err instanceof Error) {\n // Rate limit?\n if (\n err instanceof tc.HTTPError &&\n (err.httpStatusCode === 403 || err.httpStatusCode === 429)\n ) {\n core.info(\n `Received HTTP status code ${err.httpStatusCode}. This usually indicates the rate limit has been exceeded`\n );\n } else {\n core.info(err.message);\n }\n if (err.stack !== undefined) {\n core.debug(err.stack);\n }\n }\n throw err;\n }\n}\n\nexport async function getAvailablePyPyVersions() {\n const url = 'https://downloads.python.org/pypy/versions.json';\n const http: httpm.HttpClient = new httpm.HttpClient('tool-cache');\n\n const response = await http.getJson(url);\n if (!response.result) {\n throw new Error(\n `Unable to retrieve the list of available PyPy versions from '${url}'`\n );\n }\n\n return response.result;\n}\n\nasync function createPyPySymlink(\n pypyBinaryPath: string,\n pythonVersion: string\n) {\n const version = semver.coerce(pythonVersion)!;\n const pythonBinaryPostfix = semver.major(version);\n const pythonMinor = semver.minor(version);\n const pypyBinaryPostfix = pythonBinaryPostfix === 2 ? '' : '3';\n const pypyMajorMinorBinaryPostfix = `${pythonBinaryPostfix}.${pythonMinor}`;\n const binaryExtension = IS_WINDOWS ? '.exe' : '';\n\n core.info('Creating symlinks...');\n createSymlinkInFolder(\n pypyBinaryPath,\n `pypy${pypyBinaryPostfix}${binaryExtension}`,\n `python${pythonBinaryPostfix}${binaryExtension}`,\n true\n );\n\n createSymlinkInFolder(\n pypyBinaryPath,\n `pypy${pypyBinaryPostfix}${binaryExtension}`,\n `python${binaryExtension}`,\n true\n );\n\n createSymlinkInFolder(\n pypyBinaryPath,\n `pypy${pypyBinaryPostfix}${binaryExtension}`,\n `pypy${pypyMajorMinorBinaryPostfix}${binaryExtension}`,\n true\n );\n}\n\nasync function installPip(pythonLocation: string) {\n core.info('Installing and updating pip');\n const pythonBinary = path.join(pythonLocation, 'python');\n await exec.exec(`${pythonBinary} -m ensurepip`);\n\n await exec.exec(\n `${pythonLocation}/python -m pip install --ignore-installed pip`\n );\n}\n\nexport function findRelease(\n releases: IPyPyManifestRelease[],\n pythonVersion: string,\n pypyVersion: string,\n architecture: string,\n includePrerelease: boolean\n) {\n const options = {includePrerelease: includePrerelease};\n const filterReleases = releases.filter(item => {\n const isPythonVersionSatisfied = semver.satisfies(\n semver.coerce(item.python_version)!,\n pythonVersion\n );\n const isPyPyNightly =\n isNightlyKeyword(pypyVersion) && isNightlyKeyword(item.pypy_version);\n const isPyPyVersionSatisfied =\n isPyPyNightly ||\n semver.satisfies(\n pypyVersionToSemantic(item.pypy_version),\n pypyVersion,\n options\n );\n const isArchPresent =\n item.files &&\n (IS_WINDOWS\n ? isArchPresentForWindows(item, architecture)\n : isArchPresentForMacOrLinux(item, architecture, process.platform));\n return isPythonVersionSatisfied && isPyPyVersionSatisfied && isArchPresent;\n });\n\n if (filterReleases.length === 0) {\n return null;\n }\n\n const sortedReleases = filterReleases.sort((previous, current) => {\n return (\n semver.compare(\n semver.coerce(pypyVersionToSemantic(current.pypy_version))!,\n semver.coerce(pypyVersionToSemantic(previous.pypy_version))!\n ) ||\n semver.compare(\n semver.coerce(current.python_version)!,\n semver.coerce(previous.python_version)!\n )\n );\n });\n\n const foundRelease = sortedReleases[0];\n const foundAsset = IS_WINDOWS\n ? findAssetForWindows(foundRelease, architecture)\n : findAssetForMacOrLinux(foundRelease, architecture, process.platform);\n\n return {\n foundAsset,\n resolvedPythonVersion: foundRelease.python_version,\n resolvedPyPyVersion: foundRelease.pypy_version.trim()\n };\n}\n\nexport function pypyVersionToSemantic(versionSpec: string) {\n const prereleaseVersion = /(\\d+\\.\\d+\\.\\d+)((?:a|b|rc))(\\d*)/g;\n return versionSpec.replace(prereleaseVersion, '$1-$2.$3');\n}\n\nexport function isArchPresentForWindows(item: any, architecture: string) {\n architecture = replaceX32toX86(architecture);\n return item.files.some(\n (file: any) =>\n WINDOWS_PLATFORMS.includes(file.platform) && file.arch === architecture\n );\n}\n\nexport function isArchPresentForMacOrLinux(\n item: any,\n architecture: string,\n platform: string\n) {\n return item.files.some(\n (file: any) => file.arch === architecture && file.platform === platform\n );\n}\n\nexport function findAssetForWindows(releases: any, architecture: string) {\n architecture = replaceX32toX86(architecture);\n return releases.files.find(\n (item: any) =>\n WINDOWS_PLATFORMS.includes(item.platform) && item.arch === architecture\n );\n}\n\nexport function findAssetForMacOrLinux(\n releases: any,\n architecture: string,\n platform: string\n) {\n return releases.files.find(\n (item: any) => item.arch === architecture && item.platform === platform\n );\n}\n\nfunction replaceX32toX86(architecture: string): string {\n // convert x32 to x86 because os.arch() returns x32 for 32-bit systems but PyPy releases json has x86 arch value.\n if (architecture === 'x32') {\n architecture = 'x86';\n }\n return architecture;\n}\n","import * as path from 'path';\nimport * as pypyInstall from './install-pypy';\nimport {\n IS_WINDOWS,\n WINDOWS_ARCHS,\n validateVersion,\n getPyPyVersionFromPath,\n readExactPyPyVersionFile,\n validatePythonVersionFormatForPyPy,\n IPyPyManifestRelease,\n getBinaryDirectory\n} from './utils';\n\nimport * as semver from 'semver';\nimport * as core from '@actions/core';\nimport * as tc from '@actions/tool-cache';\n\ninterface IPyPyVersionSpec {\n pypyVersion: string;\n pythonVersion: string;\n}\n\nexport async function findPyPyVersion(\n versionSpec: string,\n architecture: string,\n updateEnvironment: boolean,\n checkLatest: boolean,\n allowPreReleases: boolean\n): Promise<{resolvedPyPyVersion: string; resolvedPythonVersion: string}> {\n let resolvedPyPyVersion = '';\n let resolvedPythonVersion = '';\n let installDir: string | null;\n let releases: IPyPyManifestRelease[] | undefined;\n\n const pypyVersionSpec = parsePyPyVersion(versionSpec);\n\n if (checkLatest) {\n releases = await pypyInstall.getAvailablePyPyVersions();\n if (releases && releases.length > 0) {\n const releaseData = pypyInstall.findRelease(\n releases,\n pypyVersionSpec.pythonVersion,\n pypyVersionSpec.pypyVersion,\n architecture,\n false\n );\n\n if (releaseData) {\n core.info(\n `Resolved as PyPy ${releaseData.resolvedPyPyVersion} with Python (${releaseData.resolvedPythonVersion})`\n );\n pypyVersionSpec.pythonVersion = releaseData.resolvedPythonVersion;\n pypyVersionSpec.pypyVersion = releaseData.resolvedPyPyVersion;\n } else {\n core.info(\n `Failed to resolve PyPy ${pypyVersionSpec.pypyVersion} with Python (${pypyVersionSpec.pythonVersion}) from manifest`\n );\n }\n }\n }\n\n ({installDir, resolvedPythonVersion, resolvedPyPyVersion} = findPyPyToolCache(\n pypyVersionSpec.pythonVersion,\n pypyVersionSpec.pypyVersion,\n architecture\n ));\n\n if (!installDir) {\n ({installDir, resolvedPythonVersion, resolvedPyPyVersion} =\n await pypyInstall.installPyPy(\n pypyVersionSpec.pypyVersion,\n pypyVersionSpec.pythonVersion,\n architecture,\n allowPreReleases,\n releases\n ));\n }\n\n const pipDir = IS_WINDOWS ? 'Scripts' : 'bin';\n const _binDir = path.join(installDir, pipDir);\n const binaryExtension = IS_WINDOWS ? '.exe' : '';\n const pythonPath = path.join(\n IS_WINDOWS ? installDir : _binDir,\n `python${binaryExtension}`\n );\n const pythonLocation = getBinaryDirectory(installDir);\n if (updateEnvironment) {\n core.exportVariable('pythonLocation', installDir);\n // https://cmake.org/cmake/help/latest/module/FindPython.html#module:FindPython\n core.exportVariable('Python_ROOT_DIR', installDir);\n // https://cmake.org/cmake/help/latest/module/FindPython2.html#module:FindPython2\n core.exportVariable('Python2_ROOT_DIR', installDir);\n // https://cmake.org/cmake/help/latest/module/FindPython3.html#module:FindPython3\n core.exportVariable('Python3_ROOT_DIR', installDir);\n core.exportVariable('PKG_CONFIG_PATH', pythonLocation + '/lib/pkgconfig');\n core.addPath(pythonLocation);\n core.addPath(_binDir);\n }\n core.setOutput('python-version', 'pypy' + resolvedPyPyVersion);\n core.setOutput('python-path', pythonPath);\n\n return {resolvedPyPyVersion, resolvedPythonVersion};\n}\n\nexport function findPyPyToolCache(\n pythonVersion: string,\n pypyVersion: string,\n architecture: string\n) {\n let resolvedPyPyVersion = '';\n let resolvedPythonVersion = '';\n let installDir: string | null = IS_WINDOWS\n ? findPyPyInstallDirForWindows(pythonVersion)\n : tc.find('PyPy', pythonVersion, architecture);\n\n if (installDir) {\n // 'tc.find' finds tool based on Python version but we also need to check\n // whether PyPy version satisfies requested version.\n resolvedPythonVersion = getPyPyVersionFromPath(installDir);\n resolvedPyPyVersion = readExactPyPyVersionFile(installDir);\n\n const isPyPyVersionSatisfies = semver.satisfies(\n resolvedPyPyVersion,\n pypyVersion\n );\n if (!isPyPyVersionSatisfies) {\n installDir = null;\n resolvedPyPyVersion = '';\n resolvedPythonVersion = '';\n }\n }\n\n if (!installDir) {\n core.info(\n `PyPy version ${pythonVersion} (${pypyVersion}) was not found in the local cache`\n );\n }\n\n return {installDir, resolvedPythonVersion, resolvedPyPyVersion};\n}\n\nexport function parsePyPyVersion(versionSpec: string): IPyPyVersionSpec {\n const versions = versionSpec.split('-').filter(item => !!item);\n\n if (/^(pypy)(.+)/.test(versions[0])) {\n const pythonVersion = versions[0].replace('pypy', '');\n versions.splice(0, 1, 'pypy', pythonVersion);\n }\n\n if (versions.length < 2 || versions[0] != 'pypy') {\n throw new Error(\n \"Invalid 'version' property for PyPy. PyPy version should be specified as 'pypy' or 'pypy-'. See README for examples and documentation.\"\n );\n }\n\n const pythonVersion = versions[1];\n let pypyVersion: string;\n if (versions.length > 2) {\n pypyVersion = pypyInstall.pypyVersionToSemantic(versions[2]);\n } else {\n pypyVersion = 'x';\n }\n\n if (!validateVersion(pythonVersion) || !validateVersion(pypyVersion)) {\n throw new Error(\n \"Invalid 'version' property for PyPy. Both Python version and PyPy versions should satisfy SemVer notation. See README for examples and documentation.\"\n );\n }\n\n if (!validatePythonVersionFormatForPyPy(pythonVersion)) {\n throw new Error(\n \"Invalid format of Python version for PyPy. Python version should be specified in format 'x.y'. See README for examples and documentation.\"\n );\n }\n\n return {\n pypyVersion: pypyVersion,\n pythonVersion: pythonVersion\n };\n}\n\nexport function findPyPyInstallDirForWindows(pythonVersion: string): string {\n let installDir = '';\n\n WINDOWS_ARCHS.forEach(\n architecture =>\n (installDir = installDir || tc.find('PyPy', pythonVersion, architecture))\n );\n\n return installDir;\n}\n","import * as path from 'path';\nimport * as core from '@actions/core';\nimport * as tc from '@actions/tool-cache';\nimport * as exec from '@actions/exec';\nimport * as httpm from '@actions/http-client';\nimport {ExecOptions} from '@actions/exec/lib/interfaces';\nimport {IS_WINDOWS, IS_LINUX, getDownloadFileName} from './utils';\n\nconst TOKEN = core.getInput('token');\nconst AUTH = !TOKEN ? undefined : `token ${TOKEN}`;\nconst MANIFEST_REPO_OWNER = 'actions';\nconst MANIFEST_REPO_NAME = 'python-versions';\nconst MANIFEST_REPO_BRANCH = 'main';\nexport const MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/${MANIFEST_REPO_BRANCH}/versions-manifest.json`;\n\nexport async function findReleaseFromManifest(\n semanticVersionSpec: string,\n architecture: string,\n manifest: tc.IToolRelease[] | null\n): Promise {\n if (!manifest) {\n manifest = await getManifest();\n }\n\n const foundRelease = await tc.findFromManifest(\n semanticVersionSpec,\n false,\n manifest,\n architecture\n );\n\n return foundRelease;\n}\n\nexport async function getManifest(): Promise {\n try {\n return await getManifestFromRepo();\n } catch (err) {\n core.debug('Fetching the manifest via the API failed.');\n if (err instanceof Error) {\n core.debug(err.message);\n }\n }\n return await getManifestFromURL();\n}\n\nexport function getManifestFromRepo(): Promise {\n core.debug(\n `Getting manifest from ${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}@${MANIFEST_REPO_BRANCH}`\n );\n return tc.getManifestFromRepo(\n MANIFEST_REPO_OWNER,\n MANIFEST_REPO_NAME,\n AUTH,\n MANIFEST_REPO_BRANCH\n );\n}\n\nexport async function getManifestFromURL(): Promise {\n core.debug('Falling back to fetching the manifest using raw URL.');\n\n const http: httpm.HttpClient = new httpm.HttpClient('tool-cache');\n const response = await http.getJson(MANIFEST_URL);\n if (!response.result) {\n throw new Error(`Unable to get manifest from ${MANIFEST_URL}`);\n }\n return response.result;\n}\n\nasync function installPython(workingDirectory: string) {\n const options: ExecOptions = {\n cwd: workingDirectory,\n env: {\n ...process.env,\n ...(IS_LINUX && {LD_LIBRARY_PATH: path.join(workingDirectory, 'lib')})\n },\n silent: true,\n listeners: {\n stdout: (data: Buffer) => {\n core.info(data.toString().trim());\n },\n stderr: (data: Buffer) => {\n core.error(data.toString().trim());\n }\n }\n };\n\n if (IS_WINDOWS) {\n await exec.exec('powershell', ['./setup.ps1'], options);\n } else {\n await exec.exec('bash', ['./setup.sh'], options);\n }\n}\n\nexport async function installCpythonFromRelease(release: tc.IToolRelease) {\n const downloadUrl = release.files[0].download_url;\n\n core.info(`Download from \"${downloadUrl}\"`);\n let pythonPath = '';\n try {\n const fileName = getDownloadFileName(downloadUrl);\n pythonPath = await tc.downloadTool(downloadUrl, fileName, AUTH);\n core.info('Extract downloaded archive');\n let pythonExtractedFolder;\n if (IS_WINDOWS) {\n pythonExtractedFolder = await tc.extractZip(pythonPath);\n } else {\n pythonExtractedFolder = await tc.extractTar(pythonPath);\n }\n\n core.info('Execute installation script');\n await installPython(pythonExtractedFolder);\n } catch (err) {\n if (err instanceof tc.HTTPError) {\n // Rate limit?\n if (err.httpStatusCode === 403 || err.httpStatusCode === 429) {\n core.info(\n `Received HTTP status code ${err.httpStatusCode}. This usually indicates the rate limit has been exceeded`\n );\n } else {\n core.info(err.message);\n }\n if (err.stack) {\n core.debug(err.stack);\n }\n }\n throw err;\n }\n}\n","import * as os from 'os';\nimport * as path from 'path';\nimport {IS_WINDOWS, IS_LINUX, getOSInfo} from './utils';\n\nimport * as semver from 'semver';\n\nimport * as installer from './install-python';\n\nimport * as core from '@actions/core';\nimport * as tc from '@actions/tool-cache';\n\n// Python has \"scripts\" or \"bin\" directories where command-line tools that come with packages are installed.\n// This is where pip is, along with anything that pip installs.\n// There is a separate directory for `pip install --user`.\n//\n// For reference, these directories are as follows:\n// macOS / Linux:\n// /bin (by default /usr/local/bin, but not on hosted agents -- see the `else`)\n// (--user) ~/.local/bin\n// Windows:\n// \\Scripts\n// (--user) %APPDATA%\\Python\\PythonXY\\Scripts\n// See https://docs.python.org/3/library/sysconfig.html\n\nfunction binDir(installDir: string): string {\n if (IS_WINDOWS) {\n return path.join(installDir, 'Scripts');\n } else {\n return path.join(installDir, 'bin');\n }\n}\n\nexport async function useCpythonVersion(\n version: string,\n architecture: string,\n updateEnvironment: boolean,\n checkLatest: boolean,\n allowPreReleases: boolean\n): Promise {\n let manifest: tc.IToolRelease[] | null = null;\n const desugaredVersionSpec = desugarDevVersion(version);\n let semanticVersionSpec = pythonVersionToSemantic(\n desugaredVersionSpec,\n allowPreReleases\n );\n core.debug(`Semantic version spec of ${version} is ${semanticVersionSpec}`);\n\n if (checkLatest) {\n manifest = await installer.getManifest();\n const resolvedVersion = (\n await installer.findReleaseFromManifest(\n semanticVersionSpec,\n architecture,\n manifest\n )\n )?.version;\n\n if (resolvedVersion) {\n semanticVersionSpec = resolvedVersion;\n core.info(`Resolved as '${semanticVersionSpec}'`);\n } else {\n core.info(\n `Failed to resolve version ${semanticVersionSpec} from manifest`\n );\n }\n }\n\n let installDir: string | null = tc.find(\n 'Python',\n semanticVersionSpec,\n architecture\n );\n if (!installDir) {\n core.info(\n `Version ${semanticVersionSpec} was not found in the local cache`\n );\n const foundRelease = await installer.findReleaseFromManifest(\n semanticVersionSpec,\n architecture,\n manifest\n );\n\n if (foundRelease && foundRelease.files && foundRelease.files.length > 0) {\n core.info(`Version ${semanticVersionSpec} is available for downloading`);\n await installer.installCpythonFromRelease(foundRelease);\n\n installDir = tc.find('Python', semanticVersionSpec, architecture);\n }\n }\n\n if (!installDir) {\n const osInfo = await getOSInfo();\n throw new Error(\n [\n `The version '${version}' with architecture '${architecture}' was not found for ${\n osInfo\n ? `${osInfo.osName} ${osInfo.osVersion}`\n : 'this operating system'\n }.`,\n `The list of all available versions can be found here: ${installer.MANIFEST_URL}`\n ].join(os.EOL)\n );\n }\n\n const _binDir = binDir(installDir);\n const binaryExtension = IS_WINDOWS ? '.exe' : '';\n const pythonPath = path.join(\n IS_WINDOWS ? installDir : _binDir,\n `python${binaryExtension}`\n );\n if (updateEnvironment) {\n core.exportVariable('pythonLocation', installDir);\n core.exportVariable('PKG_CONFIG_PATH', installDir + '/lib/pkgconfig');\n core.exportVariable('pythonLocation', installDir);\n // https://cmake.org/cmake/help/latest/module/FindPython.html#module:FindPython\n core.exportVariable('Python_ROOT_DIR', installDir);\n // https://cmake.org/cmake/help/latest/module/FindPython2.html#module:FindPython2\n core.exportVariable('Python2_ROOT_DIR', installDir);\n // https://cmake.org/cmake/help/latest/module/FindPython3.html#module:FindPython3\n core.exportVariable('Python3_ROOT_DIR', installDir);\n core.exportVariable('PKG_CONFIG_PATH', installDir + '/lib/pkgconfig');\n\n if (IS_LINUX) {\n const libPath = process.env.LD_LIBRARY_PATH\n ? `:${process.env.LD_LIBRARY_PATH}`\n : '';\n const pyLibPath = path.join(installDir, 'lib');\n\n if (!libPath.split(':').includes(pyLibPath)) {\n core.exportVariable('LD_LIBRARY_PATH', pyLibPath + libPath);\n }\n }\n core.addPath(installDir);\n core.addPath(_binDir);\n\n if (IS_WINDOWS) {\n // Add --user directory\n // `installDir` from tool cache should look like $RUNNER_TOOL_CACHE/Python//x64/\n // So if `findLocalTool` succeeded above, we must have a conformant `installDir`\n const version = path.basename(path.dirname(installDir));\n const major = semver.major(version);\n const minor = semver.minor(version);\n\n const userScriptsDir = path.join(\n process.env['APPDATA'] || '',\n 'Python',\n `Python${major}${minor}`,\n 'Scripts'\n );\n core.addPath(userScriptsDir);\n }\n // On Linux and macOS, pip will create the --user directory and add it to PATH as needed.\n }\n\n const installed = versionFromPath(installDir);\n core.setOutput('python-version', installed);\n core.setOutput('python-path', pythonPath);\n\n return {impl: 'CPython', version: installed};\n}\n\n/** Convert versions like `3.8-dev` to a version like `~3.8.0-0`. */\nfunction desugarDevVersion(versionSpec: string) {\n const devVersion = /^(\\d+)\\.(\\d+)-dev$/;\n return versionSpec.replace(devVersion, '~$1.$2.0-0');\n}\n\n/** Extracts python version from install path from hosted tool cache as described in README.md */\nfunction versionFromPath(installDir: string) {\n const parts = installDir.split(path.sep);\n const idx = parts.findIndex(part => part === 'PyPy' || part === 'Python');\n\n return parts[idx + 1] || '';\n}\n\ninterface InstalledVersion {\n impl: string;\n version: string;\n}\n\n/**\n * Python's prelease versions look like `3.7.0b2`.\n * This is the one part of Python versioning that does not look like semantic versioning, which specifies `3.7.0-b2`.\n * If the version spec contains prerelease versions, we need to convert them to the semantic version equivalent.\n *\n * For easier use of the action, we also map 'x.y' to allow pre-release before 'x.y.0' release if allowPreReleases is true\n */\nexport function pythonVersionToSemantic(\n versionSpec: string,\n allowPreReleases: boolean\n) {\n const prereleaseVersion = /(\\d+\\.\\d+\\.\\d+)((?:a|b|rc)\\d*)/g;\n const majorMinor = /^(\\d+)\\.(\\d+)$/;\n let result = versionSpec.replace(prereleaseVersion, '$1-$2');\n if (allowPreReleases) {\n result = result.replace(majorMinor, '~$1.$2.0-0');\n }\n return result;\n}\n","import path, { join } from \"path\"\nimport { fileURLToPath } from \"url\"\nimport { debug } from \"@actions/core\"\nimport { GITHUB_ACTIONS } from \"ci-info\"\nimport { info, warning } from \"ci-log\"\nimport { pathExists } from \"path-exists\"\nimport { findPyPyVersion } from \"setup-python/src/find-pypy.js\"\nimport { useCpythonVersion } from \"setup-python/src/find-python.js\"\nimport { IS_MAC } from \"setup-python/src/utils.js\"\n\nconst dirname = typeof __dirname === \"string\" ? __dirname : path.dirname(fileURLToPath(import.meta.url))\n\nfunction isPyPyVersion(versionSpec: string) {\n return versionSpec.startsWith(\"pypy\")\n}\n\nconst checkLatest = false\n\nexport async function setupActionsPython(version: string, _setupDir: string, arch: string) {\n if (IS_MAC) {\n process.env.AGENT_TOOLSDIRECTORY = \"/Users/runner/hostedtoolcache\"\n }\n\n const agent_toolsdirectory = process.env.AGENT_TOOLSDIRECTORY?.trim()\n if (typeof agent_toolsdirectory === \"string\" && agent_toolsdirectory !== \"\") {\n process.env.RUNNER_TOOL_CACHE = process.env.AGENT_TOOLSDIRECTORY\n }\n\n debug(`Python is expected to be installed into ${process.env.RUNNER_TOOL_CACHE}`)\n\n if (version) {\n let pythonVersion: string\n if (isPyPyVersion(version)) {\n const installed = await findPyPyVersion(version, arch, true, checkLatest, false)\n pythonVersion = `${installed.resolvedPyPyVersion}-${installed.resolvedPythonVersion}`\n info(`Successfully set up PyPy ${installed.resolvedPyPyVersion} with Python (${installed.resolvedPythonVersion})`)\n } else {\n const installed = await useCpythonVersion(version, arch, true, checkLatest, false)\n pythonVersion = installed.version\n info(`Successfully set up ${installed.impl} (${pythonVersion})`)\n }\n\n // const cache = false\n // if (cache) {\n // const { cacheDependencies } = await import(\"setup-python/src/cache-dependencies\")\n // await cacheDependencies(\"pip\", pythonVersion)\n // }\n }\n\n if (GITHUB_ACTIONS) {\n await addPythonLoggingMatcher()\n }\n\n return undefined\n}\n\nasync function addPythonLoggingMatcher() {\n const matcherPath = join(dirname, \"python_matcher.json\")\n if (!(await pathExists(matcherPath))) {\n return warning(\"the python_matcher.json file does not exist in the same folder as setup-cpp.js\")\n }\n info(`::add-matcher::${matcherPath}`)\n}\n","'use strict'\nconst ParserEND = 0x110000\nclass ParserError extends Error {\n /* istanbul ignore next */\n constructor (msg, filename, linenumber) {\n super('[ParserError] ' + msg, filename, linenumber)\n this.name = 'ParserError'\n this.code = 'ParserError'\n if (Error.captureStackTrace) Error.captureStackTrace(this, ParserError)\n }\n}\nclass State {\n constructor (parser) {\n this.parser = parser\n this.buf = ''\n this.returned = null\n this.result = null\n this.resultTable = null\n this.resultArr = null\n }\n}\nclass Parser {\n constructor () {\n this.pos = 0\n this.col = 0\n this.line = 0\n this.obj = {}\n this.ctx = this.obj\n this.stack = []\n this._buf = ''\n this.char = null\n this.ii = 0\n this.state = new State(this.parseStart)\n }\n\n parse (str) {\n /* istanbul ignore next */\n if (str.length === 0 || str.length == null) return\n\n this._buf = String(str)\n this.ii = -1\n this.char = -1\n let getNext\n while (getNext === false || this.nextChar()) {\n getNext = this.runOne()\n }\n this._buf = null\n }\n nextChar () {\n if (this.char === 0x0A) {\n ++this.line\n this.col = -1\n }\n ++this.ii\n this.char = this._buf.codePointAt(this.ii)\n ++this.pos\n ++this.col\n return this.haveBuffer()\n }\n haveBuffer () {\n return this.ii < this._buf.length\n }\n runOne () {\n return this.state.parser.call(this, this.state.returned)\n }\n finish () {\n this.char = ParserEND\n let last\n do {\n last = this.state.parser\n this.runOne()\n } while (this.state.parser !== last)\n\n this.ctx = null\n this.state = null\n this._buf = null\n\n return this.obj\n }\n next (fn) {\n /* istanbul ignore next */\n if (typeof fn !== 'function') throw new ParserError('Tried to set state to non-existent state: ' + JSON.stringify(fn))\n this.state.parser = fn\n }\n goto (fn) {\n this.next(fn)\n return this.runOne()\n }\n call (fn, returnWith) {\n if (returnWith) this.next(returnWith)\n this.stack.push(this.state)\n this.state = new State(fn)\n }\n callNow (fn, returnWith) {\n this.call(fn, returnWith)\n return this.runOne()\n }\n return (value) {\n /* istanbul ignore next */\n if (this.stack.length === 0) throw this.error(new ParserError('Stack underflow'))\n if (value === undefined) value = this.state.buf\n this.state = this.stack.pop()\n this.state.returned = value\n }\n returnNow (value) {\n this.return(value)\n return this.runOne()\n }\n consume () {\n /* istanbul ignore next */\n if (this.char === ParserEND) throw this.error(new ParserError('Unexpected end-of-buffer'))\n this.state.buf += this._buf[this.ii]\n }\n error (err) {\n err.line = this.line\n err.col = this.col\n err.pos = this.pos\n return err\n }\n /* istanbul ignore next */\n parseStart () {\n throw new ParserError('Must declare a parseStart method')\n }\n}\nParser.END = ParserEND\nParser.Error = ParserError\nmodule.exports = Parser\n","'use strict'\nmodule.exports = value => {\n const date = new Date(value)\n /* istanbul ignore if */\n if (isNaN(date)) {\n throw new TypeError('Invalid Datetime')\n } else {\n return date\n }\n}\n","'use strict'\nmodule.exports = (d, num) => {\n num = String(num)\n while (num.length < d) num = '0' + num\n return num\n}\n","'use strict'\nconst f = require('./format-num.js')\n\nclass FloatingDateTime extends Date {\n constructor (value) {\n super(value + 'Z')\n this.isFloating = true\n }\n toISOString () {\n const date = `${this.getUTCFullYear()}-${f(2, this.getUTCMonth() + 1)}-${f(2, this.getUTCDate())}`\n const time = `${f(2, this.getUTCHours())}:${f(2, this.getUTCMinutes())}:${f(2, this.getUTCSeconds())}.${f(3, this.getUTCMilliseconds())}`\n return `${date}T${time}`\n }\n}\n\nmodule.exports = value => {\n const date = new FloatingDateTime(value)\n /* istanbul ignore if */\n if (isNaN(date)) {\n throw new TypeError('Invalid Datetime')\n } else {\n return date\n }\n}\n","'use strict'\nconst f = require('./format-num.js')\nconst DateTime = global.Date\n\nclass Date extends DateTime {\n constructor (value) {\n super(value)\n this.isDate = true\n }\n toISOString () {\n return `${this.getUTCFullYear()}-${f(2, this.getUTCMonth() + 1)}-${f(2, this.getUTCDate())}`\n }\n}\n\nmodule.exports = value => {\n const date = new Date(value)\n /* istanbul ignore if */\n if (isNaN(date)) {\n throw new TypeError('Invalid Datetime')\n } else {\n return date\n }\n}\n","'use strict'\nconst f = require('./format-num.js')\n\nclass Time extends Date {\n constructor (value) {\n super(`0000-01-01T${value}Z`)\n this.isTime = true\n }\n toISOString () {\n return `${f(2, this.getUTCHours())}:${f(2, this.getUTCMinutes())}:${f(2, this.getUTCSeconds())}.${f(3, this.getUTCMilliseconds())}`\n }\n}\n\nmodule.exports = value => {\n const date = new Time(value)\n /* istanbul ignore if */\n if (isNaN(date)) {\n throw new TypeError('Invalid Datetime')\n } else {\n return date\n }\n}\n","'use strict'\nmodule.exports = require('./parse-string.js')\nmodule.exports.async = require('./parse-async.js')\nmodule.exports.stream = require('./parse-stream.js')\nmodule.exports.prettyError = require('./parse-pretty-error.js')\n"],"names":["isDigit","cp","CHAR_0","CHAR_9","isHexit","CHAR_A","CHAR_F","CHAR_a","CHAR_f","isBit","CHAR_1","isOctit","CHAR_7","isAlphaNumQuoteHyphen","CHAR_Z","CHAR_z","CHAR_APOS","CHAR_QUOT","CHAR_LOWBAR","CHAR_HYPHEN","isAlphaNumHyphen","hasKey","obj","key","hasOwnProperty","call","descriptor","InlineTable","Object","defineProperties","_type","value","INLINE_TABLE","isInlineTable","Table","TABLE","_declared","writable","isTable","InlineList","type","INLINE_LIST","_contentType","isInlineList","List","LIST","isList","Integer","num","Number","is","global","BigInt","isSafeInteger","BoxedBigInt","isNaN","this","INTEGER","_inspect","isInteger","Float","FLOAT","isFloat","tomlType","Date","makeParserClass","Parser","TOMLParser","constructor","ctx","atEndOfWord","char","CHAR_NUM","CTRL_I","CHAR_SP","atEndOfLine","END","CTRL_J","CTRL_M","parseStart","CHAR_LSQB","parseTableOrList","parseComment","callNow","parseAssignStatement","error","TomlError","parseWhitespaceToEOL","goto","return","parseAssign","recordAssignStatement","kv","target","finalKey","pop","kw","valueOf","parseKeyword","recordAssignKeyword","state","resultTable","push","parseAssignKeywordPreDot","CHAR_PERIOD","next","parseAssignKeywordPostDot","parseAssignEqual","CHAR_EQUALS","parseAssignPreValue","parseValue","recordAssignValue","returnNow","CHAR_DEL","CTRL_CHAR_BOUNDARY","errorControlCharIn","nextChar","parseTable","parseList","parseTableNext","parseTableMore","keyword","CHAR_RSQB","length","parseListNext","parseListMore","parseListEnd","parseDoubleString","parseSingleString","CHAR_PLUS","parseNumberSign","CHAR_i","parseInf","CHAR_n","parseNan","parseNumberOrDateTime","CHAR_t","parseBoolean","parseInlineList","recordValue","CHAR_LCUB","parseInlineTable","parseInf2","buf","Infinity","parseNan2","NaN","parseBasicString","parseLiteralString","parseBareKey","consume","parseLiteralMultiStringMaybe","parseLiteralMultiString","parseLiteralMultiStringContent","parseLiteralMultiEnd","parseLiteralMultiEnd2","parseLiteralMultiEnd3","parseLiteralMultiEnd4","parseMultiStringMaybe","CHAR_BSOL","parseEscape","recordEscapeReplacement","replacement","parseMultiString","parseMultiStringContent","parseMultiEscape","recordMultiEscapeReplacement","parseMultiEnd","displayCode","toString","parseMultiEnd2","parseMultiEnd3","parseMultiEnd4","parseMultiTrim","parsePreMultiTrim","escapes","CHAR_u","parseSmallUnicode","parseUnicodeReturn","CHAR_U","parseLargeUnicode","codePoint","parseInt","SURROGATE_FIRST","SURROGATE_LAST","String","fromCodePoint","err","wrap","parseMaybeSignedInfOrNan","parseNoUnder","parseNumberIntegerStart","parseNumberIntegerExponentOrDecimal","parseNumberInteger","parseNumberFloat","CHAR_E","CHAR_e","parseNumberExponentSign","result","parseNoUnderHexOctBinLiteral","parseNumberExponent","parseNumberBaseOrDateTime","parseNumberOrDateTimeOnly","parseDateTime","CHAR_COLON","parseOnlyTimeHour","parseDateTimeOnly","CHAR_b","parseIntegerBin","CHAR_o","parseIntegerOct","CHAR_x","parseIntegerHex","parseDateMonth","parseDateDay","CHAR_T","parseStartTimeHour","createDate","parseTimeHour","parseTimeMin","parseTimeSec","parseTimeZoneOrFraction","parseOnlyTimeMin","parseOnlyTimeSec","parseOnlyTimeFractionMaybe","createTime","parseOnlyTimeFraction","parseDateTimeFraction","createDateTime","createDateTimeFloat","parseTimeZoneHour","test","parseTimeZoneSep","parseTimeZoneMin","parseTrue_r","parseFalse_a","CHAR_r","parseTrue_u","parseTrue_e","parseFalse_l","CHAR_l","parseFalse_s","CHAR_s","parseFalse_e","resultArr","recordInlineListValue","parseInlineListNext","CHAR_COMMA","CHAR_RCUB","recordInlineTableValue","parseInlineTableNext","parseInlineTablePostComma","prettyError","pos","line","msg","message","col","split","lines","lineNumWidth","Math","min","linePadding","ii","max","lineNum","hh","parseString","str","Buffer","isBuffer","parser","parse","finish","parseAsync","opts","parseAsyncNext","index","blocksize","resolve","reject","slice","setImmediate","Promise","parseStream","stm","parseReadable","parseTransform","setEncoding","ended","readable","errored","once","readNext","data","read","stream","Transform","objectMode","transform","chunk","encoding","cb","emit","flush","stringify","typeError","toJSON","stringifyObject","Error","getInlineKeys","keys","filter","isInline","getComplexKeys","nobj","Array","isArray","prototype","undefined","prop","prefix","indent","inlineKeys","complexKeys","inlineIndent","forEach","stringifyKey","stringifyAnyInline","complexIndent","stringifyComplex","join","keyStr","stringifyBasicString","escapeString","replace","stringifyLiteralString","numpad","c","codePointAt","stringifyMultilineString","escaped","map","multilineOk","stringifyInline","stringifyInteger","stringifyFloat","stringifyBoolean","stringifyDatetime","stringifyInlineArray","_","stringifyInlineTable","int","dec","toISOString","values","stringified","valueType","stringifyArrayOfTables","stringifyComplexTable","firstValueType","fullKey","table","createSymlinkInFolder","folderPath","sourceName","targetName","setExecutable","sourcePath","path","targetPath","fs","existsSync","symlinkSync","IS_WINDOWS","chmodSync","validateVersion","version","isNightlyKeyword","semver.validRange","semver","validRange","pypyVersion","getPyPyVersionFromPath","installDir","basename","dirname","readExactPyPyVersionFile","fileVersion","PYPY_VERSION_FILE","readFileSync","trim","writeExactPyPyVersionFile","resolvedPyPyVersion","pypyFilePath","writeFileSync","validatePythonVersionFormatForPyPy","async","getWindowsInfo","stdout","exec.getExecOutput","getExecOutput_1","silent","osName","osVersion","getMacOSInfo","getLinuxInfo","core.debug","coreExports","debug","getOSInfo","osInfo","IS_LINUX","IS_MAC","getBinaryDirectory","getDownloadFileName","downloadUrl","tempDir","process","env","RUNNER_TEMP","installPyPy","pythonVersion","architecture","allowPreReleases","releases","downloadDir","getAvailablePyPyVersions","releaseData","findRelease","foundAsset","resolvedPythonVersion","download_url","core.info","fileName","pypyPath","tc.downloadTool","tc.extractZip","tc.extractTar","archiveName","readdirSync","toolDir","tc.cacheDir","cacheDir_1","binaryPath","createPyPySymlink","installPip","info","tc.HTTPError","HTTPError_1","httpStatusCode","stack","url","http","httpm.HttpClient","response","getJson","pypyBinaryPath","semver.coerce","pythonBinaryPostfix","semver.major","pypyBinaryPostfix","pypyMajorMinorBinaryPostfix","semver.minor","binaryExtension","pythonLocation","pythonBinary","exec.exec","exec_2","includePrerelease","options","filterReleases","item","isPythonVersionSatisfied","semver.satisfies","satisfies","coerce","python_version","isPyPyVersionSatisfied","pypy_version","pypyVersionToSemantic","isArchPresent","files","isArchPresentForWindows","isArchPresentForMacOrLinux","platform","foundRelease","sort","previous","current","semver.compare","compare","findAssetForWindows","findAssetForMacOrLinux","versionSpec","replaceX32toX86","some","file","WINDOWS_PLATFORMS","includes","arch","find","findPyPyVersion","updateEnvironment","checkLatest","pypyVersionSpec","parsePyPyVersion","findPyPyToolCache","pypyInstall.installPyPy","_binDir","pythonPath","core.exportVariable","core.setOutput","findPyPyInstallDirForWindows","tc.find","versions","splice","pypyInstall.pypyVersionToSemantic","WINDOWS_ARCHS","find_1","findReleaseFromManifest","semanticVersionSpec","manifest","getManifest","tc.findFromManifest","findFromManifest_1","getManifestFromRepo","getManifestFromURL","MANIFEST_REPO_OWNER","MANIFEST_REPO_NAME","MANIFEST_REPO_BRANCH","tc.getManifestFromRepo","getManifestFromRepo_1","AUTH","MANIFEST_URL","installPython","workingDirectory","cwd","LD_LIBRARY_PATH","listeners","stderr","core.error","installCpythonFromRelease","release","pythonExtractedFolder","downloadTool_1","binDir","useCpythonVersion","pythonVersionToSemantic","desugarDevVersion","installer.findReleaseFromManifest","installer.installCpythonFromRelease","installer.MANIFEST_URL","os","EOL","libPath","pyLibPath","major","minor","userScriptsDir","installed","versionFromPath","impl","parts","sep","idx","findIndex","part","isPyPyVersion","startsWith","setupActionsPython","_setupDir","AGENT_TOOLSDIRECTORY","agent_toolsdirectory","_a","RUNNER_TOOL_CACHE","GITHUB_ACTIONS","addPythonLoggingMatcher","matcherPath","pathExists","warning","ParserEND","ParserError","filename","linenumber","super","name","code","captureStackTrace","State","returned","_buf","getNext","runOne","haveBuffer","last","fn","JSON","returnWith","module","date","TypeError","d","f","require","FloatingDateTime","isFloating","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","DateTime","commonjsGlobal","isDate","Time","isTime","tomlParserModule","exports","fromTOML","wrapped","terr","Symbol","defineProperty","configurable","enumerable","_custom","utilInspect","eval","custom","asIntN","parseModule","stringifyModule","TOKEN","core.getInput","__dirname","fileURLToPath","document","pathToFileURL","__filename","href","_documentCurrentScript","src","URL","baseURI"],"mappings":"+SAsFA,SAASA,QAASC,GACTA,OAAAA,GAAMC,QAAgBC,QAANF,CACzB,CACA,SAASG,QAASH,GACRA,OAAAA,GAAMI,QAAgBC,QAANL,GAAkBA,GAAMM,QAAgBC,QAANP,GAAkBA,GAAMC,QAAgBC,QAANF,CAC9F,CACA,SAASQ,MAAOR,GACPA,OAAAA,IAAOS,QAAUT,IAAOC,MACjC,CACA,SAASS,QAASV,GACRA,OAAAA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QAAQmE,SACnBxE,OAA8B,WAArBK,QAAQmE,SACjBiC,cAAgB,CAAC,MAAO,OACxBpB,kBAAoB,CAAC,QAAS,SACrC7G,kBAAoB,eGRpBsP,MAAQC,SAAAA,YAAAA,SAAc,SACtBvG,KAAQsG,MAAoB,SAASA,WAArB,EAChB3G,oBAAsB,UACtBC,mBAAqB,kBACrBC,qBAAuB,OAChBI,aAAe,qCAAqCN,uBAAuBC,sBAAsBC,8CEHxGhJ,QAA+B,iBAAd2P,UAAyBA,UAAY5Q,KAAKiB,QAAQ4P,WAAAA,cAA6B,oBAAAC,SAAAnC,QAAA,OAAAoC,cAAAC,YAAAC,KAAAC,wBAAAA,uBAAAC,KAAA,IAAAC,IAAA,oCAAAN,SAAAO,SAAAJ,OAMhG1I,aAAc","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,12,13,14,15,16,17,18]} \ No newline at end of file diff --git a/dist/legacy/setup-cpp.js b/dist/legacy/setup-cpp.js index cfe2f309..072b24fd 100644 --- a/dist/legacy/setup-cpp.js +++ b/dist/legacy/setup-cpp.js @@ -1,3 +1,3 @@ #!/usr/bin/env node -"use strict";function e(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}function t(e){return e&&e.__esModule&&{}.hasOwnProperty.call(e,"default")?e.default:e}function r(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}function n(e,t,r){const n=new Qn(e,t,r);process.stdout.write(""+n+Yn.EOL)}function o(){return to>eo.length-16&&(vn.randomFillSync(eo),to=0),eo.slice(to,to+=16)}function i(e){return"string"==typeof e&&ro.test(e)}function s(e,t=0){const r=(no[e[t+0]]+no[e[t+1]]+no[e[t+2]]+no[e[t+3]]+"-"+no[e[t+4]]+no[e[t+5]]+"-"+no[e[t+6]]+no[e[t+7]]+"-"+no[e[t+8]]+no[e[t+9]]+"-"+no[e[t+10]]+no[e[t+11]]+no[e[t+12]]+no[e[t+13]]+no[e[t+14]]+no[e[t+15]]).toLowerCase();if(!i(r))throw TypeError("Stringified UUID is invalid");return r}function a(e){if(!i(e))throw TypeError("Invalid UUID");let t;const r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r}function c(e,t,r){function n(e,n,o,i){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let r=0;e.length>r;++r)t.push(e.charCodeAt(r));return t}(e)),"string"==typeof n&&(n=a(n)),16!==n.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let c=new Uint8Array(16+e.length);if(c.set(n),c.set(e,n.length),c=r(c),c[6]=15&c[6]|t,c[8]=63&c[8]|128,o){i=i||0;for(let e=0;16>e;++e)o[i+e]=c[e];return o}return s(c)}try{n.name=e}catch(o){}return n.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",n}function l(e){const t="https:"===e.protocol;if(function(e){if(!e.hostname)return!1;if(function(e){const t=e.toLowerCase();return"localhost"===t||t.startsWith("127.")||t.startsWith("[::1]")||t.startsWith("[0:0:0:0:0:0:0:1]")}(e.hostname))return!0;const t=process.env.no_proxy||process.env.NO_PROXY||"";if(!t)return!1;let r;e.port?r=Number(e.port):"http:"===e.protocol?r=80:"https:"===e.protocol&&(r=443);const n=[e.hostname.toUpperCase()];"number"==typeof r&&n.push(`${n[0]}:${r}`);for(const o of t.split(",").map((e=>e.trim().toUpperCase())).filter((e=>e)))if("*"===o||n.some((e=>e===o||e.endsWith("."+o)||o.startsWith(".")&&e.endsWith(""+o))))return!0;return!1}(e))return;const r=t?process.env.https_proxy||process.env.HTTPS_PROXY:process.env.http_proxy||process.env.HTTP_PROXY;if(r)try{return new Eo(r)}catch{if(!r.startsWith("http://")&&!r.startsWith("https://"))return new Eo("http://"+r)}}function u(e){var t=this;t.options=e||{},t.proxyOptions=t.options.proxy||{},t.maxSockets=t.options.maxSockets||To.Agent.defaultMaxSockets,t.requests=[],t.sockets=[],t.on("free",(function(e,r,n,o){for(var i=p(r,n,o),s=0,a=t.requests.length;a>s;++s){var c=t.requests[s];if(c.host===i.host&&c.port===i.port)return t.requests.splice(s,1),void c.request.onSocket(e)}e.destroy(),t.removeSocket(e)}))}function d(e,t){var r=this;u.prototype.createSocket.call(r,e,(function(n){var o=e.request.getHeader("host"),i=f({},r.options,{socket:n,servername:o?o.replace(/:.*$/,""):e.host}),s=Oo.connect(0,i);r.sockets[r.sockets.indexOf(n)]=s,t(s)}))}function p(e,t,r){return"string"==typeof e?{host:e,port:t,localAddress:r}:e}function f(e){for(var t=1,r=arguments.length;r>t;++t){var n=arguments[t];if("object"==typeof n)for(var o=Object.keys(n),i=0,s=o.length;s>i;++i){var a=o[i];void 0!==n[a]&&(e[a]=n[a])}}return e}function h(){return zo||(zo=1,function(e){var t=Bn&&Bn.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(t){i(t)}}function a(e){try{c(n.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.summary=e.markdownSummary=e.SUMMARY_DOCS_URL=e.SUMMARY_ENV_VAR=void 0;const r=yn,n=gn,{access:o,appendFile:i,writeFile:s}=n.promises;e.SUMMARY_ENV_VAR="GITHUB_STEP_SUMMARY",e.SUMMARY_DOCS_URL="https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";const a=new class{constructor(){this._buffer=""}filePath(){return t(this,void 0,void 0,(function*(){if(this._filePath)return this._filePath;const t=process.env[e.SUMMARY_ENV_VAR];if(!t)throw Error(`Unable to find environment variable for $${e.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);try{yield o(t,n.constants.R_OK|n.constants.W_OK)}catch(r){throw Error(`Unable to access summary file: '${t}'. Check if the file has correct read/write permissions.`)}return this._filePath=t,this._filePath}))}wrap(e,t,r={}){const n=Object.entries(r).map((([e,t])=>` ${e}="${t}"`)).join("");return t?`<${e}${n}>${t}`:`<${e}${n}>`}write(e){return t(this,void 0,void 0,(function*(){const t=!!(null==e?void 0:e.overwrite),r=yield this.filePath(),n=t?s:i;return yield n(r,this._buffer,{encoding:"utf8"}),this.emptyBuffer()}))}clear(){return t(this,void 0,void 0,(function*(){return this.emptyBuffer().write({overwrite:!0})}))}stringify(){return this._buffer}isEmptyBuffer(){return 0===this._buffer.length}emptyBuffer(){return this._buffer="",this}addRaw(e,t=!1){return this._buffer+=e,t?this.addEOL():this}addEOL(){return this.addRaw(r.EOL)}addCodeBlock(e,t){const r=Object.assign({},t&&{lang:t}),n=this.wrap("pre",this.wrap("code",e),r);return this.addRaw(n).addEOL()}addList(e,t=!1){const r=t?"ol":"ul",n=e.map((e=>this.wrap("li",e))).join(""),o=this.wrap(r,n);return this.addRaw(o).addEOL()}addTable(e){const t=e.map((e=>{const t=e.map((e=>{if("string"==typeof e)return this.wrap("td",e);const{header:t,data:r,colspan:n,rowspan:o}=e,i=t?"th":"td",s=Object.assign(Object.assign({},n&&{colspan:n}),o&&{rowspan:o});return this.wrap(i,r,s)})).join("");return this.wrap("tr",t)})).join(""),r=this.wrap("table",t);return this.addRaw(r).addEOL()}addDetails(e,t){const r=this.wrap("details",this.wrap("summary",e)+t);return this.addRaw(r).addEOL()}addImage(e,t,r){const{width:n,height:o}=r||{},i=Object.assign(Object.assign({},n&&{width:n}),o&&{height:o}),s=this.wrap("img",null,Object.assign({src:e,alt:t},i));return this.addRaw(s).addEOL()}addHeading(e,t){const r="h"+t,n=this.wrap(["h1","h2","h3","h4","h5","h6"].includes(r)?r:"h1",e);return this.addRaw(n).addEOL()}addSeparator(){const e=this.wrap("hr",null);return this.addRaw(e).addEOL()}addBreak(){const e=this.wrap("br",null);return this.addRaw(e).addEOL()}addQuote(e,t){const r=Object.assign({},t&&{cite:t}),n=this.wrap("blockquote",e,r);return this.addRaw(n).addEOL()}addLink(e,t){const r=this.wrap("a",e,{href:t});return this.addRaw(r).addEOL()}};e.markdownSummary=a,e.summary=a}(Ko)),Ko}function m(){return Xo||(Xo=1,function(e){function t(e,t){const r=process.env["INPUT_"+e.replace(/ /g,"_").toUpperCase()]||"";if(t&&t.required&&!r)throw Error("Input required and not supplied: "+e);return t&&!1===t.trimWhitespace?r:r.trim()}function r(e,t={}){l.issueCommand("error",d.toCommandProperties(t),e instanceof Error?""+e:e)}function n(e){l.issue("group",e)}function o(){l.issue("endgroup")}var i=Bn&&Bn.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=Bn&&Bn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=Bn&&Bn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return s(t,e),t},c=Bn&&Bn.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(t){i(t)}}function a(e){try{c(n.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.getIDToken=e.getState=e.saveState=e.group=e.endGroup=e.startGroup=e.info=e.notice=e.warning=e.error=e.debug=e.isDebug=e.setFailed=e.setCommandEcho=e.setOutput=e.getBooleanInput=e.getMultilineInput=e.getInput=e.addPath=e.setSecret=e.exportVariable=e.ExitCode=void 0;const l=Vn,u=Zn,d=zn,p=a(yn),f=a(wn),y=function(){if(Ho)return bo;Ho=1;var e=Bn&&Bn.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(t){i(t)}}function a(e){try{c(n.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(bo,"__esModule",{value:!0}),bo.OidcClient=void 0;const t=Go,n=qo,o=m();class i{static createHttpClient(e=!0,r=10){const o={allowRetries:e,maxRetries:r};return new t.HttpClient("actions/oidc-client",[new n.BearerCredentialHandler(i.getRequestToken())],o)}static getRequestToken(){const e=process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN;if(!e)throw Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable");return e}static getIDTokenUrl(){const e=process.env.ACTIONS_ID_TOKEN_REQUEST_URL;if(!e)throw Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable");return e}static getCall(t){var r;return e(this,void 0,void 0,(function*(){const e=i.createHttpClient(),n=yield e.getJson(t).catch((e=>{throw Error(`Failed to get ID Token. \n \n Error Code : ${e.statusCode}\n \n Error Message: ${e.message}`)})),o=null===(r=n.result)||void 0===r?void 0:r.value;if(!o)throw Error("Response json body do not have ID Token field");return o}))}static getIDToken(t){return e(this,void 0,void 0,(function*(){try{let e=i.getIDTokenUrl();t&&(e=`${e}&audience=${encodeURIComponent(t)}`),o.debug("ID token url is "+e);const r=yield i.getCall(e);return o.setSecret(r),r}catch(r){throw Error("Error message: "+r.message)}}))}}return bo.OidcClient=i,bo}();var g,v;(v=g=e.ExitCode||(e.ExitCode={}))[v.Success=0]="Success",v[v.Failure=1]="Failure",e.exportVariable=function(e,t){const r=d.toCommandValue(t);if(process.env[e]=r,process.env.GITHUB_ENV)return u.issueFileCommand("ENV",u.prepareKeyValueMessage(e,t));l.issueCommand("set-env",{name:e},r)},e.setSecret=function(e){l.issueCommand("add-mask",{},e)},e.addPath=function(e){process.env.GITHUB_PATH?u.issueFileCommand("PATH",e):l.issueCommand("add-path",{},e),process.env.PATH=`${e}${f.delimiter}${process.env.PATH}`},e.getInput=t,e.getMultilineInput=function(e,r){const n=t(e,r).split("\n").filter((e=>""!==e));return r&&!1===r.trimWhitespace?n:n.map((e=>e.trim()))},e.getBooleanInput=function(e,r){const n=t(e,r);if(["true","True","TRUE"].includes(n))return!0;if(["false","False","FALSE"].includes(n))return!1;throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${e}\nSupport boolean input list: \`true | True | TRUE | false | False | FALSE\``)},e.setOutput=function(e,t){if(process.env.GITHUB_OUTPUT)return u.issueFileCommand("OUTPUT",u.prepareKeyValueMessage(e,t));process.stdout.write(p.EOL),l.issueCommand("set-output",{name:e},d.toCommandValue(t))},e.setCommandEcho=function(e){l.issue("echo",e?"on":"off")},e.setFailed=function(e){process.exitCode=g.Failure,r(e)},e.isDebug=function(){return"1"===process.env.RUNNER_DEBUG},e.debug=function(e){l.issueCommand("debug",{},e)},e.error=r,e.warning=function(e,t={}){l.issueCommand("warning",d.toCommandProperties(t),e instanceof Error?""+e:e)},e.notice=function(e,t={}){l.issueCommand("notice",d.toCommandProperties(t),e instanceof Error?""+e:e)},e.info=function(e){process.stdout.write(e+p.EOL)},e.startGroup=n,e.endGroup=o,e.group=function(e,t){return c(this,void 0,void 0,(function*(){let r;n(e);try{r=yield t()}finally{o()}return r}))},e.saveState=function(e,t){if(process.env.GITHUB_STATE)return u.issueFileCommand("STATE",u.prepareKeyValueMessage(e,t));l.issueCommand("save-state",{name:e},d.toCommandValue(t))},e.getState=function(e){return process.env["STATE_"+e]||""},e.getIDToken=function(e){return c(this,void 0,void 0,(function*(){return yield y.OidcClient.getIDToken(e)}))};var w=h();Object.defineProperty(e,"summary",{enumerable:!0,get:function(){return w.summary}});var b=h();Object.defineProperty(e,"markdownSummary",{enumerable:!0,get:function(){return b.markdownSummary}});var E=function(){if(Wo)return Yo;Wo=1;var e=Bn&&Bn.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),t=Bn&&Bn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Bn&&Bn.__importStar||function(r){if(r&&r.__esModule)return r;var n={};if(null!=r)for(var o in r)"default"!==o&&Object.hasOwnProperty.call(r,o)&&e(n,r,o);return t(n,r),n};Object.defineProperty(Yo,"__esModule",{value:!0}),Yo.toPlatformPath=Yo.toWin32Path=Yo.toPosixPath=void 0;const n=r(wn);return Yo.toPosixPath=function(e){return e.replace(/[\\]/g,"/")},Yo.toWin32Path=function(e){return e.replace(/[/]/g,"\\")},Yo.toPlatformPath=function(e){return e.replace(/[/\\]/g,n.sep)},Yo}();Object.defineProperty(e,"toPosixPath",{enumerable:!0,get:function(){return E.toPosixPath}}),Object.defineProperty(e,"toWin32Path",{enumerable:!0,get:function(){return E.toWin32Path}}),Object.defineProperty(e,"toPlatformPath",{enumerable:!0,get:function(){return E.toPlatformPath}})}(qn)),qn}function y(e){return Gn.GITHUB_ACTIONS?Jo.error(e):console.log(`${e}`)}function g(e){return Gn.GITHUB_ACTIONS?Jo.warning(e):console.log(`${e}`)}function v(e){return Gn.GITHUB_ACTIONS?Jo.notice(e):console.log(`${e}`)}function w(e){return Gn.GITHUB_ACTIONS?Jo.info(e):console.log(e)}function b(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}function E(e,t,r){if("function"==typeof t&&(r=t,t={}),!r){if("function"!=typeof Promise)throw new TypeError("callback not provided");return new Promise((function(r,n){E(e,t||{},(function(e,t){e?n(e):r(t)}))}))}xs(e,t||{},(function(e,n){e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,n=!1),r(e,n)}))}function _(e,t){const r=e.options.env||process.env,n=process.cwd(),o=null!=e.options.cwd,i=o&&void 0!==process.chdir&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd)}catch(a){}let s;try{s=Gs.sync(e.command,{path:r[Hs({env:r})],pathExt:t?Bs.delimiter:void 0})}catch(c){}finally{i&&process.chdir(n)}return s&&(s=Bs.resolve(o?e.options.cwd:"",s)),s}function S(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function O(e,t){return ta&&1===e&&!t.file?S(t.original,"spawn"):null}function T(e,t,r){const n=na(e,t,r),o=ra.spawn(n.command,n.args,n.options);return oa.hookChildProcess(o,n),o}function R(e={}){const{env:t=process.env,platform:r=process.platform}=e;return"win32"!==r?"PATH":Object.keys(t).reverse().find((e=>"PATH"===e.toUpperCase()))||"Path"}function I(e){return e instanceof URL?Tn.fileURLToPath(e):e}function x(e,t){this._id=e,this._clearFn=t}function N(e){if("string"==typeof e)return ul(e);if(!ArrayBuffer.isView(e)||1!==e.BYTES_PER_ELEMENT)throw Error("Input must be a string or a Uint8Array");return dl(e)}function A(e,{checkOpen:t=!0}={}){return null!==e&&"object"==typeof e&&(e.writable||e.readable||!t||void 0===e.writable&&void 0===e.readable)&&"function"==typeof e.pipe}function P(e,{checkOpen:t=!0}={}){return A(e,{checkOpen:t})&&(e.writable||!t)&&"function"==typeof e.write&&"function"==typeof e.end&&"boolean"==typeof e.writable&&"boolean"==typeof e.writableObjectMode&&"function"==typeof e.destroy&&"boolean"==typeof e.destroyed}function $(e,{checkOpen:t=!0}={}){return A(e,{checkOpen:t})&&(e.readable||!t)&&"function"==typeof e.read&&"boolean"==typeof e.readable&&"boolean"==typeof e.readableObjectMode&&"function"==typeof e.destroy&&"boolean"==typeof e.destroyed}function C(e,t){return P(e,t)&&$(e,t)}function D(){return this[wl].next()}function L(e){return this[wl].return(e)}function k({preventCancel:e=!1}={}){const t=this.getReader(),r=new vl(t,e),n=Object.create(bl);return n[wl]=r,n}function M(e,t){const r="bigint"==typeof e;if(!r&&!Number.isFinite(e))throw new TypeError("Expected a finite number or bigint");const n=0>e?"-":"";e=0>e?-e:e,(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 o=[];const i=(e,r,n,i)=>{if(0!==o.length&&t.colonNotation||!(e=>0===e||0n===e)(e)||t.colonNotation&&"m"===n){if(null!=i||(i=e+""),t.colonNotation){const e=i.includes(".")?i.split(".")[0].length:i.length;i="0".repeat(Math.max(0,(o.length>0?2:1)-e))+i}else i+=t.verbose?" "+(s=r,1===(a=e)||1n===a?s:s+"s"):n;var s,a;o.push(i)}},s=function(e){switch(typeof e){case"number":if(Number.isFinite(e))return function(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(iu(1e3*e)%1e3),nanoseconds:Math.trunc(iu(1e6*e)%1e3)}}(e);break;case"bigint":return function(e){return{days:e/86400000n,hours:e/3600000n%24n,minutes:e/60000n%60n,seconds:e/1000n%60n,milliseconds:e%1000n,microseconds:0n,nanoseconds:0n}}(e)}throw new TypeError("Expected a finite number or bigint")}(e),a=BigInt(s.days);if(i(a/365n,"year","y"),i(a%365n,"day","d"),i(Number(s.hours),"hour","h"),i(Number(s.minutes),"minute","m"),t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&1e3>e){const e=Number(s.seconds),r=Number(s.milliseconds),n=Number(s.microseconds),o=Number(s.nanoseconds);if(i(e,"second","s"),t.formatSubMilliseconds)i(r,"millisecond","ms"),i(n,"microsecond","µs"),i(o,"nanosecond","ns");else{const e=r+n/1e3+o/1e6,s="number"==typeof t.millisecondsDecimalDigits?t.millisecondsDecimalDigits:0,a=1>e?Math.ceil(e):Math.round(e),c=s?e.toFixed(s):a;i(Number.parseFloat(c),"millisecond","ms",c)}}else{const n=(Math.round(Math.floor((r?Number(e%86400000n):e)/1e3%60*10**(c="number"==typeof t.secondsDecimalDigits?t.secondsDecimalDigits:1)+1e-7))/10**c).toFixed(c),o=t.keepDecimalsOnWholeSeconds?n:n.replace(/\.0+$/,"");i(Number.parseFloat(o),"second","s",o)}var c;if(0===o.length)return n+"0"+(t.verbose?" milliseconds":"ms");const l=t.colonNotation?":":" ";return"number"==typeof t.unitCount&&(o=o.slice(0,Math.max(t.unitCount,1))),n+o.join(l)}function j(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(const o of e)uf(o);const t=e.some((({readableObjectMode:e})=>e)),r=of(e,t),n=new sf({objectMode:t,writableHighWaterMark:r,readableHighWaterMark:r});for(const o of e)n.add(o);return n}function U(e,t=["-NoProfile","-NoLogo","-NonInteractive"],r={stdio:"inherit"}){return Im(function(){if(void 0===Ay){const e=Ny.sync("pwsh",{nothrow:!0});null!==e&&(Ay=e);const t=Ny.sync("powershell",{nothrow:!0});null!==t&&(Ay=t)}if(void 0===Ay)throw Error("Could not find powershell");return Ay}(),[...t,"-c",e],r)}function F(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}function B(){return null!==Ny.sync("sudo",{nothrow:!0})}function G(){var e;return 0===(null==(e=process.getuid)?void 0:e.call(process))||!!process.env.CI}function H(){return G()&&B()}function q(e){return H()?"sudo "+e:e}function V(e,t=[],r=Cy){return H()?Am(W(e,t),r):xm(e,X(t),r)}function z(e,t=[],r=Cy){return H()?Nm(W(e,t),r):Im(e,X(t),r)}function W(e,t){return"sudo "+X([e,...t]).join(" ")}function X(e){return e.map((e=>`'${e}'`))}function K(){return"win32"===process.platform?Dy():G()}async function Y(e){if(("linux"===process.platform||"darwin"===process.platform)&&H()&&void 0!==process.env.SUDO_USER){let t=gn.statSync(e).isDirectory();await z("chown",[...t?["-R"]:[],process.env.SUDO_USER,e],Cy)}}function J(){if(Tg)return Og;Tg=1;var e=ug,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,o=Object.getOwnPropertySymbols;return Og=function(i,s){var a,c=Object(e(s));if(i=Object(e(i)),n(c).forEach((function(e){try{t(i,e,r(s,e))}catch(n){a=n}})),"function"==typeof o&&o(c).forEach((function(e){try{t(i,e,r(s,e))}catch(n){a=n}})),void 0!==a)throw a;return i}}function Q(){return Ev?bv:(Ev=1,bv=(gv?yv:(gv=1,yv=function(){return"object"==typeof globalThis&&!!globalThis&&globalThis.Array===Array}))()?globalThis:function(){if(wv)return vv;wv=1;var e=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw Error("Unable to resolve global `this`")};return vv=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(t){return e()}try{return __global__||e()}finally{delete Object.prototype.__global__}}()}())}function Z(){if(Iv)return Rv;Iv=1;var e=Tv?Ov:(Tv=1,Ov=function(e){return!!e&&("symbol"==typeof e||!!e.constructor&&"Symbol"===e.constructor.name&&"Symbol"===e[e.constructor.toStringTag])});return Rv=function(t){if(!e(t))throw new TypeError(t+" is not a symbol");return t}}function ee(){return Mv?kv:(Mv=1,kv=function(){if(Sv)return _v;Sv=1;var e=Q(),t={object:!0,symbol:!0};return _v=function(){var r=e.Symbol;return"function"==typeof r&&(r("test symbol"),!!t[typeof r.iterator]&&!!t[typeof r.toPrimitive]&&!!t[typeof r.toStringTag])}}()()?Q().Symbol:function(){if(Lv)return Dv;Lv=1;var e,t,r,n=pv,o=Z(),i=Q().Symbol,s=function(){if(Nv)return xv;Nv=1;var e=pv,t=Object.defineProperty,r=Object.prototype,n=(0,Object.create)(null);return xv=function(o){for(var i,s,a=0;n[o+(a||"")];)++a;return n[o+=a||""]=!0,t(r,i="@@"+o,e.gs(null,(function(r){s||(s=!0,t(this,i,e(r)),s=!1)}))),i}}(),a=function(){if(Pv)return Av;Pv=1;var e=pv,t=Q().Symbol;return Av=function(r){return Object.defineProperties(r,{hasInstance:e("",t&&t.hasInstance||r("hasInstance")),isConcatSpreadable:e("",t&&t.isConcatSpreadable||r("isConcatSpreadable")),iterator:e("",t&&t.iterator||r("iterator")),match:e("",t&&t.match||r("match")),replace:e("",t&&t.replace||r("replace")),search:e("",t&&t.search||r("search")),species:e("",t&&t.species||r("species")),split:e("",t&&t.split||r("split")),toPrimitive:e("",t&&t.toPrimitive||r("toPrimitive")),toStringTag:e("",t&&t.toStringTag||r("toStringTag")),unscopables:e("",t&&t.unscopables||r("unscopables"))})}}(),c=function(){if(Cv)return $v;Cv=1;var e=pv,t=Z(),r=Object.create(null);return $v=function(n){return Object.defineProperties(n,{for:e((function(e){return r[e]?r[e]:r[e]=n(e+"")})),keyFor:e((function(e){var n;for(n in t(e),r)if(r[n]===e)return n}))})}}(),l=Object.create,u=Object.defineProperties,d=Object.defineProperty;if("function"==typeof i)try{i(),r=!0}catch(p){}else i=null;return t=function(r){if(this instanceof t)throw new TypeError("Symbol is not a constructor");return e(r)},Dv=e=function e(o){var a;if(this instanceof e)throw new TypeError("Symbol is not a constructor");return r?i(o):(a=l(t.prototype),u(a,{__description__:n("",o=void 0===o?"":o+""),__name__:n("",s(o))}))},a(e),c(e),u(t.prototype,{constructor:n(e),toString:n("",(function(){return this.__name__}))}),u(e.prototype,{toString:n((function(){return"Symbol ("+o(this).__description__+")"})),valueOf:n((function(){return o(this)}))}),d(e.prototype,e.toPrimitive,n("",(function(){var e=o(this);return"symbol"==typeof e?e:""+e}))),d(e.prototype,e.toStringTag,n("c","Symbol")),d(t.prototype,e.toStringTag,n("c",e.prototype[e.toStringTag])),d(t.prototype,e.toPrimitive,n("c",e.prototype[e.toPrimitive])),Dv}())}function te(){return Wv?zv:(Wv=1,zv=(mv?hv:(mv=1,hv=function(){var e,t,r=Array.from;return"function"==typeof r&&!(!(t=r(e=["raz","dwa"]))||t===e||"dwa"!==t[1])}))()?Array.from:function(){if(Vv)return qv;Vv=1;var e=ee().iterator,t=function(){if(Uv)return jv;Uv=1;var e={}.toString,t=e.call(function(){return arguments}());return jv=function(r){return e.call(r)===t}}(),r=function(){if(Bv)return Fv;Bv=1;var e={}.toString,t=/t/.test.bind(/^[object [A-Za-z0-9]*Function]$/);return Fv=function(r){return"function"==typeof r&&t(e.call(r))}}(),n=ig,o=cg,i=ug,s=Yy,a=function(){if(Hv)return Gv;Hv=1;var e={}.toString,t=e.call("");return Gv=function(r){return"string"==typeof r||r&&"object"==typeof r&&(r instanceof String||e.call(r)===t)||!1}}(),c=Array.isArray,l=function(){}.call,u={configurable:!0,enumerable:!0,writable:!0,value:null},d=Object.defineProperty;return qv=function(p){var f,h,m,y,g,v,w,b,E,_,S=arguments[1],O=arguments[2];if(p=Object(i(p)),s(S)&&o(S),this&&this!==Array&&r(this))f=this;else{if(!S){if(t(p))return 1!==(g=p.length)?Array.apply(null,p):((y=[,])[0]=p[0],y);if(c(p)){for(y=Array(g=p.length),h=0;g>h;++h)y[h]=p[h];return y}}y=[]}if(!c(p))if(void 0!==(E=p[e])){for(w=o(E).call(p),f&&(y=new f),b=w.next(),h=0;!b.done;)_=S?l.call(S,O,b.value,h):b.value,f?(u.value=_,d(y,h,u)):y[h]=_,b=w.next(),++h;g=h}else if(a(p)){for(g=p.length,f&&(y=new f),h=0,m=0;g>h;++h)_=p[h],g>h+1&&(55296>(v=_.charCodeAt(0))||v>56319||(_+=p[++h])),_=S?l.call(S,O,_,m):_,f?(u.value=_,d(y,m,u)):y[m]=_,++m;g=m}if(void 0===g)for(g=n(p.length),f&&(y=new f(g)),h=0;g>h;++h)_=S?l.call(S,O,p[h],h):p[h],f?(u.value=_,d(y,h,u)):y[h]=_;return f&&(u.value=null,y.length=g),y},qv}())}function re(){if(pw)return dw;pw=1;var e=uw?lw:(uw=1,lw=(sw?iw:(sw=1,iw=function(){var e=Number.isNaN;return"function"==typeof e&&!e({})&&e(NaN)&&!e(34)}))()?Number.isNaN:cw?aw:(cw=1,aw=function(e){return e!=e})),t=ig,r=ug,n=[].indexOf,o={}.hasOwnProperty,i=Math.abs,s=Math.floor;return dw=function(a){var c,l,u;if(!e(a))return n.apply(this,arguments);for(l=t(r(this).length),c=u=isNaN(u=arguments[1])?0:0>u?t(this.length)-s(i(u)):s(u);l>c;++c)if(o.call(this,c)&&e(this[c]))return c;return-1},dw}function ne(){if(bw)return ww;bw=1;var e=cg,t=gg,r=function(){}.call;return ww=function(n,o){var i={},s=arguments[2];return e(o),t(n,(function(e,t,n,a){i[t]=r.call(o,s,e,t,n,a)})),i},ww}function oe(){if(_w)return Ew;_w=1;var e=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e},t=function(t){var r,n,o=document.createTextNode(""),i=0;return new t((function(){var e;if(r)n&&(r=n.concat(r));else{if(!n)return;r=n}if(n=r,r=null,"function"==typeof n)return e=n,n=null,void e();for(o.data=i=++i%2;n;)e=n.shift(),n.length||(n=null),e()})).observe(o,{characterData:!0}),function(t){e(t),r?"function"==typeof r?r=[r,t]:r.push(t):(r=t,o.data=i=++i%2)}};return Ew=function(){if("object"==typeof process&&process&&"function"==typeof process.nextTick)return process.nextTick;if("function"==typeof queueMicrotask)return function(t){queueMicrotask(e(t))};if("object"==typeof document&&document){if("function"==typeof MutationObserver)return t(MutationObserver);if("function"==typeof WebKitMutationObserver)return t(WebKitMutationObserver)}return"function"==typeof setImmediate?function(t){setImmediate(e(t))}:"function"==typeof setTimeout||"object"==typeof setTimeout?function(t){setTimeout(e(t),0)}:null}()}function ie(){return Iw?Rw:(Iw=1,Rw=function(e){return"function"==typeof e})}function se(){function e(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}return kw||(kw=1,fb.exports=e,fb.exports.default=e),fb.exports}function ae(){if(Mw)return pb;Mw=1;var e=ne(),t=function(){if(Tw)return Ow;Tw=1;var e=[].forEach,t=Object.create;return Ow=function(r){var n=t(null);return e.call(arguments,(function(e){n[e]=!0})),n},Ow}(),r=function(){if(Pw)return Aw;Pw=1;var e=ug,t=function(){if(Nw)return xw;Nw=1;var e=ie();return xw=function(t){try{return t&&e(t.toString)?""+t:t+""}catch(r){throw new TypeError("Passed argument cannot be stringifed")}}}();return Aw=function(r){return t(e(r))}}(),n=function(){if(Lw)return Dw;Lw=1;var e=function(){if(Cw)return $w;Cw=1;var e=ie();return $w=function(t){try{return t&&e(t.toString)?""+t:t+""}catch(r){return""}}}();return Dw=function(t){var r=e(t);return r.length>100&&(r=r.slice(0,99)+"…"),r.replace(/[\n\r\u2028\u2029]/g,(function(e){return JSON.stringify(e).slice(1,-1)}))}}(),o=se(),i=oe(),s=Object.create,a=t("then","then:finally","done","done:finally");return vg.promise=function(t,c){var l=s(null),u=s(null),d=s(null);if(!0===t)t=null;else if(t=r(t),!a[t])throw new TypeError("'"+n(t)+"' is not valid promise mode");c.on("set",(function(e,r,n){var s=!1;if(!o(n))return u[e]=n,void c.emit("setasync",e,1);l[e]=1,d[e]=n;var a=function(t){var r=l[e];if(s)throw Error("Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in 'done:finally' mode)\nConsider to rely on 'then' or 'done' mode instead.");r&&(delete l[e],u[e]=t,c.emit("setasync",e,r))},p=function(){s=!0,l[e]&&(delete l[e],delete d[e],c.delete(e))},f=t;if(f||(f="then"),"then"===f){var h=function(){i(p)};"function"==typeof(n=n.then((function(e){i(a.bind(this,e))}),h)).finally&&n.finally(h)}else if("done"===f){if("function"!=typeof n.done)throw Error("Memoizee error: Retrieved promise does not implement 'done' in 'done' mode");n.done(a,p)}else if("done:finally"===f){if("function"!=typeof n.done)throw Error("Memoizee error: Retrieved promise does not implement 'done' in 'done:finally' mode");if("function"!=typeof n.finally)throw Error("Memoizee error: Retrieved promise does not implement 'finally' in 'done:finally' mode");n.done(a),n.finally(p)}})),c.on("get",(function(e,t,r){var n;if(l[e])++l[e];else{var s=function(){c.emit("getasync",e,t,r)};o(n=d[e])?"function"==typeof n.done?n.done(s):n.then((function(){i(s)})):s()}})),c.on("delete",(function(e){if(delete d[e],l[e])delete l[e];else if(hasOwnProperty.call(u,e)){var t=u[e];delete u[e],c.emit("deleteasync",e,[t])}})),c.on("clear",(function(){var t=u;u=s(null),l=s(null),d=s(null),c.emit("clearasync",e(t,(function(e){return[e]})))}))},pb}async function ce(e){try{return await gn.promises.access(e),!0}catch{return!1}}function le(e){const t=function(){if(H()&&"string"==typeof process.env.SUDO_USER&&""!==process.env.SUDO_USER)return"darwin"===process.platform?wn.join("/Users/",process.env.SUDO_USER):wn.join("/home/",process.env.SUDO_USER);{const e=yn.homedir();if(""===e)return;return e}}();return void 0===t?e:e.replace(Sb,t)}async function ue(e){const t=void 0===e.guard?"\n# Automatically Generated by envosman\n":`\n# Automatically Generated by envosman ${e.guard}\nexport SOURCE_${e.guard.toUpperCase()}RC=0\n`;await ce(e.rcPath)&&((await Tb(e.rcPath,"utf8")).includes(t)||(await Ob(e.rcPath,`\n${t}\n`),w(`Added ${t} to ${e.rcPath}`)))}async function de(e,t){await ce(t)&&((await Tb(t,"utf-8")).includes(e)||(await Ob(t,e),w(`${e} was added to ${t}`)))}async function pe(e,t,r={}){const n={escapeSpace:!1,overwrite:!0,rcPath:Ib,...r},o=function(e,t=!1){const r=t?Cb(e):e;return Ub(r,'"',"\\")}(null!=t?t:"",n.escapeSpace);try{if(Gn.GITHUB_ACTIONS)try{if(!n.overwrite&&void 0!==process.env[e])return void w(`Environment variable ${e} is already defined. Skipping.`);Jo.exportVariable(e,o)}catch(i){y(i),await fe(e,o,n)}else await fe(e,o,n)}catch(i){y(`${i}\nFailed to export environment variable ${e}=${o}. You should add it manually.`)}}async function fe(e,t,r){const n=null!=t?t:"";switch(process.platform){case"win32":return r.overwrite||void 0===process.env[e]?(await U(`[Environment]::SetEnvironmentVariable('${e}', '${n}', "User")`),void w(`${e}='${n}' was set in the environment.`)):void w(`Environment variable ${e} is already defined. Skipping.`);case"linux":case"darwin":return await xb(r),void(r.overwrite?(await Fb(r.rcPath,`\nexport ${e}="${n}"\n`),w(`${e}="${n}" was added to "${r.rcPath}`)):(await Fb(r.rcPath,`\nif [ -z "\${${e}}" ]; then export ${e}="${n}"; fi\n`),w(`if not defined ${e} then ${e}="${n}" was added to "${r.rcPath}`)))}process.env[e]=n}async function he(e,t={}){const r={rcPath:Ib,...t};if(!function(e){var t,r;return!!Gb.some((t=>t.test(e)))&&(null!=(r=null==(t=process.env.PATH)?void 0:t.split(wn.delimiter))?r:[]).includes(e)}(e)){process.env.PATH=`${e}${wn.delimiter}${process.env.PATH}`;try{if(Gn.GITHUB_ACTIONS)try{Jo.addPath(e)}catch(n){y(n),await me(e,r)}else await me(e,r)}catch(n){y(`${n}\nFailed to add ${e} to the percistent PATH. You should add it manually.`)}}}async function me(e,t){switch(process.platform){case"win32":return await U(`$USER_PATH=([Environment]::GetEnvironmentVariable("PATH", "User")); [Environment]::SetEnvironmentVariable("PATH", "${e};$USER_PATH", "User")`),void w(`"${e}" was added to the PATH.`);case"linux":case"darwin":return await xb(t),await Bb(t.rcPath,`\nexport PATH="${e}:$PATH"\n`),void w(`"${e}" was added to "${t.rcPath}"`);default:return}}function ye(e){throw Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}function ge(e){Array.isArray(e)||(e=[e]);for(const t of e){const{id:e,data:r}=t;Zb[e]=r}}function ve(e,t,r){const n=function(e){const t=Zb[e.locale];let r=e.unitTypeLookupOrder.slice();r.unshift(e.unitType),r=Array.from(new Set(r));let n=null;if(r.some((function(e){if(void 0!==t[e])return n=t[e],!0})),null===n)throw Error("Can not find any unit type data for locale: "+e.locale);return n}(r);return Kb.pluralize(r.locale,t,n[e]).replace("{0}",t)}function we(){if(y_)return m_;y_=1;const e=/\s+/g;class t{constructor(r,i){if(i=n(i),r instanceof t)return r.loose===!!i.loose&&r.includePrerelease===!!i.includePrerelease?r:new t(r.raw,i);if(r instanceof o)return this.raw=r.value,this.set=[[r]],this.formatted=void 0,this;if(this.options=i,this.loose=!!i.loose,this.includePrerelease=!!i.includePrerelease,this.raw=r.trim().replace(e," "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!h(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const t of this.set)if(1===t.length&&m(t[0])){this.set=[t];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;this.set.length>e;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;t.length>e;e++)e>0&&(this.formatted+=" "),this.formatted+=(""+t[e]).trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&p)|(this.options.loose&&f))+":"+e,n=r.get(t);if(n)return n;const s=this.options.loose;e=e.replace(s?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE],I(this.options.includePrerelease)),i("hyphen replace",e),e=e.replace(a[c.COMPARATORTRIM],l),i("comparator trim",e),e=e.replace(a[c.TILDETRIM],u),i("tilde trim",e),e=e.replace(a[c.CARETTRIM],d),i("caret trim",e);let m=e.split(" ").map((e=>g(e,this.options))).join(" ").split(/\s+/).map((e=>R(e,this.options)));s&&(m=m.filter((e=>(i("loose invalid filter",e,this.options),!!e.match(a[c.COMPARATORLOOSE]))))),i("range list",m);const y=new Map,v=m.map((e=>new o(e,this.options)));for(const r of v){if(h(r))return[r];y.set(r.value,r)}y.size>1&&y.has("")&&y.delete("");const w=[...y.values()];return r.set(t,w),w}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some((t=>y(t,r)&&e.set.some((e=>y(e,r)&&t.every((t=>e.every((e=>t.intersects(e,r)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new s(e,this.options)}catch(t){return!1}for(let r=0;this.set.length>r;r++)if(x(this.set[r],e,this.options))return!0;return!1}}m_=t;const r=new w_,n=cE,o=be(),i=oE,s=wE,{safeRe:a,t:c,comparatorTrimReplace:l,tildeTrimReplace:u,caretTrimReplace:d}=iE,{FLAG_INCLUDE_PRERELEASE:p,FLAG_LOOSE:f}=nE,h=e=>"<0.0.0-0"===e.value,m=e=>""===e.value,y=(e,t)=>{let r=!0;const n=e.slice();let o=n.pop();for(;r&&n.length;)r=n.every((e=>o.intersects(e,t))),o=n.pop();return r},g=(e,t)=>(i("comp",e,t),e=E(e,t),i("caret",e),e=w(e,t),i("tildes",e),e=S(e,t),i("xrange",e),e=T(e,t),i("stars",e),e),v=e=>!e||"x"===e.toLowerCase()||"*"===e,w=(e,t)=>e.trim().split(/\s+/).map((e=>b(e,t))).join(" "),b=(e,t)=>e.replace(t.loose?a[c.TILDELOOSE]:a[c.TILDE],((t,r,n,o,s)=>{let a;return i("tilde",e,t,r,n,o,s),v(r)?a="":v(n)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:v(o)?a=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:s?(i("replaceTilde pr",s),a=`>=${r}.${n}.${o}-${s} <${r}.${+n+1}.0-0`):a=`>=${r}.${n}.${o} <${r}.${+n+1}.0-0`,i("tilde return",a),a})),E=(e,t)=>e.trim().split(/\s+/).map((e=>_(e,t))).join(" "),_=(e,t)=>{i("caret",e,t);const r=t.includePrerelease?"-0":"";return e.replace(t.loose?a[c.CARETLOOSE]:a[c.CARET],((t,n,o,s,a)=>{let c;return i("caret",e,t,n,o,s,a),v(n)?c="":v(o)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:v(s)?c="0"===n?`>=${n}.${o}.0${r} <${n}.${+o+1}.0-0`:`>=${n}.${o}.0${r} <${+n+1}.0.0-0`:a?(i("replaceCaret pr",a),c="0"===n?"0"===o?`>=${n}.${o}.${s}-${a} <${n}.${o}.${+s+1}-0`:`>=${n}.${o}.${s}-${a} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${s}-${a} <${+n+1}.0.0-0`):(i("no pr"),c="0"===n?"0"===o?`>=${n}.${o}.${s}${r} <${n}.${o}.${+s+1}-0`:`>=${n}.${o}.${s}${r} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${s} <${+n+1}.0.0-0`),i("caret return",c),c}))},S=(e,t)=>(i("replaceXRanges",e,t),e.split(/\s+/).map((e=>O(e,t))).join(" ")),O=(e,t)=>(e=e.trim()).replace(t.loose?a[c.XRANGELOOSE]:a[c.XRANGE],((r,n,o,s,a,c)=>{i("xRange",e,r,n,o,s,a,c);const l=v(o),u=l||v(s),d=u||v(a);return"="===n&&d&&(n=""),c=t.includePrerelease?"-0":"",l?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&d?(u&&(s=0),a=0,">"===n?(n=">=",u?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):"<="===n&&(n="<",u?o=+o+1:s=+s+1),"<"===n&&(c="-0"),r=`${n+o}.${s}.${a}${c}`):u?r=`>=${o}.0.0${c} <${+o+1}.0.0-0`:d&&(r=`>=${o}.${s}.0${c} <${o}.${+s+1}.0-0`),i("xRange return",r),r})),T=(e,t)=>(i("replaceStars",e,t),e.trim().replace(a[c.STAR],"")),R=(e,t)=>(i("replaceGTE0",e,t),e.trim().replace(a[t.includePrerelease?c.GTE0PRE:c.GTE0],"")),I=e=>(t,r,n,o,i,s,a,c,l,u,d,p)=>`${r=v(n)?"":v(o)?`>=${n}.0.0${e?"-0":""}`:v(i)?`>=${n}.${o}.0${e?"-0":""}`:s?">="+r:`>=${r}${e?"-0":""}`} ${c=v(l)?"":v(u)?`<${+l+1}.0.0-0`:v(d)?`<${l}.${+u+1}.0-0`:p?`<=${l}.${u}.${d}-${p}`:e?`<${l}.${u}.${+d+1}-0`:"<="+c}`.trim(),x=(e,t,r)=>{for(let n=0;e.length>n;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;e.length>r;r++)if(i(e[r].semver),e[r].semver!==o.ANY&&e[r].semver.prerelease.length>0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0};return m_}function be(){if(v_)return g_;v_=1;const e=Symbol();class t{static get ANY(){return e}constructor(n,o){if(o=r(o),n instanceof t){if(n.loose===!!o.loose)return n;n=n.value}n=n.trim().split(/\s+/).join(" "),s("comparator",n,o),this.options=o,this.loose=!!o.loose,this.parse(n),this.value=this.semver===e?"":this.operator+this.semver.version,s("comp",this)}parse(t){const r=t.match(this.options.loose?n[o.COMPARATORLOOSE]:n[o.COMPARATOR]);if(!r)throw new TypeError("Invalid comparator: "+t);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),this.semver=r[2]?new a(r[2],this.options.loose):e}toString(){return this.value}test(t){if(s("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"==typeof t)try{t=new a(t,this.options)}catch(r){return!1}return i(t,this.operator,this.semver,this.options)}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new c(e.value,n).test(this.value):""===e.operator?""===e.value||new c(this.value,n).test(e.semver):!((n=r(n)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(i(this.semver,"<",e.semver,n)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(i(this.semver,">",e.semver,n)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}g_=t;const r=cE,{safeRe:n,t:o}=iE,i=c_,s=oE,a=wE,c=we();return g_}function Ee(e,t,r,n){return new(r||(r=Promise))((function(t,o){function i(e){try{a(n.next(e))}catch(t){o(t)}}function s(e){try{a(n.throw(e))}catch(t){o(t)}}function a(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(i,s)}a((n=n.call(e)).next())}))}function _e(e,t){function r(r){return function(c){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,r[0]&&(a=0)),a;)try{if(n=1,o&&(i=2&r[0]?o.return:r[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,r[1])).done)return i;switch(o=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,o=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&i[3]>r[1])){a.label=r[1];break}if(6===r[0]&&i[1]>a.label){a.label=i[1],i=r;break}if(i&&i[2]>a.label){a.label=i[2],a.ops.push(r);break}i[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(c){r=[6,c],o=0}finally{n=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,c])}}var n,o,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s}function Se(e){return null==e?[]:Array.isArray(e)?e:[e]}function Oe(e,t,r,n){var o,i=e[t],s=~n.string.indexOf(t)?null==r||!0===r?"":r+"":"boolean"==typeof r?r:~n.boolean.indexOf(t)?"false"!==r&&("true"===r||(e._.push(0*(o=+r)==0?o:r),!!r)):0*(o=+r)==0?o:r;e[t]=null==i?s:Array.isArray(i)?i.concat(s):[i,s]}async function Te(e,t,r,n=40){Gn.GITHUB_ACTIONS?await async function(e,t,r=40){await z("update-alternatives",["--install","/usr/bin/"+e,e,t,""+r])}(e,t,n):(await xb(r),await IS(r.rcPath,`\nif [ $UID -eq 0 ]; then update-alternatives --install /usr/bin/${e} ${e} ${t} ${n}; fi\n`))}function Re(e){const t={...process.env,DEBIAN_FRONTEND:"noninteractive"};return"nala"===e&&(void 0===t.LANG&&(t.LANG="C.UTF-8"),void 0===t.LC_ALL&&(t.LC_ALL="C.UTF-8")),t}function Ie(){return null!==Ny.sync("nala",{nothrow:!0})}function xe(){let e;return e=Ie()?"nala":"apt-get",e}function Ne(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}async function Ae(e){try{const{stdout:t}=await Im("dpkg",["-s",e],{env:Re("apt-get"),stdio:"pipe"});return"string"==typeof t&&t.split("\n").some((e=>e.startsWith("Status: install ok installed")))}catch{return!1}}async function Pe(e,t=xe()){return(await Promise.all(e.map((e=>$e(e,t))))).filter((e=>void 0!==e))}async function $e(e,t=xe()){const r=await async function(e,t,r){switch(await Ce(e,t,r)){case PS.NameDashVersion:return`${t}-${r}`;case PS.NameEqualsVersion:return`${t}=${r}`;case PS.Name:return void 0!==r&&""!==r&&g(`Could not find package ${t} with version ${r}. Installing the latest version.`),t;default:throw Error(`Could not find package ${t} ${null!=r?r:""}`)}}(t,e.name,e.version);return await Ae(r)?void 0:r}async function Ce(e,t,r){if(void 0!==r&&""!==r){const{stdout:n}=await Im("apt-cache",["search","--names-only",`^${Ne(t)}-${Ne(r)}$`],{env:Re(e),stdio:"pipe"});if(""!==n.trim())return PS.NameDashVersion;try{const{stdout:n}=await Im("apt-cache",["show",`${t}=${r}`],{env:Re(e)});if(""===n.trim())return PS.NameEqualsVersion}catch{}}try{const{stdout:r}=await Im("apt-cache",["show",t],{env:Re(e),stdio:"pipe"});if(""!==r.trim())return PS.Name}catch{}return NS?PS.None:(AS(e),Ce(e,t,r))}async function De(e,t=!1){try{const n=xe();for(const{name:t,version:r}of e)w(`Installing ${t} ${null!=r?r:""} via ${n}`);t&&AS(n),await async function(e,t){const r=[...new Set(t.flatMap((e=>{var t;return null!=(t=e.repository)?t:[]})))];await Promise.all(r.map((t=>async function(e,t=xe()){await CS(t),await async function(e){await Ae("software-properties-common")||V(e,["install","-y","--fix-broken","-o",xS,"software-properties-common"],{...Cy,env:Re(e)})}(t),V("add-apt-repository",["-y","--no-update",e],{...Cy,env:Re(t)}),AS.clear(),AS(t)}(t,e))))}(n,e);const o=await Pe(e,n);if(0===o.length)return w("All packages are already installed"),{binDir:"/usr/bin/"};await CS(n);try{await async function(e){await Promise.all(e.map((async e=>{var t;void 0!==e.key&&await(t=e.key,"keyUrl"in t?Le(t):async function({key:e,keyServer:t=kS,fileName:r,keyStorePath:n=kS}){try{Me(r);const o=wn.join(n,r);return await ce(o)||(ke(),await z("gpg",["--no-default-keyring","--keyring","gnupg-ring:"+o,"--keyserver",t,"--recv-keys",e]),await z("chmod",["644",o])),o}catch(o){return void g(`Failed to add apt key via server ${t}: ${o}`)}}(t))})))}(e),V(n,["install","--fix-broken","-y",...o],{...Cy,env:Re(n)})}catch(r){if(!function(e){return"string"==typeof e.stderr}(r))throw r;DS.some((e=>"string"==typeof r.stderr&&r.stderr.includes(e)))&&(g(`Failed to install packages ${o}. Retrying...`),V(n,["install","--fix-broken","-y","-o",xS,...o],{...Cy,env:Re(n)}))}return{binDir:"/usr/bin/"}}catch(r){throw Error("Failed to install apt packages: "+(r instanceof Error?`${r.message}\n${r.stack}`:r+""))}}async function Le({keyUrl:e,fileName:t,keyStorePath:r=LS}){try{Me(t);const n=wn.join(r,t);if(!(await ce(n))){ke(),await De([{name:"ca-certificates"}]);const r=wn.join(yn.tmpdir(),t),o=new RS.DownloaderHelper(e,yn.tmpdir(),{fileName:t});o.on("error",(t=>{throw Error(`Failed to download ${e}: ${t}`)})),await o.start(),V("gpg",["--no-default-keyring","--keyring","gnupg-ring:"+n,"--import",r]),V("chmod",["644",n])}return n}catch(n){return void g(`Failed to add apt key via download ${e}: ${n}`)}}function ke(){V("gpg",["-k"])}function Me(e){if(!e.endsWith(".gpg"))throw Error("Key file name must end with .gpg: "+e)}async function je(e={}){if(!["darwin","linux"].includes(process.platform))return;if("string"==typeof MS)return{binDir:MS};const t=await Ny("brew",{nothrow:!0});if(null!==t)return MS=wn.dirname(t),{binDir:MS};await De([{name:"ca-certificates"}]);const r=new RS.DownloaderHelper("https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh",yn.tmpdir(),{fileName:"install-brew.sh"});return r.on("error",(e=>{throw Error("Failed to download the brew installer script: "+e)})),await r.start(),xm("/bin/bash",[r.getDownloadPath()],{stdio:"inherit",env:{NONINTERACTIVE:"1"}}),MS=Ue(),await he(MS,e.rcOptions),{binDir:MS}}function Ue(){return wn.join(Fe(),"bin")}function Fe(){if("darwin"===process.platform)return"arm64"===process.arch?"/opt/homebrew":"/usr/local";if("linux"===process.platform)return"/home/linuxbrew/.linuxbrew";throw Error("Unsupported platform for brew")}async function Be(e,t,r={}){const n={overwrite:!0,cask:!1,args:[],...r};w(`Installing ${e} ${null!=t?t:""} via brew`),GS&&null!==Ny.sync("brew",{nothrow:!0})||(await je(),GS=!0);const o=Ue(),i=wn.join(o,"brew"),s=["install",void 0!==t&&""!==t?`${e}@${t}`:e];return n.overwrite&&s.push("--overwrite"),n.cask&&s.push("--cask"),xm(i,s,{stdio:"inherit"}),{binDir:o}}function Ge(){return"linux"===process.platform&&(void 0===jS&&(jS=null!==Ny.sync("dnf",{nothrow:!0})),jS)}function He(){return"linux"===process.platform&&(void 0===US&&(US=null!==Ny.sync("pacman",{nothrow:!0})),US)}function qe(){return"linux"===process.platform&&(void 0===FS&&(FS=null!==Ny.sync("apt-get",{nothrow:!0})),FS)}async function Ve(e,t,r){var n;if("win32"!==process.platform)return;if("string"==typeof BS)return{binDir:BS};const o=Ny.sync("choco",{nothrow:!0});if(null!==o)return BS=wn.dirname(o),{binDir:BS};let i="powershell.exe";const s=Ny.sync(process.env.SystemRoot+"\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",{nothrow:!0});null!==s&&(i=s),xm(i,["-NoProfile","-InputFormat","None","-ExecutionPolicy","Bypass","-Command","[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))"],{stdio:"inherit"});const a=process.env.ALLUSERSPROFILE+"\\chocolatey\\bin";await he(a,KR);const c=Ny.sync("choco",{nothrow:!0});return BS=null!==c?wn.dirname(c):(null!=(n=process.env.ChocolateyInstall)?n:"C:/ProgramData/chocolatey")+"/bin",await ce(BS)?{binDir:BS}:void 0}async function ze(e,t,r=[]){var n;w(`Installing ${e} ${null!=t?t:""} via chocolatey`),HS&&null!==Ny.sync("choco",{nothrow:!0})||(await Ve(0,0,process),HS=!0);const o=process.env.PATH,i={...process.env};if(i.TMP=void 0,i.TEMP=void 0,i.Path=void 0,i.PATH=o,void 0!==t&&""!==t)xm("choco",["install","-y",e,"--version="+t,...r],{env:i,extendEnv:!1,stdio:"inherit"});else try{xm("choco",["install","-y",e,...r],{env:i,extendEnv:!1,stdio:"inherit"})}catch(a){if(!a.message.includes("exit code 3010"))throw a;w(e+" might require a reboot for the completion of the installation.")}const s=(null!=(n=process.env.ChocolateyInstall)?n:"C:/ProgramData/chocolatey")+"/bin";return await he(s,KR),{binDir:s}}async function We(e){for(const{name:t,version:r}of e)w(`Installing ${t} ${null!=r?r:""} via dnf`);return V("dnf",["-y","install",...await Promise.all(e.map((e=>async function(e,t){if(void 0!==t&&""!==t){const{stdout:r}=await Im("dnf",["search","-q",`${e}-${t}`]);if(""!==r.trim())return`${e}-${t}`;{const{stdout:r}=await Im("dnf",["search","-q",`${e}${t}`]);if(""!==r.trim())return`${e}${t}`;g(`Failed to install ${e} ${t} via dnf, trying without version`)}}return e}(e.name,e.version))))]),{binDir:"/usr/bin/"}}async function Xe(e,t,r){w(`Installing ${e} ${null!=t?t:""} via pacman`);const n="pacman";"yay"===r&&function(){if(null===Ny.sync("yay",{nothrow:!0}))try{V("pacman",["-S","--noconfirm","base-devel","git"]);const e=wn.join(yn.tmpdir(),"yay");V("mkdir",["-p",e]),G()?(g("Creating a non-root user to build yay"),V("useradd",["-m","-G","wheel","builder"]),V("passwd",["-d","builder"]),V("chown",["-R","builder:builder",e]),V("bash",["-c",'echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers']),WS=!0,xm("su",["-","builder","-c","git clone https://aur.archlinux.org/yay.git "+e],{stdio:"inherit"}),xm("su",["-","builder","-c",`cd ${e} && makepkg -si --noconfirm`],{stdio:"inherit"})):(xm("git",["clone","https://aur.archlinux.org/yay.git",e],{stdio:"inherit",cwd:yn.tmpdir()}),xm("makepkg",["-si","--noconfirm"],{stdio:"inherit",cwd:e})),xm("rm",["-rf",e],{stdio:"inherit"})}catch(e){throw Error(`Failed to install yay: ${e}. Install yay manually and re-run the script.`)}}(),qS||"yay"===r||(V(n,["-Sy","--noconfirm"]),qS=!0),VS||"yay"===r||(V(n,["-S","--noconfirm","base-devel"]),VS=!0);const o=e=>"yay"===r?G()&&WS?V("su",["-","builder","-c","yay -S --noconfirm "+e]):xm(r,["-S","--noconfirm",e]):V(null!=r?r:n,["-S","--noconfirm",e]);if(void 0!==t&&""!==t){const r=await async function(e,t){const r=[];try{const{stdout:n}=await Im(e,["-Si",t]);for(const e of n.matchAll(zS))r.push(e[1])}catch(n){g(`Failed to get available versions for ${t}: ${n}`)}return r}(n,e);if(r.includes(t))try{o(`${e}=${t}`)}catch{o(`${e}${t}`)}else w(`Failed to install ${e} ${t} via pacman, trying without version`),o(e)}else o(e);return{binDir:"/usr/bin/"}}function Ke(e,t){return Object.keys(t).forEach((r=>{"default"===r||"__esModule"===r||e.hasOwnProperty(r)||Object.defineProperty(e,r,{enumerable:!0,get:()=>t[r]})})),e}function Ye(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}function Je(e,t=!0){return t?wn.basename(e):wn.basename(e,wn.extname(e))}function Qe(e){return wn.normalize(e).replace(RegExp(Ne(wn.sep)+"$"),"")}function Ze(e,t=".exe",r=""){return"win32"===process.platform?`${e}${t}`:`${e}${r}`}function et(e,t){const r=wn.extname(e),n=`${t}${wn.basename(e,r)}${r}`;return wn.join(wn.dirname(e),n)}function tt(e,t){const r=wn.extname(e),n=`${wn.basename(e,r)}${t}${r}`;return wn.join(wn.dirname(e),n)}function rt(e,t=".cmd",r=".sh"){return"win32"===process.platform?`${e}${t}`:`${e}${r}`}function nt(e){return"win32"===process.platform?e:"./"+e}function ot(e){const t=wn.extname(e).length;return e.slice(0,-t)}function it(e,t){return KS(e,t)}function st(e,t){const r=wn.relative(t,e);return!(!r||".."===r||r.startsWith(".."+wn.sep)||r===wn.resolve(e))}function at(e){return wO(this,void 0,void 0,(function*(){if(_O.IS_WINDOWS&&/[*"<>|]/.test(e))throw Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');try{yield _O.rm(e,{force:!0,maxRetries:3,recursive:!0,retryDelay:300})}catch(t){throw Error("File was unable to be removed "+t)}}))}function ct(e){return wO(this,void 0,void 0,(function*(){bO.ok(e,"a path argument must be provided"),yield _O.mkdir(e,{recursive:!0})}))}function lt(e){return wO(this,void 0,void 0,(function*(){if(!e)throw Error("parameter 'tool' is required");const t=[];if(_O.IS_WINDOWS&&process.env.PATHEXT)for(const e of process.env.PATHEXT.split(EO.delimiter))e&&t.push(e);if(_O.isRooted(e)){const r=yield _O.tryGetExecutablePath(e,t);return r?[r]:[]}if(e.includes(EO.sep))return[];const r=[];if(process.env.PATH)for(const e of process.env.PATH.split(EO.delimiter))e&&r.push(e);const n=[];for(const o of r){const r=yield _O.tryGetExecutablePath(EO.join(o,e),t);r&&n.push(r)}return n}))}function ut(e,t,r,n){return wO(this,void 0,void 0,(function*(){if(r>=255)return;r++,yield ct(t);const o=yield _O.readdir(e);for(const i of o){const o=`${e}/${i}`,s=`${t}/${i}`;(yield _O.lstat(o)).isDirectory()?yield ut(o,s,r,n):yield dt(o,s,n)}yield _O.chmod(t,(yield _O.stat(e)).mode)}))}function dt(e,t,r){return wO(this,void 0,void 0,(function*(){if((yield _O.lstat(e)).isSymbolicLink()){try{yield _O.lstat(t),yield _O.unlink(t)}catch(n){"EPERM"===n.code&&(yield _O.chmod(t,"0666"),yield _O.unlink(t))}const r=yield _O.readlink(e);yield _O.symlink(r,t,_O.IS_WINDOWS?"junction":null)}else(yield _O.exists(t))&&!r||(yield _O.copyFile(e,t))}))}function pt(e,t,r){return JO(this,void 0,void 0,(function*(){const n=ZO.argStringToArray(e);if(0===n.length)throw Error("Parameter 'commandLine' cannot be null or empty.");const o=n[0];return t=n.slice(1).concat(t||[]),new ZO.ToolRunner(o,t,r).exec()}))}function ft(e,t){const r=[];t=t||mT.arch();const n=yT.join(wt(),e);if(fT.existsSync(n)){const e=fT.readdirSync(n);for(const o of e)if(gt(o)){const e=yT.join(n,o,t||"");fT.existsSync(e)&&fT.existsSync(e+".complete")&&r.push(o)}}return r}function ht(e){return lT(this,void 0,void 0,(function*(){return e||(e=yT.join(bt(),_T.default())),yield pT.mkdirP(e),e}))}function mt(e,t,r){return lT(this,void 0,void 0,(function*(){const n=yT.join(wt(),e,vT.clean(t)||t,r||"");dT.debug("destination "+n);const o=n+".complete";return yield pT.rmRF(n),yield pT.rmRF(o),yield pT.mkdirP(n),n}))}function yt(e,t,r){const n=yT.join(wt(),e,vT.clean(t)||t,r||"");fT.writeFileSync(n+".complete",""),dT.debug("finished caching tool")}function gt(e){const t=vT.clean(e)||"";dT.debug("isExplicit: "+t);const r=null!=vT.valid(t);return dT.debug("explicit? "+r),r}function vt(e,t){let r="";dT.debug(`evaluating ${e.length} versions`);for(let n=(e=e.sort(((e,t)=>vT.gt(e,t)?1:-1))).length-1;n>=0;n--){const o=e[n];if(vT.satisfies(o,t)){r=o;break}}return dT.debug(r?"matched: "+r:"match not found"),r}function wt(){const e=process.env.RUNNER_TOOL_CACHE||"";return ET.ok(e,"Expected RUNNER_TOOL_CACHE to be defined"),e}function bt(){const e=process.env.RUNNER_TEMP||"";return ET.ok(e,"Expected RUNNER_TEMP to be defined"),e}function Et(e,t){const r=Bn[e];return void 0!==r?r:t}function _t(e,t){if(!e||!t)throw Error("retry-as-promised must be passed a callback and a options set");const r={$current:"$current"in(t="number"==typeof t?{max:t}:t)?t.$current:1,max:t.max,timeout:t.timeout||void 0,match:t.match?Array.isArray(t.match)?t.match:[t.match]:[],backoffBase:void 0===t.backoffBase?100:t.backoffBase,backoffExponent:t.backoffExponent||1.1,report:t.report,name:t.name||e.name||"unknown"};return r.match&&!Array.isArray(r.match)&&(r.match=[r.match]),r.report&&r.report("Trying "+r.name+" #"+r.$current+" at "+(new Date).toLocaleTimeString(),r),new Promise((function(t,n){let o,i,s;r.timeout&&(o=setTimeout((function(){i&&clearTimeout(i),n(new NT(r.name+" timed out",s))}),r.timeout)),Promise.resolve(e({current:r.$current})).then(t).then((function(){o&&clearTimeout(o),i&&clearTimeout(i)})).catch((function(a){o&&clearTimeout(o),i&&clearTimeout(i),s=a,r.report&&r.report(a&&""+a||a,r,a);var c=r.max>r.$current;if(!c)return n(a);if(c=0===r.match.length||r.match.some((function(e){return function(e,t){if("function"==typeof e)try{if(t instanceof e)return!0}catch(r){return!!e(t)}return e===""+t||e===t.message||e instanceof RegExp&&(e.test(t.message)||e.test(""+t))}(e,a)})),!c)return n(a);var l=r.backoffBase*Math.pow(r.backoffExponent,r.$current-1);r.$current++,r.report&&r.report(`Retrying ${r.name} (${r.$current})`,r),l?(r.report&&r.report(`Delaying retry of ${r.name} by ${l}`,r),i=setTimeout((function(){_t(e,r).then(t).catch(n)}),l)):_t(e,r).then(t).catch(n)}))}))}function St(e,t,r){switch(process.platform){case"win32":return ze("7zip",e);case"darwin":return Be("p7zip",e);case"linux":if(He())return Xe("p7zip",e);if(Ge())return We([{name:"p7zip",version:e},{name:"p7zip-plugins",version:e}]);if(qe())return De([{name:"p7zip-full",version:e}]);throw Error("Unsupported linux distribution");default:throw Error("Unsupported platform")}}function Ot(e){const t=e.split(".").pop();return"tar"===t?0:"gz"===t||"tgz"===t?1:"xz"===t||"txz"===t?2:"zip"===t?3:("7z"===t||"exe"===t||g(`Unknown archive type: ${t}. Defaulting to 7z`),4)}async function Tt(e,t){return await Im(await async function(){return void 0===PT&&(null===Ny.sync("7z",{nothrow:!0})&&await St("",0,process),PT="7z"),PT}(),["x",e,"-o"+t,"-y"],{stdio:"inherit"}),await Y(t),t}function Rt(e,t){return Tt(e,t)}async function It(e,t){return null!==Ny.sync("7z",{nothrow:!0})?Tt(e,t):null!==Ny.sync("unzip",{nothrow:!0})?(await Im("unzip",["-q",e,"-d",t],{stdio:"inherit"}),await Y(t),t):Tt(e,t)}async function xt(e,t,r=0,n=[]){await async function(e){switch(w("Installing tar extraction dependencies"),e){case 1:"linux"===process.platform&&(He()?(await Xe("gzip"),await Xe("tar")):Ge()?await We([{name:"gzip"},{name:"tar"}]):qe()&&await De([{name:"gzip"},{name:"tar"}]));break;case 2:"linux"===process.platform&&(He()?(await Xe("xz"),await Xe("tar")):Ge()?await We([{name:"xz"},{name:"tar"}]):qe()&&await De([{name:"xz-utils"},{name:"tar"}]));break;default:throw Error(`Unsupported archive type: ${e} for tar extraction`)}}(Ot(e));try{await SO(t)}catch{}try{await Im("tar",["xf",e,"-C",t,"--strip-components="+r,...n],{stdio:"inherit"})}catch(o){"win32"===process.platform&&o.message.includes("Can't create '\\\\?\\C:")&&g(`Failed to extract symlink ${e} to ${t}. Ignoring this symlink.`)}return await Y(t),t}async function Nt(e,t,r,n,o){var i,s;w(`Installing ${e} ${t} ${o} via direct downloading`),process.env.RUNNER_TEMP=null!=(i=process.env.RUNNER_TEMP)?i:yn.tmpdir(),process.env.RUNNER_TOOL_CACHE=null!=(s=process.env.RUNNER_TOOL_CACHE)?s:wn.join(yn.tmpdir(),"setup-cpp","hostedtoolcache");const{url:a,binRelativeDir:c,binFileName:l,extractedFolderName:u,extractFunction:d}=await r(t,process.platform,o);if(Gn.GITHUB_ACTIONS)try{const r=exports.find_1(e,t);if(r){const n=wn.join(r,u),o=wn.join(n,c);if(await ce(wn.join(o,l)))return w(`${e} ${t} was found in the cache at ${o}.`),await he(o,KR),{installDir:n,binDir:o}}}catch{}const p=wn.join(n,u),f=wn.join(p,c),h=wn.join(f,l);return await async function(e,t,r,n,o,i,s,a){if((await Promise.all([ce(e),ce(t)])).includes(!1))try{const e=await async function(e,t,r){w(`Download ${e} ${t}`);const n=await AT((()=>{var e;const t=wn.join(null!=(e=process.env.RUNNER_TEMP)?e:yn.tmpdir(),`${Date.now()}-${wn.basename(r)}`);return exports.downloadTool_1(r,t)}),{name:r,max:4,backoffBase:2e3,report:e=>w(e)});return n}(r,n,o);w(`Extracting ${e} to ${i}`);const t=null!=s?s:function(e){switch(e){case 0:case 1:case 2:return xt;case 3:return It;default:return Tt}}(Ot(o));await t(e,i)}catch(c){throw Error(`Failed to download ${r} ${n} ${a} from ${o}: ${c}`)}if(w(`Add ${e} to PATH`),await he(e,KR),!(await ce(t)))throw Error(`Failed to find the binary ${t} after extracting ${r} ${n} ${a}`);if("win32"!==process.platform)try{await km(t,"755")}catch(c){g(`Failed to make ${t} executable: ${c}`)}}(f,h,e,t,a,n,d,o),await async function(e,t,r){Gn.GITHUB_ACTIONS&&"string"==typeof process.env.RUNNER_TOOL_CACHE&&("true"!==Cr("cache-tools")&&"true"!==process.env.CACHE_TOOLS||await exports.cacheDir_1(e,t,r))}(n,e,t),{installDir:p,binDir:f}}function At(e,t,r){var n;const o=null!=(n=h_(e))?n:e;switch(t){case"win32":{const t=t_(o,"v3.19.6");let n;aO.includes(r)?n=t?"win64-x64":"windows-x86_64":cO.includes(r)?n=t?"win32-x86":"windows-i386":lO.includes(r)?n="windows-arm64":(w(`Trying unsupported arch '${r}' for cmake on Windows`),n="windows-"+r);const i=`cmake-${e}-${n}`;return{binRelativeDir:"bin/",binFileName:Ze("cmake"),extractedFolderName:i,url:`https://github.com/Kitware/CMake/releases/download/v${e}/${i}.zip`}}case"darwin":{const t=`cmake-${e}-${t_(o,"v3.19.1")?"Darwin-x86_64":"macos-universal"}`;return{binRelativeDir:"CMake.app/Contents/bin/",binFileName:Ze("cmake"),extractedFolderName:t,url:`https://github.com/Kitware/CMake/releases/download/v${e}/${t}.tar.gz`}}case"linux":{const t=t_(o,"v3.19.8");let n;lO.includes(r)?n=t?"Linux-aarch64":"linux-aarch64":aO.includes(r)?n=t?"Linux-x86_64":"linux-x86_64":(w(`Trying unsupported arch '${r}' for cmake on Linux`),n="linux-"+r);const i=`cmake-${e}-${n}`;return{binRelativeDir:"bin/",binFileName:Ze("cmake"),extractedFolderName:i,url:`https://github.com/Kitware/CMake/releases/download/v${e}/${i}.tar.gz`}}default:throw Error(`Unsupported platform '${t}'`)}}function Pt(e,t,r){return Nt("cmake",e,At,t,r)}async function $t(e,t,r=WT){const n=await async function(e,t=WT){var r,n;try{const o=await exports.getExecOutput_1(e,["--version"]),i=null==(r=(o.stdout||o.stderr||"").trim().match(t))?void 0:r[1];return null!=(n=h_(i))?n:void 0}catch(o){return void console.error(o)}}(e,r);return void 0!==n&&""!==t&&-1!==kE(n,t)}function Ct(e,t='"'){return e.includes(" ")?`${t}${e}${t}`:e}async function Dt(e,t,r){const n=await async function(e,t,r){let n,o=await Lt(t);if(void 0!==o){const e=wn.dirname(o);n={bin:o,installDir:e,binDir:e}}else{if(Gn.GITHUB_ACTIONS)try{w("Installing python in GitHub Actions");const{setupActionsPython:i}=await Promise.resolve().then((()=>require("./assets/actions_python-DomaW1UO.js")));if(await i(e,t,r),o=await Lt(t),void 0===o)throw Error("Python binary could not be found");const s=wn.dirname(o);n={bin:o,installDir:s,binDir:s}}catch(i){g(""+i)}void 0===n&&(n=await async function(e,t){let r;switch(process.platform){case"win32":{e?await ze("python3",t,["--params=/InstallDir:"+e]):await ze("python3",t);const n=await Lt(e);if(void 0===n)throw Error("Python binary could not be found");const o=wn.dirname(n);await he(o,KR),r={installDir:o,binDir:o,bin:n};break}case"darwin":{r=await Be("python3",t);const e=await Im("brew",["--prefix","python"],{stdio:"pipe"}),n=wn.join(e.stdout,"libexec","bin");await he(n,KR);break}case"linux":if(He())r=await Xe("python",t);else if(Ge())r=await We([{name:"python3",version:t}]);else{if(!qe())throw Error("Unsupported linux distributions");r=await De([{name:"python3",version:t},{name:"python-is-python3"}])}break;default:throw Error("Unsupported platform")}return r}(t,e))}if(void 0===o||void 0===n.bin){if(o=await Lt(t),void 0===o)throw Error("Python binary could not be found");n={bin:o,installDir:wn.dirname(o),binDir:wn.dirname(o)}}return n}(e,t,r);Cn(void 0!==n.bin);const o=n.bin,i=await async function(e){const t=await Mt();return void 0===t?(w("pip was not found. Installing pip"),await async function(e){await Ut(e)||(await Xt("pip"),await Ut(e))}(e),Mt()):t}(o);if(void 0===i)throw Error("pip was not installed correctly");return await async function(e){try{if(!(await Wt(e)))try{await qt(e,"pipx",void 0,{upgrade:!0,usePipx:!1})}catch(t){if(null===Xt("pipx",!1))throw Error("pipx was not installed correctly "+t)}await Im(e,["-m","pipx","ensurepath"],{stdio:"inherit"}),await async function(e){try{await qt(e,"venv",void 0,{upgrade:!1,usePipx:!1})}catch(t){g(`Failed to install venv: ${""+t}. Ignoring...`)}}(e)}catch(t){g(`Failed to install pipx: ${""+t}. Ignoring...`)}}(o),await async function(e){try{await qt(e,"setuptools",void 0,{upgrade:!0,isLibrary:!0,usePipx:!1}),await qt(e,"wheel",void 0,{upgrade:!1,isLibrary:!0,usePipx:!1})}catch(t){g(`Failed to install setuptools/wheel: ${""+t}. Ignoring...`)}}(o),n}async function Lt(e){for(const t of["python","python3"]){const r=await kt(t,e);if(void 0!==r)return r}if("win32"===process.platform){const e=wn.parse(yn.homedir()).root,t=(await zm(e)).filter((e=>e.startsWith("Python")));for(const r of t)for(const t of["python3","python"]){const n=await kt(t,wn.join(e,r));if(void 0!==n)return n}}}async function kt(e,t){var r;try{if(void 0!==t){const r=wn.join(t,Ze(e));if(await ce(r)&&await $t(r,JT))return r}const n=null!=(r=await Ny(e,{nothrow:!0,all:!0}))?r:[];for(const e of n)if(await $t(e,JT))return e}catch{}}async function Mt(){for(const e of["pip3","pip"]){const t=await jt(e);if(void 0!==t)return t}}async function jt(e){var t;try{const r=null!=(t=await Ny(e,{nothrow:!0,all:!0}))?t:[];for(const e of r)if(await $t(e,YT))return e}catch{}}async function Ut(e){try{return await Im(e,["-m","ensurepip","-U","--upgrade"],{stdio:"inherit"}),!0}catch(t){w(""+t);try{return await Im(e,["-m","pip","install","--upgrade","pip"],{stdio:"inherit"}),!0}catch(r){w(""+r)}}return!1}function Ft(e,t,r=null){var n;return Bt(t)&&"linux"===process.platform&&null!==r&&e in QT?function(e,t){const r=e[0],n=Object.keys(t).map((e=>Number.parseInt(e,10))).sort(((e,t)=>t-e)).find((e=>r>=e));return void 0===n?"":t[n]}(r,QT[e]):Bt(t)&&e in KT?null!=(n=KT[e])?n:"":"true"===t?"":null!=t?t:""}function Bt(e){return"true"===e||void 0===e}function Gt(){if(!("version"in yn)||"function"!=typeof yn.version)return null;const e=yn.version().match(/(\d+)\.(\d+)\.(\d+)/);return null===e?null:[Number.parseInt(e[1],10),Number.parseInt(e[2],10),Number.parseInt(e[3],10)]}async function Ht(e,t,r={}){return qt(await async function(){return void 0!==sR||(sR=(await Dt(Ft("python",void 0,await nR()),"",process.arch)).bin),sR}(),e,t,r)}async function qt(e,t,r,n={}){const{usePipx:o=!0,user:i=!0,upgrade:s=!1,isLibrary:a=!1}=n,c=o&&!a&&await Wt(e),l=c?"pipx":"pip",u=t.replace(/\[.*]/g,"").trim();if(!s){const t=c?await async function(e,t){try{const r=await Im(e,["-m","pipx","list","--json"],{stdio:"ignore",reject:!1});if(0!==r.exitCode||"string"!=typeof r.stdout)return!1;const n=JSON.parse(r.stdout);if(t in n.venvs)return!0;for(const e of Object.values(n.venvs))if(e.metadata.main_package.package_or_url===t||e.metadata.main_package.package===t)return!0}catch{}return!1}(e,u):await async function(e,t){try{return 0===(await Im(e,["-m","pip","-qq","show",t],{stdio:"ignore",reject:!1})).exitCode}catch{return!1}}(e,u);if(t)return{binDir:c?await Vt():await zt(e,u)}}const d=await async function(e,t){return 0===(await Im(e,["-m","pip","-qq","index","versions",t],{stdio:"ignore",reject:!1})).exitCode}(e,u);if(d)try{Jo.info(`Installing ${t} ${null!=r?r:""} via ${l}`);const n=void 0!==r&&""!==r?`${t}==${r}`:t,o=s?c?["upgrade"]:["install","--upgrade"]:["install"],a=!c&&i?["--user"]:[],u=process.env;c&&i&&(u.PIPX_HOME=await oR(),u.PIPX_BIN_DIR=await iR()),xm(e,["-m",l,...o,...a,n],{stdio:"inherit",env:u})}catch(p){if(Jo.info(`Failed to install ${t} via ${l}: ${p instanceof Error?`${p.message}\n${p.stack}`:p+""}`),null===await Xt(t))throw Error(`Failed to install ${t} via ${l}: ${p}.`)}else if(null===await Xt(t))throw Error(`Failed to install ${t} as it was not found via ${l} or the system package manager`);return{binDir:c?await Vt():await zt(e,u)}}function Vt(){return iR()}async function zt(e,t){const r=await ZT(e),n=await async function(e,t){const r=(await Promise.all(e.map((e=>ce(wn.join(e,Ze(t))))))).findIndex((e=>e));if(-1!==r)return e[r];const n=Ny.sync(Ze(t),{nothrow:!0});return null!==n?wn.dirname(n):e[e.length-1]}(r,t);return await he(n,KR),n}async function Wt(e){return 0===(await Im(e,["-m","pipx","--help"],{stdio:"ignore",reject:!1})).exitCode}function Xt(e,t=!0){if("linux"===process.platform){if(Jo.info(`Installing ${e} via the system package manager`),He())return Xe(t?"python-"+e:e);if(Ge())return We([{name:t?"python3-"+e:e}]);if(qe())return De([{name:t?"python3-"+e:e}])}else if("darwin"===process.platform)return Be(e);return null}function Kt(e,t,r){return Ht("cmakelang[YAML]",e)}async function Yt(e,t,r){switch(process.platform){case"win32":return await ze("graphviz",e),async function(){if("win32"===process.platform){const e="C:/Program Files/Graphviz/bin";return await he(e,KR),{binDir:e}}throw Error("Unsupported platform")}();case"darwin":return Be("graphviz",e);case"linux":if(He())return Xe("graphviz",e);if(Ge())return We([{name:"graphviz",version:e}]);if(qe())return De([{name:"graphviz",version:e}]);throw Error("Unsupported linux distribution");default:throw Error("Unsupported platform")}}async function Jt(e,t){const{ArchiveHdi:r}=await Promise.resolve().then((()=>require("./assets/hdi-Bqz5zNw7.js"))),n=new r(e);await n.read((async e=>{await e.extract(wn.join(t,e.path))}))}function Qt(e,t,r){switch(t){case"linux":{const t="doxygen-"+e;return{binRelativeDir:"bin/",binFileName:Ze("doxygen"),extractedFolderName:t,url:`https://www.doxygen.nl/files/${t}.linux.bin.tar.gz`}}case"win32":{const t="doxygen-"+e;return{binRelativeDir:"",binFileName:Ze("doxygen"),extractedFolderName:t,url:`https://www.doxygen.nl/files/${t}.windows.x64.bin.zip`}}case"darwin":{const t="Doxygen-"+e;return{binRelativeDir:"Doxygen/Doxygen.app/Contents/Resources/",binFileName:Ze("doxygen"),extractedFolderName:t,extractFunction:Jt,url:`https://doxygen.nl/files/${t}.dmg`}}default:throw Error(`Unsupported platform '${t}'`)}}async function Zt(){if("darwin"===process.platform)try{const e=await exports.getExecOutput_1("xcrun --sdk macosx --show-sdk-path"),t=e.stdout||e.stderr;t?await pe("SDKROOT",t.trim(),KR):y("SDKROOT not set")}catch(e){y(e)}}async function er(e){const t=await Wm(e,"utf-8");return JSON.parse(t)}function tr(e,t){const r=Object.keys(e),n=new Map;if(void 0===t.filterMapTag)for(const i of r)n.set(i,i);else for(const i of r){const e=t.filterMapTag(i);void 0!==e&&n.set(e,i)}if(0===n.size)return;const o=[];for(const[i,s]of n.entries())i.startsWith(t.version)&&o.push(s);if(0!==o.length)for(const i of o){let r=e[i];if(void 0===r)continue;if(void 0!==t.filterName&&(r=r.filter(t.filterName)),0===r.length)continue;const n=rr(i,r,t);if(void 0!==n)return n}}function rr(e,t,r){if(!(void 0!==r.keywords&&0!==r.keywords.length||void 0!==r.optionalKeywords&&0!==r.optionalKeywords.length))return{tag:e,name:t[0]};let n=[];if(void 0!==r.keywords&&0!==r.keywords.length)for(const o of t)r.keywords.every((e=>o.includes(e)))&&n.push(o);else n=t;if(0!==n.length){if(void 0!==r.optionalKeywords&&0!==r.optionalKeywords.length){const t=n.map((e=>{let t=0;for(const n of r.optionalKeywords)e.includes(n)&&t++;return t})),o=Math.max(...t);return{tag:e,name:n[t.indexOf(o)]}}return{tag:e,name:n[0]}}}async function nr(e,t,r){var n;if("win32"===t){const t=tr(await er(wn.join(lR,"github_brechtsanders_winlibs_mingw.json")),{version:e,keywords:[null!=(n={x64:"x86_64",ia32:"i386"}[r])?n:r]});if(void 0===t)throw Error(`No asset found for version ${e} and arch ${r}`);return{binRelativeDir:"bin/",binFileName:Ze("g++"),extractedFolderName:"mingw64",extractFunction:Tt,url:`https://github.com/brechtsanders/winlibs_mingw/releases/download/${t.tag}/${t.name}`}}throw Error(`Unsupported platform '${t}'`)}async function or(e,t,r,n=40){let o;switch(process.platform){case"win32":"arm"!==r&&"arm64"!==r||await ze("gcc-arm-embedded",e);try{o=await Nt("g++",e,nr,t,r)}catch(i){w(`Failed to download g++ binary. ${i}. Falling back to chocolatey.`),o=await async function(e,t){var r,n;let o;if(await ze("mingw",e),"x64"===t&&await ce("C:/tools/mingw64/bin")?(o="C:/tools/mingw64/bin",await he(o,KR)):"ia32"===t&&await ce("C:/tools/mingw32/bin")?(o="C:/tools/mingw32/bin",await he(o,KR)):await ce((null!=(r=process.env.ChocolateyInstall)?r:"C:/ProgramData/chocolatey")+"/bin/g++.exe")&&(o=(null!=(n=process.env.ChocolateyInstall)?n:"C:/ProgramData/chocolatey")+"/bin"),void 0!==o)return{binDir:o}}(e,r)}break;case"darwin":o=await Be("gcc",e);break;case"linux":"x64"===r?He()?o=await Xe("gcc",e):Ge()?o=await We([{name:"gcc",version:e},{name:"gcc-c++",version:e},{name:"libstdc++-devel"}]):qe()&&(o=""===e?await De([{name:"gcc"},{name:"g++"}]):await De([{name:"gcc",version:e,repository:"ppa:ubuntu-toolchain-r/test",key:{key:"1E9377A2BA9EF27F",fileName:"ubuntu-toolchain-r-test.gpg"}},{name:"g++",version:e,repository:"ppa:ubuntu-toolchain-r/test",key:{key:"1E9377A2BA9EF27F",fileName:"ubuntu-toolchain-r-test.gpg"}}])):(w(`Install g++-multilib because gcc for ${r} was requested`),He()?o=await Xe("gcc-multilib",e):qe()&&(o=""===e?await De([{name:"gcc-multilib"}]):await De([{name:"gcc-multilib",version:e,repository:"ppa:ubuntu-toolchain-r/test",key:{key:"1E9377A2BA9EF27F",fileName:"ubuntu-toolchain-r-test.gpg"}}])));break;default:throw Error("Unsupported platform for "+r)}if(void 0!==o)return await async function(e,t,r=40){var n;const o=[];if("win32"===process.platform)o.push(pe("CC",Ze(t+"/gcc"),KR),pe("CXX",Ze(t+"/g++"),KR));else{let s=e;""===e&&(s=await async function(e,t){try{let r="gcc";if(await ce(e+"/gcc"))r=e+"/gcc";else{const t=(await zm(e)).sort(((e,t)=>{var r,n,o,i;return function(e,t){const r=h_(e),n=h_(t);return null!==r&&null!==n?n.compare(r):t.localeCompare(e)}(null!=(n=null==(r=e.match(/^gcc-?(.*)(\.exe)?$/))?void 0:r[1])?n:"",null!=(i=null==(o=t.match(/^gcc-?(.*)(\.exe)?$/))?void 0:o[1])?i:"")}));for(const n of t)if(n.startsWith("gcc")){r=`${e}/${n}`;break}}const{stdout:n}=await Im(r,["--version"],{stdio:"pipe"}),o=n.match(/gcc.* \(.*\) ([\d.]+)/);return null!==o?o[1]:(g("Failed to parse gcc version from: "+n),t)}catch(i){return y("Failed to get gcc version: "+i),t}}(t,s),w("Using gcc version "+s));const a=AE(null!=(n=h_(s))?n:s);5>a?(o.push(pe("CC",`${t}/gcc-${s}`,KR),pe("CXX",`${t}/g++-${s}`,KR)),qe()&&o.push(Te("cc",`${t}/gcc-${s}`,KR,r),Te("cxx",`${t}/g++-${s}`,KR,r),Te("gcc",`${t}/gcc-${s}`,KR,r),Te("g++",`${t}/g++-${s}`,KR,r))):(o.push(pe("CC",`${t}/gcc-${a}`,KR),pe("CXX",`${t}/g++-${a}`,KR)),qe()&&o.push(Te("cc",`${t}/gcc-${a}`,KR,r),Te("cxx",`${t}/g++-${a}`,KR,r),Te("gcc",`${t}/gcc-${a}`,KR,r),Te("g++",`${t}/g++-${a}`,KR,r)))}o.push(Zt()),Gn.GITHUB_ACTIONS&&await async function(){const e=wn.join(lR,"gcc_matcher.json");if(!(await ce(e)))return g("the gcc_matcher.json file does not exist in the same folder as setup-cpp.js");w("::add-matcher::"+e)}(),await Promise.all(o)}(e,o.binDir,n),o}async function ir(e,t,r){let n;switch(process.platform){case"win32":case"darwin":return or(e,t,r);case"linux":He()?n=await Xe("mingw-w64-gcc",e):Ge()?n=await We([{name:"mingw64-gcc",version:e}]):qe()&&(n=await De([{name:"mingw-w64",version:e,repository:"ppa:ubuntu-toolchain-r/test",key:{key:"1E9377A2BA9EF27F",fileName:"ubuntu-toolchain-r-test.gpg"}}]));break;default:throw Error("Unsupported platform for "+r)}if(void 0!==n)return n}function sr(e){const t=OE(e),r=null!==t?AE(t):e;return pe("GCOV",""!==r?"gcov-"+r:"gcov",KR)}async function ar(e,t,r){const{keywords:n,optionalKeywords:o}=function(e,t){const r=[],n=[];switch(e){case"linux":r.push("linux"),aO.includes(t)?(n.push("64"),n.push("x86_64")):(w(`Using arch ${t} for infer`),r.push(t));break;case"darwin":r.push("osx"),aO.includes(t)?n.push("x86_64"):lO.includes(t)?n.push("arm64"):(w(`Using arch ${t} for infer`),r.push(t));break;default:w(`Using ${e} ${t} for infer`),r.push(e,t)}return{keywords:r,optionalKeywords:n}}(t,r),i=tr(await er(wn.join(uR,"github_facebook_infer.json")),{version:e,keywords:n,optionalKeywords:o,filterMapTag:e=>e.replace(/^v/,"")});if(void 0!==i)return{url:`https://github.com/facebook/infer/releases/download/${i.tag}/${i.name}`,extractedFolderName:""+wn.basename(i.name,".tar.xz"),binRelativeDir:"bin",binFileName:Ze("infer")};throw Error(`No asset found for version ${e} matching ${n} and ${o}`)}function cr(e,t,r){const n=function(e,t){switch(e){case"win32":return aO.includes(t)||cO.includes(t)?"win":lO.includes(t)?"winarm64":"win";case"darwin":return"mac";case"linux":return aO.includes(t)||cO.includes(t)?"linux":lO.includes(t)?"linux-aarch64":"linux";default:throw Error(`Unsupported platform '${e}'`)}}(t,r);return{binRelativeDir:"",binFileName:Ze("ninja"),extractedFolderName:"",url:`https://github.com/ninja-build/ninja/releases/download/v${e}/ninja-${n}.zip`}}function lr(e,t,r){return Nt("ninja",e,cr,t,r)}function ur(e){return{url:`https://github.com/SimonKagstrom/kcov/releases/download/${e}/kcov-amd64.tar.gz`,extractedFolderName:"",binRelativeDir:"usr/local/bin",binFileName:Ze("kcov")}}function dr(e){return{url:`https://github.com/SimonKagstrom/kcov/archive/refs/tags/${e}.tar.gz`,extractedFolderName:"",binRelativeDir:"build/src",binFileName:Ze("kcov"),extractFunction:pr}}async function pr(e,t){const r=await xt(e,t,1),n=await async function(){let e=Ny.sync("cmake",{nothrow:!0});if(null===e){const{binDir:t}=await Pt(Ft("cmake",void 0,await nR()),wn.join(le("~"),"cmake"),"");e=wn.join(t,"cmake")}return null===Ny.sync("ninja",{nothrow:!0})&&await lr(Ft("ninja",void 0,await nR()),wn.join(le("~"),"ninja"),""),e}();"linux"===process.platform&&(He()?await Promise.all([Xe("libdwarf"),Xe("libcurl-openssl")]):Ge()?await We([{name:"libdwarf-devel"},{name:"libcurl-devel"}]):qe()&&await De([{name:"libdw-dev"},{name:"libcurl4-openssl-dev"}]));try{if(null!==Ny.sync("patch",{nothrow:!0})){const e=wn.join(dR,"gcc13.patch");await Im("patch",["-N","-p1","-i",e],{cwd:r,stdio:"inherit"})}else w("`patch` not found, skipping gcc13.patch, kcov may not build on gcc 13")}catch{}const o=wn.join(r,"build");return await Im(n,["-S",r,"-B",o,"-DCMAKE_BUILD_TYPE=Release","-G","Ninja"],{cwd:r,stdio:"inherit"}),await Im(n,["--build",o,"--config","Release"],{cwd:r,stdio:"inherit"}),r}async function fr(){"darwin"===process.platform&&(null!==await Ny("clang",{nothrow:!0})&&null!==await Ny("clang++",{nothrow:!0})&&(v("Assuming clang is an Apple Clang compiler"),await Promise.all([pe("CC","clang",KR),pe("CXX","clang++",KR)])),Ln.error("Apple Clang automatic installation is not supported yet"))}function hr(e){return Object.values(TR).includes(e)?e:e in TR?TR[e]:e}function mr(e){if(Object.keys(TR).includes(e))return e;for(const[t,r]of Object.entries(TR))if(r===e)return t;return e}function yr(e){const t=hr(e);let r;if(t){const e=t.split(".")[0]+".9";r=`-version "${t},${e}"`}else r="-latest";let n=function(e,t){try{return(""+gR.execSync(`vswhere -products * ${t} -prerelease -property installationPath`)).trim()+"\\VC\\Auxiliary\\Build\\vcvarsall.bat"}catch(r){yR.warning("vswhere failed: "+r)}return null}(0,r);if(n&&vR.existsSync(n))return yR.info("Found with vswhere: "+n),n;yR.info("Not found with vswhere");const o=e?[mr(e)]:OR;for(const i of _R)for(const e of o)for(const t of SR)if(n=`${i}\\Microsoft Visual Studio\\${e}\\${t}\\VC\\Auxiliary\\Build\\vcvarsall.bat`,yR.info("Trying standard location: "+n),vR.existsSync(n))return yR.info("Found standard location: "+n),n;if(yR.info("Not found in standard locations"),n=ER+"\\Microsoft Visual C++ Build Tools\\vcbuildtools.bat",vR.existsSync(n))return yR.info("Found VS 2015: "+n),n;throw yR.info("Not found in VS 2015 location: "+n),Error("Microsoft Visual Studio not found")}function gr(e){return-1!=["PATH","INCLUDE","LIB","LIBPATH"].indexOf(e.toUpperCase())}async function vr(e,t,r,n,o,i,s){void 0!==t&&await ce(t)&&(w(`Adding ${t} to PATH`),await pe("VCTargetsPath",t,KR)),await NR(function(e){switch(e){case"x32":case"32":case"ia32":return"x86";case"64":return"x64";default:return e}}(r),o,n,i,s,e)}async function wr(e,t,r,n,o,i,s,a=12e5){Jo.startGroup(`Installing ${e} ${t}`);try{await function(e,t){const{milliseconds:r,fallback:n,message:o,customTimers:i={setTimeout:setTimeout,clearTimeout:clearTimeout}}=t;let s;const a=new Promise(((a,c)=>{if("number"!=typeof r||1!==Math.sign(r))throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${r}\``);if(t.signal){const{signal:e}=t;e.aborted&&c(mR(e)),e.addEventListener("abort",(()=>{c(mR(e))}))}if(r===1/0)return void e.then(a,c);const l=new pR;s=i.setTimeout.call(void 0,(()=>{if(n)try{a(n())}catch(t){c(t)}else"function"==typeof e.cancel&&e.cancel(),!1===o?a():o instanceof Error?c(o):(l.message=null!=o?o:`Promise timed out after ${r} milliseconds`,c(l))}),r),(async()=>{try{a(await e)}catch(t){c(t)}})()})).finally((()=>{a.clear()}));return a.clear=()=>{i.clearTimeout.call(void 0,s),s=void 0},a}(async function(e,t,r,n,o,i){const s=VR.includes(e);let a;if("vcvarsall"===e)await vr(Ft(e,t,r),void 0,n,void 0,void 0,!1,!1);else if("brew"===e)a=await je({rcOptions:KR});else{const i=wn.join(o,s?"llvm":e),c=Ft(e,t,r),l=zR[e];a=await l(c,i,n)}i.push(Dr(e,a))}(e,t,r,n,o,i),{milliseconds:a,message:`Timeout while installing ${e} ${t}. You can increase the timeout from options`})}catch(c){y(c),c instanceof Error&&void 0!==c.stack&&y(c.stack),s.push(e+" failed to install")}Jo.endGroup()}async function br(e,t,r){const n=await async function(e,t,r){const{keywords:n,optionalKeywords:o}=await async function(e,t){const r=[],n=[];switch(e){case"win32":aO.includes(t)?r.push("win64"):cO.includes(t)?r.push("win32"):lO.includes(t)?r.push("woa64"):(w(`Using arch ${t} for LLVM`),r.push(t));break;case"linux":if(r.push("linux"),qe()){n.push("ubuntu");const e=await nR();if(null!==e){n.push(""+e[0]);const t=10>e[1]?"0"+e[1]:""+e[1];n.push(`${e[0]}.${t}`),n.push(`${e[0]}.${t}.${e[2]}`)}}else Ge()&&n.push("rhel");aO.includes(t)?r.push("x86_64"):cO.includes(t)?r.push("x86"):lO.includes(t)?r.push("aarch64"):uO.includes(t)?r.push("armv7a"):dO.includes(t)?r.push("powerpc64le"):pO.includes(t)?r.push("sparc64"):(w(`Using arch ${t} for LLVM`),r.push(t));break;case"darwin":r.push("apple"),aO.includes(t)?r.push("x86_64"):lO.includes(t)?n.push("arm64"):(w(`Using arch ${t} for LLVM`),r.push(t));break;case"freebsd":r.push("freebsd"),aO.includes(t)?r.push("amd64"):cO.includes(t)?r.push("i386"):(w(`Using arch ${t} for LLVM`),r.push(t));break;default:w(`Using ${e} ${t} for LLVM`),r.push(e,t)}return{keywords:r,optionalKeywords:n}}(e,t),i=tr(await er(wn.join(PR,"github_llvm_llvm-project.json")),{version:r,keywords:n,optionalKeywords:o,filterMapTag:e=>e.replace(/^llvmorg-/,"")});if(void 0!==i)return`https://github.com/llvm/llvm-project/releases/download/${i.tag}/${i.name}`;const s=tr(await er(wn.join(PR,"llvm_org_releases.json")),{version:r,keywords:n,optionalKeywords:o});if(void 0!==s)return`https://releases.llvm.org/${s.tag}/${s.name}`;throw Error(`No asset found for version ${r} matching ${n} and ${o}`)}(t,r,e);return w("Downloading LLVM from "+n),{url:n,extractedFolderName:"",binRelativeDir:"bin",binFileName:Ze("clang"),extractFunction:"win32"===t?Rt:(e,t)=>xt(e,t,1)}}async function Er(e,t,r){var n;const o=await CR(e,t,r);return await async function(e,t){var r,n;const o=null!=(r=process.env.LD_LIBRARY_PATH)?r:"",i=null!=(n=process.env.DYLD_LIBRARY_PATH)?n:"",s=Tr(t),a=[pe("CC",Ze(e+"/bin/clang"),KR),pe("CXX",Ze(e+"/bin/clang++"),KR),pe("LLVM_PATH",e,KR),pe("LD_LIBRARY_PATH",`${o}${wn.delimiter}${e}/lib`,KR),pe("DYLD_LIBRARY_PATH",`${i}${wn.delimiter}${e}/lib`,KR),pe("LLVM_LDFLAGS","-L"+Ct(e+"/lib"),KR),pe("LLVM_CPPFLAGS","-I"+Ct(e+"/include"),KR),await ce(`${e}/lib/clang/${t}/include`)?pe("LLVM_CPATH",`${e}/lib/clang/${t}/include`,KR):await ce(`${e}/lib/clang/${s}/include`)?pe("LLVM_CPATH",`${e}/lib/clang/${s}/include`,KR):Promise.resolve(),pe("LIBRARY_PATH",e+"/lib",KR),Zt()];if(qe()){const t=60;a.push(Te("cc",e+"/bin/clang",KR,t),Te("cxx",e+"/bin/clang++",KR,t),Te("clang",e+"/bin/clang",KR),Te("clang++",e+"/bin/clang++",KR),Te("lld",e+"/bin/lld",KR),Te("ld.lld",e+"/bin/ld.lld",KR),Te("llvm-ar",e+"/bin/llvm-ar",KR))}await Promise.all(a)}(null!=(n=o.installDir)?n:t,e),o}function _r(e,t,r){return Or(e,t,r,AR.ClangFormat)}function Sr(e,t,r){return Or(e,t,r)}async function Or(e,t,r,n=AR.All){const o=Tr(e);try{if(qe())return await async function(e,t=0){const r="/usr/lib/llvm-"+e;await De([{name:"ca-certificates"}]);const n=new RS.DownloaderHelper("https://apt.llvm.org/llvm.sh",yn.tmpdir(),{fileName:"llvm.sh"});n.on("error",(e=>{throw Error("Failed to download the LLVM installer script: "+e)})),await n.start();const o=await Wm(n.getDownloadPath(),"utf-8"),i=wn.join(yn.tmpdir(),"llvm-setup-cpp.sh"),s=await async function(e,t,r,n){let o=function(e){return"1"!==process.env.NODE_DEBUG&&"true"!==process.env.NODE_DEBUG?e.replace(/set -eux/g,"set -eu"):e}(e);return o=function(e){return e.replace(/add-apt-repository "\${REPO_NAME}"/g,`add-apt-repository -y -n "\${REPO_NAME}"\napt-get update -o ${xS} -y`)}(o),o=function(e,t,r){return 1===e?t.replace(/ -y \$PKG/g," -y clang-format-"+r):t}(n,o,r),o=await async function(e){let t=e.replace(/apt-get install -y/g,`apt-get install -o Dpkg::Options::="--force-overwrite" -o ${xS} -y --fix-broken`);return await Promise.all(["libc++-$LLVM_VERSION-dev","libc++abi-$LLVM_VERSION-dev","libunwind-$LLVM_VERSION-dev"].map((async e=>{const r=e.replace("$LLVM_VERSION","*");await async function(e){try{const{stdout:t}=await Im("dpkg",["-l",e],{env:Re("apt-get"),stdio:"pipe"});return"string"==typeof t&&t.split("\n").some((e=>e.startsWith("ii")))}catch{return!1}}(r)&&(Ln.info("Removing conflicting package "+r),t=t.replace(e,""))}))),t}(o),o=function(e){return Ie()?e.replace(/apt-get/g,"nala"):e}(o),await ny(t,o),[{name:"lsb-release"},{name:"wget"},{name:"software-properties-common"},{name:"gnupg"}]}(o,i,e,t);return await De(s),await km(i,"755"),await z("bash",[i,""+e,...0===t?["all"]:[]],{stdio:"inherit",shell:!0,timeout:12e5}),await he(r+"/bin",KR),{installDir:""+r,binDir:r+"/bin",bin:r+"/bin/clang++"}}(o,n)}catch(s){w("Failed to install llvm via system package manager "+s)}const i=await Nt("llvm",e,br,t,r);return await DR(o),i}function Tr(e){const t=function(e){if(null===OE(e))try{const t=h_(e);if(null!==t)return w(`Coerced version '${e}' to '${t}'`),t.version}catch(t){}return e}(e);return Number.parseInt(t.split(".")[0],10)}async function Rr(){if(Gn.GITHUB_ACTIONS){const e=wn.join($R,"llvm_matcher.json");if(!(await ce(e)))return g("the llvm_matcher.json file does not exist in the same folder as setup-cpp.js");w("::add-matcher::"+e)}}async function Ir(e,t,r,n,o,i){if("win32"!==process.platform)return;const s=RR(e);w(`Checking if MSVC ${s} is already installed`);let a,c,l=!1;try{const e=xR(s);l=!0,w("Found the pre-installed version of MSVC at "+e)}catch{}if(!l)try{"14.0"===s?(a="14.0",await ze("visualcpp-build-tools","14.0.25420.1",["--ignore-dependencies"]),c="C:/Program Files (x86)/MSBuild/Microsoft.Cpp/v4.0/v140"):"15.0"===s?(a="14.16",await ze("visualstudio2017buildtools","15.9.41.0",[]),c="C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16"):"16.0"===s?(a="14.29",await ze("visualstudio2019buildtools","16.11.7.0",[]),c="C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133"):"17.0"===s?(a=void 0,await ze("visualstudio2022buildtools","117.0.5.0",[]),c=void 0):y(`The given MSVC versions ${e} is not supported yet.`)}catch(u){y(u)}await vr(s,c,r,a,n,o,i),Gn.GITHUB_ACTIONS&&await async function(){const e=wn.join(kR,"msvc_matcher.json");if(!(await ce(e)))return g("the msvc_matcher.json file does not exist in the same folder as setup-cpp.js");w("::add-matcher::"+e)}()}async function xr(e,t,r){if("win32"===process.platform)return await ze("opencppcoverage",e),{binDir:await async function(){const e="C:/Program Files/OpenCppCoverage";return await he(e,KR),e}()}}function Nr(e,t,r){return{url:Ar(t,r,e),binRelativeDir:"",binFileName:Ze("pwsh"),extractedFolderName:""}}function Ar(e,t,r){var n;switch(e){case"win32":return`https://github.com/PowerShell/PowerShell/releases/download/v${r}/PowerShell-${r}-${["ia32","x86","i386","x32"].includes(t)?"win-x86":"win-x64"}.zip`;case"darwin":return`https://github.com/PowerShell/PowerShell/releases/download/v${r}/powershell-${r}-${["arm","arm64"].includes(t)?"osx-arm64":"osx-x64"}.tar.gz`;case"linux":return`https://github.com/PowerShell/PowerShell/releases/download/v${r}/powershell-${r}-${null!=(n={arm64:"linux-arm64",arm:"linux-arm64",arm32:"linux-arm32",aarch64:"linux-arm64",x64:"linux-x64"}[t])?n:"linux-x64"}.tar.gz`;default:throw Error(`Unsupported platform '${e}'`)}}async function Pr(e,t,r){try{return await Nt("pwsh",e,Nr,t,r)}catch(n){return y(`Failed to setup pwsh via download: ${n}. Trying package managers...`),async function(e){switch(process.platform){case"win32":{await ze("powershell-core",e);const t="C:/Program Files/PowerShell/7";return await he(t,KR),{binDir:t}}case"darwin":return Be("powershell",e,{cask:!0,overwrite:!1});case"linux":if(He())return Xe("powershell-bin",e,"yay");if(Ge())return await We([{name:"curl"}]),V("/bin/bash",["-c","curl https://packages.microsoft.com/config/rhel/8/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo"]),We([{name:"powershell",version:e}]);if(qe()){await De([{name:"curl"}]);const t=await nR();return V("curl",["-LJO",`https://packages.microsoft.com/config/ubuntu/${t[0]}.0${t[1]}/packages-microsoft-prod.deb`]),V("dpkg",["-i","packages-microsoft-prod.deb"]),De([{name:"powershell",version:e}],!0)}throw Error("Unsupported linux distribution");default:throw Error("Unsupported platform")}}(e)}}function $r(e,t,r){const n=function(e){return"win32"===e?"windows":e}(t),o=function(e){switch(e){case"x64":return"amd64";case"ia32":case"x86":case"i386":case"x32":return"386";default:return e}}(r),i="win32"===t?"zip":"tar.gz";return{binRelativeDir:"",binFileName:Ze("task"),extractedFolderName:"",url:`https://github.com/go-task/task/releases/download/v${e}/task_${n}_${o}.${i}`}}function Cr(e){const t=Jo.getInput(e.toLowerCase());if("false"!==t&&""!==t)return t}function Dr(e,t){let r=`✅ ${e} was installed successfully:`;return void 0===t||("installDir"in t&&(r+="\n- The installation directory is "+t.installDir),""!==t.binDir&&(r+="\n- The binary directory is "+t.binDir)),r}var Lr,kr,Mr,jr,Ur,Fr,Br,Gr,Hr,qr,Vr,zr,Wr,Xr,Kr,Yr,Jr,Qr,Zr,en,tn,rn,nn,on,sn,an,cn,ln,un=e=>{throw TypeError(e)},dn=(e,t,r)=>t.has(e)||un("Cannot "+r),pn=(e,t,r)=>(dn(e,t,"read from private field"),r?r.call(e):t.get(e)),fn=(e,t,r)=>t.has(e)?un("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),hn=(e,t,r,n)=>(dn(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),mn=(e,t,r)=>(dn(e,t,"access private method"),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const yn=require("os"),gn=require("fs"),vn=require("crypto"),wn=require("path"),bn=require("http"),En=require("https");require("net");const _n=require("tls"),Sn=require("events"),On=require("util"),Tn=require("url"),Rn=require("child_process"),In=require("string_decoder"),xn=require("process"),Nn=require("tty"),An=require("v8"),Pn=require("stream"),$n=require("buffer"),Cn=require("assert"),Dn=require("timers"),Ln=require("console");var kn="undefined"!=typeof document?document.currentScript:null;const Mn=e(gn),jn=e(bn),Un=e(En),Fn=e(Pn);var Bn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Gn={};const Hn=[{name:"Agola CI",constant:"AGOLA",env:"AGOLA_GIT_REF",pr:"AGOLA_PULL_REQUEST_ID"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE"},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN"},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Earthly",constant:"EARTHLY",env:"EARTHLY_CI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"Gitea Actions",constant:"GITEA_ACTIONS",env:"GITEA_ACTIONS"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Google Cloud Build",constant:"GOOGLE_CLOUD_BUILD",env:"BUILDER_OUTPUT"},{name:"Harness CI",constant:"HARNESS",env:"HARNESS_BUILD_ID"},{name:"Heroku",constant:"HEROKU",env:{env:"NODE",includes:"/app/.heroku/node/bin/node"}},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"Prow",constant:"PROW",env:"PROW_JOB_ID"},{name:"ReleaseHub",constant:"RELEASEHUB",env:"RELEASE_BUILD_ID"},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Sourcehut",constant:"SOURCEHUT",env:{CI_NAME:"sourcehut"}},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vela",constant:"VELA",env:"VELA",pr:{VELA_PULL_REQUEST:"1"}},{name:"Vercel",constant:"VERCEL",env:{any:["NOW_BUILDER","VERCEL"]},pr:"VERCEL_GIT_PULL_REQUEST_ID"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"},{name:"Woodpecker",constant:"WOODPECKER",env:{CI:"woodpecker"},pr:{CI_BUILD_EVENT:"pull_request"}},{name:"Xcode Cloud",constant:"XCODE_CLOUD",env:"CI_XCODE_PROJECT",pr:"CI_PULL_REQUEST_NUMBER"},{name:"Xcode Server",constant:"XCODE_SERVER",env:"XCS"}];!function(e){function t(e){return"string"==typeof e?!!n[e]:"env"in e?n[e.env]&&n[e.env].includes(e.includes):"any"in e?e.any.some((function(e){return!!n[e]})):Object.keys(e).every((function(t){return n[t]===e[t]}))}const r=Hn,n=process.env;Object.defineProperty(e,"_vendors",{value:r.map((function(e){return e.constant}))}),e.name=null,e.isPR=null,r.forEach((function(r){const o=(Array.isArray(r.env)?r.env:[r.env]).every((function(e){return t(e)}));if(e[r.constant]=o,o)switch(e.name=r.name,typeof r.pr){case"string":e.isPR=!!n[r.pr];break;case"object":e.isPR="env"in r.pr?r.pr.env in n&&n[r.pr.env]!==r.pr.ne:"any"in r.pr?r.pr.any.some((function(e){return!!n[e]})):t(r.pr);break;default:e.isPR=null}})),e.isCI=!("false"===n.CI||!(n.BUILD_ID||n.BUILD_NUMBER||n.CI||n.CI_APP_ID||n.CI_BUILD_ID||n.CI_BUILD_NUMBER||n.CI_NAME||n.CONTINUOUS_INTEGRATION||n.RUN_ID||e.name))}(Gn);var qn={},Vn={},zn={};Object.defineProperty(zn,"__esModule",{value:!0}),zn.toCommandProperties=zn.toCommandValue=void 0,zn.toCommandValue=function(e){return null==e?"":"string"==typeof e||e instanceof String?e:JSON.stringify(e)},zn.toCommandProperties=function(e){return Object.keys(e).length?{title:e.title,file:e.file,line:e.startLine,endLine:e.endLine,col:e.startColumn,endColumn:e.endColumn}:{}};var Wn=Bn&&Bn.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),Xn=Bn&&Bn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Kn=Bn&&Bn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&Wn(t,e,r);return Xn(t,e),t};Object.defineProperty(Vn,"__esModule",{value:!0}),Vn.issue=Vn.issueCommand=void 0;const Yn=Kn(yn),Jn=zn;Vn.issueCommand=n,Vn.issue=function(e,t=""){n(e,{},t)};class Qn{constructor(e,t,r){e||(e="missing.command"),this.command=e,this.properties=t,this.message=r}toString(){let e="::"+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";let r=!0;for(const n in this.properties)if(this.properties.hasOwnProperty(n)){const o=this.properties[n];o&&(r?r=!1:e+=",",e+=`${n}=${t=o,Jn.toCommandValue(t).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}`)}}var t;return e+="::"+function(e){return Jn.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}(this.message),e}}var Zn={};const eo=new Uint8Array(256);let to=eo.length;const ro=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,no=[];for(let JR=0;256>JR;++JR)no.push((JR+256).toString(16).substr(1));let oo,io,so=0,ao=0;const co=c("v3",48,(function(e){return Array.isArray(e)?e=Buffer.from(e):"string"==typeof e&&(e=Buffer.from(e,"utf8")),vn.createHash("md5").update(e).digest()})),lo=c("v5",80,(function(e){return Array.isArray(e)?e=Buffer.from(e):"string"==typeof e&&(e=Buffer.from(e,"utf8")),vn.createHash("sha1").update(e).digest()})),uo=Object.freeze(Object.defineProperty({__proto__:null,NIL:"00000000-0000-0000-0000-000000000000",parse:a,stringify:s,v1:function(e,t,r){let n=t&&r||0;const i=t||Array(16);let a=(e=e||{}).node||oo,c=void 0!==e.clockseq?e.clockseq:io;if(null==a||null==c){const t=e.random||(e.rng||o)();null==a&&(a=oo=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==c&&(c=io=16383&(t[6]<<8|t[7]))}let l=void 0!==e.msecs?e.msecs:Date.now(),u=void 0!==e.nsecs?e.nsecs:ao+1;const d=l-so+(u-ao)/1e4;if(0>d&&void 0===e.clockseq&&(c=c+1&16383),(0>d||l>so)&&void 0===e.nsecs&&(u=0),u>=1e4)throw Error("uuid.v1(): Can't create more than 10M uuids/sec");so=l,ao=u,io=c,l+=122192928e5;const p=(1e4*(268435455&l)+u)%4294967296;i[n++]=p>>>24&255,i[n++]=p>>>16&255,i[n++]=p>>>8&255,i[n++]=255&p;const f=l/4294967296*1e4&268435455;i[n++]=f>>>8&255,i[n++]=255&f,i[n++]=f>>>24&15|16,i[n++]=f>>>16&255,i[n++]=c>>>8|128,i[n++]=255&c;for(let o=0;6>o;++o)i[n+o]=a[o];return t||s(i)},v3:co,v4:function(e,t,r){const n=(e=e||{}).random||(e.rng||o)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;16>e;++e)t[r+e]=n[e];return t}return s(n)},v5:lo,validate:i,version:function(e){if(!i(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}},Symbol.toStringTag,{value:"Module"})),po=r(uo);var fo=Bn&&Bn.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),ho=Bn&&Bn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),mo=Bn&&Bn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&fo(t,e,r);return ho(t,e),t};Object.defineProperty(Zn,"__esModule",{value:!0}),Zn.prepareKeyValueMessage=Zn.issueFileCommand=void 0;const yo=mo(gn),go=mo(yn),vo=po,wo=zn;Zn.issueFileCommand=function(e,t){const r=process.env["GITHUB_"+e];if(!r)throw Error("Unable to find environment variable for file command "+e);if(!yo.existsSync(r))throw Error("Missing file at path: "+r);yo.appendFileSync(r,`${wo.toCommandValue(t)}${go.EOL}`,{encoding:"utf8"})},Zn.prepareKeyValueMessage=function(e,t){const r="ghadelimiter_"+vo.v4(),n=wo.toCommandValue(t);if(e.includes(r))throw Error(`Unexpected input: name should not contain the delimiter "${r}"`);if(n.includes(r))throw Error(`Unexpected input: value should not contain the delimiter "${r}"`);return`${e}<<${r}${go.EOL}${n}${go.EOL}${r}`};var bo={};class Eo extends URL{_decodedUsername;_decodedPassword;constructor(e,t){super(e,t),this._decodedUsername=decodeURIComponent(super.username),this._decodedPassword=decodeURIComponent(super.password)}get username(){return this._decodedUsername}get password(){return this._decodedPassword}}var _o,So={},Oo=_n,To=bn,Ro=En,Io=Sn,xo=On;So.httpOverHttp=function(e){var t=new u(e);return t.request=To.request,t},So.httpsOverHttp=function(e){var t=new u(e);return t.request=To.request,t.createSocket=d,t.defaultPort=443,t},So.httpOverHttps=function(e){var t=new u(e);return t.request=Ro.request,t},So.httpsOverHttps=function(e){var t=new u(e);return t.request=Ro.request,t.createSocket=d,t.defaultPort=443,t},xo.inherits(u,Io.EventEmitter),u.prototype.addRequest=function(e,t,r,n){var o=this,i=f({request:e},o.options,p(t,r,n));this.maxSockets>o.sockets.length?o.createSocket(i,(function(t){function r(){o.emit("free",t,i)}function n(e){o.removeSocket(t),t.removeListener("free",r),t.removeListener("close",n),t.removeListener("agentRemove",n)}t.on("free",r),t.on("close",n),t.on("agentRemove",n),e.onSocket(t)})):o.requests.push(i)},u.prototype.createSocket=function(e,t){function r(r,i,a){var c;return s.removeAllListeners(),i.removeAllListeners(),200!==r.statusCode?(_o("tunneling socket could not be established, statusCode=%d",r.statusCode),i.destroy(),(c=Error("tunneling socket could not be established, statusCode="+r.statusCode)).code="ECONNRESET",e.request.emit("error",c),void n.removeSocket(o)):a.length>0?(_o("got illegal response body from proxy"),i.destroy(),(c=Error("got illegal response body from proxy")).code="ECONNRESET",e.request.emit("error",c),void n.removeSocket(o)):(_o("tunneling connection has established"),n.sockets[n.sockets.indexOf(o)]=i,t(i))}var n=this,o={};n.sockets.push(o);var i=f({},n.proxyOptions,{method:"CONNECT",path:e.host+":"+e.port,agent:!1,headers:{host:e.host+":"+e.port}});e.localAddress&&(i.localAddress=e.localAddress),i.proxyAuth&&(i.headers=i.headers||{},i.headers["Proxy-Authorization"]="Basic "+new Buffer(i.proxyAuth).toString("base64")),_o("making CONNECT request");var s=n.request(i);s.useChunkedEncodingByDefault=!1,s.once("response",(function(e){e.upgrade=!0})),s.once("upgrade",(function(e,t,n){process.nextTick((function(){r(e,t,n)}))})),s.once("connect",r),s.once("error",(function(t){s.removeAllListeners(),_o("tunneling socket could not be established, cause=%s\n",t.message,t.stack);var r=Error("tunneling socket could not be established, cause="+t.message);r.code="ECONNRESET",e.request.emit("error",r),n.removeSocket(o)})),s.end()},u.prototype.removeSocket=function(e){var t=this.sockets.indexOf(e);if(-1!==t){this.sockets.splice(t,1);var r=this.requests.shift();r&&this.createSocket(r,(function(e){r.request.onSocket(e)}))}},_o=process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?function(){var e=[].slice.call(arguments);"string"==typeof e[0]?e[0]="TUNNEL: "+e[0]:e.unshift("TUNNEL:"),console.error.apply(console,e)}:function(){},So.debug=_o;var No,Ao,Po,$o,Co,Do=So;(Ao=No||(No={}))[Ao.OK=200]="OK",Ao[Ao.MultipleChoices=300]="MultipleChoices",Ao[Ao.MovedPermanently=301]="MovedPermanently",Ao[Ao.ResourceMoved=302]="ResourceMoved",Ao[Ao.SeeOther=303]="SeeOther",Ao[Ao.NotModified=304]="NotModified",Ao[Ao.UseProxy=305]="UseProxy",Ao[Ao.SwitchProxy=306]="SwitchProxy",Ao[Ao.TemporaryRedirect=307]="TemporaryRedirect",Ao[Ao.PermanentRedirect=308]="PermanentRedirect",Ao[Ao.BadRequest=400]="BadRequest",Ao[Ao.Unauthorized=401]="Unauthorized",Ao[Ao.PaymentRequired=402]="PaymentRequired",Ao[Ao.Forbidden=403]="Forbidden",Ao[Ao.NotFound=404]="NotFound",Ao[Ao.MethodNotAllowed=405]="MethodNotAllowed",Ao[Ao.NotAcceptable=406]="NotAcceptable",Ao[Ao.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",Ao[Ao.RequestTimeout=408]="RequestTimeout",Ao[Ao.Conflict=409]="Conflict",Ao[Ao.Gone=410]="Gone",Ao[Ao.TooManyRequests=429]="TooManyRequests",Ao[Ao.InternalServerError=500]="InternalServerError",Ao[Ao.NotImplemented=501]="NotImplemented",Ao[Ao.BadGateway=502]="BadGateway",Ao[Ao.ServiceUnavailable=503]="ServiceUnavailable",Ao[Ao.GatewayTimeout=504]="GatewayTimeout",($o=Po||(Po={})).Accept="accept",$o.ContentType="content-type",(Co||(Co={})).ApplicationJson="application/json";const Lo=[No.MovedPermanently,No.ResourceMoved,No.SeeOther,No.TemporaryRedirect,No.PermanentRedirect],ko=[No.BadGateway,No.ServiceUnavailable,No.GatewayTimeout],Mo=["OPTIONS","GET","DELETE","HEAD"];class jo extends Error{constructor(e,t){super(e),this.name="HttpClientError",this.statusCode=t,Object.setPrototypeOf(this,jo.prototype)}statusCode;result}class Uo{constructor(e){this.message=e}message;async readBody(){return new Promise((async e=>{let t=Buffer.alloc(0);this.message.on("data",(e=>{t=Buffer.concat([t,e])})),this.message.on("end",(()=>{e(""+t)}))}))}async readBodyBuffer(){return new Promise((async e=>{const t=[];this.message.on("data",(e=>{t.push(e)})),this.message.on("end",(()=>{e(Buffer.concat(t))}))}))}}class Fo{userAgent;handlers;requestOptions;_ignoreSslError=!1;_socketTimeout;_allowRedirects=!0;_allowRedirectDowngrade=!1;_maxRedirects=50;_allowRetries=!1;_maxRetries=1;_agent;_proxyAgent;_proxyAgentDispatcher;_keepAlive=!1;_disposed=!1;constructor(e,t,r){this.userAgent=e,this.handlers=t||[],this.requestOptions=r,r&&(null!=r.ignoreSslError&&(this._ignoreSslError=r.ignoreSslError),this._socketTimeout=r.socketTimeout,null!=r.allowRedirects&&(this._allowRedirects=r.allowRedirects),null!=r.allowRedirectDowngrade&&(this._allowRedirectDowngrade=r.allowRedirectDowngrade),null!=r.maxRedirects&&(this._maxRedirects=Math.max(r.maxRedirects,0)),null!=r.keepAlive&&(this._keepAlive=r.keepAlive),null!=r.allowRetries&&(this._allowRetries=r.allowRetries),null!=r.maxRetries&&(this._maxRetries=r.maxRetries))}async options(e,t){return this.request("OPTIONS",e,null,t||{})}async get(e,t){return this.request("GET",e,null,t||{})}async del(e,t){return this.request("DELETE",e,null,t||{})}async post(e,t,r){return this.request("POST",e,t,r||{})}async patch(e,t,r){return this.request("PATCH",e,t,r||{})}async put(e,t,r){return this.request("PUT",e,t,r||{})}async head(e,t){return this.request("HEAD",e,null,t||{})}async sendStream(e,t,r,n){return this.request(e,t,r,n)}async getJson(e,t={}){t[Po.Accept]=this._getExistingOrDefaultHeader(t,Po.Accept,Co.ApplicationJson);const r=await this.get(e,t);return this._processResponse(r,this.requestOptions)}async postJson(e,t,r={}){const n=JSON.stringify(t,null,2);r[Po.Accept]=this._getExistingOrDefaultHeader(r,Po.Accept,Co.ApplicationJson),r[Po.ContentType]=this._getExistingOrDefaultHeader(r,Po.ContentType,Co.ApplicationJson);const o=await this.post(e,n,r);return this._processResponse(o,this.requestOptions)}async putJson(e,t,r={}){const n=JSON.stringify(t,null,2);r[Po.Accept]=this._getExistingOrDefaultHeader(r,Po.Accept,Co.ApplicationJson),r[Po.ContentType]=this._getExistingOrDefaultHeader(r,Po.ContentType,Co.ApplicationJson);const o=await this.put(e,n,r);return this._processResponse(o,this.requestOptions)}async patchJson(e,t,r={}){const n=JSON.stringify(t,null,2);r[Po.Accept]=this._getExistingOrDefaultHeader(r,Po.Accept,Co.ApplicationJson),r[Po.ContentType]=this._getExistingOrDefaultHeader(r,Po.ContentType,Co.ApplicationJson);const o=await this.patch(e,n,r);return this._processResponse(o,this.requestOptions)}async request(e,t,r,n){if(this._disposed)throw Error("Client has already been disposed.");const o=new URL(t);let i=this._prepareRequest(e,o,n);const s=this._allowRetries&&Mo.includes(e)?this._maxRetries+1:1;let a,c=0;do{if(a=await this.requestRaw(i,r),a&&a.message&&a.message.statusCode===No.Unauthorized){let e;for(const t of this.handlers)if(t.canHandleAuthentication(a)){e=t;break}return e?e.handleAuthentication(this,i,r):a}let t=this._maxRedirects;for(;a.message.statusCode&&Lo.includes(a.message.statusCode)&&this._allowRedirects&&t>0;){const s=a.message.headers.location;if(!s)break;const c=new URL(s);if("https:"===o.protocol&&o.protocol!==c.protocol&&!this._allowRedirectDowngrade)throw Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.");if(await a.readBody(),c.hostname!==o.hostname)for(const e in n)"authorization"===e.toLowerCase()&&delete n[e];i=this._prepareRequest(e,c,n),a=await this.requestRaw(i,r),t--}if(!a.message.statusCode||!ko.includes(a.message.statusCode))return a;c+=1,s>c&&(await a.readBody(),await this._performExponentialBackoff(c))}while(s>c);return a}dispose(){this._agent&&this._agent.destroy(),this._disposed=!0}async requestRaw(e,t){return new Promise(((r,n)=>{this.requestRawWithCallback(e,t,(function(e,t){e?n(e):t?r(t):n(Error("Unknown error"))}))}))}requestRawWithCallback(e,t,r){function n(e,t){o||(o=!0,r(e,t))}"string"==typeof t&&(e.options.headers||(e.options.headers={}),e.options.headers["Content-Length"]=Buffer.byteLength(t,"utf8"));let o=!1;const i=e.httpModule.request(e.options,(e=>{n(void 0,new Uo(e))}));let s;i.on("socket",(e=>{s=e})),i.setTimeout(this._socketTimeout||18e4,(()=>{s&&s.end(),n(Error("Request timeout: "+e.options.path))})),i.on("error",(function(e){n(e)})),t&&"string"==typeof t&&i.write(t,"utf8"),t&&"string"!=typeof t?(t.on("close",(function(){i.end()})),t.pipe(i)):i.end()}getAgent(e){const t=new URL(e);return this._getAgent(t)}async getAgentDispatcher(e){const t=new URL(e),r=l(t);if(r&&r.hostname)return await this._getProxyAgentDispatcher(t,r)}_prepareRequest(e,t,r){const n={};n.parsedUrl=t;const o="https:"===n.parsedUrl.protocol;n.httpModule=o?Un:jn;const i=o?443:80;if(n.options={},n.options.host=n.parsedUrl.hostname,n.options.port=n.parsedUrl.port?parseInt(n.parsedUrl.port):i,n.options.path=(n.parsedUrl.pathname||"")+(n.parsedUrl.search||""),n.options.method=e,n.options.headers=this._mergeHeaders(r),null!=this.userAgent&&(n.options.headers["user-agent"]=this.userAgent),n.options.agent=this._getAgent(n.parsedUrl),this.handlers)for(const s of this.handlers)s.prepareRequest(n.options);return n}_mergeHeaders(e){return this.requestOptions&&this.requestOptions.headers?Object.assign({},Bo(this.requestOptions.headers),Bo(e||{})):Bo(e||{})}_getExistingOrDefaultHeader(e,t,r){let n;return this.requestOptions&&this.requestOptions.headers&&(n=Bo(this.requestOptions.headers)[t]),e[t]||n||r}_getAgent(e){let t;const r=l(e),n=r&&r.hostname;if(this._keepAlive&&n&&(t=this._proxyAgent),n||(t=this._agent),t)return t;const o="https:"===e.protocol;let i=100;if(this.requestOptions&&(i=this.requestOptions.maxSockets||jn.globalAgent.maxSockets),r&&r.hostname){const e={maxSockets:i,keepAlive:this._keepAlive,proxy:{...(r.username||r.password)&&{proxyAuth:`${r.username}:${r.password}`},host:r.hostname,port:r.port}};let n;const s="https:"===r.protocol;n=o?s?Do.httpsOverHttps:Do.httpsOverHttp:s?Do.httpOverHttps:Do.httpOverHttp,t=n(e),this._proxyAgent=t}if(!t){const e={keepAlive:this._keepAlive,maxSockets:i};t=o?new Un.Agent(e):new jn.Agent(e),this._agent=t}return o&&this._ignoreSslError&&(t.options=Object.assign(t.options||{},{rejectUnauthorized:!1})),t}async _getProxyAgentDispatcher(e,t){let r;if(this._keepAlive&&(r=this._proxyAgentDispatcher),r)return r;const n="https:"===e.protocol;return r=new(await Promise.resolve().then((()=>require("./assets/proxy-agent-BtRxTz9r.js"))).then((e=>e.proxyAgent)))({uri:t.href,pipelining:this._keepAlive?1:0,...(t.username||t.password)&&{token:"Basic "+Buffer.from(`${t.username}:${t.password}`).toString("base64")}}),this._proxyAgentDispatcher=r,n&&this._ignoreSslError&&(r.options=Object.assign(r.options.requestTls||{},{rejectUnauthorized:!1})),r}async _performExponentialBackoff(e){const t=5*Math.pow(2,e=Math.min(10,e));return new Promise((e=>setTimeout((()=>e()),t)))}async _processResponse(e,t){return new Promise((async(r,n)=>{const o=e.message.statusCode||0,i={statusCode:o,result:null,headers:{}};let s,a;o===No.NotFound&&r(i);try{a=await e.readBody(),a&&a.length>0&&(s=t&&t.deserializeDates?JSON.parse(a,(function(e,t){if("string"==typeof t){const e=new Date(t);if(!isNaN(e.valueOf()))return e}return t})):JSON.parse(a),i.result=s),i.headers=e.message.headers}catch(c){}if(o>299){let e;e=s&&s.message?s.message:a&&a.length>0?a:`Failed request: (${o})`;const t=new jo(e,o);t.result=i.result,n(t)}else r(i)}))}}const Bo=e=>Object.keys(e).reduce(((t,r)=>(t[r.toLowerCase()]=e[r],t)),{}),Go=r(Object.freeze(Object.defineProperty({__proto__:null,get Headers(){return Po},HttpClient:Fo,HttpClientError:jo,HttpClientResponse:Uo,get HttpCodes(){return No},get MediaTypes(){return Co},getProxyUrl:function(e){const t=l(new URL(e));return t?t.href:""},isHttps:function(e){return"https:"===new URL(e).protocol}},Symbol.toStringTag,{value:"Module"})));var Ho,qo={},Vo=Bn&&Bn.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(t){i(t)}}function a(e){try{c(n.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(qo,"__esModule",{value:!0}),qo.PersonalAccessTokenCredentialHandler=qo.BearerCredentialHandler=qo.BasicCredentialHandler=void 0,qo.BasicCredentialHandler=class{constructor(e,t){this.username=e,this.password=t}prepareRequest(e){if(!e.headers)throw Error("The request has no headers");e.headers.Authorization="Basic "+Buffer.from(`${this.username}:${this.password}`).toString("base64")}canHandleAuthentication(){return!1}handleAuthentication(){return Vo(this,void 0,void 0,(function*(){throw Error("not implemented")}))}},qo.BearerCredentialHandler=class{constructor(e){this.token=e}prepareRequest(e){if(!e.headers)throw Error("The request has no headers");e.headers.Authorization="Bearer "+this.token}canHandleAuthentication(){return!1}handleAuthentication(){return Vo(this,void 0,void 0,(function*(){throw Error("not implemented")}))}},qo.PersonalAccessTokenCredentialHandler=class{constructor(e){this.token=e}prepareRequest(e){if(!e.headers)throw Error("The request has no headers");e.headers.Authorization="Basic "+Buffer.from("PAT:"+this.token).toString("base64")}canHandleAuthentication(){return!1}handleAuthentication(){return Vo(this,void 0,void 0,(function*(){throw Error("not implemented")}))}};var zo,Wo,Xo,Ko={},Yo={},Jo=m();const Qo=(e,t)=>{const r=Zo(e);if("string"!=typeof r)throw new TypeError(`${t} must be a string or a file URL: ${r}.`);return r},Zo=e=>e instanceof URL?Tn.fileURLToPath(e):e,ei=(e,t=[],r={})=>{const n=Qo(e,"First argument"),[o,i]=b(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((e=>"object"==typeof e&&null!==e)))throw new TypeError("Second argument must be an array of strings: "+o);const s=o.map(String),a=s.find((e=>e.includes("\0")));if(void 0!==a)throw new TypeError('Arguments cannot contain null bytes ("\\0"): '+a);if(!b(i))throw new TypeError("Last argument must be an options object: "+i);return[n,s,i]},{toString:ti}=Object.prototype,ri=e=>"[object Uint8Array]"===ti.call(e),ni=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),oi=new TextEncoder,ii=e=>oi.encode(e),si=new TextDecoder,ai=e=>si.decode(e),ci=e=>1===e.length&&ri(e[0])?e[0]:ui(li(e)),li=e=>e.map((e=>"string"==typeof e?ii(e):e)),ui=e=>{const t=new Uint8Array(di(e));let r=0;for(const n of e)t.set(n,r),r+=n.length;return t},di=e=>{let t=0;for(const r of e)t+=r.length;return t},pi=({templates:e,expressions:t,tokens:r,index:n,template:o})=>{if(void 0===o)throw new TypeError("Invalid backslash sequence: "+e.raw[n]);const{nextTokens:i,leadingWhitespaces:s,trailingWhitespaces:a}=fi(o,e.raw[n]),c=yi(r,i,s);if(n===t.length)return c;const l=t[n],u=Array.isArray(l)?l.map((e=>gi(e))):[gi(l)];return yi(c,u,a)},fi=(e,t)=>{var r;if(0===t.length)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};const n=[];let o=0;const i=hi.has(t[0]);for(let a=0,c=0;e.length>a;a+=1,c+=1){const i=t[c];if(hi.has(i))o!==a&&n.push(e.slice(o,a)),o=a+1;else if("\\"===i){const e=t[c+1];"u"===e&&"{"===t[c+2]?c=t.indexOf("}",c+3):c+=null!=(r=mi[e])?r:1}}const s=o===e.length;return s||n.push(e.slice(o)),{nextTokens:n,leadingWhitespaces:i,trailingWhitespaces:s}},hi=new Set([" ","\t","\r","\n"]),mi={x:3,u:5},yi=(e,t,r)=>r||0===e.length||0===t.length?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],gi=e=>{const t=typeof e;if("string"===t)return e;if("number"===t)return e+"";if(b(e)&&("stdout"in e||"isMaxBuffer"in e))return vi(e);if(e instanceof Rn.ChildProcess||"[object Promise]"==={}.toString.call(e))throw new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.");throw new TypeError(`Unexpected "${t}" in template expression`)},vi=({stdout:e})=>{if("string"==typeof e)return e;if(ri(e))return ai(e);if(void 0===e)throw new TypeError('Missing result.stdout in template expression. This is probably due to the previous subprocess\' "stdout" option.');throw new TypeError(`Unexpected "${typeof e}" stdout in template expression`)},wi=e=>bi.includes(e),bi=[xn.stdin,xn.stdout,xn.stderr],Ei=["stdin","stdout","stderr"],_i=e=>{var t;return null!=(t=Ei[e])?t:`stdio[${e}]`},Si=(e,t)=>{const r=Array.from({length:Oi(e)+1}),n=Ti(e[t],r,t);return $i(n,t)},Oi=({stdio:e})=>Array.isArray(e)?Math.max(e.length,Ei.length):Ei.length,Ti=(e,t,r)=>b(e)?Ri(e,t,r):t.fill(e),Ri=(e,t,r)=>{for(const n of Object.keys(e).sort(Ii))for(const o of Ni(n,r,t))t[o]=e[n];return t},Ii=(e,t)=>xi(e)"stdout"===e||"stderr"===e?0:"all"===e?2:1,Ni=(e,t,r)=>{if("ipc"===e)return[r.length-1];const n=Ai(e);if(void 0===n||0===n)throw new TypeError(`"${t}.${e}" is invalid.\nIt 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.\nPlease set the "stdio" option to ensure that file descriptor exists.`);return"all"===n?[1,2]:[n]},Ai=e=>{if("all"===e)return e;if(Ei.includes(e))return Ei.indexOf(e);const t=Pi.exec(e);return null!==t?Number(t[1]):void 0},Pi=/^fd(\d+)$/,$i=(e,t)=>e.map((e=>void 0===e?Ci[t]:e)),Ci={lines:!1,buffer:!0,maxBuffer:1e8,verbose:On.debuglog("execa").enabled?"full":"none",stripFinalNewline:!0},Di=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],Li=(e,t)=>"ipc"===t?e.at(-1):e[t],ki=({verbose:e},t)=>"none"!==ji(e,t),Mi=({verbose:e},t)=>!["none","short"].includes(ji(e,t)),ji=(e,t)=>void 0===t?Ui(e):Li(e,t),Ui=e=>{var t;return null!=(t=e.find((e=>Fi(e))))?t:Bi.findLast((t=>e.includes(t)))},Fi=e=>"function"==typeof e,Bi=["none","short","full"],Gi=e=>On.stripVTControlCharacters(e).split("\n").map((e=>Hi(e))).join("\n"),Hi=e=>e.replaceAll(Vi,(e=>qi(e))),qi=e=>{const t=zi[e];if(void 0!==t)return t;const r=e.codePointAt(0),n=r.toString(16);return r>Wi?"\\U"+n:"\\u"+n.padStart(4,"0")},Vi=(()=>{try{return RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}})(),zi={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},Wi=65535,Xi=/^[\w./-]+$/,Ki={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"█",squareDarkShade:"▓",squareMediumShade:"▒",squareLightShade:"░",squareTop:"▀",squareBottom:"▄",squareLeft:"▌",squareRight:"▐",squareCenter:"■",bullet:"●",dot:"․",ellipsis:"…",pointerSmall:"›",triangleUp:"▲",triangleUpSmall:"▴",triangleDown:"▼",triangleDownSmall:"▾",triangleLeftSmall:"◂",triangleRightSmall:"▸",home:"⌂",heart:"♥",musicNote:"♪",musicNoteBeamed:"♫",arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",arrowLeftRight:"↔",arrowUpDown:"↕",almostEqual:"≈",notEqual:"≠",lessOrEqual:"≤",greaterOrEqual:"≥",identical:"≡",infinity:"∞",subscriptZero:"₀",subscriptOne:"₁",subscriptTwo:"₂",subscriptThree:"₃",subscriptFour:"₄",subscriptFive:"₅",subscriptSix:"₆",subscriptSeven:"₇",subscriptEight:"₈",subscriptNine:"₉",oneHalf:"½",oneThird:"⅓",oneQuarter:"¼",oneFifth:"⅕",oneSixth:"⅙",oneEighth:"⅛",twoThirds:"⅔",twoFifths:"⅖",threeQuarters:"¾",threeFifths:"⅗",threeEighths:"⅜",fourFifths:"⅘",fiveSixths:"⅚",fiveEighths:"⅝",sevenEighths:"⅞",line:"─",lineBold:"━",lineDouble:"═",lineDashed0:"┄",lineDashed1:"┅",lineDashed2:"┈",lineDashed3:"┉",lineDashed4:"╌",lineDashed5:"╍",lineDashed6:"╴",lineDashed7:"╶",lineDashed8:"╸",lineDashed9:"╺",lineDashed10:"╼",lineDashed11:"╾",lineDashed12:"−",lineDashed13:"–",lineDashed14:"‐",lineDashed15:"⁃",lineVertical:"│",lineVerticalBold:"┃",lineVerticalDouble:"║",lineVerticalDashed0:"┆",lineVerticalDashed1:"┇",lineVerticalDashed2:"┊",lineVerticalDashed3:"┋",lineVerticalDashed4:"╎",lineVerticalDashed5:"╏",lineVerticalDashed6:"╵",lineVerticalDashed7:"╷",lineVerticalDashed8:"╹",lineVerticalDashed9:"╻",lineVerticalDashed10:"╽",lineVerticalDashed11:"╿",lineDownLeft:"┐",lineDownLeftArc:"╮",lineDownBoldLeftBold:"┓",lineDownBoldLeft:"┒",lineDownLeftBold:"┑",lineDownDoubleLeftDouble:"╗",lineDownDoubleLeft:"╖",lineDownLeftDouble:"╕",lineDownRight:"┌",lineDownRightArc:"╭",lineDownBoldRightBold:"┏",lineDownBoldRight:"┎",lineDownRightBold:"┍",lineDownDoubleRightDouble:"╔",lineDownDoubleRight:"╓",lineDownRightDouble:"╒",lineUpLeft:"┘",lineUpLeftArc:"╯",lineUpBoldLeftBold:"┛",lineUpBoldLeft:"┚",lineUpLeftBold:"┙",lineUpDoubleLeftDouble:"╝",lineUpDoubleLeft:"╜",lineUpLeftDouble:"╛",lineUpRight:"└",lineUpRightArc:"╰",lineUpBoldRightBold:"┗",lineUpBoldRight:"┖",lineUpRightBold:"┕",lineUpDoubleRightDouble:"╚",lineUpDoubleRight:"╙",lineUpRightDouble:"╘",lineUpDownLeft:"┤",lineUpBoldDownBoldLeftBold:"┫",lineUpBoldDownBoldLeft:"┨",lineUpDownLeftBold:"┥",lineUpBoldDownLeftBold:"┩",lineUpDownBoldLeftBold:"┪",lineUpDownBoldLeft:"┧",lineUpBoldDownLeft:"┦",lineUpDoubleDownDoubleLeftDouble:"╣",lineUpDoubleDownDoubleLeft:"╢",lineUpDownLeftDouble:"╡",lineUpDownRight:"├",lineUpBoldDownBoldRightBold:"┣",lineUpBoldDownBoldRight:"┠",lineUpDownRightBold:"┝",lineUpBoldDownRightBold:"┡",lineUpDownBoldRightBold:"┢",lineUpDownBoldRight:"┟",lineUpBoldDownRight:"┞",lineUpDoubleDownDoubleRightDouble:"╠",lineUpDoubleDownDoubleRight:"╟",lineUpDownRightDouble:"╞",lineDownLeftRight:"┬",lineDownBoldLeftBoldRightBold:"┳",lineDownLeftBoldRightBold:"┯",lineDownBoldLeftRight:"┰",lineDownBoldLeftBoldRight:"┱",lineDownBoldLeftRightBold:"┲",lineDownLeftRightBold:"┮",lineDownLeftBoldRight:"┭",lineDownDoubleLeftDoubleRightDouble:"╦",lineDownDoubleLeftRight:"╥",lineDownLeftDoubleRightDouble:"╤",lineUpLeftRight:"┴",lineUpBoldLeftBoldRightBold:"┻",lineUpLeftBoldRightBold:"┷",lineUpBoldLeftRight:"┸",lineUpBoldLeftBoldRight:"┹",lineUpBoldLeftRightBold:"┺",lineUpLeftRightBold:"┶",lineUpLeftBoldRight:"┵",lineUpDoubleLeftDoubleRightDouble:"╩",lineUpDoubleLeftRight:"╨",lineUpLeftDoubleRightDouble:"╧",lineUpDownLeftRight:"┼",lineUpBoldDownBoldLeftBoldRightBold:"╋",lineUpDownBoldLeftBoldRightBold:"╈",lineUpBoldDownLeftBoldRightBold:"╇",lineUpBoldDownBoldLeftRightBold:"╊",lineUpBoldDownBoldLeftBoldRight:"╉",lineUpBoldDownLeftRight:"╀",lineUpDownBoldLeftRight:"╁",lineUpDownLeftBoldRight:"┽",lineUpDownLeftRightBold:"┾",lineUpBoldDownBoldLeftRight:"╂",lineUpDownLeftBoldRightBold:"┿",lineUpBoldDownLeftBoldRight:"╃",lineUpBoldDownLeftRightBold:"╄",lineUpDownBoldLeftBoldRight:"╅",lineUpDownBoldLeftRightBold:"╆",lineUpDoubleDownDoubleLeftDoubleRightDouble:"╬",lineUpDoubleDownDoubleLeftRight:"╫",lineUpDownLeftDoubleRightDouble:"╪",lineCross:"╳",lineBackslash:"╲",lineSlash:"╱"},Yi={...Ki,tick:"✔",info:"ℹ",warning:"⚠",cross:"✘",squareSmall:"◻",squareSmallFilled:"◼",circle:"◯",circleFilled:"◉",circleDotted:"◌",circleDouble:"◎",circleCircle:"ⓞ",circleCross:"ⓧ",circlePipe:"Ⓘ",radioOn:"◉",radioOff:"◯",checkboxOn:"☒",checkboxOff:"☐",checkboxCircleOn:"ⓧ",checkboxCircleOff:"Ⓘ",pointer:"❯",triangleUpOutline:"△",triangleLeft:"◀",triangleRight:"▶",lozenge:"◆",lozengeOutline:"◇",hamburger:"☰",smiley:"㋡",mustache:"෴",star:"★",play:"▶",nodejs:"⬢",oneSeventh:"⅐",oneNinth:"⅑",oneTenth:"⅒"},Ji={...Ki,tick:"√",info:"i",warning:"‼",cross:"×",squareSmall:"□",squareSmallFilled:"■",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(○)",circleCross:"(×)",circlePipe:"(│)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[×]",checkboxOff:"[ ]",checkboxCircleOn:"(×)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"∆",triangleLeft:"◄",triangleRight:"►",lozenge:"♦",lozengeOutline:"◊",hamburger:"≡",smiley:"☺",mustache:"┌─┐",star:"✶",play:"►",nodejs:"♦",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},Qi=function(){const{env:e}=xn,{TERM:t,TERM_PROGRAM:r}=e;return"win32"!==xn.platform?"linux"!==t:!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||"{cmd::Cmder}"===e.ConEmuTask||"Terminus-Sublime"===r||"vscode"===r||"xterm-256color"===t||"alacritty"===t||"rxvt-unicode"===t||"rxvt-unicode-256color"===t||"JetBrains-JediTerm"===e.TERMINAL_EMULATOR}()?Yi:Ji,Zi=null!=(jr=null==(Mr=null==(kr=null==(Lr=null==Nn?void 0:Nn.WriteStream)?void 0:Lr.prototype)?void 0:kr.hasColors)?void 0:Mr.call(kr))&&jr,es=(e,t)=>{if(!Zi)return e=>e;const r=`[${e}m`,n=`[${t}m`;return e=>{const t=e+"";let o=t.indexOf(n);if(-1===o)return r+t+n;let i=r,s=0;for(;-1!==o;)i+=t.slice(s,o)+r,s=o+n.length,o=t.indexOf(n,s);return i+=t.slice(s)+n,i}},ts=es(1,22),rs=es(90,39),ns=es(91,39),os=es(93,39),is=(e,t)=>(e+"").padStart(t,"0"),ss=({failed:e,reject:t})=>e?t?Qi.cross:Qi.warning:Qi.tick,as={command:({piped:e})=>e?"|":"$",output:()=>" ",ipc:()=>"*",error:ss,duration:ss},cs=e=>e,ls={command:()=>ts,output:()=>cs,ipc:()=>cs,error:({reject:e})=>e?ns:os,duration:()=>rs},us=(e,t,r)=>{if(void 0===r)return e;const n=r(e,t);return"string"==typeof n?n:void 0},ds=e=>e.endsWith("\n")?e:e+"\n",ps=({type:e,verboseMessage:t,fdNumber:r,verboseInfo:n,result:o})=>{const i=fs({type:e,result:o,verboseInfo:n}),s=((e,t,r)=>{const n=(({verbose:e},t)=>{const r=ji(e,t);return Fi(r)?r:void 0})(t,r);return e.map((({verboseLine:e,verboseObject:t})=>us(e,t,n))).filter((e=>void 0!==e)).map((e=>ds(e))).join("")})(hs(t,i),n,r);gn.writeFileSync(ys,s)},fs=({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}),hs=(e,t)=>e.split("\n").map((e=>ms({...t,message:e}))),ms=e=>({verboseLine:(({type:e,message:t,timestamp:r,piped:n,commandId:o,result:{failed:i=!1}={},options:{reject:s=!0}})=>{const a=(e=>`${is(e.getHours(),2)}:${is(e.getMinutes(),2)}:${is(e.getSeconds(),2)}.${is(e.getMilliseconds(),3)}`)(r),c=as[e]({failed:i,reject:s,piped:n}),l=ls[e]({reject:s});return`${rs(`[${a}]`)} ${rs(`[${o}]`)} ${l(c)} ${l(t)}`})(e),verboseObject:e}),ys=2,gs=e=>{const t="string"==typeof e?e:On.inspect(e);return Gi(t).replaceAll("\t"," ".repeat(vs))},vs=2,ws=e=>ki({verbose:e})?bs++:void 0;let bs=0n;const Es=()=>xn.hrtime.bigint(),_s=e=>Number(xn.hrtime.bigint()-e)/1e6,Ss=(e,t,r)=>{const n=Es(),{command:o,escapedCommand:i}=((e,t)=>{const r=[e,...t];return{command:r.join(" "),escapedCommand:r.map((e=>{return t=Hi(e),Xi.test(t)?t:"win32"===xn.platform?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`;var t})).join(" ")}})(e,t),s=((e,t,r)=>((e=>{for(const t of e){if(!1===t)throw new TypeError('The "verbose: false" option was renamed to "verbose: \'none\'".');if(!0===t)throw new TypeError('The "verbose: true" option was renamed to "verbose: \'short\'".');if(!Bi.includes(t)&&!Fi(t)){const e=Bi.map((e=>`'${e}'`)).join(", ");throw new TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${e} or a function.`)}}})(e),{verbose:e,escapedCommand:t,commandId:ws(e),rawOptions:r}))(Si(r,"verbose"),i,{...r});return((e,t)=>{ki(t)&&ps({type:"command",verboseMessage:e,verboseInfo:t})})(i,s),{command:o,escapedCommand:i,startTime:n,verboseInfo:s}};var Os,Ts,Rs,Is,xs,Ns={exports:{}};xs="win32"===process.platform||Bn.TESTING_WINDOWS?function(){function e(e,t,r){return!(!e.isSymbolicLink()&&!e.isFile())&&function(e,t){var r=void 0!==t.pathExt?t.pathExt:process.env.PATHEXT;if(!r)return!0;if(-1!==(r=r.split(";")).indexOf(""))return!0;for(var n=0;r.length>n;n++){var o=r[n].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}(t,r)}function t(t,n,o){r.stat(t,(function(r,i){o(r,!r&&e(i,t,n))}))}if(Ts)return Os;Ts=1,Os=t,t.sync=function(t,n){return e(r.statSync(t),t,n)};var r=gn;return Os}():function(){function e(e,n,o){r.stat(e,(function(e,r){o(e,!e&&t(r,n))}))}function t(e,t){return e.isFile()&&function(e,t){var r=e.mode,n=e.uid,o=e.gid,i=void 0!==t.uid?t.uid:process.getuid&&process.getuid(),s=void 0!==t.gid?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),l=a|c;return r&parseInt("001",8)||r&c&&o===s||r&a&&n===i||r&l&&0===i}(e,t)}if(Is)return Rs;Is=1,Rs=e,e.sync=function(e,n){return t(r.statSync(e),n)};var r=gn;return Rs}();var As=E;E.sync=function(e,t){try{return xs.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||"EACCES"===r.code)return!1;throw r}};const Ps="win32"===process.platform||"cygwin"===process.env.OSTYPE||"msys"===process.env.OSTYPE,$s=wn,Cs=Ps?";":":",Ds=As,Ls=e=>Object.assign(Error("not found: "+e),{code:"ENOENT"}),ks=(e,t)=>{const r=t.colon||Cs,n=e.match(/\//)||Ps&&e.match(/\\/)?[""]:[...Ps?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],o=Ps?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=Ps?o.split(r):[""];return Ps&&-1!==e.indexOf(".")&&""!==i[0]&&i.unshift(""),{pathEnv:n,pathExt:i,pathExtExe:o}},Ms=(e,t,r)=>{"function"==typeof t&&(r=t,t={}),t||(t={});const{pathEnv:n,pathExt:o,pathExtExe:i}=ks(e,t),s=[],a=r=>new Promise(((o,i)=>{if(r===n.length)return t.all&&s.length?o(s):i(Ls(e));const a=n[r],l=/^".*"$/.test(a)?a.slice(1,-1):a,u=$s.join(l,e),d=!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;o(c(d,r,0))})),c=(e,r,n)=>new Promise(((l,u)=>{if(n===o.length)return l(a(r+1));const d=o[n];Ds(e+d,{pathExt:i},((o,i)=>{if(!o&&i){if(!t.all)return l(e+d);s.push(e+d)}return l(c(e,r,n+1))}))}));return r?a(0).then((e=>r(null,e)),r):a(0)};var js=Ms;Ms.sync=(e,t)=>{t=t||{};const{pathEnv:r,pathExt:n,pathExtExe:o}=ks(e,t),i=[];for(let a=0;r.length>a;a++){const c=r[a],l=/^".*"$/.test(c)?c.slice(1,-1):c,u=$s.join(l,e),d=!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let e=0;n.length>e;e++){const r=d+n[e];try{if(Ds.sync(r,{pathExt:o})){if(!t.all)return r;i.push(r)}}catch(s){}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw Ls(e)};var Us={exports:{}};const Fs=(e={})=>{const t=e.env||process.env;return"win32"!==(e.platform||process.platform)?"PATH":Object.keys(t).reverse().find((e=>"PATH"===e.toUpperCase()))||"Path"};Us.exports=Fs,Us.exports.default=Fs;const Bs=wn,Gs=js,Hs=Us.exports;var qs={};const Vs=/([()\][%!^"`<>&|;, *?])/g;qs.command=function(e){return e.replace(Vs,"^$1")},qs.argument=function(e,t){return e=(e=`"${e=(e=(e=""+e).replace(/(\\*)"/g,'$1$1\\"')).replace(/(\\*)$/,"$1$1")}"`).replace(Vs,"^$1"),t&&(e=e.replace(Vs,"^$1")),e};const zs=/^#!(.*)/,Ws=gn,Xs=wn,Ks=function(e){return _(e)||_(e,!0)},Ys=qs,Js=function(e){const t=Buffer.alloc(150);let r;try{r=Ws.openSync(e,"r"),Ws.readSync(r,t,0,150,0),Ws.closeSync(r)}catch(n){}return((e="")=>{const t=e.match(zs);if(!t)return null;const[r,n]=t[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return"env"===o?n:n?`${o} ${n}`:o})(""+t)},Qs="win32"===process.platform,Zs=/\.(?:com|exe)$/i,ea=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i,ta="win32"===process.platform,ra=Rn,na=function(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null);const n={command:e,args:t=t?t.slice(0):[],options:r=Object.assign({},r),file:void 0,original:{command:e,args:t}};return r.shell?n:function(e){if(!Qs)return e;const t=function(e){e.file=Ks(e);const t=e.file&&Js(e.file);return t?(e.args.unshift(e.file),e.command=t,Ks(e)):e.file}(e),r=!Zs.test(t);if(e.options.forceShell||r){const r=ea.test(t);e.command=Xs.normalize(e.command),e.command=Ys.command(e.command),e.args=e.args.map((e=>Ys.argument(e,r)));const n=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${n}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}(n)},oa={hookChildProcess:function(e,t){if(!ta)return;const r=e.emit;e.emit=function(n,o){if("exit"===n){const n=O(o,t);if(n)return r.call(e,"error",n)}return r.apply(e,arguments)}},verifyENOENT:O,verifyENOENTSync:function(e,t){return ta&&1===e&&!t.file?S(t.original,"spawnSync"):null},notFoundError:S};Ns.exports=T,Ns.exports.spawn=T,Ns.exports.sync=function(e,t,r){const n=na(e,t,r),o=ra.spawnSync(n.command,n.args,n.options);return o.error=o.error||oa.verifyENOENTSync(o.status,n),o},Ns.exports._parse=na,Ns.exports._enoent=oa;const ia=t(Ns.exports);On.promisify(Rn.execFile);const sa=({env:e=xn.env,...t}={})=>{const r=R({env:e={...e}});return t.path=e[r],e[r]=(({cwd:e=xn.cwd(),path:t=xn.env[R()],preferLocal:r=!0,execPath:n=xn.execPath,addExecPath:o=!0}={})=>{const i=wn.resolve(I(e)),s=[],a=t.split(wn.delimiter);return r&&((e,t,r)=>{for(const n of function(e){return{*[Symbol.iterator](){let t,r=wn.resolve(I(e));for(;t!==r;)yield r,t=r,r=wn.resolve(r,"..")}}}(r)){const r=wn.join(n,"node_modules/.bin");t.includes(r)||e.push(r)}})(s,a,i),o&&((e,t,r,n)=>{const o=wn.resolve(n,I(r),"..");t.includes(o)||e.push(o)})(s,a,n,i),""===t||t===wn.delimiter?`${s.join(wn.delimiter)}${t}`:[...s,t].join(wn.delimiter)})(t),e};var aa={};!function(e){function t(e){delete l[e]}function r(e){if(u)setTimeout(r,0,e);else{var n=l[e];if(n){u=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(void 0,r)}}(n)}finally{t(e),u=!1}}}}if(!e.setImmediate){var n,o,i,s,a,c=1,l={},u=!1,d=e.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(e);p=p&&p.setTimeout?p:e,"[object process]"==={}.toString.call(e.process)?n=function(e){process.nextTick((function(){r(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?(s="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&r(+t.data.slice(s.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),n=function(t){e.postMessage(s+t,"*")}):e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){r(e.data)},n=function(e){i.port2.postMessage(e)}):d&&"onreadystatechange"in d.createElement("script")?(o=d.documentElement,n=function(e){var t=d.createElement("script");t.onreadystatechange=function(){r(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):n=function(e){setTimeout(r,0,e)},p.setImmediate=function(e){"function"!=typeof e&&(e=Function(""+e));for(var t=Array(arguments.length-1),r=0;t.length>r;r++)t[r]=arguments[r+1];return l[c]={callback:e,args:t},n(c),c++},p.clearImmediate=t}}("undefined"==typeof self?Bn:self);var ca=void 0!==Bn&&Bn||"undefined"!=typeof self&&self||window,la=function(){}.apply,ua=aa.setTimeout=function(){return new x(la.call(setTimeout,ca,arguments),clearTimeout)};aa.setInterval=function(){return new x(la.call(setInterval,ca,arguments),clearInterval)},aa.clearTimeout=aa.clearInterval=function(e){e&&e.close()},x.prototype.unref=x.prototype.ref=function(){},x.prototype.close=function(){this._clearFn.call(ca,this._id)},aa.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},aa.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},aa._unrefActive=aa.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;0>t||(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))};var da=aa.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==Bn&&Bn.setImmediate||Bn&&Bn.setImmediate;aa.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==Bn&&Bn.clearImmediate||Bn&&Bn.clearImmediate;class pa extends Error{}const fa=(e,t)=>{Object.defineProperty(e.prototype,"name",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,ha,{value:!0,writable:!1,enumerable:!1,configurable:!1})},ha=Symbol(),ma=e=>"[object Error]"==={}.toString.call(e);class ya extends Error{}fa(ya,ya.name);class ga extends Error{}fa(ga,ga.name);const va=(e,t)=>({name:"SIGRT"+(t+1),number:wa+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),wa=34,ba=[{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"}],Ea=()=>{const e=Array.from({length:64-wa+1},va);return[...ba,...e].map(_a)},_a=({name:e,number:t,description:r,action:n,forced:o=!1,standard:i})=>{const{signals:{[e]:s}}=yn.constants,a=void 0!==s;return{name:e,number:a?s:t,description:r,supported:a,action:n,forced:o,standard:i}},Sa=({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}],Oa=(()=>{const e=Ea();return Object.fromEntries(e.map(Sa))})(),Ta=(e,t)=>{const r=t.find((({name:t})=>yn.constants.signals[t]===e));return void 0!==r?r:t.find((t=>t.number===e))};(()=>{const e=Ea(),t=Array.from({length:65},((t,r)=>((e,t)=>{const r=Ta(e,t);if(void 0===r)return{};const{name:n,description:o,supported:i,action:s,forced:a,standard:c}=r;return{[e]:{name:n,number:e,description:o,supported:i,action:s,forced:a,standard:c}}})(r,e)));Object.assign({},...t)})();const Ra=e=>0===e?e:Ia(e,"`subprocess.kill()`'s argument"),Ia=(e,t)=>{if(Number.isInteger(e))return xa(e,t);if("string"==typeof e)return Aa(e,t);throw new TypeError(`Invalid ${t} ${e+""}: it must be a string or an integer.\n${Pa()}`)},xa=(e,t)=>{if(Na.has(e))return Na.get(e);throw new TypeError(`Invalid ${t} ${e}: this signal integer does not exist.\n${Pa()}`)},Na=new Map(Object.entries(yn.constants.signals).reverse().map((([e,t])=>[t,e]))),Aa=(e,t)=>{if(e in yn.constants.signals)return e;if(e.toUpperCase()in yn.constants.signals)throw new TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`);throw new TypeError(`Invalid ${t} '${e}': this signal name does not exist.\n${Pa()}`)},Pa=()=>`Available signal names: ${$a()}.\nAvailable signal numbers: ${Ca()}.`,$a=()=>Object.keys(yn.constants.signals).sort().map((e=>`'${e}'`)).join(", "),Ca=()=>[...new Set(Object.values(yn.constants.signals).sort(((e,t)=>e-t)))].join(", "),Da=e=>Oa[e].description,La=({kill:e,options:{forceKillAfterDelay:t,killSignal:r},onInternalError:n,context:o,controller:i},s,a)=>{const{signal:c,error:l}=ka(s,a,r);Ma(l,n);const u=e(c);return ja({kill:e,signal:c,forceKillAfterDelay:t,killSignal:r,killResult:u,context:o,controller:i}),u},ka=(e,t,r)=>{const[n=r,o]=ma(e)?[void 0,e]:[e,t];if("string"!=typeof n&&!Number.isInteger(n))throw new TypeError("The first argument must be an error instance or a signal name string/integer: "+n);if(void 0!==o&&!ma(o))throw new TypeError("The second argument is optional. If specified, it must be an error instance: "+o);return{signal:Ra(n),error:o}},Ma=(e,t)=>{void 0!==e&&t.reject(e)},ja=async({kill:e,signal:t,forceKillAfterDelay:r,killSignal:n,killResult:o,context:i,controller:s})=>{t===n&&o&&Ua({kill:e,forceKillAfterDelay:r,context:i,controllerSignal:s.signal})},Ua=async({kill:e,forceKillAfterDelay:t,context:r,controllerSignal:n})=>{if(!1!==t)try{await ua(t,void 0,{signal:n}),e("SIGKILL")&&(null!=r.isForcefullyTerminated||(r.isForcefullyTerminated=!0))}catch{}},Fa=async(e,t)=>{e.aborted||await Sn.once(e,"abort",{signal:t})},Ba=({subprocess:e,cancelSignal:t,gracefulCancel:r,context:n,controller:o})=>void 0===t||r?[]:[Ga(e,t,n,o)],Ga=async(e,t,r,{signal:n})=>{throw await Fa(t,n),null!=r.terminationReason||(r.terminationReason="cancel"),e.kill(),t.reason},Ha=({methodName:e,isSubprocess:t,ipc:r,isConnected:n})=>{qa(e,t,r),Va(e,t,n)},qa=(e,t,r)=>{if(!r)throw Error(Ka(e,t)+" can only be used if the `ipc` option is `true`.")},Va=(e,t,r)=>{if(!r)throw Error(`${Ka(e,t)} cannot be used: the ${Ja(t)} has already exited or disconnected.`)},za=(e,t)=>Error(`${Ka("sendMessage",t)} failed when sending an acknowledgment response to the ${Ja(t)}.`,{cause:e}),Wa=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),Xa=["could not be cloned","circular structure","call stack size exceeded"],Ka=(e,t,r="")=>"cancelSignal"===e?"`cancelSignal`'s `controller.abort()`":`${Ya(t)}${e}(${r})`,Ya=e=>e?"":"subprocess.",Ja=e=>e?"parent process":"subprocess",Qa=e=>{e.connected&&e.disconnect()},Za=()=>{const e={},t=new Promise(((t,r)=>{Object.assign(e,{resolve:t,reject:r})}));return Object.assign(t,e)},ec=(e,t="stdin")=>{const r=!0,{options:n,fileDescriptors:o}=rc.get(e),i=nc(o,t,r),s=e.stdio[i];if(null===s)throw new TypeError(sc(i,t,n,r));return s},tc=(e,t="stdout")=>{const r=!1,{options:n,fileDescriptors:o}=rc.get(e),i=nc(o,t,r),s="all"===i?e.all:e.stdio[i];if(null==s)throw new TypeError(sc(i,t,n,r));return s},rc=new WeakMap,nc=(e,t,r)=>{const n=oc(t,r);return ic(n,t,r,e),n},oc=(e,t)=>{const r=Ai(e);if(void 0!==r)return r;const{validOptions:n,defaultValue:o}=t?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${lc(t)}" must not be "${e}".\nIt must be ${n} or "fd3", "fd4" (and so on).\nIt is optional and defaults to "${o}".`)},ic=(e,t,r,n)=>{const o=n[cc(e)];if(void 0===o)throw new TypeError(`"${lc(r)}" must not be ${t}. That file descriptor does not exist.\nPlease set the "stdio" option to ensure that file descriptor exists.`);if("input"===o.direction&&!r)throw new TypeError(`"${lc(r)}" must not be ${t}. It must be a readable stream, not writable.`);if("input"!==o.direction&&r)throw new TypeError(`"${lc(r)}" must not be ${t}. It must be a writable stream, not readable.`)},sc=(e,t,r,n)=>{if("all"===e&&!r.all)return'The "all" option must be true to use "from: \'all\'".';const{optionName:o,optionValue:i}=ac(e,r);return`The "${o}: ${uc(i)}" option is incompatible with using "${lc(n)}: ${uc(t)}".\nPlease set this option with "pipe" instead.`},ac=(e,{stdin:t,stdout:r,stderr:n,stdio:o})=>{const i=cc(e);return 0===i&&void 0!==t?{optionName:"stdin",optionValue:t}:1===i&&void 0!==r?{optionName:"stdout",optionValue:r}:2===i&&void 0!==n?{optionName:"stderr",optionValue:n}:{optionName:`stdio[${i}]`,optionValue:o[i]}},cc=e=>"all"===e?1:e,lc=e=>e?"to":"from",uc=e=>"string"==typeof e?`'${e}'`:"number"==typeof e?""+e:"Stream",dc=(e,t,r)=>{const n=e.getMaxListeners();0!==n&&n!==1/0&&(e.setMaxListeners(n+t),Sn.addAbortListener(r,(()=>{e.setMaxListeners(e.getMaxListeners()-t)})))},pc=(e,t)=>{t&&fc(e)},fc=e=>{e.refCounted()},hc=(e,t)=>{t&&mc(e)},mc=e=>{e.unrefCounted()},yc=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n},o)=>{if(Rc(o)||qc(o))return;vc.has(e)||vc.set(e,[]);const i=vc.get(e);if(i.push(o),1>=i.length)for(;i.length>0;){await $c(e,n,o),await aa.scheduler.yield();const s=await Tc({wrappedMessage:i[0],anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n});i.shift(),n.emit("message",s),n.emit("message:done")}},gc=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n,boundOnMessage:o})=>{zc();const i=vc.get(e);for(;(null==i?void 0:i.length)>0;)await Sn.once(n,"message:done");e.removeListener("message",o),((e,t)=>{t&&(fc(e),fc(e))})(t,r),n.connected=!1,n.emit("disconnect")},vc=new WeakMap,wc=(e,t,r)=>{if(bc.has(e))return bc.get(e);const n=new Sn.EventEmitter;return n.connected=!0,bc.set(e,n),Ec({ipcEmitter:n,anyProcess:e,channel:t,isSubprocess:r}),n},bc=new WeakMap,Ec=({ipcEmitter:e,anyProcess:t,channel:r,isSubprocess:n})=>{const o=yc.bind(void 0,{anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:e});t.on("message",o),t.once("disconnect",gc.bind(void 0,{anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:e,boundOnMessage:o})),((e,t)=>{t&&(mc(e),mc(e))})(r,n)},_c=e=>{const t=bc.get(e);return void 0===t?null!==e.channel:t.connected};let Sc=0n;const Oc=(e,t)=>{if((null==t?void 0:t.type)===Ac&&!t.hasListeners)for(const{id:r}of e)void 0!==r&&xc[r].resolve({isDeadlock:!0,hasListeners:!1})},Tc=async({wrappedMessage:e,anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:o})=>{if((null==e?void 0:e.type)!==Ac||!t.connected)return e;const{id:i,message:s}=e,a={id:i,type:Pc,message:Dc(t,o)};try{await kc({anyProcess:t,channel:r,isSubprocess:n,ipc:!0},a)}catch(c){o.emit("strict:error",c)}return s},Rc=e=>{var t;if((null==e?void 0:e.type)!==Pc)return!1;const{id:r,message:n}=e;return null==(t=xc[r])||t.resolve({isDeadlock:!1,hasListeners:n}),!0},Ic=async(e,t,r)=>{if((null==e?void 0:e.type)!==Ac)return;const n=Za();xc[e.id]=n;const o=new AbortController;try{const{isDeadlock:e,hasListeners:i}=await Promise.race([n,Nc(t,r,o)]);e&&(e=>{throw Error(`${Ka("sendMessage",e)} failed: the ${Ja(e)} is sending a message too, instead of listening to incoming messages.\nThis can be fixed by both sending a message and listening to incoming messages at the same time:\n\nconst [receivedMessage] = await Promise.all([\n\t${Ka("getOneMessage",e)},\n\t${Ka("sendMessage",e,"message, {strict: true}")},\n]);`)})(r),i||(e=>{throw Error(`${Ka("sendMessage",e)} failed: the ${Ja(e)} is not listening to incoming messages.`)})(r)}finally{o.abort(),delete xc[e.id]}},xc={},Nc=async(e,t,{signal:r})=>{dc(e,1,r),await Sn.once(e,"disconnect",{signal:r}),(e=>{throw Error(`${Ka("sendMessage",e)} failed: the ${Ja(e)} exited without listening to incoming messages.`)})(t)},Ac="execa:ipc:request",Pc="execa:ipc:response",$c=async(e,t,r)=>{for(var n;!Dc(e,t)&&(null==(n=Cc.get(e))?void 0:n.size)>0;){const t=[...Cc.get(e)];Oc(t,r),await Promise.all(t.map((({onMessageSent:e})=>e)))}},Cc=new WeakMap,Dc=(e,t)=>t.listenerCount("message")>Lc(e),Lc=e=>rc.has(e)&&!Li(rc.get(e).options.buffer,"ipc")?1:0,kc=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},o,{strict:i=!1}={})=>{const s="sendMessage";return Ha({methodName:s,isSubprocess:r,ipc:n,isConnected:e.connected}),Mc({anyProcess:e,channel:t,methodName:s,isSubprocess:r,message:o,strict:i})},Mc=async({anyProcess:e,channel:t,methodName:r,isSubprocess:n,message:o,strict:i})=>{const s=(({anyProcess:e,channel:t,isSubprocess:r,message:n,strict:o})=>{if(!o)return n;const i=wc(e,t,r),s=Dc(e,i);return{id:Sc++,type:Ac,message:n,hasListeners:s}})({anyProcess:e,channel:t,isSubprocess:n,message:o,strict:i}),a=((e,t,r)=>{Cc.has(e)||Cc.set(e,new Set);const n=Cc.get(e),o={onMessageSent:Za(),id:r?t.id:void 0};return n.add(o),{outgoingMessages:n,outgoingMessage:o}})(e,s,i);try{await jc({anyProcess:e,methodName:r,isSubprocess:n,wrappedMessage:s,message:o})}catch(c){throw Qa(e),c}finally{(({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()})(a)}},jc=async({anyProcess:e,methodName:t,isSubprocess:r,wrappedMessage:n,message:o})=>{const i=Uc(e);try{await Promise.all([Ic(n,e,r),i(n)])}catch(s){throw(({error:e,methodName:t,isSubprocess:r})=>{if("EPIPE"===e.code)throw Error(`${Ka(t,r)} cannot be used: the ${Ja(r)} is disconnecting.`,{cause:e})})({error:s,methodName:t,isSubprocess:r}),(({error:e,methodName:t,isSubprocess:r,message:n})=>{if((({code:e,message:t})=>Wa.has(e)||Xa.some((e=>t.includes(e))))(e))throw Error(`${Ka(t,r)}'s argument type is invalid: the message cannot be serialized: ${n+""}.`,{cause:e})})({error:s,methodName:t,isSubprocess:r,message:o}),s}},Uc=e=>{if(Fc.has(e))return Fc.get(e);const t=On.promisify(e.send.bind(e));return Fc.set(e,t),t},Fc=new WeakMap,Bc=async({anyProcess:e,channel:t,isSubprocess:r,ipc:n})=>(await Gc({anyProcess:e,channel:t,isSubprocess:r,ipc:n}),Wc.signal),Gc=async({anyProcess:e,channel:t,isSubprocess:r,ipc:n})=>{Hc||(Hc=!0,n?null!==t?(wc(e,t,r),await aa.scheduler.yield()):zc():(()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")})())};let Hc=!1;const qc=e=>(null==e?void 0:e.type)===Vc&&(Wc.abort(e.message),!0),Vc="execa:ipc:cancel",zc=()=>{Wc.abort(Error(`\`cancelSignal\` aborted: the ${Ja(!0)} disconnected.`))},Wc=new AbortController,Xc=({subprocess:e,cancelSignal:t,gracefulCancel:r,forceKillAfterDelay:n,context:o,controller:i})=>r?[Kc({subprocess:e,cancelSignal:t,forceKillAfterDelay:n,context:o,controller:i})]:[],Kc=async({subprocess:e,cancelSignal:t,forceKillAfterDelay:r,context:n,controller:{signal:o}})=>{await Fa(t,o);const i=Yc(t);throw await((e,t)=>{const r="cancelSignal";return Va(r,!1,e.connected),jc({anyProcess:e,methodName:r,isSubprocess:!1,wrappedMessage:{type:Vc,message:t},message:t})})(e,i),Ua({kill:e.kill,forceKillAfterDelay:r,context:n,controllerSignal:o}),null!=n.terminationReason||(n.terminationReason="gracefulCancel"),t.reason},Yc=({reason:e})=>{if(!(e instanceof DOMException))return e;const t=Error(e.message);return Object.defineProperty(t,"stack",{value:e.stack,enumerable:!1,configurable:!0,writable:!0}),t},Jc=(e,t,r,n)=>0===t||void 0===t?[]:[Qc(e,t,r,n)],Qc=async(e,t,r,{signal:n})=>{throw await ua(t,void 0,{signal:n}),null!=r.terminationReason||(r.terminationReason="timeout"),e.kill(),new pa},Zc={advanced:e=>{try{An.serialize(e)}catch(t){throw Error("The `ipcInput` option is not serializable with a structured clone.",{cause:t})}},json:e=>{try{JSON.stringify(e)}catch(t){throw Error("The `ipcInput` option is not serializable with JSON.",{cause:t})}}},el=async(e,t)=>{void 0!==t&&await e.sendMessage(t)},tl=new Set(["utf8","utf16le"]),rl=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),nl=new Set([...tl,...rl]),ol={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},il=e=>"string"==typeof e?`"${e}"`:e+"",sl=()=>{try{return xn.cwd()}catch(e){throw e.message="The current directory does not exist.\n"+e.message,e}},al=(e,t,r)=>{r.cwd=((e=sl())=>{const t=Qo(e,'The "cwd" option');return wn.resolve(t)})(r.cwd);const[n,o,i]=((e,t,{node:r=!1,nodePath:n=xn.execPath,nodeOptions:o=xn.execArgv.filter((e=>!e.startsWith("--inspect"))),cwd:i,execPath:s,...a})=>{if(void 0!==s)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');const c=Qo(n,'The "nodePath" option'),l=wn.resolve(i,c),u={...a,nodePath:l,node:r,cwd:i};if(!r)return[e,t,u];if("node"===wn.basename(e,".exe"))throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[l,[...o,e,...t],{ipc:!0,...u,shell:!1}]})(e,t,r),{command:s,args:a,options:c}=ia._parse(n,o,i),l=(e=>{const t={...e};for(const r of Di)t[r]=Si(e,r);return t})(c),u=cl(l);return(({timeout:e})=>{if(void 0!==e&&(!Number.isFinite(e)||0>e))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)})(u),(({encoding:e})=>{if(nl.has(e))return;const t=(e=>{if(null===e)return"buffer";if("string"!=typeof e)return;const t=e.toLowerCase();return t in ol?ol[t]:nl.has(t)?t:void 0})(e);if(void 0!==t)throw new TypeError(`Invalid option \`encoding: ${il(e)}\`.\nPlease rename it to ${il(t)}.`);const r=[...nl].map((e=>il(e))).join(", ");throw new TypeError(`Invalid option \`encoding: ${il(e)}\`.\nPlease rename it to one of: ${r}.`)})(u),(({ipcInput:e,ipc:t,serialization:r})=>{if(void 0!==e){if(!t)throw Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");Zc[r](e)}})(u),(({cancelSignal:e})=>{if(void 0!==e&&"[object AbortSignal]"!=={}.toString.call(e))throw Error("The `cancelSignal` option must be an AbortSignal: "+e)})(u),(({gracefulCancel:e,cancelSignal:t,ipc:r,serialization:n})=>{if(e){if(void 0===t)throw Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if("json"===n)throw Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}})(u),u.shell=Zo(u.shell),u.env=ll(u),u.killSignal=(e=>{const t="option `killSignal`";if(0===e)throw new TypeError(`Invalid ${t}: 0 cannot be used.`);return Ia(e,t)})(u.killSignal),u.forceKillAfterDelay=(e=>{if(!1===e)return e;if(!0===e)return 5e3;if(!Number.isFinite(e)||0>e)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e})(u.forceKillAfterDelay),u.lines=u.lines.map(((e,t)=>e&&!rl.has(u.encoding)&&u.buffer[t])),"win32"===xn.platform&&"cmd"===wn.basename(s,".exe")&&a.unshift("/q"),{file:s,commandArguments:a,options:u}},cl=({extendEnv:e=!0,preferLocal:t=!1,cwd:r,localDir:n=r,encoding:o="utf8",reject:i=!0,cleanup:s=!0,all:a=!1,windowsHide:c=!0,killSignal:l="SIGTERM",forceKillAfterDelay:u=!0,gracefulCancel:d=!1,ipcInput:p,ipc:f=void 0!==p||d,serialization:h="advanced",...m})=>({...m,extendEnv:e,preferLocal:t,cwd:r,localDirectory:n,encoding:o,reject:i,cleanup:s,all:a,windowsHide:c,killSignal:l,forceKillAfterDelay:u,gracefulCancel:d,ipcInput:p,ipc:f,serialization:h}),ll=({env:e,extendEnv:t,preferLocal:r,node:n,localDirectory:o,nodePath:i})=>{const s=t?{...xn.env,...e}:e;return r||n?sa({env:s,cwd:o,execPath:i,preferLocal:r,addExecPath:n}):s},ul=e=>e.at(-1)===pl?e.slice(0,e.at(-2)===hl?-2:-1):e,dl=e=>e.at(-1)===fl?e.subarray(0,e.at(-2)===ml?-2:-1):e,pl="\n",fl=pl.codePointAt(0),hl="\r",ml=hl.codePointAt(0);"promises"in Fn&&"pipeline"in Fn.promises||On.promisify(Fn.pipeline);const yl="promises"in Fn&&"finished"in Fn.promises?Fn.promises.finished:On.promisify(Fn.finished),gl=Object.getPrototypeOf(Object.getPrototypeOf((async function*(){})).prototype);let vl=(zr=class{constructor(e,t){fn(this,Hr),fn(this,Ur),fn(this,Fr),fn(this,Br,!1),fn(this,Gr),hn(this,Ur,e),hn(this,Fr,t)}next(){const e=()=>mn(this,Hr,qr).call(this);return hn(this,Gr,pn(this,Gr)?pn(this,Gr).then(e,e):e()),pn(this,Gr)}return(e){const t=()=>mn(this,Hr,Vr).call(this,e);return pn(this,Gr)?pn(this,Gr).then(t,t):t()}},Ur=new WeakMap,Fr=new WeakMap,Br=new WeakMap,Gr=new WeakMap,Hr=new WeakSet,qr=async function(){if(pn(this,Br))return{done:!0,value:void 0};let e;try{e=await pn(this,Ur).read()}catch(t){throw hn(this,Gr,void 0),hn(this,Br,!0),pn(this,Ur).releaseLock(),t}return e.done&&(hn(this,Gr,void 0),hn(this,Br,!0),pn(this,Ur).releaseLock()),e},Vr=async function(e){if(pn(this,Br))return{done:!0,value:e};if(hn(this,Br,!0),!pn(this,Fr)){const t=pn(this,Ur).cancel(e);return pn(this,Ur).releaseLock(),await t,{done:!0,value:e}}return pn(this,Ur).releaseLock(),{done:!0,value:e}},zr);const wl=Symbol();Object.defineProperty(D,"name",{value:"next"}),Object.defineProperty(L,"name",{value:"return"});const bl=Object.create(gl,{next:{enumerable:!0,configurable:!0,writable:!0,value:D},return:{enumerable:!0,configurable:!0,writable:!0,value:L}}),El=e=>{if($(e,{checkOpen:!1})&&void 0!==Tl.on)return Sl(e);if("function"==typeof(null==e?void 0:e[Symbol.asyncIterator]))return e;if("[object ReadableStream]"===_l.call(e))return k.call(e);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:_l}=Object.prototype,Sl=async function*(e){const t=new AbortController,r={};Ol(e,t,r);try{for await(const[r]of Tl.on(e,"data",{signal:t.signal}))yield r}catch(n){if(void 0!==r.error)throw r.error;if(!t.signal.aborted)throw n}finally{e.destroy()}},Ol=async(e,t,r)=>{try{await Tl.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(n){r.error=n}finally{t.abort()}},Tl={},Rl=async(e,{init:t,convertChunk:r,getSize:n,truncateChunk:o,addChunk:i,getFinalChunk:s,finalize:a},{maxBuffer:c=1/0}={})=>{const l=El(e),u=t();u.length=0;try{for await(const e of l){const t=r[Al(e)](e,u);xl({convertedChunk:t,state:u,getSize:n,truncateChunk:o,addChunk:i,maxBuffer:c})}return Il({state:u,convertChunk:r,getSize:n,truncateChunk:o,addChunk:i,getFinalChunk:s,maxBuffer:c}),a(u)}catch(d){const e="object"==typeof d&&null!==d?d:Error(d);throw e.bufferedData=a(u),e}},Il=({state:e,getSize:t,truncateChunk:r,addChunk:n,getFinalChunk:o,maxBuffer:i})=>{const s=o(e);void 0!==s&&xl({convertedChunk:s,state:e,getSize:t,truncateChunk:r,addChunk:n,maxBuffer:i})},xl=({convertedChunk:e,state:t,getSize:r,truncateChunk:n,addChunk:o,maxBuffer:i})=>{const s=r(e),a=t.length+s;if(i>=a)return void Nl(e,t,o,a);const c=n(e,i-t.length);throw void 0!==c&&Nl(c,t,o,i),new $l},Nl=(e,t,r,n)=>{t.contents=r(e,t,n),t.length=n},Al=e=>{var t;const r=typeof e;if("string"===r)return"string";if("object"!==r||null===e)return"others";if(null==(t=globalThis.Buffer)?void 0:t.isBuffer(e))return"buffer";const n=Pl.call(e);return"[object ArrayBuffer]"===n?"arrayBuffer":"[object DataView]"===n?"dataView":Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&"[object ArrayBuffer]"===Pl.call(e.buffer)?"typedArray":"others"},{toString:Pl}=Object.prototype;class $l extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}const Cl=e=>e,Dl=()=>{},Ll=({contents:e})=>e,kl=e=>{throw Error("Streams in object mode are not supported: "+e)},Ml=e=>e.length,jl={init:()=>({contents:[]}),convertChunk:{string:Cl,buffer:Cl,arrayBuffer:Cl,dataView:Cl,typedArray:Cl,others:Cl},getSize:()=>1,truncateChunk:Dl,addChunk:(e,{contents:t})=>(t.push(e),t),getFinalChunk:Dl,finalize:Ll},Ul=new TextEncoder,Fl=e=>new Uint8Array(e),Bl=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Gl=e=>Hl**Math.ceil(Math.log(e)/Math.log(Hl)),Hl=2,ql=()=>"resize"in ArrayBuffer.prototype,Vl={init:()=>({contents:new ArrayBuffer(0)}),convertChunk:{string:e=>Ul.encode(e),buffer:Fl,arrayBuffer:Fl,dataView:Bl,typedArray:Bl,others:kl},getSize:Ml,truncateChunk:(e,t)=>e.slice(0,t),addChunk:(e,{contents:t,length:r},n)=>{const o=ql()?((e,t)=>{if(e.maxByteLength>=t)return e.resize(t),e;const r=new ArrayBuffer(t,{maxByteLength:Gl(t)});return new Uint8Array(r).set(new Uint8Array(e),0),r})(t,n):((e,t)=>{if(e.byteLength>=t)return e;const r=new ArrayBuffer(Gl(t));return new Uint8Array(r).set(new Uint8Array(e),0),r})(t,n);return new Uint8Array(o).set(e,r),o},getFinalChunk:Dl,finalize:({contents:e,length:t})=>ql()?e:e.slice(0,t)},zl=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),Wl={init:()=>({contents:"",textDecoder:new TextDecoder}),convertChunk:{string:Cl,buffer:zl,arrayBuffer:zl,dataView:zl,typedArray:zl,others:kl},getSize:Ml,truncateChunk:(e,t)=>e.slice(0,t),addChunk:(e,{contents:t})=>t+e,getFinalChunk:({textDecoder:e})=>{const t=e.decode();return""===t?void 0:t},finalize:Ll},Xl=(e,t,r)=>{if(t.length!==r)return;const n=new $l;throw n.maxBufferInfo={fdNumber:"ipc"},n},Kl=([,e])=>e,Yl=({originalError:e,timedOut:t,timeout:r,isMaxBuffer:n,maxBuffer:o,errorCode:i,signal:s,signalDescription:a,exitCode:c,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:d,forceKillAfterDelay:p,killSignal:f})=>{const h=Jl(d,p);return t?`Command timed out after ${r} milliseconds${h}`:u?void 0===s?"Command was gracefully canceled with exit code "+c:d?"Command was gracefully canceled"+h:`Command was gracefully canceled with ${s} (${a})`:l?"Command was canceled"+h:n?`${((e,t)=>{const{streamName:r,threshold:n,unit:o}=((e,t)=>{if(void 0===(null==e?void 0:e.maxBufferInfo))return{streamName:"output",threshold:t[1],unit:"bytes"};const{maxBufferInfo:{fdNumber:r,unit:n}}=e;delete e.maxBufferInfo;const o=Li(t,r);return"ipc"===r?{streamName:"IPC output",threshold:o,unit:"messages"}:{streamName:_i(r),threshold:o,unit:n}})(e,t);return`Command's ${r} was larger than ${n} ${o}`})(e,o)}${h}`:void 0!==i?`Command failed with ${i}${h}`:d?`Command was killed with ${f} (${Da(f)})${h}`:void 0!==s?`Command was killed with ${s} (${a})`:void 0!==c?"Command failed with exit code "+c:"Command failed"},Jl=(e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:"",Ql=e=>"string"==typeof e?e:ri(e)?ai(e):"",Zl=({command:e,escapedCommand:t,stdio:r,all:n,ipcOutput:o,options:{cwd:i},startTime:s})=>nu({command:e,escapedCommand:t,cwd:i,durationMs:_s(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:[]}),eu=({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:o,startTime:i,isSync:s})=>tu({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}),tu=({error:e,command:t,escapedCommand:r,startTime:n,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,stdio:d,all:p,ipcOutput:f,options:{timeoutDuration:h,timeout:m=h,forceKillAfterDelay:y,killSignal:g,cwd:v,maxBuffer:w},isSync:b})=>{const{exitCode:E,signal:_,signalDescription:S}=ou(l,u),{originalMessage:O,shortMessage:T,message:R}=(({stdio:e,all:t,ipcOutput:r,originalError:n,signal:o,signalDescription:i,exitCode:s,escapedCommand:a,timedOut:c,isCanceled:l,isGracefullyCanceled:u,isMaxBuffer:d,isForcefullyTerminated:p,forceKillAfterDelay:f,killSignal:h,maxBuffer:m,timeout:y,cwd:g})=>{const v=Yl({originalError:n,timedOut:c,timeout:y,isMaxBuffer:d,maxBuffer:m,errorCode:null==n?void 0:n.code,signal:o,signalDescription:i,exitCode:s,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:p,forceKillAfterDelay:f,killSignal:h}),w=((e,t)=>{var r;if(e instanceof pa)return;const n=ma(o=e)&&ha in o?e.originalMessage:(null!=(r=null==e?void 0:e.message)?r:e)+"";var o;const i=Gi(((e,t)=>{if(t===sl())return e;let r;try{r=gn.statSync(t)}catch(o){return`The "cwd" option is invalid: ${t}.\n${o.message}\n${e}`}return r.isDirectory()?e:`The "cwd" option is not a directory: ${t}.\n${e}`})(n,t));return""===i?void 0:i})(n,g),b=`${v}: ${a}${void 0===w?"":"\n"+w}`,E=[b,...void 0===t?[e[2],e[1]]:[t],...e.slice(3),r.map((e=>(e=>"string"==typeof e?e:On.inspect(e))(e))).join("\n")].map((e=>Gi(N((e=>Array.isArray(e)?e.map((e=>N(Ql(e)))).filter(Boolean).join("\n"):Ql(e))(e))))).filter(Boolean).join("\n\n");return{originalMessage:w,shortMessage:b,message:E}})({stdio:d,all:p,ipcOutput:f,originalError:e,signal:_,signalDescription:S,exitCode:E,escapedCommand:r,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:y,killSignal:g,maxBuffer:w,timeout:m,cwd:v}),I=((e,t,r)=>new(r?ga:ya)(t,e instanceof pa?{}:{cause:e}))(e,R,b);return Object.assign(I,ru({error:I,command:t,escapedCommand:r,startTime:n,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:E,signal:_,signalDescription:S,stdio:d,all:p,ipcOutput:f,cwd:v,originalMessage:O,shortMessage:T})),I},ru=({error:e,command:t,escapedCommand:r,startTime:n,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,stdio:p,all:f,ipcOutput:h,cwd:m,originalMessage:y,shortMessage:g})=>{var v;return nu({shortMessage:g,originalMessage:y,command:t,escapedCommand:r,cwd:m,durationMs:_s(n),failed:!0,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isTerminated:void 0!==u,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,code:null==(v=e.cause)?void 0:v.code,stdout:p[1],stderr:p[2],all:f,stdio:p,ipcOutput:h,pipedFrom:[]})},nu=e=>Object.fromEntries(Object.entries(e).filter((([,e])=>void 0!==e))),ou=(e,t)=>{const r=null===t?void 0:t;return{exitCode:null===e?void 0:e,signal:r,signalDescription:void 0===r?void 0:Da(t)}},iu=e=>Number.isFinite(e)?e:0,su=(e,t)=>{const r=`(done in ${M(e.durationMs)})`;ps({type:"duration",verboseMessage:r,verboseInfo:t,result:e})},au=(e,t,{reject:r})=>{if(((e,t)=>{ki(t)&&(((e,t)=>{e.failed&&ps({type:"error",verboseMessage:e.shortMessage,verboseInfo:t,result:e})})(e,t),su(e,t))})(e,t),e.failed&&r)throw e;return e},cu=(e,t)=>gu(e)?"asyncGenerator":vu(e)?"generator":bu(e)?"fileUrl":Eu(e)?"filePath":Ru(e)?"webStream":A(e,{checkOpen:!1})?"native":ri(e)?"uint8Array":xu(e)?"asyncIterable":Nu(e)?"iterable":Iu(e)?du({transform:e},t):wu(e)?lu(e,t):"native",lu=(e,t)=>C(e.transform,{checkOpen:!1})?uu(e,t):Iu(e.transform)?du(e,t):hu(e,t),uu=(e,t)=>(pu(e,t,"Duplex stream"),"duplex"),du=(e,t)=>(pu(e,t,"web TransformStream"),"webTransform"),pu=({final:e,binary:t,objectMode:r},n,o)=>{fu(e,n+".final",o),fu(t,n+".binary",o),mu(r,n+".objectMode")},fu=(e,t,r)=>{if(void 0!==e)throw new TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${r}.`)},hu=({transform:e,final:t,binary:r,objectMode:n},o)=>{if(void 0!==e&&!yu(e))throw new TypeError(`The \`${o}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(C(t,{checkOpen:!1}))throw new TypeError(`The \`${o}.final\` option must not be a Duplex stream.`);if(Iu(t))throw new TypeError(`The \`${o}.final\` option must not be a web TransformStream.`);if(void 0!==t&&!yu(t))throw new TypeError(`The \`${o}.final\` option must be a generator.`);return mu(r,o+".binary"),mu(n,o+".objectMode"),gu(e)||gu(t)?"asyncGenerator":"generator"},mu=(e,t)=>{if(void 0!==e&&"boolean"!=typeof e)throw new TypeError(`The \`${t}\` option must use a boolean.`)},yu=e=>gu(e)||vu(e),gu=e=>"[object AsyncGeneratorFunction]"==={}.toString.call(e),vu=e=>"[object GeneratorFunction]"==={}.toString.call(e),wu=e=>b(e)&&(void 0!==e.transform||void 0!==e.final),bu=e=>"[object URL]"==={}.toString.call(e),Eu=e=>b(e)&&1===Object.keys(e).length&&_u(e.file),_u=e=>"string"==typeof e,Su=new Set(["ipc","ignore","inherit","overlapped","pipe"]),Ou=e=>"[object ReadableStream]"==={}.toString.call(e),Tu=e=>"[object WritableStream]"==={}.toString.call(e),Ru=e=>Ou(e)||Tu(e),Iu=e=>Ou(null==e?void 0:e.readable)&&Tu(null==e?void 0:e.writable),xu=e=>Au(e)&&"function"==typeof e[Symbol.asyncIterator],Nu=e=>Au(e)&&"function"==typeof e[Symbol.iterator],Au=e=>"object"==typeof e&&null!==e,Pu=new Set(["generator","asyncGenerator","duplex","webTransform"]),$u=new Set(["fileUrl","filePath","fileNumber"]),Cu=new Set(["fileUrl","filePath"]),Du=new Set([...Cu,"webStream","nodeStream"]),Lu=new Set(["webTransform","duplex"]),ku={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"},Mu=(e,t,r,n)=>"output"===n?ju(e,t,r):Uu(e,t,r),ju=(e,t,r)=>{const n=0!==t&&r[t-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:null!=e?e:n}},Uu=(e,t,r)=>{const n=0===t?!0===e:r[t-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:t!==r.length-1&&(null!=e?e:n)}},Fu=(e,t,r,{encoding:n})=>{const o=e.filter((({type:e})=>Pu.has(e))),i=Array.from({length:o.length});for(const[s,a]of Object.entries(o))i[s]=Bu({stdioItem:a,index:Number(s),newTransforms:i,optionName:t,direction:r,encoding:n});return Vu(i,r)},Bu=({stdioItem:e,stdioItem:{type:t},index:r,newTransforms:n,optionName:o,direction:i,encoding:s})=>"duplex"===t?Gu({stdioItem:e,optionName:o}):"webTransform"===t?Hu({stdioItem:e,index:r,newTransforms:n,direction:i}):qu({stdioItem:e,index:r,newTransforms:n,direction:i,encoding:s}),Gu=({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}}},Hu=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:n,direction:o})=>{const{transform:i,objectMode:s}=b(t)?t:{transform:t},{writableObjectMode:a,readableObjectMode:c}=Mu(s,r,n,o);return{...e,value:{transform:i,writableObjectMode:a,readableObjectMode:c}}},qu=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:n,direction:o,encoding:i})=>{const{transform:s,final:a,binary:c=!1,preserveNewlines:l=!1,objectMode:u}=b(t)?t:{transform:t},d=c||rl.has(i),{writableObjectMode:p,readableObjectMode:f}=Mu(u,r,n,o);return{...e,value:{transform:s,final:a,binary:d,preserveNewlines:l,writableObjectMode:p,readableObjectMode:f}}},Vu=(e,t)=>"input"===t?e.reverse():e,zu=["input","output","output"],Wu=()=>{},Xu=()=>"input",Ku={generator:Wu,asyncGenerator:Wu,fileUrl:Wu,filePath:Wu,iterable:Xu,asyncIterable:Xu,uint8Array:Xu,webStream:e=>Tu(e)?"output":"input",nodeStream:e=>$(e,{checkOpen:!1})?P(e,{checkOpen:!1})?void 0:"input":"output",webTransform:Wu,duplex:Wu,native(e){const t=Yu(e);return void 0!==t?t:A(e,{checkOpen:!1})?Ku.nodeStream(e):void 0}},Yu=e=>[0,xn.stdin].includes(e)?"input":[1,2,xn.stdout,xn.stderr].includes(e)?"output":void 0,Ju=e=>Ei.some((t=>void 0!==e[t])),Qu=(e,t)=>Array.isArray(e)?e.map((e=>Qu(e,t))):null==e?Ei.length>t?"pipe":"ignore":e,Zu=e=>"pipe"===e||Array.isArray(e)&&e.every((e=>"pipe"===e)),ed=({value:e,optionName:t,fdNumber:r,direction:n})=>{const o=td(e,r);if(void 0!==o){if("output"===n)return{type:"fileNumber",value:o,optionName:t};if(Nn.isatty(o))throw new TypeError(`The \`${t}: ${uc(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:ni(gn.readFileSync(o)),optionName:t}}},td=(e,t)=>{if("inherit"===e)return t;if("number"==typeof e)return e;const r=bi.indexOf(e);return-1!==r?r:void 0},rd=(e,t,r)=>{const n=bi[e];if(void 0===n)throw new TypeError(`The \`${r}: ${t}\` option is invalid: no such standard stream.`);return n},nd=({input:e,inputFile:t},r)=>0===r?[...od(e),...sd(t)]:[],od=e=>void 0===e?[]:[{type:id(e),value:e,optionName:"input"}],id=e=>{if($(e,{checkOpen:!1}))return"nodeStream";if("string"==typeof e)return"string";if(ri(e))return"uint8Array";throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},sd=e=>void 0===e?[]:[{...ad(e),optionName:"inputFile"}],ad=e=>{if(bu(e))return{type:"fileUrl",value:e};if(_u(e))return{type:"filePath",value:{file:e}};throw Error("The `inputFile` option must be a file path string or a file URL.")},cd=({otherStdioItems:e,type:t,value:r,optionName:n,direction:o})=>{const i=e.filter((e=>ld(e,r)));if(0===i.length)return;const s=i.find((e=>e.direction!==o));return ud(s,n,t),"output"===o?i[0].stream:void 0},ld=({type:e,value:t},r)=>"filePath"===e?t.file===r.file:"fileUrl"===e?t.href===r.href:t===r,ud=(e,t,r)=>{if(void 0!==e)throw new TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${ku[r]} that is the same.`)},dd=(e,t,r,n)=>{const o=(({stdio:e,ipc:t,buffer:r,...n},o,i)=>{const s=((e,t)=>{if(void 0===e)return Ei.map((e=>t[e]));if(Ju(t))throw Error("It's not possible to provide `stdio` in combination with one of "+Ei.map((e=>`\`${e}\``)).join(", "));if("string"==typeof e)return[e,e,e];if(!Array.isArray(e))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);return Array.from({length:Math.max(e.length,Ei.length)},((t,r)=>e[r]))})(e,n).map(((e,t)=>Qu(e,t)));return i?((e,t,r)=>e.map(((e,n)=>t[n]||0===n||Mi(r,n)||!Zu(e)?e:"ignore")))(s,r,o):((e,t)=>t&&!e.includes("ipc")?[...e,"ipc"]:e)(s,t)})(t,r,n),i=o.map(((e,r)=>pd({stdioOption:e,fdNumber:r,options:t,isSync:n}))),s=bd({initialFileDescriptors:i,addProperties:e,options:t,isSync:n});return t.stdio=s.map((({stdioItems:e})=>Od(e))),s},pd=({stdioOption:e,fdNumber:t,options:r,isSync:n})=>{const o=_i(t),{stdioItems:i,isStdioArray:s}=fd({stdioOption:e,fdNumber:t,options:r,optionName:o}),a=((e,t,r)=>{var n;const o=e.map((e=>(({type:e,value:t},r)=>{var n;return null!=(n=zu[r])?n:Ku[e](t)})(e,t)));if(o.includes("input")&&o.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return null!=(n=o.find(Boolean))?n:"output"})(i,t,o),c=i.map((e=>(({stdioItem:e,stdioItem:{type:t},isStdioArray:r,fdNumber:n,direction:o,isSync:i})=>r&&"native"===t?i?(({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:n,direction:o})=>{const i=ed({value:t,optionName:r,fdNumber:n,direction:o});if(void 0!==i)return i;if(A(t,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e})({stdioItem:e,fdNumber:n,direction:o}):(({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:n})=>"inherit"===t?{type:"nodeStream",value:rd(n,t,r),optionName:r}:"number"==typeof t?{type:"nodeStream",value:rd(t,t,r),optionName:r}:A(t,{checkOpen:!1})?{type:"nodeStream",value:t,optionName:r}:e)({stdioItem:e,fdNumber:n}):e)({stdioItem:e,isStdioArray:s,fdNumber:t,direction:a,isSync:n}))),l=((e,t,r,n)=>[...e.filter((({type:e})=>!Pu.has(e))),...Fu(e,t,r,n)])(c,o,a,r),u=((e,t)=>{const r=e.findLast((({type:e})=>Pu.has(e)));return void 0!==r&&("input"===t?r.value.writableObjectMode:r.value.readableObjectMode)})(l,a);return wd(l,u),{direction:a,objectMode:u,stdioItems:l}},fd=({stdioOption:e,fdNumber:t,options:r,optionName:n})=>{const o=(e=>e.filter(((t,r)=>e.every(((e,n)=>t.value!==e.value||r>=n||"generator"===t.type||"asyncGenerator"===t.type)))))([...(Array.isArray(e)?e:[e]).map((e=>hd(e,n))),...nd(r,t)]),i=o.length>1;return md(o,i,n),gd(o),{stdioItems:o,isStdioArray:i}},hd=(e,t)=>({type:cu(e,t),value:e,optionName:t}),md=(e,t,r)=>{if(0===e.length)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(t)for(const{value:n,optionName:o}of e)if(yd.has(n))throw Error(`The \`${o}\` option must not include \`${n}\`.`)},yd=new Set(["ignore","ipc"]),gd=e=>{for(const t of e)vd(t)},vd=({type:e,value:t,optionName:r})=>{if((e=>bu(e)&&"file:"!==e.protocol)(t))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme.\nFor example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(((e,t)=>"native"===e&&"string"==typeof t&&!Su.has(t))(e,t))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},wd=(e,t)=>{if(!t)return;const r=e.find((({type:e})=>$u.has(e)));if(void 0!==r)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},bd=({initialFileDescriptors:e,addProperties:t,options:r,isSync:n})=>{const o=[];try{for(const i of e)o.push(Ed({fileDescriptor:i,fileDescriptors:o,addProperties:t,options:r,isSync:n}));return o}catch(i){throw Sd(o),i}},Ed=({fileDescriptor:{direction:e,objectMode:t,stdioItems:r},fileDescriptors:n,addProperties:o,options:i,isSync:s})=>{const a=r.map((t=>_d({stdioItem:t,addProperties:o,direction:e,options:i,fileDescriptors:n,isSync:s})));return{direction:e,objectMode:t,stdioItems:a}},_d=({stdioItem:e,addProperties:t,direction:r,options:n,fileDescriptors:o,isSync:i})=>{const s=(({stdioItem:{type:e,value:t,optionName:r},direction:n,fileDescriptors:o,isSync:i})=>{const s=((e,t)=>e.flatMap((({direction:e,stdioItems:r})=>r.filter((e=>e.type===t)).map((t=>({...t,direction:e}))))))(o,e);if(0!==s.length){if(!i)return Du.has(e)?cd({otherStdioItems:s,type:e,value:t,optionName:r,direction:n}):void(Lu.has(e)&&(({otherStdioItems:e,type:t,value:r,optionName:n})=>{const o=e.find((({value:{transform:e}})=>e===r.transform));ud(o,n,t)})({otherStdioItems:s,type:e,value:t,optionName:r}));(({otherStdioItems:e,type:t,value:r,optionName:n,direction:o})=>{Cu.has(t)&&cd({otherStdioItems:e,type:t,value:r,optionName:n,direction:o})})({otherStdioItems:s,type:e,value:t,optionName:r,direction:n})}})({stdioItem:e,direction:r,fileDescriptors:o,isSync:i});return void 0!==s?{...e,stream:s}:{...e,...t[r][e.type](e,n)}},Sd=e=>{for(const{stdioItems:t}of e)for(const{stream:e}of t)void 0===e||wi(e)||e.destroy()},Od=e=>{if(e.length>1)return e.some((({value:e})=>"overlapped"===e))?"overlapped":"pipe";const[{type:t,value:r}]=e;return"native"===t?r:"pipe"},Td=({type:e,optionName:t})=>{Rd(t,ku[e])},Rd=(e,t)=>{throw new TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},Id={generator(){},asyncGenerator:Td,webStream:Td,nodeStream:Td,webTransform:Td,duplex:Td,asyncIterable:Td,native:({optionName:e,value:t})=>("ipc"!==t&&"overlapped"!==t||Rd(e,`"${t}"`),{})},xd={input:{...Id,fileUrl:({value:e})=>({contents:[ni(gn.readFileSync(e))]}),filePath:({value:{file:e}})=>({contents:[ni(gn.readFileSync(e))]}),fileNumber:Td,iterable:({value:e})=>({contents:[...e]}),string:({value:e})=>({contents:[e]}),uint8Array:({value:e})=>({contents:[e]})},output:{...Id,fileUrl:({value:e})=>({path:e}),filePath:({value:{file:e}})=>({path:e}),fileNumber:({value:e})=>({path:e}),iterable:Td,string:Td,uint8Array:Td}},Nd=(e,{stripFinalNewline:t},r)=>Ad(t,r)&&void 0!==e&&!Array.isArray(e)?N(e):e,Ad=(e,t)=>"all"===t?e[1]||e[2]:e[t],Pd=(e,t,r,n)=>e||r?void 0:Dd(t,n),$d=(e,t,r)=>r?e.flatMap((e=>Cd(e,t))):Cd(e,t),Cd=(e,t)=>{const{transform:r,final:n}=Dd(t,{});return[...r(e),...n()]},Dd=(e,t)=>(t.previousChunks="",{transform:Ld.bind(void 0,t,e),final:Md.bind(void 0,t)}),Ld=function*(e,t,r){if("string"!=typeof r)return void(yield r);let{previousChunks:n}=e,o=-1;for(let i=0;r.length>i;i+=1)if("\n"===r[i]){const s=kd(r,i,t,e);let a=r.slice(o+1,i+1-s);n.length>0&&(a=Fd(n,a),n=""),yield a,o=i}o!==r.length-1&&(n=Fd(n,r.slice(o+1))),e.previousChunks=n},kd=(e,t,r,n)=>r?0:(n.isWindowsNewline=0!==t&&"\r"===e[t-1],n.isWindowsNewline?2:1),Md=function*({previousChunks:e}){e.length>0&&(yield e)},jd=({binary:e,preserveNewlines:t,readableObjectMode:r,state:n})=>e||t||r?void 0:{transform:Ud.bind(void 0,n)},Ud=function*({isWindowsNewline:e=!1},t){const{unixNewline:r,windowsNewline:n,LF:o,concatBytes:i}="string"==typeof t?Bd:Gd;if(t.at(-1)===o)return void(yield t);const s=e?n:r;yield i(t,s)},Fd=(e,t)=>`${e}${t}`,Bd={windowsNewline:"\r\n",unixNewline:"\n",LF:"\n",concatBytes:Fd},Gd={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:(e,t)=>{const r=new Uint8Array(e.length+t.length);return r.set(e,0),r.set(t,e.length),r}},Hd=(e,t)=>e?void 0:qd.bind(void 0,t),qd=function*(e,t){if("string"!=typeof t&&!ri(t)&&!$n.Buffer.isBuffer(t))throw new TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},Vd=(e,t)=>e?zd.bind(void 0,t):Wd.bind(void 0,t),zd=function*(e,t){Xd(e,t),yield t},Wd=function*(e,t){if(Xd(e,t),"string"!=typeof t&&!ri(t))throw new TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},Xd=(e,t)=>{if(null==t)throw new TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.\nInstead, \`yield\` should either be called with a value, or not be called at all. For example:\n if (condition) { yield value; }`)},Kd=(e,t,r)=>{if(r)return;if(e)return{transform:Yd.bind(void 0,new TextEncoder)};const n=new In.StringDecoder(t);return{transform:Jd.bind(void 0,n),final:Qd.bind(void 0,n)}},Yd=function*(e,t){$n.Buffer.isBuffer(t)?yield ni(t):"string"==typeof t?yield e.encode(t):yield t},Jd=function*(e,t){yield ri(t)?e.write(t):t},Qd=function*(e){const t=e.end();""!==t&&(yield t)},Zd=On.callbackify((async(e,t,r,n)=>{t.currentIterable=e(...r);try{for await(const e of t.currentIterable)n.push(e)}finally{delete t.currentIterable}})),ep=async function*(e,t,r){if(r===t.length)return void(yield e);const{transform:n=op}=t[r];for await(const o of n(e))yield*ep(o,t,r+1)},tp=async function*(e){for(const[t,{final:r}]of Object.entries(e))yield*rp(r,Number(t),e)},rp=async function*(e,t,r){if(void 0!==e)for await(const n of e())yield*ep(n,r,t+1)},np=On.callbackify((async({currentIterable:e},t)=>{if(void 0===e){if(t)throw t}else await(t?e.throw(t):e.return())})),op=function*(e){yield e},ip=(e,t,r,n)=>{try{for(const n of e(...t))r.push(n);n()}catch(o){n(o)}},sp=(e,t)=>[...t.flatMap((t=>[...ap(t,e,0)])),...cp(e)],ap=function*(e,t,r){if(r===t.length)return void(yield e);const{transform:n=up}=t[r];for(const o of n(e))yield*ap(o,t,r+1)},cp=function*(e){for(const[t,{final:r}]of Object.entries(e))yield*lp(r,Number(t),e)},lp=function*(e,t,r){if(void 0!==e)for(const n of e())yield*ap(n,r,t+1)},up=function*(e){yield e},dp=({value:e,value:{transform:t,final:r,writableObjectMode:n,readableObjectMode:o},optionName:i},{encoding:s})=>{const a={},c=fp(e,s,i),l=gu(t),u=gu(r),d=l?Zd.bind(void 0,ep,a):ip.bind(void 0,ap),p=l||u?Zd.bind(void 0,tp,a):ip.bind(void 0,cp),f=l||u?np.bind(void 0,a):void 0;return{stream:new Pn.Transform({writableObjectMode:n,writableHighWaterMark:Pn.getDefaultHighWaterMark(n),readableObjectMode:o,readableHighWaterMark:Pn.getDefaultHighWaterMark(o),transform(e,t,r){d([e,c,0],this,r)},flush(e){p([c],this,e)},destroy:f})}},pp=(e,t,r,n)=>{const o=t.filter((({type:e})=>"generator"===e)),i=n?o.reverse():o;for(const{value:s,optionName:a}of i){const t=fp(s,r,a);e=sp(t,e)}return e},fp=({transform:e,final:t,binary:r,writableObjectMode:n,readableObjectMode:o,preserveNewlines:i},s,a)=>{const c={};return[{transform:Hd(n,a)},Kd(r,s,n),Pd(r,i,n,c),{transform:e,final:t},{transform:Vd(o,a)},jd({binary:r,preserveNewlines:i,readableObjectMode:o,state:c})].filter(Boolean)},hp=(e,t,r)=>{const{stdioItems:n}=e[t],o=n.filter((({contents:e})=>void 0!==e));if(0===o.length)return;if(0!==t){const[{type:e,optionName:t}]=o;throw new TypeError(`Only the \`stdin\` option, not \`${t}\`, can be ${ku[e]} with synchronous methods.`)}const i=o.map((({contents:e})=>e)).map((e=>mp(e,n)));r.input=ci(i)},mp=(e,t)=>{const r=pp(e,t,"utf8",!0);return yp(r),ci(r)},yp=e=>{const t=e.find((e=>"string"!=typeof e&&!ri(e)));if(void 0!==t)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}.`)},gp=({stdioItems:e,encoding:t,verboseInfo:r,fdNumber:n})=>"all"!==n&&Mi(r,n)&&!rl.has(t)&&vp(n)&&(e.some((({type:e,value:t})=>"native"===e&&wp.has(t)))||e.every((({type:e})=>Pu.has(e)))),vp=e=>1===e||2===e,wp=new Set(["pipe","overlapped"]),bp=e=>e._readableState.pipes.length>0,Ep=(e,t,r)=>{const n=gs(e);ps({type:"output",verboseMessage:n,fdNumber:t,verboseInfo:r})},_p=(e,t,r,n)=>{try{return pp(e,t,r,!1)}catch(o){return n.error=o,e}},Sp=({chunks:e,objectMode:t,encoding:r,lines:n,stripFinalNewline:o,fdNumber:i})=>{if(t)return{serializedResult:e};if("buffer"===r)return{serializedResult:ci(e)};const s=((e,t)=>((e,t)=>{if("utf8"===t&&e.every((e=>"string"==typeof e)))return e;const r=new In.StringDecoder(t),n=e.map((e=>"string"==typeof e?ii(e):e)).map((e=>r.write(e))),o=r.end();return""===o?n:[...n,o]})(e,t).join(""))(e,r);return n[i]?{serializedResult:s,finalResult:$d(s,!o[i],t)}:{serializedResult:s}},Op=({serializedResult:e,fdNumber:t,state:r,verboseInfo:n,encoding:o,stdioItems:i,objectMode:s})=>{if(!gp({stdioItems:i,encoding:o,verboseInfo:n,fdNumber:t}))return;const a=$d(e,!1,s);try{((e,t,r)=>{for(const n of e)Ep(n,t,r)})(a,t,n)}catch(c){null!=r.error||(r.error=c)}},Tp=(e,t,r)=>{for(const{path:n}of t.filter((({type:e})=>$u.has(e)))){const t="string"==typeof n?n:""+n;r.has(t)?gn.appendFileSync(n,e):(r.add(t),gn.writeFileSync(n,e))}},Rp=async e=>{try{return await Sn.once(e,"exit")}catch{return Rp(e)}},Ip=async e=>{const[t,r]=await e;if(!xp(t,r)&&Np(t,r))throw new pa;return[t,r]},xp=(e,t)=>void 0===e&&void 0===t,Np=(e,t)=>0!==e||null!==t,Ap=(e,t,r)=>void 0!==e?e:Np(t,r)?new pa:void 0,Pp=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,$p=({ipc:e,ipcInput:t,detached:r,cancelSignal:n})=>{t&&Cp("ipcInput"),e&&Cp("ipc: true"),r&&Cp("detached: true"),n&&Cp("cancelSignal")},Cp=e=>{throw new TypeError(`The "${e}" option cannot be used with synchronous methods.`)},Dp=({file:e,commandArguments:t,options:r,command:n,escapedCommand:o,verboseInfo:i,fileDescriptors:s,startTime:a})=>{const c=Lp({file:e,commandArguments:t,options:r,command:n,escapedCommand:o,fileDescriptors:s,startTime:a});if(c.failed)return c;const{resultError:l,exitCode:u,signal:d,timedOut:p,isMaxBuffer:f}=(({error:e,status:t,signal:r,output:n},{maxBuffer:o})=>{const i=Ap(e,t,r),s="ETIMEDOUT"===(null==i?void 0:i.code),a=((e,t,r)=>"ENOBUFS"===(null==e?void 0:e.code)&&null!==t&&t.some((e=>null!==e&&e.length>Kl(r))))(i,n,o);return{resultError:i,exitCode:t,signal:r,timedOut:s,isMaxBuffer:a}})(c,r),{output:h,error:m=l}=(({fileDescriptors:e,syncResult:{output:t},options:r,isMaxBuffer:n,verboseInfo:o})=>{if(null===t)return{output:Array.from({length:3})};const i={},s=new Set([]);return{output:t.map(((t,a)=>(({result:e,fileDescriptors:t,fdNumber:r,state:n,outputFiles:o,isMaxBuffer:i,verboseInfo:s},{buffer:a,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(null===e)return;const p=((e,t,r)=>{if(!t)return e;const n=Kl(r);return e.length>n?e.slice(0,n):e})(e,i,d),f=ni(p),{stdioItems:h,objectMode:y}=t[r],g=_p([f],h,c,n),{serializedResult:v,finalResult:w=v}=Sp({chunks:g,objectMode:y,encoding:c,lines:l,stripFinalNewline:u,fdNumber:r});Op({serializedResult:v,fdNumber:r,state:n,verboseInfo:s,encoding:c,stdioItems:h,objectMode:y});const b=a[r]?w:void 0;try{return void 0===n.error&&Tp(v,h,o),b}catch(m){return n.error=m,b}})({result:t,fileDescriptors:e,fdNumber:a,state:i,outputFiles:s,isMaxBuffer:n,verboseInfo:o},r))),...i}})({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:f,verboseInfo:i}),y=h.map(((e,t)=>Nd(e,r,t))),g=Nd((([,e,t],r)=>{if(r.all)return void 0===e?t:void 0===t?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,Nd(t,r,"all")]:Array.isArray(t)?[Nd(e,r,"all"),...t]:ri(e)&&ri(t)?ui([e,t]):`${e}${t}`})(h,r),r,"all");return Mp({error:m,exitCode:u,signal:d,timedOut:p,isMaxBuffer:f,stdio:y,all:g,options:r,command:n,escapedCommand:o,startTime:a})},Lp=({file:e,commandArguments:t,options:r,command:n,escapedCommand:o,fileDescriptors:i,startTime:s})=>{try{((e,t)=>{for(const r of(e=>new Set(Object.entries(e).filter((([,{direction:e}])=>"input"===e)).map((([e])=>Number(e)))))(e))hp(e,r,t)})(i,r);const n=kp(r);return Rn.spawnSync(e,t,n)}catch(a){return eu({error:a,command:n,escapedCommand:o,fileDescriptors:i,options:r,startTime:s,isSync:!0})}},kp=({encoding:e,maxBuffer:t,...r})=>({...r,encoding:"buffer",maxBuffer:Kl(t)}),Mp=({error:e,exitCode:t,signal:r,timedOut:n,isMaxBuffer:o,stdio:i,all:s,options:a,command:c,escapedCommand:l,startTime:u})=>void 0===e?Zl({command:c,escapedCommand:l,stdio:i,all:s,ipcOutput:[],options:a,startTime:u}):tu({error:e,command:c,escapedCommand:l,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:o,isForcefullyTerminated:!1,exitCode:t,signal:r,stdio:i,all:s,ipcOutput:[],options:a,startTime:u,isSync:!0}),jp=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},{reference:o=!0,filter:i}={})=>(Ha({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:_c(e)}),Up({anyProcess:e,channel:t,isSubprocess:r,filter:i,reference:o})),Up=async({anyProcess:e,channel:t,isSubprocess:r,filter:n,reference:o})=>{pc(t,o);const i=wc(e,t,r),s=new AbortController;try{return await Promise.race([Fp(i,n,s),Bp(i,r,s),Gp(i,r,s)])}catch(a){throw Qa(e),a}finally{s.abort(),hc(t,o)}},Fp=async(e,t,{signal:r})=>{if(void 0===t){const[t]=await Sn.once(e,"message",{signal:r});return t}for await(const[n]of Sn.on(e,"message",{signal:r}))if(t(n))return n},Bp=async(e,t,{signal:r})=>{await Sn.once(e,"disconnect",{signal:r}),(e=>{throw Error(`${Ka("getOneMessage",e)} could not complete: the ${Ja(e)} exited or disconnected.`)})(t)},Gp=async(e,t,{signal:r})=>{const[n]=await Sn.once(e,"strict:error",{signal:r});throw za(n,t)},Hp=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},{reference:o=!0}={})=>qp({anyProcess:e,channel:t,isSubprocess:r,ipc:n,shouldAwait:!r,reference:o}),qp=({anyProcess:e,channel:t,isSubprocess:r,ipc:n,shouldAwait:o,reference:i})=>{Ha({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:_c(e)}),pc(t,i);const s=wc(e,t,r),a=new AbortController,c={};return Vp(e,s,a),zp({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),Wp({anyProcess:e,channel:t,ipcEmitter:s,isSubprocess:r,shouldAwait:o,controller:a,state:c,reference:i})},Vp=async(e,t,r)=>{try{await Sn.once(t,"disconnect",{signal:r.signal}),r.abort()}catch{}},zp=async({ipcEmitter:e,isSubprocess:t,controller:r,state:n})=>{try{const[o]=await Sn.once(e,"strict:error",{signal:r.signal});n.error=za(o,t),r.abort()}catch{}},Wp=async function*({anyProcess:e,channel:t,ipcEmitter:r,isSubprocess:n,shouldAwait:o,controller:i,state:s,reference:a}){try{for await(const[e]of Sn.on(r,"message",{signal:i.signal}))Xp(s),yield e}catch{Xp(s)}finally{i.abort(),hc(t,a),n||Qa(e),o&&await e}},Xp=({error:e})=>{if(e)throw e},Kp=(e,t,r)=>({sendMessage:kc.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getOneMessage:jp.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getEachMessage:Hp.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})}),Yp=()=>{const e=new Pn.PassThrough;return e.end(),e},Jp=()=>new Pn.Readable({read(){}}),Qp=()=>new Pn.Writable({write(){}}),Zp=()=>new Pn.Duplex({read(){},write(){}}),ef=async(e,t,r)=>au(e,t,r),tf=({type:e,optionName:t})=>{throw new TypeError(`The \`${t}\` option cannot be ${ku[e]}.`)},rf={fileNumber:tf,generator:dp,asyncGenerator:dp,nodeStream:({value:e})=>({stream:e}),webTransform:({value:{transform:e,writableObjectMode:t,readableObjectMode:r}})=>({stream:Pn.Duplex.fromWeb(e,{objectMode:t||r})}),duplex:({value:{transform:e}})=>({stream:e}),native(){}},nf={input:{...rf,fileUrl:({value:e})=>({stream:gn.createReadStream(e)}),filePath:({value:{file:e}})=>({stream:gn.createReadStream(e)}),webStream:({value:e})=>({stream:Pn.Readable.fromWeb(e)}),iterable:({value:e})=>({stream:Pn.Readable.from(e)}),asyncIterable:({value:e})=>({stream:Pn.Readable.from(e)}),string:({value:e})=>({stream:Pn.Readable.from(e)}),uint8Array:({value:e})=>({stream:Pn.Readable.from($n.Buffer.from(e))})},output:{...rf,fileUrl:({value:e})=>({stream:gn.createWriteStream(e)}),filePath:({value:{file:e}})=>({stream:gn.createWriteStream(e)}),webStream:({value:e})=>({stream:Pn.Writable.fromWeb(e)}),iterable:tf,asyncIterable:tf,string:tf,uint8Array:tf}},of=(e,t)=>{if(0===e.length)return Pn.getDefaultHighWaterMark(t);const r=e.filter((({readableObjectMode:e})=>e===t)).map((({readableHighWaterMark:e})=>e));return Math.max(...r)};class sf extends Pn.PassThrough{constructor(){super(...arguments),fn(this,Wr,new Set([])),fn(this,Xr,new Set([])),fn(this,Kr,new Set([])),fn(this,Yr),fn(this,Jr,Symbol()),fn(this,Qr,new WeakMap)}add(e){if(uf(e),pn(this,Wr).has(e))return;pn(this,Wr).add(e),null!=pn(this,Yr)||hn(this,Yr,af(this,pn(this,Wr),pn(this,Jr)));const t=df({passThroughStream:this,stream:e,streams:pn(this,Wr),ended:pn(this,Xr),aborted:pn(this,Kr),onFinished:pn(this,Yr),unpipeEvent:pn(this,Jr)});pn(this,Qr).set(e,t),e.pipe(this,{end:!1})}async remove(e){if(uf(e),!pn(this,Wr).has(e))return!1;const t=pn(this,Qr).get(e);return void 0!==t&&(pn(this,Qr).delete(e),e.unpipe(this),await t,!0)}}Wr=new WeakMap,Xr=new WeakMap,Kr=new WeakMap,Yr=new WeakMap,Jr=new WeakMap,Qr=new WeakMap;const af=async(e,t,r)=>{Ef(e,_f);const n=new AbortController;try{await Promise.race([cf(e,n),lf(e,t,r,n)])}finally{n.abort(),Ef(e,-_f)}},cf=async(e,{signal:t})=>{try{await yl(e,{signal:t,cleanup:!0})}catch(r){throw yf(e,r),r}},lf=async(e,t,r,{signal:n})=>{for await(const[o]of Sn.on(e,"unpipe",{signal:n}))t.has(o)&&o.emit(r)},uf=e=>{if("function"!=typeof(null==e?void 0:e.pipe))throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},df=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,onFinished:i,unpipeEvent:s})=>{Ef(e,Sf);const a=new AbortController;try{await Promise.race([pf(i,t,a),ff({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:a}),hf({stream:t,streams:r,ended:n,aborted:o,unpipeEvent:s,controller:a})])}finally{a.abort(),Ef(e,-Sf)}r.size>0&&r.size===n.size+o.size&&(0===n.size&&o.size>0?vf(e):mf(e))},pf=async(e,t,{signal:r})=>{try{await e,r.aborted||vf(t)}catch(n){r.aborted||yf(t,n)}},ff=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:{signal:i}})=>{try{await yl(t,{signal:i,cleanup:!0,readable:!0,writable:!1}),r.has(t)&&n.add(t)}catch(s){if(i.aborted||!r.has(t))return;gf(s)?o.add(t):wf(e,s)}},hf=async({stream:e,streams:t,ended:r,aborted:n,unpipeEvent:o,controller:{signal:i}})=>{if(await Sn.once(e,o,{signal:i}),!e.readable)return Sn.once(i,"abort",{signal:i});t.delete(e),r.delete(e),n.delete(e)},mf=e=>{e.writable&&e.end()},yf=(e,t)=>{gf(t)?vf(e):wf(e,t)},gf=e=>"ERR_STREAM_PREMATURE_CLOSE"===(null==e?void 0:e.code),vf=e=>{(e.readable||e.writable)&&e.destroy()},wf=(e,t)=>{e.destroyed||(e.once("error",bf),e.destroy(t))},bf=()=>{},Ef=(e,t)=>{const r=e.getMaxListeners();0!==r&&r!==1/0&&e.setMaxListeners(r+t)},_f=2,Sf=1,Of=(e,t)=>{e.pipe(t),Tf(e,t),If(e,t)},Tf=async(e,t)=>{if(!wi(e)&&!wi(t)){try{await yl(e,{cleanup:!0,readable:!0,writable:!1})}catch{}Rf(t)}},Rf=e=>{e.writable&&e.end()},If=async(e,t)=>{if(!wi(e)&&!wi(t)){try{await yl(t,{cleanup:!0,readable:!1,writable:!0})}catch{}xf(e)}},xf=e=>{e.readable&&e.destroy()},Nf=(e,t,r,n)=>{"output"===r?Of(e.stdio[n],t):Of(t,e.stdio[n]);const o=Af[n];void 0!==o&&(e[o]=t),e.stdio[n]=t},Af=["stdin","stdout","stderr"],Pf=({subprocess:e,stream:t,direction:r,fdNumber:n,pipeGroups:o,controller:i})=>{var s;if(void 0===t)return;$f(t,i);const[a,c]="output"===r?[t,e.stdio[n]]:[e.stdio[n],t],l=null!=(s=o.get(a))?s:[];o.set(a,[...l,c])},$f=(e,{signal:t})=>{wi(e)&&dc(e,Cf,t)},Cf=2,Df=[];Df.push("SIGHUP","SIGINT","SIGTERM"),"win32"!==process.platform&&Df.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&Df.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const Lf=e=>!!e&&"object"==typeof e&&"function"==typeof e.removeListener&&"function"==typeof e.emit&&"function"==typeof e.reallyExit&&"function"==typeof e.listeners&&"function"==typeof e.kill&&"number"==typeof e.pid&&"function"==typeof e.on,kf=Symbol.for("signal-exit emitter"),Mf=globalThis,jf=Object.defineProperty.bind(Object);class Uf{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Mf[kf])return Mf[kf];jf(Mf,kf,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){const r=this.listeners[e],n=r.indexOf(t);-1!==n&&(0===n&&1===r.length?r.length=0:r.splice(n,1))}emit(e,t,r){if(this.emitted[e])return!1;this.emitted[e]=!0;let n=!1;for(const o of this.listeners[e])n=!0===o(t,r)||n;return"exit"===e&&(n=this.emit("afterExit",t,r)||n),n}}class Ff{}Zr=new WeakMap,en=new WeakMap,tn=new WeakMap,rn=new WeakMap,nn=new WeakMap,on=new WeakMap,sn=new WeakMap,an=new WeakSet,cn=function(e){return Lf(pn(this,tn))?(pn(this,tn).exitCode=e||0,pn(this,en).emit("exit",pn(this,tn).exitCode,null),pn(this,nn).call(pn(this,tn),pn(this,tn).exitCode)):0},ln=function(e,...t){const r=pn(this,rn);if("exit"===e&&Lf(pn(this,tn))){"number"==typeof t[0]&&(pn(this,tn).exitCode=t[0]);const n=r.call(pn(this,tn),e,...t);return pn(this,en).emit("exit",pn(this,tn).exitCode,null),n}return r.call(pn(this,tn),e,...t)};const Bf=globalThis.process,{onExit:Gf}=(Hf=Lf(Bf)?new class extends Ff{constructor(e){super(),fn(this,an),fn(this,Zr,"win32"===Bf.platform?"SIGINT":"SIGHUP"),fn(this,en,new Uf),fn(this,tn),fn(this,rn),fn(this,nn),fn(this,on,{}),fn(this,sn,!1),hn(this,tn,e),hn(this,on,{});for(const t of Df)pn(this,on)[t]=()=>{const r=pn(this,tn).listeners(t);let{count:n}=pn(this,en);if("object"==typeof e.__signal_exit_emitter__&&"number"==typeof e.__signal_exit_emitter__.count&&(n+=e.__signal_exit_emitter__.count),r.length===n){this.unload();const r=pn(this,en).emit("exit",null,t),n="SIGHUP"===t?pn(this,Zr):t;r||e.kill(e.pid,n)}};hn(this,nn,e.reallyExit),hn(this,rn,e.emit)}onExit(e,t){if(!Lf(pn(this,tn)))return()=>{};!1===pn(this,sn)&&this.load();const r=(null==t?void 0:t.alwaysLast)?"afterExit":"exit";return pn(this,en).on(r,e),()=>{pn(this,en).removeListener(r,e),0===pn(this,en).listeners.exit.length&&0===pn(this,en).listeners.afterExit.length&&this.unload()}}load(){if(!pn(this,sn)){hn(this,sn,!0),pn(this,en).count+=1;for(const t of Df)try{const e=pn(this,on)[t];e&&pn(this,tn).on(t,e)}catch(e){}pn(this,tn).emit=(e,...t)=>mn(this,an,ln).call(this,e,...t),pn(this,tn).reallyExit=e=>mn(this,an,cn).call(this,e)}}unload(){pn(this,sn)&&(hn(this,sn,!1),Df.forEach((e=>{const t=pn(this,on)[e];if(!t)throw Error("Listener not defined for signal: "+e);try{pn(this,tn).removeListener(e,t)}catch(r){}})),pn(this,tn).emit=pn(this,rn),pn(this,tn).reallyExit=pn(this,nn),pn(this,en).count-=1)}}(Bf):new class extends Ff{onExit(){return()=>{}}load(){}unload(){}},{onExit:(e,t)=>Hf.onExit(e,t),load:()=>Hf.load(),unload:()=>Hf.unload()});var Hf;const qf=(e,t,r,...n)=>{if(Array.isArray(r))return{destination:t(Vf,e)(r,...n),pipeOptions:e};if("string"==typeof r||r instanceof URL){if(Object.keys(e).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');const[o,i,s]=ei(r,...n);return{destination:t(Vf)(o,i,s),pipeOptions:s}}if(rc.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)},Vf=({options:e})=>({options:{...e,stdin:"pipe",piped:!0}}),zf=({error:e,fileDescriptors:t,sourceOptions:r,startTime:n})=>eu({error:e,command:Wf,escapedCommand:Wf,fileDescriptors:t,options:r,startTime:n,isSync:!1}),Wf="source.pipe(destination)",Xf=async e=>{const[{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),"rejected"===o)throw s;if("rejected"===t)throw n;return s},Kf=new WeakMap,Yf=(e,t)=>void 0===e?[]:[Jf(e,t)],Jf=async(e,{sourceStream:t,mergedStream:r,fileDescriptors:n,sourceOptions:o,startTime:i})=>{throw await On.aborted(e,t),await r.remove(t),zf({error:Error("Pipe canceled by `unpipeSignal` option."),fileDescriptors:n,sourceOptions:o,startTime:i})},Qf=(e,...t)=>{if(b(t[0]))return Qf.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});const{destination:r,...n}=(({source:e,sourcePromise:t,boundOptions:r,createNested:n},...o)=>{const i=Es(),{destination:s,destinationStream:a,destinationError:c,from:l,unpipeSignal:u}=((e,t,r)=>{try{const{destination:n,pipeOptions:{from:o,to:i,unpipeSignal:s}={}}=qf(e,t,...r);return{destination:n,destinationStream:ec(n,i),from:o,unpipeSignal:s}}catch(n){return{destinationError:n}}})(r,n,o),{sourceStream:d,sourceError:p}=((e,t)=>{try{return{sourceStream:tc(e,t)}}catch(r){return{sourceError:r}}})(e,l),{options:f,fileDescriptors:h}=rc.get(e);return{sourcePromise:t,sourceStream:d,sourceOptions:f,sourceError:p,destination:s,destinationStream:a,destinationError:c,unpipeSignal:u,fileDescriptors:h,startTime:i}})(e,...t),o=Zf({...n,destination:r});return o.pipe=Qf.bind(void 0,{...e,source:r,sourcePromise:o,boundOptions:{}}),o},Zf=async({sourcePromise:e,sourceStream:t,sourceOptions:r,sourceError:n,destination:o,destinationStream:i,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{const u=eh(e,o);(({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n,fileDescriptors:o,sourceOptions:i,startTime:s})=>{const a=(({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n})=>void 0!==t&&void 0!==n?n:void 0!==n?(xf(e),n):void 0!==t?(Rf(r),t):void 0)({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n});if(void 0!==a)throw zf({error:a,fileDescriptors:o,sourceOptions:i,startTime:s})})({sourceStream:t,sourceError:n,destinationStream:i,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:l});const d=new AbortController;try{const e=((e,t,r)=>{const n=Kf.has(t)?((e,t)=>{const r=Kf.get(t);return r.add(e),r})(e,t):((e,t)=>{const r=j([e]);return Of(r,t),Kf.set(t,r),r})(e,t);return dc(e,2,r.signal),dc(t,1,r.signal),(async e=>{try{await yl(e,{cleanup:!0,readable:!1,writable:!0})}catch{}Kf.delete(e)})(t),n})(t,i,d);return await Promise.race([Xf(u),...Yf(a,{sourceStream:t,mergedStream:e,sourceOptions:r,fileDescriptors:c,startTime:l})])}finally{d.abort()}},eh=(e,t)=>Promise.allSettled([e,t]),th=({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:n,encoding:o,preserveNewlines:i})=>{const s=new AbortController;return rh(t,s),ih({stream:e,controller:s,binary:r,shouldEncode:!e.readableObjectMode&&n,encoding:o,shouldSplit:!e.readableObjectMode,preserveNewlines:i})},rh=async(e,t)=>{try{await e}catch{}finally{t.abort()}},nh=({stream:e,onStreamEnd:t,lines:r,encoding:n,stripFinalNewline:o,allMixed:i})=>{const s=new AbortController;oh(t,s,e);const a=e.readableObjectMode&&!i;return ih({stream:e,controller:s,binary:"buffer"===n,shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!o})},oh=async(e,t,r)=>{try{await e}catch{r.destroy()}finally{t.abort()}},ih=({stream:e,controller:t,binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s})=>{const a=Sn.on(e,"data",{signal:t.signal,highWaterMark:ah,highWatermark:ah});return ch({onStdoutChunk:a,controller:t,binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s})},sh=Pn.getDefaultHighWaterMark(!0),ah=sh,ch=async function*({onStdoutChunk:e,controller:t,binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s}){const a=lh({binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s});try{for await(const[t]of e)yield*ap(t,a,0)}catch(c){if(!t.signal.aborted)throw c}finally{yield*cp(a)}},lh=({binary:e,shouldEncode:t,encoding:r,shouldSplit:n,preserveNewlines:o})=>[Kd(e,r,!t),Pd(e,o,!n,{})].filter(Boolean),uh=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,buffer:o,maxBuffer:i,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{const d=dh({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,allMixed:a,verboseInfo:l,streamInfo:u});if(!o)return void(await Promise.all([ph(e),d]));const p=Ad(c,r),f=nh({stream:e,onStreamEnd:t,lines:s,encoding:n,stripFinalNewline:p,allMixed:a}),[h]=await Promise.all([fh({stream:e,iterable:f,fdNumber:r,encoding:n,maxBuffer:i,lines:s}),d]);return h},dh=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,allMixed:o,verboseInfo:i,streamInfo:{fileDescriptors:s}})=>{var a;if(!gp({stdioItems:null==(a=s[r])?void 0:a.stdioItems,encoding:n,verboseInfo:i,fdNumber:r}))return;const c=nh({stream:e,onStreamEnd:t,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:o});await(async(e,t,r,n)=>{for await(const o of e)bp(t)||Ep(o,r,n)})(c,e,r,i)},ph=async e=>{await da(),null===e.readableFlowing&&e.resume()},fh=async({stream:e,stream:{readableObjectMode:t},iterable:r,fdNumber:n,encoding:o,maxBuffer:i,lines:s})=>{try{return t||s?await async function(e,t){return Rl(e,jl,t)}(r,{maxBuffer:i}):"buffer"===o?new Uint8Array(await async function(e,t){return Rl(e,Vl,t)}(r,{maxBuffer:i})):await async function(e,t){return Rl(e,Wl,t)}(r,{maxBuffer:i})}catch(a){return mh((({error:e,stream:t,readableObjectMode:r,lines:n,encoding:o,fdNumber:i})=>{if(!(e instanceof $l))throw e;if("all"===i)return e;const s=((e,t,r)=>e?"objects":t?"lines":"buffer"===r?"bytes":"characters")(r,n,o);throw e.maxBufferInfo={fdNumber:i,unit:s},t.destroy(),e})({error:a,stream:e,readableObjectMode:t,lines:s,encoding:o,fdNumber:n}))}},hh=async e=>{try{return await e}catch(t){return mh(t)}},mh=({bufferedData:e})=>"[object ArrayBuffer]"===ti.call(e)?new Uint8Array(e):e,yh=async(e,t,r,{isSameDirection:n,stopOnExit:o=!1}={})=>{const i=gh(e,r),s=new AbortController;try{await Promise.race([...o?[r.exitPromise]:[],yl(e,{cleanup:!0,signal:s.signal})])}catch(a){i.stdinCleanedUp||bh(a,t,r,n)}finally{s.abort()}},gh=(e,{originalStreams:[t],subprocess:r})=>{const n={stdinCleanedUp:!1};return e===t&&vh(e,r,n),n},vh=(e,t,r)=>{const{_destroy:n}=e;e._destroy=(...o)=>{wh(t,r),n.call(e,...o)}},wh=({exitCode:e,signalCode:t},r)=>{null===e&&null===t||(r.stdinCleanedUp=!0)},bh=(e,t,r,n)=>{if(!Eh(e,t,r,n))throw e},Eh=(e,t,r,n=!0)=>r.propagating?Oh(e)||Sh(e):(r.propagating=!0,_h(r,t)===n?Oh(e):Sh(e)),_h=({fileDescriptors:e},t)=>"all"!==t&&"input"===e[t].direction,Sh=e=>"ERR_STREAM_PREMATURE_CLOSE"===(null==e?void 0:e.code),Oh=e=>"EPIPE"===(null==e?void 0:e.code),Th=async({stream:e,fdNumber:t,encoding:r,buffer:n,maxBuffer:o,lines:i,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l})=>{if(!e)return;const u=yh(e,t,l);if(_h(l,t))return void(await u);const[d]=await Promise.all([uh({stream:e,onStreamEnd:u,fdNumber:t,encoding:r,buffer:n,maxBuffer:o,lines:i,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l}),u]);return d},Rh=({stdout:e,stderr:t,all:r},[,n,o])=>{const i=n||o;return i?n?o?{stream:r,buffer:i}:{stream:e,buffer:i}:{stream:t,buffer:i}:{stream:r,buffer:i}},Ih=({all:e,stdout:t,stderr:r})=>e&&t&&r&&t.readableObjectMode!==r.readableObjectMode,xh=(e,t)=>{const r=gs(e);ps({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:t})},Nh=async(e,t)=>(await Promise.allSettled([e]),t),Ah=async({subprocess:e,options:{encoding:t,buffer:r,maxBuffer:n,lines:o,timeoutDuration:i,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:p,verboseInfo:f,fileDescriptors:h,originalStreams:m,onInternalError:y,controller:g})=>{const v=(async(e,t)=>{const[r,n]=await(async e=>{const[t,r]=await Promise.allSettled([Sn.once(e,"spawn"),Sn.once(e,"exit")]);return"rejected"===t.status?[]:"rejected"===r.status?Rp(e):r.value})(e);return null!=t.isForcefullyTerminated||(t.isForcefullyTerminated=!1),[r,n]})(e,p),w={originalStreams:m,fileDescriptors:h,subprocess:e,exitPromise:v,propagating:!1},b=(({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:i,verboseInfo:s,streamInfo:a})=>e.stdio.map(((e,c)=>Th({stream:e,fdNumber:c,encoding:t,buffer:r[c],maxBuffer:n[c],lines:o[c],allMixed:!1,stripFinalNewline:i,verboseInfo:s,streamInfo:a}))))({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:l,verboseInfo:f,streamInfo:w}),E=(({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:i,verboseInfo:s,streamInfo:a})=>Th({...Rh(e,r),fdNumber:"all",encoding:t,maxBuffer:n[1]+n[2],lines:o[1]||o[2],allMixed:Ih(e),stripFinalNewline:i,verboseInfo:s,streamInfo:a}))({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:l,verboseInfo:f,streamInfo:w}),_=[],S=(async({subprocess:e,buffer:t,maxBuffer:r,ipc:n,ipcOutput:o,verboseInfo:i})=>{if(!n)return o;const s=(e=>Mi(e,"ipc"))(i),a=Li(t,"ipc"),c=Li(r,"ipc");for await(const l of qp({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(Xl(0,o,c),o.push(l)),s&&xh(l,i);return o})({subprocess:e,buffer:r,maxBuffer:n,ipc:u,ipcOutput:_,verboseInfo:f}),O=Ph(m,e,w),T=$h(h,w);try{return await Promise.race([Promise.all([{},Ip(v),Promise.all(b),E,S,el(e,d),...O,...T]),y,Ch(e,g),...Jc(e,i,p,g),...Ba({subprocess:e,cancelSignal:s,gracefulCancel:a,context:p,controller:g}),...Xc({subprocess:e,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:p,controller:g})])}catch(R){return null!=p.terminationReason||(p.terminationReason="other"),Promise.all([{error:R},v,Promise.all(b.map((e=>hh(e)))),hh(E),Nh(S,_),Promise.allSettled(O),Promise.allSettled(T)])}},Ph=(e,t,r)=>e.map(((e,n)=>e===t.stdio[n]?void 0:yh(e,n,r))),$h=(e,t)=>e.flatMap((({stdioItems:e},r)=>e.filter((({value:e,stream:t=e})=>A(t,{checkOpen:!1})&&!wi(t))).map((({type:e,value:n,stream:o=n})=>yh(o,r,t,{isSameDirection:Pu.has(e),stopOnExit:"native"===e}))))),Ch=async(e,{signal:t})=>{const[r]=await Sn.once(e,"error",{signal:t});throw r},Dh=(e,t,r)=>{const n=e[r];n.has(t)||n.set(t,[]);const o=n.get(t),i=Za();return o.push(i),{resolve:i.resolve.bind(i),promises:o}},Lh=async({resolve:e,promises:t},r)=>{e();const[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...t])]);return!n},kh=async e=>{if(void 0!==e)try{await Mh(e)}catch{}},Mh=async e=>{await yl(e,{cleanup:!0,readable:!1,writable:!0})},jh=async e=>{await yl(e,{cleanup:!0,readable:!0,writable:!1})},Uh=async(e,t)=>{if(await e,t)throw t},Fh=(e,t,r)=>{r&&!Sh(r)?e.destroy(r):t&&e.destroy()},Bh=({subprocess:e,concurrentStreams:t,encoding:r},{from:n,binary:o=!0,preserveNewlines:i=!0}={})=>{const s=o||rl.has(r),{subprocessStdout:a,waitReadableDestroy:c}=Gh(e,n,t),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=Hh(a,s),{read:p,onStdoutDataDone:f}=qh({subprocessStdout:a,subprocess:e,binary:s,encoding:r,preserveNewlines:i}),h=new Pn.Readable({read:p,destroy:On.callbackify(Wh.bind(void 0,{subprocessStdout:a,subprocess:e,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return zh({subprocessStdout:a,onStdoutDataDone:f,readable:h,subprocess:e}),h},Gh=(e,t,r)=>{const n=tc(e,t);return{subprocessStdout:n,waitReadableDestroy:Dh(r,n,"readableDestroy")}},Hh=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r},n)=>n?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:sh},qh=({subprocessStdout:e,subprocess:t,binary:r,encoding:n,preserveNewlines:o})=>{const i=Za(),s=th({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{const{value:n,done:o}=await t.next();o?r.resolve():e.push(n)}catch{}},zh=async({subprocessStdout:e,onStdoutDataDone:t,readable:r,subprocess:n,subprocessStdin:o})=>{try{await jh(e),await n,await kh(o),await t,r.readable&&r.push(null)}catch(i){await kh(o),Xh(r,i)}},Wh=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:r},n)=>{await Lh(r,t)&&(Xh(e,n),await Uh(t,n))},Xh=(e,t)=>{Fh(e,e.readable,t)},Kh=({subprocess:e,concurrentStreams:t},{to:r}={})=>{const{subprocessStdin:n,waitWritableFinal:o,waitWritableDestroy:i}=Yh(e,r,t),s=new Pn.Writable({...Jh(n,e,o),destroy:On.callbackify(tm.bind(void 0,{subprocessStdin:n,subprocess:e,waitWritableFinal:o,waitWritableDestroy:i})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return em(n,s),s},Yh=(e,t,r)=>{const n=ec(e,t);return{subprocessStdin:n,waitWritableFinal:Dh(r,n,"writableFinal"),waitWritableDestroy:Dh(r,n,"writableDestroy")}},Jh=(e,t,r)=>({write:Qh.bind(void 0,e),final:On.callbackify(Zh.bind(void 0,e,t,r))}),Qh=(e,t,r,n)=>{e.write(t,r)?n():e.once("drain",n)},Zh=async(e,t,r)=>{await Lh(r,t)&&(e.writable&&e.end(),await t)},em=async(e,t,r)=>{try{await Mh(e),t.writable&&t.end()}catch(n){await(async e=>{if(void 0!==e)try{await jh(e)}catch{}})(r),rm(t,n)}},tm=async({subprocessStdin:e,subprocess:t,waitWritableFinal:r,waitWritableDestroy:n},o)=>{await Lh(r,t),await Lh(n,t)&&(rm(e,o),await Uh(t,o))},rm=(e,t)=>{Fh(e,e.writable,t)},nm=({subprocess:e,concurrentStreams:t,encoding:r},{from:n,to:o,binary:i=!0,preserveNewlines:s=!0}={})=>{const a=i||rl.has(r),{subprocessStdout:c,waitReadableDestroy:l}=Gh(e,n,t),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:p}=Yh(e,o,t),{readableEncoding:f,readableObjectMode:h,readableHighWaterMark:m}=Hh(c,a),{read:y,onStdoutDataDone:g}=qh({subprocessStdout:c,subprocess:e,binary:a,encoding:r,preserveNewlines:s}),v=new Pn.Duplex({read:y,...Jh(u,e,d),destroy:On.callbackify(om.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:e,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:p})),readableHighWaterMark:m,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:h,writableObjectMode:u.writableObjectMode,encoding:f});return zh({subprocessStdout:c,onStdoutDataDone:g,readable:v,subprocess:e,subprocessStdin:u}),em(u,v,c),v},om=async({subprocessStdout:e,subprocessStdin:t,subprocess:r,waitReadableDestroy:n,waitWritableFinal:o,waitWritableDestroy:i},s)=>{await Promise.all([Wh({subprocessStdout:e,subprocess:r,waitReadableDestroy:n},s),tm({subprocessStdin:t,subprocess:r,waitWritableFinal:o,waitWritableDestroy:i},s)])},im=(e,t,{from:r,binary:n=!1,preserveNewlines:o=!1}={})=>{const i=n||rl.has(t),s=tc(e,r),a=th({subprocessStdout:s,subprocess:e,binary:i,shouldEncode:!0,encoding:t,preserveNewlines:o});return sm(a,s,e)},sm=async function*(e,t,r){try{yield*e}finally{t.readable&&t.destroy(),await r}},am=(e,{encoding:t})=>{const r={readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap};e.readable=Bh.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.writable=Kh.bind(void 0,{subprocess:e,concurrentStreams:r}),e.duplex=nm.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.iterable=im.bind(void 0,e,t),e[Symbol.asyncIterator]=im.bind(void 0,e,t,{})},cm=(async()=>{})().constructor.prototype,lm=["then","catch","finally"].map((e=>[e,Reflect.getOwnPropertyDescriptor(cm,e)])),um=(e,t,r)=>{const{command:n,escapedCommand:o,startTime:i,verboseInfo:s}=Ss(e,t,r),{file:a,commandArguments:c,options:l}=al(e,t,r),u=dm(l),d=((e,t)=>dd(nf,e,t,!1))(u,s);return{file:a,commandArguments:c,command:n,escapedCommand:o,startTime:i,verboseInfo:s,options:u,fileDescriptors:d}},dm=({timeout:e,signal:t,...r})=>{if(void 0!==t)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:e}},pm=({file:e,commandArguments:t,options:r,startTime:n,verboseInfo:o,command:i,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=Rn.spawn(e,t,r)}catch(f){return(({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:o,startTime:i,verboseInfo:s})=>{Sd(n);const a=new Rn.ChildProcess;((e,t)=>{const r=Yp(),n=Yp(),o=Yp(),i=Array.from({length:t.length-3},Yp),s=Yp(),a=[r,n,o,...i];Object.assign(e,{stdin:r,stdout:n,stderr:o,all:s,stdio:a})})(a,n),Object.assign(a,{readable:Jp,writable:Qp,duplex:Zp});const c=eu({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:o,startTime:i,isSync:!1});return{subprocess:a,promise:ef(c,s,o)}})({error:f,command:i,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:o})}const l=new AbortController;Sn.setMaxListeners(1/0,l.signal);const u=[...c.stdio];((e,t,r)=>{const n=new Map;for(const[o,{stdioItems:i,direction:s}]of Object.entries(t)){for(const{stream:t}of i.filter((({type:e})=>Pu.has(e))))Nf(e,t,s,o);for(const{stream:t}of i.filter((({type:e})=>!Pu.has(e))))Pf({subprocess:e,stream:t,direction:s,fdNumber:o,pipeGroups:n,controller:r})}for(const[o,i]of n.entries()){const e=1===i.length?i[0]:j(i);Of(e,o)}})(c,a,l),((e,{cleanup:t,detached:r},{signal:n})=>{if(!t||r)return;const o=Gf((()=>{e.kill()}));Sn.addAbortListener(n,(()=>{o()}))})(c,r,l);const d={},p=Za();return c.kill=La.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:p,context:d,controller:l}),c.all=(({stdout:e,stderr:t},{all:r})=>r&&(e||t)?j([e,t].filter(Boolean)):void 0)(c,r),am(c,r),((e,{ipc:t})=>{Object.assign(e,Kp(e,!1,t))})(c,r),{subprocess:c,promise:fm({subprocess:c,options:r,startTime:n,verboseInfo:o,fileDescriptors:a,originalStreams:u,command:i,escapedCommand:s,context:d,onInternalError:p,controller:l})}},fm=async({subprocess:e,options:t,startTime:r,verboseInfo:n,fileDescriptors:o,originalStreams:i,command:s,escapedCommand:a,context:c,onInternalError:l,controller:u})=>{const[d,[p,f],h,m,y]=await Ah({subprocess:e,options:t,context:c,verboseInfo:n,fileDescriptors:o,originalStreams:i,onInternalError:l,controller:u});u.abort(),l.resolve();const g=h.map(((e,r)=>Nd(e,t,r))),v=Nd(m,t,"all"),w=hm({errorInfo:d,exitCode:p,signal:f,stdio:g,all:v,ipcOutput:y,context:c,options:t,command:s,escapedCommand:a,startTime:r});return au(w,n,t)},hm=({errorInfo:e,exitCode:t,signal:r,stdio:n,all:o,ipcOutput:i,context:s,options:a,command:c,escapedCommand:l,startTime:u})=>"error"in e?tu({error:e.error,command:c,escapedCommand:l,timedOut:"timeout"===s.terminationReason,isCanceled:"cancel"===s.terminationReason||"gracefulCancel"===s.terminationReason,isGracefullyCanceled:"gracefulCancel"===s.terminationReason,isMaxBuffer:e.error instanceof $l,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:t,signal:r,stdio:n,all:o,ipcOutput:i,options:a,startTime:u,isSync:!1}):Zl({command:c,escapedCommand:l,stdio:n,all:o,ipcOutput:i,options:a,startTime:u}),mm=(e,t)=>{const r=Object.fromEntries(Object.entries(t).map((([t,r])=>[t,ym(t,e[t],r)])));return{...e,...r}},ym=(e,t,r)=>gm.has(e)&&b(t)&&b(r)?{...t,...r}:r,gm=new Set(["env",...Di]),vm=(e,t,r,n)=>{const o=(e,t,n)=>vm(e,t,r,n),i=(...i)=>wm({mapArguments:e,deepOptions:r,boundOptions:t,setBoundExeca:n,createNested:o},...i);return void 0!==n&&n(i,o,t),i},wm=({mapArguments:e,deepOptions:t={},boundOptions:r={},setBoundExeca:n,createNested:o},i,...s)=>{if(b(i))return o(e,mm(r,i),n);const{file:a,commandArguments:c,options:l,isSync:u}=bm({mapArguments:e,firstArgument:i,nextArguments:s,deepOptions:t,boundOptions:r});return u?((e,t,r)=>{const{file:n,commandArguments:o,command:i,escapedCommand:s,startTime:a,verboseInfo:c,options:l,fileDescriptors:u}=((e,t,r)=>{const{command:n,escapedCommand:o,startTime:i,verboseInfo:s}=Ss(e,t,r),a=Pp(r),{file:c,commandArguments:l,options:u}=al(e,t,a);$p(u);const d=((e,t)=>dd(xd,e,t,!0))(u,s);return{file:c,commandArguments:l,command:n,escapedCommand:o,startTime:i,verboseInfo:s,options:u,fileDescriptors:d}})(e,t,r),d=Dp({file:n,commandArguments:o,options:l,command:i,escapedCommand:s,verboseInfo:c,fileDescriptors:u,startTime:a});return au(d,c,l)})(a,c,l):((e,t,r,n)=>{const{file:o,commandArguments:i,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=um(e,t,r),{subprocess:p,promise:f}=pm({file:o,commandArguments:i,options:u,startTime:c,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:d});return p.pipe=Qf.bind(void 0,{source:p,sourcePromise:f,boundOptions:{},createNested:n}),((e,t)=>{for(const[r,n]of lm){const o=n.value.bind(t);Reflect.defineProperty(e,r,{...n,value:o})}})(p,f),rc.set(p,{options:u,fileDescriptors:d}),p})(a,c,l,o)},bm=({mapArguments:e,firstArgument:t,nextArguments:r,deepOptions:n,boundOptions:o})=>{const i=Array.isArray(s=t)&&Array.isArray(s.raw)?((e,t)=>{let r=[];for(const[i,s]of e.entries())r=pi({templates:e,expressions:t,tokens:r,index:i,template:s});if(0===r.length)throw new TypeError("Template script must not be empty");const[n,...o]=r;return[n,o,{}]})(t,r):[t,...r];var s;const[a,c,l]=ei(...i),u=mm(mm(n,o),l),{file:d=a,commandArguments:p=c,options:f=u,isSync:h=!1}=e({file:a,commandArguments:c,options:u});return{file:d,commandArguments:p,options:f,isSync:h}},Em=(e,t)=>{if(t.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${e} ${t}.`);const[r,...n]=_m(e);return{file:r,commandArguments:n}},_m=e=>{if("string"!=typeof e)throw new TypeError(`The command must be a string: ${e+""}.`);const t=e.trim();if(""===t)return[];const r=[];for(const n of t.split(Sm)){const e=r.at(-1);e&&e.endsWith("\\")?r[r.length-1]=`${e.slice(0,-1)} ${n}`:r.push(n)}return r},Sm=/ +/g,Om=({options:e})=>({...Tm(e),isSync:!0}),Tm=e=>({options:{...Rm(e),...e}}),Rm=({input:e,inputFile:t,stdio:r})=>void 0===e&&void 0===t&&void 0===r?{stdin:"inherit"}:{},Im=vm((()=>({}))),xm=vm((()=>({isSync:!0}))),Nm=vm((({file:e,commandArguments:t})=>Em(e,t))),Am=vm((({file:e,commandArguments:t})=>({...Em(e,t),isSync:!0})));vm((({options:e})=>{if(!1===e.node)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}})),vm((({options:e})=>Tm(e)),{},{preferLocal:!0},((e,t,r)=>{e.sync=t(Om,r),e.s=e.sync})),(()=>{const e=xn,t=!0,r=void 0!==xn.channel;Kp(e,t,r),Bc.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})})();var Pm={},$m={};const Cm=Mn.promises,{access:Dm,appendFile:Lm,chmod:km,chown:Mm,copyFile:jm,lchmod:Um,lchown:Fm,link:Bm,lstat:Gm,mkdir:Hm,mkdtemp:qm,open:Vm,readdir:zm,readFile:Wm,readlink:Xm,realpath:Km,rename:Ym,rmdir:Jm,stat:Qm,symlink:Zm,truncate:ey,unlink:ty,utimes:ry,writeFile:ny}=Mn.promises,oy="rm"in Mn.promises?Mn.promises.rm:On.promisify(Mn.unlink),iy=r(Object.freeze(Object.defineProperty({__proto__:null,access:Dm,appendFile:Lm,chmod:km,chown:Mm,copyFile:jm,default:Cm,lchmod:Um,lchown:Fm,link:Bm,lstat:Gm,mkdir:Hm,mkdtemp:qm,open:Vm,readFile:Wm,readdir:zm,readlink:Xm,realpath:Km,rename:Ym,rm:oy,rmdir:Jm,stat:Qm,symlink:Zm,truncate:ey,unlink:ty,utimes:ry,writeFile:ny},Symbol.toStringTag,{value:"Module"})));Object.defineProperty($m,"__esModule",{value:!0}),$m.sync=$m.isexe=void 0;const sy=gn,ay=iy;$m.isexe=async(e,t={})=>{const{ignoreErrors:r=!1}=t;try{return cy(await(0,ay.stat)(e),t)}catch(n){if(r||"EACCES"===n.code)return!1;throw n}},$m.sync=(e,t={})=>{const{ignoreErrors:r=!1}=t;try{return cy((0,sy.statSync)(e),t)}catch(n){if(r||"EACCES"===n.code)return!1;throw n}};const cy=(e,t)=>e.isFile()&&ly(e,t),ly=(e,t)=>{var r,n,o,i,s,a,c,l;const u=null!=(n=t.uid)?n:null==(r=process.getuid)?void 0:r.call(process),d=null!=(s=null!=(i=t.groups)?i:null==(o=process.getgroups)?void 0:o.call(process))?s:[],p=null!=(l=null!=(c=t.gid)?c:null==(a=process.getgid)?void 0:a.call(process))?l:d[0];if(void 0===u||void 0===p)throw Error("cannot get uid or gid");const f=new Set([p,...d]),h=e.mode,m=e.uid,y=e.gid,g=parseInt("100",8),v=parseInt("010",8),w=g|v;return!!(h&parseInt("001",8)||h&v&&f.has(y)||h&g&&m===u||h&w&&0===u)};var uy={};Object.defineProperty(uy,"__esModule",{value:!0}),uy.sync=uy.isexe=void 0;const dy=gn,py=iy;uy.isexe=async(e,t={})=>{const{ignoreErrors:r=!1}=t;try{return fy(await(0,py.stat)(e),e,t)}catch(n){if(r||"EACCES"===n.code)return!1;throw n}},uy.sync=(e,t={})=>{const{ignoreErrors:r=!1}=t;try{return fy((0,dy.statSync)(e),e,t)}catch(n){if(r||"EACCES"===n.code)return!1;throw n}};const fy=(e,t,r)=>e.isFile()&&((e,t)=>{const{pathExt:r=process.env.PATHEXT||""}=t,n=r.split(";");if(-1!==n.indexOf(""))return!0;for(let o=0;n.length>o;o++){const t=n[o].toLowerCase(),r=e.substring(e.length-t.length).toLowerCase();if(t&&r===t)return!0}return!1})(t,r);var hy={};Object.defineProperty(hy,"__esModule",{value:!0}),function(e){var t=Bn&&Bn.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=Bn&&Bn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=Bn&&Bn.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var o in e)"default"!==o&&{}.hasOwnProperty.call(e,o)&&t(n,e,o);return r(n,e),n},o=Bn&&Bn.__exportStar||function(e,r){for(var n in e)"default"===n||{}.hasOwnProperty.call(r,n)||t(r,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.sync=e.isexe=e.posix=e.win32=void 0;const i=n($m);e.posix=i;const s=n(uy);e.win32=s,o(hy,e);const a="win32"===(process.env._ISEXE_TEST_PLATFORM_||process.platform)?s:i;e.isexe=a.isexe,e.sync=a.sync}(Pm);const{isexe:my,sync:yy}=Pm,{join:gy,delimiter:vy,sep:wy,posix:by}=wn,Ey="win32"===process.platform,_y=RegExp(`[${by.sep}${wy===by.sep?"":wy}]`.replace(/(\\)/g,"\\$1")),Sy=RegExp("^\\."+_y.source),Oy=e=>Object.assign(Error("not found: "+e),{code:"ENOENT"}),Ty=(e,{path:t=process.env.PATH,pathExt:r=process.env.PATHEXT,delimiter:n=vy})=>{const o=e.match(_y)?[""]:[...Ey?[process.cwd()]:[],...(t||"").split(n)];if(Ey){const t=r||[".EXE",".CMD",".BAT",".COM"].join(n),i=t.split(n).flatMap((e=>[e,e.toLowerCase()]));return e.includes(".")&&""!==i[0]&&i.unshift(""),{pathEnv:o,pathExt:i,pathExtExe:t}}return{pathEnv:o,pathExt:[""]}},Ry=(e,t)=>{const r=/^".*"$/.test(e)?e.slice(1,-1):e;return(!r&&Sy.test(t)?t.slice(0,2):"")+gy(r,t)},Iy=async(e,t={})=>{const{pathEnv:r,pathExt:n,pathExtExe:o}=Ty(e,t),i=[];for(const s of r){const r=Ry(s,e);for(const e of n){const n=r+e;if(await my(n,{pathExt:o,ignoreErrors:!0})){if(!t.all)return n;i.push(n)}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw Oy(e)};var xy=Iy;Iy.sync=(e,t={})=>{const{pathEnv:r,pathExt:n,pathExtExe:o}=Ty(e,t),i=[];for(const s of r){const r=Ry(s,e);for(const e of n){const n=r+e;if(yy(n,{pathExt:o,ignoreErrors:!0})){if(!t.all)return n;i.push(n)}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw Oy(e)};const Ny=t(xy);let Ay;var Py,$y={};F($y,"hasSudo",(()=>B)),F($y,"isRoot",(()=>G)),F($y,"isSudo",(()=>H)),F($y,"prependSudo",(()=>q)),F($y,"defaultExecOptions",(()=>Cy)),F($y,"execRootSync",(()=>V)),F($y,"execRoot",(()=>z));let Cy={stdio:"inherit",shell:!0};F(Py={},"isAdminWindows",(()=>Dy)),F(Py,"isAdminPosix",(()=>Ly)),F(Py,"isAdmin",(()=>K));let Dy=async function(){var e;if("win32"!==process.platform)return!1;try{return await Im("fsutil",["dirty","query",null!=(e=process.env.systemdrive)?e:""]),!0}catch(t){return"ENOENT"===t.code&&async function(){try{return await Im("fltmc"),!0}catch{return!1}}()}},Ly=G;F({},"grantUserWriteAccess",(()=>Y));var ky,My,jy,Uy,Fy,By,Gy,Hy,qy,Vy,zy,Wy,Xy,Ky,Yy=function(e){return null!=e},Jy=Yy,Qy=[].forEach,Zy=Object.create,eg=function(e){var t=Zy(null);return Qy.call(arguments,(function(e){Jy(e)&&function(e,t){var r;for(r in e)t[r]=e[r]}(Object(e),t)})),t},tg="function"==typeof(jy=Math.sign)&&1===jy(10)&&-1===jy(-20)?Math.sign:My?ky:(My=1,ky=function(e){return isNaN(e=Number(e))||0===e?e:e>0?1:-1}),rg=Math.abs,ng=Math.floor,og=Math.max,ig=function(e){return og(0,function(e){return isNaN(e)?0:0!==(e=Number(e))&&isFinite(e)?tg(e)*ng(rg(e)):e}(e))},sg=ig,ag=function(e,t,r){var n;return isNaN(e)?0>(n=t)?1:r&&n?n-1:n:!1!==e&&sg(e)},cg=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e},lg=Yy,ug=function(e){if(!lg(e))throw new TypeError("Cannot use null or undefined");return e},dg=cg,pg=ug,fg=function(){}.bind,hg=function(){}.call,mg=Object.keys,yg={}.propertyIsEnumerable,gg=(Uy="forEach",function(e,t){var r,n=arguments[2],o=arguments[3];return e=Object(pg(e)),dg(t),r=mg(e),o&&r.sort("function"==typeof o?fg.call(o,e):void 0),"function"!=typeof Uy&&(Uy=r[Uy]),hg.call(Uy,r,(function(r,o){return yg.call(e,r)?hg.call(t,n,e[r],r,e,o):undefined}))}),vg={},wg={exports:{}},bg="function"==typeof(Ky=Object.assign)&&(Ky(Xy={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),Xy.foo+Xy.bar+Xy.trzy==="razdwatrzy")?Object.assign:function(){if(Wy)return zy;Wy=1;var e=Vy?qy:(Vy=1,qy=(By?Fy:(By=1,Fy=function(){try{return!0}catch(e){return!1}}))()?Object.keys:function(){if(Hy)return Gy;Hy=1;var e=Yy,t=Object.keys;return Gy=function(r){return t(e(r)?Object(r):r)}}()),t=ug,r=Math.max;return zy=function(n,o){var i,s,a,c=r(arguments.length,2);for(n=Object(t(n)),a=function(e){try{n[e]=o[e]}catch(t){i||(i=t)}},s=1;c>s;++s)e(o=arguments[s]).forEach(a);if(void 0!==i)throw i;return n},zy}(),Eg=Yy,_g={function:!0,object:!0},Sg=function(e){return Eg(e)&&_g[typeof e]||!1};!function(e){var t=bg,r=Sg,n=Yy,o=Error.captureStackTrace;e.exports=function(i){var s=Error(i),a=arguments[1],c=arguments[2];return n(c)||r(a)&&(c=a,a=null),n(c)&&t(s,c),n(a)&&(s.code=a),o&&o(s,e.exports),s}}(wg);var Og,Tg,Rg,Ig,xg=wg.exports,Ng={exports:{}},Ag=ig;try{Object.defineProperty((function(e,t){return t}),"length",{configurable:!0,writable:!1,enumerable:!1,value:1})}catch(YR){}Ig=J(),Rg=function(){var e=[];return function(t){var r,n=0;if(e[t])return e[t];for(r=[];t--;)r.push("a"+(++n).toString(36));return Function("fn","return function ("+r.join(", ")+") { return fn.apply(this, arguments); };")}}(),Ng.exports=function(e,t){var r;if(t=Ag(t),e.length===t)return e;r=Rg(t)(e);try{Ig(r,e)}catch(YR){}return r};var Pg,$g,Cg=Ng.exports,Dg={exports:{}},Lg=function(e){return null!=e},kg=Lg,Mg={object:!0,function:!0,undefined:!0},jg=function(e){if(!function(e){return!!kg(e)&&hasOwnProperty.call(Mg,typeof e)}(e))return!1;try{return!!e.constructor&&e.constructor.prototype===e}catch(t){return!1}},Ug=/^\s*class[\s{/}]/,Fg=function(){}.toString,Bg="razdwatrzy",Gg="function"==typeof Bg.contains&&!0===Bg.contains("dwa")&&!1===Bg.contains("foo")?"".contains:function(){if($g)return Pg;$g=1;var e="".indexOf;return Pg=function(t){return e.call(this,t,arguments[1])>-1}}(),Hg=Lg,qg=function(e){return!!function(e){if("function"!=typeof e)return!1;if(!hasOwnProperty.call(e,"length"))return!1;try{if("number"!=typeof e.length)return!1;if("function"!=typeof e.call)return!1;if("function"!=typeof e.apply)return!1}catch(t){return!1}return!jg(e)}(e)&&!Ug.test(Fg.call(e))},Vg=bg,zg=eg,Wg=Gg;(Dg.exports=function(e,t){var r,n,o,i,s;return 2>arguments.length||"string"!=typeof e?(i=t,t=e,e=null):i=arguments[2],Hg(e)?(r=Wg.call(e,"c"),n=Wg.call(e,"e"),o=Wg.call(e,"w")):(r=o=!0,n=!1),s={value:t,configurable:r,enumerable:n,writable:o},i?Vg(zg(i),s):s}).gs=function(e,t,r){var n,o,i,s;return"string"!=typeof e?(i=r,r=t,t=e,e=null):i=arguments[3],Hg(t)?qg(t)?Hg(r)?qg(r)||(i=r,r=void 0):r=void 0:(i=t,t=r=void 0):t=void 0,Hg(e)?(n=Wg.call(e,"c"),o=Wg.call(e,"e")):(n=!0,o=!1),s={get:t,set:r,configurable:n,enumerable:o},i?Vg(zg(i),s):s};var Xg,Kg,Yg,Jg,Qg,Zg,ev,tv,rv,nv,ov,iv,sv,av,cv,lv,uv,dv,pv=Dg.exports,fv={exports:{}};Xg=fv,ov=cg,iv=function(){}.apply,sv=function(){}.call,av=Object.create,cv=Object.defineProperty,lv=Object.defineProperties,uv={}.hasOwnProperty,dv={configurable:!0,enumerable:!1,writable:!0},Jg=function(e,t){var r,n;return ov(t),n=this,Yg.call(this,e,r=function(){Qg.call(n,e,r),iv.call(t,this,arguments)}),r.__eeOnceListener__=t,this},Qg=function(e,t){var r,n,o,i;if(ov(t),!uv.call(this,"__ee__"))return this;if(!(r=this.__ee__)[e])return this;if("object"==typeof(n=r[e]))for(i=0;o=n[i];++i)o!==t&&o.__eeOnceListener__!==t||(2===n.length?r[e]=n[i?0:1]:n.splice(i,1));else n!==t&&n.__eeOnceListener__!==t||delete r[e];return this},Zg=function(e){var t,r,n,o,i;if(uv.call(this,"__ee__")&&(o=this.__ee__[e]))if("object"==typeof o){for(i=Array((r=arguments.length)-1),t=1;r>t;++t)i[t-1]=arguments[t];for(o=o.slice(),t=0;n=o[t];++t)iv.call(n,this,i)}else switch(arguments.length){case 1:sv.call(o,this);break;case 2:sv.call(o,this,arguments[1]);break;case 3:sv.call(o,this,arguments[1],arguments[2]);break;default:for(i=Array((r=arguments.length)-1),t=1;r>t;++t)i[t-1]=arguments[t];iv.call(o,this,i)}},ev={on:Yg=function(e,t){var r;return ov(t),uv.call(this,"__ee__")?r=this.__ee__:(r=dv.value=av(null),cv(this,"__ee__",dv),dv.value=null),r[e]?"object"==typeof r[e]?r[e].push(t):r[e]=[r[e],t]:r[e]=t,this},once:Jg,off:Qg,emit:Zg},tv={on:(nv=pv)(Yg),once:nv(Jg),off:nv(Qg),emit:nv(Zg)},rv=lv({},tv),Xg.exports=Kg=function(e){return null==e?av(rv):lv(Object(e),tv)},Kg.methods=ev;var hv,mv,yv,gv,vv,wv,bv,Ev,_v,Sv,Ov,Tv,Rv,Iv,xv,Nv,Av,Pv,$v,Cv,Dv,Lv,kv,Mv,jv,Uv,Fv,Bv,Gv,Hv,qv,Vv,zv,Wv,Xv,Kv=fv.exports,Yv=te(),Jv=Array.isArray,Qv=Yy,Zv=cg,ew=[].slice;Xv=function(e){return this.map((function(t,r){return t?t(e[r]):e[r]})).concat(ew.call(e,this.length))};var tw,rw,nw,ow,iw,sw,aw,cw,lw,uw,dw,pw,fw,hw,mw,yw,gw,vw,ww,bw,Ew,_w,Sw,Ow,Tw,Rw,Iw,xw,Nw,Aw,Pw,$w,Cw,Dw,Lw,kw,Mw,jw,Uw,Fw,Bw,Gw,Hw,qw,Vw,zw,Ww,Xw=cg,Kw=xg,Yw=Cg,Jw=pv,Qw=Kv.methods,Zw=function(e){return(t=e,e=Jv(t)?t:Yv(t)).forEach((function(e){Qv(e)&&Zv(e)})),Xv.bind(e);var t},eb=function(){}.apply,tb=function(){}.call,rb=Object.create,nb=Object.defineProperties,ob=Qw.on,ib=Qw.emit,sb=cg,ab=gg,cb=vg,lb=function(e,t,r){var n,o,i,s,a,c,l,u,d,p,f,h,m,y,g,v=rb(null);return o=!1!==t?t:isNaN(e.length)?1:e.length,r.normalizer&&(p=function(e){var t;return"function"==typeof e?{set:e,get:e}:(t={get:Xw(e.get)},void 0!==e.set?(t.set=Xw(e.set),e.delete&&(t.delete=Xw(e.delete)),e.clear&&(t.clear=Xw(e.clear)),t):(t.set=t.get,t))}(r.normalizer),i=p.get,s=p.set,a=p.delete,c=p.clear),null!=r.resolvers&&(g=Zw(r.resolvers)),y=i?Yw((function(t){var r,o,a=arguments;if(g&&(a=g(a)),null!==(r=i(a))&&hasOwnProperty.call(v,r))return f&&n.emit("get",r,a,this),v[r];if(o=1===a.length?tb.call(e,this,a[0]):eb.call(e,this,a),null===r){if(null!==(r=i(a)))throw Kw("Circular invocation","CIRCULAR_INVOCATION");r=s(a)}else if(hasOwnProperty.call(v,r))throw Kw("Circular invocation","CIRCULAR_INVOCATION");return v[r]=o,h&&n.emit("set",r,null,o),o}),o):0===t?function(){var t;if(hasOwnProperty.call(v,"data"))return f&&n.emit("get","data",arguments,this),v.data;if(t=arguments.length?eb.call(e,this,arguments):tb.call(e,this),hasOwnProperty.call(v,"data"))throw Kw("Circular invocation","CIRCULAR_INVOCATION");return v.data=t,h&&n.emit("set","data",null,t),t}:function(t){var r,o,i=arguments;if(g&&(i=g(arguments)),o=i[0]+"",hasOwnProperty.call(v,o))return f&&n.emit("get",o,i,this),v[o];if(r=1===i.length?tb.call(e,this,i[0]):eb.call(e,this,i),hasOwnProperty.call(v,o))throw Kw("Circular invocation","CIRCULAR_INVOCATION");return v[o]=r,h&&n.emit("set",o,null,r),r},n={original:e,memoized:y,profileName:r.profileName,get:function(e){return g&&(e=g(e)),i?i(e):e[0]+""},has:function(e){return hasOwnProperty.call(v,e)},delete:function(e){var t;hasOwnProperty.call(v,e)&&(a&&a(e),t=v[e],delete v[e],m&&n.emit("delete",e,t))},clear:function(){var e=v;c&&c(),v=rb(null),n.emit("clear",e)},on:function(e,t){return"get"===e?f=!0:"set"===e?h=!0:"delete"===e&&(m=!0),ob.call(this,e,t)},emit:ib,updateEnv:function(){e=n.original}},l=i?Yw((function(e){var t,r=arguments;g&&(r=g(r)),null!==(t=i(r))&&n.delete(t)}),o):0===t?function(){return n.delete("data")}:function(e){return g&&(e=g(arguments)[0]),n.delete(e)},u=Yw((function(){var e,r=arguments;return 0===t?v.data:(g&&(r=g(r)),e=i?i(r):r[0]+"",v[e])})),d=Yw((function(){var e,r=arguments;return 0===t?n.has("data"):(g&&(r=g(r)),null!==(e=i?i(r):r[0]+"")&&n.has(e))})),nb(y,{__memoized__:Jw(!0),delete:Jw(l),clear:Jw(n.clear),_get:Jw(u),_has:Jw(d)}),n},ub=ag,db={},pb={},fb={exports:{}},hb={},mb={},yb={},gb={},vb=eg,wb=ag,bb=function e(t){var r,n,o;if(sb(t),(r=Object(arguments[1])).async&&r.promise)throw Error("Options 'async' and 'promise' cannot be used together");return hasOwnProperty.call(t,"__memoized__")&&!r.force?t:(n=ub(r.length,t.length,r.async&&cb.async),o=lb(t,n,r),ab(cb,(function(e,t){r[t]&&e(r[t],o,r)})),e.__profiler__&&e.__profiler__(o),o.updateEnv(),o.memoized)},Eb=function(e){var t,r=vb(arguments[1]);return r.normalizer||0!==(t=r.length=wb(r.length,e.length,r.async))&&(r.primitive?!1===t?r.normalizer=(rw||(rw=1,tw=function(e){var t,r,n=e.length;if(!n)return"";for(t=e[r=0]+"";--n;)t+=""+e[++r];return t}),tw):t>1&&(r.normalizer=(ow||(ow=1,nw=function(e){return e?function(t){for(var r=t[0]+"",n=0,o=e;--o;)r+=""+t[++n];return r}:function(){return""}}),nw)(t)):r.normalizer=!1===t?function(){if(hw)return fw;hw=1;var e=re(),t=Object.create;return fw=function(){var r=0,n=[],o=t(null);return{get:function(t){var r,o=0,i=n,s=t.length;if(0===s)return i[s]||null;if(i=i[s]){for(;s-1>o;){if(-1===(r=e.call(i[0],t[o])))return null;i=i[1][r],++o}return-1===(r=e.call(i[0],t[o]))?null:i[1][r]||null}return null},set:function(t){var i,s=0,a=n,c=t.length;if(0===c)a[c]=++r;else{for(a[c]||(a[c]=[[],[]]),a=a[c];c-1>s;)-1===(i=e.call(a[0],t[s]))&&(i=a[0].push(t[s])-1,a[1].push([[],[]])),a=a[1][i],++s;-1===(i=e.call(a[0],t[s]))&&(i=a[0].push(t[s])-1),a[1][i]=++r}return o[r]=t,r},delete:function(t){var r,i=0,s=n,a=o[t],c=a.length,l=[];if(0===c)delete s[c];else if(s=s[c]){for(;c-1>i;){if(-1===(r=e.call(s[0],a[i])))return;l.push(s,r),s=s[1][r],++i}if(-1===(r=e.call(s[0],a[i])))return;for(t=s[1][r],s[0].splice(r,1),s[1].splice(r,1);!s[0].length&&l.length;)r=l.pop(),(s=l.pop())[0].splice(r,1),s[1].splice(r,1)}delete o[t]},clear:function(){n=[],o=t(null)}}},fw}()():1===t?function(){if(yw)return mw;yw=1;var e=re();return mw=function(){var t=0,r=[],n=[];return{get:function(t){var o=e.call(r,t[0]);return-1===o?null:n[o]},set:function(e){return r.push(e[0]),n.push(++t),t},delete:function(t){var o=e.call(n,t);-1!==o&&(r.splice(o,1),n.splice(o,1))},clear:function(){r=[],n=[]}}}}()():function(){if(vw)return gw;vw=1;var e=re(),t=Object.create;return gw=function(r){var n=0,o=[[],[]],i=t(null);return{get:function(t){for(var n,i=0,s=o;r-1>i;){if(-1===(n=e.call(s[0],t[i])))return null;s=s[1][n],++i}return-1===(n=e.call(s[0],t[i]))?null:s[1][n]||null},set:function(t){for(var s,a=0,c=o;r-1>a;)-1===(s=e.call(c[0],t[a]))&&(s=c[0].push(t[a])-1,c[1].push([[],[]])),c=c[1][s],++a;return-1===(s=e.call(c[0],t[a]))&&(s=c[0].push(t[a])-1),c[1][s]=++n,i[n]=t,n},delete:function(t){for(var n,s=0,a=o,c=[],l=i[t];r-1>s;){if(-1===(n=e.call(a[0],l[s])))return;c.push(a,n),a=a[1][n],++s}if(-1!==(n=e.call(a[0],l[s]))){for(t=a[1][n],a[0].splice(n,1),a[1].splice(n,1);!a[0].length&&c.length;)n=c.pop(),(a=c.pop())[0].splice(n,1),a[1].splice(n,1);delete i[t]}},clear:function(){o=[[],[]],i=t(null)}}},gw}()(t)),r.async&&function(){if(Sw)return db;Sw=1;var e=te(),t=ne(),r=J(),n=Cg,o=oe(),i=[].slice,s=function(){}.apply,a=Object.create;vg.async=function(c,l){var u,d,p,f=a(null),h=a(null),m=l.memoized,y=l.original;l.memoized=n((function(e){var t=arguments,r=t[t.length-1];return"function"==typeof r&&(u=r,t=i.call(t,0,-1)),m.apply(d=this,p=t)}),m);try{r(l.memoized,m)}catch(YR){}l.on("get",(function(e){var t,r,n;if(u){if(f[e])return"function"==typeof f[e]?f[e]=[f[e],u]:f[e].push(u),void(u=null);t=u,r=d,n=p,u=d=p=null,o((function(){var o;hasOwnProperty.call(h,e)?(o=h[e],l.emit("getasync",e,n,r),s.call(t,o.context,o.args)):(u=t,d=r,p=n,m.apply(r,n))}))}})),l.original=function(){var t,r,n,i;return u?(t=e(arguments),r=function t(r){var n,a,c=t.id;if(null!=c){if(delete t.id,n=f[c],delete f[c],n)return a=e(arguments),l.has(c)&&(r?l.delete(c):(h[c]={context:this,args:a},l.emit("setasync",c,"function"==typeof n?1:n.length))),"function"==typeof n?i=s.call(n,this,a):n.forEach((function(e){i=s.call(e,this,a)}),this),i}else o(s.bind(t,this,arguments))},n=u,u=d=p=null,t.push(r),i=s.call(y,this,t),r.cb=n,u=r,i):s.call(y,this,arguments)},l.on("set",(function(e){u?(f[e]?"function"==typeof f[e]?f[e]=[f[e],u.cb]:f[e].push(u.cb):f[e]=u.cb,delete u.cb,u.id=e,u=null):l.delete(e)})),l.on("delete",(function(e){var t;hasOwnProperty.call(f,e)||h[e]&&(t=h[e],delete h[e],l.emit("deleteasync",e,i.call(t.args,1)))})),l.on("clear",(function(){var e=h;h=a(null),l.emit("clearasync",t(e,(function(e){return i.call(e.args,1)})))}))}}(),r.promise&&ae(),r.dispose&&function(){if(jw)return hb;jw=1;var e=cg,t=gg,r=vg,n=function(){}.apply;r.dispose=function(o,i,s){var a;if(e(o),s.async&&r.async||s.promise&&r.promise)return i.on("deleteasync",a=function(e,t){n.call(o,null,t)}),void i.on("clearasync",(function(e){t(e,(function(e,t){a(t,e)}))}));i.on("delete",a=function(e,t){o(t)}),i.on("clear",(function(e){t(e,(function(e,t){a(t,e)}))}))}}(),r.maxAge&&function(){if(Hw)return mb;Hw=1;var e=te(),t=gg,r=oe(),n=se(),o=function(){if(Gw)return Bw;Gw=1;var e=ig,t=Fw?Uw:(Fw=1,Uw=2147483647);return Bw=function(r){if((r=e(r))>t)throw new TypeError(r+" exceeds maximum possible timeout");return r}}(),i=vg,s=Function.prototype,a=Math.max,c=Math.min,l=Object.create;i.maxAge=function(u,d,p){var f,h,m,y;(u=o(u))&&(f=l(null),d.on("set"+(h=p.async&&i.async||p.promise&&i.promise?"async":""),(function(e){f[e]=setTimeout((function(){d.delete(e)}),u),"function"==typeof f[e].unref&&f[e].unref(),y&&(y[e]&&"nextTick"!==y[e]&&clearTimeout(y[e]),y[e]=setTimeout((function(){delete y[e]}),m),"function"==typeof y[e].unref&&y[e].unref())})),d.on("delete"+h,(function(e){clearTimeout(f[e]),delete f[e],y&&("nextTick"!==y[e]&&clearTimeout(y[e]),delete y[e])})),p.preFetch&&(m=!0===p.preFetch||isNaN(p.preFetch)?.333:a(c(Number(p.preFetch),1),0))&&(y={},m=(1-m)*u,d.on("get"+h,(function(t,o,i){y[t]||(y[t]="nextTick",r((function(){var r;"nextTick"===y[t]&&(delete y[t],d.delete(t),p.async&&(o=e(o)).push(s),r=d.memoized.apply(i,o),p.promise&&n(r)&&("function"==typeof r.done?r.done(s,s):r.then(s,s)))})))}))),d.on("clear"+h,(function(){t(f,(function(e){clearTimeout(e)})),f={},y&&(t(y,(function(e){"nextTick"!==e&&clearTimeout(e)})),y={})})))}}(),r.max&&function(){if(zw)return yb;zw=1;var e=ig,t=function(){if(Vw)return qw;Vw=1;var e=ig,t=Object.create,r={}.hasOwnProperty;return qw=function(n){var o,i=0,s=1,a=t(null),c=t(null),l=0;return n=e(n),{hit:function(e){var t=c[e],u=++l;if(a[u]=e,c[e]=u,!t){if(++i,n>=i)return;return o(e=a[s]),e}if(delete a[t],s===t)for(;!r.call(a,++s);)continue},delete:o=function(e){var t=c[e];if(t&&(delete a[t],delete c[e],--i,s===t)){if(!i)return l=0,void(s=1);for(;!r.call(a,++s);)continue}},clear:function(){i=0,s=1,a=t(null),c=t(null),l=0}}}}(),r=vg;r.max=function(n,o,i){var s,a,c;(n=e(n))&&(a=t(n),o.on("set"+(s=i.async&&r.async||i.promise&&r.promise?"async":""),c=function(e){void 0!==(e=a.hit(e))&&o.delete(e)}),o.on("get"+s,c),o.on("delete"+s,a.delete),o.on("clear"+s,a.clear))}}(),r.refCounter&&function(){if(Ww)return gb;Ww=1;var e=pv,t=vg,r=Object.create,n=Object.defineProperties;t.refCounter=function(o,i,s){var a,c;a=r(null),i.on("set"+(c=s.async&&t.async||s.promise&&t.promise?"async":""),(function(e,t){a[e]=t||1})),i.on("get"+c,(function(e){++a[e]})),i.on("delete"+c,(function(e){delete a[e]})),i.on("clear"+c,(function(){a={}})),n(i.memoized,{deleteRef:e((function(){var e=i.get(arguments);return null===e?null:a[e]?! --a[e]&&(i.delete(e),!0):null})),getRefCount:e((function(){var e=i.get(arguments);return null===e?0:a[e]?a[e]:0}))})}}(),bb(e,r)};const _b=t(Eb),Sb=/^~(?=$|\/|\\)/,{appendFile:Ob,readFile:Tb,writeFile:Rb}=gn.promises,Ib=le("~/.bashrc"),xb=_b((async function(e){const t=void 0===e.guard?`\nsource "${e.rcPath}"\n`:`\n# ${e.guard}\nif [[ "$SOURCE_${e.guard.toUpperCase()}RC" != 0 && -f "${e.rcPath}" ]]; then source "${e.rcPath}"; fi\n`;try{await Promise.all([ue(e),de(t,le("~/.bashrc")),de(t,le("~/.profile"))])}catch(r){g(`Failed to add ${t} to .profile or .bashrc. You should add it manually: ${r}`)}}),{promise:!0}),Nb=yn,Ab="win32"!==Nb.platform(),Pb=Nb.release(),$b=/(\d+\.\d+)\.(\d+)/,Cb=t((function(e){return Ab?e.replace(/(\s+)/g,"\\$1"):((e="",t="")=>/1\d+\.\d+/.test(e)&&Number(t)>=17134.1184)(...$b.exec(Pb).splice(1))?e:e.replace(/(\s+)/g,"%20")}));var Db,Lb,kb,Mb,jb={exports:{}};kb=function(){if(Lb)return Db;Lb=1;var e=/[|\\{}()[\]^$+*?.]/g;return Db=function(t){if("string"!=typeof t)throw new TypeError("Expected a string");return t.replace(e,"\\$&")}}(),Mb=function(e){return e.split("").reverse().join("")},jb.exports=function(e,t,r){var n;return null==t&&(t="'"),null==r&&(r="\\"),"string"!=typeof e?e:(n=RegExp("(["+kb(t)+"])(?!"+kb(r)+")","g"),Mb(Mb(e).replace(n,"$1"+r)))};const Ub=t(jb.exports),{appendFile:Fb}=gn.promises,{appendFile:Bb}=gn.promises,Gb=[/\/usr\/bin\/?/,/\/usr\/local\/bin\/?/];var Hb={exports:{}};!function(e){!function(){function t(e,t,o){if(r(e),"object"!=typeof o)throw Error("List of variants should be specified as an object");var i=n[e](t);return void 0!==o[i]?o[i]:null}function r(e){(function(e){return void 0!==n[e]})(e)||function(e){try{ye(__dirname+"/../locales/"+e+".js")}catch(t){throw Error("Failed to load the following locale: "+e)}}(e)}var n={},o={create:function(e){return r(e),{pluralize:function(r,n){return t(e,r,n)}}},addLocale:function(e,t){n[e]=t},pluralize:t};e.exports=o}()}(Hb);var qb=Hb.exports,Vb=qb;const zb=t(Vb);var Wb={};qb.addLocale("en",(function(e){var t=Math.floor(Math.abs(e)),r=(""+e).replace(/^[^.]*\.?/,"").length;return"string"==typeof e&&(e=parseInt(e,10)),1===t&&0===r?"one":"other"}));var Xb={exports:{}};Xb.exports=!("undefined"==typeof process||!process.versions||!process.versions.node);const Kb=Vb,Yb=Xb.exports,Jb=[["years",290304e5],["months",24192e5],["weeks",6048e5],["days",864e5],["hours",36e5],["minutes",6e4],["seconds",1e3]],Qb={locale:"en",span:2,delimiter:", ",unitType:"long",unitTypeLookupOrder:["long","short","narrow"],autoloadLocales:!0},Zb={},eE=t({create:function(e){return e=Object.assign({},Qb,e||{}),{format:function(t,r,n){return function(e,t,r){if(function(e,t){const{autoload:r}=t;if(!Zb[e]){if(!Yb||!r)throw Error(`Missing locale: ${e}, you must load it manually before using it`);!function(e){try{ge(ye(`../locales/${e}.js`))}catch(t){throw Error(`Failed to load locale: ${e} from ../locales/${e}.js. If using a bundled time-delta, set 'autoloadLocales: false' in the config: ${t}`)}}(e)}}(r.locale,{autoload:r.autoloadLocales}),!e)throw Error("Missing first date argument");if(!t)throw Error("Missing second date argument");const n=function(e,t){let r=t-e;const n=[];return Jb.some((function(e){const t=e[0],o=e[1],i=Math.floor(r/o);if(r-=i*o,n.push([t,i]),0>=r)return!0})),n}(e,t),o=[];for(const i of n){const[e,t]=i;if(t>0&&o.push(ve(e,t,r)),o.length>=r.span)break}return o.join(r.delimiter)}(t,r,n=Object.assign({},e,n||{}))}}},addLocale:ge,defaultConfig:Qb}),tE=t({id:"en",data:{long:{years:{one:"{0} year",other:"{0} years"},months:{one:"{0} month",other:"{0} months"},weeks:{one:"{0} week",other:"{0} weeks"},days:{one:"{0} day",other:"{0} days"},hours:{one:"{0} hour",other:"{0} hours"},minutes:{one:"{0} minute",other:"{0} minutes"},seconds:{one:"{0} second",other:"{0} seconds"}},narrow:{years:{one:"{0}y",other:"{0}y"},months:{one:"{0}m",other:"{0}m"},weeks:{one:"{0}w",other:"{0}w"},days:{one:"{0}d",other:"{0}d"},hours:{one:"{0}h",other:"{0}h"},minutes:{one:"{0}m",other:"{0}m"},seconds:{one:"{0}s",other:"{0}s"}},short:{years:{one:"{0} yr",other:"{0} yrs"},months:{one:"{0} mth",other:"{0} mths"},weeks:{one:"{0} wk",other:"{0} wks"},days:{one:"{0} day",other:"{0} days"},hours:{one:"{0} hr",other:"{0} hr"},minutes:{one:"{0} min",other:"{0} min"},seconds:{one:"{0} sec",other:"{0} sec"}}}});var rE={exports:{}},nE={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},oE="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};!function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:o}=nE,i=oE,s=(t=e.exports={}).re=[],a=t.safeRe=[],c=t.src=[],l=t.t={};let u=0;const d="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",o],[d,n]],f=(e,t,r)=>{const n=(e=>{for(const[t,r]of p)e=e.split(t+"*").join(`${t}{0,${r}}`).split(t+"+").join(`${t}{1,${r}}`);return e})(t),o=u++;i(e,o,t),l[e]=o,c[o]=t,s[o]=RegExp(t,r?"g":void 0),a[o]=RegExp(n,r?"g":void 0)};f("NUMERICIDENTIFIER","0|[1-9]\\d*"),f("NUMERICIDENTIFIERLOOSE","\\d+"),f("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),f("MAINVERSION",`(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`),f("MAINVERSIONLOOSE",`(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASEIDENTIFIER",`(?:${c[l.NUMERICIDENTIFIER]}|${c[l.NONNUMERICIDENTIFIER]})`),f("PRERELEASEIDENTIFIERLOOSE",`(?:${c[l.NUMERICIDENTIFIERLOOSE]}|${c[l.NONNUMERICIDENTIFIER]})`),f("PRERELEASE",`(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`),f("PRERELEASELOOSE",`(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`),f("BUILDIDENTIFIER",d+"+"),f("BUILD",`(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`),f("FULLPLAIN",`v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`),f("FULL",`^${c[l.FULLPLAIN]}$`),f("LOOSEPLAIN",`[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`),f("LOOSE",`^${c[l.LOOSEPLAIN]}$`),f("GTLT","((?:<|>)?=?)"),f("XRANGEIDENTIFIERLOOSE",c[l.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*"),f("XRANGEIDENTIFIER",c[l.NUMERICIDENTIFIER]+"|x|X|\\*"),f("XRANGEPLAIN",`[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`),f("XRANGEPLAINLOOSE",`[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`),f("XRANGE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`),f("XRANGELOOSE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`),f("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),f("COERCE",c[l.COERCEPLAIN]+"(?:$|[^\\d])"),f("COERCEFULL",c[l.COERCEPLAIN]+`(?:${c[l.PRERELEASE]})?(?:${c[l.BUILD]})?(?:$|[^\\d])`),f("COERCERTL",c[l.COERCE],!0),f("COERCERTLFULL",c[l.COERCEFULL],!0),f("LONETILDE","(?:~>?)"),f("TILDETRIM",`(\\s*)${c[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",f("TILDE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`),f("TILDELOOSE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`),f("LONECARET","(?:\\^)"),f("CARETTRIM",`(\\s*)${c[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",f("CARET",`^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`),f("CARETLOOSE",`^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`),f("COMPARATORLOOSE",`^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`),f("COMPARATOR",`^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`),f("COMPARATORTRIM",`(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",f("HYPHENRANGE",`^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`),f("HYPHENRANGELOOSE",`^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`),f("STAR","(<|>)?=?\\s*\\*"),f("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),f("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(rE,rE.exports);var iE=rE.exports;const sE=Object.freeze({loose:!0}),aE=Object.freeze({});var cE=e=>e?"object"!=typeof e?sE:e:aE;const lE=/^[0-9]+$/,uE=(e,t)=>{const r=lE.test(e),n=lE.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:t>e?-1:1};var dE={compareIdentifiers:uE,rcompareIdentifiers:(e,t)=>uE(t,e)};const pE=oE,{MAX_LENGTH:fE,MAX_SAFE_INTEGER:hE}=nE,{safeRe:mE,t:yE}=iE,gE=cE,{compareIdentifiers:vE}=dE;var wE=class e{constructor(t,r){if(r=gE(r),t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if("string"!=typeof t)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>fE)throw new TypeError(`version is longer than ${fE} characters`);pE("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?mE[yE.LOOSE]:mE[yE.FULL]);if(!n)throw new TypeError("Invalid Version: "+t);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>hE||0>this.major)throw new TypeError("Invalid major version");if(this.minor>hE||0>this.minor)throw new TypeError("Invalid minor version");if(this.patch>hE||0>this.patch)throw new TypeError("Invalid patch version");this.prerelease=n[4]?n[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&hE>t)return t}return e})):[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version}toString(){return this.version}compare(t){if(pE("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if("string"==typeof t&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),vE(this.major,t.major)||vE(this.minor,t.minor)||vE(this.patch,t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{const e=this.prerelease[r],n=t.prerelease[r];if(pE("prerelease compare",r,e,n),void 0===e&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===e)return-1;if(e!==n)return vE(e,n)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{const e=this.build[r],n=t.build[r];if(pE("build compare",r,e,n),void 0===e&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===e)return-1;if(e!==n)return vE(e,n)}while(++r)}inc(e,t,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(!t&&!1===r)throw Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===vE(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw Error("invalid increment argument: "+e)}return this.raw=this.format(),this.build.length&&(this.raw+="+"+this.build.join(".")),this}};const bE=wE;var EE=(e,t,r=!1)=>{if(e instanceof bE)return e;try{return new bE(e,t)}catch(n){if(!r)return null;throw n}};const _E=EE;var SE=(e,t)=>{const r=_E(e,t);return r?r.version:null};const OE=t(SE),TE=EE;const RE=wE;const IE=EE;const xE=wE;var NE=(e,t)=>new xE(e,t).major;const AE=t(NE),PE=wE;const $E=wE;const CE=EE;const DE=wE;var LE=(e,t,r)=>new DE(e,r).compare(new DE(t,r));const kE=t(LE),ME=LE;const jE=LE;const UE=wE;var FE=(e,t,r)=>{const n=new UE(e,r),o=new UE(t,r);return n.compare(o)||n.compareBuild(o)};const BE=FE;const GE=FE;const HE=LE;var qE=(e,t,r)=>HE(e,t,r)>0;const VE=LE;var zE=(e,t,r)=>0>VE(e,t,r);const WE=LE;var XE=(e,t,r)=>0===WE(e,t,r);const KE=LE;var YE=(e,t,r)=>0!==KE(e,t,r);const JE=LE;var QE=(e,t,r)=>JE(e,t,r)>=0;const ZE=LE;var e_=(e,t,r)=>0>=ZE(e,t,r);const t_=t(e_),r_=XE,n_=YE,o_=qE,i_=QE,s_=zE,a_=e_;var c_=(e,t,r,n)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return r_(e,r,n);case"!=":return n_(e,r,n);case">":return o_(e,r,n);case">=":return i_(e,r,n);case"<":return s_(e,r,n);case"<=":return a_(e,r,n);default:throw new TypeError("Invalid operator: "+t)}};const l_=wE,u_=EE,{safeRe:d_,t:p_}=iE;var f_=(e,t)=>{if(e instanceof l_)return e;if("number"==typeof e&&(e+=""),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){const n=t.includePrerelease?d_[p_.COERCERTLFULL]:d_[p_.COERCERTL];let o;for(;(o=n.exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&o.index+o[0].length===r.index+r[0].length||(r=o),n.lastIndex=o.index+o[1].length+o[2].length;n.lastIndex=-1}else r=e.match(t.includePrerelease?d_[p_.COERCEFULL]:d_[p_.COERCE]);return null===r?null:u_(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}${t.includePrerelease&&r[5]?"-"+r[5]:""}${t.includePrerelease&&r[6]?"+"+r[6]:""}`,t)};const h_=t(f_);var m_,y_,g_,v_,w_=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}};const b_=we();var E_=(e,t,r)=>{try{t=new b_(t,r)}catch(n){return!1}return t.test(e)};const __=we();const S_=wE,O_=we();const T_=wE,R_=we();const I_=wE,x_=we(),N_=qE;const A_=we();const P_=wE,$_=be(),{ANY:C_}=$_,D_=we(),L_=E_,k_=qE,M_=zE,j_=e_,U_=QE;var F_=(e,t,r,n)=>{let o,i,s,a,c;switch(e=new P_(e,n),t=new D_(t,n),r){case">":o=k_,i=j_,s=M_,a=">",c=">=";break;case"<":o=M_,i=U_,s=k_,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(L_(e,t,n))return!1;for(let l=0;t.set.length>l;++l){let r=null,u=null;if(t.set[l].forEach((e=>{e.semver===C_&&(e=new $_(">=0.0.0")),r=r||e,u=u||e,o(e.semver,r.semver,n)?r=e:s(e.semver,u.semver,n)&&(u=e)})),r.operator===a||r.operator===c)return!1;if((!u.operator||u.operator===a)&&i(e,u.semver))return!1;if(u.operator===c&&s(e,u.semver))return!1}return!0};const B_=F_;const G_=F_;const H_=we();const q_=E_,V_=LE,z_=we(),W_=be(),{ANY:X_}=W_,K_=E_,Y_=LE,J_=[new W_(">=0.0.0-0")],Q_=[new W_(">=0.0.0")],Z_=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===X_){if(1===t.length&&t[0].semver===X_)return!0;e=r.includePrerelease?J_:Q_}if(1===t.length&&t[0].semver===X_){if(r.includePrerelease)return!0;t=Q_}const n=new Set;let o,i,s,a,c,l,u;for(const f of e)">"===f.operator||">="===f.operator?o=eS(o,f,r):"<"===f.operator||"<="===f.operator?i=tS(i,f,r):n.add(f.semver);if(n.size>1)return null;if(o&&i){if(s=Y_(o.semver,i.semver,r),s>0)return null;if(0===s&&(">="!==o.operator||"<="!==i.operator))return null}for(const f of n){if(o&&!K_(f,o+"",r))return null;if(i&&!K_(f,i+"",r))return null;for(const e of t)if(!K_(f,e+"",r))return!1;return!0}let d=!(!i||r.includePrerelease||!i.semver.prerelease.length)&&i.semver,p=!(!o||r.includePrerelease||!o.semver.prerelease.length)&&o.semver;d&&1===d.prerelease.length&&"<"===i.operator&&0===d.prerelease[0]&&(d=!1);for(const f of t){if(u=u||">"===f.operator||">="===f.operator,l=l||"<"===f.operator||"<="===f.operator,o)if(p&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===p.major&&f.semver.minor===p.minor&&f.semver.patch===p.patch&&(p=!1),">"===f.operator||">="===f.operator){if(a=eS(o,f,r),a===f&&a!==o)return!1}else if(">="===o.operator&&!K_(o.semver,f+"",r))return!1;if(i)if(d&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===d.major&&f.semver.minor===d.minor&&f.semver.patch===d.patch&&(d=!1),"<"===f.operator||"<="===f.operator){if(c=tS(i,f,r),c===f&&c!==i)return!1}else if("<="===i.operator&&!K_(i.semver,f+"",r))return!1;if(!f.operator&&(i||o)&&0!==s)return!1}return!(o&&l&&!i&&0!==s||i&&u&&!o&&0!==s||p||d)},eS=(e,t,r)=>{if(!e)return t;const n=Y_(e.semver,t.semver,r);return n>0?e:0>n||">"===t.operator&&">="===e.operator?t:e},tS=(e,t,r)=>{if(!e)return t;const n=Y_(e.semver,t.semver,r);return 0>n?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};const rS=iE,nS=nE,oS=wE,iS=dE;var sS={parse:EE,valid:SE,clean:(e,t)=>{const r=TE(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null},inc:(e,t,r,n,o)=>{"string"==typeof r&&(o=n,n=r,r=void 0);try{return new RE(e instanceof RE?e.version:e,r).inc(t,n,o).version}catch(i){return null}},diff:(e,t)=>{const r=IE(e,null,!0),n=IE(t,null,!0),o=r.compare(n);if(0===o)return null;const i=o>0,s=i?r:n,a=i?n:r,c=!!s.prerelease.length;if(a.prerelease.length&&!c)return a.patch||a.minor?s.patch?"patch":s.minor?"minor":"major":"major";const l=c?"pre":"";return r.major!==n.major?l+"major":r.minor!==n.minor?l+"minor":r.patch!==n.patch?l+"patch":"prerelease"},major:NE,minor:(e,t)=>new PE(e,t).minor,patch:(e,t)=>new $E(e,t).patch,prerelease:(e,t)=>{const r=CE(e,t);return r&&r.prerelease.length?r.prerelease:null},compare:LE,rcompare:(e,t,r)=>ME(t,e,r),compareLoose:(e,t)=>jE(e,t,!0),compareBuild:FE,sort:(e,t)=>e.sort(((e,r)=>BE(e,r,t))),rsort:(e,t)=>e.sort(((e,r)=>GE(r,e,t))),gt:qE,lt:zE,eq:XE,neq:YE,gte:QE,lte:e_,cmp:c_,coerce:f_,Comparator:be(),Range:we(),satisfies:E_,toComparators:(e,t)=>new __(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" "))),maxSatisfying:(e,t,r)=>{let n=null,o=null,i=null;try{i=new O_(t,r)}catch(s){return null}return e.forEach((e=>{i.test(e)&&(n&&-1!==o.compare(e)||(n=e,o=new S_(n,r)))})),n},minSatisfying:(e,t,r)=>{let n=null,o=null,i=null;try{i=new R_(t,r)}catch(s){return null}return e.forEach((e=>{i.test(e)&&(n&&1!==o.compare(e)||(n=e,o=new T_(n,r)))})),n},minVersion:(e,t)=>{e=new x_(e,t);let r=new I_("0.0.0");if(e.test(r))return r;if(r=new I_("0.0.0-0"),e.test(r))return r;r=null;for(let n=0;e.set.length>n;++n){let t=null;e.set[n].forEach((e=>{const r=new I_(e.semver.version);switch(e.operator){case">":0===r.prerelease.length?r.patch++:r.prerelease.push(0),r.raw=r.format();case"":case">=":t&&!N_(r,t)||(t=r);break;case"<":case"<=":break;default:throw Error("Unexpected operation: "+e.operator)}})),!t||r&&!N_(r,t)||(r=t)}return r&&e.test(r)?r:null},validRange:(e,t)=>{try{return new A_(e,t).range||"*"}catch(r){return null}},outside:F_,gtr:(e,t,r)=>B_(e,t,">",r),ltr:(e,t,r)=>G_(e,t,"<",r),intersects:(e,t,r)=>(e=new H_(e,r),t=new H_(t,r),e.intersects(t,r)),simplifyRange:(e,t,r)=>{const n=[];let o=null,i=null;const s=e.sort(((e,t)=>V_(e,t,r)));for(const l of s)q_(l,t,r)?(i=l,o||(o=l)):(i&&n.push([o,i]),i=null,o=null);o&&n.push([o,null]);const a=[];for(const[l,u]of n)a.push(l===u?l:u||l!==s[0]?u?l===s[0]?"<="+u:`${l} - ${u}`:">="+l:"*");const c=a.join(" || ");return("string"==typeof t.raw?t.raw:t+"").length>c.length?c:t},subset:(e,t,r={})=>{if(e===t)return!0;e=new z_(e,r),t=new z_(t,r);let n=!1;e:for(const o of e.set){for(const e of t.set){const t=Z_(o,e,r);if(n=n||null!==t,t)continue e}if(n)return!1}return!0},SemVer:oS,re:rS.re,src:rS.src,tokens:rS.t,SEMVER_SPEC_VERSION:nS.SEMVER_SPEC_VERSION,RELEASE_TYPES:nS.RELEASE_TYPES,compareIdentifiers:iS.compareIdentifiers,rcompareIdentifiers:iS.rcompareIdentifiers},aS=sS,cS=yn,lS=wn,uS=gn,dS=En,pS=xn.env.npm_package_json,fS=xn.env.npm_config_user_agent,hS=!(!fS||!fS.startsWith("npm")),mS=!(!pS||!pS.endsWith("package.json")),yS=hS||mS,gS=!(!fS||!fS.startsWith("yarn")),vS=yS||gS,wS=cS.homedir(),bS=process.env.XDG_CONFIG_HOME||lS.join(wS,".config","simple-update-notifier"),ES=function(e){return lS.join(bS,"".concat(e.replace("@","").replace("/","__"),".json"))},_S=function(e,t){return Ee(void 0,0,void 0,(function(){var r;return _e(this,(function(n){return r="https://registry.npmjs.org/-/package/".concat(e,"/dist-tags"),[2,new Promise((function(e,n){dS.get(r,(function(r){var o="";r.on("data",(function(e){return o+=e})),r.on("end",(function(){try{var r=JSON.parse(o)[t];r||n(Error("Error getting version")),e(r)}catch(i){n(Error("Could not parse version response"))}}))})).on("error",(function(e){return n(e)}))}))]}))}))},SS=function(e){var t=e.pkg,r=e.updateCheckInterval,n=void 0===r?864e5:r,o=e.distTag,i=void 0===o?"latest":o,s=e.alwaysRun,a=e.debug;return Ee(void 0,0,void 0,(function(){var r,o;return _e(this,(function(c){switch(c.label){case 0:return uS.existsSync(bS)||uS.mkdirSync(bS,{recursive:!0}),r=function(t){var r=ES(t);try{if(!uS.existsSync(r))return;return JSON.parse(uS.readFileSync(r,"utf8")).lastUpdateCheck}catch(e){return}}(t.name),s||!r||r<(new Date).getTime()-n?[4,_S(t.name,i)]:[3,2];case 1:return o=c.sent(),l=ES(t.name),uS.writeFileSync(l,JSON.stringify({lastUpdateCheck:(new Date).getTime()})),aS.gt(o,t.version)?[2,o]:(a&&console.error("Latest version (".concat(o,") not newer than current version (").concat(t.version,")")),[3,3]);case 2:a&&console.error("Too recent to check for a new update. simpleUpdateNotifier() interval set to ".concat(n,"ms but only ").concat((new Date).getTime()-r,"ms since last check.")),c.label=3;case 3:return[2,!1]}var l}))}))};const OS=t((function(e){return Ee(void 0,0,void 0,(function(){var t,r;return _e(this,(function(n){switch(n.label){case 0:if(!e.alwaysRun&&(!process.stdout.isTTY||vS&&!e.shouldNotifyInNpmScript))return e.debug&&console.error("Opting out of running simpleUpdateNotifier()"),[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,SS(e)];case 2:return(t=n.sent())&&console.error(function(e){for(var t=e.split("\n"),r=Math.max.apply(Math,t.map((function(e){return e.length}))),n=["┌".concat("─".repeat(r+2),"┐")],o=0,i=t;i.length>o;o++)n.push("│ ".concat(i[o].padEnd(r)," │"));return n.push("└".concat("─".repeat(r+2),"┘")),n.join("\n")}("New version of ".concat(e.pkg.name," available!\nCurrent Version: ").concat(e.pkg.version,"\nLatest Version: ").concat(t))),[3,4];case 3:return r=n.sent(),e.debug&&r instanceof Error&&console.error("Unexpected error in simpleUpdateNotifier():",r),[3,4];case 4:return[2]}}))}))})),TS={name:"setup-cpp",version:"0.43.0"};var RS={};!function(e){function t(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)({}).hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}Object.defineProperty(e,"__esModule",{value:!0}),e.DownloaderHelper=e.DH_STATES=void 0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function e(e,t){for(var r,n=0;t.length>n;n++)(r=t[n]).enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=t(gn),s=Tn,a=t(wn),c=t(bn),l=t(En),u=Sn,d=e.DH_STATES={IDLE:"IDLE",SKIPPED:"SKIPPED",STARTED:"STARTED",DOWNLOADING:"DOWNLOADING",RETRY:"RETRY",PAUSED:"PAUSED",RESUMED:"RESUMED",STOPPED:"STOPPED",FINISHED:"FINISHED",FAILED:"FAILED"};e.DownloaderHelper=function(e){function t(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{captureRejections:!0}));return i.__validate(e,n)?(i.url=i.requestURL=e.trim(),i.state=d.IDLE,i.__defaultOpts={body:null,retry:!1,method:"GET",headers:{},fileName:"",timeout:-1,metadata:null,override:!1,forceResume:!1,removeOnStop:!0,removeOnFail:!0,progressThrottle:1e3,httpRequestOptions:{},httpsRequestOptions:{},resumeOnIncomplete:!0,resumeIfFileExists:!1,resumeOnIncompleteMaxRetry:5},i.__opts=Object.assign({},i.__defaultOpts),i.__pipes=[],i.__total=0,i.__downloaded=0,i.__progress=0,i.__retryCount=0,i.__retryTimeout=null,i.__resumeRetryCount=0,i.__states=d,i.__promise=null,i.__request=null,i.__response=null,i.__isAborted=!1,i.__isResumed=!1,i.__isResumable=!1,i.__isRedirected=!1,i.__destFolder=n,i.__statsEstimate={time:0,bytes:0,prevBytes:0,throttleTime:0},i.__fileName="",i.__filePath="",i.updateOptions(o),i):r(i)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"start",value:function(){var e=this,t=function(){return new Promise((function(t,r){e.__promise={resolve:t,reject:r},e.__start()}))};return this.__opts.resumeIfFileExists&&this.state!==this.__states.RESUMED?this.getTotalSize().then((function(r){var n=r.name,o=r.total,s=e.__opts.override;return e.__opts.override=!0,e.__filePath=e.__getFilePath(n),e.__opts.override=s,e.__filePath&&i.existsSync(e.__filePath)?e.__getFilesizeInBytes(e.__filePath)===o?t():e.resumeFromFile(e.__filePath,{total:o,fileName:n}):t()})):t()}},{key:"pause",value:function(){var e=this;return this.state===this.__states.STOPPED?Promise.resolve(!0):(this.__response&&(this.__response.unpipe(),this.__pipes.forEach((function(e){return e.stream.unpipe()}))),this.__fileStream&&this.__fileStream.removeAllListeners(),this.__requestAbort(),this.__closeFileStream().then((function(){return e.__setState(e.__states.PAUSED),e.emit("pause"),!0})))}},{key:"resume",value:function(){return this.__promise?this.state===this.__states.STOPPED?Promise.resolve(!1):(this.__setState(this.__states.RESUMED),this.__isResumable&&(this.__isResumed=!0,this.__reqOptions.headers.range="bytes="+this.__downloaded+"-"),this.emit("resume",this.__isResumed),this.__start()):this.start()}},{key:"stop",value:function(){var e=this;return this.state===this.__states.STOPPED?Promise.resolve(!0):(this.__requestAbort(),this.__closeFileStream().then((function(){return e.__opts.removeOnStop?new Promise((function(t,r){i.access(e.__filePath,(function(n){return n?(e.__emitStop(),t(!0)):void i.unlink(e.__filePath,(function(n){return n?(e.__setState(e.__states.FAILED),e.emit("error",n),r(n)):(e.__emitStop(),void t(!0))}))}))})):(e.__emitStop(),Promise.resolve(!0))})))}},{key:"pipe",value:function(e){return this.__pipes.push({stream:e,options:arguments.length>1&&void 0!==arguments[1]?arguments[1]:null}),e}},{key:"unpipe",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=function(t){return e.__response?e.__response.unpipe(t):t.unpipe()};t?this.__pipes.find((function(e){return e.stream===t}))&&(r(t),this.__pipes=this.__pipes.filter((function(e){return e.stream!==t}))):(this.__pipes.forEach((function(e){return r(e.stream)})),this.__pipes=[])}},{key:"getDownloadPath",value:function(){return this.__filePath}},{key:"isResumable",value:function(){return this.__isResumable}},{key:"updateOptions",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.__opts=Object.assign({},this.__opts,e),this.__headers=this.__opts.headers,this.__opts.timeout>-1&&(this.__opts.httpRequestOptions.timeout=this.__opts.timeout,this.__opts.httpsRequestOptions.timeout=this.__opts.timeout),("number"!=typeof this.__opts.progressThrottle||0>this.__opts.progressThrottle)&&(this.__opts.progressThrottle=this.__defaultOpts.progressThrottle),this.url=t||this.url,this.__reqOptions=this.__getReqOptions(this.__opts.method,this.url,this.__opts.headers),this.__initProtocol(this.url)}},{key:"getOptions",value:function(){return this.__opts}},{key:"getMetadata",value:function(){return this.__opts.metadata}},{key:"getStats",value:function(){return{total:this.__total,name:this.__fileName,downloaded:this.__downloaded,progress:this.__progress,speed:this.__statsEstimate.bytes}}},{key:"getTotalSize",value:function(){var e=this;return new Promise((function(t,r){var n=function(t){e.__initProtocol(t);var r=Object.assign({},e.__headers);r.hasOwnProperty("range")&&delete r.range;var n=e.__getReqOptions("HEAD",t,r);return Object.assign({},e.__reqOptions,n)},o=function(i,a){var c=e.__protocol.request(a,(function(a){if(e.__isRequireRedirect(a)){var c=/^https?:\/\//.test(a.headers.location)?a.headers.location:new s.URL(a.headers.location,i).href;return e.emit("redirected",c,i),o(c,n(c))}return 200===a.statusCode?void t({name:e.__getFileNameFromHeaders(a.headers,a),total:parseInt(a.headers["content-length"])||null}):r(Error("Response status was "+a.statusCode))}));c.on("error",(function(e){return r(e)})),c.on("timeout",(function(){return r(Error("timeout"))})),c.on("uncaughtException",(function(e){return r(e)})),c.end()};o(e.url,n(e.url))}))}},{key:"getResumeState",value:function(){return{downloaded:this.__downloaded,filePath:this.__filePath,fileName:this.__fileName,total:this.__total}}},{key:"resumeFromFile",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.__opts.override=!0,this.__filePath=e,(r.total&&r.fileName?Promise.resolve({name:r.fileName,total:r.total}):this.getTotalSize()).then((function(e){var n=e.name;return t.__total=r.total||e.total,t.__fileName=r.fileName||n,t.__downloaded=r.downloaded||t.__getFilesizeInBytes(t.__filePath),t.__reqOptions.headers.range="bytes="+t.__downloaded+"-",t.__isResumed=!0,t.__isResumable=!0,t.__setState(t.__states.RESUMED),t.emit("resume",t.__isResumed),new Promise((function(e,r){t.__promise={resolve:e,reject:r},t.__start()}))}))}},{key:"__start",value:function(){this.__isRedirected||this.state===this.__states.RESUMED||(this.emit("start"),this.__setState(this.__states.STARTED),this.__initProtocol(this.url)),this.__response=null,this.__isAborted=!1,this.__request&&!this.__request.destroyed&&this.__request.destroy(),this.__retryTimeout&&(clearTimeout(this.__retryTimeout),this.__retryTimeout=null),this.__request=this.__downloadRequest(this.__promise.resolve,this.__promise.reject),this.__request.on("error",this.__onError(this.__promise.resolve,this.__promise.reject)),this.__request.on("timeout",this.__onTimeout(this.__promise.resolve,this.__promise.reject)),this.__request.on("uncaughtException",this.__onError(this.__promise.resolve,this.__promise.reject,!0)),this.__opts.body&&this.__request.write(this.__opts.body),this.__request.end()}},{key:"__resolvePending",value:function(){if(this.__promise){var e=this.__promise.resolve;return this.__promise=null,e(!0)}}},{key:"__downloadRequest",value:function(e,t){var r=this;return this.__protocol.request(this.__reqOptions,(function(n){if(r.__response=n,r.__isResumed||(r.__total=parseInt(n.headers["content-length"])||null,r.__resetStats()),r.__isRequireRedirect(n)){var o=/^https?:\/\//.test(n.headers.location)?n.headers.location:new s.URL(n.headers.location,r.url).href;return r.__isRedirected=!0,r.__initProtocol(o),r.emit("redirected",o,r.url),r.__start()}if(200!==n.statusCode&&206!==n.statusCode){var i=Error("Response status was "+n.statusCode);return i.status=n.statusCode||0,i.body=n.body||"",r.__setState(r.__states.FAILED),r.emit("error",i),t(i)}(r.__opts.forceResume||n.headers.hasOwnProperty("accept-ranges")&&"none"!==n.headers["accept-ranges"])&&(r.__isResumable=!0),r.__startDownload(n,e,t)}))}},{key:"__startDownload",value:function(e,t,r){var o=this,s=e;if(this.__isResumed)this.__fileStream=i.createWriteStream(this.__filePath,{flags:"a"});else{var c=this.__getFileNameFromHeaders(e.headers);if(this.__filePath=this.__getFilePath(c),this.__fileName=this.__filePath.split(a.sep).pop(),i.existsSync(this.__filePath)){var l=this.__getFilesizeInBytes(this.__filePath),u=this.__total?this.__total:0;if("object"===n(this.__opts.override)&&this.__opts.override.skip&&(this.__opts.override.skipSmaller||l>=u))return this.emit("skip",{totalSize:this.__total,fileName:this.__fileName,filePath:this.__filePath,downloadedSize:l}),this.__setState(this.__states.SKIPPED),t(!0)}this.__fileStream=i.createWriteStream(this.__filePath,{})}this.emit("download",{fileName:this.__fileName,filePath:this.__filePath,totalSize:this.__total,isResumed:this.__isResumed,downloadedSize:this.__downloaded}),this.__retryCount=0,this.__isResumed=!1,this.__isRedirected=!1,this.__setState(this.__states.DOWNLOADING),this.__statsEstimate.time=new Date,this.__statsEstimate.throttleTime=new Date,s.on("data",(function(e){return o.__calculateStats(e.length)})),this.__pipes.forEach((function(e){s.pipe(e.stream,e.options),s=e.stream})),s.pipe(this.__fileStream),s.on("error",this.__onError(t,r)),this.__fileStream.on("finish",this.__onFinished(t,r)),this.__fileStream.on("error",this.__onError(t,r))}},{key:"__hasFinished",value:function(){return!this.__isAborted&&-1===[this.__states.PAUSED,this.__states.STOPPED,this.__states.RETRY,this.__states.FAILED,this.__states.RESUMED].indexOf(this.state)}},{key:"__isRequireRedirect",value:function(e){return e.statusCode>300&&400>e.statusCode&&e.headers.hasOwnProperty("location")&&e.headers.location}},{key:"__onFinished",value:function(e,t){var r=this;return function(){r.__fileStream.close((function(n){if(n)return t(n);if(r.__hasFinished()){var o=!!r.__total&&r.__downloaded!==r.__total;if(o&&r.__isResumable&&r.__opts.resumeOnIncomplete&&r.__opts.resumeOnIncompleteMaxRetry>=r.__resumeRetryCount)return r.__resumeRetryCount++,r.emit("warning",Error("uncomplete download, retrying")),r.resume();r.__setState(r.__states.FINISHED),r.__pipes=[],r.emit("end",{fileName:r.__fileName,filePath:r.__filePath,totalSize:r.__total,incomplete:o,onDiskSize:r.__getFilesizeInBytes(r.__filePath),downloadedSize:r.__downloaded})}return e(r.__downloaded===r.__total)}))}}},{key:"__closeFileStream",value:function(){var e=this;return this.__fileStream?new Promise((function(t,r){e.__fileStream.close((function(e){return e?r(e):t(!0)}))})):Promise.resolve(!0)}},{key:"__onError",value:function(e,t){var r=this,n=!(2>=arguments.length||void 0===arguments[2])&&arguments[2];return function(e){return r.__pipes=[],n&&r.__requestAbort(),r.state===r.__states.STOPPED||r.state===r.__states.FAILED?void 0:r.__opts.retry?r.__retry(e).catch((function(n){r.__removeFile().finally((function(){r.__setState(r.__states.FAILED),r.emit("error",n||e),t(n||e)}))})):r.__removeFile().finally((function(){r.__setState(r.__states.FAILED),r.emit("error",e),t(e)}))}}},{key:"__retry",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!this.__opts.retry||"object"!==n(this.__opts.retry))return Promise.reject(t||Error("wrong retry options"));var r=this.__opts.retry,o=r.delay,i=void 0===o?0:o,s=r.maxRetries;return(void 0===s?999:s)>this.__retryCount?(this.__retryCount++,this.__setState(this.__states.RETRY),this.emit("retry",this.__retryCount,this.__opts.retry,t),this.__response&&(this.__response.unpipe(),this.__pipes.forEach((function(e){return e.stream.unpipe()}))),this.__fileStream&&this.__fileStream.removeAllListeners(),this.__requestAbort(),this.__closeFileStream().then((function(){return new Promise((function(t){return e.__retryTimeout=setTimeout((function(){return t(e.__downloaded>0?e.resume():e.__start())}),i)}))}))):Promise.reject(t||Error("reached the maximum retries"))}},{key:"__onTimeout",value:function(e,t){var r=this;return function(){return r.__requestAbort(),r.__opts.retry?r.__retry(Error("timeout")).catch((function(e){r.__removeFile().finally((function(){r.__setState(r.__states.FAILED),e?t(e):(r.emit("timeout"),t(Error("timeout")))}))})):r.__removeFile().finally((function(){r.__setState(r.__states.FAILED),r.emit("timeout"),t(Error("timeout"))}))}}},{key:"__resetStats",value:function(){this.__retryCount=0,this.__downloaded=0,this.__progress=0,this.__resumeRetryCount=0,this.__statsEstimate={time:0,bytes:0,prevBytes:0,throttleTime:0}}},{key:"__getFileNameFromHeaders",value:function(e,t){var r="",n=e.hasOwnProperty("content-disposition"),o=n?e["content-disposition"].match(/.*filename\*=.*?'.*?'([^"].+?[^"])(?:(?:;)|$)/i):null,i=!n||o?null:e["content-disposition"].match(/.*filename="(.*?)";?/i),c=!n||o||i?null:e["content-disposition"].match(/.*filename=([^"].+?[^"])(?:(?:;)|$)/i);return n&&(o||i||c)?(r=(r=e["content-disposition"]).trim(),o?r=o[1]:i?r=i[1]:c&&(r=c[1]),r=r.replace(/[/\\]/g,"")):r=a.basename(new s.URL(this.requestURL).pathname).length>0?a.basename(new s.URL(this.requestURL).pathname):new s.URL(this.requestURL).hostname+".html",this.__opts.fileName?this.__getFileNameFromOpts(r,t):r.replace(/\.*$/,"")}},{key:"__getFilePath",value:function(e){var t=a.join(this.__destFolder,e),r=t;return this.__opts.override||this.state===this.__states.RESUMED||t!==(r=this.__uniqFileNameSync(r))&&this.emit("renamed",{path:r,fileName:r.split(a.sep).pop(),prevPath:t,prevFileName:t.split(a.sep).pop()}),r}},{key:"__getFileNameFromOpts",value:function(e,t){if(!this.__opts.fileName)return e;if("string"==typeof this.__opts.fileName)return this.__opts.fileName;if("function"==typeof this.__opts.fileName){var r=a.join(this.__destFolder,e);return t&&t.headers||this.__response&&this.__response.headers?this.__opts.fileName(e,r,(t||this.__response).headers["content-type"]):this.__opts.fileName(e,r)}if("object"===n(this.__opts.fileName)){var o=this.__opts.fileName,i=o.name,s=!!o.hasOwnProperty("ext")&&o.ext;if("string"==typeof s)return i+"."+s;if("boolean"==typeof s){if(s)return i;var c=e.includes(".")?e.split(".").pop():"";return""===c?i:i+"."+c}}return e}},{key:"__calculateStats",value:function(e){var t=new Date,r=t-this.__statsEstimate.time,n=t-this.__statsEstimate.throttleTime,o=this.__total||0;e&&(this.__downloaded+=e,this.__progress=0===o?0:this.__downloaded/o*100,(this.__downloaded===o||r>1e3)&&(this.__statsEstimate.time=t,this.__statsEstimate.bytes=this.__downloaded-this.__statsEstimate.prevBytes,this.__statsEstimate.prevBytes=this.__downloaded),(this.__downloaded===o||n>this.__opts.progressThrottle)&&(this.__statsEstimate.throttleTime=t,this.emit("progress.throttled",this.getStats())),this.emit("progress",this.getStats()))}},{key:"__setState",value:function(e){this.state=e,this.emit("stateChanged",this.state)}},{key:"__getReqOptions",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=new s.URL(t),o={protocol:n.protocol,host:n.hostname,port:n.port,path:n.pathname+n.search,method:e};return r&&(o.headers=r),o}},{key:"__getFilesizeInBytes",value:function(e){try{return i.statSync(e,{throwIfNoEntry:!1}).size||0}catch(t){this.emit("warning",t)}return 0}},{key:"__validate",value:function(e,t){if("string"!=typeof e)throw Error("URL should be an string");if(""===e.trim())throw Error("URL couldn't be empty");if("string"!=typeof t)throw Error("Destination Folder should be an string");if(""===t.trim())throw Error("Destination Folder couldn't be empty");if(!i.existsSync(t))throw Error("Destination Folder must exist");if(!i.statSync(t).isDirectory())throw Error("Destination Folder must be a directory");try{i.accessSync(t,i.constants.W_OK)}catch(r){throw Error("Destination Folder must be writable")}return!0}},{key:"__initProtocol",value:function(e){var t=this.__getReqOptions(this.__opts.method,e,this.__headers);this.requestURL=e,e.indexOf("https://")>-1?(this.__protocol=l,t.agent=new l.Agent({keepAlive:!1}),this.__reqOptions=Object.assign({},t,this.__opts.httpsRequestOptions)):(this.__protocol=c,t.agent=new c.Agent({keepAlive:!1}),this.__reqOptions=Object.assign({},t,this.__opts.httpRequestOptions))}},{key:"__uniqFileNameSync",value:function(e){if("string"!=typeof e||""===e)return e;try{i.accessSync(e,i.F_OK);var t=e.match(/(.*)(\([0-9]+\))(\..*)$/),r=t?t[1].trim():e,n=t?parseInt(t[2].replace(/\(|\)/,"")):0,o=e.split(".").pop();return o!==e&&o.length>0?r=r.replace(o="."+o,""):o="",this.__uniqFileNameSync(r+" ("+ ++n+")"+o)}catch(s){return e}}},{key:"__removeFile",value:function(){var e=this;return new Promise((function(t){return e.__fileStream?void e.__fileStream.close((function(r){return r&&e.emit("warning",r),e.__opts.removeOnFail?i.access(e.__filePath,(function(n){return n?t():void i.unlink(e.__filePath,(function(n){n&&e.emit("warning",r),t()}))})):void t()})):t()}))}},{key:"__requestAbort",value:function(){this.__isAborted=!0,this.__retryTimeout&&(clearTimeout(this.__retryTimeout),this.__retryTimeout=null),this.__response&&this.__response.destroy(),this.__request&&(this.__request.destroy?this.__request.destroy():this.__request.abort())}},{key:"__emitStop",value:function(){this.__resolvePending(),this.__setState(this.__states.STOPPED),this.emit("stop")}}]),t}(u.EventEmitter)}(RS);const{appendFile:IS}=gn.promises,xS="Dpkg::Lock::Timeout=300";let NS=!1;const AS=_b((function(e=xe()){V(e,"nala"!==e?["update","-y","-o",xS]:["update","-o",xS],{...Cy,env:Re(e)}),NS=!0}));var PS,$S;($S=PS||(PS={}))[$S.NameDashVersion=0]="NameDashVersion",$S[$S.NameEqualsVersion=1]="NameEqualsVersion",$S[$S.Name=2]="Name",$S[$S.None=3]="None";const CS=_b((async function(e){AS(e);const t=await Pe([{name:"ca-certificates"},{name:"gnupg"},{name:"apt-utils"}],e);0!==t.length&&V(e,["install","-y","--fix-broken","-o",xS,...t],{...Cy,env:Re(e)})}),{promise:!0}),DS=["E: Could not get lock","dpkg: error processing archive","dpkg: error: dpkg status database is locked by another process"],LS="/etc/apt/trusted.gpg.d",kS="keyserver.ubuntu.com";let MS,jS,US,FS,BS,GS=!1,HS=!1,qS=!1,VS=!1;const zS=/Version\s*:\s*(.*)/g;let WS=!1;var XS=wn;const KS=t((function(e,t){if("string"!=typeof e)return e;if(0===e.length)return e;var r,n=XS.basename(e,XS.extname(e))+t,o=XS.join(XS.dirname(e),n);return(r=e.slice(0,2))==="."+XS.sep||"./"===r?"."+XS.sep+o:o}));var YS={},JS={};Ye(JS,"name",(()=>Je));var QS={};Ye(QS,"normalizeTrim",(()=>Qe));var ZS={};Ye(ZS,"addExeExt",(()=>Ze));var eO={};Ye(eO,"addNamePrefix",(()=>et));var tO={};Ye(tO,"addNameSuffix",(()=>tt));var rO={};Ye(rO,"addShExt",(()=>rt));var nO={};Ye(nO,"addShRelativePrefix",(()=>nt));var oO={};Ye(oO,"removeExt",(()=>ot));var iO={};Ye(iO,"replaceExt",(()=>it));var sO={};Ye(sO,"isPathInside",(()=>st)),Ke(YS,JS),Ke(YS,QS),Ke(YS,ZS),Ke(YS,eO),Ke(YS,tO),Ke(YS,rO),Ke(YS,nO),Ke(YS,oO),Ke(YS,iO),Ke(YS,sO);const aO=["x64","amd64","x86_64","win64","64"],cO=["x86","i386","ia32","win32","32","x32"],lO=["aarch64","arm64","woa64","arm"],uO=["armv7","armv7a"],dO=["powerpc64le","ppc64le"],pO=["sparc64"];var fO={},hO={},mO={};!function(e){function t(e){return(1&e.mode)>0||(8&e.mode)>0&&e.gid===process.getgid()||(64&e.mode)>0&&e.uid===process.getuid()}var r,n=Bn&&Bn.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=Bn&&Bn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=Bn&&Bn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t},s=Bn&&Bn.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(t){i(t)}}function a(e){try{c(n.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.getCmdPath=e.tryGetExecutablePath=e.isRooted=e.isDirectory=e.exists=e.READONLY=e.UV_FS_O_EXLOCK=e.IS_WINDOWS=e.unlink=e.symlink=e.stat=e.rmdir=e.rm=e.rename=e.readlink=e.readdir=e.open=e.mkdir=e.lstat=e.copyFile=e.chmod=void 0;const a=i(gn),c=i(wn);e.chmod=(r=a.promises).chmod,e.copyFile=r.copyFile,e.lstat=r.lstat,e.mkdir=r.mkdir,e.open=r.open,e.readdir=r.readdir,e.readlink=r.readlink,e.rename=r.rename,e.rm=r.rm,e.rmdir=r.rmdir,e.stat=r.stat,e.symlink=r.symlink,e.unlink=r.unlink,e.IS_WINDOWS="win32"===process.platform,e.UV_FS_O_EXLOCK=268435456,e.READONLY=a.constants.O_RDONLY,e.exists=function(t){return s(this,void 0,void 0,(function*(){try{yield e.stat(t)}catch(r){if("ENOENT"===r.code)return!1;throw r}return!0}))},e.isDirectory=function(t,r=!1){return s(this,void 0,void 0,(function*(){return(r?yield e.stat(t):yield e.lstat(t)).isDirectory()}))},e.isRooted=function(t){if(!(t=function(t){return t=t||"",e.IS_WINDOWS?(t=t.replace(/\//g,"\\")).replace(/\\\\+/g,"\\"):t.replace(/\/\/+/g,"/")}(t)))throw Error('isRooted() parameter "p" cannot be empty');return e.IS_WINDOWS?t.startsWith("\\")||/^[A-Z]:/i.test(t):t.startsWith("/")},e.tryGetExecutablePath=function(r,n){return s(this,void 0,void 0,(function*(){let o;try{o=yield e.stat(r)}catch(s){"ENOENT"!==s.code&&console.log(`Unexpected error attempting to determine if executable file exists '${r}': ${s}`)}if(o&&o.isFile())if(e.IS_WINDOWS){const e=c.extname(r).toUpperCase();if(n.some((t=>t.toUpperCase()===e)))return r}else if(t(o))return r;const i=r;for(const a of n){r=i+a,o=void 0;try{o=yield e.stat(r)}catch(s){"ENOENT"!==s.code&&console.log(`Unexpected error attempting to determine if executable file exists '${r}': ${s}`)}if(o&&o.isFile()){if(e.IS_WINDOWS){try{const t=c.dirname(r),n=c.basename(r).toUpperCase();for(const o of yield e.readdir(t))if(n===o.toUpperCase()){r=c.join(t,o);break}}catch(s){console.log(`Unexpected error attempting to determine the actual case of the file '${r}': ${s}`)}return r}if(t(o))return r}}return""}))},e.getCmdPath=function(){var e;return null!==(e=process.env.COMSPEC)&&void 0!==e?e:"cmd.exe"}}(mO);var yO=Bn&&Bn.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),gO=Bn&&Bn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),vO=Bn&&Bn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&yO(t,e,r);return gO(t,e),t},wO=Bn&&Bn.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(t){i(t)}}function a(e){try{c(n.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(hO,"__esModule",{value:!0}),hO.findInPath=hO.which=SO=hO.mkdirP=hO.rmRF=hO.mv=hO.cp=void 0;const bO=Cn,EO=vO(wn),_O=vO(mO);hO.cp=function(e,t,r={}){return wO(this,void 0,void 0,(function*(){const{force:n,recursive:o,copySourceDirectory:i}=function(e){return{force:null==e.force||e.force,recursive:!!e.recursive,copySourceDirectory:null==e.copySourceDirectory||!!e.copySourceDirectory}}(r),s=(yield _O.exists(t))?yield _O.stat(t):null;if(s&&s.isFile()&&!n)return;const a=s&&s.isDirectory()&&i?EO.join(t,EO.basename(e)):t;if(!(yield _O.exists(e)))throw Error("no such file or directory: "+e);if((yield _O.stat(e)).isDirectory()){if(!o)throw Error(`Failed to copy. ${e} is a directory, but tried to copy without recursive flag.`);yield ut(e,a,0,n)}else{if(""===EO.relative(e,a))throw Error(`'${a}' and '${e}' are the same file`);yield dt(e,a,n)}}))},hO.mv=function(e,t,r={}){return wO(this,void 0,void 0,(function*(){if(yield _O.exists(t)){let n=!0;if((yield _O.isDirectory(t))&&(t=EO.join(t,EO.basename(e)),n=yield _O.exists(t)),n){if(null!=r.force&&!r.force)throw Error("Destination already exists");yield at(t)}}yield ct(EO.dirname(t)),yield _O.rename(e,t)}))},hO.rmRF=at;var SO=hO.mkdirP=ct;hO.which=function e(t,r){return wO(this,void 0,void 0,(function*(){if(!t)throw Error("parameter 'tool' is required");if(r){const r=yield e(t,!1);if(!r)throw Error(_O.IS_WINDOWS?`Unable to locate executable file: ${t}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`:`Unable to locate executable file: ${t}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);return r}const n=yield lt(t);return n&&n.length>0?n[0]:""}))},hO.findInPath=lt;var OO={exports:{}},TO={exports:{}};!function(e,t){function r(e){A[e]=P++}function n(e){for(var t=0;C.length>t;t++){var r=C[t][0],n=C[t][1];e=e.split(r+"*").join(r+"{0,"+n+"}").split(r+"+").join(r+"{1,"+n+"}")}return e}function o(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof i)return e;if("string"!=typeof e)return null;if(e.length>O)return null;if(!(t.loose?x[A.LOOSE]:x[A.FULL]).test(e))return null;try{return new i(e,t)}catch(r){return null}}function i(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof i){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>O)throw new TypeError("version is longer than "+O+" characters");if(!(this instanceof i))return new i(e,t);S("SemVer",e,t),this.options=t,this.loose=!!t.loose;var r=e.trim().match(t.loose?x[A.LOOSE]:x[A.FULL]);if(!r)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>T||0>this.major)throw new TypeError("Invalid major version");if(this.minor>T||0>this.minor)throw new TypeError("Invalid minor version");if(this.patch>T||0>this.patch)throw new TypeError("Invalid patch version");this.prerelease=r[4]?r[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&T>t)return t}return e})):[],this.build=r[5]?r[5].split("."):[],this.format()}function s(e,t){var r=L.test(e),n=L.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:t>e?-1:1}function a(e,t,r){return new i(e,r).compare(new i(t,r))}function c(e,t,r){return a(e,t,r)>0}function l(e,t,r){return 0>a(e,t,r)}function u(e,t,r){return 0===a(e,t,r)}function d(e,t,r){return 0!==a(e,t,r)}function p(e,t,r){return a(e,t,r)>=0}function f(e,t,r){return 0>=a(e,t,r)}function h(e,t,r,n){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return u(e,r,n);case"!=":return d(e,r,n);case">":return c(e,r,n);case">=":return p(e,r,n);case"<":return l(e,r,n);case"<=":return f(e,r,n);default:throw new TypeError("Invalid operator: "+t)}}function m(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof m){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof m))return new m(e,t);e=e.trim().split(/\s+/).join(" "),S("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.value=this.semver===k?"":this.operator+this.semver.version,S("comp",this)}function y(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof y)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new y(e.raw,t);if(e instanceof m)return new y(e.value,t);if(!(this instanceof y))return new y(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}function g(e,t){for(var r=!0,n=e.slice(),o=n.pop();r&&n.length;)r=n.every((function(e){return o.intersects(e,t)})),o=n.pop();return r}function v(e){return!e||"x"===e.toLowerCase()||"*"===e}function w(e,t,r,n,o,i,s,a,c,l,u,d,p){return((t=v(r)?"":v(n)?">="+r+".0.0":v(o)?">="+r+"."+n+".0":">="+t)+" "+(a=v(c)?"":v(l)?"<"+(+c+1)+".0.0":v(u)?"<"+c+"."+(+l+1)+".0":d?"<="+c+"."+l+"."+u+"-"+d:"<="+a)).trim()}function b(e,t,r){for(var n=0;e.length>n;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(n=0;e.length>n;n++)if(S(e[n].semver),e[n].semver!==k&&e[n].semver.prerelease.length>0){var o=e[n].semver;if(o.major===t.major&&o.minor===t.minor&&o.patch===t.patch)return!0}return!1}return!0}function E(e,t,r){try{t=new y(t,r)}catch(n){return!1}return t.test(e)}function _(e,t,r,n){var o,s,a,u,d;switch(e=new i(e,n),t=new y(t,n),r){case">":o=c,s=f,a=l,u=">",d=">=";break;case"<":o=l,s=p,a=c,u="<",d="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(E(e,t,n))return!1;for(var h=0;t.set.length>h;++h){var g=null,v=null;if(t.set[h].forEach((function(e){e.semver===k&&(e=new m(">=0.0.0")),v=v||e,o(e.semver,(g=g||e).semver,n)?g=e:a(e.semver,v.semver,n)&&(v=e)})),g.operator===u||g.operator===d)return!1;if((!v.operator||v.operator===u)&&s(e,v.semver))return!1;if(v.operator===d&&a(e,v.semver))return!1}return!0}var S;t=TO.exports=i,S="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e=[].slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var O=256,T=Number.MAX_SAFE_INTEGER||9007199254740991,R=O-6,I=t.re=[],x=t.safeRe=[],N=t.src=[],A=t.tokens={},P=0,$="[a-zA-Z0-9-]",C=[["\\s",1],["\\d",O],[$,R]];r("NUMERICIDENTIFIER"),N[A.NUMERICIDENTIFIER]="0|[1-9]\\d*",r("NUMERICIDENTIFIERLOOSE"),N[A.NUMERICIDENTIFIERLOOSE]="\\d+",r("NONNUMERICIDENTIFIER"),N[A.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-]"+$+"*",r("MAINVERSION"),N[A.MAINVERSION]="("+N[A.NUMERICIDENTIFIER]+")\\.("+N[A.NUMERICIDENTIFIER]+")\\.("+N[A.NUMERICIDENTIFIER]+")",r("MAINVERSIONLOOSE"),N[A.MAINVERSIONLOOSE]="("+N[A.NUMERICIDENTIFIERLOOSE]+")\\.("+N[A.NUMERICIDENTIFIERLOOSE]+")\\.("+N[A.NUMERICIDENTIFIERLOOSE]+")",r("PRERELEASEIDENTIFIER"),N[A.PRERELEASEIDENTIFIER]="(?:"+N[A.NUMERICIDENTIFIER]+"|"+N[A.NONNUMERICIDENTIFIER]+")",r("PRERELEASEIDENTIFIERLOOSE"),N[A.PRERELEASEIDENTIFIERLOOSE]="(?:"+N[A.NUMERICIDENTIFIERLOOSE]+"|"+N[A.NONNUMERICIDENTIFIER]+")",r("PRERELEASE"),N[A.PRERELEASE]="(?:-("+N[A.PRERELEASEIDENTIFIER]+"(?:\\."+N[A.PRERELEASEIDENTIFIER]+")*))",r("PRERELEASELOOSE"),N[A.PRERELEASELOOSE]="(?:-?("+N[A.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+N[A.PRERELEASEIDENTIFIERLOOSE]+")*))",r("BUILDIDENTIFIER"),N[A.BUILDIDENTIFIER]=$+"+",r("BUILD"),N[A.BUILD]="(?:\\+("+N[A.BUILDIDENTIFIER]+"(?:\\."+N[A.BUILDIDENTIFIER]+")*))",r("FULL"),r("FULLPLAIN"),N[A.FULLPLAIN]="v?"+N[A.MAINVERSION]+N[A.PRERELEASE]+"?"+N[A.BUILD]+"?",N[A.FULL]="^"+N[A.FULLPLAIN]+"$",r("LOOSEPLAIN"),N[A.LOOSEPLAIN]="[v=\\s]*"+N[A.MAINVERSIONLOOSE]+N[A.PRERELEASELOOSE]+"?"+N[A.BUILD]+"?",r("LOOSE"),N[A.LOOSE]="^"+N[A.LOOSEPLAIN]+"$",r("GTLT"),N[A.GTLT]="((?:<|>)?=?)",r("XRANGEIDENTIFIERLOOSE"),N[A.XRANGEIDENTIFIERLOOSE]=N[A.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",r("XRANGEIDENTIFIER"),N[A.XRANGEIDENTIFIER]=N[A.NUMERICIDENTIFIER]+"|x|X|\\*",r("XRANGEPLAIN"),N[A.XRANGEPLAIN]="[v=\\s]*("+N[A.XRANGEIDENTIFIER]+")(?:\\.("+N[A.XRANGEIDENTIFIER]+")(?:\\.("+N[A.XRANGEIDENTIFIER]+")(?:"+N[A.PRERELEASE]+")?"+N[A.BUILD]+"?)?)?",r("XRANGEPLAINLOOSE"),N[A.XRANGEPLAINLOOSE]="[v=\\s]*("+N[A.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+N[A.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+N[A.XRANGEIDENTIFIERLOOSE]+")(?:"+N[A.PRERELEASELOOSE]+")?"+N[A.BUILD]+"?)?)?",r("XRANGE"),N[A.XRANGE]="^"+N[A.GTLT]+"\\s*"+N[A.XRANGEPLAIN]+"$",r("XRANGELOOSE"),N[A.XRANGELOOSE]="^"+N[A.GTLT]+"\\s*"+N[A.XRANGEPLAINLOOSE]+"$",r("COERCE"),N[A.COERCE]="(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])",r("COERCERTL"),I[A.COERCERTL]=RegExp(N[A.COERCE],"g"),x[A.COERCERTL]=RegExp(n(N[A.COERCE]),"g"),r("LONETILDE"),N[A.LONETILDE]="(?:~>?)",r("TILDETRIM"),N[A.TILDETRIM]="(\\s*)"+N[A.LONETILDE]+"\\s+",I[A.TILDETRIM]=RegExp(N[A.TILDETRIM],"g"),x[A.TILDETRIM]=RegExp(n(N[A.TILDETRIM]),"g"),r("TILDE"),N[A.TILDE]="^"+N[A.LONETILDE]+N[A.XRANGEPLAIN]+"$",r("TILDELOOSE"),N[A.TILDELOOSE]="^"+N[A.LONETILDE]+N[A.XRANGEPLAINLOOSE]+"$",r("LONECARET"),N[A.LONECARET]="(?:\\^)",r("CARETTRIM"),N[A.CARETTRIM]="(\\s*)"+N[A.LONECARET]+"\\s+",I[A.CARETTRIM]=RegExp(N[A.CARETTRIM],"g"),x[A.CARETTRIM]=RegExp(n(N[A.CARETTRIM]),"g"),r("CARET"),N[A.CARET]="^"+N[A.LONECARET]+N[A.XRANGEPLAIN]+"$",r("CARETLOOSE"),N[A.CARETLOOSE]="^"+N[A.LONECARET]+N[A.XRANGEPLAINLOOSE]+"$",r("COMPARATORLOOSE"),N[A.COMPARATORLOOSE]="^"+N[A.GTLT]+"\\s*("+N[A.LOOSEPLAIN]+")$|^$",r("COMPARATOR"),N[A.COMPARATOR]="^"+N[A.GTLT]+"\\s*("+N[A.FULLPLAIN]+")$|^$",r("COMPARATORTRIM"),N[A.COMPARATORTRIM]="(\\s*)"+N[A.GTLT]+"\\s*("+N[A.LOOSEPLAIN]+"|"+N[A.XRANGEPLAIN]+")",I[A.COMPARATORTRIM]=RegExp(N[A.COMPARATORTRIM],"g"),x[A.COMPARATORTRIM]=RegExp(n(N[A.COMPARATORTRIM]),"g"),r("HYPHENRANGE"),N[A.HYPHENRANGE]="^\\s*("+N[A.XRANGEPLAIN]+")\\s+-\\s+("+N[A.XRANGEPLAIN]+")\\s*$",r("HYPHENRANGELOOSE"),N[A.HYPHENRANGELOOSE]="^\\s*("+N[A.XRANGEPLAINLOOSE]+")\\s+-\\s+("+N[A.XRANGEPLAINLOOSE]+")\\s*$",r("STAR"),N[A.STAR]="(<|>)?=?\\s*\\*";for(var D=0;P>D;D++)S(D,N[D]),I[D]||(I[D]=RegExp(N[D]),x[D]=RegExp(n(N[D])));t.parse=o,t.valid=function(e,t){var r=o(e,t);return r?r.version:null},t.clean=function(e,t){var r=o(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null},t.SemVer=i,i.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},i.prototype.toString=function(){return this.version},i.prototype.compare=function(e){return S("SemVer.compare",this.version,this.options,e),e instanceof i||(e=new i(e,this.options)),this.compareMain(e)||this.comparePre(e)},i.prototype.compareMain=function(e){return e instanceof i||(e=new i(e,this.options)),s(this.major,e.major)||s(this.minor,e.minor)||s(this.patch,e.patch)},i.prototype.comparePre=function(e){if(e instanceof i||(e=new i(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;var t=0;do{var r=this.prerelease[t],n=e.prerelease[t];if(S("prerelease compare",t,r,n),void 0===r&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===r)return-1;if(r!==n)return s(r,n)}while(++t)},i.prototype.compareBuild=function(e){e instanceof i||(e=new i(e,this.options));var t=0;do{var r=this.build[t],n=e.build[t];if(S("prerelease compare",t,r,n),void 0===r&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===r)return-1;if(r!==n)return s(r,n)}while(++t)},i.prototype.inc=function(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var r=this.prerelease.length;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);-1===r&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function(e,t,r,n){"string"==typeof r&&(n=r,r=void 0);try{return new i(e,r).inc(t,n).version}catch(o){return null}},t.diff=function(e,t){if(u(e,t))return null;var r=o(e),n=o(t),i="";if(r.prerelease.length||n.prerelease.length){i="pre";var s="prerelease"}for(var a in r)if(("major"===a||"minor"===a||"patch"===a)&&r[a]!==n[a])return i+a;return s},t.compareIdentifiers=s;var L=/^[0-9]+$/;t.rcompareIdentifiers=function(e,t){return s(t,e)},t.major=function(e,t){return new i(e,t).major},t.minor=function(e,t){return new i(e,t).minor},t.patch=function(e,t){return new i(e,t).patch},t.compare=a,t.compareLoose=function(e,t){return a(e,t,!0)},t.compareBuild=function(e,t,r){var n=new i(e,r),o=new i(t,r);return n.compare(o)||n.compareBuild(o)},t.rcompare=function(e,t,r){return a(t,e,r)},t.sort=function(e,r){return e.sort((function(e,n){return t.compareBuild(e,n,r)}))},t.rsort=function(e,r){return e.sort((function(e,n){return t.compareBuild(n,e,r)}))},t.gt=c,t.lt=l,t.eq=u,t.neq=d,t.gte=p,t.lte=f,t.cmp=h,t.Comparator=m;var k={};m.prototype.parse=function(e){var t=e.match(this.options.loose?x[A.COMPARATORLOOSE]:x[A.COMPARATOR]);if(!t)throw new TypeError("Invalid comparator: "+e);this.operator=void 0!==t[1]?t[1]:"","="===this.operator&&(this.operator=""),this.semver=t[2]?new i(t[2],this.options.loose):k},m.prototype.toString=function(){return this.value},m.prototype.test=function(e){if(S("Comparator.test",e,this.options.loose),this.semver===k||e===k)return!0;if("string"==typeof e)try{e=new i(e,this.options)}catch(t){return!1}return h(e,this.operator,this.semver,this.options)},m.prototype.intersects=function(e,t){if(!(e instanceof m))throw new TypeError("a Comparator is required");var r;if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||(r=new y(e.value,t),E(this.value,r,t));if(""===e.operator)return""===e.value||(r=new y(this.value,t),E(e.semver,r,t));var n=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=h(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=h(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return n||o||i&&s||a||c},t.Range=y,y.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},y.prototype.toString=function(){return this.range},y.prototype.parseRange=function(e){var t=this.options.loose;e=e.replace(t?x[A.HYPHENRANGELOOSE]:x[A.HYPHENRANGE],w),S("hyphen replace",e),e=e.replace(x[A.COMPARATORTRIM],"$1$2$3"),S("comparator trim",e,x[A.COMPARATORTRIM]),e=(e=(e=e.replace(x[A.TILDETRIM],"$1~")).replace(x[A.CARETTRIM],"$1^")).split(/\s+/).join(" ");var r=t?x[A.COMPARATORLOOSE]:x[A.COMPARATOR],n=e.split(" ").map((function(e){return function(e,t){return S("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){return S("caret",e,t),e.replace(t.loose?x[A.CARETLOOSE]:x[A.CARET],(function(t,r,n,o,i){var s;return S("caret",e,t,r,n,o,i),v(r)?s="":v(n)?s=">="+r+".0.0 <"+(+r+1)+".0.0":v(o)?s="0"===r?">="+r+"."+n+".0 <"+r+"."+(+n+1)+".0":">="+r+"."+n+".0 <"+(+r+1)+".0.0":i?(S("replaceCaret pr",i),s="0"===r?"0"===n?">="+r+"."+n+"."+o+"-"+i+" <"+r+"."+n+"."+(+o+1):">="+r+"."+n+"."+o+"-"+i+" <"+r+"."+(+n+1)+".0":">="+r+"."+n+"."+o+"-"+i+" <"+(+r+1)+".0.0"):(S("no pr"),s="0"===r?"0"===n?">="+r+"."+n+"."+o+" <"+r+"."+n+"."+(+o+1):">="+r+"."+n+"."+o+" <"+r+"."+(+n+1)+".0":">="+r+"."+n+"."+o+" <"+(+r+1)+".0.0"),S("caret return",s),s}))}(e,t)})).join(" ")}(e,t),S("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){return e.replace(t.loose?x[A.TILDELOOSE]:x[A.TILDE],(function(t,r,n,o,i){var s;return S("tilde",e,t,r,n,o,i),v(r)?s="":v(n)?s=">="+r+".0.0 <"+(+r+1)+".0.0":v(o)?s=">="+r+"."+n+".0 <"+r+"."+(+n+1)+".0":i?(S("replaceTilde pr",i),s=">="+r+"."+n+"."+o+"-"+i+" <"+r+"."+(+n+1)+".0"):s=">="+r+"."+n+"."+o+" <"+r+"."+(+n+1)+".0",S("tilde return",s),s}))}(e,t)})).join(" ")}(e,t),S("tildes",e),e=function(e,t){return S("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){return(e=e.trim()).replace(t.loose?x[A.XRANGELOOSE]:x[A.XRANGE],(function(r,n,o,i,s,a){S("xRange",e,r,n,o,i,s,a);var c=v(o),l=c||v(i),u=l||v(s);return"="===n&&u&&(n=""),a=t.includePrerelease?"-0":"",c?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&u?(l&&(i=0),s=0,">"===n?(n=">=",l?(o=+o+1,i=0,s=0):(i=+i+1,s=0)):"<="===n&&(n="<",l?o=+o+1:i=+i+1),r=n+o+"."+i+"."+s+a):l?r=">="+o+".0.0"+a+" <"+(+o+1)+".0.0"+a:u&&(r=">="+o+"."+i+".0"+a+" <"+o+"."+(+i+1)+".0"+a),S("xRange return",r),r}))}(e,t)})).join(" ")}(e,t),S("xrange",e),e=function(e,t){return S("replaceStars",e,t),e.trim().replace(x[A.STAR],"")}(e,t),S("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(n=n.filter((function(e){return!!e.match(r)}))),n.map((function(e){return new m(e,this.options)}),this)},y.prototype.intersects=function(e,t){if(!(e instanceof y))throw new TypeError("a Range is required");return this.set.some((function(r){return g(r,t)&&e.set.some((function(e){return g(e,t)&&r.every((function(r){return e.every((function(e){return r.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new y(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},y.prototype.test=function(e){if(!e)return!1;if("string"==typeof e)try{e=new i(e,this.options)}catch(r){return!1}for(var t=0;this.set.length>t;t++)if(b(this.set[t],e,this.options))return!0;return!1},t.satisfies=E,t.maxSatisfying=function(e,t,r){var n=null,o=null;try{var s=new y(t,r)}catch(a){return null}return e.forEach((function(e){s.test(e)&&(n&&-1!==o.compare(e)||(o=new i(n=e,r)))})),n},t.minSatisfying=function(e,t,r){var n=null,o=null;try{var s=new y(t,r)}catch(a){return null}return e.forEach((function(e){s.test(e)&&(n&&1!==o.compare(e)||(o=new i(n=e,r)))})),n},t.minVersion=function(e,t){e=new y(e,t);var r=new i("0.0.0");if(e.test(r))return r;if(r=new i("0.0.0-0"),e.test(r))return r;r=null;for(var n=0;e.set.length>n;++n)e.set[n].forEach((function(e){var t=new i(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":r&&!c(r,t)||(r=t);break;case"<":case"<=":break;default:throw Error("Unexpected operation: "+e.operator)}}));return r&&e.test(r)?r:null},t.validRange=function(e,t){try{return new y(e,t).range||"*"}catch(r){return null}},t.ltr=function(e,t,r){return _(e,t,"<",r)},t.gtr=function(e,t,r){return _(e,t,">",r)},t.outside=_,t.prerelease=function(e,t){var r=o(e,t);return r&&r.prerelease.length?r.prerelease:null},t.intersects=function(e,t,r){return e=new y(e,r),t=new y(t,r),e.intersects(t)},t.coerce=function(e,t){if(e instanceof i)return e;if("number"==typeof e&&(e+=""),"string"!=typeof e)return null;var r=null;if((t=t||{}).rtl){for(var n;(n=x[A.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&n.index+n[0].length===r.index+r[0].length||(r=n),x[A.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;x[A.COERCERTL].lastIndex=-1}else r=e.match(x[A.COERCE]);return null===r?null:o(r[2]+"."+(r[3]||"0")+"."+(r[4]||"0"),t)}}(0,TO.exports);var RO=TO.exports;!function(e,t){var r=Bn&&Bn.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=Bn&&Bn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=Bn&&Bn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.hasOwnProperty.call(e,o)&&r(t,e,o);return n(t,e),t},i=Bn&&Bn.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(t){i(t)}}function a(e){try{c(n.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t._readLinuxVersionFile=t._getOsVersion=t._findMatch=void 0;const s=o(RO),a=m(),c=yn,l=Rn,u=gn;t._findMatch=function(t,r,n,o){return i(this,void 0,void 0,(function*(){const i=c.platform();let l,u,d;for(const c of n){const n=c.version;if(a.debug(`check ${n} satisfies ${t}`),s.satisfies(n,t)&&(!r||c.stable===r)&&(d=c.files.find((t=>{a.debug(`${t.arch}===${o} && ${t.platform}===${i}`);let r=t.arch===o&&t.platform===i;if(r&&t.platform_version){const n=e.exports._getOsVersion();r=n===t.platform_version||s.satisfies(n,t.platform_version)}return r})),d)){a.debug("matched "+c.version),u=c;break}}return u&&d&&(l=Object.assign({},u),l.files=[d]),l}))},t._getOsVersion=function(){const t=c.platform();let r="";if("darwin"===t)r=""+l.execSync("sw_vers -productVersion");else if("linux"===t){const t=e.exports._readLinuxVersionFile();if(t){const e=t.split("\n");for(const t of e){const e=t.split("=");if(2===e.length&&("VERSION_ID"===e[0].trim()||"DISTRIB_RELEASE"===e[0].trim())){r=e[1].trim().replace(/^"/,"").replace(/"$/,"");break}}}}return r},t._readLinuxVersionFile=function(){const e="/etc/lsb-release",t="/etc/os-release";let r="";return u.existsSync(e)?r=""+u.readFileSync(e):u.existsSync(t)&&(r=""+u.readFileSync(t)),r}}(OO,OO.exports);for(var IO=OO.exports,xO=vn,NO=[],AO=0;256>AO;++AO)NO[AO]=(AO+256).toString(16).substr(1);var PO=function(){return xO.randomBytes(16)},$O=function(e,t){var r=t||0;return""+NO[e[r++]]+NO[e[r++]]+NO[e[r++]]+NO[e[r++]]+"-"+NO[e[r++]]+NO[e[r++]]+"-"+NO[e[r++]]+NO[e[r++]]+"-"+NO[e[r++]]+NO[e[r++]]+"-"+NO[e[r++]]+NO[e[r++]]+NO[e[r++]]+NO[e[r++]]+NO[e[r++]]+NO[e[r++]]},CO={},DO={},LO=Bn&&Bn.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),kO=Bn&&Bn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),MO=Bn&&Bn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&LO(t,e,r);return kO(t,e),t},jO=Bn&&Bn.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(t){i(t)}}function a(e){try{c(n.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(DO,"__esModule",{value:!0}),DO.argStringToArray=DO.ToolRunner=void 0;const UO=MO(yn),FO=MO(Sn),BO=MO(Rn),GO=MO(wn),HO=MO(hO),qO=MO(mO),VO=Dn,zO="win32"===process.platform;DO.ToolRunner=class extends FO.EventEmitter{constructor(e,t,r){if(super(),!e)throw Error("Parameter 'toolPath' cannot be null or empty.");this.toolPath=e,this.args=t||[],this.options=r||{}}_debug(e){this.options.listeners&&this.options.listeners.debug&&this.options.listeners.debug(e)}_getCommandString(e,t){const r=this._getSpawnFileName(),n=this._getSpawnArgs(e);let o=t?"":"[command]";if(zO)if(this._isCmdFile()){o+=r;for(const e of n)o+=" "+e}else if(e.windowsVerbatimArguments){o+=`"${r}"`;for(const e of n)o+=" "+e}else{o+=this._windowsQuoteCmdArg(r);for(const e of n)o+=" "+this._windowsQuoteCmdArg(e)}else{o+=r;for(const e of n)o+=" "+e}return o}_processLineBuffer(e,t,r){try{let n=t+""+e,o=n.indexOf(UO.EOL);for(;o>-1;)r(n.substring(0,o)),n=n.substring(o+UO.EOL.length),o=n.indexOf(UO.EOL);return n}catch(n){return this._debug("error processing line. Failed with error "+n),""}}_getSpawnFileName(){return zO&&this._isCmdFile()?process.env.COMSPEC||"cmd.exe":this.toolPath}_getSpawnArgs(e){if(zO&&this._isCmdFile()){let t='/D /S /C "'+this._windowsQuoteCmdArg(this.toolPath);for(const r of this.args)t+=" ",t+=e.windowsVerbatimArguments?r:this._windowsQuoteCmdArg(r);return t+='"',[t]}return this.args}_endsWith(e,t){return e.endsWith(t)}_isCmdFile(){const e=this.toolPath.toUpperCase();return this._endsWith(e,".CMD")||this._endsWith(e,".BAT")}_windowsQuoteCmdArg(e){if(!this._isCmdFile())return this._uvQuoteCmdArg(e);if(!e)return'""';const t=[" ","\t","&","(",")","[","]","{","}","^","=",";","!","'","+",",","`","~","|","<",">",'"'];let r=!1;for(const i of e)if(t.some((e=>e===i))){r=!0;break}if(!r)return e;let n='"',o=!0;for(let i=e.length;i>0;i--)n+=e[i-1],o&&"\\"===e[i-1]?n+="\\":'"'===e[i-1]?(o=!0,n+='"'):o=!1;return n+='"',n.split("").reverse().join("")}_uvQuoteCmdArg(e){if(!e)return'""';if(!e.includes(" ")&&!e.includes("\t")&&!e.includes('"'))return e;if(!e.includes('"')&&!e.includes("\\"))return`"${e}"`;let t='"',r=!0;for(let n=e.length;n>0;n--)t+=e[n-1],r&&"\\"===e[n-1]?t+="\\":'"'===e[n-1]?(r=!0,t+="\\"):r=!1;return t+='"',t.split("").reverse().join("")}_cloneExecOptions(e){const t={cwd:(e=e||{}).cwd||process.cwd(),env:e.env||process.env,silent:e.silent||!1,windowsVerbatimArguments:e.windowsVerbatimArguments||!1,failOnStdErr:e.failOnStdErr||!1,ignoreReturnCode:e.ignoreReturnCode||!1,delay:e.delay||1e4};return t.outStream=e.outStream||process.stdout,t.errStream=e.errStream||process.stderr,t}_getSpawnOptions(e,t){const r={};return r.cwd=(e=e||{}).cwd,r.env=e.env,r.windowsVerbatimArguments=e.windowsVerbatimArguments||this._isCmdFile(),e.windowsVerbatimArguments&&(r.argv0=`"${t}"`),r}exec(){return jO(this,void 0,void 0,(function*(){return!qO.isRooted(this.toolPath)&&(this.toolPath.includes("/")||zO&&this.toolPath.includes("\\"))&&(this.toolPath=GO.resolve(process.cwd(),this.options.cwd||process.cwd(),this.toolPath)),this.toolPath=yield HO.which(this.toolPath,!0),new Promise(((e,t)=>jO(this,void 0,void 0,(function*(){this._debug("exec tool: "+this.toolPath),this._debug("arguments:");for(const e of this.args)this._debug(" "+e);const r=this._cloneExecOptions(this.options);!r.silent&&r.outStream&&r.outStream.write(this._getCommandString(r)+UO.EOL);const n=new WO(r,this.toolPath);if(n.on("debug",(e=>{this._debug(e)})),this.options.cwd&&!(yield qO.exists(this.options.cwd)))return t(Error(`The cwd: ${this.options.cwd} does not exist!`));const o=this._getSpawnFileName(),i=BO.spawn(o,this._getSpawnArgs(r),this._getSpawnOptions(this.options,o));let s="";i.stdout&&i.stdout.on("data",(e=>{this.options.listeners&&this.options.listeners.stdout&&this.options.listeners.stdout(e),!r.silent&&r.outStream&&r.outStream.write(e),s=this._processLineBuffer(e,s,(e=>{this.options.listeners&&this.options.listeners.stdline&&this.options.listeners.stdline(e)}))}));let a="";if(i.stderr&&i.stderr.on("data",(e=>{n.processStderr=!0,this.options.listeners&&this.options.listeners.stderr&&this.options.listeners.stderr(e),!r.silent&&r.errStream&&r.outStream&&(r.failOnStdErr?r.errStream:r.outStream).write(e),a=this._processLineBuffer(e,a,(e=>{this.options.listeners&&this.options.listeners.errline&&this.options.listeners.errline(e)}))})),i.on("error",(e=>{n.processError=e.message,n.processExited=!0,n.processClosed=!0,n.CheckComplete()})),i.on("exit",(e=>{n.processExitCode=e,n.processExited=!0,this._debug(`Exit code ${e} received from tool '${this.toolPath}'`),n.CheckComplete()})),i.on("close",(e=>{n.processExitCode=e,n.processExited=!0,n.processClosed=!0,this._debug(`STDIO streams have closed for tool '${this.toolPath}'`),n.CheckComplete()})),n.on("done",((r,n)=>{s.length>0&&this.emit("stdline",s),a.length>0&&this.emit("errline",a),i.removeAllListeners(),r?t(r):e(n)})),this.options.input){if(!i.stdin)throw Error("child process missing stdin");i.stdin.end(this.options.input)}}))))}))}},DO.argStringToArray=function(e){function t(e){o&&'"'!==e&&(i+="\\"),i+=e,o=!1}const r=[];let n=!1,o=!1,i="";for(let s=0;e.length>s;s++){const a=e.charAt(s);'"'!==a?"\\"===a&&o?t(a):"\\"===a&&n?o=!0:" "!==a||n?t(a):i.length>0&&(r.push(i),i=""):o?t(a):n=!n}return i.length>0&&r.push(i.trim()),r};class WO extends FO.EventEmitter{constructor(e,t){if(super(),this.processClosed=!1,this.processError="",this.processExitCode=0,this.processExited=!1,this.processStderr=!1,this.delay=1e4,this.done=!1,this.timeout=null,!t)throw Error("toolPath must not be empty");this.options=e,this.toolPath=t,e.delay&&(this.delay=e.delay)}CheckComplete(){this.done||(this.processClosed?this._setResult():this.processExited&&(this.timeout=VO.setTimeout(WO.HandleTimeout,this.delay,this)))}_debug(e){this.emit("debug",e)}_setResult(){let e;this.processExited&&(this.processError?e=Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`):0===this.processExitCode||this.options.ignoreReturnCode?this.processStderr&&this.options.failOnStdErr&&(e=Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`)):e=Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`)),this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.done=!0,this.emit("done",e,this.processExitCode)}static HandleTimeout(e){e.done||(!e.processClosed&&e.processExited&&e._debug(`The STDIO streams did not close within ${e.delay/1e3} seconds of the exit event from process '${e.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`),e._setResult())}}var XO=Bn&&Bn.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),KO=Bn&&Bn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),YO=Bn&&Bn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&XO(t,e,r);return KO(t,e),t},JO=Bn&&Bn.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(t){i(t)}}function a(e){try{c(n.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(CO,"__esModule",{value:!0}),exports.getExecOutput_1=CO.getExecOutput=exports.exec_2=CO.exec=void 0;const QO=In,ZO=YO(DO);exports.exec_2=CO.exec=pt,exports.getExecOutput_1=CO.getExecOutput=function(e,t,r){var n,o;return JO(this,void 0,void 0,(function*(){let i="",s="";const a=new QO.StringDecoder("utf8"),c=new QO.StringDecoder("utf8"),l=null===(n=null==r?void 0:r.listeners)||void 0===n?void 0:n.stdout,u=null===(o=null==r?void 0:r.listeners)||void 0===o?void 0:o.stderr,d=Object.assign(Object.assign({},null==r?void 0:r.listeners),{stdout:e=>{i+=a.write(e),l&&l(e)},stderr:e=>{s+=c.write(e),u&&u(e)}}),p=yield pt(e,t,Object.assign(Object.assign({},r),{listeners:d}));return i+=a.end(),s+=c.end(),{exitCode:p,stdout:i,stderr:s}}))};var eT={},tT=Bn&&Bn.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),rT=Bn&&Bn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),nT=Bn&&Bn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&tT(t,e,r);return rT(t,e),t},oT=Bn&&Bn.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(t){i(t)}}function a(e){try{c(n.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(eT,"__esModule",{value:!0}),eT.RetryHelper=void 0;const iT=nT(m());eT.RetryHelper=class{constructor(e,t,r){if(1>e)throw Error("max attempts should be greater than or equal to 1");if(this.maxAttempts=e,this.minSeconds=Math.floor(t),this.maxSeconds=Math.floor(r),this.minSeconds>this.maxSeconds)throw Error("min seconds should be less than or equal to max seconds")}execute(e,t){return oT(this,void 0,void 0,(function*(){let r=1;for(;this.maxAttempts>r;){try{return yield e()}catch(n){if(t&&!t(n))throw n;iT.info(n.message)}const o=this.getSleepAmount();iT.info(`Waiting ${o} seconds before trying again`),yield this.sleep(o),r++}return yield e()}))}getSleepAmount(){return Math.floor(Math.random()*(this.maxSeconds-this.minSeconds+1))+this.minSeconds}sleep(e){return oT(this,void 0,void 0,(function*(){return new Promise((t=>setTimeout(t,1e3*e)))}))}};var sT=Bn&&Bn.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),aT=Bn&&Bn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),cT=Bn&&Bn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&sT(t,e,r);return aT(t,e),t},lT=Bn&&Bn.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(t){i(t)}}function a(e){try{c(n.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},uT=Bn&&Bn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(fO,"__esModule",{value:!0}),fO.evaluateVersions=fO.isExplicitVersion=exports.findFromManifest_1=fO.findFromManifest=exports.getManifestFromRepo_1=fO.getManifestFromRepo=fO.findAllVersions=exports.find_1=fO.find=fO.cacheFile=exports.cacheDir_1=fO.cacheDir=exports.extractZip_1=fO.extractZip=fO.extractXar=exports.extractTar_1=fO.extractTar=fO.extract7z=exports.downloadTool_1=fO.downloadTool=exports.HTTPError_1=fO.HTTPError=void 0;const dT=cT(m()),pT=cT(hO),fT=cT(gn),hT=cT(IO),mT=cT(yn),yT=cT(wn),gT=cT(Go),vT=cT(RO),wT=cT(Pn),bT=cT(On),ET=Cn,_T=uT((function(e,t,r){var n=t&&r||0;"string"==typeof e&&(t="binary"===e?Array(16):null,e=null);var o=(e=e||{}).random||(e.rng||PO)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t)for(var i=0;16>i;++i)t[n+i]=o[i];return t||$O(o)})),ST=CO,OT=eT;class TT extends Error{constructor(e){super("Unexpected HTTP response: "+e),this.httpStatusCode=e,Object.setPrototypeOf(this,new.target.prototype)}}exports.HTTPError_1=fO.HTTPError=TT;const RT="win32"===process.platform,IT="darwin"===process.platform;exports.downloadTool_1=fO.downloadTool=function(e,t,r,n){return lT(this,void 0,void 0,(function*(){t=t||yT.join(bt(),_T.default()),yield pT.mkdirP(yT.dirname(t)),dT.debug("Downloading "+e),dT.debug("Destination "+t);const o=Et("TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS",10),i=Et("TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS",20),s=new OT.RetryHelper(3,o,i);return yield s.execute((()=>lT(this,void 0,void 0,(function*(){return yield function(e,t,r,n){return lT(this,void 0,void 0,(function*(){if(fT.existsSync(t))throw Error(`Destination file path ${t} already exists`);const o=new gT.HttpClient("actions/tool-cache",[],{allowRetries:!1});r&&(dT.debug("set auth"),void 0===n&&(n={}),n.authorization=r);const i=yield o.get(e,n);if(200!==i.message.statusCode){const t=new TT(i.message.statusCode);throw dT.debug(`Failed to download from "${e}". Code(${i.message.statusCode}) Message(${i.message.statusMessage})`),t}const s=bT.promisify(wT.pipeline),a=Et("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY",(()=>i.message))();let c=!1;try{return yield s(a,fT.createWriteStream(t)),dT.debug("download complete"),c=!0,t}finally{if(!c){dT.debug("download failed");try{yield pT.rmRF(t)}catch(l){dT.debug(`Failed to delete '${t}'. ${l.message}`)}}}}))}(e,t||"",r,n)}))),(e=>!(e instanceof TT&&e.httpStatusCode&&500>e.httpStatusCode&&408!==e.httpStatusCode&&429!==e.httpStatusCode)))}))},fO.extract7z=function(e,t,r){return lT(this,void 0,void 0,(function*(){ET.ok(RT,"extract7z() not supported on current OS"),ET.ok(e,'parameter "file" is required'),t=yield ht(t);const n=process.cwd();if(process.chdir(t),r)try{const t=["x",dT.isDebug()?"-bb1":"-bb0","-bd","-sccUTF-8",e],n={silent:!0};yield ST.exec(`"${r}"`,t,n)}finally{process.chdir(n)}else{const r=["-NoLogo","-Sta","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",`& '${yT.join(__dirname,"..","scripts","Invoke-7zdec.ps1").replace(/'/g,"''").replace(/"|\n|\r/g,"")}' -Source '${e.replace(/'/g,"''").replace(/"|\n|\r/g,"")}' -Target '${t.replace(/'/g,"''").replace(/"|\n|\r/g,"")}'`],o={silent:!0};try{const e=yield pT.which("powershell",!0);yield ST.exec(`"${e}"`,r,o)}finally{process.chdir(n)}}return t}))},exports.extractTar_1=fO.extractTar=function(e,t,r="xz"){return lT(this,void 0,void 0,(function*(){if(!e)throw Error("parameter 'file' is required");t=yield ht(t),dT.debug("Checking tar --version");let n="";yield ST.exec("tar --version",[],{ignoreReturnCode:!0,silent:!0,listeners:{stdout:e=>n+=""+e,stderr:e=>n+=""+e}}),dT.debug(n.trim());const o=n.toUpperCase().includes("GNU TAR");let i;i=r instanceof Array?r:[r],dT.isDebug()&&!r.includes("v")&&i.push("-v");let s=t,a=e;return RT&&o&&(i.push("--force-local"),s=t.replace(/\\/g,"/"),a=e.replace(/\\/g,"/")),o&&(i.push("--warning=no-unknown-keyword"),i.push("--overwrite")),i.push("-C",s,"-f",a),yield ST.exec("tar",i),t}))},fO.extractXar=function(e,t,r=[]){return lT(this,void 0,void 0,(function*(){let n;ET.ok(IT,"extractXar() not supported on current OS"),ET.ok(e,'parameter "file" is required'),t=yield ht(t),n=r instanceof Array?r:[r],n.push("-x","-C",t,"-f",e),dT.isDebug()&&n.push("-v");const o=yield pT.which("xar",!0);var i;return yield ST.exec(`"${o}"`,(i=n,Array.from(new Set(i)))),t}))},exports.extractZip_1=fO.extractZip=function(e,t){return lT(this,void 0,void 0,(function*(){if(!e)throw Error("parameter 'file' is required");return t=yield ht(t),RT?yield function(e,t){return lT(this,void 0,void 0,(function*(){const r=e.replace(/'/g,"''").replace(/"|\n|\r/g,""),n=t.replace(/'/g,"''").replace(/"|\n|\r/g,""),o=yield pT.which("pwsh",!1);if(o){const e=["-NoLogo","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",["$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;",`try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${r}', '${n}', $true) }`,`catch { if (($_.Exception.GetType().FullName -eq 'System.Management.Automation.MethodException') -or ($_.Exception.GetType().FullName -eq 'System.Management.Automation.RuntimeException') ){ Expand-Archive -LiteralPath '${r}' -DestinationPath '${n}' -Force } else { throw $_ } } ;`].join(" ")];dT.debug("Using pwsh at path: "+o),yield ST.exec(`"${o}"`,e)}else{const e=["-NoLogo","-Sta","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",["$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;",`if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${r}' -DestinationPath '${n}' -Force }`,`else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${r}', '${n}', $true) }`].join(" ")],t=yield pT.which("powershell",!0);dT.debug("Using powershell at path: "+t),yield ST.exec(`"${t}"`,e)}}))}(e,t):yield function(e,t){return lT(this,void 0,void 0,(function*(){const r=yield pT.which("unzip",!0),n=[e];dT.isDebug()||n.unshift("-q"),n.unshift("-o"),yield ST.exec(`"${r}"`,n,{cwd:t})}))}(e,t),t}))},exports.cacheDir_1=fO.cacheDir=function(e,t,r,n){return lT(this,void 0,void 0,(function*(){if(r=vT.clean(r)||r,n=n||mT.arch(),dT.debug(`Caching tool ${t} ${r} ${n}`),dT.debug("source dir: "+e),!fT.statSync(e).isDirectory())throw Error("sourceDir is not a directory");const o=yield mt(t,r,n);for(const t of fT.readdirSync(e)){const r=yT.join(e,t);yield pT.cp(r,o,{recursive:!0})}return yt(t,r,n),o}))},fO.cacheFile=function(e,t,r,n,o){return lT(this,void 0,void 0,(function*(){if(n=vT.clean(n)||n,o=o||mT.arch(),dT.debug(`Caching tool ${r} ${n} ${o}`),dT.debug("source file: "+e),!fT.statSync(e).isFile())throw Error("sourceFile is not a file");const i=yield mt(r,n,o),s=yT.join(i,t);return dT.debug("destination file "+s),yield pT.cp(e,s),yt(r,n,o),i}))},exports.find_1=fO.find=function(e,t,r){if(!e)throw Error("toolName parameter is required");if(!t)throw Error("versionSpec parameter is required");r=r||mT.arch(),gt(t)||(t=vt(ft(e,r),t));let n="";if(t){t=vT.clean(t)||"";const o=yT.join(wt(),e,t,r);dT.debug("checking cache: "+o),fT.existsSync(o)&&fT.existsSync(o+".complete")?(dT.debug(`Found tool in cache ${e} ${t} ${r}`),n=o):dT.debug("not found")}return n},fO.findAllVersions=ft,exports.getManifestFromRepo_1=fO.getManifestFromRepo=function(e,t,r,n="master"){return lT(this,void 0,void 0,(function*(){let o=[];const i=`https://api.github.com/repos/${e}/${t}/git/trees/${n}`,s=new gT.HttpClient("tool-cache"),a={};r&&(dT.debug("set auth"),a.authorization=r);const c=yield s.getJson(i,a);if(!c.result)return o;let l="";for(const e of c.result.tree)if("versions-manifest.json"===e.path){l=e.url;break}a.accept="application/vnd.github.VERSION.raw";let u=yield(yield s.get(l,a)).readBody();if(u){u=u.replace(/^\uFEFF/,"");try{o=JSON.parse(u)}catch(d){dT.debug("Invalid json")}}return o}))},exports.findFromManifest_1=fO.findFromManifest=function(e,t,r,n=mT.arch()){return lT(this,void 0,void 0,(function*(){return yield hT._findMatch(e,t,r,n)}))},fO.isExplicitVersion=gt,fO.evaluateVersions=vt;var xT={};Object.defineProperty(xT,"__esModule",{value:!0}),xT.retryAsPromised=xT.TimeoutError=void 0;let NT=class extends Error{constructor(e,t){super(e),this.name="TimeoutError",this.previous=t}};xT.TimeoutError=NT,xT.retryAsPromised=_t;var AT=xT.default=_t;let PT;const $T=e=>{if(e)if("object"==typeof e)e={mode:511,...e};else if("number"==typeof e)e={mode:e};else{if("string"!=typeof e)throw new TypeError("invalid options argument");e={mode:parseInt(e,8)}}else e={mode:511};const t=e,r=e.fs||{};return e.mkdir=e.mkdir||r.mkdir||gn.mkdir,e.mkdirAsync=e.mkdirAsync?e.mkdirAsync:async(e,r)=>new Promise(((n,o)=>t.mkdir(e,r,((e,t)=>e?o(e):n(t))))),e.stat=e.stat||r.stat||gn.stat,e.statAsync=e.statAsync?e.statAsync:async e=>new Promise(((r,n)=>t.stat(e,((e,t)=>e?n(e):r(t))))),e.statSync=e.statSync||r.statSync||gn.statSync,e.mkdirSync=e.mkdirSync||r.mkdirSync||gn.mkdirSync,t},CT=(e,t,r)=>{const n=wn.dirname(e),o={...$T(t),recursive:!1};if(n===e)try{return o.mkdirSync(e,o)}catch(i){if(i&&"EISDIR"!==i.code)throw i;return}try{return o.mkdirSync(e,o),r||e}catch(i){const t=i;if(t&&"ENOENT"===t.code)return CT(e,o,CT(n,o,r));if(t&&"EEXIST"!==t.code&&t&&"EROFS"!==t.code)throw i;try{if(!o.statSync(e).isDirectory())throw i}catch(s){throw i}}},DT=Object.assign((async(e,t,r)=>{const n=$T(t);n.recursive=!1;const o=wn.dirname(e);return o===e?n.mkdirAsync(e,n).catch((e=>{if(e&&"EISDIR"!==e.code)throw e})):n.mkdirAsync(e,n).then((()=>r||e),(async t=>{const i=t;if(i&&"ENOENT"===i.code)return DT(o,n).then((t=>DT(e,n,t)));if(i&&"EEXIST"!==i.code&&"EROFS"!==i.code)throw t;return n.statAsync(e).then((e=>{if(e.isDirectory())return r;throw t}),(()=>{throw t}))}))}),{sync:CT}),LT=async(e,t,r)=>{if(r!==t)return e.statAsync(t).then((e=>e.isDirectory()?r:void 0),(r=>r&&"ENOENT"===r.code?LT(e,wn.dirname(t),t):void 0))},kT=(e,t,r)=>{if(r!==t)try{return e.statSync(t).isDirectory()?r:void 0}catch(n){return n&&"ENOENT"===n.code?kT(e,wn.dirname(t),t):void 0}},MT=(e,t)=>{const r=$T(t);if(r.recursive=!0,wn.dirname(e)===e)return r.mkdirSync(e,r);const n=kT(r,e);try{return r.mkdirSync(e,r),n}catch(o){if(o&&"ENOENT"===o.code)return CT(e,r);throw o}},jT=Object.assign((async(e,t)=>{const r={...$T(t),recursive:!0};return wn.dirname(e)===e?await r.mkdirAsync(e,r):LT(r,e).then((t=>r.mkdirAsync(e,r).then((e=>t||e)).catch((t=>{if(t&&"ENOENT"===t.code)return DT(e,r);throw t}))))}),{sync:MT}),UT=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,FT=e=>{if(/\0/.test(e))throw Object.assign(new TypeError("path must be a string without null bytes"),{path:e,code:"ERR_INVALID_ARG_VALUE"});if(e=wn.resolve(e),"win32"===UT){const t=/[*|"<>?:]/,{root:r}=wn.parse(e);if(t.test(e.substring(r.length)))throw Object.assign(Error("Illegal characters in path."),{path:e,code:"EINVAL"})}return e},BT=(process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version).replace(/^v/,"").split("."),GT=+BT[0]>10||10==+BT[0]&&+BT[1]>=12,HT=GT?e=>$T(e).mkdirSync===gn.mkdirSync:()=>!1,qT=Object.assign(GT?e=>$T(e).mkdir===gn.mkdir:()=>!1,{sync:HT}),VT=(e,t)=>{e=FT(e);const r=$T(t);return HT(r)?MT(e,r):CT(e,r)},zT=Object.assign((async(e,t)=>{e=FT(e);const r=$T(t);return qT(r)?jT(e,r):DT(e,r)}),{mkdirpSync:VT,mkdirpNative:jT,mkdirpNativeSync:MT,mkdirpManual:DT,mkdirpManualSync:CT,sync:VT,native:jT,nativeSync:MT,manual:DT,manualSync:CT,useNative:qT,useNativeSync:HT}),WT=/v?(\d\S*)/,XT="darwin"===process.platform&&"x64"===process.arch?"15.0.7":"18.1.8",KT={llvm:XT,clang:XT,"clang++":XT,"clang-tidy":XT,clangtidy:XT,"clang-format":XT,clangformat:XT,ninja:"1.12.1",cmake:"3.30.2",gcovr:"5.2",conan:"1.64.1",meson:"1.5.1",kcov:"42",task:"3.38.0",doxygen:He()?"1.11.0-4":"1.11.0",gcc:"win32"===process.platform?"14.2.0posix-18.1.8-12.0.0-ucrt-r1":"",powershell:"7.4.5"},YT="22.2.0",JT="3.7.9",QT={mingw:{24:"8.0.0-1",22:"8.0.0-1",20:"7.0.0-2"},gcovr:{24:"6.0",22:"6.0",20:"6.0",18:"5.0"},meson:{24:"1.0.0",22:"1.0.0",20:"1.0.0",18:"0.61.4"},nala:{24:"",22:"",21:"legacy",20:"legacy",18:"legacy",16:"legacy",14:"legacy"},kcov:{24:"42-binary",22:"42-binary",20:"40-binary",18:"40",16:"40",14:"40"},doxygen:{24:"1.11.0",22:"1.11.0",20:"1.10.0",18:"1.10.0"}},ZT=_b((async function(e){const t=[];"linux"===process.platform?t.push("/home/runner/.local/bin/"):"darwin"===process.platform&&t.push("/usr/local/bin/");const r=(await exports.getExecOutput_1(e+' -c "import sys;print(sys.base_exec_prefix);"')).stdout.trim();return t.push(wn.join(r,"Scripts"),wn.join(r,"Scripts","bin"),wn.join(r,"bin")),function(e){return[...new Set(e)]}(t)}),{promise:!0});var eR={};Object.defineProperty(eR,"__esModule",{value:!0});var tR=eR.getUbuntuVersion=void 0;const rR=Rn;tR=eR.getUbuntuVersion=async function(){if("linux"!==process.platform)return[];const e=await(t="lsb_release",r=["-a"],new Promise(((e,n)=>{rR.execFile(t,r,{encoding:"utf8",shell:!1},((o,i,s)=>{if(o)return"errno"in o&&"ENOENT"===o.code?void e(null):void n(Error(`Could not execute \`${t} ${r.join(" ")}\`: ${o} (stderr=${s})`));e(i)}))})));var t,r;if(null===e)return[];const n=/^Distributor ID:\s*(.+)$/,o=/^Description:\s*Ubuntu\s+(\d+)\.(\d+)(?:\.(\d+))?/,i=/^Release:\s*(\d+)\.(\d+)(?:\.(\d+))?$/;let s=null,a=null,c=!1;for(const l of e.split("\n")){const e=l.match(n);if(null!==e){if("Ubuntu"!==e[1])return[];c=!0}const t=l.match(o);t&&(s=t);const r=l.match(i);if(r&&(a=r),c&&s&&a)break}if(!c)return[];for(const l of[s,a])if(l){const e=[l[1],l[2]];return l[3]&&e.push(l[3]),e.map((e=>parseInt(e,10)))}return[]};const nR=_b((async function(){try{if(qe()){try{null===Ny.sync("lsb_release",{nothrow:!0})&&await De([{name:"lsb-release"}])}catch{return Gt()}const e=await tR();return 0===e.length?Gt():e}return null}catch(e){return g(""+e),null}}),{promise:!0}),oR=_b((async function(){let e=process.env.PIPX_HOME;if(void 0!==e)return e;const t=le("~/.local/pipx");if(await ce(t))return t;switch(process.platform){case"win32":e=le("~/AppData/Local/pipx");break;case"darwin":e=le("~/Library/Application Support/pipx");break;default:e=le("~/.local/share/pipx")}return await zT(e),await zT(wn.join(e,"trash")),await zT(wn.join(e,"shared")),await zT(wn.join(e,"venv")),e}),{promise:!0}),iR=_b((async function(){if(void 0!==process.env.PIPX_BIN_DIR)return process.env.PIPX_BIN_DIR;const e=le("~/.local/bin");return await he(e,KR),await zT(e),e}),{promise:!0});let sR;const aR=new Map([[24,["Sequoia","15"]],[23,["Sonoma","14"]],[22,["Ventura","13"]],[21,["Monterey","12"]],[20,["Big Sur","11"]],[19,["Catalina","10.15"]],[18,["Mojave","10.14"]],[17,["High Sierra","10.13"]],[16,["Sierra","10.12"]],[15,["El Capitan","10.11"]],[14,["Yosemite","10.10"]],[13,["Mavericks","10.9"]],[12,["Mountain Lion","10.8"]],[11,["Lion","10.7"]],[10,["Snow Leopard","10.6"]],[9,["Leopard","10.5"]],[8,["Tiger","10.4"]],[7,["Panther","10.3"]],[6,["Jaguar","10.2"]],[5,["Puma","10.1"]]]),cR=_b((function(){if("darwin"!==process.platform)return[];const{version:e}=function(e){e=Number((e||yn.release()).split(".")[0]);const[t,r]=aR.get(e)||["Unknown",""];return{name:t,version:r}}();return e.split(".").map((e=>Number.parseInt(e,10)))})),lR="string"==typeof __dirname?__dirname:wn.dirname(Tn.fileURLToPath("undefined"==typeof document?require("url").pathToFileURL(__filename).href:kn&&kn.src||new URL("setup-cpp.js",document.baseURI).href)),uR="string"==typeof __dirname?__dirname:wn.dirname(Tn.fileURLToPath("undefined"==typeof document?require("url").pathToFileURL(__filename).href:kn&&kn.src||new URL("setup-cpp.js",document.baseURI).href)),dR="string"==typeof __dirname?__dirname:wn.dirname(Tn.fileURLToPath("undefined"==typeof document?require("url").pathToFileURL(__filename).href:kn&&kn.src||new URL("setup-cpp.js",document.baseURI).href));class pR extends Error{constructor(e){super(e),this.name="TimeoutError"}}class fR extends Error{constructor(e){super(),this.name="AbortError",this.message=e}}const hR=e=>void 0===globalThis.DOMException?new fR(e):new DOMException(e),mR=e=>{const t=void 0===e.reason?hR("This operation was aborted."):e.reason;return t instanceof Error?t:hR(t)},yR=m(),gR=Rn,vR=gn,wR=wn,bR=xn,ER=bR.env["ProgramFiles(x86)"],_R=[bR.env["ProgramFiles(x86)"],bR.env.ProgramFiles],SR=["Enterprise","Professional","Community","BuildTools"],OR=["2022","2019","2017"],TR={2022:"17.0",2019:"16.0",2017:"15.0",2015:"14.0",2013:"12.0"};var RR=hr;const IR=ER+"\\Microsoft Visual Studio\\Installer";var xR=yr,NR=function(e,t,r,n,o,i){if("win32"!=bR.platform)return void yR.info("This is not a Windows virtual environment, bye!");bR.env.PATH+=wR.delimiter+IR;let s={win32:"x86",win64:"x64",x86_64:"x64","x86-64":"x64"};e.toLowerCase()in s&&(e=s[e.toLowerCase()]);var a=[e];n&&!0===JSON.parse(n)&&a.push("uwp"),t&&a.push(t),r&&a.push("-vcvars_ver="+r),o&&!0===JSON.parse(o)&&a.push("-vcvars_spectre_libs=spectre");const c=`"${yr(i)}" ${a.join(" ")}`;yR.debug("vcvars command-line: "+c);const l=(""+gR.execSync(`set && cls && ${c} && cls && set`,{shell:"cmd"})).split("\f"),u=l[0].split("\r\n"),d=l[1].split("\r\n"),p=l[2].split("\r\n"),f=d.filter((e=>!(!e.match(/^\[ERROR.*\]/)||e.match(/Error in script usage. The correct usage is:$/))));if(f.length>0)throw Error("invalid parameters\r\n"+f.join("\r\n"));let h={};for(let m of u){const[e,t]=m.split("=");h[e]=t}yR.startGroup("Environment variables");for(let m of p){if(!m.includes("="))continue;let[e,t]=m.split("=");t!==h[e]&&(yR.info("Setting "+e),gr(e)&&(t=t.split(";").filter((function(e,t,r){return r.indexOf(e)===t})).join(";")),yR.exportVariable(e,t))}yR.endGroup(),yR.info("Configured Developer Command Prompt")},AR=(e=>(e[e.All=0]="All",e[e.ClangFormat=1]="ClangFormat",e[e.Core=2]="Core",e))(AR||{});const PR="string"==typeof __dirname?__dirname:wn.dirname(Tn.fileURLToPath("undefined"==typeof document?require("url").pathToFileURL(__filename).href:kn&&kn.src||new URL("setup-cpp.js",document.baseURI).href)),$R="string"==typeof __dirname?__dirname:wn.dirname(Tn.fileURLToPath("undefined"==typeof document?require("url").pathToFileURL(__filename).href:kn&&kn.src||new URL("setup-cpp.js",document.baseURI).href)),CR=_b((async function(e,t,r){const[n,o]=await Promise.all([Or(e,t,r),Rr()]);return await LR(r),n}),{promise:!0}),DR=_b((async function(e){if(qe())if(e>10)await De([{name:"libtinfo-dev"}]);else try{await De([{name:"libtinfo5"}])}catch(t){w(`Failed to install libtinfo5 ${t}\nManually installing the package`);const e=`libtinfo5_6.3-2ubuntu0.1_${aO.includes(process.arch)?"amd64":lO.includes(process.arch)?"arm64":process.arch}.deb`,r="http://launchpadlibrarian.net/666971015/"+e,n=new RS.DownloaderHelper(r,yn.tmpdir(),{fileName:e});n.on("error",(e=>{throw Error(`Failed to download ${r}: ${e}`)})),await n.start(),V("dpkg",["-i",wn.join(yn.tmpdir(),e)])}else He()?await Xe("ncurses5-compat-libs",void 0,"yay"):Ge()&&await We([{name:"ncurses-compat-libs"}])}),{promise:!0}),LR=_b((async function(e){"linux"===process.platform&&await or(Ft("gcc",void 0,await nR()),"",e,40)}),{promise:!0}),kR="string"==typeof __dirname?__dirname:wn.dirname(Tn.fileURLToPath("undefined"==typeof document?require("url").pathToFileURL(__filename).href:kn&&kn.src||new URL("setup-cpp.js",document.baseURI).href));let MR,jR=!1;const UR={llvm:Er,clang:Er,"clang++":Er},FR={gcc:or,"g++":or},BR={mingw:ir},GR={msvc:Ir,cl:Ir,msbuild:Ir,visualstudio:Ir},HR={appleclang:fr,applellvm:fr,"apple-clang":fr,"apple-llvm":fr},qR={cmakelang:Kt,"cmake-lint":Kt,"cmake-format":Kt,cmakelint:Kt,cmakeformat:Kt},VR=["llvm","clang","clang++","clang-tidy","clang-format","clangtidy","clangformat"],zR={nala:async function(e,t,r){if(!qe())return;if("string"==typeof MR)return{binDir:MR};const n=Ny.sync("nala",{nothrow:!0});if(null!==n)return MR=wn.dirname(n),{binDir:MR};await De([{name:"python3-apt"}]),MR="/usr/bin";try{const t=await $e({name:"nala",version:e});if(void 0!==t)return await De([{name:t}]),{binDir:MR}}catch(o){w("Failed to install nala: "+o)}try{const e=await $e({name:"nala-legacy"});if(void 0!==e)return await De([{name:e}],!0),{binDir:MR}}catch(o){w("Failed to install nala-legacy: "+o)}return await async function(){const e=new RS.DownloaderHelper("https://gitlab.com/volian/volian-archive/-/raw/main/install-nala.sh",yn.tmpdir(),{fileName:"install-nala.sh"});e.on("error",(e=>{throw Error("Failed to download install-nala.sh: "+e)})),await e.start();const t=wn.join(yn.tmpdir(),"install-nala.sh"),r=await Wm(t,"utf8");await ny(t,r.replace(/sudo/g,"")),await De([{name:"wget"}]);try{V("bash",[t])}catch(o){y("Failed to install nala via installer: "+o),V("apt",["install","-y","-t","nala","nala"])}}(),{binDir:MR}},brew:je,choco:Ve,python:Dt,powershell:Pr,pwsh:Pr,...UR,...FR,...BR,...GR,...HR,...qR,cmake:Pt,ninja:lr,vcpkg:async function(e,t,r){return jR&&null!==Ny.sync("vcpkg",{nothrow:!0})?{binDir:wn.dirname(Ny.sync("vcpkg"))}:("linux"===process.platform&&(He()?await Promise.all([Xe("curl"),Xe("zip"),Xe("unzip"),Xe("tar"),Xe("git"),Xe("pkg-config")]):Ge()?await We([{name:"curl"},{name:"zip"},{name:"unzip"},{name:"tar"},{name:"git"},{name:"pkg-config"}]):qe()&&await De([{name:"curl"},{name:"zip"},{name:"unzip"},{name:"tar"},{name:"git"},{name:"pkg-config"}])),await ce(wn.join(t,rt("bootstrap-vcpkg",".bat")))?v(`Vcpkg folder already exists at ${t}. Skipping the clone`):xm("git",["clone","https://github.com/microsoft/vcpkg"],{cwd:wn.dirname(t),stdio:"inherit"}),""!==e&&"true"!==e&&(w("Checking out vcpkg version "+e),xm("git",["checkout",e],{cwd:t,stdio:"inherit"})),xm(rt(nt("bootstrap-vcpkg"),".bat"),{cwd:t,shell:!0,stdio:"inherit"}),await Y(t),await he(t,KR),jR=!0,{binDir:t})},bazel:async function(e,t,r){switch(process.platform){case"win32":return ze("bazelisk",e);case"darwin":return Be("bazelisk",e);case"linux":if(He())throw Error("installing bazel on Arch linux is not supported yet");if(Ge())return await We([{name:"dnf-plugins-core"}]),V("dnf",["copr","enable","vbatts/bazel"]),We([{name:"bazel4"}]);if(qe())return V("bash",["-c",`echo "deb [arch=amd64 signed-by=${await Le({fileName:"bazel-archive-keyring.gpg",keyUrl:"https://bazel.build/bazel-release.pub.gpg"})}] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list`]),De([{name:"bazel",version:e}],!0);throw Error("Unsupported linux distribution");default:throw Error("Unsupported platform")}},conan:function(e,t,r){return Ht("conan",e)},meson:function(e,t,r){return Ht("meson",e)},gcovr:function(e,t,r){return Ht("gcovr",e)},opencppcoverage:xr,OpenCppCoverage:xr,ccache:function(e,t,r){switch(process.platform){case"win32":return ze("ccache",e);case"darwin":return Be("ccache",e);case"linux":if(He())return Xe("ccache",e);if(Ge())return We([{name:"ccache",version:e}]);if(qe())return De([{name:"ccache",version:e}]);throw Error("Unsupported linux distribution");default:throw Error("Unsupported platform")}},sccache:function(e,t,r){switch(process.platform){case"win32":return ze("sccache",e);case"linux":case"darwin":return Be("sccache",e);default:throw Error("Unsupported platform")}},doxygen:async function(e,t,r){switch(process.platform){case"win32":{await AT((()=>ze("doxygen.install",e)),{name:"doxygen.install",max:4,backoffBase:2e3,report:e=>w(e)});const t={binDir:await async function(){if("win32"===process.platform){for(const e of["C:/ProgramData/chocolatey/bin","C:/Program Files/doxygen/bin","C:/Program Files (x86)/doxygen"])if(await ce(wn.join(e,"doxygen.exe")))return await he(e,KR),e;throw Error("Failed to find doxygen binary")}throw Error("Unsupported platform")}()};return await Yt(Ft("graphviz",void 0)),t}case"darwin":{const e=await Be("doxygen",void 0);return cR()[0]>11&&await Yt(Ft("graphviz",void 0)),e}case"linux":{let o;if(""===e||He()||Ge())if(He())o=await Xe("doxygen",e);else{if(Ge())return We([{name:"doxygen",version:e}]);if(!qe())throw Error("Unsupported linux distributions");o=await De([{name:"doxygen",version:e}])}else{if(!qe())throw Error("Unsupported linux distributions");try{o=await Nt("doxygen",e,Qt,t,r);try{await De([{name:"libclang-cpp9"}])}catch(n){w("Failed to download libclang-cpp9 that might be needed for running doxygen. "+n)}}catch(n){v(`Failed to download doxygen binary. ${n}. Falling back to apt-get.`),o=await De([{name:"doxygen"}])}}return await Yt(Ft("graphviz",void 0,await nR())),o}default:throw Error("Unsupported platform")}},graphviz:Yt,cppcheck:async function(e,t,r){switch(process.platform){case"win32":return await ze("cppcheck",e),{binDir:await async function(){const e="C:/Program Files/Cppcheck";return await he(e,KR),e}()};case"darwin":return Be("cppcheck",e);case"linux":if(He())return Xe("cppcheck",e);if(Ge())return We([{name:"ccache",version:e}]);if(qe())return De([{name:"cppcheck",version:e}]);throw Error("Unsupported linux distribution");default:throw Error("Unsupported platform")}},cpplint:function(e,t,r){return Ht("cpplint",e)},flawfinder:function(e,t,r){return Ht("flawfinder",e)},lizard:function(e,t,r){return Ht("lizard",e)},infer:function(e,t,r){return Nt("infer",e,ar,t,r)},"clang-tidy":Sr,clangtidy:Sr,"clang-format":_r,clangformat:_r,vcvarsall:vr,kcov:async function(e,t,r){if("linux"!==process.platform)return void w("Kcov is not supported on non-linux");const n=e.split("-");let o=function(e){return e.match(/^v/)?e:"v"+e}(n[0]);const i=n[1],s=function(e){return Number.parseInt(e.replace(/^v/,""),10)}(o);let a;return 38===s&&(o="v38"),"binary"!==i||39>s?(a=await Nt("kcov",o,dr,t,r),a):(a=await Nt("kcov",o,ur,t,r),He()?await Xe("binutils"):Ge()?await We([{name:"binutils"}]):qe()&&await De([{name:"libbinutils"}]),a)},make:async function(e,t,r){switch(process.platform){case"win32":return ze("make",e);case"darwin":{await Be("make",e);const t=wn.join(Fe(),"opt/make/libexec/gnubin");return await he(t,KR),{binDir:t}}case"linux":if(He())return Xe("make",e);if(Ge())return We([{name:"make",version:e}]);if(qe())return De([{name:"make",version:e}]);throw Error("Unsupported linux distribution");default:throw Error("Unsupported platform")}},task:function(e,t,r){return Nt("task",e,$r,t,r)},sevenzip:St,"7zip":St,"7z":St},WR=Object.keys(zR),XR=["compiler","architecture","timeout",...WR],KR={rcPath:le("~/.cpprc"),guard:"cpp"};(async function(e){var t,r,n;let o=Promise.resolve();Gn.GITHUB_ACTIONS||(o=async function(){try{await OS({pkg:TS})}catch(e){g("Failed to check for updates: "+(e instanceof Error?e.message+e.stack:e))}}(),process.env.ACTIONS_ALLOW_UNSECURE_COMMANDS="true");const i=function(e){return function(e,t){var r,n,o,i,s,a={_:[]},c=0,l=0,u=0,d=(e=e||[]).length;const p=void 0!==(t=t||{}).alias,f=void 0!==t.unknown,h=void 0!==t.default;if(t.alias=t.alias||{},t.string=Se(t.string),t.boolean=Se(t.boolean),p)for(r in t.alias)for(n=t.alias[r]=Se(t.alias[r]),c=0;n.length>c;c++)(t.alias[n[c]]=n.concat(r)).splice(c,1);for(c=t.boolean.length;c-- >0;)for(l=(n=t.alias[t.boolean[c]]||[]).length;l-- >0;)t.boolean.push(n[l]);for(c=t.string.length;c-- >0;)for(l=(n=t.alias[t.string[c]]||[]).length;l-- >0;)t.string.push(n[l]);if(h)for(r in t.default)if(i=typeof t.default[r],n=t.alias[r]=t.alias[r]||[],void 0!==t[i])for(t[i].push(r),c=0;n.length>c;c++)t[i].push(n[c]);const m=f?Object.keys(t.alias):[];for(c=0;d>c;c++){if("--"===(o=e[c])){a._=a._.concat(e.slice(++c));break}for(l=0;o.length>l&&45===o.charCodeAt(l);l++);if(0===l)a._.push(o);else if("no-"===o.substring(l,l+3)){if(i=o.substring(l+3),f&&!~m.indexOf(i))return t.unknown(o);a[i]=!1}else{for(u=l+1;o.length>u&&61!==o.charCodeAt(u);u++);for(i=o.substring(l,u),s=o.substring(++u)||c+1===d||45===(""+e[c+1]).charCodeAt(0)||e[++c],n=2===l?[i]:i,u=0;n.length>u;u++){if(i=n[u],f&&!~m.indexOf(i))return t.unknown("-".repeat(l)+i);Oe(a,i,n.length>u+1||s,t)}}}if(h)for(r in t.default)void 0===a[r]&&(a[r]=t.default[r]);if(p)for(r in a)for(n=t.alias[r]||[];n.length>0;)a[n.shift()]=a[r];return a}(e,{string:[...XR,"timeout"],default:Object.fromEntries(XR.map((e=>[e,Cr(e)]))),alias:{h:"help"},boolean:"help"})}(e);i.help&&(w('\nsetup-cpp [options]\nsetup-cpp --compiler llvm --cmake true --ninja true --ccache true --vcpkg true\n\nInstall all the tools required for building and testing C++/C projects.\n\n--architecture\t the cpu architecture to install the tools for. By default it uses the current CPU architecture.\n--timeout\t the timeout for the installation of each tool in minutes. By default it is 10 minutes.\n--compiler\t the to install.\n \t You can specify the version instead of specifying just the name e.g: --compiler \'llvm-13.0.0\'\n--$tool_name\t pass "true" or pass the you would like to install for this tool. e.g. --conan true or --conan "1.42.1"\n\nAll the available tools:\n'),console.table({"compiler and analyzer":{tools:"--llvm, --gcc, --msvc, --apple-clang, --vcvarsall"},"build system":{tools:"--cmake, --ninja, --meson, --make, --task, --bazel"},"package manager":{tools:"--vcpkg, --conan, --choco, --brew, --nala"},"analyzer/linter":{tools:"--clang-tidy, --clang-format, --cppcheck, --cpplint, --flawfinder, --lizard, --infer, , --cmakelang, --cmake-lint, --cmake-format"},cache:{tools:"--ccache, --sccache"},documentation:{tools:"--doxygen, --graphviz"},coverage:{tools:"--gcovr, --opencppcoverage, --kcov"},other:{tools:"--python, --powershell, --sevenzip"}},["tools"]));const s=null!=(t=i.architecture)?t:process.arch,a=null!=(r=process.env.SETUP_CPP_DIR)?r:le("~"),c=[],l=[],u=eE.create({autoloadLocales:!0});let d,p;eE.addLocale(tE),zb.addLocale(Wb);const f=await nR(),h=void 0!==i.compiler?function(e){try{const t=e.split("-"),r=t[0];if(1 in t){const e=t[1];return null===OE(e)&&w(`Invalid semver version ${e} used for the compiler.`),{compiler:r,version:e}}return{compiler:r,version:void 0}}catch(t){return y(`Failed to parse the compiler info ${e}: ${t}`),{compiler:e,version:void 0}}}(i.compiler):void 0;if(!function(e,t,r){var n,o;const i=void 0!==r&&t.includes(r.compiler),s=(i?t:t.filter((e=>"compiler"!==e))).filter((t=>void 0!==e[t])),a=s.filter((t=>!Bt(i&&"compiler"===t&&void 0!==r?r.version:e[t]))),c=0!==a.length?i&&"compiler"===a[0]&&void 0!==r?null!=(n=r.version)?n:"true":null!=(o=e[a[0]])?o:"true":"true";if(a.some((t=>i&&"compiler"===t&&void 0!==r?e.compiler!==`${r.compiler}-${c}`:e[t]!==c)))return!1;for(const l of s)e[l]=i&&"compiler"===l&&void 0!==r?`${r.compiler}-${c}`:c;return!0}(i,[...VR,"compiler"],h))return y("The same version must be used for llvm, clang-format and clang-tidy"),1;He()&&"string"==typeof i.cppcheck&&"string"==typeof i.gcovr&&(w("installing python-pygments to avoid conflicts with cppcheck and gcovr on Arch linux"),await Xe("python-pygments"));let m=!1;for(const y of WR){if(Gn.isCI&&0!==l.length){m=!0;break}const e=i[y];void 0!==e&&(d=Date.now(),await wr(y,e,f,s,a,c,l,60*Number.parseFloat(null!=(n=i.timeout)?n:"20")*1e3),p=Date.now(),w("took "+(u.format(d,p)||"0 seconds")))}if(!m&&void 0!==h){const e=Date.now();await async function(e,t,r,n,o,i,s){let a;try{if(Jo.startGroup(`Installing ${e} ${null!=t?t:""}`),e in UR)a=await Er(Ft("llvm",t,r),wn.join(n,"llvm"),o),await pe("GCOV","llvm-cov gcov",KR);else if(e in FR){const e=Ft("gcc",t,r);a=await or(e,wn.join(n,"gcc"),o),await sr(e)}else if(e in BR){const e=Ft("mingw",t,r);a=await ir(e,wn.join(n,"gcc"),o),await sr(e)}else e in GR?a=await Ir(Ft("msvc",t,r),wn.join(n,"msvc"),o):e in HR?await fr():(a=null,s.push("Unsupported compiler "+e))}catch(c){y(c),s.push(`Failed to install the ${e} ${t}`)}null!==a&&i.push(Dr(e,a)),Jo.endGroup()}(h.compiler,h.version,f,a,s,c,l);const t=Date.now();w("took "+(u.format(e,t)||"0 seconds"))}if(await async function(e){if(await ce(e.rcPath)){const t=(await Tb(e.rcPath,"utf-8")).split("\n"),r=[...new Set(t.reverse())].reverse();await Rb(e.rcPath,r.join("\n")),await Y(e.rcPath)}}(KR),0===c.length&&0===l.length)return g("setup-cpp was called without any arguments. Nothing to do."),0;for(const y of c)console.log(`${y}`);for(const g of l)y(g);if(w("setup-cpp finished"),!Gn.GITHUB_ACTIONS)switch(process.platform){case"win32":g("Run `RefreshEnv.cmd` or restart your shell to update the environment.");break;case"linux":case"darwin":g("Run `source ~/.cpprc` or restart your shell to update the environment.")}return await o,0===l.length?0:1})(process.argv).then((e=>{process.exitCode=e})).catch((e=>{y("main() panicked!"),y(e),process.exitCode=1})),exports.HttpClient=Fo,exports.ciInfo=Gn,exports.commonjsGlobal=Bn,exports.coreExports=Jo,exports.getAugmentedNamespace=r,exports.getDefaultExportFromCjs=t,exports.info=w,exports.pathExists=ce,exports.semver=sS,exports.warning=g; +"use strict";function e(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}function t(e){return e&&e.__esModule&&{}.hasOwnProperty.call(e,"default")?e.default:e}function r(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}function n(e,t,r){const n=new an(e,t,r);process.stdout.write(""+n+on.EOL)}function o(){return un>ln.length-16&&(Pr.randomFillSync(ln),un=0),ln.slice(un,un+=16)}function i(e){return"string"==typeof e&&pn.test(e)}function s(e,t=0){const r=(fn[e[t+0]]+fn[e[t+1]]+fn[e[t+2]]+fn[e[t+3]]+"-"+fn[e[t+4]]+fn[e[t+5]]+"-"+fn[e[t+6]]+fn[e[t+7]]+"-"+fn[e[t+8]]+fn[e[t+9]]+"-"+fn[e[t+10]]+fn[e[t+11]]+fn[e[t+12]]+fn[e[t+13]]+fn[e[t+14]]+fn[e[t+15]]).toLowerCase();if(!i(r))throw TypeError("Stringified UUID is invalid");return r}function a(e){if(!i(e))throw TypeError("Invalid UUID");let t;const r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r}function c(e,t,r){function n(e,n,o,i){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let r=0;e.length>r;++r)t.push(e.charCodeAt(r));return t}(e)),"string"==typeof n&&(n=a(n)),16!==n.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let c=new Uint8Array(16+e.length);if(c.set(n),c.set(e,n.length),c=r(c),c[6]=15&c[6]|t,c[8]=63&c[8]|128,o){i=i||0;for(let e=0;16>e;++e)o[i+e]=c[e];return o}return s(c)}try{n.name=e}catch(o){}return n.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",n}function l(e){const t="https:"===e.protocol;if(function(e){if(!e.hostname)return!1;if(function(e){const t=e.toLowerCase();return"localhost"===t||t.startsWith("127.")||t.startsWith("[::1]")||t.startsWith("[0:0:0:0:0:0:0:1]")}(e.hostname))return!0;const t=process.env.no_proxy||process.env.NO_PROXY||"";if(!t)return!1;let r;e.port?r=Number(e.port):"http:"===e.protocol?r=80:"https:"===e.protocol&&(r=443);const n=[e.hostname.toUpperCase()];"number"==typeof r&&n.push(`${n[0]}:${r}`);for(const o of t.split(",").map((e=>e.trim().toUpperCase())).filter((e=>e)))if("*"===o||n.some((e=>e===o||e.endsWith("."+o)||o.startsWith(".")&&e.endsWith(""+o))))return!0;return!1}(e))return;const r=t?process.env.https_proxy||process.env.HTTPS_PROXY:process.env.http_proxy||process.env.HTTP_PROXY;if(r)try{return new Pn(r)}catch{if(!r.startsWith("http://")&&!r.startsWith("https://"))return new Pn("http://"+r)}}function u(e){var t=this;t.options=e||{},t.proxyOptions=t.options.proxy||{},t.maxSockets=t.options.maxSockets||Cn.Agent.defaultMaxSockets,t.requests=[],t.sockets=[],t.on("free",(function(e,r,n,o){for(var i=f(r,n,o),s=0,a=t.requests.length;a>s;++s){var c=t.requests[s];if(c.host===i.host&&c.port===i.port)return t.requests.splice(s,1),void c.request.onSocket(e)}e.destroy(),t.removeSocket(e)}))}function p(e,t){var r=this;u.prototype.createSocket.call(r,e,(function(n){var o=e.request.getHeader("host"),i=d({},r.options,{socket:n,servername:o?o.replace(/:.*$/,""):e.host}),s=$n.connect(0,i);r.sockets[r.sockets.indexOf(n)]=s,t(s)}))}function f(e,t,r){return"string"==typeof e?{host:e,port:t,localAddress:r}:e}function d(e){for(var t=1,r=arguments.length;r>t;++t){var n=arguments[t];if("object"==typeof n)for(var o=Object.keys(n),i=0,s=o.length;s>i;++i){var a=o[i];void 0!==n[a]&&(e[a]=n[a])}}return e}function h(){return eo||(eo=1,function(e){var t=Kr&&Kr.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(t){i(t)}}function a(e){try{c(n.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.summary=e.markdownSummary=e.SUMMARY_DOCS_URL=e.SUMMARY_ENV_VAR=void 0;const r=Tr,n=xr,{access:o,appendFile:i,writeFile:s}=n.promises;e.SUMMARY_ENV_VAR="GITHUB_STEP_SUMMARY",e.SUMMARY_DOCS_URL="https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";const a=new class{constructor(){this._buffer=""}filePath(){return t(this,void 0,void 0,(function*(){if(this._filePath)return this._filePath;const t=process.env[e.SUMMARY_ENV_VAR];if(!t)throw Error(`Unable to find environment variable for $${e.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);try{yield o(t,n.constants.R_OK|n.constants.W_OK)}catch(r){throw Error(`Unable to access summary file: '${t}'. Check if the file has correct read/write permissions.`)}return this._filePath=t,this._filePath}))}wrap(e,t,r={}){const n=Object.entries(r).map((([e,t])=>` ${e}="${t}"`)).join("");return t?`<${e}${n}>${t}`:`<${e}${n}>`}write(e){return t(this,void 0,void 0,(function*(){const t=!!(null==e?void 0:e.overwrite),r=yield this.filePath(),n=t?s:i;return yield n(r,this._buffer,{encoding:"utf8"}),this.emptyBuffer()}))}clear(){return t(this,void 0,void 0,(function*(){return this.emptyBuffer().write({overwrite:!0})}))}stringify(){return this._buffer}isEmptyBuffer(){return 0===this._buffer.length}emptyBuffer(){return this._buffer="",this}addRaw(e,t=!1){return this._buffer+=e,t?this.addEOL():this}addEOL(){return this.addRaw(r.EOL)}addCodeBlock(e,t){const r=Object.assign({},t&&{lang:t}),n=this.wrap("pre",this.wrap("code",e),r);return this.addRaw(n).addEOL()}addList(e,t=!1){const r=t?"ol":"ul",n=e.map((e=>this.wrap("li",e))).join(""),o=this.wrap(r,n);return this.addRaw(o).addEOL()}addTable(e){const t=e.map((e=>{const t=e.map((e=>{if("string"==typeof e)return this.wrap("td",e);const{header:t,data:r,colspan:n,rowspan:o}=e,i=t?"th":"td",s=Object.assign(Object.assign({},n&&{colspan:n}),o&&{rowspan:o});return this.wrap(i,r,s)})).join("");return this.wrap("tr",t)})).join(""),r=this.wrap("table",t);return this.addRaw(r).addEOL()}addDetails(e,t){const r=this.wrap("details",this.wrap("summary",e)+t);return this.addRaw(r).addEOL()}addImage(e,t,r){const{width:n,height:o}=r||{},i=Object.assign(Object.assign({},n&&{width:n}),o&&{height:o}),s=this.wrap("img",null,Object.assign({src:e,alt:t},i));return this.addRaw(s).addEOL()}addHeading(e,t){const r="h"+t,n=this.wrap(["h1","h2","h3","h4","h5","h6"].includes(r)?r:"h1",e);return this.addRaw(n).addEOL()}addSeparator(){const e=this.wrap("hr",null);return this.addRaw(e).addEOL()}addBreak(){const e=this.wrap("br",null);return this.addRaw(e).addEOL()}addQuote(e,t){const r=Object.assign({},t&&{cite:t}),n=this.wrap("blockquote",e,r);return this.addRaw(n).addEOL()}addLink(e,t){const r=this.wrap("a",e,{href:t});return this.addRaw(r).addEOL()}};e.markdownSummary=a,e.summary=a}(co)),co}function m(){return ro||(ro=1,function(e){function t(e,t){const r=process.env["INPUT_"+e.replace(/ /g,"_").toUpperCase()]||"";if(t&&t.required&&!r)throw Error("Input required and not supplied: "+e);return t&&!1===t.trimWhitespace?r:r.trim()}function r(e,t={}){l.issueCommand("error",p.toCommandProperties(t),e instanceof Error?""+e:e)}function n(e){l.issue("group",e)}function o(){l.issue("endgroup")}var i=Kr&&Kr.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=Kr&&Kr.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=Kr&&Kr.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return s(t,e),t},c=Kr&&Kr.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(t){i(t)}}function a(e){try{c(n.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.getIDToken=e.getState=e.saveState=e.group=e.endGroup=e.startGroup=e.info=e.notice=e.warning=e.error=e.debug=e.isDebug=e.setFailed=e.setCommandEcho=e.setOutput=e.getBooleanInput=e.getMultilineInput=e.getInput=e.addPath=e.setSecret=e.exportVariable=e.ExitCode=void 0;const l=Zr,u=cn,p=en,f=a(Tr),d=a(Ar),v=function(){if(Jn)return xn;Jn=1;var e=Kr&&Kr.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(t){i(t)}}function a(e){try{c(n.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(xn,"__esModule",{value:!0}),xn.OidcClient=void 0;const t=Yn,n=Qn,o=m();class i{static createHttpClient(e=!0,r=10){const o={allowRetries:e,maxRetries:r};return new t.HttpClient("actions/oidc-client",[new n.BearerCredentialHandler(i.getRequestToken())],o)}static getRequestToken(){const e=process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN;if(!e)throw Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable");return e}static getIDTokenUrl(){const e=process.env.ACTIONS_ID_TOKEN_REQUEST_URL;if(!e)throw Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable");return e}static getCall(t){var r;return e(this,void 0,void 0,(function*(){const e=i.createHttpClient(),n=yield e.getJson(t).catch((e=>{throw Error(`Failed to get ID Token. \n \n Error Code : ${e.statusCode}\n \n Error Message: ${e.message}`)})),o=null===(r=n.result)||void 0===r?void 0:r.value;if(!o)throw Error("Response json body do not have ID Token field");return o}))}static getIDToken(t){return e(this,void 0,void 0,(function*(){try{let e=i.getIDTokenUrl();t&&(e=`${e}&audience=${encodeURIComponent(t)}`),o.debug("ID token url is "+e);const r=yield i.getCall(e);return o.setSecret(r),r}catch(r){throw Error("Error message: "+r.message)}}))}}return xn.OidcClient=i,xn}();var y,g;(g=y=e.ExitCode||(e.ExitCode={}))[g.Success=0]="Success",g[g.Failure=1]="Failure",e.exportVariable=function(e,t){const r=p.toCommandValue(t);if(process.env[e]=r,process.env.GITHUB_ENV)return u.issueFileCommand("ENV",u.prepareKeyValueMessage(e,t));l.issueCommand("set-env",{name:e},r)},e.setSecret=function(e){l.issueCommand("add-mask",{},e)},e.addPath=function(e){process.env.GITHUB_PATH?u.issueFileCommand("PATH",e):l.issueCommand("add-path",{},e),process.env.PATH=`${e}${d.delimiter}${process.env.PATH}`},e.getInput=t,e.getMultilineInput=function(e,r){const n=t(e,r).split("\n").filter((e=>""!==e));return r&&!1===r.trimWhitespace?n:n.map((e=>e.trim()))},e.getBooleanInput=function(e,r){const n=t(e,r);if(["true","True","TRUE"].includes(n))return!0;if(["false","False","FALSE"].includes(n))return!1;throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${e}\nSupport boolean input list: \`true | True | TRUE | false | False | FALSE\``)},e.setOutput=function(e,t){if(process.env.GITHUB_OUTPUT)return u.issueFileCommand("OUTPUT",u.prepareKeyValueMessage(e,t));process.stdout.write(f.EOL),l.issueCommand("set-output",{name:e},p.toCommandValue(t))},e.setCommandEcho=function(e){l.issue("echo",e?"on":"off")},e.setFailed=function(e){process.exitCode=y.Failure,r(e)},e.isDebug=function(){return"1"===process.env.RUNNER_DEBUG},e.debug=function(e){l.issueCommand("debug",{},e)},e.error=r,e.warning=function(e,t={}){l.issueCommand("warning",p.toCommandProperties(t),e instanceof Error?""+e:e)},e.notice=function(e,t={}){l.issueCommand("notice",p.toCommandProperties(t),e instanceof Error?""+e:e)},e.info=function(e){process.stdout.write(e+f.EOL)},e.startGroup=n,e.endGroup=o,e.group=function(e,t){return c(this,void 0,void 0,(function*(){let r;n(e);try{r=yield t()}finally{o()}return r}))},e.saveState=function(e,t){if(process.env.GITHUB_STATE)return u.issueFileCommand("STATE",u.prepareKeyValueMessage(e,t));l.issueCommand("save-state",{name:e},p.toCommandValue(t))},e.getState=function(e){return process.env["STATE_"+e]||""},e.getIDToken=function(e){return c(this,void 0,void 0,(function*(){return yield v.OidcClient.getIDToken(e)}))};var w=h();Object.defineProperty(e,"summary",{enumerable:!0,get:function(){return w.summary}});var _=h();Object.defineProperty(e,"markdownSummary",{enumerable:!0,get:function(){return _.markdownSummary}});var E=function(){if(to)return lo;to=1;var e=Kr&&Kr.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),t=Kr&&Kr.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Kr&&Kr.__importStar||function(r){if(r&&r.__esModule)return r;var n={};if(null!=r)for(var o in r)"default"!==o&&Object.hasOwnProperty.call(r,o)&&e(n,r,o);return t(n,r),n};Object.defineProperty(lo,"__esModule",{value:!0}),lo.toPlatformPath=lo.toWin32Path=lo.toPosixPath=void 0;const n=r(Ar);return lo.toPosixPath=function(e){return e.replace(/[\\]/g,"/")},lo.toWin32Path=function(e){return e.replace(/[/]/g,"\\")},lo.toPlatformPath=function(e){return e.replace(/[/\\]/g,n.sep)},lo}();Object.defineProperty(e,"toPosixPath",{enumerable:!0,get:function(){return E.toPosixPath}}),Object.defineProperty(e,"toWin32Path",{enumerable:!0,get:function(){return E.toWin32Path}}),Object.defineProperty(e,"toPlatformPath",{enumerable:!0,get:function(){return E.toPlatformPath}})}(Qr)),Qr}function v(e){return Yr.GITHUB_ACTIONS?uo.error(e):console.log(`${e}`)}function y(e){return Yr.GITHUB_ACTIONS?uo.warning(e):console.log(`${e}`)}function g(e){return Yr.GITHUB_ACTIONS?uo.notice(e):console.log(`${e}`)}function w(e){return Yr.GITHUB_ACTIONS?uo.info(e):console.log(e)}function _(e,t,r){if("function"==typeof t&&(r=t,t={}),!r){if("function"!=typeof Promise)throw new TypeError("callback not provided");return new Promise((function(r,n){_(e,t||{},(function(e,t){e?n(e):r(t)}))}))}ao(e,t||{},(function(e,n){e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,n=!1),r(e,n)}))}function E(e,t){const r=e.options.env||process.env,n=process.cwd(),o=null!=e.options.cwd,i=o&&void 0!==process.chdir&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd)}catch(a){}let s;try{s=So.sync(e.command,{path:r[Io({env:r})],pathExt:t?Ro.delimiter:void 0})}catch(c){}finally{i&&process.chdir(n)}return s&&(s=Ro.resolve(o?e.options.cwd:"",s)),s}function b(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function O(e,t){return Uo&&1===e&&!t.file?b(t.original,"spawn"):null}function R(e,t,r){const n=Mo(e,t,r),o=Fo.spawn(n.command,n.args,n.options);return Go.hookChildProcess(o,n),o}function S(e={}){const{env:t=process.env,platform:r=process.platform}=e;return"win32"!==r?"PATH":Object.keys(t).reverse().find((e=>"PATH"===e.toUpperCase()))||"Path"}function I(e){return null!==e&&"object"==typeof e&&"function"==typeof e.pipe}function T(e){return I(e)&&!1!==e.writable&&"function"==typeof e._write&&"object"==typeof e._writableState}async function x(e,t){if(!e)throw Error("Expected a stream");t={maxBuffer:1/0,...t};const{maxBuffer:r}=t,n=Mi(t);return await new Promise(((t,o)=>{const i=e=>{e&&n.getBufferedLength()<=ji.MAX_LENGTH&&(e.bufferedData=n.getBufferedValue()),o(e)};(async()=>{try{await Gi(e,n),t()}catch(r){i(r)}})(),n.on("data",(()=>{n.getBufferedLength()>r&&i(new Bi)}))})),n.getBufferedValue()}function P(e,t,r){const n=cs(e,t,r),o=ts(e,t),i=rs(e,t);let s;as(i,n.options),(({timeout:e})=>{if(void 0!==e&&(!Number.isFinite(e)||0>e))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)})(n.options);try{s=Ur.spawn(n.file,n.args,n.options)}catch(p){const e=new Ur.ChildProcess,t=Promise.reject(ii({error:p,stdout:"",stderr:"",all:"",command:o,escapedCommand:i,parsed:n,timedOut:!1,isCanceled:!1,killed:!1}));return Ji(e,t),e}const a=(e=>new Promise(((t,r)=>{e.on("exit",((e,r)=>{t({exitCode:e,signal:r})})),e.on("error",(e=>{r(e)})),e.stdin&&e.stdin.on("error",(e=>{r(e)}))})))(s),c=((e,{timeout:t,killSignal:r="SIGTERM"},n)=>{if(0===t||void 0===t)return n;let o;const i=new Promise(((n,i)=>{o=setTimeout((()=>{((e,t,r)=>{e.kill(t),r(Object.assign(Error("Timed out"),{timedOut:!0,signal:t}))})(e,r,i)}),t)})),s=n.finally((()=>{clearTimeout(o)}));return Promise.race([i,s])})(s,n.options,a),l=(async(e,{cleanup:t,detached:r},n)=>{if(!t||r)return n;const o=Ti((()=>{e.kill()}));return n.finally((()=>{o()}))})(s,n.options,c);s.kill=xi.bind(null,s.kill.bind(s)),s.cancel=Ci.bind(null,s,{isCanceled:!1});const u=Yo((async()=>{const[{error:e,exitCode:t,signal:r,timedOut:a},c,u,p]=await(async({stdout:t,stderr:r,all:n},{encoding:o,buffer:i,maxBuffer:s},a)=>{const c=Wi(t,{encoding:o,buffer:i,maxBuffer:s}),l=Wi(r,{encoding:o,buffer:i,maxBuffer:s}),u=Wi(n,{encoding:o,buffer:i,maxBuffer:2*s});try{return await Promise.all([a,c,l,u])}catch(e){return Promise.all([{error:e,signal:e.signal,timedOut:e.timedOut},Xi(t,c),Xi(r,l),Xi(n,u)])}})(s,n.options,l),f=ls(n.options,c),d=ls(n.options,u),h=ls(n.options,p);if(e||0!==t||null!==r){const c=ii({error:e,exitCode:t,signal:r,stdout:f,stderr:d,all:h,command:o,escapedCommand:i,parsed:n,timedOut:a,isCanceled:!!n.options.signal&&n.options.signal.aborted,killed:s.killed});if(!n.options.reject)return c;throw c}return{command:o,escapedCommand:i,exitCode:0,stdout:f,stderr:d,all:h,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}));return((e,t)=>{const r=(({input:e,inputFile:t})=>"string"!=typeof t?e:(zi(e),xr.createReadStream(t)))(t);void 0!==r&&(I(r)?r.pipe(e.stdin):e.stdin.end(r))})(s,n.options),s.all=((e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;const r=Vi();return e.stdout&&r.add(e.stdout),e.stderr&&r.add(e.stderr),r})(s,n.options),(e=>{null!==e.stdout&&(e.pipeStdout=Li.bind(void 0,e,"stdout")),null!==e.stderr&&(e.pipeStderr=Li.bind(void 0,e,"stderr")),void 0!==e.all&&(e.pipeAll=Li.bind(void 0,e,"all"))})(s),Ji(s,u),s}function A(e,t,r){const n=cs(e,t,r),o=ts(e,t),i=rs(e,t);as(i,n.options);const s=(e=>{const t=(({input:e,inputFile:t})=>"string"!=typeof t?e:(zi(e),xr.readFileSync(t)))(e);if(I(t))throw new TypeError("The `input` option cannot be a stream in sync mode");return t})(n.options);let a;try{a=Ur.spawnSync(n.file,n.args,{...n.options,input:s})}catch(u){throw ii({error:u,stdout:"",stderr:"",all:"",command:o,escapedCommand:i,parsed:n,timedOut:!1,isCanceled:!1,killed:!1})}const c=ls(n.options,a.stdout,a.error),l=ls(n.options,a.stderr,a.error);if(a.error||0!==a.status||null!==a.signal){const e=ii({stdout:c,stderr:l,error:a.error,signal:a.signal,exitCode:a.status,command:o,escapedCommand:i,parsed:n,timedOut:a.error&&"ETIMEDOUT"===a.error.code,isCanceled:!1,killed:null!==a.signal});if(!n.options.reject)return e;throw e}return{command:o,escapedCommand:i,exitCode:0,stdout:c,stderr:l,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}function N(e,t=["-NoProfile","-NoLogo","-NonInteractive"],r={stdio:"inherit"}){return P(function(){if(void 0===la){const e=ca.sync("pwsh",{nothrow:!0});null!==e&&(la=e);const t=ca.sync("powershell",{nothrow:!0});null!==t&&(la=t)}if(void 0===la)throw Error("Could not find powershell");return la}(),[...t,"-c",e],r)}function $(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}function C(){return null!==ca.sync("sudo",{nothrow:!0})}function L(){var e;return 0===(null==(e=process.getuid)?void 0:e.call(process))||!!process.env.CI}function k(){return L()&&C()}function D(e){return k()?"sudo "+e:e}function j(e,t=[],r=fa){return k()?function(e,t){const[r,...n]=os(e);return A(r,n,t)}(F(e,t),r):A(e,M(t),r)}function U(e,t=[],r=fa){return k()?function(e,t){const[r,...n]=os(e);return P(r,n,t)}(F(e,t),r):P(e,M(t),r)}function F(e,t){return"sudo "+M([e,...t]).join(" ")}function M(e){return e.map((e=>`'${e}'`))}function G(){return"win32"===process.platform?da():L()}async function B(e){if(("linux"===process.platform||"darwin"===process.platform)&&k()&&void 0!==process.env.SUDO_USER){let t=xr.statSync(e).isDirectory();await U("chown",[...t?["-R"]:[],process.env.SUDO_USER,e],fa)}}function H(){if(oc)return nc;oc=1;var e=Ha,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,o=Object.getOwnPropertySymbols;return nc=function(i,s){var a,c=Object(e(s));if(i=Object(e(i)),n(c).forEach((function(e){try{t(i,e,r(s,e))}catch(n){a=n}})),"function"==typeof o&&o(c).forEach((function(e){try{t(i,e,r(s,e))}catch(n){a=n}})),void 0!==a)throw a;return i}}function q(){return Dc?kc:(Dc=1,kc=($c?Nc:($c=1,Nc=function(){return"object"==typeof globalThis&&!!globalThis&&globalThis.Array===Array}))()?globalThis:function(){if(Lc)return Cc;Lc=1;var e=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw Error("Unable to resolve global `this`")};return Cc=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(t){return e()}try{return __global__||e()}finally{delete Object.prototype.__global__}}()}())}function V(){if(Bc)return Gc;Bc=1;var e=Mc?Fc:(Mc=1,Fc=function(e){return!!e&&("symbol"==typeof e||!!e.constructor&&"Symbol"===e.constructor.name&&"Symbol"===e[e.constructor.toStringTag])});return Gc=function(t){if(!e(t))throw new TypeError(t+" is not a symbol");return t}}function z(){return Qc?Jc:(Qc=1,Jc=function(){if(Uc)return jc;Uc=1;var e=q(),t={object:!0,symbol:!0};return jc=function(){var r=e.Symbol;return"function"==typeof r&&(r("test symbol"),!!t[typeof r.iterator]&&!!t[typeof r.toPrimitive]&&!!t[typeof r.toStringTag])}}()()?q().Symbol:function(){if(Yc)return Kc;Yc=1;var e,t,r,n=Tc,o=V(),i=q().Symbol,s=function(){if(qc)return Hc;qc=1;var e=Tc,t=Object.defineProperty,r=Object.prototype,n=(0,Object.create)(null);return Hc=function(o){for(var i,s,a=0;n[o+(a||"")];)++a;return n[o+=a||""]=!0,t(r,i="@@"+o,e.gs(null,(function(r){s||(s=!0,t(this,i,e(r)),s=!1)}))),i}}(),a=function(){if(zc)return Vc;zc=1;var e=Tc,t=q().Symbol;return Vc=function(r){return Object.defineProperties(r,{hasInstance:e("",t&&t.hasInstance||r("hasInstance")),isConcatSpreadable:e("",t&&t.isConcatSpreadable||r("isConcatSpreadable")),iterator:e("",t&&t.iterator||r("iterator")),match:e("",t&&t.match||r("match")),replace:e("",t&&t.replace||r("replace")),search:e("",t&&t.search||r("search")),species:e("",t&&t.species||r("species")),split:e("",t&&t.split||r("split")),toPrimitive:e("",t&&t.toPrimitive||r("toPrimitive")),toStringTag:e("",t&&t.toStringTag||r("toStringTag")),unscopables:e("",t&&t.unscopables||r("unscopables"))})}}(),c=function(){if(Wc)return Xc;Wc=1;var e=Tc,t=V(),r=Object.create(null);return Xc=function(n){return Object.defineProperties(n,{for:e((function(e){return r[e]?r[e]:r[e]=n(e+"")})),keyFor:e((function(e){var n;for(n in t(e),r)if(r[n]===e)return n}))})}}(),l=Object.create,u=Object.defineProperties,p=Object.defineProperty;if("function"==typeof i)try{i(),r=!0}catch(f){}else i=null;return t=function(r){if(this instanceof t)throw new TypeError("Symbol is not a constructor");return e(r)},Kc=e=function e(o){var a;if(this instanceof e)throw new TypeError("Symbol is not a constructor");return r?i(o):(a=l(t.prototype),u(a,{__description__:n("",o=void 0===o?"":o+""),__name__:n("",s(o))}))},a(e),c(e),u(t.prototype,{constructor:n(e),toString:n("",(function(){return this.__name__}))}),u(e.prototype,{toString:n((function(){return"Symbol ("+o(this).__description__+")"})),valueOf:n((function(){return o(this)}))}),p(e.prototype,e.toPrimitive,n("",(function(){var e=o(this);return"symbol"==typeof e?e:""+e}))),p(e.prototype,e.toStringTag,n("c","Symbol")),p(t.prototype,e.toStringTag,n("c",e.prototype[e.toStringTag])),p(t.prototype,e.toPrimitive,n("c",e.prototype[e.toPrimitive])),Kc}())}function X(){return cl?al:(cl=1,al=(Ac?Pc:(Ac=1,Pc=function(){var e,t,r=Array.from;return"function"==typeof r&&!(!(t=r(e=["raz","dwa"]))||t===e||"dwa"!==t[1])}))()?Array.from:function(){if(sl)return il;sl=1;var e=z().iterator,t=function(){if(el)return Zc;el=1;var e={}.toString,t=e.call(function(){return arguments}());return Zc=function(r){return e.call(r)===t}}(),r=function(){if(rl)return tl;rl=1;var e={}.toString,t=/t/.test.bind(/^[object [A-Za-z0-9]*Function]$/);return tl=function(r){return"function"==typeof r&&t(e.call(r))}}(),n=Ua,o=Ga,i=Ha,s=Pa,a=function(){if(ol)return nl;ol=1;var e={}.toString,t=e.call("");return nl=function(r){return"string"==typeof r||r&&"object"==typeof r&&(r instanceof String||e.call(r)===t)||!1}}(),c=Array.isArray,l=function(){}.call,u={configurable:!0,enumerable:!0,writable:!0,value:null},p=Object.defineProperty;return il=function(f){var d,h,m,v,y,g,w,_,E,b,O=arguments[1],R=arguments[2];if(f=Object(i(f)),s(O)&&o(O),this&&this!==Array&&r(this))d=this;else{if(!O){if(t(f))return 1!==(y=f.length)?Array.apply(null,f):((v=[,])[0]=f[0],v);if(c(f)){for(v=Array(y=f.length),h=0;y>h;++h)v[h]=f[h];return v}}v=[]}if(!c(f))if(void 0!==(E=f[e])){for(w=o(E).call(f),d&&(v=new d),_=w.next(),h=0;!_.done;)b=O?l.call(O,R,_.value,h):_.value,d?(u.value=b,p(v,h,u)):v[h]=b,_=w.next(),++h;y=h}else if(a(f)){for(y=f.length,d&&(v=new d),h=0,m=0;y>h;++h)b=f[h],y>h+1&&(55296>(g=b.charCodeAt(0))||g>56319||(b+=f[++h])),b=O?l.call(O,R,b,m):b,d?(u.value=b,p(v,m,u)):v[m]=b,++m;y=m}if(void 0===y)for(y=n(f.length),d&&(v=new d(y)),h=0;y>h;++h)b=O?l.call(O,R,f[h],h):f[h],d?(u.value=b,p(v,h,u)):v[h]=b;return d&&(u.value=null,v.length=y),v},il}())}function W(){if(Tl)return Il;Tl=1;var e=Sl?Rl:(Sl=1,Rl=(El?_l:(El=1,_l=function(){var e=Number.isNaN;return"function"==typeof e&&!e({})&&e(NaN)&&!e(34)}))()?Number.isNaN:Ol?bl:(Ol=1,bl=function(e){return e!=e})),t=Ua,r=Ha,n=[].indexOf,o={}.hasOwnProperty,i=Math.abs,s=Math.floor;return Il=function(a){var c,l,u;if(!e(a))return n.apply(this,arguments);for(l=t(r(this).length),c=u=isNaN(u=arguments[1])?0:0>u?t(this.length)-s(i(u)):s(u);l>c;++c)if(o.call(this,c)&&e(this[c]))return c;return-1},Il}function K(){if(kl)return Ll;kl=1;var e=Ga,t=Ya,r=function(){}.call;return Ll=function(n,o){var i={},s=arguments[2];return e(o),t(n,(function(e,t,n,a){i[t]=r.call(o,s,e,t,n,a)})),i},Ll}function Y(){if(jl)return Dl;jl=1;var e=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e},t=function(t){var r,n,o=document.createTextNode(""),i=0;return new t((function(){var e;if(r)n&&(r=n.concat(r));else{if(!n)return;r=n}if(n=r,r=null,"function"==typeof n)return e=n,n=null,void e();for(o.data=i=++i%2;n;)e=n.shift(),n.length||(n=null),e()})).observe(o,{characterData:!0}),function(t){e(t),r?"function"==typeof r?r=[r,t]:r.push(t):(r=t,o.data=i=++i%2)}};return Dl=function(){if("object"==typeof process&&process&&"function"==typeof process.nextTick)return process.nextTick;if("function"==typeof queueMicrotask)return function(t){queueMicrotask(e(t))};if("object"==typeof document&&document){if("function"==typeof MutationObserver)return t(MutationObserver);if("function"==typeof WebKitMutationObserver)return t(WebKitMutationObserver)}return"function"==typeof setImmediate?function(t){setImmediate(e(t))}:"function"==typeof setTimeout||"object"==typeof setTimeout?function(t){setTimeout(e(t),0)}:null}()}function J(){return Bl?Gl:(Bl=1,Gl=function(e){return"function"==typeof e})}function Q(){function e(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}return Jl||(Jl=1,xu.exports=e,xu.exports.default=e),xu.exports}function Z(){if(Ql)return Tu;Ql=1;var e=K(),t=function(){if(Ml)return Fl;Ml=1;var e=[].forEach,t=Object.create;return Fl=function(r){var n=t(null);return e.call(arguments,(function(e){n[e]=!0})),n},Fl}(),r=function(){if(zl)return Vl;zl=1;var e=Ha,t=function(){if(ql)return Hl;ql=1;var e=J();return Hl=function(t){try{return t&&e(t.toString)?""+t:t+""}catch(r){throw new TypeError("Passed argument cannot be stringifed")}}}();return Vl=function(r){return t(e(r))}}(),n=function(){if(Yl)return Kl;Yl=1;var e=function(){if(Wl)return Xl;Wl=1;var e=J();return Xl=function(t){try{return t&&e(t.toString)?""+t:t+""}catch(r){return""}}}();return Kl=function(t){var r=e(t);return r.length>100&&(r=r.slice(0,99)+"…"),r.replace(/[\n\r\u2028\u2029]/g,(function(e){return JSON.stringify(e).slice(1,-1)}))}}(),o=Q(),i=Y(),s=Object.create,a=t("then","then:finally","done","done:finally");return Ja.promise=function(t,c){var l=s(null),u=s(null),p=s(null);if(!0===t)t=null;else if(t=r(t),!a[t])throw new TypeError("'"+n(t)+"' is not valid promise mode");c.on("set",(function(e,r,n){var s=!1;if(!o(n))return u[e]=n,void c.emit("setasync",e,1);l[e]=1,p[e]=n;var a=function(t){var r=l[e];if(s)throw Error("Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in 'done:finally' mode)\nConsider to rely on 'then' or 'done' mode instead.");r&&(delete l[e],u[e]=t,c.emit("setasync",e,r))},f=function(){s=!0,l[e]&&(delete l[e],delete p[e],c.delete(e))},d=t;if(d||(d="then"),"then"===d){var h=function(){i(f)};"function"==typeof(n=n.then((function(e){i(a.bind(this,e))}),h)).finally&&n.finally(h)}else if("done"===d){if("function"!=typeof n.done)throw Error("Memoizee error: Retrieved promise does not implement 'done' in 'done' mode");n.done(a,f)}else if("done:finally"===d){if("function"!=typeof n.done)throw Error("Memoizee error: Retrieved promise does not implement 'done' in 'done:finally' mode");if("function"!=typeof n.finally)throw Error("Memoizee error: Retrieved promise does not implement 'finally' in 'done:finally' mode");n.done(a),n.finally(f)}})),c.on("get",(function(e,t,r){var n;if(l[e])++l[e];else{var s=function(){c.emit("getasync",e,t,r)};o(n=p[e])?"function"==typeof n.done?n.done(s):n.then((function(){i(s)})):s()}})),c.on("delete",(function(e){if(delete p[e],l[e])delete l[e];else if(hasOwnProperty.call(u,e)){var t=u[e];delete u[e],c.emit("deleteasync",e,[t])}})),c.on("clear",(function(){var t=u;u=s(null),l=s(null),p=s(null),c.emit("clearasync",e(t,(function(e){return[e]})))}))},Tu}async function ee(e){try{return await xr.promises.access(e),!0}catch{return!1}}function te(e){const t=function(){if(k()&&"string"==typeof process.env.SUDO_USER&&""!==process.env.SUDO_USER)return"darwin"===process.platform?Ar.join("/Users/",process.env.SUDO_USER):Ar.join("/home/",process.env.SUDO_USER);{const e=Tr.homedir();if(""===e)return;return e}}();return void 0===t?e:e.replace(Uu,t)}async function re(e){const t=void 0===e.guard?"\n# Automatically Generated by envosman\n":`\n# Automatically Generated by envosman ${e.guard}\nexport SOURCE_${e.guard.toUpperCase()}RC=0\n`;await ee(e.rcPath)&&((await Mu(e.rcPath,"utf8")).includes(t)||(await Fu(e.rcPath,`\n${t}\n`),w(`Added ${t} to ${e.rcPath}`)))}async function ne(e,t){await ee(t)&&((await Mu(t,"utf-8")).includes(e)||(await Fu(t,e),w(`${e} was added to ${t}`)))}async function oe(e,t,r={}){const n={escapeSpace:!1,overwrite:!0,rcPath:Bu,...r},o=function(e,t=!1){const r=t?Wu(e):e;return ep(r,'"',"\\")}(null!=t?t:"",n.escapeSpace);try{if(Yr.GITHUB_ACTIONS)try{if(!n.overwrite&&void 0!==process.env[e])return void w(`Environment variable ${e} is already defined. Skipping.`);uo.exportVariable(e,o)}catch(i){v(i),await ie(e,o,n)}else await ie(e,o,n)}catch(i){v(`${i}\nFailed to export environment variable ${e}=${o}. You should add it manually.`)}}async function ie(e,t,r){const n=null!=t?t:"";switch(process.platform){case"win32":return r.overwrite||void 0===process.env[e]?(await N(`[Environment]::SetEnvironmentVariable('${e}', '${n}', "User")`),void w(`${e}='${n}' was set in the environment.`)):void w(`Environment variable ${e} is already defined. Skipping.`);case"linux":case"darwin":return await Hu(r),void(r.overwrite?(await tp(r.rcPath,`\nexport ${e}="${n}"\n`),w(`${e}="${n}" was added to "${r.rcPath}`)):(await tp(r.rcPath,`\nif [ -z "\${${e}}" ]; then export ${e}="${n}"; fi\n`),w(`if not defined ${e} then ${e}="${n}" was added to "${r.rcPath}`)))}process.env[e]=n}async function se(e,t={}){const r={rcPath:Bu,...t};if(!function(e){var t,r;return!!np.some((t=>t.test(e)))&&(null!=(r=null==(t=process.env.PATH)?void 0:t.split(Ar.delimiter))?r:[]).includes(e)}(e)){process.env.PATH=`${e}${Ar.delimiter}${process.env.PATH}`;try{if(Yr.GITHUB_ACTIONS)try{uo.addPath(e)}catch(n){v(n),await ae(e,r)}else await ae(e,r)}catch(n){v(`${n}\nFailed to add ${e} to the percistent PATH. You should add it manually.`)}}}async function ae(e,t){switch(process.platform){case"win32":return await N(`$USER_PATH=([Environment]::GetEnvironmentVariable("PATH", "User")); [Environment]::SetEnvironmentVariable("PATH", "${e};$USER_PATH", "User")`),void w(`"${e}" was added to the PATH.`);case"linux":case"darwin":return await Hu(t),await rp(t.rcPath,`\nexport PATH="${e}:$PATH"\n`),void w(`"${e}" was added to "${t.rcPath}"`);default:return}}function ce(e){throw Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}function le(e){Array.isArray(e)||(e=[e]);for(const t of e){const{id:e,data:r}=t;hp[e]=r}}function ue(e,t,r){const n=function(e){const t=hp[e.locale];let r=e.unitTypeLookupOrder.slice();r.unshift(e.unitType),r=Array.from(new Set(r));let n=null;if(r.some((function(e){if(void 0!==t[e])return n=t[e],!0})),null===n)throw Error("Can not find any unit type data for locale: "+e.locale);return n}(r);return up.pluralize(r.locale,t,n[e]).replace("{0}",t)}function pe(){if($f)return Nf;$f=1;const e=/\s+/g;class t{constructor(r,i){if(i=n(i),r instanceof t)return r.loose===!!i.loose&&r.includePrerelease===!!i.includePrerelease?r:new t(r.raw,i);if(r instanceof o)return this.raw=r.value,this.set=[[r]],this.formatted=void 0,this;if(this.options=i,this.loose=!!i.loose,this.includePrerelease=!!i.includePrerelease,this.raw=r.trim().replace(e," "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!h(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const t of this.set)if(1===t.length&&m(t[0])){this.set=[t];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;this.set.length>e;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;t.length>e;e++)e>0&&(this.formatted+=" "),this.formatted+=(""+t[e]).trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&f)|(this.options.loose&&d))+":"+e,n=r.get(t);if(n)return n;const s=this.options.loose;e=e.replace(s?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE],T(this.options.includePrerelease)),i("hyphen replace",e),e=e.replace(a[c.COMPARATORTRIM],l),i("comparator trim",e),e=e.replace(a[c.TILDETRIM],u),i("tilde trim",e),e=e.replace(a[c.CARETTRIM],p),i("caret trim",e);let m=e.split(" ").map((e=>y(e,this.options))).join(" ").split(/\s+/).map((e=>I(e,this.options)));s&&(m=m.filter((e=>(i("loose invalid filter",e,this.options),!!e.match(a[c.COMPARATORLOOSE]))))),i("range list",m);const v=new Map,g=m.map((e=>new o(e,this.options)));for(const r of g){if(h(r))return[r];v.set(r.value,r)}v.size>1&&v.has("")&&v.delete("");const w=[...v.values()];return r.set(t,w),w}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some((t=>v(t,r)&&e.set.some((e=>v(e,r)&&t.every((t=>e.every((e=>t.intersects(e,r)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new s(e,this.options)}catch(t){return!1}for(let r=0;this.set.length>r;r++)if(x(this.set[r],e,this.options))return!0;return!1}}Nf=t;const r=new kf,n=Op,o=fe(),i=wp,s=Lp,{safeRe:a,t:c,comparatorTrimReplace:l,tildeTrimReplace:u,caretTrimReplace:p}=_p,{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:d}=gp,h=e=>"<0.0.0-0"===e.value,m=e=>""===e.value,v=(e,t)=>{let r=!0;const n=e.slice();let o=n.pop();for(;r&&n.length;)r=n.every((e=>o.intersects(e,t))),o=n.pop();return r},y=(e,t)=>(i("comp",e,t),e=E(e,t),i("caret",e),e=w(e,t),i("tildes",e),e=O(e,t),i("xrange",e),e=S(e,t),i("stars",e),e),g=e=>!e||"x"===e.toLowerCase()||"*"===e,w=(e,t)=>e.trim().split(/\s+/).map((e=>_(e,t))).join(" "),_=(e,t)=>e.replace(t.loose?a[c.TILDELOOSE]:a[c.TILDE],((t,r,n,o,s)=>{let a;return i("tilde",e,t,r,n,o,s),g(r)?a="":g(n)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:g(o)?a=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:s?(i("replaceTilde pr",s),a=`>=${r}.${n}.${o}-${s} <${r}.${+n+1}.0-0`):a=`>=${r}.${n}.${o} <${r}.${+n+1}.0-0`,i("tilde return",a),a})),E=(e,t)=>e.trim().split(/\s+/).map((e=>b(e,t))).join(" "),b=(e,t)=>{i("caret",e,t);const r=t.includePrerelease?"-0":"";return e.replace(t.loose?a[c.CARETLOOSE]:a[c.CARET],((t,n,o,s,a)=>{let c;return i("caret",e,t,n,o,s,a),g(n)?c="":g(o)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:g(s)?c="0"===n?`>=${n}.${o}.0${r} <${n}.${+o+1}.0-0`:`>=${n}.${o}.0${r} <${+n+1}.0.0-0`:a?(i("replaceCaret pr",a),c="0"===n?"0"===o?`>=${n}.${o}.${s}-${a} <${n}.${o}.${+s+1}-0`:`>=${n}.${o}.${s}-${a} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${s}-${a} <${+n+1}.0.0-0`):(i("no pr"),c="0"===n?"0"===o?`>=${n}.${o}.${s}${r} <${n}.${o}.${+s+1}-0`:`>=${n}.${o}.${s}${r} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${s} <${+n+1}.0.0-0`),i("caret return",c),c}))},O=(e,t)=>(i("replaceXRanges",e,t),e.split(/\s+/).map((e=>R(e,t))).join(" ")),R=(e,t)=>(e=e.trim()).replace(t.loose?a[c.XRANGELOOSE]:a[c.XRANGE],((r,n,o,s,a,c)=>{i("xRange",e,r,n,o,s,a,c);const l=g(o),u=l||g(s),p=u||g(a);return"="===n&&p&&(n=""),c=t.includePrerelease?"-0":"",l?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&p?(u&&(s=0),a=0,">"===n?(n=">=",u?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):"<="===n&&(n="<",u?o=+o+1:s=+s+1),"<"===n&&(c="-0"),r=`${n+o}.${s}.${a}${c}`):u?r=`>=${o}.0.0${c} <${+o+1}.0.0-0`:p&&(r=`>=${o}.${s}.0${c} <${o}.${+s+1}.0-0`),i("xRange return",r),r})),S=(e,t)=>(i("replaceStars",e,t),e.trim().replace(a[c.STAR],"")),I=(e,t)=>(i("replaceGTE0",e,t),e.trim().replace(a[t.includePrerelease?c.GTE0PRE:c.GTE0],"")),T=e=>(t,r,n,o,i,s,a,c,l,u,p,f)=>`${r=g(n)?"":g(o)?`>=${n}.0.0${e?"-0":""}`:g(i)?`>=${n}.${o}.0${e?"-0":""}`:s?">="+r:`>=${r}${e?"-0":""}`} ${c=g(l)?"":g(u)?`<${+l+1}.0.0-0`:g(p)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${p}-${f}`:e?`<${l}.${u}.${+p+1}-0`:"<="+c}`.trim(),x=(e,t,r)=>{for(let n=0;e.length>n;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;e.length>r;r++)if(i(e[r].semver),e[r].semver!==o.ANY&&e[r].semver.prerelease.length>0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0};return Nf}function fe(){if(Lf)return Cf;Lf=1;const e=Symbol();class t{static get ANY(){return e}constructor(n,o){if(o=r(o),n instanceof t){if(n.loose===!!o.loose)return n;n=n.value}n=n.trim().split(/\s+/).join(" "),s("comparator",n,o),this.options=o,this.loose=!!o.loose,this.parse(n),this.value=this.semver===e?"":this.operator+this.semver.version,s("comp",this)}parse(t){const r=t.match(this.options.loose?n[o.COMPARATORLOOSE]:n[o.COMPARATOR]);if(!r)throw new TypeError("Invalid comparator: "+t);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),this.semver=r[2]?new a(r[2],this.options.loose):e}toString(){return this.value}test(t){if(s("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"==typeof t)try{t=new a(t,this.options)}catch(r){return!1}return i(t,this.operator,this.semver,this.options)}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new c(e.value,n).test(this.value):""===e.operator?""===e.value||new c(this.value,n).test(e.semver):!((n=r(n)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(i(this.semver,"<",e.semver,n)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(i(this.semver,">",e.semver,n)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}Cf=t;const r=Op,{safeRe:n,t:o}=_p,i=Rf,s=wp,a=Lp,c=pe();return Cf}function de(e,t,r,n){return new(r||(r=Promise))((function(t,o){function i(e){try{a(n.next(e))}catch(t){o(t)}}function s(e){try{a(n.throw(e))}catch(t){o(t)}}function a(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(i,s)}a((n=n.call(e)).next())}))}function he(e,t){function r(r){return function(c){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,r[0]&&(a=0)),a;)try{if(n=1,o&&(i=2&r[0]?o.return:r[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,r[1])).done)return i;switch(o=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,o=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&i[3]>r[1])){a.label=r[1];break}if(6===r[0]&&i[1]>a.label){a.label=i[1],i=r;break}if(i&&i[2]>a.label){a.label=i[2],a.ops.push(r);break}i[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(c){r=[6,c],o=0}finally{n=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,c])}}var n,o,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s}function me(e){return null==e?[]:Array.isArray(e)?e:[e]}function ve(e,t,r,n){var o,i=e[t],s=~n.string.indexOf(t)?null==r||!0===r?"":r+"":"boolean"==typeof r?r:~n.boolean.indexOf(t)?"false"!==r&&("true"===r||(e._.push(0*(o=+r)==0?o:r),!!r)):0*(o=+r)==0?o:r;e[t]=null==i?s:Array.isArray(i)?i.concat(s):[i,s]}async function ye(e,t,r,n=40){Yr.GITHUB_ACTIONS?await async function(e,t,r=40){await U("update-alternatives",["--install","/usr/bin/"+e,e,t,""+r])}(e,t,n):(await Hu(r),await Hd(r.rcPath,`\nif [ $UID -eq 0 ]; then update-alternatives --install /usr/bin/${e} ${e} ${t} ${n}; fi\n`))}function ge(e){const t={...process.env,DEBIAN_FRONTEND:"noninteractive"};return"nala"===e&&(void 0===t.LANG&&(t.LANG="C.UTF-8"),void 0===t.LC_ALL&&(t.LC_ALL="C.UTF-8")),t}function we(){return null!==ca.sync("nala",{nothrow:!0})}function _e(){let e;return e=we()?"nala":"apt-get",e}function Ee(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}async function be(e){try{const{stdout:t}=await P("dpkg",["-s",e],{env:ge("apt-get"),stdio:"pipe"});return"string"==typeof t&&t.split("\n").some((e=>e.startsWith("Status: install ok installed")))}catch{return!1}}async function Oe(e,t=_e()){return(await Promise.all(e.map((e=>Re(e,t))))).filter((e=>void 0!==e))}async function Re(e,t=_e()){const r=await async function(e,t,r){switch(await Se(e,t,r)){case Xd.NameDashVersion:return`${t}-${r}`;case Xd.NameEqualsVersion:return`${t}=${r}`;case Xd.Name:return void 0!==r&&""!==r&&y(`Could not find package ${t} with version ${r}. Installing the latest version.`),t;default:throw Error(`Could not find package ${t} ${null!=r?r:""}`)}}(t,e.name,e.version);return await be(r)?void 0:r}async function Se(e,t,r){if(void 0!==r&&""!==r){const{stdout:n}=await P("apt-cache",["search","--names-only",`^${Ee(t)}-${Ee(r)}$`],{env:ge(e),stdio:"pipe"});if(""!==n.trim())return Xd.NameDashVersion;try{const{stdout:n}=await P("apt-cache",["show",`${t}=${r}`],{env:ge(e)});if(""===n.trim())return Xd.NameEqualsVersion}catch{}}try{const{stdout:r}=await P("apt-cache",["show",t],{env:ge(e),stdio:"pipe"});if(""!==r.trim())return Xd.Name}catch{}return Vd?Xd.None:(zd(e),Se(e,t,r))}async function Ie(e,t=!1){try{const n=_e();for(const{name:t,version:r}of e)w(`Installing ${t} ${null!=r?r:""} via ${n}`);t&&zd(n),await async function(e,t){const r=[...new Set(t.flatMap((e=>{var t;return null!=(t=e.repository)?t:[]})))];await Promise.all(r.map((t=>async function(e,t=_e()){await Kd(t),await async function(e){await be("software-properties-common")||j(e,["install","-y","--fix-broken","-o",qd,"software-properties-common"],{...fa,env:ge(e)})}(t),j("add-apt-repository",["-y","--no-update",e],{...fa,env:ge(t)}),zd.clear(),zd(t)}(t,e))))}(n,e);const o=await Oe(e,n);if(0===o.length)return w("All packages are already installed"),{binDir:"/usr/bin/"};await Kd(n);try{await async function(e){await Promise.all(e.map((async e=>{var t;void 0!==e.key&&await(t=e.key,"keyUrl"in t?Te(t):async function({key:e,keyServer:t=Qd,fileName:r,keyStorePath:n=Qd}){try{Pe(r);const o=Ar.join(n,r);return await ee(o)||(xe(),await U("gpg",["--no-default-keyring","--keyring","gnupg-ring:"+o,"--keyserver",t,"--recv-keys",e]),await U("chmod",["644",o])),o}catch(o){return void y(`Failed to add apt key via server ${t}: ${o}`)}}(t))})))}(e),j(n,["install","--fix-broken","-y",...o],{...fa,env:ge(n)})}catch(r){if(!function(e){return"string"==typeof e.stderr}(r))throw r;Yd.some((e=>"string"==typeof r.stderr&&r.stderr.includes(e)))&&(y(`Failed to install packages ${o}. Retrying...`),j(n,["install","--fix-broken","-y","-o",qd,...o],{...fa,env:ge(n)}))}return{binDir:"/usr/bin/"}}catch(r){throw Error("Failed to install apt packages: "+(r instanceof Error?`${r.message}\n${r.stack}`:r+""))}}async function Te({keyUrl:e,fileName:t,keyStorePath:r=Jd}){try{Pe(t);const n=Ar.join(r,t);if(!(await ee(n))){xe(),await Ie([{name:"ca-certificates"}]);const r=Ar.join(Tr.tmpdir(),t),o=new Bd.DownloaderHelper(e,Tr.tmpdir(),{fileName:t});o.on("error",(t=>{throw Error(`Failed to download ${e}: ${t}`)})),await o.start(),j("gpg",["--no-default-keyring","--keyring","gnupg-ring:"+n,"--import",r]),j("chmod",["644",n])}return n}catch(n){return void y(`Failed to add apt key via download ${e}: ${n}`)}}function xe(){j("gpg",["-k"])}function Pe(e){if(!e.endsWith(".gpg"))throw Error("Key file name must end with .gpg: "+e)}async function Ae(e={}){if(!["darwin","linux"].includes(process.platform))return;if("string"==typeof Zd)return{binDir:Zd};const t=await ca("brew",{nothrow:!0});if(null!==t)return Zd=Ar.dirname(t),{binDir:Zd};await Ie([{name:"ca-certificates"}]);const r=new Bd.DownloaderHelper("https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh",Tr.tmpdir(),{fileName:"install-brew.sh"});return r.on("error",(e=>{throw Error("Failed to download the brew installer script: "+e)})),await r.start(),A("/bin/bash",[r.getDownloadPath()],{stdio:"inherit",env:{NONINTERACTIVE:"1"}}),Zd=Ne(),await se(Zd,e.rcOptions),{binDir:Zd}}function Ne(){return Ar.join($e(),"bin")}function $e(){if("darwin"===process.platform)return"arm64"===process.arch?"/opt/homebrew":"/usr/local";if("linux"===process.platform)return"/home/linuxbrew/.linuxbrew";throw Error("Unsupported platform for brew")}async function Ce(e,t,r={}){const n={overwrite:!0,cask:!1,args:[],...r};w(`Installing ${e} ${null!=t?t:""} via brew`),oh&&null!==ca.sync("brew",{nothrow:!0})||(await Ae(),oh=!0);const o=Ne(),i=Ar.join(o,"brew"),s=["install",void 0!==t&&""!==t?`${e}@${t}`:e];return n.overwrite&&s.push("--overwrite"),n.cask&&s.push("--cask"),A(i,s,{stdio:"inherit"}),{binDir:o}}function Le(){return"linux"===process.platform&&(void 0===eh&&(eh=null!==ca.sync("dnf",{nothrow:!0})),eh)}function ke(){return"linux"===process.platform&&(void 0===th&&(th=null!==ca.sync("pacman",{nothrow:!0})),th)}function De(){return"linux"===process.platform&&(void 0===rh&&(rh=null!==ca.sync("apt-get",{nothrow:!0})),rh)}async function je(e,t,r){var n;if("win32"!==process.platform)return;if("string"==typeof nh)return{binDir:nh};const o=ca.sync("choco",{nothrow:!0});if(null!==o)return nh=Ar.dirname(o),{binDir:nh};let i="powershell.exe";const s=ca.sync(process.env.SystemRoot+"\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",{nothrow:!0});null!==s&&(i=s),A(i,["-NoProfile","-InputFormat","None","-ExecutionPolicy","Bypass","-Command","[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))"],{stdio:"inherit"});const a=process.env.ALLUSERSPROFILE+"\\chocolatey\\bin";await se(a,py);const c=ca.sync("choco",{nothrow:!0});return nh=null!==c?Ar.dirname(c):(null!=(n=process.env.ChocolateyInstall)?n:"C:/ProgramData/chocolatey")+"/bin",await ee(nh)?{binDir:nh}:void 0}async function Ue(e,t,r=[]){var n;w(`Installing ${e} ${null!=t?t:""} via chocolatey`),ih&&null!==ca.sync("choco",{nothrow:!0})||(await je(0,0,process),ih=!0);const o=process.env.PATH,i={...process.env};if(i.TMP=void 0,i.TEMP=void 0,i.Path=void 0,i.PATH=o,void 0!==t&&""!==t)A("choco",["install","-y",e,"--version="+t,...r],{env:i,extendEnv:!1,stdio:"inherit"});else try{A("choco",["install","-y",e,...r],{env:i,extendEnv:!1,stdio:"inherit"})}catch(a){if(!a.message.includes("exit code 3010"))throw a;w(e+" might require a reboot for the completion of the installation.")}const s=(null!=(n=process.env.ChocolateyInstall)?n:"C:/ProgramData/chocolatey")+"/bin";return await se(s,py),{binDir:s}}async function Fe(e){for(const{name:t,version:r}of e)w(`Installing ${t} ${null!=r?r:""} via dnf`);return j("dnf",["-y","install",...await Promise.all(e.map((e=>async function(e,t){if(void 0!==t&&""!==t){const{stdout:r}=await P("dnf",["search","-q",`${e}-${t}`]);if(""!==r.trim())return`${e}-${t}`;{const{stdout:r}=await P("dnf",["search","-q",`${e}${t}`]);if(""!==r.trim())return`${e}${t}`;y(`Failed to install ${e} ${t} via dnf, trying without version`)}}return e}(e.name,e.version))))]),{binDir:"/usr/bin/"}}async function Me(e,t,r){w(`Installing ${e} ${null!=t?t:""} via pacman`);const n="pacman";"yay"===r&&function(){if(null===ca.sync("yay",{nothrow:!0}))try{j("pacman",["-S","--noconfirm","base-devel","git"]);const e=Ar.join(Tr.tmpdir(),"yay");j("mkdir",["-p",e]),L()?(y("Creating a non-root user to build yay"),j("useradd",["-m","-G","wheel","builder"]),j("passwd",["-d","builder"]),j("chown",["-R","builder:builder",e]),j("bash",["-c",'echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers']),lh=!0,A("su",["-","builder","-c","git clone https://aur.archlinux.org/yay.git "+e],{stdio:"inherit"}),A("su",["-","builder","-c",`cd ${e} && makepkg -si --noconfirm`],{stdio:"inherit"})):(A("git",["clone","https://aur.archlinux.org/yay.git",e],{stdio:"inherit",cwd:Tr.tmpdir()}),A("makepkg",["-si","--noconfirm"],{stdio:"inherit",cwd:e})),A("rm",["-rf",e],{stdio:"inherit"})}catch(e){throw Error(`Failed to install yay: ${e}. Install yay manually and re-run the script.`)}}(),sh||"yay"===r||(j(n,["-Sy","--noconfirm"]),sh=!0),ah||"yay"===r||(j(n,["-S","--noconfirm","base-devel"]),ah=!0);const o=e=>"yay"===r?L()&&lh?j("su",["-","builder","-c","yay -S --noconfirm "+e]):A(r,["-S","--noconfirm",e]):j(null!=r?r:n,["-S","--noconfirm",e]);if(void 0!==t&&""!==t){const r=await async function(e,t){const r=[];try{const{stdout:n}=await P(e,["-Si",t]);for(const e of n.matchAll(ch))r.push(e[1])}catch(n){y(`Failed to get available versions for ${t}: ${n}`)}return r}(n,e);if(r.includes(t))try{o(`${e}=${t}`)}catch{o(`${e}${t}`)}else w(`Failed to install ${e} ${t} via pacman, trying without version`),o(e)}else o(e);return{binDir:"/usr/bin/"}}function Ge(e,t){return Object.keys(t).forEach((r=>{"default"===r||"__esModule"===r||e.hasOwnProperty(r)||Object.defineProperty(e,r,{enumerable:!0,get:()=>t[r]})})),e}function Be(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}function He(e,t=!0){return t?Ar.basename(e):Ar.basename(e,Ar.extname(e))}function qe(e){return Ar.normalize(e).replace(RegExp(Ee(Ar.sep)+"$"),"")}function Ve(e,t=".exe",r=""){return"win32"===process.platform?`${e}${t}`:`${e}${r}`}function ze(e,t){const r=Ar.extname(e),n=`${t}${Ar.basename(e,r)}${r}`;return Ar.join(Ar.dirname(e),n)}function Xe(e,t){const r=Ar.extname(e),n=`${Ar.basename(e,r)}${t}${r}`;return Ar.join(Ar.dirname(e),n)}function We(e,t=".cmd",r=".sh"){return"win32"===process.platform?`${e}${t}`:`${e}${r}`}function Ke(e){return"win32"===process.platform?e:"./"+e}function Ye(e){const t=Ar.extname(e).length;return e.slice(0,-t)}function Je(e,t){return ph(e,t)}function Qe(e,t){const r=Ar.relative(t,e);return!(!r||".."===r||r.startsWith(".."+Ar.sep)||r===Ar.resolve(e))}function Ze(e){return kh(this,void 0,void 0,(function*(){if(Uh.IS_WINDOWS&&/[*"<>|]/.test(e))throw Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');try{yield Uh.rm(e,{force:!0,maxRetries:3,recursive:!0,retryDelay:300})}catch(t){throw Error("File was unable to be removed "+t)}}))}function et(e){return kh(this,void 0,void 0,(function*(){Dh.ok(e,"a path argument must be provided"),yield Uh.mkdir(e,{recursive:!0})}))}function tt(e){return kh(this,void 0,void 0,(function*(){if(!e)throw Error("parameter 'tool' is required");const t=[];if(Uh.IS_WINDOWS&&process.env.PATHEXT)for(const e of process.env.PATHEXT.split(jh.delimiter))e&&t.push(e);if(Uh.isRooted(e)){const r=yield Uh.tryGetExecutablePath(e,t);return r?[r]:[]}if(e.includes(jh.sep))return[];const r=[];if(process.env.PATH)for(const e of process.env.PATH.split(jh.delimiter))e&&r.push(e);const n=[];for(const o of r){const r=yield Uh.tryGetExecutablePath(jh.join(o,e),t);r&&n.push(r)}return n}))}function rt(e,t,r,n){return kh(this,void 0,void 0,(function*(){if(r>=255)return;r++,yield et(t);const o=yield Uh.readdir(e);for(const i of o){const o=`${e}/${i}`,s=`${t}/${i}`;(yield Uh.lstat(o)).isDirectory()?yield rt(o,s,r,n):yield nt(o,s,n)}yield Uh.chmod(t,(yield Uh.stat(e)).mode)}))}function nt(e,t,r){return kh(this,void 0,void 0,(function*(){if((yield Uh.lstat(e)).isSymbolicLink()){try{yield Uh.lstat(t),yield Uh.unlink(t)}catch(n){"EPERM"===n.code&&(yield Uh.chmod(t,"0666"),yield Uh.unlink(t))}const r=yield Uh.readlink(e);yield Uh.symlink(r,t,Uh.IS_WINDOWS?"junction":null)}else(yield Uh.exists(t))&&!r||(yield Uh.copyFile(e,t))}))}function ot(e,t,r){return dm(this,void 0,void 0,(function*(){const n=mm.argStringToArray(e);if(0===n.length)throw Error("Parameter 'commandLine' cannot be null or empty.");const o=n[0];return t=n.slice(1).concat(t||[]),new mm.ToolRunner(o,t,r).exec()}))}function it(e,t){const r=[];t=t||Nm.arch();const n=$m.join(pt(),e);if(Pm.existsSync(n)){const e=Pm.readdirSync(n);for(const o of e)if(lt(o)){const e=$m.join(n,o,t||"");Pm.existsSync(e)&&Pm.existsSync(e+".complete")&&r.push(o)}}return r}function st(e){return Sm(this,void 0,void 0,(function*(){return e||(e=$m.join(ft(),Um.default())),yield xm.mkdirP(e),e}))}function at(e,t,r){return Sm(this,void 0,void 0,(function*(){const n=$m.join(pt(),e,Lm.clean(t)||t,r||"");Tm.debug("destination "+n);const o=n+".complete";return yield xm.rmRF(n),yield xm.rmRF(o),yield xm.mkdirP(n),n}))}function ct(e,t,r){const n=$m.join(pt(),e,Lm.clean(t)||t,r||"");Pm.writeFileSync(n+".complete",""),Tm.debug("finished caching tool")}function lt(e){const t=Lm.clean(e)||"";Tm.debug("isExplicit: "+t);const r=null!=Lm.valid(t);return Tm.debug("explicit? "+r),r}function ut(e,t){let r="";Tm.debug(`evaluating ${e.length} versions`);for(let n=(e=e.sort(((e,t)=>Lm.gt(e,t)?1:-1))).length-1;n>=0;n--){const o=e[n];if(Lm.satisfies(o,t)){r=o;break}}return Tm.debug(r?"matched: "+r:"match not found"),r}function pt(){const e=process.env.RUNNER_TOOL_CACHE||"";return jm.ok(e,"Expected RUNNER_TOOL_CACHE to be defined"),e}function ft(){const e=process.env.RUNNER_TEMP||"";return jm.ok(e,"Expected RUNNER_TEMP to be defined"),e}function dt(e,t){const r=Kr[e];return void 0!==r?r:t}function ht(e,t){if(!e||!t)throw Error("retry-as-promised must be passed a callback and a options set");const r={$current:"$current"in(t="number"==typeof t?{max:t}:t)?t.$current:1,max:t.max,timeout:t.timeout||void 0,match:t.match?Array.isArray(t.match)?t.match:[t.match]:[],backoffBase:void 0===t.backoffBase?100:t.backoffBase,backoffExponent:t.backoffExponent||1.1,report:t.report,name:t.name||e.name||"unknown"};return r.match&&!Array.isArray(r.match)&&(r.match=[r.match]),r.report&&r.report("Trying "+r.name+" #"+r.$current+" at "+(new Date).toLocaleTimeString(),r),new Promise((function(t,n){let o,i,s;r.timeout&&(o=setTimeout((function(){i&&clearTimeout(i),n(new Vm(r.name+" timed out",s))}),r.timeout)),Promise.resolve(e({current:r.$current})).then(t).then((function(){o&&clearTimeout(o),i&&clearTimeout(i)})).catch((function(a){o&&clearTimeout(o),i&&clearTimeout(i),s=a,r.report&&r.report(a&&""+a||a,r,a);var c=r.max>r.$current;if(!c)return n(a);if(c=0===r.match.length||r.match.some((function(e){return function(e,t){if("function"==typeof e)try{if(t instanceof e)return!0}catch(r){return!!e(t)}return e===""+t||e===t.message||e instanceof RegExp&&(e.test(t.message)||e.test(""+t))}(e,a)})),!c)return n(a);var l=r.backoffBase*Math.pow(r.backoffExponent,r.$current-1);r.$current++,r.report&&r.report(`Retrying ${r.name} (${r.$current})`,r),l?(r.report&&r.report(`Delaying retry of ${r.name} by ${l}`,r),i=setTimeout((function(){ht(e,r).then(t).catch(n)}),l)):ht(e,r).then(t).catch(n)}))}))}function mt(e,t,r){switch(process.platform){case"win32":return Ue("7zip",e);case"darwin":return Ce("p7zip",e);case"linux":if(ke())return Me("p7zip",e);if(Le())return Fe([{name:"p7zip",version:e},{name:"p7zip-plugins",version:e}]);if(De())return Ie([{name:"p7zip-full",version:e}]);throw Error("Unsupported linux distribution");default:throw Error("Unsupported platform")}}function vt(e){const t=e.split(".").pop();return"tar"===t?0:"gz"===t||"tgz"===t?1:"xz"===t||"txz"===t?2:"zip"===t?3:("7z"===t||"exe"===t||y(`Unknown archive type: ${t}. Defaulting to 7z`),4)}async function yt(e,t){return await P(await async function(){return void 0===Xm&&(null===ca.sync("7z",{nothrow:!0})&&await mt("",0,process),Xm="7z"),Xm}(),["x",e,"-o"+t,"-y"],{stdio:"inherit"}),await B(t),t}function gt(e,t){return yt(e,t)}async function wt(e,t){return null!==ca.sync("7z",{nothrow:!0})?yt(e,t):null!==ca.sync("unzip",{nothrow:!0})?(await P("unzip",["-q",e,"-d",t],{stdio:"inherit"}),await B(t),t):yt(e,t)}async function _t(e,t,r=0,n=[]){await async function(e){switch(w("Installing tar extraction dependencies"),e){case 1:"linux"===process.platform&&(ke()?(await Me("gzip"),await Me("tar")):Le()?await Fe([{name:"gzip"},{name:"tar"}]):De()&&await Ie([{name:"gzip"},{name:"tar"}]));break;case 2:"linux"===process.platform&&(ke()?(await Me("xz"),await Me("tar")):Le()?await Fe([{name:"xz"},{name:"tar"}]):De()&&await Ie([{name:"xz-utils"},{name:"tar"}]));break;default:throw Error(`Unsupported archive type: ${e} for tar extraction`)}}(vt(e));try{await Fh(t)}catch{}try{await P("tar",["xf",e,"-C",t,"--strip-components="+r,...n],{stdio:"inherit"})}catch(o){"win32"===process.platform&&o.message.includes("Can't create '\\\\?\\C:")&&y(`Failed to extract symlink ${e} to ${t}. Ignoring this symlink.`)}return await B(t),t}async function Et(e,t,r,n,o){var i,s;w(`Installing ${e} ${t} ${o} via direct downloading`),process.env.RUNNER_TEMP=null!=(i=process.env.RUNNER_TEMP)?i:Tr.tmpdir(),process.env.RUNNER_TOOL_CACHE=null!=(s=process.env.RUNNER_TOOL_CACHE)?s:Ar.join(Tr.tmpdir(),"setup-cpp","hostedtoolcache");const{url:a,binRelativeDir:c,binFileName:l,extractedFolderName:u,extractFunction:p}=await r(t,process.platform,o);if(Yr.GITHUB_ACTIONS)try{const r=exports.find_1(e,t);if(r){const n=Ar.join(r,u),o=Ar.join(n,c);if(await ee(Ar.join(o,l)))return w(`${e} ${t} was found in the cache at ${o}.`),await se(o,py),{installDir:n,binDir:o}}}catch{}const f=Ar.join(n,u),d=Ar.join(f,c),h=Ar.join(d,l);return await async function(e,t,r,n,o,i,s,a){if((await Promise.all([ee(e),ee(t)])).includes(!1))try{const e=await async function(e,t,r){w(`Download ${e} ${t}`);const n=await zm((()=>{var e;const t=Ar.join(null!=(e=process.env.RUNNER_TEMP)?e:Tr.tmpdir(),`${Date.now()}-${Ar.basename(r)}`);return exports.downloadTool_1(r,t)}),{name:r,max:4,backoffBase:2e3,report:e=>w(e)});return n}(r,n,o);w(`Extracting ${e} to ${i}`);const t=null!=s?s:function(e){switch(e){case 0:case 1:case 2:return _t;case 3:return wt;default:return yt}}(vt(o));await t(e,i)}catch(c){throw Error(`Failed to download ${r} ${n} ${a} from ${o}: ${c}`)}if(w(`Add ${e} to PATH`),await se(e,py),!(await ee(t)))throw Error(`Failed to find the binary ${t} after extracting ${r} ${n} ${a}`);if("win32"!==process.platform)try{await ms(t,"755")}catch(c){y(`Failed to make ${t} executable: ${c}`)}}(d,h,e,t,a,n,p,o),await async function(e,t,r){Yr.GITHUB_ACTIONS&&"string"==typeof process.env.RUNNER_TOOL_CACHE&&("true"!==Sr("cache-tools")&&"true"!==process.env.CACHE_TOOLS||await exports.cacheDir_1(e,t,r))}(n,e,t),{installDir:f,binDir:d}}function bt(e,t,r){var n;const o=null!=(n=Af(e))?n:e;switch(t){case"win32":{const t=yf(o,"v3.19.6");let n;Oh.includes(r)?n=t?"win64-x64":"windows-x86_64":Rh.includes(r)?n=t?"win32-x86":"windows-i386":Sh.includes(r)?n="windows-arm64":(w(`Trying unsupported arch '${r}' for cmake on Windows`),n="windows-"+r);const i=`cmake-${e}-${n}`;return{binRelativeDir:"bin/",binFileName:Ve("cmake"),extractedFolderName:i,url:`https://github.com/Kitware/CMake/releases/download/v${e}/${i}.zip`}}case"darwin":{const t=`cmake-${e}-${yf(o,"v3.19.1")?"Darwin-x86_64":"macos-universal"}`;return{binRelativeDir:"CMake.app/Contents/bin/",binFileName:Ve("cmake"),extractedFolderName:t,url:`https://github.com/Kitware/CMake/releases/download/v${e}/${t}.tar.gz`}}case"linux":{const t=yf(o,"v3.19.8");let n;Sh.includes(r)?n=t?"Linux-aarch64":"linux-aarch64":Oh.includes(r)?n=t?"Linux-x86_64":"linux-x86_64":(w(`Trying unsupported arch '${r}' for cmake on Linux`),n="linux-"+r);const i=`cmake-${e}-${n}`;return{binRelativeDir:"bin/",binFileName:Ve("cmake"),extractedFolderName:i,url:`https://github.com/Kitware/CMake/releases/download/v${e}/${i}.tar.gz`}}default:throw Error(`Unsupported platform '${t}'`)}}function Ot(e,t,r){return Et("cmake",e,bt,t,r)}async function Rt(e,t,r=lv){const n=await async function(e,t=lv){var r,n;try{const o=await exports.getExecOutput_1(e,["--version"]),i=null==(r=(o.stdout||o.stderr||"").trim().match(t))?void 0:r[1];return null!=(n=Af(i))?n:void 0}catch(o){return void console.error(o)}}(e,r);return void 0!==n&&""!==t&&-1!==Jp(n,t)}function St(e,t='"'){return e.includes(" ")?`${t}${e}${t}`:e}async function It(e,t,r){const n=await async function(e,t,r){let n,o=await Tt(t);if(void 0!==o){const e=Ar.dirname(o);n={bin:o,installDir:e,binDir:e}}else{if(Yr.GITHUB_ACTIONS)try{w("Installing python in GitHub Actions");const{setupActionsPython:i}=await Promise.resolve().then((()=>require("./assets/actions_python-B7InDb2U.js")));if(await i(e,t,r),o=await Tt(t),void 0===o)throw Error("Python binary could not be found");const s=Ar.dirname(o);n={bin:o,installDir:s,binDir:s}}catch(i){y(""+i)}void 0===n&&(n=await async function(e,t){let r;switch(process.platform){case"win32":{e?await Ue("python3",t,["--params=/InstallDir:"+e]):await Ue("python3",t);const n=await Tt(e);if(void 0===n)throw Error("Python binary could not be found");const o=Ar.dirname(n);await se(o,py),r={installDir:o,binDir:o,bin:n};break}case"darwin":{r=await Ce("python3",t);const e=await P("brew",["--prefix","python"],{stdio:"pipe"}),n=Ar.join(e.stdout,"libexec","bin");await se(n,py);break}case"linux":if(ke())r=await Me("python",t);else if(Le())r=await Fe([{name:"python3",version:t}]);else{if(!De())throw Error("Unsupported linux distributions");r=await Ie([{name:"python3",version:t},{name:"python-is-python3"}])}break;default:throw Error("Unsupported platform")}return r}(t,e))}if(void 0===o||void 0===n.bin){if(o=await Tt(t),void 0===o)throw Error("Python binary could not be found");n={bin:o,installDir:Ar.dirname(o),binDir:Ar.dirname(o)}}return n}(e,t,r);Fr(void 0!==n.bin);const o=n.bin,i=await async function(e){const t=await Pt();return void 0===t?(w("pip was not found. Installing pip"),await async function(e){await Nt(e)||(await Mt("pip"),await Nt(e))}(e),Pt()):t}(o);if(void 0===i)throw Error("pip was not installed correctly");return await async function(e){try{if(!(await Ft(e)))try{await Dt(e,"pipx",void 0,{upgrade:!0,usePipx:!1})}catch(t){if(null===Mt("pipx",!1))throw Error("pipx was not installed correctly "+t)}await P(e,["-m","pipx","ensurepath"],{stdio:"inherit"}),await async function(e){try{await Dt(e,"venv",void 0,{upgrade:!1,usePipx:!1})}catch(t){y(`Failed to install venv: ${""+t}. Ignoring...`)}}(e)}catch(t){y(`Failed to install pipx: ${""+t}. Ignoring...`)}}(o),await async function(e){try{await Dt(e,"setuptools",void 0,{upgrade:!0,isLibrary:!0,usePipx:!1}),await Dt(e,"wheel",void 0,{upgrade:!1,isLibrary:!0,usePipx:!1})}catch(t){y(`Failed to install setuptools/wheel: ${""+t}. Ignoring...`)}}(o),n}async function Tt(e){for(const t of["python","python3"]){const r=await xt(t,e);if(void 0!==r)return r}if("win32"===process.platform){const e=Ar.parse(Tr.homedir()).root,t=(await Ss(e)).filter((e=>e.startsWith("Python")));for(const r of t)for(const t of["python3","python"]){const n=await xt(t,Ar.join(e,r));if(void 0!==n)return n}}}async function xt(e,t){var r;try{if(void 0!==t){const r=Ar.join(t,Ve(e));if(await ee(r)&&await Rt(r,dv))return r}const n=null!=(r=await ca(e,{nothrow:!0,all:!0}))?r:[];for(const e of n)if(await Rt(e,dv))return e}catch{}}async function Pt(){for(const e of["pip3","pip"]){const t=await At(e);if(void 0!==t)return t}}async function At(e){var t;try{const r=null!=(t=await ca(e,{nothrow:!0,all:!0}))?t:[];for(const e of r)if(await Rt(e,fv))return e}catch{}}async function Nt(e){try{return await P(e,["-m","ensurepip","-U","--upgrade"],{stdio:"inherit"}),!0}catch(t){w(""+t);try{return await P(e,["-m","pip","install","--upgrade","pip"],{stdio:"inherit"}),!0}catch(r){w(""+r)}}return!1}function $t(e,t,r=null){var n;return Ct(t)&&"linux"===process.platform&&null!==r&&e in hv?function(e,t){const r=e[0],n=Object.keys(t).map((e=>Number.parseInt(e,10))).sort(((e,t)=>t-e)).find((e=>r>=e));return void 0===n?"":t[n]}(r,hv[e]):Ct(t)&&e in pv?null!=(n=pv[e])?n:"":"true"===t?"":null!=t?t:""}function Ct(e){return"true"===e||void 0===e}function Lt(){if(!("version"in Tr)||"function"!=typeof Tr.version)return null;const e=Tr.version().match(/(\d+)\.(\d+)\.(\d+)/);return null===e?null:[Number.parseInt(e[1],10),Number.parseInt(e[2],10),Number.parseInt(e[3],10)]}async function kt(e,t,r={}){return Dt(await async function(){return void 0!==bv||(bv=(await It($t("python",void 0,await wv()),"",process.arch)).bin),bv}(),e,t,r)}async function Dt(e,t,r,n={}){const{usePipx:o=!0,user:i=!0,upgrade:s=!1,isLibrary:a=!1}=n,c=o&&!a&&await Ft(e),l=c?"pipx":"pip",u=t.replace(/\[.*]/g,"").trim();if(!s){const t=c?await async function(e,t){try{const r=await P(e,["-m","pipx","list","--json"],{stdio:"ignore",reject:!1});if(0!==r.exitCode||"string"!=typeof r.stdout)return!1;const n=JSON.parse(r.stdout);if(t in n.venvs)return!0;for(const e of Object.values(n.venvs))if(e.metadata.main_package.package_or_url===t||e.metadata.main_package.package===t)return!0}catch{}return!1}(e,u):await async function(e,t){try{return 0===(await P(e,["-m","pip","-qq","show",t],{stdio:"ignore",reject:!1})).exitCode}catch{return!1}}(e,u);if(t)return{binDir:c?await jt():await Ut(e,u)}}const p=await async function(e,t){return 0===(await P(e,["-m","pip","-qq","index","versions",t],{stdio:"ignore",reject:!1})).exitCode}(e,u);if(p)try{uo.info(`Installing ${t} ${null!=r?r:""} via ${l}`);const n=void 0!==r&&""!==r?`${t}==${r}`:t,o=s?c?["upgrade"]:["install","--upgrade"]:["install"],a=!c&&i?["--user"]:[],u=process.env;c&&i&&(u.PIPX_HOME=await _v(),u.PIPX_BIN_DIR=await Ev()),A(e,["-m",l,...o,...a,n],{stdio:"inherit",env:u})}catch(f){if(uo.info(`Failed to install ${t} via ${l}: ${f instanceof Error?`${f.message}\n${f.stack}`:f+""}`),null===await Mt(t))throw Error(`Failed to install ${t} via ${l}: ${f}.`)}else if(null===await Mt(t))throw Error(`Failed to install ${t} as it was not found via ${l} or the system package manager`);return{binDir:c?await jt():await Ut(e,u)}}function jt(){return Ev()}async function Ut(e,t){const r=await mv(e),n=await async function(e,t){const r=(await Promise.all(e.map((e=>ee(Ar.join(e,Ve(t))))))).findIndex((e=>e));if(-1!==r)return e[r];const n=ca.sync(Ve(t),{nothrow:!0});return null!==n?Ar.dirname(n):e[e.length-1]}(r,t);return await se(n,py),n}async function Ft(e){return 0===(await P(e,["-m","pipx","--help"],{stdio:"ignore",reject:!1})).exitCode}function Mt(e,t=!0){if("linux"===process.platform){if(uo.info(`Installing ${e} via the system package manager`),ke())return Me(t?"python-"+e:e);if(Le())return Fe([{name:t?"python3-"+e:e}]);if(De())return Ie([{name:t?"python3-"+e:e}])}else if("darwin"===process.platform)return Ce(e);return null}function Gt(e,t,r){return kt("cmakelang[YAML]",e)}async function Bt(e,t,r){switch(process.platform){case"win32":return await Ue("graphviz",e),async function(){if("win32"===process.platform){const e="C:/Program Files/Graphviz/bin";return await se(e,py),{binDir:e}}throw Error("Unsupported platform")}();case"darwin":return Ce("graphviz",e);case"linux":if(ke())return Me("graphviz",e);if(Le())return Fe([{name:"graphviz",version:e}]);if(De())return Ie([{name:"graphviz",version:e}]);throw Error("Unsupported linux distribution");default:throw Error("Unsupported platform")}}async function Ht(e,t){const{ArchiveHdi:r}=await Promise.resolve().then((()=>require("./assets/hdi-Bqz5zNw7.js"))),n=new r(e);await n.read((async e=>{await e.extract(Ar.join(t,e.path))}))}function qt(e,t,r){switch(t){case"linux":{const t="doxygen-"+e;return{binRelativeDir:"bin/",binFileName:Ve("doxygen"),extractedFolderName:t,url:`https://www.doxygen.nl/files/${t}.linux.bin.tar.gz`}}case"win32":{const t="doxygen-"+e;return{binRelativeDir:"",binFileName:Ve("doxygen"),extractedFolderName:t,url:`https://www.doxygen.nl/files/${t}.windows.x64.bin.zip`}}case"darwin":{const t="Doxygen-"+e;return{binRelativeDir:"Doxygen/Doxygen.app/Contents/Resources/",binFileName:Ve("doxygen"),extractedFolderName:t,extractFunction:Ht,url:`https://doxygen.nl/files/${t}.dmg`}}default:throw Error(`Unsupported platform '${t}'`)}}async function Vt(){if("darwin"===process.platform)try{const e=await exports.getExecOutput_1("xcrun --sdk macosx --show-sdk-path"),t=e.stdout||e.stderr;t?await oe("SDKROOT",t.trim(),py):v("SDKROOT not set")}catch(e){v(e)}}async function zt(e){const t=await Is(e,"utf-8");return JSON.parse(t)}function Xt(e,t){const r=Object.keys(e),n=new Map;if(void 0===t.filterMapTag)for(const i of r)n.set(i,i);else for(const i of r){const e=t.filterMapTag(i);void 0!==e&&n.set(e,i)}if(0===n.size)return;const o=[];for(const[i,s]of n.entries())i.startsWith(t.version)&&o.push(s);if(0!==o.length)for(const i of o){let r=e[i];if(void 0===r)continue;if(void 0!==t.filterName&&(r=r.filter(t.filterName)),0===r.length)continue;const n=Wt(i,r,t);if(void 0!==n)return n}}function Wt(e,t,r){if(!(void 0!==r.keywords&&0!==r.keywords.length||void 0!==r.optionalKeywords&&0!==r.optionalKeywords.length))return{tag:e,name:t[0]};let n=[];if(void 0!==r.keywords&&0!==r.keywords.length)for(const o of t)r.keywords.every((e=>o.includes(e)))&&n.push(o);else n=t;if(0!==n.length){if(void 0!==r.optionalKeywords&&0!==r.optionalKeywords.length){const t=n.map((e=>{let t=0;for(const n of r.optionalKeywords)e.includes(n)&&t++;return t})),o=Math.max(...t);return{tag:e,name:n[t.indexOf(o)]}}return{tag:e,name:n[0]}}}async function Kt(e,t,r){var n;if("win32"===t){const t=Xt(await zt(Ar.join(Sv,"github_brechtsanders_winlibs_mingw.json")),{version:e,keywords:[null!=(n={x64:"x86_64",ia32:"i386"}[r])?n:r]});if(void 0===t)throw Error(`No asset found for version ${e} and arch ${r}`);return{binRelativeDir:"bin/",binFileName:Ve("g++"),extractedFolderName:"mingw64",extractFunction:yt,url:`https://github.com/brechtsanders/winlibs_mingw/releases/download/${t.tag}/${t.name}`}}throw Error(`Unsupported platform '${t}'`)}async function Yt(e,t,r,n=40){let o;switch(process.platform){case"win32":"arm"!==r&&"arm64"!==r||await Ue("gcc-arm-embedded",e);try{o=await Et("g++",e,Kt,t,r)}catch(i){w(`Failed to download g++ binary. ${i}. Falling back to chocolatey.`),o=await async function(e,t){var r,n;let o;if(await Ue("mingw",e),"x64"===t&&await ee("C:/tools/mingw64/bin")?(o="C:/tools/mingw64/bin",await se(o,py)):"ia32"===t&&await ee("C:/tools/mingw32/bin")?(o="C:/tools/mingw32/bin",await se(o,py)):await ee((null!=(r=process.env.ChocolateyInstall)?r:"C:/ProgramData/chocolatey")+"/bin/g++.exe")&&(o=(null!=(n=process.env.ChocolateyInstall)?n:"C:/ProgramData/chocolatey")+"/bin"),void 0!==o)return{binDir:o}}(e,r)}break;case"darwin":o=await Ce("gcc",e);break;case"linux":"x64"===r?ke()?o=await Me("gcc",e):Le()?o=await Fe([{name:"gcc",version:e},{name:"gcc-c++",version:e},{name:"libstdc++-devel"}]):De()&&(o=""===e?await Ie([{name:"gcc"},{name:"g++"}]):await Ie([{name:"gcc",version:e,repository:"ppa:ubuntu-toolchain-r/test",key:{key:"1E9377A2BA9EF27F",fileName:"ubuntu-toolchain-r-test.gpg"}},{name:"g++",version:e,repository:"ppa:ubuntu-toolchain-r/test",key:{key:"1E9377A2BA9EF27F",fileName:"ubuntu-toolchain-r-test.gpg"}}])):(w(`Install g++-multilib because gcc for ${r} was requested`),ke()?o=await Me("gcc-multilib",e):De()&&(o=""===e?await Ie([{name:"gcc-multilib"}]):await Ie([{name:"gcc-multilib",version:e,repository:"ppa:ubuntu-toolchain-r/test",key:{key:"1E9377A2BA9EF27F",fileName:"ubuntu-toolchain-r-test.gpg"}}])));break;default:throw Error("Unsupported platform for "+r)}if(void 0!==o)return await async function(e,t,r=40){var n;const o=[];if("win32"===process.platform)o.push(oe("CC",Ve(t+"/gcc"),py),oe("CXX",Ve(t+"/g++"),py));else{let s=e;""===e&&(s=await async function(e,t){try{let r="gcc";if(await ee(e+"/gcc"))r=e+"/gcc";else{const t=(await Ss(e)).sort(((e,t)=>{var r,n,o,i;return function(e,t){const r=Af(e),n=Af(t);return null!==r&&null!==n?n.compare(r):t.localeCompare(e)}(null!=(n=null==(r=e.match(/^gcc-?(.*)(\.exe)?$/))?void 0:r[1])?n:"",null!=(i=null==(o=t.match(/^gcc-?(.*)(\.exe)?$/))?void 0:o[1])?i:"")}));for(const n of t)if(n.startsWith("gcc")){r=`${e}/${n}`;break}}const{stdout:n}=await P(r,["--version"],{stdio:"pipe"}),o=n.match(/gcc.* \(.*\) ([\d.]+)/);return null!==o?o[1]:(y("Failed to parse gcc version from: "+n),t)}catch(i){return v("Failed to get gcc version: "+i),t}}(t,s),w("Using gcc version "+s));const a=Vp(null!=(n=Af(s))?n:s);5>a?(o.push(oe("CC",`${t}/gcc-${s}`,py),oe("CXX",`${t}/g++-${s}`,py)),De()&&o.push(ye("cc",`${t}/gcc-${s}`,py,r),ye("cxx",`${t}/g++-${s}`,py,r),ye("gcc",`${t}/gcc-${s}`,py,r),ye("g++",`${t}/g++-${s}`,py,r))):(o.push(oe("CC",`${t}/gcc-${a}`,py),oe("CXX",`${t}/g++-${a}`,py)),De()&&o.push(ye("cc",`${t}/gcc-${a}`,py,r),ye("cxx",`${t}/g++-${a}`,py,r),ye("gcc",`${t}/gcc-${a}`,py,r),ye("g++",`${t}/g++-${a}`,py,r)))}o.push(Vt()),Yr.GITHUB_ACTIONS&&await async function(){const e=Ar.join(Sv,"gcc_matcher.json");if(!(await ee(e)))return y("the gcc_matcher.json file does not exist in the same folder as setup-cpp.js");w("::add-matcher::"+e)}(),await Promise.all(o)}(e,o.binDir,n),o}async function Jt(e,t,r){let n;switch(process.platform){case"win32":case"darwin":return Yt(e,t,r);case"linux":ke()?n=await Me("mingw-w64-gcc",e):Le()?n=await Fe([{name:"mingw64-gcc",version:e}]):De()&&(n=await Ie([{name:"mingw-w64",version:e,repository:"ppa:ubuntu-toolchain-r/test",key:{key:"1E9377A2BA9EF27F",fileName:"ubuntu-toolchain-r-test.gpg"}}]));break;default:throw Error("Unsupported platform for "+r)}if(void 0!==n)return n}function Qt(e){const t=Fp(e),r=null!==t?Vp(t):e;return oe("GCOV",""!==r?"gcov-"+r:"gcov",py)}async function Zt(e,t,r){const{keywords:n,optionalKeywords:o}=function(e,t){const r=[],n=[];switch(e){case"linux":r.push("linux"),Oh.includes(t)?(n.push("64"),n.push("x86_64")):(w(`Using arch ${t} for infer`),r.push(t));break;case"darwin":r.push("osx"),Oh.includes(t)?n.push("x86_64"):Sh.includes(t)?n.push("arm64"):(w(`Using arch ${t} for infer`),r.push(t));break;default:w(`Using ${e} ${t} for infer`),r.push(e,t)}return{keywords:r,optionalKeywords:n}}(t,r),i=Xt(await zt(Ar.join(Iv,"github_facebook_infer.json")),{version:e,keywords:n,optionalKeywords:o,filterMapTag:e=>e.replace(/^v/,"")});if(void 0!==i)return{url:`https://github.com/facebook/infer/releases/download/${i.tag}/${i.name}`,extractedFolderName:""+Ar.basename(i.name,".tar.xz"),binRelativeDir:"bin",binFileName:Ve("infer")};throw Error(`No asset found for version ${e} matching ${n} and ${o}`)}function er(e,t,r){const n=function(e,t){switch(e){case"win32":return Oh.includes(t)||Rh.includes(t)?"win":Sh.includes(t)?"winarm64":"win";case"darwin":return"mac";case"linux":return Oh.includes(t)||Rh.includes(t)?"linux":Sh.includes(t)?"linux-aarch64":"linux";default:throw Error(`Unsupported platform '${e}'`)}}(t,r);return{binRelativeDir:"",binFileName:Ve("ninja"),extractedFolderName:"",url:`https://github.com/ninja-build/ninja/releases/download/v${e}/ninja-${n}.zip`}}function tr(e,t,r){return Et("ninja",e,er,t,r)}function rr(e){return{url:`https://github.com/SimonKagstrom/kcov/releases/download/${e}/kcov-amd64.tar.gz`,extractedFolderName:"",binRelativeDir:"usr/local/bin",binFileName:Ve("kcov")}}function nr(e){return{url:`https://github.com/SimonKagstrom/kcov/archive/refs/tags/${e}.tar.gz`,extractedFolderName:"",binRelativeDir:"build/src",binFileName:Ve("kcov"),extractFunction:or}}async function or(e,t){const r=await _t(e,t,1),n=await async function(){let e=ca.sync("cmake",{nothrow:!0});if(null===e){const{binDir:t}=await Ot($t("cmake",void 0,await wv()),Ar.join(te("~"),"cmake"),"");e=Ar.join(t,"cmake")}return null===ca.sync("ninja",{nothrow:!0})&&await tr($t("ninja",void 0,await wv()),Ar.join(te("~"),"ninja"),""),e}();"linux"===process.platform&&(ke()?await Promise.all([Me("libdwarf"),Me("libcurl-openssl")]):Le()?await Fe([{name:"libdwarf-devel"},{name:"libcurl-devel"}]):De()&&await Ie([{name:"libdw-dev"},{name:"libcurl4-openssl-dev"}]));try{if(null!==ca.sync("patch",{nothrow:!0})){const e=Ar.join(Tv,"gcc13.patch");await P("patch",["-N","-p1","-i",e],{cwd:r,stdio:"inherit"})}else w("`patch` not found, skipping gcc13.patch, kcov may not build on gcc 13")}catch{}const o=Ar.join(r,"build");return await P(n,["-S",r,"-B",o,"-DCMAKE_BUILD_TYPE=Release","-G","Ninja"],{cwd:r,stdio:"inherit"}),await P(n,["--build",o,"--config","Release"],{cwd:r,stdio:"inherit"}),r}async function ir(){"darwin"===process.platform&&(null!==await ca("clang",{nothrow:!0})&&null!==await ca("clang++",{nothrow:!0})&&(g("Assuming clang is an Apple Clang compiler"),await Promise.all([oe("CC","clang",py),oe("CXX","clang++",py)])),qr.error("Apple Clang automatic installation is not supported yet"))}function sr(e){return Object.values(Gv).includes(e)?e:e in Gv?Gv[e]:e}function ar(e){if(Object.keys(Gv).includes(e))return e;for(const[t,r]of Object.entries(Gv))if(r===e)return t;return e}function cr(e){const t=sr(e);let r;if(t){const e=t.split(".")[0]+".9";r=`-version "${t},${e}"`}else r="-latest";let n=function(e,t){try{return(""+Cv.execSync(`vswhere -products * ${t} -prerelease -property installationPath`)).trim()+"\\VC\\Auxiliary\\Build\\vcvarsall.bat"}catch(r){$v.warning("vswhere failed: "+r)}return null}(0,r);if(n&&Lv.existsSync(n))return $v.info("Found with vswhere: "+n),n;$v.info("Not found with vswhere");const o=e?[ar(e)]:Mv;for(const i of Uv)for(const e of o)for(const t of Fv)if(n=`${i}\\Microsoft Visual Studio\\${e}\\${t}\\VC\\Auxiliary\\Build\\vcvarsall.bat`,$v.info("Trying standard location: "+n),Lv.existsSync(n))return $v.info("Found standard location: "+n),n;if($v.info("Not found in standard locations"),n=jv+"\\Microsoft Visual C++ Build Tools\\vcbuildtools.bat",Lv.existsSync(n))return $v.info("Found VS 2015: "+n),n;throw $v.info("Not found in VS 2015 location: "+n),Error("Microsoft Visual Studio not found")}function lr(e){return-1!=["PATH","INCLUDE","LIB","LIBPATH"].indexOf(e.toUpperCase())}async function ur(e,t,r,n,o,i,s){void 0!==t&&await ee(t)&&(w(`Adding ${t} to PATH`),await oe("VCTargetsPath",t,py)),await Vv(function(e){switch(e){case"x32":case"32":case"ia32":return"x86";case"64":return"x64";default:return e}}(r),o,n,i,s,e)}async function pr(e,t,r,n,o,i,s,a=12e5){uo.startGroup(`Installing ${e} ${t}`);try{await function(e,t){const{milliseconds:r,fallback:n,message:o,customTimers:i={setTimeout:setTimeout,clearTimeout:clearTimeout}}=t;let s;const a=new Promise(((a,c)=>{if("number"!=typeof r||1!==Math.sign(r))throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${r}\``);if(t.signal){const{signal:e}=t;e.aborted&&c(Nv(e)),e.addEventListener("abort",(()=>{c(Nv(e))}))}if(r===1/0)return void e.then(a,c);const l=new xv;s=i.setTimeout.call(void 0,(()=>{if(n)try{a(n())}catch(t){c(t)}else"function"==typeof e.cancel&&e.cancel(),!1===o?a():o instanceof Error?c(o):(l.message=null!=o?o:`Promise timed out after ${r} milliseconds`,c(l))}),r),(async()=>{try{a(await e)}catch(t){c(t)}})()})).finally((()=>{a.clear()}));return a.clear=()=>{i.clearTimeout.call(void 0,s),s=void 0},a}(async function(e,t,r,n,o,i){const s=ay.includes(e);let a;if("vcvarsall"===e)await ur($t(e,t,r),void 0,n,void 0,void 0,!1,!1);else if("brew"===e)a=await Ae({rcOptions:py});else{const i=Ar.join(o,s?"llvm":e),c=$t(e,t,r),l=cy[e];a=await l(c,i,n)}i.push(Ir(e,a))}(e,t,r,n,o,i),{milliseconds:a,message:`Timeout while installing ${e} ${t}. You can increase the timeout from options`})}catch(c){v(c),c instanceof Error&&void 0!==c.stack&&v(c.stack),s.push(e+" failed to install")}uo.endGroup()}async function fr(e,t,r){const n=await async function(e,t,r){const{keywords:n,optionalKeywords:o}=await async function(e,t){const r=[],n=[];switch(e){case"win32":Oh.includes(t)?r.push("win64"):Rh.includes(t)?r.push("win32"):Sh.includes(t)?r.push("woa64"):(w(`Using arch ${t} for LLVM`),r.push(t));break;case"linux":if(r.push("linux"),De()){n.push("ubuntu");const e=await wv();if(null!==e){n.push(""+e[0]);const t=10>e[1]?"0"+e[1]:""+e[1];n.push(`${e[0]}.${t}`),n.push(`${e[0]}.${t}.${e[2]}`)}}else Le()&&n.push("rhel");Oh.includes(t)?r.push("x86_64"):Rh.includes(t)?r.push("x86"):Sh.includes(t)?r.push("aarch64"):Ih.includes(t)?r.push("armv7a"):Th.includes(t)?r.push("powerpc64le"):xh.includes(t)?r.push("sparc64"):(w(`Using arch ${t} for LLVM`),r.push(t));break;case"darwin":r.push("apple"),Oh.includes(t)?r.push("x86_64"):Sh.includes(t)?n.push("arm64"):(w(`Using arch ${t} for LLVM`),r.push(t));break;case"freebsd":r.push("freebsd"),Oh.includes(t)?r.push("amd64"):Rh.includes(t)?r.push("i386"):(w(`Using arch ${t} for LLVM`),r.push(t));break;default:w(`Using ${e} ${t} for LLVM`),r.push(e,t)}return{keywords:r,optionalKeywords:n}}(e,t),i=Xt(await zt(Ar.join(Xv,"github_llvm_llvm-project.json")),{version:r,keywords:n,optionalKeywords:o,filterMapTag:e=>e.replace(/^llvmorg-/,"")});if(void 0!==i)return`https://github.com/llvm/llvm-project/releases/download/${i.tag}/${i.name}`;const s=Xt(await zt(Ar.join(Xv,"llvm_org_releases.json")),{version:r,keywords:n,optionalKeywords:o});if(void 0!==s)return`https://releases.llvm.org/${s.tag}/${s.name}`;throw Error(`No asset found for version ${r} matching ${n} and ${o}`)}(t,r,e);return w("Downloading LLVM from "+n),{url:n,extractedFolderName:"",binRelativeDir:"bin",binFileName:Ve("clang"),extractFunction:"win32"===t?gt:(e,t)=>_t(e,t,1)}}async function dr(e,t,r){var n;const o=await Kv(e,t,r);return await async function(e,t){var r,n;const o=null!=(r=process.env.LD_LIBRARY_PATH)?r:"",i=null!=(n=process.env.DYLD_LIBRARY_PATH)?n:"",s=yr(t),a=[oe("CC",Ve(e+"/bin/clang"),py),oe("CXX",Ve(e+"/bin/clang++"),py),oe("LLVM_PATH",e,py),oe("LD_LIBRARY_PATH",`${o}${Ar.delimiter}${e}/lib`,py),oe("DYLD_LIBRARY_PATH",`${i}${Ar.delimiter}${e}/lib`,py),oe("LLVM_LDFLAGS","-L"+St(e+"/lib"),py),oe("LLVM_CPPFLAGS","-I"+St(e+"/include"),py),await ee(`${e}/lib/clang/${t}/include`)?oe("LLVM_CPATH",`${e}/lib/clang/${t}/include`,py):await ee(`${e}/lib/clang/${s}/include`)?oe("LLVM_CPATH",`${e}/lib/clang/${s}/include`,py):Promise.resolve(),oe("LIBRARY_PATH",e+"/lib",py),Vt()];if(De()){const t=60;a.push(ye("cc",e+"/bin/clang",py,t),ye("cxx",e+"/bin/clang++",py,t),ye("clang",e+"/bin/clang",py),ye("clang++",e+"/bin/clang++",py),ye("lld",e+"/bin/lld",py),ye("ld.lld",e+"/bin/ld.lld",py),ye("llvm-ar",e+"/bin/llvm-ar",py))}await Promise.all(a)}(null!=(n=o.installDir)?n:t,e),o}function hr(e,t,r){return vr(e,t,r,zv.ClangFormat)}function mr(e,t,r){return vr(e,t,r)}async function vr(e,t,r,n=zv.All){const o=yr(e);try{if(De())return await async function(e,t=0){const r="/usr/lib/llvm-"+e;await Ie([{name:"ca-certificates"}]);const n=new Bd.DownloaderHelper("https://apt.llvm.org/llvm.sh",Tr.tmpdir(),{fileName:"llvm.sh"});n.on("error",(e=>{throw Error("Failed to download the LLVM installer script: "+e)})),await n.start();const o=await Is(n.getDownloadPath(),"utf-8"),i=Ar.join(Tr.tmpdir(),"llvm-setup-cpp.sh"),s=await async function(e,t,r,n){let o=function(e){return"1"!==process.env.NODE_DEBUG&&"true"!==process.env.NODE_DEBUG?e.replace(/set -eux/g,"set -eu"):e}(e);return o=function(e){return e.replace(/add-apt-repository "\${REPO_NAME}"/g,`add-apt-repository -y -n "\${REPO_NAME}"\napt-get update -o ${qd} -y`)}(o),o=function(e,t,r){return 1===e?t.replace(/ -y \$PKG/g," -y clang-format-"+r):t}(n,o,r),o=await async function(e){let t=e.replace(/apt-get install -y/g,`apt-get install -o Dpkg::Options::="--force-overwrite" -o ${qd} -y --fix-broken`);return await Promise.all(["libc++-$LLVM_VERSION-dev","libc++abi-$LLVM_VERSION-dev","libunwind-$LLVM_VERSION-dev"].map((async e=>{const r=e.replace("$LLVM_VERSION","*");await async function(e){try{const{stdout:t}=await P("dpkg",["-l",e],{env:ge("apt-get"),stdio:"pipe"});return"string"==typeof t&&t.split("\n").some((e=>e.startsWith("ii")))}catch{return!1}}(r)&&(qr.info("Removing conflicting package "+r),t=t.replace(e,""))}))),t}(o),o=function(e){return we()?e.replace(/apt-get/g,"nala"):e}(o),await Ds(t,o),[{name:"lsb-release"},{name:"wget"},{name:"software-properties-common"},{name:"gnupg"}]}(o,i,e,t);return await Ie(s),await ms(i,"755"),await U("bash",[i,""+e,...0===t?["all"]:[]],{stdio:"inherit",shell:!0,timeout:12e5}),await se(r+"/bin",py),{installDir:""+r,binDir:r+"/bin",bin:r+"/bin/clang++"}}(o,n)}catch(s){w("Failed to install llvm via system package manager "+s)}const i=await Et("llvm",e,fr,t,r);return await Yv(o),i}function yr(e){const t=function(e){if(null===Fp(e))try{const t=Af(e);if(null!==t)return w(`Coerced version '${e}' to '${t}'`),t.version}catch(t){}return e}(e);return Number.parseInt(t.split(".")[0],10)}async function gr(){if(Yr.GITHUB_ACTIONS){const e=Ar.join(Wv,"llvm_matcher.json");if(!(await ee(e)))return y("the llvm_matcher.json file does not exist in the same folder as setup-cpp.js");w("::add-matcher::"+e)}}async function wr(e,t,r,n,o,i){if("win32"!==process.platform)return;const s=Bv(e);w(`Checking if MSVC ${s} is already installed`);let a,c,l=!1;try{const e=qv(s);l=!0,w("Found the pre-installed version of MSVC at "+e)}catch{}if(!l)try{"14.0"===s?(a="14.0",await Ue("visualcpp-build-tools","14.0.25420.1",["--ignore-dependencies"]),c="C:/Program Files (x86)/MSBuild/Microsoft.Cpp/v4.0/v140"):"15.0"===s?(a="14.16",await Ue("visualstudio2017buildtools","15.9.41.0",[]),c="C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16"):"16.0"===s?(a="14.29",await Ue("visualstudio2019buildtools","16.11.7.0",[]),c="C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133"):"17.0"===s?(a=void 0,await Ue("visualstudio2022buildtools","117.0.5.0",[]),c=void 0):v(`The given MSVC versions ${e} is not supported yet.`)}catch(u){v(u)}await ur(s,c,r,a,n,o,i),Yr.GITHUB_ACTIONS&&await async function(){const e=Ar.join(Qv,"msvc_matcher.json");if(!(await ee(e)))return y("the msvc_matcher.json file does not exist in the same folder as setup-cpp.js");w("::add-matcher::"+e)}()}async function _r(e,t,r){if("win32"===process.platform)return await Ue("opencppcoverage",e),{binDir:await async function(){const e="C:/Program Files/OpenCppCoverage";return await se(e,py),e}()}}function Er(e,t,r){return{url:br(t,r,e),binRelativeDir:"",binFileName:Ve("pwsh"),extractedFolderName:""}}function br(e,t,r){var n;switch(e){case"win32":return`https://github.com/PowerShell/PowerShell/releases/download/v${r}/PowerShell-${r}-${["ia32","x86","i386","x32"].includes(t)?"win-x86":"win-x64"}.zip`;case"darwin":return`https://github.com/PowerShell/PowerShell/releases/download/v${r}/powershell-${r}-${["arm","arm64"].includes(t)?"osx-arm64":"osx-x64"}.tar.gz`;case"linux":return`https://github.com/PowerShell/PowerShell/releases/download/v${r}/powershell-${r}-${null!=(n={arm64:"linux-arm64",arm:"linux-arm64",arm32:"linux-arm32",aarch64:"linux-arm64",x64:"linux-x64"}[t])?n:"linux-x64"}.tar.gz`;default:throw Error(`Unsupported platform '${e}'`)}}async function Or(e,t,r){try{return await Et("pwsh",e,Er,t,r)}catch(n){return v(`Failed to setup pwsh via download: ${n}. Trying package managers...`),async function(e){switch(process.platform){case"win32":{await Ue("powershell-core",e);const t="C:/Program Files/PowerShell/7";return await se(t,py),{binDir:t}}case"darwin":return Ce("powershell",e,{cask:!0,overwrite:!1});case"linux":if(ke())return Me("powershell-bin",e,"yay");if(Le())return await Fe([{name:"curl"}]),j("/bin/bash",["-c","curl https://packages.microsoft.com/config/rhel/8/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo"]),Fe([{name:"powershell",version:e}]);if(De()){await Ie([{name:"curl"}]);const t=await wv();return j("curl",["-LJO",`https://packages.microsoft.com/config/ubuntu/${t[0]}.0${t[1]}/packages-microsoft-prod.deb`]),j("dpkg",["-i","packages-microsoft-prod.deb"]),Ie([{name:"powershell",version:e}],!0)}throw Error("Unsupported linux distribution");default:throw Error("Unsupported platform")}}(e)}}function Rr(e,t,r){const n=function(e){return"win32"===e?"windows":e}(t),o=function(e){switch(e){case"x64":return"amd64";case"ia32":case"x86":case"i386":case"x32":return"386";default:return e}}(r),i="win32"===t?"zip":"tar.gz";return{binRelativeDir:"",binFileName:Ve("task"),extractedFolderName:"",url:`https://github.com/go-task/task/releases/download/v${e}/task_${n}_${o}.${i}`}}function Sr(e){const t=uo.getInput(e.toLowerCase());if("false"!==t&&""!==t)return t}function Ir(e,t){let r=`✅ ${e} was installed successfully:`;return void 0===t||("installDir"in t&&(r+="\n- The installation directory is "+t.installDir),""!==t.binDir&&(r+="\n- The binary directory is "+t.binDir)),r}Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Tr=require("os"),xr=require("fs"),Pr=require("crypto"),Ar=require("path"),Nr=require("http"),$r=require("https");require("net");const Cr=require("tls"),Lr=require("events"),kr=require("util"),Dr=require("buffer"),jr=require("process"),Ur=require("child_process"),Fr=require("assert"),Mr=require("stream"),Gr=require("url"),Br=require("string_decoder"),Hr=require("timers"),qr=require("console");var Vr="undefined"!=typeof document?document.currentScript:null;const zr=e(xr),Xr=e(Nr),Wr=e($r);var Kr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Yr={};const Jr=[{name:"Agola CI",constant:"AGOLA",env:"AGOLA_GIT_REF",pr:"AGOLA_PULL_REQUEST_ID"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE"},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN"},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Earthly",constant:"EARTHLY",env:"EARTHLY_CI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"Gitea Actions",constant:"GITEA_ACTIONS",env:"GITEA_ACTIONS"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Google Cloud Build",constant:"GOOGLE_CLOUD_BUILD",env:"BUILDER_OUTPUT"},{name:"Harness CI",constant:"HARNESS",env:"HARNESS_BUILD_ID"},{name:"Heroku",constant:"HEROKU",env:{env:"NODE",includes:"/app/.heroku/node/bin/node"}},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"Prow",constant:"PROW",env:"PROW_JOB_ID"},{name:"ReleaseHub",constant:"RELEASEHUB",env:"RELEASE_BUILD_ID"},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Sourcehut",constant:"SOURCEHUT",env:{CI_NAME:"sourcehut"}},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vela",constant:"VELA",env:"VELA",pr:{VELA_PULL_REQUEST:"1"}},{name:"Vercel",constant:"VERCEL",env:{any:["NOW_BUILDER","VERCEL"]},pr:"VERCEL_GIT_PULL_REQUEST_ID"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"},{name:"Woodpecker",constant:"WOODPECKER",env:{CI:"woodpecker"},pr:{CI_BUILD_EVENT:"pull_request"}},{name:"Xcode Cloud",constant:"XCODE_CLOUD",env:"CI_XCODE_PROJECT",pr:"CI_PULL_REQUEST_NUMBER"},{name:"Xcode Server",constant:"XCODE_SERVER",env:"XCS"}];!function(e){function t(e){return"string"==typeof e?!!n[e]:"env"in e?n[e.env]&&n[e.env].includes(e.includes):"any"in e?e.any.some((function(e){return!!n[e]})):Object.keys(e).every((function(t){return n[t]===e[t]}))}const r=Jr,n=process.env;Object.defineProperty(e,"_vendors",{value:r.map((function(e){return e.constant}))}),e.name=null,e.isPR=null,r.forEach((function(r){const o=(Array.isArray(r.env)?r.env:[r.env]).every((function(e){return t(e)}));if(e[r.constant]=o,o)switch(e.name=r.name,typeof r.pr){case"string":e.isPR=!!n[r.pr];break;case"object":e.isPR="env"in r.pr?r.pr.env in n&&n[r.pr.env]!==r.pr.ne:"any"in r.pr?r.pr.any.some((function(e){return!!n[e]})):t(r.pr);break;default:e.isPR=null}})),e.isCI=!("false"===n.CI||!(n.BUILD_ID||n.BUILD_NUMBER||n.CI||n.CI_APP_ID||n.CI_BUILD_ID||n.CI_BUILD_NUMBER||n.CI_NAME||n.CONTINUOUS_INTEGRATION||n.RUN_ID||e.name))}(Yr);var Qr={},Zr={},en={};Object.defineProperty(en,"__esModule",{value:!0}),en.toCommandProperties=en.toCommandValue=void 0,en.toCommandValue=function(e){return null==e?"":"string"==typeof e||e instanceof String?e:JSON.stringify(e)},en.toCommandProperties=function(e){return Object.keys(e).length?{title:e.title,file:e.file,line:e.startLine,endLine:e.endLine,col:e.startColumn,endColumn:e.endColumn}:{}};var tn=Kr&&Kr.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),rn=Kr&&Kr.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),nn=Kr&&Kr.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&tn(t,e,r);return rn(t,e),t};Object.defineProperty(Zr,"__esModule",{value:!0}),Zr.issue=Zr.issueCommand=void 0;const on=nn(Tr),sn=en;Zr.issueCommand=n,Zr.issue=function(e,t=""){n(e,{},t)};class an{constructor(e,t,r){e||(e="missing.command"),this.command=e,this.properties=t,this.message=r}toString(){let e="::"+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";let r=!0;for(const n in this.properties)if(this.properties.hasOwnProperty(n)){const o=this.properties[n];o&&(r?r=!1:e+=",",e+=`${n}=${t=o,sn.toCommandValue(t).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}`)}}var t;return e+="::"+function(e){return sn.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}(this.message),e}}var cn={};const ln=new Uint8Array(256);let un=ln.length;const pn=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,fn=[];for(let dy=0;256>dy;++dy)fn.push((dy+256).toString(16).substr(1));let dn,hn,mn=0,vn=0;const yn=c("v3",48,(function(e){return Array.isArray(e)?e=Buffer.from(e):"string"==typeof e&&(e=Buffer.from(e,"utf8")),Pr.createHash("md5").update(e).digest()})),gn=c("v5",80,(function(e){return Array.isArray(e)?e=Buffer.from(e):"string"==typeof e&&(e=Buffer.from(e,"utf8")),Pr.createHash("sha1").update(e).digest()})),wn=Object.freeze(Object.defineProperty({__proto__:null,NIL:"00000000-0000-0000-0000-000000000000",parse:a,stringify:s,v1:function(e,t,r){let n=t&&r||0;const i=t||Array(16);let a=(e=e||{}).node||dn,c=void 0!==e.clockseq?e.clockseq:hn;if(null==a||null==c){const t=e.random||(e.rng||o)();null==a&&(a=dn=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==c&&(c=hn=16383&(t[6]<<8|t[7]))}let l=void 0!==e.msecs?e.msecs:Date.now(),u=void 0!==e.nsecs?e.nsecs:vn+1;const p=l-mn+(u-vn)/1e4;if(0>p&&void 0===e.clockseq&&(c=c+1&16383),(0>p||l>mn)&&void 0===e.nsecs&&(u=0),u>=1e4)throw Error("uuid.v1(): Can't create more than 10M uuids/sec");mn=l,vn=u,hn=c,l+=122192928e5;const f=(1e4*(268435455&l)+u)%4294967296;i[n++]=f>>>24&255,i[n++]=f>>>16&255,i[n++]=f>>>8&255,i[n++]=255&f;const d=l/4294967296*1e4&268435455;i[n++]=d>>>8&255,i[n++]=255&d,i[n++]=d>>>24&15|16,i[n++]=d>>>16&255,i[n++]=c>>>8|128,i[n++]=255&c;for(let o=0;6>o;++o)i[n+o]=a[o];return t||s(i)},v3:yn,v4:function(e,t,r){const n=(e=e||{}).random||(e.rng||o)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;16>e;++e)t[r+e]=n[e];return t}return s(n)},v5:gn,validate:i,version:function(e){if(!i(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}},Symbol.toStringTag,{value:"Module"})),_n=r(wn);var En=Kr&&Kr.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),bn=Kr&&Kr.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),On=Kr&&Kr.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&En(t,e,r);return bn(t,e),t};Object.defineProperty(cn,"__esModule",{value:!0}),cn.prepareKeyValueMessage=cn.issueFileCommand=void 0;const Rn=On(xr),Sn=On(Tr),In=_n,Tn=en;cn.issueFileCommand=function(e,t){const r=process.env["GITHUB_"+e];if(!r)throw Error("Unable to find environment variable for file command "+e);if(!Rn.existsSync(r))throw Error("Missing file at path: "+r);Rn.appendFileSync(r,`${Tn.toCommandValue(t)}${Sn.EOL}`,{encoding:"utf8"})},cn.prepareKeyValueMessage=function(e,t){const r="ghadelimiter_"+In.v4(),n=Tn.toCommandValue(t);if(e.includes(r))throw Error(`Unexpected input: name should not contain the delimiter "${r}"`);if(n.includes(r))throw Error(`Unexpected input: value should not contain the delimiter "${r}"`);return`${e}<<${r}${Sn.EOL}${n}${Sn.EOL}${r}`};var xn={};class Pn extends URL{_decodedUsername;_decodedPassword;constructor(e,t){super(e,t),this._decodedUsername=decodeURIComponent(super.username),this._decodedPassword=decodeURIComponent(super.password)}get username(){return this._decodedUsername}get password(){return this._decodedPassword}}var An,Nn={},$n=Cr,Cn=Nr,Ln=$r,kn=Lr,Dn=kr;Nn.httpOverHttp=function(e){var t=new u(e);return t.request=Cn.request,t},Nn.httpsOverHttp=function(e){var t=new u(e);return t.request=Cn.request,t.createSocket=p,t.defaultPort=443,t},Nn.httpOverHttps=function(e){var t=new u(e);return t.request=Ln.request,t},Nn.httpsOverHttps=function(e){var t=new u(e);return t.request=Ln.request,t.createSocket=p,t.defaultPort=443,t},Dn.inherits(u,kn.EventEmitter),u.prototype.addRequest=function(e,t,r,n){var o=this,i=d({request:e},o.options,f(t,r,n));this.maxSockets>o.sockets.length?o.createSocket(i,(function(t){function r(){o.emit("free",t,i)}function n(e){o.removeSocket(t),t.removeListener("free",r),t.removeListener("close",n),t.removeListener("agentRemove",n)}t.on("free",r),t.on("close",n),t.on("agentRemove",n),e.onSocket(t)})):o.requests.push(i)},u.prototype.createSocket=function(e,t){function r(r,i,a){var c;return s.removeAllListeners(),i.removeAllListeners(),200!==r.statusCode?(An("tunneling socket could not be established, statusCode=%d",r.statusCode),i.destroy(),(c=Error("tunneling socket could not be established, statusCode="+r.statusCode)).code="ECONNRESET",e.request.emit("error",c),void n.removeSocket(o)):a.length>0?(An("got illegal response body from proxy"),i.destroy(),(c=Error("got illegal response body from proxy")).code="ECONNRESET",e.request.emit("error",c),void n.removeSocket(o)):(An("tunneling connection has established"),n.sockets[n.sockets.indexOf(o)]=i,t(i))}var n=this,o={};n.sockets.push(o);var i=d({},n.proxyOptions,{method:"CONNECT",path:e.host+":"+e.port,agent:!1,headers:{host:e.host+":"+e.port}});e.localAddress&&(i.localAddress=e.localAddress),i.proxyAuth&&(i.headers=i.headers||{},i.headers["Proxy-Authorization"]="Basic "+new Buffer(i.proxyAuth).toString("base64")),An("making CONNECT request");var s=n.request(i);s.useChunkedEncodingByDefault=!1,s.once("response",(function(e){e.upgrade=!0})),s.once("upgrade",(function(e,t,n){process.nextTick((function(){r(e,t,n)}))})),s.once("connect",r),s.once("error",(function(t){s.removeAllListeners(),An("tunneling socket could not be established, cause=%s\n",t.message,t.stack);var r=Error("tunneling socket could not be established, cause="+t.message);r.code="ECONNRESET",e.request.emit("error",r),n.removeSocket(o)})),s.end()},u.prototype.removeSocket=function(e){var t=this.sockets.indexOf(e);if(-1!==t){this.sockets.splice(t,1);var r=this.requests.shift();r&&this.createSocket(r,(function(e){r.request.onSocket(e)}))}},An=process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?function(){var e=[].slice.call(arguments);"string"==typeof e[0]?e[0]="TUNNEL: "+e[0]:e.unshift("TUNNEL:"),console.error.apply(console,e)}:function(){},Nn.debug=An;var jn,Un,Fn,Mn,Gn,Bn=Nn;(Un=jn||(jn={}))[Un.OK=200]="OK",Un[Un.MultipleChoices=300]="MultipleChoices",Un[Un.MovedPermanently=301]="MovedPermanently",Un[Un.ResourceMoved=302]="ResourceMoved",Un[Un.SeeOther=303]="SeeOther",Un[Un.NotModified=304]="NotModified",Un[Un.UseProxy=305]="UseProxy",Un[Un.SwitchProxy=306]="SwitchProxy",Un[Un.TemporaryRedirect=307]="TemporaryRedirect",Un[Un.PermanentRedirect=308]="PermanentRedirect",Un[Un.BadRequest=400]="BadRequest",Un[Un.Unauthorized=401]="Unauthorized",Un[Un.PaymentRequired=402]="PaymentRequired",Un[Un.Forbidden=403]="Forbidden",Un[Un.NotFound=404]="NotFound",Un[Un.MethodNotAllowed=405]="MethodNotAllowed",Un[Un.NotAcceptable=406]="NotAcceptable",Un[Un.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",Un[Un.RequestTimeout=408]="RequestTimeout",Un[Un.Conflict=409]="Conflict",Un[Un.Gone=410]="Gone",Un[Un.TooManyRequests=429]="TooManyRequests",Un[Un.InternalServerError=500]="InternalServerError",Un[Un.NotImplemented=501]="NotImplemented",Un[Un.BadGateway=502]="BadGateway",Un[Un.ServiceUnavailable=503]="ServiceUnavailable",Un[Un.GatewayTimeout=504]="GatewayTimeout",(Mn=Fn||(Fn={})).Accept="accept",Mn.ContentType="content-type",(Gn||(Gn={})).ApplicationJson="application/json";const Hn=[jn.MovedPermanently,jn.ResourceMoved,jn.SeeOther,jn.TemporaryRedirect,jn.PermanentRedirect],qn=[jn.BadGateway,jn.ServiceUnavailable,jn.GatewayTimeout],Vn=["OPTIONS","GET","DELETE","HEAD"];class zn extends Error{constructor(e,t){super(e),this.name="HttpClientError",this.statusCode=t,Object.setPrototypeOf(this,zn.prototype)}statusCode;result}class Xn{constructor(e){this.message=e}message;async readBody(){return new Promise((async e=>{let t=Buffer.alloc(0);this.message.on("data",(e=>{t=Buffer.concat([t,e])})),this.message.on("end",(()=>{e(""+t)}))}))}async readBodyBuffer(){return new Promise((async e=>{const t=[];this.message.on("data",(e=>{t.push(e)})),this.message.on("end",(()=>{e(Buffer.concat(t))}))}))}}class Wn{userAgent;handlers;requestOptions;_ignoreSslError=!1;_socketTimeout;_allowRedirects=!0;_allowRedirectDowngrade=!1;_maxRedirects=50;_allowRetries=!1;_maxRetries=1;_agent;_proxyAgent;_proxyAgentDispatcher;_keepAlive=!1;_disposed=!1;constructor(e,t,r){this.userAgent=e,this.handlers=t||[],this.requestOptions=r,r&&(null!=r.ignoreSslError&&(this._ignoreSslError=r.ignoreSslError),this._socketTimeout=r.socketTimeout,null!=r.allowRedirects&&(this._allowRedirects=r.allowRedirects),null!=r.allowRedirectDowngrade&&(this._allowRedirectDowngrade=r.allowRedirectDowngrade),null!=r.maxRedirects&&(this._maxRedirects=Math.max(r.maxRedirects,0)),null!=r.keepAlive&&(this._keepAlive=r.keepAlive),null!=r.allowRetries&&(this._allowRetries=r.allowRetries),null!=r.maxRetries&&(this._maxRetries=r.maxRetries))}async options(e,t){return this.request("OPTIONS",e,null,t||{})}async get(e,t){return this.request("GET",e,null,t||{})}async del(e,t){return this.request("DELETE",e,null,t||{})}async post(e,t,r){return this.request("POST",e,t,r||{})}async patch(e,t,r){return this.request("PATCH",e,t,r||{})}async put(e,t,r){return this.request("PUT",e,t,r||{})}async head(e,t){return this.request("HEAD",e,null,t||{})}async sendStream(e,t,r,n){return this.request(e,t,r,n)}async getJson(e,t={}){t[Fn.Accept]=this._getExistingOrDefaultHeader(t,Fn.Accept,Gn.ApplicationJson);const r=await this.get(e,t);return this._processResponse(r,this.requestOptions)}async postJson(e,t,r={}){const n=JSON.stringify(t,null,2);r[Fn.Accept]=this._getExistingOrDefaultHeader(r,Fn.Accept,Gn.ApplicationJson),r[Fn.ContentType]=this._getExistingOrDefaultHeader(r,Fn.ContentType,Gn.ApplicationJson);const o=await this.post(e,n,r);return this._processResponse(o,this.requestOptions)}async putJson(e,t,r={}){const n=JSON.stringify(t,null,2);r[Fn.Accept]=this._getExistingOrDefaultHeader(r,Fn.Accept,Gn.ApplicationJson),r[Fn.ContentType]=this._getExistingOrDefaultHeader(r,Fn.ContentType,Gn.ApplicationJson);const o=await this.put(e,n,r);return this._processResponse(o,this.requestOptions)}async patchJson(e,t,r={}){const n=JSON.stringify(t,null,2);r[Fn.Accept]=this._getExistingOrDefaultHeader(r,Fn.Accept,Gn.ApplicationJson),r[Fn.ContentType]=this._getExistingOrDefaultHeader(r,Fn.ContentType,Gn.ApplicationJson);const o=await this.patch(e,n,r);return this._processResponse(o,this.requestOptions)}async request(e,t,r,n){if(this._disposed)throw Error("Client has already been disposed.");const o=new URL(t);let i=this._prepareRequest(e,o,n);const s=this._allowRetries&&Vn.includes(e)?this._maxRetries+1:1;let a,c=0;do{if(a=await this.requestRaw(i,r),a&&a.message&&a.message.statusCode===jn.Unauthorized){let e;for(const t of this.handlers)if(t.canHandleAuthentication(a)){e=t;break}return e?e.handleAuthentication(this,i,r):a}let t=this._maxRedirects;for(;a.message.statusCode&&Hn.includes(a.message.statusCode)&&this._allowRedirects&&t>0;){const s=a.message.headers.location;if(!s)break;const c=new URL(s);if("https:"===o.protocol&&o.protocol!==c.protocol&&!this._allowRedirectDowngrade)throw Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.");if(await a.readBody(),c.hostname!==o.hostname)for(const e in n)"authorization"===e.toLowerCase()&&delete n[e];i=this._prepareRequest(e,c,n),a=await this.requestRaw(i,r),t--}if(!a.message.statusCode||!qn.includes(a.message.statusCode))return a;c+=1,s>c&&(await a.readBody(),await this._performExponentialBackoff(c))}while(s>c);return a}dispose(){this._agent&&this._agent.destroy(),this._disposed=!0}async requestRaw(e,t){return new Promise(((r,n)=>{this.requestRawWithCallback(e,t,(function(e,t){e?n(e):t?r(t):n(Error("Unknown error"))}))}))}requestRawWithCallback(e,t,r){function n(e,t){o||(o=!0,r(e,t))}"string"==typeof t&&(e.options.headers||(e.options.headers={}),e.options.headers["Content-Length"]=Buffer.byteLength(t,"utf8"));let o=!1;const i=e.httpModule.request(e.options,(e=>{n(void 0,new Xn(e))}));let s;i.on("socket",(e=>{s=e})),i.setTimeout(this._socketTimeout||18e4,(()=>{s&&s.end(),n(Error("Request timeout: "+e.options.path))})),i.on("error",(function(e){n(e)})),t&&"string"==typeof t&&i.write(t,"utf8"),t&&"string"!=typeof t?(t.on("close",(function(){i.end()})),t.pipe(i)):i.end()}getAgent(e){const t=new URL(e);return this._getAgent(t)}async getAgentDispatcher(e){const t=new URL(e),r=l(t);if(r&&r.hostname)return await this._getProxyAgentDispatcher(t,r)}_prepareRequest(e,t,r){const n={};n.parsedUrl=t;const o="https:"===n.parsedUrl.protocol;n.httpModule=o?Wr:Xr;const i=o?443:80;if(n.options={},n.options.host=n.parsedUrl.hostname,n.options.port=n.parsedUrl.port?parseInt(n.parsedUrl.port):i,n.options.path=(n.parsedUrl.pathname||"")+(n.parsedUrl.search||""),n.options.method=e,n.options.headers=this._mergeHeaders(r),null!=this.userAgent&&(n.options.headers["user-agent"]=this.userAgent),n.options.agent=this._getAgent(n.parsedUrl),this.handlers)for(const s of this.handlers)s.prepareRequest(n.options);return n}_mergeHeaders(e){return this.requestOptions&&this.requestOptions.headers?Object.assign({},Kn(this.requestOptions.headers),Kn(e||{})):Kn(e||{})}_getExistingOrDefaultHeader(e,t,r){let n;return this.requestOptions&&this.requestOptions.headers&&(n=Kn(this.requestOptions.headers)[t]),e[t]||n||r}_getAgent(e){let t;const r=l(e),n=r&&r.hostname;if(this._keepAlive&&n&&(t=this._proxyAgent),n||(t=this._agent),t)return t;const o="https:"===e.protocol;let i=100;if(this.requestOptions&&(i=this.requestOptions.maxSockets||Xr.globalAgent.maxSockets),r&&r.hostname){const e={maxSockets:i,keepAlive:this._keepAlive,proxy:{...(r.username||r.password)&&{proxyAuth:`${r.username}:${r.password}`},host:r.hostname,port:r.port}};let n;const s="https:"===r.protocol;n=o?s?Bn.httpsOverHttps:Bn.httpsOverHttp:s?Bn.httpOverHttps:Bn.httpOverHttp,t=n(e),this._proxyAgent=t}if(!t){const e={keepAlive:this._keepAlive,maxSockets:i};t=o?new Wr.Agent(e):new Xr.Agent(e),this._agent=t}return o&&this._ignoreSslError&&(t.options=Object.assign(t.options||{},{rejectUnauthorized:!1})),t}async _getProxyAgentDispatcher(e,t){let r;if(this._keepAlive&&(r=this._proxyAgentDispatcher),r)return r;const n="https:"===e.protocol;return r=new(await Promise.resolve().then((()=>require("./assets/proxy-agent-BtRxTz9r.js"))).then((e=>e.proxyAgent)))({uri:t.href,pipelining:this._keepAlive?1:0,...(t.username||t.password)&&{token:"Basic "+Buffer.from(`${t.username}:${t.password}`).toString("base64")}}),this._proxyAgentDispatcher=r,n&&this._ignoreSslError&&(r.options=Object.assign(r.options.requestTls||{},{rejectUnauthorized:!1})),r}async _performExponentialBackoff(e){const t=5*Math.pow(2,e=Math.min(10,e));return new Promise((e=>setTimeout((()=>e()),t)))}async _processResponse(e,t){return new Promise((async(r,n)=>{const o=e.message.statusCode||0,i={statusCode:o,result:null,headers:{}};let s,a;o===jn.NotFound&&r(i);try{a=await e.readBody(),a&&a.length>0&&(s=t&&t.deserializeDates?JSON.parse(a,(function(e,t){if("string"==typeof t){const e=new Date(t);if(!isNaN(e.valueOf()))return e}return t})):JSON.parse(a),i.result=s),i.headers=e.message.headers}catch(c){}if(o>299){let e;e=s&&s.message?s.message:a&&a.length>0?a:`Failed request: (${o})`;const t=new zn(e,o);t.result=i.result,n(t)}else r(i)}))}}const Kn=e=>Object.keys(e).reduce(((t,r)=>(t[r.toLowerCase()]=e[r],t)),{}),Yn=r(Object.freeze(Object.defineProperty({__proto__:null,get Headers(){return Fn},HttpClient:Wn,HttpClientError:zn,HttpClientResponse:Xn,get HttpCodes(){return jn},get MediaTypes(){return Gn},getProxyUrl:function(e){const t=l(new URL(e));return t?t.href:""},isHttps:function(e){return"https:"===new URL(e).protocol}},Symbol.toStringTag,{value:"Module"})));var Jn,Qn={},Zn=Kr&&Kr.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(t){i(t)}}function a(e){try{c(n.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.PersonalAccessTokenCredentialHandler=Qn.BearerCredentialHandler=Qn.BasicCredentialHandler=void 0,Qn.BasicCredentialHandler=class{constructor(e,t){this.username=e,this.password=t}prepareRequest(e){if(!e.headers)throw Error("The request has no headers");e.headers.Authorization="Basic "+Buffer.from(`${this.username}:${this.password}`).toString("base64")}canHandleAuthentication(){return!1}handleAuthentication(){return Zn(this,void 0,void 0,(function*(){throw Error("not implemented")}))}},Qn.BearerCredentialHandler=class{constructor(e){this.token=e}prepareRequest(e){if(!e.headers)throw Error("The request has no headers");e.headers.Authorization="Bearer "+this.token}canHandleAuthentication(){return!1}handleAuthentication(){return Zn(this,void 0,void 0,(function*(){throw Error("not implemented")}))}},Qn.PersonalAccessTokenCredentialHandler=class{constructor(e){this.token=e}prepareRequest(e){if(!e.headers)throw Error("The request has no headers");e.headers.Authorization="Basic "+Buffer.from("PAT:"+this.token).toString("base64")}canHandleAuthentication(){return!1}handleAuthentication(){return Zn(this,void 0,void 0,(function*(){throw Error("not implemented")}))}};var eo,to,ro,no,oo,io,so,ao,co={},lo={},uo=m(),po={exports:{}};ao="win32"===process.platform||Kr.TESTING_WINDOWS?function(){function e(e,t,r){return!(!e.isSymbolicLink()&&!e.isFile())&&function(e,t){var r=void 0!==t.pathExt?t.pathExt:process.env.PATHEXT;if(!r)return!0;if(-1!==(r=r.split(";")).indexOf(""))return!0;for(var n=0;r.length>n;n++){var o=r[n].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}(t,r)}function t(t,n,o){r.stat(t,(function(r,i){o(r,!r&&e(i,t,n))}))}if(oo)return no;oo=1,no=t,t.sync=function(t,n){return e(r.statSync(t),t,n)};var r=xr;return no}():function(){function e(e,n,o){r.stat(e,(function(e,r){o(e,!e&&t(r,n))}))}function t(e,t){return e.isFile()&&function(e,t){var r=e.mode,n=e.uid,o=e.gid,i=void 0!==t.uid?t.uid:process.getuid&&process.getuid(),s=void 0!==t.gid?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),l=a|c;return r&parseInt("001",8)||r&c&&o===s||r&a&&n===i||r&l&&0===i}(e,t)}if(so)return io;so=1,io=e,e.sync=function(e,n){return t(r.statSync(e),n)};var r=xr;return io}();var fo=_;_.sync=function(e,t){try{return ao.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||"EACCES"===r.code)return!1;throw r}};const ho="win32"===process.platform||"cygwin"===process.env.OSTYPE||"msys"===process.env.OSTYPE,mo=Ar,vo=ho?";":":",yo=fo,go=e=>Object.assign(Error("not found: "+e),{code:"ENOENT"}),wo=(e,t)=>{const r=t.colon||vo,n=e.match(/\//)||ho&&e.match(/\\/)?[""]:[...ho?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],o=ho?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=ho?o.split(r):[""];return ho&&-1!==e.indexOf(".")&&""!==i[0]&&i.unshift(""),{pathEnv:n,pathExt:i,pathExtExe:o}},_o=(e,t,r)=>{"function"==typeof t&&(r=t,t={}),t||(t={});const{pathEnv:n,pathExt:o,pathExtExe:i}=wo(e,t),s=[],a=r=>new Promise(((o,i)=>{if(r===n.length)return t.all&&s.length?o(s):i(go(e));const a=n[r],l=/^".*"$/.test(a)?a.slice(1,-1):a,u=mo.join(l,e),p=!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;o(c(p,r,0))})),c=(e,r,n)=>new Promise(((l,u)=>{if(n===o.length)return l(a(r+1));const p=o[n];yo(e+p,{pathExt:i},((o,i)=>{if(!o&&i){if(!t.all)return l(e+p);s.push(e+p)}return l(c(e,r,n+1))}))}));return r?a(0).then((e=>r(null,e)),r):a(0)};var Eo=_o;_o.sync=(e,t)=>{t=t||{};const{pathEnv:r,pathExt:n,pathExtExe:o}=wo(e,t),i=[];for(let a=0;r.length>a;a++){const c=r[a],l=/^".*"$/.test(c)?c.slice(1,-1):c,u=mo.join(l,e),p=!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let e=0;n.length>e;e++){const r=p+n[e];try{if(yo.sync(r,{pathExt:o})){if(!t.all)return r;i.push(r)}}catch(s){}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw go(e)};var bo={exports:{}};const Oo=(e={})=>{const t=e.env||process.env;return"win32"!==(e.platform||process.platform)?"PATH":Object.keys(t).reverse().find((e=>"PATH"===e.toUpperCase()))||"Path"};bo.exports=Oo,bo.exports.default=Oo;const Ro=Ar,So=Eo,Io=bo.exports;var To={};const xo=/([()\][%!^"`<>&|;, *?])/g;To.command=function(e){return e.replace(xo,"^$1")},To.argument=function(e,t){return e=(e=`"${e=(e=(e=""+e).replace(/(\\*)"/g,'$1$1\\"')).replace(/(\\*)$/,"$1$1")}"`).replace(xo,"^$1"),t&&(e=e.replace(xo,"^$1")),e};const Po=/^#!(.*)/,Ao=xr,No=Ar,$o=function(e){return E(e)||E(e,!0)},Co=To,Lo=function(e){const t=Buffer.alloc(150);let r;try{r=Ao.openSync(e,"r"),Ao.readSync(r,t,0,150,0),Ao.closeSync(r)}catch(n){}return((e="")=>{const t=e.match(Po);if(!t)return null;const[r,n]=t[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return"env"===o?n:n?`${o} ${n}`:o})(""+t)},ko="win32"===process.platform,Do=/\.(?:com|exe)$/i,jo=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i,Uo="win32"===process.platform,Fo=Ur,Mo=function(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null);const n={command:e,args:t=t?t.slice(0):[],options:r=Object.assign({},r),file:void 0,original:{command:e,args:t}};return r.shell?n:function(e){if(!ko)return e;const t=function(e){e.file=$o(e);const t=e.file&&Lo(e.file);return t?(e.args.unshift(e.file),e.command=t,$o(e)):e.file}(e),r=!Do.test(t);if(e.options.forceShell||r){const r=jo.test(t);e.command=No.normalize(e.command),e.command=Co.command(e.command),e.args=e.args.map((e=>Co.argument(e,r)));const n=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${n}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}(n)},Go={hookChildProcess:function(e,t){if(!Uo)return;const r=e.emit;e.emit=function(n,o){if("exit"===n){const n=O(o,t);if(n)return r.call(e,"error",n)}return r.apply(e,arguments)}},verifyENOENT:O,verifyENOENTSync:function(e,t){return Uo&&1===e&&!t.file?b(t.original,"spawnSync"):null},notFoundError:b};po.exports=R,po.exports.spawn=R,po.exports.sync=function(e,t,r){const n=Mo(e,t,r),o=Fo.spawnSync(n.command,n.args,n.options);return o.error=o.error||Go.verifyENOENTSync(o.status,n),o},po.exports._parse=Mo,po.exports._enoent=Go;const Bo=t(po.exports),Ho=({env:e=jr.env,...t}={})=>{const r=S({env:e={...e}});return t.path=e[r],e[r]=(({cwd:e=jr.cwd(),path:t=jr.env[S()],preferLocal:r=!0,execPath:n=jr.execPath,addExecPath:o=!0}={})=>{const i=e instanceof URL?Gr.fileURLToPath(e):e,s=Ar.resolve(i),a=[];return r&&((e,t)=>{let r;for(;r!==t;)e.push(Ar.join(t,"node_modules/.bin")),r=t,t=Ar.resolve(t,"..")})(a,s),o&&((e,t,r)=>{const n=t instanceof URL?Gr.fileURLToPath(t):t;e.push(Ar.resolve(r,n,".."))})(a,n,s),[...a,t].join(Ar.delimiter)})(t),e},qo=(e,t,r,n)=>{if("length"===r||"prototype"===r)return;if("arguments"===r||"caller"===r)return;const o=Object.getOwnPropertyDescriptor(e,r),i=Object.getOwnPropertyDescriptor(t,r);!Vo(o,i)&&n||Object.defineProperty(e,r,i)},Vo=function(e,t){return void 0===e||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},zo=(e,t)=>`/* Wrapped ${e}*/\n${t}`,Xo=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Wo=Object.getOwnPropertyDescriptor(function(){}.toString,"name"),Ko=new WeakMap,Yo=(e,t={})=>{if("function"!=typeof e)throw new TypeError("Expected a function");let r,n=0;const o=e.displayName||e.name||"",i=function(...s){if(Ko.set(i,++n),1===n)r=e.apply(this,s),e=null;else if(!0===t.throw)throw Error(`Function \`${o}\` can only be called once`);return r};return function(e,t,{ignoreNonConfigurable:r=!1}={}){const{name:n}=e;for(const o of Reflect.ownKeys(t))qo(e,t,o,r);((e,t)=>{const r=Object.getPrototypeOf(t);r!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,r)})(e,t),((e,t,r)=>{const n=""===r?"":`with ${r.trim()}() `,o=zo.bind(null,n,""+t);Object.defineProperty(o,"name",Wo),Object.defineProperty(e,"toString",{...Xo,value:o})})(e,t,n)}(i,e),Ko.set(i,n),i};Yo.callCount=e=>{if(!Ko.has(e))throw Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return Ko.get(e)};const Jo=(e,t)=>({name:"SIGRT"+(t+1),number:Qo+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Qo=34,Zo=[{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"}],ei=()=>{const e=Array.from({length:64-Qo+1},Jo);return[...Zo,...e].map(ti)},ti=({name:e,number:t,description:r,action:n,forced:o=!1,standard:i})=>{const{signals:{[e]:s}}=Tr.constants,a=void 0!==s;return{name:e,number:a?s:t,description:r,supported:a,action:n,forced:o,standard:i}},ri=({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=(()=>{const e=ei();return Object.fromEntries(e.map(ri))})(),oi=(e,t)=>{const r=t.find((({name:t})=>Tr.constants.signals[t]===e));return void 0!==r?r:t.find((t=>t.number===e))};(()=>{const e=ei(),t=Array.from({length:65},((t,r)=>((e,t)=>{const r=oi(e,t);if(void 0===r)return{};const{name:n,description:o,supported:i,action:s,forced:a,standard:c}=r;return{[e]:{name:n,number:e,description:o,supported:i,action:s,forced:a,standard:c}}})(r,e)));Object.assign({},...t)})();const ii=({stdout:e,stderr:t,all:r,error:n,signal:o,exitCode:i,command:s,escapedCommand:a,timedOut:c,isCanceled:l,killed:u,parsed:{options:{timeout:p,cwd:f=jr.cwd()}}})=>{const d=void 0===(o=null===o?void 0:o)?void 0:ni[o].description,h=(({timedOut:e,timeout:t,errorCode:r,signal:n,signalDescription:o,exitCode:i,isCanceled:s})=>e?`timed out after ${t} milliseconds`:s?"was canceled":void 0!==r?"failed with "+r:void 0!==n?`was killed with ${n} (${o})`:void 0!==i?"failed with exit code "+i:"failed")({timedOut:c,timeout:p,errorCode:n&&n.code,signal:o,signalDescription:d,exitCode:i=null===i?void 0:i,isCanceled:l}),m=`Command ${h}: ${s}`,v="[object Error]"==={}.toString.call(n),y=v?`${m}\n${n.message}`:m,g=[y,t,e].filter(Boolean).join("\n");return v?(n.originalMessage=n.message,n.message=g):n=Error(g),n.shortMessage=y,n.command=s,n.escapedCommand=a,n.exitCode=i,n.signal=o,n.signalDescription=d,n.stdout=e,n.stderr=t,n.cwd=f,void 0!==r&&(n.all=r),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!c,n.isCanceled=l,n.killed=u&&!c,n},si=["stdin","stdout","stderr"];var ai,ci={exports:{}},li={exports:{}},ui=Kr.process;const pi=function(e){return e&&"object"==typeof e&&"function"==typeof e.removeListener&&"function"==typeof e.emit&&"function"==typeof e.reallyExit&&"function"==typeof e.listeners&&"function"==typeof e.kill&&"number"==typeof e.pid&&"function"==typeof e.on};if(pi(ui)){var fi,di=Fr,hi=(ai||(ai=1,(Ii=li).exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],"win32"!==process.platform&&Ii.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&Ii.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")),li.exports),mi=/^win/i.test(ui.platform),vi=Lr;"function"!=typeof vi&&(vi=vi.EventEmitter),ui.__signal_exit_emitter__?fi=ui.__signal_exit_emitter__:((fi=ui.__signal_exit_emitter__=new vi).count=0,fi.emitted={}),fi.infinite||(fi.setMaxListeners(1/0),fi.infinite=!0),ci.exports=function(e,t){if(!pi(Kr.process))return function(){};di.equal(typeof e,"function","a callback must be provided for exit handler"),!1===_i&&Ei();var r="exit";return t&&t.alwaysLast&&(r="afterexit"),fi.on(r,e),function(){fi.removeListener(r,e),0===fi.listeners("exit").length&&0===fi.listeners("afterexit").length&&yi()}};var yi=function(){_i&&pi(Kr.process)&&(_i=!1,hi.forEach((function(e){try{ui.removeListener(e,wi[e])}catch(t){}})),ui.emit=Ri,ui.reallyExit=bi,fi.count-=1)};ci.exports.unload=yi;var gi=function(e,t,r){fi.emitted[e]||(fi.emitted[e]=!0,fi.emit(e,t,r))},wi={};hi.forEach((function(e){wi[e]=function(){pi(Kr.process)&&ui.listeners(e).length===fi.count&&(yi(),gi("exit",null,e),gi("afterexit",null,e),mi&&"SIGHUP"===e&&(e="SIGINT"),ui.kill(ui.pid,e))}})),ci.exports.signals=function(){return hi};var _i=!1,Ei=function(){!_i&&pi(Kr.process)&&(_i=!0,fi.count+=1,hi=hi.filter((function(e){try{return ui.on(e,wi[e]),!0}catch(t){return!1}})),ui.emit=Si,ui.reallyExit=Oi)};ci.exports.load=Ei;var bi=ui.reallyExit,Oi=function(e){pi(Kr.process)&&(ui.exitCode=e||0,gi("exit",ui.exitCode,null),gi("afterexit",ui.exitCode,null),bi.call(ui,ui.exitCode))},Ri=ui.emit,Si=function(e,t){if("exit"===e&&pi(Kr.process)){void 0!==t&&(ui.exitCode=t);var r=Ri.apply(this,arguments);return gi("exit",ui.exitCode,null),gi("afterexit",ui.exitCode,null),r}return Ri.apply(this,arguments)}}else ci.exports=function(){return function(){}};var Ii;const Ti=t(ci.exports),xi=(e,t="SIGTERM",r={})=>{const n=e(t);return Pi(e,t,r,n),n},Pi=(e,t,r,n)=>{if(!Ai(t,r,n))return;const o=$i(r),i=setTimeout((()=>{e("SIGKILL")}),o);i.unref&&i.unref()},Ai=(e,{forceKillAfterTimeout:t},r)=>Ni(e)&&!1!==t&&r,Ni=e=>e===Tr.constants.signals.SIGTERM||"string"==typeof e&&"SIGTERM"===e.toUpperCase(),$i=({forceKillAfterTimeout:e=!0})=>{if(!0===e)return 5e3;if(!Number.isFinite(e)||0>e)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Ci=(e,t)=>{e.kill()&&(t.isCanceled=!0)},Li=(e,t,r)=>{if("string"==typeof r)return e[t].pipe(xr.createWriteStream(r)),e;if(T(r))return e[t].pipe(r),e;if(!(e=>e instanceof Ur.ChildProcess&&"function"==typeof e.then)(r))throw new TypeError("The second argument must be a string, a stream or an Execa child process.");if(!T(r.stdin))throw new TypeError("The target child process's stdin must be available.");return e[t].pipe(r.stdin),r};var ki={exports:{}};const{PassThrough:Di}=Mr,{constants:ji}=Dr,Ui=Mr,{promisify:Fi}=kr,Mi=e=>{e={...e};const{array:t}=e;let{encoding:r}=e;const n="buffer"===r;let o=!1;t?o=!(r||n):r=r||"utf8",n&&(r=null);const i=new Di({objectMode:o});r&&i.setEncoding(r);let s=0;const a=[];return i.on("data",(e=>{a.push(e),o?s=a.length:s+=e.length})),i.getBufferedValue=()=>t?a:n?Buffer.concat(a,s):a.join(""),i.getBufferedLength=()=>s,i},Gi=Fi(Ui.pipeline);class Bi extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}}ki.exports=x,ki.exports.buffer=(e,t)=>x(e,{...t,encoding:"buffer"}),ki.exports.array=(e,t)=>x(e,{...t,array:!0}),ki.exports.MaxBufferError=Bi;const Hi=t(ki.exports),{PassThrough:qi}=Mr,Vi=t((function(){function e(o){return Array.isArray(o)?(o.forEach(e),this):(r.push(o),o.once("end",t.bind(null,o)),o.once("error",n.emit.bind(n,"error")),o.pipe(n,{end:!1}),this)}function t(e){!(r=r.filter((function(t){return t!==e}))).length&&n.readable&&n.end()}var r=[],n=new qi({objectMode:!0});return n.setMaxListeners(0),n.add=e,n.isEmpty=function(){return 0==r.length},n.on("unpipe",t),[].slice.call(arguments).forEach(e),n})),zi=e=>{if(void 0!==e)throw new TypeError("The `input` and `inputFile` options cannot be both set.")},Xi=async(e,t)=>{if(e&&void 0!==t){e.destroy();try{return await t}catch(r){return r.bufferedData}}},Wi=(e,{encoding:t,buffer:r,maxBuffer:n})=>{if(e&&r)return t?Hi(e,{encoding:t,maxBuffer:n}):Hi.buffer(e,{maxBuffer:n})},Ki=(async()=>{})().constructor.prototype,Yi=["then","catch","finally"].map((e=>[e,Reflect.getOwnPropertyDescriptor(Ki,e)])),Ji=(e,t)=>{for(const[r,n]of Yi){const o="function"==typeof t?(...e)=>Reflect.apply(n.value,t(),e):n.value.bind(t);Reflect.defineProperty(e,r,{...n,value:o})}},Qi=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],Zi=/^[\w.-]+$/,es=/"/g,ts=(e,t)=>Qi(e,t).join(" "),rs=(e,t)=>Qi(e,t).map((e=>(e=>"string"!=typeof e||Zi.test(e)?e:`"${e.replace(es,'\\"')}"`)(e))).join(" "),ns=/ +/g,os=e=>{const t=[];for(const r of e.trim().split(ns)){const e=t[t.length-1];e&&e.endsWith("\\")?t[t.length-1]=`${e.slice(0,-1)} ${r}`:t.push(r)}return t},is=kr.debuglog("execa").enabled,ss=(e,t)=>(e+"").padStart(t,"0"),as=(e,{verbose:t})=>{t&&jr.stderr.write(`[${(()=>{const e=new Date;return`${ss(e.getHours(),2)}:${ss(e.getMinutes(),2)}:${ss(e.getSeconds(),2)}.${ss(e.getMilliseconds(),3)}`})()}] ${e}\n`)},cs=(e,t,r={})=>{const n=Bo._parse(e,t,r);return e=n.command,t=n.args,(r={maxBuffer:1e8,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:(r=n.options).cwd||jr.cwd(),execPath:jr.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:is,...r}).env=(({env:e,extendEnv:t,preferLocal:r,localDir:n,execPath:o})=>{const i=t?{...jr.env,...e}:e;return r?Ho({env:i,cwd:n,execPath:o}):i})(r),r.stdio=(e=>{if(!e)return;const{stdio:t}=e;if(void 0===t)return si.map((t=>e[t]));if((e=>si.some((t=>void 0!==e[t])))(e))throw Error("It's not possible to provide `stdio` in combination with one of "+si.map((e=>`\`${e}\``)).join(", "));if("string"==typeof t)return t;if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);return Array.from({length:Math.max(t.length,si.length)},((e,r)=>t[r]))})(r),"win32"===jr.platform&&"cmd"===Ar.basename(e,".exe")&&t.unshift("/q"),{file:e,args:t,options:r,parsed:n}},ls=(e,t,r)=>"string"==typeof t||Dr.Buffer.isBuffer(t)?e.stripFinalNewline?function(e){const t="string"==typeof e?"\r":13;return e[e.length-1]===("string"==typeof e?"\n":10)&&(e=e.slice(0,-1)),e[e.length-1]===t&&(e=e.slice(0,-1)),e}(t):t:void 0===r?void 0:"";var us={},ps={};const fs=zr.promises,{access:ds,appendFile:hs,chmod:ms,chown:vs,copyFile:ys,lchmod:gs,lchown:ws,link:_s,lstat:Es,mkdir:bs,mkdtemp:Os,open:Rs,readdir:Ss,readFile:Is,readlink:Ts,realpath:xs,rename:Ps,rmdir:As,stat:Ns,symlink:$s,truncate:Cs,unlink:Ls,utimes:ks,writeFile:Ds}=zr.promises,js="rm"in zr.promises?zr.promises.rm:kr.promisify(zr.unlink),Us=r(Object.freeze(Object.defineProperty({__proto__:null,access:ds,appendFile:hs,chmod:ms,chown:vs,copyFile:ys,default:fs,lchmod:gs,lchown:ws,link:_s,lstat:Es,mkdir:bs,mkdtemp:Os,open:Rs,readFile:Is,readdir:Ss,readlink:Ts,realpath:xs,rename:Ps,rm:js,rmdir:As,stat:Ns,symlink:$s,truncate:Cs,unlink:Ls,utimes:ks,writeFile:Ds},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(ps,"__esModule",{value:!0}),ps.sync=ps.isexe=void 0;const Fs=xr,Ms=Us;ps.isexe=async(e,t={})=>{const{ignoreErrors:r=!1}=t;try{return Gs(await(0,Ms.stat)(e),t)}catch(n){if(r||"EACCES"===n.code)return!1;throw n}},ps.sync=(e,t={})=>{const{ignoreErrors:r=!1}=t;try{return Gs((0,Fs.statSync)(e),t)}catch(n){if(r||"EACCES"===n.code)return!1;throw n}};const Gs=(e,t)=>e.isFile()&&Bs(e,t),Bs=(e,t)=>{var r,n,o,i,s,a,c,l;const u=null!=(n=t.uid)?n:null==(r=process.getuid)?void 0:r.call(process),p=null!=(s=null!=(i=t.groups)?i:null==(o=process.getgroups)?void 0:o.call(process))?s:[],f=null!=(l=null!=(c=t.gid)?c:null==(a=process.getgid)?void 0:a.call(process))?l:p[0];if(void 0===u||void 0===f)throw Error("cannot get uid or gid");const d=new Set([f,...p]),h=e.mode,m=e.uid,v=e.gid,y=parseInt("100",8),g=parseInt("010",8),w=y|g;return!!(h&parseInt("001",8)||h&g&&d.has(v)||h&y&&m===u||h&w&&0===u)};var Hs={};Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.sync=Hs.isexe=void 0;const qs=xr,Vs=Us;Hs.isexe=async(e,t={})=>{const{ignoreErrors:r=!1}=t;try{return zs(await(0,Vs.stat)(e),e,t)}catch(n){if(r||"EACCES"===n.code)return!1;throw n}},Hs.sync=(e,t={})=>{const{ignoreErrors:r=!1}=t;try{return zs((0,qs.statSync)(e),e,t)}catch(n){if(r||"EACCES"===n.code)return!1;throw n}};const zs=(e,t,r)=>e.isFile()&&((e,t)=>{const{pathExt:r=process.env.PATHEXT||""}=t,n=r.split(";");if(-1!==n.indexOf(""))return!0;for(let o=0;n.length>o;o++){const t=n[o].toLowerCase(),r=e.substring(e.length-t.length).toLowerCase();if(t&&r===t)return!0}return!1})(t,r);var Xs={};Object.defineProperty(Xs,"__esModule",{value:!0}),function(e){var t=Kr&&Kr.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=Kr&&Kr.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=Kr&&Kr.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var o in e)"default"!==o&&{}.hasOwnProperty.call(e,o)&&t(n,e,o);return r(n,e),n},o=Kr&&Kr.__exportStar||function(e,r){for(var n in e)"default"===n||{}.hasOwnProperty.call(r,n)||t(r,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.sync=e.isexe=e.posix=e.win32=void 0;const i=n(ps);e.posix=i;const s=n(Hs);e.win32=s,o(Xs,e);const a="win32"===(process.env._ISEXE_TEST_PLATFORM_||process.platform)?s:i;e.isexe=a.isexe,e.sync=a.sync}(us);const{isexe:Ws,sync:Ks}=us,{join:Ys,delimiter:Js,sep:Qs,posix:Zs}=Ar,ea="win32"===process.platform,ta=RegExp(`[${Zs.sep}${Qs===Zs.sep?"":Qs}]`.replace(/(\\)/g,"\\$1")),ra=RegExp("^\\."+ta.source),na=e=>Object.assign(Error("not found: "+e),{code:"ENOENT"}),oa=(e,{path:t=process.env.PATH,pathExt:r=process.env.PATHEXT,delimiter:n=Js})=>{const o=e.match(ta)?[""]:[...ea?[process.cwd()]:[],...(t||"").split(n)];if(ea){const t=r||[".EXE",".CMD",".BAT",".COM"].join(n),i=t.split(n).flatMap((e=>[e,e.toLowerCase()]));return e.includes(".")&&""!==i[0]&&i.unshift(""),{pathEnv:o,pathExt:i,pathExtExe:t}}return{pathEnv:o,pathExt:[""]}},ia=(e,t)=>{const r=/^".*"$/.test(e)?e.slice(1,-1):e;return(!r&&ra.test(t)?t.slice(0,2):"")+Ys(r,t)},sa=async(e,t={})=>{const{pathEnv:r,pathExt:n,pathExtExe:o}=oa(e,t),i=[];for(const s of r){const r=ia(s,e);for(const e of n){const n=r+e;if(await Ws(n,{pathExt:o,ignoreErrors:!0})){if(!t.all)return n;i.push(n)}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw na(e)};var aa=sa;sa.sync=(e,t={})=>{const{pathEnv:r,pathExt:n,pathExtExe:o}=oa(e,t),i=[];for(const s of r){const r=ia(s,e);for(const e of n){const n=r+e;if(Ks(n,{pathExt:o,ignoreErrors:!0})){if(!t.all)return n;i.push(n)}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw na(e)};const ca=t(aa);let la;var ua,pa={};$(pa,"hasSudo",(()=>C)),$(pa,"isRoot",(()=>L)),$(pa,"isSudo",(()=>k)),$(pa,"prependSudo",(()=>D)),$(pa,"defaultExecOptions",(()=>fa)),$(pa,"execRootSync",(()=>j)),$(pa,"execRoot",(()=>U));let fa={stdio:"inherit",shell:!0};$(ua={},"isAdminWindows",(()=>da)),$(ua,"isAdminPosix",(()=>ha)),$(ua,"isAdmin",(()=>G));let da=async function(){var e;if("win32"!==process.platform)return!1;try{return await P("fsutil",["dirty","query",null!=(e=process.env.systemdrive)?e:""]),!0}catch(t){return"ENOENT"===t.code&&async function(){try{return await P("fltmc"),!0}catch{return!1}}()}},ha=L;$({},"grantUserWriteAccess",(()=>B));var ma,va,ya,ga,wa,_a,Ea,ba,Oa,Ra,Sa,Ia,Ta,xa,Pa=function(e){return null!=e},Aa=Pa,Na=[].forEach,$a=Object.create,Ca=function(e){var t=$a(null);return Na.call(arguments,(function(e){Aa(e)&&function(e,t){var r;for(r in e)t[r]=e[r]}(Object(e),t)})),t},La="function"==typeof(ya=Math.sign)&&1===ya(10)&&-1===ya(-20)?Math.sign:va?ma:(va=1,ma=function(e){return isNaN(e=Number(e))||0===e?e:e>0?1:-1}),ka=Math.abs,Da=Math.floor,ja=Math.max,Ua=function(e){return ja(0,function(e){return isNaN(e)?0:0!==(e=Number(e))&&isFinite(e)?La(e)*Da(ka(e)):e}(e))},Fa=Ua,Ma=function(e,t,r){var n;return isNaN(e)?0>(n=t)?1:r&&n?n-1:n:!1!==e&&Fa(e)},Ga=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e},Ba=Pa,Ha=function(e){if(!Ba(e))throw new TypeError("Cannot use null or undefined");return e},qa=Ga,Va=Ha,za=function(){}.bind,Xa=function(){}.call,Wa=Object.keys,Ka={}.propertyIsEnumerable,Ya=(ga="forEach",function(e,t){var r,n=arguments[2],o=arguments[3];return e=Object(Va(e)),qa(t),r=Wa(e),o&&r.sort("function"==typeof o?za.call(o,e):void 0),"function"!=typeof ga&&(ga=r[ga]),Xa.call(ga,r,(function(r,o){return Ka.call(e,r)?Xa.call(t,n,e[r],r,e,o):undefined}))}),Ja={},Qa={exports:{}},Za="function"==typeof(xa=Object.assign)&&(xa(Ta={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),Ta.foo+Ta.bar+Ta.trzy==="razdwatrzy")?Object.assign:function(){if(Ia)return Sa;Ia=1;var e=Ra?Oa:(Ra=1,Oa=(_a?wa:(_a=1,wa=function(){try{return!0}catch(e){return!1}}))()?Object.keys:function(){if(ba)return Ea;ba=1;var e=Pa,t=Object.keys;return Ea=function(r){return t(e(r)?Object(r):r)}}()),t=Ha,r=Math.max;return Sa=function(n,o){var i,s,a,c=r(arguments.length,2);for(n=Object(t(n)),a=function(e){try{n[e]=o[e]}catch(t){i||(i=t)}},s=1;c>s;++s)e(o=arguments[s]).forEach(a);if(void 0!==i)throw i;return n},Sa}(),ec=Pa,tc={function:!0,object:!0},rc=function(e){return ec(e)&&tc[typeof e]||!1};!function(e){var t=Za,r=rc,n=Pa,o=Error.captureStackTrace;e.exports=function(i){var s=Error(i),a=arguments[1],c=arguments[2];return n(c)||r(a)&&(c=a,a=null),n(c)&&t(s,c),n(a)&&(s.code=a),o&&o(s,e.exports),s}}(Qa);var nc,oc,ic,sc,ac=Qa.exports,cc={exports:{}},lc=Ua;try{Object.defineProperty((function(e,t){return t}),"length",{configurable:!0,writable:!1,enumerable:!1,value:1})}catch(fy){}sc=H(),ic=function(){var e=[];return function(t){var r,n=0;if(e[t])return e[t];for(r=[];t--;)r.push("a"+(++n).toString(36));return Function("fn","return function ("+r.join(", ")+") { return fn.apply(this, arguments); };")}}(),cc.exports=function(e,t){var r;if(t=lc(t),e.length===t)return e;r=ic(t)(e);try{sc(r,e)}catch(fy){}return r};var uc,pc,fc=cc.exports,dc={exports:{}},hc=function(e){return null!=e},mc=hc,vc={object:!0,function:!0,undefined:!0},yc=function(e){if(!function(e){return!!mc(e)&&hasOwnProperty.call(vc,typeof e)}(e))return!1;try{return!!e.constructor&&e.constructor.prototype===e}catch(t){return!1}},gc=/^\s*class[\s{/}]/,wc=function(){}.toString,_c="razdwatrzy",Ec="function"==typeof _c.contains&&!0===_c.contains("dwa")&&!1===_c.contains("foo")?"".contains:function(){if(pc)return uc;pc=1;var e="".indexOf;return uc=function(t){return e.call(this,t,arguments[1])>-1}}(),bc=hc,Oc=function(e){return!!function(e){if("function"!=typeof e)return!1;if(!hasOwnProperty.call(e,"length"))return!1;try{if("number"!=typeof e.length)return!1;if("function"!=typeof e.call)return!1;if("function"!=typeof e.apply)return!1}catch(t){return!1}return!yc(e)}(e)&&!gc.test(wc.call(e))},Rc=Za,Sc=Ca,Ic=Ec;(dc.exports=function(e,t){var r,n,o,i,s;return 2>arguments.length||"string"!=typeof e?(i=t,t=e,e=null):i=arguments[2],bc(e)?(r=Ic.call(e,"c"),n=Ic.call(e,"e"),o=Ic.call(e,"w")):(r=o=!0,n=!1),s={value:t,configurable:r,enumerable:n,writable:o},i?Rc(Sc(i),s):s}).gs=function(e,t,r){var n,o,i,s;return"string"!=typeof e?(i=r,r=t,t=e,e=null):i=arguments[3],bc(t)?Oc(t)?bc(r)?Oc(r)||(i=r,r=void 0):r=void 0:(i=t,t=r=void 0):t=void 0,bc(e)?(n=Ic.call(e,"c"),o=Ic.call(e,"e")):(n=!0,o=!1),s={get:t,set:r,configurable:n,enumerable:o},i?Rc(Sc(i),s):s};var Tc=dc.exports,xc={exports:{}};!function(e,t){var r,n,o,i,s,a,c,l=Tc,u=Ga,p=function(){}.apply,f=function(){}.call,d=Object.create,h=Object.defineProperty,m=Object.defineProperties,v={}.hasOwnProperty,y={configurable:!0,enumerable:!1,writable:!0};n=function(e,t){var n,i;return u(t),i=this,r.call(this,e,n=function(){o.call(i,e,n),p.call(t,this,arguments)}),n.__eeOnceListener__=t,this},o=function(e,t){var r,n,o,i;if(u(t),!v.call(this,"__ee__"))return this;if(!(r=this.__ee__)[e])return this;if("object"==typeof(n=r[e]))for(i=0;o=n[i];++i)o!==t&&o.__eeOnceListener__!==t||(2===n.length?r[e]=n[i?0:1]:n.splice(i,1));else n!==t&&n.__eeOnceListener__!==t||delete r[e];return this},i=function(e){var t,r,n,o,i;if(v.call(this,"__ee__")&&(o=this.__ee__[e]))if("object"==typeof o){for(i=Array((r=arguments.length)-1),t=1;r>t;++t)i[t-1]=arguments[t];for(o=o.slice(),t=0;n=o[t];++t)p.call(n,this,i)}else switch(arguments.length){case 1:f.call(o,this);break;case 2:f.call(o,this,arguments[1]);break;case 3:f.call(o,this,arguments[1],arguments[2]);break;default:for(i=Array((r=arguments.length)-1),t=1;r>t;++t)i[t-1]=arguments[t];p.call(o,this,i)}},s={on:r=function(e,t){var r;return u(t),v.call(this,"__ee__")?r=this.__ee__:(r=y.value=d(null),h(this,"__ee__",y),y.value=null),r[e]?"object"==typeof r[e]?r[e].push(t):r[e]=[r[e],t]:r[e]=t,this},once:n,off:o,emit:i},a={on:l(r),once:l(n),off:l(o),emit:l(i)},c=m({},a),e.exports=t=function(e){return null==e?d(c):m(Object(e),a)},t.methods=s}(xc,xc.exports);var Pc,Ac,Nc,$c,Cc,Lc,kc,Dc,jc,Uc,Fc,Mc,Gc,Bc,Hc,qc,Vc,zc,Xc,Wc,Kc,Yc,Jc,Qc,Zc,el,tl,rl,nl,ol,il,sl,al,cl,ll,ul=xc.exports,pl=X(),fl=Array.isArray,dl=Pa,hl=Ga,ml=[].slice;ll=function(e){return this.map((function(t,r){return t?t(e[r]):e[r]})).concat(ml.call(e,this.length))};var vl,yl,gl,wl,_l,El,bl,Ol,Rl,Sl,Il,Tl,xl,Pl,Al,Nl,$l,Cl,Ll,kl,Dl,jl,Ul,Fl,Ml,Gl,Bl,Hl,ql,Vl,zl,Xl,Wl,Kl,Yl,Jl,Ql,Zl,eu,tu,ru,nu,ou,iu,su,au,cu,lu=Ga,uu=ac,pu=fc,fu=Tc,du=ul.methods,hu=function(e){return(t=e,e=fl(t)?t:pl(t)).forEach((function(e){dl(e)&&hl(e)})),ll.bind(e);var t},mu=function(){}.apply,vu=function(){}.call,yu=Object.create,gu=Object.defineProperties,wu=du.on,_u=du.emit,Eu=Ga,bu=Ya,Ou=Ja,Ru=function(e,t,r){var n,o,i,s,a,c,l,u,p,f,d,h,m,v,y,g=yu(null);return o=!1!==t?t:isNaN(e.length)?1:e.length,r.normalizer&&(f=function(e){var t;return"function"==typeof e?{set:e,get:e}:(t={get:lu(e.get)},void 0!==e.set?(t.set=lu(e.set),e.delete&&(t.delete=lu(e.delete)),e.clear&&(t.clear=lu(e.clear)),t):(t.set=t.get,t))}(r.normalizer),i=f.get,s=f.set,a=f.delete,c=f.clear),null!=r.resolvers&&(y=hu(r.resolvers)),v=i?pu((function(t){var r,o,a=arguments;if(y&&(a=y(a)),null!==(r=i(a))&&hasOwnProperty.call(g,r))return d&&n.emit("get",r,a,this),g[r];if(o=1===a.length?vu.call(e,this,a[0]):mu.call(e,this,a),null===r){if(null!==(r=i(a)))throw uu("Circular invocation","CIRCULAR_INVOCATION");r=s(a)}else if(hasOwnProperty.call(g,r))throw uu("Circular invocation","CIRCULAR_INVOCATION");return g[r]=o,h&&n.emit("set",r,null,o),o}),o):0===t?function(){var t;if(hasOwnProperty.call(g,"data"))return d&&n.emit("get","data",arguments,this),g.data;if(t=arguments.length?mu.call(e,this,arguments):vu.call(e,this),hasOwnProperty.call(g,"data"))throw uu("Circular invocation","CIRCULAR_INVOCATION");return g.data=t,h&&n.emit("set","data",null,t),t}:function(t){var r,o,i=arguments;if(y&&(i=y(arguments)),o=i[0]+"",hasOwnProperty.call(g,o))return d&&n.emit("get",o,i,this),g[o];if(r=1===i.length?vu.call(e,this,i[0]):mu.call(e,this,i),hasOwnProperty.call(g,o))throw uu("Circular invocation","CIRCULAR_INVOCATION");return g[o]=r,h&&n.emit("set",o,null,r),r},n={original:e,memoized:v,profileName:r.profileName,get:function(e){return y&&(e=y(e)),i?i(e):e[0]+""},has:function(e){return hasOwnProperty.call(g,e)},delete:function(e){var t;hasOwnProperty.call(g,e)&&(a&&a(e),t=g[e],delete g[e],m&&n.emit("delete",e,t))},clear:function(){var e=g;c&&c(),g=yu(null),n.emit("clear",e)},on:function(e,t){return"get"===e?d=!0:"set"===e?h=!0:"delete"===e&&(m=!0),wu.call(this,e,t)},emit:_u,updateEnv:function(){e=n.original}},l=i?pu((function(e){var t,r=arguments;y&&(r=y(r)),null!==(t=i(r))&&n.delete(t)}),o):0===t?function(){return n.delete("data")}:function(e){return y&&(e=y(arguments)[0]),n.delete(e)},u=pu((function(){var e,r=arguments;return 0===t?g.data:(y&&(r=y(r)),e=i?i(r):r[0]+"",g[e])})),p=pu((function(){var e,r=arguments;return 0===t?n.has("data"):(y&&(r=y(r)),null!==(e=i?i(r):r[0]+"")&&n.has(e))})),gu(v,{__memoized__:fu(!0),delete:fu(l),clear:fu(n.clear),_get:fu(u),_has:fu(p)}),n},Su=Ma,Iu={},Tu={},xu={exports:{}},Pu={},Au={},Nu={},$u={},Cu=Ca,Lu=Ma,ku=function e(t){var r,n,o;if(Eu(t),(r=Object(arguments[1])).async&&r.promise)throw Error("Options 'async' and 'promise' cannot be used together");return hasOwnProperty.call(t,"__memoized__")&&!r.force?t:(n=Su(r.length,t.length,r.async&&Ou.async),o=Ru(t,n,r),bu(Ou,(function(e,t){r[t]&&e(r[t],o,r)})),e.__profiler__&&e.__profiler__(o),o.updateEnv(),o.memoized)},Du=function(e){var t,r=Cu(arguments[1]);return r.normalizer||0!==(t=r.length=Lu(r.length,e.length,r.async))&&(r.primitive?!1===t?r.normalizer=(yl||(yl=1,vl=function(e){var t,r,n=e.length;if(!n)return"";for(t=e[r=0]+"";--n;)t+=""+e[++r];return t}),vl):t>1&&(r.normalizer=(wl||(wl=1,gl=function(e){return e?function(t){for(var r=t[0]+"",n=0,o=e;--o;)r+=""+t[++n];return r}:function(){return""}}),gl)(t)):r.normalizer=!1===t?function(){if(Pl)return xl;Pl=1;var e=W(),t=Object.create;return xl=function(){var r=0,n=[],o=t(null);return{get:function(t){var r,o=0,i=n,s=t.length;if(0===s)return i[s]||null;if(i=i[s]){for(;s-1>o;){if(-1===(r=e.call(i[0],t[o])))return null;i=i[1][r],++o}return-1===(r=e.call(i[0],t[o]))?null:i[1][r]||null}return null},set:function(t){var i,s=0,a=n,c=t.length;if(0===c)a[c]=++r;else{for(a[c]||(a[c]=[[],[]]),a=a[c];c-1>s;)-1===(i=e.call(a[0],t[s]))&&(i=a[0].push(t[s])-1,a[1].push([[],[]])),a=a[1][i],++s;-1===(i=e.call(a[0],t[s]))&&(i=a[0].push(t[s])-1),a[1][i]=++r}return o[r]=t,r},delete:function(t){var r,i=0,s=n,a=o[t],c=a.length,l=[];if(0===c)delete s[c];else if(s=s[c]){for(;c-1>i;){if(-1===(r=e.call(s[0],a[i])))return;l.push(s,r),s=s[1][r],++i}if(-1===(r=e.call(s[0],a[i])))return;for(t=s[1][r],s[0].splice(r,1),s[1].splice(r,1);!s[0].length&&l.length;)r=l.pop(),(s=l.pop())[0].splice(r,1),s[1].splice(r,1)}delete o[t]},clear:function(){n=[],o=t(null)}}},xl}()():1===t?function(){if(Nl)return Al;Nl=1;var e=W();return Al=function(){var t=0,r=[],n=[];return{get:function(t){var o=e.call(r,t[0]);return-1===o?null:n[o]},set:function(e){return r.push(e[0]),n.push(++t),t},delete:function(t){var o=e.call(n,t);-1!==o&&(r.splice(o,1),n.splice(o,1))},clear:function(){r=[],n=[]}}}}()():function(){if(Cl)return $l;Cl=1;var e=W(),t=Object.create;return $l=function(r){var n=0,o=[[],[]],i=t(null);return{get:function(t){for(var n,i=0,s=o;r-1>i;){if(-1===(n=e.call(s[0],t[i])))return null;s=s[1][n],++i}return-1===(n=e.call(s[0],t[i]))?null:s[1][n]||null},set:function(t){for(var s,a=0,c=o;r-1>a;)-1===(s=e.call(c[0],t[a]))&&(s=c[0].push(t[a])-1,c[1].push([[],[]])),c=c[1][s],++a;return-1===(s=e.call(c[0],t[a]))&&(s=c[0].push(t[a])-1),c[1][s]=++n,i[n]=t,n},delete:function(t){for(var n,s=0,a=o,c=[],l=i[t];r-1>s;){if(-1===(n=e.call(a[0],l[s])))return;c.push(a,n),a=a[1][n],++s}if(-1!==(n=e.call(a[0],l[s]))){for(t=a[1][n],a[0].splice(n,1),a[1].splice(n,1);!a[0].length&&c.length;)n=c.pop(),(a=c.pop())[0].splice(n,1),a[1].splice(n,1);delete i[t]}},clear:function(){o=[[],[]],i=t(null)}}},$l}()(t)),r.async&&function(){if(Ul)return Iu;Ul=1;var e=X(),t=K(),r=H(),n=fc,o=Y(),i=[].slice,s=function(){}.apply,a=Object.create;Ja.async=function(c,l){var u,p,f,d=a(null),h=a(null),m=l.memoized,v=l.original;l.memoized=n((function(e){var t=arguments,r=t[t.length-1];return"function"==typeof r&&(u=r,t=i.call(t,0,-1)),m.apply(p=this,f=t)}),m);try{r(l.memoized,m)}catch(fy){}l.on("get",(function(e){var t,r,n;if(u){if(d[e])return"function"==typeof d[e]?d[e]=[d[e],u]:d[e].push(u),void(u=null);t=u,r=p,n=f,u=p=f=null,o((function(){var o;hasOwnProperty.call(h,e)?(o=h[e],l.emit("getasync",e,n,r),s.call(t,o.context,o.args)):(u=t,p=r,f=n,m.apply(r,n))}))}})),l.original=function(){var t,r,n,i;return u?(t=e(arguments),r=function t(r){var n,a,c=t.id;if(null!=c){if(delete t.id,n=d[c],delete d[c],n)return a=e(arguments),l.has(c)&&(r?l.delete(c):(h[c]={context:this,args:a},l.emit("setasync",c,"function"==typeof n?1:n.length))),"function"==typeof n?i=s.call(n,this,a):n.forEach((function(e){i=s.call(e,this,a)}),this),i}else o(s.bind(t,this,arguments))},n=u,u=p=f=null,t.push(r),i=s.call(v,this,t),r.cb=n,u=r,i):s.call(v,this,arguments)},l.on("set",(function(e){u?(d[e]?"function"==typeof d[e]?d[e]=[d[e],u.cb]:d[e].push(u.cb):d[e]=u.cb,delete u.cb,u.id=e,u=null):l.delete(e)})),l.on("delete",(function(e){var t;hasOwnProperty.call(d,e)||h[e]&&(t=h[e],delete h[e],l.emit("deleteasync",e,i.call(t.args,1)))})),l.on("clear",(function(){var e=h;h=a(null),l.emit("clearasync",t(e,(function(e){return i.call(e.args,1)})))}))}}(),r.promise&&Z(),r.dispose&&function(){if(Zl)return Pu;Zl=1;var e=Ga,t=Ya,r=Ja,n=function(){}.apply;r.dispose=function(o,i,s){var a;if(e(o),s.async&&r.async||s.promise&&r.promise)return i.on("deleteasync",a=function(e,t){n.call(o,null,t)}),void i.on("clearasync",(function(e){t(e,(function(e,t){a(t,e)}))}));i.on("delete",a=function(e,t){o(t)}),i.on("clear",(function(e){t(e,(function(e,t){a(t,e)}))}))}}(),r.maxAge&&function(){if(ou)return Au;ou=1;var e=X(),t=Ya,r=Y(),n=Q(),o=function(){if(nu)return ru;nu=1;var e=Ua,t=tu?eu:(tu=1,eu=2147483647);return ru=function(r){if((r=e(r))>t)throw new TypeError(r+" exceeds maximum possible timeout");return r}}(),i=Ja,s=Function.prototype,a=Math.max,c=Math.min,l=Object.create;i.maxAge=function(u,p,f){var d,h,m,v;(u=o(u))&&(d=l(null),p.on("set"+(h=f.async&&i.async||f.promise&&i.promise?"async":""),(function(e){d[e]=setTimeout((function(){p.delete(e)}),u),"function"==typeof d[e].unref&&d[e].unref(),v&&(v[e]&&"nextTick"!==v[e]&&clearTimeout(v[e]),v[e]=setTimeout((function(){delete v[e]}),m),"function"==typeof v[e].unref&&v[e].unref())})),p.on("delete"+h,(function(e){clearTimeout(d[e]),delete d[e],v&&("nextTick"!==v[e]&&clearTimeout(v[e]),delete v[e])})),f.preFetch&&(m=!0===f.preFetch||isNaN(f.preFetch)?.333:a(c(Number(f.preFetch),1),0))&&(v={},m=(1-m)*u,p.on("get"+h,(function(t,o,i){v[t]||(v[t]="nextTick",r((function(){var r;"nextTick"===v[t]&&(delete v[t],p.delete(t),f.async&&(o=e(o)).push(s),r=p.memoized.apply(i,o),f.promise&&n(r)&&("function"==typeof r.done?r.done(s,s):r.then(s,s)))})))}))),p.on("clear"+h,(function(){t(d,(function(e){clearTimeout(e)})),d={},v&&(t(v,(function(e){"nextTick"!==e&&clearTimeout(e)})),v={})})))}}(),r.max&&function(){if(au)return Nu;au=1;var e=Ua,t=function(){if(su)return iu;su=1;var e=Ua,t=Object.create,r={}.hasOwnProperty;return iu=function(n){var o,i=0,s=1,a=t(null),c=t(null),l=0;return n=e(n),{hit:function(e){var t=c[e],u=++l;if(a[u]=e,c[e]=u,!t){if(++i,n>=i)return;return o(e=a[s]),e}if(delete a[t],s===t)for(;!r.call(a,++s);)continue},delete:o=function(e){var t=c[e];if(t&&(delete a[t],delete c[e],--i,s===t)){if(!i)return l=0,void(s=1);for(;!r.call(a,++s);)continue}},clear:function(){i=0,s=1,a=t(null),c=t(null),l=0}}}}(),r=Ja;r.max=function(n,o,i){var s,a,c;(n=e(n))&&(a=t(n),o.on("set"+(s=i.async&&r.async||i.promise&&r.promise?"async":""),c=function(e){void 0!==(e=a.hit(e))&&o.delete(e)}),o.on("get"+s,c),o.on("delete"+s,a.delete),o.on("clear"+s,a.clear))}}(),r.refCounter&&function(){if(cu)return $u;cu=1;var e=Tc,t=Ja,r=Object.create,n=Object.defineProperties;t.refCounter=function(o,i,s){var a,c;a=r(null),i.on("set"+(c=s.async&&t.async||s.promise&&t.promise?"async":""),(function(e,t){a[e]=t||1})),i.on("get"+c,(function(e){++a[e]})),i.on("delete"+c,(function(e){delete a[e]})),i.on("clear"+c,(function(){a={}})),n(i.memoized,{deleteRef:e((function(){var e=i.get(arguments);return null===e?null:a[e]?! --a[e]&&(i.delete(e),!0):null})),getRefCount:e((function(){var e=i.get(arguments);return null===e?0:a[e]?a[e]:0}))})}}(),ku(e,r)};const ju=t(Du),Uu=/^~(?=$|\/|\\)/,{appendFile:Fu,readFile:Mu,writeFile:Gu}=xr.promises,Bu=te("~/.bashrc"),Hu=ju((async function(e){const t=void 0===e.guard?`\nsource "${e.rcPath}"\n`:`\n# ${e.guard}\nif [[ "$SOURCE_${e.guard.toUpperCase()}RC" != 0 && -f "${e.rcPath}" ]]; then source "${e.rcPath}"; fi\n`;try{await Promise.all([re(e),ne(t,te("~/.bashrc")),ne(t,te("~/.profile"))])}catch(r){y(`Failed to add ${t} to .profile or .bashrc. You should add it manually: ${r}`)}}),{promise:!0}),qu=Tr,Vu="win32"!==qu.platform(),zu=qu.release(),Xu=/(\d+\.\d+)\.(\d+)/,Wu=t((function(e){return Vu?e.replace(/(\s+)/g,"\\$1"):((e="",t="")=>/1\d+\.\d+/.test(e)&&Number(t)>=17134.1184)(...Xu.exec(zu).splice(1))?e:e.replace(/(\s+)/g,"%20")}));var Ku,Yu,Ju,Qu,Zu={exports:{}};Ju=function(){if(Yu)return Ku;Yu=1;var e=/[|\\{}()[\]^$+*?.]/g;return Ku=function(t){if("string"!=typeof t)throw new TypeError("Expected a string");return t.replace(e,"\\$&")}}(),Qu=function(e){return e.split("").reverse().join("")},Zu.exports=function(e,t,r){var n;return null==t&&(t="'"),null==r&&(r="\\"),"string"!=typeof e?e:(n=RegExp("(["+Ju(t)+"])(?!"+Ju(r)+")","g"),Qu(Qu(e).replace(n,"$1"+r)))};const ep=t(Zu.exports),{appendFile:tp}=xr.promises,{appendFile:rp}=xr.promises,np=[/\/usr\/bin\/?/,/\/usr\/local\/bin\/?/];var op={exports:{}};!function(e){!function(){function t(e,t,o){if(r(e),"object"!=typeof o)throw Error("List of variants should be specified as an object");var i=n[e](t);return void 0!==o[i]?o[i]:null}function r(e){(function(e){return void 0!==n[e]})(e)||function(e){try{ce(__dirname+"/../locales/"+e+".js")}catch(t){throw Error("Failed to load the following locale: "+e)}}(e)}var n={};e.exports={create:function(e){return r(e),{pluralize:function(r,n){return t(e,r,n)}}},addLocale:function(e,t){n[e]=t},pluralize:t}}()}(op);var ip=op.exports,sp=ip;const ap=t(sp);var cp={};ip.addLocale("en",(function(e){var t=Math.floor(Math.abs(e)),r=(""+e).replace(/^[^.]*\.?/,"").length;return"string"==typeof e&&(e=parseInt(e,10)),1===t&&0===r?"one":"other"}));var lp={exports:{}};lp.exports=!("undefined"==typeof process||!process.versions||!process.versions.node);const up=sp,pp=lp.exports,fp=[["years",290304e5],["months",24192e5],["weeks",6048e5],["days",864e5],["hours",36e5],["minutes",6e4],["seconds",1e3]],dp={locale:"en",span:2,delimiter:", ",unitType:"long",unitTypeLookupOrder:["long","short","narrow"],autoloadLocales:!0},hp={},mp=t({create:function(e){return e=Object.assign({},dp,e||{}),{format:function(t,r,n){return function(e,t,r){if(function(e,t){const{autoload:r}=t;if(!hp[e]){if(!pp||!r)throw Error(`Missing locale: ${e}, you must load it manually before using it`);!function(e){try{le(ce(`../locales/${e}.js`))}catch(t){throw Error(`Failed to load locale: ${e} from ../locales/${e}.js. If using a bundled time-delta, set 'autoloadLocales: false' in the config: ${t}`)}}(e)}}(r.locale,{autoload:r.autoloadLocales}),!e)throw Error("Missing first date argument");if(!t)throw Error("Missing second date argument");const n=function(e,t){let r=t-e;const n=[];return fp.some((function(e){const t=e[0],o=e[1],i=Math.floor(r/o);if(r-=i*o,n.push([t,i]),0>=r)return!0})),n}(e,t),o=[];for(const i of n){const[e,t]=i;if(t>0&&o.push(ue(e,t,r)),o.length>=r.span)break}return o.join(r.delimiter)}(t,r,n=Object.assign({},e,n||{}))}}},addLocale:le,defaultConfig:dp}),vp=t({id:"en",data:{long:{years:{one:"{0} year",other:"{0} years"},months:{one:"{0} month",other:"{0} months"},weeks:{one:"{0} week",other:"{0} weeks"},days:{one:"{0} day",other:"{0} days"},hours:{one:"{0} hour",other:"{0} hours"},minutes:{one:"{0} minute",other:"{0} minutes"},seconds:{one:"{0} second",other:"{0} seconds"}},narrow:{years:{one:"{0}y",other:"{0}y"},months:{one:"{0}m",other:"{0}m"},weeks:{one:"{0}w",other:"{0}w"},days:{one:"{0}d",other:"{0}d"},hours:{one:"{0}h",other:"{0}h"},minutes:{one:"{0}m",other:"{0}m"},seconds:{one:"{0}s",other:"{0}s"}},short:{years:{one:"{0} yr",other:"{0} yrs"},months:{one:"{0} mth",other:"{0} mths"},weeks:{one:"{0} wk",other:"{0} wks"},days:{one:"{0} day",other:"{0} days"},hours:{one:"{0} hr",other:"{0} hr"},minutes:{one:"{0} min",other:"{0} min"},seconds:{one:"{0} sec",other:"{0} sec"}}}});var yp={exports:{}},gp={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},wp="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};!function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:o}=gp,i=wp,s=(t=e.exports={}).re=[],a=t.safeRe=[],c=t.src=[],l=t.t={};let u=0;const p="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",o],[p,n]],d=(e,t,r)=>{const n=(e=>{for(const[t,r]of f)e=e.split(t+"*").join(`${t}{0,${r}}`).split(t+"+").join(`${t}{1,${r}}`);return e})(t),o=u++;i(e,o,t),l[e]=o,c[o]=t,s[o]=RegExp(t,r?"g":void 0),a[o]=RegExp(n,r?"g":void 0)};d("NUMERICIDENTIFIER","0|[1-9]\\d*"),d("NUMERICIDENTIFIERLOOSE","\\d+"),d("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${p}*`),d("MAINVERSION",`(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`),d("MAINVERSIONLOOSE",`(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`),d("PRERELEASEIDENTIFIER",`(?:${c[l.NUMERICIDENTIFIER]}|${c[l.NONNUMERICIDENTIFIER]})`),d("PRERELEASEIDENTIFIERLOOSE",`(?:${c[l.NUMERICIDENTIFIERLOOSE]}|${c[l.NONNUMERICIDENTIFIER]})`),d("PRERELEASE",`(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`),d("PRERELEASELOOSE",`(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`),d("BUILDIDENTIFIER",p+"+"),d("BUILD",`(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`),d("FULLPLAIN",`v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`),d("FULL",`^${c[l.FULLPLAIN]}$`),d("LOOSEPLAIN",`[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`),d("LOOSE",`^${c[l.LOOSEPLAIN]}$`),d("GTLT","((?:<|>)?=?)"),d("XRANGEIDENTIFIERLOOSE",c[l.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*"),d("XRANGEIDENTIFIER",c[l.NUMERICIDENTIFIER]+"|x|X|\\*"),d("XRANGEPLAIN",`[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`),d("XRANGEPLAINLOOSE",`[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`),d("XRANGE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`),d("XRANGELOOSE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`),d("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),d("COERCE",c[l.COERCEPLAIN]+"(?:$|[^\\d])"),d("COERCEFULL",c[l.COERCEPLAIN]+`(?:${c[l.PRERELEASE]})?(?:${c[l.BUILD]})?(?:$|[^\\d])`),d("COERCERTL",c[l.COERCE],!0),d("COERCERTLFULL",c[l.COERCEFULL],!0),d("LONETILDE","(?:~>?)"),d("TILDETRIM",`(\\s*)${c[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",d("TILDE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`),d("TILDELOOSE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`),d("LONECARET","(?:\\^)"),d("CARETTRIM",`(\\s*)${c[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",d("CARET",`^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`),d("CARETLOOSE",`^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`),d("COMPARATORLOOSE",`^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`),d("COMPARATOR",`^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`),d("COMPARATORTRIM",`(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",d("HYPHENRANGE",`^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`),d("HYPHENRANGELOOSE",`^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`),d("STAR","(<|>)?=?\\s*\\*"),d("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),d("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(yp,yp.exports);var _p=yp.exports;const Ep=Object.freeze({loose:!0}),bp=Object.freeze({});var Op=e=>e?"object"!=typeof e?Ep:e:bp;const Rp=/^[0-9]+$/,Sp=(e,t)=>{const r=Rp.test(e),n=Rp.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:t>e?-1:1};var Ip={compareIdentifiers:Sp,rcompareIdentifiers:(e,t)=>Sp(t,e)};const Tp=wp,{MAX_LENGTH:xp,MAX_SAFE_INTEGER:Pp}=gp,{safeRe:Ap,t:Np}=_p,$p=Op,{compareIdentifiers:Cp}=Ip;var Lp=class e{constructor(t,r){if(r=$p(r),t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if("string"!=typeof t)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>xp)throw new TypeError(`version is longer than ${xp} characters`);Tp("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?Ap[Np.LOOSE]:Ap[Np.FULL]);if(!n)throw new TypeError("Invalid Version: "+t);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Pp||0>this.major)throw new TypeError("Invalid major version");if(this.minor>Pp||0>this.minor)throw new TypeError("Invalid minor version");if(this.patch>Pp||0>this.patch)throw new TypeError("Invalid patch version");this.prerelease=n[4]?n[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&Pp>t)return t}return e})):[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version}toString(){return this.version}compare(t){if(Tp("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if("string"==typeof t&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),Cp(this.major,t.major)||Cp(this.minor,t.minor)||Cp(this.patch,t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{const e=this.prerelease[r],n=t.prerelease[r];if(Tp("prerelease compare",r,e,n),void 0===e&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===e)return-1;if(e!==n)return Cp(e,n)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{const e=this.build[r],n=t.build[r];if(Tp("build compare",r,e,n),void 0===e&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===e)return-1;if(e!==n)return Cp(e,n)}while(++r)}inc(e,t,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(!t&&!1===r)throw Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===Cp(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw Error("invalid increment argument: "+e)}return this.raw=this.format(),this.build.length&&(this.raw+="+"+this.build.join(".")),this}};const kp=Lp;var Dp=(e,t,r=!1)=>{if(e instanceof kp)return e;try{return new kp(e,t)}catch(n){if(!r)return null;throw n}};const jp=Dp;var Up=(e,t)=>{const r=jp(e,t);return r?r.version:null};const Fp=t(Up),Mp=Dp;const Gp=Lp;const Bp=Dp;const Hp=Lp;var qp=(e,t)=>new Hp(e,t).major;const Vp=t(qp),zp=Lp;const Xp=Lp;const Wp=Dp;const Kp=Lp;var Yp=(e,t,r)=>new Kp(e,r).compare(new Kp(t,r));const Jp=t(Yp),Qp=Yp;const Zp=Yp;const ef=Lp;var tf=(e,t,r)=>{const n=new ef(e,r),o=new ef(t,r);return n.compare(o)||n.compareBuild(o)};const rf=tf;const nf=tf;const of=Yp;var sf=(e,t,r)=>of(e,t,r)>0;const af=Yp;var cf=(e,t,r)=>0>af(e,t,r);const lf=Yp;var uf=(e,t,r)=>0===lf(e,t,r);const pf=Yp;var ff=(e,t,r)=>0!==pf(e,t,r);const df=Yp;var hf=(e,t,r)=>df(e,t,r)>=0;const mf=Yp;var vf=(e,t,r)=>0>=mf(e,t,r);const yf=t(vf),gf=uf,wf=ff,_f=sf,Ef=hf,bf=cf,Of=vf;var Rf=(e,t,r,n)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return gf(e,r,n);case"!=":return wf(e,r,n);case">":return _f(e,r,n);case">=":return Ef(e,r,n);case"<":return bf(e,r,n);case"<=":return Of(e,r,n);default:throw new TypeError("Invalid operator: "+t)}};const Sf=Lp,If=Dp,{safeRe:Tf,t:xf}=_p;var Pf=(e,t)=>{if(e instanceof Sf)return e;if("number"==typeof e&&(e+=""),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){const n=t.includePrerelease?Tf[xf.COERCERTLFULL]:Tf[xf.COERCERTL];let o;for(;(o=n.exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&o.index+o[0].length===r.index+r[0].length||(r=o),n.lastIndex=o.index+o[1].length+o[2].length;n.lastIndex=-1}else r=e.match(t.includePrerelease?Tf[xf.COERCEFULL]:Tf[xf.COERCE]);return null===r?null:If(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}${t.includePrerelease&&r[5]?"-"+r[5]:""}${t.includePrerelease&&r[6]?"+"+r[6]:""}`,t)};const Af=t(Pf);var Nf,$f,Cf,Lf,kf=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}};const Df=pe();var jf=(e,t,r)=>{try{t=new Df(t,r)}catch(n){return!1}return t.test(e)};const Uf=pe();const Ff=Lp,Mf=pe();const Gf=Lp,Bf=pe();const Hf=Lp,qf=pe(),Vf=sf;const zf=pe();const Xf=Lp,Wf=fe(),{ANY:Kf}=Wf,Yf=pe(),Jf=jf,Qf=sf,Zf=cf,ed=vf,td=hf;var rd=(e,t,r,n)=>{let o,i,s,a,c;switch(e=new Xf(e,n),t=new Yf(t,n),r){case">":o=Qf,i=ed,s=Zf,a=">",c=">=";break;case"<":o=Zf,i=td,s=Qf,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Jf(e,t,n))return!1;for(let l=0;t.set.length>l;++l){let r=null,u=null;if(t.set[l].forEach((e=>{e.semver===Kf&&(e=new Wf(">=0.0.0")),r=r||e,u=u||e,o(e.semver,r.semver,n)?r=e:s(e.semver,u.semver,n)&&(u=e)})),r.operator===a||r.operator===c)return!1;if((!u.operator||u.operator===a)&&i(e,u.semver))return!1;if(u.operator===c&&s(e,u.semver))return!1}return!0};const nd=rd;const od=rd;const id=pe();const sd=jf,ad=Yp,cd=pe(),ld=fe(),{ANY:ud}=ld,pd=jf,fd=Yp,dd=[new ld(">=0.0.0-0")],hd=[new ld(">=0.0.0")],md=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===ud){if(1===t.length&&t[0].semver===ud)return!0;e=r.includePrerelease?dd:hd}if(1===t.length&&t[0].semver===ud){if(r.includePrerelease)return!0;t=hd}const n=new Set;let o,i,s,a,c,l,u;for(const d of e)">"===d.operator||">="===d.operator?o=vd(o,d,r):"<"===d.operator||"<="===d.operator?i=yd(i,d,r):n.add(d.semver);if(n.size>1)return null;if(o&&i){if(s=fd(o.semver,i.semver,r),s>0)return null;if(0===s&&(">="!==o.operator||"<="!==i.operator))return null}for(const d of n){if(o&&!pd(d,o+"",r))return null;if(i&&!pd(d,i+"",r))return null;for(const e of t)if(!pd(d,e+"",r))return!1;return!0}let p=!(!i||r.includePrerelease||!i.semver.prerelease.length)&&i.semver,f=!(!o||r.includePrerelease||!o.semver.prerelease.length)&&o.semver;p&&1===p.prerelease.length&&"<"===i.operator&&0===p.prerelease[0]&&(p=!1);for(const d of t){if(u=u||">"===d.operator||">="===d.operator,l=l||"<"===d.operator||"<="===d.operator,o)if(f&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===f.major&&d.semver.minor===f.minor&&d.semver.patch===f.patch&&(f=!1),">"===d.operator||">="===d.operator){if(a=vd(o,d,r),a===d&&a!==o)return!1}else if(">="===o.operator&&!pd(o.semver,d+"",r))return!1;if(i)if(p&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===p.major&&d.semver.minor===p.minor&&d.semver.patch===p.patch&&(p=!1),"<"===d.operator||"<="===d.operator){if(c=yd(i,d,r),c===d&&c!==i)return!1}else if("<="===i.operator&&!pd(i.semver,d+"",r))return!1;if(!d.operator&&(i||o)&&0!==s)return!1}return!(o&&l&&!i&&0!==s||i&&u&&!o&&0!==s||f||p)},vd=(e,t,r)=>{if(!e)return t;const n=fd(e.semver,t.semver,r);return n>0?e:0>n||">"===t.operator&&">="===e.operator?t:e},yd=(e,t,r)=>{if(!e)return t;const n=fd(e.semver,t.semver,r);return 0>n?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};const gd=_p,wd=gp,_d=Lp,Ed=Ip;var bd={parse:Dp,valid:Up,clean:(e,t)=>{const r=Mp(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null},inc:(e,t,r,n,o)=>{"string"==typeof r&&(o=n,n=r,r=void 0);try{return new Gp(e instanceof Gp?e.version:e,r).inc(t,n,o).version}catch(i){return null}},diff:(e,t)=>{const r=Bp(e,null,!0),n=Bp(t,null,!0),o=r.compare(n);if(0===o)return null;const i=o>0,s=i?r:n,a=i?n:r,c=!!s.prerelease.length;if(a.prerelease.length&&!c)return a.patch||a.minor?s.patch?"patch":s.minor?"minor":"major":"major";const l=c?"pre":"";return r.major!==n.major?l+"major":r.minor!==n.minor?l+"minor":r.patch!==n.patch?l+"patch":"prerelease"},major:qp,minor:(e,t)=>new zp(e,t).minor,patch:(e,t)=>new Xp(e,t).patch,prerelease:(e,t)=>{const r=Wp(e,t);return r&&r.prerelease.length?r.prerelease:null},compare:Yp,rcompare:(e,t,r)=>Qp(t,e,r),compareLoose:(e,t)=>Zp(e,t,!0),compareBuild:tf,sort:(e,t)=>e.sort(((e,r)=>rf(e,r,t))),rsort:(e,t)=>e.sort(((e,r)=>nf(r,e,t))),gt:sf,lt:cf,eq:uf,neq:ff,gte:hf,lte:vf,cmp:Rf,coerce:Pf,Comparator:fe(),Range:pe(),satisfies:jf,toComparators:(e,t)=>new Uf(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" "))),maxSatisfying:(e,t,r)=>{let n=null,o=null,i=null;try{i=new Mf(t,r)}catch(s){return null}return e.forEach((e=>{i.test(e)&&(n&&-1!==o.compare(e)||(n=e,o=new Ff(n,r)))})),n},minSatisfying:(e,t,r)=>{let n=null,o=null,i=null;try{i=new Bf(t,r)}catch(s){return null}return e.forEach((e=>{i.test(e)&&(n&&1!==o.compare(e)||(n=e,o=new Gf(n,r)))})),n},minVersion:(e,t)=>{e=new qf(e,t);let r=new Hf("0.0.0");if(e.test(r))return r;if(r=new Hf("0.0.0-0"),e.test(r))return r;r=null;for(let n=0;e.set.length>n;++n){let t=null;e.set[n].forEach((e=>{const r=new Hf(e.semver.version);switch(e.operator){case">":0===r.prerelease.length?r.patch++:r.prerelease.push(0),r.raw=r.format();case"":case">=":t&&!Vf(r,t)||(t=r);break;case"<":case"<=":break;default:throw Error("Unexpected operation: "+e.operator)}})),!t||r&&!Vf(r,t)||(r=t)}return r&&e.test(r)?r:null},validRange:(e,t)=>{try{return new zf(e,t).range||"*"}catch(r){return null}},outside:rd,gtr:(e,t,r)=>nd(e,t,">",r),ltr:(e,t,r)=>od(e,t,"<",r),intersects:(e,t,r)=>(e=new id(e,r),t=new id(t,r),e.intersects(t,r)),simplifyRange:(e,t,r)=>{const n=[];let o=null,i=null;const s=e.sort(((e,t)=>ad(e,t,r)));for(const l of s)sd(l,t,r)?(i=l,o||(o=l)):(i&&n.push([o,i]),i=null,o=null);o&&n.push([o,null]);const a=[];for(const[l,u]of n)a.push(l===u?l:u||l!==s[0]?u?l===s[0]?"<="+u:`${l} - ${u}`:">="+l:"*");const c=a.join(" || ");return("string"==typeof t.raw?t.raw:t+"").length>c.length?c:t},subset:(e,t,r={})=>{if(e===t)return!0;e=new cd(e,r),t=new cd(t,r);let n=!1;e:for(const o of e.set){for(const e of t.set){const t=md(o,e,r);if(n=n||null!==t,t)continue e}if(n)return!1}return!0},SemVer:_d,re:gd.re,src:gd.src,tokens:gd.t,SEMVER_SPEC_VERSION:wd.SEMVER_SPEC_VERSION,RELEASE_TYPES:wd.RELEASE_TYPES,compareIdentifiers:Ed.compareIdentifiers,rcompareIdentifiers:Ed.rcompareIdentifiers},Od=bd,Rd=Tr,Sd=Ar,Id=xr,Td=$r,xd=jr.env.npm_package_json,Pd=jr.env.npm_config_user_agent,Ad=!(!Pd||!Pd.startsWith("npm")),Nd=!(!xd||!xd.endsWith("package.json")),$d=Ad||Nd,Cd=!(!Pd||!Pd.startsWith("yarn")),Ld=$d||Cd,kd=Rd.homedir(),Dd=process.env.XDG_CONFIG_HOME||Sd.join(kd,".config","simple-update-notifier"),jd=function(e){return Sd.join(Dd,"".concat(e.replace("@","").replace("/","__"),".json"))},Ud=function(e,t){return de(void 0,0,void 0,(function(){var r;return he(this,(function(n){return r="https://registry.npmjs.org/-/package/".concat(e,"/dist-tags"),[2,new Promise((function(e,n){Td.get(r,(function(r){var o="";r.on("data",(function(e){return o+=e})),r.on("end",(function(){try{var r=JSON.parse(o)[t];r||n(Error("Error getting version")),e(r)}catch(i){n(Error("Could not parse version response"))}}))})).on("error",(function(e){return n(e)}))}))]}))}))},Fd=function(e){var t=e.pkg,r=e.updateCheckInterval,n=void 0===r?864e5:r,o=e.distTag,i=void 0===o?"latest":o,s=e.alwaysRun,a=e.debug;return de(void 0,0,void 0,(function(){var r,o;return he(this,(function(c){switch(c.label){case 0:return Id.existsSync(Dd)||Id.mkdirSync(Dd,{recursive:!0}),r=function(t){var r=jd(t);try{if(!Id.existsSync(r))return;return JSON.parse(Id.readFileSync(r,"utf8")).lastUpdateCheck}catch(e){return}}(t.name),s||!r||r<(new Date).getTime()-n?[4,Ud(t.name,i)]:[3,2];case 1:return o=c.sent(),l=jd(t.name),Id.writeFileSync(l,JSON.stringify({lastUpdateCheck:(new Date).getTime()})),Od.gt(o,t.version)?[2,o]:(a&&console.error("Latest version (".concat(o,") not newer than current version (").concat(t.version,")")),[3,3]);case 2:a&&console.error("Too recent to check for a new update. simpleUpdateNotifier() interval set to ".concat(n,"ms but only ").concat((new Date).getTime()-r,"ms since last check.")),c.label=3;case 3:return[2,!1]}var l}))}))};const Md=t((function(e){return de(void 0,0,void 0,(function(){var t,r;return he(this,(function(n){switch(n.label){case 0:if(!e.alwaysRun&&(!process.stdout.isTTY||Ld&&!e.shouldNotifyInNpmScript))return e.debug&&console.error("Opting out of running simpleUpdateNotifier()"),[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,Fd(e)];case 2:return(t=n.sent())&&console.error(function(e){for(var t=e.split("\n"),r=Math.max.apply(Math,t.map((function(e){return e.length}))),n=["┌".concat("─".repeat(r+2),"┐")],o=0,i=t;i.length>o;o++)n.push("│ ".concat(i[o].padEnd(r)," │"));return n.push("└".concat("─".repeat(r+2),"┘")),n.join("\n")}("New version of ".concat(e.pkg.name," available!\nCurrent Version: ").concat(e.pkg.version,"\nLatest Version: ").concat(t))),[3,4];case 3:return r=n.sent(),e.debug&&r instanceof Error&&console.error("Unexpected error in simpleUpdateNotifier():",r),[3,4];case 4:return[2]}}))}))})),Gd={name:"setup-cpp",version:"0.43.0"};var Bd={};!function(e){function t(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)({}).hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}Object.defineProperty(e,"__esModule",{value:!0}),e.DownloaderHelper=e.DH_STATES=void 0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function e(e,t){for(var r,n=0;t.length>n;n++)(r=t[n]).enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=t(xr),s=Gr,a=t(Ar),c=t(Nr),l=t($r),u=Lr,p=e.DH_STATES={IDLE:"IDLE",SKIPPED:"SKIPPED",STARTED:"STARTED",DOWNLOADING:"DOWNLOADING",RETRY:"RETRY",PAUSED:"PAUSED",RESUMED:"RESUMED",STOPPED:"STOPPED",FINISHED:"FINISHED",FAILED:"FAILED"};e.DownloaderHelper=function(e){function t(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{captureRejections:!0}));return i.__validate(e,n)?(i.url=i.requestURL=e.trim(),i.state=p.IDLE,i.__defaultOpts={body:null,retry:!1,method:"GET",headers:{},fileName:"",timeout:-1,metadata:null,override:!1,forceResume:!1,removeOnStop:!0,removeOnFail:!0,progressThrottle:1e3,httpRequestOptions:{},httpsRequestOptions:{},resumeOnIncomplete:!0,resumeIfFileExists:!1,resumeOnIncompleteMaxRetry:5},i.__opts=Object.assign({},i.__defaultOpts),i.__pipes=[],i.__total=0,i.__downloaded=0,i.__progress=0,i.__retryCount=0,i.__retryTimeout=null,i.__resumeRetryCount=0,i.__states=p,i.__promise=null,i.__request=null,i.__response=null,i.__isAborted=!1,i.__isResumed=!1,i.__isResumable=!1,i.__isRedirected=!1,i.__destFolder=n,i.__statsEstimate={time:0,bytes:0,prevBytes:0,throttleTime:0},i.__fileName="",i.__filePath="",i.updateOptions(o),i):r(i)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"start",value:function(){var e=this,t=function(){return new Promise((function(t,r){e.__promise={resolve:t,reject:r},e.__start()}))};return this.__opts.resumeIfFileExists&&this.state!==this.__states.RESUMED?this.getTotalSize().then((function(r){var n=r.name,o=r.total,s=e.__opts.override;return e.__opts.override=!0,e.__filePath=e.__getFilePath(n),e.__opts.override=s,e.__filePath&&i.existsSync(e.__filePath)?e.__getFilesizeInBytes(e.__filePath)===o?t():e.resumeFromFile(e.__filePath,{total:o,fileName:n}):t()})):t()}},{key:"pause",value:function(){var e=this;return this.state===this.__states.STOPPED?Promise.resolve(!0):(this.__response&&(this.__response.unpipe(),this.__pipes.forEach((function(e){return e.stream.unpipe()}))),this.__fileStream&&this.__fileStream.removeAllListeners(),this.__requestAbort(),this.__closeFileStream().then((function(){return e.__setState(e.__states.PAUSED),e.emit("pause"),!0})))}},{key:"resume",value:function(){return this.__promise?this.state===this.__states.STOPPED?Promise.resolve(!1):(this.__setState(this.__states.RESUMED),this.__isResumable&&(this.__isResumed=!0,this.__reqOptions.headers.range="bytes="+this.__downloaded+"-"),this.emit("resume",this.__isResumed),this.__start()):this.start()}},{key:"stop",value:function(){var e=this;return this.state===this.__states.STOPPED?Promise.resolve(!0):(this.__requestAbort(),this.__closeFileStream().then((function(){return e.__opts.removeOnStop?new Promise((function(t,r){i.access(e.__filePath,(function(n){return n?(e.__emitStop(),t(!0)):void i.unlink(e.__filePath,(function(n){return n?(e.__setState(e.__states.FAILED),e.emit("error",n),r(n)):(e.__emitStop(),void t(!0))}))}))})):(e.__emitStop(),Promise.resolve(!0))})))}},{key:"pipe",value:function(e){return this.__pipes.push({stream:e,options:arguments.length>1&&void 0!==arguments[1]?arguments[1]:null}),e}},{key:"unpipe",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=function(t){return e.__response?e.__response.unpipe(t):t.unpipe()};t?this.__pipes.find((function(e){return e.stream===t}))&&(r(t),this.__pipes=this.__pipes.filter((function(e){return e.stream!==t}))):(this.__pipes.forEach((function(e){return r(e.stream)})),this.__pipes=[])}},{key:"getDownloadPath",value:function(){return this.__filePath}},{key:"isResumable",value:function(){return this.__isResumable}},{key:"updateOptions",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.__opts=Object.assign({},this.__opts,e),this.__headers=this.__opts.headers,this.__opts.timeout>-1&&(this.__opts.httpRequestOptions.timeout=this.__opts.timeout,this.__opts.httpsRequestOptions.timeout=this.__opts.timeout),("number"!=typeof this.__opts.progressThrottle||0>this.__opts.progressThrottle)&&(this.__opts.progressThrottle=this.__defaultOpts.progressThrottle),this.url=t||this.url,this.__reqOptions=this.__getReqOptions(this.__opts.method,this.url,this.__opts.headers),this.__initProtocol(this.url)}},{key:"getOptions",value:function(){return this.__opts}},{key:"getMetadata",value:function(){return this.__opts.metadata}},{key:"getStats",value:function(){return{total:this.__total,name:this.__fileName,downloaded:this.__downloaded,progress:this.__progress,speed:this.__statsEstimate.bytes}}},{key:"getTotalSize",value:function(){var e=this;return new Promise((function(t,r){var n=function(t){e.__initProtocol(t);var r=Object.assign({},e.__headers);r.hasOwnProperty("range")&&delete r.range;var n=e.__getReqOptions("HEAD",t,r);return Object.assign({},e.__reqOptions,n)},o=function(i,a){var c=e.__protocol.request(a,(function(a){if(e.__isRequireRedirect(a)){var c=/^https?:\/\//.test(a.headers.location)?a.headers.location:new s.URL(a.headers.location,i).href;return e.emit("redirected",c,i),o(c,n(c))}return 200===a.statusCode?void t({name:e.__getFileNameFromHeaders(a.headers,a),total:parseInt(a.headers["content-length"])||null}):r(Error("Response status was "+a.statusCode))}));c.on("error",(function(e){return r(e)})),c.on("timeout",(function(){return r(Error("timeout"))})),c.on("uncaughtException",(function(e){return r(e)})),c.end()};o(e.url,n(e.url))}))}},{key:"getResumeState",value:function(){return{downloaded:this.__downloaded,filePath:this.__filePath,fileName:this.__fileName,total:this.__total}}},{key:"resumeFromFile",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.__opts.override=!0,this.__filePath=e,(r.total&&r.fileName?Promise.resolve({name:r.fileName,total:r.total}):this.getTotalSize()).then((function(e){var n=e.name;return t.__total=r.total||e.total,t.__fileName=r.fileName||n,t.__downloaded=r.downloaded||t.__getFilesizeInBytes(t.__filePath),t.__reqOptions.headers.range="bytes="+t.__downloaded+"-",t.__isResumed=!0,t.__isResumable=!0,t.__setState(t.__states.RESUMED),t.emit("resume",t.__isResumed),new Promise((function(e,r){t.__promise={resolve:e,reject:r},t.__start()}))}))}},{key:"__start",value:function(){this.__isRedirected||this.state===this.__states.RESUMED||(this.emit("start"),this.__setState(this.__states.STARTED),this.__initProtocol(this.url)),this.__response=null,this.__isAborted=!1,this.__request&&!this.__request.destroyed&&this.__request.destroy(),this.__retryTimeout&&(clearTimeout(this.__retryTimeout),this.__retryTimeout=null),this.__request=this.__downloadRequest(this.__promise.resolve,this.__promise.reject),this.__request.on("error",this.__onError(this.__promise.resolve,this.__promise.reject)),this.__request.on("timeout",this.__onTimeout(this.__promise.resolve,this.__promise.reject)),this.__request.on("uncaughtException",this.__onError(this.__promise.resolve,this.__promise.reject,!0)),this.__opts.body&&this.__request.write(this.__opts.body),this.__request.end()}},{key:"__resolvePending",value:function(){if(this.__promise){var e=this.__promise.resolve;return this.__promise=null,e(!0)}}},{key:"__downloadRequest",value:function(e,t){var r=this;return this.__protocol.request(this.__reqOptions,(function(n){if(r.__response=n,r.__isResumed||(r.__total=parseInt(n.headers["content-length"])||null,r.__resetStats()),r.__isRequireRedirect(n)){var o=/^https?:\/\//.test(n.headers.location)?n.headers.location:new s.URL(n.headers.location,r.url).href;return r.__isRedirected=!0,r.__initProtocol(o),r.emit("redirected",o,r.url),r.__start()}if(200!==n.statusCode&&206!==n.statusCode){var i=Error("Response status was "+n.statusCode);return i.status=n.statusCode||0,i.body=n.body||"",r.__setState(r.__states.FAILED),r.emit("error",i),t(i)}(r.__opts.forceResume||n.headers.hasOwnProperty("accept-ranges")&&"none"!==n.headers["accept-ranges"])&&(r.__isResumable=!0),r.__startDownload(n,e,t)}))}},{key:"__startDownload",value:function(e,t,r){var o=this,s=e;if(this.__isResumed)this.__fileStream=i.createWriteStream(this.__filePath,{flags:"a"});else{var c=this.__getFileNameFromHeaders(e.headers);if(this.__filePath=this.__getFilePath(c),this.__fileName=this.__filePath.split(a.sep).pop(),i.existsSync(this.__filePath)){var l=this.__getFilesizeInBytes(this.__filePath),u=this.__total?this.__total:0;if("object"===n(this.__opts.override)&&this.__opts.override.skip&&(this.__opts.override.skipSmaller||l>=u))return this.emit("skip",{totalSize:this.__total,fileName:this.__fileName,filePath:this.__filePath,downloadedSize:l}),this.__setState(this.__states.SKIPPED),t(!0)}this.__fileStream=i.createWriteStream(this.__filePath,{})}this.emit("download",{fileName:this.__fileName,filePath:this.__filePath,totalSize:this.__total,isResumed:this.__isResumed,downloadedSize:this.__downloaded}),this.__retryCount=0,this.__isResumed=!1,this.__isRedirected=!1,this.__setState(this.__states.DOWNLOADING),this.__statsEstimate.time=new Date,this.__statsEstimate.throttleTime=new Date,s.on("data",(function(e){return o.__calculateStats(e.length)})),this.__pipes.forEach((function(e){s.pipe(e.stream,e.options),s=e.stream})),s.pipe(this.__fileStream),s.on("error",this.__onError(t,r)),this.__fileStream.on("finish",this.__onFinished(t,r)),this.__fileStream.on("error",this.__onError(t,r))}},{key:"__hasFinished",value:function(){return!this.__isAborted&&-1===[this.__states.PAUSED,this.__states.STOPPED,this.__states.RETRY,this.__states.FAILED,this.__states.RESUMED].indexOf(this.state)}},{key:"__isRequireRedirect",value:function(e){return e.statusCode>300&&400>e.statusCode&&e.headers.hasOwnProperty("location")&&e.headers.location}},{key:"__onFinished",value:function(e,t){var r=this;return function(){r.__fileStream.close((function(n){if(n)return t(n);if(r.__hasFinished()){var o=!!r.__total&&r.__downloaded!==r.__total;if(o&&r.__isResumable&&r.__opts.resumeOnIncomplete&&r.__opts.resumeOnIncompleteMaxRetry>=r.__resumeRetryCount)return r.__resumeRetryCount++,r.emit("warning",Error("uncomplete download, retrying")),r.resume();r.__setState(r.__states.FINISHED),r.__pipes=[],r.emit("end",{fileName:r.__fileName,filePath:r.__filePath,totalSize:r.__total,incomplete:o,onDiskSize:r.__getFilesizeInBytes(r.__filePath),downloadedSize:r.__downloaded})}return e(r.__downloaded===r.__total)}))}}},{key:"__closeFileStream",value:function(){var e=this;return this.__fileStream?new Promise((function(t,r){e.__fileStream.close((function(e){return e?r(e):t(!0)}))})):Promise.resolve(!0)}},{key:"__onError",value:function(e,t){var r=this,n=!(2>=arguments.length||void 0===arguments[2])&&arguments[2];return function(e){return r.__pipes=[],n&&r.__requestAbort(),r.state===r.__states.STOPPED||r.state===r.__states.FAILED?void 0:r.__opts.retry?r.__retry(e).catch((function(n){r.__removeFile().finally((function(){r.__setState(r.__states.FAILED),r.emit("error",n||e),t(n||e)}))})):r.__removeFile().finally((function(){r.__setState(r.__states.FAILED),r.emit("error",e),t(e)}))}}},{key:"__retry",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!this.__opts.retry||"object"!==n(this.__opts.retry))return Promise.reject(t||Error("wrong retry options"));var r=this.__opts.retry,o=r.delay,i=void 0===o?0:o,s=r.maxRetries;return(void 0===s?999:s)>this.__retryCount?(this.__retryCount++,this.__setState(this.__states.RETRY),this.emit("retry",this.__retryCount,this.__opts.retry,t),this.__response&&(this.__response.unpipe(),this.__pipes.forEach((function(e){return e.stream.unpipe()}))),this.__fileStream&&this.__fileStream.removeAllListeners(),this.__requestAbort(),this.__closeFileStream().then((function(){return new Promise((function(t){return e.__retryTimeout=setTimeout((function(){return t(e.__downloaded>0?e.resume():e.__start())}),i)}))}))):Promise.reject(t||Error("reached the maximum retries"))}},{key:"__onTimeout",value:function(e,t){var r=this;return function(){return r.__requestAbort(),r.__opts.retry?r.__retry(Error("timeout")).catch((function(e){r.__removeFile().finally((function(){r.__setState(r.__states.FAILED),e?t(e):(r.emit("timeout"),t(Error("timeout")))}))})):r.__removeFile().finally((function(){r.__setState(r.__states.FAILED),r.emit("timeout"),t(Error("timeout"))}))}}},{key:"__resetStats",value:function(){this.__retryCount=0,this.__downloaded=0,this.__progress=0,this.__resumeRetryCount=0,this.__statsEstimate={time:0,bytes:0,prevBytes:0,throttleTime:0}}},{key:"__getFileNameFromHeaders",value:function(e,t){var r="",n=e.hasOwnProperty("content-disposition"),o=n?e["content-disposition"].match(/.*filename\*=.*?'.*?'([^"].+?[^"])(?:(?:;)|$)/i):null,i=!n||o?null:e["content-disposition"].match(/.*filename="(.*?)";?/i),c=!n||o||i?null:e["content-disposition"].match(/.*filename=([^"].+?[^"])(?:(?:;)|$)/i);return n&&(o||i||c)?(r=(r=e["content-disposition"]).trim(),o?r=o[1]:i?r=i[1]:c&&(r=c[1]),r=r.replace(/[/\\]/g,"")):r=a.basename(new s.URL(this.requestURL).pathname).length>0?a.basename(new s.URL(this.requestURL).pathname):new s.URL(this.requestURL).hostname+".html",this.__opts.fileName?this.__getFileNameFromOpts(r,t):r.replace(/\.*$/,"")}},{key:"__getFilePath",value:function(e){var t=a.join(this.__destFolder,e),r=t;return this.__opts.override||this.state===this.__states.RESUMED||t!==(r=this.__uniqFileNameSync(r))&&this.emit("renamed",{path:r,fileName:r.split(a.sep).pop(),prevPath:t,prevFileName:t.split(a.sep).pop()}),r}},{key:"__getFileNameFromOpts",value:function(e,t){if(!this.__opts.fileName)return e;if("string"==typeof this.__opts.fileName)return this.__opts.fileName;if("function"==typeof this.__opts.fileName){var r=a.join(this.__destFolder,e);return t&&t.headers||this.__response&&this.__response.headers?this.__opts.fileName(e,r,(t||this.__response).headers["content-type"]):this.__opts.fileName(e,r)}if("object"===n(this.__opts.fileName)){var o=this.__opts.fileName,i=o.name,s=!!o.hasOwnProperty("ext")&&o.ext;if("string"==typeof s)return i+"."+s;if("boolean"==typeof s){if(s)return i;var c=e.includes(".")?e.split(".").pop():"";return""===c?i:i+"."+c}}return e}},{key:"__calculateStats",value:function(e){var t=new Date,r=t-this.__statsEstimate.time,n=t-this.__statsEstimate.throttleTime,o=this.__total||0;e&&(this.__downloaded+=e,this.__progress=0===o?0:this.__downloaded/o*100,(this.__downloaded===o||r>1e3)&&(this.__statsEstimate.time=t,this.__statsEstimate.bytes=this.__downloaded-this.__statsEstimate.prevBytes,this.__statsEstimate.prevBytes=this.__downloaded),(this.__downloaded===o||n>this.__opts.progressThrottle)&&(this.__statsEstimate.throttleTime=t,this.emit("progress.throttled",this.getStats())),this.emit("progress",this.getStats()))}},{key:"__setState",value:function(e){this.state=e,this.emit("stateChanged",this.state)}},{key:"__getReqOptions",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=new s.URL(t),o={protocol:n.protocol,host:n.hostname,port:n.port,path:n.pathname+n.search,method:e};return r&&(o.headers=r),o}},{key:"__getFilesizeInBytes",value:function(e){try{return i.statSync(e,{throwIfNoEntry:!1}).size||0}catch(t){this.emit("warning",t)}return 0}},{key:"__validate",value:function(e,t){if("string"!=typeof e)throw Error("URL should be an string");if(""===e.trim())throw Error("URL couldn't be empty");if("string"!=typeof t)throw Error("Destination Folder should be an string");if(""===t.trim())throw Error("Destination Folder couldn't be empty");if(!i.existsSync(t))throw Error("Destination Folder must exist");if(!i.statSync(t).isDirectory())throw Error("Destination Folder must be a directory");try{i.accessSync(t,i.constants.W_OK)}catch(r){throw Error("Destination Folder must be writable")}return!0}},{key:"__initProtocol",value:function(e){var t=this.__getReqOptions(this.__opts.method,e,this.__headers);this.requestURL=e,e.indexOf("https://")>-1?(this.__protocol=l,t.agent=new l.Agent({keepAlive:!1}),this.__reqOptions=Object.assign({},t,this.__opts.httpsRequestOptions)):(this.__protocol=c,t.agent=new c.Agent({keepAlive:!1}),this.__reqOptions=Object.assign({},t,this.__opts.httpRequestOptions))}},{key:"__uniqFileNameSync",value:function(e){if("string"!=typeof e||""===e)return e;try{i.accessSync(e,i.F_OK);var t=e.match(/(.*)(\([0-9]+\))(\..*)$/),r=t?t[1].trim():e,n=t?parseInt(t[2].replace(/\(|\)/,"")):0,o=e.split(".").pop();return o!==e&&o.length>0?r=r.replace(o="."+o,""):o="",this.__uniqFileNameSync(r+" ("+ ++n+")"+o)}catch(s){return e}}},{key:"__removeFile",value:function(){var e=this;return new Promise((function(t){return e.__fileStream?void e.__fileStream.close((function(r){return r&&e.emit("warning",r),e.__opts.removeOnFail?i.access(e.__filePath,(function(n){return n?t():void i.unlink(e.__filePath,(function(n){n&&e.emit("warning",r),t()}))})):void t()})):t()}))}},{key:"__requestAbort",value:function(){this.__isAborted=!0,this.__retryTimeout&&(clearTimeout(this.__retryTimeout),this.__retryTimeout=null),this.__response&&this.__response.destroy(),this.__request&&(this.__request.destroy?this.__request.destroy():this.__request.abort())}},{key:"__emitStop",value:function(){this.__resolvePending(),this.__setState(this.__states.STOPPED),this.emit("stop")}}]),t}(u.EventEmitter)}(Bd);const{appendFile:Hd}=xr.promises,qd="Dpkg::Lock::Timeout=300";let Vd=!1;const zd=ju((function(e=_e()){j(e,"nala"!==e?["update","-y","-o",qd]:["update","-o",qd],{...fa,env:ge(e)}),Vd=!0}));var Xd,Wd;(Wd=Xd||(Xd={}))[Wd.NameDashVersion=0]="NameDashVersion",Wd[Wd.NameEqualsVersion=1]="NameEqualsVersion",Wd[Wd.Name=2]="Name",Wd[Wd.None=3]="None";const Kd=ju((async function(e){zd(e);const t=await Oe([{name:"ca-certificates"},{name:"gnupg"},{name:"apt-utils"}],e);0!==t.length&&j(e,["install","-y","--fix-broken","-o",qd,...t],{...fa,env:ge(e)})}),{promise:!0}),Yd=["E: Could not get lock","dpkg: error processing archive","dpkg: error: dpkg status database is locked by another process"],Jd="/etc/apt/trusted.gpg.d",Qd="keyserver.ubuntu.com";let Zd,eh,th,rh,nh,oh=!1,ih=!1,sh=!1,ah=!1;const ch=/Version\s*:\s*(.*)/g;let lh=!1;var uh=Ar;const ph=t((function(e,t){if("string"!=typeof e)return e;if(0===e.length)return e;var r,n=uh.basename(e,uh.extname(e))+t,o=uh.join(uh.dirname(e),n);return(r=e.slice(0,2))==="."+uh.sep||"./"===r?"."+uh.sep+o:o}));var fh={},dh={};Be(dh,"name",(()=>He));var hh={};Be(hh,"normalizeTrim",(()=>qe));var mh={};Be(mh,"addExeExt",(()=>Ve));var vh={};Be(vh,"addNamePrefix",(()=>ze));var yh={};Be(yh,"addNameSuffix",(()=>Xe));var gh={};Be(gh,"addShExt",(()=>We));var wh={};Be(wh,"addShRelativePrefix",(()=>Ke));var _h={};Be(_h,"removeExt",(()=>Ye));var Eh={};Be(Eh,"replaceExt",(()=>Je));var bh={};Be(bh,"isPathInside",(()=>Qe)),Ge(fh,dh),Ge(fh,hh),Ge(fh,mh),Ge(fh,vh),Ge(fh,yh),Ge(fh,gh),Ge(fh,wh),Ge(fh,_h),Ge(fh,Eh),Ge(fh,bh);const Oh=["x64","amd64","x86_64","win64","64"],Rh=["x86","i386","ia32","win32","32","x32"],Sh=["aarch64","arm64","woa64","arm"],Ih=["armv7","armv7a"],Th=["powerpc64le","ppc64le"],xh=["sparc64"];var Ph={},Ah={},Nh={};!function(e){function t(e){return(1&e.mode)>0||(8&e.mode)>0&&e.gid===process.getgid()||(64&e.mode)>0&&e.uid===process.getuid()}var r,n=Kr&&Kr.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=Kr&&Kr.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=Kr&&Kr.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t},s=Kr&&Kr.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(t){i(t)}}function a(e){try{c(n.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.getCmdPath=e.tryGetExecutablePath=e.isRooted=e.isDirectory=e.exists=e.READONLY=e.UV_FS_O_EXLOCK=e.IS_WINDOWS=e.unlink=e.symlink=e.stat=e.rmdir=e.rm=e.rename=e.readlink=e.readdir=e.open=e.mkdir=e.lstat=e.copyFile=e.chmod=void 0;const a=i(xr),c=i(Ar);e.chmod=(r=a.promises).chmod,e.copyFile=r.copyFile,e.lstat=r.lstat,e.mkdir=r.mkdir,e.open=r.open,e.readdir=r.readdir,e.readlink=r.readlink,e.rename=r.rename,e.rm=r.rm,e.rmdir=r.rmdir,e.stat=r.stat,e.symlink=r.symlink,e.unlink=r.unlink,e.IS_WINDOWS="win32"===process.platform,e.UV_FS_O_EXLOCK=268435456,e.READONLY=a.constants.O_RDONLY,e.exists=function(t){return s(this,void 0,void 0,(function*(){try{yield e.stat(t)}catch(r){if("ENOENT"===r.code)return!1;throw r}return!0}))},e.isDirectory=function(t,r=!1){return s(this,void 0,void 0,(function*(){return(r?yield e.stat(t):yield e.lstat(t)).isDirectory()}))},e.isRooted=function(t){if(!(t=function(t){return t=t||"",e.IS_WINDOWS?(t=t.replace(/\//g,"\\")).replace(/\\\\+/g,"\\"):t.replace(/\/\/+/g,"/")}(t)))throw Error('isRooted() parameter "p" cannot be empty');return e.IS_WINDOWS?t.startsWith("\\")||/^[A-Z]:/i.test(t):t.startsWith("/")},e.tryGetExecutablePath=function(r,n){return s(this,void 0,void 0,(function*(){let o;try{o=yield e.stat(r)}catch(s){"ENOENT"!==s.code&&console.log(`Unexpected error attempting to determine if executable file exists '${r}': ${s}`)}if(o&&o.isFile())if(e.IS_WINDOWS){const e=c.extname(r).toUpperCase();if(n.some((t=>t.toUpperCase()===e)))return r}else if(t(o))return r;const i=r;for(const a of n){r=i+a,o=void 0;try{o=yield e.stat(r)}catch(s){"ENOENT"!==s.code&&console.log(`Unexpected error attempting to determine if executable file exists '${r}': ${s}`)}if(o&&o.isFile()){if(e.IS_WINDOWS){try{const t=c.dirname(r),n=c.basename(r).toUpperCase();for(const o of yield e.readdir(t))if(n===o.toUpperCase()){r=c.join(t,o);break}}catch(s){console.log(`Unexpected error attempting to determine the actual case of the file '${r}': ${s}`)}return r}if(t(o))return r}}return""}))},e.getCmdPath=function(){var e;return null!==(e=process.env.COMSPEC)&&void 0!==e?e:"cmd.exe"}}(Nh);var $h=Kr&&Kr.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),Ch=Kr&&Kr.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Lh=Kr&&Kr.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&$h(t,e,r);return Ch(t,e),t},kh=Kr&&Kr.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(t){i(t)}}function a(e){try{c(n.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(Ah,"__esModule",{value:!0}),Ah.findInPath=Ah.which=Fh=Ah.mkdirP=Ah.rmRF=Ah.mv=Ah.cp=void 0;const Dh=Fr,jh=Lh(Ar),Uh=Lh(Nh);Ah.cp=function(e,t,r={}){return kh(this,void 0,void 0,(function*(){const{force:n,recursive:o,copySourceDirectory:i}=function(e){return{force:null==e.force||e.force,recursive:!!e.recursive,copySourceDirectory:null==e.copySourceDirectory||!!e.copySourceDirectory}}(r),s=(yield Uh.exists(t))?yield Uh.stat(t):null;if(s&&s.isFile()&&!n)return;const a=s&&s.isDirectory()&&i?jh.join(t,jh.basename(e)):t;if(!(yield Uh.exists(e)))throw Error("no such file or directory: "+e);if((yield Uh.stat(e)).isDirectory()){if(!o)throw Error(`Failed to copy. ${e} is a directory, but tried to copy without recursive flag.`);yield rt(e,a,0,n)}else{if(""===jh.relative(e,a))throw Error(`'${a}' and '${e}' are the same file`);yield nt(e,a,n)}}))},Ah.mv=function(e,t,r={}){return kh(this,void 0,void 0,(function*(){if(yield Uh.exists(t)){let n=!0;if((yield Uh.isDirectory(t))&&(t=jh.join(t,jh.basename(e)),n=yield Uh.exists(t)),n){if(null!=r.force&&!r.force)throw Error("Destination already exists");yield Ze(t)}}yield et(jh.dirname(t)),yield Uh.rename(e,t)}))},Ah.rmRF=Ze;var Fh=Ah.mkdirP=et;Ah.which=function e(t,r){return kh(this,void 0,void 0,(function*(){if(!t)throw Error("parameter 'tool' is required");if(r){const r=yield e(t,!1);if(!r)throw Error(Uh.IS_WINDOWS?`Unable to locate executable file: ${t}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`:`Unable to locate executable file: ${t}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);return r}const n=yield tt(t);return n&&n.length>0?n[0]:""}))},Ah.findInPath=tt;var Mh={exports:{}},Gh={exports:{}};!function(e,t){function r(e){A[e]=N++}function n(e){for(var t=0;C.length>t;t++){var r=C[t][0],n=C[t][1];e=e.split(r+"*").join(r+"{0,"+n+"}").split(r+"+").join(r+"{1,"+n+"}")}return e}function o(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof i)return e;if("string"!=typeof e)return null;if(e.length>R)return null;if(!(t.loose?x[A.LOOSE]:x[A.FULL]).test(e))return null;try{return new i(e,t)}catch(r){return null}}function i(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof i){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>R)throw new TypeError("version is longer than "+R+" characters");if(!(this instanceof i))return new i(e,t);O("SemVer",e,t),this.options=t,this.loose=!!t.loose;var r=e.trim().match(t.loose?x[A.LOOSE]:x[A.FULL]);if(!r)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>S||0>this.major)throw new TypeError("Invalid major version");if(this.minor>S||0>this.minor)throw new TypeError("Invalid minor version");if(this.patch>S||0>this.patch)throw new TypeError("Invalid patch version");this.prerelease=r[4]?r[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&S>t)return t}return e})):[],this.build=r[5]?r[5].split("."):[],this.format()}function s(e,t){var r=k.test(e),n=k.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:t>e?-1:1}function a(e,t,r){return new i(e,r).compare(new i(t,r))}function c(e,t,r){return a(e,t,r)>0}function l(e,t,r){return 0>a(e,t,r)}function u(e,t,r){return 0===a(e,t,r)}function p(e,t,r){return 0!==a(e,t,r)}function f(e,t,r){return a(e,t,r)>=0}function d(e,t,r){return 0>=a(e,t,r)}function h(e,t,r,n){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return u(e,r,n);case"!=":return p(e,r,n);case">":return c(e,r,n);case">=":return f(e,r,n);case"<":return l(e,r,n);case"<=":return d(e,r,n);default:throw new TypeError("Invalid operator: "+t)}}function m(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof m){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof m))return new m(e,t);e=e.trim().split(/\s+/).join(" "),O("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.value=this.semver===D?"":this.operator+this.semver.version,O("comp",this)}function v(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof v)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new v(e.raw,t);if(e instanceof m)return new v(e.value,t);if(!(this instanceof v))return new v(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}function y(e,t){for(var r=!0,n=e.slice(),o=n.pop();r&&n.length;)r=n.every((function(e){return o.intersects(e,t)})),o=n.pop();return r}function g(e){return!e||"x"===e.toLowerCase()||"*"===e}function w(e,t,r,n,o,i,s,a,c,l,u,p,f){return((t=g(r)?"":g(n)?">="+r+".0.0":g(o)?">="+r+"."+n+".0":">="+t)+" "+(a=g(c)?"":g(l)?"<"+(+c+1)+".0.0":g(u)?"<"+c+"."+(+l+1)+".0":p?"<="+c+"."+l+"."+u+"-"+p:"<="+a)).trim()}function _(e,t,r){for(var n=0;e.length>n;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(n=0;e.length>n;n++)if(O(e[n].semver),e[n].semver!==D&&e[n].semver.prerelease.length>0){var o=e[n].semver;if(o.major===t.major&&o.minor===t.minor&&o.patch===t.patch)return!0}return!1}return!0}function E(e,t,r){try{t=new v(t,r)}catch(n){return!1}return t.test(e)}function b(e,t,r,n){var o,s,a,u,p;switch(e=new i(e,n),t=new v(t,n),r){case">":o=c,s=d,a=l,u=">",p=">=";break;case"<":o=l,s=f,a=c,u="<",p="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(E(e,t,n))return!1;for(var h=0;t.set.length>h;++h){var y=null,g=null;if(t.set[h].forEach((function(e){e.semver===D&&(e=new m(">=0.0.0")),g=g||e,o(e.semver,(y=y||e).semver,n)?y=e:a(e.semver,g.semver,n)&&(g=e)})),y.operator===u||y.operator===p)return!1;if((!g.operator||g.operator===u)&&s(e,g.semver))return!1;if(g.operator===p&&a(e,g.semver))return!1}return!0}var O;t=Gh.exports=i,O="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e=[].slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var R=256,S=Number.MAX_SAFE_INTEGER||9007199254740991,I=R-6,T=t.re=[],x=t.safeRe=[],P=t.src=[],A=t.tokens={},N=0,$="[a-zA-Z0-9-]",C=[["\\s",1],["\\d",R],[$,I]];r("NUMERICIDENTIFIER"),P[A.NUMERICIDENTIFIER]="0|[1-9]\\d*",r("NUMERICIDENTIFIERLOOSE"),P[A.NUMERICIDENTIFIERLOOSE]="\\d+",r("NONNUMERICIDENTIFIER"),P[A.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-]"+$+"*",r("MAINVERSION"),P[A.MAINVERSION]="("+P[A.NUMERICIDENTIFIER]+")\\.("+P[A.NUMERICIDENTIFIER]+")\\.("+P[A.NUMERICIDENTIFIER]+")",r("MAINVERSIONLOOSE"),P[A.MAINVERSIONLOOSE]="("+P[A.NUMERICIDENTIFIERLOOSE]+")\\.("+P[A.NUMERICIDENTIFIERLOOSE]+")\\.("+P[A.NUMERICIDENTIFIERLOOSE]+")",r("PRERELEASEIDENTIFIER"),P[A.PRERELEASEIDENTIFIER]="(?:"+P[A.NUMERICIDENTIFIER]+"|"+P[A.NONNUMERICIDENTIFIER]+")",r("PRERELEASEIDENTIFIERLOOSE"),P[A.PRERELEASEIDENTIFIERLOOSE]="(?:"+P[A.NUMERICIDENTIFIERLOOSE]+"|"+P[A.NONNUMERICIDENTIFIER]+")",r("PRERELEASE"),P[A.PRERELEASE]="(?:-("+P[A.PRERELEASEIDENTIFIER]+"(?:\\."+P[A.PRERELEASEIDENTIFIER]+")*))",r("PRERELEASELOOSE"),P[A.PRERELEASELOOSE]="(?:-?("+P[A.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+P[A.PRERELEASEIDENTIFIERLOOSE]+")*))",r("BUILDIDENTIFIER"),P[A.BUILDIDENTIFIER]=$+"+",r("BUILD"),P[A.BUILD]="(?:\\+("+P[A.BUILDIDENTIFIER]+"(?:\\."+P[A.BUILDIDENTIFIER]+")*))",r("FULL"),r("FULLPLAIN"),P[A.FULLPLAIN]="v?"+P[A.MAINVERSION]+P[A.PRERELEASE]+"?"+P[A.BUILD]+"?",P[A.FULL]="^"+P[A.FULLPLAIN]+"$",r("LOOSEPLAIN"),P[A.LOOSEPLAIN]="[v=\\s]*"+P[A.MAINVERSIONLOOSE]+P[A.PRERELEASELOOSE]+"?"+P[A.BUILD]+"?",r("LOOSE"),P[A.LOOSE]="^"+P[A.LOOSEPLAIN]+"$",r("GTLT"),P[A.GTLT]="((?:<|>)?=?)",r("XRANGEIDENTIFIERLOOSE"),P[A.XRANGEIDENTIFIERLOOSE]=P[A.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",r("XRANGEIDENTIFIER"),P[A.XRANGEIDENTIFIER]=P[A.NUMERICIDENTIFIER]+"|x|X|\\*",r("XRANGEPLAIN"),P[A.XRANGEPLAIN]="[v=\\s]*("+P[A.XRANGEIDENTIFIER]+")(?:\\.("+P[A.XRANGEIDENTIFIER]+")(?:\\.("+P[A.XRANGEIDENTIFIER]+")(?:"+P[A.PRERELEASE]+")?"+P[A.BUILD]+"?)?)?",r("XRANGEPLAINLOOSE"),P[A.XRANGEPLAINLOOSE]="[v=\\s]*("+P[A.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+P[A.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+P[A.XRANGEIDENTIFIERLOOSE]+")(?:"+P[A.PRERELEASELOOSE]+")?"+P[A.BUILD]+"?)?)?",r("XRANGE"),P[A.XRANGE]="^"+P[A.GTLT]+"\\s*"+P[A.XRANGEPLAIN]+"$",r("XRANGELOOSE"),P[A.XRANGELOOSE]="^"+P[A.GTLT]+"\\s*"+P[A.XRANGEPLAINLOOSE]+"$",r("COERCE"),P[A.COERCE]="(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])",r("COERCERTL"),T[A.COERCERTL]=RegExp(P[A.COERCE],"g"),x[A.COERCERTL]=RegExp(n(P[A.COERCE]),"g"),r("LONETILDE"),P[A.LONETILDE]="(?:~>?)",r("TILDETRIM"),P[A.TILDETRIM]="(\\s*)"+P[A.LONETILDE]+"\\s+",T[A.TILDETRIM]=RegExp(P[A.TILDETRIM],"g"),x[A.TILDETRIM]=RegExp(n(P[A.TILDETRIM]),"g"),r("TILDE"),P[A.TILDE]="^"+P[A.LONETILDE]+P[A.XRANGEPLAIN]+"$",r("TILDELOOSE"),P[A.TILDELOOSE]="^"+P[A.LONETILDE]+P[A.XRANGEPLAINLOOSE]+"$",r("LONECARET"),P[A.LONECARET]="(?:\\^)",r("CARETTRIM"),P[A.CARETTRIM]="(\\s*)"+P[A.LONECARET]+"\\s+",T[A.CARETTRIM]=RegExp(P[A.CARETTRIM],"g"),x[A.CARETTRIM]=RegExp(n(P[A.CARETTRIM]),"g"),r("CARET"),P[A.CARET]="^"+P[A.LONECARET]+P[A.XRANGEPLAIN]+"$",r("CARETLOOSE"),P[A.CARETLOOSE]="^"+P[A.LONECARET]+P[A.XRANGEPLAINLOOSE]+"$",r("COMPARATORLOOSE"),P[A.COMPARATORLOOSE]="^"+P[A.GTLT]+"\\s*("+P[A.LOOSEPLAIN]+")$|^$",r("COMPARATOR"),P[A.COMPARATOR]="^"+P[A.GTLT]+"\\s*("+P[A.FULLPLAIN]+")$|^$",r("COMPARATORTRIM"),P[A.COMPARATORTRIM]="(\\s*)"+P[A.GTLT]+"\\s*("+P[A.LOOSEPLAIN]+"|"+P[A.XRANGEPLAIN]+")",T[A.COMPARATORTRIM]=RegExp(P[A.COMPARATORTRIM],"g"),x[A.COMPARATORTRIM]=RegExp(n(P[A.COMPARATORTRIM]),"g"),r("HYPHENRANGE"),P[A.HYPHENRANGE]="^\\s*("+P[A.XRANGEPLAIN]+")\\s+-\\s+("+P[A.XRANGEPLAIN]+")\\s*$",r("HYPHENRANGELOOSE"),P[A.HYPHENRANGELOOSE]="^\\s*("+P[A.XRANGEPLAINLOOSE]+")\\s+-\\s+("+P[A.XRANGEPLAINLOOSE]+")\\s*$",r("STAR"),P[A.STAR]="(<|>)?=?\\s*\\*";for(var L=0;N>L;L++)O(L,P[L]),T[L]||(T[L]=RegExp(P[L]),x[L]=RegExp(n(P[L])));t.parse=o,t.valid=function(e,t){var r=o(e,t);return r?r.version:null},t.clean=function(e,t){var r=o(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null},t.SemVer=i,i.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},i.prototype.toString=function(){return this.version},i.prototype.compare=function(e){return O("SemVer.compare",this.version,this.options,e),e instanceof i||(e=new i(e,this.options)),this.compareMain(e)||this.comparePre(e)},i.prototype.compareMain=function(e){return e instanceof i||(e=new i(e,this.options)),s(this.major,e.major)||s(this.minor,e.minor)||s(this.patch,e.patch)},i.prototype.comparePre=function(e){if(e instanceof i||(e=new i(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;var t=0;do{var r=this.prerelease[t],n=e.prerelease[t];if(O("prerelease compare",t,r,n),void 0===r&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===r)return-1;if(r!==n)return s(r,n)}while(++t)},i.prototype.compareBuild=function(e){e instanceof i||(e=new i(e,this.options));var t=0;do{var r=this.build[t],n=e.build[t];if(O("prerelease compare",t,r,n),void 0===r&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===r)return-1;if(r!==n)return s(r,n)}while(++t)},i.prototype.inc=function(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var r=this.prerelease.length;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);-1===r&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function(e,t,r,n){"string"==typeof r&&(n=r,r=void 0);try{return new i(e,r).inc(t,n).version}catch(o){return null}},t.diff=function(e,t){if(u(e,t))return null;var r=o(e),n=o(t),i="";if(r.prerelease.length||n.prerelease.length){i="pre";var s="prerelease"}for(var a in r)if(("major"===a||"minor"===a||"patch"===a)&&r[a]!==n[a])return i+a;return s},t.compareIdentifiers=s;var k=/^[0-9]+$/;t.rcompareIdentifiers=function(e,t){return s(t,e)},t.major=function(e,t){return new i(e,t).major},t.minor=function(e,t){return new i(e,t).minor},t.patch=function(e,t){return new i(e,t).patch},t.compare=a,t.compareLoose=function(e,t){return a(e,t,!0)},t.compareBuild=function(e,t,r){var n=new i(e,r),o=new i(t,r);return n.compare(o)||n.compareBuild(o)},t.rcompare=function(e,t,r){return a(t,e,r)},t.sort=function(e,r){return e.sort((function(e,n){return t.compareBuild(e,n,r)}))},t.rsort=function(e,r){return e.sort((function(e,n){return t.compareBuild(n,e,r)}))},t.gt=c,t.lt=l,t.eq=u,t.neq=p,t.gte=f,t.lte=d,t.cmp=h,t.Comparator=m;var D={};m.prototype.parse=function(e){var t=e.match(this.options.loose?x[A.COMPARATORLOOSE]:x[A.COMPARATOR]);if(!t)throw new TypeError("Invalid comparator: "+e);this.operator=void 0!==t[1]?t[1]:"","="===this.operator&&(this.operator=""),this.semver=t[2]?new i(t[2],this.options.loose):D},m.prototype.toString=function(){return this.value},m.prototype.test=function(e){if(O("Comparator.test",e,this.options.loose),this.semver===D||e===D)return!0;if("string"==typeof e)try{e=new i(e,this.options)}catch(t){return!1}return h(e,this.operator,this.semver,this.options)},m.prototype.intersects=function(e,t){if(!(e instanceof m))throw new TypeError("a Comparator is required");var r;if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||(r=new v(e.value,t),E(this.value,r,t));if(""===e.operator)return""===e.value||(r=new v(this.value,t),E(e.semver,r,t));var n=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=h(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=h(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return n||o||i&&s||a||c},t.Range=v,v.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},v.prototype.toString=function(){return this.range},v.prototype.parseRange=function(e){var t=this.options.loose;e=e.replace(t?x[A.HYPHENRANGELOOSE]:x[A.HYPHENRANGE],w),O("hyphen replace",e),e=e.replace(x[A.COMPARATORTRIM],"$1$2$3"),O("comparator trim",e,x[A.COMPARATORTRIM]),e=(e=(e=e.replace(x[A.TILDETRIM],"$1~")).replace(x[A.CARETTRIM],"$1^")).split(/\s+/).join(" ");var r=t?x[A.COMPARATORLOOSE]:x[A.COMPARATOR],n=e.split(" ").map((function(e){return function(e,t){return O("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){return O("caret",e,t),e.replace(t.loose?x[A.CARETLOOSE]:x[A.CARET],(function(t,r,n,o,i){var s;return O("caret",e,t,r,n,o,i),g(r)?s="":g(n)?s=">="+r+".0.0 <"+(+r+1)+".0.0":g(o)?s="0"===r?">="+r+"."+n+".0 <"+r+"."+(+n+1)+".0":">="+r+"."+n+".0 <"+(+r+1)+".0.0":i?(O("replaceCaret pr",i),s="0"===r?"0"===n?">="+r+"."+n+"."+o+"-"+i+" <"+r+"."+n+"."+(+o+1):">="+r+"."+n+"."+o+"-"+i+" <"+r+"."+(+n+1)+".0":">="+r+"."+n+"."+o+"-"+i+" <"+(+r+1)+".0.0"):(O("no pr"),s="0"===r?"0"===n?">="+r+"."+n+"."+o+" <"+r+"."+n+"."+(+o+1):">="+r+"."+n+"."+o+" <"+r+"."+(+n+1)+".0":">="+r+"."+n+"."+o+" <"+(+r+1)+".0.0"),O("caret return",s),s}))}(e,t)})).join(" ")}(e,t),O("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){return e.replace(t.loose?x[A.TILDELOOSE]:x[A.TILDE],(function(t,r,n,o,i){var s;return O("tilde",e,t,r,n,o,i),g(r)?s="":g(n)?s=">="+r+".0.0 <"+(+r+1)+".0.0":g(o)?s=">="+r+"."+n+".0 <"+r+"."+(+n+1)+".0":i?(O("replaceTilde pr",i),s=">="+r+"."+n+"."+o+"-"+i+" <"+r+"."+(+n+1)+".0"):s=">="+r+"."+n+"."+o+" <"+r+"."+(+n+1)+".0",O("tilde return",s),s}))}(e,t)})).join(" ")}(e,t),O("tildes",e),e=function(e,t){return O("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){return(e=e.trim()).replace(t.loose?x[A.XRANGELOOSE]:x[A.XRANGE],(function(r,n,o,i,s,a){O("xRange",e,r,n,o,i,s,a);var c=g(o),l=c||g(i),u=l||g(s);return"="===n&&u&&(n=""),a=t.includePrerelease?"-0":"",c?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&u?(l&&(i=0),s=0,">"===n?(n=">=",l?(o=+o+1,i=0,s=0):(i=+i+1,s=0)):"<="===n&&(n="<",l?o=+o+1:i=+i+1),r=n+o+"."+i+"."+s+a):l?r=">="+o+".0.0"+a+" <"+(+o+1)+".0.0"+a:u&&(r=">="+o+"."+i+".0"+a+" <"+o+"."+(+i+1)+".0"+a),O("xRange return",r),r}))}(e,t)})).join(" ")}(e,t),O("xrange",e),e=function(e,t){return O("replaceStars",e,t),e.trim().replace(x[A.STAR],"")}(e,t),O("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(n=n.filter((function(e){return!!e.match(r)}))),n.map((function(e){return new m(e,this.options)}),this)},v.prototype.intersects=function(e,t){if(!(e instanceof v))throw new TypeError("a Range is required");return this.set.some((function(r){return y(r,t)&&e.set.some((function(e){return y(e,t)&&r.every((function(r){return e.every((function(e){return r.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new v(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},v.prototype.test=function(e){if(!e)return!1;if("string"==typeof e)try{e=new i(e,this.options)}catch(r){return!1}for(var t=0;this.set.length>t;t++)if(_(this.set[t],e,this.options))return!0;return!1},t.satisfies=E,t.maxSatisfying=function(e,t,r){var n=null,o=null;try{var s=new v(t,r)}catch(a){return null}return e.forEach((function(e){s.test(e)&&(n&&-1!==o.compare(e)||(o=new i(n=e,r)))})),n},t.minSatisfying=function(e,t,r){var n=null,o=null;try{var s=new v(t,r)}catch(a){return null}return e.forEach((function(e){s.test(e)&&(n&&1!==o.compare(e)||(o=new i(n=e,r)))})),n},t.minVersion=function(e,t){e=new v(e,t);var r=new i("0.0.0");if(e.test(r))return r;if(r=new i("0.0.0-0"),e.test(r))return r;r=null;for(var n=0;e.set.length>n;++n)e.set[n].forEach((function(e){var t=new i(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":r&&!c(r,t)||(r=t);break;case"<":case"<=":break;default:throw Error("Unexpected operation: "+e.operator)}}));return r&&e.test(r)?r:null},t.validRange=function(e,t){try{return new v(e,t).range||"*"}catch(r){return null}},t.ltr=function(e,t,r){return b(e,t,"<",r)},t.gtr=function(e,t,r){return b(e,t,">",r)},t.outside=b,t.prerelease=function(e,t){var r=o(e,t);return r&&r.prerelease.length?r.prerelease:null},t.intersects=function(e,t,r){return e=new v(e,r),t=new v(t,r),e.intersects(t)},t.coerce=function(e,t){if(e instanceof i)return e;if("number"==typeof e&&(e+=""),"string"!=typeof e)return null;var r=null;if((t=t||{}).rtl){for(var n;(n=x[A.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&n.index+n[0].length===r.index+r[0].length||(r=n),x[A.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;x[A.COERCERTL].lastIndex=-1}else r=e.match(x[A.COERCE]);return null===r?null:o(r[2]+"."+(r[3]||"0")+"."+(r[4]||"0"),t)}}(0,Gh.exports);var Bh=Gh.exports;!function(e,t){var r=Kr&&Kr.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=Kr&&Kr.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=Kr&&Kr.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.hasOwnProperty.call(e,o)&&r(t,e,o);return n(t,e),t},i=Kr&&Kr.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(t){i(t)}}function a(e){try{c(n.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t._readLinuxVersionFile=t._getOsVersion=t._findMatch=void 0;const s=o(Bh),a=m(),c=Tr,l=Ur,u=xr;t._findMatch=function(t,r,n,o){return i(this,void 0,void 0,(function*(){const i=c.platform();let l,u,p;for(const c of n){const n=c.version;if(a.debug(`check ${n} satisfies ${t}`),s.satisfies(n,t)&&(!r||c.stable===r)&&(p=c.files.find((t=>{a.debug(`${t.arch}===${o} && ${t.platform}===${i}`);let r=t.arch===o&&t.platform===i;if(r&&t.platform_version){const n=e.exports._getOsVersion();r=n===t.platform_version||s.satisfies(n,t.platform_version)}return r})),p)){a.debug("matched "+c.version),u=c;break}}return u&&p&&(l=Object.assign({},u),l.files=[p]),l}))},t._getOsVersion=function(){const t=c.platform();let r="";if("darwin"===t)r=""+l.execSync("sw_vers -productVersion");else if("linux"===t){const t=e.exports._readLinuxVersionFile();if(t){const e=t.split("\n");for(const t of e){const e=t.split("=");if(2===e.length&&("VERSION_ID"===e[0].trim()||"DISTRIB_RELEASE"===e[0].trim())){r=e[1].trim().replace(/^"/,"").replace(/"$/,"");break}}}}return r},t._readLinuxVersionFile=function(){const e="/etc/lsb-release",t="/etc/os-release";let r="";return u.existsSync(e)?r=""+u.readFileSync(e):u.existsSync(t)&&(r=""+u.readFileSync(t)),r}}(Mh,Mh.exports);for(var Hh=Mh.exports,qh=Pr,Vh=[],zh=0;256>zh;++zh)Vh[zh]=(zh+256).toString(16).substr(1);var Xh=function(){return qh.randomBytes(16)},Wh=function(e,t){var r=t||0;return""+Vh[e[r++]]+Vh[e[r++]]+Vh[e[r++]]+Vh[e[r++]]+"-"+Vh[e[r++]]+Vh[e[r++]]+"-"+Vh[e[r++]]+Vh[e[r++]]+"-"+Vh[e[r++]]+Vh[e[r++]]+"-"+Vh[e[r++]]+Vh[e[r++]]+Vh[e[r++]]+Vh[e[r++]]+Vh[e[r++]]+Vh[e[r++]]},Kh={},Yh={},Jh=Kr&&Kr.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),Qh=Kr&&Kr.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Zh=Kr&&Kr.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&Jh(t,e,r);return Qh(t,e),t},em=Kr&&Kr.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(t){i(t)}}function a(e){try{c(n.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(Yh,"__esModule",{value:!0}),Yh.argStringToArray=Yh.ToolRunner=void 0;const tm=Zh(Tr),rm=Zh(Lr),nm=Zh(Ur),om=Zh(Ar),im=Zh(Ah),sm=Zh(Nh),am=Hr,cm="win32"===process.platform;Yh.ToolRunner=class extends rm.EventEmitter{constructor(e,t,r){if(super(),!e)throw Error("Parameter 'toolPath' cannot be null or empty.");this.toolPath=e,this.args=t||[],this.options=r||{}}_debug(e){this.options.listeners&&this.options.listeners.debug&&this.options.listeners.debug(e)}_getCommandString(e,t){const r=this._getSpawnFileName(),n=this._getSpawnArgs(e);let o=t?"":"[command]";if(cm)if(this._isCmdFile()){o+=r;for(const e of n)o+=" "+e}else if(e.windowsVerbatimArguments){o+=`"${r}"`;for(const e of n)o+=" "+e}else{o+=this._windowsQuoteCmdArg(r);for(const e of n)o+=" "+this._windowsQuoteCmdArg(e)}else{o+=r;for(const e of n)o+=" "+e}return o}_processLineBuffer(e,t,r){try{let n=t+""+e,o=n.indexOf(tm.EOL);for(;o>-1;)r(n.substring(0,o)),n=n.substring(o+tm.EOL.length),o=n.indexOf(tm.EOL);return n}catch(n){return this._debug("error processing line. Failed with error "+n),""}}_getSpawnFileName(){return cm&&this._isCmdFile()?process.env.COMSPEC||"cmd.exe":this.toolPath}_getSpawnArgs(e){if(cm&&this._isCmdFile()){let t='/D /S /C "'+this._windowsQuoteCmdArg(this.toolPath);for(const r of this.args)t+=" ",t+=e.windowsVerbatimArguments?r:this._windowsQuoteCmdArg(r);return t+='"',[t]}return this.args}_endsWith(e,t){return e.endsWith(t)}_isCmdFile(){const e=this.toolPath.toUpperCase();return this._endsWith(e,".CMD")||this._endsWith(e,".BAT")}_windowsQuoteCmdArg(e){if(!this._isCmdFile())return this._uvQuoteCmdArg(e);if(!e)return'""';const t=[" ","\t","&","(",")","[","]","{","}","^","=",";","!","'","+",",","`","~","|","<",">",'"'];let r=!1;for(const i of e)if(t.some((e=>e===i))){r=!0;break}if(!r)return e;let n='"',o=!0;for(let i=e.length;i>0;i--)n+=e[i-1],o&&"\\"===e[i-1]?n+="\\":'"'===e[i-1]?(o=!0,n+='"'):o=!1;return n+='"',n.split("").reverse().join("")}_uvQuoteCmdArg(e){if(!e)return'""';if(!e.includes(" ")&&!e.includes("\t")&&!e.includes('"'))return e;if(!e.includes('"')&&!e.includes("\\"))return`"${e}"`;let t='"',r=!0;for(let n=e.length;n>0;n--)t+=e[n-1],r&&"\\"===e[n-1]?t+="\\":'"'===e[n-1]?(r=!0,t+="\\"):r=!1;return t+='"',t.split("").reverse().join("")}_cloneExecOptions(e){const t={cwd:(e=e||{}).cwd||process.cwd(),env:e.env||process.env,silent:e.silent||!1,windowsVerbatimArguments:e.windowsVerbatimArguments||!1,failOnStdErr:e.failOnStdErr||!1,ignoreReturnCode:e.ignoreReturnCode||!1,delay:e.delay||1e4};return t.outStream=e.outStream||process.stdout,t.errStream=e.errStream||process.stderr,t}_getSpawnOptions(e,t){const r={};return r.cwd=(e=e||{}).cwd,r.env=e.env,r.windowsVerbatimArguments=e.windowsVerbatimArguments||this._isCmdFile(),e.windowsVerbatimArguments&&(r.argv0=`"${t}"`),r}exec(){return em(this,void 0,void 0,(function*(){return!sm.isRooted(this.toolPath)&&(this.toolPath.includes("/")||cm&&this.toolPath.includes("\\"))&&(this.toolPath=om.resolve(process.cwd(),this.options.cwd||process.cwd(),this.toolPath)),this.toolPath=yield im.which(this.toolPath,!0),new Promise(((e,t)=>em(this,void 0,void 0,(function*(){this._debug("exec tool: "+this.toolPath),this._debug("arguments:");for(const e of this.args)this._debug(" "+e);const r=this._cloneExecOptions(this.options);!r.silent&&r.outStream&&r.outStream.write(this._getCommandString(r)+tm.EOL);const n=new lm(r,this.toolPath);if(n.on("debug",(e=>{this._debug(e)})),this.options.cwd&&!(yield sm.exists(this.options.cwd)))return t(Error(`The cwd: ${this.options.cwd} does not exist!`));const o=this._getSpawnFileName(),i=nm.spawn(o,this._getSpawnArgs(r),this._getSpawnOptions(this.options,o));let s="";i.stdout&&i.stdout.on("data",(e=>{this.options.listeners&&this.options.listeners.stdout&&this.options.listeners.stdout(e),!r.silent&&r.outStream&&r.outStream.write(e),s=this._processLineBuffer(e,s,(e=>{this.options.listeners&&this.options.listeners.stdline&&this.options.listeners.stdline(e)}))}));let a="";if(i.stderr&&i.stderr.on("data",(e=>{n.processStderr=!0,this.options.listeners&&this.options.listeners.stderr&&this.options.listeners.stderr(e),!r.silent&&r.errStream&&r.outStream&&(r.failOnStdErr?r.errStream:r.outStream).write(e),a=this._processLineBuffer(e,a,(e=>{this.options.listeners&&this.options.listeners.errline&&this.options.listeners.errline(e)}))})),i.on("error",(e=>{n.processError=e.message,n.processExited=!0,n.processClosed=!0,n.CheckComplete()})),i.on("exit",(e=>{n.processExitCode=e,n.processExited=!0,this._debug(`Exit code ${e} received from tool '${this.toolPath}'`),n.CheckComplete()})),i.on("close",(e=>{n.processExitCode=e,n.processExited=!0,n.processClosed=!0,this._debug(`STDIO streams have closed for tool '${this.toolPath}'`),n.CheckComplete()})),n.on("done",((r,n)=>{s.length>0&&this.emit("stdline",s),a.length>0&&this.emit("errline",a),i.removeAllListeners(),r?t(r):e(n)})),this.options.input){if(!i.stdin)throw Error("child process missing stdin");i.stdin.end(this.options.input)}}))))}))}},Yh.argStringToArray=function(e){function t(e){o&&'"'!==e&&(i+="\\"),i+=e,o=!1}const r=[];let n=!1,o=!1,i="";for(let s=0;e.length>s;s++){const a=e.charAt(s);'"'!==a?"\\"===a&&o?t(a):"\\"===a&&n?o=!0:" "!==a||n?t(a):i.length>0&&(r.push(i),i=""):o?t(a):n=!n}return i.length>0&&r.push(i.trim()),r};class lm extends rm.EventEmitter{constructor(e,t){if(super(),this.processClosed=!1,this.processError="",this.processExitCode=0,this.processExited=!1,this.processStderr=!1,this.delay=1e4,this.done=!1,this.timeout=null,!t)throw Error("toolPath must not be empty");this.options=e,this.toolPath=t,e.delay&&(this.delay=e.delay)}CheckComplete(){this.done||(this.processClosed?this._setResult():this.processExited&&(this.timeout=am.setTimeout(lm.HandleTimeout,this.delay,this)))}_debug(e){this.emit("debug",e)}_setResult(){let e;this.processExited&&(this.processError?e=Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`):0===this.processExitCode||this.options.ignoreReturnCode?this.processStderr&&this.options.failOnStdErr&&(e=Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`)):e=Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`)),this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.done=!0,this.emit("done",e,this.processExitCode)}static HandleTimeout(e){e.done||(!e.processClosed&&e.processExited&&e._debug(`The STDIO streams did not close within ${e.delay/1e3} seconds of the exit event from process '${e.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`),e._setResult())}}var um=Kr&&Kr.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),pm=Kr&&Kr.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),fm=Kr&&Kr.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&um(t,e,r);return pm(t,e),t},dm=Kr&&Kr.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(t){i(t)}}function a(e){try{c(n.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(Kh,"__esModule",{value:!0}),exports.getExecOutput_1=Kh.getExecOutput=exports.exec_2=Kh.exec=void 0;const hm=Br,mm=fm(Yh);exports.exec_2=Kh.exec=ot,exports.getExecOutput_1=Kh.getExecOutput=function(e,t,r){var n,o;return dm(this,void 0,void 0,(function*(){let i="",s="";const a=new hm.StringDecoder("utf8"),c=new hm.StringDecoder("utf8"),l=null===(n=null==r?void 0:r.listeners)||void 0===n?void 0:n.stdout,u=null===(o=null==r?void 0:r.listeners)||void 0===o?void 0:o.stderr,p=Object.assign(Object.assign({},null==r?void 0:r.listeners),{stdout:e=>{i+=a.write(e),l&&l(e)},stderr:e=>{s+=c.write(e),u&&u(e)}}),f=yield ot(e,t,Object.assign(Object.assign({},r),{listeners:p}));return i+=a.end(),s+=c.end(),{exitCode:f,stdout:i,stderr:s}}))};var vm={},ym=Kr&&Kr.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),gm=Kr&&Kr.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),wm=Kr&&Kr.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&ym(t,e,r);return gm(t,e),t},_m=Kr&&Kr.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(t){i(t)}}function a(e){try{c(n.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(vm,"__esModule",{value:!0}),vm.RetryHelper=void 0;const Em=wm(m());vm.RetryHelper=class{constructor(e,t,r){if(1>e)throw Error("max attempts should be greater than or equal to 1");if(this.maxAttempts=e,this.minSeconds=Math.floor(t),this.maxSeconds=Math.floor(r),this.minSeconds>this.maxSeconds)throw Error("min seconds should be less than or equal to max seconds")}execute(e,t){return _m(this,void 0,void 0,(function*(){let r=1;for(;this.maxAttempts>r;){try{return yield e()}catch(n){if(t&&!t(n))throw n;Em.info(n.message)}const o=this.getSleepAmount();Em.info(`Waiting ${o} seconds before trying again`),yield this.sleep(o),r++}return yield e()}))}getSleepAmount(){return Math.floor(Math.random()*(this.maxSeconds-this.minSeconds+1))+this.minSeconds}sleep(e){return _m(this,void 0,void 0,(function*(){return new Promise((t=>setTimeout(t,1e3*e)))}))}};var bm=Kr&&Kr.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),Om=Kr&&Kr.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Rm=Kr&&Kr.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&bm(t,e,r);return Om(t,e),t},Sm=Kr&&Kr.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(t){i(t)}}function a(e){try{c(n.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},Im=Kr&&Kr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ph,"__esModule",{value:!0}),Ph.evaluateVersions=Ph.isExplicitVersion=exports.findFromManifest_1=Ph.findFromManifest=exports.getManifestFromRepo_1=Ph.getManifestFromRepo=Ph.findAllVersions=exports.find_1=Ph.find=Ph.cacheFile=exports.cacheDir_1=Ph.cacheDir=exports.extractZip_1=Ph.extractZip=Ph.extractXar=exports.extractTar_1=Ph.extractTar=Ph.extract7z=exports.downloadTool_1=Ph.downloadTool=exports.HTTPError_1=Ph.HTTPError=void 0;const Tm=Rm(m()),xm=Rm(Ah),Pm=Rm(xr),Am=Rm(Hh),Nm=Rm(Tr),$m=Rm(Ar),Cm=Rm(Yn),Lm=Rm(Bh),km=Rm(Mr),Dm=Rm(kr),jm=Fr,Um=Im((function(e,t,r){var n=t&&r||0;"string"==typeof e&&(t="binary"===e?Array(16):null,e=null);var o=(e=e||{}).random||(e.rng||Xh)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t)for(var i=0;16>i;++i)t[n+i]=o[i];return t||Wh(o)})),Fm=Kh,Mm=vm;class Gm extends Error{constructor(e){super("Unexpected HTTP response: "+e),this.httpStatusCode=e,Object.setPrototypeOf(this,new.target.prototype)}}exports.HTTPError_1=Ph.HTTPError=Gm;const Bm="win32"===process.platform,Hm="darwin"===process.platform;exports.downloadTool_1=Ph.downloadTool=function(e,t,r,n){return Sm(this,void 0,void 0,(function*(){t=t||$m.join(ft(),Um.default()),yield xm.mkdirP($m.dirname(t)),Tm.debug("Downloading "+e),Tm.debug("Destination "+t);const o=dt("TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS",10),i=dt("TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS",20),s=new Mm.RetryHelper(3,o,i);return yield s.execute((()=>Sm(this,void 0,void 0,(function*(){return yield function(e,t,r,n){return Sm(this,void 0,void 0,(function*(){if(Pm.existsSync(t))throw Error(`Destination file path ${t} already exists`);const o=new Cm.HttpClient("actions/tool-cache",[],{allowRetries:!1});r&&(Tm.debug("set auth"),void 0===n&&(n={}),n.authorization=r);const i=yield o.get(e,n);if(200!==i.message.statusCode){const t=new Gm(i.message.statusCode);throw Tm.debug(`Failed to download from "${e}". Code(${i.message.statusCode}) Message(${i.message.statusMessage})`),t}const s=Dm.promisify(km.pipeline),a=dt("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY",(()=>i.message))();let c=!1;try{return yield s(a,Pm.createWriteStream(t)),Tm.debug("download complete"),c=!0,t}finally{if(!c){Tm.debug("download failed");try{yield xm.rmRF(t)}catch(l){Tm.debug(`Failed to delete '${t}'. ${l.message}`)}}}}))}(e,t||"",r,n)}))),(e=>!(e instanceof Gm&&e.httpStatusCode&&500>e.httpStatusCode&&408!==e.httpStatusCode&&429!==e.httpStatusCode)))}))},Ph.extract7z=function(e,t,r){return Sm(this,void 0,void 0,(function*(){jm.ok(Bm,"extract7z() not supported on current OS"),jm.ok(e,'parameter "file" is required'),t=yield st(t);const n=process.cwd();if(process.chdir(t),r)try{const t=["x",Tm.isDebug()?"-bb1":"-bb0","-bd","-sccUTF-8",e],n={silent:!0};yield Fm.exec(`"${r}"`,t,n)}finally{process.chdir(n)}else{const r=["-NoLogo","-Sta","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",`& '${$m.join(__dirname,"..","scripts","Invoke-7zdec.ps1").replace(/'/g,"''").replace(/"|\n|\r/g,"")}' -Source '${e.replace(/'/g,"''").replace(/"|\n|\r/g,"")}' -Target '${t.replace(/'/g,"''").replace(/"|\n|\r/g,"")}'`],o={silent:!0};try{const e=yield xm.which("powershell",!0);yield Fm.exec(`"${e}"`,r,o)}finally{process.chdir(n)}}return t}))},exports.extractTar_1=Ph.extractTar=function(e,t,r="xz"){return Sm(this,void 0,void 0,(function*(){if(!e)throw Error("parameter 'file' is required");t=yield st(t),Tm.debug("Checking tar --version");let n="";yield Fm.exec("tar --version",[],{ignoreReturnCode:!0,silent:!0,listeners:{stdout:e=>n+=""+e,stderr:e=>n+=""+e}}),Tm.debug(n.trim());const o=n.toUpperCase().includes("GNU TAR");let i;i=r instanceof Array?r:[r],Tm.isDebug()&&!r.includes("v")&&i.push("-v");let s=t,a=e;return Bm&&o&&(i.push("--force-local"),s=t.replace(/\\/g,"/"),a=e.replace(/\\/g,"/")),o&&(i.push("--warning=no-unknown-keyword"),i.push("--overwrite")),i.push("-C",s,"-f",a),yield Fm.exec("tar",i),t}))},Ph.extractXar=function(e,t,r=[]){return Sm(this,void 0,void 0,(function*(){let n;jm.ok(Hm,"extractXar() not supported on current OS"),jm.ok(e,'parameter "file" is required'),t=yield st(t),n=r instanceof Array?r:[r],n.push("-x","-C",t,"-f",e),Tm.isDebug()&&n.push("-v");const o=yield xm.which("xar",!0);var i;return yield Fm.exec(`"${o}"`,(i=n,Array.from(new Set(i)))),t}))},exports.extractZip_1=Ph.extractZip=function(e,t){return Sm(this,void 0,void 0,(function*(){if(!e)throw Error("parameter 'file' is required");return t=yield st(t),Bm?yield function(e,t){return Sm(this,void 0,void 0,(function*(){const r=e.replace(/'/g,"''").replace(/"|\n|\r/g,""),n=t.replace(/'/g,"''").replace(/"|\n|\r/g,""),o=yield xm.which("pwsh",!1);if(o){const e=["-NoLogo","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",["$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;",`try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${r}', '${n}', $true) }`,`catch { if (($_.Exception.GetType().FullName -eq 'System.Management.Automation.MethodException') -or ($_.Exception.GetType().FullName -eq 'System.Management.Automation.RuntimeException') ){ Expand-Archive -LiteralPath '${r}' -DestinationPath '${n}' -Force } else { throw $_ } } ;`].join(" ")];Tm.debug("Using pwsh at path: "+o),yield Fm.exec(`"${o}"`,e)}else{const e=["-NoLogo","-Sta","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",["$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;",`if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${r}' -DestinationPath '${n}' -Force }`,`else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${r}', '${n}', $true) }`].join(" ")],t=yield xm.which("powershell",!0);Tm.debug("Using powershell at path: "+t),yield Fm.exec(`"${t}"`,e)}}))}(e,t):yield function(e,t){return Sm(this,void 0,void 0,(function*(){const r=yield xm.which("unzip",!0),n=[e];Tm.isDebug()||n.unshift("-q"),n.unshift("-o"),yield Fm.exec(`"${r}"`,n,{cwd:t})}))}(e,t),t}))},exports.cacheDir_1=Ph.cacheDir=function(e,t,r,n){return Sm(this,void 0,void 0,(function*(){if(r=Lm.clean(r)||r,n=n||Nm.arch(),Tm.debug(`Caching tool ${t} ${r} ${n}`),Tm.debug("source dir: "+e),!Pm.statSync(e).isDirectory())throw Error("sourceDir is not a directory");const o=yield at(t,r,n);for(const t of Pm.readdirSync(e)){const r=$m.join(e,t);yield xm.cp(r,o,{recursive:!0})}return ct(t,r,n),o}))},Ph.cacheFile=function(e,t,r,n,o){return Sm(this,void 0,void 0,(function*(){if(n=Lm.clean(n)||n,o=o||Nm.arch(),Tm.debug(`Caching tool ${r} ${n} ${o}`),Tm.debug("source file: "+e),!Pm.statSync(e).isFile())throw Error("sourceFile is not a file");const i=yield at(r,n,o),s=$m.join(i,t);return Tm.debug("destination file "+s),yield xm.cp(e,s),ct(r,n,o),i}))},exports.find_1=Ph.find=function(e,t,r){if(!e)throw Error("toolName parameter is required");if(!t)throw Error("versionSpec parameter is required");r=r||Nm.arch(),lt(t)||(t=ut(it(e,r),t));let n="";if(t){t=Lm.clean(t)||"";const o=$m.join(pt(),e,t,r);Tm.debug("checking cache: "+o),Pm.existsSync(o)&&Pm.existsSync(o+".complete")?(Tm.debug(`Found tool in cache ${e} ${t} ${r}`),n=o):Tm.debug("not found")}return n},Ph.findAllVersions=it,exports.getManifestFromRepo_1=Ph.getManifestFromRepo=function(e,t,r,n="master"){return Sm(this,void 0,void 0,(function*(){let o=[];const i=`https://api.github.com/repos/${e}/${t}/git/trees/${n}`,s=new Cm.HttpClient("tool-cache"),a={};r&&(Tm.debug("set auth"),a.authorization=r);const c=yield s.getJson(i,a);if(!c.result)return o;let l="";for(const e of c.result.tree)if("versions-manifest.json"===e.path){l=e.url;break}a.accept="application/vnd.github.VERSION.raw";let u=yield(yield s.get(l,a)).readBody();if(u){u=u.replace(/^\uFEFF/,"");try{o=JSON.parse(u)}catch(p){Tm.debug("Invalid json")}}return o}))},exports.findFromManifest_1=Ph.findFromManifest=function(e,t,r,n=Nm.arch()){return Sm(this,void 0,void 0,(function*(){return yield Am._findMatch(e,t,r,n)}))},Ph.isExplicitVersion=lt,Ph.evaluateVersions=ut;var qm={};Object.defineProperty(qm,"__esModule",{value:!0}),qm.retryAsPromised=qm.TimeoutError=void 0;let Vm=class extends Error{constructor(e,t){super(e),this.name="TimeoutError",this.previous=t}};qm.TimeoutError=Vm,qm.retryAsPromised=ht;var zm=qm.default=ht;let Xm;const Wm=e=>{if(e)if("object"==typeof e)e={mode:511,...e};else if("number"==typeof e)e={mode:e};else{if("string"!=typeof e)throw new TypeError("invalid options argument");e={mode:parseInt(e,8)}}else e={mode:511};const t=e,r=e.fs||{};return e.mkdir=e.mkdir||r.mkdir||xr.mkdir,e.mkdirAsync=e.mkdirAsync?e.mkdirAsync:async(e,r)=>new Promise(((n,o)=>t.mkdir(e,r,((e,t)=>e?o(e):n(t))))),e.stat=e.stat||r.stat||xr.stat,e.statAsync=e.statAsync?e.statAsync:async e=>new Promise(((r,n)=>t.stat(e,((e,t)=>e?n(e):r(t))))),e.statSync=e.statSync||r.statSync||xr.statSync,e.mkdirSync=e.mkdirSync||r.mkdirSync||xr.mkdirSync,t},Km=(e,t,r)=>{const n=Ar.dirname(e),o={...Wm(t),recursive:!1};if(n===e)try{return o.mkdirSync(e,o)}catch(i){if(i&&"EISDIR"!==i.code)throw i;return}try{return o.mkdirSync(e,o),r||e}catch(i){const t=i;if(t&&"ENOENT"===t.code)return Km(e,o,Km(n,o,r));if(t&&"EEXIST"!==t.code&&t&&"EROFS"!==t.code)throw i;try{if(!o.statSync(e).isDirectory())throw i}catch(s){throw i}}},Ym=Object.assign((async(e,t,r)=>{const n=Wm(t);n.recursive=!1;const o=Ar.dirname(e);return o===e?n.mkdirAsync(e,n).catch((e=>{if(e&&"EISDIR"!==e.code)throw e})):n.mkdirAsync(e,n).then((()=>r||e),(async t=>{const i=t;if(i&&"ENOENT"===i.code)return Ym(o,n).then((t=>Ym(e,n,t)));if(i&&"EEXIST"!==i.code&&"EROFS"!==i.code)throw t;return n.statAsync(e).then((e=>{if(e.isDirectory())return r;throw t}),(()=>{throw t}))}))}),{sync:Km}),Jm=async(e,t,r)=>{if(r!==t)return e.statAsync(t).then((e=>e.isDirectory()?r:void 0),(r=>r&&"ENOENT"===r.code?Jm(e,Ar.dirname(t),t):void 0))},Qm=(e,t,r)=>{if(r!==t)try{return e.statSync(t).isDirectory()?r:void 0}catch(n){return n&&"ENOENT"===n.code?Qm(e,Ar.dirname(t),t):void 0}},Zm=(e,t)=>{const r=Wm(t);if(r.recursive=!0,Ar.dirname(e)===e)return r.mkdirSync(e,r);const n=Qm(r,e);try{return r.mkdirSync(e,r),n}catch(o){if(o&&"ENOENT"===o.code)return Km(e,r);throw o}},ev=Object.assign((async(e,t)=>{const r={...Wm(t),recursive:!0};return Ar.dirname(e)===e?await r.mkdirAsync(e,r):Jm(r,e).then((t=>r.mkdirAsync(e,r).then((e=>t||e)).catch((t=>{if(t&&"ENOENT"===t.code)return Ym(e,r);throw t}))))}),{sync:Zm}),tv=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,rv=e=>{if(/\0/.test(e))throw Object.assign(new TypeError("path must be a string without null bytes"),{path:e,code:"ERR_INVALID_ARG_VALUE"});if(e=Ar.resolve(e),"win32"===tv){const t=/[*|"<>?:]/,{root:r}=Ar.parse(e);if(t.test(e.substring(r.length)))throw Object.assign(Error("Illegal characters in path."),{path:e,code:"EINVAL"})}return e},nv=(process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version).replace(/^v/,"").split("."),ov=+nv[0]>10||10==+nv[0]&&+nv[1]>=12,iv=ov?e=>Wm(e).mkdirSync===xr.mkdirSync:()=>!1,sv=Object.assign(ov?e=>Wm(e).mkdir===xr.mkdir:()=>!1,{sync:iv}),av=(e,t)=>{e=rv(e);const r=Wm(t);return iv(r)?Zm(e,r):Km(e,r)},cv=Object.assign((async(e,t)=>{e=rv(e);const r=Wm(t);return sv(r)?ev(e,r):Ym(e,r)}),{mkdirpSync:av,mkdirpNative:ev,mkdirpNativeSync:Zm,mkdirpManual:Ym,mkdirpManualSync:Km,sync:av,native:ev,nativeSync:Zm,manual:Ym,manualSync:Km,useNative:sv,useNativeSync:iv}),lv=/v?(\d\S*)/,uv="darwin"===process.platform&&"x64"===process.arch?"15.0.7":"18.1.8",pv={llvm:uv,clang:uv,"clang++":uv,"clang-tidy":uv,clangtidy:uv,"clang-format":uv,clangformat:uv,ninja:"1.12.1",cmake:"3.30.2",gcovr:"5.2",conan:"1.64.1",meson:"1.5.1",kcov:"42",task:"3.38.0",doxygen:ke()?"1.11.0-4":"1.11.0",gcc:"win32"===process.platform?"14.2.0posix-18.1.8-12.0.0-ucrt-r1":"",powershell:"7.4.5"},fv="22.2.0",dv="3.7.9",hv={mingw:{24:"8.0.0-1",22:"8.0.0-1",20:"7.0.0-2"},gcovr:{24:"6.0",22:"6.0",20:"6.0",18:"5.0"},meson:{24:"1.0.0",22:"1.0.0",20:"1.0.0",18:"0.61.4"},nala:{24:"",22:"",21:"legacy",20:"legacy",18:"legacy",16:"legacy",14:"legacy"},kcov:{24:"42-binary",22:"42-binary",20:"40-binary",18:"40",16:"40",14:"40"},doxygen:{24:"1.11.0",22:"1.11.0",20:"1.10.0",18:"1.10.0"}},mv=ju((async function(e){const t=[];"linux"===process.platform?t.push("/home/runner/.local/bin/"):"darwin"===process.platform&&t.push("/usr/local/bin/");const r=(await exports.getExecOutput_1(e+' -c "import sys;print(sys.base_exec_prefix);"')).stdout.trim();return t.push(Ar.join(r,"Scripts"),Ar.join(r,"Scripts","bin"),Ar.join(r,"bin")),function(e){return[...new Set(e)]}(t)}),{promise:!0});var vv={};Object.defineProperty(vv,"__esModule",{value:!0});var yv=vv.getUbuntuVersion=void 0;const gv=Ur;yv=vv.getUbuntuVersion=async function(){if("linux"!==process.platform)return[];const e=await(t="lsb_release",r=["-a"],new Promise(((e,n)=>{gv.execFile(t,r,{encoding:"utf8",shell:!1},((o,i,s)=>{if(o)return"errno"in o&&"ENOENT"===o.code?void e(null):void n(Error(`Could not execute \`${t} ${r.join(" ")}\`: ${o} (stderr=${s})`));e(i)}))})));var t,r;if(null===e)return[];const n=/^Distributor ID:\s*(.+)$/,o=/^Description:\s*Ubuntu\s+(\d+)\.(\d+)(?:\.(\d+))?/,i=/^Release:\s*(\d+)\.(\d+)(?:\.(\d+))?$/;let s=null,a=null,c=!1;for(const l of e.split("\n")){const e=l.match(n);if(null!==e){if("Ubuntu"!==e[1])return[];c=!0}const t=l.match(o);t&&(s=t);const r=l.match(i);if(r&&(a=r),c&&s&&a)break}if(!c)return[];for(const l of[s,a])if(l){const e=[l[1],l[2]];return l[3]&&e.push(l[3]),e.map((e=>parseInt(e,10)))}return[]};const wv=ju((async function(){try{if(De()){try{null===ca.sync("lsb_release",{nothrow:!0})&&await Ie([{name:"lsb-release"}])}catch{return Lt()}const e=await yv();return 0===e.length?Lt():e}return null}catch(e){return y(""+e),null}}),{promise:!0}),_v=ju((async function(){let e=process.env.PIPX_HOME;if(void 0!==e)return e;const t=te("~/.local/pipx");if(await ee(t))return t;switch(process.platform){case"win32":e=te("~/AppData/Local/pipx");break;case"darwin":e=te("~/Library/Application Support/pipx");break;default:e=te("~/.local/share/pipx")}return await cv(e),await cv(Ar.join(e,"trash")),await cv(Ar.join(e,"shared")),await cv(Ar.join(e,"venv")),e}),{promise:!0}),Ev=ju((async function(){if(void 0!==process.env.PIPX_BIN_DIR)return process.env.PIPX_BIN_DIR;const e=te("~/.local/bin");return await se(e,py),await cv(e),e}),{promise:!0});let bv;const Ov=new Map([[24,["Sequoia","15"]],[23,["Sonoma","14"]],[22,["Ventura","13"]],[21,["Monterey","12"]],[20,["Big Sur","11"]],[19,["Catalina","10.15"]],[18,["Mojave","10.14"]],[17,["High Sierra","10.13"]],[16,["Sierra","10.12"]],[15,["El Capitan","10.11"]],[14,["Yosemite","10.10"]],[13,["Mavericks","10.9"]],[12,["Mountain Lion","10.8"]],[11,["Lion","10.7"]],[10,["Snow Leopard","10.6"]],[9,["Leopard","10.5"]],[8,["Tiger","10.4"]],[7,["Panther","10.3"]],[6,["Jaguar","10.2"]],[5,["Puma","10.1"]]]),Rv=ju((function(){if("darwin"!==process.platform)return[];const{version:e}=function(e){e=Number((e||Tr.release()).split(".")[0]);const[t,r]=Ov.get(e)||["Unknown",""];return{name:t,version:r}}();return e.split(".").map((e=>Number.parseInt(e,10)))})),Sv="string"==typeof __dirname?__dirname:Ar.dirname(Gr.fileURLToPath("undefined"==typeof document?require("url").pathToFileURL(__filename).href:Vr&&Vr.src||new URL("setup-cpp.js",document.baseURI).href)),Iv="string"==typeof __dirname?__dirname:Ar.dirname(Gr.fileURLToPath("undefined"==typeof document?require("url").pathToFileURL(__filename).href:Vr&&Vr.src||new URL("setup-cpp.js",document.baseURI).href)),Tv="string"==typeof __dirname?__dirname:Ar.dirname(Gr.fileURLToPath("undefined"==typeof document?require("url").pathToFileURL(__filename).href:Vr&&Vr.src||new URL("setup-cpp.js",document.baseURI).href));class xv extends Error{constructor(e){super(e),this.name="TimeoutError"}}class Pv extends Error{constructor(e){super(),this.name="AbortError",this.message=e}}const Av=e=>void 0===globalThis.DOMException?new Pv(e):new DOMException(e),Nv=e=>{const t=void 0===e.reason?Av("This operation was aborted."):e.reason;return t instanceof Error?t:Av(t)},$v=m(),Cv=Ur,Lv=xr,kv=Ar,Dv=jr,jv=Dv.env["ProgramFiles(x86)"],Uv=[Dv.env["ProgramFiles(x86)"],Dv.env.ProgramFiles],Fv=["Enterprise","Professional","Community","BuildTools"],Mv=["2022","2019","2017"],Gv={2022:"17.0",2019:"16.0",2017:"15.0",2015:"14.0",2013:"12.0"};var Bv=sr;const Hv=jv+"\\Microsoft Visual Studio\\Installer";var qv=cr,Vv=function(e,t,r,n,o,i){if("win32"!=Dv.platform)return void $v.info("This is not a Windows virtual environment, bye!");Dv.env.PATH+=kv.delimiter+Hv;let s={win32:"x86",win64:"x64",x86_64:"x64","x86-64":"x64"};e.toLowerCase()in s&&(e=s[e.toLowerCase()]);var a=[e];n&&!0===JSON.parse(n)&&a.push("uwp"),t&&a.push(t),r&&a.push("-vcvars_ver="+r),o&&!0===JSON.parse(o)&&a.push("-vcvars_spectre_libs=spectre");const c=`"${cr(i)}" ${a.join(" ")}`;$v.debug("vcvars command-line: "+c);const l=(""+Cv.execSync(`set && cls && ${c} && cls && set`,{shell:"cmd"})).split("\f"),u=l[0].split("\r\n"),p=l[1].split("\r\n"),f=l[2].split("\r\n"),d=p.filter((e=>!(!e.match(/^\[ERROR.*\]/)||e.match(/Error in script usage. The correct usage is:$/))));if(d.length>0)throw Error("invalid parameters\r\n"+d.join("\r\n"));let h={};for(let m of u){const[e,t]=m.split("=");h[e]=t}$v.startGroup("Environment variables");for(let m of f){if(!m.includes("="))continue;let[e,t]=m.split("=");t!==h[e]&&($v.info("Setting "+e),lr(e)&&(t=t.split(";").filter((function(e,t,r){return r.indexOf(e)===t})).join(";")),$v.exportVariable(e,t))}$v.endGroup(),$v.info("Configured Developer Command Prompt")},zv=(e=>(e[e.All=0]="All",e[e.ClangFormat=1]="ClangFormat",e[e.Core=2]="Core",e))(zv||{});const Xv="string"==typeof __dirname?__dirname:Ar.dirname(Gr.fileURLToPath("undefined"==typeof document?require("url").pathToFileURL(__filename).href:Vr&&Vr.src||new URL("setup-cpp.js",document.baseURI).href)),Wv="string"==typeof __dirname?__dirname:Ar.dirname(Gr.fileURLToPath("undefined"==typeof document?require("url").pathToFileURL(__filename).href:Vr&&Vr.src||new URL("setup-cpp.js",document.baseURI).href)),Kv=ju((async function(e,t,r){const[n,o]=await Promise.all([vr(e,t,r),gr()]);return await Jv(r),n}),{promise:!0}),Yv=ju((async function(e){if(De())if(e>10)await Ie([{name:"libtinfo-dev"}]);else try{await Ie([{name:"libtinfo5"}])}catch(t){w(`Failed to install libtinfo5 ${t}\nManually installing the package`);const e=`libtinfo5_6.3-2ubuntu0.1_${Oh.includes(process.arch)?"amd64":Sh.includes(process.arch)?"arm64":process.arch}.deb`,r="http://launchpadlibrarian.net/666971015/"+e,n=new Bd.DownloaderHelper(r,Tr.tmpdir(),{fileName:e});n.on("error",(e=>{throw Error(`Failed to download ${r}: ${e}`)})),await n.start(),j("dpkg",["-i",Ar.join(Tr.tmpdir(),e)])}else ke()?await Me("ncurses5-compat-libs",void 0,"yay"):Le()&&await Fe([{name:"ncurses-compat-libs"}])}),{promise:!0}),Jv=ju((async function(e){"linux"===process.platform&&await Yt($t("gcc",void 0,await wv()),"",e,40)}),{promise:!0}),Qv="string"==typeof __dirname?__dirname:Ar.dirname(Gr.fileURLToPath("undefined"==typeof document?require("url").pathToFileURL(__filename).href:Vr&&Vr.src||new URL("setup-cpp.js",document.baseURI).href));let Zv,ey=!1;const ty={llvm:dr,clang:dr,"clang++":dr},ry={gcc:Yt,"g++":Yt},ny={mingw:Jt},oy={msvc:wr,cl:wr,msbuild:wr,visualstudio:wr},iy={appleclang:ir,applellvm:ir,"apple-clang":ir,"apple-llvm":ir},sy={cmakelang:Gt,"cmake-lint":Gt,"cmake-format":Gt,cmakelint:Gt,cmakeformat:Gt},ay=["llvm","clang","clang++","clang-tidy","clang-format","clangtidy","clangformat"],cy={nala:async function(e,t,r){if(!De())return;if("string"==typeof Zv)return{binDir:Zv};const n=ca.sync("nala",{nothrow:!0});if(null!==n)return Zv=Ar.dirname(n),{binDir:Zv};await Ie([{name:"python3-apt"}]),Zv="/usr/bin";try{const t=await Re({name:"nala",version:e});if(void 0!==t)return await Ie([{name:t}]),{binDir:Zv}}catch(o){w("Failed to install nala: "+o)}try{const e=await Re({name:"nala-legacy"});if(void 0!==e)return await Ie([{name:e}],!0),{binDir:Zv}}catch(o){w("Failed to install nala-legacy: "+o)}return await async function(){const e=new Bd.DownloaderHelper("https://gitlab.com/volian/volian-archive/-/raw/main/install-nala.sh",Tr.tmpdir(),{fileName:"install-nala.sh"});e.on("error",(e=>{throw Error("Failed to download install-nala.sh: "+e)})),await e.start();const t=Ar.join(Tr.tmpdir(),"install-nala.sh"),r=await Is(t,"utf8");await Ds(t,r.replace(/sudo/g,"")),await Ie([{name:"wget"}]);try{j("bash",[t])}catch(o){v("Failed to install nala via installer: "+o),j("apt",["install","-y","-t","nala","nala"])}}(),{binDir:Zv}},brew:Ae,choco:je,python:It,powershell:Or,pwsh:Or,...ty,...ry,...ny,...oy,...iy,...sy,cmake:Ot,ninja:tr,vcpkg:async function(e,t,r){return ey&&null!==ca.sync("vcpkg",{nothrow:!0})?{binDir:Ar.dirname(ca.sync("vcpkg"))}:("linux"===process.platform&&(ke()?await Promise.all([Me("curl"),Me("zip"),Me("unzip"),Me("tar"),Me("git"),Me("pkg-config")]):Le()?await Fe([{name:"curl"},{name:"zip"},{name:"unzip"},{name:"tar"},{name:"git"},{name:"pkg-config"}]):De()&&await Ie([{name:"curl"},{name:"zip"},{name:"unzip"},{name:"tar"},{name:"git"},{name:"pkg-config"}])),await ee(Ar.join(t,We("bootstrap-vcpkg",".bat")))?g(`Vcpkg folder already exists at ${t}. Skipping the clone`):A("git",["clone","https://github.com/microsoft/vcpkg"],{cwd:Ar.dirname(t),stdio:"inherit"}),""!==e&&"true"!==e&&(w("Checking out vcpkg version "+e),A("git",["checkout",e],{cwd:t,stdio:"inherit"})),A(We(Ke("bootstrap-vcpkg"),".bat"),{cwd:t,shell:!0,stdio:"inherit"}),await B(t),await se(t,py),ey=!0,{binDir:t})},bazel:async function(e,t,r){switch(process.platform){case"win32":return Ue("bazelisk",e);case"darwin":return Ce("bazelisk",e);case"linux":if(ke())throw Error("installing bazel on Arch linux is not supported yet");if(Le())return await Fe([{name:"dnf-plugins-core"}]),j("dnf",["copr","enable","vbatts/bazel"]),Fe([{name:"bazel4"}]);if(De())return j("bash",["-c",`echo "deb [arch=amd64 signed-by=${await Te({fileName:"bazel-archive-keyring.gpg",keyUrl:"https://bazel.build/bazel-release.pub.gpg"})}] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list`]),Ie([{name:"bazel",version:e}],!0);throw Error("Unsupported linux distribution");default:throw Error("Unsupported platform")}},conan:function(e,t,r){return kt("conan",e)},meson:function(e,t,r){return kt("meson",e)},gcovr:function(e,t,r){return kt("gcovr",e)},opencppcoverage:_r,OpenCppCoverage:_r,ccache:function(e,t,r){switch(process.platform){case"win32":return Ue("ccache",e);case"darwin":return Ce("ccache",e);case"linux":if(ke())return Me("ccache",e);if(Le())return Fe([{name:"ccache",version:e}]);if(De())return Ie([{name:"ccache",version:e}]);throw Error("Unsupported linux distribution");default:throw Error("Unsupported platform")}},sccache:function(e,t,r){switch(process.platform){case"win32":return Ue("sccache",e);case"linux":case"darwin":return Ce("sccache",e);default:throw Error("Unsupported platform")}},doxygen:async function(e,t,r){switch(process.platform){case"win32":{await zm((()=>Ue("doxygen.install",e)),{name:"doxygen.install",max:4,backoffBase:2e3,report:e=>w(e)});const t={binDir:await async function(){if("win32"===process.platform){for(const e of["C:/ProgramData/chocolatey/bin","C:/Program Files/doxygen/bin","C:/Program Files (x86)/doxygen"])if(await ee(Ar.join(e,"doxygen.exe")))return await se(e,py),e;throw Error("Failed to find doxygen binary")}throw Error("Unsupported platform")}()};return await Bt($t("graphviz",void 0)),t}case"darwin":{const e=await Ce("doxygen",void 0);return Rv()[0]>11&&await Bt($t("graphviz",void 0)),e}case"linux":{let o;if(""===e||ke()||Le())if(ke())o=await Me("doxygen",e);else{if(Le())return Fe([{name:"doxygen",version:e}]);if(!De())throw Error("Unsupported linux distributions");o=await Ie([{name:"doxygen",version:e}])}else{if(!De())throw Error("Unsupported linux distributions");try{o=await Et("doxygen",e,qt,t,r);try{await Ie([{name:"libclang-cpp9"}])}catch(n){w("Failed to download libclang-cpp9 that might be needed for running doxygen. "+n)}}catch(n){g(`Failed to download doxygen binary. ${n}. Falling back to apt-get.`),o=await Ie([{name:"doxygen"}])}}return await Bt($t("graphviz",void 0,await wv())),o}default:throw Error("Unsupported platform")}},graphviz:Bt,cppcheck:async function(e,t,r){switch(process.platform){case"win32":return await Ue("cppcheck",e),{binDir:await async function(){const e="C:/Program Files/Cppcheck";return await se(e,py),e}()};case"darwin":return Ce("cppcheck",e);case"linux":if(ke())return Me("cppcheck",e);if(Le())return Fe([{name:"ccache",version:e}]);if(De())return Ie([{name:"cppcheck",version:e}]);throw Error("Unsupported linux distribution");default:throw Error("Unsupported platform")}},cpplint:function(e,t,r){return kt("cpplint",e)},flawfinder:function(e,t,r){return kt("flawfinder",e)},lizard:function(e,t,r){return kt("lizard",e)},infer:function(e,t,r){return Et("infer",e,Zt,t,r)},"clang-tidy":mr,clangtidy:mr,"clang-format":hr,clangformat:hr,vcvarsall:ur,kcov:async function(e,t,r){if("linux"!==process.platform)return void w("Kcov is not supported on non-linux");const n=e.split("-");let o=function(e){return e.match(/^v/)?e:"v"+e}(n[0]);const i=n[1],s=function(e){return Number.parseInt(e.replace(/^v/,""),10)}(o);let a;return 38===s&&(o="v38"),"binary"!==i||39>s?(a=await Et("kcov",o,nr,t,r),a):(a=await Et("kcov",o,rr,t,r),ke()?await Me("binutils"):Le()?await Fe([{name:"binutils"}]):De()&&await Ie([{name:"libbinutils"}]),a)},make:async function(e,t,r){switch(process.platform){case"win32":return Ue("make",e);case"darwin":{await Ce("make",e);const t=Ar.join($e(),"opt/make/libexec/gnubin");return await se(t,py),{binDir:t}}case"linux":if(ke())return Me("make",e);if(Le())return Fe([{name:"make",version:e}]);if(De())return Ie([{name:"make",version:e}]);throw Error("Unsupported linux distribution");default:throw Error("Unsupported platform")}},task:function(e,t,r){return Et("task",e,Rr,t,r)},sevenzip:mt,"7zip":mt,"7z":mt},ly=Object.keys(cy),uy=["compiler","architecture","timeout",...ly],py={rcPath:te("~/.cpprc"),guard:"cpp"};(async function(e){var t,r,n;let o=Promise.resolve();Yr.GITHUB_ACTIONS||(o=async function(){try{await Md({pkg:Gd})}catch(e){y("Failed to check for updates: "+(e instanceof Error?e.message+e.stack:e))}}(),process.env.ACTIONS_ALLOW_UNSECURE_COMMANDS="true");const i=function(e){return function(e,t){var r,n,o,i,s,a={_:[]},c=0,l=0,u=0,p=(e=e||[]).length;const f=void 0!==(t=t||{}).alias,d=void 0!==t.unknown,h=void 0!==t.default;if(t.alias=t.alias||{},t.string=me(t.string),t.boolean=me(t.boolean),f)for(r in t.alias)for(n=t.alias[r]=me(t.alias[r]),c=0;n.length>c;c++)(t.alias[n[c]]=n.concat(r)).splice(c,1);for(c=t.boolean.length;c-- >0;)for(l=(n=t.alias[t.boolean[c]]||[]).length;l-- >0;)t.boolean.push(n[l]);for(c=t.string.length;c-- >0;)for(l=(n=t.alias[t.string[c]]||[]).length;l-- >0;)t.string.push(n[l]);if(h)for(r in t.default)if(i=typeof t.default[r],n=t.alias[r]=t.alias[r]||[],void 0!==t[i])for(t[i].push(r),c=0;n.length>c;c++)t[i].push(n[c]);const m=d?Object.keys(t.alias):[];for(c=0;p>c;c++){if("--"===(o=e[c])){a._=a._.concat(e.slice(++c));break}for(l=0;o.length>l&&45===o.charCodeAt(l);l++);if(0===l)a._.push(o);else if("no-"===o.substring(l,l+3)){if(i=o.substring(l+3),d&&!~m.indexOf(i))return t.unknown(o);a[i]=!1}else{for(u=l+1;o.length>u&&61!==o.charCodeAt(u);u++);for(i=o.substring(l,u),s=o.substring(++u)||c+1===p||45===(""+e[c+1]).charCodeAt(0)||e[++c],n=2===l?[i]:i,u=0;n.length>u;u++){if(i=n[u],d&&!~m.indexOf(i))return t.unknown("-".repeat(l)+i);ve(a,i,n.length>u+1||s,t)}}}if(h)for(r in t.default)void 0===a[r]&&(a[r]=t.default[r]);if(f)for(r in a)for(n=t.alias[r]||[];n.length>0;)a[n.shift()]=a[r];return a}(e,{string:[...uy,"timeout"],default:Object.fromEntries(uy.map((e=>[e,Sr(e)]))),alias:{h:"help"},boolean:"help"})}(e);i.help&&(w('\nsetup-cpp [options]\nsetup-cpp --compiler llvm --cmake true --ninja true --ccache true --vcpkg true\n\nInstall all the tools required for building and testing C++/C projects.\n\n--architecture\t the cpu architecture to install the tools for. By default it uses the current CPU architecture.\n--timeout\t the timeout for the installation of each tool in minutes. By default it is 10 minutes.\n--compiler\t the to install.\n \t You can specify the version instead of specifying just the name e.g: --compiler \'llvm-13.0.0\'\n--$tool_name\t pass "true" or pass the you would like to install for this tool. e.g. --conan true or --conan "1.42.1"\n\nAll the available tools:\n'),console.table({"compiler and analyzer":{tools:"--llvm, --gcc, --msvc, --apple-clang, --vcvarsall"},"build system":{tools:"--cmake, --ninja, --meson, --make, --task, --bazel"},"package manager":{tools:"--vcpkg, --conan, --choco, --brew, --nala"},"analyzer/linter":{tools:"--clang-tidy, --clang-format, --cppcheck, --cpplint, --flawfinder, --lizard, --infer, , --cmakelang, --cmake-lint, --cmake-format"},cache:{tools:"--ccache, --sccache"},documentation:{tools:"--doxygen, --graphviz"},coverage:{tools:"--gcovr, --opencppcoverage, --kcov"},other:{tools:"--python, --powershell, --sevenzip"}},["tools"]));const s=null!=(t=i.architecture)?t:process.arch,a=null!=(r=process.env.SETUP_CPP_DIR)?r:te("~"),c=[],l=[],u=mp.create({autoloadLocales:!0});let p,f;mp.addLocale(vp),ap.addLocale(cp);const d=await wv(),h=void 0!==i.compiler?function(e){try{const t=e.split("-"),r=t[0];if(1 in t){const e=t[1];return null===Fp(e)&&w(`Invalid semver version ${e} used for the compiler.`),{compiler:r,version:e}}return{compiler:r,version:void 0}}catch(t){return v(`Failed to parse the compiler info ${e}: ${t}`),{compiler:e,version:void 0}}}(i.compiler):void 0;if(!function(e,t,r){var n,o;const i=void 0!==r&&t.includes(r.compiler),s=(i?t:t.filter((e=>"compiler"!==e))).filter((t=>void 0!==e[t])),a=s.filter((t=>!Ct(i&&"compiler"===t&&void 0!==r?r.version:e[t]))),c=0!==a.length?i&&"compiler"===a[0]&&void 0!==r?null!=(n=r.version)?n:"true":null!=(o=e[a[0]])?o:"true":"true";if(a.some((t=>i&&"compiler"===t&&void 0!==r?e.compiler!==`${r.compiler}-${c}`:e[t]!==c)))return!1;for(const l of s)e[l]=i&&"compiler"===l&&void 0!==r?`${r.compiler}-${c}`:c;return!0}(i,[...ay,"compiler"],h))return v("The same version must be used for llvm, clang-format and clang-tidy"),1;ke()&&"string"==typeof i.cppcheck&&"string"==typeof i.gcovr&&(w("installing python-pygments to avoid conflicts with cppcheck and gcovr on Arch linux"),await Me("python-pygments"));let m=!1;for(const v of ly){if(Yr.isCI&&0!==l.length){m=!0;break}const e=i[v];void 0!==e&&(p=Date.now(),await pr(v,e,d,s,a,c,l,60*Number.parseFloat(null!=(n=i.timeout)?n:"20")*1e3),f=Date.now(),w("took "+(u.format(p,f)||"0 seconds")))}if(!m&&void 0!==h){const e=Date.now();await async function(e,t,r,n,o,i,s){let a;try{if(uo.startGroup(`Installing ${e} ${null!=t?t:""}`),e in ty)a=await dr($t("llvm",t,r),Ar.join(n,"llvm"),o),await oe("GCOV","llvm-cov gcov",py);else if(e in ry){const e=$t("gcc",t,r);a=await Yt(e,Ar.join(n,"gcc"),o),await Qt(e)}else if(e in ny){const e=$t("mingw",t,r);a=await Jt(e,Ar.join(n,"gcc"),o),await Qt(e)}else e in oy?a=await wr($t("msvc",t,r),Ar.join(n,"msvc"),o):e in iy?await ir():(a=null,s.push("Unsupported compiler "+e))}catch(c){v(c),s.push(`Failed to install the ${e} ${t}`)}null!==a&&i.push(Ir(e,a)),uo.endGroup()}(h.compiler,h.version,d,a,s,c,l);const t=Date.now();w("took "+(u.format(e,t)||"0 seconds"))}if(await async function(e){if(await ee(e.rcPath)){const t=(await Mu(e.rcPath,"utf-8")).split("\n"),r=[...new Set(t.reverse())].reverse();await Gu(e.rcPath,r.join("\n")),await B(e.rcPath)}}(py),0===c.length&&0===l.length)return y("setup-cpp was called without any arguments. Nothing to do."),0;for(const v of c)console.log(`${v}`);for(const y of l)v(y);if(w("setup-cpp finished"),!Yr.GITHUB_ACTIONS)switch(process.platform){case"win32":y("Run `RefreshEnv.cmd` or restart your shell to update the environment.");break;case"linux":case"darwin":y("Run `source ~/.cpprc` or restart your shell to update the environment.")}return await o,0===l.length?0:1})(process.argv).then((e=>{process.exitCode=e})).catch((e=>{v("main() panicked!"),v(e),process.exitCode=1})),exports.HttpClient=Wn,exports.ciInfo=Yr,exports.commonjsGlobal=Kr,exports.coreExports=uo,exports.getAugmentedNamespace=r,exports.getDefaultExportFromCjs=t,exports.info=w,exports.pathExists=ee,exports.semver=bd,exports.warning=y; //# sourceMappingURL=setup-cpp.js.map diff --git a/dist/legacy/setup-cpp.js.map b/dist/legacy/setup-cpp.js.map index 640264fa..35e61dbc 100644 --- a/dist/legacy/setup-cpp.js.map +++ b/dist/legacy/setup-cpp.js.map @@ -1 +1 @@ -{"version":3,"file":"setup-cpp.js","sources":["../../node_modules/.pnpm/@actions+core@1.10.1/node_modules/@actions/core/lib/command.js","../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/rng.js","../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/validate.js","../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/stringify.js","../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/parse.js","../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/v35.js","../../node_modules/.pnpm/@actions+http-client@2.2.3_patch_hash=gqcf2jay7nqqezf3jni6mxu74u/node_modules/@actions/http-client/lib/esnext/proxy.js","../../node_modules/.pnpm/tunnel@0.0.6/node_modules/tunnel/lib/tunnel.js","../../node_modules/.pnpm/@actions+core@1.10.1/node_modules/@actions/core/lib/summary.js","../../node_modules/.pnpm/@actions+core@1.10.1/node_modules/@actions/core/lib/core.js","../../node_modules/.pnpm/@actions+core@1.10.1/node_modules/@actions/core/lib/oidc-utils.js","../../node_modules/.pnpm/@actions+core@1.10.1/node_modules/@actions/core/lib/path-utils.js","../../packages/ci-log/dist/index.js","../../node_modules/.pnpm/is-plain-obj@4.1.0/node_modules/is-plain-obj/index.js","../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js","../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/resolveCommand.js","../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/enoent.js","../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/index.js","../../node_modules/.pnpm/path-key@4.0.0/node_modules/path-key/index.js","../../node_modules/.pnpm/unicorn-magic@0.3.0/node_modules/unicorn-magic/node.js","../../node_modules/.pnpm/timers-browserify@2.0.12/node_modules/timers-browserify/main.js","../../node_modules/.pnpm/strip-final-newline@4.0.0/node_modules/strip-final-newline/index.js","../../node_modules/.pnpm/is-stream@4.0.1/node_modules/is-stream/index.js","../../node_modules/.pnpm/@sec-ant+readable-stream@0.4.1/node_modules/@sec-ant/readable-stream/dist/ponyfill/asyncIterator.js","../../node_modules/.pnpm/pretty-ms@9.1.0/node_modules/pretty-ms/index.js","../../node_modules/.pnpm/parse-ms@4.0.0/node_modules/parse-ms/index.js","../../node_modules/.pnpm/@sindresorhus+merge-streams@4.0.0/node_modules/@sindresorhus/merge-streams/index.js","../../packages/exec-powershell/dist/index.js","../../node_modules/.pnpm/admina@1.0.1/node_modules/admina/dist/index.node.mjs","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/mixin.js","../../node_modules/.pnpm/ext@1.7.0/node_modules/ext/global-this/index.js","../../node_modules/.pnpm/ext@1.7.0/node_modules/ext/global-this/is-implemented.js","../../node_modules/.pnpm/ext@1.7.0/node_modules/ext/global-this/implementation.js","../../node_modules/.pnpm/es6-symbol@3.1.4/node_modules/es6-symbol/validate-symbol.js","../../node_modules/.pnpm/es6-symbol@3.1.4/node_modules/es6-symbol/is-symbol.js","../../node_modules/.pnpm/es6-symbol@3.1.4/node_modules/es6-symbol/index.js","../../node_modules/.pnpm/es6-symbol@3.1.4/node_modules/es6-symbol/is-implemented.js","../../node_modules/.pnpm/es6-symbol@3.1.4/node_modules/es6-symbol/polyfill.js","../../node_modules/.pnpm/es6-symbol@3.1.4/node_modules/es6-symbol/lib/private/generate-name.js","../../node_modules/.pnpm/es6-symbol@3.1.4/node_modules/es6-symbol/lib/private/setup/standard-symbols.js","../../node_modules/.pnpm/es6-symbol@3.1.4/node_modules/es6-symbol/lib/private/setup/symbol-registry.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/array/from/index.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/array/from/is-implemented.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/array/from/shim.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/function/is-arguments.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/function/is-function.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/string/is-string.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/array/#/e-index-of.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/number/is-nan/index.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/number/is-nan/is-implemented.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/number/is-nan/shim.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/map.js","../../node_modules/.pnpm/next-tick@1.1.0/node_modules/next-tick/index.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/is-callable.js","../../node_modules/.pnpm/is-promise@2.2.2/node_modules/is-promise/index.js","../../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/ext/promise.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/primitive-set.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/validate-stringifiable-value.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/validate-stringifiable.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/to-short-string-representation.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/safe-to-string.js","../../node_modules/.pnpm/path-exists@5.0.0/node_modules/path-exists/index.js","../../packages/untildify-user/dist/index.js","../../packages/envosman/dist/rc-file.js","../../packages/envosman/dist/add-env.js","../../packages/envosman/dist/utils.js","../../packages/envosman/dist/add-path.js","../../node_modules/.pnpm/time-delta@https+++codeload.github.com+aminya+time-delta+tar.gz+69d91a4/node_modules/time-delta/lib/time-delta.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/classes/range.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/classes/comparator.js","../../node_modules/.pnpm/simple-update-notifier@2.0.0/node_modules/simple-update-notifier/build/index.js","../../node_modules/.pnpm/mri@1.2.0/node_modules/mri/lib/index.mjs","../../packages/setup-apt/dist/alternatives.js","../../packages/setup-apt/dist/apt-env.js","../../packages/setup-apt/dist/get-apt.js","../../node_modules/.pnpm/escape-string-regexp@5.0.0/node_modules/escape-string-regexp/index.js","../../packages/setup-apt/dist/is-installed.js","../../packages/setup-apt/dist/qualify-install.js","../../packages/setup-apt/dist/install.js","../../packages/setup-apt/dist/apt-repository.js","../../packages/setup-apt/dist/apt-key.js","../../packages/setup-brew/dist/install.js","../../packages/setup-brew/dist/install-pack.js","../../src/utils/env/hasDnf.ts","../../src/utils/env/isArch.ts","../../src/utils/env/isUbuntu.ts","../../src/chocolatey/chocolatey.ts","../../src/utils/setup/setupChocoPack.ts","../../src/utils/setup/setupDnfPack.ts","../../src/utils/setup/setupPacmanPack.ts","../../node_modules/.pnpm/patha@0.4.1/node_modules/patha/dist/index.node.mjs","../../node_modules/.pnpm/@actions+io@1.1.3/node_modules/@actions/io/lib/io.js","../../node_modules/.pnpm/@actions+exec@1.1.1/node_modules/@actions/exec/lib/exec.js","../../node_modules/.pnpm/@actions+tool-cache@2.0.1/node_modules/@actions/tool-cache/lib/tool-cache.js","../../node_modules/.pnpm/retry-as-promised@7.0.4/node_modules/retry-as-promised/dist/index.js","../../src/sevenzip/sevenzip.ts","../../src/utils/setup/extract.ts","../../src/utils/setup/setupBin.ts","../../src/cmake/cmake.ts","../../src/utils/setup/version.ts","../../src/utils/std/index.ts","../../src/python/python.ts","../../src/versions/versions.ts","../../src/utils/env/ubuntu_version.ts","../../src/utils/setup/setupPipPack.ts","../../src/cmakelang/cmakelang.ts","../../src/graphviz/graphviz.ts","../../src/utils/setup/setupDmg.ts","../../src/doxygen/doxygen.ts","../../src/macos-sdk/macos-sdk.ts","../../src/utils/asset/load-assets.ts","../../src/gcc/gcc.ts","../../src/gcovr/gcovr.ts","../../src/infer/infer.ts","../../src/ninja/ninja.ts","../../src/kcov/kcov.ts","../../src/llvm/apple-clang.ts","../../node_modules/.pnpm/msvc-dev-cmd@https+++codeload.github.com+aminya+msvc-dev-cmd+tar.gz+c01f519bd995460228ed3dec4df51df92dc290fd/node_modules/msvc-dev-cmd/lib.js","../../src/vcvarsall/vcvarsall.ts","../../src/installTool.ts","../../node_modules/.pnpm/p-timeout@6.1.2/node_modules/p-timeout/index.js","../../src/llvm/llvm_url.ts","../../src/llvm/llvm.ts","../../src/llvm/llvm_installer.ts","../../src/msvc/msvc.ts","../../src/opencppcoverage/opencppcoverage.ts","../../src/powershell/powershell.ts","../../src/task/task.ts","../../src/cli-options.ts","../../node_modules/.pnpm/ci-info@4.0.0/node_modules/ci-info/index.js","../../node_modules/.pnpm/@actions+core@1.10.1/node_modules/@actions/core/lib/utils.js","../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/regex.js","../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/v1.js","../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/v3.js","../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/md5.js","../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/v5.js","../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/sha1.js","../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/nil.js","../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/v4.js","../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/version.js","../../node_modules/.pnpm/@actions+core@1.10.1/node_modules/@actions/core/lib/file-command.js","../../node_modules/.pnpm/tunnel@0.0.6/node_modules/tunnel/index.js","../../node_modules/.pnpm/@actions+http-client@2.2.3_patch_hash=gqcf2jay7nqqezf3jni6mxu74u/node_modules/@actions/http-client/lib/esnext/index.js","../../node_modules/.pnpm/@actions+http-client@2.2.3_patch_hash=gqcf2jay7nqqezf3jni6mxu74u/node_modules/@actions/http-client/lib/auth.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/arguments/file-url.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/methods/parameters.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/utils/uint-array.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/methods/template.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/utils/standard-stream.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/arguments/specific.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/verbose/values.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/arguments/escape.js","../../node_modules/.pnpm/figures@6.1.0/node_modules/figures/index.js","../../node_modules/.pnpm/is-unicode-supported@2.1.0/node_modules/is-unicode-supported/index.js","../../node_modules/.pnpm/yoctocolors@2.1.1/node_modules/yoctocolors/base.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/verbose/default.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/verbose/custom.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/verbose/log.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/verbose/info.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/return/duration.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/arguments/command.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/verbose/start.js","../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js","../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js","../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js","../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js","../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/escape.js","../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js","../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js","../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/readShebang.js","../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/parse.js","../../node_modules/.pnpm/npm-run-path@6.0.0/node_modules/npm-run-path/index.js","../../node_modules/.pnpm/setimmediate@1.0.5/node_modules/setimmediate/setImmediate.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/return/final-error.js","../../node_modules/.pnpm/human-signals@8.0.0/node_modules/human-signals/build/src/realtime.js","../../node_modules/.pnpm/human-signals@8.0.0/node_modules/human-signals/build/src/core.js","../../node_modules/.pnpm/human-signals@8.0.0/node_modules/human-signals/build/src/signals.js","../../node_modules/.pnpm/human-signals@8.0.0/node_modules/human-signals/build/src/main.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/terminate/signal.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/terminate/kill.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/utils/abort-signal.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/terminate/cancel.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/ipc/validation.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/utils/deferred.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/arguments/fd-options.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/utils/max-listeners.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/ipc/reference.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/ipc/incoming.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/ipc/forward.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/ipc/strict.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/ipc/outgoing.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/ipc/send.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/ipc/graceful.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/terminate/graceful.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/terminate/timeout.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/ipc/ipc-input.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/arguments/encoding-option.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/arguments/cwd.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/arguments/options.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/methods/node.js","../../src/utils/compat/stream/promises.ts","../../node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/stream.js","../../node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/contents.js","../../node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/utils.js","../../node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/array.js","../../node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/array-buffer.js","../../node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/string.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/io/max-buffer.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/return/message.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/return/result.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/verbose/complete.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/return/reject.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/verbose/error.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/stdio/type.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/transform/object-mode.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/transform/normalize.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/stdio/direction.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/stdio/stdio-option.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/stdio/native.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/stdio/input-option.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/stdio/duplicate.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/stdio/handle.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/ipc/array.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/stdio/handle-sync.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/io/strip-newline.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/transform/split.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/transform/validate.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/transform/encoding-transform.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/transform/run-async.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/transform/run-sync.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/transform/generator.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/io/input-sync.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/verbose/output.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/io/output-sync.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/resolve/exit-async.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/resolve/exit-sync.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/methods/main-sync.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/resolve/all-sync.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/ipc/get-one.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/ipc/get-each.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/ipc/methods.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/return/early-error.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/stdio/handle-async.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/io/pipeline.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/io/output-async.js","../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js","../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/terminate/cleanup.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/pipe/pipe-arguments.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/pipe/throw.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/pipe/sequence.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/pipe/streaming.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/pipe/abort.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/pipe/setup.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/io/iterate.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/io/contents.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/resolve/wait-stream.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/resolve/stdio.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/resolve/all-async.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/verbose/ipc.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/ipc/buffer-messages.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/resolve/wait-subprocess.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/convert/concurrent.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/convert/shared.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/convert/readable.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/convert/writable.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/convert/duplex.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/convert/iterable.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/convert/add.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/methods/promise.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/methods/main-async.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/methods/bind.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/methods/create.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/methods/command.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/lib/methods/script.js","../../node_modules/.pnpm/execa@9.4.0/node_modules/execa/index.js","../../src/utils/compat/fs/promises.ts","../../node_modules/.pnpm/isexe@3.1.1/node_modules/isexe/dist/cjs/posix.js","../../node_modules/.pnpm/isexe@3.1.1/node_modules/isexe/dist/cjs/win32.js","../../node_modules/.pnpm/isexe@3.1.1/node_modules/isexe/dist/cjs/index.js","../../node_modules/.pnpm/which@4.0.0/node_modules/which/lib/index.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/math/sign/is-implemented.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/_iterate.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/assign/is-implemented.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/is-value.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/normalize-options.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/number/to-integer.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/math/sign/index.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/math/sign/shim.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/number/to-pos-integer.js","../../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/lib/resolve-length.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/valid-callable.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/valid-value.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/for-each.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/assign/index.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/assign/shim.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/keys/index.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/keys/is-implemented.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/keys/shim.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/is-object.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/error/custom.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/function/_define-length.js","../../node_modules/.pnpm/type@2.7.3/node_modules/type/value/is.js","../../node_modules/.pnpm/type@2.7.3/node_modules/type/object/is.js","../../node_modules/.pnpm/type@2.7.3/node_modules/type/function/is.js","../../node_modules/.pnpm/type@2.7.3/node_modules/type/prototype/is.js","../../node_modules/.pnpm/type@2.7.3/node_modules/type/plain-function/is.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/string/#/contains/is-implemented.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/string/#/contains/index.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/string/#/contains/shim.js","../../node_modules/.pnpm/d@1.0.2/node_modules/d/index.js","../../node_modules/.pnpm/event-emitter@0.3.5/node_modules/event-emitter/index.js","../../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/lib/resolve-resolve.js","../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/array/to-array.js","../../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/lib/resolve-normalize.js","../../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/lib/configure-map.js","../../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/plain.js","../../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/index.js","../../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/normalizers/primitive.js","../../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/normalizers/get-primitive-fixed.js","../../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/normalizers/get.js","../../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/normalizers/get-1.js","../../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/normalizers/get-fixed.js","../../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/ext/async.js","../../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/ext/dispose.js","../../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/ext/max-age.js","../../node_modules/.pnpm/timers-ext@0.1.8/node_modules/timers-ext/valid-timeout.js","../../node_modules/.pnpm/timers-ext@0.1.8/node_modules/timers-ext/max-timeout.js","../../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/ext/max.js","../../node_modules/.pnpm/lru-queue@0.1.0/node_modules/lru-queue/index.js","../../node_modules/.pnpm/memoizee@0.4.17/node_modules/memoizee/ext/ref-counter.js","../../node_modules/.pnpm/escape-path-with-spaces@1.0.2/node_modules/escape-path-with-spaces/index.js","../../node_modules/.pnpm/escape-quotes@1.0.2/node_modules/escape-quotes/lib/escape-quotes.js","../../node_modules/.pnpm/escape-string-regexp@1.0.5/node_modules/escape-string-regexp/index.js","../../node_modules/.pnpm/numerous@1.0.3/node_modules/numerous/lib/numerous.js","../../node_modules/.pnpm/numerous@1.0.3/node_modules/numerous/index.js","../../node_modules/.pnpm/numerous@1.0.3/node_modules/numerous/locales/en.js","../../node_modules/.pnpm/is-node@1.0.2/node_modules/is-node/index.js","../../node_modules/.pnpm/time-delta@https+++codeload.github.com+aminya+time-delta+tar.gz+69d91a4/node_modules/time-delta/locales/en.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/constants.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/debug.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/re.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/parse-options.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/identifiers.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/classes/semver.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/parse.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/valid.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/clean.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/inc.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/diff.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/major.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/minor.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/patch.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/prerelease.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/compare.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/rcompare.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/compare-loose.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/compare-build.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/sort.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/rsort.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/gt.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/lt.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/eq.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/neq.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/gte.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/lte.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/cmp.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/coerce.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/lrucache.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/satisfies.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/to-comparators.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/max-satisfying.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/min-satisfying.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/min-version.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/valid.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/outside.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/gtr.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/ltr.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/intersects.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/simplify.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/subset.js","../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/index.js","../../node_modules/.pnpm/node-downloader-helper@2.1.9/node_modules/node-downloader-helper/dist/index.js","../../packages/setup-apt/dist/apt-timeout.js","../../packages/setup-apt/dist/update.js","../../packages/setup-apt/dist/init-apt.js","../../node_modules/.pnpm/replace-ext@2.0.0/node_modules/replace-ext/index.js","../../src/utils/env/arch.ts","../../node_modules/.pnpm/@actions+io@1.1.3/node_modules/@actions/io/lib/io-util.js","../../node_modules/.pnpm/semver@6.3.1/node_modules/semver/semver.js","../../node_modules/.pnpm/@actions+tool-cache@2.0.1/node_modules/@actions/tool-cache/lib/manifest.js","../../node_modules/.pnpm/uuid@3.4.0/node_modules/uuid/lib/bytesToUuid.js","../../node_modules/.pnpm/uuid@3.4.0/node_modules/uuid/lib/rng.js","../../node_modules/.pnpm/uuid@3.4.0/node_modules/uuid/v4.js","../../node_modules/.pnpm/@actions+exec@1.1.1/node_modules/@actions/exec/lib/toolrunner.js","../../node_modules/.pnpm/@actions+tool-cache@2.0.1/node_modules/@actions/tool-cache/lib/retry-helper.js","../../node_modules/.pnpm/mkdirp@3.0.1/node_modules/mkdirp/dist/mjs/opts-arg.js","../../node_modules/.pnpm/mkdirp@3.0.1/node_modules/mkdirp/dist/mjs/mkdirp-manual.js","../../node_modules/.pnpm/mkdirp@3.0.1/node_modules/mkdirp/dist/mjs/find-made.js","../../node_modules/.pnpm/mkdirp@3.0.1/node_modules/mkdirp/dist/mjs/mkdirp-native.js","../../node_modules/.pnpm/mkdirp@3.0.1/node_modules/mkdirp/dist/mjs/path-arg.js","../../node_modules/.pnpm/mkdirp@3.0.1/node_modules/mkdirp/dist/mjs/use-native.js","../../node_modules/.pnpm/mkdirp@3.0.1/node_modules/mkdirp/dist/mjs/index.js","../../src/versions/default_versions.ts","../../node_modules/.pnpm/ubuntu-version@2.0.0/node_modules/ubuntu-version/index.js","../../node_modules/.pnpm/macos-release@3.3.0/node_modules/macos-release/index.js","../../src/utils/env/macos_version.ts","../../src/nala/nala.ts","../../src/vcpkg/vcpkg.ts","../../src/tool.ts","../../src/bazel/bazel.ts","../../src/conan/conan.ts","../../src/meson/meson.ts","../../src/ccache/ccache.ts","../../src/sccache/sccache.ts","../../src/cppcheck/cppcheck.ts","../../src/cpplint/cpplint.ts","../../src/flawfinder/flawfinder.ts","../../src/lizard/lizard.ts","../../src/make/make.ts","../../src/setup-cpp.ts","../../src/check-updates.ts","../../src/compilers.ts"],"sourcesContent":["\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.issue = exports.issueCommand = void 0;\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\n/**\n * Commands\n *\n * Command Format:\n * ::name key=value,key=value::message\n *\n * Examples:\n * ::warning::This is the message\n * ::set-env name=MY_VAR::some value\n */\nfunction issueCommand(command, properties, message) {\n const cmd = new Command(command, properties, message);\n process.stdout.write(cmd.toString() + os.EOL);\n}\nexports.issueCommand = issueCommand;\nfunction issue(name, message = '') {\n issueCommand(name, {}, message);\n}\nexports.issue = issue;\nconst CMD_STRING = '::';\nclass Command {\n constructor(command, properties, message) {\n if (!command) {\n command = 'missing.command';\n }\n this.command = command;\n this.properties = properties;\n this.message = message;\n }\n toString() {\n let cmdStr = CMD_STRING + this.command;\n if (this.properties && Object.keys(this.properties).length > 0) {\n cmdStr += ' ';\n let first = true;\n for (const key in this.properties) {\n if (this.properties.hasOwnProperty(key)) {\n const val = this.properties[key];\n if (val) {\n if (first) {\n first = false;\n }\n else {\n cmdStr += ',';\n }\n cmdStr += `${key}=${escapeProperty(val)}`;\n }\n }\n }\n }\n cmdStr += `${CMD_STRING}${escapeData(this.message)}`;\n return cmdStr;\n }\n}\nfunction escapeData(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A');\n}\nfunction escapeProperty(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A')\n .replace(/:/g, '%3A')\n .replace(/,/g, '%2C');\n}\n//# sourceMappingURL=command.js.map","import crypto from 'crypto';\nconst rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate\n\nlet poolPtr = rnds8Pool.length;\nexport default function rng() {\n if (poolPtr > rnds8Pool.length - 16) {\n crypto.randomFillSync(rnds8Pool);\n poolPtr = 0;\n }\n\n return rnds8Pool.slice(poolPtr, poolPtr += 16);\n}","import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","import validate from './validate.js';\n\nfunction parse(uuid) {\n if (!validate(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n let v;\n const arr = new Uint8Array(16); // Parse ########-....-....-....-............\n\n arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;\n arr[1] = v >>> 16 & 0xff;\n arr[2] = v >>> 8 & 0xff;\n arr[3] = v & 0xff; // Parse ........-####-....-....-............\n\n arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;\n arr[5] = v & 0xff; // Parse ........-....-####-....-............\n\n arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;\n arr[7] = v & 0xff; // Parse ........-....-....-####-............\n\n arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;\n arr[9] = v & 0xff; // Parse ........-....-....-....-############\n // (Use \"/\" to avoid 32-bit truncation when bit-shifting high-order bytes)\n\n arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;\n arr[11] = v / 0x100000000 & 0xff;\n arr[12] = v >>> 24 & 0xff;\n arr[13] = v >>> 16 & 0xff;\n arr[14] = v >>> 8 & 0xff;\n arr[15] = v & 0xff;\n return arr;\n}\n\nexport default parse;","import stringify from './stringify.js';\nimport parse from './parse.js';\n\nfunction stringToBytes(str) {\n str = unescape(encodeURIComponent(str)); // UTF8 escape\n\n const bytes = [];\n\n for (let i = 0; i < str.length; ++i) {\n bytes.push(str.charCodeAt(i));\n }\n\n return bytes;\n}\n\nexport const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';\nexport const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';\nexport default function (name, version, hashfunc) {\n function generateUUID(value, namespace, buf, offset) {\n if (typeof value === 'string') {\n value = stringToBytes(value);\n }\n\n if (typeof namespace === 'string') {\n namespace = parse(namespace);\n }\n\n if (namespace.length !== 16) {\n throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');\n } // Compute hash of namespace and value, Per 4.3\n // Future: Use spread syntax when supported on all platforms, e.g. `bytes =\n // hashfunc([...namespace, ... value])`\n\n\n let bytes = new Uint8Array(16 + value.length);\n bytes.set(namespace);\n bytes.set(value, namespace.length);\n bytes = hashfunc(bytes);\n bytes[6] = bytes[6] & 0x0f | version;\n bytes[8] = bytes[8] & 0x3f | 0x80;\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = bytes[i];\n }\n\n return buf;\n }\n\n return stringify(bytes);\n } // Function#name is not settable on some platforms (#270)\n\n\n try {\n generateUUID.name = name; // eslint-disable-next-line no-empty\n } catch (err) {} // For CommonJS default export support\n\n\n generateUUID.DNS = DNS;\n generateUUID.URL = URL;\n return generateUUID;\n}","export function getProxyUrl(reqUrl) {\n const usingSsl = reqUrl.protocol === 'https:';\n if (checkBypass(reqUrl)) {\n return undefined;\n }\n const proxyVar = (() => {\n if (usingSsl) {\n return process.env['https_proxy'] || process.env['HTTPS_PROXY'];\n }\n else {\n return process.env['http_proxy'] || process.env['HTTP_PROXY'];\n }\n })();\n if (proxyVar) {\n try {\n return new DecodedURL(proxyVar);\n }\n catch {\n if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))\n return new DecodedURL(`http://${proxyVar}`);\n }\n }\n else {\n return undefined;\n }\n}\nexport function checkBypass(reqUrl) {\n if (!reqUrl.hostname) {\n return false;\n }\n const reqHost = reqUrl.hostname;\n if (isLoopbackAddress(reqHost)) {\n return true;\n }\n const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';\n if (!noProxy) {\n return false;\n }\n // Determine the request port\n let reqPort;\n if (reqUrl.port) {\n reqPort = Number(reqUrl.port);\n }\n else if (reqUrl.protocol === 'http:') {\n reqPort = 80;\n }\n else if (reqUrl.protocol === 'https:') {\n reqPort = 443;\n }\n // Format the request hostname and hostname with port\n const upperReqHosts = [reqUrl.hostname.toUpperCase()];\n if (typeof reqPort === 'number') {\n upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);\n }\n // Compare request host against noproxy\n for (const upperNoProxyItem of noProxy\n .split(',')\n .map(x => x.trim().toUpperCase())\n .filter(x => x)) {\n if (upperNoProxyItem === '*' ||\n upperReqHosts.some(x => x === upperNoProxyItem ||\n x.endsWith(`.${upperNoProxyItem}`) ||\n (upperNoProxyItem.startsWith('.') &&\n x.endsWith(`${upperNoProxyItem}`)))) {\n return true;\n }\n }\n return false;\n}\nfunction isLoopbackAddress(host) {\n const hostLower = host.toLowerCase();\n return (hostLower === 'localhost' ||\n hostLower.startsWith('127.') ||\n hostLower.startsWith('[::1]') ||\n hostLower.startsWith('[0:0:0:0:0:0:0:1]'));\n}\nclass DecodedURL extends URL {\n _decodedUsername;\n _decodedPassword;\n constructor(url, base) {\n super(url, base);\n this._decodedUsername = decodeURIComponent(super.username);\n this._decodedPassword = decodeURIComponent(super.password);\n }\n get username() {\n return this._decodedUsername;\n }\n get password() {\n return this._decodedPassword;\n }\n}\n//# sourceMappingURL=proxy.js.map","'use strict';\n\nvar net = require('net');\nvar tls = require('tls');\nvar http = require('http');\nvar https = require('https');\nvar events = require('events');\nvar assert = require('assert');\nvar util = require('util');\n\n\nexports.httpOverHttp = httpOverHttp;\nexports.httpsOverHttp = httpsOverHttp;\nexports.httpOverHttps = httpOverHttps;\nexports.httpsOverHttps = httpsOverHttps;\n\n\nfunction httpOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n return agent;\n}\n\nfunction httpsOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\nfunction httpOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n return agent;\n}\n\nfunction httpsOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\n\nfunction TunnelingAgent(options) {\n var self = this;\n self.options = options || {};\n self.proxyOptions = self.options.proxy || {};\n self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;\n self.requests = [];\n self.sockets = [];\n\n self.on('free', function onFree(socket, host, port, localAddress) {\n var options = toOptions(host, port, localAddress);\n for (var i = 0, len = self.requests.length; i < len; ++i) {\n var pending = self.requests[i];\n if (pending.host === options.host && pending.port === options.port) {\n // Detect the request to connect same origin server,\n // reuse the connection.\n self.requests.splice(i, 1);\n pending.request.onSocket(socket);\n return;\n }\n }\n socket.destroy();\n self.removeSocket(socket);\n });\n}\nutil.inherits(TunnelingAgent, events.EventEmitter);\n\nTunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {\n var self = this;\n var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));\n\n if (self.sockets.length >= this.maxSockets) {\n // We are over limit so we'll add it to the queue.\n self.requests.push(options);\n return;\n }\n\n // If we are under maxSockets create a new one.\n self.createSocket(options, function(socket) {\n socket.on('free', onFree);\n socket.on('close', onCloseOrRemove);\n socket.on('agentRemove', onCloseOrRemove);\n req.onSocket(socket);\n\n function onFree() {\n self.emit('free', socket, options);\n }\n\n function onCloseOrRemove(err) {\n self.removeSocket(socket);\n socket.removeListener('free', onFree);\n socket.removeListener('close', onCloseOrRemove);\n socket.removeListener('agentRemove', onCloseOrRemove);\n }\n });\n};\n\nTunnelingAgent.prototype.createSocket = function createSocket(options, cb) {\n var self = this;\n var placeholder = {};\n self.sockets.push(placeholder);\n\n var connectOptions = mergeOptions({}, self.proxyOptions, {\n method: 'CONNECT',\n path: options.host + ':' + options.port,\n agent: false,\n headers: {\n host: options.host + ':' + options.port\n }\n });\n if (options.localAddress) {\n connectOptions.localAddress = options.localAddress;\n }\n if (connectOptions.proxyAuth) {\n connectOptions.headers = connectOptions.headers || {};\n connectOptions.headers['Proxy-Authorization'] = 'Basic ' +\n new Buffer(connectOptions.proxyAuth).toString('base64');\n }\n\n debug('making CONNECT request');\n var connectReq = self.request(connectOptions);\n connectReq.useChunkedEncodingByDefault = false; // for v0.6\n connectReq.once('response', onResponse); // for v0.6\n connectReq.once('upgrade', onUpgrade); // for v0.6\n connectReq.once('connect', onConnect); // for v0.7 or later\n connectReq.once('error', onError);\n connectReq.end();\n\n function onResponse(res) {\n // Very hacky. This is necessary to avoid http-parser leaks.\n res.upgrade = true;\n }\n\n function onUpgrade(res, socket, head) {\n // Hacky.\n process.nextTick(function() {\n onConnect(res, socket, head);\n });\n }\n\n function onConnect(res, socket, head) {\n connectReq.removeAllListeners();\n socket.removeAllListeners();\n\n if (res.statusCode !== 200) {\n debug('tunneling socket could not be established, statusCode=%d',\n res.statusCode);\n socket.destroy();\n var error = new Error('tunneling socket could not be established, ' +\n 'statusCode=' + res.statusCode);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n if (head.length > 0) {\n debug('got illegal response body from proxy');\n socket.destroy();\n var error = new Error('got illegal response body from proxy');\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n debug('tunneling connection has established');\n self.sockets[self.sockets.indexOf(placeholder)] = socket;\n return cb(socket);\n }\n\n function onError(cause) {\n connectReq.removeAllListeners();\n\n debug('tunneling socket could not be established, cause=%s\\n',\n cause.message, cause.stack);\n var error = new Error('tunneling socket could not be established, ' +\n 'cause=' + cause.message);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n }\n};\n\nTunnelingAgent.prototype.removeSocket = function removeSocket(socket) {\n var pos = this.sockets.indexOf(socket)\n if (pos === -1) {\n return;\n }\n this.sockets.splice(pos, 1);\n\n var pending = this.requests.shift();\n if (pending) {\n // If we have pending requests and a socket gets closed a new one\n // needs to be created to take over in the pool for the one that closed.\n this.createSocket(pending, function(socket) {\n pending.request.onSocket(socket);\n });\n }\n};\n\nfunction createSecureSocket(options, cb) {\n var self = this;\n TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {\n var hostHeader = options.request.getHeader('host');\n var tlsOptions = mergeOptions({}, self.options, {\n socket: socket,\n servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host\n });\n\n // 0 is dummy port for v0.6\n var secureSocket = tls.connect(0, tlsOptions);\n self.sockets[self.sockets.indexOf(socket)] = secureSocket;\n cb(secureSocket);\n });\n}\n\n\nfunction toOptions(host, port, localAddress) {\n if (typeof host === 'string') { // since v0.10\n return {\n host: host,\n port: port,\n localAddress: localAddress\n };\n }\n return host; // for v0.11 or later\n}\n\nfunction mergeOptions(target) {\n for (var i = 1, len = arguments.length; i < len; ++i) {\n var overrides = arguments[i];\n if (typeof overrides === 'object') {\n var keys = Object.keys(overrides);\n for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {\n var k = keys[j];\n if (overrides[k] !== undefined) {\n target[k] = overrides[k];\n }\n }\n }\n }\n return target;\n}\n\n\nvar debug;\nif (process.env.NODE_DEBUG && /\\btunnel\\b/.test(process.env.NODE_DEBUG)) {\n debug = function() {\n var args = Array.prototype.slice.call(arguments);\n if (typeof args[0] === 'string') {\n args[0] = 'TUNNEL: ' + args[0];\n } else {\n args.unshift('TUNNEL:');\n }\n console.error.apply(console, args);\n }\n} else {\n debug = function() {};\n}\nexports.debug = debug; // for test\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;\nconst os_1 = require(\"os\");\nconst fs_1 = require(\"fs\");\nconst { access, appendFile, writeFile } = fs_1.promises;\nexports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';\nexports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';\nclass Summary {\n constructor() {\n this._buffer = '';\n }\n /**\n * Finds the summary file path from the environment, rejects if env var is not found or file does not exist\n * Also checks r/w permissions.\n *\n * @returns step summary file path\n */\n filePath() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._filePath) {\n return this._filePath;\n }\n const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];\n if (!pathFromEnv) {\n throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);\n }\n try {\n yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);\n }\n catch (_a) {\n throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);\n }\n this._filePath = pathFromEnv;\n return this._filePath;\n });\n }\n /**\n * Wraps content in an HTML tag, adding any HTML attributes\n *\n * @param {string} tag HTML tag to wrap\n * @param {string | null} content content within the tag\n * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add\n *\n * @returns {string} content wrapped in HTML element\n */\n wrap(tag, content, attrs = {}) {\n const htmlAttrs = Object.entries(attrs)\n .map(([key, value]) => ` ${key}=\"${value}\"`)\n .join('');\n if (!content) {\n return `<${tag}${htmlAttrs}>`;\n }\n return `<${tag}${htmlAttrs}>${content}`;\n }\n /**\n * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.\n *\n * @param {SummaryWriteOptions} [options] (optional) options for write operation\n *\n * @returns {Promise} summary instance\n */\n write(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);\n const filePath = yield this.filePath();\n const writeFunc = overwrite ? writeFile : appendFile;\n yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });\n return this.emptyBuffer();\n });\n }\n /**\n * Clears the summary buffer and wipes the summary file\n *\n * @returns {Summary} summary instance\n */\n clear() {\n return __awaiter(this, void 0, void 0, function* () {\n return this.emptyBuffer().write({ overwrite: true });\n });\n }\n /**\n * Returns the current summary buffer as a string\n *\n * @returns {string} string of summary buffer\n */\n stringify() {\n return this._buffer;\n }\n /**\n * If the summary buffer is empty\n *\n * @returns {boolen} true if the buffer is empty\n */\n isEmptyBuffer() {\n return this._buffer.length === 0;\n }\n /**\n * Resets the summary buffer without writing to summary file\n *\n * @returns {Summary} summary instance\n */\n emptyBuffer() {\n this._buffer = '';\n return this;\n }\n /**\n * Adds raw text to the summary buffer\n *\n * @param {string} text content to add\n * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)\n *\n * @returns {Summary} summary instance\n */\n addRaw(text, addEOL = false) {\n this._buffer += text;\n return addEOL ? this.addEOL() : this;\n }\n /**\n * Adds the operating system-specific end-of-line marker to the buffer\n *\n * @returns {Summary} summary instance\n */\n addEOL() {\n return this.addRaw(os_1.EOL);\n }\n /**\n * Adds an HTML codeblock to the summary buffer\n *\n * @param {string} code content to render within fenced code block\n * @param {string} lang (optional) language to syntax highlight code\n *\n * @returns {Summary} summary instance\n */\n addCodeBlock(code, lang) {\n const attrs = Object.assign({}, (lang && { lang }));\n const element = this.wrap('pre', this.wrap('code', code), attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML list to the summary buffer\n *\n * @param {string[]} items list of items to render\n * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)\n *\n * @returns {Summary} summary instance\n */\n addList(items, ordered = false) {\n const tag = ordered ? 'ol' : 'ul';\n const listItems = items.map(item => this.wrap('li', item)).join('');\n const element = this.wrap(tag, listItems);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML table to the summary buffer\n *\n * @param {SummaryTableCell[]} rows table rows\n *\n * @returns {Summary} summary instance\n */\n addTable(rows) {\n const tableBody = rows\n .map(row => {\n const cells = row\n .map(cell => {\n if (typeof cell === 'string') {\n return this.wrap('td', cell);\n }\n const { header, data, colspan, rowspan } = cell;\n const tag = header ? 'th' : 'td';\n const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));\n return this.wrap(tag, data, attrs);\n })\n .join('');\n return this.wrap('tr', cells);\n })\n .join('');\n const element = this.wrap('table', tableBody);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds a collapsable HTML details element to the summary buffer\n *\n * @param {string} label text for the closed state\n * @param {string} content collapsable content\n *\n * @returns {Summary} summary instance\n */\n addDetails(label, content) {\n const element = this.wrap('details', this.wrap('summary', label) + content);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML image tag to the summary buffer\n *\n * @param {string} src path to the image you to embed\n * @param {string} alt text description of the image\n * @param {SummaryImageOptions} options (optional) addition image attributes\n *\n * @returns {Summary} summary instance\n */\n addImage(src, alt, options) {\n const { width, height } = options || {};\n const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));\n const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML section heading element\n *\n * @param {string} text heading text\n * @param {number | string} [level=1] (optional) the heading level, default: 1\n *\n * @returns {Summary} summary instance\n */\n addHeading(text, level) {\n const tag = `h${level}`;\n const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)\n ? tag\n : 'h1';\n const element = this.wrap(allowedTag, text);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML thematic break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addSeparator() {\n const element = this.wrap('hr', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML line break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addBreak() {\n const element = this.wrap('br', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML blockquote to the summary buffer\n *\n * @param {string} text quote text\n * @param {string} cite (optional) citation url\n *\n * @returns {Summary} summary instance\n */\n addQuote(text, cite) {\n const attrs = Object.assign({}, (cite && { cite }));\n const element = this.wrap('blockquote', text, attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML anchor tag to the summary buffer\n *\n * @param {string} text link text/content\n * @param {string} href hyperlink\n *\n * @returns {Summary} summary instance\n */\n addLink(text, href) {\n const element = this.wrap('a', text, { href });\n return this.addRaw(element).addEOL();\n }\n}\nconst _summary = new Summary();\n/**\n * @deprecated use `core.summary`\n */\nexports.markdownSummary = _summary;\nexports.summary = _summary;\n//# sourceMappingURL=summary.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;\nconst command_1 = require(\"./command\");\nconst file_command_1 = require(\"./file-command\");\nconst utils_1 = require(\"./utils\");\nconst os = __importStar(require(\"os\"));\nconst path = __importStar(require(\"path\"));\nconst oidc_utils_1 = require(\"./oidc-utils\");\n/**\n * The code to exit an action\n */\nvar ExitCode;\n(function (ExitCode) {\n /**\n * A code indicating that the action was successful\n */\n ExitCode[ExitCode[\"Success\"] = 0] = \"Success\";\n /**\n * A code indicating that the action was a failure\n */\n ExitCode[ExitCode[\"Failure\"] = 1] = \"Failure\";\n})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));\n//-----------------------------------------------------------------------\n// Variables\n//-----------------------------------------------------------------------\n/**\n * Sets env variable for this action and future actions in the job\n * @param name the name of the variable to set\n * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction exportVariable(name, val) {\n const convertedVal = utils_1.toCommandValue(val);\n process.env[name] = convertedVal;\n const filePath = process.env['GITHUB_ENV'] || '';\n if (filePath) {\n return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));\n }\n command_1.issueCommand('set-env', { name }, convertedVal);\n}\nexports.exportVariable = exportVariable;\n/**\n * Registers a secret which will get masked from logs\n * @param secret value of the secret\n */\nfunction setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}\nexports.setSecret = setSecret;\n/**\n * Prepends inputPath to the PATH (for this action and future actions)\n * @param inputPath\n */\nfunction addPath(inputPath) {\n const filePath = process.env['GITHUB_PATH'] || '';\n if (filePath) {\n file_command_1.issueFileCommand('PATH', inputPath);\n }\n else {\n command_1.issueCommand('add-path', {}, inputPath);\n }\n process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;\n}\nexports.addPath = addPath;\n/**\n * Gets the value of an input.\n * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.\n * Returns an empty string if the value is not defined.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string\n */\nfunction getInput(name, options) {\n const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';\n if (options && options.required && !val) {\n throw new Error(`Input required and not supplied: ${name}`);\n }\n if (options && options.trimWhitespace === false) {\n return val;\n }\n return val.trim();\n}\nexports.getInput = getInput;\n/**\n * Gets the values of an multiline input. Each value is also trimmed.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string[]\n *\n */\nfunction getMultilineInput(name, options) {\n const inputs = getInput(name, options)\n .split('\\n')\n .filter(x => x !== '');\n if (options && options.trimWhitespace === false) {\n return inputs;\n }\n return inputs.map(input => input.trim());\n}\nexports.getMultilineInput = getMultilineInput;\n/**\n * Gets the input value of the boolean type in the YAML 1.2 \"core schema\" specification.\n * Support boolean input list: `true | True | TRUE | false | False | FALSE` .\n * The return value is also in boolean type.\n * ref: https://yaml.org/spec/1.2/spec.html#id2804923\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns boolean\n */\nfunction getBooleanInput(name, options) {\n const trueValue = ['true', 'True', 'TRUE'];\n const falseValue = ['false', 'False', 'FALSE'];\n const val = getInput(name, options);\n if (trueValue.includes(val))\n return true;\n if (falseValue.includes(val))\n return false;\n throw new TypeError(`Input does not meet YAML 1.2 \"Core Schema\" specification: ${name}\\n` +\n `Support boolean input list: \\`true | True | TRUE | false | False | FALSE\\``);\n}\nexports.getBooleanInput = getBooleanInput;\n/**\n * Sets the value of an output.\n *\n * @param name name of the output to set\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction setOutput(name, value) {\n const filePath = process.env['GITHUB_OUTPUT'] || '';\n if (filePath) {\n return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));\n }\n process.stdout.write(os.EOL);\n command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));\n}\nexports.setOutput = setOutput;\n/**\n * Enables or disables the echoing of commands into stdout for the rest of the step.\n * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.\n *\n */\nfunction setCommandEcho(enabled) {\n command_1.issue('echo', enabled ? 'on' : 'off');\n}\nexports.setCommandEcho = setCommandEcho;\n//-----------------------------------------------------------------------\n// Results\n//-----------------------------------------------------------------------\n/**\n * Sets the action status to failed.\n * When the action exits it will be with an exit code of 1\n * @param message add error issue message\n */\nfunction setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}\nexports.setFailed = setFailed;\n//-----------------------------------------------------------------------\n// Logging Commands\n//-----------------------------------------------------------------------\n/**\n * Gets whether Actions Step Debug is on or not\n */\nfunction isDebug() {\n return process.env['RUNNER_DEBUG'] === '1';\n}\nexports.isDebug = isDebug;\n/**\n * Writes debug message to user log\n * @param message debug message\n */\nfunction debug(message) {\n command_1.issueCommand('debug', {}, message);\n}\nexports.debug = debug;\n/**\n * Adds an error issue\n * @param message error issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction error(message, properties = {}) {\n command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.error = error;\n/**\n * Adds a warning issue\n * @param message warning issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction warning(message, properties = {}) {\n command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.warning = warning;\n/**\n * Adds a notice issue\n * @param message notice issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction notice(message, properties = {}) {\n command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.notice = notice;\n/**\n * Writes info to log with console.log.\n * @param message info message\n */\nfunction info(message) {\n process.stdout.write(message + os.EOL);\n}\nexports.info = info;\n/**\n * Begin an output group.\n *\n * Output until the next `groupEnd` will be foldable in this group\n *\n * @param name The name of the output group\n */\nfunction startGroup(name) {\n command_1.issue('group', name);\n}\nexports.startGroup = startGroup;\n/**\n * End an output group.\n */\nfunction endGroup() {\n command_1.issue('endgroup');\n}\nexports.endGroup = endGroup;\n/**\n * Wrap an asynchronous function call in a group.\n *\n * Returns the same type as the function itself.\n *\n * @param name The name of the group\n * @param fn The function to wrap in the group\n */\nfunction group(name, fn) {\n return __awaiter(this, void 0, void 0, function* () {\n startGroup(name);\n let result;\n try {\n result = yield fn();\n }\n finally {\n endGroup();\n }\n return result;\n });\n}\nexports.group = group;\n//-----------------------------------------------------------------------\n// Wrapper action state\n//-----------------------------------------------------------------------\n/**\n * Saves state for current action, the state can only be retrieved by this action's post job execution.\n *\n * @param name name of the state to store\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction saveState(name, value) {\n const filePath = process.env['GITHUB_STATE'] || '';\n if (filePath) {\n return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));\n }\n command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));\n}\nexports.saveState = saveState;\n/**\n * Gets the value of an state set by this action's main execution.\n *\n * @param name name of the state to get\n * @returns string\n */\nfunction getState(name) {\n return process.env[`STATE_${name}`] || '';\n}\nexports.getState = getState;\nfunction getIDToken(aud) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield oidc_utils_1.OidcClient.getIDToken(aud);\n });\n}\nexports.getIDToken = getIDToken;\n/**\n * Summary exports\n */\nvar summary_1 = require(\"./summary\");\nObject.defineProperty(exports, \"summary\", { enumerable: true, get: function () { return summary_1.summary; } });\n/**\n * @deprecated use core.summary\n */\nvar summary_2 = require(\"./summary\");\nObject.defineProperty(exports, \"markdownSummary\", { enumerable: true, get: function () { return summary_2.markdownSummary; } });\n/**\n * Path exports\n */\nvar path_utils_1 = require(\"./path-utils\");\nObject.defineProperty(exports, \"toPosixPath\", { enumerable: true, get: function () { return path_utils_1.toPosixPath; } });\nObject.defineProperty(exports, \"toWin32Path\", { enumerable: true, get: function () { return path_utils_1.toWin32Path; } });\nObject.defineProperty(exports, \"toPlatformPath\", { enumerable: true, get: function () { return path_utils_1.toPlatformPath; } });\n//# sourceMappingURL=core.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OidcClient = void 0;\nconst http_client_1 = require(\"@actions/http-client\");\nconst auth_1 = require(\"@actions/http-client/lib/auth\");\nconst core_1 = require(\"./core\");\nclass OidcClient {\n static createHttpClient(allowRetry = true, maxRetry = 10) {\n const requestOptions = {\n allowRetries: allowRetry,\n maxRetries: maxRetry\n };\n return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);\n }\n static getRequestToken() {\n const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];\n if (!token) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');\n }\n return token;\n }\n static getIDTokenUrl() {\n const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];\n if (!runtimeUrl) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');\n }\n return runtimeUrl;\n }\n static getCall(id_token_url) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const httpclient = OidcClient.createHttpClient();\n const res = yield httpclient\n .getJson(id_token_url)\n .catch(error => {\n throw new Error(`Failed to get ID Token. \\n \n Error Code : ${error.statusCode}\\n \n Error Message: ${error.message}`);\n });\n const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;\n if (!id_token) {\n throw new Error('Response json body do not have ID Token field');\n }\n return id_token;\n });\n }\n static getIDToken(audience) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n // New ID Token is requested from action service\n let id_token_url = OidcClient.getIDTokenUrl();\n if (audience) {\n const encodedAudience = encodeURIComponent(audience);\n id_token_url = `${id_token_url}&audience=${encodedAudience}`;\n }\n core_1.debug(`ID token url is ${id_token_url}`);\n const id_token = yield OidcClient.getCall(id_token_url);\n core_1.setSecret(id_token);\n return id_token;\n }\n catch (error) {\n throw new Error(`Error message: ${error.message}`);\n }\n });\n }\n}\nexports.OidcClient = OidcClient;\n//# sourceMappingURL=oidc-utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;\nconst path = __importStar(require(\"path\"));\n/**\n * toPosixPath converts the given path to the posix form. On Windows, \\\\ will be\n * replaced with /.\n *\n * @param pth. Path to transform.\n * @return string Posix path.\n */\nfunction toPosixPath(pth) {\n return pth.replace(/[\\\\]/g, '/');\n}\nexports.toPosixPath = toPosixPath;\n/**\n * toWin32Path converts the given path to the win32 form. On Linux, / will be\n * replaced with \\\\.\n *\n * @param pth. Path to transform.\n * @return string Win32 path.\n */\nfunction toWin32Path(pth) {\n return pth.replace(/[/]/g, '\\\\');\n}\nexports.toWin32Path = toWin32Path;\n/**\n * toPlatformPath converts the given path to a platform-specific path. It does\n * this by replacing instances of / and \\ with the platform-specific path\n * separator.\n *\n * @param pth The path to platformize.\n * @return string The platform-specific path.\n */\nfunction toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path.sep);\n}\nexports.toPlatformPath = toPlatformPath;\n//# sourceMappingURL=path-utils.js.map","import * as core from \"@actions/core\";\nimport { GITHUB_ACTIONS } from \"ci-info\";\nexport function error(err) {\n return GITHUB_ACTIONS ? core.error(err) : console.log(`\\x1b[31m${err}\\x1b[0m`);\n}\nexport function success(msg) {\n return console.log(`\\x1b[32m${msg}\\x1b[0m`);\n}\nexport function warning(msg) {\n return GITHUB_ACTIONS ? core.warning(msg) : console.log(`\\x1b[33m${msg}\\x1b[0m`);\n}\nexport function notice(msg) {\n return GITHUB_ACTIONS ? core.notice(msg) : console.log(`\\x1b[94m${msg}\\x1b[0m`);\n}\nexport function info(msg) {\n return GITHUB_ACTIONS ? core.info(msg) : console.log(msg);\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLElBQUksTUFBTSxlQUFlLENBQUE7QUFDckMsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLFNBQVMsQ0FBQTtBQUV4QyxNQUFNLFVBQVUsS0FBSyxDQUFDLEdBQW1CO0lBQ3ZDLE9BQU8sY0FBYyxDQUFDLENBQUMsQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxPQUFPLENBQUMsR0FBRyxDQUFDLFdBQVcsR0FBRyxTQUFTLENBQUMsQ0FBQTtBQUNoRixDQUFDO0FBR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SR7ZXJyfVxceDFiWzBtYClcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIHN1Y2Nlc3MobXNnOiBzdHJpbmcpIHtcbiAgcmV0dXJuIGNvbnNvbGUubG9nKGBcXHgxYlszMm0ke21zZ31cXHgxYlswbWApXG59XG5cbmV4cG9ydCBmdW5jdGlvbiB3YXJuaW5nKG1zZzogc3RyaW5nKSB7XG4gIHJldHVybiBHSVRIVUJfQUNUSU9OUyA/IGNvcmUud2FybmluZyhtc2cpIDogY29uc29sZS5sb2coYFxceDFiWzMzbSR7bXNnfVxceDFiWzBtYClcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIG5vdGljZShtc2c6IHN0cmluZykge1xuICByZXR1cm4gR0lUSFVCX0FDVElPTlMgPyBjb3JlLm5vdGljZShtc2cpIDogY29uc29sZS5sb2coYFxceDFiWzk0bSR7bXNnfVxceDFiWzBtYClcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGluZm8obXNnOiBzdHJpbmcpIHtcbiAgcmV0dXJuIEdJVEhVQl9BQ1RJT05TID8gY29yZS5pbmZvKG1zZykgOiBjb25zb2xlLmxvZyhtc2cpXG59XG4iXX0=","export default function isPlainObject(value) {\n\tif (typeof value !== 'object' || value === null) {\n\t\treturn false;\n\t}\n\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);\n}\n","var fs = require('fs')\nvar core\nif (process.platform === 'win32' || global.TESTING_WINDOWS) {\n core = require('./windows.js')\n} else {\n core = require('./mode.js')\n}\n\nmodule.exports = isexe\nisexe.sync = sync\n\nfunction isexe (path, options, cb) {\n if (typeof options === 'function') {\n cb = options\n options = {}\n }\n\n if (!cb) {\n if (typeof Promise !== 'function') {\n throw new TypeError('callback not provided')\n }\n\n return new Promise(function (resolve, reject) {\n isexe(path, options || {}, function (er, is) {\n if (er) {\n reject(er)\n } else {\n resolve(is)\n }\n })\n })\n }\n\n core(path, options || {}, function (er, is) {\n // ignore EACCES because that just means we aren't allowed to run it\n if (er) {\n if (er.code === 'EACCES' || options && options.ignoreErrors) {\n er = null\n is = false\n }\n }\n cb(er, is)\n })\n}\n\nfunction sync (path, options) {\n // my kingdom for a filtered catch\n try {\n return core.sync(path, options || {})\n } catch (er) {\n if (options && options.ignoreErrors || er.code === 'EACCES') {\n return false\n } else {\n throw er\n }\n }\n}\n","'use strict';\n\nconst path = require('path');\nconst which = require('which');\nconst getPathKey = require('path-key');\n\nfunction resolveCommandAttempt(parsed, withoutPathExt) {\n const env = parsed.options.env || process.env;\n const cwd = process.cwd();\n const hasCustomCwd = parsed.options.cwd != null;\n // Worker threads do not have process.chdir()\n const shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined && !process.chdir.disabled;\n\n // If a custom `cwd` was specified, we need to change the process cwd\n // because `which` will do stat calls but does not support a custom cwd\n if (shouldSwitchCwd) {\n try {\n process.chdir(parsed.options.cwd);\n } catch (err) {\n /* Empty */\n }\n }\n\n let resolved;\n\n try {\n resolved = which.sync(parsed.command, {\n path: env[getPathKey({ env })],\n pathExt: withoutPathExt ? path.delimiter : undefined,\n });\n } catch (e) {\n /* Empty */\n } finally {\n if (shouldSwitchCwd) {\n process.chdir(cwd);\n }\n }\n\n // If we successfully resolved, ensure that an absolute path is returned\n // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it\n if (resolved) {\n resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);\n }\n\n return resolved;\n}\n\nfunction resolveCommand(parsed) {\n return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);\n}\n\nmodule.exports = resolveCommand;\n","'use strict';\n\nconst isWin = process.platform === 'win32';\n\nfunction notFoundError(original, syscall) {\n return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {\n code: 'ENOENT',\n errno: 'ENOENT',\n syscall: `${syscall} ${original.command}`,\n path: original.command,\n spawnargs: original.args,\n });\n}\n\nfunction hookChildProcess(cp, parsed) {\n if (!isWin) {\n return;\n }\n\n const originalEmit = cp.emit;\n\n cp.emit = function (name, arg1) {\n // If emitting \"exit\" event and exit code is 1, we need to check if\n // the command exists and emit an \"error\" instead\n // See https://github.com/IndigoUnited/node-cross-spawn/issues/16\n if (name === 'exit') {\n const err = verifyENOENT(arg1, parsed, 'spawn');\n\n if (err) {\n return originalEmit.call(cp, 'error', err);\n }\n }\n\n return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params\n };\n}\n\nfunction verifyENOENT(status, parsed) {\n if (isWin && status === 1 && !parsed.file) {\n return notFoundError(parsed.original, 'spawn');\n }\n\n return null;\n}\n\nfunction verifyENOENTSync(status, parsed) {\n if (isWin && status === 1 && !parsed.file) {\n return notFoundError(parsed.original, 'spawnSync');\n }\n\n return null;\n}\n\nmodule.exports = {\n hookChildProcess,\n verifyENOENT,\n verifyENOENTSync,\n notFoundError,\n};\n","'use strict';\n\nconst cp = require('child_process');\nconst parse = require('./lib/parse');\nconst enoent = require('./lib/enoent');\n\nfunction spawn(command, args, options) {\n // Parse the arguments\n const parsed = parse(command, args, options);\n\n // Spawn the child process\n const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);\n\n // Hook into child process \"exit\" event to emit an error if the command\n // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16\n enoent.hookChildProcess(spawned, parsed);\n\n return spawned;\n}\n\nfunction spawnSync(command, args, options) {\n // Parse the arguments\n const parsed = parse(command, args, options);\n\n // Spawn the child process\n const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);\n\n // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16\n result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);\n\n return result;\n}\n\nmodule.exports = spawn;\nmodule.exports.spawn = spawn;\nmodule.exports.sync = spawnSync;\n\nmodule.exports._parse = parse;\nmodule.exports._enoent = enoent;\n","export default function pathKey(options = {}) {\n\tconst {\n\t\tenv = process.env,\n\t\tplatform = process.platform\n\t} = options;\n\n\tif (platform !== 'win32') {\n\t\treturn 'PATH';\n\t}\n\n\treturn Object.keys(env).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path';\n}\n","import {promisify} from 'node:util';\nimport {execFile as execFileCallback, execFileSync as execFileSyncOriginal} from 'node:child_process';\nimport path from 'node:path';\nimport {fileURLToPath} from 'node:url';\n\nconst execFileOriginal = promisify(execFileCallback);\n\nexport function toPath(urlOrPath) {\n\treturn urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n}\n\nexport function rootDirectory(pathInput) {\n\treturn path.parse(toPath(pathInput)).root;\n}\n\nexport function traversePathUp(startPath) {\n\treturn {\n\t\t* [Symbol.iterator]() {\n\t\t\tlet currentPath = path.resolve(toPath(startPath));\n\t\t\tlet previousPath;\n\n\t\t\twhile (previousPath !== currentPath) {\n\t\t\t\tyield currentPath;\n\t\t\t\tpreviousPath = currentPath;\n\t\t\t\tcurrentPath = path.resolve(currentPath, '..');\n\t\t\t}\n\t\t},\n\t};\n}\n\nconst TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;\n\nexport async function execFile(file, arguments_, options = {}) {\n\treturn execFileOriginal(file, arguments_, {\n\t\tmaxBuffer: TEN_MEGABYTES_IN_BYTES,\n\t\t...options,\n\t});\n}\n\nexport function execFileSync(file, arguments_ = [], options = {}) {\n\treturn execFileSyncOriginal(file, arguments_, {\n\t\tmaxBuffer: TEN_MEGABYTES_IN_BYTES,\n\t\tencoding: 'utf8',\n\t\tstdio: 'pipe',\n\t\t...options,\n\t});\n}\n\nexport * from './default.js';\n","var scope = (typeof global !== \"undefined\" && global) ||\n (typeof self !== \"undefined\" && self) ||\n window;\nvar apply = Function.prototype.apply;\n\n// DOM APIs, for completeness\n\nexports.setTimeout = function() {\n return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout);\n};\nexports.setInterval = function() {\n return new Timeout(apply.call(setInterval, scope, arguments), clearInterval);\n};\nexports.clearTimeout =\nexports.clearInterval = function(timeout) {\n if (timeout) {\n timeout.close();\n }\n};\n\nfunction Timeout(id, clearFn) {\n this._id = id;\n this._clearFn = clearFn;\n}\nTimeout.prototype.unref = Timeout.prototype.ref = function() {};\nTimeout.prototype.close = function() {\n this._clearFn.call(scope, this._id);\n};\n\n// Does not start the time, just sets up the members needed.\nexports.enroll = function(item, msecs) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = msecs;\n};\n\nexports.unenroll = function(item) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = -1;\n};\n\nexports._unrefActive = exports.active = function(item) {\n clearTimeout(item._idleTimeoutId);\n\n var msecs = item._idleTimeout;\n if (msecs >= 0) {\n item._idleTimeoutId = setTimeout(function onTimeout() {\n if (item._onTimeout)\n item._onTimeout();\n }, msecs);\n }\n};\n\n// setimmediate attaches itself to the global object\nrequire(\"setimmediate\");\n// On some exotic environments, it's not clear which object `setimmediate` was\n// able to install onto. Search each possibility in the same order as the\n// `setimmediate` library.\nexports.setImmediate = (typeof self !== \"undefined\" && self.setImmediate) ||\n (typeof global !== \"undefined\" && global.setImmediate) ||\n (this && this.setImmediate);\nexports.clearImmediate = (typeof self !== \"undefined\" && self.clearImmediate) ||\n (typeof global !== \"undefined\" && global.clearImmediate) ||\n (this && this.clearImmediate);\n","export default function stripFinalNewline(input) {\n\tif (typeof input === 'string') {\n\t\treturn stripFinalNewlineString(input);\n\t}\n\n\tif (!(ArrayBuffer.isView(input) && input.BYTES_PER_ELEMENT === 1)) {\n\t\tthrow new Error('Input must be a string or a Uint8Array');\n\t}\n\n\treturn stripFinalNewlineBinary(input);\n}\n\nconst stripFinalNewlineString = input =>\n\tinput.at(-1) === LF\n\t\t? input.slice(0, input.at(-2) === CR ? -2 : -1)\n\t\t: input;\n\nconst stripFinalNewlineBinary = input =>\n\tinput.at(-1) === LF_BINARY\n\t\t? input.subarray(0, input.at(-2) === CR_BINARY ? -2 : -1)\n\t\t: input;\n\nconst LF = '\\n';\nconst LF_BINARY = LF.codePointAt(0);\nconst CR = '\\r';\nconst CR_BINARY = CR.codePointAt(0);\n","export function isStream(stream, {checkOpen = true} = {}) {\n\treturn stream !== null\n\t\t&& typeof stream === 'object'\n\t\t&& (stream.writable || stream.readable || !checkOpen || (stream.writable === undefined && stream.readable === undefined))\n\t\t&& typeof stream.pipe === 'function';\n}\n\nexport function isWritableStream(stream, {checkOpen = true} = {}) {\n\treturn isStream(stream, {checkOpen})\n\t\t&& (stream.writable || !checkOpen)\n\t\t&& typeof stream.write === 'function'\n\t\t&& typeof stream.end === 'function'\n\t\t&& typeof stream.writable === 'boolean'\n\t\t&& typeof stream.writableObjectMode === 'boolean'\n\t\t&& typeof stream.destroy === 'function'\n\t\t&& typeof stream.destroyed === 'boolean';\n}\n\nexport function isReadableStream(stream, {checkOpen = true} = {}) {\n\treturn isStream(stream, {checkOpen})\n\t\t&& (stream.readable || !checkOpen)\n\t\t&& typeof stream.read === 'function'\n\t\t&& typeof stream.readable === 'boolean'\n\t\t&& typeof stream.readableObjectMode === 'boolean'\n\t\t&& typeof stream.destroy === 'function'\n\t\t&& typeof stream.destroyed === 'boolean';\n}\n\nexport function isDuplexStream(stream, options) {\n\treturn isWritableStream(stream, options)\n\t\t&& isReadableStream(stream, options);\n}\n\nexport function isTransformStream(stream, options) {\n\treturn isDuplexStream(stream, options)\n\t\t&& typeof stream._transform === 'function';\n}\n","const a = Object.getPrototypeOf(\n Object.getPrototypeOf(\n /* istanbul ignore next */\n async function* () {\n }\n ).prototype\n);\nclass c {\n #t;\n #n;\n #r = !1;\n #e = void 0;\n constructor(e, t) {\n this.#t = e, this.#n = t;\n }\n next() {\n const e = () => this.#s();\n return this.#e = this.#e ? this.#e.then(e, e) : e(), this.#e;\n }\n return(e) {\n const t = () => this.#i(e);\n return this.#e ? this.#e.then(t, t) : t();\n }\n async #s() {\n if (this.#r)\n return {\n done: !0,\n value: void 0\n };\n let e;\n try {\n e = await this.#t.read();\n } catch (t) {\n throw this.#e = void 0, this.#r = !0, this.#t.releaseLock(), t;\n }\n return e.done && (this.#e = void 0, this.#r = !0, this.#t.releaseLock()), e;\n }\n async #i(e) {\n if (this.#r)\n return {\n done: !0,\n value: e\n };\n if (this.#r = !0, !this.#n) {\n const t = this.#t.cancel(e);\n return this.#t.releaseLock(), await t, {\n done: !0,\n value: e\n };\n }\n return this.#t.releaseLock(), {\n done: !0,\n value: e\n };\n }\n}\nconst n = Symbol();\nfunction i() {\n return this[n].next();\n}\nObject.defineProperty(i, \"name\", { value: \"next\" });\nfunction o(r) {\n return this[n].return(r);\n}\nObject.defineProperty(o, \"name\", { value: \"return\" });\nconst u = Object.create(a, {\n next: {\n enumerable: !0,\n configurable: !0,\n writable: !0,\n value: i\n },\n return: {\n enumerable: !0,\n configurable: !0,\n writable: !0,\n value: o\n }\n});\nfunction h({ preventCancel: r = !1 } = {}) {\n const e = this.getReader(), t = new c(\n e,\n r\n ), s = Object.create(u);\n return s[n] = t, s;\n}\nexport {\n h as asyncIterator\n};\n","import parseMilliseconds from 'parse-ms';\n\nconst isZero = value => value === 0 || value === 0n;\nconst pluralize = (word, count) => (count === 1 || count === 1n) ? word : `${word}s`;\n\nconst SECOND_ROUNDING_EPSILON = 0.000_000_1;\nconst ONE_DAY_IN_MILLISECONDS = 24n * 60n * 60n * 1000n;\n\nexport default function prettyMilliseconds(milliseconds, options) {\n\tconst isBigInt = typeof milliseconds === 'bigint';\n\tif (!isBigInt && !Number.isFinite(milliseconds)) {\n\t\tthrow new TypeError('Expected a finite number or bigint');\n\t}\n\n\toptions = {...options};\n\n\tconst sign = milliseconds < 0 ? '-' : '';\n\tmilliseconds = milliseconds < 0 ? -milliseconds : milliseconds; // Cannot use `Math.abs()` because of BigInt support.\n\n\tif (options.colonNotation) {\n\t\toptions.compact = false;\n\t\toptions.formatSubMilliseconds = false;\n\t\toptions.separateMilliseconds = false;\n\t\toptions.verbose = false;\n\t}\n\n\tif (options.compact) {\n\t\toptions.unitCount = 1;\n\t\toptions.secondsDecimalDigits = 0;\n\t\toptions.millisecondsDecimalDigits = 0;\n\t}\n\n\tlet result = [];\n\n\tconst floorDecimals = (value, decimalDigits) => {\n\t\tconst flooredInterimValue = Math.floor((value * (10 ** decimalDigits)) + SECOND_ROUNDING_EPSILON);\n\t\tconst flooredValue = Math.round(flooredInterimValue) / (10 ** decimalDigits);\n\t\treturn flooredValue.toFixed(decimalDigits);\n\t};\n\n\tconst add = (value, long, short, valueString) => {\n\t\tif (\n\t\t\t(result.length === 0 || !options.colonNotation)\n\t\t\t&& isZero(value)\n\t\t\t&& !(options.colonNotation && short === 'm')) {\n\t\t\treturn;\n\t\t}\n\n\t\tvalueString ??= String(value);\n\t\tif (options.colonNotation) {\n\t\t\tconst wholeDigits = valueString.includes('.') ? valueString.split('.')[0].length : valueString.length;\n\t\t\tconst minLength = result.length > 0 ? 2 : 1;\n\t\t\tvalueString = '0'.repeat(Math.max(0, minLength - wholeDigits)) + valueString;\n\t\t} else {\n\t\t\tvalueString += options.verbose ? ' ' + pluralize(long, value) : short;\n\t\t}\n\n\t\tresult.push(valueString);\n\t};\n\n\tconst parsed = parseMilliseconds(milliseconds);\n\tconst days = BigInt(parsed.days);\n\n\tadd(days / 365n, 'year', 'y');\n\tadd(days % 365n, 'day', 'd');\n\tadd(Number(parsed.hours), 'hour', 'h');\n\tadd(Number(parsed.minutes), 'minute', 'm');\n\n\tif (\n\t\toptions.separateMilliseconds\n\t\t|| options.formatSubMilliseconds\n\t\t|| (!options.colonNotation && milliseconds < 1000)\n\t) {\n\t\tconst seconds = Number(parsed.seconds);\n\t\tconst milliseconds = Number(parsed.milliseconds);\n\t\tconst microseconds = Number(parsed.microseconds);\n\t\tconst nanoseconds = Number(parsed.nanoseconds);\n\n\t\tadd(seconds, 'second', 's');\n\n\t\tif (options.formatSubMilliseconds) {\n\t\t\tadd(milliseconds, 'millisecond', 'ms');\n\t\t\tadd(microseconds, 'microsecond', 'µs');\n\t\t\tadd(nanoseconds, 'nanosecond', 'ns');\n\t\t} else {\n\t\t\tconst millisecondsAndBelow\n\t\t\t\t= milliseconds\n\t\t\t\t+ (microseconds / 1000)\n\t\t\t\t+ (nanoseconds / 1e6);\n\n\t\t\tconst millisecondsDecimalDigits\n\t\t\t\t= typeof options.millisecondsDecimalDigits === 'number'\n\t\t\t\t\t? options.millisecondsDecimalDigits\n\t\t\t\t\t: 0;\n\n\t\t\tconst roundedMilliseconds = millisecondsAndBelow >= 1\n\t\t\t\t? Math.round(millisecondsAndBelow)\n\t\t\t\t: Math.ceil(millisecondsAndBelow);\n\n\t\t\tconst millisecondsString = millisecondsDecimalDigits\n\t\t\t\t? millisecondsAndBelow.toFixed(millisecondsDecimalDigits)\n\t\t\t\t: roundedMilliseconds;\n\n\t\t\tadd(\n\t\t\t\tNumber.parseFloat(millisecondsString),\n\t\t\t\t'millisecond',\n\t\t\t\t'ms',\n\t\t\t\tmillisecondsString,\n\t\t\t);\n\t\t}\n\t} else {\n\t\tconst seconds = (\n\t\t\t(isBigInt ? Number(milliseconds % ONE_DAY_IN_MILLISECONDS) : milliseconds)\n\t\t\t/ 1000\n\t\t) % 60;\n\t\tconst secondsDecimalDigits\n\t\t\t= typeof options.secondsDecimalDigits === 'number'\n\t\t\t\t? options.secondsDecimalDigits\n\t\t\t\t: 1;\n\t\tconst secondsFixed = floorDecimals(seconds, secondsDecimalDigits);\n\t\tconst secondsString = options.keepDecimalsOnWholeSeconds\n\t\t\t? secondsFixed\n\t\t\t: secondsFixed.replace(/\\.0+$/, '');\n\t\tadd(Number.parseFloat(secondsString), 'second', 's', secondsString);\n\t}\n\n\tif (result.length === 0) {\n\t\treturn sign + '0' + (options.verbose ? ' milliseconds' : 'ms');\n\t}\n\n\tconst separator = options.colonNotation ? ':' : ' ';\n\tif (typeof options.unitCount === 'number') {\n\t\tresult = result.slice(0, Math.max(options.unitCount, 1));\n\t}\n\n\treturn sign + result.join(separator);\n}\n","const toZeroIfInfinity = value => Number.isFinite(value) ? value : 0;\n\nfunction parseNumber(milliseconds) {\n\treturn {\n\t\tdays: Math.trunc(milliseconds / 86_400_000),\n\t\thours: Math.trunc(milliseconds / 3_600_000 % 24),\n\t\tminutes: Math.trunc(milliseconds / 60_000 % 60),\n\t\tseconds: Math.trunc(milliseconds / 1000 % 60),\n\t\tmilliseconds: Math.trunc(milliseconds % 1000),\n\t\tmicroseconds: Math.trunc(toZeroIfInfinity(milliseconds * 1000) % 1000),\n\t\tnanoseconds: Math.trunc(toZeroIfInfinity(milliseconds * 1e6) % 1000),\n\t};\n}\n\nfunction parseBigint(milliseconds) {\n\treturn {\n\t\tdays: milliseconds / 86_400_000n,\n\t\thours: milliseconds / 3_600_000n % 24n,\n\t\tminutes: milliseconds / 60_000n % 60n,\n\t\tseconds: milliseconds / 1000n % 60n,\n\t\tmilliseconds: milliseconds % 1000n,\n\t\tmicroseconds: 0n,\n\t\tnanoseconds: 0n,\n\t};\n}\n\nexport default function parseMilliseconds(milliseconds) {\n\tswitch (typeof milliseconds) {\n\t\tcase 'number': {\n\t\t\tif (Number.isFinite(milliseconds)) {\n\t\t\t\treturn parseNumber(milliseconds);\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase 'bigint': {\n\t\t\treturn parseBigint(milliseconds);\n\t\t}\n\n\t\t// No default\n\t}\n\n\tthrow new TypeError('Expected a finite number or bigint');\n}\n","import {on, once} from 'node:events';\nimport {PassThrough as PassThroughStream, getDefaultHighWaterMark} from 'node:stream';\nimport {finished} from 'node:stream/promises';\n\nexport default function mergeStreams(streams) {\n\tif (!Array.isArray(streams)) {\n\t\tthrow new TypeError(`Expected an array, got \\`${typeof streams}\\`.`);\n\t}\n\n\tfor (const stream of streams) {\n\t\tvalidateStream(stream);\n\t}\n\n\tconst objectMode = streams.some(({readableObjectMode}) => readableObjectMode);\n\tconst highWaterMark = getHighWaterMark(streams, objectMode);\n\tconst passThroughStream = new MergedStream({\n\t\tobjectMode,\n\t\twritableHighWaterMark: highWaterMark,\n\t\treadableHighWaterMark: highWaterMark,\n\t});\n\n\tfor (const stream of streams) {\n\t\tpassThroughStream.add(stream);\n\t}\n\n\treturn passThroughStream;\n}\n\nconst getHighWaterMark = (streams, objectMode) => {\n\tif (streams.length === 0) {\n\t\treturn getDefaultHighWaterMark(objectMode);\n\t}\n\n\tconst highWaterMarks = streams\n\t\t.filter(({readableObjectMode}) => readableObjectMode === objectMode)\n\t\t.map(({readableHighWaterMark}) => readableHighWaterMark);\n\treturn Math.max(...highWaterMarks);\n};\n\nclass MergedStream extends PassThroughStream {\n\t#streams = new Set([]);\n\t#ended = new Set([]);\n\t#aborted = new Set([]);\n\t#onFinished;\n\t#unpipeEvent = Symbol('unpipe');\n\t#streamPromises = new WeakMap();\n\n\tadd(stream) {\n\t\tvalidateStream(stream);\n\n\t\tif (this.#streams.has(stream)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#streams.add(stream);\n\n\t\tthis.#onFinished ??= onMergedStreamFinished(this, this.#streams, this.#unpipeEvent);\n\t\tconst streamPromise = endWhenStreamsDone({\n\t\t\tpassThroughStream: this,\n\t\t\tstream,\n\t\t\tstreams: this.#streams,\n\t\t\tended: this.#ended,\n\t\t\taborted: this.#aborted,\n\t\t\tonFinished: this.#onFinished,\n\t\t\tunpipeEvent: this.#unpipeEvent,\n\t\t});\n\t\tthis.#streamPromises.set(stream, streamPromise);\n\n\t\tstream.pipe(this, {end: false});\n\t}\n\n\tasync remove(stream) {\n\t\tvalidateStream(stream);\n\n\t\tif (!this.#streams.has(stream)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst streamPromise = this.#streamPromises.get(stream);\n\t\tif (streamPromise === undefined) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.#streamPromises.delete(stream);\n\n\t\tstream.unpipe(this);\n\t\tawait streamPromise;\n\t\treturn true;\n\t}\n}\n\nconst onMergedStreamFinished = async (passThroughStream, streams, unpipeEvent) => {\n\tupdateMaxListeners(passThroughStream, PASSTHROUGH_LISTENERS_COUNT);\n\tconst controller = new AbortController();\n\n\ttry {\n\t\tawait Promise.race([\n\t\t\tonMergedStreamEnd(passThroughStream, controller),\n\t\t\tonInputStreamsUnpipe(passThroughStream, streams, unpipeEvent, controller),\n\t\t]);\n\t} finally {\n\t\tcontroller.abort();\n\t\tupdateMaxListeners(passThroughStream, -PASSTHROUGH_LISTENERS_COUNT);\n\t}\n};\n\nconst onMergedStreamEnd = async (passThroughStream, {signal}) => {\n\ttry {\n\t\tawait finished(passThroughStream, {signal, cleanup: true});\n\t} catch (error) {\n\t\terrorOrAbortStream(passThroughStream, error);\n\t\tthrow error;\n\t}\n};\n\nconst onInputStreamsUnpipe = async (passThroughStream, streams, unpipeEvent, {signal}) => {\n\tfor await (const [unpipedStream] of on(passThroughStream, 'unpipe', {signal})) {\n\t\tif (streams.has(unpipedStream)) {\n\t\t\tunpipedStream.emit(unpipeEvent);\n\t\t}\n\t}\n};\n\nconst validateStream = stream => {\n\tif (typeof stream?.pipe !== 'function') {\n\t\tthrow new TypeError(`Expected a readable stream, got: \\`${typeof stream}\\`.`);\n\t}\n};\n\nconst endWhenStreamsDone = async ({passThroughStream, stream, streams, ended, aborted, onFinished, unpipeEvent}) => {\n\tupdateMaxListeners(passThroughStream, PASSTHROUGH_LISTENERS_PER_STREAM);\n\tconst controller = new AbortController();\n\n\ttry {\n\t\tawait Promise.race([\n\t\t\tafterMergedStreamFinished(onFinished, stream, controller),\n\t\t\tonInputStreamEnd({\n\t\t\t\tpassThroughStream,\n\t\t\t\tstream,\n\t\t\t\tstreams,\n\t\t\t\tended,\n\t\t\t\taborted,\n\t\t\t\tcontroller,\n\t\t\t}),\n\t\t\tonInputStreamUnpipe({\n\t\t\t\tstream,\n\t\t\t\tstreams,\n\t\t\t\tended,\n\t\t\t\taborted,\n\t\t\t\tunpipeEvent,\n\t\t\t\tcontroller,\n\t\t\t}),\n\t\t]);\n\t} finally {\n\t\tcontroller.abort();\n\t\tupdateMaxListeners(passThroughStream, -PASSTHROUGH_LISTENERS_PER_STREAM);\n\t}\n\n\tif (streams.size > 0 && streams.size === ended.size + aborted.size) {\n\t\tif (ended.size === 0 && aborted.size > 0) {\n\t\t\tabortStream(passThroughStream);\n\t\t} else {\n\t\t\tendStream(passThroughStream);\n\t\t}\n\t}\n};\n\nconst afterMergedStreamFinished = async (onFinished, stream, {signal}) => {\n\ttry {\n\t\tawait onFinished;\n\t\tif (!signal.aborted) {\n\t\t\tabortStream(stream);\n\t\t}\n\t} catch (error) {\n\t\tif (!signal.aborted) {\n\t\t\terrorOrAbortStream(stream, error);\n\t\t}\n\t}\n};\n\nconst onInputStreamEnd = async ({passThroughStream, stream, streams, ended, aborted, controller: {signal}}) => {\n\ttry {\n\t\tawait finished(stream, {\n\t\t\tsignal,\n\t\t\tcleanup: true,\n\t\t\treadable: true,\n\t\t\twritable: false,\n\t\t});\n\t\tif (streams.has(stream)) {\n\t\t\tended.add(stream);\n\t\t}\n\t} catch (error) {\n\t\tif (signal.aborted || !streams.has(stream)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isAbortError(error)) {\n\t\t\taborted.add(stream);\n\t\t} else {\n\t\t\terrorStream(passThroughStream, error);\n\t\t}\n\t}\n};\n\nconst onInputStreamUnpipe = async ({stream, streams, ended, aborted, unpipeEvent, controller: {signal}}) => {\n\tawait once(stream, unpipeEvent, {signal});\n\n\tif (!stream.readable) {\n\t\treturn once(signal, 'abort', {signal});\n\t}\n\n\tstreams.delete(stream);\n\tended.delete(stream);\n\taborted.delete(stream);\n};\n\nconst endStream = stream => {\n\tif (stream.writable) {\n\t\tstream.end();\n\t}\n};\n\nconst errorOrAbortStream = (stream, error) => {\n\tif (isAbortError(error)) {\n\t\tabortStream(stream);\n\t} else {\n\t\terrorStream(stream, error);\n\t}\n};\n\n// This is the error thrown by `finished()` on `stream.destroy()`\nconst isAbortError = error => error?.code === 'ERR_STREAM_PREMATURE_CLOSE';\n\nconst abortStream = stream => {\n\tif (stream.readable || stream.writable) {\n\t\tstream.destroy();\n\t}\n};\n\n// `stream.destroy(error)` crashes the process with `uncaughtException` if no `error` event listener exists on `stream`.\n// We take care of error handling on user behalf, so we do not want this to happen.\nconst errorStream = (stream, error) => {\n\tif (!stream.destroyed) {\n\t\tstream.once('error', noop);\n\t\tstream.destroy(error);\n\t}\n};\n\nconst noop = () => {};\n\nconst updateMaxListeners = (passThroughStream, increment) => {\n\tconst maxListeners = passThroughStream.getMaxListeners();\n\tif (maxListeners !== 0 && maxListeners !== Number.POSITIVE_INFINITY) {\n\t\tpassThroughStream.setMaxListeners(maxListeners + increment);\n\t}\n};\n\n// Number of times `passThroughStream.on()` is called regardless of streams:\n// - once due to `finished(passThroughStream)`\n// - once due to `on(passThroughStream)`\nconst PASSTHROUGH_LISTENERS_COUNT = 2;\n\n// Number of times `passThroughStream.on()` is called per stream:\n// - once due to `stream.pipe(passThroughStream)`\nconst PASSTHROUGH_LISTENERS_PER_STREAM = 1;\n","import * as execa from \"execa\";\nimport which from \"which\";\n/** The cached powershell path */\nlet powershell;\n/**\n * Asynchronously execute a powershell command.\n *\n * @param command The powershell command to execute\n * @param startupFlags The optional startup flags to be passed to powershell. Defaults to `[\"-NoProfile\", \"-NoLogo\",\n * \"-NonInteractive\"]`. This means that the Powershell profile is not sourced first.\n * @param execOptions The options passed to `execa`. Defaults to `{ stdio: \"inherit\" }`\n * @returns A promise to the execution result\n * @note It prefers `pwsh` over `powershell`\n */\nexport function execPowershell(command, startupFlags = [\"-NoProfile\", \"-NoLogo\", \"-NonInteractive\"], execOptions = { stdio: \"inherit\" }) {\n return execa.execa(getPowerShell(), [...startupFlags, \"-c\", command], execOptions);\n}\n/**\n * Execute a powershell command.\n *\n * @param command The powershell command to execute\n * @param startupFlags The optional startup flags to be passed to powershell. Defaults to `[\"-NoProfile\", \"-NoLogo\",\n * \"-NonInteractive\"]`. This means that the Powershell profile is not sourced first.\n * @param execOptions The options passed to `execa`. Defaults to `{ stdio: \"inherit\" }`\n * @returns The execution result\n * @note It prefers `pwsh` over `powershell`\n */\nexport function execPowershellSync(command, startupFlags = [\"-NoProfile\", \"-NoLogo\", \"-NonInteractive\"], execOptions = { stdio: \"inherit\" }) {\n return execa.execaSync(getPowerShell(), [...startupFlags, \"-c\", command], execOptions);\n}\n/**\n * Get the path to the powershell executable.\n *\n * @note It prefers `pwsh` over `powershell`\n * @note It caches the path for the subsequent calls to this function\n */\nexport function getPowerShell() {\n if (powershell === undefined) {\n const maybePwsh = which.sync(\"pwsh\", { nothrow: true });\n if (maybePwsh !== null) {\n powershell = maybePwsh;\n }\n const maybePowerShell = which.sync(\"powershell\", { nothrow: true });\n if (maybePowerShell !== null) {\n powershell = maybePowerShell;\n }\n }\n if (powershell === undefined) {\n throw new Error(\"Could not find powershell\");\n }\n return powershell;\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEtBQUssTUFBTSxPQUFPLENBQUE7QUFDOUIsT0FBTyxLQUFLLE1BQU0sT0FBTyxDQUFBO0FBRXpCLGlDQUFpQztBQUNqQyxJQUFJLFVBQThCLENBQUE7QUFFbEM7Ozs7Ozs7OztHQVNHO0FBQ0gsTUFBTSxVQUFVLGNBQWMsQ0FDNUIsT0FBZSxFQUNmLGVBQXlCLENBQUMsWUFBWSxFQUFFLFNBQVMsRUFBRSxpQkFBaUIsQ0FBQyxFQUNyRSxjQUE2QixFQUFFLEtBQUssRUFBRSxTQUFTLEVBQUU7SUFFakQsT0FBTyxLQUFLLENBQUMsS0FBSyxDQUFDLGFBQWEsRUFBRSxFQUFFLENBQUMsR0FBRyxZQUFZLEVBQUUsSUFBSSxFQUFFLE9BQU8sQ0FBQyxFQUFFLFdBQVcsQ0FBQyxDQUFBO0FBQ3BGLENBQUM7QUFFRDs7Ozs7Ozs7O0dBU0c7QUFDSCxNQUFNLFVBQVUsa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IH1cbiAgcmV0dXJuIHBvd2Vyc2hlbGxcbn1cbiJdfQ==","function e(e,t,r,o){Object.defineProperty(e,t,{get:r,set:o,enumerable:!0,configurable:!0})}function t(){return null!==m.sync(\"sudo\",{nothrow:!0})}function r(){return process.getuid?.()===0||!!process.env.CI}function o(){return r()&&t()}function n(e){return o()?`sudo ${e}`:e}function s(e,t=[],r=h){return o()?b(a(e,t),r):l(e,i(t),r)}function c(e,t=[],r=h){return o()?y(a(e,t),r):S(e,i(t),r)}function a(e,t){return`sudo ${i([e,...t]).join(\" \")}`}function i(e){return e.map(e=>`'${e}'`)}async function d(){try{return await S(\"fltmc\"),!0}catch{return!1}}async function u(){if(\"win32\"!==process.platform)return!1;try{return await S(\"fsutil\",[\"dirty\",\"query\",process.env.systemdrive??\"\"]),!0}catch(e){if(\"ENOENT\"===e.code)return d();return!1}}function f(){return\"win32\"===process.platform?R():r()}async function p(e){if((\"linux\"===process.platform||\"darwin\"===process.platform)&&o()&&void 0!==process.env.SUDO_USER){let t=w.statSync(e).isDirectory();await c(\"chown\",[...t?[\"-R\"]:[],process.env.SUDO_USER,e],h)}}var $,x={};import m from\"which\";import{execaCommandSync as b,execaSync as l,execaCommand as y,execa as S}from\"execa\";import w from\"fs\";e(x,\"hasSudo\",()=>t),e(x,\"isRoot\",()=>r),e(x,\"isSudo\",()=>o),e(x,\"prependSudo\",()=>n),e(x,\"defaultExecOptions\",()=>h),e(x,\"execRootSync\",()=>s),e(x,\"execRoot\",()=>c);let h={stdio:\"inherit\",shell:!0};e($={},\"isAdminWindows\",()=>R),e($,\"isAdminPosix\",()=>A),e($,\"isAdmin\",()=>f);let R=u,A=r;e({},\"grantUserWriteAccess\",()=>p);export{t as hasSudo,r as isRoot,o as isSudo,n as prependSudo,h as defaultExecOptions,s as execRootSync,c as execRoot,R as isAdminWindows,A as isAdminPosix,f as isAdmin,p as grantUserWriteAccess};\n//# sourceMappingURL=index.node.mjs.map\n","\"use strict\";\n\nvar value = require(\"./valid-value\")\n , defineProperty = Object.defineProperty\n , getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor\n , getOwnPropertyNames = Object.getOwnPropertyNames\n , getOwnPropertySymbols = Object.getOwnPropertySymbols;\n\nmodule.exports = function (target, source) {\n\tvar error, sourceObject = Object(value(source));\n\ttarget = Object(value(target));\n\tgetOwnPropertyNames(sourceObject).forEach(function (name) {\n\t\ttry {\n\t\t\tdefineProperty(target, name, getOwnPropertyDescriptor(source, name));\n\t\t} catch (e) { error = e; }\n\t});\n\tif (typeof getOwnPropertySymbols === \"function\") {\n\t\tgetOwnPropertySymbols(sourceObject).forEach(function (symbol) {\n\t\t\ttry {\n\t\t\t\tdefineProperty(target, symbol, getOwnPropertyDescriptor(source, symbol));\n\t\t\t} catch (e) { error = e; }\n\t\t});\n\t}\n\tif (error !== undefined) throw error;\n\treturn target;\n};\n","\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")() ? globalThis : require(\"./implementation\");\n","\"use strict\";\n\nmodule.exports = function () {\n\tif (typeof globalThis !== \"object\") return false;\n\tif (!globalThis) return false;\n\treturn globalThis.Array === Array;\n};\n","var naiveFallback = function () {\n\tif (typeof self === \"object\" && self) return self;\n\tif (typeof window === \"object\" && window) return window;\n\tthrow new Error(\"Unable to resolve global `this`\");\n};\n\nmodule.exports = (function () {\n\tif (this) return this;\n\n\t// Unexpected strict mode (may happen if e.g. bundled into ESM module)\n\n\t// Thanks @mathiasbynens -> https://mathiasbynens.be/notes/globalthis\n\t// In all ES5+ engines global object inherits from Object.prototype\n\t// (if you approached one that doesn't please report)\n\ttry {\n\t\tObject.defineProperty(Object.prototype, \"__global__\", {\n\t\t\tget: function () { return this; },\n\t\t\tconfigurable: true\n\t\t});\n\t} catch (error) {\n\t\t// Unfortunate case of Object.prototype being sealed (via preventExtensions, seal or freeze)\n\t\treturn naiveFallback();\n\t}\n\ttry {\n\t\t// Safari case (window.__global__ is resolved with global context, but __global__ does not)\n\t\tif (!__global__) return naiveFallback();\n\t\treturn __global__;\n\t} finally {\n\t\tdelete Object.prototype.__global__;\n\t}\n})();\n","\"use strict\";\n\nvar isSymbol = require(\"./is-symbol\");\n\nmodule.exports = function (value) {\n\tif (!isSymbol(value)) throw new TypeError(value + \" is not a symbol\");\n\treturn value;\n};\n","\"use strict\";\n\nmodule.exports = function (value) {\n\tif (!value) return false;\n\tif (typeof value === \"symbol\") return true;\n\tif (!value.constructor) return false;\n\tif (value.constructor.name !== \"Symbol\") return false;\n\treturn value[value.constructor.toStringTag] === \"Symbol\";\n};\n","\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")()\n\t? require(\"ext/global-this\").Symbol\n\t: require(\"./polyfill\");\n","\"use strict\";\n\nvar global = require(\"ext/global-this\")\n , validTypes = { object: true, symbol: true };\n\nmodule.exports = function () {\n\tvar Symbol = global.Symbol;\n\tvar symbol;\n\tif (typeof Symbol !== \"function\") return false;\n\tsymbol = Symbol(\"test symbol\");\n\ttry { String(symbol); }\n\tcatch (e) { return false; }\n\n\t// Return 'true' also for polyfills\n\tif (!validTypes[typeof Symbol.iterator]) return false;\n\tif (!validTypes[typeof Symbol.toPrimitive]) return false;\n\tif (!validTypes[typeof Symbol.toStringTag]) return false;\n\n\treturn true;\n};\n","// ES2015 Symbol polyfill for environments that do not (or partially) support it\n\n\"use strict\";\n\nvar d = require(\"d\")\n , validateSymbol = require(\"./validate-symbol\")\n , NativeSymbol = require(\"ext/global-this\").Symbol\n , generateName = require(\"./lib/private/generate-name\")\n , setupStandardSymbols = require(\"./lib/private/setup/standard-symbols\")\n , setupSymbolRegistry = require(\"./lib/private/setup/symbol-registry\");\n\nvar create = Object.create\n , defineProperties = Object.defineProperties\n , defineProperty = Object.defineProperty;\n\nvar SymbolPolyfill, HiddenSymbol, isNativeSafe;\n\nif (typeof NativeSymbol === \"function\") {\n\ttry {\n\t\tString(NativeSymbol());\n\t\tisNativeSafe = true;\n\t} catch (ignore) {}\n} else {\n\tNativeSymbol = null;\n}\n\n// Internal constructor (not one exposed) for creating Symbol instances.\n// This one is used to ensure that `someSymbol instanceof Symbol` always return false\nHiddenSymbol = function Symbol(description) {\n\tif (this instanceof HiddenSymbol) throw new TypeError(\"Symbol is not a constructor\");\n\treturn SymbolPolyfill(description);\n};\n\n// Exposed `Symbol` constructor\n// (returns instances of HiddenSymbol)\nmodule.exports = SymbolPolyfill = function Symbol(description) {\n\tvar symbol;\n\tif (this instanceof Symbol) throw new TypeError(\"Symbol is not a constructor\");\n\tif (isNativeSafe) return NativeSymbol(description);\n\tsymbol = create(HiddenSymbol.prototype);\n\tdescription = description === undefined ? \"\" : String(description);\n\treturn defineProperties(symbol, {\n\t\t__description__: d(\"\", description),\n\t\t__name__: d(\"\", generateName(description))\n\t});\n};\n\nsetupStandardSymbols(SymbolPolyfill);\nsetupSymbolRegistry(SymbolPolyfill);\n\n// Internal tweaks for real symbol producer\ndefineProperties(HiddenSymbol.prototype, {\n\tconstructor: d(SymbolPolyfill),\n\ttoString: d(\"\", function () { return this.__name__; })\n});\n\n// Proper implementation of methods exposed on Symbol.prototype\n// They won't be accessible on produced symbol instances as they derive from HiddenSymbol.prototype\ndefineProperties(SymbolPolyfill.prototype, {\n\ttoString: d(function () { return \"Symbol (\" + validateSymbol(this).__description__ + \")\"; }),\n\tvalueOf: d(function () { return validateSymbol(this); })\n});\ndefineProperty(\n\tSymbolPolyfill.prototype, SymbolPolyfill.toPrimitive,\n\td(\"\", function () {\n\t\tvar symbol = validateSymbol(this);\n\t\tif (typeof symbol === \"symbol\") return symbol;\n\t\treturn symbol.toString();\n\t})\n);\ndefineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toStringTag, d(\"c\", \"Symbol\"));\n\n// Proper implementaton of toPrimitive and toStringTag for returned symbol instances\ndefineProperty(\n\tHiddenSymbol.prototype, SymbolPolyfill.toStringTag,\n\td(\"c\", SymbolPolyfill.prototype[SymbolPolyfill.toStringTag])\n);\n\n// Note: It's important to define `toPrimitive` as last one, as some implementations\n// implement `toPrimitive` natively without implementing `toStringTag` (or other specified symbols)\n// And that may invoke error in definition flow:\n// See: https://github.com/medikoo/es6-symbol/issues/13#issuecomment-164146149\ndefineProperty(\n\tHiddenSymbol.prototype, SymbolPolyfill.toPrimitive,\n\td(\"c\", SymbolPolyfill.prototype[SymbolPolyfill.toPrimitive])\n);\n","\"use strict\";\n\nvar d = require(\"d\");\n\nvar create = Object.create, defineProperty = Object.defineProperty, objPrototype = Object.prototype;\n\nvar created = create(null);\nmodule.exports = function (desc) {\n\tvar postfix = 0, name, ie11BugWorkaround;\n\twhile (created[desc + (postfix || \"\")]) ++postfix;\n\tdesc += postfix || \"\";\n\tcreated[desc] = true;\n\tname = \"@@\" + desc;\n\tdefineProperty(\n\t\tobjPrototype, name,\n\t\td.gs(null, function (value) {\n\t\t\t// For IE11 issue see:\n\t\t\t// https://connect.microsoft.com/IE/feedbackdetail/view/1928508/\n\t\t\t// ie11-broken-getters-on-dom-objects\n\t\t\t// https://github.com/medikoo/es6-symbol/issues/12\n\t\t\tif (ie11BugWorkaround) return;\n\t\t\tie11BugWorkaround = true;\n\t\t\tdefineProperty(this, name, d(value));\n\t\t\tie11BugWorkaround = false;\n\t\t})\n\t);\n\treturn name;\n};\n","\"use strict\";\n\nvar d = require(\"d\")\n , NativeSymbol = require(\"ext/global-this\").Symbol;\n\nmodule.exports = function (SymbolPolyfill) {\n\treturn Object.defineProperties(SymbolPolyfill, {\n\t\t// To ensure proper interoperability with other native functions (e.g. Array.from)\n\t\t// fallback to eventual native implementation of given symbol\n\t\thasInstance: d(\n\t\t\t\"\", (NativeSymbol && NativeSymbol.hasInstance) || SymbolPolyfill(\"hasInstance\")\n\t\t),\n\t\tisConcatSpreadable: d(\n\t\t\t\"\",\n\t\t\t(NativeSymbol && NativeSymbol.isConcatSpreadable) ||\n\t\t\t\tSymbolPolyfill(\"isConcatSpreadable\")\n\t\t),\n\t\titerator: d(\"\", (NativeSymbol && NativeSymbol.iterator) || SymbolPolyfill(\"iterator\")),\n\t\tmatch: d(\"\", (NativeSymbol && NativeSymbol.match) || SymbolPolyfill(\"match\")),\n\t\treplace: d(\"\", (NativeSymbol && NativeSymbol.replace) || SymbolPolyfill(\"replace\")),\n\t\tsearch: d(\"\", (NativeSymbol && NativeSymbol.search) || SymbolPolyfill(\"search\")),\n\t\tspecies: d(\"\", (NativeSymbol && NativeSymbol.species) || SymbolPolyfill(\"species\")),\n\t\tsplit: d(\"\", (NativeSymbol && NativeSymbol.split) || SymbolPolyfill(\"split\")),\n\t\ttoPrimitive: d(\n\t\t\t\"\", (NativeSymbol && NativeSymbol.toPrimitive) || SymbolPolyfill(\"toPrimitive\")\n\t\t),\n\t\ttoStringTag: d(\n\t\t\t\"\", (NativeSymbol && NativeSymbol.toStringTag) || SymbolPolyfill(\"toStringTag\")\n\t\t),\n\t\tunscopables: d(\n\t\t\t\"\", (NativeSymbol && NativeSymbol.unscopables) || SymbolPolyfill(\"unscopables\")\n\t\t)\n\t});\n};\n","\"use strict\";\n\nvar d = require(\"d\")\n , validateSymbol = require(\"../../../validate-symbol\");\n\nvar registry = Object.create(null);\n\nmodule.exports = function (SymbolPolyfill) {\n\treturn Object.defineProperties(SymbolPolyfill, {\n\t\tfor: d(function (key) {\n\t\t\tif (registry[key]) return registry[key];\n\t\t\treturn (registry[key] = SymbolPolyfill(String(key)));\n\t\t}),\n\t\tkeyFor: d(function (symbol) {\n\t\t\tvar key;\n\t\t\tvalidateSymbol(symbol);\n\t\t\tfor (key in registry) {\n\t\t\t\tif (registry[key] === symbol) return key;\n\t\t\t}\n\t\t\treturn undefined;\n\t\t})\n\t});\n};\n","\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")() ? Array.from : require(\"./shim\");\n","\"use strict\";\n\nmodule.exports = function () {\n\tvar from = Array.from, arr, result;\n\tif (typeof from !== \"function\") return false;\n\tarr = [\"raz\", \"dwa\"];\n\tresult = from(arr);\n\treturn Boolean(result && result !== arr && result[1] === \"dwa\");\n};\n","\"use strict\";\n\nvar iteratorSymbol = require(\"es6-symbol\").iterator\n , isArguments = require(\"../../function/is-arguments\")\n , isFunction = require(\"../../function/is-function\")\n , toPosInt = require(\"../../number/to-pos-integer\")\n , callable = require(\"../../object/valid-callable\")\n , validValue = require(\"../../object/valid-value\")\n , isValue = require(\"../../object/is-value\")\n , isString = require(\"../../string/is-string\")\n , isArray = Array.isArray\n , call = Function.prototype.call\n , desc = { configurable: true, enumerable: true, writable: true, value: null }\n , defineProperty = Object.defineProperty;\n\n// eslint-disable-next-line complexity, max-lines-per-function\nmodule.exports = function (arrayLike /*, mapFn, thisArg*/) {\n\tvar mapFn = arguments[1]\n\t , thisArg = arguments[2]\n\t , Context\n\t , i\n\t , j\n\t , arr\n\t , length\n\t , code\n\t , iterator\n\t , result\n\t , getIterator\n\t , value;\n\n\tarrayLike = Object(validValue(arrayLike));\n\n\tif (isValue(mapFn)) callable(mapFn);\n\tif (!this || this === Array || !isFunction(this)) {\n\t\t// Result: Plain array\n\t\tif (!mapFn) {\n\t\t\tif (isArguments(arrayLike)) {\n\t\t\t\t// Source: Arguments\n\t\t\t\tlength = arrayLike.length;\n\t\t\t\tif (length !== 1) return Array.apply(null, arrayLike);\n\t\t\t\tarr = new Array(1);\n\t\t\t\tarr[0] = arrayLike[0];\n\t\t\t\treturn arr;\n\t\t\t}\n\t\t\tif (isArray(arrayLike)) {\n\t\t\t\t// Source: Array\n\t\t\t\tarr = new Array((length = arrayLike.length));\n\t\t\t\tfor (i = 0; i < length; ++i) arr[i] = arrayLike[i];\n\t\t\t\treturn arr;\n\t\t\t}\n\t\t}\n\t\tarr = [];\n\t} else {\n\t\t// Result: Non plain array\n\t\tContext = this;\n\t}\n\n\tif (!isArray(arrayLike)) {\n\t\tif ((getIterator = arrayLike[iteratorSymbol]) !== undefined) {\n\t\t\t// Source: Iterator\n\t\t\titerator = callable(getIterator).call(arrayLike);\n\t\t\tif (Context) arr = new Context();\n\t\t\tresult = iterator.next();\n\t\t\ti = 0;\n\t\t\twhile (!result.done) {\n\t\t\t\tvalue = mapFn ? call.call(mapFn, thisArg, result.value, i) : result.value;\n\t\t\t\tif (Context) {\n\t\t\t\t\tdesc.value = value;\n\t\t\t\t\tdefineProperty(arr, i, desc);\n\t\t\t\t} else {\n\t\t\t\t\tarr[i] = value;\n\t\t\t\t}\n\t\t\t\tresult = iterator.next();\n\t\t\t\t++i;\n\t\t\t}\n\t\t\tlength = i;\n\t\t} else if (isString(arrayLike)) {\n\t\t\t// Source: String\n\t\t\tlength = arrayLike.length;\n\t\t\tif (Context) arr = new Context();\n\t\t\tfor (i = 0, j = 0; i < length; ++i) {\n\t\t\t\tvalue = arrayLike[i];\n\t\t\t\tif (i + 1 < length) {\n\t\t\t\t\tcode = value.charCodeAt(0);\n\t\t\t\t\t// eslint-disable-next-line max-depth\n\t\t\t\t\tif (code >= 0xd800 && code <= 0xdbff) value += arrayLike[++i];\n\t\t\t\t}\n\t\t\t\tvalue = mapFn ? call.call(mapFn, thisArg, value, j) : value;\n\t\t\t\tif (Context) {\n\t\t\t\t\tdesc.value = value;\n\t\t\t\t\tdefineProperty(arr, j, desc);\n\t\t\t\t} else {\n\t\t\t\t\tarr[j] = value;\n\t\t\t\t}\n\t\t\t\t++j;\n\t\t\t}\n\t\t\tlength = j;\n\t\t}\n\t}\n\tif (length === undefined) {\n\t\t// Source: array or array-like\n\t\tlength = toPosInt(arrayLike.length);\n\t\tif (Context) arr = new Context(length);\n\t\tfor (i = 0; i < length; ++i) {\n\t\t\tvalue = mapFn ? call.call(mapFn, thisArg, arrayLike[i], i) : arrayLike[i];\n\t\t\tif (Context) {\n\t\t\t\tdesc.value = value;\n\t\t\t\tdefineProperty(arr, i, desc);\n\t\t\t} else {\n\t\t\t\tarr[i] = value;\n\t\t\t}\n\t\t}\n\t}\n\tif (Context) {\n\t\tdesc.value = null;\n\t\tarr.length = length;\n\t}\n\treturn arr;\n};\n","\"use strict\";\n\nvar objToString = Object.prototype.toString\n , id = objToString.call((function () { return arguments; })());\n\nmodule.exports = function (value) { return objToString.call(value) === id; };\n","\"use strict\";\n\nvar objToString = Object.prototype.toString\n , isFunctionStringTag = RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);\n\nmodule.exports = function (value) {\n\treturn typeof value === \"function\" && isFunctionStringTag(objToString.call(value));\n};\n","\"use strict\";\n\nvar objToString = Object.prototype.toString, id = objToString.call(\"\");\n\nmodule.exports = function (value) {\n\treturn (\n\t\ttypeof value === \"string\" ||\n\t\t(value &&\n\t\t\ttypeof value === \"object\" &&\n\t\t\t(value instanceof String || objToString.call(value) === id)) ||\n\t\tfalse\n\t);\n};\n","\"use strict\";\n\nvar numberIsNaN = require(\"../../number/is-nan\")\n , toPosInt = require(\"../../number/to-pos-integer\")\n , value = require(\"../../object/valid-value\")\n , indexOf = Array.prototype.indexOf\n , objHasOwnProperty = Object.prototype.hasOwnProperty\n , abs = Math.abs\n , floor = Math.floor;\n\nmodule.exports = function (searchElement /*, fromIndex*/) {\n\tvar i, length, fromIndex, val;\n\tif (!numberIsNaN(searchElement)) return indexOf.apply(this, arguments);\n\n\tlength = toPosInt(value(this).length);\n\tfromIndex = arguments[1];\n\tif (isNaN(fromIndex)) fromIndex = 0;\n\telse if (fromIndex >= 0) fromIndex = floor(fromIndex);\n\telse fromIndex = toPosInt(this.length) - floor(abs(fromIndex));\n\n\tfor (i = fromIndex; i < length; ++i) {\n\t\tif (objHasOwnProperty.call(this, i)) {\n\t\t\tval = this[i];\n\t\t\tif (numberIsNaN(val)) return i; // Jslint: ignore\n\t\t}\n\t}\n\treturn -1;\n};\n","\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")() ? Number.isNaN : require(\"./shim\");\n","\"use strict\";\n\nmodule.exports = function () {\n\tvar numberIsNaN = Number.isNaN;\n\tif (typeof numberIsNaN !== \"function\") return false;\n\treturn !numberIsNaN({}) && numberIsNaN(NaN) && !numberIsNaN(34);\n};\n","\"use strict\";\n\nmodule.exports = function (value) {\n\t// eslint-disable-next-line no-self-compare\n\treturn value !== value;\n};\n","\"use strict\";\n\nvar callable = require(\"./valid-callable\")\n , forEach = require(\"./for-each\")\n , call = Function.prototype.call;\n\nmodule.exports = function (obj, cb /*, thisArg*/) {\n\tvar result = {}, thisArg = arguments[2];\n\tcallable(cb);\n\tforEach(obj, function (value, key, targetObj, index) {\n\t\tresult[key] = call.call(cb, thisArg, value, key, targetObj, index);\n\t});\n\treturn result;\n};\n","'use strict';\n\nvar ensureCallable = function (fn) {\n\tif (typeof fn !== 'function') throw new TypeError(fn + \" is not a function\");\n\treturn fn;\n};\n\nvar byObserver = function (Observer) {\n\tvar node = document.createTextNode(''), queue, currentQueue, i = 0;\n\tnew Observer(function () {\n\t\tvar callback;\n\t\tif (!queue) {\n\t\t\tif (!currentQueue) return;\n\t\t\tqueue = currentQueue;\n\t\t} else if (currentQueue) {\n\t\t\tqueue = currentQueue.concat(queue);\n\t\t}\n\t\tcurrentQueue = queue;\n\t\tqueue = null;\n\t\tif (typeof currentQueue === 'function') {\n\t\t\tcallback = currentQueue;\n\t\t\tcurrentQueue = null;\n\t\t\tcallback();\n\t\t\treturn;\n\t\t}\n\t\tnode.data = (i = ++i % 2); // Invoke other batch, to handle leftover callbacks in case of crash\n\t\twhile (currentQueue) {\n\t\t\tcallback = currentQueue.shift();\n\t\t\tif (!currentQueue.length) currentQueue = null;\n\t\t\tcallback();\n\t\t}\n\t}).observe(node, { characterData: true });\n\treturn function (fn) {\n\t\tensureCallable(fn);\n\t\tif (queue) {\n\t\t\tif (typeof queue === 'function') queue = [queue, fn];\n\t\t\telse queue.push(fn);\n\t\t\treturn;\n\t\t}\n\t\tqueue = fn;\n\t\tnode.data = (i = ++i % 2);\n\t};\n};\n\nmodule.exports = (function () {\n\t// Node.js\n\tif ((typeof process === 'object') && process && (typeof process.nextTick === 'function')) {\n\t\treturn process.nextTick;\n\t}\n\n\t// queueMicrotask\n\tif (typeof queueMicrotask === \"function\") {\n\t\treturn function (cb) { queueMicrotask(ensureCallable(cb)); };\n\t}\n\n\t// MutationObserver\n\tif ((typeof document === 'object') && document) {\n\t\tif (typeof MutationObserver === 'function') return byObserver(MutationObserver);\n\t\tif (typeof WebKitMutationObserver === 'function') return byObserver(WebKitMutationObserver);\n\t}\n\n\t// W3C Draft\n\t// http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/setImmediate/Overview.html\n\tif (typeof setImmediate === 'function') {\n\t\treturn function (cb) { setImmediate(ensureCallable(cb)); };\n\t}\n\n\t// Wide available standard\n\tif ((typeof setTimeout === 'function') || (typeof setTimeout === 'object')) {\n\t\treturn function (cb) { setTimeout(ensureCallable(cb), 0); };\n\t}\n\n\treturn null;\n}());\n","// Deprecated\n\n\"use strict\";\n\nmodule.exports = function (obj) { return typeof obj === \"function\"; };\n","module.exports = isPromise;\nmodule.exports.default = isPromise;\n\nfunction isPromise(obj) {\n return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';\n}\n","/* eslint max-statements: 0 */\n\n// Support for functions returning promise\n\n\"use strict\";\n\nvar objectMap = require(\"es5-ext/object/map\")\n , primitiveSet = require(\"es5-ext/object/primitive-set\")\n , ensureString = require(\"es5-ext/object/validate-stringifiable-value\")\n , toShortString = require(\"es5-ext/to-short-string-representation\")\n , isPromise = require(\"is-promise\")\n , nextTick = require(\"next-tick\");\n\nvar create = Object.create\n , supportedModes = primitiveSet(\"then\", \"then:finally\", \"done\", \"done:finally\");\n\nrequire(\"../lib/registered-extensions\").promise = function (mode, conf) {\n\tvar waiting = create(null), cache = create(null), promises = create(null);\n\n\tif (mode === true) {\n\t\tmode = null;\n\t} else {\n\t\tmode = ensureString(mode);\n\t\tif (!supportedModes[mode]) {\n\t\t\tthrow new TypeError(\"'\" + toShortString(mode) + \"' is not valid promise mode\");\n\t\t}\n\t}\n\n\t// After not from cache call\n\tconf.on(\"set\", function (id, ignore, promise) {\n\t\tvar isFailed = false;\n\n\t\tif (!isPromise(promise)) {\n\t\t\t// Non promise result\n\t\t\tcache[id] = promise;\n\t\t\tconf.emit(\"setasync\", id, 1);\n\t\t\treturn;\n\t\t}\n\t\twaiting[id] = 1;\n\t\tpromises[id] = promise;\n\t\tvar onSuccess = function (result) {\n\t\t\tvar count = waiting[id];\n\t\t\tif (isFailed) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"Memoizee error: Detected unordered then|done & finally resolution, which \" +\n\t\t\t\t\t\t\"in turn makes proper detection of success/failure impossible (when in \" +\n\t\t\t\t\t\t\"'done:finally' mode)\\n\" +\n\t\t\t\t\t\t\"Consider to rely on 'then' or 'done' mode instead.\"\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (!count) return; // Deleted from cache before resolved\n\t\t\tdelete waiting[id];\n\t\t\tcache[id] = result;\n\t\t\tconf.emit(\"setasync\", id, count);\n\t\t};\n\t\tvar onFailure = function () {\n\t\t\tisFailed = true;\n\t\t\tif (!waiting[id]) return; // Deleted from cache (or succeed in case of finally)\n\t\t\tdelete waiting[id];\n\t\t\tdelete promises[id];\n\t\t\tconf.delete(id);\n\t\t};\n\n\t\tvar resolvedMode = mode;\n\t\tif (!resolvedMode) resolvedMode = \"then\";\n\n\t\tif (resolvedMode === \"then\") {\n\t\t\tvar nextTickFailure = function () { nextTick(onFailure); };\n\t\t\t// Eventual finally needs to be attached to non rejected promise\n\t\t\t// (so we not force propagation of unhandled rejection)\n\t\t\tpromise = promise.then(function (result) {\n\t\t\t\tnextTick(onSuccess.bind(this, result));\n\t\t\t}, nextTickFailure);\n\t\t\t// If `finally` is a function we attach to it to remove cancelled promises.\n\t\t\tif (typeof promise.finally === \"function\") {\n\t\t\t\tpromise.finally(nextTickFailure);\n\t\t\t}\n\t\t} else if (resolvedMode === \"done\") {\n\t\t\t// Not recommended, as it may mute any eventual \"Unhandled error\" events\n\t\t\tif (typeof promise.done !== \"function\") {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"Memoizee error: Retrieved promise does not implement 'done' \" +\n\t\t\t\t\t\t\"in 'done' mode\"\n\t\t\t\t);\n\t\t\t}\n\t\t\tpromise.done(onSuccess, onFailure);\n\t\t} else if (resolvedMode === \"done:finally\") {\n\t\t\t// The only mode with no side effects assuming library does not throw unconditionally\n\t\t\t// for rejected promises.\n\t\t\tif (typeof promise.done !== \"function\") {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"Memoizee error: Retrieved promise does not implement 'done' \" +\n\t\t\t\t\t\t\"in 'done:finally' mode\"\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (typeof promise.finally !== \"function\") {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"Memoizee error: Retrieved promise does not implement 'finally' \" +\n\t\t\t\t\t\t\"in 'done:finally' mode\"\n\t\t\t\t);\n\t\t\t}\n\t\t\tpromise.done(onSuccess);\n\t\t\tpromise.finally(onFailure);\n\t\t}\n\t});\n\n\t// From cache (sync)\n\tconf.on(\"get\", function (id, args, context) {\n\t\tvar promise;\n\t\tif (waiting[id]) {\n\t\t\t++waiting[id]; // Still waiting\n\t\t\treturn;\n\t\t}\n\t\tpromise = promises[id];\n\t\tvar emit = function () { conf.emit(\"getasync\", id, args, context); };\n\t\tif (isPromise(promise)) {\n\t\t\tif (typeof promise.done === \"function\") promise.done(emit);\n\t\t\telse {\n\t\t\t\tpromise.then(function () { nextTick(emit); });\n\t\t\t}\n\t\t} else {\n\t\t\temit();\n\t\t}\n\t});\n\n\t// On delete\n\tconf.on(\"delete\", function (id) {\n\t\tdelete promises[id];\n\t\tif (waiting[id]) {\n\t\t\tdelete waiting[id];\n\t\t\treturn; // Not yet resolved\n\t\t}\n\t\tif (!hasOwnProperty.call(cache, id)) return;\n\t\tvar result = cache[id];\n\t\tdelete cache[id];\n\t\tconf.emit(\"deleteasync\", id, [result]);\n\t});\n\n\t// On clear\n\tconf.on(\"clear\", function () {\n\t\tvar oldCache = cache;\n\t\tcache = create(null);\n\t\twaiting = create(null);\n\t\tpromises = create(null);\n\t\tconf.emit(\"clearasync\", objectMap(oldCache, function (data) { return [data]; }));\n\t});\n};\n","\"use strict\";\n\nvar forEach = Array.prototype.forEach, create = Object.create;\n\n// eslint-disable-next-line no-unused-vars\nmodule.exports = function (arg /*, …args*/) {\n\tvar set = create(null);\n\tforEach.call(arguments, function (name) { set[name] = true; });\n\treturn set;\n};\n","\"use strict\";\n\nvar ensureValue = require(\"./valid-value\")\n , stringifiable = require(\"./validate-stringifiable\");\n\nmodule.exports = function (value) { return stringifiable(ensureValue(value)); };\n","\"use strict\";\n\nvar isCallable = require(\"./is-callable\");\n\nmodule.exports = function (stringifiable) {\n\ttry {\n\t\tif (stringifiable && isCallable(stringifiable.toString)) return stringifiable.toString();\n\t\treturn String(stringifiable);\n\t} catch (e) {\n\t\tthrow new TypeError(\"Passed argument cannot be stringifed\");\n\t}\n};\n","\"use strict\";\n\nvar safeToString = require(\"./safe-to-string\");\n\nvar reNewLine = /[\\n\\r\\u2028\\u2029]/g;\n\nmodule.exports = function (value) {\n\tvar string = safeToString(value);\n\t// Trim if too long\n\tif (string.length > 100) string = string.slice(0, 99) + \"…\";\n\t// Replace eventual new lines\n\tstring = string.replace(reNewLine, function (char) {\n\t\treturn JSON.stringify(char).slice(1, -1);\n\t});\n\treturn string;\n};\n","\"use strict\";\n\nvar isCallable = require(\"./object/is-callable\");\n\nmodule.exports = function (value) {\n\ttry {\n\t\tif (value && isCallable(value.toString)) return value.toString();\n\t\treturn String(value);\n\t} catch (e) {\n\t\treturn \"\";\n\t}\n};\n","import fs, {promises as fsPromises} from 'node:fs';\n\nexport async function pathExists(path) {\n\ttry {\n\t\tawait fsPromises.access(path);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nexport function pathExistsSync(path) {\n\ttry {\n\t\tfs.accessSync(path);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n","import { homedir } from \"os\";\nimport { join } from \"path\";\nimport { isSudo } from \"admina\";\nexport function userHomeDir() {\n if (isSudo() && typeof process.env.SUDO_USER === \"string\" && process.env.SUDO_USER !== \"\") {\n // use the user profile even if root\n if (process.platform === \"darwin\") {\n return join(\"/Users/\", process.env.SUDO_USER);\n }\n else {\n return join(\"/home/\", process.env.SUDO_USER);\n }\n }\n else {\n const maybeHomeDir = homedir();\n if (maybeHomeDir === \"\") {\n return undefined;\n }\n return maybeHomeDir;\n }\n}\nconst tildeRegex = /^~(?=$|\\/|\\\\)/;\n/**\n * Replaces a tilde with the user's home directory\n *\n * @example UntildifyUser(\"~/foo\") // /home/user/foo\n *\n * @param path The path to untildify\n * @returns The untildified path\n */\nexport function untildifyUser(path) {\n const maybeHomeDir = userHomeDir();\n if (maybeHomeDir === undefined) {\n return path;\n }\n return path.replace(tildeRegex, maybeHomeDir);\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLElBQUksQ0FBQTtBQUM1QixPQUFPLEVBQUUsSUFBSSxFQUFFLE1BQU0sTUFBTSxDQUFBO0FBQzNCLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSxRQUFRLENBQUE7QUFFL0IsTUFBTSxVQUFVLFdBQVc7SUFDekIsSUFBSSxNQUFNLEVBQUUsSUFBSSxPQUFPLE9BQU8sQ0FBQyxHQUFHLENBQUMsU0FBUyxLQUFLLFFBQVEsSUFBSSxPQUFPLENBQUMsR0FBRyxDQUFDLFNBQVMsS0FBSyxFQUFFLEVBQUUsQ0FBQztRQUMxRixvQ0FBb0M7UUFDcEMsSUFBSSxPQUFPLENBQUMsUUFBUSxLQUFLLFFBQVEsRUFBRSxDQUFDO1lBQ2xDLE9BQU8sSUFBSSxDQUFDLFNBQVMsRUFBRSxPQUFPLENBQUMsR0FBRyxDQUFDLFNBQVMsQ0FBQyxDQUFBO1FBQy9DLENBQUM7YUFBTSxDQUFDO1lBQ04sT0FBTyxJQUFJL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yd2luXCIpIHtcbiAgICAgIHJldHVybiBqb2luKFwiL1VzZXJzL1wiLCBwcm9jZXNzLmVudi5TVURPX1VTRVIpXG4gICAgfSBlbHNlIHtcbiAgICAgIHJldHVybiBqb2luKFwiL2hvbWUvXCIsIHByb2Nlc3MuZW52LlNVRE9fVVNFUilcbiAgICB9XG4gIH0gZWxzZSB7XG4gICAgY29uc3QgbWF5YmVIb21lRGlyID0gaG9tZWRpcigpXG4gICAgaWYgKG1heWJlSG9tZURpciA9PT0gXCJcIikge1xuICAgICAgcmV0dXJuIHVuZGVmaW5lZFxuICAgIH1cbiAgICByZXR1cm4gbWF5YmVIb21lRGlyXG4gIH1cbn1cblxuY29uc3QgdGlsZGVSZWdleCA9IC9efig/PSR8XFwvfFxcXFwpL1xuXG4vKipcbiAqIFJlcGxhY2VzIGEgdGlsZGUgd2l0aCB0aGUgdXNlcidzIGhvbWUgZGlyZWN0b3J5XG4gKlxuICogQGV4YW1wbGUgVW50aWxkaWZ5VXNlcihcIn4vZm9vXCIpIC8vIC9ob21lL3VzZXIvZm9vXG4gKlxuICogQHBhcmFtIHBhdGggVGhlIHBhdGggdG8gdW50aWxkaWZ5XG4gKiBAcmV0dXJucyBUaGUgdW50aWxkaWZpZWQgcGF0aFxuICovXG5leHBvcnQgZnVuY3Rpb24gdW50aWxkaWZ5VXNlcihwYXRoOiBzdHJpbmcpIHtcbiAgY29uc3QgbWF5YmVIb21lRGlyID0gdXNlckhvbWVEaXIoKVxuICBpZiAobWF5YmVIb21lRGlyID09PSB1bmRlZmluZWQpIHtcbiAgICByZXR1cm4gcGF0aFxuICB9XG5cbiAgcmV0dXJuIHBhdGgucmVwbGFjZSh0aWxkZVJlZ2V4LCBtYXliZUhvbWVEaXIpXG59XG4iXX0=","import { promises } from \"fs\";\nimport { grantUserWriteAccess } from \"admina\";\nimport { info, warning } from \"ci-log\";\nimport memoize from \"memoizee\";\nimport { pathExists } from \"path-exists\";\nimport { untildifyUser } from \"untildify-user\";\nconst { appendFile, readFile, writeFile } = promises;\nexport const defaultRcPath = untildifyUser(\"~/.bashrc\");\nasync function sourceRCInRc_(options) {\n const sourceRcString = options.guard === undefined\n ? `\\nsource \"${options.rcPath}\"\\n`\n : `\\n# ${options.guard}\\nif [[ \"$SOURCE_${options.guard.toUpperCase()}RC\" != 0 && -f \"${options.rcPath}\" ]]; then source \"${options.rcPath}\"; fi\\n`;\n try {\n await Promise.all([\n addRCHeader(options),\n addSourceToTargetRc(sourceRcString, untildifyUser(\"~/.bashrc\")),\n addSourceToTargetRc(sourceRcString, untildifyUser(\"~/.profile\")),\n ]);\n }\n catch (err) {\n warning(`Failed to add ${sourceRcString} to .profile or .bashrc. You should add it manually: ${err}`);\n }\n}\n/**\n * handles adding conditions to source rc file from .bashrc and .profile\n */\nexport const sourceRCInRc = memoize(sourceRCInRc_, { promise: true });\nasync function addRCHeader(options) {\n // a variable that prevents source rc from being called from .bashrc and .profile\n const rcHeader = options.guard === undefined\n ? \"\\n# Automatically Generated by envosman\\n\"\n : `\\n# Automatically Generated by envosman ${options.guard}\\nexport SOURCE_${options.guard.toUpperCase()}RC=0\\n`;\n if (await pathExists(options.rcPath)) {\n const rcContent = await readFile(options.rcPath, \"utf8\");\n if (!rcContent.includes(rcHeader)) {\n // already executed setupCppInProfile\n await appendFile(options.rcPath, `\\n${rcHeader}\\n`);\n info(`Added ${rcHeader} to ${options.rcPath}`);\n }\n }\n}\nasync function addSourceToTargetRc(sourceRcString, targetRcPath) {\n if (await pathExists(targetRcPath)) {\n const bashrcContent = await readFile(targetRcPath, \"utf-8\");\n if (!bashrcContent.includes(sourceRcString)) {\n await appendFile(targetRcPath, sourceRcString);\n info(`${sourceRcString} was added to ${targetRcPath}`);\n }\n }\n}\nexport async function finalizeRC(rcOptions) {\n if (await pathExists(rcOptions.rcPath)) {\n const entries = (await readFile(rcOptions.rcPath, \"utf-8\")).split(\"\\n\");\n const uniqueEntries = [...new Set(entries.reverse())].reverse(); // remove duplicates, keeping the latest entry\n await write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} from \"@actions/core\";\nimport { GITHUB_ACTIONS } from \"ci-info\";\nimport { error, info } from \"ci-log\";\nimport { execPowershell } from \"exec-powershell\";\nimport { defaultRcPath, sourceRCInRc } from \"./rc-file.js\";\nimport { escapeString } from \"./utils.js\";\nconst { appendFile } = promises;\n/**\n * Add an environment variable.\n *\n * This function is cross-platforms and works in all the local or CI systems.\n */\nexport async function addEnv(name, valGiven, givenOptions = {}) {\n const options = {\n escapeSpace: false,\n overwrite: true,\n rcPath: defaultRcPath,\n ...givenOptions,\n };\n const val = escapeString(valGiven ?? \"\", options.escapeSpace);\n try {\n if (GITHUB_ACTIONS) {\n try {\n if (!options.overwrite) {\n if (process.env[name] !== undefined) {\n info(`Environment variable ${name} is already defined. Skipping.`);\n return;\n }\n }\n ghExportVariable(name, val);\n }\n catch (err) {\n error(err);\n await addEnvSystem(name, val, options);\n }\n }\n else {\n await addEnvSystem(name, val, options);\n }\n }\n catch (err) {\n error(`${err}\\nFailed to export environment variable ${name}=${val}. You should add it manually.`);\n }\n}\nasync function addEnvSystem(name, valGiven, options) {\n const val = valGiven ?? \"\";\n switch (process.platform) {\n case \"win32\": {\n if (!options.overwrite) {\n if (process.env[name] !== undefined) {\n info(`Environment variable ${name} is already defined. Skipping.`);\n return;\n }\n }\n // We do not use `execaSync(`setx PATH \"${path};%PATH%\"`)` because of its character limit\n await execPowershell(`[Environment]::SetEnvironmentVariable('${name}', '${val}', \"User\")`);\n info(`${name}='${val}' was set in the environment.`);\n return;\n }\n case \"linux\":\n case \"darwin\": {\n await sourceRCInRc(options);\n if (!options.overwrite) {\n await appendFile(options.rcPath, `\\nif [ -z \"\\${${name}}\" ]; then export ${name}=\"${val}\"; fi\\n`);\n info(`if not defined ${name} then ${name}=\"${val}\" was added to \"${options.rcPath}`);\n }\n else {\n await appendFile(options.rcPath, `\\nexport ${name}=\"${val}\"\\n`);\n info(`${name}=\"${val}\" was added to \"${options.rcPath}`);\n }\n return;\n }\n default: {\n // fall through shell path modification\n }\n }\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WV9PVwiJHt2YWx9XCIgd2FzIGFkZGVkIHRvIFwiJHtvcHRpb25zLnJjUGF0aH1gKVxuICAgICAgfVxuICAgICAgcmV0dXJuXG4gICAgfVxuICAgIGRlZmF1bHQ6IHtcbiAgICAgIC8vIGZhbGwgdGhyb3VnaCBzaGVsbCBwYXRoIG1vZGlmaWNhdGlvblxuICAgIH1cbiAgfVxuICBwcm9jZXNzLmVudltuYW1lXSA9IHZhbFxufVxuIl19","import escapeSpace from \"escape-path-with-spaces\";\nimport escapeQuote from \"escape-quotes\";\n/**\n * Escape a string for use in a shell command\n * @param valGiven The string to escape\n * @param shouldEscapeSpace Whether to escape spaces in the string\n *\n * @private\n */\nexport function escapeString(valGiven, shouldEscapeSpace = false) {\n const spaceEscaped = shouldEscapeSpace ? escapeSpace(valGiven) : valGiven;\n return escapeQuote(spaceEscaped, \"\\\"\", \"\\\\\");\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxXQUFXLE1BQU0seUJBQXlCLENBQUE7QUFDakQsT0FBTyxXQUFXLE1BQU0sZUFBZSxDQUFBO0FBRXZDOzs7Ozs7R0FNRztBQUNILE1BQU0sVUFBVSxZQUFZLENBQUMsUUFBZ0IsRUFBRSxvQkFBNkIsS0FBSztJQUMvRSxNQUFNLFlBQVksR0FBRyxpQkFBaUIsQ0FBQyxDQUFDLENBQUMsV0FBVyxDQUFDLFFBQVEsQ0FBQyxDQUFDLENBQUMsQ0FBQyxRQUFRLENBQUE7SUFDekUsT0FBTyxXQUFXLENBQUMsWUFBWSxFQUFFLElBQUksRUFBRSxJQUFJLENBQUMsQ0FBQTtBQUM5QyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IGVzY2FwZVNwYWNlIGZyb20gXCJlc2NhcGUtcGF0aC13aXRoLXNwYWNlc1wiXG5pbXBvcnQgZXNjYXBlUXVvdGUgZnJvbSBcImVzY2FwZS1xdW90ZXNcIlxuXG4vKipcbiAqIEVzY2FwZSBhIHN0cmluZyBmb3IgdXNlIGluIGEgc2hlbGwgY29tbWFuZFxuICogQHBhcmFtIHZhbEdpdmVuIFRoZSBzdHJpbmcgdG8gZXNjYXBlXG4gKiBAcGFyYW0gc2hvdWxkRXNjYXBlU3BhY2UgV2hldGhlciB0byBlc2NhcGUgc3BhY2VzIGluIHRoZSBzdHJpbmdcbiAqXG4gKiBAcHJpdmF0ZVxuICovXG5leHBvcnQgZnVuY3Rpb24gZXNjYXBlU3RyaW5nKHZhbEdpdmVuOiBzdHJpbmcsIHNob3VsZEVzY2FwZVNwYWNlOiBib29sZWFuID0gZmFsc2UpIHtcbiAgY29uc3Qgc3BhY2VFc2NhcGVkID0gc2hvdWxkRXNjYXBlU3BhY2UgPyBlc2NhcGVTcGFjZSh2YWxHaXZlbikgOiB2YWxHaXZlblxuICByZXR1cm4gZXNjYXBlUXVvdGUoc3BhY2VFc2NhcGVkLCBcIlxcXCJcIiwgXCJcXFxcXCIpXG59XG4iXX0=","import { promises } from \"fs\";\nimport { delimiter } from \"path\";\nimport { addPath as ghAddPath } from \"@actions/core\";\nimport { GITHUB_ACTIONS } from \"ci-info\";\nimport { error, info } from \"ci-log\";\nimport { execPowershell } from \"exec-powershell\";\nimport { defaultRcPath, sourceRCInRc } from \"./rc-file.js\";\nconst { appendFile } = promises;\n/**\n * Add a path to the PATH environment variable.\n *\n * This function is cross-platforms and works in all the local or CI systems.\n */\nexport async function addPath(path, givenOptions = {}) {\n const options = { rcPath: defaultRcPath, ...givenOptions };\n if (isIgnoredPath(path)) {\n return;\n }\n process.env.PATH = `${path}${delimiter}${process.env.PATH}`;\n try {\n if (GITHUB_ACTIONS) {\n try {\n ghAddPath(path);\n }\n catch (err) {\n error(err);\n await addPathSystem(path, options);\n }\n }\n else {\n await addPathSystem(path, options);\n }\n }\n catch (err) {\n error(`${err}\\nFailed to add ${path} to the percistent PATH. You should add it manually.`);\n }\n}\nasync function addPathSystem(path, options) {\n switch (process.platform) {\n case \"win32\": {\n // We do not use `execaSync(`setx PATH \"${path};%PATH%\"`)` because of its character limit and also because %PATH% is different for user and system\n await execPowershell(`$USER_PATH=([Environment]::GetEnvironmentVariable(\"PATH\", \"User\")); [Environment]::SetEnvironmentVariable(\"PATH\", \"${path};$USER_PATH\", \"User\")`);\n info(`\"${path}\" was added to the PATH.`);\n return;\n }\n case \"linux\":\n case \"darwin\": {\n await sourceRCInRc(options);\n await appendFile(options.rcPath, `\\nexport PATH=\"${path}:$PATH\"\\n`);\n info(`\"${path}\" was added to \"${options.rcPath}\"`);\n return;\n }\n default: {\n return;\n }\n }\n}\nconst ignoredPaths = [/\\/usr\\/bin\\/?/, /\\/usr\\/local\\/bin\\/?/];\n/** Skip adding /usr/bin to PATH if it is already there */\nfunction isIgnoredPath(path) {\n if (ignoredPaths.some((checkedPath) => checkedPath.test(path))) {\n const paths = process.env.PATH?.split(delimiter) ?? [];\n return paths.includes(path);\n }\n return false;\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWRkLXBhdGguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvYWRkLXBhdGgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLElBQUksQ0FBQTtBQUM3QixPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sTUFBTSxDQUFBO0FBQ2hDLE9BQU8sRUFBRSxPQUFPLElBQUksU0FBUyxFQUFFLE1BQU0sZUFBZSxDQUFBO0FBQ3BELE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSxTQUFTLENBQUE7QUFDeEMsT0FBTyxFQUFFLEtBQUssRUFBRSxJQUFJLEVBQUUsTU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AgICB9XG4gICAgZGVmYXVsdDoge1xuICAgICAgcmV0dXJuXG4gICAgfVxuICB9XG59XG5cbmNvbnN0IGlnbm9yZWRQYXRocyA9IFsvXFwvdXNyXFwvYmluXFwvPy8sIC9cXC91c3JcXC9sb2NhbFxcL2JpblxcLz8vXVxuXG4vKiogU2tpcCBhZGRpbmcgL3Vzci9iaW4gdG8gUEFUSCBpZiBpdCBpcyBhbHJlYWR5IHRoZXJlICovXG5mdW5jdGlvbiBpc0lnbm9yZWRQYXRoKHBhdGg6IHN0cmluZykge1xuICBpZiAoaWdub3JlZFBhdGhzLnNvbWUoKGNoZWNrZWRQYXRoKSA9PiBjaGVja2VkUGF0aC50ZXN0KHBhdGgpKSkge1xuICAgIGNvbnN0IHBhdGhzID0gcHJvY2Vzcy5lbnYuUEFUSD8uc3BsaXQoZGVsaW1pdGVyKSA/PyBbXVxuICAgIHJldHVybiBwYXRocy5pbmNsdWRlcyhwYXRoKVxuICB9XG4gIHJldHVybiBmYWxzZVxufVxuIl19","\n//==============//\n// DEPENDENCIES //\n//==============//\n\nconst numerous = require('numerous');\nconst isNode = require('is-node');\n\n\n//================//\n// MODULE GLOBALS //\n//================//\n\n/**\n * Pre-calculating millisecond values for each time unit.\n */\nconst timeUnits = [\n ['years', 12 * 4 * 7 * 24 * 60 * 60 * 1000],\n ['months', 4 * 7 * 24 * 60 * 60 * 1000],\n ['weeks', 7 * 24 * 60 * 60 * 1000],\n ['days', 24 * 60 * 60 * 1000],\n ['hours', 60 * 60 * 1000],\n ['minutes', 60 * 1000],\n ['seconds', 1000],\n];\n\nconst defaultConfig = {\n locale: 'en',\n span: 2,\n delimiter: ', ',\n unitType: 'long',\n unitTypeLookupOrder: ['long', 'short', 'narrow'],\n autoloadLocales: true,\n};\n\n/**\n * Contains data of loaded locales.\n * @type {Object}\n */\nconst locales = {};\n\n\n//=========//\n// EXPORTS //\n//=========//\n\nmodule.exports = {\n create: timeDeltaFactory,\n addLocale,\n defaultConfig,\n};\n\n\n//===========//\n// FUNCTIONS //\n//===========//\n\n/**\n * Adds pluralization data for the specified locale.\n * Should be called in browser.\n *\n * @param {Object|Object[]} localeData\n */\nfunction addLocale(localeData) {\n\n // Normalizing input\n if (!Array.isArray(localeData)) {\n localeData = [localeData];\n }\n\n for (const item of localeData) {\n const { id, data } = item;\n locales[id] = data;\n }\n\n}\n\n\n/**\n * Creates new instance.\n *\n * @param {object?} config\n *\n * @returns {object}\n */\nfunction timeDeltaFactory(config) {\n\n // Initializing config by extending the default one\n config = Object.assign({}, defaultConfig, config || {});\n\n return {\n\n /**\n * Public proxy for internal format function.\n *\n * @param {Date} firstDate\n * @param {Date} secondDate\n * @param {object?} options\n *\n * @returns {string}\n */\n format: function (firstDate, secondDate, options) {\n\n // Allowing to override config with each individual call\n options = Object.assign({}, config, options || {});\n\n return format(firstDate, secondDate, options);\n\n }\n\n };\n\n}\n\n\n/**\n * Returns difference between two dates as a text string.\n *\n * @param {Date} firstDate\n * @param {Date} secondDate\n * @param {object} config\n *\n * @returns {string}\n */\nfunction format(firstDate, secondDate, config) {\n\n ensureLocaleLoadedOrThrow(config.locale, {\n autoload: config.autoloadLocales,\n });\n\n // Handling input arguments\n // -----\n\n if (!firstDate) {\n throw new Error('Missing first date argument');\n }\n\n if (!secondDate) {\n throw new Error('Missing second date argument');\n }\n\n // Calculating\n // -----\n\n const difference = getDifference(firstDate, secondDate);\n const parts = [];\n\n for (const unit of difference) {\n const [name, value] = unit;\n if (value > 0) {\n parts.push(pluralize(name, value, config));\n }\n if (parts.length >= config.span) {\n break;\n }\n }\n\n // Returning the string value\n return parts.join(config.delimiter);\n\n}\n\n\n/**\n * Checks if locale is loaded. If not, tries to load it in Node.js,\n * or throws and error in Browser.\n *\n * @param {string} locale\n * @param {Object?} options\n */\nfunction ensureLocaleLoadedOrThrow(locale, options) {\n\n const { autoload } = options;\n\n if (hasLocale(locale)) {\n return;\n }\n\n if (isNode && autoload) {\n requireLocale(locale);\n\n } else {\n throw new Error(\n `Missing locale: ${locale}, you must load it manually before using it`\n );\n }\n\n}\n\n\n/**\n * Returns true if specified locale is loaded, false otherwise.\n *\n * @param {string} localeId\n *\n * @returns {boolean}\n */\nfunction hasLocale(localeId) {\n return Boolean(locales[localeId]);\n}\n\n/**\n * Tries to load the specified locale.\n *\n * @param {string} localeId\n */\nfunction requireLocale(localeId) {\n try {\n addLocale(\n require(`../locales/${localeId}.js`)\n );\n\n } catch (error) {\n throw Error(\n `Failed to load locale: ${localeId} from ../locales/${localeId}.js. If using a bundled time-delta, set 'autoloadLocales: false' in the config: ${error}`\n );\n\n }\n}\n\n\n/**\n * Returns difference as separate time units.\n *\n * @param {Date} firstDate\n * @param {Date} secondDate\n *\n * @returns {Array}\n */\nfunction getDifference(firstDate, secondDate) {\n let difference = (secondDate - firstDate);\n const results = [];\n timeUnits.some(function (unit) {\n const name = unit[0];\n const divider = unit[1];\n const value = Math.floor(difference / divider);\n difference -= value * divider;\n results.push([name, value]);\n if (difference <= 0) {\n // Breaking the loop.\n return true;\n }\n });\n return results;\n}\n\n/**\n * Returns localized and pluralized time unit.\n *\n * @param {string} unit\n * @param {int} value\n * @param {object} config\n *\n * @returns {string}\n */\nfunction pluralize(unit, value, config) {\n const unitTypeData = getLocaleDataForUnitType(config);\n const unitString = numerous.pluralize(\n config.locale,\n value,\n unitTypeData[unit]\n );\n return unitString.replace('{0}', value);\n}\n\n\n/**\n * Returns locale data for preferred unit type.\n *\n * @param {object} config\n *\n * @returns {Array}\n */\nfunction getLocaleDataForUnitType(config) {\n\n const localeData = locales[config.locale];\n\n // Making a copy of array from config.\n let lookupOrder = config.unitTypeLookupOrder.slice();\n\n // Adding interested type to the top.\n lookupOrder.unshift(config.unitType);\n\n // Making sure only unique items are present.\n lookupOrder = arrayUnique(lookupOrder);\n\n let unitTypeData = null;\n lookupOrder.some(function (unitType) {\n if ('undefined' !== typeof localeData[unitType]) {\n unitTypeData = localeData[unitType];\n // Breaking the loop.\n return true;\n }\n });\n\n if (null === unitTypeData) {\n throw new Error('Can not find any unit type data for locale: ' + config.locale);\n }\n\n return unitTypeData;\n}\n\n/**\n * Returns array with only unique items.\n *\n * @param {Array} array\n *\n * @returns {Array}\n */\nfunction arrayUnique(array) {\n return Array.from(\n new Set(array)\n );\n}\n","const SPACE_CHARACTERS = /\\s+/g\n\n// hoisted class for cyclic dependency\nclass Range {\n constructor (range, options) {\n options = parseOptions(options)\n\n if (range instanceof Range) {\n if (\n range.loose === !!options.loose &&\n range.includePrerelease === !!options.includePrerelease\n ) {\n return range\n } else {\n return new Range(range.raw, options)\n }\n }\n\n if (range instanceof Comparator) {\n // just put it in the set and return\n this.raw = range.value\n this.set = [[range]]\n this.formatted = undefined\n return this\n }\n\n this.options = options\n this.loose = !!options.loose\n this.includePrerelease = !!options.includePrerelease\n\n // First reduce all whitespace as much as possible so we do not have to rely\n // on potentially slow regexes like \\s*. This is then stored and used for\n // future error messages as well.\n this.raw = range.trim().replace(SPACE_CHARACTERS, ' ')\n\n // First, split on ||\n this.set = this.raw\n .split('||')\n // map the range to a 2d array of comparators\n .map(r => this.parseRange(r.trim()))\n // throw out any comparator lists that are empty\n // this generally means that it was not a valid range, which is allowed\n // in loose mode, but will still throw if the WHOLE range is invalid.\n .filter(c => c.length)\n\n if (!this.set.length) {\n throw new TypeError(`Invalid SemVer Range: ${this.raw}`)\n }\n\n // if we have any that are not the null set, throw out null sets.\n if (this.set.length > 1) {\n // keep the first one, in case they're all null sets\n const first = this.set[0]\n this.set = this.set.filter(c => !isNullSet(c[0]))\n if (this.set.length === 0) {\n this.set = [first]\n } else if (this.set.length > 1) {\n // if we have any that are *, then the range is just *\n for (const c of this.set) {\n if (c.length === 1 && isAny(c[0])) {\n this.set = [c]\n break\n }\n }\n }\n }\n\n this.formatted = undefined\n }\n\n get range () {\n if (this.formatted === undefined) {\n this.formatted = ''\n for (let i = 0; i < this.set.length; i++) {\n if (i > 0) {\n this.formatted += '||'\n }\n const comps = this.set[i]\n for (let k = 0; k < comps.length; k++) {\n if (k > 0) {\n this.formatted += ' '\n }\n this.formatted += comps[k].toString().trim()\n }\n }\n }\n return this.formatted\n }\n\n format () {\n return this.range\n }\n\n toString () {\n return this.range\n }\n\n parseRange (range) {\n // memoize range parsing for performance.\n // this is a very hot path, and fully deterministic.\n const memoOpts =\n (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) |\n (this.options.loose && FLAG_LOOSE)\n const memoKey = memoOpts + ':' + range\n const cached = cache.get(memoKey)\n if (cached) {\n return cached\n }\n\n const loose = this.options.loose\n // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`\n const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]\n range = range.replace(hr, hyphenReplace(this.options.includePrerelease))\n debug('hyphen replace', range)\n\n // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`\n range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)\n debug('comparator trim', range)\n\n // `~ 1.2.3` => `~1.2.3`\n range = range.replace(re[t.TILDETRIM], tildeTrimReplace)\n debug('tilde trim', range)\n\n // `^ 1.2.3` => `^1.2.3`\n range = range.replace(re[t.CARETTRIM], caretTrimReplace)\n debug('caret trim', range)\n\n // At this point, the range is completely trimmed and\n // ready to be split into comparators.\n\n let rangeList = range\n .split(' ')\n .map(comp => parseComparator(comp, this.options))\n .join(' ')\n .split(/\\s+/)\n // >=0.0.0 is equivalent to *\n .map(comp => replaceGTE0(comp, this.options))\n\n if (loose) {\n // in loose mode, throw out any that are not valid comparators\n rangeList = rangeList.filter(comp => {\n debug('loose invalid filter', comp, this.options)\n return !!comp.match(re[t.COMPARATORLOOSE])\n })\n }\n debug('range list', rangeList)\n\n // if any comparators are the null set, then replace with JUST null set\n // if more than one comparator, remove any * comparators\n // also, don't include the same comparator more than once\n const rangeMap = new Map()\n const comparators = rangeList.map(comp => new Comparator(comp, this.options))\n for (const comp of comparators) {\n if (isNullSet(comp)) {\n return [comp]\n }\n rangeMap.set(comp.value, comp)\n }\n if (rangeMap.size > 1 && rangeMap.has('')) {\n rangeMap.delete('')\n }\n\n const result = [...rangeMap.values()]\n cache.set(memoKey, result)\n return result\n }\n\n intersects (range, options) {\n if (!(range instanceof Range)) {\n throw new TypeError('a Range is required')\n }\n\n return this.set.some((thisComparators) => {\n return (\n isSatisfiable(thisComparators, options) &&\n range.set.some((rangeComparators) => {\n return (\n isSatisfiable(rangeComparators, options) &&\n thisComparators.every((thisComparator) => {\n return rangeComparators.every((rangeComparator) => {\n return thisComparator.intersects(rangeComparator, options)\n })\n })\n )\n })\n )\n })\n }\n\n // if ANY of the sets match ALL of its comparators, then pass\n test (version) {\n if (!version) {\n return false\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n for (let i = 0; i < this.set.length; i++) {\n if (testSet(this.set[i], version, this.options)) {\n return true\n }\n }\n return false\n }\n}\n\nmodule.exports = Range\n\nconst LRU = require('../internal/lrucache')\nconst cache = new LRU()\n\nconst parseOptions = require('../internal/parse-options')\nconst Comparator = require('./comparator')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst {\n safeRe: re,\n t,\n comparatorTrimReplace,\n tildeTrimReplace,\n caretTrimReplace,\n} = require('../internal/re')\nconst { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require('../internal/constants')\n\nconst isNullSet = c => c.value === '<0.0.0-0'\nconst isAny = c => c.value === ''\n\n// take a set of comparators and determine whether there\n// exists a version which can satisfy it\nconst isSatisfiable = (comparators, options) => {\n let result = true\n const remainingComparators = comparators.slice()\n let testComparator = remainingComparators.pop()\n\n while (result && remainingComparators.length) {\n result = remainingComparators.every((otherComparator) => {\n return testComparator.intersects(otherComparator, options)\n })\n\n testComparator = remainingComparators.pop()\n }\n\n return result\n}\n\n// comprised of xranges, tildes, stars, and gtlt's at this point.\n// already replaced the hyphen ranges\n// turn into a set of JUST comparators.\nconst parseComparator = (comp, options) => {\n debug('comp', comp, options)\n comp = replaceCarets(comp, options)\n debug('caret', comp)\n comp = replaceTildes(comp, options)\n debug('tildes', comp)\n comp = replaceXRanges(comp, options)\n debug('xrange', comp)\n comp = replaceStars(comp, options)\n debug('stars', comp)\n return comp\n}\n\nconst isX = id => !id || id.toLowerCase() === 'x' || id === '*'\n\n// ~, ~> --> * (any, kinda silly)\n// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0\n// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0\n// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0\n// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0\n// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0\n// ~0.0.1 --> >=0.0.1 <0.1.0-0\nconst replaceTildes = (comp, options) => {\n return comp\n .trim()\n .split(/\\s+/)\n .map((c) => replaceTilde(c, options))\n .join(' ')\n}\n\nconst replaceTilde = (comp, options) => {\n const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('tilde', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0 <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n // ~1.2 == >=1.2.0 <1.3.0-0\n ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`\n } else if (pr) {\n debug('replaceTilde pr', pr)\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n } else {\n // ~1.2.3 == >=1.2.3 <1.3.0-0\n ret = `>=${M}.${m}.${p\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('tilde return', ret)\n return ret\n })\n}\n\n// ^ --> * (any, kinda silly)\n// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0\n// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0\n// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0\n// ^1.2.3 --> >=1.2.3 <2.0.0-0\n// ^1.2.0 --> >=1.2.0 <2.0.0-0\n// ^0.0.1 --> >=0.0.1 <0.0.2-0\n// ^0.1.0 --> >=0.1.0 <0.2.0-0\nconst replaceCarets = (comp, options) => {\n return comp\n .trim()\n .split(/\\s+/)\n .map((c) => replaceCaret(c, options))\n .join(' ')\n}\n\nconst replaceCaret = (comp, options) => {\n debug('caret', comp, options)\n const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]\n const z = options.includePrerelease ? '-0' : ''\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('caret', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n if (M === '0') {\n ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`\n } else {\n ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`\n }\n } else if (pr) {\n debug('replaceCaret pr', pr)\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${+M + 1}.0.0-0`\n }\n } else {\n debug('no pr')\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p\n }${z} <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p\n }${z} <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p\n } <${+M + 1}.0.0-0`\n }\n }\n\n debug('caret return', ret)\n return ret\n })\n}\n\nconst replaceXRanges = (comp, options) => {\n debug('replaceXRanges', comp, options)\n return comp\n .split(/\\s+/)\n .map((c) => replaceXRange(c, options))\n .join(' ')\n}\n\nconst replaceXRange = (comp, options) => {\n comp = comp.trim()\n const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]\n return comp.replace(r, (ret, gtlt, M, m, p, pr) => {\n debug('xRange', comp, ret, gtlt, M, m, p, pr)\n const xM = isX(M)\n const xm = xM || isX(m)\n const xp = xm || isX(p)\n const anyX = xp\n\n if (gtlt === '=' && anyX) {\n gtlt = ''\n }\n\n // if we're including prereleases in the match, then we need\n // to fix this to -0, the lowest possible prerelease value\n pr = options.includePrerelease ? '-0' : ''\n\n if (xM) {\n if (gtlt === '>' || gtlt === '<') {\n // nothing is allowed\n ret = '<0.0.0-0'\n } else {\n // nothing is forbidden\n ret = '*'\n }\n } else if (gtlt && anyX) {\n // we know patch is an x, because we have any x at all.\n // replace X with 0\n if (xm) {\n m = 0\n }\n p = 0\n\n if (gtlt === '>') {\n // >1 => >=2.0.0\n // >1.2 => >=1.3.0\n gtlt = '>='\n if (xm) {\n M = +M + 1\n m = 0\n p = 0\n } else {\n m = +m + 1\n p = 0\n }\n } else if (gtlt === '<=') {\n // <=0.7.x is actually <0.8.0, since any 0.7.x should\n // pass. Similarly, <=7.x is actually <8.0.0, etc.\n gtlt = '<'\n if (xm) {\n M = +M + 1\n } else {\n m = +m + 1\n }\n }\n\n if (gtlt === '<') {\n pr = '-0'\n }\n\n ret = `${gtlt + M}.${m}.${p}${pr}`\n } else if (xm) {\n ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`\n } else if (xp) {\n ret = `>=${M}.${m}.0${pr\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('xRange return', ret)\n\n return ret\n })\n}\n\n// Because * is AND-ed with everything else in the comparator,\n// and '' means \"any version\", just remove the *s entirely.\nconst replaceStars = (comp, options) => {\n debug('replaceStars', comp, options)\n // Looseness is ignored here. star is always as loose as it gets!\n return comp\n .trim()\n .replace(re[t.STAR], '')\n}\n\nconst replaceGTE0 = (comp, options) => {\n debug('replaceGTE0', comp, options)\n return comp\n .trim()\n .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')\n}\n\n// This function is passed to string.replace(re[t.HYPHENRANGE])\n// M, m, patch, prerelease, build\n// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5\n// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do\n// 1.2 - 3.4 => >=1.2.0 <3.5.0-0\n// TODO build?\nconst hyphenReplace = incPr => ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr) => {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = `>=${fM}.0.0${incPr ? '-0' : ''}`\n } else if (isX(fp)) {\n from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`\n } else if (fpr) {\n from = `>=${from}`\n } else {\n from = `>=${from}${incPr ? '-0' : ''}`\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = `<${+tM + 1}.0.0-0`\n } else if (isX(tp)) {\n to = `<${tM}.${+tm + 1}.0-0`\n } else if (tpr) {\n to = `<=${tM}.${tm}.${tp}-${tpr}`\n } else if (incPr) {\n to = `<${tM}.${tm}.${+tp + 1}-0`\n } else {\n to = `<=${to}`\n }\n\n return `${from} ${to}`.trim()\n}\n\nconst testSet = (set, version, options) => {\n for (let i = 0; i < set.length; i++) {\n if (!set[i].test(version)) {\n return false\n }\n }\n\n if (version.prerelease.length && !options.includePrerelease) {\n // Find the set of versions that are allowed to have prereleases\n // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0\n // That should allow `1.2.3-pr.2` to pass.\n // However, `1.2.4-alpha.notready` should NOT be allowed,\n // even though it's within the range set by the comparators.\n for (let i = 0; i < set.length; i++) {\n debug(set[i].semver)\n if (set[i].semver === Comparator.ANY) {\n continue\n }\n\n if (set[i].semver.prerelease.length > 0) {\n const allowed = set[i].semver\n if (allowed.major === version.major &&\n allowed.minor === version.minor &&\n allowed.patch === version.patch) {\n return true\n }\n }\n }\n\n // Version has a -pre, but it's not one of the ones we like.\n return false\n }\n\n return true\n}\n","const ANY = Symbol('SemVer ANY')\n// hoisted class for cyclic dependency\nclass Comparator {\n static get ANY () {\n return ANY\n }\n\n constructor (comp, options) {\n options = parseOptions(options)\n\n if (comp instanceof Comparator) {\n if (comp.loose === !!options.loose) {\n return comp\n } else {\n comp = comp.value\n }\n }\n\n comp = comp.trim().split(/\\s+/).join(' ')\n debug('comparator', comp, options)\n this.options = options\n this.loose = !!options.loose\n this.parse(comp)\n\n if (this.semver === ANY) {\n this.value = ''\n } else {\n this.value = this.operator + this.semver.version\n }\n\n debug('comp', this)\n }\n\n parse (comp) {\n const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]\n const m = comp.match(r)\n\n if (!m) {\n throw new TypeError(`Invalid comparator: ${comp}`)\n }\n\n this.operator = m[1] !== undefined ? m[1] : ''\n if (this.operator === '=') {\n this.operator = ''\n }\n\n // if it literally is just '>' or '' then allow anything.\n if (!m[2]) {\n this.semver = ANY\n } else {\n this.semver = new SemVer(m[2], this.options.loose)\n }\n }\n\n toString () {\n return this.value\n }\n\n test (version) {\n debug('Comparator.test', version, this.options.loose)\n\n if (this.semver === ANY || version === ANY) {\n return true\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n return cmp(version, this.operator, this.semver, this.options)\n }\n\n intersects (comp, options) {\n if (!(comp instanceof Comparator)) {\n throw new TypeError('a Comparator is required')\n }\n\n if (this.operator === '') {\n if (this.value === '') {\n return true\n }\n return new Range(comp.value, options).test(this.value)\n } else if (comp.operator === '') {\n if (comp.value === '') {\n return true\n }\n return new Range(this.value, options).test(comp.semver)\n }\n\n options = parseOptions(options)\n\n // Special cases where nothing can possibly be lower\n if (options.includePrerelease &&\n (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) {\n return false\n }\n if (!options.includePrerelease &&\n (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) {\n return false\n }\n\n // Same direction increasing (> or >=)\n if (this.operator.startsWith('>') && comp.operator.startsWith('>')) {\n return true\n }\n // Same direction decreasing (< or <=)\n if (this.operator.startsWith('<') && comp.operator.startsWith('<')) {\n return true\n }\n // same SemVer and both sides are inclusive (<= or >=)\n if (\n (this.semver.version === comp.semver.version) &&\n this.operator.includes('=') && comp.operator.includes('=')) {\n return true\n }\n // opposite directions less than\n if (cmp(this.semver, '<', comp.semver, options) &&\n this.operator.startsWith('>') && comp.operator.startsWith('<')) {\n return true\n }\n // opposite directions greater than\n if (cmp(this.semver, '>', comp.semver, options) &&\n this.operator.startsWith('<') && comp.operator.startsWith('>')) {\n return true\n }\n return false\n }\n}\n\nmodule.exports = Comparator\n\nconst parseOptions = require('../internal/parse-options')\nconst { safeRe: re, t } = require('../internal/re')\nconst cmp = require('../functions/cmp')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst Range = require('./range')\n","'use strict';\n\nvar process$1 = require('process');\nvar semver = require('semver');\nvar os = require('os');\nvar path = require('path');\nvar fs = require('fs');\nvar https = require('https');\n\n/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\n\r\nfunction __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nfunction __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\n\nvar packageJson = process$1.env.npm_package_json;\nvar userAgent = process$1.env.npm_config_user_agent;\nvar isNpm6 = Boolean(userAgent && userAgent.startsWith('npm'));\nvar isNpm7 = Boolean(packageJson && packageJson.endsWith('package.json'));\nvar isNpm = isNpm6 || isNpm7;\nvar isYarn = Boolean(userAgent && userAgent.startsWith('yarn'));\nvar isNpmOrYarn = isNpm || isYarn;\n\nvar homeDirectory = os.homedir();\nvar configDir = process.env.XDG_CONFIG_HOME ||\n path.join(homeDirectory, '.config', 'simple-update-notifier');\nvar getConfigFile = function (packageName) {\n return path.join(configDir, \"\".concat(packageName.replace('@', '').replace('/', '__'), \".json\"));\n};\nvar createConfigDir = function () {\n if (!fs.existsSync(configDir)) {\n fs.mkdirSync(configDir, { recursive: true });\n }\n};\nvar getLastUpdate = function (packageName) {\n var configFile = getConfigFile(packageName);\n try {\n if (!fs.existsSync(configFile)) {\n return undefined;\n }\n var file = JSON.parse(fs.readFileSync(configFile, 'utf8'));\n return file.lastUpdateCheck;\n }\n catch (_a) {\n return undefined;\n }\n};\nvar saveLastUpdate = function (packageName) {\n var configFile = getConfigFile(packageName);\n fs.writeFileSync(configFile, JSON.stringify({ lastUpdateCheck: new Date().getTime() }));\n};\n\nvar getDistVersion = function (packageName, distTag) { return __awaiter(void 0, void 0, void 0, function () {\n var url;\n return __generator(this, function (_a) {\n url = \"https://registry.npmjs.org/-/package/\".concat(packageName, \"/dist-tags\");\n return [2 /*return*/, new Promise(function (resolve, reject) {\n https\n .get(url, function (res) {\n var body = '';\n res.on('data', function (chunk) { return (body += chunk); });\n res.on('end', function () {\n try {\n var json = JSON.parse(body);\n var version = json[distTag];\n if (!version) {\n reject(new Error('Error getting version'));\n }\n resolve(version);\n }\n catch (_a) {\n reject(new Error('Could not parse version response'));\n }\n });\n })\n .on('error', function (err) { return reject(err); });\n })];\n });\n}); };\n\nvar hasNewVersion = function (_a) {\n var pkg = _a.pkg, _b = _a.updateCheckInterval, updateCheckInterval = _b === void 0 ? 1000 * 60 * 60 * 24 : _b, _c = _a.distTag, distTag = _c === void 0 ? 'latest' : _c, alwaysRun = _a.alwaysRun, debug = _a.debug;\n return __awaiter(void 0, void 0, void 0, function () {\n var lastUpdateCheck, latestVersion;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0:\n createConfigDir();\n lastUpdateCheck = getLastUpdate(pkg.name);\n if (!(alwaysRun ||\n !lastUpdateCheck ||\n lastUpdateCheck < new Date().getTime() - updateCheckInterval)) return [3 /*break*/, 2];\n return [4 /*yield*/, getDistVersion(pkg.name, distTag)];\n case 1:\n latestVersion = _d.sent();\n saveLastUpdate(pkg.name);\n if (semver.gt(latestVersion, pkg.version)) {\n return [2 /*return*/, latestVersion];\n }\n else if (debug) {\n console.error(\"Latest version (\".concat(latestVersion, \") not newer than current version (\").concat(pkg.version, \")\"));\n }\n return [3 /*break*/, 3];\n case 2:\n if (debug) {\n console.error(\"Too recent to check for a new update. simpleUpdateNotifier() interval set to \".concat(updateCheckInterval, \"ms but only \").concat(new Date().getTime() - lastUpdateCheck, \"ms since last check.\"));\n }\n _d.label = 3;\n case 3: return [2 /*return*/, false];\n }\n });\n });\n};\n\nvar borderedText = function (text) {\n var lines = text.split('\\n');\n var width = Math.max.apply(Math, lines.map(function (l) { return l.length; }));\n var res = [\"\\u250C\".concat('─'.repeat(width + 2), \"\\u2510\")];\n for (var _i = 0, lines_1 = lines; _i < lines_1.length; _i++) {\n var line = lines_1[_i];\n res.push(\"\\u2502 \".concat(line.padEnd(width), \" \\u2502\"));\n }\n res.push(\"\\u2514\".concat('─'.repeat(width + 2), \"\\u2518\"));\n return res.join('\\n');\n};\n\nvar simpleUpdateNotifier = function (args) { return __awaiter(void 0, void 0, void 0, function () {\n var latestVersion, err_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!args.alwaysRun &&\n (!process.stdout.isTTY || (isNpmOrYarn && !args.shouldNotifyInNpmScript))) {\n if (args.debug) {\n console.error('Opting out of running simpleUpdateNotifier()');\n }\n return [2 /*return*/];\n }\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, hasNewVersion(args)];\n case 2:\n latestVersion = _a.sent();\n if (latestVersion) {\n console.error(borderedText(\"New version of \".concat(args.pkg.name, \" available!\\nCurrent Version: \").concat(args.pkg.version, \"\\nLatest Version: \").concat(latestVersion)));\n }\n return [3 /*break*/, 4];\n case 3:\n err_1 = _a.sent();\n // Catch any network errors or cache writing errors so module doesn't cause a crash\n if (args.debug && err_1 instanceof Error) {\n console.error('Unexpected error in simpleUpdateNotifier():', err_1);\n }\n return [3 /*break*/, 4];\n case 4: return [2 /*return*/];\n }\n });\n}); };\n\nmodule.exports = simpleUpdateNotifier;\n","function toArr(any) {\n\treturn any == null ? [] : Array.isArray(any) ? any : [any];\n}\n\nfunction toVal(out, key, val, opts) {\n\tvar x, old=out[key], nxt=(\n\t\t!!~opts.string.indexOf(key) ? (val == null || val === true ? '' : String(val))\n\t\t: typeof val === 'boolean' ? val\n\t\t: !!~opts.boolean.indexOf(key) ? (val === 'false' ? false : val === 'true' || (out._.push((x = +val,x * 0 === 0) ? x : val),!!val))\n\t\t: (x = +val,x * 0 === 0) ? x : val\n\t);\n\tout[key] = old == null ? nxt : (Array.isArray(old) ? old.concat(nxt) : [old, nxt]);\n}\n\nexport default function (args, opts) {\n\targs = args || [];\n\topts = opts || {};\n\n\tvar k, arr, arg, name, val, out={ _:[] };\n\tvar i=0, j=0, idx=0, len=args.length;\n\n\tconst alibi = opts.alias !== void 0;\n\tconst strict = opts.unknown !== void 0;\n\tconst defaults = opts.default !== void 0;\n\n\topts.alias = opts.alias || {};\n\topts.string = toArr(opts.string);\n\topts.boolean = toArr(opts.boolean);\n\n\tif (alibi) {\n\t\tfor (k in opts.alias) {\n\t\t\tarr = opts.alias[k] = toArr(opts.alias[k]);\n\t\t\tfor (i=0; i < arr.length; i++) {\n\t\t\t\t(opts.alias[arr[i]] = arr.concat(k)).splice(i, 1);\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (i=opts.boolean.length; i-- > 0;) {\n\t\tarr = opts.alias[opts.boolean[i]] || [];\n\t\tfor (j=arr.length; j-- > 0;) opts.boolean.push(arr[j]);\n\t}\n\n\tfor (i=opts.string.length; i-- > 0;) {\n\t\tarr = opts.alias[opts.string[i]] || [];\n\t\tfor (j=arr.length; j-- > 0;) opts.string.push(arr[j]);\n\t}\n\n\tif (defaults) {\n\t\tfor (k in opts.default) {\n\t\t\tname = typeof opts.default[k];\n\t\t\tarr = opts.alias[k] = opts.alias[k] || [];\n\t\t\tif (opts[name] !== void 0) {\n\t\t\t\topts[name].push(k);\n\t\t\t\tfor (i=0; i < arr.length; i++) {\n\t\t\t\t\topts[name].push(arr[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tconst keys = strict ? Object.keys(opts.alias) : [];\n\n\tfor (i=0; i < len; i++) {\n\t\targ = args[i];\n\n\t\tif (arg === '--') {\n\t\t\tout._ = out._.concat(args.slice(++i));\n\t\t\tbreak;\n\t\t}\n\n\t\tfor (j=0; j < arg.length; j++) {\n\t\t\tif (arg.charCodeAt(j) !== 45) break; // \"-\"\n\t\t}\n\n\t\tif (j === 0) {\n\t\t\tout._.push(arg);\n\t\t} else if (arg.substring(j, j + 3) === 'no-') {\n\t\t\tname = arg.substring(j + 3);\n\t\t\tif (strict && !~keys.indexOf(name)) {\n\t\t\t\treturn opts.unknown(arg);\n\t\t\t}\n\t\t\tout[name] = false;\n\t\t} else {\n\t\t\tfor (idx=j+1; idx < arg.length; idx++) {\n\t\t\t\tif (arg.charCodeAt(idx) === 61) break; // \"=\"\n\t\t\t}\n\n\t\t\tname = arg.substring(j, idx);\n\t\t\tval = arg.substring(++idx) || (i+1 === len || (''+args[i+1]).charCodeAt(0) === 45 || args[++i]);\n\t\t\tarr = (j === 2 ? [name] : name);\n\n\t\t\tfor (idx=0; idx < arr.length; idx++) {\n\t\t\t\tname = arr[idx];\n\t\t\t\tif (strict && !~keys.indexOf(name)) return opts.unknown('-'.repeat(j) + name);\n\t\t\t\ttoVal(out, name, (idx + 1 < arr.length) || val, opts);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (defaults) {\n\t\tfor (k in opts.default) {\n\t\t\tif (out[k] === void 0) {\n\t\t\t\tout[k] = opts.default[k];\n\t\t\t}\n\t\t}\n\t}\n\n\tif (alibi) {\n\t\tfor (k in out) {\n\t\t\tarr = opts.alias[k] || [];\n\t\t\twhile (arr.length > 0) {\n\t\t\t\tout[arr.shift()] = out[k];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn out;\n}\n","import { promises } from \"fs\";\nimport { execRoot } from \"admina\";\nimport { GITHUB_ACTIONS } from \"ci-info\";\nimport { sourceRC } from \"envosman\";\nconst { appendFile } = promises;\n/**\n * Update the alternatives for a package\n * @param name The name of the package\n * @param path The path to the binary\n * @param priority The priority of the alternative (Defaults to `40`)\n */\nexport async function updateAptAlternatives(name, path, priority = 40) {\n await execRoot(\"update-alternatives\", [\"--install\", `/usr/bin/${name}`, name, path, priority.toString()]);\n}\n/**\n * Add the update-alternatives command to the rc file\n * @param name The name of the package\n * @param path The path to the binary\n * @param rcOptions The options for the rc file to add the update-alternatives command to\n * @param priority The priority of the alternative (Defaults to `40`)\n */\nexport async function addUpdateAlternativesToRc(name, path, rcOptions, priority = 40) {\n if (GITHUB_ACTIONS) {\n await updateAptAlternatives(name, path, priority);\n }\n else {\n await sourceRC(rcOptions);\n await appendFile(rcOptions.rcPath, `\\nif [ $UID -eq 0 ]; then update-alternatives --install /usr/bin/${name} ${name} ${path} ${priority}; fi\\n`);\n }\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWx0ZXJuYXRpdmVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2FsdGV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hbWUgb2YgdGhlIHBhY2thZ2VcbiAqIEBwYXJhbSBwYXRoIFRoZSBwYXRoIHRvIHRoZSBiaW5hcnlcbiAqIEBwYXJhbSByY09wdGlvbnMgVGhlIG9wdGlvbnMgZm9yIHRoZSByYyBmaWxlIHRvIGFkZCB0aGUgdXBkYXRlLWFsdGVybmF0aXZlcyBjb21tYW5kIHRvXG4gKiBAcGFyYW0gcHJpb3JpdHkgVGhlIHByaW9yaXR5IG9mIHRoZSBhbHRlcm5hdGl2ZSAoRGVmYXVsdHMgdG8gYDQwYClcbiAqL1xuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGFkZFVwZGF0ZUFsdGVybmF0aXZlc1RvUmMoXG4gIG5hbWU6IHN0cmluZyxcbiAgcGF0aDogc3RyaW5nLFxuICByY09wdGlvbnM6IFJjT3B0aW9ucyxcbiAgcHJpb3JpdHk6IG51bWJlciA9IDQwLFxuKSB7XG4gIGlmIChHSVRIVUJfQUNUSU9OUykge1xuICAgIGF3YWl0IHVwZGF0ZUFwdEFsdGVybmF0aXZlcyhuYW1lLCBwYXRoLCBwcmlvcml0eSlcbiAgfSBlbHNlIHtcbiAgICBhd2FpdCBzb3VyY2VSQyhyY09wdGlvbnMpXG4gICAgYXdhaXQgYXBwZW5kRmlsZShcbiAgICAgIHJjT3B0aW9ucy5yY1BhdGgsXG4gICAgICBgXFxuaWYgWyAkVUlEIC1lcSAwIF07IHRoZW4gdXBkYXRlLWFsdGVybmF0aXZlcyAtLWluc3RhbGwgL3Vzci9iaW4vJHtuYW1lfSAke25hbWV9ICR7cGF0aH0gJHtwcmlvcml0eX07IGZpXFxuYCxcbiAgICApXG4gIH1cbn1cbiJdfQ==","/**\n * Get the environment variables to use for the apt command\n * @param apt The apt command to use\n * @private Used internally\n */\nexport function getAptEnv(apt) {\n const env = { ...process.env, DEBIAN_FRONTEND: \"noninteractive\" };\n if (apt === \"nala\") {\n // if LANG/LC_ALL is not set, enable utf8 otherwise nala fails because of ASCII encoding\n if (env.LANG === undefined) {\n env.LANG = \"C.UTF-8\";\n }\n if (env.LC_ALL === undefined) {\n env.LC_ALL = \"C.UTF-8\";\n }\n }\n return env;\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXB0LWVudi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9hcHQtZW52LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7O0dBSUc7QUFFSCxNQUFNLFVBQVUsU0FBUyxDQUFDLEdBQVc7SUFDbkMsTUFBTSxHQUFHLEdBQXNCLEVBQUUsR0FBRyxPQUFPLENBQUMsR0FBRyxFQUFFLGVBQWUsRUFBRSxnQkFBZ0IsRUFBRSxDQUFBO0lBRXBGLElBQUksR0FBRyxLQUFLLE1BQU0sRUFBRSxDQUFDO1FBQ25CLHdGQUF3RjtRQUN4RixJQUFJLEdBQUcsQ0FBQyxJQUFJLEtBQUssU0FBUyxFQUFFLENBQUM7WUFDM0IsR0FBRyxDQUFDLElBQUksR0FBRyxTQUFTLENBQUE7UUFDdEIsQ0FBQztRQUNELElBQUksR0FBRyxDQUFDLE1BQU0sS0FBSyxTQUFTLEVBQUUsQ0FBQztZQUM3QixHQUFHLENBQUMsTUFBTSxHQUFHLFNBQVMsQ0FBQTtRQUN4QixDQUFDO0lBQ0gsQ0FBQztJQUVELE9BQU8sR0FBRyxDQUFBO0FBQ1osQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2V0IHRoZSBlbnZpcm9ubWVudCB2YXJpYWJsZXMgdG8gdXNlIGZvciB0aGUgYXB0IGNvbW1hbmRcbiAqIEBwYXJhbSBhcHQgVGhlIGFwdCBjb21tYW5kIHRvIHVzZVxuICogQHByaXZhdGUgVXNlZCBpbnRlcm5hbGx5XG4gKi9cblxuZXhwb3J0IGZ1bmN0aW9uIGdldEFwdEVudihhcHQ6IHN0cmluZykge1xuICBjb25zdCBlbnY6IE5vZGVKUy5Qcm9jZXNzRW52ID0geyAuLi5wcm9jZXNzLmVudiwgREVCSUFOX0ZST05URU5EOiBcIm5vbmludGVyYWN0aXZlXCIgfVxuXG4gIGlmIChhcHQgPT09IFwibmFsYVwiKSB7XG4gICAgLy8gaWYgTEFORy9MQ19BTEwgaXMgbm90IHNldCwgZW5hYmxlIHV0Zjggb3RoZXJ3aXNlIG5hbGEgZmFpbHMgYmVjYXVzZSBvZiBBU0NJSSBlbmNvZGluZ1xuICAgIGlmIChlbnYuTEFORyA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICBlbnYuTEFORyA9IFwiQy5VVEYtOFwiXG4gICAgfVxuICAgIGlmIChlbnYuTENfQUxMID09PSB1bmRlZmluZWQpIHtcbiAgICAgIGVudi5MQ19BTEwgPSBcIkMuVVRGLThcIlxuICAgIH1cbiAgfVxuXG4gIHJldHVybiBlbnZcbn1cbiJdfQ==","import which from \"which\";\n/**\n * Check if nala is installed\n */\nexport function hasNala() {\n return which.sync(\"nala\", { nothrow: true }) !== null;\n}\n/**\n * Get the apt command to use\n * If nala is installed, use that, otherwise use apt-get\n */\nexport function getApt() {\n let apt;\n if (hasNala()) {\n apt = \"nala\";\n }\n else {\n apt = \"apt-get\";\n }\n return apt;\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0LWFwdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9nZXQtYXB0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxNQUFNLE9BQU8sQ0FBQTtBQUV6Qjs7R0FFRztBQUNILE1BQU0sVUFBVSxPQUFPO0lBQ3JCLE9BQU8sS0FBSyxDQUFDLElBQUksQ0FBQyxNQUFNLEVBQUUsRUFBRSxPQUFPLEVBQUUsSUFBSSxFQUFFLENBQUMsS0FBSyxJQUFJLENBQUE7QUFDdkQsQ0FBQztBQUVEOzs7R0FHRztBQUNILE1BQU0sVUFBVSxNQUFNO0lBQ3BCLElBQUksR0FBVyxDQUFBO0lBQ2YsSUFBSSxPQUFPLEVBQUUsRUFBRSxDQUFDO1FBQ2QsR0FBRyxHQUFHLE1BQU0sQ0FBQTtJQUNkLENBQUM7U0FBTSxDQUFDO1FBQ04sR0FBRyxHQUFHLFNBQVMsQ0FBQTtJQUNqQixDQUFDO0lBQ0QsT0FBTyxHQUFHLENBQUE7QUFDWixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHdoaWNoIGZyb20gXCJ3aGljaFwiXG5cbi8qKlxuICogQ2hlY2sgaWYgbmFsYSBpcyBpbnN0YWxsZWRcbiAqL1xuZXhwb3J0IGZ1bmN0aW9uIGhhc05hbGEoKSB7XG4gIHJldHVybiB3aGljaC5zeW5jKFwibmFsYVwiLCB7IG5vdGhyb3c6IHRydWUgfSkgIT09IG51bGxcbn1cblxuLyoqXG4gKiBHZXQgdGhlIGFwdCBjb21tYW5kIHRvIHVzZVxuICogSWYgbmFsYSBpcyBpbnN0YWxsZWQsIHVzZSB0aGF0LCBvdGhlcndpc2UgdXNlIGFwdC1nZXRcbiAqL1xuZXhwb3J0IGZ1bmN0aW9uIGdldEFwdCgpIHtcbiAgbGV0IGFwdDogc3RyaW5nXG4gIGlmIChoYXNOYWxhKCkpIHtcbiAgICBhcHQgPSBcIm5hbGFcIlxuICB9IGVsc2Uge1xuICAgIGFwdCA9IFwiYXB0LWdldFwiXG4gIH1cbiAgcmV0dXJuIGFwdFxufVxuIl19","export default function escapeStringRegexp(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError('Expected a string');\n\t}\n\n\t// Escape characters with special meaning either inside or outside character sets.\n\t// Use a simple backslash escape when it’s always valid, and a `\\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.\n\treturn string\n\t\t.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&')\n\t\t.replace(/-/g, '\\\\x2d');\n}\n","import { execa } from \"execa\";\nimport { getAptEnv } from \"./apt-env.js\";\n/**\n * Check if a package is installed\n * @param pack The package to check\n * @returns `true` if the package is installed, `false` otherwise\n */\nexport async function isAptPackInstalled(pack) {\n try {\n // check if a package is installed\n const { stdout } = await execa(\"dpkg\", [\"-s\", pack], { env: getAptEnv(\"apt-get\"), stdio: \"pipe\" });\n if (typeof stdout !== \"string\") {\n return false;\n }\n const lines = stdout.split(\"\\n\");\n // check if the output contains a line that starts with \"Status: install ok installed\"\n return lines.some((line) => line.startsWith(\"Status: install ok installed\"));\n }\n catch {\n return false;\n }\n}\n/**\n * Check if a package matching a regexp is installed\n * @param regexp The regexp to check\n * @returns `true` if a package is installed, `false` otherwise\n */\nexport async function isAptPackRegexInstalled(regexp) {\n try {\n // check if a package matching the regexp is installed\n const { stdout } = await execa(\"dpkg\", [\"-l\", regexp], { env: getAptEnv(\"apt-get\"), stdio: \"pipe\" });\n if (typeof stdout !== \"string\") {\n return false;\n }\n const lines = stdout.split(\"\\n\");\n // check if the output contains any lines that start with \"ii\"\n return lines.some((line) => line.startsWith(\"ii\"));\n }\n catch {\n return false;\n }\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaXMtaW5zdGFsbGVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2lzLWluc3RhbGxlZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsS0FBSyxFQUFFLE1BQU0sT0FBTyxDQUFBO0FBQzdCLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxjQUFjLENBQUE7QUFFeEM7Ozs7R0FJRztBQUNILE1BQU0sQ0FBQyxLQUFLLFVBQVUsa0JBQWtCLENBQUMsSUFBWTtJQUNuRCxJQUFJLENBQUM7UUFDSCxrQ0FBa0M7UUFDbEMsTUFBTSxFQUFFLE1BQU0sRUFBRSxHQUFHL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9PiBsaW5lLnN0YXJ0c1dpdGgoXCJpaVwiKSlcbiAgfSBjYXRjaCB7XG4gICAgcmV0dXJuIGZhbHNlXG4gIH1cbn1cbiJdfQ==","import { warning } from \"ci-log\";\nimport escapeRegex from \"escape-string-regexp\";\nimport { execa } from \"execa\";\nimport { getAptEnv } from \"./apt-env.js\";\nimport { getApt } from \"./get-apt.js\";\nimport { isAptPackInstalled } from \"./is-installed.js\";\nimport { updateAptReposMemoized, updatedRepos } from \"./update.js\";\n/**\n * The type of apt package to install\n */\nexport var AptPackageType;\n(function (AptPackageType) {\n AptPackageType[AptPackageType[\"NameDashVersion\"] = 0] = \"NameDashVersion\";\n AptPackageType[AptPackageType[\"NameEqualsVersion\"] = 1] = \"NameEqualsVersion\";\n AptPackageType[AptPackageType[\"Name\"] = 2] = \"Name\";\n AptPackageType[AptPackageType[\"None\"] = 3] = \"None\";\n})(AptPackageType || (AptPackageType = {}));\n/**\n * Filter out the packages that are already installed and qualify the packages into a full package name/version\n */\nexport async function filterAndQualifyAptPackages(packages, apt = getApt()) {\n return (await Promise.all(packages.map((pack) => qualifiedNeededAptPackage(pack, apt))))\n .filter((pack) => pack !== undefined);\n}\n/**\n * Qualify the package into full package name/version.\n * If the package is not installed, return the full package name/version.\n * If the package is already installed, return undefined\n */\nexport async function qualifiedNeededAptPackage(pack, apt = getApt()) {\n // Qualify the package into full package name/version\n const qualified = await getAptArg(apt, pack.name, pack.version);\n // filter out the package that are already installed\n return (await isAptPackInstalled(qualified)) ? undefined : qualified;\n}\nasync function aptPackageType(apt, name, version) {\n if (version !== undefined && version !== \"\") {\n const { stdout } = await execa(\"apt-cache\", [\n \"search\",\n \"--names-only\",\n `^${escapeRegex(name)}-${escapeRegex(version)}$`,\n ], { env: getAptEnv(apt), stdio: \"pipe\" });\n if (stdout.trim() !== \"\") {\n return AptPackageType.NameDashVersion;\n }\n try {\n // check if apt-get show can find the version\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const { stdout } = await execa(\"apt-cache\", [\"show\", `${name}=${version}`], { env: getAptEnv(apt) });\n if (stdout.trim() === \"\") {\n return AptPackageType.NameEqualsVersion;\n }\n }\n catch {\n // ignore\n }\n }\n try {\n const { stdout: showStdout } = await execa(\"apt-cache\", [\"show\", name], { env: getAptEnv(apt), stdio: \"pipe\" });\n if (showStdout.trim() !== \"\") {\n return AptPackageType.Name;\n }\n }\n catch {\n // ignore\n }\n // If apt-cache fails, update the repos and try again\n if (!updatedRepos) {\n updateAptReposMemoized(apt);\n return aptPackageType(apt, name, version);\n }\n return AptPackageType.None;\n}\nasync function getAptArg(apt, name, version) {\n const package_type = await aptPackageType(apt, name, version);\n switch (package_type) {\n case AptPackageType.NameDashVersion:\n return `${name}-${version}`;\n case AptPackageType.NameEqualsVersion:\n return `${name}=${version}`;\n case AptPackageType.Name:\n if (version !== undefined && version !== \"\") {\n warning(`Could not find package ${name} with version ${version}. Installing the latest version.`);\n }\n return name;\n default:\n throw new Error(`Could not find package ${name} ${version ?? \"\"}`);\n }\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXVhbGlmeS1pbnN0YWxsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL3F1YWxpZnktaW5zdGFsbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsT0FBTyxFQUFFLE1BQU0sUUFBUSxDQUFBO0FBQ2hDLE9BQU8sV0FBVyxNQUFNLHNCQUFzQixDQUFBO0FBQzlDLE9BQU8sRUFBRSxLQUFLLEVBQUUsTUFBTSxPQUFPLENBQUE7QUFDN0IsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLGNBQWMsQ0FBQTtBQUN4QyxPQUFPLEVBQUUsTUFBTSxFQUFFLE1BQU0sY0FBYyxDQUFBO0FBRXJDLE9BQU8sRUFBRSxrQkFBa0IsRUFBRSxNQUFNLG1CQUFtQixDQUFBO0FBQ3REL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ocGFja2FnZV90eXBlKSB7XG4gICAgY2FzZSBBcHRQYWNrYWdlVHlwZS5OYW1lRGFzaFZlcnNpb246XG4gICAgICByZXR1cm4gYCR7bmFtZX0tJHt2ZXJzaW9ufWBcbiAgICBjYXNlIEFwdFBhY2thZ2VUeXBlLk5hbWVFcXVhbHNWZXJzaW9uOlxuICAgICAgcmV0dXJuIGAke25hbWV9PSR7dmVyc2lvbn1gXG4gICAgY2FzZSBBcHRQYWNrYWdlVHlwZS5OYW1lOlxuICAgICAgaWYgKHZlcnNpb24gIT09IHVuZGVmaW5lZCAmJiB2ZXJzaW9uICE9PSBcIlwiKSB7XG4gICAgICAgIHdhcm5pbmcoYENvdWxkIG5vdCBmaW5kIHBhY2thZ2UgJHtuYW1lfSB3aXRoIHZlcnNpb24gJHt2ZXJzaW9ufS4gSW5zdGFsbGluZyB0aGUgbGF0ZXN0IHZlcnNpb24uYClcbiAgICAgIH1cbiAgICAgIHJldHVybiBuYW1lXG4gICAgZGVmYXVsdDpcbiAgICAgIHRocm93IG5ldyBFcnJvcihgQ291bGQgbm90IGZpbmQgcGFja2FnZSAke25hbWV9ICR7dmVyc2lvbiA/PyBcIlwifWApXG4gIH1cbn1cbiJdfQ==","import { defaultExecOptions, execRootSync } from \"admina\";\nimport { info, warning } from \"ci-log\";\nimport { getAptEnv } from \"./apt-env.js\";\nimport { addAptKey } from \"./apt-key.js\";\nimport { addAptRepository } from \"./apt-repository.js\";\nimport { aptTimeout } from \"./apt-timeout.js\";\nimport { getApt } from \"./get-apt.js\";\nimport { initAptMemoized } from \"./init-apt.js\";\nimport { filterAndQualifyAptPackages } from \"./qualify-install.js\";\nimport { updateAptReposMemoized } from \"./update.js\";\nconst retryErrors = [\n \"E: Could not get lock\",\n \"dpkg: error processing archive\",\n \"dpkg: error: dpkg status database is locked by another process\",\n];\n/**\n * Install a package using apt\n *\n * @param packages The packages to install (name, and optional info like version and repositories)\n * @param update Whether to update the package list before installing (Defaults to `false`)\n *\n * @returns The installation information\n *\n * @example\n * ```ts\n * await installAptPack([{ name: \"ca-certificates\" }, { name: \"gnupg\" }])\n * ```\n *\n * @example\n * ```ts\n await installAptPack([\n {\n name: \"gcc\",\n version,\n repository: \"ppa:ubuntu-toolchain-r/test\",\n key: { key: \"1E9377A2BA9EF27F\", fileName: \"ubuntu-toolchain-r-test.gpg\" },\n },\n ])\n * ```\n */\nexport async function installAptPack(packages, update = false) {\n try {\n const apt = getApt();\n for (const { name, version } of packages) {\n info(`Installing ${name} ${version ?? \"\"} via ${apt}`);\n }\n // Update the repos if needed\n if (update) {\n updateAptReposMemoized(apt);\n }\n // Add the repos if needed\n await addRepositories(apt, packages);\n const needToInstall = await filterAndQualifyAptPackages(packages, apt);\n if (needToInstall.length === 0) {\n info(\"All packages are already installed\");\n return { binDir: \"/usr/bin/\" };\n }\n // Initialize apt if needed\n await initAptMemoized(apt);\n try {\n // Add the keys if needed\n await addAptKeys(packages);\n // Install\n execRootSync(apt, [\"install\", \"--fix-broken\", \"-y\", ...needToInstall], {\n ...defaultExecOptions,\n env: getAptEnv(apt),\n });\n }\n catch (err) {\n if (isExecaError(err)) {\n if (retryErrors.some((error) => typeof err.stderr === \"string\" && err.stderr.includes(error))) {\n warning(`Failed to install packages ${needToInstall}. Retrying...`);\n execRootSync(apt, [\"install\", \"--fix-broken\", \"-y\", \"-o\", aptTimeout, ...needToInstall], { ...defaultExecOptions, env: getAptEnv(apt) });\n }\n }\n else {\n throw err;\n }\n }\n return { binDir: \"/usr/bin/\" };\n }\n catch (err) {\n const msg = err instanceof Error ? `${err.message}\\n${err.stack}` : String(err);\n throw new Error(`Failed to install apt packages: ${msg}`);\n }\n}\nasync function addRepositories(apt, packages) {\n const allRepositories = [...new Set(packages.flatMap((pack) => pack.repository ?? []))];\n await Promise.all(allRepositories.map((repo) => addAptRepository(repo, apt)));\n}\nasync function addAptKeys(packages) {\n await Promise.all(packages.map(async (pack) => {\n if (pack.key !== undefined) {\n await addAptKey(pack.key);\n }\n }));\n}\nf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GFkZEFwdEtleXMocGFja2FnZXM6IEFwdFBhY2thZ2VbXSkge1xuICBhd2FpdCBQcm9taXNlLmFsbChwYWNrYWdlcy5tYXAoYXN5bmMgKHBhY2spID0+IHtcbiAgICBpZiAocGFjay5rZXkgIT09IHVuZGVmaW5lZCkge1xuICAgICAgYXdhaXQgYWRkQXB0S2V5KHBhY2sua2V5KVxuICAgIH1cbiAgfSkpXG59XG5cbmZ1bmN0aW9uIGlzRXhlY2FFcnJvcihlcnI6IHVua25vd24pOiBlcnIgaXMgRXhlY2FFcnJvciB7XG4gIHJldHVybiB0eXBlb2YgKGVyciBhcyBFeGVjYUVycm9yKS5zdGRlcnIgPT09IFwic3RyaW5nXCJcbn1cbiJdfQ==","import { defaultExecOptions, execRootSync } from \"admina\";\nimport { getAptEnv } from \"./apt-env.js\";\nimport { aptTimeout } from \"./apt-timeout.js\";\nimport { getApt } from \"./get-apt.js\";\nimport { initAptMemoized } from \"./init-apt.js\";\nimport { isAptPackInstalled } from \"./is-installed.js\";\nimport { updateAptReposMemoized } from \"./update.js\";\nexport async function addAptRepository(repo, apt = getApt()) {\n await initAptMemoized(apt);\n await installAddAptRepo(apt);\n execRootSync(\"add-apt-repository\", [\"-y\", \"--no-update\", repo], { ...defaultExecOptions, env: getAptEnv(apt) });\n // Update the repos\n updateAptReposMemoized.clear(); // ensure update is called\n updateAptReposMemoized(apt);\n}\nexport async function installAddAptRepo(apt) {\n if (await isAptPackInstalled(\"software-properties-common\")) {\n return;\n }\n execRootSync(apt, [\"install\", \"-y\", \"--fix-broken\", \"-o\", aptTimeout, \"software-properties-common\"], { ...defaultExecOptions, env: getAptEnv(apt) });\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXB0LXJlcG9zaXRvcnkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvYXB0LXJlcG9zaXRvcnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ik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i5kZWZhdWx0RXhlY09wdGlvbnMsIGVudjogZ2V0QXB0RW52KGFwdCkgfSlcblxuICAvLyBVcGRhdGUgdGhlIHJlcG9zXG4gIHVwZGF0ZUFwdFJlcG9zTWVtb2l6ZWQuY2xlYXIoKSAvLyBlbnN1cmUgdXBkYXRlIGlzIGNhbGxlZFxuICB1cGRhdGVBcHRSZXBvc01lbW9pemVkKGFwdClcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGluc3RhbGxBZGRBcHRSZXBvKGFwdDogc3RyaW5nKSB7XG4gIGlmIChhd2FpdCBpc0FwdFBhY2tJbnN0YWxsZWQoXCJzb2Z0d2FyZS1wcm9wZXJ0aWVzLWNvbW1vblwiKSkge1xuICAgIHJldHVyblxuICB9XG4gIGV4ZWNSb290U3luYyhcbiAgICBhcHQsXG4gICAgW1wiaW5zdGFsbFwiLCBcIi15XCIsIFwiLS1maXgtYnJva2VuXCIsIFwiLW9cIiwgYXB0VGltZW91dCwgXCJzb2Z0d2FyZS1wcm9wZXJ0aWVzLWNvbW1vblwiXSxcbiAgICB7IC4uLmRlZmF1bHRFeGVjT3B0aW9ucywgZW52OiBnZXRBcHRFbnYoYXB0KSB9LFxuICApXG59XG4iXX0=","import { tmpdir } from \"os\";\nimport { join } from \"path\";\nimport { execRoot, execRootSync } from \"admina\";\nimport { warning } from \"ci-log\";\nimport { DownloaderHelper } from \"node-downloader-helper\";\nimport { pathExists } from \"path-exists\";\nimport { installAptPack } from \"./install.js\";\n/**\n * Add an apt key\n * @param options The options for adding the key\n * @returns The file name of the key that was added or `undefined` if it failed\n *\n * @example\n * ```ts\n * await addAptKey({ key: \"3B4FE6ACC0B21F32\" fileName: \"bazel-archive-keyring.gpg\"})\n * ```\n *\n * @example\n * ```ts\n * await addAptKey({ keyUrl: \"https://bazel.build/bazel-release.pub.gpg\", fileName: \"bazel-archive-keyring.gpg\"})\n * ```\n */\nexport function addAptKey(options) {\n if (\"keyUrl\" in options) {\n return addAptKeyViaURL(options);\n }\n else {\n return addAptKeyViaServer(options);\n }\n}\nexport const defaultKeyStorePath = \"/etc/apt/trusted.gpg.d\";\nexport const defaultKeyServer = \"keyserver.ubuntu.com\";\n/**\n * Add an apt key via a keyserver\n * @returns The file name of the key that was added or `undefined` if it failed\n */\nexport async function addAptKeyViaServer({ key, keyServer = defaultKeyServer, fileName, keyStorePath = defaultKeyServer }) {\n try {\n assertGpgFileName(fileName);\n const filePath = join(keyStorePath, fileName);\n if (!(await pathExists(filePath))) {\n initGpg();\n await execRoot(\"gpg\", [\n \"--no-default-keyring\",\n \"--keyring\",\n `gnupg-ring:${filePath}`,\n \"--keyserver\",\n keyServer,\n \"--recv-keys\",\n key,\n ]);\n await execRoot(\"chmod\", [\"644\", filePath]);\n }\n return filePath;\n }\n catch (err) {\n warning(`Failed to add apt key via server ${keyServer}: ${err}`);\n return undefined;\n }\n}\n/**\n * Add an apt key via a download\n * @param options The options for adding the key\n * @returns The file name of the key that was added\n */\nexport async function addAptKeyViaURL({ keyUrl, fileName, keyStorePath = defaultKeyStorePath }) {\n try {\n assertGpgFileName(fileName);\n const filePath = join(keyStorePath, fileName);\n if (!(await pathExists(filePath))) {\n initGpg();\n await installAptPack([{ name: \"ca-certificates\" }]);\n const dlPath = join(tmpdir(), fileName);\n const dl = new DownloaderHelper(keyUrl, tmpdir(), { fileName });\n dl.on(\"error\", (err) => {\n throw new Error(`Failed to download ${keyUrl}: ${err}`);\n });\n await dl.start();\n execRootSync(\"gpg\", [\n \"--no-default-keyring\",\n \"--keyring\",\n `gnupg-ring:${filePath}`,\n \"--import\",\n dlPath,\n ]);\n execRootSync(\"chmod\", [\"644\", filePath]);\n }\n return filePath;\n }\n catch (err) {\n warning(`Failed to add apt key via download ${keyUrl}: ${err}`);\n return undefined;\n }\n}\nfunction initGpg() {\n execRootSync(\"gpg\", [\"-k\"]);\n}\nfunction assertGpgFileName(fileName) {\n if (!fileName.endsWith(\".gpg\")) {\n throw new Error(`Key file name must end with .gpg: ${file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bmN0aW9uIGFzc2VydEdwZ0ZpbGVOYW1lKGZpbGVOYW1lOiBzdHJpbmcpIHtcbiAgaWYgKCFmaWxlTmFtZS5lbmRzV2l0aChcIi5ncGdcIikpIHtcbiAgICB0aHJvdyBuZXcgRXJyb3IoYEtleSBmaWxlIG5hbWUgbXVzdCBlbmQgd2l0aCAuZ3BnOiAke2ZpbGVOYW1lfWApXG4gIH1cbn1cbiJdfQ==","import { tmpdir } from \"os\";\nimport { dirname, join } from \"path\";\nimport { addPath } from \"envosman\";\nimport { execaSync } from \"execa\";\nimport { DownloaderHelper } from \"node-downloader-helper\";\nimport { installAptPack } from \"setup-apt\";\nimport which from \"which\";\n/* eslint-disable require-atomic-updates */\nlet binDir;\nexport async function setupBrew(options = {}) {\n // brew is only available on darwin and linux\n if (![\"darwin\", \"linux\"].includes(process.platform)) {\n return undefined;\n }\n // check if the function has already been called\n if (typeof binDir === \"string\") {\n return { binDir };\n }\n // check if brew is already installed\n const maybeBinDir = await which(\"brew\", { nothrow: true });\n if (maybeBinDir !== null) {\n binDir = dirname(maybeBinDir);\n return { binDir };\n }\n // download the installation script\n await installAptPack([{ name: \"ca-certificates\" }]);\n const dl = new DownloaderHelper(\"https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh\", tmpdir(), {\n fileName: \"install-brew.sh\",\n });\n dl.on(\"error\", (err) => {\n throw new Error(`Failed to download the brew installer script: ${err}`);\n });\n await dl.start();\n // brew installation is not thread-safe\n execaSync(\"/bin/bash\", [dl.getDownloadPath()], {\n stdio: \"inherit\",\n env: {\n NONINTERACTIVE: \"1\",\n },\n });\n // add the bin directory to the PATH\n binDir = getBrewBinDir();\n await addPath(binDir, options.rcOptions);\n return { binDir };\n}\n/**\n * Get the path to the bin directory of brew\n * @returns {string} The path where brew binary is installed\n *\n * Based on the installation script from https://brew.sh\n */\nexport function getBrewBinDir() {\n return join(getBrewDir(), \"bin\");\n}\n/**\n * Get the path where brew is installed\n * @returns {string} The path where brew is installed\n *\n * Based on the installation script from https://brew.sh\n */\nexport function getBrewDir() {\n if (process.platform === \"darwin\") {\n if (process.arch === \"arm64\") {\n return \"/opt/homebrew\";\n }\n else {\n return \"/usr/local\";\n }\n }\n if (process.platform === \"linux\") {\n return \"/home/linuxbrew/.linuxbrew\";\n }\n throw new Error(\"Unsupported platform for brew\");\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5zdGFsbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9pbnN0YWxsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSxJQUFJLENBQUE7QUFDM0IsT0FBTyxFQUFFLE9BQU8sRUFBRSxJQUFJLEVBQUUsTUFBTSxNQUFNLENBQUE7QUFDcEMsT0FBTyxFQUF1QixPQUFPLEVBQUUsTUFBTSxVQUFVLENBQUE7QUFDdkQsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLE9BQU8sQ0FBQTtBQUNqQyxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQTtBQUN6RCxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sV0FBVyxDQUFBO0FBQzFDLE9BQU8sS0FBSyxNQUFNLE9BQU8sQ0FBQTtBQUd6QiwyQ0FBMkM7QUFDM0MsSUFBSSxNQUEwQixDQUFBO0FBYTlCLE1BQU0sQ0FBQyxLQUFLLFVBQVUsU0FBUyxDQUFDLFVBQTRCLEVBQUU7SUFDNUQsNkNBQTZDO0lBQzdDLElBQUksQ0FBQyxDQUFDLFFBQVEsRUFBRSxPQUFPLENBQUMsQ0FBQyxRQUFRLENBQUMsT0FBTyxDQUFDLFFBQVEsQ0FBQyxFQUFFLENBQUM7UUFDcEQsT0FBTyxTQUFTLENBQUE7SUFDbEIsQ0FBQztJQUVELGdEQUFnRDtJQUNoRCx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iKSB7XG4gICAgaWYgKHByb2Nlc3MuYXJjaCA9PT0gXCJhcm02NFwiKSB7XG4gICAgICByZXR1cm4gXCIvb3B0L2hvbWVicmV3XCJcbiAgICB9IGVsc2Uge1xuICAgICAgcmV0dXJuIFwiL3Vzci9sb2NhbFwiXG4gICAgfVxuICB9XG5cbiAgaWYgKHByb2Nlc3MucGxhdGZvcm0gPT09IFwibGludXhcIikge1xuICAgIHJldHVybiBcIi9ob21lL2xpbnV4YnJldy8ubGludXhicmV3XCJcbiAgfVxuXG4gIHRocm93IG5ldyBFcnJvcihcIlVuc3VwcG9ydGVkIHBsYXRmb3JtIGZvciBicmV3XCIpXG59XG4iXX0=","import { join } from \"path\";\nimport { info } from \"ci-log\";\nimport { execaSync } from \"execa\";\nimport which from \"which\";\nimport { getBrewBinDir, setupBrew } from \"./install.js\";\n/* eslint-disable require-atomic-updates */\nlet hasBrew = false;\n/** A function that installs a package using brew\n *\n * @param name The name of the package\n * @param version The version of the package (optional)\n * @param options The options for installing the package\n *\n * @returns The installation information\n */\nexport async function installBrewPack(name, version, givenOptions = {}) {\n const options = {\n overwrite: true,\n cask: false,\n args: [],\n ...givenOptions,\n };\n info(`Installing ${name} ${version ?? \"\"} via brew`);\n if (!hasBrew || which.sync(\"brew\", { nothrow: true }) === null) {\n await setupBrew();\n hasBrew = true;\n }\n const binDir = getBrewBinDir();\n const brewPath = join(binDir, \"brew\");\n // Args\n const args = [\n \"install\",\n (version !== undefined && version !== \"\") ? `${name}@${version}` : name,\n ];\n if (options.overwrite) {\n args.push(\"--overwrite\");\n }\n if (options.cask) {\n args.push(\"--cask\");\n }\n // brew is not thread-safe\n execaSync(brewPath, args, { stdio: \"inherit\" });\n return { binDir };\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5zdGFsbC1wYWNrLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2luc3RhbGwtcGFjay50cyJdLCJu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xuXG4gIGlmICghaGFzQnJldyB8fCB3aGljaC5zeW5jKFwiYnJld1wiLCB7IG5vdGhyb3c6IHRydWUgfSkgPT09IG51bGwpIHtcbiAgICBhd2FpdCBzZXR1cEJyZXcoKVxuICAgIGhhc0JyZXcgPSB0cnVlXG4gIH1cblxuICBjb25zdCBiaW5EaXIgPSBnZXRCcmV3QmluRGlyKClcbiAgY29uc3QgYnJld1BhdGggPSBqb2luKGJpbkRpciwgXCJicmV3XCIpXG5cbiAgLy8gQXJnc1xuICBjb25zdCBhcmdzID0gW1xuICAgIFwiaW5zdGFsbFwiLFxuICAgICh2ZXJzaW9uICE9PSB1bmRlZmluZWQgJiYgdmVyc2lvbiAhPT0gXCJcIikgPyBgJHtuYW1lfUAke3ZlcnNpb259YCA6IG5hbWUsXG4gIF1cbiAgaWYgKG9wdGlvbnMub3ZlcndyaXRlKSB7XG4gICAgYXJncy5wdXNoKFwiLS1vdmVyd3JpdGVcIilcbiAgfVxuICBpZiAob3B0aW9ucy5jYXNrKSB7XG4gICAgYXJncy5wdXNoKFwiLS1jYXNrXCIpXG4gIH1cblxuICAvLyBicmV3IGlzIG5vdCB0aHJlYWQtc2FmZVxuICBleGVjYVN5bmMoYnJld1BhdGgsIGFyZ3MsIHsgc3RkaW86IFwiaW5oZXJpdFwiIH0pXG5cbiAgcmV0dXJuIHsgYmluRGlyIH1cbn1cbiJdfQ==","import which from \"which\"\n\nlet hasDnfCache: undefined | boolean = undefined\n\nexport function hasDnf(): boolean {\n if (process.platform !== \"linux\") {\n return false\n }\n if (hasDnfCache === undefined) {\n hasDnfCache = which.sync(\"dnf\", { nothrow: true }) !== null\n }\n\n return hasDnfCache\n}\n","import which from \"which\"\n\nlet isArchCache: undefined | boolean = undefined\n\nexport function isArch(): boolean {\n if (process.platform !== \"linux\") {\n return false\n }\n if (isArchCache === undefined) {\n // detect arch by checking if pacman exists\n isArchCache = which.sync(\"pacman\", { nothrow: true }) !== null\n }\n\n return isArchCache\n}\n","import which from \"which\"\n\nlet isUbuntuCache: undefined | boolean = undefined\n\nexport function isUbuntu(): boolean {\n if (process.platform !== \"linux\") {\n return false\n }\n if (isUbuntuCache === undefined) {\n const apt = \"apt-get\"\n isUbuntuCache = which.sync(apt, { nothrow: true }) !== null\n }\n\n return isUbuntuCache\n}\n","import { dirname } from \"path\"\nimport { addPath } from \"envosman\"\nimport { execaSync } from \"execa\"\nimport { pathExists } from \"path-exists\"\nimport which from \"which\"\nimport { rcOptions } from \"../cli-options.js\"\nimport type { InstallationInfo } from \"../utils/setup/setupBin.js\"\n\n/* eslint-disable require-atomic-updates */\nlet binDir: string | undefined\n\nexport async function setupChocolatey(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _version: string,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _setupDir: string,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _arch: string,\n): Promise {\n if (process.platform !== \"win32\") {\n return undefined\n }\n\n if (typeof binDir === \"string\") {\n return { binDir }\n }\n\n const maybeBinDir = which.sync(\"choco\", { nothrow: true })\n if (maybeBinDir !== null) {\n binDir = dirname(maybeBinDir)\n return { binDir }\n }\n\n let powershell = \"powershell.exe\"\n const maybePowerShell = which.sync(`${process.env.SystemRoot}\\\\System32\\\\WindowsPowerShell\\\\v1.0\\\\powershell.exe`, {\n nothrow: true,\n })\n if (maybePowerShell !== null) {\n powershell = maybePowerShell\n }\n\n // https://docs.chocolatey.org/en-us/choco/setup#install-with-cmd.exe\n execaSync(\n powershell,\n [\n \"-NoProfile\",\n \"-InputFormat\",\n \"None\",\n \"-ExecutionPolicy\",\n \"Bypass\",\n \"-Command\",\n \"[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))\",\n ],\n { stdio: \"inherit\" },\n )\n\n const chocoPath = `${process.env.ALLUSERSPROFILE}\\\\chocolatey\\\\bin`\n await addPath(chocoPath, rcOptions)\n\n const maybeChoco = which.sync(\"choco\", { nothrow: true })\n if (maybeChoco !== null) {\n binDir = dirname(maybeChoco)\n } else {\n binDir = `${process.env.ChocolateyInstall ?? \"C:/ProgramData/chocolatey\"}/bin`\n }\n\n if (await pathExists(binDir)) {\n return { binDir }\n }\n return undefined\n}\n","/* eslint-disable require-atomic-updates */\nimport { info } from \"ci-log\"\nimport { addPath } from \"envosman\"\nimport { execaSync } from \"execa\"\nimport which from \"which\"\nimport { setupChocolatey } from \"../../chocolatey/chocolatey.js\"\nimport { rcOptions } from \"../../cli-options.js\"\nimport type { InstallationInfo } from \"./setupBin.js\"\n\nlet hasChoco = false\n\n/** A function that installs a package using choco */\nexport async function setupChocoPack(name: string, version?: string, args: string[] = []): Promise {\n info(`Installing ${name} ${version ?? \"\"} via chocolatey`)\n\n if (!hasChoco || which.sync(\"choco\", { nothrow: true }) === null) {\n await setupChocolatey(\"\", \"\", process.arch)\n hasChoco = true\n }\n\n // https://github.com/jberezanski/ChocolateyPackages/issues/97#issuecomment-986825694\n const PATH = process.env.PATH\n const env = { ...process.env }\n env.TMP = undefined\n env.TEMP = undefined\n env.Path = undefined\n env.PATH = PATH\n\n if (version !== undefined && version !== \"\") {\n execaSync(\"choco\", [\"install\", \"-y\", name, `--version=${version}`, ...args], {\n env,\n extendEnv: false,\n stdio: \"inherit\",\n })\n } else {\n try {\n execaSync(\"choco\", [\"install\", \"-y\", name, ...args], { env, extendEnv: false, stdio: \"inherit\" })\n } catch (err) {\n // if the package requires a reboot, downgrade the error to a notice\n if ((err as Error).message.includes(\"exit code 3010\")) {\n info(`${name} might require a reboot for the completion of the installation.`)\n } else {\n throw err\n }\n }\n }\n\n const binDir = `${process.env.ChocolateyInstall ?? \"C:/ProgramData/chocolatey\"}/bin`\n await addPath(binDir, rcOptions)\n\n return { binDir }\n}\n","import { execRootSync } from \"admina\"\nimport { info, warning } from \"ci-log\"\nimport { execa } from \"execa\"\nimport type { InstallationInfo } from \"./setupBin.js\"\n\ntype DnfPackage = {\n name: string\n version?: string\n}\n\n/** A function that installs a package using dnf */\nexport async function setupDnfPack(packages: DnfPackage[]): Promise {\n for (const { name, version } of packages) {\n info(`Installing ${name} ${version ?? \"\"} via dnf`)\n }\n\n const dnfArgs = await Promise.all(packages.map((pack) => getDnfArg(pack.name, pack.version)))\n execRootSync(\"dnf\", [\"-y\", \"install\", ...dnfArgs])\n\n return { binDir: \"/usr/bin/\" }\n}\n\nasync function getDnfArg(name: string, version: string | undefined) {\n if (version !== undefined && version !== \"\") {\n // check if name-version is available\n const { stdout } = await execa(\"dnf\", [\"search\", \"-q\", `${name}-${version}`])\n\n if (stdout.trim() !== \"\") {\n return `${name}-${version}`\n } else {\n // try with ${name}${version}\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const { stdout } = await execa(\"dnf\", [\"search\", \"-q\", `${name}${version}`])\n if (stdout.trim() !== \"\") {\n return `${name}${version}`\n }\n\n warning(`Failed to install ${name} ${version} via dnf, trying without version`)\n }\n }\n return name\n}\n","import { tmpdir } from \"os\"\nimport { join } from \"path\"\nimport { execRootSync, isRoot } from \"admina\"\nimport { info, warning } from \"ci-log\"\nimport { execa, execaSync } from \"execa\"\nimport which from \"which\"\nimport type { InstallationInfo } from \"./setupBin.js\"\n\n/* eslint-disable require-atomic-updates */\nlet didUpdate: boolean = false\nlet didInit: boolean = false\n\n/** A function that installs a package using pacman */\nexport async function setupPacmanPack(name: string, version?: string, aur?: string): Promise {\n info(`Installing ${name} ${version ?? \"\"} via pacman`)\n\n const pacman = \"pacman\"\n\n if (aur === \"yay\") {\n setupYay()\n }\n\n // yay can't run as root, so skip update\n if (!didUpdate && aur !== \"yay\") {\n execRootSync(pacman, [\"-Sy\", \"--noconfirm\"])\n didUpdate = true\n }\n\n // install base-devel\n if (!didInit && aur !== \"yay\") {\n execRootSync(pacman, [\"-S\", \"--noconfirm\", \"base-devel\"])\n didInit = true\n }\n\n const runInstall = (arg: string) => {\n if (aur === \"yay\") {\n // run yay as non-root to fix ERROR: Running makepkg as root is not allowed as it can cause permanent, catastrophic damage to your system.\n if (isRoot() && createdBuilderUser) {\n // Run yay as builder user\n return execRootSync(\"su\", [\"-\", \"builder\", \"-c\", `yay -S --noconfirm ${arg}`])\n } else {\n return execaSync(aur, [\"-S\", \"--noconfirm\", arg])\n }\n }\n return execRootSync(aur ?? pacman, [\"-S\", \"--noconfirm\", arg])\n }\n\n if (version !== undefined && version !== \"\") {\n // check if version is available\n const availableVersions = await availablePacmanVersions(pacman, name)\n if (availableVersions.includes(version)) {\n // try different version formats\n try {\n runInstall(`${name}=${version}`)\n } catch {\n runInstall(`${name}${version}`)\n }\n } else {\n // try without version\n info(`Failed to install ${name} ${version} via pacman, trying without version`)\n runInstall(name)\n }\n } else {\n // version not specified, install latest\n runInstall(name)\n }\n\n return { binDir: \"/usr/bin/\" }\n}\n\nconst pacmanSiVersionRegex = /Version\\s*:\\s*(.*)/g\n\n/** Query pacman for available versions */\nasync function availablePacmanVersions(pacman: string, name: string) {\n const availableVersions = []\n try {\n const { stdout } = await execa(pacman, [\"-Si\", name])\n\n for (const match of stdout.matchAll(pacmanSiVersionRegex)) {\n availableVersions.push(match[1])\n }\n } catch (err) {\n warning(`Failed to get available versions for ${name}: ${err}`)\n }\n return availableVersions\n}\n\nlet createdBuilderUser = false\n\nfunction setupYay() {\n if (which.sync(\"yay\", { nothrow: true }) === null) {\n try {\n // Install prerequisites\n execRootSync(\"pacman\", [\"-S\", \"--noconfirm\", \"base-devel\", \"git\"])\n\n const yayBuildDir = join(tmpdir(), \"yay\")\n\n execRootSync(\"mkdir\", [\"-p\", yayBuildDir])\n\n if (isRoot()) {\n // Create a non-root user to build yay\n warning(\"Creating a non-root user to build yay\")\n execRootSync(\"useradd\", [\"-m\", \"-G\", \"wheel\", \"builder\"])\n execRootSync(\"passwd\", [\"-d\", \"builder\"])\n execRootSync(\"chown\", [\"-R\", \"builder:builder\", yayBuildDir])\n execRootSync(\"bash\", [\"-c\", `echo \"builder ALL=(ALL) NOPASSWD: ALL\" >> /etc/sudoers`])\n createdBuilderUser = true\n\n // Clone the yay repository into a temporary directory\n execaSync(\"su\", [\"-\", \"builder\", \"-c\", `git clone https://aur.archlinux.org/yay.git ${yayBuildDir}`], {\n stdio: \"inherit\",\n })\n\n execaSync(\"su\", [\"-\", \"builder\", \"-c\", `cd ${yayBuildDir} && makepkg -si --noconfirm`], {\n stdio: \"inherit\",\n })\n } else {\n // Clone the yay repository into a temporary directory\n execaSync(\"git\", [\"clone\", \"https://aur.archlinux.org/yay.git\", yayBuildDir], {\n stdio: \"inherit\",\n cwd: tmpdir(),\n })\n\n // Build and install yay\n execaSync(\"makepkg\", [\"-si\", \"--noconfirm\"], {\n stdio: \"inherit\",\n cwd: yayBuildDir,\n })\n }\n\n // clean-up\n execaSync(\"rm\", [\"-rf\", yayBuildDir], { stdio: \"inherit\" })\n } catch (error) {\n throw new Error(`Failed to install yay: ${error}. Install yay manually and re-run the script.`)\n }\n }\n}\n","function e(e,a){return Object.keys(a).forEach((r=>{\"default\"===r||\"__esModule\"===r||e.hasOwnProperty(r)||Object.defineProperty(e,r,{enumerable:!0,get(){return a[r]}})})),e}function a(e,a,r,s){Object.defineProperty(e,a,{get:r,set:s,enumerable:!0,configurable:!0})}function r(e,a=!0){return a?u(e):u(e,x(e))}function s(e){return E(e).replace(RegExp(y(N)+\"$\"),\"\")}function t(e,a=\".exe\",r=\"\"){return\"win32\"===process.platform?`${e}${a}`:`${e}${r}`}function n(e,a){const r=x(e),s=`${a}${u(e,r)}${r}`;return h(l(e),s)}function i(e,a){const r=x(e),s=`${u(e,r)}${a}${r}`;return h(l(e),s)}function o(e,a=\".cmd\",r=\".sh\"){return\"win32\"===process.platform?`${e}${a}`:`${e}${r}`}function m(e){return\"win32\"===process.platform?e:\"./\"+e}function c(e){const a=x(e).length;return e.slice(0,-a)}function d(e,a){return z(e,a)}function f(e,a){const r=g(a,e);return!(!r||\"..\"===r||r.startsWith(\"..\"+N)||r===w(e))}import{basename as u,delimiter as p,dirname as l,extname as x,format as v,isAbsolute as $,join as h,normalize as E,parse as P,posix as b,relative as g,resolve as w,sep as N,toNamespacedPath as S,win32 as j}from\"path\";import y from\"escape-string-regexp\";import z from\"replace-ext\";var O={},R={};a(R,\"name\",(()=>r));var A={};a(A,\"normalizeTrim\",(()=>s));var I={};a(I,\"addExeExt\",(()=>t));var T={};a(T,\"addNamePrefix\",(()=>n));var _={};a(_,\"addNameSuffix\",(()=>i));var k={};a(k,\"addShExt\",(()=>o));var M={};a(M,\"addShRelativePrefix\",(()=>m));var W={};a(W,\"removeExt\",(()=>c));var q={};a(q,\"replaceExt\",(()=>d));var B={};a(B,\"isPathInside\",(()=>f)),e(O,R),e(O,A),e(O,I),e(O,T),e(O,_),e(O,k),e(O,M),e(O,W),e(O,q),e(O,B);export{u as basename,p as delimiter,l as dirname,x as extname,v as format,$ as isAbsolute,h as join,E as normalize,P as parse,b as posix,g as relative,w as resolve,N as sep,S as toNamespacedPath,j as win32,r as name,s as normalizeTrim,t as addExeExt,n as addNamePrefix,i as addNameSuffix,o as addShExt,m as addShRelativePrefix,c as removeExt,d as replaceExt,f as isPathInside};\n//# sourceMappingURL=index.node.mjs.map\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0;\nconst assert_1 = require(\"assert\");\nconst path = __importStar(require(\"path\"));\nconst ioUtil = __importStar(require(\"./io-util\"));\n/**\n * Copies a file or folder.\n * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js\n *\n * @param source source path\n * @param dest destination path\n * @param options optional. See CopyOptions.\n */\nfunction cp(source, dest, options = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const { force, recursive, copySourceDirectory } = readCopyOptions(options);\n const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;\n // Dest is an existing file, but not forcing\n if (destStat && destStat.isFile() && !force) {\n return;\n }\n // If dest is an existing directory, should copy inside.\n const newDest = destStat && destStat.isDirectory() && copySourceDirectory\n ? path.join(dest, path.basename(source))\n : dest;\n if (!(yield ioUtil.exists(source))) {\n throw new Error(`no such file or directory: ${source}`);\n }\n const sourceStat = yield ioUtil.stat(source);\n if (sourceStat.isDirectory()) {\n if (!recursive) {\n throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);\n }\n else {\n yield cpDirRecursive(source, newDest, 0, force);\n }\n }\n else {\n if (path.relative(source, newDest) === '') {\n // a file cannot be copied to itself\n throw new Error(`'${newDest}' and '${source}' are the same file`);\n }\n yield copyFile(source, newDest, force);\n }\n });\n}\nexports.cp = cp;\n/**\n * Moves a path.\n *\n * @param source source path\n * @param dest destination path\n * @param options optional. See MoveOptions.\n */\nfunction mv(source, dest, options = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n if (yield ioUtil.exists(dest)) {\n let destExists = true;\n if (yield ioUtil.isDirectory(dest)) {\n // If dest is directory copy src into dest\n dest = path.join(dest, path.basename(source));\n destExists = yield ioUtil.exists(dest);\n }\n if (destExists) {\n if (options.force == null || options.force) {\n yield rmRF(dest);\n }\n else {\n throw new Error('Destination already exists');\n }\n }\n }\n yield mkdirP(path.dirname(dest));\n yield ioUtil.rename(source, dest);\n });\n}\nexports.mv = mv;\n/**\n * Remove a path recursively with force\n *\n * @param inputPath path to remove\n */\nfunction rmRF(inputPath) {\n return __awaiter(this, void 0, void 0, function* () {\n if (ioUtil.IS_WINDOWS) {\n // Check for invalid characters\n // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file\n if (/[*\"<>|]/.test(inputPath)) {\n throw new Error('File path must not contain `*`, `\"`, `<`, `>` or `|` on Windows');\n }\n }\n try {\n // note if path does not exist, error is silent\n yield ioUtil.rm(inputPath, {\n force: true,\n maxRetries: 3,\n recursive: true,\n retryDelay: 300\n });\n }\n catch (err) {\n throw new Error(`File was unable to be removed ${err}`);\n }\n });\n}\nexports.rmRF = rmRF;\n/**\n * Make a directory. Creates the full path with folders in between\n * Will throw if it fails\n *\n * @param fsPath path to create\n * @returns Promise\n */\nfunction mkdirP(fsPath) {\n return __awaiter(this, void 0, void 0, function* () {\n assert_1.ok(fsPath, 'a path argument must be provided');\n yield ioUtil.mkdir(fsPath, { recursive: true });\n });\n}\nexports.mkdirP = mkdirP;\n/**\n * Returns path of a tool had the tool actually been invoked. Resolves via paths.\n * If you check and the tool does not exist, it will throw.\n *\n * @param tool name of the tool\n * @param check whether to check if tool exists\n * @returns Promise path to tool\n */\nfunction which(tool, check) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!tool) {\n throw new Error(\"parameter 'tool' is required\");\n }\n // recursive when check=true\n if (check) {\n const result = yield which(tool, false);\n if (!result) {\n if (ioUtil.IS_WINDOWS) {\n throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`);\n }\n else {\n throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);\n }\n }\n return result;\n }\n const matches = yield findInPath(tool);\n if (matches && matches.length > 0) {\n return matches[0];\n }\n return '';\n });\n}\nexports.which = which;\n/**\n * Returns a list of all occurrences of the given tool on the system path.\n *\n * @returns Promise the paths of the tool\n */\nfunction findInPath(tool) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!tool) {\n throw new Error(\"parameter 'tool' is required\");\n }\n // build the list of extensions to try\n const extensions = [];\n if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) {\n for (const extension of process.env['PATHEXT'].split(path.delimiter)) {\n if (extension) {\n extensions.push(extension);\n }\n }\n }\n // if it's rooted, return it if exists. otherwise return empty.\n if (ioUtil.isRooted(tool)) {\n const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);\n if (filePath) {\n return [filePath];\n }\n return [];\n }\n // if any path separators, return empty\n if (tool.includes(path.sep)) {\n return [];\n }\n // build the list of directories\n //\n // Note, technically \"where\" checks the current directory on Windows. From a toolkit perspective,\n // it feels like we should not do this. Checking the current directory seems like more of a use\n // case of a shell, and the which() function exposed by the toolkit should strive for consistency\n // across platforms.\n const directories = [];\n if (process.env.PATH) {\n for (const p of process.env.PATH.split(path.delimiter)) {\n if (p) {\n directories.push(p);\n }\n }\n }\n // find all matches\n const matches = [];\n for (const directory of directories) {\n const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions);\n if (filePath) {\n matches.push(filePath);\n }\n }\n return matches;\n });\n}\nexports.findInPath = findInPath;\nfunction readCopyOptions(options) {\n const force = options.force == null ? true : options.force;\n const recursive = Boolean(options.recursive);\n const copySourceDirectory = options.copySourceDirectory == null\n ? true\n : Boolean(options.copySourceDirectory);\n return { force, recursive, copySourceDirectory };\n}\nfunction cpDirRecursive(sourceDir, destDir, currentDepth, force) {\n return __awaiter(this, void 0, void 0, function* () {\n // Ensure there is not a run away recursive copy\n if (currentDepth >= 255)\n return;\n currentDepth++;\n yield mkdirP(destDir);\n const files = yield ioUtil.readdir(sourceDir);\n for (const fileName of files) {\n const srcFile = `${sourceDir}/${fileName}`;\n const destFile = `${destDir}/${fileName}`;\n const srcFileStat = yield ioUtil.lstat(srcFile);\n if (srcFileStat.isDirectory()) {\n // Recurse\n yield cpDirRecursive(srcFile, destFile, currentDepth, force);\n }\n else {\n yield copyFile(srcFile, destFile, force);\n }\n }\n // Change the mode for the newly created directory\n yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);\n });\n}\n// Buffered file copy\nfunction copyFile(srcFile, destFile, force) {\n return __awaiter(this, void 0, void 0, function* () {\n if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {\n // unlink/re-link it\n try {\n yield ioUtil.lstat(destFile);\n yield ioUtil.unlink(destFile);\n }\n catch (e) {\n // Try to override file permission\n if (e.code === 'EPERM') {\n yield ioUtil.chmod(destFile, '0666');\n yield ioUtil.unlink(destFile);\n }\n // other errors = it doesn't exist, no work to do\n }\n // Copy over symlink\n const symlinkFull = yield ioUtil.readlink(srcFile);\n yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);\n }\n else if (!(yield ioUtil.exists(destFile)) || force) {\n yield ioUtil.copyFile(srcFile, destFile);\n }\n });\n}\n//# sourceMappingURL=io.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getExecOutput = exports.exec = void 0;\nconst string_decoder_1 = require(\"string_decoder\");\nconst tr = __importStar(require(\"./toolrunner\"));\n/**\n * Exec a command.\n * Output will be streamed to the live console.\n * Returns promise with return code\n *\n * @param commandLine command to execute (can include additional args). Must be correctly escaped.\n * @param args optional arguments for tool. Escaping is handled by the lib.\n * @param options optional exec options. See ExecOptions\n * @returns Promise exit code\n */\nfunction exec(commandLine, args, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const commandArgs = tr.argStringToArray(commandLine);\n if (commandArgs.length === 0) {\n throw new Error(`Parameter 'commandLine' cannot be null or empty.`);\n }\n // Path to tool to execute should be first arg\n const toolPath = commandArgs[0];\n args = commandArgs.slice(1).concat(args || []);\n const runner = new tr.ToolRunner(toolPath, args, options);\n return runner.exec();\n });\n}\nexports.exec = exec;\n/**\n * Exec a command and get the output.\n * Output will be streamed to the live console.\n * Returns promise with the exit code and collected stdout and stderr\n *\n * @param commandLine command to execute (can include additional args). Must be correctly escaped.\n * @param args optional arguments for tool. Escaping is handled by the lib.\n * @param options optional exec options. See ExecOptions\n * @returns Promise exit code, stdout, and stderr\n */\nfunction getExecOutput(commandLine, args, options) {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function* () {\n let stdout = '';\n let stderr = '';\n //Using string decoder covers the case where a mult-byte character is split\n const stdoutDecoder = new string_decoder_1.StringDecoder('utf8');\n const stderrDecoder = new string_decoder_1.StringDecoder('utf8');\n const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout;\n const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr;\n const stdErrListener = (data) => {\n stderr += stderrDecoder.write(data);\n if (originalStdErrListener) {\n originalStdErrListener(data);\n }\n };\n const stdOutListener = (data) => {\n stdout += stdoutDecoder.write(data);\n if (originalStdoutListener) {\n originalStdoutListener(data);\n }\n };\n const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener });\n const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners }));\n //flush any remaining characters\n stdout += stdoutDecoder.end();\n stderr += stderrDecoder.end();\n return {\n exitCode,\n stdout,\n stderr\n };\n });\n}\nexports.getExecOutput = getExecOutput;\n//# sourceMappingURL=exec.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.evaluateVersions = exports.isExplicitVersion = exports.findFromManifest = exports.getManifestFromRepo = exports.findAllVersions = exports.find = exports.cacheFile = exports.cacheDir = exports.extractZip = exports.extractXar = exports.extractTar = exports.extract7z = exports.downloadTool = exports.HTTPError = void 0;\nconst core = __importStar(require(\"@actions/core\"));\nconst io = __importStar(require(\"@actions/io\"));\nconst fs = __importStar(require(\"fs\"));\nconst mm = __importStar(require(\"./manifest\"));\nconst os = __importStar(require(\"os\"));\nconst path = __importStar(require(\"path\"));\nconst httpm = __importStar(require(\"@actions/http-client\"));\nconst semver = __importStar(require(\"semver\"));\nconst stream = __importStar(require(\"stream\"));\nconst util = __importStar(require(\"util\"));\nconst assert_1 = require(\"assert\");\nconst v4_1 = __importDefault(require(\"uuid/v4\"));\nconst exec_1 = require(\"@actions/exec/lib/exec\");\nconst retry_helper_1 = require(\"./retry-helper\");\nclass HTTPError extends Error {\n constructor(httpStatusCode) {\n super(`Unexpected HTTP response: ${httpStatusCode}`);\n this.httpStatusCode = httpStatusCode;\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\nexports.HTTPError = HTTPError;\nconst IS_WINDOWS = process.platform === 'win32';\nconst IS_MAC = process.platform === 'darwin';\nconst userAgent = 'actions/tool-cache';\n/**\n * Download a tool from an url and stream it into a file\n *\n * @param url url of tool to download\n * @param dest path to download tool\n * @param auth authorization header\n * @param headers other headers\n * @returns path to downloaded tool\n */\nfunction downloadTool(url, dest, auth, headers) {\n return __awaiter(this, void 0, void 0, function* () {\n dest = dest || path.join(_getTempDirectory(), v4_1.default());\n yield io.mkdirP(path.dirname(dest));\n core.debug(`Downloading ${url}`);\n core.debug(`Destination ${dest}`);\n const maxAttempts = 3;\n const minSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS', 10);\n const maxSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS', 20);\n const retryHelper = new retry_helper_1.RetryHelper(maxAttempts, minSeconds, maxSeconds);\n return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {\n return yield downloadToolAttempt(url, dest || '', auth, headers);\n }), (err) => {\n if (err instanceof HTTPError && err.httpStatusCode) {\n // Don't retry anything less than 500, except 408 Request Timeout and 429 Too Many Requests\n if (err.httpStatusCode < 500 &&\n err.httpStatusCode !== 408 &&\n err.httpStatusCode !== 429) {\n return false;\n }\n }\n // Otherwise retry\n return true;\n });\n });\n}\nexports.downloadTool = downloadTool;\nfunction downloadToolAttempt(url, dest, auth, headers) {\n return __awaiter(this, void 0, void 0, function* () {\n if (fs.existsSync(dest)) {\n throw new Error(`Destination file path ${dest} already exists`);\n }\n // Get the response headers\n const http = new httpm.HttpClient(userAgent, [], {\n allowRetries: false\n });\n if (auth) {\n core.debug('set auth');\n if (headers === undefined) {\n headers = {};\n }\n headers.authorization = auth;\n }\n const response = yield http.get(url, headers);\n if (response.message.statusCode !== 200) {\n const err = new HTTPError(response.message.statusCode);\n core.debug(`Failed to download from \"${url}\". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);\n throw err;\n }\n // Download the response body\n const pipeline = util.promisify(stream.pipeline);\n const responseMessageFactory = _getGlobal('TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY', () => response.message);\n const readStream = responseMessageFactory();\n let succeeded = false;\n try {\n yield pipeline(readStream, fs.createWriteStream(dest));\n core.debug('download complete');\n succeeded = true;\n return dest;\n }\n finally {\n // Error, delete dest before retry\n if (!succeeded) {\n core.debug('download failed');\n try {\n yield io.rmRF(dest);\n }\n catch (err) {\n core.debug(`Failed to delete '${dest}'. ${err.message}`);\n }\n }\n }\n });\n}\n/**\n * Extract a .7z file\n *\n * @param file path to the .7z file\n * @param dest destination directory. Optional.\n * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this\n * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will\n * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is\n * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line\n * interface, it is smaller than the full command line interface, and it does support long paths. At the\n * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.\n * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path\n * to 7zr.exe can be pass to this function.\n * @returns path to the destination directory\n */\nfunction extract7z(file, dest, _7zPath) {\n return __awaiter(this, void 0, void 0, function* () {\n assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');\n assert_1.ok(file, 'parameter \"file\" is required');\n dest = yield _createExtractFolder(dest);\n const originalCwd = process.cwd();\n process.chdir(dest);\n if (_7zPath) {\n try {\n const logLevel = core.isDebug() ? '-bb1' : '-bb0';\n const args = [\n 'x',\n logLevel,\n '-bd',\n '-sccUTF-8',\n file\n ];\n const options = {\n silent: true\n };\n yield exec_1.exec(`\"${_7zPath}\"`, args, options);\n }\n finally {\n process.chdir(originalCwd);\n }\n }\n else {\n const escapedScript = path\n .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')\n .replace(/'/g, \"''\")\n .replace(/\"|\\n|\\r/g, ''); // double-up single quotes, remove double quotes and newlines\n const escapedFile = file.replace(/'/g, \"''\").replace(/\"|\\n|\\r/g, '');\n const escapedTarget = dest.replace(/'/g, \"''\").replace(/\"|\\n|\\r/g, '');\n const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;\n const args = [\n '-NoLogo',\n '-Sta',\n '-NoProfile',\n '-NonInteractive',\n '-ExecutionPolicy',\n 'Unrestricted',\n '-Command',\n command\n ];\n const options = {\n silent: true\n };\n try {\n const powershellPath = yield io.which('powershell', true);\n yield exec_1.exec(`\"${powershellPath}\"`, args, options);\n }\n finally {\n process.chdir(originalCwd);\n }\n }\n return dest;\n });\n}\nexports.extract7z = extract7z;\n/**\n * Extract a compressed tar archive\n *\n * @param file path to the tar\n * @param dest destination directory. Optional.\n * @param flags flags for the tar command to use for extraction. Defaults to 'xz' (extracting gzipped tars). Optional.\n * @returns path to the destination directory\n */\nfunction extractTar(file, dest, flags = 'xz') {\n return __awaiter(this, void 0, void 0, function* () {\n if (!file) {\n throw new Error(\"parameter 'file' is required\");\n }\n // Create dest\n dest = yield _createExtractFolder(dest);\n // Determine whether GNU tar\n core.debug('Checking tar --version');\n let versionOutput = '';\n yield exec_1.exec('tar --version', [], {\n ignoreReturnCode: true,\n silent: true,\n listeners: {\n stdout: (data) => (versionOutput += data.toString()),\n stderr: (data) => (versionOutput += data.toString())\n }\n });\n core.debug(versionOutput.trim());\n const isGnuTar = versionOutput.toUpperCase().includes('GNU TAR');\n // Initialize args\n let args;\n if (flags instanceof Array) {\n args = flags;\n }\n else {\n args = [flags];\n }\n if (core.isDebug() && !flags.includes('v')) {\n args.push('-v');\n }\n let destArg = dest;\n let fileArg = file;\n if (IS_WINDOWS && isGnuTar) {\n args.push('--force-local');\n destArg = dest.replace(/\\\\/g, '/');\n // Technically only the dest needs to have `/` but for aesthetic consistency\n // convert slashes in the file arg too.\n fileArg = file.replace(/\\\\/g, '/');\n }\n if (isGnuTar) {\n // Suppress warnings when using GNU tar to extract archives created by BSD tar\n args.push('--warning=no-unknown-keyword');\n args.push('--overwrite');\n }\n args.push('-C', destArg, '-f', fileArg);\n yield exec_1.exec(`tar`, args);\n return dest;\n });\n}\nexports.extractTar = extractTar;\n/**\n * Extract a xar compatible archive\n *\n * @param file path to the archive\n * @param dest destination directory. Optional.\n * @param flags flags for the xar. Optional.\n * @returns path to the destination directory\n */\nfunction extractXar(file, dest, flags = []) {\n return __awaiter(this, void 0, void 0, function* () {\n assert_1.ok(IS_MAC, 'extractXar() not supported on current OS');\n assert_1.ok(file, 'parameter \"file\" is required');\n dest = yield _createExtractFolder(dest);\n let args;\n if (flags instanceof Array) {\n args = flags;\n }\n else {\n args = [flags];\n }\n args.push('-x', '-C', dest, '-f', file);\n if (core.isDebug()) {\n args.push('-v');\n }\n const xarPath = yield io.which('xar', true);\n yield exec_1.exec(`\"${xarPath}\"`, _unique(args));\n return dest;\n });\n}\nexports.extractXar = extractXar;\n/**\n * Extract a zip\n *\n * @param file path to the zip\n * @param dest destination directory. Optional.\n * @returns path to the destination directory\n */\nfunction extractZip(file, dest) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!file) {\n throw new Error(\"parameter 'file' is required\");\n }\n dest = yield _createExtractFolder(dest);\n if (IS_WINDOWS) {\n yield extractZipWin(file, dest);\n }\n else {\n yield extractZipNix(file, dest);\n }\n return dest;\n });\n}\nexports.extractZip = extractZip;\nfunction extractZipWin(file, dest) {\n return __awaiter(this, void 0, void 0, function* () {\n // build the powershell command\n const escapedFile = file.replace(/'/g, \"''\").replace(/\"|\\n|\\r/g, ''); // double-up single quotes, remove double quotes and newlines\n const escapedDest = dest.replace(/'/g, \"''\").replace(/\"|\\n|\\r/g, '');\n const pwshPath = yield io.which('pwsh', false);\n //To match the file overwrite behavior on nix systems, we use the overwrite = true flag for ExtractToDirectory\n //and the -Force flag for Expand-Archive as a fallback\n if (pwshPath) {\n //attempt to use pwsh with ExtractToDirectory, if this fails attempt Expand-Archive\n const pwshCommand = [\n `$ErrorActionPreference = 'Stop' ;`,\n `try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;`,\n `try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`,\n `catch { if (($_.Exception.GetType().FullName -eq 'System.Management.Automation.MethodException') -or ($_.Exception.GetType().FullName -eq 'System.Management.Automation.RuntimeException') ){ Expand-Archive -LiteralPath '${escapedFile}' -DestinationPath '${escapedDest}' -Force } else { throw $_ } } ;`\n ].join(' ');\n const args = [\n '-NoLogo',\n '-NoProfile',\n '-NonInteractive',\n '-ExecutionPolicy',\n 'Unrestricted',\n '-Command',\n pwshCommand\n ];\n core.debug(`Using pwsh at path: ${pwshPath}`);\n yield exec_1.exec(`\"${pwshPath}\"`, args);\n }\n else {\n const powershellCommand = [\n `$ErrorActionPreference = 'Stop' ;`,\n `try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;`,\n `if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${escapedFile}' -DestinationPath '${escapedDest}' -Force }`,\n `else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`\n ].join(' ');\n const args = [\n '-NoLogo',\n '-Sta',\n '-NoProfile',\n '-NonInteractive',\n '-ExecutionPolicy',\n 'Unrestricted',\n '-Command',\n powershellCommand\n ];\n const powershellPath = yield io.which('powershell', true);\n core.debug(`Using powershell at path: ${powershellPath}`);\n yield exec_1.exec(`\"${powershellPath}\"`, args);\n }\n });\n}\nfunction extractZipNix(file, dest) {\n return __awaiter(this, void 0, void 0, function* () {\n const unzipPath = yield io.which('unzip', true);\n const args = [file];\n if (!core.isDebug()) {\n args.unshift('-q');\n }\n args.unshift('-o'); //overwrite with -o, otherwise a prompt is shown which freezes the run\n yield exec_1.exec(`\"${unzipPath}\"`, args, { cwd: dest });\n });\n}\n/**\n * Caches a directory and installs it into the tool cacheDir\n *\n * @param sourceDir the directory to cache into tools\n * @param tool tool name\n * @param version version of the tool. semver format\n * @param arch architecture of the tool. Optional. Defaults to machine architecture\n */\nfunction cacheDir(sourceDir, tool, version, arch) {\n return __awaiter(this, void 0, void 0, function* () {\n version = semver.clean(version) || version;\n arch = arch || os.arch();\n core.debug(`Caching tool ${tool} ${version} ${arch}`);\n core.debug(`source dir: ${sourceDir}`);\n if (!fs.statSync(sourceDir).isDirectory()) {\n throw new Error('sourceDir is not a directory');\n }\n // Create the tool dir\n const destPath = yield _createToolPath(tool, version, arch);\n // copy each child item. do not move. move can fail on Windows\n // due to anti-virus software having an open handle on a file.\n for (const itemName of fs.readdirSync(sourceDir)) {\n const s = path.join(sourceDir, itemName);\n yield io.cp(s, destPath, { recursive: true });\n }\n // write .complete\n _completeToolPath(tool, version, arch);\n return destPath;\n });\n}\nexports.cacheDir = cacheDir;\n/**\n * Caches a downloaded file (GUID) and installs it\n * into the tool cache with a given targetName\n *\n * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.\n * @param targetFile the name of the file name in the tools directory\n * @param tool tool name\n * @param version version of the tool. semver format\n * @param arch architecture of the tool. Optional. Defaults to machine architecture\n */\nfunction cacheFile(sourceFile, targetFile, tool, version, arch) {\n return __awaiter(this, void 0, void 0, function* () {\n version = semver.clean(version) || version;\n arch = arch || os.arch();\n core.debug(`Caching tool ${tool} ${version} ${arch}`);\n core.debug(`source file: ${sourceFile}`);\n if (!fs.statSync(sourceFile).isFile()) {\n throw new Error('sourceFile is not a file');\n }\n // create the tool dir\n const destFolder = yield _createToolPath(tool, version, arch);\n // copy instead of move. move can fail on Windows due to\n // anti-virus software having an open handle on a file.\n const destPath = path.join(destFolder, targetFile);\n core.debug(`destination file ${destPath}`);\n yield io.cp(sourceFile, destPath);\n // write .complete\n _completeToolPath(tool, version, arch);\n return destFolder;\n });\n}\nexports.cacheFile = cacheFile;\n/**\n * Finds the path to a tool version in the local installed tool cache\n *\n * @param toolName name of the tool\n * @param versionSpec version of the tool\n * @param arch optional arch. defaults to arch of computer\n */\nfunction find(toolName, versionSpec, arch) {\n if (!toolName) {\n throw new Error('toolName parameter is required');\n }\n if (!versionSpec) {\n throw new Error('versionSpec parameter is required');\n }\n arch = arch || os.arch();\n // attempt to resolve an explicit version\n if (!isExplicitVersion(versionSpec)) {\n const localVersions = findAllVersions(toolName, arch);\n const match = evaluateVersions(localVersions, versionSpec);\n versionSpec = match;\n }\n // check for the explicit version in the cache\n let toolPath = '';\n if (versionSpec) {\n versionSpec = semver.clean(versionSpec) || '';\n const cachePath = path.join(_getCacheDirectory(), toolName, versionSpec, arch);\n core.debug(`checking cache: ${cachePath}`);\n if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {\n core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);\n toolPath = cachePath;\n }\n else {\n core.debug('not found');\n }\n }\n return toolPath;\n}\nexports.find = find;\n/**\n * Finds the paths to all versions of a tool that are installed in the local tool cache\n *\n * @param toolName name of the tool\n * @param arch optional arch. defaults to arch of computer\n */\nfunction findAllVersions(toolName, arch) {\n const versions = [];\n arch = arch || os.arch();\n const toolPath = path.join(_getCacheDirectory(), toolName);\n if (fs.existsSync(toolPath)) {\n const children = fs.readdirSync(toolPath);\n for (const child of children) {\n if (isExplicitVersion(child)) {\n const fullPath = path.join(toolPath, child, arch || '');\n if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {\n versions.push(child);\n }\n }\n }\n }\n return versions;\n}\nexports.findAllVersions = findAllVersions;\nfunction getManifestFromRepo(owner, repo, auth, branch = 'master') {\n return __awaiter(this, void 0, void 0, function* () {\n let releases = [];\n const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`;\n const http = new httpm.HttpClient('tool-cache');\n const headers = {};\n if (auth) {\n core.debug('set auth');\n headers.authorization = auth;\n }\n const response = yield http.getJson(treeUrl, headers);\n if (!response.result) {\n return releases;\n }\n let manifestUrl = '';\n for (const item of response.result.tree) {\n if (item.path === 'versions-manifest.json') {\n manifestUrl = item.url;\n break;\n }\n }\n headers['accept'] = 'application/vnd.github.VERSION.raw';\n let versionsRaw = yield (yield http.get(manifestUrl, headers)).readBody();\n if (versionsRaw) {\n // shouldn't be needed but protects against invalid json saved with BOM\n versionsRaw = versionsRaw.replace(/^\\uFEFF/, '');\n try {\n releases = JSON.parse(versionsRaw);\n }\n catch (_a) {\n core.debug('Invalid json');\n }\n }\n return releases;\n });\n}\nexports.getManifestFromRepo = getManifestFromRepo;\nfunction findFromManifest(versionSpec, stable, manifest, archFilter = os.arch()) {\n return __awaiter(this, void 0, void 0, function* () {\n // wrap the internal impl\n const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter);\n return match;\n });\n}\nexports.findFromManifest = findFromManifest;\nfunction _createExtractFolder(dest) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!dest) {\n // create a temp dir\n dest = path.join(_getTempDirectory(), v4_1.default());\n }\n yield io.mkdirP(dest);\n return dest;\n });\n}\nfunction _createToolPath(tool, version, arch) {\n return __awaiter(this, void 0, void 0, function* () {\n const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');\n core.debug(`destination ${folderPath}`);\n const markerPath = `${folderPath}.complete`;\n yield io.rmRF(folderPath);\n yield io.rmRF(markerPath);\n yield io.mkdirP(folderPath);\n return folderPath;\n });\n}\nfunction _completeToolPath(tool, version, arch) {\n const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');\n const markerPath = `${folderPath}.complete`;\n fs.writeFileSync(markerPath, '');\n core.debug('finished caching tool');\n}\n/**\n * Check if version string is explicit\n *\n * @param versionSpec version string to check\n */\nfunction isExplicitVersion(versionSpec) {\n const c = semver.clean(versionSpec) || '';\n core.debug(`isExplicit: ${c}`);\n const valid = semver.valid(c) != null;\n core.debug(`explicit? ${valid}`);\n return valid;\n}\nexports.isExplicitVersion = isExplicitVersion;\n/**\n * Get the highest satisfiying semantic version in `versions` which satisfies `versionSpec`\n *\n * @param versions array of versions to evaluate\n * @param versionSpec semantic version spec to satisfy\n */\nfunction evaluateVersions(versions, versionSpec) {\n let version = '';\n core.debug(`evaluating ${versions.length} versions`);\n versions = versions.sort((a, b) => {\n if (semver.gt(a, b)) {\n return 1;\n }\n return -1;\n });\n for (let i = versions.length - 1; i >= 0; i--) {\n const potential = versions[i];\n const satisfied = semver.satisfies(potential, versionSpec);\n if (satisfied) {\n version = potential;\n break;\n }\n }\n if (version) {\n core.debug(`matched: ${version}`);\n }\n else {\n core.debug('match not found');\n }\n return version;\n}\nexports.evaluateVersions = evaluateVersions;\n/**\n * Gets RUNNER_TOOL_CACHE\n */\nfunction _getCacheDirectory() {\n const cacheDirectory = process.env['RUNNER_TOOL_CACHE'] || '';\n assert_1.ok(cacheDirectory, 'Expected RUNNER_TOOL_CACHE to be defined');\n return cacheDirectory;\n}\n/**\n * Gets RUNNER_TEMP\n */\nfunction _getTempDirectory() {\n const tempDirectory = process.env['RUNNER_TEMP'] || '';\n assert_1.ok(tempDirectory, 'Expected RUNNER_TEMP to be defined');\n return tempDirectory;\n}\n/**\n * Gets a global variable\n */\nfunction _getGlobal(key, defaultValue) {\n /* eslint-disable @typescript-eslint/no-explicit-any */\n const value = global[key];\n /* eslint-enable @typescript-eslint/no-explicit-any */\n return value !== undefined ? value : defaultValue;\n}\n/**\n * Returns an array of unique values.\n * @param values Values to make unique.\n */\nfunction _unique(values) {\n return Array.from(new Set(values));\n}\n//# sourceMappingURL=tool-cache.js.map","'use strict';\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.retryAsPromised = exports.TimeoutError = void 0;\nclass TimeoutError extends Error {\n constructor(message, previousError) {\n super(message);\n this.name = \"TimeoutError\";\n this.previous = previousError;\n }\n}\nexports.TimeoutError = TimeoutError;\nfunction matches(match, err) {\n if (typeof match === 'function') {\n try {\n if (err instanceof match)\n return true;\n }\n catch (_) {\n return !!match(err);\n }\n }\n if (match === err.toString())\n return true;\n if (match === err.message)\n return true;\n return match instanceof RegExp\n && (match.test(err.message) || match.test(err.toString()));\n}\nfunction retryAsPromised(callback, optionsInput) {\n if (!callback || !optionsInput) {\n throw new Error('retry-as-promised must be passed a callback and a options set');\n }\n optionsInput = (typeof optionsInput === \"number\" ? { max: optionsInput } : optionsInput);\n const options = {\n $current: \"$current\" in optionsInput ? optionsInput.$current : 1,\n max: optionsInput.max,\n timeout: optionsInput.timeout || undefined,\n match: optionsInput.match ? Array.isArray(optionsInput.match) ? optionsInput.match : [optionsInput.match] : [],\n backoffBase: optionsInput.backoffBase === undefined ? 100 : optionsInput.backoffBase,\n backoffExponent: optionsInput.backoffExponent || 1.1,\n report: optionsInput.report,\n name: optionsInput.name || callback.name || 'unknown'\n };\n if (options.match && !Array.isArray(options.match))\n options.match = [options.match];\n if (options.report)\n options.report('Trying ' + options.name + ' #' + options.$current + ' at ' + new Date().toLocaleTimeString(), options);\n return new Promise(function (resolve, reject) {\n let timeout;\n let backoffTimeout;\n let lastError;\n if (options.timeout) {\n timeout = setTimeout(function () {\n if (backoffTimeout)\n clearTimeout(backoffTimeout);\n reject(new TimeoutError(options.name + ' timed out', lastError));\n }, options.timeout);\n }\n Promise.resolve(callback({ current: options.$current }))\n .then(resolve)\n .then(function () {\n if (timeout)\n clearTimeout(timeout);\n if (backoffTimeout)\n clearTimeout(backoffTimeout);\n })\n .catch(function (err) {\n if (timeout)\n clearTimeout(timeout);\n if (backoffTimeout)\n clearTimeout(backoffTimeout);\n lastError = err;\n if (options.report)\n options.report((err && err.toString()) || err, options, err);\n // Should not retry if max has been reached\n var shouldRetry = options.$current < options.max;\n if (!shouldRetry)\n return reject(err);\n shouldRetry = options.match.length === 0 || options.match.some(function (match) {\n return matches(match, err);\n });\n if (!shouldRetry)\n return reject(err);\n var retryDelay = options.backoffBase * Math.pow(options.backoffExponent, options.$current - 1);\n // Do some accounting\n options.$current++;\n if (options.report)\n options.report(`Retrying ${options.name} (${options.$current})`, options);\n if (retryDelay) {\n // Use backoff function to ease retry rate\n if (options.report)\n options.report(`Delaying retry of ${options.name} by ${retryDelay}`, options);\n backoffTimeout = setTimeout(function () {\n retryAsPromised(callback, options)\n .then(resolve)\n .catch(reject);\n }, retryDelay);\n }\n else {\n retryAsPromised(callback, options)\n .then(resolve)\n .catch(reject);\n }\n });\n });\n}\nexports.retryAsPromised = retryAsPromised;\n;\nexports.default = retryAsPromised;\n","import { installAptPack } from \"setup-apt\"\nimport { installBrewPack } from \"setup-brew\"\nimport { hasDnf } from \"../utils/env/hasDnf.js\"\nimport { isArch } from \"../utils/env/isArch.js\"\nimport { isUbuntu } from \"../utils/env/isUbuntu.js\"\nimport { setupChocoPack } from \"../utils/setup/setupChocoPack.js\"\nimport { setupDnfPack } from \"../utils/setup/setupDnfPack.js\"\nimport { setupPacmanPack } from \"../utils/setup/setupPacmanPack.js\"\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function setupSevenZip(version: string, _setupDir: string, _arch: string) {\n switch (process.platform) {\n case \"win32\": {\n return setupChocoPack(\"7zip\", version)\n }\n case \"darwin\": {\n return installBrewPack(\"p7zip\", version)\n }\n case \"linux\": {\n if (isArch()) {\n return setupPacmanPack(\"p7zip\", version)\n } else if (hasDnf()) {\n return setupDnfPack([\n { name: \"p7zip\", version },\n { name: \"p7zip-plugins\", version },\n ])\n } else if (isUbuntu()) {\n return installAptPack([{ name: \"p7zip-full\", version }])\n }\n throw new Error(\"Unsupported linux distribution\")\n }\n default: {\n throw new Error(\"Unsupported platform\")\n }\n }\n}\n","import { mkdirP } from \"@actions/io\"\nimport { grantUserWriteAccess } from \"admina\"\nimport { info, warning } from \"ci-log\"\nimport { execa } from \"execa\"\nimport { installAptPack } from \"setup-apt\"\nimport which from \"which\"\nimport { setupSevenZip } from \"../../sevenzip/sevenzip.js\"\nimport { hasDnf } from \"../env/hasDnf.js\"\nimport { isArch } from \"../env/isArch.js\"\nimport { isUbuntu } from \"../env/isUbuntu.js\"\nimport { setupDnfPack } from \"./setupDnfPack.js\"\nimport { setupPacmanPack } from \"./setupPacmanPack.js\"\nexport { extractTar, extractXar } from \"@actions/tool-cache\"\n\nexport enum ArchiveType {\n Tar = 0,\n TarGz = 1,\n TarXz = 2,\n Zip = 3,\n SevenZip = 4,\n}\n\nexport function getArchiveType(file: string): ArchiveType {\n const ext = file.split(\".\").pop()\n\n if (ext === \"tar\") {\n return ArchiveType.Tar\n }\n\n if (ext === \"gz\" || ext === \"tgz\") {\n return ArchiveType.TarGz\n }\n\n if (ext === \"xz\" || ext === \"txz\") {\n return ArchiveType.TarXz\n }\n\n if (ext === \"zip\") {\n return ArchiveType.Zip\n }\n\n if (ext === \"7z\" || ext === \"exe\") {\n return ArchiveType.SevenZip\n }\n\n // default to 7z\n warning(`Unknown archive type: ${ext}. Defaulting to 7z`)\n return ArchiveType.SevenZip\n}\n\nexport function getExtractFunction(archiveType: ArchiveType) {\n switch (archiveType) {\n case ArchiveType.Tar:\n case ArchiveType.TarGz:\n return extractTarByExe\n case ArchiveType.TarXz:\n return extractTarByExe\n case ArchiveType.Zip:\n return extractZip\n default:\n return extract7Zip\n }\n}\n\nlet sevenZip: string | undefined\n\n/// Extract 7z using 7z\nexport async function extract7Zip(file: string, dest: string) {\n await execa(await getSevenZip(), [\"x\", file, `-o${dest}`, \"-y\"], { stdio: \"inherit\" })\n await grantUserWriteAccess(dest)\n return dest\n}\n\n/// install 7z if needed\nasync function getSevenZip() {\n if (sevenZip === undefined) {\n if (which.sync(\"7z\", { nothrow: true }) === null) {\n await setupSevenZip(\"\", \"\", process.arch)\n }\n // eslint-disable-next-line require-atomic-updates\n sevenZip = \"7z\"\n }\n return sevenZip\n}\n\n/// Extract Exe using 7z\nexport function extractExe(file: string, dest: string) {\n return extract7Zip(file, dest)\n}\n\n/// Extract Zip using unzip or 7z\nexport async function extractZip(file: string, dest: string) {\n // prefer 7z if available (faster especially on Windows)\n if (which.sync(\"7z\", { nothrow: true }) !== null) {\n return extract7Zip(file, dest)\n }\n\n // if unzip is available use it (usually available on posix systems)\n if (which.sync(\"unzip\", { nothrow: true }) !== null) {\n await execa(\"unzip\", [\"-q\", file, \"-d\", dest], { stdio: \"inherit\" })\n await grantUserWriteAccess(dest)\n return dest\n }\n\n // fallback to 7z (will install 7z if needed)\n return extract7Zip(file, dest)\n}\n\nexport async function extractTarByExe(file: string, dest: string, stripComponents: number = 0, flags: string[] = []) {\n await installTarDependencies(getArchiveType(file))\n\n try {\n await mkdirP(dest)\n } catch {\n // ignore\n }\n\n // TODO windows fails to create symlinks\n // https://github.com/heroku/heroku-slugs/issues/3\n\n try {\n await execa(\"tar\", [\"xf\", file, \"-C\", dest, `--strip-components=${stripComponents}`, ...flags], {\n stdio: \"inherit\",\n })\n } catch (e) {\n if (process.platform === \"win32\" && (e as Error).message.includes(\"Can't create '\\\\\\\\?\\\\C:\")) {\n warning(`Failed to extract symlink ${file} to ${dest}. Ignoring this symlink.`)\n }\n }\n\n await grantUserWriteAccess(dest)\n return dest\n}\n\nasync function installTarDependencies(archiveType: ArchiveType) {\n info(\"Installing tar extraction dependencies\")\n\n switch (archiveType) {\n case ArchiveType.TarGz: {\n if (process.platform === \"linux\") {\n if (isArch()) {\n await setupPacmanPack(\"gzip\")\n await setupPacmanPack(\"tar\")\n } else if (hasDnf()) {\n await setupDnfPack([{ name: \"gzip\" }, { name: \"tar\" }])\n } else if (isUbuntu()) {\n await installAptPack([{ name: \"gzip\" }, { name: \"tar\" }])\n }\n }\n break\n }\n case ArchiveType.TarXz: {\n if (process.platform === \"linux\") {\n if (isArch()) {\n await setupPacmanPack(\"xz\")\n await setupPacmanPack(\"tar\")\n } else if (hasDnf()) {\n await setupDnfPack([{ name: \"xz\" }, { name: \"tar\" }])\n } else if (isUbuntu()) {\n await installAptPack([{ name: \"xz-utils\" }, { name: \"tar\" }])\n }\n }\n break\n }\n default:\n throw new Error(`Unsupported archive type: ${archiveType} for tar extraction`)\n }\n}\n","import { tmpdir } from \"os\"\nimport { basename, join } from \"path\"\nimport { cacheDir, downloadTool, find } from \"@actions/tool-cache\"\nimport { GITHUB_ACTIONS } from \"ci-info\"\nimport { info, warning } from \"ci-log\"\nimport { addPath } from \"envosman\"\nimport { chmod } from \"fs/promises\"\nimport { pathExists } from \"path-exists\"\nimport retry from \"retry-as-promised\"\nimport { maybeGetInput, rcOptions } from \"../../cli-options.js\"\nimport { getArchiveType, getExtractFunction } from \"./extract.js\"\n\n/** A type that describes a package */\nexport type PackageInfo = {\n /** Url to download the package */\n url: string\n /** The top folder name once it is extracted. It can be `\"\"` if there is no top folder */\n extractedFolderName: string\n /** The relative directory in which the binary is located. It can be `\"\"` if the exe is in the top folder */\n binRelativeDir: string\n /** The main binary file. */\n binFileName: string\n /** The function to extract the downloaded archive. It can be `undefined`, if the binary itself is downloaded directly. */\n extractFunction?: (file: string, dest: string) => Promise\n}\n\nexport type InstallationInfo = {\n /** The top install dir */\n installDir?: string\n binDir: string\n bin?: string\n}\n\n/**\n * A function that:\n *\n * - Downloads and extracts a package\n * - Adds the bin path of the package to PATH\n * - Caches the downloaded directory into tool cache for usage from other sessions\n *\n * @returns The installation directory\n */\nexport async function setupBin(\n name: string,\n version: string,\n getPackageInfo: (version: string, platform: NodeJS.Platform, arch: string) => PackageInfo | Promise,\n setupDir: string,\n arch: string,\n): Promise {\n info(`Installing ${name} ${version} ${arch} via direct downloading`)\n\n process.env.RUNNER_TEMP = process.env.RUNNER_TEMP ?? tmpdir()\n process.env.RUNNER_TOOL_CACHE = process.env.RUNNER_TOOL_CACHE ?? join(tmpdir(), \"setup-cpp\", \"hostedtoolcache\")\n\n const { url, binRelativeDir, binFileName, extractedFolderName, extractFunction } = await getPackageInfo(\n version,\n process.platform,\n arch,\n )\n\n // Restore from cache (if found).\n if (GITHUB_ACTIONS) {\n try {\n const dir = find(name, version)\n if (dir) {\n const installDir = join(dir, extractedFolderName)\n const binDir = join(installDir, binRelativeDir)\n if (await pathExists(join(binDir, binFileName))) {\n info(`${name} ${version} was found in the cache at ${binDir}.`)\n await addPath(binDir, rcOptions)\n\n return { installDir, binDir }\n }\n }\n } catch {\n // fails on a local machine?\n }\n }\n\n const installDir = join(setupDir, extractedFolderName)\n const binDir = join(installDir, binRelativeDir)\n const binFile = join(binDir, binFileName)\n\n await downloadExtractInstall(binDir, binFile, name, version, url, setupDir, extractFunction, arch)\n\n await cacheInstallation(setupDir, name, version)\n\n return { installDir, binDir }\n}\n\nasync function downloadExtractInstall(\n binDir: string,\n binFile: string,\n name: string,\n version: string,\n url: string,\n setupDir: string,\n givenExtractFunction: PackageInfo[\"extractFunction\"],\n arch: string,\n) {\n // download ane extract the package into the installation directory.\n if ((await Promise.all([pathExists(binDir), pathExists(binFile)])).includes(false)) {\n try {\n const downloaded = await tryDownload(name, version, url)\n\n info(`Extracting ${downloaded} to ${setupDir}`)\n\n const extractFunction = givenExtractFunction ?? getExtractFunction(getArchiveType(url))\n await extractFunction(downloaded, setupDir)\n } catch (err) {\n throw new Error(`Failed to download ${name} ${version} ${arch} from ${url}: ${err}`)\n }\n }\n\n // Adding the bin dir to the path\n /** The directory which the tool is installed to */\n info(`Add ${binDir} to PATH`)\n await addPath(binDir, rcOptions)\n\n // Check if the binary exists after extraction\n if (!(await pathExists(binFile))) {\n throw new Error(`Failed to find the binary ${binFile} after extracting ${name} ${version} ${arch}`)\n }\n\n // make the binary executable on non-windows platforms\n if (process.platform !== \"win32\") {\n try {\n await chmod(binFile, \"755\")\n } catch (err) {\n warning(`Failed to make ${binFile} executable: ${err}`)\n }\n }\n}\n\nasync function tryDownload(name: string, version: string, url: string) {\n info(`Download ${name} ${version}`)\n // try to download the package 4 times with 2 seconds delay\n const downloaded = await retry(\n () => {\n const downloadedFilePath = join(process.env.RUNNER_TEMP ?? tmpdir(), `${Date.now()}-${basename(url)}`)\n\n return downloadTool(url, downloadedFilePath)\n },\n { name: url, max: 4, backoffBase: 2000, report: (err) => info(err) },\n )\n return downloaded\n}\n\nasync function cacheInstallation(setupDir: string, name: string, version: string) {\n // check if inside Github Actions. If so, cache the installation\n if (GITHUB_ACTIONS && typeof process.env.RUNNER_TOOL_CACHE === \"string\") {\n if (maybeGetInput(\"cache-tools\") === \"true\" || process.env.CACHE_TOOLS === \"true\") {\n await cacheDir(setupDir, name, version)\n }\n }\n}\n","import { info } from \"ci-log\"\nimport { addExeExt } from \"patha\"\nimport semverCoerce from \"semver/functions/coerce\"\nimport semverLte from \"semver/functions/lte\"\nimport { arm64, x86, x86_64 } from \"../utils/env/arch.js\"\nimport { type InstallationInfo, type PackageInfo, setupBin } from \"../utils/setup/setupBin.js\"\n\n/** Get the platform data for cmake */\nfunction getCmakePackageInfo(version: string, platform: NodeJS.Platform, arch: string): PackageInfo {\n const semVersion = semverCoerce(version) ?? version\n switch (platform) {\n case \"win32\": {\n const isOld = semverLte(semVersion, \"v3.19.6\")\n let osArchStr: string\n if (x86_64.includes(arch)) {\n osArchStr = isOld ? \"win64-x64\" : \"windows-x86_64\"\n } else if (x86.includes(arch)) {\n osArchStr = isOld ? \"win32-x86\" : \"windows-i386\"\n } else if (arm64.includes(arch)) {\n osArchStr = \"windows-arm64\"\n } else {\n info(`Trying unsupported arch '${arch}' for cmake on Windows`)\n osArchStr = `windows-${arch}`\n }\n const folderName = `cmake-${version}-${osArchStr}`\n return {\n binRelativeDir: \"bin/\",\n binFileName: addExeExt(\"cmake\"),\n extractedFolderName: folderName,\n url: `https://github.com/Kitware/CMake/releases/download/v${version}/${folderName}.zip`,\n }\n }\n case \"darwin\": {\n const isOld = semverLte(semVersion, \"v3.19.1\")\n const osArchStr = isOld ? \"Darwin-x86_64\" : \"macos-universal\"\n const folderName = `cmake-${version}-${osArchStr}`\n return {\n binRelativeDir: \"CMake.app/Contents/bin/\",\n binFileName: addExeExt(\"cmake\"),\n extractedFolderName: folderName,\n url: `https://github.com/Kitware/CMake/releases/download/v${version}/${folderName}.tar.gz`,\n }\n }\n case \"linux\": {\n const isOld = semverLte(semVersion, \"v3.19.8\")\n let osArchStr: string\n if (arm64.includes(arch)) {\n osArchStr = isOld ? \"Linux-aarch64\" : \"linux-aarch64\"\n } else if (x86_64.includes(arch)) {\n osArchStr = isOld ? \"Linux-x86_64\" : \"linux-x86_64\"\n } else {\n info(`Trying unsupported arch '${arch}' for cmake on Linux`)\n osArchStr = `linux-${arch}`\n }\n const folderName = `cmake-${version}-${osArchStr}`\n return {\n binRelativeDir: \"bin/\",\n binFileName: addExeExt(\"cmake\"),\n extractedFolderName: folderName,\n url: `https://github.com/Kitware/CMake/releases/download/v${version}/${folderName}.tar.gz`,\n }\n }\n default:\n throw new Error(`Unsupported platform '${platform}'`)\n }\n}\n\n/** Setup cmake */\nexport function setupCmake(version: string, setupDir: string, arch: string): Promise {\n return setupBin(\"cmake\", version, getCmakePackageInfo, setupDir, arch)\n}\n","import { getExecOutput } from \"@actions/exec\"\nimport { info } from \"ci-log\"\nimport { isUrlOnline } from \"is-url-online\"\nimport semverCoerce from \"semver/functions/coerce\"\nimport semverCompare from \"semver/functions/compare\"\nimport semverValid from \"semver/functions/valid\"\n\n/**\n * Gets the specific versions supported by this action compatible with the supplied (specific or minimum) version in\n * descending order of release (e.g., `5.0.2`, `5.0.1`, and `5.0.0` for `5`).\n */\nexport function getSpecificVersions(versions: Set, semversion: string): string[] {\n return Array.from(versions)\n .filter((v) => /^\\d+\\.\\d+\\.\\d+$/.test(v) && v.startsWith(semversion))\n .sort((a, b) => {\n try {\n return semverCompare(a, b)\n } catch (err) {\n return a.localeCompare(b)\n }\n })\n .reverse()\n}\n\n/**\n * Gets the specific and minimum versions that can be used to refer to the supplied specific versions (e.g., `3`, `3.5`,\n * `3.5.2` for `3.5.2`).\n */\nexport function getVersions(specific: string[]): Set {\n const versions = new Set(specific)\n\n for (const version of specific) {\n versions.add(/^\\d+/.exec(version)![0])\n versions.add(/^\\d+\\.\\d+/.exec(version)![0])\n }\n\n return versions\n}\n\n/** Gets the most recent specific version for which there is a valid download URL. */\nexport async function getSpecificVersionAndUrl(\n versions: Set,\n platform: string,\n version: string,\n getUrl: (platform: string, version: string) => string | null | Promise,\n): Promise<[string, string]> {\n // specific ubuntu version\n if (platform === \"linux\" && version.includes(\"ubuntu\")) {\n const url = await getUrl(platform, version)\n // eslint-disable-next-line no-await-in-loop\n if (url !== null && (await isUrlOnline(url))) {\n return [version, url]\n }\n }\n\n // if the given set doesn't include the version, throw an error\n if (!versions.has(version)) {\n throw new Error(\n `Unsupported target! (platform='${platform}', version='${version}'). Try one of the following: ${\n JSON.stringify(\n versions,\n )\n }`,\n )\n }\n\n const offlineUrls: string[] = []\n\n // TODO use Promise.any\n for (const specificVersion of getSpecificVersions(versions, version)) {\n // eslint-disable-next-line no-await-in-loop\n const url = await getUrl(platform, specificVersion)\n if (url !== null) {\n // eslint-disable-next-line no-await-in-loop\n if (await isUrlOnline(url)) {\n return [specificVersion, url]\n } else {\n offlineUrls.push(url)\n }\n }\n }\n\n throw new Error(\n `Unsupported target! (platform='${platform}', version='${version}'). Try one of the following: ${\n JSON.stringify(\n versions,\n )\n }`,\n )\n}\n\nexport const defaultVersionRegex = /v?(\\d\\S*)/\n\n/** Get the version of a binary */\nexport async function getBinVersion(file: string, versionRegex: RegExp = defaultVersionRegex) {\n try {\n const execout = await getExecOutput(file, [\"--version\"])\n const version_output = execout.stdout || execout.stderr || \"\"\n const version = version_output.trim().match(versionRegex)?.[1]\n return semverCoerce(version) ?? undefined\n } catch (e) {\n console.error(e)\n return undefined\n }\n}\n\n/** Check if the given bin is up to date against the target version */\nexport async function isBinUptoDate(\n givenFile: string,\n targetVersion: string,\n versionRegex: RegExp = defaultVersionRegex,\n) {\n const givenVersion = await getBinVersion(givenFile, versionRegex)\n if (givenVersion !== undefined && targetVersion !== \"\") {\n return semverCompare(givenVersion, targetVersion) !== -1\n } else {\n // assume given version is old\n return false\n }\n}\n\n/** Coerce the given version if it is invalid */\nexport function semverCoerceIfInvalid(version: string) {\n if (semverValid(version) === null) {\n // version coercion\n try {\n // find the semver version of an integer\n const coercedVersion = semverCoerce(version)\n if (coercedVersion !== null) {\n info(`Coerced version '${version}' to '${coercedVersion}'`)\n return coercedVersion.version\n }\n } catch (err) {\n // handled below\n }\n }\n return version\n}\n\nexport function removeVPrefix(version: string) {\n return Number.parseInt(version.replace(/^v/, \"\"), 10)\n}\n\nexport function addVPrefix(version: string) {\n if (!version.match(/^v/)) {\n return `v${version}`\n }\n return version\n}\n\nexport function compareVersion(tag1: string, tag2: string) {\n const v1 = semverCoerce(tag1)\n const v2 = semverCoerce(tag2)\n if (v1 !== null && v2 !== null) {\n // put the latest version first\n return v2.compare(v1)\n }\n\n // if the tags are not semver, compare them as strings, putting the latest tag first\n return tag2.localeCompare(tag1)\n}\n","export function unique(dirs: string[]) {\n return [...new Set(dirs)]\n}\n\nexport function quoteIfHasSpace(str: string, quoteChar = \"\\\"\") {\n return str.includes(\" \") ? `${quoteChar}${str}${quoteChar}` : str\n}\n","import assert from \"assert\"\nimport { homedir } from \"os\"\nimport { dirname, join, parse as pathParse } from \"path\"\nimport { getExecOutput } from \"@actions/exec\"\nimport { GITHUB_ACTIONS } from \"ci-info\"\nimport { info, warning } from \"ci-log\"\nimport { addPath } from \"envosman\"\nimport { execa } from \"execa\"\nimport { readdir } from \"fs/promises\"\nimport memoize from \"memoizee\"\nimport { pathExists } from \"path-exists\"\nimport { addExeExt } from \"patha\"\nimport { installAptPack } from \"setup-apt\"\nimport { installBrewPack } from \"setup-brew\"\nimport which from \"which\"\nimport { rcOptions } from \"../cli-options.js\"\nimport { hasDnf } from \"../utils/env/hasDnf.js\"\nimport { isArch } from \"../utils/env/isArch.js\"\nimport { isUbuntu } from \"../utils/env/isUbuntu.js\"\nimport type { InstallationInfo } from \"../utils/setup/setupBin.js\"\nimport { setupChocoPack } from \"../utils/setup/setupChocoPack.js\"\nimport { setupDnfPack } from \"../utils/setup/setupDnfPack.js\"\nimport { setupPacmanPack } from \"../utils/setup/setupPacmanPack.js\"\nimport { hasPipx, setupPipPackSystem, setupPipPackWithPython } from \"../utils/setup/setupPipPack.js\"\nimport { isBinUptoDate } from \"../utils/setup/version.js\"\nimport { unique } from \"../utils/std/index.js\"\nimport { MinVersions } from \"../versions/default_versions.js\"\n\nexport async function setupPython(\n version: string,\n setupDir: string,\n arch: string,\n): Promise {\n const installInfo = await findOrSetupPython(version, setupDir, arch)\n assert(installInfo.bin !== undefined)\n const foundPython = installInfo.bin\n\n // setup pip\n const foundPip = await findOrSetupPip(foundPython)\n if (foundPip === undefined) {\n throw new Error(\"pip was not installed correctly\")\n }\n\n await setupPipx(foundPython)\n\n await setupWheel(foundPython)\n\n return installInfo as InstallationInfo & { bin: string }\n}\n\nasync function setupPipx(foundPython: string) {\n try {\n if (!(await hasPipx(foundPython))) {\n try {\n await setupPipPackWithPython(foundPython, \"pipx\", undefined, { upgrade: true, usePipx: false })\n } catch (err) {\n if (setupPipPackSystem(\"pipx\", false) === null) {\n throw new Error(`pipx was not installed correctly ${err}`)\n }\n }\n }\n await execa(foundPython, [\"-m\", \"pipx\", \"ensurepath\"], { stdio: \"inherit\" })\n await setupVenv(foundPython)\n } catch (err) {\n warning(`Failed to install pipx: ${(err as Error).toString()}. Ignoring...`)\n }\n}\n\nasync function setupVenv(foundPython: string) {\n try {\n await setupPipPackWithPython(foundPython, \"venv\", undefined, { upgrade: false, usePipx: false })\n } catch (err) {\n warning(`Failed to install venv: ${(err as Error).toString()}. Ignoring...`)\n }\n}\n\n/** Setup wheel and setuptools */\nasync function setupWheel(foundPython: string) {\n try {\n await setupPipPackWithPython(foundPython, \"setuptools\", undefined, {\n upgrade: true,\n isLibrary: true,\n usePipx: false,\n })\n await setupPipPackWithPython(foundPython, \"wheel\", undefined, { upgrade: false, isLibrary: true, usePipx: false })\n } catch (err) {\n warning(`Failed to install setuptools/wheel: ${(err as Error).toString()}. Ignoring...`)\n }\n}\n\nasync function findOrSetupPython(version: string, setupDir: string, arch: string): Promise {\n let installInfo: InstallationInfo | undefined\n let foundPython = await findPython(setupDir)\n\n if (foundPython !== undefined) {\n const binDir = dirname(foundPython)\n installInfo = { bin: foundPython, installDir: binDir, binDir }\n } else {\n // if python is not found, try to install it\n if (GITHUB_ACTIONS) {\n // install python in GitHub Actions\n try {\n info(\"Installing python in GitHub Actions\")\n const { setupActionsPython } = await import(\"./actions_python.js\")\n await setupActionsPython(version, setupDir, arch)\n\n foundPython = await findPython(setupDir)\n if (foundPython === undefined) {\n throw new Error(\"Python binary could not be found\")\n }\n const binDir = dirname(foundPython)\n installInfo = { bin: foundPython, installDir: binDir, binDir }\n } catch (err) {\n warning((err as Error).toString())\n }\n }\n if (installInfo === undefined) {\n // install python via system package manager\n installInfo = await setupPythonSystem(setupDir, version)\n }\n }\n\n if (foundPython === undefined || installInfo.bin === undefined) {\n foundPython = await findPython(setupDir)\n if (foundPython === undefined) {\n throw new Error(\"Python binary could not be found\")\n }\n installInfo = { bin: foundPython, installDir: dirname(foundPython), binDir: dirname(foundPython) }\n }\n\n return installInfo\n}\n\nasync function setupPythonSystem(setupDir: string, version: string) {\n let installInfo: InstallationInfo | undefined\n switch (process.platform) {\n case \"win32\": {\n if (setupDir) {\n await setupChocoPack(\"python3\", version, [`--params=/InstallDir:${setupDir}`])\n } else {\n await setupChocoPack(\"python3\", version)\n }\n // Adding the bin dir to the path\n const bin = await findPython(setupDir)\n if (bin === undefined) {\n throw new Error(\"Python binary could not be found\")\n }\n const binDir = dirname(bin)\n /** The directory which the tool is installed to */\n await addPath(binDir, rcOptions)\n installInfo = { installDir: binDir, binDir, bin }\n break\n }\n case \"darwin\": {\n installInfo = await installBrewPack(\"python3\", version)\n // add the python and pip binaries to the path\n const brewPythonPrefix: {\n stdout: string\n stderr: string\n } = await execa(\"brew\", [\"--prefix\", \"python\"], { stdio: \"pipe\" })\n const brewPythonBin = join(brewPythonPrefix.stdout, \"libexec\", \"bin\")\n await addPath(brewPythonBin, rcOptions)\n\n break\n }\n case \"linux\": {\n if (isArch()) {\n installInfo = await setupPacmanPack(\"python\", version)\n } else if (hasDnf()) {\n installInfo = await setupDnfPack([{ name: \"python3\", version }])\n } else if (isUbuntu()) {\n installInfo = await installAptPack([{ name: \"python3\", version }, { name: \"python-is-python3\" }])\n } else {\n throw new Error(\"Unsupported linux distributions\")\n }\n break\n }\n default: {\n throw new Error(\"Unsupported platform\")\n }\n }\n return installInfo\n}\n\nasync function findPython(binDir?: string) {\n for (const pythonBin of [\"python\", \"python3\"]) {\n // eslint-disable-next-line no-await-in-loop\n const foundPython = await isPythonUpToDate(pythonBin, binDir)\n if (foundPython !== undefined) {\n return foundPython\n }\n }\n\n // On Windows, search in C:\\PythonXX\n if (process.platform === \"win32\") {\n const rootDir = pathParse(homedir()).root\n // find all directories in rootDir using readdir\n const pythonDirs = (await readdir(rootDir)).filter((dir) => dir.startsWith(\"Python\"))\n\n for (const pythonDir of pythonDirs) {\n for (const pythonBin of [\"python3\", \"python\"]) {\n // eslint-disable-next-line no-await-in-loop\n const foundPython = await isPythonUpToDate(pythonBin, join(rootDir, pythonDir))\n if (foundPython !== undefined) {\n return foundPython\n }\n }\n }\n }\n\n return undefined\n}\n\nasync function isPythonUpToDate(candidate: string, binDir?: string) {\n try {\n if (binDir !== undefined) {\n const pythonBinPath = join(binDir, addExeExt(candidate))\n if (await pathExists(pythonBinPath) && await isBinUptoDate(pythonBinPath, MinVersions.python!)) {\n return pythonBinPath\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const pythonBinPaths = (await which(candidate, { nothrow: true, all: true })) ?? []\n for (const pythonBinPath of pythonBinPaths) {\n // eslint-disable-next-line no-await-in-loop\n if (await isBinUptoDate(pythonBinPath, MinVersions.python!)) {\n return pythonBinPath\n }\n }\n } catch {\n // fall through\n }\n return undefined\n}\n\nasync function findOrSetupPip(foundPython: string) {\n const maybePip = await findPip()\n\n if (maybePip === undefined) {\n // install pip if not installed\n info(\"pip was not found. Installing pip\")\n await setupPip(foundPython)\n return findPip() // recurse to check if pip is on PATH and up-to-date\n }\n\n return maybePip\n}\n\nasync function findPip() {\n for (const pipCandidate of [\"pip3\", \"pip\"]) {\n // eslint-disable-next-line no-await-in-loop\n const maybePip = await isPipUptoDate(pipCandidate)\n if (maybePip !== undefined) {\n return maybePip\n }\n }\n return undefined\n}\n\nasync function isPipUptoDate(pip: string) {\n try {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const pipPaths = (await which(pip, { nothrow: true, all: true })) ?? []\n for (const pipPath of pipPaths) {\n // eslint-disable-next-line no-await-in-loop\n if (await isBinUptoDate(pipPath, MinVersions.pip!)) {\n return pipPath\n }\n }\n } catch {\n // fall through\n }\n return undefined\n}\n\nasync function setupPip(foundPython: string) {\n const upgraded = await ensurePipUpgrade(foundPython)\n if (!upgraded) {\n // ensure that pip is installed on Linux (happens when python is found but pip not installed)\n await setupPipPackSystem(\"pip\")\n\n // upgrade pip\n await ensurePipUpgrade(foundPython)\n }\n}\n\nasync function ensurePipUpgrade(foundPython: string) {\n try {\n await execa(foundPython, [\"-m\", \"ensurepip\", \"-U\", \"--upgrade\"], { stdio: \"inherit\" })\n return true\n } catch (err1) {\n info((err1 as Error).toString())\n try {\n // ensure pip is disabled on Ubuntu\n await execa(foundPython, [\"-m\", \"pip\", \"install\", \"--upgrade\", \"pip\"], { stdio: \"inherit\" })\n return true\n } catch (err2) {\n info((err2 as Error).toString())\n // pip module not found\n }\n }\n // all methods failed\n return false\n}\n\nasync function addPythonBaseExecPrefix_(python: string) {\n const dirs: string[] = []\n\n // detection based on the platform\n if (process.platform === \"linux\") {\n dirs.push(\"/home/runner/.local/bin/\")\n } else if (process.platform === \"darwin\") {\n dirs.push(\"/usr/local/bin/\")\n }\n\n // detection using python.sys\n const base_exec_prefix = (await getExecOutput(`${python} -c \"import sys;print(sys.base_exec_prefix);\"`)).stdout.trim()\n // any of these are possible depending on the operating system!\n dirs.push(join(base_exec_prefix, \"Scripts\"), join(base_exec_prefix, \"Scripts\", \"bin\"), join(base_exec_prefix, \"bin\"))\n\n // remove duplicates\n return unique(dirs)\n}\n\n/**\n * Add the base exec prefix to the PATH. This is required for Conan, Meson, etc. to work properly.\n *\n * The answer is cached for subsequent calls\n */\nexport const addPythonBaseExecPrefix = memoize(addPythonBaseExecPrefix_, { promise: true })\n","import type { Opts } from \"../cli-options.js\"\nimport type { CompilerInfo } from \"../compilers.js\"\nimport type { Inputs } from \"../tool.js\"\nimport { DefaultUbuntuVersion, DefaultVersions } from \"./default_versions.js\"\n\n/** Get the default version if passed true or undefined, otherwise return the version itself */\nexport function getVersion(name: string, version: string | undefined, osVersion: number[] | null = null) {\n if (isVersionDefault(version) && process.platform === \"linux\" && osVersion !== null && name in DefaultUbuntuVersion) {\n return getDefaultLinuxVersion(osVersion, DefaultUbuntuVersion[name]!)\n } else if (isVersionDefault(version) && name in DefaultVersions) {\n return DefaultVersions[name] ?? \"\"\n } else if (version === \"true\") {\n return \"\"\n }\n return version ?? \"\"\n}\n\nfunction isVersionDefault(version: string | undefined) {\n return version === \"true\" || version === undefined\n}\n\n/// choose the default linux version based on ubuntu version\nfunction getDefaultLinuxVersion(osVersion: number[], toolLinuxVersions: Record) {\n const osVersionMaj = osVersion[0]\n\n // find which version block the os version is in\n const satisfyingVersion = Object.keys(toolLinuxVersions)\n .map((v) => Number.parseInt(v, 10))\n .sort((a, b) => b - a) // sort in descending order\n .find((v) => osVersionMaj >= v)\n\n return satisfyingVersion === undefined ? \"\" : toolLinuxVersions[satisfyingVersion]\n}\n\n/**\n * Sync the versions for the given inputs\n *\n * It modifies the opts object to have the same version for all the tools\n * If the return is false, it means that versions don't match the target version\n * @param opts - The options object (modified in place)\n * @param tools - The tools to sync the versions for (it can include `compiler`)\n * @param compilerInfo - The compiler info to sync the versions for (if any)\n */\nexport function syncVersions(\n opts: Opts,\n toolsGiven: Inputs[],\n compilerInfo: CompilerInfo | undefined = undefined,\n): boolean {\n // check if compiler version should be synced\n const syncCompiler = compilerInfo === undefined ? false : toolsGiven.includes(compilerInfo.compiler as Inputs)\n\n // remove the compiler from the tools if it should not be synced\n const tools = syncCompiler ? toolsGiven : toolsGiven.filter((tool) => tool !== \"compiler\")\n\n // filter out the tools that are in use in the options\n const toolsInUse = tools.filter((tool) => opts[tool] !== undefined)\n\n // filter out the tools that are not default\n const toolsNonDefaultVersion = toolsInUse.filter((tool) => {\n const version = (syncCompiler && tool === \"compiler\" && compilerInfo !== undefined)\n ? compilerInfo.version\n : opts[tool]\n return !isVersionDefault(version)\n })\n\n // find the target version to sync to\n const targetVersion: string = (toolsNonDefaultVersion.length !== 0)\n ? (syncCompiler && toolsNonDefaultVersion[0] === \"compiler\" && compilerInfo !== undefined)\n ? compilerInfo.version ?? \"true\"\n : opts[toolsNonDefaultVersion[0]] ?? \"true\"\n : \"true\"\n\n // error if any explicit versions don't match the target version\n if (\n toolsNonDefaultVersion.some((tool) => {\n if (syncCompiler && tool === \"compiler\" && compilerInfo !== undefined) {\n return opts.compiler !== `${compilerInfo.compiler}-${targetVersion}`\n }\n\n return opts[tool] !== targetVersion\n })\n ) {\n return false\n }\n\n // update the version of all the tools to the target version\n for (const tool of toolsInUse) {\n opts[tool] = (syncCompiler && tool === \"compiler\" && compilerInfo !== undefined)\n ? `${compilerInfo.compiler}-${targetVersion}`\n : targetVersion\n }\n\n return true\n}\n","import os from \"os\"\nimport { warning } from \"ci-log\"\nimport memoize from \"memoizee\"\nimport { installAptPack } from \"setup-apt\"\nimport { getUbuntuVersion } from \"ubuntu-version\"\nimport which from \"which\"\nimport { isUbuntu } from \"./isUbuntu.js\"\n\nasync function ubuntuVersion_(): Promise {\n try {\n if (isUbuntu()) {\n try {\n if (which.sync(\"lsb_release\", { nothrow: true }) === null) {\n await installAptPack([{ name: \"lsb-release\" }])\n }\n } catch {\n return detectUsingOsVersion()\n }\n\n const versionSplitted = await getUbuntuVersion()\n\n if (versionSplitted.length === 0) {\n return detectUsingOsVersion()\n }\n\n return versionSplitted\n } else {\n return null\n }\n } catch (err) {\n warning((err as Error).toString())\n return null\n }\n}\n\n/** Detect Ubuntu version */\nexport const ubuntuVersion = memoize(ubuntuVersion_, { promise: true })\n\n/** Detect Ubuntu version using os.version() for Ubuntu based distros */\nfunction detectUsingOsVersion() {\n if (!(\"version\" in os && typeof os.version === \"function\")) {\n return null\n }\n\n // #40~22.04.3-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 30 17:30:19 UTC 2\n const osVersion: string = os.version()\n // parse the version\n const versionMatch = osVersion.match(/(\\d+)\\.(\\d+)\\.(\\d+)/)\n if (versionMatch === null) {\n return null\n }\n\n const majorVersion = Number.parseInt(versionMatch[1], 10)\n const minorVersion = Number.parseInt(versionMatch[2], 10)\n const patchVersion = Number.parseInt(versionMatch[3], 10)\n\n return [majorVersion, minorVersion, patchVersion]\n}\n","import { dirname, join } from \"path\"\nimport { info } from \"@actions/core\"\nimport { addPath } from \"envosman\"\nimport { execa, execaSync } from \"execa\"\nimport memoize from \"memoizee\"\nimport { mkdirp } from \"mkdirp\"\nimport { pathExists } from \"path-exists\"\nimport { addExeExt } from \"patha\"\nimport { installAptPack } from \"setup-apt\"\nimport { installBrewPack } from \"setup-brew\"\nimport { untildifyUser } from \"untildify-user\"\nimport which from \"which\"\nimport { rcOptions } from \"../../cli-options.js\"\nimport { addPythonBaseExecPrefix, setupPython } from \"../../python/python.js\"\nimport { getVersion } from \"../../versions/versions.js\"\nimport { hasDnf } from \"../env/hasDnf.js\"\nimport { isArch } from \"../env/isArch.js\"\nimport { isUbuntu } from \"../env/isUbuntu.js\"\nimport { ubuntuVersion } from \"../env/ubuntu_version.js\"\nimport type { InstallationInfo } from \"./setupBin.js\"\nimport { setupDnfPack } from \"./setupDnfPack.js\"\nimport { setupPacmanPack } from \"./setupPacmanPack.js\"\n\nexport type SetupPipPackOptions = {\n /** Whether to use pipx instead of pip */\n usePipx?: boolean\n /** Whether to install the package as a user */\n user?: boolean\n /** Whether to upgrade the package */\n upgrade?: boolean\n /** Whether the package is a library */\n isLibrary?: boolean\n}\n\n/** A function that installs a package using pip */\nexport async function setupPipPack(\n name: string,\n version?: string,\n options: SetupPipPackOptions = {},\n): Promise {\n return setupPipPackWithPython(await getPython(), name, version, options)\n}\n\nexport async function setupPipPackWithPython(\n givenPython: string,\n name: string,\n version?: string,\n options: SetupPipPackOptions = {},\n): Promise {\n const { usePipx = true, user = true, upgrade = false, isLibrary = false } = options\n\n const isPipx = usePipx && !isLibrary && (await hasPipx(givenPython))\n\n const pip = isPipx ? \"pipx\" : \"pip\"\n\n // remove `[]` extensions\n const nameOnly = getPackageName(name)\n\n // if upgrade is not requested, check if the package is already installed, and return if it is\n if (!upgrade) {\n const installed = isPipx\n ? await pipxPackageInstalled(givenPython, nameOnly)\n : await pipPackageIsInstalled(givenPython, nameOnly)\n if (installed) {\n const binDir = isPipx\n ? await finishPipxPackageInstall()\n : await finishPipPackageInstall(givenPython, nameOnly)\n return { binDir }\n }\n }\n\n const hasPackage = await pipHasPackage(givenPython, nameOnly)\n if (hasPackage) {\n try {\n info(`Installing ${name} ${version ?? \"\"} via ${pip}`)\n\n const nameAndVersion = version !== undefined && version !== \"\" ? `${name}==${version}` : name\n const upgradeFlag = upgrade ? (isPipx ? [\"upgrade\"] : [\"install\", \"--upgrade\"]) : [\"install\"]\n const userFlag = !isPipx && user ? [\"--user\"] : []\n\n const env = process.env\n\n if (isPipx && user) {\n // install to user home\n env.PIPX_HOME = await getPipxHome()\n env.PIPX_BIN_DIR = await getPipxBinDir()\n }\n\n execaSync(givenPython, [\"-m\", pip, ...upgradeFlag, ...userFlag, nameAndVersion], {\n stdio: \"inherit\",\n env,\n })\n } catch (err) {\n const msg = err instanceof Error ? `${err.message}\\n${err.stack}` : String(err)\n info(`Failed to install ${name} via ${pip}: ${msg}`)\n if ((await setupPipPackSystem(name)) === null) {\n throw new Error(`Failed to install ${name} via ${pip}: ${err}.`)\n }\n }\n } else if ((await setupPipPackSystem(name)) === null) {\n throw new Error(`Failed to install ${name} as it was not found via ${pip} or the system package manager`)\n }\n\n const binDir = isPipx\n ? await finishPipxPackageInstall()\n : await finishPipPackageInstall(givenPython, nameOnly)\n return { binDir }\n}\n\nfunction finishPipxPackageInstall() {\n return getPipxBinDir()\n}\n\nasync function finishPipPackageInstall(givenPython: string, name: string) {\n const pythonBaseExecPrefix = await addPythonBaseExecPrefix(givenPython)\n const binDir = await findBinDir(pythonBaseExecPrefix, name)\n await addPath(binDir, rcOptions)\n return binDir\n}\n\nexport async function hasPipx(givenPython: string) {\n const res = await execa(givenPython, [\"-m\", \"pipx\", \"--help\"], { stdio: \"ignore\", reject: false })\n return res.exitCode === 0\n}\n\nasync function getPipxHome_() {\n let pipxHome = process.env.PIPX_HOME\n if (pipxHome !== undefined) {\n return pipxHome\n }\n\n // Based on https://pipx.pypa.io/stable/installation/\n const compatHome = untildifyUser(\"~/.local/pipx\")\n if (await pathExists(compatHome)) {\n return compatHome\n }\n\n switch (process.platform) {\n case \"win32\": {\n pipxHome = untildifyUser(\"~/AppData/Local/pipx\")\n break\n }\n case \"darwin\": {\n pipxHome = untildifyUser(\"~/Library/Application Support/pipx\")\n break\n }\n default: {\n pipxHome = untildifyUser(\"~/.local/share/pipx\")\n break\n }\n }\n\n await mkdirp(pipxHome)\n await mkdirp(join(pipxHome, \"trash\"))\n await mkdirp(join(pipxHome, \"shared\"))\n await mkdirp(join(pipxHome, \"venv\"))\n return pipxHome\n}\nconst getPipxHome = memoize(getPipxHome_, { promise: true })\n\nasync function getPipxBinDir_() {\n if (process.env.PIPX_BIN_DIR !== undefined) {\n return process.env.PIPX_BIN_DIR\n }\n\n const pipxBinDir = untildifyUser(\"~/.local/bin\")\n await addPath(pipxBinDir, rcOptions)\n await mkdirp(pipxBinDir)\n return pipxBinDir\n}\nconst getPipxBinDir = memoize(getPipxBinDir_, { promise: true })\n\n/* eslint-disable require-atomic-updates */\nlet pythonBin: string | undefined\n\nasync function getPython(): Promise {\n if (pythonBin !== undefined) {\n return pythonBin\n }\n\n pythonBin = (await setupPython(getVersion(\"python\", undefined, await ubuntuVersion()), \"\", process.arch)).bin\n return pythonBin\n}\n\n/**\n * Get the actual name of a pip package from the given string\n * @param pkg the given name that might contain extensions in `[]`.\n * @returns stirped down name of the package\n */\nfunction getPackageName(pkg: string) {\n return pkg.replace(/\\[.*]/g, \"\").trim()\n}\n\nasync function pipPackageIsInstalled(python: string, name: string) {\n try {\n const result = await execa(python, [\"-m\", \"pip\", \"-qq\", \"show\", name], {\n stdio: \"ignore\",\n reject: false,\n })\n return result.exitCode === 0\n } catch {\n return false\n }\n}\n\ntype PipxShowType = {\n venvs: Record\n}\n\nasync function pipxPackageInstalled(python: string, name: string) {\n try {\n const result = await execa(python, [\"-m\", \"pipx\", \"list\", \"--json\"], {\n stdio: \"ignore\",\n reject: false,\n })\n if (result.exitCode !== 0 || typeof result.stdout !== \"string\") {\n return false\n }\n\n const pipxOut = JSON.parse(result.stdout) as PipxShowType\n // search among the venvs\n if (name in pipxOut.venvs) {\n return true\n }\n // search among the urls\n for (const venv of Object.values(pipxOut.venvs)) {\n if (venv.metadata.main_package.package_or_url === name || venv.metadata.main_package.package === name) {\n return true\n }\n }\n } catch {\n // ignore\n }\n return false\n}\n\nasync function pipHasPackage(python: string, name: string) {\n const result = await execa(python, [\"-m\", \"pip\", \"-qq\", \"index\", \"versions\", name], {\n stdio: \"ignore\",\n reject: false,\n })\n return result.exitCode === 0\n}\n\nasync function findBinDir(dirs: string[], name: string) {\n const exists = await Promise.all(dirs.map((dir) => pathExists(join(dir, addExeExt(name)))))\n const dirIndex = exists.findIndex((exist) => exist)\n if (dirIndex !== -1) {\n const foundDir = dirs[dirIndex]\n return foundDir\n }\n\n const whichDir = which.sync(addExeExt(name), { nothrow: true })\n if (whichDir !== null) {\n return dirname(whichDir)\n }\n\n return dirs[dirs.length - 1]\n}\n\nexport function setupPipPackSystem(name: string, addPythonPrefix = true) {\n if (process.platform === \"linux\") {\n info(`Installing ${name} via the system package manager`)\n if (isArch()) {\n return setupPacmanPack(addPythonPrefix ? `python-${name}` : name)\n } else if (hasDnf()) {\n return setupDnfPack([{ name: addPythonPrefix ? `python3-${name}` : name }])\n } else if (isUbuntu()) {\n return installAptPack([{ name: addPythonPrefix ? `python3-${name}` : name }])\n }\n } else if (process.platform === \"darwin\") {\n return installBrewPack(name)\n }\n return null\n}\n","import { setupPipPack } from \"../utils/setup/setupPipPack.js\"\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function setupCmakelang(version: string | undefined, _setupDir: string, _arch: string) {\n return setupPipPack(\"cmakelang[YAML]\", version)\n}\n","import { addPath } from \"envosman\"\nimport { installAptPack } from \"setup-apt\"\nimport { installBrewPack } from \"setup-brew\"\nimport { rcOptions } from \"../cli-options.js\"\nimport { hasDnf } from \"../utils/env/hasDnf.js\"\nimport { isArch } from \"../utils/env/isArch.js\"\nimport { isUbuntu } from \"../utils/env/isUbuntu.js\"\nimport type { InstallationInfo } from \"../utils/setup/setupBin.js\"\nimport { setupChocoPack } from \"../utils/setup/setupChocoPack.js\"\nimport { setupDnfPack } from \"../utils/setup/setupDnfPack.js\"\nimport { setupPacmanPack } from \"../utils/setup/setupPacmanPack.js\"\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport async function setupGraphviz(version: string, _setupDir: string, _arch: string) {\n switch (process.platform) {\n case \"win32\": {\n await setupChocoPack(\"graphviz\", version)\n return activateGraphviz()\n }\n case \"darwin\": {\n return installBrewPack(\"graphviz\", version)\n }\n case \"linux\": {\n if (isArch()) {\n return setupPacmanPack(\"graphviz\", version)\n } else if (hasDnf()) {\n return setupDnfPack([{ name: \"graphviz\", version }])\n } else if (isUbuntu()) {\n return installAptPack([{ name: \"graphviz\", version }])\n }\n throw new Error(\"Unsupported linux distribution\")\n }\n default: {\n throw new Error(\"Unsupported platform\")\n }\n }\n}\n\nasync function activateGraphviz(): Promise {\n switch (process.platform) {\n case \"win32\": {\n const binDir = \"C:/Program Files/Graphviz/bin\"\n await addPath(binDir, rcOptions)\n return { binDir }\n }\n default: {\n throw new Error(\"Unsupported platform\")\n }\n }\n}\n","import { join } from \"path\"\n\nexport async function setupDmg(path: string, destDir: string) {\n const { ArchiveHdi } = await import(\"@shockpkg/archive-files/esm/archive/hdi.mjs\")\n\n const dmg = new ArchiveHdi(path)\n await dmg.read(async (entry) => {\n await entry.extract(join(destDir, entry.path))\n })\n}\n","import { join } from \"path\"\nimport { info, notice } from \"ci-log\"\nimport { addPath } from \"envosman\"\nimport { addExeExt } from \"patha\"\nimport { installAptPack } from \"setup-apt\"\nimport { installBrewPack } from \"setup-brew\"\nimport { setupGraphviz } from \"../graphviz/graphviz.js\"\nimport { type InstallationInfo, type PackageInfo, setupBin } from \"../utils/setup/setupBin.js\"\nimport { setupChocoPack } from \"../utils/setup/setupChocoPack.js\"\nimport { setupPacmanPack } from \"../utils/setup/setupPacmanPack.js\"\nimport { getVersion } from \"../versions/versions.js\"\n\nimport { pathExists } from \"path-exists\"\nimport retry from \"retry-as-promised\"\nimport { rcOptions } from \"../cli-options.js\"\nimport { hasDnf } from \"../utils/env/hasDnf.js\"\nimport { isArch } from \"../utils/env/isArch.js\"\nimport { isUbuntu } from \"../utils/env/isUbuntu.js\"\nimport { macosVersion } from \"../utils/env/macos_version.js\"\nimport { ubuntuVersion } from \"../utils/env/ubuntu_version.js\"\nimport { setupDmg } from \"../utils/setup/setupDmg.js\"\nimport { setupDnfPack } from \"../utils/setup/setupDnfPack.js\"\n\n/** Get the platform data for cmake */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction getDoxygenPackageInfo(version: string, platform: NodeJS.Platform, _arch: string): PackageInfo {\n switch (platform) {\n case \"linux\": {\n const folderName = `doxygen-${version}`\n return {\n binRelativeDir: \"bin/\",\n binFileName: addExeExt(\"doxygen\"),\n extractedFolderName: folderName,\n url: `https://www.doxygen.nl/files/${folderName}.linux.bin.tar.gz`,\n }\n }\n case \"win32\": {\n const folderName = `doxygen-${version}`\n return {\n binRelativeDir: \"\",\n binFileName: addExeExt(\"doxygen\"),\n extractedFolderName: folderName,\n url: `https://www.doxygen.nl/files/${folderName}.windows.x64.bin.zip`,\n }\n }\n case \"darwin\": {\n const folderName = `Doxygen-${version}`\n return {\n binRelativeDir: \"Doxygen/Doxygen.app/Contents/Resources/\",\n binFileName: addExeExt(\"doxygen\"),\n extractedFolderName: folderName,\n extractFunction: setupDmg,\n url: `https://doxygen.nl/files/${folderName}.dmg`,\n }\n }\n default:\n throw new Error(`Unsupported platform '${platform}'`)\n }\n}\n\nexport async function setupDoxygen(version: string, setupDir: string, arch: string) {\n switch (process.platform) {\n case \"win32\": {\n // try to download the package 4 times with 2 seconds delay\n await retry(\n () => {\n return setupChocoPack(\"doxygen.install\", version)\n },\n { name: \"doxygen.install\", max: 4, backoffBase: 2000, report: (err) => info(err) },\n )\n const binDir = await activateWinDoxygen()\n const installationInfo = { binDir }\n await setupGraphviz(getVersion(\"graphviz\", undefined), \"\", arch)\n return installationInfo\n }\n case \"darwin\": {\n // let installationInfo: InstallationInfo\n // try {\n // installationInfo = await setupBin(\"doxygen\", version, getDoxygenPackageInfo, setupDir, arch)\n // } catch {\n const installationInfo = await installBrewPack(\"doxygen\", undefined)\n // }\n\n // only install graphviz if the macOS version is greater than 11\n if (macosVersion()[0] > 11) {\n await setupGraphviz(getVersion(\"graphviz\", undefined), \"\", arch)\n }\n return installationInfo\n }\n case \"linux\": {\n let installationInfo: InstallationInfo\n if (version === \"\" || isArch() || hasDnf()) {\n if (isArch()) {\n installationInfo = await setupPacmanPack(\"doxygen\", version)\n } else if (hasDnf()) {\n return setupDnfPack([{ name: \"doxygen\", version }])\n } else if (isUbuntu()) {\n installationInfo = await installAptPack([{ name: \"doxygen\", version }])\n } else {\n throw new Error(\"Unsupported linux distributions\")\n }\n } else if (isUbuntu()) {\n try {\n // doxygen on stable Ubuntu repositories is very old. So, we use get the binary from the website itself\n installationInfo = await setupBin(\"doxygen\", version, getDoxygenPackageInfo, setupDir, arch)\n try {\n await installAptPack([{ name: \"libclang-cpp9\" }])\n } catch (err) {\n info(`Failed to download libclang-cpp9 that might be needed for running doxygen. ${err}`)\n }\n } catch (err) {\n notice(`Failed to download doxygen binary. ${err}. Falling back to apt-get.`)\n installationInfo = await installAptPack([{ name: \"doxygen\" }])\n }\n } else {\n throw new Error(\"Unsupported linux distributions\")\n }\n await setupGraphviz(getVersion(\"graphviz\", undefined, await ubuntuVersion()), \"\", arch)\n return installationInfo\n }\n default: {\n throw new Error(\"Unsupported platform\")\n }\n }\n}\n\nasync function activateWinDoxygen() {\n switch (process.platform) {\n case \"win32\": {\n for (\n const binDir of [\n \"C:/ProgramData/chocolatey/bin\",\n \"C:/Program Files/doxygen/bin\",\n \"C:/Program Files (x86)/doxygen\",\n ]\n ) {\n // eslint-disable-next-line no-await-in-loop\n if (await pathExists(join(binDir, \"doxygen.exe\"))) {\n // eslint-disable-next-line no-await-in-loop\n await addPath(binDir, rcOptions)\n return binDir\n }\n }\n throw new Error(\"Failed to find doxygen binary\")\n }\n default: {\n throw new Error(\"Unsupported platform\")\n }\n }\n}\n","import { getExecOutput } from \"@actions/exec\"\nimport { error } from \"ci-log\"\nimport { addEnv } from \"envosman\"\nimport { rcOptions } from \"../cli-options.js\"\n\nexport async function setupMacOSSDK() {\n if (process.platform === \"darwin\") {\n try {\n const xcrun = await getExecOutput(\"xcrun --sdk macosx --show-sdk-path\")\n const sdkroot = xcrun.stdout || xcrun.stderr\n if (sdkroot) {\n await addEnv(\"SDKROOT\", sdkroot.trim(), rcOptions)\n } else {\n error(\"SDKROOT not set\")\n }\n } catch (e) {\n error(e as Error | string)\n }\n }\n}\n","import { readFile } from \"fs/promises\"\n\n/**\n * The list of assets\n * @key tag The tag of the release\n * @value assets The names of the assets of the release\n */\nexport type Assets = Record\n\n/**\n * Load the list of assets from a json file\n */\nexport async function loadAssetList(path: string): Promise {\n const data = await readFile(path, \"utf-8\")\n return JSON.parse(data)\n}\n\ntype MatchAssetOpts = {\n version: string\n keywords?: string[]\n optionalKeywords?: string[]\n filterMapTag?: (tag: string) => string | undefined\n filterName?: (asset: string) => boolean\n}\n\n/**\n * Match the asset that matches the version and given keywords\n */\nexport function matchAsset(\n assets: Assets,\n opts: MatchAssetOpts,\n): { tag: string; name: string } | undefined {\n // get the list of versions\n const origTags = Object.keys(assets)\n\n // filter/map the tags\n const versionMap: Map = new Map()\n if (opts.filterMapTag === undefined) {\n for (const origTag of origTags) {\n versionMap.set(origTag, origTag)\n }\n } else {\n for (const origTag of origTags) {\n const mappedTag = opts.filterMapTag(origTag)\n if (mappedTag !== undefined) {\n versionMap.set(mappedTag, origTag)\n }\n }\n }\n\n if (versionMap.size === 0) {\n return undefined\n }\n\n // find the first tag that starts with the version\n // loop over the versions starting with the latest\n const candidateTags: string[] = []\n for (const [version, origTag] of versionMap.entries()) {\n if (version.startsWith(opts.version)) {\n candidateTags.push(origTag)\n }\n }\n\n if (candidateTags.length === 0) {\n return undefined\n }\n\n // Loop over the candidate tags and return the first one that has assets\n for (const candidateTag of candidateTags) {\n // get the list of assets\n let assetNames = assets[candidateTag]\n if (assetNames === undefined) {\n continue\n }\n\n // filter the assets\n if (opts.filterName !== undefined) {\n assetNames = assetNames.filter(opts.filterName)\n }\n\n if (assetNames.length === 0) {\n continue\n }\n\n // check if this version contains the keywords and optional keywords in the asset name\n const match = matchAssetName(candidateTag, assetNames, opts)\n if (match !== undefined) {\n return match\n }\n }\n\n return undefined\n}\n\nfunction matchAssetName(tag: string, assetNames: string[], opts: MatchAssetOpts) {\n // if no keywords are given, return the first asset\n if (\n (opts.keywords === undefined\n || opts.keywords.length === 0)\n && (opts.optionalKeywords === undefined\n || opts.optionalKeywords.length === 0)\n ) {\n return { tag, name: assetNames[0] }\n }\n\n // check if the asset contains all the keywords\n let candidates: string[] = []\n if (\n opts.keywords !== undefined\n && opts.keywords.length !== 0\n ) {\n for (const name of assetNames) {\n if (opts.keywords!.every((keyword) => name.includes(keyword))) {\n candidates.push(name)\n }\n }\n } else {\n candidates = assetNames\n }\n\n if (candidates.length === 0) {\n return undefined\n }\n\n // prefer the candidates that contain more optional keywords\n if (\n opts.optionalKeywords !== undefined\n && opts.optionalKeywords.length !== 0\n ) {\n // rate the candidates based on the number of optional keywords they contain\n const candidateScores = candidates.map((name) => {\n let score = 0\n for (const keyword of opts.optionalKeywords!) {\n if (name.includes(keyword)) {\n score++\n }\n }\n return score\n })\n\n // find the candidate with the highest score\n const maxScore = Math.max(...candidateScores)\n const maxIndex = candidateScores.indexOf(maxScore)\n return { tag, name: candidates[maxIndex] }\n }\n\n // return the first candidate if no optional keywords are given\n return { tag, name: candidates[0] }\n}\n","import path, { join } from \"path\"\nimport { fileURLToPath } from \"url\"\nimport { GITHUB_ACTIONS } from \"ci-info\"\nimport { error, info, warning } from \"ci-log\"\nimport { addEnv, addPath } from \"envosman\"\nimport { execa } from \"execa\"\nimport { readdir } from \"fs/promises\"\nimport { pathExists } from \"path-exists\"\nimport { addExeExt } from \"patha\"\nimport semverCoerce from \"semver/functions/coerce\"\nimport semverMajor from \"semver/functions/major\"\nimport { addUpdateAlternativesToRc, installAptPack } from \"setup-apt\"\nimport { installBrewPack } from \"setup-brew\"\nimport { rcOptions } from \"../cli-options.js\"\nimport { setupMacOSSDK } from \"../macos-sdk/macos-sdk.js\"\nimport { loadAssetList, matchAsset } from \"../utils/asset/load-assets.js\"\nimport { hasDnf } from \"../utils/env/hasDnf.js\"\nimport { isArch } from \"../utils/env/isArch.js\"\nimport { isUbuntu } from \"../utils/env/isUbuntu.js\"\nimport { extract7Zip } from \"../utils/setup/extract.js\"\nimport { type InstallationInfo, type PackageInfo, setupBin } from \"../utils/setup/setupBin.js\"\nimport { setupChocoPack } from \"../utils/setup/setupChocoPack.js\"\nimport { setupDnfPack } from \"../utils/setup/setupDnfPack.js\"\nimport { setupPacmanPack } from \"../utils/setup/setupPacmanPack.js\"\nimport { compareVersion } from \"../utils/setup/version.js\"\n\nconst dirname = typeof __dirname === \"string\" ? __dirname : path.dirname(fileURLToPath(import.meta.url))\n\nasync function getGccPackageInfo(version: string, platform: NodeJS.Platform, arch: string): Promise {\n switch (platform) {\n case \"win32\": {\n const mingwAssets = await loadAssetList(\n join(dirname, \"github_brechtsanders_winlibs_mingw.json\"),\n )\n\n const mingwArchMap = {\n x64: \"x86_64\",\n ia32: \"i386\",\n } as Record\n\n const asset = matchAsset(\n mingwAssets,\n {\n version,\n keywords: [\n mingwArchMap[arch] ?? arch,\n ],\n },\n )\n\n if (asset === undefined) {\n throw new Error(`No asset found for version ${version} and arch ${arch}`)\n }\n\n return {\n binRelativeDir: \"bin/\",\n binFileName: addExeExt(\"g++\"),\n extractedFolderName: \"mingw64\",\n extractFunction: extract7Zip,\n url: `https://github.com/brechtsanders/winlibs_mingw/releases/download/${asset.tag}/${asset.name}`,\n }\n }\n default:\n throw new Error(`Unsupported platform '${platform}'`)\n }\n}\n\nexport async function setupGcc(version: string, setupDir: string, arch: string, priority: number = 40) {\n let installationInfo: InstallationInfo | undefined\n switch (process.platform) {\n case \"win32\": {\n if (arch === \"arm\" || arch === \"arm64\") {\n await setupChocoPack(\"gcc-arm-embedded\", version)\n }\n try {\n installationInfo = await setupBin(\"g++\", version, getGccPackageInfo, setupDir, arch)\n } catch (err) {\n info(`Failed to download g++ binary. ${err}. Falling back to chocolatey.`)\n installationInfo = await setupChocoMingw(version, arch)\n }\n break\n }\n case \"darwin\": {\n installationInfo = await installBrewPack(\"gcc\", version)\n break\n }\n case \"linux\": {\n if (arch === \"x64\") {\n if (isArch()) {\n installationInfo = await setupPacmanPack(\"gcc\", version)\n } else if (hasDnf()) {\n installationInfo = await setupDnfPack([\n { name: \"gcc\", version },\n { name: \"gcc-c++\", version },\n { name: \"libstdc++-devel\" },\n ])\n } else if (isUbuntu()) {\n if (version === \"\") {\n // the default version\n installationInfo = await installAptPack([{ name: \"gcc\" }, { name: \"g++\" }])\n } else {\n // add the PPA for access to more versions\n installationInfo = await installAptPack([\n {\n name: \"gcc\",\n version,\n repository: \"ppa:ubuntu-toolchain-r/test\",\n key: { key: \"1E9377A2BA9EF27F\", fileName: \"ubuntu-toolchain-r-test.gpg\" },\n },\n {\n name: \"g++\",\n version,\n repository: \"ppa:ubuntu-toolchain-r/test\",\n key: { key: \"1E9377A2BA9EF27F\", fileName: \"ubuntu-toolchain-r-test.gpg\" },\n },\n ])\n }\n }\n } else {\n info(`Install g++-multilib because gcc for ${arch} was requested`)\n if (isArch()) {\n installationInfo = await setupPacmanPack(\"gcc-multilib\", version)\n } else if (isUbuntu()) {\n if (version === \"\") {\n // the default version\n installationInfo = await installAptPack([{ name: \"gcc-multilib\" }])\n } else {\n // add the PPA for access to more versions\n installationInfo = await installAptPack([{\n name: \"gcc-multilib\",\n version,\n repository: \"ppa:ubuntu-toolchain-r/test\",\n key: { key: \"1E9377A2BA9EF27F\", fileName: \"ubuntu-toolchain-r-test.gpg\" },\n }])\n }\n }\n }\n break\n }\n // TODO support bare-metal (need to support passing it as the input)\n // TODO support abi\n // case \"none\": {\n // if (arch === \"arm\" || arch === \"arm64\") {\n // return installAptPack(\"gcc-arm-none-eabi\", version, [\n // \"ppa:ubuntu-toolchain-r/test\",\n // ])\n // } else {\n // throw new Error(`Unsupported platform for ${arch}`)\n // }\n // }\n default: {\n throw new Error(`Unsupported platform for ${arch}`)\n }\n }\n if (installationInfo !== undefined) {\n await activateGcc(version, installationInfo.binDir, priority)\n return installationInfo\n }\n return undefined\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport async function setupMingw(version: string, setupDir: string, arch: string) {\n let installationInfo: InstallationInfo | undefined\n switch (process.platform) {\n case \"win32\":\n case \"darwin\": {\n return setupGcc(version, setupDir, arch)\n }\n case \"linux\": {\n if (isArch()) {\n installationInfo = await setupPacmanPack(\"mingw-w64-gcc\", version)\n } else if (hasDnf()) {\n installationInfo = await setupDnfPack([{ name: \"mingw64-gcc\", version }])\n } else if (isUbuntu()) {\n installationInfo = await installAptPack([\n {\n name: \"mingw-w64\",\n version,\n repository: \"ppa:ubuntu-toolchain-r/test\",\n key: { key: \"1E9377A2BA9EF27F\", fileName: \"ubuntu-toolchain-r-test.gpg\" },\n },\n ])\n }\n break\n }\n default: {\n throw new Error(`Unsupported platform for ${arch}`)\n }\n }\n if (installationInfo !== undefined) {\n // TODO: setup alternatives and update CC/CXX env. ?\n // Setting up g++-mingw-w64-i686-win32 (10.3.0-14ubuntu1+24.3) ...\n // update-alternatives: using /usr/bin/i686-w64-mingw32-g++-win32 to provide /usr/bin/i686-w64-mingw32-g++ (i686-w64-mingw32-g++) in auto mode\n // Setting up g++-mingw-w64-x86-64-win32 (10.3.0-14ubuntu1+24.3) ...\n // update-alternatives: using /usr/bin/x86_64-w64-mingw32-g++-win32 to provide /usr/bin/x86_64-w64-mingw32-g++ (x86_64-w64-mingw32-g++) in auto mode\n // await activateGcc(version, installationInfo.binDir)\n return installationInfo\n }\n return undefined\n}\n\nasync function setupChocoMingw(version: string, arch: string): Promise {\n await setupChocoPack(\"mingw\", version)\n let binDir: string | undefined\n if (arch === \"x64\" && (await pathExists(\"C:/tools/mingw64/bin\"))) {\n binDir = \"C:/tools/mingw64/bin\"\n await addPath(binDir, rcOptions)\n } else if (arch === \"ia32\" && (await pathExists(\"C:/tools/mingw32/bin\"))) {\n binDir = \"C:/tools/mingw32/bin\"\n await addPath(binDir, rcOptions)\n } else if (await pathExists(`${process.env.ChocolateyInstall ?? \"C:/ProgramData/chocolatey\"}/bin/g++.exe`)) {\n binDir = `${process.env.ChocolateyInstall ?? \"C:/ProgramData/chocolatey\"}/bin`\n }\n if (binDir !== undefined) {\n return { binDir }\n }\n return undefined\n}\n\n/** Setup gcc as the compiler */\nasync function activateGcc(givenVersion: string, binDir: string, priority: number = 40) {\n const promises: Promise[] = []\n\n if (process.platform === \"win32\") {\n promises.push(\n addEnv(\"CC\", addExeExt(`${binDir}/gcc`), rcOptions),\n addEnv(\"CXX\", addExeExt(`${binDir}/g++`), rcOptions),\n )\n } else {\n // if version is empty, get the version from the gcc command\n let version = givenVersion\n if (givenVersion === \"\") {\n version = await getGccCmdVersion(binDir, version)\n info(`Using gcc version ${version}`)\n }\n\n const majorVersion = semverMajor(semverCoerce(version) ?? version)\n if (majorVersion >= 5) {\n promises.push(\n addEnv(\"CC\", `${binDir}/gcc-${majorVersion}`, rcOptions),\n addEnv(\"CXX\", `${binDir}/g++-${majorVersion}`, rcOptions),\n )\n\n if (isUbuntu()) {\n promises.push(\n addUpdateAlternativesToRc(\"cc\", `${binDir}/gcc-${majorVersion}`, rcOptions, priority),\n addUpdateAlternativesToRc(\"cxx\", `${binDir}/g++-${majorVersion}`, rcOptions, priority),\n addUpdateAlternativesToRc(\"gcc\", `${binDir}/gcc-${majorVersion}`, rcOptions, priority),\n addUpdateAlternativesToRc(\"g++\", `${binDir}/g++-${majorVersion}`, rcOptions, priority),\n )\n }\n } else {\n promises.push(\n addEnv(\"CC\", `${binDir}/gcc-${version}`, rcOptions),\n addEnv(\"CXX\", `${binDir}/g++-${version}`, rcOptions),\n )\n\n if (isUbuntu()) {\n promises.push(\n addUpdateAlternativesToRc(\"cc\", `${binDir}/gcc-${version}`, rcOptions, priority),\n addUpdateAlternativesToRc(\"cxx\", `${binDir}/g++-${version}`, rcOptions, priority),\n addUpdateAlternativesToRc(\"gcc\", `${binDir}/gcc-${version}`, rcOptions, priority),\n addUpdateAlternativesToRc(\"g++\", `${binDir}/g++-${version}`, rcOptions, priority),\n )\n }\n }\n }\n\n promises.push(setupMacOSSDK())\n\n // TODO\n // const ld = process.env.LD_LIBRARY_PATH ?? \"\"\n // const dyld = process.env.DYLD_LIBRARY_PATH ?? \"\"\n // promises.push(\n // addEnv(\"LD_LIBRARY_PATH\", `${installDir}/lib${path.delimiter}${ld}`, rcOptions),\n // addEnv(\"DYLD_LIBRARY_PATH\", `${installDir}/lib${path.delimiter}${dyld}`, rcOptions),\n // addEnv(\"CPATH\", `${installDir}/lib/gcc/${majorVersion}/include`, rcOptions),\n // addEnv(\"LDFLAGS\", `-L${installDir}/lib`, rcOptions),\n // addEnv(\"CPPFLAGS\", `-I${installDir}/include`, rcOptions),\n // )\n\n if (GITHUB_ACTIONS) {\n await addGccLoggingMatcher()\n }\n\n await Promise.all(promises)\n}\n\nasync function getGccCmdVersion(binDir: string, givenVersion: string) {\n // TODO get the version from the package manager\n try {\n let gccExe = \"gcc\"\n if (await pathExists(`${binDir}/gcc`)) {\n gccExe = `${binDir}/gcc`\n } else {\n // try to find the gcc exe in the bin dir\n const files = (await readdir(binDir)).sort(\n (exe1, exe2) => {\n const version1 = exe1.match(/^gcc-?(.*)(\\.exe)?$/)?.[1] ?? \"\"\n const version2 = exe2.match(/^gcc-?(.*)(\\.exe)?$/)?.[1] ?? \"\"\n return compareVersion(version1, version2)\n },\n )\n for (const file of files) {\n if (file.startsWith(\"gcc\")) {\n gccExe = `${binDir}/${file}`\n break\n }\n }\n }\n\n const { stdout: versionStdout } = await execa(gccExe, [\"--version\"], { stdio: \"pipe\" })\n\n // gcc-11 (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0\n // gcc-12 (Homebrew GCC 12.4.0) 12.4.0\n // gcc (Ubuntu 13.1.0-8ubuntu1~22.04) 13.1.0\n\n const versionMatch = (versionStdout as string).match(/gcc.* \\(.*\\) ([\\d.]+)/)\n\n if (versionMatch !== null) {\n return versionMatch[1]\n }\n\n warning(`Failed to parse gcc version from: ${versionStdout}`)\n return givenVersion\n } catch (err) {\n error(`Failed to get gcc version: ${err}`)\n return givenVersion\n }\n}\n\nasync function addGccLoggingMatcher() {\n const matcherPath = join(dirname, \"gcc_matcher.json\")\n if (!(await pathExists(matcherPath))) {\n return warning(\"the gcc_matcher.json file does not exist in the same folder as setup-cpp.js\")\n }\n info(`::add-matcher::${matcherPath}`)\n}\n","import { addEnv } from \"envosman\"\nimport semverMajor from \"semver/functions/major\"\nimport semverValid from \"semver/functions/valid\"\nimport { rcOptions } from \"../cli-options.js\"\nimport { setupPipPack } from \"../utils/setup/setupPipPack.js\"\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function setupGcovr(version: string | undefined, _setupDir: string, _arch: string) {\n return setupPipPack(\"gcovr\", version)\n}\n\nexport function activateGcovLLVM() {\n return addEnv(\"GCOV\", \"llvm-cov gcov\", rcOptions)\n}\n\nexport function activateGcovGCC(gccVersion: string) {\n const gccSemver = semverValid(gccVersion)\n const gccMajor = gccSemver !== null ? semverMajor(gccSemver) : gccVersion\n const gcov = gccMajor !== \"\" ? `gcov-${gccMajor}` : \"gcov\"\n\n return addEnv(\"GCOV\", gcov, rcOptions)\n}\n","import path, { basename, join } from \"path\"\nimport { fileURLToPath } from \"url\"\nimport { info } from \"ci-log\"\nimport { addExeExt } from \"patha\"\nimport { loadAssetList, matchAsset } from \"../utils/asset/load-assets.js\"\nimport { arm64, x86_64 } from \"../utils/env/arch.js\"\nimport { type InstallationInfo, type PackageInfo, setupBin } from \"../utils/setup/setupBin.js\"\n\nconst dirname = typeof __dirname === \"string\" ? __dirname : path.dirname(fileURLToPath(import.meta.url))\n\n/** Get the platform data for infer */\nasync function getInferPackageInfo(version: string, platform: NodeJS.Platform, arch: string): Promise {\n const { keywords, optionalKeywords } = getAssetKeywords(platform, arch)\n\n // first check the github releases\n const inferGitHubAssets = await loadAssetList(\n join(dirname, \"github_facebook_infer.json\"),\n )\n const ghAsset = matchAsset(\n inferGitHubAssets,\n {\n version,\n keywords,\n optionalKeywords,\n filterMapTag(tag) {\n return tag.replace(/^v/, \"\")\n },\n },\n )\n\n if (ghAsset !== undefined) {\n return {\n url: `https://github.com/facebook/infer/releases/download/${ghAsset.tag}/${ghAsset.name}`,\n extractedFolderName: `${basename(ghAsset.name, \".tar.xz\")}`,\n binRelativeDir: \"bin\",\n binFileName: addExeExt(\"infer\"),\n }\n }\n\n throw new Error(`No asset found for version ${version} matching ${keywords} and ${optionalKeywords}`)\n}\n\n/** Setup infer */\nexport function setupInfer(version: string, setupDir: string, arch: string): Promise {\n return setupBin(\"infer\", version, getInferPackageInfo, setupDir, arch)\n}\n\nfunction getAssetKeywords(platform: string, arch: string) {\n const keywords: string[] = []\n const optionalKeywords: string[] = []\n\n switch (platform) {\n case \"linux\": {\n keywords.push(\"linux\")\n\n if (x86_64.includes(arch)) {\n optionalKeywords.push(\"64\")\n optionalKeywords.push(\"x86_64\")\n } else {\n info(`Using arch ${arch} for infer`)\n keywords.push(arch)\n }\n break\n }\n case \"darwin\": {\n keywords.push(\"osx\")\n\n if (x86_64.includes(arch)) {\n optionalKeywords.push(\"x86_64\")\n } else if (arm64.includes(arch)) {\n // allow falling back to x86_64 if arm64 is not available\n optionalKeywords.push(\"arm64\")\n } else {\n info(`Using arch ${arch} for infer`)\n keywords.push(arch)\n }\n break\n }\n default:\n info(`Using ${platform} ${arch} for infer`)\n keywords.push(platform, arch)\n break\n }\n return { keywords, optionalKeywords }\n}\n","import { addExeExt } from \"patha\"\nimport { arm64, x86, x86_64 } from \"../utils/env/arch.js\"\nimport { type InstallationInfo, type PackageInfo, setupBin } from \"../utils/setup/setupBin.js\"\n\n/** Get the platform name Ninja uses in their download links */\nfunction getNinjaPlatformArch(platform: NodeJS.Platform, arch: string) {\n switch (platform) {\n case \"win32\":\n return x86_64.includes(arch)\n || x86.includes(arch)\n ? \"win\"\n : arm64.includes(arch)\n ? \"winarm64\"\n : \"win\"\n case \"darwin\":\n return \"mac\"\n case \"linux\":\n return x86_64.includes(arch)\n || x86.includes(arch)\n ? \"linux\"\n : arm64.includes(arch)\n ? \"linux-aarch64\"\n : \"linux\"\n default:\n throw new Error(`Unsupported platform '${platform}'`)\n }\n}\n\n/** Get the platform data for ninja */\nfunction getNinjaPackageInfo(version: string, platform: NodeJS.Platform, arch: string): PackageInfo {\n const ninjaPlatform = getNinjaPlatformArch(platform, arch)\n return {\n binRelativeDir: \"\",\n binFileName: addExeExt(\"ninja\"),\n extractedFolderName: \"\",\n url: `https://github.com/ninja-build/ninja/releases/download/v${version}/ninja-${ninjaPlatform}.zip`,\n }\n}\n\nexport function setupNinja(version: string, setupDir: string, arch: string): Promise {\n return setupBin(\"ninja\", version, getNinjaPackageInfo, setupDir, arch)\n}\n","import path, { join } from \"path\"\nimport { fileURLToPath } from \"url\"\nimport { info } from \"ci-log\"\nimport { execa } from \"execa\"\nimport { addExeExt } from \"patha\"\nimport { installAptPack } from \"setup-apt\"\nimport { untildifyUser } from \"untildify-user\"\nimport which from \"which\"\nimport { setupCmake } from \"../cmake/cmake.js\"\nimport { setupNinja } from \"../ninja/ninja.js\"\nimport { hasDnf } from \"../utils/env/hasDnf.js\"\nimport { isArch } from \"../utils/env/isArch.js\"\nimport { isUbuntu } from \"../utils/env/isUbuntu.js\"\nimport { ubuntuVersion } from \"../utils/env/ubuntu_version.js\"\nimport { extractTarByExe } from \"../utils/setup/extract.js\"\nimport { type InstallationInfo, type PackageInfo, setupBin } from \"../utils/setup/setupBin.js\"\nimport { setupDnfPack } from \"../utils/setup/setupDnfPack.js\"\nimport { setupPacmanPack } from \"../utils/setup/setupPacmanPack.js\"\nimport { addVPrefix, removeVPrefix } from \"../utils/setup/version.js\"\nimport { getVersion } from \"../versions/versions.js\"\n\nconst dirname = typeof __dirname === \"string\" ? __dirname : path.dirname(fileURLToPath(import.meta.url))\n\nfunction getDownloadKcovPackageInfo(version: string): PackageInfo {\n return {\n url: `https://github.com/SimonKagstrom/kcov/releases/download/${version}/kcov-amd64.tar.gz`,\n extractedFolderName: \"\",\n binRelativeDir: \"usr/local/bin\",\n binFileName: addExeExt(\"kcov\"),\n }\n}\n\nfunction getBuildKcovPackageInfo(version: string): PackageInfo {\n return {\n url: `https://github.com/SimonKagstrom/kcov/archive/refs/tags/${version}.tar.gz`,\n extractedFolderName: \"\",\n binRelativeDir: \"build/src\",\n binFileName: addExeExt(\"kcov\"),\n extractFunction: buildKcov,\n }\n}\n\nasync function buildKcov(file: string, dest: string) {\n const out = await extractTarByExe(file, dest, 1)\n\n // build after extraction using CMake\n const cmake = await getCmake()\n\n if (process.platform === \"linux\") {\n if (isArch()) {\n await Promise.all([setupPacmanPack(\"libdwarf\"), setupPacmanPack(\"libcurl-openssl\")])\n } else if (hasDnf()) {\n await setupDnfPack([{ name: \"libdwarf-devel\" }, { name: \"libcurl-devel\" }])\n } else if (isUbuntu()) {\n await installAptPack([{ name: \"libdw-dev\" }, { name: \"libcurl4-openssl-dev\" }])\n }\n }\n\n // apply gcc13.patch\n try {\n if (which.sync(\"patch\", { nothrow: true }) !== null) {\n const patch = join(dirname, \"gcc13.patch\")\n await execa(\"patch\", [\"-N\", \"-p1\", \"-i\", patch], { cwd: out, stdio: \"inherit\" })\n } else {\n info(\"`patch` not found, skipping gcc13.patch, kcov may not build on gcc 13\")\n }\n } catch {\n // ignore\n }\n\n const buildDir = join(out, \"build\")\n await execa(cmake, [\"-S\", out, \"-B\", buildDir, \"-DCMAKE_BUILD_TYPE=Release\", \"-G\", \"Ninja\"], {\n cwd: out,\n stdio: \"inherit\",\n })\n await execa(cmake, [\"--build\", buildDir, \"--config\", \"Release\"], { cwd: out, stdio: \"inherit\" })\n // execRootSync(cmake, [\"--install\", buildDir], out)\n // return \"user/local/bin\" // the cmake install prefix\n return out\n}\n\nasync function getCmake() {\n let cmake = which.sync(\"cmake\", { nothrow: true })\n if (cmake === null) {\n const { binDir } = await setupCmake(\n getVersion(\"cmake\", undefined, await ubuntuVersion()),\n join(untildifyUser(\"~\"), \"cmake\"),\n \"\",\n )\n cmake = join(binDir, \"cmake\")\n }\n const ninja = which.sync(\"ninja\", { nothrow: true })\n if (ninja === null) {\n await setupNinja(getVersion(\"ninja\", undefined, await ubuntuVersion()), join(untildifyUser(\"~\"), \"ninja\"), \"\")\n }\n return cmake\n}\n\nexport async function setupKcov(versionGiven: string, setupDir: string, arch: string) {\n if (process.platform !== \"linux\") {\n info(\"Kcov is not supported on non-linux\")\n return\n }\n\n // parse version\n const versionSplit = versionGiven.split(\"-\")\n let version = addVPrefix(versionSplit[0])\n const installMethod = versionSplit[1] as \"binary\" | undefined\n const version_number = removeVPrefix(version)\n // fix inconsistency in tagging\n if (version_number === 38) {\n version = \"v38\"\n }\n\n let installationInfo: InstallationInfo\n if (installMethod === \"binary\" && version_number >= 39) {\n installationInfo = await setupBin(\"kcov\", version, getDownloadKcovPackageInfo, setupDir, arch)\n if (isArch()) {\n await setupPacmanPack(\"binutils\")\n } else if (hasDnf()) {\n await setupDnfPack([{ name: \"binutils\" }])\n } else if (isUbuntu()) {\n await installAptPack([{ name: \"libbinutils\" }])\n }\n return installationInfo\n } else {\n installationInfo = await setupBin(\"kcov\", version, getBuildKcovPackageInfo, setupDir, arch)\n }\n return installationInfo\n}\n","import { error } from \"console\"\nimport { notice } from \"ci-log\"\nimport { addEnv } from \"envosman\"\nimport which from \"which\"\nimport { rcOptions } from \"../cli-options.js\"\n\nexport async function setupAppleClang() {\n if (process.platform !== \"darwin\") {\n return\n }\n\n if (await which(\"clang\", { nothrow: true }) !== null && await which(\"clang++\", { nothrow: true }) !== null) {\n notice(\"Assuming clang is an Apple Clang compiler\")\n await Promise.all([addEnv(\"CC\", \"clang\", rcOptions), addEnv(\"CXX\", \"clang++\", rcOptions)])\n }\n\n // TODO install Apple Clang automatically\n error(\"Apple Clang automatic installation is not supported yet\")\n}\n","const core = require('@actions/core')\nconst child_process = require('child_process')\nconst fs = require('fs')\nconst path = require('path')\nconst process = require('process')\n\nconst PROGRAM_FILES_X86 = process.env['ProgramFiles(x86)']\nconst PROGRAM_FILES = [process.env['ProgramFiles(x86)'], process.env['ProgramFiles']]\n\n\nconst EDITIONS = ['Enterprise', 'Professional', 'Community', 'BuildTools']\nconst YEARS = ['2022', '2019', '2017']\n\nconst VsYearVersion = {\n '2022': '17.0',\n '2019': '16.0',\n '2017': '15.0',\n '2015': '14.0',\n '2013': '12.0',\n}\n\n/**\n * Convert the vs version (e.g. 2022) or year (e.g. 17.0) to the version number (e.g. 17.0)\n * @param {string | undefined} vsversion the year (e.g. 2022) or version number (e.g. 17.0)\n * @returns {string | undefined} the version number (e.g. 17.0)\n */\nfunction vsversion_to_versionnumber(vsversion) {\n if (Object.values(VsYearVersion).includes(vsversion)) {\n return vsversion\n } else {\n if (vsversion in VsYearVersion) {\n return VsYearVersion[vsversion]\n }\n }\n return vsversion\n}\nexports.vsversion_to_versionnumber = vsversion_to_versionnumber\n\n/**\n * Convert the vs version (e.g. 17.0) or year (e.g. 2022) to the year (e.g. 2022)\n * @param {string} vsversion the version number (e.g. 17.0) or year (e.g. 2022)\n * @returns {string} the year (e.g. 2022)\n */\nfunction vsversion_to_year(vsversion) {\n if (Object.keys(VsYearVersion).includes(vsversion)) {\n return vsversion\n } else {\n for (const [year, ver] of Object.entries(VsYearVersion)) {\n if (ver === vsversion) {\n return year\n }\n }\n }\n return vsversion\n}\nexports.vsversion_to_year = vsversion_to_year\n\nconst VSWHERE_PATH = `${PROGRAM_FILES_X86}\\\\Microsoft Visual Studio\\\\Installer`\n\n/**\n * Find MSVC tools with vswhere\n * @param {string} pattern the pattern to search for\n * @param {string} version_pattern the version pattern to search for\n * @returns {string | null} the path to the found MSVC tools\n */\nfunction findWithVswhere(pattern, version_pattern) {\n try {\n let installationPath = child_process.execSync(`vswhere -products * ${version_pattern} -prerelease -property installationPath`).toString().trim()\n return installationPath + '\\\\' + pattern\n } catch (e) {\n core.warning(`vswhere failed: ${e}`)\n }\n return null\n}\nexports.findWithVswhere = findWithVswhere\n\n/**\n * Find the vcvarsall.bat file for the given Visual Studio version\n * @param {string | undefined} vsversion the version of Visual Studio to find (year or version number)\n * @returns {string} the path to the vcvarsall.bat file\n */\nfunction findVcvarsall(vsversion) {\n const vsversion_number = vsversion_to_versionnumber(vsversion)\n let version_pattern\n if (vsversion_number) {\n const upper_bound = vsversion_number.split('.')[0] + '.9'\n version_pattern = `-version \"${vsversion_number},${upper_bound}\"`\n } else {\n version_pattern = \"-latest\"\n }\n\n // If vswhere is available, ask it about the location of the latest Visual Studio.\n let path = findWithVswhere('VC\\\\Auxiliary\\\\Build\\\\vcvarsall.bat', version_pattern)\n if (path && fs.existsSync(path)) {\n core.info(`Found with vswhere: ${path}`)\n return path\n }\n core.info(\"Not found with vswhere\")\n\n // If that does not work, try the standard installation locations,\n // starting with the latest and moving to the oldest.\n const years = vsversion ? [vsversion_to_year(vsversion)] : YEARS\n for (const prog_files of PROGRAM_FILES) {\n for (const ver of years) {\n for (const ed of EDITIONS) {\n path = `${prog_files}\\\\Microsoft Visual Studio\\\\${ver}\\\\${ed}\\\\VC\\\\Auxiliary\\\\Build\\\\vcvarsall.bat`\n core.info(`Trying standard location: ${path}`)\n if (fs.existsSync(path)) {\n core.info(`Found standard location: ${path}`)\n return path\n }\n }\n }\n }\n core.info(\"Not found in standard locations\")\n\n // Special case for Visual Studio 2015 (and maybe earlier), try it out too.\n path = `${PROGRAM_FILES_X86}\\\\Microsoft Visual C++ Build Tools\\\\vcbuildtools.bat`\n if (fs.existsSync(path)) {\n core.info(`Found VS 2015: ${path}`)\n return path\n }\n core.info(`Not found in VS 2015 location: ${path}`)\n\n throw new Error('Microsoft Visual Studio not found')\n}\nexports.findVcvarsall = findVcvarsall\n\nfunction isPathVariable(name) {\n const pathLikeVariables = ['PATH', 'INCLUDE', 'LIB', 'LIBPATH']\n return pathLikeVariables.indexOf(name.toUpperCase()) != -1\n}\n\nfunction filterPathValue(path) {\n let paths = path.split(';')\n // Remove duplicates by keeping the first occurance and preserving order.\n // This keeps path shadowing working as intended.\n function unique(value, index, self) {\n return self.indexOf(value) === index\n }\n return paths.filter(unique).join(';')\n}\n\n/**\n * Setup MSVC Developer Command Prompt\n * @param {string} arch - Target architecture\n * @param {string | undefined} sdk - Windows SDK number to build for\n * @param {string | undefined} toolset - VC++ compiler toolset version\n * @param {boolean | 'true' | 'false' | undefined} uwp - Build for Universal Windows Platform\n * @param {boolean | 'true' | 'false' | undefined} spectre - Enable Spectre mitigations\n * @param {string | undefined} vsversion - The Visual Studio version to use. This can be the version number (e.g. 16.0 for 2019) or the year (e.g. \"2019\").\n */\nfunction setupMSVCDevCmd(arch, sdk, toolset, uwp, spectre, vsversion) {\n if (process.platform != 'win32') {\n core.info('This is not a Windows virtual environment, bye!')\n return\n }\n\n // Add standard location of \"vswhere\" to PATH, in case it's not there.\n process.env.PATH += path.delimiter + VSWHERE_PATH\n\n // There are all sorts of way the architectures are called. In addition to\n // values supported by Microsoft Visual C++, recognize some common aliases.\n let arch_aliases = {\n \"win32\": \"x86\",\n \"win64\": \"x64\",\n \"x86_64\": \"x64\",\n \"x86-64\": \"x64\",\n }\n // Ignore case when matching as that's what humans expect.\n if (arch.toLowerCase() in arch_aliases) {\n arch = arch_aliases[arch.toLowerCase()]\n }\n\n // Due to the way Microsoft Visual C++ is configured, we have to resort to the following hack:\n // Call the configuration batch file and then output *all* the environment variables.\n\n var args = [arch]\n\n if (uwp && JSON.parse(uwp) === true) {\n args.push('uwp')\n }\n if (sdk) {\n args.push(sdk)\n }\n if (toolset) {\n args.push(`-vcvars_ver=${toolset}`)\n }\n if (spectre && JSON.parse(spectre) === true) {\n args.push('-vcvars_spectre_libs=spectre')\n }\n\n const vcvars = `\"${findVcvarsall(vsversion)}\" ${args.join(' ')}`\n core.debug(`vcvars command-line: ${vcvars}`)\n\n const cmd_output_string = child_process.execSync(`set && cls && ${vcvars} && cls && set`, {shell: \"cmd\"}).toString()\n const cmd_output_parts = cmd_output_string.split('\\f')\n\n const old_environment = cmd_output_parts[0].split('\\r\\n')\n const vcvars_output = cmd_output_parts[1].split('\\r\\n')\n const new_environment = cmd_output_parts[2].split('\\r\\n')\n\n // If vsvars.bat is given an incorrect command line, it will print out\n // an error and *still* exit successfully. Parse out errors from output\n // which don't look like environment variables, and fail if appropriate.\n const error_messages = vcvars_output.filter((line) => {\n if (line.match(/^\\[ERROR.*\\]/)) {\n // Don't print this particular line which will be confusing in output.\n if (!line.match(/Error in script usage. The correct usage is:$/)) {\n return true\n }\n }\n return false\n })\n if (error_messages.length > 0) {\n throw new Error('invalid parameters' + '\\r\\n' + error_messages.join('\\r\\n'))\n }\n\n // Convert old environment lines into a dictionary for easier lookup.\n let old_env_vars = {}\n for (let string of old_environment) {\n const [name, value] = string.split('=')\n old_env_vars[name] = value\n }\n\n // Now look at the new environment and export everything that changed.\n // These are the variables set by vsvars.bat. Also export everything\n // that was not there during the first sweep: those are new variables.\n core.startGroup('Environment variables')\n for (let string of new_environment) {\n // vsvars.bat likes to print some fluff at the beginning.\n // Skip lines that don't look like environment variables.\n if (!string.includes('=')) {\n continue;\n }\n let [name, new_value] = string.split('=')\n let old_value = old_env_vars[name]\n // For new variables \"old_value === undefined\".\n if (new_value !== old_value) {\n core.info(`Setting ${name}`)\n // Special case for a bunch of PATH-like variables: vcvarsall.bat\n // just prepends its stuff without checking if its already there.\n // This makes repeated invocations of this action fail after some\n // point, when the environment variable overflows. Avoid that.\n if (isPathVariable(name)) {\n new_value = filterPathValue(new_value)\n }\n core.exportVariable(name, new_value)\n }\n }\n core.endGroup()\n\n core.info(`Configured Developer Command Prompt`)\n}\nexports.setupMSVCDevCmd = setupMSVCDevCmd\n","// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport { info } from \"ci-log\"\nimport { addEnv } from \"envosman\"\nimport { setupMSVCDevCmd } from \"msvc-dev-cmd/lib.js\"\nimport { pathExists } from \"path-exists\"\nimport { rcOptions } from \"../cli-options.js\"\n\nfunction getArch(arch: string): string {\n switch (arch) {\n case \"x32\":\n case \"32\":\n case \"ia32\": {\n return \"x86\"\n }\n case \"64\": {\n return \"x64\"\n }\n default: {\n return arch\n }\n }\n}\n\nexport async function setupVCVarsall(\n vsversion: string,\n VCTargetsPath: string | undefined,\n arch: string,\n toolset: string | undefined,\n sdk?: string,\n uwp?: boolean,\n spectre?: boolean,\n) {\n if (VCTargetsPath !== undefined && (await pathExists(VCTargetsPath))) {\n info(`Adding ${VCTargetsPath} to PATH`)\n await addEnv(\"VCTargetsPath\", VCTargetsPath, rcOptions)\n }\n\n await setupMSVCDevCmd(getArch(arch), sdk, toolset, uwp, spectre, vsversion)\n}\n","import { join } from \"path\"\nimport { endGroup, startGroup } from \"@actions/core\"\nimport { error } from \"ci-log\"\nimport pTimeout from \"p-timeout\"\nimport { setupBrew } from \"setup-brew\"\nimport { getSuccessMessage, rcOptions } from \"./cli-options.js\"\nimport { type ToolName, llvmTools, setups } from \"./tool.js\"\nimport type { InstallationInfo } from \"./utils/setup/setupBin.js\"\nimport { setupVCVarsall } from \"./vcvarsall/vcvarsall.js\"\nimport { getVersion } from \"./versions/versions.js\"\n\nexport const DEFAULT_TIMEOUT = 20 * 60 * 1000 // 20 minutes\n\nexport async function installTool(\n tool: ToolName,\n version: string,\n osVersion: number[] | null,\n arch: string,\n setupCppDir: string,\n successMessages: string[],\n errorMessages: string[],\n timeout: number = DEFAULT_TIMEOUT,\n) {\n startGroup(`Installing ${tool} ${version}`)\n try {\n await pTimeout(installToolImpl(tool, version, osVersion, arch, setupCppDir, successMessages), {\n milliseconds: timeout,\n message: `Timeout while installing ${tool} ${version}. You can increase the timeout from options`,\n })\n } catch (e) {\n // push error message to the logger\n error(e as string | Error)\n if (e instanceof Error && e.stack !== undefined) {\n error(e.stack)\n }\n errorMessages.push(`${tool} failed to install`)\n }\n endGroup()\n}\n\nasync function installToolImpl(\n tool: ToolName,\n version: string,\n osVersion: number[] | null,\n arch: string,\n setupCppDir: string,\n successMessages: string[],\n) {\n const hasLLVM = llvmTools.includes(tool)\n\n let installationInfo: InstallationInfo | undefined | void\n if (tool === \"vcvarsall\") {\n // eslint-disable-next-line no-await-in-loop\n await setupVCVarsall(getVersion(tool, version, osVersion), undefined, arch, undefined, undefined, false, false)\n } else if (tool === \"brew\") {\n // eslint-disable no-await-in-loop\n installationInfo = await setupBrew({ rcOptions })\n } else {\n // the tool installation directory (for the functions that ue it)\n const setupDir = join(setupCppDir, hasLLVM ? \"llvm\" : tool)\n\n const setupVersion = getVersion(tool, version, osVersion)\n\n // get the setup function\n const setupFunction = setups[tool]\n\n // eslint-disable no-await-in-loop\n installationInfo = await setupFunction(setupVersion, setupDir, arch)\n }\n // preparing a report string\n successMessages.push(getSuccessMessage(tool, installationInfo))\n}\n","export class TimeoutError extends Error {\n\tconstructor(message) {\n\t\tsuper(message);\n\t\tthis.name = 'TimeoutError';\n\t}\n}\n\n/**\nAn error to be thrown when the request is aborted by AbortController.\nDOMException is thrown instead of this Error when DOMException is available.\n*/\nexport class AbortError extends Error {\n\tconstructor(message) {\n\t\tsuper();\n\t\tthis.name = 'AbortError';\n\t\tthis.message = message;\n\t}\n}\n\n/**\nTODO: Remove AbortError and just throw DOMException when targeting Node 18.\n*/\nconst getDOMException = errorMessage => globalThis.DOMException === undefined\n\t? new AbortError(errorMessage)\n\t: new DOMException(errorMessage);\n\n/**\nTODO: Remove below function and just 'reject(signal.reason)' when targeting Node 18.\n*/\nconst getAbortedReason = signal => {\n\tconst reason = signal.reason === undefined\n\t\t? getDOMException('This operation was aborted.')\n\t\t: signal.reason;\n\n\treturn reason instanceof Error ? reason : getDOMException(reason);\n};\n\nexport default function pTimeout(promise, options) {\n\tconst {\n\t\tmilliseconds,\n\t\tfallback,\n\t\tmessage,\n\t\tcustomTimers = {setTimeout, clearTimeout},\n\t} = options;\n\n\tlet timer;\n\n\tconst wrappedPromise = new Promise((resolve, reject) => {\n\t\tif (typeof milliseconds !== 'number' || Math.sign(milliseconds) !== 1) {\n\t\t\tthrow new TypeError(`Expected \\`milliseconds\\` to be a positive number, got \\`${milliseconds}\\``);\n\t\t}\n\n\t\tif (options.signal) {\n\t\t\tconst {signal} = options;\n\t\t\tif (signal.aborted) {\n\t\t\t\treject(getAbortedReason(signal));\n\t\t\t}\n\n\t\t\tsignal.addEventListener('abort', () => {\n\t\t\t\treject(getAbortedReason(signal));\n\t\t\t});\n\t\t}\n\n\t\tif (milliseconds === Number.POSITIVE_INFINITY) {\n\t\t\tpromise.then(resolve, reject);\n\t\t\treturn;\n\t\t}\n\n\t\t// We create the error outside of `setTimeout` to preserve the stack trace.\n\t\tconst timeoutError = new TimeoutError();\n\n\t\ttimer = customTimers.setTimeout.call(undefined, () => {\n\t\t\tif (fallback) {\n\t\t\t\ttry {\n\t\t\t\t\tresolve(fallback());\n\t\t\t\t} catch (error) {\n\t\t\t\t\treject(error);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (typeof promise.cancel === 'function') {\n\t\t\t\tpromise.cancel();\n\t\t\t}\n\n\t\t\tif (message === false) {\n\t\t\t\tresolve();\n\t\t\t} else if (message instanceof Error) {\n\t\t\t\treject(message);\n\t\t\t} else {\n\t\t\t\ttimeoutError.message = message ?? `Promise timed out after ${milliseconds} milliseconds`;\n\t\t\t\treject(timeoutError);\n\t\t\t}\n\t\t}, milliseconds);\n\n\t\t(async () => {\n\t\t\ttry {\n\t\t\t\tresolve(await promise);\n\t\t\t} catch (error) {\n\t\t\t\treject(error);\n\t\t\t}\n\t\t})();\n\t});\n\n\tconst cancelablePromise = wrappedPromise.finally(() => {\n\t\tcancelablePromise.clear();\n\t});\n\n\tcancelablePromise.clear = () => {\n\t\tcustomTimers.clearTimeout.call(undefined, timer);\n\t\ttimer = undefined;\n\t};\n\n\treturn cancelablePromise;\n}\n","import path, { join } from \"path\"\nimport { fileURLToPath } from \"url\"\nimport { info } from \"ci-log\"\nimport { addExeExt } from \"patha\"\nimport { loadAssetList, matchAsset } from \"../utils/asset/load-assets.js\"\nimport { arm64, armv7, powerpc64le, sparc64, x86, x86_64 } from \"../utils/env/arch.js\"\nimport { hasDnf } from \"../utils/env/hasDnf.js\"\nimport { isUbuntu } from \"../utils/env/isUbuntu.js\"\nimport { ubuntuVersion } from \"../utils/env/ubuntu_version.js\"\nimport { extractExe, extractTarByExe } from \"../utils/setup/extract.js\"\nimport type { PackageInfo } from \"../utils/setup/setupBin.js\"\n\nconst dirname = typeof __dirname === \"string\" ? __dirname : path.dirname(fileURLToPath(import.meta.url))\n\nexport async function getLLVMPackageInfo(\n version: string,\n platform: NodeJS.Platform,\n arch: string,\n): Promise {\n const url = await getLLVMAssetURL(platform, arch, version)\n info(`Downloading LLVM from ${url}`)\n\n return {\n url,\n extractedFolderName: \"\",\n binRelativeDir: \"bin\",\n binFileName: addExeExt(\"clang\"),\n extractFunction: platform === \"win32\"\n ? extractExe\n : (file: string, dest: string) => {\n return extractTarByExe(file, dest, 1)\n },\n }\n}\n\nexport async function getLLVMAssetURL(platform: string, arch: string, version: string) {\n const { keywords, optionalKeywords } = await getAssetKeywords(platform, arch)\n\n // first check the github releases\n const llvmGitHubAssets = await loadAssetList(\n join(dirname, \"github_llvm_llvm-project.json\"),\n )\n const ghAsset = matchAsset(\n llvmGitHubAssets,\n {\n version,\n keywords,\n optionalKeywords,\n filterMapTag(tag) {\n return tag.replace(/^llvmorg-/, \"\")\n },\n },\n )\n\n if (ghAsset !== undefined) {\n return `https://github.com/llvm/llvm-project/releases/download/${ghAsset.tag}/${ghAsset.name}`\n }\n\n // check the llvm website\n const llvmWebsiteAssets = await loadAssetList(\n join(dirname, \"llvm_org_releases.json\"),\n )\n\n const websiteAsset = matchAsset(\n llvmWebsiteAssets,\n {\n version,\n keywords,\n optionalKeywords,\n },\n )\n\n if (websiteAsset !== undefined) {\n return `https://releases.llvm.org/${websiteAsset.tag}/${websiteAsset.name}`\n }\n\n throw new Error(`No asset found for version ${version} matching ${keywords} and ${optionalKeywords}`)\n}\n\nasync function getAssetKeywords(platform: string, arch: string) {\n const keywords: string[] = []\n const optionalKeywords: string[] = []\n\n switch (platform) {\n case \"win32\": {\n if (x86_64.includes(arch)) {\n keywords.push(\"win64\")\n // TODO fallback to win32 if win64 is not available (e.g. for LLVM 3.6.2 and older)\n } else if (x86.includes(arch)) {\n keywords.push(\"win32\")\n } else if (arm64.includes(arch)) {\n keywords.push(\"woa64\")\n } else {\n info(`Using arch ${arch} for LLVM`)\n keywords.push(arch)\n }\n break\n }\n case \"linux\": {\n keywords.push(\"linux\")\n\n if (isUbuntu()) {\n optionalKeywords.push(\"ubuntu\")\n\n const ubuntuVer = await ubuntuVersion()\n if (ubuntuVer !== null) {\n optionalKeywords.push(`${ubuntuVer[0]}`)\n const ubuntuMin = ubuntuVer[1] < 10 ? `0${ubuntuVer[1]}` : `${ubuntuVer[1]}`\n\n optionalKeywords.push(`${ubuntuVer[0]}.${ubuntuMin}`)\n optionalKeywords.push(`${ubuntuVer[0]}.${ubuntuMin}.${ubuntuVer[2]}`)\n }\n } else if (hasDnf()) {\n optionalKeywords.push(\"rhel\")\n }\n\n if (x86_64.includes(arch)) {\n keywords.push(\"x86_64\")\n } else if (x86.includes(arch)) {\n keywords.push(\"x86\")\n } else if (arm64.includes(arch)) {\n keywords.push(\"aarch64\")\n } else if (armv7.includes(arch)) {\n keywords.push(\"armv7a\")\n } else if (powerpc64le.includes(arch)) {\n keywords.push(\"powerpc64le\")\n } else if (sparc64.includes(arch)) {\n keywords.push(\"sparc64\")\n } else {\n info(`Using arch ${arch} for LLVM`)\n keywords.push(arch)\n }\n\n break\n }\n case \"darwin\": {\n keywords.push(\"apple\")\n\n if (x86_64.includes(arch)) {\n keywords.push(\"x86_64\")\n } else if (arm64.includes(arch)) {\n // allow falling back to x86_64 if arm64 is not available\n optionalKeywords.push(\"arm64\")\n } else {\n info(`Using arch ${arch} for LLVM`)\n keywords.push(arch)\n }\n break\n }\n case \"freebsd\": {\n keywords.push(\"freebsd\")\n\n if (x86_64.includes(arch)) {\n keywords.push(\"amd64\")\n } else if (x86.includes(arch)) {\n keywords.push(\"i386\")\n } else {\n info(`Using arch ${arch} for LLVM`)\n keywords.push(arch)\n }\n\n break\n }\n default:\n info(`Using ${platform} ${arch} for LLVM`)\n keywords.push(platform, arch)\n break\n }\n return { keywords, optionalKeywords }\n}\n","import { tmpdir } from \"os\"\nimport path, { delimiter, join } from \"path\"\nimport { fileURLToPath } from \"url\"\nimport { execRootSync } from \"admina\"\nimport { GITHUB_ACTIONS } from \"ci-info\"\nimport { info, warning } from \"ci-log\"\nimport { addEnv } from \"envosman\"\nimport memoize from \"memoizee\"\nimport { DownloaderHelper } from \"node-downloader-helper\"\nimport { pathExists } from \"path-exists\"\nimport { addExeExt } from \"patha\"\nimport { addUpdateAlternativesToRc, installAptPack } from \"setup-apt\"\nimport { rcOptions } from \"../cli-options.js\"\nimport { setupGcc } from \"../gcc/gcc.js\"\nimport { setupMacOSSDK } from \"../macos-sdk/macos-sdk.js\"\nimport { arm64, x86_64 } from \"../utils/env/arch.js\"\nimport { hasDnf } from \"../utils/env/hasDnf.js\"\nimport { isArch } from \"../utils/env/isArch.js\"\nimport { isUbuntu } from \"../utils/env/isUbuntu.js\"\nimport { ubuntuVersion } from \"../utils/env/ubuntu_version.js\"\nimport { type InstallationInfo, setupBin } from \"../utils/setup/setupBin.js\"\nimport { setupDnfPack } from \"../utils/setup/setupDnfPack.js\"\nimport { setupPacmanPack } from \"../utils/setup/setupPacmanPack.js\"\nimport { semverCoerceIfInvalid } from \"../utils/setup/version.js\"\nimport { quoteIfHasSpace } from \"../utils/std/index.js\"\nimport { getVersion } from \"../versions/versions.js\"\nimport { LLVMPackages, setupLLVMApt } from \"./llvm_installer.js\"\nimport { getLLVMPackageInfo } from \"./llvm_url.js\"\n\nconst dirname = typeof __dirname === \"string\" ? __dirname : path.dirname(fileURLToPath(import.meta.url))\n\nexport async function setupLLVM(version: string, setupDir: string, arch: string): Promise {\n const installationInfo = await setupLLVMWithoutActivation(version, setupDir, arch)\n await activateLLVM(installationInfo.installDir ?? setupDir, version)\n return installationInfo\n}\n\nasync function setupLLVMWithoutActivation_(version: string, setupDir: string, arch: string) {\n // install LLVM\n const [installationInfo, _1] = await Promise.all([\n setupLLVMOnly(version, setupDir, arch),\n addLLVMLoggingMatcher(),\n ])\n\n // install LLVM dependencies\n await setupLLVMDeps(arch)\n\n return installationInfo\n}\nconst setupLLVMWithoutActivation = memoize(setupLLVMWithoutActivation_, { promise: true })\n\n/**\n * Setup clang-format\n *\n * This uses the LLVM installer on Ubuntu, and the LLVM binaries on other platforms\n */\nexport function setupClangFormat(version: string, setupDir: string, arch: string) {\n return setupLLVMOnly(version, setupDir, arch, LLVMPackages.ClangFormat)\n}\n\n/** Setup llvm tools (clang tidy, etc.) without activating llvm and using it as the compiler */\nexport function setupClangTools(version: string, setupDir: string, arch: string) {\n return setupLLVMOnly(version, setupDir, arch)\n}\n\nasync function setupLLVMOnly(\n version: string,\n setupDir: string,\n arch: string,\n packages: LLVMPackages = LLVMPackages.All,\n) {\n const majorVersion = majorLLVMVersion(version)\n try {\n if (isUbuntu()) {\n return await setupLLVMApt(majorVersion, packages)\n }\n } catch (err) {\n info(`Failed to install llvm via system package manager ${err}`)\n }\n\n const installationInfo = await setupBin(\"llvm\", version, getLLVMPackageInfo, setupDir, arch)\n await llvmBinaryDeps(majorVersion)\n return installationInfo\n}\n\nfunction majorLLVMVersion(version: string) {\n const coeredVersion = semverCoerceIfInvalid(version)\n return Number.parseInt(coeredVersion.split(\".\")[0], 10)\n}\n\nasync function llvmBinaryDeps_(majorVersion: number) {\n if (isUbuntu()) {\n if (majorVersion <= 10) {\n try {\n await installAptPack([{ name: \"libtinfo5\" }])\n } catch (err) {\n // Manually install libtinfo5 if the package is not available\n info(`Failed to install libtinfo5 ${err}\\nManually installing the package`)\n const arch = x86_64.includes(process.arch)\n ? \"amd64\"\n : arm64.includes(process.arch)\n ? \"arm64\"\n : process.arch\n\n const fileName = `libtinfo5_6.3-2ubuntu0.1_${arch}.deb`\n const url = `http://launchpadlibrarian.net/666971015/${fileName}`\n const dl = new DownloaderHelper(url, tmpdir(), { fileName })\n dl.on(\"error\", (dlErr) => {\n throw new Error(`Failed to download ${url}: ${dlErr}`)\n })\n await dl.start()\n // Install the downloaded package via dpkg\n execRootSync(\"dpkg\", [\"-i\", join(tmpdir(), fileName)])\n }\n } else {\n await installAptPack([{ name: \"libtinfo-dev\" }])\n }\n } else if (isArch()) {\n // https://aur.archlinux.org/packages/ncurses5-compat-libs\n await setupPacmanPack(\"ncurses5-compat-libs\", undefined, \"yay\")\n } else if (hasDnf()) {\n // https://packages.fedoraproject.org/pkgs/ncurses/ncurses-compat-libs/index.html\n await setupDnfPack([\n { name: \"ncurses-compat-libs\" },\n ])\n }\n}\nconst llvmBinaryDeps = memoize(llvmBinaryDeps_, { promise: true })\n\nasync function setupLLVMDeps_(arch: string) {\n if (process.platform === \"linux\") {\n // using llvm requires ld, an up to date libstdc++, etc. So, install gcc first,\n // but with a lower priority than the one used by activateLLVM()\n await setupGcc(getVersion(\"gcc\", undefined, await ubuntuVersion()), \"\", arch, 40)\n }\n}\nconst setupLLVMDeps = memoize(setupLLVMDeps_, { promise: true })\n\nexport async function activateLLVM(directory: string, version: string) {\n const ld = process.env.LD_LIBRARY_PATH ?? \"\"\n const dyld = process.env.DYLD_LIBRARY_PATH ?? \"\"\n\n const llvmMajor = majorLLVMVersion(version)\n\n const actPromises: Promise[] = [\n // compiler paths\n addEnv(\"CC\", addExeExt(`${directory}/bin/clang`), rcOptions),\n addEnv(\"CXX\", addExeExt(`${directory}/bin/clang++`), rcOptions),\n\n // the output of this action\n addEnv(\"LLVM_PATH\", directory, rcOptions),\n\n // Setup LLVM as the compiler\n addEnv(\"LD_LIBRARY_PATH\", `${ld}${delimiter}${directory}/lib`, rcOptions),\n addEnv(\"DYLD_LIBRARY_PATH\", `${dyld}${delimiter}${directory}/lib`, rcOptions),\n\n // compiler flags\n addEnv(\"LLVM_LDFLAGS\", `-L${quoteIfHasSpace(`${directory}/lib`)}`, rcOptions),\n addEnv(\"LLVM_CPPFLAGS\", `-I${quoteIfHasSpace(`${directory}/include`)}`, rcOptions),\n\n // CPATH\n await pathExists(`${directory}/lib/clang/${version}/include`)\n ? addEnv(\"LLVM_CPATH\", `${directory}/lib/clang/${version}/include`, rcOptions)\n : await pathExists(`${directory}/lib/clang/${llvmMajor}/include`)\n ? addEnv(\"LLVM_CPATH\", `${directory}/lib/clang/${llvmMajor}/include`, rcOptions)\n : Promise.resolve(),\n\n addEnv(\"LIBRARY_PATH\", `${directory}/lib`, rcOptions),\n\n // os sdks\n setupMacOSSDK(),\n ]\n\n if (isUbuntu()) {\n const priority = 60\n actPromises.push(\n addUpdateAlternativesToRc(\"cc\", `${directory}/bin/clang`, rcOptions, priority),\n addUpdateAlternativesToRc(\"cxx\", `${directory}/bin/clang++`, rcOptions, priority),\n addUpdateAlternativesToRc(\"clang\", `${directory}/bin/clang`, rcOptions),\n addUpdateAlternativesToRc(\"clang++\", `${directory}/bin/clang++`, rcOptions),\n addUpdateAlternativesToRc(\"lld\", `${directory}/bin/lld`, rcOptions),\n addUpdateAlternativesToRc(\"ld.lld\", `${directory}/bin/ld.lld`, rcOptions),\n addUpdateAlternativesToRc(\"llvm-ar\", `${directory}/bin/llvm-ar`, rcOptions),\n )\n }\n\n await Promise.all(actPromises)\n}\n\nasync function addLLVMLoggingMatcher() {\n if (GITHUB_ACTIONS) {\n const matcherPath = join(dirname, \"llvm_matcher.json\")\n if (!(await pathExists(matcherPath))) {\n return warning(\"the llvm_matcher.json file does not exist in the same folder as setup-cpp.js\")\n }\n info(`::add-matcher::${matcherPath}`)\n }\n}\n","import { info } from \"console\"\nimport { tmpdir } from \"os\"\nimport { join } from \"path\"\nimport { execRoot } from \"admina\"\nimport { addPath } from \"envosman\"\nimport { chmod, readFile, writeFile } from \"fs/promises\"\nimport { DownloaderHelper } from \"node-downloader-helper\"\nimport { aptTimeout, hasNala, installAptPack, isAptPackRegexInstalled } from \"setup-apt\"\nimport { rcOptions } from \"../cli-options.js\"\nimport { DEFAULT_TIMEOUT } from \"../installTool.js\"\nimport type { InstallationInfo } from \"../utils/setup/setupBin.js\"\n\nexport enum LLVMPackages {\n All = 0,\n ClangFormat = 1,\n Core = 2,\n}\n\nexport async function setupLLVMApt(\n majorVersion: number,\n packages: LLVMPackages = LLVMPackages.All,\n): Promise {\n // TODO for older versions, this also includes the minor version\n const installationFolder = `/usr/lib/llvm-${majorVersion}`\n\n // download the installation script\n await installAptPack([{ name: \"ca-certificates\" }])\n const dl = new DownloaderHelper(\"https://apt.llvm.org/llvm.sh\", tmpdir(), { fileName: \"llvm.sh\" })\n dl.on(\"error\", (err) => {\n throw new Error(`Failed to download the LLVM installer script: ${err}`)\n })\n await dl.start()\n const installerScript = await readFile(dl.getDownloadPath(), \"utf-8\")\n\n const installerPath = join(tmpdir(), \"llvm-setup-cpp.sh\")\n const neededPackages = await patchAptLLVMScript(\n installerScript,\n installerPath,\n majorVersion,\n packages,\n )\n await installAptPack(neededPackages)\n await chmod(installerPath, \"755\")\n await execRoot(\n \"bash\",\n [installerPath, `${majorVersion}`, ...(packages === LLVMPackages.All ? [\"all\"] : [])],\n {\n stdio: \"inherit\",\n shell: true,\n timeout: DEFAULT_TIMEOUT,\n },\n )\n\n await addPath(`${installationFolder}/bin`, rcOptions)\n\n return {\n installDir: `${installationFolder}`,\n binDir: `${installationFolder}/bin`,\n bin: `${installationFolder}/bin/clang++`,\n }\n}\n\nasync function patchAptLLVMScript(\n givenScript: string,\n target_path: string,\n majorVersion: number,\n packages: LLVMPackages,\n) {\n let script = debugScript(givenScript)\n script = nonInteractiveScript(script)\n script = choosePackages(packages, script, majorVersion)\n script = await removeConflictingPackages(script)\n script = useNalaScript(script)\n\n await writeFile(target_path, script)\n\n // the packages needed by the script\n return [{ name: \"lsb-release\" }, { name: \"wget\" }, { name: \"software-properties-common\" }, { name: \"gnupg\" }]\n}\n\nfunction debugScript(script: string) {\n if (process.env.NODE_DEBUG !== \"1\" && process.env.NODE_DEBUG !== \"true\") {\n return script.replace(/set -eux/g, \"set -eu\")\n }\n return script\n}\n\nfunction nonInteractiveScript(script: string) {\n // make the scirpt non-interactive and fix broken packages\n return script.replace(\n /add-apt-repository \"\\${REPO_NAME}\"/g,\n `add-apt-repository -y -n \"\\${REPO_NAME}\"\napt-get update -o ${aptTimeout} -y`,\n )\n}\n\nasync function removeConflictingPackages(givenScript: string) {\n // fix conflicts between libclang-rt and libclang\n let script = givenScript.replace(\n /apt-get install -y/g,\n `apt-get install -o Dpkg::Options::=\"--force-overwrite\" -o ${aptTimeout} -y --fix-broken`,\n )\n\n // check if these are installed and if so, remove them from the script as they conflict\n const conflictingPackages = [\"libc++-$LLVM_VERSION-dev\", \"libc++abi-$LLVM_VERSION-dev\", \"libunwind-$LLVM_VERSION-dev\"]\n await Promise.all(\n conflictingPackages.map(async (pack) => {\n const installingPack = pack.replace(\"$LLVM_VERSION\", \"*\")\n if (await isAptPackRegexInstalled(installingPack)) {\n info(`Removing conflicting package ${installingPack}`)\n script = script.replace(pack, \"\")\n }\n }),\n )\n return script\n}\n\nfunction useNalaScript(script: string) {\n // use nala if it is available\n if (hasNala()) {\n return script.replace(/apt-get/g, \"nala\")\n }\n return script\n}\n\nfunction choosePackages(packages: LLVMPackages, script: string, majorVersion: number) {\n if (packages === LLVMPackages.ClangFormat) {\n return script.replace(/ -y \\$PKG/g, ` -y clang-format-${majorVersion}`)\n }\n return script\n}\n","import path, { join } from \"path\"\nimport { fileURLToPath } from \"url\"\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport { GITHUB_ACTIONS } from \"ci-info\"\nimport { error, info, warning } from \"ci-log\"\nimport { findVcvarsall, vsversion_to_versionnumber } from \"msvc-dev-cmd/lib.js\"\nimport { pathExists } from \"path-exists\"\nimport { setupChocoPack } from \"../utils/setup/setupChocoPack.js\"\nimport { setupVCVarsall } from \"../vcvarsall/vcvarsall.js\"\n\nconst dirname = typeof __dirname === \"string\" ? __dirname : path.dirname(fileURLToPath(import.meta.url))\n\ntype MSVCVersion = \"2022\" | \"17.0\" | \"2019\" | \"16.0\" | \"2017\" | \"15.0\" | \"2015\" | \"14.0\" | \"2013\" | \"12.0\" | string\n\nexport async function setupMSVC(\n versionGiven: MSVCVersion,\n _setupDir: string,\n arch: string,\n sdk?: string,\n uwp?: boolean,\n spectre?: boolean,\n) {\n if (process.platform !== \"win32\") {\n return\n }\n const version = vsversion_to_versionnumber(versionGiven) as string\n\n // check if the given version is already installed\n info(`Checking if MSVC ${version} is already installed`)\n let installed = false\n try {\n const vcvarsall_path = findVcvarsall(version) as string\n installed = true\n info(`Found the pre-installed version of MSVC at ${vcvarsall_path}`)\n } catch {\n // not installed, try installing\n }\n\n let toolset: string | undefined\n let VCTargetsPath: string | undefined\n // https://github.com/aminya/setup-cpp/issues/1\n if (!installed) {\n try {\n if (version === \"14.0\") {\n toolset = \"14.0\"\n await setupChocoPack(\"visualcpp-build-tools\", \"14.0.25420.1\", [\"--ignore-dependencies\"])\n VCTargetsPath = \"C:/Program Files (x86)/MSBuild/Microsoft.Cpp/v4.0/v140\"\n } else if (version === \"15.0\") {\n toolset = \"14.16\"\n await setupChocoPack(\"visualstudio2017buildtools\", \"15.9.41.0\", [])\n VCTargetsPath = \"C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16\" // TODO verify path\n } else if (version === \"16.0\") {\n toolset = \"14.29\"\n await setupChocoPack(\"visualstudio2019buildtools\", \"16.11.7.0\", [])\n VCTargetsPath = \"C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133\"\n } else if (version === \"17.0\") {\n toolset = undefined\n await setupChocoPack(\"visualstudio2022buildtools\", \"117.0.5.0\", [])\n VCTargetsPath = undefined\n } else {\n error(`The given MSVC versions ${versionGiven} is not supported yet.`)\n }\n } catch (e) {\n error(e as string | Error)\n }\n }\n // run vcvarsall.bat environment variables\n await setupVCVarsall(version, VCTargetsPath, arch, toolset, sdk, uwp, spectre)\n\n if (GITHUB_ACTIONS) {\n await addMSVCLoggingMatcher()\n }\n}\n\nasync function addMSVCLoggingMatcher() {\n const matcherPath = join(dirname, \"msvc_matcher.json\")\n if (!(await pathExists(matcherPath))) {\n return warning(\"the msvc_matcher.json file does not exist in the same folder as setup-cpp.js\")\n }\n info(`::add-matcher::${matcherPath}`)\n}\n","import { addPath } from \"envosman\"\nimport { rcOptions } from \"../cli-options.js\"\nimport { setupChocoPack } from \"../utils/setup/setupChocoPack.js\"\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport async function setupOpencppcoverage(version: string | undefined, _setupDir: string, _arch: string) {\n if (process.platform !== \"win32\") {\n return\n }\n await setupChocoPack(\"opencppcoverage\", version)\n const binDir = await activateOpencppcoverage()\n return { binDir }\n}\n\nasync function activateOpencppcoverage() {\n const binDir = \"C:/Program Files/OpenCppCoverage\"\n await addPath(binDir, rcOptions)\n return binDir\n}\n","import { execRootSync } from \"admina\"\nimport { error } from \"ci-log\"\nimport { addPath } from \"envosman\"\nimport { addExeExt } from \"patha\"\nimport { installAptPack } from \"setup-apt\"\nimport { installBrewPack } from \"setup-brew\"\nimport { rcOptions } from \"../cli-options.js\"\nimport { hasDnf } from \"../utils/env/hasDnf.js\"\nimport { isArch } from \"../utils/env/isArch.js\"\nimport { isUbuntu } from \"../utils/env/isUbuntu.js\"\nimport { ubuntuVersion } from \"../utils/env/ubuntu_version.js\"\nimport { type PackageInfo, setupBin } from \"../utils/setup/setupBin.js\"\nimport { setupChocoPack } from \"../utils/setup/setupChocoPack.js\"\nimport { setupDnfPack } from \"../utils/setup/setupDnfPack.js\"\nimport { setupPacmanPack } from \"../utils/setup/setupPacmanPack.js\"\n\n/** Get the platform data for cmake */\nfunction getPowerShellPackageInfo(version: string, platform: NodeJS.Platform, arch: string): PackageInfo {\n return {\n url: getPowershellUrl(platform, arch, version),\n binRelativeDir: \"\",\n binFileName: addExeExt(\"pwsh\"),\n extractedFolderName: \"\",\n }\n}\n\nfunction getPowershellUrl(\n platform: string,\n arch: string,\n version: string,\n) {\n switch (platform) {\n case \"win32\": {\n const osArchStr = ([\"ia32\", \"x86\", \"i386\", \"x32\"].includes(arch))\n ? \"win-x86\"\n : \"win-x64\"\n\n return `https://github.com/PowerShell/PowerShell/releases/download/v${version}/PowerShell-${version}-${osArchStr}.zip`\n }\n case \"darwin\": {\n const osArchStr = [\"arm\", \"arm64\"].includes(arch) ? \"osx-arm64\" : \"osx-x64\"\n\n return `https://github.com/PowerShell/PowerShell/releases/download/v${version}/powershell-${version}-${osArchStr}.tar.gz`\n }\n case \"linux\": {\n const archMap = {\n arm64: \"linux-arm64\",\n arm: \"linux-arm64\",\n arm32: \"linux-arm32\",\n aarch64: \"linux-arm64\",\n x64: \"linux-x64\",\n } as Record\n const osArchStr = archMap[arch] ?? \"linux-x64\"\n // TODO support musl\n return `https://github.com/PowerShell/PowerShell/releases/download/v${version}/powershell-${version}-${osArchStr}.tar.gz`\n }\n default:\n throw new Error(`Unsupported platform '${platform}'`)\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport async function setupPowershell(version: string, setupDir: string, arch: string) {\n try {\n return await setupBin(\"pwsh\", version, getPowerShellPackageInfo, setupDir, arch)\n } catch (err) {\n error(`Failed to setup pwsh via download: ${err}. Trying package managers...`)\n return setupPowershellSystem(version, setupDir, arch)\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport async function setupPowershellSystem(version: string | undefined, _setupDir: string, _arch: string) {\n switch (process.platform) {\n case \"win32\": {\n await setupChocoPack(\"powershell-core\", version)\n const binDir = \"C:/Program Files/PowerShell/7\"\n await addPath(binDir, rcOptions)\n return { binDir }\n }\n case \"darwin\": {\n return installBrewPack(\"powershell\", version, { cask: true, overwrite: false })\n }\n case \"linux\": {\n if (isArch()) {\n return setupPacmanPack(\"powershell-bin\", version, \"yay\")\n } else if (hasDnf()) {\n await setupDnfPack([{ name: \"curl\" }])\n execRootSync(\"/bin/bash\", [\n \"-c\",\n \"curl https://packages.microsoft.com/config/rhel/8/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo\",\n ])\n return setupDnfPack([{ name: \"powershell\", version }])\n } else if (isUbuntu()) {\n await installAptPack([{ name: \"curl\" }])\n const ubuntuVerSplitted = (await ubuntuVersion())!\n const ubuntuVersionString = `${ubuntuVerSplitted[0]}.0${ubuntuVerSplitted[1]}`\n\n execRootSync(\"curl\", [\n \"-LJO\",\n `https://packages.microsoft.com/config/ubuntu/${ubuntuVersionString}/packages-microsoft-prod.deb`,\n ])\n execRootSync(\"dpkg\", [\"-i\", \"packages-microsoft-prod.deb\"])\n\n // TODO Debian\n // const keyFileName = await addAptKeyViaURL(\n // \"microsoft.asc\",\n // \"https://packages.microsoft.com/keys/microsoft.asc\"\n // )\n // execRootSync(\"/bin/bash\", [\n // \"-c\",\n // `echo \"deb [arch=amd64 signed-by=${keyFileName}] https://packages.microsoft.com/repos/microsoft-debian-bullseye-prod bullseye main\" > /etc/apt/sources.list.d/microsoft.list`,\n // ])\n\n return installAptPack([{ name: \"powershell\", version }], true)\n }\n throw new Error(\"Unsupported linux distribution\")\n }\n default: {\n throw new Error(\"Unsupported platform\")\n }\n }\n}\n","import { addExeExt } from \"patha\"\nimport { type InstallationInfo, type PackageInfo, setupBin } from \"../utils/setup/setupBin.js\"\n\n/** Get the platform name task uses in their download links */\nfunction getTaskPlatform(platform: NodeJS.Platform) {\n switch (platform) {\n case \"win32\":\n return \"windows\"\n default:\n return platform\n }\n}\n\n/** Get the arch name task uses in their download links */\nfunction getTaskArch(arch: string) {\n switch (arch) {\n case \"x64\":\n return \"amd64\"\n case \"ia32\":\n case \"x86\":\n case \"i386\":\n case \"x32\":\n return \"386\"\n default:\n return arch\n }\n}\n\n/** Get the platform data for task */\nfunction getTaskPackageInfo(version: string, platform: NodeJS.Platform, arch: string): PackageInfo {\n const taskPlatform = getTaskPlatform(platform)\n const taskArch = getTaskArch(arch)\n const extension = platform === \"win32\" ? \"zip\" : \"tar.gz\"\n return {\n binRelativeDir: \"\",\n binFileName: addExeExt(\"task\"),\n extractedFolderName: \"\",\n url: `https://github.com/go-task/task/releases/download/v${version}/task_${taskPlatform}_${taskArch}.${extension}`,\n }\n}\n\nexport function setupTask(version: string, setupDir: string, arch: string): Promise {\n return setupBin(\"task\", version, getTaskPackageInfo, setupDir, arch)\n}\n","import { getInput } from \"@actions/core\"\nimport { info } from \"ci-log\"\nimport mri from \"mri\"\nimport { untildifyUser } from \"untildify-user\"\nimport { type Inputs, inputs } from \"./tool.js\"\nimport type { InstallationInfo } from \"./utils/setup/setupBin.js\"\n\nexport function parseArgs(args: string[]): Opts {\n return mri & { help: boolean }>(args, {\n string: [...inputs, \"timeout\"],\n default: Object.fromEntries(inputs.map((inp) => [inp, maybeGetInput(inp)])),\n alias: { h: \"help\" },\n boolean: \"help\",\n })\n}\n\nexport function printHelp() {\n info(`\nsetup-cpp [options]\nsetup-cpp --compiler llvm --cmake true --ninja true --ccache true --vcpkg true\n\nInstall all the tools required for building and testing C++/C projects.\n\n--architecture\\t the cpu architecture to install the tools for. By default it uses the current CPU architecture.\n--timeout\\t the timeout for the installation of each tool in minutes. By default it is 10 minutes.\n--compiler\\t the to install.\n \\t You can specify the version instead of specifying just the name e.g: --compiler 'llvm-13.0.0'\n--$tool_name\\t pass \"true\" or pass the you would like to install for this tool. e.g. --conan true or --conan \"1.42.1\"\n\nAll the available tools:\n`)\n\n console.table(\n {\n \"compiler and analyzer\": {\n tools: \"--llvm, --gcc, --msvc, --apple-clang, --vcvarsall\",\n },\n \"build system\": {\n tools: \"--cmake, --ninja, --meson, --make, --task, --bazel\",\n },\n \"package manager\": { tools: \"--vcpkg, --conan, --choco, --brew, --nala\" },\n \"analyzer/linter\": {\n tools:\n \"--clang-tidy, --clang-format, --cppcheck, --cpplint, --flawfinder, --lizard, --infer, , --cmakelang, --cmake-lint, --cmake-format\",\n },\n cache: { tools: \"--ccache, --sccache\" },\n documentation: { tools: \"--doxygen, --graphviz\" },\n coverage: { tools: \"--gcovr, --opencppcoverage, --kcov\" },\n other: { tools: \"--python, --powershell, --sevenzip\" },\n },\n [\"tools\"],\n )\n}\n/** Get an object from github actions */\n\nexport function maybeGetInput(key: string) {\n const value = getInput(key.toLowerCase())\n if (value !== \"false\" && value !== \"\") {\n return value\n }\n return undefined // skip installation\n}\nexport type Opts = mri.Argv<\n Record & {\n help: boolean\n timeout?: string\n }\n>\n\nexport function getSuccessMessage(tool: string, installationInfo: InstallationInfo | undefined | void) {\n let msg = `✅ ${tool} was installed successfully:`\n if (installationInfo === undefined) {\n return msg\n }\n if (\"installDir\" in installationInfo) {\n msg += `\\n- The installation directory is ${installationInfo.installDir}`\n }\n if (installationInfo.binDir !== \"\") {\n msg += `\\n- The binary directory is ${installationInfo.binDir}`\n }\n return msg\n}\n\nexport const rcOptions = {\n rcPath: untildifyUser(\"~/.cpprc\"),\n guard: \"cpp\",\n}\n","'use strict'\n\nconst vendors = require('./vendors.json')\n\nconst env = process.env\n\n// Used for testing only\nObject.defineProperty(exports, '_vendors', {\n value: vendors.map(function (v) {\n return v.constant\n })\n})\n\nexports.name = null\nexports.isPR = null\n\nvendors.forEach(function (vendor) {\n const envs = Array.isArray(vendor.env) ? vendor.env : [vendor.env]\n const isCI = envs.every(function (obj) {\n return checkEnv(obj)\n })\n\n exports[vendor.constant] = isCI\n\n if (!isCI) {\n return\n }\n\n exports.name = vendor.name\n\n switch (typeof vendor.pr) {\n case 'string':\n // \"pr\": \"CIRRUS_PR\"\n exports.isPR = !!env[vendor.pr]\n break\n case 'object':\n if ('env' in vendor.pr) {\n // \"pr\": { \"env\": \"BUILDKITE_PULL_REQUEST\", \"ne\": \"false\" }\n exports.isPR = vendor.pr.env in env && env[vendor.pr.env] !== vendor.pr.ne\n } else if ('any' in vendor.pr) {\n // \"pr\": { \"any\": [\"ghprbPullId\", \"CHANGE_ID\"] }\n exports.isPR = vendor.pr.any.some(function (key) {\n return !!env[key]\n })\n } else {\n // \"pr\": { \"DRONE_BUILD_EVENT\": \"pull_request\" }\n exports.isPR = checkEnv(vendor.pr)\n }\n break\n default:\n // PR detection not supported for this vendor\n exports.isPR = null\n }\n})\n\nexports.isCI = !!(\n env.CI !== 'false' && // Bypass all checks if CI env is explicitly set to 'false'\n (env.BUILD_ID || // Jenkins, Cloudbees\n env.BUILD_NUMBER || // Jenkins, TeamCity\n env.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari\n env.CI_APP_ID || // Appflow\n env.CI_BUILD_ID || // Appflow\n env.CI_BUILD_NUMBER || // Appflow\n env.CI_NAME || // Codeship and others\n env.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI\n env.RUN_ID || // TaskCluster, dsari\n exports.name ||\n false)\n)\n\nfunction checkEnv (obj) {\n // \"env\": \"CIRRUS\"\n if (typeof obj === 'string') return !!env[obj]\n\n // \"env\": { \"env\": \"NODE\", \"includes\": \"/app/.heroku/node/bin/node\" }\n if ('env' in obj) {\n // Currently there are no other types, uncomment when there are\n // if ('includes' in obj) {\n return env[obj.env] && env[obj.env].includes(obj.includes)\n // }\n }\n if ('any' in obj) {\n return obj.any.some(function (k) {\n return !!env[k]\n })\n }\n return Object.keys(obj).every(function (k) {\n return env[k] === obj[k]\n })\n}\n","\"use strict\";\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toCommandProperties = exports.toCommandValue = void 0;\n/**\n * Sanitizes an input into a string so it can be passed into issueCommand safely\n * @param input input to sanitize into a string\n */\nfunction toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}\nexports.toCommandValue = toCommandValue;\n/**\n *\n * @param annotationProperties\n * @returns The command properties to send with the actual annotation command\n * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646\n */\nfunction toCommandProperties(annotationProperties) {\n if (!Object.keys(annotationProperties).length) {\n return {};\n }\n return {\n title: annotationProperties.title,\n file: annotationProperties.file,\n line: annotationProperties.startLine,\n endLine: annotationProperties.endLine,\n col: annotationProperties.startColumn,\n endColumn: annotationProperties.endColumn\n };\n}\nexports.toCommandProperties = toCommandProperties;\n//# sourceMappingURL=utils.js.map","export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;","import rng from './rng.js';\nimport stringify from './stringify.js'; // **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nlet _nodeId;\n\nlet _clockseq; // Previous uuid creation time\n\n\nlet _lastMSecs = 0;\nlet _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details\n\nfunction v1(options, buf, offset) {\n let i = buf && offset || 0;\n const b = buf || new Array(16);\n options = options || {};\n let node = options.node || _nodeId;\n let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n\n if (node == null || clockseq == null) {\n const seedBytes = options.random || (options.rng || rng)();\n\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];\n }\n\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n } // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n\n\n let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n\n let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)\n\n const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression\n\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n\n\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n } // Per 4.2.1.2 Throw error if too many uuids are requested\n\n\n if (nsecs >= 10000) {\n throw new Error(\"uuid.v1(): Can't create more than 10M uuids/sec\");\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n\n msecs += 12219292800000; // `time_low`\n\n const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff; // `time_mid`\n\n const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff; // `time_high_and_version`\n\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n\n b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n\n b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`\n\n b[i++] = clockseq & 0xff; // `node`\n\n for (let n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf || stringify(b);\n}\n\nexport default v1;","import v35 from './v35.js';\nimport md5 from './md5.js';\nconst v3 = v35('v3', 0x30, md5);\nexport default v3;","import crypto from 'crypto';\n\nfunction md5(bytes) {\n if (Array.isArray(bytes)) {\n bytes = Buffer.from(bytes);\n } else if (typeof bytes === 'string') {\n bytes = Buffer.from(bytes, 'utf8');\n }\n\n return crypto.createHash('md5').update(bytes).digest();\n}\n\nexport default md5;","import v35 from './v35.js';\nimport sha1 from './sha1.js';\nconst v5 = v35('v5', 0x50, sha1);\nexport default v5;","import crypto from 'crypto';\n\nfunction sha1(bytes) {\n if (Array.isArray(bytes)) {\n bytes = Buffer.from(bytes);\n } else if (typeof bytes === 'string') {\n bytes = Buffer.from(bytes, 'utf8');\n }\n\n return crypto.createHash('sha1').update(bytes).digest();\n}\n\nexport default sha1;","export default '00000000-0000-0000-0000-000000000000';","import rng from './rng.js';\nimport stringify from './stringify.js';\n\nfunction v4(options, buf, offset) {\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return stringify(rnds);\n}\n\nexport default v4;","import validate from './validate.js';\n\nfunction version(uuid) {\n if (!validate(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n return parseInt(uuid.substr(14, 1), 16);\n}\n\nexport default version;","\"use strict\";\n// For internal use, subject to change.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.prepareKeyValueMessage = exports.issueFileCommand = void 0;\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst fs = __importStar(require(\"fs\"));\nconst os = __importStar(require(\"os\"));\nconst uuid_1 = require(\"uuid\");\nconst utils_1 = require(\"./utils\");\nfunction issueFileCommand(command, message) {\n const filePath = process.env[`GITHUB_${command}`];\n if (!filePath) {\n throw new Error(`Unable to find environment variable for file command ${command}`);\n }\n if (!fs.existsSync(filePath)) {\n throw new Error(`Missing file at path: ${filePath}`);\n }\n fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {\n encoding: 'utf8'\n });\n}\nexports.issueFileCommand = issueFileCommand;\nfunction prepareKeyValueMessage(key, value) {\n const delimiter = `ghadelimiter_${uuid_1.v4()}`;\n const convertedValue = utils_1.toCommandValue(value);\n // These should realistically never happen, but just in case someone finds a\n // way to exploit uuid generation let's not allow keys or values that contain\n // the delimiter.\n if (key.includes(delimiter)) {\n throw new Error(`Unexpected input: name should not contain the delimiter \"${delimiter}\"`);\n }\n if (convertedValue.includes(delimiter)) {\n throw new Error(`Unexpected input: value should not contain the delimiter \"${delimiter}\"`);\n }\n return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;\n}\nexports.prepareKeyValueMessage = prepareKeyValueMessage;\n//# sourceMappingURL=file-command.js.map","module.exports = require('./lib/tunnel');\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport * as http from 'http';\nimport * as https from 'https';\nimport * as pm from './proxy';\nimport * as tunnel from 'tunnel';\nexport var HttpCodes;\n(function (HttpCodes) {\n HttpCodes[HttpCodes[\"OK\"] = 200] = \"OK\";\n HttpCodes[HttpCodes[\"MultipleChoices\"] = 300] = \"MultipleChoices\";\n HttpCodes[HttpCodes[\"MovedPermanently\"] = 301] = \"MovedPermanently\";\n HttpCodes[HttpCodes[\"ResourceMoved\"] = 302] = \"ResourceMoved\";\n HttpCodes[HttpCodes[\"SeeOther\"] = 303] = \"SeeOther\";\n HttpCodes[HttpCodes[\"NotModified\"] = 304] = \"NotModified\";\n HttpCodes[HttpCodes[\"UseProxy\"] = 305] = \"UseProxy\";\n HttpCodes[HttpCodes[\"SwitchProxy\"] = 306] = \"SwitchProxy\";\n HttpCodes[HttpCodes[\"TemporaryRedirect\"] = 307] = \"TemporaryRedirect\";\n HttpCodes[HttpCodes[\"PermanentRedirect\"] = 308] = \"PermanentRedirect\";\n HttpCodes[HttpCodes[\"BadRequest\"] = 400] = \"BadRequest\";\n HttpCodes[HttpCodes[\"Unauthorized\"] = 401] = \"Unauthorized\";\n HttpCodes[HttpCodes[\"PaymentRequired\"] = 402] = \"PaymentRequired\";\n HttpCodes[HttpCodes[\"Forbidden\"] = 403] = \"Forbidden\";\n HttpCodes[HttpCodes[\"NotFound\"] = 404] = \"NotFound\";\n HttpCodes[HttpCodes[\"MethodNotAllowed\"] = 405] = \"MethodNotAllowed\";\n HttpCodes[HttpCodes[\"NotAcceptable\"] = 406] = \"NotAcceptable\";\n HttpCodes[HttpCodes[\"ProxyAuthenticationRequired\"] = 407] = \"ProxyAuthenticationRequired\";\n HttpCodes[HttpCodes[\"RequestTimeout\"] = 408] = \"RequestTimeout\";\n HttpCodes[HttpCodes[\"Conflict\"] = 409] = \"Conflict\";\n HttpCodes[HttpCodes[\"Gone\"] = 410] = \"Gone\";\n HttpCodes[HttpCodes[\"TooManyRequests\"] = 429] = \"TooManyRequests\";\n HttpCodes[HttpCodes[\"InternalServerError\"] = 500] = \"InternalServerError\";\n HttpCodes[HttpCodes[\"NotImplemented\"] = 501] = \"NotImplemented\";\n HttpCodes[HttpCodes[\"BadGateway\"] = 502] = \"BadGateway\";\n HttpCodes[HttpCodes[\"ServiceUnavailable\"] = 503] = \"ServiceUnavailable\";\n HttpCodes[HttpCodes[\"GatewayTimeout\"] = 504] = \"GatewayTimeout\";\n})(HttpCodes || (HttpCodes = {}));\nexport var Headers;\n(function (Headers) {\n Headers[\"Accept\"] = \"accept\";\n Headers[\"ContentType\"] = \"content-type\";\n})(Headers || (Headers = {}));\nexport var MediaTypes;\n(function (MediaTypes) {\n MediaTypes[\"ApplicationJson\"] = \"application/json\";\n})(MediaTypes || (MediaTypes = {}));\n/**\n * Returns the proxy URL, depending upon the supplied url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\nexport function getProxyUrl(serverUrl) {\n const proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}\nconst HttpRedirectCodes = [\n HttpCodes.MovedPermanently,\n HttpCodes.ResourceMoved,\n HttpCodes.SeeOther,\n HttpCodes.TemporaryRedirect,\n HttpCodes.PermanentRedirect\n];\nconst HttpResponseRetryCodes = [\n HttpCodes.BadGateway,\n HttpCodes.ServiceUnavailable,\n HttpCodes.GatewayTimeout\n];\nconst RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];\nconst ExponentialBackoffCeiling = 10;\nconst ExponentialBackoffTimeSlice = 5;\nexport class HttpClientError extends Error {\n constructor(message, statusCode) {\n super(message);\n this.name = 'HttpClientError';\n this.statusCode = statusCode;\n Object.setPrototypeOf(this, HttpClientError.prototype);\n }\n statusCode;\n result;\n}\nexport class HttpClientResponse {\n constructor(message) {\n this.message = message;\n }\n message;\n async readBody() {\n return new Promise(async (resolve) => {\n let output = Buffer.alloc(0);\n this.message.on('data', (chunk) => {\n output = Buffer.concat([output, chunk]);\n });\n this.message.on('end', () => {\n resolve(output.toString());\n });\n });\n }\n async readBodyBuffer() {\n return new Promise(async (resolve) => {\n const chunks = [];\n this.message.on('data', (chunk) => {\n chunks.push(chunk);\n });\n this.message.on('end', () => {\n resolve(Buffer.concat(chunks));\n });\n });\n }\n}\nexport function isHttps(requestUrl) {\n const parsedUrl = new URL(requestUrl);\n return parsedUrl.protocol === 'https:';\n}\nexport class HttpClient {\n userAgent;\n handlers;\n requestOptions;\n _ignoreSslError = false;\n _socketTimeout;\n _allowRedirects = true;\n _allowRedirectDowngrade = false;\n _maxRedirects = 50;\n _allowRetries = false;\n _maxRetries = 1;\n _agent;\n _proxyAgent;\n _proxyAgentDispatcher;\n _keepAlive = false;\n _disposed = false;\n constructor(userAgent, handlers, requestOptions) {\n this.userAgent = userAgent;\n this.handlers = handlers || [];\n this.requestOptions = requestOptions;\n if (requestOptions) {\n if (requestOptions.ignoreSslError != null) {\n this._ignoreSslError = requestOptions.ignoreSslError;\n }\n this._socketTimeout = requestOptions.socketTimeout;\n if (requestOptions.allowRedirects != null) {\n this._allowRedirects = requestOptions.allowRedirects;\n }\n if (requestOptions.allowRedirectDowngrade != null) {\n this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;\n }\n if (requestOptions.maxRedirects != null) {\n this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);\n }\n if (requestOptions.keepAlive != null) {\n this._keepAlive = requestOptions.keepAlive;\n }\n if (requestOptions.allowRetries != null) {\n this._allowRetries = requestOptions.allowRetries;\n }\n if (requestOptions.maxRetries != null) {\n this._maxRetries = requestOptions.maxRetries;\n }\n }\n }\n async options(requestUrl, additionalHeaders) {\n return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});\n }\n async get(requestUrl, additionalHeaders) {\n return this.request('GET', requestUrl, null, additionalHeaders || {});\n }\n async del(requestUrl, additionalHeaders) {\n return this.request('DELETE', requestUrl, null, additionalHeaders || {});\n }\n async post(requestUrl, data, additionalHeaders) {\n return this.request('POST', requestUrl, data, additionalHeaders || {});\n }\n async patch(requestUrl, data, additionalHeaders) {\n return this.request('PATCH', requestUrl, data, additionalHeaders || {});\n }\n async put(requestUrl, data, additionalHeaders) {\n return this.request('PUT', requestUrl, data, additionalHeaders || {});\n }\n async head(requestUrl, additionalHeaders) {\n return this.request('HEAD', requestUrl, null, additionalHeaders || {});\n }\n async sendStream(verb, requestUrl, stream, additionalHeaders) {\n return this.request(verb, requestUrl, stream, additionalHeaders);\n }\n /**\n * Gets a typed object from an endpoint\n * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise\n */\n async getJson(requestUrl, additionalHeaders = {}) {\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n const res = await this.get(requestUrl, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n }\n async postJson(requestUrl, obj, additionalHeaders = {}) {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = await this.post(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n }\n async putJson(requestUrl, obj, additionalHeaders = {}) {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = await this.put(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n }\n async patchJson(requestUrl, obj, additionalHeaders = {}) {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = await this.patch(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n }\n /**\n * Makes a raw http request.\n * All other methods such as get, post, patch, and request ultimately call this.\n * Prefer get, del, post and patch\n */\n async request(verb, requestUrl, data, headers) {\n if (this._disposed) {\n throw new Error('Client has already been disposed.');\n }\n const parsedUrl = new URL(requestUrl);\n let info = this._prepareRequest(verb, parsedUrl, headers);\n // Only perform retries on reads since writes may not be idempotent.\n const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)\n ? this._maxRetries + 1\n : 1;\n let numTries = 0;\n let response;\n do {\n response = await this.requestRaw(info, data);\n // Check if it's an authentication challenge\n if (response &&\n response.message &&\n response.message.statusCode === HttpCodes.Unauthorized) {\n let authenticationHandler;\n for (const handler of this.handlers) {\n if (handler.canHandleAuthentication(response)) {\n authenticationHandler = handler;\n break;\n }\n }\n if (authenticationHandler) {\n return authenticationHandler.handleAuthentication(this, info, data);\n }\n else {\n // We have received an unauthorized response but have no handlers to handle it.\n // Let the response return to the caller.\n return response;\n }\n }\n let redirectsRemaining = this._maxRedirects;\n while (response.message.statusCode &&\n HttpRedirectCodes.includes(response.message.statusCode) &&\n this._allowRedirects &&\n redirectsRemaining > 0) {\n const redirectUrl = response.message.headers['location'];\n if (!redirectUrl) {\n // if there's no location to redirect to, we won't\n break;\n }\n const parsedRedirectUrl = new URL(redirectUrl);\n if (parsedUrl.protocol === 'https:' &&\n parsedUrl.protocol !== parsedRedirectUrl.protocol &&\n !this._allowRedirectDowngrade) {\n throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');\n }\n // we need to finish reading the response before reassigning response\n // which will leak the open socket.\n await response.readBody();\n // strip authorization header if redirected to a different hostname\n if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {\n for (const header in headers) {\n // header names are case insensitive\n if (header.toLowerCase() === 'authorization') {\n delete headers[header];\n }\n }\n }\n // let's make the request with the new redirectUrl\n info = this._prepareRequest(verb, parsedRedirectUrl, headers);\n response = await this.requestRaw(info, data);\n redirectsRemaining--;\n }\n if (!response.message.statusCode ||\n !HttpResponseRetryCodes.includes(response.message.statusCode)) {\n // If not a retry code, return immediately instead of retrying\n return response;\n }\n numTries += 1;\n if (numTries < maxTries) {\n await response.readBody();\n await this._performExponentialBackoff(numTries);\n }\n } while (numTries < maxTries);\n return response;\n }\n /**\n * Needs to be called if keepAlive is set to true in request options.\n */\n dispose() {\n if (this._agent) {\n this._agent.destroy();\n }\n this._disposed = true;\n }\n /**\n * Raw request.\n * @param info\n * @param data\n */\n async requestRaw(info, data) {\n return new Promise((resolve, reject) => {\n function callbackForResult(err, res) {\n if (err) {\n reject(err);\n }\n else if (!res) {\n // If `err` is not passed, then `res` must be passed.\n reject(new Error('Unknown error'));\n }\n else {\n resolve(res);\n }\n }\n this.requestRawWithCallback(info, data, callbackForResult);\n });\n }\n /**\n * Raw request with callback.\n * @param info\n * @param data\n * @param onResult\n */\n requestRawWithCallback(info, data, onResult) {\n if (typeof data === 'string') {\n if (!info.options.headers) {\n info.options.headers = {};\n }\n info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');\n }\n let callbackCalled = false;\n function handleResult(err, res) {\n if (!callbackCalled) {\n callbackCalled = true;\n onResult(err, res);\n }\n }\n const req = info.httpModule.request(info.options, (msg) => {\n const res = new HttpClientResponse(msg);\n handleResult(undefined, res);\n });\n let socket;\n req.on('socket', sock => {\n socket = sock;\n });\n // If we ever get disconnected, we want the socket to timeout eventually\n req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n if (socket) {\n socket.end();\n }\n handleResult(new Error(`Request timeout: ${info.options.path}`));\n });\n req.on('error', function (err) {\n // err has statusCode property\n // res should have headers\n handleResult(err);\n });\n if (data && typeof data === 'string') {\n req.write(data, 'utf8');\n }\n if (data && typeof data !== 'string') {\n data.on('close', function () {\n req.end();\n });\n data.pipe(req);\n }\n else {\n req.end();\n }\n }\n /**\n * Gets an http agent. This function is useful when you need an http agent that handles\n * routing through a proxy server - depending upon the url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\n getAgent(serverUrl) {\n const parsedUrl = new URL(serverUrl);\n return this._getAgent(parsedUrl);\n }\n async getAgentDispatcher(serverUrl) {\n const parsedUrl = new URL(serverUrl);\n const proxyUrl = pm.getProxyUrl(parsedUrl);\n const useProxy = proxyUrl && proxyUrl.hostname;\n if (!useProxy) {\n return undefined;\n }\n return await this._getProxyAgentDispatcher(parsedUrl, proxyUrl);\n }\n _prepareRequest(method, requestUrl, headers) {\n const info = {};\n info.parsedUrl = requestUrl;\n const usingSsl = info.parsedUrl.protocol === 'https:';\n info.httpModule = usingSsl ? https : http;\n const defaultPort = usingSsl ? 443 : 80;\n info.options = {};\n info.options.host = info.parsedUrl.hostname;\n info.options.port = info.parsedUrl.port\n ? parseInt(info.parsedUrl.port)\n : defaultPort;\n info.options.path =\n (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');\n info.options.method = method;\n info.options.headers = this._mergeHeaders(headers);\n if (this.userAgent != null) {\n info.options.headers['user-agent'] = this.userAgent;\n }\n info.options.agent = this._getAgent(info.parsedUrl);\n // gives handlers an opportunity to participate\n if (this.handlers) {\n for (const handler of this.handlers) {\n handler.prepareRequest(info.options);\n }\n }\n return info;\n }\n _mergeHeaders(headers) {\n if (this.requestOptions && this.requestOptions.headers) {\n return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));\n }\n return lowercaseKeys(headers || {});\n }\n _getExistingOrDefaultHeader(additionalHeaders, header, _default) {\n let clientHeader;\n if (this.requestOptions && this.requestOptions.headers) {\n clientHeader = lowercaseKeys(this.requestOptions.headers)[header];\n }\n return additionalHeaders[header] || clientHeader || _default;\n }\n _getAgent(parsedUrl) {\n let agent;\n const proxyUrl = pm.getProxyUrl(parsedUrl);\n const useProxy = proxyUrl && proxyUrl.hostname;\n if (this._keepAlive && useProxy) {\n agent = this._proxyAgent;\n }\n if (!useProxy) {\n agent = this._agent;\n }\n // if agent is already assigned use that agent.\n if (agent) {\n return agent;\n }\n const usingSsl = parsedUrl.protocol === 'https:';\n let maxSockets = 100;\n if (this.requestOptions) {\n maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;\n }\n // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.\n if (proxyUrl && proxyUrl.hostname) {\n const agentOptions = {\n maxSockets,\n keepAlive: this._keepAlive,\n proxy: {\n ...((proxyUrl.username || proxyUrl.password) && {\n proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`\n }),\n host: proxyUrl.hostname,\n port: proxyUrl.port\n }\n };\n let tunnelAgent;\n const overHttps = proxyUrl.protocol === 'https:';\n if (usingSsl) {\n tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;\n }\n else {\n tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;\n }\n agent = tunnelAgent(agentOptions);\n this._proxyAgent = agent;\n }\n // if tunneling agent isn't assigned create a new agent\n if (!agent) {\n const options = { keepAlive: this._keepAlive, maxSockets };\n agent = usingSsl ? new https.Agent(options) : new http.Agent(options);\n this._agent = agent;\n }\n if (usingSsl && this._ignoreSslError) {\n // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n // we have to cast it to any and change it directly\n agent.options = Object.assign(agent.options || {}, {\n rejectUnauthorized: false\n });\n }\n return agent;\n }\n async _getProxyAgentDispatcher(parsedUrl, proxyUrl) {\n let proxyAgent;\n if (this._keepAlive) {\n proxyAgent = this._proxyAgentDispatcher;\n }\n // if agent is already assigned use that agent.\n if (proxyAgent) {\n return proxyAgent;\n }\n const usingSsl = parsedUrl.protocol === 'https:';\n // Lazy load ProxyAgent to avoid bundling all the undici\n const ProxyAgent = (await import('undici/lib/proxy-agent'));\n proxyAgent = new ProxyAgent({\n uri: proxyUrl.href,\n pipelining: !this._keepAlive ? 0 : 1,\n ...((proxyUrl.username || proxyUrl.password) && {\n token: `Basic ${Buffer.from(`${proxyUrl.username}:${proxyUrl.password}`).toString('base64')}`\n })\n });\n this._proxyAgentDispatcher = proxyAgent;\n if (usingSsl && this._ignoreSslError) {\n // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n // we have to cast it to any and change it directly\n proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, {\n rejectUnauthorized: false\n });\n }\n return proxyAgent;\n }\n async _performExponentialBackoff(retryNumber) {\n retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);\n const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);\n return new Promise(resolve => setTimeout(() => resolve(), ms));\n }\n async _processResponse(res, options) {\n return new Promise(async (resolve, reject) => {\n const statusCode = res.message.statusCode || 0;\n const response = {\n statusCode,\n result: null,\n headers: {}\n };\n // not found leads to null obj returned\n if (statusCode === HttpCodes.NotFound) {\n resolve(response);\n }\n // get the result from the body\n function dateTimeDeserializer(key, value) {\n if (typeof value === 'string') {\n const a = new Date(value);\n if (!isNaN(a.valueOf())) {\n return a;\n }\n }\n return value;\n }\n let obj;\n let contents;\n try {\n contents = await res.readBody();\n if (contents && contents.length > 0) {\n if (options && options.deserializeDates) {\n obj = JSON.parse(contents, dateTimeDeserializer);\n }\n else {\n obj = JSON.parse(contents);\n }\n response.result = obj;\n }\n response.headers = res.message.headers;\n }\n catch (err) {\n // Invalid resource (contents not json); leaving result obj null\n }\n // note that 3xx redirects are handled by the http layer.\n if (statusCode > 299) {\n let msg;\n // if exception/error in body, attempt to get better error\n if (obj && obj.message) {\n msg = obj.message;\n }\n else if (contents && contents.length > 0) {\n // it may be the case that the exception is in the body message as string\n msg = contents;\n }\n else {\n msg = `Failed request: (${statusCode})`;\n }\n const err = new HttpClientError(msg, statusCode);\n err.result = response.result;\n reject(err);\n }\n else {\n resolve(response);\n }\n });\n }\n}\nconst lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0;\nclass BasicCredentialHandler {\n constructor(username, password) {\n this.username = username;\n this.password = password;\n }\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.BasicCredentialHandler = BasicCredentialHandler;\nclass BearerCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Bearer ${this.token}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.BearerCredentialHandler = BearerCredentialHandler;\nclass PersonalAccessTokenCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;\n//# sourceMappingURL=auth.js.map","import {fileURLToPath} from 'node:url';\n\n// Allow some arguments/options to be either a file path string or a file URL\nexport const safeNormalizeFileUrl = (file, name) => {\n\tconst fileString = normalizeFileUrl(file);\n\n\tif (typeof fileString !== 'string') {\n\t\tthrow new TypeError(`${name} must be a string or a file URL: ${fileString}.`);\n\t}\n\n\treturn fileString;\n};\n\n// Same but also allows other values, e.g. `boolean` for the `shell` option\nexport const normalizeFileUrl = file => file instanceof URL ? fileURLToPath(file) : file;\n","import isPlainObject from 'is-plain-obj';\nimport {safeNormalizeFileUrl} from '../arguments/file-url.js';\n\n// The command `arguments` and `options` are both optional.\n// This also does basic validation on them and on the command file.\nexport const normalizeParameters = (rawFile, rawArguments = [], rawOptions = {}) => {\n\tconst filePath = safeNormalizeFileUrl(rawFile, 'First argument');\n\tconst [commandArguments, options] = isPlainObject(rawArguments)\n\t\t? [[], rawArguments]\n\t\t: [rawArguments, rawOptions];\n\n\tif (!Array.isArray(commandArguments)) {\n\t\tthrow new TypeError(`Second argument must be either an array of arguments or an options object: ${commandArguments}`);\n\t}\n\n\tif (commandArguments.some(commandArgument => typeof commandArgument === 'object' && commandArgument !== null)) {\n\t\tthrow new TypeError(`Second argument must be an array of strings: ${commandArguments}`);\n\t}\n\n\tconst normalizedArguments = commandArguments.map(String);\n\tconst nullByteArgument = normalizedArguments.find(normalizedArgument => normalizedArgument.includes('\\0'));\n\tif (nullByteArgument !== undefined) {\n\t\tthrow new TypeError(`Arguments cannot contain null bytes (\"\\\\0\"): ${nullByteArgument}`);\n\t}\n\n\tif (!isPlainObject(options)) {\n\t\tthrow new TypeError(`Last argument must be an options object: ${options}`);\n\t}\n\n\treturn [filePath, normalizedArguments, options];\n};\n","import {StringDecoder} from 'node:string_decoder';\n\nconst {toString: objectToString} = Object.prototype;\n\nexport const isArrayBuffer = value => objectToString.call(value) === '[object ArrayBuffer]';\n\n// Is either Uint8Array or Buffer\nexport const isUint8Array = value => objectToString.call(value) === '[object Uint8Array]';\n\nexport const bufferToUint8Array = buffer => new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);\n\nconst textEncoder = new TextEncoder();\nconst stringToUint8Array = string => textEncoder.encode(string);\n\nconst textDecoder = new TextDecoder();\nexport const uint8ArrayToString = uint8Array => textDecoder.decode(uint8Array);\n\nexport const joinToString = (uint8ArraysOrStrings, encoding) => {\n\tconst strings = uint8ArraysToStrings(uint8ArraysOrStrings, encoding);\n\treturn strings.join('');\n};\n\nconst uint8ArraysToStrings = (uint8ArraysOrStrings, encoding) => {\n\tif (encoding === 'utf8' && uint8ArraysOrStrings.every(uint8ArrayOrString => typeof uint8ArrayOrString === 'string')) {\n\t\treturn uint8ArraysOrStrings;\n\t}\n\n\tconst decoder = new StringDecoder(encoding);\n\tconst strings = uint8ArraysOrStrings\n\t\t.map(uint8ArrayOrString => typeof uint8ArrayOrString === 'string'\n\t\t\t? stringToUint8Array(uint8ArrayOrString)\n\t\t\t: uint8ArrayOrString)\n\t\t.map(uint8Array => decoder.write(uint8Array));\n\tconst finalString = decoder.end();\n\treturn finalString === '' ? strings : [...strings, finalString];\n};\n\nexport const joinToUint8Array = uint8ArraysOrStrings => {\n\tif (uint8ArraysOrStrings.length === 1 && isUint8Array(uint8ArraysOrStrings[0])) {\n\t\treturn uint8ArraysOrStrings[0];\n\t}\n\n\treturn concatUint8Arrays(stringsToUint8Arrays(uint8ArraysOrStrings));\n};\n\nconst stringsToUint8Arrays = uint8ArraysOrStrings => uint8ArraysOrStrings.map(uint8ArrayOrString => typeof uint8ArrayOrString === 'string'\n\t? stringToUint8Array(uint8ArrayOrString)\n\t: uint8ArrayOrString);\n\nexport const concatUint8Arrays = uint8Arrays => {\n\tconst result = new Uint8Array(getJoinLength(uint8Arrays));\n\n\tlet index = 0;\n\tfor (const uint8Array of uint8Arrays) {\n\t\tresult.set(uint8Array, index);\n\t\tindex += uint8Array.length;\n\t}\n\n\treturn result;\n};\n\nconst getJoinLength = uint8Arrays => {\n\tlet joinLength = 0;\n\tfor (const uint8Array of uint8Arrays) {\n\t\tjoinLength += uint8Array.length;\n\t}\n\n\treturn joinLength;\n};\n","import {ChildProcess} from 'node:child_process';\nimport isPlainObject from 'is-plain-obj';\nimport {isUint8Array, uint8ArrayToString} from '../utils/uint-array.js';\n\n// Check whether the template string syntax is being used\nexport const isTemplateString = templates => Array.isArray(templates) && Array.isArray(templates.raw);\n\n// Convert execa`file ...commandArguments` to execa(file, commandArguments)\nexport const parseTemplates = (templates, expressions) => {\n\tlet tokens = [];\n\n\tfor (const [index, template] of templates.entries()) {\n\t\ttokens = parseTemplate({\n\t\t\ttemplates,\n\t\t\texpressions,\n\t\t\ttokens,\n\t\t\tindex,\n\t\t\ttemplate,\n\t\t});\n\t}\n\n\tif (tokens.length === 0) {\n\t\tthrow new TypeError('Template script must not be empty');\n\t}\n\n\tconst [file, ...commandArguments] = tokens;\n\treturn [file, commandArguments, {}];\n};\n\nconst parseTemplate = ({templates, expressions, tokens, index, template}) => {\n\tif (template === undefined) {\n\t\tthrow new TypeError(`Invalid backslash sequence: ${templates.raw[index]}`);\n\t}\n\n\tconst {nextTokens, leadingWhitespaces, trailingWhitespaces} = splitByWhitespaces(template, templates.raw[index]);\n\tconst newTokens = concatTokens(tokens, nextTokens, leadingWhitespaces);\n\n\tif (index === expressions.length) {\n\t\treturn newTokens;\n\t}\n\n\tconst expression = expressions[index];\n\tconst expressionTokens = Array.isArray(expression)\n\t\t? expression.map(expression => parseExpression(expression))\n\t\t: [parseExpression(expression)];\n\treturn concatTokens(newTokens, expressionTokens, trailingWhitespaces);\n};\n\n// Like `string.split(/[ \\t\\r\\n]+/)` except newlines and tabs are:\n// - ignored when input as a backslash sequence like: `echo foo\\n bar`\n// - not ignored when input directly\n// The only way to distinguish those in JavaScript is to use a tagged template and compare:\n// - the first array argument, which does not escape backslash sequences\n// - its `raw` property, which escapes them\nconst splitByWhitespaces = (template, rawTemplate) => {\n\tif (rawTemplate.length === 0) {\n\t\treturn {nextTokens: [], leadingWhitespaces: false, trailingWhitespaces: false};\n\t}\n\n\tconst nextTokens = [];\n\tlet templateStart = 0;\n\tconst leadingWhitespaces = DELIMITERS.has(rawTemplate[0]);\n\n\tfor (\n\t\tlet templateIndex = 0, rawIndex = 0;\n\t\ttemplateIndex < template.length;\n\t\ttemplateIndex += 1, rawIndex += 1\n\t) {\n\t\tconst rawCharacter = rawTemplate[rawIndex];\n\t\tif (DELIMITERS.has(rawCharacter)) {\n\t\t\tif (templateStart !== templateIndex) {\n\t\t\t\tnextTokens.push(template.slice(templateStart, templateIndex));\n\t\t\t}\n\n\t\t\ttemplateStart = templateIndex + 1;\n\t\t} else if (rawCharacter === '\\\\') {\n\t\t\tconst nextRawCharacter = rawTemplate[rawIndex + 1];\n\t\t\tif (nextRawCharacter === 'u' && rawTemplate[rawIndex + 2] === '{') {\n\t\t\t\trawIndex = rawTemplate.indexOf('}', rawIndex + 3);\n\t\t\t} else {\n\t\t\t\trawIndex += ESCAPE_LENGTH[nextRawCharacter] ?? 1;\n\t\t\t}\n\t\t}\n\t}\n\n\tconst trailingWhitespaces = templateStart === template.length;\n\tif (!trailingWhitespaces) {\n\t\tnextTokens.push(template.slice(templateStart));\n\t}\n\n\treturn {nextTokens, leadingWhitespaces, trailingWhitespaces};\n};\n\nconst DELIMITERS = new Set([' ', '\\t', '\\r', '\\n']);\n\n// Number of characters in backslash escape sequences: \\0 \\xXX or \\uXXXX\n// \\cX is allowed in RegExps but not in strings\n// Octal sequences are not allowed in strict mode\nconst ESCAPE_LENGTH = {x: 3, u: 5};\n\nconst concatTokens = (tokens, nextTokens, isSeparated) => isSeparated\n\t|| tokens.length === 0\n\t|| nextTokens.length === 0\n\t? [...tokens, ...nextTokens]\n\t: [\n\t\t...tokens.slice(0, -1),\n\t\t`${tokens.at(-1)}${nextTokens[0]}`,\n\t\t...nextTokens.slice(1),\n\t];\n\n// Handle `${expression}` inside the template string syntax\nconst parseExpression = expression => {\n\tconst typeOfExpression = typeof expression;\n\n\tif (typeOfExpression === 'string') {\n\t\treturn expression;\n\t}\n\n\tif (typeOfExpression === 'number') {\n\t\treturn String(expression);\n\t}\n\n\tif (isPlainObject(expression) && ('stdout' in expression || 'isMaxBuffer' in expression)) {\n\t\treturn getSubprocessResult(expression);\n\t}\n\n\tif (expression instanceof ChildProcess || Object.prototype.toString.call(expression) === '[object Promise]') {\n\t\t// eslint-disable-next-line no-template-curly-in-string\n\t\tthrow new TypeError('Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.');\n\t}\n\n\tthrow new TypeError(`Unexpected \"${typeOfExpression}\" in template expression`);\n};\n\nconst getSubprocessResult = ({stdout}) => {\n\tif (typeof stdout === 'string') {\n\t\treturn stdout;\n\t}\n\n\tif (isUint8Array(stdout)) {\n\t\treturn uint8ArrayToString(stdout);\n\t}\n\n\tif (stdout === undefined) {\n\t\tthrow new TypeError('Missing result.stdout in template expression. This is probably due to the previous subprocess\\' \"stdout\" option.');\n\t}\n\n\tthrow new TypeError(`Unexpected \"${typeof stdout}\" stdout in template expression`);\n};\n","import process from 'node:process';\n\nexport const isStandardStream = stream => STANDARD_STREAMS.includes(stream);\nexport const STANDARD_STREAMS = [process.stdin, process.stdout, process.stderr];\nexport const STANDARD_STREAMS_ALIASES = ['stdin', 'stdout', 'stderr'];\nexport const getStreamName = fdNumber => STANDARD_STREAMS_ALIASES[fdNumber] ?? `stdio[${fdNumber}]`;\n","import {debuglog} from 'node:util';\nimport isPlainObject from 'is-plain-obj';\nimport {STANDARD_STREAMS_ALIASES} from '../utils/standard-stream.js';\n\n// Some options can have different values for `stdout`/`stderr`/`fd3`.\n// This normalizes those to array of values.\n// For example, `{verbose: {stdout: 'none', stderr: 'full'}}` becomes `{verbose: ['none', 'none', 'full']}`\nexport const normalizeFdSpecificOptions = options => {\n\tconst optionsCopy = {...options};\n\n\tfor (const optionName of FD_SPECIFIC_OPTIONS) {\n\t\toptionsCopy[optionName] = normalizeFdSpecificOption(options, optionName);\n\t}\n\n\treturn optionsCopy;\n};\n\nexport const normalizeFdSpecificOption = (options, optionName) => {\n\tconst optionBaseArray = Array.from({length: getStdioLength(options) + 1});\n\tconst optionArray = normalizeFdSpecificValue(options[optionName], optionBaseArray, optionName);\n\treturn addDefaultValue(optionArray, optionName);\n};\n\nconst getStdioLength = ({stdio}) => Array.isArray(stdio)\n\t? Math.max(stdio.length, STANDARD_STREAMS_ALIASES.length)\n\t: STANDARD_STREAMS_ALIASES.length;\n\nconst normalizeFdSpecificValue = (optionValue, optionArray, optionName) => isPlainObject(optionValue)\n\t? normalizeOptionObject(optionValue, optionArray, optionName)\n\t: optionArray.fill(optionValue);\n\nconst normalizeOptionObject = (optionValue, optionArray, optionName) => {\n\tfor (const fdName of Object.keys(optionValue).sort(compareFdName)) {\n\t\tfor (const fdNumber of parseFdName(fdName, optionName, optionArray)) {\n\t\t\toptionArray[fdNumber] = optionValue[fdName];\n\t\t}\n\t}\n\n\treturn optionArray;\n};\n\n// Ensure priority order when setting both `stdout`/`stderr`, `fd1`/`fd2`, and `all`\nconst compareFdName = (fdNameA, fdNameB) => getFdNameOrder(fdNameA) < getFdNameOrder(fdNameB) ? 1 : -1;\n\nconst getFdNameOrder = fdName => {\n\tif (fdName === 'stdout' || fdName === 'stderr') {\n\t\treturn 0;\n\t}\n\n\treturn fdName === 'all' ? 2 : 1;\n};\n\nconst parseFdName = (fdName, optionName, optionArray) => {\n\tif (fdName === 'ipc') {\n\t\treturn [optionArray.length - 1];\n\t}\n\n\tconst fdNumber = parseFd(fdName);\n\tif (fdNumber === undefined || fdNumber === 0) {\n\t\tthrow new TypeError(`\"${optionName}.${fdName}\" is invalid.\nIt must be \"${optionName}.stdout\", \"${optionName}.stderr\", \"${optionName}.all\", \"${optionName}.ipc\", or \"${optionName}.fd3\", \"${optionName}.fd4\" (and so on).`);\n\t}\n\n\tif (fdNumber >= optionArray.length) {\n\t\tthrow new TypeError(`\"${optionName}.${fdName}\" is invalid: that file descriptor does not exist.\nPlease set the \"stdio\" option to ensure that file descriptor exists.`);\n\t}\n\n\treturn fdNumber === 'all' ? [1, 2] : [fdNumber];\n};\n\n// Use the same syntax for fd-specific options and the `from`/`to` options\nexport const parseFd = fdName => {\n\tif (fdName === 'all') {\n\t\treturn fdName;\n\t}\n\n\tif (STANDARD_STREAMS_ALIASES.includes(fdName)) {\n\t\treturn STANDARD_STREAMS_ALIASES.indexOf(fdName);\n\t}\n\n\tconst regexpResult = FD_REGEXP.exec(fdName);\n\tif (regexpResult !== null) {\n\t\treturn Number(regexpResult[1]);\n\t}\n};\n\nconst FD_REGEXP = /^fd(\\d+)$/;\n\nconst addDefaultValue = (optionArray, optionName) => optionArray.map(optionValue => optionValue === undefined\n\t? DEFAULT_OPTIONS[optionName]\n\t: optionValue);\n\n// Default value for the `verbose` option\nconst verboseDefault = debuglog('execa').enabled ? 'full' : 'none';\n\nconst DEFAULT_OPTIONS = {\n\tlines: false,\n\tbuffer: true,\n\tmaxBuffer: 1000 * 1000 * 100,\n\tverbose: verboseDefault,\n\tstripFinalNewline: true,\n};\n\n// List of options which can have different values for `stdout`/`stderr`\nexport const FD_SPECIFIC_OPTIONS = ['lines', 'buffer', 'maxBuffer', 'verbose', 'stripFinalNewline'];\n\n// Retrieve fd-specific option\nexport const getFdSpecificValue = (optionArray, fdNumber) => fdNumber === 'ipc'\n\t? optionArray.at(-1)\n\t: optionArray[fdNumber];\n","import {getFdSpecificValue} from '../arguments/specific.js';\n\n// The `verbose` option can have different values for `stdout`/`stderr`\nexport const isVerbose = ({verbose}, fdNumber) => getFdVerbose(verbose, fdNumber) !== 'none';\n\n// Whether IPC and output and logged\nexport const isFullVerbose = ({verbose}, fdNumber) => !['none', 'short'].includes(getFdVerbose(verbose, fdNumber));\n\n// The `verbose` option can be a function to customize logging\nexport const getVerboseFunction = ({verbose}, fdNumber) => {\n\tconst fdVerbose = getFdVerbose(verbose, fdNumber);\n\treturn isVerboseFunction(fdVerbose) ? fdVerbose : undefined;\n};\n\n// When using `verbose: {stdout, stderr, fd3, ipc}`:\n// - `verbose.stdout|stderr|fd3` is used for 'output'\n// - `verbose.ipc` is only used for 'ipc'\n// - highest `verbose.*` value is used for 'command', 'error' and 'duration'\nconst getFdVerbose = (verbose, fdNumber) => fdNumber === undefined\n\t? getFdGenericVerbose(verbose)\n\t: getFdSpecificValue(verbose, fdNumber);\n\n// When using `verbose: {stdout, stderr, fd3, ipc}` and logging is not specific to a file descriptor.\n// We then use the highest `verbose.*` value, using the following order:\n// - function > 'full' > 'short' > 'none'\n// - if several functions are defined: stdout > stderr > fd3 > ipc\nconst getFdGenericVerbose = verbose => verbose.find(fdVerbose => isVerboseFunction(fdVerbose))\n\t?? VERBOSE_VALUES.findLast(fdVerbose => verbose.includes(fdVerbose));\n\n// Whether the `verbose` option is customized using a function\nexport const isVerboseFunction = fdVerbose => typeof fdVerbose === 'function';\n\nexport const VERBOSE_VALUES = ['none', 'short', 'full'];\n","import {platform} from 'node:process';\nimport {stripVTControlCharacters} from 'node:util';\n\n// Compute `result.command` and `result.escapedCommand`\nexport const joinCommand = (filePath, rawArguments) => {\n\tconst fileAndArguments = [filePath, ...rawArguments];\n\tconst command = fileAndArguments.join(' ');\n\tconst escapedCommand = fileAndArguments\n\t\t.map(fileAndArgument => quoteString(escapeControlCharacters(fileAndArgument)))\n\t\t.join(' ');\n\treturn {command, escapedCommand};\n};\n\n// Remove ANSI sequences and escape control characters and newlines\nexport const escapeLines = lines => stripVTControlCharacters(lines)\n\t.split('\\n')\n\t.map(line => escapeControlCharacters(line))\n\t.join('\\n');\n\nconst escapeControlCharacters = line => line.replaceAll(SPECIAL_CHAR_REGEXP, character => escapeControlCharacter(character));\n\nconst escapeControlCharacter = character => {\n\tconst commonEscape = COMMON_ESCAPES[character];\n\tif (commonEscape !== undefined) {\n\t\treturn commonEscape;\n\t}\n\n\tconst codepoint = character.codePointAt(0);\n\tconst codepointHex = codepoint.toString(16);\n\treturn codepoint <= ASTRAL_START\n\t\t? `\\\\u${codepointHex.padStart(4, '0')}`\n\t\t: `\\\\U${codepointHex}`;\n};\n\n// Characters that would create issues when printed are escaped using the \\u or \\U notation.\n// Those include control characters and newlines.\n// The \\u and \\U notation is Bash specific, but there is no way to do this in a shell-agnostic way.\n// Some shells do not even have a way to print those characters in an escaped fashion.\n// Therefore, we prioritize printing those safely, instead of allowing those to be copy-pasted.\n// List of Unicode character categories: https://www.fileformat.info/info/unicode/category/index.htm\nconst getSpecialCharRegExp = () => {\n\ttry {\n\t\t// This throws when using Node.js without ICU support.\n\t\t// When using a RegExp literal, this would throw at parsing-time, instead of runtime.\n\t\t// eslint-disable-next-line prefer-regex-literals\n\t\treturn new RegExp('\\\\p{Separator}|\\\\p{Other}', 'gu');\n\t} catch {\n\t\t// Similar to the above RegExp, but works even when Node.js has been built without ICU support.\n\t\t// Unlike the above RegExp, it only covers whitespaces and C0/C1 control characters.\n\t\t// It does not cover some edge cases, such as Unicode reserved characters.\n\t\t// See https://github.com/sindresorhus/execa/issues/1143\n\t\t// eslint-disable-next-line no-control-regex\n\t\treturn /[\\s\\u0000-\\u001F\\u007F-\\u009F\\u00AD]/g;\n\t}\n};\n\nconst SPECIAL_CHAR_REGEXP = getSpecialCharRegExp();\n\n// Accepted by $'...' in Bash.\n// Exclude \\a \\e \\v which are accepted in Bash but not in JavaScript (except \\v) and JSON.\nconst COMMON_ESCAPES = {\n\t' ': ' ',\n\t'\\b': '\\\\b',\n\t'\\f': '\\\\f',\n\t'\\n': '\\\\n',\n\t'\\r': '\\\\r',\n\t'\\t': '\\\\t',\n};\n\n// Up until that codepoint, \\u notation can be used instead of \\U\nconst ASTRAL_START = 65_535;\n\n// Some characters are shell-specific, i.e. need to be escaped when the command is copy-pasted then run.\n// Escaping is shell-specific. We cannot know which shell is used: `process.platform` detection is not enough.\n// For example, Windows users could be using `cmd.exe`, Powershell or Bash for Windows which all use different escaping.\n// We use '...' on Unix, which is POSIX shell compliant and escape all characters but ' so this is fairly safe.\n// On Windows, we assume cmd.exe is used and escape with \"...\", which also works with Powershell.\nconst quoteString = escapedArgument => {\n\tif (NO_ESCAPE_REGEXP.test(escapedArgument)) {\n\t\treturn escapedArgument;\n\t}\n\n\treturn platform === 'win32'\n\t\t? `\"${escapedArgument.replaceAll('\"', '\"\"')}\"`\n\t\t: `'${escapedArgument.replaceAll('\\'', '\\'\\\\\\'\\'')}'`;\n};\n\nconst NO_ESCAPE_REGEXP = /^[\\w./-]+$/;\n","import isUnicodeSupported from 'is-unicode-supported';\n\nconst common = {\n\tcircleQuestionMark: '(?)',\n\tquestionMarkPrefix: '(?)',\n\tsquare: '█',\n\tsquareDarkShade: '▓',\n\tsquareMediumShade: '▒',\n\tsquareLightShade: '░',\n\tsquareTop: '▀',\n\tsquareBottom: '▄',\n\tsquareLeft: '▌',\n\tsquareRight: '▐',\n\tsquareCenter: '■',\n\tbullet: '●',\n\tdot: '․',\n\tellipsis: '…',\n\tpointerSmall: '›',\n\ttriangleUp: '▲',\n\ttriangleUpSmall: '▴',\n\ttriangleDown: '▼',\n\ttriangleDownSmall: '▾',\n\ttriangleLeftSmall: '◂',\n\ttriangleRightSmall: '▸',\n\thome: '⌂',\n\theart: '♥',\n\tmusicNote: '♪',\n\tmusicNoteBeamed: '♫',\n\tarrowUp: '↑',\n\tarrowDown: '↓',\n\tarrowLeft: '←',\n\tarrowRight: '→',\n\tarrowLeftRight: '↔',\n\tarrowUpDown: '↕',\n\talmostEqual: '≈',\n\tnotEqual: '≠',\n\tlessOrEqual: '≤',\n\tgreaterOrEqual: '≥',\n\tidentical: '≡',\n\tinfinity: '∞',\n\tsubscriptZero: '₀',\n\tsubscriptOne: '₁',\n\tsubscriptTwo: '₂',\n\tsubscriptThree: '₃',\n\tsubscriptFour: '₄',\n\tsubscriptFive: '₅',\n\tsubscriptSix: '₆',\n\tsubscriptSeven: '₇',\n\tsubscriptEight: '₈',\n\tsubscriptNine: '₉',\n\toneHalf: '½',\n\toneThird: '⅓',\n\toneQuarter: '¼',\n\toneFifth: '⅕',\n\toneSixth: '⅙',\n\toneEighth: '⅛',\n\ttwoThirds: '⅔',\n\ttwoFifths: '⅖',\n\tthreeQuarters: '¾',\n\tthreeFifths: '⅗',\n\tthreeEighths: '⅜',\n\tfourFifths: '⅘',\n\tfiveSixths: '⅚',\n\tfiveEighths: '⅝',\n\tsevenEighths: '⅞',\n\tline: '─',\n\tlineBold: '━',\n\tlineDouble: '═',\n\tlineDashed0: '┄',\n\tlineDashed1: '┅',\n\tlineDashed2: '┈',\n\tlineDashed3: '┉',\n\tlineDashed4: '╌',\n\tlineDashed5: '╍',\n\tlineDashed6: '╴',\n\tlineDashed7: '╶',\n\tlineDashed8: '╸',\n\tlineDashed9: '╺',\n\tlineDashed10: '╼',\n\tlineDashed11: '╾',\n\tlineDashed12: '−',\n\tlineDashed13: '–',\n\tlineDashed14: '‐',\n\tlineDashed15: '⁃',\n\tlineVertical: '│',\n\tlineVerticalBold: '┃',\n\tlineVerticalDouble: '║',\n\tlineVerticalDashed0: '┆',\n\tlineVerticalDashed1: '┇',\n\tlineVerticalDashed2: '┊',\n\tlineVerticalDashed3: '┋',\n\tlineVerticalDashed4: '╎',\n\tlineVerticalDashed5: '╏',\n\tlineVerticalDashed6: '╵',\n\tlineVerticalDashed7: '╷',\n\tlineVerticalDashed8: '╹',\n\tlineVerticalDashed9: '╻',\n\tlineVerticalDashed10: '╽',\n\tlineVerticalDashed11: '╿',\n\tlineDownLeft: '┐',\n\tlineDownLeftArc: '╮',\n\tlineDownBoldLeftBold: '┓',\n\tlineDownBoldLeft: '┒',\n\tlineDownLeftBold: '┑',\n\tlineDownDoubleLeftDouble: '╗',\n\tlineDownDoubleLeft: '╖',\n\tlineDownLeftDouble: '╕',\n\tlineDownRight: '┌',\n\tlineDownRightArc: '╭',\n\tlineDownBoldRightBold: '┏',\n\tlineDownBoldRight: '┎',\n\tlineDownRightBold: '┍',\n\tlineDownDoubleRightDouble: '╔',\n\tlineDownDoubleRight: '╓',\n\tlineDownRightDouble: '╒',\n\tlineUpLeft: '┘',\n\tlineUpLeftArc: '╯',\n\tlineUpBoldLeftBold: '┛',\n\tlineUpBoldLeft: '┚',\n\tlineUpLeftBold: '┙',\n\tlineUpDoubleLeftDouble: '╝',\n\tlineUpDoubleLeft: '╜',\n\tlineUpLeftDouble: '╛',\n\tlineUpRight: '└',\n\tlineUpRightArc: '╰',\n\tlineUpBoldRightBold: '┗',\n\tlineUpBoldRight: '┖',\n\tlineUpRightBold: '┕',\n\tlineUpDoubleRightDouble: '╚',\n\tlineUpDoubleRight: '╙',\n\tlineUpRightDouble: '╘',\n\tlineUpDownLeft: '┤',\n\tlineUpBoldDownBoldLeftBold: '┫',\n\tlineUpBoldDownBoldLeft: '┨',\n\tlineUpDownLeftBold: '┥',\n\tlineUpBoldDownLeftBold: '┩',\n\tlineUpDownBoldLeftBold: '┪',\n\tlineUpDownBoldLeft: '┧',\n\tlineUpBoldDownLeft: '┦',\n\tlineUpDoubleDownDoubleLeftDouble: '╣',\n\tlineUpDoubleDownDoubleLeft: '╢',\n\tlineUpDownLeftDouble: '╡',\n\tlineUpDownRight: '├',\n\tlineUpBoldDownBoldRightBold: '┣',\n\tlineUpBoldDownBoldRight: '┠',\n\tlineUpDownRightBold: '┝',\n\tlineUpBoldDownRightBold: '┡',\n\tlineUpDownBoldRightBold: '┢',\n\tlineUpDownBoldRight: '┟',\n\tlineUpBoldDownRight: '┞',\n\tlineUpDoubleDownDoubleRightDouble: '╠',\n\tlineUpDoubleDownDoubleRight: '╟',\n\tlineUpDownRightDouble: '╞',\n\tlineDownLeftRight: '┬',\n\tlineDownBoldLeftBoldRightBold: '┳',\n\tlineDownLeftBoldRightBold: '┯',\n\tlineDownBoldLeftRight: '┰',\n\tlineDownBoldLeftBoldRight: '┱',\n\tlineDownBoldLeftRightBold: '┲',\n\tlineDownLeftRightBold: '┮',\n\tlineDownLeftBoldRight: '┭',\n\tlineDownDoubleLeftDoubleRightDouble: '╦',\n\tlineDownDoubleLeftRight: '╥',\n\tlineDownLeftDoubleRightDouble: '╤',\n\tlineUpLeftRight: '┴',\n\tlineUpBoldLeftBoldRightBold: '┻',\n\tlineUpLeftBoldRightBold: '┷',\n\tlineUpBoldLeftRight: '┸',\n\tlineUpBoldLeftBoldRight: '┹',\n\tlineUpBoldLeftRightBold: '┺',\n\tlineUpLeftRightBold: '┶',\n\tlineUpLeftBoldRight: '┵',\n\tlineUpDoubleLeftDoubleRightDouble: '╩',\n\tlineUpDoubleLeftRight: '╨',\n\tlineUpLeftDoubleRightDouble: '╧',\n\tlineUpDownLeftRight: '┼',\n\tlineUpBoldDownBoldLeftBoldRightBold: '╋',\n\tlineUpDownBoldLeftBoldRightBold: '╈',\n\tlineUpBoldDownLeftBoldRightBold: '╇',\n\tlineUpBoldDownBoldLeftRightBold: '╊',\n\tlineUpBoldDownBoldLeftBoldRight: '╉',\n\tlineUpBoldDownLeftRight: '╀',\n\tlineUpDownBoldLeftRight: '╁',\n\tlineUpDownLeftBoldRight: '┽',\n\tlineUpDownLeftRightBold: '┾',\n\tlineUpBoldDownBoldLeftRight: '╂',\n\tlineUpDownLeftBoldRightBold: '┿',\n\tlineUpBoldDownLeftBoldRight: '╃',\n\tlineUpBoldDownLeftRightBold: '╄',\n\tlineUpDownBoldLeftBoldRight: '╅',\n\tlineUpDownBoldLeftRightBold: '╆',\n\tlineUpDoubleDownDoubleLeftDoubleRightDouble: '╬',\n\tlineUpDoubleDownDoubleLeftRight: '╫',\n\tlineUpDownLeftDoubleRightDouble: '╪',\n\tlineCross: '╳',\n\tlineBackslash: '╲',\n\tlineSlash: '╱',\n};\n\nconst specialMainSymbols = {\n\ttick: '✔',\n\tinfo: 'ℹ',\n\twarning: '⚠',\n\tcross: '✘',\n\tsquareSmall: '◻',\n\tsquareSmallFilled: '◼',\n\tcircle: '◯',\n\tcircleFilled: '◉',\n\tcircleDotted: '◌',\n\tcircleDouble: '◎',\n\tcircleCircle: 'ⓞ',\n\tcircleCross: 'ⓧ',\n\tcirclePipe: 'Ⓘ',\n\tradioOn: '◉',\n\tradioOff: '◯',\n\tcheckboxOn: '☒',\n\tcheckboxOff: '☐',\n\tcheckboxCircleOn: 'ⓧ',\n\tcheckboxCircleOff: 'Ⓘ',\n\tpointer: '❯',\n\ttriangleUpOutline: '△',\n\ttriangleLeft: '◀',\n\ttriangleRight: '▶',\n\tlozenge: '◆',\n\tlozengeOutline: '◇',\n\thamburger: '☰',\n\tsmiley: '㋡',\n\tmustache: '෴',\n\tstar: '★',\n\tplay: '▶',\n\tnodejs: '⬢',\n\toneSeventh: '⅐',\n\toneNinth: '⅑',\n\toneTenth: '⅒',\n};\n\nconst specialFallbackSymbols = {\n\ttick: '√',\n\tinfo: 'i',\n\twarning: '‼',\n\tcross: '×',\n\tsquareSmall: '□',\n\tsquareSmallFilled: '■',\n\tcircle: '( )',\n\tcircleFilled: '(*)',\n\tcircleDotted: '( )',\n\tcircleDouble: '( )',\n\tcircleCircle: '(○)',\n\tcircleCross: '(×)',\n\tcirclePipe: '(│)',\n\tradioOn: '(*)',\n\tradioOff: '( )',\n\tcheckboxOn: '[×]',\n\tcheckboxOff: '[ ]',\n\tcheckboxCircleOn: '(×)',\n\tcheckboxCircleOff: '( )',\n\tpointer: '>',\n\ttriangleUpOutline: '∆',\n\ttriangleLeft: '◄',\n\ttriangleRight: '►',\n\tlozenge: '♦',\n\tlozengeOutline: '◊',\n\thamburger: '≡',\n\tsmiley: '☺',\n\tmustache: '┌─┐',\n\tstar: '✶',\n\tplay: '►',\n\tnodejs: '♦',\n\toneSeventh: '1/7',\n\toneNinth: '1/9',\n\toneTenth: '1/10',\n};\n\nexport const mainSymbols = {...common, ...specialMainSymbols};\nexport const fallbackSymbols = {...common, ...specialFallbackSymbols};\n\nconst shouldUseMain = isUnicodeSupported();\nconst figures = shouldUseMain ? mainSymbols : fallbackSymbols;\nexport default figures;\n\nconst replacements = Object.entries(specialMainSymbols);\n\n// On terminals which do not support Unicode symbols, substitute them to other symbols\nexport const replaceSymbols = (string, {useFallback = !shouldUseMain} = {}) => {\n\tif (useFallback) {\n\t\tfor (const [key, mainSymbol] of replacements) {\n\t\t\tstring = string.replaceAll(mainSymbol, fallbackSymbols[key]);\n\t\t}\n\t}\n\n\treturn string;\n};\n","import process from 'node:process';\n\nexport default function isUnicodeSupported() {\n\tconst {env} = process;\n\tconst {TERM, TERM_PROGRAM} = env;\n\n\tif (process.platform !== 'win32') {\n\t\treturn TERM !== 'linux'; // Linux console (kernel)\n\t}\n\n\treturn Boolean(env.WT_SESSION) // Windows Terminal\n\t\t|| Boolean(env.TERMINUS_SUBLIME) // Terminus (<0.2.27)\n\t\t|| env.ConEmuTask === '{cmd::Cmder}' // ConEmu and cmder\n\t\t|| TERM_PROGRAM === 'Terminus-Sublime'\n\t\t|| TERM_PROGRAM === 'vscode'\n\t\t|| TERM === 'xterm-256color'\n\t\t|| TERM === 'alacritty'\n\t\t|| TERM === 'rxvt-unicode'\n\t\t|| TERM === 'rxvt-unicode-256color'\n\t\t|| env.TERMINAL_EMULATOR === 'JetBrains-JediTerm';\n}\n","import tty from 'node:tty';\n\n// eslint-disable-next-line no-warning-comments\n// TODO: Use a better method when it's added to Node.js (https://github.com/nodejs/node/pull/40240)\n// Lots of optionals here to support Deno.\nconst hasColors = tty?.WriteStream?.prototype?.hasColors?.() ?? false;\n\nconst format = (open, close) => {\n\tif (!hasColors) {\n\t\treturn input => input;\n\t}\n\n\tconst openCode = `\\u001B[${open}m`;\n\tconst closeCode = `\\u001B[${close}m`;\n\n\treturn input => {\n\t\tconst string = input + ''; // eslint-disable-line no-implicit-coercion -- This is faster.\n\t\tlet index = string.indexOf(closeCode);\n\n\t\tif (index === -1) {\n\t\t\t// Note: Intentionally not using string interpolation for performance reasons.\n\t\t\treturn openCode + string + closeCode;\n\t\t}\n\n\t\t// Handle nested colors.\n\n\t\t// We could have done this, but it's too slow (as of Node.js 22).\n\t\t// return openCode + string.replaceAll(closeCode, openCode) + closeCode;\n\n\t\tlet result = openCode;\n\t\tlet lastIndex = 0;\n\n\t\twhile (index !== -1) {\n\t\t\tresult += string.slice(lastIndex, index) + openCode;\n\t\t\tlastIndex = index + closeCode.length;\n\t\t\tindex = string.indexOf(closeCode, lastIndex);\n\t\t}\n\n\t\tresult += string.slice(lastIndex) + closeCode;\n\n\t\treturn result;\n\t};\n};\n\nexport const reset = format(0, 0);\nexport const bold = format(1, 22);\nexport const dim = format(2, 22);\nexport const italic = format(3, 23);\nexport const underline = format(4, 24);\nexport const overline = format(53, 55);\nexport const inverse = format(7, 27);\nexport const hidden = format(8, 28);\nexport const strikethrough = format(9, 29);\n\nexport const black = format(30, 39);\nexport const red = format(31, 39);\nexport const green = format(32, 39);\nexport const yellow = format(33, 39);\nexport const blue = format(34, 39);\nexport const magenta = format(35, 39);\nexport const cyan = format(36, 39);\nexport const white = format(37, 39);\nexport const gray = format(90, 39);\n\nexport const bgBlack = format(40, 49);\nexport const bgRed = format(41, 49);\nexport const bgGreen = format(42, 49);\nexport const bgYellow = format(43, 49);\nexport const bgBlue = format(44, 49);\nexport const bgMagenta = format(45, 49);\nexport const bgCyan = format(46, 49);\nexport const bgWhite = format(47, 49);\nexport const bgGray = format(100, 49);\n\nexport const redBright = format(91, 39);\nexport const greenBright = format(92, 39);\nexport const yellowBright = format(93, 39);\nexport const blueBright = format(94, 39);\nexport const magentaBright = format(95, 39);\nexport const cyanBright = format(96, 39);\nexport const whiteBright = format(97, 39);\n\nexport const bgRedBright = format(101, 49);\nexport const bgGreenBright = format(102, 49);\nexport const bgYellowBright = format(103, 49);\nexport const bgBlueBright = format(104, 49);\nexport const bgMagentaBright = format(105, 49);\nexport const bgCyanBright = format(106, 49);\nexport const bgWhiteBright = format(107, 49);\n","import figures from 'figures';\nimport {\n\tgray,\n\tbold,\n\tredBright,\n\tyellowBright,\n} from 'yoctocolors';\n\n// Default when `verbose` is not a function\nexport const defaultVerboseFunction = ({\n\ttype,\n\tmessage,\n\ttimestamp,\n\tpiped,\n\tcommandId,\n\tresult: {failed = false} = {},\n\toptions: {reject = true},\n}) => {\n\tconst timestampString = serializeTimestamp(timestamp);\n\tconst icon = ICONS[type]({failed, reject, piped});\n\tconst color = COLORS[type]({reject});\n\treturn `${gray(`[${timestampString}]`)} ${gray(`[${commandId}]`)} ${color(icon)} ${color(message)}`;\n};\n\n// Prepending the timestamp allows debugging the slow paths of a subprocess\nconst serializeTimestamp = timestamp => `${padField(timestamp.getHours(), 2)}:${padField(timestamp.getMinutes(), 2)}:${padField(timestamp.getSeconds(), 2)}.${padField(timestamp.getMilliseconds(), 3)}`;\n\nconst padField = (field, padding) => String(field).padStart(padding, '0');\n\nconst getFinalIcon = ({failed, reject}) => {\n\tif (!failed) {\n\t\treturn figures.tick;\n\t}\n\n\treturn reject ? figures.cross : figures.warning;\n};\n\nconst ICONS = {\n\tcommand: ({piped}) => piped ? '|' : '$',\n\toutput: () => ' ',\n\tipc: () => '*',\n\terror: getFinalIcon,\n\tduration: getFinalIcon,\n};\n\nconst identity = string => string;\n\nconst COLORS = {\n\tcommand: () => bold,\n\toutput: () => identity,\n\tipc: () => identity,\n\terror: ({reject}) => reject ? redBright : yellowBright,\n\tduration: () => gray,\n};\n","import {getVerboseFunction} from './values.js';\n\n// Apply the `verbose` function on each line\nexport const applyVerboseOnLines = (printedLines, verboseInfo, fdNumber) => {\n\tconst verboseFunction = getVerboseFunction(verboseInfo, fdNumber);\n\treturn printedLines\n\t\t.map(({verboseLine, verboseObject}) => applyVerboseFunction(verboseLine, verboseObject, verboseFunction))\n\t\t.filter(printedLine => printedLine !== undefined)\n\t\t.map(printedLine => appendNewline(printedLine))\n\t\t.join('');\n};\n\nconst applyVerboseFunction = (verboseLine, verboseObject, verboseFunction) => {\n\tif (verboseFunction === undefined) {\n\t\treturn verboseLine;\n\t}\n\n\tconst printedLine = verboseFunction(verboseLine, verboseObject);\n\tif (typeof printedLine === 'string') {\n\t\treturn printedLine;\n\t}\n};\n\nconst appendNewline = printedLine => printedLine.endsWith('\\n')\n\t? printedLine\n\t: `${printedLine}\\n`;\n","import {writeFileSync} from 'node:fs';\nimport {inspect} from 'node:util';\nimport {escapeLines} from '../arguments/escape.js';\nimport {defaultVerboseFunction} from './default.js';\nimport {applyVerboseOnLines} from './custom.js';\n\n// Write synchronously to ensure lines are properly ordered and not interleaved with `stdout`\nexport const verboseLog = ({type, verboseMessage, fdNumber, verboseInfo, result}) => {\n\tconst verboseObject = getVerboseObject({type, result, verboseInfo});\n\tconst printedLines = getPrintedLines(verboseMessage, verboseObject);\n\tconst finalLines = applyVerboseOnLines(printedLines, verboseInfo, fdNumber);\n\twriteFileSync(STDERR_FD, finalLines);\n};\n\nconst getVerboseObject = ({\n\ttype,\n\tresult,\n\tverboseInfo: {escapedCommand, commandId, rawOptions: {piped = false, ...options}},\n}) => ({\n\ttype,\n\tescapedCommand,\n\tcommandId: `${commandId}`,\n\ttimestamp: new Date(),\n\tpiped,\n\tresult,\n\toptions,\n});\n\nconst getPrintedLines = (verboseMessage, verboseObject) => verboseMessage\n\t.split('\\n')\n\t.map(message => getPrintedLine({...verboseObject, message}));\n\nconst getPrintedLine = verboseObject => {\n\tconst verboseLine = defaultVerboseFunction(verboseObject);\n\treturn {verboseLine, verboseObject};\n};\n\n// Unless a `verbose` function is used, print all logs on `stderr`\nconst STDERR_FD = 2;\n\n// Serialize any type to a line string, for logging\nexport const serializeVerboseMessage = message => {\n\tconst messageString = typeof message === 'string' ? message : inspect(message);\n\tconst escapedMessage = escapeLines(messageString);\n\treturn escapedMessage.replaceAll('\\t', ' '.repeat(TAB_SIZE));\n};\n\n// Same as `util.inspect()`\nconst TAB_SIZE = 2;\n","import {isVerbose, VERBOSE_VALUES, isVerboseFunction} from './values.js';\n\n// Information computed before spawning, used by the `verbose` option\nexport const getVerboseInfo = (verbose, escapedCommand, rawOptions) => {\n\tvalidateVerbose(verbose);\n\tconst commandId = getCommandId(verbose);\n\treturn {\n\t\tverbose,\n\t\tescapedCommand,\n\t\tcommandId,\n\t\trawOptions,\n\t};\n};\n\nconst getCommandId = verbose => isVerbose({verbose}) ? COMMAND_ID++ : undefined;\n\n// Prepending the `pid` is useful when multiple commands print their output at the same time.\n// However, we cannot use the real PID since this is not available with `child_process.spawnSync()`.\n// Also, we cannot use the real PID if we want to print it before `child_process.spawn()` is run.\n// As a pro, it is shorter than a normal PID and never re-uses the same id.\n// As a con, it cannot be used to send signals.\nlet COMMAND_ID = 0n;\n\nconst validateVerbose = verbose => {\n\tfor (const fdVerbose of verbose) {\n\t\tif (fdVerbose === false) {\n\t\t\tthrow new TypeError('The \"verbose: false\" option was renamed to \"verbose: \\'none\\'\".');\n\t\t}\n\n\t\tif (fdVerbose === true) {\n\t\t\tthrow new TypeError('The \"verbose: true\" option was renamed to \"verbose: \\'short\\'\".');\n\t\t}\n\n\t\tif (!VERBOSE_VALUES.includes(fdVerbose) && !isVerboseFunction(fdVerbose)) {\n\t\t\tconst allowedValues = VERBOSE_VALUES.map(allowedValue => `'${allowedValue}'`).join(', ');\n\t\t\tthrow new TypeError(`The \"verbose\" option must not be ${fdVerbose}. Allowed values are: ${allowedValues} or a function.`);\n\t\t}\n\t}\n};\n","import {hrtime} from 'node:process';\n\n// Start counting time before spawning the subprocess\nexport const getStartTime = () => hrtime.bigint();\n\n// Compute duration after the subprocess ended.\n// Printed by the `verbose` option.\nexport const getDurationMs = startTime => Number(hrtime.bigint() - startTime) / 1e6;\n","import {logCommand} from '../verbose/start.js';\nimport {getVerboseInfo} from '../verbose/info.js';\nimport {getStartTime} from '../return/duration.js';\nimport {joinCommand} from './escape.js';\nimport {normalizeFdSpecificOption} from './specific.js';\n\n// Compute `result.command`, `result.escapedCommand` and `verbose`-related information\nexport const handleCommand = (filePath, rawArguments, rawOptions) => {\n\tconst startTime = getStartTime();\n\tconst {command, escapedCommand} = joinCommand(filePath, rawArguments);\n\tconst verbose = normalizeFdSpecificOption(rawOptions, 'verbose');\n\tconst verboseInfo = getVerboseInfo(verbose, escapedCommand, {...rawOptions});\n\tlogCommand(escapedCommand, verboseInfo);\n\treturn {\n\t\tcommand,\n\t\tescapedCommand,\n\t\tstartTime,\n\t\tverboseInfo,\n\t};\n};\n","import {isVerbose} from './values.js';\nimport {verboseLog} from './log.js';\n\n// When `verbose` is `short|full|custom`, print each command\nexport const logCommand = (escapedCommand, verboseInfo) => {\n\tif (!isVerbose(verboseInfo)) {\n\t\treturn;\n\t}\n\n\tverboseLog({\n\t\ttype: 'command',\n\t\tverboseMessage: escapedCommand,\n\t\tverboseInfo,\n\t});\n};\n","module.exports = isexe\nisexe.sync = sync\n\nvar fs = require('fs')\n\nfunction checkPathExt (path, options) {\n var pathext = options.pathExt !== undefined ?\n options.pathExt : process.env.PATHEXT\n\n if (!pathext) {\n return true\n }\n\n pathext = pathext.split(';')\n if (pathext.indexOf('') !== -1) {\n return true\n }\n for (var i = 0; i < pathext.length; i++) {\n var p = pathext[i].toLowerCase()\n if (p && path.substr(-p.length).toLowerCase() === p) {\n return true\n }\n }\n return false\n}\n\nfunction checkStat (stat, path, options) {\n if (!stat.isSymbolicLink() && !stat.isFile()) {\n return false\n }\n return checkPathExt(path, options)\n}\n\nfunction isexe (path, options, cb) {\n fs.stat(path, function (er, stat) {\n cb(er, er ? false : checkStat(stat, path, options))\n })\n}\n\nfunction sync (path, options) {\n return checkStat(fs.statSync(path), path, options)\n}\n","module.exports = isexe\nisexe.sync = sync\n\nvar fs = require('fs')\n\nfunction isexe (path, options, cb) {\n fs.stat(path, function (er, stat) {\n cb(er, er ? false : checkStat(stat, options))\n })\n}\n\nfunction sync (path, options) {\n return checkStat(fs.statSync(path), options)\n}\n\nfunction checkStat (stat, options) {\n return stat.isFile() && checkMode(stat, options)\n}\n\nfunction checkMode (stat, options) {\n var mod = stat.mode\n var uid = stat.uid\n var gid = stat.gid\n\n var myUid = options.uid !== undefined ?\n options.uid : process.getuid && process.getuid()\n var myGid = options.gid !== undefined ?\n options.gid : process.getgid && process.getgid()\n\n var u = parseInt('100', 8)\n var g = parseInt('010', 8)\n var o = parseInt('001', 8)\n var ug = u | g\n\n var ret = (mod & o) ||\n (mod & g) && gid === myGid ||\n (mod & u) && uid === myUid ||\n (mod & ug) && myUid === 0\n\n return ret\n}\n","const isWindows = process.platform === 'win32' ||\n process.env.OSTYPE === 'cygwin' ||\n process.env.OSTYPE === 'msys'\n\nconst path = require('path')\nconst COLON = isWindows ? ';' : ':'\nconst isexe = require('isexe')\n\nconst getNotFoundError = (cmd) =>\n Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' })\n\nconst getPathInfo = (cmd, opt) => {\n const colon = opt.colon || COLON\n\n // If it has a slash, then we don't bother searching the pathenv.\n // just check the file itself, and that's it.\n const pathEnv = cmd.match(/\\//) || isWindows && cmd.match(/\\\\/) ? ['']\n : (\n [\n // windows always checks the cwd first\n ...(isWindows ? [process.cwd()] : []),\n ...(opt.path || process.env.PATH ||\n /* istanbul ignore next: very unusual */ '').split(colon),\n ]\n )\n const pathExtExe = isWindows\n ? opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM'\n : ''\n const pathExt = isWindows ? pathExtExe.split(colon) : ['']\n\n if (isWindows) {\n if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')\n pathExt.unshift('')\n }\n\n return {\n pathEnv,\n pathExt,\n pathExtExe,\n }\n}\n\nconst which = (cmd, opt, cb) => {\n if (typeof opt === 'function') {\n cb = opt\n opt = {}\n }\n if (!opt)\n opt = {}\n\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n const step = i => new Promise((resolve, reject) => {\n if (i === pathEnv.length)\n return opt.all && found.length ? resolve(found)\n : reject(getNotFoundError(cmd))\n\n const ppRaw = pathEnv[i]\n const pathPart = /^\".*\"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw\n\n const pCmd = path.join(pathPart, cmd)\n const p = !pathPart && /^\\.[\\\\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd\n : pCmd\n\n resolve(subStep(p, i, 0))\n })\n\n const subStep = (p, i, ii) => new Promise((resolve, reject) => {\n if (ii === pathExt.length)\n return resolve(step(i + 1))\n const ext = pathExt[ii]\n isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {\n if (!er && is) {\n if (opt.all)\n found.push(p + ext)\n else\n return resolve(p + ext)\n }\n return resolve(subStep(p, i, ii + 1))\n })\n })\n\n return cb ? step(0).then(res => cb(null, res), cb) : step(0)\n}\n\nconst whichSync = (cmd, opt) => {\n opt = opt || {}\n\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n for (let i = 0; i < pathEnv.length; i ++) {\n const ppRaw = pathEnv[i]\n const pathPart = /^\".*\"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw\n\n const pCmd = path.join(pathPart, cmd)\n const p = !pathPart && /^\\.[\\\\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd\n : pCmd\n\n for (let j = 0; j < pathExt.length; j ++) {\n const cur = p + pathExt[j]\n try {\n const is = isexe.sync(cur, { pathExt: pathExtExe })\n if (is) {\n if (opt.all)\n found.push(cur)\n else\n return cur\n }\n } catch (ex) {}\n }\n }\n\n if (opt.all && found.length)\n return found\n\n if (opt.nothrow)\n return null\n\n throw getNotFoundError(cmd)\n}\n\nmodule.exports = which\nwhich.sync = whichSync\n","'use strict';\n\nconst pathKey = (options = {}) => {\n\tconst environment = options.env || process.env;\n\tconst platform = options.platform || process.platform;\n\n\tif (platform !== 'win32') {\n\t\treturn 'PATH';\n\t}\n\n\treturn Object.keys(environment).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path';\n};\n\nmodule.exports = pathKey;\n// TODO: Remove this for the next major release\nmodule.exports.default = pathKey;\n","'use strict';\n\n// See http://www.robvanderwoude.com/escapechars.php\nconst metaCharsRegExp = /([()\\][%!^\"`<>&|;, *?])/g;\n\nfunction escapeCommand(arg) {\n // Escape meta chars\n arg = arg.replace(metaCharsRegExp, '^$1');\n\n return arg;\n}\n\nfunction escapeArgument(arg, doubleEscapeMetaChars) {\n // Convert to string\n arg = `${arg}`;\n\n // Algorithm below is based on https://qntm.org/cmd\n\n // Sequence of backslashes followed by a double quote:\n // double up all the backslashes and escape the double quote\n arg = arg.replace(/(\\\\*)\"/g, '$1$1\\\\\"');\n\n // Sequence of backslashes followed by the end of the string\n // (which will become a double quote later):\n // double up all the backslashes\n arg = arg.replace(/(\\\\*)$/, '$1$1');\n\n // All other backslashes occur literally\n\n // Quote the whole thing:\n arg = `\"${arg}\"`;\n\n // Escape meta chars\n arg = arg.replace(metaCharsRegExp, '^$1');\n\n // Double escape meta chars if necessary\n if (doubleEscapeMetaChars) {\n arg = arg.replace(metaCharsRegExp, '^$1');\n }\n\n return arg;\n}\n\nmodule.exports.command = escapeCommand;\nmodule.exports.argument = escapeArgument;\n","'use strict';\nconst shebangRegex = require('shebang-regex');\n\nmodule.exports = (string = '') => {\n\tconst match = string.match(shebangRegex);\n\n\tif (!match) {\n\t\treturn null;\n\t}\n\n\tconst [path, argument] = match[0].replace(/#! ?/, '').split(' ');\n\tconst binary = path.split('/').pop();\n\n\tif (binary === 'env') {\n\t\treturn argument;\n\t}\n\n\treturn argument ? `${binary} ${argument}` : binary;\n};\n","'use strict';\nmodule.exports = /^#!(.*)/;\n","'use strict';\n\nconst fs = require('fs');\nconst shebangCommand = require('shebang-command');\n\nfunction readShebang(command) {\n // Read the first 150 bytes from the file\n const size = 150;\n const buffer = Buffer.alloc(size);\n\n let fd;\n\n try {\n fd = fs.openSync(command, 'r');\n fs.readSync(fd, buffer, 0, size, 0);\n fs.closeSync(fd);\n } catch (e) { /* Empty */ }\n\n // Attempt to extract shebang (null is returned if not a shebang)\n return shebangCommand(buffer.toString());\n}\n\nmodule.exports = readShebang;\n","'use strict';\n\nconst path = require('path');\nconst resolveCommand = require('./util/resolveCommand');\nconst escape = require('./util/escape');\nconst readShebang = require('./util/readShebang');\n\nconst isWin = process.platform === 'win32';\nconst isExecutableRegExp = /\\.(?:com|exe)$/i;\nconst isCmdShimRegExp = /node_modules[\\\\/].bin[\\\\/][^\\\\/]+\\.cmd$/i;\n\nfunction detectShebang(parsed) {\n parsed.file = resolveCommand(parsed);\n\n const shebang = parsed.file && readShebang(parsed.file);\n\n if (shebang) {\n parsed.args.unshift(parsed.file);\n parsed.command = shebang;\n\n return resolveCommand(parsed);\n }\n\n return parsed.file;\n}\n\nfunction parseNonShell(parsed) {\n if (!isWin) {\n return parsed;\n }\n\n // Detect & add support for shebangs\n const commandFile = detectShebang(parsed);\n\n // We don't need a shell if the command filename is an executable\n const needsShell = !isExecutableRegExp.test(commandFile);\n\n // If a shell is required, use cmd.exe and take care of escaping everything correctly\n // Note that `forceShell` is an hidden option used only in tests\n if (parsed.options.forceShell || needsShell) {\n // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`\n // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument\n // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,\n // we need to double escape them\n const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);\n\n // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\\bar)\n // This is necessary otherwise it will always fail with ENOENT in those cases\n parsed.command = path.normalize(parsed.command);\n\n // Escape command & arguments\n parsed.command = escape.command(parsed.command);\n parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));\n\n const shellCommand = [parsed.command].concat(parsed.args).join(' ');\n\n parsed.args = ['/d', '/s', '/c', `\"${shellCommand}\"`];\n parsed.command = process.env.comspec || 'cmd.exe';\n parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped\n }\n\n return parsed;\n}\n\nfunction parse(command, args, options) {\n // Normalize arguments, similar to nodejs\n if (args && !Array.isArray(args)) {\n options = args;\n args = null;\n }\n\n args = args ? args.slice(0) : []; // Clone array to avoid changing the original\n options = Object.assign({}, options); // Clone object to avoid changing the original\n\n // Build our parsed object\n const parsed = {\n command,\n args,\n options,\n file: undefined,\n original: {\n command,\n args,\n },\n };\n\n // Delegate further parsing to shell or non-shell\n return options.shell ? parsed : parseNonShell(parsed);\n}\n\nmodule.exports = parse;\n","import process from 'node:process';\nimport path from 'node:path';\nimport pathKey from 'path-key';\nimport {toPath, traversePathUp} from 'unicorn-magic';\n\nexport const npmRunPath = ({\n\tcwd = process.cwd(),\n\tpath: pathOption = process.env[pathKey()],\n\tpreferLocal = true,\n\texecPath = process.execPath,\n\taddExecPath = true,\n} = {}) => {\n\tconst cwdPath = path.resolve(toPath(cwd));\n\tconst result = [];\n\tconst pathParts = pathOption.split(path.delimiter);\n\n\tif (preferLocal) {\n\t\tapplyPreferLocal(result, pathParts, cwdPath);\n\t}\n\n\tif (addExecPath) {\n\t\tapplyExecPath(result, pathParts, execPath, cwdPath);\n\t}\n\n\treturn pathOption === '' || pathOption === path.delimiter\n\t\t? `${result.join(path.delimiter)}${pathOption}`\n\t\t: [...result, pathOption].join(path.delimiter);\n};\n\nconst applyPreferLocal = (result, pathParts, cwdPath) => {\n\tfor (const directory of traversePathUp(cwdPath)) {\n\t\tconst pathPart = path.join(directory, 'node_modules/.bin');\n\t\tif (!pathParts.includes(pathPart)) {\n\t\t\tresult.push(pathPart);\n\t\t}\n\t}\n};\n\n// Ensure the running `node` binary is used\nconst applyExecPath = (result, pathParts, execPath, cwdPath) => {\n\tconst pathPart = path.resolve(cwdPath, toPath(execPath), '..');\n\tif (!pathParts.includes(pathPart)) {\n\t\tresult.push(pathPart);\n\t}\n};\n\nexport const npmRunPathEnv = ({env = process.env, ...options} = {}) => {\n\tenv = {...env};\n\n\tconst pathName = pathKey({env});\n\toptions.path = env[pathName];\n\tenv[pathName] = npmRunPath(options);\n\n\treturn env;\n};\n","(function (global, undefined) {\n \"use strict\";\n\n if (global.setImmediate) {\n return;\n }\n\n var nextHandle = 1; // Spec says greater than zero\n var tasksByHandle = {};\n var currentlyRunningATask = false;\n var doc = global.document;\n var registerImmediate;\n\n function setImmediate(callback) {\n // Callback can either be a function or a string\n if (typeof callback !== \"function\") {\n callback = new Function(\"\" + callback);\n }\n // Copy function arguments\n var args = new Array(arguments.length - 1);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i + 1];\n }\n // Store and register the task\n var task = { callback: callback, args: args };\n tasksByHandle[nextHandle] = task;\n registerImmediate(nextHandle);\n return nextHandle++;\n }\n\n function clearImmediate(handle) {\n delete tasksByHandle[handle];\n }\n\n function run(task) {\n var callback = task.callback;\n var args = task.args;\n switch (args.length) {\n case 0:\n callback();\n break;\n case 1:\n callback(args[0]);\n break;\n case 2:\n callback(args[0], args[1]);\n break;\n case 3:\n callback(args[0], args[1], args[2]);\n break;\n default:\n callback.apply(undefined, args);\n break;\n }\n }\n\n function runIfPresent(handle) {\n // From the spec: \"Wait until any invocations of this algorithm started before this one have completed.\"\n // So if we're currently running a task, we'll need to delay this invocation.\n if (currentlyRunningATask) {\n // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a\n // \"too much recursion\" error.\n setTimeout(runIfPresent, 0, handle);\n } else {\n var task = tasksByHandle[handle];\n if (task) {\n currentlyRunningATask = true;\n try {\n run(task);\n } finally {\n clearImmediate(handle);\n currentlyRunningATask = false;\n }\n }\n }\n }\n\n function installNextTickImplementation() {\n registerImmediate = function(handle) {\n process.nextTick(function () { runIfPresent(handle); });\n };\n }\n\n function canUsePostMessage() {\n // The test against `importScripts` prevents this implementation from being installed inside a web worker,\n // where `global.postMessage` means something completely different and can't be used for this purpose.\n if (global.postMessage && !global.importScripts) {\n var postMessageIsAsynchronous = true;\n var oldOnMessage = global.onmessage;\n global.onmessage = function() {\n postMessageIsAsynchronous = false;\n };\n global.postMessage(\"\", \"*\");\n global.onmessage = oldOnMessage;\n return postMessageIsAsynchronous;\n }\n }\n\n function installPostMessageImplementation() {\n // Installs an event handler on `global` for the `message` event: see\n // * https://developer.mozilla.org/en/DOM/window.postMessage\n // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages\n\n var messagePrefix = \"setImmediate$\" + Math.random() + \"$\";\n var onGlobalMessage = function(event) {\n if (event.source === global &&\n typeof event.data === \"string\" &&\n event.data.indexOf(messagePrefix) === 0) {\n runIfPresent(+event.data.slice(messagePrefix.length));\n }\n };\n\n if (global.addEventListener) {\n global.addEventListener(\"message\", onGlobalMessage, false);\n } else {\n global.attachEvent(\"onmessage\", onGlobalMessage);\n }\n\n registerImmediate = function(handle) {\n global.postMessage(messagePrefix + handle, \"*\");\n };\n }\n\n function installMessageChannelImplementation() {\n var channel = new MessageChannel();\n channel.port1.onmessage = function(event) {\n var handle = event.data;\n runIfPresent(handle);\n };\n\n registerImmediate = function(handle) {\n channel.port2.postMessage(handle);\n };\n }\n\n function installReadyStateChangeImplementation() {\n var html = doc.documentElement;\n registerImmediate = function(handle) {\n // Create a