opentrader
Version:
OpenTrader is a powerful open-source crypto trading bot designated to automate your trading strategies on various cryptocurrency exchanges.
69 lines (60 loc) • 37.3 kB
JavaScript
import{b0 as ae,b1 as mt,a$ as lt}from"./index-Du-vO1Hr.js";import{a as Oe,c as Et,d as wt,e as Ot,f as St,g as jt,h as pt,b as je}from"./browser-rfzQWLT_.js";import{r as qt}from"./callBound-DcviPCZX.js";import{A as Pt}from"./index-1J4FGkgF.js";import"./__vite-browser-external-v7f2oYTb.js";var Pe={exports:{}},Re={},We;function ht(){if(We)return Re;We=1;function h(i){"@babel/helpers - typeof";return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},h(i)}function S(i,a,g){return Object.defineProperty(i,"prototype",{writable:!1}),i}function b(i,a){if(!(i instanceof a))throw new TypeError("Cannot call a class as a function")}function y(i,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(a&&a.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),a&&I(i,a)}function I(i,a){return I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(P,M){return P.__proto__=M,P},I(i,a)}function T(i){var a=L();return function(){var P=$(i),M;if(a){var R=$(this).constructor;M=Reflect.construct(P,arguments,R)}else M=P.apply(this,arguments);return q(this,M)}}function q(i,a){if(a&&(h(a)==="object"||typeof a=="function"))return a;if(a!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return H(i)}function H(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function L(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function $(i){return $=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(g){return g.__proto__||Object.getPrototypeOf(g)},$(i)}var D={},x,j;function v(i,a,g){g||(g=Error);function P(R,W,B){return typeof a=="string"?a:a(R,W,B)}var M=function(R){y(B,R);var W=T(B);function B(te,re,C){var Q;return b(this,B),Q=W.call(this,P(te,re,C)),Q.code=i,Q}return S(B)}(g);D[i]=M}function k(i,a){if(Array.isArray(i)){var g=i.length;return i=i.map(function(P){return String(P)}),g>2?"one of ".concat(a," ").concat(i.slice(0,g-1).join(", "),", or ")+i[g-1]:g===2?"one of ".concat(a," ").concat(i[0]," or ").concat(i[1]):"of ".concat(a," ").concat(i[0])}else return"of ".concat(a," ").concat(String(i))}function X(i,a,g){return i.substr(0,a.length)===a}function J(i,a,g){return(g===void 0||g>i.length)&&(g=i.length),i.substring(g-a.length,g)===a}function F(i,a,g){return typeof g!="number"&&(g=0),g+a.length>i.length?!1:i.indexOf(a,g)!==-1}return v("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),v("ERR_INVALID_ARG_TYPE",function(i,a,g){x===void 0&&(x=Ce()),x(typeof i=="string","'name' must be a string");var P;typeof a=="string"&&X(a,"not ")?(P="must not be",a=a.replace(/^not /,"")):P="must be";var M;if(J(i," argument"))M="The ".concat(i," ").concat(P," ").concat(k(a,"type"));else{var R=F(i,".")?"property":"argument";M='The "'.concat(i,'" ').concat(R," ").concat(P," ").concat(k(a,"type"))}return M+=". Received type ".concat(h(g)),M},TypeError),v("ERR_INVALID_ARG_VALUE",function(i,a){var g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";j===void 0&&(j=Oe());var P=j.inspect(a);return P.length>128&&(P="".concat(P.slice(0,128),"...")),"The argument '".concat(i,"' ").concat(g,". Received ").concat(P)},TypeError),v("ERR_INVALID_RETURN_VALUE",function(i,a,g){var P;return g&&g.constructor&&g.constructor.name?P="instance of ".concat(g.constructor.name):P="type ".concat(h(g)),"Expected ".concat(i,' to be returned from the "').concat(a,'"')+" function but got ".concat(P,".")},TypeError),v("ERR_MISSING_ARGS",function(){for(var i=arguments.length,a=new Array(i),g=0;g<i;g++)a[g]=arguments[g];x===void 0&&(x=Ce()),x(a.length>0,"At least one arg needs to be specified");var P="The ",M=a.length;switch(a=a.map(function(R){return'"'.concat(R,'"')}),M){case 1:P+="".concat(a[0]," argument");break;case 2:P+="".concat(a[0]," and ").concat(a[1]," arguments");break;default:P+=a.slice(0,M-1).join(", "),P+=", and ".concat(a[M-1]," arguments");break}return"".concat(P," must be specified")},TypeError),Re.codes=D,Re}var Ae,Ye;function Rt(){if(Ye)return Ae;Ye=1;function h(c,u){var E=Object.keys(c);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(c);u&&(d=d.filter(function(A){return Object.getOwnPropertyDescriptor(c,A).enumerable})),E.push.apply(E,d)}return E}function S(c){for(var u=1;u<arguments.length;u++){var E=arguments[u]!=null?arguments[u]:{};u%2?h(Object(E),!0).forEach(function(d){b(c,d,E[d])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(E)):h(Object(E)).forEach(function(d){Object.defineProperty(c,d,Object.getOwnPropertyDescriptor(E,d))})}return c}function b(c,u,E){return u=q(u),u in c?Object.defineProperty(c,u,{value:E,enumerable:!0,configurable:!0,writable:!0}):c[u]=E,c}function y(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function I(c,u){for(var E=0;E<u.length;E++){var d=u[E];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(c,q(d.key),d)}}function T(c,u,E){return u&&I(c.prototype,u),Object.defineProperty(c,"prototype",{writable:!1}),c}function q(c){var u=H(c,"string");return i(u)==="symbol"?u:String(u)}function H(c,u){if(i(c)!=="object"||c===null)return c;var E=c[Symbol.toPrimitive];if(E!==void 0){var d=E.call(c,u);if(i(d)!=="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}function L(c,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(u&&u.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),u&&J(c,u)}function $(c){var u=k();return function(){var d=F(c),A;if(u){var n=F(this).constructor;A=Reflect.construct(d,arguments,n)}else A=d.apply(this,arguments);return D(this,A)}}function D(c,u){if(u&&(i(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return x(c)}function x(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function j(c){var u=typeof Map=="function"?new Map:void 0;return j=function(d){if(d===null||!X(d))return d;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(typeof u<"u"){if(u.has(d))return u.get(d);u.set(d,A)}function A(){return v(d,arguments,F(this).constructor)}return A.prototype=Object.create(d.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),J(A,d)},j(c)}function v(c,u,E){return k()?v=Reflect.construct.bind():v=function(A,n,t){var o=[null];o.push.apply(o,n);var l=Function.bind.apply(A,o),f=new l;return t&&J(f,t.prototype),f},v.apply(null,arguments)}function k(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function X(c){return Function.toString.call(c).indexOf("[native code]")!==-1}function J(c,u){return J=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(d,A){return d.__proto__=A,d},J(c,u)}function F(c){return F=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},F(c)}function i(c){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},i(c)}var a=Oe(),g=a.inspect,P=ht(),M=P.codes.ERR_INVALID_ARG_TYPE;function R(c,u,E){return(E===void 0||E>c.length)&&(E=c.length),c.substring(E-u.length,E)===u}function W(c,u){if(u=Math.floor(u),c.length==0||u==0)return"";var E=c.length*u;for(u=Math.floor(Math.log(u)/Math.log(2));u;)c+=c,u--;return c+=c.substring(0,E-c.length),c}var B="",te="",re="",C="",Q={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},he=10;function ye(c){var u=Object.keys(c),E=Object.create(Object.getPrototypeOf(c));return u.forEach(function(d){E[d]=c[d]}),Object.defineProperty(E,"message",{value:c.message}),E}function ie(c){return g(c,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function ge(c,u,E){var d="",A="",n=0,t="",o=!1,l=ie(c),f=l.split(`
`),p=ie(u).split(`
`),w=0,V="";if(E==="strictEqual"&&i(c)==="object"&&i(u)==="object"&&c!==null&&u!==null&&(E="strictEqualObject"),f.length===1&&p.length===1&&f[0]!==p[0]){var z=f[0].length+p[0].length;if(z<=he){if((i(c)!=="object"||c===null)&&(i(u)!=="object"||u===null)&&(c!==0||u!==0))return"".concat(Q[E],`
`)+"".concat(f[0]," !== ").concat(p[0],`
`)}else if(E!=="strictEqualObject"){var Y=ae.stderr&&ae.stderr.isTTY?ae.stderr.columns:80;if(z<Y){for(;f[0][w]===p[0][w];)w++;w>2&&(V=`
`.concat(W(" ",w),"^"),w=0)}}}for(var K=f[f.length-1],se=p[p.length-1];K===se&&(w++<2?t=`
`.concat(K).concat(t):d=K,f.pop(),p.pop(),!(f.length===0||p.length===0));)K=f[f.length-1],se=p[p.length-1];var be=Math.max(f.length,p.length);if(be===0){var le=l.split(`
`);if(le.length>30)for(le[26]="".concat(B,"...").concat(C);le.length>27;)le.pop();return"".concat(Q.notIdentical,`
`).concat(le.join(`
`),`
`)}w>3&&(t=`
`.concat(B,"...").concat(C).concat(t),o=!0),d!==""&&(t=`
`.concat(d).concat(t),d="");var ne=0,ve=Q[E]+`
`.concat(te,"+ actual").concat(C," ").concat(re,"- expected").concat(C),Se=" ".concat(B,"...").concat(C," Lines skipped");for(w=0;w<be;w++){var oe=w-n;if(f.length<w+1)oe>1&&w>2&&(oe>4?(A+=`
`.concat(B,"...").concat(C),o=!0):oe>3&&(A+=`
`.concat(p[w-2]),ne++),A+=`
`.concat(p[w-1]),ne++),n=w,d+=`
`.concat(re,"-").concat(C," ").concat(p[w]),ne++;else if(p.length<w+1)oe>1&&w>2&&(oe>4?(A+=`
`.concat(B,"...").concat(C),o=!0):oe>3&&(A+=`
`.concat(f[w-2]),ne++),A+=`
`.concat(f[w-1]),ne++),n=w,A+=`
`.concat(te,"+").concat(C," ").concat(f[w]),ne++;else{var pe=p[w],ue=f[w],e=ue!==pe&&(!R(ue,",")||ue.slice(0,-1)!==pe);e&&R(pe,",")&&pe.slice(0,-1)===ue&&(e=!1,ue+=","),e?(oe>1&&w>2&&(oe>4?(A+=`
`.concat(B,"...").concat(C),o=!0):oe>3&&(A+=`
`.concat(f[w-2]),ne++),A+=`
`.concat(f[w-1]),ne++),n=w,A+=`
`.concat(te,"+").concat(C," ").concat(ue),d+=`
`.concat(re,"-").concat(C," ").concat(pe),ne+=2):(A+=d,d="",(oe===1||w===0)&&(A+=`
`.concat(ue),ne++))}if(ne>20&&w<be-2)return"".concat(ve).concat(Se,`
`).concat(A,`
`).concat(B,"...").concat(C).concat(d,`
`)+"".concat(B,"...").concat(C)}return"".concat(ve).concat(o?Se:"",`
`).concat(A).concat(d).concat(t).concat(V)}var ce=function(c,u){L(d,c);var E=$(d);function d(A){var n;if(y(this,d),i(A)!=="object"||A===null)throw new M("options","Object",A);var t=A.message,o=A.operator,l=A.stackStartFn,f=A.actual,p=A.expected,w=Error.stackTraceLimit;if(Error.stackTraceLimit=0,t!=null)n=E.call(this,String(t));else if(ae.stderr&&ae.stderr.isTTY&&(ae.stderr&&ae.stderr.getColorDepth&&ae.stderr.getColorDepth()!==1?(B="\x1B[34m",te="\x1B[32m",C="\x1B[39m",re="\x1B[31m"):(B="",te="",C="",re="")),i(f)==="object"&&f!==null&&i(p)==="object"&&p!==null&&"stack"in f&&f instanceof Error&&"stack"in p&&p instanceof Error&&(f=ye(f),p=ye(p)),o==="deepStrictEqual"||o==="strictEqual")n=E.call(this,ge(f,p,o));else if(o==="notDeepStrictEqual"||o==="notStrictEqual"){var V=Q[o],z=ie(f).split(`
`);if(o==="notStrictEqual"&&i(f)==="object"&&f!==null&&(V=Q.notStrictEqualObject),z.length>30)for(z[26]="".concat(B,"...").concat(C);z.length>27;)z.pop();z.length===1?n=E.call(this,"".concat(V," ").concat(z[0])):n=E.call(this,"".concat(V,`
`).concat(z.join(`
`),`
`))}else{var Y=ie(f),K="",se=Q[o];o==="notDeepEqual"||o==="notEqual"?(Y="".concat(Q[o],`
`).concat(Y),Y.length>1024&&(Y="".concat(Y.slice(0,1021),"..."))):(K="".concat(ie(p)),Y.length>512&&(Y="".concat(Y.slice(0,509),"...")),K.length>512&&(K="".concat(K.slice(0,509),"...")),o==="deepEqual"||o==="equal"?Y="".concat(se,`
`).concat(Y,`
should equal
`):K=" ".concat(o," ").concat(K)),n=E.call(this,"".concat(Y).concat(K))}return Error.stackTraceLimit=w,n.generatedMessage=!t,Object.defineProperty(x(n),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),n.code="ERR_ASSERTION",n.actual=f,n.expected=p,n.operator=o,Error.captureStackTrace&&Error.captureStackTrace(x(n),l),n.stack,n.name="AssertionError",D(n)}return T(d,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:u,value:function(n,t){return g(this,S(S({},t),{},{customInspect:!1,depth:0}))}}]),d}(j(Error),g.custom);return Ae=ce,Ae}var Ie,ke;function yt(){if(ke)return Ie;ke=1;var h=Object.prototype.toString;return Ie=function(b){var y=h.call(b),I=y==="[object Arguments]";return I||(I=y!=="[object Array]"&&b!==null&&typeof b=="object"&&typeof b.length=="number"&&b.length>=0&&h.call(b.callee)==="[object Function]"),I},Ie}var Ne,Xe;function At(){if(Xe)return Ne;Xe=1;var h;if(!Object.keys){var S=Object.prototype.hasOwnProperty,b=Object.prototype.toString,y=yt(),I=Object.prototype.propertyIsEnumerable,T=!I.call({toString:null},"toString"),q=I.call(function(){},"prototype"),H=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],L=function(j){var v=j.constructor;return v&&v.prototype===j},$={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},D=function(){if(typeof window>"u")return!1;for(var j in window)try{if(!$["$"+j]&&S.call(window,j)&&window[j]!==null&&typeof window[j]=="object")try{L(window[j])}catch{return!0}}catch{return!0}return!1}(),x=function(j){if(typeof window>"u"||!D)return L(j);try{return L(j)}catch{return!1}};h=function(v){var k=v!==null&&typeof v=="object",X=b.call(v)==="[object Function]",J=y(v),F=k&&b.call(v)==="[object String]",i=[];if(!k&&!X&&!J)throw new TypeError("Object.keys called on a non-object");var a=q&&X;if(F&&v.length>0&&!S.call(v,0))for(var g=0;g<v.length;++g)i.push(String(g));if(J&&v.length>0)for(var P=0;P<v.length;++P)i.push(String(P));else for(var M in v)!(a&&M==="prototype")&&S.call(v,M)&&i.push(String(M));if(T)for(var R=x(v),W=0;W<H.length;++W)!(R&&H[W]==="constructor")&&S.call(v,H[W])&&i.push(H[W]);return i}}return Ne=h,Ne}var xe,Je;function gt(){if(Je)return xe;Je=1;var h=Array.prototype.slice,S=yt(),b=Object.keys,y=b?function(q){return b(q)}:At(),I=Object.keys;return y.shim=function(){if(Object.keys){var q=function(){var H=Object.keys(arguments);return H&&H.length===arguments.length}(1,2);q||(Object.keys=function(L){return S(L)?I(h.call(L)):I(L)})}else Object.keys=y;return Object.keys||y},xe=y,xe}var Te,Qe;function It(){if(Qe)return Te;Qe=1;var h=gt(),S=Et()(),b=wt(),y=Ot(),I=b("Array.prototype.push"),T=b("Object.prototype.propertyIsEnumerable"),q=S?y.getOwnPropertySymbols:null;return Te=function(L,$){if(L==null)throw new TypeError("target must be an object");var D=y(L);if(arguments.length===1)return D;for(var x=1;x<arguments.length;++x){var j=y(arguments[x]),v=h(j),k=S&&(y.getOwnPropertySymbols||q);if(k)for(var X=k(j),J=0;J<X.length;++J){var F=X[J];T(j,F)&&I(v,F)}for(var i=0;i<v.length;++i){var a=v[i];if(T(j,a)){var g=j[a];D[a]=g}}}return D},Te}var $e,Ze;function Nt(){if(Ze)return $e;Ze=1;var h=It(),S=function(){if(!Object.assign)return!1;for(var y="abcdefghijklmnopqrst",I=y.split(""),T={},q=0;q<I.length;++q)T[I[q]]=I[q];var H=Object.assign({},T),L="";for(var $ in H)L+=$;return y!==L},b=function(){if(!Object.assign||!Object.preventExtensions)return!1;var y=Object.preventExtensions({1:2});try{Object.assign(y,"xy")}catch{return y[1]==="y"}return!1};return $e=function(){return!Object.assign||S()||b()?h:Object.assign},$e}var De,Ke;function dt(){if(Ke)return De;Ke=1;var h=function(S){return S!==S};return De=function(b,y){return b===0&&y===0?1/b===1/y:!!(b===y||h(b)&&h(y))},De}var _e,et;function ze(){if(et)return _e;et=1;var h=dt();return _e=function(){return typeof Object.is=="function"?Object.is:h},_e}var Le,tt;function qe(){if(tt)return Le;tt=1;var h=gt(),S=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",b=Object.prototype.toString,y=Array.prototype.concat,I=St(),T=function($){return typeof $=="function"&&b.call($)==="[object Function]"},q=jt()(),H=function($,D,x,j){if(D in $){if(j===!0){if($[D]===x)return}else if(!T(j)||!j())return}q?I($,D,x,!0):I($,D,x)},L=function($,D){var x=arguments.length>2?arguments[2]:{},j=h(D);S&&(j=y.call(j,Object.getOwnPropertySymbols(D)));for(var v=0;v<j.length;v+=1)H($,j[v],D[j[v]],x[j[v]])};return L.supportsDescriptors=!!q,Le=L,Le}var Fe,rt;function xt(){if(rt)return Fe;rt=1;var h=ze(),S=qe();return Fe=function(){var y=h();return S(Object,{is:y},{is:function(){return Object.is!==y}}),y},Fe}var Me,nt;function Tt(){if(nt)return Me;nt=1;var h=qe(),S=pt(),b=dt(),y=ze(),I=xt(),T=S(y(),Object);return h(T,{getPolyfill:y,implementation:b,shim:I}),Me=T,Me}var Be,ot;function bt(){return ot||(ot=1,Be=function(S){return S!==S}),Be}var Ue,it;function vt(){if(it)return Ue;it=1;var h=bt();return Ue=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:h},Ue}var Ve,at;function $t(){if(at)return Ve;at=1;var h=qe(),S=vt();return Ve=function(){var y=S();return h(Number,{isNaN:y},{isNaN:function(){return Number.isNaN!==y}}),y},Ve}var Ge,ct;function Dt(){if(ct)return Ge;ct=1;var h=pt(),S=qe(),b=bt(),y=vt(),I=$t(),T=h(y(),Number);return S(T,{getPolyfill:y,implementation:b,shim:I}),Ge=T,Ge}var He,ut;function _t(){if(ut)return He;ut=1;function h(e,r){return T(e)||I(e,r)||b(e,r)||S()}function S(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function b(e,r){if(e){if(typeof e=="string")return y(e,r);var s=Object.prototype.toString.call(e).slice(8,-1);if(s==="Object"&&e.constructor&&(s=e.constructor.name),s==="Map"||s==="Set")return Array.from(e);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return y(e,r)}}function y(e,r){(r==null||r>e.length)&&(r=e.length);for(var s=0,m=new Array(r);s<r;s++)m[s]=e[s];return m}function I(e,r){var s=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(s!=null){var m,O,_,N,U=[],G=!0,Z=!1;try{if(_=(s=s.call(e)).next,r!==0)for(;!(G=(m=_.call(s)).done)&&(U.push(m.value),U.length!==r);G=!0);}catch(ee){Z=!0,O=ee}finally{try{if(!G&&s.return!=null&&(N=s.return(),Object(N)!==N))return}finally{if(Z)throw O}}return U}}function T(e){if(Array.isArray(e))return e}function q(e){"@babel/helpers - typeof";return q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},q(e)}var H=/a/g.flags!==void 0,L=function(r){var s=[];return r.forEach(function(m){return s.push(m)}),s},$=function(r){var s=[];return r.forEach(function(m,O){return s.push([O,m])}),s},D=Object.is?Object.is:Tt(),x=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},j=Number.isNaN?Number.isNaN:Dt();function v(e){return e.call.bind(e)}var k=v(Object.prototype.hasOwnProperty),X=v(Object.prototype.propertyIsEnumerable),J=v(Object.prototype.toString),F=Oe().types,i=F.isAnyArrayBuffer,a=F.isArrayBufferView,g=F.isDate,P=F.isMap,M=F.isRegExp,R=F.isSet,W=F.isNativeError,B=F.isBoxedPrimitive,te=F.isNumberObject,re=F.isStringObject,C=F.isBooleanObject,Q=F.isBigIntObject,he=F.isSymbolObject,ye=F.isFloat32Array,ie=F.isFloat64Array;function ge(e){if(e.length===0||e.length>10)return!0;for(var r=0;r<e.length;r++){var s=e.charCodeAt(r);if(s<48||s>57)return!0}return e.length===10&&e>=Math.pow(2,32)}function ce(e){return Object.keys(e).filter(ge).concat(x(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/function c(e,r){if(e===r)return 0;for(var s=e.length,m=r.length,O=0,_=Math.min(s,m);O<_;++O)if(e[O]!==r[O]){s=e[O],m=r[O];break}return s<m?-1:m<s?1:0}var u=!0,E=!1,d=0,A=1,n=2,t=3;function o(e,r){return H?e.source===r.source&&e.flags===r.flags:RegExp.prototype.toString.call(e)===RegExp.prototype.toString.call(r)}function l(e,r){if(e.byteLength!==r.byteLength)return!1;for(var s=0;s<e.byteLength;s++)if(e[s]!==r[s])return!1;return!0}function f(e,r){return e.byteLength!==r.byteLength?!1:c(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(r.buffer,r.byteOffset,r.byteLength))===0}function p(e,r){return e.byteLength===r.byteLength&&c(new Uint8Array(e),new Uint8Array(r))===0}function w(e,r){return te(e)?te(r)&&D(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(r)):re(e)?re(r)&&String.prototype.valueOf.call(e)===String.prototype.valueOf.call(r):C(e)?C(r)&&Boolean.prototype.valueOf.call(e)===Boolean.prototype.valueOf.call(r):Q(e)?Q(r)&&BigInt.prototype.valueOf.call(e)===BigInt.prototype.valueOf.call(r):he(r)&&Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(r)}function V(e,r,s,m){if(e===r)return e!==0?!0:s?D(e,r):!0;if(s){if(q(e)!=="object")return typeof e=="number"&&j(e)&&j(r);if(q(r)!=="object"||e===null||r===null||Object.getPrototypeOf(e)!==Object.getPrototypeOf(r))return!1}else{if(e===null||q(e)!=="object")return r===null||q(r)!=="object"?e==r:!1;if(r===null||q(r)!=="object")return!1}var O=J(e),_=J(r);if(O!==_)return!1;if(Array.isArray(e)){if(e.length!==r.length)return!1;var N=ce(e),U=ce(r);return N.length!==U.length?!1:Y(e,r,s,m,A,N)}if(O==="[object Object]"&&(!P(e)&&P(r)||!R(e)&&R(r)))return!1;if(g(e)){if(!g(r)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(r))return!1}else if(M(e)){if(!M(r)||!o(e,r))return!1}else if(W(e)||e instanceof Error){if(e.message!==r.message||e.name!==r.name)return!1}else if(a(e)){if(!s&&(ye(e)||ie(e))){if(!l(e,r))return!1}else if(!f(e,r))return!1;var G=ce(e),Z=ce(r);return G.length!==Z.length?!1:Y(e,r,s,m,d,G)}else{if(R(e))return!R(r)||e.size!==r.size?!1:Y(e,r,s,m,n);if(P(e))return!P(r)||e.size!==r.size?!1:Y(e,r,s,m,t);if(i(e)){if(!p(e,r))return!1}else if(B(e)&&!w(e,r))return!1}return Y(e,r,s,m,d)}function z(e,r){return r.filter(function(s){return X(e,s)})}function Y(e,r,s,m,O,_){if(arguments.length===5){_=Object.keys(e);var N=Object.keys(r);if(_.length!==N.length)return!1}for(var U=0;U<_.length;U++)if(!k(r,_[U]))return!1;if(s&&arguments.length===5){var G=x(e);if(G.length!==0){var Z=0;for(U=0;U<G.length;U++){var ee=G[U];if(X(e,ee)){if(!X(r,ee))return!1;_.push(ee),Z++}else if(X(r,ee))return!1}var me=x(r);if(G.length!==me.length&&z(r,me).length!==Z)return!1}else{var de=x(r);if(de.length!==0&&z(r,de).length!==0)return!1}}if(_.length===0&&(O===d||O===A&&e.length===0||e.size===0))return!0;if(m===void 0)m={val1:new Map,val2:new Map,position:0};else{var Ee=m.val1.get(e);if(Ee!==void 0){var fe=m.val2.get(r);if(fe!==void 0)return Ee===fe}m.position++}m.val1.set(e,m.position),m.val2.set(r,m.position);var we=oe(e,r,s,_,m,O);return m.val1.delete(e),m.val2.delete(r),we}function K(e,r,s,m){for(var O=L(e),_=0;_<O.length;_++){var N=O[_];if(V(r,N,s,m))return e.delete(N),!0}return!1}function se(e){switch(q(e)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":e=+e;case"number":if(j(e))return!1}return!0}function be(e,r,s){var m=se(s);return m??(r.has(m)&&!e.has(m))}function le(e,r,s,m,O){var _=se(s);if(_!=null)return _;var N=r.get(_);return N===void 0&&!r.has(_)||!V(m,N,!1,O)?!1:!e.has(_)&&V(m,N,!1,O)}function ne(e,r,s,m){for(var O=null,_=L(e),N=0;N<_.length;N++){var U=_[N];if(q(U)==="object"&&U!==null)O===null&&(O=new Set),O.add(U);else if(!r.has(U)){if(s||!be(e,r,U))return!1;O===null&&(O=new Set),O.add(U)}}if(O!==null){for(var G=L(r),Z=0;Z<G.length;Z++){var ee=G[Z];if(q(ee)==="object"&&ee!==null){if(!K(O,ee,s,m))return!1}else if(!s&&!e.has(ee)&&!K(O,ee,s,m))return!1}return O.size===0}return!0}function ve(e,r,s,m,O,_){for(var N=L(e),U=0;U<N.length;U++){var G=N[U];if(V(s,G,O,_)&&V(m,r.get(G),O,_))return e.delete(G),!0}return!1}function Se(e,r,s,m){for(var O=null,_=$(e),N=0;N<_.length;N++){var U=h(_[N],2),G=U[0],Z=U[1];if(q(G)==="object"&&G!==null)O===null&&(O=new Set),O.add(G);else{var ee=r.get(G);if(ee===void 0&&!r.has(G)||!V(Z,ee,s,m)){if(s||!le(e,r,G,Z,m))return!1;O===null&&(O=new Set),O.add(G)}}}if(O!==null){for(var me=$(r),de=0;de<me.length;de++){var Ee=h(me[de],2),fe=Ee[0],we=Ee[1];if(q(fe)==="object"&&fe!==null){if(!ve(O,e,fe,we,s,m))return!1}else if(!s&&(!e.has(fe)||!V(e.get(fe),we,!1,m))&&!ve(O,e,fe,we,!1,m))return!1}return O.size===0}return!0}function oe(e,r,s,m,O,_){var N=0;if(_===n){if(!ne(e,r,s,O))return!1}else if(_===t){if(!Se(e,r,s,O))return!1}else if(_===A)for(;N<e.length;N++)if(k(e,N)){if(!k(r,N)||!V(e[N],r[N],s,O))return!1}else{if(k(r,N))return!1;for(var U=Object.keys(e);N<U.length;N++){var G=U[N];if(!k(r,G)||!V(e[G],r[G],s,O))return!1}return U.length===Object.keys(r).length}for(N=0;N<m.length;N++){var Z=m[N];if(!V(e[Z],r[Z],s,O))return!1}return!0}function pe(e,r){return V(e,r,E)}function ue(e,r){return V(e,r,u)}return He={isDeepEqual:pe,isDeepStrictEqual:ue},He}var ft;function Ce(){if(ft)return Pe.exports;ft=1;function h(n){"@babel/helpers - typeof";return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h(n)}function S(n,t,o){return Object.defineProperty(n,"prototype",{writable:!1}),n}function b(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}var y=ht(),I=y.codes,T=I.ERR_AMBIGUOUS_ARGUMENT,q=I.ERR_INVALID_ARG_TYPE,H=I.ERR_INVALID_ARG_VALUE,L=I.ERR_INVALID_RETURN_VALUE,$=I.ERR_MISSING_ARGS,D=Rt(),x=Oe(),j=x.inspect,v=Oe().types,k=v.isPromise,X=v.isRegExp,J=Nt()(),F=ze()(),i=qt()("RegExp.prototype.test"),a,g;function P(){var n=_t();a=n.isDeepEqual,g=n.isDeepStrictEqual}var M=!1,R=Pe.exports=C,W={};function B(n){throw n.message instanceof Error?n.message:new D(n)}function te(n,t,o,l,f){var p=arguments.length,w;if(p===0)w="Failed";else if(p===1)o=n,n=void 0;else{if(M===!1){M=!0;var V=ae.emitWarning?ae.emitWarning:console.warn.bind(console);V("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}p===2&&(l="!=")}if(o instanceof Error)throw o;var z={actual:n,expected:t,operator:l===void 0?"fail":l,stackStartFn:f||te};o!==void 0&&(z.message=o);var Y=new D(z);throw w&&(Y.message=w,Y.generatedMessage=!0),Y}R.fail=te,R.AssertionError=D;function re(n,t,o,l){if(!o){var f=!1;if(t===0)f=!0,l="No value argument passed to `assert.ok()`";else if(l instanceof Error)throw l;var p=new D({actual:o,expected:!0,message:l,operator:"==",stackStartFn:n});throw p.generatedMessage=f,p}}function C(){for(var n=arguments.length,t=new Array(n),o=0;o<n;o++)t[o]=arguments[o];re.apply(void 0,[C,t.length].concat(t))}R.ok=C,R.equal=function n(t,o,l){if(arguments.length<2)throw new $("actual","expected");t!=o&&B({actual:t,expected:o,message:l,operator:"==",stackStartFn:n})},R.notEqual=function n(t,o,l){if(arguments.length<2)throw new $("actual","expected");t==o&&B({actual:t,expected:o,message:l,operator:"!=",stackStartFn:n})},R.deepEqual=function n(t,o,l){if(arguments.length<2)throw new $("actual","expected");a===void 0&&P(),a(t,o)||B({actual:t,expected:o,message:l,operator:"deepEqual",stackStartFn:n})},R.notDeepEqual=function n(t,o,l){if(arguments.length<2)throw new $("actual","expected");a===void 0&&P(),a(t,o)&&B({actual:t,expected:o,message:l,operator:"notDeepEqual",stackStartFn:n})},R.deepStrictEqual=function n(t,o,l){if(arguments.length<2)throw new $("actual","expected");a===void 0&&P(),g(t,o)||B({actual:t,expected:o,message:l,operator:"deepStrictEqual",stackStartFn:n})},R.notDeepStrictEqual=Q;function Q(n,t,o){if(arguments.length<2)throw new $("actual","expected");a===void 0&&P(),g(n,t)&&B({actual:n,expected:t,message:o,operator:"notDeepStrictEqual",stackStartFn:Q})}R.strictEqual=function n(t,o,l){if(arguments.length<2)throw new $("actual","expected");F(t,o)||B({actual:t,expected:o,message:l,operator:"strictEqual",stackStartFn:n})},R.notStrictEqual=function n(t,o,l){if(arguments.length<2)throw new $("actual","expected");F(t,o)&&B({actual:t,expected:o,message:l,operator:"notStrictEqual",stackStartFn:n})};var he=S(function n(t,o,l){var f=this;b(this,n),o.forEach(function(p){p in t&&(l!==void 0&&typeof l[p]=="string"&&X(t[p])&&i(t[p],l[p])?f[p]=l[p]:f[p]=t[p])})});function ye(n,t,o,l,f,p){if(!(o in n)||!g(n[o],t[o])){if(!l){var w=new he(n,f),V=new he(t,f,n),z=new D({actual:w,expected:V,operator:"deepStrictEqual",stackStartFn:p});throw z.actual=n,z.expected=t,z.operator=p.name,z}B({actual:n,expected:t,message:l,operator:p.name,stackStartFn:p})}}function ie(n,t,o,l){if(typeof t!="function"){if(X(t))return i(t,n);if(arguments.length===2)throw new q("expected",["Function","RegExp"],t);if(h(n)!=="object"||n===null){var f=new D({actual:n,expected:t,message:o,operator:"deepStrictEqual",stackStartFn:l});throw f.operator=l.name,f}var p=Object.keys(t);if(t instanceof Error)p.push("name","message");else if(p.length===0)throw new H("error",t,"may not be an empty object");return a===void 0&&P(),p.forEach(function(w){typeof n[w]=="string"&&X(t[w])&&i(t[w],n[w])||ye(n,t,w,o,p,l)}),!0}return t.prototype!==void 0&&n instanceof t?!0:Error.isPrototypeOf(t)?!1:t.call({},n)===!0}function ge(n){if(typeof n!="function")throw new q("fn","Function",n);try{n()}catch(t){return t}return W}function ce(n){return k(n)||n!==null&&h(n)==="object"&&typeof n.then=="function"&&typeof n.catch=="function"}function c(n){return Promise.resolve().then(function(){var t;if(typeof n=="function"){if(t=n(),!ce(t))throw new L("instance of Promise","promiseFn",t)}else if(ce(n))t=n;else throw new q("promiseFn",["Function","Promise"],n);return Promise.resolve().then(function(){return t}).then(function(){return W}).catch(function(o){return o})})}function u(n,t,o,l){if(typeof o=="string"){if(arguments.length===4)throw new q("error",["Object","Error","Function","RegExp"],o);if(h(t)==="object"&&t!==null){if(t.message===o)throw new T("error/message",'The error message "'.concat(t.message,'" is identical to the message.'))}else if(t===o)throw new T("error/message",'The error "'.concat(t,'" is identical to the message.'));l=o,o=void 0}else if(o!=null&&h(o)!=="object"&&typeof o!="function")throw new q("error",["Object","Error","Function","RegExp"],o);if(t===W){var f="";o&&o.name&&(f+=" (".concat(o.name,")")),f+=l?": ".concat(l):".";var p=n.name==="rejects"?"rejection":"exception";B({actual:void 0,expected:o,operator:n.name,message:"Missing expected ".concat(p).concat(f),stackStartFn:n})}if(o&&!ie(t,o,l,n))throw t}function E(n,t,o,l){if(t!==W){if(typeof o=="string"&&(l=o,o=void 0),!o||ie(t,o)){var f=l?": ".concat(l):".",p=n.name==="doesNotReject"?"rejection":"exception";B({actual:t,expected:o,operator:n.name,message:"Got unwanted ".concat(p).concat(f,`
`)+'Actual message: "'.concat(t&&t.message,'"'),stackStartFn:n})}throw t}}R.throws=function n(t){for(var o=arguments.length,l=new Array(o>1?o-1:0),f=1;f<o;f++)l[f-1]=arguments[f];u.apply(void 0,[n,ge(t)].concat(l))},R.rejects=function n(t){for(var o=arguments.length,l=new Array(o>1?o-1:0),f=1;f<o;f++)l[f-1]=arguments[f];return c(t).then(function(p){return u.apply(void 0,[n,p].concat(l))})},R.doesNotThrow=function n(t){for(var o=arguments.length,l=new Array(o>1?o-1:0),f=1;f<o;f++)l[f-1]=arguments[f];E.apply(void 0,[n,ge(t)].concat(l))},R.doesNotReject=function n(t){for(var o=arguments.length,l=new Array(o>1?o-1:0),f=1;f<o;f++)l[f-1]=arguments[f];return c(t).then(function(p){return E.apply(void 0,[n,p].concat(l))})},R.ifError=function n(t){if(t!=null){var o="ifError got unwanted exception: ";h(t)==="object"&&typeof t.message=="string"?t.message.length===0&&t.constructor?o+=t.constructor.name:o+=t.message:o+=j(t);var l=new D({actual:t,expected:null,operator:"ifError",message:o,stackStartFn:n}),f=t.stack;if(typeof f=="string"){var p=f.split(`
`);p.shift();for(var w=l.stack.split(`
`),V=0;V<p.length;V++){var z=w.indexOf(p[V]);if(z!==-1){w=w.slice(0,z);break}}l.stack="".concat(w.join(`
`),`
`).concat(p.join(`
`))}throw l}};function d(n,t,o,l,f){if(!X(t))throw new q("regexp","RegExp",t);var p=f==="match";if(typeof n!="string"||i(t,n)!==p){if(o instanceof Error)throw o;var w=!o;o=o||(typeof n!="string"?'The "string" argument must be of type string. Received type '+"".concat(h(n)," (").concat(j(n),")"):(p?"The input did not match the regular expression ":"The input was expected to not match the regular expression ")+"".concat(j(t),`. Input:
`).concat(j(n),`
`));var V=new D({actual:n,expected:t,message:o,operator:f,stackStartFn:l});throw V.generatedMessage=w,V}}R.match=function n(t,o,l){d(t,o,l,n,"match")},R.doesNotMatch=function n(t,o,l){d(t,o,l,n,"doesNotMatch")};function A(){for(var n=arguments.length,t=new Array(n),o=0;o<n;o++)t[o]=arguments[o];re.apply(void 0,[A,t.length].concat(t))}return R.strict=J(A,R,{equal:R.strictEqual,deepEqual:R.deepStrictEqual,notEqual:R.notStrictEqual,notDeepEqual:R.notDeepStrictEqual}),R.strict.strict=R.strict,Pe.exports}var Lt=Ce();const Ft=mt(Lt);function Mt(h){return new Promise((S,b)=>{let y=0;const I=[];function T(){const x=h.read();x?D(x):h.once("readable",T)}function q(){h.removeListener("end",L),h.removeListener("error",$),h.removeListener("close",H),h.removeListener("readable",T)}function H(x){}function L(){}function $(x){q(),b(x)}function D(x){I.push(x),y+=x.length;const j=lt.concat(I,y);if(j.indexOf(`\r
\r
`)===-1){T();return}const k=j.toString("ascii").split(`\r
`),X=k.shift();if(!X)throw new Error("No header received");const J=X.split(" "),F=+J[1],i=J.slice(2).join(" "),a={};for(const g of k){if(!g)continue;const P=g.indexOf(":");if(P===-1)throw new Error(`Invalid header: "${g}"`);const M=g.slice(0,P).toLowerCase(),R=g.slice(P+1).trimStart(),W=a[M];typeof W=="string"?a[M]=[W,R]:Array.isArray(W)?W.push(R):a[M]=R}q(),S({connect:{statusCode:F,statusText:i,headers:a},buffered:j})}h.on("error",$),h.on("close",H),h.on("end",L),T()})}class Bt extends Pt{constructor(S,b){super(b),this.options={path:void 0},this.proxy=typeof S=="string"?new URL(S):S,this.proxyHeaders=(b==null?void 0:b.headers)??{};const y=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),I=this.proxy.port?parseInt(this.proxy.port,10):this.secureProxy?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...b?st(b,"headers"):null,host:y,port:I}}get secureProxy(){return Vt(this.proxy.protocol)}async connect(S,b){const{proxy:y,secureProxy:I}=this;if(!b.host)throw new TypeError('No "host" provided');let T;I?T=(void 0)(this.connectOpts):T=je.connect(this.connectOpts);const q=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},H=je.isIPv6(b.host)?`[${b.host}]`:b.host;let L=`CONNECT ${H}:${b.port} HTTP/1.1\r
`;if(y.username||y.password){const v=`${decodeURIComponent(y.username)}:${decodeURIComponent(y.password)}`;q["Proxy-Authorization"]=`Basic ${lt.from(v).toString("base64")}`}q.Host=`${H}:${b.port}`,q["Proxy-Connection"]||(q["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(const v of Object.keys(q))L+=`${v}: ${q[v]}\r
`;const $=Mt(T);T.write(`${L}\r
`);const{connect:D,buffered:x}=await $;if(S.emit("proxyConnect",D),this.emit("proxyConnect",D,S),D.statusCode===200){if(S.once("socket",Ut),b.secureEndpoint){const v=b.servername||b.host;return(void 0)({...st(b,"host","path","port"),socket:T,servername:je.isIP(v)?void 0:v})}return T}T.destroy();const j=new je.Socket({writable:!1});return j.readable=!0,S.once("socket",v=>{Ft(v.listenerCount("data")>0),v.push(x),v.push(null)}),j}}Bt.protocols=["http","https"];function Ut(h){h.resume()}function Vt(h){return typeof h=="string"?/^https:?$/i.test(h):!1}function st(h,...S){const b={};let y;for(y in h)S.includes(y)||(b[y]=h[y]);return b}export{Bt as HttpsProxyAgent};