metaapi.cloud-metastats-sdk
Version:
Javascript SDK for MetaStats forex trading statistics API. Can calculate metrics for MetaTrader accounts added to MetaApi. Supports both MetaTrader 5 (MT5) and MetaTrader 4 (MT4). (https://metaapi.cloud)
2 lines • 241 kB
JavaScript
/*! For license information please see index.js.LICENSE.txt */
(()=>{var e={9118:(e,a,i)=>{e.exports={parallel:i(9162),serial:i(1357),serialOrdered:i(9087)}},7651:e=>{function a(e){"function"==typeof this.jobs[e]&&this.jobs[e]()}e.exports=function(e){Object.keys(e.jobs).forEach(a.bind(e)),e.jobs={}}},5912:(e,a,i)=>{var n=i(9265);e.exports=function(e){var a=!1;return n((function(){a=!0})),function(i,o){a?e(i,o):n((function(){e(i,o)}))}}},9265:e=>{e.exports=function(e){var a="function"==typeof setImmediate?setImmediate:"object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:null;a?a(e):setTimeout(e,0)}},7594:(e,a,i)=>{var n=i(5912),o=i(7651);e.exports=function(e,a,i,t){var s=i.keyedList?i.keyedList[i.index]:i.index;i.jobs[s]=function(e,a,i,o){return 2==e.length?e(i,n(o)):e(i,a,n(o))}(a,s,e[s],(function(e,a){s in i.jobs&&(delete i.jobs[s],e?o(i):i.results[s]=a,t(e,i.results))}))}},4528:e=>{e.exports=function(e,a){var i=!Array.isArray(e),n={index:0,keyedList:i||a?Object.keys(e):null,jobs:{},results:i?{}:[],size:i?Object.keys(e).length:e.length};return a&&n.keyedList.sort(i?a:function(i,n){return a(e[i],e[n])}),n}},5353:(e,a,i)=>{var n=i(7651),o=i(5912);e.exports=function(e){Object.keys(this.jobs).length&&(this.index=this.size,n(this),o(e)(null,this.results))}},9162:(e,a,i)=>{var n=i(7594),o=i(4528),t=i(5353);e.exports=function(e,a,i){for(var s=o(e);s.index<(s.keyedList||e).length;)n(e,a,s,(function(e,a){e?i(e,a):0!==Object.keys(s.jobs).length||i(null,s.results)})),s.index++;return t.bind(s,i)}},1357:(e,a,i)=>{var n=i(9087);e.exports=function(e,a,i){return n(e,a,null,i)}},9087:(e,a,i)=>{var n=i(7594),o=i(4528),t=i(5353);function s(e,a){return e<a?-1:e>a?1:0}e.exports=function(e,a,i,s){var r=o(e,i);return n(e,a,r,(function i(o,t){o?s(o,t):(r.index++,r.index<(r.keyedList||e).length?n(e,a,r,i):s(null,r.results))})),t.bind(r,s)},e.exports.ascending=s,e.exports.descending=function(e,a){return-1*s(e,a)}},5116:(e,a,i)=>{"use strict";var n=i(8612),o=i(1768),t=i(8928),s=i(9770);e.exports=s||n.call(t,o)},1768:e=>{"use strict";e.exports=Function.prototype.apply},8928:e=>{"use strict";e.exports=Function.prototype.call},319:(e,a,i)=>{"use strict";var n=i(8612),o=i(4453),t=i(8928),s=i(5116);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new o("a function is required");return s(n,t,e)}},9770:e=>{"use strict";e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},9779:(e,a,i)=>{var n=i(3837),o=i(2781).Stream,t=i(3463);function s(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2097152,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}e.exports=s,n.inherits(s,o),s.create=function(e){var a=new this;for(var i in e=e||{})a[i]=e[i];return a},s.isStreamLike=function(e){return"function"!=typeof e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e&&!Buffer.isBuffer(e)},s.prototype.append=function(e){if(s.isStreamLike(e)){if(!(e instanceof t)){var a=t.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=a}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this},s.prototype.pipe=function(e,a){return o.prototype.pipe.call(this,e,a),this.resume(),e},s.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop)this._pendingNext=!0;else{this._insideLoop=!0;try{do{this._pendingNext=!1,this._realGetNext()}while(this._pendingNext)}finally{this._insideLoop=!1}}},s.prototype._realGetNext=function(){var e=this._streams.shift();void 0!==e?"function"==typeof e?e(function(e){s.isStreamLike(e)&&(e.on("data",this._checkDataSize.bind(this)),this._handleErrors(e)),this._pipeNext(e)}.bind(this)):this._pipeNext(e):this.end()},s.prototype._pipeNext=function(e){if(this._currentStream=e,s.isStreamLike(e))return e.on("end",this._getNext.bind(this)),void e.pipe(this,{end:!1});var a=e;this.write(a),this._getNext()},s.prototype._handleErrors=function(e){var a=this;e.on("error",(function(e){a._emitError(e)}))},s.prototype.write=function(e){this.emit("data",e)},s.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&"function"==typeof this._currentStream.pause&&this._currentStream.pause(),this.emit("pause"))},s.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&"function"==typeof this._currentStream.resume&&this._currentStream.resume(),this.emit("resume")},s.prototype.end=function(){this._reset(),this.emit("end")},s.prototype.destroy=function(){this._reset(),this.emit("close")},s.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null},s.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}},s.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach((function(a){a.dataSize&&(e.dataSize+=a.dataSize)})),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)},s.prototype._emitError=function(e){this._reset(),this.emit("error",e)}},1227:(e,a,i)=>{a.formatArgs=function(a){if(a[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+a[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const i="color: "+this.color;a.splice(1,0,i,"color: inherit");let n=0,o=0;a[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(o=n))})),a.splice(o,0,i)},a.save=function(e){try{e?a.storage.setItem("debug",e):a.storage.removeItem("debug")}catch(e){}},a.load=function(){let e;try{e=a.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},a.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},a.storage=function(){try{return localStorage}catch(e){}}(),a.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),a.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],a.log=console.debug||console.log||(()=>{}),e.exports=i(2447)(a);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},2447:(e,a,i)=>{e.exports=function(e){function a(e){let i,o,t,s=null;function r(...e){if(!r.enabled)return;const n=r,o=Number(new Date),t=o-(i||o);n.diff=t,n.prev=i,n.curr=o,i=o,e[0]=a.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((i,o)=>{if("%%"===i)return"%";s++;const t=a.formatters[o];if("function"==typeof t){const a=e[s];i=t.call(n,a),e.splice(s,1),s--}return i})),a.formatArgs.call(n,e),(n.log||a.log).apply(n,e)}return r.namespace=e,r.useColors=a.useColors(),r.color=a.selectColor(e),r.extend=n,r.destroy=a.destroy,Object.defineProperty(r,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(o!==a.namespaces&&(o=a.namespaces,t=a.enabled(e)),t),set:e=>{s=e}}),"function"==typeof a.init&&a.init(r),r}function n(e,i){const n=a(this.namespace+(void 0===i?":":i)+e);return n.log=this.log,n}function o(e,a){let i=0,n=0,o=-1,t=0;for(;i<e.length;)if(n<a.length&&(a[n]===e[i]||"*"===a[n]))"*"===a[n]?(o=n,t=i,n++):(i++,n++);else{if(-1===o)return!1;n=o+1,t++,i=t}for(;n<a.length&&"*"===a[n];)n++;return n===a.length}return a.debug=a,a.default=a,a.coerce=function(e){return e instanceof Error?e.stack||e.message:e},a.disable=function(){const e=[...a.names,...a.skips.map((e=>"-"+e))].join(",");return a.enable(""),e},a.enable=function(e){a.save(e),a.namespaces=e,a.names=[],a.skips=[];const i=("string"==typeof e?e:"").trim().replace(" ",",").split(",").filter(Boolean);for(const e of i)"-"===e[0]?a.skips.push(e.slice(1)):a.names.push(e)},a.enabled=function(e){for(const i of a.skips)if(o(e,i))return!1;for(const i of a.names)if(o(e,i))return!0;return!1},a.humanize=i(7824),a.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((i=>{a[i]=e[i]})),a.names=[],a.skips=[],a.formatters={},a.selectColor=function(e){let i=0;for(let a=0;a<e.length;a++)i=(i<<5)-i+e.charCodeAt(a),i|=0;return a.colors[Math.abs(i)%a.colors.length]},a.enable(a.load()),a}},5158:(e,a,i)=>{"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?e.exports=i(1227):e.exports=i(39)},39:(e,a,i)=>{const n=i(6224),o=i(3837);a.init=function(e){e.inspectOpts={};const i=Object.keys(a.inspectOpts);for(let n=0;n<i.length;n++)e.inspectOpts[i[n]]=a.inspectOpts[i[n]]},a.log=function(...e){return process.stderr.write(o.formatWithOptions(a.inspectOpts,...e)+"\n")},a.formatArgs=function(i){const{namespace:n,useColors:o}=this;if(o){const a=this.color,o="[3"+(a<8?a:"8;5;"+a),t=` ${o};1m${n} [0m`;i[0]=t+i[0].split("\n").join("\n"+t),i.push(o+"m+"+e.exports.humanize(this.diff)+"[0m")}else i[0]=(a.inspectOpts.hideDate?"":(new Date).toISOString()+" ")+n+" "+i[0]},a.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},a.load=function(){return process.env.DEBUG},a.useColors=function(){return"colors"in a.inspectOpts?Boolean(a.inspectOpts.colors):n.isatty(process.stderr.fd)},a.destroy=o.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),a.colors=[6,2,3,4,5,1];try{const e=i(2130);e&&(e.stderr||e).level>=2&&(a.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}a.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,a)=>{const i=a.substring(6).toLowerCase().replace(/_([a-z])/g,((e,a)=>a.toUpperCase()));let n=process.env[a];return n=!!/^(yes|on|true|enabled)$/i.test(n)||!/^(no|off|false|disabled)$/i.test(n)&&("null"===n?null:Number(n)),e[i]=n,e}),{}),e.exports=i(2447)(a);const{formatters:t}=e.exports;t.o=function(e){return this.inspectOpts.colors=this.useColors,o.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},t.O=function(e){return this.inspectOpts.colors=this.useColors,o.inspect(e,this.inspectOpts)}},3463:(e,a,i)=>{var n=i(2781).Stream,o=i(3837);function t(){this.source=null,this.dataSize=0,this.maxDataSize=1048576,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}e.exports=t,o.inherits(t,n),t.create=function(e,a){var i=new this;for(var n in a=a||{})i[n]=a[n];i.source=e;var o=e.emit;return e.emit=function(){return i._handleEmit(arguments),o.apply(e,arguments)},e.on("error",(function(){})),i.pauseStream&&e.pause(),i},Object.defineProperty(t.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}}),t.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)},t.prototype.resume=function(){this._released||this.release(),this.source.resume()},t.prototype.pause=function(){this.source.pause()},t.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]},t.prototype.pipe=function(){var e=n.prototype.pipe.apply(this,arguments);return this.resume(),e},t.prototype._handleEmit=function(e){this._released?this.emit.apply(this,e):("data"===e[0]&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e))},t.prototype._checkIfMaxDataSizeExceeded=function(){if(!(this._maxDataSizeExceeded||this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}}},6504:(e,a,i)=>{"use strict";var n,o=i(319),t=i(7296);try{n=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var s=!!n&&t&&t(Object.prototype,"__proto__"),r=Object,c=r.getPrototypeOf;e.exports=s&&"function"==typeof s.get?o([s.get]):"function"==typeof c&&function(e){return c(null==e?e:r(e))}},4429:e=>{"use strict";var a=Object.defineProperty||!1;if(a)try{a({},"a",{value:1})}catch(e){a=!1}e.exports=a},3981:e=>{"use strict";e.exports=EvalError},1648:e=>{"use strict";e.exports=Error},4726:e=>{"use strict";e.exports=RangeError},6712:e=>{"use strict";e.exports=ReferenceError},3464:e=>{"use strict";e.exports=SyntaxError},4453:e=>{"use strict";e.exports=TypeError},3915:e=>{"use strict";e.exports=URIError},8892:e=>{"use strict";e.exports=Object},4105:(e,a,i)=>{"use strict";var n=i(210)("%Object.defineProperty%",!0),o=i(6410)(),t=i(8824),s=i(4453),r=o?Symbol.toStringTag:null;e.exports=function(e,a){var i=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(void 0!==i&&"boolean"!=typeof i||void 0!==o&&"boolean"!=typeof o)throw new s("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");!r||!i&&t(e,r)||(n?n(e,r,{configurable:!o,enumerable:!1,value:a,writable:!1}):e[r]=a)}},2261:(e,a,i)=>{var n;e.exports=function(){if(!n){try{n=i(5158)("follow-redirects")}catch(e){}"function"!=typeof n&&(n=function(){})}n.apply(null,arguments)}},938:(e,a,i)=>{var n,o,t,s=i(7310),r=s.URL,c=i(3685),p=i(5687),l=i(2781).Writable,u=i(9491),d=i(2261);n="undefined"!=typeof process,o="undefined"!=typeof window&&"undefined"!=typeof document,t=P(Error.captureStackTrace),n||!o&&t||console.warn("The follow-redirects package should be excluded from browser builds.");var m=!1;try{u(new r(""))}catch(e){m="ERR_INVALID_URL"===e.code}var x=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],f=["abort","aborted","connect","error","socket","timeout"],v=Object.create(null);f.forEach((function(e){v[e]=function(a,i,n){this._redirectable.emit(e,a,i,n)}}));var h=A("ERR_INVALID_URL","Invalid URL",TypeError),b=A("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),g=A("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",b),y=A("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),w=A("ERR_STREAM_WRITE_AFTER_END","write after end"),_=l.prototype.destroy||E;function k(e,a){l.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],a&&this.on("response",a);var i=this;this._onNativeResponse=function(e){try{i._processResponse(e)}catch(e){i.emit("error",e instanceof b?e:new b({cause:e}))}},this._performRequest()}function j(e){var a={maxRedirects:21,maxBodyLength:10485760},i={};return Object.keys(e).forEach((function(n){var o=n+":",t=i[o]=e[n],s=a[n]=Object.create(t);Object.defineProperties(s,{request:{value:function(e,n,t){return r&&e instanceof r?e=C(e):F(e)?e=C(O(e)):(t=n,n=R(e),e={protocol:o}),P(n)&&(t=n,n=null),(n=Object.assign({maxRedirects:a.maxRedirects,maxBodyLength:a.maxBodyLength},e,n)).nativeProtocols=i,F(n.host)||F(n.hostname)||(n.hostname="::1"),u.equal(n.protocol,o,"protocol mismatch"),d("options",n),new k(n,t)},configurable:!0,enumerable:!0,writable:!0},get:{value:function(e,a,i){var n=s.request(e,a,i);return n.end(),n},configurable:!0,enumerable:!0,writable:!0}})})),a}function E(){}function O(e){var a;if(m)a=new r(e);else if(!F((a=R(s.parse(e))).protocol))throw new h({input:e});return a}function R(e){if(/^\[/.test(e.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(e.hostname))throw new h({input:e.href||e});if(/^\[/.test(e.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(e.host))throw new h({input:e.href||e});return e}function C(e,a){var i=a||{};for(var n of x)i[n]=e[n];return i.hostname.startsWith("[")&&(i.hostname=i.hostname.slice(1,-1)),""!==i.port&&(i.port=Number(i.port)),i.path=i.search?i.pathname+i.search:i.pathname,i}function S(e,a){var i;for(var n in a)e.test(n)&&(i=a[n],delete a[n]);return null==i?void 0:String(i).trim()}function A(e,a,i){function n(i){P(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,i||{}),this.code=e,this.message=this.cause?a+": "+this.cause.message:a}return n.prototype=new(i||Error),Object.defineProperties(n.prototype,{constructor:{value:n,enumerable:!1},name:{value:"Error ["+e+"]",enumerable:!1}}),n}function T(e,a){for(var i of f)e.removeListener(i,v[i]);e.on("error",E),e.destroy(a)}function F(e){return"string"==typeof e||e instanceof String}function P(e){return"function"==typeof e}k.prototype=Object.create(l.prototype),k.prototype.abort=function(){T(this._currentRequest),this._currentRequest.abort(),this.emit("abort")},k.prototype.destroy=function(e){return T(this._currentRequest,e),_.call(this,e),this},k.prototype.write=function(e,a,i){if(this._ending)throw new w;if(!(F(e)||"object"==typeof(n=e)&&"length"in n))throw new TypeError("data should be a string, Buffer or Uint8Array");var n;P(a)&&(i=a,a=null),0!==e.length?this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:a}),this._currentRequest.write(e,a,i)):(this.emit("error",new y),this.abort()):i&&i()},k.prototype.end=function(e,a,i){if(P(e)?(i=e,e=a=null):P(a)&&(i=a,a=null),e){var n=this,o=this._currentRequest;this.write(e,a,(function(){n._ended=!0,o.end(null,null,i)})),this._ending=!0}else this._ended=this._ending=!0,this._currentRequest.end(null,null,i)},k.prototype.setHeader=function(e,a){this._options.headers[e]=a,this._currentRequest.setHeader(e,a)},k.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)},k.prototype.setTimeout=function(e,a){var i=this;function n(a){a.setTimeout(e),a.removeListener("timeout",a.destroy),a.addListener("timeout",a.destroy)}function o(a){i._timeout&&clearTimeout(i._timeout),i._timeout=setTimeout((function(){i.emit("timeout"),t()}),e),n(a)}function t(){i._timeout&&(clearTimeout(i._timeout),i._timeout=null),i.removeListener("abort",t),i.removeListener("error",t),i.removeListener("response",t),i.removeListener("close",t),a&&i.removeListener("timeout",a),i.socket||i._currentRequest.removeListener("socket",o)}return a&&this.on("timeout",a),this.socket?o(this.socket):this._currentRequest.once("socket",o),this.on("socket",n),this.on("abort",t),this.on("error",t),this.on("response",t),this.on("close",t),this},["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach((function(e){k.prototype[e]=function(a,i){return this._currentRequest[e](a,i)}})),["aborted","connection","socket"].forEach((function(e){Object.defineProperty(k.prototype,e,{get:function(){return this._currentRequest[e]}})})),k.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var a=e.path.indexOf("?");a<0?e.pathname=e.path:(e.pathname=e.path.substring(0,a),e.search=e.path.substring(a))}},k.prototype._performRequest=function(){var e=this._options.protocol,a=this._options.nativeProtocols[e];if(!a)throw new TypeError("Unsupported protocol "+e);if(this._options.agents){var i=e.slice(0,-1);this._options.agent=this._options.agents[i]}var n=this._currentRequest=a.request(this._options,this._onNativeResponse);for(var o of(n._redirectable=this,f))n.on(o,v[o]);if(this._currentUrl=/^\//.test(this._options.path)?s.format(this._options):this._options.path,this._isRedirect){var t=0,r=this,c=this._requestBodyBuffers;!function e(a){if(n===r._currentRequest)if(a)r.emit("error",a);else if(t<c.length){var i=c[t++];n.finished||n.write(i.data,i.encoding,e)}else r._ended&&n.end()}()}},k.prototype._processResponse=function(e){var a=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:a});var i,n=e.headers.location;if(!n||!1===this._options.followRedirects||a<300||a>=400)return e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),void(this._requestBodyBuffers=[]);if(T(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)throw new g;var o=this._options.beforeRedirect;o&&(i=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var t=this._options.method;((301===a||302===a)&&"POST"===this._options.method||303===a&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],S(/^content-/i,this._options.headers));var c,p,l=S(/^host$/i,this._options.headers),x=O(this._currentUrl),f=l||x.host,v=/^\w+:/.test(n)?this._currentUrl:s.format(Object.assign(x,{host:f})),h=(c=n,p=v,m?new r(c,p):O(s.resolve(p,c)));if(d("redirecting to",h.href),this._isRedirect=!0,C(h,this._options),(h.protocol!==x.protocol&&"https:"!==h.protocol||h.host!==f&&!function(e,a){u(F(e)&&F(a));var i=e.length-a.length-1;return i>0&&"."===e[i]&&e.endsWith(a)}(h.host,f))&&S(/^(?:(?:proxy-)?authorization|cookie)$/i,this._options.headers),P(o)){var b={headers:e.headers,statusCode:a},y={url:v,method:t,headers:i};o(this._options,b,y),this._sanitizeOptions(this._options)}this._performRequest()},e.exports=j({http:c,https:p}),e.exports.wrap=j},6882:(e,a,i)=>{var n=i(9779),o=i(3837),t=i(1017),s=i(3685),r=i(5687),c=i(7310).parse,p=i(7147),l=i(2781).Stream,u=i(983),d=i(9118),m=i(4105),x=i(2275);function f(e){if(!(this instanceof f))return new f(e);for(var a in this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],n.call(this),e=e||{})this[a]=e[a]}e.exports=f,o.inherits(f,n),f.LINE_BREAK="\r\n",f.DEFAULT_CONTENT_TYPE="application/octet-stream",f.prototype.append=function(e,a,i){"string"==typeof(i=i||{})&&(i={filename:i});var o=n.prototype.append.bind(this);if("number"==typeof a&&(a=""+a),Array.isArray(a))this._error(new Error("Arrays are not supported."));else{var t=this._multiPartHeader(e,a,i),s=this._multiPartFooter();o(t),o(a),o(s),this._trackLength(t,a,i)}},f.prototype._trackLength=function(e,a,i){var n=0;null!=i.knownLength?n+=+i.knownLength:Buffer.isBuffer(a)?n=a.length:"string"==typeof a&&(n=Buffer.byteLength(a)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+f.LINE_BREAK.length,a&&(a.path||a.readable&&Object.prototype.hasOwnProperty.call(a,"httpVersion")||a instanceof l)&&(i.knownLength||this._valuesToMeasure.push(a))},f.prototype._lengthRetriever=function(e,a){Object.prototype.hasOwnProperty.call(e,"fd")?null!=e.end&&e.end!=1/0&&null!=e.start?a(null,e.end+1-(e.start?e.start:0)):p.stat(e.path,(function(i,n){var o;i?a(i):(o=n.size-(e.start?e.start:0),a(null,o))})):Object.prototype.hasOwnProperty.call(e,"httpVersion")?a(null,+e.headers["content-length"]):Object.prototype.hasOwnProperty.call(e,"httpModule")?(e.on("response",(function(i){e.pause(),a(null,+i.headers["content-length"])})),e.resume()):a("Unknown stream")},f.prototype._multiPartHeader=function(e,a,i){if("string"==typeof i.header)return i.header;var n,o=this._getContentDisposition(a,i),t=this._getContentType(a,i),s="",r={"Content-Disposition":["form-data",'name="'+e+'"'].concat(o||[]),"Content-Type":[].concat(t||[])};for(var c in"object"==typeof i.header&&x(r,i.header),r)if(Object.prototype.hasOwnProperty.call(r,c)){if(null==(n=r[c]))continue;Array.isArray(n)||(n=[n]),n.length&&(s+=c+": "+n.join("; ")+f.LINE_BREAK)}return"--"+this.getBoundary()+f.LINE_BREAK+s+f.LINE_BREAK},f.prototype._getContentDisposition=function(e,a){var i,n;return"string"==typeof a.filepath?i=t.normalize(a.filepath).replace(/\\/g,"/"):a.filename||e.name||e.path?i=t.basename(a.filename||e.name||e.path):e.readable&&Object.prototype.hasOwnProperty.call(e,"httpVersion")&&(i=t.basename(e.client._httpMessage.path||"")),i&&(n='filename="'+i+'"'),n},f.prototype._getContentType=function(e,a){var i=a.contentType;return!i&&e.name&&(i=u.lookup(e.name)),!i&&e.path&&(i=u.lookup(e.path)),!i&&e.readable&&Object.prototype.hasOwnProperty.call(e,"httpVersion")&&(i=e.headers["content-type"]),i||!a.filepath&&!a.filename||(i=u.lookup(a.filepath||a.filename)),i||"object"!=typeof e||(i=f.DEFAULT_CONTENT_TYPE),i},f.prototype._multiPartFooter=function(){return function(e){var a=f.LINE_BREAK;0===this._streams.length&&(a+=this._lastBoundary()),e(a)}.bind(this)},f.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+f.LINE_BREAK},f.prototype.getHeaders=function(e){var a,i={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(a in e)Object.prototype.hasOwnProperty.call(e,a)&&(i[a.toLowerCase()]=e[a]);return i},f.prototype.setBoundary=function(e){this._boundary=e},f.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary},f.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),a=this.getBoundary(),i=0,n=this._streams.length;i<n;i++)"function"!=typeof this._streams[i]&&(e=Buffer.isBuffer(this._streams[i])?Buffer.concat([e,this._streams[i]]):Buffer.concat([e,Buffer.from(this._streams[i])]),"string"==typeof this._streams[i]&&this._streams[i].substring(2,a.length+2)===a||(e=Buffer.concat([e,Buffer.from(f.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])},f.prototype._generateBoundary=function(){for(var e="--------------------------",a=0;a<24;a++)e+=Math.floor(10*Math.random()).toString(16);this._boundary=e},f.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e},f.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e},f.prototype.getLength=function(e){var a=this._overheadLength+this._valueLength;this._streams.length&&(a+=this._lastBoundary().length),this._valuesToMeasure.length?d.parallel(this._valuesToMeasure,this._lengthRetriever,(function(i,n){i?e(i):(n.forEach((function(e){a+=e})),e(null,a))})):process.nextTick(e.bind(this,null,a))},f.prototype.submit=function(e,a){var i,n,o={method:"post"};return"string"==typeof e?(e=c(e),n=x({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(n=x(e,o)).port||(n.port="https:"==n.protocol?443:80),n.headers=this.getHeaders(e.headers),i="https:"==n.protocol?r.request(n):s.request(n),this.getLength(function(e,n){if(e&&"Unknown stream"!==e)this._error(e);else if(n&&i.setHeader("Content-Length",n),this.pipe(i),a){var o,t=function(e,n){return i.removeListener("error",t),i.removeListener("response",o),a.call(this,e,n)};o=t.bind(this,null),i.on("error",t),i.on("response",o)}}.bind(this)),i},f.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))},f.prototype.toString=function(){return"[object FormData]"},m(f,"FormData")},2275:e=>{e.exports=function(e,a){return Object.keys(a).forEach((function(i){e[i]=e[i]||a[i]})),e}},7648:e=>{"use strict";var a=Object.prototype.toString,i=Math.max,n=function(e,a){for(var i=[],n=0;n<e.length;n+=1)i[n]=e[n];for(var o=0;o<a.length;o+=1)i[o+e.length]=a[o];return i};e.exports=function(e){var o=this;if("function"!=typeof o||"[object Function]"!==a.apply(o))throw new TypeError("Function.prototype.bind called on incompatible "+o);for(var t,s=function(e){for(var a=[],i=1,n=0;i<e.length;i+=1,n+=1)a[n]=e[i];return a}(arguments),r=i(0,o.length-s.length),c=[],p=0;p<r;p++)c[p]="$"+p;if(t=Function("binder","return function ("+function(e){for(var a="",i=0;i<e.length;i+=1)a+=e[i],i+1<e.length&&(a+=",");return a}(c)+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof t){var a=o.apply(this,n(s,arguments));return Object(a)===a?a:this}return o.apply(e,n(s,arguments))})),o.prototype){var l=function(){};l.prototype=o.prototype,t.prototype=new l,l.prototype=null}return t}},8612:(e,a,i)=>{"use strict";var n=i(7648);e.exports=Function.prototype.bind||n},210:(e,a,i)=>{"use strict";var n,o=i(8892),t=i(1648),s=i(3981),r=i(4726),c=i(6712),p=i(3464),l=i(4453),u=i(3915),d=i(9738),m=i(6329),x=i(2264),f=i(5730),v=i(707),h=i(3862),b=i(9550),g=Function,y=function(e){try{return g('"use strict"; return ('+e+").constructor;")()}catch(e){}},w=i(7296),_=i(4429),k=function(){throw new l},j=w?function(){try{return k}catch(e){try{return w(arguments,"callee").get}catch(e){return k}}}():k,E=i(1405)(),O=i(1618),R=i(8899),C=i(443),S=i(1768),A=i(8928),T={},F="undefined"!=typeof Uint8Array&&O?O(Uint8Array):n,P={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":E&&O?O([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":T,"%AsyncGenerator%":T,"%AsyncGeneratorFunction%":T,"%AsyncIteratorPrototype%":T,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":s,"%Float16Array%":"undefined"==typeof Float16Array?n:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":g,"%GeneratorFunction%":T,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":E&&O?O(O([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&E&&O?O((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":o,"%Object.getOwnPropertyDescriptor%":w,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":r,"%ReferenceError%":c,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&E&&O?O((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":E&&O?O(""[Symbol.iterator]()):n,"%Symbol%":E?Symbol:n,"%SyntaxError%":p,"%ThrowTypeError%":j,"%TypedArray%":F,"%TypeError%":l,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":u,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet,"%Function.prototype.call%":A,"%Function.prototype.apply%":S,"%Object.defineProperty%":_,"%Object.getPrototypeOf%":R,"%Math.abs%":d,"%Math.floor%":m,"%Math.max%":x,"%Math.min%":f,"%Math.pow%":v,"%Math.round%":h,"%Math.sign%":b,"%Reflect.getPrototypeOf%":C};if(O)try{null.error}catch(e){var z=O(O(e));P["%Error.prototype%"]=z}var q=function e(a){var i;if("%AsyncFunction%"===a)i=y("async function () {}");else if("%GeneratorFunction%"===a)i=y("function* () {}");else if("%AsyncGeneratorFunction%"===a)i=y("async function* () {}");else if("%AsyncGenerator%"===a){var n=e("%AsyncGeneratorFunction%");n&&(i=n.prototype)}else if("%AsyncIteratorPrototype%"===a){var o=e("%AsyncGenerator%");o&&O&&(i=O(o.prototype))}return P[a]=i,i},L={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},U=i(8612),B=i(8824),N=U.call(A,Array.prototype.concat),D=U.call(S,Array.prototype.splice),I=U.call(A,String.prototype.replace),M=U.call(A,String.prototype.slice),H=U.call(A,RegExp.prototype.exec),$=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,W=/\\(\\)?/g,G=function(e,a){var i,n=e;if(B(L,n)&&(n="%"+(i=L[n])[0]+"%"),B(P,n)){var o=P[n];if(o===T&&(o=q(n)),void 0===o&&!a)throw new l("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:o}}throw new p("intrinsic "+e+" does not exist!")};e.exports=function(e,a){if("string"!=typeof e||0===e.length)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof a)throw new l('"allowMissing" argument must be a boolean');if(null===H(/^%?[^%]*%?$/,e))throw new p("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=function(e){var a=M(e,0,1),i=M(e,-1);if("%"===a&&"%"!==i)throw new p("invalid intrinsic syntax, expected closing `%`");if("%"===i&&"%"!==a)throw new p("invalid intrinsic syntax, expected opening `%`");var n=[];return I(e,$,(function(e,a,i,o){n[n.length]=i?I(o,W,"$1"):a||e})),n}(e),n=i.length>0?i[0]:"",o=G("%"+n+"%",a),t=o.name,s=o.value,r=!1,c=o.alias;c&&(n=c[0],D(i,N([0,1],c)));for(var u=1,d=!0;u<i.length;u+=1){var m=i[u],x=M(m,0,1),f=M(m,-1);if(('"'===x||"'"===x||"`"===x||'"'===f||"'"===f||"`"===f)&&x!==f)throw new p("property names with quotes must have matching quotes");if("constructor"!==m&&d||(r=!0),B(P,t="%"+(n+="."+m)+"%"))s=P[t];else if(null!=s){if(!(m in s)){if(!a)throw new l("base intrinsic for "+e+" exists, but the property is not available.");return}if(w&&u+1>=i.length){var v=w(s,m);s=(d=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:s[m]}else d=B(s,m),s=s[m];d&&!r&&(P[t]=s)}}return s}},8899:(e,a,i)=>{"use strict";var n=i(8892);e.exports=n.getPrototypeOf||null},443:e=>{"use strict";e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},1618:(e,a,i)=>{"use strict";var n=i(443),o=i(8899),t=i(6504);e.exports=n?function(e){return n(e)}:o?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return o(e)}:t?function(e){return t(e)}:null},690:e=>{"use strict";e.exports=Object.getOwnPropertyDescriptor},7296:(e,a,i)=>{"use strict";var n=i(690);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},6560:e=>{"use strict";e.exports=(e,a=process.argv)=>{const i=e.startsWith("-")?"":1===e.length?"-":"--",n=a.indexOf(i+e),o=a.indexOf("--");return-1!==n&&(-1===o||n<o)}},1405:(e,a,i)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=i(5419);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},5419:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},a=Symbol("test"),i=Object(a);if("string"==typeof a)return!1;if("[object Symbol]"!==Object.prototype.toString.call(a))return!1;if("[object Symbol]"!==Object.prototype.toString.call(i))return!1;for(var n in e[a]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==a)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,a))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var t=Object.getOwnPropertyDescriptor(e,a);if(42!==t.value||!0!==t.enumerable)return!1}return!0}},6410:(e,a,i)=>{"use strict";var n=i(5419);e.exports=function(){return n()&&!!Symbol.toStringTag}},8824:(e,a,i)=>{"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,t=i(8612);e.exports=t.call(n,o)},9738:e=>{"use strict";e.exports=Math.abs},6329:e=>{"use strict";e.exports=Math.floor},3678:e=>{"use strict";e.exports=Number.isNaN||function(e){return e!=e}},2264:e=>{"use strict";e.exports=Math.max},5730:e=>{"use strict";e.exports=Math.min},707:e=>{"use strict";e.exports=Math.pow},3862:e=>{"use strict";e.exports=Math.round},9550:(e,a,i)=>{"use strict";var n=i(3678);e.exports=function(e){return n(e)||0===e?e:e<0?-1:1}},983:(e,a,i)=>{"use strict";var n,o,t,s=i(8240),r=i(1017).extname,c=/^\s*([^;\s]*)(?:;|\s|$)/,p=/^text\//i;function l(e){if(!e||"string"!=typeof e)return!1;var a=c.exec(e),i=a&&s[a[1].toLowerCase()];return i&&i.charset?i.charset:!(!a||!p.test(a[1]))&&"UTF-8"}a.charset=l,a.charsets={lookup:l},a.contentType=function(e){if(!e||"string"!=typeof e)return!1;var i=-1===e.indexOf("/")?a.lookup(e):e;if(!i)return!1;if(-1===i.indexOf("charset")){var n=a.charset(i);n&&(i+="; charset="+n.toLowerCase())}return i},a.extension=function(e){if(!e||"string"!=typeof e)return!1;var i=c.exec(e),n=i&&a.extensions[i[1].toLowerCase()];return!(!n||!n.length)&&n[0]},a.extensions=Object.create(null),a.lookup=function(e){if(!e||"string"!=typeof e)return!1;var i=r("x."+e).toLowerCase().substr(1);return i&&a.types[i]||!1},a.types=Object.create(null),n=a.extensions,o=a.types,t=["nginx","apache",void 0,"iana"],Object.keys(s).forEach((function(e){var a=s[e],i=a.extensions;if(i&&i.length){n[e]=i;for(var r=0;r<i.length;r++){var c=i[r];if(o[c]){var p=t.indexOf(s[o[c]].source),l=t.indexOf(a.source);if("application/octet-stream"!==o[c]&&(p>l||p===l&&"application/"===o[c].substr(0,12)))continue}o[c]=e}}}))},8240:(e,a,i)=>{e.exports=i(2590)},7824:e=>{var a=1e3,i=60*a,n=60*i,o=24*n,t=7*o;function s(e,a,i,n){var o=a>=1.5*i;return Math.round(e/i)+" "+n+(o?"s":"")}e.exports=function(e,r){r=r||{};var c,p,l=typeof e;if("string"===l&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var s=/^(-?(?:\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(s){var r=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r;case"weeks":case"week":case"w":return r*t;case"days":case"day":case"d":return r*o;case"hours":case"hour":case"hrs":case"hr":case"h":return r*n;case"minutes":case"minute":case"mins":case"min":case"m":return r*i;case"seconds":case"second":case"secs":case"sec":case"s":return r*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}(e);if("number"===l&&isFinite(e))return r.long?(c=e,(p=Math.abs(c))>=o?s(c,p,o,"day"):p>=n?s(c,p,n,"hour"):p>=i?s(c,p,i,"minute"):p>=a?s(c,p,a,"second"):c+" ms"):function(e){var t=Math.abs(e);return t>=o?Math.round(e/o)+"d":t>=n?Math.round(e/n)+"h":t>=i?Math.round(e/i)+"m":t>=a?Math.round(e/a)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},1394:(e,a,i)=>{"use strict";var n=i(7310).parse,o={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443},t=String.prototype.endsWith||function(e){return e.length<=this.length&&-1!==this.indexOf(e,this.length-e.length)};function s(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}a.getProxyForUrl=function(e){var a="string"==typeof e?n(e):e||{},i=a.protocol,r=a.host,c=a.port;if("string"!=typeof r||!r||"string"!=typeof i)return"";if(i=i.split(":",1)[0],!function(e,a){var i=(s("npm_config_no_proxy")||s("no_proxy")).toLowerCase();return!i||"*"!==i&&i.split(/[,\s]/).every((function(i){if(!i)return!0;var n=i.match(/^(.+):(\d+)$/),o=n?n[1]:i,s=n?parseInt(n[2]):0;return!(!s||s===a)||(/^[.*]/.test(o)?("*"===o.charAt(0)&&(o=o.slice(1)),!t.call(e,o)):e!==o)}))}(r=r.replace(/:\d*$/,""),c=parseInt(c)||o[i]||0))return"";var p=s("npm_config_"+i+"_proxy")||s(i+"_proxy")||s("npm_config_proxy")||s("all_proxy");return p&&-1===p.indexOf("://")&&(p=i+"://"+p),p}},2130:(e,a,i)=>{"use strict";const n=i(2037),o=i(6224),t=i(6560),{env:s}=process;let r;function c(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function p(e,a){if(0===r)return 0;if(t("color=16m")||t("color=full")||t("color=truecolor"))return 3;if(t("color=256"))return 2;if(e&&!a&&void 0===r)return 0;const i=r||0;if("dumb"===s.TERM)return i;if("win32"===process.platform){const e=n.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in s)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in s))||"codeship"===s.CI_NAME?1:i;if("TEAMCITY_VERSION"in s)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(s.TEAMCITY_VERSION)?1:0;if("truecolor"===s.COLORTERM)return 3;if("TERM_PROGRAM"in s){const e=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(s.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(s.TERM)||"COLORTERM"in s?1:i}t("no-color")||t("no-colors")||t("color=false")||t("color=never")?r=0:(t("color")||t("colors")||t("color=true")||t("color=always"))&&(r=1),"FORCE_COLOR"in s&&(r="true"===s.FORCE_COLOR?1:"false"===s.FORCE_COLOR?0:0===s.FORCE_COLOR.length?1:Math.min(parseInt(s.FORCE_COLOR,10),3)),e.exports={supportsColor:function(e){return c(p(e,e&&e.isTTY))},stdout:c(p(!0,o.isatty(1))),stderr:c(p(!0,o.isatty(2)))}},3559:(e,a,i)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return o}});const n=i(5355);let o=class{constructor(e,a,i="agiliumtrade.agiliumtrade.ai"){this._httpClient=e,this._domain=i,this._token=a,this._urlCache=null,this._accountCache={}}get token(){return this._token}async requestMetastats(e,a){await this._updateHost(),await this._updateAccountHost(a);const i=this._accountCache[a];try{const a=i.regions[i.regionIndex],n=e(`https://metastats-api-v1.${a.region}.${this._urlCache.domain}`,a.id);return await this._httpClient.request(n)}catch(n){if(["ConflictError","InternalError","ApiError","TimeoutError"].includes(n.name)){if(i.regions.length===i.regionIndex+1)throw i.regionIndex=0,n;return i.regionIndex++,await this.requestMetastats(e,a)}throw n}}async _updateHost(){if(!this._urlCache||this._urlCache.lastUpdated<Date.now()-6e5){const e=await this._httpClient.requestWithFailover({url:`https://mt-provisioning-api-v1.${this._domain}/users/current/servers/mt-client-api`,method:"GET",headers:{"auth-token":this._token},json:!0});this._urlCache={domain:e.domain,lastUpdated:Date.now()}}}async _updateAccountHost(e){if(!this._accountCache[e]||this._accountCache[e].lastUpdated<Date.now()-6e5){const a=async e=>{const a={url:`https://mt-provisioning-api-v1.${this._domain}/users/current/accounts/${e}`,method:"GET",headers:{"auth-token":this._token},json:!0};return await this._httpClient.requestWithFailover(a)};let i=[],o=await a(e);if(o.primaryAccountId&&(o=await a(o.primaryAccountId)),i=[{_id:o._id,region:o.region,state:o.state}].concat(o.accountReplicas||[]),i=i.filter((e=>"DEPLOYED"===e.state)),!i.length)throw new n.ValidationError("There are no replicas deployed yet. Please make sure at least one of the replicas is deployed.");let t=i.map((e=>({region:e.region,id:e._id})));this._accountCache[e]={regions:t,regionIndex:0,lastUpdated:Date.now()}}}}},5355:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),function(e,a){for(var i in a)Object.defineProperty(e,i,{enumerable:!0,get:a[i]})}(a,{ApiError:function(){return n},ForbiddenError:function(){return t},InternalError:function(){return c},NotFoundError:function(){return o},TooManyRequestsError:function(){return p},UnauthorizedError:function(){return s},ValidationError:function(){return r}});const i="undefined"!=typeof process&&process.release&&"node"===process.release.name;let n=class extends Error{constructor(e,a,n,o){super(o?a+". Request URL: "+o:a),this.name=e.name,this.status=n,this.url=o,i&&Error.captureStackTrace&&Error.captureStackTrace(this,e)}set code(e){this._code=e}get code(){return this._code}set arguments(e){this._args=e}get arguments(){return this._args}},o=class e extends n{constructor(a,i){super(e,a,404,i)}},t=class e extends n{constructor(a,i){super(e,a,403,i)}},s=class e extends n{constructor(a,i){super(e,a,401,i)}},r=class e extends n{constructor(a,i,n){super(e,a,400,n),this.details=i}},c=class e extends n{constructor(a,i){super(e,a,500,i)}},p=class e extends n{constructor(a,i,n){super(e,a,429,n),this.metadata=i}}},4313:(e,a,i)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),function(e,a){for(var i in a)Object.defineProperty(e,i,{enumerable:!0,get:a[i]})}(a,{HttpClientMock:function(){return c},default:function(){return r}});const n=s(i(3306)),o=i(5355),t=s(i(6554));function s(e){return e&&e.__esModule?e:{default:e}}let r=class{constructor(e=60,a={}){this._timeout=1e3*e,this._retries=a.retries||5,this._minRetryDelay=1e3*(a.minDelayInSeconds||1),this._maxRetryDelay=1e3*(a.maxDelayInSeconds||30)}async request(e,a=Date.now()+this._maxRetryDelay*this._retries){e.timeout=this._timeout;let i,n=0;e.callback=(e,a)=>{a&&202===a.status&&(n=a.headers["retry-after"])};try{const a=await this._makeRequest(e);e.callback(null,a),i=a&&a.data||void 0}catch(e){throw this._convertError(e)}return n&&(await this._handleRetry(a,1e3*n),i=await this.request(e,a)),i}async requestWithFailover(e,a=0,i=Date.now()+this._maxRetryDelay*this._retries){e.timeout=this._timeout;let n,o=0;e.callback=(e,a)=>{a&&202===a.status&&(o=a.headers["retry-after"])};try{const a=await this._makeRequest(e);e.callback(null,a),n=a&&a.data||void 0}catch(n){return a=await this._handleError(n,a,i),this.requestWithFailover(e,a,i)}return o&&(await this._handleRetry(i,1e3*o),n=await this.requestWithFailover(e,a,i)),n}_makeRequest(e){return(0,n.default)({transitional:{clarifyTimeoutError:!0},...e})}async _wait(e){await new Promise((a=>setTimeout(a,e)))}async _handleRetry(e,a){if(!(e>Date.now()+a))throw new t.default("Timed out