/*! For license information please see 0xcert-wanchain-http-provider.min.js.LICENSE.txt */
(()=>{var t={1303:function(t,e,r){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(2574).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var i=a(t,r);return r-1>=e&&(i|=a(t,r-1)<<4),i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;n*=i,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<t.length&&(16===e?this._parseHex(t,n,r):(this._parseBase(t,e,n),"le"===r&&this._initArray(this.toArray(),e,r)))},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===r)for(n=t.length-1,o=0;n>=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n<t.length;n+=3)s=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o=0,s=0;if("be"===r)for(i=t.length-1;i>=e;i-=2)n=u(t,e,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(t.length-e)%2==0?e+1:e;i<t.length;i+=2)n=u(t,e,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,l=r;l<a;l+=i)u=h(t,l,l+i,e),this.imuln(n),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var d=1;for(u=h(t,l,t.length,e),l=0;l<s;l++)d*=e;this.imuln(d),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<i;h++){for(var l=u>>>26,d=67108863&u,c=Math.min(h,e.length-1),f=Math.max(0,h-t.length+1);f<=c;f++){var p=h-f|0;l+=(s=(n=0|t.words[p])*(o=0|e.words[f])+d)/67108864|0,d=67108863&s}r.words[h]=0|d,u=0|l}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<n|o)).toString(16);r=0!=(o=a>>>24-n&16777215)||s!==this.length-1?l[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=d[t],f=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var _=p.modn(f).toString(t);r=(p=p.idivn(f)).isZero()?_+r:l[h-_.length]+_+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),l=this.clone();if(u){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-n;a++)h[a]=0;for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),h[o-a-1]=s}return h},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return i(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return i(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;i<r.length;i++)this.words[i]=e.words[i]^r.words[i];if(this!==e)for(;i<e.length;i++)this.words[i]=e.words[i];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return i(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<n:this.words[r]&~(1<<n),this.strip()},o.prototype.iadd=function(t){var e,r,i;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o<i.length;o++)e=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&e,n=e>>>26;for(;0!==n&&o<r.length;o++)e=(0|r.words[o])+n,this.words[o]=67108863&e,n=e>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s<i.length;s++)o=(e=(0|r.words[s])-(0|i.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,r){var i,n,o,s=t.words,a=e.words,u=r.words,h=0,l=0|s[0],d=8191&l,c=l>>>13,f=0|s[1],p=8191&f,_=f>>>13,v=0|s[2],E=8191&v,m=v>>>13,g=0|s[3],A=8191&g,y=g>>>13,M=0|s[4],N=8191&M,T=M>>>13,w=0|s[5],R=8191&w,O=w>>>13,I=0|s[6],b=8191&I,S=I>>>13,P=0|s[7],D=8191&P,L=P>>>13,C=0|s[8],x=8191&C,U=C>>>13,G=0|s[9],k=8191&G,B=G>>>13,j=0|a[0],F=8191&j,Y=j>>>13,V=0|a[1],W=8191&V,K=V>>>13,X=0|a[2],Z=8191&X,H=X>>>13,z=0|a[3],q=8191&z,$=z>>>13,J=0|a[4],Q=8191&J,tt=J>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,lt=0|a[8],dt=8191&lt,ct=lt>>>13,ft=0|a[9],pt=8191&ft,_t=ft>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(i=Math.imul(d,F))|0)+((8191&(n=(n=Math.imul(d,Y))+Math.imul(c,F)|0))<<13)|0;h=((o=Math.imul(c,Y))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,Y))+Math.imul(_,F)|0,o=Math.imul(_,Y);var Et=(h+(i=i+Math.imul(d,W)|0)|0)+((8191&(n=(n=n+Math.imul(d,K)|0)+Math.imul(c,W)|0))<<13)|0;h=((o=o+Math.imul(c,K)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(E,F),n=(n=Math.imul(E,Y))+Math.imul(m,F)|0,o=Math.imul(m,Y),i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,K)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,K)|0;var mt=(h+(i=i+Math.imul(d,Z)|0)|0)+((8191&(n=(n=n+Math.imul(d,H)|0)+Math.imul(c,Z)|0))<<13)|0;h=((o=o+Math.imul(c,H)|0)+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,Y))+Math.imul(y,F)|0,o=Math.imul(y,Y),i=i+Math.imul(E,W)|0,n=(n=n+Math.imul(E,K)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,K)|0,i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,H)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,H)|0;var gt=(h+(i=i+Math.imul(d,q)|0)|0)+((8191&(n=(n=n+Math.imul(d,$)|0)+Math.imul(c,q)|0))<<13)|0;h=((o=o+Math.imul(c,$)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,Y))+Math.imul(T,F)|0,o=Math.imul(T,Y),i=i+Math.imul(A,W)|0,n=(n=n+Math.imul(A,K)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,K)|0,i=i+Math.imul(E,Z)|0,n=(n=n+Math.imul(E,H)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,H)|0,i=i+Math.imul(p,q)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,$)|0;var At=(h+(i=i+Math.imul(d,Q)|0)|0)+((8191&(n=(n=n+Math.imul(d,tt)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(R,F),n=(n=Math.imul(R,Y))+Math.imul(O,F)|0,o=Math.imul(O,Y),i=i+Math.imul(N,W)|0,n=(n=n+Math.imul(N,K)|0)+Math.imul(T,W)|0,o=o+Math.imul(T,K)|0,i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,H)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,H)|0,i=i+Math.imul(E,q)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,$)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0;var yt=(h+(i=i+Math.imul(d,rt)|0)|0)+((8191&(n=(n=n+Math.imul(d,it)|0)+Math.imul(c,rt)|0))<<13)|0;h=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(b,F),n=(n=Math.imul(b,Y))+Math.imul(S,F)|0,o=Math.imul(S,Y),i=i+Math.imul(R,W)|0,n=(n=n+Math.imul(R,K)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,K)|0,i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,H)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,H)|0,i=i+Math.imul(A,q)|0,n=(n=n+Math.imul(A,$)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,$)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,it)|0;var Mt=(h+(i=i+Math.imul(d,ot)|0)|0)+((8191&(n=(n=n+Math.imul(d,st)|0)+Math.imul(c,ot)|0))<<13)|0;h=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(D,F),n=(n=Math.imul(D,Y))+Math.imul(L,F)|0,o=Math.imul(L,Y),i=i+Math.imul(b,W)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,K)|0,i=i+Math.imul(R,Z)|0,n=(n=n+Math.imul(R,H)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,H)|0,i=i+Math.imul(N,q)|0,n=(n=n+Math.imul(N,$)|0)+Math.imul(T,q)|0,o=o+Math.imul(T,$)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0;var Nt=(h+(i=i+Math.imul(d,ut)|0)|0)+((8191&(n=(n=n+Math.imul(d,ht)|0)+Math.imul(c,ut)|0))<<13)|0;h=((o=o+Math.imul(c,ht)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,i=Math.imul(x,F),n=(n=Math.imul(x,Y))+Math.imul(U,F)|0,o=Math.imul(U,Y),i=i+Math.imul(D,W)|0,n=(n=n+Math.imul(D,K)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,K)|0,i=i+Math.imul(b,Z)|0,n=(n=n+Math.imul(b,H)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,H)|0,i=i+Math.imul(R,q)|0,n=(n=n+Math.imul(R,$)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,$)|0,i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0,i=i+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0;var Tt=(h+(i=i+Math.imul(d,dt)|0)|0)+((8191&(n=(n=n+Math.imul(d,ct)|0)+Math.imul(c,dt)|0))<<13)|0;h=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(k,F),n=(n=Math.imul(k,Y))+Math.imul(B,F)|0,o=Math.imul(B,Y),i=i+Math.imul(x,W)|0,n=(n=n+Math.imul(x,K)|0)+Math.imul(U,W)|0,o=o+Math.imul(U,K)|0,i=i+Math.imul(D,Z)|0,n=(n=n+Math.imul(D,H)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,H)|0,i=i+Math.imul(b,q)|0,n=(n=n+Math.imul(b,$)|0)+Math.imul(S,q)|0,o=o+Math.imul(S,$)|0,i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,tt)|0,i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(E,ut)|0,n=(n=n+Math.imul(E,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0,i=i+Math.imul(p,dt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(_,dt)|0,o=o+Math.imul(_,ct)|0;var wt=(h+(i=i+Math.imul(d,pt)|0)|0)+((8191&(n=(n=n+Math.imul(d,_t)|0)+Math.imul(c,pt)|0))<<13)|0;h=((o=o+Math.imul(c,_t)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(k,W),n=(n=Math.imul(k,K))+Math.imul(B,W)|0,o=Math.imul(B,K),i=i+Math.imul(x,Z)|0,n=(n=n+Math.imul(x,H)|0)+Math.imul(U,Z)|0,o=o+Math.imul(U,H)|0,i=i+Math.imul(D,q)|0,n=(n=n+Math.imul(D,$)|0)+Math.imul(L,q)|0,o=o+Math.imul(L,$)|0,i=i+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,i=i+Math.imul(R,rt)|0,n=(n=n+Math.imul(R,it)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,it)|0,i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,i=i+Math.imul(A,ut)|0,n=(n=n+Math.imul(A,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0,i=i+Math.imul(E,dt)|0,n=(n=n+Math.imul(E,ct)|0)+Math.imul(m,dt)|0,o=o+Math.imul(m,ct)|0;var Rt=(h+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,_t)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,_t)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(k,Z),n=(n=Math.imul(k,H))+Math.imul(B,Z)|0,o=Math.imul(B,H),i=i+Math.imul(x,q)|0,n=(n=n+Math.imul(x,$)|0)+Math.imul(U,q)|0,o=o+Math.imul(U,$)|0,i=i+Math.imul(D,Q)|0,n=(n=n+Math.imul(D,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,i=i+Math.imul(b,rt)|0,n=(n=n+Math.imul(b,it)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,it)|0,i=i+Math.imul(R,ot)|0,n=(n=n+Math.imul(R,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,i=i+Math.imul(N,ut)|0,n=(n=n+Math.imul(N,ht)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ht)|0,i=i+Math.imul(A,dt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(y,dt)|0,o=o+Math.imul(y,ct)|0;var Ot=(h+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,_t)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,_t)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(k,q),n=(n=Math.imul(k,$))+Math.imul(B,q)|0,o=Math.imul(B,$),i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(U,Q)|0,o=o+Math.imul(U,tt)|0,i=i+Math.imul(D,rt)|0,n=(n=n+Math.imul(D,it)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,it)|0,i=i+Math.imul(b,ot)|0,n=(n=n+Math.imul(b,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,i=i+Math.imul(R,ut)|0,n=(n=n+Math.imul(R,ht)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ht)|0,i=i+Math.imul(N,dt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(T,dt)|0,o=o+Math.imul(T,ct)|0;var It=(h+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,_t)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,_t)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(k,Q),n=(n=Math.imul(k,tt))+Math.imul(B,Q)|0,o=Math.imul(B,tt),i=i+Math.imul(x,rt)|0,n=(n=n+Math.imul(x,it)|0)+Math.imul(U,rt)|0,o=o+Math.imul(U,it)|0,i=i+Math.imul(D,ot)|0,n=(n=n+Math.imul(D,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,i=i+Math.imul(b,ut)|0,n=(n=n+Math.imul(b,ht)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ht)|0,i=i+Math.imul(R,dt)|0,n=(n=n+Math.imul(R,ct)|0)+Math.imul(O,dt)|0,o=o+Math.imul(O,ct)|0;var bt=(h+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,_t)|0)+Math.imul(T,pt)|0))<<13)|0;h=((o=o+Math.imul(T,_t)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(k,rt),n=(n=Math.imul(k,it))+Math.imul(B,rt)|0,o=Math.imul(B,it),i=i+Math.imul(x,ot)|0,n=(n=n+Math.imul(x,st)|0)+Math.imul(U,ot)|0,o=o+Math.imul(U,st)|0,i=i+Math.imul(D,ut)|0,n=(n=n+Math.imul(D,ht)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ht)|0,i=i+Math.imul(b,dt)|0,n=(n=n+Math.imul(b,ct)|0)+Math.imul(S,dt)|0,o=o+Math.imul(S,ct)|0;var St=(h+(i=i+Math.imul(R,pt)|0)|0)+((8191&(n=(n=n+Math.imul(R,_t)|0)+Math.imul(O,pt)|0))<<13)|0;h=((o=o+Math.imul(O,_t)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(k,ot),n=(n=Math.imul(k,st))+Math.imul(B,ot)|0,o=Math.imul(B,st),i=i+Math.imul(x,ut)|0,n=(n=n+Math.imul(x,ht)|0)+Math.imul(U,ut)|0,o=o+Math.imul(U,ht)|0,i=i+Math.imul(D,dt)|0,n=(n=n+Math.imul(D,ct)|0)+Math.imul(L,dt)|0,o=o+Math.imul(L,ct)|0;var Pt=(h+(i=i+Math.imul(b,pt)|0)|0)+((8191&(n=(n=n+Math.imul(b,_t)|0)+Math.imul(S,pt)|0))<<13)|0;h=((o=o+Math.imul(S,_t)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(k,ut),n=(n=Math.imul(k,ht))+Math.imul(B,ut)|0,o=Math.imul(B,ht),i=i+Math.imul(x,dt)|0,n=(n=n+Math.imul(x,ct)|0)+Math.imul(U,dt)|0,o=o+Math.imul(U,ct)|0;var Dt=(h+(i=i+Math.imul(D,pt)|0)|0)+((8191&(n=(n=n+Math.imul(D,_t)|0)+Math.imul(L,pt)|0))<<13)|0;h=((o=o+Math.imul(L,_t)|0)+(n>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,i=Math.imul(k,dt),n=(n=Math.imul(k,ct))+Math.imul(B,dt)|0,o=Math.imul(B,ct);var Lt=(h+(i=i+Math.imul(x,pt)|0)|0)+((8191&(n=(n=n+Math.imul(x,_t)|0)+Math.imul(U,pt)|0))<<13)|0;h=((o=o+Math.imul(U,_t)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var Ct=(h+(i=Math.imul(k,pt))|0)+((8191&(n=(n=Math.imul(k,_t))+Math.imul(B,pt)|0))<<13)|0;return h=((o=Math.imul(B,_t))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,u[0]=vt,u[1]=Et,u[2]=mt,u[3]=gt,u[4]=At,u[5]=yt,u[6]=Mt,u[7]=Nt,u[8]=Tt,u[9]=wt,u[10]=Rt,u[11]=Ot,u[12]=It,u[13]=bt,u[14]=St,u[15]=Pt,u[16]=Dt,u[17]=Lt,u[18]=Ct,0!==h&&(u[19]=h,r.length++),r};function _(t,e,r){return(new v).mulp(t,e,r)}function v(t,e){this.x=t,this.y=e}Math.imul||(p=f),o.prototype.mulTo=function(t,e){var r,i=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):i<63?f(this,t,e):i<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var l=o-h,d=(0|t.words[l])*(0|e.words[h]),c=67108863&d;a=67108863&(c=c+a|0),n+=(s=(s=s+(d/67108864|0)|0)+(c>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):_(this,t,e),r},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i<t;i++)e[i]=this.revBin(i,r,t);return e},v.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var i=0,n=0;n<e;n++)i|=(1&t)<<e-n-1,t>>=1;return i},v.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s<o;s++)i[s]=e[t[s]],n[s]=r[t[s]]},v.prototype.transform=function(t,e,r,i,n,o){this.permute(o,t,e,r,i,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),l=0;l<n;l+=a)for(var d=u,c=h,f=0;f<s;f++){var p=r[l+f],_=i[l+f],v=r[l+f+s],E=i[l+f+s],m=d*v-c*E;E=d*E+c*v,v=m,r[l+f]=p+v,i[l+f]=_+E,r[l+f+s]=p-v,i[l+f+s]=_-E,f!==a&&(m=u*d-h*c,c=u*c+h*d,d=m)}},v.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},v.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=t[i];t[i]=t[r-i-1],t[r-i-1]=n,n=e[i],e[i]=-e[r-i-1],e[r-i-1]=-n}},v.prototype.normalize13b=function(t,e){for(var r=0,i=0;i<e/2;i++){var n=8192*Math.round(t[2*i+1]/e)+Math.round(t[2*i]/e)+r;t[i]=67108863&n,r=n<67108864?0:n/67108864|0}return t},v.prototype.convert13b=function(t,e,r,n){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<n;++s)r[s]=0;i(0===o),i(0==(-8192&o))},v.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},v.prototype.mulp=function(t,e,r){var i=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(i),o=this.stub(i),s=new Array(i),a=new Array(i),u=new Array(i),h=new Array(i),l=new Array(i),d=new Array(i),c=r.words;c.length=i,this.convert13b(t.words,t.length,s,i),this.convert13b(e.words,e.length,h,i),this.transform(s,o,a,u,i,n),this.transform(h,o,l,d,i,n);for(var f=0;f<i;f++){var p=a[f]*l[f]-u[f]*d[f];u[f]=a[f]*d[f]+u[f]*l[f],a[f]=p}return this.conjugate(a,u,i),this.transform(a,u,c,o,i,n),this.conjugate(c,o,i),this.normalize13b(c,i),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),_(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){i("number"==typeof t),i(t<67108864);for(var e=0,r=0;r<this.length;r++){var n=(0|this.words[r])*t,o=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=(t.words[i]&1<<n)>>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i<e.length&&0===e[i];i++,r=r.sqr());if(++i<e.length)for(var n=r.sqr();i<e.length;i++,n=n.sqr())0!==e[i]&&(r=r.mul(n));return r},o.prototype.iushln=function(t){i("number"==typeof t&&t>=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},o.prototype.ishln=function(t){return i(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var n;i("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(n-=s,n=Math.max(0,n),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var l=0;for(h=this.length-1;h>=0&&(0!==l||h>=n);h--){var d=0|this.words[h];this.words[h]=l<<26-o|d>>>o,l=d&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<<e;return!(this.length<=r||!(this.words[r]&n))},o.prototype.imaskn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return i("number"==typeof t),i(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var n,o,s=t.length+r;this._expand(s);var a=0;for(n=0;n<t.length;n++){o=(0|this.words[n+r])+a;var u=(0|t.words[n])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n<this.length-r;n++)a=(o=(0|this.words[n+r])+a)>>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,u=i.length-n.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var l=i.clone()._ishlnsubmul(n,1,u);0===l.negative&&(i=l,a&&(a.words[u]=1));for(var d=u-1;d>=0;d--){var c=67108864*(0|i.words[n.length+d])+(0|i.words[n.length+d-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,d);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,d),i.isZero()||(i.negative^=1);a&&(a.words[d]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),d=e.clone();!e.isZero();){for(var c=0,f=1;0==(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(l),s.isub(d)),n.iushrn(1),s.iushrn(1);for(var p=0,_=1;0==(r.words[0]&_)&&p<26;++p,_<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(d)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(u)):(r.isub(e),a.isub(n),u.isub(s))}return{a,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,l=1;0==(e.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var d=0,c=1;0==(r.words[0]&c)&&d<26;++d,c<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var o=n,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){i<n?e=-1:i>n&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new N(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var E={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function y(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function N(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function T(t){N.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},n(g,m),g.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n<i;n++)e.words[n]=t.words[n];if(e.length=i,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,n=10;n<t.length;n++){var s=0|t.words[n];t.words[n-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},g.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var i=0|t.words[r];e+=977*i,t.words[r]=67108863&e,e=64*i+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(A,m),n(y,m),n(M,m),M.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var i=19*(0|t.words[r])+e,n=67108863&i;i>>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(E[t])return E[t];var e;if("k256"===t)e=new g;else if("p224"===t)e=new A;else if("p192"===t)e=new y;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return E[t]=e,e},N.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},N.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},N.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},N.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},N.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},N.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},N.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},N.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},N.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},N.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},N.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},N.prototype.isqr=function(t){return this.imul(t,t.clone())},N.prototype.sqr=function(t){return this.mul(t,t)},N.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,h).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,n),c=this.pow(t,n.addn(1).iushrn(1)),f=this.pow(t,n),p=s;0!==f.cmp(a);){for(var _=f,v=0;0!==_.cmp(a);v++)_=_.redSqr();i(v<p);var E=this.pow(d,new o(1).iushln(p-v-1));c=c.redMul(E),d=E.redSqr(),f=f.redMul(d),p=v}return c},N.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},N.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],t);var n=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),i=e.length-1;i>=0;i--){for(var h=e.words[i],l=u-1;l>=0;l--){var d=h>>l&1;n!==r[0]&&(n=this.sqr(n)),0!==d||0!==s?(s<<=1,s|=d,(4==++a||0===i&&0===l)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}u=26}return n},N.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},N.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new T(t)},n(T,N),T.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},T.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},T.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},T.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},T.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},6395:t=>{const e="0123456789abcdef".split(""),r=[1,256,65536,16777216],i=[0,8,16,24],n=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],o=t=>{var e,r,i,o,s,a,u,h,l,d,c,f,p,_,v,E,m,g,A,y,M,N,T,w,R,O,I,b,S,P,D,L,C,x,U,G,k,B,j,F,Y,V,W,K,X,Z,H,z,q,$,J,Q,tt,et,rt,it,nt,ot,st,at,ut,ht,lt;for(i=0;i<48;i+=2)o=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],l=t[5]^t[15]^t[25]^t[35]^t[45],d=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=o^(h<<1|l>>>31),r=s^(l<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(d<<1|c>>>31),r=u^(c<<1|d>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(f<<1|p>>>31),r=l^(p<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=d^(o<<1|s>>>31),r=c^(s<<1|o>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,_=t[0],v=t[1],Z=t[11]<<4|t[10]>>>28,H=t[10]<<4|t[11]>>>28,b=t[20]<<3|t[21]>>>29,S=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,V=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,x=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,E=t[13]<<12|t[12]>>>20,m=t[12]<<12|t[13]>>>20,z=t[22]<<10|t[23]>>>22,q=t[23]<<10|t[22]>>>22,P=t[33]<<13|t[32]>>>19,D=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,G=t[14]<<6|t[15]>>>26,k=t[15]<<6|t[14]>>>26,g=t[25]<<11|t[24]>>>21,A=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,J=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,w=t[6]<<28|t[7]>>>4,R=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,B=t[26]<<25|t[27]>>>7,j=t[27]<<25|t[26]>>>7,y=t[36]<<21|t[37]>>>11,M=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,K=t[8]<<27|t[9]>>>5,X=t[9]<<27|t[8]>>>5,O=t[18]<<20|t[19]>>>12,I=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,Y=t[39]<<8|t[38]>>>24,N=t[48]<<14|t[49]>>>18,T=t[49]<<14|t[48]>>>18,t[0]=_^~E&g,t[1]=v^~m&A,t[10]=w^~O&b,t[11]=R^~I&S,t[20]=x^~G&B,t[21]=U^~k&j,t[30]=K^~Z&z,t[31]=X^~H&q,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=E^~g&y,t[3]=m^~A&M,t[12]=O^~b&P,t[13]=I^~S&D,t[22]=G^~B&F,t[23]=k^~j&Y,t[32]=Z^~z&$,t[33]=H^~q&J,t[42]=it^~ot&at,t[43]=nt^~st&ut,t[4]=g^~y&N,t[5]=A^~M&T,t[14]=b^~P&L,t[15]=S^~D&C,t[24]=B^~F&V,t[25]=j^~Y&W,t[34]=z^~$&Q,t[35]=q^~J&tt,t[44]=ot^~at&ht,t[45]=st^~ut&lt,t[6]=y^~N&_,t[7]=M^~T&v,t[16]=P^~L&w,t[17]=D^~C&R,t[26]=F^~V&x,t[27]=Y^~W&U,t[36]=$^~Q&K,t[37]=J^~tt&X,t[46]=at^~ht&et,t[47]=ut^~lt&rt,t[8]=N^~_&E,t[9]=T^~v&m,t[18]=L^~w&O,t[19]=C^~R&I,t[28]=V^~x&G,t[29]=W^~U&k,t[38]=Q^~K&Z,t[39]=tt^~X&H,t[48]=ht^~et&it,t[49]=lt^~rt&nt,t[0]^=n[i],t[1]^=n[i+1]},s=t=>n=>{var s;if("0x"===n.slice(0,2)){s=[];for(var a=2,u=n.length;a<u;a+=2)s.push(parseInt(n.slice(a,a+2),16))}else s=n;return((t,n)=>{for(var s,a=n.length,u=t.blocks,h=t.blockCount<<2,l=t.blockCount,d=t.outputBlocks,c=t.s,f=0;f<a;){if(t.reset)for(t.reset=!1,u[0]=t.block,v=1;v<l+1;++v)u[v]=0;if("string"!=typeof n)for(v=t.start;f<a&&v<h;++f)u[v>>2]|=n[f]<<i[3&v++];else for(v=t.start;f<a&&v<h;++f)(s=n.charCodeAt(f))<128?u[v>>2]|=s<<i[3&v++]:s<2048?(u[v>>2]|=(192|s>>6)<<i[3&v++],u[v>>2]|=(128|63&s)<<i[3&v++]):s<55296||s>=57344?(u[v>>2]|=(224|s>>12)<<i[3&v++],u[v>>2]|=(128|s>>6&63)<<i[3&v++],u[v>>2]|=(128|63&s)<<i[3&v++]):(s=65536+((1023&s)<<10|1023&n.charCodeAt(++f)),u[v>>2]|=(240|s>>18)<<i[3&v++],u[v>>2]|=(128|s>>12&63)<<i[3&v++],u[v>>2]|=(128|s>>6&63)<<i[3&v++],u[v>>2]|=(128|63&s)<<i[3&v++]);if(t.lastByteIndex=v,v>=h){for(t.start=v-h,t.block=u[l],v=0;v<l;++v)c[v]^=u[v];o(c),t.reset=!0}else t.start=v}if(u[(v=t.lastByteIndex)>>2]|=r[3&v],t.lastByteIndex===h)for(u[0]=u[l],v=1;v<l+1;++v)u[v]=0;for(u[l-1]|=2147483648,v=0;v<l;++v)c[v]^=u[v];o(c);for(var p,_="",v=0,E=0;E<d;){for(v=0;v<l&&E<d;++v,++E)p=c[v],_+=e[p>>4&15]+e[15&p]+e[p>>12&15]+e[p>>8&15]+e[p>>20&15]+e[p>>16&15]+e[p>>28&15]+e[p>>24&15];E%l==0&&(o(c),v=0)}return"0x"+_})((t=>{return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(e=[0,0,0,0,0,0,0,0,0,0],[].concat(e,e,e,e,e))};var e})(t),s)};t.exports={keccak256:s(256),keccak512:s(512),keccak256s:s(256),keccak512s:s(512)}},1041:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.version="4.0.47"},3850:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(2069);e.AddressZero="0x0000000000000000000000000000000000000000",e.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",e.EtherSymbol="Ξ";var n=i.bigNumberify(-1);e.NegativeOne=n;var o=i.bigNumberify(0);e.Zero=o;var s=i.bigNumberify(1);e.One=s;var a=i.bigNumberify(2);e.Two=a;var u=i.bigNumberify("1000000000000000000");e.WeiPerEther=u;var h=i.bigNumberify("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");e.MaxUint256=h},6666:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(1041);e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.MISSING_NEW="MISSING_NEW",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.NUMERIC_FAULT="NUMERIC_FAULT",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,o=!1;function s(t,r,n){if(o)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var s=[];Object.keys(n).forEach((function(t){try{s.push(t+"="+JSON.stringify(n[t]))}catch(e){s.push(t+"="+JSON.stringify(n[t].toString()))}})),s.push("version="+i.version);var a=t;s.length&&(t+=" ("+s.join(", ")+")");var u=new Error(t);throw u.reason=a,u.code=r,Object.keys(n).forEach((function(t){u[t]=n[t]})),u}e.throwError=s,e.checkNew=function(t,r){t instanceof r||s("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,i){i||(i=""),t<r&&s("missing argument"+i,e.MISSING_ARGUMENT,{count:t,expectedCount:r}),t>r&&s("too many arguments"+i,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&s("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o=!!t,n=!!r},e.checkNormalize=function(){try{if(["NFD","NFC","NFKD","NFKC"].forEach((function(t){try{"test".normalize(t)}catch(e){throw new Error("missing "+t)}})),String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){s("platform missing String.prototype.normalize",e.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:t.message})}};var a={debug:1,default:2,info:2,warn:3,error:4,off:5},u=a.default;function h(t,e){u>a[t]||console.log.apply(console,e)}function l(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];h("warn",t)}e.setLogLevel=function(t){var e=a[t];null!=e?u=e:l("invliad log level - "+t)},e.warn=l,e.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];h("info",t)}},4164:(t,e,r)=>{!function(){"use strict";var e="object"==typeof window?window:{};!e.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(e=r.g);for(var i=!e.JS_SHA3_NO_COMMON_JS&&t.exports,n="0123456789abcdef".split(""),o=[0,8,16,24],s=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],a=[224,256,384,512],u=["hex","buffer","arrayBuffer","array"],h=function(t,e,r){return function(i){return new A(t,e,t).update(i)[r]()}},l=function(t,e,r){return function(i,n){return new A(t,e,n).update(i)[r]()}},d=function(t,e){var r=h(t,e,"hex");r.create=function(){return new A(t,e,t)},r.update=function(t){return r.create().update(t)};for(var i=0;i<u.length;++i){var n=u[i];r[n]=h(t,e,n)}return r},c=[{name:"keccak",padding:[1,256,65536,16777216],bits:a,createMethod:d},{name:"sha3",padding:[6,1536,393216,100663296],bits:a,createMethod:d},{name:"shake",padding:[31,7936,2031616,520093696],bits:[128,256],createMethod:function(t,e){var r=l(t,e,"hex");r.create=function(r){return new A(t,e,r)},r.update=function(t,e){return r.create(e).update(t)};for(var i=0;i<u.length;++i){var n=u[i];r[n]=l(t,e,n)}return r}}],f={},p=[],_=0;_<c.length;++_)for(var v=c[_],E=v.bits,m=0;m<E.length;++m){var g=v.name+"_"+E[m];p.push(g),f[g]=v.createMethod(E[m],v.padding)}function A(t,e,r){this.blocks=[],this.s=[],this.padding=e,this.outputBits=r,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}A.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,i,n=t.length,s=this.blocks,a=this.byteCount,u=this.blockCount,h=0,l=this.s;h<n;){if(this.reset)for(this.reset=!1,s[0]=this.block,r=1;r<u+1;++r)s[r]=0;if(e)for(r=this.start;h<n&&r<a;++h)s[r>>2]|=t[h]<<o[3&r++];else for(r=this.start;h<n&&r<a;++h)(i=t.charCodeAt(h))<128?s[r>>2]|=i<<o[3&r++]:i<2048?(s[r>>2]|=(192|i>>6)<<o[3&r++],s[r>>2]|=(128|63&i)<<o[3&r++]):i<55296||i>=57344?(s[r>>2]|=(224|i>>12)<<o[3&r++],s[r>>2]|=(128|i>>6&63)<<o[3&r++],s[r>>2]|=(128|63&i)<<o[3&r++]):(i=65536+((1023&i)<<10|1023&t.charCodeAt(++h)),s[r>>2]|=(240|i>>18)<<o[3&r++],s[r>>2]|=(128|i>>12&63)<<o[3&r++],s[r>>2]|=(128|i>>6&63)<<o[3&r++],s[r>>2]|=(128|63&i)<<o[3&r++]);if(this.lastByteIndex=r,r>=a){for(this.start=r-a,this.block=s[u],r=0;r<u;++r)l[r]^=s[r];y(l),this.reset=!0}else this.start=r}return this},A.prototype.finalize=function(){var t=this.blocks,e=this.lastByteIndex,r=this.blockCount,i=this.s;if(t[e>>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e<r+1;++e)t[e]=0;for(t[r-1]|=2147483648,e=0;e<r;++e)i[e]^=t[e];y(i)},A.prototype.toString=A.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,r=this.s,i=this.outputBlocks,o=this.extraBytes,s=0,a=0,u="";a<i;){for(s=0;s<e&&a<i;++s,++a)t=r[s],u+=n[t>>4&15]+n[15&t]+n[t>>12&15]+n[t>>8&15]+n[t>>20&15]+n[t>>16&15]+n[t>>28&15]+n[t>>24&15];a%e==0&&(y(r),s=0)}return o&&(t=r[s],o>0&&(u+=n[t>>4&15]+n[15&t]),o>1&&(u+=n[t>>12&15]+n[t>>8&15]),o>2&&(u+=n[t>>20&15]+n[t>>16&15])),u},A.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s<i;){for(o=0;o<e&&s<i;++o,++s)u[s]=r[o];s%e==0&&y(r)}return n&&(u[o]=r[o],t=t.slice(0,a)),t},A.prototype.buffer=A.prototype.arrayBuffer,A.prototype.digest=A.prototype.array=function(){this.finalize();for(var t,e,r=this.blockCount,i=this.s,n=this.outputBlocks,o=this.extraBytes,s=0,a=0,u=[];a<n;){for(s=0;s<r&&a<n;++s,++a)t=a<<2,e=i[s],u[t]=255&e,u[t+1]=e>>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%r==0&&y(i)}return o&&(t=a<<2,e=i[s],o>0&&(u[t]=255&e),o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u};var y=function(t){var e,r,i,n,o,a,u,h,l,d,c,f,p,_,v,E,m,g,A,y,M,N,T,w,R,O,I,b,S,P,D,L,C,x,U,G,k,B,j,F,Y,V,W,K,X,Z,H,z,q,$,J,Q,tt,et,rt,it,nt,ot,st,at,ut,ht,lt;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],l=t[5]^t[15]^t[25]^t[35]^t[45],d=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(h<<1|l>>>31),r=o^(l<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(d<<1|c>>>31),r=u^(c<<1|d>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(f<<1|p>>>31),r=l^(p<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=d^(n<<1|o>>>31),r=c^(o<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,_=t[0],v=t[1],Z=t[11]<<4|t[10]>>>28,H=t[10]<<4|t[11]>>>28,b=t[20]<<3|t[21]>>>29,S=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,V=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,x=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,E=t[13]<<12|t[12]>>>20,m=t[12]<<12|t[13]>>>20,z=t[22]<<10|t[23]>>>22,q=t[23]<<10|t[22]>>>22,P=t[33]<<13|t[32]>>>19,D=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,G=t[14]<<6|t[15]>>>26,k=t[15]<<6|t[14]>>>26,g=t[25]<<11|t[24]>>>21,A=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,J=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,w=t[6]<<28|t[7]>>>4,R=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,B=t[26]<<25|t[27]>>>7,j=t[27]<<25|t[26]>>>7,y=t[36]<<21|t[37]>>>11,M=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,K=t[8]<<27|t[9]>>>5,X=t[9]<<27|t[8]>>>5,O=t[18]<<20|t[19]>>>12,I=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,Y=t[39]<<8|t[38]>>>24,N=t[48]<<14|t[49]>>>18,T=t[49]<<14|t[48]>>>18,t[0]=_^~E&g,t[1]=v^~m&A,t[10]=w^~O&b,t[11]=R^~I&S,t[20]=x^~G&B,t[21]=U^~k&j,t[30]=K^~Z&z,t[31]=X^~H&q,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=E^~g&y,t[3]=m^~A&M,t[12]=O^~b&P,t[13]=I^~S&D,t[22]=G^~B&F,t[23]=k^~j&Y,t[32]=Z^~z&$,t[33]=H^~q&J,t[42]=it^~ot&at,t[43]=nt^~st&ut,t[4]=g^~y&N,t[5]=A^~M&T,t[14]=b^~P&L,t[15]=S^~D&C,t[24]=B^~F&V,t[25]=j^~Y&W,t[34]=z^~$&Q,t[35]=q^~J&tt,t[44]=ot^~at&ht,t[45]=st^~ut&lt,t[6]=y^~N&_,t[7]=M^~T&v,t[16]=P^~L&w,t[17]=D^~C&R,t[26]=F^~V&x,t[27]=Y^~W&U,t[36]=$^~Q&K,t[37]=J^~tt&X,t[46]=at^~ht&et,t[47]=ut^~lt&rt,t[8]=N^~_&E,t[9]=T^~v&m,t[18]=L^~w&O,t[19]=C^~R&I,t[28]=V^~x&G,t[29]=W^~U&k,t[38]=Q^~K&Z,t[39]=tt^~X&H,t[48]=ht^~et&it,t[49]=lt^~rt&nt,t[0]^=s[i],t[1]^=s[i+1]};if(i)t.exports=f;else for(_=0;_<p.length;++_)e[p[_]]=f[p[_]]}()},861:function(t,e,r){"use strict";var i,n=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var s=r(3850),a=o(r(6666)),u=r(2990),h=r(2069),l=r(2453),d=r(9469),c=r(589),f=new RegExp(/^bytes([0-9]*)$/),p=new RegExp(/^(u?int)([0-9]*)$/),_=new RegExp(/^(.*)\[([0-9]*)\]$/);e.defaultCoerceFunc=function(t,e){var r=t.match(p);return r&&parseInt(r[2])<=48?e.toNumber():e};var v=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),E=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function m(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}function g(t,e){var r=t;function i(t){throw new Error('unexpected character "'+r[t]+'" at position '+t+' in "'+r+'"')}t=t.replace(/\s/g," ");for(var n={type:"",name:"",state:{allowType:!0}},o=n,s=0;s<t.length;s++){var a=t[s];switch(a){case"(":o.state.allowParams||i(s),o.state.allowType=!1,o.type=m(o.type),o.components=[{type:"",name:"",parent:o,state:{allowType:!0}}],o=o.components[0];break;case")":delete o.state,e&&"indexed"===o.name&&(o.indexed=!0,o.name=""),o.type=m(o.type);var u=o;(o=o.parent)||i(s),delete u.parent,o.state.allowParams=!1,o.state.allowName=!0,o.state.allowArray=!0;break;case",":delete o.state,e&&"indexed"===o.name&&(o.indexed=!0,o.name=""),o.type=m(o.type);var h={type:"",name:"",parent:o.parent,state:{allowType:!0}};o.parent.components.push(h),delete o.parent,o=h;break;case" ":o.state.allowType&&""!==o.type&&(o.type=m(o.type),delete o.state.allowType,o.state.allowName=!0,o.state.allowParams=!0),o.state.allowName&&""!==o.name&&(e&&"indexed"===o.name?(o.indexed=!0,o.name=""):o.state.allowName=!1);break;case"[":o.state.allowArray||i(s),o.type+=a,o.state.allowArray=!1,o.state.allowName=!1,o.state.readArray=!0;break;case"]":o.state.readArray||i(s),o.type+=a,o.state.readArray=!1,o.state.allowArray=!0,o.state.allowName=!0;break;default:o.state.allowType?(o.type+=a,o.state.allowParams=!0,o.state.allowArray=!0):o.state.allowName?(o.name+=a,delete o.state.allowArray):o.state.readArray?o.type+=a:i(s)}}if(o.parent)throw new Error("unexpected eof");return delete n.state,e&&"indexed"===o.name&&(o.indexed=!0,o.name=""),n.type=m(n.type),n}function A(t){return j(e.defaultCoerceFunc,t).type}e.parseParamType=function(t){return g(t,!0)},e.formatParamType=A,e.formatSignature=function(t){return t.name+"("+t.inputs.map((function(t){return A(t)})).join(",")+")"},e.parseSignature=function(t){if("string"==typeof t)return"event "===(t=(t=(t=t.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).substring(0,6)?function(t){var e={anonymous:!1,inputs:[],name:"",type:"event"},r=t.match(v);if(!r)throw new Error("invalid event: "+t);if(e.name=r[1].trim(),k(r[2]).forEach((function(t){(t=g(t,!0)).indexed=!!t.indexed,e.inputs.push(t)})),r[3].split(" ").forEach((function(t){switch(t){case"anonymous":e.anonymous=!0;break;case"":break;default:a.info("unknown modifier: "+t)}})),e.name&&!e.name.match(E))throw new Error('invalid identifier: "'+e.name+'"');return e}(t.substring(6).trim()):("function "===t.substring(0,9)&&(t=t.substring(9)),function(t){var e={constant:!1,gas:null,inputs:[],name:"",outputs:[],payable:!1,stateMutability:null,type:"function"},r=t.split("@");if(1!==r.length){if(r.length>2)throw new Error("invalid signature");if(!r[1].match(/^[0-9]+$/))throw new Error("invalid signature gas");e.gas=h.bigNumberify(r[1]),t=r[0]}var i=(r=t.split(" returns "))[0].match(v);if(!i)throw new Error("invalid signature");if(e.name=i[1].trim(),!e.name.match(E))throw new Error('invalid identifier: "'+i[1]+'"');if(k(i[2]).forEach((function(t){e.inputs.push(g(t))})),i[3].split(" ").forEach((function(t){switch(t){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:a.info("unknown modifier: "+t)}})),r.length>1){var n=r[1].match(v);if(""!=n[1].trim()||""!=n[3].trim())throw new Error("unexpected tokens");k(n[2]).forEach((function(t){e.outputs.push(g(t))}))}if("constructor"===e.name){if(e.type="constructor",e.outputs.length)throw new Error("constructor may not have outputs");delete e.name,delete e.outputs}return e}(t.trim()));throw new Error("unknown signature")};var y=function(t,e,r,i,n){this.coerceFunc=t,this.name=e,this.type=r,this.localName=i,this.dynamic=n},M=function(t){function e(e){var r=t.call(this,e.coerceFunc,e.name,e.type,void 0,e.dynamic)||this;return c.defineReadOnly(r,"coder",e),r}return n(e,t),e.prototype.encode=function(t){return this.coder.encode(t)},e.prototype.decode=function(t,e){return this.coder.decode(t,e)},e}(y),N=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return n(e,t),e.prototype.encode=function(t){return l.arrayify([])},e.prototype.decode=function(t,e){if(e>t.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},e}(y),T=function(t){function e(e,r,i,n){var o=this,s=(i?"int":"uint")+8*r;return(o=t.call(this,e,s,s,n,!1)||this).size=r,o.signed=i,o}return n(e,t),e.prototype.encode=function(t){try{var e=h.bigNumberify(t);if(this.signed){var r=s.MaxUint256.maskn(8*this.size-1);if(e.gt(r))throw new Error("out-of-bounds");if(r=r.add(s.One).mul(s.NegativeOne),e.lt(r))throw new Error("out-of-bounds")}else if(e.lt(s.Zero)||e.gt(s.MaxUint256.maskn(8*this.size)))throw new Error("out-of-bounds");return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),l.padZeros(l.arrayify(e),32)}catch(e){a.throwError("invalid number value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length<e+32&&a.throwError("insufficient data for "+this.name+" type",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:l.hexlify(t.slice(e,e+32))});var r=32-this.size,i=h.bigNumberify(t.slice(e+r,e+32));return i=this.signed?i.fromTwos(8*this.size):i.maskn(8*this.size),{consumed:32,value:this.coerceFunc(this.name,i)}},e}(y),w=new T((function(t,e){return e}),32,!1,"none"),R=function(t){function e(e,r){return t.call(this,e,"bool","bool",r,!1)||this}return n(e,t),e.prototype.encode=function(t){return w.encode(t?1:0)},e.prototype.decode=function(t,e){try{var r=w.decode(t,e)}catch(t){throw"insufficient data for uint256 type"===t.reason&&a.throwError("insufficient data for boolean type",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"boolean",value:t.value}),t}return{consumed:r.consumed,value:this.coerceFunc("bool",!r.value.isZero())}},e}(y),O=function(t){function e(e,r,i){var n=this,o="bytes"+r;return(n=t.call(this,e,o,o,i,!1)||this).length=r,n}return n(e,t),e.prototype.encode=function(t){var e=new Uint8Array(32);try{var r=l.arrayify(t);if(r.length!==this.length)throw new Error("incorrect data length");e.set(r)}catch(e){a.throwError("invalid "+this.name+" value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e.value||t})}return e},e.prototype.decode=function(t,e){return t.length<e+32&&a.throwError("insufficient data for "+this.name+" type",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:l.hexlify(t.slice(e,e+32))}),{consumed:32,value:this.coerceFunc(this.name,l.hexlify(t.slice(e,e+this.length)))}},e}(y),I=function(t){function e(e,r){return t.call(this,e,"address","address",r,!1)||this}return n(e,t),e.prototype.encode=function(t){var e=new Uint8Array(32);try{e.set(l.arrayify(u.getAddress(t)),12)}catch(e){a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"address",value:t})}return e},e.prototype.decode=function(t,e){return t.length<e+32&&a.throwError("insufficient data for address type",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"address",value:l.hexlify(t.slice(e,e+32))}),{consumed:32,value:this.coerceFunc("address",u.getAddress(l.hexlify(t.slice(e+12,e+32))))}},e}(y);function b(t){var e=32*Math.ceil(t.length/32),r=new Uint8Array(e-t.length);return l.concat([w.encode(t.length),t,r])}function S(t,e,r){t.length<e+32&&a.throwError("insufficient data for dynamicBytes length",a.INVALID_ARGUMENT,{arg:r,coderType:"dynamicBytes",value:l.hexlify(t.slice(e,e+32))});var i=w.decode(t,e).value;try{i=i.toNumber()}catch(t){a.throwError("dynamic bytes count too large",a.INVALID_ARGUMENT,{arg:r,coderType:"dynamicBytes",value:i.toString()})}return t.length<e+32+i&&a.throwError("insufficient data for dynamicBytes type",a.INVALID_ARGUMENT,{arg:r,coderType:"dynamicBytes",value:l.hexlify(t.slice(e,e+32+i))}),{consumed:32+32*Math.ceil(i/32),value:t.slice(e+32,e+32+i)}}var P=function(t){function e(e,r){return t.call(this,e,"bytes","bytes",r,!0)||this}return n(e,t),e.prototype.encode=function(t){try{return b(l.arrayify(t))}catch(t){a.throwError("invalid bytes value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"bytes",value:t.value})}return null},e.prototype.decode=function(t,e){var r=S(t,e,this.localName);return r.value=this.coerceFunc("bytes",l.hexlify(r.value)),r},e}(y),D=function(t){function e(e,r){return t.call(this,e,"string","string",r,!0)||this}return n(e,t),e.prototype.encode=function(t){return"string"!=typeof t&&a.throwError("invalid string value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"string",value:t}),b(d.toUtf8Bytes(t))},e.prototype.decode=function(t,e){var r=S(t,e,this.localName);return r.value=this.coerceFunc("string",d.toUtf8String(r.value)),r},e}(y);function L(t){return 32*Math.ceil(t/32)}function C(t,e){if(Array.isArray(e));else if(e&&"object"==typeof e){var r=[];t.forEach((function(t){r.push(e[t.localName])})),e=r}else a.throwError("invalid tuple value",a.INVALID_ARGUMENT,{coderType:"tuple",value:e});t.length!==e.length&&a.throwError("types/value length mismatch",a.INVALID_ARGUMENT,{coderType:"tuple",value:e});var i=[];t.forEach((function(t,r){i.push({dynamic:t.dynamic,value:t.encode(e[r])})}));var n=0,o=0;i.forEach((function(t){t.dynamic?(n+=32,o+=L(t.value.length)):n+=L(t.value.length)}));var s=0,u=n,h=new Uint8Array(n+o);return i.forEach((function(t){t.dynamic?(h.set(w.encode(u),s),s+=32,h.set(t.value,u),u+=L(t.value.length)):(h.set(t.value,s),s+=L(t.value.length))})),h}function x(t,e,r){var i=r,n=0,o=[];return t.forEach((function(t){if(t.dynamic){var s=w.decode(e,r);(a=t.decode(e,i+s.value.toNumber())).consumed=s.consumed}else var a=t.decode(e,r);null!=a.value&&o.push(a.value),r+=a.consumed,n+=a.consumed})),t.forEach((function(t,e){var r=t.localName;r&&("length"===r&&(r="_length"),null==o[r]&&(o[r]=o[e]))})),{value:o,consumed:n}}var U=function(t){function e(e,r,i,n){var o=this,s=r.type+"["+(i>=0?i:"")+"]",a=-1===i||r.dynamic;return(o=t.call(this,e,"array",s,n,a)||this).coder=r,o.length=i,o}return n(e,t),e.prototype.encode=function(t){Array.isArray(t)||a.throwError("expected array value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=w.encode(e)),a.checkArgumentCount(e,t.length," in coder array"+(this.localName?" "+this.localName:""));for(var i=[],n=0;n<t.length;n++)i.push(this.coder);return l.concat([r,C(i,t)])},e.prototype.decode=function(t,e){var r=0,i=this.length;if(-1===i){try{var n=w.decode(t,e)}catch(t){a.throwError("insufficient data for dynamic array length",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t.value})}try{i=n.value.toNumber()}catch(t){a.throwError("array count too large",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:n.value.toString()})}r+=n.consumed,e+=n.consumed}for(var o=[],s=0;s<i;s++)o.push(new M(this.coder));var u=x(o,t,e);return u.consumed+=r,u.value=this.coerceFunc(this.type,u.value),u},e}(y),G=function(t){function e(e,r,i){var n=this,o=!1,s=[];r.forEach((function(t){t.dynamic&&(o=!0),s.push(t.type)}));var a="tuple("+s.join(",")+")";return(n=t.call(this,e,"tuple",a,i,o)||this).coders=r,n}return n(e,t),e.prototype.encode=function(t){return C(this.coders,t)},e.prototype.decode=function(t,e){var r=x(this.coders,t,e);return r.value=this.coerceFunc(this.type,r.value),r},e}(y);function k(t){t=t.trim();for(var e=[],r="",i=0,n=0;n<t.length;n++){var o=t[n];if(","===o&&0===i)e.push(r),r="";else if(r+=o,"("===o)i++;else if(")"===o&&-1==--i)throw new Error("unbalanced parenthsis")}return r&&e.push(r),e}var B={address:I,bool:R,string:D,bytes:P};function j(t,e){var r,i=B[e.type];if(i)return new i(t,e.name);if(r=e.type.match(p))return(0===(n=parseInt(r[2]||"256"))||n>256||n%8!=0)&&a.throwError("invalid "+r[1]+" bit length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new T(t,n/8,"int"===r[1],e.name);if(r=e.type.match(f))return(0===(n=parseInt(r[1]))||n>32)&&a.throwError("invalid bytes length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new O(t,n,e.name);if(r=e.type.match(_)){var n=parseInt(r[2]||"-1");return(e=c.shallowCopy(e)).type=r[1],e=c.deepCopy(e),new U(t,j(t,e),n,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var i=[];return e.forEach((function(e){i.push(j(t,e))})),new G(t,i,r)}(t,e.components,e.name):""===e.type?new N(t,e.name):(a.throwError("invalid type",a.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var F=function(){function t(r){a.checkNew(this,t),r||(r=e.defaultCoerceFunc),c.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&a.throwError("types/values length mismatch",a.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach((function(t){var e;e="string"==typeof t?g(t):t,r.push(j(this.coerceFunc,e))}),this),l.hexlify(new G(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach((function(t){var e;e="string"==typeof t?g(t):c.deepCopy(t),r.push(j(this.coerceFunc,e))}),this),new G(this.coerceFunc,r,"_").decode(l.arrayify(e),0).value},t}();e.AbiCoder=F,e.defaultAbiCoder=new F},2990:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(1303)),o=r(2453),s=r(7839),a=r(8854),u=r(6666);function h(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),i=0;i<40;i++)r[i]=e[i].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var n=0;n<40;n+=2)r[n>>1]>>4>=8&&(e[n]=e[n].toUpperCase()),(15&r[n>>1])>=8&&(e[n+1]=e[n+1].toUpperCase());return"0x"+e.join("")}for(var l={},d=0;d<10;d++)l[String(d)]=String(d);for(d=0;d<26;d++)l[String.fromCharCode(65+d)]=String(10+d);var c,f=Math.floor((c=9007199254740991,Math.log10?Math.log10(c):Math.log(c)/Math.LN10));function p(t){t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00";var e="";for(t.split("").forEach((function(t){e+=l[t]}));e.length>=f;){var r=e.substring(0,f);e=parseInt(r,10)%97+e.substring(r.length)}for(var i=String(98-parseInt(e,10)%97);i.length<2;)i="0"+i;return i}function _(t){var e=null;if("string"!=typeof t&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t}),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=h(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:t});else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==p(t)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:t}),e=new n.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=h("0x"+e)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=_,e.getIcapAddress=function(t){for(var e=new n.default.BN(_(t).substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+p("XE00"+e)+e},e.getContractAddress=function(t){if(!t.from)throw new Error("missing from address");var e=t.nonce;return _("0x"+s.keccak256(a.encode([_(t.from),o.stripZeros(o.hexlify(e))])).substring(26))},e.getCreate2Address=function(t){var e=t.initCodeHash;t.initCode&&(e?s.keccak256(t.initCode)!==e&&u.throwError("initCode/initCodeHash mismatch",u.INVALID_ARGUMENT,{arg:"options",value:t}):e=s.keccak256(t.initCode)),e||u.throwError("missing initCode or initCodeHash",u.INVALID_ARGUMENT,{arg:"options",value:t});var r=_(t.from),i=o.arrayify(t.salt);return 32!==i.length&&u.throwError("invalid salt",u.INVALID_ARGUMENT,{arg:"options",value:t}),_("0x"+s.keccak256(o.concat(["0xff",r,i,e])).substring(26))}},2069:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var o=i(r(1303)),s=r(2453),a=r(589),u=n(r(6666)),h=new o.default.BN(-1);function l(t){var e=t.toString(16);return"-"===e[0]?e.length%2==0?"-0x0"+e.substring(1):"-0x"+e.substring(1):e.length%2==1?"0x0"+e:"0x"+e}function d(t){return f(_(t))}function c(t){return new p(l(t))}function f(t){var e=t._hex;return"-"===e[0]?new o.default.BN(e.substring(3),16).mul(h):new o.default.BN(e.substring(2),16)}var p=function(){function t(e){if(u.checkNew(this,t),a.setType(this,"BigNumber"),"string"==typeof e)s.isHexString(e)?("0x"==e&&(e="0x0"),a.defineReadOnly(this,"_hex",e)):"-"===e[0]&&s.isHexString(e.substring(1))?a.defineReadOnly(this,"_hex",e):e.match(/^-?[0-9]*$/)?(""==e&&(e="0"),a.defineReadOnly(this,"_hex",l(new o.default.BN(e)))):u.throwError("invalid BigNumber string value",u.INVALID_ARGUMENT,{arg:"value",value:e});else if("number"==typeof e){parseInt(String(e))!==e&&u.throwError("underflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:e,outputValue:parseInt(String(e))});try{a.defineReadOnly(this,"_hex",l(new o.default.BN(e)))}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else e instanceof t?a.defineReadOnly(this,"_hex",e._hex):e.toHexString?a.defineReadOnly(this,"_hex",l(d(e.toHexString()))):e._hex&&s.isHexString(e._hex)?a.defineReadOnly(this,"_hex",e._hex):s.isArrayish(e)?a.defineReadOnly(this,"_hex",l(new o.default.BN(s.hexlify(e).substring(2),16))):u.throwError("invalid BigNumber value",u.INVALID_ARGUMENT,{arg:"value",value:e})}return t.prototype.fromTwos=function(t){return c(f(this).fromTwos(t))},t.prototype.toTwos=function(t){return c(f(this).toTwos(t))},t.prototype.abs=function(){return"-"===this._hex[0]?c(f(this).mul(h)):this},t.prototype.add=function(t){return c(f(this).add(d(t)))},t.prototype.sub=function(t){return c(f(this).sub(d(t)))},t.prototype.div=function(t){return _(t).isZero()&&u.throwError("division by zero",u.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),c(f(this).div(d(t)))},t.prototype.mul=function(t){return c(f(this).mul(d(t)))},t.prototype.mod=function(t){return c(f(this).mod(d(t)))},t.prototype.pow=function(t){return c(f(this).pow(d(t)))},t.prototype.maskn=function(t){return c(f(this).maskn(t))},t.prototype.eq=function(t){return f(this).eq(d(t))},t.prototype.lt=function(t){return f(this).lt(d(t))},t.prototype.lte=function(t){return f(this).lte(d(t))},t.prototype.gt=function(t){return f(this).gt(d(t))},t.prototype.gte=function(t){return f(this).gte(d(t))},t.prototype.isZero=function(){return f(this).isZero()},t.prototype.toNumber=function(){try{return f(this).toNumber()}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},t.prototype.toString=function(){return f(this).toString(10)},t.prototype.toHexString=function(){return this._hex},t.isBigNumber=function(t){return a.isType(t,"BigNumber")},t}();function _(t){return p.isBigNumber(t)?t:new p(t)}e.BigNumber=p,e.bigNumberify=_},2453:function(t,e,r){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(6666));function o(t){return!!t.toHexString}function s(t){return t.slice||(t.slice=function(){var e=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function a(t){if(!t||parseInt(String(t.length))!=t.length||"string"==typeof t)return!1;for(var e=0;e<t.length;e++){var r=t[e];if(r<0||r>=256||parseInt(String(r))!=r)return!1}return!0}function u(t){if(null==t&&n.throwError("cannot convert null value to array",n.INVALID_ARGUMENT,{arg:"value",value:t}),o(t)&&(t=t.toHexString()),"string"==typeof t){var e=t.match(/^(0x)?[0-9a-fA-F]*$/);e||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==e[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),(t=t.substring(2)).length%2&&(t="0"+t);for(var r=[],i=0;i<t.length;i+=2)r.push(parseInt(t.substr(i,2),16));return s(new Uint8Array(r))}return a(t)?s(new Uint8Array(t)):(n.throwError("invalid arrayify value",null,{arg:"value",value:t,type:typeof t}),null)}function h(t){for(var e=[],r=0,i=0;i<t.length;i++){var n=u(t[i]);e.push(n),r+=n.length}var o=new Uint8Array(r),a=0;for(i=0;i<e.length;i++)o.set(e[i],a),a+=e[i].length;return s(o)}function l(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}e.isHexable=o,e.isArrayish=a,e.arrayify=u,e.concat=h,e.stripZeros=function(t){var e=u(t);if(0===e.length)return e;for(var r=0;0===e[r];)r++;return r&&(e=e.slice(r)),e},e.padZeros=function(t,e){if(e<(t=u(t)).length)throw new Error("cannot pad");var r=new Uint8Array(e);return r.set(t,e-t.length),s(r)},e.isHexString=l;var d="0123456789abcdef";function c(t){if(o(t))return t.toHexString();if("number"==typeof t){t<0&&n.throwError("cannot hexlify negative value",n.INVALID_ARGUMENT,{arg:"value",value:t}),t>=9007199254740991&&n.throwError("out-of-range",n.NUMERIC_FAULT,{operartion:"hexlify",fault:"out-of-safe-range"});for(var e="";t;)e=d[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("string"==typeof t){var r=t.match(/^(0x)?[0-9a-fA-F]*$/);return r||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==r[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2&&(t="0x0"+t.substring(2)),t}if(a(t)){for(var i=[],s=0;s<t.length;s++){var u=t[s];i.push(d[(240&u)>>4]+d[15&u])}return"0x"+i.join("")}return n.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function f(t,e){for(l(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length<2*e+2;)t="0x0"+t.substring(2);return t}function p(t){var e,r=0,i="0x",o="0x";if((e=t)&&null!=e.r&&null!=e.s){null==t.v&&null==t.recoveryParam&&n.throwError("at least on of recoveryParam or v must be specified",n.INVALID_ARGUMENT,{argument:"signature",value:t}),i=f(t.r,32),o=f(t.s,32),"string"==typeof(r=t.v)&&(r=parseInt(r,16));var s=t.recoveryParam;null==s&&null!=t.v&&(s=1-r%2),r=27+s}else{var a=u(t);if(65!==a.length)throw new Error("invalid signature");i=c(a.slice(0,32)),o=c(a.slice(32,64)),27!==(r=a[64])&&28!==r&&(r=27+r%2)}return{r:i,s:o,recoveryParam:r-27,v:r}}e.hexlify=c,e.hexDataLength=function(t){return l(t)&&t.length%2==0?(t.length-2)/2:null},e.hexDataSlice=function(t,e,r){return l(t)||n.throwError("invalid hex data",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2!=0&&n.throwError("hex data length must be even",n.INVALID_ARGUMENT,{arg:"value",value:t}),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)},e.hexStripZeros=function(t){for(l(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length>3&&"0x0"===t.substring(0,3);)t="0x"+t.substring(3);return t},e.hexZeroPad=f,e.splitSignature=p,e.joinSignature=function(t){return c(h([(t=p(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},7839:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(4164),n=r(2453);e.keccak256=function(t){return"0x"+i.keccak_256(n.arrayify(t))}},589:function(t,e,r){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(6666));function o(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function s(t,e){return t&&t._ethersType===e}e.defineReadOnly=o,e.setType=function(t,e){Object.defineProperty(t,"_ethersType",{configurable:!1,value:e,writable:!1})},e.isType=s,e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach((function(i){var n=t[i];n instanceof Promise?r.push(n.then((function(t){return e[i]=t,null}))):e[i]=n})),Promise.all(r).then((function(){return e}))},e.checkProperties=function(t,e){t&&"object"==typeof t||n.throwError("invalid object",n.INVALID_ARGUMENT,{argument:"object",value:t}),Object.keys(t).forEach((function(r){e[r]||n.throwError("invalid object key - "+r,n.INVALID_ARGUMENT,{argument:"transaction",value:t,key:r})}))},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e};var a={boolean:!0,number:!0,string:!0};e.deepCopy=function t(e,r){if(null==e||a[typeof e])return e;if(Array.isArray(e)){var i=e.map((function(e){return t(e,r)}));return r&&Object.freeze(i),i}if("object"==typeof e){if(s(e,"BigNumber"))return e;if(s(e,"Description"))return e;if(s(e,"Indexed"))return e;for(var n in i={},e){var u=e[n];void 0!==u&&o(i,n,t(u,r))}return r&&Object.freeze(i),i}if("function"==typeof e)return e;throw new Error("Cannot deepCopy "+typeof e)},e.inheritable=function t(e){return function(r){var i,n;n=e,(i=r).super_=n,i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),o(r,"inherits",t(r))}}},8854:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(2453);function n(t){for(var e=[];t;)e.unshift(255&t),t>>=8;return e}function o(t,e,r){for(var i=0,n=0;n<r;n++)i=256*i+t[e+n];return i}function s(t){if(Array.isArray(t)){var e=[];return t.forEach((function(t){e=e.concat(s(t))})),e.length<=55?(e.unshift(192+e.length),e):((r=n(e.length)).unshift(247+r.length),r.concat(e))}var r,o=Array.prototype.slice.call(i.arrayify(t));return 1===o.length&&o[0]<=127?o:o.length<=55?(o.unshift(128+o.length),o):((r=n(o.length)).unshift(183+r.length),r.concat(o))}function a(t,e,r,i){for(var n=[];r<e+1+i;){var o=u(t,r);if(n.push(o.result),(r+=o.consumed)>e+1+i)throw new Error("invalid rlp")}return{consumed:1+i,result:n}}function u(t,e){if(0===t.length)throw new Error("invalid rlp data");if(t[e]>=248){if(e+1+(r=t[e]-247)>t.length)throw new Error("too short");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("to short");return a(t,e,e+1+r,r+n)}if(t[e]>=192){if(e+1+(n=t[e]-192)>t.length)throw new Error("invalid rlp data");return a(t,e,e+1,n)}if(t[e]>=184){var r;if(e+1+(r=t[e]-183)>t.length)throw new Error("invalid rlp data");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+n,result:i.hexlify(t.slice(e+1+r,e+1+r+n))}}if(t[e]>=128){var n;if(e+1+(n=t[e]-128)>t.length)throw new Error("invalid rlp data");return{consumed:1+n,result:i.hexlify(t.slice(e+1,e+1+n))}}return{consumed:1,result:i.hexlify(t[e])}}e.encode=function(t){return i.hexlify(s(t))},e.decode=function(t){var e=i.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},9469:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,n=r(3850),o=r(6666),s=r(2453);function a(t,e){void 0===e&&(e=i.current),e!=i.current&&(o.checkNormalize(),t=t.normalize(e));for(var r=[],n=0;n<t.length;n++){var a=t.charCodeAt(n);if(a<128)r.push(a);else if(a<2048)r.push(a>>6|192),r.push(63&a|128);else if(55296==(64512&a)){n++;var u=t.charCodeAt(n);if(n>=t.length||56320!=(64512&u))throw new Error("invalid utf-8 string");a=65536+((1023&a)<<10)+(1023&u),r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(a>>12|224),r.push(a>>6&63|128),r.push(63&a|128)}return s.arrayify(r)}function u(t,e){t=s.arrayify(t);for(var r="",i=0;i<t.length;){var n=t[i++];if(n>>7!=0){var o=null,a=null;if(192==(224&n))o=1,a=127;else if(224==(240&n))o=2,a=2047;else{if(240!=(248&n)){if(!e){if(128==(192&n))throw new Error("invalid utf8 byte sequence; unexpected continuation byte");throw new Error("invalid utf8 byte sequence; invalid prefix")}continue}o=3,a=65535}if(i+o>t.length){if(!e)throw new Error("invalid utf8 byte sequence; too short");for(;i<t.length&&t[i]>>6==2;i++);}else{for(var u=n&(1<<8-o-1)-1,h=0;h<o;h++){var l=t[i];if(128!=(192&l)){u=null;break}u=u<<6|63&l,i++}if(null!==u)if(u<=a){if(!e)throw new Error("invalid utf8 byte sequence; overlong")}else if(u>1114111){if(!e)throw new Error("invalid utf8 byte sequence; out-of-range")}else if(u>=55296&&u<=57343){if(!e)throw new Error("invalid utf8 byte sequence; utf-16 surrogate")}else u<=65535?r+=String.fromCharCode(u):(u-=65536,r+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u)));else if(!e)throw new Error("invalid utf8 byte sequence; invalid continuation byte")}}else r+=String.fromCharCode(n)}return r}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(i=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=a,e.toUtf8String=u,e.formatBytes32String=function(t){var e=a(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return s.hexlify(s.concat([e,n.HashZero]).slice(0,32))},e.parseBytes32String=function(t){var e=s.arrayify(t);if(32!==e.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==e[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===e[r-1];)r--;return u(e.slice(0,r))}},7533:t=>{"use strict";var e,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var n=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,i){function n(r){t.removeListener(e,o),i(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",n),r([].slice.call(arguments))}_(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&_(t,"error",e,{once:!0})}(t,n)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function h(t,e,r,i){var n,o,s,h;if(a(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),(n=u(t))>0&&s.length>n&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,h=l,console&&console.warn&&console.warn(h)}return t}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=l.bind(i);return n.listener=r,i.wrapFn=n,n}function c(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(n):p(n,n.length)}function f(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(t,e){for(var r=new Array(e),i=0;i<e;++i)r[i]=t[i];return r}function _(t,e,r,i){if("function"==typeof t.on)i.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function n(o){i.once&&t.removeEventListener(e,n),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(t){if("number"!=typeof t||t<0||n(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");s=t}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||n(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n="error"===t,o=this._events;if(void 0!==o)n=n&&void 0===o.error;else if(!n)return!1;if(n){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)i(u,this,e);else{var h=u.length,l=p(u,h);for(r=0;r<h;++r)i(l[r],this,e)}return!0},o.prototype.addListener=function(t,e){return h(this,t,e,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(t,e){return h(this,t,e,!0)},o.prototype.once=function(t,e){return a(e),this.on(t,d(this,t,e)),this},o.prototype.prependOnceListener=function(t,e){return a(e),this.prependListener(t,d(this,t,e)),this},o.prototype.removeListener=function(t,e){var r,i,n,o,s;if(a(e),void 0===(i=this._events))return this;if(void 0===(r=i[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(n=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,n=o;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,n),1===r.length&&(i[t]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",t,s||e)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(t){var e,r,i;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var n,o=Object.keys(r);for(i=0;i<o.length;++i)"removeListener"!==(n=o[i])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(i=e.length-1;i>=0;i--)this.removeListener(t,e[i]);return this},o.prototype.listeners=function(t){return c(this,t,!0)},o.prototype.rawListeners=function(t){return c(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):f.call(t,e)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},9002:(t,e)=>{"use strict";var r=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r)return r;throw new Error("unable to locate global object")}();t.exports=e=r.fetch,r.fetch&&(e.default=r.fetch.bind(r)),e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response},2143:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseError=void 0;const i=r(6112);e.parseError=function(t){return t instanceof i.ProviderError?t:Object.values(i.ProviderIssue).includes(t)?new i.ProviderError(t):new i.ProviderError(i.ProviderIssue.CONTRACT_ERROR,t)}},2072:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.buildGatewayConfig=void 0;const i=r(6898);e.buildGatewayConfig=function(t){switch(t){case i.NetworkKind.LIVE:return{actionsOrderId:"0x800ecA21614dA02Df076981Bca9c664dBE19089A",assetLedgerDeployOrderId:"0x984e781a6C09b433493767755f7b072183Ce7BfF",valueLedgerDeployOrderId:"0x9118bd4230EAb074f98527658f3649aA26420568"};case i.NetworkKind.RINKEBY:return{actionsOrderId:"0xF8254F1B119Cd263b066912B3Cb4FE568f580b6c",assetLedgerDeployOrderId:"0xC9F667603300390BCF8C4Fb5688d755811F34Da5",valueLedgerDeployOrderId:"0xA02121436e9307f9e369e188941b731D79c4DD7d"};case i.NetworkKind.ROPSTEN:return{actionsOrderId:"0xbb719e35c67198e4453923eeccF0c678C6129982",assetLedgerDeployOrderId:"0xC94284591B312c5551329F868420dec03C9044f8",valueLedgerDeployOrderId:"0xD348c4D9BE9585295891E0322FeFe58009c1514C"};default:throw new Error("Unsupported network kind.")}}},1868:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Mutation=e.MutationStatus=void 0;const n=r(2624),o=r(6112),s=r(7533),a=r(6898);var u;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(u=e.MutationStatus||(e.MutationStatus={}));class h extends s.EventEmitter{constructor(t,e,r){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._logs=[],this._id=e,this._provider=t,this._provider.sandbox&&(this._status=u.COMPLETED),this._context=r}get id(){return this._id}get provider(){return this._provider}get confirmations(){return this._confirmations}get senderId(){return this._senderId}get receiverId(){return this._receiverId}get logs(){return this._logs}isPending(){return this._status===u.PENDING}isCompleted(){return this._status===u.COMPLETED}emit(...t){return super.emit.call(this,...t),this}on(...t){return super.on.call(this,...t),this}once(...t){return super.once.call(this,...t),this}off(t,e){return e?super.off(t,e):super.removeAllListeners(t),this}complete(){return i(this,void 0,void 0,(function*(){const t=this._status===u.INITIALIZED;return this.isCompleted()?this.resolveCurrentState():(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise(((e,r)=>{this.isCompleted()?e(null):(this.once(o.MutationEvent.COMPLETE,(()=>e(null))),this.once(o.MutationEvent.ERROR,(t=>r(t)))),t&&this.loopUntilCompleted()})),this)}))}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}resolve(){return i(this,void 0,void 0,(function*(){return this.resolveCurrentState()}))}retry(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t)throw new Error("Mutation not found");if(t.blockNumber)throw new Error("Mutation already accepted onto the blockchain");const e=yield this._provider.post({method:"eth_gasPrice",params:[]}),r=t.gasPrice,i=e.result*this._provider.retryGasPriceMultiplier,n=i>=r?i:r*this._provider.retryGasPriceMultiplier,o={from:t.from,data:t.input,nonce:t.nonce,value:t.value,gas:t.gas,gasPrice:`0x${Math.ceil(n).toString(16)}`};t.to&&(o.to=t.to);const s=yield this._provider.post({method:"eth_sendTransaction",params:[o]});this._id=s.result}))}cancel(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t)throw new Error("Mutation not found");if(t.blockNumber)throw new Error("Mutation already accepted onto the blockchain");if(t.from.toLowerCase()!==this._provider.accountId.toLowerCase())throw new Error("You are not the maker of this mutation so you cannot cancel it.");const e=`0x${Math.ceil(1.1*t.gasPrice).toString(16)}`,r={from:t.from,to:t.from,nonce:t.nonce,value:"0x0",gasPrice:e},i=yield this._provider.post({method:"eth_sendTransaction",params:[r]});this._id=i.result}))}resolveCurrentState(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t||t.to&&"0x0"!==t.to||(t.to=yield this.getTransactionReceipt().then((t=>t?t.contractAddress:null))),t&&t.to){if(this._senderId=n.normalizeAddress(t.from),this._receiverId=n.normalizeAddress(t.to),this._confirmations=yield this.getLastBlock().then((e=>e-parseInt(t.blockNumber||e))).then((t=>t<0?0:t)),this._confirmations>=this._provider.requiredConfirmations)return yield this.parseLogs(),this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}}))}loopUntilCompleted(){return i(this,void 0,void 0,(function*(){yield this.resolveCurrentState(),-1===this._provider.mutationTimeout||Date.now()-this._started<this._provider.mutationTimeout?this._timer=setTimeout(this.loopUntilCompleted.bind(this),this._speed):this.emit(o.MutationEvent.ERROR,new Error("Mutation has timed out"))}))}getTransactionObject(){return i(this,void 0,void 0,(function*(){return(yield this._provider.post({method:"eth_getTransactionByHash",params:[this.id]})).result}))}getTransactionReceipt(){return i(this,void 0,void 0,(function*(){return(yield this._provider.post({method:"eth_getTransactionReceipt",params:[this.id]})).result}))}getLastBlock(){return i(this,void 0,void 0,(function*(){const t=yield this._provider.post({method:"eth_blockNumber"});return parseInt(t.result)}))}parseLogs(){return i(this,void 0,void 0,(function*(){try{this._logs=[];const t=this._context.getContext();if(!t)return;(yield this.getTransactionReceipt()).logs.forEach((e=>{const r=t.find((t=>t.topic===e.topics[0]));if(!r)return void this._provider.log(JSON.stringify(e));const i={};i.event=r.name,i.address=e.address;const n=r.types.filter((t=>t.kind===a.MutationEventTypeKind.NORMAL)),o=r.types.filter((t=>t.kind===a.MutationEventTypeKind.INDEXED));if(n.length>0){const t=n.map((t=>t.type)),r=this._provider.encoder.decodeParameters(t,e.data);n.forEach(((t,e)=>{i[t.name]=r[e]}))}o.forEach(((t,r)=>{i[t.name]=this._provider.encoder.decodeParameters([t.type],e.topics[r+1])[0]})),this._logs.push(i)}))}catch(t){this._provider.log(t)}}))}}e.Mutation=h},1623:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.GenericProvider=void 0;const n=r(2624),o=r(6112),s=r(7533),a=r(2143),u=r(6898);class h extends s.EventEmitter{constructor(t){super(),this._id=0,this.encoder=void 0!==t.encoder?t.encoder:new n.Encoder,this.accountId=t.accountId,this.gatewayConfig=t.gatewayConfig,this.unsafeRecipientIds=t.unsafeRecipientIds,this.assetLedgerSource=t.assetLedgerSource||"https://conventions.0xcert.org/ethereum/xcert-mock.json",this.valueLedgerSource=t.valueLedgerSource||"https://conventions.0xcert.org/ethereum/token-mock.json",this.signMethod=void 0!==t.signMethod?t.signMethod:u.SignMethod.ETH_SIGN,this.requiredConfirmations=void 0!==t.requiredConfirmations?t.requiredConfirmations:1,this.mutationTimeout=void 0!==t.mutationTimeout?t.mutationTimeout:36e5,this.gasPriceMultiplier=void 0!==t.gasPriceMultiplier?t.gasPriceMultiplier:1.1,this.retryGasPriceMultiplier=void 0!==t.retryGasPriceMultiplier?t.retryGasPriceMultiplier:2,this.sandbox=void 0!==t.sandbox&&t.sandbox,this.verbose=void 0!==t.verbose&&t.verbose,this._client=t.client&&t.client.currentProvider?t.client.currentProvider:t.client}log(t){this.verbose&&console.log(t)}get accountId(){return this._accountId||null}set accountId(t){t=this.encoder.normalizeAddress(t),this.isCurrentAccount(t)||this.emit(o.ProviderEvent.ACCOUNT_CHANGE,t,this._accountId),this._accountId=t}get unsafeRecipientIds(){return this._unsafeRecipientIds||[]}set unsafeRecipientIds(t){this._unsafeRecipientIds=(t||[]).map((t=>this.encoder.normalizeAddress(t)))}get gatewayConfig(){return this._gatewayConfig}set gatewayConfig(t){this._gatewayConfig=void 0!==t?{actionsOrderId:this.encoder.normalizeAddress(t.actionsOrderId),assetLedgerDeployOrderId:this.encoder.normalizeAddress(t.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this.encoder.normalizeAddress(t.valueLedgerDeployOrderId)}:null}emit(...t){return super.emit.call(this,...t),this}on(...t){return super.on.call(this,...t),this}once(...t){return super.once.call(this,...t),this}off(t,e){return e?super.off(t,e):super.removeAllListeners(t),this}sign(t){return i(this,void 0,void 0,(function*(){if(!this.accountId)throw new Error("accountId not set.");if(this.signMethod===u.SignMethod.PERSONAL_SIGN)return(yield this.post({method:"personal_sign",params:[t,this.accountId,null]})).result;if(this.signMethod===u.SignMethod.ETH_SIGN)return(yield this.post({method:"eth_sign",params:[this.accountId,t]})).result;throw new Error("Signing method not implemented.")}))}getAvailableAccounts(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map((t=>this.encoder.normalizeAddress(t)))}))}getNetworkVersion(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"net_version",params:[]})).result}))}isCurrentAccount(t){return this.accountId===this.encoder.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.encoder.normalizeAddress(t);return!!this.unsafeRecipientIds.find((t=>t===e))}post(t){return i(this,void 0,void 0,(function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length&&(this.sandbox||void 0===e.params[0].gas)){try{const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_estimateGas"}));e.params[0].gas=`0x${Math.ceil(1.1*t.result).toString(16)}`}catch(t){if(t&&t.original&&(-32603===t.original.code||-32e3===t.original.code)){e.params.push("latest");const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_call"}));throw new o.ProviderError(o.ProviderIssue.CONTRACT_ERROR,t.result)}throw t}if(this.sandbox)return{id:null,jsonrpc:null,result:e.params[0].gas};if(void 0===e.params[0].gasPrice){const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_gasPrice",params:[]}));e.params[0].gasPrice=`0x${Math.ceil(t.result*this.gasPriceMultiplier).toString(16)}`}}return this.request(e)}))}request(t){return i(this,void 0,void 0,(function*(){const e=Object.assign({jsonrpc:"2.0",id:t.id||this.getNextId(),params:[]},t);return new Promise(((t,r)=>{this._client.send(e,((i,n)=>i?(this.log(i),r(i)):n.error?(this.log(i),r(n.error)):n.id!==e.id?r("Invalid RPC id"):t(n)))})).catch((t=>{throw new o.ProviderError(o.ProviderIssue.GENERAL,t)})).then((t=>{if("eth_call"===e.method&&t&&t.result&&-1!==t.result.indexOf("0x08c379a0")){const e=this.encoder.decodeParameters(["string"],`0x${t.result.substring(10)}`);throw a.parseError(e[0])}return t}))}))}getNextId(){return this._id++,this._id}}e.GenericProvider=h},6898:(t,e)=>{"use strict";var r,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.NetworkKind=e.MutationEventTypeKind=e.SignMethod=void 0,(n=e.SignMethod||(e.SignMethod={}))[n.ETH_SIGN=0]="ETH_SIGN",n[n.TREZOR=1]="TREZOR",n[n.NO_PREFIX=2]="NO_PREFIX",n[n.PERSONAL_SIGN=3]="PERSONAL_SIGN",(i=e.MutationEventTypeKind||(e.MutationEventTypeKind={}))[i.NORMAL=0]="NORMAL",i[i.INDEXED=1]="INDEXED",(r=e.NetworkKind||(e.NetworkKind={}))[r.LIVE=0]="LIVE",r[r.ROPSTEN=1]="ROPSTEN",r[r.RINKEBY=2]="RINKEBY"},3279:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(8330),e),n(r(677),e),n(r(2143),e),n(r(1868),e),n(r(1623),e),n(r(6898),e),n(r(2072),e)},2624:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(7203),e),n(r(881),e),n(r(1402),e),n(r(9030),e),n(r(3690),e),n(r(7170),e),n(r(3710),e),n(r(2057),e),n(r(9555),e),n(r(1389),e)},7203:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeParameters=e.encodeParameters=void 0;const i=new(r(861).AbiCoder);e.encodeParameters=function(t,e){return i.encode(t,e)},e.decodeParameters=function(t,e){return i.decode(t,e)}},1402:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.bigNumberify=e.BigNumber=void 0;const i=r(2069);var n=r(2069);Object.defineProperty(e,"BigNumber",{enumerable:!0,get:function(){return n.BigNumber}}),e.bigNumberify=function(t){return i.bigNumberify(t)}},9030:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Encoder=void 0;const i=r(861),n=r(2990);e.Encoder=class{constructor(){this.coder=new i.AbiCoder}encodeParameters(t,e){return this.coder.encode(t,e)}decodeParameters(t,e){return this.coder.decode(t,e)}normalizeAddress(t){return t?n.getAddress(t):null}}},3690:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hexToBytes=void 0,e.hexToBytes=function(t){t=t.toString(16).replace(/^0x/i,"");const e=[];for(let r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e}},7170:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.leftPad=void 0,e.leftPad=function(t,e,r,i){const n=void 0===i?/^0x/i.test(t)||"number"==typeof t:i,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+new Array(o).join(r||"0")+t}},881:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.normalizeAddress=void 0;const i=r(2990);e.normalizeAddress=function(t){return t?i.getAddress(t.toLowerCase()):null}},3710:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.rightPad=void 0,e.rightPad=function(t,e,r,i){const n=void 0===i?/^0x/i.test(t)||"number"==typeof t:i,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+t+new Array(o).join(r||"0")}},2057:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.stringToHex=void 0,e.stringToHex=function(t){let e="";for(let r=0;r<t.length;r++)e+=t.charCodeAt(r).toString(16);return e}},9555:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ZERO_ADDRESS=void 0,e.ZERO_ADDRESS="0x0000000000000000000000000000000000000000"},1389:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4508:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},1340:(t,e)=>{"use strict";var r,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.AssetLedgerCapability=e.SuperAssetLedgerAbility=e.GeneralAssetLedgerAbility=void 0,(n=e.GeneralAssetLedgerAbility||(e.GeneralAssetLedgerAbility={}))[n.CREATE_ASSET=16]="CREATE_ASSET",n[n.REVOKE_ASSET=32]="REVOKE_ASSET",n[n.TOGGLE_TRANSFERS=64]="TOGGLE_TRANSFERS",n[n.UPDATE_ASSET=128]="UPDATE_ASSET",n[n.UPDATE_URI_BASE=256]="UPDATE_URI_BASE",n[n.ALLOW_CREATE_ASSET=512]="ALLOW_CREATE_ASSET",n[n.ALLOW_UPDATE_ASSET_IMPRINT=1024]="ALLOW_UPDATE_ASSET_IMPRINT",(i=e.SuperAssetLedgerAbility||(e.SuperAssetLedgerAbility={}))[i.MANAGE_ABILITIES=1]="MANAGE_ABILITIES",i[i.ALLOW_MANAGE_ABILITIES=2]="ALLOW_MANAGE_ABILITIES",(r=e.AssetLedgerCapability||(e.AssetLedgerCapability={}))[r.DESTROY_ASSET=1]="DESTROY_ASSET",r[r.UPDATE_ASSET=2]="UPDATE_ASSET",r[r.REVOKE_ASSET=4]="REVOKE_ASSET",r[r.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"},8096:(t,e)=>{"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),e.ValueLedgerDeployOrder=e.AssetLedgerDeployOrder=e.SignedFixedActionsOrder=e.FixedActionsOrder=e.SignedDynamicActionsOrder=e.DynamicActionsOrder=e.AssetSetOperatorOrder=e.DappValueApproveOrder=e.OrderKind=e.ActionsOrderActionKind=void 0,(i=e.ActionsOrderActionKind||(e.ActionsOrderActionKind={}))[i.CREATE_ASSET=1]="CREATE_ASSET",i[i.TRANSFER_ASSET=2]="TRANSFER_ASSET",i[i.TRANSFER_VALUE=3]="TRANSFER_VALUE",i[i.UPDATE_ASSET_IMPRINT=4]="UPDATE_ASSET_IMPRINT",i[i.SET_ABILITIES=5]="SET_ABILITIES",i[i.DESTROY_ASSET=6]="DESTROY_ASSET",(r=e.OrderKind||(e.OrderKind={}))[r.ASSET_LEDGER_DEPLOY_ORDER=1]="ASSET_LEDGER_DEPLOY_ORDER",r[r.VALUE_LEDGER_DEPLOY_ORDER=2]="VALUE_LEDGER_DEPLOY_ORDER",r[r.FIXED_ACTIONS_ORDER=3]="FIXED_ACTIONS_ORDER",r[r.DYNAMIC_ACTIONS_ORDER=4]="DYNAMIC_ACTIONS_ORDER",r[r.SIGNED_FIXED_ACTIONS_ORDER=5]="SIGNED_FIXED_ACTIONS_ORDER",r[r.SIGNED_DYNAMIC_ACTIONS_ORDER=6]="SIGNED_DYNAMIC_ACTIONS_ORDER",r[r.ASSET_SET_OPERATOR_ORDER=7]="ASSET_SET_OPERATOR_ORDER",r[r.DAPP_VALUE_APPROVE_ORDER=8]="DAPP_VALUE_APPROVE_ORDER",e.DappValueApproveOrder=class{},e.AssetSetOperatorOrder=class{},e.DynamicActionsOrder=class{},e.SignedDynamicActionsOrder=class{},e.FixedActionsOrder=class{},e.SignedFixedActionsOrder=class{},e.AssetLedgerDeployOrder=class{},e.ValueLedgerDeployOrder=class{}},2503:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ProviderIssue=void 0,(r=e.ProviderIssue||(e.ProviderIssue={})).GENERAL="0",r.CONTRACT_ERROR="1",r.ACTIONS_ORDER_KIND_NOT_SUPPORTED="5000001",r.DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000002",r.FIXED_ACTIONS_ORDER_SIGNATURES="5000003",r.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000004",r.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES="5000005",r.NO_RECEIVER_ID="5000006",r.PROXY_KIND_NOT_SUPPORTED="5000007",r.SENDER_ID_NOT_A_SIGNER="5000008",r.SENDER_ID_AND_RECEIVER_ID_MISSING="5000009",r.ACTION_KIND_NOT_SUPPORTED="5000010",r.ERC20_APPROVAL_RACE_CONDITION="5000011",r.ERC20_NOT_ENOUGH_BALANCE="001001",r.ERC20_NOT_ENOUGH_ALLOWANCE="001002",r.ERC721_ZERO_ADDRESS="003001",r.ERC721_NOT_VALID_NFT="003002",r.ERC721_NOT_OWNER_OR_OPERATOR="003003",r.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR="003004",r.ERC721_NOT_ABLE_TO_RECEIVE_NFT="003005",r.ERC721_NFT_ALREADY_EXISTS="003006",r.ERC721_METADATA_ZERO_ADDRESS="004001",r.ERC721_METADATA_NOT_VALID_NFT="004002",r.ERC721_METADATA_NOT_OWNER_OR_OPERATOR="004003",r.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR="004004",r.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT="004005",r.ERC721_METADATA_NFT_ALREADY_EXISTS="004006",r.ERC721_ENUMERABLE_ZERO_ADDRESS="005001",r.ERC721_ENUMERABLE_NOT_VALID_NFT="005002",r.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR="005003",r.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="005004",r.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="005005",r.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS="005006",r.ERC721_ENUMERABLE_INVALID_INDEX="005007",r.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS="006001",r.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT="006002",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR="006003",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="006004",r.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="006005",r.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS="006006",r.ERC721_METADATA_ENUMERABLE_INVALID_INDEX="006007",r.XCERT_CAPABILITY_NOT_SUPPORTED="007001",r.XCERT_TRANSFERS_DISABLED="007002",r.XCERT_NOT_VALID_XCERT="007003",r.XCERT_NOT_OWNER_OR_OPERATOR="007004",r.XCERT_INVALID_SIGNATURE="007005",r.XCERT_INVALID_SIGNATURE_KIND="007006",r.XCERT_CLAIM_PERFORMED="007007",r.XCERT_CLAIM_EXPIRED="007008",r.XCERT_CLAIM_CANCELED="007009",r.XCERT_NOT_OWNER="007010",r.SAFE_MATH_OVERFLOW="008001",r.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND="008002",r.SAFE_MATH_DIVISION_BY_ZERO="008003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="009001",r.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="009002",r.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED="009003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE="009004",r.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED="009005",r.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="009006",r.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="009007",r.DAPP_TOKEN_NOT_ENOUGH_BALANCE="010001",r.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE="010002",r.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS="010003",r.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED="010004",r.DAPP_TOKEN_MIGRATION_STARTED="010005",r.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE="010006",r.DAPP_TOKEN_INVALID_SIGNATURE="010007",r.DAPP_TOKEN_CLAIM_PERFORMED="010008",r.DAPP_TOKEN_CLAIM_EXPIRED="010009",r.DAPP_TOKEN_INVALID_SIGNATURE_KIND="010010",r.DAPP_TOKEN_CLAIM_CANCELED="010011",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="011001",r.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="011002",r.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED="011003",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE="011004",r.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED="011005",r.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="011006",r.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="011007",r.ERC20_TRANSFER_PROXY_TRANSFER_FAILED="012001",r.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND="015001",r.ACTIONS_GATEWAY_INVALID_PROXY="015002",r.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER="015003",r.ACTIONS_GATEWAY_CLAIM_EXPIRED="015004",r.ACTIONS_GATEWAY_INVALID_SIGNATURE="015005",r.ACTIONS_GATEWAY_ORDER_CANCELED="015006",r.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED="015007",r.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER="015008",r.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY="015009",r.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY="015010",r.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY="015011",r.SIGNER_IS_NOT_DESTROY_ASSET_OWNER="015012",r.ABILITABLE_NOT_AUTHORIZED="017001",r.ABILITABLE_INVALID_INPUT="017002",r.OWNABLE_NOT_OWNER="018001",r.OWNABLE_ZERO_ADDRESS="018002",r.CLAIMABLE_NOT_PENDING_OWNER="019001"},1414:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(2503);e.default={[i.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED]:"Actions order kind not supported.",[i.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for DYNAMIC_ACTIONS_ORDER kind.",[i.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for FIXED_ACTIONS_ORDER kind.",[i.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_DYNAMIC_ACTIONS_ORDER kind.",[i.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_FIXED_ACTIONS_ORDER kind.",[i.ProviderIssue.NO_RECEIVER_ID]:"ReceiverId is not set.",[i.ProviderIssue.PROXY_KIND_NOT_SUPPORTED]:"Invalid proxy kind.",[i.ProviderIssue.SENDER_ID_NOT_A_SIGNER]:"SenderId is not a signer.",[i.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING]:"Both senderId and receiverId are missing.",[i.ProviderIssue.ACTION_KIND_NOT_SUPPORTED]:"Not implemented.",[i.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION]:"First set approval to 0. ERC-20 token potential attack.",[i.ProviderIssue.ERC20_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[i.ProviderIssue.ERC20_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[i.ProviderIssue.ERC721_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_METADATA_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_METADATA_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_METADATA_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_METADATA_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[i.ProviderIssue.XCERT_CAPABILITY_NOT_SUPPORTED]:"Asset ledger does not have capability for this action.",[i.ProviderIssue.XCERT_TRANSFERS_DISABLED]:"Transfers on this asset ledger are currently disabled.",[i.ProviderIssue.XCERT_NOT_VALID_XCERT]:"Asset with this ID does not exist.",[i.ProviderIssue.XCERT_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.XCERT_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.XCERT_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.XCERT_CLAIM_PERFORMED]:"This order was already performed.",[i.ProviderIssue.XCERT_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.XCERT_CLAIM_CANCELED]:"This order was canceled.",[i.ProviderIssue.XCERT_NOT_OWNER]:"You are not the owner of the order.",[i.ProviderIssue.SAFE_MATH_OVERFLOW]:"This action caused a math error: overflow.",[i.ProviderIssue.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND]:"This action caused a math error: subtrahend is greater than minuend.",[i.ProviderIssue.SAFE_MATH_DIVISION_BY_ZERO]:"This action caused a math error: division by zero.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[i.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[i.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[i.ProviderIssue.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS]:"Tokens cannot be sent to this recipient. Recipients are limited.",[i.ProviderIssue.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED]:"Migration is not in progress.",[i.ProviderIssue.DAPP_TOKEN_MIGRATION_STARTED]:"Migration is in progress.",[i.ProviderIssue.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE]:"Migration cannot be performed. Please notify token owner.",[i.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_PERFORMED]:"This order was already performed.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_CANCELED]:"This order was canceled.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[i.ProviderIssue.ERC20_TRANSFER_PROXY_TRANSFER_FAILED]:"Transfer failed.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_PROXY]:"Invalid proxy.",[i.ProviderIssue.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER]:"Sender is not one of the signers.",[i.ProviderIssue.ACTIONS_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.ACTIONS_GATEWAY_ORDER_CANCELED]:"This order was canceled.",[i.ProviderIssue.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER]:"Sender is not one of the signers.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY]:"Signer of CREATE_ASSET action does not have ALLOW_CREATE_ASSET ability.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY]:"Signer of UPDATE_ASSET action does not have ALLOW_UPDATE_ASSET ability.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY]:"Signer of SET_ASSET_LEDGER_ABILITY action does not have ALLOW_MANAGE_ABILITIES ability.",[i.ProviderIssue.SIGNER_IS_NOT_DESTROY_ASSET_OWNER]:"Signer of DESTROY_ASSET action is not the asset owner.",[i.ProviderIssue.ABILITABLE_NOT_AUTHORIZED]:"Sender does not have specified ability.",[i.ProviderIssue.ABILITABLE_INVALID_INPUT]:"Ability 0 is not a valid ability.",[i.ProviderIssue.OWNABLE_NOT_OWNER]:"Sender is not an owner.",[i.ProviderIssue.OWNABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.CLAIMABLE_NOT_PENDING_OWNER]:"Sender cannot claim ownership."}},8330:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.MutationEvent=void 0,(r=e.MutationEvent||(e.MutationEvent={})).COMPLETE="complete",r.CONFIRM="confirm",r.ERROR="error"},677:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ProviderError=e.ProviderEvent=void 0;const i=r(1414);var n;(n=e.ProviderEvent||(e.ProviderEvent={})).ACCOUNT_CHANGE="accountChanged",n.NETWORK_CHANGE="networkChanged";class o extends Error{constructor(t,e){super(),this.name="ProviderError",this.issue=t,this.original=e,this.message=i.default[t]||`GenericProvider error [issue: ${t}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}e.ProviderError=o},5079:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},6112:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(4508),e),n(r(677),e),n(r(1340),e),n(r(8330),e),n(r(8096),e),n(r(5079),e),n(r(2503),e)},5353:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(6496),e),n(r(509),e),n(r(9203),e),n(r(2890),e),n(r(4467),e),n(r(899),e),n(r(2938),e),n(r(7612),e)},6496:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.fetchJson=void 0,e.fetchJson=function(t,e){return i(this,void 0,void 0,(function*(){if("undefined"!=typeof window)return window.fetch(t,e).then((t=>t.json()));if(0===t.lastIndexOf("http",0))return r(9002)(t,e).then((t=>t.json()));try{return Object(function(){var t=new Error("Cannot find module 'fs'");throw t.code="MODULE_NOT_FOUND",t}()).promises.readFile(t,"utf8").then((t=>JSON.parse(t)))}catch(t){return null}}))}},9203:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.keccak256=void 0;const i=r(6395);e.keccak256=function(t){return i.keccak256(t)}},509:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.sha=void 0,e.sha=function(t,e){return i(this,void 0,void 0,(function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(e),i=yield window.crypto.subtle.digest(`SHA-${t}`,r);return Array.from(new Uint8Array(i)).map((t=>`00${t.toString(16)}`.slice(-2))).join("")}return r(1111).createHash(`sha${t}`).update(e).digest("hex")}))}},2890:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toFloat=void 0,e.toFloat=function(t){return parseFloat(`${t}`)||0}},4467:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toInteger=void 0,e.toInteger=function(t){return"number"==typeof t&&t>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof t&&!0===t?1:parseInt(`${t}`)||0}},899:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toSeconds=void 0,e.toSeconds=function(t){return parseInt(""+parseFloat(`${t}`)/1e3)||0}},2938:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toString=void 0,e.toString=function(t){return null!=t?t.toString():null}},7612:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toTuple=void 0,e.toTuple=function t(e){if(!(e instanceof Object))return[];const r=[];let i=0;return Object.keys(e).forEach((n=>{if(e[n]instanceof Object)r[i]=t(e[n]);else if(e[n]instanceof Array){let o=0;const s=[];e[n].forEach((r=>{s[o]=t(e[n]),o++})),r[i]=s}else r[i]=e[n];i++})),r}},976:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.buildGatewayConfig=void 0;const i=r(6531);e.buildGatewayConfig=function(t){switch(t){case i.NetworkKind.LIVE:return{actionsOrderId:"0x8a85cA5ED516DA0f235647222e89CEfeF85F53e4",assetLedgerDeployOrderId:"0x20337208647bB73b706D435c86F31cd5897bB24c",valueLedgerDeployOrderId:"0x9a0bB454D50c7281562cD75311412E1a7D1375AF"};case i.NetworkKind.TESTNET:return{actionsOrderId:"0x7b65B89Dd2b43229E8BD087fA1601805d571b57D",assetLedgerDeployOrderId:"0x121ab5e82cdA136e4632268956d4227696D2F5e7",valueLedgerDeployOrderId:"0xE18a943ab808B69A5da445de844932f5f267baA0"};default:throw new Error("Unsupported network kind.")}}},8279:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GenericProvider=void 0;const i=r(3279),n=r(9406);class o extends i.GenericProvider{constructor(t){super(Object.assign({encoder:void 0!==t.encoder?t.encoder:new n.Encoder,assetLedgerSource:t.assetLedgerSource||"https://conventions.0xcert.org/wanchain/xcert-mock.json",valueLedgerSource:t.valueLedgerSource||"https://conventions.0xcert.org/wanchain/token-mock.json"},t))}}e.GenericProvider=o},6531:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.NetworkKind=void 0,(r=e.NetworkKind||(e.NetworkKind={}))[r.LIVE=0]="LIVE",r[r.TESTNET=1]="TESTNET"},5411:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.parseError=e.MutationEventTypeKind=e.MutationEvent=e.MutationStatus=e.Mutation=e.SignMethod=void 0;var o=r(3279);Object.defineProperty(e,"SignMethod",{enumerable:!0,get:function(){return o.SignMethod}}),Object.defineProperty(e,"Mutation",{enumerable:!0,get:function(){return o.Mutation}}),Object.defineProperty(e,"MutationStatus",{enumerable:!0,get:function(){return o.MutationStatus}}),Object.defineProperty(e,"MutationEvent",{enumerable:!0,get:function(){return o.MutationEvent}}),Object.defineProperty(e,"MutationEventTypeKind",{enumerable:!0,get:function(){return o.MutationEventTypeKind}}),Object.defineProperty(e,"parseError",{enumerable:!0,get:function(){return o.parseError}}),n(r(8279),e),n(r(6531),e),n(r(976),e)},741:function(t,e,r){"use strict";var i=this&&this.__rest||function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]])}return r};Object.defineProperty(e,"__esModule",{value:!0}),e.HttpProvider=void 0;const n=r(5353),o=r(5411);class s extends o.GenericProvider{constructor(t){super(t),this._options=t,this._client=this}static getInstance(t){return new this(t)}isSupported(){return!!this._client.fetch}send(t,e){const r=Object.assign({url:"http://localhost:8545"},this._options),{url:o}=r,s=i(r,["url"]);return n.fetchJson(o,Object.assign(Object.assign({},s),{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})).then((t=>t)).then((t=>e(null,t))).catch((t=>e(t,null)))}}e.HttpProvider=s},5:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(5411),e),n(r(741),e)},9406:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(1793),e)},1793:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Encoder=void 0;const i=r(861);e.Encoder=class{constructor(){this.coder=new i.AbiCoder}encodeParameters(t,e){return this.coder.encode(t,e)}decodeParameters(t,e){return this.coder.decode(t,e)}normalizeAddress(t){return t?t.toLowerCase():null}}},1111:t=>{"use strict";t.exports=void 0},2574:()=>{}},e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={id:i,loaded:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(5))})();