@ultrade/shared 1.0.8 → 1.0.10

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.
Files changed (124) hide show
  1. package/dist/browser/common/auth.helper.js +17 -0
  2. package/dist/browser/common/big-number.helper.js +11 -0
  3. package/dist/browser/common/index.js +17 -0
  4. package/dist/browser/common/mappers/codexAsset.mapper.js +11 -0
  5. package/dist/browser/common/mappers/codexBalance.mapper.js +11 -0
  6. package/dist/browser/common/mappers/index.js +11 -0
  7. package/dist/browser/common/mappers/trade.mapper.js +11 -0
  8. package/dist/browser/common/utils/assert.js +11 -0
  9. package/dist/browser/common/utils/decode.js +11 -0
  10. package/dist/browser/common/utils/index.js +11 -0
  11. package/dist/browser/common/utils/social.js +11 -0
  12. package/dist/browser/common/utils/stat.js +11 -0
  13. package/dist/browser/constants/index.js +11 -0
  14. package/dist/browser/enums/index.js +11 -0
  15. package/dist/browser/helpers/Encoding.js +17 -0
  16. package/dist/browser/helpers/algo.helper.js +17 -0
  17. package/dist/browser/helpers/assert.helper.js +11 -0
  18. package/dist/browser/helpers/atomic.helper.js +11 -0
  19. package/dist/browser/helpers/balance.helper.js +17 -0
  20. package/dist/browser/helpers/codex/common.helper.js +18 -0
  21. package/dist/browser/helpers/codex/index.js +18 -0
  22. package/dist/browser/helpers/codex/mbr.helper.js +17 -0
  23. package/dist/browser/helpers/codex/mna.helper.js +17 -0
  24. package/dist/browser/helpers/codex/order.helper.js +17 -0
  25. package/dist/browser/helpers/codex/setGlobal.helper.js +17 -0
  26. package/dist/browser/helpers/codex/transfer.helper.js +18 -0
  27. package/dist/browser/helpers/codex/txn.helper.js +17 -0
  28. package/dist/browser/helpers/codex.helper.js +24 -0
  29. package/dist/browser/helpers/eth.helper.js +18 -0
  30. package/dist/browser/helpers/index.js +11 -0
  31. package/dist/browser/helpers/interval.helpers.js +11 -0
  32. package/dist/browser/helpers/liquidity.helper.js +11 -0
  33. package/dist/browser/helpers/order.helper.js +11 -0
  34. package/dist/browser/helpers/pair.helper.js +11 -0
  35. package/dist/browser/helpers/pointSystem.helper.js +11 -0
  36. package/dist/browser/helpers/ticker.helpers.js +11 -0
  37. package/dist/browser/helpers/vaa.helper.js +11 -0
  38. package/dist/browser/helpers/withdraw.helper.js +18 -0
  39. package/dist/browser/interfaces/index.js +11 -0
  40. package/dist/browser/types/index.js +11 -0
  41. package/dist/node/common/auth.helper.js +1 -0
  42. package/dist/node/common/big-number.helper.js +1 -0
  43. package/dist/node/common/index.js +1 -0
  44. package/dist/node/common/mappers/codexAsset.mapper.js +1 -0
  45. package/dist/node/common/mappers/codexBalance.mapper.js +1 -0
  46. package/dist/node/common/mappers/index.js +1 -0
  47. package/dist/node/common/mappers/trade.mapper.js +1 -0
  48. package/dist/node/common/utils/assert.js +1 -0
  49. package/dist/node/common/utils/decode.js +1 -0
  50. package/dist/node/common/utils/index.js +1 -0
  51. package/dist/node/common/utils/social.js +1 -0
  52. package/dist/node/common/utils/stat.js +1 -0
  53. package/dist/node/constants/index.js +1 -0
  54. package/dist/node/enums/index.js +1 -0
  55. package/dist/node/helpers/Encoding.js +1 -0
  56. package/dist/node/helpers/algo.helper.js +1 -0
  57. package/dist/node/helpers/assert.helper.js +1 -0
  58. package/dist/node/helpers/atomic.helper.js +1 -0
  59. package/dist/node/helpers/balance.helper.js +1 -0
  60. package/dist/node/helpers/codex/common.helper.js +2 -0
  61. package/dist/node/helpers/codex/index.js +2 -0
  62. package/dist/node/helpers/codex/mbr.helper.js +1 -0
  63. package/dist/node/helpers/codex/mna.helper.js +1 -0
  64. package/dist/node/helpers/codex/order.helper.js +1 -0
  65. package/dist/node/helpers/codex/setGlobal.helper.js +1 -0
  66. package/dist/node/helpers/codex/transfer.helper.js +2 -0
  67. package/dist/node/helpers/codex/txn.helper.js +1 -0
  68. package/dist/node/helpers/codex.helper.js +8 -0
  69. package/dist/node/helpers/eth.helper.js +2 -0
  70. package/dist/node/helpers/index.js +1 -0
  71. package/dist/node/helpers/interval.helpers.js +1 -0
  72. package/dist/node/helpers/liquidity.helper.js +1 -0
  73. package/dist/node/helpers/order.helper.js +1 -0
  74. package/dist/node/helpers/pair.helper.js +1 -0
  75. package/dist/node/helpers/pointSystem.helper.js +1 -0
  76. package/dist/node/helpers/ticker.helpers.js +1 -0
  77. package/dist/node/helpers/vaa.helper.js +0 -0
  78. package/dist/node/helpers/withdraw.helper.js +2 -0
  79. package/dist/node/interfaces/index.js +1 -0
  80. package/dist/node/types/index.js +1 -0
  81. package/dist/src/helpers/vaa.helper.d.ts +0 -2
  82. package/dist/src/interfaces/index.d.ts +1 -0
  83. package/dist/src/interfaces/pagination.interface.d.ts +57 -0
  84. package/package.json +25 -47
  85. package/dist/common/auth.helper.js +0 -1
  86. package/dist/common/big-number.helper.js +0 -1
  87. package/dist/common/index.js +0 -1
  88. package/dist/common/mappers/codexAsset.mapper.js +0 -1
  89. package/dist/common/mappers/codexBalance.mapper.js +0 -1
  90. package/dist/common/mappers/index.js +0 -1
  91. package/dist/common/mappers/trade.mapper.js +0 -1
  92. package/dist/common/utils/assert.js +0 -1
  93. package/dist/common/utils/decode.js +0 -1
  94. package/dist/common/utils/index.js +0 -1
  95. package/dist/common/utils/social.js +0 -1
  96. package/dist/common/utils/stat.js +0 -1
  97. package/dist/constants/index.js +0 -1
  98. package/dist/enums/index.js +0 -1
  99. package/dist/helpers/Encoding.js +0 -1
  100. package/dist/helpers/algo.helper.js +0 -1
  101. package/dist/helpers/assert.helper.js +0 -1
  102. package/dist/helpers/atomic.helper.js +0 -1
  103. package/dist/helpers/balance.helper.js +0 -1
  104. package/dist/helpers/codex/common.helper.js +0 -2
  105. package/dist/helpers/codex/index.js +0 -2
  106. package/dist/helpers/codex/mbr.helper.js +0 -1
  107. package/dist/helpers/codex/mna.helper.js +0 -1
  108. package/dist/helpers/codex/order.helper.js +0 -1
  109. package/dist/helpers/codex/setGlobal.helper.js +0 -1
  110. package/dist/helpers/codex/transfer.helper.js +0 -2
  111. package/dist/helpers/codex/txn.helper.js +0 -1
  112. package/dist/helpers/codex.helper.js +0 -8
  113. package/dist/helpers/eth.helper.js +0 -2
  114. package/dist/helpers/index.js +0 -1
  115. package/dist/helpers/interval.helpers.js +0 -1
  116. package/dist/helpers/liquidity.helper.js +0 -1
  117. package/dist/helpers/order.helper.js +0 -1
  118. package/dist/helpers/pair.helper.js +0 -1
  119. package/dist/helpers/pointSystem.helper.js +0 -1
  120. package/dist/helpers/ticker.helpers.js +0 -1
  121. package/dist/helpers/vaa.helper.js +0 -1
  122. package/dist/helpers/withdraw.helper.js +0 -2
  123. package/dist/interfaces/index.js +0 -1
  124. package/dist/types/index.js +0 -1
