@ultrade/shared 1.0.17 → 1.0.19
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/index.js +1 -1
- package/dist/browser/common/mappers/index.js +1 -1
- package/dist/browser/common/mappers/trade.mapper.js +1 -1
- package/dist/browser/constants/index.js +1 -1
- package/dist/browser/enums/index.js +1 -1
- package/dist/browser/helpers/assert.helper.js +1 -1
- package/dist/browser/helpers/atomic.helper.js +1 -1
- package/dist/browser/helpers/balance.helper.js +1 -1
- package/dist/browser/helpers/codex/common.helper.js +2 -2
- package/dist/browser/helpers/codex/index.js +2 -2
- package/dist/browser/helpers/codex/mbr.helper.js +1 -1
- package/dist/browser/helpers/codex/mna.helper.js +1 -1
- package/dist/browser/helpers/codex/order.helper.js +1 -1
- package/dist/browser/helpers/codex/setGlobal.helper.js +1 -1
- package/dist/browser/helpers/codex/transfer.helper.js +2 -2
- package/dist/browser/helpers/codex/txn.helper.js +1 -1
- package/dist/browser/helpers/codex.helper.js +6 -6
- package/dist/browser/helpers/eth.helper.js +2 -2
- package/dist/browser/helpers/order.helper.js +1 -1
- package/dist/browser/helpers/pair.helper.js +1 -1
- package/dist/browser/helpers/withdraw.helper.js +2 -2
- package/dist/browser/interfaces/index.js +1 -1
- package/dist/constants/settings.d.ts +2 -0
- package/dist/enums/index.d.ts +1 -0
- package/dist/enums/settings.enum.d.ts +37 -0
- package/dist/interfaces/index.d.ts +1 -0
- package/dist/interfaces/pair.interface.d.ts +13 -0
- package/dist/interfaces/settings.interface.d.ts +25 -0
- package/dist/node/common/index.js +1 -1
- package/dist/node/common/mappers/index.js +1 -1
- package/dist/node/common/mappers/trade.mapper.js +1 -1
- package/dist/node/constants/index.js +1 -1
- package/dist/node/enums/index.js +1 -1
- package/dist/node/helpers/assert.helper.js +1 -1
- package/dist/node/helpers/atomic.helper.js +1 -1
- package/dist/node/helpers/balance.helper.js +1 -1
- package/dist/node/helpers/codex/common.helper.js +2 -2
- package/dist/node/helpers/codex/index.js +2 -2
- package/dist/node/helpers/codex/mbr.helper.js +1 -1
- package/dist/node/helpers/codex/mna.helper.js +1 -1
- package/dist/node/helpers/codex/order.helper.js +1 -1
- package/dist/node/helpers/codex/setGlobal.helper.js +1 -1
- package/dist/node/helpers/codex/transfer.helper.js +2 -2
- package/dist/node/helpers/codex/txn.helper.js +1 -1
- package/dist/node/helpers/codex.helper.js +6 -6
- package/dist/node/helpers/eth.helper.js +2 -2
- package/dist/node/helpers/order.helper.js +1 -1
- package/dist/node/helpers/pair.helper.js +1 -1
- package/dist/node/helpers/withdraw.helper.js +2 -2
- package/dist/node/interfaces/index.js +1 -1
- package/package.json +2 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function q(){throw new Error("setTimeout has not been defined")}function Q(){throw new Error("clearTimeout has not been defined")}var R=q,w=Q;typeof globalThis.setTimeout=="function"&&(R=setTimeout);typeof globalThis.clearTimeout=="function"&&(w=clearTimeout);function X(t){if(R===setTimeout)return setTimeout(t,0);if((R===q||!R)&&setTimeout)return R=setTimeout,setTimeout(t,0);try{return R(t,0)}catch{try{return R.call(null,t,0)}catch{return R.call(this,t,0)}}}function gr(t){if(w===clearTimeout)return clearTimeout(t);if((w===Q||!w)&&clearTimeout)return w=clearTimeout,clearTimeout(t);try{return w(t)}catch{try{return w.call(null,t)}catch{return w.call(this,t)}}}var x=[],D=!1,I,L=-1;function _r(){!D||!I||(D=!1,I.length?x=I.concat(x):L=-1,x.length&&$())}function $(){if(!D){var t=X(_r);D=!0;for(var r=x.length;r;){for(I=x,x=[];++L<r;)I&&I[L].run();L=-1,r=x.length}I=null,D=!1,gr(t)}}function mr(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&&!D&&X($)}function J(t,r){this.fun=t,this.array=r}J.prototype.run=function(){this.fun.apply(null,this.array)};var br="browser",dr="browser",xr=!0,Ar={},Rr=[],wr="",Ir={},Nr={},Sr={};function N(){}var yr=N,Or=N,Dr=N,Lr=N,Cr=N,Pr=N,vr=N;function Ur(t){throw new Error("process.binding is not supported")}function Mr(){return"/"}function Br(t){throw new Error("process.chdir is not supported")}function kr(){return 0}var O=globalThis.performance||{},Yr=O.now||O.mozNow||O.msNow||O.oNow||O.webkitNow||function(){return new Date().getTime()};function Fr(t){var r=Yr.call(O)*.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 Gr=new Date;function Hr(){var t=new Date,r=t-Gr;return r/1e3}var h={nextTick:mr,title:br,browser:xr,env:Ar,argv:Rr,version:wr,versions:Ir,on:yr,addListener:Or,once:Dr,off:Lr,removeListener:Cr,removeAllListeners:Pr,emit:vr,binding:Ur,cwd:Mr,chdir:Br,umask:kr,hrtime:Fr,platform:dr,release:Nr,config:Sr,uptime:Hr},V={};Object.keys(V).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]=V[t]:e=e[i]||(e[i]={})}});var b=[],_=[],Wr=typeof Uint8Array<"u"?Uint8Array:Array,Y=!1;function rr(){Y=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)b[r]=t[r],_[t.charCodeAt(r)]=r;_[45]=62,_[95]=63}function Kr(t){Y||rr();var r,e,n,i,o,a,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=t[c-2]==="="?2:t[c-1]==="="?1:0,a=new Wr(c*3/4-o),n=o>0?c-4:c;var l=0;for(r=0,e=0;r<n;r+=4,e+=3)i=_[t.charCodeAt(r)]<<18|_[t.charCodeAt(r+1)]<<12|_[t.charCodeAt(r+2)]<<6|_[t.charCodeAt(r+3)],a[l++]=i>>16&255,a[l++]=i>>8&255,a[l++]=i&255;return o===2?(i=_[t.charCodeAt(r)]<<2|_[t.charCodeAt(r+1)]>>4,a[l++]=i&255):o===1&&(i=_[t.charCodeAt(r)]<<10|_[t.charCodeAt(r+1)]<<4|_[t.charCodeAt(r+2)]>>2,a[l++]=i>>8&255,a[l++]=i&255),a}function Vr(t){return b[t>>18&63]+b[t>>12&63]+b[t>>6&63]+b[t&63]}function qr(t,r,e){for(var n,i=[],o=r;o<e;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(Vr(n));return i.join("")}function Z(t){Y||rr();for(var r,e=t.length,n=e%3,i="",o=[],a=16383,c=0,l=e-n;c<l;c+=a)o.push(qr(t,c,c+a>l?l:c+a));return n===1?(r=t[e-1],i+=b[r>>2],i+=b[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=b[r>>10],i+=b[r>>4&63],i+=b[r<<2&63],i+="="),o.push(i),o.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 A(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 er(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function er(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?$r(t,r,e,n):typeof r=="string"?Xr(t,r,e):Jr(t,r)}u.from=function(t,r,e){return er(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 tr(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 Qr(t,r,e,n){return tr(r),r<=0?A(t,r):e!==void 0?typeof n=="string"?A(t,r).fill(e,n):A(t,r).fill(e):A(t,r)}u.alloc=function(t,r,e){return Qr(null,t,r,e)};function F(t,r){if(tr(r),t=A(t,r<0?0:G(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 Xr(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=nr(r,e)|0;t=A(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function k(t,r){var e=r.length<0?0:G(r.length)|0;t=A(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function $r(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=k(t,r),t}function Jr(t,r){if(d(r)){var e=G(r.length)|0;return t=A(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"||Te(r.length)?A(t,0):k(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return k(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function G(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=ge;function d(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!d(r)||!d(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,i=e.length,o=0,a=Math.min(n,i);o<a;++o)if(r[o]!==e[o]){n=r[o],i=e[o];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),o=0;for(n=0;n<r.length;++n){var a=r[n];if(!d(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};function nr(t,r){if(d(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 P(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return sr(t).length;default:if(n)return P(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=nr;function Zr(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 ue(this,r,e);case"utf8":case"utf-8":return ar(this,r,e);case"ascii":return oe(this,r,e);case"latin1":case"binary":return ae(this,r,e);case"base64":return ne(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ce(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?ar(this,0,r):Zr.apply(this,arguments)};u.prototype.equals=function(r){if(!d(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,o){if(!d(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),o===void 0&&(o=this.length),e<0||n>r.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=n)return 0;if(i>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,o>>>=0,this===r)return 0;for(var a=o-i,c=n-e,l=Math.min(a,c),f=this.slice(i,o),E=r.slice(e,n),s=0;s<l;++s)if(f[s]!==E[s]){a=f[s],c=E[s];break}return a<c?-1:c<a?1:0};function ir(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)),d(r))return r.length===0?-1:z(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):z(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function z(t,r,e,n,i){var o=1,a=t.length,c=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;o=2,a/=2,c/=2,e/=2}function l(g,y){return o===1?g[y]:g.readUInt16BE(y*o)}var f;if(i){var E=-1;for(f=e;f<a;f++)if(l(t,f)===l(r,E===-1?0:f-E)){if(E===-1&&(E=f),f-E+1===c)return E*o}else E!==-1&&(f-=f-E),E=-1}else for(e+c>a&&(e=a-c),f=e;f>=0;f--){for(var s=!0,m=0;m<c;m++)if(l(t,f+m)!==l(r,m)){s=!1;break}if(s)return f}return-1}u.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};u.prototype.indexOf=function(r,e,n){return ir(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return ir(this,r,e,n,!1)};function zr(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var c=parseInt(r.substr(a*2,2),16);if(isNaN(c))return a;t[e+a]=c}return a}function jr(t,r,e,n){return M(P(r,t.length-e),t,e,n)}function or(t,r,e,n){return M(pe(r),t,e,n)}function re(t,r,e,n){return or(t,r,e,n)}function ee(t,r,e,n){return M(sr(r),t,e,n)}function te(t,r,e,n){return M(he(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 o=this.length-e;if((n===void 0||n>o)&&(n=o),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return zr(this,r,e,n);case"utf8":case"utf-8":return jr(this,r,e,n);case"ascii":return or(this,r,e,n);case"latin1":case"binary":return re(this,r,e,n);case"base64":return ee(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return te(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ne(t,r,e){return r===0&&e===t.length?Z(t):Z(t.slice(r,e))}function ar(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o=t[i],a=null,c=o>239?4:o>223?3:o>191?2:1;if(i+c<=e){var l,f,E,s;switch(c){case 1:o<128&&(a=o);break;case 2:l=t[i+1],(l&192)===128&&(s=(o&31)<<6|l&63,s>127&&(a=s));break;case 3:l=t[i+1],f=t[i+2],(l&192)===128&&(f&192)===128&&(s=(o&15)<<12|(l&63)<<6|f&63,s>2047&&(s<55296||s>57343)&&(a=s));break;case 4:l=t[i+1],f=t[i+2],E=t[i+3],(l&192)===128&&(f&192)===128&&(E&192)===128&&(s=(o&15)<<18|(l&63)<<12|(f&63)<<6|E&63,s>65535&&s<1114112&&(a=s))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=c}return ie(n)}var j=4096;function ie(t){var r=t.length;if(r<=j)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=j));return e}function oe(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 ae(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 ue(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=Ee(t[o]);return i}function ce(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+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 o=e-r;i=new u(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+r]}return i};function p(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||p(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return i};u.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||p(r,e,this.length);for(var i=this[r+--e],o=1;e>0&&(o*=256);)i+=this[r+--e]*o;return i};u.prototype.readUInt8=function(r,e){return e||p(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||p(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||p(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUInt32LE=function(r,e){return e||p(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||p(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||p(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};u.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||p(r,e,this.length);for(var i=e,o=1,a=this[r+--i];i>0&&(o*=256);)a+=this[r+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*e)),a};u.prototype.readInt8=function(r,e){return e||p(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,e){e||p(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||p(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||p(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||p(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||p(r,4,this.length),B(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||p(r,4,this.length),B(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||p(r,8,this.length),B(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||p(r,8,this.length),B(this,r,!1,52,8)};function T(t,r,e,n,i,o){if(!d(t))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(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 o=Math.pow(2,8*n)-1;T(this,r,e,n,o,0)}var a=1,c=0;for(this[e]=r&255;++c<n&&(a*=256);)this[e+c]=r/a&255;return e+n};u.prototype.writeUIntBE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;T(this,r,e,n,o,0)}var a=n-1,c=1;for(this[e+a]=r&255;--a>=0&&(c*=256);)this[e+a]=r/c&255;return e+n};u.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function v(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++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||T(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):v(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):v(this,r,e,!1),e+2};function U(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++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||T(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):U(this,r,e,!0),e+4};u.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(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):U(this,r,e,!1),e+4};u.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);T(this,r,e,n,o-1,-o)}var a=0,c=1,l=0;for(this[e]=r&255;++a<n&&(c*=256);)r<0&&l===0&&this[e+a-1]!==0&&(l=1),this[e+a]=(r/c>>0)-l&255;return e+n};u.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);T(this,r,e,n,o-1,-o)}var a=n-1,c=1,l=0;for(this[e+a]=r&255;--a>=0&&(c*=256);)r<0&&l===0&&this[e+a+1]!==0&&(l=1),this[e+a]=(r/c>>0)-l&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||T(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||T(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):v(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):v(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(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):U(this,r,e,!0),e+4};u.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(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):U(this,r,e,!1),e+4};function ur(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function cr(t,r,e,n,i){return i||ur(t,r,e,4,34028234663852886e22,-34028234663852886e22),Er(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return cr(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return cr(this,r,e,!1,n)};function lr(t,r,e,n,i){return i||ur(t,r,e,8,17976931348623157e292,-17976931348623157e292),Er(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return lr(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return lr(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 o=i-n,a;if(this===r&&n<e&&e<i)for(a=o-1;a>=0;--a)r[a+e]=this[a+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+o),e);return o};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 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"&&!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 a;if(typeof r=="number")for(a=e;a<n;++a)this[a]=r;else{var c=d(r)?r:P(new u(r,i).toString()),l=c.length;for(a=0;a<n-e;++a)this[a+e]=c[a%l]}return this};var le=/[^+\/0-9A-Za-z-_]/g;function se(t){if(t=fe(t).replace(le,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function fe(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Ee(t){return t<16?"0"+t.toString(16):t.toString(16)}function P(t,r){r=r||1/0;for(var e,n=t.length,i=null,o=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function pe(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function he(t,r){for(var e,n,i,o=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function sr(t){return Kr(se(t))}function M(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 Te(t){return t!==t}function ge(t){return t!=null&&(!!t._isBuffer||fr(t)||_e(t))}function fr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function _e(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&fr(t.slice(0,0))}function B(t,r,e,n,i){var o,a,c=i*8-n-1,l=(1<<c)-1,f=l>>1,E=-7,s=e?i-1:0,m=e?-1:1,g=t[r+s];for(s+=m,o=g&(1<<-E)-1,g>>=-E,E+=c;E>0;o=o*256+t[r+s],s+=m,E-=8);for(a=o&(1<<-E)-1,o>>=-E,E+=n;E>0;a=a*256+t[r+s],s+=m,E-=8);if(o===0)o=1-f;else{if(o===l)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-f}return(g?-1:1)*a*Math.pow(2,o-n)}function Er(t,r,e,n,i,o){var a,c,l,f=o*8-i-1,E=(1<<f)-1,s=E>>1,m=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:o-1,y=n?1:-1,Tr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,a=E):(a=Math.floor(Math.log(r)/Math.LN2),r*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+s>=1?r+=m/l:r+=m*Math.pow(2,1-s),r*l>=2&&(a++,l/=2),a+s>=E?(c=0,a=E):a+s>=1?(c=(r*l-1)*Math.pow(2,i),a=a+s):(c=r*Math.pow(2,s-1)*Math.pow(2,i),a=0));i>=8;t[e+g]=c&255,g+=y,c/=256,i-=8);for(a=a<<i|c,f+=i;f>0;t[e+g]=a&255,g+=y,a/=256,f-=8);t[e+g-y]|=Tr*128}import H from"bignumber.js";H.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});function pr(t,r){return hr(t,r,"*")}function W(t,r){return hr(t,r,"/")}function hr(t,r,e){switch(t=new H(String(t)),r=new H(String(r)),e.toLowerCase()){case"-":return t.minus(r).toString();case"+":return t.plus(r).toString();case"*":case"x":return t.multipliedBy(r).toString();case"\xF7":case"/":return t.dividedBy(r).toString();case">=":return t.isGreaterThanOrEqualTo(r);case">":return t.isGreaterThan(r);case"<=":return t.isLessThanOrEqualTo(r);case"<":return t.isLessThan(r);case"==":return t.isEqualTo(r);case"mod":return t.modulo(r);default:break}}var ke={SMALLESTUNIT:h.env.SMALLEST_UNIT},Ye={SMALLEST_UNITS:h.env.SMALLEST_UNIT};var We=`{"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 $e=["point-system.discordEnabled","point-system.telegramBotName","point-system.telegramBotId","point-system.telegramEnabled","point-system.telegramGroupId","point-system.telegramGroupName","point-system.twitterAccountId","point-system.twitterAccountName","point-system.twitterEnabled","point-system.twitterJobEnabled","point-system.guideLink"];var pt=t=>pr(t,10**18),ht=(t,r)=>W(t,10**(18-r)),me=(t,r)=>W(t,10**r),Tt=t=>me(t,18);export{ht as defactorPrice,pt as factorPrice,me as toDecimal,Tt as toDecimalPrice};
|
|
1
|
+
function q(){throw new Error("setTimeout has not been defined")}function Q(){throw new Error("clearTimeout has not been defined")}var R=q,w=Q;typeof globalThis.setTimeout=="function"&&(R=setTimeout);typeof globalThis.clearTimeout=="function"&&(w=clearTimeout);function X(t){if(R===setTimeout)return setTimeout(t,0);if((R===q||!R)&&setTimeout)return R=setTimeout,setTimeout(t,0);try{return R(t,0)}catch{try{return R.call(null,t,0)}catch{return R.call(this,t,0)}}}function gr(t){if(w===clearTimeout)return clearTimeout(t);if((w===Q||!w)&&clearTimeout)return w=clearTimeout,clearTimeout(t);try{return w(t)}catch{try{return w.call(null,t)}catch{return w.call(this,t)}}}var x=[],D=!1,I,L=-1;function _r(){!D||!I||(D=!1,I.length?x=I.concat(x):L=-1,x.length&&J())}function J(){if(!D){var t=X(_r);D=!0;for(var r=x.length;r;){for(I=x,x=[];++L<r;)I&&I[L].run();L=-1,r=x.length}I=null,D=!1,gr(t)}}function br(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 $(t,r)),x.length===1&&!D&&X(J)}function $(t,r){this.fun=t,this.array=r}$.prototype.run=function(){this.fun.apply(null,this.array)};var mr="browser",dr="browser",xr=!0,Ar={},Rr=[],wr="",Ir={},Nr={},Sr={};function N(){}var yr=N,Or=N,Dr=N,Lr=N,Cr=N,Pr=N,vr=N;function Ur(t){throw new Error("process.binding is not supported")}function Mr(){return"/"}function Br(t){throw new Error("process.chdir is not supported")}function kr(){return 0}var O=globalThis.performance||{},Yr=O.now||O.mozNow||O.msNow||O.oNow||O.webkitNow||function(){return new Date().getTime()};function Fr(t){var r=Yr.call(O)*.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 Gr=new Date;function Hr(){var t=new Date,r=t-Gr;return r/1e3}var h={nextTick:br,title:mr,browser:xr,env:Ar,argv:Rr,version:wr,versions:Ir,on:yr,addListener:Or,once:Dr,off:Lr,removeListener:Cr,removeAllListeners:Pr,emit:vr,binding:Ur,cwd:Mr,chdir:Br,umask:kr,hrtime:Fr,platform:dr,release:Nr,config:Sr,uptime:Hr},V={};Object.keys(V).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]=V[t]:e=e[i]||(e[i]={})}});var m=[],_=[],Wr=typeof Uint8Array<"u"?Uint8Array:Array,Y=!1;function rr(){Y=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)m[r]=t[r],_[t.charCodeAt(r)]=r;_[45]=62,_[95]=63}function Kr(t){Y||rr();var r,e,n,i,o,a,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=t[c-2]==="="?2:t[c-1]==="="?1:0,a=new Wr(c*3/4-o),n=o>0?c-4:c;var l=0;for(r=0,e=0;r<n;r+=4,e+=3)i=_[t.charCodeAt(r)]<<18|_[t.charCodeAt(r+1)]<<12|_[t.charCodeAt(r+2)]<<6|_[t.charCodeAt(r+3)],a[l++]=i>>16&255,a[l++]=i>>8&255,a[l++]=i&255;return o===2?(i=_[t.charCodeAt(r)]<<2|_[t.charCodeAt(r+1)]>>4,a[l++]=i&255):o===1&&(i=_[t.charCodeAt(r)]<<10|_[t.charCodeAt(r+1)]<<4|_[t.charCodeAt(r+2)]>>2,a[l++]=i>>8&255,a[l++]=i&255),a}function Vr(t){return m[t>>18&63]+m[t>>12&63]+m[t>>6&63]+m[t&63]}function qr(t,r,e){for(var n,i=[],o=r;o<e;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(Vr(n));return i.join("")}function Z(t){Y||rr();for(var r,e=t.length,n=e%3,i="",o=[],a=16383,c=0,l=e-n;c<l;c+=a)o.push(qr(t,c,c+a>l?l:c+a));return n===1?(r=t[e-1],i+=m[r>>2],i+=m[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=m[r>>10],i+=m[r>>4&63],i+=m[r<<2&63],i+="="),o.push(i),o.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 A(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 er(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function er(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?Jr(t,r,e,n):typeof r=="string"?Xr(t,r,e):$r(t,r)}u.from=function(t,r,e){return er(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 tr(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 Qr(t,r,e,n){return tr(r),r<=0?A(t,r):e!==void 0?typeof n=="string"?A(t,r).fill(e,n):A(t,r).fill(e):A(t,r)}u.alloc=function(t,r,e){return Qr(null,t,r,e)};function F(t,r){if(tr(r),t=A(t,r<0?0:G(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 Xr(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=nr(r,e)|0;t=A(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function k(t,r){var e=r.length<0?0:G(r.length)|0;t=A(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function Jr(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=k(t,r),t}function $r(t,r){if(d(r)){var e=G(r.length)|0;return t=A(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"||Te(r.length)?A(t,0):k(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return k(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function G(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=ge;function d(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!d(r)||!d(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,i=e.length,o=0,a=Math.min(n,i);o<a;++o)if(r[o]!==e[o]){n=r[o],i=e[o];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),o=0;for(n=0;n<r.length;++n){var a=r[n];if(!d(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};function nr(t,r){if(d(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 P(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return sr(t).length;default:if(n)return P(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=nr;function Zr(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 ue(this,r,e);case"utf8":case"utf-8":return ar(this,r,e);case"ascii":return oe(this,r,e);case"latin1":case"binary":return ae(this,r,e);case"base64":return ne(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ce(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?ar(this,0,r):Zr.apply(this,arguments)};u.prototype.equals=function(r){if(!d(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,o){if(!d(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),o===void 0&&(o=this.length),e<0||n>r.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=n)return 0;if(i>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,o>>>=0,this===r)return 0;for(var a=o-i,c=n-e,l=Math.min(a,c),f=this.slice(i,o),E=r.slice(e,n),s=0;s<l;++s)if(f[s]!==E[s]){a=f[s],c=E[s];break}return a<c?-1:c<a?1:0};function ir(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)),d(r))return r.length===0?-1:z(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):z(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function z(t,r,e,n,i){var o=1,a=t.length,c=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;o=2,a/=2,c/=2,e/=2}function l(g,y){return o===1?g[y]:g.readUInt16BE(y*o)}var f;if(i){var E=-1;for(f=e;f<a;f++)if(l(t,f)===l(r,E===-1?0:f-E)){if(E===-1&&(E=f),f-E+1===c)return E*o}else E!==-1&&(f-=f-E),E=-1}else for(e+c>a&&(e=a-c),f=e;f>=0;f--){for(var s=!0,b=0;b<c;b++)if(l(t,f+b)!==l(r,b)){s=!1;break}if(s)return f}return-1}u.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};u.prototype.indexOf=function(r,e,n){return ir(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return ir(this,r,e,n,!1)};function zr(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var c=parseInt(r.substr(a*2,2),16);if(isNaN(c))return a;t[e+a]=c}return a}function jr(t,r,e,n){return M(P(r,t.length-e),t,e,n)}function or(t,r,e,n){return M(pe(r),t,e,n)}function re(t,r,e,n){return or(t,r,e,n)}function ee(t,r,e,n){return M(sr(r),t,e,n)}function te(t,r,e,n){return M(he(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 o=this.length-e;if((n===void 0||n>o)&&(n=o),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return zr(this,r,e,n);case"utf8":case"utf-8":return jr(this,r,e,n);case"ascii":return or(this,r,e,n);case"latin1":case"binary":return re(this,r,e,n);case"base64":return ee(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return te(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ne(t,r,e){return r===0&&e===t.length?Z(t):Z(t.slice(r,e))}function ar(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o=t[i],a=null,c=o>239?4:o>223?3:o>191?2:1;if(i+c<=e){var l,f,E,s;switch(c){case 1:o<128&&(a=o);break;case 2:l=t[i+1],(l&192)===128&&(s=(o&31)<<6|l&63,s>127&&(a=s));break;case 3:l=t[i+1],f=t[i+2],(l&192)===128&&(f&192)===128&&(s=(o&15)<<12|(l&63)<<6|f&63,s>2047&&(s<55296||s>57343)&&(a=s));break;case 4:l=t[i+1],f=t[i+2],E=t[i+3],(l&192)===128&&(f&192)===128&&(E&192)===128&&(s=(o&15)<<18|(l&63)<<12|(f&63)<<6|E&63,s>65535&&s<1114112&&(a=s))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=c}return ie(n)}var j=4096;function ie(t){var r=t.length;if(r<=j)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=j));return e}function oe(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 ae(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 ue(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=Ee(t[o]);return i}function ce(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+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 o=e-r;i=new u(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+r]}return i};function p(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||p(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return i};u.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||p(r,e,this.length);for(var i=this[r+--e],o=1;e>0&&(o*=256);)i+=this[r+--e]*o;return i};u.prototype.readUInt8=function(r,e){return e||p(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||p(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||p(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUInt32LE=function(r,e){return e||p(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||p(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||p(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};u.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||p(r,e,this.length);for(var i=e,o=1,a=this[r+--i];i>0&&(o*=256);)a+=this[r+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*e)),a};u.prototype.readInt8=function(r,e){return e||p(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,e){e||p(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||p(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||p(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||p(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||p(r,4,this.length),B(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||p(r,4,this.length),B(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||p(r,8,this.length),B(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||p(r,8,this.length),B(this,r,!1,52,8)};function T(t,r,e,n,i,o){if(!d(t))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(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 o=Math.pow(2,8*n)-1;T(this,r,e,n,o,0)}var a=1,c=0;for(this[e]=r&255;++c<n&&(a*=256);)this[e+c]=r/a&255;return e+n};u.prototype.writeUIntBE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;T(this,r,e,n,o,0)}var a=n-1,c=1;for(this[e+a]=r&255;--a>=0&&(c*=256);)this[e+a]=r/c&255;return e+n};u.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function v(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++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||T(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):v(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):v(this,r,e,!1),e+2};function U(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++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||T(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):U(this,r,e,!0),e+4};u.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(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):U(this,r,e,!1),e+4};u.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);T(this,r,e,n,o-1,-o)}var a=0,c=1,l=0;for(this[e]=r&255;++a<n&&(c*=256);)r<0&&l===0&&this[e+a-1]!==0&&(l=1),this[e+a]=(r/c>>0)-l&255;return e+n};u.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);T(this,r,e,n,o-1,-o)}var a=n-1,c=1,l=0;for(this[e+a]=r&255;--a>=0&&(c*=256);)r<0&&l===0&&this[e+a+1]!==0&&(l=1),this[e+a]=(r/c>>0)-l&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||T(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||T(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):v(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):v(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(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):U(this,r,e,!0),e+4};u.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(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):U(this,r,e,!1),e+4};function ur(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function cr(t,r,e,n,i){return i||ur(t,r,e,4,34028234663852886e22,-34028234663852886e22),Er(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return cr(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return cr(this,r,e,!1,n)};function lr(t,r,e,n,i){return i||ur(t,r,e,8,17976931348623157e292,-17976931348623157e292),Er(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return lr(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return lr(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 o=i-n,a;if(this===r&&n<e&&e<i)for(a=o-1;a>=0;--a)r[a+e]=this[a+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+o),e);return o};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 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"&&!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 a;if(typeof r=="number")for(a=e;a<n;++a)this[a]=r;else{var c=d(r)?r:P(new u(r,i).toString()),l=c.length;for(a=0;a<n-e;++a)this[a+e]=c[a%l]}return this};var le=/[^+\/0-9A-Za-z-_]/g;function se(t){if(t=fe(t).replace(le,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function fe(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Ee(t){return t<16?"0"+t.toString(16):t.toString(16)}function P(t,r){r=r||1/0;for(var e,n=t.length,i=null,o=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function pe(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function he(t,r){for(var e,n,i,o=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function sr(t){return Kr(se(t))}function M(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 Te(t){return t!==t}function ge(t){return t!=null&&(!!t._isBuffer||fr(t)||_e(t))}function fr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function _e(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&fr(t.slice(0,0))}function B(t,r,e,n,i){var o,a,c=i*8-n-1,l=(1<<c)-1,f=l>>1,E=-7,s=e?i-1:0,b=e?-1:1,g=t[r+s];for(s+=b,o=g&(1<<-E)-1,g>>=-E,E+=c;E>0;o=o*256+t[r+s],s+=b,E-=8);for(a=o&(1<<-E)-1,o>>=-E,E+=n;E>0;a=a*256+t[r+s],s+=b,E-=8);if(o===0)o=1-f;else{if(o===l)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-f}return(g?-1:1)*a*Math.pow(2,o-n)}function Er(t,r,e,n,i,o){var a,c,l,f=o*8-i-1,E=(1<<f)-1,s=E>>1,b=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:o-1,y=n?1:-1,Tr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,a=E):(a=Math.floor(Math.log(r)/Math.LN2),r*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+s>=1?r+=b/l:r+=b*Math.pow(2,1-s),r*l>=2&&(a++,l/=2),a+s>=E?(c=0,a=E):a+s>=1?(c=(r*l-1)*Math.pow(2,i),a=a+s):(c=r*Math.pow(2,s-1)*Math.pow(2,i),a=0));i>=8;t[e+g]=c&255,g+=y,c/=256,i-=8);for(a=a<<i|c,f+=i;f>0;t[e+g]=a&255,g+=y,a/=256,f-=8);t[e+g-y]|=Tr*128}import H from"bignumber.js";H.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});function pr(t,r){return hr(t,r,"*")}function W(t,r){return hr(t,r,"/")}function hr(t,r,e){switch(t=new H(String(t)),r=new H(String(r)),e.toLowerCase()){case"-":return t.minus(r).toString();case"+":return t.plus(r).toString();case"*":case"x":return t.multipliedBy(r).toString();case"\xF7":case"/":return t.dividedBy(r).toString();case">=":return t.isGreaterThanOrEqualTo(r);case">":return t.isGreaterThan(r);case"<=":return t.isLessThanOrEqualTo(r);case"<":return t.isLessThan(r);case"==":return t.isEqualTo(r);case"mod":return t.modulo(r);default:break}}var ke={SMALLESTUNIT:h.env.SMALLEST_UNIT},Ye={SMALLEST_UNITS:h.env.SMALLEST_UNIT};var We=`{"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 Je=["point-system.discordEnabled","point-system.telegramBotName","point-system.telegramBotId","point-system.telegramEnabled","point-system.telegramGroupId","point-system.telegramGroupName","point-system.twitterAccountId","point-system.twitterAccountName","point-system.twitterEnabled","point-system.twitterJobEnabled","point-system.guideLink"];var pt=t=>pr(t,10**18),ht=(t,r)=>W(t,10**(18-r)),be=(t,r)=>W(t,10**r),Tt=t=>be(t,18);export{ht as defactorPrice,pt as factorPrice,be as toDecimal,Tt as toDecimalPrice};
|
|
2
2
|
/*! Bundled license information:
|
|
3
3
|
|
|
4
4
|
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function yr(){throw new Error("setTimeout has not been defined")}function _r(){throw new Error("clearTimeout has not been defined")}var O=yr,k=_r;typeof globalThis.setTimeout=="function"&&(O=setTimeout);typeof globalThis.clearTimeout=="function"&&(k=clearTimeout);function Ir(t){if(O===setTimeout)return setTimeout(t,0);if((O===yr||!O)&&setTimeout)return O=setTimeout,setTimeout(t,0);try{return O(t,0)}catch{try{return O.call(null,t,0)}catch{return O.call(this,t,0)}}}function Ie(t){if(k===clearTimeout)return clearTimeout(t);if((k===_r||!k)&&clearTimeout)return k=clearTimeout,clearTimeout(t);try{return k(t)}catch{try{return k.call(null,t)}catch{return k.call(this,t)}}}var B=[],F=!1,P,H=-1;function we(){!F||!P||(F=!1,P.length?B=P.concat(B):H=-1,B.length&&wr())}function wr(){if(!F){var t=Ir(we);F=!0;for(var r=B.length;r;){for(P=B,B=[];++H<r;)P&&P[H].run();H=-1,r=B.length}P=null,F=!1,Ie(t)}}function Ne(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];B.push(new Nr(t,r)),B.length===1&&!F&&Ir(wr)}function Nr(t,r){this.fun=t,this.array=r}Nr.prototype.run=function(){this.fun.apply(null,this.array)};var Re="browser",Se="browser",Be=!0,Ce={},De=[],Oe="",ke={},Pe={},Ue={};function U(){}var Le=U,Me=U,ve=U,Fe=U,Ye=U,Ge=U,We=U;function Ke(t){throw new Error("process.binding is not supported")}function He(){return"/"}function Ve(t){throw new Error("process.chdir is not supported")}function $e(){return 0}var v=globalThis.performance||{},ze=v.now||v.mozNow||v.msNow||v.oNow||v.webkitNow||function(){return new Date().getTime()};function Xe(t){var r=ze.call(v)*.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 qe=new Date;function Je(){var t=new Date,r=t-qe;return r/1e3}var m={nextTick:Ne,title:Re,browser:Be,env:Ce,argv:De,version:Oe,versions:ke,on:Le,addListener:Me,once:ve,off:Fe,removeListener:Ye,removeAllListeners:Ge,emit:We,binding:Ke,cwd:He,chdir:Ve,umask:$e,hrtime:Xe,platform:Se,release:Pe,config:Ue,uptime:Je},Tr={};Object.keys(Tr).forEach(t=>{let r=t.split("."),e=m;for(let n=0;n<r.length;n++){let o=r[n];n===r.length-1?e[o]=Tr[t]:e=e[o]||(e[o]={})}});var w=[],_=[],je=typeof Uint8Array<"u"?Uint8Array:Array,cr=!1;function Cr(){cr=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)w[r]=t[r],_[t.charCodeAt(r)]=r;_[45]=62,_[95]=63}function Qe(t){cr||Cr();var r,e,n,o,a,i,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=t[c-2]==="="?2:t[c-1]==="="?1:0,i=new je(c*3/4-a),n=a>0?c-4:c;var p=0;for(r=0,e=0;r<n;r+=4,e+=3)o=_[t.charCodeAt(r)]<<18|_[t.charCodeAt(r+1)]<<12|_[t.charCodeAt(r+2)]<<6|_[t.charCodeAt(r+3)],i[p++]=o>>16&255,i[p++]=o>>8&255,i[p++]=o&255;return a===2?(o=_[t.charCodeAt(r)]<<2|_[t.charCodeAt(r+1)]>>4,i[p++]=o&255):a===1&&(o=_[t.charCodeAt(r)]<<10|_[t.charCodeAt(r+1)]<<4|_[t.charCodeAt(r+2)]>>2,i[p++]=o>>8&255,i[p++]=o&255),i}function Ze(t){return w[t>>18&63]+w[t>>12&63]+w[t>>6&63]+w[t&63]}function rt(t,r,e){for(var n,o=[],a=r;a<e;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],o.push(Ze(n));return o.join("")}function Rr(t){cr||Cr();for(var r,e=t.length,n=e%3,o="",a=[],i=16383,c=0,p=e-n;c<p;c+=i)a.push(rt(t,c,c+i>p?p:c+i));return n===1?(r=t[e-1],o+=w[r>>2],o+=w[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=w[r>>10],o+=w[r>>4&63],o+=w[r<<2&63],o+="="),a.push(o),a.join("")}s.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function V(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function C(t,r){if(V()<r)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=s.prototype):(t===null&&(t=new s(r)),t.length=r),t}function s(t,r,e){if(!s.TYPED_ARRAY_SUPPORT&&!(this instanceof s))return new s(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 ur(this,t)}return Dr(this,t,r,e)}s.poolSize=8192;s._augment=function(t){return t.__proto__=s.prototype,t};function Dr(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?nt(t,r,e,n):typeof r=="string"?tt(t,r,e):ot(t,r)}s.from=function(t,r,e){return Dr(null,t,r,e)};s.kMaxLength=V();s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&s[Symbol.species]);function Or(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 et(t,r,e,n){return Or(r),r<=0?C(t,r):e!==void 0?typeof n=="string"?C(t,r).fill(e,n):C(t,r).fill(e):C(t,r)}s.alloc=function(t,r,e){return et(null,t,r,e)};function ur(t,r){if(Or(r),t=C(t,r<0?0:pr(r)|0),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}s.allocUnsafe=function(t){return ur(null,t)};s.allocUnsafeSlow=function(t){return ur(null,t)};function tt(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!s.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=kr(r,e)|0;t=C(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function sr(t,r){var e=r.length<0?0:pr(r.length)|0;t=C(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function nt(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),s.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=s.prototype):t=sr(t,r),t}function ot(t,r){if(N(r)){var e=pr(r.length)|0;return t=C(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"||_t(r.length)?C(t,0):sr(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return sr(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function pr(t){if(t>=V())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+V().toString(16)+" bytes");return t|0}s.isBuffer=It;function N(t){return!!(t!=null&&t._isBuffer)}s.compare=function(r,e){if(!N(r)||!N(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,a=0,i=Math.min(n,o);a<i;++a)if(r[a]!==e[a]){n=r[a],o=e[a];break}return n<o?-1:o<n?1:0};s.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}};s.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return s.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=s.allocUnsafe(e),a=0;for(n=0;n<r.length;++n){var i=r[n];if(!N(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(o,a),a+=i.length}return o};function kr(t,r){if(N(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 $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Yr(t).length;default:if(n)return $(t).length;r=(""+r).toLowerCase(),n=!0}}s.byteLength=kr;function it(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 gt(this,r,e);case"utf8":case"utf-8":return Lr(this,r,e);case"ascii":return dt(this,r,e);case"latin1":case"binary":return ft(this,r,e);case"base64":return lt(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ht(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}s.prototype._isBuffer=!0;function L(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}s.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)L(this,e,e+1);return this};s.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)L(this,e,e+3),L(this,e+1,e+2);return this};s.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)L(this,e,e+7),L(this,e+1,e+6),L(this,e+2,e+5),L(this,e+3,e+4);return this};s.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Lr(this,0,r):it.apply(this,arguments)};s.prototype.equals=function(r){if(!N(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:s.compare(this,r)===0};s.prototype.compare=function(r,e,n,o,a){if(!N(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),o===void 0&&(o=0),a===void 0&&(a=this.length),e<0||n>r.length||o<0||a>this.length)throw new RangeError("out of range index");if(o>=a&&e>=n)return 0;if(o>=a)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,a>>>=0,this===r)return 0;for(var i=a-o,c=n-e,p=Math.min(i,c),f=this.slice(o,a),d=r.slice(e,n),l=0;l<p;++l)if(f[l]!==d[l]){i=f[l],c=d[l];break}return i<c?-1:c<i?1:0};function Pr(t,r,e,n,o){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=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof r=="string"&&(r=s.from(r,n)),N(r))return r.length===0?-1:Sr(t,r,e,n,o);if(typeof r=="number")return r=r&255,s.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Sr(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function Sr(t,r,e,n,o){var a=1,i=t.length,c=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,i/=2,c/=2,e/=2}function p(g,y){return a===1?g[y]:g.readUInt16BE(y*a)}var f;if(o){var d=-1;for(f=e;f<i;f++)if(p(t,f)===p(r,d===-1?0:f-d)){if(d===-1&&(d=f),f-d+1===c)return d*a}else d!==-1&&(f-=f-d),d=-1}else for(e+c>i&&(e=i-c),f=e;f>=0;f--){for(var l=!0,h=0;h<c;h++)if(p(t,f+h)!==p(r,h)){l=!1;break}if(l)return f}return-1}s.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};s.prototype.indexOf=function(r,e,n){return Pr(this,r,e,n,!0)};s.prototype.lastIndexOf=function(r,e,n){return Pr(this,r,e,n,!1)};function at(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var a=r.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var i=0;i<n;++i){var c=parseInt(r.substr(i*2,2),16);if(isNaN(c))return i;t[e+i]=c}return i}function st(t,r,e,n){return q($(r,t.length-e),t,e,n)}function Ur(t,r,e,n){return q(Tt(r),t,e,n)}function ct(t,r,e,n){return Ur(t,r,e,n)}function ut(t,r,e,n){return q(Yr(r),t,e,n)}function pt(t,r,e,n){return q(yt(r,t.length-e),t,e,n)}s.prototype.write=function(r,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=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");o||(o="utf8");for(var i=!1;;)switch(o){case"hex":return at(this,r,e,n);case"utf8":case"utf-8":return st(this,r,e,n);case"ascii":return Ur(this,r,e,n);case"latin1":case"binary":return ct(this,r,e,n);case"base64":return ut(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pt(this,r,e,n);default:if(i)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),i=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function lt(t,r,e){return r===0&&e===t.length?Rr(t):Rr(t.slice(r,e))}function Lr(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var a=t[o],i=null,c=a>239?4:a>223?3:a>191?2:1;if(o+c<=e){var p,f,d,l;switch(c){case 1:a<128&&(i=a);break;case 2:p=t[o+1],(p&192)===128&&(l=(a&31)<<6|p&63,l>127&&(i=l));break;case 3:p=t[o+1],f=t[o+2],(p&192)===128&&(f&192)===128&&(l=(a&15)<<12|(p&63)<<6|f&63,l>2047&&(l<55296||l>57343)&&(i=l));break;case 4:p=t[o+1],f=t[o+2],d=t[o+3],(p&192)===128&&(f&192)===128&&(d&192)===128&&(l=(a&15)<<18|(p&63)<<12|(f&63)<<6|d&63,l>65535&&l<1114112&&(i=l))}}i===null?(i=65533,c=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|i&1023),n.push(i),o+=c}return mt(n)}var Br=4096;function mt(t){var r=t.length;if(r<=Br)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=Br));return e}function dt(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]&127);return n}function ft(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function gt(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",a=r;a<e;++a)o+=At(t[a]);return o}function ht(t,r,e){for(var n=t.slice(r,e),o="",a=0;a<n.length;a+=2)o+=String.fromCharCode(n[a]+n[a+1]*256);return o}s.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 o;if(s.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=s.prototype;else{var a=e-r;o=new s(a,void 0);for(var i=0;i<a;++i)o[i]=this[i+r]}return o};function x(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")}s.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||x(r,e,this.length);for(var o=this[r],a=1,i=0;++i<e&&(a*=256);)o+=this[r+i]*a;return o};s.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||x(r,e,this.length);for(var o=this[r+--e],a=1;e>0&&(a*=256);)o+=this[r+--e]*a;return o};s.prototype.readUInt8=function(r,e){return e||x(r,1,this.length),this[r]};s.prototype.readUInt16LE=function(r,e){return e||x(r,2,this.length),this[r]|this[r+1]<<8};s.prototype.readUInt16BE=function(r,e){return e||x(r,2,this.length),this[r]<<8|this[r+1]};s.prototype.readUInt32LE=function(r,e){return e||x(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};s.prototype.readUInt32BE=function(r,e){return e||x(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};s.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||x(r,e,this.length);for(var o=this[r],a=1,i=0;++i<e&&(a*=256);)o+=this[r+i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*e)),o};s.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||x(r,e,this.length);for(var o=e,a=1,i=this[r+--o];o>0&&(a*=256);)i+=this[r+--o]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*e)),i};s.prototype.readInt8=function(r,e){return e||x(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};s.prototype.readInt16LE=function(r,e){e||x(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};s.prototype.readInt16BE=function(r,e){e||x(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};s.prototype.readInt32LE=function(r,e){return e||x(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};s.prototype.readInt32BE=function(r,e){return e||x(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};s.prototype.readFloatLE=function(r,e){return e||x(r,4,this.length),J(this,r,!0,23,4)};s.prototype.readFloatBE=function(r,e){return e||x(r,4,this.length),J(this,r,!1,23,4)};s.prototype.readDoubleLE=function(r,e){return e||x(r,8,this.length),J(this,r,!0,52,8)};s.prototype.readDoubleBE=function(r,e){return e||x(r,8,this.length),J(this,r,!1,52,8)};function A(t,r,e,n,o,a){if(!N(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<a)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}s.prototype.writeUIntLE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;A(this,r,e,n,a,0)}var i=1,c=0;for(this[e]=r&255;++c<n&&(i*=256);)this[e+c]=r/i&255;return e+n};s.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;A(this,r,e,n,a,0)}var i=n-1,c=1;for(this[e+i]=r&255;--i>=0&&(c*=256);)this[e+i]=r/c&255;return e+n};s.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function z(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,a=Math.min(t.length-e,2);o<a;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}s.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):z(this,r,e,!0),e+2};s.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):z(this,r,e,!1),e+2};function X(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,a=Math.min(t.length-e,4);o<a;++o)t[e+o]=r>>>(n?o:3-o)*8&255}s.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):X(this,r,e,!0),e+4};s.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):X(this,r,e,!1),e+4};s.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);A(this,r,e,n,a-1,-a)}var i=0,c=1,p=0;for(this[e]=r&255;++i<n&&(c*=256);)r<0&&p===0&&this[e+i-1]!==0&&(p=1),this[e+i]=(r/c>>0)-p&255;return e+n};s.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);A(this,r,e,n,a-1,-a)}var i=n-1,c=1,p=0;for(this[e+i]=r&255;--i>=0&&(c*=256);)r<0&&p===0&&this[e+i+1]!==0&&(p=1),this[e+i]=(r/c>>0)-p&255;return e+n};s.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};s.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):z(this,r,e,!0),e+2};s.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):z(this,r,e,!1),e+2};s.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):X(this,r,e,!0),e+4};s.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):X(this,r,e,!1),e+4};function Mr(t,r,e,n,o,a){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function vr(t,r,e,n,o){return o||Mr(t,r,e,4,34028234663852886e22,-34028234663852886e22),Wr(t,r,e,n,23,4),e+4}s.prototype.writeFloatLE=function(r,e,n){return vr(this,r,e,!0,n)};s.prototype.writeFloatBE=function(r,e,n){return vr(this,r,e,!1,n)};function Fr(t,r,e,n,o){return o||Mr(t,r,e,8,17976931348623157e292,-17976931348623157e292),Wr(t,r,e,n,52,8),e+8}s.prototype.writeDoubleLE=function(r,e,n){return Fr(this,r,e,!0,n)};s.prototype.writeDoubleBE=function(r,e,n){return Fr(this,r,e,!1,n)};s.prototype.copy=function(r,e,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),e>=r.length&&(e=r.length),e||(e=0),o>0&&o<n&&(o=n),o===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(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),r.length-e<o-n&&(o=r.length-e+n);var a=o-n,i;if(this===r&&n<e&&e<o)for(i=a-1;i>=0;--i)r[i+e]=this[i+n];else if(a<1e3||!s.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)r[i+e]=this[i+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+a),e);return a};s.prototype.fill=function(r,e,n,o){if(typeof r=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),r.length===1){var a=r.charCodeAt(0);a<256&&(r=a)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!s.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}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 i;if(typeof r=="number")for(i=e;i<n;++i)this[i]=r;else{var c=N(r)?r:$(new s(r,o).toString()),p=c.length;for(i=0;i<n-e;++i)this[i+e]=c[i%p]}return this};var xt=/[^+\/0-9A-Za-z-_]/g;function bt(t){if(t=Et(t).replace(xt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Et(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function At(t){return t<16?"0"+t.toString(16):t.toString(16)}function $(t,r){r=r||1/0;for(var e,n=t.length,o=null,a=[],i=0;i<n;++i){if(e=t.charCodeAt(i),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&a.push(239,191,189);continue}else if(i+1===n){(r-=3)>-1&&a.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&a.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&a.push(239,191,189);if(o=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 Tt(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function yt(t,r){for(var e,n,o,a=[],i=0;i<t.length&&!((r-=2)<0);++i)e=t.charCodeAt(i),n=e>>8,o=e%256,a.push(o),a.push(n);return a}function Yr(t){return Qe(bt(t))}function q(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function _t(t){return t!==t}function It(t){return t!=null&&(!!t._isBuffer||Gr(t)||wt(t))}function Gr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function wt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Gr(t.slice(0,0))}function J(t,r,e,n,o){var a,i,c=o*8-n-1,p=(1<<c)-1,f=p>>1,d=-7,l=e?o-1:0,h=e?-1:1,g=t[r+l];for(l+=h,a=g&(1<<-d)-1,g>>=-d,d+=c;d>0;a=a*256+t[r+l],l+=h,d-=8);for(i=a&(1<<-d)-1,a>>=-d,d+=n;d>0;i=i*256+t[r+l],l+=h,d-=8);if(a===0)a=1-f;else{if(a===p)return i?NaN:(g?-1:1)*(1/0);i=i+Math.pow(2,n),a=a-f}return(g?-1:1)*i*Math.pow(2,a-n)}function Wr(t,r,e,n,o,a){var i,c,p,f=a*8-o-1,d=(1<<f)-1,l=d>>1,h=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:a-1,y=n?1:-1,ar=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,i=d):(i=Math.floor(Math.log(r)/Math.LN2),r*(p=Math.pow(2,-i))<1&&(i--,p*=2),i+l>=1?r+=h/p:r+=h*Math.pow(2,1-l),r*p>=2&&(i++,p/=2),i+l>=d?(c=0,i=d):i+l>=1?(c=(r*p-1)*Math.pow(2,o),i=i+l):(c=r*Math.pow(2,l-1)*Math.pow(2,o),i=0));o>=8;t[e+g]=c&255,g+=y,c/=256,o-=8);for(i=i<<o|c,f+=o;f>0;t[e+g]=i&255,g+=y,i/=256,f-=8);t[e+g-y]|=ar*128}import lr from"bignumber.js";lr.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});function mr(t,r){return Kr(t,r,"*")}function G(t,r){return Kr(t,r,"/")}function Kr(t,r,e){switch(t=new lr(String(t)),r=new lr(String(r)),e.toLowerCase()){case"-":return t.minus(r).toString();case"+":return t.plus(r).toString();case"*":case"x":return t.multipliedBy(r).toString();case"\xF7":case"/":return t.dividedBy(r).toString();case">=":return t.isGreaterThanOrEqualTo(r);case">":return t.isGreaterThan(r);case"<=":return t.isLessThanOrEqualTo(r);case"<":return t.isLessThan(r);case"==":return t.isEqualTo(r);case"mod":return t.modulo(r);default:break}}var Hr=(e=>(e[e.Buy=0]="Buy",e[e.Sell=1]="Sell",e))(Hr||{}),W=Hr;var Vr=(o=>(o[o.Limit=0]="Limit",o[o.IOC=1]="IOC",o[o.POST=2]="POST",o[o.Market=3]="Market",o))(Vr||{}),j=Vr;var $r=(o=>(o.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",o.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",o.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",o.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",o))($r||{}),zr=(n=>(n.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",n.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",n.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",n))(zr||{}),Uo={...$r,...zr};var dr={"0x4343545055534443000000000000000000000000000000000000000000000000":65537};var Hi={SMALLESTUNIT:m.env.SMALLEST_UNIT},Vi={SMALLEST_UNITS:m.env.SMALLEST_UNIT};var qi=`{"theme1":{"value":"${m.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${m.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${m.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var ra=["point-system.discordEnabled","point-system.telegramBotName","point-system.telegramBotId","point-system.telegramEnabled","point-system.telegramGroupId","point-system.telegramGroupName","point-system.twitterAccountId","point-system.twitterAccountName","point-system.twitterEnabled","point-system.twitterJobEnabled","point-system.guideLink"];var fr=(t,r)=>G(t,10**(18-r)),Xr=(t,r)=>G(t,10**r);import ye from"algosdk";import*as En from"bs58";import zs from"algosdk";import*as be from"bs58";import cn from"algosdk";import Ba,{decodeAddress as Ca,encodeAddress as Da}from"algosdk";var R=[],I=[],St=typeof Uint8Array<"u"?Uint8Array:Array,hr=!1;function Qr(){hr=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)R[r]=t[r],I[t.charCodeAt(r)]=r;I[45]=62,I[95]=63}function Bt(t){hr||Qr();var r,e,n,o,a,i,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=t[c-2]==="="?2:t[c-1]==="="?1:0,i=new St(c*3/4-a),n=a>0?c-4:c;var p=0;for(r=0,e=0;r<n;r+=4,e+=3)o=I[t.charCodeAt(r)]<<18|I[t.charCodeAt(r+1)]<<12|I[t.charCodeAt(r+2)]<<6|I[t.charCodeAt(r+3)],i[p++]=o>>16&255,i[p++]=o>>8&255,i[p++]=o&255;return a===2?(o=I[t.charCodeAt(r)]<<2|I[t.charCodeAt(r+1)]>>4,i[p++]=o&255):a===1&&(o=I[t.charCodeAt(r)]<<10|I[t.charCodeAt(r+1)]<<4|I[t.charCodeAt(r+2)]>>2,i[p++]=o>>8&255,i[p++]=o&255),i}function Ct(t){return R[t>>18&63]+R[t>>12&63]+R[t>>6&63]+R[t&63]}function Dt(t,r,e){for(var n,o=[],a=r;a<e;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],o.push(Ct(n));return o.join("")}function qr(t){hr||Qr();for(var r,e=t.length,n=e%3,o="",a=[],i=16383,c=0,p=e-n;c<p;c+=i)a.push(Dt(t,c,c+i>p?p:c+i));return n===1?(r=t[e-1],o+=R[r>>2],o+=R[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=R[r>>10],o+=R[r>>4&63],o+=R[r<<2&63],o+="="),a.push(o),a.join("")}function rr(t,r,e,n,o){var a,i,c=o*8-n-1,p=(1<<c)-1,f=p>>1,d=-7,l=e?o-1:0,h=e?-1:1,g=t[r+l];for(l+=h,a=g&(1<<-d)-1,g>>=-d,d+=c;d>0;a=a*256+t[r+l],l+=h,d-=8);for(i=a&(1<<-d)-1,a>>=-d,d+=n;d>0;i=i*256+t[r+l],l+=h,d-=8);if(a===0)a=1-f;else{if(a===p)return i?NaN:(g?-1:1)*(1/0);i=i+Math.pow(2,n),a=a-f}return(g?-1:1)*i*Math.pow(2,a-n)}function Zr(t,r,e,n,o,a){var i,c,p,f=a*8-o-1,d=(1<<f)-1,l=d>>1,h=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:a-1,y=n?1:-1,ar=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,i=d):(i=Math.floor(Math.log(r)/Math.LN2),r*(p=Math.pow(2,-i))<1&&(i--,p*=2),i+l>=1?r+=h/p:r+=h*Math.pow(2,1-l),r*p>=2&&(i++,p/=2),i+l>=d?(c=0,i=d):i+l>=1?(c=(r*p-1)*Math.pow(2,o),i=i+l):(c=r*Math.pow(2,l-1)*Math.pow(2,o),i=0));o>=8;t[e+g]=c&255,g+=y,c/=256,o-=8);for(i=i<<o|c,f+=o;f>0;t[e+g]=i&255,g+=y,i/=256,f-=8);t[e+g-y]|=ar*128}var Ot={}.toString,re=Array.isArray||function(t){return Ot.call(t)=="[object Array]"};var kt=50;u.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;var Ia=Q();function Q(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function D(t,r){if(Q()<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 xr(this,t)}return ee(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function ee(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?Lt(t,r,e,n):typeof r=="string"?Ut(t,r,e):Mt(t,r)}u.from=function(t,r,e){return ee(null,t,r,e)};u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array);function te(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 Pt(t,r,e,n){return te(r),r<=0?D(t,r):e!==void 0?typeof n=="string"?D(t,r).fill(e,n):D(t,r).fill(e):D(t,r)}u.alloc=function(t,r,e){return Pt(null,t,r,e)};function xr(t,r){if(te(r),t=D(t,r<0?0:br(r)|0),!u.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}u.allocUnsafe=function(t){return xr(null,t)};u.allocUnsafeSlow=function(t){return xr(null,t)};function Ut(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=ne(r,e)|0;t=D(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function gr(t,r){var e=r.length<0?0:br(r.length)|0;t=D(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function Lt(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=gr(t,r),t}function Mt(t,r){if(S(r)){var e=br(r.length)|0;return t=D(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"||tn(r.length)?D(t,0):gr(t,r);if(r.type==="Buffer"&&re(r.data))return gr(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function br(t){if(t>=Q())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Q().toString(16)+" bytes");return t|0}u.isBuffer=nn;function S(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!S(r)||!S(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,a=0,i=Math.min(n,o);a<i;++a)if(r[a]!==e[a]){n=r[a],o=e[a];break}return n<o?-1:o<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(!re(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 o=u.allocUnsafe(e),a=0;for(n=0;n<r.length;++n){var i=r[n];if(!S(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(o,a),a+=i.length}return o};function ne(t,r){if(S(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 Z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return pe(t).length;default:if(n)return Z(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=ne;function vt(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 Xt(this,r,e);case"utf8":case"utf-8":return ae(this,r,e);case"ascii":return $t(this,r,e);case"latin1":case"binary":return zt(this,r,e);case"base64":return Ht(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return qt(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function M(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)M(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)M(this,e,e+3),M(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)M(this,e,e+7),M(this,e+1,e+6),M(this,e+2,e+5),M(this,e+3,e+4);return this};u.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?ae(this,0,r):vt.apply(this,arguments)};u.prototype.equals=function(r){if(!S(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:u.compare(this,r)===0};u.prototype.inspect=function(){var r="",e=kt;return this.length>0&&(r=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(r+=" ... ")),"<Buffer "+r+">"};u.prototype.compare=function(r,e,n,o,a){if(!S(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),o===void 0&&(o=0),a===void 0&&(a=this.length),e<0||n>r.length||o<0||a>this.length)throw new RangeError("out of range index");if(o>=a&&e>=n)return 0;if(o>=a)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,a>>>=0,this===r)return 0;for(var i=a-o,c=n-e,p=Math.min(i,c),f=this.slice(o,a),d=r.slice(e,n),l=0;l<p;++l)if(f[l]!==d[l]){i=f[l],c=d[l];break}return i<c?-1:c<i?1:0};function oe(t,r,e,n,o){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=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof r=="string"&&(r=u.from(r,n)),S(r))return r.length===0?-1:Jr(t,r,e,n,o);if(typeof r=="number")return r=r&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Jr(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function Jr(t,r,e,n,o){var a=1,i=t.length,c=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,i/=2,c/=2,e/=2}function p(g,y){return a===1?g[y]:g.readUInt16BE(y*a)}var f;if(o){var d=-1;for(f=e;f<i;f++)if(p(t,f)===p(r,d===-1?0:f-d)){if(d===-1&&(d=f),f-d+1===c)return d*a}else d!==-1&&(f-=f-d),d=-1}else for(e+c>i&&(e=i-c),f=e;f>=0;f--){for(var l=!0,h=0;h<c;h++)if(p(t,f+h)!==p(r,h)){l=!1;break}if(l)return f}return-1}u.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};u.prototype.indexOf=function(r,e,n){return oe(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return oe(this,r,e,n,!1)};function Ft(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var a=r.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var i=0;i<n;++i){var c=parseInt(r.substr(i*2,2),16);if(isNaN(c))return i;t[e+i]=c}return i}function Yt(t,r,e,n){return nr(Z(r,t.length-e),t,e,n)}function ie(t,r,e,n){return nr(rn(r),t,e,n)}function Gt(t,r,e,n){return ie(t,r,e,n)}function Wt(t,r,e,n){return nr(pe(r),t,e,n)}function Kt(t,r,e,n){return nr(en(r,t.length-e),t,e,n)}u.prototype.write=function(r,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=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");o||(o="utf8");for(var i=!1;;)switch(o){case"hex":return Ft(this,r,e,n);case"utf8":case"utf-8":return Yt(this,r,e,n);case"ascii":return ie(this,r,e,n);case"latin1":case"binary":return Gt(this,r,e,n);case"base64":return Wt(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Kt(this,r,e,n);default:if(i)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),i=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ht(t,r,e){return r===0&&e===t.length?qr(t):qr(t.slice(r,e))}function ae(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var a=t[o],i=null,c=a>239?4:a>223?3:a>191?2:1;if(o+c<=e){var p,f,d,l;switch(c){case 1:a<128&&(i=a);break;case 2:p=t[o+1],(p&192)===128&&(l=(a&31)<<6|p&63,l>127&&(i=l));break;case 3:p=t[o+1],f=t[o+2],(p&192)===128&&(f&192)===128&&(l=(a&15)<<12|(p&63)<<6|f&63,l>2047&&(l<55296||l>57343)&&(i=l));break;case 4:p=t[o+1],f=t[o+2],d=t[o+3],(p&192)===128&&(f&192)===128&&(d&192)===128&&(l=(a&15)<<18|(p&63)<<12|(f&63)<<6|d&63,l>65535&&l<1114112&&(i=l))}}i===null?(i=65533,c=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|i&1023),n.push(i),o+=c}return Vt(n)}var jr=4096;function Vt(t){var r=t.length;if(r<=jr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=jr));return e}function $t(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]&127);return n}function zt(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function Xt(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",a=r;a<e;++a)o+=Zt(t[a]);return o}function qt(t,r,e){for(var n=t.slice(r,e),o="",a=0;a<n.length;a+=2)o+=String.fromCharCode(n[a]+n[a+1]*256);return o}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 o;if(u.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=u.prototype;else{var a=e-r;o=new u(a,void 0);for(var i=0;i<a;++i)o[i]=this[i+r]}return o};function b(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||b(r,e,this.length);for(var o=this[r],a=1,i=0;++i<e&&(a*=256);)o+=this[r+i]*a;return o};u.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var o=this[r+--e],a=1;e>0&&(a*=256);)o+=this[r+--e]*a;return o};u.prototype.readUInt8=function(r,e){return e||b(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||b(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||b(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUInt32LE=function(r,e){return e||b(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||b(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||b(r,e,this.length);for(var o=this[r],a=1,i=0;++i<e&&(a*=256);)o+=this[r+i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*e)),o};u.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var o=e,a=1,i=this[r+--o];o>0&&(a*=256);)i+=this[r+--o]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*e)),i};u.prototype.readInt8=function(r,e){return e||b(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,e){e||b(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||b(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||b(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||b(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||b(r,4,this.length),rr(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||b(r,4,this.length),rr(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||b(r,8,this.length),rr(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||b(r,8,this.length),rr(this,r,!1,52,8)};function T(t,r,e,n,o,a){if(!S(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||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,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;T(this,r,e,n,a,0)}var i=1,c=0;for(this[e]=r&255;++c<n&&(i*=256);)this[e+c]=r/i&255;return e+n};u.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;T(this,r,e,n,a,0)}var i=n-1,c=1;for(this[e+i]=r&255;--i>=0&&(c*=256);)this[e+i]=r/c&255;return e+n};u.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function er(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,a=Math.min(t.length-e,2);o<a;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}u.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):er(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):er(this,r,e,!1),e+2};function tr(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,a=Math.min(t.length-e,4);o<a;++o)t[e+o]=r>>>(n?o:3-o)*8&255}u.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(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):tr(this,r,e,!0),e+4};u.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(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):tr(this,r,e,!1),e+4};u.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);T(this,r,e,n,a-1,-a)}var i=0,c=1,p=0;for(this[e]=r&255;++i<n&&(c*=256);)r<0&&p===0&&this[e+i-1]!==0&&(p=1),this[e+i]=(r/c>>0)-p&255;return e+n};u.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);T(this,r,e,n,a-1,-a)}var i=n-1,c=1,p=0;for(this[e+i]=r&255;--i>=0&&(c*=256);)r<0&&p===0&&this[e+i+1]!==0&&(p=1),this[e+i]=(r/c>>0)-p&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||T(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||T(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):er(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):er(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(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):tr(this,r,e,!0),e+4};u.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(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):tr(this,r,e,!1),e+4};function se(t,r,e,n,o,a){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function ce(t,r,e,n,o){return o||se(t,r,e,4),Zr(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return ce(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return ce(this,r,e,!1,n)};function ue(t,r,e,n,o){return o||se(t,r,e,8),Zr(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return ue(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return ue(this,r,e,!1,n)};u.prototype.copy=function(r,e,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),e>=r.length&&(e=r.length),e||(e=0),o>0&&o<n&&(o=n),o===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(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),r.length-e<o-n&&(o=r.length-e+n);var a=o-n,i;if(this===r&&n<e&&e<o)for(i=a-1;i>=0;--i)r[i+e]=this[i+n];else if(a<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)r[i+e]=this[i+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+a),e);return a};u.prototype.fill=function(r,e,n,o){if(typeof r=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),r.length===1){var a=r.charCodeAt(0);a<256&&(r=a)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!u.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}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 i;if(typeof r=="number")for(i=e;i<n;++i)this[i]=r;else{var c=S(r)?r:Z(new u(r,o).toString()),p=c.length;for(i=0;i<n-e;++i)this[i+e]=c[i%p]}return this};var Jt=/[^+\/0-9A-Za-z-_]/g;function jt(t){if(t=Qt(t).replace(Jt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Qt(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Zt(t){return t<16?"0"+t.toString(16):t.toString(16)}function Z(t,r){r=r||1/0;for(var e,n=t.length,o=null,a=[],i=0;i<n;++i){if(e=t.charCodeAt(i),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&a.push(239,191,189);continue}else if(i+1===n){(r-=3)>-1&&a.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&a.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&a.push(239,191,189);if(o=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 rn(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function en(t,r){for(var e,n,o,a=[],i=0;i<t.length&&!((r-=2)<0);++i)e=t.charCodeAt(i),n=e>>8,o=e%256,a.push(o),a.push(n);return a}function pe(t){return Bt(jt(t))}function nr(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function tn(t){return t!==t}function nn(t){return t!=null&&(!!t._isBuffer||le(t)||on(t))}function le(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function on(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&le(t.slice(0,0))}import{encodeAddress as an,decodeAddress as Ma}from"algosdk";function Y(t){return t.reduce((r,e)=>Uint8Array.from([...r,...e]))}var me={V1_1:"v1_1",V2:"v2"},Qa={[me.V1_1]:{testnet:62368684,mainnet:552635992},[me.V2]:{testnet:148607e3,mainnet:1002541853}};var de=t=>cn.decodeAddress(t.toUpperCase()).publicKey;import*as E from"ethereumjs-util";function pn(t){return E.toUnsigned(new E.BN(String(t)))}function fe(t){let r=pn(t);if(r.length>32)throw new Error("Invalid value. The buffer length of the value is more than 32");return new Uint8Array(E.setLengthLeft(r,32))}var ge=t=>new Uint8Array(E.setLengthLeft(or(t),32)),or=t=>s.from(ln(t),"hex"),ln=t=>t.startsWith("0x")?t.slice(2):t;var Er=t=>new Uint8Array(E.keccak256(s.from(t)));var Ar=(t,r)=>r===8?de(t):r===1?be.decode(t):ge(t);import nc from"algosdk";import mc from"algosdk";import Ac from"algosdk";import Cc from"algosdk";import $c from"algosdk";var An=(t,r)=>r===8?fe(+t):dr[t]?new Uint8Array(or(String(t))):Ar(String(t),r);var _e=(t,r)=>{let e=Te(t.address,t.chainId,r.address,r.chainId);return s.from(Er(e)).toString("hex")},Te=(t,r,e,n)=>{let o=Ar(t,r),a=ye.encodeUint64(r),i=ye.encodeUint64(n),c=An(e,n);return Y([o,a,c,i])};var zu=(t,{userId:r,chainId:e,price:n,side:o,type:a,amount:i,total:c,id:p})=>{let{baseAsset:f,priceAsset:d}=t,l={address:r,chainId:e},h=o===W.Buy?d:f;return{action:"order",actionId:p,account:l,token:h,amount:o===W.Buy?a===j.Market?fr(c,d.decimal):mr(Xr(i,f.decimal),fr(n,d.decimal)):i,ts:Date.now()}},Xu=(t,r,e,n="0")=>({hash:_e(t,r),loginAddress:t.address,loginChainId:t.chainId,tokenId:r.address,tokenChainId:r.chainId,amount:e,lockedAmount:n});export{zu as mapToBalanceInfo,Xu as mapToCodexBalance};
|
|
1
|
+
function yr(){throw new Error("setTimeout has not been defined")}function _r(){throw new Error("clearTimeout has not been defined")}var O=yr,k=_r;typeof globalThis.setTimeout=="function"&&(O=setTimeout);typeof globalThis.clearTimeout=="function"&&(k=clearTimeout);function Ir(t){if(O===setTimeout)return setTimeout(t,0);if((O===yr||!O)&&setTimeout)return O=setTimeout,setTimeout(t,0);try{return O(t,0)}catch{try{return O.call(null,t,0)}catch{return O.call(this,t,0)}}}function Ie(t){if(k===clearTimeout)return clearTimeout(t);if((k===_r||!k)&&clearTimeout)return k=clearTimeout,clearTimeout(t);try{return k(t)}catch{try{return k.call(null,t)}catch{return k.call(this,t)}}}var B=[],F=!1,P,H=-1;function we(){!F||!P||(F=!1,P.length?B=P.concat(B):H=-1,B.length&&wr())}function wr(){if(!F){var t=Ir(we);F=!0;for(var r=B.length;r;){for(P=B,B=[];++H<r;)P&&P[H].run();H=-1,r=B.length}P=null,F=!1,Ie(t)}}function Ne(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];B.push(new Nr(t,r)),B.length===1&&!F&&Ir(wr)}function Nr(t,r){this.fun=t,this.array=r}Nr.prototype.run=function(){this.fun.apply(null,this.array)};var Re="browser",Se="browser",Be=!0,De={},Ce=[],Oe="",ke={},Pe={},Ue={};function U(){}var Le=U,Me=U,ve=U,Fe=U,Ye=U,Ge=U,We=U;function Ke(t){throw new Error("process.binding is not supported")}function He(){return"/"}function Ve(t){throw new Error("process.chdir is not supported")}function $e(){return 0}var v=globalThis.performance||{},ze=v.now||v.mozNow||v.msNow||v.oNow||v.webkitNow||function(){return new Date().getTime()};function Xe(t){var r=ze.call(v)*.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 qe=new Date;function Je(){var t=new Date,r=t-qe;return r/1e3}var m={nextTick:Ne,title:Re,browser:Be,env:De,argv:Ce,version:Oe,versions:ke,on:Le,addListener:Me,once:ve,off:Fe,removeListener:Ye,removeAllListeners:Ge,emit:We,binding:Ke,cwd:He,chdir:Ve,umask:$e,hrtime:Xe,platform:Se,release:Pe,config:Ue,uptime:Je},Tr={};Object.keys(Tr).forEach(t=>{let r=t.split("."),e=m;for(let n=0;n<r.length;n++){let o=r[n];n===r.length-1?e[o]=Tr[t]:e=e[o]||(e[o]={})}});var w=[],_=[],je=typeof Uint8Array<"u"?Uint8Array:Array,cr=!1;function Dr(){cr=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)w[r]=t[r],_[t.charCodeAt(r)]=r;_[45]=62,_[95]=63}function Qe(t){cr||Dr();var r,e,n,o,a,i,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=t[c-2]==="="?2:t[c-1]==="="?1:0,i=new je(c*3/4-a),n=a>0?c-4:c;var p=0;for(r=0,e=0;r<n;r+=4,e+=3)o=_[t.charCodeAt(r)]<<18|_[t.charCodeAt(r+1)]<<12|_[t.charCodeAt(r+2)]<<6|_[t.charCodeAt(r+3)],i[p++]=o>>16&255,i[p++]=o>>8&255,i[p++]=o&255;return a===2?(o=_[t.charCodeAt(r)]<<2|_[t.charCodeAt(r+1)]>>4,i[p++]=o&255):a===1&&(o=_[t.charCodeAt(r)]<<10|_[t.charCodeAt(r+1)]<<4|_[t.charCodeAt(r+2)]>>2,i[p++]=o>>8&255,i[p++]=o&255),i}function Ze(t){return w[t>>18&63]+w[t>>12&63]+w[t>>6&63]+w[t&63]}function rt(t,r,e){for(var n,o=[],a=r;a<e;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],o.push(Ze(n));return o.join("")}function Rr(t){cr||Dr();for(var r,e=t.length,n=e%3,o="",a=[],i=16383,c=0,p=e-n;c<p;c+=i)a.push(rt(t,c,c+i>p?p:c+i));return n===1?(r=t[e-1],o+=w[r>>2],o+=w[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=w[r>>10],o+=w[r>>4&63],o+=w[r<<2&63],o+="="),a.push(o),a.join("")}s.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function V(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function D(t,r){if(V()<r)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=s.prototype):(t===null&&(t=new s(r)),t.length=r),t}function s(t,r,e){if(!s.TYPED_ARRAY_SUPPORT&&!(this instanceof s))return new s(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 ur(this,t)}return Cr(this,t,r,e)}s.poolSize=8192;s._augment=function(t){return t.__proto__=s.prototype,t};function Cr(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?nt(t,r,e,n):typeof r=="string"?tt(t,r,e):ot(t,r)}s.from=function(t,r,e){return Cr(null,t,r,e)};s.kMaxLength=V();s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&s[Symbol.species]);function Or(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 et(t,r,e,n){return Or(r),r<=0?D(t,r):e!==void 0?typeof n=="string"?D(t,r).fill(e,n):D(t,r).fill(e):D(t,r)}s.alloc=function(t,r,e){return et(null,t,r,e)};function ur(t,r){if(Or(r),t=D(t,r<0?0:pr(r)|0),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}s.allocUnsafe=function(t){return ur(null,t)};s.allocUnsafeSlow=function(t){return ur(null,t)};function tt(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!s.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=kr(r,e)|0;t=D(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function sr(t,r){var e=r.length<0?0:pr(r.length)|0;t=D(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function nt(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),s.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=s.prototype):t=sr(t,r),t}function ot(t,r){if(N(r)){var e=pr(r.length)|0;return t=D(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"||_t(r.length)?D(t,0):sr(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return sr(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function pr(t){if(t>=V())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+V().toString(16)+" bytes");return t|0}s.isBuffer=It;function N(t){return!!(t!=null&&t._isBuffer)}s.compare=function(r,e){if(!N(r)||!N(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,a=0,i=Math.min(n,o);a<i;++a)if(r[a]!==e[a]){n=r[a],o=e[a];break}return n<o?-1:o<n?1:0};s.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}};s.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return s.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=s.allocUnsafe(e),a=0;for(n=0;n<r.length;++n){var i=r[n];if(!N(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(o,a),a+=i.length}return o};function kr(t,r){if(N(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 $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Yr(t).length;default:if(n)return $(t).length;r=(""+r).toLowerCase(),n=!0}}s.byteLength=kr;function it(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 gt(this,r,e);case"utf8":case"utf-8":return Lr(this,r,e);case"ascii":return dt(this,r,e);case"latin1":case"binary":return ft(this,r,e);case"base64":return lt(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ht(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}s.prototype._isBuffer=!0;function L(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}s.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)L(this,e,e+1);return this};s.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)L(this,e,e+3),L(this,e+1,e+2);return this};s.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)L(this,e,e+7),L(this,e+1,e+6),L(this,e+2,e+5),L(this,e+3,e+4);return this};s.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Lr(this,0,r):it.apply(this,arguments)};s.prototype.equals=function(r){if(!N(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:s.compare(this,r)===0};s.prototype.compare=function(r,e,n,o,a){if(!N(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),o===void 0&&(o=0),a===void 0&&(a=this.length),e<0||n>r.length||o<0||a>this.length)throw new RangeError("out of range index");if(o>=a&&e>=n)return 0;if(o>=a)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,a>>>=0,this===r)return 0;for(var i=a-o,c=n-e,p=Math.min(i,c),f=this.slice(o,a),d=r.slice(e,n),l=0;l<p;++l)if(f[l]!==d[l]){i=f[l],c=d[l];break}return i<c?-1:c<i?1:0};function Pr(t,r,e,n,o){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=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof r=="string"&&(r=s.from(r,n)),N(r))return r.length===0?-1:Sr(t,r,e,n,o);if(typeof r=="number")return r=r&255,s.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Sr(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function Sr(t,r,e,n,o){var a=1,i=t.length,c=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,i/=2,c/=2,e/=2}function p(g,y){return a===1?g[y]:g.readUInt16BE(y*a)}var f;if(o){var d=-1;for(f=e;f<i;f++)if(p(t,f)===p(r,d===-1?0:f-d)){if(d===-1&&(d=f),f-d+1===c)return d*a}else d!==-1&&(f-=f-d),d=-1}else for(e+c>i&&(e=i-c),f=e;f>=0;f--){for(var l=!0,h=0;h<c;h++)if(p(t,f+h)!==p(r,h)){l=!1;break}if(l)return f}return-1}s.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};s.prototype.indexOf=function(r,e,n){return Pr(this,r,e,n,!0)};s.prototype.lastIndexOf=function(r,e,n){return Pr(this,r,e,n,!1)};function at(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var a=r.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var i=0;i<n;++i){var c=parseInt(r.substr(i*2,2),16);if(isNaN(c))return i;t[e+i]=c}return i}function st(t,r,e,n){return q($(r,t.length-e),t,e,n)}function Ur(t,r,e,n){return q(Tt(r),t,e,n)}function ct(t,r,e,n){return Ur(t,r,e,n)}function ut(t,r,e,n){return q(Yr(r),t,e,n)}function pt(t,r,e,n){return q(yt(r,t.length-e),t,e,n)}s.prototype.write=function(r,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=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");o||(o="utf8");for(var i=!1;;)switch(o){case"hex":return at(this,r,e,n);case"utf8":case"utf-8":return st(this,r,e,n);case"ascii":return Ur(this,r,e,n);case"latin1":case"binary":return ct(this,r,e,n);case"base64":return ut(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pt(this,r,e,n);default:if(i)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),i=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function lt(t,r,e){return r===0&&e===t.length?Rr(t):Rr(t.slice(r,e))}function Lr(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var a=t[o],i=null,c=a>239?4:a>223?3:a>191?2:1;if(o+c<=e){var p,f,d,l;switch(c){case 1:a<128&&(i=a);break;case 2:p=t[o+1],(p&192)===128&&(l=(a&31)<<6|p&63,l>127&&(i=l));break;case 3:p=t[o+1],f=t[o+2],(p&192)===128&&(f&192)===128&&(l=(a&15)<<12|(p&63)<<6|f&63,l>2047&&(l<55296||l>57343)&&(i=l));break;case 4:p=t[o+1],f=t[o+2],d=t[o+3],(p&192)===128&&(f&192)===128&&(d&192)===128&&(l=(a&15)<<18|(p&63)<<12|(f&63)<<6|d&63,l>65535&&l<1114112&&(i=l))}}i===null?(i=65533,c=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|i&1023),n.push(i),o+=c}return mt(n)}var Br=4096;function mt(t){var r=t.length;if(r<=Br)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=Br));return e}function dt(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]&127);return n}function ft(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function gt(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",a=r;a<e;++a)o+=At(t[a]);return o}function ht(t,r,e){for(var n=t.slice(r,e),o="",a=0;a<n.length;a+=2)o+=String.fromCharCode(n[a]+n[a+1]*256);return o}s.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 o;if(s.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=s.prototype;else{var a=e-r;o=new s(a,void 0);for(var i=0;i<a;++i)o[i]=this[i+r]}return o};function x(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")}s.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||x(r,e,this.length);for(var o=this[r],a=1,i=0;++i<e&&(a*=256);)o+=this[r+i]*a;return o};s.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||x(r,e,this.length);for(var o=this[r+--e],a=1;e>0&&(a*=256);)o+=this[r+--e]*a;return o};s.prototype.readUInt8=function(r,e){return e||x(r,1,this.length),this[r]};s.prototype.readUInt16LE=function(r,e){return e||x(r,2,this.length),this[r]|this[r+1]<<8};s.prototype.readUInt16BE=function(r,e){return e||x(r,2,this.length),this[r]<<8|this[r+1]};s.prototype.readUInt32LE=function(r,e){return e||x(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};s.prototype.readUInt32BE=function(r,e){return e||x(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};s.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||x(r,e,this.length);for(var o=this[r],a=1,i=0;++i<e&&(a*=256);)o+=this[r+i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*e)),o};s.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||x(r,e,this.length);for(var o=e,a=1,i=this[r+--o];o>0&&(a*=256);)i+=this[r+--o]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*e)),i};s.prototype.readInt8=function(r,e){return e||x(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};s.prototype.readInt16LE=function(r,e){e||x(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};s.prototype.readInt16BE=function(r,e){e||x(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};s.prototype.readInt32LE=function(r,e){return e||x(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};s.prototype.readInt32BE=function(r,e){return e||x(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};s.prototype.readFloatLE=function(r,e){return e||x(r,4,this.length),J(this,r,!0,23,4)};s.prototype.readFloatBE=function(r,e){return e||x(r,4,this.length),J(this,r,!1,23,4)};s.prototype.readDoubleLE=function(r,e){return e||x(r,8,this.length),J(this,r,!0,52,8)};s.prototype.readDoubleBE=function(r,e){return e||x(r,8,this.length),J(this,r,!1,52,8)};function A(t,r,e,n,o,a){if(!N(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<a)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}s.prototype.writeUIntLE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;A(this,r,e,n,a,0)}var i=1,c=0;for(this[e]=r&255;++c<n&&(i*=256);)this[e+c]=r/i&255;return e+n};s.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;A(this,r,e,n,a,0)}var i=n-1,c=1;for(this[e+i]=r&255;--i>=0&&(c*=256);)this[e+i]=r/c&255;return e+n};s.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function z(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,a=Math.min(t.length-e,2);o<a;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}s.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):z(this,r,e,!0),e+2};s.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):z(this,r,e,!1),e+2};function X(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,a=Math.min(t.length-e,4);o<a;++o)t[e+o]=r>>>(n?o:3-o)*8&255}s.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):X(this,r,e,!0),e+4};s.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):X(this,r,e,!1),e+4};s.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);A(this,r,e,n,a-1,-a)}var i=0,c=1,p=0;for(this[e]=r&255;++i<n&&(c*=256);)r<0&&p===0&&this[e+i-1]!==0&&(p=1),this[e+i]=(r/c>>0)-p&255;return e+n};s.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);A(this,r,e,n,a-1,-a)}var i=n-1,c=1,p=0;for(this[e+i]=r&255;--i>=0&&(c*=256);)r<0&&p===0&&this[e+i+1]!==0&&(p=1),this[e+i]=(r/c>>0)-p&255;return e+n};s.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};s.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):z(this,r,e,!0),e+2};s.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):z(this,r,e,!1),e+2};s.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):X(this,r,e,!0),e+4};s.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):X(this,r,e,!1),e+4};function Mr(t,r,e,n,o,a){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function vr(t,r,e,n,o){return o||Mr(t,r,e,4,34028234663852886e22,-34028234663852886e22),Wr(t,r,e,n,23,4),e+4}s.prototype.writeFloatLE=function(r,e,n){return vr(this,r,e,!0,n)};s.prototype.writeFloatBE=function(r,e,n){return vr(this,r,e,!1,n)};function Fr(t,r,e,n,o){return o||Mr(t,r,e,8,17976931348623157e292,-17976931348623157e292),Wr(t,r,e,n,52,8),e+8}s.prototype.writeDoubleLE=function(r,e,n){return Fr(this,r,e,!0,n)};s.prototype.writeDoubleBE=function(r,e,n){return Fr(this,r,e,!1,n)};s.prototype.copy=function(r,e,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),e>=r.length&&(e=r.length),e||(e=0),o>0&&o<n&&(o=n),o===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(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),r.length-e<o-n&&(o=r.length-e+n);var a=o-n,i;if(this===r&&n<e&&e<o)for(i=a-1;i>=0;--i)r[i+e]=this[i+n];else if(a<1e3||!s.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)r[i+e]=this[i+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+a),e);return a};s.prototype.fill=function(r,e,n,o){if(typeof r=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),r.length===1){var a=r.charCodeAt(0);a<256&&(r=a)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!s.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}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 i;if(typeof r=="number")for(i=e;i<n;++i)this[i]=r;else{var c=N(r)?r:$(new s(r,o).toString()),p=c.length;for(i=0;i<n-e;++i)this[i+e]=c[i%p]}return this};var xt=/[^+\/0-9A-Za-z-_]/g;function bt(t){if(t=Et(t).replace(xt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Et(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function At(t){return t<16?"0"+t.toString(16):t.toString(16)}function $(t,r){r=r||1/0;for(var e,n=t.length,o=null,a=[],i=0;i<n;++i){if(e=t.charCodeAt(i),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&a.push(239,191,189);continue}else if(i+1===n){(r-=3)>-1&&a.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&a.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&a.push(239,191,189);if(o=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 Tt(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function yt(t,r){for(var e,n,o,a=[],i=0;i<t.length&&!((r-=2)<0);++i)e=t.charCodeAt(i),n=e>>8,o=e%256,a.push(o),a.push(n);return a}function Yr(t){return Qe(bt(t))}function q(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function _t(t){return t!==t}function It(t){return t!=null&&(!!t._isBuffer||Gr(t)||wt(t))}function Gr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function wt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Gr(t.slice(0,0))}function J(t,r,e,n,o){var a,i,c=o*8-n-1,p=(1<<c)-1,f=p>>1,d=-7,l=e?o-1:0,h=e?-1:1,g=t[r+l];for(l+=h,a=g&(1<<-d)-1,g>>=-d,d+=c;d>0;a=a*256+t[r+l],l+=h,d-=8);for(i=a&(1<<-d)-1,a>>=-d,d+=n;d>0;i=i*256+t[r+l],l+=h,d-=8);if(a===0)a=1-f;else{if(a===p)return i?NaN:(g?-1:1)*(1/0);i=i+Math.pow(2,n),a=a-f}return(g?-1:1)*i*Math.pow(2,a-n)}function Wr(t,r,e,n,o,a){var i,c,p,f=a*8-o-1,d=(1<<f)-1,l=d>>1,h=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:a-1,y=n?1:-1,ar=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,i=d):(i=Math.floor(Math.log(r)/Math.LN2),r*(p=Math.pow(2,-i))<1&&(i--,p*=2),i+l>=1?r+=h/p:r+=h*Math.pow(2,1-l),r*p>=2&&(i++,p/=2),i+l>=d?(c=0,i=d):i+l>=1?(c=(r*p-1)*Math.pow(2,o),i=i+l):(c=r*Math.pow(2,l-1)*Math.pow(2,o),i=0));o>=8;t[e+g]=c&255,g+=y,c/=256,o-=8);for(i=i<<o|c,f+=o;f>0;t[e+g]=i&255,g+=y,i/=256,f-=8);t[e+g-y]|=ar*128}import lr from"bignumber.js";lr.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});function mr(t,r){return Kr(t,r,"*")}function G(t,r){return Kr(t,r,"/")}function Kr(t,r,e){switch(t=new lr(String(t)),r=new lr(String(r)),e.toLowerCase()){case"-":return t.minus(r).toString();case"+":return t.plus(r).toString();case"*":case"x":return t.multipliedBy(r).toString();case"\xF7":case"/":return t.dividedBy(r).toString();case">=":return t.isGreaterThanOrEqualTo(r);case">":return t.isGreaterThan(r);case"<=":return t.isLessThanOrEqualTo(r);case"<":return t.isLessThan(r);case"==":return t.isEqualTo(r);case"mod":return t.modulo(r);default:break}}var Hr=(e=>(e[e.Buy=0]="Buy",e[e.Sell=1]="Sell",e))(Hr||{}),W=Hr;var Vr=(o=>(o[o.Limit=0]="Limit",o[o.IOC=1]="IOC",o[o.POST=2]="POST",o[o.Market=3]="Market",o))(Vr||{}),j=Vr;var $r=(o=>(o.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",o.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",o.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",o.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",o))($r||{}),zr=(n=>(n.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",n.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",n.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",n))(zr||{}),Uo={...$r,...zr};var dr={"0x4343545055534443000000000000000000000000000000000000000000000000":65537};var Xi={SMALLESTUNIT:m.env.SMALLEST_UNIT},qi={SMALLEST_UNITS:m.env.SMALLEST_UNIT};var Zi=`{"theme1":{"value":"${m.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${m.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${m.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var oa=["point-system.discordEnabled","point-system.telegramBotName","point-system.telegramBotId","point-system.telegramEnabled","point-system.telegramGroupId","point-system.telegramGroupName","point-system.twitterAccountId","point-system.twitterAccountName","point-system.twitterEnabled","point-system.twitterJobEnabled","point-system.guideLink"];var fr=(t,r)=>G(t,10**(18-r)),Xr=(t,r)=>G(t,10**r);import ye from"algosdk";import*as En from"bs58";import js from"algosdk";import*as be from"bs58";import cn from"algosdk";import ka,{decodeAddress as Pa,encodeAddress as Ua}from"algosdk";var R=[],I=[],St=typeof Uint8Array<"u"?Uint8Array:Array,hr=!1;function Qr(){hr=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)R[r]=t[r],I[t.charCodeAt(r)]=r;I[45]=62,I[95]=63}function Bt(t){hr||Qr();var r,e,n,o,a,i,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=t[c-2]==="="?2:t[c-1]==="="?1:0,i=new St(c*3/4-a),n=a>0?c-4:c;var p=0;for(r=0,e=0;r<n;r+=4,e+=3)o=I[t.charCodeAt(r)]<<18|I[t.charCodeAt(r+1)]<<12|I[t.charCodeAt(r+2)]<<6|I[t.charCodeAt(r+3)],i[p++]=o>>16&255,i[p++]=o>>8&255,i[p++]=o&255;return a===2?(o=I[t.charCodeAt(r)]<<2|I[t.charCodeAt(r+1)]>>4,i[p++]=o&255):a===1&&(o=I[t.charCodeAt(r)]<<10|I[t.charCodeAt(r+1)]<<4|I[t.charCodeAt(r+2)]>>2,i[p++]=o>>8&255,i[p++]=o&255),i}function Dt(t){return R[t>>18&63]+R[t>>12&63]+R[t>>6&63]+R[t&63]}function Ct(t,r,e){for(var n,o=[],a=r;a<e;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],o.push(Dt(n));return o.join("")}function qr(t){hr||Qr();for(var r,e=t.length,n=e%3,o="",a=[],i=16383,c=0,p=e-n;c<p;c+=i)a.push(Ct(t,c,c+i>p?p:c+i));return n===1?(r=t[e-1],o+=R[r>>2],o+=R[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=R[r>>10],o+=R[r>>4&63],o+=R[r<<2&63],o+="="),a.push(o),a.join("")}function rr(t,r,e,n,o){var a,i,c=o*8-n-1,p=(1<<c)-1,f=p>>1,d=-7,l=e?o-1:0,h=e?-1:1,g=t[r+l];for(l+=h,a=g&(1<<-d)-1,g>>=-d,d+=c;d>0;a=a*256+t[r+l],l+=h,d-=8);for(i=a&(1<<-d)-1,a>>=-d,d+=n;d>0;i=i*256+t[r+l],l+=h,d-=8);if(a===0)a=1-f;else{if(a===p)return i?NaN:(g?-1:1)*(1/0);i=i+Math.pow(2,n),a=a-f}return(g?-1:1)*i*Math.pow(2,a-n)}function Zr(t,r,e,n,o,a){var i,c,p,f=a*8-o-1,d=(1<<f)-1,l=d>>1,h=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:a-1,y=n?1:-1,ar=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,i=d):(i=Math.floor(Math.log(r)/Math.LN2),r*(p=Math.pow(2,-i))<1&&(i--,p*=2),i+l>=1?r+=h/p:r+=h*Math.pow(2,1-l),r*p>=2&&(i++,p/=2),i+l>=d?(c=0,i=d):i+l>=1?(c=(r*p-1)*Math.pow(2,o),i=i+l):(c=r*Math.pow(2,l-1)*Math.pow(2,o),i=0));o>=8;t[e+g]=c&255,g+=y,c/=256,o-=8);for(i=i<<o|c,f+=o;f>0;t[e+g]=i&255,g+=y,i/=256,f-=8);t[e+g-y]|=ar*128}var Ot={}.toString,re=Array.isArray||function(t){return Ot.call(t)=="[object Array]"};var kt=50;u.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;var Sa=Q();function Q(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function C(t,r){if(Q()<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 xr(this,t)}return ee(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function ee(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?Lt(t,r,e,n):typeof r=="string"?Ut(t,r,e):Mt(t,r)}u.from=function(t,r,e){return ee(null,t,r,e)};u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array);function te(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 Pt(t,r,e,n){return te(r),r<=0?C(t,r):e!==void 0?typeof n=="string"?C(t,r).fill(e,n):C(t,r).fill(e):C(t,r)}u.alloc=function(t,r,e){return Pt(null,t,r,e)};function xr(t,r){if(te(r),t=C(t,r<0?0:br(r)|0),!u.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}u.allocUnsafe=function(t){return xr(null,t)};u.allocUnsafeSlow=function(t){return xr(null,t)};function Ut(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=ne(r,e)|0;t=C(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function gr(t,r){var e=r.length<0?0:br(r.length)|0;t=C(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function Lt(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=gr(t,r),t}function Mt(t,r){if(S(r)){var e=br(r.length)|0;return t=C(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"||tn(r.length)?C(t,0):gr(t,r);if(r.type==="Buffer"&&re(r.data))return gr(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function br(t){if(t>=Q())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Q().toString(16)+" bytes");return t|0}u.isBuffer=nn;function S(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!S(r)||!S(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,a=0,i=Math.min(n,o);a<i;++a)if(r[a]!==e[a]){n=r[a],o=e[a];break}return n<o?-1:o<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(!re(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 o=u.allocUnsafe(e),a=0;for(n=0;n<r.length;++n){var i=r[n];if(!S(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(o,a),a+=i.length}return o};function ne(t,r){if(S(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 Z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return pe(t).length;default:if(n)return Z(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=ne;function vt(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 Xt(this,r,e);case"utf8":case"utf-8":return ae(this,r,e);case"ascii":return $t(this,r,e);case"latin1":case"binary":return zt(this,r,e);case"base64":return Ht(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return qt(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function M(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)M(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)M(this,e,e+3),M(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)M(this,e,e+7),M(this,e+1,e+6),M(this,e+2,e+5),M(this,e+3,e+4);return this};u.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?ae(this,0,r):vt.apply(this,arguments)};u.prototype.equals=function(r){if(!S(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:u.compare(this,r)===0};u.prototype.inspect=function(){var r="",e=kt;return this.length>0&&(r=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(r+=" ... ")),"<Buffer "+r+">"};u.prototype.compare=function(r,e,n,o,a){if(!S(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),o===void 0&&(o=0),a===void 0&&(a=this.length),e<0||n>r.length||o<0||a>this.length)throw new RangeError("out of range index");if(o>=a&&e>=n)return 0;if(o>=a)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,a>>>=0,this===r)return 0;for(var i=a-o,c=n-e,p=Math.min(i,c),f=this.slice(o,a),d=r.slice(e,n),l=0;l<p;++l)if(f[l]!==d[l]){i=f[l],c=d[l];break}return i<c?-1:c<i?1:0};function oe(t,r,e,n,o){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=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof r=="string"&&(r=u.from(r,n)),S(r))return r.length===0?-1:Jr(t,r,e,n,o);if(typeof r=="number")return r=r&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Jr(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function Jr(t,r,e,n,o){var a=1,i=t.length,c=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,i/=2,c/=2,e/=2}function p(g,y){return a===1?g[y]:g.readUInt16BE(y*a)}var f;if(o){var d=-1;for(f=e;f<i;f++)if(p(t,f)===p(r,d===-1?0:f-d)){if(d===-1&&(d=f),f-d+1===c)return d*a}else d!==-1&&(f-=f-d),d=-1}else for(e+c>i&&(e=i-c),f=e;f>=0;f--){for(var l=!0,h=0;h<c;h++)if(p(t,f+h)!==p(r,h)){l=!1;break}if(l)return f}return-1}u.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};u.prototype.indexOf=function(r,e,n){return oe(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return oe(this,r,e,n,!1)};function Ft(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var a=r.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var i=0;i<n;++i){var c=parseInt(r.substr(i*2,2),16);if(isNaN(c))return i;t[e+i]=c}return i}function Yt(t,r,e,n){return nr(Z(r,t.length-e),t,e,n)}function ie(t,r,e,n){return nr(rn(r),t,e,n)}function Gt(t,r,e,n){return ie(t,r,e,n)}function Wt(t,r,e,n){return nr(pe(r),t,e,n)}function Kt(t,r,e,n){return nr(en(r,t.length-e),t,e,n)}u.prototype.write=function(r,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=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");o||(o="utf8");for(var i=!1;;)switch(o){case"hex":return Ft(this,r,e,n);case"utf8":case"utf-8":return Yt(this,r,e,n);case"ascii":return ie(this,r,e,n);case"latin1":case"binary":return Gt(this,r,e,n);case"base64":return Wt(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Kt(this,r,e,n);default:if(i)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),i=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ht(t,r,e){return r===0&&e===t.length?qr(t):qr(t.slice(r,e))}function ae(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var a=t[o],i=null,c=a>239?4:a>223?3:a>191?2:1;if(o+c<=e){var p,f,d,l;switch(c){case 1:a<128&&(i=a);break;case 2:p=t[o+1],(p&192)===128&&(l=(a&31)<<6|p&63,l>127&&(i=l));break;case 3:p=t[o+1],f=t[o+2],(p&192)===128&&(f&192)===128&&(l=(a&15)<<12|(p&63)<<6|f&63,l>2047&&(l<55296||l>57343)&&(i=l));break;case 4:p=t[o+1],f=t[o+2],d=t[o+3],(p&192)===128&&(f&192)===128&&(d&192)===128&&(l=(a&15)<<18|(p&63)<<12|(f&63)<<6|d&63,l>65535&&l<1114112&&(i=l))}}i===null?(i=65533,c=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|i&1023),n.push(i),o+=c}return Vt(n)}var jr=4096;function Vt(t){var r=t.length;if(r<=jr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=jr));return e}function $t(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]&127);return n}function zt(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function Xt(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",a=r;a<e;++a)o+=Zt(t[a]);return o}function qt(t,r,e){for(var n=t.slice(r,e),o="",a=0;a<n.length;a+=2)o+=String.fromCharCode(n[a]+n[a+1]*256);return o}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 o;if(u.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=u.prototype;else{var a=e-r;o=new u(a,void 0);for(var i=0;i<a;++i)o[i]=this[i+r]}return o};function b(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||b(r,e,this.length);for(var o=this[r],a=1,i=0;++i<e&&(a*=256);)o+=this[r+i]*a;return o};u.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var o=this[r+--e],a=1;e>0&&(a*=256);)o+=this[r+--e]*a;return o};u.prototype.readUInt8=function(r,e){return e||b(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||b(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||b(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUInt32LE=function(r,e){return e||b(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||b(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||b(r,e,this.length);for(var o=this[r],a=1,i=0;++i<e&&(a*=256);)o+=this[r+i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*e)),o};u.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var o=e,a=1,i=this[r+--o];o>0&&(a*=256);)i+=this[r+--o]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*e)),i};u.prototype.readInt8=function(r,e){return e||b(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,e){e||b(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||b(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||b(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||b(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||b(r,4,this.length),rr(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||b(r,4,this.length),rr(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||b(r,8,this.length),rr(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||b(r,8,this.length),rr(this,r,!1,52,8)};function T(t,r,e,n,o,a){if(!S(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||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,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;T(this,r,e,n,a,0)}var i=1,c=0;for(this[e]=r&255;++c<n&&(i*=256);)this[e+c]=r/i&255;return e+n};u.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;T(this,r,e,n,a,0)}var i=n-1,c=1;for(this[e+i]=r&255;--i>=0&&(c*=256);)this[e+i]=r/c&255;return e+n};u.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function er(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,a=Math.min(t.length-e,2);o<a;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}u.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):er(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):er(this,r,e,!1),e+2};function tr(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,a=Math.min(t.length-e,4);o<a;++o)t[e+o]=r>>>(n?o:3-o)*8&255}u.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(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):tr(this,r,e,!0),e+4};u.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(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):tr(this,r,e,!1),e+4};u.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);T(this,r,e,n,a-1,-a)}var i=0,c=1,p=0;for(this[e]=r&255;++i<n&&(c*=256);)r<0&&p===0&&this[e+i-1]!==0&&(p=1),this[e+i]=(r/c>>0)-p&255;return e+n};u.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);T(this,r,e,n,a-1,-a)}var i=n-1,c=1,p=0;for(this[e+i]=r&255;--i>=0&&(c*=256);)r<0&&p===0&&this[e+i+1]!==0&&(p=1),this[e+i]=(r/c>>0)-p&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||T(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||T(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):er(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):er(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(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):tr(this,r,e,!0),e+4};u.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(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):tr(this,r,e,!1),e+4};function se(t,r,e,n,o,a){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function ce(t,r,e,n,o){return o||se(t,r,e,4),Zr(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return ce(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return ce(this,r,e,!1,n)};function ue(t,r,e,n,o){return o||se(t,r,e,8),Zr(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return ue(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return ue(this,r,e,!1,n)};u.prototype.copy=function(r,e,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),e>=r.length&&(e=r.length),e||(e=0),o>0&&o<n&&(o=n),o===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(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),r.length-e<o-n&&(o=r.length-e+n);var a=o-n,i;if(this===r&&n<e&&e<o)for(i=a-1;i>=0;--i)r[i+e]=this[i+n];else if(a<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)r[i+e]=this[i+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+a),e);return a};u.prototype.fill=function(r,e,n,o){if(typeof r=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),r.length===1){var a=r.charCodeAt(0);a<256&&(r=a)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!u.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}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 i;if(typeof r=="number")for(i=e;i<n;++i)this[i]=r;else{var c=S(r)?r:Z(new u(r,o).toString()),p=c.length;for(i=0;i<n-e;++i)this[i+e]=c[i%p]}return this};var Jt=/[^+\/0-9A-Za-z-_]/g;function jt(t){if(t=Qt(t).replace(Jt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Qt(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Zt(t){return t<16?"0"+t.toString(16):t.toString(16)}function Z(t,r){r=r||1/0;for(var e,n=t.length,o=null,a=[],i=0;i<n;++i){if(e=t.charCodeAt(i),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&a.push(239,191,189);continue}else if(i+1===n){(r-=3)>-1&&a.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&a.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&a.push(239,191,189);if(o=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 rn(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function en(t,r){for(var e,n,o,a=[],i=0;i<t.length&&!((r-=2)<0);++i)e=t.charCodeAt(i),n=e>>8,o=e%256,a.push(o),a.push(n);return a}function pe(t){return Bt(jt(t))}function nr(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function tn(t){return t!==t}function nn(t){return t!=null&&(!!t._isBuffer||le(t)||on(t))}function le(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function on(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&le(t.slice(0,0))}import{encodeAddress as an,decodeAddress as Ga}from"algosdk";function Y(t){return t.reduce((r,e)=>Uint8Array.from([...r,...e]))}var me={V1_1:"v1_1",V2:"v2"},ts={[me.V1_1]:{testnet:62368684,mainnet:552635992},[me.V2]:{testnet:148607e3,mainnet:1002541853}};var de=t=>cn.decodeAddress(t.toUpperCase()).publicKey;import*as E from"ethereumjs-util";function pn(t){return E.toUnsigned(new E.BN(String(t)))}function fe(t){let r=pn(t);if(r.length>32)throw new Error("Invalid value. The buffer length of the value is more than 32");return new Uint8Array(E.setLengthLeft(r,32))}var ge=t=>new Uint8Array(E.setLengthLeft(or(t),32)),or=t=>s.from(ln(t),"hex"),ln=t=>t.startsWith("0x")?t.slice(2):t;var Er=t=>new Uint8Array(E.keccak256(s.from(t)));var Ar=(t,r)=>r===8?de(t):r===1?be.decode(t):ge(t);import sc from"algosdk";import hc from"algosdk";import Ic from"algosdk";import Pc from"algosdk";import Jc from"algosdk";var An=(t,r)=>r===8?fe(+t):dr[t]?new Uint8Array(or(String(t))):Ar(String(t),r);var _e=(t,r)=>{let e=Te(t.address,t.chainId,r.address,r.chainId);return s.from(Er(e)).toString("hex")},Te=(t,r,e,n)=>{let o=Ar(t,r),a=ye.encodeUint64(r),i=ye.encodeUint64(n),c=An(e,n);return Y([o,a,c,i])};var ju=(t,{userId:r,chainId:e,price:n,side:o,type:a,amount:i,total:c,id:p})=>{let{baseAsset:f,priceAsset:d}=t,l={address:r,chainId:e},h=o===W.Buy?d:f;return{action:"order",actionId:p,account:l,token:h,amount:o===W.Buy?a===j.Market?fr(c,d.decimal):mr(Xr(i,f.decimal),fr(n,d.decimal)):i,ts:Date.now()}},Qu=(t,r,e,n="0")=>({hash:_e(t,r),loginAddress:t.address,loginChainId:t.chainId,tokenId:r.address,tokenChainId:r.chainId,amount:e,lockedAmount:n});export{ju as mapToBalanceInfo,Qu as mapToCodexBalance};
|
|
2
2
|
/*!
|
|
3
3
|
* The buffer module from node.js, for the browser.
|
|
4
4
|
*
|