@ultrade/shared 1.0.7 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/common/auth.helper.js +17 -0
- package/dist/browser/common/big-number.helper.js +11 -0
- package/dist/browser/common/index.js +17 -0
- package/dist/browser/common/mappers/codexAsset.mapper.js +11 -0
- package/dist/browser/common/mappers/codexBalance.mapper.js +11 -0
- package/dist/browser/common/mappers/index.js +11 -0
- package/dist/browser/common/mappers/trade.mapper.js +11 -0
- package/dist/browser/common/utils/assert.js +11 -0
- package/dist/browser/common/utils/decode.js +11 -0
- package/dist/browser/common/utils/index.js +11 -0
- package/dist/browser/common/utils/social.js +11 -0
- package/dist/browser/common/utils/stat.js +11 -0
- package/dist/browser/constants/index.js +11 -0
- package/dist/browser/enums/index.js +11 -0
- package/dist/browser/helpers/Encoding.js +17 -0
- package/dist/browser/helpers/algo.helper.js +17 -0
- package/dist/browser/helpers/assert.helper.js +11 -0
- package/dist/browser/helpers/atomic.helper.js +11 -0
- package/dist/browser/helpers/balance.helper.js +17 -0
- package/dist/browser/helpers/codex/common.helper.js +18 -0
- package/dist/browser/helpers/codex/index.js +18 -0
- package/dist/browser/helpers/codex/mbr.helper.js +17 -0
- package/dist/browser/helpers/codex/mna.helper.js +17 -0
- package/dist/browser/helpers/codex/order.helper.js +17 -0
- package/dist/browser/helpers/codex/setGlobal.helper.js +17 -0
- package/dist/browser/helpers/codex/transfer.helper.js +18 -0
- package/dist/browser/helpers/codex/txn.helper.js +17 -0
- package/dist/browser/helpers/codex.helper.js +24 -0
- package/dist/browser/helpers/eth.helper.js +18 -0
- package/dist/browser/helpers/index.js +11 -0
- package/dist/browser/helpers/interval.helpers.js +11 -0
- package/dist/browser/helpers/liquidity.helper.js +11 -0
- package/dist/browser/helpers/order.helper.js +11 -0
- package/dist/browser/helpers/pair.helper.js +11 -0
- package/dist/browser/helpers/pointSystem.helper.js +11 -0
- package/dist/browser/helpers/ticker.helpers.js +11 -0
- package/dist/browser/helpers/vaa.helper.js +11 -0
- package/dist/browser/helpers/withdraw.helper.js +18 -0
- package/dist/browser/interfaces/index.js +11 -0
- package/dist/browser/types/index.js +11 -0
- package/dist/node/common/auth.helper.js +1 -0
- package/dist/node/common/big-number.helper.js +1 -0
- package/dist/node/common/index.js +1 -0
- package/dist/node/common/mappers/codexAsset.mapper.js +1 -0
- package/dist/node/common/mappers/codexBalance.mapper.js +1 -0
- package/dist/node/common/mappers/index.js +1 -0
- package/dist/node/common/mappers/trade.mapper.js +1 -0
- package/dist/node/common/utils/assert.js +1 -0
- package/dist/node/common/utils/decode.js +1 -0
- package/dist/node/common/utils/index.js +1 -0
- package/dist/node/common/utils/social.js +1 -0
- package/dist/node/common/utils/stat.js +1 -0
- package/dist/node/constants/index.js +1 -0
- package/dist/node/enums/index.js +1 -0
- package/dist/node/helpers/Encoding.js +1 -0
- package/dist/node/helpers/algo.helper.js +1 -0
- package/dist/node/helpers/assert.helper.js +1 -0
- package/dist/node/helpers/atomic.helper.js +1 -0
- package/dist/node/helpers/balance.helper.js +1 -0
- package/dist/node/helpers/codex/common.helper.js +2 -0
- package/dist/node/helpers/codex/index.js +2 -0
- package/dist/node/helpers/codex/mbr.helper.js +1 -0
- package/dist/node/helpers/codex/mna.helper.js +1 -0
- package/dist/node/helpers/codex/order.helper.js +1 -0
- package/dist/node/helpers/codex/setGlobal.helper.js +1 -0
- package/dist/node/helpers/codex/transfer.helper.js +2 -0
- package/dist/node/helpers/codex/txn.helper.js +1 -0
- package/dist/node/helpers/codex.helper.js +8 -0
- package/dist/node/helpers/eth.helper.js +2 -0
- package/dist/node/helpers/index.js +1 -0
- package/dist/node/helpers/interval.helpers.js +1 -0
- package/dist/node/helpers/liquidity.helper.js +1 -0
- package/dist/node/helpers/order.helper.js +1 -0
- package/dist/node/helpers/pair.helper.js +1 -0
- package/dist/node/helpers/pointSystem.helper.js +1 -0
- package/dist/node/helpers/ticker.helpers.js +1 -0
- package/dist/node/helpers/vaa.helper.js +0 -0
- package/dist/node/helpers/withdraw.helper.js +2 -0
- package/dist/node/interfaces/index.js +1 -0
- package/dist/node/types/index.js +1 -0
- package/dist/src/helpers/codex/common.helper.d.ts +1 -1
- package/dist/src/helpers/vaa.helper.d.ts +0 -2
- package/package.json +25 -41
- package/dist/common/auth.helper.js +0 -1
- package/dist/common/big-number.helper.js +0 -1
- package/dist/common/index.js +0 -1
- package/dist/common/mappers/codexAsset.mapper.js +0 -1
- package/dist/common/mappers/codexBalance.mapper.js +0 -1
- package/dist/common/mappers/index.js +0 -1
- package/dist/common/mappers/trade.mapper.js +0 -1
- package/dist/common/utils/assert.js +0 -1
- package/dist/common/utils/decode.js +0 -1
- package/dist/common/utils/index.js +0 -1
- package/dist/common/utils/social.js +0 -1
- package/dist/common/utils/stat.js +0 -1
- package/dist/constants/index.js +0 -1
- package/dist/enums/index.js +0 -1
- package/dist/helpers/Encoding.js +0 -1
- package/dist/helpers/algo.helper.js +0 -1
- package/dist/helpers/assert.helper.js +0 -1
- package/dist/helpers/atomic.helper.js +0 -1
- package/dist/helpers/balance.helper.js +0 -1
- package/dist/helpers/codex/common.helper.js +0 -2
- package/dist/helpers/codex/index.js +0 -2
- package/dist/helpers/codex/mbr.helper.js +0 -1
- package/dist/helpers/codex/mna.helper.js +0 -1
- package/dist/helpers/codex/order.helper.js +0 -1
- package/dist/helpers/codex/setGlobal.helper.js +0 -1
- package/dist/helpers/codex/transfer.helper.js +0 -2
- package/dist/helpers/codex/txn.helper.js +0 -1
- package/dist/helpers/codex.helper.js +0 -8
- package/dist/helpers/eth.helper.js +0 -2
- package/dist/helpers/index.js +0 -1
- package/dist/helpers/interval.helpers.js +0 -1
- package/dist/helpers/liquidity.helper.js +0 -1
- package/dist/helpers/order.helper.js +0 -1
- package/dist/helpers/pair.helper.js +0 -1
- package/dist/helpers/pointSystem.helper.js +0 -1
- package/dist/helpers/ticker.helpers.js +0 -1
- package/dist/helpers/vaa.helper.js +0 -1
- package/dist/helpers/withdraw.helper.js +0 -2
- package/dist/interfaces/index.js +0 -1
- package/dist/types/index.js +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function O(){throw new Error("setTimeout has not been defined")}function Q(){throw new Error("clearTimeout has not been defined")}var R=O,_=Q;typeof globalThis.setTimeout=="function"&&(R=setTimeout);typeof globalThis.clearTimeout=="function"&&(_=clearTimeout);function z(n){if(R===setTimeout)return setTimeout(n,0);if((R===O||!R)&&setTimeout)return R=setTimeout,setTimeout(n,0);try{return R(n,0)}catch{try{return R.call(null,n,0)}catch{return R.call(this,n,0)}}}function sr(n){if(_===clearTimeout)return clearTimeout(n);if((_===Q||!_)&&clearTimeout)return _=clearTimeout,clearTimeout(n);try{return _(n)}catch{try{return _.call(null,n)}catch{return _.call(this,n)}}}var A=[],Y=!1,U,P=-1;function pr(){!Y||!U||(Y=!1,U.length?A=U.concat(A):P=-1,A.length&&G())}function G(){if(!Y){var n=z(pr);Y=!0;for(var r=A.length;r;){for(U=A,A=[];++P<r;)U&&U[P].run();P=-1,r=A.length}U=null,Y=!1,sr(n)}}function wr(n){var r=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)r[i-1]=arguments[i];A.push(new J(n,r)),A.length===1&&!Y&&z(G)}function J(n,r){this.fun=n,this.array=r}J.prototype.run=function(){this.fun.apply(null,this.array)};var xr="browser",Er="browser",mr=!0,gr={},yr=[],Ar="",Tr={},Rr={},_r={};function I(){}var Ur=I,Ir=I,vr=I,dr=I,Br=I,Yr=I,Sr=I;function Pr(n){throw new Error("process.binding is not supported")}function Dr(){return"/"}function Mr(n){throw new Error("process.chdir is not supported")}function Cr(){return 0}var B=globalThis.performance||{},kr=B.now||B.mozNow||B.msNow||B.oNow||B.webkitNow||function(){return new Date().getTime()};function Nr(n){var r=kr.call(B)*.001,i=Math.floor(r),e=Math.floor(r%1*1e9);return n&&(i=i-n[0],e=e-n[1],e<0&&(i--,e+=1e9)),[i,e]}var Lr=new Date;function Fr(){var n=new Date,r=n-Lr;return r/1e3}var F={nextTick:wr,title:xr,browser:mr,env:gr,argv:yr,version:Ar,versions:Tr,on:Ur,addListener:Ir,once:vr,off:dr,removeListener:Br,removeAllListeners:Yr,emit:Sr,binding:Pr,cwd:Dr,chdir:Mr,umask:Cr,hrtime:Nr,platform:Er,release:Rr,config:_r,uptime:Fr},H={};Object.keys(H).forEach(n=>{let r=n.split("."),i=F;for(let e=0;e<r.length;e++){let t=r[e];e===r.length-1?i[t]=H[n]:i=i[t]||(i[t]={})}});var g=[],m=[],Wr=typeof Uint8Array<"u"?Uint8Array:Array,b=!1;function $(){b=!0;for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,i=n.length;r<i;++r)g[r]=n[r],m[n.charCodeAt(r)]=r;m[45]=62,m[95]=63}function br(n){b||$();var r,i,e,t,u,f,a=n.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");u=n[a-2]==="="?2:n[a-1]==="="?1:0,f=new Wr(a*3/4-u),e=u>0?a-4:a;var h=0;for(r=0,i=0;r<e;r+=4,i+=3)t=m[n.charCodeAt(r)]<<18|m[n.charCodeAt(r+1)]<<12|m[n.charCodeAt(r+2)]<<6|m[n.charCodeAt(r+3)],f[h++]=t>>16&255,f[h++]=t>>8&255,f[h++]=t&255;return u===2?(t=m[n.charCodeAt(r)]<<2|m[n.charCodeAt(r+1)]>>4,f[h++]=t&255):u===1&&(t=m[n.charCodeAt(r)]<<10|m[n.charCodeAt(r+1)]<<4|m[n.charCodeAt(r+2)]>>2,f[h++]=t>>8&255,f[h++]=t&255),f}function qr(n){return g[n>>18&63]+g[n>>12&63]+g[n>>6&63]+g[n&63]}function Vr(n,r,i){for(var e,t=[],u=r;u<i;u+=3)e=(n[u]<<16)+(n[u+1]<<8)+n[u+2],t.push(qr(e));return t.join("")}function X(n){b||$();for(var r,i=n.length,e=i%3,t="",u=[],f=16383,a=0,h=i-e;a<h;a+=f)u.push(Vr(n,a,a+f>h?h:a+f));return e===1?(r=n[i-1],t+=g[r>>2],t+=g[r<<4&63],t+="=="):e===2&&(r=(n[i-2]<<8)+n[i-1],t+=g[r>>10],t+=g[r>>4&63],t+=g[r<<2&63],t+="="),u.push(t),u.join("")}o.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function D(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function T(n,r){if(D()<r)throw new RangeError("Invalid typed array length");return o.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(r),n.__proto__=o.prototype):(n===null&&(n=new o(r)),n.length=r),n}function o(n,r,i){if(!o.TYPED_ARRAY_SUPPORT&&!(this instanceof o))return new o(n,r,i);if(typeof n=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return q(this,n)}return j(this,n,r,i)}o.poolSize=8192;o._augment=function(n){return n.__proto__=o.prototype,n};function j(n,r,i,e){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Qr(n,r,i,e):typeof r=="string"?Or(n,r,i):zr(n,r)}o.from=function(n,r,i){return j(null,n,r,i)};o.kMaxLength=D();o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&o[Symbol.species]);function rr(n){if(typeof n!="number")throw new TypeError('"size" argument must be a number');if(n<0)throw new RangeError('"size" argument must not be negative')}function Hr(n,r,i,e){return rr(r),r<=0?T(n,r):i!==void 0?typeof e=="string"?T(n,r).fill(i,e):T(n,r).fill(i):T(n,r)}o.alloc=function(n,r,i){return Hr(null,n,r,i)};function q(n,r){if(rr(r),n=T(n,r<0?0:V(r)|0),!o.TYPED_ARRAY_SUPPORT)for(var i=0;i<r;++i)n[i]=0;return n}o.allocUnsafe=function(n){return q(null,n)};o.allocUnsafeSlow=function(n){return q(null,n)};function Or(n,r,i){if((typeof i!="string"||i==="")&&(i="utf8"),!o.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var e=ir(r,i)|0;n=T(n,e);var t=n.write(r,i);return t!==e&&(n=n.slice(0,t)),n}function W(n,r){var i=r.length<0?0:V(r.length)|0;n=T(n,i);for(var e=0;e<i;e+=1)n[e]=r[e]&255;return n}function Qr(n,r,i,e){if(r.byteLength,i<0||r.byteLength<i)throw new RangeError("'offset' is out of bounds");if(r.byteLength<i+(e||0))throw new RangeError("'length' is out of bounds");return i===void 0&&e===void 0?r=new Uint8Array(r):e===void 0?r=new Uint8Array(r,i):r=new Uint8Array(r,i,e),o.TYPED_ARRAY_SUPPORT?(n=r,n.__proto__=o.prototype):n=W(n,r),n}function zr(n,r){if(y(r)){var i=V(r.length)|0;return n=T(n,i),n.length===0||r.copy(n,0,0,i),n}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||li(r.length)?T(n,0):W(n,r);if(r.type==="Buffer"&&Array.isArray(r.data))return W(n,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function V(n){if(n>=D())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+D().toString(16)+" bytes");return n|0}o.isBuffer=si;function y(n){return!!(n!=null&&n._isBuffer)}o.compare=function(r,i){if(!y(r)||!y(i))throw new TypeError("Arguments must be Buffers");if(r===i)return 0;for(var e=r.length,t=i.length,u=0,f=Math.min(e,t);u<f;++u)if(r[u]!==i[u]){e=r[u],t=i[u];break}return e<t?-1:t<e?1:0};o.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};o.concat=function(r,i){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return o.alloc(0);var e;if(i===void 0)for(i=0,e=0;e<r.length;++e)i+=r[e].length;var t=o.allocUnsafe(i),u=0;for(e=0;e<r.length;++e){var f=r[e];if(!y(f))throw new TypeError('"list" argument must be an Array of Buffers');f.copy(t,u),u+=f.length}return t};function ir(n,r){if(y(n))return n.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(n)||n instanceof ArrayBuffer))return n.byteLength;typeof n!="string"&&(n=""+n);var i=n.length;if(i===0)return 0;for(var e=!1;;)switch(r){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return M(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return ar(n).length;default:if(e)return M(n).length;r=(""+r).toLowerCase(),e=!0}}o.byteLength=ir;function Gr(n,r,i){var e=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,r>>>=0,i<=r))return"";for(n||(n="utf8");;)switch(n){case"hex":return ei(this,r,i);case"utf8":case"utf-8":return tr(this,r,i);case"ascii":return ii(this,r,i);case"latin1":case"binary":return ni(this,r,i);case"base64":return jr(this,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ti(this,r,i);default:if(e)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),e=!0}}o.prototype._isBuffer=!0;function v(n,r,i){var e=n[r];n[r]=n[i],n[i]=e}o.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var i=0;i<r;i+=2)v(this,i,i+1);return this};o.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var i=0;i<r;i+=4)v(this,i,i+3),v(this,i+1,i+2);return this};o.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var i=0;i<r;i+=8)v(this,i,i+7),v(this,i+1,i+6),v(this,i+2,i+5),v(this,i+3,i+4);return this};o.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?tr(this,0,r):Gr.apply(this,arguments)};o.prototype.equals=function(r){if(!y(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:o.compare(this,r)===0};o.prototype.compare=function(r,i,e,t,u){if(!y(r))throw new TypeError("Argument must be a Buffer");if(i===void 0&&(i=0),e===void 0&&(e=r?r.length:0),t===void 0&&(t=0),u===void 0&&(u=this.length),i<0||e>r.length||t<0||u>this.length)throw new RangeError("out of range index");if(t>=u&&i>=e)return 0;if(t>=u)return-1;if(i>=e)return 1;if(i>>>=0,e>>>=0,t>>>=0,u>>>=0,this===r)return 0;for(var f=u-t,a=e-i,h=Math.min(f,a),s=this.slice(t,u),l=r.slice(i,e),c=0;c<h;++c)if(s[c]!==l[c]){f=s[c],a=l[c];break}return f<a?-1:a<f?1:0};function nr(n,r,i,e,t){if(n.length===0)return-1;if(typeof i=="string"?(e=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=t?0:n.length-1),i<0&&(i=n.length+i),i>=n.length){if(t)return-1;i=n.length-1}else if(i<0)if(t)i=0;else return-1;if(typeof r=="string"&&(r=o.from(r,e)),y(r))return r.length===0?-1:Z(n,r,i,e,t);if(typeof r=="number")return r=r&255,o.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?t?Uint8Array.prototype.indexOf.call(n,r,i):Uint8Array.prototype.lastIndexOf.call(n,r,i):Z(n,[r],i,e,t);throw new TypeError("val must be string, number or Buffer")}function Z(n,r,i,e,t){var u=1,f=n.length,a=r.length;if(e!==void 0&&(e=String(e).toLowerCase(),e==="ucs2"||e==="ucs-2"||e==="utf16le"||e==="utf-16le")){if(n.length<2||r.length<2)return-1;u=2,f/=2,a/=2,i/=2}function h(E,d){return u===1?E[d]:E.readUInt16BE(d*u)}var s;if(t){var l=-1;for(s=i;s<f;s++)if(h(n,s)===h(r,l===-1?0:s-l)){if(l===-1&&(l=s),s-l+1===a)return l*u}else l!==-1&&(s-=s-l),l=-1}else for(i+a>f&&(i=f-a),s=i;s>=0;s--){for(var c=!0,x=0;x<a;x++)if(h(n,s+x)!==h(r,x)){c=!1;break}if(c)return s}return-1}o.prototype.includes=function(r,i,e){return this.indexOf(r,i,e)!==-1};o.prototype.indexOf=function(r,i,e){return nr(this,r,i,e,!0)};o.prototype.lastIndexOf=function(r,i,e){return nr(this,r,i,e,!1)};function Jr(n,r,i,e){i=Number(i)||0;var t=n.length-i;e?(e=Number(e),e>t&&(e=t)):e=t;var u=r.length;if(u%2!==0)throw new TypeError("Invalid hex string");e>u/2&&(e=u/2);for(var f=0;f<e;++f){var a=parseInt(r.substr(f*2,2),16);if(isNaN(a))return f;n[i+f]=a}return f}function Xr(n,r,i,e){return N(M(r,n.length-i),n,i,e)}function er(n,r,i,e){return N(hi(r),n,i,e)}function Zr(n,r,i,e){return er(n,r,i,e)}function Kr(n,r,i,e){return N(ar(r),n,i,e)}function $r(n,r,i,e){return N(ci(r,n.length-i),n,i,e)}o.prototype.write=function(r,i,e,t){if(i===void 0)t="utf8",e=this.length,i=0;else if(e===void 0&&typeof i=="string")t=i,e=this.length,i=0;else if(isFinite(i))i=i|0,isFinite(e)?(e=e|0,t===void 0&&(t="utf8")):(t=e,e=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var u=this.length-i;if((e===void 0||e>u)&&(e=u),r.length>0&&(e<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");t||(t="utf8");for(var f=!1;;)switch(t){case"hex":return Jr(this,r,i,e);case"utf8":case"utf-8":return Xr(this,r,i,e);case"ascii":return er(this,r,i,e);case"latin1":case"binary":return Zr(this,r,i,e);case"base64":return Kr(this,r,i,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $r(this,r,i,e);default:if(f)throw new TypeError("Unknown encoding: "+t);t=(""+t).toLowerCase(),f=!0}};o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function jr(n,r,i){return r===0&&i===n.length?X(n):X(n.slice(r,i))}function tr(n,r,i){i=Math.min(n.length,i);for(var e=[],t=r;t<i;){var u=n[t],f=null,a=u>239?4:u>223?3:u>191?2:1;if(t+a<=i){var h,s,l,c;switch(a){case 1:u<128&&(f=u);break;case 2:h=n[t+1],(h&192)===128&&(c=(u&31)<<6|h&63,c>127&&(f=c));break;case 3:h=n[t+1],s=n[t+2],(h&192)===128&&(s&192)===128&&(c=(u&15)<<12|(h&63)<<6|s&63,c>2047&&(c<55296||c>57343)&&(f=c));break;case 4:h=n[t+1],s=n[t+2],l=n[t+3],(h&192)===128&&(s&192)===128&&(l&192)===128&&(c=(u&15)<<18|(h&63)<<12|(s&63)<<6|l&63,c>65535&&c<1114112&&(f=c))}}f===null?(f=65533,a=1):f>65535&&(f-=65536,e.push(f>>>10&1023|55296),f=56320|f&1023),e.push(f),t+=a}return ri(e)}var K=4096;function ri(n){var r=n.length;if(r<=K)return String.fromCharCode.apply(String,n);for(var i="",e=0;e<r;)i+=String.fromCharCode.apply(String,n.slice(e,e+=K));return i}function ii(n,r,i){var e="";i=Math.min(n.length,i);for(var t=r;t<i;++t)e+=String.fromCharCode(n[t]&127);return e}function ni(n,r,i){var e="";i=Math.min(n.length,i);for(var t=r;t<i;++t)e+=String.fromCharCode(n[t]);return e}function ei(n,r,i){var e=n.length;(!r||r<0)&&(r=0),(!i||i<0||i>e)&&(i=e);for(var t="",u=r;u<i;++u)t+=ai(n[u]);return t}function ti(n,r,i){for(var e=n.slice(r,i),t="",u=0;u<e.length;u+=2)t+=String.fromCharCode(e[u]+e[u+1]*256);return t}o.prototype.slice=function(r,i){var e=this.length;r=~~r,i=i===void 0?e:~~i,r<0?(r+=e,r<0&&(r=0)):r>e&&(r=e),i<0?(i+=e,i<0&&(i=0)):i>e&&(i=e),i<r&&(i=r);var t;if(o.TYPED_ARRAY_SUPPORT)t=this.subarray(r,i),t.__proto__=o.prototype;else{var u=i-r;t=new o(u,void 0);for(var f=0;f<u;++f)t[f]=this[f+r]}return t};function p(n,r,i){if(n%1!==0||n<0)throw new RangeError("offset is not uint");if(n+r>i)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUIntLE=function(r,i,e){r=r|0,i=i|0,e||p(r,i,this.length);for(var t=this[r],u=1,f=0;++f<i&&(u*=256);)t+=this[r+f]*u;return t};o.prototype.readUIntBE=function(r,i,e){r=r|0,i=i|0,e||p(r,i,this.length);for(var t=this[r+--i],u=1;i>0&&(u*=256);)t+=this[r+--i]*u;return t};o.prototype.readUInt8=function(r,i){return i||p(r,1,this.length),this[r]};o.prototype.readUInt16LE=function(r,i){return i||p(r,2,this.length),this[r]|this[r+1]<<8};o.prototype.readUInt16BE=function(r,i){return i||p(r,2,this.length),this[r]<<8|this[r+1]};o.prototype.readUInt32LE=function(r,i){return i||p(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};o.prototype.readUInt32BE=function(r,i){return i||p(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};o.prototype.readIntLE=function(r,i,e){r=r|0,i=i|0,e||p(r,i,this.length);for(var t=this[r],u=1,f=0;++f<i&&(u*=256);)t+=this[r+f]*u;return u*=128,t>=u&&(t-=Math.pow(2,8*i)),t};o.prototype.readIntBE=function(r,i,e){r=r|0,i=i|0,e||p(r,i,this.length);for(var t=i,u=1,f=this[r+--t];t>0&&(u*=256);)f+=this[r+--t]*u;return u*=128,f>=u&&(f-=Math.pow(2,8*i)),f};o.prototype.readInt8=function(r,i){return i||p(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};o.prototype.readInt16LE=function(r,i){i||p(r,2,this.length);var e=this[r]|this[r+1]<<8;return e&32768?e|4294901760:e};o.prototype.readInt16BE=function(r,i){i||p(r,2,this.length);var e=this[r+1]|this[r]<<8;return e&32768?e|4294901760:e};o.prototype.readInt32LE=function(r,i){return i||p(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};o.prototype.readInt32BE=function(r,i){return i||p(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};o.prototype.readFloatLE=function(r,i){return i||p(r,4,this.length),L(this,r,!0,23,4)};o.prototype.readFloatBE=function(r,i){return i||p(r,4,this.length),L(this,r,!1,23,4)};o.prototype.readDoubleLE=function(r,i){return i||p(r,8,this.length),L(this,r,!0,52,8)};o.prototype.readDoubleBE=function(r,i){return i||p(r,8,this.length),L(this,r,!1,52,8)};function w(n,r,i,e,t,u){if(!y(n))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>t||r<u)throw new RangeError('"value" argument is out of bounds');if(i+e>n.length)throw new RangeError("Index out of range")}o.prototype.writeUIntLE=function(r,i,e,t){if(r=+r,i=i|0,e=e|0,!t){var u=Math.pow(2,8*e)-1;w(this,r,i,e,u,0)}var f=1,a=0;for(this[i]=r&255;++a<e&&(f*=256);)this[i+a]=r/f&255;return i+e};o.prototype.writeUIntBE=function(r,i,e,t){if(r=+r,i=i|0,e=e|0,!t){var u=Math.pow(2,8*e)-1;w(this,r,i,e,u,0)}var f=e-1,a=1;for(this[i+f]=r&255;--f>=0&&(a*=256);)this[i+f]=r/a&255;return i+e};o.prototype.writeUInt8=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,1,255,0),o.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[i]=r&255,i+1};function C(n,r,i,e){r<0&&(r=65535+r+1);for(var t=0,u=Math.min(n.length-i,2);t<u;++t)n[i+t]=(r&255<<8*(e?t:1-t))>>>(e?t:1-t)*8}o.prototype.writeUInt16LE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[i]=r&255,this[i+1]=r>>>8):C(this,r,i,!0),i+2};o.prototype.writeUInt16BE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[i]=r>>>8,this[i+1]=r&255):C(this,r,i,!1),i+2};function k(n,r,i,e){r<0&&(r=4294967295+r+1);for(var t=0,u=Math.min(n.length-i,4);t<u;++t)n[i+t]=r>>>(e?t:3-t)*8&255}o.prototype.writeUInt32LE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[i+3]=r>>>24,this[i+2]=r>>>16,this[i+1]=r>>>8,this[i]=r&255):k(this,r,i,!0),i+4};o.prototype.writeUInt32BE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[i]=r>>>24,this[i+1]=r>>>16,this[i+2]=r>>>8,this[i+3]=r&255):k(this,r,i,!1),i+4};o.prototype.writeIntLE=function(r,i,e,t){if(r=+r,i=i|0,!t){var u=Math.pow(2,8*e-1);w(this,r,i,e,u-1,-u)}var f=0,a=1,h=0;for(this[i]=r&255;++f<e&&(a*=256);)r<0&&h===0&&this[i+f-1]!==0&&(h=1),this[i+f]=(r/a>>0)-h&255;return i+e};o.prototype.writeIntBE=function(r,i,e,t){if(r=+r,i=i|0,!t){var u=Math.pow(2,8*e-1);w(this,r,i,e,u-1,-u)}var f=e-1,a=1,h=0;for(this[i+f]=r&255;--f>=0&&(a*=256);)r<0&&h===0&&this[i+f+1]!==0&&(h=1),this[i+f]=(r/a>>0)-h&255;return i+e};o.prototype.writeInt8=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,1,127,-128),o.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[i]=r&255,i+1};o.prototype.writeInt16LE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[i]=r&255,this[i+1]=r>>>8):C(this,r,i,!0),i+2};o.prototype.writeInt16BE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[i]=r>>>8,this[i+1]=r&255):C(this,r,i,!1),i+2};o.prototype.writeInt32LE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[i]=r&255,this[i+1]=r>>>8,this[i+2]=r>>>16,this[i+3]=r>>>24):k(this,r,i,!0),i+4};o.prototype.writeInt32BE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),o.TYPED_ARRAY_SUPPORT?(this[i]=r>>>24,this[i+1]=r>>>16,this[i+2]=r>>>8,this[i+3]=r&255):k(this,r,i,!1),i+4};function ur(n,r,i,e,t,u){if(i+e>n.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function fr(n,r,i,e,t){return t||ur(n,r,i,4,34028234663852886e22,-34028234663852886e22),cr(n,r,i,e,23,4),i+4}o.prototype.writeFloatLE=function(r,i,e){return fr(this,r,i,!0,e)};o.prototype.writeFloatBE=function(r,i,e){return fr(this,r,i,!1,e)};function or(n,r,i,e,t){return t||ur(n,r,i,8,17976931348623157e292,-17976931348623157e292),cr(n,r,i,e,52,8),i+8}o.prototype.writeDoubleLE=function(r,i,e){return or(this,r,i,!0,e)};o.prototype.writeDoubleBE=function(r,i,e){return or(this,r,i,!1,e)};o.prototype.copy=function(r,i,e,t){if(e||(e=0),!t&&t!==0&&(t=this.length),i>=r.length&&(i=r.length),i||(i=0),t>0&&t<e&&(t=e),t===e||r.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(t<0)throw new RangeError("sourceEnd out of bounds");t>this.length&&(t=this.length),r.length-i<t-e&&(t=r.length-i+e);var u=t-e,f;if(this===r&&e<i&&i<t)for(f=u-1;f>=0;--f)r[f+i]=this[f+e];else if(u<1e3||!o.TYPED_ARRAY_SUPPORT)for(f=0;f<u;++f)r[f+i]=this[f+e];else Uint8Array.prototype.set.call(r,this.subarray(e,e+u),i);return u};o.prototype.fill=function(r,i,e,t){if(typeof r=="string"){if(typeof i=="string"?(t=i,i=0,e=this.length):typeof e=="string"&&(t=e,e=this.length),r.length===1){var u=r.charCodeAt(0);u<256&&(r=u)}if(t!==void 0&&typeof t!="string")throw new TypeError("encoding must be a string");if(typeof t=="string"&&!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t)}else typeof r=="number"&&(r=r&255);if(i<0||this.length<i||this.length<e)throw new RangeError("Out of range index");if(e<=i)return this;i=i>>>0,e=e===void 0?this.length:e>>>0,r||(r=0);var f;if(typeof r=="number")for(f=i;f<e;++f)this[f]=r;else{var a=y(r)?r:M(new o(r,t).toString()),h=a.length;for(f=0;f<e-i;++f)this[f+i]=a[f%h]}return this};var ui=/[^+\/0-9A-Za-z-_]/g;function fi(n){if(n=oi(n).replace(ui,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function oi(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function ai(n){return n<16?"0"+n.toString(16):n.toString(16)}function M(n,r){r=r||1/0;for(var i,e=n.length,t=null,u=[],f=0;f<e;++f){if(i=n.charCodeAt(f),i>55295&&i<57344){if(!t){if(i>56319){(r-=3)>-1&&u.push(239,191,189);continue}else if(f+1===e){(r-=3)>-1&&u.push(239,191,189);continue}t=i;continue}if(i<56320){(r-=3)>-1&&u.push(239,191,189),t=i;continue}i=(t-55296<<10|i-56320)+65536}else t&&(r-=3)>-1&&u.push(239,191,189);if(t=null,i<128){if((r-=1)<0)break;u.push(i)}else if(i<2048){if((r-=2)<0)break;u.push(i>>6|192,i&63|128)}else if(i<65536){if((r-=3)<0)break;u.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((r-=4)<0)break;u.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return u}function hi(n){for(var r=[],i=0;i<n.length;++i)r.push(n.charCodeAt(i)&255);return r}function ci(n,r){for(var i,e,t,u=[],f=0;f<n.length&&!((r-=2)<0);++f)i=n.charCodeAt(f),e=i>>8,t=i%256,u.push(t),u.push(e);return u}function ar(n){return br(fi(n))}function N(n,r,i,e){for(var t=0;t<e&&!(t+i>=r.length||t>=n.length);++t)r[t+i]=n[t];return t}function li(n){return n!==n}function si(n){return n!=null&&(!!n._isBuffer||hr(n)||pi(n))}function hr(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function pi(n){return typeof n.readFloatLE=="function"&&typeof n.slice=="function"&&hr(n.slice(0,0))}function L(n,r,i,e,t){var u,f,a=t*8-e-1,h=(1<<a)-1,s=h>>1,l=-7,c=i?t-1:0,x=i?-1:1,E=n[r+c];for(c+=x,u=E&(1<<-l)-1,E>>=-l,l+=a;l>0;u=u*256+n[r+c],c+=x,l-=8);for(f=u&(1<<-l)-1,u>>=-l,l+=e;l>0;f=f*256+n[r+c],c+=x,l-=8);if(u===0)u=1-s;else{if(u===h)return f?NaN:(E?-1:1)*(1/0);f=f+Math.pow(2,e),u=u-s}return(E?-1:1)*f*Math.pow(2,u-e)}function cr(n,r,i,e,t,u){var f,a,h,s=u*8-t-1,l=(1<<s)-1,c=l>>1,x=t===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=e?0:u-1,d=e?1:-1,lr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,f=l):(f=Math.floor(Math.log(r)/Math.LN2),r*(h=Math.pow(2,-f))<1&&(f--,h*=2),f+c>=1?r+=x/h:r+=x*Math.pow(2,1-c),r*h>=2&&(f++,h/=2),f+c>=l?(a=0,f=l):f+c>=1?(a=(r*h-1)*Math.pow(2,t),f=f+c):(a=r*Math.pow(2,c-1)*Math.pow(2,t),f=0));t>=8;n[i+E]=a&255,E+=d,a/=256,t-=8);for(f=f<<t|a,s+=t;s>0;n[i+E]=f&255,E+=d,f/=256,s-=8);n[i+E-d]|=lr*128}import S from"bignumber.js";function Ti(n){let{buy:r,sell:i,baseDec:e,baseUsd:t}=n,u=r.reduce((l,[c,x])=>l.plus(new S(x)),new S(0)),f=i.reduce((l,[,c])=>l.plus(new S(c)),new S(0));return u.plus(f).dividedBy(new S(10).pow(e)).multipliedBy(t).integerValue(S.ROUND_CEIL).toNumber()}export{Ti as computeLiquidityUsd};
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
5
|
+
(*!
|
|
6
|
+
* The buffer module from node.js, for the browser.
|
|
7
|
+
*
|
|
8
|
+
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
9
|
+
* @license MIT
|
|
10
|
+
*)
|
|
11
|
+
*/
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function K(){throw new Error("setTimeout has not been defined")}function z(){throw new Error("clearTimeout has not been defined")}var d=K,N=z;typeof globalThis.setTimeout=="function"&&(d=setTimeout);typeof globalThis.clearTimeout=="function"&&(N=clearTimeout);function J(e){if(d===setTimeout)return setTimeout(e,0);if((d===K||!d)&&setTimeout)return d=setTimeout,setTimeout(e,0);try{return d(e,0)}catch{try{return d.call(null,e,0)}catch{return d.call(this,e,0)}}}function Ir(e){if(N===clearTimeout)return clearTimeout(e);if((N===z||!N)&&clearTimeout)return N=clearTimeout,clearTimeout(e);try{return N(e)}catch{try{return N.call(null,e)}catch{return N.call(this,e)}}}var T=[],v=!1,b,U=-1;function Ar(){!v||!b||(v=!1,b.length?T=b.concat(T):U=-1,T.length&&X())}function X(){if(!v){var e=J(Ar);v=!0;for(var r=T.length;r;){for(b=T,T=[];++U<r;)b&&b[U].run();U=-1,r=T.length}b=null,v=!1,Ir(e)}}function _r(e){var r=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)r[t-1]=arguments[t];T.push(new q(e,r)),T.length===1&&!v&&J(X)}function q(e,r){this.fun=e,this.array=r}q.prototype.run=function(){this.fun.apply(null,this.array)};var wr="browser",Tr="browser",Rr=!0,dr={},Nr=[],br="",Cr={},gr={},Or={};function C(){}var Dr=C,vr=C,Lr=C,yr=C,Ur=C,Sr=C,Pr=C;function Br(e){throw new Error("process.binding is not supported")}function kr(){return"/"}function Mr(e){throw new Error("process.chdir is not supported")}function Yr(){return 0}var D=globalThis.performance||{},Fr=D.now||D.mozNow||D.msNow||D.oNow||D.webkitNow||function(){return new Date().getTime()};function Gr(e){var r=Fr.call(D)*.001,t=Math.floor(r),i=Math.floor(r%1*1e9);return e&&(t=t-e[0],i=i-e[1],i<0&&(t--,i+=1e9)),[t,i]}var Wr=new Date;function Vr(){var e=new Date,r=e-Wr;return r/1e3}var l={nextTick:_r,title:wr,browser:Rr,env:dr,argv:Nr,version:br,versions:Cr,on:Dr,addListener:vr,once:Lr,off:yr,removeListener:Ur,removeAllListeners:Sr,emit:Pr,binding:Br,cwd:kr,chdir:Mr,umask:Yr,hrtime:Gr,platform:Tr,release:gr,config:Or,uptime:Vr},H={};Object.keys(H).forEach(e=>{let r=e.split("."),t=l;for(let i=0;i<r.length;i++){let n=r[i];i===r.length-1?t[n]=H[e]:t=t[n]||(t[n]={})}});var _=[],I=[],Hr=typeof Uint8Array<"u"?Uint8Array:Array,G=!1;function j(){G=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,t=e.length;r<t;++r)_[r]=e[r],I[e.charCodeAt(r)]=r;I[45]=62,I[95]=63}function Kr(e){G||j();var r,t,i,n,o,p,c=e.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=e[c-2]==="="?2:e[c-1]==="="?1:0,p=new Hr(c*3/4-o),i=o>0?c-4:c;var a=0;for(r=0,t=0;r<i;r+=4,t+=3)n=I[e.charCodeAt(r)]<<18|I[e.charCodeAt(r+1)]<<12|I[e.charCodeAt(r+2)]<<6|I[e.charCodeAt(r+3)],p[a++]=n>>16&255,p[a++]=n>>8&255,p[a++]=n&255;return o===2?(n=I[e.charCodeAt(r)]<<2|I[e.charCodeAt(r+1)]>>4,p[a++]=n&255):o===1&&(n=I[e.charCodeAt(r)]<<10|I[e.charCodeAt(r+1)]<<4|I[e.charCodeAt(r+2)]>>2,p[a++]=n>>8&255,p[a++]=n&255),p}function zr(e){return _[e>>18&63]+_[e>>12&63]+_[e>>6&63]+_[e&63]}function Jr(e,r,t){for(var i,n=[],o=r;o<t;o+=3)i=(e[o]<<16)+(e[o+1]<<8)+e[o+2],n.push(zr(i));return n.join("")}function Q(e){G||j();for(var r,t=e.length,i=t%3,n="",o=[],p=16383,c=0,a=t-i;c<a;c+=p)o.push(Jr(e,c,c+p>a?a:c+p));return i===1?(r=e[t-1],n+=_[r>>2],n+=_[r<<4&63],n+="=="):i===2&&(r=(e[t-2]<<8)+e[t-1],n+=_[r>>10],n+=_[r>>4&63],n+=_[r<<2&63],n+="="),o.push(n),o.join("")}h.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function S(){return h.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function R(e,r){if(S()<r)throw new RangeError("Invalid typed array length");return h.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(r),e.__proto__=h.prototype):(e===null&&(e=new h(r)),e.length=r),e}function h(e,r,t){if(!h.TYPED_ARRAY_SUPPORT&&!(this instanceof h))return new h(e,r,t);if(typeof e=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return W(this,e)}return rr(this,e,r,t)}h.poolSize=8192;h._augment=function(e){return e.__proto__=h.prototype,e};function rr(e,r,t,i){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Qr(e,r,t,i):typeof r=="string"?qr(e,r,t):Zr(e,r)}h.from=function(e,r,t){return rr(null,e,r,t)};h.kMaxLength=S();h.TYPED_ARRAY_SUPPORT&&(h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&h[Symbol.species]);function tr(e){if(typeof e!="number")throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function Xr(e,r,t,i){return tr(r),r<=0?R(e,r):t!==void 0?typeof i=="string"?R(e,r).fill(t,i):R(e,r).fill(t):R(e,r)}h.alloc=function(e,r,t){return Xr(null,e,r,t)};function W(e,r){if(tr(r),e=R(e,r<0?0:V(r)|0),!h.TYPED_ARRAY_SUPPORT)for(var t=0;t<r;++t)e[t]=0;return e}h.allocUnsafe=function(e){return W(null,e)};h.allocUnsafeSlow=function(e){return W(null,e)};function qr(e,r,t){if((typeof t!="string"||t==="")&&(t="utf8"),!h.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var i=er(r,t)|0;e=R(e,i);var n=e.write(r,t);return n!==i&&(e=e.slice(0,n)),e}function F(e,r){var t=r.length<0?0:V(r.length)|0;e=R(e,t);for(var i=0;i<t;i+=1)e[i]=r[i]&255;return e}function Qr(e,r,t,i){if(r.byteLength,t<0||r.byteLength<t)throw new RangeError("'offset' is out of bounds");if(r.byteLength<t+(i||0))throw new RangeError("'length' is out of bounds");return t===void 0&&i===void 0?r=new Uint8Array(r):i===void 0?r=new Uint8Array(r,t):r=new Uint8Array(r,t,i),h.TYPED_ARRAY_SUPPORT?(e=r,e.__proto__=h.prototype):e=F(e,r),e}function Zr(e,r){if(w(r)){var t=V(r.length)|0;return e=R(e,t),e.length===0||r.copy(e,0,0,t),e}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||xt(r.length)?R(e,0):F(e,r);if(r.type==="Buffer"&&Array.isArray(r.data))return F(e,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function V(e){if(e>=S())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+S().toString(16)+" bytes");return e|0}h.isBuffer=It;function w(e){return!!(e!=null&&e._isBuffer)}h.compare=function(r,t){if(!w(r)||!w(t))throw new TypeError("Arguments must be Buffers");if(r===t)return 0;for(var i=r.length,n=t.length,o=0,p=Math.min(i,n);o<p;++o)if(r[o]!==t[o]){i=r[o],n=t[o];break}return i<n?-1:n<i?1:0};h.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};h.concat=function(r,t){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return h.alloc(0);var i;if(t===void 0)for(t=0,i=0;i<r.length;++i)t+=r[i].length;var n=h.allocUnsafe(t),o=0;for(i=0;i<r.length;++i){var p=r[i];if(!w(p))throw new TypeError('"list" argument must be an Array of Buffers');p.copy(n,o),o+=p.length}return n};function er(e,r){if(w(e))return e.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;typeof e!="string"&&(e=""+e);var t=e.length;if(t===0)return 0;for(var i=!1;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return P(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return ar(e).length;default:if(i)return P(e).length;r=(""+r).toLowerCase(),i=!0}}h.byteLength=er;function $r(e,r,t){var i=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(e||(e="utf8");;)switch(e){case"hex":return ct(this,r,t);case"utf8":case"utf-8":return or(this,r,t);case"ascii":return pt(this,r,t);case"latin1":case"binary":return ht(this,r,t);case"base64":return nt(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return at(this,r,t);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}h.prototype._isBuffer=!0;function g(e,r,t){var i=e[r];e[r]=e[t],e[t]=i}h.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<r;t+=2)g(this,t,t+1);return this};h.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<r;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this};h.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<r;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this};h.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?or(this,0,r):$r.apply(this,arguments)};h.prototype.equals=function(r){if(!w(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:h.compare(this,r)===0};h.prototype.compare=function(r,t,i,n,o){if(!w(r))throw new TypeError("Argument must be a Buffer");if(t===void 0&&(t=0),i===void 0&&(i=r?r.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),t<0||i>r.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=i)return 0;if(n>=o)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,n>>>=0,o>>>=0,this===r)return 0;for(var p=o-n,c=i-t,a=Math.min(p,c),f=this.slice(n,o),u=r.slice(t,i),s=0;s<a;++s)if(f[s]!==u[s]){p=f[s],c=u[s];break}return p<c?-1:c<p?1:0};function ir(e,r,t,i,n){if(e.length===0)return-1;if(typeof t=="string"?(i=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,isNaN(t)&&(t=n?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(n)return-1;t=e.length-1}else if(t<0)if(n)t=0;else return-1;if(typeof r=="string"&&(r=h.from(r,i)),w(r))return r.length===0?-1:Z(e,r,t,i,n);if(typeof r=="number")return r=r&255,h.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(e,r,t):Uint8Array.prototype.lastIndexOf.call(e,r,t):Z(e,[r],t,i,n);throw new TypeError("val must be string, number or Buffer")}function Z(e,r,t,i,n){var o=1,p=e.length,c=r.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(e.length<2||r.length<2)return-1;o=2,p/=2,c/=2,t/=2}function a(x,O){return o===1?x[O]:x.readUInt16BE(O*o)}var f;if(n){var u=-1;for(f=t;f<p;f++)if(a(e,f)===a(r,u===-1?0:f-u)){if(u===-1&&(u=f),f-u+1===c)return u*o}else u!==-1&&(f-=f-u),u=-1}else for(t+c>p&&(t=p-c),f=t;f>=0;f--){for(var s=!0,A=0;A<c;A++)if(a(e,f+A)!==a(r,A)){s=!1;break}if(s)return f}return-1}h.prototype.includes=function(r,t,i){return this.indexOf(r,t,i)!==-1};h.prototype.indexOf=function(r,t,i){return ir(this,r,t,i,!0)};h.prototype.lastIndexOf=function(r,t,i){return ir(this,r,t,i,!1)};function jr(e,r,t,i){t=Number(t)||0;var n=e.length-t;i?(i=Number(i),i>n&&(i=n)):i=n;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var p=0;p<i;++p){var c=parseInt(r.substr(p*2,2),16);if(isNaN(c))return p;e[t+p]=c}return p}function rt(e,r,t,i){return M(P(r,e.length-t),e,t,i)}function nr(e,r,t,i){return M(Et(r),e,t,i)}function tt(e,r,t,i){return nr(e,r,t,i)}function et(e,r,t,i){return M(ar(r),e,t,i)}function it(e,r,t,i){return M(mt(r,e.length-t),e,t,i)}h.prototype.write=function(r,t,i,n){if(t===void 0)n="utf8",i=this.length,t=0;else if(i===void 0&&typeof t=="string")n=t,i=this.length,t=0;else if(isFinite(t))t=t|0,isFinite(i)?(i=i|0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-t;if((i===void 0||i>o)&&(i=o),r.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var p=!1;;)switch(n){case"hex":return jr(this,r,t,i);case"utf8":case"utf-8":return rt(this,r,t,i);case"ascii":return nr(this,r,t,i);case"latin1":case"binary":return tt(this,r,t,i);case"base64":return et(this,r,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return it(this,r,t,i);default:if(p)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}};h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function nt(e,r,t){return r===0&&t===e.length?Q(e):Q(e.slice(r,t))}function or(e,r,t){t=Math.min(e.length,t);for(var i=[],n=r;n<t;){var o=e[n],p=null,c=o>239?4:o>223?3:o>191?2:1;if(n+c<=t){var a,f,u,s;switch(c){case 1:o<128&&(p=o);break;case 2:a=e[n+1],(a&192)===128&&(s=(o&31)<<6|a&63,s>127&&(p=s));break;case 3:a=e[n+1],f=e[n+2],(a&192)===128&&(f&192)===128&&(s=(o&15)<<12|(a&63)<<6|f&63,s>2047&&(s<55296||s>57343)&&(p=s));break;case 4:a=e[n+1],f=e[n+2],u=e[n+3],(a&192)===128&&(f&192)===128&&(u&192)===128&&(s=(o&15)<<18|(a&63)<<12|(f&63)<<6|u&63,s>65535&&s<1114112&&(p=s))}}p===null?(p=65533,c=1):p>65535&&(p-=65536,i.push(p>>>10&1023|55296),p=56320|p&1023),i.push(p),n+=c}return ot(i)}var $=4096;function ot(e){var r=e.length;if(r<=$)return String.fromCharCode.apply(String,e);for(var t="",i=0;i<r;)t+=String.fromCharCode.apply(String,e.slice(i,i+=$));return t}function pt(e,r,t){var i="";t=Math.min(e.length,t);for(var n=r;n<t;++n)i+=String.fromCharCode(e[n]&127);return i}function ht(e,r,t){var i="";t=Math.min(e.length,t);for(var n=r;n<t;++n)i+=String.fromCharCode(e[n]);return i}function ct(e,r,t){var i=e.length;(!r||r<0)&&(r=0),(!t||t<0||t>i)&&(t=i);for(var n="",o=r;o<t;++o)n+=lt(e[o]);return n}function at(e,r,t){for(var i=e.slice(r,t),n="",o=0;o<i.length;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}h.prototype.slice=function(r,t){var i=this.length;r=~~r,t=t===void 0?i:~~t,r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),t<r&&(t=r);var n;if(h.TYPED_ARRAY_SUPPORT)n=this.subarray(r,t),n.__proto__=h.prototype;else{var o=t-r;n=new h(o,void 0);for(var p=0;p<o;++p)n[p]=this[p+r]}return n};function E(e,r,t){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+r>t)throw new RangeError("Trying to access beyond buffer length")}h.prototype.readUIntLE=function(r,t,i){r=r|0,t=t|0,i||E(r,t,this.length);for(var n=this[r],o=1,p=0;++p<t&&(o*=256);)n+=this[r+p]*o;return n};h.prototype.readUIntBE=function(r,t,i){r=r|0,t=t|0,i||E(r,t,this.length);for(var n=this[r+--t],o=1;t>0&&(o*=256);)n+=this[r+--t]*o;return n};h.prototype.readUInt8=function(r,t){return t||E(r,1,this.length),this[r]};h.prototype.readUInt16LE=function(r,t){return t||E(r,2,this.length),this[r]|this[r+1]<<8};h.prototype.readUInt16BE=function(r,t){return t||E(r,2,this.length),this[r]<<8|this[r+1]};h.prototype.readUInt32LE=function(r,t){return t||E(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};h.prototype.readUInt32BE=function(r,t){return t||E(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};h.prototype.readIntLE=function(r,t,i){r=r|0,t=t|0,i||E(r,t,this.length);for(var n=this[r],o=1,p=0;++p<t&&(o*=256);)n+=this[r+p]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n};h.prototype.readIntBE=function(r,t,i){r=r|0,t=t|0,i||E(r,t,this.length);for(var n=t,o=1,p=this[r+--n];n>0&&(o*=256);)p+=this[r+--n]*o;return o*=128,p>=o&&(p-=Math.pow(2,8*t)),p};h.prototype.readInt8=function(r,t){return t||E(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};h.prototype.readInt16LE=function(r,t){t||E(r,2,this.length);var i=this[r]|this[r+1]<<8;return i&32768?i|4294901760:i};h.prototype.readInt16BE=function(r,t){t||E(r,2,this.length);var i=this[r+1]|this[r]<<8;return i&32768?i|4294901760:i};h.prototype.readInt32LE=function(r,t){return t||E(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};h.prototype.readInt32BE=function(r,t){return t||E(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};h.prototype.readFloatLE=function(r,t){return t||E(r,4,this.length),Y(this,r,!0,23,4)};h.prototype.readFloatBE=function(r,t){return t||E(r,4,this.length),Y(this,r,!1,23,4)};h.prototype.readDoubleLE=function(r,t){return t||E(r,8,this.length),Y(this,r,!0,52,8)};h.prototype.readDoubleBE=function(r,t){return t||E(r,8,this.length),Y(this,r,!1,52,8)};function m(e,r,t,i,n,o){if(!w(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>n||r<o)throw new RangeError('"value" argument is out of bounds');if(t+i>e.length)throw new RangeError("Index out of range")}h.prototype.writeUIntLE=function(r,t,i,n){if(r=+r,t=t|0,i=i|0,!n){var o=Math.pow(2,8*i)-1;m(this,r,t,i,o,0)}var p=1,c=0;for(this[t]=r&255;++c<i&&(p*=256);)this[t+c]=r/p&255;return t+i};h.prototype.writeUIntBE=function(r,t,i,n){if(r=+r,t=t|0,i=i|0,!n){var o=Math.pow(2,8*i)-1;m(this,r,t,i,o,0)}var p=i-1,c=1;for(this[t+p]=r&255;--p>=0&&(c*=256);)this[t+p]=r/c&255;return t+i};h.prototype.writeUInt8=function(r,t,i){return r=+r,t=t|0,i||m(this,r,t,1,255,0),h.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[t]=r&255,t+1};function B(e,r,t,i){r<0&&(r=65535+r+1);for(var n=0,o=Math.min(e.length-t,2);n<o;++n)e[t+n]=(r&255<<8*(i?n:1-n))>>>(i?n:1-n)*8}h.prototype.writeUInt16LE=function(r,t,i){return r=+r,t=t|0,i||m(this,r,t,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[t]=r&255,this[t+1]=r>>>8):B(this,r,t,!0),t+2};h.prototype.writeUInt16BE=function(r,t,i){return r=+r,t=t|0,i||m(this,r,t,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[t]=r>>>8,this[t+1]=r&255):B(this,r,t,!1),t+2};function k(e,r,t,i){r<0&&(r=4294967295+r+1);for(var n=0,o=Math.min(e.length-t,4);n<o;++n)e[t+n]=r>>>(i?n:3-n)*8&255}h.prototype.writeUInt32LE=function(r,t,i){return r=+r,t=t|0,i||m(this,r,t,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255):k(this,r,t,!0),t+4};h.prototype.writeUInt32BE=function(r,t,i){return r=+r,t=t|0,i||m(this,r,t,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255):k(this,r,t,!1),t+4};h.prototype.writeIntLE=function(r,t,i,n){if(r=+r,t=t|0,!n){var o=Math.pow(2,8*i-1);m(this,r,t,i,o-1,-o)}var p=0,c=1,a=0;for(this[t]=r&255;++p<i&&(c*=256);)r<0&&a===0&&this[t+p-1]!==0&&(a=1),this[t+p]=(r/c>>0)-a&255;return t+i};h.prototype.writeIntBE=function(r,t,i,n){if(r=+r,t=t|0,!n){var o=Math.pow(2,8*i-1);m(this,r,t,i,o-1,-o)}var p=i-1,c=1,a=0;for(this[t+p]=r&255;--p>=0&&(c*=256);)r<0&&a===0&&this[t+p+1]!==0&&(a=1),this[t+p]=(r/c>>0)-a&255;return t+i};h.prototype.writeInt8=function(r,t,i){return r=+r,t=t|0,i||m(this,r,t,1,127,-128),h.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[t]=r&255,t+1};h.prototype.writeInt16LE=function(r,t,i){return r=+r,t=t|0,i||m(this,r,t,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[t]=r&255,this[t+1]=r>>>8):B(this,r,t,!0),t+2};h.prototype.writeInt16BE=function(r,t,i){return r=+r,t=t|0,i||m(this,r,t,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[t]=r>>>8,this[t+1]=r&255):B(this,r,t,!1),t+2};h.prototype.writeInt32LE=function(r,t,i){return r=+r,t=t|0,i||m(this,r,t,4,2147483647,-2147483648),h.TYPED_ARRAY_SUPPORT?(this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24):k(this,r,t,!0),t+4};h.prototype.writeInt32BE=function(r,t,i){return r=+r,t=t|0,i||m(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),h.TYPED_ARRAY_SUPPORT?(this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255):k(this,r,t,!1),t+4};function pr(e,r,t,i,n,o){if(t+i>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function hr(e,r,t,i,n){return n||pr(e,r,t,4,34028234663852886e22,-34028234663852886e22),fr(e,r,t,i,23,4),t+4}h.prototype.writeFloatLE=function(r,t,i){return hr(this,r,t,!0,i)};h.prototype.writeFloatBE=function(r,t,i){return hr(this,r,t,!1,i)};function cr(e,r,t,i,n){return n||pr(e,r,t,8,17976931348623157e292,-17976931348623157e292),fr(e,r,t,i,52,8),t+8}h.prototype.writeDoubleLE=function(r,t,i){return cr(this,r,t,!0,i)};h.prototype.writeDoubleBE=function(r,t,i){return cr(this,r,t,!1,i)};h.prototype.copy=function(r,t,i,n){if(i||(i=0),!n&&n!==0&&(n=this.length),t>=r.length&&(t=r.length),t||(t=0),n>0&&n<i&&(n=i),n===i||r.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),r.length-t<n-i&&(n=r.length-t+i);var o=n-i,p;if(this===r&&i<t&&t<n)for(p=o-1;p>=0;--p)r[p+t]=this[p+i];else if(o<1e3||!h.TYPED_ARRAY_SUPPORT)for(p=0;p<o;++p)r[p+t]=this[p+i];else Uint8Array.prototype.set.call(r,this.subarray(i,i+o),t);return o};h.prototype.fill=function(r,t,i,n){if(typeof r=="string"){if(typeof t=="string"?(n=t,t=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!h.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else typeof r=="number"&&(r=r&255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;t=t>>>0,i=i===void 0?this.length:i>>>0,r||(r=0);var p;if(typeof r=="number")for(p=t;p<i;++p)this[p]=r;else{var c=w(r)?r:P(new h(r,n).toString()),a=c.length;for(p=0;p<i-t;++p)this[p+t]=c[p%a]}return this};var st=/[^+\/0-9A-Za-z-_]/g;function ft(e){if(e=ut(e).replace(st,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function ut(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function lt(e){return e<16?"0"+e.toString(16):e.toString(16)}function P(e,r){r=r||1/0;for(var t,i=e.length,n=null,o=[],p=0;p<i;++p){if(t=e.charCodeAt(p),t>55295&&t<57344){if(!n){if(t>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(p+1===i){(r-=3)>-1&&o.push(239,191,189);continue}n=t;continue}if(t<56320){(r-=3)>-1&&o.push(239,191,189),n=t;continue}t=(n-55296<<10|t-56320)+65536}else n&&(r-=3)>-1&&o.push(239,191,189);if(n=null,t<128){if((r-=1)<0)break;o.push(t)}else if(t<2048){if((r-=2)<0)break;o.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;o.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;o.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return o}function Et(e){for(var r=[],t=0;t<e.length;++t)r.push(e.charCodeAt(t)&255);return r}function mt(e,r){for(var t,i,n,o=[],p=0;p<e.length&&!((r-=2)<0);++p)t=e.charCodeAt(p),i=t>>8,n=t%256,o.push(n),o.push(i);return o}function ar(e){return Kr(ft(e))}function M(e,r,t,i){for(var n=0;n<i&&!(n+t>=r.length||n>=e.length);++n)r[n+t]=e[n];return n}function xt(e){return e!==e}function It(e){return e!=null&&(!!e._isBuffer||sr(e)||At(e))}function sr(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function At(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&sr(e.slice(0,0))}function Y(e,r,t,i,n){var o,p,c=n*8-i-1,a=(1<<c)-1,f=a>>1,u=-7,s=t?n-1:0,A=t?-1:1,x=e[r+s];for(s+=A,o=x&(1<<-u)-1,x>>=-u,u+=c;u>0;o=o*256+e[r+s],s+=A,u-=8);for(p=o&(1<<-u)-1,o>>=-u,u+=i;u>0;p=p*256+e[r+s],s+=A,u-=8);if(o===0)o=1-f;else{if(o===a)return p?NaN:(x?-1:1)*(1/0);p=p+Math.pow(2,i),o=o-f}return(x?-1:1)*p*Math.pow(2,o-i)}function fr(e,r,t,i,n,o){var p,c,a,f=o*8-n-1,u=(1<<f)-1,s=u>>1,A=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=i?0:o-1,O=i?1:-1,xr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,p=u):(p=Math.floor(Math.log(r)/Math.LN2),r*(a=Math.pow(2,-p))<1&&(p--,a*=2),p+s>=1?r+=A/a:r+=A*Math.pow(2,1-s),r*a>=2&&(p++,a/=2),p+s>=u?(c=0,p=u):p+s>=1?(c=(r*a-1)*Math.pow(2,n),p=p+s):(c=r*Math.pow(2,s-1)*Math.pow(2,n),p=0));n>=8;e[t+x]=c&255,x+=O,c/=256,n-=8);for(p=p<<n|c,f+=n;f>0;e[t+x]=p&255,x+=O,p/=256,f-=8);e[t+x-O]|=xr*128}var ur=(t=>(t[t.Buy=0]="Buy",t[t.Sell=1]="Sell",t))(ur||{}),L=ur;var lr=(n=>(n[n.Limit=0]="Limit",n[n.IOC=1]="IOC",n[n.POST=2]="POST",n[n.Market=3]="Market",n))(lr||{}),y=lr;var Er=(n=>(n.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",n.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",n.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",n.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",n))(Er||{}),mr=(i=>(i.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",i.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",i.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",i))(mr||{}),Oe={...Er,...mr};function Di(e){switch(e){case"B":return L.Buy;case"S":return L.Sell;default:throw new Error("Unknown order side short type: "+e)}}function vi(e){switch(e){case L.Buy:return"B";case L.Sell:return"S";default:throw new Error("Unknown order side type: "+e)}}function Li(e){switch(e){case"I":return y.IOC;case"P":return y.POST;case"M":return y.Market;case"L":default:return y.Limit}}function yi(e){switch(e){case"B":return"BUY";case"S":return"SELL";default:throw new Error("Unknown order side short type: "+e)}}function Ui(e){switch(e){case"I":return"IOC";case"P":return"POST";case"M":return"Market";case"L":default:return"Limit"}}export{Di as mapOrderSideFromShort,yi as mapOrderSideFromShortToLong,vi as mapOrderSideToShort,Li as mapOrderTypeShort,Ui as mapOrderTypeShortToLong};
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
5
|
+
(*!
|
|
6
|
+
* The buffer module from node.js, for the browser.
|
|
7
|
+
*
|
|
8
|
+
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
9
|
+
* @license MIT
|
|
10
|
+
*)
|
|
11
|
+
*/
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function H(){throw new Error("setTimeout has not been defined")}function K(){throw new Error("clearTimeout has not been defined")}var b=H,d=K;typeof globalThis.setTimeout=="function"&&(b=setTimeout);typeof globalThis.clearTimeout=="function"&&(d=clearTimeout);function z(e){if(b===setTimeout)return setTimeout(e,0);if((b===H||!b)&&setTimeout)return b=setTimeout,setTimeout(e,0);try{return b(e,0)}catch{try{return b.call(null,e,0)}catch{return b.call(this,e,0)}}}function mr(e){if(d===clearTimeout)return clearTimeout(e);if((d===K||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(e);try{return d(e)}catch{try{return d.call(null,e)}catch{return d.call(this,e)}}}var R=[],O=!1,C,y=-1;function xr(){!O||!C||(O=!1,C.length?R=C.concat(R):y=-1,R.length&&J())}function J(){if(!O){var e=z(xr);O=!0;for(var r=R.length;r;){for(C=R,R=[];++y<r;)C&&C[y].run();y=-1,r=R.length}C=null,O=!1,mr(e)}}function _r(e){var r=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)r[t-1]=arguments[t];R.push(new X(e,r)),R.length===1&&!O&&z(J)}function X(e,r){this.fun=e,this.array=r}X.prototype.run=function(){this.fun.apply(null,this.array)};var Ir="browser",Ar="browser",wr=!0,Rr={},Tr=[],Nr="",br={},dr={},Cr={};function g(){}var gr=g,Dr=g,vr=g,Or=g,Lr=g,yr=g,Ur=g;function Pr(e){throw new Error("process.binding is not supported")}function Br(){return"/"}function Sr(e){throw new Error("process.chdir is not supported")}function Mr(){return 0}var v=globalThis.performance||{},kr=v.now||v.mozNow||v.msNow||v.oNow||v.webkitNow||function(){return new Date().getTime()};function Yr(e){var r=kr.call(v)*.001,t=Math.floor(r),i=Math.floor(r%1*1e9);return e&&(t=t-e[0],i=i-e[1],i<0&&(t--,i+=1e9)),[t,i]}var Fr=new Date;function Gr(){var e=new Date,r=e-Fr;return r/1e3}var l={nextTick:_r,title:Ir,browser:wr,env:Rr,argv:Tr,version:Nr,versions:br,on:gr,addListener:Dr,once:vr,off:Or,removeListener:Lr,removeAllListeners:yr,emit:Ur,binding:Pr,cwd:Br,chdir:Sr,umask:Mr,hrtime:Yr,platform:Ar,release:dr,config:Cr,uptime:Gr},V={};Object.keys(V).forEach(e=>{let r=e.split("."),t=l;for(let i=0;i<r.length;i++){let n=r[i];i===r.length-1?t[n]=V[e]:t=t[n]||(t[n]={})}});var A=[],I=[],Wr=typeof Uint8Array<"u"?Uint8Array:Array,F=!1;function $(){F=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,t=e.length;r<t;++r)A[r]=e[r],I[e.charCodeAt(r)]=r;I[45]=62,I[95]=63}function Vr(e){F||$();var r,t,i,n,o,p,c=e.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=e[c-2]==="="?2:e[c-1]==="="?1:0,p=new Wr(c*3/4-o),i=o>0?c-4:c;var h=0;for(r=0,t=0;r<i;r+=4,t+=3)n=I[e.charCodeAt(r)]<<18|I[e.charCodeAt(r+1)]<<12|I[e.charCodeAt(r+2)]<<6|I[e.charCodeAt(r+3)],p[h++]=n>>16&255,p[h++]=n>>8&255,p[h++]=n&255;return o===2?(n=I[e.charCodeAt(r)]<<2|I[e.charCodeAt(r+1)]>>4,p[h++]=n&255):o===1&&(n=I[e.charCodeAt(r)]<<10|I[e.charCodeAt(r+1)]<<4|I[e.charCodeAt(r+2)]>>2,p[h++]=n>>8&255,p[h++]=n&255),p}function Hr(e){return A[e>>18&63]+A[e>>12&63]+A[e>>6&63]+A[e&63]}function Kr(e,r,t){for(var i,n=[],o=r;o<t;o+=3)i=(e[o]<<16)+(e[o+1]<<8)+e[o+2],n.push(Hr(i));return n.join("")}function q(e){F||$();for(var r,t=e.length,i=t%3,n="",o=[],p=16383,c=0,h=t-i;c<h;c+=p)o.push(Kr(e,c,c+p>h?h:c+p));return i===1?(r=e[t-1],n+=A[r>>2],n+=A[r<<4&63],n+="=="):i===2&&(r=(e[t-2]<<8)+e[t-1],n+=A[r>>10],n+=A[r>>4&63],n+=A[r<<2&63],n+="="),o.push(n),o.join("")}a.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function U(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function T(e,r){if(U()<r)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(r),e.__proto__=a.prototype):(e===null&&(e=new a(r)),e.length=r),e}function a(e,r,t){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(e,r,t);if(typeof e=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return G(this,e)}return j(this,e,r,t)}a.poolSize=8192;a._augment=function(e){return e.__proto__=a.prototype,e};function j(e,r,t,i){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Xr(e,r,t,i):typeof r=="string"?Jr(e,r,t):qr(e,r)}a.from=function(e,r,t){return j(null,e,r,t)};a.kMaxLength=U();a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&a[Symbol.species]);function rr(e){if(typeof e!="number")throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function zr(e,r,t,i){return rr(r),r<=0?T(e,r):t!==void 0?typeof i=="string"?T(e,r).fill(t,i):T(e,r).fill(t):T(e,r)}a.alloc=function(e,r,t){return zr(null,e,r,t)};function G(e,r){if(rr(r),e=T(e,r<0?0:W(r)|0),!a.TYPED_ARRAY_SUPPORT)for(var t=0;t<r;++t)e[t]=0;return e}a.allocUnsafe=function(e){return G(null,e)};a.allocUnsafeSlow=function(e){return G(null,e)};function Jr(e,r,t){if((typeof t!="string"||t==="")&&(t="utf8"),!a.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var i=tr(r,t)|0;e=T(e,i);var n=e.write(r,t);return n!==i&&(e=e.slice(0,n)),e}function Y(e,r){var t=r.length<0?0:W(r.length)|0;e=T(e,t);for(var i=0;i<t;i+=1)e[i]=r[i]&255;return e}function Xr(e,r,t,i){if(r.byteLength,t<0||r.byteLength<t)throw new RangeError("'offset' is out of bounds");if(r.byteLength<t+(i||0))throw new RangeError("'length' is out of bounds");return t===void 0&&i===void 0?r=new Uint8Array(r):i===void 0?r=new Uint8Array(r,t):r=new Uint8Array(r,t,i),a.TYPED_ARRAY_SUPPORT?(e=r,e.__proto__=a.prototype):e=Y(e,r),e}function qr(e,r){if(w(r)){var t=W(r.length)|0;return e=T(e,t),e.length===0||r.copy(e,0,0,t),e}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||Et(r.length)?T(e,0):Y(e,r);if(r.type==="Buffer"&&Array.isArray(r.data))return Y(e,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function W(e){if(e>=U())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+U().toString(16)+" bytes");return e|0}a.isBuffer=mt;function w(e){return!!(e!=null&&e._isBuffer)}a.compare=function(r,t){if(!w(r)||!w(t))throw new TypeError("Arguments must be Buffers");if(r===t)return 0;for(var i=r.length,n=t.length,o=0,p=Math.min(i,n);o<p;++o)if(r[o]!==t[o]){i=r[o],n=t[o];break}return i<n?-1:n<i?1:0};a.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};a.concat=function(r,t){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return a.alloc(0);var i;if(t===void 0)for(t=0,i=0;i<r.length;++i)t+=r[i].length;var n=a.allocUnsafe(t),o=0;for(i=0;i<r.length;++i){var p=r[i];if(!w(p))throw new TypeError('"list" argument must be an Array of Buffers');p.copy(n,o),o+=p.length}return n};function tr(e,r){if(w(e))return e.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;typeof e!="string"&&(e=""+e);var t=e.length;if(t===0)return 0;for(var i=!1;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return P(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return cr(e).length;default:if(i)return P(e).length;r=(""+r).toLowerCase(),i=!0}}a.byteLength=tr;function Qr(e,r,t){var i=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(e||(e="utf8");;)switch(e){case"hex":return pt(this,r,t);case"utf8":case"utf-8":return nr(this,r,t);case"ascii":return nt(this,r,t);case"latin1":case"binary":return ot(this,r,t);case"base64":return et(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return at(this,r,t);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}a.prototype._isBuffer=!0;function D(e,r,t){var i=e[r];e[r]=e[t],e[t]=i}a.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<r;t+=2)D(this,t,t+1);return this};a.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<r;t+=4)D(this,t,t+3),D(this,t+1,t+2);return this};a.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<r;t+=8)D(this,t,t+7),D(this,t+1,t+6),D(this,t+2,t+5),D(this,t+3,t+4);return this};a.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?nr(this,0,r):Qr.apply(this,arguments)};a.prototype.equals=function(r){if(!w(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:a.compare(this,r)===0};a.prototype.compare=function(r,t,i,n,o){if(!w(r))throw new TypeError("Argument must be a Buffer");if(t===void 0&&(t=0),i===void 0&&(i=r?r.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),t<0||i>r.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=i)return 0;if(n>=o)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,n>>>=0,o>>>=0,this===r)return 0;for(var p=o-n,c=i-t,h=Math.min(p,c),s=this.slice(n,o),u=r.slice(t,i),f=0;f<h;++f)if(s[f]!==u[f]){p=s[f],c=u[f];break}return p<c?-1:c<p?1:0};function er(e,r,t,i,n){if(e.length===0)return-1;if(typeof t=="string"?(i=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,isNaN(t)&&(t=n?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(n)return-1;t=e.length-1}else if(t<0)if(n)t=0;else return-1;if(typeof r=="string"&&(r=a.from(r,i)),w(r))return r.length===0?-1:Q(e,r,t,i,n);if(typeof r=="number")return r=r&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(e,r,t):Uint8Array.prototype.lastIndexOf.call(e,r,t):Q(e,[r],t,i,n);throw new TypeError("val must be string, number or Buffer")}function Q(e,r,t,i,n){var o=1,p=e.length,c=r.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(e.length<2||r.length<2)return-1;o=2,p/=2,c/=2,t/=2}function h(m,N){return o===1?m[N]:m.readUInt16BE(N*o)}var s;if(n){var u=-1;for(s=t;s<p;s++)if(h(e,s)===h(r,u===-1?0:s-u)){if(u===-1&&(u=s),s-u+1===c)return u*o}else u!==-1&&(s-=s-u),u=-1}else for(t+c>p&&(t=p-c),s=t;s>=0;s--){for(var f=!0,_=0;_<c;_++)if(h(e,s+_)!==h(r,_)){f=!1;break}if(f)return s}return-1}a.prototype.includes=function(r,t,i){return this.indexOf(r,t,i)!==-1};a.prototype.indexOf=function(r,t,i){return er(this,r,t,i,!0)};a.prototype.lastIndexOf=function(r,t,i){return er(this,r,t,i,!1)};function Zr(e,r,t,i){t=Number(t)||0;var n=e.length-t;i?(i=Number(i),i>n&&(i=n)):i=n;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var p=0;p<i;++p){var c=parseInt(r.substr(p*2,2),16);if(isNaN(c))return p;e[t+p]=c}return p}function $r(e,r,t,i){return M(P(r,e.length-t),e,t,i)}function ir(e,r,t,i){return M(ut(r),e,t,i)}function jr(e,r,t,i){return ir(e,r,t,i)}function rt(e,r,t,i){return M(cr(r),e,t,i)}function tt(e,r,t,i){return M(lt(r,e.length-t),e,t,i)}a.prototype.write=function(r,t,i,n){if(t===void 0)n="utf8",i=this.length,t=0;else if(i===void 0&&typeof t=="string")n=t,i=this.length,t=0;else if(isFinite(t))t=t|0,isFinite(i)?(i=i|0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-t;if((i===void 0||i>o)&&(i=o),r.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var p=!1;;)switch(n){case"hex":return Zr(this,r,t,i);case"utf8":case"utf-8":return $r(this,r,t,i);case"ascii":return ir(this,r,t,i);case"latin1":case"binary":return jr(this,r,t,i);case"base64":return rt(this,r,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return tt(this,r,t,i);default:if(p)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function et(e,r,t){return r===0&&t===e.length?q(e):q(e.slice(r,t))}function nr(e,r,t){t=Math.min(e.length,t);for(var i=[],n=r;n<t;){var o=e[n],p=null,c=o>239?4:o>223?3:o>191?2:1;if(n+c<=t){var h,s,u,f;switch(c){case 1:o<128&&(p=o);break;case 2:h=e[n+1],(h&192)===128&&(f=(o&31)<<6|h&63,f>127&&(p=f));break;case 3:h=e[n+1],s=e[n+2],(h&192)===128&&(s&192)===128&&(f=(o&15)<<12|(h&63)<<6|s&63,f>2047&&(f<55296||f>57343)&&(p=f));break;case 4:h=e[n+1],s=e[n+2],u=e[n+3],(h&192)===128&&(s&192)===128&&(u&192)===128&&(f=(o&15)<<18|(h&63)<<12|(s&63)<<6|u&63,f>65535&&f<1114112&&(p=f))}}p===null?(p=65533,c=1):p>65535&&(p-=65536,i.push(p>>>10&1023|55296),p=56320|p&1023),i.push(p),n+=c}return it(i)}var Z=4096;function it(e){var r=e.length;if(r<=Z)return String.fromCharCode.apply(String,e);for(var t="",i=0;i<r;)t+=String.fromCharCode.apply(String,e.slice(i,i+=Z));return t}function nt(e,r,t){var i="";t=Math.min(e.length,t);for(var n=r;n<t;++n)i+=String.fromCharCode(e[n]&127);return i}function ot(e,r,t){var i="";t=Math.min(e.length,t);for(var n=r;n<t;++n)i+=String.fromCharCode(e[n]);return i}function pt(e,r,t){var i=e.length;(!r||r<0)&&(r=0),(!t||t<0||t>i)&&(t=i);for(var n="",o=r;o<t;++o)n+=ft(e[o]);return n}function at(e,r,t){for(var i=e.slice(r,t),n="",o=0;o<i.length;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}a.prototype.slice=function(r,t){var i=this.length;r=~~r,t=t===void 0?i:~~t,r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),t<r&&(t=r);var n;if(a.TYPED_ARRAY_SUPPORT)n=this.subarray(r,t),n.__proto__=a.prototype;else{var o=t-r;n=new a(o,void 0);for(var p=0;p<o;++p)n[p]=this[p+r]}return n};function E(e,r,t){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+r>t)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUIntLE=function(r,t,i){r=r|0,t=t|0,i||E(r,t,this.length);for(var n=this[r],o=1,p=0;++p<t&&(o*=256);)n+=this[r+p]*o;return n};a.prototype.readUIntBE=function(r,t,i){r=r|0,t=t|0,i||E(r,t,this.length);for(var n=this[r+--t],o=1;t>0&&(o*=256);)n+=this[r+--t]*o;return n};a.prototype.readUInt8=function(r,t){return t||E(r,1,this.length),this[r]};a.prototype.readUInt16LE=function(r,t){return t||E(r,2,this.length),this[r]|this[r+1]<<8};a.prototype.readUInt16BE=function(r,t){return t||E(r,2,this.length),this[r]<<8|this[r+1]};a.prototype.readUInt32LE=function(r,t){return t||E(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};a.prototype.readUInt32BE=function(r,t){return t||E(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};a.prototype.readIntLE=function(r,t,i){r=r|0,t=t|0,i||E(r,t,this.length);for(var n=this[r],o=1,p=0;++p<t&&(o*=256);)n+=this[r+p]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n};a.prototype.readIntBE=function(r,t,i){r=r|0,t=t|0,i||E(r,t,this.length);for(var n=t,o=1,p=this[r+--n];n>0&&(o*=256);)p+=this[r+--n]*o;return o*=128,p>=o&&(p-=Math.pow(2,8*t)),p};a.prototype.readInt8=function(r,t){return t||E(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};a.prototype.readInt16LE=function(r,t){t||E(r,2,this.length);var i=this[r]|this[r+1]<<8;return i&32768?i|4294901760:i};a.prototype.readInt16BE=function(r,t){t||E(r,2,this.length);var i=this[r+1]|this[r]<<8;return i&32768?i|4294901760:i};a.prototype.readInt32LE=function(r,t){return t||E(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};a.prototype.readInt32BE=function(r,t){return t||E(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};a.prototype.readFloatLE=function(r,t){return t||E(r,4,this.length),k(this,r,!0,23,4)};a.prototype.readFloatBE=function(r,t){return t||E(r,4,this.length),k(this,r,!1,23,4)};a.prototype.readDoubleLE=function(r,t){return t||E(r,8,this.length),k(this,r,!0,52,8)};a.prototype.readDoubleBE=function(r,t){return t||E(r,8,this.length),k(this,r,!1,52,8)};function x(e,r,t,i,n,o){if(!w(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>n||r<o)throw new RangeError('"value" argument is out of bounds');if(t+i>e.length)throw new RangeError("Index out of range")}a.prototype.writeUIntLE=function(r,t,i,n){if(r=+r,t=t|0,i=i|0,!n){var o=Math.pow(2,8*i)-1;x(this,r,t,i,o,0)}var p=1,c=0;for(this[t]=r&255;++c<i&&(p*=256);)this[t+c]=r/p&255;return t+i};a.prototype.writeUIntBE=function(r,t,i,n){if(r=+r,t=t|0,i=i|0,!n){var o=Math.pow(2,8*i)-1;x(this,r,t,i,o,0)}var p=i-1,c=1;for(this[t+p]=r&255;--p>=0&&(c*=256);)this[t+p]=r/c&255;return t+i};a.prototype.writeUInt8=function(r,t,i){return r=+r,t=t|0,i||x(this,r,t,1,255,0),a.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[t]=r&255,t+1};function B(e,r,t,i){r<0&&(r=65535+r+1);for(var n=0,o=Math.min(e.length-t,2);n<o;++n)e[t+n]=(r&255<<8*(i?n:1-n))>>>(i?n:1-n)*8}a.prototype.writeUInt16LE=function(r,t,i){return r=+r,t=t|0,i||x(this,r,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=r&255,this[t+1]=r>>>8):B(this,r,t,!0),t+2};a.prototype.writeUInt16BE=function(r,t,i){return r=+r,t=t|0,i||x(this,r,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=r>>>8,this[t+1]=r&255):B(this,r,t,!1),t+2};function S(e,r,t,i){r<0&&(r=4294967295+r+1);for(var n=0,o=Math.min(e.length-t,4);n<o;++n)e[t+n]=r>>>(i?n:3-n)*8&255}a.prototype.writeUInt32LE=function(r,t,i){return r=+r,t=t|0,i||x(this,r,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255):S(this,r,t,!0),t+4};a.prototype.writeUInt32BE=function(r,t,i){return r=+r,t=t|0,i||x(this,r,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255):S(this,r,t,!1),t+4};a.prototype.writeIntLE=function(r,t,i,n){if(r=+r,t=t|0,!n){var o=Math.pow(2,8*i-1);x(this,r,t,i,o-1,-o)}var p=0,c=1,h=0;for(this[t]=r&255;++p<i&&(c*=256);)r<0&&h===0&&this[t+p-1]!==0&&(h=1),this[t+p]=(r/c>>0)-h&255;return t+i};a.prototype.writeIntBE=function(r,t,i,n){if(r=+r,t=t|0,!n){var o=Math.pow(2,8*i-1);x(this,r,t,i,o-1,-o)}var p=i-1,c=1,h=0;for(this[t+p]=r&255;--p>=0&&(c*=256);)r<0&&h===0&&this[t+p+1]!==0&&(h=1),this[t+p]=(r/c>>0)-h&255;return t+i};a.prototype.writeInt8=function(r,t,i){return r=+r,t=t|0,i||x(this,r,t,1,127,-128),a.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[t]=r&255,t+1};a.prototype.writeInt16LE=function(r,t,i){return r=+r,t=t|0,i||x(this,r,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=r&255,this[t+1]=r>>>8):B(this,r,t,!0),t+2};a.prototype.writeInt16BE=function(r,t,i){return r=+r,t=t|0,i||x(this,r,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=r>>>8,this[t+1]=r&255):B(this,r,t,!1),t+2};a.prototype.writeInt32LE=function(r,t,i){return r=+r,t=t|0,i||x(this,r,t,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24):S(this,r,t,!0),t+4};a.prototype.writeInt32BE=function(r,t,i){return r=+r,t=t|0,i||x(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),a.TYPED_ARRAY_SUPPORT?(this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255):S(this,r,t,!1),t+4};function or(e,r,t,i,n,o){if(t+i>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function pr(e,r,t,i,n){return n||or(e,r,t,4,34028234663852886e22,-34028234663852886e22),sr(e,r,t,i,23,4),t+4}a.prototype.writeFloatLE=function(r,t,i){return pr(this,r,t,!0,i)};a.prototype.writeFloatBE=function(r,t,i){return pr(this,r,t,!1,i)};function ar(e,r,t,i,n){return n||or(e,r,t,8,17976931348623157e292,-17976931348623157e292),sr(e,r,t,i,52,8),t+8}a.prototype.writeDoubleLE=function(r,t,i){return ar(this,r,t,!0,i)};a.prototype.writeDoubleBE=function(r,t,i){return ar(this,r,t,!1,i)};a.prototype.copy=function(r,t,i,n){if(i||(i=0),!n&&n!==0&&(n=this.length),t>=r.length&&(t=r.length),t||(t=0),n>0&&n<i&&(n=i),n===i||r.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),r.length-t<n-i&&(n=r.length-t+i);var o=n-i,p;if(this===r&&i<t&&t<n)for(p=o-1;p>=0;--p)r[p+t]=this[p+i];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(p=0;p<o;++p)r[p+t]=this[p+i];else Uint8Array.prototype.set.call(r,this.subarray(i,i+o),t);return o};a.prototype.fill=function(r,t,i,n){if(typeof r=="string"){if(typeof t=="string"?(n=t,t=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else typeof r=="number"&&(r=r&255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;t=t>>>0,i=i===void 0?this.length:i>>>0,r||(r=0);var p;if(typeof r=="number")for(p=t;p<i;++p)this[p]=r;else{var c=w(r)?r:P(new a(r,n).toString()),h=c.length;for(p=0;p<i-t;++p)this[p+t]=c[p%h]}return this};var ct=/[^+\/0-9A-Za-z-_]/g;function ht(e){if(e=st(e).replace(ct,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function st(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function ft(e){return e<16?"0"+e.toString(16):e.toString(16)}function P(e,r){r=r||1/0;for(var t,i=e.length,n=null,o=[],p=0;p<i;++p){if(t=e.charCodeAt(p),t>55295&&t<57344){if(!n){if(t>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(p+1===i){(r-=3)>-1&&o.push(239,191,189);continue}n=t;continue}if(t<56320){(r-=3)>-1&&o.push(239,191,189),n=t;continue}t=(n-55296<<10|t-56320)+65536}else n&&(r-=3)>-1&&o.push(239,191,189);if(n=null,t<128){if((r-=1)<0)break;o.push(t)}else if(t<2048){if((r-=2)<0)break;o.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;o.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;o.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return o}function ut(e){for(var r=[],t=0;t<e.length;++t)r.push(e.charCodeAt(t)&255);return r}function lt(e,r){for(var t,i,n,o=[],p=0;p<e.length&&!((r-=2)<0);++p)t=e.charCodeAt(p),i=t>>8,n=t%256,o.push(n),o.push(i);return o}function cr(e){return Vr(ht(e))}function M(e,r,t,i){for(var n=0;n<i&&!(n+t>=r.length||n>=e.length);++n)r[n+t]=e[n];return n}function Et(e){return e!==e}function mt(e){return e!=null&&(!!e._isBuffer||hr(e)||xt(e))}function hr(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function xt(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&hr(e.slice(0,0))}function k(e,r,t,i,n){var o,p,c=n*8-i-1,h=(1<<c)-1,s=h>>1,u=-7,f=t?n-1:0,_=t?-1:1,m=e[r+f];for(f+=_,o=m&(1<<-u)-1,m>>=-u,u+=c;u>0;o=o*256+e[r+f],f+=_,u-=8);for(p=o&(1<<-u)-1,o>>=-u,u+=i;u>0;p=p*256+e[r+f],f+=_,u-=8);if(o===0)o=1-s;else{if(o===h)return p?NaN:(m?-1:1)*(1/0);p=p+Math.pow(2,i),o=o-s}return(m?-1:1)*p*Math.pow(2,o-i)}function sr(e,r,t,i,n,o){var p,c,h,s=o*8-n-1,u=(1<<s)-1,f=u>>1,_=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=i?0:o-1,N=i?1:-1,Er=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,p=u):(p=Math.floor(Math.log(r)/Math.LN2),r*(h=Math.pow(2,-p))<1&&(p--,h*=2),p+f>=1?r+=_/h:r+=_*Math.pow(2,1-f),r*h>=2&&(p++,h/=2),p+f>=u?(c=0,p=u):p+f>=1?(c=(r*h-1)*Math.pow(2,n),p=p+f):(c=r*Math.pow(2,f-1)*Math.pow(2,n),p=0));n>=8;e[t+m]=c&255,m+=N,c/=256,n-=8);for(p=p<<n|c,s+=n;s>0;e[t+m]=p&255,m+=N,p/=256,s-=8);e[t+m-N]|=Er*128}var fr=(s=>(s.MFT_AUDIO_LINK="mft.audioLink",s.MFT_TITLE="mft.title",s.MODE_PRE_SALE="mode.preSale",s.MAKER_FEE="makerFee",s.TAKER_FEE="takerFee",s.VIEW_BASE_COIN_ICON_LINK="view.baseCoinIconLink",s.VIEW_BASE_COIN_MARKET_LINK="view.baseCoinMarketLink",s.VIEW_PRICE_COIN_ICON_LINK="view.priceCoinIconLink",s.VIEW_PRICE_COIN_MARKET_LINK="view.priceCoinMarketLink",s))(fr||{}),L=fr;var ur=(n=>(n.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",n.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",n.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",n.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",n))(ur||{}),lr=(i=>(i.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",i.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",i.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",i))(lr||{}),ge={...ur,...lr};var vi=e=>{let{base_id:r,base_chain_id:t,base_decimal:i,base_currency:n,price_id:o,price_chain_id:p,price_decimal:c,price_currency:h}=e,[s,u]=[[r,t,i,n],[o,p,c,h]].map(([f,_,m,N])=>({address:f,chainId:_,decimal:m,name:N}));return{baseAsset:s,priceAsset:u}},_t=(e,r)=>e?.reduce((t,i)=>{let{settingId:n,value:o}=i;return i.companyId&&i.companyId!==r||(n===L.MODE_PRE_SALE?t[n]=JSON.parse(o):t[n]=o),t},{}),Oi=(e,r,t)=>{let i=_t(e,r),n=t==="M"?L.MAKER_FEE:L.TAKER_FEE,o=Number(i[n]);if(o)return o};export{Oi as extractPairFee,vi as fetchTokensFromPair,_t as parsePairSettings};
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
5
|
+
(*!
|
|
6
|
+
* The buffer module from node.js, for the browser.
|
|
7
|
+
*
|
|
8
|
+
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
9
|
+
* @license MIT
|
|
10
|
+
*)
|
|
11
|
+
*/
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function K(){throw new Error("setTimeout has not been defined")}function V(){throw new Error("clearTimeout has not been defined")}var w=K,A=V;typeof globalThis.setTimeout=="function"&&(w=setTimeout);typeof globalThis.clearTimeout=="function"&&(A=clearTimeout);function H(t){if(w===setTimeout)return setTimeout(t,0);if((w===K||!w)&&setTimeout)return w=setTimeout,setTimeout(t,0);try{return w(t,0)}catch{try{return w.call(null,t,0)}catch{return w.call(this,t,0)}}}function fr(t){if(A===clearTimeout)return clearTimeout(t);if((A===V||!A)&&clearTimeout)return A=clearTimeout,clearTimeout(t);try{return A(t)}catch{try{return A.call(null,t)}catch{return A.call(this,t)}}}var x=[],v=!1,I,k=-1;function mr(){!v||!I||(v=!1,I.length?x=I.concat(x):k=-1,x.length&&z())}function z(){if(!v){var t=H(mr);v=!0;for(var r=x.length;r;){for(I=x,x=[];++k<r;)I&&I[k].run();k=-1,r=x.length}I=null,v=!1,fr(t)}}function hr(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];x.push(new J(t,r)),x.length===1&&!v&&H(z)}function J(t,r){this.fun=t,this.array=r}J.prototype.run=function(){this.fun.apply(null,this.array)};var br="browser",gr="browser",dr=!0,Er={},Tr=[],_r="",xr={},yr={},wr={};function R(){}var Ar=R,Ir=R,Rr=R,Sr=R,Nr=R,Pr=R,vr=R;function kr(t){throw new Error("process.binding is not supported")}function Cr(){return"/"}function Or(t){throw new Error("process.chdir is not supported")}function Dr(){return 0}var P=globalThis.performance||{},Mr=P.now||P.mozNow||P.msNow||P.oNow||P.webkitNow||function(){return new Date().getTime()};function Br(t){var r=Mr.call(P)*.001,e=Math.floor(r),n=Math.floor(r%1*1e9);return t&&(e=e-t[0],n=n-t[1],n<0&&(e--,n+=1e9)),[e,n]}var Lr=new Date;function Ur(){var t=new Date,r=t-Lr;return r/1e3}var h={nextTick:hr,title:br,browser:dr,env:Er,argv:Tr,version:_r,versions:xr,on:Ar,addListener:Ir,once:Rr,off:Sr,removeListener:Nr,removeAllListeners:Pr,emit:vr,binding:kr,cwd:Cr,chdir:Or,umask:Dr,hrtime:Br,platform:gr,release:yr,config:wr,uptime:Ur},G={};Object.keys(G).forEach(t=>{let r=t.split("."),e=h;for(let n=0;n<r.length;n++){let i=r[n];n===r.length-1?e[i]=G[t]:e=e[i]||(e[i]={})}});var T=[],d=[],Yr=typeof Uint8Array<"u"?Uint8Array:Array,Y=!1;function Z(){Y=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)T[r]=t[r],d[t.charCodeAt(r)]=r;d[45]=62,d[95]=63}function Fr(t){Y||Z();var r,e,n,i,a,o,s=t.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=t[s-2]==="="?2:t[s-1]==="="?1:0,o=new Yr(s*3/4-a),n=a>0?s-4:s;var c=0;for(r=0,e=0;r<n;r+=4,e+=3)i=d[t.charCodeAt(r)]<<18|d[t.charCodeAt(r+1)]<<12|d[t.charCodeAt(r+2)]<<6|d[t.charCodeAt(r+3)],o[c++]=i>>16&255,o[c++]=i>>8&255,o[c++]=i&255;return a===2?(i=d[t.charCodeAt(r)]<<2|d[t.charCodeAt(r+1)]>>4,o[c++]=i&255):a===1&&(i=d[t.charCodeAt(r)]<<10|d[t.charCodeAt(r+1)]<<4|d[t.charCodeAt(r+2)]>>2,o[c++]=i>>8&255,o[c++]=i&255),o}function Wr(t){return T[t>>18&63]+T[t>>12&63]+T[t>>6&63]+T[t&63]}function Gr(t,r,e){for(var n,i=[],a=r;a<e;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],i.push(Wr(n));return i.join("")}function X(t){Y||Z();for(var r,e=t.length,n=e%3,i="",a=[],o=16383,s=0,c=e-n;s<c;s+=o)a.push(Gr(t,s,s+o>c?c:s+o));return n===1?(r=t[e-1],i+=T[r>>2],i+=T[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=T[r>>10],i+=T[r>>4&63],i+=T[r<<2&63],i+="="),a.push(i),a.join("")}u.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function C(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function y(t,r){if(C()<r)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=u.prototype):(t===null&&(t=new u(r)),t.length=r),t}function u(t,r,e){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u))return new u(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return F(this,t)}return Q(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function Q(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Hr(t,r,e,n):typeof r=="string"?Vr(t,r,e):zr(t,r)}u.from=function(t,r,e){return Q(null,t,r,e)};u.kMaxLength=C();u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&u[Symbol.species]);function j(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function Kr(t,r,e,n){return j(r),r<=0?y(t,r):e!==void 0?typeof n=="string"?y(t,r).fill(e,n):y(t,r).fill(e):y(t,r)}u.alloc=function(t,r,e){return Kr(null,t,r,e)};function F(t,r){if(j(r),t=y(t,r<0?0:W(r)|0),!u.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}u.allocUnsafe=function(t){return F(null,t)};u.allocUnsafeSlow=function(t){return F(null,t)};function Vr(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!u.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=rr(r,e)|0;t=y(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function U(t,r){var e=r.length<0?0:W(r.length)|0;t=y(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function Hr(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),u.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=u.prototype):t=U(t,r),t}function zr(t,r){if(_(r)){var e=W(r.length)|0;return t=y(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||pe(r.length)?y(t,0):U(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return U(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function W(t){if(t>=C())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+C().toString(16)+" bytes");return t|0}u.isBuffer=fe;function _(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!_(r)||!_(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,i=e.length,a=0,o=Math.min(n,i);a<o;++a)if(r[a]!==e[a]){n=r[a],i=e[a];break}return n<i?-1:i<n?1:0};u.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};u.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return u.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var i=u.allocUnsafe(e),a=0;for(n=0;n<r.length;++n){var o=r[n];if(!_(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,a),a+=o.length}return i};function rr(t,r){if(_(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return O(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return ur(t).length;default:if(n)return O(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=rr;function Jr(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return ne(this,r,e);case"utf8":case"utf-8":return nr(this,r,e);case"ascii":return ee(this,r,e);case"latin1":case"binary":return te(this,r,e);case"base64":return jr(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ie(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function S(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}u.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)S(this,e,e+1);return this};u.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)S(this,e,e+3),S(this,e+1,e+2);return this};u.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)S(this,e,e+7),S(this,e+1,e+6),S(this,e+2,e+5),S(this,e+3,e+4);return this};u.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?nr(this,0,r):Jr.apply(this,arguments)};u.prototype.equals=function(r){if(!_(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:u.compare(this,r)===0};u.prototype.compare=function(r,e,n,i,a){if(!_(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),a===void 0&&(a=this.length),e<0||n>r.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&e>=n)return 0;if(i>=a)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,a>>>=0,this===r)return 0;for(var o=a-i,s=n-e,c=Math.min(o,s),p=this.slice(i,a),f=r.slice(e,n),l=0;l<c;++l)if(p[l]!==f[l]){o=p[l],s=f[l];break}return o<s?-1:s<o?1:0};function er(t,r,e,n,i){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof r=="string"&&(r=u.from(r,n)),_(r))return r.length===0?-1:q(t,r,e,n,i);if(typeof r=="number")return r=r&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):q(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function q(t,r,e,n,i){var a=1,o=t.length,s=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;a=2,o/=2,s/=2,e/=2}function c(g,N){return a===1?g[N]:g.readUInt16BE(N*a)}var p;if(i){var f=-1;for(p=e;p<o;p++)if(c(t,p)===c(r,f===-1?0:p-f)){if(f===-1&&(f=p),p-f+1===s)return f*a}else f!==-1&&(p-=p-f),f=-1}else for(e+s>o&&(e=o-s),p=e;p>=0;p--){for(var l=!0,E=0;E<s;E++)if(c(t,p+E)!==c(r,E)){l=!1;break}if(l)return p}return-1}u.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};u.prototype.indexOf=function(r,e,n){return er(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return er(this,r,e,n,!1)};function Xr(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var a=r.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o<n;++o){var s=parseInt(r.substr(o*2,2),16);if(isNaN(s))return o;t[e+o]=s}return o}function qr(t,r,e,n){return B(O(r,t.length-e),t,e,n)}function tr(t,r,e,n){return B(ce(r),t,e,n)}function $r(t,r,e,n){return tr(t,r,e,n)}function Zr(t,r,e,n){return B(ur(r),t,e,n)}function Qr(t,r,e,n){return B(le(r,t.length-e),t,e,n)}u.prototype.write=function(r,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-e;if((n===void 0||n>a)&&(n=a),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return Xr(this,r,e,n);case"utf8":case"utf-8":return qr(this,r,e,n);case"ascii":return tr(this,r,e,n);case"latin1":case"binary":return $r(this,r,e,n);case"base64":return Zr(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Qr(this,r,e,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function jr(t,r,e){return r===0&&e===t.length?X(t):X(t.slice(r,e))}function nr(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var a=t[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s<=e){var c,p,f,l;switch(s){case 1:a<128&&(o=a);break;case 2:c=t[i+1],(c&192)===128&&(l=(a&31)<<6|c&63,l>127&&(o=l));break;case 3:c=t[i+1],p=t[i+2],(c&192)===128&&(p&192)===128&&(l=(a&15)<<12|(c&63)<<6|p&63,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:c=t[i+1],p=t[i+2],f=t[i+3],(c&192)===128&&(p&192)===128&&(f&192)===128&&(l=(a&15)<<18|(c&63)<<12|(p&63)<<6|f&63,l>65535&&l<1114112&&(o=l))}}o===null?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),i+=s}return re(n)}var $=4096;function re(t){var r=t.length;if(r<=$)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=$));return e}function ee(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]&127);return n}function te(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function ne(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",a=r;a<e;++a)i+=se(t[a]);return i}function ie(t,r,e){for(var n=t.slice(r,e),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+n[a+1]*256);return i}u.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var i;if(u.TYPED_ARRAY_SUPPORT)i=this.subarray(r,e),i.__proto__=u.prototype;else{var a=e-r;i=new u(a,void 0);for(var o=0;o<a;++o)i[o]=this[o+r]}return i};function m(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=this[r],a=1,o=0;++o<e&&(a*=256);)i+=this[r+o]*a;return i};u.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=this[r+--e],a=1;e>0&&(a*=256);)i+=this[r+--e]*a;return i};u.prototype.readUInt8=function(r,e){return e||m(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||m(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||m(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUInt32LE=function(r,e){return e||m(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};u.prototype.readUInt32BE=function(r,e){return e||m(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};u.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=this[r],a=1,o=0;++o<e&&(a*=256);)i+=this[r+o]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*e)),i};u.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=e,a=1,o=this[r+--i];i>0&&(a*=256);)o+=this[r+--i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*e)),o};u.prototype.readInt8=function(r,e){return e||m(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,e){e||m(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};u.prototype.readInt16BE=function(r,e){e||m(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};u.prototype.readInt32LE=function(r,e){return e||m(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};u.prototype.readInt32BE=function(r,e){return e||m(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};u.prototype.readFloatLE=function(r,e){return e||m(r,4,this.length),L(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||m(r,4,this.length),L(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||m(r,8,this.length),L(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||m(r,8,this.length),L(this,r,!1,52,8)};function b(t,r,e,n,i,a){if(!_(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<a)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}u.prototype.writeUIntLE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;b(this,r,e,n,a,0)}var o=1,s=0;for(this[e]=r&255;++s<n&&(o*=256);)this[e+s]=r/o&255;return e+n};u.prototype.writeUIntBE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;b(this,r,e,n,a,0)}var o=n-1,s=1;for(this[e+o]=r&255;--o>=0&&(s*=256);)this[e+o]=r/s&255;return e+n};u.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||b(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function D(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,a=Math.min(t.length-e,2);i<a;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}u.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||b(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):D(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||b(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):D(this,r,e,!1),e+2};function M(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,a=Math.min(t.length-e,4);i<a;++i)t[e+i]=r>>>(n?i:3-i)*8&255}u.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||b(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):M(this,r,e,!0),e+4};u.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||b(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):M(this,r,e,!1),e+4};u.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e|0,!i){var a=Math.pow(2,8*n-1);b(this,r,e,n,a-1,-a)}var o=0,s=1,c=0;for(this[e]=r&255;++o<n&&(s*=256);)r<0&&c===0&&this[e+o-1]!==0&&(c=1),this[e+o]=(r/s>>0)-c&255;return e+n};u.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e|0,!i){var a=Math.pow(2,8*n-1);b(this,r,e,n,a-1,-a)}var o=n-1,s=1,c=0;for(this[e+o]=r&255;--o>=0&&(s*=256);)r<0&&c===0&&this[e+o+1]!==0&&(c=1),this[e+o]=(r/s>>0)-c&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||b(this,r,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};u.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||b(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):D(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||b(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):D(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||b(this,r,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):M(this,r,e,!0),e+4};u.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||b(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):M(this,r,e,!1),e+4};function ir(t,r,e,n,i,a){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function ar(t,r,e,n,i){return i||ir(t,r,e,4,34028234663852886e22,-34028234663852886e22),cr(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return ar(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return ar(this,r,e,!1,n)};function or(t,r,e,n,i){return i||ir(t,r,e,8,17976931348623157e292,-17976931348623157e292),cr(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return or(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return or(this,r,e,!1,n)};u.prototype.copy=function(r,e,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),e>=r.length&&(e=r.length),e||(e=0),i>0&&i<n&&(i=n),i===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-e<i-n&&(i=r.length-e+n);var a=i-n,o;if(this===r&&n<e&&e<i)for(o=a-1;o>=0;--o)r[o+e]=this[o+n];else if(a<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o<a;++o)r[o+e]=this[o+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+a),e);return a};u.prototype.fill=function(r,e,n,i){if(typeof r=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),r.length===1){var a=r.charCodeAt(0);a<256&&(r=a)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var o;if(typeof r=="number")for(o=e;o<n;++o)this[o]=r;else{var s=_(r)?r:O(new u(r,i).toString()),c=s.length;for(o=0;o<n-e;++o)this[o+e]=s[o%c]}return this};var ae=/[^+\/0-9A-Za-z-_]/g;function oe(t){if(t=ue(t).replace(ae,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function ue(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function se(t){return t<16?"0"+t.toString(16):t.toString(16)}function O(t,r){r=r||1/0;for(var e,n=t.length,i=null,a=[],o=0;o<n;++o){if(e=t.charCodeAt(o),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&a.push(239,191,189);continue}else if(o+1===n){(r-=3)>-1&&a.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&a.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&a.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;a.push(e)}else if(e<2048){if((r-=2)<0)break;a.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;a.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;a.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return a}function ce(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function le(t,r){for(var e,n,i,a=[],o=0;o<t.length&&!((r-=2)<0);++o)e=t.charCodeAt(o),n=e>>8,i=e%256,a.push(i),a.push(n);return a}function ur(t){return Fr(oe(t))}function B(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function pe(t){return t!==t}function fe(t){return t!=null&&(!!t._isBuffer||sr(t)||me(t))}function sr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function me(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&sr(t.slice(0,0))}function L(t,r,e,n,i){var a,o,s=i*8-n-1,c=(1<<s)-1,p=c>>1,f=-7,l=e?i-1:0,E=e?-1:1,g=t[r+l];for(l+=E,a=g&(1<<-f)-1,g>>=-f,f+=s;f>0;a=a*256+t[r+l],l+=E,f-=8);for(o=a&(1<<-f)-1,a>>=-f,f+=n;f>0;o=o*256+t[r+l],l+=E,f-=8);if(a===0)a=1-p;else{if(a===c)return o?NaN:(g?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-p}return(g?-1:1)*o*Math.pow(2,a-n)}function cr(t,r,e,n,i,a){var o,s,c,p=a*8-i-1,f=(1<<p)-1,l=f>>1,E=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:a-1,N=n?1:-1,pr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,o=f):(o=Math.floor(Math.log(r)/Math.LN2),r*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+l>=1?r+=E/c:r+=E*Math.pow(2,1-l),r*c>=2&&(o++,c/=2),o+l>=f?(s=0,o=f):o+l>=1?(s=(r*c-1)*Math.pow(2,i),o=o+l):(s=r*Math.pow(2,l-1)*Math.pow(2,i),o=0));i>=8;t[e+g]=s&255,g+=N,s/=256,i-=8);for(o=o<<i|s,p+=i;p>0;t[e+g]=o&255,g+=N,o/=256,p-=8);t[e+g-N]|=pr*128}var Ae=`{"theme1":{"value":"${h.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${h.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${h.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var lr={V1_1:"v1_1",V2:"v2"},Ne={[lr.V1_1]:{testnet:62368684,mainnet:552635992},[lr.V2]:{testnet:148607e3,mainnet:1002541853}};var et=t=>{let r={};return t.forEach(({settingId:e,value:n,setting:i})=>{i.type==="boolean"?r[e]=n==="true":r[e]=n}),{discordEnabled:r["point-system.discordEnabled"],telegramBotName:r["point-system.telegramBotName"],telegramBotId:r["point-system.telegramBotId"],telegramEnabled:r["point-system.telegramEnabled"],telegramGroupId:r["point-system.telegramGroupId"],telegramGroupName:r["point-system.telegramGroupName"],twitterAccountId:r["point-system.twitterAccountId"],twitterAccountName:r["point-system.twitterAccountName"],twitterEnabled:r["point-system.twitterEnabled"],twitterJobEnabled:r["point-system.twitterJobEnabled"],guideLink:r["point-system.guideLink"]}};export{et as transformPointSystemSettings};
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
5
|
+
(*!
|
|
6
|
+
* The buffer module from node.js, for the browser.
|
|
7
|
+
*
|
|
8
|
+
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
9
|
+
* @license MIT
|
|
10
|
+
*)
|
|
11
|
+
*/
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function V(){throw new Error("setTimeout has not been defined")}function W(){throw new Error("clearTimeout has not been defined")}var d=V,R=W;typeof globalThis.setTimeout=="function"&&(d=setTimeout);typeof globalThis.clearTimeout=="function"&&(R=clearTimeout);function X(e){if(d===setTimeout)return setTimeout(e,0);if((d===V||!d)&&setTimeout)return d=setTimeout,setTimeout(e,0);try{return d(e,0)}catch{try{return d.call(null,e,0)}catch{return d.call(this,e,0)}}}function gr(e){if(R===clearTimeout)return clearTimeout(e);if((R===W||!R)&&clearTimeout)return R=clearTimeout,clearTimeout(e);try{return R(e)}catch{try{return R.call(null,e)}catch{return R.call(this,e)}}}var A=[],B=!1,_,S=-1;function Er(){!B||!_||(B=!1,_.length?A=_.concat(A):S=-1,A.length&&Z())}function Z(){if(!B){var e=X(Er);B=!0;for(var r=A.length;r;){for(_=A,A=[];++S<r;)_&&_[S].run();S=-1,r=A.length}_=null,B=!1,gr(e)}}function Tr(e){var r=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)r[n-1]=arguments[n];A.push(new z(e,r)),A.length===1&&!B&&X(Z)}function z(e,r){this.fun=e,this.array=r}z.prototype.run=function(){this.fun.apply(null,this.array)};var Ar="browser",yr="browser",dr=!0,Rr={},_r=[],Ur="",Ir={},vr={},br={};function U(){}var Br=U,Sr=U,kr=U,Mr=U,Pr=U,Dr=U,Nr=U;function Yr(e){throw new Error("process.binding is not supported")}function Lr(){return"/"}function Cr(e){throw new Error("process.chdir is not supported")}function Fr(){return 0}var b=globalThis.performance||{},Or=b.now||b.mozNow||b.msNow||b.oNow||b.webkitNow||function(){return new Date().getTime()};function Hr(e){var r=Or.call(b)*.001,n=Math.floor(r),t=Math.floor(r%1*1e9);return e&&(n=n-e[0],t=t-e[1],t<0&&(n--,t+=1e9)),[n,t]}var qr=new Date;function Gr(){var e=new Date,r=e-qr;return r/1e3}var k={nextTick:Tr,title:Ar,browser:dr,env:Rr,argv:_r,version:Ur,versions:Ir,on:Br,addListener:Sr,once:kr,off:Mr,removeListener:Pr,removeAllListeners:Dr,emit:Nr,binding:Yr,cwd:Lr,chdir:Cr,umask:Fr,hrtime:Hr,platform:yr,release:vr,config:br,uptime:Gr},Q={};Object.keys(Q).forEach(e=>{let r=e.split("."),n=k;for(let t=0;t<r.length;t++){let i=r[t];t===r.length-1?n[i]=Q[e]:n=n[i]||(n[i]={})}});var E=[],m=[],Qr=typeof Uint8Array<"u"?Uint8Array:Array,O=!1;function j(){O=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,n=e.length;r<n;++r)E[r]=e[r],m[e.charCodeAt(r)]=r;m[45]=62,m[95]=63}function Vr(e){O||j();var r,n,t,i,o,u,a=e.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=e[a-2]==="="?2:e[a-1]==="="?1:0,u=new Qr(a*3/4-o),t=o>0?a-4:a;var c=0;for(r=0,n=0;r<t;r+=4,n+=3)i=m[e.charCodeAt(r)]<<18|m[e.charCodeAt(r+1)]<<12|m[e.charCodeAt(r+2)]<<6|m[e.charCodeAt(r+3)],u[c++]=i>>16&255,u[c++]=i>>8&255,u[c++]=i&255;return o===2?(i=m[e.charCodeAt(r)]<<2|m[e.charCodeAt(r+1)]>>4,u[c++]=i&255):o===1&&(i=m[e.charCodeAt(r)]<<10|m[e.charCodeAt(r+1)]<<4|m[e.charCodeAt(r+2)]>>2,u[c++]=i>>8&255,u[c++]=i&255),u}function Wr(e){return E[e>>18&63]+E[e>>12&63]+E[e>>6&63]+E[e&63]}function Xr(e,r,n){for(var t,i=[],o=r;o<n;o+=3)t=(e[o]<<16)+(e[o+1]<<8)+e[o+2],i.push(Wr(t));return i.join("")}function J(e){O||j();for(var r,n=e.length,t=n%3,i="",o=[],u=16383,a=0,c=n-t;a<c;a+=u)o.push(Xr(e,a,a+u>c?c:a+u));return t===1?(r=e[n-1],i+=E[r>>2],i+=E[r<<4&63],i+="=="):t===2&&(r=(e[n-2]<<8)+e[n-1],i+=E[r>>10],i+=E[r>>4&63],i+=E[r<<2&63],i+="="),o.push(i),o.join("")}f.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function M(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function y(e,r){if(M()<r)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(r),e.__proto__=f.prototype):(e===null&&(e=new f(r)),e.length=r),e}function f(e,r,n){if(!f.TYPED_ARRAY_SUPPORT&&!(this instanceof f))return new f(e,r,n);if(typeof e=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return H(this,e)}return rr(this,e,r,n)}f.poolSize=8192;f._augment=function(e){return e.__proto__=f.prototype,e};function rr(e,r,n,t){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Jr(e,r,n,t):typeof r=="string"?zr(e,r,n):$r(e,r)}f.from=function(e,r,n){return rr(null,e,r,n)};f.kMaxLength=M();f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&f[Symbol.species]);function nr(e){if(typeof e!="number")throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function Zr(e,r,n,t){return nr(r),r<=0?y(e,r):n!==void 0?typeof t=="string"?y(e,r).fill(n,t):y(e,r).fill(n):y(e,r)}f.alloc=function(e,r,n){return Zr(null,e,r,n)};function H(e,r){if(nr(r),e=y(e,r<0?0:q(r)|0),!f.TYPED_ARRAY_SUPPORT)for(var n=0;n<r;++n)e[n]=0;return e}f.allocUnsafe=function(e){return H(null,e)};f.allocUnsafeSlow=function(e){return H(null,e)};function zr(e,r,n){if((typeof n!="string"||n==="")&&(n="utf8"),!f.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var t=er(r,n)|0;e=y(e,t);var i=e.write(r,n);return i!==t&&(e=e.slice(0,i)),e}function F(e,r){var n=r.length<0?0:q(r.length)|0;e=y(e,n);for(var t=0;t<n;t+=1)e[t]=r[t]&255;return e}function Jr(e,r,n,t){if(r.byteLength,n<0||r.byteLength<n)throw new RangeError("'offset' is out of bounds");if(r.byteLength<n+(t||0))throw new RangeError("'length' is out of bounds");return n===void 0&&t===void 0?r=new Uint8Array(r):t===void 0?r=new Uint8Array(r,n):r=new Uint8Array(r,n,t),f.TYPED_ARRAY_SUPPORT?(e=r,e.__proto__=f.prototype):e=F(e,r),e}function $r(e,r){if(T(r)){var n=q(r.length)|0;return e=y(e,n),e.length===0||r.copy(e,0,0,n),e}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||gn(r.length)?y(e,0):F(e,r);if(r.type==="Buffer"&&Array.isArray(r.data))return F(e,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function q(e){if(e>=M())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+M().toString(16)+" bytes");return e|0}f.isBuffer=En;function T(e){return!!(e!=null&&e._isBuffer)}f.compare=function(r,n){if(!T(r)||!T(n))throw new TypeError("Arguments must be Buffers");if(r===n)return 0;for(var t=r.length,i=n.length,o=0,u=Math.min(t,i);o<u;++o)if(r[o]!==n[o]){t=r[o],i=n[o];break}return t<i?-1:i<t?1:0};f.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};f.concat=function(r,n){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return f.alloc(0);var t;if(n===void 0)for(n=0,t=0;t<r.length;++t)n+=r[t].length;var i=f.allocUnsafe(n),o=0;for(t=0;t<r.length;++t){var u=r[t];if(!T(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(i,o),o+=u.length}return i};function er(e,r){if(T(e))return e.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;typeof e!="string"&&(e=""+e);var n=e.length;if(n===0)return 0;for(var t=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return P(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return cr(e).length;default:if(t)return P(e).length;r=(""+r).toLowerCase(),t=!0}}f.byteLength=er;function Kr(e,r,n){var t=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,r>>>=0,n<=r))return"";for(e||(e="utf8");;)switch(e){case"hex":return cn(this,r,n);case"utf8":case"utf-8":return or(this,r,n);case"ascii":return fn(this,r,n);case"latin1":case"binary":return an(this,r,n);case"base64":return on(this,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return sn(this,r,n);default:if(t)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),t=!0}}f.prototype._isBuffer=!0;function I(e,r,n){var t=e[r];e[r]=e[n],e[n]=t}f.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var n=0;n<r;n+=2)I(this,n,n+1);return this};f.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var n=0;n<r;n+=4)I(this,n,n+3),I(this,n+1,n+2);return this};f.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var n=0;n<r;n+=8)I(this,n,n+7),I(this,n+1,n+6),I(this,n+2,n+5),I(this,n+3,n+4);return this};f.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?or(this,0,r):Kr.apply(this,arguments)};f.prototype.equals=function(r){if(!T(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:f.compare(this,r)===0};f.prototype.compare=function(r,n,t,i,o){if(!T(r))throw new TypeError("Argument must be a Buffer");if(n===void 0&&(n=0),t===void 0&&(t=r?r.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),n<0||t>r.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&n>=t)return 0;if(i>=o)return-1;if(n>=t)return 1;if(n>>>=0,t>>>=0,i>>>=0,o>>>=0,this===r)return 0;for(var u=o-i,a=t-n,c=Math.min(u,a),l=this.slice(i,o),s=r.slice(n,t),h=0;h<c;++h)if(l[h]!==s[h]){u=l[h],a=s[h];break}return u<a?-1:a<u?1:0};function tr(e,r,n,t,i){if(e.length===0)return-1;if(typeof n=="string"?(t=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0)if(i)n=0;else return-1;if(typeof r=="string"&&(r=f.from(r,t)),T(r))return r.length===0?-1:$(e,r,n,t,i);if(typeof r=="number")return r=r&255,f.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,r,n):Uint8Array.prototype.lastIndexOf.call(e,r,n):$(e,[r],n,t,i);throw new TypeError("val must be string, number or Buffer")}function $(e,r,n,t,i){var o=1,u=e.length,a=r.length;if(t!==void 0&&(t=String(t).toLowerCase(),t==="ucs2"||t==="ucs-2"||t==="utf16le"||t==="utf-16le")){if(e.length<2||r.length<2)return-1;o=2,u/=2,a/=2,n/=2}function c(w,v){return o===1?w[v]:w.readUInt16BE(v*o)}var l;if(i){var s=-1;for(l=n;l<u;l++)if(c(e,l)===c(r,s===-1?0:l-s)){if(s===-1&&(s=l),l-s+1===a)return s*o}else s!==-1&&(l-=l-s),s=-1}else for(n+a>u&&(n=u-a),l=n;l>=0;l--){for(var h=!0,g=0;g<a;g++)if(c(e,l+g)!==c(r,g)){h=!1;break}if(h)return l}return-1}f.prototype.includes=function(r,n,t){return this.indexOf(r,n,t)!==-1};f.prototype.indexOf=function(r,n,t){return tr(this,r,n,t,!0)};f.prototype.lastIndexOf=function(r,n,t){return tr(this,r,n,t,!1)};function jr(e,r,n,t){n=Number(n)||0;var i=e.length-n;t?(t=Number(t),t>i&&(t=i)):t=i;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");t>o/2&&(t=o/2);for(var u=0;u<t;++u){var a=parseInt(r.substr(u*2,2),16);if(isNaN(a))return u;e[n+u]=a}return u}function rn(e,r,n,t){return Y(P(r,e.length-n),e,n,t)}function ir(e,r,n,t){return Y(wn(r),e,n,t)}function nn(e,r,n,t){return ir(e,r,n,t)}function en(e,r,n,t){return Y(cr(r),e,n,t)}function tn(e,r,n,t){return Y(mn(r,e.length-n),e,n,t)}f.prototype.write=function(r,n,t,i){if(n===void 0)i="utf8",t=this.length,n=0;else if(t===void 0&&typeof n=="string")i=n,t=this.length,n=0;else if(isFinite(n))n=n|0,isFinite(t)?(t=t|0,i===void 0&&(i="utf8")):(i=t,t=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-n;if((t===void 0||t>o)&&(t=o),r.length>0&&(t<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var u=!1;;)switch(i){case"hex":return jr(this,r,n,t);case"utf8":case"utf-8":return rn(this,r,n,t);case"ascii":return ir(this,r,n,t);case"latin1":case"binary":return nn(this,r,n,t);case"base64":return en(this,r,n,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return tn(this,r,n,t);default:if(u)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),u=!0}};f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function on(e,r,n){return r===0&&n===e.length?J(e):J(e.slice(r,n))}function or(e,r,n){n=Math.min(e.length,n);for(var t=[],i=r;i<n;){var o=e[i],u=null,a=o>239?4:o>223?3:o>191?2:1;if(i+a<=n){var c,l,s,h;switch(a){case 1:o<128&&(u=o);break;case 2:c=e[i+1],(c&192)===128&&(h=(o&31)<<6|c&63,h>127&&(u=h));break;case 3:c=e[i+1],l=e[i+2],(c&192)===128&&(l&192)===128&&(h=(o&15)<<12|(c&63)<<6|l&63,h>2047&&(h<55296||h>57343)&&(u=h));break;case 4:c=e[i+1],l=e[i+2],s=e[i+3],(c&192)===128&&(l&192)===128&&(s&192)===128&&(h=(o&15)<<18|(c&63)<<12|(l&63)<<6|s&63,h>65535&&h<1114112&&(u=h))}}u===null?(u=65533,a=1):u>65535&&(u-=65536,t.push(u>>>10&1023|55296),u=56320|u&1023),t.push(u),i+=a}return un(t)}var K=4096;function un(e){var r=e.length;if(r<=K)return String.fromCharCode.apply(String,e);for(var n="",t=0;t<r;)n+=String.fromCharCode.apply(String,e.slice(t,t+=K));return n}function fn(e,r,n){var t="";n=Math.min(e.length,n);for(var i=r;i<n;++i)t+=String.fromCharCode(e[i]&127);return t}function an(e,r,n){var t="";n=Math.min(e.length,n);for(var i=r;i<n;++i)t+=String.fromCharCode(e[i]);return t}function cn(e,r,n){var t=e.length;(!r||r<0)&&(r=0),(!n||n<0||n>t)&&(n=t);for(var i="",o=r;o<n;++o)i+=xn(e[o]);return i}function sn(e,r,n){for(var t=e.slice(r,n),i="",o=0;o<t.length;o+=2)i+=String.fromCharCode(t[o]+t[o+1]*256);return i}f.prototype.slice=function(r,n){var t=this.length;r=~~r,n=n===void 0?t:~~n,r<0?(r+=t,r<0&&(r=0)):r>t&&(r=t),n<0?(n+=t,n<0&&(n=0)):n>t&&(n=t),n<r&&(n=r);var i;if(f.TYPED_ARRAY_SUPPORT)i=this.subarray(r,n),i.__proto__=f.prototype;else{var o=n-r;i=new f(o,void 0);for(var u=0;u<o;++u)i[u]=this[u+r]}return i};function p(e,r,n){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+r>n)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function(r,n,t){r=r|0,n=n|0,t||p(r,n,this.length);for(var i=this[r],o=1,u=0;++u<n&&(o*=256);)i+=this[r+u]*o;return i};f.prototype.readUIntBE=function(r,n,t){r=r|0,n=n|0,t||p(r,n,this.length);for(var i=this[r+--n],o=1;n>0&&(o*=256);)i+=this[r+--n]*o;return i};f.prototype.readUInt8=function(r,n){return n||p(r,1,this.length),this[r]};f.prototype.readUInt16LE=function(r,n){return n||p(r,2,this.length),this[r]|this[r+1]<<8};f.prototype.readUInt16BE=function(r,n){return n||p(r,2,this.length),this[r]<<8|this[r+1]};f.prototype.readUInt32LE=function(r,n){return n||p(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};f.prototype.readUInt32BE=function(r,n){return n||p(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};f.prototype.readIntLE=function(r,n,t){r=r|0,n=n|0,t||p(r,n,this.length);for(var i=this[r],o=1,u=0;++u<n&&(o*=256);)i+=this[r+u]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*n)),i};f.prototype.readIntBE=function(r,n,t){r=r|0,n=n|0,t||p(r,n,this.length);for(var i=n,o=1,u=this[r+--i];i>0&&(o*=256);)u+=this[r+--i]*o;return o*=128,u>=o&&(u-=Math.pow(2,8*n)),u};f.prototype.readInt8=function(r,n){return n||p(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};f.prototype.readInt16LE=function(r,n){n||p(r,2,this.length);var t=this[r]|this[r+1]<<8;return t&32768?t|4294901760:t};f.prototype.readInt16BE=function(r,n){n||p(r,2,this.length);var t=this[r+1]|this[r]<<8;return t&32768?t|4294901760:t};f.prototype.readInt32LE=function(r,n){return n||p(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};f.prototype.readInt32BE=function(r,n){return n||p(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};f.prototype.readFloatLE=function(r,n){return n||p(r,4,this.length),L(this,r,!0,23,4)};f.prototype.readFloatBE=function(r,n){return n||p(r,4,this.length),L(this,r,!1,23,4)};f.prototype.readDoubleLE=function(r,n){return n||p(r,8,this.length),L(this,r,!0,52,8)};f.prototype.readDoubleBE=function(r,n){return n||p(r,8,this.length),L(this,r,!1,52,8)};function x(e,r,n,t,i,o){if(!T(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(n+t>e.length)throw new RangeError("Index out of range")}f.prototype.writeUIntLE=function(r,n,t,i){if(r=+r,n=n|0,t=t|0,!i){var o=Math.pow(2,8*t)-1;x(this,r,n,t,o,0)}var u=1,a=0;for(this[n]=r&255;++a<t&&(u*=256);)this[n+a]=r/u&255;return n+t};f.prototype.writeUIntBE=function(r,n,t,i){if(r=+r,n=n|0,t=t|0,!i){var o=Math.pow(2,8*t)-1;x(this,r,n,t,o,0)}var u=t-1,a=1;for(this[n+u]=r&255;--u>=0&&(a*=256);)this[n+u]=r/a&255;return n+t};f.prototype.writeUInt8=function(r,n,t){return r=+r,n=n|0,t||x(this,r,n,1,255,0),f.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[n]=r&255,n+1};function D(e,r,n,t){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(e.length-n,2);i<o;++i)e[n+i]=(r&255<<8*(t?i:1-i))>>>(t?i:1-i)*8}f.prototype.writeUInt16LE=function(r,n,t){return r=+r,n=n|0,t||x(this,r,n,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8):D(this,r,n,!0),n+2};f.prototype.writeUInt16BE=function(r,n,t){return r=+r,n=n|0,t||x(this,r,n,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[n]=r>>>8,this[n+1]=r&255):D(this,r,n,!1),n+2};function N(e,r,n,t){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(e.length-n,4);i<o;++i)e[n+i]=r>>>(t?i:3-i)*8&255}f.prototype.writeUInt32LE=function(r,n,t){return r=+r,n=n|0,t||x(this,r,n,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[n+3]=r>>>24,this[n+2]=r>>>16,this[n+1]=r>>>8,this[n]=r&255):N(this,r,n,!0),n+4};f.prototype.writeUInt32BE=function(r,n,t){return r=+r,n=n|0,t||x(this,r,n,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255):N(this,r,n,!1),n+4};f.prototype.writeIntLE=function(r,n,t,i){if(r=+r,n=n|0,!i){var o=Math.pow(2,8*t-1);x(this,r,n,t,o-1,-o)}var u=0,a=1,c=0;for(this[n]=r&255;++u<t&&(a*=256);)r<0&&c===0&&this[n+u-1]!==0&&(c=1),this[n+u]=(r/a>>0)-c&255;return n+t};f.prototype.writeIntBE=function(r,n,t,i){if(r=+r,n=n|0,!i){var o=Math.pow(2,8*t-1);x(this,r,n,t,o-1,-o)}var u=t-1,a=1,c=0;for(this[n+u]=r&255;--u>=0&&(a*=256);)r<0&&c===0&&this[n+u+1]!==0&&(c=1),this[n+u]=(r/a>>0)-c&255;return n+t};f.prototype.writeInt8=function(r,n,t){return r=+r,n=n|0,t||x(this,r,n,1,127,-128),f.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[n]=r&255,n+1};f.prototype.writeInt16LE=function(r,n,t){return r=+r,n=n|0,t||x(this,r,n,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8):D(this,r,n,!0),n+2};f.prototype.writeInt16BE=function(r,n,t){return r=+r,n=n|0,t||x(this,r,n,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[n]=r>>>8,this[n+1]=r&255):D(this,r,n,!1),n+2};f.prototype.writeInt32LE=function(r,n,t){return r=+r,n=n|0,t||x(this,r,n,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8,this[n+2]=r>>>16,this[n+3]=r>>>24):N(this,r,n,!0),n+4};f.prototype.writeInt32BE=function(r,n,t){return r=+r,n=n|0,t||x(this,r,n,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),f.TYPED_ARRAY_SUPPORT?(this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255):N(this,r,n,!1),n+4};function ur(e,r,n,t,i,o){if(n+t>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function fr(e,r,n,t,i){return i||ur(e,r,n,4,34028234663852886e22,-34028234663852886e22),hr(e,r,n,t,23,4),n+4}f.prototype.writeFloatLE=function(r,n,t){return fr(this,r,n,!0,t)};f.prototype.writeFloatBE=function(r,n,t){return fr(this,r,n,!1,t)};function ar(e,r,n,t,i){return i||ur(e,r,n,8,17976931348623157e292,-17976931348623157e292),hr(e,r,n,t,52,8),n+8}f.prototype.writeDoubleLE=function(r,n,t){return ar(this,r,n,!0,t)};f.prototype.writeDoubleBE=function(r,n,t){return ar(this,r,n,!1,t)};f.prototype.copy=function(r,n,t,i){if(t||(t=0),!i&&i!==0&&(i=this.length),n>=r.length&&(n=r.length),n||(n=0),i>0&&i<t&&(i=t),i===t||r.length===0||this.length===0)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(t<0||t>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-n<i-t&&(i=r.length-n+t);var o=i-t,u;if(this===r&&t<n&&n<i)for(u=o-1;u>=0;--u)r[u+n]=this[u+t];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(u=0;u<o;++u)r[u+n]=this[u+t];else Uint8Array.prototype.set.call(r,this.subarray(t,t+o),n);return o};f.prototype.fill=function(r,n,t,i){if(typeof r=="string"){if(typeof n=="string"?(i=n,n=0,t=this.length):typeof t=="string"&&(i=t,t=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!f.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof r=="number"&&(r=r&255);if(n<0||this.length<n||this.length<t)throw new RangeError("Out of range index");if(t<=n)return this;n=n>>>0,t=t===void 0?this.length:t>>>0,r||(r=0);var u;if(typeof r=="number")for(u=n;u<t;++u)this[u]=r;else{var a=T(r)?r:P(new f(r,i).toString()),c=a.length;for(u=0;u<t-n;++u)this[u+n]=a[u%c]}return this};var hn=/[^+\/0-9A-Za-z-_]/g;function ln(e){if(e=pn(e).replace(hn,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function pn(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function xn(e){return e<16?"0"+e.toString(16):e.toString(16)}function P(e,r){r=r||1/0;for(var n,t=e.length,i=null,o=[],u=0;u<t;++u){if(n=e.charCodeAt(u),n>55295&&n<57344){if(!i){if(n>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(u+1===t){(r-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(r-=3)>-1&&o.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((r-=1)<0)break;o.push(n)}else if(n<2048){if((r-=2)<0)break;o.push(n>>6|192,n&63|128)}else if(n<65536){if((r-=3)<0)break;o.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((r-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return o}function wn(e){for(var r=[],n=0;n<e.length;++n)r.push(e.charCodeAt(n)&255);return r}function mn(e,r){for(var n,t,i,o=[],u=0;u<e.length&&!((r-=2)<0);++u)n=e.charCodeAt(u),t=n>>8,i=n%256,o.push(i),o.push(t);return o}function cr(e){return Vr(ln(e))}function Y(e,r,n,t){for(var i=0;i<t&&!(i+n>=r.length||i>=e.length);++i)r[i+n]=e[i];return i}function gn(e){return e!==e}function En(e){return e!=null&&(!!e._isBuffer||sr(e)||Tn(e))}function sr(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function Tn(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&sr(e.slice(0,0))}function L(e,r,n,t,i){var o,u,a=i*8-t-1,c=(1<<a)-1,l=c>>1,s=-7,h=n?i-1:0,g=n?-1:1,w=e[r+h];for(h+=g,o=w&(1<<-s)-1,w>>=-s,s+=a;s>0;o=o*256+e[r+h],h+=g,s-=8);for(u=o&(1<<-s)-1,o>>=-s,s+=t;s>0;u=u*256+e[r+h],h+=g,s-=8);if(o===0)o=1-l;else{if(o===c)return u?NaN:(w?-1:1)*(1/0);u=u+Math.pow(2,t),o=o-l}return(w?-1:1)*u*Math.pow(2,o-t)}function hr(e,r,n,t,i,o){var u,a,c,l=o*8-i-1,s=(1<<l)-1,h=s>>1,g=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=t?0:o-1,v=t?1:-1,mr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,u=s):(u=Math.floor(Math.log(r)/Math.LN2),r*(c=Math.pow(2,-u))<1&&(u--,c*=2),u+h>=1?r+=g/c:r+=g*Math.pow(2,1-h),r*c>=2&&(u++,c/=2),u+h>=s?(a=0,u=s):u+h>=1?(a=(r*c-1)*Math.pow(2,i),u=u+h):(a=r*Math.pow(2,h-1)*Math.pow(2,i),u=0));i>=8;e[n+w]=a&255,w+=v,a/=256,i-=8);for(u=u<<i|a,l+=i;l>0;e[n+w]=u&255,w+=v,u/=256,l-=8);e[n+w-v]|=mr*128}import G from"bignumber.js";G.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});function lr(e,r){return C(e,r,"+")}function pr(e,r){return C(e,r,"/")}function xr(e,r){return!!C(e,r,">")}function wr(e,r){return!!C(e,r,"<")}function C(e,r,n){switch(e=new G(String(e)),r=new G(String(r)),n.toLowerCase()){case"-":return e.minus(r).toString();case"+":return e.plus(r).toString();case"*":case"x":return e.multipliedBy(r).toString();case"\xF7":case"/":return e.dividedBy(r).toString();case">=":return e.isGreaterThanOrEqualTo(r);case">":return e.isGreaterThan(r);case"<=":return e.isLessThanOrEqualTo(r);case"<":return e.isLessThan(r);case"==":return e.isEqualTo(r);case"mod":return e.modulo(r);default:break}}function kn(e,r,n){let t=[],i=n-r,o=null,u=e.sort((a,c)=>c.t-a.t);for(let a=0;a<u.length;a++){let c=u[a];c.t<i&&(o&&(t.push({...o}),o=null),i=i-r*Math.ceil((i-c.t)/r)),o?(wr(o.h,c.h)&&(o.h=c.h),xr(o.l,c.l)&&(o.l=c.l),o.o=c.o,o.v=Number(lr(o.v,c.v))):o={...c,t:i},a+1===u.length&&t.push({...o})}return t}function Mn(e,r,n){let t=e.sort((u,a)=>a.t-u.t),i=[],o=new Map;for(let u of t){let c=new Date(u.t*1e3).getFullYear();o.has(c)||o.set(c,[]),o.get(c).push(u)}for(let[u,a]of o){if(a.length===0)continue;let c=a.sort((s,h)=>s.t-h.t),l={t:new Date(u,0,1).getTime()/1e3,o:c[0].o,h:Math.max(...c.map(s=>s.h)),l:Math.min(...c.map(s=>s.l)),c:c[c.length-1].c,v:c.reduce((s,h)=>s+h.v,0),q:c.reduce((s,h)=>s+h.q,0)};i.push(l)}return i.sort((u,a)=>a.t-u.t)}function Pn(e,r,n){throw new Error("groupTickersByYearInterval has not implemented yet")}function Dn(e){return{t:+pr(e.timestamp,1e3),o:e.open,h:e.high,l:e.low,c:e.close,v:e.volume,q:e.quote}}function Nn(e){return new Date(e*1e3).setSeconds(60,0)/1e3}function Yn(e){return new Date(e*1e3).setMinutes(60,0,0)/1e3}function Ln(e){return new Date(e*1e3).setHours(24,0,0,0)/1e3}export{kn as groupTickersByInterval,Mn as groupTickersByMonthInterval,Pn as groupTickersByYearInterval,Dn as mapCandleToTicker,Ln as roundUpHoursInTimestamp,Yn as roundUpMinutesInTimestamp,Nn as roundUpSecondsInTimestamp};
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
5
|
+
(*!
|
|
6
|
+
* The buffer module from node.js, for the browser.
|
|
7
|
+
*
|
|
8
|
+
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
9
|
+
* @license MIT
|
|
10
|
+
*)
|
|
11
|
+
*/
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function G(){throw new Error("setTimeout has not been defined")}function J(){throw new Error("clearTimeout has not been defined")}var R=G,_=J;typeof globalThis.setTimeout=="function"&&(R=setTimeout);typeof globalThis.clearTimeout=="function"&&(_=clearTimeout);function O(n){if(R===setTimeout)return setTimeout(n,0);if((R===G||!R)&&setTimeout)return R=setTimeout,setTimeout(n,0);try{return R(n,0)}catch{try{return R.call(null,n,0)}catch{return R.call(this,n,0)}}}function lr(n){if(_===clearTimeout)return clearTimeout(n);if((_===J||!_)&&clearTimeout)return _=clearTimeout,clearTimeout(n);try{return _(n)}catch{try{return _.call(null,n)}catch{return _.call(this,n)}}}var y=[],Y=!1,I,S=-1;function pr(){!Y||!I||(Y=!1,I.length?y=I.concat(y):S=-1,y.length&&Q())}function Q(){if(!Y){var n=O(pr);Y=!0;for(var r=y.length;r;){for(I=y,y=[];++S<r;)I&&I[S].run();S=-1,r=y.length}I=null,Y=!1,lr(n)}}function sr(n){var r=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)r[i-1]=arguments[i];y.push(new X(n,r)),y.length===1&&!Y&&O(Q)}function X(n,r){this.fun=n,this.array=r}X.prototype.run=function(){this.fun.apply(null,this.array)};var wr="browser",xr="browser",Er=!0,mr={},Ar=[],gr="",yr={},Tr={},Rr={};function v(){}var _r=v,Ir=v,vr=v,Ur=v,Br=v,dr=v,Yr=v;function Sr(n){throw new Error("process.binding is not supported")}function Pr(){return"/"}function Mr(n){throw new Error("process.chdir is not supported")}function Dr(){return 0}var d=globalThis.performance||{},Cr=d.now||d.mozNow||d.msNow||d.oNow||d.webkitNow||function(){return new Date().getTime()};function kr(n){var r=Cr.call(d)*.001,i=Math.floor(r),e=Math.floor(r%1*1e9);return n&&(i=i-n[0],e=e-n[1],e<0&&(i--,e+=1e9)),[i,e]}var Nr=new Date;function Lr(){var n=new Date,r=n-Nr;return r/1e3}var L={nextTick:sr,title:wr,browser:Er,env:mr,argv:Ar,version:gr,versions:yr,on:_r,addListener:Ir,once:vr,off:Ur,removeListener:Br,removeAllListeners:dr,emit:Yr,binding:Sr,cwd:Pr,chdir:Mr,umask:Dr,hrtime:kr,platform:xr,release:Tr,config:Rr,uptime:Lr},z={};Object.keys(z).forEach(n=>{let r=n.split("."),i=L;for(let e=0;e<r.length;e++){let t=r[e];e===r.length-1?i[t]=z[n]:i=i[t]||(i[t]={})}});var A=[],E=[],Fr=typeof Uint8Array<"u"?Uint8Array:Array,W=!1;function $(){W=!0;for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,i=n.length;r<i;++r)A[r]=n[r],E[n.charCodeAt(r)]=r;E[45]=62,E[95]=63}function Wr(n){W||$();var r,i,e,t,f,u,h=n.length;if(h%4>0)throw new Error("Invalid string. Length must be a multiple of 4");f=n[h-2]==="="?2:n[h-1]==="="?1:0,u=new Fr(h*3/4-f),e=f>0?h-4:h;var a=0;for(r=0,i=0;r<e;r+=4,i+=3)t=E[n.charCodeAt(r)]<<18|E[n.charCodeAt(r+1)]<<12|E[n.charCodeAt(r+2)]<<6|E[n.charCodeAt(r+3)],u[a++]=t>>16&255,u[a++]=t>>8&255,u[a++]=t&255;return f===2?(t=E[n.charCodeAt(r)]<<2|E[n.charCodeAt(r+1)]>>4,u[a++]=t&255):f===1&&(t=E[n.charCodeAt(r)]<<10|E[n.charCodeAt(r+1)]<<4|E[n.charCodeAt(r+2)]>>2,u[a++]=t>>8&255,u[a++]=t&255),u}function Hr(n){return A[n>>18&63]+A[n>>12&63]+A[n>>6&63]+A[n&63]}function Vr(n,r,i){for(var e,t=[],f=r;f<i;f+=3)e=(n[f]<<16)+(n[f+1]<<8)+n[f+2],t.push(Hr(e));return t.join("")}function q(n){W||$();for(var r,i=n.length,e=i%3,t="",f=[],u=16383,h=0,a=i-e;h<a;h+=u)f.push(Vr(n,h,h+u>a?a:h+u));return e===1?(r=n[i-1],t+=A[r>>2],t+=A[r<<4&63],t+="=="):e===2&&(r=(n[i-2]<<8)+n[i-1],t+=A[r>>10],t+=A[r>>4&63],t+=A[r<<2&63],t+="="),f.push(t),f.join("")}o.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function P(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function T(n,r){if(P()<r)throw new RangeError("Invalid typed array length");return o.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(r),n.__proto__=o.prototype):(n===null&&(n=new o(r)),n.length=r),n}function o(n,r,i){if(!o.TYPED_ARRAY_SUPPORT&&!(this instanceof o))return new o(n,r,i);if(typeof n=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return H(this,n)}return b(this,n,r,i)}o.poolSize=8192;o._augment=function(n){return n.__proto__=o.prototype,n};function b(n,r,i,e){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Jr(n,r,i,e):typeof r=="string"?Gr(n,r,i):Or(n,r)}o.from=function(n,r,i){return b(null,n,r,i)};o.kMaxLength=P();o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&o[Symbol.species]);function j(n){if(typeof n!="number")throw new TypeError('"size" argument must be a number');if(n<0)throw new RangeError('"size" argument must not be negative')}function zr(n,r,i,e){return j(r),r<=0?T(n,r):i!==void 0?typeof e=="string"?T(n,r).fill(i,e):T(n,r).fill(i):T(n,r)}o.alloc=function(n,r,i){return zr(null,n,r,i)};function H(n,r){if(j(r),n=T(n,r<0?0:V(r)|0),!o.TYPED_ARRAY_SUPPORT)for(var i=0;i<r;++i)n[i]=0;return n}o.allocUnsafe=function(n){return H(null,n)};o.allocUnsafeSlow=function(n){return H(null,n)};function Gr(n,r,i){if((typeof i!="string"||i==="")&&(i="utf8"),!o.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var e=rr(r,i)|0;n=T(n,e);var t=n.write(r,i);return t!==e&&(n=n.slice(0,t)),n}function F(n,r){var i=r.length<0?0:V(r.length)|0;n=T(n,i);for(var e=0;e<i;e+=1)n[e]=r[e]&255;return n}function Jr(n,r,i,e){if(r.byteLength,i<0||r.byteLength<i)throw new RangeError("'offset' is out of bounds");if(r.byteLength<i+(e||0))throw new RangeError("'length' is out of bounds");return i===void 0&&e===void 0?r=new Uint8Array(r):e===void 0?r=new Uint8Array(r,i):r=new Uint8Array(r,i,e),o.TYPED_ARRAY_SUPPORT?(n=r,n.__proto__=o.prototype):n=F(n,r),n}function Or(n,r){if(g(r)){var i=V(r.length)|0;return n=T(n,i),n.length===0||r.copy(n,0,0,i),n}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||ci(r.length)?T(n,0):F(n,r);if(r.type==="Buffer"&&Array.isArray(r.data))return F(n,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function V(n){if(n>=P())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+P().toString(16)+" bytes");return n|0}o.isBuffer=li;function g(n){return!!(n!=null&&n._isBuffer)}o.compare=function(r,i){if(!g(r)||!g(i))throw new TypeError("Arguments must be Buffers");if(r===i)return 0;for(var e=r.length,t=i.length,f=0,u=Math.min(e,t);f<u;++f)if(r[f]!==i[f]){e=r[f],t=i[f];break}return e<t?-1:t<e?1:0};o.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};o.concat=function(r,i){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return o.alloc(0);var e;if(i===void 0)for(i=0,e=0;e<r.length;++e)i+=r[e].length;var t=o.allocUnsafe(i),f=0;for(e=0;e<r.length;++e){var u=r[e];if(!g(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(t,f),f+=u.length}return t};function rr(n,r){if(g(n))return n.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(n)||n instanceof ArrayBuffer))return n.byteLength;typeof n!="string"&&(n=""+n);var i=n.length;if(i===0)return 0;for(var e=!1;;)switch(r){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return M(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return or(n).length;default:if(e)return M(n).length;r=(""+r).toLowerCase(),e=!0}}o.byteLength=rr;function Qr(n,r,i){var e=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,r>>>=0,i<=r))return"";for(n||(n="utf8");;)switch(n){case"hex":return ni(this,r,i);case"utf8":case"utf-8":return er(this,r,i);case"ascii":return ri(this,r,i);case"latin1":case"binary":return ii(this,r,i);case"base64":return br(this,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ei(this,r,i);default:if(e)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),e=!0}}o.prototype._isBuffer=!0;function U(n,r,i){var e=n[r];n[r]=n[i],n[i]=e}o.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var i=0;i<r;i+=2)U(this,i,i+1);return this};o.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var i=0;i<r;i+=4)U(this,i,i+3),U(this,i+1,i+2);return this};o.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var i=0;i<r;i+=8)U(this,i,i+7),U(this,i+1,i+6),U(this,i+2,i+5),U(this,i+3,i+4);return this};o.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?er(this,0,r):Qr.apply(this,arguments)};o.prototype.equals=function(r){if(!g(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:o.compare(this,r)===0};o.prototype.compare=function(r,i,e,t,f){if(!g(r))throw new TypeError("Argument must be a Buffer");if(i===void 0&&(i=0),e===void 0&&(e=r?r.length:0),t===void 0&&(t=0),f===void 0&&(f=this.length),i<0||e>r.length||t<0||f>this.length)throw new RangeError("out of range index");if(t>=f&&i>=e)return 0;if(t>=f)return-1;if(i>=e)return 1;if(i>>>=0,e>>>=0,t>>>=0,f>>>=0,this===r)return 0;for(var u=f-t,h=e-i,a=Math.min(u,h),l=this.slice(t,f),p=r.slice(i,e),c=0;c<a;++c)if(l[c]!==p[c]){u=l[c],h=p[c];break}return u<h?-1:h<u?1:0};function ir(n,r,i,e,t){if(n.length===0)return-1;if(typeof i=="string"?(e=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=t?0:n.length-1),i<0&&(i=n.length+i),i>=n.length){if(t)return-1;i=n.length-1}else if(i<0)if(t)i=0;else return-1;if(typeof r=="string"&&(r=o.from(r,e)),g(r))return r.length===0?-1:Z(n,r,i,e,t);if(typeof r=="number")return r=r&255,o.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?t?Uint8Array.prototype.indexOf.call(n,r,i):Uint8Array.prototype.lastIndexOf.call(n,r,i):Z(n,[r],i,e,t);throw new TypeError("val must be string, number or Buffer")}function Z(n,r,i,e,t){var f=1,u=n.length,h=r.length;if(e!==void 0&&(e=String(e).toLowerCase(),e==="ucs2"||e==="ucs-2"||e==="utf16le"||e==="utf-16le")){if(n.length<2||r.length<2)return-1;f=2,u/=2,h/=2,i/=2}function a(x,B){return f===1?x[B]:x.readUInt16BE(B*f)}var l;if(t){var p=-1;for(l=i;l<u;l++)if(a(n,l)===a(r,p===-1?0:l-p)){if(p===-1&&(p=l),l-p+1===h)return p*f}else p!==-1&&(l-=l-p),p=-1}else for(i+h>u&&(i=u-h),l=i;l>=0;l--){for(var c=!0,m=0;m<h;m++)if(a(n,l+m)!==a(r,m)){c=!1;break}if(c)return l}return-1}o.prototype.includes=function(r,i,e){return this.indexOf(r,i,e)!==-1};o.prototype.indexOf=function(r,i,e){return ir(this,r,i,e,!0)};o.prototype.lastIndexOf=function(r,i,e){return ir(this,r,i,e,!1)};function Xr(n,r,i,e){i=Number(i)||0;var t=n.length-i;e?(e=Number(e),e>t&&(e=t)):e=t;var f=r.length;if(f%2!==0)throw new TypeError("Invalid hex string");e>f/2&&(e=f/2);for(var u=0;u<e;++u){var h=parseInt(r.substr(u*2,2),16);if(isNaN(h))return u;n[i+u]=h}return u}function qr(n,r,i,e){return k(M(r,n.length-i),n,i,e)}function nr(n,r,i,e){return k(hi(r),n,i,e)}function Zr(n,r,i,e){return nr(n,r,i,e)}function Kr(n,r,i,e){return k(or(r),n,i,e)}function $r(n,r,i,e){return k(ai(r,n.length-i),n,i,e)}o.prototype.write=function(r,i,e,t){if(i===void 0)t="utf8",e=this.length,i=0;else if(e===void 0&&typeof i=="string")t=i,e=this.length,i=0;else if(isFinite(i))i=i|0,isFinite(e)?(e=e|0,t===void 0&&(t="utf8")):(t=e,e=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var f=this.length-i;if((e===void 0||e>f)&&(e=f),r.length>0&&(e<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");t||(t="utf8");for(var u=!1;;)switch(t){case"hex":return Xr(this,r,i,e);case"utf8":case"utf-8":return qr(this,r,i,e);case"ascii":return nr(this,r,i,e);case"latin1":case"binary":return Zr(this,r,i,e);case"base64":return Kr(this,r,i,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $r(this,r,i,e);default:if(u)throw new TypeError("Unknown encoding: "+t);t=(""+t).toLowerCase(),u=!0}};o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function br(n,r,i){return r===0&&i===n.length?q(n):q(n.slice(r,i))}function er(n,r,i){i=Math.min(n.length,i);for(var e=[],t=r;t<i;){var f=n[t],u=null,h=f>239?4:f>223?3:f>191?2:1;if(t+h<=i){var a,l,p,c;switch(h){case 1:f<128&&(u=f);break;case 2:a=n[t+1],(a&192)===128&&(c=(f&31)<<6|a&63,c>127&&(u=c));break;case 3:a=n[t+1],l=n[t+2],(a&192)===128&&(l&192)===128&&(c=(f&15)<<12|(a&63)<<6|l&63,c>2047&&(c<55296||c>57343)&&(u=c));break;case 4:a=n[t+1],l=n[t+2],p=n[t+3],(a&192)===128&&(l&192)===128&&(p&192)===128&&(c=(f&15)<<18|(a&63)<<12|(l&63)<<6|p&63,c>65535&&c<1114112&&(u=c))}}u===null?(u=65533,h=1):u>65535&&(u-=65536,e.push(u>>>10&1023|55296),u=56320|u&1023),e.push(u),t+=h}return jr(e)}var K=4096;function jr(n){var r=n.length;if(r<=K)return String.fromCharCode.apply(String,n);for(var i="",e=0;e<r;)i+=String.fromCharCode.apply(String,n.slice(e,e+=K));return i}function ri(n,r,i){var e="";i=Math.min(n.length,i);for(var t=r;t<i;++t)e+=String.fromCharCode(n[t]&127);return e}function ii(n,r,i){var e="";i=Math.min(n.length,i);for(var t=r;t<i;++t)e+=String.fromCharCode(n[t]);return e}function ni(n,r,i){var e=n.length;(!r||r<0)&&(r=0),(!i||i<0||i>e)&&(i=e);for(var t="",f=r;f<i;++f)t+=oi(n[f]);return t}function ei(n,r,i){for(var e=n.slice(r,i),t="",f=0;f<e.length;f+=2)t+=String.fromCharCode(e[f]+e[f+1]*256);return t}o.prototype.slice=function(r,i){var e=this.length;r=~~r,i=i===void 0?e:~~i,r<0?(r+=e,r<0&&(r=0)):r>e&&(r=e),i<0?(i+=e,i<0&&(i=0)):i>e&&(i=e),i<r&&(i=r);var t;if(o.TYPED_ARRAY_SUPPORT)t=this.subarray(r,i),t.__proto__=o.prototype;else{var f=i-r;t=new o(f,void 0);for(var u=0;u<f;++u)t[u]=this[u+r]}return t};function s(n,r,i){if(n%1!==0||n<0)throw new RangeError("offset is not uint");if(n+r>i)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUIntLE=function(r,i,e){r=r|0,i=i|0,e||s(r,i,this.length);for(var t=this[r],f=1,u=0;++u<i&&(f*=256);)t+=this[r+u]*f;return t};o.prototype.readUIntBE=function(r,i,e){r=r|0,i=i|0,e||s(r,i,this.length);for(var t=this[r+--i],f=1;i>0&&(f*=256);)t+=this[r+--i]*f;return t};o.prototype.readUInt8=function(r,i){return i||s(r,1,this.length),this[r]};o.prototype.readUInt16LE=function(r,i){return i||s(r,2,this.length),this[r]|this[r+1]<<8};o.prototype.readUInt16BE=function(r,i){return i||s(r,2,this.length),this[r]<<8|this[r+1]};o.prototype.readUInt32LE=function(r,i){return i||s(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};o.prototype.readUInt32BE=function(r,i){return i||s(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};o.prototype.readIntLE=function(r,i,e){r=r|0,i=i|0,e||s(r,i,this.length);for(var t=this[r],f=1,u=0;++u<i&&(f*=256);)t+=this[r+u]*f;return f*=128,t>=f&&(t-=Math.pow(2,8*i)),t};o.prototype.readIntBE=function(r,i,e){r=r|0,i=i|0,e||s(r,i,this.length);for(var t=i,f=1,u=this[r+--t];t>0&&(f*=256);)u+=this[r+--t]*f;return f*=128,u>=f&&(u-=Math.pow(2,8*i)),u};o.prototype.readInt8=function(r,i){return i||s(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};o.prototype.readInt16LE=function(r,i){i||s(r,2,this.length);var e=this[r]|this[r+1]<<8;return e&32768?e|4294901760:e};o.prototype.readInt16BE=function(r,i){i||s(r,2,this.length);var e=this[r+1]|this[r]<<8;return e&32768?e|4294901760:e};o.prototype.readInt32LE=function(r,i){return i||s(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};o.prototype.readInt32BE=function(r,i){return i||s(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};o.prototype.readFloatLE=function(r,i){return i||s(r,4,this.length),N(this,r,!0,23,4)};o.prototype.readFloatBE=function(r,i){return i||s(r,4,this.length),N(this,r,!1,23,4)};o.prototype.readDoubleLE=function(r,i){return i||s(r,8,this.length),N(this,r,!0,52,8)};o.prototype.readDoubleBE=function(r,i){return i||s(r,8,this.length),N(this,r,!1,52,8)};function w(n,r,i,e,t,f){if(!g(n))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>t||r<f)throw new RangeError('"value" argument is out of bounds');if(i+e>n.length)throw new RangeError("Index out of range")}o.prototype.writeUIntLE=function(r,i,e,t){if(r=+r,i=i|0,e=e|0,!t){var f=Math.pow(2,8*e)-1;w(this,r,i,e,f,0)}var u=1,h=0;for(this[i]=r&255;++h<e&&(u*=256);)this[i+h]=r/u&255;return i+e};o.prototype.writeUIntBE=function(r,i,e,t){if(r=+r,i=i|0,e=e|0,!t){var f=Math.pow(2,8*e)-1;w(this,r,i,e,f,0)}var u=e-1,h=1;for(this[i+u]=r&255;--u>=0&&(h*=256);)this[i+u]=r/h&255;return i+e};o.prototype.writeUInt8=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,1,255,0),o.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[i]=r&255,i+1};function D(n,r,i,e){r<0&&(r=65535+r+1);for(var t=0,f=Math.min(n.length-i,2);t<f;++t)n[i+t]=(r&255<<8*(e?t:1-t))>>>(e?t:1-t)*8}o.prototype.writeUInt16LE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[i]=r&255,this[i+1]=r>>>8):D(this,r,i,!0),i+2};o.prototype.writeUInt16BE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[i]=r>>>8,this[i+1]=r&255):D(this,r,i,!1),i+2};function C(n,r,i,e){r<0&&(r=4294967295+r+1);for(var t=0,f=Math.min(n.length-i,4);t<f;++t)n[i+t]=r>>>(e?t:3-t)*8&255}o.prototype.writeUInt32LE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[i+3]=r>>>24,this[i+2]=r>>>16,this[i+1]=r>>>8,this[i]=r&255):C(this,r,i,!0),i+4};o.prototype.writeUInt32BE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[i]=r>>>24,this[i+1]=r>>>16,this[i+2]=r>>>8,this[i+3]=r&255):C(this,r,i,!1),i+4};o.prototype.writeIntLE=function(r,i,e,t){if(r=+r,i=i|0,!t){var f=Math.pow(2,8*e-1);w(this,r,i,e,f-1,-f)}var u=0,h=1,a=0;for(this[i]=r&255;++u<e&&(h*=256);)r<0&&a===0&&this[i+u-1]!==0&&(a=1),this[i+u]=(r/h>>0)-a&255;return i+e};o.prototype.writeIntBE=function(r,i,e,t){if(r=+r,i=i|0,!t){var f=Math.pow(2,8*e-1);w(this,r,i,e,f-1,-f)}var u=e-1,h=1,a=0;for(this[i+u]=r&255;--u>=0&&(h*=256);)r<0&&a===0&&this[i+u+1]!==0&&(a=1),this[i+u]=(r/h>>0)-a&255;return i+e};o.prototype.writeInt8=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,1,127,-128),o.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[i]=r&255,i+1};o.prototype.writeInt16LE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[i]=r&255,this[i+1]=r>>>8):D(this,r,i,!0),i+2};o.prototype.writeInt16BE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[i]=r>>>8,this[i+1]=r&255):D(this,r,i,!1),i+2};o.prototype.writeInt32LE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[i]=r&255,this[i+1]=r>>>8,this[i+2]=r>>>16,this[i+3]=r>>>24):C(this,r,i,!0),i+4};o.prototype.writeInt32BE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),o.TYPED_ARRAY_SUPPORT?(this[i]=r>>>24,this[i+1]=r>>>16,this[i+2]=r>>>8,this[i+3]=r&255):C(this,r,i,!1),i+4};function tr(n,r,i,e,t,f){if(i+e>n.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function fr(n,r,i,e,t){return t||tr(n,r,i,4,34028234663852886e22,-34028234663852886e22),ar(n,r,i,e,23,4),i+4}o.prototype.writeFloatLE=function(r,i,e){return fr(this,r,i,!0,e)};o.prototype.writeFloatBE=function(r,i,e){return fr(this,r,i,!1,e)};function ur(n,r,i,e,t){return t||tr(n,r,i,8,17976931348623157e292,-17976931348623157e292),ar(n,r,i,e,52,8),i+8}o.prototype.writeDoubleLE=function(r,i,e){return ur(this,r,i,!0,e)};o.prototype.writeDoubleBE=function(r,i,e){return ur(this,r,i,!1,e)};o.prototype.copy=function(r,i,e,t){if(e||(e=0),!t&&t!==0&&(t=this.length),i>=r.length&&(i=r.length),i||(i=0),t>0&&t<e&&(t=e),t===e||r.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(t<0)throw new RangeError("sourceEnd out of bounds");t>this.length&&(t=this.length),r.length-i<t-e&&(t=r.length-i+e);var f=t-e,u;if(this===r&&e<i&&i<t)for(u=f-1;u>=0;--u)r[u+i]=this[u+e];else if(f<1e3||!o.TYPED_ARRAY_SUPPORT)for(u=0;u<f;++u)r[u+i]=this[u+e];else Uint8Array.prototype.set.call(r,this.subarray(e,e+f),i);return f};o.prototype.fill=function(r,i,e,t){if(typeof r=="string"){if(typeof i=="string"?(t=i,i=0,e=this.length):typeof e=="string"&&(t=e,e=this.length),r.length===1){var f=r.charCodeAt(0);f<256&&(r=f)}if(t!==void 0&&typeof t!="string")throw new TypeError("encoding must be a string");if(typeof t=="string"&&!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t)}else typeof r=="number"&&(r=r&255);if(i<0||this.length<i||this.length<e)throw new RangeError("Out of range index");if(e<=i)return this;i=i>>>0,e=e===void 0?this.length:e>>>0,r||(r=0);var u;if(typeof r=="number")for(u=i;u<e;++u)this[u]=r;else{var h=g(r)?r:M(new o(r,t).toString()),a=h.length;for(u=0;u<e-i;++u)this[u+i]=h[u%a]}return this};var ti=/[^+\/0-9A-Za-z-_]/g;function fi(n){if(n=ui(n).replace(ti,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function ui(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function oi(n){return n<16?"0"+n.toString(16):n.toString(16)}function M(n,r){r=r||1/0;for(var i,e=n.length,t=null,f=[],u=0;u<e;++u){if(i=n.charCodeAt(u),i>55295&&i<57344){if(!t){if(i>56319){(r-=3)>-1&&f.push(239,191,189);continue}else if(u+1===e){(r-=3)>-1&&f.push(239,191,189);continue}t=i;continue}if(i<56320){(r-=3)>-1&&f.push(239,191,189),t=i;continue}i=(t-55296<<10|i-56320)+65536}else t&&(r-=3)>-1&&f.push(239,191,189);if(t=null,i<128){if((r-=1)<0)break;f.push(i)}else if(i<2048){if((r-=2)<0)break;f.push(i>>6|192,i&63|128)}else if(i<65536){if((r-=3)<0)break;f.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((r-=4)<0)break;f.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return f}function hi(n){for(var r=[],i=0;i<n.length;++i)r.push(n.charCodeAt(i)&255);return r}function ai(n,r){for(var i,e,t,f=[],u=0;u<n.length&&!((r-=2)<0);++u)i=n.charCodeAt(u),e=i>>8,t=i%256,f.push(t),f.push(e);return f}function or(n){return Wr(fi(n))}function k(n,r,i,e){for(var t=0;t<e&&!(t+i>=r.length||t>=n.length);++t)r[t+i]=n[t];return t}function ci(n){return n!==n}function li(n){return n!=null&&(!!n._isBuffer||hr(n)||pi(n))}function hr(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function pi(n){return typeof n.readFloatLE=="function"&&typeof n.slice=="function"&&hr(n.slice(0,0))}function N(n,r,i,e,t){var f,u,h=t*8-e-1,a=(1<<h)-1,l=a>>1,p=-7,c=i?t-1:0,m=i?-1:1,x=n[r+c];for(c+=m,f=x&(1<<-p)-1,x>>=-p,p+=h;p>0;f=f*256+n[r+c],c+=m,p-=8);for(u=f&(1<<-p)-1,f>>=-p,p+=e;p>0;u=u*256+n[r+c],c+=m,p-=8);if(f===0)f=1-l;else{if(f===a)return u?NaN:(x?-1:1)*(1/0);u=u+Math.pow(2,e),f=f-l}return(x?-1:1)*u*Math.pow(2,f-e)}function ar(n,r,i,e,t,f){var u,h,a,l=f*8-t-1,p=(1<<l)-1,c=p>>1,m=t===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=e?0:f-1,B=e?1:-1,cr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(h=isNaN(r)?1:0,u=p):(u=Math.floor(Math.log(r)/Math.LN2),r*(a=Math.pow(2,-u))<1&&(u--,a*=2),u+c>=1?r+=m/a:r+=m*Math.pow(2,1-c),r*a>=2&&(u++,a/=2),u+c>=p?(h=0,u=p):u+c>=1?(h=(r*a-1)*Math.pow(2,t),u=u+c):(h=r*Math.pow(2,c-1)*Math.pow(2,t),u=0));t>=8;n[i+x]=h&255,x+=B,h/=256,t-=8);for(u=u<<t|h,l+=t;l>0;n[i+x]=u&255,x+=B,u/=256,l-=8);n[i+x-B]|=cr*128}
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
5
|
+
(*!
|
|
6
|
+
* The buffer module from node.js, for the browser.
|
|
7
|
+
*
|
|
8
|
+
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
9
|
+
* @license MIT
|
|
10
|
+
*)
|
|
11
|
+
*/
|