@@ -0,0 +1,11 @@
1
+ function H(){throw new Error("setTimeout has not been defined")}function K(){throw new Error("clearTimeout has not been defined")}var R=H,w=K;typeof globalThis.setTimeout=="function"&&(R=setTimeout);typeof globalThis.clearTimeout=="function"&&(w=clearTimeout);function V(t){if(R===setTimeout)return setTimeout(t,0);if((R===H||!R)&&setTimeout)return R=setTimeout,setTimeout(t,0);try{return R(t,0)}catch{try{return R.call(null,t,0)}catch{return R.call(this,t,0)}}}function Er(t){if(w===clearTimeout)return clearTimeout(t);if((w===K||!w)&&clearTimeout)return w=clearTimeout,clearTimeout(t);try{return w(t)}catch{try{return w.call(null,t)}catch{return w.call(this,t)}}}var A=[],O=!1,I,v=-1;function sr(){!O||!I||(O=!1,I.length?A=I.concat(A):v=-1,A.length&&X())}function X(){if(!O){var t=V(sr);O=!0;for(var r=A.length;r;){for(I=A,A=[];++v<r;)I&&I[v].run();v=-1,r=A.length}I=null,O=!1,Er(t)}}function pr(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];A.push(new q(t,r)),A.length===1&&!O&&V(X)}function q(t,r){this.fun=t,this.array=r}q.prototype.run=function(){this.fun.apply(null,this.array)};var hr="browser",Tr="browser",_r=!0,dr={},br=[],mr="",gr={},Ar={},xr={};function y(){}var Rr=y,wr=y,Ir=y,yr=y,Nr=y,Sr=y,Dr=y;function Or(t){throw new Error("process.binding is not supported")}function vr(){return"/"}function Cr(t){throw new Error("process.chdir is not supported")}function Pr(){return 0}var D=globalThis.performance||{},Lr=D.now||D.mozNow||D.msNow||D.oNow||D.webkitNow||function(){return new Date().getTime()};function Mr(t){var r=Lr.call(D)*.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 Ur=new Date;function kr(){var t=new Date,r=t-Ur;return r/1e3}var h={nextTick:pr,title:hr,browser:_r,env:dr,argv:br,version:mr,versions:gr,on:Rr,addListener:wr,once:Ir,off:yr,removeListener:Nr,removeAllListeners:Sr,emit:Dr,binding:Or,cwd:vr,chdir:Cr,umask:Pr,hrtime:Mr,platform:Tr,release:Ar,config:xr,uptime:kr},W={};Object.keys(W).forEach(t=>{let r=t.split("."),e=h;for(let n=0;n<r.length;n++){let i=r[n];n===r.length-1?e[i]=W[t]:e=e[i]||(e[i]={})}});var m=[],d=[],Br=typeof Uint8Array<"u"?Uint8Array:Array,Y=!1;function z(){Y=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)m[r]=t[r],d[t.charCodeAt(r)]=r;d[45]=62,d[95]=63}function Yr(t){Y||z();var r,e,n,i,a,o,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=t[c-2]==="="?2:t[c-1]==="="?1:0,o=new Br(c*3/4-a),n=a>0?c-4:c;var l=0;for(r=0,e=0;r<n;r+=4,e+=3)i=d[t.charCodeAt(r)]<<18|d[t.charCodeAt(r+1)]<<12|d[t.charCodeAt(r+2)]<<6|d[t.charCodeAt(r+3)],o[l++]=i>>16&255,o[l++]=i>>8&255,o[l++]=i&255;return a===2?(i=d[t.charCodeAt(r)]<<2|d[t.charCodeAt(r+1)]>>4,o[l++]=i&255):a===1&&(i=d[t.charCodeAt(r)]<<10|d[t.charCodeAt(r+1)]<<4|d[t.charCodeAt(r+2)]>>2,o[l++]=i>>8&255,o[l++]=i&255),o}function Fr(t){return m[t>>18&63]+m[t>>12&63]+m[t>>6&63]+m[t&63]}function Gr(t,r,e){for(var n,i=[],a=r;a<e;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],i.push(Fr(n));return i.join("")}function Q(t){Y||z();for(var r,e=t.length,n=e%3,i="",a=[],o=16383,c=0,l=e-n;c<l;c+=o)a.push(Gr(t,c,c+o>l?l:c+o));return n===1?(r=t[e-1],i+=m[r>>2],i+=m[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=m[r>>10],i+=m[r>>4&63],i+=m[r<<2&63],i+="="),a.push(i),a.join("")}u.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function C(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function x(t,r){if(C()<r)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=u.prototype):(t===null&&(t=new u(r)),t.length=r),t}function u(t,r,e){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u))return new u(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return F(this,t)}return Z(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function Z(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?Kr(t,r,e,n):typeof r=="string"?Hr(t,r,e):Vr(t,r)}u.from=function(t,r,e){return Z(null,t,r,e)};u.kMaxLength=C();u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&u[Symbol.species]);function j(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function Wr(t,r,e,n){return j(r),r<=0?x(t,r):e!==void 0?typeof n=="string"?x(t,r).fill(e,n):x(t,r).fill(e):x(t,r)}u.alloc=function(t,r,e){return Wr(null,t,r,e)};function F(t,r){if(j(r),t=x(t,r<0?0:G(r)|0),!u.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}u.allocUnsafe=function(t){return F(null,t)};u.allocUnsafeSlow=function(t){return F(null,t)};function Hr(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!u.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=rr(r,e)|0;t=x(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function B(t,r){var e=r.length<0?0:G(r.length)|0;t=x(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function Kr(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),u.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=u.prototype):t=B(t,r),t}function Vr(t,r){if(g(r)){var e=G(r.length)|0;return t=x(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"||fe(r.length)?x(t,0):B(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return B(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function G(t){if(t>=C())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+C().toString(16)+" bytes");return t|0}u.isBuffer=Ee;function g(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!g(r)||!g(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,i=e.length,a=0,o=Math.min(n,i);a<o;++a)if(r[a]!==e[a]){n=r[a],i=e[a];break}return n<i?-1:i<n?1:0};u.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};u.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return u.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var i=u.allocUnsafe(e),a=0;for(n=0;n<r.length;++n){var o=r[n];if(!g(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,a),a+=o.length}return i};function rr(t,r){if(g(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return P(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return ur(t).length;default:if(n)return P(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=rr;function Xr(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 te(this,r,e);case"utf8":case"utf-8":return nr(this,r,e);case"ascii":return re(this,r,e);case"latin1":case"binary":return ee(this,r,e);case"base64":return Zr(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ne(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function N(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}u.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)N(this,e,e+1);return this};u.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)N(this,e,e+3),N(this,e+1,e+2);return this};u.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)N(this,e,e+7),N(this,e+1,e+6),N(this,e+2,e+5),N(this,e+3,e+4);return this};u.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?nr(this,0,r):Xr.apply(this,arguments)};u.prototype.equals=function(r){if(!g(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:u.compare(this,r)===0};u.prototype.compare=function(r,e,n,i,a){if(!g(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),a===void 0&&(a=this.length),e<0||n>r.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&e>=n)return 0;if(i>=a)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,a>>>=0,this===r)return 0;for(var o=a-i,c=n-e,l=Math.min(o,c),E=this.slice(i,a),s=r.slice(e,n),f=0;f<l;++f)if(E[f]!==s[f]){o=E[f],c=s[f];break}return o<c?-1:c<o?1:0};function er(t,r,e,n,i){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof r=="string"&&(r=u.from(r,n)),g(r))return r.length===0?-1:J(t,r,e,n,i);if(typeof r=="number")return r=r&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):J(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function J(t,r,e,n,i){var a=1,o=t.length,c=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;a=2,o/=2,c/=2,e/=2}function l(_,S){return a===1?_[S]:_.readUInt16BE(S*a)}var E;if(i){var s=-1;for(E=e;E<o;E++)if(l(t,E)===l(r,s===-1?0:E-s)){if(s===-1&&(s=E),E-s+1===c)return s*a}else s!==-1&&(E-=E-s),s=-1}else for(e+c>o&&(e=o-c),E=e;E>=0;E--){for(var f=!0,b=0;b<c;b++)if(l(t,E+b)!==l(r,b)){f=!1;break}if(f)return E}return-1}u.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};u.prototype.indexOf=function(r,e,n){return er(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return er(this,r,e,n,!1)};function qr(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var a=r.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o<n;++o){var c=parseInt(r.substr(o*2,2),16);if(isNaN(c))return o;t[e+o]=c}return o}function Qr(t,r,e,n){return U(P(r,t.length-e),t,e,n)}function tr(t,r,e,n){return U(ce(r),t,e,n)}function Jr(t,r,e,n){return tr(t,r,e,n)}function $r(t,r,e,n){return U(ur(r),t,e,n)}function zr(t,r,e,n){return U(le(r,t.length-e),t,e,n)}u.prototype.write=function(r,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-e;if((n===void 0||n>a)&&(n=a),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return qr(this,r,e,n);case"utf8":case"utf-8":return Qr(this,r,e,n);case"ascii":return tr(this,r,e,n);case"latin1":case"binary":return Jr(this,r,e,n);case"base64":return $r(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return zr(this,r,e,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Zr(t,r,e){return r===0&&e===t.length?Q(t):Q(t.slice(r,e))}function nr(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var a=t[i],o=null,c=a>239?4:a>223?3:a>191?2:1;if(i+c<=e){var l,E,s,f;switch(c){case 1:a<128&&(o=a);break;case 2:l=t[i+1],(l&192)===128&&(f=(a&31)<<6|l&63,f>127&&(o=f));break;case 3:l=t[i+1],E=t[i+2],(l&192)===128&&(E&192)===128&&(f=(a&15)<<12|(l&63)<<6|E&63,f>2047&&(f<55296||f>57343)&&(o=f));break;case 4:l=t[i+1],E=t[i+2],s=t[i+3],(l&192)===128&&(E&192)===128&&(s&192)===128&&(f=(a&15)<<18|(l&63)<<12|(E&63)<<6|s&63,f>65535&&f<1114112&&(o=f))}}o===null?(o=65533,c=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),i+=c}return jr(n)}var $=4096;function jr(t){var r=t.length;if(r<=$)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=$));return e}function re(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 ee(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 te(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",a=r;a<e;++a)i+=ue(t[a]);return i}function ne(t,r,e){for(var n=t.slice(r,e),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+n[a+1]*256);return i}u.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var i;if(u.TYPED_ARRAY_SUPPORT)i=this.subarray(r,e),i.__proto__=u.prototype;else{var a=e-r;i=new u(a,void 0);for(var o=0;o<a;++o)i[o]=this[o+r]}return i};function p(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||p(r,e,this.length);for(var i=this[r],a=1,o=0;++o<e&&(a*=256);)i+=this[r+o]*a;return i};u.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||p(r,e,this.length);for(var i=this[r+--e],a=1;e>0&&(a*=256);)i+=this[r+--e]*a;return i};u.prototype.readUInt8=function(r,e){return e||p(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||p(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||p(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUInt32LE=function(r,e){return e||p(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};u.prototype.readUInt32BE=function(r,e){return e||p(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};u.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||p(r,e,this.length);for(var i=this[r],a=1,o=0;++o<e&&(a*=256);)i+=this[r+o]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*e)),i};u.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||p(r,e,this.length);for(var i=e,a=1,o=this[r+--i];i>0&&(a*=256);)o+=this[r+--i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*e)),o};u.prototype.readInt8=function(r,e){return e||p(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,e){e||p(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};u.prototype.readInt16BE=function(r,e){e||p(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};u.prototype.readInt32LE=function(r,e){return e||p(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};u.prototype.readInt32BE=function(r,e){return e||p(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};u.prototype.readFloatLE=function(r,e){return e||p(r,4,this.length),k(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||p(r,4,this.length),k(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||p(r,8,this.length),k(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||p(r,8,this.length),k(this,r,!1,52,8)};function T(t,r,e,n,i,a){if(!g(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<a)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}u.prototype.writeUIntLE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;T(this,r,e,n,a,0)}var o=1,c=0;for(this[e]=r&255;++c<n&&(o*=256);)this[e+c]=r/o&255;return e+n};u.prototype.writeUIntBE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;T(this,r,e,n,a,0)}var o=n-1,c=1;for(this[e+o]=r&255;--o>=0&&(c*=256);)this[e+o]=r/c&255;return e+n};u.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function L(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,a=Math.min(t.length-e,2);i<a;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}u.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):L(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):L(this,r,e,!1),e+2};function M(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,a=Math.min(t.length-e,4);i<a;++i)t[e+i]=r>>>(n?i:3-i)*8&255}u.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):M(this,r,e,!0),e+4};u.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):M(this,r,e,!1),e+4};u.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e|0,!i){var a=Math.pow(2,8*n-1);T(this,r,e,n,a-1,-a)}var o=0,c=1,l=0;for(this[e]=r&255;++o<n&&(c*=256);)r<0&&l===0&&this[e+o-1]!==0&&(l=1),this[e+o]=(r/c>>0)-l&255;return e+n};u.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e|0,!i){var a=Math.pow(2,8*n-1);T(this,r,e,n,a-1,-a)}var o=n-1,c=1,l=0;for(this[e+o]=r&255;--o>=0&&(c*=256);)r<0&&l===0&&this[e+o+1]!==0&&(l=1),this[e+o]=(r/c>>0)-l&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};u.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):L(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):L(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):M(this,r,e,!0),e+4};u.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):M(this,r,e,!1),e+4};function ir(t,r,e,n,i,a){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function ar(t,r,e,n,i){return i||ir(t,r,e,4,34028234663852886e22,-34028234663852886e22),lr(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return ar(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return ar(this,r,e,!1,n)};function or(t,r,e,n,i){return i||ir(t,r,e,8,17976931348623157e292,-17976931348623157e292),lr(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return or(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return or(this,r,e,!1,n)};u.prototype.copy=function(r,e,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),e>=r.length&&(e=r.length),e||(e=0),i>0&&i<n&&(i=n),i===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-e<i-n&&(i=r.length-e+n);var a=i-n,o;if(this===r&&n<e&&e<i)for(o=a-1;o>=0;--o)r[o+e]=this[o+n];else if(a<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o<a;++o)r[o+e]=this[o+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+a),e);return a};u.prototype.fill=function(r,e,n,i){if(typeof r=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),r.length===1){var a=r.charCodeAt(0);a<256&&(r=a)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var o;if(typeof r=="number")for(o=e;o<n;++o)this[o]=r;else{var c=g(r)?r:P(new u(r,i).toString()),l=c.length;for(o=0;o<n-e;++o)this[o+e]=c[o%l]}return this};var ie=/[^+\/0-9A-Za-z-_]/g;function ae(t){if(t=oe(t).replace(ie,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function oe(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function ue(t){return t<16?"0"+t.toString(16):t.toString(16)}function P(t,r){r=r||1/0;for(var e,n=t.length,i=null,a=[],o=0;o<n;++o){if(e=t.charCodeAt(o),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&a.push(239,191,189);continue}else if(o+1===n){(r-=3)>-1&&a.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&a.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&a.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;a.push(e)}else if(e<2048){if((r-=2)<0)break;a.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;a.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;a.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return a}function ce(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function le(t,r){for(var e,n,i,a=[],o=0;o<t.length&&!((r-=2)<0);++o)e=t.charCodeAt(o),n=e>>8,i=e%256,a.push(i),a.push(n);return a}function ur(t){return Yr(ae(t))}function U(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 fe(t){return t!==t}function Ee(t){return t!=null&&(!!t._isBuffer||cr(t)||se(t))}function cr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function se(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&cr(t.slice(0,0))}function k(t,r,e,n,i){var a,o,c=i*8-n-1,l=(1<<c)-1,E=l>>1,s=-7,f=e?i-1:0,b=e?-1:1,_=t[r+f];for(f+=b,a=_&(1<<-s)-1,_>>=-s,s+=c;s>0;a=a*256+t[r+f],f+=b,s-=8);for(o=a&(1<<-s)-1,a>>=-s,s+=n;s>0;o=o*256+t[r+f],f+=b,s-=8);if(a===0)a=1-E;else{if(a===l)return o?NaN:(_?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-E}return(_?-1:1)*o*Math.pow(2,a-n)}function lr(t,r,e,n,i,a){var o,c,l,E=a*8-i-1,s=(1<<E)-1,f=s>>1,b=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,_=n?0:a-1,S=n?1:-1,fr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,o=s):(o=Math.floor(Math.log(r)/Math.LN2),r*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+f>=1?r+=b/l:r+=b*Math.pow(2,1-f),r*l>=2&&(o++,l/=2),o+f>=s?(c=0,o=s):o+f>=1?(c=(r*l-1)*Math.pow(2,i),o=o+f):(c=r*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[e+_]=c&255,_+=S,c/=256,i-=8);for(o=o<<i|c,E+=i;E>0;t[e+_]=o&255,_+=S,o/=256,E-=8);t[e+_-S]|=fr*128}var me=864e5,ge=30;var we=18,Ie=1e5,ye=1e3,Ne=9e4,Se=30,De=60,Oe=328,ve=1,Ce=18,Pe=36,Le=248;var Be={"0x4343545055534443000000000000000000000000000000000000000000000000":65537};var We={SUCCESS:200,CREATED:201,ACCEPTED:202,NOCONTENT:204,BADREQUEST:400,FORBIDDEN:403,NOTFOUND:404,TIMEOUT:408,TOOMANYREQ:429,INTERNALSERVER:500,BADGATEWAYS:502,SERVICEUNAVILABLE:503,GATEWAYTIMEOUT:504},He={INSERT:"Data has been saved successfully.",ERROR:"Some error has been occured. Please try again.",SUCCESS:"Your request is executed successfully!",REQUIRED:"coin_type or price param is required",CAPTCHATEXTNOTFOUND:"Captcha text not found.",CAPTCHA_VERIFICATION_FAILED:"Captcha is not verified.",NOTEMPTY:"coin_type or price should not be empty",PAIR_LIST:"Pair list",PAIR_STATUS:"Pair status has been changed",ACTIVE_USERS:"Active Users",SETTINGS_NOT_FOUND:"No settings found in DB.",TRADE_IS_HALT:"Trading is disabled.",KYC_REQUIRED:"KYC is required for this action.",EMAIL_NOT_VERIFIED:"Your email is not verified.Please verify first.",NOT_BETA_USER:"Trade only works for beta user.",WRONG_PAIR_KEY:"Pair key not found.",PAIRDISABLED:"Temporarily order placement has been disabled for this pair. Please try again later.",BALANCE_NOT_SUFFICIENT:"You have insufficient balance.",MIN_TRADE_NOT_MATCHED:"Minimum trade limit does not matched.",ORDER_PLACED_SUCCESSFULLY:"Order has been placed successfully.",ORDER_NOT_FOUND:"Sorry this order id does not found.",ORDER_ALREADY_MATCHED:"Order already matched.",ORDER_ALREADY_CANCELED:"Order already cancelled.",ORDER_CANCELED_SUCCESSFULLY:"order successfully cancelled",ORDER_LIST:"Order list fetched successfully.",ORDER_EXIT:"Successfully exited from the position.",PAIRERR:"please provide pair param",ORDERSIDE:"side param is required",ORDERTYPE:"type param is required",ORDERIDREQ:"order_id param is required",ORDERDETAIL:"order detail",COMMODITYORICE:"commodity price",COMMODITYSPOT:"commodity spot updated",TOKEN_INSERTED:"ERC token has been added",PARAMREQ:"Parameter missing",EXIST:"Token Already Exist",BREACHEDTOKENS:"List of breached tokens",API_EXPOSE:{TOKEN_NOT_FOUND:"Token not found, Please get token and set to header.",ERROR:"Something went wrong, Please try again later"},LIMITED_UNITS:"ONLY {{units}} units are available. You can place your order with this amount",UNITS_UNAVAIL:"Amount unavailable",ORDER:{ERROR:"An error has been occured",UNITS_UNAVAIL:"Amount unavailable",LIMITED_UNITS:"ONLY {{units}} units are available. You can place your order with this amount",PLACED:"Order has been placed",NOPARAMS:"empty body params",ORDER_NOT_FOUND:"Sorry this order id not found.",ORDER_ALREADY_MATCHED:"Order already matched.",ORDER_ALREADY_CANCELED:"Order already cancelled.",ORDER_CANCELED_SUCCESSFULLY:"Order cancelled successfully"},DOMAIN_NOT_FOUND:"domain not found"},Ke={SMALLESTUNIT:h.env.SMALLEST_UNIT},Ve={SMALLEST_UNITS:h.env.SMALLEST_UNIT},Xe={AVAILABLE_ASSETS_PER_USER:1,AVAILABLE_ASSETS_PER_IP:3};var $e=`{"theme1":{"value":"${h.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${h.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${h.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var tt=["point-system.discordEnabled","point-system.telegramBotName","point-system.telegramBotId","point-system.telegramEnabled","point-system.telegramGroupId","point-system.telegramGroupName","point-system.twitterAccountId","point-system.twitterAccountName","point-system.twitterEnabled","point-system.twitterJobEnabled","point-system.guideLink"];var ot=t=>`By signing this message, you confirm that the wallet is a trusted one ${t}; Data: `;export{Ke as BIGNUMBER,Ve as CALCULATIONS,Be as CCTP_UNIFIED_ASSETS,me as DAY_MILLISECONDS,Ne as DEFAULT_FEE_SHARE,Se as DEFAULT_ORDER_EXPIRATION_DAYS,ge as EXPIRE_DAYS,we as FACTOR_PRICE_DECIMAL,Ie as FEE_SCALE,ye as FRONTEND_FEE_SCALE,Ce as MAX_TOKEN_DECIMAL,De as MIN_ORDER_EXPIRATION_MINS,Oe as ORDER_DATA_BYTES_LENGTH,ve as ORDER_MSG_VERSION,tt as PointSystemSettingsIds,We as RESPONSES,He as RES_MSG,Xe as SERVER,Pe as SHARE_DATA_LENGTH,Le as WITHDRAW_DATA_BYTES_LENGTH,ot as messageForSigning};
2
+ /*! Bundled license information:
3
+
4
+ @esbuild-plugins/node-globals-polyfill/Buffer.js:
5
+ (*!
6
+ * The buffer module from node.js, for the browser.
7
+ *
8
+ * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
9
+ * @license MIT
10
+ *)
11
+ */
@@ -0,0 +1,11 @@
1
+ function V(){throw new Error("setTimeout has not been defined")}function H(){throw new Error("clearTimeout has not been defined")}var b=V,C=H;typeof globalThis.setTimeout=="function"&&(b=setTimeout);typeof globalThis.clearTimeout=="function"&&(C=clearTimeout);function K(e){if(b===setTimeout)return setTimeout(e,0);if((b===V||!b)&&setTimeout)return b=setTimeout,setTimeout(e,0);try{return b(e,0)}catch{try{return b.call(null,e,0)}catch{return b.call(this,e,0)}}}function _r(e){if(C===clearTimeout)return clearTimeout(e);if((C===H||!C)&&clearTimeout)return C=clearTimeout,clearTimeout(e);try{return C(e)}catch{try{return C.call(null,e)}catch{return C.call(this,e)}}}var T=[],O=!1,d,L=-1;function Ir(){!O||!d||(O=!1,d.length?T=d.concat(T):L=-1,T.length&&z())}function z(){if(!O){var e=K(Ir);O=!0;for(var r=T.length;r;){for(d=T,T=[];++L<r;)d&&d[L].run();L=-1,r=T.length}d=null,O=!1,_r(e)}}function wr(e){var r=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)r[t-1]=arguments[t];T.push(new J(e,r)),T.length===1&&!O&&K(z)}function J(e,r){this.fun=e,this.array=r}J.prototype.run=function(){this.fun.apply(null,this.array)};var Rr="browser",Tr="browser",Nr=!0,br={},Cr=[],dr="",gr={},Dr={},vr={};function g(){}var Or=g,Lr=g,yr=g,Ur=g,Pr=g,Br=g,Sr=g;function Yr(e){throw new Error("process.binding is not supported")}function Mr(){return"/"}function kr(e){throw new Error("process.chdir is not supported")}function Gr(){return 0}var v=globalThis.performance||{},Fr=v.now||v.mozNow||v.msNow||v.oNow||v.webkitNow||function(){return new Date().getTime()};function Wr(e){var r=Fr.call(v)*.001,t=Math.floor(r),i=Math.floor(r%1*1e9);return e&&(t=t-e[0],i=i-e[1],i<0&&(t--,i+=1e9)),[t,i]}var Vr=new Date;function Hr(){var e=new Date,r=e-Vr;return r/1e3}var E={nextTick:wr,title:Rr,browser:Nr,env:br,argv:Cr,version:dr,versions:gr,on:Or,addListener:Lr,once:yr,off:Ur,removeListener:Pr,removeAllListeners:Br,emit:Sr,binding:Yr,cwd:Mr,chdir:kr,umask:Gr,hrtime:Wr,platform:Tr,release:Dr,config:vr,uptime:Hr},W={};Object.keys(W).forEach(e=>{let r=e.split("."),t=E;for(let i=0;i<r.length;i++){let n=r[i];i===r.length-1?t[n]=W[e]:t=t[n]||(t[n]={})}});var w=[],_=[],Kr=typeof Uint8Array<"u"?Uint8Array:Array,k=!1;function Z(){k=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,t=e.length;r<t;++r)w[r]=e[r],_[e.charCodeAt(r)]=r;_[45]=62,_[95]=63}function zr(e){k||Z();var r,t,i,n,o,p,c=e.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=e[c-2]==="="?2:e[c-1]==="="?1:0,p=new Kr(c*3/4-o),i=o>0?c-4:c;var s=0;for(r=0,t=0;r<i;r+=4,t+=3)n=_[e.charCodeAt(r)]<<18|_[e.charCodeAt(r+1)]<<12|_[e.charCodeAt(r+2)]<<6|_[e.charCodeAt(r+3)],p[s++]=n>>16&255,p[s++]=n>>8&255,p[s++]=n&255;return o===2?(n=_[e.charCodeAt(r)]<<2|_[e.charCodeAt(r+1)]>>4,p[s++]=n&255):o===1&&(n=_[e.charCodeAt(r)]<<10|_[e.charCodeAt(r+1)]<<4|_[e.charCodeAt(r+2)]>>2,p[s++]=n>>8&255,p[s++]=n&255),p}function Jr(e){return w[e>>18&63]+w[e>>12&63]+w[e>>6&63]+w[e&63]}function Xr(e,r,t){for(var i,n=[],o=r;o<t;o+=3)i=(e[o]<<16)+(e[o+1]<<8)+e[o+2],n.push(Jr(i));return n.join("")}function X(e){k||Z();for(var r,t=e.length,i=t%3,n="",o=[],p=16383,c=0,s=t-i;c<s;c+=p)o.push(Xr(e,c,c+p>s?s:c+p));return i===1?(r=e[t-1],n+=w[r>>2],n+=w[r<<4&63],n+="=="):i===2&&(r=(e[t-2]<<8)+e[t-1],n+=w[r>>10],n+=w[r>>4&63],n+=w[r<<2&63],n+="="),o.push(n),o.join("")}h.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function y(){return h.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function N(e,r){if(y()<r)throw new RangeError("Invalid typed array length");return h.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(r),e.__proto__=h.prototype):(e===null&&(e=new h(r)),e.length=r),e}function h(e,r,t){if(!h.TYPED_ARRAY_SUPPORT&&!(this instanceof h))return new h(e,r,t);if(typeof e=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return G(this,e)}return $(this,e,r,t)}h.poolSize=8192;h._augment=function(e){return e.__proto__=h.prototype,e};function $(e,r,t,i){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Zr(e,r,t,i):typeof r=="string"?Qr(e,r,t):$r(e,r)}h.from=function(e,r,t){return $(null,e,r,t)};h.kMaxLength=y();h.TYPED_ARRAY_SUPPORT&&(h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&h[Symbol.species]);function j(e){if(typeof e!="number")throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function qr(e,r,t,i){return j(r),r<=0?N(e,r):t!==void 0?typeof i=="string"?N(e,r).fill(t,i):N(e,r).fill(t):N(e,r)}h.alloc=function(e,r,t){return qr(null,e,r,t)};function G(e,r){if(j(r),e=N(e,r<0?0:F(r)|0),!h.TYPED_ARRAY_SUPPORT)for(var t=0;t<r;++t)e[t]=0;return e}h.allocUnsafe=function(e){return G(null,e)};h.allocUnsafeSlow=function(e){return G(null,e)};function Qr(e,r,t){if((typeof t!="string"||t==="")&&(t="utf8"),!h.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var i=rr(r,t)|0;e=N(e,i);var n=e.write(r,t);return n!==i&&(e=e.slice(0,n)),e}function M(e,r){var t=r.length<0?0:F(r.length)|0;e=N(e,t);for(var i=0;i<t;i+=1)e[i]=r[i]&255;return e}function Zr(e,r,t,i){if(r.byteLength,t<0||r.byteLength<t)throw new RangeError("'offset' is out of bounds");if(r.byteLength<t+(i||0))throw new RangeError("'length' is out of bounds");return t===void 0&&i===void 0?r=new Uint8Array(r):i===void 0?r=new Uint8Array(r,t):r=new Uint8Array(r,t,i),h.TYPED_ARRAY_SUPPORT?(e=r,e.__proto__=h.prototype):e=M(e,r),e}function $r(e,r){if(R(r)){var t=F(r.length)|0;return e=N(e,t),e.length===0||r.copy(e,0,0,t),e}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||At(r.length)?N(e,0):M(e,r);if(r.type==="Buffer"&&Array.isArray(r.data))return M(e,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function F(e){if(e>=y())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+y().toString(16)+" bytes");return e|0}h.isBuffer=_t;function R(e){return!!(e!=null&&e._isBuffer)}h.compare=function(r,t){if(!R(r)||!R(t))throw new TypeError("Arguments must be Buffers");if(r===t)return 0;for(var i=r.length,n=t.length,o=0,p=Math.min(i,n);o<p;++o)if(r[o]!==t[o]){i=r[o],n=t[o];break}return i<n?-1:n<i?1:0};h.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};h.concat=function(r,t){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return h.alloc(0);var i;if(t===void 0)for(t=0,i=0;i<r.length;++i)t+=r[i].length;var n=h.allocUnsafe(t),o=0;for(i=0;i<r.length;++i){var p=r[i];if(!R(p))throw new TypeError('"list" argument must be an Array of Buffers');p.copy(n,o),o+=p.length}return n};function rr(e,r){if(R(e))return e.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;typeof e!="string"&&(e=""+e);var t=e.length;if(t===0)return 0;for(var i=!1;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return hr(e).length;default:if(i)return U(e).length;r=(""+r).toLowerCase(),i=!0}}h.byteLength=rr;function jr(e,r,t){var i=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(e||(e="utf8");;)switch(e){case"hex":return at(this,r,t);case"utf8":case"utf-8":return ir(this,r,t);case"ascii":return ht(this,r,t);case"latin1":case"binary":return ct(this,r,t);case"base64":return ot(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return st(this,r,t);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}h.prototype._isBuffer=!0;function D(e,r,t){var i=e[r];e[r]=e[t],e[t]=i}h.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<r;t+=2)D(this,t,t+1);return this};h.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<r;t+=4)D(this,t,t+3),D(this,t+1,t+2);return this};h.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<r;t+=8)D(this,t,t+7),D(this,t+1,t+6),D(this,t+2,t+5),D(this,t+3,t+4);return this};h.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?ir(this,0,r):jr.apply(this,arguments)};h.prototype.equals=function(r){if(!R(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:h.compare(this,r)===0};h.prototype.compare=function(r,t,i,n,o){if(!R(r))throw new TypeError("Argument must be a Buffer");if(t===void 0&&(t=0),i===void 0&&(i=r?r.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),t<0||i>r.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=i)return 0;if(n>=o)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,n>>>=0,o>>>=0,this===r)return 0;for(var p=o-n,c=i-t,s=Math.min(p,c),f=this.slice(n,o),l=r.slice(t,i),a=0;a<s;++a)if(f[a]!==l[a]){p=f[a],c=l[a];break}return p<c?-1:c<p?1:0};function tr(e,r,t,i,n){if(e.length===0)return-1;if(typeof t=="string"?(i=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,isNaN(t)&&(t=n?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(n)return-1;t=e.length-1}else if(t<0)if(n)t=0;else return-1;if(typeof r=="string"&&(r=h.from(r,i)),R(r))return r.length===0?-1:q(e,r,t,i,n);if(typeof r=="number")return r=r&255,h.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(e,r,t):Uint8Array.prototype.lastIndexOf.call(e,r,t):q(e,[r],t,i,n);throw new TypeError("val must be string, number or Buffer")}function q(e,r,t,i,n){var o=1,p=e.length,c=r.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(e.length<2||r.length<2)return-1;o=2,p/=2,c/=2,t/=2}function s(A,u){return o===1?A[u]:A.readUInt16BE(u*o)}var f;if(n){var l=-1;for(f=t;f<p;f++)if(s(e,f)===s(r,l===-1?0:f-l)){if(l===-1&&(l=f),f-l+1===c)return l*o}else l!==-1&&(f-=f-l),l=-1}else for(t+c>p&&(t=p-c),f=t;f>=0;f--){for(var a=!0,I=0;I<c;I++)if(s(e,f+I)!==s(r,I)){a=!1;break}if(a)return f}return-1}h.prototype.includes=function(r,t,i){return this.indexOf(r,t,i)!==-1};h.prototype.indexOf=function(r,t,i){return tr(this,r,t,i,!0)};h.prototype.lastIndexOf=function(r,t,i){return tr(this,r,t,i,!1)};function rt(e,r,t,i){t=Number(t)||0;var n=e.length-t;i?(i=Number(i),i>n&&(i=n)):i=n;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var p=0;p<i;++p){var c=parseInt(r.substr(p*2,2),16);if(isNaN(c))return p;e[t+p]=c}return p}function tt(e,r,t,i){return S(U(r,e.length-t),e,t,i)}function er(e,r,t,i){return S(xt(r),e,t,i)}function et(e,r,t,i){return er(e,r,t,i)}function it(e,r,t,i){return S(hr(r),e,t,i)}function nt(e,r,t,i){return S(mt(r,e.length-t),e,t,i)}h.prototype.write=function(r,t,i,n){if(t===void 0)n="utf8",i=this.length,t=0;else if(i===void 0&&typeof t=="string")n=t,i=this.length,t=0;else if(isFinite(t))t=t|0,isFinite(i)?(i=i|0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-t;if((i===void 0||i>o)&&(i=o),r.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var p=!1;;)switch(n){case"hex":return rt(this,r,t,i);case"utf8":case"utf-8":return tt(this,r,t,i);case"ascii":return er(this,r,t,i);case"latin1":case"binary":return et(this,r,t,i);case"base64":return it(this,r,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return nt(this,r,t,i);default:if(p)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}};h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ot(e,r,t){return r===0&&t===e.length?X(e):X(e.slice(r,t))}function ir(e,r,t){t=Math.min(e.length,t);for(var i=[],n=r;n<t;){var o=e[n],p=null,c=o>239?4:o>223?3:o>191?2:1;if(n+c<=t){var s,f,l,a;switch(c){case 1:o<128&&(p=o);break;case 2:s=e[n+1],(s&192)===128&&(a=(o&31)<<6|s&63,a>127&&(p=a));break;case 3:s=e[n+1],f=e[n+2],(s&192)===128&&(f&192)===128&&(a=(o&15)<<12|(s&63)<<6|f&63,a>2047&&(a<55296||a>57343)&&(p=a));break;case 4:s=e[n+1],f=e[n+2],l=e[n+3],(s&192)===128&&(f&192)===128&&(l&192)===128&&(a=(o&15)<<18|(s&63)<<12|(f&63)<<6|l&63,a>65535&&a<1114112&&(p=a))}}p===null?(p=65533,c=1):p>65535&&(p-=65536,i.push(p>>>10&1023|55296),p=56320|p&1023),i.push(p),n+=c}return pt(i)}var Q=4096;function pt(e){var r=e.length;if(r<=Q)return String.fromCharCode.apply(String,e);for(var t="",i=0;i<r;)t+=String.fromCharCode.apply(String,e.slice(i,i+=Q));return t}function ht(e,r,t){var i="";t=Math.min(e.length,t);for(var n=r;n<t;++n)i+=String.fromCharCode(e[n]&127);return i}function ct(e,r,t){var i="";t=Math.min(e.length,t);for(var n=r;n<t;++n)i+=String.fromCharCode(e[n]);return i}function at(e,r,t){var i=e.length;(!r||r<0)&&(r=0),(!t||t<0||t>i)&&(t=i);for(var n="",o=r;o<t;++o)n+=Et(e[o]);return n}function st(e,r,t){for(var i=e.slice(r,t),n="",o=0;o<i.length;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}h.prototype.slice=function(r,t){var i=this.length;r=~~r,t=t===void 0?i:~~t,r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),t<r&&(t=r);var n;if(h.TYPED_ARRAY_SUPPORT)n=this.subarray(r,t),n.__proto__=h.prototype;else{var o=t-r;n=new h(o,void 0);for(var p=0;p<o;++p)n[p]=this[p+r]}return n};function x(e,r,t){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+r>t)throw new RangeError("Trying to access beyond buffer length")}h.prototype.readUIntLE=function(r,t,i){r=r|0,t=t|0,i||x(r,t,this.length);for(var n=this[r],o=1,p=0;++p<t&&(o*=256);)n+=this[r+p]*o;return n};h.prototype.readUIntBE=function(r,t,i){r=r|0,t=t|0,i||x(r,t,this.length);for(var n=this[r+--t],o=1;t>0&&(o*=256);)n+=this[r+--t]*o;return n};h.prototype.readUInt8=function(r,t){return t||x(r,1,this.length),this[r]};h.prototype.readUInt16LE=function(r,t){return t||x(r,2,this.length),this[r]|this[r+1]<<8};h.prototype.readUInt16BE=function(r,t){return t||x(r,2,this.length),this[r]<<8|this[r+1]};h.prototype.readUInt32LE=function(r,t){return t||x(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};h.prototype.readUInt32BE=function(r,t){return t||x(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};h.prototype.readIntLE=function(r,t,i){r=r|0,t=t|0,i||x(r,t,this.length);for(var n=this[r],o=1,p=0;++p<t&&(o*=256);)n+=this[r+p]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n};h.prototype.readIntBE=function(r,t,i){r=r|0,t=t|0,i||x(r,t,this.length);for(var n=t,o=1,p=this[r+--n];n>0&&(o*=256);)p+=this[r+--n]*o;return o*=128,p>=o&&(p-=Math.pow(2,8*t)),p};h.prototype.readInt8=function(r,t){return t||x(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};h.prototype.readInt16LE=function(r,t){t||x(r,2,this.length);var i=this[r]|this[r+1]<<8;return i&32768?i|4294901760:i};h.prototype.readInt16BE=function(r,t){t||x(r,2,this.length);var i=this[r+1]|this[r]<<8;return i&32768?i|4294901760:i};h.prototype.readInt32LE=function(r,t){return t||x(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};h.prototype.readInt32BE=function(r,t){return t||x(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};h.prototype.readFloatLE=function(r,t){return t||x(r,4,this.length),Y(this,r,!0,23,4)};h.prototype.readFloatBE=function(r,t){return t||x(r,4,this.length),Y(this,r,!1,23,4)};h.prototype.readDoubleLE=function(r,t){return t||x(r,8,this.length),Y(this,r,!0,52,8)};h.prototype.readDoubleBE=function(r,t){return t||x(r,8,this.length),Y(this,r,!1,52,8)};function m(e,r,t,i,n,o){if(!R(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>n||r<o)throw new RangeError('"value" argument is out of bounds');if(t+i>e.length)throw new RangeError("Index out of range")}h.prototype.writeUIntLE=function(r,t,i,n){if(r=+r,t=t|0,i=i|0,!n){var o=Math.pow(2,8*i)-1;m(this,r,t,i,o,0)}var p=1,c=0;for(this[t]=r&255;++c<i&&(p*=256);)this[t+c]=r/p&255;return t+i};h.prototype.writeUIntBE=function(r,t,i,n){if(r=+r,t=t|0,i=i|0,!n){var o=Math.pow(2,8*i)-1;m(this,r,t,i,o,0)}var p=i-1,c=1;for(this[t+p]=r&255;--p>=0&&(c*=256);)this[t+p]=r/c&255;return t+i};h.prototype.writeUInt8=function(r,t,i){return r=+r,t=t|0,i||m(this,r,t,1,255,0),h.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[t]=r&255,t+1};function P(e,r,t,i){r<0&&(r=65535+r+1);for(var n=0,o=Math.min(e.length-t,2);n<o;++n)e[t+n]=(r&255<<8*(i?n:1-n))>>>(i?n:1-n)*8}h.prototype.writeUInt16LE=function(r,t,i){return r=+r,t=t|0,i||m(this,r,t,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[t]=r&255,this[t+1]=r>>>8):P(this,r,t,!0),t+2};h.prototype.writeUInt16BE=function(r,t,i){return r=+r,t=t|0,i||m(this,r,t,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[t]=r>>>8,this[t+1]=r&255):P(this,r,t,!1),t+2};function B(e,r,t,i){r<0&&(r=4294967295+r+1);for(var n=0,o=Math.min(e.length-t,4);n<o;++n)e[t+n]=r>>>(i?n:3-n)*8&255}h.prototype.writeUInt32LE=function(r,t,i){return r=+r,t=t|0,i||m(this,r,t,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255):B(this,r,t,!0),t+4};h.prototype.writeUInt32BE=function(r,t,i){return r=+r,t=t|0,i||m(this,r,t,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255):B(this,r,t,!1),t+4};h.prototype.writeIntLE=function(r,t,i,n){if(r=+r,t=t|0,!n){var o=Math.pow(2,8*i-1);m(this,r,t,i,o-1,-o)}var p=0,c=1,s=0;for(this[t]=r&255;++p<i&&(c*=256);)r<0&&s===0&&this[t+p-1]!==0&&(s=1),this[t+p]=(r/c>>0)-s&255;return t+i};h.prototype.writeIntBE=function(r,t,i,n){if(r=+r,t=t|0,!n){var o=Math.pow(2,8*i-1);m(this,r,t,i,o-1,-o)}var p=i-1,c=1,s=0;for(this[t+p]=r&255;--p>=0&&(c*=256);)r<0&&s===0&&this[t+p+1]!==0&&(s=1),this[t+p]=(r/c>>0)-s&255;return t+i};h.prototype.writeInt8=function(r,t,i){return r=+r,t=t|0,i||m(this,r,t,1,127,-128),h.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[t]=r&255,t+1};h.prototype.writeInt16LE=function(r,t,i){return r=+r,t=t|0,i||m(this,r,t,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[t]=r&255,this[t+1]=r>>>8):P(this,r,t,!0),t+2};h.prototype.writeInt16BE=function(r,t,i){return r=+r,t=t|0,i||m(this,r,t,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[t]=r>>>8,this[t+1]=r&255):P(this,r,t,!1),t+2};h.prototype.writeInt32LE=function(r,t,i){return r=+r,t=t|0,i||m(this,r,t,4,2147483647,-2147483648),h.TYPED_ARRAY_SUPPORT?(this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24):B(this,r,t,!0),t+4};h.prototype.writeInt32BE=function(r,t,i){return r=+r,t=t|0,i||m(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),h.TYPED_ARRAY_SUPPORT?(this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255):B(this,r,t,!1),t+4};function nr(e,r,t,i,n,o){if(t+i>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function or(e,r,t,i,n){return n||nr(e,r,t,4,34028234663852886e22,-34028234663852886e22),ar(e,r,t,i,23,4),t+4}h.prototype.writeFloatLE=function(r,t,i){return or(this,r,t,!0,i)};h.prototype.writeFloatBE=function(r,t,i){return or(this,r,t,!1,i)};function pr(e,r,t,i,n){return n||nr(e,r,t,8,17976931348623157e292,-17976931348623157e292),ar(e,r,t,i,52,8),t+8}h.prototype.writeDoubleLE=function(r,t,i){return pr(this,r,t,!0,i)};h.prototype.writeDoubleBE=function(r,t,i){return pr(this,r,t,!1,i)};h.prototype.copy=function(r,t,i,n){if(i||(i=0),!n&&n!==0&&(n=this.length),t>=r.length&&(t=r.length),t||(t=0),n>0&&n<i&&(n=i),n===i||r.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),r.length-t<n-i&&(n=r.length-t+i);var o=n-i,p;if(this===r&&i<t&&t<n)for(p=o-1;p>=0;--p)r[p+t]=this[p+i];else if(o<1e3||!h.TYPED_ARRAY_SUPPORT)for(p=0;p<o;++p)r[p+t]=this[p+i];else Uint8Array.prototype.set.call(r,this.subarray(i,i+o),t);return o};h.prototype.fill=function(r,t,i,n){if(typeof r=="string"){if(typeof t=="string"?(n=t,t=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!h.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else typeof r=="number"&&(r=r&255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;t=t>>>0,i=i===void 0?this.length:i>>>0,r||(r=0);var p;if(typeof r=="number")for(p=t;p<i;++p)this[p]=r;else{var c=R(r)?r:U(new h(r,n).toString()),s=c.length;for(p=0;p<i-t;++p)this[p+t]=c[p%s]}return this};var ft=/[^+\/0-9A-Za-z-_]/g;function ut(e){if(e=lt(e).replace(ft,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function lt(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function Et(e){return e<16?"0"+e.toString(16):e.toString(16)}function U(e,r){r=r||1/0;for(var t,i=e.length,n=null,o=[],p=0;p<i;++p){if(t=e.charCodeAt(p),t>55295&&t<57344){if(!n){if(t>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(p+1===i){(r-=3)>-1&&o.push(239,191,189);continue}n=t;continue}if(t<56320){(r-=3)>-1&&o.push(239,191,189),n=t;continue}t=(n-55296<<10|t-56320)+65536}else n&&(r-=3)>-1&&o.push(239,191,189);if(n=null,t<128){if((r-=1)<0)break;o.push(t)}else if(t<2048){if((r-=2)<0)break;o.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;o.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;o.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return o}function xt(e){for(var r=[],t=0;t<e.length;++t)r.push(e.charCodeAt(t)&255);return r}function mt(e,r){for(var t,i,n,o=[],p=0;p<e.length&&!((r-=2)<0);++p)t=e.charCodeAt(p),i=t>>8,n=t%256,o.push(n),o.push(i);return o}function hr(e){return zr(ut(e))}function S(e,r,t,i){for(var n=0;n<i&&!(n+t>=r.length||n>=e.length);++n)r[n+t]=e[n];return n}function At(e){return e!==e}function _t(e){return e!=null&&(!!e._isBuffer||cr(e)||It(e))}function cr(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function It(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&cr(e.slice(0,0))}function Y(e,r,t,i,n){var o,p,c=n*8-i-1,s=(1<<c)-1,f=s>>1,l=-7,a=t?n-1:0,I=t?-1:1,A=e[r+a];for(a+=I,o=A&(1<<-l)-1,A>>=-l,l+=c;l>0;o=o*256+e[r+a],a+=I,l-=8);for(p=o&(1<<-l)-1,o>>=-l,l+=i;l>0;p=p*256+e[r+a],a+=I,l-=8);if(o===0)o=1-f;else{if(o===s)return p?NaN:(A?-1:1)*(1/0);p=p+Math.pow(2,i),o=o-f}return(A?-1:1)*p*Math.pow(2,o-i)}function ar(e,r,t,i,n,o){var p,c,s,f=o*8-n-1,l=(1<<f)-1,a=l>>1,I=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=i?0:o-1,u=i?1:-1,Ar=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,p=l):(p=Math.floor(Math.log(r)/Math.LN2),r*(s=Math.pow(2,-p))<1&&(p--,s*=2),p+a>=1?r+=I/s:r+=I*Math.pow(2,1-a),r*s>=2&&(p++,s/=2),p+a>=l?(c=0,p=l):p+a>=1?(c=(r*s-1)*Math.pow(2,n),p=p+a):(c=r*Math.pow(2,a-1)*Math.pow(2,n),p=0));n>=8;e[t+A]=c&255,A+=u,c/=256,n-=8);for(p=p<<n|c,f+=n;f>0;e[t+A]=p&255,A+=u,p/=256,f-=8);e[t+A-u]|=Ar*128}var wt=(u=>(u[u.Solana=1]="Solana",u[u.Algorand=8]="Algorand",u[u.Polygon=5]="Polygon",u[u.Bsc=4]="Bsc",u[u.Avalanche=6]="Avalanche",u[u.Arbitrum=23]="Arbitrum",u[u.Optimism=24]="Optimism",u[u.Base=30]="Base",u[u.Ethereum=2]="Ethereum",u[u.Sepolia=10002]="Sepolia",u[u.ArbitrumSepolia=10003]="ArbitrumSepolia",u[u.BaseSepolia=10004]="BaseSepolia",u[u.OptimismSepolia=10005]="OptimismSepolia",u[u.PolygonAmoy=10007]="PolygonAmoy",u))(wt||{}),ae={1:"Solana",2:"Ethereum",5:"Polygon",4:"BNB Chain",6:"Avalanche",8:"Algorand",23:"Arbitrum",24:"Optimism",30:"Base",10002:"Ethereum Sepolia",10003:"Arbitrum Sepolia",10004:"Base Sepolia",10005:"Optimism Sepolia",10007:"Polygon Amoy"},se={4:["","https://bsc-testnet.public.blastapi.io","https://bsc-testnet.blockpi.network/v1/rpc/private","https://bsc-testnet-rpc.publicnode.com","https://api.zan.top/bsc-testnet","https://data-seed-prebsc-2-s1.bnbchain.org:8545","https://data-seed-prebsc-2-s2.bnbchain.org:8545","https://data-seed-prebsc-2-s3.bnbchain.org:8545","https://data-seed-prebsc-1-s1.bnbchain.org:8545","https://data-seed-prebsc-1-s2.bnbchain.org:8545","https://data-seed-prebsc-1-s3.bnbchain.org:8545","https://endpoints.omniatech.io/v1/bsc/testnet/public"],6:["","https://rpc.ankr.com/avalanche_fuji","https://rpc.ankr.com/avalanche_fuji-c","https://api.avax-test.network/ext/bc/C/rpc","https://ava-testnet.public.blastapi.io/ext/bc/C/rpc","https://endpoints.omniatech.io/v1/avax/fuji/public","https://avalanche-fuji.blockpi.network/v1/rpc/private","https://avalanche-fuji-c-chain-rpc.publicnode.com","https://avalanche-fuji.blockpi.network/v1/rpc/private"],10002:["https://ethereum-sepolia-rpc.publicnode.com","https://sepolia.gateway.tenderly.co","https://eth-sepolia.public.blastapi.io","https://ethereum-sepolia.blockpi.network/v1/rpc/private","https://sepolia.drpc.org","https://endpoints.omniatech.io/v1/eth/sepolia/public","https://1rpc.io/sepolia","https://gateway.tenderly.co/public/sepolia","https://sepolia.gateway.tenderly.co","https://api.zan.top/eth-sepolia","https://ethereum-sepolia.rpc.subquery.network/public"],10003:["","https://arbitrum-sepolia.blockpi.network/v1/rpc/private ","https://arbitrum-sepolia.gateway.tenderly.co","https://endpoints.omniatech.io/v1/arbitrum/sepolia/public","https://api.zan.top/arb-sepolia","https://sepolia-rollup.arbitrum.io/rpc"],10004:["","https://sepolia.base.org","https://base-sepolia-rpc.publicnode.com","https://base-sepolia.gateway.tenderly.co","https://base-sepolia.blockpi.network/v1/rpc/private","https://node.histori.xyz/base-sepolia/8ry9f6t9dct1se2hlagxnd9n2a"],10005:["","https://optimism-sepolia.blockpi.network/v1/rpc/private","https://sepolia.optimism.io","https://api.zan.top/opt-sepolia","https://optimism-sepolia.gateway.tenderly.co","https://optimism-sepolia.drpc.org","https://endpoints.omniatech.io/v1/op/sepolia/public"],10007:["https://rpc-amoy.polygon.technology","https://polygon-amoy-bor-rpc.publicnode.com","https://rpc.ankr.com/polygon_amoy","https://polygon-amoy.drpc.org","https://api.zan.top/polygon-amoy","https://polygon-amoy.gateway.tenderly.co"]},fe={2:["","https://eth.llamarpc.com","https://ethereum.blockpi.network/v1/rpc/public","https://eth-mainnet.nodereal.io/v1/1659dfb40aa24bbb8153a677b98064d7","https://uk.rpc.blxrbdn.com","https://singapore.rpc.blxrbdn.com","https://virginia.rpc.blxrbdn.com","https://eth-mainnet.public.blastapi.io","https://api.securerpc.com/v1","https://mainnet.gateway.tenderly.co","https://eth-pokt.nodies.app","https://eth.blockrazor.xyz","https://eth.merkle.io","https://gateway.tenderly.co/public/mainnet","https://eth.rpc.blxrbdn.com"],4:["","https://bsc.blockrazor.xyz","https://bscrpc.com","https://bsc-mainnet.public.blastapi.io","https://binance.llamarpc.com","https://go.getblock.io/cc778cdbdf5c4b028ec9456e0e6c0cf3","https://bsc-pokt.nodies.app","https://56.rpc.thirdweb.com","https://bsc.blockpi.network/v1/rpc/private","https://bsc.rpc.blxrbdn.com","https://bsc-dataseed.bnbchain.org","https://endpoints.omniatech.io/v1/bsc/mainnet/public","https://bsc-dataseed1.ninicoin.io","https://bsc-dataseed2.defibit.io","https://bsc-dataseed2.ninicoin.io","https://0.48.club","https://bsc-dataseed3.defibit.io"],5:["","https://polygon.llamarpc.com","https://polygon-rpc.com","https://rpc-mainnet.matic.quiknode.pro","https://endpoints.omniatech.io/v1/matic/mainnet/public","https://polygon-pokt.nodies.app","https://polygon-bor-rpc.publicnode.com","https://polygon.rpc.subquery.network/public","https://polygon-bor-rpc.publicnode.com","https://polygon.blockpi.network/v1/rpc/private","https://polygon.api.onfinality.io/public","https://polygon.lava.build","https://api.zan.top/polygon-mainnet","https://polygon.meowrpc.com"],6:["","https://avalanche-c-chain-rpc.publicnode.com","https://ava-mainnet.public.blastapi.io/ext/bc/C/rpc","https://endpoints.omniatech.io/v1/avax/mainnet/public","https://avalanche-c-chain-rpc.publicnode.com","https://avalanche.blockpi.network/v1/rpc/private","https://avalanche.public-rpc.com","https://avalanche.drpc.org","https://avax.meowrpc.com","https://endpoints.omniatech.io/v1/avax/mainnet/public","https://api.avax.network/ext/bc/C/rpc","https://1rpc.io/avax/c","https://avax-pokt.nodies.app/ext/bc/C/rpc","https://endpoints.omniatech.io/v1/avax/mainnet/public","https://api.zan.top/avax-mainnet/ext/bc/C/rpc"],23:["","https://arbitrum.llamarpc.com","https://arbitrum.rpc.subquery.network/public","https://endpoints.omniatech.io/v1/arbitrum/one/public","https://arbitrum.meowrpc.com","https://arbitrum.gateway.tenderly.co","https://arbitrum-one.public.blastapi.io","https://arb1.lava.build","https://arbitrum-one.publicnode.com","https://arbitrum.blockpi.network/v1/rpc/public","https://arb-pokt.nodies.app","https://api.zan.top/arb-one","https://arb1.arbitrum.io/rpc","https://arbitrum.drpc.org","https://1rpc.io/arb"],24:["","https://optimism.llamarpc.com","https://op-pokt.nodies.app","https://optimism-mainnet.public.blastapi.io","https://optimism.blockpi.network/v1/rpc/public","https://endpoints.omniatech.io/v1/op/mainnet/public","https://optimism-rpc.publicnode.com","https://optimism.drpc.org","https://1rpc.io/op","https://optimism.gateway.tenderly.co","https://optimism.lava.build","https://optimism.rpc.subquery.network/public","https://mainnet.optimism.io","https://optimism-rpc.publicnode.com","https://gateway.tenderly.co/public/optimism"],30:["","https://base.llamarpc.com","https://base-mainnet.public.blastapi.io","https://base-rpc.publicnode.com","https://base.blockpi.network/v1/rpc/public","https://base.drpc.org","https://mainnet.base.org","https://base.api.onfinality.io/public","https://base-pokt.nodies.app","https://1rpc.io/base","https://developer-access-mainnet.base.org","https://endpoints.omniatech.io/v1/base/mainnet/public","https://base.rpc.subquery.network/public","https://base.api.onfinality.io/public","https://base.meowrpc.com","https://base.gateway.tenderly.co"]};var Rt=(n=>(n[n.Off=0]="Off",n[n.Full=1]="Full",n[n.Partial=2]="Partial",n[n.Scheduled=3]="Scheduled",n))(Rt||{});var Tt=(o=>(o[o.SELF_TRADE=1]="SELF_TRADE",o[o.FULL_FILLED=2]="FULL_FILLED",o[o.FULL_CANCELLED=3]="FULL_CANCELLED",o[o.PARTIALLY_CANCELLED=4]="PARTIALLY_CANCELLED",o[o.CREATED=5]="CREATED",o))(Tt||{});var Nt=(s=>(s.USERS_READ="users.read",s.FOLLOWS_READ="follows.read",s.FOLLOWS_WRITE="follows.write",s.TWEET_READ="tweet.read",s.TWEET_WRITE="tweet.write",s.OFFLINE_ACCESS="offline.access",s.LIKE_READ="like.read",s.LIKE_WRITE="like.write",s))(Nt||{});var sr=(f=>(f.MFT_AUDIO_LINK="mft.audioLink",f.MFT_TITLE="mft.title",f.MODE_PRE_SALE="mode.preSale",f.MAKER_FEE="makerFee",f.TAKER_FEE="takerFee",f.VIEW_BASE_COIN_ICON_LINK="view.baseCoinIconLink",f.VIEW_BASE_COIN_MARKET_LINK="view.baseCoinMarketLink",f.VIEW_PRICE_COIN_ICON_LINK="view.priceCoinIconLink",f.VIEW_PRICE_COIN_MARKET_LINK="view.priceCoinMarketLink",f))(sr||{}),bt=sr;var fr=(t=>(t[t.Buy=0]="Buy",t[t.Sell=1]="Sell",t))(fr||{}),Ct=fr;var ur=(o=>(o[o.Open=1]="Open",o[o.Canceled=2]="Canceled",o[o.Matched=3]="Matched",o[o.SelfMatched=4]="SelfMatched",o[o.Expired=5]="Expired",o))(ur||{}),dt=ur;var lr=(n=>(n[n.Limit=0]="Limit",n[n.IOC=1]="IOC",n[n.POST=2]="POST",n[n.Market=3]="Market",n))(lr||{}),gt=lr;var Er=(t=>(t.User="User",t.Api="API",t))(Er||{});var Dt=(n=>(n.COMPANY="COMPANY",n.TWITTER="TWITTER",n.DISCORD="DISCORD",n.TELEGRAM="TELEGRAM",n))(Dt||{}),vt=(a=>(a[a.TWITTER_FOLLOW=1]="TWITTER_FOLLOW",a[a.TWITTER_REPLY=2]="TWITTER_REPLY",a[a.TWITTER_RETWEET=3]="TWITTER_RETWEET",a[a.TWITTER_LIKE=4]="TWITTER_LIKE",a[a.COMPANY_FIRST_LOGIN=5]="COMPANY_FIRST_LOGIN",a[a.COMPANY_CONFIRM_EMAIL=6]="COMPANY_CONFIRM_EMAIL",a[a.COMPANY_DEPOSIT=7]="COMPANY_DEPOSIT",a[a.COMPANY_TRADE=8]="COMPANY_TRADE",a[a.TELEGRAM_JOIN_GROUP=9]="TELEGRAM_JOIN_GROUP",a[a.DISCORD_JOIN_SERVER=10]="DISCORD_JOIN_SERVER",a[a.AFFILIATE_POINTS_REWARD=11]="AFFILIATE_POINTS_REWARD",a))(vt||{}),ke=[1,9,10,6,5];var Ot=(n=>(n.CREATED="created",n.STARTED="started",n.PAUSED="paused",n.CLOSED="closed",n))(Ot||{}),Lt=(t=>(t.Post="POST",t.Comment="COMMENT",t))(Lt||{});var yt=(p=>(p.INSTRUCTIONS="INSTRUCTIONS",p.TEXT_STYLE="TEXT_STYLE",p.TEXT_TONE="TEXT_TONE",p.REACTION_TYPE="REACTION_TYPE",p.COMMENT_LENGTH="COMMENT_LENGTH",p.CONTEXT="CONTEXT",p))(yt||{});var Ut=(p=>(p[p.FEE_TIER_1=1]="FEE_TIER_1",p[p.FEE_TIER_2=2]="FEE_TIER_2",p[p.FEE_TIER_3=3]="FEE_TIER_3",p[p.FEE_TIER_4=4]="FEE_TIER_4",p[p.FEE_TIER_5=5]="FEE_TIER_5",p[p.FEE_TIER_6=6]="FEE_TIER_6",p))(Ut||{}),Pt=(t=>(t[t.Approve=1]="Approve",t[t.Reject=0]="Reject",t))(Pt||{}),Bt=(o=>(o.INITIATED="INITIATED",o.CREATED="CREATED",o.PROCESSING="PROCESSING",o.APPROVED="APPROVED",o.REJECTED="REJECTED",o))(Bt||{});var St=(o=>(o.INVITED_ACCOUNTS_COUNT="invitedAccountsCount",o.CREATED_AT="createdAt",o.FEE_SHARE="feeShare",o.ADDRESS="address",o.REFERRAL_TRADING_VOLUME="referralTradingVolume",o))(St||{});var Yt=(p=>(p.ACTIVE="ACTIVE",p.FAILED="FAILED",p.STARTING="STARTING",p.DRAINING="DRAINING",p.TERMINATING="TERMINATING",p.TERMINATED="TERMINATED",p))(Yt||{}),Mt=(o=>(o.MATCHING_ENGINE="me",o.ORDER_SERVICE="ors",o.API="api",o.SOCKET_SERVICE="ws",o.TRANSACTION_SERVICE="tns",o))(Mt||{}),kt=(o=>(o.ACTIVE="ACTIVE",o.FAILED="FAILED",o.UNASSIGNED="UNASSIGNED",o.ASSIGNED="ASSIGNED",o.STARTING="STARTING",o))(kt||{});var Gt=(n=>(n.Pending="pending",n.Completed="completed",n.Failed="failed",n.Received="received",n))(Gt||{}),Ft=(i=>(i.Deposit="deposit",i.Withdraw="withdraw",i.Rebalance="rebalance",i))(Ft||{}),Wt=(i=>(i.PENDING="pending",i.COMPLETED="completed",i.FAILED="failed",i))(Wt||{}),Vt=(o=>(o.USER_TO_TMC="user_to_tmc",o.TMC_TO_USER="tmc_to_user",o.RELAYER_TO_TMC="relayer_to_tmc",o.RELAYER_TO_CODEX="relayer_to_codex",o.RELAYER_TO_CIRCLE="relayer_to_circle",o))(Vt||{});var Ht=(i=>(i.Unconfirmed="UNCONFIRMED",i.Confirmed="CONFIRMED",i.Rejected="REJECTED",i))(Ht||{}),Kt=(i=>(i.RESUBMITTED="RESUBMITTED",i.PROCESSED="PROCESSED",i.REMATCHED="REMATCHED",i))(Kt||{});var zt=(n=>(n[n.FIRST=1]="FIRST",n[n.SECOND=2]="SECOND",n[n.THIRD=3]="THIRD",n[n.FOURTH=4]="FOURTH",n))(zt||{}),Jt=(c=>(c.REBATE_TIER="rebateTier",c.CREATED_AT="createdAt",c.NAME="name",c.TAKER_FEE="takerFee",c.ENABLED="enabled",c.ADDRESS="address",c.CHAIN="chainId",c))(Jt||{});var Xt=(t=>(t.ASCENDING="ASC",t.DESCENDING="DESC",t))(Xt||{});var xr=(n=>(n.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",n.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",n.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",n.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",n))(xr||{}),mr=(i=>(i.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",i.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",i.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",i))(mr||{}),mi={...xr,...mr},qt=(i=>(i.CRITICAL="CRITICAL",i.IMPORTANT="IMPORTANT",i.INFO="INFO",i))(qt||{}),Qt=(t=>(t.UNREAD="UNREAD",t.READ="READ",t))(Qt||{}),Zt=(i=>(i.PENDING="PENDING",i.PROCESSED="PROCESSED",i.FAILED="FAILED",i))(Zt||{});var $t=(p=>(p.STRING="string",p.BOOLEAN="boolean",p.INT="int",p.FLOAT="float",p.SINGLE_CHOICE="single-choice",p.MULTI_CHOICE="multi-choice",p))($t||{});var jt=(c=>(c.VERSION="version",c.LAST_ALGO_BLOCK="last_algo_block",c.PRICES_PROVIDER_API_KEY="prices_provider_api_key",c.DEFAULT_API_DOMAIN="default_api_domain",c.NONCE_ACCOUNTS_SOLANA="nonce_accounts_solana",c.ARCHIVE_DATA_BATCH_SIZE="archive_data_batch_size",c.ARCHIVE_TASK_LOCK="archive_task_lock",c))(jt||{});var re=(i=>(i.SUCCESS="success",i.FAILED="failed",i.PENDING="pending",i))(re||{});var te=(i=>(i.SOLANA="SOLANA",i.ALGORAND="ALGORAND",i.EVM="EVM",i))(te||{});var ee=(o=>(o.CONNECTED="CONNECTED",o.CONNECTING="CONNECTING",o.DISCONNECTED="DISCONNECTED",o.DISCONNECTING="DISCONNECTING",o.PENDING="PENDING",o))(ee||{});export{mr as AccountNotificationEnum,vt as ActionEnum,Dt as ActionSource,Ft as ActionTypeEnum,St as AffiliateSortByEnum,bt as AvailablePairSettings,Wt as CCTPStatus,ae as ChainNames,wt as Chains,mi as CombinedNotificationEnum,Yt as ComponentStatusType,Mt as ComponentType,Ut as FeeTier,xr as GlobalNotificationEnum,fe as HTTPSRPC_MAINNET,se as HTTPSRPC_TESTNET,Bt as KYCAuthenticationStatus,Pt as LastLookAction,Rt as MaintenanceMode,zt as MarketMakerRebateTier,Jt as MarketMakerSortByEnum,ke as NON_REPEATABLE_ACTIONS,Tt as Notification,qt as NotificationPriorityEnum,Qt as NotificationStatusEnum,Gt as OperationStatusEnum,Ct as OrderSide,dt as OrderStatus,gt as OrderType,kt as PairComponentStatusType,yt as PromptTypeEnum,ee as RabbitConnectionStatus,Zt as ScheduledNotificationStatusEnum,Ot as SeasonStatusEnum,$t as SettingTypeColumn,Xt as SortDirectionEnum,jt as StateType,Ht as TradeStatus,Kt as TradeSubStatus,Er as TradingKeyType,Vt as TransactionType,Lt as TweetType,Nt as TwitterAccessScopeEnum,re as UpgradeStatus,te as WithdrawalWalletType};
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 hr(){throw new Error("setTimeout has not been defined")}function ar(){throw new Error("clearTimeout has not been defined")}var P=hr,D=ar;typeof globalThis.setTimeout=="function"&&(P=setTimeout);typeof globalThis.clearTimeout=="function"&&(D=clearTimeout);function cr(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 Zr(i){if(D===clearTimeout)return clearTimeout(i);if((D===ar||!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 B=[],N=!1,S,L=-1;function qr(){!N||!S||(N=!1,S.length?B=S.concat(B):L=-1,B.length&&sr())}function sr(){if(!N){var i=cr(qr);N=!0;for(var r=B.length;r;){for(S=B,B=[];++L<r;)S&&S[L].run();L=-1,r=B.length}S=null,N=!1,Zr(i)}}function jr(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 pr(i,r)),B.length===1&&!N&&cr(sr)}function pr(i,r){this.fun=i,this.array=r}pr.prototype.run=function(){this.fun.apply(null,this.array)};var rn="browser",nn="browser",en=!0,tn={},un=[],on="",fn={},hn={},an={};function Y(){}var cn=Y,sn=Y,pn=Y,ln=Y,xn=Y,wn=Y,En=Y;function yn(i){throw new Error("process.binding is not supported")}function An(){return"/"}function gn(i){throw new Error("process.chdir is not supported")}function mn(){return 0}var M=globalThis.performance||{},Un=M.now||M.mozNow||M.msNow||M.oNow||M.webkitNow||function(){return new Date().getTime()};function In(i){var r=Un.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 Rn=new Date;function Tn(){var i=new Date,r=i-Rn;return r/1e3}var $={nextTick:jr,title:rn,browser:en,env:tn,argv:un,version:on,versions:fn,on:cn,addListener:sn,once:pn,off:ln,removeListener:xn,removeAllListeners:wn,emit:En,binding:yn,cwd:An,chdir:gn,umask:mn,hrtime:In,platform:nn,release:hn,config:an,uptime:Tn},fr={};Object.keys(fr).forEach(i=>{let r=i.split("."),n=$;for(let e=0;e<r.length;e++){let t=r[e];e===r.length-1?n[t]=fr[i]:n=n[t]||(n[t]={})}});var R=[],U=[],_n=typeof Uint8Array<"u"?Uint8Array:Array,rr=!1;function Er(){rr=!0;for(var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,n=i.length;r<n;++r)R[r]=i[r],U[i.charCodeAt(r)]=r;U[45]=62,U[95]=63}function dn(i){rr||Er();var r,n,e,t,u,o,f=i.length;if(f%4>0)throw new Error("Invalid string. Length must be a multiple of 4");u=i[f-2]==="="?2:i[f-1]==="="?1:0,o=new _n(f*3/4-u),e=u>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)],o[c++]=t>>16&255,o[c++]=t>>8&255,o[c++]=t&255;return u===2?(t=U[i.charCodeAt(r)]<<2|U[i.charCodeAt(r+1)]>>4,o[c++]=t&255):u===1&&(t=U[i.charCodeAt(r)]<<10|U[i.charCodeAt(r+1)]<<4|U[i.charCodeAt(r+2)]>>2,o[c++]=t>>8&255,o[c++]=t&255),o}function Bn(i){return R[i>>18&63]+R[i>>12&63]+R[i>>6&63]+R[i&63]}function Fn(i,r,n){for(var e,t=[],u=r;u<n;u+=3)e=(i[u]<<16)+(i[u+1]<<8)+i[u+2],t.push(Bn(e));return t.join("")}function lr(i){rr||Er();for(var r,n=i.length,e=n%3,t="",u=[],o=16383,f=0,c=n-e;f<c;f+=o)u.push(Fn(i,f,f+o>c?c:f+o));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+="="),u.push(t),u.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?Dn(i,r,n,e):typeof r=="string"?Pn(i,r,n):Sn(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 vn(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 vn(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 Pn(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=gr(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 Dn(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 Sn(i,r){if(T(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"||Zn(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=qn;function T(i){return!!(i!=null&&i._isBuffer)}a.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,u=0,o=Math.min(e,t);u<o;++u)if(r[u]!==n[u]){e=r[u],t=n[u];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),u=0;for(e=0;e<r.length;++e){var o=r[e];if(!T(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(t,u),u+=o.length}return t};function gr(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 z(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return dr(i).length;default:if(e)return z(i).length;r=(""+r).toLowerCase(),e=!0}}a.byteLength=gr;function Yn(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 Vn(this,r,n);case"utf8":case"utf-8":return Ir(this,r,n);case"ascii":return zn(this,r,n);case"latin1":case"binary":return bn(this,r,n);case"base64":return $n(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}}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):Yn.apply(this,arguments)};a.prototype.equals=function(r){if(!T(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,u){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),u===void 0&&(u=this.length),n<0||e>r.length||t<0||u>this.length)throw new RangeError("out of range index");if(t>=u&&n>=e)return 0;if(t>=u)return-1;if(n>=e)return 1;if(n>>>=0,e>>>=0,t>>>=0,u>>>=0,this===r)return 0;for(var o=u-t,f=e-n,c=Math.min(o,f),p=this.slice(t,u),l=r.slice(n,e),s=0;s<c;++s)if(p[s]!==l[s]){o=p[s],f=l[s];break}return o<f?-1:f<o?1:0};function mr(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)),T(r))return r.length===0?-1:xr(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):xr(i,[r],n,e,t);throw new TypeError("val must be string, number or Buffer")}function xr(i,r,n,e,t){var u=1,o=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;u=2,o/=2,f/=2,n/=2}function c(x,m){return u===1?x[m]:x.readUInt16BE(m*u)}var p;if(t){var l=-1;for(p=n;p<o;p++)if(c(i,p)===c(r,l===-1?0:p-l)){if(l===-1&&(l=p),p-l+1===f)return l*u}else l!==-1&&(p-=p-l),l=-1}else for(n+f>o&&(n=o-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 mr(this,r,n,e,!0)};a.prototype.lastIndexOf=function(r,n,e){return mr(this,r,n,e,!1)};function kn(i,r,n,e){n=Number(n)||0;var t=i.length-n;e?(e=Number(e),e>t&&(e=t)):e=t;var u=r.length;if(u%2!==0)throw new TypeError("Invalid hex string");e>u/2&&(e=u/2);for(var o=0;o<e;++o){var f=parseInt(r.substr(o*2,2),16);if(isNaN(f))return o;i[n+o]=f}return o}function Cn(i,r,n,e){return H(z(r,i.length-n),i,n,e)}function Ur(i,r,n,e){return H(Kn(r),i,n,e)}function Mn(i,r,n,e){return Ur(i,r,n,e)}function Nn(i,r,n,e){return H(dr(r),i,n,e)}function Ln(i,r,n,e){return H(Qn(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 u=this.length-n;if((e===void 0||e>u)&&(e=u),r.length>0&&(e<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");t||(t="utf8");for(var o=!1;;)switch(t){case"hex":return kn(this,r,n,e);case"utf8":case"utf-8":return Cn(this,r,n,e);case"ascii":return Ur(this,r,n,e);case"latin1":case"binary":return Mn(this,r,n,e);case"base64":return Nn(this,r,n,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ln(this,r,n,e);default:if(o)throw new TypeError("Unknown encoding: "+t);t=(""+t).toLowerCase(),o=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function $n(i,r,n){return r===0&&n===i.length?lr(i):lr(i.slice(r,n))}function Ir(i,r,n){n=Math.min(i.length,n);for(var e=[],t=r;t<n;){var u=i[t],o=null,f=u>239?4:u>223?3:u>191?2:1;if(t+f<=n){var c,p,l,s;switch(f){case 1:u<128&&(o=u);break;case 2:c=i[t+1],(c&192)===128&&(s=(u&31)<<6|c&63,s>127&&(o=s));break;case 3:c=i[t+1],p=i[t+2],(c&192)===128&&(p&192)===128&&(s=(u&15)<<12|(c&63)<<6|p&63,s>2047&&(s<55296||s>57343)&&(o=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=(u&15)<<18|(c&63)<<12|(p&63)<<6|l&63,s>65535&&s<1114112&&(o=s))}}o===null?(o=65533,f=1):o>65535&&(o-=65536,e.push(o>>>10&1023|55296),o=56320|o&1023),e.push(o),t+=f}return Wn(e)}var wr=4096;function Wn(i){var r=i.length;if(r<=wr)return String.fromCharCode.apply(String,i);for(var n="",e=0;e<r;)n+=String.fromCharCode.apply(String,i.slice(e,e+=wr));return n}function zn(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 bn(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 Vn(i,r,n){var e=i.length;(!r||r<0)&&(r=0),(!n||n<0||n>e)&&(n=e);for(var t="",u=r;u<n;++u)t+=Xn(i[u]);return t}function Hn(i,r,n){for(var e=i.slice(r,n),t="",u=0;u<e.length;u+=2)t+=String.fromCharCode(e[u]+e[u+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 u=n-r;t=new a(u,void 0);for(var o=0;o<u;++o)t[o]=this[o+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],u=1,o=0;++o<n&&(u*=256);)t+=this[r+o]*u;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],u=1;n>0&&(u*=256);)t+=this[r+--n]*u;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],u=1,o=0;++o<n&&(u*=256);)t+=this[r+o]*u;return u*=128,t>=u&&(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,u=1,o=this[r+--t];t>0&&(u*=256);)o+=this[r+--t]*u;return u*=128,o>=u&&(o-=Math.pow(2,8*n)),o};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),O(this,r,!0,23,4)};a.prototype.readFloatBE=function(r,n){return n||E(r,4,this.length),O(this,r,!1,23,4)};a.prototype.readDoubleLE=function(r,n){return n||E(r,8,this.length),O(this,r,!0,52,8)};a.prototype.readDoubleBE=function(r,n){return n||E(r,8,this.length),O(this,r,!1,52,8)};function A(i,r,n,e,t,u){if(!T(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>t||r<u)throw new RangeError('"value" argument is out of bounds');if(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 u=Math.pow(2,8*e)-1;A(this,r,n,e,u,0)}var o=1,f=0;for(this[n]=r&255;++f<e&&(o*=256);)this[n+f]=r/o&255;return n+e};a.prototype.writeUIntBE=function(r,n,e,t){if(r=+r,n=n|0,e=e|0,!t){var u=Math.pow(2,8*e)-1;A(this,r,n,e,u,0)}var o=e-1,f=1;for(this[n+o]=r&255;--o>=0&&(f*=256);)this[n+o]=r/f&255;return n+e};a.prototype.writeUInt8=function(r,n,e){return r=+r,n=n|0,e||A(this,r,n,1,255,0),a.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[n]=r&255,n+1};function b(i,r,n,e){r<0&&(r=65535+r+1);for(var t=0,u=Math.min(i.length-n,2);t<u;++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||A(this,r,n,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8):b(this,r,n,!0),n+2};a.prototype.writeUInt16BE=function(r,n,e){return r=+r,n=n|0,e||A(this,r,n,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[n]=r>>>8,this[n+1]=r&255):b(this,r,n,!1),n+2};function V(i,r,n,e){r<0&&(r=4294967295+r+1);for(var t=0,u=Math.min(i.length-n,4);t<u;++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||A(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):V(this,r,n,!0),n+4};a.prototype.writeUInt32BE=function(r,n,e){return r=+r,n=n|0,e||A(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):V(this,r,n,!1),n+4};a.prototype.writeIntLE=function(r,n,e,t){if(r=+r,n=n|0,!t){var u=Math.pow(2,8*e-1);A(this,r,n,e,u-1,-u)}var o=0,f=1,c=0;for(this[n]=r&255;++o<e&&(f*=256);)r<0&&c===0&&this[n+o-1]!==0&&(c=1),this[n+o]=(r/f>>0)-c&255;return n+e};a.prototype.writeIntBE=function(r,n,e,t){if(r=+r,n=n|0,!t){var u=Math.pow(2,8*e-1);A(this,r,n,e,u-1,-u)}var o=e-1,f=1,c=0;for(this[n+o]=r&255;--o>=0&&(f*=256);)r<0&&c===0&&this[n+o+1]!==0&&(c=1),this[n+o]=(r/f>>0)-c&255;return n+e};a.prototype.writeInt8=function(r,n,e){return r=+r,n=n|0,e||A(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||A(this,r,n,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8):b(this,r,n,!0),n+2};a.prototype.writeInt16BE=function(r,n,e){return r=+r,n=n|0,e||A(this,r,n,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[n]=r>>>8,this[n+1]=r&255):b(this,r,n,!1),n+2};a.prototype.writeInt32LE=function(r,n,e){return r=+r,n=n|0,e||A(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):V(this,r,n,!0),n+4};a.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),a.TYPED_ARRAY_SUPPORT?(this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255):V(this,r,n,!1),n+4};function Rr(i,r,n,e,t,u){if(n+e>i.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Tr(i,r,n,e,t){return t||Rr(i,r,n,4,34028234663852886e22,-34028234663852886e22),Fr(i,r,n,e,23,4),n+4}a.prototype.writeFloatLE=function(r,n,e){return Tr(this,r,n,!0,e)};a.prototype.writeFloatBE=function(r,n,e){return Tr(this,r,n,!1,e)};function _r(i,r,n,e,t){return t||Rr(i,r,n,8,17976931348623157e292,-17976931348623157e292),Fr(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 u=t-e,o;if(this===r&&e<n&&n<t)for(o=u-1;o>=0;--o)r[o+n]=this[o+e];else if(u<1e3||!a.TYPED_ARRAY_SUPPORT)for(o=0;o<u;++o)r[o+n]=this[o+e];else Uint8Array.prototype.set.call(r,this.subarray(e,e+u),n);return u};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 u=r.charCodeAt(0);u<256&&(r=u)}if(t!==void 0&&typeof t!="string")throw new TypeError("encoding must be a string");if(typeof t=="string"&&!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 o;if(typeof r=="number")for(o=n;o<e;++o)this[o]=r;else{var f=T(r)?r:z(new a(r,t).toString()),c=f.length;for(o=0;o<e-n;++o)this[o+n]=f[o%c]}return this};var On=/[^+\/0-9A-Za-z-_]/g;function Gn(i){if(i=Jn(i).replace(On,""),i.length<2)return"";for(;i.length%4!==0;)i=i+"=";return i}function Jn(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 z(i,r){r=r||1/0;for(var n,e=i.length,t=null,u=[],o=0;o<e;++o){if(n=i.charCodeAt(o),n>55295&&n<57344){if(!t){if(n>56319){(r-=3)>-1&&u.push(239,191,189);continue}else if(o+1===e){(r-=3)>-1&&u.push(239,191,189);continue}t=n;continue}if(n<56320){(r-=3)>-1&&u.push(239,191,189),t=n;continue}n=(t-55296<<10|n-56320)+65536}else t&&(r-=3)>-1&&u.push(239,191,189);if(t=null,n<128){if((r-=1)<0)break;u.push(n)}else if(n<2048){if((r-=2)<0)break;u.push(n>>6|192,n&63|128)}else if(n<65536){if((r-=3)<0)break;u.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((r-=4)<0)break;u.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return u}function Kn(i){for(var r=[],n=0;n<i.length;++n)r.push(i.charCodeAt(n)&255);return r}function Qn(i,r){for(var n,e,t,u=[],o=0;o<i.length&&!((r-=2)<0);++o)n=i.charCodeAt(o),e=n>>8,t=n%256,u.push(t),u.push(e);return u}function dr(i){return dn(Gn(i))}function H(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 Zn(i){return i!==i}function qn(i){return i!=null&&(!!i._isBuffer||Br(i)||jn(i))}function Br(i){return!!i.constructor&&typeof i.constructor.isBuffer=="function"&&i.constructor.isBuffer(i)}function jn(i){return typeof i.readFloatLE=="function"&&typeof i.slice=="function"&&Br(i.slice(0,0))}function O(i,r,n,e,t){var u,o,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,u=x&(1<<-l)-1,x>>=-l,l+=f;l>0;u=u*256+i[r+s],s+=w,l-=8);for(o=u&(1<<-l)-1,u>>=-l,l+=e;l>0;o=o*256+i[r+s],s+=w,l-=8);if(u===0)u=1-p;else{if(u===c)return o?NaN:(x?-1:1)*(1/0);o=o+Math.pow(2,e),u=u-p}return(x?-1:1)*o*Math.pow(2,u-e)}function Fr(i,r,n,e,t,u){var o,f,c,p=u*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:u-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,o=l):(o=Math.floor(Math.log(r)/Math.LN2),r*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+s>=1?r+=w/c:r+=w*Math.pow(2,1-s),r*c>=2&&(o++,c/=2),o+s>=l?(f=0,o=l):o+s>=1?(f=(r*c-1)*Math.pow(2,t),o=o+s):(f=r*Math.pow(2,s-1)*Math.pow(2,t),o=0));t>=8;i[n+x]=f&255,x+=m,f/=256,t-=8);for(o=o<<t|f,p+=t;p>0;i[n+x]=o&255,x+=m,o/=256,p-=8);i[n+x-m]|=q*128}import Di,{decodeAddress as Si,encodeAddress as Yi}from"algosdk";var _=[],I=[],ri=typeof Uint8Array<"u"?Uint8Array:Array,tr=!1;function Sr(){tr=!0;for(var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,n=i.length;r<n;++r)_[r]=i[r],I[i.charCodeAt(r)]=r;I[45]=62,I[95]=63}function ni(i){tr||Sr();var r,n,e,t,u,o,f=i.length;if(f%4>0)throw new Error("Invalid string. Length must be a multiple of 4");u=i[f-2]==="="?2:i[f-1]==="="?1:0,o=new ri(f*3/4-u),e=u>0?f-4:f;var c=0;for(r=0,n=0;r<e;r+=4,n+=3)t=I[i.charCodeAt(r)]<<18|I[i.charCodeAt(r+1)]<<12|I[i.charCodeAt(r+2)]<<6|I[i.charCodeAt(r+3)],o[c++]=t>>16&255,o[c++]=t>>8&255,o[c++]=t&255;return u===2?(t=I[i.charCodeAt(r)]<<2|I[i.charCodeAt(r+1)]>>4,o[c++]=t&255):u===1&&(t=I[i.charCodeAt(r)]<<10|I[i.charCodeAt(r+1)]<<4|I[i.charCodeAt(r+2)]>>2,o[c++]=t>>8&255,o[c++]=t&255),o}function ii(i){return _[i>>18&63]+_[i>>12&63]+_[i>>6&63]+_[i&63]}function ei(i,r,n){for(var e,t=[],u=r;u<n;u+=3)e=(i[u]<<16)+(i[u+1]<<8)+i[u+2],t.push(ii(e));return t.join("")}function vr(i){tr||Sr();for(var r,n=i.length,e=n%3,t="",u=[],o=16383,f=0,c=n-e;f<c;f+=o)u.push(ei(i,f,f+o>c?c:f+o));return e===1?(r=i[n-1],t+=_[r>>2],t+=_[r<<4&63],t+="=="):e===2&&(r=(i[n-2]<<8)+i[n-1],t+=_[r>>10],t+=_[r>>4&63],t+=_[r<<2&63],t+="="),u.push(t),u.join("")}function X(i,r,n,e,t){var u,o,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,u=x&(1<<-l)-1,x>>=-l,l+=f;l>0;u=u*256+i[r+s],s+=w,l-=8);for(o=u&(1<<-l)-1,u>>=-l,l+=e;l>0;o=o*256+i[r+s],s+=w,l-=8);if(u===0)u=1-p;else{if(u===c)return o?NaN:(x?-1:1)*(1/0);o=o+Math.pow(2,e),u=u-p}return(x?-1:1)*o*Math.pow(2,u-e)}function Yr(i,r,n,e,t,u){var o,f,c,p=u*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:u-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,o=l):(o=Math.floor(Math.log(r)/Math.LN2),r*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+s>=1?r+=w/c:r+=w*Math.pow(2,1-s),r*c>=2&&(o++,c/=2),o+s>=l?(f=0,o=l):o+s>=1?(f=(r*c-1)*Math.pow(2,t),o=o+s):(f=r*Math.pow(2,s-1)*Math.pow(2,t),o=0));t>=8;i[n+x]=f&255,x+=m,f/=256,t-=8);for(o=o<<t|f,p+=t;p>0;i[n+x]=o&255,x+=m,o/=256,p-=8);i[n+x-m]|=q*128}var ti={}.toString,kr=Array.isArray||function(i){return ti.call(i)=="[object Array]"};var ui=50;h.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;var bi=G();function G(){return h.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function v(i,r){if(G()<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 ur(this,i)}return Cr(this,i,r,n)}h.poolSize=8192;h._augment=function(i){return i.__proto__=h.prototype,i};function Cr(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?hi(i,r,n,e):typeof r=="string"?fi(i,r,n):ai(i,r)}h.from=function(i,r,n){return Cr(null,i,r,n)};h.TYPED_ARRAY_SUPPORT&&(h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array);function Mr(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 oi(i,r,n,e){return Mr(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 oi(null,i,r,n)};function ur(i,r){if(Mr(r),i=v(i,r<0?0:or(r)|0),!h.TYPED_ARRAY_SUPPORT)for(var n=0;n<r;++n)i[n]=0;return i}h.allocUnsafe=function(i){return ur(null,i)};h.allocUnsafeSlow=function(i){return ur(null,i)};function fi(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=Nr(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:or(r.length)|0;i=v(i,n);for(var e=0;e<n;e+=1)i[e]=r[e]&255;return i}function hi(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 ai(i,r){if(d(r)){var n=or(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"||Fi(r.length)?v(i,0):er(i,r);if(r.type==="Buffer"&&kr(r.data))return er(i,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function or(i){if(i>=G())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+G().toString(16)+" bytes");return i|0}h.isBuffer=vi;function d(i){return!!(i!=null&&i._isBuffer)}h.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,u=0,o=Math.min(e,t);u<o;++u)if(r[u]!==n[u]){e=r[u],t=n[u];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(!kr(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),u=0;for(e=0;e<r.length;++e){var o=r[e];if(!d(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(t,u),u+=o.length}return t};function Nr(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 J(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return Hr(i).length;default:if(e)return J(i).length;r=(""+r).toLowerCase(),e=!0}}h.byteLength=Nr;function ci(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 mi(this,r,n);case"utf8":case"utf-8":return Wr(this,r,n);case"ascii":return Ai(this,r,n);case"latin1":case"binary":return gi(this,r,n);case"base64":return Ei(this,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ui(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?Wr(this,0,r):ci.apply(this,arguments)};h.prototype.equals=function(r){if(!d(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=ui;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,u){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),u===void 0&&(u=this.length),n<0||e>r.length||t<0||u>this.length)throw new RangeError("out of range index");if(t>=u&&n>=e)return 0;if(t>=u)return-1;if(n>=e)return 1;if(n>>>=0,e>>>=0,t>>>=0,u>>>=0,this===r)return 0;for(var o=u-t,f=e-n,c=Math.min(o,f),p=this.slice(t,u),l=r.slice(n,e),s=0;s<c;++s)if(p[s]!==l[s]){o=p[s],f=l[s];break}return o<f?-1:f<o?1:0};function Lr(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)),d(r))return r.length===0?-1:Pr(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):Pr(i,[r],n,e,t);throw new TypeError("val must be string, number or Buffer")}function Pr(i,r,n,e,t){var u=1,o=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;u=2,o/=2,f/=2,n/=2}function c(x,m){return u===1?x[m]:x.readUInt16BE(m*u)}var p;if(t){var l=-1;for(p=n;p<o;p++)if(c(i,p)===c(r,l===-1?0:p-l)){if(l===-1&&(l=p),p-l+1===f)return l*u}else l!==-1&&(p-=p-l),l=-1}else for(n+f>o&&(n=o-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 Lr(this,r,n,e,!0)};h.prototype.lastIndexOf=function(r,n,e){return Lr(this,r,n,e,!1)};function si(i,r,n,e){n=Number(n)||0;var t=i.length-n;e?(e=Number(e),e>t&&(e=t)):e=t;var u=r.length;if(u%2!==0)throw new TypeError("Invalid hex string");e>u/2&&(e=u/2);for(var o=0;o<e;++o){var f=parseInt(r.substr(o*2,2),16);if(isNaN(f))return o;i[n+o]=f}return o}function pi(i,r,n,e){return Z(J(r,i.length-n),i,n,e)}function $r(i,r,n,e){return Z(di(r),i,n,e)}function li(i,r,n,e){return $r(i,r,n,e)}function xi(i,r,n,e){return Z(Hr(r),i,n,e)}function wi(i,r,n,e){return Z(Bi(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 u=this.length-n;if((e===void 0||e>u)&&(e=u),r.length>0&&(e<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");t||(t="utf8");for(var o=!1;;)switch(t){case"hex":return si(this,r,n,e);case"utf8":case"utf-8":return pi(this,r,n,e);case"ascii":return $r(this,r,n,e);case"latin1":case"binary":return li(this,r,n,e);case"base64":return xi(this,r,n,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return wi(this,r,n,e);default:if(o)throw new TypeError("Unknown encoding: "+t);t=(""+t).toLowerCase(),o=!0}};h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ei(i,r,n){return r===0&&n===i.length?vr(i):vr(i.slice(r,n))}function Wr(i,r,n){n=Math.min(i.length,n);for(var e=[],t=r;t<n;){var u=i[t],o=null,f=u>239?4:u>223?3:u>191?2:1;if(t+f<=n){var c,p,l,s;switch(f){case 1:u<128&&(o=u);break;case 2:c=i[t+1],(c&192)===128&&(s=(u&31)<<6|c&63,s>127&&(o=s));break;case 3:c=i[t+1],p=i[t+2],(c&192)===128&&(p&192)===128&&(s=(u&15)<<12|(c&63)<<6|p&63,s>2047&&(s<55296||s>57343)&&(o=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=(u&15)<<18|(c&63)<<12|(p&63)<<6|l&63,s>65535&&s<1114112&&(o=s))}}o===null?(o=65533,f=1):o>65535&&(o-=65536,e.push(o>>>10&1023|55296),o=56320|o&1023),e.push(o),t+=f}return yi(e)}var Dr=4096;function yi(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 Ai(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 gi(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 mi(i,r,n){var e=i.length;(!r||r<0)&&(r=0),(!n||n<0||n>e)&&(n=e);for(var t="",u=r;u<n;++u)t+=_i(i[u]);return t}function Ui(i,r,n){for(var e=i.slice(r,n),t="",u=0;u<e.length;u+=2)t+=String.fromCharCode(e[u]+e[u+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 u=n-r;t=new h(u,void 0);for(var o=0;o<u;++o)t[o]=this[o+r]}return t};function y(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||y(r,n,this.length);for(var t=this[r],u=1,o=0;++o<n&&(u*=256);)t+=this[r+o]*u;return t};h.prototype.readUIntBE=function(r,n,e){r=r|0,n=n|0,e||y(r,n,this.length);for(var t=this[r+--n],u=1;n>0&&(u*=256);)t+=this[r+--n]*u;return t};h.prototype.readUInt8=function(r,n){return n||y(r,1,this.length),this[r]};h.prototype.readUInt16LE=function(r,n){return n||y(r,2,this.length),this[r]|this[r+1]<<8};h.prototype.readUInt16BE=function(r,n){return n||y(r,2,this.length),this[r]<<8|this[r+1]};h.prototype.readUInt32LE=function(r,n){return n||y(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||y(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||y(r,n,this.length);for(var t=this[r],u=1,o=0;++o<n&&(u*=256);)t+=this[r+o]*u;return u*=128,t>=u&&(t-=Math.pow(2,8*n)),t};h.prototype.readIntBE=function(r,n,e){r=r|0,n=n|0,e||y(r,n,this.length);for(var t=n,u=1,o=this[r+--t];t>0&&(u*=256);)o+=this[r+--t]*u;return u*=128,o>=u&&(o-=Math.pow(2,8*n)),o};h.prototype.readInt8=function(r,n){return n||y(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};h.prototype.readInt16LE=function(r,n){n||y(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||y(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||y(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||y(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||y(r,4,this.length),X(this,r,!0,23,4)};h.prototype.readFloatBE=function(r,n){return n||y(r,4,this.length),X(this,r,!1,23,4)};h.prototype.readDoubleLE=function(r,n){return n||y(r,8,this.length),X(this,r,!0,52,8)};h.prototype.readDoubleBE=function(r,n){return n||y(r,8,this.length),X(this,r,!1,52,8)};function g(i,r,n,e,t,u){if(!d(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>t||r<u)throw new RangeError('"value" argument is out of bounds');if(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 u=Math.pow(2,8*e)-1;g(this,r,n,e,u,0)}var o=1,f=0;for(this[n]=r&255;++f<e&&(o*=256);)this[n+f]=r/o&255;return n+e};h.prototype.writeUIntBE=function(r,n,e,t){if(r=+r,n=n|0,e=e|0,!t){var u=Math.pow(2,8*e)-1;g(this,r,n,e,u,0)}var o=e-1,f=1;for(this[n+o]=r&255;--o>=0&&(f*=256);)this[n+o]=r/f&255;return n+e};h.prototype.writeUInt8=function(r,n,e){return r=+r,n=n|0,e||g(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,u=Math.min(i.length-n,2);t<u;++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||g(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||g(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,u=Math.min(i.length-n,4);t<u;++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||g(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||g(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 u=Math.pow(2,8*e-1);g(this,r,n,e,u-1,-u)}var o=0,f=1,c=0;for(this[n]=r&255;++o<e&&(f*=256);)r<0&&c===0&&this[n+o-1]!==0&&(c=1),this[n+o]=(r/f>>0)-c&255;return n+e};h.prototype.writeIntBE=function(r,n,e,t){if(r=+r,n=n|0,!t){var u=Math.pow(2,8*e-1);g(this,r,n,e,u-1,-u)}var o=e-1,f=1,c=0;for(this[n+o]=r&255;--o>=0&&(f*=256);)r<0&&c===0&&this[n+o+1]!==0&&(c=1),this[n+o]=(r/f>>0)-c&255;return n+e};h.prototype.writeInt8=function(r,n,e){return r=+r,n=n|0,e||g(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||g(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||g(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||g(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||g(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,u){if(n+e>i.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function br(i,r,n,e,t){return t||zr(i,r,n,4),Yr(i,r,n,e,23,4),n+4}h.prototype.writeFloatLE=function(r,n,e){return br(this,r,n,!0,e)};h.prototype.writeFloatBE=function(r,n,e){return br(this,r,n,!1,e)};function Vr(i,r,n,e,t){return t||zr(i,r,n,8),Yr(i,r,n,e,52,8),n+8}h.prototype.writeDoubleLE=function(r,n,e){return Vr(this,r,n,!0,e)};h.prototype.writeDoubleBE=function(r,n,e){return Vr(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 u=t-e,o;if(this===r&&e<n&&n<t)for(o=u-1;o>=0;--o)r[o+n]=this[o+e];else if(u<1e3||!h.TYPED_ARRAY_SUPPORT)for(o=0;o<u;++o)r[o+n]=this[o+e];else Uint8Array.prototype.set.call(r,this.subarray(e,e+u),n);return u};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 u=r.charCodeAt(0);u<256&&(r=u)}if(t!==void 0&&typeof t!="string")throw new TypeError("encoding must be a string");if(typeof t=="string"&&!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 o;if(typeof r=="number")for(o=n;o<e;++o)this[o]=r;else{var f=d(r)?r:J(new h(r,t).toString()),c=f.length;for(o=0;o<e-n;++o)this[o+n]=f[o%c]}return this};var Ii=/[^+\/0-9A-Za-z-_]/g;function Ri(i){if(i=Ti(i).replace(Ii,""),i.length<2)return"";for(;i.length%4!==0;)i=i+"=";return i}function Ti(i){return i.trim?i.trim():i.replace(/^\s+|\s+$/g,"")}function _i(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,u=[],o=0;o<e;++o){if(n=i.charCodeAt(o),n>55295&&n<57344){if(!t){if(n>56319){(r-=3)>-1&&u.push(239,191,189);continue}else if(o+1===e){(r-=3)>-1&&u.push(239,191,189);continue}t=n;continue}if(n<56320){(r-=3)>-1&&u.push(239,191,189),t=n;continue}n=(t-55296<<10|n-56320)+65536}else t&&(r-=3)>-1&&u.push(239,191,189);if(t=null,n<128){if((r-=1)<0)break;u.push(n)}else if(n<2048){if((r-=2)<0)break;u.push(n>>6|192,n&63|128)}else if(n<65536){if((r-=3)<0)break;u.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((r-=4)<0)break;u.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return u}function di(i){for(var r=[],n=0;n<i.length;++n)r.push(i.charCodeAt(n)&255);return r}function Bi(i,r){for(var n,e,t,u=[],o=0;o<i.length&&!((r-=2)<0);++o)n=i.charCodeAt(o),e=n>>8,t=n%256,u.push(t),u.push(e);return u}function Hr(i){return ni(Ri(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 Fi(i){return i!==i}function vi(i){return i!=null&&(!!i._isBuffer||Or(i)||Pi(i))}function Or(i){return!!i.constructor&&typeof i.constructor.isBuffer=="function"&&i.constructor.isBuffer(i)}function Pi(i){return typeof i.readFloatLE=="function"&&typeof i.slice=="function"&&Or(i.slice(0,0))}import{encodeAddress as he,decodeAddress as ae}from"algosdk";function Jr(i){return i.reduce((r,n)=>Uint8Array.from([...r,...n]))}function Xi(i,r){let n=[];for(let[e,t]of Object.entries(r)){let u=i[e];if(u===void 0)throw new Error(`Key ${e} missing from value`);switch(t.type){case"address":if(u instanceof Uint8Array&&u.length==32){n.push(u);break}else if(typeof u=="string")n.push(Si(u).publicKey);else throw new Error(`${e}: Expected address, got ${u}`);break;case"bytes":if(u instanceof Uint8Array)if(u.length==t.size){n.push(u);break}else throw new Error(`${e}: Bytes length is wrong, expected ${t.size}, got ${u.length}`);else throw new Error(`${e}: Expected bytes[${t.size}], got ${u}`);case"double":if(typeof u=="number"){let o=new ArrayBuffer(8);h.from(o).writeDoubleLE(u,0),n.push(new Uint8Array(o));break}else throw new Error(`${e}: Expected double, got ${u}`);case"number":case"uint":if(typeof u=="bigint"||typeof u=="number"){n.push(Kr(u));break}else throw new Error(`${e}: Expected uint or number, got ${u}`);case"string":if(typeof u=="string"){let o=Xr(u);if(o.length==t.size){n.push(o);break}else throw new Error(`${e}: Expected string length ${t.size}, got string length ${o.length}`)}else throw new Error(`${e}: Expected string length ${t.size}, got ${u}`)}}return Jr(n)}function Ki(i,r){let n=new Map,e=0;for(let[t,u]of Object.entries(r)){if(e>=i.length)throw new Error("Array index out of bounds");let o;switch(u.type){case"address":o=Yi(i.slice(e,e+32)),e+=32;break;case"bytes":o=i.slice(e,e+u.size),e+=u.size;break;case"double":o=h.from(i.slice(e,e+8)).readDoubleLE(0),e+=8;break;case"number":o=Number(Gr(i.slice(e,e+8))),e+=8;break;case"uint":o=Gr(i.slice(e,e+8)),e+=8;break;case"string":o=ki(i.slice(e,e+u.size)),e+=u.size;break}n.set(t,o)}return Object.fromEntries(n)}function Qi(i){return i.map(r=>r instanceof Uint8Array?new Uint8Array(r):typeof r=="string"?Xr(r):(typeof r=="boolean"&&(r=BigInt(r?1:0)),typeof r=="number"&&(r=BigInt(r)),Kr(r)))}function Xr(i){return new Uint8Array(h.from(i))}function ki(i){return h.from(i).toString("utf-8")}function Zi(i){let r=Di.encodeUint64(i);return Jr([new Uint8Array(32-r.length),r])}function Kr(i){let r=h.alloc(8);for(let n=0;n<8;n++)r[7-n]=Number(BigInt(i)>>BigInt(n*8)&BigInt(255));return new Uint8Array(r)}function Gr(i){let r=BigInt(0);for(let n=0;n<8&&i?.length;n++)r=r<<BigInt(8)|BigInt(i[n]);return r}function qi(i){return h.from(i).toString("base64")}function Ci(i){return h.from(i,"base64")}function ji(i,r){return i.length===r.length&&i.reduce((n,e,t)=>n&&e===r[t],!0)}function Qr(i,r){let n=i["global-state-delta"].find(e=>e.key===r);if(n!==void 0)return n.value}function re(i,r){let n=Qr(i,r);if(n!==void 0)return BigInt(n.uint)}function ne(i,r){let n=Qr(i,r);if(n!==void 0)return Ci(n.bytes)}function ie(i){return Math.floor(i.getTime()/1e3)}function ee(i){return new Date(i*1e3)}export{ji as compareArrays,Jr as concatArrays,ae as decodeAddress,Ci as decodeBase64,ki as decodeString,Gr as decodeUint64,Zi as encode32Bytes,he as encodeAddress,Qi as encodeArgArray,qi as encodeBase64,Xr as encodeString,Kr as encodeUint64,ee as fromUnix,ne as getDeltaBytes,re as getDeltaUint,Xi as packData,ie as toUnix,Ki as unpackData};
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,17 @@
1
+ function fr(){throw new Error("setTimeout has not been defined")}function lr(){throw new Error("clearTimeout has not been defined")}var B=fr,P=lr;typeof globalThis.setTimeout=="function"&&(B=setTimeout);typeof globalThis.clearTimeout=="function"&&(P=clearTimeout);function pr(t){if(B===setTimeout)return setTimeout(t,0);if((B===fr||!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 jr(t){if(P===clearTimeout)return clearTimeout(t);if((P===lr||!P)&&clearTimeout)return P=clearTimeout,clearTimeout(t);try{return P(t)}catch{try{return P.call(null,t)}catch{return P.call(this,t)}}}var k=[],O=!1,v,L=-1;function re(){!O||!v||(O=!1,v.length?k=v.concat(k):L=-1,k.length&&hr())}function hr(){if(!O){var t=pr(re);O=!0;for(var r=k.length;r;){for(v=k,k=[];++L<r;)v&&v[L].run();L=-1,r=k.length}v=null,O=!1,jr(t)}}function ee(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];k.push(new mr(t,r)),k.length===1&&!O&&pr(hr)}function mr(t,r){this.fun=t,this.array=r}mr.prototype.run=function(){this.fun.apply(null,this.array)};var te="browser",ne="browser",ie=!0,oe={},ae=[],ue="",se={},ce={},fe={};function D(){}var le=D,pe=D,he=D,me=D,ge=D,xe=D,de=D;function be(t){throw new Error("process.binding is not supported")}function Ee(){return"/"}function we(t){throw new Error("process.chdir is not supported")}function Te(){return 0}var F=globalThis.performance||{},ye=F.now||F.mozNow||F.msNow||F.oNow||F.webkitNow||function(){return new Date().getTime()};function _e(t){var r=ye.call(F)*.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 Ae=new Date;function Ie(){var t=new Date,r=t-Ae;return r/1e3}var x={nextTick:ee,title:te,browser:ie,env:oe,argv:ae,version:ue,versions:se,on:le,addListener:pe,once:he,off:me,removeListener:ge,removeAllListeners:xe,emit:de,binding:be,cwd:Ee,chdir:we,umask:Te,hrtime:_e,platform:ne,release:ce,config:fe,uptime:Ie},cr={};Object.keys(cr).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]=cr[t]:e=e[i]||(e[i]={})}});var A=[],y=[],Re=typeof Uint8Array<"u"?Uint8Array:Array,er=!1;function br(){er=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)A[r]=t[r],y[t.charCodeAt(r)]=r;y[45]=62,y[95]=63}function Se(t){er||br();var r,e,n,i,o,a,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,a=new Re(s*3/4-o),n=o>0?s-4:s;var f=0;for(r=0,e=0;r<n;r+=4,e+=3)i=y[t.charCodeAt(r)]<<18|y[t.charCodeAt(r+1)]<<12|y[t.charCodeAt(r+2)]<<6|y[t.charCodeAt(r+3)],a[f++]=i>>16&255,a[f++]=i>>8&255,a[f++]=i&255;return o===2?(i=y[t.charCodeAt(r)]<<2|y[t.charCodeAt(r+1)]>>4,a[f++]=i&255):o===1&&(i=y[t.charCodeAt(r)]<<10|y[t.charCodeAt(r+1)]<<4|y[t.charCodeAt(r+2)]>>2,a[f++]=i>>8&255,a[f++]=i&255),a}function ke(t){return A[t>>18&63]+A[t>>12&63]+A[t>>6&63]+A[t&63]}function Ue(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(ke(n));return i.join("")}function gr(t){er||br();for(var r,e=t.length,n=e%3,i="",o=[],a=16383,s=0,f=e-n;s<f;s+=a)o.push(Ue(t,s,s+a>f?f:s+a));return n===1?(r=t[e-1],i+=A[r>>2],i+=A[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=A[r>>10],i+=A[r>>4&63],i+=A[r<<2&63],i+="="),o.push(i),o.join("")}u.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function Y(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function U(t,r){if(Y()<r)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=u.prototype):(t===null&&(t=new u(r)),t.length=r),t}function u(t,r,e){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u))return new u(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return tr(this,t)}return Er(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function Er(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Pe(t,r,e,n):typeof r=="string"?Be(t,r,e):ve(t,r)}u.from=function(t,r,e){return Er(null,t,r,e)};u.kMaxLength=Y();u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&u[Symbol.species]);function wr(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 Ne(t,r,e,n){return wr(r),r<=0?U(t,r):e!==void 0?typeof n=="string"?U(t,r).fill(e,n):U(t,r).fill(e):U(t,r)}u.alloc=function(t,r,e){return Ne(null,t,r,e)};function tr(t,r){if(wr(r),t=U(t,r<0?0:nr(r)|0),!u.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}u.allocUnsafe=function(t){return tr(null,t)};u.allocUnsafeSlow=function(t){return tr(null,t)};function Be(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!u.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=Tr(r,e)|0;t=U(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function rr(t,r){var e=r.length<0?0:nr(r.length)|0;t=U(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function Pe(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),u.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=u.prototype):t=rr(t,r),t}function ve(t,r){if(I(r)){var e=nr(r.length)|0;return t=U(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"||Ze(r.length)?U(t,0):rr(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return rr(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function nr(t){if(t>=Y())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Y().toString(16)+" bytes");return t|0}u.isBuffer=je;function I(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!I(r)||!I(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,i=e.length,o=0,a=Math.min(n,i);o<a;++o)if(r[o]!==e[o]){n=r[o],i=e[o];break}return n<i?-1:i<n?1:0};u.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};u.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return u.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var i=u.allocUnsafe(e),o=0;for(n=0;n<r.length;++n){var a=r[n];if(!I(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};function Tr(t,r){if(I(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 W(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return kr(t).length;default:if(n)return W(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=Tr;function De(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 Ve(this,r,e);case"utf8":case"utf-8":return Ar(this,r,e);case"ascii":return Ge(this,r,e);case"latin1":case"binary":return He(this,r,e);case"base64":return Ye(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ke(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function C(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}u.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)C(this,e,e+1);return this};u.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)C(this,e,e+3),C(this,e+1,e+2);return this};u.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)C(this,e,e+7),C(this,e+1,e+6),C(this,e+2,e+5),C(this,e+3,e+4);return this};u.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Ar(this,0,r):De.apply(this,arguments)};u.prototype.equals=function(r){if(!I(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:u.compare(this,r)===0};u.prototype.compare=function(r,e,n,i,o){if(!I(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||n>r.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=n)return 0;if(i>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,o>>>=0,this===r)return 0;for(var a=o-i,s=n-e,f=Math.min(a,s),p=this.slice(i,o),h=r.slice(e,n),l=0;l<f;++l)if(p[l]!==h[l]){a=p[l],s=h[l];break}return a<s?-1:s<a?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=u.from(r,n)),I(r))return r.length===0?-1:xr(t,r,e,n,i);if(typeof r=="number")return r=r&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):xr(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function xr(t,r,e,n,i){var o=1,a=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,a/=2,s/=2,e/=2}function f(m,T){return o===1?m[T]:m.readUInt16BE(T*o)}var p;if(i){var h=-1;for(p=e;p<a;p++)if(f(t,p)===f(r,h===-1?0:p-h)){if(h===-1&&(h=p),p-h+1===s)return h*o}else h!==-1&&(p-=p-h),h=-1}else for(e+s>a&&(e=a-s),p=e;p>=0;p--){for(var l=!0,g=0;g<s;g++)if(f(t,p+g)!==f(r,g)){l=!1;break}if(l)return p}return-1}u.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};u.prototype.indexOf=function(r,e,n){return yr(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return yr(this,r,e,n,!1)};function Ce(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(r.substr(a*2,2),16);if(isNaN(s))return a;t[e+a]=s}return a}function Me(t,r,e,n){return V(W(r,t.length-e),t,e,n)}function _r(t,r,e,n){return V(Xe(r),t,e,n)}function Fe(t,r,e,n){return _r(t,r,e,n)}function Oe(t,r,e,n){return V(kr(r),t,e,n)}function Le(t,r,e,n){return V(Qe(r,t.length-e),t,e,n)}u.prototype.write=function(r,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((n===void 0||n>o)&&(n=o),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return Ce(this,r,e,n);case"utf8":case"utf-8":return Me(this,r,e,n);case"ascii":return _r(this,r,e,n);case"latin1":case"binary":return Fe(this,r,e,n);case"base64":return Oe(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Le(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ye(t,r,e){return r===0&&e===t.length?gr(t):gr(t.slice(r,e))}function Ar(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o=t[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=e){var f,p,h,l;switch(s){case 1:o<128&&(a=o);break;case 2:f=t[i+1],(f&192)===128&&(l=(o&31)<<6|f&63,l>127&&(a=l));break;case 3:f=t[i+1],p=t[i+2],(f&192)===128&&(p&192)===128&&(l=(o&15)<<12|(f&63)<<6|p&63,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:f=t[i+1],p=t[i+2],h=t[i+3],(f&192)===128&&(p&192)===128&&(h&192)===128&&(l=(o&15)<<18|(f&63)<<12|(p&63)<<6|h&63,l>65535&&l<1114112&&(a=l))}}a===null?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=s}return We(n)}var dr=4096;function We(t){var r=t.length;if(r<=dr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=dr));return e}function Ge(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 He(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 Ve(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+=Je(t[o]);return i}function Ke(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}u.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var i;if(u.TYPED_ARRAY_SUPPORT)i=this.subarray(r,e),i.__proto__=u.prototype;else{var o=e-r;i=new u(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+r]}return i};function 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")}u.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,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return i};u.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||d(r,e,this.length);for(var i=this[r+--e],o=1;e>0&&(o*=256);)i+=this[r+--e]*o;return i};u.prototype.readUInt8=function(r,e){return e||d(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||d(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||d(r,2,this.length),this[r]<<8|this[r+1]};u.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};u.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])};u.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,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};u.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||d(r,e,this.length);for(var i=e,o=1,a=this[r+--i];i>0&&(o*=256);)a+=this[r+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*e)),a};u.prototype.readInt8=function(r,e){return e||d(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.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};u.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};u.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};u.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]};u.prototype.readFloatLE=function(r,e){return e||d(r,4,this.length),K(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||d(r,4,this.length),K(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||d(r,8,this.length),K(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||d(r,8,this.length),K(this,r,!1,52,8)};function E(t,r,e,n,i,o){if(!I(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}u.prototype.writeUIntLE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;E(this,r,e,n,o,0)}var a=1,s=0;for(this[e]=r&255;++s<n&&(a*=256);)this[e+s]=r/a&255;return e+n};u.prototype.writeUIntBE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;E(this,r,e,n,o,0)}var a=n-1,s=1;for(this[e+a]=r&255;--a>=0&&(s*=256);)this[e+a]=r/s&255;return e+n};u.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function G(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}u.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):G(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):G(this,r,e,!1),e+2};function H(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>(n?i:3-i)*8&255}u.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):H(this,r,e,!0),e+4};u.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):H(this,r,e,!1),e+4};u.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);E(this,r,e,n,o-1,-o)}var a=0,s=1,f=0;for(this[e]=r&255;++a<n&&(s*=256);)r<0&&f===0&&this[e+a-1]!==0&&(f=1),this[e+a]=(r/s>>0)-f&255;return e+n};u.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);E(this,r,e,n,o-1,-o)}var a=n-1,s=1,f=0;for(this[e+a]=r&255;--a>=0&&(s*=256);)r<0&&f===0&&this[e+a+1]!==0&&(f=1),this[e+a]=(r/s>>0)-f&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};u.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):G(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):G(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):H(this,r,e,!0),e+4};u.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):H(this,r,e,!1),e+4};function Ir(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 Rr(t,r,e,n,i){return i||Ir(t,r,e,4,34028234663852886e22,-34028234663852886e22),Nr(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return Rr(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return Rr(this,r,e,!1,n)};function Sr(t,r,e,n,i){return i||Ir(t,r,e,8,17976931348623157e292,-17976931348623157e292),Nr(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return Sr(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return Sr(this,r,e,!1,n)};u.prototype.copy=function(r,e,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),e>=r.length&&(e=r.length),e||(e=0),i>0&&i<n&&(i=n),i===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-e<i-n&&(i=r.length-e+n);var o=i-n,a;if(this===r&&n<e&&e<i)for(a=o-1;a>=0;--a)r[a+e]=this[a+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+o),e);return o};u.prototype.fill=function(r,e,n,i){if(typeof r=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var a;if(typeof r=="number")for(a=e;a<n;++a)this[a]=r;else{var s=I(r)?r:W(new u(r,i).toString()),f=s.length;for(a=0;a<n-e;++a)this[a+e]=s[a%f]}return this};var $e=/[^+\/0-9A-Za-z-_]/g;function ze(t){if(t=qe(t).replace($e,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function qe(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Je(t){return t<16?"0"+t.toString(16):t.toString(16)}function W(t,r){r=r||1/0;for(var e,n=t.length,i=null,o=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function Xe(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function Qe(t,r){for(var e,n,i,o=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function kr(t){return Se(ze(t))}function V(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 Ze(t){return t!==t}function je(t){return t!=null&&(!!t._isBuffer||Ur(t)||rt(t))}function Ur(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function rt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Ur(t.slice(0,0))}function K(t,r,e,n,i){var o,a,s=i*8-n-1,f=(1<<s)-1,p=f>>1,h=-7,l=e?i-1:0,g=e?-1:1,m=t[r+l];for(l+=g,o=m&(1<<-h)-1,m>>=-h,h+=s;h>0;o=o*256+t[r+l],l+=g,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=n;h>0;a=a*256+t[r+l],l+=g,h-=8);if(o===0)o=1-p;else{if(o===f)return a?NaN:(m?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-p}return(m?-1:1)*a*Math.pow(2,o-n)}function Nr(t,r,e,n,i,o){var a,s,f,p=o*8-i-1,h=(1<<p)-1,l=h>>1,g=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:o-1,T=n?1:-1,j=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,a=h):(a=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-a))<1&&(a--,f*=2),a+l>=1?r+=g/f:r+=g*Math.pow(2,1-l),r*f>=2&&(a++,f/=2),a+l>=h?(s=0,a=h):a+l>=1?(s=(r*f-1)*Math.pow(2,i),a=a+l):(s=r*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[e+m]=s&255,m+=T,s/=256,i-=8);for(a=a<<i|s,p+=i;p>0;t[e+m]=a&255,m+=T,a/=256,p-=8);t[e+m-T]|=j*128}import sr from"algosdk";import zt,{decodeAddress as qt,encodeAddress as Jt}from"algosdk";var R=[],_=[],et=typeof Uint8Array<"u"?Uint8Array:Array,or=!1;function Dr(){or=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)R[r]=t[r],_[t.charCodeAt(r)]=r;_[45]=62,_[95]=63}function tt(t){or||Dr();var r,e,n,i,o,a,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,a=new et(s*3/4-o),n=o>0?s-4:s;var f=0;for(r=0,e=0;r<n;r+=4,e+=3)i=_[t.charCodeAt(r)]<<18|_[t.charCodeAt(r+1)]<<12|_[t.charCodeAt(r+2)]<<6|_[t.charCodeAt(r+3)],a[f++]=i>>16&255,a[f++]=i>>8&255,a[f++]=i&255;return o===2?(i=_[t.charCodeAt(r)]<<2|_[t.charCodeAt(r+1)]>>4,a[f++]=i&255):o===1&&(i=_[t.charCodeAt(r)]<<10|_[t.charCodeAt(r+1)]<<4|_[t.charCodeAt(r+2)]>>2,a[f++]=i>>8&255,a[f++]=i&255),a}function nt(t){return R[t>>18&63]+R[t>>12&63]+R[t>>6&63]+R[t&63]}function it(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(nt(n));return i.join("")}function Br(t){or||Dr();for(var r,e=t.length,n=e%3,i="",o=[],a=16383,s=0,f=e-n;s<f;s+=a)o.push(it(t,s,s+a>f?f:s+a));return n===1?(r=t[e-1],i+=R[r>>2],i+=R[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=R[r>>10],i+=R[r>>4&63],i+=R[r<<2&63],i+="="),o.push(i),o.join("")}function q(t,r,e,n,i){var o,a,s=i*8-n-1,f=(1<<s)-1,p=f>>1,h=-7,l=e?i-1:0,g=e?-1:1,m=t[r+l];for(l+=g,o=m&(1<<-h)-1,m>>=-h,h+=s;h>0;o=o*256+t[r+l],l+=g,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=n;h>0;a=a*256+t[r+l],l+=g,h-=8);if(o===0)o=1-p;else{if(o===f)return a?NaN:(m?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-p}return(m?-1:1)*a*Math.pow(2,o-n)}function Cr(t,r,e,n,i,o){var a,s,f,p=o*8-i-1,h=(1<<p)-1,l=h>>1,g=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:o-1,T=n?1:-1,j=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,a=h):(a=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-a))<1&&(a--,f*=2),a+l>=1?r+=g/f:r+=g*Math.pow(2,1-l),r*f>=2&&(a++,f/=2),a+l>=h?(s=0,a=h):a+l>=1?(s=(r*f-1)*Math.pow(2,i),a=a+l):(s=r*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[e+m]=s&255,m+=T,s/=256,i-=8);for(a=a<<i|s,p+=i;p>0;t[e+m]=a&255,m+=T,a/=256,p-=8);t[e+m-T]|=j*128}var ot={}.toString,Mr=Array.isArray||function(t){return ot.call(t)=="[object Array]"};var at=50;c.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;var Gt=$();function $(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function N(t,r){if($()<r)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=c.prototype):(t===null&&(t=new c(r)),t.length=r),t}function c(t,r,e){if(!c.TYPED_ARRAY_SUPPORT&&!(this instanceof c))return new c(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 ar(this,t)}return Fr(this,t,r,e)}c.poolSize=8192;c._augment=function(t){return t.__proto__=c.prototype,t};function Fr(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"?st(t,r,e):ft(t,r)}c.from=function(t,r,e){return Fr(null,t,r,e)};c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array);function Or(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function ut(t,r,e,n){return Or(r),r<=0?N(t,r):e!==void 0?typeof n=="string"?N(t,r).fill(e,n):N(t,r).fill(e):N(t,r)}c.alloc=function(t,r,e){return ut(null,t,r,e)};function ar(t,r){if(Or(r),t=N(t,r<0?0:ur(r)|0),!c.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}c.allocUnsafe=function(t){return ar(null,t)};c.allocUnsafeSlow=function(t){return ar(null,t)};function st(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!c.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=Lr(r,e)|0;t=N(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function ir(t,r){var e=r.length<0?0:ur(r.length)|0;t=N(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),c.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=c.prototype):t=ir(t,r),t}function ft(t,r){if(S(r)){var e=ur(r.length)|0;return t=N(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"||Ut(r.length)?N(t,0):ir(t,r);if(r.type==="Buffer"&&Mr(r.data))return ir(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function ur(t){if(t>=$())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+$().toString(16)+" bytes");return t|0}c.isBuffer=Nt;function S(t){return!!(t!=null&&t._isBuffer)}c.compare=function(r,e){if(!S(r)||!S(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,i=e.length,o=0,a=Math.min(n,i);o<a;++o)if(r[o]!==e[o]){n=r[o],i=e[o];break}return n<i?-1:i<n?1:0};c.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}};c.concat=function(r,e){if(!Mr(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return c.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var i=c.allocUnsafe(e),o=0;for(n=0;n<r.length;++n){var a=r[n];if(!S(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};function Lr(t,r){if(S(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return $r(t).length;default:if(n)return z(t).length;r=(""+r).toLowerCase(),n=!0}}c.byteLength=Lr;function lt(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 Tt(this,r,e);case"utf8":case"utf-8":return Gr(this,r,e);case"ascii":return Et(this,r,e);case"latin1":case"binary":return wt(this,r,e);case"base64":return dt(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}}c.prototype._isBuffer=!0;function M(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}c.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};c.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};c.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};c.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Gr(this,0,r):lt.apply(this,arguments)};c.prototype.equals=function(r){if(!S(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:c.compare(this,r)===0};c.prototype.inspect=function(){var r="",e=at;return this.length>0&&(r=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(r+=" ... ")),"<Buffer "+r+">"};c.prototype.compare=function(r,e,n,i,o){if(!S(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||n>r.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=n)return 0;if(i>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,o>>>=0,this===r)return 0;for(var a=o-i,s=n-e,f=Math.min(a,s),p=this.slice(i,o),h=r.slice(e,n),l=0;l<f;++l)if(p[l]!==h[l]){a=p[l],s=h[l];break}return a<s?-1:s<a?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=c.from(r,n)),S(r))return r.length===0?-1:Pr(t,r,e,n,i);if(typeof r=="number")return r=r&255,c.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Pr(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function Pr(t,r,e,n,i){var o=1,a=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,a/=2,s/=2,e/=2}function f(m,T){return o===1?m[T]:m.readUInt16BE(T*o)}var p;if(i){var h=-1;for(p=e;p<a;p++)if(f(t,p)===f(r,h===-1?0:p-h)){if(h===-1&&(h=p),p-h+1===s)return h*o}else h!==-1&&(p-=p-h),h=-1}else for(e+s>a&&(e=a-s),p=e;p>=0;p--){for(var l=!0,g=0;g<s;g++)if(f(t,p+g)!==f(r,g)){l=!1;break}if(l)return p}return-1}c.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};c.prototype.indexOf=function(r,e,n){return Yr(this,r,e,n,!0)};c.prototype.lastIndexOf=function(r,e,n){return Yr(this,r,e,n,!1)};function pt(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(r.substr(a*2,2),16);if(isNaN(s))return a;t[e+a]=s}return a}function ht(t,r,e,n){return Q(z(r,t.length-e),t,e,n)}function Wr(t,r,e,n){return Q(St(r),t,e,n)}function mt(t,r,e,n){return Wr(t,r,e,n)}function gt(t,r,e,n){return Q($r(r),t,e,n)}function xt(t,r,e,n){return Q(kt(r,t.length-e),t,e,n)}c.prototype.write=function(r,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((n===void 0||n>o)&&(n=o),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return pt(this,r,e,n);case"utf8":case"utf-8":return ht(this,r,e,n);case"ascii":return Wr(this,r,e,n);case"latin1":case"binary":return mt(this,r,e,n);case"base64":return gt(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return xt(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function dt(t,r,e){return r===0&&e===t.length?Br(t):Br(t.slice(r,e))}function Gr(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o=t[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=e){var f,p,h,l;switch(s){case 1:o<128&&(a=o);break;case 2:f=t[i+1],(f&192)===128&&(l=(o&31)<<6|f&63,l>127&&(a=l));break;case 3:f=t[i+1],p=t[i+2],(f&192)===128&&(p&192)===128&&(l=(o&15)<<12|(f&63)<<6|p&63,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:f=t[i+1],p=t[i+2],h=t[i+3],(f&192)===128&&(p&192)===128&&(h&192)===128&&(l=(o&15)<<18|(f&63)<<12|(p&63)<<6|h&63,l>65535&&l<1114112&&(a=l))}}a===null?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=s}return bt(n)}var vr=4096;function bt(t){var r=t.length;if(r<=vr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=vr));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 wt(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 Tt(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+=Rt(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}c.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(c.TYPED_ARRAY_SUPPORT)i=this.subarray(r,e),i.__proto__=c.prototype;else{var o=e-r;i=new c(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+r]}return i};function b(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return i};c.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var i=this[r+--e],o=1;e>0&&(o*=256);)i+=this[r+--e]*o;return i};c.prototype.readUInt8=function(r,e){return e||b(r,1,this.length),this[r]};c.prototype.readUInt16LE=function(r,e){return e||b(r,2,this.length),this[r]|this[r+1]<<8};c.prototype.readUInt16BE=function(r,e){return e||b(r,2,this.length),this[r]<<8|this[r+1]};c.prototype.readUInt32LE=function(r,e){return e||b(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};c.prototype.readUInt32BE=function(r,e){return e||b(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};c.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};c.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var i=e,o=1,a=this[r+--i];i>0&&(o*=256);)a+=this[r+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*e)),a};c.prototype.readInt8=function(r,e){return e||b(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};c.prototype.readInt16LE=function(r,e){e||b(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};c.prototype.readInt16BE=function(r,e){e||b(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};c.prototype.readInt32LE=function(r,e){return e||b(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};c.prototype.readInt32BE=function(r,e){return e||b(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};c.prototype.readFloatLE=function(r,e){return e||b(r,4,this.length),q(this,r,!0,23,4)};c.prototype.readFloatBE=function(r,e){return e||b(r,4,this.length),q(this,r,!1,23,4)};c.prototype.readDoubleLE=function(r,e){return e||b(r,8,this.length),q(this,r,!0,52,8)};c.prototype.readDoubleBE=function(r,e){return e||b(r,8,this.length),q(this,r,!1,52,8)};function w(t,r,e,n,i,o){if(!S(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")}c.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;w(this,r,e,n,o,0)}var a=1,s=0;for(this[e]=r&255;++s<n&&(a*=256);)this[e+s]=r/a&255;return e+n};c.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;w(this,r,e,n,o,0)}var a=n-1,s=1;for(this[e+a]=r&255;--a>=0&&(s*=256);)this[e+a]=r/s&255;return e+n};c.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,1,255,0),c.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}c.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):J(this,r,e,!0),e+2};c.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):J(this,r,e,!1),e+2};function X(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}c.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):X(this,r,e,!0),e+4};c.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):X(this,r,e,!1),e+4};c.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);w(this,r,e,n,o-1,-o)}var a=0,s=1,f=0;for(this[e]=r&255;++a<n&&(s*=256);)r<0&&f===0&&this[e+a-1]!==0&&(f=1),this[e+a]=(r/s>>0)-f&255;return e+n};c.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);w(this,r,e,n,o-1,-o)}var a=n-1,s=1,f=0;for(this[e+a]=r&255;--a>=0&&(s*=256);)r<0&&f===0&&this[e+a+1]!==0&&(f=1),this[e+a]=(r/s>>0)-f&255;return e+n};c.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};c.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):J(this,r,e,!0),e+2};c.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):J(this,r,e,!1),e+2};c.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):X(this,r,e,!0),e+4};c.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),c.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):X(this,r,e,!1),e+4};function Hr(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 Vr(t,r,e,n,i){return i||Hr(t,r,e,4),Cr(t,r,e,n,23,4),e+4}c.prototype.writeFloatLE=function(r,e,n){return Vr(this,r,e,!0,n)};c.prototype.writeFloatBE=function(r,e,n){return Vr(this,r,e,!1,n)};function Kr(t,r,e,n,i){return i||Hr(t,r,e,8),Cr(t,r,e,n,52,8),e+8}c.prototype.writeDoubleLE=function(r,e,n){return Kr(this,r,e,!0,n)};c.prototype.writeDoubleBE=function(r,e,n){return Kr(this,r,e,!1,n)};c.prototype.copy=function(r,e,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),e>=r.length&&(e=r.length),e||(e=0),i>0&&i<n&&(i=n),i===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-e<i-n&&(i=r.length-e+n);var o=i-n,a;if(this===r&&n<e&&e<i)for(a=o-1;a>=0;--a)r[a+e]=this[a+n];else if(o<1e3||!c.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+o),e);return o};c.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"&&!c.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var a;if(typeof r=="number")for(a=e;a<n;++a)this[a]=r;else{var s=S(r)?r:z(new c(r,i).toString()),f=s.length;for(a=0;a<n-e;++a)this[a+e]=s[a%f]}return this};var _t=/[^+\/0-9A-Za-z-_]/g;function At(t){if(t=It(t).replace(_t,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function It(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Rt(t){return t<16?"0"+t.toString(16):t.toString(16)}function z(t,r){r=r||1/0;for(var e,n=t.length,i=null,o=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function St(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=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function $r(t){return tt(At(t))}function Q(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 Ut(t){return t!==t}function Nt(t){return t!=null&&(!!t._isBuffer||zr(t)||Bt(t))}function zr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Bt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&zr(t.slice(0,0))}import{encodeAddress as Xr,decodeAddress as en}from"algosdk";function qr(t){return t.reduce((r,e)=>Uint8Array.from([...r,...e]))}function Jr(t){return t.map(r=>r instanceof Uint8Array?new Uint8Array(r):typeof r=="string"?Pt(r):(typeof r=="boolean"&&(r=BigInt(r?1:0)),typeof r=="number"&&(r=BigInt(r)),vt(r)))}function Pt(t){return new Uint8Array(c.from(t))}function vt(t){let r=c.alloc(8);for(let e=0;e<8;e++)r[7-e]=Number(BigInt(t)>>BigInt(e*8)&BigInt(255));return new Uint8Array(r)}function Z(t){return c.from(t,"base64")}import Dt from"bignumber.js";Dt.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});var yn=`{"theme1":{"value":"${x.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${x.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${x.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var Qr={V1_1:"v1_1",V2:"v2"},Rn={[Qr.V1_1]:{testnet:62368684,mainnet:552635992},[Qr.V2]:{testnet:148607e3,mainnet:1002541853}};function Zr(t){return Object.keys(t).sort().reduce((r,e)=>({...r,[e]:t[e]}),{})}var li=(t,r)=>r.map(n=>({appIndex:t,name:qr(Jr(["WLP_",n]))}));function Ct(t){let r={};return t.forEach(e=>{let n=Z(e.key).toString(),i=e.value,o=i.type;o==2&&(i=i.uint),o==1&&(i=Z(i.bytes)),n=="gov"?r.gov=Xr(i):r[n]=i}),Zr(r)}var pi=t=>{let r={0:t.amount},e=t.assets;for(let n=0;n<e.length;n++){let i=e[n]["asset-id"],o=e[n].amount;r[i]=o}return console.log(`Account ${t.address} balances`,JSON.stringify(r)),r},hi=async(t,r)=>{let e=await t.getApplicationByID(r).do();return Ct(e.params["global-state"])},mi=async(t,r)=>{let{boxes:e}=await t.getApplicationBoxes(r).do();console.log("boxes",r,e.map(n=>n.name).filter(n=>n.length===32).map(n=>u.from(n).toString("base64")))},gi=async(t,r,e)=>{try{let{value:n}=await t.getApplicationBoxByName(r,e).do();return n}catch(n){if(n.message.includes("box not found"))return console.log(`Box not found '${u.from(e).toString("hex")}'`),null;throw n}},xi=async(t,r=1)=>{let e=await t.getTransactionParams().do();return r>1&&(e.fee=sr.ALGORAND_MIN_TX_FEE*r,e.flatFee=!0),{...e}},di=(t,r)=>Object.keys(t).includes(r.toString()),bi=t=>sr.decodeAddress(t.toUpperCase()).publicKey,Ei=(t,r,e,n)=>sr.verifyBytes(new Uint8Array(u.from(e,n)),Z(t),r);export{li as createBoxes,bi as decodeAndNormalizeAddress,Ct as decodeStateArray,pi as getAccountAssetBalances,mi as getAppBoxes,hi as getAppGlobalState,gi as getBoxByName,xi as getTxnParams,di as isAssetOptedIn,Ei as verifySignature};
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 J(){throw new Error("setTimeout has not been defined")}function $(){throw new Error("clearTimeout has not been defined")}var x=J,N=$;typeof globalThis.setTimeout=="function"&&(x=setTimeout);typeof globalThis.clearTimeout=="function"&&(N=clearTimeout);function Z(t){if(x===setTimeout)return setTimeout(t,0);if((x===J||!x)&&setTimeout)return x=setTimeout,setTimeout(t,0);try{return x(t,0)}catch{try{return x.call(null,t,0)}catch{return x.call(this,t,0)}}}function xr(t){if(N===clearTimeout)return clearTimeout(t);if((N===$||!N)&&clearTimeout)return N=clearTimeout,clearTimeout(t);try{return N(t)}catch{try{return N.call(null,t)}catch{return N.call(this,t)}}}var I=[],y=!1,O,U=-1;function Nr(){!y||!O||(y=!1,O.length?I=O.concat(I):U=-1,I.length&&j())}function j(){if(!y){var t=Z(Nr);y=!0;for(var r=I.length;r;){for(O=I,I=[];++U<r;)O&&O[U].run();U=-1,r=I.length}O=null,y=!1,xr(t)}}function Or(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];I.push(new rr(t,r)),I.length===1&&!y&&Z(j)}function rr(t,r){this.fun=t,this.array=r}rr.prototype.run=function(){this.fun.apply(null,this.array)};var wr="browser",Dr="browser",Cr=!0,Sr={},Lr=[],yr="",vr={},Pr={},Mr={};function w(){}var Ur=w,kr=w,Br=w,Yr=w,Fr=w,Gr=w,Hr=w;function Wr(t){throw new Error("process.binding is not supported")}function Kr(){return"/"}function Vr(t){throw new Error("process.chdir is not supported")}function Xr(){return 0}var L=globalThis.performance||{},qr=L.now||L.mozNow||L.msNow||L.oNow||L.webkitNow||function(){return new Date().getTime()};function zr(t){var r=qr.call(L)*.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 Qr=new Date;function Jr(){var t=new Date,r=t-Qr;return r/1e3}var c={nextTick:Or,title:wr,browser:Cr,env:Sr,argv:Lr,version:yr,versions:vr,on:Ur,addListener:kr,once:Br,off:Yr,removeListener:Fr,removeAllListeners:Gr,emit:Hr,binding:Wr,cwd:Kr,chdir:Vr,umask:Xr,hrtime:zr,platform:Dr,release:Pr,config:Mr,uptime:Jr},Q={};Object.keys(Q).forEach(t=>{let r=t.split("."),e=c;for(let n=0;n<r.length;n++){let i=r[n];n===r.length-1?e[i]=Q[t]:e=e[i]||(e[i]={})}});var g=[],b=[],$r=typeof Uint8Array<"u"?Uint8Array:Array,V=!1;function ir(){V=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)g[r]=t[r],b[t.charCodeAt(r)]=r;b[45]=62,b[95]=63}function Zr(t){V||ir();var r,e,n,i,a,s,p=t.length;if(p%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=t[p-2]==="="?2:t[p-1]==="="?1:0,s=new $r(p*3/4-a),n=a>0?p-4:p;var u=0;for(r=0,e=0;r<n;r+=4,e+=3)i=b[t.charCodeAt(r)]<<18|b[t.charCodeAt(r+1)]<<12|b[t.charCodeAt(r+2)]<<6|b[t.charCodeAt(r+3)],s[u++]=i>>16&255,s[u++]=i>>8&255,s[u++]=i&255;return a===2?(i=b[t.charCodeAt(r)]<<2|b[t.charCodeAt(r+1)]>>4,s[u++]=i&255):a===1&&(i=b[t.charCodeAt(r)]<<10|b[t.charCodeAt(r+1)]<<4|b[t.charCodeAt(r+2)]>>2,s[u++]=i>>8&255,s[u++]=i&255),s}function jr(t){return g[t>>18&63]+g[t>>12&63]+g[t>>6&63]+g[t&63]}function re(t,r,e){for(var n,i=[],a=r;a<e;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],i.push(jr(n));return i.join("")}function er(t){V||ir();for(var r,e=t.length,n=e%3,i="",a=[],s=16383,p=0,u=e-n;p<u;p+=s)a.push(re(t,p,p+s>u?u:p+s));return n===1?(r=t[e-1],i+=g[r>>2],i+=g[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=g[r>>10],i+=g[r>>4&63],i+=g[r<<2&63],i+="="),a.push(i),a.join("")}o.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function k(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function R(t,r){if(k()<r)throw new RangeError("Invalid typed array length");return o.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=o.prototype):(t===null&&(t=new o(r)),t.length=r),t}function o(t,r,e){if(!o.TYPED_ARRAY_SUPPORT&&!(this instanceof o))return new o(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 X(this,t)}return or(this,t,r,e)}o.poolSize=8192;o._augment=function(t){return t.__proto__=o.prototype,t};function or(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?ne(t,r,e,n):typeof r=="string"?te(t,r,e):ie(t,r)}o.from=function(t,r,e){return or(null,t,r,e)};o.kMaxLength=k();o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&o[Symbol.species]);function ar(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 ee(t,r,e,n){return ar(r),r<=0?R(t,r):e!==void 0?typeof n=="string"?R(t,r).fill(e,n):R(t,r).fill(e):R(t,r)}o.alloc=function(t,r,e){return ee(null,t,r,e)};function X(t,r){if(ar(r),t=R(t,r<0?0:q(r)|0),!o.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}o.allocUnsafe=function(t){return X(null,t)};o.allocUnsafeSlow=function(t){return X(null,t)};function te(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!o.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=sr(r,e)|0;t=R(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function K(t,r){var e=r.length<0?0:q(r.length)|0;t=R(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function ne(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),o.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=o.prototype):t=K(t,r),t}function ie(t,r){if(A(r)){var e=q(r.length)|0;return t=R(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"||Re(r.length)?R(t,0):K(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return K(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function q(t){if(t>=k())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+k().toString(16)+" bytes");return t|0}o.isBuffer=xe;function A(t){return!!(t!=null&&t._isBuffer)}o.compare=function(r,e){if(!A(r)||!A(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,i=e.length,a=0,s=Math.min(n,i);a<s;++a)if(r[a]!==e[a]){n=r[a],i=e[a];break}return n<i?-1:i<n?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,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return o.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var i=o.allocUnsafe(e),a=0;for(n=0;n<r.length;++n){var s=r[n];if(!A(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,a),a+=s.length}return i};function sr(t,r){if(A(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 B(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return mr(t).length;default:if(n)return B(t).length;r=(""+r).toLowerCase(),n=!0}}o.byteLength=sr;function oe(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 fe(this,r,e);case"utf8":case"utf-8":return cr(this,r,e);case"ascii":return he(this,r,e);case"latin1":case"binary":return me(this,r,e);case"base64":return le(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _e(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}o.prototype._isBuffer=!0;function D(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}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 e=0;e<r;e+=2)D(this,e,e+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 e=0;e<r;e+=4)D(this,e,e+3),D(this,e+1,e+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 e=0;e<r;e+=8)D(this,e,e+7),D(this,e+1,e+6),D(this,e+2,e+5),D(this,e+3,e+4);return this};o.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?cr(this,0,r):oe.apply(this,arguments)};o.prototype.equals=function(r){if(!A(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:o.compare(this,r)===0};o.prototype.compare=function(r,e,n,i,a){if(!A(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),a===void 0&&(a=this.length),e<0||n>r.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&e>=n)return 0;if(i>=a)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,a>>>=0,this===r)return 0;for(var s=a-i,p=n-e,u=Math.min(s,p),E=this.slice(i,a),h=r.slice(e,n),l=0;l<u;++l)if(E[l]!==h[l]){s=E[l],p=h[l];break}return s<p?-1:p<s?1:0};function pr(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=o.from(r,n)),A(r))return r.length===0?-1:tr(t,r,e,n,i);if(typeof r=="number")return r=r&255,o.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):tr(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function tr(t,r,e,n,i){var a=1,s=t.length,p=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;a=2,s/=2,p/=2,e/=2}function u(d,S){return a===1?d[S]:d.readUInt16BE(S*a)}var E;if(i){var h=-1;for(E=e;E<s;E++)if(u(t,E)===u(r,h===-1?0:E-h)){if(h===-1&&(h=E),E-h+1===p)return h*a}else h!==-1&&(E-=E-h),h=-1}else for(e+p>s&&(e=s-p),E=e;E>=0;E--){for(var l=!0,T=0;T<p;T++)if(u(t,E+T)!==u(r,T)){l=!1;break}if(l)return E}return-1}o.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};o.prototype.indexOf=function(r,e,n){return pr(this,r,e,n,!0)};o.prototype.lastIndexOf=function(r,e,n){return pr(this,r,e,n,!1)};function ae(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var a=r.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var s=0;s<n;++s){var p=parseInt(r.substr(s*2,2),16);if(isNaN(p))return s;t[e+s]=p}return s}function se(t,r,e,n){return G(B(r,t.length-e),t,e,n)}function ur(t,r,e,n){return G(Ae(r),t,e,n)}function pe(t,r,e,n){return ur(t,r,e,n)}function ue(t,r,e,n){return G(mr(r),t,e,n)}function ce(t,r,e,n){return G(Ie(r,t.length-e),t,e,n)}o.prototype.write=function(r,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-e;if((n===void 0||n>a)&&(n=a),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return ae(this,r,e,n);case"utf8":case"utf-8":return se(this,r,e,n);case"ascii":return ur(this,r,e,n);case"latin1":case"binary":return pe(this,r,e,n);case"base64":return ue(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ce(this,r,e,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}};o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function le(t,r,e){return r===0&&e===t.length?er(t):er(t.slice(r,e))}function cr(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var a=t[i],s=null,p=a>239?4:a>223?3:a>191?2:1;if(i+p<=e){var u,E,h,l;switch(p){case 1:a<128&&(s=a);break;case 2:u=t[i+1],(u&192)===128&&(l=(a&31)<<6|u&63,l>127&&(s=l));break;case 3:u=t[i+1],E=t[i+2],(u&192)===128&&(E&192)===128&&(l=(a&15)<<12|(u&63)<<6|E&63,l>2047&&(l<55296||l>57343)&&(s=l));break;case 4:u=t[i+1],E=t[i+2],h=t[i+3],(u&192)===128&&(E&192)===128&&(h&192)===128&&(l=(a&15)<<18|(u&63)<<12|(E&63)<<6|h&63,l>65535&&l<1114112&&(s=l))}}s===null?(s=65533,p=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=p}return Ee(n)}var nr=4096;function Ee(t){var r=t.length;if(r<=nr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=nr));return e}function he(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 me(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 fe(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",a=r;a<e;++a)i+=ge(t[a]);return i}function _e(t,r,e){for(var n=t.slice(r,e),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+n[a+1]*256);return i}o.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(o.TYPED_ARRAY_SUPPORT)i=this.subarray(r,e),i.__proto__=o.prototype;else{var a=e-r;i=new o(a,void 0);for(var s=0;s<a;++s)i[s]=this[s+r]}return i};function m(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=this[r],a=1,s=0;++s<e&&(a*=256);)i+=this[r+s]*a;return i};o.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=this[r+--e],a=1;e>0&&(a*=256);)i+=this[r+--e]*a;return i};o.prototype.readUInt8=function(r,e){return e||m(r,1,this.length),this[r]};o.prototype.readUInt16LE=function(r,e){return e||m(r,2,this.length),this[r]|this[r+1]<<8};o.prototype.readUInt16BE=function(r,e){return e||m(r,2,this.length),this[r]<<8|this[r+1]};o.prototype.readUInt32LE=function(r,e){return e||m(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};o.prototype.readUInt32BE=function(r,e){return e||m(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};o.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=this[r],a=1,s=0;++s<e&&(a*=256);)i+=this[r+s]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*e)),i};o.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=e,a=1,s=this[r+--i];i>0&&(a*=256);)s+=this[r+--i]*a;return a*=128,s>=a&&(s-=Math.pow(2,8*e)),s};o.prototype.readInt8=function(r,e){return e||m(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};o.prototype.readInt16LE=function(r,e){e||m(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};o.prototype.readInt16BE=function(r,e){e||m(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};o.prototype.readInt32LE=function(r,e){return e||m(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};o.prototype.readInt32BE=function(r,e){return e||m(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};o.prototype.readFloatLE=function(r,e){return e||m(r,4,this.length),H(this,r,!0,23,4)};o.prototype.readFloatBE=function(r,e){return e||m(r,4,this.length),H(this,r,!1,23,4)};o.prototype.readDoubleLE=function(r,e){return e||m(r,8,this.length),H(this,r,!0,52,8)};o.prototype.readDoubleBE=function(r,e){return e||m(r,8,this.length),H(this,r,!1,52,8)};function _(t,r,e,n,i,a){if(!A(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<a)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}o.prototype.writeUIntLE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;_(this,r,e,n,a,0)}var s=1,p=0;for(this[e]=r&255;++p<n&&(s*=256);)this[e+p]=r/s&255;return e+n};o.prototype.writeUIntBE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;_(this,r,e,n,a,0)}var s=n-1,p=1;for(this[e+s]=r&255;--s>=0&&(p*=256);)this[e+s]=r/p&255;return e+n};o.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||_(this,r,e,1,255,0),o.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function Y(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,a=Math.min(t.length-e,2);i<a;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}o.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||_(this,r,e,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):Y(this,r,e,!0),e+2};o.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||_(this,r,e,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):Y(this,r,e,!1),e+2};function F(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,a=Math.min(t.length-e,4);i<a;++i)t[e+i]=r>>>(n?i:3-i)*8&255}o.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||_(this,r,e,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):F(this,r,e,!0),e+4};o.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||_(this,r,e,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):F(this,r,e,!1),e+4};o.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e|0,!i){var a=Math.pow(2,8*n-1);_(this,r,e,n,a-1,-a)}var s=0,p=1,u=0;for(this[e]=r&255;++s<n&&(p*=256);)r<0&&u===0&&this[e+s-1]!==0&&(u=1),this[e+s]=(r/p>>0)-u&255;return e+n};o.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e|0,!i){var a=Math.pow(2,8*n-1);_(this,r,e,n,a-1,-a)}var s=n-1,p=1,u=0;for(this[e+s]=r&255;--s>=0&&(p*=256);)r<0&&u===0&&this[e+s+1]!==0&&(u=1),this[e+s]=(r/p>>0)-u&255;return e+n};o.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||_(this,r,e,1,127,-128),o.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};o.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||_(this,r,e,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):Y(this,r,e,!0),e+2};o.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||_(this,r,e,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):Y(this,r,e,!1),e+2};o.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||_(this,r,e,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):F(this,r,e,!0),e+4};o.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||_(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),o.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):F(this,r,e,!1),e+4};function lr(t,r,e,n,i,a){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Er(t,r,e,n,i){return i||lr(t,r,e,4,34028234663852886e22,-34028234663852886e22),_r(t,r,e,n,23,4),e+4}o.prototype.writeFloatLE=function(r,e,n){return Er(this,r,e,!0,n)};o.prototype.writeFloatBE=function(r,e,n){return Er(this,r,e,!1,n)};function hr(t,r,e,n,i){return i||lr(t,r,e,8,17976931348623157e292,-17976931348623157e292),_r(t,r,e,n,52,8),e+8}o.prototype.writeDoubleLE=function(r,e,n){return hr(this,r,e,!0,n)};o.prototype.writeDoubleBE=function(r,e,n){return hr(this,r,e,!1,n)};o.prototype.copy=function(r,e,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),e>=r.length&&(e=r.length),e||(e=0),i>0&&i<n&&(i=n),i===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-e<i-n&&(i=r.length-e+n);var a=i-n,s;if(this===r&&n<e&&e<i)for(s=a-1;s>=0;--s)r[s+e]=this[s+n];else if(a<1e3||!o.TYPED_ARRAY_SUPPORT)for(s=0;s<a;++s)r[s+e]=this[s+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+a),e);return a};o.prototype.fill=function(r,e,n,i){if(typeof r=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),r.length===1){var a=r.charCodeAt(0);a<256&&(r=a)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!o.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 s;if(typeof r=="number")for(s=e;s<n;++s)this[s]=r;else{var p=A(r)?r:B(new o(r,i).toString()),u=p.length;for(s=0;s<n-e;++s)this[s+e]=p[s%u]}return this};var de=/[^+\/0-9A-Za-z-_]/g;function be(t){if(t=Te(t).replace(de,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Te(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function ge(t){return t<16?"0"+t.toString(16):t.toString(16)}function B(t,r){r=r||1/0;for(var e,n=t.length,i=null,a=[],s=0;s<n;++s){if(e=t.charCodeAt(s),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&a.push(239,191,189);continue}else if(s+1===n){(r-=3)>-1&&a.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&a.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&a.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;a.push(e)}else if(e<2048){if((r-=2)<0)break;a.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;a.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;a.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return a}function Ae(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function Ie(t,r){for(var e,n,i,a=[],s=0;s<t.length&&!((r-=2)<0);++s)e=t.charCodeAt(s),n=e>>8,i=e%256,a.push(i),a.push(n);return a}function mr(t){return Zr(be(t))}function G(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 Re(t){return t!==t}function xe(t){return t!=null&&(!!t._isBuffer||fr(t)||Ne(t))}function fr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Ne(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&fr(t.slice(0,0))}function H(t,r,e,n,i){var a,s,p=i*8-n-1,u=(1<<p)-1,E=u>>1,h=-7,l=e?i-1:0,T=e?-1:1,d=t[r+l];for(l+=T,a=d&(1<<-h)-1,d>>=-h,h+=p;h>0;a=a*256+t[r+l],l+=T,h-=8);for(s=a&(1<<-h)-1,a>>=-h,h+=n;h>0;s=s*256+t[r+l],l+=T,h-=8);if(a===0)a=1-E;else{if(a===u)return s?NaN:(d?-1:1)*(1/0);s=s+Math.pow(2,n),a=a-E}return(d?-1:1)*s*Math.pow(2,a-n)}function _r(t,r,e,n,i,a){var s,p,u,E=a*8-i-1,h=(1<<E)-1,l=h>>1,T=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,S=n?1:-1,Rr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(p=isNaN(r)?1:0,s=h):(s=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+l>=1?r+=T/u:r+=T*Math.pow(2,1-l),r*u>=2&&(s++,u/=2),s+l>=h?(p=0,s=h):s+l>=1?(p=(r*u-1)*Math.pow(2,i),s=s+l):(p=r*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;t[e+d]=p&255,d+=S,p/=256,i-=8);for(s=s<<i|p,E+=i;E>0;t[e+d]=s&255,d+=S,s/=256,E-=8);t[e+d-S]|=Rr*128}import z from"bignumber.js";z.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});function dr(t,r){return M(t,r,"*")}function W(t,r){return!!M(t,r,">=")}function v(t,r){return!!M(t,r,">")}function C(t,r){return!!M(t,r,"==")}function Oe(t,r){return M(t,r,"mod")}function P(t,r){return C(Oe(t,r),0)}function M(t,r,e){switch(t=new z(String(t)),r=new z(String(r)),e.toLowerCase()){case"-":return t.minus(r).toString();case"+":return t.plus(r).toString();case"*":case"x":return t.multipliedBy(r).toString();case"\xF7":case"/":return t.dividedBy(r).toString();case">=":return t.isGreaterThanOrEqualTo(r);case">":return t.isGreaterThan(r);case"<=":return t.isLessThanOrEqualTo(r);case"<":return t.isLessThan(r);case"==":return t.isEqualTo(r);case"mod":return t.modulo(r);default:break}}var br=(t,r)=>String(t).toLowerCase()===String(r).toLowerCase();var Ze={SMALLESTUNIT:c.env.SMALLEST_UNIT},je={SMALLEST_UNITS:c.env.SMALLEST_UNIT};var nt=`{"theme1":{"value":"${c.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${c.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${c.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var ut=["point-system.discordEnabled","point-system.telegramBotName","point-system.telegramBotId","point-system.telegramEnabled","point-system.telegramGroupId","point-system.telegramGroupName","point-system.twitterAccountId","point-system.twitterAccountName","point-system.twitterEnabled","point-system.twitterJobEnabled","point-system.guideLink"];var Tr=(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))(Tr||{}),gr=(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))(gr||{}),Cn={...Tr,...gr};var Ui=(t,r)=>{Ir("base",{address:String(t.baseTokenAddress),chainId:t.baseTokenChainId},r.baseAsset),Ir("price",{address:String(t.priceTokenAddress),chainId:t.priceTokenChainId},r.priceAsset),Ce(t,r)},Ir=(t,r,e)=>{f(Number(r.chainId)===Number(e.chainId),`Invalid ${t}TokenChainId, must be ${e.chainId}`),f(e.chainId===1&&String(r.address)===String(e.address)||e.chainId===8&&Number(r.address)===Number(e.address)||br(r.address,e.address),`Invalid ${t}TokenAddress, must be ${e.address}`)},ki=t=>{f(t.expiredTime>=Math.floor(Date.now()/1e3)+3600,"Expiration time shorter than 1 hour")},Ce=(t,r)=>{if(f(C(1,t.version),`Invalid order message version. Current is ${1}`),f(C(t.decimalPrice,0)||C(dr(t.decimalPrice,10**18),t.price),"Invalid price or decimalPrice"),f(!isNaN(t.random),"Invalid random, must be a number"),f(t.random>0,"Invalid random, must be greater than 0"),f(t.random<=Number.MAX_SAFE_INTEGER,"Invalid random, must no more than 2^53-1"),f(t.expiredTime>=Math.floor(Date.now()/1e3),"Invalid expiration time"),f(["B","S"].includes(t.orderSide),"Invalid order side"),f(["L","P","I","M"].includes(t.orderType),"Invalid order type"),t.orderType==="M"&&t.orderSide==="S")f(C(t.price,0)&&v(t.amount,0),"Invalid market order amount or price"),f(P(t.amount,r.min_size_increment)&&W(t.amount,r.min_order_size),"Invalid market order amount");else{if(t.orderType==="M"&&t.orderSide==="B"&&C(t.amount,0))throw new Error("Buy murket order by total is not implemented yet");t.orderType==="M"&&t.orderSide==="B"&&v(t.amount,0)?f(v(t.price,0)&&P(t.amount,r.min_size_increment)&&W(t.amount,r.min_order_size),"Invalid buy market order by amount"):(f(v(t.price,0)&&v(t.amount,0),"Invalid order amount or price is zero"),f(P(t.amount,r.min_size_increment)&&W(t.amount,r.min_order_size)&&P(t.price,r.min_price_increment),"Invalid order amount or price"))}},f=(t,r)=>{if(!t)throw new Error(r)};export{Ce as assertOrder,Ui as assertOrderData,ki as assertOrderExpirationAtCreationMoment};
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
+ */