diff --git a/build/index.js b/build/index.js index ae0283a4..20959005 100644 --- a/build/index.js +++ b/build/index.js @@ -10,4 +10,4 @@ * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. - */e.exports=function isObject(e){return e!=null&&typeof e==="object"&&Array.isArray(e)===false}},7493:(e,t,r)=>{"use strict";const o=r(2087);const s=new Map([[19,"Catalina"],[18,"Mojave"],[17,"High Sierra"],[16,"Sierra"],[15,"El Capitan"],[14,"Yosemite"],[13,"Mavericks"],[12,"Mountain Lion"],[11,"Lion"],[10,"Snow Leopard"],[9,"Leopard"],[8,"Tiger"],[7,"Panther"],[6,"Jaguar"],[5,"Puma"]]);const macosRelease=e=>{e=Number((e||o.release()).split(".")[0]);return{name:s.get(e),version:"10."+(e-4)}};e.exports=macosRelease;e.exports.default=macosRelease},2621:(e,t,r)=>{"use strict";const{PassThrough:o}=r(2413);e.exports=function(){var e=[];var t=new o({objectMode:true});t.setMaxListeners(0);t.add=add;t.isEmpty=isEmpty;t.on("unpipe",remove);Array.prototype.slice.call(arguments).forEach(add);return t;function add(r){if(Array.isArray(r)){r.forEach(add);return this}e.push(r);r.once("end",remove.bind(null,r));r.once("error",t.emit.bind(t,"error"));r.pipe(t,{end:false});return this}function isEmpty(){return e.length==0}function remove(r){e=e.filter((function(e){return e!==r}));if(!e.length&&t.readable){t.end()}}}},6047:e=>{"use strict";const mimicFn=(e,t)=>{for(const r of Reflect.ownKeys(t)){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}return e};e.exports=mimicFn;e.exports.default=mimicFn},900:e=>{var t=1e3;var r=t*60;var o=r*60;var s=o*24;var n=s*7;var i=s*365.25;e.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0){return parse(e)}else if(r==="number"&&isFinite(e)){return t.long?fmtLong(e):fmtShort(e)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function parse(e){e=String(e);if(e.length>100){return}var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!a){return}var c=parseFloat(a[1]);var u=(a[2]||"ms").toLowerCase();switch(u){case"years":case"year":case"yrs":case"yr":case"y":return c*i;case"weeks":case"week":case"w":return c*n;case"days":case"day":case"d":return c*s;case"hours":case"hour":case"hrs":case"hr":case"h":return c*o;case"minutes":case"minute":case"mins":case"min":case"m":return c*r;case"seconds":case"second":case"secs":case"sec":case"s":return c*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return undefined}}function fmtShort(e){var n=Math.abs(e);if(n>=s){return Math.round(e/s)+"d"}if(n>=o){return Math.round(e/o)+"h"}if(n>=r){return Math.round(e/r)+"m"}if(n>=t){return Math.round(e/t)+"s"}return e+"ms"}function fmtLong(e){var n=Math.abs(e);if(n>=s){return plural(e,n,s,"day")}if(n>=o){return plural(e,n,o,"hour")}if(n>=r){return plural(e,n,r,"minute")}if(n>=t){return plural(e,n,t,"second")}return e+" ms"}function plural(e,t,r,o){var s=t>=r*1.5;return Math.round(e/r)+" "+o+(s?"s":"")}},467:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var o=_interopDefault(r(2413));var s=_interopDefault(r(8605));var n=_interopDefault(r(8835));var i=_interopDefault(r(7211));var a=_interopDefault(r(8761));const c=o.Readable;const u=Symbol("buffer");const l=Symbol("type");class Blob{constructor(){this[l]="";const e=arguments[0];const t=arguments[1];const r=[];let o=0;if(e){const t=e;const s=Number(t.length);for(let e=0;e1&&arguments[1]!==undefined?arguments[1]:{},s=r.size;let n=s===undefined?0:s;var i=r.timeout;let a=i===undefined?0:i;if(e==null){e=null}else if(isURLSearchParams(e)){e=Buffer.from(e.toString())}else if(isBlob(e));else if(Buffer.isBuffer(e));else if(Object.prototype.toString.call(e)==="[object ArrayBuffer]"){e=Buffer.from(e)}else if(ArrayBuffer.isView(e)){e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)}else if(e instanceof o);else{e=Buffer.from(String(e))}this[d]={body:e,disturbed:false,error:null};this.size=n;this.timeout=a;if(e instanceof o){e.on("error",(function(e){const r=e.name==="AbortError"?e:new FetchError(`Invalid response body while trying to fetch ${t.url}: ${e.message}`,"system",e);t[d].error=r}))}}Body.prototype={get body(){return this[d].body},get bodyUsed(){return this[d].disturbed},arrayBuffer(){return consumeBody.call(this).then((function(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}))},blob(){let e=this.headers&&this.headers.get("content-type")||"";return consumeBody.call(this).then((function(t){return Object.assign(new Blob([],{type:e.toLowerCase()}),{[u]:t})}))},json(){var e=this;return consumeBody.call(this).then((function(t){try{return JSON.parse(t.toString())}catch(t){return Body.Promise.reject(new FetchError(`invalid json response body at ${e.url} reason: ${t.message}`,"invalid-json"))}}))},text(){return consumeBody.call(this).then((function(e){return e.toString()}))},buffer(){return consumeBody.call(this)},textConverted(){var e=this;return consumeBody.call(this).then((function(t){return convertBody(t,e.headers)}))}};Object.defineProperties(Body.prototype,{body:{enumerable:true},bodyUsed:{enumerable:true},arrayBuffer:{enumerable:true},blob:{enumerable:true},json:{enumerable:true},text:{enumerable:true}});Body.mixIn=function(e){for(const t of Object.getOwnPropertyNames(Body.prototype)){if(!(t in e)){const r=Object.getOwnPropertyDescriptor(Body.prototype,t);Object.defineProperty(e,t,r)}}};function consumeBody(){var e=this;if(this[d].disturbed){return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`))}this[d].disturbed=true;if(this[d].error){return Body.Promise.reject(this[d].error)}let t=this.body;if(t===null){return Body.Promise.resolve(Buffer.alloc(0))}if(isBlob(t)){t=t.stream()}if(Buffer.isBuffer(t)){return Body.Promise.resolve(t)}if(!(t instanceof o)){return Body.Promise.resolve(Buffer.alloc(0))}let r=[];let s=0;let n=false;return new Body.Promise((function(o,i){let a;if(e.timeout){a=setTimeout((function(){n=true;i(new FetchError(`Response timeout while trying to fetch ${e.url} (over ${e.timeout}ms)`,"body-timeout"))}),e.timeout)}t.on("error",(function(t){if(t.name==="AbortError"){n=true;i(t)}else{i(new FetchError(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,"system",t))}}));t.on("data",(function(t){if(n||t===null){return}if(e.size&&s+t.length>e.size){n=true;i(new FetchError(`content size at ${e.url} over limit: ${e.size}`,"max-size"));return}s+=t.length;r.push(t)}));t.on("end",(function(){if(n){return}clearTimeout(a);try{o(Buffer.concat(r,s))}catch(t){i(new FetchError(`Could not create Buffer from response body for ${e.url}: ${t.message}`,"system",t))}}))}))}function convertBody(e,t){if(typeof p!=="function"){throw new Error("The package `encoding` must be installed to use the textConverted() function")}const r=t.get("content-type");let o="utf-8";let s,n;if(r){s=/charset=([^;]*)/i.exec(r)}n=e.slice(0,1024).toString();if(!s&&n){s=/0&&arguments[0]!==undefined?arguments[0]:undefined;this[b]=Object.create(null);if(e instanceof Headers){const t=e.raw();const r=Object.keys(t);for(const e of r){for(const r of t[e]){this.append(e,r)}}return}if(e==null);else if(typeof e==="object"){const t=e[Symbol.iterator];if(t!=null){if(typeof t!=="function"){throw new TypeError("Header pairs must be iterable")}const r=[];for(const t of e){if(typeof t!=="object"||typeof t[Symbol.iterator]!=="function"){throw new TypeError("Each header pair must be iterable")}r.push(Array.from(t))}for(const e of r){if(e.length!==2){throw new TypeError("Each header pair must be a name/value tuple")}this.append(e[0],e[1])}}else{for(const t of Object.keys(e)){const r=e[t];this.append(t,r)}}}else{throw new TypeError("Provided initializer must be an object")}}get(e){e=`${e}`;validateName(e);const t=find(this[b],e);if(t===undefined){return null}return this[b][t].join(", ")}forEach(e){let t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:undefined;let r=getHeaders(this);let o=0;while(o1&&arguments[1]!==undefined?arguments[1]:"key+value";const r=Object.keys(e[b]).sort();return r.map(t==="key"?function(e){return e.toLowerCase()}:t==="value"?function(t){return e[b][t].join(", ")}:function(t){return[t.toLowerCase(),e[b][t].join(", ")]})}const T=Symbol("internal");function createHeadersIterator(e,t){const r=Object.create(E);r[T]={target:e,kind:t,index:0};return r}const E=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==E){throw new TypeError("Value of `this` is not a HeadersIterator")}var e=this[T];const t=e.target,r=e.kind,o=e.index;const s=getHeaders(t,r);const n=s.length;if(o>=n){return{value:undefined,done:true}}this[T].index=o+1;return{value:s[o],done:false}}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));Object.defineProperty(E,Symbol.toStringTag,{value:"HeadersIterator",writable:false,enumerable:false,configurable:true});function exportNodeCompatibleHeaders(e){const t=Object.assign({__proto__:null},e[b]);const r=find(e[b],"Host");if(r!==undefined){t[r]=t[r][0]}return t}function createHeadersLenient(e){const t=new Headers;for(const r of Object.keys(e)){if(g.test(r)){continue}if(Array.isArray(e[r])){for(const o of e[r]){if(h.test(o)){continue}if(t[b][r]===undefined){t[b][r]=[o]}else{t[b][r].push(o)}}}else if(!h.test(e[r])){t[b][r]=[e[r]]}}return t}const w=Symbol("Response internals");const y=s.STATUS_CODES;class Response{constructor(){let e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;let t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};Body.call(this,e,t);const r=t.status||200;const o=new Headers(t.headers);if(e!=null&&!o.has("Content-Type")){const t=extractContentType(e);if(t){o.append("Content-Type",t)}}this[w]={url:t.url,status:r,statusText:t.statusText||y[r],headers:o,counter:t.counter}}get url(){return this[w].url||""}get status(){return this[w].status}get ok(){return this[w].status>=200&&this[w].status<300}get redirected(){return this[w].counter>0}get statusText(){return this[w].statusText}get headers(){return this[w].headers}clone(){return new Response(clone(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}Body.mixIn(Response.prototype);Object.defineProperties(Response.prototype,{url:{enumerable:true},status:{enumerable:true},ok:{enumerable:true},redirected:{enumerable:true},statusText:{enumerable:true},headers:{enumerable:true},clone:{enumerable:true}});Object.defineProperty(Response.prototype,Symbol.toStringTag,{value:"Response",writable:false,enumerable:false,configurable:true});const v=Symbol("Request internals");const _=n.parse;const O=n.format;const k="destroy"in o.Readable.prototype;function isRequest(e){return typeof e==="object"&&typeof e[v]==="object"}function isAbortSignal(e){const t=e&&typeof e==="object"&&Object.getPrototypeOf(e);return!!(t&&t.constructor.name==="AbortSignal")}class Request{constructor(e){let t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};let r;if(!isRequest(e)){if(e&&e.href){r=_(e.href)}else{r=_(`${e}`)}e={}}else{r=_(e.url)}let o=t.method||e.method||"GET";o=o.toUpperCase();if((t.body!=null||isRequest(e)&&e.body!==null)&&(o==="GET"||o==="HEAD")){throw new TypeError("Request with GET/HEAD method cannot have body")}let s=t.body!=null?t.body:isRequest(e)&&e.body!==null?clone(e):null;Body.call(this,s,{timeout:t.timeout||e.timeout||0,size:t.size||e.size||0});const n=new Headers(t.headers||e.headers||{});if(s!=null&&!n.has("Content-Type")){const e=extractContentType(s);if(e){n.append("Content-Type",e)}}let i=isRequest(e)?e.signal:null;if("signal"in t)i=t.signal;if(i!=null&&!isAbortSignal(i)){throw new TypeError("Expected signal to be an instanceof AbortSignal")}this[v]={method:o,redirect:t.redirect||e.redirect||"follow",headers:n,parsedURL:r,signal:i};this.follow=t.follow!==undefined?t.follow:e.follow!==undefined?e.follow:20;this.compress=t.compress!==undefined?t.compress:e.compress!==undefined?e.compress:true;this.counter=t.counter||e.counter||0;this.agent=t.agent||e.agent}get method(){return this[v].method}get url(){return O(this[v].parsedURL)}get headers(){return this[v].headers}get redirect(){return this[v].redirect}get signal(){return this[v].signal}clone(){return new Request(this)}}Body.mixIn(Request.prototype);Object.defineProperty(Request.prototype,Symbol.toStringTag,{value:"Request",writable:false,enumerable:false,configurable:true});Object.defineProperties(Request.prototype,{method:{enumerable:true},url:{enumerable:true},headers:{enumerable:true},redirect:{enumerable:true},clone:{enumerable:true},signal:{enumerable:true}});function getNodeRequestOptions(e){const t=e[v].parsedURL;const r=new Headers(e[v].headers);if(!r.has("Accept")){r.set("Accept","*/*")}if(!t.protocol||!t.hostname){throw new TypeError("Only absolute URLs are supported")}if(!/^https?:$/.test(t.protocol)){throw new TypeError("Only HTTP(S) protocols are supported")}if(e.signal&&e.body instanceof o.Readable&&!k){throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8")}let s=null;if(e.body==null&&/^(POST|PUT)$/i.test(e.method)){s="0"}if(e.body!=null){const t=getTotalBytes(e);if(typeof t==="number"){s=String(t)}}if(s){r.set("Content-Length",s)}if(!r.has("User-Agent")){r.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)")}if(e.compress&&!r.has("Accept-Encoding")){r.set("Accept-Encoding","gzip,deflate")}let n=e.agent;if(typeof n==="function"){n=n(t)}if(!r.has("Connection")&&!n){r.set("Connection","close")}return Object.assign({},t,{method:e.method,headers:exportNodeCompatibleHeaders(r),agent:n})}function AbortError(e){Error.call(this,e);this.type="aborted";this.message=e;Error.captureStackTrace(this,this.constructor)}AbortError.prototype=Object.create(Error.prototype);AbortError.prototype.constructor=AbortError;AbortError.prototype.name="AbortError";const G=o.PassThrough;const P=n.resolve;function fetch(e,t){if(!fetch.Promise){throw new Error("native promise missing, set fetch.Promise to your favorite alternative")}Body.Promise=fetch.Promise;return new fetch.Promise((function(r,n){const c=new Request(e,t);const u=getNodeRequestOptions(c);const l=(u.protocol==="https:"?i:s).request;const p=c.signal;let d=null;const m=function abort(){let e=new AbortError("The user aborted a request.");n(e);if(c.body&&c.body instanceof o.Readable){c.body.destroy(e)}if(!d||!d.body)return;d.body.emit("error",e)};if(p&&p.aborted){m();return}const g=function abortAndFinalize(){m();finalize()};const h=l(u);let b;if(p){p.addEventListener("abort",g)}function finalize(){h.abort();if(p)p.removeEventListener("abort",g);clearTimeout(b)}if(c.timeout){h.once("socket",(function(e){b=setTimeout((function(){n(new FetchError(`network timeout at: ${c.url}`,"request-timeout"));finalize()}),c.timeout)}))}h.on("error",(function(e){n(new FetchError(`request to ${c.url} failed, reason: ${e.message}`,"system",e));finalize()}));h.on("response",(function(e){clearTimeout(b);const t=createHeadersLenient(e.headers);if(fetch.isRedirect(e.statusCode)){const o=t.get("Location");const s=o===null?null:P(c.url,o);switch(c.redirect){case"error":n(new FetchError(`redirect mode is set to error: ${c.url}`,"no-redirect"));finalize();return;case"manual":if(s!==null){try{t.set("Location",s)}catch(e){n(e)}}break;case"follow":if(s===null){break}if(c.counter>=c.follow){n(new FetchError(`maximum redirect reached at: ${c.url}`,"max-redirect"));finalize();return}const o={headers:new Headers(c.headers),follow:c.follow,counter:c.counter+1,agent:c.agent,compress:c.compress,method:c.method,body:c.body,signal:c.signal,timeout:c.timeout};if(e.statusCode!==303&&c.body&&getTotalBytes(c)===null){n(new FetchError("Cannot follow redirect with body being a readable stream","unsupported-redirect"));finalize();return}if(e.statusCode===303||(e.statusCode===301||e.statusCode===302)&&c.method==="POST"){o.method="GET";o.body=undefined;o.headers.delete("content-length")}r(fetch(new Request(s,o)));finalize();return}}e.once("end",(function(){if(p)p.removeEventListener("abort",g)}));let o=e.pipe(new G);const s={url:c.url,status:e.statusCode,statusText:e.statusMessage,headers:t,size:c.size,timeout:c.timeout,counter:c.counter};const i=t.get("Content-Encoding");if(!c.compress||c.method==="HEAD"||i===null||e.statusCode===204||e.statusCode===304){d=new Response(o,s);r(d);return}const u={flush:a.Z_SYNC_FLUSH,finishFlush:a.Z_SYNC_FLUSH};if(i=="gzip"||i=="x-gzip"){o=o.pipe(a.createGunzip(u));d=new Response(o,s);r(d);return}if(i=="deflate"||i=="x-deflate"){const t=e.pipe(new G);t.once("data",(function(e){if((e[0]&15)===8){o=o.pipe(a.createInflate())}else{o=o.pipe(a.createInflateRaw())}d=new Response(o,s);r(d)}));return}if(i=="br"&&typeof a.createBrotliDecompress==="function"){o=o.pipe(a.createBrotliDecompress());d=new Response(o,s);r(d);return}d=new Response(o,s);r(d)}));writeToStream(h,c)}))}fetch.isRedirect=function(e){return e===301||e===302||e===303||e===307||e===308};fetch.Promise=global.Promise;e.exports=t=fetch;Object.defineProperty(t,"__esModule",{value:true});t.default=t;t.Headers=Headers;t.Request=Request;t.Response=Response;t.FetchError=FetchError},502:(e,t,r)=>{"use strict";const o=r(5622);const s=r(7278);const npmRunPath=e=>{e={cwd:process.cwd(),path:process.env[s()],execPath:process.execPath,...e};let t;let r=o.resolve(e.cwd);const n=[];while(t!==r){n.push(o.join(r,"node_modules/.bin"));t=r;r=o.resolve(r,"..")}const i=o.resolve(e.cwd,e.execPath,"..");n.push(i);return n.concat(e.path).join(o.delimiter)};e.exports=npmRunPath;e.exports.default=npmRunPath;e.exports.env=t=>{t={env:process.env,...t};const r={...t.env};const o=s({env:r});t.path=r[o];r[o]=e.exports(t);return r}},7278:e=>{"use strict";const pathKey=(e={})=>{const t=e.env||process.env;const r=e.platform||process.platform;if(r!=="win32"){return"PATH"}return Object.keys(t).reverse().find((e=>e.toUpperCase()==="PATH"))||"Path"};e.exports=pathKey;e.exports.default=pathKey},1223:(e,t,r)=>{var o=r(2940);e.exports=o(once);e.exports.strict=o(onceStrict);once.proto=once((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return once(this)},configurable:true});Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return onceStrict(this)},configurable:true})}));function once(e){var f=function(){if(f.called)return f.value;f.called=true;return f.value=e.apply(this,arguments)};f.called=false;return f}function onceStrict(e){var f=function(){if(f.called)throw new Error(f.onceError);f.called=true;return f.value=e.apply(this,arguments)};var t=e.name||"Function wrapped with `once`";f.onceError=t+" shouldn't be called more than once";f.called=false;return f}},4824:(e,t,r)=>{"use strict";const o=r(2087);const s=r(7493);const n=r(3515);const osName=(e,t)=>{if(!e&&t){throw new Error("You can't specify a `release` without specifying `platform`")}e=e||o.platform();let r;if(e==="darwin"){if(!t&&o.platform()==="darwin"){t=o.release()}const e=t?Number(t.split(".")[0])>15?"macOS":"OS X":"macOS";r=t?s(t).name:"";return e+(r?" "+r:"")}if(e==="linux"){if(!t&&o.platform()==="linux"){t=o.release()}r=t?t.replace(/^(\d+\.\d+).*/,"$1"):"";return"Linux"+(r?" "+r:"")}if(e==="win32"){if(!t&&o.platform()==="win32"){t=o.release()}r=t?n(t):"";return"Windows"+(r?" "+r:"")}return e};e.exports=osName},1330:e=>{"use strict";e.exports=(e,t)=>{t=t||(()=>{});return e.then((e=>new Promise((e=>{e(t())})).then((()=>e))),(e=>new Promise((e=>{e(t())})).then((()=>{throw e}))))}},539:e=>{"use strict";e.exports=e=>{e=e||{};const t=e.env||process.env;const r=e.platform||process.platform;if(r!=="win32"){return"PATH"}return Object.keys(t).find((e=>e.toUpperCase()==="PATH"))||"Path"}},8341:(e,t,r)=>{var o=r(1223);var s=r(1205);var n=r(5747);var noop=function(){};var i=/^v?\.0/.test(process.version);var isFn=function(e){return typeof e==="function"};var isFS=function(e){if(!i)return false;if(!n)return false;return(e instanceof(n.ReadStream||noop)||e instanceof(n.WriteStream||noop))&&isFn(e.close)};var isRequest=function(e){return e.setHeader&&isFn(e.abort)};var destroyer=function(e,t,r,n){n=o(n);var i=false;e.on("close",(function(){i=true}));s(e,{readable:t,writable:r},(function(e){if(e)return n(e);i=true;n()}));var a=false;return function(t){if(i)return;if(a)return;a=true;if(isFS(e))return e.close(noop);if(isRequest(e))return e.abort();if(isFn(e.destroy))return e.destroy();n(t||new Error("stream was destroyed"))}};var call=function(e){e()};var pipe=function(e,t){return e.pipe(t)};var pump=function(){var e=Array.prototype.slice.call(arguments);var t=isFn(e[e.length-1]||noop)&&e.pop()||noop;if(Array.isArray(e[0]))e=e[0];if(e.length<2)throw new Error("pump requires two streams per minimum");var r;var o=e.map((function(s,n){var i=n0;return destroyer(s,i,a,(function(e){if(!r)r=e;if(e)o.forEach(call);if(i)return;o.forEach(call);t(r)}))}));return e.reduce(pipe)};e.exports=pump},7032:(e,t,r)=>{"use strict";const o=r(2638);e.exports=(e="")=>{const t=e.match(o);if(!t){return null}const[r,s]=t[0].replace(/#! ?/,"").split(" ");const n=r.split("/").pop();if(n==="env"){return s}return s?`${n} ${s}`:n}},2638:e=>{"use strict";e.exports=/^#!(.*)/},4931:(e,t,r)=>{var o=r(2357);var s=r(3710);var n=/^win/i.test(process.platform);var i=r(8614);if(typeof i!=="function"){i=i.EventEmitter}var a;if(process.__signal_exit_emitter__){a=process.__signal_exit_emitter__}else{a=process.__signal_exit_emitter__=new i;a.count=0;a.emitted={}}if(!a.infinite){a.setMaxListeners(Infinity);a.infinite=true}e.exports=function(e,t){o.equal(typeof e,"function","a callback must be provided for exit handler");if(u===false){load()}var r="exit";if(t&&t.alwaysLast){r="afterexit"}var remove=function(){a.removeListener(r,e);if(a.listeners("exit").length===0&&a.listeners("afterexit").length===0){unload()}};a.on(r,e);return remove};e.exports.unload=unload;function unload(){if(!u){return}u=false;s.forEach((function(e){try{process.removeListener(e,c[e])}catch(e){}}));process.emit=p;process.reallyExit=l;a.count-=1}function emit(e,t,r){if(a.emitted[e]){return}a.emitted[e]=true;a.emit(e,t,r)}var c={};s.forEach((function(e){c[e]=function listener(){var t=process.listeners(e);if(t.length===a.count){unload();emit("exit",null,e);emit("afterexit",null,e);if(n&&e==="SIGHUP"){e="SIGINT"}process.kill(process.pid,e)}}}));e.exports.signals=function(){return s};e.exports.load=load;var u=false;function load(){if(u){return}u=true;a.count+=1;s=s.filter((function(e){try{process.on(e,c[e]);return true}catch(e){return false}}));process.emit=processEmit;process.reallyExit=processReallyExit}var l=process.reallyExit;function processReallyExit(e){process.exitCode=e||0;emit("exit",process.exitCode,null);emit("afterexit",process.exitCode,null);l.call(process,process.exitCode)}var p=process.emit;function processEmit(e,t){if(e==="exit"){if(t!==undefined){process.exitCode=t}var r=p.apply(this,arguments);emit("exit",process.exitCode,null);emit("afterexit",process.exitCode,null);return r}else{return p.apply(this,arguments)}}},3710:e=>{e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32"){e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT")}if(process.platform==="linux"){e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}},5515:e=>{"use strict";e.exports=function(e){var t=typeof e==="string"?"\n":"\n".charCodeAt();var r=typeof e==="string"?"\r":"\r".charCodeAt();if(e[e.length-1]===t){e=e.slice(0,e.length-1)}if(e[e.length-1]===r){e=e.slice(0,e.length-1)}return e}},8174:e=>{"use strict";e.exports=e=>{const t=typeof e==="string"?"\n":"\n".charCodeAt();const r=typeof e==="string"?"\r":"\r".charCodeAt();if(e[e.length-1]===t){e=e.slice(0,e.length-1)}if(e[e.length-1]===r){e=e.slice(0,e.length-1)}return e}},9318:(e,t,r)=>{"use strict";const o=r(2087);const s=r(3867);const n=r(1621);const{env:i}=process;let a;if(n("no-color")||n("no-colors")||n("color=false")||n("color=never")){a=0}else if(n("color")||n("colors")||n("color=true")||n("color=always")){a=1}if("FORCE_COLOR"in i){if(i.FORCE_COLOR==="true"){a=1}else if(i.FORCE_COLOR==="false"){a=0}else{a=i.FORCE_COLOR.length===0?1:Math.min(parseInt(i.FORCE_COLOR,10),3)}}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e,t){if(a===0){return 0}if(n("color=16m")||n("color=full")||n("color=truecolor")){return 3}if(n("color=256")){return 2}if(e&&!t&&a===undefined){return 0}const r=a||0;if(i.TERM==="dumb"){return r}if(process.platform==="win32"){const e=o.release().split(".");if(Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in i){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in i))||i.CI_NAME==="codeship"){return 1}return r}if("TEAMCITY_VERSION"in i){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(i.TEAMCITY_VERSION)?1:0}if("GITHUB_ACTIONS"in i){return 1}if(i.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in i){const e=parseInt((i.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(i.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(i.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(i.TERM)){return 1}if("COLORTERM"in i){return 1}return r}function getSupportLevel(e){const t=supportsColor(e,e&&e.isTTY);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:translateLevel(supportsColor(true,s.isatty(1))),stderr:translateLevel(supportsColor(true,s.isatty(2)))}},4294:(e,t,r)=>{e.exports=r(4219)},4219:(e,t,r)=>{"use strict";var o=r(1631);var s=r(4016);var n=r(8605);var i=r(7211);var a=r(8614);var c=r(2357);var u=r(1669);t.httpOverHttp=httpOverHttp;t.httpsOverHttp=httpsOverHttp;t.httpOverHttps=httpOverHttps;t.httpsOverHttps=httpsOverHttps;function httpOverHttp(e){var t=new TunnelingAgent(e);t.request=n.request;return t}function httpsOverHttp(e){var t=new TunnelingAgent(e);t.request=n.request;t.createSocket=createSecureSocket;t.defaultPort=443;return t}function httpOverHttps(e){var t=new TunnelingAgent(e);t.request=i.request;return t}function httpsOverHttps(e){var t=new TunnelingAgent(e);t.request=i.request;t.createSocket=createSecureSocket;t.defaultPort=443;return t}function TunnelingAgent(e){var t=this;t.options=e||{};t.proxyOptions=t.options.proxy||{};t.maxSockets=t.options.maxSockets||n.Agent.defaultMaxSockets;t.requests=[];t.sockets=[];t.on("free",(function onFree(e,r,o,s){var n=toOptions(r,o,s);for(var i=0,a=t.requests.length;i=this.maxSockets){s.requests.push(n);return}s.createSocket(n,(function(t){t.on("free",onFree);t.on("close",onCloseOrRemove);t.on("agentRemove",onCloseOrRemove);e.onSocket(t);function onFree(){s.emit("free",t,n)}function onCloseOrRemove(e){s.removeSocket(t);t.removeListener("free",onFree);t.removeListener("close",onCloseOrRemove);t.removeListener("agentRemove",onCloseOrRemove)}}))};TunnelingAgent.prototype.createSocket=function createSocket(e,t){var r=this;var o={};r.sockets.push(o);var s=mergeOptions({},r.proxyOptions,{method:"CONNECT",path:e.host+":"+e.port,agent:false,headers:{host:e.host+":"+e.port}});if(e.localAddress){s.localAddress=e.localAddress}if(s.proxyAuth){s.headers=s.headers||{};s.headers["Proxy-Authorization"]="Basic "+new Buffer(s.proxyAuth).toString("base64")}l("making CONNECT request");var n=r.request(s);n.useChunkedEncodingByDefault=false;n.once("response",onResponse);n.once("upgrade",onUpgrade);n.once("connect",onConnect);n.once("error",onError);n.end();function onResponse(e){e.upgrade=true}function onUpgrade(e,t,r){process.nextTick((function(){onConnect(e,t,r)}))}function onConnect(s,i,a){n.removeAllListeners();i.removeAllListeners();if(s.statusCode!==200){l("tunneling socket could not be established, statusCode=%d",s.statusCode);i.destroy();var c=new Error("tunneling socket could not be established, "+"statusCode="+s.statusCode);c.code="ECONNRESET";e.request.emit("error",c);r.removeSocket(o);return}if(a.length>0){l("got illegal response body from proxy");i.destroy();var c=new Error("got illegal response body from proxy");c.code="ECONNRESET";e.request.emit("error",c);r.removeSocket(o);return}l("tunneling connection has established");r.sockets[r.sockets.indexOf(o)]=i;return t(i)}function onError(t){n.removeAllListeners();l("tunneling socket could not be established, cause=%s\n",t.message,t.stack);var s=new Error("tunneling socket could not be established, "+"cause="+t.message);s.code="ECONNRESET";e.request.emit("error",s);r.removeSocket(o)}};TunnelingAgent.prototype.removeSocket=function removeSocket(e){var t=this.sockets.indexOf(e);if(t===-1){return}this.sockets.splice(t,1);var r=this.requests.shift();if(r){this.createSocket(r,(function(e){r.request.onSocket(e)}))}};function createSecureSocket(e,t){var r=this;TunnelingAgent.prototype.createSocket.call(r,e,(function(o){var n=e.request.getHeader("host");var i=mergeOptions({},r.options,{socket:o,servername:n?n.replace(/:.*$/,""):e.host});var a=s.connect(0,i);r.sockets[r.sockets.indexOf(o)]=a;t(a)}))}function toOptions(e,t,r){if(typeof e==="string"){return{host:e,port:t,localAddress:r}}return e}function mergeOptions(e){for(var t=1,r=arguments.length;t{"use strict";Object.defineProperty(t,"__esModule",{value:true});function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var o=_interopDefault(r(4824));function getUserAgent(){try{return`Node.js/${process.version.substr(1)} (${o()}; ${process.arch})`}catch(e){if(/wmic os get Caption/.test(e.message)){return"Windows "}return""}}t.getUserAgent=getUserAgent},4207:(e,t,r)=>{const o=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys";const s=r(5622);const n=o?";":":";const i=r(7126);const getNotFoundError=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"});const getPathInfo=(e,t)=>{const r=t.colon||n;const s=e.match(/\//)||o&&e.match(/\\/)?[""]:[...o?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)];const i=o?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"";const a=o?i.split(r):[""];if(o){if(e.indexOf(".")!==-1&&a[0]!=="")a.unshift("")}return{pathEnv:s,pathExt:a,pathExtExe:i}};const which=(e,t,r)=>{if(typeof t==="function"){r=t;t={}}if(!t)t={};const{pathEnv:o,pathExt:n,pathExtExe:a}=getPathInfo(e,t);const c=[];const step=r=>new Promise(((n,i)=>{if(r===o.length)return t.all&&c.length?n(c):i(getNotFoundError(e));const a=o[r];const u=/^".*"$/.test(a)?a.slice(1,-1):a;const l=s.join(u,e);const p=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;n(subStep(p,r,0))}));const subStep=(e,r,o)=>new Promise(((s,u)=>{if(o===n.length)return s(step(r+1));const l=n[o];i(e+l,{pathExt:a},((n,i)=>{if(!n&&i){if(t.all)c.push(e+l);else return s(e+l)}return s(subStep(e,r,o+1))}))}));return r?step(0).then((e=>r(null,e)),r):step(0)};const whichSync=(e,t)=>{t=t||{};const{pathEnv:r,pathExt:o,pathExtExe:n}=getPathInfo(e,t);const a=[];for(let c=0;c{"use strict";const o=r(2087);const s=r(4780);const n=new Map([["10.0","10"],["6.3","8.1"],["6.2","8"],["6.1","7"],["6.0","Vista"],["5.2","Server 2003"],["5.1","XP"],["5.0","2000"],["4.9","ME"],["4.1","98"],["4.0","95"]]);const windowsRelease=e=>{const t=/\d+\.\d/.exec(e||o.release());if(e&&!t){throw new Error("`release` argument doesn't match `n.n`")}const r=(t||[])[0];if((!e||e===o.release())&&["6.1","6.2","6.3","10.0"].includes(r)){let e;try{e=s.sync("wmic",["os","get","Caption"]).stdout||""}catch(t){e=s.sync("powershell",["(Get-CimInstance -ClassName Win32_OperatingSystem).caption"]).stdout||""}const t=(e.match(/2008|2012|2016|2019/)||[])[0];if(t){return`Server ${t}`}}return n.get(r)};e.exports=windowsRelease},4780:(e,t,r)=>{"use strict";const o=r(5622);const s=r(3129);const n=r(2746);const i=r(5515);const a=r(2509);const c=r(2597);const u=r(2560);const l=r(1330);const p=r(4931);const d=r(2160);const m=r(7023);const g=1e3*1e3*10;function handleArgs(e,t,r){let s;r=Object.assign({extendEnv:true,env:{}},r);if(r.extendEnv){r.env=Object.assign({},process.env,r.env)}if(r.__winShell===true){delete r.__winShell;s={command:e,args:t,options:r,file:e,original:{cmd:e,args:t}}}else{s=n._parse(e,t,r)}r=Object.assign({maxBuffer:g,buffer:true,stripEof:true,preferLocal:true,localDir:s.options.cwd||process.cwd(),encoding:"utf8",reject:true,cleanup:true},s.options);r.stdio=m(r);if(r.preferLocal){r.env=a.env(Object.assign({},r,{cwd:r.localDir}))}if(r.detached){r.cleanup=false}if(process.platform==="win32"&&o.basename(s.command)==="cmd.exe"){s.args.unshift("/q")}return{cmd:s.command,args:s.args,opts:r,parsed:s}}function handleInput(e,t){if(t===null||t===undefined){return}if(c(t)){t.pipe(e.stdin)}else{e.stdin.end(t)}}function handleOutput(e,t){if(t&&e.stripEof){t=i(t)}return t}function handleShell(e,t,r){let o="/bin/sh";let s=["-c",t];r=Object.assign({},r);if(process.platform==="win32"){r.__winShell=true;o=process.env.comspec||"cmd.exe";s=["/s","/c",`"${t}"`];r.windowsVerbatimArguments=true}if(r.shell){o=r.shell;delete r.shell}return e(o,s,r)}function getStream(e,t,{encoding:r,buffer:o,maxBuffer:s}){if(!e[t]){return null}let n;if(!o){n=new Promise(((r,o)=>{e[t].once("end",r).once("error",o)}))}else if(r){n=u(e[t],{encoding:r,maxBuffer:s})}else{n=u.buffer(e[t],{maxBuffer:s})}return n.catch((e=>{e.stream=t;e.message=`${t} ${e.message}`;throw e}))}function makeError(e,t){const{stdout:r,stderr:o}=e;let s=e.error;const{code:n,signal:i}=e;const{parsed:a,joinedCmd:c}=t;const u=t.timedOut||false;if(!s){let e="";if(Array.isArray(a.opts.stdio)){if(a.opts.stdio[2]!=="inherit"){e+=e.length>0?o:`\n${o}`}if(a.opts.stdio[1]!=="inherit"){e+=`\n${r}`}}else if(a.opts.stdio!=="inherit"){e=`\n${o}${r}`}s=new Error(`Command failed: ${c}${e}`);s.code=n<0?d(n):n}s.stdout=r;s.stderr=o;s.failed=true;s.signal=i||null;s.cmd=c;s.timedOut=u;return s}function joinCmd(e,t){let r=e;if(Array.isArray(t)&&t.length>0){r+=" "+t.join(" ")}return r}e.exports=(e,t,r)=>{const o=handleArgs(e,t,r);const{encoding:i,buffer:a,maxBuffer:c}=o.opts;const u=joinCmd(e,t);let d;try{d=s.spawn(o.cmd,o.args,o.opts)}catch(e){return Promise.reject(e)}let m;if(o.opts.cleanup){m=p((()=>{d.kill()}))}let g=null;let h=false;const cleanup=()=>{if(g){clearTimeout(g);g=null}if(m){m()}};if(o.opts.timeout>0){g=setTimeout((()=>{g=null;h=true;d.kill(o.opts.killSignal)}),o.opts.timeout)}const b=new Promise((e=>{d.on("exit",((t,r)=>{cleanup();e({code:t,signal:r})}));d.on("error",(t=>{cleanup();e({error:t})}));if(d.stdin){d.stdin.on("error",(t=>{cleanup();e({error:t})}))}}));function destroy(){if(d.stdout){d.stdout.destroy()}if(d.stderr){d.stderr.destroy()}}const handlePromise=()=>l(Promise.all([b,getStream(d,"stdout",{encoding:i,buffer:a,maxBuffer:c}),getStream(d,"stderr",{encoding:i,buffer:a,maxBuffer:c})]).then((e=>{const t=e[0];t.stdout=e[1];t.stderr=e[2];if(t.error||t.code!==0||t.signal!==null){const e=makeError(t,{joinedCmd:u,parsed:o,timedOut:h});e.killed=e.killed||d.killed;if(!o.opts.reject){return e}throw e}return{stdout:handleOutput(o.opts,t.stdout),stderr:handleOutput(o.opts,t.stderr),code:0,failed:false,killed:false,signal:null,cmd:u,timedOut:false}})),destroy);n._enoent.hookChildProcess(d,o.parsed);handleInput(d,o.opts.input);d.then=(e,t)=>handlePromise().then(e,t);d.catch=e=>handlePromise().catch(e);return d};e.exports.stdout=(...t)=>e.exports(...t).then((e=>e.stdout));e.exports.stderr=(...t)=>e.exports(...t).then((e=>e.stderr));e.exports.shell=(t,r)=>handleShell(e.exports,t,r);e.exports.sync=(e,t,r)=>{const o=handleArgs(e,t,r);const n=joinCmd(e,t);if(c(o.opts.input)){throw new TypeError("The `input` option cannot be a stream in sync mode")}const i=s.spawnSync(o.cmd,o.args,o.opts);i.code=i.status;if(i.error||i.status!==0||i.signal!==null){const e=makeError(i,{joinedCmd:n,parsed:o});if(!o.opts.reject){return e}throw e}return{stdout:handleOutput(o.opts,i.stdout),stderr:handleOutput(o.opts,i.stderr),code:0,failed:false,signal:null,cmd:n,timedOut:false}};e.exports.shellSync=(t,r)=>handleShell(e.exports.sync,t,r)},2160:(e,t,r)=>{"use strict";const o=r(1669);let s;if(typeof o.getSystemErrorName==="function"){e.exports=o.getSystemErrorName}else{try{s=process.binding("uv");if(typeof s.errname!=="function"){throw new TypeError("uv.errname is not a function")}}catch(e){console.error("execa/lib/errname: unable to establish process.binding('uv')",e);s=null}e.exports=e=>errname(s,e)}e.exports.__test__=errname;function errname(e,t){if(e){return e.errname(t)}if(!(t<0)){throw new Error("err >= 0")}return`Unknown system error ${t}`}},7023:e=>{"use strict";const t=["stdin","stdout","stderr"];const hasAlias=e=>t.some((t=>Boolean(e[t])));e.exports=e=>{if(!e){return null}if(e.stdio&&hasAlias(e)){throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${t.map((e=>`\`${e}\``)).join(", ")}`)}if(typeof e.stdio==="string"){return e.stdio}const r=e.stdio||[];if(!Array.isArray(r)){throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof r}\``)}const o=[];const s=Math.max(r.length,t.length);for(let n=0;n{"use strict";const{PassThrough:o}=r(2413);e.exports=e=>{e=Object.assign({},e);const{array:t}=e;let{encoding:r}=e;const s=r==="buffer";let n=false;if(t){n=!(r||s)}else{r=r||"utf8"}if(s){r=null}let i=0;const a=[];const c=new o({objectMode:n});if(r){c.setEncoding(r)}c.on("data",(e=>{a.push(e);if(n){i=a.length}else{i+=e.length}}));c.getBufferedValue=()=>{if(t){return a}return s?Buffer.concat(a,i):a.join("")};c.getBufferedLength=()=>i;return c}},2560:(e,t,r)=>{"use strict";const o=r(8341);const s=r(9286);class MaxBufferError extends Error{constructor(){super("maxBuffer exceeded");this.name="MaxBufferError"}}function getStream(e,t){if(!e){return Promise.reject(new Error("Expected a stream"))}t=Object.assign({maxBuffer:Infinity},t);const{maxBuffer:r}=t;let n;return new Promise(((i,a)=>{const rejectPromise=e=>{if(e){e.bufferedData=n.getBufferedValue()}a(e)};n=o(e,s(t),(e=>{if(e){rejectPromise(e);return}i()}));n.on("data",(()=>{if(n.getBufferedLength()>r){rejectPromise(new MaxBufferError)}}))})).then((()=>n.getBufferedValue()))}e.exports=getStream;e.exports.buffer=(e,t)=>getStream(e,Object.assign({},t,{encoding:"buffer"}));e.exports.array=(e,t)=>getStream(e,Object.assign({},t,{array:true}));e.exports.MaxBufferError=MaxBufferError},2597:e=>{"use strict";var t=e.exports=function(e){return e!==null&&typeof e==="object"&&typeof e.pipe==="function"};t.writable=function(e){return t(e)&&e.writable!==false&&typeof e._write==="function"&&typeof e._writableState==="object"};t.readable=function(e){return t(e)&&e.readable!==false&&typeof e._read==="function"&&typeof e._readableState==="object"};t.duplex=function(e){return t.writable(e)&&t.readable(e)};t.transform=function(e){return t.duplex(e)&&typeof e._transform==="function"&&typeof e._transformState==="object"}},2509:(e,t,r)=>{"use strict";const o=r(5622);const s=r(539);e.exports=e=>{e=Object.assign({cwd:process.cwd(),path:process.env[s()]},e);let t;let r=o.resolve(e.cwd);const n=[];while(t!==r){n.push(o.join(r,"node_modules/.bin"));t=r;r=o.resolve(r,"..")}n.push(o.dirname(process.execPath));return n.concat(e.path).join(o.delimiter)};e.exports.env=t=>{t=Object.assign({env:process.env},t);const r=Object.assign({},t.env);const o=s({env:r});t.path=r[o];r[o]=e.exports(t);return r}},2940:e=>{e.exports=wrappy;function wrappy(e,t){if(e&&t)return wrappy(e)(t);if(typeof e!=="function")throw new TypeError("need wrapper function");Object.keys(e).forEach((function(t){wrapper[t]=e[t]}));return wrapper;function wrapper(){var t=new Array(arguments.length);for(var r=0;r{module.exports=eval("require")("encoding")},2357:e=>{"use strict";e.exports=require("assert")},4293:e=>{"use strict";e.exports=require("buffer")},3129:e=>{"use strict";e.exports=require("child_process")},8614:e=>{"use strict";e.exports=require("events")},5747:e=>{"use strict";e.exports=require("fs")},8605:e=>{"use strict";e.exports=require("http")},7211:e=>{"use strict";e.exports=require("https")},1631:e=>{"use strict";e.exports=require("net")},2087:e=>{"use strict";e.exports=require("os")},5622:e=>{"use strict";e.exports=require("path")},2413:e=>{"use strict";e.exports=require("stream")},4016:e=>{"use strict";e.exports=require("tls")},3867:e=>{"use strict";e.exports=require("tty")},8835:e=>{"use strict";e.exports=require("url")},1669:e=>{"use strict";e.exports=require("util")},8761:e=>{"use strict";e.exports=require("zlib")}};var __webpack_module_cache__={};function __nccwpck_require__(e){var t=__webpack_module_cache__[e];if(t!==undefined){return t.exports}var r=__webpack_module_cache__[e]={exports:{}};var o=true;try{__webpack_modules__[e].call(r.exports,r,r.exports,__nccwpck_require__);o=false}finally{if(o)delete __webpack_module_cache__[e]}return r.exports}(()=>{__nccwpck_require__.n=e=>{var t=e&&e.__esModule?()=>e["default"]:()=>e;__nccwpck_require__.d(t,{a:t});return t}})();(()=>{__nccwpck_require__.d=(e,t)=>{for(var r in t){if(__nccwpck_require__.o(t,r)&&!__nccwpck_require__.o(e,r)){Object.defineProperty(e,r,{enumerable:true,get:t[r]})}}}})();(()=>{__nccwpck_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})();(()=>{__nccwpck_require__.r=e=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var __webpack_exports__={};(()=>{"use strict";__nccwpck_require__.r(__webpack_exports__);var e=__nccwpck_require__(2186);var t=__nccwpck_require__(5438);var r=__nccwpck_require__(1231);var o=__nccwpck_require__(1669);var s=__nccwpck_require__(8237);var n=__nccwpck_require__.n(s);const i=n()("apollo-schema-check");const isGitHubActions=()=>!!process.env.GITHUB_WORKSPACE;const debug=(...t)=>{if(isGitHubActions()){for(const r of t){(0,e.debug)((0,o.inspect)(r))}}else{i(t)}};const getCommentIdentifier=()=>{const t=(0,e.getInput)("config");const r=(0,e.getInput)("graph");const o=(0,e.getInput)("variant");const s=(0,e.getInput)("title");if(s){return`\x3c!-- apolloSchemaCheckAction name: ${s} --\x3e`}else if(t){return`\x3c!-- apolloSchemaCheckAction config: ${t} --\x3e`}else if(r&&o){return`\x3c!-- apolloSchemaCheckAction graph: ${r}@${o} --\x3e`}else if(r){return`\x3c!-- apolloSchemaCheckAction graph: ${r} --\x3e`}else if(o){return`\x3c!-- apolloSchemaCheckAction variant: ${o} --\x3e`}else{return`\x3c!-- apolloSchemaCheckAction --\x3e`}};var a=__nccwpck_require__(5447);var c=__nccwpck_require__.n(a);const getArguments=()=>{const t={config:(0,e.getInput)("config"),graph:(0,e.getInput)("graph"),variant:(0,e.getInput)("variant"),endpoint:(0,e.getInput)("endpoint"),header:(0,e.getInput)("header"),key:(0,e.getInput)("key"),localSchemaFile:(0,e.getInput)("localSchemaFile"),queryCountThreshold:(0,e.getInput)("queryCountThreshold"),queryCountThresholdPercentage:(0,e.getInput)("queryCountThresholdPercentage"),serviceName:(0,e.getInput)("serviceName"),validationPeriod:(0,e.getInput)("validationPeriod")};const r=[];debug("token",!!process.env.GITHUB_TOKEN);if(t.graph&&!t.key){throw new Error("You must provide an Apollo key")}if(!t.config&&!t.graph){throw new Error("You must provide either a config file or a graph name")}for(const[e,o]of Object.entries(t)){if(e==="header"&&o){const e=o.split(",");for(const t of e){r.push(`--header='${t.trim()}'`)}}else if(o){r.push(`--${e}=${o}`)}}r.push("--markdown");return r};const formatMessage=(t,r)=>{const o=t.indexOf("###");const s=(0,e.getInput)("title");const n=(0,e.getInput)("alwaysComment");const i=(0,e.getInput)("failOnError");if(o===-1){throw new Error("Error running Apollo CLI")}if(n!=="true"&&t.includes("null operations")){debug("alwaysComment is false and number of operations is null");debug("output",t);return}if(!r&&n!=="true"&&/\s0 schema changes/.test(t)){debug("existingComment is false, alwaysComment is false and there are zero schema changes");debug("output",t);return}let a=t.slice(o);if(i&&/\d+ breaking change/.test(a)){debug("Breaking changes found");debug("message",a);(0,e.setFailed)("Breaking changes found")}else if(i&&/\d+ composition error/.test(a)){debug("Composition errors found");debug("message",a);(0,e.setFailed)("Composition errors found")}if(s){a=a.replace("### Apollo Service Check\n",`### Apollo Schema Check\n#### ${s}\n`)}else{a=a.replace("### Apollo Service Check",`### Apollo Schema Check`)}debug("message",a);return a};var u=undefined&&undefined.__awaiter||function(e,t,r,o){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,s){function fulfilled(e){try{step(o.next(e))}catch(e){s(e)}}function rejected(e){try{step(o["throw"](e))}catch(e){s(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((o=o.apply(e,t||[])).next())}))};const getMessage=(e,t)=>u(void 0,void 0,void 0,(function*(){const r=getArguments();if(t){debug("existing comment found")}const o=r.map((e=>e.startsWith("--key")?e.replace(/:[^:]+$/,"***"):e));console.log("Apollo CLI command",["npx","apollo@2.33.6","schema:check",...o].join(" "));try{const o=(yield c()("npx",["apollo@2.33.6","schema:check",...r])).stdout;console.log(o);const s=formatMessage(o,t);if(s){return`${s}\n\n${e}`}else{return}}catch(r){if(r.exitCode!==1){console.error(`Apollo CLI error: exit code ${r.exitCode}`,r);throw new Error("Error running Apollo CLI")}else{console.log(r.stdout);const o=formatMessage(r.stdout,t);if(o){return`${o}\n\n${e}`}else{return}}}}));var l=undefined&&undefined.__awaiter||function(e,t,r,o){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,s){function fulfilled(e){try{step(o.next(e))}catch(e){s(e)}}function rejected(e){try{step(o["throw"](e))}catch(e){s(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((o=o.apply(e,t||[])).next())}))};const run=()=>l(void 0,void 0,void 0,(function*(){if(!isGitHubActions()){console.log(yield getMessage(getCommentIdentifier(),false));return}try{if(t.context.payload.pull_request==null){(0,e.setFailed)("No pull request found");return}const o=process.env.GITHUB_REPOSITORY;if(!o){(0,e.setFailed)("No repo found");return}const s=getCommentIdentifier();const[n,i]=o.split("/");const a=t.context.payload.pull_request.number;const c=new r.v;const u=yield c.issues.listComments({owner:n,repo:i,issue_number:a});const l=u.data.find((e=>{var t;return(t=e===null||e===void 0?void 0:e.body)===null||t===void 0?void 0:t.includes(s)}));const p=yield getMessage(s,!!l);if(p){if(l){c.issues.updateComment(Object.assign(Object.assign({},t.context.repo),{comment_id:l.id,body:p}))}else{c.issues.createComment(Object.assign(Object.assign({},t.context.repo),{issue_number:a,body:p}))}}}catch(t){(0,e.setFailed)(t.message)}}));run()})();module.exports=__webpack_exports__})(); \ No newline at end of file + */e.exports=function isObject(e){return e!=null&&typeof e==="object"&&Array.isArray(e)===false}},7493:(e,t,r)=>{"use strict";const o=r(2087);const s=new Map([[19,"Catalina"],[18,"Mojave"],[17,"High Sierra"],[16,"Sierra"],[15,"El Capitan"],[14,"Yosemite"],[13,"Mavericks"],[12,"Mountain Lion"],[11,"Lion"],[10,"Snow Leopard"],[9,"Leopard"],[8,"Tiger"],[7,"Panther"],[6,"Jaguar"],[5,"Puma"]]);const macosRelease=e=>{e=Number((e||o.release()).split(".")[0]);return{name:s.get(e),version:"10."+(e-4)}};e.exports=macosRelease;e.exports.default=macosRelease},2621:(e,t,r)=>{"use strict";const{PassThrough:o}=r(2413);e.exports=function(){var e=[];var t=new o({objectMode:true});t.setMaxListeners(0);t.add=add;t.isEmpty=isEmpty;t.on("unpipe",remove);Array.prototype.slice.call(arguments).forEach(add);return t;function add(r){if(Array.isArray(r)){r.forEach(add);return this}e.push(r);r.once("end",remove.bind(null,r));r.once("error",t.emit.bind(t,"error"));r.pipe(t,{end:false});return this}function isEmpty(){return e.length==0}function remove(r){e=e.filter((function(e){return e!==r}));if(!e.length&&t.readable){t.end()}}}},6047:e=>{"use strict";const mimicFn=(e,t)=>{for(const r of Reflect.ownKeys(t)){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}return e};e.exports=mimicFn;e.exports.default=mimicFn},900:e=>{var t=1e3;var r=t*60;var o=r*60;var s=o*24;var n=s*7;var i=s*365.25;e.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0){return parse(e)}else if(r==="number"&&isFinite(e)){return t.long?fmtLong(e):fmtShort(e)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function parse(e){e=String(e);if(e.length>100){return}var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!a){return}var c=parseFloat(a[1]);var u=(a[2]||"ms").toLowerCase();switch(u){case"years":case"year":case"yrs":case"yr":case"y":return c*i;case"weeks":case"week":case"w":return c*n;case"days":case"day":case"d":return c*s;case"hours":case"hour":case"hrs":case"hr":case"h":return c*o;case"minutes":case"minute":case"mins":case"min":case"m":return c*r;case"seconds":case"second":case"secs":case"sec":case"s":return c*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return undefined}}function fmtShort(e){var n=Math.abs(e);if(n>=s){return Math.round(e/s)+"d"}if(n>=o){return Math.round(e/o)+"h"}if(n>=r){return Math.round(e/r)+"m"}if(n>=t){return Math.round(e/t)+"s"}return e+"ms"}function fmtLong(e){var n=Math.abs(e);if(n>=s){return plural(e,n,s,"day")}if(n>=o){return plural(e,n,o,"hour")}if(n>=r){return plural(e,n,r,"minute")}if(n>=t){return plural(e,n,t,"second")}return e+" ms"}function plural(e,t,r,o){var s=t>=r*1.5;return Math.round(e/r)+" "+o+(s?"s":"")}},467:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var o=_interopDefault(r(2413));var s=_interopDefault(r(8605));var n=_interopDefault(r(8835));var i=_interopDefault(r(7211));var a=_interopDefault(r(8761));const c=o.Readable;const u=Symbol("buffer");const l=Symbol("type");class Blob{constructor(){this[l]="";const e=arguments[0];const t=arguments[1];const r=[];let o=0;if(e){const t=e;const s=Number(t.length);for(let e=0;e1&&arguments[1]!==undefined?arguments[1]:{},s=r.size;let n=s===undefined?0:s;var i=r.timeout;let a=i===undefined?0:i;if(e==null){e=null}else if(isURLSearchParams(e)){e=Buffer.from(e.toString())}else if(isBlob(e));else if(Buffer.isBuffer(e));else if(Object.prototype.toString.call(e)==="[object ArrayBuffer]"){e=Buffer.from(e)}else if(ArrayBuffer.isView(e)){e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)}else if(e instanceof o);else{e=Buffer.from(String(e))}this[d]={body:e,disturbed:false,error:null};this.size=n;this.timeout=a;if(e instanceof o){e.on("error",(function(e){const r=e.name==="AbortError"?e:new FetchError(`Invalid response body while trying to fetch ${t.url}: ${e.message}`,"system",e);t[d].error=r}))}}Body.prototype={get body(){return this[d].body},get bodyUsed(){return this[d].disturbed},arrayBuffer(){return consumeBody.call(this).then((function(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}))},blob(){let e=this.headers&&this.headers.get("content-type")||"";return consumeBody.call(this).then((function(t){return Object.assign(new Blob([],{type:e.toLowerCase()}),{[u]:t})}))},json(){var e=this;return consumeBody.call(this).then((function(t){try{return JSON.parse(t.toString())}catch(t){return Body.Promise.reject(new FetchError(`invalid json response body at ${e.url} reason: ${t.message}`,"invalid-json"))}}))},text(){return consumeBody.call(this).then((function(e){return e.toString()}))},buffer(){return consumeBody.call(this)},textConverted(){var e=this;return consumeBody.call(this).then((function(t){return convertBody(t,e.headers)}))}};Object.defineProperties(Body.prototype,{body:{enumerable:true},bodyUsed:{enumerable:true},arrayBuffer:{enumerable:true},blob:{enumerable:true},json:{enumerable:true},text:{enumerable:true}});Body.mixIn=function(e){for(const t of Object.getOwnPropertyNames(Body.prototype)){if(!(t in e)){const r=Object.getOwnPropertyDescriptor(Body.prototype,t);Object.defineProperty(e,t,r)}}};function consumeBody(){var e=this;if(this[d].disturbed){return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`))}this[d].disturbed=true;if(this[d].error){return Body.Promise.reject(this[d].error)}let t=this.body;if(t===null){return Body.Promise.resolve(Buffer.alloc(0))}if(isBlob(t)){t=t.stream()}if(Buffer.isBuffer(t)){return Body.Promise.resolve(t)}if(!(t instanceof o)){return Body.Promise.resolve(Buffer.alloc(0))}let r=[];let s=0;let n=false;return new Body.Promise((function(o,i){let a;if(e.timeout){a=setTimeout((function(){n=true;i(new FetchError(`Response timeout while trying to fetch ${e.url} (over ${e.timeout}ms)`,"body-timeout"))}),e.timeout)}t.on("error",(function(t){if(t.name==="AbortError"){n=true;i(t)}else{i(new FetchError(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,"system",t))}}));t.on("data",(function(t){if(n||t===null){return}if(e.size&&s+t.length>e.size){n=true;i(new FetchError(`content size at ${e.url} over limit: ${e.size}`,"max-size"));return}s+=t.length;r.push(t)}));t.on("end",(function(){if(n){return}clearTimeout(a);try{o(Buffer.concat(r,s))}catch(t){i(new FetchError(`Could not create Buffer from response body for ${e.url}: ${t.message}`,"system",t))}}))}))}function convertBody(e,t){if(typeof p!=="function"){throw new Error("The package `encoding` must be installed to use the textConverted() function")}const r=t.get("content-type");let o="utf-8";let s,n;if(r){s=/charset=([^;]*)/i.exec(r)}n=e.slice(0,1024).toString();if(!s&&n){s=/0&&arguments[0]!==undefined?arguments[0]:undefined;this[b]=Object.create(null);if(e instanceof Headers){const t=e.raw();const r=Object.keys(t);for(const e of r){for(const r of t[e]){this.append(e,r)}}return}if(e==null);else if(typeof e==="object"){const t=e[Symbol.iterator];if(t!=null){if(typeof t!=="function"){throw new TypeError("Header pairs must be iterable")}const r=[];for(const t of e){if(typeof t!=="object"||typeof t[Symbol.iterator]!=="function"){throw new TypeError("Each header pair must be iterable")}r.push(Array.from(t))}for(const e of r){if(e.length!==2){throw new TypeError("Each header pair must be a name/value tuple")}this.append(e[0],e[1])}}else{for(const t of Object.keys(e)){const r=e[t];this.append(t,r)}}}else{throw new TypeError("Provided initializer must be an object")}}get(e){e=`${e}`;validateName(e);const t=find(this[b],e);if(t===undefined){return null}return this[b][t].join(", ")}forEach(e){let t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:undefined;let r=getHeaders(this);let o=0;while(o1&&arguments[1]!==undefined?arguments[1]:"key+value";const r=Object.keys(e[b]).sort();return r.map(t==="key"?function(e){return e.toLowerCase()}:t==="value"?function(t){return e[b][t].join(", ")}:function(t){return[t.toLowerCase(),e[b][t].join(", ")]})}const T=Symbol("internal");function createHeadersIterator(e,t){const r=Object.create(E);r[T]={target:e,kind:t,index:0};return r}const E=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==E){throw new TypeError("Value of `this` is not a HeadersIterator")}var e=this[T];const t=e.target,r=e.kind,o=e.index;const s=getHeaders(t,r);const n=s.length;if(o>=n){return{value:undefined,done:true}}this[T].index=o+1;return{value:s[o],done:false}}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));Object.defineProperty(E,Symbol.toStringTag,{value:"HeadersIterator",writable:false,enumerable:false,configurable:true});function exportNodeCompatibleHeaders(e){const t=Object.assign({__proto__:null},e[b]);const r=find(e[b],"Host");if(r!==undefined){t[r]=t[r][0]}return t}function createHeadersLenient(e){const t=new Headers;for(const r of Object.keys(e)){if(g.test(r)){continue}if(Array.isArray(e[r])){for(const o of e[r]){if(h.test(o)){continue}if(t[b][r]===undefined){t[b][r]=[o]}else{t[b][r].push(o)}}}else if(!h.test(e[r])){t[b][r]=[e[r]]}}return t}const w=Symbol("Response internals");const y=s.STATUS_CODES;class Response{constructor(){let e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;let t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};Body.call(this,e,t);const r=t.status||200;const o=new Headers(t.headers);if(e!=null&&!o.has("Content-Type")){const t=extractContentType(e);if(t){o.append("Content-Type",t)}}this[w]={url:t.url,status:r,statusText:t.statusText||y[r],headers:o,counter:t.counter}}get url(){return this[w].url||""}get status(){return this[w].status}get ok(){return this[w].status>=200&&this[w].status<300}get redirected(){return this[w].counter>0}get statusText(){return this[w].statusText}get headers(){return this[w].headers}clone(){return new Response(clone(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}Body.mixIn(Response.prototype);Object.defineProperties(Response.prototype,{url:{enumerable:true},status:{enumerable:true},ok:{enumerable:true},redirected:{enumerable:true},statusText:{enumerable:true},headers:{enumerable:true},clone:{enumerable:true}});Object.defineProperty(Response.prototype,Symbol.toStringTag,{value:"Response",writable:false,enumerable:false,configurable:true});const v=Symbol("Request internals");const _=n.parse;const O=n.format;const k="destroy"in o.Readable.prototype;function isRequest(e){return typeof e==="object"&&typeof e[v]==="object"}function isAbortSignal(e){const t=e&&typeof e==="object"&&Object.getPrototypeOf(e);return!!(t&&t.constructor.name==="AbortSignal")}class Request{constructor(e){let t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};let r;if(!isRequest(e)){if(e&&e.href){r=_(e.href)}else{r=_(`${e}`)}e={}}else{r=_(e.url)}let o=t.method||e.method||"GET";o=o.toUpperCase();if((t.body!=null||isRequest(e)&&e.body!==null)&&(o==="GET"||o==="HEAD")){throw new TypeError("Request with GET/HEAD method cannot have body")}let s=t.body!=null?t.body:isRequest(e)&&e.body!==null?clone(e):null;Body.call(this,s,{timeout:t.timeout||e.timeout||0,size:t.size||e.size||0});const n=new Headers(t.headers||e.headers||{});if(s!=null&&!n.has("Content-Type")){const e=extractContentType(s);if(e){n.append("Content-Type",e)}}let i=isRequest(e)?e.signal:null;if("signal"in t)i=t.signal;if(i!=null&&!isAbortSignal(i)){throw new TypeError("Expected signal to be an instanceof AbortSignal")}this[v]={method:o,redirect:t.redirect||e.redirect||"follow",headers:n,parsedURL:r,signal:i};this.follow=t.follow!==undefined?t.follow:e.follow!==undefined?e.follow:20;this.compress=t.compress!==undefined?t.compress:e.compress!==undefined?e.compress:true;this.counter=t.counter||e.counter||0;this.agent=t.agent||e.agent}get method(){return this[v].method}get url(){return O(this[v].parsedURL)}get headers(){return this[v].headers}get redirect(){return this[v].redirect}get signal(){return this[v].signal}clone(){return new Request(this)}}Body.mixIn(Request.prototype);Object.defineProperty(Request.prototype,Symbol.toStringTag,{value:"Request",writable:false,enumerable:false,configurable:true});Object.defineProperties(Request.prototype,{method:{enumerable:true},url:{enumerable:true},headers:{enumerable:true},redirect:{enumerable:true},clone:{enumerable:true},signal:{enumerable:true}});function getNodeRequestOptions(e){const t=e[v].parsedURL;const r=new Headers(e[v].headers);if(!r.has("Accept")){r.set("Accept","*/*")}if(!t.protocol||!t.hostname){throw new TypeError("Only absolute URLs are supported")}if(!/^https?:$/.test(t.protocol)){throw new TypeError("Only HTTP(S) protocols are supported")}if(e.signal&&e.body instanceof o.Readable&&!k){throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8")}let s=null;if(e.body==null&&/^(POST|PUT)$/i.test(e.method)){s="0"}if(e.body!=null){const t=getTotalBytes(e);if(typeof t==="number"){s=String(t)}}if(s){r.set("Content-Length",s)}if(!r.has("User-Agent")){r.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)")}if(e.compress&&!r.has("Accept-Encoding")){r.set("Accept-Encoding","gzip,deflate")}let n=e.agent;if(typeof n==="function"){n=n(t)}if(!r.has("Connection")&&!n){r.set("Connection","close")}return Object.assign({},t,{method:e.method,headers:exportNodeCompatibleHeaders(r),agent:n})}function AbortError(e){Error.call(this,e);this.type="aborted";this.message=e;Error.captureStackTrace(this,this.constructor)}AbortError.prototype=Object.create(Error.prototype);AbortError.prototype.constructor=AbortError;AbortError.prototype.name="AbortError";const G=o.PassThrough;const P=n.resolve;function fetch(e,t){if(!fetch.Promise){throw new Error("native promise missing, set fetch.Promise to your favorite alternative")}Body.Promise=fetch.Promise;return new fetch.Promise((function(r,n){const c=new Request(e,t);const u=getNodeRequestOptions(c);const l=(u.protocol==="https:"?i:s).request;const p=c.signal;let d=null;const m=function abort(){let e=new AbortError("The user aborted a request.");n(e);if(c.body&&c.body instanceof o.Readable){c.body.destroy(e)}if(!d||!d.body)return;d.body.emit("error",e)};if(p&&p.aborted){m();return}const g=function abortAndFinalize(){m();finalize()};const h=l(u);let b;if(p){p.addEventListener("abort",g)}function finalize(){h.abort();if(p)p.removeEventListener("abort",g);clearTimeout(b)}if(c.timeout){h.once("socket",(function(e){b=setTimeout((function(){n(new FetchError(`network timeout at: ${c.url}`,"request-timeout"));finalize()}),c.timeout)}))}h.on("error",(function(e){n(new FetchError(`request to ${c.url} failed, reason: ${e.message}`,"system",e));finalize()}));h.on("response",(function(e){clearTimeout(b);const t=createHeadersLenient(e.headers);if(fetch.isRedirect(e.statusCode)){const o=t.get("Location");const s=o===null?null:P(c.url,o);switch(c.redirect){case"error":n(new FetchError(`redirect mode is set to error: ${c.url}`,"no-redirect"));finalize();return;case"manual":if(s!==null){try{t.set("Location",s)}catch(e){n(e)}}break;case"follow":if(s===null){break}if(c.counter>=c.follow){n(new FetchError(`maximum redirect reached at: ${c.url}`,"max-redirect"));finalize();return}const o={headers:new Headers(c.headers),follow:c.follow,counter:c.counter+1,agent:c.agent,compress:c.compress,method:c.method,body:c.body,signal:c.signal,timeout:c.timeout};if(e.statusCode!==303&&c.body&&getTotalBytes(c)===null){n(new FetchError("Cannot follow redirect with body being a readable stream","unsupported-redirect"));finalize();return}if(e.statusCode===303||(e.statusCode===301||e.statusCode===302)&&c.method==="POST"){o.method="GET";o.body=undefined;o.headers.delete("content-length")}r(fetch(new Request(s,o)));finalize();return}}e.once("end",(function(){if(p)p.removeEventListener("abort",g)}));let o=e.pipe(new G);const s={url:c.url,status:e.statusCode,statusText:e.statusMessage,headers:t,size:c.size,timeout:c.timeout,counter:c.counter};const i=t.get("Content-Encoding");if(!c.compress||c.method==="HEAD"||i===null||e.statusCode===204||e.statusCode===304){d=new Response(o,s);r(d);return}const u={flush:a.Z_SYNC_FLUSH,finishFlush:a.Z_SYNC_FLUSH};if(i=="gzip"||i=="x-gzip"){o=o.pipe(a.createGunzip(u));d=new Response(o,s);r(d);return}if(i=="deflate"||i=="x-deflate"){const t=e.pipe(new G);t.once("data",(function(e){if((e[0]&15)===8){o=o.pipe(a.createInflate())}else{o=o.pipe(a.createInflateRaw())}d=new Response(o,s);r(d)}));return}if(i=="br"&&typeof a.createBrotliDecompress==="function"){o=o.pipe(a.createBrotliDecompress());d=new Response(o,s);r(d);return}d=new Response(o,s);r(d)}));writeToStream(h,c)}))}fetch.isRedirect=function(e){return e===301||e===302||e===303||e===307||e===308};fetch.Promise=global.Promise;e.exports=t=fetch;Object.defineProperty(t,"__esModule",{value:true});t.default=t;t.Headers=Headers;t.Request=Request;t.Response=Response;t.FetchError=FetchError},502:(e,t,r)=>{"use strict";const o=r(5622);const s=r(7278);const npmRunPath=e=>{e={cwd:process.cwd(),path:process.env[s()],execPath:process.execPath,...e};let t;let r=o.resolve(e.cwd);const n=[];while(t!==r){n.push(o.join(r,"node_modules/.bin"));t=r;r=o.resolve(r,"..")}const i=o.resolve(e.cwd,e.execPath,"..");n.push(i);return n.concat(e.path).join(o.delimiter)};e.exports=npmRunPath;e.exports.default=npmRunPath;e.exports.env=t=>{t={env:process.env,...t};const r={...t.env};const o=s({env:r});t.path=r[o];r[o]=e.exports(t);return r}},7278:e=>{"use strict";const pathKey=(e={})=>{const t=e.env||process.env;const r=e.platform||process.platform;if(r!=="win32"){return"PATH"}return Object.keys(t).reverse().find((e=>e.toUpperCase()==="PATH"))||"Path"};e.exports=pathKey;e.exports.default=pathKey},1223:(e,t,r)=>{var o=r(2940);e.exports=o(once);e.exports.strict=o(onceStrict);once.proto=once((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return once(this)},configurable:true});Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return onceStrict(this)},configurable:true})}));function once(e){var f=function(){if(f.called)return f.value;f.called=true;return f.value=e.apply(this,arguments)};f.called=false;return f}function onceStrict(e){var f=function(){if(f.called)throw new Error(f.onceError);f.called=true;return f.value=e.apply(this,arguments)};var t=e.name||"Function wrapped with `once`";f.onceError=t+" shouldn't be called more than once";f.called=false;return f}},4824:(e,t,r)=>{"use strict";const o=r(2087);const s=r(7493);const n=r(3515);const osName=(e,t)=>{if(!e&&t){throw new Error("You can't specify a `release` without specifying `platform`")}e=e||o.platform();let r;if(e==="darwin"){if(!t&&o.platform()==="darwin"){t=o.release()}const e=t?Number(t.split(".")[0])>15?"macOS":"OS X":"macOS";r=t?s(t).name:"";return e+(r?" "+r:"")}if(e==="linux"){if(!t&&o.platform()==="linux"){t=o.release()}r=t?t.replace(/^(\d+\.\d+).*/,"$1"):"";return"Linux"+(r?" "+r:"")}if(e==="win32"){if(!t&&o.platform()==="win32"){t=o.release()}r=t?n(t):"";return"Windows"+(r?" "+r:"")}return e};e.exports=osName},1330:e=>{"use strict";e.exports=(e,t)=>{t=t||(()=>{});return e.then((e=>new Promise((e=>{e(t())})).then((()=>e))),(e=>new Promise((e=>{e(t())})).then((()=>{throw e}))))}},539:e=>{"use strict";e.exports=e=>{e=e||{};const t=e.env||process.env;const r=e.platform||process.platform;if(r!=="win32"){return"PATH"}return Object.keys(t).find((e=>e.toUpperCase()==="PATH"))||"Path"}},8341:(e,t,r)=>{var o=r(1223);var s=r(1205);var n=r(5747);var noop=function(){};var i=/^v?\.0/.test(process.version);var isFn=function(e){return typeof e==="function"};var isFS=function(e){if(!i)return false;if(!n)return false;return(e instanceof(n.ReadStream||noop)||e instanceof(n.WriteStream||noop))&&isFn(e.close)};var isRequest=function(e){return e.setHeader&&isFn(e.abort)};var destroyer=function(e,t,r,n){n=o(n);var i=false;e.on("close",(function(){i=true}));s(e,{readable:t,writable:r},(function(e){if(e)return n(e);i=true;n()}));var a=false;return function(t){if(i)return;if(a)return;a=true;if(isFS(e))return e.close(noop);if(isRequest(e))return e.abort();if(isFn(e.destroy))return e.destroy();n(t||new Error("stream was destroyed"))}};var call=function(e){e()};var pipe=function(e,t){return e.pipe(t)};var pump=function(){var e=Array.prototype.slice.call(arguments);var t=isFn(e[e.length-1]||noop)&&e.pop()||noop;if(Array.isArray(e[0]))e=e[0];if(e.length<2)throw new Error("pump requires two streams per minimum");var r;var o=e.map((function(s,n){var i=n0;return destroyer(s,i,a,(function(e){if(!r)r=e;if(e)o.forEach(call);if(i)return;o.forEach(call);t(r)}))}));return e.reduce(pipe)};e.exports=pump},7032:(e,t,r)=>{"use strict";const o=r(2638);e.exports=(e="")=>{const t=e.match(o);if(!t){return null}const[r,s]=t[0].replace(/#! ?/,"").split(" ");const n=r.split("/").pop();if(n==="env"){return s}return s?`${n} ${s}`:n}},2638:e=>{"use strict";e.exports=/^#!(.*)/},4931:(e,t,r)=>{var o=r(2357);var s=r(3710);var n=/^win/i.test(process.platform);var i=r(8614);if(typeof i!=="function"){i=i.EventEmitter}var a;if(process.__signal_exit_emitter__){a=process.__signal_exit_emitter__}else{a=process.__signal_exit_emitter__=new i;a.count=0;a.emitted={}}if(!a.infinite){a.setMaxListeners(Infinity);a.infinite=true}e.exports=function(e,t){o.equal(typeof e,"function","a callback must be provided for exit handler");if(u===false){load()}var r="exit";if(t&&t.alwaysLast){r="afterexit"}var remove=function(){a.removeListener(r,e);if(a.listeners("exit").length===0&&a.listeners("afterexit").length===0){unload()}};a.on(r,e);return remove};e.exports.unload=unload;function unload(){if(!u){return}u=false;s.forEach((function(e){try{process.removeListener(e,c[e])}catch(e){}}));process.emit=p;process.reallyExit=l;a.count-=1}function emit(e,t,r){if(a.emitted[e]){return}a.emitted[e]=true;a.emit(e,t,r)}var c={};s.forEach((function(e){c[e]=function listener(){var t=process.listeners(e);if(t.length===a.count){unload();emit("exit",null,e);emit("afterexit",null,e);if(n&&e==="SIGHUP"){e="SIGINT"}process.kill(process.pid,e)}}}));e.exports.signals=function(){return s};e.exports.load=load;var u=false;function load(){if(u){return}u=true;a.count+=1;s=s.filter((function(e){try{process.on(e,c[e]);return true}catch(e){return false}}));process.emit=processEmit;process.reallyExit=processReallyExit}var l=process.reallyExit;function processReallyExit(e){process.exitCode=e||0;emit("exit",process.exitCode,null);emit("afterexit",process.exitCode,null);l.call(process,process.exitCode)}var p=process.emit;function processEmit(e,t){if(e==="exit"){if(t!==undefined){process.exitCode=t}var r=p.apply(this,arguments);emit("exit",process.exitCode,null);emit("afterexit",process.exitCode,null);return r}else{return p.apply(this,arguments)}}},3710:e=>{e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32"){e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT")}if(process.platform==="linux"){e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}},5515:e=>{"use strict";e.exports=function(e){var t=typeof e==="string"?"\n":"\n".charCodeAt();var r=typeof e==="string"?"\r":"\r".charCodeAt();if(e[e.length-1]===t){e=e.slice(0,e.length-1)}if(e[e.length-1]===r){e=e.slice(0,e.length-1)}return e}},8174:e=>{"use strict";e.exports=e=>{const t=typeof e==="string"?"\n":"\n".charCodeAt();const r=typeof e==="string"?"\r":"\r".charCodeAt();if(e[e.length-1]===t){e=e.slice(0,e.length-1)}if(e[e.length-1]===r){e=e.slice(0,e.length-1)}return e}},9318:(e,t,r)=>{"use strict";const o=r(2087);const s=r(3867);const n=r(1621);const{env:i}=process;let a;if(n("no-color")||n("no-colors")||n("color=false")||n("color=never")){a=0}else if(n("color")||n("colors")||n("color=true")||n("color=always")){a=1}if("FORCE_COLOR"in i){if(i.FORCE_COLOR==="true"){a=1}else if(i.FORCE_COLOR==="false"){a=0}else{a=i.FORCE_COLOR.length===0?1:Math.min(parseInt(i.FORCE_COLOR,10),3)}}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e,t){if(a===0){return 0}if(n("color=16m")||n("color=full")||n("color=truecolor")){return 3}if(n("color=256")){return 2}if(e&&!t&&a===undefined){return 0}const r=a||0;if(i.TERM==="dumb"){return r}if(process.platform==="win32"){const e=o.release().split(".");if(Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in i){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in i))||i.CI_NAME==="codeship"){return 1}return r}if("TEAMCITY_VERSION"in i){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(i.TEAMCITY_VERSION)?1:0}if("GITHUB_ACTIONS"in i){return 1}if(i.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in i){const e=parseInt((i.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(i.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(i.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(i.TERM)){return 1}if("COLORTERM"in i){return 1}return r}function getSupportLevel(e){const t=supportsColor(e,e&&e.isTTY);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:translateLevel(supportsColor(true,s.isatty(1))),stderr:translateLevel(supportsColor(true,s.isatty(2)))}},4294:(e,t,r)=>{e.exports=r(4219)},4219:(e,t,r)=>{"use strict";var o=r(1631);var s=r(4016);var n=r(8605);var i=r(7211);var a=r(8614);var c=r(2357);var u=r(1669);t.httpOverHttp=httpOverHttp;t.httpsOverHttp=httpsOverHttp;t.httpOverHttps=httpOverHttps;t.httpsOverHttps=httpsOverHttps;function httpOverHttp(e){var t=new TunnelingAgent(e);t.request=n.request;return t}function httpsOverHttp(e){var t=new TunnelingAgent(e);t.request=n.request;t.createSocket=createSecureSocket;t.defaultPort=443;return t}function httpOverHttps(e){var t=new TunnelingAgent(e);t.request=i.request;return t}function httpsOverHttps(e){var t=new TunnelingAgent(e);t.request=i.request;t.createSocket=createSecureSocket;t.defaultPort=443;return t}function TunnelingAgent(e){var t=this;t.options=e||{};t.proxyOptions=t.options.proxy||{};t.maxSockets=t.options.maxSockets||n.Agent.defaultMaxSockets;t.requests=[];t.sockets=[];t.on("free",(function onFree(e,r,o,s){var n=toOptions(r,o,s);for(var i=0,a=t.requests.length;i=this.maxSockets){s.requests.push(n);return}s.createSocket(n,(function(t){t.on("free",onFree);t.on("close",onCloseOrRemove);t.on("agentRemove",onCloseOrRemove);e.onSocket(t);function onFree(){s.emit("free",t,n)}function onCloseOrRemove(e){s.removeSocket(t);t.removeListener("free",onFree);t.removeListener("close",onCloseOrRemove);t.removeListener("agentRemove",onCloseOrRemove)}}))};TunnelingAgent.prototype.createSocket=function createSocket(e,t){var r=this;var o={};r.sockets.push(o);var s=mergeOptions({},r.proxyOptions,{method:"CONNECT",path:e.host+":"+e.port,agent:false,headers:{host:e.host+":"+e.port}});if(e.localAddress){s.localAddress=e.localAddress}if(s.proxyAuth){s.headers=s.headers||{};s.headers["Proxy-Authorization"]="Basic "+new Buffer(s.proxyAuth).toString("base64")}l("making CONNECT request");var n=r.request(s);n.useChunkedEncodingByDefault=false;n.once("response",onResponse);n.once("upgrade",onUpgrade);n.once("connect",onConnect);n.once("error",onError);n.end();function onResponse(e){e.upgrade=true}function onUpgrade(e,t,r){process.nextTick((function(){onConnect(e,t,r)}))}function onConnect(s,i,a){n.removeAllListeners();i.removeAllListeners();if(s.statusCode!==200){l("tunneling socket could not be established, statusCode=%d",s.statusCode);i.destroy();var c=new Error("tunneling socket could not be established, "+"statusCode="+s.statusCode);c.code="ECONNRESET";e.request.emit("error",c);r.removeSocket(o);return}if(a.length>0){l("got illegal response body from proxy");i.destroy();var c=new Error("got illegal response body from proxy");c.code="ECONNRESET";e.request.emit("error",c);r.removeSocket(o);return}l("tunneling connection has established");r.sockets[r.sockets.indexOf(o)]=i;return t(i)}function onError(t){n.removeAllListeners();l("tunneling socket could not be established, cause=%s\n",t.message,t.stack);var s=new Error("tunneling socket could not be established, "+"cause="+t.message);s.code="ECONNRESET";e.request.emit("error",s);r.removeSocket(o)}};TunnelingAgent.prototype.removeSocket=function removeSocket(e){var t=this.sockets.indexOf(e);if(t===-1){return}this.sockets.splice(t,1);var r=this.requests.shift();if(r){this.createSocket(r,(function(e){r.request.onSocket(e)}))}};function createSecureSocket(e,t){var r=this;TunnelingAgent.prototype.createSocket.call(r,e,(function(o){var n=e.request.getHeader("host");var i=mergeOptions({},r.options,{socket:o,servername:n?n.replace(/:.*$/,""):e.host});var a=s.connect(0,i);r.sockets[r.sockets.indexOf(o)]=a;t(a)}))}function toOptions(e,t,r){if(typeof e==="string"){return{host:e,port:t,localAddress:r}}return e}function mergeOptions(e){for(var t=1,r=arguments.length;t{"use strict";Object.defineProperty(t,"__esModule",{value:true});function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var o=_interopDefault(r(4824));function getUserAgent(){try{return`Node.js/${process.version.substr(1)} (${o()}; ${process.arch})`}catch(e){if(/wmic os get Caption/.test(e.message)){return"Windows "}return""}}t.getUserAgent=getUserAgent},4207:(e,t,r)=>{const o=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys";const s=r(5622);const n=o?";":":";const i=r(7126);const getNotFoundError=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"});const getPathInfo=(e,t)=>{const r=t.colon||n;const s=e.match(/\//)||o&&e.match(/\\/)?[""]:[...o?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)];const i=o?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"";const a=o?i.split(r):[""];if(o){if(e.indexOf(".")!==-1&&a[0]!=="")a.unshift("")}return{pathEnv:s,pathExt:a,pathExtExe:i}};const which=(e,t,r)=>{if(typeof t==="function"){r=t;t={}}if(!t)t={};const{pathEnv:o,pathExt:n,pathExtExe:a}=getPathInfo(e,t);const c=[];const step=r=>new Promise(((n,i)=>{if(r===o.length)return t.all&&c.length?n(c):i(getNotFoundError(e));const a=o[r];const u=/^".*"$/.test(a)?a.slice(1,-1):a;const l=s.join(u,e);const p=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;n(subStep(p,r,0))}));const subStep=(e,r,o)=>new Promise(((s,u)=>{if(o===n.length)return s(step(r+1));const l=n[o];i(e+l,{pathExt:a},((n,i)=>{if(!n&&i){if(t.all)c.push(e+l);else return s(e+l)}return s(subStep(e,r,o+1))}))}));return r?step(0).then((e=>r(null,e)),r):step(0)};const whichSync=(e,t)=>{t=t||{};const{pathEnv:r,pathExt:o,pathExtExe:n}=getPathInfo(e,t);const a=[];for(let c=0;c{"use strict";const o=r(2087);const s=r(4780);const n=new Map([["10.0","10"],["6.3","8.1"],["6.2","8"],["6.1","7"],["6.0","Vista"],["5.2","Server 2003"],["5.1","XP"],["5.0","2000"],["4.9","ME"],["4.1","98"],["4.0","95"]]);const windowsRelease=e=>{const t=/\d+\.\d/.exec(e||o.release());if(e&&!t){throw new Error("`release` argument doesn't match `n.n`")}const r=(t||[])[0];if((!e||e===o.release())&&["6.1","6.2","6.3","10.0"].includes(r)){let e;try{e=s.sync("wmic",["os","get","Caption"]).stdout||""}catch(t){e=s.sync("powershell",["(Get-CimInstance -ClassName Win32_OperatingSystem).caption"]).stdout||""}const t=(e.match(/2008|2012|2016|2019/)||[])[0];if(t){return`Server ${t}`}}return n.get(r)};e.exports=windowsRelease},4780:(e,t,r)=>{"use strict";const o=r(5622);const s=r(3129);const n=r(2746);const i=r(5515);const a=r(2509);const c=r(2597);const u=r(2560);const l=r(1330);const p=r(4931);const d=r(2160);const m=r(7023);const g=1e3*1e3*10;function handleArgs(e,t,r){let s;r=Object.assign({extendEnv:true,env:{}},r);if(r.extendEnv){r.env=Object.assign({},process.env,r.env)}if(r.__winShell===true){delete r.__winShell;s={command:e,args:t,options:r,file:e,original:{cmd:e,args:t}}}else{s=n._parse(e,t,r)}r=Object.assign({maxBuffer:g,buffer:true,stripEof:true,preferLocal:true,localDir:s.options.cwd||process.cwd(),encoding:"utf8",reject:true,cleanup:true},s.options);r.stdio=m(r);if(r.preferLocal){r.env=a.env(Object.assign({},r,{cwd:r.localDir}))}if(r.detached){r.cleanup=false}if(process.platform==="win32"&&o.basename(s.command)==="cmd.exe"){s.args.unshift("/q")}return{cmd:s.command,args:s.args,opts:r,parsed:s}}function handleInput(e,t){if(t===null||t===undefined){return}if(c(t)){t.pipe(e.stdin)}else{e.stdin.end(t)}}function handleOutput(e,t){if(t&&e.stripEof){t=i(t)}return t}function handleShell(e,t,r){let o="/bin/sh";let s=["-c",t];r=Object.assign({},r);if(process.platform==="win32"){r.__winShell=true;o=process.env.comspec||"cmd.exe";s=["/s","/c",`"${t}"`];r.windowsVerbatimArguments=true}if(r.shell){o=r.shell;delete r.shell}return e(o,s,r)}function getStream(e,t,{encoding:r,buffer:o,maxBuffer:s}){if(!e[t]){return null}let n;if(!o){n=new Promise(((r,o)=>{e[t].once("end",r).once("error",o)}))}else if(r){n=u(e[t],{encoding:r,maxBuffer:s})}else{n=u.buffer(e[t],{maxBuffer:s})}return n.catch((e=>{e.stream=t;e.message=`${t} ${e.message}`;throw e}))}function makeError(e,t){const{stdout:r,stderr:o}=e;let s=e.error;const{code:n,signal:i}=e;const{parsed:a,joinedCmd:c}=t;const u=t.timedOut||false;if(!s){let e="";if(Array.isArray(a.opts.stdio)){if(a.opts.stdio[2]!=="inherit"){e+=e.length>0?o:`\n${o}`}if(a.opts.stdio[1]!=="inherit"){e+=`\n${r}`}}else if(a.opts.stdio!=="inherit"){e=`\n${o}${r}`}s=new Error(`Command failed: ${c}${e}`);s.code=n<0?d(n):n}s.stdout=r;s.stderr=o;s.failed=true;s.signal=i||null;s.cmd=c;s.timedOut=u;return s}function joinCmd(e,t){let r=e;if(Array.isArray(t)&&t.length>0){r+=" "+t.join(" ")}return r}e.exports=(e,t,r)=>{const o=handleArgs(e,t,r);const{encoding:i,buffer:a,maxBuffer:c}=o.opts;const u=joinCmd(e,t);let d;try{d=s.spawn(o.cmd,o.args,o.opts)}catch(e){return Promise.reject(e)}let m;if(o.opts.cleanup){m=p((()=>{d.kill()}))}let g=null;let h=false;const cleanup=()=>{if(g){clearTimeout(g);g=null}if(m){m()}};if(o.opts.timeout>0){g=setTimeout((()=>{g=null;h=true;d.kill(o.opts.killSignal)}),o.opts.timeout)}const b=new Promise((e=>{d.on("exit",((t,r)=>{cleanup();e({code:t,signal:r})}));d.on("error",(t=>{cleanup();e({error:t})}));if(d.stdin){d.stdin.on("error",(t=>{cleanup();e({error:t})}))}}));function destroy(){if(d.stdout){d.stdout.destroy()}if(d.stderr){d.stderr.destroy()}}const handlePromise=()=>l(Promise.all([b,getStream(d,"stdout",{encoding:i,buffer:a,maxBuffer:c}),getStream(d,"stderr",{encoding:i,buffer:a,maxBuffer:c})]).then((e=>{const t=e[0];t.stdout=e[1];t.stderr=e[2];if(t.error||t.code!==0||t.signal!==null){const e=makeError(t,{joinedCmd:u,parsed:o,timedOut:h});e.killed=e.killed||d.killed;if(!o.opts.reject){return e}throw e}return{stdout:handleOutput(o.opts,t.stdout),stderr:handleOutput(o.opts,t.stderr),code:0,failed:false,killed:false,signal:null,cmd:u,timedOut:false}})),destroy);n._enoent.hookChildProcess(d,o.parsed);handleInput(d,o.opts.input);d.then=(e,t)=>handlePromise().then(e,t);d.catch=e=>handlePromise().catch(e);return d};e.exports.stdout=(...t)=>e.exports(...t).then((e=>e.stdout));e.exports.stderr=(...t)=>e.exports(...t).then((e=>e.stderr));e.exports.shell=(t,r)=>handleShell(e.exports,t,r);e.exports.sync=(e,t,r)=>{const o=handleArgs(e,t,r);const n=joinCmd(e,t);if(c(o.opts.input)){throw new TypeError("The `input` option cannot be a stream in sync mode")}const i=s.spawnSync(o.cmd,o.args,o.opts);i.code=i.status;if(i.error||i.status!==0||i.signal!==null){const e=makeError(i,{joinedCmd:n,parsed:o});if(!o.opts.reject){return e}throw e}return{stdout:handleOutput(o.opts,i.stdout),stderr:handleOutput(o.opts,i.stderr),code:0,failed:false,signal:null,cmd:n,timedOut:false}};e.exports.shellSync=(t,r)=>handleShell(e.exports.sync,t,r)},2160:(e,t,r)=>{"use strict";const o=r(1669);let s;if(typeof o.getSystemErrorName==="function"){e.exports=o.getSystemErrorName}else{try{s=process.binding("uv");if(typeof s.errname!=="function"){throw new TypeError("uv.errname is not a function")}}catch(e){console.error("execa/lib/errname: unable to establish process.binding('uv')",e);s=null}e.exports=e=>errname(s,e)}e.exports.__test__=errname;function errname(e,t){if(e){return e.errname(t)}if(!(t<0)){throw new Error("err >= 0")}return`Unknown system error ${t}`}},7023:e=>{"use strict";const t=["stdin","stdout","stderr"];const hasAlias=e=>t.some((t=>Boolean(e[t])));e.exports=e=>{if(!e){return null}if(e.stdio&&hasAlias(e)){throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${t.map((e=>`\`${e}\``)).join(", ")}`)}if(typeof e.stdio==="string"){return e.stdio}const r=e.stdio||[];if(!Array.isArray(r)){throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof r}\``)}const o=[];const s=Math.max(r.length,t.length);for(let n=0;n{"use strict";const{PassThrough:o}=r(2413);e.exports=e=>{e=Object.assign({},e);const{array:t}=e;let{encoding:r}=e;const s=r==="buffer";let n=false;if(t){n=!(r||s)}else{r=r||"utf8"}if(s){r=null}let i=0;const a=[];const c=new o({objectMode:n});if(r){c.setEncoding(r)}c.on("data",(e=>{a.push(e);if(n){i=a.length}else{i+=e.length}}));c.getBufferedValue=()=>{if(t){return a}return s?Buffer.concat(a,i):a.join("")};c.getBufferedLength=()=>i;return c}},2560:(e,t,r)=>{"use strict";const o=r(8341);const s=r(9286);class MaxBufferError extends Error{constructor(){super("maxBuffer exceeded");this.name="MaxBufferError"}}function getStream(e,t){if(!e){return Promise.reject(new Error("Expected a stream"))}t=Object.assign({maxBuffer:Infinity},t);const{maxBuffer:r}=t;let n;return new Promise(((i,a)=>{const rejectPromise=e=>{if(e){e.bufferedData=n.getBufferedValue()}a(e)};n=o(e,s(t),(e=>{if(e){rejectPromise(e);return}i()}));n.on("data",(()=>{if(n.getBufferedLength()>r){rejectPromise(new MaxBufferError)}}))})).then((()=>n.getBufferedValue()))}e.exports=getStream;e.exports.buffer=(e,t)=>getStream(e,Object.assign({},t,{encoding:"buffer"}));e.exports.array=(e,t)=>getStream(e,Object.assign({},t,{array:true}));e.exports.MaxBufferError=MaxBufferError},2597:e=>{"use strict";var t=e.exports=function(e){return e!==null&&typeof e==="object"&&typeof e.pipe==="function"};t.writable=function(e){return t(e)&&e.writable!==false&&typeof e._write==="function"&&typeof e._writableState==="object"};t.readable=function(e){return t(e)&&e.readable!==false&&typeof e._read==="function"&&typeof e._readableState==="object"};t.duplex=function(e){return t.writable(e)&&t.readable(e)};t.transform=function(e){return t.duplex(e)&&typeof e._transform==="function"&&typeof e._transformState==="object"}},2509:(e,t,r)=>{"use strict";const o=r(5622);const s=r(539);e.exports=e=>{e=Object.assign({cwd:process.cwd(),path:process.env[s()]},e);let t;let r=o.resolve(e.cwd);const n=[];while(t!==r){n.push(o.join(r,"node_modules/.bin"));t=r;r=o.resolve(r,"..")}n.push(o.dirname(process.execPath));return n.concat(e.path).join(o.delimiter)};e.exports.env=t=>{t=Object.assign({env:process.env},t);const r=Object.assign({},t.env);const o=s({env:r});t.path=r[o];r[o]=e.exports(t);return r}},2940:e=>{e.exports=wrappy;function wrappy(e,t){if(e&&t)return wrappy(e)(t);if(typeof e!=="function")throw new TypeError("need wrapper function");Object.keys(e).forEach((function(t){wrapper[t]=e[t]}));return wrapper;function wrapper(){var t=new Array(arguments.length);for(var r=0;r{module.exports=eval("require")("encoding")},2357:e=>{"use strict";e.exports=require("assert")},4293:e=>{"use strict";e.exports=require("buffer")},3129:e=>{"use strict";e.exports=require("child_process")},8614:e=>{"use strict";e.exports=require("events")},5747:e=>{"use strict";e.exports=require("fs")},8605:e=>{"use strict";e.exports=require("http")},7211:e=>{"use strict";e.exports=require("https")},1631:e=>{"use strict";e.exports=require("net")},2087:e=>{"use strict";e.exports=require("os")},5622:e=>{"use strict";e.exports=require("path")},2413:e=>{"use strict";e.exports=require("stream")},4016:e=>{"use strict";e.exports=require("tls")},3867:e=>{"use strict";e.exports=require("tty")},8835:e=>{"use strict";e.exports=require("url")},1669:e=>{"use strict";e.exports=require("util")},8761:e=>{"use strict";e.exports=require("zlib")}};var __webpack_module_cache__={};function __nccwpck_require__(e){var t=__webpack_module_cache__[e];if(t!==undefined){return t.exports}var r=__webpack_module_cache__[e]={exports:{}};var o=true;try{__webpack_modules__[e].call(r.exports,r,r.exports,__nccwpck_require__);o=false}finally{if(o)delete __webpack_module_cache__[e]}return r.exports}(()=>{__nccwpck_require__.n=e=>{var t=e&&e.__esModule?()=>e["default"]:()=>e;__nccwpck_require__.d(t,{a:t});return t}})();(()=>{__nccwpck_require__.d=(e,t)=>{for(var r in t){if(__nccwpck_require__.o(t,r)&&!__nccwpck_require__.o(e,r)){Object.defineProperty(e,r,{enumerable:true,get:t[r]})}}}})();(()=>{__nccwpck_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})();(()=>{__nccwpck_require__.r=e=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var __webpack_exports__={};(()=>{"use strict";__nccwpck_require__.r(__webpack_exports__);var e=__nccwpck_require__(2186);var t=__nccwpck_require__(5438);var r=__nccwpck_require__(1231);var o=__nccwpck_require__(1669);var s=__nccwpck_require__(8237);var n=__nccwpck_require__.n(s);const i=n()("apollo-schema-check");const isGitHubActions=()=>!!process.env.GITHUB_WORKSPACE;const debug=(...t)=>{if(isGitHubActions()){for(const r of t){(0,e.debug)((0,o.inspect)(r))}}else{i(t)}};const getCommentIdentifier=()=>{const t=(0,e.getInput)("config");const r=(0,e.getInput)("graph");const o=(0,e.getInput)("variant");const s=(0,e.getInput)("title");if(s){return`\x3c!-- apolloSchemaCheckAction name: ${s} --\x3e`}else if(t){return`\x3c!-- apolloSchemaCheckAction config: ${t} --\x3e`}else if(r&&o){return`\x3c!-- apolloSchemaCheckAction graph: ${r}@${o} --\x3e`}else if(r){return`\x3c!-- apolloSchemaCheckAction graph: ${r} --\x3e`}else if(o){return`\x3c!-- apolloSchemaCheckAction variant: ${o} --\x3e`}else{return`\x3c!-- apolloSchemaCheckAction --\x3e`}};var a=__nccwpck_require__(5447);var c=__nccwpck_require__.n(a);const getArguments=()=>{const t={config:(0,e.getInput)("config"),graph:(0,e.getInput)("graph"),variant:(0,e.getInput)("variant"),endpoint:(0,e.getInput)("endpoint"),header:(0,e.getInput)("header"),key:(0,e.getInput)("key"),localSchemaFile:(0,e.getInput)("localSchemaFile"),queryCountThreshold:(0,e.getInput)("queryCountThreshold"),queryCountThresholdPercentage:(0,e.getInput)("queryCountThresholdPercentage"),serviceName:(0,e.getInput)("serviceName"),validationPeriod:(0,e.getInput)("validationPeriod")};const r=`--branch=${process.env.GITHUB_REF}#refs/heads/`;const o=`--author=${process.env.GITHUB_ACTOR}`;const s=[r,o];debug("token",!!process.env.GITHUB_TOKEN);if(t.graph&&!t.key){throw new Error("You must provide an Apollo key")}if(!t.config&&!t.graph){throw new Error("You must provide either a config file or a graph name")}for(const[e,r]of Object.entries(t)){if(e==="header"&&r){const e=r.split(",");for(const t of e){s.push(`--header='${t.trim()}'`)}}else if(r){s.push(`--${e}=${r}`)}}s.push("--markdown");return s};const formatMessage=(t,r)=>{const o=t.indexOf("###");const s=(0,e.getInput)("title");const n=(0,e.getInput)("alwaysComment");const i=(0,e.getInput)("failOnError");if(o===-1){throw new Error("Error running Apollo CLI")}if(n!=="true"&&t.includes("null operations")){debug("alwaysComment is false and number of operations is null");debug("output",t);return}if(!r&&n!=="true"&&/\s0 schema changes/.test(t)){debug("existingComment is false, alwaysComment is false and there are zero schema changes");debug("output",t);return}let a=t.slice(o);if(i&&/\d+ breaking change/.test(a)){debug("Breaking changes found");debug("message",a);(0,e.setFailed)("Breaking changes found")}else if(i&&/\d+ composition error/.test(a)){debug("Composition errors found");debug("message",a);(0,e.setFailed)("Composition errors found")}if(s){a=a.replace("### Apollo Service Check\n",`### Apollo Schema Check\n#### ${s}\n`)}else{a=a.replace("### Apollo Service Check",`### Apollo Schema Check`)}debug("message",a);return a};var u=undefined&&undefined.__awaiter||function(e,t,r,o){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,s){function fulfilled(e){try{step(o.next(e))}catch(e){s(e)}}function rejected(e){try{step(o["throw"](e))}catch(e){s(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((o=o.apply(e,t||[])).next())}))};const getMessage=(e,t)=>u(void 0,void 0,void 0,(function*(){const r=getArguments();if(t){debug("existing comment found")}const o=r.map((e=>e.startsWith("--key")?e.replace(/:[^:]+$/,"***"):e));console.log("Apollo CLI command",["npx","apollo@2.33.6","schema:check",...o].join(" "));try{const o=(yield c()("npx",["apollo@2.33.6","schema:check",...r])).stdout;console.log(o);const s=formatMessage(o,t);if(s){return`${s}\n\n${e}`}else{return}}catch(r){if(r.exitCode!==1){console.error(`Apollo CLI error: exit code ${r.exitCode}`,r);throw new Error("Error running Apollo CLI")}else{console.log(r.stdout);const o=formatMessage(r.stdout,t);if(o){return`${o}\n\n${e}`}else{return}}}}));var l=undefined&&undefined.__awaiter||function(e,t,r,o){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,s){function fulfilled(e){try{step(o.next(e))}catch(e){s(e)}}function rejected(e){try{step(o["throw"](e))}catch(e){s(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((o=o.apply(e,t||[])).next())}))};const run=()=>l(void 0,void 0,void 0,(function*(){if(!isGitHubActions()){console.log(yield getMessage(getCommentIdentifier(),false));return}try{if(t.context.payload.pull_request==null){(0,e.setFailed)("No pull request found");return}const o=process.env.GITHUB_REPOSITORY;if(!o){(0,e.setFailed)("No repo found");return}const s=getCommentIdentifier();const[n,i]=o.split("/");const a=t.context.payload.pull_request.number;const c=new r.v;const u=yield c.issues.listComments({owner:n,repo:i,issue_number:a});const l=u.data.find((e=>{var t;return(t=e===null||e===void 0?void 0:e.body)===null||t===void 0?void 0:t.includes(s)}));const p=yield getMessage(s,!!l);if(p){if(l){c.issues.updateComment(Object.assign(Object.assign({},t.context.repo),{comment_id:l.id,body:p}))}else{c.issues.createComment(Object.assign(Object.assign({},t.context.repo),{issue_number:a,body:p}))}}}catch(t){(0,e.setFailed)(t.message)}}));run()})();module.exports=__webpack_exports__})(); \ No newline at end of file