mirror of https://github.com/aminya/setup-cpp.git
84 lines
319 KiB
JavaScript
84 lines
319 KiB
JavaScript
#!/usr/bin/env node
|
||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ot=require("process"),pe=require("os"),T=require("path"),ae=require("fs"),En=require("https"),Sm=require("perf_hooks"),Ea=require("http");require("net");const bm=require("tls"),Sn=require("events"),ur=require("util"),Rm=require("string_decoder"),At=require("child_process"),xr=require("assert"),Om=require("timers"),ip=require("buffer"),ct=require("url"),Cr=require("stream"),$m=require("constants"),cn=require("console");var we=typeof document<"u"?document.currentScript:null;function Sa(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 Ir=Sa(ae),ic=Sa(En),Fn=Sa(Ea),sp=Object.freeze(Object.defineProperty({__proto__:null,get default(){return sp},get randomUUID(){return ry}},Symbol.toStringTag,{value:"Module"}));function jn(e){return e==null?[]:Array.isArray(e)?e:[e]}function Im(e,t,r,n){var s,o=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((s=+r,s*0===0?s:r)),!!r):(s=+r,s*0===0?s:r);e[t]=o==null?i:Array.isArray(o)?o.concat(i):[o,i]}function Pm(e,t){e=e||[],t=t||{};var r,n,s,o,i,l={_:[]},u=0,c=0,a=0,m=e.length;const d=t.alias!==void 0,v=t.unknown!==void 0,E=t.default!==void 0;if(t.alias=t.alias||{},t.string=jn(t.string),t.boolean=jn(t.boolean),d)for(r in t.alias)for(n=t.alias[r]=jn(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]]||[],c=n.length;c-- >0;)t.boolean.push(n[c]);for(u=t.string.length;u-- >0;)for(n=t.alias[t.string[u]]||[],c=n.length;c-- >0;)t.string.push(n[c]);if(E){for(r in t.default)if(o=typeof t.default[r],n=t.alias[r]=t.alias[r]||[],t[o]!==void 0)for(t[o].push(r),u=0;u<n.length;u++)t[o].push(n[u])}const p=v?Object.keys(t.alias):[];for(u=0;u<m;u++){if(s=e[u],s==="--"){l._=l._.concat(e.slice(++u));break}for(c=0;c<s.length&&s.charCodeAt(c)===45;c++);if(c===0)l._.push(s);else if(s.substring(c,c+3)==="no-"){if(o=s.substring(c+3),v&&!~p.indexOf(o))return t.unknown(s);l[o]=!1}else{for(a=c+1;a<s.length&&s.charCodeAt(a)!==61;a++);for(o=s.substring(c,a),i=s.substring(++a)||u+1===m||(""+e[u+1]).charCodeAt(0)===45||e[++u],n=c===2?[o]:o,a=0;a<n.length;a++){if(o=n[a],v&&!~p.indexOf(o))return t.unknown("-".repeat(c)+o);Im(l,o,a+1<n.length||i,t)}}}if(E)for(r in t.default)l[r]===void 0&&(l[r]=t.default[r]);if(d)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 $e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function bn(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 s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:function(){return e[n]}})}),r}var jr={exports:{}},Un,sc;function Rn(){if(sc)return Un;sc=1;const e="2.0.0",t=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,s=t-6;return Un={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:s,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Un}var Mn,oc;function On(){return oc||(oc=1,Mn=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),Mn}var ac;function Ar(){return ac||(ac=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:s}=Rn(),o=On();t=e.exports={};const i=t.re=[],l=t.safeRe=[],u=t.src=[],c=t.safeSrc=[],a=t.t={};let m=0;const d="[a-zA-Z0-9-]",v=[["\\s",1],["\\d",s],[d,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},p=(f,h,y)=>{const w=E(h),S=m++;o(f,S,h),a[f]=S,u[S]=h,c[S]=w,i[S]=new RegExp(h,y?"g":void 0),l[S]=new RegExp(w,y?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),p("MAINVERSION",`(${u[a.NUMERICIDENTIFIER]})\\.(${u[a.NUMERICIDENTIFIER]})\\.(${u[a.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${u[a.NUMERICIDENTIFIERLOOSE]})\\.(${u[a.NUMERICIDENTIFIERLOOSE]})\\.(${u[a.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${u[a.NUMERICIDENTIFIER]}|${u[a.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${u[a.NUMERICIDENTIFIERLOOSE]}|${u[a.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${u[a.PRERELEASEIDENTIFIER]}(?:\\.${u[a.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${u[a.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[a.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${d}+`),p("BUILD",`(?:\\+(${u[a.BUILDIDENTIFIER]}(?:\\.${u[a.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${u[a.MAINVERSION]}${u[a.PRERELEASE]}?${u[a.BUILD]}?`),p("FULL",`^${u[a.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${u[a.MAINVERSIONLOOSE]}${u[a.PRERELEASELOOSE]}?${u[a.BUILD]}?`),p("LOOSE",`^${u[a.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${u[a.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${u[a.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${u[a.XRANGEIDENTIFIER]})(?:\\.(${u[a.XRANGEIDENTIFIER]})(?:\\.(${u[a.XRANGEIDENTIFIER]})(?:${u[a.PRERELEASE]})?${u[a.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${u[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[a.XRANGEIDENTIFIERLOOSE]})(?:${u[a.PRERELEASELOOSE]})?${u[a.BUILD]}?)?)?`),p("XRANGE",`^${u[a.GTLT]}\\s*${u[a.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${u[a.GTLT]}\\s*${u[a.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),p("COERCE",`${u[a.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",u[a.COERCEPLAIN]+`(?:${u[a.PRERELEASE]})?(?:${u[a.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",u[a.COERCE],!0),p("COERCERTLFULL",u[a.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${u[a.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${u[a.LONETILDE]}${u[a.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${u[a.LONETILDE]}${u[a.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${u[a.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${u[a.LONECARET]}${u[a.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${u[a.LONECARET]}${u[a.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${u[a.GTLT]}\\s*(${u[a.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${u[a.GTLT]}\\s*(${u[a.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${u[a.GTLT]}\\s*(${u[a.LOOSEPLAIN]}|${u[a.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${u[a.XRANGEPLAIN]})\\s+-\\s+(${u[a.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${u[a.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[a.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(jr,jr.exports)),jr.exports}var Gn,cc;function ba(){if(cc)return Gn;cc=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return Gn=n=>n?typeof n!="object"?e:n:t,Gn}var Vn,uc;function op(){if(uc)return Vn;uc=1;const e=/^[0-9]+$/,t=(n,s)=>{const o=e.test(n),i=e.test(s);return o&&i&&(n=+n,s=+s),n===s?0:o&&!i?-1:i&&!o?1:n<s?-1:1};return Vn={compareIdentifiers:t,rcompareIdentifiers:(n,s)=>t(s,n)},Vn}var Bn,lc;function ze(){if(lc)return Bn;lc=1;const e=On(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=Rn(),{safeRe:n,safeSrc:s,t:o}=Ar(),i=ba(),{compareIdentifiers:l}=op();class u{constructor(a,m){if(m=i(m),a instanceof u){if(a.loose===!!m.loose&&a.includePrerelease===!!m.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,m),this.options=m,this.loose=!!m.loose,this.includePrerelease=!!m.includePrerelease;const d=a.trim().match(m.loose?n[o.LOOSE]:n[o.FULL]);if(!d)throw new TypeError(`Invalid Version: ${a}`);if(this.raw=a,this.major=+d[1],this.minor=+d[2],this.patch=+d[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");d[4]?this.prerelease=d[4].split(".").map(v=>{if(/^[0-9]+$/.test(v)){const E=+v;if(E>=0&&E<r)return E}return v}):this.prerelease=[],this.build=d[5]?d[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 u)){if(typeof a=="string"&&a===this.version)return 0;a=new u(a,this.options)}return a.version===this.version?0:this.compareMain(a)||this.comparePre(a)}compareMain(a){return a instanceof u||(a=new u(a,this.options)),l(this.major,a.major)||l(this.minor,a.minor)||l(this.patch,a.patch)}comparePre(a){if(a instanceof u||(a=new u(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 m=0;do{const d=this.prerelease[m],v=a.prerelease[m];if(e("prerelease compare",m,d,v),d===void 0&&v===void 0)return 0;if(v===void 0)return 1;if(d===void 0)return-1;if(d===v)continue;return l(d,v)}while(++m)}compareBuild(a){a instanceof u||(a=new u(a,this.options));let m=0;do{const d=this.build[m],v=a.build[m];if(e("build compare",m,d,v),d===void 0&&v===void 0)return 0;if(v===void 0)return 1;if(d===void 0)return-1;if(d===v)continue;return l(d,v)}while(++m)}inc(a,m,d){if(a.startsWith("pre")){if(!m&&d===!1)throw new Error("invalid increment argument: identifier is empty");if(m){const v=new RegExp(`^${this.options.loose?s[o.PRERELEASELOOSE]:s[o.PRERELEASE]}$`),E=`-${m}`.match(v);if(!E||E[1]!==m)throw new Error(`invalid identifier: ${m}`)}}switch(a){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",m,d);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",m,d);break;case"prepatch":this.prerelease.length=0,this.inc("patch",m,d),this.inc("pre",m,d);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",m,d),this.inc("pre",m,d);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 v=Number(d)?1:0;if(this.prerelease.length===0)this.prerelease=[v];else{let E=this.prerelease.length;for(;--E>=0;)typeof this.prerelease[E]=="number"&&(this.prerelease[E]++,E=-2);if(E===-1){if(m===this.prerelease.join(".")&&d===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(v)}}if(m){let E=[m,v];d===!1&&(E=[m]),l(this.prerelease[0],m)===0?isNaN(this.prerelease[1])&&(this.prerelease=E):this.prerelease=E}break}default:throw new Error(`invalid increment argument: ${a}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Bn=u,Bn}var Hn,fc;function lr(){if(fc)return Hn;fc=1;const e=ze();return Hn=(r,n,s=!1)=>{if(r instanceof e)return r;try{return new e(r,n)}catch(o){if(!s)return null;throw o}},Hn}var zn,dc;function ap(){if(dc)return zn;dc=1;const e=lr();return zn=(r,n)=>{const s=e(r,n);return s?s.version:null},zn}var Wn,pc;function Tm(){if(pc)return Wn;pc=1;const e=lr();return Wn=(r,n)=>{const s=e(r.trim().replace(/^[=v]+/,""),n);return s?s.version:null},Wn}var Xn,hc;function xm(){if(hc)return Xn;hc=1;const e=ze();return Xn=(r,n,s,o,i)=>{typeof s=="string"&&(i=o,o=s,s=void 0);try{return new e(r instanceof e?r.version:r,s).inc(n,o,i).version}catch{return null}},Xn}var Kn,mc;function Cm(){if(mc)return Kn;mc=1;const e=lr();return Kn=(r,n)=>{const s=e(r,null,!0),o=e(n,null,!0),i=s.compare(o);if(i===0)return null;const l=i>0,u=l?s:o,c=l?o:s,a=!!u.prerelease.length;if(!!c.prerelease.length&&!a){if(!c.patch&&!c.minor)return"major";if(c.compareMain(u)===0)return c.minor&&!c.patch?"minor":"patch"}const d=a?"pre":"";return s.major!==o.major?d+"major":s.minor!==o.minor?d+"minor":s.patch!==o.patch?d+"patch":"prerelease"},Kn}var Yn,yc;function cp(){if(yc)return Yn;yc=1;const e=ze();return Yn=(r,n)=>new e(r,n).major,Yn}var Jn,vc;function Am(){if(vc)return Jn;vc=1;const e=ze();return Jn=(r,n)=>new e(r,n).minor,Jn}var Qn,wc;function Nm(){if(wc)return Qn;wc=1;const e=ze();return Qn=(r,n)=>new e(r,n).patch,Qn}var Zn,gc;function Lm(){if(gc)return Zn;gc=1;const e=lr();return Zn=(r,n)=>{const s=e(r,n);return s&&s.prerelease.length?s.prerelease:null},Zn}var ei,_c;function ut(){if(_c)return ei;_c=1;const e=ze();return ei=(r,n,s)=>new e(r,s).compare(new e(n,s)),ei}var ti,Ec;function Dm(){if(Ec)return ti;Ec=1;const e=ut();return ti=(r,n,s)=>e(n,r,s),ti}var ri,Sc;function km(){if(Sc)return ri;Sc=1;const e=ut();return ri=(r,n)=>e(r,n,!0),ri}var ni,bc;function Ra(){if(bc)return ni;bc=1;const e=ze();return ni=(r,n,s)=>{const o=new e(r,s),i=new e(n,s);return o.compare(i)||o.compareBuild(i)},ni}var ii,Rc;function qm(){if(Rc)return ii;Rc=1;const e=Ra();return ii=(r,n)=>r.sort((s,o)=>e(s,o,n)),ii}var si,Oc;function Fm(){if(Oc)return si;Oc=1;const e=Ra();return si=(r,n)=>r.sort((s,o)=>e(o,s,n)),si}var oi,$c;function $n(){if($c)return oi;$c=1;const e=ut();return oi=(r,n,s)=>e(r,n,s)>0,oi}var ai,Ic;function Oa(){if(Ic)return ai;Ic=1;const e=ut();return ai=(r,n,s)=>e(r,n,s)<0,ai}var ci,Pc;function up(){if(Pc)return ci;Pc=1;const e=ut();return ci=(r,n,s)=>e(r,n,s)===0,ci}var ui,Tc;function lp(){if(Tc)return ui;Tc=1;const e=ut();return ui=(r,n,s)=>e(r,n,s)!==0,ui}var li,xc;function $a(){if(xc)return li;xc=1;const e=ut();return li=(r,n,s)=>e(r,n,s)>=0,li}var fi,Cc;function In(){if(Cc)return fi;Cc=1;const e=ut();return fi=(r,n,s)=>e(r,n,s)<=0,fi}var di,Ac;function fp(){if(Ac)return di;Ac=1;const e=up(),t=lp(),r=$n(),n=$a(),s=Oa(),o=In();return di=(l,u,c,a)=>{switch(u){case"===":return typeof l=="object"&&(l=l.version),typeof c=="object"&&(c=c.version),l===c;case"!==":return typeof l=="object"&&(l=l.version),typeof c=="object"&&(c=c.version),l!==c;case"":case"=":case"==":return e(l,c,a);case"!=":return t(l,c,a);case">":return r(l,c,a);case">=":return n(l,c,a);case"<":return s(l,c,a);case"<=":return o(l,c,a);default:throw new TypeError(`Invalid operator: ${u}`)}},di}var pi,Nc;function dp(){if(Nc)return pi;Nc=1;const e=ze(),t=lr(),{safeRe:r,t:n}=Ar();return pi=(o,i)=>{if(o instanceof e)return o;if(typeof o=="number"&&(o=String(o)),typeof o!="string")return null;i=i||{};let l=null;if(!i.rtl)l=o.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(o))&&(!l||l.index+l[0].length!==o.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],c=l[3]||"0",a=l[4]||"0",m=i.includePrerelease&&l[5]?`-${l[5]}`:"",d=i.includePrerelease&&l[6]?`+${l[6]}`:"";return t(`${u}.${c}.${a}${m}${d}`,i)},pi}var hi,Lc;function jm(){if(Lc)return hi;Lc=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 o=this.map.keys().next().value;this.delete(o)}this.map.set(r,n)}return this}}return hi=e,hi}var mi,Dc;function wt(){if(Dc)return mi;Dc=1;const e=/\s+/g;class t{constructor(x,F){if(F=s(F),x instanceof t)return x.loose===!!F.loose&&x.includePrerelease===!!F.includePrerelease?x:new t(x.raw,F);if(x instanceof o)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=>!p(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[c.HYPHENRANGELOOSE]:u[c.HYPHENRANGE];x=x.replace(N,Y(this.options.includePrerelease)),i("hyphen replace",x),x=x.replace(u[c.COMPARATORTRIM],a),i("comparator trim",x),x=x.replace(u[c.TILDETRIM],m),i("tilde trim",x),x=x.replace(u[c.CARETTRIM],d),i("caret trim",x);let z=x.split(" ").map(K=>y(K,this.options)).join(" ").split(/\s+/).map(K=>G(K,this.options));V&&(z=z.filter(K=>(i("loose invalid filter",K,this.options),!!K.match(u[c.COMPARATORLOOSE])))),i("range list",z);const X=new Map,re=z.map(K=>new o(K,this.options));for(const K of re){if(p(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}}mi=t;const r=jm(),n=new r,s=ba(),o=Pn(),i=On(),l=ze(),{safeRe:u,t:c,comparatorTrimReplace:a,tildeTrimReplace:m,caretTrimReplace:d}=Ar(),{FLAG_INCLUDE_PRERELEASE:v,FLAG_LOOSE:E}=Rn(),p=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[c.TILDELOOSE]:u[c.TILDE];return A.replace(F,(U,q,V,N,z)=>{i("tilde",A,U,q,V,N,z);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`:z?(i("replaceTilde pr",z),X=`>=${q}.${V}.${N}-${z} <${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[c.CARETLOOSE]:u[c.CARET],U=x.includePrerelease?"-0":"";return A.replace(F,(q,V,N,z,X)=>{i("caret",A,q,V,N,z,X);let re;return w(V)?re="":w(N)?re=`>=${V}.0.0${U} <${+V+1}.0.0-0`:w(z)?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}.${z}-${X} <${V}.${N}.${+z+1}-0`:re=`>=${V}.${N}.${z}-${X} <${V}.${+N+1}.0-0`:re=`>=${V}.${N}.${z}-${X} <${+V+1}.0.0-0`):(i("no pr"),V==="0"?N==="0"?re=`>=${V}.${N}.${z}${U} <${V}.${N}.${+z+1}-0`:re=`>=${V}.${N}.${z}${U} <${V}.${+N+1}.0-0`:re=`>=${V}.${N}.${z} <${+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[c.XRANGELOOSE]:u[c.XRANGE];return A.replace(F,(U,q,V,N,z,X)=>{i("xRange",A,U,q,V,N,z,X);const re=w(V),ue=re||w(N),K=ue||w(z),ie=K;return q==="="&&ie&&(q=""),X=x.includePrerelease?"-0":"",re?q===">"||q==="<"?U="<0.0.0-0":U="*":q&&ie?(ue&&(N=0),z=0,q===">"?(q=">=",ue?(V=+V+1,N=0,z=0):(N=+N+1,z=0)):q==="<="&&(q="<",ue?V=+V+1:N=+N+1),q==="<"&&(X="-0"),U=`${q+V}.${N}.${z}${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[c.STAR],"")),G=(A,x)=>(i("replaceGTE0",A,x),A.trim().replace(u[x.includePrerelease?c.GTE0PRE:c.GTE0],"")),Y=A=>(x,F,U,q,V,N,z,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!==o.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 mi}var yi,kc;function Pn(){if(kc)return yi;kc=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(a,m){if(m=r(m),a instanceof t){if(a.loose===!!m.loose)return a;a=a.value}a=a.trim().split(/\s+/).join(" "),i("comparator",a,m),this.options=m,this.loose=!!m.loose,this.parse(a),this.semver===e?this.value="":this.value=this.operator+this.semver.version,i("comp",this)}parse(a){const m=this.options.loose?n[s.COMPARATORLOOSE]:n[s.COMPARATOR],d=a.match(m);if(!d)throw new TypeError(`Invalid comparator: ${a}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new l(d[2],this.options.loose):this.semver=e}toString(){return this.value}test(a){if(i("Comparator.test",a,this.options.loose),this.semver===e||a===e)return!0;if(typeof a=="string")try{a=new l(a,this.options)}catch{return!1}return o(a,this.operator,this.semver,this.options)}intersects(a,m){if(!(a instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(a.value,m).test(this.value):a.operator===""?a.value===""?!0:new u(this.value,m).test(a.semver):(m=r(m),m.includePrerelease&&(this.value==="<0.0.0-0"||a.value==="<0.0.0-0")||!m.includePrerelease&&(this.value.startsWith("<0.0.0")||a.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&a.operator.startsWith(">")||this.operator.startsWith("<")&&a.operator.startsWith("<")||this.semver.version===a.semver.version&&this.operator.includes("=")&&a.operator.includes("=")||o(this.semver,"<",a.semver,m)&&this.operator.startsWith(">")&&a.operator.startsWith("<")||o(this.semver,">",a.semver,m)&&this.operator.startsWith("<")&&a.operator.startsWith(">")))}}yi=t;const r=ba(),{safeRe:n,t:s}=Ar(),o=fp(),i=On(),l=ze(),u=wt();return yi}var vi,qc;function Nr(){if(qc)return vi;qc=1;const e=wt();return vi=(r,n,s)=>{try{n=new e(n,s)}catch{return!1}return n.test(r)},vi}var wi,Fc;function Um(){if(Fc)return wi;Fc=1;const e=wt();return wi=(r,n)=>new e(r,n).set.map(s=>s.map(o=>o.value).join(" ").trim().split(" ")),wi}var gi,jc;function Mm(){if(jc)return gi;jc=1;const e=ze(),t=wt();return gi=(n,s,o)=>{let i=null,l=null,u=null;try{u=new t(s,o)}catch{return null}return n.forEach(c=>{u.test(c)&&(!i||l.compare(c)===-1)&&(i=c,l=new e(i,o))}),i},gi}var _i,Uc;function Gm(){if(Uc)return _i;Uc=1;const e=ze(),t=wt();return _i=(n,s,o)=>{let i=null,l=null,u=null;try{u=new t(s,o)}catch{return null}return n.forEach(c=>{u.test(c)&&(!i||l.compare(c)===1)&&(i=c,l=new e(i,o))}),i},_i}var Ei,Mc;function Vm(){if(Mc)return Ei;Mc=1;const e=ze(),t=wt(),r=$n();return Ei=(s,o)=>{s=new t(s,o);let i=new e("0.0.0");if(s.test(i)||(i=new e("0.0.0-0"),s.test(i)))return i;i=null;for(let l=0;l<s.set.length;++l){const u=s.set[l];let c=null;u.forEach(a=>{const m=new e(a.semver.version);switch(a.operator){case">":m.prerelease.length===0?m.patch++:m.prerelease.push(0),m.raw=m.format();case"":case">=":(!c||r(m,c))&&(c=m);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),c&&(!i||r(i,c))&&(i=c)}return i&&s.test(i)?i:null},Ei}var Si,Gc;function Bm(){if(Gc)return Si;Gc=1;const e=wt();return Si=(r,n)=>{try{return new e(r,n).range||"*"}catch{return null}},Si}var bi,Vc;function Ia(){if(Vc)return bi;Vc=1;const e=ze(),t=Pn(),{ANY:r}=t,n=wt(),s=Nr(),o=$n(),i=Oa(),l=In(),u=$a();return bi=(a,m,d,v)=>{a=new e(a,v),m=new n(m,v);let E,p,f,h,y;switch(d){case">":E=o,p=l,f=i,h=">",y=">=";break;case"<":E=i,p=u,f=o,h="<",y="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(s(a,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)&&p(a,b.semver))return!1;if(b.operator===y&&f(a,b.semver))return!1}return!0},bi}var Ri,Bc;function Hm(){if(Bc)return Ri;Bc=1;const e=Ia();return Ri=(r,n,s)=>e(r,n,">",s),Ri}var Oi,Hc;function zm(){if(Hc)return Oi;Hc=1;const e=Ia();return Oi=(r,n,s)=>e(r,n,"<",s),Oi}var $i,zc;function Wm(){if(zc)return $i;zc=1;const e=wt();return $i=(r,n,s)=>(r=new e(r,s),n=new e(n,s),r.intersects(n,s)),$i}var Ii,Wc;function Xm(){if(Wc)return Ii;Wc=1;const e=Nr(),t=ut();return Ii=(r,n,s)=>{const o=[];let i=null,l=null;const u=r.sort((d,v)=>t(d,v,s));for(const d of u)e(d,n,s)?(l=d,i||(i=d)):(l&&o.push([i,l]),l=null,i=null);i&&o.push([i,null]);const c=[];for(const[d,v]of o)d===v?c.push(d):!v&&d===u[0]?c.push("*"):v?d===u[0]?c.push(`<=${v}`):c.push(`${d} - ${v}`):c.push(`>=${d}`);const a=c.join(" || "),m=typeof n.raw=="string"?n.raw:String(n);return a.length<m.length?a:n},Ii}var Pi,Xc;function Km(){if(Xc)return Pi;Xc=1;const e=wt(),t=Pn(),{ANY:r}=t,n=Nr(),s=ut(),o=(m,d,v={})=>{if(m===d)return!0;m=new e(m,v),d=new e(d,v);let E=!1;e:for(const p of m.set){for(const f of d.set){const h=u(p,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,d,v)=>{if(m===d)return!0;if(m.length===1&&m[0].semver===r){if(d.length===1&&d[0].semver===r)return!0;v.includePrerelease?m=i:m=l}if(d.length===1&&d[0].semver===r){if(v.includePrerelease)return!0;d=l}const E=new Set;let p,f;for(const O of m)O.operator===">"||O.operator===">="?p=c(p,O,v):O.operator==="<"||O.operator==="<="?f=a(f,O,v):E.add(O.semver);if(E.size>1)return null;let h;if(p&&f){if(h=s(p.semver,f.semver,v),h>0)return null;if(h===0&&(p.operator!==">="||f.operator!=="<="))return null}for(const O of E){if(p&&!n(O,String(p),v)||f&&!n(O,String(f),v))return null;for(const $ of d)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=p&&!v.includePrerelease&&p.semver.prerelease.length?p.semver:!1;b&&b.prerelease.length===1&&f.operator==="<"&&b.prerelease[0]===0&&(b=!1);for(const O of d){if(_=_||O.operator===">"||O.operator===">=",S=S||O.operator==="<"||O.operator==="<=",p){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=c(p,O,v),y===O&&y!==p)return!1}else if(p.operator===">="&&!n(p.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=a(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||p)&&h!==0)return!1}return!(p&&S&&!f&&h!==0||f&&_&&!p&&h!==0||g||b)},c=(m,d,v)=>{if(!m)return d;const E=s(m.semver,d.semver,v);return E>0?m:E<0||d.operator===">"&&m.operator===">="?d:m},a=(m,d,v)=>{if(!m)return d;const E=s(m.semver,d.semver,v);return E<0?m:E>0||d.operator==="<"&&m.operator==="<="?d:m};return Pi=o,Pi}var Ti,Kc;function pp(){if(Kc)return Ti;Kc=1;const e=Ar(),t=Rn(),r=ze(),n=op(),s=lr(),o=ap(),i=Tm(),l=xm(),u=Cm(),c=cp(),a=Am(),m=Nm(),d=Lm(),v=ut(),E=Dm(),p=km(),f=Ra(),h=qm(),y=Fm(),w=$n(),S=Oa(),_=up(),b=lp(),g=$a(),O=In(),$=fp(),C=dp(),G=Pn(),Y=wt(),Q=Nr(),A=Um(),x=Mm(),F=Gm(),U=Vm(),q=Bm(),V=Ia(),N=Hm(),z=zm(),X=Wm(),re=Xm(),ue=Km();return Ti={parse:s,valid:o,clean:i,inc:l,diff:u,major:c,minor:a,patch:m,prerelease:d,compare:v,rcompare:E,compareLoose:p,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:z,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},Ti}var xi,Yc;function Ym(){if(Yc)return xi;Yc=1;var e=ot,t=pp(),r=pe,n=T,s=ae,o=En;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,c=e.env.npm_config_user_agent,a=!!(c&&c.startsWith("npm")),m=!!(u&&u.endsWith("package.json")),d=a||m,v=!!(c&&c.startsWith("yarn")),E=d||v,p=r.homedir(),f=process.env.XDG_CONFIG_HOME||n.join(p,".config","simple-update-notifier"),h=function($){return n.join(f,"".concat($.replace("@","").replace("/","__"),".json"))},y=function(){s.existsSync(f)||s.mkdirSync(f,{recursive:!0})},w=function($){var C=h($);try{if(!s.existsSync(C))return;var G=JSON.parse(s.readFileSync(C,"utf8"));return G.lastUpdateCheck}catch{return}},S=function($){var C=h($);s.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){o.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 xi=O,xi}var Jm=Ym();const Qm=$e(Jm),Zm="setup-cpp",ey="1.5.3",Pa={name:Zm,version:ey};var lt={},Ye={},Ut={},Jc;function Ta(){if(Jc)return Ut;Jc=1,Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.toCommandProperties=Ut.toCommandValue=void 0;function e(r){return r==null?"":typeof r=="string"||r instanceof String?r:JSON.stringify(r)}Ut.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 Ut.toCommandProperties=t,Ut}var Qc;function ty(){if(Qc)return Ye;Qc=1;var e=Ye&&Ye.__createBinding||(Object.create?function(m,d,v,E){E===void 0&&(E=v);var p=Object.getOwnPropertyDescriptor(d,v);(!p||("get"in p?!d.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return d[v]}}),Object.defineProperty(m,E,p)}:function(m,d,v,E){E===void 0&&(E=v),m[E]=d[v]}),t=Ye&&Ye.__setModuleDefault||(Object.create?function(m,d){Object.defineProperty(m,"default",{enumerable:!0,value:d})}:function(m,d){m.default=d}),r=Ye&&Ye.__importStar||function(m){if(m&&m.__esModule)return m;var d={};if(m!=null)for(var v in m)v!=="default"&&Object.prototype.hasOwnProperty.call(m,v)&&e(d,m,v);return t(d,m),d};Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.issue=Ye.issueCommand=void 0;const n=r(pe),s=Ta();function o(m,d,v){const E=new u(m,d,v);process.stdout.write(E.toString()+n.EOL)}Ye.issueCommand=o;function i(m,d=""){o(m,{},d)}Ye.issue=i;const l="::";class u{constructor(d,v,E){d||(d="missing.command"),this.command=d,this.properties=v,this.message=E}toString(){let d=l+this.command;if(this.properties&&Object.keys(this.properties).length>0){d+=" ";let v=!0;for(const E in this.properties)if(this.properties.hasOwnProperty(E)){const p=this.properties[E];p&&(v?v=!1:d+=",",d+=`${E}=${a(p)}`)}}return d+=`${l}${c(this.message)}`,d}}function c(m){return(0,s.toCommandValue)(m).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function a(m){return(0,s.toCommandValue)(m).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}return Ye}var Je={},np;(np=global.crypto)!=null&&np.randomUUID||(global.crypto||(global.crypto={}),global.crypto.randomUUID=()=>{let e=new Date().getTime(),t=Sm.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 ry=global.crypto.randomUUID.bind(global.crypto),xa=bn(sp);var Zc;function ny(){if(Zc)return Je;Zc=1;var e=Je&&Je.__createBinding||(Object.create?function(c,a,m,d){d===void 0&&(d=m);var v=Object.getOwnPropertyDescriptor(a,m);(!v||("get"in v?!a.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return a[m]}}),Object.defineProperty(c,d,v)}:function(c,a,m,d){d===void 0&&(d=m),c[d]=a[m]}),t=Je&&Je.__setModuleDefault||(Object.create?function(c,a){Object.defineProperty(c,"default",{enumerable:!0,value:a})}:function(c,a){c.default=a}),r=Je&&Je.__importStar||function(c){if(c&&c.__esModule)return c;var a={};if(c!=null)for(var m in c)m!=="default"&&Object.prototype.hasOwnProperty.call(c,m)&&e(a,c,m);return t(a,c),a};Object.defineProperty(Je,"__esModule",{value:!0}),Je.prepareKeyValueMessage=Je.issueFileCommand=void 0;const n=r(xa),s=r(ae),o=r(pe),i=Ta();function l(c,a){const m=process.env[`GITHUB_${c}`];if(!m)throw new Error(`Unable to find environment variable for file command ${c}`);if(!s.existsSync(m))throw new Error(`Missing file at path: ${m}`);s.appendFileSync(m,`${(0,i.toCommandValue)(a)}${o.EOL}`,{encoding:"utf8"})}Je.issueFileCommand=l;function u(c,a){const m=`ghadelimiter_${n.randomUUID()}`,d=(0,i.toCommandValue)(a);if(c.includes(m))throw new Error(`Unexpected input: name should not contain the delimiter "${m}"`);if(d.includes(m))throw new Error(`Unexpected input: value should not contain the delimiter "${m}"`);return`${c}<<${m}${o.EOL}${d}${o.EOL}${m}`}return Je.prepareKeyValueMessage=u,Je}var Mt={};function ya(e){const t=e.protocol==="https:";if(iy(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 eu(r)}catch{if(!r.startsWith("http://")&&!r.startsWith("https://"))return new eu(`http://${r}`)}else return}function iy(e){if(!e.hostname)return!1;const t=e.hostname;if(sy(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 s=[e.hostname.toUpperCase()];typeof n=="number"&&s.push(`${s[0]}:${n}`);for(const o of r.split(",").map(i=>i.trim().toUpperCase()).filter(i=>i))if(o==="*"||s.some(i=>i===o||i.endsWith(`.${o}`)||o.startsWith(".")&&i.endsWith(`${o}`)))return!0;return!1}function sy(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 eu 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 Gt={},tu;function oy(){if(tu)return Gt;tu=1;var e=bm,t=Ea,r=En,n=Sn,s=ur;Gt.httpOverHttp=o,Gt.httpsOverHttp=i,Gt.httpOverHttps=l,Gt.httpsOverHttps=u;function o(E){var p=new c(E);return p.request=t.request,p}function i(E){var p=new c(E);return p.request=t.request,p.createSocket=a,p.defaultPort=443,p}function l(E){var p=new c(E);return p.request=r.request,p}function u(E){var p=new c(E);return p.request=r.request,p.createSocket=a,p.defaultPort=443,p}function c(E){var p=this;p.options=E||{},p.proxyOptions=p.options.proxy||{},p.maxSockets=p.options.maxSockets||t.Agent.defaultMaxSockets,p.requests=[],p.sockets=[],p.on("free",function(h,y,w,S){for(var _=m(y,w,S),b=0,g=p.requests.length;b<g;++b){var O=p.requests[b];if(O.host===_.host&&O.port===_.port){p.requests.splice(b,1),O.request.onSocket(h);return}}h.destroy(),p.removeSocket(h)})}s.inherits(c,n.EventEmitter),c.prototype.addRequest=function(p,f,h,y){var w=this,S=d({request:p},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),p.onSocket(_);function b(){w.emit("free",_,S)}function g(O){w.removeSocket(_),_.removeListener("free",b),_.removeListener("close",g),_.removeListener("agentRemove",g)}})},c.prototype.createSocket=function(p,f){var h=this,y={};h.sockets.push(y);var w=d({},h.proxyOptions,{method:"CONNECT",path:p.host+":"+p.port,agent:!1,headers:{host:p.host+":"+p.port}});p.localAddress&&(w.localAddress=p.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",p.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",p.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",p.request.emit("error",C),h.removeSocket(y)}},c.prototype.removeSocket=function(p){var f=this.sockets.indexOf(p);if(f!==-1){this.sockets.splice(f,1);var h=this.requests.shift();h&&this.createSocket(h,function(y){h.request.onSocket(y)})}};function a(E,p){var f=this;c.prototype.createSocket.call(f,E,function(h){var y=E.request.getHeader("host"),w=d({},f.options,{socket:h,servername:y?y.replace(/:.*$/,""):E.host}),S=e.connect(0,w);f.sockets[f.sockets.indexOf(h)]=S,p(S)})}function m(E,p,f){return typeof E=="string"?{host:E,port:p,localAddress:f}:E}function d(E){for(var p=1,f=arguments.length;p<f;++p){var h=arguments[p];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(){},Gt.debug=v,Gt}var Ci,ru;function ay(){return ru||(ru=1,Ci=oy()),Ci}var Ur=ay(),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 Fe;(function(e){e.Accept="accept",e.ContentType="content-type"})(Fe||(Fe={}));var Ot;(function(e){e.ApplicationJson="application/json"})(Ot||(Ot={}));function cy(e){const t=ya(new URL(e));return t?t.href:""}const uy=[tt.MovedPermanently,tt.ResourceMoved,tt.SeeOther,tt.TemporaryRedirect,tt.PermanentRedirect],ly=[tt.BadGateway,tt.ServiceUnavailable,tt.GatewayTimeout],fy=["OPTIONS","GET","DELETE","HEAD"],dy=10,py=5;class Tn extends Error{constructor(t,r){super(t),this.name="HttpClientError",this.statusCode=r,Object.setPrototypeOf(this,Tn.prototype)}statusCode;result}class hp{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 hy(e){return new URL(e).protocol==="https:"}class mp{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,s){return this.request(t,r,n,s)}async getJson(t,r={}){r[Fe.Accept]=this._getExistingOrDefaultHeader(r,Fe.Accept,Ot.ApplicationJson);const n=await this.get(t,r);return this._processResponse(n,this.requestOptions)}async postJson(t,r,n={}){const s=JSON.stringify(r,null,2);n[Fe.Accept]=this._getExistingOrDefaultHeader(n,Fe.Accept,Ot.ApplicationJson),n[Fe.ContentType]=this._getExistingOrDefaultHeader(n,Fe.ContentType,Ot.ApplicationJson);const o=await this.post(t,s,n);return this._processResponse(o,this.requestOptions)}async putJson(t,r,n={}){const s=JSON.stringify(r,null,2);n[Fe.Accept]=this._getExistingOrDefaultHeader(n,Fe.Accept,Ot.ApplicationJson),n[Fe.ContentType]=this._getExistingOrDefaultHeader(n,Fe.ContentType,Ot.ApplicationJson);const o=await this.put(t,s,n);return this._processResponse(o,this.requestOptions)}async patchJson(t,r,n={}){const s=JSON.stringify(r,null,2);n[Fe.Accept]=this._getExistingOrDefaultHeader(n,Fe.Accept,Ot.ApplicationJson),n[Fe.ContentType]=this._getExistingOrDefaultHeader(n,Fe.ContentType,Ot.ApplicationJson);const o=await this.patch(t,s,n);return this._processResponse(o,this.requestOptions)}async request(t,r,n,s){if(this._disposed)throw new Error("Client has already been disposed.");const o=new URL(r);let i=this._prepareRequest(t,o,s);const l=this._allowRetries&&fy.includes(t)?this._maxRetries+1:1;let u=0,c;do{if(c=await this.requestRaw(i,n),c&&c.message&&c.message.statusCode===tt.Unauthorized){let m;for(const d of this.handlers)if(d.canHandleAuthentication(c)){m=d;break}return m?m.handleAuthentication(this,i,n):c}let a=this._maxRedirects;for(;c.message.statusCode&&uy.includes(c.message.statusCode)&&this._allowRedirects&&a>0;){const m=c.message.headers.location;if(!m)break;const d=new URL(m);if(o.protocol==="https:"&&o.protocol!==d.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 c.readBody(),d.hostname!==o.hostname)for(const v in s)v.toLowerCase()==="authorization"&&delete s[v];i=this._prepareRequest(t,d,s),c=await this.requestRaw(i,n),a--}if(!c.message.statusCode||!ly.includes(c.message.statusCode))return c;u+=1,u<l&&(await c.readBody(),await this._performExponentialBackoff(u))}while(u<l);return c}dispose(){this._agent&&this._agent.destroy(),this._disposed=!0}async requestRaw(t,r){return new Promise((n,s)=>{function o(i,l){i?s(i):l?n(l):s(new Error("Unknown error"))}this.requestRawWithCallback(t,r,o)})}requestRawWithCallback(t,r,n){typeof r=="string"&&(t.options.headers||(t.options.headers={}),t.options.headers["Content-Length"]=Buffer.byteLength(r,"utf8"));let s=!1;function o(u,c){s||(s=!0,n(u,c))}const i=t.httpModule.request(t.options,u=>{const c=new hp(u);o(void 0,c)});let l;i.on("socket",u=>{l=u}),i.setTimeout(this._socketTimeout||3*6e4,()=>{l&&l.end(),o(new Error(`Request timeout: ${t.options.path}`))}),i.on("error",function(u){o(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=ya(r);if(n&&n.hostname)return await this._getProxyAgentDispatcher(r,n)}_prepareRequest(t,r,n){const s={};s.parsedUrl=r;const o=s.parsedUrl.protocol==="https:";s.httpModule=o?ic:Fn;const i=o?443:80;if(s.options={},s.options.host=s.parsedUrl.hostname,s.options.port=s.parsedUrl.port?parseInt(s.parsedUrl.port):i,s.options.path=(s.parsedUrl.pathname||"")+(s.parsedUrl.search||""),s.options.method=t,s.options.headers=this._mergeHeaders(n),this.userAgent!=null&&(s.options.headers["user-agent"]=this.userAgent),s.options.agent=this._getAgent(s.parsedUrl),this.handlers)for(const l of this.handlers)l.prepareRequest(s.options);return s}_mergeHeaders(t){return this.requestOptions&&this.requestOptions.headers?Object.assign({},Mr(this.requestOptions.headers),Mr(t||{})):Mr(t||{})}_getExistingOrDefaultHeader(t,r,n){let s;return this.requestOptions&&this.requestOptions.headers&&(s=Mr(this.requestOptions.headers)[r]),t[r]||s||n}_getAgent(t){let r;const n=ya(t),s=n&&n.hostname;if(this._keepAlive&&s&&(r=this._proxyAgent),s||(r=this._agent),r)return r;const o=t.protocol==="https:";let i=100;if(this.requestOptions&&(i=this.requestOptions.maxSockets||Fn.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 c=n.protocol==="https:";o?u=c?Ur.httpsOverHttps:Ur.httpsOverHttp:u=c?Ur.httpOverHttps:Ur.httpOverHttp,r=u(l),this._proxyAgent=r}if(!r){const l={keepAlive:this._keepAlive,maxSockets:i};r=o?new ic.Agent(l):new Fn.Agent(l),this._agent=r}return o&&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 s=t.protocol==="https:",o=await Promise.resolve().then(()=>require("./assets/proxy-agent-DrLNheMy.js")).then(i=>i.proxyAgent);return n=new o({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,s&&this._ignoreSslError&&(n.options=Object.assign(n.options.requestTls||{},{rejectUnauthorized:!1})),n}async _performExponentialBackoff(t){t=Math.min(dy,t);const r=py*Math.pow(2,t);return new Promise(n=>setTimeout(()=>n(),r))}async _processResponse(t,r){return new Promise(async(n,s)=>{const o=t.message.statusCode||0,i={statusCode:o,result:null,headers:{}};o===tt.NotFound&&n(i);function l(a,m){if(typeof m=="string"){const d=new Date(m);if(!isNaN(d.valueOf()))return d}return m}let u,c;try{c=await t.readBody(),c&&c.length>0&&(r&&r.deserializeDates?u=JSON.parse(c,l):u=JSON.parse(c),i.result=u),i.headers=t.message.headers}catch{}if(o>299){let a;u&&u.message?a=u.message:c&&c.length>0?a=c:a=`Failed request: (${o})`;const m=new Tn(a,o);m.result=i.result,s(m)}else n(i)})}}const Mr=e=>Object.keys(e).reduce((t,r)=>(t[r.toLowerCase()]=e[r],t),{}),my=Object.freeze(Object.defineProperty({__proto__:null,get Headers(){return Fe},HttpClient:mp,HttpClientError:Tn,HttpClientResponse:hp,get HttpCodes(){return tt},get MediaTypes(){return Ot},getProxyUrl:cy,isHttps:hy},Symbol.toStringTag,{value:"Module"})),yp=bn(my);var ft={},nu;function yy(){if(nu)return ft;nu=1;var e=ft&&ft.__awaiter||function(s,o,i,l){function u(c){return c instanceof i?c:new i(function(a){a(c)})}return new(i||(i=Promise))(function(c,a){function m(E){try{v(l.next(E))}catch(p){a(p)}}function d(E){try{v(l.throw(E))}catch(p){a(p)}}function v(E){E.done?c(E.value):u(E.value).then(m,d)}v((l=l.apply(s,o||[])).next())})};Object.defineProperty(ft,"__esModule",{value:!0}),ft.PersonalAccessTokenCredentialHandler=ft.BearerCredentialHandler=ft.BasicCredentialHandler=void 0;class t{constructor(o,i){this.username=o,this.password=i}prepareRequest(o){if(!o.headers)throw Error("The request has no headers");o.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")})}}ft.BasicCredentialHandler=t;class r{constructor(o){this.token=o}prepareRequest(o){if(!o.headers)throw Error("The request has no headers");o.headers.Authorization=`Bearer ${this.token}`}canHandleAuthentication(){return!1}handleAuthentication(){return e(this,void 0,void 0,function*(){throw new Error("not implemented")})}}ft.BearerCredentialHandler=r;class n{constructor(o){this.token=o}prepareRequest(o){if(!o.headers)throw Error("The request has no headers");o.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 ft.PersonalAccessTokenCredentialHandler=n,ft}var iu;function vy(){if(iu)return Mt;iu=1;var e=Mt&&Mt.__awaiter||function(o,i,l,u){function c(a){return a instanceof l?a:new l(function(m){m(a)})}return new(l||(l=Promise))(function(a,m){function d(p){try{E(u.next(p))}catch(f){m(f)}}function v(p){try{E(u.throw(p))}catch(f){m(f)}}function E(p){p.done?a(p.value):c(p.value).then(d,v)}E((u=u.apply(o,i||[])).next())})};Object.defineProperty(Mt,"__esModule",{value:!0}),Mt.OidcClient=void 0;const t=yp,r=yy(),n=fr();class s{static createHttpClient(i=!0,l=10){const u={allowRetries:i,maxRetries:l};return new t.HttpClient("actions/oidc-client",[new r.BearerCredentialHandler(s.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 a=(l=(yield s.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(!a)throw new Error("Response json body do not have ID Token field");return a})}static getIDToken(i){return e(this,void 0,void 0,function*(){try{let l=s.getIDTokenUrl();if(i){const c=encodeURIComponent(i);l=`${l}&audience=${c}`}(0,n.debug)(`ID token url is ${l}`);const u=yield s.getCall(l);return(0,n.setSecret)(u),u}catch(l){throw new Error(`Error message: ${l.message}`)}})}}return Mt.OidcClient=s,Mt}var gr={},su;function ou(){return su||(su=1,function(e){var t=gr&&gr.__awaiter||function(c,a,m,d){function v(E){return E instanceof m?E:new m(function(p){p(E)})}return new(m||(m=Promise))(function(E,p){function f(w){try{y(d.next(w))}catch(S){p(S)}}function h(w){try{y(d.throw(w))}catch(S){p(S)}}function y(w){w.done?E(w.value):v(w.value).then(f,h)}y((d=d.apply(c,a||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.summary=e.markdownSummary=e.SUMMARY_DOCS_URL=e.SUMMARY_ENV_VAR=void 0;const r=pe,n=ae,{access:s,appendFile:o,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 a=process.env[e.SUMMARY_ENV_VAR];if(!a)throw new Error(`Unable to find environment variable for $${e.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);try{yield s(a,n.constants.R_OK|n.constants.W_OK)}catch{throw new Error(`Unable to access summary file: '${a}'. Check if the file has correct read/write permissions.`)}return this._filePath=a,this._filePath})}wrap(a,m,d={}){const v=Object.entries(d).map(([E,p])=>` ${E}="${p}"`).join("");return m?`<${a}${v}>${m}</${a}>`:`<${a}${v}>`}write(a){return t(this,void 0,void 0,function*(){const m=!!(a!=null&&a.overwrite),d=yield this.filePath();return yield(m?i:o)(d,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(a,m=!1){return this._buffer+=a,m?this.addEOL():this}addEOL(){return this.addRaw(r.EOL)}addCodeBlock(a,m){const d=Object.assign({},m&&{lang:m}),v=this.wrap("pre",this.wrap("code",a),d);return this.addRaw(v).addEOL()}addList(a,m=!1){const d=m?"ol":"ul",v=a.map(p=>this.wrap("li",p)).join(""),E=this.wrap(d,v);return this.addRaw(E).addEOL()}addTable(a){const m=a.map(v=>{const E=v.map(p=>{if(typeof p=="string")return this.wrap("td",p);const{header:f,data:h,colspan:y,rowspan:w}=p,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(""),d=this.wrap("table",m);return this.addRaw(d).addEOL()}addDetails(a,m){const d=this.wrap("details",this.wrap("summary",a)+m);return this.addRaw(d).addEOL()}addImage(a,m,d){const{width:v,height:E}=d||{},p=Object.assign(Object.assign({},v&&{width:v}),E&&{height:E}),f=this.wrap("img",null,Object.assign({src:a,alt:m},p));return this.addRaw(f).addEOL()}addHeading(a,m){const d=`h${m}`,v=["h1","h2","h3","h4","h5","h6"].includes(d)?d:"h1",E=this.wrap(v,a);return this.addRaw(E).addEOL()}addSeparator(){const a=this.wrap("hr",null);return this.addRaw(a).addEOL()}addBreak(){const a=this.wrap("br",null);return this.addRaw(a).addEOL()}addQuote(a,m){const d=Object.assign({},m&&{cite:m}),v=this.wrap("blockquote",a,d);return this.addRaw(v).addEOL()}addLink(a,m){const d=this.wrap("a",a,{href:m});return this.addRaw(d).addEOL()}}const u=new l;e.markdownSummary=u,e.summary=u}(gr)),gr}var Me={},au;function wy(){if(au)return Me;au=1;var e=Me&&Me.__createBinding||(Object.create?function(l,u,c,a){a===void 0&&(a=c);var m=Object.getOwnPropertyDescriptor(u,c);(!m||("get"in m?!u.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return u[c]}}),Object.defineProperty(l,a,m)}:function(l,u,c,a){a===void 0&&(a=c),l[a]=u[c]}),t=Me&&Me.__setModuleDefault||(Object.create?function(l,u){Object.defineProperty(l,"default",{enumerable:!0,value:u})}:function(l,u){l.default=u}),r=Me&&Me.__importStar||function(l){if(l&&l.__esModule)return l;var u={};if(l!=null)for(var c in l)c!=="default"&&Object.prototype.hasOwnProperty.call(l,c)&&e(u,l,c);return t(u,l),u};Object.defineProperty(Me,"__esModule",{value:!0}),Me.toPlatformPath=Me.toWin32Path=Me.toPosixPath=void 0;const n=r(T);function s(l){return l.replace(/[\\]/g,"/")}Me.toPosixPath=s;function o(l){return l.replace(/[/]/g,"\\")}Me.toWin32Path=o;function i(l){return l.replace(/[/\\]/g,n.sep)}return Me.toPlatformPath=i,Me}var Qe={},Ge={},Ve={},Re={},dt={},cu;function vp(){return cu||(cu=1,function(e){var t=dt&&dt.__createBinding||(Object.create?function(p,f,h,y){y===void 0&&(y=h),Object.defineProperty(p,y,{enumerable:!0,get:function(){return f[h]}})}:function(p,f,h,y){y===void 0&&(y=h),p[y]=f[h]}),r=dt&&dt.__setModuleDefault||(Object.create?function(p,f){Object.defineProperty(p,"default",{enumerable:!0,value:f})}:function(p,f){p.default=f}),n=dt&&dt.__importStar||function(p){if(p&&p.__esModule)return p;var f={};if(p!=null)for(var h in p)h!=="default"&&Object.hasOwnProperty.call(p,h)&&t(f,p,h);return r(f,p),f},s=dt&&dt.__awaiter||function(p,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(p,f||[])).next())})},o;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);o=i.promises,e.chmod=o.chmod,e.copyFile=o.copyFile,e.lstat=o.lstat,e.mkdir=o.mkdir,e.open=o.open,e.readdir=o.readdir,e.readlink=o.readlink,e.rename=o.rename,e.rm=o.rm,e.rmdir=o.rmdir,e.stat=o.stat,e.symlink=o.symlink,e.unlink=o.unlink,e.IS_WINDOWS=process.platform==="win32",e.UV_FS_O_EXLOCK=268435456,e.READONLY=i.constants.O_RDONLY;function u(p){return s(this,void 0,void 0,function*(){try{yield e.stat(p)}catch(f){if(f.code==="ENOENT")return!1;throw f}return!0})}e.exists=u;function c(p,f=!1){return s(this,void 0,void 0,function*(){return(f?yield e.stat(p):yield e.lstat(p)).isDirectory()})}e.isDirectory=c;function a(p){if(p=d(p),!p)throw new Error('isRooted() parameter "p" cannot be empty');return e.IS_WINDOWS?p.startsWith("\\")||/^[A-Z]:/i.test(p):p.startsWith("/")}e.isRooted=a;function m(p,f){return s(this,void 0,void 0,function*(){let h;try{h=yield e.stat(p)}catch(w){w.code!=="ENOENT"&&console.log(`Unexpected error attempting to determine if executable file exists '${p}': ${w}`)}if(h&&h.isFile()){if(e.IS_WINDOWS){const w=l.extname(p).toUpperCase();if(f.some(S=>S.toUpperCase()===w))return p}else if(v(h))return p}const y=p;for(const w of f){p=y+w,h=void 0;try{h=yield e.stat(p)}catch(S){S.code!=="ENOENT"&&console.log(`Unexpected error attempting to determine if executable file exists '${p}': ${S}`)}if(h&&h.isFile()){if(e.IS_WINDOWS){try{const S=l.dirname(p),_=l.basename(p).toUpperCase();for(const b of yield e.readdir(S))if(_===b.toUpperCase()){p=l.join(S,b);break}}catch(S){console.log(`Unexpected error attempting to determine the actual case of the file '${p}': ${S}`)}return p}else if(v(h))return p}}return""})}e.tryGetExecutablePath=m;function d(p){return p=p||"",e.IS_WINDOWS?(p=p.replace(/\//g,"\\"),p.replace(/\\\\+/g,"\\")):p.replace(/\/\/+/g,"/")}function v(p){return(p.mode&1)>0||(p.mode&8)>0&&p.gid===process.getgid()||(p.mode&64)>0&&p.uid===process.getuid()}function E(){var p;return(p=process.env.COMSPEC)!==null&&p!==void 0?p:"cmd.exe"}e.getCmdPath=E}(dt)),dt}var uu;function wp(){if(uu)return Re;uu=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 s=xr,o=r(T),i=r(vp());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()&&_?o.join(h,o.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(o.relative(f,g)==="")throw new Error(`'${g}' and '${f}' are the same file`);yield p(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=o.join(h,o.basename(f)),w=yield i.exists(h)),w)if(y.force==null||y.force)yield c(h);else throw new Error("Destination already exists")}yield a(o.dirname(h)),yield i.rename(f,h)})}Re.mv=u;function c(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=c;function a(f){return n(this,void 0,void 0,function*(){s.ok(f,"a path argument must be provided"),yield i.mkdir(f,{recursive:!0})})}Re.mkdirP=a;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 d(f);return y&&y.length>0?y[0]:""})}Re.which=m;function d(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(o.delimiter))S&&h.push(S);if(i.isRooted(f)){const S=yield i.tryGetExecutablePath(f,h);return S?[S]:[]}if(f.includes(o.sep))return[];const y=[];if(process.env.PATH)for(const S of process.env.PATH.split(o.delimiter))S&&y.push(S);const w=[];for(const S of y){const _=yield i.tryGetExecutablePath(o.join(S,f),h);_&&w.push(_)}return w})}Re.findInPath=d;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 a(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 p(b,g,w)}yield i.chmod(h,(yield i.stat(f)).mode)})}function p(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 lu;function gy(){if(lu)return Ve;lu=1;var e=Ve&&Ve.__createBinding||(Object.create?function(p,f,h,y){y===void 0&&(y=h),Object.defineProperty(p,y,{enumerable:!0,get:function(){return f[h]}})}:function(p,f,h,y){y===void 0&&(y=h),p[y]=f[h]}),t=Ve&&Ve.__setModuleDefault||(Object.create?function(p,f){Object.defineProperty(p,"default",{enumerable:!0,value:f})}:function(p,f){p.default=f}),r=Ve&&Ve.__importStar||function(p){if(p&&p.__esModule)return p;var f={};if(p!=null)for(var h in p)h!=="default"&&Object.hasOwnProperty.call(p,h)&&e(f,p,h);return t(f,p),f},n=Ve&&Ve.__awaiter||function(p,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(p,f||[])).next())})};Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.argStringToArray=Ve.ToolRunner=void 0;const s=r(pe),o=r(Sn),i=r(At),l=r(T),u=r(wp()),c=r(vp()),a=Om,m=process.platform==="win32";class d extends o.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(s.EOL);for(;S>-1;){const _=w.substring(0,S);y(_),w=w.substring(S+s.EOL.length),S=w.indexOf(s.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!c.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)+s.EOL);const w=new E(y,this.toolPath);if(w.on("debug",O=>{this._debug(O)}),this.options.cwd&&!(yield c.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)}}))})}}Ve.ToolRunner=d;function v(p){const f=[];let h=!1,y=!1,w="";function S(_){y&&_!=='"'&&(w+="\\"),w+=_,y=!1}for(let _=0;_<p.length;_++){const b=p.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}Ve.argStringToArray=v;class E extends o.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=a.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 Ve}var fu;function Ca(){if(fu)return Ge;fu=1;var e=Ge&&Ge.__createBinding||(Object.create?function(u,c,a,m){m===void 0&&(m=a),Object.defineProperty(u,m,{enumerable:!0,get:function(){return c[a]}})}:function(u,c,a,m){m===void 0&&(m=a),u[m]=c[a]}),t=Ge&&Ge.__setModuleDefault||(Object.create?function(u,c){Object.defineProperty(u,"default",{enumerable:!0,value:c})}:function(u,c){u.default=c}),r=Ge&&Ge.__importStar||function(u){if(u&&u.__esModule)return u;var c={};if(u!=null)for(var a in u)a!=="default"&&Object.hasOwnProperty.call(u,a)&&e(c,u,a);return t(c,u),c},n=Ge&&Ge.__awaiter||function(u,c,a,m){function d(v){return v instanceof a?v:new a(function(E){E(v)})}return new(a||(a=Promise))(function(v,E){function p(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):d(y.value).then(p,f)}h((m=m.apply(u,c||[])).next())})};Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.getExecOutput=Ge.exec=void 0;const s=Rm,o=r(gy());function i(u,c,a){return n(this,void 0,void 0,function*(){const m=o.argStringToArray(u);if(m.length===0)throw new Error("Parameter 'commandLine' cannot be null or empty.");const d=m[0];return c=m.slice(1).concat(c||[]),new o.ToolRunner(d,c,a).exec()})}Ge.exec=i;function l(u,c,a){var m,d;return n(this,void 0,void 0,function*(){let v="",E="";const p=new s.StringDecoder("utf8"),f=new s.StringDecoder("utf8"),h=(m=a==null?void 0:a.listeners)===null||m===void 0?void 0:m.stdout,y=(d=a==null?void 0:a.listeners)===null||d===void 0?void 0:d.stderr,w=g=>{E+=f.write(g),y&&y(g)},S=g=>{v+=p.write(g),h&&h(g)},_=Object.assign(Object.assign({},a==null?void 0:a.listeners),{stdout:S,stderr:w}),b=yield i(u,c,Object.assign(Object.assign({},a),{listeners:_}));return v+=p.end(),E+=f.end(),{exitCode:b,stdout:v,stderr:E}})}return Ge.getExecOutput=l,Ge}var du;function _y(){return du||(du=1,function(e){var t=Qe&&Qe.__createBinding||(Object.create?function(d,v,E,p){p===void 0&&(p=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(d,p,f)}:function(d,v,E,p){p===void 0&&(p=E),d[p]=v[E]}),r=Qe&&Qe.__setModuleDefault||(Object.create?function(d,v){Object.defineProperty(d,"default",{enumerable:!0,value:v})}:function(d,v){d.default=v}),n=Qe&&Qe.__importStar||function(d){if(d&&d.__esModule)return d;var v={};if(d!=null)for(var E in d)E!=="default"&&Object.prototype.hasOwnProperty.call(d,E)&&t(v,d,E);return r(v,d),v},s=Qe&&Qe.__awaiter||function(d,v,E,p){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{_(p.next(b))}catch(g){y(g)}}function S(b){try{_(p.throw(b))}catch(g){y(g)}}function _(b){b.done?h(b.value):f(b.value).then(w,S)}_((p=p.apply(d,v||[])).next())})},o=Qe&&Qe.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.getDetails=e.isLinux=e.isMacOS=e.isWindows=e.arch=e.platform=void 0;const i=o(pe),l=n(Ca()),u=()=>s(void 0,void 0,void 0,function*(){const{stdout:d}=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:d.trim()}}),c=()=>s(void 0,void 0,void 0,function*(){var d,v,E,p;const{stdout:f}=yield l.getExecOutput("sw_vers",void 0,{silent:!0}),h=(v=(d=f.match(/ProductVersion:\s*(.+)/))===null||d===void 0?void 0:d[1])!==null&&v!==void 0?v:"";return{name:(p=(E=f.match(/ProductName:\s*(.+)/))===null||E===void 0?void 0:E[1])!==null&&p!==void 0?p:"",version:h}}),a=()=>s(void 0,void 0,void 0,function*(){const{stdout:d}=yield l.getExecOutput("lsb_release",["-i","-r","-s"],{silent:!0}),[v,E]=d.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 s(this,void 0,void 0,function*(){return Object.assign(Object.assign({},yield e.isWindows?u():e.isMacOS?c():a()),{platform:e.platform,arch:e.arch,isWindows:e.isWindows,isMacOS:e.isMacOS,isLinux:e.isLinux})})}e.getDetails=m}(Qe)),Qe}var pu;function fr(){return pu||(pu=1,function(e){var t=lt&<.__createBinding||(Object.create?function(N,z,X,re){re===void 0&&(re=X);var ue=Object.getOwnPropertyDescriptor(z,X);(!ue||("get"in ue?!z.__esModule:ue.writable||ue.configurable))&&(ue={enumerable:!0,get:function(){return z[X]}}),Object.defineProperty(N,re,ue)}:function(N,z,X,re){re===void 0&&(re=X),N[re]=z[X]}),r=lt&<.__setModuleDefault||(Object.create?function(N,z){Object.defineProperty(N,"default",{enumerable:!0,value:z})}:function(N,z){N.default=z}),n=lt&<.__importStar||function(N){if(N&&N.__esModule)return N;var z={};if(N!=null)for(var X in N)X!=="default"&&Object.prototype.hasOwnProperty.call(N,X)&&t(z,N,X);return r(z,N),z},s=lt&<.__awaiter||function(N,z,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 se(D){try{k(re.next(D))}catch(L){ie(L)}}function ge(D){try{k(re.throw(D))}catch(L){ie(L)}}function k(D){D.done?K(D.value):ue(D.value).then(se,ge)}k((re=re.apply(N,z||[])).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 o=ty(),i=ny(),l=Ta(),u=n(pe),c=n(T),a=vy();var m;(function(N){N[N.Success=0]="Success",N[N.Failure=1]="Failure"})(m||(e.ExitCode=m={}));function d(N,z){const X=(0,l.toCommandValue)(z);if(process.env[N]=X,process.env.GITHUB_ENV||"")return(0,i.issueFileCommand)("ENV",(0,i.prepareKeyValueMessage)(N,z));(0,o.issueCommand)("set-env",{name:N},X)}e.exportVariable=d;function v(N){(0,o.issueCommand)("add-mask",{},N)}e.setSecret=v;function E(N){process.env.GITHUB_PATH||""?(0,i.issueFileCommand)("PATH",N):(0,o.issueCommand)("add-path",{},N),process.env.PATH=`${N}${c.delimiter}${process.env.PATH}`}e.addPath=E;function p(N,z){const X=process.env[`INPUT_${N.replace(/ /g,"_").toUpperCase()}`]||"";if(z&&z.required&&!X)throw new Error(`Input required and not supplied: ${N}`);return z&&z.trimWhitespace===!1?X:X.trim()}e.getInput=p;function f(N,z){const X=p(N,z).split(`
|
||
`).filter(re=>re!=="");return z&&z.trimWhitespace===!1?X:X.map(re=>re.trim())}e.getMultilineInput=f;function h(N,z){const X=["true","True","TRUE"],re=["false","False","FALSE"],ue=p(N,z);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,z){if(process.env.GITHUB_OUTPUT||"")return(0,i.issueFileCommand)("OUTPUT",(0,i.prepareKeyValueMessage)(N,z));process.stdout.write(u.EOL),(0,o.issueCommand)("set-output",{name:N},(0,l.toCommandValue)(z))}e.setOutput=y;function w(N){(0,o.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,o.issueCommand)("debug",{},N)}e.debug=b;function g(N,z={}){(0,o.issueCommand)("error",(0,l.toCommandProperties)(z),N instanceof Error?N.toString():N)}e.error=g;function O(N,z={}){(0,o.issueCommand)("warning",(0,l.toCommandProperties)(z),N instanceof Error?N.toString():N)}e.warning=O;function $(N,z={}){(0,o.issueCommand)("notice",(0,l.toCommandProperties)(z),N instanceof Error?N.toString():N)}e.notice=$;function C(N){process.stdout.write(N+u.EOL)}e.info=C;function G(N){(0,o.issue)("group",N)}e.startGroup=G;function Y(){(0,o.issue)("endgroup")}e.endGroup=Y;function Q(N,z){return s(this,void 0,void 0,function*(){G(N);let X;try{X=yield z()}finally{Y()}return X})}e.group=Q;function A(N,z){if(process.env.GITHUB_STATE||"")return(0,i.issueFileCommand)("STATE",(0,i.prepareKeyValueMessage)(N,z));(0,o.issueCommand)("save-state",{name:N},(0,l.toCommandValue)(z))}e.saveState=A;function x(N){return process.env[`STATE_${N}`]||""}e.getState=x;function F(N){return s(this,void 0,void 0,function*(){return yield a.OidcClient.getIDToken(N)})}e.getIDToken=F;var U=ou();Object.defineProperty(e,"summary",{enumerable:!0,get:function(){return U.summary}});var q=ou();Object.defineProperty(e,"markdownSummary",{enumerable:!0,get:function(){return q.markdownSummary}});var V=wy();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(_y())}(lt)),lt}var be=fr();function gp(e){const t=be.getInput(e.toLowerCase());if(t!=="false"&&t!=="")return t}var Ai={};const Ey=[{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:"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 hu;function Sy(){return hu||(hu=1,function(e){const t=Ey,r=process.env;Object.defineProperty(e,"_vendors",{value:t.map(function(o){return o.constant})}),e.name=null,e.isPR=null,e.id=null,t.forEach(function(o){const l=(Array.isArray(o.env)?o.env:[o.env]).every(function(u){return n(u)});e[o.constant]=l,l&&(e.name=o.name,e.isPR=s(o),e.id=o.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(o){return typeof o=="string"?!!r[o]:"env"in o?r[o.env]&&r[o.env].includes(o.includes):"any"in o?o.any.some(function(i){return!!r[i]}):Object.keys(o).every(function(i){return r[i]===o[i]})}function s(o){switch(typeof o.pr){case"string":return!!r[o.pr];case"object":return"env"in o.pr?"any"in o.pr?o.pr.any.some(function(i){return r[o.pr.env]===i}):o.pr.env in r&&r[o.pr.env]!==o.pr.ne:"any"in o.pr?o.pr.any.some(function(i){return!!r[i]}):n(o.pr);default:return null}}}(Ai)),Ai}var un=Sy();const gt=$e(un),{GITHUB_ACTIONS:xn}=gt;function ke(e){return xn?be.error(e):console.log(`\x1B[31m${e}\x1B[0m`)}function by(e){return console.log(`\x1B[32m${e}\x1B[0m`)}function Se(e){return xn?be.warning(e):console.log(`\x1B[33m${e}\x1B[0m`)}function Yt(e){return xn?be.notice(e):console.log(`\x1B[94m${e}\x1B[0m`)}function W(e){return xn?be.info(e):console.log(e)}var Vt={exports:{}},Ni,mu;function Ry(){if(mu)return Ni;mu=1,Ni=n,n.sync=s;var e=ae;function t(o,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 c=l[u].toLowerCase();if(c&&o.substr(-c.length).toLowerCase()===c)return!0}return!1}function r(o,i,l){return!o.isSymbolicLink()&&!o.isFile()?!1:t(i,l)}function n(o,i,l){e.stat(o,function(u,c){l(u,u?!1:r(c,o,i))})}function s(o,i){return r(e.statSync(o),o,i)}return Ni}var Li,yu;function Oy(){if(yu)return Li;yu=1,Li=t,t.sync=r;var e=ae;function t(o,i,l){e.stat(o,function(u,c){l(u,u?!1:n(c,i))})}function r(o,i){return n(e.statSync(o),i)}function n(o,i){return o.isFile()&&s(o,i)}function s(o,i){var l=o.mode,u=o.uid,c=o.gid,a=i.uid!==void 0?i.uid:process.getuid&&process.getuid(),m=i.gid!==void 0?i.gid:process.getgid&&process.getgid(),d=parseInt("100",8),v=parseInt("010",8),E=parseInt("001",8),p=d|v,f=l&E||l&v&&c===m||l&d&&u===a||l&p&&a===0;return f}return Li}var Di,vu;function $y(){if(vu)return Di;vu=1;var e;process.platform==="win32"||et.TESTING_WINDOWS?e=Ry():e=Oy(),Di=t,t.sync=r;function t(n,s,o){if(typeof s=="function"&&(o=s,s={}),!o){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,l){t(n,s||{},function(u,c){u?l(u):i(c)})})}e(n,s||{},function(i,l){i&&(i.code==="EACCES"||s&&s.ignoreErrors)&&(i=null,l=!1),o(i,l)})}function r(n,s){try{return e.sync(n,s||{})}catch(o){if(s&&s.ignoreErrors||o.code==="EACCES")return!1;throw o}}return Di}var ki,wu;function Iy(){if(wu)return ki;wu=1;const e=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",t=T,r=e?";":":",n=$y(),s=u=>Object.assign(new Error(`not found: ${u}`),{code:"ENOENT"}),o=(u,c)=>{const a=c.colon||r,m=u.match(/\//)||e&&u.match(/\\/)?[""]:[...e?[process.cwd()]:[],...(c.path||process.env.PATH||"").split(a)],d=e?c.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",v=e?d.split(a):[""];return e&&u.indexOf(".")!==-1&&v[0]!==""&&v.unshift(""),{pathEnv:m,pathExt:v,pathExtExe:d}},i=(u,c,a)=>{typeof c=="function"&&(a=c,c={}),c||(c={});const{pathEnv:m,pathExt:d,pathExtExe:v}=o(u,c),E=[],p=h=>new Promise((y,w)=>{if(h===m.length)return c.all&&E.length?y(E):w(s(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===d.length)return S(p(y+1));const b=d[w];n(h+b,{pathExt:v},(g,O)=>{if(!g&&O)if(c.all)E.push(h+b);else return S(h+b);return S(f(h,y,w+1))})});return a?p(0).then(h=>a(null,h),a):p(0)},l=(u,c)=>{c=c||{};const{pathEnv:a,pathExt:m,pathExtExe:d}=o(u,c),v=[];for(let E=0;E<a.length;E++){const p=a[E],f=/^".*"$/.test(p)?p.slice(1,-1):p,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:d}))if(c.all)v.push(S);else return S}catch{}}}if(c.all&&v.length)return v;if(c.nothrow)return null;throw s(u)};return ki=i,i.sync=l,ki}var Gr={exports:{}},gu;function Py(){if(gu)return Gr.exports;gu=1;const e=(t={})=>{const r=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(r).reverse().find(s=>s.toUpperCase()==="PATH")||"Path"};return Gr.exports=e,Gr.exports.default=e,Gr.exports}var qi,_u;function Ty(){if(_u)return qi;_u=1;const e=T,t=Iy(),r=Py();function n(o,i){const l=o.options.env||process.env,u=process.cwd(),c=o.options.cwd!=null,a=c&&process.chdir!==void 0&&!process.chdir.disabled;if(a)try{process.chdir(o.options.cwd)}catch{}let m;try{m=t.sync(o.command,{path:l[r({env:l})],pathExt:i?e.delimiter:void 0})}catch{}finally{a&&process.chdir(u)}return m&&(m=e.resolve(c?o.options.cwd:"",m)),m}function s(o){return n(o)||n(o,!0)}return qi=s,qi}var Vr={},Eu;function xy(){if(Eu)return Vr;Eu=1;const e=/([()\][%!^"`<>&|;, *?])/g;function t(n){return n=n.replace(e,"^$1"),n}function r(n,s){return n=`${n}`,n=n.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),n=n.replace(/(?=(\\+?)?)\1$/,"$1$1"),n=`"${n}"`,n=n.replace(e,"^$1"),s&&(n=n.replace(e,"^$1")),n}return Vr.command=t,Vr.argument=r,Vr}var Fi,Su;function Cy(){return Su||(Su=1,Fi=/^#!(.*)/),Fi}var ji,bu;function Ay(){if(bu)return ji;bu=1;const e=Cy();return ji=(t="")=>{const r=t.match(e);if(!r)return null;const[n,s]=r[0].replace(/#! ?/,"").split(" "),o=n.split("/").pop();return o==="env"?s:s?`${o} ${s}`:o},ji}var Ui,Ru;function Ny(){if(Ru)return Ui;Ru=1;const e=ae,t=Ay();function r(n){const o=Buffer.alloc(150);let i;try{i=e.openSync(n,"r"),e.readSync(i,o,0,150,0),e.closeSync(i)}catch{}return t(o.toString())}return Ui=r,Ui}var Mi,Ou;function Ly(){if(Ou)return Mi;Ou=1;const e=T,t=Ty(),r=xy(),n=Ny(),s=process.platform==="win32",o=/\.(?:com|exe)$/i,i=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function l(a){a.file=t(a);const m=a.file&&n(a.file);return m?(a.args.unshift(a.file),a.command=m,t(a)):a.file}function u(a){if(!s)return a;const m=l(a),d=!o.test(m);if(a.options.forceShell||d){const v=i.test(m);a.command=e.normalize(a.command),a.command=r.command(a.command),a.args=a.args.map(p=>r.argument(p,v));const E=[a.command].concat(a.args).join(" ");a.args=["/d","/s","/c",`"${E}"`],a.command=process.env.comspec||"cmd.exe",a.options.windowsVerbatimArguments=!0}return a}function c(a,m,d){m&&!Array.isArray(m)&&(d=m,m=null),m=m?m.slice(0):[],d=Object.assign({},d);const v={command:a,args:m,options:d,file:void 0,original:{command:a,args:m}};return d.shell?v:u(v)}return Mi=c,Mi}var Gi,$u;function Dy(){if($u)return Gi;$u=1;const e=process.platform==="win32";function t(o,i){return Object.assign(new Error(`${i} ${o.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${i} ${o.command}`,path:o.command,spawnargs:o.args})}function r(o,i){if(!e)return;const l=o.emit;o.emit=function(u,c){if(u==="exit"){const a=n(c,i);if(a)return l.call(o,"error",a)}return l.apply(o,arguments)}}function n(o,i){return e&&o===1&&!i.file?t(i.original,"spawn"):null}function s(o,i){return e&&o===1&&!i.file?t(i.original,"spawnSync"):null}return Gi={hookChildProcess:r,verifyENOENT:n,verifyENOENTSync:s,notFoundError:t},Gi}var Iu;function ky(){if(Iu)return Vt.exports;Iu=1;const e=At,t=Ly(),r=Dy();function n(o,i,l){const u=t(o,i,l),c=e.spawn(u.command,u.args,u.options);return r.hookChildProcess(c,u),c}function s(o,i,l){const u=t(o,i,l),c=e.spawnSync(u.command,u.args,u.options);return c.error=c.error||r.verifyENOENTSync(c.status,u),c}return Vt.exports=n,Vt.exports.spawn=n,Vt.exports.sync=s,Vt.exports._parse=t,Vt.exports._enoent=r,Vt.exports}var qy=ky();const Fy=$e(qy);function jy(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 _p(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 Uy=({cwd:e=ot.cwd(),path:t=ot.env[_p()],preferLocal:r=!0,execPath:n=ot.execPath,addExecPath:s=!0}={})=>{const o=e instanceof URL?ct.fileURLToPath(e):e,i=T.resolve(o),l=[];return r&&My(l,i),s&&Gy(l,n,i),[...l,t].join(T.delimiter)},My=(e,t)=>{let r;for(;r!==t;)e.push(T.join(t,"node_modules/.bin")),r=t,t=T.resolve(t,"..")},Gy=(e,t,r)=>{const n=t instanceof URL?ct.fileURLToPath(t):t;e.push(T.resolve(r,n,".."))},Vy=({env:e=ot.env,...t}={})=>{e={...e};const r=_p({env:e});return t.path=e[r],e[r]=Uy(t),e},By=(e,t,r,n)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;const s=Object.getOwnPropertyDescriptor(e,r),o=Object.getOwnPropertyDescriptor(t,r);!Hy(s,o)&&n||Object.defineProperty(e,r,o)},Hy=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)},zy=(e,t)=>{const r=Object.getPrototypeOf(t);r!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,r)},Wy=(e,t)=>`/* Wrapped ${e}*/
|
||
${t}`,Xy=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Ky=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Yy=(e,t,r)=>{const n=r===""?"":`with ${r.trim()}() `,s=Wy.bind(null,n,t.toString());Object.defineProperty(s,"name",Ky),Object.defineProperty(e,"toString",{...Xy,value:s})};function Jy(e,t,{ignoreNonConfigurable:r=!1}={}){const{name:n}=e;for(const s of Reflect.ownKeys(t))By(e,t,s,r);return zy(e,t),Yy(e,t,n),e}const ln=new WeakMap,Ep=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let r,n=0;const s=e.displayName||e.name||"<anonymous>",o=function(...i){if(ln.set(o,++n),n===1)r=e.apply(this,i),e=null;else if(t.throw===!0)throw new Error(`Function \`${s}\` can only be called once`);return r};return Jy(o,e),ln.set(o,n),o};Ep.callCount=e=>{if(!ln.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return ln.get(e)};const Qy=()=>{const e=bp-Sp+1;return Array.from({length:e},Zy)},Zy=(e,t)=>({name:`SIGRT${t+1}`,number:Sp+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Sp=34,bp=64,ev=[{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"}],Rp=()=>{const e=Qy();return[...ev,...e].map(tv)},tv=({name:e,number:t,description:r,action:n,forced:s=!1,standard:o})=>{const{signals:{[e]:i}}=pe.constants,l=i!==void 0;return{name:e,number:l?i:t,description:r,supported:l,action:n,forced:s,standard:o}},rv=()=>{const e=Rp();return Object.fromEntries(e.map(nv))},nv=({name:e,number:t,description:r,supported:n,action:s,forced:o,standard:i})=>[e,{name:e,number:t,description:r,supported:n,action:s,forced:o,standard:i}],iv=rv(),sv=()=>{const e=Rp(),t=bp+1,r=Array.from({length:t},(n,s)=>ov(s,e));return Object.assign({},...r)},ov=(e,t)=>{const r=av(e,t);if(r===void 0)return{};const{name:n,description:s,supported:o,action:i,forced:l,standard:u}=r;return{[e]:{name:n,number:e,description:s,supported:o,action:i,forced:l,standard:u}}},av=(e,t)=>{const r=t.find(({name:n})=>pe.constants.signals[n]===e);return r!==void 0?r:t.find(n=>n.number===e)};sv();const cv=({timedOut:e,timeout:t,errorCode:r,signal:n,signalDescription:s,exitCode:o,isCanceled:i})=>e?`timed out after ${t} milliseconds`:i?"was canceled":r!==void 0?`failed with ${r}`:n!==void 0?`was killed with ${n} (${s})`:o!==void 0?`failed with exit code ${o}`:"failed",fn=({stdout:e,stderr:t,all:r,error:n,signal:s,exitCode:o,command:i,escapedCommand:l,timedOut:u,isCanceled:c,killed:a,parsed:{options:{timeout:m,cwd:d=ot.cwd()}}})=>{o=o===null?void 0:o,s=s===null?void 0:s;const v=s===void 0?void 0:iv[s].description,E=n&&n.code,f=`Command ${cv({timedOut:u,timeout:m,errorCode:E,signal:s,signalDescription:v,exitCode:o,isCanceled:c})}: ${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=o,n.signal=s,n.signalDescription=v,n.stdout=e,n.stderr=t,n.cwd=d,r!==void 0&&(n.all=r),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!u,n.isCanceled=c,n.killed=a&&!u,n},Zr=["stdin","stdout","stderr"],uv=e=>Zr.some(t=>e[t]!==void 0),lv=e=>{if(!e)return;const{stdio:t}=e;if(t===void 0)return Zr.map(n=>e[n]);if(uv(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Zr.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,Zr.length);return Array.from({length:r},(n,s)=>t[s])};var Bt={exports:{}},Vi={exports:{}},Pu;function fv(){return Pu||(Pu=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")}(Vi)),Vi.exports}var Tu;function dv(){if(Tu)return Bt.exports;Tu=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))Bt.exports=function(){return function(){}};else{var r=xr,n=fv(),s=/^win/i.test(e.platform),o=Sn;typeof o!="function"&&(o=o.EventEmitter);var i;e.__signal_exit_emitter__?i=e.__signal_exit_emitter__:(i=e.__signal_exit_emitter__=new o,i.count=0,i.emitted={}),i.infinite||(i.setMaxListeners(1/0),i.infinite=!0),Bt.exports=function(f,h){if(!t(et.process))return function(){};r.equal(typeof f,"function","a callback must be provided for exit handler"),a===!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(){!a||!t(et.process)||(a=!1,n.forEach(function(h){try{e.removeListener(h,c[h])}catch{}}),e.emit=E,e.reallyExit=d,i.count-=1)};Bt.exports.unload=l;var u=function(h,y,w){i.emitted[h]||(i.emitted[h]=!0,i.emit(h,y,w))},c={};n.forEach(function(f){c[f]=function(){if(t(et.process)){var y=e.listeners(f);y.length===i.count&&(l(),u("exit",null,f),u("afterexit",null,f),s&&f==="SIGHUP"&&(f="SIGINT"),e.kill(e.pid,f))}}}),Bt.exports.signals=function(){return n};var a=!1,m=function(){a||!t(et.process)||(a=!0,i.count+=1,n=n.filter(function(h){try{return e.on(h,c[h]),!0}catch{return!1}}),e.emit=p,e.reallyExit=v)};Bt.exports.load=m;var d=e.reallyExit,v=function(h){t(et.process)&&(e.exitCode=h||0,u("exit",e.exitCode,null),u("afterexit",e.exitCode,null),d.call(e,e.exitCode))},E=e.emit,p=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 Bt.exports}var pv=dv();const hv=$e(pv),mv=1e3*5,yv=(e,t="SIGTERM",r={})=>{const n=e(t);return vv(e,t,r,n),n},vv=(e,t,r,n)=>{if(!wv(t,r,n))return;const s=_v(r),o=setTimeout(()=>{e("SIGKILL")},s);o.unref&&o.unref()},wv=(e,{forceKillAfterTimeout:t},r)=>gv(e)&&t!==!1&&r,gv=e=>e===pe.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",_v=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return mv;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},Ev=(e,t)=>{e.kill()&&(t.isCanceled=!0)},Sv=(e,t,r)=>{e.kill(t),r(Object.assign(new Error("Timed out"),{timedOut:!0,signal:t}))},bv=(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{if(t===0||t===void 0)return n;let s;const o=new Promise((l,u)=>{s=setTimeout(()=>{Sv(e,r,u)},t)}),i=n.finally(()=>{clearTimeout(s)});return Promise.race([o,i])},Rv=({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})`)},Ov=async(e,{cleanup:t,detached:r},n)=>{if(!t||r)return n;const s=hv(()=>{e.kill()});return n.finally(()=>{s()})};function Aa(e){return e!==null&&typeof e=="object"&&typeof e.pipe=="function"}function xu(e){return Aa(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object"}const $v=e=>e instanceof At.ChildProcess&&typeof e.then=="function",Bi=(e,t,r)=>{if(typeof r=="string")return e[t].pipe(ae.createWriteStream(r)),e;if(xu(r))return e[t].pipe(r),e;if(!$v(r))throw new TypeError("The second argument must be a string, a stream or an Execa child process.");if(!xu(r.stdin))throw new TypeError("The target child process's stdin must be available.");return e[t].pipe(r.stdin),r},Iv=e=>{e.stdout!==null&&(e.pipeStdout=Bi.bind(void 0,e,"stdout")),e.stderr!==null&&(e.pipeStderr=Bi.bind(void 0,e,"stderr")),e.all!==void 0&&(e.pipeAll=Bi.bind(void 0,e,"all"))};var sr={exports:{}},Hi,Cu;function Pv(){if(Cu)return Hi;Cu=1;const{PassThrough:e}=Cr;return Hi=t=>{t={...t};const{array:r}=t;let{encoding:n}=t;const s=n==="buffer";let o=!1;r?o=!(n||s):n=n||"utf8",s&&(n=null);const i=new e({objectMode:o});n&&i.setEncoding(n);let l=0;const u=[];return i.on("data",c=>{u.push(c),o?l=u.length:l+=c.length}),i.getBufferedValue=()=>r?u:s?Buffer.concat(u,l):u.join(""),i.getBufferedLength=()=>l,i},Hi}var Au;function Tv(){if(Au)return sr.exports;Au=1;const{constants:e}=ip,t=Cr,{promisify:r}=ur,n=Pv(),s=r(t.pipeline);class o 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:c}=u,a=n(u);return await new Promise((m,d)=>{const v=E=>{E&&a.getBufferedLength()<=e.MAX_LENGTH&&(E.bufferedData=a.getBufferedValue()),d(E)};(async()=>{try{await s(l,a),m()}catch(E){v(E)}})(),a.on("data",()=>{a.getBufferedLength()>c&&v(new o)})}),a.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=o,sr.exports}var xv=Tv();const Nu=$e(xv);var zi,Lu;function Cv(){if(Lu)return zi;Lu=1;const{PassThrough:e}=Cr;return zi=function(){var t=[],r=new e({objectMode:!0});return r.setMaxListeners(0),r.add=n,r.isEmpty=s,r.on("unpipe",o),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",o.bind(null,i)),i.once("error",r.emit.bind(r,"error")),i.pipe(r,{end:!1}),this)}function s(){return t.length==0}function o(i){t=t.filter(function(l){return l!==i}),!t.length&&r.readable&&r.end()}},zi}var Av=Cv();const Nv=$e(Av),Op=e=>{if(e!==void 0)throw new TypeError("The `input` and `inputFile` options cannot be both set.")},Lv=({input:e,inputFile:t})=>typeof t!="string"?e:(Op(e),ae.readFileSync(t)),Dv=e=>{const t=Lv(e);if(Aa(t))throw new TypeError("The `input` option cannot be a stream in sync mode");return t},kv=({input:e,inputFile:t})=>typeof t!="string"?e:(Op(e),ae.createReadStream(t)),qv=(e,t)=>{const r=kv(t);r!==void 0&&(Aa(r)?r.pipe(e.stdin):e.stdin.end(r))},Fv=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;const r=Nv();return e.stdout&&r.add(e.stdout),e.stderr&&r.add(e.stderr),r},Wi=async(e,t)=>{if(!(!e||t===void 0)){e.destroy();try{return await t}catch(r){return r.bufferedData}}},Xi=(e,{encoding:t,buffer:r,maxBuffer:n})=>{if(!(!e||!r))return t?Nu(e,{encoding:t,maxBuffer:n}):Nu.buffer(e,{maxBuffer:n})},jv=async({stdout:e,stderr:t,all:r},{encoding:n,buffer:s,maxBuffer:o},i)=>{const l=Xi(e,{encoding:n,buffer:s,maxBuffer:o}),u=Xi(t,{encoding:n,buffer:s,maxBuffer:o}),c=Xi(r,{encoding:n,buffer:s,maxBuffer:o*2});try{return await Promise.all([i,l,u,c])}catch(a){return Promise.all([{error:a,signal:a.signal,timedOut:a.timedOut},Wi(e,l),Wi(t,u),Wi(r,c)])}},Uv=(async()=>{})().constructor.prototype,Mv=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(Uv,e)]),Du=(e,t)=>{for(const[r,n]of Mv){const s=typeof t=="function"?(...o)=>Reflect.apply(n.value,t(),o):n.value.bind(t);Reflect.defineProperty(e,r,{...n,value:s})}},Gv=e=>new Promise((t,r)=>{e.on("exit",(n,s)=>{t({exitCode:n,signal:s})}),e.on("error",n=>{r(n)}),e.stdin&&e.stdin.on("error",n=>{r(n)})}),$p=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],Vv=/^[\w.-]+$/,Bv=/"/g,Hv=e=>typeof e!="string"||Vv.test(e)?e:`"${e.replace(Bv,'\\"')}"`,Ip=(e,t)=>$p(e,t).join(" "),Pp=(e,t)=>$p(e,t).map(r=>Hv(r)).join(" "),zv=/ +/g,Tp=e=>{const t=[];for(const r of e.trim().split(zv)){const n=t[t.length-1];n&&n.endsWith("\\")?t[t.length-1]=`${n.slice(0,-1)} ${r}`:t.push(r)}return t},Wv=ur.debuglog("execa").enabled,Br=(e,t)=>String(e).padStart(t,"0"),Xv=()=>{const e=new Date;return`${Br(e.getHours(),2)}:${Br(e.getMinutes(),2)}:${Br(e.getSeconds(),2)}.${Br(e.getMilliseconds(),3)}`},xp=(e,{verbose:t})=>{t&&ot.stderr.write(`[${Xv()}] ${e}
|
||
`)},Kv=1e3*1e3*100,Yv=({env:e,extendEnv:t,preferLocal:r,localDir:n,execPath:s})=>{const o=t?{...ot.env,...e}:e;return r?Vy({env:o,cwd:n,execPath:s}):o},Cp=(e,t,r={})=>{const n=Fy._parse(e,t,r);return e=n.command,t=n.args,r=n.options,r={maxBuffer:Kv,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:r.cwd||ot.cwd(),execPath:ot.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:Wv,...r},r.env=Yv(r),r.stdio=lv(r),ot.platform==="win32"&&T.basename(e,".exe")==="cmd"&&t.unshift("/q"),{file:e,args:t,options:r,parsed:n}},Pr=(e,t,r)=>typeof t!="string"&&!ip.Buffer.isBuffer(t)?r===void 0?void 0:"":e.stripFinalNewline?jy(t):t;function le(e,t,r){const n=Cp(e,t,r),s=Ip(e,t),o=Pp(e,t);xp(o,n.options),Rv(n.options);let i;try{i=At.spawn(n.file,n.args,n.options)}catch(v){const E=new At.ChildProcess,p=Promise.reject(fn({error:v,stdout:"",stderr:"",all:"",command:s,escapedCommand:o,parsed:n,timedOut:!1,isCanceled:!1,killed:!1}));return Du(E,p),E}const l=Gv(i),u=bv(i,n.options,l),c=Ov(i,n.options,u),a={isCanceled:!1};i.kill=yv.bind(null,i.kill.bind(i)),i.cancel=Ev.bind(null,i,a);const d=Ep(async()=>{const[{error:v,exitCode:E,signal:p,timedOut:f},h,y,w]=await jv(i,n.options,c),S=Pr(n.options,h),_=Pr(n.options,y),b=Pr(n.options,w);if(v||E!==0||p!==null){const g=fn({error:v,exitCode:E,signal:p,stdout:S,stderr:_,all:b,command:s,escapedCommand:o,parsed:n,timedOut:f,isCanceled:a.isCanceled||(n.options.signal?n.options.signal.aborted:!1),killed:i.killed});if(!n.options.reject)return g;throw g}return{command:s,escapedCommand:o,exitCode:0,stdout:S,stderr:_,all:b,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return qv(i,n.options),i.all=Fv(i,n.options),Iv(i),Du(i,d),i}function Be(e,t,r){const n=Cp(e,t,r),s=Ip(e,t),o=Pp(e,t);xp(o,n.options);const i=Dv(n.options);let l;try{l=At.spawnSync(n.file,n.args,{...n.options,input:i})}catch(a){throw fn({error:a,stdout:"",stderr:"",all:"",command:s,escapedCommand:o,parsed:n,timedOut:!1,isCanceled:!1,killed:!1})}const u=Pr(n.options,l.stdout,l.error),c=Pr(n.options,l.stderr,l.error);if(l.error||l.status!==0||l.signal!==null){const a=fn({stdout:u,stderr:c,error:l.error,signal:l.signal,exitCode:l.status,command:s,escapedCommand:o,parsed:n,timedOut:l.error&&l.error.code==="ETIMEDOUT",isCanceled:!1,killed:l.signal!==null});if(!n.options.reject)return a;throw a}return{command:s,escapedCommand:o,exitCode:0,stdout:u,stderr:c,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}function Jv(e,t){const[r,...n]=Tp(e);return le(r,n,t)}function Qv(e,t){const[r,...n]=Tp(e);return Be(r,n,t)}var pt={},Ht={};const Zv=Ir.promises,{access:ew,appendFile:Ap,chmod:Na,chown:tw,copyFile:rw,lchmod:nw,lchown:iw,link:sw,lstat:ow,mkdir:aw,mkdtemp:cw,open:uw,readdir:La,readFile:Lr,readlink:lw,realpath:fw,rename:dw,rmdir:pw,stat:hw,symlink:mw,truncate:yw,unlink:vw,utimes:ww,writeFile:Da}=Ir.promises,Np="rm"in Ir.promises?Ir.promises.rm:ur.promisify(Ir.unlink),gw=Object.freeze(Object.defineProperty({__proto__:null,access:ew,appendFile:Ap,chmod:Na,chown:tw,copyFile:rw,default:Zv,lchmod:nw,lchown:iw,link:sw,lstat:ow,mkdir:aw,mkdtemp:cw,open:uw,readFile:Lr,readdir:La,readlink:lw,realpath:fw,rename:dw,rm:Np,rmdir:pw,stat:hw,symlink:mw,truncate:yw,unlink:vw,utimes:ww,writeFile:Da},Symbol.toStringTag,{value:"Module"})),Lp=bn(gw);var ku;function _w(){if(ku)return Ht;ku=1,Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.sync=Ht.isexe=void 0;const e=ae,t=Lp,r=async(i,l={})=>{const{ignoreErrors:u=!1}=l;try{return s(await(0,t.stat)(i),l)}catch(c){const a=c;if(u||a.code==="EACCES")return!1;throw a}};Ht.isexe=r;const n=(i,l={})=>{const{ignoreErrors:u=!1}=l;try{return s((0,e.statSync)(i),l)}catch(c){const a=c;if(u||a.code==="EACCES")return!1;throw a}};Ht.sync=n;const s=(i,l)=>i.isFile()&&o(i,l),o=(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),c=(g=(b=l.groups)!=null?b:(_=process.getgroups)==null?void 0:_.call(process))!=null?g:[],a=(C=($=l.gid)!=null?$:(O=process.getgid)==null?void 0:O.call(process))!=null?C:c[0];if(u===void 0||a===void 0)throw new Error("cannot get uid or gid");const m=new Set([a,...c]),d=i.mode,v=i.uid,E=i.gid,p=parseInt("100",8),f=parseInt("010",8),h=parseInt("001",8),y=p|f;return!!(d&h||d&f&&m.has(E)||d&p&&v===u||d&y&&u===0)};return Ht}var zt={},qu;function Ew(){if(qu)return zt;qu=1,Object.defineProperty(zt,"__esModule",{value:!0}),zt.sync=zt.isexe=void 0;const e=ae,t=Lp,r=async(i,l={})=>{const{ignoreErrors:u=!1}=l;try{return o(await(0,t.stat)(i),i,l)}catch(c){const a=c;if(u||a.code==="EACCES")return!1;throw a}};zt.isexe=r;const n=(i,l={})=>{const{ignoreErrors:u=!1}=l;try{return o((0,e.statSync)(i),i,l)}catch(c){const a=c;if(u||a.code==="EACCES")return!1;throw a}};zt.sync=n;const s=(i,l)=>{const{pathExt:u=process.env.PATHEXT||""}=l,c=u.split(";");if(c.indexOf("")!==-1)return!0;for(let a=0;a<c.length;a++){const m=c[a].toLowerCase(),d=i.substring(i.length-m.length).toLowerCase();if(m&&d===m)return!0}return!1},o=(i,l,u)=>i.isFile()&&s(l,u);return zt}var Ki={},Fu;function Sw(){return Fu||(Fu=1,Object.defineProperty(Ki,"__esModule",{value:!0})),Ki}var ju;function bw(){return ju||(ju=1,function(e){var t=pt&&pt.__createBinding||(Object.create?function(c,a,m,d){d===void 0&&(d=m);var v=Object.getOwnPropertyDescriptor(a,m);(!v||("get"in v?!a.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return a[m]}}),Object.defineProperty(c,d,v)}:function(c,a,m,d){d===void 0&&(d=m),c[d]=a[m]}),r=pt&&pt.__setModuleDefault||(Object.create?function(c,a){Object.defineProperty(c,"default",{enumerable:!0,value:a})}:function(c,a){c.default=a}),n=pt&&pt.__importStar||function(c){if(c&&c.__esModule)return c;var a={};if(c!=null)for(var m in c)m!=="default"&&Object.prototype.hasOwnProperty.call(c,m)&&t(a,c,m);return r(a,c),a},s=pt&&pt.__exportStar||function(c,a){for(var m in c)m!=="default"&&!Object.prototype.hasOwnProperty.call(a,m)&&t(a,c,m)};Object.defineProperty(e,"__esModule",{value:!0}),e.sync=e.isexe=e.posix=e.win32=void 0;const o=n(_w());e.posix=o;const i=n(Ew());e.win32=i,s(Sw(),e);const u=(process.env._ISEXE_TEST_PLATFORM_||process.platform)==="win32"?i:o;e.isexe=u.isexe,e.sync=u.sync}(pt)),pt}var Yi,Uu;function Rw(){if(Uu)return Yi;Uu=1;const{isexe:e,sync:t}=bw(),{join:r,delimiter:n,sep:s,posix:o}=T,i=process.platform==="win32",l=new RegExp(`[${o.sep}${s===o.sep?"":s}]`.replace(/(\\)/g,"\\$1")),u=new RegExp(`^\\.${l.source}`),c=E=>Object.assign(new Error(`not found: ${E}`),{code:"ENOENT"}),a=(E,{path:p=process.env.PATH,pathExt:f=process.env.PATHEXT,delimiter:h=n})=>{const y=E.match(l)?[""]:[...i?[process.cwd()]:[],...(p||"").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,p)=>{const f=/^".*"$/.test(E)?E.slice(1,-1):E;return(!f&&u.test(p)?p.slice(0,2):"")+r(f,p)},d=async(E,p={})=>{const{pathEnv:f,pathExt:h,pathExtExe:y}=a(E,p),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(!p.all)return g;w.push(g)}}}if(p.all&&w.length)return w;if(p.nothrow)return null;throw c(E)},v=(E,p={})=>{const{pathEnv:f,pathExt:h,pathExtExe:y}=a(E,p),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(!p.all)return g;w.push(g)}}}if(p.all&&w.length)return w;if(p.nothrow)return null;throw c(E)};return Yi=d,d.sync=v,Yi}var Ow=Rw();const he=$e(Ow);let _r;function Dp(e,t=["-NoProfile","-NoLogo","-NonInteractive"],r={stdio:"inherit"}){return le($w(),[...t,"-c",e],r)}function $w(){if(_r===void 0){const e=he.sync("pwsh",{nothrow:!0});e!==null&&(_r=e);const t=he.sync("powershell",{nothrow:!0});t!==null&&(_r=t)}if(_r===void 0)throw new Error("Could not find powershell");return _r}function ht(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}function kp(){return he.sync("sudo",{nothrow:!0})!==null}function dr(){var e;return((e=process.getuid)==null?void 0:e.call(process))===0||!!process.env.CI}function pr(){return dr()&&kp()}function Iw(e){return pr()?`sudo ${e}`:e}function ye(e,t=[],r=vt){return pr()?Qv(qp(e,t),r):Be(e,ka(t),r)}function yt(e,t=[],r=vt){return pr()?Jv(qp(e,t),r):le(e,ka(t),r)}function qp(e,t){return`sudo ${ka([e,...t]).join(" ")}`}function ka(e){return e.map(t=>`'${t}'`)}async function Pw(){try{return await le("fltmc"),!0}catch{return!1}}async function Tw(){var e;if(process.platform!=="win32")return!1;try{return await le("fsutil",["dirty","query",(e=process.env.systemdrive)!=null?e:""]),!0}catch(t){return t.code==="ENOENT"?Pw():!1}}function xw(){return process.platform==="win32"?Fp():dr()}async function hr(e){if((process.platform==="linux"||process.platform==="darwin")&&pr()&&process.env.SUDO_USER!==void 0){let t=ae.statSync(e).isDirectory();await yt("chown",[...t?["-R"]:[],process.env.SUDO_USER,e],vt)}}var Ji,Wt={};ht(Wt,"hasSudo",()=>kp),ht(Wt,"isRoot",()=>dr),ht(Wt,"isSudo",()=>pr),ht(Wt,"prependSudo",()=>Iw),ht(Wt,"defaultExecOptions",()=>vt),ht(Wt,"execRootSync",()=>ye),ht(Wt,"execRoot",()=>yt);let vt={stdio:"inherit",shell:!0};ht(Ji={},"isAdminWindows",()=>Fp),ht(Ji,"isAdminPosix",()=>Cw),ht(Ji,"isAdmin",()=>xw);let Fp=Tw,Cw=dr;ht({},"grantUserWriteAccess",()=>hr);var Qi,Mu;function Aw(){return Mu||(Mu=1,Qi=function(){}),Qi}var Zi,Gu;function Zt(){if(Gu)return Zi;Gu=1;var e=Aw()();return Zi=function(t){return t!==e&&t!==null},Zi}var es,Vu;function jp(){if(Vu)return es;Vu=1;var e=Zt(),t=Array.prototype.forEach,r=Object.create,n=function(s,o){var i;for(i in s)o[i]=s[i]};return es=function(s){var o=r(null);return t.call(arguments,function(i){e(i)&&n(Object(i),o)}),o},es}var ts,Bu;function Nw(){return Bu||(Bu=1,ts=function(){var e=Math.sign;return typeof e!="function"?!1:e(10)===1&&e(-20)===-1}),ts}var rs,Hu;function Lw(){return Hu||(Hu=1,rs=function(e){return e=Number(e),isNaN(e)||e===0?e:e>0?1:-1}),rs}var ns,zu;function Dw(){return zu||(zu=1,ns=Nw()()?Math.sign:Lw()),ns}var is,Wu;function kw(){if(Wu)return is;Wu=1;var e=Dw(),t=Math.abs,r=Math.floor;return is=function(n){return isNaN(n)?0:(n=Number(n),n===0||!isFinite(n)?n:e(n)*r(t(n)))},is}var ss,Xu;function er(){if(Xu)return ss;Xu=1;var e=kw(),t=Math.max;return ss=function(r){return t(0,e(r))},ss}var os,Ku;function Up(){if(Ku)return os;Ku=1;var e=er();return os=function(t,r,n){var s;return isNaN(t)?(s=r,s>=0?n&&s?s-1:s:1):t===!1?!1:e(t)},os}var as,Yu;function Ft(){return Yu||(Yu=1,as=function(e){if(typeof e!="function")throw new TypeError(e+" is not a function");return e}),as}var cs,Ju;function mr(){if(Ju)return cs;Ju=1;var e=Zt();return cs=function(t){if(!e(t))throw new TypeError("Cannot use null or undefined");return t},cs}var us,Qu;function qw(){if(Qu)return us;Qu=1;var e=Ft(),t=mr(),r=Function.prototype.bind,n=Function.prototype.call,s=Object.keys,o=Object.prototype.propertyIsEnumerable;return us=function(i,l){return function(u,c){var a,m=arguments[2],d=arguments[3];return u=Object(t(u)),e(c),a=s(u),d&&a.sort(typeof d=="function"?r.call(d,u):void 0),typeof i!="function"&&(i=a[i]),n.call(i,a,function(v,E){return o.call(u,v)?n.call(c,m,u[v],v,u,E):l})}},us}var ls,Zu;function Cn(){return Zu||(Zu=1,ls=qw()("forEach")),ls}var el={},tl;function tr(){return tl||(tl=1),el}var fs={exports:{}},ds,rl;function Fw(){return rl||(rl=1,ds=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")}),ds}var ps,nl;function jw(){return nl||(nl=1,ps=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),ps}var hs,il;function Uw(){if(il)return hs;il=1;var e=Zt(),t=Object.keys;return hs=function(r){return t(e(r)?Object(r):r)},hs}var ms,sl;function Mw(){return sl||(sl=1,ms=jw()()?Object.keys:Uw()),ms}var ys,ol;function Gw(){if(ol)return ys;ol=1;var e=Mw(),t=mr(),r=Math.max;return ys=function(n,s){var o,i,l=r(arguments.length,2),u;for(n=Object(t(n)),u=function(c){try{n[c]=s[c]}catch(a){o||(o=a)}},i=1;i<l;++i)s=arguments[i],e(s).forEach(u);if(o!==void 0)throw o;return n},ys}var vs,al;function Mp(){return al||(al=1,vs=Fw()()?Object.assign:Gw()),vs}var ws,cl;function Vw(){if(cl)return ws;cl=1;var e=Zt(),t={function:!0,object:!0};return ws=function(r){return e(r)&&t[typeof r]||!1},ws}var ul;function Bw(){return ul||(ul=1,function(e){var t=Mp(),r=Vw(),n=Zt(),s=Error.captureStackTrace;e.exports=function(o){var i=new Error(o),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),s&&s(i,e.exports),i}}(fs)),fs.exports}var Hr={exports:{}},gs,ll;function Gp(){if(ll)return gs;ll=1;var e=mr(),t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols;return gs=function(o,i){var l,u=Object(e(i));if(o=Object(e(o)),n(u).forEach(function(c){try{t(o,c,r(i,c))}catch(a){l=a}}),typeof s=="function"&&s(u).forEach(function(c){try{t(o,c,r(i,c))}catch(a){l=a}}),l!==void 0)throw l;return o},gs}var fl;function Vp(){if(fl)return Hr.exports;fl=1;var e=er(),t=function(i,l){return l},r,n,s,o;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,Hr.exports=function(i,l){return l=e(l),i.length===l?i:(r.value=l,n(i,"length",r))}):(o=Gp(),s=function(){var i=[];return function(l){var u,c=0;if(i[l])return i[l];for(u=[];l--;)u.push("a"+(++c).toString(36));return new Function("fn","return function ("+u.join(", ")+") { return fn.apply(this, arguments); };")}}(),Hr.exports=function(i,l){var u;if(l=e(l),i.length===l)return i;u=s(l)(i);try{o(u,i)}catch{}return u}),Hr.exports}var _s={exports:{}},Es,dl;function Bp(){if(dl)return Es;dl=1;var e=void 0;return Es=function(t){return t!==e&&t!==null},Es}var Ss,pl;function Hw(){if(pl)return Ss;pl=1;var e=Bp(),t={object:!0,function:!0,undefined:!0};return Ss=function(r){return e(r)?hasOwnProperty.call(t,typeof r):!1},Ss}var bs,hl;function zw(){if(hl)return bs;hl=1;var e=Hw();return bs=function(t){if(!e(t))return!1;try{return t.constructor?t.constructor.prototype===t:!1}catch{return!1}},bs}var Rs,ml;function Ww(){if(ml)return Rs;ml=1;var e=zw();return Rs=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)},Rs}var Os,yl;function Xw(){if(yl)return Os;yl=1;var e=Ww(),t=/^\s*class[\s{/}]/,r=Function.prototype.toString;return Os=function(n){return!(!e(n)||t.test(r.call(n)))},Os}var $s,vl;function Kw(){if(vl)return $s;vl=1;var e="razdwatrzy";return $s=function(){return typeof e.contains!="function"?!1:e.contains("dwa")===!0&&e.contains("foo")===!1},$s}var Is,wl;function Yw(){if(wl)return Is;wl=1;var e=String.prototype.indexOf;return Is=function(t){return e.call(this,t,arguments[1])>-1},Is}var Ps,gl;function Jw(){return gl||(gl=1,Ps=Kw()()?String.prototype.contains:Yw()),Ps}var _l;function rr(){if(_l)return _s.exports;_l=1;var e=Bp(),t=Xw(),r=Mp(),n=jp(),s=Jw(),o=_s.exports=function(i,l){var u,c,a,m,d;return arguments.length<2||typeof i!="string"?(m=l,l=i,i=null):m=arguments[2],e(i)?(u=s.call(i,"c"),c=s.call(i,"e"),a=s.call(i,"w")):(u=a=!0,c=!1),d={value:l,configurable:u,enumerable:c,writable:a},m?r(n(m),d):d};return o.gs=function(i,l,u){var c,a,m,d;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)?(c=s.call(i,"c"),a=s.call(i,"e")):(c=!0,a=!1),d={get:l,set:u,configurable:c,enumerable:a},m?r(n(m),d):d},_s.exports}var zr={exports:{}},El;function Qw(){return El||(El=1,function(e,t){var r=rr(),n=Ft(),s=Function.prototype.apply,o=Function.prototype.call,i=Object.create,l=Object.defineProperty,u=Object.defineProperties,c=Object.prototype.hasOwnProperty,a={configurable:!0,enumerable:!1,writable:!0},m,d,v,E,p,f,h;m=function(y,w){var S;return n(w),c.call(this,"__ee__")?S=this.__ee__:(S=a.value=i(null),l(this,"__ee__",a),a.value=null),S[y]?typeof S[y]=="object"?S[y].push(w):S[y]=[S[y],w]:S[y]=w,this},d=function(y,w){var S,_;return n(w),_=this,m.call(this,y,S=function(){v.call(_,y,S),s.call(w,this,arguments)}),S.__eeOnceListener__=w,this},v=function(y,w){var S,_,b,g;if(n(w),!c.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(c.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)s.call(_,this,g)}else switch(arguments.length){case 1:o.call(b,this);break;case 2:o.call(b,this,arguments[1]);break;case 3:o.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];s.call(b,this,g)}},p={on:m,once:d,off:v,emit:E},f={on:r(m),once:r(d),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=p}(zr,zr.exports)),zr.exports}var Ts,Sl;function Zw(){return Sl||(Sl=1,Ts=function(){var e=Array.from,t,r;return typeof e!="function"?!1:(t=["raz","dwa"],r=e(t),!!(r&&r!==t&&r[1]==="dwa"))}),Ts}var xs,bl;function eg(){return bl||(bl=1,xs=function(){return typeof globalThis!="object"||!globalThis?!1:globalThis.Array===Array}),xs}var Cs,Rl;function tg(){if(Rl)return Cs;Rl=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 Cs=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__}}(),Cs}var As,Ol;function An(){return Ol||(Ol=1,As=eg()()?globalThis:tg()),As}var Ns,$l;function rg(){if($l)return Ns;$l=1;var e=An(),t={object:!0,symbol:!0};return Ns=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])},Ns}var Ls,Il;function ng(){return Il||(Il=1,Ls=function(e){return e?typeof e=="symbol"?!0:!e.constructor||e.constructor.name!=="Symbol"?!1:e[e.constructor.toStringTag]==="Symbol":!1}),Ls}var Ds,Pl;function Hp(){if(Pl)return Ds;Pl=1;var e=ng();return Ds=function(t){if(!e(t))throw new TypeError(t+" is not a symbol");return t},Ds}var ks,Tl;function ig(){if(Tl)return ks;Tl=1;var e=rr(),t=Object.create,r=Object.defineProperty,n=Object.prototype,s=t(null);return ks=function(o){for(var i=0,l,u;s[o+(i||"")];)++i;return o+=i||"",s[o]=!0,l="@@"+o,r(n,l,e.gs(null,function(c){u||(u=!0,r(this,l,e(c)),u=!1)})),l},ks}var qs,xl;function sg(){if(xl)return qs;xl=1;var e=rr(),t=An().Symbol;return qs=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"))})},qs}var Fs,Cl;function og(){if(Cl)return Fs;Cl=1;var e=rr(),t=Hp(),r=Object.create(null);return Fs=function(n){return Object.defineProperties(n,{for:e(function(s){return r[s]?r[s]:r[s]=n(String(s))}),keyFor:e(function(s){var o;t(s);for(o in r)if(r[o]===s)return o})})},Fs}var js,Al;function ag(){if(Al)return js;Al=1;var e=rr(),t=Hp(),r=An().Symbol,n=ig(),s=sg(),o=og(),i=Object.create,l=Object.defineProperties,u=Object.defineProperty,c,a,m;if(typeof r=="function")try{String(r()),m=!0}catch{}else r=null;return a=function(v){if(this instanceof a)throw new TypeError("Symbol is not a constructor");return c(v)},js=c=function d(v){var E;if(this instanceof d)throw new TypeError("Symbol is not a constructor");return m?r(v):(E=i(a.prototype),v=v===void 0?"":String(v),l(E,{__description__:e("",v),__name__:e("",n(v))}))},s(c),o(c),l(a.prototype,{constructor:e(c),toString:e("",function(){return this.__name__})}),l(c.prototype,{toString:e(function(){return"Symbol ("+t(this).__description__+")"}),valueOf:e(function(){return t(this)})}),u(c.prototype,c.toPrimitive,e("",function(){var d=t(this);return typeof d=="symbol"?d:d.toString()})),u(c.prototype,c.toStringTag,e("c","Symbol")),u(a.prototype,c.toStringTag,e("c",c.prototype[c.toStringTag])),u(a.prototype,c.toPrimitive,e("c",c.prototype[c.toPrimitive])),js}var Us,Nl;function cg(){return Nl||(Nl=1,Us=rg()()?An().Symbol:ag()),Us}var Ms,Ll;function ug(){if(Ll)return Ms;Ll=1;var e=Object.prototype.toString,t=e.call(function(){return arguments}());return Ms=function(r){return e.call(r)===t},Ms}var Gs,Dl;function lg(){if(Dl)return Gs;Dl=1;var e=Object.prototype.toString,t=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);return Gs=function(r){return typeof r=="function"&&t(e.call(r))},Gs}var Vs,kl;function fg(){if(kl)return Vs;kl=1;var e=Object.prototype.toString,t=e.call("");return Vs=function(r){return typeof r=="string"||r&&typeof r=="object"&&(r instanceof String||e.call(r)===t)||!1},Vs}var Bs,ql;function dg(){if(ql)return Bs;ql=1;var e=cg().iterator,t=ug(),r=lg(),n=er(),s=Ft(),o=mr(),i=Zt(),l=fg(),u=Array.isArray,c=Function.prototype.call,a={configurable:!0,enumerable:!0,writable:!0,value:null},m=Object.defineProperty;return Bs=function(d){var v=arguments[1],E=arguments[2],p,f,h,y,w,S,_,b,g,O;if(d=Object(o(d)),i(v)&&s(v),!this||this===Array||!r(this)){if(!v){if(t(d))return w=d.length,w!==1?Array.apply(null,d):(y=new Array(1),y[0]=d[0],y);if(u(d)){for(y=new Array(w=d.length),f=0;f<w;++f)y[f]=d[f];return y}}y=[]}else p=this;if(!u(d)){if((g=d[e])!==void 0){for(_=s(g).call(d),p&&(y=new p),b=_.next(),f=0;!b.done;)O=v?c.call(v,E,b.value,f):b.value,p?(a.value=O,m(y,f,a)):y[f]=O,b=_.next(),++f;w=f}else if(l(d)){for(w=d.length,p&&(y=new p),f=0,h=0;f<w;++f)O=d[f],f+1<w&&(S=O.charCodeAt(0),S>=55296&&S<=56319&&(O+=d[++f])),O=v?c.call(v,E,O,h):O,p?(a.value=O,m(y,h,a)):y[h]=O,++h;w=h}}if(w===void 0)for(w=n(d.length),p&&(y=new p(w)),f=0;f<w;++f)O=v?c.call(v,E,d[f],f):d[f],p?(a.value=O,m(y,f,a)):y[f]=O;return p&&(a.value=null,y.length=w),y},Bs}var Hs,Fl;function qa(){return Fl||(Fl=1,Hs=Zw()()?Array.from:dg()),Hs}var zs,jl;function pg(){if(jl)return zs;jl=1;var e=qa(),t=Array.isArray;return zs=function(r){return t(r)?r:e(r)},zs}var Ws,Ul;function hg(){if(Ul)return Ws;Ul=1;var e=pg(),t=Zt(),r=Ft(),n=Array.prototype.slice,s;return s=function(o){return this.map(function(i,l){return i?i(o[l]):o[l]}).concat(n.call(o,this.length))},Ws=function(o){return o=e(o),o.forEach(function(i){t(i)&&r(i)}),s.bind(o)},Ws}var Xs,Ml;function mg(){if(Ml)return Xs;Ml=1;var e=Ft();return Xs=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))},Xs}var Ks,Gl;function yg(){if(Gl)return Ks;Gl=1;var e=Bw(),t=Vp(),r=rr(),n=Qw().methods,s=hg(),o=mg(),i=Function.prototype.apply,l=Function.prototype.call,u=Object.create,c=Object.defineProperties,a=n.on,m=n.emit;return Ks=function(d,v,E){var p=u(null),f,h,y,w,S,_,b,g,O,$,C,G,Y,Q,A;return v!==!1?h=v:isNaN(d.length)?h=1:h=d.length,E.normalizer&&($=o(E.normalizer),y=$.get,w=$.set,S=$.delete,_=$.clear),E.resolvers!=null&&(A=s(E.resolvers)),y?Q=t(function(x){var F,U,q=arguments;if(A&&(q=A(q)),F=y(q),F!==null&&hasOwnProperty.call(p,F))return C&&f.emit("get",F,q,this),p[F];if(q.length===1?U=l.call(d,this,q[0]):U=i.call(d,this,q),F===null){if(F=y(q),F!==null)throw e("Circular invocation","CIRCULAR_INVOCATION");F=w(q)}else if(hasOwnProperty.call(p,F))throw e("Circular invocation","CIRCULAR_INVOCATION");return p[F]=U,G&&f.emit("set",F,null,U),U},h):v===0?Q=function(){var x;if(hasOwnProperty.call(p,"data"))return C&&f.emit("get","data",arguments,this),p.data;if(arguments.length?x=i.call(d,this,arguments):x=l.call(d,this),hasOwnProperty.call(p,"data"))throw e("Circular invocation","CIRCULAR_INVOCATION");return p.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(p,q))return C&&f.emit("get",q,U,this),p[q];if(U.length===1?F=l.call(d,this,U[0]):F=i.call(d,this,U),hasOwnProperty.call(p,q))throw e("Circular invocation","CIRCULAR_INVOCATION");return p[q]=F,G&&f.emit("set",q,null,F),F},f={original:d,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(p,x)},delete:function(x){var F;hasOwnProperty.call(p,x)&&(S&&S(x),F=p[x],delete p[x],Y&&f.emit("delete",x,F))},clear:function(){var x=p;_&&_(),p=u(null),f.emit("clear",x)},on:function(x,F){return x==="get"?C=!0:x==="set"?G=!0:x==="delete"&&(Y=!0),a.call(this,x,F)},emit:m,updateEnv:function(){d=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?p.data:(A&&(F=A(F)),y?x=y(F):x=String(F[0]),p[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))}),c(Q,{__memoized__:r(!0),delete:r(b),clear:r(f.clear),_get:r(g),_has:r(O)}),f},Ks}var Ys,Vl;function vg(){if(Vl)return Ys;Vl=1;var e=Ft(),t=Cn(),r=tr(),n=yg(),s=Up();return Ys=function o(i){var l,u,c;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=s(l.length,i.length,l.async&&r.async),c=n(i,u,l),t(r,function(a,m){l[m]&&a(l[m],c,l)}),o.__profiler__&&o.__profiler__(c),c.updateEnv(),c.memoized)},Ys}var Js,Bl;function wg(){return Bl||(Bl=1,Js=function(e){var t,r,n=e.length;if(!n)return"";for(t=String(e[r=0]);--n;)t+=""+e[++r];return t}),Js}var Qs,Hl;function gg(){return Hl||(Hl=1,Qs=function(e){return e?function(t){for(var r=String(t[0]),n=0,s=e;--s;)r+=""+t[++n];return r}:function(){return""}}),Qs}var Zs,zl;function _g(){return zl||(zl=1,Zs=function(){var e=Number.isNaN;return typeof e!="function"?!1:!e({})&&e(NaN)&&!e(34)}),Zs}var eo,Wl;function Eg(){return Wl||(Wl=1,eo=function(e){return e!==e}),eo}var to,Xl;function Sg(){return Xl||(Xl=1,to=_g()()?Number.isNaN:Eg()),to}var ro,Kl;function Fa(){if(Kl)return ro;Kl=1;var e=Sg(),t=er(),r=mr(),n=Array.prototype.indexOf,s=Object.prototype.hasOwnProperty,o=Math.abs,i=Math.floor;return ro=function(l){var u,c,a,m;if(!e(l))return n.apply(this,arguments);for(c=t(r(this).length),a=arguments[1],isNaN(a)?a=0:a>=0?a=i(a):a=t(this.length)-i(o(a)),u=a;u<c;++u)if(s.call(this,u)&&(m=this[u],e(m)))return u;return-1},ro}var no,Yl;function bg(){if(Yl)return no;Yl=1;var e=Fa(),t=Object.create;return no=function(){var r=0,n=[],s=t(null);return{get:function(o){var i=0,l=n,u,c=o.length;if(c===0)return l[c]||null;if(l=l[c]){for(;i<c-1;){if(u=e.call(l[0],o[i]),u===-1)return null;l=l[1][u],++i}return u=e.call(l[0],o[i]),u===-1?null:l[1][u]||null}return null},set:function(o){var i=0,l=n,u,c=o.length;if(c===0)l[c]=++r;else{for(l[c]||(l[c]=[[],[]]),l=l[c];i<c-1;)u=e.call(l[0],o[i]),u===-1&&(u=l[0].push(o[i])-1,l[1].push([[],[]])),l=l[1][u],++i;u=e.call(l[0],o[i]),u===-1&&(u=l[0].push(o[i])-1),l[1][u]=++r}return s[r]=o,r},delete:function(o){var i=0,l=n,u,c=s[o],a=c.length,m=[];if(a===0)delete l[a];else if(l=l[a]){for(;i<a-1;){if(u=e.call(l[0],c[i]),u===-1)return;m.push(l,u),l=l[1][u],++i}if(u=e.call(l[0],c[i]),u===-1)return;for(o=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 s[o]},clear:function(){n=[],s=t(null)}}},no}var io,Jl;function Rg(){if(Jl)return io;Jl=1;var e=Fa();return io=function(){var t=0,r=[],n=[];return{get:function(s){var o=e.call(r,s[0]);return o===-1?null:n[o]},set:function(s){return r.push(s[0]),n.push(++t),t},delete:function(s){var o=e.call(n,s);o!==-1&&(r.splice(o,1),n.splice(o,1))},clear:function(){r=[],n=[]}}},io}var so,Ql;function Og(){if(Ql)return so;Ql=1;var e=Fa(),t=Object.create;return so=function(r){var n=0,s=[[],[]],o=t(null);return{get:function(i){for(var l=0,u=s,c;l<r-1;){if(c=e.call(u[0],i[l]),c===-1)return null;u=u[1][c],++l}return c=e.call(u[0],i[l]),c===-1?null:u[1][c]||null},set:function(i){for(var l=0,u=s,c;l<r-1;)c=e.call(u[0],i[l]),c===-1&&(c=u[0].push(i[l])-1,u[1].push([[],[]])),u=u[1][c],++l;return c=e.call(u[0],i[l]),c===-1&&(c=u[0].push(i[l])-1),u[1][c]=++n,o[n]=i,n},delete:function(i){for(var l=0,u=s,c,a=[],m=o[i];l<r-1;){if(c=e.call(u[0],m[l]),c===-1)return;a.push(u,c),u=u[1][c],++l}if(c=e.call(u[0],m[l]),c!==-1){for(i=u[1][c],u[0].splice(c,1),u[1].splice(c,1);!u[0].length&&a.length;)c=a.pop(),u=a.pop(),u[0].splice(c,1),u[1].splice(c,1);delete o[i]}},clear:function(){s=[[],[]],o=t(null)}}},so}var Zl={},oo,ef;function zp(){if(ef)return oo;ef=1;var e=Ft(),t=Cn(),r=Function.prototype.call;return oo=function(n,s){var o={},i=arguments[2];return e(s),t(n,function(l,u,c,a){o[u]=r.call(s,i,l,u,c,a)}),o},oo}var ao,tf;function ja(){if(tf)return ao;tf=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(""),s,o,i=0;return new r(function(){var l;if(s)o&&(s=o.concat(s));else{if(!o)return;s=o}if(o=s,s=null,typeof o=="function"){l=o,o=null,l();return}for(n.data=i=++i%2;o;)l=o.shift(),o.length||(o=null),l()}).observe(n,{characterData:!0}),function(l){if(e(l),s){typeof s=="function"?s=[s,l]:s.push(l);return}s=l,n.data=i=++i%2}};return ao=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}(),ao}var rf;function $g(){if(rf)return Zl;rf=1;var e=qa(),t=zp(),r=Gp(),n=Vp(),s=ja(),o=Array.prototype.slice,i=Function.prototype.apply,l=Object.create;return tr().async=function(u,c){var a=l(null),m=l(null),d=c.memoized,v=c.original,E,p,f;c.memoized=n(function(h){var y=arguments,w=y[y.length-1];return typeof w=="function"&&(E=w,y=o.call(y,0,-1)),d.apply(p=this,f=y)},d);try{r(c.memoized,d)}catch{}c.on("get",function(h){var y,w,S;if(E){if(a[h]){typeof a[h]=="function"?a[h]=[a[h],E]:a[h].push(E),E=null;return}y=E,w=p,S=f,E=p=f=null,s(function(){var _;hasOwnProperty.call(m,h)?(_=m[h],c.emit("getasync",h,S,w),i.call(y,_.context,_.args)):(E=y,p=w,f=S,d.apply(w,S))})}}),c.original=function(){var h,y,w,S;return E?(h=e(arguments),y=function _(b){var g,O,$=_.id;if($==null){s(i.bind(_,this,arguments));return}if(delete _.id,g=a[$],delete a[$],!!g)return O=e(arguments),c.has($)&&(b?c.delete($):(m[$]={context:this,args:O},c.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=p=f=null,h.push(y),S=i.call(v,this,h),y.cb=w,E=y,S):i.call(v,this,arguments)},c.on("set",function(h){if(!E){c.delete(h);return}a[h]?typeof a[h]=="function"?a[h]=[a[h],E.cb]:a[h].push(E.cb):a[h]=E.cb,delete E.cb,E.id=h,E=null}),c.on("delete",function(h){var y;hasOwnProperty.call(a,h)||m[h]&&(y=m[h],delete m[h],c.emit("deleteasync",h,o.call(y.args,1)))}),c.on("clear",function(){var h=m;m=l(null),c.emit("clearasync",t(h,function(y){return o.call(y.args,1)}))})},Zl}var nf={},co,sf;function Ig(){if(sf)return co;sf=1;var e=Array.prototype.forEach,t=Object.create;return co=function(r){var n=t(null);return e.call(arguments,function(s){n[s]=!0}),n},co}var uo,of;function Wp(){return of||(of=1,uo=function(e){return typeof e=="function"}),uo}var lo,af;function Pg(){if(af)return lo;af=1;var e=Wp();return lo=function(t){try{return t&&e(t.toString)?t.toString():String(t)}catch{throw new TypeError("Passed argument cannot be stringifed")}},lo}var fo,cf;function Tg(){if(cf)return fo;cf=1;var e=mr(),t=Pg();return fo=function(r){return t(e(r))},fo}var po,uf;function xg(){if(uf)return po;uf=1;var e=Wp();return po=function(t){try{return t&&e(t.toString)?t.toString():String(t)}catch{return"<Non-coercible to string value>"}},po}var ho,lf;function Cg(){if(lf)return ho;lf=1;var e=xg(),t=/[\n\r\u2028\u2029]/g;return ho=function(r){var n=e(r);return n.length>100&&(n=n.slice(0,99)+"…"),n=n.replace(t,function(s){return JSON.stringify(s).slice(1,-1)}),n},ho}var Wr={exports:{}},ff;function Xp(){if(ff)return Wr.exports;ff=1,Wr.exports=e,Wr.exports.default=e;function e(t){return!!t&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"}return Wr.exports}var df;function Ag(){if(df)return nf;df=1;var e=zp(),t=Ig(),r=Tg(),n=Cg(),s=Xp(),o=ja(),i=Object.create,l=t("then","then:finally","done","done:finally");return tr().promise=function(u,c){var a=i(null),m=i(null),d=i(null);if(u===!0)u=null;else if(u=r(u),!l[u])throw new TypeError("'"+n(u)+"' is not valid promise mode");c.on("set",function(v,E,p){var f=!1;if(!s(p)){m[v]=p,c.emit("setasync",v,1);return}a[v]=1,d[v]=p;var h=function(_){var b=a[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 a[v],m[v]=_,c.emit("setasync",v,b))},y=function(){f=!0,a[v]&&(delete a[v],delete d[v],c.delete(v))},w=u;if(w||(w="then"),w==="then"){var S=function(){o(y)};p=p.then(function(_){o(h.bind(this,_))},S),typeof p.finally=="function"&&p.finally(S)}else if(w==="done"){if(typeof p.done!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done' mode");p.done(h,y)}else if(w==="done:finally"){if(typeof p.done!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done:finally' mode");if(typeof p.finally!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'finally' in 'done:finally' mode");p.done(h),p.finally(y)}}),c.on("get",function(v,E,p){var f;if(a[v]){++a[v];return}f=d[v];var h=function(){c.emit("getasync",v,E,p)};s(f)?typeof f.done=="function"?f.done(h):f.then(function(){o(h)}):h()}),c.on("delete",function(v){if(delete d[v],a[v]){delete a[v];return}if(hasOwnProperty.call(m,v)){var E=m[v];delete m[v],c.emit("deleteasync",v,[E])}}),c.on("clear",function(){var v=m;m=i(null),a=i(null),d=i(null),c.emit("clearasync",e(v,function(E){return[E]}))})},nf}var pf={},hf;function Ng(){if(hf)return pf;hf=1;var e=Ft(),t=Cn(),r=tr(),n=Function.prototype.apply;return r.dispose=function(s,o,i){var l;if(e(s),i.async&&r.async||i.promise&&r.promise){o.on("deleteasync",l=function(u,c){n.call(s,null,c)}),o.on("clearasync",function(u){t(u,function(c,a){l(a,c)})});return}o.on("delete",l=function(u,c){s(c)}),o.on("clear",function(u){t(u,function(c,a){l(a,c)})})},pf}var mf={},mo,yf;function Lg(){return yf||(yf=1,mo=2147483647),mo}var yo,vf;function Dg(){if(vf)return yo;vf=1;var e=er(),t=Lg();return yo=function(r){if(r=e(r),r>t)throw new TypeError(r+" exceeds maximum possible timeout");return r},yo}var wf;function kg(){if(wf)return mf;wf=1;var e=qa(),t=Cn(),r=ja(),n=Xp(),s=Dg(),o=tr(),i=Function.prototype,l=Math.max,u=Math.min,c=Object.create;return o.maxAge=function(a,m,d){var v,E,p,f;a=s(a),a&&(v=c(null),E=d.async&&o.async||d.promise&&o.promise?"async":"",m.on("set"+E,function(h){v[h]=setTimeout(function(){m.delete(h)},a),typeof v[h].unref=="function"&&v[h].unref(),f&&(f[h]&&f[h]!=="nextTick"&&clearTimeout(f[h]),f[h]=setTimeout(function(){delete f[h]},p),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])}),d.preFetch&&(d.preFetch===!0||isNaN(d.preFetch)?p=.333:p=l(u(Number(d.preFetch),1),0),p&&(f={},p=(1-p)*a,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),d.async&&(y=e(y),y.push(i)),S=m.memoized.apply(w,y),d.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={})}))},mf}var gf={},vo,_f;function qg(){if(_f)return vo;_f=1;var e=er(),t=Object.create,r=Object.prototype.hasOwnProperty;return vo=function(n){var s=0,o=1,i=t(null),l=t(null),u=0,c;return n=e(n),{hit:function(a){var m=l[a],d=++u;if(i[d]=a,l[a]=d,!m)return++s,s<=n?void 0:(a=i[o],c(a),a);if(delete i[m],o===m)for(;!r.call(i,++o););},delete:c=function(a){var m=l[a];if(m&&(delete i[m],delete l[a],--s,o===m)){if(!s){u=0,o=1;return}for(;!r.call(i,++o););}},clear:function(){s=0,o=1,i=t(null),l=t(null),u=0}}},vo}var Ef;function Fg(){if(Ef)return gf;Ef=1;var e=er(),t=qg(),r=tr();return r.max=function(n,s,o){var i,l,u;n=e(n),n&&(l=t(n),i=o.async&&r.async||o.promise&&r.promise?"async":"",s.on("set"+i,u=function(c){c=l.hit(c),c!==void 0&&s.delete(c)}),s.on("get"+i,u),s.on("delete"+i,l.delete),s.on("clear"+i,l.clear))},gf}var Sf={},bf;function jg(){if(bf)return Sf;bf=1;var e=rr(),t=tr(),r=Object.create,n=Object.defineProperties;return t.refCounter=function(s,o,i){var l,u;l=r(null),u=i.async&&t.async||i.promise&&t.promise?"async":"",o.on("set"+u,function(c,a){l[c]=a||1}),o.on("get"+u,function(c){++l[c]}),o.on("delete"+u,function(c){delete l[c]}),o.on("clear"+u,function(){l={}}),n(o.memoized,{deleteRef:e(function(){var c=o.get(arguments);return c===null||!l[c]?null:--l[c]?!1:(o.delete(c),!0)}),getRefCount:e(function(){var c=o.get(arguments);return c===null||!l[c]?0:l[c]})})},Sf}var wo,Rf;function Ug(){if(Rf)return wo;Rf=1;var e=jp(),t=Up(),r=vg();return wo=function(n){var s=e(arguments[1]),o;return s.normalizer||(o=s.length=t(s.length,n.length,s.async),o!==0&&(s.primitive?o===!1?s.normalizer=wg():o>1&&(s.normalizer=gg()(o)):o===!1?s.normalizer=bg()():o===1?s.normalizer=Rg()():s.normalizer=Og()(o))),s.async&&$g(),s.promise&&Ag(),s.dispose&&Ng(),s.maxAge&&kg(),s.max&&Fg(),s.refCounter&&jg(),r(n,s)},wo}var Mg=Ug();const je=$e(Mg);async function me(e){try{return await ae.promises.access(e),!0}catch{return!1}}function Gg(e){try{return ae.accessSync(e),!0}catch{return!1}}function Vg(){if(pr()&&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=pe.homedir();return e===""?void 0:e}}const Bg=/^~(?=$|\/|\\)/;function st(e){const t=Vg();return t===void 0?e:e.replace(Bg,t)}const{appendFile:Kp,readFile:Ua,writeFile:Hg}=ae.promises,Yp=st("~/.bashrc");async function zg(e){const t=e.guard===void 0?`
|
||
source "${e.rcPath}"
|
||
`:`
|
||
# ${e.guard}
|
||
if [[ "$SOURCE_${e.guard.toUpperCase()}RC" != 0 && -f "${e.rcPath}" ]]; then source "${e.rcPath}"; fi
|
||
`;try{await Promise.all([Wg(e),Of(t,st("~/.bashrc")),Of(t,st("~/.profile"))])}catch(r){Se(`Failed to add ${t} to .profile or .bashrc. You should add it manually: ${r}`)}}const Ma=je(zg,{promise:!0});async function Wg(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 me(e.rcPath)&&((await Ua(e.rcPath,"utf8")).includes(t)||(await Kp(e.rcPath,`
|
||
${t}
|
||
`),W(`Added ${t} to ${e.rcPath}`)))}async function Of(e,t){await me(t)&&((await Ua(t,"utf-8")).includes(e)||(await Kp(t,e),W(`${e} was added to ${t}`)))}async function Xg(e){if(await me(e.rcPath)){const t=(await Ua(e.rcPath,"utf-8")).split(`
|
||
`),r=[...new Set(t.reverse())].reverse();await Hg(e.rcPath,r.join(`
|
||
`)),await hr(e.rcPath)}}var go,$f;function Kg(){if($f)return go;$f=1;const e=pe,t=e.platform()!=="win32",r=e.release(),n=/(\d+\.\d+)\.(\d+)/,s=(o="",i="")=>/1\d+\.\d+/.test(o)&&Number(i)>=17134.1184;return go=function(o){return t?o.replace(/(\s+)/g,"\\$1"):s(...n.exec(r).splice(1))?o:o.replace(/(\s+)/g,"%20")},go}var Yg=Kg();const Jg=$e(Yg);var en={exports:{}},_o,If;function Qg(){if(If)return _o;If=1;var e=/[|\\{}()[\]^$+*?.]/g;return _o=function(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(e,"\\$&")},_o}var Zg=en.exports,Pf;function e_(){return Pf||(Pf=1,function(){var e,t;e=Qg(),t=function(r){return r.split("").reverse().join("")},en.exports=function(r,n,s){var o;return n==null&&(n="'"),s==null&&(s="\\"),typeof r!="string"?r:(o=new RegExp("(["+e(n)+"])(?!"+e(s)+")","g"),t(t(r).replace(o,"$1"+s)))}}.call(Zg)),en.exports}var t_=e_();const r_=$e(t_);function n_(e,t=!1){const r=t?Jg(e):e;return r_(r,'"',"\\")}const{GITHUB_ACTIONS:i_}=gt,{appendFile:Tf}=ae.promises;async function Te(e,t,r={}){const n={escapeSpace:!1,overwrite:!0,rcPath:Yp,...r},s=n_(t!=null?t:"",n.escapeSpace);try{if(i_)try{if(!n.overwrite&&process.env[e]!==void 0){W(`Environment variable ${e} is already defined. Skipping.`);return}be.exportVariable(e,s)}catch(o){ke(o),await xf(e,s,n)}else await xf(e,s,n)}catch(o){ke(`${o}
|
||
Failed to export environment variable ${e}=${s}. You should add it manually.`)}}async function xf(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 Dp(`[Environment]::SetEnvironmentVariable('${e}', '${n}', "User")`),W(`${e}='${n}' was set in the environment.`);return}case"linux":case"darwin":{await Ma(r),r.overwrite?(await Tf(r.rcPath,`
|
||
export ${e}="${n}"
|
||
`),W(`${e}="${n}" was added to "${r.rcPath}`)):(await Tf(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:s_}=gt,{appendFile:o_}=ae.promises;async function Ie(e,t={}){const r={rcPath:Yp,...t};if(!c_(e)){process.env.PATH=`${e}${T.delimiter}${process.env.PATH}`;try{if(s_)try{be.addPath(e)}catch(n){ke(n),await Cf(e,r)}else await Cf(e,r)}catch(n){ke(`${n}
|
||
Failed to add ${e} to the percistent PATH. You should add it manually.`)}}}async function Cf(e,t){switch(process.platform){case"win32":{await Dp(`$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 Ma(t),await o_(t.rcPath,`
|
||
export PATH="${e}:$PATH"
|
||
`),W(`"${e}" was added to "${t.rcPath}"`);return}default:return}}const a_=[/\/usr\/bin\/?/,/\/usr\/local\/bin\/?/];function c_(e){var t,r;return a_.some(n=>n.test(e))?((r=(t=process.env.PATH)==null?void 0:t.split(T.delimiter))!=null?r:[]).includes(e):!1}function Ga(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 tn={exports:{}},u_=tn.exports,Af;function Jp(){return Af||(Af=1,function(e){(function(){var t={},r={create:n,addLocale:s,pluralize:o};e.exports=r;function n(c){return l(c),{pluralize:function(a,m){return o(c,a,m)}}}function s(c,a){t[c]=a}function o(c,a,m){if(l(c),typeof m!="object")throw new Error("List of variants should be specified as an object");var d=t[c](a);return typeof m[d]<"u"?m[d]:null}function i(c){return typeof t[c]<"u"}function l(c){i(c)||u(c)}function u(c){try{Ga(__dirname+"/../locales/"+c+".js")}catch{throw Error("Failed to load the following locale: "+c)}}}).call(u_)}(tn)),tn.exports}var Eo,Nf;function Qp(){return Nf||(Nf=1,Eo=Jp()),Eo}var l_=Qp();const f_=$e(l_);var So={},Lf;function d_(){return Lf||(Lf=1,function(){var e=this,t;typeof Ga=="function"?t=Jp():t=e.numerous,t.addLocale("en",function(n){var s=Math.floor(Math.abs(n)),o=n.toString().replace(/^[^.]*\.?/,"").length;return typeof n=="string"&&(n=parseInt(n,10)),s===1&&o===0?"one":"other"})}.call(So)),So}var p_=d_();const h_=$e(p_);var bo={exports:{}},Df;function m_(){return Df||(Df=1,function(e,t){e.exports=!!(typeof process<"u"&&process.versions&&process.versions.node)}(bo)),bo.exports}var Ro,kf;function y_(){if(kf)return Ro;kf=1;const e=Qp(),t=m_(),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},s={};Ro={create:i,addLocale:o,defaultConfig:n};function o(p){Array.isArray(p)||(p=[p]);for(const f of p){const{id:h,data:y}=f;s[h]=y}}function i(p){return p=Object.assign({},n,p||{}),{format:function(f,h,y){return y=Object.assign({},p,y||{}),l(f,h,y)}}}function l(p,f,h){if(u(h.locale,{autoload:h.autoloadLocales}),!p)throw new Error("Missing first date argument");if(!f)throw new Error("Missing second date argument");const y=m(p,f),w=[];for(const S of y){const[_,b]=S;if(b>0&&w.push(d(_,b,h)),w.length>=h.span)break}return w.join(h.delimiter)}function u(p,f){const{autoload:h}=f;if(!c(p))if(t&&h)a(p);else throw new Error(`Missing locale: ${p}, you must load it manually before using it`)}function c(p){return!!s[p]}function a(p){try{o(Ga(`../locales/${p}.js`))}catch(f){throw Error(`Failed to load locale: ${p} from ../locales/${p}.js. If using a bundled time-delta, set 'autoloadLocales: false' in the config: ${f}`)}}function m(p,f){let h=f-p;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 d(p,f,h){const y=v(h);return e.pluralize(h.locale,f,y[p]).replace("{0}",f)}function v(p){const f=s[p.locale];let h=p.unitTypeLookupOrder.slice();h.unshift(p.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: "+p.locale);return y}function E(p){return Array.from(new Set(p))}return Ro}var Oo,qf;function v_(){return qf||(qf=1,Oo=y_()),Oo}var w_=v_();const Ff=$e(w_);var $o,jf;function g_(){return jf||(jf=1,$o={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"}}}}),$o}var __=g_();const E_=$e(__);var S_=ap();const Nn=$e(S_);function dn(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var Io,Uf;function b_(){if(Uf)return Io;Uf=1;var e=T;function t(n,s){if(typeof n!="string"||n.length===0)return n;var o=e.basename(n,e.extname(n))+s,i=e.join(e.dirname(n),o);return r(n)?"."+e.sep+i:i}function r(n){var s=n.slice(0,2);return s==="."+e.sep||s==="./"}return Io=t,Io}var R_=b_();const O_=$e(R_);function St(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 Tt(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}function $_(e,t=!0){return t?T.basename(e):T.basename(e,T.extname(e))}function I_(e){return T.normalize(e).replace(RegExp(dn(T.sep)+"$"),"")}function Ee(e,t=".exe",r=""){return process.platform==="win32"?`${e}${t}`:`${e}${r}`}function P_(e,t){const r=T.extname(e),n=`${t}${T.basename(e,r)}${r}`;return T.join(T.dirname(e),n)}function T_(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 Zp(e){return process.platform==="win32"?e:"./"+e}function x_(e){const t=T.extname(e).length;return e.slice(0,-t)}function C_(e,t){return O_(e,t)}function A_(e,t){const r=T.relative(t,e);return!(!r||r===".."||r.startsWith(".."+T.sep)||r===T.resolve(e))}var bt={},eh={};Tt(eh,"name",()=>$_);var th={};Tt(th,"normalizeTrim",()=>I_);var rh={};Tt(rh,"addExeExt",()=>Ee);var nh={};Tt(nh,"addNamePrefix",()=>P_);var ih={};Tt(ih,"addNameSuffix",()=>T_);var sh={};Tt(sh,"addShExt",()=>va);var oh={};Tt(oh,"addShRelativePrefix",()=>Zp);var ah={};Tt(ah,"removeExt",()=>x_);var ch={};Tt(ch,"replaceExt",()=>C_);var Mf={};Tt(Mf,"isPathInside",()=>A_),St(bt,eh),St(bt,th),St(bt,rh),St(bt,nh),St(bt,ih),St(bt,sh),St(bt,oh),St(bt,ah),St(bt,ch),St(bt,Mf);var N_=cp();const uh=$e(N_);function lh(){if(process.platform!=="linux")return!1;try{return Gg("/etc/alpine-release")}catch{return!1}}async function L_(){if(!lh())return!1;try{return await he("apk"),!0}catch{return!1}}const Oe=je(L_,{promise:!0});async function D_(){await le("apk",["update"],{stdio:"inherit"})}const pn=je(D_,{promise:!0});async function k_(e){if(!await Oe())throw new Error("apk is not available on this system");try{const t="/etc/apk/repositories";if(!await me(t))throw new Error(`APK repositories file not found at ${t}`);return W(`Adding repository: ${e}`),await Ap(t,`${e}
|
||
`),await pn.clear(),await pn(),W(`Successfully added repository: ${e}`),!0}catch(t){throw new Error(`Failed to add repository ${e}: ${t}`)}}async function fh(){const e=(await q_()).split(".").slice(0,2).join(".");return k_(`https://dl-cdn.alpinelinux.org/alpine/v${e}/community/`)}async function q_(){const e="/etc/alpine-release";if(!await me(e))throw new Error(`Alpine release file not found at ${e}`);return Lr(e,"utf8")}async function F_(e){try{const{exitCode:t}=await yt("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 yt("apk",["info","-v",e.name],{stdio:["ignore","pipe","ignore"]});return r.trim().split("-").slice(-1)[0]===e.version}catch{return!1}}async function dh(e){return(await Promise.all(e.map(async r=>await F_(r)?void 0:r))).filter(r=>r!==void 0).map(ph)}function ph(e){return e.version!==void 0&&e.version!==""?`${e.name}=${e.version}`:e.name}async function j_(){const e=await dh([{name:"bash"}]);e.length!==0&&ye("apk",["add",...e],{...vt})}const U_=je(j_,{promise:!0});async function Le(e,t=!1){if(!await Oe())throw new Error("apk is not available on this system");try{await U_(),t&&await pn.clear(),await pn();const r=await dh(e);return r.length===0?(W("All packages are already installed"),{binDir:"/usr/bin"}):(W(`Installing ${r.join(" ")}`),await yt("apk",["add",...r]),W(`Successfully installed ${r.join(" ")}`),{binDir:"/usr/bin"})}catch(r){throw Se(`Failed to install ${e.map(n=>ph(n)).join(" ")}: ${r}`),r}}const{GITHUB_ACTIONS:M_}=gt,{appendFile:G_}=ae.promises;async function V_(e,t,r=40){await yt("update-alternatives",["--install",`/usr/bin/${e}`,e,t,r.toString()])}async function mt(e,t,r,n=40){M_?await V_(e,t,n):(await Ma(r),await G_(r.rcPath,`
|
||
if [ $UID -eq 0 ]; then update-alternatives --install /usr/bin/${e} ${e} ${t} ${n}; fi
|
||
`))}var Po={},Gf;function B_(){return Gf||(Gf=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,s=v(n),o=ct,i=T,l=v(i),u=Ea,c=v(u),a=En,m=v(a),d=Sn;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 p(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=p(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):p(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&&s.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){s.access(_.__filePath,function($){return $?(_.__emitStop(),g(!0)):void s.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 o.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 o.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=s.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(),s.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=s.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 o.URL(this.requestURL).pathname).length?g=l.basename(new o.URL(this.requestURL).pathname):g=new o.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 o.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=s.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(!s.existsSync(b))throw new Error("Destination Folder must exist");var g=s.statSync(b);if(!g.isDirectory())throw new Error("Destination Folder must be a directory");try{s.accessSync(b,s.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=c,b.agent=new c.Agent({keepAlive:!1}),this.__reqOptions=Object.assign({},b,this.__opts.httpRequestOptions))}},{key:"__uniqFileNameSync",value:function(_){if(typeof _!="string"||_==="")return _;try{s.accessSync(_,s.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?s.access(_.__filePath,function(O){return O?b():void s.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}(d.EventEmitter)}(Po)),Po}var Dr=B_();function It(e){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}const yr="Dpkg::Lock::Timeout=300";function hh(){return he.sync("nala",{nothrow:!0})!==null}function kr(){let e;return hh()?e="nala":e="apt-get",e}async function Va(e){try{const{stdout:t}=await le("dpkg",["-s",e],{env:It("apt-get"),stdio:"pipe"});return typeof t!="string"?!1:t.split(`
|
||
`).some(n=>n.startsWith("Status: install ok installed"))}catch{return!1}}async function H_(e){try{const{stdout:t}=await le("dpkg",["-l",e],{env:It("apt-get"),stdio:"pipe"});return typeof t!="string"?!1:t.split(`
|
||
`).some(n=>n.startsWith("ii"))}catch{return!1}}let mh=!1;function z_(e=kr()){ye(e,["update","-o",yr],{...vt,env:It(e)}),mh=!0}const cr=je(z_);var $t;(function(e){e[e.NameDashVersion=0]="NameDashVersion",e[e.NameEqualsVersion=1]="NameEqualsVersion",e[e.Name=2]="Name",e[e.None=3]="None"})($t||($t={}));async function yh(e,t=kr()){return(await Promise.all(e.map(r=>wa(r,t)))).filter(r=>r!==void 0)}async function wa(e,t=kr()){const r=await X_(t,e);return await Va(r)?void 0:r}async function vh(e,t,r,n){const s=r!==void 0&&r!=="",o=!s||n;if(s){if(await W_(e,t,r))return $t.NameDashVersion;if(await Vf(e,`${t}=${r}`))return $t.NameEqualsVersion}const i=()=>{s&&n&&W(`Could not find package ${t} ${r}. Falling back to latest version.`)};return o&&await Vf(e,t)?(i(),$t.Name):mh?o?(i(),$t.Name):$t.None:(cr(e),vh(e,t,r,n))}async function W_(e,t,r){try{const{stdout:n}=await le("apt-cache",["search","--names-only",`^${dn(t)}-${dn(r)}$`],{env:It(e),stdio:"pipe"});if(n.trim()!=="")return!0}catch{}return!1}async function Vf(e,t){try{const{stdout:r}=await le("apt-cache",["show",t],{env:It(e),stdio:"pipe",verbose:!0});if(r.trim()!=="")return!0}catch{}return!1}async function X_(e,t){const{name:r,version:n,fallBackToLatest:s=!1}=t;switch(await vh(e,r,n,s)){case $t.NameDashVersion:return`${r}-${n}`;case $t.NameEqualsVersion:return`${r}=${n}`;case $t.Name:return r;default:throw new Error(`Could not find package '${r}' ${n!=null?n:"with unspecified version"}`)}}async function K_(e){cr(e);const t=await yh([{name:"ca-certificates"},{name:"gnupg"},{name:"apt-utils"}],e);t.length!==0&&ye(e,["install","-y","--fix-broken","-o",yr,...t],{...vt,env:It(e)})}const wh=je(K_,{promise:!0});async function Y_(e,t=kr()){await wh(t),await gh(),ye("add-apt-repository",["-y","--no-update",e],{...vt,env:It(t)}),cr.clear(),cr(t)}async function gh(){if(await Va("software-properties-common"))return;const e="apt-get";ye(e,["install","-y","--fix-broken","-o",yr,"software-properties-common"],{...vt,env:It(e)})}const J_=["E: Could not get lock","dpkg: error processing archive","dpkg: error: dpkg status database is locked by another process"];async function fe(e,t=!1){try{const r=kr();for(const{name:s,version:o}of e)W(`Installing ${s} ${o!=null?o:""} via ${r}`);t&&cr.clear(),cr(r),await Q_(r,e);const n=await yh(e,r);if(n.length===0)return W("All packages are already installed"),{binDir:"/usr/bin/"};await wh(r);try{await Z_(e),ye(r,["install","--fix-broken","-y",...n],{...vt,env:It(r)})}catch(s){if(eE(s))J_.some(o=>typeof s.stderr=="string"&&s.stderr.includes(o))&&(Se(`Failed to install packages ${n}. Retrying...`),ye(r,["install","--fix-broken","-y","-o",yr,...n],{...vt,env:It(r)}));else throw s}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 Q_(e,t){const r=[...new Set(t.flatMap(n=>{var s;return(s=n.repository)!=null?s:[]}))];await Promise.all(r.map(n=>Y_(n,e)))}async function Z_(e){await Promise.all(e.map(async t=>{t.key!==void 0&&await tE(t.key)}))}function eE(e){return typeof e.stderr=="string"}function tE(e){return"keyUrl"in e?_h(e):nE(e)}const rE="/etc/apt/trusted.gpg.d",Bf="keyserver.ubuntu.com";async function nE({key:e,keyServer:t=Bf,fileName:r,keyStorePath:n=Bf}){try{Sh(r);const s=T.join(n,r);return await me(s)||(Eh(),await yt("gpg",["--no-default-keyring","--keyring",`gnupg-ring:${s}`,"--keyserver",t,"--recv-keys",e]),await yt("chmod",["644",s])),s}catch(s){Se(`Failed to add apt key via server ${t}: ${s}`);return}}async function _h({keyUrl:e,fileName:t,keyStorePath:r=rE}){try{Sh(t);const n=T.join(r,t);if(!await me(n)){Eh(),await fe([{name:"ca-certificates"}]);const s=T.join(pe.tmpdir(),t),o=new Dr.DownloaderHelper(e,pe.tmpdir(),{fileName:t});o.on("error",i=>{throw new Error(`Failed to download ${e}: ${i}`)}),await o.start(),ye("gpg",["--no-default-keyring","--keyring",`gnupg-ring:${n}`,"--import",s]),ye("chmod",["644",n])}return n}catch(n){Se(`Failed to add apt key via download ${e}: ${n}`);return}}function Eh(){ye("gpg",["-k"])}function Sh(e){if(!e.endsWith(".gpg"))throw new Error(`Key file name must end with .gpg: ${e}`)}let Xt;async function Ba(e={}){if(!["darwin","linux"].includes(process.platform)||process.platform==="linux"&&process.arch!=="x64"){Se(`Brew is not supported on ${process.platform} ${process.arch}`);return}if(typeof Xt=="string")return{binDir:Xt};const t=await he("brew",{nothrow:!0});if(t!==null)return Xt=T.dirname(t),{binDir:Xt};await fe([{name:"ca-certificates"}]);const r=new Dr.DownloaderHelper("https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh",pe.tmpdir(),{fileName:"install-brew.sh"});return r.on("error",n=>{throw new Error(`Failed to download the brew installer script: ${n}`)}),await r.start(),Be("/bin/bash",[r.getDownloadPath()],{stdio:"inherit",env:{NONINTERACTIVE:"1"}}),Xt=Ha(),await Ie(Xt,e.rcOptions),{binDir:Xt}}function Ha(){return T.join(za(),"bin")}function bh(){return T.join(Ha(),"brew")}function za(){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 Rh(e,t){return t!==void 0&&t!==""?`${e}@${t}`:e}async function iE(e,t){const r=Rh(e,t),n=await Hf(r);if(n!==void 0)return n;const s=await Hf(e);return s!==void 0?s:sE(e,r)}async function Hf(e){try{const t=bh();return(await le(t,["--prefix",e],{stdio:"pipe"})).stdout}catch{return}}function sE(e,t){const r=za(),n=T.join(r,"opt",t);if(ae.existsSync(n))return n;const s=T.join(r,"opt",e);if(ae.existsSync(s))return s;const o=T.join(r,"Cellar",t);if(ae.existsSync(o))return o;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 zf=!1;async function He(e,t,r={}){"overwrite"in r||(r.overwrite=!0),r.cask===!0&&(r.overwrite=!1),W(`Installing ${e} ${t!=null?t:""} via brew`),(!zf||he.sync("brew",{nothrow:!0})===null)&&(await Ba(),zf=!0);const n=bh(),s=["install",Rh(e,t)];for(const[u,c]of Object.entries(r))typeof c=="boolean"&&c?s.push(`--${u}`):typeof c=="string"&&s.push(`--${u}`,c);const o=Be(n,[...s,"--dry-run"],{stdio:"pipe"});o.exitCode===0&&new RegExp(`.*${e}.* is already installed and up-to-date.[\\s\\S]*`).test(o.stderr)?W(`${e} ${t!=null?t:""} is already installed and up-to-date`):Be(n,s,{stdio:"inherit"});const l=await iE(e,t);return l===void 0?(Se(`Failed to find installation directory for ${e} ${t}`),{binDir:Ha(),installDir:void 0}):{installDir:l,binDir:T.join(l,"bin")}}var Ln=Ca();const ne={rcPath:st("~/.cpprc"),guard:"cpp"};async function Oh(){if(process.platform==="darwin")try{const e=await Ln.getExecOutput("xcrun --sdk macosx --show-sdk-path"),t=e.stdout||e.stderr;t?await Te("SDKROOT",t.trim(),ne):ke("SDKROOT not set")}catch(e){ke(e)}}let To;function xe(){return process.platform!=="linux"?!1:(To===void 0&&(To=he.sync("dnf",{nothrow:!0})!==null),To)}let xo;function Pe(){return process.platform!=="linux"?!1:(xo===void 0&&(xo=he.sync("pacman",{nothrow:!0})!==null),xo)}let Co;function ve(){return process.platform!=="linux"?!1:(Co===void 0&&(Co=he.sync("apt-get",{nothrow:!0})!==null),Co)}async function Ce(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=>oE(r.name,r.version)));return ye("dnf",["-y","install",...t]),{binDir:"/usr/bin/"}}async function oE(e,t){if(t===void 0||t==="")return e;const{stdout:r}=await le("dnf",["search","-q",`${e}-${t}`]);if(r.trim()!=="")return`${e}-${t}`;const{stdout:n}=await le("dnf",["search","-q",`${e}${t}`]);return n.trim()!==""?`${e}${t}`:(Se(`Failed to install ${e} ${t} via dnf, trying without version`),e)}let Wf=!1,Xf=!1;async function _e(e,t,r){W(`Installing ${e} ${t!=null?t:""} via pacman`);const n="pacman";r==="yay"&&uE(),!Wf&&r!=="yay"&&(ye(n,["-Sy","--noconfirm"]),Wf=!0),!Xf&&r!=="yay"&&(ye(n,["-S","--noconfirm","base-devel"]),Xf=!0);const s=o=>r==="yay"?dr()&&$h?ye("su",["-","builder","-c",`yay -S --noconfirm ${o}`]):Be(r,["-S","--noconfirm",o]):ye(r!=null?r:n,["-S","--noconfirm",o]);if(t!==void 0&&t!=="")if((await cE(n,e)).includes(t))try{s(`${e}=${t}`)}catch{s(`${e}${t}`)}else W(`Failed to install ${e} ${t} via pacman, trying without version`),s(e);else s(e);return{binDir:"/usr/bin/"}}const aE=/Version\s*:\s*(.*)/g;async function cE(e,t){const r=[];try{const{stdout:n}=await le(e,["-Si",t]);for(const s of n.matchAll(aE))r.push(s[1])}catch(n){Se(`Failed to get available versions for ${t}: ${n}`)}return r}let $h=!1;function uE(){if(he.sync("yay",{nothrow:!0})===null)try{ye("pacman",["-S","--noconfirm","base-devel","git"]);const e=T.join(pe.tmpdir(),"yay");ye("mkdir",["-p",e]),dr()?(Se("Creating a non-root user to build yay"),ye("useradd",["-m","-G","wheel","builder"]),ye("passwd",["-d","builder"]),ye("chown",["-R","builder:builder",e]),ye("bash",["-c",'echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers']),$h=!0,Be("su",["-","builder","-c",`git clone https://aur.archlinux.org/yay.git ${e}`],{stdio:"inherit"}),Be("su",["-","builder","-c",`cd ${e} && makepkg -si --noconfirm`],{stdio:"inherit"})):(Be("git",["clone","https://aur.archlinux.org/yay.git",e],{stdio:"inherit",cwd:pe.tmpdir()}),Be("makepkg",["-si","--noconfirm"],{stdio:"inherit",cwd:e})),Be("rm",["-rf",e],{stdio:"inherit"})}catch(e){throw new Error(`Failed to install yay: ${e}. Install yay manually and re-run the script.`)}}var lE=dp();const Jt=$e(lE);var fE=ut();const dE=$e(fE);var pE=Nr();const Wa=$e(pE),Ih=/v?(\d\S*)/;async function Ph(e,t=Ih){var r,n;try{const s=await Ln.getExecOutput(e,["--version"]),i=(r=(s.stdout||s.stderr||"").trim().match(t))==null?void 0:r[1];return(n=Jt(i))!=null?n:void 0}catch(s){console.error(s);return}}async function ga(e,t,r=Ih){const n=await Ph(e,r);if(n!==void 0&&t!=="")try{return dE(n,t)!==-1}catch{return Wa(n,t)}else return!1}function Th(e){if(Nn(e)===null)try{const t=Jt(e);if(t!==null)return W(`Coerced version '${e}' to '${t}'`),t.version}catch{}return e}function hE(e){if(Nn(e)===null)try{const t=Jt(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 mE(e){return Number.parseInt(e.replace(/^v/,""),10)}function yE(e){return e.match(/^v/)?e:`v${e}`}function vE(e,t){const r=Jt(e),n=Jt(t);return r!==null&&n!==null?n.compare(r):t.localeCompare(e)}async function xh(){const e=T.join(sS,"gcc_matcher.json");if(!await me(e))return Se("the gcc_matcher.json file does not exist in the same folder as setup-cpp.js");W(`::add-matcher::${e}`)}async function hn(e){const t=await Lr(e,"utf-8");return JSON.parse(t)}function mn(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 c=t.filterMapTag(u);c!==void 0&&n.set(c,u)}if(n.size===0)return;const s=(l=t.versionSatisfies)!=null?l:Wa,o=hE(t.version),i=[];for(const[u,c]of n.entries())s(u,o)&&i.push(c);if(i.length!==0)for(const u of i){let c=e[u];if(c===void 0||(t.filterName!==void 0&&(c=c.filter(t.filterName)),c.length===0))continue;const a=wE(u,c,t);if(a!==void 0)return a}}function wE(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 s of t)r.keywords.every(o=>typeof o=="string"&&s.includes(o)?!0:Array.isArray(o)&&o.some(i=>s.includes(i)))&&n.push(s);else n=t;if(n.length!==0){if(r.optionalKeywords!==void 0&&r.optionalKeywords.length!==0){const s=n.map(l=>{let u=0;for(const c of r.optionalKeywords)(typeof c=="string"&&l.includes(c)||Array.isArray(c)&&c.some(a=>l.includes(a)))&&u++;return u}),o=Math.max(...s),i=s.indexOf(o);return{tag:e,name:n[i]}}return{tag:e,name:n[0]}}}var Ao={},Xr={},Kf;function Ue(){return Kf||(Kf=1,Xr.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((s,o)=>s!=null?n(s):r(o)),e.apply(this,t)})},"name",{value:e.name})},Xr.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})}),Xr}var No,Yf;function gE(){if(Yf)return No;Yf=1;var e=$m,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 s=process.chdir;process.chdir=function(i){r=null,s.call(process,i)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,s)}No=o;function o(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=c(i.chmod),i.fchmod=c(i.fchmod),i.lchmod=c(i.lchmod),i.chownSync=d(i.chownSync),i.fchownSync=d(i.fchownSync),i.lchownSync=d(i.lchownSync),i.chmodSync=a(i.chmodSync),i.fchmodSync=a(i.fchmodSync),i.lchmodSync=a(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 c(f){return f&&function(h,y,w){return f.call(i,h,y,function(S){p(S)&&(S=null),w&&w.apply(this,arguments)})}}function a(f){return f&&function(h,y){try{return f.call(i,h,y)}catch(w){if(!p(w))throw w}}}function m(f){return f&&function(h,y,w,S){return f.call(i,h,y,w,function(_){p(_)&&(_=null),S&&S.apply(this,arguments)})}}function d(f){return f&&function(h,y,w){try{return f.call(i,h,y,w)}catch(S){if(!p(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 p(f){if(!f||f.code==="ENOSYS")return!0;var h=!process.getuid||process.getuid()!==0;return!!(h&&(f.code==="EINVAL"||f.code==="EPERM"))}}return No}var Lo,Jf;function _E(){if(Jf)return Lo;Jf=1;var e=Cr.Stream;Lo=t;function t(r){return{ReadStream:n,WriteStream:s};function n(o,i){if(!(this instanceof n))return new n(o,i);e.call(this);var l=this;this.path=o,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),c=0,a=u.length;c<a;c++){var m=u[c];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(d,v){if(d){l.emit("error",d),l.readable=!1;return}l.fd=v,l.emit("open",v),l._read()})}function s(o,i){if(!(this instanceof s))return new s(o,i);e.call(this),this.path=o,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,c=l.length;u<c;u++){var a=l[u];this[a]=i[a]}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 Lo}var Do,Qf;function EE(){if(Qf)return Do;Qf=1,Do=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(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(r,s))}),n}return Do}var Kr,Zf;function qr(){if(Zf)return Kr;Zf=1;var e=ae,t=gE(),r=_E(),n=EE(),s=ur,o,i;typeof Symbol=="function"&&typeof Symbol.for=="function"?(o=Symbol.for("graceful-fs.queue"),i=Symbol.for("graceful-fs.previous")):(o="___graceful-fs.queue",i="___graceful-fs.previous");function l(){}function u(f,h){Object.defineProperty(f,o,{get:function(){return h}})}var c=l;if(s.debuglog?c=s.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(c=function(){var f=s.format.apply(s,arguments);f="GFS4: "+f.split(/\n/).join(`
|
||
GFS4: `),console.error(f)}),!e[o]){var a=et[o]||[];u(e,a),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(){c(e[o]),xr.equal(e[o].length,0)})}et[o]||u(et,e[o]),Kr=m(n(e)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!e.__patched&&(Kr=m(e),e.__patched=!0);function m(f){t(f),f.gracefulify=m,f.createReadStream=z,f.createWriteStream=X;var h=f.readFile;f.readFile=y;function y(K,ie,se){return typeof ie=="function"&&(se=ie,ie=null),ge(K,ie,se);function ge(k,D,L,M){return h(k,D,function(H){H&&(H.code==="EMFILE"||H.code==="ENFILE")?d([ge,[k,D,L],H,M||Date.now(),Date.now()]):typeof L=="function"&&L.apply(this,arguments)})}}var w=f.writeFile;f.writeFile=S;function S(K,ie,se,ge){return typeof se=="function"&&(ge=se,se=null),k(K,ie,se,ge);function k(D,L,M,H,ee){return w(D,L,M,function(J){J&&(J.code==="EMFILE"||J.code==="ENFILE")?d([k,[D,L,M,H],J,ee||Date.now(),Date.now()]):typeof H=="function"&&H.apply(this,arguments)})}}var _=f.appendFile;_&&(f.appendFile=b);function b(K,ie,se,ge){return typeof se=="function"&&(ge=se,se=null),k(K,ie,se,ge);function k(D,L,M,H,ee){return _(D,L,M,function(J){J&&(J.code==="EMFILE"||J.code==="ENFILE")?d([k,[D,L,M,H],J,ee||Date.now(),Date.now()]):typeof H=="function"&&H.apply(this,arguments)})}}var g=f.copyFile;g&&(f.copyFile=O);function O(K,ie,se,ge){return typeof se=="function"&&(ge=se,se=0),k(K,ie,se,ge);function k(D,L,M,H,ee){return g(D,L,M,function(J){J&&(J.code==="EMFILE"||J.code==="ENFILE")?d([k,[D,L,M,H],J,ee||Date.now(),Date.now()]):typeof H=="function"&&H.apply(this,arguments)})}}var $=f.readdir;f.readdir=G;var C=/^v[0-5]\./;function G(K,ie,se){typeof ie=="function"&&(se=ie,ie=null);var ge=C.test(process.version)?function(L,M,H,ee){return $(L,k(L,M,H,ee))}:function(L,M,H,ee){return $(L,M,k(L,M,H,ee))};return ge(K,ie,se);function k(D,L,M,H){return function(ee,J){ee&&(ee.code==="EMFILE"||ee.code==="ENFILE")?d([ge,[D,L,M],ee,H||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,se){ie?(K.autoClose&&K.destroy(),K.emit("error",ie)):(K.fd=se,K.emit("open",se),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,se){ie?(K.destroy(),K.emit("error",ie)):(K.fd=se,K.emit("open",se))})}function z(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,se,ge){return typeof se=="function"&&(ge=se,se=null),k(K,ie,se,ge);function k(D,L,M,H,ee){return re(D,L,M,function(J,qe){J&&(J.code==="EMFILE"||J.code==="ENFILE")?d([k,[D,L,M,H],J,ee||Date.now(),Date.now()]):typeof H=="function"&&H.apply(this,arguments)})}}return f}function d(f){c("ENQUEUE",f[0].name,f[1]),e[o].push(f),p()}var v;function E(){for(var f=Date.now(),h=0;h<e[o].length;++h)e[o][h].length>2&&(e[o][h][3]=f,e[o][h][4]=f);p()}function p(){if(clearTimeout(v),v=void 0,e[o].length!==0){var f=e[o].shift(),h=f[0],y=f[1],w=f[2],S=f[3],_=f[4];if(S===void 0)c("RETRY",h.name,y),h.apply(null,y);else if(Date.now()-S>=6e4){c("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>=$?(c("RETRY",h.name,y),h.apply(null,y.concat([S]))):e[o].push(f)}v===void 0&&(v=setTimeout(p,0))}}return Kr}var ed;function We(){return ed||(ed=1,function(e){const t=Ue().fromCallback,r=qr(),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(s=>typeof r[s]=="function");Object.assign(e,r),n.forEach(s=>{e[s]=t(r[s])}),e.exists=function(s,o){return typeof o=="function"?r.exists(s,o):new Promise(i=>r.exists(s,i))},e.read=function(s,o,i,l,u,c){return typeof c=="function"?r.read(s,o,i,l,u,c):new Promise((a,m)=>{r.read(s,o,i,l,u,(d,v,E)=>{if(d)return m(d);a({bytesRead:v,buffer:E})})})},e.write=function(s,o,...i){return typeof i[i.length-1]=="function"?r.write(s,o,...i):new Promise((l,u)=>{r.write(s,o,...i,(c,a,m)=>{if(c)return u(c);l({bytesWritten:a,buffer:m})})})},e.readv=function(s,o,...i){return typeof i[i.length-1]=="function"?r.readv(s,o,...i):new Promise((l,u)=>{r.readv(s,o,...i,(c,a,m)=>{if(c)return u(c);l({bytesRead:a,buffers:m})})})},e.writev=function(s,o,...i){return typeof i[i.length-1]=="function"?r.writev(s,o,...i):new Promise((l,u)=>{r.writev(s,o,...i,(c,a,m)=>{if(c)return u(c);l({bytesWritten:a,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")}(Ao)),Ao}var Yr={},ko={},td;function SE(){if(td)return ko;td=1;const e=T;return ko.checkPath=function(r){if(process.platform==="win32"&&/[<>:"|?*]/.test(r.replace(e.parse(r).root,""))){const s=new Error(`Path contains invalid characters: ${r}`);throw s.code="EINVAL",s}},ko}var rd;function bE(){if(rd)return Yr;rd=1;const e=We(),{checkPath:t}=SE(),r=n=>{const s={mode:511};return typeof n=="number"?n:{...s,...n}.mode};return Yr.makeDir=async(n,s)=>(t(n),e.mkdir(n,{mode:r(s),recursive:!0})),Yr.makeDirSync=(n,s)=>(t(n),e.mkdirSync(n,{mode:r(s),recursive:!0})),Yr}var qo,nd;function xt(){if(nd)return qo;nd=1;const e=Ue().fromPromise,{makeDir:t,makeDirSync:r}=bE(),n=e(t);return qo={mkdirs:n,mkdirsSync:r,mkdirp:n,mkdirpSync:r,ensureDir:n,ensureDirSync:r},qo}var Fo,id;function nr(){if(id)return Fo;id=1;const e=Ue().fromPromise,t=We();function r(n){return t.access(n).then(()=>!0).catch(()=>!1)}return Fo={pathExists:e(r),pathExistsSync:t.existsSync},Fo}var jo,sd;function Ch(){if(sd)return jo;sd=1;const e=We(),t=Ue().fromPromise;async function r(s,o,i){const l=await e.open(s,"r+");let u=null;try{await e.futimes(l,o,i)}finally{try{await e.close(l)}catch(c){u=c}}if(u)throw u}function n(s,o,i){const l=e.openSync(s,"r+");return e.futimesSync(l,o,i),e.closeSync(l)}return jo={utimesMillis:t(r),utimesMillisSync:n},jo}var Uo,od;function vr(){if(od)return Uo;od=1;const e=We(),t=T,r=Ue().fromPromise;function n(d,v,E){const p=E.dereference?f=>e.stat(f,{bigint:!0}):f=>e.lstat(f,{bigint:!0});return Promise.all([p(d),p(v).catch(f=>{if(f.code==="ENOENT")return null;throw f})]).then(([f,h])=>({srcStat:f,destStat:h}))}function s(d,v,E){let p;const f=E.dereference?y=>e.statSync(y,{bigint:!0}):y=>e.lstatSync(y,{bigint:!0}),h=f(d);try{p=f(v)}catch(y){if(y.code==="ENOENT")return{srcStat:h,destStat:null};throw y}return{srcStat:h,destStat:p}}async function o(d,v,E,p){const{srcStat:f,destStat:h}=await n(d,v,p);if(h){if(c(f,h)){const y=t.basename(d),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 '${d}'.`);if(!f.isDirectory()&&h.isDirectory())throw new Error(`Cannot overwrite directory '${v}' with non-directory '${d}'.`)}if(f.isDirectory()&&a(d,v))throw new Error(m(d,v,E));return{srcStat:f,destStat:h}}function i(d,v,E,p){const{srcStat:f,destStat:h}=s(d,v,p);if(h){if(c(f,h)){const y=t.basename(d),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 '${d}'.`);if(!f.isDirectory()&&h.isDirectory())throw new Error(`Cannot overwrite directory '${v}' with non-directory '${d}'.`)}if(f.isDirectory()&&a(d,v))throw new Error(m(d,v,E));return{srcStat:f,destStat:h}}async function l(d,v,E,p){const f=t.resolve(t.dirname(d)),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(c(v,y))throw new Error(m(d,E,p));return l(d,v,h,p)}function u(d,v,E,p){const f=t.resolve(t.dirname(d)),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(c(v,y))throw new Error(m(d,E,p));return u(d,v,h,p)}function c(d,v){return v.ino&&v.dev&&v.ino===d.ino&&v.dev===d.dev}function a(d,v){const E=t.resolve(d).split(t.sep).filter(f=>f),p=t.resolve(v).split(t.sep).filter(f=>f);return E.every((f,h)=>p[h]===f)}function m(d,v,E){return`Cannot ${E} '${d}' to a subdirectory of itself, '${v}'.`}return Uo={checkPaths:r(o),checkPathsSync:i,checkParentPaths:r(l),checkParentPathsSync:u,isSrcSubdir:a,areIdentical:c},Uo}var Mo,ad;function RE(){if(ad)return Mo;ad=1;const e=We(),t=T,{mkdirs:r}=xt(),{pathExists:n}=nr(),{utimesMillis:s}=Ch(),o=vr();async function i(p,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 o.checkPaths(p,f,"copy",h);if(await o.checkParentPaths(p,y,f,"copy"),!await l(p,f,h))return;const _=t.dirname(f);await n(_)||await r(_),await u(w,p,f,h)}async function l(p,f,h){return h.filter?h.filter(p,f):!0}async function u(p,f,h,y){const S=await(y.dereference?e.stat:e.lstat)(f);if(S.isDirectory())return v(S,p,f,h,y);if(S.isFile()||S.isCharacterDevice()||S.isBlockDevice())return c(S,p,f,h,y);if(S.isSymbolicLink())return E(p,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 c(p,f,h,y,w){if(!f)return a(p,h,y,w);if(w.overwrite)return await e.unlink(y),a(p,h,y,w);if(w.errorOnExist)throw new Error(`'${y}' already exists`)}async function a(p,f,h,y){if(await e.copyFile(f,h),y.preserveTimestamps){m(p.mode)&&await d(h,p.mode);const w=await e.stat(f);await s(h,w.atime,w.mtime)}return e.chmod(h,p.mode)}function m(p){return(p&128)===0}function d(p,f){return e.chmod(p,f|128)}async function v(p,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 o.checkPaths(b,g,"copy",w).then(({destStat:$})=>u($,b,g,w))}))}await Promise.all(S),f||await e.chmod(y,p.mode)}async function E(p,f,h,y){let w=await e.readlink(f);if(y.dereference&&(w=t.resolve(process.cwd(),w)),!p)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)),o.isSrcSubdir(w,S))throw new Error(`Cannot copy '${w}' to a subdirectory of itself, '${S}'.`);if(o.isSrcSubdir(S,w))throw new Error(`Cannot overwrite '${S}' with '${w}'.`);return await e.unlink(h),e.symlink(w,h)}return Mo=i,Mo}var Go,cd;function OE(){if(cd)return Go;cd=1;const e=qr(),t=T,r=xt().mkdirsSync,n=Ch().utimesMillisSync,s=vr();function o(_,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:$}=s.checkPathsSync(_,b,"copy",g);if(s.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 p(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,$):c(_,g,O,$)}function u(_,b,g,O){if(O.overwrite)return e.unlinkSync(g),c(_,b,g,O);if(O.errorOnExist)throw new Error(`'${g}' already exists`)}function c(_,b,g,O){return e.copyFileSync(b,g),O.preserveTimestamps&&a(_.mode,b,g),v(g,_.mode)}function a(_,b,g){return m(_)&&d(g,_),E(b,g)}function m(_){return(_&128)===0}function d(_,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 p(_,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}=s.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)),s.isSrcSubdir($,C))throw new Error(`Cannot copy '${$}' to a subdirectory of itself, '${C}'.`);if(s.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 Go=o,Go}var Vo,ud;function Xa(){if(ud)return Vo;ud=1;const e=Ue().fromPromise;return Vo={copy:e(RE()),copySync:OE()},Vo}var Bo,ld;function Dn(){if(ld)return Bo;ld=1;const e=qr(),t=Ue().fromCallback;function r(s,o){e.rm(s,{recursive:!0,force:!0},o)}function n(s){e.rmSync(s,{recursive:!0,force:!0})}return Bo={remove:t(r),removeSync:n},Bo}var Ho,fd;function $E(){if(fd)return Ho;fd=1;const e=Ue().fromPromise,t=We(),r=T,n=xt(),s=Dn(),o=e(async function(u){let c;try{c=await t.readdir(u)}catch{return n.mkdirs(u)}return Promise.all(c.map(a=>s.remove(r.join(u,a))))});function i(l){let u;try{u=t.readdirSync(l)}catch{return n.mkdirsSync(l)}u.forEach(c=>{c=r.join(l,c),s.removeSync(c)})}return Ho={emptyDirSync:i,emptydirSync:i,emptyDir:o,emptydir:o},Ho}var zo,dd;function IE(){if(dd)return zo;dd=1;const e=Ue().fromPromise,t=T,r=We(),n=xt();async function s(i){let l;try{l=await r.stat(i)}catch{}if(l&&l.isFile())return;const u=t.dirname(i);let c=null;try{c=await r.stat(u)}catch(a){if(a.code==="ENOENT"){await n.mkdirs(u),await r.writeFile(i,"");return}else throw a}c.isDirectory()?await r.writeFile(i,""):await r.readdir(u)}function o(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(c){if(c&&c.code==="ENOENT")n.mkdirsSync(u);else throw c}r.writeFileSync(i,"")}return zo={createFile:e(s),createFileSync:o},zo}var Wo,pd;function PE(){if(pd)return Wo;pd=1;const e=Ue().fromPromise,t=T,r=We(),n=xt(),{pathExists:s}=nr(),{areIdentical:o}=vr();async function i(u,c){let a;try{a=await r.lstat(c)}catch{}let m;try{m=await r.lstat(u)}catch(E){throw E.message=E.message.replace("lstat","ensureLink"),E}if(a&&o(m,a))return;const d=t.dirname(c);await s(d)||await n.mkdirs(d),await r.link(u,c)}function l(u,c){let a;try{a=r.lstatSync(c)}catch{}try{const v=r.lstatSync(u);if(a&&o(v,a))return}catch(v){throw v.message=v.message.replace("lstat","ensureLink"),v}const m=t.dirname(c);return r.existsSync(m)||n.mkdirsSync(m),r.linkSync(u,c)}return Wo={createLink:e(i),createLinkSync:l},Wo}var Xo,hd;function TE(){if(hd)return Xo;hd=1;const e=T,t=We(),{pathExists:r}=nr(),n=Ue().fromPromise;async function s(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),c=e.join(u,i);if(await r(c))return{toCwd:c,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 o(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),c=e.join(u,i);if(t.existsSync(c))return{toCwd:c,toDst:i};if(!t.existsSync(i))throw new Error("relative srcpath does not exist");return{toCwd:i,toDst:e.relative(u,i)}}return Xo={symlinkPaths:n(s),symlinkPathsSync:o},Xo}var Ko,md;function xE(){if(md)return Ko;md=1;const e=We(),t=Ue().fromPromise;async function r(s,o){if(o)return o;let i;try{i=await e.lstat(s)}catch{return"file"}return i&&i.isDirectory()?"dir":"file"}function n(s,o){if(o)return o;let i;try{i=e.lstatSync(s)}catch{return"file"}return i&&i.isDirectory()?"dir":"file"}return Ko={symlinkType:t(r),symlinkTypeSync:n},Ko}var Yo,yd;function CE(){if(yd)return Yo;yd=1;const e=Ue().fromPromise,t=T,r=We(),{mkdirs:n,mkdirsSync:s}=xt(),{symlinkPaths:o,symlinkPathsSync:i}=TE(),{symlinkType:l,symlinkTypeSync:u}=xE(),{pathExists:c}=nr(),{areIdentical:a}=vr();async function m(v,E,p){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(a(S,_))return}const h=await o(v,E);v=h.toDst;const y=await l(h.toCwd,p),w=t.dirname(E);return await c(w)||await n(w),r.symlink(v,E,y)}function d(v,E,p){let f;try{f=r.lstatSync(E)}catch{}if(f&&f.isSymbolicLink()){const S=r.statSync(v),_=r.statSync(E);if(a(S,_))return}const h=i(v,E);v=h.toDst,p=u(h.toCwd,p);const y=t.dirname(E);return r.existsSync(y)||s(y),r.symlinkSync(v,E,p)}return Yo={createSymlink:e(m),createSymlinkSync:d},Yo}var Jo,vd;function AE(){if(vd)return Jo;vd=1;const{createFile:e,createFileSync:t}=IE(),{createLink:r,createLinkSync:n}=PE(),{createSymlink:s,createSymlinkSync:o}=CE();return Jo={createFile:e,createFileSync:t,ensureFile:e,ensureFileSync:t,createLink:r,createLinkSync:n,ensureLink:r,ensureLinkSync:n,createSymlink:s,createSymlinkSync:o,ensureSymlink:s,ensureSymlinkSync:o},Jo}var Qo,wd;function Ka(){if(wd)return Qo;wd=1;function e(r,{EOL:n=`
|
||
`,finalEOL:s=!0,replacer:o=null,spaces:i}={}){const l=s?n:"";return JSON.stringify(r,o,i).replace(/\n/g,n)+l}function t(r){return Buffer.isBuffer(r)&&(r=r.toString("utf8")),r.replace(/^\uFEFF/,"")}return Qo={stringify:e,stripBom:t},Qo}var Zo,gd;function NE(){if(gd)return Zo;gd=1;let e;try{e=qr()}catch{e=ae}const t=Ue(),{stringify:r,stripBom:n}=Ka();async function s(m,d={}){typeof d=="string"&&(d={encoding:d});const v=d.fs||e,E="throws"in d?d.throws:!0;let p=await t.fromCallback(v.readFile)(m,d);p=n(p);let f;try{f=JSON.parse(p,d?d.reviver:null)}catch(h){if(E)throw h.message=`${m}: ${h.message}`,h;return null}return f}const o=t.fromPromise(s);function i(m,d={}){typeof d=="string"&&(d={encoding:d});const v=d.fs||e,E="throws"in d?d.throws:!0;try{let p=v.readFileSync(m,d);return p=n(p),JSON.parse(p,d.reviver)}catch(p){if(E)throw p.message=`${m}: ${p.message}`,p;return null}}async function l(m,d,v={}){const E=v.fs||e,p=r(d,v);await t.fromCallback(E.writeFile)(m,p,v)}const u=t.fromPromise(l);function c(m,d,v={}){const E=v.fs||e,p=r(d,v);return E.writeFileSync(m,p,v)}return Zo={readFile:o,readFileSync:i,writeFile:u,writeFileSync:c},Zo}var ea,_d;function LE(){if(_d)return ea;_d=1;const e=NE();return ea={readJson:e.readFile,readJsonSync:e.readFileSync,writeJson:e.writeFile,writeJsonSync:e.writeFileSync},ea}var ta,Ed;function Ya(){if(Ed)return ta;Ed=1;const e=Ue().fromPromise,t=We(),r=T,n=xt(),s=nr().pathExists;async function o(l,u,c="utf-8"){const a=r.dirname(l);return await s(a)||await n.mkdirs(a),t.writeFile(l,u,c)}function i(l,...u){const c=r.dirname(l);t.existsSync(c)||n.mkdirsSync(c),t.writeFileSync(l,...u)}return ta={outputFile:e(o),outputFileSync:i},ta}var ra,Sd;function DE(){if(Sd)return ra;Sd=1;const{stringify:e}=Ka(),{outputFile:t}=Ya();async function r(n,s,o={}){const i=e(s,o);await t(n,i,o)}return ra=r,ra}var na,bd;function kE(){if(bd)return na;bd=1;const{stringify:e}=Ka(),{outputFileSync:t}=Ya();function r(n,s,o){const i=e(s,o);t(n,i,o)}return na=r,na}var ia,Rd;function qE(){if(Rd)return ia;Rd=1;const e=Ue().fromPromise,t=LE();return t.outputJson=e(DE()),t.outputJsonSync=kE(),t.outputJSON=t.outputJson,t.outputJSONSync=t.outputJsonSync,t.writeJSON=t.writeJson,t.writeJSONSync=t.writeJsonSync,t.readJSON=t.readJson,t.readJSONSync=t.readJsonSync,ia=t,ia}var sa,Od;function FE(){if(Od)return sa;Od=1;const e=We(),t=T,{copy:r}=Xa(),{remove:n}=Dn(),{mkdirp:s}=xt(),{pathExists:o}=nr(),i=vr();async function l(a,m,d={}){const v=d.overwrite||d.clobber||!1,{srcStat:E,isChangingCase:p=!1}=await i.checkPaths(a,m,"move",d);await i.checkParentPaths(a,E,m,"move");const f=t.dirname(m);return t.parse(f).root!==f&&await s(f),u(a,m,v,p)}async function u(a,m,d,v){if(!v){if(d)await n(m);else if(await o(m))throw new Error("dest already exists.")}try{await e.rename(a,m)}catch(E){if(E.code!=="EXDEV")throw E;await c(a,m,d)}}async function c(a,m,d){return await r(a,m,{overwrite:d,errorOnExist:!0,preserveTimestamps:!0}),n(a)}return sa=l,sa}var oa,$d;function jE(){if($d)return oa;$d=1;const e=qr(),t=T,r=Xa().copySync,n=Dn().removeSync,s=xt().mkdirpSync,o=vr();function i(m,d,v){v=v||{};const E=v.overwrite||v.clobber||!1,{srcStat:p,isChangingCase:f=!1}=o.checkPathsSync(m,d,"move",v);return o.checkParentPathsSync(m,p,d,"move"),l(d)||s(t.dirname(d)),u(m,d,E,f)}function l(m){const d=t.dirname(m);return t.parse(d).root===d}function u(m,d,v,E){if(E)return c(m,d,v);if(v)return n(d),c(m,d,v);if(e.existsSync(d))throw new Error("dest already exists.");return c(m,d,v)}function c(m,d,v){try{e.renameSync(m,d)}catch(E){if(E.code!=="EXDEV")throw E;return a(m,d,v)}}function a(m,d,v){return r(m,d,{overwrite:v,errorOnExist:!0,preserveTimestamps:!0}),n(m)}return oa=i,oa}var aa,Id;function UE(){if(Id)return aa;Id=1;const e=Ue().fromPromise;return aa={move:e(FE()),moveSync:jE()},aa}var ca,Pd;function ME(){return Pd||(Pd=1,ca={...We(),...Xa(),...$E(),...AE(),...qE(),...xt(),...UE(),...Ya(),...nr(),...Dn()}),ca}var Ah=ME();let Lt;async function Nh(e){var i;if(process.platform!=="win32")return;if(typeof Lt=="string")return{binDir:Lt};const t=he.sync("choco",{nothrow:!0});if(t!==null)return Lt=T.dirname(t),{binDir:Lt};let r="powershell.exe";const n=he.sync(`${process.env.SystemRoot}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,{nothrow:!0});n!==null&&(r=n),Be(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 s=`${process.env.ALLUSERSPROFILE}\\chocolatey\\bin`;await Ie(s,ne);const o=he.sync("choco",{nothrow:!0});if(o!==null?Lt=T.dirname(o):Lt=`${(i=process.env.ChocolateyInstall)!=null?i:"C:/ProgramData/chocolatey"}/bin`,await me(Lt))return{binDir:Lt}}let Td=!1;async function De(e,t,r=[]){var i;W(`Installing ${e} ${t!=null?t:""} via chocolatey`),(!Td||he.sync("choco",{nothrow:!0})===null)&&(await Nh(),Td=!0);const n=process.env.PATH,s={...process.env};if(s.TMP=void 0,s.TEMP=void 0,s.Path=void 0,s.PATH=n,t!==void 0&&t!=="")Be("choco",["install","-y",e,`--version=${t}`,...r],{env:s,extendEnv:!1,stdio:"inherit"});else try{Be("choco",["install","-y",e,...r],{env:s,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 o=`${(i=process.env.ChocolateyInstall)!=null?i:"C:/ProgramData/chocolatey"}/bin`;return await Ie(o,ne),{binDir:o}}async function rn({version:e}={}){switch(process.platform){case"win32":return De("7zip",e);case"darwin":return He("p7zip",e);case"linux":{if(Pe())return _e("p7zip",e);if(xe())return Ce([{name:"p7zip",version:e},{name:"p7zip-plugins",version:e}]);if(ve())return fe([{name:"p7zip-full",version:e}]);if(await Oe())return Le([{name:"p7zip",version:e}]);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}var ce={},br={exports:{}},Jr={exports:{}},xd;function Lh(){return xd||(xd=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,s=Number.MAX_SAFE_INTEGER||9007199254740991,o=16,i=n-6,l=t.re=[],u=t.safeRe=[],c=t.src=[],a=t.tokens={},m=0;function d(R){a[R]=m++}var v="[a-zA-Z0-9-]",E=[["\\s",1],["\\d",n],[v,i]];function p(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}d("NUMERICIDENTIFIER"),c[a.NUMERICIDENTIFIER]="0|[1-9]\\d*",d("NUMERICIDENTIFIERLOOSE"),c[a.NUMERICIDENTIFIERLOOSE]="\\d+",d("NONNUMERICIDENTIFIER"),c[a.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-]"+v+"*",d("MAINVERSION"),c[a.MAINVERSION]="("+c[a.NUMERICIDENTIFIER]+")\\.("+c[a.NUMERICIDENTIFIER]+")\\.("+c[a.NUMERICIDENTIFIER]+")",d("MAINVERSIONLOOSE"),c[a.MAINVERSIONLOOSE]="("+c[a.NUMERICIDENTIFIERLOOSE]+")\\.("+c[a.NUMERICIDENTIFIERLOOSE]+")\\.("+c[a.NUMERICIDENTIFIERLOOSE]+")",d("PRERELEASEIDENTIFIER"),c[a.PRERELEASEIDENTIFIER]="(?:"+c[a.NUMERICIDENTIFIER]+"|"+c[a.NONNUMERICIDENTIFIER]+")",d("PRERELEASEIDENTIFIERLOOSE"),c[a.PRERELEASEIDENTIFIERLOOSE]="(?:"+c[a.NUMERICIDENTIFIERLOOSE]+"|"+c[a.NONNUMERICIDENTIFIER]+")",d("PRERELEASE"),c[a.PRERELEASE]="(?:-("+c[a.PRERELEASEIDENTIFIER]+"(?:\\."+c[a.PRERELEASEIDENTIFIER]+")*))",d("PRERELEASELOOSE"),c[a.PRERELEASELOOSE]="(?:-?("+c[a.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+c[a.PRERELEASEIDENTIFIERLOOSE]+")*))",d("BUILDIDENTIFIER"),c[a.BUILDIDENTIFIER]=v+"+",d("BUILD"),c[a.BUILD]="(?:\\+("+c[a.BUILDIDENTIFIER]+"(?:\\."+c[a.BUILDIDENTIFIER]+")*))",d("FULL"),d("FULLPLAIN"),c[a.FULLPLAIN]="v?"+c[a.MAINVERSION]+c[a.PRERELEASE]+"?"+c[a.BUILD]+"?",c[a.FULL]="^"+c[a.FULLPLAIN]+"$",d("LOOSEPLAIN"),c[a.LOOSEPLAIN]="[v=\\s]*"+c[a.MAINVERSIONLOOSE]+c[a.PRERELEASELOOSE]+"?"+c[a.BUILD]+"?",d("LOOSE"),c[a.LOOSE]="^"+c[a.LOOSEPLAIN]+"$",d("GTLT"),c[a.GTLT]="((?:<|>)?=?)",d("XRANGEIDENTIFIERLOOSE"),c[a.XRANGEIDENTIFIERLOOSE]=c[a.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",d("XRANGEIDENTIFIER"),c[a.XRANGEIDENTIFIER]=c[a.NUMERICIDENTIFIER]+"|x|X|\\*",d("XRANGEPLAIN"),c[a.XRANGEPLAIN]="[v=\\s]*("+c[a.XRANGEIDENTIFIER]+")(?:\\.("+c[a.XRANGEIDENTIFIER]+")(?:\\.("+c[a.XRANGEIDENTIFIER]+")(?:"+c[a.PRERELEASE]+")?"+c[a.BUILD]+"?)?)?",d("XRANGEPLAINLOOSE"),c[a.XRANGEPLAINLOOSE]="[v=\\s]*("+c[a.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+c[a.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+c[a.XRANGEIDENTIFIERLOOSE]+")(?:"+c[a.PRERELEASELOOSE]+")?"+c[a.BUILD]+"?)?)?",d("XRANGE"),c[a.XRANGE]="^"+c[a.GTLT]+"\\s*"+c[a.XRANGEPLAIN]+"$",d("XRANGELOOSE"),c[a.XRANGELOOSE]="^"+c[a.GTLT]+"\\s*"+c[a.XRANGEPLAINLOOSE]+"$",d("COERCE"),c[a.COERCE]="(^|[^\\d])(\\d{1,"+o+"})(?:\\.(\\d{1,"+o+"}))?(?:\\.(\\d{1,"+o+"}))?(?:$|[^\\d])",d("COERCERTL"),l[a.COERCERTL]=new RegExp(c[a.COERCE],"g"),u[a.COERCERTL]=new RegExp(p(c[a.COERCE]),"g"),d("LONETILDE"),c[a.LONETILDE]="(?:~>?)",d("TILDETRIM"),c[a.TILDETRIM]="(\\s*)"+c[a.LONETILDE]+"\\s+",l[a.TILDETRIM]=new RegExp(c[a.TILDETRIM],"g"),u[a.TILDETRIM]=new RegExp(p(c[a.TILDETRIM]),"g");var f="$1~";d("TILDE"),c[a.TILDE]="^"+c[a.LONETILDE]+c[a.XRANGEPLAIN]+"$",d("TILDELOOSE"),c[a.TILDELOOSE]="^"+c[a.LONETILDE]+c[a.XRANGEPLAINLOOSE]+"$",d("LONECARET"),c[a.LONECARET]="(?:\\^)",d("CARETTRIM"),c[a.CARETTRIM]="(\\s*)"+c[a.LONECARET]+"\\s+",l[a.CARETTRIM]=new RegExp(c[a.CARETTRIM],"g"),u[a.CARETTRIM]=new RegExp(p(c[a.CARETTRIM]),"g");var h="$1^";d("CARET"),c[a.CARET]="^"+c[a.LONECARET]+c[a.XRANGEPLAIN]+"$",d("CARETLOOSE"),c[a.CARETLOOSE]="^"+c[a.LONECARET]+c[a.XRANGEPLAINLOOSE]+"$",d("COMPARATORLOOSE"),c[a.COMPARATORLOOSE]="^"+c[a.GTLT]+"\\s*("+c[a.LOOSEPLAIN]+")$|^$",d("COMPARATOR"),c[a.COMPARATOR]="^"+c[a.GTLT]+"\\s*("+c[a.FULLPLAIN]+")$|^$",d("COMPARATORTRIM"),c[a.COMPARATORTRIM]="(\\s*)"+c[a.GTLT]+"\\s*("+c[a.LOOSEPLAIN]+"|"+c[a.XRANGEPLAIN]+")",l[a.COMPARATORTRIM]=new RegExp(c[a.COMPARATORTRIM],"g"),u[a.COMPARATORTRIM]=new RegExp(p(c[a.COMPARATORTRIM]),"g");var y="$1$2$3";d("HYPHENRANGE"),c[a.HYPHENRANGE]="^\\s*("+c[a.XRANGEPLAIN]+")\\s+-\\s+("+c[a.XRANGEPLAIN]+")\\s*$",d("HYPHENRANGELOOSE"),c[a.HYPHENRANGELOOSE]="^\\s*("+c[a.XRANGEPLAINLOOSE]+")\\s+-\\s+("+c[a.XRANGEPLAINLOOSE]+")\\s*$",d("STAR"),c[a.STAR]="(<|>)?=?\\s*\\*";for(var w=0;w<m;w++)r(w,c[w]),l[w]||(l[w]=new RegExp(c[w]),u[w]=new RegExp(p(c[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[a.LOOSE]:u[a.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[a.LOOSE]:u[a.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>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||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<s)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=z;function z(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=se;function se(R,I,P){return F(R,I,P)<=0}t.cmp=ge;function ge(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 se(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[a.COMPARATORLOOSE]:u[a.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 ge(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),Fr(this.value,P,I));if(R.operator==="")return R.value===""?!0:(P=new L(this.value,I),Fr(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==="<="),de=ge(this.semver,"<",R.semver,I)&&(this.operator===">="||this.operator===">")&&(R.operator==="<="||R.operator==="<"),oe=ge(this.semver,">",R.semver,I)&&(this.operator==="<="||this.operator==="<")&&(R.operator===">="||R.operator===">");return j||B||Z&&te||de||oe},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[a.HYPHENRANGELOOSE]:u[a.HYPHENRANGE];R=R.replace(P,fm),r("hyphen replace",R),R=R.replace(u[a.COMPARATORTRIM],y),r("comparator trim",R,u[a.COMPARATORTRIM]),R=R.replace(u[a.TILDETRIM],f),R=R.replace(u[a.CARETTRIM],h),R=R.split(/\s+/).join(" ");var j=I?u[a.COMPARATORLOOSE]:u[a.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=H;function H(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=Ct(R,I),r("xrange",R),R=lm(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 Ae(P,I)}).join(" ")}function Ae(R,I){var P=I.loose?u[a.TILDELOOSE]:u[a.TILDE];return R.replace(P,function(j,B,Z,te,de){r("tilde",R,j,B,Z,te,de);var oe;return J(B)?oe="":J(Z)?oe=">="+B+".0.0 <"+(+B+1)+".0.0":J(te)?oe=">="+B+"."+Z+".0 <"+B+"."+(+Z+1)+".0":de?(r("replaceTilde pr",de),oe=">="+B+"."+Z+"."+te+"-"+de+" <"+B+"."+(+Z+1)+".0"):oe=">="+B+"."+Z+"."+te+" <"+B+"."+(+Z+1)+".0",r("tilde return",oe),oe})}function Xe(R,I){return R.trim().split(/\s+/).map(function(P){return Ne(P,I)}).join(" ")}function Ne(R,I){r("caret",R,I);var P=I.loose?u[a.CARETLOOSE]:u[a.CARET];return R.replace(P,function(j,B,Z,te,de){r("caret",R,j,B,Z,te,de);var oe;return J(B)?oe="":J(Z)?oe=">="+B+".0.0 <"+(+B+1)+".0.0":J(te)?B==="0"?oe=">="+B+"."+Z+".0 <"+B+"."+(+Z+1)+".0":oe=">="+B+"."+Z+".0 <"+(+B+1)+".0.0":de?(r("replaceCaret pr",de),B==="0"?Z==="0"?oe=">="+B+"."+Z+"."+te+"-"+de+" <"+B+"."+Z+"."+(+te+1):oe=">="+B+"."+Z+"."+te+"-"+de+" <"+B+"."+(+Z+1)+".0":oe=">="+B+"."+Z+"."+te+"-"+de+" <"+(+B+1)+".0.0"):(r("no pr"),B==="0"?Z==="0"?oe=">="+B+"."+Z+"."+te+" <"+B+"."+Z+"."+(+te+1):oe=">="+B+"."+Z+"."+te+" <"+B+"."+(+Z+1)+".0":oe=">="+B+"."+Z+"."+te+" <"+(+B+1)+".0.0"),r("caret return",oe),oe})}function Ct(R,I){return r("replaceXRanges",R,I),R.split(/\s+/).map(function(P){return um(P,I)}).join(" ")}function um(R,I){R=R.trim();var P=I.loose?u[a.XRANGELOOSE]:u[a.XRANGE];return R.replace(P,function(j,B,Z,te,de,oe){r("xRange",R,j,B,Z,te,de,oe);var _t=J(Z),Et=_t||J(te),nt=Et||J(de),Ke=nt;return B==="="&&Ke&&(B=""),oe=I.includePrerelease?"-0":"",_t?B===">"||B==="<"?j="<0.0.0-0":j="*":B&&Ke?(Et&&(te=0),de=0,B===">"?(B=">=",Et?(Z=+Z+1,te=0,de=0):(te=+te+1,de=0)):B==="<="&&(B="<",Et?Z=+Z+1:te=+te+1),j=B+Z+"."+te+"."+de+oe):Et?j=">="+Z+".0.0"+oe+" <"+(+Z+1)+".0.0"+oe:nt&&(j=">="+Z+"."+te+".0"+oe+" <"+Z+"."+(+te+1)+".0"+oe),r("xRange return",j),j})}function lm(R,I){return r("replaceStars",R,I),R.trim().replace(u[a.STAR],"")}function fm(R,I,P,j,B,Z,te,de,oe,_t,Et,nt,Ke){return J(P)?I="":J(j)?I=">="+P+".0.0":J(B)?I=">="+P+"."+j+".0":I=">="+I,J(oe)?de="":J(_t)?de="<"+(+oe+1)+".0.0":J(Et)?de="<"+oe+"."+(+_t+1)+".0":nt?de="<="+oe+"."+_t+"."+Et+"-"+nt:de="<="+de,(I+" "+de).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(dm(this.set[I],R,this.options))return!0;return!1};function dm(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=Fr;function Fr(R,I,P){try{I=new L(I,P)}catch{return!1}return I.test(R)}t.maxSatisfying=pm;function pm(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=hm;function hm(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=mm;function mm(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=ym;function ym(R,I){try{return new L(R,I).range||"*"}catch{return null}}t.ltr=vm;function vm(R,I,P){return qn(R,I,"<",P)}t.gtr=wm;function wm(R,I,P){return qn(R,I,">",P)}t.outside=qn;function qn(R,I,P,j){R=new g(R,j),I=new L(I,j);var B,Z,te,de,oe;switch(P){case">":B=X,Z=se,te=re,de=">",oe=">=";break;case"<":B=re,Z=ie,te=X,de="<",oe="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Fr(R,I,j))return!1;for(var _t=0;_t<I.set.length;++_t){var Et=I.set[_t],nt=null,Ke=null;if(Et.forEach(function(Nt){Nt.semver===D&&(Nt=new k(">=0.0.0")),nt=nt||Nt,Ke=Ke||Nt,B(Nt.semver,nt.semver,j)?nt=Nt:te(Nt.semver,Ke.semver,j)&&(Ke=Nt)}),nt.operator===de||nt.operator===oe||(!Ke.operator||Ke.operator===de)&&Z(R,Ke.semver))return!1;if(Ke.operator===oe&&te(R,Ke.semver))return!1}return!0}t.prerelease=gm;function gm(R,I){var P=S(R,I);return P&&P.prerelease.length?P.prerelease:null}t.intersects=_m;function _m(R,I,P){return R=new L(R,P),I=new L(I,P),R.intersects(I)}t.coerce=Em;function Em(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[a.COERCE]);else{for(var j;(j=u[a.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[a.COERCERTL].lastIndex=j.index+j[1].length+j[2].length;u[a.COERCERTL].lastIndex=-1}return P===null?null:S(P[2]+"."+(P[3]||"0")+"."+(P[4]||"0"),I)}}(Jr,Jr.exports)),Jr.exports}var Dt=br.exports,Cd;function GE(){return Cd||(Cd=1,function(e,t){var r=Dt&&Dt.__createBinding||(Object.create?function(E,p,f,h){h===void 0&&(h=f);var y=Object.getOwnPropertyDescriptor(p,f);(!y||("get"in y?!p.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return p[f]}}),Object.defineProperty(E,h,y)}:function(E,p,f,h){h===void 0&&(h=f),E[h]=p[f]}),n=Dt&&Dt.__setModuleDefault||(Object.create?function(E,p){Object.defineProperty(E,"default",{enumerable:!0,value:p})}:function(E,p){E.default=p}),s=Dt&&Dt.__importStar||function(E){if(E&&E.__esModule)return E;var p={};if(E!=null)for(var f in E)f!=="default"&&Object.prototype.hasOwnProperty.call(E,f)&&r(p,E,f);return n(p,E),p},o=Dt&&Dt.__awaiter||function(E,p,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,p||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t._readLinuxVersionFile=t._getOsVersion=t._findMatch=void 0;const i=s(Lh()),l=fr(),u=pe,c=At,a=ae;function m(E,p,f,h){return o(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)&&(!p||b.stable===p)&&(_=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 d(){const E=u.platform();let p="";if(E==="darwin")p=c.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")){p=w[1].trim().replace(/^"/,"").replace(/"$/,"");break}}}}return p}t._getOsVersion=d;function v(){const E="/etc/lsb-release",p="/etc/os-release";let f="";return a.existsSync(E)?f=a.readFileSync(E).toString():a.existsSync(p)&&(f=a.readFileSync(p).toString()),f}t._readLinuxVersionFile=v}(br,br.exports)),br.exports}var Ze={},Ad;function VE(){if(Ad)return Ze;Ad=1;var e=Ze&&Ze.__createBinding||(Object.create?function(i,l,u,c){c===void 0&&(c=u);var a=Object.getOwnPropertyDescriptor(l,u);(!a||("get"in a?!l.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return l[u]}}),Object.defineProperty(i,c,a)}:function(i,l,u,c){c===void 0&&(c=u),i[c]=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,c){function a(m){return m instanceof u?m:new u(function(d){d(m)})}return new(u||(u=Promise))(function(m,d){function v(f){try{p(c.next(f))}catch(h){d(h)}}function E(f){try{p(c.throw(f))}catch(h){d(h)}}function p(f){f.done?m(f.value):a(f.value).then(v,E)}p((c=c.apply(i,l||[])).next())})};Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.RetryHelper=void 0;const s=r(fr());class o{constructor(l,u,c){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(c),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 c=1;for(;c<this.maxAttempts;){try{return yield l()}catch(m){if(u&&!u(m))throw m;s.info(m.message)}const a=this.getSleepAmount();s.info(`Waiting ${a} seconds before trying again`),yield this.sleep(a),c++}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=o,Ze}var Nd;function BE(){if(Nd)return ce;Nd=1;var e=ce&&ce.__createBinding||(Object.create?function(k,D,L,M){M===void 0&&(M=L);var H=Object.getOwnPropertyDescriptor(D,L);(!H||("get"in H?!D.__esModule:H.writable||H.configurable))&&(H={enumerable:!0,get:function(){return D[L]}}),Object.defineProperty(k,M,H)}: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 H(ee){return ee instanceof L?ee:new L(function(J){J(ee)})}return new(L||(L=Promise))(function(ee,J){function qe(Ne){try{Xe(M.next(Ne))}catch(Ct){J(Ct)}}function Ae(Ne){try{Xe(M.throw(Ne))}catch(Ct){J(Ct)}}function Xe(Ne){Ne.done?ee(Ne.value):H(Ne.value).then(qe,Ae)}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 s=r(fr()),o=r(wp()),i=r(xa),l=r(ae),u=r(GE()),c=r(pe),a=r(T),m=r(yp),d=r(Lh()),v=r(Cr),E=r(ur),p=xr,f=Ca(),h=VE();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||a.join(ie(),i.randomUUID()),yield o.mkdirP(a.dirname(D)),s.debug(`Downloading ${k}`),s.debug(`Destination ${D}`);const H=3,ee=se("TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS",10),J=se("TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS",20);return yield new h.RetryHelper(H,ee,J).execute(()=>n(this,void 0,void 0,function*(){return yield g(k,D||"",L,M)}),Ae=>!(Ae instanceof y&&Ae.httpStatusCode&&Ae.httpStatusCode<500&&Ae.httpStatusCode!==408&&Ae.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 H=new m.HttpClient(_,[],{allowRetries:!1});L&&(s.debug("set auth"),M===void 0&&(M={}),M.authorization=L);const ee=yield H.get(k,M);if(ee.message.statusCode!==200){const Ne=new y(ee.message.statusCode);throw s.debug(`Failed to download from "${k}". Code(${ee.message.statusCode}) Message(${ee.message.statusMessage})`),Ne}const J=E.promisify(v.pipeline),Ae=se("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY",()=>ee.message)();let Xe=!1;try{return yield J(Ae,l.createWriteStream(D)),s.debug("download complete"),Xe=!0,D}finally{if(!Xe){s.debug("download failed");try{yield o.rmRF(D)}catch(Ne){s.debug(`Failed to delete '${D}'. ${Ne.message}`)}}}})}function O(k,D,L){return n(this,void 0,void 0,function*(){(0,p.ok)(w,"extract7z() not supported on current OS"),(0,p.ok)(k,'parameter "file" is required'),D=yield N(D);const M=process.cwd();if(process.chdir(D),L)try{const ee=["x",s.isDebug()?"-bb1":"-bb0","-bd","-sccUTF-8",k],J={silent:!0};yield(0,f.exec)(`"${L}"`,ee,J)}finally{process.chdir(M)}else{const H=a.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,""),Ae=["-NoLogo","-Sta","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",`& '${H}' -Source '${ee}' -Target '${J}'`],Xe={silent:!0};try{const Ne=yield o.which("powershell",!0);yield(0,f.exec)(`"${Ne}"`,Ae,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),s.debug("Checking tar --version");let M="";yield(0,f.exec)("tar --version",[],{ignoreReturnCode:!0,silent:!0,listeners:{stdout:Ae=>M+=Ae.toString(),stderr:Ae=>M+=Ae.toString()}}),s.debug(M.trim());const H=M.toUpperCase().includes("GNU TAR");let ee;L instanceof Array?ee=L:ee=[L],s.isDebug()&&!L.includes("v")&&ee.push("-v");let J=D,qe=k;return w&&H&&(ee.push("--force-local"),J=D.replace(/\\/g,"/"),qe=k.replace(/\\/g,"/")),H&&(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,p.ok)(S,"extractXar() not supported on current OS"),(0,p.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),s.isDebug()&&M.push("-v");const H=yield o.which("xar",!0);return yield(0,f.exec)(`"${H}"`,ge(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,""),H=yield o.which("pwsh",!1);if(H){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(" ")];s.debug(`Using pwsh at path: ${H}`),yield(0,f.exec)(`"${H}"`,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 o.which("powershell",!0);s.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 o.which("unzip",!0),M=[k];s.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=d.clean(L)||L,M=M||c.arch(),s.debug(`Caching tool ${D} ${L} ${M}`),s.debug(`source dir: ${k}`),!l.statSync(k).isDirectory())throw new Error("sourceDir is not a directory");const H=yield z(D,L,M);for(const ee of l.readdirSync(k)){const J=a.join(k,ee);yield o.cp(J,H,{recursive:!0})}return X(D,L,M),H})}ce.cacheDir=A;function x(k,D,L,M,H){return n(this,void 0,void 0,function*(){if(M=d.clean(M)||M,H=H||c.arch(),s.debug(`Caching tool ${L} ${M} ${H}`),s.debug(`source file: ${k}`),!l.statSync(k).isFile())throw new Error("sourceFile is not a file");const ee=yield z(L,M,H),J=a.join(ee,D);return s.debug(`destination file ${J}`),yield o.cp(k,J),X(L,M,H),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||c.arch(),!re(D)){const H=U(k,L);D=ue(H,D)}let M="";if(D){D=d.clean(D)||"";const H=a.join(K(),k,D,L);s.debug(`checking cache: ${H}`),l.existsSync(H)&&l.existsSync(`${H}.complete`)?(s.debug(`Found tool in cache ${k} ${D} ${L}`),M=H):s.debug("not found")}return M}ce.find=F;function U(k,D){const L=[];D=D||c.arch();const M=a.join(K(),k);if(l.existsSync(M)){const H=l.readdirSync(M);for(const ee of H)if(re(ee)){const J=a.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 H=[];const ee=`https://api.github.com/repos/${k}/${D}/git/trees/${M}`,J=new m.HttpClient("tool-cache"),qe={};L&&(s.debug("set auth"),qe.authorization=L);const Ae=yield J.getJson(ee,qe);if(!Ae.result)return H;let Xe="";for(const Ct of Ae.result.tree)if(Ct.path==="versions-manifest.json"){Xe=Ct.url;break}qe.accept="application/vnd.github.VERSION.raw";let Ne=yield(yield J.get(Xe,qe)).readBody();if(Ne){Ne=Ne.replace(/^\uFEFF/,"");try{H=JSON.parse(Ne)}catch{s.debug("Invalid json")}}return H})}ce.getManifestFromRepo=q;function V(k,D,L,M=c.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=a.join(ie(),i.randomUUID())),yield o.mkdirP(k),k})}function z(k,D,L){return n(this,void 0,void 0,function*(){const M=a.join(K(),k,d.clean(D)||D,L||"");s.debug(`destination ${M}`);const H=`${M}.complete`;return yield o.rmRF(M),yield o.rmRF(H),yield o.mkdirP(M),M})}function X(k,D,L){const H=`${a.join(K(),k,d.clean(D)||D,L||"")}.complete`;l.writeFileSync(H,""),s.debug("finished caching tool")}function re(k){const D=d.clean(k)||"";s.debug(`isExplicit: ${D}`);const L=d.valid(D)!=null;return s.debug(`explicit? ${L}`),L}ce.isExplicitVersion=re;function ue(k,D){let L="";s.debug(`evaluating ${k.length} versions`),k=k.sort((M,H)=>d.gt(M,H)?1:-1);for(let M=k.length-1;M>=0;M--){const H=k[M];if(d.satisfies(H,D)){L=H;break}}return L?s.debug(`matched: ${L}`):s.debug("match not found"),L}ce.evaluateVersions=ue;function K(){const k=process.env.RUNNER_TOOL_CACHE||"";return(0,p.ok)(k,"Expected RUNNER_TOOL_CACHE to be defined"),k}function ie(){const k=process.env.RUNNER_TEMP||"";return(0,p.ok)(k,"Expected RUNNER_TEMP to be defined"),k}function se(k,D){const L=et[k];return L!==void 0?L:D}function ge(k){return Array.from(new Set(k))}return ce}var kn=BE();function Ja(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"||Se(`Unknown archive type: ${t}. Defaulting to 7z`),4)}function Dh(e){switch(e){case 0:case 1:return vn;case 2:return vn;case 3:return zE;default:return yn}}let ua;async function yn(e,t){const r=T.basename(e);if(/.*\.tar\..+$/.test(r)){const n=T.dirname(e);await la(e,n);const s=r.slice(0,-3),o=T.join(n,s);await la(o,n),await Np(o);const i=s.slice(0,-4),l=T.join(n,i);W(`Moving ${l} to ${t}`),await Ah.move(l,t,{overwrite:!0})}else await la(e,t);return t}async function la(e,t){W(`7z: extracting ${e} to ${t}`),await le(await HE(),["x",e,`-o${t}`,"-y"],{stdio:"inherit"}),await hr(t)}async function HE(){return ua===void 0&&(he.sync("7z",{nothrow:!0})===null&&await rn({version:""}),ua="7z"),ua}async function zE(e,t){return he.sync("7z",{nothrow:!0})!==null?yn(e,t):he.sync("unzip",{nothrow:!0})!==null?(await le("unzip",["-q",e,"-d",t],{stdio:"inherit"}),await hr(t),t):yn(e,t)}async function vn(e,t,r=0,n=[]){await WE(Ja(e));try{await Ah.mkdirp(t)}catch{}try{await le("tar",["xf",e,"-C",t,`--strip-components=${r}`,...n],{stdio:"inherit"})}catch(s){process.platform==="win32"&&s.message.includes("Can't create '\\\\?\\C:")&&Se(`Failed to extract symlink ${e} to ${t}. Ignoring this symlink.`)}return await hr(t),t}async function WE(e){switch(W("Installing tar extraction dependencies"),e){case 1:{process.platform==="linux"&&(Pe()?(await _e("gzip"),await _e("tar")):xe()?await Ce([{name:"gzip"},{name:"tar"}]):ve()?await fe([{name:"gzip"},{name:"tar"}]):await Oe()&&await Le([{name:"gzip"},{name:"tar"}]));break}case 2:{process.platform==="linux"&&(Pe()?(await _e("xz"),await _e("tar")):xe()?await Ce([{name:"xz"},{name:"tar"}]):ve()?await fe([{name:"xz-utils"},{name:"tar"}]):await Oe()&&await Le([{name:"xz"},{name:"tar"}]));break}default:throw new Error(`Unsupported archive type: ${e} for tar extraction`)}}var Rt={},Ld;function XE(){if(Ld)return Rt;Ld=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.retryAsPromised=Rt.applyJitter=Rt.TimeoutError=void 0;class e extends Error{constructor(o,i){super(o),this.name="TimeoutError",this.previous=i}}Rt.TimeoutError=e;function t(s,o){if(typeof s=="function")try{if(o instanceof s)return!0}catch{return!!s(o)}return s===o.toString()||s===o.message?!0:s instanceof RegExp&&(s.test(o.message)||s.test(o.toString()))}function r(s,o){const i=s+Math.random()*o*(Math.random()>.5?1:-1);return Math.max(0,i)}Rt.applyJitter=r;function n(s,o){if(!s||!o)throw new Error("retry-as-promised must be passed a callback and a options set");o=typeof o=="number"?{max:o}:o;const i={$current:"$current"in o?o.$current:1,max:o.max,timeout:o.timeout||void 0,match:o.match?Array.isArray(o.match)?o.match:[o.match]:[],backoffBase:o.backoffBase===void 0?100:o.backoffBase,backoffExponent:o.backoffExponent||1.1,backoffJitter:o.backoffJitter||0,report:o.report,name:o.name||s.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 c,a,m;i.timeout&&(c=setTimeout(function(){a&&clearTimeout(a),u(new e(i.name+" timed out",m))},i.timeout)),Promise.resolve(s({current:i.$current})).then(l).then(function(){c&&clearTimeout(c),a&&clearTimeout(a)}).catch(function(d){c&&clearTimeout(c),a&&clearTimeout(a),m=d,i.report&&i.report(d&&d.toString()||d,i,d);var v=i.$current<i.max;if(!v||(v=i.match.length===0||i.match.some(function(f){return t(f,d)}),!v))return u(d);var E=i.backoffBase*Math.pow(i.backoffExponent,i.$current-1);const p=i.backoffJitter;p!==void 0&&(E=r(E,p)),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),a=setTimeout(function(){n(s,i).then(l).catch(u)},E)):n(s,i).then(l).catch(u)})})}return Rt.retryAsPromised=n,Rt.default=n,Rt}var KE=XE();const kh=$e(KE),{GITHUB_ACTIONS:qh}=gt;async function Pt(e,t,r,n,s){var v,E;W(`Installing ${e} ${t} ${s} via direct downloading`),process.env.RUNNER_TEMP=(v=process.env.RUNNER_TEMP)!=null?v:pe.tmpdir(),process.env.RUNNER_TOOL_CACHE=(E=process.env.RUNNER_TOOL_CACHE)!=null?E:T.join(pe.tmpdir(),"setup-cpp","hostedtoolcache");const{url:o,binRelativeDir:i,binFileName:l,extractedFolderName:u,extractFunction:c}=await r(t,process.platform,s);if(qh)try{const p=kn.find(e,t);if(p){const f=T.join(p,u),h=T.join(f,i);if(await me(T.join(h,l)))return W(`${e} ${t} was found in the cache at ${h}.`),await Ie(h,ne),{installDir:f,binDir:h}}}catch{}const a=T.join(n,u),m=T.join(a,i),d=T.join(m,l);return await YE(m,d,e,t,o,n,c,s),await QE(n,e,t),{installDir:a,binDir:m}}async function YE(e,t,r,n,s,o,i,l){if((await Promise.all([me(e),me(t)])).includes(!1))try{const u=await JE(r,n,s);W(`Extracting ${u} to ${o}`),await(i!=null?i:Dh(Ja(s)))(u,o)}catch(u){throw new Error(`Failed to download ${r} ${n} ${l} from ${s}: ${u}`)}if(W(`Add ${e} to PATH`),await Ie(e,ne),!await me(t))throw new Error(`Failed to find the binary ${t} after extracting ${r} ${n} ${l}`);if(process.platform!=="win32")try{await Na(t,"755")}catch(u){Se(`Failed to make ${t} executable: ${u}`)}}async function JE(e,t,r){return W(`Download ${e} ${t}`),await kh(()=>{var o;const s=T.join((o=process.env.RUNNER_TEMP)!=null?o:pe.tmpdir(),`${Date.now()}-${T.basename(r)}`);return kn.downloadTool(r,s)},{name:r,max:4,backoffBase:2e3,report:s=>W(s)})}async function QE(e,t,r){qh&&typeof process.env.RUNNER_TOOL_CACHE=="string"&&(gp("cache-tools")==="true"||process.env.CACHE_TOOLS==="true")&&await kn.cacheDir(e,t,r)}const{GITHUB_ACTIONS:ZE}=gt,eS=typeof __dirname=="string"?__dirname:T.dirname(ct.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:we&&we.tagName.toUpperCase()==="SCRIPT"&&we.src||new URL("setup-cpp.js",document.baseURI).href));async function Qa({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 Pt("g++",e,rS,t,r)}catch(s){W(`Failed to download g++ binary. ${s}. Falling back to chocolatey.`),n=await tS(e,r)}break}case"linux":{if(Pe())n=await _e("mingw-w64-gcc",e);else if(xe())n=await Ce([{name:"mingw64-gcc",version:e}]);else if(ve())n=await fe([{name:"mingw-w64",version:e}]);else if(await Oe())await fh(),n=await Le([{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 nS(n.binDir),n}async function tS(e,t){var n,s;await De("mingw",e);let r;if(t==="x64"&&await me("C:/tools/mingw64/bin")?(r="C:/tools/mingw64/bin",await Ie(r,ne)):t==="ia32"&&await me("C:/tools/mingw32/bin")?(r="C:/tools/mingw32/bin",await Ie(r,ne)):await me(`${(n=process.env.ChocolateyInstall)!=null?n:"C:/ProgramData/chocolatey"}/bin/g++.exe`)&&(r=`${(s=process.env.ChocolateyInstall)!=null?s:"C:/ProgramData/chocolatey"}/bin`),r!==void 0)return{binDir:r}}async function rS(e,t,r){var c;if(t!=="win32")throw new Error(`Unsupported platform '${t}'`);const n=await hn(T.join(eS,"github_brechtsanders_winlibs_mingw.json")),s={x64:"x86_64",ia32:"i386"},o=fa(e),i=da(e),l=Dd(e),u=mn(n,{version:e,keywords:[(c=s[r])!=null?c:r],filterName:a=>(o===void 0||o===fa(a))&&(i===void 0||i===da(a))&&(l===void 0||l===Dd(a)),versionSatisfies:(a,m)=>{const d=Jt(a);if(d===null)throw new Error(`Invalid MinGW asset version: '${a}'`);return Wa(d,m)&&(o===void 0||o===fa(a))&&(i===void 0||i===da(a))}});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:yn,url:`https://github.com/brechtsanders/winlibs_mingw/releases/download/${u.tag}/${u.name}`}}function fa(e){const t=e.match(/(ucrt|msvcrt)/);return t!==null?t[1]:void 0}function da(e){const t=e.match(/(posix|mcf)/);return t!==null?t[1]:void 0}function Dd(e){const t=e.match(/(seh|dwarf)/);return t!==null?t[1]:void 0}async function nS(e){const t=[];process.platform==="win32"&&t.push(Te("CC",Ee(`${e}/gcc`),ne),Te("CXX",Ee(`${e}/g++`),ne)),ZE&&await xh(),await Promise.all(t)}const{GITHUB_ACTIONS:iS}=gt,sS=typeof __dirname=="string"?__dirname:T.dirname(ct.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:we&&we.tagName.toUpperCase()==="SCRIPT"&&we.src||new URL("setup-cpp.js",document.baseURI).href));async function wn({version:e,setupDir:t,arch:r,priority:n=40}){let s;switch(process.platform){case"win32":{s=await Qa({version:e,setupDir:t,arch:r});break}case"darwin":{s=await He("gcc",e);break}case"linux":{if(Pe())s=await _e("gcc",e);else if(xe())s=await Ce([{name:"gcc",version:e},{name:"gcc-c++",version:e},{name:"libstdc++-devel"}]);else if(await Oe())s=await Le([{name:"gcc",version:e},{name:"g++",version:e}]);else if(ve())if(e==="")s=await fe([{name:"gcc"},{name:"g++"}]);else try{s=await fe([{name:"gcc",version:e},{name:"g++",version:e}])}catch{s=await fe([{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(s!==void 0)return await oS(e,s.binDir,n),s}async function oS(e,t,r=40){if(process.platform==="win32")return;const n=[];{const s=aS(e),[o,i]=await Promise.all([kd("gcc",t,s),kd("g++",t,s)]);n.push(Te("CC",o,ne),Te("CXX",i,ne)),ve()&&n.push(mt("cc",o,ne,r),mt("cxx",i,ne,r),mt("gcc",o,ne,r),mt("g++",i,ne,r))}n.push(Oh()),iS&&await xh(),await Promise.all(n)}function aS(e){try{const t=Th(e),r=uh(t);return r>=5?`${r}`:e}catch{return e}}async function kd(e,t,r){var o,i;if(await me(`${t}/${e}-${r}`))return Ee(`${t}/${e}-${r}`);const n=new RegExp(`^${dn(e)}-?([\\d\\.\\-]*)(?:\\.exe)?$`),s=(await La(t)).filter(l=>n.test(l)).sort((l,u)=>{var m,d,v,E;const c=(d=(m=l.match(n))==null?void 0:m[1])!=null?d:"",a=(E=(v=u.match(n))==null?void 0:v[1])!=null?E:"";try{return vE(c,a)}catch{return 0}});for(const l of s){const u=`${t}/${l}`;if(r===""||l.includes(r)||(i=(o=await cS(u))==null?void 0:o.includes(r))!=null&&i)return Ee(u)}return await me(`${t}/${e}`)?Ee(`${t}/${e}`):Ee(e)}async function cS(e){try{const{stdout:t}=await le(e,["--version"],{stdio:"pipe"}),r=t.match(/(gcc|g\+\+).* \(.*\) ([\d.]+)/);if(r!==null)return r[2];Se(`Failed to parse gcc version from: ${t}`)}catch(t){ke(`Failed to get gcc version: ${t}`)}}const jt=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,s)=>new Promise((o,i)=>t.mkdir(n,s,(l,u)=>l?i(l):o(u))),e.stat=e.stat||r.stat||ae.stat,e.statAsync=e.statAsync?e.statAsync:async n=>new Promise((s,o)=>t.stat(n,(i,l)=>i?o(i):s(l))),e.statSync=e.statSync||r.statSync||ae.statSync,e.mkdirSync=e.mkdirSync||r.mkdirSync||ae.mkdirSync,t},Qt=(e,t,r)=>{const n=T.dirname(e),s={...jt(t),recursive:!1};if(n===e)try{return s.mkdirSync(e,s)}catch(o){const i=o;if(i&&i.code!=="EISDIR")throw o;return}try{return s.mkdirSync(e,s),r||e}catch(o){const i=o;if(i&&i.code==="ENOENT")return Qt(e,s,Qt(n,s,r));if(i&&i.code!=="EEXIST"&&i&&i.code!=="EROFS")throw o;try{if(!s.statSync(e).isDirectory())throw o}catch{throw o}}},or=Object.assign(async(e,t,r)=>{const n=jt(t);n.recursive=!1;const s=T.dirname(e);return s===e?n.mkdirAsync(e,n).catch(o=>{const i=o;if(i&&i.code!=="EISDIR")throw o}):n.mkdirAsync(e,n).then(()=>r||e,async o=>{const i=o;if(i&&i.code==="ENOENT")return or(s,n).then(l=>or(e,n,l));if(i&&i.code!=="EEXIST"&&i.code!=="EROFS")throw o;return n.statAsync(e).then(l=>{if(l.isDirectory())return r;throw o},()=>{throw o})})},{sync:Qt}),Fh=async(e,t,r)=>{if(r!==t)return e.statAsync(t).then(n=>n.isDirectory()?r:void 0,n=>{const s=n;return s&&s.code==="ENOENT"?Fh(e,T.dirname(t),t):void 0})},jh=(e,t,r)=>{if(r!==t)try{return e.statSync(t).isDirectory()?r:void 0}catch(n){const s=n;return s&&s.code==="ENOENT"?jh(e,T.dirname(t),t):void 0}},gn=(e,t)=>{const r=jt(t);if(r.recursive=!0,T.dirname(e)===e)return r.mkdirSync(e,r);const s=jh(r,e);try{return r.mkdirSync(e,r),s}catch(o){const i=o;if(i&&i.code==="ENOENT")return Qt(e,r);throw o}},pa=Object.assign(async(e,t)=>{const r={...jt(t),recursive:!0};return T.dirname(e)===e?await r.mkdirAsync(e,r):Fh(r,e).then(s=>r.mkdirAsync(e,r).then(o=>s||o).catch(o=>{const i=o;if(i&&i.code==="ENOENT")return or(e,r);throw o}))},{sync:gn}),uS=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,Uh=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),uS==="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},lS=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version,ha=lS.replace(/^v/,"").split("."),Mh=+ha[0]>10||+ha[0]==10&&+ha[1]>=12,Za=Mh?e=>jt(e).mkdirSync===ae.mkdirSync:()=>!1,qd=Object.assign(Mh?e=>jt(e).mkdir===ae.mkdir:()=>!1,{sync:Za}),Fd=(e,t)=>{e=Uh(e);const r=jt(t);return Za(r)?gn(e,r):Qt(e,r)},Rr=Object.assign(async(e,t)=>{e=Uh(e);const r=jt(t);return qd(r)?pa(e,r):or(e,r)},{mkdirpSync:Fd,mkdirpNative:pa,mkdirpNativeSync:gn,mkdirpManual:or,mkdirpManualSync:Qt,sync:Fd,native:pa,nativeSync:gn,manual:or,manualSync:Qt,useNative:qd,useNativeSync:Za});function rt(e,t,r=null){var n;return Gh(t)?(n=ec(e,r))!=null?n:"":t}function fS(){const e=typeof __dirname=="string"?__dirname:T.dirname(ct.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:we&&we.tagName.toUpperCase()==="SCRIPT"&&we.src||new URL("setup-cpp.js",document.baseURI).href)),t=T.join(e,"versions.json");return JSON.parse(ae.readFileSync(t,"utf-8"))}const dS=je(fS);function ec(e,t=null){var d,v,E;const n=dS()[e];if(n===void 0)return;if(typeof n=="string")return n;const s=n,o=(d=s[process.platform])!=null?d:s.else;if(o===void 0)throw new Error(`Platform "${process.platform}" not found in versions data for tool "${e}"`);if(typeof o=="string")return o;const i=o,l=ve()?"ubuntu":Pe()?"archlinux":lh()?"alpine":xe()?"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 c=u,a=t!==null?pS(t,c):c.else;if(a===void 0)throw new Error(`Architecture "${process.arch}" not found in versions data for tool "${e}"`);if(typeof a=="string")return a;const m=a;return(E=m[process.arch])!=null?E:m.else}function pS(e,t){var s;const r=e[0],n=Object.keys(t).map(o=>Number.parseInt(o,10)).filter(o=>!Number.isNaN(o)).sort((o,i)=>i-o).find(o=>r>=o);return n!==void 0&&(s=t[n])!=null?s:t.else}function Gh(e){return e==="true"||e===void 0}function hS(e,t,r=void 0){var u,c;const n=r===void 0?!1:t.includes(r.compiler),o=(n?t:t.filter(a=>a!=="compiler")).filter(a=>e[a]!==void 0),i=o.filter(a=>{const m=n&&a==="compiler"&&r!==void 0?r.version:e[a];return!Gh(m)}),l=i.length!==0?n&&i[0]==="compiler"&&r!==void 0?(u=r.version)!=null?u:"true":(c=e[i[0]])!=null?c:"true":"true";if(i.some(a=>n&&a==="compiler"&&r!==void 0?e.compiler!==`${r.compiler}-${l}`:e[a]!==l))return!1;for(const a of o)e[a]=n&&a==="compiler"&&r!==void 0?`${r.compiler}-${l}`:l;return!0}function mS(e){return e.startsWith(">")}const{GITHUB_ACTIONS:yS}=gt;async function Vh({version:e,setupDir:t,arch:r}){be.startGroup("Setup Python");const n=await ES(e,t,r);xr(n.bin!==void 0);const s=n.bin;be.endGroup(),be.startGroup("Setup venv"),await wS(s),be.endGroup(),be.startGroup("Setup pip");const o=await bS(s);if(be.endGroup(),o===void 0)throw new Error("pip was not installed correctly");return be.startGroup("Setup pipx"),await vS(s),be.endGroup(),be.startGroup("Setup wheel"),await _S(s),be.endGroup(),n}async function vS(e){try{if(!await sn(e)){try{await Tr("pipx")}catch(t){Yt(`pipx was not installed completely for the system-wide python: ${t}`)}try{await sn(e)||await _n(e,"pipx",void 0,{upgrade:!0,usePipx:!1})}catch(t){Yt(`pipx was not installed completely for ${e}: ${t}`)}}if(await sn(e))await le(e,["-m","pipx","ensurepath"],{stdio:"inherit"});else if(await TS())Yt(`pipx module not found for ${e}. Trying to install with pipx binary...`),await le("pipx",["ensurepath"],{stdio:"inherit"});else throw new Error("pipx module or pipx binary not found. Corrput pipx installation.")}catch(t){Yt(`Failed to install pipx completely for ${e}: ${t.toString()}. Ignoring...`)}}async function wS(e){if(await gS(e)){W("venv module already installed.");return}try{await Tr("venv")}catch(t){W(`Failed to install venv: ${t.toString()}. Ignoring...`)}}async function gS(e){try{return await le(e,["-m","venv","-h"],{stdio:"ignore"}),ve()?Va("python3-venv"):!0}catch{}return!1}async function _S(e){try{await _n(e,"setuptools",void 0,{upgrade:!0,isLibrary:!0,usePipx:!1}),await _n(e,"wheel",void 0,{upgrade:!1,isLibrary:!0,usePipx:!1})}catch(t){W(`Failed to install setuptools/wheel: ${t.toString()}. Ignoring...`)}}async function ES(e,t,r){const n=mS(e)?"":e;let s,o=await nn(t);if(o!==void 0){const i=T.dirname(o);s={bin:o,installDir:i,binDir:i}}else{if(yS)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),o=await nn(t),o===void 0)throw new Error("Python binary could not be found");const l=T.dirname(o);s={bin:o,installDir:l,binDir:l}}catch(i){Se(i.toString())}s===void 0&&(s=await SS(t,n))}if(o===void 0||s.bin===void 0){if(o=await nn(t),o===void 0)throw new Error("Python binary could not be found");s={bin:o,installDir:T.dirname(o),binDir:T.dirname(o)}}return s}async function SS(e,t){let r;switch(process.platform){case"win32":{e?await De("python3",t,[`--params=/InstallDir:${e}`]):await De("python3",t);const n=await nn(e);if(n===void 0)throw new Error("Python binary could not be found");const s=T.dirname(n);await Ie(s,ne),r={installDir:s,binDir:s,bin:n};break}case"darwin":{r=await He("python3",t);const n=await le("brew",["--prefix","python"],{stdio:"pipe"}),s=T.join(n.stdout,"libexec","bin");await Ie(s,ne);break}case"linux":{if(Pe())r=await _e("python",t);else if(xe())r=await Ce([{name:"python3",version:t}]);else if(ve())r=await fe([{name:"python3",version:t},{name:"python-is-python3"}]);else if(await Oe())r=await Le([{name:"python3",version:t}]);else throw new Error("Unsupported linux distributions");break}default:throw new Error("Unsupported platform")}return r}async function nn(e){for(const t of["python","python3"]){const r=await jd(t,e);if(r!==void 0)return r}if(process.platform==="win32"){const t=T.parse(pe.homedir()).root,r=(await La(t)).filter(n=>n.startsWith("Python"));for(const n of r)for(const s of["python3","python"]){const o=await jd(s,T.join(t,n));if(o!==void 0)return o}}}async function jd(e,t){var r;try{const n=ec("python");if(t!==void 0){const o=T.join(t,Ee(e));if(await me(o)&&await ga(o,n))return o}const s=(r=await he(e,{nothrow:!0,all:!0}))!=null?r:[];for(const o of s)if(await ga(o,n))return o}catch{}}async function bS(e){const t=await Ud();return t===void 0?(W("pip was not found. Installing pip"),await OS(e),Ud()):t}async function Ud(){for(const e of["pip3","pip"]){const t=await RS(e);if(t!==void 0)return t}}async function RS(e){var t;try{const r=ec("pip"),n=(t=await he(e,{nothrow:!0,all:!0}))!=null?t:[];for(const s of n)if(await ga(s,r))return s}catch{}}async function OS(e){await Md(e)||(await Tr("pip"),await Md(e))}async function Md(e){if(await Wh(e))return!1;try{return await le(e,["-m","ensurepip","-U","--upgrade"],{stdio:"inherit"}),!0}catch(t){W(t.toString());try{return await le(e,["-m","pip","install","--upgrade","pip"],{stdio:"inherit"}),!0}catch(r){W(r.toString())}}return!1}var Er={},Gd;function $S(){if(Gd)return Er;Gd=1,Object.defineProperty(Er,"__esModule",{value:!0}),Er.getUbuntuVersion=void 0;const e=At;function t(s){return"errno"in s}function r(s,o){return new Promise((i,l)=>{e.execFile(s,o,{encoding:"utf8",shell:!1},(u,c,a)=>{if(u){if(t(u)&&u.code==="ENOENT"){i(null);return}l(new Error(`Could not execute \`${s} ${o.join(" ")}\`: ${u} (stderr=${a})`));return}i(c)})})}async function n(){if(process.platform!=="linux")return[];const s=await r("lsb_release",["-a"]);if(s===null)return[];const o=/^Distributor ID:\s*(.+)$/,i=/^Description:\s*Ubuntu\s+(\d+)\.(\d+)(?:\.(\d+))?/,l=/^Release:\s*(\d+)\.(\d+)(?:\.(\d+))?$/;let u=null,c=null,a=!1;for(const m of s.split(`
|
||
`)){const d=m.match(o);if(d!==null){if(d[1]!=="Ubuntu")return[];a=!0}const v=m.match(i);v&&(u=v);const E=m.match(l);if(E&&(c=E),a&&u&&c)break}if(!a)return[];for(const m of[u,c])if(m){const d=[m[1],m[2]];return m[3]&&d.push(m[3]),d.map(v=>parseInt(v,10))}return[]}return Er.getUbuntuVersion=n,Er}var Bh=$S();async function IS(){try{if(ve()){try{he.sync("lsb_release",{nothrow:!0})===null&&await fe([{name:"lsb-release"}])}catch{return Vd()}const e=await Bh.getUbuntuVersion();return e.length===0?Vd():e}else return null}catch(e){return Se(e.toString()),null}}const qt=je(IS,{promise:!0});function Vd(){if(!("version"in pe&&typeof pe.version=="function"))return null;const t=pe.version().match(/(\d+)\.(\d+)\.(\d+)/);if(t===null)return null;const r=Number.parseInt(t[1],10),n=Number.parseInt(t[2],10),s=Number.parseInt(t[3],10);return[r,n,s]}function PS(e){return[...new Set(e)]}function Bd(e,t='"'){return e.includes(" ")?`${t}${e}${t}`:e}async function ir(e,t,r={}){return _n(await NS(r.pythonVersion),e,t,r)}async function _n(e,t,r,n={}){const{usePipx:s=!0,user:o=!0,upgrade:i=!1,isLibrary:l=!1}=n,u=s&&!l&&await sn(e),c=!u&&await Wh(e),a=u?"pipx":"pip",m=LS(t);if(!i&&(u?await kS(e,m):await DS(e,m)))return{binDir:u?await Hd():await zd(e,m)};if(!c&&await qS(e,m))try{be.info(`Installing ${t} ${r!=null?r:""} via ${a}`);const v=r!==void 0&&r!==""?`${t}==${r}`:t,E=i?u?["upgrade"]:["install","--upgrade"]:["install"],p=!u&&o?["--user"]:[],f=process.env;u&&o&&(f.PIPX_HOME=await CS(),f.PIPX_BIN_DIR=await Hh()),Be(e,["-m",a,...E,...p,v],{stdio:"inherit",env:f})}catch(v){const E=v instanceof Error?`${v.message}
|
||
${v.stack}`:String(v);if(be.info(`Failed to install ${t} via ${a}: ${E}`),await Tr(t)===null)throw new Error(`Failed to install ${t} via ${a}: ${v}.`)}else if(await Tr(t)===null)throw new Error(`Failed to install ${t} as it was not found via ${a} or the system package manager`);return{binDir:u?await Hd():await zd(e,m)}}function Hd(){return Hh()}async function zd(e,t){const r=await US(e),n=await FS(r,t);return await Ie(n,ne),n}async function TS(){return await he("pipx",{nothrow:!0})!==null}async function sn(e){return(await le(e,["-m","pipx","--help"],{stdio:"ignore",reject:!1})).exitCode===0}async function xS(){let e=process.env.PIPX_HOME;if(e!==void 0)return e;const t=st("~/.local/pipx");if(await me(t))return t;switch(process.platform){case"win32":{e=st("~/AppData/Local/pipx");break}case"darwin":{e=st("~/Library/Application Support/pipx");break}default:{e=st("~/.local/share/pipx");break}}return await Rr(e),await Rr(T.join(e,"trash")),await Rr(T.join(e,"shared")),await Rr(T.join(e,"venv")),e}const CS=je(xS,{promise:!0});async function AS(){if(process.env.PIPX_BIN_DIR!==void 0)return process.env.PIPX_BIN_DIR;const e=st("~/.local/bin");return await Ie(e,ne),await Rr(e),e}const Hh=je(AS,{promise:!0});let Qr;async function NS(e){if(Qr!==void 0)return Qr;const t=e!=null?e:rt("python",void 0,await qt());return Qr=(await Vh({version:t,setupDir:"",arch:process.arch})).bin,Qr}function LS(e){return e.replace(/\[.*]/g,"").trim()}async function DS(e,t){try{return(await le(e,["-m","pip","-qq","show",t],{stdio:"ignore",reject:!1})).exitCode===0}catch{return!1}}async function kS(e,t){try{const r=await le(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 s of Object.values(n.venvs))if(s.metadata.main_package.package_or_url===t||s.metadata.main_package.package===t)return!0}catch{}return!1}async function qS(e,t){return(await le(e,["-m","pip","-qq","index","versions",t],{stdio:"ignore",reject:!1})).exitCode===0}async function FS(e,t){const n=(await Promise.all(e.map(o=>me(T.join(o,Ee(t)))))).findIndex(o=>o);if(n!==-1)return e[n];const s=he.sync(Ee(t),{nothrow:!0});return s!==null?T.dirname(s):e[e.length-1]}async function Tr(e,t){if(process.platform==="linux"){be.info(`Installing ${e} via the system package manager`);const r=e==="pipx"?Pe():!0;if(Pe())return _e(r?`python-${e}`:e);if(xe())return Ce([{name:r?`python3-${e}`:e}]);if(ve())return fe([{name:r?`python3-${e}`:e}]);if(await Oe())return Le([{name:r?`py3-${e}`:e}])}else if(process.platform==="darwin")return["venv"].includes(e)?null:He(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 zh(e);return t.push(T.join(r,"Scripts"),T.join(r,"Scripts","bin"),T.join(r,"bin")),PS(t)}const US=je(jS,{promise:!0});async function MS(e){return(await Ln.getExecOutput(`${e} -c "import sys;print(sys.base_exec_prefix);"`)).stdout.trim()}const zh=je(MS,{promise:!0});async function GS(e){try{const t=await zh(e),r=await Ph(e);if(r===void 0)return Se(`Failed to get the version of ${e}`),!1;const n=T.join(t,"lib",`python${r.major}.${r.minor}`,"EXTERNALLY-MANAGED");return me(n)}catch(t){return Se(`Failed to check if ${e} is externally managed: ${t}`),!1}}const Wh=je(GS,{promise:!0});function VS({version:e}={}){return ir("gcovr",e)}function BS(){return Te("GCOV","llvm-cov gcov",ne)}function Wd(e){const t=Nn(e),r=t!==null?uh(t):e,n=r!==""?`gcov-${r}`:"gcov";return Te("GCOV",n,ne)}const it=["x64","amd64","x86_64","win64","64","amd64_x86","amd64_arm64"],ar=["x86","i386","ia32","win32","32","x32"],at=["aarch64","arm64","woa64","arm"],HS=["armv7","armv7a"],zS=["powerpc64le","ppc64le"],WS=["sparc64"],XS=["sparcv9"];function Xh(e){return at.includes(e)?"arm64":it.includes(e)?"amd64":e}async function KS({version:e}={}){switch(process.platform){case"win32":return De("bazelisk",e);case"darwin":return He("bazelisk",e);case"linux":{if(Pe())throw new Error("installing bazel on Arch linux is not supported yet");if(xe())return await Ce([{name:"dnf-plugins-core"}]),await yt("dnf",["copr","enable","vbatts/bazel"]),Ce([{name:"bazel4"}]);if(ve()){const t=await _h({fileName:"bazel-archive-keyring.gpg",keyUrl:"https://bazel.build/bazel-release.pub.gpg"});return await yt("bash",["-c",`echo "deb [arch=${Xh(process.arch)} signed-by=${t}] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list`]),fe([{name:"bazel",version:e}],!0)}else if(await Oe())return Le([{name:"bazel",version:e}],!0);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}async function YS({version:e}={}){switch(process.platform){case"win32":return De("ccache",e);case"darwin":return He("ccache",e);case"linux":{if(Pe())return _e("ccache",e);if(xe())return Ce([{name:"ccache",version:e}]);if(ve())return fe([{name:"ccache",version:e}]);if(await Oe())return Le([{name:"ccache",version:e}]);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}var JS=In();const ma=$e(JS);function QS(e,t,r){var s;const n=(s=Jt(e))!=null?s:e;switch(t){case"win32":{const o=ma(n,"v3.19.6");let i;it.includes(r)?i=o?"win64-x64":"windows-x86_64":ar.includes(r)?i=o?"win32-x86":"windows-i386":at.includes(r)?i="windows-arm64":(W(`Trying unsupported arch '${r}' for cmake on Windows`),i=`windows-${r}`);const l=`cmake-${e}-${i}`;return{binRelativeDir:"bin/",binFileName:Ee("cmake"),extractedFolderName:l,url:`https://github.com/Kitware/CMake/releases/download/v${e}/${l}.zip`}}case"darwin":{const i=ma(n,"v3.19.1")?"Darwin-x86_64":"macos-universal",l=`cmake-${e}-${i}`;return{binRelativeDir:"CMake.app/Contents/bin/",binFileName:Ee("cmake"),extractedFolderName:l,url:`https://github.com/Kitware/CMake/releases/download/v${e}/${l}.tar.gz`}}case"linux":{const o=ma(n,"v3.19.8");let i;at.includes(r)?i=o?"Linux-aarch64":"linux-aarch64":it.includes(r)?i=o?"Linux-x86_64":"linux-x86_64":(W(`Trying unsupported arch '${r}' for cmake on Linux`),i=`linux-${r}`);const l=`cmake-${e}-${i}`;return{binRelativeDir:"bin/",binFileName:Ee("cmake"),extractedFolderName:l,url:`https://github.com/Kitware/CMake/releases/download/v${e}/${l}.tar.gz`}}default:throw new Error(`Unsupported platform '${t}'`)}}async function Kh({version:e,setupDir:t,arch:r}){return await Oe()?Le([{name:"cmake"}]):Pt("cmake",e,QS,t,r)}function Sr({version:e}={}){return ir("cmakelang[YAML]",e)}function ZS({version:e}={}){return ir("conan",e)}async function eb({version:e}={}){switch(process.platform){case"win32":return await De("cppcheck",e),{binDir:await tb()};case"darwin":return He("cppcheck",e);case"linux":{if(Pe())return _e("cppcheck",e);if(xe())return Ce([{name:"ccache",version:e}]);if(ve())return fe([{name:"cppcheck",version:e}]);if(await Oe())return Le([{name:"cppcheck",version:e}]);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}async function tb(){const e="C:/Program Files/Cppcheck";return await Ie(e,ne),e}function rb({version:e}={}){return ir("cpplint",e,{pythonVersion:">=3.8.0"})}async function on({version:e}={}){switch(process.platform){case"win32":return await De("graphviz",e),nb();case"darwin":return He("graphviz",e);case"linux":{if(Pe())return _e("graphviz",e);if(xe())return Ce([{name:"graphviz",version:e}]);if(ve())return fe([{name:"graphviz",version:e}]);if(await Oe())return Le([{name:"graphviz",version:e}]);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}async function nb(){switch(process.platform){case"win32":{const e="C:/Program Files/Graphviz/bin";return await Ie(e,ne),{binDir:e}}default:throw new Error("Unsupported platform")}}const ib=new Map([[24,["Sequoia","15"]],[23,["Sonoma","14"]],[22,["Ventura","13"]],[21,["Monterey","12"]],[20,["Big Sur","11"]],[19,["Catalina","10.15"]],[18,["Mojave","10.14"]],[17,["High Sierra","10.13"]],[16,["Sierra","10.12"]],[15,["El Capitan","10.11"]],[14,["Yosemite","10.10"]],[13,["Mavericks","10.9"]],[12,["Mountain Lion","10.8"]],[11,["Lion","10.7"]],[10,["Snow Leopard","10.6"]],[9,["Leopard","10.5"]],[8,["Tiger","10.4"]],[7,["Panther","10.3"]],[6,["Jaguar","10.2"]],[5,["Puma","10.1"]]]);function sb(e){e=Number((e||pe.release()).split(".")[0]);const[t,r]=ib.get(e)||["Unknown",""];return{name:t,version:r}}function ob(){if(process.platform!=="darwin")return[];const{version:e}=sb();return e.split(".").map(t=>Number.parseInt(t,10))}const ab=je(ob);async function cb(e,t){const{ArchiveHdi:r}=await Promise.resolve().then(()=>require("./assets/index-CTEbAbkY.js"));await new r(e).read(async s=>{await s.extract(T.join(t,s.path))})}function ub(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:cb,url:`https://doxygen.nl/files/${n}.dmg`}}default:throw new Error(`Unsupported platform '${t}'`)}}async function lb({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:o=>W(o)});const s={binDir:await db()};return await on({version:rt("graphviz",void 0)}),s}case"darwin":{const n=await He("doxygen",void 0,{formula:!0});return ab()[0]>11&&await on({version:rt("graphviz",void 0)}),n}case"linux":{const n=await fb({version:e,setupDir:t,arch:r});return await on({version:rt("graphviz",void 0,await qt())}),n}default:throw new Error("Unsupported platform")}}async function fb({version:e,setupDir:t,arch:r}){try{if(Pe())return await _e("doxygen",e);if(xe())return Ce([{name:"doxygen",version:e}]);if(ve())return await fe([{name:"doxygen",version:e,fallBackToLatest:at.includes(r)}]);if(await Oe())return Le([{name:"doxygen"}]);throw new Error("Unsupported linux distributions")}catch{try{const n=await Pt("doxygen",e,ub,t,r);if(ve())try{await fe([{name:"libclang-cpp-dev"}])}catch(s){W(`Failed to download libclang-cpp-dev that might be needed for running doxygen. ${s}`)}return n}catch(n){return Yt(`Failed to download doxygen binary. ${n}. Falling back to installing the latest version from apt-get.`),fe([{name:"doxygen"}])}}}async function db(){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 me(T.join(e,"doxygen.exe")))return await Ie(e,ne),e;throw new Error("Failed to find doxygen binary")}default:throw new Error("Unsupported platform")}}function pb({version:e}={}){return ir("flawfinder",e)}async function Yh({version:e}={}){const t=await he("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=hb();return n!==null&&await Ie(n,ne),r}case"darwin":return He("git",e);case"linux":{if(Pe())return _e("git",e);if(xe())return Ce([{name:"git",version:e}]);if(ve())return fe([{name:"git",version:e}]);if(await Oe())return Le([{name:"git",version:e}]);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}function hb(){const e=["C:/Program Files/Git/bin/git.exe","C:/Program Files (x86)/Git/bin/git.exe"];for(const t of e)if(ae.existsSync(t))return t;return Se("Git not found in the default locations. Add git to PATH manually."),null}const mb=typeof __dirname=="string"?__dirname:T.dirname(ct.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:we&&we.tagName.toUpperCase()==="SCRIPT"&&we.src||new URL("setup-cpp.js",document.baseURI).href));async function yb(e,t,r){const{keywords:n,optionalKeywords:s}=wb(t,r),o=await hn(T.join(mb,"github_facebook_infer.json")),i=mn(o,{version:e,keywords:n,optionalKeywords:s,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 ${s}`)}function vb({version:e,setupDir:t,arch:r}){return Pt("infer",e,yb,t,r)}function wb(e,t){const r=[],n=[];switch(e){case"linux":{r.push("linux"),it.includes(t)?(n.push("64"),n.push("x86_64")):(W(`Using arch ${t} for infer`),r.push(t));break}case"darwin":{r.push("osx"),it.includes(t)?n.push("x86_64"):at.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 gb(e,t){switch(e){case"win32":return it.includes(t)||ar.includes(t)?"win":at.includes(t)?"winarm64":"win";case"darwin":return"mac";case"linux":return it.includes(t)||ar.includes(t)?"linux":at.includes(t)?"linux-aarch64":"linux";default:throw new Error(`Unsupported platform '${e}'`)}}function _b(e,t,r){const n=gb(t,r);return{binRelativeDir:"",binFileName:Ee("ninja"),extractedFolderName:"",url:`https://github.com/ninja-build/ninja/releases/download/v${e}/ninja-${n}.zip`}}async function Jh({version:e,setupDir:t,arch:r}){return await Oe()?(await fh(),await Le([{name:"ninja-build"},{name:"ninja-is-really-ninja"}]),await Ie("/usr/lib/ninja-build/bin",ne),{binDir:"/usr/lib/ninja-build/bin",installDir:"/usr/lib/ninja-build/",bin:"/usr/lib/ninja-build/bin/ninja"}):Pt("ninja",e,_b,t,r)}const Eb=typeof __dirname=="string"?__dirname:T.dirname(ct.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:we&&we.tagName.toUpperCase()==="SCRIPT"&&we.src||new URL("setup-cpp.js",document.baseURI).href));function Sb(e){return{url:`https://github.com/SimonKagstrom/kcov/releases/download/${e}/kcov-amd64.tar.gz`,extractedFolderName:"",binRelativeDir:"usr/local/bin",binFileName:Ee("kcov")}}function bb(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,s)=>Rb(n,s,r)}}async function Rb(e,t,r){const n=await vn(e,t,1),s=await Ob(r);process.platform==="linux"&&(Pe()?await Promise.all([_e("libdwarf"),_e("libcurl-openssl")]):xe()?await Ce([{name:"libdwarf-devel"},{name:"libcurl-devel"}]):ve()&&await fe([{name:"libdw-dev"},{name:"libcurl4-openssl-dev"}]));try{if(he.sync("patch",{nothrow:!0})!==null){const i=T.join(Eb,"gcc13.patch");await le("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 o=T.join(n,"build");return await le(s,["-S",n,"-B",o,"-DCMAKE_BUILD_TYPE=Release","-G","Ninja"],{cwd:n,stdio:"inherit"}),await le(s,["--build",o,"--config","Release"],{cwd:n,stdio:"inherit"}),n}async function Ob(e){let t=he.sync("cmake",{nothrow:!0});if(t===null){const{binDir:n}=await Kh({version:rt("cmake",void 0,await qt()),setupDir:T.join(st("~"),"cmake"),arch:e});t=T.join(n,"cmake")}return he.sync("ninja",{nothrow:!0})===null&&await Jh({version:rt("ninja",void 0,await qt()),setupDir:T.join(st("~"),"ninja"),arch:e}),t}async function $b({version:e,setupDir:t,arch:r}){if(process.platform!=="linux"){W("Kcov is not supported on non-linux");return}const n=e.split("-");let s=yE(n[0]);const o=n[1],i=mE(s);i===38&&(s="v38");let l;return o==="binary"&&i>=39?(l=await Pt("kcov",s,Sb,t,r),Pe()?await _e("binutils"):xe()?await Ce([{name:"binutils"}]):ve()&&await fe([{name:"libbinutils"}]),l):(l=await Pt("kcov",s,bb,t,r),l)}function Ib({version:e}={}){return ir("lizard",e)}async function Or(){process.platform==="darwin"&&(await he("clang",{nothrow:!0})!==null&&await he("clang++",{nothrow:!0})!==null&&(Yt("Assuming clang is an Apple Clang compiler"),await Promise.all([Te("CC","clang",ne),Te("CXX","clang++",ne)])),cn.error("Apple Clang automatic installation is not supported yet"))}function Pb(e){const t=Th(e);return Number.parseInt(t.split(".")[0],10)}const wr=je(Pb);async function Tb(e){if(await Oe())try{return await xb(e)}catch(t){W(`Failed to install llvm via system package manager ${t}.`)}}function xb(e){const t=wr(e);return Le([{name:`llvm${t}`}])}const Cb=typeof __dirname=="string"?__dirname:T.dirname(ct.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:we&&we.tagName.toUpperCase()==="SCRIPT"&&we.src||new URL("setup-cpp.js",document.baseURI).href));var tc=(e=>(e[e.All=0]="All",e[e.ClangFormat=1]="ClangFormat",e[e.Core=2]="Core",e))(tc||{});async function Ab(e,t=0){if(ve())try{return await Nb(e,t)}catch(r){cn.info(`Failed to install llvm via system package manager ${r}. Trying to remove the repository`);try{ye(T.join(Cb,"llvm_repo_remove.bash"),[`${wr(e)}`])}catch(n){cn.info(`Failed to remove llvm repository ${n}`)}}}async function Nb(e,t=0){const r=wr(e),n=`/usr/lib/llvm-${r}`;await fe([{name:"ca-certificates"}]);const s=new Dr.DownloaderHelper("https://apt.llvm.org/llvm.sh",pe.tmpdir(),{fileName:"llvm.sh"});s.on("error",l=>{throw new Error(`Failed to download the LLVM installer script: ${l}`)}),await s.start();const o=await Lr(s.getDownloadPath(),"utf-8"),i=T.join(pe.tmpdir(),"llvm-setup-cpp.sh");return await Lb(o,i,r,t),await gh(),await fe([{name:"lsb-release"},{name:"wget"},{name:"gnupg"}]),await Na(i,"755"),await yt("bash",[i,`${r}`,...t===0?["all"]:[]],{stdio:"inherit",shell:!0,timeout:om}),await Ie(`${n}/bin`,ne),{installDir:`${n}`,binDir:`${n}/bin`,bin:`${n}/bin/clang++`}}async function Lb(e,t,r,n){let s=Db(e);s=kb(s),s=jb(n,s,r),s=await qb(s),s=Fb(s),await Da(t,s)}function Db(e){return process.env.NODE_DEBUG!=="1"&&process.env.NODE_DEBUG!=="true"?e.replace(/set -eux/g,"set -eu"):e}function kb(e){return e.replace(/add-apt-repository\s*(-y)?\s*"\${REPO_NAME}"/g,`add-apt-repository -y -n "\${REPO_NAME}"
|
||
apt-get update -o ${yr}`)}async function qb(e){let t=e.replace(/apt-get install -y/g,`apt-get install -o Dpkg::Options::="--force-overwrite" -o ${yr} -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 s=n.replace("$LLVM_VERSION","*");await H_(s)&&(cn.info(`Removing conflicting package ${s}`),t=t.replace(n,""))})),t}function Fb(e){return hh()?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 Xd=typeof __dirname=="string"?__dirname:T.dirname(ct.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:we&&we.tagName.toUpperCase()==="SCRIPT"&&we.src||new URL("setup-cpp.js",document.baseURI).href));async function Ub(e,t,r){const n=await Mb(t,r,e);return W(`Downloading LLVM from ${n}`),{url:n,extractedFolderName:"",binRelativeDir:"bin",binFileName:Ee("clang"),extractFunction:t==="win32"?Dh(Ja(n)):(s,o)=>vn(s,o,1)}}async function Mb(e,t,r){const{keywords:n,optionalKeywords:s}=await Gb(e,t),o=await hn(T.join(Xd,"github_llvm_llvm-project.json")),i=mn(o,{version:r,keywords:n,optionalKeywords:s,filterMapTag(c){return c.replace(/^llvmorg-/,"")}});if(i!==void 0)return`https://github.com/llvm/llvm-project/releases/download/${i.tag}/${i.name}`;const l=await hn(T.join(Xd,"llvm_org_releases.json")),u=mn(l,{version:r,keywords:n,optionalKeywords:s});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 ${s}`)}async function Gb(e,t){const r=[],n=[];switch(e){case"win32":{n.push(".exe",".exe");const s=[];it.includes(t)?(s.push("win64"),n.push(["x86_64","X64"])):ar.includes(t)?s.push("win32"):at.includes(t)?s.push("woa64"):(W(`Using arch ${t} for LLVM`),s.push(t)),s.push("windows","Windows"),r.push(s);break}case"linux":{const s=["linux","Linux"];if(ve()){n.push("ubuntu");const o=await qt();if(o!==null){n.push(`${o[0]}`);const i=o[1]<10?`0${o[1]}`:`${o[1]}`;n.push(`${o[0]}.${i}`),n.push(`${o[0]}.${i}.${o[2]}`)}}else xe()&&n.push("rhel");it.includes(t)?r.push(["x86_64","X64"]):ar.includes(t)?r.push("x86"):at.includes(t)?r.push("aarch64"):HS.includes(t)?r.push("armv7a"):zS.includes(t)?r.push("powerpc64le"):WS.includes(t)?r.push("sparc64"):(W(`Using arch ${t} for LLVM`),r.push(t)),r.push(s);break}case"darwin":{r.push(["apple","macos","macOS"]),it.includes(t)?n.push(["x86_64","X64"]):at.includes(t)?n.push(["arm64","ARM64"]):(W(`Using arch ${t} for LLVM`),r.push(t));break}case"freebsd":{r.push("freebsd"),it.includes(t)?r.push("amd64"):ar.includes(t)?r.push("i386"):(W(`Using arch ${t} for LLVM`),r.push(t));break}case"solaris":{r.push("solaris"),it.includes(t)?r.push("amd64"):XS.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 Vb({version:e,setupDir:t,arch:r}){const n=await Pt("llvm",e,Ub,t,r);return await Hb(wr(e),r),n}async function Bb(e,t){if(ve())for(const r of["libtinfo5","libtinfo6"])try{await fe([{name:r}])}catch{try{if(r==="libtinfo5"){W(`Failed to install ${r}
|
||
Manually installing the package`);const s=`libtinfo5_6.3-2ubuntu0.1_${Xh(t)}.deb`,o=`https://launchpad.net/ubuntu/+archive/primary/+files/${s}`,i=new Dr.DownloaderHelper(o,pe.tmpdir(),{fileName:s});i.on("error",async l=>{W(`Failed to download ${o}: ${l}`),await i.stop()}),await i.start(),ye("dpkg",["-i",T.join(pe.tmpdir(),s)])}}catch{W(`Failed to install ${r}. Ignoring`)}}else Pe()?await _e("ncurses5-compat-libs",void 0,"yay"):xe()&&await Ce([{name:"ncurses-compat-libs"}])}const Hb=je(Bb,{promise:!0});async function zb({version:e}){if(process.platform!=="darwin")return Promise.resolve(void 0);try{return await Wb({version:e})}catch(t){W(`Failed to install llvm via brew: ${t}`);return}}async function Wb({version:e}){const t=wr(e),r=await He("llvm",`${t}`,{"force-bottle":!0});return await Ie(r.binDir,ne),r}const{GITHUB_ACTIONS:Xb}=gt,Kb=typeof __dirname=="string"?__dirname:T.dirname(ct.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:we&&we.tagName.toUpperCase()==="SCRIPT"&&we.src||new URL("setup-cpp.js",document.baseURI).href));async function an({version:e,setupDir:t,arch:r}){const n=await rc(e,t,r);return await Jb(r),await Zb(),n.installDir!==void 0&&await Qb(n.installDir,e),n}async function rc(e,t,r,n=tc.All){const s=await Ab(e,n);if(s!==void 0)return s;const o=await Tb(e);if(o!==void 0)return o;const i=await zb({version:e});return i!==void 0?i:Vb({version:e,setupDir:t,arch:r})}async function Yb(e){process.platform==="linux"&&await wn({version:rt("gcc",void 0,await qt()),setupDir:"",arch:e,priority:40})}const Jb=je(Yb,{promise:!0});async function Qb(e,t){var i,l;const r=(i=process.env.LD_LIBRARY_PATH)!=null?i:"",n=(l=process.env.DYLD_LIBRARY_PATH)!=null?l:"",s=wr(t),o=[Te("CC",Ee(`${e}/bin/clang`),ne),Te("CXX",Ee(`${e}/bin/clang++`),ne),Te("LLVM_PATH",e,ne),Te("LLVM_LD_LIBRARY_PATH",`${r}${T.delimiter}${e}/lib`,ne),Te("LLVM_DYLD_LIBRARY_PATH",`${n}${T.delimiter}${e}/lib`,ne),Te("LLVM_LDFLAGS",`-L${Bd(`${e}/lib`)}`,ne),Te("LLVM_CPPFLAGS",`-I${Bd(`${e}/include`)}`,ne),await me(`${e}/lib/clang/${t}/include`)?Te("LLVM_CPATH",`${e}/lib/clang/${t}/include`,ne):await me(`${e}/lib/clang/${s}/include`)?Te("LLVM_CPATH",`${e}/lib/clang/${s}/include`,ne):Promise.resolve(),Te("LLVM_LIBRARY_PATH",`${e}/lib`,ne),Oh()];ve()&&o.push(mt("cc",`${e}/bin/clang`,ne,60),mt("cxx",`${e}/bin/clang++`,ne,60),mt("clang",`${e}/bin/clang`,ne),mt("clang++",`${e}/bin/clang++`,ne),mt("lld",`${e}/bin/lld`,ne),mt("ld.lld",`${e}/bin/ld.lld`,ne),mt("llvm-ar",`${e}/bin/llvm-ar`,ne)),await Promise.all(o)}async function Zb(){if(!Xb)return;const e=T.join(Kb,"llvm_matcher.json");if(!await me(e))return Se("the llvm_matcher.json file does not exist in the same folder as setup-cpp.js");W(`::add-matcher::${e}`)}function Kd({version:e,setupDir:t,arch:r}){return rc(e,t,r,tc.ClangFormat)}function Yd({version:e,setupDir:t,arch:r}){return rc(e,t,r)}async function eR({version:e}={}){switch(process.platform){case"win32":return De("make",e);case"darwin":{await He("make",e);const t=T.join(za(),"opt/make/libexec/gnubin");return await Ie(t,ne),{binDir:t}}case"linux":{if(Pe())return _e("make",e);if(xe())return Ce([{name:"make",version:e}]);if(ve())return fe([{name:"make",version:e}]);if(await Oe())return Le([{name:"make",version:e}]);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}function tR({version:e}={}){return ir("meson",e)}var Kt={},Jd;function rR(){if(Jd)return Kt;Jd=1;const e=fr(),t=At,r=ae,n=T,s=ot,o=s.env["ProgramFiles(x86)"],i=[s.env["ProgramFiles(x86)"],s.env.ProgramFiles],l=["Enterprise","Professional","Community","BuildTools"],u=["2022","2019","2017"],c={2022:"17.0",2019:"16.0",2017:"15.0",2015:"14.0",2013:"12.0"};function a(y){return Object.values(c).includes(y)?y:y in c?c[y]:y}Kt.vsversion_to_versionnumber=a;function m(y){if(Object.keys(c).includes(y))return y;for(const[w,S]of Object.entries(c))if(S===y)return w;return y}Kt.vsversion_to_year=m;const d=`${o}\\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}Kt.findWithVswhere=v;function E(y){const w=a(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"),_=`${o}\\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")}Kt.findVcvarsall=E;function p(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(s.platform!="win32"){e.info("This is not a Windows virtual environment, bye!");return}s.env.PATH+=n.delimiter+d;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("="),z=U[V];N!==z&&(e.info(`Setting ${V}`),p(V)&&(N=f(N)),e.exportVariable(V,N))}e.endGroup(),e.info("Configured Developer Command Prompt")}return Kt.setupMSVCDevCmd=h,Kt}var _a=rR();function nR(e){switch(e){case"x32":case"32":case"ia32":return"x86";case"64":return"x64";default:return e}}async function nc({vsversion:e,VCTargetsPath:t,arch:r,toolset:n,sdk:s,uwp:o,spectre:i}){t!==void 0&&await me(t)&&(W(`Adding ${t} to PATH`),await Te("VCTargetsPath",t,ne)),await _a.setupMSVCDevCmd(nR(r),s,n,o,i,e)}const{GITHUB_ACTIONS:iR}=gt,sR=typeof __dirname=="string"?__dirname:T.dirname(ct.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:we&&we.tagName.toUpperCase()==="SCRIPT"&&we.src||new URL("setup-cpp.js",document.baseURI).href));async function $r({version:e,setupDir:t,arch:r,sdk:n,uwp:s,spectre:o}){if(process.platform!=="win32")return;const i=_a.vsversion_to_versionnumber(e);W(`Checking if MSVC ${i} is already installed`);let l=!1;try{const a=_a.findVcvarsall(i);l=!0,W(`Found the pre-installed version of MSVC at ${a}`)}catch{}let u,c;if(!l)try{i==="14.0"?(u="14.0",await De("visualcpp-build-tools","14.0.25420.1",["--ignore-dependencies"]),c="C:/Program Files (x86)/MSBuild/Microsoft.Cpp/v4.0/v140"):i==="15.0"?(u="14.16",await De("visualstudio2017buildtools","15.9.41.0",[]),c="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",[]),c="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",[]),c=void 0):ke(`The given MSVC versions ${e} is not supported yet.`)}catch(a){ke(a)}await nc({VCTargetsPath:c,arch:r,toolset:u,sdk:n,uwp:s,spectre:o}),iR&&await oR()}async function oR(){const e=T.join(sR,"msvc_matcher.json");if(!await me(e))return Se("the msvc_matcher.json file does not exist in the same folder as setup-cpp.js");W(`::add-matcher::${e}`)}let kt;async function aR({version:e}={}){if(!ve())return;if(typeof kt=="string")return{binDir:kt};const t=he.sync("nala",{nothrow:!0});if(t!==null)return kt=T.dirname(t),{binDir:kt};await fe([{name:"python3-apt"}]),kt="/usr/bin";try{const r=await wa({name:"nala",version:e});if(r!==void 0)return await fe([{name:r}]),{binDir:kt}}catch(r){W(`Failed to install nala: ${r}`)}try{const r=await wa({name:"nala-legacy"});if(r!==void 0)return await fe([{name:r}],!0),{binDir:kt}}catch(r){W(`Failed to install nala-legacy: ${r}`)}return await cR(),{binDir:kt}}async function cR(){const e=new Dr.DownloaderHelper("https://gitlab.com/volian/volian-archive/-/raw/main/install-nala.sh",pe.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(pe.tmpdir(),"install-nala.sh"),r=await Lr(t,"utf8");await Da(t,r.replace(/sudo/g,"")),await fe([{name:"wget"}]);try{ye("bash",[t])}catch(n){ke(`Failed to install nala via installer: ${n}`),ye("apt",["install","-y","-t","nala","nala"])}}async function Qd({version:e}={}){return process.platform!=="win32"?void 0:(await De("opencppcoverage",e),{binDir:await uR()})}async function uR(){const e="C:/Program Files/OpenCppCoverage";return await Ie(e,ne),e}function lR(e,t,r){return{url:fR(t,r,e),binRelativeDir:"",binFileName:Ee("pwsh"),extractedFolderName:""}}function fR(e,t,r){var n;switch(e){case"win32":{const s=["ia32","x86","i386","x32"].includes(t)?"win-x86":"win-x64";return`https://github.com/PowerShell/PowerShell/releases/download/v${r}/PowerShell-${r}-${s}.zip`}case"darwin":{const s=["arm","arm64"].includes(t)?"osx-arm64":"osx-x64";return`https://github.com/PowerShell/PowerShell/releases/download/v${r}/powershell-${r}-${s}.tar.gz`}case"linux":{const o=(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}-${o}.tar.gz`}default:throw new Error(`Unsupported platform '${e}'`)}}async function Zd({version:e,setupDir:t,arch:r}){try{return await Oe()?ep({version:e}):await Pt("pwsh",e,lR,t,r)}catch(n){return ke(`Failed to setup pwsh via download: ${n}. Trying package managers...`),ep({version:e})}}async function ep({version:e}={}){switch(process.platform){case"win32":{await De("powershell-core",e);const t="C:/Program Files/PowerShell/7";return await Ie(t,ne),{binDir:t}}case"darwin":return He("powershell",e,{cask:!0,overwrite:!1});case"linux":{if(Pe())return _e("powershell-bin",e,"yay");if(xe())return await Ce([{name:"curl"}]),ye("/bin/bash",["-c","curl https://packages.microsoft.com/config/rhel/8/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo"]),Ce([{name:"powershell",version:e}]);if(ve()){await fe([{name:"curl"}]);const t=await qt(),r=`${t[0]}.0${t[1]}`;return ye("curl",["-LJO",`https://packages.microsoft.com/config/ubuntu/${r}/packages-microsoft-prod.deb`]),ye("dpkg",["-i","packages-microsoft-prod.deb"]),fe([{name:"powershell",version:e}],!0)}else if(await Oe())return Le([{name:"powershell",version:void 0}]);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}async function dR({version:e}={}){switch(process.platform){case"win32":return De("sccache",e);case"linux":{if(ve()){if((await Bh.getUbuntuVersion())[0]>=24)return fe([{name:"sccache",version:e}])}else if(await Oe())return Le([{name:"sccache",version:e}]);return He("sccache",e)}case"darwin":return He("sccache",e);default:throw new Error("Unsupported platform")}}function pR(e){switch(e){case"win32":return"windows";default:return e}}function hR(e){switch(e){case"x64":return"amd64";case"ia32":case"x86":case"i386":case"x32":return"386";default:return e}}function mR(e,t,r){const n=pR(t),s=hR(r),o=t==="win32"?"zip":"tar.gz";return{binRelativeDir:"",binFileName:Ee("task"),extractedFolderName:"",url:`https://github.com/go-task/task/releases/download/v${e}/task_${n}_${s}.${o}`}}function yR({version:e,setupDir:t,arch:r}){return Pt("task",e,mR,t,r)}let tp=!1;async function vR({version:e,setupDir:t,arch:r}){const n=await he("vcpkg",{nothrow:!0});if(tp&&n!==null)return{binDir:T.dirname(n)};if(await Yh(),process.platform==="linux"){if(Pe())await Promise.all([_e("curl"),_e("zip"),_e("unzip"),_e("tar"),_e("pkg-config")]);else if(xe())await Ce([{name:"curl"},{name:"zip"},{name:"unzip"},{name:"tar"},{name:"pkg-config"}]);else if(ve())await fe([{name:"curl"},{name:"zip"},{name:"unzip"},{name:"tar"},{name:"pkg-config"}]);else if(await Oe()){const s=[{name:"curl"},{name:"zip"},{name:"unzip"},{name:"tar"},{name:"pkgconf"}];at.includes(r)&&s.push({name:"build-base"}),await Le(s)}}return await me(T.join(t,va("bootstrap-vcpkg",".bat")))?Yt(`Vcpkg folder already exists at ${t}. Skipping the clone`):await le("git",["clone","https://github.com/microsoft/vcpkg"],{cwd:T.dirname(t),stdio:"inherit"}),e!==""&&e!=="true"&&(W(`Checking out vcpkg version ${e}`),await le("git",["checkout",e],{cwd:t,stdio:"inherit"})),process.platform==="linux"&&at.includes(r)&&await Te("VCPKG_FORCE_SYSTEM_BINARIES","1"),await le(va(Zp("bootstrap-vcpkg"),".bat"),{cwd:t,shell:!0,stdio:"inherit"}),await hr(t),await Ie(t,ne),tp=!0,{binDir:t}}const Qh={llvm:an,clang:an,"clang++":an},Zh={gcc:wn,"g++":wn},em={mingw:Qa},tm={msvc:$r,cl:$r,msbuild:$r,visualstudio:$r},rm={appleclang:Or,applellvm:Or,"apple-clang":Or,"apple-llvm":Or},wR={cmakelang:Sr,"cmake-lint":Sr,"cmake-format":Sr,cmakelint:Sr,cmakeformat:Sr},nm=["llvm","clang","clang++","clang-tidy","clang-format","clangtidy","clangformat"],im={git:Yh,nala:aR,brew:Ba,choco:Nh,python:Vh,powershell:Zd,pwsh:Zd,...Qh,...Zh,...em,...tm,...rm,...wR,cmake:Kh,ninja:Jh,vcpkg:vR,bazel:KS,conan:ZS,meson:tR,gcovr:VS,opencppcoverage:Qd,OpenCppCoverage:Qd,ccache:YS,sccache:dR,doxygen:lb,graphviz:on,cppcheck:eb,cpplint:rb,flawfinder:pb,lizard:Ib,infer:vb,"clang-tidy":Yd,clangtidy:Yd,"clang-format":Kd,clangformat:Kd,vcvarsall:nc,kcov:$b,make:eR,task:yR,sevenzip:rn,"7zip":rn,"7z":rn},sm=Object.keys(im),rp=["compiler","architecture","timeout",...sm],om=60*60*1e3;async function gR(e,t,r,n,s,o,i,l=om){be.startGroup(`Installing ${e} ${t}`);try{await _R(e,t,r,n,s,o)}catch(u){ke(u),u instanceof Error&&u.stack!==void 0&&ke(u.stack),i.push(`${e} failed to install`)}be.endGroup()}async function _R(e,t,r,n,s,o){const i=nm.includes(e);let l;if(e==="vcvarsall")await nc({version:rt(e,t,r),arch:n,uwp:!1,spectre:!1});else if(e==="brew")l=await Ba({rcOptions:ne});else{const u=T.join(s,i?"llvm":e),c=rt(e,t,r),a=im[e];l=await a({version:c,setupDir:u,arch:n})}o.push(am(e,l))}function am(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 ER=/[.-]((?:\d{4}|\d+(?:\.\d+)*(?:-[\w.-]+)?(?:\+[\w.-]+)?)$)/;function SR(e){try{const t=e.match(ER);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}$/)&&Nn(r)===null&&W(`Non-semver version format: ${r}`),{compiler:n,version:r}}catch(t){return ke(`Failed to parse the compiler info ${e}: ${t}`),{compiler:e,version:void 0}}}async function bR(e,t,r,n,s,o,i){var u;let l;try{if(be.startGroup(`Installing ${e} ${t!=null?t:""}`),e in Qh)l=await an({version:rt("llvm",t,r),setupDir:T.join(n,"llvm"),arch:s}),await BS();else if(e in Zh){const c=rt("gcc",t,r);l=await wn({version:c,setupDir:T.join(n,"gcc"),arch:s}),await Wd(c)}else if(e in em){const c=rt("mingw",t,r);l=await Qa({version:c,setupDir:T.join(n,"gcc"),arch:s}),await Wd(c)}else e in tm?l=await $r({version:rt("msvc",t,r),setupDir:T.join(n,"msvc"),arch:s}):e in rm?await Or():(l=null,i.push(`Unsupported compiler ${e}`))}catch(c){ke(c),c instanceof Error&&ke((u=c.stack)!=null?u:""),i.push(`Failed to install the ${e} compiler ${t}`)}l!==null&&o.push(am(e,l)),be.endGroup()}async function RR(e,t="npm"){try{return await he("setup-cpp",{nothrow:!0})!==null?`setup-cpp@${e} already installed`:(W(`Installing setup-cpp@${e} via ${t}...`),await le(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 OR(e={}){var E,p;const t=(E=e.architecture)!=null?E:process.arch,r=(p=process.env.SETUP_CPP_DIR)!=null?p:st("~"),n=[],s=[],o=Ff.create({autoloadLocales:!0});Ff.addLocale(E_),f_.addLocale(h_);let i,l;const u=await qt(),c=e.compiler!==void 0?SR(e.compiler):void 0;if(!hS(e,[...nm,"compiler"],c))return{successMessages:[],errorMessages:["The same version must be used for llvm, clang-format and clang-tidy"]};Pe()&&typeof e.cppcheck=="string"&&typeof e.gcovr=="string"&&(W("installing python-pygments to avoid conflicts with cppcheck and gcovr on Arch linux"),await _e("python-pygments"));const a=sm.filter(f=>{const h=e[f];return h!==void 0&&h!=="false"}),m=e["setup-cpp"]===void 0||e["setup-cpp"]?RR(Pa.version,e["node-package-manager"]):Promise.resolve(void 0);let d=!1;for(const f of a){const h=e[f],y=e.timeout!==void 0?Number.parseFloat(e.timeout)*60*1e3:void 0;if(i=Date.now(),await gR(f,h,u,t,r,n,s,y),l=Date.now(),W(`took ${o.format(i,l)||"0 seconds"}`),s.length!==0&&un.isCI){d=!0;break}}if(!d&&c!==void 0){const f=Date.now();await bR(c.compiler,c.version,u,r,t,n,s);const h=Date.now();W(`took ${o.format(f,h)||"0 seconds"}`)}const v=await m;return typeof v=="string"?n.push(v):v instanceof Error&&s.push(v.message),await Xg(ne),{successMessages:n,errorMessages:s}}async function $R(e){const t=un.GITHUB_ACTIONS?Promise.resolve():IR(),r=cm(e);if(r.help)return PR(),0;if(r.version)return W(`${Pa.version}`),0;const{successMessages:n,errorMessages:s}=await OR(r);for(const o of n)by(o);for(const o of s)ke(o);if((n.length!==0||s.length!==0)&&(W("setup-cpp finished"),!un.GITHUB_ACTIONS))switch(process.platform){case"win32":{Se("Run `RefreshEnv.cmd` or restart your shell to update the environment.");break}case"linux":case"darwin":{Se("Run `source ~/.cpprc` or restart your shell to update the environment.");break}}return await t,s.length===0?0:1}async function IR(){try{await Qm({pkg:Pa})}catch(e){Se(`Failed to check for updates: ${e instanceof Error?e.message+e.stack:e}`)}}function cm(e){const t=Object.fromEntries(rp.map(r=>[r,gp(r)]));return Pm(e,{string:[...rp,"timeout","node-package-manager"],default:t,alias:{h:"help",v:"version"},boolean:["help","version","setup-cpp"]})}function PR(){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, --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"}},["tools"])}process.env.SETUP_CPP_SKIP_MAIN!=="true"&&$R(process.argv).then(e=>{process.exitCode=e}).catch(e=>{ke("main() panicked!"),ke(e),process.exitCode=1});exports.HttpClient=mp;exports.ciInfo=gt;exports.commonjsGlobal=et;exports.coreExports=be;exports.execExports=Ln;exports.getAugmentedNamespace=bn;exports.getDefaultExportFromCjs=$e;exports.info=W;exports.parseArgs=cm;exports.pathExists=me;exports.require$$13=xa;exports.requireSemver=pp;exports.toolCacheExports=kn;exports.warning=Se;
|
||
//# sourceMappingURL=setup-cpp.js.map
|