mirror of https://github.com/aminya/setup-cpp.git
82 lines
322 KiB
JavaScript
82 lines
322 KiB
JavaScript
#!/usr/bin/env node
|
||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const at=require("process"),le=require("os"),T=require("path"),ae=require("fs"),Rn=require("https"),Om=require("perf_hooks"),ba=require("http");require("net");const $m=require("tls"),On=require("events"),pr=require("util"),Im=require("string_decoder"),Nt=require("child_process"),kr=require("assert"),Pm=require("timers"),ap=require("buffer"),lt=require("url"),qr=require("stream"),Tm=require("constants"),pn=require("console");var ge=typeof document<"u"?document.currentScript:null;function Ra(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){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)}const Ar=Ra(ae),sc=Ra(Rn),Mn=Ra(ba),cp=Object.freeze(Object.defineProperty({__proto__:null,get default(){return cp},get randomUUID(){return oy}},Symbol.toStringTag,{value:"Module"}));function Gn(e){return e==null?[]:Array.isArray(e)?e:[e]}function xm(e,t,r,n){var o,s=e[t],i=~n.string.indexOf(t)?r==null||r===!0?"":String(r):typeof r=="boolean"?r:~n.boolean.indexOf(t)?r==="false"?!1:r==="true"||(e._.push((o=+r,o*0===0?o:r)),!!r):(o=+r,o*0===0?o:r);e[t]=s==null?i:Array.isArray(s)?s.concat(i):[s,i]}function Cm(e,t){e=e||[],t=t||{};var r,n,o,s,i,l={_:[]},u=0,a=0,c=0,m=e.length;const p=t.alias!==void 0,v=t.unknown!==void 0,E=t.default!==void 0;if(t.alias=t.alias||{},t.string=Gn(t.string),t.boolean=Gn(t.boolean),p)for(r in t.alias)for(n=t.alias[r]=Gn(t.alias[r]),u=0;u<n.length;u++)(t.alias[n[u]]=n.concat(r)).splice(u,1);for(u=t.boolean.length;u-- >0;)for(n=t.alias[t.boolean[u]]||[],a=n.length;a-- >0;)t.boolean.push(n[a]);for(u=t.string.length;u-- >0;)for(n=t.alias[t.string[u]]||[],a=n.length;a-- >0;)t.string.push(n[a]);if(E){for(r in t.default)if(s=typeof t.default[r],n=t.alias[r]=t.alias[r]||[],t[s]!==void 0)for(t[s].push(r),u=0;u<n.length;u++)t[s].push(n[u])}const d=v?Object.keys(t.alias):[];for(u=0;u<m;u++){if(o=e[u],o==="--"){l._=l._.concat(e.slice(++u));break}for(a=0;a<o.length&&o.charCodeAt(a)===45;a++);if(a===0)l._.push(o);else if(o.substring(a,a+3)==="no-"){if(s=o.substring(a+3),v&&!~d.indexOf(s))return t.unknown(o);l[s]=!1}else{for(c=a+1;c<o.length&&o.charCodeAt(c)!==61;c++);for(s=o.substring(a,c),i=o.substring(++c)||u+1===m||(""+e[u+1]).charCodeAt(0)===45||e[++u],n=a===2?[s]:s,c=0;c<n.length;c++){if(s=n[c],v&&!~d.indexOf(s))return t.unknown("-".repeat(a)+s);xm(l,s,c+1<n.length||i,t)}}}if(E)for(r in t.default)l[r]===void 0&&(l[r]=t.default[r]);if(p)for(r in l)for(n=t.alias[r]||[];n.length>0;)l[n.shift()]=l[r];return l}var et=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Oe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function $n(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?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(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),r}var Vr={exports:{}},Vn,ac;function In(){if(ac)return Vn;ac=1;const e="2.0.0",t=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,o=t-6;return Vn={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:o,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Vn}var Bn,cc;function Pn(){return cc||(cc=1,Bn=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),Bn}var uc;function Fr(){return uc||(uc=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:o}=In(),s=Pn();t=e.exports={};const i=t.re=[],l=t.safeRe=[],u=t.src=[],a=t.safeSrc=[],c=t.t={};let m=0;const p="[a-zA-Z0-9-]",v=[["\\s",1],["\\d",o],[p,n]],E=f=>{for(const[h,y]of v)f=f.split(`${h}*`).join(`${h}{0,${y}}`).split(`${h}+`).join(`${h}{1,${y}}`);return f},d=(f,h,y)=>{const w=E(h),S=m++;s(f,S,h),c[f]=S,u[S]=h,a[S]=w,i[S]=new RegExp(h,y?"g":void 0),l[S]=new RegExp(w,y?"g":void 0)};d("NUMERICIDENTIFIER","0|[1-9]\\d*"),d("NUMERICIDENTIFIERLOOSE","\\d+"),d("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${p}*`),d("MAINVERSION",`(${u[c.NUMERICIDENTIFIER]})\\.(${u[c.NUMERICIDENTIFIER]})\\.(${u[c.NUMERICIDENTIFIER]})`),d("MAINVERSIONLOOSE",`(${u[c.NUMERICIDENTIFIERLOOSE]})\\.(${u[c.NUMERICIDENTIFIERLOOSE]})\\.(${u[c.NUMERICIDENTIFIERLOOSE]})`),d("PRERELEASEIDENTIFIER",`(?:${u[c.NONNUMERICIDENTIFIER]}|${u[c.NUMERICIDENTIFIER]})`),d("PRERELEASEIDENTIFIERLOOSE",`(?:${u[c.NONNUMERICIDENTIFIER]}|${u[c.NUMERICIDENTIFIERLOOSE]})`),d("PRERELEASE",`(?:-(${u[c.PRERELEASEIDENTIFIER]}(?:\\.${u[c.PRERELEASEIDENTIFIER]})*))`),d("PRERELEASELOOSE",`(?:-?(${u[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[c.PRERELEASEIDENTIFIERLOOSE]})*))`),d("BUILDIDENTIFIER",`${p}+`),d("BUILD",`(?:\\+(${u[c.BUILDIDENTIFIER]}(?:\\.${u[c.BUILDIDENTIFIER]})*))`),d("FULLPLAIN",`v?${u[c.MAINVERSION]}${u[c.PRERELEASE]}?${u[c.BUILD]}?`),d("FULL",`^${u[c.FULLPLAIN]}$`),d("LOOSEPLAIN",`[v=\\s]*${u[c.MAINVERSIONLOOSE]}${u[c.PRERELEASELOOSE]}?${u[c.BUILD]}?`),d("LOOSE",`^${u[c.LOOSEPLAIN]}$`),d("GTLT","((?:<|>)?=?)"),d("XRANGEIDENTIFIERLOOSE",`${u[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),d("XRANGEIDENTIFIER",`${u[c.NUMERICIDENTIFIER]}|x|X|\\*`),d("XRANGEPLAIN",`[v=\\s]*(${u[c.XRANGEIDENTIFIER]})(?:\\.(${u[c.XRANGEIDENTIFIER]})(?:\\.(${u[c.XRANGEIDENTIFIER]})(?:${u[c.PRERELEASE]})?${u[c.BUILD]}?)?)?`),d("XRANGEPLAINLOOSE",`[v=\\s]*(${u[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[c.XRANGEIDENTIFIERLOOSE]})(?:${u[c.PRERELEASELOOSE]})?${u[c.BUILD]}?)?)?`),d("XRANGE",`^${u[c.GTLT]}\\s*${u[c.XRANGEPLAIN]}$`),d("XRANGELOOSE",`^${u[c.GTLT]}\\s*${u[c.XRANGEPLAINLOOSE]}$`),d("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),d("COERCE",`${u[c.COERCEPLAIN]}(?:$|[^\\d])`),d("COERCEFULL",u[c.COERCEPLAIN]+`(?:${u[c.PRERELEASE]})?(?:${u[c.BUILD]})?(?:$|[^\\d])`),d("COERCERTL",u[c.COERCE],!0),d("COERCERTLFULL",u[c.COERCEFULL],!0),d("LONETILDE","(?:~>?)"),d("TILDETRIM",`(\\s*)${u[c.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",d("TILDE",`^${u[c.LONETILDE]}${u[c.XRANGEPLAIN]}$`),d("TILDELOOSE",`^${u[c.LONETILDE]}${u[c.XRANGEPLAINLOOSE]}$`),d("LONECARET","(?:\\^)"),d("CARETTRIM",`(\\s*)${u[c.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",d("CARET",`^${u[c.LONECARET]}${u[c.XRANGEPLAIN]}$`),d("CARETLOOSE",`^${u[c.LONECARET]}${u[c.XRANGEPLAINLOOSE]}$`),d("COMPARATORLOOSE",`^${u[c.GTLT]}\\s*(${u[c.LOOSEPLAIN]})$|^$`),d("COMPARATOR",`^${u[c.GTLT]}\\s*(${u[c.FULLPLAIN]})$|^$`),d("COMPARATORTRIM",`(\\s*)${u[c.GTLT]}\\s*(${u[c.LOOSEPLAIN]}|${u[c.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",d("HYPHENRANGE",`^\\s*(${u[c.XRANGEPLAIN]})\\s+-\\s+(${u[c.XRANGEPLAIN]})\\s*$`),d("HYPHENRANGELOOSE",`^\\s*(${u[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[c.XRANGEPLAINLOOSE]})\\s*$`),d("STAR","(<|>)?=?\\s*\\*"),d("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),d("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Vr,Vr.exports)),Vr.exports}var zn,lc;function Oa(){if(lc)return zn;lc=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return zn=n=>n?typeof n!="object"?e:n:t,zn}var Hn,fc;function up(){if(fc)return Hn;fc=1;const e=/^[0-9]+$/,t=(n,o)=>{const s=e.test(n),i=e.test(o);return s&&i&&(n=+n,o=+o),n===o?0:s&&!i?-1:i&&!s?1:n<o?-1:1};return Hn={compareIdentifiers:t,rcompareIdentifiers:(n,o)=>t(o,n)},Hn}var Wn,dc;function He(){if(dc)return Wn;dc=1;const e=Pn(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=In(),{safeRe:n,t:o}=Fr(),s=Oa(),{compareIdentifiers:i}=up();class l{constructor(a,c){if(c=s(c),a instanceof l){if(a.loose===!!c.loose&&a.includePrerelease===!!c.includePrerelease)return a;a=a.version}else if(typeof a!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof a}".`);if(a.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",a,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;const m=a.trim().match(c.loose?n[o.LOOSE]:n[o.FULL]);if(!m)throw new TypeError(`Invalid Version: ${a}`);if(this.raw=a,this.major=+m[1],this.minor=+m[2],this.patch=+m[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");m[4]?this.prerelease=m[4].split(".").map(p=>{if(/^[0-9]+$/.test(p)){const v=+p;if(v>=0&&v<r)return v}return p}):this.prerelease=[],this.build=m[5]?m[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(a){if(e("SemVer.compare",this.version,this.options,a),!(a instanceof l)){if(typeof a=="string"&&a===this.version)return 0;a=new l(a,this.options)}return a.version===this.version?0:this.compareMain(a)||this.comparePre(a)}compareMain(a){return a instanceof l||(a=new l(a,this.options)),i(this.major,a.major)||i(this.minor,a.minor)||i(this.patch,a.patch)}comparePre(a){if(a instanceof l||(a=new l(a,this.options)),this.prerelease.length&&!a.prerelease.length)return-1;if(!this.prerelease.length&&a.prerelease.length)return 1;if(!this.prerelease.length&&!a.prerelease.length)return 0;let c=0;do{const m=this.prerelease[c],p=a.prerelease[c];if(e("prerelease compare",c,m,p),m===void 0&&p===void 0)return 0;if(p===void 0)return 1;if(m===void 0)return-1;if(m===p)continue;return i(m,p)}while(++c)}compareBuild(a){a instanceof l||(a=new l(a,this.options));let c=0;do{const m=this.build[c],p=a.build[c];if(e("build compare",c,m,p),m===void 0&&p===void 0)return 0;if(p===void 0)return 1;if(m===void 0)return-1;if(m===p)continue;return i(m,p)}while(++c)}inc(a,c,m){if(a.startsWith("pre")){if(!c&&m===!1)throw new Error("invalid increment argument: identifier is empty");if(c){const p=`-${c}`.match(this.options.loose?n[o.PRERELEASELOOSE]:n[o.PRERELEASE]);if(!p||p[1]!==c)throw new Error(`invalid identifier: ${c}`)}}switch(a){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",c,m);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",c,m);break;case"prepatch":this.prerelease.length=0,this.inc("patch",c,m),this.inc("pre",c,m);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",c,m),this.inc("pre",c,m);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const p=Number(m)?1:0;if(this.prerelease.length===0)this.prerelease=[p];else{let v=this.prerelease.length;for(;--v>=0;)typeof this.prerelease[v]=="number"&&(this.prerelease[v]++,v=-2);if(v===-1){if(c===this.prerelease.join(".")&&m===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(p)}}if(c){let v=[c,p];m===!1&&(v=[c]),i(this.prerelease[0],c)===0?isNaN(this.prerelease[1])&&(this.prerelease=v):this.prerelease=v}break}default:throw new Error(`invalid increment argument: ${a}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Wn=l,Wn}var Xn,pc;function hr(){if(pc)return Xn;pc=1;const e=He();return Xn=(r,n,o=!1)=>{if(r instanceof e)return r;try{return new e(r,n)}catch(s){if(!o)return null;throw s}},Xn}var Kn,hc;function lp(){if(hc)return Kn;hc=1;const e=hr();return Kn=(r,n)=>{const o=e(r,n);return o?o.version:null},Kn}var Yn,mc;function Am(){if(mc)return Yn;mc=1;const e=hr();return Yn=(r,n)=>{const o=e(r.trim().replace(/^[=v]+/,""),n);return o?o.version:null},Yn}var Jn,yc;function Nm(){if(yc)return Jn;yc=1;const e=He();return Jn=(r,n,o,s,i)=>{typeof o=="string"&&(i=s,s=o,o=void 0);try{return new e(r instanceof e?r.version:r,o).inc(n,s,i).version}catch{return null}},Jn}var Qn,wc;function Lm(){if(wc)return Qn;wc=1;const e=hr();return Qn=(r,n)=>{const o=e(r,null,!0),s=e(n,null,!0),i=o.compare(s);if(i===0)return null;const l=i>0,u=l?o:s,a=l?s:o,c=!!u.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(u)===0)return a.minor&&!a.patch?"minor":"patch"}const p=c?"pre":"";return o.major!==s.major?p+"major":o.minor!==s.minor?p+"minor":o.patch!==s.patch?p+"patch":"prerelease"},Qn}var Zn,vc;function fp(){if(vc)return Zn;vc=1;const e=He();return Zn=(r,n)=>new e(r,n).major,Zn}var ei,gc;function Dm(){if(gc)return ei;gc=1;const e=He();return ei=(r,n)=>new e(r,n).minor,ei}var ti,_c;function km(){if(_c)return ti;_c=1;const e=He();return ti=(r,n)=>new e(r,n).patch,ti}var ri,Ec;function qm(){if(Ec)return ri;Ec=1;const e=hr();return ri=(r,n)=>{const o=e(r,n);return o&&o.prerelease.length?o.prerelease:null},ri}var ni,Sc;function ft(){if(Sc)return ni;Sc=1;const e=He();return ni=(r,n,o)=>new e(r,o).compare(new e(n,o)),ni}var ii,bc;function Fm(){if(bc)return ii;bc=1;const e=ft();return ii=(r,n,o)=>e(n,r,o),ii}var oi,Rc;function jm(){if(Rc)return oi;Rc=1;const e=ft();return oi=(r,n)=>e(r,n,!0),oi}var si,Oc;function $a(){if(Oc)return si;Oc=1;const e=He();return si=(r,n,o)=>{const s=new e(r,o),i=new e(n,o);return s.compare(i)||s.compareBuild(i)},si}var ai,$c;function Um(){if($c)return ai;$c=1;const e=$a();return ai=(r,n)=>r.sort((o,s)=>e(o,s,n)),ai}var ci,Ic;function Mm(){if(Ic)return ci;Ic=1;const e=$a();return ci=(r,n)=>r.sort((o,s)=>e(s,o,n)),ci}var ui,Pc;function Tn(){if(Pc)return ui;Pc=1;const e=ft();return ui=(r,n,o)=>e(r,n,o)>0,ui}var li,Tc;function Ia(){if(Tc)return li;Tc=1;const e=ft();return li=(r,n,o)=>e(r,n,o)<0,li}var fi,xc;function dp(){if(xc)return fi;xc=1;const e=ft();return fi=(r,n,o)=>e(r,n,o)===0,fi}var di,Cc;function pp(){if(Cc)return di;Cc=1;const e=ft();return di=(r,n,o)=>e(r,n,o)!==0,di}var pi,Ac;function Pa(){if(Ac)return pi;Ac=1;const e=ft();return pi=(r,n,o)=>e(r,n,o)>=0,pi}var hi,Nc;function xn(){if(Nc)return hi;Nc=1;const e=ft();return hi=(r,n,o)=>e(r,n,o)<=0,hi}var mi,Lc;function hp(){if(Lc)return mi;Lc=1;const e=dp(),t=pp(),r=Tn(),n=Pa(),o=Ia(),s=xn();return mi=(l,u,a,c)=>{switch(u){case"===":return typeof l=="object"&&(l=l.version),typeof a=="object"&&(a=a.version),l===a;case"!==":return typeof l=="object"&&(l=l.version),typeof a=="object"&&(a=a.version),l!==a;case"":case"=":case"==":return e(l,a,c);case"!=":return t(l,a,c);case">":return r(l,a,c);case">=":return n(l,a,c);case"<":return o(l,a,c);case"<=":return s(l,a,c);default:throw new TypeError(`Invalid operator: ${u}`)}},mi}var yi,Dc;function mp(){if(Dc)return yi;Dc=1;const e=He(),t=hr(),{safeRe:r,t:n}=Fr();return yi=(s,i)=>{if(s instanceof e)return s;if(typeof s=="number"&&(s=String(s)),typeof s!="string")return null;i=i||{};let l=null;if(!i.rtl)l=s.match(i.includePrerelease?r[n.COERCEFULL]:r[n.COERCE]);else{const v=i.includePrerelease?r[n.COERCERTLFULL]:r[n.COERCERTL];let E;for(;(E=v.exec(s))&&(!l||l.index+l[0].length!==s.length);)(!l||E.index+E[0].length!==l.index+l[0].length)&&(l=E),v.lastIndex=E.index+E[1].length+E[2].length;v.lastIndex=-1}if(l===null)return null;const u=l[2],a=l[3]||"0",c=l[4]||"0",m=i.includePrerelease&&l[5]?`-${l[5]}`:"",p=i.includePrerelease&&l[6]?`+${l[6]}`:"";return t(`${u}.${a}.${c}${m}${p}`,i)},yi}var wi,kc;function Gm(){if(kc)return wi;kc=1;class e{constructor(){this.max=1e3,this.map=new Map}get(r){const n=this.map.get(r);if(n!==void 0)return this.map.delete(r),this.map.set(r,n),n}delete(r){return this.map.delete(r)}set(r,n){if(!this.delete(r)&&n!==void 0){if(this.map.size>=this.max){const s=this.map.keys().next().value;this.delete(s)}this.map.set(r,n)}return this}}return wi=e,wi}var vi,qc;function _t(){if(qc)return vi;qc=1;const e=/\s+/g;class t{constructor(x,F){if(F=o(F),x instanceof t)return x.loose===!!F.loose&&x.includePrerelease===!!F.includePrerelease?x:new t(x.raw,F);if(x instanceof s)return this.raw=x.value,this.set=[[x]],this.formatted=void 0,this;if(this.options=F,this.loose=!!F.loose,this.includePrerelease=!!F.includePrerelease,this.raw=x.trim().replace(e," "),this.set=this.raw.split("||").map(U=>this.parseRange(U.trim())).filter(U=>U.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const U=this.set[0];if(this.set=this.set.filter(q=>!d(q[0])),this.set.length===0)this.set=[U];else if(this.set.length>1){for(const q of this.set)if(q.length===1&&f(q[0])){this.set=[q];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let x=0;x<this.set.length;x++){x>0&&(this.formatted+="||");const F=this.set[x];for(let U=0;U<F.length;U++)U>0&&(this.formatted+=" "),this.formatted+=F[U].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(x){const U=((this.options.includePrerelease&&v)|(this.options.loose&&E))+":"+x,q=n.get(U);if(q)return q;const V=this.options.loose,N=V?u[a.HYPHENRANGELOOSE]:u[a.HYPHENRANGE];x=x.replace(N,Y(this.options.includePrerelease)),i("hyphen replace",x),x=x.replace(u[a.COMPARATORTRIM],c),i("comparator trim",x),x=x.replace(u[a.TILDETRIM],m),i("tilde trim",x),x=x.replace(u[a.CARETTRIM],p),i("caret trim",x);let H=x.split(" ").map(K=>y(K,this.options)).join(" ").split(/\s+/).map(K=>G(K,this.options));V&&(H=H.filter(K=>(i("loose invalid filter",K,this.options),!!K.match(u[a.COMPARATORLOOSE])))),i("range list",H);const X=new Map,re=H.map(K=>new s(K,this.options));for(const K of re){if(d(K))return[K];X.set(K.value,K)}X.size>1&&X.has("")&&X.delete("");const ue=[...X.values()];return n.set(U,ue),ue}intersects(x,F){if(!(x instanceof t))throw new TypeError("a Range is required");return this.set.some(U=>h(U,F)&&x.set.some(q=>h(q,F)&&U.every(V=>q.every(N=>V.intersects(N,F)))))}test(x){if(!x)return!1;if(typeof x=="string")try{x=new l(x,this.options)}catch{return!1}for(let F=0;F<this.set.length;F++)if(Q(this.set[F],x,this.options))return!0;return!1}}vi=t;const r=Gm(),n=new r,o=Oa(),s=Cn(),i=Pn(),l=He(),{safeRe:u,t:a,comparatorTrimReplace:c,tildeTrimReplace:m,caretTrimReplace:p}=Fr(),{FLAG_INCLUDE_PRERELEASE:v,FLAG_LOOSE:E}=In(),d=A=>A.value==="<0.0.0-0",f=A=>A.value==="",h=(A,x)=>{let F=!0;const U=A.slice();let q=U.pop();for(;F&&U.length;)F=U.every(V=>q.intersects(V,x)),q=U.pop();return F},y=(A,x)=>(i("comp",A,x),A=b(A,x),i("caret",A),A=S(A,x),i("tildes",A),A=O(A,x),i("xrange",A),A=C(A,x),i("stars",A),A),w=A=>!A||A.toLowerCase()==="x"||A==="*",S=(A,x)=>A.trim().split(/\s+/).map(F=>_(F,x)).join(" "),_=(A,x)=>{const F=x.loose?u[a.TILDELOOSE]:u[a.TILDE];return A.replace(F,(U,q,V,N,H)=>{i("tilde",A,U,q,V,N,H);let X;return w(q)?X="":w(V)?X=`>=${q}.0.0 <${+q+1}.0.0-0`:w(N)?X=`>=${q}.${V}.0 <${q}.${+V+1}.0-0`:H?(i("replaceTilde pr",H),X=`>=${q}.${V}.${N}-${H} <${q}.${+V+1}.0-0`):X=`>=${q}.${V}.${N} <${q}.${+V+1}.0-0`,i("tilde return",X),X})},b=(A,x)=>A.trim().split(/\s+/).map(F=>g(F,x)).join(" "),g=(A,x)=>{i("caret",A,x);const F=x.loose?u[a.CARETLOOSE]:u[a.CARET],U=x.includePrerelease?"-0":"";return A.replace(F,(q,V,N,H,X)=>{i("caret",A,q,V,N,H,X);let re;return w(V)?re="":w(N)?re=`>=${V}.0.0${U} <${+V+1}.0.0-0`:w(H)?V==="0"?re=`>=${V}.${N}.0${U} <${V}.${+N+1}.0-0`:re=`>=${V}.${N}.0${U} <${+V+1}.0.0-0`:X?(i("replaceCaret pr",X),V==="0"?N==="0"?re=`>=${V}.${N}.${H}-${X} <${V}.${N}.${+H+1}-0`:re=`>=${V}.${N}.${H}-${X} <${V}.${+N+1}.0-0`:re=`>=${V}.${N}.${H}-${X} <${+V+1}.0.0-0`):(i("no pr"),V==="0"?N==="0"?re=`>=${V}.${N}.${H}${U} <${V}.${N}.${+H+1}-0`:re=`>=${V}.${N}.${H}${U} <${V}.${+N+1}.0-0`:re=`>=${V}.${N}.${H} <${+V+1}.0.0-0`),i("caret return",re),re})},O=(A,x)=>(i("replaceXRanges",A,x),A.split(/\s+/).map(F=>$(F,x)).join(" ")),$=(A,x)=>{A=A.trim();const F=x.loose?u[a.XRANGELOOSE]:u[a.XRANGE];return A.replace(F,(U,q,V,N,H,X)=>{i("xRange",A,U,q,V,N,H,X);const re=w(V),ue=re||w(N),K=ue||w(H),ie=K;return q==="="&&ie&&(q=""),X=x.includePrerelease?"-0":"",re?q===">"||q==="<"?U="<0.0.0-0":U="*":q&&ie?(ue&&(N=0),H=0,q===">"?(q=">=",ue?(V=+V+1,N=0,H=0):(N=+N+1,H=0)):q==="<="&&(q="<",ue?V=+V+1:N=+N+1),q==="<"&&(X="-0"),U=`${q+V}.${N}.${H}${X}`):ue?U=`>=${V}.0.0${X} <${+V+1}.0.0-0`:K&&(U=`>=${V}.${N}.0${X} <${V}.${+N+1}.0-0`),i("xRange return",U),U})},C=(A,x)=>(i("replaceStars",A,x),A.trim().replace(u[a.STAR],"")),G=(A,x)=>(i("replaceGTE0",A,x),A.trim().replace(u[x.includePrerelease?a.GTE0PRE:a.GTE0],"")),Y=A=>(x,F,U,q,V,N,H,X,re,ue,K,ie)=>(w(U)?F="":w(q)?F=`>=${U}.0.0${A?"-0":""}`:w(V)?F=`>=${U}.${q}.0${A?"-0":""}`:N?F=`>=${F}`:F=`>=${F}${A?"-0":""}`,w(re)?X="":w(ue)?X=`<${+re+1}.0.0-0`:w(K)?X=`<${re}.${+ue+1}.0-0`:ie?X=`<=${re}.${ue}.${K}-${ie}`:A?X=`<${re}.${ue}.${+K+1}-0`:X=`<=${X}`,`${F} ${X}`.trim()),Q=(A,x,F)=>{for(let U=0;U<A.length;U++)if(!A[U].test(x))return!1;if(x.prerelease.length&&!F.includePrerelease){for(let U=0;U<A.length;U++)if(i(A[U].semver),A[U].semver!==s.ANY&&A[U].semver.prerelease.length>0){const q=A[U].semver;if(q.major===x.major&&q.minor===x.minor&&q.patch===x.patch)return!0}return!1}return!0};return vi}var gi,Fc;function Cn(){if(Fc)return gi;Fc=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(c,m){if(m=r(m),c instanceof t){if(c.loose===!!m.loose)return c;c=c.value}c=c.trim().split(/\s+/).join(" "),i("comparator",c,m),this.options=m,this.loose=!!m.loose,this.parse(c),this.semver===e?this.value="":this.value=this.operator+this.semver.version,i("comp",this)}parse(c){const m=this.options.loose?n[o.COMPARATORLOOSE]:n[o.COMPARATOR],p=c.match(m);if(!p)throw new TypeError(`Invalid comparator: ${c}`);this.operator=p[1]!==void 0?p[1]:"",this.operator==="="&&(this.operator=""),p[2]?this.semver=new l(p[2],this.options.loose):this.semver=e}toString(){return this.value}test(c){if(i("Comparator.test",c,this.options.loose),this.semver===e||c===e)return!0;if(typeof c=="string")try{c=new l(c,this.options)}catch{return!1}return s(c,this.operator,this.semver,this.options)}intersects(c,m){if(!(c instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(c.value,m).test(this.value):c.operator===""?c.value===""?!0:new u(this.value,m).test(c.semver):(m=r(m),m.includePrerelease&&(this.value==="<0.0.0-0"||c.value==="<0.0.0-0")||!m.includePrerelease&&(this.value.startsWith("<0.0.0")||c.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&c.operator.startsWith(">")||this.operator.startsWith("<")&&c.operator.startsWith("<")||this.semver.version===c.semver.version&&this.operator.includes("=")&&c.operator.includes("=")||s(this.semver,"<",c.semver,m)&&this.operator.startsWith(">")&&c.operator.startsWith("<")||s(this.semver,">",c.semver,m)&&this.operator.startsWith("<")&&c.operator.startsWith(">")))}}gi=t;const r=Oa(),{safeRe:n,t:o}=Fr(),s=hp(),i=Pn(),l=He(),u=_t();return gi}var _i,jc;function jr(){if(jc)return _i;jc=1;const e=_t();return _i=(r,n,o)=>{try{n=new e(n,o)}catch{return!1}return n.test(r)},_i}var Ei,Uc;function Vm(){if(Uc)return Ei;Uc=1;const e=_t();return Ei=(r,n)=>new e(r,n).set.map(o=>o.map(s=>s.value).join(" ").trim().split(" ")),Ei}var Si,Mc;function Bm(){if(Mc)return Si;Mc=1;const e=He(),t=_t();return Si=(n,o,s)=>{let i=null,l=null,u=null;try{u=new t(o,s)}catch{return null}return n.forEach(a=>{u.test(a)&&(!i||l.compare(a)===-1)&&(i=a,l=new e(i,s))}),i},Si}var bi,Gc;function zm(){if(Gc)return bi;Gc=1;const e=He(),t=_t();return bi=(n,o,s)=>{let i=null,l=null,u=null;try{u=new t(o,s)}catch{return null}return n.forEach(a=>{u.test(a)&&(!i||l.compare(a)===1)&&(i=a,l=new e(i,s))}),i},bi}var Ri,Vc;function Hm(){if(Vc)return Ri;Vc=1;const e=He(),t=_t(),r=Tn();return Ri=(o,s)=>{o=new t(o,s);let i=new e("0.0.0");if(o.test(i)||(i=new e("0.0.0-0"),o.test(i)))return i;i=null;for(let l=0;l<o.set.length;++l){const u=o.set[l];let a=null;u.forEach(c=>{const m=new e(c.semver.version);switch(c.operator){case">":m.prerelease.length===0?m.patch++:m.prerelease.push(0),m.raw=m.format();case"":case">=":(!a||r(m,a))&&(a=m);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),a&&(!i||r(i,a))&&(i=a)}return i&&o.test(i)?i:null},Ri}var Oi,Bc;function Wm(){if(Bc)return Oi;Bc=1;const e=_t();return Oi=(r,n)=>{try{return new e(r,n).range||"*"}catch{return null}},Oi}var $i,zc;function Ta(){if(zc)return $i;zc=1;const e=He(),t=Cn(),{ANY:r}=t,n=_t(),o=jr(),s=Tn(),i=Ia(),l=xn(),u=Pa();return $i=(c,m,p,v)=>{c=new e(c,v),m=new n(m,v);let E,d,f,h,y;switch(p){case">":E=s,d=l,f=i,h=">",y=">=";break;case"<":E=i,d=u,f=s,h="<",y="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(o(c,m,v))return!1;for(let w=0;w<m.set.length;++w){const S=m.set[w];let _=null,b=null;if(S.forEach(g=>{g.semver===r&&(g=new t(">=0.0.0")),_=_||g,b=b||g,E(g.semver,_.semver,v)?_=g:f(g.semver,b.semver,v)&&(b=g)}),_.operator===h||_.operator===y||(!b.operator||b.operator===h)&&d(c,b.semver))return!1;if(b.operator===y&&f(c,b.semver))return!1}return!0},$i}var Ii,Hc;function Xm(){if(Hc)return Ii;Hc=1;const e=Ta();return Ii=(r,n,o)=>e(r,n,">",o),Ii}var Pi,Wc;function Km(){if(Wc)return Pi;Wc=1;const e=Ta();return Pi=(r,n,o)=>e(r,n,"<",o),Pi}var Ti,Xc;function Ym(){if(Xc)return Ti;Xc=1;const e=_t();return Ti=(r,n,o)=>(r=new e(r,o),n=new e(n,o),r.intersects(n,o)),Ti}var xi,Kc;function Jm(){if(Kc)return xi;Kc=1;const e=jr(),t=ft();return xi=(r,n,o)=>{const s=[];let i=null,l=null;const u=r.sort((p,v)=>t(p,v,o));for(const p of u)e(p,n,o)?(l=p,i||(i=p)):(l&&s.push([i,l]),l=null,i=null);i&&s.push([i,null]);const a=[];for(const[p,v]of s)p===v?a.push(p):!v&&p===u[0]?a.push("*"):v?p===u[0]?a.push(`<=${v}`):a.push(`${p} - ${v}`):a.push(`>=${p}`);const c=a.join(" || "),m=typeof n.raw=="string"?n.raw:String(n);return c.length<m.length?c:n},xi}var Ci,Yc;function Qm(){if(Yc)return Ci;Yc=1;const e=_t(),t=Cn(),{ANY:r}=t,n=jr(),o=ft(),s=(m,p,v={})=>{if(m===p)return!0;m=new e(m,v),p=new e(p,v);let E=!1;e:for(const d of m.set){for(const f of p.set){const h=u(d,f,v);if(E=E||h!==null,h)continue e}if(E)return!1}return!0},i=[new t(">=0.0.0-0")],l=[new t(">=0.0.0")],u=(m,p,v)=>{if(m===p)return!0;if(m.length===1&&m[0].semver===r){if(p.length===1&&p[0].semver===r)return!0;v.includePrerelease?m=i:m=l}if(p.length===1&&p[0].semver===r){if(v.includePrerelease)return!0;p=l}const E=new Set;let d,f;for(const O of m)O.operator===">"||O.operator===">="?d=a(d,O,v):O.operator==="<"||O.operator==="<="?f=c(f,O,v):E.add(O.semver);if(E.size>1)return null;let h;if(d&&f){if(h=o(d.semver,f.semver,v),h>0)return null;if(h===0&&(d.operator!==">="||f.operator!=="<="))return null}for(const O of E){if(d&&!n(O,String(d),v)||f&&!n(O,String(f),v))return null;for(const $ of p)if(!n(O,String($),v))return!1;return!0}let y,w,S,_,b=f&&!v.includePrerelease&&f.semver.prerelease.length?f.semver:!1,g=d&&!v.includePrerelease&&d.semver.prerelease.length?d.semver:!1;b&&b.prerelease.length===1&&f.operator==="<"&&b.prerelease[0]===0&&(b=!1);for(const O of p){if(_=_||O.operator===">"||O.operator===">=",S=S||O.operator==="<"||O.operator==="<=",d){if(g&&O.semver.prerelease&&O.semver.prerelease.length&&O.semver.major===g.major&&O.semver.minor===g.minor&&O.semver.patch===g.patch&&(g=!1),O.operator===">"||O.operator===">="){if(y=a(d,O,v),y===O&&y!==d)return!1}else if(d.operator===">="&&!n(d.semver,String(O),v))return!1}if(f){if(b&&O.semver.prerelease&&O.semver.prerelease.length&&O.semver.major===b.major&&O.semver.minor===b.minor&&O.semver.patch===b.patch&&(b=!1),O.operator==="<"||O.operator==="<="){if(w=c(f,O,v),w===O&&w!==f)return!1}else if(f.operator==="<="&&!n(f.semver,String(O),v))return!1}if(!O.operator&&(f||d)&&h!==0)return!1}return!(d&&S&&!f&&h!==0||f&&_&&!d&&h!==0||g||b)},a=(m,p,v)=>{if(!m)return p;const E=o(m.semver,p.semver,v);return E>0?m:E<0||p.operator===">"&&m.operator===">="?p:m},c=(m,p,v)=>{if(!m)return p;const E=o(m.semver,p.semver,v);return E<0?m:E>0||p.operator==="<"&&m.operator==="<="?p:m};return Ci=s,Ci}var Ai,Jc;function yp(){if(Jc)return Ai;Jc=1;const e=Fr(),t=In(),r=He(),n=up(),o=hr(),s=lp(),i=Am(),l=Nm(),u=Lm(),a=fp(),c=Dm(),m=km(),p=qm(),v=ft(),E=Fm(),d=jm(),f=$a(),h=Um(),y=Mm(),w=Tn(),S=Ia(),_=dp(),b=pp(),g=Pa(),O=xn(),$=hp(),C=mp(),G=Cn(),Y=_t(),Q=jr(),A=Vm(),x=Bm(),F=zm(),U=Hm(),q=Wm(),V=Ta(),N=Xm(),H=Km(),X=Ym(),re=Jm(),ue=Qm();return Ai={parse:o,valid:s,clean:i,inc:l,diff:u,major:a,minor:c,patch:m,prerelease:p,compare:v,rcompare:E,compareLoose:d,compareBuild:f,sort:h,rsort:y,gt:w,lt:S,eq:_,neq:b,gte:g,lte:O,cmp:$,coerce:C,Comparator:G,Range:Y,satisfies:Q,toComparators:A,maxSatisfying:x,minSatisfying:F,minVersion:U,validRange:q,outside:V,gtr:N,ltr:H,intersects:X,simplifyRange:re,subset:ue,SemVer:r,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers},Ai}var Ni,Qc;function Zm(){if(Qc)return Ni;Qc=1;var e=at,t=yp(),r=le,n=T,o=ae,s=Rn;function i($,C,G,Y){function Q(A){return A instanceof G?A:new G(function(x){x(A)})}return new(G||(G=Promise))(function(A,x){function F(V){try{q(Y.next(V))}catch(N){x(N)}}function U(V){try{q(Y.throw(V))}catch(N){x(N)}}function q(V){V.done?A(V.value):Q(V.value).then(F,U)}q((Y=Y.apply($,[])).next())})}function l($,C){var G={label:0,sent:function(){if(A[0]&1)throw A[1];return A[1]},trys:[],ops:[]},Y,Q,A,x;return x={next:F(0),throw:F(1),return:F(2)},typeof Symbol=="function"&&(x[Symbol.iterator]=function(){return this}),x;function F(q){return function(V){return U([q,V])}}function U(q){if(Y)throw new TypeError("Generator is already executing.");for(;x&&(x=0,q[0]&&(G=0)),G;)try{if(Y=1,Q&&(A=q[0]&2?Q.return:q[0]?Q.throw||((A=Q.return)&&A.call(Q),0):Q.next)&&!(A=A.call(Q,q[1])).done)return A;switch(Q=0,A&&(q=[q[0]&2,A.value]),q[0]){case 0:case 1:A=q;break;case 4:return G.label++,{value:q[1],done:!1};case 5:G.label++,Q=q[1],q=[0];continue;case 7:q=G.ops.pop(),G.trys.pop();continue;default:if(A=G.trys,!(A=A.length>0&&A[A.length-1])&&(q[0]===6||q[0]===2)){G=0;continue}if(q[0]===3&&(!A||q[1]>A[0]&&q[1]<A[3])){G.label=q[1];break}if(q[0]===6&&G.label<A[1]){G.label=A[1],A=q;break}if(A&&G.label<A[2]){G.label=A[2],G.ops.push(q);break}A[2]&&G.ops.pop(),G.trys.pop();continue}q=C.call($,G)}catch(V){q=[6,V],Q=0}finally{Y=A=0}if(q[0]&5)throw q[1];return{value:q[0]?q[1]:void 0,done:!0}}}var u=e.env.npm_package_json,a=e.env.npm_config_user_agent,c=!!(a&&a.startsWith("npm")),m=!!(u&&u.endsWith("package.json")),p=c||m,v=!!(a&&a.startsWith("yarn")),E=p||v,d=r.homedir(),f=process.env.XDG_CONFIG_HOME||n.join(d,".config","simple-update-notifier"),h=function($){return n.join(f,"".concat($.replace("@","").replace("/","__"),".json"))},y=function(){o.existsSync(f)||o.mkdirSync(f,{recursive:!0})},w=function($){var C=h($);try{if(!o.existsSync(C))return;var G=JSON.parse(o.readFileSync(C,"utf8"));return G.lastUpdateCheck}catch{return}},S=function($){var C=h($);o.writeFileSync(C,JSON.stringify({lastUpdateCheck:new Date().getTime()}))},_=function($,C){return i(void 0,void 0,void 0,function(){var G;return l(this,function(Y){return G="https://registry.npmjs.org/-/package/".concat($,"/dist-tags"),[2,new Promise(function(Q,A){s.get(G,function(x){var F="";x.on("data",function(U){return F+=U}),x.on("end",function(){try{var U=JSON.parse(F),q=U[C];q||A(new Error("Error getting version")),Q(q)}catch{A(new Error("Could not parse version response"))}})}).on("error",function(x){return A(x)})})]})})},b=function($){var C=$.pkg,G=$.updateCheckInterval,Y=G===void 0?1e3*60*60*24:G,Q=$.distTag,A=Q===void 0?"latest":Q,x=$.alwaysRun,F=$.debug;return i(void 0,void 0,void 0,function(){var U,q;return l(this,function(V){switch(V.label){case 0:return y(),U=w(C.name),x||!U||U<new Date().getTime()-Y?[4,_(C.name,A)]:[3,2];case 1:return q=V.sent(),S(C.name),t.gt(q,C.version)?[2,q]:(F&&console.error("Latest version (".concat(q,") not newer than current version (").concat(C.version,")")),[3,3]);case 2:F&&console.error("Too recent to check for a new update. simpleUpdateNotifier() interval set to ".concat(Y,"ms but only ").concat(new Date().getTime()-U,"ms since last check.")),V.label=3;case 3:return[2,!1]}})})},g=function($){for(var C=$.split(`
|
||
`),G=Math.max.apply(Math,C.map(function(F){return F.length})),Y=["┌".concat("─".repeat(G+2),"┐")],Q=0,A=C;Q<A.length;Q++){var x=A[Q];Y.push("│ ".concat(x.padEnd(G)," │"))}return Y.push("└".concat("─".repeat(G+2),"┘")),Y.join(`
|
||
`)},O=function($){return i(void 0,void 0,void 0,function(){var C,G;return l(this,function(Y){switch(Y.label){case 0:if(!$.alwaysRun&&(!process.stdout.isTTY||E&&!$.shouldNotifyInNpmScript))return $.debug&&console.error("Opting out of running simpleUpdateNotifier()"),[2];Y.label=1;case 1:return Y.trys.push([1,3,,4]),[4,b($)];case 2:return C=Y.sent(),C&&console.error(g("New version of ".concat($.pkg.name,` available!
|
||
Current Version: `).concat($.pkg.version,`
|
||
Latest Version: `).concat(C))),[3,4];case 3:return G=Y.sent(),$.debug&&G instanceof Error&&console.error("Unexpected error in simpleUpdateNotifier():",G),[3,4];case 4:return[2]}})})};return Ni=O,Ni}var ey=Zm();const ty=Oe(ey),ry="setup-cpp",ny="1.7.2",xa={name:ry,version:ny};var dt={},Ye={},Mt={},Zc;function Ca(){if(Zc)return Mt;Zc=1,Object.defineProperty(Mt,"__esModule",{value:!0}),Mt.toCommandProperties=Mt.toCommandValue=void 0;function e(r){return r==null?"":typeof r=="string"||r instanceof String?r:JSON.stringify(r)}Mt.toCommandValue=e;function t(r){return Object.keys(r).length?{title:r.title,file:r.file,line:r.startLine,endLine:r.endLine,col:r.startColumn,endColumn:r.endColumn}:{}}return Mt.toCommandProperties=t,Mt}var eu;function iy(){if(eu)return Ye;eu=1;var e=Ye&&Ye.__createBinding||(Object.create?function(m,p,v,E){E===void 0&&(E=v);var d=Object.getOwnPropertyDescriptor(p,v);(!d||("get"in d?!p.__esModule:d.writable||d.configurable))&&(d={enumerable:!0,get:function(){return p[v]}}),Object.defineProperty(m,E,d)}:function(m,p,v,E){E===void 0&&(E=v),m[E]=p[v]}),t=Ye&&Ye.__setModuleDefault||(Object.create?function(m,p){Object.defineProperty(m,"default",{enumerable:!0,value:p})}:function(m,p){m.default=p}),r=Ye&&Ye.__importStar||function(m){if(m&&m.__esModule)return m;var p={};if(m!=null)for(var v in m)v!=="default"&&Object.prototype.hasOwnProperty.call(m,v)&&e(p,m,v);return t(p,m),p};Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.issue=Ye.issueCommand=void 0;const n=r(le),o=Ca();function s(m,p,v){const E=new u(m,p,v);process.stdout.write(E.toString()+n.EOL)}Ye.issueCommand=s;function i(m,p=""){s(m,{},p)}Ye.issue=i;const l="::";class u{constructor(p,v,E){p||(p="missing.command"),this.command=p,this.properties=v,this.message=E}toString(){let p=l+this.command;if(this.properties&&Object.keys(this.properties).length>0){p+=" ";let v=!0;for(const E in this.properties)if(this.properties.hasOwnProperty(E)){const d=this.properties[E];d&&(v?v=!1:p+=",",p+=`${E}=${c(d)}`)}}return p+=`${l}${a(this.message)}`,p}}function a(m){return(0,o.toCommandValue)(m).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function c(m){return(0,o.toCommandValue)(m).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}return Ye}var Je={},sp;(sp=global.crypto)!=null&&sp.randomUUID||(global.crypto||(global.crypto={}),global.crypto.randomUUID=()=>{let e=new Date().getTime(),t=Om.performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{let n=Math.random()*16;return e>0?(n=(e+n)%16|0,e=Math.floor(e/16)):(n=(t+n)%16|0,t=Math.floor(t/16)),(r==="x"?n:n&3|8).toString(16)})});const oy=global.crypto.randomUUID.bind(global.crypto),Aa=$n(cp);var tu;function sy(){if(tu)return Je;tu=1;var e=Je&&Je.__createBinding||(Object.create?function(a,c,m,p){p===void 0&&(p=m);var v=Object.getOwnPropertyDescriptor(c,m);(!v||("get"in v?!c.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return c[m]}}),Object.defineProperty(a,p,v)}:function(a,c,m,p){p===void 0&&(p=m),a[p]=c[m]}),t=Je&&Je.__setModuleDefault||(Object.create?function(a,c){Object.defineProperty(a,"default",{enumerable:!0,value:c})}:function(a,c){a.default=c}),r=Je&&Je.__importStar||function(a){if(a&&a.__esModule)return a;var c={};if(a!=null)for(var m in a)m!=="default"&&Object.prototype.hasOwnProperty.call(a,m)&&e(c,a,m);return t(c,a),c};Object.defineProperty(Je,"__esModule",{value:!0}),Je.prepareKeyValueMessage=Je.issueFileCommand=void 0;const n=r(Aa),o=r(ae),s=r(le),i=Ca();function l(a,c){const m=process.env[`GITHUB_${a}`];if(!m)throw new Error(`Unable to find environment variable for file command ${a}`);if(!o.existsSync(m))throw new Error(`Missing file at path: ${m}`);o.appendFileSync(m,`${(0,i.toCommandValue)(c)}${s.EOL}`,{encoding:"utf8"})}Je.issueFileCommand=l;function u(a,c){const m=`ghadelimiter_${n.randomUUID()}`,p=(0,i.toCommandValue)(c);if(a.includes(m))throw new Error(`Unexpected input: name should not contain the delimiter "${m}"`);if(p.includes(m))throw new Error(`Unexpected input: value should not contain the delimiter "${m}"`);return`${a}<<${m}${s.EOL}${p}${s.EOL}${m}`}return Je.prepareKeyValueMessage=u,Je}var Gt={};function wa(e){const t=e.protocol==="https:";if(ay(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 ru(r)}catch{if(!r.startsWith("http://")&&!r.startsWith("https://"))return new ru(`http://${r}`)}else return}function ay(e){if(!e.hostname)return!1;const t=e.hostname;if(cy(t))return!0;const r=process.env.no_proxy||process.env.NO_PROXY||"";if(!r)return!1;let n;e.port?n=Number(e.port):e.protocol==="http:"?n=80:e.protocol==="https:"&&(n=443);const o=[e.hostname.toUpperCase()];typeof n=="number"&&o.push(`${o[0]}:${n}`);for(const s of r.split(",").map(i=>i.trim().toUpperCase()).filter(i=>i))if(s==="*"||o.some(i=>i===s||i.endsWith(`.${s}`)||s.startsWith(".")&&i.endsWith(`${s}`)))return!0;return!1}function cy(e){const t=e.toLowerCase();return t==="localhost"||t.startsWith("127.")||t.startsWith("[::1]")||t.startsWith("[0:0:0:0:0:0:0:1]")}class ru extends URL{_decodedUsername;_decodedPassword;constructor(t,r){super(t,r),this._decodedUsername=decodeURIComponent(super.username),this._decodedPassword=decodeURIComponent(super.password)}get username(){return this._decodedUsername}get password(){return this._decodedPassword}}var Vt={},nu;function uy(){if(nu)return Vt;nu=1;var e=$m,t=ba,r=Rn,n=On,o=pr;Vt.httpOverHttp=s,Vt.httpsOverHttp=i,Vt.httpOverHttps=l,Vt.httpsOverHttps=u;function s(E){var d=new a(E);return d.request=t.request,d}function i(E){var d=new a(E);return d.request=t.request,d.createSocket=c,d.defaultPort=443,d}function l(E){var d=new a(E);return d.request=r.request,d}function u(E){var d=new a(E);return d.request=r.request,d.createSocket=c,d.defaultPort=443,d}function a(E){var d=this;d.options=E||{},d.proxyOptions=d.options.proxy||{},d.maxSockets=d.options.maxSockets||t.Agent.defaultMaxSockets,d.requests=[],d.sockets=[],d.on("free",function(h,y,w,S){for(var _=m(y,w,S),b=0,g=d.requests.length;b<g;++b){var O=d.requests[b];if(O.host===_.host&&O.port===_.port){d.requests.splice(b,1),O.request.onSocket(h);return}}h.destroy(),d.removeSocket(h)})}o.inherits(a,n.EventEmitter),a.prototype.addRequest=function(d,f,h,y){var w=this,S=p({request:d},w.options,m(f,h,y));if(w.sockets.length>=this.maxSockets){w.requests.push(S);return}w.createSocket(S,function(_){_.on("free",b),_.on("close",g),_.on("agentRemove",g),d.onSocket(_);function b(){w.emit("free",_,S)}function g(O){w.removeSocket(_),_.removeListener("free",b),_.removeListener("close",g),_.removeListener("agentRemove",g)}})},a.prototype.createSocket=function(d,f){var h=this,y={};h.sockets.push(y);var w=p({},h.proxyOptions,{method:"CONNECT",path:d.host+":"+d.port,agent:!1,headers:{host:d.host+":"+d.port}});d.localAddress&&(w.localAddress=d.localAddress),w.proxyAuth&&(w.headers=w.headers||{},w.headers["Proxy-Authorization"]="Basic "+new Buffer(w.proxyAuth).toString("base64")),v("making CONNECT request");var S=h.request(w);S.useChunkedEncodingByDefault=!1,S.once("response",_),S.once("upgrade",b),S.once("connect",g),S.once("error",O),S.end();function _($){$.upgrade=!0}function b($,C,G){process.nextTick(function(){g($,C,G)})}function g($,C,G){if(S.removeAllListeners(),C.removeAllListeners(),$.statusCode!==200){v("tunneling socket could not be established, statusCode=%d",$.statusCode),C.destroy();var Y=new Error("tunneling socket could not be established, statusCode="+$.statusCode);Y.code="ECONNRESET",d.request.emit("error",Y),h.removeSocket(y);return}if(G.length>0){v("got illegal response body from proxy"),C.destroy();var Y=new Error("got illegal response body from proxy");Y.code="ECONNRESET",d.request.emit("error",Y),h.removeSocket(y);return}return v("tunneling connection has established"),h.sockets[h.sockets.indexOf(y)]=C,f(C)}function O($){S.removeAllListeners(),v(`tunneling socket could not be established, cause=%s
|
||
`,$.message,$.stack);var C=new Error("tunneling socket could not be established, cause="+$.message);C.code="ECONNRESET",d.request.emit("error",C),h.removeSocket(y)}},a.prototype.removeSocket=function(d){var f=this.sockets.indexOf(d);if(f!==-1){this.sockets.splice(f,1);var h=this.requests.shift();h&&this.createSocket(h,function(y){h.request.onSocket(y)})}};function c(E,d){var f=this;a.prototype.createSocket.call(f,E,function(h){var y=E.request.getHeader("host"),w=p({},f.options,{socket:h,servername:y?y.replace(/:.*$/,""):E.host}),S=e.connect(0,w);f.sockets[f.sockets.indexOf(h)]=S,d(S)})}function m(E,d,f){return typeof E=="string"?{host:E,port:d,localAddress:f}:E}function p(E){for(var d=1,f=arguments.length;d<f;++d){var h=arguments[d];if(typeof h=="object")for(var y=Object.keys(h),w=0,S=y.length;w<S;++w){var _=y[w];h[_]!==void 0&&(E[_]=h[_])}}return E}var v;return process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?v=function(){var E=Array.prototype.slice.call(arguments);typeof E[0]=="string"?E[0]="TUNNEL: "+E[0]:E.unshift("TUNNEL:"),console.error.apply(console,E)}:v=function(){},Vt.debug=v,Vt}var Li,iu;function ly(){return iu||(iu=1,Li=uy()),Li}var Br=ly(),tt;(function(e){e[e.OK=200]="OK",e[e.MultipleChoices=300]="MultipleChoices",e[e.MovedPermanently=301]="MovedPermanently",e[e.ResourceMoved=302]="ResourceMoved",e[e.SeeOther=303]="SeeOther",e[e.NotModified=304]="NotModified",e[e.UseProxy=305]="UseProxy",e[e.SwitchProxy=306]="SwitchProxy",e[e.TemporaryRedirect=307]="TemporaryRedirect",e[e.PermanentRedirect=308]="PermanentRedirect",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.PaymentRequired=402]="PaymentRequired",e[e.Forbidden=403]="Forbidden",e[e.NotFound=404]="NotFound",e[e.MethodNotAllowed=405]="MethodNotAllowed",e[e.NotAcceptable=406]="NotAcceptable",e[e.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",e[e.RequestTimeout=408]="RequestTimeout",e[e.Conflict=409]="Conflict",e[e.Gone=410]="Gone",e[e.TooManyRequests=429]="TooManyRequests",e[e.InternalServerError=500]="InternalServerError",e[e.NotImplemented=501]="NotImplemented",e[e.BadGateway=502]="BadGateway",e[e.ServiceUnavailable=503]="ServiceUnavailable",e[e.GatewayTimeout=504]="GatewayTimeout"})(tt||(tt={}));var je;(function(e){e.Accept="accept",e.ContentType="content-type"})(je||(je={}));var It;(function(e){e.ApplicationJson="application/json"})(It||(It={}));function fy(e){const t=wa(new URL(e));return t?t.href:""}const dy=[tt.MovedPermanently,tt.ResourceMoved,tt.SeeOther,tt.TemporaryRedirect,tt.PermanentRedirect],py=[tt.BadGateway,tt.ServiceUnavailable,tt.GatewayTimeout],hy=["OPTIONS","GET","DELETE","HEAD"],my=10,yy=5;class An extends Error{constructor(t,r){super(t),this.name="HttpClientError",this.statusCode=r,Object.setPrototypeOf(this,An.prototype)}statusCode;result}class wp{constructor(t){this.message=t}message;async readBody(){return new Promise(async t=>{let r=Buffer.alloc(0);this.message.on("data",n=>{r=Buffer.concat([r,n])}),this.message.on("end",()=>{t(r.toString())})})}async readBodyBuffer(){return new Promise(async t=>{const r=[];this.message.on("data",n=>{r.push(n)}),this.message.on("end",()=>{t(Buffer.concat(r))})})}}function wy(e){return new URL(e).protocol==="https:"}class vp{userAgent;handlers;requestOptions;_ignoreSslError=!1;_socketTimeout;_allowRedirects=!0;_allowRedirectDowngrade=!1;_maxRedirects=50;_allowRetries=!1;_maxRetries=1;_agent;_proxyAgent;_proxyAgentDispatcher;_keepAlive=!1;_disposed=!1;constructor(t,r,n){this.userAgent=t,this.handlers=r||[],this.requestOptions=n,n&&(n.ignoreSslError!=null&&(this._ignoreSslError=n.ignoreSslError),this._socketTimeout=n.socketTimeout,n.allowRedirects!=null&&(this._allowRedirects=n.allowRedirects),n.allowRedirectDowngrade!=null&&(this._allowRedirectDowngrade=n.allowRedirectDowngrade),n.maxRedirects!=null&&(this._maxRedirects=Math.max(n.maxRedirects,0)),n.keepAlive!=null&&(this._keepAlive=n.keepAlive),n.allowRetries!=null&&(this._allowRetries=n.allowRetries),n.maxRetries!=null&&(this._maxRetries=n.maxRetries))}async options(t,r){return this.request("OPTIONS",t,null,r||{})}async get(t,r){return this.request("GET",t,null,r||{})}async del(t,r){return this.request("DELETE",t,null,r||{})}async post(t,r,n){return this.request("POST",t,r,n||{})}async patch(t,r,n){return this.request("PATCH",t,r,n||{})}async put(t,r,n){return this.request("PUT",t,r,n||{})}async head(t,r){return this.request("HEAD",t,null,r||{})}async sendStream(t,r,n,o){return this.request(t,r,n,o)}async getJson(t,r={}){r[je.Accept]=this._getExistingOrDefaultHeader(r,je.Accept,It.ApplicationJson);const n=await this.get(t,r);return this._processResponse(n,this.requestOptions)}async postJson(t,r,n={}){const o=JSON.stringify(r,null,2);n[je.Accept]=this._getExistingOrDefaultHeader(n,je.Accept,It.ApplicationJson),n[je.ContentType]=this._getExistingOrDefaultHeader(n,je.ContentType,It.ApplicationJson);const s=await this.post(t,o,n);return this._processResponse(s,this.requestOptions)}async putJson(t,r,n={}){const o=JSON.stringify(r,null,2);n[je.Accept]=this._getExistingOrDefaultHeader(n,je.Accept,It.ApplicationJson),n[je.ContentType]=this._getExistingOrDefaultHeader(n,je.ContentType,It.ApplicationJson);const s=await this.put(t,o,n);return this._processResponse(s,this.requestOptions)}async patchJson(t,r,n={}){const o=JSON.stringify(r,null,2);n[je.Accept]=this._getExistingOrDefaultHeader(n,je.Accept,It.ApplicationJson),n[je.ContentType]=this._getExistingOrDefaultHeader(n,je.ContentType,It.ApplicationJson);const s=await this.patch(t,o,n);return this._processResponse(s,this.requestOptions)}async request(t,r,n,o){if(this._disposed)throw new Error("Client has already been disposed.");const s=new URL(r);let i=this._prepareRequest(t,s,o);const l=this._allowRetries&&hy.includes(t)?this._maxRetries+1:1;let u=0,a;do{if(a=await this.requestRaw(i,n),a&&a.message&&a.message.statusCode===tt.Unauthorized){let m;for(const p of this.handlers)if(p.canHandleAuthentication(a)){m=p;break}return m?m.handleAuthentication(this,i,n):a}let c=this._maxRedirects;for(;a.message.statusCode&&dy.includes(a.message.statusCode)&&this._allowRedirects&&c>0;){const m=a.message.headers.location;if(!m)break;const p=new URL(m);if(s.protocol==="https:"&&s.protocol!==p.protocol&&!this._allowRedirectDowngrade)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.");if(await a.readBody(),p.hostname!==s.hostname)for(const v in o)v.toLowerCase()==="authorization"&&delete o[v];i=this._prepareRequest(t,p,o),a=await this.requestRaw(i,n),c--}if(!a.message.statusCode||!py.includes(a.message.statusCode))return a;u+=1,u<l&&(await a.readBody(),await this._performExponentialBackoff(u))}while(u<l);return a}dispose(){this._agent&&this._agent.destroy(),this._disposed=!0}async requestRaw(t,r){return new Promise((n,o)=>{function s(i,l){i?o(i):l?n(l):o(new Error("Unknown error"))}this.requestRawWithCallback(t,r,s)})}requestRawWithCallback(t,r,n){typeof r=="string"&&(t.options.headers||(t.options.headers={}),t.options.headers["Content-Length"]=Buffer.byteLength(r,"utf8"));let o=!1;function s(u,a){o||(o=!0,n(u,a))}const i=t.httpModule.request(t.options,u=>{const a=new wp(u);s(void 0,a)});let l;i.on("socket",u=>{l=u}),i.setTimeout(this._socketTimeout||3*6e4,()=>{l&&l.end(),s(new Error(`Request timeout: ${t.options.path}`))}),i.on("error",function(u){s(u)}),r&&typeof r=="string"&&i.write(r,"utf8"),r&&typeof r!="string"?(r.on("close",function(){i.end()}),r.pipe(i)):i.end()}getAgent(t){const r=new URL(t);return this._getAgent(r)}async getAgentDispatcher(t){const r=new URL(t),n=wa(r);if(n&&n.hostname)return await this._getProxyAgentDispatcher(r,n)}_prepareRequest(t,r,n){const o={};o.parsedUrl=r;const s=o.parsedUrl.protocol==="https:";o.httpModule=s?sc:Mn;const i=s?443:80;if(o.options={},o.options.host=o.parsedUrl.hostname,o.options.port=o.parsedUrl.port?parseInt(o.parsedUrl.port):i,o.options.path=(o.parsedUrl.pathname||"")+(o.parsedUrl.search||""),o.options.method=t,o.options.headers=this._mergeHeaders(n),this.userAgent!=null&&(o.options.headers["user-agent"]=this.userAgent),o.options.agent=this._getAgent(o.parsedUrl),this.handlers)for(const l of this.handlers)l.prepareRequest(o.options);return o}_mergeHeaders(t){return this.requestOptions&&this.requestOptions.headers?Object.assign({},zr(this.requestOptions.headers),zr(t||{})):zr(t||{})}_getExistingOrDefaultHeader(t,r,n){let o;return this.requestOptions&&this.requestOptions.headers&&(o=zr(this.requestOptions.headers)[r]),t[r]||o||n}_getAgent(t){let r;const n=wa(t),o=n&&n.hostname;if(this._keepAlive&&o&&(r=this._proxyAgent),o||(r=this._agent),r)return r;const s=t.protocol==="https:";let i=100;if(this.requestOptions&&(i=this.requestOptions.maxSockets||Mn.globalAgent.maxSockets),n&&n.hostname){const l={maxSockets:i,keepAlive:this._keepAlive,proxy:{...(n.username||n.password)&&{proxyAuth:`${n.username}:${n.password}`},host:n.hostname,port:n.port}};let u;const a=n.protocol==="https:";s?u=a?Br.httpsOverHttps:Br.httpsOverHttp:u=a?Br.httpOverHttps:Br.httpOverHttp,r=u(l),this._proxyAgent=r}if(!r){const l={keepAlive:this._keepAlive,maxSockets:i};r=s?new sc.Agent(l):new Mn.Agent(l),this._agent=r}return s&&this._ignoreSslError&&(r.options=Object.assign(r.options||{},{rejectUnauthorized:!1})),r}async _getProxyAgentDispatcher(t,r){let n;if(this._keepAlive&&(n=this._proxyAgentDispatcher),n)return n;const o=t.protocol==="https:",s=await Promise.resolve().then(()=>require("./assets/proxy-agent-DrLNheMy.js")).then(i=>i.proxyAgent);return n=new s({uri:r.href,pipelining:this._keepAlive?1:0,...(r.username||r.password)&&{token:`Basic ${Buffer.from(`${r.username}:${r.password}`).toString("base64")}`}}),this._proxyAgentDispatcher=n,o&&this._ignoreSslError&&(n.options=Object.assign(n.options.requestTls||{},{rejectUnauthorized:!1})),n}async _performExponentialBackoff(t){t=Math.min(my,t);const r=yy*Math.pow(2,t);return new Promise(n=>setTimeout(()=>n(),r))}async _processResponse(t,r){return new Promise(async(n,o)=>{const s=t.message.statusCode||0,i={statusCode:s,result:null,headers:{}};s===tt.NotFound&&n(i);function l(c,m){if(typeof m=="string"){const p=new Date(m);if(!isNaN(p.valueOf()))return p}return m}let u,a;try{a=await t.readBody(),a&&a.length>0&&(r&&r.deserializeDates?u=JSON.parse(a,l):u=JSON.parse(a),i.result=u),i.headers=t.message.headers}catch{}if(s>299){let c;u&&u.message?c=u.message:a&&a.length>0?c=a:c=`Failed request: (${s})`;const m=new An(c,s);m.result=i.result,o(m)}else n(i)})}}const zr=e=>Object.keys(e).reduce((t,r)=>(t[r.toLowerCase()]=e[r],t),{}),vy=Object.freeze(Object.defineProperty({__proto__:null,get Headers(){return je},HttpClient:vp,HttpClientError:An,HttpClientResponse:wp,get HttpCodes(){return tt},get MediaTypes(){return It},getProxyUrl:fy,isHttps:wy},Symbol.toStringTag,{value:"Module"})),gp=$n(vy);var pt={},ou;function gy(){if(ou)return pt;ou=1;var e=pt&&pt.__awaiter||function(o,s,i,l){function u(a){return a instanceof i?a:new i(function(c){c(a)})}return new(i||(i=Promise))(function(a,c){function m(E){try{v(l.next(E))}catch(d){c(d)}}function p(E){try{v(l.throw(E))}catch(d){c(d)}}function v(E){E.done?a(E.value):u(E.value).then(m,p)}v((l=l.apply(o,s||[])).next())})};Object.defineProperty(pt,"__esModule",{value:!0}),pt.PersonalAccessTokenCredentialHandler=pt.BearerCredentialHandler=pt.BasicCredentialHandler=void 0;class t{constructor(s,i){this.username=s,this.password=i}prepareRequest(s){if(!s.headers)throw Error("The request has no headers");s.headers.Authorization=`Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`}canHandleAuthentication(){return!1}handleAuthentication(){return e(this,void 0,void 0,function*(){throw new Error("not implemented")})}}pt.BasicCredentialHandler=t;class r{constructor(s){this.token=s}prepareRequest(s){if(!s.headers)throw Error("The request has no headers");s.headers.Authorization=`Bearer ${this.token}`}canHandleAuthentication(){return!1}handleAuthentication(){return e(this,void 0,void 0,function*(){throw new Error("not implemented")})}}pt.BearerCredentialHandler=r;class n{constructor(s){this.token=s}prepareRequest(s){if(!s.headers)throw Error("The request has no headers");s.headers.Authorization=`Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`}canHandleAuthentication(){return!1}handleAuthentication(){return e(this,void 0,void 0,function*(){throw new Error("not implemented")})}}return pt.PersonalAccessTokenCredentialHandler=n,pt}var su;function _y(){if(su)return Gt;su=1;var e=Gt&&Gt.__awaiter||function(s,i,l,u){function a(c){return c instanceof l?c:new l(function(m){m(c)})}return new(l||(l=Promise))(function(c,m){function p(d){try{E(u.next(d))}catch(f){m(f)}}function v(d){try{E(u.throw(d))}catch(f){m(f)}}function E(d){d.done?c(d.value):a(d.value).then(p,v)}E((u=u.apply(s,i||[])).next())})};Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.OidcClient=void 0;const t=gp,r=gy(),n=mr();class o{static createHttpClient(i=!0,l=10){const u={allowRetries:i,maxRetries:l};return new t.HttpClient("actions/oidc-client",[new r.BearerCredentialHandler(o.getRequestToken())],u)}static getRequestToken(){const i=process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN;if(!i)throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable");return i}static getIDTokenUrl(){const i=process.env.ACTIONS_ID_TOKEN_REQUEST_URL;if(!i)throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable");return i}static getCall(i){var l;return e(this,void 0,void 0,function*(){const c=(l=(yield o.createHttpClient().getJson(i).catch(m=>{throw new Error(`Failed to get ID Token.
|
||
|
||
Error Code : ${m.statusCode}
|
||
|
||
Error Message: ${m.message}`)})).result)===null||l===void 0?void 0:l.value;if(!c)throw new Error("Response json body do not have ID Token field");return c})}static getIDToken(i){return e(this,void 0,void 0,function*(){try{let l=o.getIDTokenUrl();if(i){const a=encodeURIComponent(i);l=`${l}&audience=${a}`}(0,n.debug)(`ID token url is ${l}`);const u=yield o.getCall(l);return(0,n.setSecret)(u),u}catch(l){throw new Error(`Error message: ${l.message}`)}})}}return Gt.OidcClient=o,Gt}var Rr={},au;function cu(){return au||(au=1,function(e){var t=Rr&&Rr.__awaiter||function(a,c,m,p){function v(E){return E instanceof m?E:new m(function(d){d(E)})}return new(m||(m=Promise))(function(E,d){function f(w){try{y(p.next(w))}catch(S){d(S)}}function h(w){try{y(p.throw(w))}catch(S){d(S)}}function y(w){w.done?E(w.value):v(w.value).then(f,h)}y((p=p.apply(a,c||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.summary=e.markdownSummary=e.SUMMARY_DOCS_URL=e.SUMMARY_ENV_VAR=void 0;const r=le,n=ae,{access:o,appendFile:s,writeFile:i}=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";class l{constructor(){this._buffer=""}filePath(){return t(this,void 0,void 0,function*(){if(this._filePath)return this._filePath;const c=process.env[e.SUMMARY_ENV_VAR];if(!c)throw new Error(`Unable to find environment variable for $${e.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);try{yield o(c,n.constants.R_OK|n.constants.W_OK)}catch{throw new Error(`Unable to access summary file: '${c}'. Check if the file has correct read/write permissions.`)}return this._filePath=c,this._filePath})}wrap(c,m,p={}){const v=Object.entries(p).map(([E,d])=>` ${E}="${d}"`).join("");return m?`<${c}${v}>${m}</${c}>`:`<${c}${v}>`}write(c){return t(this,void 0,void 0,function*(){const m=!!(c!=null&&c.overwrite),p=yield this.filePath();return yield(m?i:s)(p,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 this._buffer.length===0}emptyBuffer(){return this._buffer="",this}addRaw(c,m=!1){return this._buffer+=c,m?this.addEOL():this}addEOL(){return this.addRaw(r.EOL)}addCodeBlock(c,m){const p=Object.assign({},m&&{lang:m}),v=this.wrap("pre",this.wrap("code",c),p);return this.addRaw(v).addEOL()}addList(c,m=!1){const p=m?"ol":"ul",v=c.map(d=>this.wrap("li",d)).join(""),E=this.wrap(p,v);return this.addRaw(E).addEOL()}addTable(c){const m=c.map(v=>{const E=v.map(d=>{if(typeof d=="string")return this.wrap("td",d);const{header:f,data:h,colspan:y,rowspan:w}=d,S=f?"th":"td",_=Object.assign(Object.assign({},y&&{colspan:y}),w&&{rowspan:w});return this.wrap(S,h,_)}).join("");return this.wrap("tr",E)}).join(""),p=this.wrap("table",m);return this.addRaw(p).addEOL()}addDetails(c,m){const p=this.wrap("details",this.wrap("summary",c)+m);return this.addRaw(p).addEOL()}addImage(c,m,p){const{width:v,height:E}=p||{},d=Object.assign(Object.assign({},v&&{width:v}),E&&{height:E}),f=this.wrap("img",null,Object.assign({src:c,alt:m},d));return this.addRaw(f).addEOL()}addHeading(c,m){const p=`h${m}`,v=["h1","h2","h3","h4","h5","h6"].includes(p)?p:"h1",E=this.wrap(v,c);return this.addRaw(E).addEOL()}addSeparator(){const c=this.wrap("hr",null);return this.addRaw(c).addEOL()}addBreak(){const c=this.wrap("br",null);return this.addRaw(c).addEOL()}addQuote(c,m){const p=Object.assign({},m&&{cite:m}),v=this.wrap("blockquote",c,p);return this.addRaw(v).addEOL()}addLink(c,m){const p=this.wrap("a",c,{href:m});return this.addRaw(p).addEOL()}}const u=new l;e.markdownSummary=u,e.summary=u}(Rr)),Rr}var Ge={},uu;function Ey(){if(uu)return Ge;uu=1;var e=Ge&&Ge.__createBinding||(Object.create?function(l,u,a,c){c===void 0&&(c=a);var m=Object.getOwnPropertyDescriptor(u,a);(!m||("get"in m?!u.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return u[a]}}),Object.defineProperty(l,c,m)}:function(l,u,a,c){c===void 0&&(c=a),l[c]=u[a]}),t=Ge&&Ge.__setModuleDefault||(Object.create?function(l,u){Object.defineProperty(l,"default",{enumerable:!0,value:u})}:function(l,u){l.default=u}),r=Ge&&Ge.__importStar||function(l){if(l&&l.__esModule)return l;var u={};if(l!=null)for(var a in l)a!=="default"&&Object.prototype.hasOwnProperty.call(l,a)&&e(u,l,a);return t(u,l),u};Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.toPlatformPath=Ge.toWin32Path=Ge.toPosixPath=void 0;const n=r(T);function o(l){return l.replace(/[\\]/g,"/")}Ge.toPosixPath=o;function s(l){return l.replace(/[/]/g,"\\")}Ge.toWin32Path=s;function i(l){return l.replace(/[/\\]/g,n.sep)}return Ge.toPlatformPath=i,Ge}var Qe={},Ve={},Be={},Re={},ht={},lu;function _p(){return lu||(lu=1,function(e){var t=ht&&ht.__createBinding||(Object.create?function(d,f,h,y){y===void 0&&(y=h),Object.defineProperty(d,y,{enumerable:!0,get:function(){return f[h]}})}:function(d,f,h,y){y===void 0&&(y=h),d[y]=f[h]}),r=ht&&ht.__setModuleDefault||(Object.create?function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}:function(d,f){d.default=f}),n=ht&&ht.__importStar||function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h in d)h!=="default"&&Object.hasOwnProperty.call(d,h)&&t(f,d,h);return r(f,d),f},o=ht&&ht.__awaiter||function(d,f,h,y){function w(S){return S instanceof h?S:new h(function(_){_(S)})}return new(h||(h=Promise))(function(S,_){function b($){try{O(y.next($))}catch(C){_(C)}}function g($){try{O(y.throw($))}catch(C){_(C)}}function O($){$.done?S($.value):w($.value).then(b,g)}O((y=y.apply(d,f||[])).next())})},s;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 i=n(ae),l=n(T);s=i.promises,e.chmod=s.chmod,e.copyFile=s.copyFile,e.lstat=s.lstat,e.mkdir=s.mkdir,e.open=s.open,e.readdir=s.readdir,e.readlink=s.readlink,e.rename=s.rename,e.rm=s.rm,e.rmdir=s.rmdir,e.stat=s.stat,e.symlink=s.symlink,e.unlink=s.unlink,e.IS_WINDOWS=process.platform==="win32",e.UV_FS_O_EXLOCK=268435456,e.READONLY=i.constants.O_RDONLY;function u(d){return o(this,void 0,void 0,function*(){try{yield e.stat(d)}catch(f){if(f.code==="ENOENT")return!1;throw f}return!0})}e.exists=u;function a(d,f=!1){return o(this,void 0,void 0,function*(){return(f?yield e.stat(d):yield e.lstat(d)).isDirectory()})}e.isDirectory=a;function c(d){if(d=p(d),!d)throw new Error('isRooted() parameter "p" cannot be empty');return e.IS_WINDOWS?d.startsWith("\\")||/^[A-Z]:/i.test(d):d.startsWith("/")}e.isRooted=c;function m(d,f){return o(this,void 0,void 0,function*(){let h;try{h=yield e.stat(d)}catch(w){w.code!=="ENOENT"&&console.log(`Unexpected error attempting to determine if executable file exists '${d}': ${w}`)}if(h&&h.isFile()){if(e.IS_WINDOWS){const w=l.extname(d).toUpperCase();if(f.some(S=>S.toUpperCase()===w))return d}else if(v(h))return d}const y=d;for(const w of f){d=y+w,h=void 0;try{h=yield e.stat(d)}catch(S){S.code!=="ENOENT"&&console.log(`Unexpected error attempting to determine if executable file exists '${d}': ${S}`)}if(h&&h.isFile()){if(e.IS_WINDOWS){try{const S=l.dirname(d),_=l.basename(d).toUpperCase();for(const b of yield e.readdir(S))if(_===b.toUpperCase()){d=l.join(S,b);break}}catch(S){console.log(`Unexpected error attempting to determine the actual case of the file '${d}': ${S}`)}return d}else if(v(h))return d}}return""})}e.tryGetExecutablePath=m;function p(d){return d=d||"",e.IS_WINDOWS?(d=d.replace(/\//g,"\\"),d.replace(/\\\\+/g,"\\")):d.replace(/\/\/+/g,"/")}function v(d){return(d.mode&1)>0||(d.mode&8)>0&&d.gid===process.getgid()||(d.mode&64)>0&&d.uid===process.getuid()}function E(){var d;return(d=process.env.COMSPEC)!==null&&d!==void 0?d:"cmd.exe"}e.getCmdPath=E}(ht)),ht}var fu;function Ep(){if(fu)return Re;fu=1;var e=Re&&Re.__createBinding||(Object.create?function(f,h,y,w){w===void 0&&(w=y),Object.defineProperty(f,w,{enumerable:!0,get:function(){return h[y]}})}:function(f,h,y,w){w===void 0&&(w=y),f[w]=h[y]}),t=Re&&Re.__setModuleDefault||(Object.create?function(f,h){Object.defineProperty(f,"default",{enumerable:!0,value:h})}:function(f,h){f.default=h}),r=Re&&Re.__importStar||function(f){if(f&&f.__esModule)return f;var h={};if(f!=null)for(var y in f)y!=="default"&&Object.hasOwnProperty.call(f,y)&&e(h,f,y);return t(h,f),h},n=Re&&Re.__awaiter||function(f,h,y,w){function S(_){return _ instanceof y?_:new y(function(b){b(_)})}return new(y||(y=Promise))(function(_,b){function g(C){try{$(w.next(C))}catch(G){b(G)}}function O(C){try{$(w.throw(C))}catch(G){b(G)}}function $(C){C.done?_(C.value):S(C.value).then(g,O)}$((w=w.apply(f,h||[])).next())})};Object.defineProperty(Re,"__esModule",{value:!0}),Re.findInPath=Re.which=Re.mkdirP=Re.rmRF=Re.mv=Re.cp=void 0;const o=kr,s=r(T),i=r(_p());function l(f,h,y={}){return n(this,void 0,void 0,function*(){const{force:w,recursive:S,copySourceDirectory:_}=v(y),b=(yield i.exists(h))?yield i.stat(h):null;if(b&&b.isFile()&&!w)return;const g=b&&b.isDirectory()&&_?s.join(h,s.basename(f)):h;if(!(yield i.exists(f)))throw new Error(`no such file or directory: ${f}`);if((yield i.stat(f)).isDirectory())if(S)yield E(f,g,0,w);else throw new Error(`Failed to copy. ${f} is a directory, but tried to copy without recursive flag.`);else{if(s.relative(f,g)==="")throw new Error(`'${g}' and '${f}' are the same file`);yield d(f,g,w)}})}Re.cp=l;function u(f,h,y={}){return n(this,void 0,void 0,function*(){if(yield i.exists(h)){let w=!0;if((yield i.isDirectory(h))&&(h=s.join(h,s.basename(f)),w=yield i.exists(h)),w)if(y.force==null||y.force)yield a(h);else throw new Error("Destination already exists")}yield c(s.dirname(h)),yield i.rename(f,h)})}Re.mv=u;function a(f){return n(this,void 0,void 0,function*(){if(i.IS_WINDOWS&&/[*"<>|]/.test(f))throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');try{yield i.rm(f,{force:!0,maxRetries:3,recursive:!0,retryDelay:300})}catch(h){throw new Error(`File was unable to be removed ${h}`)}})}Re.rmRF=a;function c(f){return n(this,void 0,void 0,function*(){o.ok(f,"a path argument must be provided"),yield i.mkdir(f,{recursive:!0})})}Re.mkdirP=c;function m(f,h){return n(this,void 0,void 0,function*(){if(!f)throw new Error("parameter 'tool' is required");if(h){const w=yield m(f,!1);if(!w)throw i.IS_WINDOWS?new Error(`Unable to locate executable file: ${f}. 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.`):new Error(`Unable to locate executable file: ${f}. 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 w}const y=yield p(f);return y&&y.length>0?y[0]:""})}Re.which=m;function p(f){return n(this,void 0,void 0,function*(){if(!f)throw new Error("parameter 'tool' is required");const h=[];if(i.IS_WINDOWS&&process.env.PATHEXT)for(const S of process.env.PATHEXT.split(s.delimiter))S&&h.push(S);if(i.isRooted(f)){const S=yield i.tryGetExecutablePath(f,h);return S?[S]:[]}if(f.includes(s.sep))return[];const y=[];if(process.env.PATH)for(const S of process.env.PATH.split(s.delimiter))S&&y.push(S);const w=[];for(const S of y){const _=yield i.tryGetExecutablePath(s.join(S,f),h);_&&w.push(_)}return w})}Re.findInPath=p;function v(f){const h=f.force==null?!0:f.force,y=!!f.recursive,w=f.copySourceDirectory==null?!0:!!f.copySourceDirectory;return{force:h,recursive:y,copySourceDirectory:w}}function E(f,h,y,w){return n(this,void 0,void 0,function*(){if(y>=255)return;y++,yield c(h);const S=yield i.readdir(f);for(const _ of S){const b=`${f}/${_}`,g=`${h}/${_}`;(yield i.lstat(b)).isDirectory()?yield E(b,g,y,w):yield d(b,g,w)}yield i.chmod(h,(yield i.stat(f)).mode)})}function d(f,h,y){return n(this,void 0,void 0,function*(){if((yield i.lstat(f)).isSymbolicLink()){try{yield i.lstat(h),yield i.unlink(h)}catch(S){S.code==="EPERM"&&(yield i.chmod(h,"0666"),yield i.unlink(h))}const w=yield i.readlink(f);yield i.symlink(w,h,i.IS_WINDOWS?"junction":null)}else(!(yield i.exists(h))||y)&&(yield i.copyFile(f,h))})}return Re}var du;function Sy(){if(du)return Be;du=1;var e=Be&&Be.__createBinding||(Object.create?function(d,f,h,y){y===void 0&&(y=h),Object.defineProperty(d,y,{enumerable:!0,get:function(){return f[h]}})}:function(d,f,h,y){y===void 0&&(y=h),d[y]=f[h]}),t=Be&&Be.__setModuleDefault||(Object.create?function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}:function(d,f){d.default=f}),r=Be&&Be.__importStar||function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h in d)h!=="default"&&Object.hasOwnProperty.call(d,h)&&e(f,d,h);return t(f,d),f},n=Be&&Be.__awaiter||function(d,f,h,y){function w(S){return S instanceof h?S:new h(function(_){_(S)})}return new(h||(h=Promise))(function(S,_){function b($){try{O(y.next($))}catch(C){_(C)}}function g($){try{O(y.throw($))}catch(C){_(C)}}function O($){$.done?S($.value):w($.value).then(b,g)}O((y=y.apply(d,f||[])).next())})};Object.defineProperty(Be,"__esModule",{value:!0}),Be.argStringToArray=Be.ToolRunner=void 0;const o=r(le),s=r(On),i=r(Nt),l=r(T),u=r(Ep()),a=r(_p()),c=Pm,m=process.platform==="win32";class p extends s.EventEmitter{constructor(f,h,y){if(super(),!f)throw new Error("Parameter 'toolPath' cannot be null or empty.");this.toolPath=f,this.args=h||[],this.options=y||{}}_debug(f){this.options.listeners&&this.options.listeners.debug&&this.options.listeners.debug(f)}_getCommandString(f,h){const y=this._getSpawnFileName(),w=this._getSpawnArgs(f);let S=h?"":"[command]";if(m)if(this._isCmdFile()){S+=y;for(const _ of w)S+=` ${_}`}else if(f.windowsVerbatimArguments){S+=`"${y}"`;for(const _ of w)S+=` ${_}`}else{S+=this._windowsQuoteCmdArg(y);for(const _ of w)S+=` ${this._windowsQuoteCmdArg(_)}`}else{S+=y;for(const _ of w)S+=` ${_}`}return S}_processLineBuffer(f,h,y){try{let w=h+f.toString(),S=w.indexOf(o.EOL);for(;S>-1;){const _=w.substring(0,S);y(_),w=w.substring(S+o.EOL.length),S=w.indexOf(o.EOL)}return w}catch(w){return this._debug(`error processing line. Failed with error ${w}`),""}}_getSpawnFileName(){return m&&this._isCmdFile()?process.env.COMSPEC||"cmd.exe":this.toolPath}_getSpawnArgs(f){if(m&&this._isCmdFile()){let h=`/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;for(const y of this.args)h+=" ",h+=f.windowsVerbatimArguments?y:this._windowsQuoteCmdArg(y);return h+='"',[h]}return this.args}_endsWith(f,h){return f.endsWith(h)}_isCmdFile(){const f=this.toolPath.toUpperCase();return this._endsWith(f,".CMD")||this._endsWith(f,".BAT")}_windowsQuoteCmdArg(f){if(!this._isCmdFile())return this._uvQuoteCmdArg(f);if(!f)return'""';const h=[" "," ","&","(",")","[","]","{","}","^","=",";","!","'","+",",","`","~","|","<",">",'"'];let y=!1;for(const _ of f)if(h.some(b=>b===_)){y=!0;break}if(!y)return f;let w='"',S=!0;for(let _=f.length;_>0;_--)w+=f[_-1],S&&f[_-1]==="\\"?w+="\\":f[_-1]==='"'?(S=!0,w+='"'):S=!1;return w+='"',w.split("").reverse().join("")}_uvQuoteCmdArg(f){if(!f)return'""';if(!f.includes(" ")&&!f.includes(" ")&&!f.includes('"'))return f;if(!f.includes('"')&&!f.includes("\\"))return`"${f}"`;let h='"',y=!0;for(let w=f.length;w>0;w--)h+=f[w-1],y&&f[w-1]==="\\"?h+="\\":f[w-1]==='"'?(y=!0,h+="\\"):y=!1;return h+='"',h.split("").reverse().join("")}_cloneExecOptions(f){f=f||{};const h={cwd:f.cwd||process.cwd(),env:f.env||process.env,silent:f.silent||!1,windowsVerbatimArguments:f.windowsVerbatimArguments||!1,failOnStdErr:f.failOnStdErr||!1,ignoreReturnCode:f.ignoreReturnCode||!1,delay:f.delay||1e4};return h.outStream=f.outStream||process.stdout,h.errStream=f.errStream||process.stderr,h}_getSpawnOptions(f,h){f=f||{};const y={};return y.cwd=f.cwd,y.env=f.env,y.windowsVerbatimArguments=f.windowsVerbatimArguments||this._isCmdFile(),f.windowsVerbatimArguments&&(y.argv0=`"${h}"`),y}exec(){return n(this,void 0,void 0,function*(){return!a.isRooted(this.toolPath)&&(this.toolPath.includes("/")||m&&this.toolPath.includes("\\"))&&(this.toolPath=l.resolve(process.cwd(),this.options.cwd||process.cwd(),this.toolPath)),this.toolPath=yield u.which(this.toolPath,!0),new Promise((f,h)=>n(this,void 0,void 0,function*(){this._debug(`exec tool: ${this.toolPath}`),this._debug("arguments:");for(const O of this.args)this._debug(` ${O}`);const y=this._cloneExecOptions(this.options);!y.silent&&y.outStream&&y.outStream.write(this._getCommandString(y)+o.EOL);const w=new E(y,this.toolPath);if(w.on("debug",O=>{this._debug(O)}),this.options.cwd&&!(yield a.exists(this.options.cwd)))return h(new Error(`The cwd: ${this.options.cwd} does not exist!`));const S=this._getSpawnFileName(),_=i.spawn(S,this._getSpawnArgs(y),this._getSpawnOptions(this.options,S));let b="";_.stdout&&_.stdout.on("data",O=>{this.options.listeners&&this.options.listeners.stdout&&this.options.listeners.stdout(O),!y.silent&&y.outStream&&y.outStream.write(O),b=this._processLineBuffer(O,b,$=>{this.options.listeners&&this.options.listeners.stdline&&this.options.listeners.stdline($)})});let g="";if(_.stderr&&_.stderr.on("data",O=>{w.processStderr=!0,this.options.listeners&&this.options.listeners.stderr&&this.options.listeners.stderr(O),!y.silent&&y.errStream&&y.outStream&&(y.failOnStdErr?y.errStream:y.outStream).write(O),g=this._processLineBuffer(O,g,$=>{this.options.listeners&&this.options.listeners.errline&&this.options.listeners.errline($)})}),_.on("error",O=>{w.processError=O.message,w.processExited=!0,w.processClosed=!0,w.CheckComplete()}),_.on("exit",O=>{w.processExitCode=O,w.processExited=!0,this._debug(`Exit code ${O} received from tool '${this.toolPath}'`),w.CheckComplete()}),_.on("close",O=>{w.processExitCode=O,w.processExited=!0,w.processClosed=!0,this._debug(`STDIO streams have closed for tool '${this.toolPath}'`),w.CheckComplete()}),w.on("done",(O,$)=>{b.length>0&&this.emit("stdline",b),g.length>0&&this.emit("errline",g),_.removeAllListeners(),O?h(O):f($)}),this.options.input){if(!_.stdin)throw new Error("child process missing stdin");_.stdin.end(this.options.input)}}))})}}Be.ToolRunner=p;function v(d){const f=[];let h=!1,y=!1,w="";function S(_){y&&_!=='"'&&(w+="\\"),w+=_,y=!1}for(let _=0;_<d.length;_++){const b=d.charAt(_);if(b==='"'){y?S(b):h=!h;continue}if(b==="\\"&&y){S(b);continue}if(b==="\\"&&h){y=!0;continue}if(b===" "&&!h){w.length>0&&(f.push(w),w="");continue}S(b)}return w.length>0&&f.push(w.trim()),f}Be.argStringToArray=v;class E extends s.EventEmitter{constructor(f,h){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,!h)throw new Error("toolPath must not be empty");this.options=f,this.toolPath=h,f.delay&&(this.delay=f.delay)}CheckComplete(){this.done||(this.processClosed?this._setResult():this.processExited&&(this.timeout=c.setTimeout(E.HandleTimeout,this.delay,this)))}_debug(f){this.emit("debug",f)}_setResult(){let f;this.processExited&&(this.processError?f=new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`):this.processExitCode!==0&&!this.options.ignoreReturnCode?f=new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`):this.processStderr&&this.options.failOnStdErr&&(f=new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`))),this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.done=!0,this.emit("done",f,this.processExitCode)}static HandleTimeout(f){if(!f.done){if(!f.processClosed&&f.processExited){const h=`The STDIO streams did not close within ${f.delay/1e3} seconds of the exit event from process '${f.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;f._debug(h)}f._setResult()}}}return Be}var pu;function Na(){if(pu)return Ve;pu=1;var e=Ve&&Ve.__createBinding||(Object.create?function(u,a,c,m){m===void 0&&(m=c),Object.defineProperty(u,m,{enumerable:!0,get:function(){return a[c]}})}:function(u,a,c,m){m===void 0&&(m=c),u[m]=a[c]}),t=Ve&&Ve.__setModuleDefault||(Object.create?function(u,a){Object.defineProperty(u,"default",{enumerable:!0,value:a})}:function(u,a){u.default=a}),r=Ve&&Ve.__importStar||function(u){if(u&&u.__esModule)return u;var a={};if(u!=null)for(var c in u)c!=="default"&&Object.hasOwnProperty.call(u,c)&&e(a,u,c);return t(a,u),a},n=Ve&&Ve.__awaiter||function(u,a,c,m){function p(v){return v instanceof c?v:new c(function(E){E(v)})}return new(c||(c=Promise))(function(v,E){function d(y){try{h(m.next(y))}catch(w){E(w)}}function f(y){try{h(m.throw(y))}catch(w){E(w)}}function h(y){y.done?v(y.value):p(y.value).then(d,f)}h((m=m.apply(u,a||[])).next())})};Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.getExecOutput=Ve.exec=void 0;const o=Im,s=r(Sy());function i(u,a,c){return n(this,void 0,void 0,function*(){const m=s.argStringToArray(u);if(m.length===0)throw new Error("Parameter 'commandLine' cannot be null or empty.");const p=m[0];return a=m.slice(1).concat(a||[]),new s.ToolRunner(p,a,c).exec()})}Ve.exec=i;function l(u,a,c){var m,p;return n(this,void 0,void 0,function*(){let v="",E="";const d=new o.StringDecoder("utf8"),f=new o.StringDecoder("utf8"),h=(m=c==null?void 0:c.listeners)===null||m===void 0?void 0:m.stdout,y=(p=c==null?void 0:c.listeners)===null||p===void 0?void 0:p.stderr,w=g=>{E+=f.write(g),y&&y(g)},S=g=>{v+=d.write(g),h&&h(g)},_=Object.assign(Object.assign({},c==null?void 0:c.listeners),{stdout:S,stderr:w}),b=yield i(u,a,Object.assign(Object.assign({},c),{listeners:_}));return v+=d.end(),E+=f.end(),{exitCode:b,stdout:v,stderr:E}})}return Ve.getExecOutput=l,Ve}var hu;function by(){return hu||(hu=1,function(e){var t=Qe&&Qe.__createBinding||(Object.create?function(p,v,E,d){d===void 0&&(d=E);var f=Object.getOwnPropertyDescriptor(v,E);(!f||("get"in f?!v.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return v[E]}}),Object.defineProperty(p,d,f)}:function(p,v,E,d){d===void 0&&(d=E),p[d]=v[E]}),r=Qe&&Qe.__setModuleDefault||(Object.create?function(p,v){Object.defineProperty(p,"default",{enumerable:!0,value:v})}:function(p,v){p.default=v}),n=Qe&&Qe.__importStar||function(p){if(p&&p.__esModule)return p;var v={};if(p!=null)for(var E in p)E!=="default"&&Object.prototype.hasOwnProperty.call(p,E)&&t(v,p,E);return r(v,p),v},o=Qe&&Qe.__awaiter||function(p,v,E,d){function f(h){return h instanceof E?h:new E(function(y){y(h)})}return new(E||(E=Promise))(function(h,y){function w(b){try{_(d.next(b))}catch(g){y(g)}}function S(b){try{_(d.throw(b))}catch(g){y(g)}}function _(b){b.done?h(b.value):f(b.value).then(w,S)}_((d=d.apply(p,v||[])).next())})},s=Qe&&Qe.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(e,"__esModule",{value:!0}),e.getDetails=e.isLinux=e.isMacOS=e.isWindows=e.arch=e.platform=void 0;const i=s(le),l=n(Na()),u=()=>o(void 0,void 0,void 0,function*(){const{stdout:p}=yield l.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"',void 0,{silent:!0}),{stdout:v}=yield l.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"',void 0,{silent:!0});return{name:v.trim(),version:p.trim()}}),a=()=>o(void 0,void 0,void 0,function*(){var p,v,E,d;const{stdout:f}=yield l.getExecOutput("sw_vers",void 0,{silent:!0}),h=(v=(p=f.match(/ProductVersion:\s*(.+)/))===null||p===void 0?void 0:p[1])!==null&&v!==void 0?v:"";return{name:(d=(E=f.match(/ProductName:\s*(.+)/))===null||E===void 0?void 0:E[1])!==null&&d!==void 0?d:"",version:h}}),c=()=>o(void 0,void 0,void 0,function*(){const{stdout:p}=yield l.getExecOutput("lsb_release",["-i","-r","-s"],{silent:!0}),[v,E]=p.trim().split(`
|
||
`);return{name:v,version:E}});e.platform=i.default.platform(),e.arch=i.default.arch(),e.isWindows=e.platform==="win32",e.isMacOS=e.platform==="darwin",e.isLinux=e.platform==="linux";function m(){return o(this,void 0,void 0,function*(){return Object.assign(Object.assign({},yield e.isWindows?u():e.isMacOS?a():c()),{platform:e.platform,arch:e.arch,isWindows:e.isWindows,isMacOS:e.isMacOS,isLinux:e.isLinux})})}e.getDetails=m}(Qe)),Qe}var mu;function mr(){return mu||(mu=1,function(e){var t=dt&&dt.__createBinding||(Object.create?function(N,H,X,re){re===void 0&&(re=X);var ue=Object.getOwnPropertyDescriptor(H,X);(!ue||("get"in ue?!H.__esModule:ue.writable||ue.configurable))&&(ue={enumerable:!0,get:function(){return H[X]}}),Object.defineProperty(N,re,ue)}:function(N,H,X,re){re===void 0&&(re=X),N[re]=H[X]}),r=dt&&dt.__setModuleDefault||(Object.create?function(N,H){Object.defineProperty(N,"default",{enumerable:!0,value:H})}:function(N,H){N.default=H}),n=dt&&dt.__importStar||function(N){if(N&&N.__esModule)return N;var H={};if(N!=null)for(var X in N)X!=="default"&&Object.prototype.hasOwnProperty.call(N,X)&&t(H,N,X);return r(H,N),H},o=dt&&dt.__awaiter||function(N,H,X,re){function ue(K){return K instanceof X?K:new X(function(ie){ie(K)})}return new(X||(X=Promise))(function(K,ie){function oe(D){try{k(re.next(D))}catch(L){ie(L)}}function _e(D){try{k(re.throw(D))}catch(L){ie(L)}}function k(D){D.done?K(D.value):ue(D.value).then(oe,_e)}k((re=re.apply(N,H||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.platform=e.toPlatformPath=e.toWin32Path=e.toPosixPath=e.markdownSummary=e.summary=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 s=iy(),i=sy(),l=Ca(),u=n(le),a=n(T),c=_y();var m;(function(N){N[N.Success=0]="Success",N[N.Failure=1]="Failure"})(m||(e.ExitCode=m={}));function p(N,H){const X=(0,l.toCommandValue)(H);if(process.env[N]=X,process.env.GITHUB_ENV||"")return(0,i.issueFileCommand)("ENV",(0,i.prepareKeyValueMessage)(N,H));(0,s.issueCommand)("set-env",{name:N},X)}e.exportVariable=p;function v(N){(0,s.issueCommand)("add-mask",{},N)}e.setSecret=v;function E(N){process.env.GITHUB_PATH||""?(0,i.issueFileCommand)("PATH",N):(0,s.issueCommand)("add-path",{},N),process.env.PATH=`${N}${a.delimiter}${process.env.PATH}`}e.addPath=E;function d(N,H){const X=process.env[`INPUT_${N.replace(/ /g,"_").toUpperCase()}`]||"";if(H&&H.required&&!X)throw new Error(`Input required and not supplied: ${N}`);return H&&H.trimWhitespace===!1?X:X.trim()}e.getInput=d;function f(N,H){const X=d(N,H).split(`
|
||
`).filter(re=>re!=="");return H&&H.trimWhitespace===!1?X:X.map(re=>re.trim())}e.getMultilineInput=f;function h(N,H){const X=["true","True","TRUE"],re=["false","False","FALSE"],ue=d(N,H);if(X.includes(ue))return!0;if(re.includes(ue))return!1;throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${N}
|
||
Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}e.getBooleanInput=h;function y(N,H){if(process.env.GITHUB_OUTPUT||"")return(0,i.issueFileCommand)("OUTPUT",(0,i.prepareKeyValueMessage)(N,H));process.stdout.write(u.EOL),(0,s.issueCommand)("set-output",{name:N},(0,l.toCommandValue)(H))}e.setOutput=y;function w(N){(0,s.issue)("echo",N?"on":"off")}e.setCommandEcho=w;function S(N){process.exitCode=m.Failure,g(N)}e.setFailed=S;function _(){return process.env.RUNNER_DEBUG==="1"}e.isDebug=_;function b(N){(0,s.issueCommand)("debug",{},N)}e.debug=b;function g(N,H={}){(0,s.issueCommand)("error",(0,l.toCommandProperties)(H),N instanceof Error?N.toString():N)}e.error=g;function O(N,H={}){(0,s.issueCommand)("warning",(0,l.toCommandProperties)(H),N instanceof Error?N.toString():N)}e.warning=O;function $(N,H={}){(0,s.issueCommand)("notice",(0,l.toCommandProperties)(H),N instanceof Error?N.toString():N)}e.notice=$;function C(N){process.stdout.write(N+u.EOL)}e.info=C;function G(N){(0,s.issue)("group",N)}e.startGroup=G;function Y(){(0,s.issue)("endgroup")}e.endGroup=Y;function Q(N,H){return o(this,void 0,void 0,function*(){G(N);let X;try{X=yield H()}finally{Y()}return X})}e.group=Q;function A(N,H){if(process.env.GITHUB_STATE||"")return(0,i.issueFileCommand)("STATE",(0,i.prepareKeyValueMessage)(N,H));(0,s.issueCommand)("save-state",{name:N},(0,l.toCommandValue)(H))}e.saveState=A;function x(N){return process.env[`STATE_${N}`]||""}e.getState=x;function F(N){return o(this,void 0,void 0,function*(){return yield c.OidcClient.getIDToken(N)})}e.getIDToken=F;var U=cu();Object.defineProperty(e,"summary",{enumerable:!0,get:function(){return U.summary}});var q=cu();Object.defineProperty(e,"markdownSummary",{enumerable:!0,get:function(){return q.markdownSummary}});var V=Ey();Object.defineProperty(e,"toPosixPath",{enumerable:!0,get:function(){return V.toPosixPath}}),Object.defineProperty(e,"toWin32Path",{enumerable:!0,get:function(){return V.toWin32Path}}),Object.defineProperty(e,"toPlatformPath",{enumerable:!0,get:function(){return V.toPlatformPath}}),e.platform=n(by())}(dt)),dt}var Se=mr();function Sp(e){const t=Se.getInput(e.toLowerCase());if(t!=="false"&&t!=="")return t}var Di={};const Ry=[{name:"Agola CI",constant:"AGOLA",env:"AGOLA_GIT_REF",pr:"AGOLA_PULL_REQUEST_ID"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE",pr:{env:"AC_GIT_PR",ne:"false"}},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN",pr:{env:"CODEBUILD_WEBHOOK_EVENT",any:["PULL_REQUEST_CREATED","PULL_REQUEST_UPDATED","PULL_REQUEST_REOPENED"]}},{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:"Cloudflare Pages",constant:"CLOUDFLARE_PAGES",env:"CF_PAGES"},{name:"Cloudflare Workers",constant:"CLOUDFLARE_WORKERS",env:"WORKERS_CI"},{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"}];var yu;function Oy(){return yu||(yu=1,function(e){const t=Ry,r=process.env;Object.defineProperty(e,"_vendors",{value:t.map(function(s){return s.constant})}),e.name=null,e.isPR=null,e.id=null,t.forEach(function(s){const l=(Array.isArray(s.env)?s.env:[s.env]).every(function(u){return n(u)});e[s.constant]=l,l&&(e.name=s.name,e.isPR=o(s),e.id=s.constant)}),e.isCI=!!(r.CI!=="false"&&(r.BUILD_ID||r.BUILD_NUMBER||r.CI||r.CI_APP_ID||r.CI_BUILD_ID||r.CI_BUILD_NUMBER||r.CI_NAME||r.CONTINUOUS_INTEGRATION||r.RUN_ID||e.name));function n(s){return typeof s=="string"?!!r[s]:"env"in s?r[s.env]&&r[s.env].includes(s.includes):"any"in s?s.any.some(function(i){return!!r[i]}):Object.keys(s).every(function(i){return r[i]===s[i]})}function o(s){switch(typeof s.pr){case"string":return!!r[s.pr];case"object":return"env"in s.pr?"any"in s.pr?s.pr.any.some(function(i){return r[s.pr.env]===i}):s.pr.env in r&&r[s.pr.env]!==s.pr.ne:"any"in s.pr?s.pr.any.some(function(i){return!!r[i]}):n(s.pr);default:return null}}}(Di)),Di}var hn=Oy();const Et=Oe(hn),{GITHUB_ACTIONS:Nn}=Et;function Ae(e){return Nn?Se.error(e):console.log(`\x1B[31m${e}\x1B[0m`)}function $y(e){return console.log(`\x1B[32m${e}\x1B[0m`)}function ve(e){return Nn?Se.warning(e):console.log(`\x1B[33m${e}\x1B[0m`)}function Jt(e){return Nn?Se.notice(e):console.log(`\x1B[94m${e}\x1B[0m`)}function W(e){return Nn?Se.info(e):console.log(e)}var Bt={exports:{}},ki,wu;function Iy(){if(wu)return ki;wu=1,ki=n,n.sync=o;var e=ae;function t(s,i){var l=i.pathExt!==void 0?i.pathExt:process.env.PATHEXT;if(!l||(l=l.split(";"),l.indexOf("")!==-1))return!0;for(var u=0;u<l.length;u++){var a=l[u].toLowerCase();if(a&&s.substr(-a.length).toLowerCase()===a)return!0}return!1}function r(s,i,l){return!s.isSymbolicLink()&&!s.isFile()?!1:t(i,l)}function n(s,i,l){e.stat(s,function(u,a){l(u,u?!1:r(a,s,i))})}function o(s,i){return r(e.statSync(s),s,i)}return ki}var qi,vu;function Py(){if(vu)return qi;vu=1,qi=t,t.sync=r;var e=ae;function t(s,i,l){e.stat(s,function(u,a){l(u,u?!1:n(a,i))})}function r(s,i){return n(e.statSync(s),i)}function n(s,i){return s.isFile()&&o(s,i)}function o(s,i){var l=s.mode,u=s.uid,a=s.gid,c=i.uid!==void 0?i.uid:process.getuid&&process.getuid(),m=i.gid!==void 0?i.gid:process.getgid&&process.getgid(),p=parseInt("100",8),v=parseInt("010",8),E=parseInt("001",8),d=p|v,f=l&E||l&v&&a===m||l&p&&u===c||l&d&&c===0;return f}return qi}var Fi,gu;function Ty(){if(gu)return Fi;gu=1;var e;process.platform==="win32"||et.TESTING_WINDOWS?e=Iy():e=Py(),Fi=t,t.sync=r;function t(n,o,s){if(typeof o=="function"&&(s=o,o={}),!s){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,l){t(n,o||{},function(u,a){u?l(u):i(a)})})}e(n,o||{},function(i,l){i&&(i.code==="EACCES"||o&&o.ignoreErrors)&&(i=null,l=!1),s(i,l)})}function r(n,o){try{return e.sync(n,o||{})}catch(s){if(o&&o.ignoreErrors||s.code==="EACCES")return!1;throw s}}return Fi}var ji,_u;function xy(){if(_u)return ji;_u=1;const e=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",t=T,r=e?";":":",n=Ty(),o=u=>Object.assign(new Error(`not found: ${u}`),{code:"ENOENT"}),s=(u,a)=>{const c=a.colon||r,m=u.match(/\//)||e&&u.match(/\\/)?[""]:[...e?[process.cwd()]:[],...(a.path||process.env.PATH||"").split(c)],p=e?a.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",v=e?p.split(c):[""];return e&&u.indexOf(".")!==-1&&v[0]!==""&&v.unshift(""),{pathEnv:m,pathExt:v,pathExtExe:p}},i=(u,a,c)=>{typeof a=="function"&&(c=a,a={}),a||(a={});const{pathEnv:m,pathExt:p,pathExtExe:v}=s(u,a),E=[],d=h=>new Promise((y,w)=>{if(h===m.length)return a.all&&E.length?y(E):w(o(u));const S=m[h],_=/^".*"$/.test(S)?S.slice(1,-1):S,b=t.join(_,u),g=!_&&/^\.[\\\/]/.test(u)?u.slice(0,2)+b:b;y(f(g,h,0))}),f=(h,y,w)=>new Promise((S,_)=>{if(w===p.length)return S(d(y+1));const b=p[w];n(h+b,{pathExt:v},(g,O)=>{if(!g&&O)if(a.all)E.push(h+b);else return S(h+b);return S(f(h,y,w+1))})});return c?d(0).then(h=>c(null,h),c):d(0)},l=(u,a)=>{a=a||{};const{pathEnv:c,pathExt:m,pathExtExe:p}=s(u,a),v=[];for(let E=0;E<c.length;E++){const d=c[E],f=/^".*"$/.test(d)?d.slice(1,-1):d,h=t.join(f,u),y=!f&&/^\.[\\\/]/.test(u)?u.slice(0,2)+h:h;for(let w=0;w<m.length;w++){const S=y+m[w];try{if(n.sync(S,{pathExt:p}))if(a.all)v.push(S);else return S}catch{}}}if(a.all&&v.length)return v;if(a.nothrow)return null;throw o(u)};return ji=i,i.sync=l,ji}var Hr={exports:{}},Eu;function Cy(){if(Eu)return Hr.exports;Eu=1;const e=(t={})=>{const r=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(r).reverse().find(o=>o.toUpperCase()==="PATH")||"Path"};return Hr.exports=e,Hr.exports.default=e,Hr.exports}var Ui,Su;function Ay(){if(Su)return Ui;Su=1;const e=T,t=xy(),r=Cy();function n(s,i){const l=s.options.env||process.env,u=process.cwd(),a=s.options.cwd!=null,c=a&&process.chdir!==void 0&&!process.chdir.disabled;if(c)try{process.chdir(s.options.cwd)}catch{}let m;try{m=t.sync(s.command,{path:l[r({env:l})],pathExt:i?e.delimiter:void 0})}catch{}finally{c&&process.chdir(u)}return m&&(m=e.resolve(a?s.options.cwd:"",m)),m}function o(s){return n(s)||n(s,!0)}return Ui=o,Ui}var Wr={},bu;function Ny(){if(bu)return Wr;bu=1;const e=/([()\][%!^"`<>&|;, *?])/g;function t(n){return n=n.replace(e,"^$1"),n}function r(n,o){return n=`${n}`,n=n.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),n=n.replace(/(?=(\\+?)?)\1$/,"$1$1"),n=`"${n}"`,n=n.replace(e,"^$1"),o&&(n=n.replace(e,"^$1")),n}return Wr.command=t,Wr.argument=r,Wr}var Mi,Ru;function Ly(){return Ru||(Ru=1,Mi=/^#!(.*)/),Mi}var Gi,Ou;function Dy(){if(Ou)return Gi;Ou=1;const e=Ly();return Gi=(t="")=>{const r=t.match(e);if(!r)return null;const[n,o]=r[0].replace(/#! ?/,"").split(" "),s=n.split("/").pop();return s==="env"?o:o?`${s} ${o}`:s},Gi}var Vi,$u;function ky(){if($u)return Vi;$u=1;const e=ae,t=Dy();function r(n){const s=Buffer.alloc(150);let i;try{i=e.openSync(n,"r"),e.readSync(i,s,0,150,0),e.closeSync(i)}catch{}return t(s.toString())}return Vi=r,Vi}var Bi,Iu;function qy(){if(Iu)return Bi;Iu=1;const e=T,t=Ay(),r=Ny(),n=ky(),o=process.platform==="win32",s=/\.(?:com|exe)$/i,i=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function l(c){c.file=t(c);const m=c.file&&n(c.file);return m?(c.args.unshift(c.file),c.command=m,t(c)):c.file}function u(c){if(!o)return c;const m=l(c),p=!s.test(m);if(c.options.forceShell||p){const v=i.test(m);c.command=e.normalize(c.command),c.command=r.command(c.command),c.args=c.args.map(d=>r.argument(d,v));const E=[c.command].concat(c.args).join(" ");c.args=["/d","/s","/c",`"${E}"`],c.command=process.env.comspec||"cmd.exe",c.options.windowsVerbatimArguments=!0}return c}function a(c,m,p){m&&!Array.isArray(m)&&(p=m,m=null),m=m?m.slice(0):[],p=Object.assign({},p);const v={command:c,args:m,options:p,file:void 0,original:{command:c,args:m}};return p.shell?v:u(v)}return Bi=a,Bi}var zi,Pu;function Fy(){if(Pu)return zi;Pu=1;const e=process.platform==="win32";function t(s,i){return Object.assign(new Error(`${i} ${s.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${i} ${s.command}`,path:s.command,spawnargs:s.args})}function r(s,i){if(!e)return;const l=s.emit;s.emit=function(u,a){if(u==="exit"){const c=n(a,i);if(c)return l.call(s,"error",c)}return l.apply(s,arguments)}}function n(s,i){return e&&s===1&&!i.file?t(i.original,"spawn"):null}function o(s,i){return e&&s===1&&!i.file?t(i.original,"spawnSync"):null}return zi={hookChildProcess:r,verifyENOENT:n,verifyENOENTSync:o,notFoundError:t},zi}var Tu;function jy(){if(Tu)return Bt.exports;Tu=1;const e=Nt,t=qy(),r=Fy();function n(s,i,l){const u=t(s,i,l),a=e.spawn(u.command,u.args,u.options);return r.hookChildProcess(a,u),a}function o(s,i,l){const u=t(s,i,l),a=e.spawnSync(u.command,u.args,u.options);return a.error=a.error||r.verifyENOENTSync(a.status,u),a}return Bt.exports=n,Bt.exports.spawn=n,Bt.exports.sync=o,Bt.exports._parse=t,Bt.exports._enoent=r,Bt.exports}var Uy=jy();const My=Oe(Uy);function Gy(e){const t=typeof e=="string"?`
|
||
`:10,r=typeof e=="string"?"\r":13;return e[e.length-1]===t&&(e=e.slice(0,-1)),e[e.length-1]===r&&(e=e.slice(0,-1)),e}function bp(e={}){const{env:t=process.env,platform:r=process.platform}=e;return r!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"}const Vy=({cwd:e=at.cwd(),path:t=at.env[bp()],preferLocal:r=!0,execPath:n=at.execPath,addExecPath:o=!0}={})=>{const s=e instanceof URL?lt.fileURLToPath(e):e,i=T.resolve(s),l=[];return r&&By(l,i),o&&zy(l,n,i),[...l,t].join(T.delimiter)},By=(e,t)=>{let r;for(;r!==t;)e.push(T.join(t,"node_modules/.bin")),r=t,t=T.resolve(t,"..")},zy=(e,t,r)=>{const n=t instanceof URL?lt.fileURLToPath(t):t;e.push(T.resolve(r,n,".."))},Hy=({env:e=at.env,...t}={})=>{e={...e};const r=bp({env:e});return t.path=e[r],e[r]=Vy(t),e},Wy=(e,t,r,n)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;const o=Object.getOwnPropertyDescriptor(e,r),s=Object.getOwnPropertyDescriptor(t,r);!Xy(o,s)&&n||Object.defineProperty(e,r,s)},Xy=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},Ky=(e,t)=>{const r=Object.getPrototypeOf(t);r!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,r)},Yy=(e,t)=>`/* Wrapped ${e}*/
|
||
${t}`,Jy=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Qy=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Zy=(e,t,r)=>{const n=r===""?"":`with ${r.trim()}() `,o=Yy.bind(null,n,t.toString());Object.defineProperty(o,"name",Qy),Object.defineProperty(e,"toString",{...Jy,value:o})};function ew(e,t,{ignoreNonConfigurable:r=!1}={}){const{name:n}=e;for(const o of Reflect.ownKeys(t))Wy(e,t,o,r);return Ky(e,t),Zy(e,t,n),e}const mn=new WeakMap,Rp=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let r,n=0;const o=e.displayName||e.name||"<anonymous>",s=function(...i){if(mn.set(s,++n),n===1)r=e.apply(this,i),e=null;else if(t.throw===!0)throw new Error(`Function \`${o}\` can only be called once`);return r};return ew(s,e),mn.set(s,n),s};Rp.callCount=e=>{if(!mn.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return mn.get(e)};const tw=()=>{const e=$p-Op+1;return Array.from({length:e},rw)},rw=(e,t)=>({name:`SIGRT${t+1}`,number:Op+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Op=34,$p=64,nw=[{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"}],Ip=()=>{const e=tw();return[...nw,...e].map(iw)},iw=({name:e,number:t,description:r,action:n,forced:o=!1,standard:s})=>{const{signals:{[e]:i}}=le.constants,l=i!==void 0;return{name:e,number:l?i:t,description:r,supported:l,action:n,forced:o,standard:s}},ow=()=>{const e=Ip();return Object.fromEntries(e.map(sw))},sw=({name:e,number:t,description:r,supported:n,action:o,forced:s,standard:i})=>[e,{name:e,number:t,description:r,supported:n,action:o,forced:s,standard:i}],aw=ow(),cw=()=>{const e=Ip(),t=$p+1,r=Array.from({length:t},(n,o)=>uw(o,e));return Object.assign({},...r)},uw=(e,t)=>{const r=lw(e,t);if(r===void 0)return{};const{name:n,description:o,supported:s,action:i,forced:l,standard:u}=r;return{[e]:{name:n,number:e,description:o,supported:s,action:i,forced:l,standard:u}}},lw=(e,t)=>{const r=t.find(({name:n})=>le.constants.signals[n]===e);return r!==void 0?r:t.find(n=>n.number===e)};cw();const fw=({timedOut:e,timeout:t,errorCode:r,signal:n,signalDescription:o,exitCode:s,isCanceled:i})=>e?`timed out after ${t} milliseconds`:i?"was canceled":r!==void 0?`failed with ${r}`:n!==void 0?`was killed with ${n} (${o})`:s!==void 0?`failed with exit code ${s}`:"failed",yn=({stdout:e,stderr:t,all:r,error:n,signal:o,exitCode:s,command:i,escapedCommand:l,timedOut:u,isCanceled:a,killed:c,parsed:{options:{timeout:m,cwd:p=at.cwd()}}})=>{s=s===null?void 0:s,o=o===null?void 0:o;const v=o===void 0?void 0:aw[o].description,E=n&&n.code,f=`Command ${fw({timedOut:u,timeout:m,errorCode:E,signal:o,signalDescription:v,exitCode:s,isCanceled:a})}: ${i}`,h=Object.prototype.toString.call(n)==="[object Error]",y=h?`${f}
|
||
${n.message}`:f,w=[y,t,e].filter(Boolean).join(`
|
||
`);return h?(n.originalMessage=n.message,n.message=w):n=new Error(w),n.shortMessage=y,n.command=i,n.escapedCommand=l,n.exitCode=s,n.signal=o,n.signalDescription=v,n.stdout=e,n.stderr=t,n.cwd=p,r!==void 0&&(n.all=r),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!u,n.isCanceled=a,n.killed=c&&!u,n},nn=["stdin","stdout","stderr"],dw=e=>nn.some(t=>e[t]!==void 0),pw=e=>{if(!e)return;const{stdio:t}=e;if(t===void 0)return nn.map(n=>e[n]);if(dw(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${nn.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return t;if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);const r=Math.max(t.length,nn.length);return Array.from({length:r},(n,o)=>t[o])};var zt={exports:{}},Hi={exports:{}},xu;function hw(){return xu||(xu=1,function(e){e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],process.platform!=="win32"&&e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}(Hi)),Hi.exports}var Cu;function mw(){if(Cu)return zt.exports;Cu=1;var e=et.process;const t=function(f){return f&&typeof f=="object"&&typeof f.removeListener=="function"&&typeof f.emit=="function"&&typeof f.reallyExit=="function"&&typeof f.listeners=="function"&&typeof f.kill=="function"&&typeof f.pid=="number"&&typeof f.on=="function"};if(!t(e))zt.exports=function(){return function(){}};else{var r=kr,n=hw(),o=/^win/i.test(e.platform),s=On;typeof s!="function"&&(s=s.EventEmitter);var i;e.__signal_exit_emitter__?i=e.__signal_exit_emitter__:(i=e.__signal_exit_emitter__=new s,i.count=0,i.emitted={}),i.infinite||(i.setMaxListeners(1/0),i.infinite=!0),zt.exports=function(f,h){if(!t(et.process))return function(){};r.equal(typeof f,"function","a callback must be provided for exit handler"),c===!1&&m();var y="exit";h&&h.alwaysLast&&(y="afterexit");var w=function(){i.removeListener(y,f),i.listeners("exit").length===0&&i.listeners("afterexit").length===0&&l()};return i.on(y,f),w};var l=function(){!c||!t(et.process)||(c=!1,n.forEach(function(h){try{e.removeListener(h,a[h])}catch{}}),e.emit=E,e.reallyExit=p,i.count-=1)};zt.exports.unload=l;var u=function(h,y,w){i.emitted[h]||(i.emitted[h]=!0,i.emit(h,y,w))},a={};n.forEach(function(f){a[f]=function(){if(t(et.process)){var y=e.listeners(f);y.length===i.count&&(l(),u("exit",null,f),u("afterexit",null,f),o&&f==="SIGHUP"&&(f="SIGINT"),e.kill(e.pid,f))}}}),zt.exports.signals=function(){return n};var c=!1,m=function(){c||!t(et.process)||(c=!0,i.count+=1,n=n.filter(function(h){try{return e.on(h,a[h]),!0}catch{return!1}}),e.emit=d,e.reallyExit=v)};zt.exports.load=m;var p=e.reallyExit,v=function(h){t(et.process)&&(e.exitCode=h||0,u("exit",e.exitCode,null),u("afterexit",e.exitCode,null),p.call(e,e.exitCode))},E=e.emit,d=function(h,y){if(h==="exit"&&t(et.process)){y!==void 0&&(e.exitCode=y);var w=E.apply(this,arguments);return u("exit",e.exitCode,null),u("afterexit",e.exitCode,null),w}else return E.apply(this,arguments)}}return zt.exports}var yw=mw();const ww=Oe(yw),vw=1e3*5,gw=(e,t="SIGTERM",r={})=>{const n=e(t);return _w(e,t,r,n),n},_w=(e,t,r,n)=>{if(!Ew(t,r,n))return;const o=bw(r),s=setTimeout(()=>{e("SIGKILL")},o);s.unref&&s.unref()},Ew=(e,{forceKillAfterTimeout:t},r)=>Sw(e)&&t!==!1&&r,Sw=e=>e===le.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",bw=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return vw;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Rw=(e,t)=>{e.kill()&&(t.isCanceled=!0)},Ow=(e,t,r)=>{e.kill(t),r(Object.assign(new Error("Timed out"),{timedOut:!0,signal:t}))},$w=(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{if(t===0||t===void 0)return n;let o;const s=new Promise((l,u)=>{o=setTimeout(()=>{Ow(e,r,u)},t)}),i=n.finally(()=>{clearTimeout(o)});return Promise.race([s,i])},Iw=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},Pw=async(e,{cleanup:t,detached:r},n)=>{if(!t||r)return n;const o=ww(()=>{e.kill()});return n.finally(()=>{o()})};function La(e){return e!==null&&typeof e=="object"&&typeof e.pipe=="function"}function Au(e){return La(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object"}const Tw=e=>e instanceof Nt.ChildProcess&&typeof e.then=="function",Wi=(e,t,r)=>{if(typeof r=="string")return e[t].pipe(ae.createWriteStream(r)),e;if(Au(r))return e[t].pipe(r),e;if(!Tw(r))throw new TypeError("The second argument must be a string, a stream or an Execa child process.");if(!Au(r.stdin))throw new TypeError("The target child process's stdin must be available.");return e[t].pipe(r.stdin),r},xw=e=>{e.stdout!==null&&(e.pipeStdout=Wi.bind(void 0,e,"stdout")),e.stderr!==null&&(e.pipeStderr=Wi.bind(void 0,e,"stderr")),e.all!==void 0&&(e.pipeAll=Wi.bind(void 0,e,"all"))};var sr={exports:{}},Xi,Nu;function Cw(){if(Nu)return Xi;Nu=1;const{PassThrough:e}=qr;return Xi=t=>{t={...t};const{array:r}=t;let{encoding:n}=t;const o=n==="buffer";let s=!1;r?s=!(n||o):n=n||"utf8",o&&(n=null);const i=new e({objectMode:s});n&&i.setEncoding(n);let l=0;const u=[];return i.on("data",a=>{u.push(a),s?l=u.length:l+=a.length}),i.getBufferedValue=()=>r?u:o?Buffer.concat(u,l):u.join(""),i.getBufferedLength=()=>l,i},Xi}var Lu;function Aw(){if(Lu)return sr.exports;Lu=1;const{constants:e}=ap,t=qr,{promisify:r}=pr,n=Cw(),o=r(t.pipeline);class s extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}}async function i(l,u){if(!l)throw new Error("Expected a stream");u={maxBuffer:1/0,...u};const{maxBuffer:a}=u,c=n(u);return await new Promise((m,p)=>{const v=E=>{E&&c.getBufferedLength()<=e.MAX_LENGTH&&(E.bufferedData=c.getBufferedValue()),p(E)};(async()=>{try{await o(l,c),m()}catch(E){v(E)}})(),c.on("data",()=>{c.getBufferedLength()>a&&v(new s)})}),c.getBufferedValue()}return sr.exports=i,sr.exports.buffer=(l,u)=>i(l,{...u,encoding:"buffer"}),sr.exports.array=(l,u)=>i(l,{...u,array:!0}),sr.exports.MaxBufferError=s,sr.exports}var Nw=Aw();const Du=Oe(Nw);var Ki,ku;function Lw(){if(ku)return Ki;ku=1;const{PassThrough:e}=qr;return Ki=function(){var t=[],r=new e({objectMode:!0});return r.setMaxListeners(0),r.add=n,r.isEmpty=o,r.on("unpipe",s),Array.prototype.slice.call(arguments).forEach(n),r;function n(i){return Array.isArray(i)?(i.forEach(n),this):(t.push(i),i.once("end",s.bind(null,i)),i.once("error",r.emit.bind(r,"error")),i.pipe(r,{end:!1}),this)}function o(){return t.length==0}function s(i){t=t.filter(function(l){return l!==i}),!t.length&&r.readable&&r.end()}},Ki}var Dw=Lw();const kw=Oe(Dw),Pp=e=>{if(e!==void 0)throw new TypeError("The `input` and `inputFile` options cannot be both set.")},qw=({input:e,inputFile:t})=>typeof t!="string"?e:(Pp(e),ae.readFileSync(t)),Fw=e=>{const t=qw(e);if(La(t))throw new TypeError("The `input` option cannot be a stream in sync mode");return t},jw=({input:e,inputFile:t})=>typeof t!="string"?e:(Pp(e),ae.createReadStream(t)),Uw=(e,t)=>{const r=jw(t);r!==void 0&&(La(r)?r.pipe(e.stdin):e.stdin.end(r))},Mw=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;const r=kw();return e.stdout&&r.add(e.stdout),e.stderr&&r.add(e.stderr),r},Yi=async(e,t)=>{if(!(!e||t===void 0)){e.destroy();try{return await t}catch(r){return r.bufferedData}}},Ji=(e,{encoding:t,buffer:r,maxBuffer:n})=>{if(!(!e||!r))return t?Du(e,{encoding:t,maxBuffer:n}):Du.buffer(e,{maxBuffer:n})},Gw=async({stdout:e,stderr:t,all:r},{encoding:n,buffer:o,maxBuffer:s},i)=>{const l=Ji(e,{encoding:n,buffer:o,maxBuffer:s}),u=Ji(t,{encoding:n,buffer:o,maxBuffer:s}),a=Ji(r,{encoding:n,buffer:o,maxBuffer:s*2});try{return await Promise.all([i,l,u,a])}catch(c){return Promise.all([{error:c,signal:c.signal,timedOut:c.timedOut},Yi(e,l),Yi(t,u),Yi(r,a)])}},Vw=(async()=>{})().constructor.prototype,Bw=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(Vw,e)]),qu=(e,t)=>{for(const[r,n]of Bw){const o=typeof t=="function"?(...s)=>Reflect.apply(n.value,t(),s):n.value.bind(t);Reflect.defineProperty(e,r,{...n,value:o})}},zw=e=>new Promise((t,r)=>{e.on("exit",(n,o)=>{t({exitCode:n,signal:o})}),e.on("error",n=>{r(n)}),e.stdin&&e.stdin.on("error",n=>{r(n)})}),Tp=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],Hw=/^[\w.-]+$/,Ww=/"/g,Xw=e=>typeof e!="string"||Hw.test(e)?e:`"${e.replace(Ww,'\\"')}"`,xp=(e,t)=>Tp(e,t).join(" "),Cp=(e,t)=>Tp(e,t).map(r=>Xw(r)).join(" "),Kw=/ +/g,Ap=e=>{const t=[];for(const r of e.trim().split(Kw)){const n=t[t.length-1];n&&n.endsWith("\\")?t[t.length-1]=`${n.slice(0,-1)} ${r}`:t.push(r)}return t},Yw=pr.debuglog("execa").enabled,Xr=(e,t)=>String(e).padStart(t,"0"),Jw=()=>{const e=new Date;return`${Xr(e.getHours(),2)}:${Xr(e.getMinutes(),2)}:${Xr(e.getSeconds(),2)}.${Xr(e.getMilliseconds(),3)}`},Np=(e,{verbose:t})=>{t&&at.stderr.write(`[${Jw()}] ${e}
|
||
`)},Qw=1e3*1e3*100,Zw=({env:e,extendEnv:t,preferLocal:r,localDir:n,execPath:o})=>{const s=t?{...at.env,...e}:e;return r?Hy({env:s,cwd:n,execPath:o}):s},Lp=(e,t,r={})=>{const n=My._parse(e,t,r);return e=n.command,t=n.args,r=n.options,r={maxBuffer:Qw,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:r.cwd||at.cwd(),execPath:at.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:Yw,...r},r.env=Zw(r),r.stdio=pw(r),at.platform==="win32"&&T.basename(e,".exe")==="cmd"&&t.unshift("/q"),{file:e,args:t,options:r,parsed:n}},Nr=(e,t,r)=>typeof t!="string"&&!ap.Buffer.isBuffer(t)?r===void 0?void 0:"":e.stripFinalNewline?Gy(t):t;function fe(e,t,r){const n=Lp(e,t,r),o=xp(e,t),s=Cp(e,t);Np(s,n.options),Iw(n.options);let i;try{i=Nt.spawn(n.file,n.args,n.options)}catch(v){const E=new Nt.ChildProcess,d=Promise.reject(yn({error:v,stdout:"",stderr:"",all:"",command:o,escapedCommand:s,parsed:n,timedOut:!1,isCanceled:!1,killed:!1}));return qu(E,d),E}const l=zw(i),u=$w(i,n.options,l),a=Pw(i,n.options,u),c={isCanceled:!1};i.kill=gw.bind(null,i.kill.bind(i)),i.cancel=Rw.bind(null,i,c);const p=Rp(async()=>{const[{error:v,exitCode:E,signal:d,timedOut:f},h,y,w]=await Gw(i,n.options,a),S=Nr(n.options,h),_=Nr(n.options,y),b=Nr(n.options,w);if(v||E!==0||d!==null){const g=yn({error:v,exitCode:E,signal:d,stdout:S,stderr:_,all:b,command:o,escapedCommand:s,parsed:n,timedOut:f,isCanceled:c.isCanceled||(n.options.signal?n.options.signal.aborted:!1),killed:i.killed});if(!n.options.reject)return g;throw g}return{command:o,escapedCommand:s,exitCode:0,stdout:S,stderr:_,all:b,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return Uw(i,n.options),i.all=Mw(i,n.options),xw(i),qu(i,p),i}function ze(e,t,r){const n=Lp(e,t,r),o=xp(e,t),s=Cp(e,t);Np(s,n.options);const i=Fw(n.options);let l;try{l=Nt.spawnSync(n.file,n.args,{...n.options,input:i})}catch(c){throw yn({error:c,stdout:"",stderr:"",all:"",command:o,escapedCommand:s,parsed:n,timedOut:!1,isCanceled:!1,killed:!1})}const u=Nr(n.options,l.stdout,l.error),a=Nr(n.options,l.stderr,l.error);if(l.error||l.status!==0||l.signal!==null){const c=yn({stdout:u,stderr:a,error:l.error,signal:l.signal,exitCode:l.status,command:o,escapedCommand:s,parsed:n,timedOut:l.error&&l.error.code==="ETIMEDOUT",isCanceled:!1,killed:l.signal!==null});if(!n.options.reject)return c;throw c}return{command:o,escapedCommand:s,exitCode:0,stdout:u,stderr:a,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}function ev(e,t){const[r,...n]=Ap(e);return fe(r,n,t)}function tv(e,t){const[r,...n]=Ap(e);return ze(r,n,t)}var mt={},Ht={};const rv=Ar.promises,{access:nv,appendFile:Dp,chmod:Da,chown:iv,copyFile:ov,lchmod:sv,lchown:av,link:cv,lstat:uv,mkdir:lv,mkdtemp:fv,open:dv,readdir:ka,readFile:Qt,readlink:pv,realpath:hv,rename:mv,rmdir:yv,stat:wv,symlink:vv,truncate:gv,unlink:_v,utimes:Ev,writeFile:Lr}=Ar.promises,Sv="rm"in Ar.promises?Ar.promises.rm:pr.promisify(Ar.unlink),bv=Object.freeze(Object.defineProperty({__proto__:null,access:nv,appendFile:Dp,chmod:Da,chown:iv,copyFile:ov,default:rv,lchmod:sv,lchown:av,link:cv,lstat:uv,mkdir:lv,mkdtemp:fv,open:dv,readFile:Qt,readdir:ka,readlink:pv,realpath:hv,rename:mv,rm:Sv,rmdir:yv,stat:wv,symlink:vv,truncate:gv,unlink:_v,utimes:Ev,writeFile:Lr},Symbol.toStringTag,{value:"Module"})),kp=$n(bv);var Fu;function Rv(){if(Fu)return Ht;Fu=1,Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.sync=Ht.isexe=void 0;const e=ae,t=kp,r=async(i,l={})=>{const{ignoreErrors:u=!1}=l;try{return o(await(0,t.stat)(i),l)}catch(a){const c=a;if(u||c.code==="EACCES")return!1;throw c}};Ht.isexe=r;const n=(i,l={})=>{const{ignoreErrors:u=!1}=l;try{return o((0,e.statSync)(i),l)}catch(a){const c=a;if(u||c.code==="EACCES")return!1;throw c}};Ht.sync=n;const o=(i,l)=>i.isFile()&&s(i,l),s=(i,l)=>{var w,S,_,b,g,O,$,C;const u=(S=l.uid)!=null?S:(w=process.getuid)==null?void 0:w.call(process),a=(g=(b=l.groups)!=null?b:(_=process.getgroups)==null?void 0:_.call(process))!=null?g:[],c=(C=($=l.gid)!=null?$:(O=process.getgid)==null?void 0:O.call(process))!=null?C:a[0];if(u===void 0||c===void 0)throw new Error("cannot get uid or gid");const m=new Set([c,...a]),p=i.mode,v=i.uid,E=i.gid,d=parseInt("100",8),f=parseInt("010",8),h=parseInt("001",8),y=d|f;return!!(p&h||p&f&&m.has(E)||p&d&&v===u||p&y&&u===0)};return Ht}var Wt={},ju;function Ov(){if(ju)return Wt;ju=1,Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.sync=Wt.isexe=void 0;const e=ae,t=kp,r=async(i,l={})=>{const{ignoreErrors:u=!1}=l;try{return s(await(0,t.stat)(i),i,l)}catch(a){const c=a;if(u||c.code==="EACCES")return!1;throw c}};Wt.isexe=r;const n=(i,l={})=>{const{ignoreErrors:u=!1}=l;try{return s((0,e.statSync)(i),i,l)}catch(a){const c=a;if(u||c.code==="EACCES")return!1;throw c}};Wt.sync=n;const o=(i,l)=>{const{pathExt:u=process.env.PATHEXT||""}=l,a=u.split(";");if(a.indexOf("")!==-1)return!0;for(let c=0;c<a.length;c++){const m=a[c].toLowerCase(),p=i.substring(i.length-m.length).toLowerCase();if(m&&p===m)return!0}return!1},s=(i,l,u)=>i.isFile()&&o(l,u);return Wt}var Qi={},Uu;function $v(){return Uu||(Uu=1,Object.defineProperty(Qi,"__esModule",{value:!0})),Qi}var Mu;function Iv(){return Mu||(Mu=1,function(e){var t=mt&&mt.__createBinding||(Object.create?function(a,c,m,p){p===void 0&&(p=m);var v=Object.getOwnPropertyDescriptor(c,m);(!v||("get"in v?!c.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return c[m]}}),Object.defineProperty(a,p,v)}:function(a,c,m,p){p===void 0&&(p=m),a[p]=c[m]}),r=mt&&mt.__setModuleDefault||(Object.create?function(a,c){Object.defineProperty(a,"default",{enumerable:!0,value:c})}:function(a,c){a.default=c}),n=mt&&mt.__importStar||function(a){if(a&&a.__esModule)return a;var c={};if(a!=null)for(var m in a)m!=="default"&&Object.prototype.hasOwnProperty.call(a,m)&&t(c,a,m);return r(c,a),c},o=mt&&mt.__exportStar||function(a,c){for(var m in a)m!=="default"&&!Object.prototype.hasOwnProperty.call(c,m)&&t(c,a,m)};Object.defineProperty(e,"__esModule",{value:!0}),e.sync=e.isexe=e.posix=e.win32=void 0;const s=n(Rv());e.posix=s;const i=n(Ov());e.win32=i,o($v(),e);const u=(process.env._ISEXE_TEST_PLATFORM_||process.platform)==="win32"?i:s;e.isexe=u.isexe,e.sync=u.sync}(mt)),mt}var Zi,Gu;function Pv(){if(Gu)return Zi;Gu=1;const{isexe:e,sync:t}=Iv(),{join:r,delimiter:n,sep:o,posix:s}=T,i=process.platform==="win32",l=new RegExp(`[${s.sep}${o===s.sep?"":o}]`.replace(/(\\)/g,"\\$1")),u=new RegExp(`^\\.${l.source}`),a=E=>Object.assign(new Error(`not found: ${E}`),{code:"ENOENT"}),c=(E,{path:d=process.env.PATH,pathExt:f=process.env.PATHEXT,delimiter:h=n})=>{const y=E.match(l)?[""]:[...i?[process.cwd()]:[],...(d||"").split(h)];if(i){const w=f||[".EXE",".CMD",".BAT",".COM"].join(h),S=w.split(h).flatMap(_=>[_,_.toLowerCase()]);return E.includes(".")&&S[0]!==""&&S.unshift(""),{pathEnv:y,pathExt:S,pathExtExe:w}}return{pathEnv:y,pathExt:[""]}},m=(E,d)=>{const f=/^".*"$/.test(E)?E.slice(1,-1):E;return(!f&&u.test(d)?d.slice(0,2):"")+r(f,d)},p=async(E,d={})=>{const{pathEnv:f,pathExt:h,pathExtExe:y}=c(E,d),w=[];for(const S of f){const _=m(S,E);for(const b of h){const g=_+b;if(await e(g,{pathExt:y,ignoreErrors:!0})){if(!d.all)return g;w.push(g)}}}if(d.all&&w.length)return w;if(d.nothrow)return null;throw a(E)},v=(E,d={})=>{const{pathEnv:f,pathExt:h,pathExtExe:y}=c(E,d),w=[];for(const S of f){const _=m(S,E);for(const b of h){const g=_+b;if(t(g,{pathExt:y,ignoreErrors:!0})){if(!d.all)return g;w.push(g)}}}if(d.all&&w.length)return w;if(d.nothrow)return null;throw a(E)};return Zi=p,p.sync=v,Zi}var Tv=Pv();const de=Oe(Tv);let Or;function qp(e,t=["-NoProfile","-NoLogo","-NonInteractive"],r={stdio:"inherit"}){return fe(xv(),[...t,"-c",e],r)}function xv(){if(Or===void 0){const e=de.sync("pwsh",{nothrow:!0});e!==null&&(Or=e);const t=de.sync("powershell",{nothrow:!0});t!==null&&(Or=t)}if(Or===void 0)throw new Error("Could not find powershell");return Or}function yt(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}function Fp(){return de.sync("sudo",{nothrow:!0})!==null}function yr(){var e;return((e=process.getuid)==null?void 0:e.call(process))===0||!!process.env.CI}function wr(){return yr()&&Fp()}function Cv(e){return wr()?`sudo ${e}`:e}function me(e,t=[],r=it){return wr()?tv(jp(e,t),r):ze(e,qa(t),r)}function vt(e,t=[],r=it){return wr()?ev(jp(e,t),r):fe(e,qa(t),r)}function jp(e,t){return`sudo ${qa([e,...t]).join(" ")}`}function qa(e){return e.map(t=>`'${t}'`)}async function Av(){try{return await fe("fltmc"),!0}catch{return!1}}async function Nv(){var e;if(process.platform!=="win32")return!1;try{return await fe("fsutil",["dirty","query",(e=process.env.systemdrive)!=null?e:""]),!0}catch(t){return t.code==="ENOENT"?Av():!1}}function Lv(){return process.platform==="win32"?Up():yr()}async function vr(e){if((process.platform==="linux"||process.platform==="darwin")&&wr()&&process.env.SUDO_USER!==void 0){let t=ae.statSync(e).isDirectory();await vt("chown",[...t?["-R"]:[],process.env.SUDO_USER,e],it)}}var eo,Xt={};yt(Xt,"hasSudo",()=>Fp),yt(Xt,"isRoot",()=>yr),yt(Xt,"isSudo",()=>wr),yt(Xt,"prependSudo",()=>Cv),yt(Xt,"defaultExecOptions",()=>it),yt(Xt,"execRootSync",()=>me),yt(Xt,"execRoot",()=>vt);let it={stdio:"inherit",shell:!0};yt(eo={},"isAdminWindows",()=>Up),yt(eo,"isAdminPosix",()=>Dv),yt(eo,"isAdmin",()=>Lv);let Up=Nv,Dv=yr;yt({},"grantUserWriteAccess",()=>vr);var to,Vu;function kv(){return Vu||(Vu=1,to=function(){}),to}var ro,Bu;function er(){if(Bu)return ro;Bu=1;var e=kv()();return ro=function(t){return t!==e&&t!==null},ro}var no,zu;function Mp(){if(zu)return no;zu=1;var e=er(),t=Array.prototype.forEach,r=Object.create,n=function(o,s){var i;for(i in o)s[i]=o[i]};return no=function(o){var s=r(null);return t.call(arguments,function(i){e(i)&&n(Object(i),s)}),s},no}var io,Hu;function qv(){return Hu||(Hu=1,io=function(){var e=Math.sign;return typeof e!="function"?!1:e(10)===1&&e(-20)===-1}),io}var oo,Wu;function Fv(){return Wu||(Wu=1,oo=function(e){return e=Number(e),isNaN(e)||e===0?e:e>0?1:-1}),oo}var so,Xu;function jv(){return Xu||(Xu=1,so=qv()()?Math.sign:Fv()),so}var ao,Ku;function Uv(){if(Ku)return ao;Ku=1;var e=jv(),t=Math.abs,r=Math.floor;return ao=function(n){return isNaN(n)?0:(n=Number(n),n===0||!isFinite(n)?n:e(n)*r(t(n)))},ao}var co,Yu;function tr(){if(Yu)return co;Yu=1;var e=Uv(),t=Math.max;return co=function(r){return t(0,e(r))},co}var uo,Ju;function Gp(){if(Ju)return uo;Ju=1;var e=tr();return uo=function(t,r,n){var o;return isNaN(t)?(o=r,o>=0?n&&o?o-1:o:1):t===!1?!1:e(t)},uo}var lo,Qu;function jt(){return Qu||(Qu=1,lo=function(e){if(typeof e!="function")throw new TypeError(e+" is not a function");return e}),lo}var fo,Zu;function gr(){if(Zu)return fo;Zu=1;var e=er();return fo=function(t){if(!e(t))throw new TypeError("Cannot use null or undefined");return t},fo}var po,el;function Mv(){if(el)return po;el=1;var e=jt(),t=gr(),r=Function.prototype.bind,n=Function.prototype.call,o=Object.keys,s=Object.prototype.propertyIsEnumerable;return po=function(i,l){return function(u,a){var c,m=arguments[2],p=arguments[3];return u=Object(t(u)),e(a),c=o(u),p&&c.sort(typeof p=="function"?r.call(p,u):void 0),typeof i!="function"&&(i=c[i]),n.call(i,c,function(v,E){return s.call(u,v)?n.call(a,m,u[v],v,u,E):l})}},po}var ho,tl;function Ln(){return tl||(tl=1,ho=Mv()("forEach")),ho}var rl={},nl;function rr(){return nl||(nl=1),rl}var mo={exports:{}},yo,il;function Gv(){return il||(il=1,yo=function(){var e=Object.assign,t;return typeof e!="function"?!1:(t={foo:"raz"},e(t,{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}),yo}var wo,ol;function Vv(){return ol||(ol=1,wo=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),wo}var vo,sl;function Bv(){if(sl)return vo;sl=1;var e=er(),t=Object.keys;return vo=function(r){return t(e(r)?Object(r):r)},vo}var go,al;function zv(){return al||(al=1,go=Vv()()?Object.keys:Bv()),go}var _o,cl;function Hv(){if(cl)return _o;cl=1;var e=zv(),t=gr(),r=Math.max;return _o=function(n,o){var s,i,l=r(arguments.length,2),u;for(n=Object(t(n)),u=function(a){try{n[a]=o[a]}catch(c){s||(s=c)}},i=1;i<l;++i)o=arguments[i],e(o).forEach(u);if(s!==void 0)throw s;return n},_o}var Eo,ul;function Vp(){return ul||(ul=1,Eo=Gv()()?Object.assign:Hv()),Eo}var So,ll;function Wv(){if(ll)return So;ll=1;var e=er(),t={function:!0,object:!0};return So=function(r){return e(r)&&t[typeof r]||!1},So}var fl;function Xv(){return fl||(fl=1,function(e){var t=Vp(),r=Wv(),n=er(),o=Error.captureStackTrace;e.exports=function(s){var i=new Error(s),l=arguments[1],u=arguments[2];return n(u)||r(l)&&(u=l,l=null),n(u)&&t(i,u),n(l)&&(i.code=l),o&&o(i,e.exports),i}}(mo)),mo.exports}var Kr={exports:{}},bo,dl;function Bp(){if(dl)return bo;dl=1;var e=gr(),t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,o=Object.getOwnPropertySymbols;return bo=function(s,i){var l,u=Object(e(i));if(s=Object(e(s)),n(u).forEach(function(a){try{t(s,a,r(i,a))}catch(c){l=c}}),typeof o=="function"&&o(u).forEach(function(a){try{t(s,a,r(i,a))}catch(c){l=c}}),l!==void 0)throw l;return s},bo}var pl;function zp(){if(pl)return Kr.exports;pl=1;var e=tr(),t=function(i,l){return l},r,n,o,s;try{Object.defineProperty(t,"length",{configurable:!0,writable:!1,enumerable:!1,value:1})}catch{}return t.length===1?(r={configurable:!0,writable:!1,enumerable:!1},n=Object.defineProperty,Kr.exports=function(i,l){return l=e(l),i.length===l?i:(r.value=l,n(i,"length",r))}):(s=Bp(),o=function(){var i=[];return function(l){var u,a=0;if(i[l])return i[l];for(u=[];l--;)u.push("a"+(++a).toString(36));return new Function("fn","return function ("+u.join(", ")+") { return fn.apply(this, arguments); };")}}(),Kr.exports=function(i,l){var u;if(l=e(l),i.length===l)return i;u=o(l)(i);try{s(u,i)}catch{}return u}),Kr.exports}var Ro={exports:{}},Oo,hl;function Hp(){if(hl)return Oo;hl=1;var e=void 0;return Oo=function(t){return t!==e&&t!==null},Oo}var $o,ml;function Kv(){if(ml)return $o;ml=1;var e=Hp(),t={object:!0,function:!0,undefined:!0};return $o=function(r){return e(r)?hasOwnProperty.call(t,typeof r):!1},$o}var Io,yl;function Yv(){if(yl)return Io;yl=1;var e=Kv();return Io=function(t){if(!e(t))return!1;try{return t.constructor?t.constructor.prototype===t:!1}catch{return!1}},Io}var Po,wl;function Jv(){if(wl)return Po;wl=1;var e=Yv();return Po=function(t){if(typeof t!="function"||!hasOwnProperty.call(t,"length"))return!1;try{if(typeof t.length!="number"||typeof t.call!="function"||typeof t.apply!="function")return!1}catch{return!1}return!e(t)},Po}var To,vl;function Qv(){if(vl)return To;vl=1;var e=Jv(),t=/^\s*class[\s{/}]/,r=Function.prototype.toString;return To=function(n){return!(!e(n)||t.test(r.call(n)))},To}var xo,gl;function Zv(){if(gl)return xo;gl=1;var e="razdwatrzy";return xo=function(){return typeof e.contains!="function"?!1:e.contains("dwa")===!0&&e.contains("foo")===!1},xo}var Co,_l;function eg(){if(_l)return Co;_l=1;var e=String.prototype.indexOf;return Co=function(t){return e.call(this,t,arguments[1])>-1},Co}var Ao,El;function tg(){return El||(El=1,Ao=Zv()()?String.prototype.contains:eg()),Ao}var Sl;function nr(){if(Sl)return Ro.exports;Sl=1;var e=Hp(),t=Qv(),r=Vp(),n=Mp(),o=tg(),s=Ro.exports=function(i,l){var u,a,c,m,p;return arguments.length<2||typeof i!="string"?(m=l,l=i,i=null):m=arguments[2],e(i)?(u=o.call(i,"c"),a=o.call(i,"e"),c=o.call(i,"w")):(u=c=!0,a=!1),p={value:l,configurable:u,enumerable:a,writable:c},m?r(n(m),p):p};return s.gs=function(i,l,u){var a,c,m,p;return typeof i!="string"?(m=u,u=l,l=i,i=null):m=arguments[3],e(l)?t(l)?e(u)?t(u)||(m=u,u=void 0):u=void 0:(m=l,l=u=void 0):l=void 0,e(i)?(a=o.call(i,"c"),c=o.call(i,"e")):(a=!0,c=!1),p={get:l,set:u,configurable:a,enumerable:c},m?r(n(m),p):p},Ro.exports}var Yr={exports:{}},bl;function rg(){return bl||(bl=1,function(e,t){var r=nr(),n=jt(),o=Function.prototype.apply,s=Function.prototype.call,i=Object.create,l=Object.defineProperty,u=Object.defineProperties,a=Object.prototype.hasOwnProperty,c={configurable:!0,enumerable:!1,writable:!0},m,p,v,E,d,f,h;m=function(y,w){var S;return n(w),a.call(this,"__ee__")?S=this.__ee__:(S=c.value=i(null),l(this,"__ee__",c),c.value=null),S[y]?typeof S[y]=="object"?S[y].push(w):S[y]=[S[y],w]:S[y]=w,this},p=function(y,w){var S,_;return n(w),_=this,m.call(this,y,S=function(){v.call(_,y,S),o.call(w,this,arguments)}),S.__eeOnceListener__=w,this},v=function(y,w){var S,_,b,g;if(n(w),!a.call(this,"__ee__"))return this;if(S=this.__ee__,!S[y])return this;if(_=S[y],typeof _=="object")for(g=0;b=_[g];++g)(b===w||b.__eeOnceListener__===w)&&(_.length===2?S[y]=_[g?0:1]:_.splice(g,1));else(_===w||_.__eeOnceListener__===w)&&delete S[y];return this},E=function(y){var w,S,_,b,g;if(a.call(this,"__ee__")&&(b=this.__ee__[y],!!b))if(typeof b=="object"){for(S=arguments.length,g=new Array(S-1),w=1;w<S;++w)g[w-1]=arguments[w];for(b=b.slice(),w=0;_=b[w];++w)o.call(_,this,g)}else switch(arguments.length){case 1:s.call(b,this);break;case 2:s.call(b,this,arguments[1]);break;case 3:s.call(b,this,arguments[1],arguments[2]);break;default:for(S=arguments.length,g=new Array(S-1),w=1;w<S;++w)g[w-1]=arguments[w];o.call(b,this,g)}},d={on:m,once:p,off:v,emit:E},f={on:r(m),once:r(p),off:r(v),emit:r(E)},h=u({},f),e.exports=t=function(y){return y==null?i(h):u(Object(y),f)},t.methods=d}(Yr,Yr.exports)),Yr.exports}var No,Rl;function ng(){return Rl||(Rl=1,No=function(){var e=Array.from,t,r;return typeof e!="function"?!1:(t=["raz","dwa"],r=e(t),!!(r&&r!==t&&r[1]==="dwa"))}),No}var Lo,Ol;function ig(){return Ol||(Ol=1,Lo=function(){return typeof globalThis!="object"||!globalThis?!1:globalThis.Array===Array}),Lo}var Do,$l;function og(){if($l)return Do;$l=1;var e=function(){if(typeof self=="object"&&self)return self;if(typeof window=="object"&&window)return window;throw new Error("Unable to resolve global `this`")};return Do=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return e()}try{return __global__||e()}finally{delete Object.prototype.__global__}}(),Do}var ko,Il;function Dn(){return Il||(Il=1,ko=ig()()?globalThis:og()),ko}var qo,Pl;function sg(){if(Pl)return qo;Pl=1;var e=Dn(),t={object:!0,symbol:!0};return qo=function(){var r=e.Symbol,n;if(typeof r!="function")return!1;n=r("test symbol");try{String(n)}catch{return!1}return!(!t[typeof r.iterator]||!t[typeof r.toPrimitive]||!t[typeof r.toStringTag])},qo}var Fo,Tl;function ag(){return Tl||(Tl=1,Fo=function(e){return e?typeof e=="symbol"?!0:!e.constructor||e.constructor.name!=="Symbol"?!1:e[e.constructor.toStringTag]==="Symbol":!1}),Fo}var jo,xl;function Wp(){if(xl)return jo;xl=1;var e=ag();return jo=function(t){if(!e(t))throw new TypeError(t+" is not a symbol");return t},jo}var Uo,Cl;function cg(){if(Cl)return Uo;Cl=1;var e=nr(),t=Object.create,r=Object.defineProperty,n=Object.prototype,o=t(null);return Uo=function(s){for(var i=0,l,u;o[s+(i||"")];)++i;return s+=i||"",o[s]=!0,l="@@"+s,r(n,l,e.gs(null,function(a){u||(u=!0,r(this,l,e(a)),u=!1)})),l},Uo}var Mo,Al;function ug(){if(Al)return Mo;Al=1;var e=nr(),t=Dn().Symbol;return Mo=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"))})},Mo}var Go,Nl;function lg(){if(Nl)return Go;Nl=1;var e=nr(),t=Wp(),r=Object.create(null);return Go=function(n){return Object.defineProperties(n,{for:e(function(o){return r[o]?r[o]:r[o]=n(String(o))}),keyFor:e(function(o){var s;t(o);for(s in r)if(r[s]===o)return s})})},Go}var Vo,Ll;function fg(){if(Ll)return Vo;Ll=1;var e=nr(),t=Wp(),r=Dn().Symbol,n=cg(),o=ug(),s=lg(),i=Object.create,l=Object.defineProperties,u=Object.defineProperty,a,c,m;if(typeof r=="function")try{String(r()),m=!0}catch{}else r=null;return c=function(v){if(this instanceof c)throw new TypeError("Symbol is not a constructor");return a(v)},Vo=a=function p(v){var E;if(this instanceof p)throw new TypeError("Symbol is not a constructor");return m?r(v):(E=i(c.prototype),v=v===void 0?"":String(v),l(E,{__description__:e("",v),__name__:e("",n(v))}))},o(a),s(a),l(c.prototype,{constructor:e(a),toString:e("",function(){return this.__name__})}),l(a.prototype,{toString:e(function(){return"Symbol ("+t(this).__description__+")"}),valueOf:e(function(){return t(this)})}),u(a.prototype,a.toPrimitive,e("",function(){var p=t(this);return typeof p=="symbol"?p:p.toString()})),u(a.prototype,a.toStringTag,e("c","Symbol")),u(c.prototype,a.toStringTag,e("c",a.prototype[a.toStringTag])),u(c.prototype,a.toPrimitive,e("c",a.prototype[a.toPrimitive])),Vo}var Bo,Dl;function dg(){return Dl||(Dl=1,Bo=sg()()?Dn().Symbol:fg()),Bo}var zo,kl;function pg(){if(kl)return zo;kl=1;var e=Object.prototype.toString,t=e.call(function(){return arguments}());return zo=function(r){return e.call(r)===t},zo}var Ho,ql;function hg(){if(ql)return Ho;ql=1;var e=Object.prototype.toString,t=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);return Ho=function(r){return typeof r=="function"&&t(e.call(r))},Ho}var Wo,Fl;function mg(){if(Fl)return Wo;Fl=1;var e=Object.prototype.toString,t=e.call("");return Wo=function(r){return typeof r=="string"||r&&typeof r=="object"&&(r instanceof String||e.call(r)===t)||!1},Wo}var Xo,jl;function yg(){if(jl)return Xo;jl=1;var e=dg().iterator,t=pg(),r=hg(),n=tr(),o=jt(),s=gr(),i=er(),l=mg(),u=Array.isArray,a=Function.prototype.call,c={configurable:!0,enumerable:!0,writable:!0,value:null},m=Object.defineProperty;return Xo=function(p){var v=arguments[1],E=arguments[2],d,f,h,y,w,S,_,b,g,O;if(p=Object(s(p)),i(v)&&o(v),!this||this===Array||!r(this)){if(!v){if(t(p))return w=p.length,w!==1?Array.apply(null,p):(y=new Array(1),y[0]=p[0],y);if(u(p)){for(y=new Array(w=p.length),f=0;f<w;++f)y[f]=p[f];return y}}y=[]}else d=this;if(!u(p)){if((g=p[e])!==void 0){for(_=o(g).call(p),d&&(y=new d),b=_.next(),f=0;!b.done;)O=v?a.call(v,E,b.value,f):b.value,d?(c.value=O,m(y,f,c)):y[f]=O,b=_.next(),++f;w=f}else if(l(p)){for(w=p.length,d&&(y=new d),f=0,h=0;f<w;++f)O=p[f],f+1<w&&(S=O.charCodeAt(0),S>=55296&&S<=56319&&(O+=p[++f])),O=v?a.call(v,E,O,h):O,d?(c.value=O,m(y,h,c)):y[h]=O,++h;w=h}}if(w===void 0)for(w=n(p.length),d&&(y=new d(w)),f=0;f<w;++f)O=v?a.call(v,E,p[f],f):p[f],d?(c.value=O,m(y,f,c)):y[f]=O;return d&&(c.value=null,y.length=w),y},Xo}var Ko,Ul;function Fa(){return Ul||(Ul=1,Ko=ng()()?Array.from:yg()),Ko}var Yo,Ml;function wg(){if(Ml)return Yo;Ml=1;var e=Fa(),t=Array.isArray;return Yo=function(r){return t(r)?r:e(r)},Yo}var Jo,Gl;function vg(){if(Gl)return Jo;Gl=1;var e=wg(),t=er(),r=jt(),n=Array.prototype.slice,o;return o=function(s){return this.map(function(i,l){return i?i(s[l]):s[l]}).concat(n.call(s,this.length))},Jo=function(s){return s=e(s),s.forEach(function(i){t(i)&&r(i)}),o.bind(s)},Jo}var Qo,Vl;function gg(){if(Vl)return Qo;Vl=1;var e=jt();return Qo=function(t){var r;return typeof t=="function"?{set:t,get:t}:(r={get:e(t.get)},t.set!==void 0?(r.set=e(t.set),t.delete&&(r.delete=e(t.delete)),t.clear&&(r.clear=e(t.clear)),r):(r.set=r.get,r))},Qo}var Zo,Bl;function _g(){if(Bl)return Zo;Bl=1;var e=Xv(),t=zp(),r=nr(),n=rg().methods,o=vg(),s=gg(),i=Function.prototype.apply,l=Function.prototype.call,u=Object.create,a=Object.defineProperties,c=n.on,m=n.emit;return Zo=function(p,v,E){var d=u(null),f,h,y,w,S,_,b,g,O,$,C,G,Y,Q,A;return v!==!1?h=v:isNaN(p.length)?h=1:h=p.length,E.normalizer&&($=s(E.normalizer),y=$.get,w=$.set,S=$.delete,_=$.clear),E.resolvers!=null&&(A=o(E.resolvers)),y?Q=t(function(x){var F,U,q=arguments;if(A&&(q=A(q)),F=y(q),F!==null&&hasOwnProperty.call(d,F))return C&&f.emit("get",F,q,this),d[F];if(q.length===1?U=l.call(p,this,q[0]):U=i.call(p,this,q),F===null){if(F=y(q),F!==null)throw e("Circular invocation","CIRCULAR_INVOCATION");F=w(q)}else if(hasOwnProperty.call(d,F))throw e("Circular invocation","CIRCULAR_INVOCATION");return d[F]=U,G&&f.emit("set",F,null,U),U},h):v===0?Q=function(){var x;if(hasOwnProperty.call(d,"data"))return C&&f.emit("get","data",arguments,this),d.data;if(arguments.length?x=i.call(p,this,arguments):x=l.call(p,this),hasOwnProperty.call(d,"data"))throw e("Circular invocation","CIRCULAR_INVOCATION");return d.data=x,G&&f.emit("set","data",null,x),x}:Q=function(x){var F,U=arguments,q;if(A&&(U=A(arguments)),q=String(U[0]),hasOwnProperty.call(d,q))return C&&f.emit("get",q,U,this),d[q];if(U.length===1?F=l.call(p,this,U[0]):F=i.call(p,this,U),hasOwnProperty.call(d,q))throw e("Circular invocation","CIRCULAR_INVOCATION");return d[q]=F,G&&f.emit("set",q,null,F),F},f={original:p,memoized:Q,profileName:E.profileName,get:function(x){return A&&(x=A(x)),y?y(x):String(x[0])},has:function(x){return hasOwnProperty.call(d,x)},delete:function(x){var F;hasOwnProperty.call(d,x)&&(S&&S(x),F=d[x],delete d[x],Y&&f.emit("delete",x,F))},clear:function(){var x=d;_&&_(),d=u(null),f.emit("clear",x)},on:function(x,F){return x==="get"?C=!0:x==="set"?G=!0:x==="delete"&&(Y=!0),c.call(this,x,F)},emit:m,updateEnv:function(){p=f.original}},y?b=t(function(x){var F,U=arguments;A&&(U=A(U)),F=y(U),F!==null&&f.delete(F)},h):v===0?b=function(){return f.delete("data")}:b=function(x){return A&&(x=A(arguments)[0]),f.delete(x)},g=t(function(){var x,F=arguments;return v===0?d.data:(A&&(F=A(F)),y?x=y(F):x=String(F[0]),d[x])}),O=t(function(){var x,F=arguments;return v===0?f.has("data"):(A&&(F=A(F)),y?x=y(F):x=String(F[0]),x===null?!1:f.has(x))}),a(Q,{__memoized__:r(!0),delete:r(b),clear:r(f.clear),_get:r(g),_has:r(O)}),f},Zo}var es,zl;function Eg(){if(zl)return es;zl=1;var e=jt(),t=Ln(),r=rr(),n=_g(),o=Gp();return es=function s(i){var l,u,a;if(e(i),l=Object(arguments[1]),l.async&&l.promise)throw new Error("Options 'async' and 'promise' cannot be used together");return hasOwnProperty.call(i,"__memoized__")&&!l.force?i:(u=o(l.length,i.length,l.async&&r.async),a=n(i,u,l),t(r,function(c,m){l[m]&&c(l[m],a,l)}),s.__profiler__&&s.__profiler__(a),a.updateEnv(),a.memoized)},es}var ts,Hl;function Sg(){return Hl||(Hl=1,ts=function(e){var t,r,n=e.length;if(!n)return"";for(t=String(e[r=0]);--n;)t+=""+e[++r];return t}),ts}var rs,Wl;function bg(){return Wl||(Wl=1,rs=function(e){return e?function(t){for(var r=String(t[0]),n=0,o=e;--o;)r+=""+t[++n];return r}:function(){return""}}),rs}var ns,Xl;function Rg(){return Xl||(Xl=1,ns=function(){var e=Number.isNaN;return typeof e!="function"?!1:!e({})&&e(NaN)&&!e(34)}),ns}var is,Kl;function Og(){return Kl||(Kl=1,is=function(e){return e!==e}),is}var os,Yl;function $g(){return Yl||(Yl=1,os=Rg()()?Number.isNaN:Og()),os}var ss,Jl;function ja(){if(Jl)return ss;Jl=1;var e=$g(),t=tr(),r=gr(),n=Array.prototype.indexOf,o=Object.prototype.hasOwnProperty,s=Math.abs,i=Math.floor;return ss=function(l){var u,a,c,m;if(!e(l))return n.apply(this,arguments);for(a=t(r(this).length),c=arguments[1],isNaN(c)?c=0:c>=0?c=i(c):c=t(this.length)-i(s(c)),u=c;u<a;++u)if(o.call(this,u)&&(m=this[u],e(m)))return u;return-1},ss}var as,Ql;function Ig(){if(Ql)return as;Ql=1;var e=ja(),t=Object.create;return as=function(){var r=0,n=[],o=t(null);return{get:function(s){var i=0,l=n,u,a=s.length;if(a===0)return l[a]||null;if(l=l[a]){for(;i<a-1;){if(u=e.call(l[0],s[i]),u===-1)return null;l=l[1][u],++i}return u=e.call(l[0],s[i]),u===-1?null:l[1][u]||null}return null},set:function(s){var i=0,l=n,u,a=s.length;if(a===0)l[a]=++r;else{for(l[a]||(l[a]=[[],[]]),l=l[a];i<a-1;)u=e.call(l[0],s[i]),u===-1&&(u=l[0].push(s[i])-1,l[1].push([[],[]])),l=l[1][u],++i;u=e.call(l[0],s[i]),u===-1&&(u=l[0].push(s[i])-1),l[1][u]=++r}return o[r]=s,r},delete:function(s){var i=0,l=n,u,a=o[s],c=a.length,m=[];if(c===0)delete l[c];else if(l=l[c]){for(;i<c-1;){if(u=e.call(l[0],a[i]),u===-1)return;m.push(l,u),l=l[1][u],++i}if(u=e.call(l[0],a[i]),u===-1)return;for(s=l[1][u],l[0].splice(u,1),l[1].splice(u,1);!l[0].length&&m.length;)u=m.pop(),l=m.pop(),l[0].splice(u,1),l[1].splice(u,1)}delete o[s]},clear:function(){n=[],o=t(null)}}},as}var cs,Zl;function Pg(){if(Zl)return cs;Zl=1;var e=ja();return cs=function(){var t=0,r=[],n=[];return{get:function(o){var s=e.call(r,o[0]);return s===-1?null:n[s]},set:function(o){return r.push(o[0]),n.push(++t),t},delete:function(o){var s=e.call(n,o);s!==-1&&(r.splice(s,1),n.splice(s,1))},clear:function(){r=[],n=[]}}},cs}var us,ef;function Tg(){if(ef)return us;ef=1;var e=ja(),t=Object.create;return us=function(r){var n=0,o=[[],[]],s=t(null);return{get:function(i){for(var l=0,u=o,a;l<r-1;){if(a=e.call(u[0],i[l]),a===-1)return null;u=u[1][a],++l}return a=e.call(u[0],i[l]),a===-1?null:u[1][a]||null},set:function(i){for(var l=0,u=o,a;l<r-1;)a=e.call(u[0],i[l]),a===-1&&(a=u[0].push(i[l])-1,u[1].push([[],[]])),u=u[1][a],++l;return a=e.call(u[0],i[l]),a===-1&&(a=u[0].push(i[l])-1),u[1][a]=++n,s[n]=i,n},delete:function(i){for(var l=0,u=o,a,c=[],m=s[i];l<r-1;){if(a=e.call(u[0],m[l]),a===-1)return;c.push(u,a),u=u[1][a],++l}if(a=e.call(u[0],m[l]),a!==-1){for(i=u[1][a],u[0].splice(a,1),u[1].splice(a,1);!u[0].length&&c.length;)a=c.pop(),u=c.pop(),u[0].splice(a,1),u[1].splice(a,1);delete s[i]}},clear:function(){o=[[],[]],s=t(null)}}},us}var tf={},ls,rf;function Xp(){if(rf)return ls;rf=1;var e=jt(),t=Ln(),r=Function.prototype.call;return ls=function(n,o){var s={},i=arguments[2];return e(o),t(n,function(l,u,a,c){s[u]=r.call(o,i,l,u,a,c)}),s},ls}var fs,nf;function Ua(){if(nf)return fs;nf=1;var e=function(r){if(typeof r!="function")throw new TypeError(r+" is not a function");return r},t=function(r){var n=document.createTextNode(""),o,s,i=0;return new r(function(){var l;if(o)s&&(o=s.concat(o));else{if(!s)return;o=s}if(s=o,o=null,typeof s=="function"){l=s,s=null,l();return}for(n.data=i=++i%2;s;)l=s.shift(),s.length||(s=null),l()}).observe(n,{characterData:!0}),function(l){if(e(l),o){typeof o=="function"?o=[o,l]:o.push(l);return}o=l,n.data=i=++i%2}};return fs=function(){if(typeof process=="object"&&process&&typeof process.nextTick=="function")return process.nextTick;if(typeof queueMicrotask=="function")return function(r){queueMicrotask(e(r))};if(typeof document=="object"&&document){if(typeof MutationObserver=="function")return t(MutationObserver);if(typeof WebKitMutationObserver=="function")return t(WebKitMutationObserver)}return typeof setImmediate=="function"?function(r){setImmediate(e(r))}:typeof setTimeout=="function"||typeof setTimeout=="object"?function(r){setTimeout(e(r),0)}:null}(),fs}var of;function xg(){if(of)return tf;of=1;var e=Fa(),t=Xp(),r=Bp(),n=zp(),o=Ua(),s=Array.prototype.slice,i=Function.prototype.apply,l=Object.create;return rr().async=function(u,a){var c=l(null),m=l(null),p=a.memoized,v=a.original,E,d,f;a.memoized=n(function(h){var y=arguments,w=y[y.length-1];return typeof w=="function"&&(E=w,y=s.call(y,0,-1)),p.apply(d=this,f=y)},p);try{r(a.memoized,p)}catch{}a.on("get",function(h){var y,w,S;if(E){if(c[h]){typeof c[h]=="function"?c[h]=[c[h],E]:c[h].push(E),E=null;return}y=E,w=d,S=f,E=d=f=null,o(function(){var _;hasOwnProperty.call(m,h)?(_=m[h],a.emit("getasync",h,S,w),i.call(y,_.context,_.args)):(E=y,d=w,f=S,p.apply(w,S))})}}),a.original=function(){var h,y,w,S;return E?(h=e(arguments),y=function _(b){var g,O,$=_.id;if($==null){o(i.bind(_,this,arguments));return}if(delete _.id,g=c[$],delete c[$],!!g)return O=e(arguments),a.has($)&&(b?a.delete($):(m[$]={context:this,args:O},a.emit("setasync",$,typeof g=="function"?1:g.length))),typeof g=="function"?S=i.call(g,this,O):g.forEach(function(C){S=i.call(C,this,O)},this),S},w=E,E=d=f=null,h.push(y),S=i.call(v,this,h),y.cb=w,E=y,S):i.call(v,this,arguments)},a.on("set",function(h){if(!E){a.delete(h);return}c[h]?typeof c[h]=="function"?c[h]=[c[h],E.cb]:c[h].push(E.cb):c[h]=E.cb,delete E.cb,E.id=h,E=null}),a.on("delete",function(h){var y;hasOwnProperty.call(c,h)||m[h]&&(y=m[h],delete m[h],a.emit("deleteasync",h,s.call(y.args,1)))}),a.on("clear",function(){var h=m;m=l(null),a.emit("clearasync",t(h,function(y){return s.call(y.args,1)}))})},tf}var sf={},ds,af;function Cg(){if(af)return ds;af=1;var e=Array.prototype.forEach,t=Object.create;return ds=function(r){var n=t(null);return e.call(arguments,function(o){n[o]=!0}),n},ds}var ps,cf;function Kp(){return cf||(cf=1,ps=function(e){return typeof e=="function"}),ps}var hs,uf;function Ag(){if(uf)return hs;uf=1;var e=Kp();return hs=function(t){try{return t&&e(t.toString)?t.toString():String(t)}catch{throw new TypeError("Passed argument cannot be stringifed")}},hs}var ms,lf;function Ng(){if(lf)return ms;lf=1;var e=gr(),t=Ag();return ms=function(r){return t(e(r))},ms}var ys,ff;function Lg(){if(ff)return ys;ff=1;var e=Kp();return ys=function(t){try{return t&&e(t.toString)?t.toString():String(t)}catch{return"<Non-coercible to string value>"}},ys}var ws,df;function Dg(){if(df)return ws;df=1;var e=Lg(),t=/[\n\r\u2028\u2029]/g;return ws=function(r){var n=e(r);return n.length>100&&(n=n.slice(0,99)+"…"),n=n.replace(t,function(o){return JSON.stringify(o).slice(1,-1)}),n},ws}var Jr={exports:{}},pf;function Yp(){if(pf)return Jr.exports;pf=1,Jr.exports=e,Jr.exports.default=e;function e(t){return!!t&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"}return Jr.exports}var hf;function kg(){if(hf)return sf;hf=1;var e=Xp(),t=Cg(),r=Ng(),n=Dg(),o=Yp(),s=Ua(),i=Object.create,l=t("then","then:finally","done","done:finally");return rr().promise=function(u,a){var c=i(null),m=i(null),p=i(null);if(u===!0)u=null;else if(u=r(u),!l[u])throw new TypeError("'"+n(u)+"' is not valid promise mode");a.on("set",function(v,E,d){var f=!1;if(!o(d)){m[v]=d,a.emit("setasync",v,1);return}c[v]=1,p[v]=d;var h=function(_){var b=c[v];if(f)throw new Error(`Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in 'done:finally' mode)
|
||
Consider to rely on 'then' or 'done' mode instead.`);b&&(delete c[v],m[v]=_,a.emit("setasync",v,b))},y=function(){f=!0,c[v]&&(delete c[v],delete p[v],a.delete(v))},w=u;if(w||(w="then"),w==="then"){var S=function(){s(y)};d=d.then(function(_){s(h.bind(this,_))},S),typeof d.finally=="function"&&d.finally(S)}else if(w==="done"){if(typeof d.done!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done' mode");d.done(h,y)}else if(w==="done:finally"){if(typeof d.done!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done:finally' mode");if(typeof d.finally!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'finally' in 'done:finally' mode");d.done(h),d.finally(y)}}),a.on("get",function(v,E,d){var f;if(c[v]){++c[v];return}f=p[v];var h=function(){a.emit("getasync",v,E,d)};o(f)?typeof f.done=="function"?f.done(h):f.then(function(){s(h)}):h()}),a.on("delete",function(v){if(delete p[v],c[v]){delete c[v];return}if(hasOwnProperty.call(m,v)){var E=m[v];delete m[v],a.emit("deleteasync",v,[E])}}),a.on("clear",function(){var v=m;m=i(null),c=i(null),p=i(null),a.emit("clearasync",e(v,function(E){return[E]}))})},sf}var mf={},yf;function qg(){if(yf)return mf;yf=1;var e=jt(),t=Ln(),r=rr(),n=Function.prototype.apply;return r.dispose=function(o,s,i){var l;if(e(o),i.async&&r.async||i.promise&&r.promise){s.on("deleteasync",l=function(u,a){n.call(o,null,a)}),s.on("clearasync",function(u){t(u,function(a,c){l(c,a)})});return}s.on("delete",l=function(u,a){o(a)}),s.on("clear",function(u){t(u,function(a,c){l(c,a)})})},mf}var wf={},vs,vf;function Fg(){return vf||(vf=1,vs=2147483647),vs}var gs,gf;function jg(){if(gf)return gs;gf=1;var e=tr(),t=Fg();return gs=function(r){if(r=e(r),r>t)throw new TypeError(r+" exceeds maximum possible timeout");return r},gs}var _f;function Ug(){if(_f)return wf;_f=1;var e=Fa(),t=Ln(),r=Ua(),n=Yp(),o=jg(),s=rr(),i=Function.prototype,l=Math.max,u=Math.min,a=Object.create;return s.maxAge=function(c,m,p){var v,E,d,f;c=o(c),c&&(v=a(null),E=p.async&&s.async||p.promise&&s.promise?"async":"",m.on("set"+E,function(h){v[h]=setTimeout(function(){m.delete(h)},c),typeof v[h].unref=="function"&&v[h].unref(),f&&(f[h]&&f[h]!=="nextTick"&&clearTimeout(f[h]),f[h]=setTimeout(function(){delete f[h]},d),typeof f[h].unref=="function"&&f[h].unref())}),m.on("delete"+E,function(h){clearTimeout(v[h]),delete v[h],f&&(f[h]!=="nextTick"&&clearTimeout(f[h]),delete f[h])}),p.preFetch&&(p.preFetch===!0||isNaN(p.preFetch)?d=.333:d=l(u(Number(p.preFetch),1),0),d&&(f={},d=(1-d)*c,m.on("get"+E,function(h,y,w){f[h]||(f[h]="nextTick",r(function(){var S;f[h]==="nextTick"&&(delete f[h],m.delete(h),p.async&&(y=e(y),y.push(i)),S=m.memoized.apply(w,y),p.promise&&n(S)&&(typeof S.done=="function"?S.done(i,i):S.then(i,i)))}))}))),m.on("clear"+E,function(){t(v,function(h){clearTimeout(h)}),v={},f&&(t(f,function(h){h!=="nextTick"&&clearTimeout(h)}),f={})}))},wf}var Ef={},_s,Sf;function Mg(){if(Sf)return _s;Sf=1;var e=tr(),t=Object.create,r=Object.prototype.hasOwnProperty;return _s=function(n){var o=0,s=1,i=t(null),l=t(null),u=0,a;return n=e(n),{hit:function(c){var m=l[c],p=++u;if(i[p]=c,l[c]=p,!m)return++o,o<=n?void 0:(c=i[s],a(c),c);if(delete i[m],s===m)for(;!r.call(i,++s););},delete:a=function(c){var m=l[c];if(m&&(delete i[m],delete l[c],--o,s===m)){if(!o){u=0,s=1;return}for(;!r.call(i,++s););}},clear:function(){o=0,s=1,i=t(null),l=t(null),u=0}}},_s}var bf;function Gg(){if(bf)return Ef;bf=1;var e=tr(),t=Mg(),r=rr();return r.max=function(n,o,s){var i,l,u;n=e(n),n&&(l=t(n),i=s.async&&r.async||s.promise&&r.promise?"async":"",o.on("set"+i,u=function(a){a=l.hit(a),a!==void 0&&o.delete(a)}),o.on("get"+i,u),o.on("delete"+i,l.delete),o.on("clear"+i,l.clear))},Ef}var Rf={},Of;function Vg(){if(Of)return Rf;Of=1;var e=nr(),t=rr(),r=Object.create,n=Object.defineProperties;return t.refCounter=function(o,s,i){var l,u;l=r(null),u=i.async&&t.async||i.promise&&t.promise?"async":"",s.on("set"+u,function(a,c){l[a]=c||1}),s.on("get"+u,function(a){++l[a]}),s.on("delete"+u,function(a){delete l[a]}),s.on("clear"+u,function(){l={}}),n(s.memoized,{deleteRef:e(function(){var a=s.get(arguments);return a===null||!l[a]?null:--l[a]?!1:(s.delete(a),!0)}),getRefCount:e(function(){var a=s.get(arguments);return a===null||!l[a]?0:l[a]})})},Rf}var Es,$f;function Bg(){if($f)return Es;$f=1;var e=Mp(),t=Gp(),r=Eg();return Es=function(n){var o=e(arguments[1]),s;return o.normalizer||(s=o.length=t(o.length,n.length,o.async),s!==0&&(o.primitive?s===!1?o.normalizer=Sg():s>1&&(o.normalizer=bg()(s)):s===!1?o.normalizer=Ig()():s===1?o.normalizer=Pg()():o.normalizer=Tg()(s))),o.async&&xg(),o.promise&&kg(),o.dispose&&qg(),o.maxAge&&Ug(),o.max&&Gg(),o.refCounter&&Vg(),r(n,o)},Es}var zg=Bg();const Fe=Oe(zg);async function we(e){try{return await ae.promises.access(e),!0}catch{return!1}}function Hg(e){try{return ae.accessSync(e),!0}catch{return!1}}function Wg(){if(wr()&&typeof process.env.SUDO_USER=="string"&&process.env.SUDO_USER!=="")return process.platform==="darwin"?T.join("/Users/",process.env.SUDO_USER):T.join("/home/",process.env.SUDO_USER);{const e=le.homedir();return e===""?void 0:e}}const Xg=/^~(?=$|\/|\\)/;function rt(e){const t=Wg();return t===void 0?e:e.replace(Xg,t)}const{appendFile:Jp,readFile:Ma,writeFile:Kg}=ae.promises,Yg="envosman",Qp=rt("~/.envosmanrc");async function Jg(e){var i;const t=rt("~/.bashrc"),r=rt("~/.profile"),n=T.resolve(e.rcPath);if(n===t||n===r)return;const o=(i=e.guard)!=null?i:Yg,s=`
|
||
# ${o}
|
||
if [[ "$SOURCE_${o.toUpperCase()}RC" != 0 && -f "${n}" ]]; then source "${n}"; fi
|
||
`;try{await Promise.all([Qg(e),If(s,t),If(s,r)])}catch(l){ve(`Failed to add ${s} to .profile or .bashrc. You should add it manually: ${l}`)}}const Ga=Fe(Jg,{promise:!0});async function Qg(e){const t=e.guard===void 0?`
|
||
# Automatically Generated by envosman
|
||
`:`
|
||
# Automatically Generated by envosman ${e.guard}
|
||
export SOURCE_${e.guard.toUpperCase()}RC=0
|
||
`;await we(e.rcPath)&&((await Ma(e.rcPath,"utf8")).includes(t)||(await Jp(e.rcPath,`
|
||
${t}
|
||
`),W(`Added ${t} to ${e.rcPath}`)))}async function If(e,t){await we(t)&&((await Ma(t,"utf-8")).includes(e)||(await Jp(t,e),W(`${e} was added to ${t}`)))}async function Zg(e){if(await we(e.rcPath)){const t=(await Ma(e.rcPath,"utf-8")).split(`
|
||
`),r=[...new Set(t.reverse())].reverse();await Kg(e.rcPath,r.join(`
|
||
`)),await vr(e.rcPath)}}var Ss,Pf;function e_(){if(Pf)return Ss;Pf=1;const e=le,t=e.platform()!=="win32",r=e.release(),n=/(\d+\.\d+)\.(\d+)/,o=(s="",i="")=>/1\d+\.\d+/.test(s)&&Number(i)>=17134.1184;return Ss=function(s){return t?s.replace(/(\s+)/g,"\\$1"):o(...n.exec(r).splice(1))?s:s.replace(/(\s+)/g,"%20")},Ss}var t_=e_();const r_=Oe(t_);var on={exports:{}},bs,Tf;function n_(){if(Tf)return bs;Tf=1;var e=/[|\\{}()[\]^$+*?.]/g;return bs=function(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(e,"\\$&")},bs}var i_=on.exports,xf;function o_(){return xf||(xf=1,function(){var e,t;e=n_(),t=function(r){return r.split("").reverse().join("")},on.exports=function(r,n,o){var s;return n==null&&(n="'"),o==null&&(o="\\"),typeof r!="string"?r:(s=new RegExp("(["+e(n)+"])(?!"+e(o)+")","g"),t(t(r).replace(s,"$1"+o)))}}.call(i_)),on.exports}var s_=o_();const a_=Oe(s_);function c_(e,t=!1){const r=t?r_(e):e;return a_(r,'"',"\\")}const{GITHUB_ACTIONS:u_}=Et,{appendFile:Cf}=ae.promises;async function Pe(e,t,r={}){const n={escapeSpace:!1,overwrite:!0,rcPath:Qp,...r},o=c_(t!=null?t:"",n.escapeSpace);try{if(u_)try{if(!n.overwrite&&process.env[e]!==void 0){W(`Environment variable ${e} is already defined. Skipping.`);return}Se.exportVariable(e,o)}catch(s){Ae(s),await Af(e,o,n)}else await Af(e,o,n)}catch(s){Ae(`${s}
|
||
Failed to export environment variable ${e}=${o}. You should add it manually.`)}}async function Af(e,t,r){const n=t!=null?t:"";switch(process.platform){case"win32":{if(!r.overwrite&&process.env[e]!==void 0){W(`Environment variable ${e} is already defined. Skipping.`);return}await qp(`[Environment]::SetEnvironmentVariable('${e}', '${n}', "User")`),W(`${e}='${n}' was set in the environment.`);return}case"linux":case"darwin":{await Ga(r),r.overwrite?(await Cf(r.rcPath,`
|
||
export ${e}="${n}"
|
||
`),W(`${e}="${n}" was added to "${r.rcPath}`)):(await Cf(r.rcPath,`
|
||
if [ -z "\${${e}}" ]; then export ${e}="${n}"; fi
|
||
`),W(`if not defined ${e} then ${e}="${n}" was added to "${r.rcPath}`)),process.env[e]=n;return}}process.env[e]=n}const{GITHUB_ACTIONS:l_}=Et,{appendFile:f_}=ae.promises;async function $e(e,t={}){const r={rcPath:Qp,...t};if(!p_(e)){process.env.PATH=`${e}${T.delimiter}${process.env.PATH}`;try{if(l_)try{Se.addPath(e)}catch(n){Ae(n),await Nf(e,r)}else await Nf(e,r)}catch(n){Ae(`${n}
|
||
Failed to add ${e} to the percistent PATH. You should add it manually.`)}}}async function Nf(e,t){switch(process.platform){case"win32":{await qp(`$USER_PATH=([Environment]::GetEnvironmentVariable("PATH", "User")); [Environment]::SetEnvironmentVariable("PATH", "${e};$USER_PATH", "User")`),W(`"${e}" was added to the PATH.`);return}case"linux":case"darwin":{await Ga(t),await f_(t.rcPath,`
|
||
export PATH="${e}:$PATH"
|
||
`),W(`"${e}" was added to "${t.rcPath}"`);return}default:return}}const d_=[/\/usr\/bin\/?/,/\/usr\/local\/bin\/?/];function p_(e){var t,r;return d_.some(n=>n.test(e))?((r=(t=process.env.PATH)==null?void 0:t.split(T.delimiter))!=null?r:[]).includes(e):!1}function Va(e){throw new 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.')}var sn={exports:{}},h_=sn.exports,Lf;function Zp(){return Lf||(Lf=1,function(e){(function(){var t={},r={create:n,addLocale:o,pluralize:s};e.exports=r;function n(a){return l(a),{pluralize:function(c,m){return s(a,c,m)}}}function o(a,c){t[a]=c}function s(a,c,m){if(l(a),typeof m!="object")throw new Error("List of variants should be specified as an object");var p=t[a](c);return typeof m[p]<"u"?m[p]:null}function i(a){return typeof t[a]<"u"}function l(a){i(a)||u(a)}function u(a){try{Va(__dirname+"/../locales/"+a+".js")}catch{throw Error("Failed to load the following locale: "+a)}}}).call(h_)}(sn)),sn.exports}var Rs,Df;function eh(){return Df||(Df=1,Rs=Zp()),Rs}var m_=eh();const y_=Oe(m_);var Os={},kf;function w_(){return kf||(kf=1,function(){var e=this,t;typeof Va=="function"?t=Zp():t=e.numerous,t.addLocale("en",function(n){var o=Math.floor(Math.abs(n)),s=n.toString().replace(/^[^.]*\.?/,"").length;return typeof n=="string"&&(n=parseInt(n,10)),o===1&&s===0?"one":"other"})}.call(Os)),Os}var v_=w_();const g_=Oe(v_);var $s={exports:{}},qf;function __(){return qf||(qf=1,function(e,t){e.exports=!!(typeof process<"u"&&process.versions&&process.versions.node)}($s)),$s.exports}var Is,Ff;function E_(){if(Ff)return Is;Ff=1;const e=eh(),t=__(),r=[["years",12*4*7*24*60*60*1e3],["months",4*7*24*60*60*1e3],["weeks",7*24*60*60*1e3],["days",24*60*60*1e3],["hours",60*60*1e3],["minutes",60*1e3],["seconds",1e3]],n={locale:"en",span:2,delimiter:", ",unitType:"long",unitTypeLookupOrder:["long","short","narrow"],autoloadLocales:!0},o={};Is={create:i,addLocale:s,defaultConfig:n};function s(d){Array.isArray(d)||(d=[d]);for(const f of d){const{id:h,data:y}=f;o[h]=y}}function i(d){return d=Object.assign({},n,d||{}),{format:function(f,h,y){return y=Object.assign({},d,y||{}),l(f,h,y)}}}function l(d,f,h){if(u(h.locale,{autoload:h.autoloadLocales}),!d)throw new Error("Missing first date argument");if(!f)throw new Error("Missing second date argument");const y=m(d,f),w=[];for(const S of y){const[_,b]=S;if(b>0&&w.push(p(_,b,h)),w.length>=h.span)break}return w.join(h.delimiter)}function u(d,f){const{autoload:h}=f;if(!a(d))if(t&&h)c(d);else throw new Error(`Missing locale: ${d}, you must load it manually before using it`)}function a(d){return!!o[d]}function c(d){try{s(Va(`../locales/${d}.js`))}catch(f){throw Error(`Failed to load locale: ${d} from ../locales/${d}.js. If using a bundled time-delta, set 'autoloadLocales: false' in the config: ${f}`)}}function m(d,f){let h=f-d;const y=[];return r.some(function(w){const S=w[0],_=w[1],b=Math.floor(h/_);if(h-=b*_,y.push([S,b]),h<=0)return!0}),y}function p(d,f,h){const y=v(h);return e.pluralize(h.locale,f,y[d]).replace("{0}",f)}function v(d){const f=o[d.locale];let h=d.unitTypeLookupOrder.slice();h.unshift(d.unitType),h=E(h);let y=null;if(h.some(function(w){if(typeof f[w]<"u")return y=f[w],!0}),y===null)throw new Error("Can not find any unit type data for locale: "+d.locale);return y}function E(d){return Array.from(new Set(d))}return Is}var Ps,jf;function S_(){return jf||(jf=1,Ps=E_()),Ps}var b_=S_();const Uf=Oe(b_);var Ts,Mf;function R_(){return Mf||(Mf=1,Ts={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"}}}}),Ts}var O_=R_();const $_=Oe(O_);var I_=lp();const kn=Oe(I_);function wn(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var xs,Gf;function P_(){if(Gf)return xs;Gf=1;var e=T;function t(n,o){if(typeof n!="string"||n.length===0)return n;var s=e.basename(n,e.extname(n))+o,i=e.join(e.dirname(n),s);return r(n)?"."+e.sep+i:i}function r(n){var o=n.slice(0,2);return o==="."+e.sep||o==="./"}return xs=t,xs}var T_=P_();const x_=Oe(T_);function Rt(e,t){return Object.keys(t).forEach(r=>{r==="default"||r==="__esModule"||e.hasOwnProperty(r)||Object.defineProperty(e,r,{enumerable:!0,get(){return t[r]}})}),e}function xt(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}function C_(e,t=!0){return t?T.basename(e):T.basename(e,T.extname(e))}function A_(e){return T.normalize(e).replace(RegExp(wn(T.sep)+"$"),"")}function Ee(e,t=".exe",r=""){return process.platform==="win32"?`${e}${t}`:`${e}${r}`}function N_(e,t){const r=T.extname(e),n=`${t}${T.basename(e,r)}${r}`;return T.join(T.dirname(e),n)}function L_(e,t){const r=T.extname(e),n=`${T.basename(e,r)}${t}${r}`;return T.join(T.dirname(e),n)}function va(e,t=".cmd",r=".sh"){return process.platform==="win32"?`${e}${t}`:`${e}${r}`}function th(e){return process.platform==="win32"?e:"./"+e}function D_(e){const t=T.extname(e).length;return e.slice(0,-t)}function k_(e,t){return x_(e,t)}function q_(e,t){const r=T.relative(t,e);return!(!r||r===".."||r.startsWith(".."+T.sep)||r===T.resolve(e))}var Ot={},rh={};xt(rh,"name",()=>C_);var nh={};xt(nh,"normalizeTrim",()=>A_);var ih={};xt(ih,"addExeExt",()=>Ee);var oh={};xt(oh,"addNamePrefix",()=>N_);var sh={};xt(sh,"addNameSuffix",()=>L_);var ah={};xt(ah,"addShExt",()=>va);var ch={};xt(ch,"addShRelativePrefix",()=>th);var uh={};xt(uh,"removeExt",()=>D_);var lh={};xt(lh,"replaceExt",()=>k_);var Vf={};xt(Vf,"isPathInside",()=>q_),Rt(Ot,rh),Rt(Ot,nh),Rt(Ot,ih),Rt(Ot,oh),Rt(Ot,sh),Rt(Ot,ah),Rt(Ot,ch),Rt(Ot,uh),Rt(Ot,lh),Rt(Ot,Vf);var F_=fp();const fh=Oe(F_);function dh(){if(process.platform!=="linux")return!1;try{return Hg("/etc/alpine-release")}catch{return!1}}async function j_(){if(!dh())return!1;try{return await de("apk"),!0}catch{return!1}}const Ie=Fe(j_,{promise:!0});async function U_(){await fe("apk",["update"],{stdio:"inherit"})}const vn=Fe(U_,{promise:!0});async function M_(e){if(!await Ie())throw new Error("apk is not available on this system");try{const t="/etc/apk/repositories";if(!await we(t))throw new Error(`APK repositories file not found at ${t}`);return W(`Adding repository: ${e}`),await Dp(t,`${e}
|
||
`),await vn.clear(),await vn(),W(`Successfully added repository: ${e}`),!0}catch(t){throw new Error(`Failed to add repository ${e}: ${t}`)}}async function ph(){const e=(await G_()).split(".").slice(0,2).join(".");return M_(`https://dl-cdn.alpinelinux.org/alpine/v${e}/community/`)}async function G_(){const e="/etc/alpine-release";if(!await we(e))throw new Error(`Alpine release file not found at ${e}`);return Qt(e,"utf8")}async function V_(e){try{const{exitCode:t}=await vt("apk",["info","-e",e.name],{reject:!1,stdio:["ignore","pipe","ignore"]});if(t!==0)return!1;if(e.version===void 0||e.version==="")return!0;const{stdout:r}=await vt("apk",["info","-v",e.name],{stdio:["ignore","pipe","ignore"]});return r.trim().split("-").slice(-1)[0]===e.version}catch{return!1}}async function hh(e){return(await Promise.all(e.map(async r=>await V_(r)?void 0:r))).filter(r=>r!==void 0).map(mh)}function mh(e){return e.version!==void 0&&e.version!==""?`${e.name}=${e.version}`:e.name}async function B_(){const e=await hh([{name:"bash"}]);e.length!==0&&me("apk",["add",...e],{...it})}const z_=Fe(B_,{promise:!0});async function ke(e,t=!1){if(!await Ie())throw new Error("apk is not available on this system");try{await z_(),t&&await vn.clear(),await vn();const r=await hh(e);return r.length===0?(W("All packages are already installed"),{binDir:"/usr/bin"}):(W(`Installing ${r.join(" ")}`),await vt("apk",["add",...r]),W(`Successfully installed ${r.join(" ")}`),{binDir:"/usr/bin"})}catch(r){throw ve(`Failed to install ${e.map(n=>mh(n)).join(" ")}: ${r}`),r}}const{GITHUB_ACTIONS:H_}=Et,{appendFile:W_}=ae.promises;async function X_(e,t,r=40){await vt("update-alternatives",["--install",`/usr/bin/${e}`,e,t,r.toString()])}async function wt(e,t,r,n=40){H_?await X_(e,t,n):(await Ga(r),await W_(r.rcPath,`
|
||
if [ $UID -eq 0 ]; then update-alternatives --install /usr/bin/${e} ${e} ${t} ${n}; fi
|
||
`))}var Cs={},Bf;function K_(){return Bf||(Bf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DownloaderHelper=e.DH_STATES=void 0;var t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(y){return typeof y}:function(y){return y&&typeof Symbol=="function"&&y.constructor===Symbol&&y!==Symbol.prototype?"symbol":typeof y},r=function(){function y(w,S){for(var _,b=0;b<S.length;b++)_=S[b],_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(w,_.key,_)}return function(w,S,_){return S&&y(w.prototype,S),_&&y(w,_),w}}(),n=ae,o=v(n),s=lt,i=T,l=v(i),u=ba,a=v(u),c=Rn,m=v(c),p=On;function v(y){if(y&&y.__esModule)return y;var w={};if(y!=null)for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(w[S]=y[S]);return w.default=y,w}function E(y,w){if(!(y instanceof w))throw new TypeError("Cannot call a class as a function")}function d(y,w){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:y}function f(y,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);y.prototype=Object.create(w&&w.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(y,w):y.__proto__=w)}var h=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(y){function w(S,_){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{};E(this,w);var g=d(this,(w.__proto__||Object.getPrototypeOf(w)).call(this,{captureRejections:!0}));return g.__validate(S,_)?(g.url=g.requestURL=S.trim(),g.state=h.IDLE,g.__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},g.__opts=Object.assign({},g.__defaultOpts),g.__pipes=[],g.__total=0,g.__downloaded=0,g.__progress=0,g.__retryCount=0,g.__retryTimeout=null,g.__resumeRetryCount=0,g.__states=h,g.__promise=null,g.__request=null,g.__response=null,g.__isAborted=!1,g.__isResumed=!1,g.__isResumable=!1,g.__isRedirected=!1,g.__destFolder=_,g.__statsEstimate={time:0,bytes:0,prevBytes:0,throttleTime:0},g.__fileName="",g.__filePath="",g.updateOptions(b),g):d(g)}return f(w,y),r(w,[{key:"start",value:function(){var _=this,b=function(){return new Promise(function(g,O){_.__promise={resolve:g,reject:O},_.__start()})};return this.__opts.resumeIfFileExists&&this.state!==this.__states.RESUMED?this.getTotalSize().then(function(g){var O=g.name,$=g.total,C=_.__opts.override;if(_.__opts.override=!0,_.__filePath=_.__getFilePath(O),_.__opts.override=C,_.__filePath&&o.existsSync(_.__filePath)){var G=_.__getFilesizeInBytes(_.__filePath);return G===$?b():_.resumeFromFile(_.__filePath,{total:$,fileName:O})}return b()}):b()}},{key:"pause",value:function(){var _=this;return this.state===this.__states.STOPPED?Promise.resolve(!0):(this.__response&&(this.__response.unpipe(),this.__pipes.forEach(function(b){return b.stream.unpipe()})),this.__fileStream&&this.__fileStream.removeAllListeners(),this.__requestAbort(),this.__closeFileStream().then(function(){return _.__setState(_.__states.PAUSED),_.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 _=this;if(this.state===this.__states.STOPPED)return Promise.resolve(!0);var b=function(){return new Promise(function(g,O){o.access(_.__filePath,function($){return $?(_.__emitStop(),g(!0)):void o.unlink(_.__filePath,function(C){return C?(_.__setState(_.__states.FAILED),_.emit("error",C),O(C)):(_.__emitStop(),void g(!0))})})})};return this.__requestAbort(),this.__closeFileStream().then(function(){return _.__opts.removeOnStop?b():(_.__emitStop(),Promise.resolve(!0))})}},{key:"pipe",value:function(_){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:null;return this.__pipes.push({stream:_,options:b}),_}},{key:"unpipe",value:function(){var _=this,b=0<arguments.length&&arguments[0]!==void 0?arguments[0]:null,g=function($){return _.__response?_.__response.unpipe($):$.unpipe()};if(b){var O=this.__pipes.find(function($){return $.stream===b});return void(O&&(g(b),this.__pipes=this.__pipes.filter(function($){return $.stream!==b})))}this.__pipes.forEach(function($){return g($.stream)}),this.__pipes=[]}},{key:"getDownloadPath",value:function(){return this.__filePath}},{key:"isResumable",value:function(){return this.__isResumable}},{key:"updateOptions",value:function(_){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"";this.__opts=Object.assign({},this.__opts,_),this.__headers=this.__opts.headers,-1<this.__opts.timeout&&(this.__opts.httpRequestOptions.timeout=this.__opts.timeout,this.__opts.httpsRequestOptions.timeout=this.__opts.timeout),(typeof this.__opts.progressThrottle!="number"||0>this.__opts.progressThrottle)&&(this.__opts.progressThrottle=this.__defaultOpts.progressThrottle),this.url=b||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 _=this;return new Promise(function(b,g){var O=function(C){_.__initProtocol(C);var G=Object.assign({},_.__headers);G.hasOwnProperty("range")&&delete G.range;var Y=_.__getReqOptions("HEAD",C,G);return Object.assign({},_.__reqOptions,Y)},$=function(C,G){var Y=_.__protocol.request(G,function(Q){if(_.__isRequireRedirect(Q)){var A=/^https?:\/\//.test(Q.headers.location)?Q.headers.location:new s.URL(Q.headers.location,C).href;return _.emit("redirected",A,C),$(A,O(A))}return Q.statusCode===200?void b({name:_.__getFileNameFromHeaders(Q.headers,Q),total:parseInt(Q.headers["content-length"])||null}):g(new Error("Response status was "+Q.statusCode))});Y.on("error",function(Q){return g(Q)}),Y.on("timeout",function(){return g(new Error("timeout"))}),Y.on("uncaughtException",function(Q){return g(Q)}),Y.end()};$(_.url,O(_.url))})}},{key:"getResumeState",value:function(){return{downloaded:this.__downloaded,filePath:this.__filePath,fileName:this.__fileName,total:this.__total}}},{key:"resumeFromFile",value:function(_){var b=this,g=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{};return this.__opts.override=!0,this.__filePath=_,(g.total&&g.fileName?Promise.resolve({name:g.fileName,total:g.total}):this.getTotalSize()).then(function(O){var $=O.name,C=O.total;return b.__total=g.total||C,b.__fileName=g.fileName||$,b.__downloaded=g.downloaded||b.__getFilesizeInBytes(b.__filePath),b.__reqOptions.headers.range="bytes="+b.__downloaded+"-",b.__isResumed=!0,b.__isResumable=!0,b.__setState(b.__states.RESUMED),b.emit("resume",b.__isResumed),new Promise(function(G,Y){b.__promise={resolve:G,reject:Y},b.__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 _=this.__promise.resolve;return this.__promise=null,_(!0)}}},{key:"__downloadRequest",value:function(_,b){var g=this;return this.__protocol.request(this.__reqOptions,function(O){if(g.__response=O,g.__isResumed||(g.__total=parseInt(O.headers["content-length"])||null,g.__resetStats()),g.__isRequireRedirect(O)){var $=/^https?:\/\//.test(O.headers.location)?O.headers.location:new s.URL(O.headers.location,g.url).href;return g.__isRedirected=!0,g.__initProtocol($),g.emit("redirected",$,g.url),g.__start()}if(O.statusCode!==200&&O.statusCode!==206){var C=new Error("Response status was "+O.statusCode);return C.status=O.statusCode||0,C.body=O.body||"",g.__setState(g.__states.FAILED),g.emit("error",C),b(C)}(g.__opts.forceResume||O.headers.hasOwnProperty("accept-ranges")&&O.headers["accept-ranges"]!=="none")&&(g.__isResumable=!0),g.__startDownload(O,_,b)})}},{key:"__startDownload",value:function(_,b,g){var O=this,$=_;if(this.__isResumed)this.__fileStream=o.createWriteStream(this.__filePath,{flags:"a"});else{var C=this.__getFileNameFromHeaders(_.headers);if(this.__filePath=this.__getFilePath(C),this.__fileName=this.__filePath.split(l.sep).pop(),o.existsSync(this.__filePath)){var G=this.__getFilesizeInBytes(this.__filePath),Y=this.__total?this.__total:0;if(t(this.__opts.override)==="object"&&this.__opts.override.skip&&(this.__opts.override.skipSmaller||G>=Y))return this.emit("skip",{totalSize:this.__total,fileName:this.__fileName,filePath:this.__filePath,downloadedSize:G}),this.__setState(this.__states.SKIPPED),b(!0)}this.__fileStream=o.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,$.on("data",function(Q){return O.__calculateStats(Q.length)}),this.__pipes.forEach(function(Q){$.pipe(Q.stream,Q.options),$=Q.stream}),$.pipe(this.__fileStream),$.on("error",this.__onError(b,g)),this.__fileStream.on("finish",this.__onFinished(b,g)),this.__fileStream.on("error",this.__onError(b,g))}},{key:"__hasFinished",value:function(){return!this.__isAborted&&[this.__states.PAUSED,this.__states.STOPPED,this.__states.RETRY,this.__states.FAILED,this.__states.RESUMED].indexOf(this.state)===-1}},{key:"__isRequireRedirect",value:function(_){return 300<_.statusCode&&400>_.statusCode&&_.headers.hasOwnProperty("location")&&_.headers.location}},{key:"__onFinished",value:function(_,b){var g=this;return function(){g.__fileStream.close(function(O){if(O)return b(O);if(g.__hasFinished()){var $=!!g.__total&&g.__downloaded!==g.__total;if($&&g.__isResumable&&g.__opts.resumeOnIncomplete&&g.__resumeRetryCount<=g.__opts.resumeOnIncompleteMaxRetry)return g.__resumeRetryCount++,g.emit("warning",new Error("uncomplete download, retrying")),g.resume();g.__setState(g.__states.FINISHED),g.__pipes=[],g.emit("end",{fileName:g.__fileName,filePath:g.__filePath,totalSize:g.__total,incomplete:$,onDiskSize:g.__getFilesizeInBytes(g.__filePath),downloadedSize:g.__downloaded})}return _(g.__downloaded===g.__total)})}}},{key:"__closeFileStream",value:function(){var _=this;return this.__fileStream?new Promise(function(b,g){_.__fileStream.close(function(O){return O?g(O):b(!0)})}):Promise.resolve(!0)}},{key:"__onError",value:function(_,b){var g=this,O=2<arguments.length&&arguments[2]!==void 0&&arguments[2];return function($){return g.__pipes=[],O&&g.__requestAbort(),g.state===g.__states.STOPPED||g.state===g.__states.FAILED?void 0:g.__opts.retry?g.__retry($).catch(function(C){g.__removeFile().finally(function(){g.__setState(g.__states.FAILED),g.emit("error",C||$),b(C||$)})}):g.__removeFile().finally(function(){g.__setState(g.__states.FAILED),g.emit("error",$),b($)})}}},{key:"__retry",value:function(){var _=this,b=0<arguments.length&&arguments[0]!==void 0?arguments[0]:null;if(!this.__opts.retry||t(this.__opts.retry)!=="object")return Promise.reject(b||new Error("wrong retry options"));var g=this.__opts.retry,O=g.delay,$=O===void 0?0:O,C=g.maxRetries,G=C===void 0?999:C;return this.__retryCount>=G?Promise.reject(b||new Error("reached the maximum retries")):(this.__retryCount++,this.__setState(this.__states.RETRY),this.emit("retry",this.__retryCount,this.__opts.retry,b),this.__response&&(this.__response.unpipe(),this.__pipes.forEach(function(Y){return Y.stream.unpipe()})),this.__fileStream&&this.__fileStream.removeAllListeners(),this.__requestAbort(),this.__closeFileStream().then(function(){return new Promise(function(Y){return _.__retryTimeout=setTimeout(function(){return Y(0<_.__downloaded?_.resume():_.__start())},$)})}))}},{key:"__onTimeout",value:function(_,b){var g=this;return function(){return g.__requestAbort(),g.__opts.retry?g.__retry(new Error("timeout")).catch(function(O){g.__removeFile().finally(function(){g.__setState(g.__states.FAILED),O?b(O):(g.emit("timeout"),b(new Error("timeout")))})}):g.__removeFile().finally(function(){g.__setState(g.__states.FAILED),g.emit("timeout"),b(new 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(_,b){var g="",O=/.*filename\*=.*?'.*?'([^"].+?[^"])(?:(?:;)|$)/i,$=/.*filename="(.*?)";?/i,C=/.*filename=([^"].+?[^"])(?:(?:;)|$)/i,G=_.hasOwnProperty("content-disposition"),Y=G?_["content-disposition"].match(O):null,Q=!G||Y?null:_["content-disposition"].match($),A=!G||Y||Q?null:_["content-disposition"].match(C);return G&&(Y||Q||A)?(g=_["content-disposition"],g=g.trim(),Y?g=Y[1]:Q?g=Q[1]:A&&(g=A[1]),g=g.replace(/[/\\]/g,"")):0<l.basename(new s.URL(this.requestURL).pathname).length?g=l.basename(new s.URL(this.requestURL).pathname):g=new s.URL(this.requestURL).hostname+".html",this.__opts.fileName?this.__getFileNameFromOpts(g,b):g.replace(/\.*$/,"")}},{key:"__getFilePath",value:function(_){var b=l.join(this.__destFolder,_),g=b;return this.__opts.override||this.state===this.__states.RESUMED||(g=this.__uniqFileNameSync(g),b!==g&&this.emit("renamed",{path:g,fileName:g.split(l.sep).pop(),prevPath:b,prevFileName:b.split(l.sep).pop()})),g}},{key:"__getFileNameFromOpts",value:function(_,b){if(!this.__opts.fileName)return _;if(typeof this.__opts.fileName=="string")return this.__opts.fileName;if(typeof this.__opts.fileName=="function"){var g=l.join(this.__destFolder,_);return b&&b.headers||this.__response&&this.__response.headers?this.__opts.fileName(_,g,(b||this.__response).headers["content-type"]):this.__opts.fileName(_,g)}if(t(this.__opts.fileName)==="object"){var O=this.__opts.fileName,$=O.name,C=!!O.hasOwnProperty("ext")&&O.ext;if(typeof C=="string")return $+"."+C;if(typeof C=="boolean"){if(C)return $;var G=_.includes(".")?_.split(".").pop():"";return G===""?$:$+"."+G}}return _}},{key:"__calculateStats",value:function(_){var b=new Date,g=b-this.__statsEstimate.time,O=b-this.__statsEstimate.throttleTime,$=this.__total||0;_&&(this.__downloaded+=_,this.__progress=$===0?0:100*(this.__downloaded/$),(this.__downloaded===$||1e3<g)&&(this.__statsEstimate.time=b,this.__statsEstimate.bytes=this.__downloaded-this.__statsEstimate.prevBytes,this.__statsEstimate.prevBytes=this.__downloaded),(this.__downloaded===$||O>this.__opts.progressThrottle)&&(this.__statsEstimate.throttleTime=b,this.emit("progress.throttled",this.getStats())),this.emit("progress",this.getStats()))}},{key:"__setState",value:function(_){this.state=_,this.emit("stateChanged",this.state)}},{key:"__getReqOptions",value:function(_,b){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{},O=new s.URL(b),$={protocol:O.protocol,host:O.hostname,port:O.port,path:O.pathname+O.search,method:_};return g&&($.headers=g),$}},{key:"__getFilesizeInBytes",value:function(_){try{var b=o.statSync(_,{throwIfNoEntry:!1}),g=b.size||0;return g}catch(O){this.emit("warning",O)}return 0}},{key:"__validate",value:function(_,b){if(typeof _!="string")throw new Error("URL should be an string");if(_.trim()==="")throw new Error("URL couldn't be empty");if(typeof b!="string")throw new Error("Destination Folder should be an string");if(b.trim()==="")throw new Error("Destination Folder couldn't be empty");if(!o.existsSync(b))throw new Error("Destination Folder must exist");var g=o.statSync(b);if(!g.isDirectory())throw new Error("Destination Folder must be a directory");try{o.accessSync(b,o.constants.W_OK)}catch{throw new Error("Destination Folder must be writable")}return!0}},{key:"__initProtocol",value:function(_){var b=this.__getReqOptions(this.__opts.method,_,this.__headers);this.requestURL=_,-1<_.indexOf("https://")?(this.__protocol=m,b.agent=new m.Agent({keepAlive:!1}),this.__reqOptions=Object.assign({},b,this.__opts.httpsRequestOptions)):(this.__protocol=a,b.agent=new a.Agent({keepAlive:!1}),this.__reqOptions=Object.assign({},b,this.__opts.httpRequestOptions))}},{key:"__uniqFileNameSync",value:function(_){if(typeof _!="string"||_==="")return _;try{o.accessSync(_,o.F_OK);var b=_.match(/(.*)(\([0-9]+\))(\..*)$/),g=b?b[1].trim():_,O=b?parseInt(b[2].replace(/\(|\)/,"")):0,$=_.split(".").pop();return $!==_&&0<$.length?($="."+$,g=g.replace($,"")):$="",this.__uniqFileNameSync(g+" ("+ ++O+")"+$)}catch{return _}}},{key:"__removeFile",value:function(){var _=this;return new Promise(function(b){return _.__fileStream?void _.__fileStream.close(function(g){return g&&_.emit("warning",g),_.__opts.removeOnFail?o.access(_.__filePath,function(O){return O?b():void o.unlink(_.__filePath,function($){$&&_.emit("warning",g),b()})}):void b()}):b()})}},{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")}}]),w}(p.EventEmitter)}(Cs)),Cs}var _r=K_();function yh(){return process.platform==="linux"&&de.sync("nala",{nothrow:!0})!==null}function Y_(){return process.platform==="linux"&&de.sync("apt-fast",{nothrow:!0})!==null}function ye(){return process.platform==="linux"&&de.sync("apt-get",{nothrow:!0})!==null}function Ur(){if(yh())return"nala";if(Y_())return"apt-fast";if(ye())return"apt-get";throw new Error("No apt command found")}function ut(e="apt-get"){const t={...process.env,DEBIAN_FRONTEND:"noninteractive"};return e==="nala"&&(t.LANG===void 0&&(t.LANG="C.UTF-8"),t.LC_ALL===void 0&&(t.LC_ALL="C.UTF-8")),t}function J_(e){return"keyUrl"in e?wh(e):Z_(e)}const Q_="/etc/apt/trusted.gpg.d",zf="keyserver.ubuntu.com";async function Z_({key:e,keyServer:t=zf,fileName:r,keyStorePath:n=zf}){try{gh(r);const o=T.join(n,r);return await we(o)||(vh(),await vt("gpg",["--no-default-keyring","--keyring",`gnupg-ring:${o}`,"--keyserver",t,"--recv-keys",e]),await vt("chmod",["644",o])),o}catch(o){ve(`Failed to add apt key via server ${t}: ${o}`);return}}async function wh({keyUrl:e,fileName:t,keyStorePath:r=Q_}){try{gh(t);const n=T.join(r,t);if(!await we(n)){vh(),await pe([{name:"ca-certificates"}]);const o=T.join(le.tmpdir(),t),s=new _r.DownloaderHelper(e,le.tmpdir(),{fileName:t});s.on("error",i=>{throw new Error(`Failed to download ${e}: ${i}`)}),await s.start(),me("gpg",["--no-default-keyring","--keyring",`gnupg-ring:${n}`,"--import",o]),me("chmod",["644",n])}return n}catch(n){ve(`Failed to add apt key via download ${e}: ${n}`);return}}function vh(){me("gpg",["-k"])}function gh(e){if(!e.endsWith(".gpg"))throw new Error(`Key file name must end with .gpg: ${e}`)}const Er="Dpkg::Lock::Timeout=300";async function Ba(e){try{const{stdout:t}=await fe("dpkg",["-s",e],{env:ut("apt-get"),stdio:"pipe"});return typeof t!="string"?!1:t.split(`
|
||
`).some(n=>n.startsWith("Status: install ok installed"))}catch{return!1}}async function eE(e){try{const{stdout:t}=await fe("dpkg",["-l",e],{env:ut("apt-get"),stdio:"pipe"});return typeof t!="string"?!1:t.split(`
|
||
`).some(n=>n.startsWith("ii"))}catch{return!1}}let _h=!1;function tE(e=Ur()){me(e,["update","-o",Er],{...it,env:ut(e)}),_h=!0}const lr=Fe(tE);var Pt;(function(e){e[e.NameDashVersion=0]="NameDashVersion",e[e.NameEqualsVersion=1]="NameEqualsVersion",e[e.Name=2]="Name",e[e.None=3]="None"})(Pt||(Pt={}));async function Eh(e,t=Ur()){return(await Promise.all(e.map(r=>ga(r,t)))).filter(r=>r!==void 0)}async function ga(e,t=Ur()){const r=await nE(t,e);return await Ba(r)?void 0:r}async function Sh(e,t,r,n){const o=r!==void 0&&r!=="",s=!o||n;if(o){if(await rE(e,t,r))return Pt.NameDashVersion;if(await Hf(e,`${t}=${r}`))return Pt.NameEqualsVersion}const i=()=>{o&&n&&W(`Could not find package ${t} ${r}. Falling back to latest version.`)};return s&&await Hf(e,t)?(i(),Pt.Name):_h?s?(i(),Pt.Name):Pt.None:(lr(e),Sh(e,t,r,n))}async function rE(e,t,r){try{const{stdout:n}=await fe("apt-cache",["search","--names-only",`^${wn(t)}-${wn(r)}$`],{env:ut(e),stdio:"pipe"});if(n.trim()!=="")return!0}catch{}return!1}async function Hf(e,t){try{const{stdout:r}=await fe("apt-cache",["show",t],{env:ut(e),stdio:"pipe",verbose:!0});if(r.trim()!=="")return!0}catch{}return!1}async function nE(e,t){const{name:r,version:n,fallBackToLatest:o=!1}=t;switch(await Sh(e,r,n,o)){case Pt.NameDashVersion:return`${r}-${n}`;case Pt.NameEqualsVersion:return`${r}=${n}`;case Pt.Name:return r;default:throw new Error(`Could not find package '${r}' ${n!=null?n:"with unspecified version"}`)}}async function iE(e){lr(e);const t=await Eh([{name:"ca-certificates"},{name:"gnupg"},{name:"apt-utils"}],e);t.length!==0&&me(e,["install","-y","--fix-broken","-o",Er,...t],{...it,env:ut(e)})}const bh=Fe(iE,{promise:!0});function oE(e="apt-get"){try{const{stdout:t}=me("add-apt-repository",["--help"],{...it,env:ut(e),stdio:"pipe"});return t.includes("--no-update")}catch{return!1}}const Rh=Fe(oE);async function sE(e,t=Ur()){await bh(t),await Oh();try{me("add-apt-repository",["-y",Rh(t)?"--no-update":void 0,e].filter(r=>r!==void 0),{...it,env:ut(t)})}catch{me("add-apt-repository",["-y",e],{...it,env:ut(t)})}lr.clear(),lr(t)}async function Oh(){if(await Ba("software-properties-common"))return;const e="apt-get";me(e,["install","-y","--fix-broken","-o",Er,"software-properties-common"],{...it,env:ut(e)})}const aE=["E: Could not get lock","dpkg: error processing archive","dpkg: error: dpkg status database is locked by another process"];async function pe(e,t=!1){try{const r=Ur();for(const{name:o,version:s}of e)W(`Installing ${o} ${s!=null?s:""} via ${r}`);t&&lr.clear(),lr(r),await cE(r,e);const n=await Eh(e,r);if(n.length===0)return W("All packages are already installed"),{binDir:"/usr/bin/"};await bh(r);try{await uE(e),me(r,["install","--fix-broken","-y",...n],{...it,env:ut(r)})}catch(o){if(lE(o))aE.some(s=>typeof o.stderr=="string"&&o.stderr.includes(s))&&(ve(`Failed to install packages ${n}. Retrying...`),me(r,["install","--fix-broken","-y","-o",Er,...n],{...it,env:ut(r)}));else throw o}return{binDir:"/usr/bin/"}}catch(r){const n=r instanceof Error?`${r.message}
|
||
${r.stack}`:String(r);throw new Error(`Failed to install apt packages: ${n}`)}}async function cE(e,t){const r=[...new Set(t.flatMap(n=>{var o;return(o=n.repository)!=null?o:[]}))];await Promise.all(r.map(n=>sE(n,e)))}async function uE(e){await Promise.all(e.map(async t=>{t.key!==void 0&&await J_(t.key)}))}function lE(e){return typeof e.stderr=="string"}let ar;async function Wf(){if(!ye())return;if(typeof ar=="string")return{binDir:ar};const e=de.sync("apt-fast",{nothrow:!0});return e!==null?(ar=T.dirname(e),{binDir:ar}):(ar="/usr/bin",await fE(),{binDir:ar})}async function fE(){const e=pe([{name:"bash"},{name:"wget"}]),t=new _r.DownloaderHelper("https://raw.githubusercontent.com/ilikenwf/apt-fast/c2cd0a0420d3f2d647dc82cf749bfd58c4697dac/quick-install.sh",le.tmpdir(),{fileName:"install-apt-fast.sh"});t.on("error",u=>{throw new Error(`Failed to download install-apt-fast.sh: ${u}`)}),await t.start();const r=T.join(le.tmpdir(),"install-apt-fast.sh");let n=await Qt(r,"utf8");n=n.replace(/sudo/g,"").replace("https://raw.githubusercontent.com/ilikenwf/apt-fast/master","https://raw.githubusercontent.com/Rongronggg9/apt-fast/ac82051792f764220e5e303d4560de0f1952826b"),await Lr(r,n),await e;try{me("bash",[r])}catch(u){Ae(`Failed to install apt-fast via installer: ${u}`)}const o="/etc/apt-fast.conf";let s=await Qt(o,"utf8");const i=["_APTMGR","DOWNLOADBEFORE"];for(const u of i)s=s.replace(new RegExp(`^#\\s*${u}`,"m"),u);const l=T.join(le.tmpdir(),"apt-fast.conf");await Lr(l,s),me("mv",[l,o])}let Dt;async function dE({version:e}={}){if(!ye())return;if(typeof Dt=="string")return{binDir:Dt};const t=de.sync("nala",{nothrow:!0});if(t!==null)return Dt=T.dirname(t),{binDir:Dt};await pe([{name:"python3-apt"}]),Dt="/usr/bin";try{const r=await ga({name:"nala",version:e});if(r!==void 0)return await pe([{name:r}]),{binDir:Dt}}catch(r){W(`Failed to install nala: ${r}`)}try{const r=await ga({name:"nala-legacy"});if(r!==void 0)return await pe([{name:r}],!0),{binDir:Dt}}catch(r){W(`Failed to install nala-legacy: ${r}`)}return await pE(),{binDir:Dt}}async function pE(){const e=new _r.DownloaderHelper("https://gitlab.com/volian/volian-archive/-/raw/1939afc3f80638dca2bbedde74bbd86731703cc8/install-nala.sh",le.tmpdir(),{fileName:"install-nala.sh"});e.on("error",n=>{throw new Error(`Failed to download install-nala.sh: ${n}`)}),await e.start();const t=T.join(le.tmpdir(),"install-nala.sh"),r=await Qt(t,"utf8");await Lr(t,r.replace(/sudo/g,"")),await pe([{name:"wget"}]);try{me("bash",[t])}catch(n){Ae(`Failed to install nala via installer: ${n}`),me("apt",["install","-y","-t","nala","nala"])}}let Kt;async function za(e={}){if(!["darwin","linux"].includes(process.platform)||process.platform==="linux"&&process.arch!=="x64"){ve(`Brew is not supported on ${process.platform} ${process.arch}`);return}if(typeof Kt=="string")return{binDir:Kt};const t=await de("brew",{nothrow:!0});if(t!==null)return Kt=T.dirname(t),{binDir:Kt};await pe([{name:"ca-certificates"}]);const r=new _r.DownloaderHelper("https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh",le.tmpdir(),{fileName:"install-brew.sh"});return r.on("error",n=>{throw new Error(`Failed to download the brew installer script: ${n}`)}),await r.start(),ze("/bin/bash",[r.getDownloadPath()],{stdio:"inherit",env:{NONINTERACTIVE:"1"}}),Kt=Ha(),await $e(Kt,e.rcOptions),{binDir:Kt}}function Ha(){return T.join(Wa(),"bin")}function $h(){return T.join(Ha(),"brew")}function Wa(){if(process.platform==="darwin")return process.arch==="arm64"?"/opt/homebrew":"/usr/local";if(process.platform==="linux")return"/home/linuxbrew/.linuxbrew";throw new Error("Unsupported platform for brew")}function Ih(e,t){return t!==void 0&&t!==""?`${e}@${t}`:e}async function hE(e,t){const r=Ih(e,t),n=await Xf(r);if(n!==void 0)return n;const o=await Xf(e);return o!==void 0?o:mE(e,r)}async function Xf(e){try{const t=$h();return(await fe(t,["--prefix",e],{stdio:"pipe"})).stdout}catch{return}}function mE(e,t){const r=Wa(),n=T.join(r,"opt",t);if(ae.existsSync(n))return n;const o=T.join(r,"opt",e);if(ae.existsSync(o))return o;const s=T.join(r,"Cellar",t);if(ae.existsSync(s))return s;const i=T.join(r,"Cellar",e);if(ae.existsSync(i))return i;const l=T.join(r,"lib",t);if(ae.existsSync(l))return l;const u=T.join(r,"lib",e);if(ae.existsSync(u))return u}let Kf=!1;async function Me(e,t,r={}){"overwrite"in r||(r.overwrite=!0),r.cask===!0&&(r.overwrite=!1),W(`Installing ${e} ${t!=null?t:""} via brew`),(!Kf||de.sync("brew",{nothrow:!0})===null)&&(await za(),Kf=!0);const n=$h(),o=["install",Ih(e,t)];for(const[u,a]of Object.entries(r))typeof a=="boolean"&&a?o.push(`--${u}`):typeof a=="string"&&o.push(`--${u}`,a);const s=ze(n,[...o,"--dry-run"],{stdio:"pipe"});s.exitCode===0&&new RegExp(`.*${e}.* is already installed and up-to-date.[\\s\\S]*`).test(s.stderr)?W(`${e} ${t!=null?t:""} is already installed and up-to-date`):ze(n,o,{stdio:"inherit"});const l=await hE(e,t);return l===void 0?(ve(`Failed to find installation directory for ${e} ${t}`),{binDir:Ha(),installDir:void 0}):{installDir:l,binDir:T.join(l,"bin")}}var qn=Na();const ne={rcPath:rt("~/.cpprc"),guard:"cpp"};async function Ph(){if(process.platform==="darwin")try{const e=await qn.getExecOutput("xcrun --sdk macosx --show-sdk-path"),t=e.stdout||e.stderr;t?await Pe("SDKROOT",t.trim(),ne):Ae("SDKROOT not set")}catch(e){Ae(e)}}let As;function Le(){return process.platform!=="linux"?!1:(As===void 0&&(As=de.sync("dnf",{nothrow:!0})!==null),As)}let Ns;function Te(){return process.platform!=="linux"?!1:(Ns===void 0&&(Ns=de.sync("pacman",{nothrow:!0})!==null),Ns)}async function Ne(e){for(const{name:r,version:n}of e)W(`Installing ${r} ${n!=null?n:""} via dnf`);const t=await Promise.all(e.map(r=>yE(r.name,r.version)));return me("dnf",["-y","install",...t]),{binDir:"/usr/bin/"}}async function yE(e,t){if(t===void 0||t==="")return e;const{stdout:r}=await fe("dnf",["search","-q",`${e}-${t}`]);if(r.trim()!=="")return`${e}-${t}`;const{stdout:n}=await fe("dnf",["search","-q",`${e}${t}`]);return n.trim()!==""?`${e}${t}`:(ve(`Failed to install ${e} ${t} via dnf, trying without version`),e)}let Yf=!1,Jf=!1;async function be(e,t,r){W(`Installing ${e} ${t!=null?t:""} via pacman`);const n="pacman";r==="yay"&&gE(),!Yf&&r!=="yay"&&(me(n,["-Sy","--noconfirm"]),Yf=!0),!Jf&&r!=="yay"&&(me(n,["-S","--noconfirm","base-devel"]),Jf=!0);const o=s=>r==="yay"?yr()&&Th?me("su",["-","builder","-c",`yay -S --noconfirm ${s}`]):ze(r,["-S","--noconfirm",s]):me(r!=null?r:n,["-S","--noconfirm",s]);if(t!==void 0&&t!=="")if((await vE(n,e)).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/"}}const wE=/Version\s*:\s*(.*)/g;async function vE(e,t){const r=[];try{const{stdout:n}=await fe(e,["-Si",t]);for(const o of n.matchAll(wE))r.push(o[1])}catch(n){ve(`Failed to get available versions for ${t}: ${n}`)}return r}let Th=!1;function gE(){if(de.sync("yay",{nothrow:!0})===null)try{me("pacman",["-S","--noconfirm","base-devel","git"]);const e=T.join(le.tmpdir(),"yay");me("mkdir",["-p",e]),yr()?(ve("Creating a non-root user to build yay"),me("useradd",["-m","-G","wheel","builder"]),me("passwd",["-d","builder"]),me("chown",["-R","builder:builder",e]),me("bash",["-c",'echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers']),Th=!0,ze("su",["-","builder","-c",`git clone https://aur.archlinux.org/yay.git ${e}`],{stdio:"inherit"}),ze("su",["-","builder","-c",`cd ${e} && makepkg -si --noconfirm`],{stdio:"inherit"})):(ze("git",["clone","https://aur.archlinux.org/yay.git",e],{stdio:"inherit",cwd:le.tmpdir()}),ze("makepkg",["-si","--noconfirm"],{stdio:"inherit",cwd:e})),ze("rm",["-rf",e],{stdio:"inherit"})}catch(e){throw new Error(`Failed to install yay: ${e}. Install yay manually and re-run the script.`)}}var _E=mp();const fr=Oe(_E);var EE=ft();const SE=Oe(EE);var bE=jr();const Xa=Oe(bE),xh=/v?(\d\S*)/;async function Ch(e,t=xh){var r,n;try{const o=await qn.getExecOutput(e,["--version"]),i=(r=(o.stdout||o.stderr||"").trim().match(t))==null?void 0:r[1];return(n=fr(i))!=null?n:void 0}catch(o){console.error(o);return}}async function _a(e,t,r=xh){const n=await Ch(e,r);if(n!==void 0&&t!=="")try{return SE(n,t)!==-1}catch{return Xa(n,t)}else return!1}function Ka(e){if(kn(e)===null)try{const t=fr(e);if(t!==null)return W(`Coerced version '${e}' to '${t}'`),t.version}catch{}return e}function RE(e){if(kn(e)===null)try{const t=fr(e);if(t!==null){const r=/^[<=>^~]/.test(t.version)?t.version:`^${t.version}`;return W(`Coerced version '${e}' to '${r}'`),r}}catch{}return e}function OE(e){return Number.parseInt(e.replace(/^v/,""),10)}function $E(e){return e.match(/^v/)?e:`v${e}`}function IE(e,t){const r=fr(e),n=fr(t);return r!==null&&n!==null?n.compare(r):t.localeCompare(e)}async function Ah(){const e=T.join(wS,"gcc_matcher.json");if(!await we(e))return ve("the gcc_matcher.json file does not exist in the same folder as setup-cpp.js");W(`::add-matcher::${e}`)}async function gn(e){const t=await Qt(e,"utf-8");return JSON.parse(t)}function _n(e,t){var l;const r=Object.keys(e),n=new Map;if(t.filterMapTag===void 0)for(const u of r)n.set(u,u);else for(const u of r){const a=t.filterMapTag(u);a!==void 0&&n.set(a,u)}if(n.size===0)return;const o=(l=t.versionSatisfies)!=null?l:Xa,s=RE(t.version),i=[];for(const[u,a]of n.entries())o(u,s)&&i.push(a);if(i.length!==0)for(const u of i){let a=e[u];if(a===void 0||(t.filterName!==void 0&&(a=a.filter(t.filterName)),a.length===0))continue;const c=PE(u,a,t);if(c!==void 0)return c}}function PE(e,t,r){if((r.keywords===void 0||r.keywords.length===0)&&(r.optionalKeywords===void 0||r.optionalKeywords.length===0))return{tag:e,name:t[0]};let n=[];if(r.keywords!==void 0&&r.keywords.length!==0)for(const o of t)r.keywords.every(s=>typeof s=="string"&&o.includes(s)?!0:Array.isArray(s)&&s.some(i=>o.includes(i)))&&n.push(o);else n=t;if(n.length!==0){if(r.optionalKeywords!==void 0&&r.optionalKeywords.length!==0){const o=n.map(l=>{let u=0;for(const a of r.optionalKeywords)(typeof a=="string"&&l.includes(a)||Array.isArray(a)&&a.some(c=>l.includes(c)))&&u++;return u}),s=Math.max(...o),i=o.indexOf(s);return{tag:e,name:n[i]}}return{tag:e,name:n[0]}}}var Ls={},Qr={},Qf;function Ue(){return Qf||(Qf=1,Qr.fromCallback=function(e){return Object.defineProperty(function(...t){if(typeof t[t.length-1]=="function")e.apply(this,t);else return new Promise((r,n)=>{t.push((o,s)=>o!=null?n(o):r(s)),e.apply(this,t)})},"name",{value:e.name})},Qr.fromPromise=function(e){return Object.defineProperty(function(...t){const r=t[t.length-1];if(typeof r!="function")return e.apply(this,t);t.pop(),e.apply(this,t).then(n=>r(null,n),r)},"name",{value:e.name})}),Qr}var Ds,Zf;function TE(){if(Zf)return Ds;Zf=1;var e=Tm,t=process.cwd,r=null,n=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return r||(r=t.call(process)),r};try{process.cwd()}catch{}if(typeof process.chdir=="function"){var o=process.chdir;process.chdir=function(i){r=null,o.call(process,i)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,o)}Ds=s;function s(i){e.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&l(i),i.lutimes||u(i),i.chown=m(i.chown),i.fchown=m(i.fchown),i.lchown=m(i.lchown),i.chmod=a(i.chmod),i.fchmod=a(i.fchmod),i.lchmod=a(i.lchmod),i.chownSync=p(i.chownSync),i.fchownSync=p(i.fchownSync),i.lchownSync=p(i.lchownSync),i.chmodSync=c(i.chmodSync),i.fchmodSync=c(i.fchmodSync),i.lchmodSync=c(i.lchmodSync),i.stat=v(i.stat),i.fstat=v(i.fstat),i.lstat=v(i.lstat),i.statSync=E(i.statSync),i.fstatSync=E(i.fstatSync),i.lstatSync=E(i.lstatSync),i.chmod&&!i.lchmod&&(i.lchmod=function(f,h,y){y&&process.nextTick(y)},i.lchmodSync=function(){}),i.chown&&!i.lchown&&(i.lchown=function(f,h,y,w){w&&process.nextTick(w)},i.lchownSync=function(){}),n==="win32"&&(i.rename=typeof i.rename!="function"?i.rename:function(f){function h(y,w,S){var _=Date.now(),b=0;f(y,w,function g(O){if(O&&(O.code==="EACCES"||O.code==="EPERM"||O.code==="EBUSY")&&Date.now()-_<6e4){setTimeout(function(){i.stat(w,function($,C){$&&$.code==="ENOENT"?f(y,w,g):S(O)})},b),b<100&&(b+=10);return}S&&S(O)})}return Object.setPrototypeOf&&Object.setPrototypeOf(h,f),h}(i.rename)),i.read=typeof i.read!="function"?i.read:function(f){function h(y,w,S,_,b,g){var O;if(g&&typeof g=="function"){var $=0;O=function(C,G,Y){if(C&&C.code==="EAGAIN"&&$<10)return $++,f.call(i,y,w,S,_,b,O);g.apply(this,arguments)}}return f.call(i,y,w,S,_,b,O)}return Object.setPrototypeOf&&Object.setPrototypeOf(h,f),h}(i.read),i.readSync=typeof i.readSync!="function"?i.readSync:function(f){return function(h,y,w,S,_){for(var b=0;;)try{return f.call(i,h,y,w,S,_)}catch(g){if(g.code==="EAGAIN"&&b<10){b++;continue}throw g}}}(i.readSync);function l(f){f.lchmod=function(h,y,w){f.open(h,e.O_WRONLY|e.O_SYMLINK,y,function(S,_){if(S){w&&w(S);return}f.fchmod(_,y,function(b){f.close(_,function(g){w&&w(b||g)})})})},f.lchmodSync=function(h,y){var w=f.openSync(h,e.O_WRONLY|e.O_SYMLINK,y),S=!0,_;try{_=f.fchmodSync(w,y),S=!1}finally{if(S)try{f.closeSync(w)}catch{}else f.closeSync(w)}return _}}function u(f){e.hasOwnProperty("O_SYMLINK")&&f.futimes?(f.lutimes=function(h,y,w,S){f.open(h,e.O_SYMLINK,function(_,b){if(_){S&&S(_);return}f.futimes(b,y,w,function(g){f.close(b,function(O){S&&S(g||O)})})})},f.lutimesSync=function(h,y,w){var S=f.openSync(h,e.O_SYMLINK),_,b=!0;try{_=f.futimesSync(S,y,w),b=!1}finally{if(b)try{f.closeSync(S)}catch{}else f.closeSync(S)}return _}):f.futimes&&(f.lutimes=function(h,y,w,S){S&&process.nextTick(S)},f.lutimesSync=function(){})}function a(f){return f&&function(h,y,w){return f.call(i,h,y,function(S){d(S)&&(S=null),w&&w.apply(this,arguments)})}}function c(f){return f&&function(h,y){try{return f.call(i,h,y)}catch(w){if(!d(w))throw w}}}function m(f){return f&&function(h,y,w,S){return f.call(i,h,y,w,function(_){d(_)&&(_=null),S&&S.apply(this,arguments)})}}function p(f){return f&&function(h,y,w){try{return f.call(i,h,y,w)}catch(S){if(!d(S))throw S}}}function v(f){return f&&function(h,y,w){typeof y=="function"&&(w=y,y=null);function S(_,b){b&&(b.uid<0&&(b.uid+=4294967296),b.gid<0&&(b.gid+=4294967296)),w&&w.apply(this,arguments)}return y?f.call(i,h,y,S):f.call(i,h,S)}}function E(f){return f&&function(h,y){var w=y?f.call(i,h,y):f.call(i,h);return w&&(w.uid<0&&(w.uid+=4294967296),w.gid<0&&(w.gid+=4294967296)),w}}function d(f){if(!f||f.code==="ENOSYS")return!0;var h=!process.getuid||process.getuid()!==0;return!!(h&&(f.code==="EINVAL"||f.code==="EPERM"))}}return Ds}var ks,ed;function xE(){if(ed)return ks;ed=1;var e=qr.Stream;ks=t;function t(r){return{ReadStream:n,WriteStream:o};function n(s,i){if(!(this instanceof n))return new n(s,i);e.call(this);var l=this;this.path=s,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var u=Object.keys(i),a=0,c=u.length;a<c;a++){var m=u[a];this[m]=i[m]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){l._read()});return}r.open(this.path,this.flags,this.mode,function(p,v){if(p){l.emit("error",p),l.readable=!1;return}l.fd=v,l.emit("open",v),l._read()})}function o(s,i){if(!(this instanceof o))return new o(s,i);e.call(this),this.path=s,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var l=Object.keys(i),u=0,a=l.length;u<a;u++){var c=l[u];this[c]=i[c]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=r.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}return ks}var qs,td;function CE(){if(td)return qs;td=1,qs=t;var e=Object.getPrototypeOf||function(r){return r.__proto__};function t(r){if(r===null||typeof r!="object")return r;if(r instanceof Object)var n={__proto__:e(r)};else var n=Object.create(null);return Object.getOwnPropertyNames(r).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(r,o))}),n}return qs}var Zr,rd;function Mr(){if(rd)return Zr;rd=1;var e=ae,t=TE(),r=xE(),n=CE(),o=pr,s,i;typeof Symbol=="function"&&typeof Symbol.for=="function"?(s=Symbol.for("graceful-fs.queue"),i=Symbol.for("graceful-fs.previous")):(s="___graceful-fs.queue",i="___graceful-fs.previous");function l(){}function u(f,h){Object.defineProperty(f,s,{get:function(){return h}})}var a=l;if(o.debuglog?a=o.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(a=function(){var f=o.format.apply(o,arguments);f="GFS4: "+f.split(/\n/).join(`
|
||
GFS4: `),console.error(f)}),!e[s]){var c=et[s]||[];u(e,c),e.close=function(f){function h(y,w){return f.call(e,y,function(S){S||E(),typeof w=="function"&&w.apply(this,arguments)})}return Object.defineProperty(h,i,{value:f}),h}(e.close),e.closeSync=function(f){function h(y){f.apply(e,arguments),E()}return Object.defineProperty(h,i,{value:f}),h}(e.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){a(e[s]),kr.equal(e[s].length,0)})}et[s]||u(et,e[s]),Zr=m(n(e)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!e.__patched&&(Zr=m(e),e.__patched=!0);function m(f){t(f),f.gracefulify=m,f.createReadStream=H,f.createWriteStream=X;var h=f.readFile;f.readFile=y;function y(K,ie,oe){return typeof ie=="function"&&(oe=ie,ie=null),_e(K,ie,oe);function _e(k,D,L,M){return h(k,D,function(z){z&&(z.code==="EMFILE"||z.code==="ENFILE")?p([_e,[k,D,L],z,M||Date.now(),Date.now()]):typeof L=="function"&&L.apply(this,arguments)})}}var w=f.writeFile;f.writeFile=S;function S(K,ie,oe,_e){return typeof oe=="function"&&(_e=oe,oe=null),k(K,ie,oe,_e);function k(D,L,M,z,ee){return w(D,L,M,function(J){J&&(J.code==="EMFILE"||J.code==="ENFILE")?p([k,[D,L,M,z],J,ee||Date.now(),Date.now()]):typeof z=="function"&&z.apply(this,arguments)})}}var _=f.appendFile;_&&(f.appendFile=b);function b(K,ie,oe,_e){return typeof oe=="function"&&(_e=oe,oe=null),k(K,ie,oe,_e);function k(D,L,M,z,ee){return _(D,L,M,function(J){J&&(J.code==="EMFILE"||J.code==="ENFILE")?p([k,[D,L,M,z],J,ee||Date.now(),Date.now()]):typeof z=="function"&&z.apply(this,arguments)})}}var g=f.copyFile;g&&(f.copyFile=O);function O(K,ie,oe,_e){return typeof oe=="function"&&(_e=oe,oe=0),k(K,ie,oe,_e);function k(D,L,M,z,ee){return g(D,L,M,function(J){J&&(J.code==="EMFILE"||J.code==="ENFILE")?p([k,[D,L,M,z],J,ee||Date.now(),Date.now()]):typeof z=="function"&&z.apply(this,arguments)})}}var $=f.readdir;f.readdir=G;var C=/^v[0-5]\./;function G(K,ie,oe){typeof ie=="function"&&(oe=ie,ie=null);var _e=C.test(process.version)?function(L,M,z,ee){return $(L,k(L,M,z,ee))}:function(L,M,z,ee){return $(L,M,k(L,M,z,ee))};return _e(K,ie,oe);function k(D,L,M,z){return function(ee,J){ee&&(ee.code==="EMFILE"||ee.code==="ENFILE")?p([_e,[D,L,M],ee,z||Date.now(),Date.now()]):(J&&J.sort&&J.sort(),typeof M=="function"&&M.call(this,ee,J))}}}if(process.version.substr(0,4)==="v0.8"){var Y=r(f);U=Y.ReadStream,V=Y.WriteStream}var Q=f.ReadStream;Q&&(U.prototype=Object.create(Q.prototype),U.prototype.open=q);var A=f.WriteStream;A&&(V.prototype=Object.create(A.prototype),V.prototype.open=N),Object.defineProperty(f,"ReadStream",{get:function(){return U},set:function(K){U=K},enumerable:!0,configurable:!0}),Object.defineProperty(f,"WriteStream",{get:function(){return V},set:function(K){V=K},enumerable:!0,configurable:!0});var x=U;Object.defineProperty(f,"FileReadStream",{get:function(){return x},set:function(K){x=K},enumerable:!0,configurable:!0});var F=V;Object.defineProperty(f,"FileWriteStream",{get:function(){return F},set:function(K){F=K},enumerable:!0,configurable:!0});function U(K,ie){return this instanceof U?(Q.apply(this,arguments),this):U.apply(Object.create(U.prototype),arguments)}function q(){var K=this;ue(K.path,K.flags,K.mode,function(ie,oe){ie?(K.autoClose&&K.destroy(),K.emit("error",ie)):(K.fd=oe,K.emit("open",oe),K.read())})}function V(K,ie){return this instanceof V?(A.apply(this,arguments),this):V.apply(Object.create(V.prototype),arguments)}function N(){var K=this;ue(K.path,K.flags,K.mode,function(ie,oe){ie?(K.destroy(),K.emit("error",ie)):(K.fd=oe,K.emit("open",oe))})}function H(K,ie){return new f.ReadStream(K,ie)}function X(K,ie){return new f.WriteStream(K,ie)}var re=f.open;f.open=ue;function ue(K,ie,oe,_e){return typeof oe=="function"&&(_e=oe,oe=null),k(K,ie,oe,_e);function k(D,L,M,z,ee){return re(D,L,M,function(J,qe){J&&(J.code==="EMFILE"||J.code==="ENFILE")?p([k,[D,L,M,z],J,ee||Date.now(),Date.now()]):typeof z=="function"&&z.apply(this,arguments)})}}return f}function p(f){a("ENQUEUE",f[0].name,f[1]),e[s].push(f),d()}var v;function E(){for(var f=Date.now(),h=0;h<e[s].length;++h)e[s][h].length>2&&(e[s][h][3]=f,e[s][h][4]=f);d()}function d(){if(clearTimeout(v),v=void 0,e[s].length!==0){var f=e[s].shift(),h=f[0],y=f[1],w=f[2],S=f[3],_=f[4];if(S===void 0)a("RETRY",h.name,y),h.apply(null,y);else if(Date.now()-S>=6e4){a("TIMEOUT",h.name,y);var b=y.pop();typeof b=="function"&&b.call(null,w)}else{var g=Date.now()-_,O=Math.max(_-S,1),$=Math.min(O*1.2,100);g>=$?(a("RETRY",h.name,y),h.apply(null,y.concat([S]))):e[s].push(f)}v===void 0&&(v=setTimeout(d,0))}}return Zr}var nd;function We(){return nd||(nd=1,function(e){const t=Ue().fromCallback,r=Mr(),n=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(o=>typeof r[o]=="function");Object.assign(e,r),n.forEach(o=>{e[o]=t(r[o])}),e.exists=function(o,s){return typeof s=="function"?r.exists(o,s):new Promise(i=>r.exists(o,i))},e.read=function(o,s,i,l,u,a){return typeof a=="function"?r.read(o,s,i,l,u,a):new Promise((c,m)=>{r.read(o,s,i,l,u,(p,v,E)=>{if(p)return m(p);c({bytesRead:v,buffer:E})})})},e.write=function(o,s,...i){return typeof i[i.length-1]=="function"?r.write(o,s,...i):new Promise((l,u)=>{r.write(o,s,...i,(a,c,m)=>{if(a)return u(a);l({bytesWritten:c,buffer:m})})})},e.readv=function(o,s,...i){return typeof i[i.length-1]=="function"?r.readv(o,s,...i):new Promise((l,u)=>{r.readv(o,s,...i,(a,c,m)=>{if(a)return u(a);l({bytesRead:c,buffers:m})})})},e.writev=function(o,s,...i){return typeof i[i.length-1]=="function"?r.writev(o,s,...i):new Promise((l,u)=>{r.writev(o,s,...i,(a,c,m)=>{if(a)return u(a);l({bytesWritten:c,buffers:m})})})},typeof r.realpath.native=="function"?e.realpath.native=t(r.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")}(Ls)),Ls}var en={},Fs={},id;function AE(){if(id)return Fs;id=1;const e=T;return Fs.checkPath=function(r){if(process.platform==="win32"&&/[<>:"|?*]/.test(r.replace(e.parse(r).root,""))){const o=new Error(`Path contains invalid characters: ${r}`);throw o.code="EINVAL",o}},Fs}var od;function NE(){if(od)return en;od=1;const e=We(),{checkPath:t}=AE(),r=n=>{const o={mode:511};return typeof n=="number"?n:{...o,...n}.mode};return en.makeDir=async(n,o)=>(t(n),e.mkdir(n,{mode:r(o),recursive:!0})),en.makeDirSync=(n,o)=>(t(n),e.mkdirSync(n,{mode:r(o),recursive:!0})),en}var js,sd;function Ct(){if(sd)return js;sd=1;const e=Ue().fromPromise,{makeDir:t,makeDirSync:r}=NE(),n=e(t);return js={mkdirs:n,mkdirsSync:r,mkdirp:n,mkdirpSync:r,ensureDir:n,ensureDirSync:r},js}var Us,ad;function ir(){if(ad)return Us;ad=1;const e=Ue().fromPromise,t=We();function r(n){return t.access(n).then(()=>!0).catch(()=>!1)}return Us={pathExists:e(r),pathExistsSync:t.existsSync},Us}var Ms,cd;function Nh(){if(cd)return Ms;cd=1;const e=We(),t=Ue().fromPromise;async function r(o,s,i){const l=await e.open(o,"r+");let u=null;try{await e.futimes(l,s,i)}finally{try{await e.close(l)}catch(a){u=a}}if(u)throw u}function n(o,s,i){const l=e.openSync(o,"r+");return e.futimesSync(l,s,i),e.closeSync(l)}return Ms={utimesMillis:t(r),utimesMillisSync:n},Ms}var Gs,ud;function Sr(){if(ud)return Gs;ud=1;const e=We(),t=T,r=Ue().fromPromise;function n(p,v,E){const d=E.dereference?f=>e.stat(f,{bigint:!0}):f=>e.lstat(f,{bigint:!0});return Promise.all([d(p),d(v).catch(f=>{if(f.code==="ENOENT")return null;throw f})]).then(([f,h])=>({srcStat:f,destStat:h}))}function o(p,v,E){let d;const f=E.dereference?y=>e.statSync(y,{bigint:!0}):y=>e.lstatSync(y,{bigint:!0}),h=f(p);try{d=f(v)}catch(y){if(y.code==="ENOENT")return{srcStat:h,destStat:null};throw y}return{srcStat:h,destStat:d}}async function s(p,v,E,d){const{srcStat:f,destStat:h}=await n(p,v,d);if(h){if(a(f,h)){const y=t.basename(p),w=t.basename(v);if(E==="move"&&y!==w&&y.toLowerCase()===w.toLowerCase())return{srcStat:f,destStat:h,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(f.isDirectory()&&!h.isDirectory())throw new Error(`Cannot overwrite non-directory '${v}' with directory '${p}'.`);if(!f.isDirectory()&&h.isDirectory())throw new Error(`Cannot overwrite directory '${v}' with non-directory '${p}'.`)}if(f.isDirectory()&&c(p,v))throw new Error(m(p,v,E));return{srcStat:f,destStat:h}}function i(p,v,E,d){const{srcStat:f,destStat:h}=o(p,v,d);if(h){if(a(f,h)){const y=t.basename(p),w=t.basename(v);if(E==="move"&&y!==w&&y.toLowerCase()===w.toLowerCase())return{srcStat:f,destStat:h,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(f.isDirectory()&&!h.isDirectory())throw new Error(`Cannot overwrite non-directory '${v}' with directory '${p}'.`);if(!f.isDirectory()&&h.isDirectory())throw new Error(`Cannot overwrite directory '${v}' with non-directory '${p}'.`)}if(f.isDirectory()&&c(p,v))throw new Error(m(p,v,E));return{srcStat:f,destStat:h}}async function l(p,v,E,d){const f=t.resolve(t.dirname(p)),h=t.resolve(t.dirname(E));if(h===f||h===t.parse(h).root)return;let y;try{y=await e.stat(h,{bigint:!0})}catch(w){if(w.code==="ENOENT")return;throw w}if(a(v,y))throw new Error(m(p,E,d));return l(p,v,h,d)}function u(p,v,E,d){const f=t.resolve(t.dirname(p)),h=t.resolve(t.dirname(E));if(h===f||h===t.parse(h).root)return;let y;try{y=e.statSync(h,{bigint:!0})}catch(w){if(w.code==="ENOENT")return;throw w}if(a(v,y))throw new Error(m(p,E,d));return u(p,v,h,d)}function a(p,v){return v.ino&&v.dev&&v.ino===p.ino&&v.dev===p.dev}function c(p,v){const E=t.resolve(p).split(t.sep).filter(f=>f),d=t.resolve(v).split(t.sep).filter(f=>f);return E.every((f,h)=>d[h]===f)}function m(p,v,E){return`Cannot ${E} '${p}' to a subdirectory of itself, '${v}'.`}return Gs={checkPaths:r(s),checkPathsSync:i,checkParentPaths:r(l),checkParentPathsSync:u,isSrcSubdir:c,areIdentical:a},Gs}var Vs,ld;function LE(){if(ld)return Vs;ld=1;const e=We(),t=T,{mkdirs:r}=Ct(),{pathExists:n}=ir(),{utimesMillis:o}=Nh(),s=Sr();async function i(d,f,h={}){typeof h=="function"&&(h={filter:h}),h.clobber="clobber"in h?!!h.clobber:!0,h.overwrite="overwrite"in h?!!h.overwrite:h.clobber,h.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
||
|
||
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");const{srcStat:y,destStat:w}=await s.checkPaths(d,f,"copy",h);if(await s.checkParentPaths(d,y,f,"copy"),!await l(d,f,h))return;const _=t.dirname(f);await n(_)||await r(_),await u(w,d,f,h)}async function l(d,f,h){return h.filter?h.filter(d,f):!0}async function u(d,f,h,y){const S=await(y.dereference?e.stat:e.lstat)(f);if(S.isDirectory())return v(S,d,f,h,y);if(S.isFile()||S.isCharacterDevice()||S.isBlockDevice())return a(S,d,f,h,y);if(S.isSymbolicLink())return E(d,f,h,y);throw S.isSocket()?new Error(`Cannot copy a socket file: ${f}`):S.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${f}`):new Error(`Unknown file: ${f}`)}async function a(d,f,h,y,w){if(!f)return c(d,h,y,w);if(w.overwrite)return await e.unlink(y),c(d,h,y,w);if(w.errorOnExist)throw new Error(`'${y}' already exists`)}async function c(d,f,h,y){if(await e.copyFile(f,h),y.preserveTimestamps){m(d.mode)&&await p(h,d.mode);const w=await e.stat(f);await o(h,w.atime,w.mtime)}return e.chmod(h,d.mode)}function m(d){return(d&128)===0}function p(d,f){return e.chmod(d,f|128)}async function v(d,f,h,y,w){f||await e.mkdir(y);const S=[];for await(const _ of await e.opendir(h)){const b=t.join(h,_.name),g=t.join(y,_.name);S.push(l(b,g,w).then(O=>{if(O)return s.checkPaths(b,g,"copy",w).then(({destStat:$})=>u($,b,g,w))}))}await Promise.all(S),f||await e.chmod(y,d.mode)}async function E(d,f,h,y){let w=await e.readlink(f);if(y.dereference&&(w=t.resolve(process.cwd(),w)),!d)return e.symlink(w,h);let S=null;try{S=await e.readlink(h)}catch(_){if(_.code==="EINVAL"||_.code==="UNKNOWN")return e.symlink(w,h);throw _}if(y.dereference&&(S=t.resolve(process.cwd(),S)),s.isSrcSubdir(w,S))throw new Error(`Cannot copy '${w}' to a subdirectory of itself, '${S}'.`);if(s.isSrcSubdir(S,w))throw new Error(`Cannot overwrite '${S}' with '${w}'.`);return await e.unlink(h),e.symlink(w,h)}return Vs=i,Vs}var Bs,fd;function DE(){if(fd)return Bs;fd=1;const e=Mr(),t=T,r=Ct().mkdirsSync,n=Nh().utimesMillisSync,o=Sr();function s(_,b,g){typeof g=="function"&&(g={filter:g}),g=g||{},g.clobber="clobber"in g?!!g.clobber:!0,g.overwrite="overwrite"in g?!!g.overwrite:g.clobber,g.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
||
|
||
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");const{srcStat:O,destStat:$}=o.checkPathsSync(_,b,"copy",g);if(o.checkParentPathsSync(_,O,b,"copy"),g.filter&&!g.filter(_,b))return;const C=t.dirname(b);return e.existsSync(C)||r(C),i($,_,b,g)}function i(_,b,g,O){const C=(O.dereference?e.statSync:e.lstatSync)(b);if(C.isDirectory())return d(C,_,b,g,O);if(C.isFile()||C.isCharacterDevice()||C.isBlockDevice())return l(C,_,b,g,O);if(C.isSymbolicLink())return w(_,b,g,O);throw C.isSocket()?new Error(`Cannot copy a socket file: ${b}`):C.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${b}`):new Error(`Unknown file: ${b}`)}function l(_,b,g,O,$){return b?u(_,g,O,$):a(_,g,O,$)}function u(_,b,g,O){if(O.overwrite)return e.unlinkSync(g),a(_,b,g,O);if(O.errorOnExist)throw new Error(`'${g}' already exists`)}function a(_,b,g,O){return e.copyFileSync(b,g),O.preserveTimestamps&&c(_.mode,b,g),v(g,_.mode)}function c(_,b,g){return m(_)&&p(g,_),E(b,g)}function m(_){return(_&128)===0}function p(_,b){return v(_,b|128)}function v(_,b){return e.chmodSync(_,b)}function E(_,b){const g=e.statSync(_);return n(b,g.atime,g.mtime)}function d(_,b,g,O,$){return b?h(g,O,$):f(_.mode,g,O,$)}function f(_,b,g,O){return e.mkdirSync(g),h(b,g,O),v(g,_)}function h(_,b,g){const O=e.opendirSync(_);try{let $;for(;($=O.readSync())!==null;)y($.name,_,b,g)}finally{O.closeSync()}}function y(_,b,g,O){const $=t.join(b,_),C=t.join(g,_);if(O.filter&&!O.filter($,C))return;const{destStat:G}=o.checkPathsSync($,C,"copy",O);return i(G,$,C,O)}function w(_,b,g,O){let $=e.readlinkSync(b);if(O.dereference&&($=t.resolve(process.cwd(),$)),_){let C;try{C=e.readlinkSync(g)}catch(G){if(G.code==="EINVAL"||G.code==="UNKNOWN")return e.symlinkSync($,g);throw G}if(O.dereference&&(C=t.resolve(process.cwd(),C)),o.isSrcSubdir($,C))throw new Error(`Cannot copy '${$}' to a subdirectory of itself, '${C}'.`);if(o.isSrcSubdir(C,$))throw new Error(`Cannot overwrite '${C}' with '${$}'.`);return S($,g)}else return e.symlinkSync($,g)}function S(_,b){return e.unlinkSync(b),e.symlinkSync(_,b)}return Bs=s,Bs}var zs,dd;function Ya(){if(dd)return zs;dd=1;const e=Ue().fromPromise;return zs={copy:e(LE()),copySync:DE()},zs}var Hs,pd;function Fn(){if(pd)return Hs;pd=1;const e=Mr(),t=Ue().fromCallback;function r(o,s){e.rm(o,{recursive:!0,force:!0},s)}function n(o){e.rmSync(o,{recursive:!0,force:!0})}return Hs={remove:t(r),removeSync:n},Hs}var Ws,hd;function kE(){if(hd)return Ws;hd=1;const e=Ue().fromPromise,t=We(),r=T,n=Ct(),o=Fn(),s=e(async function(u){let a;try{a=await t.readdir(u)}catch{return n.mkdirs(u)}return Promise.all(a.map(c=>o.remove(r.join(u,c))))});function i(l){let u;try{u=t.readdirSync(l)}catch{return n.mkdirsSync(l)}u.forEach(a=>{a=r.join(l,a),o.removeSync(a)})}return Ws={emptyDirSync:i,emptydirSync:i,emptyDir:s,emptydir:s},Ws}var Xs,md;function qE(){if(md)return Xs;md=1;const e=Ue().fromPromise,t=T,r=We(),n=Ct();async function o(i){let l;try{l=await r.stat(i)}catch{}if(l&&l.isFile())return;const u=t.dirname(i);let a=null;try{a=await r.stat(u)}catch(c){if(c.code==="ENOENT"){await n.mkdirs(u),await r.writeFile(i,"");return}else throw c}a.isDirectory()?await r.writeFile(i,""):await r.readdir(u)}function s(i){let l;try{l=r.statSync(i)}catch{}if(l&&l.isFile())return;const u=t.dirname(i);try{r.statSync(u).isDirectory()||r.readdirSync(u)}catch(a){if(a&&a.code==="ENOENT")n.mkdirsSync(u);else throw a}r.writeFileSync(i,"")}return Xs={createFile:e(o),createFileSync:s},Xs}var Ks,yd;function FE(){if(yd)return Ks;yd=1;const e=Ue().fromPromise,t=T,r=We(),n=Ct(),{pathExists:o}=ir(),{areIdentical:s}=Sr();async function i(u,a){let c;try{c=await r.lstat(a)}catch{}let m;try{m=await r.lstat(u)}catch(E){throw E.message=E.message.replace("lstat","ensureLink"),E}if(c&&s(m,c))return;const p=t.dirname(a);await o(p)||await n.mkdirs(p),await r.link(u,a)}function l(u,a){let c;try{c=r.lstatSync(a)}catch{}try{const v=r.lstatSync(u);if(c&&s(v,c))return}catch(v){throw v.message=v.message.replace("lstat","ensureLink"),v}const m=t.dirname(a);return r.existsSync(m)||n.mkdirsSync(m),r.linkSync(u,a)}return Ks={createLink:e(i),createLinkSync:l},Ks}var Ys,wd;function jE(){if(wd)return Ys;wd=1;const e=T,t=We(),{pathExists:r}=ir(),n=Ue().fromPromise;async function o(i,l){if(e.isAbsolute(i)){try{await t.lstat(i)}catch(m){throw m.message=m.message.replace("lstat","ensureSymlink"),m}return{toCwd:i,toDst:i}}const u=e.dirname(l),a=e.join(u,i);if(await r(a))return{toCwd:a,toDst:i};try{await t.lstat(i)}catch(m){throw m.message=m.message.replace("lstat","ensureSymlink"),m}return{toCwd:i,toDst:e.relative(u,i)}}function s(i,l){if(e.isAbsolute(i)){if(!t.existsSync(i))throw new Error("absolute srcpath does not exist");return{toCwd:i,toDst:i}}const u=e.dirname(l),a=e.join(u,i);if(t.existsSync(a))return{toCwd:a,toDst:i};if(!t.existsSync(i))throw new Error("relative srcpath does not exist");return{toCwd:i,toDst:e.relative(u,i)}}return Ys={symlinkPaths:n(o),symlinkPathsSync:s},Ys}var Js,vd;function UE(){if(vd)return Js;vd=1;const e=We(),t=Ue().fromPromise;async function r(o,s){if(s)return s;let i;try{i=await e.lstat(o)}catch{return"file"}return i&&i.isDirectory()?"dir":"file"}function n(o,s){if(s)return s;let i;try{i=e.lstatSync(o)}catch{return"file"}return i&&i.isDirectory()?"dir":"file"}return Js={symlinkType:t(r),symlinkTypeSync:n},Js}var Qs,gd;function ME(){if(gd)return Qs;gd=1;const e=Ue().fromPromise,t=T,r=We(),{mkdirs:n,mkdirsSync:o}=Ct(),{symlinkPaths:s,symlinkPathsSync:i}=jE(),{symlinkType:l,symlinkTypeSync:u}=UE(),{pathExists:a}=ir(),{areIdentical:c}=Sr();async function m(v,E,d){let f;try{f=await r.lstat(E)}catch{}if(f&&f.isSymbolicLink()){const[S,_]=await Promise.all([r.stat(v),r.stat(E)]);if(c(S,_))return}const h=await s(v,E);v=h.toDst;const y=await l(h.toCwd,d),w=t.dirname(E);return await a(w)||await n(w),r.symlink(v,E,y)}function p(v,E,d){let f;try{f=r.lstatSync(E)}catch{}if(f&&f.isSymbolicLink()){const S=r.statSync(v),_=r.statSync(E);if(c(S,_))return}const h=i(v,E);v=h.toDst,d=u(h.toCwd,d);const y=t.dirname(E);return r.existsSync(y)||o(y),r.symlinkSync(v,E,d)}return Qs={createSymlink:e(m),createSymlinkSync:p},Qs}var Zs,_d;function GE(){if(_d)return Zs;_d=1;const{createFile:e,createFileSync:t}=qE(),{createLink:r,createLinkSync:n}=FE(),{createSymlink:o,createSymlinkSync:s}=ME();return Zs={createFile:e,createFileSync:t,ensureFile:e,ensureFileSync:t,createLink:r,createLinkSync:n,ensureLink:r,ensureLinkSync:n,createSymlink:o,createSymlinkSync:s,ensureSymlink:o,ensureSymlinkSync:s},Zs}var ea,Ed;function Ja(){if(Ed)return ea;Ed=1;function e(r,{EOL:n=`
|
||
`,finalEOL:o=!0,replacer:s=null,spaces:i}={}){const l=o?n:"";return JSON.stringify(r,s,i).replace(/\n/g,n)+l}function t(r){return Buffer.isBuffer(r)&&(r=r.toString("utf8")),r.replace(/^\uFEFF/,"")}return ea={stringify:e,stripBom:t},ea}var ta,Sd;function VE(){if(Sd)return ta;Sd=1;let e;try{e=Mr()}catch{e=ae}const t=Ue(),{stringify:r,stripBom:n}=Ja();async function o(m,p={}){typeof p=="string"&&(p={encoding:p});const v=p.fs||e,E="throws"in p?p.throws:!0;let d=await t.fromCallback(v.readFile)(m,p);d=n(d);let f;try{f=JSON.parse(d,p?p.reviver:null)}catch(h){if(E)throw h.message=`${m}: ${h.message}`,h;return null}return f}const s=t.fromPromise(o);function i(m,p={}){typeof p=="string"&&(p={encoding:p});const v=p.fs||e,E="throws"in p?p.throws:!0;try{let d=v.readFileSync(m,p);return d=n(d),JSON.parse(d,p.reviver)}catch(d){if(E)throw d.message=`${m}: ${d.message}`,d;return null}}async function l(m,p,v={}){const E=v.fs||e,d=r(p,v);await t.fromCallback(E.writeFile)(m,d,v)}const u=t.fromPromise(l);function a(m,p,v={}){const E=v.fs||e,d=r(p,v);return E.writeFileSync(m,d,v)}return ta={readFile:s,readFileSync:i,writeFile:u,writeFileSync:a},ta}var ra,bd;function BE(){if(bd)return ra;bd=1;const e=VE();return ra={readJson:e.readFile,readJsonSync:e.readFileSync,writeJson:e.writeFile,writeJsonSync:e.writeFileSync},ra}var na,Rd;function Qa(){if(Rd)return na;Rd=1;const e=Ue().fromPromise,t=We(),r=T,n=Ct(),o=ir().pathExists;async function s(l,u,a="utf-8"){const c=r.dirname(l);return await o(c)||await n.mkdirs(c),t.writeFile(l,u,a)}function i(l,...u){const a=r.dirname(l);t.existsSync(a)||n.mkdirsSync(a),t.writeFileSync(l,...u)}return na={outputFile:e(s),outputFileSync:i},na}var ia,Od;function zE(){if(Od)return ia;Od=1;const{stringify:e}=Ja(),{outputFile:t}=Qa();async function r(n,o,s={}){const i=e(o,s);await t(n,i,s)}return ia=r,ia}var oa,$d;function HE(){if($d)return oa;$d=1;const{stringify:e}=Ja(),{outputFileSync:t}=Qa();function r(n,o,s){const i=e(o,s);t(n,i,s)}return oa=r,oa}var sa,Id;function WE(){if(Id)return sa;Id=1;const e=Ue().fromPromise,t=BE();return t.outputJson=e(zE()),t.outputJsonSync=HE(),t.outputJSON=t.outputJson,t.outputJSONSync=t.outputJsonSync,t.writeJSON=t.writeJson,t.writeJSONSync=t.writeJsonSync,t.readJSON=t.readJson,t.readJSONSync=t.readJsonSync,sa=t,sa}var aa,Pd;function XE(){if(Pd)return aa;Pd=1;const e=We(),t=T,{copy:r}=Ya(),{remove:n}=Fn(),{mkdirp:o}=Ct(),{pathExists:s}=ir(),i=Sr();async function l(c,m,p={}){const v=p.overwrite||p.clobber||!1,{srcStat:E,isChangingCase:d=!1}=await i.checkPaths(c,m,"move",p);await i.checkParentPaths(c,E,m,"move");const f=t.dirname(m);return t.parse(f).root!==f&&await o(f),u(c,m,v,d)}async function u(c,m,p,v){if(!v){if(p)await n(m);else if(await s(m))throw new Error("dest already exists.")}try{await e.rename(c,m)}catch(E){if(E.code!=="EXDEV")throw E;await a(c,m,p)}}async function a(c,m,p){return await r(c,m,{overwrite:p,errorOnExist:!0,preserveTimestamps:!0}),n(c)}return aa=l,aa}var ca,Td;function KE(){if(Td)return ca;Td=1;const e=Mr(),t=T,r=Ya().copySync,n=Fn().removeSync,o=Ct().mkdirpSync,s=Sr();function i(m,p,v){v=v||{};const E=v.overwrite||v.clobber||!1,{srcStat:d,isChangingCase:f=!1}=s.checkPathsSync(m,p,"move",v);return s.checkParentPathsSync(m,d,p,"move"),l(p)||o(t.dirname(p)),u(m,p,E,f)}function l(m){const p=t.dirname(m);return t.parse(p).root===p}function u(m,p,v,E){if(E)return a(m,p,v);if(v)return n(p),a(m,p,v);if(e.existsSync(p))throw new Error("dest already exists.");return a(m,p,v)}function a(m,p,v){try{e.renameSync(m,p)}catch(E){if(E.code!=="EXDEV")throw E;return c(m,p,v)}}function c(m,p,v){return r(m,p,{overwrite:v,errorOnExist:!0,preserveTimestamps:!0}),n(m)}return ca=i,ca}var ua,xd;function YE(){if(xd)return ua;xd=1;const e=Ue().fromPromise;return ua={move:e(XE()),moveSync:KE()},ua}var la,Cd;function JE(){return Cd||(Cd=1,la={...We(),...Ya(),...kE(),...GE(),...WE(),...Ct(),...YE(),...Qa(),...ir(),...Fn()}),la}var Tt=JE();let kt;async function Lh(e){var i;if(process.platform!=="win32")return;if(typeof kt=="string")return{binDir:kt};const t=de.sync("choco",{nothrow:!0});if(t!==null)return kt=T.dirname(t),{binDir:kt};let r="powershell.exe";const n=de.sync(`${process.env.SystemRoot}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,{nothrow:!0});n!==null&&(r=n),ze(r,["-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 o=`${process.env.ALLUSERSPROFILE}\\chocolatey\\bin`;await $e(o,ne);const s=de.sync("choco",{nothrow:!0});if(s!==null?kt=T.dirname(s):kt=`${(i=process.env.ChocolateyInstall)!=null?i:"C:/ProgramData/chocolatey"}/bin`,await we(kt))return{binDir:kt}}let Ad=!1;async function De(e,t,r=[]){var i;W(`Installing ${e} ${t!=null?t:""} via chocolatey`),(!Ad||de.sync("choco",{nothrow:!0})===null)&&(await Lh(),Ad=!0);const n=process.env.PATH,o={...process.env};if(o.TMP=void 0,o.TEMP=void 0,o.Path=void 0,o.PATH=n,t!==void 0&&t!=="")ze("choco",["install","-y",e,`--version=${t}`,...r],{env:o,extendEnv:!1,stdio:"inherit"});else try{ze("choco",["install","-y",e,...r],{env:o,extendEnv:!1,stdio:"inherit"})}catch(l){if(l.message.includes("exit code 3010"))W(`${e} might require a reboot for the completion of the installation.`);else throw l}const s=`${(i=process.env.ChocolateyInstall)!=null?i:"C:/ProgramData/chocolatey"}/bin`;return await $e(s,ne),{binDir:s}}async function an({version:e}={}){switch(process.platform){case"win32":return De("7zip",e);case"darwin":return Me("p7zip",e);case"linux":{if(Te())return be("p7zip",e);if(Le())return Ne([{name:"p7zip",version:e},{name:"p7zip-plugins",version:e}]);if(ye())return pe([{name:"p7zip-full",version:e}]);if(await Ie())return ke([{name:"p7zip",version:e}]);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}var ce={},Pr={exports:{}},tn={exports:{}},Nd;function Dh(){return Nd||(Nd=1,function(e,t){t=e.exports=g;var r;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?r=function(){var R=Array.prototype.slice.call(arguments,0);R.unshift("SEMVER"),console.log.apply(console,R)}:r=function(){},t.SEMVER_SPEC_VERSION="2.0.0";var n=256,o=Number.MAX_SAFE_INTEGER||9007199254740991,s=16,i=n-6,l=t.re=[],u=t.safeRe=[],a=t.src=[],c=t.tokens={},m=0;function p(R){c[R]=m++}var v="[a-zA-Z0-9-]",E=[["\\s",1],["\\d",n],[v,i]];function d(R){for(var I=0;I<E.length;I++){var P=E[I][0],j=E[I][1];R=R.split(P+"*").join(P+"{0,"+j+"}").split(P+"+").join(P+"{1,"+j+"}")}return R}p("NUMERICIDENTIFIER"),a[c.NUMERICIDENTIFIER]="0|[1-9]\\d*",p("NUMERICIDENTIFIERLOOSE"),a[c.NUMERICIDENTIFIERLOOSE]="\\d+",p("NONNUMERICIDENTIFIER"),a[c.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-]"+v+"*",p("MAINVERSION"),a[c.MAINVERSION]="("+a[c.NUMERICIDENTIFIER]+")\\.("+a[c.NUMERICIDENTIFIER]+")\\.("+a[c.NUMERICIDENTIFIER]+")",p("MAINVERSIONLOOSE"),a[c.MAINVERSIONLOOSE]="("+a[c.NUMERICIDENTIFIERLOOSE]+")\\.("+a[c.NUMERICIDENTIFIERLOOSE]+")\\.("+a[c.NUMERICIDENTIFIERLOOSE]+")",p("PRERELEASEIDENTIFIER"),a[c.PRERELEASEIDENTIFIER]="(?:"+a[c.NUMERICIDENTIFIER]+"|"+a[c.NONNUMERICIDENTIFIER]+")",p("PRERELEASEIDENTIFIERLOOSE"),a[c.PRERELEASEIDENTIFIERLOOSE]="(?:"+a[c.NUMERICIDENTIFIERLOOSE]+"|"+a[c.NONNUMERICIDENTIFIER]+")",p("PRERELEASE"),a[c.PRERELEASE]="(?:-("+a[c.PRERELEASEIDENTIFIER]+"(?:\\."+a[c.PRERELEASEIDENTIFIER]+")*))",p("PRERELEASELOOSE"),a[c.PRERELEASELOOSE]="(?:-?("+a[c.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+a[c.PRERELEASEIDENTIFIERLOOSE]+")*))",p("BUILDIDENTIFIER"),a[c.BUILDIDENTIFIER]=v+"+",p("BUILD"),a[c.BUILD]="(?:\\+("+a[c.BUILDIDENTIFIER]+"(?:\\."+a[c.BUILDIDENTIFIER]+")*))",p("FULL"),p("FULLPLAIN"),a[c.FULLPLAIN]="v?"+a[c.MAINVERSION]+a[c.PRERELEASE]+"?"+a[c.BUILD]+"?",a[c.FULL]="^"+a[c.FULLPLAIN]+"$",p("LOOSEPLAIN"),a[c.LOOSEPLAIN]="[v=\\s]*"+a[c.MAINVERSIONLOOSE]+a[c.PRERELEASELOOSE]+"?"+a[c.BUILD]+"?",p("LOOSE"),a[c.LOOSE]="^"+a[c.LOOSEPLAIN]+"$",p("GTLT"),a[c.GTLT]="((?:<|>)?=?)",p("XRANGEIDENTIFIERLOOSE"),a[c.XRANGEIDENTIFIERLOOSE]=a[c.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",p("XRANGEIDENTIFIER"),a[c.XRANGEIDENTIFIER]=a[c.NUMERICIDENTIFIER]+"|x|X|\\*",p("XRANGEPLAIN"),a[c.XRANGEPLAIN]="[v=\\s]*("+a[c.XRANGEIDENTIFIER]+")(?:\\.("+a[c.XRANGEIDENTIFIER]+")(?:\\.("+a[c.XRANGEIDENTIFIER]+")(?:"+a[c.PRERELEASE]+")?"+a[c.BUILD]+"?)?)?",p("XRANGEPLAINLOOSE"),a[c.XRANGEPLAINLOOSE]="[v=\\s]*("+a[c.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+a[c.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+a[c.XRANGEIDENTIFIERLOOSE]+")(?:"+a[c.PRERELEASELOOSE]+")?"+a[c.BUILD]+"?)?)?",p("XRANGE"),a[c.XRANGE]="^"+a[c.GTLT]+"\\s*"+a[c.XRANGEPLAIN]+"$",p("XRANGELOOSE"),a[c.XRANGELOOSE]="^"+a[c.GTLT]+"\\s*"+a[c.XRANGEPLAINLOOSE]+"$",p("COERCE"),a[c.COERCE]="(^|[^\\d])(\\d{1,"+s+"})(?:\\.(\\d{1,"+s+"}))?(?:\\.(\\d{1,"+s+"}))?(?:$|[^\\d])",p("COERCERTL"),l[c.COERCERTL]=new RegExp(a[c.COERCE],"g"),u[c.COERCERTL]=new RegExp(d(a[c.COERCE]),"g"),p("LONETILDE"),a[c.LONETILDE]="(?:~>?)",p("TILDETRIM"),a[c.TILDETRIM]="(\\s*)"+a[c.LONETILDE]+"\\s+",l[c.TILDETRIM]=new RegExp(a[c.TILDETRIM],"g"),u[c.TILDETRIM]=new RegExp(d(a[c.TILDETRIM]),"g");var f="$1~";p("TILDE"),a[c.TILDE]="^"+a[c.LONETILDE]+a[c.XRANGEPLAIN]+"$",p("TILDELOOSE"),a[c.TILDELOOSE]="^"+a[c.LONETILDE]+a[c.XRANGEPLAINLOOSE]+"$",p("LONECARET"),a[c.LONECARET]="(?:\\^)",p("CARETTRIM"),a[c.CARETTRIM]="(\\s*)"+a[c.LONECARET]+"\\s+",l[c.CARETTRIM]=new RegExp(a[c.CARETTRIM],"g"),u[c.CARETTRIM]=new RegExp(d(a[c.CARETTRIM]),"g");var h="$1^";p("CARET"),a[c.CARET]="^"+a[c.LONECARET]+a[c.XRANGEPLAIN]+"$",p("CARETLOOSE"),a[c.CARETLOOSE]="^"+a[c.LONECARET]+a[c.XRANGEPLAINLOOSE]+"$",p("COMPARATORLOOSE"),a[c.COMPARATORLOOSE]="^"+a[c.GTLT]+"\\s*("+a[c.LOOSEPLAIN]+")$|^$",p("COMPARATOR"),a[c.COMPARATOR]="^"+a[c.GTLT]+"\\s*("+a[c.FULLPLAIN]+")$|^$",p("COMPARATORTRIM"),a[c.COMPARATORTRIM]="(\\s*)"+a[c.GTLT]+"\\s*("+a[c.LOOSEPLAIN]+"|"+a[c.XRANGEPLAIN]+")",l[c.COMPARATORTRIM]=new RegExp(a[c.COMPARATORTRIM],"g"),u[c.COMPARATORTRIM]=new RegExp(d(a[c.COMPARATORTRIM]),"g");var y="$1$2$3";p("HYPHENRANGE"),a[c.HYPHENRANGE]="^\\s*("+a[c.XRANGEPLAIN]+")\\s+-\\s+("+a[c.XRANGEPLAIN]+")\\s*$",p("HYPHENRANGELOOSE"),a[c.HYPHENRANGELOOSE]="^\\s*("+a[c.XRANGEPLAINLOOSE]+")\\s+-\\s+("+a[c.XRANGEPLAINLOOSE]+")\\s*$",p("STAR"),a[c.STAR]="(<|>)?=?\\s*\\*";for(var w=0;w<m;w++)r(w,a[w]),l[w]||(l[w]=new RegExp(a[w]),u[w]=new RegExp(d(a[w])));t.parse=S;function S(R,I){if((!I||typeof I!="object")&&(I={loose:!!I,includePrerelease:!1}),R instanceof g)return R;if(typeof R!="string"||R.length>n)return null;var P=I.loose?u[c.LOOSE]:u[c.FULL];if(!P.test(R))return null;try{return new g(R,I)}catch{return null}}t.valid=_;function _(R,I){var P=S(R,I);return P?P.version:null}t.clean=b;function b(R,I){var P=S(R.trim().replace(/^[=v]+/,""),I);return P?P.version:null}t.SemVer=g;function g(R,I){if((!I||typeof I!="object")&&(I={loose:!!I,includePrerelease:!1}),R instanceof g){if(R.loose===I.loose)return R;R=R.version}else if(typeof R!="string")throw new TypeError("Invalid Version: "+R);if(R.length>n)throw new TypeError("version is longer than "+n+" characters");if(!(this instanceof g))return new g(R,I);r("SemVer",R,I),this.options=I,this.loose=!!I.loose;var P=R.trim().match(I.loose?u[c.LOOSE]:u[c.FULL]);if(!P)throw new TypeError("Invalid Version: "+R);if(this.raw=R,this.major=+P[1],this.minor=+P[2],this.patch=+P[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");P[4]?this.prerelease=P[4].split(".").map(function(j){if(/^[0-9]+$/.test(j)){var B=+j;if(B>=0&&B<o)return B}return j}):this.prerelease=[],this.build=P[5]?P[5].split("."):[],this.format()}g.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},g.prototype.toString=function(){return this.version},g.prototype.compare=function(R){return r("SemVer.compare",this.version,this.options,R),R instanceof g||(R=new g(R,this.options)),this.compareMain(R)||this.comparePre(R)},g.prototype.compareMain=function(R){return R instanceof g||(R=new g(R,this.options)),G(this.major,R.major)||G(this.minor,R.minor)||G(this.patch,R.patch)},g.prototype.comparePre=function(R){if(R instanceof g||(R=new g(R,this.options)),this.prerelease.length&&!R.prerelease.length)return-1;if(!this.prerelease.length&&R.prerelease.length)return 1;if(!this.prerelease.length&&!R.prerelease.length)return 0;var I=0;do{var P=this.prerelease[I],j=R.prerelease[I];if(r("prerelease compare",I,P,j),P===void 0&&j===void 0)return 0;if(j===void 0)return 1;if(P===void 0)return-1;if(P===j)continue;return G(P,j)}while(++I)},g.prototype.compareBuild=function(R){R instanceof g||(R=new g(R,this.options));var I=0;do{var P=this.build[I],j=R.build[I];if(r("prerelease compare",I,P,j),P===void 0&&j===void 0)return 0;if(j===void 0)return 1;if(P===void 0)return-1;if(P===j)continue;return G(P,j)}while(++I)},g.prototype.inc=function(R,I){switch(R){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",I);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",I);break;case"prepatch":this.prerelease.length=0,this.inc("patch",I),this.inc("pre",I);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",I),this.inc("pre",I);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{for(var P=this.prerelease.length;--P>=0;)typeof this.prerelease[P]=="number"&&(this.prerelease[P]++,P=-2);P===-1&&this.prerelease.push(0)}I&&(this.prerelease[0]===I?isNaN(this.prerelease[1])&&(this.prerelease=[I,0]):this.prerelease=[I,0]);break;default:throw new Error("invalid increment argument: "+R)}return this.format(),this.raw=this.version,this},t.inc=O;function O(R,I,P,j){typeof P=="string"&&(j=P,P=void 0);try{return new g(R,P).inc(I,j).version}catch{return null}}t.diff=$;function $(R,I){if(ue(R,I))return null;var P=S(R),j=S(I),B="";if(P.prerelease.length||j.prerelease.length){B="pre";var Z="prerelease"}for(var te in P)if((te==="major"||te==="minor"||te==="patch")&&P[te]!==j[te])return B+te;return Z}t.compareIdentifiers=G;var C=/^[0-9]+$/;function G(R,I){var P=C.test(R),j=C.test(I);return P&&j&&(R=+R,I=+I),R===I?0:P&&!j?-1:j&&!P?1:R<I?-1:1}t.rcompareIdentifiers=Y;function Y(R,I){return G(I,R)}t.major=Q;function Q(R,I){return new g(R,I).major}t.minor=A;function A(R,I){return new g(R,I).minor}t.patch=x;function x(R,I){return new g(R,I).patch}t.compare=F;function F(R,I,P){return new g(R,P).compare(new g(I,P))}t.compareLoose=U;function U(R,I){return F(R,I,!0)}t.compareBuild=q;function q(R,I,P){var j=new g(R,P),B=new g(I,P);return j.compare(B)||j.compareBuild(B)}t.rcompare=V;function V(R,I,P){return F(I,R,P)}t.sort=N;function N(R,I){return R.sort(function(P,j){return t.compareBuild(P,j,I)})}t.rsort=H;function H(R,I){return R.sort(function(P,j){return t.compareBuild(j,P,I)})}t.gt=X;function X(R,I,P){return F(R,I,P)>0}t.lt=re;function re(R,I,P){return F(R,I,P)<0}t.eq=ue;function ue(R,I,P){return F(R,I,P)===0}t.neq=K;function K(R,I,P){return F(R,I,P)!==0}t.gte=ie;function ie(R,I,P){return F(R,I,P)>=0}t.lte=oe;function oe(R,I,P){return F(R,I,P)<=0}t.cmp=_e;function _e(R,I,P,j){switch(I){case"===":return typeof R=="object"&&(R=R.version),typeof P=="object"&&(P=P.version),R===P;case"!==":return typeof R=="object"&&(R=R.version),typeof P=="object"&&(P=P.version),R!==P;case"":case"=":case"==":return ue(R,P,j);case"!=":return K(R,P,j);case">":return X(R,P,j);case">=":return ie(R,P,j);case"<":return re(R,P,j);case"<=":return oe(R,P,j);default:throw new TypeError("Invalid operator: "+I)}}t.Comparator=k;function k(R,I){if((!I||typeof I!="object")&&(I={loose:!!I,includePrerelease:!1}),R instanceof k){if(R.loose===!!I.loose)return R;R=R.value}if(!(this instanceof k))return new k(R,I);R=R.trim().split(/\s+/).join(" "),r("comparator",R,I),this.options=I,this.loose=!!I.loose,this.parse(R),this.semver===D?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}var D={};k.prototype.parse=function(R){var I=this.options.loose?u[c.COMPARATORLOOSE]:u[c.COMPARATOR],P=R.match(I);if(!P)throw new TypeError("Invalid comparator: "+R);this.operator=P[1]!==void 0?P[1]:"",this.operator==="="&&(this.operator=""),P[2]?this.semver=new g(P[2],this.options.loose):this.semver=D},k.prototype.toString=function(){return this.value},k.prototype.test=function(R){if(r("Comparator.test",R,this.options.loose),this.semver===D||R===D)return!0;if(typeof R=="string")try{R=new g(R,this.options)}catch{return!1}return _e(R,this.operator,this.semver,this.options)},k.prototype.intersects=function(R,I){if(!(R instanceof k))throw new TypeError("a Comparator is required");(!I||typeof I!="object")&&(I={loose:!!I,includePrerelease:!1});var P;if(this.operator==="")return this.value===""?!0:(P=new L(R.value,I),Gr(this.value,P,I));if(R.operator==="")return R.value===""?!0:(P=new L(this.value,I),Gr(R.semver,P,I));var j=(this.operator===">="||this.operator===">")&&(R.operator===">="||R.operator===">"),B=(this.operator==="<="||this.operator==="<")&&(R.operator==="<="||R.operator==="<"),Z=this.semver.version===R.semver.version,te=(this.operator===">="||this.operator==="<=")&&(R.operator===">="||R.operator==="<="),he=_e(this.semver,"<",R.semver,I)&&(this.operator===">="||this.operator===">")&&(R.operator==="<="||R.operator==="<"),se=_e(this.semver,">",R.semver,I)&&(this.operator==="<="||this.operator==="<")&&(R.operator===">="||R.operator===">");return j||B||Z&&te||he||se},t.Range=L;function L(R,I){if((!I||typeof I!="object")&&(I={loose:!!I,includePrerelease:!1}),R instanceof L)return R.loose===!!I.loose&&R.includePrerelease===!!I.includePrerelease?R:new L(R.raw,I);if(R instanceof k)return new L(R.value,I);if(!(this instanceof L))return new L(R,I);if(this.options=I,this.loose=!!I.loose,this.includePrerelease=!!I.includePrerelease,this.raw=R.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(P){return this.parseRange(P.trim())},this).filter(function(P){return P.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}L.prototype.format=function(){return this.range=this.set.map(function(R){return R.join(" ").trim()}).join("||").trim(),this.range},L.prototype.toString=function(){return this.range},L.prototype.parseRange=function(R){var I=this.options.loose,P=I?u[c.HYPHENRANGELOOSE]:u[c.HYPHENRANGE];R=R.replace(P,hm),r("hyphen replace",R),R=R.replace(u[c.COMPARATORTRIM],y),r("comparator trim",R,u[c.COMPARATORTRIM]),R=R.replace(u[c.TILDETRIM],f),R=R.replace(u[c.CARETTRIM],h),R=R.split(/\s+/).join(" ");var j=I?u[c.COMPARATORLOOSE]:u[c.COMPARATOR],B=R.split(" ").map(function(Z){return ee(Z,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(B=B.filter(function(Z){return!!Z.match(j)})),B=B.map(function(Z){return new k(Z,this.options)},this),B},L.prototype.intersects=function(R,I){if(!(R instanceof L))throw new TypeError("a Range is required");return this.set.some(function(P){return M(P,I)&&R.set.some(function(j){return M(j,I)&&P.every(function(B){return j.every(function(Z){return B.intersects(Z,I)})})})})};function M(R,I){for(var P=!0,j=R.slice(),B=j.pop();P&&j.length;)P=j.every(function(Z){return B.intersects(Z,I)}),B=j.pop();return P}t.toComparators=z;function z(R,I){return new L(R,I).set.map(function(P){return P.map(function(j){return j.value}).join(" ").trim().split(" ")})}function ee(R,I){return r("comp",R,I),R=Xe(R,I),r("caret",R),R=qe(R,I),r("tildes",R),R=At(R,I),r("xrange",R),R=pm(R,I),r("stars",R),R}function J(R){return!R||R.toLowerCase()==="x"||R==="*"}function qe(R,I){return R.trim().split(/\s+/).map(function(P){return xe(P,I)}).join(" ")}function xe(R,I){var P=I.loose?u[c.TILDELOOSE]:u[c.TILDE];return R.replace(P,function(j,B,Z,te,he){r("tilde",R,j,B,Z,te,he);var se;return J(B)?se="":J(Z)?se=">="+B+".0.0 <"+(+B+1)+".0.0":J(te)?se=">="+B+"."+Z+".0 <"+B+"."+(+Z+1)+".0":he?(r("replaceTilde pr",he),se=">="+B+"."+Z+"."+te+"-"+he+" <"+B+"."+(+Z+1)+".0"):se=">="+B+"."+Z+"."+te+" <"+B+"."+(+Z+1)+".0",r("tilde return",se),se})}function Xe(R,I){return R.trim().split(/\s+/).map(function(P){return Ce(P,I)}).join(" ")}function Ce(R,I){r("caret",R,I);var P=I.loose?u[c.CARETLOOSE]:u[c.CARET];return R.replace(P,function(j,B,Z,te,he){r("caret",R,j,B,Z,te,he);var se;return J(B)?se="":J(Z)?se=">="+B+".0.0 <"+(+B+1)+".0.0":J(te)?B==="0"?se=">="+B+"."+Z+".0 <"+B+"."+(+Z+1)+".0":se=">="+B+"."+Z+".0 <"+(+B+1)+".0.0":he?(r("replaceCaret pr",he),B==="0"?Z==="0"?se=">="+B+"."+Z+"."+te+"-"+he+" <"+B+"."+Z+"."+(+te+1):se=">="+B+"."+Z+"."+te+"-"+he+" <"+B+"."+(+Z+1)+".0":se=">="+B+"."+Z+"."+te+"-"+he+" <"+(+B+1)+".0.0"):(r("no pr"),B==="0"?Z==="0"?se=">="+B+"."+Z+"."+te+" <"+B+"."+Z+"."+(+te+1):se=">="+B+"."+Z+"."+te+" <"+B+"."+(+Z+1)+".0":se=">="+B+"."+Z+"."+te+" <"+(+B+1)+".0.0"),r("caret return",se),se})}function At(R,I){return r("replaceXRanges",R,I),R.split(/\s+/).map(function(P){return dm(P,I)}).join(" ")}function dm(R,I){R=R.trim();var P=I.loose?u[c.XRANGELOOSE]:u[c.XRANGE];return R.replace(P,function(j,B,Z,te,he,se){r("xRange",R,j,B,Z,te,he,se);var St=J(Z),bt=St||J(te),ot=bt||J(he),Ke=ot;return B==="="&&Ke&&(B=""),se=I.includePrerelease?"-0":"",St?B===">"||B==="<"?j="<0.0.0-0":j="*":B&&Ke?(bt&&(te=0),he=0,B===">"?(B=">=",bt?(Z=+Z+1,te=0,he=0):(te=+te+1,he=0)):B==="<="&&(B="<",bt?Z=+Z+1:te=+te+1),j=B+Z+"."+te+"."+he+se):bt?j=">="+Z+".0.0"+se+" <"+(+Z+1)+".0.0"+se:ot&&(j=">="+Z+"."+te+".0"+se+" <"+Z+"."+(+te+1)+".0"+se),r("xRange return",j),j})}function pm(R,I){return r("replaceStars",R,I),R.trim().replace(u[c.STAR],"")}function hm(R,I,P,j,B,Z,te,he,se,St,bt,ot,Ke){return J(P)?I="":J(j)?I=">="+P+".0.0":J(B)?I=">="+P+"."+j+".0":I=">="+I,J(se)?he="":J(St)?he="<"+(+se+1)+".0.0":J(bt)?he="<"+se+"."+(+St+1)+".0":ot?he="<="+se+"."+St+"."+bt+"-"+ot:he="<="+he,(I+" "+he).trim()}L.prototype.test=function(R){if(!R)return!1;if(typeof R=="string")try{R=new g(R,this.options)}catch{return!1}for(var I=0;I<this.set.length;I++)if(mm(this.set[I],R,this.options))return!0;return!1};function mm(R,I,P){for(var j=0;j<R.length;j++)if(!R[j].test(I))return!1;if(I.prerelease.length&&!P.includePrerelease){for(j=0;j<R.length;j++)if(r(R[j].semver),R[j].semver!==D&&R[j].semver.prerelease.length>0){var B=R[j].semver;if(B.major===I.major&&B.minor===I.minor&&B.patch===I.patch)return!0}return!1}return!0}t.satisfies=Gr;function Gr(R,I,P){try{I=new L(I,P)}catch{return!1}return I.test(R)}t.maxSatisfying=ym;function ym(R,I,P){var j=null,B=null;try{var Z=new L(I,P)}catch{return null}return R.forEach(function(te){Z.test(te)&&(!j||B.compare(te)===-1)&&(j=te,B=new g(j,P))}),j}t.minSatisfying=wm;function wm(R,I,P){var j=null,B=null;try{var Z=new L(I,P)}catch{return null}return R.forEach(function(te){Z.test(te)&&(!j||B.compare(te)===1)&&(j=te,B=new g(j,P))}),j}t.minVersion=vm;function vm(R,I){R=new L(R,I);var P=new g("0.0.0");if(R.test(P)||(P=new g("0.0.0-0"),R.test(P)))return P;P=null;for(var j=0;j<R.set.length;++j){var B=R.set[j];B.forEach(function(Z){var te=new g(Z.semver.version);switch(Z.operator){case">":te.prerelease.length===0?te.patch++:te.prerelease.push(0),te.raw=te.format();case"":case">=":(!P||X(P,te))&&(P=te);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+Z.operator)}})}return P&&R.test(P)?P:null}t.validRange=gm;function gm(R,I){try{return new L(R,I).range||"*"}catch{return null}}t.ltr=_m;function _m(R,I,P){return Un(R,I,"<",P)}t.gtr=Em;function Em(R,I,P){return Un(R,I,">",P)}t.outside=Un;function Un(R,I,P,j){R=new g(R,j),I=new L(I,j);var B,Z,te,he,se;switch(P){case">":B=X,Z=oe,te=re,he=">",se=">=";break;case"<":B=re,Z=ie,te=X,he="<",se="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Gr(R,I,j))return!1;for(var St=0;St<I.set.length;++St){var bt=I.set[St],ot=null,Ke=null;if(bt.forEach(function(Lt){Lt.semver===D&&(Lt=new k(">=0.0.0")),ot=ot||Lt,Ke=Ke||Lt,B(Lt.semver,ot.semver,j)?ot=Lt:te(Lt.semver,Ke.semver,j)&&(Ke=Lt)}),ot.operator===he||ot.operator===se||(!Ke.operator||Ke.operator===he)&&Z(R,Ke.semver))return!1;if(Ke.operator===se&&te(R,Ke.semver))return!1}return!0}t.prerelease=Sm;function Sm(R,I){var P=S(R,I);return P&&P.prerelease.length?P.prerelease:null}t.intersects=bm;function bm(R,I,P){return R=new L(R,P),I=new L(I,P),R.intersects(I)}t.coerce=Rm;function Rm(R,I){if(R instanceof g)return R;if(typeof R=="number"&&(R=String(R)),typeof R!="string")return null;I=I||{};var P=null;if(!I.rtl)P=R.match(u[c.COERCE]);else{for(var j;(j=u[c.COERCERTL].exec(R))&&(!P||P.index+P[0].length!==R.length);)(!P||j.index+j[0].length!==P.index+P[0].length)&&(P=j),u[c.COERCERTL].lastIndex=j.index+j[1].length+j[2].length;u[c.COERCERTL].lastIndex=-1}return P===null?null:S(P[2]+"."+(P[3]||"0")+"."+(P[4]||"0"),I)}}(tn,tn.exports)),tn.exports}var qt=Pr.exports,Ld;function QE(){return Ld||(Ld=1,function(e,t){var r=qt&&qt.__createBinding||(Object.create?function(E,d,f,h){h===void 0&&(h=f);var y=Object.getOwnPropertyDescriptor(d,f);(!y||("get"in y?!d.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(E,h,y)}:function(E,d,f,h){h===void 0&&(h=f),E[h]=d[f]}),n=qt&&qt.__setModuleDefault||(Object.create?function(E,d){Object.defineProperty(E,"default",{enumerable:!0,value:d})}:function(E,d){E.default=d}),o=qt&&qt.__importStar||function(E){if(E&&E.__esModule)return E;var d={};if(E!=null)for(var f in E)f!=="default"&&Object.prototype.hasOwnProperty.call(E,f)&&r(d,E,f);return n(d,E),d},s=qt&&qt.__awaiter||function(E,d,f,h){function y(w){return w instanceof f?w:new f(function(S){S(w)})}return new(f||(f=Promise))(function(w,S){function _(O){try{g(h.next(O))}catch($){S($)}}function b(O){try{g(h.throw(O))}catch($){S($)}}function g(O){O.done?w(O.value):y(O.value).then(_,b)}g((h=h.apply(E,d||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t._readLinuxVersionFile=t._getOsVersion=t._findMatch=void 0;const i=o(Dh()),l=mr(),u=le,a=Nt,c=ae;function m(E,d,f,h){return s(this,void 0,void 0,function*(){const y=u.platform();let w,S,_;for(const b of f){const g=b.version;if((0,l.debug)(`check ${g} satisfies ${E}`),i.satisfies(g,E)&&(!d||b.stable===d)&&(_=b.files.find(O=>{(0,l.debug)(`${O.arch}===${h} && ${O.platform}===${y}`);let $=O.arch===h&&O.platform===y;if($&&O.platform_version){const C=e.exports._getOsVersion();C===O.platform_version?$=!0:$=i.satisfies(C,O.platform_version)}return $}),_)){(0,l.debug)(`matched ${b.version}`),S=b;break}}return S&&_&&(w=Object.assign({},S),w.files=[_]),w})}t._findMatch=m;function p(){const E=u.platform();let d="";if(E==="darwin")d=a.execSync("sw_vers -productVersion").toString();else if(E==="linux"){const f=e.exports._readLinuxVersionFile();if(f){const h=f.split(`
|
||
`);for(const y of h){const w=y.split("=");if(w.length===2&&(w[0].trim()==="VERSION_ID"||w[0].trim()==="DISTRIB_RELEASE")){d=w[1].trim().replace(/^"/,"").replace(/"$/,"");break}}}}return d}t._getOsVersion=p;function v(){const E="/etc/lsb-release",d="/etc/os-release";let f="";return c.existsSync(E)?f=c.readFileSync(E).toString():c.existsSync(d)&&(f=c.readFileSync(d).toString()),f}t._readLinuxVersionFile=v}(Pr,Pr.exports)),Pr.exports}var Ze={},Dd;function ZE(){if(Dd)return Ze;Dd=1;var e=Ze&&Ze.__createBinding||(Object.create?function(i,l,u,a){a===void 0&&(a=u);var c=Object.getOwnPropertyDescriptor(l,u);(!c||("get"in c?!l.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return l[u]}}),Object.defineProperty(i,a,c)}:function(i,l,u,a){a===void 0&&(a=u),i[a]=l[u]}),t=Ze&&Ze.__setModuleDefault||(Object.create?function(i,l){Object.defineProperty(i,"default",{enumerable:!0,value:l})}:function(i,l){i.default=l}),r=Ze&&Ze.__importStar||function(i){if(i&&i.__esModule)return i;var l={};if(i!=null)for(var u in i)u!=="default"&&Object.prototype.hasOwnProperty.call(i,u)&&e(l,i,u);return t(l,i),l},n=Ze&&Ze.__awaiter||function(i,l,u,a){function c(m){return m instanceof u?m:new u(function(p){p(m)})}return new(u||(u=Promise))(function(m,p){function v(f){try{d(a.next(f))}catch(h){p(h)}}function E(f){try{d(a.throw(f))}catch(h){p(h)}}function d(f){f.done?m(f.value):c(f.value).then(v,E)}d((a=a.apply(i,l||[])).next())})};Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.RetryHelper=void 0;const o=r(mr());class s{constructor(l,u,a){if(l<1)throw new Error("max attempts should be greater than or equal to 1");if(this.maxAttempts=l,this.minSeconds=Math.floor(u),this.maxSeconds=Math.floor(a),this.minSeconds>this.maxSeconds)throw new Error("min seconds should be less than or equal to max seconds")}execute(l,u){return n(this,void 0,void 0,function*(){let a=1;for(;a<this.maxAttempts;){try{return yield l()}catch(m){if(u&&!u(m))throw m;o.info(m.message)}const c=this.getSleepAmount();o.info(`Waiting ${c} seconds before trying again`),yield this.sleep(c),a++}return yield l()})}getSleepAmount(){return Math.floor(Math.random()*(this.maxSeconds-this.minSeconds+1))+this.minSeconds}sleep(l){return n(this,void 0,void 0,function*(){return new Promise(u=>setTimeout(u,l*1e3))})}}return Ze.RetryHelper=s,Ze}var kd;function eS(){if(kd)return ce;kd=1;var e=ce&&ce.__createBinding||(Object.create?function(k,D,L,M){M===void 0&&(M=L);var z=Object.getOwnPropertyDescriptor(D,L);(!z||("get"in z?!D.__esModule:z.writable||z.configurable))&&(z={enumerable:!0,get:function(){return D[L]}}),Object.defineProperty(k,M,z)}:function(k,D,L,M){M===void 0&&(M=L),k[M]=D[L]}),t=ce&&ce.__setModuleDefault||(Object.create?function(k,D){Object.defineProperty(k,"default",{enumerable:!0,value:D})}:function(k,D){k.default=D}),r=ce&&ce.__importStar||function(k){if(k&&k.__esModule)return k;var D={};if(k!=null)for(var L in k)L!=="default"&&Object.prototype.hasOwnProperty.call(k,L)&&e(D,k,L);return t(D,k),D},n=ce&&ce.__awaiter||function(k,D,L,M){function z(ee){return ee instanceof L?ee:new L(function(J){J(ee)})}return new(L||(L=Promise))(function(ee,J){function qe(Ce){try{Xe(M.next(Ce))}catch(At){J(At)}}function xe(Ce){try{Xe(M.throw(Ce))}catch(At){J(At)}}function Xe(Ce){Ce.done?ee(Ce.value):z(Ce.value).then(qe,xe)}Xe((M=M.apply(k,D||[])).next())})};Object.defineProperty(ce,"__esModule",{value:!0}),ce.evaluateVersions=ce.isExplicitVersion=ce.findFromManifest=ce.getManifestFromRepo=ce.findAllVersions=ce.find=ce.cacheFile=ce.cacheDir=ce.extractZip=ce.extractXar=ce.extractTar=ce.extract7z=ce.downloadTool=ce.HTTPError=void 0;const o=r(mr()),s=r(Ep()),i=r(Aa),l=r(ae),u=r(QE()),a=r(le),c=r(T),m=r(gp),p=r(Dh()),v=r(qr),E=r(pr),d=kr,f=Na(),h=ZE();class y extends Error{constructor(D){super(`Unexpected HTTP response: ${D}`),this.httpStatusCode=D,Object.setPrototypeOf(this,new.target.prototype)}}ce.HTTPError=y;const w=process.platform==="win32",S=process.platform==="darwin",_="actions/tool-cache";function b(k,D,L,M){return n(this,void 0,void 0,function*(){D=D||c.join(ie(),i.randomUUID()),yield s.mkdirP(c.dirname(D)),o.debug(`Downloading ${k}`),o.debug(`Destination ${D}`);const z=3,ee=oe("TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS",10),J=oe("TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS",20);return yield new h.RetryHelper(z,ee,J).execute(()=>n(this,void 0,void 0,function*(){return yield g(k,D||"",L,M)}),xe=>!(xe instanceof y&&xe.httpStatusCode&&xe.httpStatusCode<500&&xe.httpStatusCode!==408&&xe.httpStatusCode!==429))})}ce.downloadTool=b;function g(k,D,L,M){return n(this,void 0,void 0,function*(){if(l.existsSync(D))throw new Error(`Destination file path ${D} already exists`);const z=new m.HttpClient(_,[],{allowRetries:!1});L&&(o.debug("set auth"),M===void 0&&(M={}),M.authorization=L);const ee=yield z.get(k,M);if(ee.message.statusCode!==200){const Ce=new y(ee.message.statusCode);throw o.debug(`Failed to download from "${k}". Code(${ee.message.statusCode}) Message(${ee.message.statusMessage})`),Ce}const J=E.promisify(v.pipeline),xe=oe("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY",()=>ee.message)();let Xe=!1;try{return yield J(xe,l.createWriteStream(D)),o.debug("download complete"),Xe=!0,D}finally{if(!Xe){o.debug("download failed");try{yield s.rmRF(D)}catch(Ce){o.debug(`Failed to delete '${D}'. ${Ce.message}`)}}}})}function O(k,D,L){return n(this,void 0,void 0,function*(){(0,d.ok)(w,"extract7z() not supported on current OS"),(0,d.ok)(k,'parameter "file" is required'),D=yield N(D);const M=process.cwd();if(process.chdir(D),L)try{const ee=["x",o.isDebug()?"-bb1":"-bb0","-bd","-sccUTF-8",k],J={silent:!0};yield(0,f.exec)(`"${L}"`,ee,J)}finally{process.chdir(M)}else{const z=c.join(__dirname,"..","scripts","Invoke-7zdec.ps1").replace(/'/g,"''").replace(/"|\n|\r/g,""),ee=k.replace(/'/g,"''").replace(/"|\n|\r/g,""),J=D.replace(/'/g,"''").replace(/"|\n|\r/g,""),xe=["-NoLogo","-Sta","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",`& '${z}' -Source '${ee}' -Target '${J}'`],Xe={silent:!0};try{const Ce=yield s.which("powershell",!0);yield(0,f.exec)(`"${Ce}"`,xe,Xe)}finally{process.chdir(M)}}return D})}ce.extract7z=O;function $(k,D,L="xz"){return n(this,void 0,void 0,function*(){if(!k)throw new Error("parameter 'file' is required");D=yield N(D),o.debug("Checking tar --version");let M="";yield(0,f.exec)("tar --version",[],{ignoreReturnCode:!0,silent:!0,listeners:{stdout:xe=>M+=xe.toString(),stderr:xe=>M+=xe.toString()}}),o.debug(M.trim());const z=M.toUpperCase().includes("GNU TAR");let ee;L instanceof Array?ee=L:ee=[L],o.isDebug()&&!L.includes("v")&&ee.push("-v");let J=D,qe=k;return w&&z&&(ee.push("--force-local"),J=D.replace(/\\/g,"/"),qe=k.replace(/\\/g,"/")),z&&(ee.push("--warning=no-unknown-keyword"),ee.push("--overwrite")),ee.push("-C",J,"-f",qe),yield(0,f.exec)("tar",ee),D})}ce.extractTar=$;function C(k,D,L=[]){return n(this,void 0,void 0,function*(){(0,d.ok)(S,"extractXar() not supported on current OS"),(0,d.ok)(k,'parameter "file" is required'),D=yield N(D);let M;L instanceof Array?M=L:M=[L],M.push("-x","-C",D,"-f",k),o.isDebug()&&M.push("-v");const z=yield s.which("xar",!0);return yield(0,f.exec)(`"${z}"`,_e(M)),D})}ce.extractXar=C;function G(k,D){return n(this,void 0,void 0,function*(){if(!k)throw new Error("parameter 'file' is required");return D=yield N(D),w?yield Y(k,D):yield Q(k,D),D})}ce.extractZip=G;function Y(k,D){return n(this,void 0,void 0,function*(){const L=k.replace(/'/g,"''").replace(/"|\n|\r/g,""),M=D.replace(/'/g,"''").replace(/"|\n|\r/g,""),z=yield s.which("pwsh",!1);if(z){const J=["-NoLogo","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",["$ErrorActionPreference = 'Stop' ;","try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;",`try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${L}', '${M}', $true) }`,`catch { if (($_.Exception.GetType().FullName -eq 'System.Management.Automation.MethodException') -or ($_.Exception.GetType().FullName -eq 'System.Management.Automation.RuntimeException') ){ Expand-Archive -LiteralPath '${L}' -DestinationPath '${M}' -Force } else { throw $_ } } ;`].join(" ")];o.debug(`Using pwsh at path: ${z}`),yield(0,f.exec)(`"${z}"`,J)}else{const J=["-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 '${L}' -DestinationPath '${M}' -Force }`,`else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${L}', '${M}', $true) }`].join(" ")],qe=yield s.which("powershell",!0);o.debug(`Using powershell at path: ${qe}`),yield(0,f.exec)(`"${qe}"`,J)}})}function Q(k,D){return n(this,void 0,void 0,function*(){const L=yield s.which("unzip",!0),M=[k];o.isDebug()||M.unshift("-q"),M.unshift("-o"),yield(0,f.exec)(`"${L}"`,M,{cwd:D})})}function A(k,D,L,M){return n(this,void 0,void 0,function*(){if(L=p.clean(L)||L,M=M||a.arch(),o.debug(`Caching tool ${D} ${L} ${M}`),o.debug(`source dir: ${k}`),!l.statSync(k).isDirectory())throw new Error("sourceDir is not a directory");const z=yield H(D,L,M);for(const ee of l.readdirSync(k)){const J=c.join(k,ee);yield s.cp(J,z,{recursive:!0})}return X(D,L,M),z})}ce.cacheDir=A;function x(k,D,L,M,z){return n(this,void 0,void 0,function*(){if(M=p.clean(M)||M,z=z||a.arch(),o.debug(`Caching tool ${L} ${M} ${z}`),o.debug(`source file: ${k}`),!l.statSync(k).isFile())throw new Error("sourceFile is not a file");const ee=yield H(L,M,z),J=c.join(ee,D);return o.debug(`destination file ${J}`),yield s.cp(k,J),X(L,M,z),ee})}ce.cacheFile=x;function F(k,D,L){if(!k)throw new Error("toolName parameter is required");if(!D)throw new Error("versionSpec parameter is required");if(L=L||a.arch(),!re(D)){const z=U(k,L);D=ue(z,D)}let M="";if(D){D=p.clean(D)||"";const z=c.join(K(),k,D,L);o.debug(`checking cache: ${z}`),l.existsSync(z)&&l.existsSync(`${z}.complete`)?(o.debug(`Found tool in cache ${k} ${D} ${L}`),M=z):o.debug("not found")}return M}ce.find=F;function U(k,D){const L=[];D=D||a.arch();const M=c.join(K(),k);if(l.existsSync(M)){const z=l.readdirSync(M);for(const ee of z)if(re(ee)){const J=c.join(M,ee,D||"");l.existsSync(J)&&l.existsSync(`${J}.complete`)&&L.push(ee)}}return L}ce.findAllVersions=U;function q(k,D,L,M="master"){return n(this,void 0,void 0,function*(){let z=[];const ee=`https://api.github.com/repos/${k}/${D}/git/trees/${M}`,J=new m.HttpClient("tool-cache"),qe={};L&&(o.debug("set auth"),qe.authorization=L);const xe=yield J.getJson(ee,qe);if(!xe.result)return z;let Xe="";for(const At of xe.result.tree)if(At.path==="versions-manifest.json"){Xe=At.url;break}qe.accept="application/vnd.github.VERSION.raw";let Ce=yield(yield J.get(Xe,qe)).readBody();if(Ce){Ce=Ce.replace(/^\uFEFF/,"");try{z=JSON.parse(Ce)}catch{o.debug("Invalid json")}}return z})}ce.getManifestFromRepo=q;function V(k,D,L,M=a.arch()){return n(this,void 0,void 0,function*(){return yield u._findMatch(k,D,L,M)})}ce.findFromManifest=V;function N(k){return n(this,void 0,void 0,function*(){return k||(k=c.join(ie(),i.randomUUID())),yield s.mkdirP(k),k})}function H(k,D,L){return n(this,void 0,void 0,function*(){const M=c.join(K(),k,p.clean(D)||D,L||"");o.debug(`destination ${M}`);const z=`${M}.complete`;return yield s.rmRF(M),yield s.rmRF(z),yield s.mkdirP(M),M})}function X(k,D,L){const z=`${c.join(K(),k,p.clean(D)||D,L||"")}.complete`;l.writeFileSync(z,""),o.debug("finished caching tool")}function re(k){const D=p.clean(k)||"";o.debug(`isExplicit: ${D}`);const L=p.valid(D)!=null;return o.debug(`explicit? ${L}`),L}ce.isExplicitVersion=re;function ue(k,D){let L="";o.debug(`evaluating ${k.length} versions`),k=k.sort((M,z)=>p.gt(M,z)?1:-1);for(let M=k.length-1;M>=0;M--){const z=k[M];if(p.satisfies(z,D)){L=z;break}}return L?o.debug(`matched: ${L}`):o.debug("match not found"),L}ce.evaluateVersions=ue;function K(){const k=process.env.RUNNER_TOOL_CACHE||"";return(0,d.ok)(k,"Expected RUNNER_TOOL_CACHE to be defined"),k}function ie(){const k=process.env.RUNNER_TEMP||"";return(0,d.ok)(k,"Expected RUNNER_TEMP to be defined"),k}function oe(k,D){const L=et[k];return L!==void 0?L:D}function _e(k){return Array.from(new Set(k))}return ce}var jn=eS(),$t={},qd;function tS(){if(qd)return $t;qd=1,Object.defineProperty($t,"__esModule",{value:!0}),$t.retryAsPromised=$t.applyJitter=$t.TimeoutError=void 0;class e extends Error{constructor(s,i){super(s),this.name="TimeoutError",this.previous=i}}$t.TimeoutError=e;function t(o,s){if(typeof o=="function")try{if(s instanceof o)return!0}catch{return!!o(s)}return o===s.toString()||o===s.message?!0:o instanceof RegExp&&(o.test(s.message)||o.test(s.toString()))}function r(o,s){const i=o+Math.random()*s*(Math.random()>.5?1:-1);return Math.max(0,i)}$t.applyJitter=r;function n(o,s){if(!o||!s)throw new Error("retry-as-promised must be passed a callback and a options set");s=typeof s=="number"?{max:s}:s;const i={$current:"$current"in s?s.$current:1,max:s.max,timeout:s.timeout||void 0,match:s.match?Array.isArray(s.match)?s.match:[s.match]:[],backoffBase:s.backoffBase===void 0?100:s.backoffBase,backoffExponent:s.backoffExponent||1.1,backoffJitter:s.backoffJitter||0,report:s.report,name:s.name||o.name||"unknown"};return i.match&&!Array.isArray(i.match)&&(i.match=[i.match]),i.report&&i.report("Trying "+i.name+" #"+i.$current+" at "+new Date().toLocaleTimeString(),i),new Promise(function(l,u){let a,c,m;i.timeout&&(a=setTimeout(function(){c&&clearTimeout(c),u(new e(i.name+" timed out",m))},i.timeout)),Promise.resolve(o({current:i.$current})).then(l).then(function(){a&&clearTimeout(a),c&&clearTimeout(c)}).catch(function(p){a&&clearTimeout(a),c&&clearTimeout(c),m=p,i.report&&i.report(p&&p.toString()||p,i,p);var v=i.$current<i.max;if(!v||(v=i.match.length===0||i.match.some(function(f){return t(f,p)}),!v))return u(p);var E=i.backoffBase*Math.pow(i.backoffExponent,i.$current-1);const d=i.backoffJitter;d!==void 0&&(E=r(E,d)),i.$current++,i.report&&i.report(`Retrying ${i.name} (${i.$current})`,i),E?(i.report&&i.report(`Delaying retry of ${i.name} by ${E}`,i),c=setTimeout(function(){n(o,i).then(l).catch(u)},E)):n(o,i).then(l).catch(u)})})}return $t.retryAsPromised=n,$t.default=n,$t}var rS=tS();const kh=Oe(rS),{GITHUB_ACTIONS:qh}=Et;async function gt(e,t,r,n,o){var v,E;W(`Installing ${e} ${t} ${o} via direct downloading`),process.env.RUNNER_TEMP=(v=process.env.RUNNER_TEMP)!=null?v:le.tmpdir(),process.env.RUNNER_TOOL_CACHE=(E=process.env.RUNNER_TOOL_CACHE)!=null?E:T.join(le.tmpdir(),"setup-cpp","hostedtoolcache");const{url:s,binRelativeDir:i,binFileName:l,extractedFolderName:u,extractFunction:a}=await r(t,process.platform,o);if(qh)try{const d=jn.find(e,t);if(d){const f=T.join(d,u),h=T.join(f,i);if(await we(T.join(h,l)))return W(`${e} ${t} was found in the cache at ${h}.`),await $e(h,ne),{installDir:f,binDir:h}}}catch{}const c=T.join(n,u),m=T.join(c,i),p=T.join(m,l);return await nS(m,p,e,t,s,n,a,o),await oS(n,e,t),{installDir:c,binDir:m}}async function nS(e,t,r,n,o,s,i,l){if((await Promise.all([we(e),we(t)])).includes(!1))try{const u=await iS(r,n,o);W(`Extracting ${u} to ${s}`),await(i!=null?i:Uh(jh(o)))(u,s)}catch(u){throw new Error(`Failed to download ${r} ${n} ${l} from ${o}: ${u}`)}if(W(`Add ${e} to PATH`),await $e(e,ne),!await we(t))throw new Error(`Failed to find the binary ${t} after extracting ${r} ${n} ${l}`);if(process.platform!=="win32")try{await Da(t,"755")}catch(u){ve(`Failed to make ${t} executable: ${u}`)}}async function iS(e,t,r){return W(`Download ${e} ${t}`),await kh(()=>{var i;const o=`${Date.now()}-setup-cpp-`,s=T.join((i=process.env.RUNNER_TEMP)!=null?i:le.tmpdir(),`${o}${T.basename(r)}`);return jn.downloadTool(r,s)},{name:r,max:4,backoffBase:2e3,report:o=>W(o)})}async function oS(e,t,r){qh&&typeof process.env.RUNNER_TOOL_CACHE=="string"&&(Sp("cache-tools")==="true"||process.env.CACHE_TOOLS==="true")&&await jn.cacheDir(e,t,r)}async function Fh({version:e,arch:t,setupDir:r}){const n=await de("tar",{nothrow:!0});if(n!==null){W(`tar already installed at ${n}`);return}switch(process.platform){case"win32":return gt("tar",e,sS,r,t);case"darwin":return Me("gnu-tar",e);case"linux":{if(Te())return await be("gzip"),await be("xz"),be("tar");if(Le())return Ne([{name:"tar"},{name:"gzip"},{name:"xz"}]);if(ye())return pe([{name:"tar"},{name:"gzip"},{name:"xz-utils"}]);if(await Ie())return ke([{name:"tar"},{name:"gzip"},{name:"xz"}]);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}function sS(e,t,r){if(t!=="win32")throw new Error("Unsupported platform");return r!=="x64"&&ve(`Unsupported architecture ${r} for tar on Windows. Using x64.`),{url:`https://phoenixnap.dl.sourceforge.net/project/gnuwin32/tar/${e}/tar-${e}-bin.zip?viasf=1`,extractedFolderName:"",binRelativeDir:"bin",binFileName:"tar.exe"}}var cn=(e=>(e[e.Tar=0]="Tar",e[e.TarGz=1]="TarGz",e[e.TarXz=2]="TarXz",e[e.Zip=3]="Zip",e[e.SevenZip=4]="SevenZip",e))(cn||{});function jh(e){const t=e.split(".").pop();return t==="tar"?0:t==="gz"||t==="tgz"?1:t==="xz"||t==="txz"?2:t==="zip"?3:(t==="7z"||t==="exe"||ve(`Unknown archive type: ${t}. Defaulting to 7z`),4)}function Uh(e){switch(e){case 0:case 1:case 2:return process.platform==="win32"?dr:Za;case 3:return lS;default:return dr}}let fa;async function dr(e,t,r=!1){const n=T.basename(e);return/.*\.tar\..+$/.test(n)?await aS(e,n,t,r):await Ea(e,t),t}async function aS(e,t,r,n){if(!/.*\.tar\..+$/.test(t))throw new Error(`Invalid tar file: ${t}`);const o=T.join(T.dirname(e),"sevenzip-temp");await Ea(e,o);const s=t.slice(0,-3),i=T.join(o,s);await Ea(i,o),await Tt.remove(i),W(`Moving ${o} to ${r}`);const l=await Tt.readdir(o);await Promise.all(l.map(async u=>{await Tt.move(T.join(o,u),T.join(r,u),{overwrite:!0})})),await Tt.remove(o),n&&await cS(r)}async function cS(e){W(`Stripping path components from ${e}`);const t=await Tt.readdir(e);if(t.length!==1)throw new Error(`Expected 1 folder in ${e}, got ${t.length}`);const r=t[0],n=T.join(e,r),o=await Tt.stat(n);if(!o.isDirectory()){ve(`Expected ${n} to be a directory, got ${o}.`);return}const s=await Tt.readdir(n);await Promise.all(s.map(i=>Tt.move(T.join(n,i),T.join(e,i),{overwrite:!0}))),await Tt.remove(n)}async function Ea(e,t){W(`7z: extracting ${e} to ${t}`),await fe(await uS(),["x",e,`-o${t}`,"-y"],{stdio:"inherit"}),await vr(t)}async function uS(){return fa===void 0&&(de.sync("7z",{nothrow:!0})===null&&await an({version:""}),fa="7z"),fa}async function lS(e,t){return de.sync("7z",{nothrow:!0})!==null?dr(e,t):de.sync("unzip",{nothrow:!0})!==null?(await fe("unzip",["-q",e,"-d",t],{stdio:"inherit"}),await vr(t),t):dr(e,t)}async function Za(e,t,r=0,n=[]){await Fh({version:"",arch:process.arch,setupDir:rt("~/tar")});try{await Tt.mkdirp(t)}catch{}try{await fe("tar",["xf",e,"-C",t,`--strip-components=${r}`,...n],{stdio:"inherit"})}catch(o){process.platform==="win32"&&o.message.includes("Can't create '\\\\?\\C:")&&ve(`Failed to extract symlink ${e} to ${t}. Ignoring this symlink.`)}return await vr(t),t}const{GITHUB_ACTIONS:fS}=Et,dS=typeof __dirname=="string"?__dirname:T.dirname(lt.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:ge&&ge.tagName.toUpperCase()==="SCRIPT"&&ge.src||new URL("setup-cpp.js",document.baseURI).href));async function ec({version:e,setupDir:t,arch:r}){let n;switch(process.platform){case"win32":{(r==="arm"||r==="arm64")&&(n=await De("gcc-arm-embedded",e));try{n=await gt("g++",e,hS,t,r)}catch(o){W(`Failed to download g++ binary. ${o}. Falling back to chocolatey.`),n=await pS(e,r)}break}case"linux":{if(Te())n=await be("mingw-w64-gcc",e);else if(Le())n=await Ne([{name:"mingw64-gcc",version:e}]);else if(ye())n=await pe([{name:"mingw-w64",version:e}]);else if(await Ie())await ph(),n=await ke([{name:"mingw-w64-gcc",version:e},{name:"mingw-w64-crt",version:e}]);else throw new Error(`Unsupported Linux distro for ${r}`);break}default:throw new Error(`Unsupported platform for ${r}`)}return n!==void 0&&await mS(n.binDir),n}async function pS(e,t){var n,o;await De("mingw",e);let r;if(t==="x64"&&await we("C:/tools/mingw64/bin")?(r="C:/tools/mingw64/bin",await $e(r,ne)):t==="ia32"&&await we("C:/tools/mingw32/bin")?(r="C:/tools/mingw32/bin",await $e(r,ne)):await we(`${(n=process.env.ChocolateyInstall)!=null?n:"C:/ProgramData/chocolatey"}/bin/g++.exe`)&&(r=`${(o=process.env.ChocolateyInstall)!=null?o:"C:/ProgramData/chocolatey"}/bin`),r!==void 0)return{binDir:r}}async function hS(e,t,r){var a;if(t!=="win32")throw new Error(`Unsupported platform '${t}'`);const n=await gn(T.join(dS,"github_brechtsanders_winlibs_mingw.json")),o={x64:"x86_64",ia32:"i386"},s=da(e),i=pa(e),l=Fd(e),u=_n(n,{version:e,keywords:[(a=o[r])!=null?a:r],filterName:c=>(s===void 0||s===da(c))&&(i===void 0||i===pa(c))&&(l===void 0||l===Fd(c)),versionSatisfies:(c,m)=>{const p=fr(c);if(p===null)throw new Error(`Invalid MinGW asset version: '${c}'`);return Xa(p,m)&&(s===void 0||s===da(c))&&(i===void 0||i===pa(c))}});if(u===void 0)throw new Error(`No asset found for version ${e} and arch ${r}`);return{binRelativeDir:"bin/",binFileName:Ee("g++"),extractedFolderName:"mingw64",extractFunction:dr,url:`https://github.com/brechtsanders/winlibs_mingw/releases/download/${u.tag}/${u.name}`}}function da(e){const t=e.match(/(ucrt|msvcrt)/);return t!==null?t[1]:void 0}function pa(e){const t=e.match(/(posix|mcf)/);return t!==null?t[1]:void 0}function Fd(e){const t=e.match(/(seh|dwarf)/);return t!==null?t[1]:void 0}async function mS(e){const t=[];process.platform==="win32"&&t.push(Pe("CC",Ee(`${e}/gcc`),ne),Pe("CXX",Ee(`${e}/g++`),ne)),fS&&await Ah(),await Promise.all(t)}const{GITHUB_ACTIONS:yS}=Et,wS=typeof __dirname=="string"?__dirname:T.dirname(lt.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:ge&&ge.tagName.toUpperCase()==="SCRIPT"&&ge.src||new URL("setup-cpp.js",document.baseURI).href));async function En({version:e,setupDir:t,arch:r,priority:n=40}){let o;switch(process.platform){case"win32":{o=await ec({version:e,setupDir:t,arch:r});break}case"darwin":{o=await Me("gcc",e);break}case"linux":{if(Te())o=await be("gcc",e);else if(Le())o=await Ne([{name:"gcc",version:e},{name:"gcc-c++",version:e},{name:"libstdc++-devel"}]);else if(await Ie())o=await ke([{name:"gcc",version:e},{name:"g++",version:e}]);else if(ye())if(e==="")o=await pe([{name:"gcc"},{name:"g++"}]);else try{o=await pe([{name:"gcc",version:e},{name:"g++",version:e}])}catch{o=await pe([{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"}}])}break}default:throw new Error(`Unsupported platform for ${r}`)}if(o!==void 0)return await vS(e,o.binDir,n),o}async function vS(e,t,r=40){if(process.platform==="win32")return;const n=[];{const o=gS(e),[s,i]=await Promise.all([jd("gcc",t,o),jd("g++",t,o)]);n.push(Pe("CC",s,ne),Pe("CXX",i,ne)),ye()&&n.push(wt("cc",s,ne,r),wt("cxx",i,ne,r),wt("gcc",s,ne,r),wt("g++",i,ne,r))}n.push(Ph()),yS&&await Ah(),await Promise.all(n)}function gS(e){try{const t=Ka(e),r=fh(t);return r>=5?`${r}`:e}catch{return e}}async function jd(e,t,r){var s,i;if(await we(`${t}/${e}-${r}`))return Ee(`${t}/${e}-${r}`);const n=new RegExp(`^${wn(e)}-?([\\d\\.\\-]*)(?:\\.exe)?$`),o=(await ka(t)).filter(l=>n.test(l)).sort((l,u)=>{var m,p,v,E;const a=(p=(m=l.match(n))==null?void 0:m[1])!=null?p:"",c=(E=(v=u.match(n))==null?void 0:v[1])!=null?E:"";try{return IE(a,c)}catch{return 0}});for(const l of o){const u=`${t}/${l}`;if(r===""||l.includes(r)||(i=(s=await _S(u))==null?void 0:s.includes(r))!=null&&i)return Ee(u)}return await we(`${t}/${e}`)?Ee(`${t}/${e}`):Ee(e)}async function _S(e){try{const{stdout:t}=await fe(e,["--version"],{stdio:"pipe"}),r=t.match(/(gcc|g\+\+).* \(.*\) ([\d.]+)/);if(r!==null)return r[2];ve(`Failed to parse gcc version from: ${t}`)}catch(t){Ae(`Failed to get gcc version: ${t}`)}}const Ut=e=>{if(!e)e={mode:511};else if(typeof e=="object")e={mode:511,...e};else if(typeof e=="number")e={mode:e};else if(typeof e=="string")e={mode:parseInt(e,8)};else throw new TypeError("invalid options argument");const t=e,r=e.fs||{};return e.mkdir=e.mkdir||r.mkdir||ae.mkdir,e.mkdirAsync=e.mkdirAsync?e.mkdirAsync:async(n,o)=>new Promise((s,i)=>t.mkdir(n,o,(l,u)=>l?i(l):s(u))),e.stat=e.stat||r.stat||ae.stat,e.statAsync=e.statAsync?e.statAsync:async n=>new Promise((o,s)=>t.stat(n,(i,l)=>i?s(i):o(l))),e.statSync=e.statSync||r.statSync||ae.statSync,e.mkdirSync=e.mkdirSync||r.mkdirSync||ae.mkdirSync,t},Zt=(e,t,r)=>{const n=T.dirname(e),o={...Ut(t),recursive:!1};if(n===e)try{return o.mkdirSync(e,o)}catch(s){const i=s;if(i&&i.code!=="EISDIR")throw s;return}try{return o.mkdirSync(e,o),r||e}catch(s){const i=s;if(i&&i.code==="ENOENT")return Zt(e,o,Zt(n,o,r));if(i&&i.code!=="EEXIST"&&i&&i.code!=="EROFS")throw s;try{if(!o.statSync(e).isDirectory())throw s}catch{throw s}}},cr=Object.assign(async(e,t,r)=>{const n=Ut(t);n.recursive=!1;const o=T.dirname(e);return o===e?n.mkdirAsync(e,n).catch(s=>{const i=s;if(i&&i.code!=="EISDIR")throw s}):n.mkdirAsync(e,n).then(()=>r||e,async s=>{const i=s;if(i&&i.code==="ENOENT")return cr(o,n).then(l=>cr(e,n,l));if(i&&i.code!=="EEXIST"&&i.code!=="EROFS")throw s;return n.statAsync(e).then(l=>{if(l.isDirectory())return r;throw s},()=>{throw s})})},{sync:Zt}),Mh=async(e,t,r)=>{if(r!==t)return e.statAsync(t).then(n=>n.isDirectory()?r:void 0,n=>{const o=n;return o&&o.code==="ENOENT"?Mh(e,T.dirname(t),t):void 0})},Gh=(e,t,r)=>{if(r!==t)try{return e.statSync(t).isDirectory()?r:void 0}catch(n){const o=n;return o&&o.code==="ENOENT"?Gh(e,T.dirname(t),t):void 0}},Sn=(e,t)=>{const r=Ut(t);if(r.recursive=!0,T.dirname(e)===e)return r.mkdirSync(e,r);const o=Gh(r,e);try{return r.mkdirSync(e,r),o}catch(s){const i=s;if(i&&i.code==="ENOENT")return Zt(e,r);throw s}},ha=Object.assign(async(e,t)=>{const r={...Ut(t),recursive:!0};return T.dirname(e)===e?await r.mkdirAsync(e,r):Mh(r,e).then(o=>r.mkdirAsync(e,r).then(s=>o||s).catch(s=>{const i=s;if(i&&i.code==="ENOENT")return cr(e,r);throw s}))},{sync:Sn}),ES=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,Vh=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=T.resolve(e),ES==="win32"){const t=/[*|"<>?:]/,{root:r}=T.parse(e);if(t.test(e.substring(r.length)))throw Object.assign(new Error("Illegal characters in path."),{path:e,code:"EINVAL"})}return e},SS=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version,ma=SS.replace(/^v/,"").split("."),Bh=+ma[0]>10||+ma[0]==10&&+ma[1]>=12,tc=Bh?e=>Ut(e).mkdirSync===ae.mkdirSync:()=>!1,Ud=Object.assign(Bh?e=>Ut(e).mkdir===ae.mkdir:()=>!1,{sync:tc}),Md=(e,t)=>{e=Vh(e);const r=Ut(t);return tc(r)?Sn(e,r):Zt(e,r)},Tr=Object.assign(async(e,t)=>{e=Vh(e);const r=Ut(t);return Ud(r)?ha(e,r):cr(e,r)},{mkdirpSync:Md,mkdirpNative:ha,mkdirpNativeSync:Sn,mkdirpManual:cr,mkdirpManualSync:Zt,sync:Md,native:ha,nativeSync:Sn,manual:cr,manualSync:Zt,useNative:Ud,useNativeSync:tc});function nt(e,t,r=null){var n;return zh(t)?(n=rc(e,r))!=null?n:"":t}function bS(){const e=typeof __dirname=="string"?__dirname:T.dirname(lt.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:ge&&ge.tagName.toUpperCase()==="SCRIPT"&&ge.src||new URL("setup-cpp.js",document.baseURI).href)),t=T.join(e,"versions.json");return JSON.parse(ae.readFileSync(t,"utf-8"))}const RS=Fe(bS);function rc(e,t=null){var p,v,E;const n=RS()[e];if(n===void 0)return;if(typeof n=="string")return n;const o=n,s=(p=o[process.platform])!=null?p:o.else;if(s===void 0)throw new Error(`Platform "${process.platform}" not found in versions data for tool "${e}"`);if(typeof s=="string")return s;const i=s,l=ye()?"ubuntu":Te()?"archlinux":dh()?"alpine":Le()?"fedora":"else",u=(v=i[l])!=null?v:i.else;if(u===void 0)throw new Error(`Distro "${l}" not found in versions data for tool "${e}"`);if(typeof u=="string")return u;const a=u,c=t!==null?OS(t,a):a.else;if(c===void 0)throw new Error(`Architecture "${process.arch}" not found in versions data for tool "${e}"`);if(typeof c=="string")return c;const m=c;return(E=m[process.arch])!=null?E:m.else}function OS(e,t){var o;const r=e[0],n=Object.keys(t).map(s=>Number.parseInt(s,10)).filter(s=>!Number.isNaN(s)).sort((s,i)=>i-s).find(s=>r>=s);return n!==void 0&&(o=t[n])!=null?o:t.else}function zh(e){return e==="true"||e===void 0}function $S(e,t,r=void 0){var u,a;const n=r===void 0?!1:t.includes(r.compiler),s=(n?t:t.filter(c=>c!=="compiler")).filter(c=>e[c]!==void 0),i=s.filter(c=>{const m=n&&c==="compiler"&&r!==void 0?r.version:e[c];return!zh(m)}),l=i.length!==0?n&&i[0]==="compiler"&&r!==void 0?(u=r.version)!=null?u:"true":(a=e[i[0]])!=null?a:"true":"true";if(i.some(c=>n&&c==="compiler"&&r!==void 0?e.compiler!==`${r.compiler}-${l}`:e[c]!==l))return!1;for(const c of s)e[c]=n&&c==="compiler"&&r!==void 0?`${r.compiler}-${l}`:l;return!0}function IS(e){return e.startsWith(">")}const{GITHUB_ACTIONS:PS}=Et;async function Hh({version:e,setupDir:t,arch:r}){Se.startGroup("Setup Python");const n=await NS(e,t,r);kr(n.bin!==void 0);const o=n.bin;Se.endGroup(),Se.startGroup("Setup venv"),await xS(o),Se.endGroup(),Se.startGroup("Setup pip");const s=await DS(o);if(Se.endGroup(),s===void 0)throw new Error("pip was not installed correctly");return Se.startGroup("Setup pipx"),await TS(o),Se.endGroup(),Se.startGroup("Setup wheel"),await AS(o),Se.endGroup(),n}async function TS(e){try{if(!await ln(e)){try{await Dr("pipx")}catch(t){Jt(`pipx was not installed completely for the system-wide python: ${t}`)}try{await ln(e)||await bn(e,"pipx",void 0,{upgrade:!0,usePipx:!1})}catch(t){Jt(`pipx was not installed completely for ${e}: ${t}`)}}if(await ln(e))await fe(e,["-m","pipx","ensurepath"],{stdio:"inherit"});else if(await MS())Jt(`pipx module not found for ${e}. Trying to install with pipx binary...`),await fe("pipx",["ensurepath"],{stdio:"inherit"});else throw new Error("pipx module or pipx binary not found. Corrput pipx installation.")}catch(t){Jt(`Failed to install pipx completely for ${e}: ${t.toString()}. Ignoring...`)}}async function xS(e){if(await CS(e)){W("venv module already installed.");return}try{await Dr("venv")}catch(t){W(`Failed to install venv: ${t.toString()}. Ignoring...`)}}async function CS(e){try{return await fe(e,["-m","venv","-h"],{stdio:"ignore"}),ye()?Ba("python3-venv"):!0}catch{}return!1}async function AS(e){try{await bn(e,"setuptools",void 0,{upgrade:!0,isLibrary:!0,usePipx:!1}),await bn(e,"wheel",void 0,{upgrade:!1,isLibrary:!0,usePipx:!1})}catch(t){W(`Failed to install setuptools/wheel: ${t.toString()}. Ignoring...`)}}async function NS(e,t,r){const n=IS(e)?"":e;let o,s=await un(t);if(s!==void 0){const i=T.dirname(s);o={bin:s,installDir:i,binDir:i}}else{if(PS)try{W("Installing python in GitHub Actions");const{setupActionsPython:i}=await Promise.resolve().then(()=>require("./assets/actions_python-B0U177DM.js"));if(await i(n,t,r),s=await un(t),s===void 0)throw new Error("Python binary could not be found");const l=T.dirname(s);o={bin:s,installDir:l,binDir:l}}catch(i){ve(i.toString())}o===void 0&&(o=await LS(t,n))}if(s===void 0||o.bin===void 0){if(s=await un(t),s===void 0)throw new Error("Python binary could not be found");o={bin:s,installDir:T.dirname(s),binDir:T.dirname(s)}}return o}async function LS(e,t){let r;switch(process.platform){case"win32":{e?await De("python3",t,[`--params=/InstallDir:${e}`]):await De("python3",t);const n=await un(e);if(n===void 0)throw new Error("Python binary could not be found");const o=T.dirname(n);await $e(o,ne),r={installDir:o,binDir:o,bin:n};break}case"darwin":{r=await Me("python3",t);const n=await fe("brew",["--prefix","python"],{stdio:"pipe"}),o=T.join(n.stdout,"libexec","bin");await $e(o,ne);break}case"linux":{if(Te())r=await be("python",t);else if(Le())r=await Ne([{name:"python3",version:t}]);else if(ye())r=await pe([{name:"python3",version:t},{name:"python-is-python3"}]);else if(await Ie())r=await ke([{name:"python3",version:t}]);else throw new Error("Unsupported linux distributions");break}default:throw new Error("Unsupported platform")}return r}async function un(e){for(const t of["python","python3"]){const r=await Gd(t,e);if(r!==void 0)return r}if(process.platform==="win32"){const t=T.parse(le.homedir()).root,r=(await ka(t)).filter(n=>n.startsWith("Python"));for(const n of r)for(const o of["python3","python"]){const s=await Gd(o,T.join(t,n));if(s!==void 0)return s}}}async function Gd(e,t){var r;try{const n=rc("python");if(t!==void 0){const s=T.join(t,Ee(e));if(await we(s)&&await _a(s,n))return s}const o=(r=await de(e,{nothrow:!0,all:!0}))!=null?r:[];for(const s of o)if(await _a(s,n))return s}catch{}}async function DS(e){const t=await Vd();return t===void 0?(W("pip was not found. Installing pip"),await qS(e),Vd()):t}async function Vd(){for(const e of["pip3","pip"]){const t=await kS(e);if(t!==void 0)return t}}async function kS(e){var t;try{const r=rc("pip"),n=(t=await de(e,{nothrow:!0,all:!0}))!=null?t:[];for(const o of n)if(await _a(o,r))return o}catch{}}async function qS(e){await Bd(e)||(await Dr("pip"),await Bd(e))}async function Bd(e){if(await Yh(e))return!1;try{return await fe(e,["-m","ensurepip","-U","--upgrade"],{stdio:"inherit"}),!0}catch(t){W(t.toString());try{return await fe(e,["-m","pip","install","--upgrade","pip"],{stdio:"inherit"}),!0}catch(r){W(r.toString())}}return!1}var $r={},zd;function FS(){if(zd)return $r;zd=1,Object.defineProperty($r,"__esModule",{value:!0}),$r.getUbuntuVersion=void 0;const e=Nt;function t(o){return"errno"in o}function r(o,s){return new Promise((i,l)=>{e.execFile(o,s,{encoding:"utf8",shell:!1},(u,a,c)=>{if(u){if(t(u)&&u.code==="ENOENT"){i(null);return}l(new Error(`Could not execute \`${o} ${s.join(" ")}\`: ${u} (stderr=${c})`));return}i(a)})})}async function n(){if(process.platform!=="linux")return[];const o=await r("lsb_release",["-a"]);if(o===null)return[];const s=/^Distributor ID:\s*(.+)$/,i=/^Description:\s*Ubuntu\s+(\d+)\.(\d+)(?:\.(\d+))?/,l=/^Release:\s*(\d+)\.(\d+)(?:\.(\d+))?$/;let u=null,a=null,c=!1;for(const m of o.split(`
|
||
`)){const p=m.match(s);if(p!==null){if(p[1]!=="Ubuntu")return[];c=!0}const v=m.match(i);v&&(u=v);const E=m.match(l);if(E&&(a=E),c&&u&&a)break}if(!c)return[];for(const m of[u,a])if(m){const p=[m[1],m[2]];return m[3]&&p.push(m[3]),p.map(v=>parseInt(v,10))}return[]}return $r.getUbuntuVersion=n,$r}var Wh=FS();async function jS(){try{if(ye()){try{de.sync("lsb_release",{nothrow:!0})===null&&await pe([{name:"lsb-release"}])}catch{return Hd()}const e=await Wh.getUbuntuVersion();return e.length===0?Hd():e}else return null}catch(e){return ve(e.toString()),null}}const Ft=Fe(jS,{promise:!0});function Hd(){if(!("version"in le&&typeof le.version=="function"))return null;const t=le.version().match(/(\d+)\.(\d+)\.(\d+)/);if(t===null)return null;const r=Number.parseInt(t[1],10),n=Number.parseInt(t[2],10),o=Number.parseInt(t[3],10);return[r,n,o]}function US(e){return[...new Set(e)]}function Wd(e,t='"'){return e.includes(" ")?`${t}${e}${t}`:e}async function or(e,t,r={}){return bn(await zS(r.pythonVersion),e,t,r)}async function bn(e,t,r,n={}){const{usePipx:o=!0,user:s=!0,upgrade:i=!1,isLibrary:l=!1}=n,u=o&&!l&&await ln(e),a=!u&&await Yh(e),c=u?"pipx":"pip",m=HS(t);if(!i&&(u?await XS(e,m):await WS(e,m)))return{binDir:u?await Xd():await Kd(e,m)};if(!a&&await KS(e,m))try{Se.info(`Installing ${t} ${r!=null?r:""} via ${c}`);const v=r!==void 0&&r!==""?`${t}==${r}`:t,E=i?u?["upgrade"]:["install","--upgrade"]:["install"],d=!u&&s?["--user"]:[],f=process.env;u&&s&&(f.PIPX_HOME=await VS(),f.PIPX_BIN_DIR=await Xh()),ze(e,["-m",c,...E,...d,v],{stdio:"inherit",env:f})}catch(v){const E=v instanceof Error?`${v.message}
|
||
${v.stack}`:String(v);if(Se.info(`Failed to install ${t} via ${c}: ${E}`),await Dr(t)===null)throw new Error(`Failed to install ${t} via ${c}: ${v}.`)}else if(await Dr(t)===null)throw new Error(`Failed to install ${t} as it was not found via ${c} or the system package manager`);return{binDir:u?await Xd():await Kd(e,m)}}function Xd(){return Xh()}async function Kd(e,t){const r=await QS(e),n=await YS(r,t);return await $e(n,ne),n}async function MS(){return await de("pipx",{nothrow:!0})!==null}async function ln(e){return(await fe(e,["-m","pipx","--help"],{stdio:"ignore",reject:!1})).exitCode===0}async function GS(){let e=process.env.PIPX_HOME;if(e!==void 0)return e;const t=rt("~/.local/pipx");if(await we(t))return t;switch(process.platform){case"win32":{e=rt("~/AppData/Local/pipx");break}case"darwin":{e=rt("~/Library/Application Support/pipx");break}default:{e=rt("~/.local/share/pipx");break}}return await Tr(e),await Tr(T.join(e,"trash")),await Tr(T.join(e,"shared")),await Tr(T.join(e,"venv")),e}const VS=Fe(GS,{promise:!0});async function BS(){if(process.env.PIPX_BIN_DIR!==void 0)return process.env.PIPX_BIN_DIR;const e=rt("~/.local/bin");return await $e(e,ne),await Tr(e),e}const Xh=Fe(BS,{promise:!0});let rn;async function zS(e){if(rn!==void 0)return rn;const t=e!=null?e:nt("python",void 0,await Ft());return rn=(await Hh({version:t,setupDir:"",arch:process.arch})).bin,rn}function HS(e){return e.replace(/\[.*]/g,"").trim()}async function WS(e,t){try{return(await fe(e,["-m","pip","-qq","show",t],{stdio:"ignore",reject:!1})).exitCode===0}catch{return!1}}async function XS(e,t){try{const r=await fe(e,["-m","pipx","list","--json"],{stdio:"ignore",reject:!1});if(r.exitCode!==0||typeof r.stdout!="string")return!1;const n=JSON.parse(r.stdout);if(t in n.venvs)return!0;for(const o of Object.values(n.venvs))if(o.metadata.main_package.package_or_url===t||o.metadata.main_package.package===t)return!0}catch{}return!1}async function KS(e,t){return(await fe(e,["-m","pip","-qq","index","versions",t],{stdio:"ignore",reject:!1})).exitCode===0}async function YS(e,t){const n=(await Promise.all(e.map(s=>we(T.join(s,Ee(t)))))).findIndex(s=>s);if(n!==-1)return e[n];const o=de.sync(Ee(t),{nothrow:!0});return o!==null?T.dirname(o):e[e.length-1]}async function Dr(e,t){if(process.platform==="linux"){Se.info(`Installing ${e} via the system package manager`);const r=e==="pipx"?Te():!0;if(Te())return be(r?`python-${e}`:e);if(Le())return Ne([{name:r?`python3-${e}`:e}]);if(ye())return pe([{name:r?`python3-${e}`:e}]);if(await Ie())return ke([{name:r?`py3-${e}`:e}])}else if(process.platform==="darwin")return["venv"].includes(e)?null:Me(e);return null}async function JS(e){const t=[];process.platform==="linux"?t.push("/home/runner/.local/bin/"):process.platform==="darwin"&&t.push("/usr/local/bin/");const r=await Kh(e);return t.push(T.join(r,"Scripts"),T.join(r,"Scripts","bin"),T.join(r,"bin")),US(t)}const QS=Fe(JS,{promise:!0});async function ZS(e){return(await qn.getExecOutput(`${e} -c "import sys;print(sys.base_exec_prefix);"`)).stdout.trim()}const Kh=Fe(ZS,{promise:!0});async function eb(e){try{const t=await Kh(e),r=await Ch(e);if(r===void 0)return ve(`Failed to get the version of ${e}`),!1;const n=T.join(t,"lib",`python${r.major}.${r.minor}`,"EXTERNALLY-MANAGED");return we(n)}catch(t){return ve(`Failed to check if ${e} is externally managed: ${t}`),!1}}const Yh=Fe(eb,{promise:!0});function tb({version:e}={}){return ye()&&(e===void 0||e==="")?pe([{name:"gcovr",version:e}]):or("gcovr",e)}function rb(){return Pe("GCOV","llvm-cov gcov",ne)}function Yd(e){const t=kn(e),r=t!==null?fh(t):e,n=r!==""?`gcov-${r}`:"gcov";return Pe("GCOV",n,ne)}const st=["x64","amd64","x86_64","win64","64","amd64_x86","amd64_arm64"],ur=["x86","i386","ia32","win32","32","x32"],ct=["aarch64","arm64","woa64","arm"],nb=["armv7","armv7a"],ib=["powerpc64le","ppc64le"],ob=["sparc64"],sb=["sparcv9"];function Jh(e){return ct.includes(e)?"arm64":st.includes(e)?"amd64":e}async function ab({version:e}={}){switch(process.platform){case"win32":return De("bazelisk",e);case"darwin":return Me("bazelisk",e);case"linux":{if(Te())throw new Error("installing bazel on Arch linux is not supported yet");if(Le())return await Ne([{name:"dnf-plugins-core"}]),await vt("dnf",["copr","enable","vbatts/bazel"]),Ne([{name:"bazel4"}]);if(ye()){const t=await wh({fileName:"bazel-archive-keyring.gpg",keyUrl:"https://bazel.build/bazel-release.pub.gpg"});return await vt("bash",["-c",`echo "deb [arch=${Jh(process.arch)} signed-by=${t}] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list`]),pe([{name:"bazel",version:e}],!0)}else if(await Ie())return ke([{name:"bazel",version:e}],!0);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}async function cb({version:e}={}){switch(process.platform){case"win32":return De("ccache",e);case"darwin":return Me("ccache",e);case"linux":{if(Te())return be("ccache",e);if(Le())return Ne([{name:"ccache",version:e}]);if(ye())return pe([{name:"ccache",version:e}]);if(await Ie())return ke([{name:"ccache",version:e}]);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}var ub=xn();const ya=Oe(ub);function lb(e,t,r){const n=e===""?"":Ka(e);switch(t){case"win32":{const o=n===""?!1:ya(n,"v3.19.6");let s;st.includes(r)?s=o?"win64-x64":"windows-x86_64":ur.includes(r)?s=o?"win32-x86":"windows-i386":ct.includes(r)?s="windows-arm64":(W(`Trying unsupported arch '${r}' for cmake on Windows`),s=`windows-${r}`);const i=`cmake-${e}-${s}`;return{binRelativeDir:"bin/",binFileName:Ee("cmake"),extractedFolderName:i,url:`https://github.com/Kitware/CMake/releases/download/v${e}/${i}.zip`}}case"darwin":{const s=(n===""?!1:ya(n,"v3.19.1"))?"Darwin-x86_64":"macos-universal",i=`cmake-${e}-${s}`;return{binRelativeDir:"CMake.app/Contents/bin/",binFileName:Ee("cmake"),extractedFolderName:i,url:`https://github.com/Kitware/CMake/releases/download/v${e}/${i}.tar.gz`}}case"linux":{const o=n===""?!1:ya(n,"v3.19.8");let s;ct.includes(r)?s=o?"Linux-aarch64":"linux-aarch64":st.includes(r)?s=o?"Linux-x86_64":"linux-x86_64":(W(`Trying unsupported arch '${r}' for cmake on Linux`),s=`linux-${r}`);const i=`cmake-${e}-${s}`;return{binRelativeDir:"bin/",binFileName:Ee("cmake"),extractedFolderName:i,url:`https://github.com/Kitware/CMake/releases/download/v${e}/${i}.tar.gz`}}default:throw new Error(`Unsupported platform '${t}'`)}}async function Qh({version:e,setupDir:t,arch:r}){return await Ie()?ke([{name:"cmake"}]):gt("cmake",e,lb,t,r)}function Ir({version:e}={}){return or("cmakelang[YAML]",e)}function fb({version:e}={}){return or("conan",e)}async function db({version:e}={}){switch(process.platform){case"win32":return await De("cppcheck",e),{binDir:await pb()};case"darwin":return Me("cppcheck",e);case"linux":{if(Te())return be("cppcheck",e);if(Le())return Ne([{name:"ccache",version:e}]);if(ye())return pe([{name:"cppcheck",version:e}]);if(await Ie())return ke([{name:"cppcheck",version:e}]);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}async function pb(){const e="C:/Program Files/Cppcheck";return await $e(e,ne),e}function hb({version:e}={}){return or("cpplint",e,{pythonVersion:">=3.8.0"})}async function fn({version:e}={}){switch(process.platform){case"win32":return await De("graphviz",e),mb();case"darwin":return Me("graphviz",e);case"linux":{if(Te())return be("graphviz",e);if(Le())return Ne([{name:"graphviz",version:e}]);if(ye())return pe([{name:"graphviz",version:e}]);if(await Ie())return ke([{name:"graphviz",version:e}]);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}async function mb(){switch(process.platform){case"win32":{const e="C:/Program Files/Graphviz/bin";return await $e(e,ne),{binDir:e}}default:throw new Error("Unsupported platform")}}const yb=new Map([[25,["Tahoe","26"]],[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"]]]);function wb(e){e=Number((e||le.release()).split(".")[0]);const[t,r]=yb.get(e)||["Unknown",""];return{name:t,version:r}}function vb(){if(process.platform!=="darwin")return[];const{version:e}=wb();return e.split(".").map(t=>Number.parseInt(t,10))}const gb=Fe(vb);async function _b(e,t){const{ArchiveHdi:r}=await Promise.resolve().then(()=>require("./assets/index-CyGoLSfE.js"));await new r(e).read(async o=>{await o.extract(T.join(t,o.path))})}function Eb(e,t,r){switch(t){case"linux":{if(process.arch==="arm64")throw new Error("Doxygen binaries are not available for Linux arm64");const n=`doxygen-${e}`;return{binRelativeDir:"bin/",binFileName:Ee("doxygen"),extractedFolderName:n,url:`https://www.doxygen.nl/files/${n}.linux.bin.tar.gz`}}case"win32":{const n=`doxygen-${e}`;return{binRelativeDir:"",binFileName:Ee("doxygen"),extractedFolderName:n,url:`https://www.doxygen.nl/files/${n}.windows.x64.bin.zip`}}case"darwin":{const n=`Doxygen-${e}`;return{binRelativeDir:"Doxygen/Doxygen.app/Contents/Resources/",binFileName:Ee("doxygen"),extractedFolderName:n,extractFunction:_b,url:`https://doxygen.nl/files/${n}.dmg`}}default:throw new Error(`Unsupported platform '${t}'`)}}async function Sb({version:e,setupDir:t,arch:r}){switch(process.platform){case"win32":{await kh(()=>De("doxygen.install",e),{name:"doxygen.install",max:4,backoffBase:2e3,report:s=>W(s)});const o={binDir:await Rb()};return await fn({version:nt("graphviz",void 0)}),o}case"darwin":{const n=await Me("doxygen",void 0,{formula:!0});return gb()[0]>11&&await fn({version:nt("graphviz",void 0)}),n}case"linux":{const n=await bb({version:e,setupDir:t,arch:r});return await fn({version:nt("graphviz",void 0,await Ft())}),n}default:throw new Error("Unsupported platform")}}async function bb({version:e,setupDir:t,arch:r}){try{if(Te())return await be("doxygen",e);if(Le())return Ne([{name:"doxygen",version:e}]);if(ye())return await pe([{name:"doxygen",version:e,fallBackToLatest:ct.includes(r)}]);if(await Ie())return ke([{name:"doxygen"}]);throw new Error("Unsupported linux distributions")}catch{try{const n=await gt("doxygen",e,Eb,t,r);if(ye())try{await pe([{name:"libclang-cpp-dev"}])}catch(o){W(`Failed to download libclang-cpp-dev that might be needed for running doxygen. ${o}`)}return n}catch(n){return Jt(`Failed to download doxygen binary. ${n}. Falling back to installing the latest version from apt-get.`),pe([{name:"doxygen"}])}}}async function Rb(){switch(process.platform){case"win32":{for(const e of["C:/ProgramData/chocolatey/bin","C:/Program Files/doxygen/bin","C:/Program Files (x86)/doxygen"])if(await we(T.join(e,"doxygen.exe")))return await $e(e,ne),e;throw new Error("Failed to find doxygen binary")}default:throw new Error("Unsupported platform")}}function Ob({version:e}={}){return or("flawfinder",e)}async function Zh({version:e}={}){const t=await de("git",{nothrow:!0});if(t!==null){W(`Git already installed at ${t}`);return}switch(process.platform){case"win32":{const r=await De("git",e),n=$b();return n!==null&&await $e(n,ne),r}case"darwin":return Me("git",e);case"linux":{if(Te())return be("git",e);if(Le())return Ne([{name:"git",version:e}]);if(ye())return pe([{name:"git",version:e}]);if(await Ie())return ke([{name:"git",version:e}]);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}function $b(){const e=["C:/Program Files/Git/bin/","C:/Program Files (x86)/Git/bin/"];for(const t of e)if(ae.existsSync(T.join(t,"git.exe")))return t;return ve("Git not found in the default locations. Add git to PATH manually."),null}const Ib=typeof __dirname=="string"?__dirname:T.dirname(lt.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:ge&&ge.tagName.toUpperCase()==="SCRIPT"&&ge.src||new URL("setup-cpp.js",document.baseURI).href));async function Pb(e,t,r){const{keywords:n,optionalKeywords:o}=xb(t,r),s=await gn(T.join(Ib,"github_facebook_infer.json")),i=_n(s,{version:e,keywords:n,optionalKeywords:o,filterMapTag(l){return l.replace(/^v/,"")}});if(i!==void 0)return{url:`https://github.com/facebook/infer/releases/download/${i.tag}/${i.name}`,extractedFolderName:`${T.basename(i.name,".tar.xz")}`,binRelativeDir:"bin",binFileName:Ee("infer")};throw new Error(`No asset found for version ${e} matching ${n} and ${o}`)}function Tb({version:e,setupDir:t,arch:r}){return gt("infer",e,Pb,t,r)}function xb(e,t){const r=[],n=[];switch(e){case"linux":{r.push("linux"),st.includes(t)?(n.push("64"),n.push("x86_64")):(W(`Using arch ${t} for infer`),r.push(t));break}case"darwin":{r.push("osx"),st.includes(t)?n.push("x86_64"):ct.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);break}return{keywords:r,optionalKeywords:n}}function Cb(e,t){switch(e){case"win32":return st.includes(t)||ur.includes(t)?"win":ct.includes(t)?"winarm64":"win";case"darwin":return"mac";case"linux":return st.includes(t)||ur.includes(t)?"linux":ct.includes(t)?"linux-aarch64":"linux";default:throw new Error(`Unsupported platform '${e}'`)}}function Ab(e,t,r){const n=Cb(t,r);return{binRelativeDir:"",binFileName:Ee("ninja"),extractedFolderName:"",url:`https://github.com/ninja-build/ninja/releases/download/v${e}/ninja-${n}.zip`}}async function em({version:e,setupDir:t,arch:r}){return await Ie()?(await ph(),await ke([{name:"ninja-build"},{name:"ninja-is-really-ninja"}]),await $e("/usr/lib/ninja-build/bin",ne),{binDir:"/usr/lib/ninja-build/bin",installDir:"/usr/lib/ninja-build/",bin:"/usr/lib/ninja-build/bin/ninja"}):gt("ninja",e,Ab,t,r)}const Nb=typeof __dirname=="string"?__dirname:T.dirname(lt.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:ge&&ge.tagName.toUpperCase()==="SCRIPT"&&ge.src||new URL("setup-cpp.js",document.baseURI).href));function Lb(e){return{url:`https://github.com/SimonKagstrom/kcov/releases/download/${e}/kcov-amd64.tar.gz`,extractedFolderName:"",binRelativeDir:"usr/local/bin",binFileName:Ee("kcov")}}function Db(e,t,r){return{url:`https://github.com/SimonKagstrom/kcov/archive/refs/tags/${e}.tar.gz`,extractedFolderName:"",binRelativeDir:"build/src",binFileName:Ee("kcov"),extractFunction:(n,o)=>kb(n,o,r)}}async function kb(e,t,r){const n=await Za(e,t,1),o=await qb(r);process.platform==="linux"&&(Te()?await Promise.all([be("libdwarf"),be("libcurl-openssl")]):Le()?await Ne([{name:"libdwarf-devel"},{name:"libcurl-devel"}]):ye()&&await pe([{name:"libdw-dev"},{name:"libcurl4-openssl-dev"}]));try{if(de.sync("patch",{nothrow:!0})!==null){const i=T.join(Nb,"gcc13.patch");await fe("patch",["-N","-p1","-i",i],{cwd:n,stdio:"inherit"})}else W("`patch` not found, skipping gcc13.patch, kcov may not build on gcc 13")}catch{}const s=T.join(n,"build");return await fe(o,["-S",n,"-B",s,"-DCMAKE_BUILD_TYPE=Release","-G","Ninja"],{cwd:n,stdio:"inherit"}),await fe(o,["--build",s,"--config","Release"],{cwd:n,stdio:"inherit"}),n}async function qb(e){let t=de.sync("cmake",{nothrow:!0});if(t===null){const{binDir:n}=await Qh({version:nt("cmake",void 0,await Ft()),setupDir:T.join(rt("~"),"cmake"),arch:e});t=T.join(n,"cmake")}return de.sync("ninja",{nothrow:!0})===null&&await em({version:nt("ninja",void 0,await Ft()),setupDir:T.join(rt("~"),"ninja"),arch:e}),t}async function Fb({version:e,setupDir:t,arch:r}){if(process.platform!=="linux"){W("Kcov is not supported on non-linux");return}const n=e.split("-");let o=$E(n[0]);const s=n[1],i=OE(o);i===38&&(o="v38");let l;return s==="binary"&&i>=39?(l=await gt("kcov",o,Lb,t,r),Te()?await be("binutils"):Le()?await Ne([{name:"binutils"}]):ye()&&await pe([{name:"libbinutils"}]),l):(l=await gt("kcov",o,Db,t,r),l)}function jb({version:e}={}){return or("lizard",e)}async function xr(){process.platform==="darwin"&&(await de("clang",{nothrow:!0})!==null&&await de("clang++",{nothrow:!0})!==null&&(Jt("Assuming clang is an Apple Clang compiler"),await Promise.all([Pe("CC","clang",ne),Pe("CXX","clang++",ne)])),pn.error("Apple Clang automatic installation is not supported yet"))}function Ub(e){const t=Ka(e);return Number.parseInt(t.split(".")[0],10)}const br=Fe(Ub);async function Mb(e){if(await Ie())try{return await Gb(e)}catch(t){W(`Failed to install llvm via system package manager ${t}.`)}}function Gb(e){const t=br(e);return ke([{name:`llvm${t}`}])}const Vb=typeof __dirname=="string"?__dirname:T.dirname(lt.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:ge&&ge.tagName.toUpperCase()==="SCRIPT"&&ge.src||new URL("setup-cpp.js",document.baseURI).href));var nc=(e=>(e[e.All=0]="All",e[e.ClangFormat=1]="ClangFormat",e[e.Core=2]="Core",e))(nc||{});async function Bb(e,t=0){if(ye())try{return await zb(e,t)}catch(r){pn.info(`Failed to install llvm via system package manager ${r}. Trying to remove the repository`);try{me(T.join(Vb,"llvm_repo_remove.bash"),[`${br(e)}`])}catch(n){pn.info(`Failed to remove llvm repository ${n}`)}}}async function zb(e,t=0){const r=br(e),n=`/usr/lib/llvm-${r}`;await pe([{name:"ca-certificates"}]);const o=new _r.DownloaderHelper("https://apt.llvm.org/llvm.sh",le.tmpdir(),{fileName:"llvm.sh",override:!0});o.on("error",l=>{throw new Error(`Failed to download the LLVM installer script: ${l}`)}),await o.start();const s=await Qt(o.getDownloadPath(),"utf-8"),i=T.join(le.tmpdir(),"llvm-setup-cpp.sh");return await Hb(s,i,r,t),await Oh(),await pe([{name:"lsb-release"},{name:"wget"},{name:"gnupg"}]),await Da(i,"755"),await vt("bash",[i,`${r}`,...t===0?["all"]:[]],{stdio:"inherit",shell:!0,timeout:um}),await $e(`${n}/bin`,ne),{installDir:`${n}`,binDir:`${n}/bin`,bin:`${n}/bin/clang++`}}async function Hb(e,t,r,n){let o=Wb(e);o=Xb(o),o=Jb(n,o,r),o=await Kb(o),o=Yb(o),await Lr(t,o)}function Wb(e){return process.env.NODE_DEBUG!=="1"&&process.env.NODE_DEBUG!=="true"?e.replace(/set -eux/g,"set -eu"):e}function Xb(e){const t=Rh();return e.replace(/add-apt-repository\s*(-y)?\s*"\${REPO_NAME}"/g,`add-apt-repository -y ${t?"--no-update":""} "\${REPO_NAME}"
|
||
apt-get update -o ${Er}`)}async function Kb(e){let t=e.replace(/apt-get install -y/g,`apt-get install -o Dpkg::Options::="--force-overwrite" -o ${Er} -y --fix-broken`);const r=["libc++-$LLVM_VERSION-dev","libc++abi-$LLVM_VERSION-dev","libunwind-$LLVM_VERSION-dev"];return await Promise.all(r.map(async n=>{const o=n.replace("$LLVM_VERSION","*");await eE(o)&&(pn.info(`Removing conflicting package ${o}`),t=t.replace(n,""))})),t}function Yb(e){return yh()?e.replace(/apt-get/g,"nala"):e}function Jb(e,t,r){return e===1?t.replace(/ -y \$PKG/g,` -y clang-format-${r}`):t}const Jd=typeof __dirname=="string"?__dirname:T.dirname(lt.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:ge&&ge.tagName.toUpperCase()==="SCRIPT"&&ge.src||new URL("setup-cpp.js",document.baseURI).href));async function Qb(e,t,r){const n=await Zb(t,r,e);W(`Downloading LLVM from ${n}`);const o=jh(n);return{url:n,extractedFolderName:"",binRelativeDir:"bin",binFileName:Ee("clang"),extractFunction:o===cn.Tar||o===cn.TarGz||o===cn.TarXz?(s,i)=>process.platform==="win32"?dr(s,i,!0):Za(s,i,1):Uh(o)}}async function Zb(e,t,r){const{keywords:n,optionalKeywords:o}=await eR(e,t),s=await gn(T.join(Jd,"github_llvm_llvm-project.json")),i=_n(s,{version:r,keywords:n,optionalKeywords:o,filterMapTag(a){return a.replace(/^llvmorg-/,"")}});if(i!==void 0)return`https://github.com/llvm/llvm-project/releases/download/${i.tag}/${i.name}`;const l=await gn(T.join(Jd,"llvm_org_releases.json")),u=_n(l,{version:r,keywords:n,optionalKeywords:o});if(u!==void 0)return`https://releases.llvm.org/${u.tag}/${u.name}`;throw new Error(`No asset found for version ${r} matching ${n} and ${o}`)}async function eR(e,t){const r=[],n=[];switch(e){case"win32":{n.push(".tar.xz",".tar.xz");const o=[];st.includes(t)?(o.push("win64"),n.push(["x86_64","X64"])):ur.includes(t)?o.push("win32"):ct.includes(t)?o.push("woa64"):(W(`Using arch ${t} for LLVM`),o.push(t)),o.push("windows","Windows"),r.push(o);break}case"linux":{const o=["linux","Linux"];if(ye()){n.push("ubuntu");const s=await Ft();if(s!==null){n.push(`${s[0]}`);const i=s[1]<10?`0${s[1]}`:`${s[1]}`;n.push(`${s[0]}.${i}`),n.push(`${s[0]}.${i}.${s[2]}`)}}else Le()&&n.push("rhel");st.includes(t)?r.push(["x86_64","X64"]):ur.includes(t)?r.push("x86"):ct.includes(t)?r.push("aarch64"):nb.includes(t)?r.push("armv7a"):ib.includes(t)?r.push("powerpc64le"):ob.includes(t)?r.push("sparc64"):(W(`Using arch ${t} for LLVM`),r.push(t)),r.push(o);break}case"darwin":{r.push(["apple","macos","macOS"]),st.includes(t)?n.push(["x86_64","X64"]):ct.includes(t)?n.push(["arm64","ARM64"]):(W(`Using arch ${t} for LLVM`),r.push(t));break}case"freebsd":{r.push("freebsd"),st.includes(t)?r.push("amd64"):ur.includes(t)?r.push("i386"):(W(`Using arch ${t} for LLVM`),r.push(t));break}case"solaris":{r.push("solaris"),st.includes(t)?r.push("amd64"):sb.includes(t)?r.push("sparcv9"):(W(`Using arch ${t} for LLVM`),r.push(t));break}default:W(`Using ${e} ${t} for LLVM`),r.push(e,t);break}return{keywords:r,optionalKeywords:n}}async function tR({version:e,setupDir:t,arch:r}){const n=await gt("llvm",e,Qb,t,r);return await nR(br(e),r),n}async function rR(e,t){if(ye())for(const r of["libtinfo5","libtinfo6"])try{await pe([{name:r}])}catch{try{if(r==="libtinfo5"){W(`Failed to install ${r}
|
||
Manually installing the package`);const o=`libtinfo5_6.3-2ubuntu0.1_${Jh(t)}.deb`,s=`https://launchpad.net/ubuntu/+archive/primary/+files/${o}`,i=new _r.DownloaderHelper(s,le.tmpdir(),{fileName:o});i.on("error",async l=>{W(`Failed to download ${s}: ${l}`),await i.stop()}),await i.start(),me("dpkg",["-i",T.join(le.tmpdir(),o)])}}catch{W(`Failed to install ${r}. Ignoring`)}}else Te()?await be("ncurses5-compat-libs",void 0,"yay"):Le()&&await Ne([{name:"ncurses-compat-libs"}])}const nR=Fe(rR,{promise:!0});async function iR({version:e}){if(process.platform!=="darwin")return Promise.resolve(void 0);try{return await oR({version:e})}catch(t){W(`Failed to install llvm via brew: ${t}`);return}}async function oR({version:e}){const t=br(e),r=await Me("llvm",`${t}`,{"force-bottle":!0});return await $e(r.binDir,ne),r}const{GITHUB_ACTIONS:sR}=Et,aR=typeof __dirname=="string"?__dirname:T.dirname(lt.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:ge&&ge.tagName.toUpperCase()==="SCRIPT"&&ge.src||new URL("setup-cpp.js",document.baseURI).href));async function dn({version:e,setupDir:t,arch:r}){const n=await ic(e,t,r);return await uR(r),await fR(),n.installDir!==void 0&&await lR(n.installDir,e),n}async function ic(e,t,r,n=nc.All){const o=await Bb(e,n);if(o!==void 0)return o;const s=await Mb(e);if(s!==void 0)return s;const i=await iR({version:e});return i!==void 0?i:tR({version:e,setupDir:t,arch:r})}async function cR(e){process.platform==="linux"&&await En({version:nt("gcc",void 0,await Ft()),setupDir:"",arch:e,priority:40})}const uR=Fe(cR,{promise:!0});async function lR(e,t){var i,l;const r=(i=process.env.LD_LIBRARY_PATH)!=null?i:"",n=(l=process.env.DYLD_LIBRARY_PATH)!=null?l:"",o=br(t),s=[Pe("CC",Ee(`${e}/bin/clang`),ne),Pe("CXX",Ee(`${e}/bin/clang++`),ne),Pe("LLVM_PATH",e,ne),Pe("LLVM_LD_LIBRARY_PATH",`${r}${T.delimiter}${e}/lib`,ne),Pe("LLVM_DYLD_LIBRARY_PATH",`${n}${T.delimiter}${e}/lib`,ne),Pe("LLVM_LDFLAGS",`-L${Wd(`${e}/lib`)}`,ne),Pe("LLVM_CPPFLAGS",`-I${Wd(`${e}/include`)}`,ne),await we(`${e}/lib/clang/${t}/include`)?Pe("LLVM_CPATH",`${e}/lib/clang/${t}/include`,ne):await we(`${e}/lib/clang/${o}/include`)?Pe("LLVM_CPATH",`${e}/lib/clang/${o}/include`,ne):Promise.resolve(),Pe("LLVM_LIBRARY_PATH",`${e}/lib`,ne),Ph()];ye()&&s.push(wt("cc",`${e}/bin/clang`,ne,60),wt("cxx",`${e}/bin/clang++`,ne,60),wt("clang",`${e}/bin/clang`,ne),wt("clang++",`${e}/bin/clang++`,ne),wt("lld",`${e}/bin/lld`,ne),wt("ld.lld",`${e}/bin/ld.lld`,ne),wt("llvm-ar",`${e}/bin/llvm-ar`,ne)),await Promise.all(s)}async function fR(){if(!sR)return;const e=T.join(aR,"llvm_matcher.json");if(!await we(e))return ve("the llvm_matcher.json file does not exist in the same folder as setup-cpp.js");W(`::add-matcher::${e}`)}function Qd({version:e,setupDir:t,arch:r}){return ic(e,t,r,nc.ClangFormat)}function Zd({version:e,setupDir:t,arch:r}){return ic(e,t,r)}async function dR({version:e}={}){switch(process.platform){case"win32":return De("make",e);case"darwin":{await Me("make",e);const t=T.join(Wa(),"opt/make/libexec/gnubin");return await $e(t,ne),{binDir:t}}case"linux":{if(Te())return be("make",e);if(Le())return Ne([{name:"make",version:e}]);if(ye())return pe([{name:"make",version:e}]);if(await Ie())return ke([{name:"make",version:e}]);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}function pR({version:e}={}){return or("meson",e)}var Yt={},ep;function hR(){if(ep)return Yt;ep=1;const e=mr(),t=Nt,r=ae,n=T,o=at,s=o.env["ProgramFiles(x86)"],i=[o.env["ProgramFiles(x86)"],o.env.ProgramFiles],l=["Enterprise","Professional","Community","BuildTools"],u=["2022","2019","2017"],a={2022:"17.0",2019:"16.0",2017:"15.0",2015:"14.0",2013:"12.0"};function c(y){return Object.values(a).includes(y)?y:y in a?a[y]:y}Yt.vsversion_to_versionnumber=c;function m(y){if(Object.keys(a).includes(y))return y;for(const[w,S]of Object.entries(a))if(S===y)return w;return y}Yt.vsversion_to_year=m;const p=`${s}\\Microsoft Visual Studio\\Installer`;function v(y,w){try{return t.execSync(`vswhere -products * ${w} -prerelease -property installationPath`).toString().trim()+"\\"+y}catch(S){e.warning(`vswhere failed: ${S}`)}return null}Yt.findWithVswhere=v;function E(y){const w=c(y);let S;if(w){const g=w.split(".")[0]+".9";S=`-version "${w},${g}"`}else S="-latest";let _=v("VC\\Auxiliary\\Build\\vcvarsall.bat",S);if(_&&r.existsSync(_))return e.info(`Found with vswhere: ${_}`),_;e.info("Not found with vswhere");const b=y?[m(y)]:u;for(const g of i)for(const O of b)for(const $ of l)if(_=`${g}\\Microsoft Visual Studio\\${O}\\${$}\\VC\\Auxiliary\\Build\\vcvarsall.bat`,e.info(`Trying standard location: ${_}`),r.existsSync(_))return e.info(`Found standard location: ${_}`),_;if(e.info("Not found in standard locations"),_=`${s}\\Microsoft Visual C++ Build Tools\\vcbuildtools.bat`,r.existsSync(_))return e.info(`Found VS 2015: ${_}`),_;throw e.info(`Not found in VS 2015 location: ${_}`),new Error("Microsoft Visual Studio not found")}Yt.findVcvarsall=E;function d(y){return["PATH","INCLUDE","LIB","LIBPATH"].indexOf(y.toUpperCase())!=-1}function f(y){let w=y.split(";");function S(_,b,g){return g.indexOf(_)===b}return w.filter(S).join(";")}function h(y,w,S,_,b,g){if(o.platform!="win32"){e.info("This is not a Windows virtual environment, bye!");return}o.env.PATH+=n.delimiter+p;let O={win32:"x86",win64:"x64",x86_64:"x64","x86-64":"x64"};y.toLowerCase()in O&&(y=O[y.toLowerCase()]);var $=[y];_&&JSON.parse(_)===!0&&$.push("uwp"),w&&$.push(w),S&&$.push(`-vcvars_ver=${S}`),b&&JSON.parse(b)===!0&&$.push("-vcvars_spectre_libs=spectre");const C=`"${E(g)}" ${$.join(" ")}`;e.debug(`vcvars command-line: ${C}`);const Y=t.execSync(`set && cls && ${C} && cls && set`,{shell:"cmd"}).toString().split("\f"),Q=Y[0].split(`\r
|
||
`),A=Y[1].split(`\r
|
||
`),x=Y[2].split(`\r
|
||
`),F=A.filter(q=>!!(q.match(/^\[ERROR.*\]/)&&!q.match(/Error in script usage. The correct usage is:$/)));if(F.length>0)throw new Error(`invalid parameters\r
|
||
`+F.join(`\r
|
||
`));let U={};for(let q of Q){const[V,N]=q.split("=");U[V]=N}e.startGroup("Environment variables");for(let q of x){if(!q.includes("="))continue;let[V,N]=q.split("="),H=U[V];N!==H&&(e.info(`Setting ${V}`),d(V)&&(N=f(N)),e.exportVariable(V,N))}e.endGroup(),e.info("Configured Developer Command Prompt")}return Yt.setupMSVCDevCmd=h,Yt}var Sa=hR();function mR(e){switch(e){case"x32":case"32":case"ia32":return"x86";case"64":return"x64";default:return e}}async function oc({vsversion:e,VCTargetsPath:t,arch:r,toolset:n,sdk:o,uwp:s,spectre:i}){t!==void 0&&await we(t)&&(W(`Adding ${t} to PATH`),await Pe("VCTargetsPath",t,ne)),await Sa.setupMSVCDevCmd(mR(r),o,n,s,i,e)}const{GITHUB_ACTIONS:yR}=Et,wR=typeof __dirname=="string"?__dirname:T.dirname(lt.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:ge&&ge.tagName.toUpperCase()==="SCRIPT"&&ge.src||new URL("setup-cpp.js",document.baseURI).href));async function Cr({version:e,setupDir:t,arch:r,sdk:n,uwp:o,spectre:s}){if(process.platform!=="win32")return;const i=Sa.vsversion_to_versionnumber(e);W(`Checking if MSVC ${i} is already installed`);let l=!1;try{const c=Sa.findVcvarsall(i);l=!0,W(`Found the pre-installed version of MSVC at ${c}`)}catch{}let u,a;if(!l)try{i==="14.0"?(u="14.0",await De("visualcpp-build-tools","14.0.25420.1",["--ignore-dependencies"]),a="C:/Program Files (x86)/MSBuild/Microsoft.Cpp/v4.0/v140"):i==="15.0"?(u="14.16",await De("visualstudio2017buildtools","15.9.41.0",[]),a="C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16"):i==="16.0"?(u="14.29",await De("visualstudio2019buildtools","16.11.7.0",[]),a="C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133"):i==="17.0"?(u=void 0,await De("visualstudio2022buildtools","117.0.5.0",[]),a=void 0):Ae(`The given MSVC versions ${e} is not supported yet.`)}catch(c){Ae(c)}await oc({VCTargetsPath:a,arch:r,toolset:u,sdk:n,uwp:o,spectre:s}),yR&&await vR()}async function vR(){const e=T.join(wR,"msvc_matcher.json");if(!await we(e))return ve("the msvc_matcher.json file does not exist in the same folder as setup-cpp.js");W(`::add-matcher::${e}`)}async function tp({version:e}={}){return process.platform!=="win32"?void 0:(await De("opencppcoverage",e),{binDir:await gR()})}async function gR(){const e="C:/Program Files/OpenCppCoverage";return await $e(e,ne),e}function _R(e,t,r){return{url:ER(t,r,e),binRelativeDir:"",binFileName:Ee("pwsh"),extractedFolderName:""}}function ER(e,t,r){var n;switch(e){case"win32":{const o=["ia32","x86","i386","x32"].includes(t)?"win-x86":"win-x64";return`https://github.com/PowerShell/PowerShell/releases/download/v${r}/PowerShell-${r}-${o}.zip`}case"darwin":{const o=["arm","arm64"].includes(t)?"osx-arm64":"osx-x64";return`https://github.com/PowerShell/PowerShell/releases/download/v${r}/powershell-${r}-${o}.tar.gz`}case"linux":{const s=(n={arm64:"linux-arm64",arm:"linux-arm64",arm32:"linux-arm32",aarch64:"linux-arm64",x64:"linux-x64"}[t])!=null?n:"linux-x64";return`https://github.com/PowerShell/PowerShell/releases/download/v${r}/powershell-${r}-${s}.tar.gz`}default:throw new Error(`Unsupported platform '${e}'`)}}async function rp({version:e,setupDir:t,arch:r}){try{return await Ie()?np({version:e}):await gt("pwsh",e,_R,t,r)}catch(n){return Ae(`Failed to setup pwsh via download: ${n}. Trying package managers...`),np({version:e})}}async function np({version:e}={}){switch(process.platform){case"win32":{await De("powershell-core",e);const t="C:/Program Files/PowerShell/7";return await $e(t,ne),{binDir:t}}case"darwin":return Me("powershell",e,{cask:!0,overwrite:!1});case"linux":{if(Te())return be("powershell-bin",e,"yay");if(Le())return await Ne([{name:"curl"}]),me("/bin/bash",["-c","curl https://packages.microsoft.com/config/rhel/8/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo"]),Ne([{name:"powershell",version:e}]);if(ye()){await pe([{name:"curl"}]);const t=await Ft(),r=`${t[0]}.0${t[1]}`;return me("curl",["-LJO",`https://packages.microsoft.com/config/ubuntu/${r}/packages-microsoft-prod.deb`]),me("dpkg",["-i","packages-microsoft-prod.deb"]),pe([{name:"powershell",version:e}],!0)}else if(await Ie())return ke([{name:"powershell",version:void 0}]);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}async function SR({version:e}={}){switch(process.platform){case"win32":return De("sccache",e);case"linux":{if(ye()){if((await Wh.getUbuntuVersion())[0]>=24)return pe([{name:"sccache",version:e}])}else if(await Ie())return ke([{name:"sccache",version:e}]);return Me("sccache",e)}case"darwin":return Me("sccache",e);default:throw new Error("Unsupported platform")}}function bR(e){switch(e){case"win32":return"windows";default:return e}}function RR(e){switch(e){case"x64":return"amd64";case"ia32":case"x86":case"i386":case"x32":return"386";default:return e}}function OR(e,t,r){const n=bR(t),o=RR(r),s=t==="win32"?"zip":"tar.gz";return{binRelativeDir:"",binFileName:Ee("task"),extractedFolderName:"",url:`https://github.com/go-task/task/releases/download/v${e}/task_${n}_${o}.${s}`}}function $R({version:e,setupDir:t,arch:r}){return gt("task",e,OR,t,r)}let ip=!1;async function IR({version:e,setupDir:t,arch:r}){const n=await de("vcpkg",{nothrow:!0});if(ip&&n!==null)return{binDir:T.dirname(n)};if(await Zh(),process.platform==="linux"){if(Te())await Promise.all([be("curl"),be("zip"),be("unzip"),be("tar"),be("pkg-config")]);else if(Le())await Ne([{name:"curl"},{name:"zip"},{name:"unzip"},{name:"tar"},{name:"pkg-config"}]);else if(ye())await pe([{name:"curl"},{name:"zip"},{name:"unzip"},{name:"tar"},{name:"pkg-config"}]);else if(await Ie()){const o=[{name:"curl"},{name:"zip"},{name:"unzip"},{name:"tar"},{name:"pkgconf"}];ct.includes(r)&&o.push({name:"build-base"}),await ke(o)}}return await we(T.join(t,va("bootstrap-vcpkg",".bat")))?Jt(`Vcpkg folder already exists at ${t}. Skipping the clone`):await fe("git",["clone","https://github.com/microsoft/vcpkg"],{cwd:T.dirname(t),stdio:"inherit"}),e!==""&&e!=="true"&&(W(`Checking out vcpkg version ${e}`),await fe("git",["checkout",e],{cwd:t,stdio:"inherit"})),process.platform==="linux"&&ct.includes(r)&&await Pe("VCPKG_FORCE_SYSTEM_BINARIES","1",ne),await fe(va(th("bootstrap-vcpkg"),".bat"),{cwd:t,shell:!0,stdio:"inherit"}),await vr(t),await $e(t,ne),ip=!0,{binDir:t}}const tm={llvm:dn,clang:dn,"clang++":dn},rm={gcc:En,"g++":En},nm={mingw:ec},im={msvc:Cr,cl:Cr,msbuild:Cr,visualstudio:Cr},om={appleclang:xr,applellvm:xr,"apple-clang":xr,"apple-llvm":xr},PR={cmakelang:Ir,"cmake-lint":Ir,"cmake-format":Ir,cmakelint:Ir,cmakeformat:Ir},sm=["llvm","clang","clang++","clang-tidy","clang-format","clangtidy","clangformat"],am={"apt-fast":Wf,aptfast:Wf,nala:dE,git:Zh,brew:za,choco:Lh,python:Hh,powershell:rp,pwsh:rp,...tm,...rm,...nm,...im,...om,...PR,cmake:Qh,ninja:em,vcpkg:IR,bazel:ab,conan:fb,meson:pR,gcovr:tb,opencppcoverage:tp,OpenCppCoverage:tp,ccache:cb,sccache:SR,doxygen:Sb,graphviz:fn,cppcheck:db,cpplint:hb,flawfinder:Ob,lizard:jb,infer:Tb,"clang-tidy":Zd,clangtidy:Zd,"clang-format":Qd,clangformat:Qd,vcvarsall:oc,kcov:Fb,make:dR,task:$R,sevenzip:an,"7zip":an,"7z":an,tar:Fh},cm=Object.keys(am),op=["compiler","architecture","timeout",...cm],um=60*60*1e3;async function TR(e,t,r,n,o,s,i,l=um){Se.startGroup(`Installing ${e} ${t}`);try{await xR(e,t,r,n,o,s)}catch(u){Ae(u),u instanceof Error&&u.stack!==void 0&&Ae(u.stack),i.push(`${e} failed to install`)}Se.endGroup()}async function xR(e,t,r,n,o,s){const i=sm.includes(e);let l;if(e==="vcvarsall")await oc({version:nt(e,t,r),arch:n,uwp:!1,spectre:!1});else if(e==="brew")l=await za({rcOptions:ne});else{const u=T.join(o,i?"llvm":e),a=nt(e,t,r),c=am[e];l=await c({version:a,setupDir:u,arch:n})}s.push(lm(e,l))}function lm(e,t){let r=`✅ ${e} was installed successfully:`;return t===void 0||("installDir"in t&&(r+=`
|
||
- The installation directory is ${t.installDir}`),t.binDir!==""&&(r+=`
|
||
- The binary directory is ${t.binDir}`)),r}const CR=/[.-]((?:\d{4}|\d+(?:\.\d+)*(?:-[\w.-]+)?(?:\+[\w.-]+)?)$)/;function AR(e){try{const t=e.match(CR);if(t===null)return{compiler:e,version:void 0};const r=t[1],n=e.slice(0,t.index).replace(/[.-]$/,"");return!r.match(/^\d{4}$/)&&kn(r)===null&&W(`Non-semver version format: ${r}`),{compiler:n,version:r}}catch(t){return Ae(`Failed to parse the compiler info ${e}: ${t}`),{compiler:e,version:void 0}}}async function NR(e,t,r,n,o,s,i){var u;let l;try{if(Se.startGroup(`Installing ${e} ${t!=null?t:""}`),e in tm)l=await dn({version:nt("llvm",t,r),setupDir:T.join(n,"llvm"),arch:o}),await rb();else if(e in rm){const a=nt("gcc",t,r);l=await En({version:a,setupDir:T.join(n,"gcc"),arch:o}),await Yd(a)}else if(e in nm){const a=nt("mingw",t,r);l=await ec({version:a,setupDir:T.join(n,"gcc"),arch:o}),await Yd(a)}else e in im?l=await Cr({version:nt("msvc",t,r),setupDir:T.join(n,"msvc"),arch:o}):e in om?await xr():(l=null,i.push(`Unsupported compiler ${e}`))}catch(a){Ae(a),a instanceof Error&&Ae((u=a.stack)!=null?u:""),i.push(`Failed to install the ${e} compiler ${t}`)}l!==null&&s.push(lm(e,l)),Se.endGroup()}async function LR(e,t="npm"){try{return await de("setup-cpp",{nothrow:!0})!==null?`setup-cpp@${e} already installed`:(W(`Installing setup-cpp@${e} via ${t}...`),await fe(t,["install","-g",`setup-cpp@${e}`],{stdio:"inherit",timeout:1e3*60*1}),`setup-cpp@${e} installed successfully`)}catch(r){return new Error(`Failed to install the setup-cpp@${e} CLI: ${r}. Ignoring...`)}}async function DR(e={}){var E,d;const t=(E=e.architecture)!=null?E:process.arch,r=(d=process.env.SETUP_CPP_DIR)!=null?d:rt("~"),n=[],o=[],s=Uf.create({autoloadLocales:!0});Uf.addLocale($_),y_.addLocale(g_);let i,l;const u=await Ft(),a=e.compiler!==void 0?AR(e.compiler):void 0;if(!$S(e,[...sm,"compiler"],a))return{successMessages:[],errorMessages:["The same version must be used for llvm, clang-format and clang-tidy"]};Te()&&typeof e.cppcheck=="string"&&typeof e.gcovr=="string"&&(W("installing python-pygments to avoid conflicts with cppcheck and gcovr on Arch linux"),await be("python-pygments"));const c=cm.filter(f=>{const h=e[f];return h!==void 0&&h!=="false"}),m=e["setup-cpp"]===void 0||e["setup-cpp"]?LR(xa.version,e["node-package-manager"]):Promise.resolve(void 0);let p=!1;for(const f of c){const h=e[f],y=e.timeout!==void 0?Number.parseFloat(e.timeout)*60*1e3:void 0;if(i=Date.now(),await TR(f,h,u,t,r,n,o,y),l=Date.now(),W(`took ${s.format(i,l)||"0 seconds"}`),o.length!==0&&hn.isCI){p=!0;break}}if(!p&&a!==void 0){const f=Date.now();await NR(a.compiler,a.version,u,r,t,n,o);const h=Date.now();W(`took ${s.format(f,h)||"0 seconds"}`)}const v=await m;return typeof v=="string"&&n.push(v),await Zg(ne),{successMessages:n,errorMessages:o}}async function kR(e){const t=hn.GITHUB_ACTIONS?Promise.resolve():qR(),r=fm(e);if(r.help)return FR(),0;if(r.version)return W(`${xa.version}`),0;const{successMessages:n,errorMessages:o}=await DR(r);for(const s of n)$y(s);for(const s of o)Ae(s);if((n.length!==0||o.length!==0)&&(W("setup-cpp finished"),!hn.GITHUB_ACTIONS))switch(process.platform){case"win32":{ve("Run `RefreshEnv.cmd` or restart your shell to update the environment.");break}case"linux":case"darwin":{ve("Run `source ~/.cpprc` or restart your shell to update the environment.");break}}return await t,o.length===0?0:1}async function qR(){try{await ty({pkg:xa})}catch(e){ve(`Failed to check for updates: ${e instanceof Error?e.message+e.stack:e}`)}}function fm(e){const t=Object.fromEntries(op.map(r=>[r,Sp(r)]));return Cm(e,{string:[...op,"timeout","node-package-manager"],default:t,alias:{h:"help",v:"version"},boolean:["help","version","setup-cpp"]})}function FR(){W(`
|
||
setup-cpp [options]
|
||
setup-cpp --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
|
||
|
||
Install all the tools required for building and testing C++/C projects.
|
||
|
||
--architecture the cpu architecture to install the tools for. By default it uses the current CPU architecture.
|
||
--timeout the timeout for the installation of each tool in minutes. By default it is 10 minutes.
|
||
--compiler the <compiler> to install.
|
||
You can specify the version instead of specifying just the name e.g: --compiler 'llvm-13.0.0'
|
||
--tool_name pass "true" or pass the <version> you would like to install for this tool. e.g. --conan true or --conan "1.42.1"
|
||
--nodePackageManager the node package manager to use (npm/yarn/pnpm) when installing setup-cpp globally
|
||
--help show this help message
|
||
--version show the version of setup-cpp
|
||
|
||
All the available tools:
|
||
`),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, --apt-fast, --nala, --git, --setup-cpp"},"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, --tar"}},["tools"])}process.env.SETUP_CPP_SKIP_MAIN!=="true"&&kR(process.argv).then(e=>{process.exitCode=e}).catch(e=>{Ae("main() panicked!"),Ae(e),process.exitCode=1});exports.HttpClient=vp;exports.ciInfo=Et;exports.commonjsGlobal=et;exports.coreExports=Se;exports.execExports=qn;exports.getAugmentedNamespace=$n;exports.getDefaultExportFromCjs=Oe;exports.info=W;exports.parseArgs=fm;exports.pathExists=we;exports.require$$13=Aa;exports.requireSemver=yp;exports.toolCacheExports=jn;exports.warning=ve;
|
||
//# sourceMappingURL=setup-cpp.js.map
|