@ultrade/shared 1.0.7 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/common/auth.helper.js +17 -0
- package/dist/browser/common/big-number.helper.js +11 -0
- package/dist/browser/common/index.js +17 -0
- package/dist/browser/common/mappers/codexAsset.mapper.js +11 -0
- package/dist/browser/common/mappers/codexBalance.mapper.js +11 -0
- package/dist/browser/common/mappers/index.js +11 -0
- package/dist/browser/common/mappers/trade.mapper.js +11 -0
- package/dist/browser/common/utils/assert.js +11 -0
- package/dist/browser/common/utils/decode.js +11 -0
- package/dist/browser/common/utils/index.js +11 -0
- package/dist/browser/common/utils/social.js +11 -0
- package/dist/browser/common/utils/stat.js +11 -0
- package/dist/browser/constants/index.js +11 -0
- package/dist/browser/enums/index.js +11 -0
- package/dist/browser/helpers/Encoding.js +17 -0
- package/dist/browser/helpers/algo.helper.js +17 -0
- package/dist/browser/helpers/assert.helper.js +11 -0
- package/dist/browser/helpers/atomic.helper.js +11 -0
- package/dist/browser/helpers/balance.helper.js +17 -0
- package/dist/browser/helpers/codex/common.helper.js +18 -0
- package/dist/browser/helpers/codex/index.js +18 -0
- package/dist/browser/helpers/codex/mbr.helper.js +17 -0
- package/dist/browser/helpers/codex/mna.helper.js +17 -0
- package/dist/browser/helpers/codex/order.helper.js +17 -0
- package/dist/browser/helpers/codex/setGlobal.helper.js +17 -0
- package/dist/browser/helpers/codex/transfer.helper.js +18 -0
- package/dist/browser/helpers/codex/txn.helper.js +17 -0
- package/dist/browser/helpers/codex.helper.js +24 -0
- package/dist/browser/helpers/eth.helper.js +18 -0
- package/dist/browser/helpers/index.js +11 -0
- package/dist/browser/helpers/interval.helpers.js +11 -0
- package/dist/browser/helpers/liquidity.helper.js +11 -0
- package/dist/browser/helpers/order.helper.js +11 -0
- package/dist/browser/helpers/pair.helper.js +11 -0
- package/dist/browser/helpers/pointSystem.helper.js +11 -0
- package/dist/browser/helpers/ticker.helpers.js +11 -0
- package/dist/browser/helpers/vaa.helper.js +11 -0
- package/dist/browser/helpers/withdraw.helper.js +18 -0
- package/dist/browser/interfaces/index.js +11 -0
- package/dist/browser/types/index.js +11 -0
- package/dist/node/common/auth.helper.js +1 -0
- package/dist/node/common/big-number.helper.js +1 -0
- package/dist/node/common/index.js +1 -0
- package/dist/node/common/mappers/codexAsset.mapper.js +1 -0
- package/dist/node/common/mappers/codexBalance.mapper.js +1 -0
- package/dist/node/common/mappers/index.js +1 -0
- package/dist/node/common/mappers/trade.mapper.js +1 -0
- package/dist/node/common/utils/assert.js +1 -0
- package/dist/node/common/utils/decode.js +1 -0
- package/dist/node/common/utils/index.js +1 -0
- package/dist/node/common/utils/social.js +1 -0
- package/dist/node/common/utils/stat.js +1 -0
- package/dist/node/constants/index.js +1 -0
- package/dist/node/enums/index.js +1 -0
- package/dist/node/helpers/Encoding.js +1 -0
- package/dist/node/helpers/algo.helper.js +1 -0
- package/dist/node/helpers/assert.helper.js +1 -0
- package/dist/node/helpers/atomic.helper.js +1 -0
- package/dist/node/helpers/balance.helper.js +1 -0
- package/dist/node/helpers/codex/common.helper.js +2 -0
- package/dist/node/helpers/codex/index.js +2 -0
- package/dist/node/helpers/codex/mbr.helper.js +1 -0
- package/dist/node/helpers/codex/mna.helper.js +1 -0
- package/dist/node/helpers/codex/order.helper.js +1 -0
- package/dist/node/helpers/codex/setGlobal.helper.js +1 -0
- package/dist/node/helpers/codex/transfer.helper.js +2 -0
- package/dist/node/helpers/codex/txn.helper.js +1 -0
- package/dist/node/helpers/codex.helper.js +8 -0
- package/dist/node/helpers/eth.helper.js +2 -0
- package/dist/node/helpers/index.js +1 -0
- package/dist/node/helpers/interval.helpers.js +1 -0
- package/dist/node/helpers/liquidity.helper.js +1 -0
- package/dist/node/helpers/order.helper.js +1 -0
- package/dist/node/helpers/pair.helper.js +1 -0
- package/dist/node/helpers/pointSystem.helper.js +1 -0
- package/dist/node/helpers/ticker.helpers.js +1 -0
- package/dist/node/helpers/vaa.helper.js +0 -0
- package/dist/node/helpers/withdraw.helper.js +2 -0
- package/dist/node/interfaces/index.js +1 -0
- package/dist/node/types/index.js +1 -0
- package/dist/src/helpers/codex/common.helper.d.ts +1 -1
- package/dist/src/helpers/vaa.helper.d.ts +0 -2
- package/package.json +25 -41
- package/dist/common/auth.helper.js +0 -1
- package/dist/common/big-number.helper.js +0 -1
- package/dist/common/index.js +0 -1
- package/dist/common/mappers/codexAsset.mapper.js +0 -1
- package/dist/common/mappers/codexBalance.mapper.js +0 -1
- package/dist/common/mappers/index.js +0 -1
- package/dist/common/mappers/trade.mapper.js +0 -1
- package/dist/common/utils/assert.js +0 -1
- package/dist/common/utils/decode.js +0 -1
- package/dist/common/utils/index.js +0 -1
- package/dist/common/utils/social.js +0 -1
- package/dist/common/utils/stat.js +0 -1
- package/dist/constants/index.js +0 -1
- package/dist/enums/index.js +0 -1
- package/dist/helpers/Encoding.js +0 -1
- package/dist/helpers/algo.helper.js +0 -1
- package/dist/helpers/assert.helper.js +0 -1
- package/dist/helpers/atomic.helper.js +0 -1
- package/dist/helpers/balance.helper.js +0 -1
- package/dist/helpers/codex/common.helper.js +0 -2
- package/dist/helpers/codex/index.js +0 -2
- package/dist/helpers/codex/mbr.helper.js +0 -1
- package/dist/helpers/codex/mna.helper.js +0 -1
- package/dist/helpers/codex/order.helper.js +0 -1
- package/dist/helpers/codex/setGlobal.helper.js +0 -1
- package/dist/helpers/codex/transfer.helper.js +0 -2
- package/dist/helpers/codex/txn.helper.js +0 -1
- package/dist/helpers/codex.helper.js +0 -8
- package/dist/helpers/eth.helper.js +0 -2
- package/dist/helpers/index.js +0 -1
- package/dist/helpers/interval.helpers.js +0 -1
- package/dist/helpers/liquidity.helper.js +0 -1
- package/dist/helpers/order.helper.js +0 -1
- package/dist/helpers/pair.helper.js +0 -1
- package/dist/helpers/pointSystem.helper.js +0 -1
- package/dist/helpers/ticker.helpers.js +0 -1
- package/dist/helpers/vaa.helper.js +0 -1
- package/dist/helpers/withdraw.helper.js +0 -2
- package/dist/interfaces/index.js +0 -1
- package/dist/types/index.js +0 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
function hr(){throw new Error("setTimeout has not been defined")}function cr(){throw new Error("clearTimeout has not been defined")}var P=hr,S=cr;typeof globalThis.setTimeout=="function"&&(P=setTimeout);typeof globalThis.clearTimeout=="function"&&(S=clearTimeout);function sr(i){if(P===setTimeout)return setTimeout(i,0);if((P===hr||!P)&&setTimeout)return P=setTimeout,setTimeout(i,0);try{return P(i,0)}catch{try{return P.call(null,i,0)}catch{return P.call(this,i,0)}}}function Xr(i){if(S===clearTimeout)return clearTimeout(i);if((S===cr||!S)&&clearTimeout)return S=clearTimeout,clearTimeout(i);try{return S(i)}catch{try{return S.call(null,i)}catch{return S.call(this,i)}}}var B=[],N=!1,D,$=-1;function Kr(){!N||!D||(N=!1,D.length?B=D.concat(B):$=-1,B.length&&pr())}function pr(){if(!N){var i=sr(Kr);N=!0;for(var r=B.length;r;){for(D=B,B=[];++$<r;)D&&D[$].run();$=-1,r=B.length}D=null,N=!1,Xr(i)}}function Qr(i){var r=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)r[n-1]=arguments[n];B.push(new lr(i,r)),B.length===1&&!N&&sr(pr)}function lr(i,r){this.fun=i,this.array=r}lr.prototype.run=function(){this.fun.apply(null,this.array)};var Zr="browser",qr="browser",jr=!0,rn={},nn=[],en="",tn={},on={},un={};function Y(){}var fn=Y,an=Y,hn=Y,cn=Y,sn=Y,pn=Y,ln=Y;function xn(i){throw new Error("process.binding is not supported")}function wn(){return"/"}function En(i){throw new Error("process.chdir is not supported")}function gn(){return 0}var M=globalThis.performance||{},yn=M.now||M.mozNow||M.msNow||M.oNow||M.webkitNow||function(){return new Date().getTime()};function An(i){var r=yn.call(M)*.001,n=Math.floor(r),e=Math.floor(r%1*1e9);return i&&(n=n-i[0],e=e-i[1],e<0&&(n--,e+=1e9)),[n,e]}var mn=new Date;function Un(){var i=new Date,r=i-mn;return r/1e3}var L={nextTick:Qr,title:Zr,browser:jr,env:rn,argv:nn,version:en,versions:tn,on:fn,addListener:an,once:hn,off:cn,removeListener:sn,removeAllListeners:pn,emit:ln,binding:xn,cwd:wn,chdir:En,umask:gn,hrtime:An,platform:qr,release:on,config:un,uptime:Un},ar={};Object.keys(ar).forEach(i=>{let r=i.split("."),n=L;for(let e=0;e<r.length;e++){let t=r[e];e===r.length-1?n[t]=ar[i]:n=n[t]||(n[t]={})}});var I=[],U=[],Tn=typeof Uint8Array<"u"?Uint8Array:Array,rr=!1;function gr(){rr=!0;for(var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,n=i.length;r<n;++r)I[r]=i[r],U[i.charCodeAt(r)]=r;U[45]=62,U[95]=63}function In(i){rr||gr();var r,n,e,t,o,u,f=i.length;if(f%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=i[f-2]==="="?2:i[f-1]==="="?1:0,u=new Tn(f*3/4-o),e=o>0?f-4:f;var c=0;for(r=0,n=0;r<e;r+=4,n+=3)t=U[i.charCodeAt(r)]<<18|U[i.charCodeAt(r+1)]<<12|U[i.charCodeAt(r+2)]<<6|U[i.charCodeAt(r+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=t&255;return o===2?(t=U[i.charCodeAt(r)]<<2|U[i.charCodeAt(r+1)]>>4,u[c++]=t&255):o===1&&(t=U[i.charCodeAt(r)]<<10|U[i.charCodeAt(r+1)]<<4|U[i.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=t&255),u}function dn(i){return I[i>>18&63]+I[i>>12&63]+I[i>>6&63]+I[i&63]}function Rn(i,r,n){for(var e,t=[],o=r;o<n;o+=3)e=(i[o]<<16)+(i[o+1]<<8)+i[o+2],t.push(dn(e));return t.join("")}function xr(i){rr||gr();for(var r,n=i.length,e=n%3,t="",o=[],u=16383,f=0,c=n-e;f<c;f+=u)o.push(Rn(i,f,f+u>c?c:f+u));return e===1?(r=i[n-1],t+=I[r>>2],t+=I[r<<4&63],t+="=="):e===2&&(r=(i[n-2]<<8)+i[n-1],t+=I[r>>10],t+=I[r>>4&63],t+=I[r<<2&63],t+="="),o.push(t),o.join("")}a.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function W(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function F(i,r){if(W()<r)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(i=new Uint8Array(r),i.__proto__=a.prototype):(i===null&&(i=new a(r)),i.length=r),i}function a(i,r,n){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(i,r,n);if(typeof i=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return nr(this,i)}return yr(this,i,r,n)}a.poolSize=8192;a._augment=function(i){return i.__proto__=a.prototype,i};function yr(i,r,n,e){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Fn(i,r,n,e):typeof r=="string"?Bn(i,r,n):vn(i,r)}a.from=function(i,r,n){return yr(null,i,r,n)};a.kMaxLength=W();a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&a[Symbol.species]);function Ar(i){if(typeof i!="number")throw new TypeError('"size" argument must be a number');if(i<0)throw new RangeError('"size" argument must not be negative')}function _n(i,r,n,e){return Ar(r),r<=0?F(i,r):n!==void 0?typeof e=="string"?F(i,r).fill(n,e):F(i,r).fill(n):F(i,r)}a.alloc=function(i,r,n){return _n(null,i,r,n)};function nr(i,r){if(Ar(r),i=F(i,r<0?0:ir(r)|0),!a.TYPED_ARRAY_SUPPORT)for(var n=0;n<r;++n)i[n]=0;return i}a.allocUnsafe=function(i){return nr(null,i)};a.allocUnsafeSlow=function(i){return nr(null,i)};function Bn(i,r,n){if((typeof n!="string"||n==="")&&(n="utf8"),!a.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var e=mr(r,n)|0;i=F(i,e);var t=i.write(r,n);return t!==e&&(i=i.slice(0,t)),i}function j(i,r){var n=r.length<0?0:ir(r.length)|0;i=F(i,n);for(var e=0;e<n;e+=1)i[e]=r[e]&255;return i}function Fn(i,r,n,e){if(r.byteLength,n<0||r.byteLength<n)throw new RangeError("'offset' is out of bounds");if(r.byteLength<n+(e||0))throw new RangeError("'length' is out of bounds");return n===void 0&&e===void 0?r=new Uint8Array(r):e===void 0?r=new Uint8Array(r,n):r=new Uint8Array(r,n,e),a.TYPED_ARRAY_SUPPORT?(i=r,i.__proto__=a.prototype):i=j(i,r),i}function vn(i,r){if(d(r)){var n=ir(r.length)|0;return i=F(i,n),i.length===0||r.copy(i,0,0,n),i}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||Xn(r.length)?F(i,0):j(i,r);if(r.type==="Buffer"&&Array.isArray(r.data))return j(i,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function ir(i){if(i>=W())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+W().toString(16)+" bytes");return i|0}a.isBuffer=Kn;function d(i){return!!(i!=null&&i._isBuffer)}a.compare=function(r,n){if(!d(r)||!d(n))throw new TypeError("Arguments must be Buffers");if(r===n)return 0;for(var e=r.length,t=n.length,o=0,u=Math.min(e,t);o<u;++o)if(r[o]!==n[o]){e=r[o],t=n[o];break}return e<t?-1:t<e?1:0};a.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};a.concat=function(r,n){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return a.alloc(0);var e;if(n===void 0)for(n=0,e=0;e<r.length;++e)n+=r[e].length;var t=a.allocUnsafe(n),o=0;for(e=0;e<r.length;++e){var u=r[e];if(!d(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(t,o),o+=u.length}return t};function mr(i,r){if(d(i))return i.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(i)||i instanceof ArrayBuffer))return i.byteLength;typeof i!="string"&&(i=""+i);var n=i.length;if(n===0)return 0;for(var e=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return b(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return Br(i).length;default:if(e)return b(i).length;r=(""+r).toLowerCase(),e=!0}}a.byteLength=mr;function Pn(i,r,n){var e=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,r>>>=0,n<=r))return"";for(i||(i="utf8");;)switch(i){case"hex":return Wn(this,r,n);case"utf8":case"utf-8":return Ir(this,r,n);case"ascii":return Ln(this,r,n);case"latin1":case"binary":return $n(this,r,n);case"base64":return Mn(this,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return bn(this,r,n);default:if(e)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),e=!0}}a.prototype._isBuffer=!0;function k(i,r,n){var e=i[r];i[r]=i[n],i[n]=e}a.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var n=0;n<r;n+=2)k(this,n,n+1);return this};a.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var n=0;n<r;n+=4)k(this,n,n+3),k(this,n+1,n+2);return this};a.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var n=0;n<r;n+=8)k(this,n,n+7),k(this,n+1,n+6),k(this,n+2,n+5),k(this,n+3,n+4);return this};a.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Ir(this,0,r):Pn.apply(this,arguments)};a.prototype.equals=function(r){if(!d(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:a.compare(this,r)===0};a.prototype.compare=function(r,n,e,t,o){if(!d(r))throw new TypeError("Argument must be a Buffer");if(n===void 0&&(n=0),e===void 0&&(e=r?r.length:0),t===void 0&&(t=0),o===void 0&&(o=this.length),n<0||e>r.length||t<0||o>this.length)throw new RangeError("out of range index");if(t>=o&&n>=e)return 0;if(t>=o)return-1;if(n>=e)return 1;if(n>>>=0,e>>>=0,t>>>=0,o>>>=0,this===r)return 0;for(var u=o-t,f=e-n,c=Math.min(u,f),p=this.slice(t,o),l=r.slice(n,e),s=0;s<c;++s)if(p[s]!==l[s]){u=p[s],f=l[s];break}return u<f?-1:f<u?1:0};function Ur(i,r,n,e,t){if(i.length===0)return-1;if(typeof n=="string"?(e=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=t?0:i.length-1),n<0&&(n=i.length+n),n>=i.length){if(t)return-1;n=i.length-1}else if(n<0)if(t)n=0;else return-1;if(typeof r=="string"&&(r=a.from(r,e)),d(r))return r.length===0?-1:wr(i,r,n,e,t);if(typeof r=="number")return r=r&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?t?Uint8Array.prototype.indexOf.call(i,r,n):Uint8Array.prototype.lastIndexOf.call(i,r,n):wr(i,[r],n,e,t);throw new TypeError("val must be string, number or Buffer")}function wr(i,r,n,e,t){var o=1,u=i.length,f=r.length;if(e!==void 0&&(e=String(e).toLowerCase(),e==="ucs2"||e==="ucs-2"||e==="utf16le"||e==="utf-16le")){if(i.length<2||r.length<2)return-1;o=2,u/=2,f/=2,n/=2}function c(x,m){return o===1?x[m]:x.readUInt16BE(m*o)}var p;if(t){var l=-1;for(p=n;p<u;p++)if(c(i,p)===c(r,l===-1?0:p-l)){if(l===-1&&(l=p),p-l+1===f)return l*o}else l!==-1&&(p-=p-l),l=-1}else for(n+f>u&&(n=u-f),p=n;p>=0;p--){for(var s=!0,w=0;w<f;w++)if(c(i,p+w)!==c(r,w)){s=!1;break}if(s)return p}return-1}a.prototype.includes=function(r,n,e){return this.indexOf(r,n,e)!==-1};a.prototype.indexOf=function(r,n,e){return Ur(this,r,n,e,!0)};a.prototype.lastIndexOf=function(r,n,e){return Ur(this,r,n,e,!1)};function Sn(i,r,n,e){n=Number(n)||0;var t=i.length-n;e?(e=Number(e),e>t&&(e=t)):e=t;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");e>o/2&&(e=o/2);for(var u=0;u<e;++u){var f=parseInt(r.substr(u*2,2),16);if(isNaN(f))return u;i[n+u]=f}return u}function Dn(i,r,n,e){return G(b(r,i.length-n),i,n,e)}function Tr(i,r,n,e){return G(Hn(r),i,n,e)}function Yn(i,r,n,e){return Tr(i,r,n,e)}function kn(i,r,n,e){return G(Br(r),i,n,e)}function Cn(i,r,n,e){return G(Jn(r,i.length-n),i,n,e)}a.prototype.write=function(r,n,e,t){if(n===void 0)t="utf8",e=this.length,n=0;else if(e===void 0&&typeof n=="string")t=n,e=this.length,n=0;else if(isFinite(n))n=n|0,isFinite(e)?(e=e|0,t===void 0&&(t="utf8")):(t=e,e=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-n;if((e===void 0||e>o)&&(e=o),r.length>0&&(e<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");t||(t="utf8");for(var u=!1;;)switch(t){case"hex":return Sn(this,r,n,e);case"utf8":case"utf-8":return Dn(this,r,n,e);case"ascii":return Tr(this,r,n,e);case"latin1":case"binary":return Yn(this,r,n,e);case"base64":return kn(this,r,n,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Cn(this,r,n,e);default:if(u)throw new TypeError("Unknown encoding: "+t);t=(""+t).toLowerCase(),u=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Mn(i,r,n){return r===0&&n===i.length?xr(i):xr(i.slice(r,n))}function Ir(i,r,n){n=Math.min(i.length,n);for(var e=[],t=r;t<n;){var o=i[t],u=null,f=o>239?4:o>223?3:o>191?2:1;if(t+f<=n){var c,p,l,s;switch(f){case 1:o<128&&(u=o);break;case 2:c=i[t+1],(c&192)===128&&(s=(o&31)<<6|c&63,s>127&&(u=s));break;case 3:c=i[t+1],p=i[t+2],(c&192)===128&&(p&192)===128&&(s=(o&15)<<12|(c&63)<<6|p&63,s>2047&&(s<55296||s>57343)&&(u=s));break;case 4:c=i[t+1],p=i[t+2],l=i[t+3],(c&192)===128&&(p&192)===128&&(l&192)===128&&(s=(o&15)<<18|(c&63)<<12|(p&63)<<6|l&63,s>65535&&s<1114112&&(u=s))}}u===null?(u=65533,f=1):u>65535&&(u-=65536,e.push(u>>>10&1023|55296),u=56320|u&1023),e.push(u),t+=f}return Nn(e)}var Er=4096;function Nn(i){var r=i.length;if(r<=Er)return String.fromCharCode.apply(String,i);for(var n="",e=0;e<r;)n+=String.fromCharCode.apply(String,i.slice(e,e+=Er));return n}function Ln(i,r,n){var e="";n=Math.min(i.length,n);for(var t=r;t<n;++t)e+=String.fromCharCode(i[t]&127);return e}function $n(i,r,n){var e="";n=Math.min(i.length,n);for(var t=r;t<n;++t)e+=String.fromCharCode(i[t]);return e}function Wn(i,r,n){var e=i.length;(!r||r<0)&&(r=0),(!n||n<0||n>e)&&(n=e);for(var t="",o=r;o<n;++o)t+=Vn(i[o]);return t}function bn(i,r,n){for(var e=i.slice(r,n),t="",o=0;o<e.length;o+=2)t+=String.fromCharCode(e[o]+e[o+1]*256);return t}a.prototype.slice=function(r,n){var e=this.length;r=~~r,n=n===void 0?e:~~n,r<0?(r+=e,r<0&&(r=0)):r>e&&(r=e),n<0?(n+=e,n<0&&(n=0)):n>e&&(n=e),n<r&&(n=r);var t;if(a.TYPED_ARRAY_SUPPORT)t=this.subarray(r,n),t.__proto__=a.prototype;else{var o=n-r;t=new a(o,void 0);for(var u=0;u<o;++u)t[u]=this[u+r]}return t};function E(i,r,n){if(i%1!==0||i<0)throw new RangeError("offset is not uint");if(i+r>n)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUIntLE=function(r,n,e){r=r|0,n=n|0,e||E(r,n,this.length);for(var t=this[r],o=1,u=0;++u<n&&(o*=256);)t+=this[r+u]*o;return t};a.prototype.readUIntBE=function(r,n,e){r=r|0,n=n|0,e||E(r,n,this.length);for(var t=this[r+--n],o=1;n>0&&(o*=256);)t+=this[r+--n]*o;return t};a.prototype.readUInt8=function(r,n){return n||E(r,1,this.length),this[r]};a.prototype.readUInt16LE=function(r,n){return n||E(r,2,this.length),this[r]|this[r+1]<<8};a.prototype.readUInt16BE=function(r,n){return n||E(r,2,this.length),this[r]<<8|this[r+1]};a.prototype.readUInt32LE=function(r,n){return n||E(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};a.prototype.readUInt32BE=function(r,n){return n||E(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};a.prototype.readIntLE=function(r,n,e){r=r|0,n=n|0,e||E(r,n,this.length);for(var t=this[r],o=1,u=0;++u<n&&(o*=256);)t+=this[r+u]*o;return o*=128,t>=o&&(t-=Math.pow(2,8*n)),t};a.prototype.readIntBE=function(r,n,e){r=r|0,n=n|0,e||E(r,n,this.length);for(var t=n,o=1,u=this[r+--t];t>0&&(o*=256);)u+=this[r+--t]*o;return o*=128,u>=o&&(u-=Math.pow(2,8*n)),u};a.prototype.readInt8=function(r,n){return n||E(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};a.prototype.readInt16LE=function(r,n){n||E(r,2,this.length);var e=this[r]|this[r+1]<<8;return e&32768?e|4294901760:e};a.prototype.readInt16BE=function(r,n){n||E(r,2,this.length);var e=this[r+1]|this[r]<<8;return e&32768?e|4294901760:e};a.prototype.readInt32LE=function(r,n){return n||E(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};a.prototype.readInt32BE=function(r,n){return n||E(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};a.prototype.readFloatLE=function(r,n){return n||E(r,4,this.length),V(this,r,!0,23,4)};a.prototype.readFloatBE=function(r,n){return n||E(r,4,this.length),V(this,r,!1,23,4)};a.prototype.readDoubleLE=function(r,n){return n||E(r,8,this.length),V(this,r,!0,52,8)};a.prototype.readDoubleBE=function(r,n){return n||E(r,8,this.length),V(this,r,!1,52,8)};function y(i,r,n,e,t,o){if(!d(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>t||r<o)throw new RangeError('"value" argument is out of bounds');if(n+e>i.length)throw new RangeError("Index out of range")}a.prototype.writeUIntLE=function(r,n,e,t){if(r=+r,n=n|0,e=e|0,!t){var o=Math.pow(2,8*e)-1;y(this,r,n,e,o,0)}var u=1,f=0;for(this[n]=r&255;++f<e&&(u*=256);)this[n+f]=r/u&255;return n+e};a.prototype.writeUIntBE=function(r,n,e,t){if(r=+r,n=n|0,e=e|0,!t){var o=Math.pow(2,8*e)-1;y(this,r,n,e,o,0)}var u=e-1,f=1;for(this[n+u]=r&255;--u>=0&&(f*=256);)this[n+u]=r/f&255;return n+e};a.prototype.writeUInt8=function(r,n,e){return r=+r,n=n|0,e||y(this,r,n,1,255,0),a.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[n]=r&255,n+1};function z(i,r,n,e){r<0&&(r=65535+r+1);for(var t=0,o=Math.min(i.length-n,2);t<o;++t)i[n+t]=(r&255<<8*(e?t:1-t))>>>(e?t:1-t)*8}a.prototype.writeUInt16LE=function(r,n,e){return r=+r,n=n|0,e||y(this,r,n,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8):z(this,r,n,!0),n+2};a.prototype.writeUInt16BE=function(r,n,e){return r=+r,n=n|0,e||y(this,r,n,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[n]=r>>>8,this[n+1]=r&255):z(this,r,n,!1),n+2};function O(i,r,n,e){r<0&&(r=4294967295+r+1);for(var t=0,o=Math.min(i.length-n,4);t<o;++t)i[n+t]=r>>>(e?t:3-t)*8&255}a.prototype.writeUInt32LE=function(r,n,e){return r=+r,n=n|0,e||y(this,r,n,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[n+3]=r>>>24,this[n+2]=r>>>16,this[n+1]=r>>>8,this[n]=r&255):O(this,r,n,!0),n+4};a.prototype.writeUInt32BE=function(r,n,e){return r=+r,n=n|0,e||y(this,r,n,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255):O(this,r,n,!1),n+4};a.prototype.writeIntLE=function(r,n,e,t){if(r=+r,n=n|0,!t){var o=Math.pow(2,8*e-1);y(this,r,n,e,o-1,-o)}var u=0,f=1,c=0;for(this[n]=r&255;++u<e&&(f*=256);)r<0&&c===0&&this[n+u-1]!==0&&(c=1),this[n+u]=(r/f>>0)-c&255;return n+e};a.prototype.writeIntBE=function(r,n,e,t){if(r=+r,n=n|0,!t){var o=Math.pow(2,8*e-1);y(this,r,n,e,o-1,-o)}var u=e-1,f=1,c=0;for(this[n+u]=r&255;--u>=0&&(f*=256);)r<0&&c===0&&this[n+u+1]!==0&&(c=1),this[n+u]=(r/f>>0)-c&255;return n+e};a.prototype.writeInt8=function(r,n,e){return r=+r,n=n|0,e||y(this,r,n,1,127,-128),a.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[n]=r&255,n+1};a.prototype.writeInt16LE=function(r,n,e){return r=+r,n=n|0,e||y(this,r,n,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8):z(this,r,n,!0),n+2};a.prototype.writeInt16BE=function(r,n,e){return r=+r,n=n|0,e||y(this,r,n,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[n]=r>>>8,this[n+1]=r&255):z(this,r,n,!1),n+2};a.prototype.writeInt32LE=function(r,n,e){return r=+r,n=n|0,e||y(this,r,n,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8,this[n+2]=r>>>16,this[n+3]=r>>>24):O(this,r,n,!0),n+4};a.prototype.writeInt32BE=function(r,n,e){return r=+r,n=n|0,e||y(this,r,n,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),a.TYPED_ARRAY_SUPPORT?(this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255):O(this,r,n,!1),n+4};function dr(i,r,n,e,t,o){if(n+e>i.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Rr(i,r,n,e,t){return t||dr(i,r,n,4,34028234663852886e22,-34028234663852886e22),vr(i,r,n,e,23,4),n+4}a.prototype.writeFloatLE=function(r,n,e){return Rr(this,r,n,!0,e)};a.prototype.writeFloatBE=function(r,n,e){return Rr(this,r,n,!1,e)};function _r(i,r,n,e,t){return t||dr(i,r,n,8,17976931348623157e292,-17976931348623157e292),vr(i,r,n,e,52,8),n+8}a.prototype.writeDoubleLE=function(r,n,e){return _r(this,r,n,!0,e)};a.prototype.writeDoubleBE=function(r,n,e){return _r(this,r,n,!1,e)};a.prototype.copy=function(r,n,e,t){if(e||(e=0),!t&&t!==0&&(t=this.length),n>=r.length&&(n=r.length),n||(n=0),t>0&&t<e&&(t=e),t===e||r.length===0||this.length===0)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(t<0)throw new RangeError("sourceEnd out of bounds");t>this.length&&(t=this.length),r.length-n<t-e&&(t=r.length-n+e);var o=t-e,u;if(this===r&&e<n&&n<t)for(u=o-1;u>=0;--u)r[u+n]=this[u+e];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(u=0;u<o;++u)r[u+n]=this[u+e];else Uint8Array.prototype.set.call(r,this.subarray(e,e+o),n);return o};a.prototype.fill=function(r,n,e,t){if(typeof r=="string"){if(typeof n=="string"?(t=n,n=0,e=this.length):typeof e=="string"&&(t=e,e=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(t!==void 0&&typeof t!="string")throw new TypeError("encoding must be a string");if(typeof t=="string"&&!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t)}else typeof r=="number"&&(r=r&255);if(n<0||this.length<n||this.length<e)throw new RangeError("Out of range index");if(e<=n)return this;n=n>>>0,e=e===void 0?this.length:e>>>0,r||(r=0);var u;if(typeof r=="number")for(u=n;u<e;++u)this[u]=r;else{var f=d(r)?r:b(new a(r,t).toString()),c=f.length;for(u=0;u<e-n;++u)this[u+n]=f[u%c]}return this};var zn=/[^+\/0-9A-Za-z-_]/g;function On(i){if(i=Gn(i).replace(zn,""),i.length<2)return"";for(;i.length%4!==0;)i=i+"=";return i}function Gn(i){return i.trim?i.trim():i.replace(/^\s+|\s+$/g,"")}function Vn(i){return i<16?"0"+i.toString(16):i.toString(16)}function b(i,r){r=r||1/0;for(var n,e=i.length,t=null,o=[],u=0;u<e;++u){if(n=i.charCodeAt(u),n>55295&&n<57344){if(!t){if(n>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(u+1===e){(r-=3)>-1&&o.push(239,191,189);continue}t=n;continue}if(n<56320){(r-=3)>-1&&o.push(239,191,189),t=n;continue}n=(t-55296<<10|n-56320)+65536}else t&&(r-=3)>-1&&o.push(239,191,189);if(t=null,n<128){if((r-=1)<0)break;o.push(n)}else if(n<2048){if((r-=2)<0)break;o.push(n>>6|192,n&63|128)}else if(n<65536){if((r-=3)<0)break;o.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((r-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return o}function Hn(i){for(var r=[],n=0;n<i.length;++n)r.push(i.charCodeAt(n)&255);return r}function Jn(i,r){for(var n,e,t,o=[],u=0;u<i.length&&!((r-=2)<0);++u)n=i.charCodeAt(u),e=n>>8,t=n%256,o.push(t),o.push(e);return o}function Br(i){return In(On(i))}function G(i,r,n,e){for(var t=0;t<e&&!(t+n>=r.length||t>=i.length);++t)r[t+n]=i[t];return t}function Xn(i){return i!==i}function Kn(i){return i!=null&&(!!i._isBuffer||Fr(i)||Qn(i))}function Fr(i){return!!i.constructor&&typeof i.constructor.isBuffer=="function"&&i.constructor.isBuffer(i)}function Qn(i){return typeof i.readFloatLE=="function"&&typeof i.slice=="function"&&Fr(i.slice(0,0))}function V(i,r,n,e,t){var o,u,f=t*8-e-1,c=(1<<f)-1,p=c>>1,l=-7,s=n?t-1:0,w=n?-1:1,x=i[r+s];for(s+=w,o=x&(1<<-l)-1,x>>=-l,l+=f;l>0;o=o*256+i[r+s],s+=w,l-=8);for(u=o&(1<<-l)-1,o>>=-l,l+=e;l>0;u=u*256+i[r+s],s+=w,l-=8);if(o===0)o=1-p;else{if(o===c)return u?NaN:(x?-1:1)*(1/0);u=u+Math.pow(2,e),o=o-p}return(x?-1:1)*u*Math.pow(2,o-e)}function vr(i,r,n,e,t,o){var u,f,c,p=o*8-t-1,l=(1<<p)-1,s=l>>1,w=t===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=e?0:o-1,m=e?1:-1,q=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(f=isNaN(r)?1:0,u=l):(u=Math.floor(Math.log(r)/Math.LN2),r*(c=Math.pow(2,-u))<1&&(u--,c*=2),u+s>=1?r+=w/c:r+=w*Math.pow(2,1-s),r*c>=2&&(u++,c/=2),u+s>=l?(f=0,u=l):u+s>=1?(f=(r*c-1)*Math.pow(2,t),u=u+s):(f=r*Math.pow(2,s-1)*Math.pow(2,t),u=0));t>=8;i[n+x]=f&255,x+=m,f/=256,t-=8);for(u=u<<t|f,p+=t;p>0;i[n+x]=u&255,x+=m,u/=256,p-=8);i[n+x-m]|=q*128}import fr from"algosdk";import bi,{decodeAddress as zi,encodeAddress as Oi}from"algosdk";var R=[],T=[],Zn=typeof Uint8Array<"u"?Uint8Array:Array,tr=!1;function Yr(){tr=!0;for(var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,n=i.length;r<n;++r)R[r]=i[r],T[i.charCodeAt(r)]=r;T[45]=62,T[95]=63}function qn(i){tr||Yr();var r,n,e,t,o,u,f=i.length;if(f%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=i[f-2]==="="?2:i[f-1]==="="?1:0,u=new Zn(f*3/4-o),e=o>0?f-4:f;var c=0;for(r=0,n=0;r<e;r+=4,n+=3)t=T[i.charCodeAt(r)]<<18|T[i.charCodeAt(r+1)]<<12|T[i.charCodeAt(r+2)]<<6|T[i.charCodeAt(r+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=t&255;return o===2?(t=T[i.charCodeAt(r)]<<2|T[i.charCodeAt(r+1)]>>4,u[c++]=t&255):o===1&&(t=T[i.charCodeAt(r)]<<10|T[i.charCodeAt(r+1)]<<4|T[i.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=t&255),u}function jn(i){return R[i>>18&63]+R[i>>12&63]+R[i>>6&63]+R[i&63]}function ri(i,r,n){for(var e,t=[],o=r;o<n;o+=3)e=(i[o]<<16)+(i[o+1]<<8)+i[o+2],t.push(jn(e));return t.join("")}function Pr(i){tr||Yr();for(var r,n=i.length,e=n%3,t="",o=[],u=16383,f=0,c=n-e;f<c;f+=u)o.push(ri(i,f,f+u>c?c:f+u));return e===1?(r=i[n-1],t+=R[r>>2],t+=R[r<<4&63],t+="=="):e===2&&(r=(i[n-2]<<8)+i[n-1],t+=R[r>>10],t+=R[r>>4&63],t+=R[r<<2&63],t+="="),o.push(t),o.join("")}function X(i,r,n,e,t){var o,u,f=t*8-e-1,c=(1<<f)-1,p=c>>1,l=-7,s=n?t-1:0,w=n?-1:1,x=i[r+s];for(s+=w,o=x&(1<<-l)-1,x>>=-l,l+=f;l>0;o=o*256+i[r+s],s+=w,l-=8);for(u=o&(1<<-l)-1,o>>=-l,l+=e;l>0;u=u*256+i[r+s],s+=w,l-=8);if(o===0)o=1-p;else{if(o===c)return u?NaN:(x?-1:1)*(1/0);u=u+Math.pow(2,e),o=o-p}return(x?-1:1)*u*Math.pow(2,o-e)}function kr(i,r,n,e,t,o){var u,f,c,p=o*8-t-1,l=(1<<p)-1,s=l>>1,w=t===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=e?0:o-1,m=e?1:-1,q=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(f=isNaN(r)?1:0,u=l):(u=Math.floor(Math.log(r)/Math.LN2),r*(c=Math.pow(2,-u))<1&&(u--,c*=2),u+s>=1?r+=w/c:r+=w*Math.pow(2,1-s),r*c>=2&&(u++,c/=2),u+s>=l?(f=0,u=l):u+s>=1?(f=(r*c-1)*Math.pow(2,t),u=u+s):(f=r*Math.pow(2,s-1)*Math.pow(2,t),u=0));t>=8;i[n+x]=f&255,x+=m,f/=256,t-=8);for(u=u<<t|f,p+=t;p>0;i[n+x]=u&255,x+=m,u/=256,p-=8);i[n+x-m]|=q*128}var ni={}.toString,Cr=Array.isArray||function(i){return ni.call(i)=="[object Array]"};var ii=50;h.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;var Mi=H();function H(){return h.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function v(i,r){if(H()<r)throw new RangeError("Invalid typed array length");return h.TYPED_ARRAY_SUPPORT?(i=new Uint8Array(r),i.__proto__=h.prototype):(i===null&&(i=new h(r)),i.length=r),i}function h(i,r,n){if(!h.TYPED_ARRAY_SUPPORT&&!(this instanceof h))return new h(i,r,n);if(typeof i=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return or(this,i)}return Mr(this,i,r,n)}h.poolSize=8192;h._augment=function(i){return i.__proto__=h.prototype,i};function Mr(i,r,n,e){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?oi(i,r,n,e):typeof r=="string"?ti(i,r,n):ui(i,r)}h.from=function(i,r,n){return Mr(null,i,r,n)};h.TYPED_ARRAY_SUPPORT&&(h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array);function Nr(i){if(typeof i!="number")throw new TypeError('"size" argument must be a number');if(i<0)throw new RangeError('"size" argument must not be negative')}function ei(i,r,n,e){return Nr(r),r<=0?v(i,r):n!==void 0?typeof e=="string"?v(i,r).fill(n,e):v(i,r).fill(n):v(i,r)}h.alloc=function(i,r,n){return ei(null,i,r,n)};function or(i,r){if(Nr(r),i=v(i,r<0?0:ur(r)|0),!h.TYPED_ARRAY_SUPPORT)for(var n=0;n<r;++n)i[n]=0;return i}h.allocUnsafe=function(i){return or(null,i)};h.allocUnsafeSlow=function(i){return or(null,i)};function ti(i,r,n){if((typeof n!="string"||n==="")&&(n="utf8"),!h.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var e=Lr(r,n)|0;i=v(i,e);var t=i.write(r,n);return t!==e&&(i=i.slice(0,t)),i}function er(i,r){var n=r.length<0?0:ur(r.length)|0;i=v(i,n);for(var e=0;e<n;e+=1)i[e]=r[e]&255;return i}function oi(i,r,n,e){if(r.byteLength,n<0||r.byteLength<n)throw new RangeError("'offset' is out of bounds");if(r.byteLength<n+(e||0))throw new RangeError("'length' is out of bounds");return n===void 0&&e===void 0?r=new Uint8Array(r):e===void 0?r=new Uint8Array(r,n):r=new Uint8Array(r,n,e),h.TYPED_ARRAY_SUPPORT?(i=r,i.__proto__=h.prototype):i=er(i,r),i}function ui(i,r){if(_(r)){var n=ur(r.length)|0;return i=v(i,n),i.length===0||r.copy(i,0,0,n),i}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||Ri(r.length)?v(i,0):er(i,r);if(r.type==="Buffer"&&Cr(r.data))return er(i,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function ur(i){if(i>=H())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+H().toString(16)+" bytes");return i|0}h.isBuffer=_i;function _(i){return!!(i!=null&&i._isBuffer)}h.compare=function(r,n){if(!_(r)||!_(n))throw new TypeError("Arguments must be Buffers");if(r===n)return 0;for(var e=r.length,t=n.length,o=0,u=Math.min(e,t);o<u;++o)if(r[o]!==n[o]){e=r[o],t=n[o];break}return e<t?-1:t<e?1:0};h.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};h.concat=function(r,n){if(!Cr(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return h.alloc(0);var e;if(n===void 0)for(n=0,e=0;e<r.length;++e)n+=r[e].length;var t=h.allocUnsafe(n),o=0;for(e=0;e<r.length;++e){var u=r[e];if(!_(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(t,o),o+=u.length}return t};function Lr(i,r){if(_(i))return i.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(i)||i instanceof ArrayBuffer))return i.byteLength;typeof i!="string"&&(i=""+i);var n=i.length;if(n===0)return 0;for(var e=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return J(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return Vr(i).length;default:if(e)return J(i).length;r=(""+r).toLowerCase(),e=!0}}h.byteLength=Lr;function fi(i,r,n){var e=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,r>>>=0,n<=r))return"";for(i||(i="utf8");;)switch(i){case"hex":return gi(this,r,n);case"utf8":case"utf-8":return br(this,r,n);case"ascii":return wi(this,r,n);case"latin1":case"binary":return Ei(this,r,n);case"base64":return li(this,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return yi(this,r,n);default:if(e)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),e=!0}}h.prototype._isBuffer=!0;function C(i,r,n){var e=i[r];i[r]=i[n],i[n]=e}h.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var n=0;n<r;n+=2)C(this,n,n+1);return this};h.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var n=0;n<r;n+=4)C(this,n,n+3),C(this,n+1,n+2);return this};h.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var n=0;n<r;n+=8)C(this,n,n+7),C(this,n+1,n+6),C(this,n+2,n+5),C(this,n+3,n+4);return this};h.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?br(this,0,r):fi.apply(this,arguments)};h.prototype.equals=function(r){if(!_(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:h.compare(this,r)===0};h.prototype.inspect=function(){var r="",n=ii;return this.length>0&&(r=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(r+=" ... ")),"<Buffer "+r+">"};h.prototype.compare=function(r,n,e,t,o){if(!_(r))throw new TypeError("Argument must be a Buffer");if(n===void 0&&(n=0),e===void 0&&(e=r?r.length:0),t===void 0&&(t=0),o===void 0&&(o=this.length),n<0||e>r.length||t<0||o>this.length)throw new RangeError("out of range index");if(t>=o&&n>=e)return 0;if(t>=o)return-1;if(n>=e)return 1;if(n>>>=0,e>>>=0,t>>>=0,o>>>=0,this===r)return 0;for(var u=o-t,f=e-n,c=Math.min(u,f),p=this.slice(t,o),l=r.slice(n,e),s=0;s<c;++s)if(p[s]!==l[s]){u=p[s],f=l[s];break}return u<f?-1:f<u?1:0};function $r(i,r,n,e,t){if(i.length===0)return-1;if(typeof n=="string"?(e=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=t?0:i.length-1),n<0&&(n=i.length+n),n>=i.length){if(t)return-1;n=i.length-1}else if(n<0)if(t)n=0;else return-1;if(typeof r=="string"&&(r=h.from(r,e)),_(r))return r.length===0?-1:Sr(i,r,n,e,t);if(typeof r=="number")return r=r&255,h.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?t?Uint8Array.prototype.indexOf.call(i,r,n):Uint8Array.prototype.lastIndexOf.call(i,r,n):Sr(i,[r],n,e,t);throw new TypeError("val must be string, number or Buffer")}function Sr(i,r,n,e,t){var o=1,u=i.length,f=r.length;if(e!==void 0&&(e=String(e).toLowerCase(),e==="ucs2"||e==="ucs-2"||e==="utf16le"||e==="utf-16le")){if(i.length<2||r.length<2)return-1;o=2,u/=2,f/=2,n/=2}function c(x,m){return o===1?x[m]:x.readUInt16BE(m*o)}var p;if(t){var l=-1;for(p=n;p<u;p++)if(c(i,p)===c(r,l===-1?0:p-l)){if(l===-1&&(l=p),p-l+1===f)return l*o}else l!==-1&&(p-=p-l),l=-1}else for(n+f>u&&(n=u-f),p=n;p>=0;p--){for(var s=!0,w=0;w<f;w++)if(c(i,p+w)!==c(r,w)){s=!1;break}if(s)return p}return-1}h.prototype.includes=function(r,n,e){return this.indexOf(r,n,e)!==-1};h.prototype.indexOf=function(r,n,e){return $r(this,r,n,e,!0)};h.prototype.lastIndexOf=function(r,n,e){return $r(this,r,n,e,!1)};function ai(i,r,n,e){n=Number(n)||0;var t=i.length-n;e?(e=Number(e),e>t&&(e=t)):e=t;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");e>o/2&&(e=o/2);for(var u=0;u<e;++u){var f=parseInt(r.substr(u*2,2),16);if(isNaN(f))return u;i[n+u]=f}return u}function hi(i,r,n,e){return Z(J(r,i.length-n),i,n,e)}function Wr(i,r,n,e){return Z(Ii(r),i,n,e)}function ci(i,r,n,e){return Wr(i,r,n,e)}function si(i,r,n,e){return Z(Vr(r),i,n,e)}function pi(i,r,n,e){return Z(di(r,i.length-n),i,n,e)}h.prototype.write=function(r,n,e,t){if(n===void 0)t="utf8",e=this.length,n=0;else if(e===void 0&&typeof n=="string")t=n,e=this.length,n=0;else if(isFinite(n))n=n|0,isFinite(e)?(e=e|0,t===void 0&&(t="utf8")):(t=e,e=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-n;if((e===void 0||e>o)&&(e=o),r.length>0&&(e<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");t||(t="utf8");for(var u=!1;;)switch(t){case"hex":return ai(this,r,n,e);case"utf8":case"utf-8":return hi(this,r,n,e);case"ascii":return Wr(this,r,n,e);case"latin1":case"binary":return ci(this,r,n,e);case"base64":return si(this,r,n,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pi(this,r,n,e);default:if(u)throw new TypeError("Unknown encoding: "+t);t=(""+t).toLowerCase(),u=!0}};h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function li(i,r,n){return r===0&&n===i.length?Pr(i):Pr(i.slice(r,n))}function br(i,r,n){n=Math.min(i.length,n);for(var e=[],t=r;t<n;){var o=i[t],u=null,f=o>239?4:o>223?3:o>191?2:1;if(t+f<=n){var c,p,l,s;switch(f){case 1:o<128&&(u=o);break;case 2:c=i[t+1],(c&192)===128&&(s=(o&31)<<6|c&63,s>127&&(u=s));break;case 3:c=i[t+1],p=i[t+2],(c&192)===128&&(p&192)===128&&(s=(o&15)<<12|(c&63)<<6|p&63,s>2047&&(s<55296||s>57343)&&(u=s));break;case 4:c=i[t+1],p=i[t+2],l=i[t+3],(c&192)===128&&(p&192)===128&&(l&192)===128&&(s=(o&15)<<18|(c&63)<<12|(p&63)<<6|l&63,s>65535&&s<1114112&&(u=s))}}u===null?(u=65533,f=1):u>65535&&(u-=65536,e.push(u>>>10&1023|55296),u=56320|u&1023),e.push(u),t+=f}return xi(e)}var Dr=4096;function xi(i){var r=i.length;if(r<=Dr)return String.fromCharCode.apply(String,i);for(var n="",e=0;e<r;)n+=String.fromCharCode.apply(String,i.slice(e,e+=Dr));return n}function wi(i,r,n){var e="";n=Math.min(i.length,n);for(var t=r;t<n;++t)e+=String.fromCharCode(i[t]&127);return e}function Ei(i,r,n){var e="";n=Math.min(i.length,n);for(var t=r;t<n;++t)e+=String.fromCharCode(i[t]);return e}function gi(i,r,n){var e=i.length;(!r||r<0)&&(r=0),(!n||n<0||n>e)&&(n=e);for(var t="",o=r;o<n;++o)t+=Ti(i[o]);return t}function yi(i,r,n){for(var e=i.slice(r,n),t="",o=0;o<e.length;o+=2)t+=String.fromCharCode(e[o]+e[o+1]*256);return t}h.prototype.slice=function(r,n){var e=this.length;r=~~r,n=n===void 0?e:~~n,r<0?(r+=e,r<0&&(r=0)):r>e&&(r=e),n<0?(n+=e,n<0&&(n=0)):n>e&&(n=e),n<r&&(n=r);var t;if(h.TYPED_ARRAY_SUPPORT)t=this.subarray(r,n),t.__proto__=h.prototype;else{var o=n-r;t=new h(o,void 0);for(var u=0;u<o;++u)t[u]=this[u+r]}return t};function g(i,r,n){if(i%1!==0||i<0)throw new RangeError("offset is not uint");if(i+r>n)throw new RangeError("Trying to access beyond buffer length")}h.prototype.readUIntLE=function(r,n,e){r=r|0,n=n|0,e||g(r,n,this.length);for(var t=this[r],o=1,u=0;++u<n&&(o*=256);)t+=this[r+u]*o;return t};h.prototype.readUIntBE=function(r,n,e){r=r|0,n=n|0,e||g(r,n,this.length);for(var t=this[r+--n],o=1;n>0&&(o*=256);)t+=this[r+--n]*o;return t};h.prototype.readUInt8=function(r,n){return n||g(r,1,this.length),this[r]};h.prototype.readUInt16LE=function(r,n){return n||g(r,2,this.length),this[r]|this[r+1]<<8};h.prototype.readUInt16BE=function(r,n){return n||g(r,2,this.length),this[r]<<8|this[r+1]};h.prototype.readUInt32LE=function(r,n){return n||g(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};h.prototype.readUInt32BE=function(r,n){return n||g(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};h.prototype.readIntLE=function(r,n,e){r=r|0,n=n|0,e||g(r,n,this.length);for(var t=this[r],o=1,u=0;++u<n&&(o*=256);)t+=this[r+u]*o;return o*=128,t>=o&&(t-=Math.pow(2,8*n)),t};h.prototype.readIntBE=function(r,n,e){r=r|0,n=n|0,e||g(r,n,this.length);for(var t=n,o=1,u=this[r+--t];t>0&&(o*=256);)u+=this[r+--t]*o;return o*=128,u>=o&&(u-=Math.pow(2,8*n)),u};h.prototype.readInt8=function(r,n){return n||g(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};h.prototype.readInt16LE=function(r,n){n||g(r,2,this.length);var e=this[r]|this[r+1]<<8;return e&32768?e|4294901760:e};h.prototype.readInt16BE=function(r,n){n||g(r,2,this.length);var e=this[r+1]|this[r]<<8;return e&32768?e|4294901760:e};h.prototype.readInt32LE=function(r,n){return n||g(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};h.prototype.readInt32BE=function(r,n){return n||g(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};h.prototype.readFloatLE=function(r,n){return n||g(r,4,this.length),X(this,r,!0,23,4)};h.prototype.readFloatBE=function(r,n){return n||g(r,4,this.length),X(this,r,!1,23,4)};h.prototype.readDoubleLE=function(r,n){return n||g(r,8,this.length),X(this,r,!0,52,8)};h.prototype.readDoubleBE=function(r,n){return n||g(r,8,this.length),X(this,r,!1,52,8)};function A(i,r,n,e,t,o){if(!_(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>t||r<o)throw new RangeError('"value" argument is out of bounds');if(n+e>i.length)throw new RangeError("Index out of range")}h.prototype.writeUIntLE=function(r,n,e,t){if(r=+r,n=n|0,e=e|0,!t){var o=Math.pow(2,8*e)-1;A(this,r,n,e,o,0)}var u=1,f=0;for(this[n]=r&255;++f<e&&(u*=256);)this[n+f]=r/u&255;return n+e};h.prototype.writeUIntBE=function(r,n,e,t){if(r=+r,n=n|0,e=e|0,!t){var o=Math.pow(2,8*e)-1;A(this,r,n,e,o,0)}var u=e-1,f=1;for(this[n+u]=r&255;--u>=0&&(f*=256);)this[n+u]=r/f&255;return n+e};h.prototype.writeUInt8=function(r,n,e){return r=+r,n=n|0,e||A(this,r,n,1,255,0),h.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[n]=r&255,n+1};function K(i,r,n,e){r<0&&(r=65535+r+1);for(var t=0,o=Math.min(i.length-n,2);t<o;++t)i[n+t]=(r&255<<8*(e?t:1-t))>>>(e?t:1-t)*8}h.prototype.writeUInt16LE=function(r,n,e){return r=+r,n=n|0,e||A(this,r,n,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8):K(this,r,n,!0),n+2};h.prototype.writeUInt16BE=function(r,n,e){return r=+r,n=n|0,e||A(this,r,n,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[n]=r>>>8,this[n+1]=r&255):K(this,r,n,!1),n+2};function Q(i,r,n,e){r<0&&(r=4294967295+r+1);for(var t=0,o=Math.min(i.length-n,4);t<o;++t)i[n+t]=r>>>(e?t:3-t)*8&255}h.prototype.writeUInt32LE=function(r,n,e){return r=+r,n=n|0,e||A(this,r,n,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[n+3]=r>>>24,this[n+2]=r>>>16,this[n+1]=r>>>8,this[n]=r&255):Q(this,r,n,!0),n+4};h.prototype.writeUInt32BE=function(r,n,e){return r=+r,n=n|0,e||A(this,r,n,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255):Q(this,r,n,!1),n+4};h.prototype.writeIntLE=function(r,n,e,t){if(r=+r,n=n|0,!t){var o=Math.pow(2,8*e-1);A(this,r,n,e,o-1,-o)}var u=0,f=1,c=0;for(this[n]=r&255;++u<e&&(f*=256);)r<0&&c===0&&this[n+u-1]!==0&&(c=1),this[n+u]=(r/f>>0)-c&255;return n+e};h.prototype.writeIntBE=function(r,n,e,t){if(r=+r,n=n|0,!t){var o=Math.pow(2,8*e-1);A(this,r,n,e,o-1,-o)}var u=e-1,f=1,c=0;for(this[n+u]=r&255;--u>=0&&(f*=256);)r<0&&c===0&&this[n+u+1]!==0&&(c=1),this[n+u]=(r/f>>0)-c&255;return n+e};h.prototype.writeInt8=function(r,n,e){return r=+r,n=n|0,e||A(this,r,n,1,127,-128),h.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[n]=r&255,n+1};h.prototype.writeInt16LE=function(r,n,e){return r=+r,n=n|0,e||A(this,r,n,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8):K(this,r,n,!0),n+2};h.prototype.writeInt16BE=function(r,n,e){return r=+r,n=n|0,e||A(this,r,n,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[n]=r>>>8,this[n+1]=r&255):K(this,r,n,!1),n+2};h.prototype.writeInt32LE=function(r,n,e){return r=+r,n=n|0,e||A(this,r,n,4,2147483647,-2147483648),h.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8,this[n+2]=r>>>16,this[n+3]=r>>>24):Q(this,r,n,!0),n+4};h.prototype.writeInt32BE=function(r,n,e){return r=+r,n=n|0,e||A(this,r,n,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),h.TYPED_ARRAY_SUPPORT?(this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255):Q(this,r,n,!1),n+4};function zr(i,r,n,e,t,o){if(n+e>i.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Or(i,r,n,e,t){return t||zr(i,r,n,4),kr(i,r,n,e,23,4),n+4}h.prototype.writeFloatLE=function(r,n,e){return Or(this,r,n,!0,e)};h.prototype.writeFloatBE=function(r,n,e){return Or(this,r,n,!1,e)};function Gr(i,r,n,e,t){return t||zr(i,r,n,8),kr(i,r,n,e,52,8),n+8}h.prototype.writeDoubleLE=function(r,n,e){return Gr(this,r,n,!0,e)};h.prototype.writeDoubleBE=function(r,n,e){return Gr(this,r,n,!1,e)};h.prototype.copy=function(r,n,e,t){if(e||(e=0),!t&&t!==0&&(t=this.length),n>=r.length&&(n=r.length),n||(n=0),t>0&&t<e&&(t=e),t===e||r.length===0||this.length===0)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(t<0)throw new RangeError("sourceEnd out of bounds");t>this.length&&(t=this.length),r.length-n<t-e&&(t=r.length-n+e);var o=t-e,u;if(this===r&&e<n&&n<t)for(u=o-1;u>=0;--u)r[u+n]=this[u+e];else if(o<1e3||!h.TYPED_ARRAY_SUPPORT)for(u=0;u<o;++u)r[u+n]=this[u+e];else Uint8Array.prototype.set.call(r,this.subarray(e,e+o),n);return o};h.prototype.fill=function(r,n,e,t){if(typeof r=="string"){if(typeof n=="string"?(t=n,n=0,e=this.length):typeof e=="string"&&(t=e,e=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(t!==void 0&&typeof t!="string")throw new TypeError("encoding must be a string");if(typeof t=="string"&&!h.isEncoding(t))throw new TypeError("Unknown encoding: "+t)}else typeof r=="number"&&(r=r&255);if(n<0||this.length<n||this.length<e)throw new RangeError("Out of range index");if(e<=n)return this;n=n>>>0,e=e===void 0?this.length:e>>>0,r||(r=0);var u;if(typeof r=="number")for(u=n;u<e;++u)this[u]=r;else{var f=_(r)?r:J(new h(r,t).toString()),c=f.length;for(u=0;u<e-n;++u)this[u+n]=f[u%c]}return this};var Ai=/[^+\/0-9A-Za-z-_]/g;function mi(i){if(i=Ui(i).replace(Ai,""),i.length<2)return"";for(;i.length%4!==0;)i=i+"=";return i}function Ui(i){return i.trim?i.trim():i.replace(/^\s+|\s+$/g,"")}function Ti(i){return i<16?"0"+i.toString(16):i.toString(16)}function J(i,r){r=r||1/0;for(var n,e=i.length,t=null,o=[],u=0;u<e;++u){if(n=i.charCodeAt(u),n>55295&&n<57344){if(!t){if(n>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(u+1===e){(r-=3)>-1&&o.push(239,191,189);continue}t=n;continue}if(n<56320){(r-=3)>-1&&o.push(239,191,189),t=n;continue}n=(t-55296<<10|n-56320)+65536}else t&&(r-=3)>-1&&o.push(239,191,189);if(t=null,n<128){if((r-=1)<0)break;o.push(n)}else if(n<2048){if((r-=2)<0)break;o.push(n>>6|192,n&63|128)}else if(n<65536){if((r-=3)<0)break;o.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((r-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return o}function Ii(i){for(var r=[],n=0;n<i.length;++n)r.push(i.charCodeAt(n)&255);return r}function di(i,r){for(var n,e,t,o=[],u=0;u<i.length&&!((r-=2)<0);++u)n=i.charCodeAt(u),e=n>>8,t=n%256,o.push(t),o.push(e);return o}function Vr(i){return qn(mi(i))}function Z(i,r,n,e){for(var t=0;t<e&&!(t+n>=r.length||t>=i.length);++t)r[t+n]=i[t];return t}function Ri(i){return i!==i}function _i(i){return i!=null&&(!!i._isBuffer||Hr(i)||Bi(i))}function Hr(i){return!!i.constructor&&typeof i.constructor.isBuffer=="function"&&i.constructor.isBuffer(i)}function Bi(i){return typeof i.readFloatLE=="function"&&typeof i.slice=="function"&&Hr(i.slice(0,0))}import{encodeAddress as Ki,decodeAddress as Qi}from"algosdk";function Jr(i){return new Uint8Array(h.from(i))}function ji(i){return Jr(i)}function Fi(i,r,n){return fr.makePaymentTxnWithSuggestedParamsFromObject({from:i,to:i,amount:0,note:r&&new Uint8Array(a.from(r,n)),suggestedParams:{fee:0,firstRound:1,lastRound:2,genesisHash:"SGO1GKSzyE7IEPItTxCByw9x8FmnrCDexi9/cOUJOiI=",genesisID:"testnet-v1.0"}})}function re(i,r,n,e){return vi(Fi(i,r,n),e)}async function vi(i,r){let n=fr.encodeUnsignedTransaction(i),e=await r([n]),t=fr.decodeSignedTransaction(e[0]);return new Uint8Array(t.sig)}export{ji as encodeMessage,Fi as generateTxnForSign,re as signTxn};
|
|
2
|
+
/*!
|
|
3
|
+
* The buffer module from node.js, for the browser.
|
|
4
|
+
*
|
|
5
|
+
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
6
|
+
* @license MIT
|
|
7
|
+
*/
|
|
8
|
+
/*! Bundled license information:
|
|
9
|
+
|
|
10
|
+
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
11
|
+
(*!
|
|
12
|
+
* The buffer module from node.js, for the browser.
|
|
13
|
+
*
|
|
14
|
+
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
15
|
+
* @license MIT
|
|
16
|
+
*)
|
|
17
|
+
*/
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function W(){throw new Error("setTimeout has not been defined")}function q(){throw new Error("clearTimeout has not been defined")}var U=W,d=q;typeof globalThis.setTimeout=="function"&&(U=setTimeout);typeof globalThis.clearTimeout=="function"&&(d=clearTimeout);function X(i){if(U===setTimeout)return setTimeout(i,0);if((U===W||!U)&&setTimeout)return U=setTimeout,setTimeout(i,0);try{return U(i,0)}catch{try{return U.call(null,i,0)}catch{return U.call(this,i,0)}}}function mr(i){if(d===clearTimeout)return clearTimeout(i);if((d===q||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(i);try{return d(i)}catch{try{return d.call(null,i)}catch{return d.call(this,i)}}}var R=[],P=!1,I,N=-1;function Er(){!P||!I||(P=!1,I.length?R=I.concat(R):N=-1,R.length&&Z())}function Z(){if(!P){var i=X(Er);P=!0;for(var r=R.length;r;){for(I=R,R=[];++N<r;)I&&I[N].run();N=-1,r=R.length}I=null,P=!1,mr(i)}}function Ar(i){var r=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)r[n-1]=arguments[n];R.push(new z(i,r)),R.length===1&&!P&&X(Z)}function z(i,r){this.fun=i,this.array=r}z.prototype.run=function(){this.fun.apply(null,this.array)};var Tr="browser",yr="browser",Rr=!0,_r={},Ur=[],dr="",Ir={},vr={},Sr={};function v(){}var Br=v,br=v,Pr=v,Nr=v,Mr=v,Dr=v,Yr=v;function Lr(i){throw new Error("process.binding is not supported")}function Cr(){return"/"}function kr(i){throw new Error("process.chdir is not supported")}function Fr(){return 0}var b=globalThis.performance||{},Or=b.now||b.mozNow||b.msNow||b.oNow||b.webkitNow||function(){return new Date().getTime()};function Hr(i){var r=Or.call(b)*.001,n=Math.floor(r),e=Math.floor(r%1*1e9);return i&&(n=n-i[0],e=e-i[1],e<0&&(n--,e+=1e9)),[n,e]}var Gr=new Date;function Qr(){var i=new Date,r=i-Gr;return r/1e3}var F={nextTick:Ar,title:Tr,browser:Rr,env:_r,argv:Ur,version:dr,versions:Ir,on:Br,addListener:br,once:Pr,off:Nr,removeListener:Mr,removeAllListeners:Dr,emit:Yr,binding:Lr,cwd:Cr,chdir:kr,umask:Fr,hrtime:Hr,platform:yr,release:vr,config:Sr,uptime:Qr},V={};Object.keys(V).forEach(i=>{let r=i.split("."),n=F;for(let e=0;e<r.length;e++){let t=r[e];e===r.length-1?n[t]=V[i]:n=n[t]||(n[t]={})}});var A=[],g=[],Vr=typeof Uint8Array<"u"?Uint8Array:Array,H=!1;function j(){H=!0;for(var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,n=i.length;r<n;++r)A[r]=i[r],g[i.charCodeAt(r)]=r;g[45]=62,g[95]=63}function Wr(i){H||j();var r,n,e,t,o,u,a=i.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=i[a-2]==="="?2:i[a-1]==="="?1:0,u=new Vr(a*3/4-o),e=o>0?a-4:a;var c=0;for(r=0,n=0;r<e;r+=4,n+=3)t=g[i.charCodeAt(r)]<<18|g[i.charCodeAt(r+1)]<<12|g[i.charCodeAt(r+2)]<<6|g[i.charCodeAt(r+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=t&255;return o===2?(t=g[i.charCodeAt(r)]<<2|g[i.charCodeAt(r+1)]>>4,u[c++]=t&255):o===1&&(t=g[i.charCodeAt(r)]<<10|g[i.charCodeAt(r+1)]<<4|g[i.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=t&255),u}function qr(i){return A[i>>18&63]+A[i>>12&63]+A[i>>6&63]+A[i&63]}function Xr(i,r,n){for(var e,t=[],o=r;o<n;o+=3)e=(i[o]<<16)+(i[o+1]<<8)+i[o+2],t.push(qr(e));return t.join("")}function J(i){H||j();for(var r,n=i.length,e=n%3,t="",o=[],u=16383,a=0,c=n-e;a<c;a+=u)o.push(Xr(i,a,a+u>c?c:a+u));return e===1?(r=i[n-1],t+=A[r>>2],t+=A[r<<4&63],t+="=="):e===2&&(r=(i[n-2]<<8)+i[n-1],t+=A[r>>10],t+=A[r>>4&63],t+=A[r<<2&63],t+="="),o.push(t),o.join("")}f.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function M(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function _(i,r){if(M()<r)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(i=new Uint8Array(r),i.__proto__=f.prototype):(i===null&&(i=new f(r)),i.length=r),i}function f(i,r,n){if(!f.TYPED_ARRAY_SUPPORT&&!(this instanceof f))return new f(i,r,n);if(typeof i=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return G(this,i)}return rr(this,i,r,n)}f.poolSize=8192;f._augment=function(i){return i.__proto__=f.prototype,i};function rr(i,r,n,e){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Jr(i,r,n,e):typeof r=="string"?zr(i,r,n):$r(i,r)}f.from=function(i,r,n){return rr(null,i,r,n)};f.kMaxLength=M();f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&f[Symbol.species]);function nr(i){if(typeof i!="number")throw new TypeError('"size" argument must be a number');if(i<0)throw new RangeError('"size" argument must not be negative')}function Zr(i,r,n,e){return nr(r),r<=0?_(i,r):n!==void 0?typeof e=="string"?_(i,r).fill(n,e):_(i,r).fill(n):_(i,r)}f.alloc=function(i,r,n){return Zr(null,i,r,n)};function G(i,r){if(nr(r),i=_(i,r<0?0:Q(r)|0),!f.TYPED_ARRAY_SUPPORT)for(var n=0;n<r;++n)i[n]=0;return i}f.allocUnsafe=function(i){return G(null,i)};f.allocUnsafeSlow=function(i){return G(null,i)};function zr(i,r,n){if((typeof n!="string"||n==="")&&(n="utf8"),!f.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var e=ir(r,n)|0;i=_(i,e);var t=i.write(r,n);return t!==e&&(i=i.slice(0,t)),i}function O(i,r){var n=r.length<0?0:Q(r.length)|0;i=_(i,n);for(var e=0;e<n;e+=1)i[e]=r[e]&255;return i}function Jr(i,r,n,e){if(r.byteLength,n<0||r.byteLength<n)throw new RangeError("'offset' is out of bounds");if(r.byteLength<n+(e||0))throw new RangeError("'length' is out of bounds");return n===void 0&&e===void 0?r=new Uint8Array(r):e===void 0?r=new Uint8Array(r,n):r=new Uint8Array(r,n,e),f.TYPED_ARRAY_SUPPORT?(i=r,i.__proto__=f.prototype):i=O(i,r),i}function $r(i,r){if(T(r)){var n=Q(r.length)|0;return i=_(i,n),i.length===0||r.copy(i,0,0,n),i}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||mn(r.length)?_(i,0):O(i,r);if(r.type==="Buffer"&&Array.isArray(r.data))return O(i,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Q(i){if(i>=M())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+M().toString(16)+" bytes");return i|0}f.isBuffer=En;function T(i){return!!(i!=null&&i._isBuffer)}f.compare=function(r,n){if(!T(r)||!T(n))throw new TypeError("Arguments must be Buffers");if(r===n)return 0;for(var e=r.length,t=n.length,o=0,u=Math.min(e,t);o<u;++o)if(r[o]!==n[o]){e=r[o],t=n[o];break}return e<t?-1:t<e?1:0};f.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};f.concat=function(r,n){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return f.alloc(0);var e;if(n===void 0)for(n=0,e=0;e<r.length;++e)n+=r[e].length;var t=f.allocUnsafe(n),o=0;for(e=0;e<r.length;++e){var u=r[e];if(!T(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(t,o),o+=u.length}return t};function ir(i,r){if(T(i))return i.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(i)||i instanceof ArrayBuffer))return i.byteLength;typeof i!="string"&&(i=""+i);var n=i.length;if(n===0)return 0;for(var e=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return D(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return cr(i).length;default:if(e)return D(i).length;r=(""+r).toLowerCase(),e=!0}}f.byteLength=ir;function Kr(i,r,n){var e=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,r>>>=0,n<=r))return"";for(i||(i="utf8");;)switch(i){case"hex":return cn(this,r,n);case"utf8":case"utf-8":return or(this,r,n);case"ascii":return fn(this,r,n);case"latin1":case"binary":return an(this,r,n);case"base64":return on(this,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return hn(this,r,n);default:if(e)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),e=!0}}f.prototype._isBuffer=!0;function S(i,r,n){var e=i[r];i[r]=i[n],i[n]=e}f.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var n=0;n<r;n+=2)S(this,n,n+1);return this};f.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var n=0;n<r;n+=4)S(this,n,n+3),S(this,n+1,n+2);return this};f.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var n=0;n<r;n+=8)S(this,n,n+7),S(this,n+1,n+6),S(this,n+2,n+5),S(this,n+3,n+4);return this};f.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?or(this,0,r):Kr.apply(this,arguments)};f.prototype.equals=function(r){if(!T(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:f.compare(this,r)===0};f.prototype.compare=function(r,n,e,t,o){if(!T(r))throw new TypeError("Argument must be a Buffer");if(n===void 0&&(n=0),e===void 0&&(e=r?r.length:0),t===void 0&&(t=0),o===void 0&&(o=this.length),n<0||e>r.length||t<0||o>this.length)throw new RangeError("out of range index");if(t>=o&&n>=e)return 0;if(t>=o)return-1;if(n>=e)return 1;if(n>>>=0,e>>>=0,t>>>=0,o>>>=0,this===r)return 0;for(var u=o-t,a=e-n,c=Math.min(u,a),l=this.slice(t,o),h=r.slice(n,e),s=0;s<c;++s)if(l[s]!==h[s]){u=l[s],a=h[s];break}return u<a?-1:a<u?1:0};function er(i,r,n,e,t){if(i.length===0)return-1;if(typeof n=="string"?(e=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=t?0:i.length-1),n<0&&(n=i.length+n),n>=i.length){if(t)return-1;n=i.length-1}else if(n<0)if(t)n=0;else return-1;if(typeof r=="string"&&(r=f.from(r,e)),T(r))return r.length===0?-1:$(i,r,n,e,t);if(typeof r=="number")return r=r&255,f.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?t?Uint8Array.prototype.indexOf.call(i,r,n):Uint8Array.prototype.lastIndexOf.call(i,r,n):$(i,[r],n,e,t);throw new TypeError("val must be string, number or Buffer")}function $(i,r,n,e,t){var o=1,u=i.length,a=r.length;if(e!==void 0&&(e=String(e).toLowerCase(),e==="ucs2"||e==="ucs-2"||e==="utf16le"||e==="utf-16le")){if(i.length<2||r.length<2)return-1;o=2,u/=2,a/=2,n/=2}function c(w,B){return o===1?w[B]:w.readUInt16BE(B*o)}var l;if(t){var h=-1;for(l=n;l<u;l++)if(c(i,l)===c(r,h===-1?0:l-h)){if(h===-1&&(h=l),l-h+1===a)return h*o}else h!==-1&&(l-=l-h),h=-1}else for(n+a>u&&(n=u-a),l=n;l>=0;l--){for(var s=!0,E=0;E<a;E++)if(c(i,l+E)!==c(r,E)){s=!1;break}if(s)return l}return-1}f.prototype.includes=function(r,n,e){return this.indexOf(r,n,e)!==-1};f.prototype.indexOf=function(r,n,e){return er(this,r,n,e,!0)};f.prototype.lastIndexOf=function(r,n,e){return er(this,r,n,e,!1)};function jr(i,r,n,e){n=Number(n)||0;var t=i.length-n;e?(e=Number(e),e>t&&(e=t)):e=t;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");e>o/2&&(e=o/2);for(var u=0;u<e;++u){var a=parseInt(r.substr(u*2,2),16);if(isNaN(a))return u;i[n+u]=a}return u}function rn(i,r,n,e){return C(D(r,i.length-n),i,n,e)}function tr(i,r,n,e){return C(wn(r),i,n,e)}function nn(i,r,n,e){return tr(i,r,n,e)}function en(i,r,n,e){return C(cr(r),i,n,e)}function tn(i,r,n,e){return C(gn(r,i.length-n),i,n,e)}f.prototype.write=function(r,n,e,t){if(n===void 0)t="utf8",e=this.length,n=0;else if(e===void 0&&typeof n=="string")t=n,e=this.length,n=0;else if(isFinite(n))n=n|0,isFinite(e)?(e=e|0,t===void 0&&(t="utf8")):(t=e,e=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-n;if((e===void 0||e>o)&&(e=o),r.length>0&&(e<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");t||(t="utf8");for(var u=!1;;)switch(t){case"hex":return jr(this,r,n,e);case"utf8":case"utf-8":return rn(this,r,n,e);case"ascii":return tr(this,r,n,e);case"latin1":case"binary":return nn(this,r,n,e);case"base64":return en(this,r,n,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return tn(this,r,n,e);default:if(u)throw new TypeError("Unknown encoding: "+t);t=(""+t).toLowerCase(),u=!0}};f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function on(i,r,n){return r===0&&n===i.length?J(i):J(i.slice(r,n))}function or(i,r,n){n=Math.min(i.length,n);for(var e=[],t=r;t<n;){var o=i[t],u=null,a=o>239?4:o>223?3:o>191?2:1;if(t+a<=n){var c,l,h,s;switch(a){case 1:o<128&&(u=o);break;case 2:c=i[t+1],(c&192)===128&&(s=(o&31)<<6|c&63,s>127&&(u=s));break;case 3:c=i[t+1],l=i[t+2],(c&192)===128&&(l&192)===128&&(s=(o&15)<<12|(c&63)<<6|l&63,s>2047&&(s<55296||s>57343)&&(u=s));break;case 4:c=i[t+1],l=i[t+2],h=i[t+3],(c&192)===128&&(l&192)===128&&(h&192)===128&&(s=(o&15)<<18|(c&63)<<12|(l&63)<<6|h&63,s>65535&&s<1114112&&(u=s))}}u===null?(u=65533,a=1):u>65535&&(u-=65536,e.push(u>>>10&1023|55296),u=56320|u&1023),e.push(u),t+=a}return un(e)}var K=4096;function un(i){var r=i.length;if(r<=K)return String.fromCharCode.apply(String,i);for(var n="",e=0;e<r;)n+=String.fromCharCode.apply(String,i.slice(e,e+=K));return n}function fn(i,r,n){var e="";n=Math.min(i.length,n);for(var t=r;t<n;++t)e+=String.fromCharCode(i[t]&127);return e}function an(i,r,n){var e="";n=Math.min(i.length,n);for(var t=r;t<n;++t)e+=String.fromCharCode(i[t]);return e}function cn(i,r,n){var e=i.length;(!r||r<0)&&(r=0),(!n||n<0||n>e)&&(n=e);for(var t="",o=r;o<n;++o)t+=xn(i[o]);return t}function hn(i,r,n){for(var e=i.slice(r,n),t="",o=0;o<e.length;o+=2)t+=String.fromCharCode(e[o]+e[o+1]*256);return t}f.prototype.slice=function(r,n){var e=this.length;r=~~r,n=n===void 0?e:~~n,r<0?(r+=e,r<0&&(r=0)):r>e&&(r=e),n<0?(n+=e,n<0&&(n=0)):n>e&&(n=e),n<r&&(n=r);var t;if(f.TYPED_ARRAY_SUPPORT)t=this.subarray(r,n),t.__proto__=f.prototype;else{var o=n-r;t=new f(o,void 0);for(var u=0;u<o;++u)t[u]=this[u+r]}return t};function p(i,r,n){if(i%1!==0||i<0)throw new RangeError("offset is not uint");if(i+r>n)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function(r,n,e){r=r|0,n=n|0,e||p(r,n,this.length);for(var t=this[r],o=1,u=0;++u<n&&(o*=256);)t+=this[r+u]*o;return t};f.prototype.readUIntBE=function(r,n,e){r=r|0,n=n|0,e||p(r,n,this.length);for(var t=this[r+--n],o=1;n>0&&(o*=256);)t+=this[r+--n]*o;return t};f.prototype.readUInt8=function(r,n){return n||p(r,1,this.length),this[r]};f.prototype.readUInt16LE=function(r,n){return n||p(r,2,this.length),this[r]|this[r+1]<<8};f.prototype.readUInt16BE=function(r,n){return n||p(r,2,this.length),this[r]<<8|this[r+1]};f.prototype.readUInt32LE=function(r,n){return n||p(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};f.prototype.readUInt32BE=function(r,n){return n||p(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};f.prototype.readIntLE=function(r,n,e){r=r|0,n=n|0,e||p(r,n,this.length);for(var t=this[r],o=1,u=0;++u<n&&(o*=256);)t+=this[r+u]*o;return o*=128,t>=o&&(t-=Math.pow(2,8*n)),t};f.prototype.readIntBE=function(r,n,e){r=r|0,n=n|0,e||p(r,n,this.length);for(var t=n,o=1,u=this[r+--t];t>0&&(o*=256);)u+=this[r+--t]*o;return o*=128,u>=o&&(u-=Math.pow(2,8*n)),u};f.prototype.readInt8=function(r,n){return n||p(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};f.prototype.readInt16LE=function(r,n){n||p(r,2,this.length);var e=this[r]|this[r+1]<<8;return e&32768?e|4294901760:e};f.prototype.readInt16BE=function(r,n){n||p(r,2,this.length);var e=this[r+1]|this[r]<<8;return e&32768?e|4294901760:e};f.prototype.readInt32LE=function(r,n){return n||p(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};f.prototype.readInt32BE=function(r,n){return n||p(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};f.prototype.readFloatLE=function(r,n){return n||p(r,4,this.length),k(this,r,!0,23,4)};f.prototype.readFloatBE=function(r,n){return n||p(r,4,this.length),k(this,r,!1,23,4)};f.prototype.readDoubleLE=function(r,n){return n||p(r,8,this.length),k(this,r,!0,52,8)};f.prototype.readDoubleBE=function(r,n){return n||p(r,8,this.length),k(this,r,!1,52,8)};function x(i,r,n,e,t,o){if(!T(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>t||r<o)throw new RangeError('"value" argument is out of bounds');if(n+e>i.length)throw new RangeError("Index out of range")}f.prototype.writeUIntLE=function(r,n,e,t){if(r=+r,n=n|0,e=e|0,!t){var o=Math.pow(2,8*e)-1;x(this,r,n,e,o,0)}var u=1,a=0;for(this[n]=r&255;++a<e&&(u*=256);)this[n+a]=r/u&255;return n+e};f.prototype.writeUIntBE=function(r,n,e,t){if(r=+r,n=n|0,e=e|0,!t){var o=Math.pow(2,8*e)-1;x(this,r,n,e,o,0)}var u=e-1,a=1;for(this[n+u]=r&255;--u>=0&&(a*=256);)this[n+u]=r/a&255;return n+e};f.prototype.writeUInt8=function(r,n,e){return r=+r,n=n|0,e||x(this,r,n,1,255,0),f.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[n]=r&255,n+1};function Y(i,r,n,e){r<0&&(r=65535+r+1);for(var t=0,o=Math.min(i.length-n,2);t<o;++t)i[n+t]=(r&255<<8*(e?t:1-t))>>>(e?t:1-t)*8}f.prototype.writeUInt16LE=function(r,n,e){return r=+r,n=n|0,e||x(this,r,n,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8):Y(this,r,n,!0),n+2};f.prototype.writeUInt16BE=function(r,n,e){return r=+r,n=n|0,e||x(this,r,n,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[n]=r>>>8,this[n+1]=r&255):Y(this,r,n,!1),n+2};function L(i,r,n,e){r<0&&(r=4294967295+r+1);for(var t=0,o=Math.min(i.length-n,4);t<o;++t)i[n+t]=r>>>(e?t:3-t)*8&255}f.prototype.writeUInt32LE=function(r,n,e){return r=+r,n=n|0,e||x(this,r,n,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[n+3]=r>>>24,this[n+2]=r>>>16,this[n+1]=r>>>8,this[n]=r&255):L(this,r,n,!0),n+4};f.prototype.writeUInt32BE=function(r,n,e){return r=+r,n=n|0,e||x(this,r,n,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255):L(this,r,n,!1),n+4};f.prototype.writeIntLE=function(r,n,e,t){if(r=+r,n=n|0,!t){var o=Math.pow(2,8*e-1);x(this,r,n,e,o-1,-o)}var u=0,a=1,c=0;for(this[n]=r&255;++u<e&&(a*=256);)r<0&&c===0&&this[n+u-1]!==0&&(c=1),this[n+u]=(r/a>>0)-c&255;return n+e};f.prototype.writeIntBE=function(r,n,e,t){if(r=+r,n=n|0,!t){var o=Math.pow(2,8*e-1);x(this,r,n,e,o-1,-o)}var u=e-1,a=1,c=0;for(this[n+u]=r&255;--u>=0&&(a*=256);)r<0&&c===0&&this[n+u+1]!==0&&(c=1),this[n+u]=(r/a>>0)-c&255;return n+e};f.prototype.writeInt8=function(r,n,e){return r=+r,n=n|0,e||x(this,r,n,1,127,-128),f.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[n]=r&255,n+1};f.prototype.writeInt16LE=function(r,n,e){return r=+r,n=n|0,e||x(this,r,n,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8):Y(this,r,n,!0),n+2};f.prototype.writeInt16BE=function(r,n,e){return r=+r,n=n|0,e||x(this,r,n,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[n]=r>>>8,this[n+1]=r&255):Y(this,r,n,!1),n+2};f.prototype.writeInt32LE=function(r,n,e){return r=+r,n=n|0,e||x(this,r,n,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8,this[n+2]=r>>>16,this[n+3]=r>>>24):L(this,r,n,!0),n+4};f.prototype.writeInt32BE=function(r,n,e){return r=+r,n=n|0,e||x(this,r,n,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),f.TYPED_ARRAY_SUPPORT?(this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255):L(this,r,n,!1),n+4};function ur(i,r,n,e,t,o){if(n+e>i.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function fr(i,r,n,e,t){return t||ur(i,r,n,4,34028234663852886e22,-34028234663852886e22),sr(i,r,n,e,23,4),n+4}f.prototype.writeFloatLE=function(r,n,e){return fr(this,r,n,!0,e)};f.prototype.writeFloatBE=function(r,n,e){return fr(this,r,n,!1,e)};function ar(i,r,n,e,t){return t||ur(i,r,n,8,17976931348623157e292,-17976931348623157e292),sr(i,r,n,e,52,8),n+8}f.prototype.writeDoubleLE=function(r,n,e){return ar(this,r,n,!0,e)};f.prototype.writeDoubleBE=function(r,n,e){return ar(this,r,n,!1,e)};f.prototype.copy=function(r,n,e,t){if(e||(e=0),!t&&t!==0&&(t=this.length),n>=r.length&&(n=r.length),n||(n=0),t>0&&t<e&&(t=e),t===e||r.length===0||this.length===0)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(t<0)throw new RangeError("sourceEnd out of bounds");t>this.length&&(t=this.length),r.length-n<t-e&&(t=r.length-n+e);var o=t-e,u;if(this===r&&e<n&&n<t)for(u=o-1;u>=0;--u)r[u+n]=this[u+e];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(u=0;u<o;++u)r[u+n]=this[u+e];else Uint8Array.prototype.set.call(r,this.subarray(e,e+o),n);return o};f.prototype.fill=function(r,n,e,t){if(typeof r=="string"){if(typeof n=="string"?(t=n,n=0,e=this.length):typeof e=="string"&&(t=e,e=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(t!==void 0&&typeof t!="string")throw new TypeError("encoding must be a string");if(typeof t=="string"&&!f.isEncoding(t))throw new TypeError("Unknown encoding: "+t)}else typeof r=="number"&&(r=r&255);if(n<0||this.length<n||this.length<e)throw new RangeError("Out of range index");if(e<=n)return this;n=n>>>0,e=e===void 0?this.length:e>>>0,r||(r=0);var u;if(typeof r=="number")for(u=n;u<e;++u)this[u]=r;else{var a=T(r)?r:D(new f(r,t).toString()),c=a.length;for(u=0;u<e-n;++u)this[u+n]=a[u%c]}return this};var sn=/[^+\/0-9A-Za-z-_]/g;function ln(i){if(i=pn(i).replace(sn,""),i.length<2)return"";for(;i.length%4!==0;)i=i+"=";return i}function pn(i){return i.trim?i.trim():i.replace(/^\s+|\s+$/g,"")}function xn(i){return i<16?"0"+i.toString(16):i.toString(16)}function D(i,r){r=r||1/0;for(var n,e=i.length,t=null,o=[],u=0;u<e;++u){if(n=i.charCodeAt(u),n>55295&&n<57344){if(!t){if(n>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(u+1===e){(r-=3)>-1&&o.push(239,191,189);continue}t=n;continue}if(n<56320){(r-=3)>-1&&o.push(239,191,189),t=n;continue}n=(t-55296<<10|n-56320)+65536}else t&&(r-=3)>-1&&o.push(239,191,189);if(t=null,n<128){if((r-=1)<0)break;o.push(n)}else if(n<2048){if((r-=2)<0)break;o.push(n>>6|192,n&63|128)}else if(n<65536){if((r-=3)<0)break;o.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((r-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return o}function wn(i){for(var r=[],n=0;n<i.length;++n)r.push(i.charCodeAt(n)&255);return r}function gn(i,r){for(var n,e,t,o=[],u=0;u<i.length&&!((r-=2)<0);++u)n=i.charCodeAt(u),e=n>>8,t=n%256,o.push(t),o.push(e);return o}function cr(i){return Wr(ln(i))}function C(i,r,n,e){for(var t=0;t<e&&!(t+n>=r.length||t>=i.length);++t)r[t+n]=i[t];return t}function mn(i){return i!==i}function En(i){return i!=null&&(!!i._isBuffer||hr(i)||An(i))}function hr(i){return!!i.constructor&&typeof i.constructor.isBuffer=="function"&&i.constructor.isBuffer(i)}function An(i){return typeof i.readFloatLE=="function"&&typeof i.slice=="function"&&hr(i.slice(0,0))}function k(i,r,n,e,t){var o,u,a=t*8-e-1,c=(1<<a)-1,l=c>>1,h=-7,s=n?t-1:0,E=n?-1:1,w=i[r+s];for(s+=E,o=w&(1<<-h)-1,w>>=-h,h+=a;h>0;o=o*256+i[r+s],s+=E,h-=8);for(u=o&(1<<-h)-1,o>>=-h,h+=e;h>0;u=u*256+i[r+s],s+=E,h-=8);if(o===0)o=1-l;else{if(o===c)return u?NaN:(w?-1:1)*(1/0);u=u+Math.pow(2,e),o=o-l}return(w?-1:1)*u*Math.pow(2,o-e)}function sr(i,r,n,e,t,o){var u,a,c,l=o*8-t-1,h=(1<<l)-1,s=h>>1,E=t===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=e?0:o-1,B=e?1:-1,gr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,u=h):(u=Math.floor(Math.log(r)/Math.LN2),r*(c=Math.pow(2,-u))<1&&(u--,c*=2),u+s>=1?r+=E/c:r+=E*Math.pow(2,1-s),r*c>=2&&(u++,c/=2),u+s>=h?(a=0,u=h):u+s>=1?(a=(r*c-1)*Math.pow(2,t),u=u+s):(a=r*Math.pow(2,s-1)*Math.pow(2,t),u=0));t>=8;i[n+w]=a&255,w+=B,a/=256,t-=8);for(u=u<<t|a,l+=t;l>0;i[n+w]=u&255,w+=B,u/=256,l-=8);i[n+w-B]|=gr*128}import m from"bignumber.js";m.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});var Tn=(h=>(h.MINUS="-",h.PLUS="+",h.MULTIPLY="*",h.DIVIDE="/",h.GREATER_THAN_OR_EQUAL=">=",h.GREATER_THAN=">",h.LESS_THAN_OR_EQUAL="<=",h.LESS_THAN="<",h.EQUAL="==",h.MOD="mod",h))(Tn||{});function bn(i){return new m(i).abs().toString()}function Pn(i){let n=new m(String(i)).integerValue(m.ROUND_CEIL).toString();return xr(i,n)||console.log("Ceil value",{value:i,res:n}),n}function Nn(i,r,n=!1){let e=new m(String(i)),t;if(n){let o=e.toFixed(),u=o.indexOf(".");if(u>=0){let a=o.slice(u+1),c=0;for(let h of a)if(h==="0")c++;else break;let l=c+1;t=e.toFixed(l,m.ROUND_UP)}else t=e.toFixed(0)}else t=e.toFixed(r);return console.log("Fixed value",{value:i,res:t}),t}function Mn(i){let n=new m(String(i)).integerValue(m.ROUND_FLOOR).toString();return console.log("Floor value",{value:i,res:n}),n}function Dn(i){let n=new m(String(i)).integerValue(m.ROUND_HALF_UP).toString();return console.log("Round value",{value:i,res:n}),n}function Yn(i,r){return y(i,r,"+")}function Ln(i,r){return y(i,r,"-")}function yn(i,r){return y(i,r,"*")}function Cn(i,r){return yn(i,r||0)}function kn(i,r){return y(i,r,"/")}function Fn(i,r){return!!y(i,r,">=")}function On(i,r){return!!y(i,r,">")}function Hn(i,r){return!!y(i,r,"<=")}function Gn(i,r){return!!y(i,r,"<")}function xr(i,r){return!!y(i,r,"==")}function Rn(i,r){return y(i,r,"mod")}function Qn(i,r){return xr(Rn(i,r),0)}function y(i,r,n){switch(i=new m(String(i)),r=new m(String(r)),n.toLowerCase()){case"-":return i.minus(r).toString();case"+":return i.plus(r).toString();case"*":case"x":return i.multipliedBy(r).toString();case"\xF7":case"/":return i.dividedBy(r).toString();case">=":return i.isGreaterThanOrEqualTo(r);case">":return i.isGreaterThan(r);case"<=":return i.isLessThanOrEqualTo(r);case"<":return i.isLessThan(r);case"==":return i.isEqualTo(r);case"mod":return i.modulo(r);default:break}}function lr(i){if(i.toString().includes("e")){let r=i.toString().split("e");return[parseFloat(r[0]),parseFloat(r[1])]}return[i,0]}function pr(i,r){return i+(r<0?`e${r}`:`e+${r}`)}function wr({decimalPlaces:i=0},r){if(i>0){let[n,e]=lr(r),[t,o]=lr(Math.round(Number(pr(n,e+i))));return Number(pr(t,o-i))}return Math.round(r)}function Vn(i,r){let n=Number(i);return wr({decimalPlaces:n},Math.pow(10,-n)*Number(r))}function Wn(i,r){let n=Math.pow(10,Number(i))*Number(r);return wr({decimalPlaces:0},n)}export{Tn as Operations,bn as absolute,y as bn_operation,Pn as ceil,Vn as convertFromBaseUnits,Wn as convertToBaseUnits,kn as divide,xr as equal,Mn as floor,On as greaterThan,Fn as greaterThanOrEqual,Gn as lessThan,Hn as lessThanOrEqual,Ln as minus,Rn as mod,Qn as modZero,yn as multiply,Yn as plus,Dn as round,wr as roundNumber,Nn as toFixed,Cn as toUsd};
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
5
|
+
(*!
|
|
6
|
+
* The buffer module from node.js, for the browser.
|
|
7
|
+
*
|
|
8
|
+
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
9
|
+
* @license MIT
|
|
10
|
+
*)
|
|
11
|
+
*/
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
function lr(){throw new Error("setTimeout has not been defined")}function xr(){throw new Error("clearTimeout has not been defined")}var B=lr,L=xr;typeof globalThis.setTimeout=="function"&&(B=setTimeout);typeof globalThis.clearTimeout=="function"&&(L=clearTimeout);function mr(t){if(B===setTimeout)return setTimeout(t,0);if((B===lr||!B)&&setTimeout)return B=setTimeout,setTimeout(t,0);try{return B(t,0)}catch{try{return B.call(null,t,0)}catch{return B.call(this,t,0)}}}function he(t){if(L===clearTimeout)return clearTimeout(t);if((L===xr||!L)&&clearTimeout)return L=clearTimeout,clearTimeout(t);try{return L(t)}catch{try{return L.call(null,t)}catch{return L.call(this,t)}}}var O=[],G=!1,P,W=-1;function le(){!G||!P||(G=!1,P.length?O=P.concat(O):W=-1,O.length&&Er())}function Er(){if(!G){var t=mr(le);G=!0;for(var r=O.length;r;){for(P=O,O=[];++W<r;)P&&P[W].run();W=-1,r=O.length}P=null,G=!1,he(t)}}function xe(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];O.push(new dr(t,r)),O.length===1&&!G&&mr(Er)}function dr(t,r){this.fun=t,this.array=r}dr.prototype.run=function(){this.fun.apply(null,this.array)};var me="browser",Ee="browser",de=!0,we={},Ae=[],ge="",Ie={},Te={},_e={};function v(){}var Re=v,ye=v,be=v,Ce=v,Ue=v,De=v,Ne=v;function Oe(t){throw new Error("process.binding is not supported")}function Fe(){return"/"}function Se(t){throw new Error("process.chdir is not supported")}function Be(){return 0}var Y=globalThis.performance||{},Le=Y.now||Y.mozNow||Y.msNow||Y.oNow||Y.webkitNow||function(){return new Date().getTime()};function Pe(t){var r=Le.call(Y)*.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 ve=new Date;function ke(){var t=new Date,r=t-ve;return r/1e3}var x={nextTick:xe,title:me,browser:de,env:we,argv:Ae,version:ge,versions:Ie,on:Re,addListener:ye,once:be,off:Ce,removeListener:Ue,removeAllListeners:De,emit:Ne,binding:Oe,cwd:Fe,chdir:Se,umask:Be,hrtime:Pe,platform:Ee,release:Te,config:_e,uptime:ke},hr={};Object.keys(hr).forEach(t=>{let r=t.split("."),e=x;for(let n=0;n<r.length;n++){let i=r[n];n===r.length-1?e[i]=hr[t]:e=e[i]||(e[i]={})}});var y=[],T=[],Me=typeof Uint8Array<"u"?Uint8Array:Array,ir=!1;function Ir(){ir=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)y[r]=t[r],T[t.charCodeAt(r)]=r;T[45]=62,T[95]=63}function Ye(t){ir||Ir();var r,e,n,i,o,u,s=t.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=t[s-2]==="="?2:t[s-1]==="="?1:0,u=new Me(s*3/4-o),n=o>0?s-4:s;var c=0;for(r=0,e=0;r<n;r+=4,e+=3)i=T[t.charCodeAt(r)]<<18|T[t.charCodeAt(r+1)]<<12|T[t.charCodeAt(r+2)]<<6|T[t.charCodeAt(r+3)],u[c++]=i>>16&255,u[c++]=i>>8&255,u[c++]=i&255;return o===2?(i=T[t.charCodeAt(r)]<<2|T[t.charCodeAt(r+1)]>>4,u[c++]=i&255):o===1&&(i=T[t.charCodeAt(r)]<<10|T[t.charCodeAt(r+1)]<<4|T[t.charCodeAt(r+2)]>>2,u[c++]=i>>8&255,u[c++]=i&255),u}function Ge(t){return y[t>>18&63]+y[t>>12&63]+y[t>>6&63]+y[t&63]}function We(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(Ge(n));return i.join("")}function wr(t){ir||Ir();for(var r,e=t.length,n=e%3,i="",o=[],u=16383,s=0,c=e-n;s<c;s+=u)o.push(We(t,s,s+u>c?c:s+u));return n===1?(r=t[e-1],i+=y[r>>2],i+=y[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=y[r>>10],i+=y[r>>4&63],i+=y[r<<2&63],i+="="),o.push(i),o.join("")}a.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function V(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function F(t,r){if(V()<r)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=a.prototype):(t===null&&(t=new a(r)),t.length=r),t}function a(t,r,e){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(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 or(this,t)}return Tr(this,t,r,e)}a.poolSize=8192;a._augment=function(t){return t.__proto__=a.prototype,t};function Tr(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?ze(t,r,e,n):typeof r=="string"?He(t,r,e):Ke(t,r)}a.from=function(t,r,e){return Tr(null,t,r,e)};a.kMaxLength=V();a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&a[Symbol.species]);function _r(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 Ve(t,r,e,n){return _r(r),r<=0?F(t,r):e!==void 0?typeof n=="string"?F(t,r).fill(e,n):F(t,r).fill(e):F(t,r)}a.alloc=function(t,r,e){return Ve(null,t,r,e)};function or(t,r){if(_r(r),t=F(t,r<0?0:ur(r)|0),!a.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}a.allocUnsafe=function(t){return or(null,t)};a.allocUnsafeSlow=function(t){return or(null,t)};function He(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!a.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=Rr(r,e)|0;t=F(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function nr(t,r){var e=r.length<0?0:ur(r.length)|0;t=F(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function ze(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),a.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=a.prototype):t=nr(t,r),t}function Ke(t,r){if(b(r)){var e=ur(r.length)|0;return t=F(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"||ft(r.length)?F(t,0):nr(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return nr(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function ur(t){if(t>=V())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+V().toString(16)+" bytes");return t|0}a.isBuffer=ht;function b(t){return!!(t!=null&&t._isBuffer)}a.compare=function(r,e){if(!b(r)||!b(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,i=e.length,o=0,u=Math.min(n,i);o<u;++o)if(r[o]!==e[o]){n=r[o],i=e[o];break}return n<i?-1:i<n?1:0};a.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};a.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return a.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var i=a.allocUnsafe(e),o=0;for(n=0;n<r.length;++n){var u=r[n];if(!b(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(i,o),o+=u.length}return i};function Rr(t,r){if(b(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 H(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Or(t).length;default:if(n)return H(t).length;r=(""+r).toLowerCase(),n=!0}}a.byteLength=Rr;function Xe(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 nt(this,r,e);case"utf8":case"utf-8":return Cr(this,r,e);case"ascii":return et(this,r,e);case"latin1":case"binary":return tt(this,r,e);case"base64":return je(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return it(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}a.prototype._isBuffer=!0;function k(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}a.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)k(this,e,e+1);return this};a.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)k(this,e,e+3),k(this,e+1,e+2);return this};a.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)k(this,e,e+7),k(this,e+1,e+6),k(this,e+2,e+5),k(this,e+3,e+4);return this};a.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Cr(this,0,r):Xe.apply(this,arguments)};a.prototype.equals=function(r){if(!b(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:a.compare(this,r)===0};a.prototype.compare=function(r,e,n,i,o){if(!b(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 u=o-i,s=n-e,c=Math.min(u,s),l=this.slice(i,o),f=r.slice(e,n),h=0;h<c;++h)if(l[h]!==f[h]){u=l[h],s=f[h];break}return u<s?-1:s<u?1:0};function yr(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=a.from(r,n)),b(r))return r.length===0?-1:Ar(t,r,e,n,i);if(typeof r=="number")return r=r&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Ar(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function Ar(t,r,e,n,i){var o=1,u=t.length,s=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;o=2,u/=2,s/=2,e/=2}function c(m,I){return o===1?m[I]:m.readUInt16BE(I*o)}var l;if(i){var f=-1;for(l=e;l<u;l++)if(c(t,l)===c(r,f===-1?0:l-f)){if(f===-1&&(f=l),l-f+1===s)return f*o}else f!==-1&&(l-=l-f),f=-1}else for(e+s>u&&(e=u-s),l=e;l>=0;l--){for(var h=!0,E=0;E<s;E++)if(c(t,l+E)!==c(r,E)){h=!1;break}if(h)return l}return-1}a.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};a.prototype.indexOf=function(r,e,n){return yr(this,r,e,n,!0)};a.prototype.lastIndexOf=function(r,e,n){return yr(this,r,e,n,!1)};function $e(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 u=0;u<n;++u){var s=parseInt(r.substr(u*2,2),16);if(isNaN(s))return u;t[e+u]=s}return u}function qe(t,r,e,n){return X(H(r,t.length-e),t,e,n)}function br(t,r,e,n){return X(pt(r),t,e,n)}function Je(t,r,e,n){return br(t,r,e,n)}function Qe(t,r,e,n){return X(Or(r),t,e,n)}function Ze(t,r,e,n){return X(ct(r,t.length-e),t,e,n)}a.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 u=!1;;)switch(i){case"hex":return $e(this,r,e,n);case"utf8":case"utf-8":return qe(this,r,e,n);case"ascii":return br(this,r,e,n);case"latin1":case"binary":return Je(this,r,e,n);case"base64":return Qe(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ze(this,r,e,n);default:if(u)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),u=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function je(t,r,e){return r===0&&e===t.length?wr(t):wr(t.slice(r,e))}function Cr(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o=t[i],u=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=e){var c,l,f,h;switch(s){case 1:o<128&&(u=o);break;case 2:c=t[i+1],(c&192)===128&&(h=(o&31)<<6|c&63,h>127&&(u=h));break;case 3:c=t[i+1],l=t[i+2],(c&192)===128&&(l&192)===128&&(h=(o&15)<<12|(c&63)<<6|l&63,h>2047&&(h<55296||h>57343)&&(u=h));break;case 4:c=t[i+1],l=t[i+2],f=t[i+3],(c&192)===128&&(l&192)===128&&(f&192)===128&&(h=(o&15)<<18|(c&63)<<12|(l&63)<<6|f&63,h>65535&&h<1114112&&(u=h))}}u===null?(u=65533,s=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|u&1023),n.push(u),i+=s}return rt(n)}var gr=4096;function rt(t){var r=t.length;if(r<=gr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=gr));return e}function et(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 tt(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 nt(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+=st(t[o]);return i}function it(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}a.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(a.TYPED_ARRAY_SUPPORT)i=this.subarray(r,e),i.__proto__=a.prototype;else{var o=e-r;i=new a(o,void 0);for(var u=0;u<o;++u)i[u]=this[u+r]}return i};function d(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")}a.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||d(r,e,this.length);for(var i=this[r],o=1,u=0;++u<e&&(o*=256);)i+=this[r+u]*o;return i};a.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||d(r,e,this.length);for(var i=this[r+--e],o=1;e>0&&(o*=256);)i+=this[r+--e]*o;return i};a.prototype.readUInt8=function(r,e){return e||d(r,1,this.length),this[r]};a.prototype.readUInt16LE=function(r,e){return e||d(r,2,this.length),this[r]|this[r+1]<<8};a.prototype.readUInt16BE=function(r,e){return e||d(r,2,this.length),this[r]<<8|this[r+1]};a.prototype.readUInt32LE=function(r,e){return e||d(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};a.prototype.readUInt32BE=function(r,e){return e||d(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};a.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||d(r,e,this.length);for(var i=this[r],o=1,u=0;++u<e&&(o*=256);)i+=this[r+u]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};a.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||d(r,e,this.length);for(var i=e,o=1,u=this[r+--i];i>0&&(o*=256);)u+=this[r+--i]*o;return o*=128,u>=o&&(u-=Math.pow(2,8*e)),u};a.prototype.readInt8=function(r,e){return e||d(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};a.prototype.readInt16LE=function(r,e){e||d(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};a.prototype.readInt16BE=function(r,e){e||d(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};a.prototype.readInt32LE=function(r,e){return e||d(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};a.prototype.readInt32BE=function(r,e){return e||d(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};a.prototype.readFloatLE=function(r,e){return e||d(r,4,this.length),$(this,r,!0,23,4)};a.prototype.readFloatBE=function(r,e){return e||d(r,4,this.length),$(this,r,!1,23,4)};a.prototype.readDoubleLE=function(r,e){return e||d(r,8,this.length),$(this,r,!0,52,8)};a.prototype.readDoubleBE=function(r,e){return e||d(r,8,this.length),$(this,r,!1,52,8)};function A(t,r,e,n,i,o){if(!b(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")}a.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;A(this,r,e,n,o,0)}var u=1,s=0;for(this[e]=r&255;++s<n&&(u*=256);)this[e+s]=r/u&255;return e+n};a.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;A(this,r,e,n,o,0)}var u=n-1,s=1;for(this[e+u]=r&255;--u>=0&&(s*=256);)this[e+u]=r/s&255;return e+n};a.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,1,255,0),a.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 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}a.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):z(this,r,e,!0),e+2};a.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):z(this,r,e,!1),e+2};function K(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}a.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):K(this,r,e,!0),e+4};a.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):K(this,r,e,!1),e+4};a.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);A(this,r,e,n,o-1,-o)}var u=0,s=1,c=0;for(this[e]=r&255;++u<n&&(s*=256);)r<0&&c===0&&this[e+u-1]!==0&&(c=1),this[e+u]=(r/s>>0)-c&255;return e+n};a.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);A(this,r,e,n,o-1,-o)}var u=n-1,s=1,c=0;for(this[e+u]=r&255;--u>=0&&(s*=256);)r<0&&c===0&&this[e+u+1]!==0&&(c=1),this[e+u]=(r/s>>0)-c&255;return e+n};a.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};a.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):z(this,r,e,!0),e+2};a.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):z(this,r,e,!1),e+2};a.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):K(this,r,e,!0),e+4};a.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),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):K(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 Dr(t,r,e,n,i){return i||Ur(t,r,e,4,34028234663852886e22,-34028234663852886e22),Sr(t,r,e,n,23,4),e+4}a.prototype.writeFloatLE=function(r,e,n){return Dr(this,r,e,!0,n)};a.prototype.writeFloatBE=function(r,e,n){return Dr(this,r,e,!1,n)};function Nr(t,r,e,n,i){return i||Ur(t,r,e,8,17976931348623157e292,-17976931348623157e292),Sr(t,r,e,n,52,8),e+8}a.prototype.writeDoubleLE=function(r,e,n){return Nr(this,r,e,!0,n)};a.prototype.writeDoubleBE=function(r,e,n){return Nr(this,r,e,!1,n)};a.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,u;if(this===r&&n<e&&e<i)for(u=o-1;u>=0;--u)r[u+e]=this[u+n];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(u=0;u<o;++u)r[u+e]=this[u+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+o),e);return o};a.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"&&!a.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 u;if(typeof r=="number")for(u=e;u<n;++u)this[u]=r;else{var s=b(r)?r:H(new a(r,i).toString()),c=s.length;for(u=0;u<n-e;++u)this[u+e]=s[u%c]}return this};var ot=/[^+\/0-9A-Za-z-_]/g;function ut(t){if(t=at(t).replace(ot,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function at(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function st(t){return t<16?"0"+t.toString(16):t.toString(16)}function H(t,r){r=r||1/0;for(var e,n=t.length,i=null,o=[],u=0;u<n;++u){if(e=t.charCodeAt(u),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(u+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 pt(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function ct(t,r){for(var e,n,i,o=[],u=0;u<t.length&&!((r-=2)<0);++u)e=t.charCodeAt(u),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function Or(t){return Ye(ut(t))}function X(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 ft(t){return t!==t}function ht(t){return t!=null&&(!!t._isBuffer||Fr(t)||lt(t))}function Fr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function lt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Fr(t.slice(0,0))}function $(t,r,e,n,i){var o,u,s=i*8-n-1,c=(1<<s)-1,l=c>>1,f=-7,h=e?i-1:0,E=e?-1:1,m=t[r+h];for(h+=E,o=m&(1<<-f)-1,m>>=-f,f+=s;f>0;o=o*256+t[r+h],h+=E,f-=8);for(u=o&(1<<-f)-1,o>>=-f,f+=n;f>0;u=u*256+t[r+h],h+=E,f-=8);if(o===0)o=1-l;else{if(o===c)return u?NaN:(m?-1:1)*(1/0);u=u+Math.pow(2,n),o=o-l}return(m?-1:1)*u*Math.pow(2,o-n)}function Sr(t,r,e,n,i,o){var u,s,c,l=o*8-i-1,f=(1<<l)-1,h=f>>1,E=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:o-1,I=n?1:-1,tr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,u=f):(u=Math.floor(Math.log(r)/Math.LN2),r*(c=Math.pow(2,-u))<1&&(u--,c*=2),u+h>=1?r+=E/c:r+=E*Math.pow(2,1-h),r*c>=2&&(u++,c/=2),u+h>=f?(s=0,u=f):u+h>=1?(s=(r*c-1)*Math.pow(2,i),u=u+h):(s=r*Math.pow(2,h-1)*Math.pow(2,i),u=0));i>=8;t[e+m]=s&255,m+=I,s/=256,i-=8);for(u=u<<i|s,l+=i;l>0;t[e+m]=u&255,m+=I,u/=256,l-=8);t[e+m-I]|=tr*128}function on(t,r){return{id:t.id,address:t.address,chainId:t.chainId,name:t.name,unitName:t.unitName,decimals:t.decimals,isGas:t.isGas,img:t.img,cmcLink:t.cmcLink,isArchived:r?r(t):!1}}function pn(t){return{hash:t.hash,loginAddress:t.loginAddress,loginChainId:t.loginChainId,tokenId:t.token?.id,tokenAddress:t.tokenId,tokenChainId:t.tokenChainId,amount:t.amount,lockedAmount:t.lockedAmount}}var Br=(e=>(e[e.Buy=0]="Buy",e[e.Sell=1]="Sell",e))(Br||{}),C=Br;var Lr=(i=>(i.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",i.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",i.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",i.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",i))(Lr||{}),Pr=(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))(Pr||{}),Ei={...Lr,...Pr};function vr(t){switch(t){case C.Buy:return"B";case C.Sell:return"S";default:throw new Error("Unknown order side type: "+t)}}var Io=t=>{let r=new Date(t),e=r.toLocaleDateString("default",{year:"numeric",month:"numeric",day:"numeric"}),n=r.toLocaleTimeString("en-US",{hour12:!0,hour:"2-digit",minute:"2-digit"});return e+" "+n},Yr=(t,r)=>String(t).toLowerCase()===String(r).toLowerCase();function To(t,r){return t=Math.ceil(t),r=Math.floor(r),Math.floor(Math.random()*(r-t+1))+t}function _o(t){let r=[],e=t.split(".");for(let n=0;n<e.length-1;n++)r.push(e.slice(n).join("."));return r}function Ro(t){let r=t.headers&&q({Authorization:t.headers.Authorization?.substring(0,200),"CloudFront-Viewer-Country":t.headers["CloudFront-Viewer-Country"],Host:t.headers.Host,origin:t.headers.origin,Referer:t.headers.Referer,"User-Agent":t.headers["User-Agent"],"wl-domain":t.headers["wl-domain"],"X-API-Key":kr(t.headers["X-API-Key"]),"X-Forwarded-For":t.headers["X-Forwarded-For"],"X-Forwarded-Port":t.headers["X-Forwarded-Port"],"X-Forwarded-Proto":t.headers["X-Forwarded-Proto"],"X-Trading-Key":t.headers["X-Trading-Key"],"X-Wallet-Address":t.headers["X-Wallet-Address"],"X-Wallet-Token":t.headers["X-Wallet-Token"],accessToken:kr(t.headers.accessToken),companyId:t.headers.companyId,seasonId:t.headers.seasonId}),e=t.requestContext&&q({identity:t.requestContext.identity&&q({userAgent:t.requestContext.identity.userAgent,sourceIp:t.requestContext.identity.sourceIp}),domainName:t.requestContext.domainName});return q({manage:t.manage,path:t.path,httpMethod:t.httpMethod,headers:r,requestContext:e})}function kr(t){if(!t?.length)return t;let r=Math.round(t.length/3),e=r,n=t.length-r;return t.substring(0,e)+"*".repeat(r)+t.substring(n)}function Mr(t,r){return Array.isArray(t)?t.map(e=>Mr(e,r)):typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t).filter(([e])=>e!==r).map(([e,n])=>[e,Mr(n,r)])):t}function q(t){return Object.fromEntries(Object.entries(t).filter(([,r])=>r!==void 0))}import _ from"bignumber.js";_.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});var mt=(f=>(f.MINUS="-",f.PLUS="+",f.MULTIPLY="*",f.DIVIDE="/",f.GREATER_THAN_OR_EQUAL=">=",f.GREATER_THAN=">",f.LESS_THAN_OR_EQUAL="<=",f.LESS_THAN="<",f.EQUAL="==",f.MOD="mod",f))(mt||{});function Do(t){return new _(t).abs().toString()}function No(t){let e=new _(String(t)).integerValue(_.ROUND_CEIL).toString();return Hr(t,e)||console.log("Ceil value",{value:t,res:e}),e}function Oo(t,r,e=!1){let n=new _(String(t)),i;if(e){let o=n.toFixed(),u=o.indexOf(".");if(u>=0){let s=o.slice(u+1),c=0;for(let f of s)if(f==="0")c++;else break;let l=c+1;i=n.toFixed(l,_.ROUND_UP)}else i=n.toFixed(0)}else i=n.toFixed(r);return console.log("Fixed value",{value:t,res:i}),i}function Fo(t){let e=new _(String(t)).integerValue(_.ROUND_FLOOR).toString();return console.log("Floor value",{value:t,res:e}),e}function So(t){let e=new _(String(t)).integerValue(_.ROUND_HALF_UP).toString();return console.log("Round value",{value:t,res:e}),e}function Vr(t,r){return U(t,r,"+")}function Bo(t,r){return U(t,r,"-")}function Et(t,r){return U(t,r,"*")}function Lo(t,r){return Et(t,r||0)}function Po(t,r){return U(t,r,"/")}function vo(t,r){return!!U(t,r,">=")}function ko(t,r){return!!U(t,r,">")}function Mo(t,r){return!!U(t,r,"<=")}function Yo(t,r){return!!U(t,r,"<")}function Hr(t,r){return!!U(t,r,"==")}function dt(t,r){return U(t,r,"mod")}function Go(t,r){return Hr(dt(t,r),0)}function U(t,r,e){switch(t=new _(String(t)),r=new _(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}}function Gr(t){if(t.toString().includes("e")){let r=t.toString().split("e");return[parseFloat(r[0]),parseFloat(r[1])]}return[t,0]}function Wr(t,r){return t+(r<0?`e${r}`:`e+${r}`)}function zr({decimalPlaces:t=0},r){if(t>0){let[e,n]=Gr(r),[i,o]=Gr(Math.round(Number(Wr(e,n+t))));return Number(Wr(i,o-t))}return Math.round(r)}function Wo(t,r){let e=Number(t);return zr({decimalPlaces:e},Math.pow(10,-e)*Number(r))}function Vo(t,r){let e=Math.pow(10,Number(t))*Number(r);return zr({decimalPlaces:0},e)}function Qo(t,r,e){let n=t.buyOrder&&t.sellOrder?t.buyOrderId>t.sellOrderId?t.buyOrder:t.sellOrder:t.buyOrder||t.sellOrder;return{pairId:t.pairId,orderId:n?.id,orderSide:n&&vr(n.side),...Kr(r,e),...Xr(t,n)}}function Zo(t,r,e,n,i){return{id:t.id,pairId:t.pairId,pair:e||t.pair?.pairKey,...Kr(n,i),amount:t.amount,price:t.price,total:t.total,filledAmount:t.filledAmount,filledTotal:t.filledTotal,avgPrice:t.excutedPrice,status:t.status,side:t.side,type:t.type,userId:t.userId,createdAt:t.createdAt?.getTime(),completedAt:t.completedAt?.getTime()||null,updatedAt:t.updatedAt?.getTime(),trades:r&&r.map(o=>Xr(o,t))}}function Kr(t,r){return{baseTokenId:t?.id,baseTokenDecimal:t?.decimals,quoteTokenId:r?.id,quoteTokenDecimal:r?.decimals}}function Xr(t,r){return{tradeId:t.tradeId,status:t.txStatus,amount:t.amount,total:t.total,price:t.price,fee:r&&t.tradeFees.filter(e=>Yr(e.address,r.userId)).reduce((e,n)=>Vr(e,n.fee),"0"),createdAt:t.createdAt?.getTime(),updatedAt:t.updatedAt?.getTime(),isBuyer:r&&r.side===C.Buy,isMaker:r&&wt(r.side,t.tradeSide)}}function wt(t,r){return t===C.Buy&&r===C.Sell||t===C.Sell&&r===C.Buy}import fr from"algosdk";import lu,{decodeAddress as xu,encodeAddress as mu}from"algosdk";var D=[],R=[],At=typeof Uint8Array<"u"?Uint8Array:Array,sr=!1;function Qr(){sr=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)D[r]=t[r],R[t.charCodeAt(r)]=r;R[45]=62,R[95]=63}function gt(t){sr||Qr();var r,e,n,i,o,u,s=t.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=t[s-2]==="="?2:t[s-1]==="="?1:0,u=new At(s*3/4-o),n=o>0?s-4:s;var c=0;for(r=0,e=0;r<n;r+=4,e+=3)i=R[t.charCodeAt(r)]<<18|R[t.charCodeAt(r+1)]<<12|R[t.charCodeAt(r+2)]<<6|R[t.charCodeAt(r+3)],u[c++]=i>>16&255,u[c++]=i>>8&255,u[c++]=i&255;return o===2?(i=R[t.charCodeAt(r)]<<2|R[t.charCodeAt(r+1)]>>4,u[c++]=i&255):o===1&&(i=R[t.charCodeAt(r)]<<10|R[t.charCodeAt(r+1)]<<4|R[t.charCodeAt(r+2)]>>2,u[c++]=i>>8&255,u[c++]=i&255),u}function It(t){return D[t>>18&63]+D[t>>12&63]+D[t>>6&63]+D[t&63]}function Tt(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(It(n));return i.join("")}function $r(t){sr||Qr();for(var r,e=t.length,n=e%3,i="",o=[],u=16383,s=0,c=e-n;s<c;s+=u)o.push(Tt(t,s,s+u>c?c:s+u));return n===1?(r=t[e-1],i+=D[r>>2],i+=D[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=D[r>>10],i+=D[r>>4&63],i+=D[r<<2&63],i+="="),o.push(i),o.join("")}function Z(t,r,e,n,i){var o,u,s=i*8-n-1,c=(1<<s)-1,l=c>>1,f=-7,h=e?i-1:0,E=e?-1:1,m=t[r+h];for(h+=E,o=m&(1<<-f)-1,m>>=-f,f+=s;f>0;o=o*256+t[r+h],h+=E,f-=8);for(u=o&(1<<-f)-1,o>>=-f,f+=n;f>0;u=u*256+t[r+h],h+=E,f-=8);if(o===0)o=1-l;else{if(o===c)return u?NaN:(m?-1:1)*(1/0);u=u+Math.pow(2,n),o=o-l}return(m?-1:1)*u*Math.pow(2,o-n)}function Zr(t,r,e,n,i,o){var u,s,c,l=o*8-i-1,f=(1<<l)-1,h=f>>1,E=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:o-1,I=n?1:-1,tr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,u=f):(u=Math.floor(Math.log(r)/Math.LN2),r*(c=Math.pow(2,-u))<1&&(u--,c*=2),u+h>=1?r+=E/c:r+=E*Math.pow(2,1-h),r*c>=2&&(u++,c/=2),u+h>=f?(s=0,u=f):u+h>=1?(s=(r*c-1)*Math.pow(2,i),u=u+h):(s=r*Math.pow(2,h-1)*Math.pow(2,i),u=0));i>=8;t[e+m]=s&255,m+=I,s/=256,i-=8);for(u=u<<i|s,l+=i;l>0;t[e+m]=u&255,m+=I,u/=256,l-=8);t[e+m-I]|=tr*128}var _t={}.toString,jr=Array.isArray||function(t){return _t.call(t)=="[object Array]"};var Rt=50;p.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;var su=J();function J(){return p.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function S(t,r){if(J()<r)throw new RangeError("Invalid typed array length");return p.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=p.prototype):(t===null&&(t=new p(r)),t.length=r),t}function p(t,r,e){if(!p.TYPED_ARRAY_SUPPORT&&!(this instanceof p))return new p(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 pr(this,t)}return re(this,t,r,e)}p.poolSize=8192;p._augment=function(t){return t.__proto__=p.prototype,t};function re(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?Ct(t,r,e,n):typeof r=="string"?bt(t,r,e):Ut(t,r)}p.from=function(t,r,e){return re(null,t,r,e)};p.TYPED_ARRAY_SUPPORT&&(p.prototype.__proto__=Uint8Array.prototype,p.__proto__=Uint8Array);function ee(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 yt(t,r,e,n){return ee(r),r<=0?S(t,r):e!==void 0?typeof n=="string"?S(t,r).fill(e,n):S(t,r).fill(e):S(t,r)}p.alloc=function(t,r,e){return yt(null,t,r,e)};function pr(t,r){if(ee(r),t=S(t,r<0?0:cr(r)|0),!p.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}p.allocUnsafe=function(t){return pr(null,t)};p.allocUnsafeSlow=function(t){return pr(null,t)};function bt(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!p.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=te(r,e)|0;t=S(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function ar(t,r){var e=r.length<0?0:cr(r.length)|0;t=S(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function Ct(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),p.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=p.prototype):t=ar(t,r),t}function Ut(t,r){if(N(r)){var e=cr(r.length)|0;return t=S(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"||Xt(r.length)?S(t,0):ar(t,r);if(r.type==="Buffer"&&jr(r.data))return ar(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function cr(t){if(t>=J())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+J().toString(16)+" bytes");return t|0}p.isBuffer=$t;function N(t){return!!(t!=null&&t._isBuffer)}p.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,i=e.length,o=0,u=Math.min(n,i);o<u;++o)if(r[o]!==e[o]){n=r[o],i=e[o];break}return n<i?-1:i<n?1:0};p.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}};p.concat=function(r,e){if(!jr(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return p.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var i=p.allocUnsafe(e),o=0;for(n=0;n<r.length;++n){var u=r[n];if(!N(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(i,o),o+=u.length}return i};function te(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 Q(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 Q(t).length;r=(""+r).toLowerCase(),n=!0}}p.byteLength=te;function Dt(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 Mt(this,r,e);case"utf8":case"utf-8":return oe(this,r,e);case"ascii":return vt(this,r,e);case"latin1":case"binary":return kt(this,r,e);case"base64":return Lt(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Yt(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}p.prototype._isBuffer=!0;function M(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}p.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};p.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};p.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};p.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?oe(this,0,r):Dt.apply(this,arguments)};p.prototype.equals=function(r){if(!N(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:p.compare(this,r)===0};p.prototype.inspect=function(){var r="",e=Rt;return this.length>0&&(r=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(r+=" ... ")),"<Buffer "+r+">"};p.prototype.compare=function(r,e,n,i,o){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),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 u=o-i,s=n-e,c=Math.min(u,s),l=this.slice(i,o),f=r.slice(e,n),h=0;h<c;++h)if(l[h]!==f[h]){u=l[h],s=f[h];break}return u<s?-1:s<u?1:0};function ne(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=p.from(r,n)),N(r))return r.length===0?-1:qr(t,r,e,n,i);if(typeof r=="number")return r=r&255,p.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):qr(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function qr(t,r,e,n,i){var o=1,u=t.length,s=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;o=2,u/=2,s/=2,e/=2}function c(m,I){return o===1?m[I]:m.readUInt16BE(I*o)}var l;if(i){var f=-1;for(l=e;l<u;l++)if(c(t,l)===c(r,f===-1?0:l-f)){if(f===-1&&(f=l),l-f+1===s)return f*o}else f!==-1&&(l-=l-f),f=-1}else for(e+s>u&&(e=u-s),l=e;l>=0;l--){for(var h=!0,E=0;E<s;E++)if(c(t,l+E)!==c(r,E)){h=!1;break}if(h)return l}return-1}p.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};p.prototype.indexOf=function(r,e,n){return ne(this,r,e,n,!0)};p.prototype.lastIndexOf=function(r,e,n){return ne(this,r,e,n,!1)};function Nt(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 u=0;u<n;++u){var s=parseInt(r.substr(u*2,2),16);if(isNaN(s))return u;t[e+u]=s}return u}function Ot(t,r,e,n){return er(Q(r,t.length-e),t,e,n)}function ie(t,r,e,n){return er(zt(r),t,e,n)}function Ft(t,r,e,n){return ie(t,r,e,n)}function St(t,r,e,n){return er(pe(r),t,e,n)}function Bt(t,r,e,n){return er(Kt(r,t.length-e),t,e,n)}p.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 u=!1;;)switch(i){case"hex":return Nt(this,r,e,n);case"utf8":case"utf-8":return Ot(this,r,e,n);case"ascii":return ie(this,r,e,n);case"latin1":case"binary":return Ft(this,r,e,n);case"base64":return St(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Bt(this,r,e,n);default:if(u)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),u=!0}};p.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?$r(t):$r(t.slice(r,e))}function oe(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o=t[i],u=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=e){var c,l,f,h;switch(s){case 1:o<128&&(u=o);break;case 2:c=t[i+1],(c&192)===128&&(h=(o&31)<<6|c&63,h>127&&(u=h));break;case 3:c=t[i+1],l=t[i+2],(c&192)===128&&(l&192)===128&&(h=(o&15)<<12|(c&63)<<6|l&63,h>2047&&(h<55296||h>57343)&&(u=h));break;case 4:c=t[i+1],l=t[i+2],f=t[i+3],(c&192)===128&&(l&192)===128&&(f&192)===128&&(h=(o&15)<<18|(c&63)<<12|(l&63)<<6|f&63,h>65535&&h<1114112&&(u=h))}}u===null?(u=65533,s=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|u&1023),n.push(u),i+=s}return Pt(n)}var Jr=4096;function Pt(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 vt(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 kt(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 Mt(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+=Ht(t[o]);return i}function Yt(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}p.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(p.TYPED_ARRAY_SUPPORT)i=this.subarray(r,e),i.__proto__=p.prototype;else{var o=e-r;i=new p(o,void 0);for(var u=0;u<o;++u)i[u]=this[u+r]}return i};function w(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")}p.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||w(r,e,this.length);for(var i=this[r],o=1,u=0;++u<e&&(o*=256);)i+=this[r+u]*o;return i};p.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||w(r,e,this.length);for(var i=this[r+--e],o=1;e>0&&(o*=256);)i+=this[r+--e]*o;return i};p.prototype.readUInt8=function(r,e){return e||w(r,1,this.length),this[r]};p.prototype.readUInt16LE=function(r,e){return e||w(r,2,this.length),this[r]|this[r+1]<<8};p.prototype.readUInt16BE=function(r,e){return e||w(r,2,this.length),this[r]<<8|this[r+1]};p.prototype.readUInt32LE=function(r,e){return e||w(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};p.prototype.readUInt32BE=function(r,e){return e||w(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};p.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||w(r,e,this.length);for(var i=this[r],o=1,u=0;++u<e&&(o*=256);)i+=this[r+u]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};p.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||w(r,e,this.length);for(var i=e,o=1,u=this[r+--i];i>0&&(o*=256);)u+=this[r+--i]*o;return o*=128,u>=o&&(u-=Math.pow(2,8*e)),u};p.prototype.readInt8=function(r,e){return e||w(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};p.prototype.readInt16LE=function(r,e){e||w(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};p.prototype.readInt16BE=function(r,e){e||w(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};p.prototype.readInt32LE=function(r,e){return e||w(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};p.prototype.readInt32BE=function(r,e){return e||w(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};p.prototype.readFloatLE=function(r,e){return e||w(r,4,this.length),Z(this,r,!0,23,4)};p.prototype.readFloatBE=function(r,e){return e||w(r,4,this.length),Z(this,r,!1,23,4)};p.prototype.readDoubleLE=function(r,e){return e||w(r,8,this.length),Z(this,r,!0,52,8)};p.prototype.readDoubleBE=function(r,e){return e||w(r,8,this.length),Z(this,r,!1,52,8)};function g(t,r,e,n,i,o){if(!N(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")}p.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;g(this,r,e,n,o,0)}var u=1,s=0;for(this[e]=r&255;++s<n&&(u*=256);)this[e+s]=r/u&255;return e+n};p.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;g(this,r,e,n,o,0)}var u=n-1,s=1;for(this[e+u]=r&255;--u>=0&&(s*=256);)this[e+u]=r/s&255;return e+n};p.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||g(this,r,e,1,255,0),p.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function j(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}p.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||g(this,r,e,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):j(this,r,e,!0),e+2};p.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||g(this,r,e,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):j(this,r,e,!1),e+2};function rr(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}p.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||g(this,r,e,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):rr(this,r,e,!0),e+4};p.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||g(this,r,e,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):rr(this,r,e,!1),e+4};p.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);g(this,r,e,n,o-1,-o)}var u=0,s=1,c=0;for(this[e]=r&255;++u<n&&(s*=256);)r<0&&c===0&&this[e+u-1]!==0&&(c=1),this[e+u]=(r/s>>0)-c&255;return e+n};p.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);g(this,r,e,n,o-1,-o)}var u=n-1,s=1,c=0;for(this[e+u]=r&255;--u>=0&&(s*=256);)r<0&&c===0&&this[e+u+1]!==0&&(c=1),this[e+u]=(r/s>>0)-c&255;return e+n};p.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||g(this,r,e,1,127,-128),p.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};p.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||g(this,r,e,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):j(this,r,e,!0),e+2};p.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||g(this,r,e,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):j(this,r,e,!1),e+2};p.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||g(this,r,e,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):rr(this,r,e,!0),e+4};p.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||g(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),p.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):rr(this,r,e,!1),e+4};function ue(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 ae(t,r,e,n,i){return i||ue(t,r,e,4),Zr(t,r,e,n,23,4),e+4}p.prototype.writeFloatLE=function(r,e,n){return ae(this,r,e,!0,n)};p.prototype.writeFloatBE=function(r,e,n){return ae(this,r,e,!1,n)};function se(t,r,e,n,i){return i||ue(t,r,e,8),Zr(t,r,e,n,52,8),e+8}p.prototype.writeDoubleLE=function(r,e,n){return se(this,r,e,!0,n)};p.prototype.writeDoubleBE=function(r,e,n){return se(this,r,e,!1,n)};p.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,u;if(this===r&&n<e&&e<i)for(u=o-1;u>=0;--u)r[u+e]=this[u+n];else if(o<1e3||!p.TYPED_ARRAY_SUPPORT)for(u=0;u<o;++u)r[u+e]=this[u+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+o),e);return o};p.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"&&!p.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 u;if(typeof r=="number")for(u=e;u<n;++u)this[u]=r;else{var s=N(r)?r:Q(new p(r,i).toString()),c=s.length;for(u=0;u<n-e;++u)this[u+e]=s[u%c]}return this};var Gt=/[^+\/0-9A-Za-z-_]/g;function Wt(t){if(t=Vt(t).replace(Gt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Vt(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Ht(t){return t<16?"0"+t.toString(16):t.toString(16)}function Q(t,r){r=r||1/0;for(var e,n=t.length,i=null,o=[],u=0;u<n;++u){if(e=t.charCodeAt(u),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(u+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 zt(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function Kt(t,r){for(var e,n,i,o=[],u=0;u<t.length&&!((r-=2)<0);++u)e=t.charCodeAt(u),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function pe(t){return gt(Wt(t))}function er(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 Xt(t){return t!==t}function $t(t){return t!=null&&(!!t._isBuffer||ce(t)||qt(t))}function ce(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function qt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&ce(t.slice(0,0))}import{encodeAddress as Iu,decodeAddress as Tu}from"algosdk";function fe(t){return new Uint8Array(p.from(t))}function yu(t){return fe(t)}function Jt(t,r,e){return fr.makePaymentTxnWithSuggestedParamsFromObject({from:t,to:t,amount:0,note:r&&new Uint8Array(a.from(r,e)),suggestedParams:{fee:0,firstRound:1,lastRound:2,genesisHash:"SGO1GKSzyE7IEPItTxCByw9x8FmnrCDexi9/cOUJOiI=",genesisID:"testnet-v1.0"}})}function bu(t,r,e,n){return Qt(Jt(t,r,e),n)}async function Qt(t,r){let e=fr.encodeUnsignedTransaction(t),n=await r([e]),i=fr.decodeSignedTransaction(n[0]);return new Uint8Array(i.sig)}export{mt as Operations,Do as absolute,U as bn_operation,No as ceil,Wo as convertFromBaseUnits,Vo as convertToBaseUnits,Ro as cutEvent,Po as divide,yu as encodeMessage,Hr as equal,Yr as equalIgnoreCase,Fo as floor,Jt as generateTxnForSign,_o as getDomains,To as getRandomInt,ko as greaterThan,vo as greaterThanOrEqual,wt as isMaker,Yo as lessThan,Mo as lessThanOrEqual,Io as listDateFormat,on as mapToCodexAssetDto,pn as mapToCodexBalanceDto,Zo as mapToOrderTradeDto,Qo as mapToUserTradeDto,kr as maskingString,Bo as minus,dt as mod,Go as modZero,Et as multiply,Vr as plus,Mr as removeField,So as round,zr as roundNumber,bu as signTxn,Oo as toFixed,Lo as toUsd};
|
|
2
|
+
/*!
|
|
3
|
+
* The buffer module from node.js, for the browser.
|
|
4
|
+
*
|
|
5
|
+
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
6
|
+
* @license MIT
|
|
7
|
+
*/
|
|
8
|
+
/*! Bundled license information:
|
|
9
|
+
|
|
10
|
+
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
11
|
+
(*!
|
|
12
|
+
* The buffer module from node.js, for the browser.
|
|
13
|
+
*
|
|
14
|
+
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
15
|
+
* @license MIT
|
|
16
|
+
*)
|
|
17
|
+
*/
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function z(){throw new Error("setTimeout has not been defined")}function J(){throw new Error("clearTimeout has not been defined")}var R=z,I=J;typeof globalThis.setTimeout=="function"&&(R=setTimeout);typeof globalThis.clearTimeout=="function"&&(I=clearTimeout);function O(n){if(R===setTimeout)return setTimeout(n,0);if((R===z||!R)&&setTimeout)return R=setTimeout,setTimeout(n,0);try{return R(n,0)}catch{try{return R.call(null,n,0)}catch{return R.call(this,n,0)}}}function sr(n){if(I===clearTimeout)return clearTimeout(n);if((I===J||!I)&&clearTimeout)return I=clearTimeout,clearTimeout(n);try{return I(n)}catch{try{return I.call(null,n)}catch{return I.call(this,n)}}}var y=[],Y=!1,_,S=-1;function lr(){!Y||!_||(Y=!1,_.length?y=_.concat(y):S=-1,y.length&&Q())}function Q(){if(!Y){var n=O(lr);Y=!0;for(var r=y.length;r;){for(_=y,y=[];++S<r;)_&&_[S].run();S=-1,r=y.length}_=null,Y=!1,sr(n)}}function pr(n){var r=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)r[i-1]=arguments[i];y.push(new X(n,r)),y.length===1&&!Y&&O(Q)}function X(n,r){this.fun=n,this.array=r}X.prototype.run=function(){this.fun.apply(null,this.array)};var wr="browser",xr="browser",Er=!0,mr={},Ar=[],gr="",yr={},Tr={},Rr={};function v(){}var Ir=v,_r=v,vr=v,Ur=v,dr=v,Br=v,Yr=v;function Sr(n){throw new Error("process.binding is not supported")}function Pr(){return"/"}function Cr(n){throw new Error("process.chdir is not supported")}function Dr(){return 0}var B=globalThis.performance||{},Mr=B.now||B.mozNow||B.msNow||B.oNow||B.webkitNow||function(){return new Date().getTime()};function kr(n){var r=Mr.call(B)*.001,i=Math.floor(r),e=Math.floor(r%1*1e9);return n&&(i=i-n[0],e=e-n[1],e<0&&(i--,e+=1e9)),[i,e]}var Nr=new Date;function Lr(){var n=new Date,r=n-Nr;return r/1e3}var L={nextTick:pr,title:wr,browser:Er,env:mr,argv:Ar,version:gr,versions:yr,on:Ir,addListener:_r,once:vr,off:Ur,removeListener:dr,removeAllListeners:Br,emit:Yr,binding:Sr,cwd:Pr,chdir:Cr,umask:Dr,hrtime:kr,platform:xr,release:Tr,config:Rr,uptime:Lr},V={};Object.keys(V).forEach(n=>{let r=n.split("."),i=L;for(let e=0;e<r.length;e++){let t=r[e];e===r.length-1?i[t]=V[n]:i=i[t]||(i[t]={})}});var A=[],E=[],Fr=typeof Uint8Array<"u"?Uint8Array:Array,W=!1;function $(){W=!0;for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,i=n.length;r<i;++r)A[r]=n[r],E[n.charCodeAt(r)]=r;E[45]=62,E[95]=63}function Wr(n){W||$();var r,i,e,t,f,u,a=n.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");f=n[a-2]==="="?2:n[a-1]==="="?1:0,u=new Fr(a*3/4-f),e=f>0?a-4:a;var h=0;for(r=0,i=0;r<e;r+=4,i+=3)t=E[n.charCodeAt(r)]<<18|E[n.charCodeAt(r+1)]<<12|E[n.charCodeAt(r+2)]<<6|E[n.charCodeAt(r+3)],u[h++]=t>>16&255,u[h++]=t>>8&255,u[h++]=t&255;return f===2?(t=E[n.charCodeAt(r)]<<2|E[n.charCodeAt(r+1)]>>4,u[h++]=t&255):f===1&&(t=E[n.charCodeAt(r)]<<10|E[n.charCodeAt(r+1)]<<4|E[n.charCodeAt(r+2)]>>2,u[h++]=t>>8&255,u[h++]=t&255),u}function Gr(n){return A[n>>18&63]+A[n>>12&63]+A[n>>6&63]+A[n&63]}function Hr(n,r,i){for(var e,t=[],f=r;f<i;f+=3)e=(n[f]<<16)+(n[f+1]<<8)+n[f+2],t.push(Gr(e));return t.join("")}function q(n){W||$();for(var r,i=n.length,e=i%3,t="",f=[],u=16383,a=0,h=i-e;a<h;a+=u)f.push(Hr(n,a,a+u>h?h:a+u));return e===1?(r=n[i-1],t+=A[r>>2],t+=A[r<<4&63],t+="=="):e===2&&(r=(n[i-2]<<8)+n[i-1],t+=A[r>>10],t+=A[r>>4&63],t+=A[r<<2&63],t+="="),f.push(t),f.join("")}o.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function P(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function T(n,r){if(P()<r)throw new RangeError("Invalid typed array length");return o.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(r),n.__proto__=o.prototype):(n===null&&(n=new o(r)),n.length=r),n}function o(n,r,i){if(!o.TYPED_ARRAY_SUPPORT&&!(this instanceof o))return new o(n,r,i);if(typeof n=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return G(this,n)}return b(this,n,r,i)}o.poolSize=8192;o._augment=function(n){return n.__proto__=o.prototype,n};function b(n,r,i,e){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Jr(n,r,i,e):typeof r=="string"?zr(n,r,i):Or(n,r)}o.from=function(n,r,i){return b(null,n,r,i)};o.kMaxLength=P();o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&o[Symbol.species]);function j(n){if(typeof n!="number")throw new TypeError('"size" argument must be a number');if(n<0)throw new RangeError('"size" argument must not be negative')}function Vr(n,r,i,e){return j(r),r<=0?T(n,r):i!==void 0?typeof e=="string"?T(n,r).fill(i,e):T(n,r).fill(i):T(n,r)}o.alloc=function(n,r,i){return Vr(null,n,r,i)};function G(n,r){if(j(r),n=T(n,r<0?0:H(r)|0),!o.TYPED_ARRAY_SUPPORT)for(var i=0;i<r;++i)n[i]=0;return n}o.allocUnsafe=function(n){return G(null,n)};o.allocUnsafeSlow=function(n){return G(null,n)};function zr(n,r,i){if((typeof i!="string"||i==="")&&(i="utf8"),!o.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var e=rr(r,i)|0;n=T(n,e);var t=n.write(r,i);return t!==e&&(n=n.slice(0,t)),n}function F(n,r){var i=r.length<0?0:H(r.length)|0;n=T(n,i);for(var e=0;e<i;e+=1)n[e]=r[e]&255;return n}function Jr(n,r,i,e){if(r.byteLength,i<0||r.byteLength<i)throw new RangeError("'offset' is out of bounds");if(r.byteLength<i+(e||0))throw new RangeError("'length' is out of bounds");return i===void 0&&e===void 0?r=new Uint8Array(r):e===void 0?r=new Uint8Array(r,i):r=new Uint8Array(r,i,e),o.TYPED_ARRAY_SUPPORT?(n=r,n.__proto__=o.prototype):n=F(n,r),n}function Or(n,r){if(g(r)){var i=H(r.length)|0;return n=T(n,i),n.length===0||r.copy(n,0,0,i),n}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||ci(r.length)?T(n,0):F(n,r);if(r.type==="Buffer"&&Array.isArray(r.data))return F(n,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function H(n){if(n>=P())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+P().toString(16)+" bytes");return n|0}o.isBuffer=si;function g(n){return!!(n!=null&&n._isBuffer)}o.compare=function(r,i){if(!g(r)||!g(i))throw new TypeError("Arguments must be Buffers");if(r===i)return 0;for(var e=r.length,t=i.length,f=0,u=Math.min(e,t);f<u;++f)if(r[f]!==i[f]){e=r[f],t=i[f];break}return e<t?-1:t<e?1:0};o.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};o.concat=function(r,i){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return o.alloc(0);var e;if(i===void 0)for(i=0,e=0;e<r.length;++e)i+=r[e].length;var t=o.allocUnsafe(i),f=0;for(e=0;e<r.length;++e){var u=r[e];if(!g(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(t,f),f+=u.length}return t};function rr(n,r){if(g(n))return n.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(n)||n instanceof ArrayBuffer))return n.byteLength;typeof n!="string"&&(n=""+n);var i=n.length;if(i===0)return 0;for(var e=!1;;)switch(r){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return C(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return or(n).length;default:if(e)return C(n).length;r=(""+r).toLowerCase(),e=!0}}o.byteLength=rr;function Qr(n,r,i){var e=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,r>>>=0,i<=r))return"";for(n||(n="utf8");;)switch(n){case"hex":return ni(this,r,i);case"utf8":case"utf-8":return er(this,r,i);case"ascii":return ri(this,r,i);case"latin1":case"binary":return ii(this,r,i);case"base64":return br(this,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ei(this,r,i);default:if(e)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),e=!0}}o.prototype._isBuffer=!0;function U(n,r,i){var e=n[r];n[r]=n[i],n[i]=e}o.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var i=0;i<r;i+=2)U(this,i,i+1);return this};o.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var i=0;i<r;i+=4)U(this,i,i+3),U(this,i+1,i+2);return this};o.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var i=0;i<r;i+=8)U(this,i,i+7),U(this,i+1,i+6),U(this,i+2,i+5),U(this,i+3,i+4);return this};o.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?er(this,0,r):Qr.apply(this,arguments)};o.prototype.equals=function(r){if(!g(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:o.compare(this,r)===0};o.prototype.compare=function(r,i,e,t,f){if(!g(r))throw new TypeError("Argument must be a Buffer");if(i===void 0&&(i=0),e===void 0&&(e=r?r.length:0),t===void 0&&(t=0),f===void 0&&(f=this.length),i<0||e>r.length||t<0||f>this.length)throw new RangeError("out of range index");if(t>=f&&i>=e)return 0;if(t>=f)return-1;if(i>=e)return 1;if(i>>>=0,e>>>=0,t>>>=0,f>>>=0,this===r)return 0;for(var u=f-t,a=e-i,h=Math.min(u,a),s=this.slice(t,f),l=r.slice(i,e),c=0;c<h;++c)if(s[c]!==l[c]){u=s[c],a=l[c];break}return u<a?-1:a<u?1:0};function ir(n,r,i,e,t){if(n.length===0)return-1;if(typeof i=="string"?(e=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=t?0:n.length-1),i<0&&(i=n.length+i),i>=n.length){if(t)return-1;i=n.length-1}else if(i<0)if(t)i=0;else return-1;if(typeof r=="string"&&(r=o.from(r,e)),g(r))return r.length===0?-1:Z(n,r,i,e,t);if(typeof r=="number")return r=r&255,o.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?t?Uint8Array.prototype.indexOf.call(n,r,i):Uint8Array.prototype.lastIndexOf.call(n,r,i):Z(n,[r],i,e,t);throw new TypeError("val must be string, number or Buffer")}function Z(n,r,i,e,t){var f=1,u=n.length,a=r.length;if(e!==void 0&&(e=String(e).toLowerCase(),e==="ucs2"||e==="ucs-2"||e==="utf16le"||e==="utf-16le")){if(n.length<2||r.length<2)return-1;f=2,u/=2,a/=2,i/=2}function h(x,d){return f===1?x[d]:x.readUInt16BE(d*f)}var s;if(t){var l=-1;for(s=i;s<u;s++)if(h(n,s)===h(r,l===-1?0:s-l)){if(l===-1&&(l=s),s-l+1===a)return l*f}else l!==-1&&(s-=s-l),l=-1}else for(i+a>u&&(i=u-a),s=i;s>=0;s--){for(var c=!0,m=0;m<a;m++)if(h(n,s+m)!==h(r,m)){c=!1;break}if(c)return s}return-1}o.prototype.includes=function(r,i,e){return this.indexOf(r,i,e)!==-1};o.prototype.indexOf=function(r,i,e){return ir(this,r,i,e,!0)};o.prototype.lastIndexOf=function(r,i,e){return ir(this,r,i,e,!1)};function Xr(n,r,i,e){i=Number(i)||0;var t=n.length-i;e?(e=Number(e),e>t&&(e=t)):e=t;var f=r.length;if(f%2!==0)throw new TypeError("Invalid hex string");e>f/2&&(e=f/2);for(var u=0;u<e;++u){var a=parseInt(r.substr(u*2,2),16);if(isNaN(a))return u;n[i+u]=a}return u}function qr(n,r,i,e){return k(C(r,n.length-i),n,i,e)}function nr(n,r,i,e){return k(ai(r),n,i,e)}function Zr(n,r,i,e){return nr(n,r,i,e)}function Kr(n,r,i,e){return k(or(r),n,i,e)}function $r(n,r,i,e){return k(hi(r,n.length-i),n,i,e)}o.prototype.write=function(r,i,e,t){if(i===void 0)t="utf8",e=this.length,i=0;else if(e===void 0&&typeof i=="string")t=i,e=this.length,i=0;else if(isFinite(i))i=i|0,isFinite(e)?(e=e|0,t===void 0&&(t="utf8")):(t=e,e=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var f=this.length-i;if((e===void 0||e>f)&&(e=f),r.length>0&&(e<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");t||(t="utf8");for(var u=!1;;)switch(t){case"hex":return Xr(this,r,i,e);case"utf8":case"utf-8":return qr(this,r,i,e);case"ascii":return nr(this,r,i,e);case"latin1":case"binary":return Zr(this,r,i,e);case"base64":return Kr(this,r,i,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $r(this,r,i,e);default:if(u)throw new TypeError("Unknown encoding: "+t);t=(""+t).toLowerCase(),u=!0}};o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function br(n,r,i){return r===0&&i===n.length?q(n):q(n.slice(r,i))}function er(n,r,i){i=Math.min(n.length,i);for(var e=[],t=r;t<i;){var f=n[t],u=null,a=f>239?4:f>223?3:f>191?2:1;if(t+a<=i){var h,s,l,c;switch(a){case 1:f<128&&(u=f);break;case 2:h=n[t+1],(h&192)===128&&(c=(f&31)<<6|h&63,c>127&&(u=c));break;case 3:h=n[t+1],s=n[t+2],(h&192)===128&&(s&192)===128&&(c=(f&15)<<12|(h&63)<<6|s&63,c>2047&&(c<55296||c>57343)&&(u=c));break;case 4:h=n[t+1],s=n[t+2],l=n[t+3],(h&192)===128&&(s&192)===128&&(l&192)===128&&(c=(f&15)<<18|(h&63)<<12|(s&63)<<6|l&63,c>65535&&c<1114112&&(u=c))}}u===null?(u=65533,a=1):u>65535&&(u-=65536,e.push(u>>>10&1023|55296),u=56320|u&1023),e.push(u),t+=a}return jr(e)}var K=4096;function jr(n){var r=n.length;if(r<=K)return String.fromCharCode.apply(String,n);for(var i="",e=0;e<r;)i+=String.fromCharCode.apply(String,n.slice(e,e+=K));return i}function ri(n,r,i){var e="";i=Math.min(n.length,i);for(var t=r;t<i;++t)e+=String.fromCharCode(n[t]&127);return e}function ii(n,r,i){var e="";i=Math.min(n.length,i);for(var t=r;t<i;++t)e+=String.fromCharCode(n[t]);return e}function ni(n,r,i){var e=n.length;(!r||r<0)&&(r=0),(!i||i<0||i>e)&&(i=e);for(var t="",f=r;f<i;++f)t+=oi(n[f]);return t}function ei(n,r,i){for(var e=n.slice(r,i),t="",f=0;f<e.length;f+=2)t+=String.fromCharCode(e[f]+e[f+1]*256);return t}o.prototype.slice=function(r,i){var e=this.length;r=~~r,i=i===void 0?e:~~i,r<0?(r+=e,r<0&&(r=0)):r>e&&(r=e),i<0?(i+=e,i<0&&(i=0)):i>e&&(i=e),i<r&&(i=r);var t;if(o.TYPED_ARRAY_SUPPORT)t=this.subarray(r,i),t.__proto__=o.prototype;else{var f=i-r;t=new o(f,void 0);for(var u=0;u<f;++u)t[u]=this[u+r]}return t};function p(n,r,i){if(n%1!==0||n<0)throw new RangeError("offset is not uint");if(n+r>i)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUIntLE=function(r,i,e){r=r|0,i=i|0,e||p(r,i,this.length);for(var t=this[r],f=1,u=0;++u<i&&(f*=256);)t+=this[r+u]*f;return t};o.prototype.readUIntBE=function(r,i,e){r=r|0,i=i|0,e||p(r,i,this.length);for(var t=this[r+--i],f=1;i>0&&(f*=256);)t+=this[r+--i]*f;return t};o.prototype.readUInt8=function(r,i){return i||p(r,1,this.length),this[r]};o.prototype.readUInt16LE=function(r,i){return i||p(r,2,this.length),this[r]|this[r+1]<<8};o.prototype.readUInt16BE=function(r,i){return i||p(r,2,this.length),this[r]<<8|this[r+1]};o.prototype.readUInt32LE=function(r,i){return i||p(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};o.prototype.readUInt32BE=function(r,i){return i||p(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};o.prototype.readIntLE=function(r,i,e){r=r|0,i=i|0,e||p(r,i,this.length);for(var t=this[r],f=1,u=0;++u<i&&(f*=256);)t+=this[r+u]*f;return f*=128,t>=f&&(t-=Math.pow(2,8*i)),t};o.prototype.readIntBE=function(r,i,e){r=r|0,i=i|0,e||p(r,i,this.length);for(var t=i,f=1,u=this[r+--t];t>0&&(f*=256);)u+=this[r+--t]*f;return f*=128,u>=f&&(u-=Math.pow(2,8*i)),u};o.prototype.readInt8=function(r,i){return i||p(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};o.prototype.readInt16LE=function(r,i){i||p(r,2,this.length);var e=this[r]|this[r+1]<<8;return e&32768?e|4294901760:e};o.prototype.readInt16BE=function(r,i){i||p(r,2,this.length);var e=this[r+1]|this[r]<<8;return e&32768?e|4294901760:e};o.prototype.readInt32LE=function(r,i){return i||p(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};o.prototype.readInt32BE=function(r,i){return i||p(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};o.prototype.readFloatLE=function(r,i){return i||p(r,4,this.length),N(this,r,!0,23,4)};o.prototype.readFloatBE=function(r,i){return i||p(r,4,this.length),N(this,r,!1,23,4)};o.prototype.readDoubleLE=function(r,i){return i||p(r,8,this.length),N(this,r,!0,52,8)};o.prototype.readDoubleBE=function(r,i){return i||p(r,8,this.length),N(this,r,!1,52,8)};function w(n,r,i,e,t,f){if(!g(n))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>t||r<f)throw new RangeError('"value" argument is out of bounds');if(i+e>n.length)throw new RangeError("Index out of range")}o.prototype.writeUIntLE=function(r,i,e,t){if(r=+r,i=i|0,e=e|0,!t){var f=Math.pow(2,8*e)-1;w(this,r,i,e,f,0)}var u=1,a=0;for(this[i]=r&255;++a<e&&(u*=256);)this[i+a]=r/u&255;return i+e};o.prototype.writeUIntBE=function(r,i,e,t){if(r=+r,i=i|0,e=e|0,!t){var f=Math.pow(2,8*e)-1;w(this,r,i,e,f,0)}var u=e-1,a=1;for(this[i+u]=r&255;--u>=0&&(a*=256);)this[i+u]=r/a&255;return i+e};o.prototype.writeUInt8=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,1,255,0),o.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[i]=r&255,i+1};function D(n,r,i,e){r<0&&(r=65535+r+1);for(var t=0,f=Math.min(n.length-i,2);t<f;++t)n[i+t]=(r&255<<8*(e?t:1-t))>>>(e?t:1-t)*8}o.prototype.writeUInt16LE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[i]=r&255,this[i+1]=r>>>8):D(this,r,i,!0),i+2};o.prototype.writeUInt16BE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[i]=r>>>8,this[i+1]=r&255):D(this,r,i,!1),i+2};function M(n,r,i,e){r<0&&(r=4294967295+r+1);for(var t=0,f=Math.min(n.length-i,4);t<f;++t)n[i+t]=r>>>(e?t:3-t)*8&255}o.prototype.writeUInt32LE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[i+3]=r>>>24,this[i+2]=r>>>16,this[i+1]=r>>>8,this[i]=r&255):M(this,r,i,!0),i+4};o.prototype.writeUInt32BE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[i]=r>>>24,this[i+1]=r>>>16,this[i+2]=r>>>8,this[i+3]=r&255):M(this,r,i,!1),i+4};o.prototype.writeIntLE=function(r,i,e,t){if(r=+r,i=i|0,!t){var f=Math.pow(2,8*e-1);w(this,r,i,e,f-1,-f)}var u=0,a=1,h=0;for(this[i]=r&255;++u<e&&(a*=256);)r<0&&h===0&&this[i+u-1]!==0&&(h=1),this[i+u]=(r/a>>0)-h&255;return i+e};o.prototype.writeIntBE=function(r,i,e,t){if(r=+r,i=i|0,!t){var f=Math.pow(2,8*e-1);w(this,r,i,e,f-1,-f)}var u=e-1,a=1,h=0;for(this[i+u]=r&255;--u>=0&&(a*=256);)r<0&&h===0&&this[i+u+1]!==0&&(h=1),this[i+u]=(r/a>>0)-h&255;return i+e};o.prototype.writeInt8=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,1,127,-128),o.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[i]=r&255,i+1};o.prototype.writeInt16LE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[i]=r&255,this[i+1]=r>>>8):D(this,r,i,!0),i+2};o.prototype.writeInt16BE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[i]=r>>>8,this[i+1]=r&255):D(this,r,i,!1),i+2};o.prototype.writeInt32LE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[i]=r&255,this[i+1]=r>>>8,this[i+2]=r>>>16,this[i+3]=r>>>24):M(this,r,i,!0),i+4};o.prototype.writeInt32BE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),o.TYPED_ARRAY_SUPPORT?(this[i]=r>>>24,this[i+1]=r>>>16,this[i+2]=r>>>8,this[i+3]=r&255):M(this,r,i,!1),i+4};function tr(n,r,i,e,t,f){if(i+e>n.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function fr(n,r,i,e,t){return t||tr(n,r,i,4,34028234663852886e22,-34028234663852886e22),hr(n,r,i,e,23,4),i+4}o.prototype.writeFloatLE=function(r,i,e){return fr(this,r,i,!0,e)};o.prototype.writeFloatBE=function(r,i,e){return fr(this,r,i,!1,e)};function ur(n,r,i,e,t){return t||tr(n,r,i,8,17976931348623157e292,-17976931348623157e292),hr(n,r,i,e,52,8),i+8}o.prototype.writeDoubleLE=function(r,i,e){return ur(this,r,i,!0,e)};o.prototype.writeDoubleBE=function(r,i,e){return ur(this,r,i,!1,e)};o.prototype.copy=function(r,i,e,t){if(e||(e=0),!t&&t!==0&&(t=this.length),i>=r.length&&(i=r.length),i||(i=0),t>0&&t<e&&(t=e),t===e||r.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(t<0)throw new RangeError("sourceEnd out of bounds");t>this.length&&(t=this.length),r.length-i<t-e&&(t=r.length-i+e);var f=t-e,u;if(this===r&&e<i&&i<t)for(u=f-1;u>=0;--u)r[u+i]=this[u+e];else if(f<1e3||!o.TYPED_ARRAY_SUPPORT)for(u=0;u<f;++u)r[u+i]=this[u+e];else Uint8Array.prototype.set.call(r,this.subarray(e,e+f),i);return f};o.prototype.fill=function(r,i,e,t){if(typeof r=="string"){if(typeof i=="string"?(t=i,i=0,e=this.length):typeof e=="string"&&(t=e,e=this.length),r.length===1){var f=r.charCodeAt(0);f<256&&(r=f)}if(t!==void 0&&typeof t!="string")throw new TypeError("encoding must be a string");if(typeof t=="string"&&!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t)}else typeof r=="number"&&(r=r&255);if(i<0||this.length<i||this.length<e)throw new RangeError("Out of range index");if(e<=i)return this;i=i>>>0,e=e===void 0?this.length:e>>>0,r||(r=0);var u;if(typeof r=="number")for(u=i;u<e;++u)this[u]=r;else{var a=g(r)?r:C(new o(r,t).toString()),h=a.length;for(u=0;u<e-i;++u)this[u+i]=a[u%h]}return this};var ti=/[^+\/0-9A-Za-z-_]/g;function fi(n){if(n=ui(n).replace(ti,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function ui(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function oi(n){return n<16?"0"+n.toString(16):n.toString(16)}function C(n,r){r=r||1/0;for(var i,e=n.length,t=null,f=[],u=0;u<e;++u){if(i=n.charCodeAt(u),i>55295&&i<57344){if(!t){if(i>56319){(r-=3)>-1&&f.push(239,191,189);continue}else if(u+1===e){(r-=3)>-1&&f.push(239,191,189);continue}t=i;continue}if(i<56320){(r-=3)>-1&&f.push(239,191,189),t=i;continue}i=(t-55296<<10|i-56320)+65536}else t&&(r-=3)>-1&&f.push(239,191,189);if(t=null,i<128){if((r-=1)<0)break;f.push(i)}else if(i<2048){if((r-=2)<0)break;f.push(i>>6|192,i&63|128)}else if(i<65536){if((r-=3)<0)break;f.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((r-=4)<0)break;f.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return f}function ai(n){for(var r=[],i=0;i<n.length;++i)r.push(n.charCodeAt(i)&255);return r}function hi(n,r){for(var i,e,t,f=[],u=0;u<n.length&&!((r-=2)<0);++u)i=n.charCodeAt(u),e=i>>8,t=i%256,f.push(t),f.push(e);return f}function or(n){return Wr(fi(n))}function k(n,r,i,e){for(var t=0;t<e&&!(t+i>=r.length||t>=n.length);++t)r[t+i]=n[t];return t}function ci(n){return n!==n}function si(n){return n!=null&&(!!n._isBuffer||ar(n)||li(n))}function ar(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function li(n){return typeof n.readFloatLE=="function"&&typeof n.slice=="function"&&ar(n.slice(0,0))}function N(n,r,i,e,t){var f,u,a=t*8-e-1,h=(1<<a)-1,s=h>>1,l=-7,c=i?t-1:0,m=i?-1:1,x=n[r+c];for(c+=m,f=x&(1<<-l)-1,x>>=-l,l+=a;l>0;f=f*256+n[r+c],c+=m,l-=8);for(u=f&(1<<-l)-1,f>>=-l,l+=e;l>0;u=u*256+n[r+c],c+=m,l-=8);if(f===0)f=1-s;else{if(f===h)return u?NaN:(x?-1:1)*(1/0);u=u+Math.pow(2,e),f=f-s}return(x?-1:1)*u*Math.pow(2,f-e)}function hr(n,r,i,e,t,f){var u,a,h,s=f*8-t-1,l=(1<<s)-1,c=l>>1,m=t===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=e?0:f-1,d=e?1:-1,cr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,u=l):(u=Math.floor(Math.log(r)/Math.LN2),r*(h=Math.pow(2,-u))<1&&(u--,h*=2),u+c>=1?r+=m/h:r+=m*Math.pow(2,1-c),r*h>=2&&(u++,h/=2),u+c>=l?(a=0,u=l):u+c>=1?(a=(r*h-1)*Math.pow(2,t),u=u+c):(a=r*Math.pow(2,c-1)*Math.pow(2,t),u=0));t>=8;n[i+x]=a&255,x+=d,a/=256,t-=8);for(u=u<<t|a,s+=t;s>0;n[i+x]=u&255,x+=d,u/=256,s-=8);n[i+x-d]|=cr*128}function gi(n,r){return{id:n.id,address:n.address,chainId:n.chainId,name:n.name,unitName:n.unitName,decimals:n.decimals,isGas:n.isGas,img:n.img,cmcLink:n.cmcLink,isArchived:r?r(n):!1}}export{gi as mapToCodexAssetDto};
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
5
|
+
(*!
|
|
6
|
+
* The buffer module from node.js, for the browser.
|
|
7
|
+
*
|
|
8
|
+
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
9
|
+
* @license MIT
|
|
10
|
+
*)
|
|
11
|
+
*/
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function G(){throw new Error("setTimeout has not been defined")}function J(){throw new Error("clearTimeout has not been defined")}var R=G,I=J;typeof globalThis.setTimeout=="function"&&(R=setTimeout);typeof globalThis.clearTimeout=="function"&&(I=clearTimeout);function O(i){if(R===setTimeout)return setTimeout(i,0);if((R===G||!R)&&setTimeout)return R=setTimeout,setTimeout(i,0);try{return R(i,0)}catch{try{return R.call(null,i,0)}catch{return R.call(this,i,0)}}}function lr(i){if(I===clearTimeout)return clearTimeout(i);if((I===J||!I)&&clearTimeout)return I=clearTimeout,clearTimeout(i);try{return I(i)}catch{try{return I.call(null,i)}catch{return I.call(this,i)}}}var y=[],Y=!1,_,S=-1;function pr(){!Y||!_||(Y=!1,_.length?y=_.concat(y):S=-1,y.length&&Q())}function Q(){if(!Y){var i=O(pr);Y=!0;for(var r=y.length;r;){for(_=y,y=[];++S<r;)_&&_[S].run();S=-1,r=y.length}_=null,Y=!1,lr(i)}}function sr(i){var r=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)r[n-1]=arguments[n];y.push(new X(i,r)),y.length===1&&!Y&&O(Q)}function X(i,r){this.fun=i,this.array=r}X.prototype.run=function(){this.fun.apply(null,this.array)};var wr="browser",xr="browser",Er=!0,mr={},Ar=[],gr="",yr={},Tr={},Rr={};function d(){}var Ir=d,_r=d,dr=d,vr=d,Ur=d,Br=d,Yr=d;function Sr(i){throw new Error("process.binding is not supported")}function Pr(){return"/"}function Cr(i){throw new Error("process.chdir is not supported")}function kr(){return 0}var B=globalThis.performance||{},Dr=B.now||B.mozNow||B.msNow||B.oNow||B.webkitNow||function(){return new Date().getTime()};function Mr(i){var r=Dr.call(B)*.001,n=Math.floor(r),e=Math.floor(r%1*1e9);return i&&(n=n-i[0],e=e-i[1],e<0&&(n--,e+=1e9)),[n,e]}var Nr=new Date;function Lr(){var i=new Date,r=i-Nr;return r/1e3}var L={nextTick:sr,title:wr,browser:Er,env:mr,argv:Ar,version:gr,versions:yr,on:Ir,addListener:_r,once:dr,off:vr,removeListener:Ur,removeAllListeners:Br,emit:Yr,binding:Sr,cwd:Pr,chdir:Cr,umask:kr,hrtime:Mr,platform:xr,release:Tr,config:Rr,uptime:Lr},z={};Object.keys(z).forEach(i=>{let r=i.split("."),n=L;for(let e=0;e<r.length;e++){let t=r[e];e===r.length-1?n[t]=z[i]:n=n[t]||(n[t]={})}});var A=[],E=[],Fr=typeof Uint8Array<"u"?Uint8Array:Array,W=!1;function $(){W=!0;for(var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,n=i.length;r<n;++r)A[r]=i[r],E[i.charCodeAt(r)]=r;E[45]=62,E[95]=63}function Wr(i){W||$();var r,n,e,t,f,u,a=i.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");f=i[a-2]==="="?2:i[a-1]==="="?1:0,u=new Fr(a*3/4-f),e=f>0?a-4:a;var h=0;for(r=0,n=0;r<e;r+=4,n+=3)t=E[i.charCodeAt(r)]<<18|E[i.charCodeAt(r+1)]<<12|E[i.charCodeAt(r+2)]<<6|E[i.charCodeAt(r+3)],u[h++]=t>>16&255,u[h++]=t>>8&255,u[h++]=t&255;return f===2?(t=E[i.charCodeAt(r)]<<2|E[i.charCodeAt(r+1)]>>4,u[h++]=t&255):f===1&&(t=E[i.charCodeAt(r)]<<10|E[i.charCodeAt(r+1)]<<4|E[i.charCodeAt(r+2)]>>2,u[h++]=t>>8&255,u[h++]=t&255),u}function Hr(i){return A[i>>18&63]+A[i>>12&63]+A[i>>6&63]+A[i&63]}function Vr(i,r,n){for(var e,t=[],f=r;f<n;f+=3)e=(i[f]<<16)+(i[f+1]<<8)+i[f+2],t.push(Hr(e));return t.join("")}function q(i){W||$();for(var r,n=i.length,e=n%3,t="",f=[],u=16383,a=0,h=n-e;a<h;a+=u)f.push(Vr(i,a,a+u>h?h:a+u));return e===1?(r=i[n-1],t+=A[r>>2],t+=A[r<<4&63],t+="=="):e===2&&(r=(i[n-2]<<8)+i[n-1],t+=A[r>>10],t+=A[r>>4&63],t+=A[r<<2&63],t+="="),f.push(t),f.join("")}o.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function P(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function T(i,r){if(P()<r)throw new RangeError("Invalid typed array length");return o.TYPED_ARRAY_SUPPORT?(i=new Uint8Array(r),i.__proto__=o.prototype):(i===null&&(i=new o(r)),i.length=r),i}function o(i,r,n){if(!o.TYPED_ARRAY_SUPPORT&&!(this instanceof o))return new o(i,r,n);if(typeof i=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return H(this,i)}return b(this,i,r,n)}o.poolSize=8192;o._augment=function(i){return i.__proto__=o.prototype,i};function b(i,r,n,e){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Jr(i,r,n,e):typeof r=="string"?Gr(i,r,n):Or(i,r)}o.from=function(i,r,n){return b(null,i,r,n)};o.kMaxLength=P();o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&o[Symbol.species]);function j(i){if(typeof i!="number")throw new TypeError('"size" argument must be a number');if(i<0)throw new RangeError('"size" argument must not be negative')}function zr(i,r,n,e){return j(r),r<=0?T(i,r):n!==void 0?typeof e=="string"?T(i,r).fill(n,e):T(i,r).fill(n):T(i,r)}o.alloc=function(i,r,n){return zr(null,i,r,n)};function H(i,r){if(j(r),i=T(i,r<0?0:V(r)|0),!o.TYPED_ARRAY_SUPPORT)for(var n=0;n<r;++n)i[n]=0;return i}o.allocUnsafe=function(i){return H(null,i)};o.allocUnsafeSlow=function(i){return H(null,i)};function Gr(i,r,n){if((typeof n!="string"||n==="")&&(n="utf8"),!o.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var e=rr(r,n)|0;i=T(i,e);var t=i.write(r,n);return t!==e&&(i=i.slice(0,t)),i}function F(i,r){var n=r.length<0?0:V(r.length)|0;i=T(i,n);for(var e=0;e<n;e+=1)i[e]=r[e]&255;return i}function Jr(i,r,n,e){if(r.byteLength,n<0||r.byteLength<n)throw new RangeError("'offset' is out of bounds");if(r.byteLength<n+(e||0))throw new RangeError("'length' is out of bounds");return n===void 0&&e===void 0?r=new Uint8Array(r):e===void 0?r=new Uint8Array(r,n):r=new Uint8Array(r,n,e),o.TYPED_ARRAY_SUPPORT?(i=r,i.__proto__=o.prototype):i=F(i,r),i}function Or(i,r){if(g(r)){var n=V(r.length)|0;return i=T(i,n),i.length===0||r.copy(i,0,0,n),i}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||ln(r.length)?T(i,0):F(i,r);if(r.type==="Buffer"&&Array.isArray(r.data))return F(i,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function V(i){if(i>=P())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+P().toString(16)+" bytes");return i|0}o.isBuffer=pn;function g(i){return!!(i!=null&&i._isBuffer)}o.compare=function(r,n){if(!g(r)||!g(n))throw new TypeError("Arguments must be Buffers");if(r===n)return 0;for(var e=r.length,t=n.length,f=0,u=Math.min(e,t);f<u;++f)if(r[f]!==n[f]){e=r[f],t=n[f];break}return e<t?-1:t<e?1:0};o.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};o.concat=function(r,n){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return o.alloc(0);var e;if(n===void 0)for(n=0,e=0;e<r.length;++e)n+=r[e].length;var t=o.allocUnsafe(n),f=0;for(e=0;e<r.length;++e){var u=r[e];if(!g(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(t,f),f+=u.length}return t};function rr(i,r){if(g(i))return i.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(i)||i instanceof ArrayBuffer))return i.byteLength;typeof i!="string"&&(i=""+i);var n=i.length;if(n===0)return 0;for(var e=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return C(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return or(i).length;default:if(e)return C(i).length;r=(""+r).toLowerCase(),e=!0}}o.byteLength=rr;function Qr(i,r,n){var e=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,r>>>=0,n<=r))return"";for(i||(i="utf8");;)switch(i){case"hex":return en(this,r,n);case"utf8":case"utf-8":return er(this,r,n);case"ascii":return rn(this,r,n);case"latin1":case"binary":return nn(this,r,n);case"base64":return br(this,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return tn(this,r,n);default:if(e)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),e=!0}}o.prototype._isBuffer=!0;function v(i,r,n){var e=i[r];i[r]=i[n],i[n]=e}o.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var n=0;n<r;n+=2)v(this,n,n+1);return this};o.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var n=0;n<r;n+=4)v(this,n,n+3),v(this,n+1,n+2);return this};o.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var n=0;n<r;n+=8)v(this,n,n+7),v(this,n+1,n+6),v(this,n+2,n+5),v(this,n+3,n+4);return this};o.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?er(this,0,r):Qr.apply(this,arguments)};o.prototype.equals=function(r){if(!g(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:o.compare(this,r)===0};o.prototype.compare=function(r,n,e,t,f){if(!g(r))throw new TypeError("Argument must be a Buffer");if(n===void 0&&(n=0),e===void 0&&(e=r?r.length:0),t===void 0&&(t=0),f===void 0&&(f=this.length),n<0||e>r.length||t<0||f>this.length)throw new RangeError("out of range index");if(t>=f&&n>=e)return 0;if(t>=f)return-1;if(n>=e)return 1;if(n>>>=0,e>>>=0,t>>>=0,f>>>=0,this===r)return 0;for(var u=f-t,a=e-n,h=Math.min(u,a),l=this.slice(t,f),p=r.slice(n,e),c=0;c<h;++c)if(l[c]!==p[c]){u=l[c],a=p[c];break}return u<a?-1:a<u?1:0};function nr(i,r,n,e,t){if(i.length===0)return-1;if(typeof n=="string"?(e=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=t?0:i.length-1),n<0&&(n=i.length+n),n>=i.length){if(t)return-1;n=i.length-1}else if(n<0)if(t)n=0;else return-1;if(typeof r=="string"&&(r=o.from(r,e)),g(r))return r.length===0?-1:Z(i,r,n,e,t);if(typeof r=="number")return r=r&255,o.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?t?Uint8Array.prototype.indexOf.call(i,r,n):Uint8Array.prototype.lastIndexOf.call(i,r,n):Z(i,[r],n,e,t);throw new TypeError("val must be string, number or Buffer")}function Z(i,r,n,e,t){var f=1,u=i.length,a=r.length;if(e!==void 0&&(e=String(e).toLowerCase(),e==="ucs2"||e==="ucs-2"||e==="utf16le"||e==="utf-16le")){if(i.length<2||r.length<2)return-1;f=2,u/=2,a/=2,n/=2}function h(x,U){return f===1?x[U]:x.readUInt16BE(U*f)}var l;if(t){var p=-1;for(l=n;l<u;l++)if(h(i,l)===h(r,p===-1?0:l-p)){if(p===-1&&(p=l),l-p+1===a)return p*f}else p!==-1&&(l-=l-p),p=-1}else for(n+a>u&&(n=u-a),l=n;l>=0;l--){for(var c=!0,m=0;m<a;m++)if(h(i,l+m)!==h(r,m)){c=!1;break}if(c)return l}return-1}o.prototype.includes=function(r,n,e){return this.indexOf(r,n,e)!==-1};o.prototype.indexOf=function(r,n,e){return nr(this,r,n,e,!0)};o.prototype.lastIndexOf=function(r,n,e){return nr(this,r,n,e,!1)};function Xr(i,r,n,e){n=Number(n)||0;var t=i.length-n;e?(e=Number(e),e>t&&(e=t)):e=t;var f=r.length;if(f%2!==0)throw new TypeError("Invalid hex string");e>f/2&&(e=f/2);for(var u=0;u<e;++u){var a=parseInt(r.substr(u*2,2),16);if(isNaN(a))return u;i[n+u]=a}return u}function qr(i,r,n,e){return M(C(r,i.length-n),i,n,e)}function ir(i,r,n,e){return M(hn(r),i,n,e)}function Zr(i,r,n,e){return ir(i,r,n,e)}function Kr(i,r,n,e){return M(or(r),i,n,e)}function $r(i,r,n,e){return M(cn(r,i.length-n),i,n,e)}o.prototype.write=function(r,n,e,t){if(n===void 0)t="utf8",e=this.length,n=0;else if(e===void 0&&typeof n=="string")t=n,e=this.length,n=0;else if(isFinite(n))n=n|0,isFinite(e)?(e=e|0,t===void 0&&(t="utf8")):(t=e,e=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var f=this.length-n;if((e===void 0||e>f)&&(e=f),r.length>0&&(e<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");t||(t="utf8");for(var u=!1;;)switch(t){case"hex":return Xr(this,r,n,e);case"utf8":case"utf-8":return qr(this,r,n,e);case"ascii":return ir(this,r,n,e);case"latin1":case"binary":return Zr(this,r,n,e);case"base64":return Kr(this,r,n,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $r(this,r,n,e);default:if(u)throw new TypeError("Unknown encoding: "+t);t=(""+t).toLowerCase(),u=!0}};o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function br(i,r,n){return r===0&&n===i.length?q(i):q(i.slice(r,n))}function er(i,r,n){n=Math.min(i.length,n);for(var e=[],t=r;t<n;){var f=i[t],u=null,a=f>239?4:f>223?3:f>191?2:1;if(t+a<=n){var h,l,p,c;switch(a){case 1:f<128&&(u=f);break;case 2:h=i[t+1],(h&192)===128&&(c=(f&31)<<6|h&63,c>127&&(u=c));break;case 3:h=i[t+1],l=i[t+2],(h&192)===128&&(l&192)===128&&(c=(f&15)<<12|(h&63)<<6|l&63,c>2047&&(c<55296||c>57343)&&(u=c));break;case 4:h=i[t+1],l=i[t+2],p=i[t+3],(h&192)===128&&(l&192)===128&&(p&192)===128&&(c=(f&15)<<18|(h&63)<<12|(l&63)<<6|p&63,c>65535&&c<1114112&&(u=c))}}u===null?(u=65533,a=1):u>65535&&(u-=65536,e.push(u>>>10&1023|55296),u=56320|u&1023),e.push(u),t+=a}return jr(e)}var K=4096;function jr(i){var r=i.length;if(r<=K)return String.fromCharCode.apply(String,i);for(var n="",e=0;e<r;)n+=String.fromCharCode.apply(String,i.slice(e,e+=K));return n}function rn(i,r,n){var e="";n=Math.min(i.length,n);for(var t=r;t<n;++t)e+=String.fromCharCode(i[t]&127);return e}function nn(i,r,n){var e="";n=Math.min(i.length,n);for(var t=r;t<n;++t)e+=String.fromCharCode(i[t]);return e}function en(i,r,n){var e=i.length;(!r||r<0)&&(r=0),(!n||n<0||n>e)&&(n=e);for(var t="",f=r;f<n;++f)t+=an(i[f]);return t}function tn(i,r,n){for(var e=i.slice(r,n),t="",f=0;f<e.length;f+=2)t+=String.fromCharCode(e[f]+e[f+1]*256);return t}o.prototype.slice=function(r,n){var e=this.length;r=~~r,n=n===void 0?e:~~n,r<0?(r+=e,r<0&&(r=0)):r>e&&(r=e),n<0?(n+=e,n<0&&(n=0)):n>e&&(n=e),n<r&&(n=r);var t;if(o.TYPED_ARRAY_SUPPORT)t=this.subarray(r,n),t.__proto__=o.prototype;else{var f=n-r;t=new o(f,void 0);for(var u=0;u<f;++u)t[u]=this[u+r]}return t};function s(i,r,n){if(i%1!==0||i<0)throw new RangeError("offset is not uint");if(i+r>n)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUIntLE=function(r,n,e){r=r|0,n=n|0,e||s(r,n,this.length);for(var t=this[r],f=1,u=0;++u<n&&(f*=256);)t+=this[r+u]*f;return t};o.prototype.readUIntBE=function(r,n,e){r=r|0,n=n|0,e||s(r,n,this.length);for(var t=this[r+--n],f=1;n>0&&(f*=256);)t+=this[r+--n]*f;return t};o.prototype.readUInt8=function(r,n){return n||s(r,1,this.length),this[r]};o.prototype.readUInt16LE=function(r,n){return n||s(r,2,this.length),this[r]|this[r+1]<<8};o.prototype.readUInt16BE=function(r,n){return n||s(r,2,this.length),this[r]<<8|this[r+1]};o.prototype.readUInt32LE=function(r,n){return n||s(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};o.prototype.readUInt32BE=function(r,n){return n||s(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};o.prototype.readIntLE=function(r,n,e){r=r|0,n=n|0,e||s(r,n,this.length);for(var t=this[r],f=1,u=0;++u<n&&(f*=256);)t+=this[r+u]*f;return f*=128,t>=f&&(t-=Math.pow(2,8*n)),t};o.prototype.readIntBE=function(r,n,e){r=r|0,n=n|0,e||s(r,n,this.length);for(var t=n,f=1,u=this[r+--t];t>0&&(f*=256);)u+=this[r+--t]*f;return f*=128,u>=f&&(u-=Math.pow(2,8*n)),u};o.prototype.readInt8=function(r,n){return n||s(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};o.prototype.readInt16LE=function(r,n){n||s(r,2,this.length);var e=this[r]|this[r+1]<<8;return e&32768?e|4294901760:e};o.prototype.readInt16BE=function(r,n){n||s(r,2,this.length);var e=this[r+1]|this[r]<<8;return e&32768?e|4294901760:e};o.prototype.readInt32LE=function(r,n){return n||s(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};o.prototype.readInt32BE=function(r,n){return n||s(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};o.prototype.readFloatLE=function(r,n){return n||s(r,4,this.length),N(this,r,!0,23,4)};o.prototype.readFloatBE=function(r,n){return n||s(r,4,this.length),N(this,r,!1,23,4)};o.prototype.readDoubleLE=function(r,n){return n||s(r,8,this.length),N(this,r,!0,52,8)};o.prototype.readDoubleBE=function(r,n){return n||s(r,8,this.length),N(this,r,!1,52,8)};function w(i,r,n,e,t,f){if(!g(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>t||r<f)throw new RangeError('"value" argument is out of bounds');if(n+e>i.length)throw new RangeError("Index out of range")}o.prototype.writeUIntLE=function(r,n,e,t){if(r=+r,n=n|0,e=e|0,!t){var f=Math.pow(2,8*e)-1;w(this,r,n,e,f,0)}var u=1,a=0;for(this[n]=r&255;++a<e&&(u*=256);)this[n+a]=r/u&255;return n+e};o.prototype.writeUIntBE=function(r,n,e,t){if(r=+r,n=n|0,e=e|0,!t){var f=Math.pow(2,8*e)-1;w(this,r,n,e,f,0)}var u=e-1,a=1;for(this[n+u]=r&255;--u>=0&&(a*=256);)this[n+u]=r/a&255;return n+e};o.prototype.writeUInt8=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,1,255,0),o.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[n]=r&255,n+1};function k(i,r,n,e){r<0&&(r=65535+r+1);for(var t=0,f=Math.min(i.length-n,2);t<f;++t)i[n+t]=(r&255<<8*(e?t:1-t))>>>(e?t:1-t)*8}o.prototype.writeUInt16LE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8):k(this,r,n,!0),n+2};o.prototype.writeUInt16BE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[n]=r>>>8,this[n+1]=r&255):k(this,r,n,!1),n+2};function D(i,r,n,e){r<0&&(r=4294967295+r+1);for(var t=0,f=Math.min(i.length-n,4);t<f;++t)i[n+t]=r>>>(e?t:3-t)*8&255}o.prototype.writeUInt32LE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[n+3]=r>>>24,this[n+2]=r>>>16,this[n+1]=r>>>8,this[n]=r&255):D(this,r,n,!0),n+4};o.prototype.writeUInt32BE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255):D(this,r,n,!1),n+4};o.prototype.writeIntLE=function(r,n,e,t){if(r=+r,n=n|0,!t){var f=Math.pow(2,8*e-1);w(this,r,n,e,f-1,-f)}var u=0,a=1,h=0;for(this[n]=r&255;++u<e&&(a*=256);)r<0&&h===0&&this[n+u-1]!==0&&(h=1),this[n+u]=(r/a>>0)-h&255;return n+e};o.prototype.writeIntBE=function(r,n,e,t){if(r=+r,n=n|0,!t){var f=Math.pow(2,8*e-1);w(this,r,n,e,f-1,-f)}var u=e-1,a=1,h=0;for(this[n+u]=r&255;--u>=0&&(a*=256);)r<0&&h===0&&this[n+u+1]!==0&&(h=1),this[n+u]=(r/a>>0)-h&255;return n+e};o.prototype.writeInt8=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,1,127,-128),o.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[n]=r&255,n+1};o.prototype.writeInt16LE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8):k(this,r,n,!0),n+2};o.prototype.writeInt16BE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[n]=r>>>8,this[n+1]=r&255):k(this,r,n,!1),n+2};o.prototype.writeInt32LE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8,this[n+2]=r>>>16,this[n+3]=r>>>24):D(this,r,n,!0),n+4};o.prototype.writeInt32BE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),o.TYPED_ARRAY_SUPPORT?(this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255):D(this,r,n,!1),n+4};function tr(i,r,n,e,t,f){if(n+e>i.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function fr(i,r,n,e,t){return t||tr(i,r,n,4,34028234663852886e22,-34028234663852886e22),hr(i,r,n,e,23,4),n+4}o.prototype.writeFloatLE=function(r,n,e){return fr(this,r,n,!0,e)};o.prototype.writeFloatBE=function(r,n,e){return fr(this,r,n,!1,e)};function ur(i,r,n,e,t){return t||tr(i,r,n,8,17976931348623157e292,-17976931348623157e292),hr(i,r,n,e,52,8),n+8}o.prototype.writeDoubleLE=function(r,n,e){return ur(this,r,n,!0,e)};o.prototype.writeDoubleBE=function(r,n,e){return ur(this,r,n,!1,e)};o.prototype.copy=function(r,n,e,t){if(e||(e=0),!t&&t!==0&&(t=this.length),n>=r.length&&(n=r.length),n||(n=0),t>0&&t<e&&(t=e),t===e||r.length===0||this.length===0)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(t<0)throw new RangeError("sourceEnd out of bounds");t>this.length&&(t=this.length),r.length-n<t-e&&(t=r.length-n+e);var f=t-e,u;if(this===r&&e<n&&n<t)for(u=f-1;u>=0;--u)r[u+n]=this[u+e];else if(f<1e3||!o.TYPED_ARRAY_SUPPORT)for(u=0;u<f;++u)r[u+n]=this[u+e];else Uint8Array.prototype.set.call(r,this.subarray(e,e+f),n);return f};o.prototype.fill=function(r,n,e,t){if(typeof r=="string"){if(typeof n=="string"?(t=n,n=0,e=this.length):typeof e=="string"&&(t=e,e=this.length),r.length===1){var f=r.charCodeAt(0);f<256&&(r=f)}if(t!==void 0&&typeof t!="string")throw new TypeError("encoding must be a string");if(typeof t=="string"&&!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t)}else typeof r=="number"&&(r=r&255);if(n<0||this.length<n||this.length<e)throw new RangeError("Out of range index");if(e<=n)return this;n=n>>>0,e=e===void 0?this.length:e>>>0,r||(r=0);var u;if(typeof r=="number")for(u=n;u<e;++u)this[u]=r;else{var a=g(r)?r:C(new o(r,t).toString()),h=a.length;for(u=0;u<e-n;++u)this[u+n]=a[u%h]}return this};var fn=/[^+\/0-9A-Za-z-_]/g;function un(i){if(i=on(i).replace(fn,""),i.length<2)return"";for(;i.length%4!==0;)i=i+"=";return i}function on(i){return i.trim?i.trim():i.replace(/^\s+|\s+$/g,"")}function an(i){return i<16?"0"+i.toString(16):i.toString(16)}function C(i,r){r=r||1/0;for(var n,e=i.length,t=null,f=[],u=0;u<e;++u){if(n=i.charCodeAt(u),n>55295&&n<57344){if(!t){if(n>56319){(r-=3)>-1&&f.push(239,191,189);continue}else if(u+1===e){(r-=3)>-1&&f.push(239,191,189);continue}t=n;continue}if(n<56320){(r-=3)>-1&&f.push(239,191,189),t=n;continue}n=(t-55296<<10|n-56320)+65536}else t&&(r-=3)>-1&&f.push(239,191,189);if(t=null,n<128){if((r-=1)<0)break;f.push(n)}else if(n<2048){if((r-=2)<0)break;f.push(n>>6|192,n&63|128)}else if(n<65536){if((r-=3)<0)break;f.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((r-=4)<0)break;f.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return f}function hn(i){for(var r=[],n=0;n<i.length;++n)r.push(i.charCodeAt(n)&255);return r}function cn(i,r){for(var n,e,t,f=[],u=0;u<i.length&&!((r-=2)<0);++u)n=i.charCodeAt(u),e=n>>8,t=n%256,f.push(t),f.push(e);return f}function or(i){return Wr(un(i))}function M(i,r,n,e){for(var t=0;t<e&&!(t+n>=r.length||t>=i.length);++t)r[t+n]=i[t];return t}function ln(i){return i!==i}function pn(i){return i!=null&&(!!i._isBuffer||ar(i)||sn(i))}function ar(i){return!!i.constructor&&typeof i.constructor.isBuffer=="function"&&i.constructor.isBuffer(i)}function sn(i){return typeof i.readFloatLE=="function"&&typeof i.slice=="function"&&ar(i.slice(0,0))}function N(i,r,n,e,t){var f,u,a=t*8-e-1,h=(1<<a)-1,l=h>>1,p=-7,c=n?t-1:0,m=n?-1:1,x=i[r+c];for(c+=m,f=x&(1<<-p)-1,x>>=-p,p+=a;p>0;f=f*256+i[r+c],c+=m,p-=8);for(u=f&(1<<-p)-1,f>>=-p,p+=e;p>0;u=u*256+i[r+c],c+=m,p-=8);if(f===0)f=1-l;else{if(f===h)return u?NaN:(x?-1:1)*(1/0);u=u+Math.pow(2,e),f=f-l}return(x?-1:1)*u*Math.pow(2,f-e)}function hr(i,r,n,e,t,f){var u,a,h,l=f*8-t-1,p=(1<<l)-1,c=p>>1,m=t===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=e?0:f-1,U=e?1:-1,cr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,u=p):(u=Math.floor(Math.log(r)/Math.LN2),r*(h=Math.pow(2,-u))<1&&(u--,h*=2),u+c>=1?r+=m/h:r+=m*Math.pow(2,1-c),r*h>=2&&(u++,h/=2),u+c>=p?(a=0,u=p):u+c>=1?(a=(r*h-1)*Math.pow(2,t),u=u+c):(a=r*Math.pow(2,c-1)*Math.pow(2,t),u=0));t>=8;i[n+x]=a&255,x+=U,a/=256,t-=8);for(u=u<<t|a,l+=t;l>0;i[n+x]=u&255,x+=U,u/=256,l-=8);i[n+x-U]|=cr*128}function yn(i){return{hash:i.hash,loginAddress:i.loginAddress,loginChainId:i.loginChainId,tokenId:i.token?.id,tokenAddress:i.tokenId,tokenChainId:i.tokenChainId,amount:i.amount,lockedAmount:i.lockedAmount}}export{yn as mapToCodexBalanceDto};
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
5
|
+
(*!
|
|
6
|
+
* The buffer module from node.js, for the browser.
|
|
7
|
+
*
|
|
8
|
+
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
9
|
+
* @license MIT
|
|
10
|
+
*)
|
|
11
|
+
*/
|