-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsrc.395090bd.js
185 lines (180 loc) · 241 KB
/
src.395090bd.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"QVnC":[function(require,module,exports) {
var define;
var t,r=function(t){"use strict";var r,e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{u({},"")}catch(F){u=function(t,r,e){return t[r]=e}}function h(t,r,e,n){var o=r&&r.prototype instanceof g?r:g,i=Object.create(o.prototype),a=new G(n||[]);return i._invoke=function(t,r,e){var n=l;return function(o,i){if(n===p)throw new Error("Generator is already running");if(n===y){if("throw"===o)throw i;return T()}for(e.method=o,e.arg=i;;){var a=e.delegate;if(a){var c=j(a,e);if(c){if(c===v)continue;return c}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if(n===l)throw n=y,e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);n=p;var u=f(t,r,e);if("normal"===u.type){if(n=e.done?y:s,u.arg===v)continue;return{value:u.arg,done:e.done}}"throw"===u.type&&(n=y,e.method="throw",e.arg=u.arg)}}}(t,e,a),i}function f(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(F){return{type:"throw",arg:F}}}t.wrap=h;var l="suspendedStart",s="suspendedYield",p="executing",y="completed",v={};function g(){}function d(){}function m(){}var w={};u(w,i,function(){return this});var L=Object.getPrototypeOf,x=L&&L(L(N([])));x&&x!==e&&n.call(x,i)&&(w=x);var b=m.prototype=g.prototype=Object.create(w);function E(t){["next","throw","return"].forEach(function(r){u(t,r,function(t){return this._invoke(r,t)})})}function _(t,r){var e;this._invoke=function(o,i){function a(){return new r(function(e,a){!function e(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var h=u.arg,l=h.value;return l&&"object"==typeof l&&n.call(l,"__await")?r.resolve(l.__await).then(function(t){e("next",t,a,c)},function(t){e("throw",t,a,c)}):r.resolve(l).then(function(t){h.value=t,a(h)},function(t){return e("throw",t,a,c)})}c(u.arg)}(o,i,e,a)})}return e=e?e.then(a,a):a()}}function j(t,e){var n=t.iterator[e.method];if(n===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=r,j(t,e),"throw"===e.method))return v;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=f(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,v;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,v):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,v)}function O(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function k(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function N(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function e(){for(;++o<t.length;)if(n.call(t,o))return e.value=t[o],e.done=!1,e;return e.value=r,e.done=!0,e};return a.next=a}}return{next:T}}function T(){return{value:r,done:!0}}return d.prototype=m,u(b,"constructor",m),u(m,"constructor",d),d.displayName=u(m,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===d||"GeneratorFunction"===(r.displayName||r.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u(t,c,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},E(_.prototype),u(_.prototype,a,function(){return this}),t.AsyncIterator=_,t.async=function(r,e,n,o,i){void 0===i&&(i=Promise);var a=new _(h(r,e,n,o),i);return t.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},E(b),u(b,c,"Generator"),u(b,i,function(){return this}),u(b,"toString",function(){return"[object Generator]"}),t.keys=function(t){var r=[];for(var e in t)r.push(e);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,G.prototype={constructor:G,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function o(n,o){return c.type="throw",c.arg=t,e.next=n,o&&(e.method="next",e.arg=r),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),h=n.call(a,"finallyLoc");if(u&&h){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var o=this.tryEntries[e];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=r,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),v},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),k(e),v}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;k(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:N(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),v}},t}("object"==typeof module?module.exports:{});try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}
},{}],"b5MB":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.KeyStore=void 0;class e{}exports.KeyStore=e;
},{}],"rDCW":[function(require,module,exports) {
},{}],"WYSB":[function(require,module,exports) {
!function(r){"use strict";var t=function(r){var t,n=new Float64Array(16);if(r)for(t=0;t<r.length;t++)n[t]=r[t];return n},n=function(){throw new Error("no PRNG")},e=new Uint8Array(16),o=new Uint8Array(32);o[0]=9;var i=t(),h=t([1]),a=t([56129,1]),f=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),s=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),u=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),c=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),y=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function l(r,t,n,e){r[t]=n>>24&255,r[t+1]=n>>16&255,r[t+2]=n>>8&255,r[t+3]=255&n,r[t+4]=e>>24&255,r[t+5]=e>>16&255,r[t+6]=e>>8&255,r[t+7]=255&e}function w(r,t,n,e,o){var i,h=0;for(i=0;i<o;i++)h|=r[t+i]^n[e+i];return(1&h-1>>>8)-1}function v(r,t,n,e){return w(r,t,n,e,16)}function p(r,t,n,e){return w(r,t,n,e,32)}function b(r,t,n,e){!function(r,t,n,e){for(var o,i=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,s=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,u=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,y=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,w=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,v=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,p=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,b=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,g=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,A=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,_=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,U=i,d=h,E=a,x=f,M=s,m=u,B=c,S=y,k=l,K=w,Y=v,L=p,T=b,z=g,R=A,P=_,N=0;N<20;N+=2)U^=(o=(T^=(o=(k^=(o=(M^=(o=U+T|0)<<7|o>>>25)+U|0)<<9|o>>>23)+M|0)<<13|o>>>19)+k|0)<<18|o>>>14,m^=(o=(d^=(o=(z^=(o=(K^=(o=m+d|0)<<7|o>>>25)+m|0)<<9|o>>>23)+K|0)<<13|o>>>19)+z|0)<<18|o>>>14,Y^=(o=(B^=(o=(E^=(o=(R^=(o=Y+B|0)<<7|o>>>25)+Y|0)<<9|o>>>23)+R|0)<<13|o>>>19)+E|0)<<18|o>>>14,P^=(o=(L^=(o=(S^=(o=(x^=(o=P+L|0)<<7|o>>>25)+P|0)<<9|o>>>23)+x|0)<<13|o>>>19)+S|0)<<18|o>>>14,U^=(o=(x^=(o=(E^=(o=(d^=(o=U+x|0)<<7|o>>>25)+U|0)<<9|o>>>23)+d|0)<<13|o>>>19)+E|0)<<18|o>>>14,m^=(o=(M^=(o=(S^=(o=(B^=(o=m+M|0)<<7|o>>>25)+m|0)<<9|o>>>23)+B|0)<<13|o>>>19)+S|0)<<18|o>>>14,Y^=(o=(K^=(o=(k^=(o=(L^=(o=Y+K|0)<<7|o>>>25)+Y|0)<<9|o>>>23)+L|0)<<13|o>>>19)+k|0)<<18|o>>>14,P^=(o=(R^=(o=(z^=(o=(T^=(o=P+R|0)<<7|o>>>25)+P|0)<<9|o>>>23)+T|0)<<13|o>>>19)+z|0)<<18|o>>>14;U=U+i|0,d=d+h|0,E=E+a|0,x=x+f|0,M=M+s|0,m=m+u|0,B=B+c|0,S=S+y|0,k=k+l|0,K=K+w|0,Y=Y+v|0,L=L+p|0,T=T+b|0,z=z+g|0,R=R+A|0,P=P+_|0,r[0]=U>>>0&255,r[1]=U>>>8&255,r[2]=U>>>16&255,r[3]=U>>>24&255,r[4]=d>>>0&255,r[5]=d>>>8&255,r[6]=d>>>16&255,r[7]=d>>>24&255,r[8]=E>>>0&255,r[9]=E>>>8&255,r[10]=E>>>16&255,r[11]=E>>>24&255,r[12]=x>>>0&255,r[13]=x>>>8&255,r[14]=x>>>16&255,r[15]=x>>>24&255,r[16]=M>>>0&255,r[17]=M>>>8&255,r[18]=M>>>16&255,r[19]=M>>>24&255,r[20]=m>>>0&255,r[21]=m>>>8&255,r[22]=m>>>16&255,r[23]=m>>>24&255,r[24]=B>>>0&255,r[25]=B>>>8&255,r[26]=B>>>16&255,r[27]=B>>>24&255,r[28]=S>>>0&255,r[29]=S>>>8&255,r[30]=S>>>16&255,r[31]=S>>>24&255,r[32]=k>>>0&255,r[33]=k>>>8&255,r[34]=k>>>16&255,r[35]=k>>>24&255,r[36]=K>>>0&255,r[37]=K>>>8&255,r[38]=K>>>16&255,r[39]=K>>>24&255,r[40]=Y>>>0&255,r[41]=Y>>>8&255,r[42]=Y>>>16&255,r[43]=Y>>>24&255,r[44]=L>>>0&255,r[45]=L>>>8&255,r[46]=L>>>16&255,r[47]=L>>>24&255,r[48]=T>>>0&255,r[49]=T>>>8&255,r[50]=T>>>16&255,r[51]=T>>>24&255,r[52]=z>>>0&255,r[53]=z>>>8&255,r[54]=z>>>16&255,r[55]=z>>>24&255,r[56]=R>>>0&255,r[57]=R>>>8&255,r[58]=R>>>16&255,r[59]=R>>>24&255,r[60]=P>>>0&255,r[61]=P>>>8&255,r[62]=P>>>16&255,r[63]=P>>>24&255}(r,t,n,e)}function g(r,t,n,e){!function(r,t,n,e){for(var o,i=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,s=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,u=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,y=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,w=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,v=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,p=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,b=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,g=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,A=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,_=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,U=0;U<20;U+=2)i^=(o=(b^=(o=(l^=(o=(s^=(o=i+b|0)<<7|o>>>25)+i|0)<<9|o>>>23)+s|0)<<13|o>>>19)+l|0)<<18|o>>>14,u^=(o=(h^=(o=(g^=(o=(w^=(o=u+h|0)<<7|o>>>25)+u|0)<<9|o>>>23)+w|0)<<13|o>>>19)+g|0)<<18|o>>>14,v^=(o=(c^=(o=(a^=(o=(A^=(o=v+c|0)<<7|o>>>25)+v|0)<<9|o>>>23)+A|0)<<13|o>>>19)+a|0)<<18|o>>>14,_^=(o=(p^=(o=(y^=(o=(f^=(o=_+p|0)<<7|o>>>25)+_|0)<<9|o>>>23)+f|0)<<13|o>>>19)+y|0)<<18|o>>>14,i^=(o=(f^=(o=(a^=(o=(h^=(o=i+f|0)<<7|o>>>25)+i|0)<<9|o>>>23)+h|0)<<13|o>>>19)+a|0)<<18|o>>>14,u^=(o=(s^=(o=(y^=(o=(c^=(o=u+s|0)<<7|o>>>25)+u|0)<<9|o>>>23)+c|0)<<13|o>>>19)+y|0)<<18|o>>>14,v^=(o=(w^=(o=(l^=(o=(p^=(o=v+w|0)<<7|o>>>25)+v|0)<<9|o>>>23)+p|0)<<13|o>>>19)+l|0)<<18|o>>>14,_^=(o=(A^=(o=(g^=(o=(b^=(o=_+A|0)<<7|o>>>25)+_|0)<<9|o>>>23)+b|0)<<13|o>>>19)+g|0)<<18|o>>>14;r[0]=i>>>0&255,r[1]=i>>>8&255,r[2]=i>>>16&255,r[3]=i>>>24&255,r[4]=u>>>0&255,r[5]=u>>>8&255,r[6]=u>>>16&255,r[7]=u>>>24&255,r[8]=v>>>0&255,r[9]=v>>>8&255,r[10]=v>>>16&255,r[11]=v>>>24&255,r[12]=_>>>0&255,r[13]=_>>>8&255,r[14]=_>>>16&255,r[15]=_>>>24&255,r[16]=c>>>0&255,r[17]=c>>>8&255,r[18]=c>>>16&255,r[19]=c>>>24&255,r[20]=y>>>0&255,r[21]=y>>>8&255,r[22]=y>>>16&255,r[23]=y>>>24&255,r[24]=l>>>0&255,r[25]=l>>>8&255,r[26]=l>>>16&255,r[27]=l>>>24&255,r[28]=w>>>0&255,r[29]=w>>>8&255,r[30]=w>>>16&255,r[31]=w>>>24&255}(r,t,n,e)}var A=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function _(r,t,n,e,o,i,h){var a,f,s=new Uint8Array(16),u=new Uint8Array(64);for(f=0;f<16;f++)s[f]=0;for(f=0;f<8;f++)s[f]=i[f];for(;o>=64;){for(b(u,s,h,A),f=0;f<64;f++)r[t+f]=n[e+f]^u[f];for(a=1,f=8;f<16;f++)a=a+(255&s[f])|0,s[f]=255&a,a>>>=8;o-=64,t+=64,e+=64}if(o>0)for(b(u,s,h,A),f=0;f<o;f++)r[t+f]=n[e+f]^u[f];return 0}function U(r,t,n,e,o){var i,h,a=new Uint8Array(16),f=new Uint8Array(64);for(h=0;h<16;h++)a[h]=0;for(h=0;h<8;h++)a[h]=e[h];for(;n>=64;){for(b(f,a,o,A),h=0;h<64;h++)r[t+h]=f[h];for(i=1,h=8;h<16;h++)i=i+(255&a[h])|0,a[h]=255&i,i>>>=8;n-=64,t+=64}if(n>0)for(b(f,a,o,A),h=0;h<n;h++)r[t+h]=f[h];return 0}function d(r,t,n,e,o){var i=new Uint8Array(32);g(i,e,o,A);for(var h=new Uint8Array(8),a=0;a<8;a++)h[a]=e[a+16];return U(r,t,n,h,i)}function E(r,t,n,e,o,i,h){var a=new Uint8Array(32);g(a,i,h,A);for(var f=new Uint8Array(8),s=0;s<8;s++)f[s]=i[s+16];return _(r,t,n,e,o,f,a)}var x=function(r){var t,n,e,o,i,h,a,f;this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0,t=255&r[0]|(255&r[1])<<8,this.r[0]=8191&t,n=255&r[2]|(255&r[3])<<8,this.r[1]=8191&(t>>>13|n<<3),e=255&r[4]|(255&r[5])<<8,this.r[2]=7939&(n>>>10|e<<6),o=255&r[6]|(255&r[7])<<8,this.r[3]=8191&(e>>>7|o<<9),i=255&r[8]|(255&r[9])<<8,this.r[4]=255&(o>>>4|i<<12),this.r[5]=i>>>1&8190,h=255&r[10]|(255&r[11])<<8,this.r[6]=8191&(i>>>14|h<<2),a=255&r[12]|(255&r[13])<<8,this.r[7]=8065&(h>>>11|a<<5),f=255&r[14]|(255&r[15])<<8,this.r[8]=8191&(a>>>8|f<<8),this.r[9]=f>>>5&127,this.pad[0]=255&r[16]|(255&r[17])<<8,this.pad[1]=255&r[18]|(255&r[19])<<8,this.pad[2]=255&r[20]|(255&r[21])<<8,this.pad[3]=255&r[22]|(255&r[23])<<8,this.pad[4]=255&r[24]|(255&r[25])<<8,this.pad[5]=255&r[26]|(255&r[27])<<8,this.pad[6]=255&r[28]|(255&r[29])<<8,this.pad[7]=255&r[30]|(255&r[31])<<8};function M(r,t,n,e,o,i){var h=new x(i);return h.update(n,e,o),h.finish(r,t),0}function m(r,t,n,e,o,i){var h=new Uint8Array(16);return M(h,0,n,e,o,i),v(r,t,h,0)}function B(r,t,n,e,o){var i;if(n<32)return-1;for(E(r,0,t,0,n,e,o),M(r,16,r,32,n-32,r),i=0;i<16;i++)r[i]=0;return 0}function S(r,t,n,e,o){var i,h=new Uint8Array(32);if(n<32)return-1;if(d(h,0,32,e,o),0!==m(t,16,t,32,n-32,h))return-1;for(E(r,0,t,0,n,e,o),i=0;i<32;i++)r[i]=0;return 0}function k(r,t){var n;for(n=0;n<16;n++)r[n]=0|t[n]}function K(r){var t,n,e=1;for(t=0;t<16;t++)n=r[t]+e+65535,e=Math.floor(n/65536),r[t]=n-65536*e;r[0]+=e-1+37*(e-1)}function Y(r,t,n){for(var e,o=~(n-1),i=0;i<16;i++)e=o&(r[i]^t[i]),r[i]^=e,t[i]^=e}function L(r,n){var e,o,i,h=t(),a=t();for(e=0;e<16;e++)a[e]=n[e];for(K(a),K(a),K(a),o=0;o<2;o++){for(h[0]=a[0]-65517,e=1;e<15;e++)h[e]=a[e]-65535-(h[e-1]>>16&1),h[e-1]&=65535;h[15]=a[15]-32767-(h[14]>>16&1),i=h[15]>>16&1,h[14]&=65535,Y(a,h,1-i)}for(e=0;e<16;e++)r[2*e]=255&a[e],r[2*e+1]=a[e]>>8}function T(r,t){var n=new Uint8Array(32),e=new Uint8Array(32);return L(n,r),L(e,t),p(n,0,e,0)}function z(r){var t=new Uint8Array(32);return L(t,r),1&t[0]}function R(r,t){var n;for(n=0;n<16;n++)r[n]=t[2*n]+(t[2*n+1]<<8);r[15]&=32767}function P(r,t,n){for(var e=0;e<16;e++)r[e]=t[e]+n[e]}function N(r,t,n){for(var e=0;e<16;e++)r[e]=t[e]-n[e]}function O(r,t,n){var e,o,i=0,h=0,a=0,f=0,s=0,u=0,c=0,y=0,l=0,w=0,v=0,p=0,b=0,g=0,A=0,_=0,U=0,d=0,E=0,x=0,M=0,m=0,B=0,S=0,k=0,K=0,Y=0,L=0,T=0,z=0,R=0,P=n[0],N=n[1],O=n[2],C=n[3],F=n[4],I=n[5],Z=n[6],G=n[7],q=n[8],D=n[9],V=n[10],X=n[11],j=n[12],H=n[13],J=n[14],Q=n[15];i+=(e=t[0])*P,h+=e*N,a+=e*O,f+=e*C,s+=e*F,u+=e*I,c+=e*Z,y+=e*G,l+=e*q,w+=e*D,v+=e*V,p+=e*X,b+=e*j,g+=e*H,A+=e*J,_+=e*Q,h+=(e=t[1])*P,a+=e*N,f+=e*O,s+=e*C,u+=e*F,c+=e*I,y+=e*Z,l+=e*G,w+=e*q,v+=e*D,p+=e*V,b+=e*X,g+=e*j,A+=e*H,_+=e*J,U+=e*Q,a+=(e=t[2])*P,f+=e*N,s+=e*O,u+=e*C,c+=e*F,y+=e*I,l+=e*Z,w+=e*G,v+=e*q,p+=e*D,b+=e*V,g+=e*X,A+=e*j,_+=e*H,U+=e*J,d+=e*Q,f+=(e=t[3])*P,s+=e*N,u+=e*O,c+=e*C,y+=e*F,l+=e*I,w+=e*Z,v+=e*G,p+=e*q,b+=e*D,g+=e*V,A+=e*X,_+=e*j,U+=e*H,d+=e*J,E+=e*Q,s+=(e=t[4])*P,u+=e*N,c+=e*O,y+=e*C,l+=e*F,w+=e*I,v+=e*Z,p+=e*G,b+=e*q,g+=e*D,A+=e*V,_+=e*X,U+=e*j,d+=e*H,E+=e*J,x+=e*Q,u+=(e=t[5])*P,c+=e*N,y+=e*O,l+=e*C,w+=e*F,v+=e*I,p+=e*Z,b+=e*G,g+=e*q,A+=e*D,_+=e*V,U+=e*X,d+=e*j,E+=e*H,x+=e*J,M+=e*Q,c+=(e=t[6])*P,y+=e*N,l+=e*O,w+=e*C,v+=e*F,p+=e*I,b+=e*Z,g+=e*G,A+=e*q,_+=e*D,U+=e*V,d+=e*X,E+=e*j,x+=e*H,M+=e*J,m+=e*Q,y+=(e=t[7])*P,l+=e*N,w+=e*O,v+=e*C,p+=e*F,b+=e*I,g+=e*Z,A+=e*G,_+=e*q,U+=e*D,d+=e*V,E+=e*X,x+=e*j,M+=e*H,m+=e*J,B+=e*Q,l+=(e=t[8])*P,w+=e*N,v+=e*O,p+=e*C,b+=e*F,g+=e*I,A+=e*Z,_+=e*G,U+=e*q,d+=e*D,E+=e*V,x+=e*X,M+=e*j,m+=e*H,B+=e*J,S+=e*Q,w+=(e=t[9])*P,v+=e*N,p+=e*O,b+=e*C,g+=e*F,A+=e*I,_+=e*Z,U+=e*G,d+=e*q,E+=e*D,x+=e*V,M+=e*X,m+=e*j,B+=e*H,S+=e*J,k+=e*Q,v+=(e=t[10])*P,p+=e*N,b+=e*O,g+=e*C,A+=e*F,_+=e*I,U+=e*Z,d+=e*G,E+=e*q,x+=e*D,M+=e*V,m+=e*X,B+=e*j,S+=e*H,k+=e*J,K+=e*Q,p+=(e=t[11])*P,b+=e*N,g+=e*O,A+=e*C,_+=e*F,U+=e*I,d+=e*Z,E+=e*G,x+=e*q,M+=e*D,m+=e*V,B+=e*X,S+=e*j,k+=e*H,K+=e*J,Y+=e*Q,b+=(e=t[12])*P,g+=e*N,A+=e*O,_+=e*C,U+=e*F,d+=e*I,E+=e*Z,x+=e*G,M+=e*q,m+=e*D,B+=e*V,S+=e*X,k+=e*j,K+=e*H,Y+=e*J,L+=e*Q,g+=(e=t[13])*P,A+=e*N,_+=e*O,U+=e*C,d+=e*F,E+=e*I,x+=e*Z,M+=e*G,m+=e*q,B+=e*D,S+=e*V,k+=e*X,K+=e*j,Y+=e*H,L+=e*J,T+=e*Q,A+=(e=t[14])*P,_+=e*N,U+=e*O,d+=e*C,E+=e*F,x+=e*I,M+=e*Z,m+=e*G,B+=e*q,S+=e*D,k+=e*V,K+=e*X,Y+=e*j,L+=e*H,T+=e*J,z+=e*Q,_+=(e=t[15])*P,h+=38*(d+=e*O),a+=38*(E+=e*C),f+=38*(x+=e*F),s+=38*(M+=e*I),u+=38*(m+=e*Z),c+=38*(B+=e*G),y+=38*(S+=e*q),l+=38*(k+=e*D),w+=38*(K+=e*V),v+=38*(Y+=e*X),p+=38*(L+=e*j),b+=38*(T+=e*H),g+=38*(z+=e*J),A+=38*(R+=e*Q),i=(e=(i+=38*(U+=e*N))+(o=1)+65535)-65536*(o=Math.floor(e/65536)),h=(e=h+o+65535)-65536*(o=Math.floor(e/65536)),a=(e=a+o+65535)-65536*(o=Math.floor(e/65536)),f=(e=f+o+65535)-65536*(o=Math.floor(e/65536)),s=(e=s+o+65535)-65536*(o=Math.floor(e/65536)),u=(e=u+o+65535)-65536*(o=Math.floor(e/65536)),c=(e=c+o+65535)-65536*(o=Math.floor(e/65536)),y=(e=y+o+65535)-65536*(o=Math.floor(e/65536)),l=(e=l+o+65535)-65536*(o=Math.floor(e/65536)),w=(e=w+o+65535)-65536*(o=Math.floor(e/65536)),v=(e=v+o+65535)-65536*(o=Math.floor(e/65536)),p=(e=p+o+65535)-65536*(o=Math.floor(e/65536)),b=(e=b+o+65535)-65536*(o=Math.floor(e/65536)),g=(e=g+o+65535)-65536*(o=Math.floor(e/65536)),A=(e=A+o+65535)-65536*(o=Math.floor(e/65536)),_=(e=_+o+65535)-65536*(o=Math.floor(e/65536)),i=(e=(i+=o-1+37*(o-1))+(o=1)+65535)-65536*(o=Math.floor(e/65536)),h=(e=h+o+65535)-65536*(o=Math.floor(e/65536)),a=(e=a+o+65535)-65536*(o=Math.floor(e/65536)),f=(e=f+o+65535)-65536*(o=Math.floor(e/65536)),s=(e=s+o+65535)-65536*(o=Math.floor(e/65536)),u=(e=u+o+65535)-65536*(o=Math.floor(e/65536)),c=(e=c+o+65535)-65536*(o=Math.floor(e/65536)),y=(e=y+o+65535)-65536*(o=Math.floor(e/65536)),l=(e=l+o+65535)-65536*(o=Math.floor(e/65536)),w=(e=w+o+65535)-65536*(o=Math.floor(e/65536)),v=(e=v+o+65535)-65536*(o=Math.floor(e/65536)),p=(e=p+o+65535)-65536*(o=Math.floor(e/65536)),b=(e=b+o+65535)-65536*(o=Math.floor(e/65536)),g=(e=g+o+65535)-65536*(o=Math.floor(e/65536)),A=(e=A+o+65535)-65536*(o=Math.floor(e/65536)),_=(e=_+o+65535)-65536*(o=Math.floor(e/65536)),i+=o-1+37*(o-1),r[0]=i,r[1]=h,r[2]=a,r[3]=f,r[4]=s,r[5]=u,r[6]=c,r[7]=y,r[8]=l,r[9]=w,r[10]=v,r[11]=p,r[12]=b,r[13]=g,r[14]=A,r[15]=_}function C(r,t){O(r,t,t)}function F(r,n){var e,o=t();for(e=0;e<16;e++)o[e]=n[e];for(e=253;e>=0;e--)C(o,o),2!==e&&4!==e&&O(o,o,n);for(e=0;e<16;e++)r[e]=o[e]}function I(r,n){var e,o=t();for(e=0;e<16;e++)o[e]=n[e];for(e=250;e>=0;e--)C(o,o),1!==e&&O(o,o,n);for(e=0;e<16;e++)r[e]=o[e]}function Z(r,n,e){var o,i,h=new Uint8Array(32),f=new Float64Array(80),s=t(),u=t(),c=t(),y=t(),l=t(),w=t();for(i=0;i<31;i++)h[i]=n[i];for(h[31]=127&n[31]|64,h[0]&=248,R(f,e),i=0;i<16;i++)u[i]=f[i],y[i]=s[i]=c[i]=0;for(s[0]=y[0]=1,i=254;i>=0;--i)Y(s,u,o=h[i>>>3]>>>(7&i)&1),Y(c,y,o),P(l,s,c),N(s,s,c),P(c,u,y),N(u,u,y),C(y,l),C(w,s),O(s,c,s),O(c,u,l),P(l,s,c),N(s,s,c),C(u,s),N(c,y,w),O(s,c,a),P(s,s,y),O(c,c,s),O(s,y,w),O(y,u,f),C(u,l),Y(s,u,o),Y(c,y,o);for(i=0;i<16;i++)f[i+16]=s[i],f[i+32]=c[i],f[i+48]=u[i],f[i+64]=y[i];var v=f.subarray(32),p=f.subarray(16);return F(v,v),O(p,p,v),L(r,p),0}function G(r,t){return Z(r,t,o)}function q(r,t){return n(t,32),G(r,t)}function D(r,t,n){var o=new Uint8Array(32);return Z(o,n,t),g(r,e,o,A)}x.prototype.blocks=function(r,t,n){for(var e,o,i,h,a,f,s,u,c,y,l,w,v,p,b,g,A,_,U,d=this.fin?0:2048,E=this.h[0],x=this.h[1],M=this.h[2],m=this.h[3],B=this.h[4],S=this.h[5],k=this.h[6],K=this.h[7],Y=this.h[8],L=this.h[9],T=this.r[0],z=this.r[1],R=this.r[2],P=this.r[3],N=this.r[4],O=this.r[5],C=this.r[6],F=this.r[7],I=this.r[8],Z=this.r[9];n>=16;)y=c=0,y+=(E+=8191&(e=255&r[t+0]|(255&r[t+1])<<8))*T,y+=(x+=8191&(e>>>13|(o=255&r[t+2]|(255&r[t+3])<<8)<<3))*(5*Z),y+=(M+=8191&(o>>>10|(i=255&r[t+4]|(255&r[t+5])<<8)<<6))*(5*I),y+=(m+=8191&(i>>>7|(h=255&r[t+6]|(255&r[t+7])<<8)<<9))*(5*F),c=(y+=(B+=8191&(h>>>4|(a=255&r[t+8]|(255&r[t+9])<<8)<<12))*(5*C))>>>13,y&=8191,y+=(S+=a>>>1&8191)*(5*O),y+=(k+=8191&(a>>>14|(f=255&r[t+10]|(255&r[t+11])<<8)<<2))*(5*N),y+=(K+=8191&(f>>>11|(s=255&r[t+12]|(255&r[t+13])<<8)<<5))*(5*P),y+=(Y+=8191&(s>>>8|(u=255&r[t+14]|(255&r[t+15])<<8)<<8))*(5*R),l=c+=(y+=(L+=u>>>5|d)*(5*z))>>>13,l+=E*z,l+=x*T,l+=M*(5*Z),l+=m*(5*I),c=(l+=B*(5*F))>>>13,l&=8191,l+=S*(5*C),l+=k*(5*O),l+=K*(5*N),l+=Y*(5*P),c+=(l+=L*(5*R))>>>13,l&=8191,w=c,w+=E*R,w+=x*z,w+=M*T,w+=m*(5*Z),c=(w+=B*(5*I))>>>13,w&=8191,w+=S*(5*F),w+=k*(5*C),w+=K*(5*O),w+=Y*(5*N),v=c+=(w+=L*(5*P))>>>13,v+=E*P,v+=x*R,v+=M*z,v+=m*T,c=(v+=B*(5*Z))>>>13,v&=8191,v+=S*(5*I),v+=k*(5*F),v+=K*(5*C),v+=Y*(5*O),p=c+=(v+=L*(5*N))>>>13,p+=E*N,p+=x*P,p+=M*R,p+=m*z,c=(p+=B*T)>>>13,p&=8191,p+=S*(5*Z),p+=k*(5*I),p+=K*(5*F),p+=Y*(5*C),b=c+=(p+=L*(5*O))>>>13,b+=E*O,b+=x*N,b+=M*P,b+=m*R,c=(b+=B*z)>>>13,b&=8191,b+=S*T,b+=k*(5*Z),b+=K*(5*I),b+=Y*(5*F),g=c+=(b+=L*(5*C))>>>13,g+=E*C,g+=x*O,g+=M*N,g+=m*P,c=(g+=B*R)>>>13,g&=8191,g+=S*z,g+=k*T,g+=K*(5*Z),g+=Y*(5*I),A=c+=(g+=L*(5*F))>>>13,A+=E*F,A+=x*C,A+=M*O,A+=m*N,c=(A+=B*P)>>>13,A&=8191,A+=S*R,A+=k*z,A+=K*T,A+=Y*(5*Z),_=c+=(A+=L*(5*I))>>>13,_+=E*I,_+=x*F,_+=M*C,_+=m*O,c=(_+=B*N)>>>13,_&=8191,_+=S*P,_+=k*R,_+=K*z,_+=Y*T,U=c+=(_+=L*(5*Z))>>>13,U+=E*Z,U+=x*I,U+=M*F,U+=m*C,c=(U+=B*O)>>>13,U&=8191,U+=S*N,U+=k*P,U+=K*R,U+=Y*z,E=y=8191&(c=(c=((c+=(U+=L*T)>>>13)<<2)+c|0)+(y&=8191)|0),x=l+=c>>>=13,M=w&=8191,m=v&=8191,B=p&=8191,S=b&=8191,k=g&=8191,K=A&=8191,Y=_&=8191,L=U&=8191,t+=16,n-=16;this.h[0]=E,this.h[1]=x,this.h[2]=M,this.h[3]=m,this.h[4]=B,this.h[5]=S,this.h[6]=k,this.h[7]=K,this.h[8]=Y,this.h[9]=L},x.prototype.finish=function(r,t){var n,e,o,i,h=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=n,n=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,h[0]=this.h[0]+5,n=h[0]>>>13,h[0]&=8191,i=1;i<10;i++)h[i]=this.h[i]+n,n=h[i]>>>13,h[i]&=8191;for(h[9]-=8192,e=(1^n)-1,i=0;i<10;i++)h[i]&=e;for(e=~e,i=0;i<10;i++)this.h[i]=this.h[i]&e|h[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),o=this.h[0]+this.pad[0],this.h[0]=65535&o,i=1;i<8;i++)o=(this.h[i]+this.pad[i]|0)+(o>>>16)|0,this.h[i]=65535&o;r[t+0]=this.h[0]>>>0&255,r[t+1]=this.h[0]>>>8&255,r[t+2]=this.h[1]>>>0&255,r[t+3]=this.h[1]>>>8&255,r[t+4]=this.h[2]>>>0&255,r[t+5]=this.h[2]>>>8&255,r[t+6]=this.h[3]>>>0&255,r[t+7]=this.h[3]>>>8&255,r[t+8]=this.h[4]>>>0&255,r[t+9]=this.h[4]>>>8&255,r[t+10]=this.h[5]>>>0&255,r[t+11]=this.h[5]>>>8&255,r[t+12]=this.h[6]>>>0&255,r[t+13]=this.h[6]>>>8&255,r[t+14]=this.h[7]>>>0&255,r[t+15]=this.h[7]>>>8&255},x.prototype.update=function(r,t,n){var e,o;if(this.leftover){for((o=16-this.leftover)>n&&(o=n),e=0;e<o;e++)this.buffer[this.leftover+e]=r[t+e];if(n-=o,t+=o,this.leftover+=o,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(n>=16&&(o=n-n%16,this.blocks(r,t,o),t+=o,n-=o),n){for(e=0;e<n;e++)this.buffer[this.leftover+e]=r[t+e];this.leftover+=n}};var V=B,X=S;var j=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function H(r,t,n,e){for(var o,i,h,a,f,s,u,c,y,l,w,v,p,b,g,A,_,U,d,E,x,M,m,B,S,k,K=new Int32Array(16),Y=new Int32Array(16),L=r[0],T=r[1],z=r[2],R=r[3],P=r[4],N=r[5],O=r[6],C=r[7],F=t[0],I=t[1],Z=t[2],G=t[3],q=t[4],D=t[5],V=t[6],X=t[7],H=0;e>=128;){for(d=0;d<16;d++)E=8*d+H,K[d]=n[E+0]<<24|n[E+1]<<16|n[E+2]<<8|n[E+3],Y[d]=n[E+4]<<24|n[E+5]<<16|n[E+6]<<8|n[E+7];for(d=0;d<80;d++)if(o=L,i=T,h=z,a=R,f=P,s=N,u=O,C,y=F,l=I,w=Z,v=G,p=q,b=D,g=V,X,m=65535&(M=X),B=M>>>16,S=65535&(x=C),k=x>>>16,m+=65535&(M=(q>>>14|P<<18)^(q>>>18|P<<14)^(P>>>9|q<<23)),B+=M>>>16,S+=65535&(x=(P>>>14|q<<18)^(P>>>18|q<<14)^(q>>>9|P<<23)),k+=x>>>16,m+=65535&(M=q&D^~q&V),B+=M>>>16,S+=65535&(x=P&N^~P&O),k+=x>>>16,x=j[2*d],m+=65535&(M=j[2*d+1]),B+=M>>>16,S+=65535&x,k+=x>>>16,x=K[d%16],B+=(M=Y[d%16])>>>16,S+=65535&x,k+=x>>>16,S+=(B+=(m+=65535&M)>>>16)>>>16,m=65535&(M=U=65535&m|B<<16),B=M>>>16,S=65535&(x=_=65535&S|(k+=S>>>16)<<16),k=x>>>16,m+=65535&(M=(F>>>28|L<<4)^(L>>>2|F<<30)^(L>>>7|F<<25)),B+=M>>>16,S+=65535&(x=(L>>>28|F<<4)^(F>>>2|L<<30)^(F>>>7|L<<25)),k+=x>>>16,B+=(M=F&I^F&Z^I&Z)>>>16,S+=65535&(x=L&T^L&z^T&z),k+=x>>>16,c=65535&(S+=(B+=(m+=65535&M)>>>16)>>>16)|(k+=S>>>16)<<16,A=65535&m|B<<16,m=65535&(M=v),B=M>>>16,S=65535&(x=a),k=x>>>16,B+=(M=U)>>>16,S+=65535&(x=_),k+=x>>>16,T=o,z=i,R=h,P=a=65535&(S+=(B+=(m+=65535&M)>>>16)>>>16)|(k+=S>>>16)<<16,N=f,O=s,C=u,L=c,I=y,Z=l,G=w,q=v=65535&m|B<<16,D=p,V=b,X=g,F=A,d%16==15)for(E=0;E<16;E++)x=K[E],m=65535&(M=Y[E]),B=M>>>16,S=65535&x,k=x>>>16,x=K[(E+9)%16],m+=65535&(M=Y[(E+9)%16]),B+=M>>>16,S+=65535&x,k+=x>>>16,_=K[(E+1)%16],m+=65535&(M=((U=Y[(E+1)%16])>>>1|_<<31)^(U>>>8|_<<24)^(U>>>7|_<<25)),B+=M>>>16,S+=65535&(x=(_>>>1|U<<31)^(_>>>8|U<<24)^_>>>7),k+=x>>>16,_=K[(E+14)%16],B+=(M=((U=Y[(E+14)%16])>>>19|_<<13)^(_>>>29|U<<3)^(U>>>6|_<<26))>>>16,S+=65535&(x=(_>>>19|U<<13)^(U>>>29|_<<3)^_>>>6),k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,K[E]=65535&S|k<<16,Y[E]=65535&m|B<<16;m=65535&(M=F),B=M>>>16,S=65535&(x=L),k=x>>>16,x=r[0],B+=(M=t[0])>>>16,S+=65535&x,k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[0]=L=65535&S|k<<16,t[0]=F=65535&m|B<<16,m=65535&(M=I),B=M>>>16,S=65535&(x=T),k=x>>>16,x=r[1],B+=(M=t[1])>>>16,S+=65535&x,k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[1]=T=65535&S|k<<16,t[1]=I=65535&m|B<<16,m=65535&(M=Z),B=M>>>16,S=65535&(x=z),k=x>>>16,x=r[2],B+=(M=t[2])>>>16,S+=65535&x,k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[2]=z=65535&S|k<<16,t[2]=Z=65535&m|B<<16,m=65535&(M=G),B=M>>>16,S=65535&(x=R),k=x>>>16,x=r[3],B+=(M=t[3])>>>16,S+=65535&x,k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[3]=R=65535&S|k<<16,t[3]=G=65535&m|B<<16,m=65535&(M=q),B=M>>>16,S=65535&(x=P),k=x>>>16,x=r[4],B+=(M=t[4])>>>16,S+=65535&x,k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[4]=P=65535&S|k<<16,t[4]=q=65535&m|B<<16,m=65535&(M=D),B=M>>>16,S=65535&(x=N),k=x>>>16,x=r[5],B+=(M=t[5])>>>16,S+=65535&x,k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[5]=N=65535&S|k<<16,t[5]=D=65535&m|B<<16,m=65535&(M=V),B=M>>>16,S=65535&(x=O),k=x>>>16,x=r[6],B+=(M=t[6])>>>16,S+=65535&x,k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[6]=O=65535&S|k<<16,t[6]=V=65535&m|B<<16,m=65535&(M=X),B=M>>>16,S=65535&(x=C),k=x>>>16,x=r[7],B+=(M=t[7])>>>16,S+=65535&x,k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[7]=C=65535&S|k<<16,t[7]=X=65535&m|B<<16,H+=128,e-=128}return e}function J(r,t,n){var e,o=new Int32Array(8),i=new Int32Array(8),h=new Uint8Array(256),a=n;for(o[0]=1779033703,o[1]=3144134277,o[2]=1013904242,o[3]=2773480762,o[4]=1359893119,o[5]=2600822924,o[6]=528734635,o[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,H(o,i,t,n),n%=128,e=0;e<n;e++)h[e]=t[a-n+e];for(h[n]=128,h[(n=256-128*(n<112?1:0))-9]=0,l(h,n-8,a/536870912|0,a<<3),H(o,i,h,n),e=0;e<8;e++)l(r,8*e,o[e],i[e]);return 0}function Q(r,n){var e=t(),o=t(),i=t(),h=t(),a=t(),f=t(),u=t(),c=t(),y=t();N(e,r[1],r[0]),N(y,n[1],n[0]),O(e,e,y),P(o,r[0],r[1]),P(y,n[0],n[1]),O(o,o,y),O(i,r[3],n[3]),O(i,i,s),O(h,r[2],n[2]),P(h,h,h),N(a,o,e),N(f,h,i),P(u,h,i),P(c,o,e),O(r[0],a,f),O(r[1],c,u),O(r[2],u,f),O(r[3],a,c)}function W(r,t,n){var e;for(e=0;e<4;e++)Y(r[e],t[e],n)}function $(r,n){var e=t(),o=t(),i=t();F(i,n[2]),O(e,n[0],i),O(o,n[1],i),L(r,o),r[31]^=z(e)<<7}function rr(r,t,n){var e,o;for(k(r[0],i),k(r[1],h),k(r[2],h),k(r[3],i),o=255;o>=0;--o)W(r,t,e=n[o/8|0]>>(7&o)&1),Q(t,r),Q(r,r),W(r,t,e)}function tr(r,n){var e=[t(),t(),t(),t()];k(e[0],u),k(e[1],c),k(e[2],h),O(e[3],u,c),rr(r,e,n)}function nr(r,e,o){var i,h=new Uint8Array(64),a=[t(),t(),t(),t()];for(o||n(e,32),J(h,e,32),h[0]&=248,h[31]&=127,h[31]|=64,tr(a,h),$(r,a),i=0;i<32;i++)e[i+32]=r[i];return 0}var er=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function or(r,t){var n,e,o,i;for(e=63;e>=32;--e){for(n=0,o=e-32,i=e-12;o<i;++o)t[o]+=n-16*t[e]*er[o-(e-32)],n=Math.floor((t[o]+128)/256),t[o]-=256*n;t[o]+=n,t[e]=0}for(n=0,o=0;o<32;o++)t[o]+=n-(t[31]>>4)*er[o],n=t[o]>>8,t[o]&=255;for(o=0;o<32;o++)t[o]-=n*er[o];for(e=0;e<32;e++)t[e+1]+=t[e]>>8,r[e]=255&t[e]}function ir(r){var t,n=new Float64Array(64);for(t=0;t<64;t++)n[t]=r[t];for(t=0;t<64;t++)r[t]=0;or(r,n)}function hr(r,n,e,o){var i,h,a=new Uint8Array(64),f=new Uint8Array(64),s=new Uint8Array(64),u=new Float64Array(64),c=[t(),t(),t(),t()];J(a,o,32),a[0]&=248,a[31]&=127,a[31]|=64;var y=e+64;for(i=0;i<e;i++)r[64+i]=n[i];for(i=0;i<32;i++)r[32+i]=a[32+i];for(J(s,r.subarray(32),e+32),ir(s),tr(c,s),$(r,c),i=32;i<64;i++)r[i]=o[i];for(J(f,r,e+64),ir(f),i=0;i<64;i++)u[i]=0;for(i=0;i<32;i++)u[i]=s[i];for(i=0;i<32;i++)for(h=0;h<32;h++)u[i+h]+=f[i]*a[h];return or(r.subarray(32),u),y}function ar(r,n,e,o){var a,s=new Uint8Array(32),u=new Uint8Array(64),c=[t(),t(),t(),t()],l=[t(),t(),t(),t()];if(e<64)return-1;if(function(r,n){var e=t(),o=t(),a=t(),s=t(),u=t(),c=t(),l=t();return k(r[2],h),R(r[1],n),C(a,r[1]),O(s,a,f),N(a,a,r[2]),P(s,r[2],s),C(u,s),C(c,u),O(l,c,u),O(e,l,a),O(e,e,s),I(e,e),O(e,e,a),O(e,e,s),O(e,e,s),O(r[0],e,s),C(o,r[0]),O(o,o,s),T(o,a)&&O(r[0],r[0],y),C(o,r[0]),O(o,o,s),T(o,a)?-1:(z(r[0])===n[31]>>7&&N(r[0],i,r[0]),O(r[3],r[0],r[1]),0)}(l,o))return-1;for(a=0;a<e;a++)r[a]=n[a];for(a=0;a<32;a++)r[a+32]=o[a];if(J(u,r,e),ir(u),rr(c,l,u),tr(l,n.subarray(32)),Q(c,l),$(s,c),e-=64,p(n,0,s,0)){for(a=0;a<e;a++)r[a]=0;return-1}for(a=0;a<e;a++)r[a]=n[a+64];return e}var fr=32,sr=24,ur=32,cr=32,yr=sr;function lr(r,t){if(r.length!==fr)throw new Error("bad key size");if(t.length!==sr)throw new Error("bad nonce size")}function wr(){for(var r=0;r<arguments.length;r++)if(!(arguments[r]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function vr(r){for(var t=0;t<r.length;t++)r[t]=0}r.lowlevel={crypto_core_hsalsa20:g,crypto_stream_xor:E,crypto_stream:d,crypto_stream_salsa20_xor:_,crypto_stream_salsa20:U,crypto_onetimeauth:M,crypto_onetimeauth_verify:m,crypto_verify_16:v,crypto_verify_32:p,crypto_secretbox:B,crypto_secretbox_open:S,crypto_scalarmult:Z,crypto_scalarmult_base:G,crypto_box_beforenm:D,crypto_box_afternm:V,crypto_box:function(r,t,n,e,o,i){var h=new Uint8Array(32);return D(h,o,i),V(r,t,n,e,h)},crypto_box_open:function(r,t,n,e,o,i){var h=new Uint8Array(32);return D(h,o,i),X(r,t,n,e,h)},crypto_box_keypair:q,crypto_hash:J,crypto_sign:hr,crypto_sign_keypair:nr,crypto_sign_open:ar,crypto_secretbox_KEYBYTES:fr,crypto_secretbox_NONCEBYTES:sr,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:16,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:ur,crypto_box_SECRETKEYBYTES:cr,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:yr,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:64,crypto_sign_PUBLICKEYBYTES:32,crypto_sign_SECRETKEYBYTES:64,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64,gf:t,D:f,L:er,pack25519:L,unpack25519:R,M:O,A:P,S:C,Z:N,pow2523:I,add:Q,set25519:k,modL:or,scalarmult:rr,scalarbase:tr},r.randomBytes=function(r){var t=new Uint8Array(r);return n(t,r),t},r.secretbox=function(r,t,n){wr(r,t,n),lr(n,t);for(var e=new Uint8Array(32+r.length),o=new Uint8Array(e.length),i=0;i<r.length;i++)e[i+32]=r[i];return B(o,e,e.length,t,n),o.subarray(16)},r.secretbox.open=function(r,t,n){wr(r,t,n),lr(n,t);for(var e=new Uint8Array(16+r.length),o=new Uint8Array(e.length),i=0;i<r.length;i++)e[i+16]=r[i];return e.length<32?null:0!==S(o,e,e.length,t,n)?null:o.subarray(32)},r.secretbox.keyLength=fr,r.secretbox.nonceLength=sr,r.secretbox.overheadLength=16,r.scalarMult=function(r,t){if(wr(r,t),32!==r.length)throw new Error("bad n size");if(32!==t.length)throw new Error("bad p size");var n=new Uint8Array(32);return Z(n,r,t),n},r.scalarMult.base=function(r){if(wr(r),32!==r.length)throw new Error("bad n size");var t=new Uint8Array(32);return G(t,r),t},r.scalarMult.scalarLength=32,r.scalarMult.groupElementLength=32,r.box=function(t,n,e,o){var i=r.box.before(e,o);return r.secretbox(t,n,i)},r.box.before=function(r,t){wr(r,t),function(r,t){if(r.length!==ur)throw new Error("bad public key size");if(t.length!==cr)throw new Error("bad secret key size")}(r,t);var n=new Uint8Array(32);return D(n,r,t),n},r.box.after=r.secretbox,r.box.open=function(t,n,e,o){var i=r.box.before(e,o);return r.secretbox.open(t,n,i)},r.box.open.after=r.secretbox.open,r.box.keyPair=function(){var r=new Uint8Array(ur),t=new Uint8Array(cr);return q(r,t),{publicKey:r,secretKey:t}},r.box.keyPair.fromSecretKey=function(r){if(wr(r),r.length!==cr)throw new Error("bad secret key size");var t=new Uint8Array(ur);return G(t,r),{publicKey:t,secretKey:new Uint8Array(r)}},r.box.publicKeyLength=ur,r.box.secretKeyLength=cr,r.box.sharedKeyLength=32,r.box.nonceLength=yr,r.box.overheadLength=r.secretbox.overheadLength,r.sign=function(r,t){if(wr(r,t),64!==t.length)throw new Error("bad secret key size");var n=new Uint8Array(64+r.length);return hr(n,r,r.length,t),n},r.sign.open=function(r,t){if(wr(r,t),32!==t.length)throw new Error("bad public key size");var n=new Uint8Array(r.length),e=ar(n,r,r.length,t);if(e<0)return null;for(var o=new Uint8Array(e),i=0;i<o.length;i++)o[i]=n[i];return o},r.sign.detached=function(t,n){for(var e=r.sign(t,n),o=new Uint8Array(64),i=0;i<o.length;i++)o[i]=e[i];return o},r.sign.detached.verify=function(r,t,n){if(wr(r,t,n),64!==t.length)throw new Error("bad signature size");if(32!==n.length)throw new Error("bad public key size");var e,o=new Uint8Array(64+r.length),i=new Uint8Array(64+r.length);for(e=0;e<64;e++)o[e]=t[e];for(e=0;e<r.length;e++)o[e+64]=r[e];return ar(i,o,o.length,n)>=0},r.sign.keyPair=function(){var r=new Uint8Array(32),t=new Uint8Array(64);return nr(r,t),{publicKey:r,secretKey:t}},r.sign.keyPair.fromSecretKey=function(r){if(wr(r),64!==r.length)throw new Error("bad secret key size");for(var t=new Uint8Array(32),n=0;n<t.length;n++)t[n]=r[32+n];return{publicKey:t,secretKey:new Uint8Array(r)}},r.sign.keyPair.fromSeed=function(r){if(wr(r),32!==r.length)throw new Error("bad seed size");for(var t=new Uint8Array(32),n=new Uint8Array(64),e=0;e<32;e++)n[e]=r[e];return nr(t,n,!0),{publicKey:t,secretKey:n}},r.sign.publicKeyLength=32,r.sign.secretKeyLength=64,r.sign.seedLength=32,r.sign.signatureLength=64,r.hash=function(r){wr(r);var t=new Uint8Array(64);return J(t,r,r.length),t},r.hash.hashLength=64,r.verify=function(r,t){return wr(r,t),0!==r.length&&0!==t.length&&(r.length===t.length&&0===w(r,0,t,0,r.length))},r.setPRNG=function(r){n=r},function(){var t="undefined"!=typeof self?self.crypto||self.msCrypto:null;if(t&&t.getRandomValues){r.setPRNG(function(r,n){var e,o=new Uint8Array(n);for(e=0;e<n;e+=65536)t.getRandomValues(o.subarray(e,e+Math.min(n-e,65536)));for(e=0;e<n;e++)r[e]=o[e];vr(o)})}else"undefined"!=typeof require&&(t=require("crypto"))&&t.randomBytes&&r.setPRNG(function(r,n){var e,o=t.randomBytes(n);for(e=0;e<n;e++)r[e]=o[e];vr(o)})}()}("undefined"!=typeof module&&module.exports?module.exports:self.nacl=self.nacl||{});
},{"crypto":"rDCW"}],"BOxy":[function(require,module,exports) {
var Buffer = require("buffer").Buffer;
var t=require("buffer").Buffer;!function(t,i){"use strict";function r(t,i){if(!t)throw new Error(i||"Assertion failed")}function n(t,i){t.super_=i;var r=function(){};r.prototype=i.prototype,t.prototype=new r,t.prototype.constructor=t}function h(t,i,r){if(h.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==i&&"be"!==i||(r=i,i=10),this._init(t||0,i||10,r||"be"))}var e;"object"==typeof t?t.exports=h:i.BN=h,h.BN=h,h.wordSize=26;try{e="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:require("buffer").Buffer}catch(B){}function o(t,i){var n=t.charCodeAt(i);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+t)}function s(t,i,r){var n=o(t,r);return r-1>=i&&(n|=o(t,r-1)<<4),n}function u(t,i,n,h){for(var e=0,o=0,s=Math.min(t.length,n),u=i;u<s;u++){var a=t.charCodeAt(u)-48;e*=h,o=a>=49?a-49+10:a>=17?a-17+10:a,r(a>=0&&o<h,"Invalid character"),e+=o}return e}function a(t,i){t.words=i.words,t.length=i.length,t.negative=i.negative,t.red=i.red}if(h.isBN=function(t){return t instanceof h||null!==t&&"object"==typeof t&&t.constructor.wordSize===h.wordSize&&Array.isArray(t.words)},h.max=function(t,i){return t.cmp(i)>0?t:i},h.min=function(t,i){return t.cmp(i)<0?t:i},h.prototype._init=function(t,i,n){if("number"==typeof t)return this._initNumber(t,i,n);if("object"==typeof t)return this._initArray(t,i,n);"hex"===i&&(i=16),r(i===(0|i)&&i>=2&&i<=36);var h=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(h++,this.negative=1),h<t.length&&(16===i?this._parseHex(t,h,n):(this._parseBase(t,i,h),"le"===n&&this._initArray(this.toArray(),i,n)))},h.prototype._initNumber=function(t,i,n){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):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),i,n)},h.prototype._initArray=function(t,i,n){if(r("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 h=0;h<this.length;h++)this.words[h]=0;var e,o,s=0;if("be"===n)for(h=t.length-1,e=0;h>=0;h-=3)o=t[h]|t[h-1]<<8|t[h-2]<<16,this.words[e]|=o<<s&67108863,this.words[e+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,e++);else if("le"===n)for(h=0,e=0;h<t.length;h+=3)o=t[h]|t[h+1]<<8|t[h+2]<<16,this.words[e]|=o<<s&67108863,this.words[e+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,e++);return this._strip()},h.prototype._parseHex=function(t,i,r){this.length=Math.ceil((t.length-i)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var h,e=0,o=0;if("be"===r)for(n=t.length-1;n>=i;n-=2)h=s(t,i,n)<<e,this.words[o]|=67108863&h,e>=18?(e-=18,o+=1,this.words[o]|=h>>>26):e+=8;else for(n=(t.length-i)%2==0?i+1:i;n<t.length;n+=2)h=s(t,i,n)<<e,this.words[o]|=67108863&h,e>=18?(e-=18,o+=1,this.words[o]|=h>>>26):e+=8;this._strip()},h.prototype._parseBase=function(t,i,r){this.words=[0],this.length=1;for(var n=0,h=1;h<=67108863;h*=i)n++;n--,h=h/i|0;for(var e=t.length-r,o=e%n,s=Math.min(e,e-o)+r,a=0,l=r;l<s;l+=n)a=u(t,l,l+n,i),this.imuln(h),this.words[0]+a<67108864?this.words[0]+=a:this._iaddn(a);if(0!==o){var m=1;for(a=u(t,l,t.length,i),l=0;l<o;l++)m*=i;this.imuln(m),this.words[0]+a<67108864?this.words[0]+=a:this._iaddn(a)}this._strip()},h.prototype.copy=function(t){t.words=new Array(this.length);for(var i=0;i<this.length;i++)t.words[i]=this.words[i];t.length=this.length,t.negative=this.negative,t.red=this.red},h.prototype._move=function(t){a(t,this)},h.prototype.clone=function(){var t=new h(null);return this.copy(t),t},h.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},h.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},h.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{h.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(B){h.prototype.inspect=l}else h.prototype.inspect=l;function l(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var m=["","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"],f=[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],d=[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];h.prototype.toString=function(t,i){var n;if(i=0|i||1,16===(t=t||10)||"hex"===t){n="";for(var h=0,e=0,o=0;o<this.length;o++){var s=this.words[o],u=(16777215&(s<<h|e)).toString(16);n=0!==(e=s>>>24-h&16777215)||o!==this.length-1?m[6-u.length]+u+n:u+n,(h+=2)>=26&&(h-=26,o--)}for(0!==e&&(n=e.toString(16)+n);n.length%i!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var a=f[t],l=d[t];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var M=p.modrn(l).toString(t);n=(p=p.idivn(l)).isZero()?M+n:m[a-M.length]+M+n}for(this.isZero()&&(n="0"+n);n.length%i!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},h.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&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},h.prototype.toJSON=function(){return this.toString(16,2)},e&&(h.prototype.toBuffer=function(t,i){return this.toArrayLike(e,t,i)}),h.prototype.toArray=function(t,i){return this.toArrayLike(Array,t,i)};function p(t,i,r){r.negative=i.negative^t.negative;var n=t.length+i.length|0;r.length=n,n=n-1|0;var h=0|t.words[0],e=0|i.words[0],o=h*e,s=67108863&o,u=o/67108864|0;r.words[0]=s;for(var a=1;a<n;a++){for(var l=u>>>26,m=67108863&u,f=Math.min(a,i.length-1),d=Math.max(0,a-t.length+1);d<=f;d++){var p=a-d|0;l+=(o=(h=0|t.words[p])*(e=0|i.words[d])+m)/67108864|0,m=67108863&o}r.words[a]=0|m,u=0|l}return 0!==u?r.words[a]=0|u:r.length--,r._strip()}h.prototype.toArrayLike=function(t,i,n){this._strip();var h=this.byteLength(),e=n||Math.max(1,h);r(h<=e,"byte array longer than desired length"),r(e>0,"Requested array length <= 0");var o=function(t,i){return t.allocUnsafe?t.allocUnsafe(i):new t(i)}(t,e);return this["_toArrayLike"+("le"===i?"LE":"BE")](o,h),o},h.prototype._toArrayLikeLE=function(t,i){for(var r=0,n=0,h=0,e=0;h<this.length;h++){var o=this.words[h]<<e|n;t[r++]=255&o,r<t.length&&(t[r++]=o>>8&255),r<t.length&&(t[r++]=o>>16&255),6===e?(r<t.length&&(t[r++]=o>>24&255),n=0,e=0):(n=o>>>24,e+=2)}if(r<t.length)for(t[r++]=n;r<t.length;)t[r++]=0},h.prototype._toArrayLikeBE=function(t,i){for(var r=t.length-1,n=0,h=0,e=0;h<this.length;h++){var o=this.words[h]<<e|n;t[r--]=255&o,r>=0&&(t[r--]=o>>8&255),r>=0&&(t[r--]=o>>16&255),6===e?(r>=0&&(t[r--]=o>>24&255),n=0,e=0):(n=o>>>24,e+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?h.prototype._countBits=function(t){return 32-Math.clz32(t)}:h.prototype._countBits=function(t){var i=t,r=0;return i>=4096&&(r+=13,i>>>=13),i>=64&&(r+=7,i>>>=7),i>=8&&(r+=4,i>>>=4),i>=2&&(r+=2,i>>>=2),r+i},h.prototype._zeroBits=function(t){if(0===t)return 26;var i=t,r=0;return 0==(8191&i)&&(r+=13,i>>>=13),0==(127&i)&&(r+=7,i>>>=7),0==(15&i)&&(r+=4,i>>>=4),0==(3&i)&&(r+=2,i>>>=2),0==(1&i)&&r++,r},h.prototype.bitLength=function(){var t=this.words[this.length-1],i=this._countBits(t);return 26*(this.length-1)+i},h.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,i=0;i<this.length;i++){var r=this._zeroBits(this.words[i]);if(t+=r,26!==r)break}return t},h.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},h.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},h.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},h.prototype.isNeg=function(){return 0!==this.negative},h.prototype.neg=function(){return this.clone().ineg()},h.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},h.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var i=0;i<t.length;i++)this.words[i]=this.words[i]|t.words[i];return this._strip()},h.prototype.ior=function(t){return r(0==(this.negative|t.negative)),this.iuor(t)},h.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},h.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},h.prototype.iuand=function(t){var i;i=this.length>t.length?t:this;for(var r=0;r<i.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=i.length,this._strip()},h.prototype.iand=function(t){return r(0==(this.negative|t.negative)),this.iuand(t)},h.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},h.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},h.prototype.iuxor=function(t){var i,r;this.length>t.length?(i=this,r=t):(i=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=i.words[n]^r.words[n];if(this!==i)for(;n<i.length;n++)this.words[n]=i.words[n];return this.length=i.length,this._strip()},h.prototype.ixor=function(t){return r(0==(this.negative|t.negative)),this.iuxor(t)},h.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},h.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},h.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var i=0|Math.ceil(t/26),n=t%26;this._expand(i),n>0&&i--;for(var h=0;h<i;h++)this.words[h]=67108863&~this.words[h];return n>0&&(this.words[h]=~this.words[h]&67108863>>26-n),this._strip()},h.prototype.notn=function(t){return this.clone().inotn(t)},h.prototype.setn=function(t,i){r("number"==typeof t&&t>=0);var n=t/26|0,h=t%26;return this._expand(n+1),this.words[n]=i?this.words[n]|1<<h:this.words[n]&~(1<<h),this._strip()},h.prototype.iadd=function(t){var i,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,i=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,i=this.isub(t),t.negative=1,i._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var h=0,e=0;e<n.length;e++)i=(0|r.words[e])+(0|n.words[e])+h,this.words[e]=67108863&i,h=i>>>26;for(;0!==h&&e<r.length;e++)i=(0|r.words[e])+h,this.words[e]=67108863&i,h=i>>>26;if(this.length=r.length,0!==h)this.words[this.length]=h,this.length++;else if(r!==this)for(;e<r.length;e++)this.words[e]=r.words[e];return this},h.prototype.add=function(t){var i;return 0!==t.negative&&0===this.negative?(t.negative=0,i=this.sub(t),t.negative^=1,i):0===t.negative&&0!==this.negative?(this.negative=0,i=t.sub(this),this.negative=1,i):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},h.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var i=this.iadd(t);return t.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,h=this.cmp(t);if(0===h)return this.negative=0,this.length=1,this.words[0]=0,this;h>0?(r=this,n=t):(r=t,n=this);for(var e=0,o=0;o<n.length;o++)e=(i=(0|r.words[o])-(0|n.words[o])+e)>>26,this.words[o]=67108863&i;for(;0!==e&&o<r.length;o++)e=(i=(0|r.words[o])+e)>>26,this.words[o]=67108863&i;if(0===e&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this._strip()},h.prototype.sub=function(t){return this.clone().isub(t)};var M=function(t,i,r){var n,h,e,o=t.words,s=i.words,u=r.words,a=0,l=0|o[0],m=8191&l,f=l>>>13,d=0|o[1],p=8191&d,M=d>>>13,v=0|o[2],g=8191&v,c=v>>>13,w=0|o[3],y=8191&w,b=w>>>13,_=0|o[4],k=8191&_,A=_>>>13,S=0|o[5],x=8191&S,B=S>>>13,q=0|o[6],R=8191&q,Z=q>>>13,L=0|o[7],N=8191&L,I=L>>>13,E=0|o[8],z=8191&E,T=E>>>13,O=0|o[9],j=8191&O,K=O>>>13,P=0|s[0],F=8191&P,U=P>>>13,C=0|s[1],D=8191&C,H=C>>>13,J=0|s[2],G=8191&J,Q=J>>>13,V=0|s[3],W=8191&V,X=V>>>13,Y=0|s[4],$=8191&Y,tt=Y>>>13,it=0|s[5],rt=8191&it,nt=it>>>13,ht=0|s[6],et=8191&ht,ot=ht>>>13,st=0|s[7],ut=8191&st,at=st>>>13,lt=0|s[8],mt=8191<,ft=lt>>>13,dt=0|s[9],pt=8191&dt,Mt=dt>>>13;r.negative=t.negative^i.negative,r.length=19;var vt=(a+(n=Math.imul(m,F))|0)+((8191&(h=(h=Math.imul(m,U))+Math.imul(f,F)|0))<<13)|0;a=((e=Math.imul(f,U))+(h>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,F),h=(h=Math.imul(p,U))+Math.imul(M,F)|0,e=Math.imul(M,U);var gt=(a+(n=n+Math.imul(m,D)|0)|0)+((8191&(h=(h=h+Math.imul(m,H)|0)+Math.imul(f,D)|0))<<13)|0;a=((e=e+Math.imul(f,H)|0)+(h>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,F),h=(h=Math.imul(g,U))+Math.imul(c,F)|0,e=Math.imul(c,U),n=n+Math.imul(p,D)|0,h=(h=h+Math.imul(p,H)|0)+Math.imul(M,D)|0,e=e+Math.imul(M,H)|0;var ct=(a+(n=n+Math.imul(m,G)|0)|0)+((8191&(h=(h=h+Math.imul(m,Q)|0)+Math.imul(f,G)|0))<<13)|0;a=((e=e+Math.imul(f,Q)|0)+(h>>>13)|0)+(ct>>>26)|0,ct&=67108863,n=Math.imul(y,F),h=(h=Math.imul(y,U))+Math.imul(b,F)|0,e=Math.imul(b,U),n=n+Math.imul(g,D)|0,h=(h=h+Math.imul(g,H)|0)+Math.imul(c,D)|0,e=e+Math.imul(c,H)|0,n=n+Math.imul(p,G)|0,h=(h=h+Math.imul(p,Q)|0)+Math.imul(M,G)|0,e=e+Math.imul(M,Q)|0;var wt=(a+(n=n+Math.imul(m,W)|0)|0)+((8191&(h=(h=h+Math.imul(m,X)|0)+Math.imul(f,W)|0))<<13)|0;a=((e=e+Math.imul(f,X)|0)+(h>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(k,F),h=(h=Math.imul(k,U))+Math.imul(A,F)|0,e=Math.imul(A,U),n=n+Math.imul(y,D)|0,h=(h=h+Math.imul(y,H)|0)+Math.imul(b,D)|0,e=e+Math.imul(b,H)|0,n=n+Math.imul(g,G)|0,h=(h=h+Math.imul(g,Q)|0)+Math.imul(c,G)|0,e=e+Math.imul(c,Q)|0,n=n+Math.imul(p,W)|0,h=(h=h+Math.imul(p,X)|0)+Math.imul(M,W)|0,e=e+Math.imul(M,X)|0;var yt=(a+(n=n+Math.imul(m,$)|0)|0)+((8191&(h=(h=h+Math.imul(m,tt)|0)+Math.imul(f,$)|0))<<13)|0;a=((e=e+Math.imul(f,tt)|0)+(h>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(x,F),h=(h=Math.imul(x,U))+Math.imul(B,F)|0,e=Math.imul(B,U),n=n+Math.imul(k,D)|0,h=(h=h+Math.imul(k,H)|0)+Math.imul(A,D)|0,e=e+Math.imul(A,H)|0,n=n+Math.imul(y,G)|0,h=(h=h+Math.imul(y,Q)|0)+Math.imul(b,G)|0,e=e+Math.imul(b,Q)|0,n=n+Math.imul(g,W)|0,h=(h=h+Math.imul(g,X)|0)+Math.imul(c,W)|0,e=e+Math.imul(c,X)|0,n=n+Math.imul(p,$)|0,h=(h=h+Math.imul(p,tt)|0)+Math.imul(M,$)|0,e=e+Math.imul(M,tt)|0;var bt=(a+(n=n+Math.imul(m,rt)|0)|0)+((8191&(h=(h=h+Math.imul(m,nt)|0)+Math.imul(f,rt)|0))<<13)|0;a=((e=e+Math.imul(f,nt)|0)+(h>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(R,F),h=(h=Math.imul(R,U))+Math.imul(Z,F)|0,e=Math.imul(Z,U),n=n+Math.imul(x,D)|0,h=(h=h+Math.imul(x,H)|0)+Math.imul(B,D)|0,e=e+Math.imul(B,H)|0,n=n+Math.imul(k,G)|0,h=(h=h+Math.imul(k,Q)|0)+Math.imul(A,G)|0,e=e+Math.imul(A,Q)|0,n=n+Math.imul(y,W)|0,h=(h=h+Math.imul(y,X)|0)+Math.imul(b,W)|0,e=e+Math.imul(b,X)|0,n=n+Math.imul(g,$)|0,h=(h=h+Math.imul(g,tt)|0)+Math.imul(c,$)|0,e=e+Math.imul(c,tt)|0,n=n+Math.imul(p,rt)|0,h=(h=h+Math.imul(p,nt)|0)+Math.imul(M,rt)|0,e=e+Math.imul(M,nt)|0;var _t=(a+(n=n+Math.imul(m,et)|0)|0)+((8191&(h=(h=h+Math.imul(m,ot)|0)+Math.imul(f,et)|0))<<13)|0;a=((e=e+Math.imul(f,ot)|0)+(h>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(N,F),h=(h=Math.imul(N,U))+Math.imul(I,F)|0,e=Math.imul(I,U),n=n+Math.imul(R,D)|0,h=(h=h+Math.imul(R,H)|0)+Math.imul(Z,D)|0,e=e+Math.imul(Z,H)|0,n=n+Math.imul(x,G)|0,h=(h=h+Math.imul(x,Q)|0)+Math.imul(B,G)|0,e=e+Math.imul(B,Q)|0,n=n+Math.imul(k,W)|0,h=(h=h+Math.imul(k,X)|0)+Math.imul(A,W)|0,e=e+Math.imul(A,X)|0,n=n+Math.imul(y,$)|0,h=(h=h+Math.imul(y,tt)|0)+Math.imul(b,$)|0,e=e+Math.imul(b,tt)|0,n=n+Math.imul(g,rt)|0,h=(h=h+Math.imul(g,nt)|0)+Math.imul(c,rt)|0,e=e+Math.imul(c,nt)|0,n=n+Math.imul(p,et)|0,h=(h=h+Math.imul(p,ot)|0)+Math.imul(M,et)|0,e=e+Math.imul(M,ot)|0;var kt=(a+(n=n+Math.imul(m,ut)|0)|0)+((8191&(h=(h=h+Math.imul(m,at)|0)+Math.imul(f,ut)|0))<<13)|0;a=((e=e+Math.imul(f,at)|0)+(h>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(z,F),h=(h=Math.imul(z,U))+Math.imul(T,F)|0,e=Math.imul(T,U),n=n+Math.imul(N,D)|0,h=(h=h+Math.imul(N,H)|0)+Math.imul(I,D)|0,e=e+Math.imul(I,H)|0,n=n+Math.imul(R,G)|0,h=(h=h+Math.imul(R,Q)|0)+Math.imul(Z,G)|0,e=e+Math.imul(Z,Q)|0,n=n+Math.imul(x,W)|0,h=(h=h+Math.imul(x,X)|0)+Math.imul(B,W)|0,e=e+Math.imul(B,X)|0,n=n+Math.imul(k,$)|0,h=(h=h+Math.imul(k,tt)|0)+Math.imul(A,$)|0,e=e+Math.imul(A,tt)|0,n=n+Math.imul(y,rt)|0,h=(h=h+Math.imul(y,nt)|0)+Math.imul(b,rt)|0,e=e+Math.imul(b,nt)|0,n=n+Math.imul(g,et)|0,h=(h=h+Math.imul(g,ot)|0)+Math.imul(c,et)|0,e=e+Math.imul(c,ot)|0,n=n+Math.imul(p,ut)|0,h=(h=h+Math.imul(p,at)|0)+Math.imul(M,ut)|0,e=e+Math.imul(M,at)|0;var At=(a+(n=n+Math.imul(m,mt)|0)|0)+((8191&(h=(h=h+Math.imul(m,ft)|0)+Math.imul(f,mt)|0))<<13)|0;a=((e=e+Math.imul(f,ft)|0)+(h>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(j,F),h=(h=Math.imul(j,U))+Math.imul(K,F)|0,e=Math.imul(K,U),n=n+Math.imul(z,D)|0,h=(h=h+Math.imul(z,H)|0)+Math.imul(T,D)|0,e=e+Math.imul(T,H)|0,n=n+Math.imul(N,G)|0,h=(h=h+Math.imul(N,Q)|0)+Math.imul(I,G)|0,e=e+Math.imul(I,Q)|0,n=n+Math.imul(R,W)|0,h=(h=h+Math.imul(R,X)|0)+Math.imul(Z,W)|0,e=e+Math.imul(Z,X)|0,n=n+Math.imul(x,$)|0,h=(h=h+Math.imul(x,tt)|0)+Math.imul(B,$)|0,e=e+Math.imul(B,tt)|0,n=n+Math.imul(k,rt)|0,h=(h=h+Math.imul(k,nt)|0)+Math.imul(A,rt)|0,e=e+Math.imul(A,nt)|0,n=n+Math.imul(y,et)|0,h=(h=h+Math.imul(y,ot)|0)+Math.imul(b,et)|0,e=e+Math.imul(b,ot)|0,n=n+Math.imul(g,ut)|0,h=(h=h+Math.imul(g,at)|0)+Math.imul(c,ut)|0,e=e+Math.imul(c,at)|0,n=n+Math.imul(p,mt)|0,h=(h=h+Math.imul(p,ft)|0)+Math.imul(M,mt)|0,e=e+Math.imul(M,ft)|0;var St=(a+(n=n+Math.imul(m,pt)|0)|0)+((8191&(h=(h=h+Math.imul(m,Mt)|0)+Math.imul(f,pt)|0))<<13)|0;a=((e=e+Math.imul(f,Mt)|0)+(h>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(j,D),h=(h=Math.imul(j,H))+Math.imul(K,D)|0,e=Math.imul(K,H),n=n+Math.imul(z,G)|0,h=(h=h+Math.imul(z,Q)|0)+Math.imul(T,G)|0,e=e+Math.imul(T,Q)|0,n=n+Math.imul(N,W)|0,h=(h=h+Math.imul(N,X)|0)+Math.imul(I,W)|0,e=e+Math.imul(I,X)|0,n=n+Math.imul(R,$)|0,h=(h=h+Math.imul(R,tt)|0)+Math.imul(Z,$)|0,e=e+Math.imul(Z,tt)|0,n=n+Math.imul(x,rt)|0,h=(h=h+Math.imul(x,nt)|0)+Math.imul(B,rt)|0,e=e+Math.imul(B,nt)|0,n=n+Math.imul(k,et)|0,h=(h=h+Math.imul(k,ot)|0)+Math.imul(A,et)|0,e=e+Math.imul(A,ot)|0,n=n+Math.imul(y,ut)|0,h=(h=h+Math.imul(y,at)|0)+Math.imul(b,ut)|0,e=e+Math.imul(b,at)|0,n=n+Math.imul(g,mt)|0,h=(h=h+Math.imul(g,ft)|0)+Math.imul(c,mt)|0,e=e+Math.imul(c,ft)|0;var xt=(a+(n=n+Math.imul(p,pt)|0)|0)+((8191&(h=(h=h+Math.imul(p,Mt)|0)+Math.imul(M,pt)|0))<<13)|0;a=((e=e+Math.imul(M,Mt)|0)+(h>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(j,G),h=(h=Math.imul(j,Q))+Math.imul(K,G)|0,e=Math.imul(K,Q),n=n+Math.imul(z,W)|0,h=(h=h+Math.imul(z,X)|0)+Math.imul(T,W)|0,e=e+Math.imul(T,X)|0,n=n+Math.imul(N,$)|0,h=(h=h+Math.imul(N,tt)|0)+Math.imul(I,$)|0,e=e+Math.imul(I,tt)|0,n=n+Math.imul(R,rt)|0,h=(h=h+Math.imul(R,nt)|0)+Math.imul(Z,rt)|0,e=e+Math.imul(Z,nt)|0,n=n+Math.imul(x,et)|0,h=(h=h+Math.imul(x,ot)|0)+Math.imul(B,et)|0,e=e+Math.imul(B,ot)|0,n=n+Math.imul(k,ut)|0,h=(h=h+Math.imul(k,at)|0)+Math.imul(A,ut)|0,e=e+Math.imul(A,at)|0,n=n+Math.imul(y,mt)|0,h=(h=h+Math.imul(y,ft)|0)+Math.imul(b,mt)|0,e=e+Math.imul(b,ft)|0;var Bt=(a+(n=n+Math.imul(g,pt)|0)|0)+((8191&(h=(h=h+Math.imul(g,Mt)|0)+Math.imul(c,pt)|0))<<13)|0;a=((e=e+Math.imul(c,Mt)|0)+(h>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(j,W),h=(h=Math.imul(j,X))+Math.imul(K,W)|0,e=Math.imul(K,X),n=n+Math.imul(z,$)|0,h=(h=h+Math.imul(z,tt)|0)+Math.imul(T,$)|0,e=e+Math.imul(T,tt)|0,n=n+Math.imul(N,rt)|0,h=(h=h+Math.imul(N,nt)|0)+Math.imul(I,rt)|0,e=e+Math.imul(I,nt)|0,n=n+Math.imul(R,et)|0,h=(h=h+Math.imul(R,ot)|0)+Math.imul(Z,et)|0,e=e+Math.imul(Z,ot)|0,n=n+Math.imul(x,ut)|0,h=(h=h+Math.imul(x,at)|0)+Math.imul(B,ut)|0,e=e+Math.imul(B,at)|0,n=n+Math.imul(k,mt)|0,h=(h=h+Math.imul(k,ft)|0)+Math.imul(A,mt)|0,e=e+Math.imul(A,ft)|0;var qt=(a+(n=n+Math.imul(y,pt)|0)|0)+((8191&(h=(h=h+Math.imul(y,Mt)|0)+Math.imul(b,pt)|0))<<13)|0;a=((e=e+Math.imul(b,Mt)|0)+(h>>>13)|0)+(qt>>>26)|0,qt&=67108863,n=Math.imul(j,$),h=(h=Math.imul(j,tt))+Math.imul(K,$)|0,e=Math.imul(K,tt),n=n+Math.imul(z,rt)|0,h=(h=h+Math.imul(z,nt)|0)+Math.imul(T,rt)|0,e=e+Math.imul(T,nt)|0,n=n+Math.imul(N,et)|0,h=(h=h+Math.imul(N,ot)|0)+Math.imul(I,et)|0,e=e+Math.imul(I,ot)|0,n=n+Math.imul(R,ut)|0,h=(h=h+Math.imul(R,at)|0)+Math.imul(Z,ut)|0,e=e+Math.imul(Z,at)|0,n=n+Math.imul(x,mt)|0,h=(h=h+Math.imul(x,ft)|0)+Math.imul(B,mt)|0,e=e+Math.imul(B,ft)|0;var Rt=(a+(n=n+Math.imul(k,pt)|0)|0)+((8191&(h=(h=h+Math.imul(k,Mt)|0)+Math.imul(A,pt)|0))<<13)|0;a=((e=e+Math.imul(A,Mt)|0)+(h>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(j,rt),h=(h=Math.imul(j,nt))+Math.imul(K,rt)|0,e=Math.imul(K,nt),n=n+Math.imul(z,et)|0,h=(h=h+Math.imul(z,ot)|0)+Math.imul(T,et)|0,e=e+Math.imul(T,ot)|0,n=n+Math.imul(N,ut)|0,h=(h=h+Math.imul(N,at)|0)+Math.imul(I,ut)|0,e=e+Math.imul(I,at)|0,n=n+Math.imul(R,mt)|0,h=(h=h+Math.imul(R,ft)|0)+Math.imul(Z,mt)|0,e=e+Math.imul(Z,ft)|0;var Zt=(a+(n=n+Math.imul(x,pt)|0)|0)+((8191&(h=(h=h+Math.imul(x,Mt)|0)+Math.imul(B,pt)|0))<<13)|0;a=((e=e+Math.imul(B,Mt)|0)+(h>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,n=Math.imul(j,et),h=(h=Math.imul(j,ot))+Math.imul(K,et)|0,e=Math.imul(K,ot),n=n+Math.imul(z,ut)|0,h=(h=h+Math.imul(z,at)|0)+Math.imul(T,ut)|0,e=e+Math.imul(T,at)|0,n=n+Math.imul(N,mt)|0,h=(h=h+Math.imul(N,ft)|0)+Math.imul(I,mt)|0,e=e+Math.imul(I,ft)|0;var Lt=(a+(n=n+Math.imul(R,pt)|0)|0)+((8191&(h=(h=h+Math.imul(R,Mt)|0)+Math.imul(Z,pt)|0))<<13)|0;a=((e=e+Math.imul(Z,Mt)|0)+(h>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(j,ut),h=(h=Math.imul(j,at))+Math.imul(K,ut)|0,e=Math.imul(K,at),n=n+Math.imul(z,mt)|0,h=(h=h+Math.imul(z,ft)|0)+Math.imul(T,mt)|0,e=e+Math.imul(T,ft)|0;var Nt=(a+(n=n+Math.imul(N,pt)|0)|0)+((8191&(h=(h=h+Math.imul(N,Mt)|0)+Math.imul(I,pt)|0))<<13)|0;a=((e=e+Math.imul(I,Mt)|0)+(h>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(j,mt),h=(h=Math.imul(j,ft))+Math.imul(K,mt)|0,e=Math.imul(K,ft);var It=(a+(n=n+Math.imul(z,pt)|0)|0)+((8191&(h=(h=h+Math.imul(z,Mt)|0)+Math.imul(T,pt)|0))<<13)|0;a=((e=e+Math.imul(T,Mt)|0)+(h>>>13)|0)+(It>>>26)|0,It&=67108863;var Et=(a+(n=Math.imul(j,pt))|0)+((8191&(h=(h=Math.imul(j,Mt))+Math.imul(K,pt)|0))<<13)|0;return a=((e=Math.imul(K,Mt))+(h>>>13)|0)+(Et>>>26)|0,Et&=67108863,u[0]=vt,u[1]=gt,u[2]=ct,u[3]=wt,u[4]=yt,u[5]=bt,u[6]=_t,u[7]=kt,u[8]=At,u[9]=St,u[10]=xt,u[11]=Bt,u[12]=qt,u[13]=Rt,u[14]=Zt,u[15]=Lt,u[16]=Nt,u[17]=It,u[18]=Et,0!==a&&(u[19]=a,r.length++),r};function v(t,i,r){r.negative=i.negative^t.negative,r.length=t.length+i.length;for(var n=0,h=0,e=0;e<r.length-1;e++){var o=h;h=0;for(var s=67108863&n,u=Math.min(e,i.length-1),a=Math.max(0,e-t.length+1);a<=u;a++){var l=e-a,m=(0|t.words[l])*(0|i.words[a]),f=67108863&m;s=67108863&(f=f+s|0),h+=(o=(o=o+(m/67108864|0)|0)+(f>>>26)|0)>>>26,o&=67108863}r.words[e]=s,n=o,o=h}return 0!==n?r.words[e]=n:r.length--,r._strip()}function g(t,i,r){return v(t,i,r)}function c(t,i){this.x=t,this.y=i}Math.imul||(M=p),h.prototype.mulTo=function(t,i){var r=this.length+t.length;return 10===this.length&&10===t.length?M(this,t,i):r<63?p(this,t,i):r<1024?v(this,t,i):g(this,t,i)},c.prototype.makeRBT=function(t){for(var i=new Array(t),r=h.prototype._countBits(t)-1,n=0;n<t;n++)i[n]=this.revBin(n,r,t);return i},c.prototype.revBin=function(t,i,r){if(0===t||t===r-1)return t;for(var n=0,h=0;h<i;h++)n|=(1&t)<<i-h-1,t>>=1;return n},c.prototype.permute=function(t,i,r,n,h,e){for(var o=0;o<e;o++)n[o]=i[t[o]],h[o]=r[t[o]]},c.prototype.transform=function(t,i,r,n,h,e){this.permute(e,t,i,r,n,h);for(var o=1;o<h;o<<=1)for(var s=o<<1,u=Math.cos(2*Math.PI/s),a=Math.sin(2*Math.PI/s),l=0;l<h;l+=s)for(var m=u,f=a,d=0;d<o;d++){var p=r[l+d],M=n[l+d],v=r[l+d+o],g=n[l+d+o],c=m*v-f*g;g=m*g+f*v,v=c,r[l+d]=p+v,n[l+d]=M+g,r[l+d+o]=p-v,n[l+d+o]=M-g,d!==s&&(c=u*m-a*f,f=u*f+a*m,m=c)}},c.prototype.guessLen13b=function(t,i){var r=1|Math.max(i,t),n=1&r,h=0;for(r=r/2|0;r;r>>>=1)h++;return 1<<h+1+n},c.prototype.conjugate=function(t,i,r){if(!(r<=1))for(var n=0;n<r/2;n++){var h=t[n];t[n]=t[r-n-1],t[r-n-1]=h,h=i[n],i[n]=-i[r-n-1],i[r-n-1]=-h}},c.prototype.normalize13b=function(t,i){for(var r=0,n=0;n<i/2;n++){var h=8192*Math.round(t[2*n+1]/i)+Math.round(t[2*n]/i)+r;t[n]=67108863&h,r=h<67108864?0:h/67108864|0}return t},c.prototype.convert13b=function(t,i,n,h){for(var e=0,o=0;o<i;o++)e+=0|t[o],n[2*o]=8191&e,e>>>=13,n[2*o+1]=8191&e,e>>>=13;for(o=2*i;o<h;++o)n[o]=0;r(0===e),r(0==(-8192&e))},c.prototype.stub=function(t){for(var i=new Array(t),r=0;r<t;r++)i[r]=0;return i},c.prototype.mulp=function(t,i,r){var n=2*this.guessLen13b(t.length,i.length),h=this.makeRBT(n),e=this.stub(n),o=new Array(n),s=new Array(n),u=new Array(n),a=new Array(n),l=new Array(n),m=new Array(n),f=r.words;f.length=n,this.convert13b(t.words,t.length,o,n),this.convert13b(i.words,i.length,a,n),this.transform(o,e,s,u,n,h),this.transform(a,e,l,m,n,h);for(var d=0;d<n;d++){var p=s[d]*l[d]-u[d]*m[d];u[d]=s[d]*m[d]+u[d]*l[d],s[d]=p}return this.conjugate(s,u,n),this.transform(s,u,f,e,n,h),this.conjugate(f,e,n),this.normalize13b(f,n),r.negative=t.negative^i.negative,r.length=t.length+i.length,r._strip()},h.prototype.mul=function(t){var i=new h(null);return i.words=new Array(this.length+t.length),this.mulTo(t,i)},h.prototype.mulf=function(t){var i=new h(null);return i.words=new Array(this.length+t.length),g(this,t,i)},h.prototype.imul=function(t){return this.clone().mulTo(t,this)},h.prototype.imuln=function(t){var i=t<0;i&&(t=-t),r("number"==typeof t),r(t<67108864);for(var n=0,h=0;h<this.length;h++){var e=(0|this.words[h])*t,o=(67108863&e)+(67108863&n);n>>=26,n+=e/67108864|0,n+=o>>>26,this.words[h]=67108863&o}return 0!==n&&(this.words[h]=n,this.length++),i?this.ineg():this},h.prototype.muln=function(t){return this.clone().imuln(t)},h.prototype.sqr=function(){return this.mul(this)},h.prototype.isqr=function(){return this.imul(this.clone())},h.prototype.pow=function(t){var i=function(t){for(var i=new Array(t.bitLength()),r=0;r<i.length;r++){var n=r/26|0,h=r%26;i[r]=t.words[n]>>>h&1}return i}(t);if(0===i.length)return new h(1);for(var r=this,n=0;n<i.length&&0===i[n];n++,r=r.sqr());if(++n<i.length)for(var e=r.sqr();n<i.length;n++,e=e.sqr())0!==i[n]&&(r=r.mul(e));return r},h.prototype.iushln=function(t){r("number"==typeof t&&t>=0);var i,n=t%26,h=(t-n)/26,e=67108863>>>26-n<<26-n;if(0!==n){var o=0;for(i=0;i<this.length;i++){var s=this.words[i]&e,u=(0|this.words[i])-s<<n;this.words[i]=u|o,o=s>>>26-n}o&&(this.words[i]=o,this.length++)}if(0!==h){for(i=this.length-1;i>=0;i--)this.words[i+h]=this.words[i];for(i=0;i<h;i++)this.words[i]=0;this.length+=h}return this._strip()},h.prototype.ishln=function(t){return r(0===this.negative),this.iushln(t)},h.prototype.iushrn=function(t,i,n){var h;r("number"==typeof t&&t>=0),h=i?(i-i%26)/26:0;var e=t%26,o=Math.min((t-e)/26,this.length),s=67108863^67108863>>>e<<e,u=n;if(h-=o,h=Math.max(0,h),u){for(var a=0;a<o;a++)u.words[a]=this.words[a];u.length=o}if(0===o);else if(this.length>o)for(this.length-=o,a=0;a<this.length;a++)this.words[a]=this.words[a+o];else this.words[0]=0,this.length=1;var l=0;for(a=this.length-1;a>=0&&(0!==l||a>=h);a--){var m=0|this.words[a];this.words[a]=l<<26-e|m>>>e,l=m&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},h.prototype.ishrn=function(t,i,n){return r(0===this.negative),this.iushrn(t,i,n)},h.prototype.shln=function(t){return this.clone().ishln(t)},h.prototype.ushln=function(t){return this.clone().iushln(t)},h.prototype.shrn=function(t){return this.clone().ishrn(t)},h.prototype.ushrn=function(t){return this.clone().iushrn(t)},h.prototype.testn=function(t){r("number"==typeof t&&t>=0);var i=t%26,n=(t-i)/26,h=1<<i;return!(this.length<=n)&&!!(this.words[n]&h)},h.prototype.imaskn=function(t){r("number"==typeof t&&t>=0);var i=t%26,n=(t-i)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==i&&n++,this.length=Math.min(n,this.length),0!==i){var h=67108863^67108863>>>i<<i;this.words[this.length-1]&=h}return this._strip()},h.prototype.maskn=function(t){return this.clone().imaskn(t)},h.prototype.iaddn=function(t){return r("number"==typeof t),r(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)},h.prototype._iaddn=function(t){this.words[0]+=t;for(var i=0;i<this.length&&this.words[i]>=67108864;i++)this.words[i]-=67108864,i===this.length-1?this.words[i+1]=1:this.words[i+1]++;return this.length=Math.max(this.length,i+1),this},h.prototype.isubn=function(t){if(r("number"==typeof t),r(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 i=0;i<this.length&&this.words[i]<0;i++)this.words[i]+=67108864,this.words[i+1]-=1;return this._strip()},h.prototype.addn=function(t){return this.clone().iaddn(t)},h.prototype.subn=function(t){return this.clone().isubn(t)},h.prototype.iabs=function(){return this.negative=0,this},h.prototype.abs=function(){return this.clone().iabs()},h.prototype._ishlnsubmul=function(t,i,n){var h,e,o=t.length+n;this._expand(o);var s=0;for(h=0;h<t.length;h++){e=(0|this.words[h+n])+s;var u=(0|t.words[h])*i;s=((e-=67108863&u)>>26)-(u/67108864|0),this.words[h+n]=67108863&e}for(;h<this.length-n;h++)s=(e=(0|this.words[h+n])+s)>>26,this.words[h+n]=67108863&e;if(0===s)return this._strip();for(r(-1===s),s=0,h=0;h<this.length;h++)s=(e=-(0|this.words[h])+s)>>26,this.words[h]=67108863&e;return this.negative=1,this._strip()},h.prototype._wordDiv=function(t,i){var r=(this.length,t.length),n=this.clone(),e=t,o=0|e.words[e.length-1];0!==(r=26-this._countBits(o))&&(e=e.ushln(r),n.iushln(r),o=0|e.words[e.length-1]);var s,u=n.length-e.length;if("mod"!==i){(s=new h(null)).length=u+1,s.words=new Array(s.length);for(var a=0;a<s.length;a++)s.words[a]=0}var l=n.clone()._ishlnsubmul(e,1,u);0===l.negative&&(n=l,s&&(s.words[u]=1));for(var m=u-1;m>=0;m--){var f=67108864*(0|n.words[e.length+m])+(0|n.words[e.length+m-1]);for(f=Math.min(f/o|0,67108863),n._ishlnsubmul(e,f,m);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(e,1,m),n.isZero()||(n.negative^=1);s&&(s.words[m]=f)}return s&&s._strip(),n._strip(),"div"!==i&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},h.prototype.divmod=function(t,i,n){return r(!t.isZero()),this.isZero()?{div:new h(0),mod:new h(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,i),"mod"!==i&&(e=s.div.neg()),"div"!==i&&(o=s.mod.neg(),n&&0!==o.negative&&o.iadd(t)),{div:e,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),i),"mod"!==i&&(e=s.div.neg()),{div:e,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),i),"div"!==i&&(o=s.mod.neg(),n&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new h(0),mod:this}:1===t.length?"div"===i?{div:this.divn(t.words[0]),mod:null}:"mod"===i?{div:null,mod:new h(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new h(this.modrn(t.words[0]))}:this._wordDiv(t,i);var e,o,s},h.prototype.div=function(t){return this.divmod(t,"div",!1).div},h.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},h.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},h.prototype.divRound=function(t){var i=this.divmod(t);if(i.mod.isZero())return i.div;var r=0!==i.div.negative?i.mod.isub(t):i.mod,n=t.ushrn(1),h=t.andln(1),e=r.cmp(n);return e<0||1===h&&0===e?i.div:0!==i.div.negative?i.div.isubn(1):i.div.iaddn(1)},h.prototype.modrn=function(t){var i=t<0;i&&(t=-t),r(t<=67108863);for(var n=(1<<26)%t,h=0,e=this.length-1;e>=0;e--)h=(n*h+(0|this.words[e]))%t;return i?-h:h},h.prototype.modn=function(t){return this.modrn(t)},h.prototype.idivn=function(t){var i=t<0;i&&(t=-t),r(t<=67108863);for(var n=0,h=this.length-1;h>=0;h--){var e=(0|this.words[h])+67108864*n;this.words[h]=e/t|0,n=e%t}return this._strip(),i?this.ineg():this},h.prototype.divn=function(t){return this.clone().idivn(t)},h.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var i=this,n=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var e=new h(1),o=new h(0),s=new h(0),u=new h(1),a=0;i.isEven()&&n.isEven();)i.iushrn(1),n.iushrn(1),++a;for(var l=n.clone(),m=i.clone();!i.isZero();){for(var f=0,d=1;0==(i.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(i.iushrn(f);f-- >0;)(e.isOdd()||o.isOdd())&&(e.iadd(l),o.isub(m)),e.iushrn(1),o.iushrn(1);for(var p=0,M=1;0==(n.words[0]&M)&&p<26;++p,M<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(m)),s.iushrn(1),u.iushrn(1);i.cmp(n)>=0?(i.isub(n),e.isub(s),o.isub(u)):(n.isub(i),s.isub(e),u.isub(o))}return{a:s,b:u,gcd:n.iushln(a)}},h.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var i=this,n=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var e,o=new h(1),s=new h(0),u=n.clone();i.cmpn(1)>0&&n.cmpn(1)>0;){for(var a=0,l=1;0==(i.words[0]&l)&&a<26;++a,l<<=1);if(a>0)for(i.iushrn(a);a-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var m=0,f=1;0==(n.words[0]&f)&&m<26;++m,f<<=1);if(m>0)for(n.iushrn(m);m-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);i.cmp(n)>=0?(i.isub(n),o.isub(s)):(n.isub(i),s.isub(o))}return(e=0===i.cmpn(1)?o:s).cmpn(0)<0&&e.iadd(t),e},h.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var i=this.clone(),r=t.clone();i.negative=0,r.negative=0;for(var n=0;i.isEven()&&r.isEven();n++)i.iushrn(1),r.iushrn(1);for(;;){for(;i.isEven();)i.iushrn(1);for(;r.isEven();)r.iushrn(1);var h=i.cmp(r);if(h<0){var e=i;i=r,r=e}else if(0===h||0===r.cmpn(1))break;i.isub(r)}return r.iushln(n)},h.prototype.invm=function(t){return this.egcd(t).a.umod(t)},h.prototype.isEven=function(){return 0==(1&this.words[0])},h.prototype.isOdd=function(){return 1==(1&this.words[0])},h.prototype.andln=function(t){return this.words[0]&t},h.prototype.bincn=function(t){r("number"==typeof t);var i=t%26,n=(t-i)/26,h=1<<i;if(this.length<=n)return this._expand(n+1),this.words[n]|=h,this;for(var e=h,o=n;0!==e&&o<this.length;o++){var s=0|this.words[o];e=(s+=e)>>>26,s&=67108863,this.words[o]=s}return 0!==e&&(this.words[o]=e,this.length++),this},h.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},h.prototype.cmpn=function(t){var i,n=t<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)i=1;else{n&&(t=-t),r(t<=67108863,"Number is too big");var h=0|this.words[0];i=h===t?0:h<t?-1:1}return 0!==this.negative?0|-i:i},h.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var i=this.ucmp(t);return 0!==this.negative?0|-i:i},h.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var i=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],h=0|t.words[r];if(n!==h){n<h?i=-1:n>h&&(i=1);break}}return i},h.prototype.gtn=function(t){return 1===this.cmpn(t)},h.prototype.gt=function(t){return 1===this.cmp(t)},h.prototype.gten=function(t){return this.cmpn(t)>=0},h.prototype.gte=function(t){return this.cmp(t)>=0},h.prototype.ltn=function(t){return-1===this.cmpn(t)},h.prototype.lt=function(t){return-1===this.cmp(t)},h.prototype.lten=function(t){return this.cmpn(t)<=0},h.prototype.lte=function(t){return this.cmp(t)<=0},h.prototype.eqn=function(t){return 0===this.cmpn(t)},h.prototype.eq=function(t){return 0===this.cmp(t)},h.red=function(t){return new S(t)},h.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},h.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},h.prototype._forceRed=function(t){return this.red=t,this},h.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},h.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},h.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},h.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},h.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},h.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},h.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},h.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},h.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},h.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},h.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},h.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},h.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},h.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var w={k256:null,p224:null,p192:null,p25519:null};function y(t,i){this.name=t,this.p=new h(i,16),this.n=this.p.bitLength(),this.k=new h(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function k(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var i=h._prime(t);this.m=i.p,this.prime=i}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function x(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new h(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)}y.prototype._tmp=function(){var t=new h(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var i,r=t;do{this.split(r,this.tmp),i=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(i>this.n);var n=i<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(t,i){t.iushrn(this.n,0,i)},y.prototype.imulK=function(t){return t.imul(this.k)},n(b,y),b.prototype.split=function(t,i){for(var r=Math.min(t.length,9),n=0;n<r;n++)i.words[n]=t.words[n];if(i.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var h=t.words[9];for(i.words[i.length++]=4194303&h,n=10;n<t.length;n++){var e=0|t.words[n];t.words[n-10]=(4194303&e)<<4|h>>>22,h=e}h>>>=22,t.words[n-10]=h,0===h&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var i=0,r=0;r<t.length;r++){var n=0|t.words[r];i+=977*n,t.words[r]=67108863&i,i=64*n+(i/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(_,y),n(k,y),n(A,y),A.prototype.imulK=function(t){for(var i=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+i,h=67108863&n;n>>>=26,t.words[r]=h,i=n}return 0!==i&&(t.words[t.length++]=i),t},h._prime=function(t){if(w[t])return w[t];var i;if("k256"===t)i=new b;else if("p224"===t)i=new _;else if("p192"===t)i=new k;else{if("p25519"!==t)throw new Error("Unknown prime "+t);i=new A}return w[t]=i,i},S.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,i){r(0==(t.negative|i.negative),"red works only with positives"),r(t.red&&t.red===i.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(a(t,t.umod(this.m)._forceRed(this)),t)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,i){this._verify2(t,i);var r=t.add(i);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,i){this._verify2(t,i);var r=t.iadd(i);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,i){this._verify2(t,i);var r=t.sub(i);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,i){this._verify2(t,i);var r=t.isub(i);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,i){return this._verify1(t),this.imod(t.ushln(i))},S.prototype.imul=function(t,i){return this._verify2(t,i),this.imod(t.imul(i))},S.prototype.mul=function(t,i){return this._verify2(t,i),this.imod(t.mul(i))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var i=this.m.andln(3);if(r(i%2==1),3===i){var n=this.m.add(new h(1)).iushrn(2);return this.pow(t,n)}for(var e=this.m.subn(1),o=0;!e.isZero()&&0===e.andln(1);)o++,e.iushrn(1);r(!e.isZero());var s=new h(1).toRed(this),u=s.redNeg(),a=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new h(2*l*l).toRed(this);0!==this.pow(l,a).cmp(u);)l.redIAdd(u);for(var m=this.pow(l,e),f=this.pow(t,e.addn(1).iushrn(1)),d=this.pow(t,e),p=o;0!==d.cmp(s);){for(var M=d,v=0;0!==M.cmp(s);v++)M=M.redSqr();r(v<p);var g=this.pow(m,new h(1).iushln(p-v-1));f=f.redMul(g),m=g.redSqr(),d=d.redMul(m),p=v}return f},S.prototype.invm=function(t){var i=t._invmp(this.m);return 0!==i.negative?(i.negative=0,this.imod(i).redNeg()):this.imod(i)},S.prototype.pow=function(t,i){if(i.isZero())return new h(1).toRed(this);if(0===i.cmpn(1))return t.clone();var r=new Array(16);r[0]=new h(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var e=r[0],o=0,s=0,u=i.bitLength()%26;for(0===u&&(u=26),n=i.length-1;n>=0;n--){for(var a=i.words[n],l=u-1;l>=0;l--){var m=a>>l&1;e!==r[0]&&(e=this.sqr(e)),0!==m||0!==o?(o<<=1,o|=m,(4===++s||0===n&&0===l)&&(e=this.mul(e,r[o]),s=0,o=0)):s=0}u=26}return e},S.prototype.convertTo=function(t){var i=t.umod(this.m);return i===t?i.clone():i},S.prototype.convertFrom=function(t){var i=t.clone();return i.red=null,i},h.mont=function(t){return new x(t)},n(x,S),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var i=this.imod(t.mul(this.rinv));return i.red=null,i},x.prototype.imul=function(t,i){if(t.isZero()||i.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(i),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=r.isub(n).iushrn(this.shift),e=h;return h.cmp(this.m)>=0?e=h.isub(this.m):h.cmpn(0)<0&&(e=h.iadd(this.m)),e._forceRed(this)},x.prototype.mul=function(t,i){if(t.isZero()||i.isZero())return new h(0)._forceRed(this);var r=t.mul(i),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=r.isub(n).iushrn(this.shift),o=e;return e.cmp(this.m)>=0?o=e.isub(this.m):e.cmpn(0)<0&&(o=e.iadd(this.m)),o._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}("undefined"==typeof module||module,this);
},{"buffer":"rDCW"}],"yh9p":[function(require,module,exports) {
"use strict";exports.byteLength=u,exports.toByteArray=i,exports.fromByteArray=d;for(var r=[],t=[],e="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=n.length;o<a;++o)r[o]=n[o],t[n.charCodeAt(o)]=o;function h(r){var t=r.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");return-1===e&&(e=t),[e,e===t?0:4-e%4]}function u(r){var t=h(r),e=t[0],n=t[1];return 3*(e+n)/4-n}function c(r,t,e){return 3*(t+e)/4-e}function i(r){var n,o,a=h(r),u=a[0],i=a[1],f=new e(c(r,u,i)),A=0,d=i>0?u-4:u;for(o=0;o<d;o+=4)n=t[r.charCodeAt(o)]<<18|t[r.charCodeAt(o+1)]<<12|t[r.charCodeAt(o+2)]<<6|t[r.charCodeAt(o+3)],f[A++]=n>>16&255,f[A++]=n>>8&255,f[A++]=255&n;return 2===i&&(n=t[r.charCodeAt(o)]<<2|t[r.charCodeAt(o+1)]>>4,f[A++]=255&n),1===i&&(n=t[r.charCodeAt(o)]<<10|t[r.charCodeAt(o+1)]<<4|t[r.charCodeAt(o+2)]>>2,f[A++]=n>>8&255,f[A++]=255&n),f}function f(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function A(r,t,e){for(var n,o=[],a=t;a<e;a+=3)n=(r[a]<<16&16711680)+(r[a+1]<<8&65280)+(255&r[a+2]),o.push(f(n));return o.join("")}function d(t){for(var e,n=t.length,o=n%3,a=[],h=0,u=n-o;h<u;h+=16383)a.push(A(t,h,h+16383>u?u:h+16383));return 1===o?(e=t[n-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),a.join("")}t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63;
},{}],"JgNJ":[function(require,module,exports) {
exports.read=function(a,o,t,r,h){var M,p,w=8*h-r-1,f=(1<<w)-1,e=f>>1,i=-7,N=t?h-1:0,n=t?-1:1,s=a[o+N];for(N+=n,M=s&(1<<-i)-1,s>>=-i,i+=w;i>0;M=256*M+a[o+N],N+=n,i-=8);for(p=M&(1<<-i)-1,M>>=-i,i+=r;i>0;p=256*p+a[o+N],N+=n,i-=8);if(0===M)M=1-e;else{if(M===f)return p?NaN:1/0*(s?-1:1);p+=Math.pow(2,r),M-=e}return(s?-1:1)*p*Math.pow(2,M-r)},exports.write=function(a,o,t,r,h,M){var p,w,f,e=8*M-h-1,i=(1<<e)-1,N=i>>1,n=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,s=r?0:M-1,u=r?1:-1,l=o<0||0===o&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(w=isNaN(o)?1:0,p=i):(p=Math.floor(Math.log(o)/Math.LN2),o*(f=Math.pow(2,-p))<1&&(p--,f*=2),(o+=p+N>=1?n/f:n*Math.pow(2,1-N))*f>=2&&(p++,f/=2),p+N>=i?(w=0,p=i):p+N>=1?(w=(o*f-1)*Math.pow(2,h),p+=N):(w=o*Math.pow(2,N-1)*Math.pow(2,h),p=0));h>=8;a[t+s]=255&w,s+=u,w/=256,h-=8);for(p=p<<h|w,e+=h;e>0;a[t+s]=255&p,s+=u,p/=256,e-=8);a[t+s-u]|=128*l};
},{}],"REa7":[function(require,module,exports) {
var r={}.toString;module.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)};
},{}],"dskh":[function(require,module,exports) {
var global = arguments[3];
var t=arguments[3],r=require("base64-js"),e=require("ieee754"),n=require("isarray");function i(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(r){return!1}}function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,r){if(o()<r)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=f.prototype:(null===t&&(t=new f(r)),t.length=r),t}function f(t,r,e){if(!(f.TYPED_ARRAY_SUPPORT||this instanceof f))return new f(t,r,e);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return s(this,t,r,e)}function s(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?g(t,r,e,n):"string"==typeof r?l(t,r,e):y(t,r)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function a(t,r,e,n){return h(r),r<=0?u(t,r):void 0!==e?"string"==typeof n?u(t,r).fill(e,n):u(t,r).fill(e):u(t,r)}function c(t,r){if(h(r),t=u(t,r<0?0:0|w(r)),!f.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function l(t,r,e){if("string"==typeof e&&""!==e||(e="utf8"),!f.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|v(r,e),i=(t=u(t,n)).write(r,e);return i!==n&&(t=t.slice(0,i)),t}function p(t,r){var e=r.length<0?0:0|w(r.length);t=u(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function g(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n),f.TYPED_ARRAY_SUPPORT?(t=r).__proto__=f.prototype:t=p(t,r),t}function y(t,r){if(f.isBuffer(r)){var e=0|w(r.length);return 0===(t=u(t,e)).length?t:(r.copy(t,0,0,e),t)}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||W(r.length)?u(t,0):p(t,r);if("Buffer"===r.type&&n(r.data))return p(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function w(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function d(t){return+t!=t&&(t=0),f.alloc(+t)}function v(t,r){if(f.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return K(t).length;default:if(n)return $(t).length;r=(""+r).toLowerCase(),n=!0}}function E(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return x(this,r,e);case"utf8":case"utf-8":return Y(this,r,e);case"ascii":return L(this,r,e);case"latin1":case"binary":return D(this,r,e);case"base64":return S(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function R(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0){if(!i)return-1;e=0}if("string"==typeof r&&(r=f.from(r,n)),f.isBuffer(r))return 0===r.length?-1:_(t,r,e,n,i);if("number"==typeof r)return r&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):_(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function _(t,r,e,n,i){var o,u=1,f=t.length,s=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;u=2,f/=2,s/=2,e/=2}function h(t,r){return 1===u?t[r]:t.readUInt16BE(r*u)}if(i){var a=-1;for(o=e;o<f;o++)if(h(t,o)===h(r,-1===a?0:o-a)){if(-1===a&&(a=o),o-a+1===s)return a*u}else-1!==a&&(o-=o-a),a=-1}else for(e+s>f&&(e=f-s),o=e;o>=0;o--){for(var c=!0,l=0;l<s;l++)if(h(t,o+l)!==h(r,l)){c=!1;break}if(c)return o}return-1}function A(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n))>i&&(n=i):n=i;var o=r.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var u=0;u<n;++u){var f=parseInt(r.substr(2*u,2),16);if(isNaN(f))return u;t[e+u]=f}return u}function m(t,r,e,n){return Q($(r,t.length-e),t,e,n)}function P(t,r,e,n){return Q(G(r),t,e,n)}function T(t,r,e,n){return P(t,r,e,n)}function B(t,r,e,n){return Q(K(r),t,e,n)}function U(t,r,e,n){return Q(H(r,t.length-e),t,e,n)}function S(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function Y(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o,u,f,s,h=t[i],a=null,c=h>239?4:h>223?3:h>191?2:1;if(i+c<=e)switch(c){case 1:h<128&&(a=h);break;case 2:128==(192&(o=t[i+1]))&&(s=(31&h)<<6|63&o)>127&&(a=s);break;case 3:o=t[i+1],u=t[i+2],128==(192&o)&&128==(192&u)&&(s=(15&h)<<12|(63&o)<<6|63&u)>2047&&(s<55296||s>57343)&&(a=s);break;case 4:o=t[i+1],u=t[i+2],f=t[i+3],128==(192&o)&&128==(192&u)&&128==(192&f)&&(s=(15&h)<<18|(63&o)<<12|(63&u)<<6|63&f)>65535&&s<1114112&&(a=s)}null===a?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=c}return O(n)}exports.Buffer=f,exports.SlowBuffer=d,exports.INSPECT_MAX_BYTES=50,f.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:i(),exports.kMaxLength=o(),f.poolSize=8192,f._augment=function(t){return t.__proto__=f.prototype,t},f.from=function(t,r,e){return s(null,t,r,e)},f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0})),f.alloc=function(t,r,e){return a(null,t,r,e)},f.allocUnsafe=function(t){return c(null,t)},f.allocUnsafeSlow=function(t){return c(null,t)},f.isBuffer=function(t){return!(null==t||!t._isBuffer)},f.compare=function(t,r){if(!f.isBuffer(t)||!f.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,i=0,o=Math.min(e,n);i<o;++i)if(t[i]!==r[i]){e=t[i],n=r[i];break}return e<n?-1:n<e?1:0},f.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(t,r){if(!n(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var i=f.allocUnsafe(r),o=0;for(e=0;e<t.length;++e){var u=t[e];if(!f.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(i,o),o+=u.length}return i},f.byteLength=v,f.prototype._isBuffer=!0,f.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)b(this,r,r+1);return this},f.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)b(this,r,r+3),b(this,r+1,r+2);return this},f.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)b(this,r,r+7),b(this,r+1,r+6),b(this,r+2,r+5),b(this,r+3,r+4);return this},f.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?Y(this,0,t):E.apply(this,arguments)},f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){var t="",r=exports.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},f.prototype.compare=function(t,r,e,n,i){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),r<0||e>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&r>=e)return 0;if(n>=i)return-1;if(r>=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),u=(e>>>=0)-(r>>>=0),s=Math.min(o,u),h=this.slice(n,i),a=t.slice(r,e),c=0;c<s;++c)if(h[c]!==a[c]){o=h[c],u=a[c];break}return o<u?-1:u<o?1:0},f.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},f.prototype.indexOf=function(t,r,e){return R(this,t,r,e,!0)},f.prototype.lastIndexOf=function(t,r,e){return R(this,t,r,e,!1)},f.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var i=this.length-r;if((void 0===e||e>i)&&(e=i),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return A(this,t,r,e);case"utf8":case"utf-8":return m(this,t,r,e);case"ascii":return P(this,t,r,e);case"latin1":case"binary":return T(this,t,r,e);case"base64":return B(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,t,r,e);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function O(t){var r=t.length;if(r<=I)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=I));return e}function L(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(127&t[i]);return n}function D(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function x(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=Z(t[o]);return i}function C(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function M(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function k(t,r,e,n,i,o){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function N(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function z(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>8*(n?i:3-i)&255}function F(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function j(t,r,n,i,o){return o||F(t,r,n,4,3.4028234663852886e38,-3.4028234663852886e38),e.write(t,r,n,i,23,4),n+4}function q(t,r,n,i,o){return o||F(t,r,n,8,1.7976931348623157e308,-1.7976931348623157e308),e.write(t,r,n,i,52,8),n+8}f.prototype.slice=function(t,r){var e,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t),f.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,r)).__proto__=f.prototype;else{var i=r-t;e=new f(i,void 0);for(var o=0;o<i;++o)e[o]=this[o+t]}return e},f.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n},f.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t+--r],i=1;r>0&&(i*=256);)n+=this[t+--r]*i;return n},f.prototype.readUInt8=function(t,r){return r||M(t,1,this.length),this[t]},f.prototype.readUInt16LE=function(t,r){return r||M(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUInt16BE=function(t,r){return r||M(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUInt32LE=function(t,r){return r||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUInt32BE=function(t,r){return r||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*r)),n},f.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=r,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*r)),o},f.prototype.readInt8=function(t,r){return r||M(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},f.prototype.readInt16LE=function(t,r){r||M(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},f.prototype.readInt16BE=function(t,r){r||M(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},f.prototype.readInt32LE=function(t,r){return r||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,r){return r||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readFloatLE=function(t,r){return r||M(t,4,this.length),e.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,r){return r||M(t,4,this.length),e.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,r){return r||M(t,8,this.length),e.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,r){return r||M(t,8,this.length),e.read(this,t,!1,52,8)},f.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||k(this,t,r,e,Math.pow(2,8*e)-1,0);var i=1,o=0;for(this[r]=255&t;++o<e&&(i*=256);)this[r+o]=t/i&255;return r+e},f.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||k(this,t,r,e,Math.pow(2,8*e)-1,0);var i=e-1,o=1;for(this[r+i]=255&t;--i>=0&&(o*=256);)this[r+i]=t/o&255;return r+e},f.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,1,255,0),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},f.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):N(this,t,r,!0),r+2},f.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):N(this,t,r,!1),r+2},f.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):z(this,t,r,!0),r+4},f.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):z(this,t,r,!1),r+4},f.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);k(this,t,r,e,i-1,-i)}var o=0,u=1,f=0;for(this[r]=255&t;++o<e&&(u*=256);)t<0&&0===f&&0!==this[r+o-1]&&(f=1),this[r+o]=(t/u>>0)-f&255;return r+e},f.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);k(this,t,r,e,i-1,-i)}var o=e-1,u=1,f=0;for(this[r+o]=255&t;--o>=0&&(u*=256);)t<0&&0===f&&0!==this[r+o+1]&&(f=1),this[r+o]=(t/u>>0)-f&255;return r+e},f.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,1,127,-128),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},f.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):N(this,t,r,!0),r+2},f.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):N(this,t,r,!1),r+2},f.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):z(this,t,r,!0),r+4},f.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):z(this,t,r,!1),r+4},f.prototype.writeFloatLE=function(t,r,e){return j(this,t,r,!0,e)},f.prototype.writeFloatBE=function(t,r,e){return j(this,t,r,!1,e)},f.prototype.writeDoubleLE=function(t,r,e){return q(this,t,r,!0,e)},f.prototype.writeDoubleBE=function(t,r,e){return q(this,t,r,!1,e)},f.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var i,o=n-e;if(this===t&&e<r&&r<n)for(i=o-1;i>=0;--i)t[i+r]=this[i+e];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+r]=this[i+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+o),r);return o},f.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!f.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;var o;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(o=r;o<e;++o)this[o]=t;else{var u=f.isBuffer(t)?t:$(new f(t,n).toString()),s=u.length;for(o=0;o<e-r;++o)this[o+r]=u[o%s]}return this};var V=/[^+\/0-9A-Za-z-_]/g;function X(t){if((t=J(t).replace(V,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}function J(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Z(t){return t<16?"0"+t.toString(16):t.toString(16)}function $(t,r){var e;r=r||1/0;for(var n=t.length,i=null,o=[],u=0;u<n;++u){if((e=t.charCodeAt(u))>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}if(u+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=65536+(i-55296<<10|e-56320)}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}function G(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}function H(t,r){for(var e,n,i,o=[],u=0;u<t.length&&!((r-=2)<0);++u)n=(e=t.charCodeAt(u))>>8,i=e%256,o.push(i),o.push(n);return o}function K(t){return r.toByteArray(X(t))}function Q(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function W(t){return t!=t}
},{"base64-js":"yh9p","ieee754":"JgNJ","isarray":"REa7","buffer":"dskh"}],"Wugr":[function(require,module,exports) {
var r=require("buffer"),e=r.Buffer;function o(r,e){for(var o in r)e[o]=r[o]}function n(r,o,n){return e(r,o,n)}e.from&&e.alloc&&e.allocUnsafe&&e.allocUnsafeSlow?module.exports=r:(o(r,exports),exports.Buffer=n),n.prototype=Object.create(e.prototype),o(e,n),n.from=function(r,o,n){if("number"==typeof r)throw new TypeError("Argument must not be a number");return e(r,o,n)},n.alloc=function(r,o,n){if("number"!=typeof r)throw new TypeError("Argument must be a number");var t=e(r);return void 0!==o?"string"==typeof n?t.fill(o,n):t.fill(o):t.fill(0),t},n.allocUnsafe=function(r){if("number"!=typeof r)throw new TypeError("Argument must be a number");return e(r)},n.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)};
},{"buffer":"dskh"}],"g2zT":[function(require,module,exports) {
"use strict";var r=require("safe-buffer").Buffer;function e(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var o=new Uint8Array(256),t=0;t<o.length;t++)o[t]=255;for(var n=0;n<e.length;n++){var a=e.charAt(n),f=a.charCodeAt(0);if(255!==o[f])throw new TypeError(a+" is ambiguous");o[f]=n}var i=e.length,h=e.charAt(0),c=Math.log(i)/Math.log(256),l=Math.log(256)/Math.log(i);function u(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return r.alloc(0);for(var t=0,n=0,a=0;e[t]===h;)n++,t++;for(var f=(e.length-t)*c+1>>>0,l=new Uint8Array(f);e[t];){var u=o[e.charCodeAt(t)];if(255===u)return;for(var v=0,w=f-1;(0!==u||v<a)&&-1!==w;w--,v++)u+=i*l[w]>>>0,l[w]=u%256>>>0,u=u/256>>>0;if(0!==u)throw new Error("Non-zero carry");a=v,t++}for(var g=f-a;g!==f&&0===l[g];)g++;var s=r.allocUnsafe(n+(f-g));s.fill(0,0,n);for(var y=n;g!==f;)s[y++]=l[g++];return s}return{encode:function(o){if((Array.isArray(o)||o instanceof Uint8Array)&&(o=r.from(o)),!r.isBuffer(o))throw new TypeError("Expected Buffer");if(0===o.length)return"";for(var t=0,n=0,a=0,f=o.length;a!==f&&0===o[a];)a++,t++;for(var c=(f-a)*l+1>>>0,u=new Uint8Array(c);a!==f;){for(var v=o[a],w=0,g=c-1;(0!==v||w<n)&&-1!==g;g--,w++)v+=256*u[g]>>>0,u[g]=v%i>>>0,v=v/i>>>0;if(0!==v)throw new Error("Non-zero carry");n=w,a++}for(var s=c-n;s!==c&&0===u[s];)s++;for(var y=h.repeat(t);s<c;++s)y+=e.charAt(u[s]);return y},decodeUnsafe:u,decode:function(r){var e=u(r);if(e)return e;throw new Error("Non-base"+i+" character")}}}module.exports=e;
},{"safe-buffer":"Wugr"}],"GtuF":[function(require,module,exports) {
var e=require("base-x"),r="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";module.exports=e(r);
},{"base-x":"g2zT"}],"u2Lg":[function(require,module,exports) {
"use strict";function e(e,r,t){return r<=e&&e<=t}function r(e){if(void 0===e)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function t(e){for(var r=String(e),t=r.length,n=0,i=[];n<t;){var o=r.charCodeAt(n);if(o<55296||o>57343)i.push(o);else if(56320<=o&&o<=57343)i.push(65533);else if(55296<=o&&o<=56319)if(n===t-1)i.push(65533);else{var s=e.charCodeAt(n+1);if(56320<=s&&s<=57343){var a=1023&o,f=1023&s;i.push(65536+(a<<10)+f),n+=1}else i.push(65533)}n+=1}return i}function n(e){for(var r="",t=0;t<e.length;++t){var n=e[t];n<=65535?r+=String.fromCharCode(n):(n-=65536,r+=String.fromCharCode(55296+(n>>10),56320+(1023&n)))}return r}var i=-1;function o(e){this.tokens=[].slice.call(e)}o.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():i},prepend:function(e){if(Array.isArray(e))for(var r=e;r.length;)this.tokens.unshift(r.pop());else this.tokens.unshift(e)},push:function(e){if(Array.isArray(e))for(var r=e;r.length;)this.tokens.push(r.shift());else this.tokens.push(e)}};var s=-1;function a(e,r){if(e)throw TypeError("Decoder error");return r||65533}var f="utf-8";function h(e,t){if(!(this instanceof h))return new h(e,t);if((e=void 0!==e?String(e).toLowerCase():f)!==f)throw new Error("Encoding not supported. Only utf-8 is supported");t=r(t),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=Boolean(t.fatal),this._ignoreBOM=Boolean(t.ignoreBOM),Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}function u(e,t){if(!(this instanceof u))return new u(e,t);if((e=void 0!==e?String(e).toLowerCase():f)!==f)throw new Error("Encoding not supported. Only utf-8 is supported");t=r(t),this._streaming=!1,this._encoder=null,this._options={fatal:Boolean(t.fatal)},Object.defineProperty(this,"encoding",{value:"utf-8"})}function l(r){var t=r.fatal,n=0,o=0,f=0,h=128,u=191;this.handler=function(r,l){if(l===i&&0!==f)return f=0,a(t);if(l===i)return s;if(0===f){if(e(l,0,127))return l;if(e(l,194,223))f=1,n=l-192;else if(e(l,224,239))224===l&&(h=160),237===l&&(u=159),f=2,n=l-224;else{if(!e(l,240,244))return a(t);240===l&&(h=144),244===l&&(u=143),f=3,n=l-240}return n<<=6*f,null}if(!e(l,h,u))return n=f=o=0,h=128,u=191,r.prepend(l),a(t);if(h=128,u=191,n+=l-128<<6*(f-(o+=1)),o!==f)return null;var d=n;return n=f=o=0,d}}function d(r){r.fatal;this.handler=function(r,t){if(t===i)return s;if(e(t,0,127))return t;var n,o;e(t,128,2047)?(n=1,o=192):e(t,2048,65535)?(n=2,o=224):e(t,65536,1114111)&&(n=3,o=240);for(var a=[(t>>6*n)+o];n>0;){var f=t>>6*(n-1);a.push(128|63&f),n-=1}return a}}h.prototype={decode:function(e,t){var i;i="object"==typeof e&&e instanceof ArrayBuffer?new Uint8Array(e):"object"==typeof e&&"buffer"in e&&e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(0),t=r(t),this._streaming||(this._decoder=new l({fatal:this._fatal}),this._BOMseen=!1),this._streaming=Boolean(t.stream);for(var a,f=new o(i),h=[];!f.endOfStream()&&(a=this._decoder.handler(f,f.read()))!==s;)null!==a&&(Array.isArray(a)?h.push.apply(h,a):h.push(a));if(!this._streaming){do{if((a=this._decoder.handler(f,f.read()))===s)break;null!==a&&(Array.isArray(a)?h.push.apply(h,a):h.push(a))}while(!f.endOfStream());this._decoder=null}return h.length&&(-1===["utf-8"].indexOf(this.encoding)||this._ignoreBOM||this._BOMseen||(65279===h[0]?(this._BOMseen=!0,h.shift()):this._BOMseen=!0)),n(h)}},u.prototype={encode:function(e,n){e=e?String(e):"",n=r(n),this._streaming||(this._encoder=new d(this._options)),this._streaming=Boolean(n.stream);for(var i,a=[],f=new o(t(e));!f.endOfStream()&&(i=this._encoder.handler(f,f.read()))!==s;)Array.isArray(i)?a.push.apply(a,i):a.push(i);if(!this._streaming){for(;(i=this._encoder.handler(f,f.read()))!==s;)Array.isArray(i)?a.push.apply(a,i):a.push(i);this._encoder=null}return new Uint8Array(a)}},exports.TextEncoder=u,exports.TextDecoder=h;
},{}],"C6Jz":[function(require,module,exports) {
var global = arguments[3];
var Buffer = require("buffer").Buffer;
var e=arguments[3],t=require("buffer").Buffer,r=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__decorate||function(e,t,r,i){var n,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,i);else for(var f=e.length-1;f>=0;f--)(n=e[f])&&(o=(s<3?n(o):s>3?n(t,r,o):n(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.deserializeUnchecked=exports.deserialize=exports.serialize=exports.BinaryReader=exports.BinaryWriter=exports.BorshError=exports.baseDecode=exports.baseEncode=void 0;const f=o(require("bn.js")),a=o(require("bs58")),u=s(require("text-encoding-utf-8")),h="function"!=typeof e.TextDecoder?u.TextDecoder:e.TextDecoder,l=new h("utf-8",{fatal:!0});function c(e){return"string"==typeof e&&(e=t.from(e,"utf8")),a.default.encode(t.from(e))}function d(e){return t.from(a.default.decode(e))}exports.baseEncode=c,exports.baseDecode=d;const y=1024;class p extends Error{constructor(e){super(e),this.fieldPath=[],this.originalMessage=e}addToFieldPath(e){this.fieldPath.splice(0,0,e),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}exports.BorshError=p;class w{constructor(){this.buf=t.alloc(y),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=t.concat([this.buf,t.alloc(y)]))}writeU8(e){this.maybeResize(),this.buf.writeUInt8(e,this.length),this.length+=1}writeU16(e){this.maybeResize(),this.buf.writeUInt16LE(e,this.length),this.length+=2}writeU32(e){this.maybeResize(),this.buf.writeUInt32LE(e,this.length),this.length+=4}writeU64(e){this.maybeResize(),this.writeBuffer(t.from(new f.default(e).toArray("le",8)))}writeU128(e){this.maybeResize(),this.writeBuffer(t.from(new f.default(e).toArray("le",16)))}writeU256(e){this.maybeResize(),this.writeBuffer(t.from(new f.default(e).toArray("le",32)))}writeU512(e){this.maybeResize(),this.writeBuffer(t.from(new f.default(e).toArray("le",64)))}writeBuffer(e){this.buf=t.concat([t.from(this.buf.subarray(0,this.length)),e,t.alloc(y)]),this.length+=e.length}writeString(e){this.maybeResize();const r=t.from(e,"utf8");this.writeU32(r.length),this.writeBuffer(r)}writeFixedArray(e){this.writeBuffer(t.from(e))}writeArray(e,t){this.maybeResize(),this.writeU32(e.length);for(const r of e)this.maybeResize(),t(r)}toArray(){return this.buf.subarray(0,this.length)}}function b(e,t,r){const i=r.value;r.value=function(...e){try{return i.apply(this,e)}catch(t){if(t instanceof RangeError){const e=t.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(e)>=0)throw new p("Reached the end of buffer when deserializing")}throw t}}}exports.BinaryWriter=w;class g{constructor(e){this.buf=e,this.offset=0}readU8(){const e=this.buf.readUInt8(this.offset);return this.offset+=1,e}readU16(){const e=this.buf.readUInt16LE(this.offset);return this.offset+=2,e}readU32(){const e=this.buf.readUInt32LE(this.offset);return this.offset+=4,e}readU64(){const e=this.readBuffer(8);return new f.default(e,"le")}readU128(){const e=this.readBuffer(16);return new f.default(e,"le")}readU256(){const e=this.readBuffer(32);return new f.default(e,"le")}readU512(){const e=this.readBuffer(64);return new f.default(e,"le")}readBuffer(e){if(this.offset+e>this.buf.length)throw new p(`Expected buffer length ${e} isn't within bounds`);const t=this.buf.slice(this.offset,this.offset+e);return this.offset+=e,t}readString(){const e=this.readU32(),t=this.readBuffer(e);try{return l.decode(t)}catch(r){throw new p(`Error decoding UTF-8 string: ${r}`)}}readFixedArray(e){return new Uint8Array(this.readBuffer(e))}readArray(e){const t=this.readU32(),r=Array();for(let i=0;i<t;++i)r.push(e());return r}}function U(e){return e.charAt(0).toUpperCase()+e.slice(1)}function m(e,t,r,i,n){try{if("string"==typeof i)n[`write${U(i)}`](r);else if(i instanceof Array)if("number"==typeof i[0]){if(r.length!==i[0])throw new p(`Expecting byte array of length ${i[0]}, but got ${r.length} bytes`);n.writeFixedArray(r)}else if(2===i.length&&"number"==typeof i[1]){if(r.length!==i[1])throw new p(`Expecting byte array of length ${i[1]}, but got ${r.length} bytes`);for(let t=0;t<i[1];t++)m(e,null,r[t],i[0],n)}else n.writeArray(r,r=>{m(e,t,r,i[0],n)});else if(void 0!==i.kind)switch(i.kind){case"option":null==r?n.writeU8(0):(n.writeU8(1),m(e,t,r,i.type,n));break;default:throw new p(`FieldType ${i} unrecognized`)}else x(e,r,n)}catch(s){throw s instanceof p&&s.addToFieldPath(t),s}}function x(e,t,r){if("function"==typeof t.borshSerialize)return void t.borshSerialize(r);const i=e.get(t.constructor);if(!i)throw new p(`Class ${t.constructor.name} is missing in schema`);if("struct"===i.kind)i.fields.map(([i,n])=>{m(e,i,t[i],n,r)});else{if("enum"!==i.kind)throw new p(`Unexpected schema kind: ${i.kind} for ${t.constructor.name}`);{const n=t[i.field];for(let s=0;s<i.values.length;++s){const[o,f]=i.values[s];if(o===n){r.writeU8(s),m(e,o,t[o],f,r);break}}}}}function z(e,t,r=w){const i=new r;return x(e,t,i),i.toArray()}function B(e,t,r,i){try{if("string"==typeof r)return i[`read${U(r)}`]();if(r instanceof Array){if("number"==typeof r[0])return i.readFixedArray(r[0]);if("number"==typeof r[1]){const t=[];for(let n=0;n<r[1];n++)t.push(B(e,null,r[0],i));return t}return i.readArray(()=>B(e,t,r[0],i))}if("option"===r.kind){return i.readU8()?B(e,t,r.type,i):void 0}return R(e,r,i)}catch(n){throw n instanceof p&&n.addToFieldPath(t),n}}function R(e,t,r){if("function"==typeof t.borshDeserialize)return t.borshDeserialize(r);const i=e.get(t);if(!i)throw new p(`Class ${t.name} is missing in schema`);if("struct"===i.kind){const i={};for(const[n,s]of e.get(t).fields)i[n]=B(e,n,s,r);return new t(i)}if("enum"===i.kind){const n=r.readU8();if(n>=i.values.length)throw new p(`Enum index: ${n} is out of range`);const[s,o]=i.values[n];return new t({[s]:B(e,s,o,r)})}throw new p(`Unexpected schema kind: ${i.kind} for ${t.constructor.name}`)}function _(e,t,r,i=g){const n=new i(r),s=R(e,t,n);if(n.offset<r.length)throw new p(`Unexpected ${r.length-n.offset} bytes after deserialized data`);return s}function A(e,t,r,i=g){return R(e,t,new i(r))}n([b],g.prototype,"readU8",null),n([b],g.prototype,"readU16",null),n([b],g.prototype,"readU32",null),n([b],g.prototype,"readU64",null),n([b],g.prototype,"readU128",null),n([b],g.prototype,"readU256",null),n([b],g.prototype,"readU512",null),n([b],g.prototype,"readString",null),n([b],g.prototype,"readFixedArray",null),n([b],g.prototype,"readArray",null),exports.BinaryReader=g,exports.serialize=z,exports.deserialize=_,exports.deserializeUnchecked=A;
},{"bn.js":"BOxy","bs58":"GtuF","text-encoding-utf-8":"u2Lg","buffer":"dskh"}],"vXEo":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("borsh");Object.defineProperty(exports,"base_encode",{enumerable:!0,get:function(){return e.baseEncode}}),Object.defineProperty(exports,"base_decode",{enumerable:!0,get:function(){return e.baseDecode}}),Object.defineProperty(exports,"serialize",{enumerable:!0,get:function(){return e.serialize}}),Object.defineProperty(exports,"deserialize",{enumerable:!0,get:function(){return e.deserialize}}),Object.defineProperty(exports,"BorshError",{enumerable:!0,get:function(){return e.BorshError}}),Object.defineProperty(exports,"BinaryWriter",{enumerable:!0,get:function(){return e.BinaryWriter}}),Object.defineProperty(exports,"BinaryReader",{enumerable:!0,get:function(){return e.BinaryReader}});
},{"borsh":"C6Jz"}],"bD1J":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Assignable=exports.Enum=void 0;class e{constructor(e){if(1!==Object.keys(e).length)throw new Error("Enum can only take single value");Object.keys(e).map(s=>{this[s]=e[s],this.enum=s})}}exports.Enum=e;class s{constructor(e){Object.keys(e).map(s=>{this[s]=e[s]})}}exports.Assignable=s;
},{}],"kvXx":[function(require,module,exports) {
"use strict";var e=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.KeyPairEd25519=exports.KeyPair=exports.PublicKey=exports.KeyType=void 0;const t=e(require("tweetnacl")),r=require("./serialize"),n=require("./enums");var s;function o(e){switch(e){case s.ED25519:return"ed25519";default:throw new Error(`Unknown key type ${e}`)}}function i(e){switch(e.toLowerCase()){case"ed25519":return s.ED25519;default:throw new Error(`Unknown key type ${e}`)}}!function(e){e[e.ED25519=0]="ED25519"}(s=exports.KeyType||(exports.KeyType={}));class a extends n.Assignable{static from(e){return"string"==typeof e?a.fromString(e):e}static fromString(e){const t=e.split(":");if(1===t.length)return new a({keyType:s.ED25519,data:r.base_decode(t[0])});if(2===t.length)return new a({keyType:i(t[0]),data:r.base_decode(t[1])});throw new Error("Invalid encoded key format, must be <curve>:<encoded key>")}toString(){return`${o(this.keyType)}:${r.base_encode(this.data)}`}}exports.PublicKey=a;class c{static fromRandom(e){switch(e.toUpperCase()){case"ED25519":return u.fromRandom();default:throw new Error(`Unknown curve ${e}`)}}static fromString(e){const t=e.split(":");if(1===t.length)return new u(t[0]);if(2!==t.length)throw new Error("Invalid encoded key format, must be <curve>:<encoded key>");switch(t[0].toUpperCase()){case"ED25519":return new u(t[1]);default:throw new Error(`Unknown curve: ${t[0]}`)}}}exports.KeyPair=c;class u extends c{constructor(e){super();const n=t.default.sign.keyPair.fromSecretKey(r.base_decode(e));this.publicKey=new a({keyType:s.ED25519,data:n.publicKey}),this.secretKey=e}static fromRandom(){const e=t.default.sign.keyPair();return new u(r.base_encode(e.secretKey))}sign(e){return{signature:t.default.sign.detached(e,r.base_decode(this.secretKey)),publicKey:this.publicKey}}verify(e,r){return t.default.sign.detached.verify(e,r,this.publicKey.data)}toString(){return`ed25519:${this.secretKey}`}getPublicKey(){return this.publicKey}}exports.KeyPairEd25519=u;
},{"tweetnacl":"WYSB","./serialize":"vXEo","./enums":"bD1J"}],"qQPA":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.InMemoryKeyStore=void 0;const e=require("./keystore"),t=require("../utils/key_pair");class s extends e.KeyStore{constructor(){super(),this.keys={}}async setKey(e,t,s){this.keys[`${t}:${e}`]=s.toString()}async getKey(e,s){const r=this.keys[`${s}:${e}`];return r?t.KeyPair.fromString(r):null}async removeKey(e,t){delete this.keys[`${t}:${e}`]}async clear(){this.keys={}}async getNetworks(){const e=new Set;return Object.keys(this.keys).forEach(t=>{const s=t.split(":");e.add(s[1])}),Array.from(e.values())}async getAccounts(e){const t=new Array;return Object.keys(this.keys).forEach(s=>{const r=s.split(":");r[r.length-1]===e&&t.push(r.slice(0,r.length-1).join(":"))}),t}toString(){return"InMemoryKeyStore"}}exports.InMemoryKeyStore=s;
},{"./keystore":"b5MB","../utils/key_pair":"kvXx"}],"v3DV":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BrowserLocalStorageKeyStore=void 0;const e=require("./keystore"),t=require("../utils/key_pair"),r="near-api-js:keystore:";class s extends e.KeyStore{constructor(e=window.localStorage,t=r){super(),this.localStorage=e,this.prefix=t}async setKey(e,t,r){this.localStorage.setItem(this.storageKeyForSecretKey(e,t),r.toString())}async getKey(e,r){const s=this.localStorage.getItem(this.storageKeyForSecretKey(e,r));return s?t.KeyPair.fromString(s):null}async removeKey(e,t){this.localStorage.removeItem(this.storageKeyForSecretKey(e,t))}async clear(){for(const e of this.storageKeys())e.startsWith(this.prefix)&&this.localStorage.removeItem(e)}async getNetworks(){const e=new Set;for(const t of this.storageKeys())if(t.startsWith(this.prefix)){const r=t.substring(this.prefix.length).split(":");e.add(r[1])}return Array.from(e.values())}async getAccounts(e){const t=new Array;for(const r of this.storageKeys())if(r.startsWith(this.prefix)){const s=r.substring(this.prefix.length).split(":");s[1]===e&&t.push(s[0])}return t}storageKeyForSecretKey(e,t){return`${this.prefix}${t}:${e}`}*storageKeys(){for(let e=0;e<this.localStorage.length;e++)yield this.localStorage.key(e)}}exports.BrowserLocalStorageKeyStore=s;
},{"./keystore":"b5MB","../utils/key_pair":"kvXx"}],"iVAc":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MergeKeyStore=void 0;const e=require("./keystore");class t extends e.KeyStore{constructor(e,t={writeKeyStoreIndex:0}){super(),this.options=t,this.keyStores=e}async setKey(e,t,o){await this.keyStores[this.options.writeKeyStoreIndex].setKey(e,t,o)}async getKey(e,t){for(const o of this.keyStores){const r=await o.getKey(e,t);if(r)return r}return null}async removeKey(e,t){for(const o of this.keyStores)await o.removeKey(e,t)}async clear(){for(const e of this.keyStores)await e.clear()}async getNetworks(){const e=new Set;for(const t of this.keyStores)for(const o of await t.getNetworks())e.add(o);return Array.from(e)}async getAccounts(e){const t=new Set;for(const o of this.keyStores)for(const r of await o.getAccounts(e))t.add(r);return Array.from(t)}toString(){return`MergeKeyStore(${this.keyStores.join(", ")})`}}exports.MergeKeyStore=t;
},{"./keystore":"b5MB"}],"TLlZ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MergeKeyStore=exports.BrowserLocalStorageKeyStore=exports.InMemoryKeyStore=exports.KeyStore=void 0;const e=require("./keystore");Object.defineProperty(exports,"KeyStore",{enumerable:!0,get:function(){return e.KeyStore}});const r=require("./in_memory_key_store");Object.defineProperty(exports,"InMemoryKeyStore",{enumerable:!0,get:function(){return r.InMemoryKeyStore}});const t=require("./browser_local_storage_key_store");Object.defineProperty(exports,"BrowserLocalStorageKeyStore",{enumerable:!0,get:function(){return t.BrowserLocalStorageKeyStore}});const o=require("./merge_key_store");Object.defineProperty(exports,"MergeKeyStore",{enumerable:!0,get:function(){return o.MergeKeyStore}});
},{"./keystore":"b5MB","./in_memory_key_store":"qQPA","./browser_local_storage_key_store":"v3DV","./merge_key_store":"iVAc"}],"y4mD":[function(require,module,exports) {
var Buffer = require("buffer").Buffer;
var t,e,s,r=require("buffer").Buffer;Object.defineProperty(exports,"__esModule",{value:!0}),exports.getTransactionLastResult=exports.Provider=exports.IdType=exports.FinalExecutionStatusBasic=exports.ExecutionStatusBasic=void 0,function(t){t.Unknown="Unknown",t.Pending="Pending",t.Failure="Failure"}(t=exports.ExecutionStatusBasic||(exports.ExecutionStatusBasic={})),function(t){t.NotStarted="NotStarted",t.Started="Started",t.Failure="Failure"}(e=exports.FinalExecutionStatusBasic||(exports.FinalExecutionStatusBasic={})),function(t){t.Transaction="transaction",t.Receipt="receipt"}(s=exports.IdType||(exports.IdType={}));class a{}function n(t){if("object"==typeof t.status&&"string"==typeof t.status.SuccessValue){const s=r.from(t.status.SuccessValue,"base64").toString();try{return JSON.parse(s)}catch(e){return s}}return null}exports.Provider=a,exports.getTransactionLastResult=n;
},{"buffer":"dskh"}],"BGME":[function(require,module,exports) {
"use strict";function e(e){if(!e)throw new TypeError("argument namespace is required");function o(e){}return o._file=void 0,o._ignored=!0,o._namespace=e,o._traced=!1,o._warned=Object.create(null),o.function=r,o.property=t,o}function r(e,r){if("function"!=typeof e)throw new TypeError("argument fn must be a function");return e}function t(e,r,t){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("argument obj must be object");var o=Object.getOwnPropertyDescriptor(e,r);if(!o)throw new TypeError("must call property on owner object");if(!o.configurable)throw new TypeError("property must be configurable")}module.exports=e;
},{}],"br24":[function(require,module,exports) {
"use strict";function t(t,r){return t.__proto__=r,t}function r(t,r){for(var o in r)Object.prototype.hasOwnProperty.call(t,o)||(t[o]=r[o]);return t}module.exports=Object.setPrototypeOf||({__proto__:[]}instanceof Array?t:r);
},{}],"EdQM":[function(require,module,exports) {
module.exports={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"(Unused)",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"};
},{}],"DXbu":[function(require,module,exports) {
"use strict";var r=require("./codes.json");function e(r,e){var t=[];return Object.keys(e).forEach(function(o){var n=e[o],s=Number(o);r[s]=n,r[n]=s,r[n.toLowerCase()]=s,t.push(s)}),t}function t(r){if("number"==typeof r){if(!t[r])throw new Error("invalid status code: "+r);return r}if("string"!=typeof r)throw new TypeError("code must be a number or string");var e=parseInt(r,10);if(!isNaN(e)){if(!t[e])throw new Error("invalid status code: "+e);return e}if(!(e=t[r.toLowerCase()]))throw new Error('invalid status message: "'+r+'"');return e}module.exports=t,t.STATUS_CODES=r,t.codes=e(t,r),t.redirect={300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0},t.empty={204:!0,205:!0,304:!0},t.retry={502:!0,503:!0,504:!0};
},{"./codes.json":"EdQM"}],"Bm0n":[function(require,module,exports) {
"function"==typeof Object.create?module.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:module.exports=function(t,e){if(e){t.super_=e;var o=function(){};o.prototype=e.prototype,t.prototype=new o,t.prototype.constructor=t}};
},{}],"xY5n":[function(require,module,exports) {
"use strict";function e(e){return e.split(" ").map(function(e){return e.slice(0,1).toUpperCase()+e.slice(1)}).join("").replace(/[^ _0-9a-z]/gi,"")}module.exports=e;
},{}],"blzi":[function(require,module,exports) {
"use strict";var e=require("depd")("http-errors"),r=require("setprototypeof"),t=require("statuses"),o=require("inherits"),n=require("toidentifier");function a(e){return Number(String(e).charAt(0)+"00")}function u(){for(var r,o,n=500,s={},c=0;c<arguments.length;c++){var p=arguments[c];if(p instanceof Error)n=(r=p).status||r.statusCode||n;else switch(typeof p){case"string":o=p;break;case"number":n=p,0!==c&&e("non-first-argument status code; replace with createError("+p+", ...)");break;case"object":s=p}}"number"==typeof n&&(n<400||n>=600)&&e("non-error status code; use only 4xx or 5xx status codes"),("number"!=typeof n||!t[n]&&(n<400||n>=600))&&(n=500);var i=u[n]||u[a(n)];for(var f in r||(r=i?new i(o):new Error(o||t[n]),Error.captureStackTrace(r,u)),i&&r instanceof i&&r.status===n||(r.expose=n<500,r.status=r.statusCode=n),s)"status"!==f&&"statusCode"!==f&&(r[f]=s[f]);return r}function s(){function e(){throw new TypeError("cannot construct abstract class")}return o(e,Error),e}function c(e,n,a){var u=b(n);function s(e){var o=null!=e?e:t[a],n=new Error(o);return Error.captureStackTrace(n,s),r(n,s.prototype),Object.defineProperty(n,"message",{enumerable:!0,configurable:!0,value:o,writable:!0}),Object.defineProperty(n,"name",{enumerable:!1,configurable:!0,value:u,writable:!0}),n}return o(s,e),f(s,u),s.prototype.status=a,s.prototype.statusCode=a,s.prototype.expose=!0,s}function p(e){return function(r){return!(!r||"object"!=typeof r)&&(r instanceof e||r instanceof Error&&"boolean"==typeof r.expose&&"number"==typeof r.statusCode&&r.status===r.statusCode)}}function i(e,n,a){var u=b(n);function s(e){var o=null!=e?e:t[a],n=new Error(o);return Error.captureStackTrace(n,s),r(n,s.prototype),Object.defineProperty(n,"message",{enumerable:!0,configurable:!0,value:o,writable:!0}),Object.defineProperty(n,"name",{enumerable:!1,configurable:!0,value:u,writable:!0}),n}return o(s,e),f(s,u),s.prototype.status=a,s.prototype.statusCode=a,s.prototype.expose=!1,s}function f(e,r){var t=Object.getOwnPropertyDescriptor(e,"name");t&&t.configurable&&(t.value=r,Object.defineProperty(e,"name",t))}function l(r,o,u){o.forEach(function(e){var o,s=n(t[e]);switch(a(e)){case 400:o=c(u,s,e);break;case 500:o=i(u,s,e)}o&&(r[e]=o,r[s]=o)}),r["I'mateapot"]=e.function(r.ImATeapot,'"I\'mateapot"; use "ImATeapot" instead')}function b(e){return"Error"!==e.substr(-5)?e+"Error":e}module.exports=u,module.exports.HttpError=s(),module.exports.isHttpError=p(module.exports.HttpError),l(module.exports,t.codes,module.exports.HttpError);
},{"depd":"BGME","setprototypeof":"br24","statuses":"DXbu","inherits":"Bm0n","toidentifier":"xY5n"}],"sgp1":[function(require,module,exports) {
"use strict";async function e(e,r,n,u){let o=e;for(let i=0;i<r;i++){const e=await u();if(e)return e;await t(o),o*=n}return null}function t(e){return new Promise(t=>setTimeout(t,e))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"jwOG":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.logWarning=exports.ErrorContext=exports.TypedError=exports.ArgumentTypeError=exports.PositionalArgsError=void 0;class r extends Error{constructor(){super("Contract method calls expect named arguments wrapped in object, e.g. { argName1: argValue1, argName2: argValue2 }")}}exports.PositionalArgsError=r;class e extends Error{constructor(r,e,t){super(`Expected ${e} for '${r}' argument, but got '${JSON.stringify(t)}'`)}}exports.ArgumentTypeError=e;class t extends Error{constructor(r,e,t){super(r),this.type=e||"UntypedError",this.context=t}}exports.TypedError=t;class o{constructor(r){this.transactionHash=r}}function s(...r){console.warn(...r)}exports.ErrorContext=o,exports.logWarning=s;
},{}],"T1W2":[function(require,module,exports) {
"use strict";var e=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.fetchJson=void 0;const t=e(require("http-errors")),r=e(require("./exponential-backoff")),o=require("../providers"),n=require("./errors"),i=1e3,s=1.5,a=10;async function u(e,u){let c=null;c="string"==typeof e?e:e.url;const l=await r.default(i,a,s,async()=>{try{const r=await fetch(c,{method:u?"POST":"GET",body:u||void 0,headers:{"Content-Type":"application/json; charset=utf-8"}});if(!r.ok){if(503===r.status)return n.logWarning(`Retrying HTTP request for ${c} as it's not available now`),null;throw t.default(r.status,await r.text())}return r}catch(e){if(e.toString().includes("FetchError")||e.toString().includes("Failed to fetch"))return n.logWarning(`Retrying HTTP request for ${c} because of error: ${e}`),null;throw e}});if(!l)throw new o.TypedError(`Exceeded ${a} attempts for ${c}.`,"RetriesExceeded");return await l.json()}exports.fetchJson=u;
},{"http-errors":"blzi","./exponential-backoff":"sgp1","../providers":"a8i6","./errors":"jwOG"}],"gZU7":[function(require,module,exports) {
var define;
var global = arguments[3];
var e,t=arguments[3];!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof e&&e.amd?e(n):(t=t||self).Mustache=n()}(this,function(){"use strict";var e=Object.prototype.toString,t=Array.isArray||function(t){return"[object Array]"===e.call(t)};function n(e){return"function"==typeof e}function r(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function i(e,t){return null!=e&&"object"==typeof e&&t in e}var o=RegExp.prototype.test;var a=/\S/;function s(e){return!function(e,t){return o.call(e,t)}(a,e)}var c={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};var p=/\s*/,u=/\s+/,l=/\s*=/,h=/\s*\}/,f=/#|\^|\/|>|\{|&|=|!/;function g(e){this.string=e,this.tail=e,this.pos=0}function d(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function v(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}g.prototype.eos=function(){return""===this.tail},g.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n},g.prototype.scanUntil=function(e){var t,n=this.tail.search(e);switch(n){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=t.length,t},d.prototype.push=function(e){return new d(e,this)},d.prototype.lookup=function(e){var t,r,o,a=this.cache;if(a.hasOwnProperty(e))t=a[e];else{for(var s,c,p,u=this,l=!1;u;){if(e.indexOf(".")>0)for(s=u.view,c=e.split("."),p=0;null!=s&&p<c.length;)p===c.length-1&&(l=i(s,c[p])||(r=s,o=c[p],null!=r&&"object"!=typeof r&&r.hasOwnProperty&&r.hasOwnProperty(o))),s=s[c[p++]];else s=u.view[e],l=i(u.view,e);if(l){t=s;break}u=u.parent}a[e]=t}return n(t)&&(t=t.call(this.view)),t},v.prototype.clearCache=function(){void 0!==this.templateCache&&this.templateCache.clear()},v.prototype.parse=function(e,n){var i=this.templateCache,o=e+":"+(n||y.tags).join(":"),a=void 0!==i,c=a?i.get(o):void 0;return null==c&&(c=function(e,n){if(!e)return[];var i,o,a,c=!1,d=[],v=[],w=[],m=!1,b=!1,C="",k=0;function x(){if(m&&!b)for(;w.length;)delete v[w.pop()];else w=[];m=!1,b=!1}function E(e){if("string"==typeof e&&(e=e.split(u,2)),!t(e)||2!==e.length)throw new Error("Invalid tags: "+e);i=new RegExp(r(e[0])+"\\s*"),o=new RegExp("\\s*"+r(e[1])),a=new RegExp("\\s*"+r("}"+e[1]))}E(n||y.tags);for(var T,j,U,S,P,V,O=new g(e);!O.eos();){if(T=O.pos,U=O.scanUntil(i))for(var A=0,I=U.length;A<I;++A)s(S=U.charAt(A))?(w.push(v.length),C+=S):(b=!0,c=!0,C+=" "),v.push(["text",S,T,T+1]),T+=1,"\n"===S&&(x(),C="",k=0,c=!1);if(!O.scan(i))break;if(m=!0,j=O.scan(f)||"name",O.scan(p),"="===j?(U=O.scanUntil(l),O.scan(l),O.scanUntil(o)):"{"===j?(U=O.scanUntil(a),O.scan(h),O.scanUntil(o),j="&"):U=O.scanUntil(o),!O.scan(o))throw new Error("Unclosed tag at "+O.pos);if(P=">"==j?[j,U,T,O.pos,C,k,c]:[j,U,T,O.pos],k++,v.push(P),"#"===j||"^"===j)d.push(P);else if("/"===j){if(!(V=d.pop()))throw new Error('Unopened section "'+U+'" at '+T);if(V[1]!==U)throw new Error('Unclosed section "'+V[1]+'" at '+T)}else"name"===j||"{"===j||"&"===j?b=!0:"="===j&&E(U)}if(x(),V=d.pop())throw new Error('Unclosed section "'+V[1]+'" at '+O.pos);return function(e){for(var t,n=[],r=n,i=[],o=0,a=e.length;o<a;++o)switch((t=e[o])[0]){case"#":case"^":r.push(t),i.push(t),r=t[4]=[];break;case"/":i.pop()[5]=t[2],r=i.length>0?i[i.length-1][4]:n;break;default:r.push(t)}return n}(function(e){for(var t,n,r=[],i=0,o=e.length;i<o;++i)(t=e[i])&&("text"===t[0]&&n&&"text"===n[0]?(n[1]+=t[1],n[3]=t[3]):(r.push(t),n=t));return r}(v))}(e,n),a&&i.set(o,c)),c},v.prototype.render=function(e,t,n,r){var i=this.getConfigTags(r),o=this.parse(e,i),a=t instanceof d?t:new d(t,void 0);return this.renderTokens(o,a,n,e,r)},v.prototype.renderTokens=function(e,t,n,r,i){for(var o,a,s,c="",p=0,u=e.length;p<u;++p)s=void 0,"#"===(a=(o=e[p])[0])?s=this.renderSection(o,t,n,r,i):"^"===a?s=this.renderInverted(o,t,n,r,i):">"===a?s=this.renderPartial(o,t,n,i):"&"===a?s=this.unescapedValue(o,t):"name"===a?s=this.escapedValue(o,t,i):"text"===a&&(s=this.rawValue(o)),void 0!==s&&(c+=s);return c},v.prototype.renderSection=function(e,r,i,o,a){var s=this,c="",p=r.lookup(e[1]);if(p){if(t(p))for(var u=0,l=p.length;u<l;++u)c+=this.renderTokens(e[4],r.push(p[u]),i,o,a);else if("object"==typeof p||"string"==typeof p||"number"==typeof p)c+=this.renderTokens(e[4],r.push(p),i,o,a);else if(n(p)){if("string"!=typeof o)throw new Error("Cannot use higher-order sections without the original template");null!=(p=p.call(r.view,o.slice(e[3],e[5]),function(e){return s.render(e,r,i,a)}))&&(c+=p)}else c+=this.renderTokens(e[4],r,i,o,a);return c}},v.prototype.renderInverted=function(e,n,r,i,o){var a=n.lookup(e[1]);if(!a||t(a)&&0===a.length)return this.renderTokens(e[4],n,r,i,o)},v.prototype.indentPartial=function(e,t,n){for(var r=t.replace(/[^ \t]/g,""),i=e.split("\n"),o=0;o<i.length;o++)i[o].length&&(o>0||!n)&&(i[o]=r+i[o]);return i.join("\n")},v.prototype.renderPartial=function(e,t,r,i){if(r){var o=this.getConfigTags(i),a=n(r)?r(e[1]):r[e[1]];if(null!=a){var s=e[6],c=e[5],p=e[4],u=a;0==c&&p&&(u=this.indentPartial(a,p,s));var l=this.parse(u,o);return this.renderTokens(l,t,r,u,i)}}},v.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);if(null!=n)return n},v.prototype.escapedValue=function(e,t,n){var r=this.getConfigEscape(n)||y.escape,i=t.lookup(e[1]);if(null!=i)return"number"==typeof i&&r===y.escape?String(i):r(i)},v.prototype.rawValue=function(e){return e[1]},v.prototype.getConfigTags=function(e){return t(e)?e:e&&"object"==typeof e?e.tags:void 0},v.prototype.getConfigEscape=function(e){return e&&"object"==typeof e&&!t(e)?e.escape:void 0};var y={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(e){w.templateCache=e},get templateCache(){return w.templateCache}},w=new v;return y.clearCache=function(){return w.clearCache()},y.parse=function(e,t){return w.parse(e,t)},y.render=function(e,n,r,i){if("string"!=typeof e)throw new TypeError('Invalid template! Template should be a "string" but "'+(t(o=e)?"array":typeof o)+'" was given as the first argument for mustache#render(template, view, partials)');var o;return w.render(e,n,r,i)},y.escape=function(e){return String(e).replace(/[&<>"'`=\/]/g,function(e){return c[e]})},y.Scanner=g,y.Context=d,y.Writer=v,y});
},{}],"OUm3":[function(require,module,exports) {
module.exports={schema:{BadUTF16:{name:"BadUTF16",subtypes:[],props:{}},BadUTF8:{name:"BadUTF8",subtypes:[],props:{}},BalanceExceeded:{name:"BalanceExceeded",subtypes:[],props:{}},BreakpointTrap:{name:"BreakpointTrap",subtypes:[],props:{}},CacheError:{name:"CacheError",subtypes:["ReadError","WriteError","DeserializationError","SerializationError"],props:{}},CallIndirectOOB:{name:"CallIndirectOOB",subtypes:[],props:{}},CannotAppendActionToJointPromise:{name:"CannotAppendActionToJointPromise",subtypes:[],props:{}},CannotReturnJointPromise:{name:"CannotReturnJointPromise",subtypes:[],props:{}},CodeDoesNotExist:{name:"CodeDoesNotExist",subtypes:[],props:{account_id:""}},CompilationError:{name:"CompilationError",subtypes:["CodeDoesNotExist","PrepareError","WasmerCompileError"],props:{}},ContractSizeExceeded:{name:"ContractSizeExceeded",subtypes:[],props:{limit:"",size:""}},Deprecated:{name:"Deprecated",subtypes:[],props:{method_name:""}},Deserialization:{name:"Deserialization",subtypes:[],props:{}},DeserializationError:{name:"DeserializationError",subtypes:[],props:{}},EmptyMethodName:{name:"EmptyMethodName",subtypes:[],props:{}},FunctionCallError:{name:"FunctionCallError",subtypes:["CompilationError","LinkError","MethodResolveError","WasmTrap","WasmUnknownError","HostError","EvmError"],props:{}},GasExceeded:{name:"GasExceeded",subtypes:[],props:{}},GasInstrumentation:{name:"GasInstrumentation",subtypes:[],props:{}},GasLimitExceeded:{name:"GasLimitExceeded",subtypes:[],props:{}},GenericTrap:{name:"GenericTrap",subtypes:[],props:{}},GuestPanic:{name:"GuestPanic",subtypes:[],props:{panic_msg:""}},HostError:{name:"HostError",subtypes:["BadUTF16","BadUTF8","GasExceeded","GasLimitExceeded","BalanceExceeded","EmptyMethodName","GuestPanic","IntegerOverflow","InvalidPromiseIndex","CannotAppendActionToJointPromise","CannotReturnJointPromise","InvalidPromiseResultIndex","InvalidRegisterId","IteratorWasInvalidated","MemoryAccessViolation","InvalidReceiptIndex","InvalidIteratorIndex","InvalidAccountId","InvalidMethodName","InvalidPublicKey","ProhibitedInView","NumberOfLogsExceeded","KeyLengthExceeded","ValueLengthExceeded","TotalLogLengthExceeded","NumberPromisesExceeded","NumberInputDataDependenciesExceeded","ReturnedValueLengthExceeded","ContractSizeExceeded","Deprecated"],props:{}},IllegalArithmetic:{name:"IllegalArithmetic",subtypes:[],props:{}},IncorrectCallIndirectSignature:{name:"IncorrectCallIndirectSignature",subtypes:[],props:{}},Instantiate:{name:"Instantiate",subtypes:[],props:{}},IntegerOverflow:{name:"IntegerOverflow",subtypes:[],props:{}},InternalMemoryDeclared:{name:"InternalMemoryDeclared",subtypes:[],props:{}},InvalidAccountId:{name:"InvalidAccountId",subtypes:[],props:{account_id:""}},InvalidIteratorIndex:{name:"InvalidIteratorIndex",subtypes:[],props:{iterator_index:""}},InvalidMethodName:{name:"InvalidMethodName",subtypes:[],props:{}},InvalidPromiseIndex:{name:"InvalidPromiseIndex",subtypes:[],props:{promise_idx:""}},InvalidPromiseResultIndex:{name:"InvalidPromiseResultIndex",subtypes:[],props:{result_idx:""}},InvalidPublicKey:{name:"InvalidPublicKey",subtypes:[],props:{}},InvalidReceiptIndex:{name:"InvalidReceiptIndex",subtypes:[],props:{receipt_index:""}},InvalidRegisterId:{name:"InvalidRegisterId",subtypes:[],props:{register_id:""}},IteratorWasInvalidated:{name:"IteratorWasInvalidated",subtypes:[],props:{iterator_index:""}},KeyLengthExceeded:{name:"KeyLengthExceeded",subtypes:[],props:{length:"",limit:""}},LinkError:{name:"LinkError",subtypes:[],props:{msg:""}},Memory:{name:"Memory",subtypes:[],props:{}},MemoryAccessViolation:{name:"MemoryAccessViolation",subtypes:[],props:{}},MemoryOutOfBounds:{name:"MemoryOutOfBounds",subtypes:[],props:{}},MethodEmptyName:{name:"MethodEmptyName",subtypes:[],props:{}},MethodInvalidSignature:{name:"MethodInvalidSignature",subtypes:[],props:{}},MethodNotFound:{name:"MethodNotFound",subtypes:[],props:{}},MethodResolveError:{name:"MethodResolveError",subtypes:["MethodEmptyName","MethodUTF8Error","MethodNotFound","MethodInvalidSignature"],props:{}},MethodUTF8Error:{name:"MethodUTF8Error",subtypes:[],props:{}},MisalignedAtomicAccess:{name:"MisalignedAtomicAccess",subtypes:[],props:{}},NumberInputDataDependenciesExceeded:{name:"NumberInputDataDependenciesExceeded",subtypes:[],props:{limit:"",number_of_input_data_dependencies:""}},NumberOfLogsExceeded:{name:"NumberOfLogsExceeded",subtypes:[],props:{limit:""}},NumberPromisesExceeded:{name:"NumberPromisesExceeded",subtypes:[],props:{limit:"",number_of_promises:""}},PrepareError:{name:"PrepareError",subtypes:["Serialization","Deserialization","InternalMemoryDeclared","GasInstrumentation","StackHeightInstrumentation","Instantiate","Memory"],props:{}},ProhibitedInView:{name:"ProhibitedInView",subtypes:[],props:{method_name:""}},ReadError:{name:"ReadError",subtypes:[],props:{}},ReturnedValueLengthExceeded:{name:"ReturnedValueLengthExceeded",subtypes:[],props:{length:"",limit:""}},Serialization:{name:"Serialization",subtypes:[],props:{}},SerializationError:{name:"SerializationError",subtypes:[],props:{hash:""}},StackHeightInstrumentation:{name:"StackHeightInstrumentation",subtypes:[],props:{}},StackOverflow:{name:"StackOverflow",subtypes:[],props:{}},TotalLogLengthExceeded:{name:"TotalLogLengthExceeded",subtypes:[],props:{length:"",limit:""}},Unreachable:{name:"Unreachable",subtypes:[],props:{}},ValueLengthExceeded:{name:"ValueLengthExceeded",subtypes:[],props:{length:"",limit:""}},WasmTrap:{name:"WasmTrap",subtypes:["Unreachable","IncorrectCallIndirectSignature","MemoryOutOfBounds","CallIndirectOOB","IllegalArithmetic","MisalignedAtomicAccess","BreakpointTrap","StackOverflow","GenericTrap"],props:{}},WasmUnknownError:{name:"WasmUnknownError",subtypes:[],props:{}},WasmerCompileError:{name:"WasmerCompileError",subtypes:[],props:{msg:""}},WriteError:{name:"WriteError",subtypes:[],props:{}},AccessKeyNotFound:{name:"AccessKeyNotFound",subtypes:[],props:{account_id:"",public_key:""}},AccountAlreadyExists:{name:"AccountAlreadyExists",subtypes:[],props:{account_id:""}},AccountDoesNotExist:{name:"AccountDoesNotExist",subtypes:[],props:{account_id:""}},ActionError:{name:"ActionError",subtypes:["AccountAlreadyExists","AccountDoesNotExist","CreateAccountOnlyByRegistrar","CreateAccountNotAllowed","ActorNoPermission","DeleteKeyDoesNotExist","AddKeyAlreadyExists","DeleteAccountStaking","LackBalanceForState","TriesToUnstake","TriesToStake","InsufficientStake","FunctionCallError","NewReceiptValidationError","OnlyImplicitAccountCreationAllowed"],props:{index:""}},ActionsValidationError:{name:"ActionsValidationError",subtypes:["DeleteActionMustBeFinal","TotalPrepaidGasExceeded","TotalNumberOfActionsExceeded","AddKeyMethodNamesNumberOfBytesExceeded","AddKeyMethodNameLengthExceeded","IntegerOverflow","InvalidAccountId","ContractSizeExceeded","FunctionCallMethodNameLengthExceeded","FunctionCallArgumentsLengthExceeded","UnsuitableStakingKey","FunctionCallZeroAttachedGas"],props:{}},ActorNoPermission:{name:"ActorNoPermission",subtypes:[],props:{account_id:"",actor_id:""}},AddKeyAlreadyExists:{name:"AddKeyAlreadyExists",subtypes:[],props:{account_id:"",public_key:""}},AddKeyMethodNameLengthExceeded:{name:"AddKeyMethodNameLengthExceeded",subtypes:[],props:{length:"",limit:""}},AddKeyMethodNamesNumberOfBytesExceeded:{name:"AddKeyMethodNamesNumberOfBytesExceeded",subtypes:[],props:{limit:"",total_number_of_bytes:""}},BalanceMismatchError:{name:"BalanceMismatchError",subtypes:[],props:{final_accounts_balance:"",final_postponed_receipts_balance:"",incoming_receipts_balance:"",incoming_validator_rewards:"",initial_accounts_balance:"",initial_postponed_receipts_balance:"",new_delayed_receipts_balance:"",other_burnt_amount:"",outgoing_receipts_balance:"",processed_delayed_receipts_balance:"",slashed_burnt_amount:"",tx_burnt_amount:""}},CostOverflow:{name:"CostOverflow",subtypes:[],props:{}},CreateAccountNotAllowed:{name:"CreateAccountNotAllowed",subtypes:[],props:{account_id:"",predecessor_id:""}},CreateAccountOnlyByRegistrar:{name:"CreateAccountOnlyByRegistrar",subtypes:[],props:{account_id:"",predecessor_id:"",registrar_account_id:""}},DeleteAccountStaking:{name:"DeleteAccountStaking",subtypes:[],props:{account_id:""}},DeleteActionMustBeFinal:{name:"DeleteActionMustBeFinal",subtypes:[],props:{}},DeleteKeyDoesNotExist:{name:"DeleteKeyDoesNotExist",subtypes:[],props:{account_id:"",public_key:""}},DepositWithFunctionCall:{name:"DepositWithFunctionCall",subtypes:[],props:{}},Expired:{name:"Expired",subtypes:[],props:{}},FunctionCallArgumentsLengthExceeded:{name:"FunctionCallArgumentsLengthExceeded",subtypes:[],props:{length:"",limit:""}},FunctionCallMethodNameLengthExceeded:{name:"FunctionCallMethodNameLengthExceeded",subtypes:[],props:{length:"",limit:""}},FunctionCallZeroAttachedGas:{name:"FunctionCallZeroAttachedGas",subtypes:[],props:{}},InsufficientStake:{name:"InsufficientStake",subtypes:[],props:{account_id:"",minimum_stake:"",stake:""}},InvalidAccessKeyError:{name:"InvalidAccessKeyError",subtypes:["AccessKeyNotFound","ReceiverMismatch","MethodNameMismatch","RequiresFullAccess","NotEnoughAllowance","DepositWithFunctionCall"],props:{}},InvalidChain:{name:"InvalidChain",subtypes:[],props:{}},InvalidDataReceiverId:{name:"InvalidDataReceiverId",subtypes:[],props:{account_id:""}},InvalidNonce:{name:"InvalidNonce",subtypes:[],props:{ak_nonce:"",tx_nonce:""}},InvalidPredecessorId:{name:"InvalidPredecessorId",subtypes:[],props:{account_id:""}},InvalidReceiverId:{name:"InvalidReceiverId",subtypes:[],props:{account_id:""}},InvalidSignature:{name:"InvalidSignature",subtypes:[],props:{}},InvalidSignerId:{name:"InvalidSignerId",subtypes:[],props:{account_id:""}},InvalidTxError:{name:"InvalidTxError",subtypes:["InvalidAccessKeyError","InvalidSignerId","SignerDoesNotExist","InvalidNonce","InvalidReceiverId","InvalidSignature","NotEnoughBalance","LackBalanceForState","CostOverflow","InvalidChain","Expired","ActionsValidation"],props:{}},LackBalanceForState:{name:"LackBalanceForState",subtypes:[],props:{account_id:"",amount:""}},MethodNameMismatch:{name:"MethodNameMismatch",subtypes:[],props:{method_name:""}},NotEnoughAllowance:{name:"NotEnoughAllowance",subtypes:[],props:{account_id:"",allowance:"",cost:"",public_key:""}},NotEnoughBalance:{name:"NotEnoughBalance",subtypes:[],props:{balance:"",cost:"",signer_id:""}},OnlyImplicitAccountCreationAllowed:{name:"OnlyImplicitAccountCreationAllowed",subtypes:[],props:{account_id:""}},ReceiptValidationError:{name:"ReceiptValidationError",subtypes:["InvalidPredecessorId","InvalidReceiverId","InvalidSignerId","InvalidDataReceiverId","ReturnedValueLengthExceeded","NumberInputDataDependenciesExceeded","ActionsValidation"],props:{}},ReceiverMismatch:{name:"ReceiverMismatch",subtypes:[],props:{ak_receiver:"",tx_receiver:""}},RequiresFullAccess:{name:"RequiresFullAccess",subtypes:[],props:{}},SignerDoesNotExist:{name:"SignerDoesNotExist",subtypes:[],props:{signer_id:""}},TotalNumberOfActionsExceeded:{name:"TotalNumberOfActionsExceeded",subtypes:[],props:{limit:"",total_number_of_actions:""}},TotalPrepaidGasExceeded:{name:"TotalPrepaidGasExceeded",subtypes:[],props:{limit:"",total_prepaid_gas:""}},TriesToStake:{name:"TriesToStake",subtypes:[],props:{account_id:"",balance:"",locked:"",stake:""}},TriesToUnstake:{name:"TriesToUnstake",subtypes:[],props:{account_id:""}},TxExecutionError:{name:"TxExecutionError",subtypes:["ActionError","InvalidTxError"],props:{}},UnsuitableStakingKey:{name:"UnsuitableStakingKey",subtypes:[],props:{public_key:""}},Closed:{name:"Closed",subtypes:[],props:{}},InternalError:{name:"InternalError",subtypes:[],props:{}},ServerError:{name:"ServerError",subtypes:["TxExecutionError","Timeout","Closed","InternalError"],props:{}},Timeout:{name:"Timeout",subtypes:[],props:{}}}};
},{}],"C7SY":[function(require,module,exports) {
module.exports={GasLimitExceeded:"Exceeded the maximum amount of gas allowed to burn per contract",MethodEmptyName:"Method name is empty",WasmerCompileError:"Wasmer compilation error: {{msg}}",GuestPanic:"Smart contract panicked: {{panic_msg}}",Memory:"Error creating Wasm memory",GasExceeded:"Exceeded the prepaid gas",MethodUTF8Error:"Method name is not valid UTF8 string",BadUTF16:"String encoding is bad UTF-16 sequence",WasmTrap:"WebAssembly trap: {{msg}}",GasInstrumentation:"Gas instrumentation failed or contract has denied instructions.",InvalidPromiseIndex:"{{promise_idx}} does not correspond to existing promises",InvalidPromiseResultIndex:"Accessed invalid promise result index: {{result_idx}}",Deserialization:"Error happened while deserializing the module",MethodNotFound:"Contract method is not found",InvalidRegisterId:"Accessed invalid register id: {{register_id}}",InvalidReceiptIndex:"VM Logic returned an invalid receipt index: {{receipt_index}}",EmptyMethodName:"Method name is empty in contract call",CannotReturnJointPromise:"Returning joint promise is currently prohibited",StackHeightInstrumentation:"Stack instrumentation failed",CodeDoesNotExist:"Cannot find contract code for account {{account_id}}",MethodInvalidSignature:"Invalid method signature",IntegerOverflow:"Integer overflow happened during contract execution",MemoryAccessViolation:"MemoryAccessViolation",InvalidIteratorIndex:"Iterator index {{iterator_index}} does not exist",IteratorWasInvalidated:"Iterator {{iterator_index}} was invalidated after its creation by performing a mutable operation on trie",InvalidAccountId:"VM Logic returned an invalid account id",Serialization:"Error happened while serializing the module",CannotAppendActionToJointPromise:"Actions can only be appended to non-joint promise.",InternalMemoryDeclared:"Internal memory declaration has been found in the module",Instantiate:"Error happened during instantiation",ProhibitedInView:"{{method_name}} is not allowed in view calls",InvalidMethodName:"VM Logic returned an invalid method name",BadUTF8:"String encoding is bad UTF-8 sequence",BalanceExceeded:"Exceeded the account balance",LinkError:"Wasm contract link error: {{msg}}",InvalidPublicKey:"VM Logic provided an invalid public key",ActorNoPermission:"Actor {{actor_id}} doesn't have permission to account {{account_id}} to complete the action",LackBalanceForState:"The account {{account_id}} wouldn't have enough balance to cover storage, required to have {{amount}} yoctoNEAR more",ReceiverMismatch:"Wrong AccessKey used for transaction: transaction is sent to receiver_id={{tx_receiver}}, but is signed with function call access key that restricted to only use with receiver_id={{ak_receiver}}. Either change receiver_id in your transaction or switch to use a FullAccessKey.",CostOverflow:"Transaction gas or balance cost is too high",InvalidSignature:"Transaction is not signed with the given public key",AccessKeyNotFound:'Signer "{{account_id}}" doesn\'t have access key with the given public_key {{public_key}}',NotEnoughBalance:"Sender {{signer_id}} does not have enough balance {{#formatNear}}{{balance}}{{/formatNear}} for operation costing {{#formatNear}}{{cost}}{{/formatNear}}",NotEnoughAllowance:"Access Key {account_id}:{public_key} does not have enough balance {{#formatNear}}{{allowance}}{{/formatNear}} for transaction costing {{#formatNear}}{{cost}}{{/formatNear}}",Expired:"Transaction has expired",DeleteAccountStaking:"Account {{account_id}} is staking and can not be deleted",SignerDoesNotExist:"Signer {{signer_id}} does not exist",TriesToStake:"Account {{account_id}} tried to stake {{#formatNear}}{{stake}}{{/formatNear}}, but has staked {{#formatNear}}{{locked}}{{/formatNear}} and only has {{#formatNear}}{{balance}}{{/formatNear}}",AddKeyAlreadyExists:"The public key {{public_key}} is already used for an existing access key",InvalidSigner:"Invalid signer account ID {{signer_id}} according to requirements",CreateAccountNotAllowed:"The new account_id {{account_id}} can't be created by {{predecessor_id}}",RequiresFullAccess:"The transaction contains more then one action, but it was signed with an access key which allows transaction to apply only one specific action. To apply more then one actions TX must be signed with a full access key",TriesToUnstake:"Account {{account_id}} is not yet staked, but tried to unstake",InvalidNonce:"Transaction nonce {{tx_nonce}} must be larger than nonce of the used access key {{ak_nonce}}",AccountAlreadyExists:"Can't create a new account {{account_id}}, because it already exists",InvalidChain:"Transaction parent block hash doesn't belong to the current chain",AccountDoesNotExist:"Can't complete the action because account {{account_id}} doesn't exist",MethodNameMismatch:"Transaction method name {{method_name}} isn't allowed by the access key",DeleteAccountHasRent:"Account {{account_id}} can't be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover the rent",DeleteAccountHasEnoughBalance:"Account {{account_id}} can't be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover it's storage",InvalidReceiver:"Invalid receiver account ID {{receiver_id}} according to requirements",DeleteKeyDoesNotExist:"Account {{account_id}} tries to remove an access key that doesn't exist",Timeout:"Timeout exceeded",Closed:"Connection closed"};
},{}],"K54z":[function(require,module,exports) {
"use strict";var e=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getErrorTypeFromErrorMessage=exports.formatError=exports.parseResultError=exports.parseRpcError=exports.ServerError=void 0;const r=e(require("mustache")),t=e(require("../generated/rpc_error_schema.json")),o=e(require("../res/error_messages.json")),s=require("../common-index"),n=require("../utils/errors"),i={formatNear:()=>(e,r)=>s.utils.format.formatNearAmount(r(e))};class c extends n.TypedError{}exports.ServerError=c;class a extends c{}function u(e){const r={},o=d(e,t.default.schema,r,""),s=new c(f(o,r),o);return Object.assign(s,r),s}function p(e){const r=u(e.status.Failure),t=new a;return Object.assign(t,r),t.type=r.type,t.message=r.message,t.transaction_outcome=e.transaction_outcome,t}function f(e,t){return"string"==typeof o.default[e]?r.default.render(o.default[e],{...t,...i}):JSON.stringify(t)}function d(e,r,t,o){let s,n,i;for(const c in r){if(x(e[c]))return e[c];if(m(e[c]))s=e[c],n=r[c],i=c;else{if(!m(e.kind)||!m(e.kind[c]))continue;s=e.kind[c],n=r[c],i=c}}if(s&&n){for(const e of Object.keys(n.props))t[e]=s[e];return d(s,r,t,i)}return t.kind=e,o}function l(e){switch(!0){case/^account .*? does not exist while viewing$/.test(e):case/^Account .*? doesn't exist$/.test(e):return"AccountDoesNotExist";case/^access key .*? does not exist while viewing$/.test(e):return"AccessKeyDoesNotExist";case/wasm execution failed with error: FunctionCallError\(CompilationError\(CodeDoesNotExist/.test(e):return"CodeDoesNotExist";case/Transaction nonce \d+ must be larger than nonce of the used access key \d+/.test(e):return"InvalidNonce";default:return"UntypedError"}}function m(e){return"[object Object]"===Object.prototype.toString.call(e)}function x(e){return"[object String]"===Object.prototype.toString.call(e)}exports.parseRpcError=u,exports.parseResultError=p,exports.formatError=f,exports.getErrorTypeFromErrorMessage=l;
},{"mustache":"gZU7","../generated/rpc_error_schema.json":"OUm3","../res/error_messages.json":"C7SY","../common-index":"gdw7","../utils/errors":"jwOG"}],"HVwB":[function(require,module,exports) {
var Buffer = require("buffer").Buffer;
var e=require("buffer").Buffer,r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.JsonRpcProvider=exports.ErrorContext=exports.TypedError=void 0;const t=r(require("depd")),n=require("./provider"),s=require("../utils/web"),o=require("../utils/errors");Object.defineProperty(exports,"TypedError",{enumerable:!0,get:function(){return o.TypedError}}),Object.defineProperty(exports,"ErrorContext",{enumerable:!0,get:function(){return o.ErrorContext}});const c=require("borsh"),i=r(require("../utils/exponential-backoff")),a=require("../utils/rpc_errors"),d=12,l=500,u=1.5;let p=123;class y extends n.Provider{constructor(e){super(),this.connection={url:e}}async status(){return this.sendJsonRpc("status",[])}async sendTransaction(r){const t=r.encode();return this.sendJsonRpc("broadcast_tx_commit",[e.from(t).toString("base64")])}async sendTransactionAsync(r){const t=r.encode();return this.sendJsonRpc("broadcast_tx_async",[e.from(t).toString("base64")])}async txStatus(e,r){return"string"==typeof e?this.txStatusString(e,r):this.txStatusUint8Array(e,r)}async txStatusUint8Array(e,r){return this.sendJsonRpc("tx",[c.baseEncode(e),r])}async txStatusString(e,r){return this.sendJsonRpc("tx",[e,r])}async txStatusReceipts(e,r){return this.sendJsonRpc("EXPERIMENTAL_tx_status",[c.baseEncode(e),r])}async query(...e){let r;if(1===e.length)r=await this.sendJsonRpc("query",e[0]);else{const[t,n]=e;r=await this.sendJsonRpc("query",[t,n])}if(r&&r.error)throw new o.TypedError(`Querying ${e} failed: ${r.error}.\n${JSON.stringify(r,null,2)}`,a.getErrorTypeFromErrorMessage(r.error));return r}async block(e){const{finality:r}=e;let{blockId:n}=e;if("object"!=typeof e){t.default("JsonRpcProvider.block(blockId)")("use `block({ blockId })` or `block({ finality })` instead"),n=e}return this.sendJsonRpc("block",{block_id:n,finality:r})}async blockChanges(e){const{finality:r}=e,{blockId:t}=e;return this.sendJsonRpc("EXPERIMENTAL_changes_in_block",{block_id:t,finality:r})}async chunk(e){return this.sendJsonRpc("chunk",[e])}async validators(e){return this.sendJsonRpc("validators",[e])}async experimental_genesisConfig(){return t.default("JsonRpcProvider.experimental_protocolConfig()")("use `experimental_protocolConfig({ sync_checkpoint: 'genesis' })` to fetch the up-to-date or genesis protocol config explicitly"),await this.sendJsonRpc("EXPERIMENTAL_protocol_config",{sync_checkpoint:"genesis"})}async experimental_protocolConfig(e){return await this.sendJsonRpc("EXPERIMENTAL_protocol_config",e)}async experimental_lightClientProof(e){return t.default("JsonRpcProvider.experimental_lightClientProof(request)")("use `lightClientProof` instead"),await this.lightClientProof(e)}async lightClientProof(e){return await this.sendJsonRpc("EXPERIMENTAL_light_client_proof",e)}async accessKeyChanges(e,r){const{finality:t}=r,{blockId:n}=r;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"all_access_key_changes",account_ids:e,block_id:n,finality:t})}async singleAccessKeyChanges(e,r){const{finality:t}=r,{blockId:n}=r;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"single_access_key_changes",keys:e,block_id:n,finality:t})}async accountChanges(e,r){const{finality:t}=r,{blockId:n}=r;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"account_changes",account_ids:e,block_id:n,finality:t})}async contractStateChanges(e,r,t=""){const{finality:n}=r,{blockId:s}=r;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"data_changes",account_ids:e,key_prefix_base64:t,block_id:s,finality:n})}async contractCodeChanges(e,r){const{finality:t}=r,{blockId:n}=r;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"contract_code_changes",account_ids:e,block_id:n,finality:t})}async gasPrice(e){return await this.sendJsonRpc("gas_price",[e])}async sendJsonRpc(e,r){const t=await i.default(l,d,u,async()=>{try{const n={method:e,params:r,id:p++,jsonrpc:"2.0"},c=await s.fetchJson(this.connection,JSON.stringify(n));if(c.error){if("object"==typeof c.error.data){if("string"==typeof c.error.data.error_message&&"string"==typeof c.error.data.error_type)throw new o.TypedError(c.error.data.error_message,c.error.data.error_type);throw a.parseRpcError(c.error.data)}{const e=`[${c.error.code}] ${c.error.message}: ${c.error.data}`;if("Timeout"===c.error.data||e.includes("Timeout error")||e.includes("query has timed out"))throw new o.TypedError(e,"TimeoutError");throw new o.TypedError(e,a.getErrorTypeFromErrorMessage(c.error.data))}}return c}catch(t){if("TimeoutError"===t.type)return console.warn(`Retrying request to ${e} as it has timed out`,r),null;throw t}}),{result:n}=t;if(void 0===n)throw new o.TypedError(`Exceeded ${d} attempts for request to ${e}.`,"RetriesExceeded");return n}}exports.JsonRpcProvider=y;
},{"depd":"BGME","./provider":"y4mD","../utils/web":"T1W2","../utils/errors":"jwOG","borsh":"C6Jz","../utils/exponential-backoff":"sgp1","../utils/rpc_errors":"K54z","buffer":"dskh"}],"a8i6":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ErrorContext=exports.TypedError=exports.getTransactionLastResult=exports.FinalExecutionStatusBasic=exports.JsonRpcProvider=exports.Provider=void 0;const e=require("./provider");Object.defineProperty(exports,"Provider",{enumerable:!0,get:function(){return e.Provider}}),Object.defineProperty(exports,"getTransactionLastResult",{enumerable:!0,get:function(){return e.getTransactionLastResult}}),Object.defineProperty(exports,"FinalExecutionStatusBasic",{enumerable:!0,get:function(){return e.FinalExecutionStatusBasic}});const r=require("./json-rpc-provider");Object.defineProperty(exports,"JsonRpcProvider",{enumerable:!0,get:function(){return r.JsonRpcProvider}}),Object.defineProperty(exports,"TypedError",{enumerable:!0,get:function(){return r.TypedError}}),Object.defineProperty(exports,"ErrorContext",{enumerable:!0,get:function(){return r.ErrorContext}});
},{"./provider":"y4mD","./json-rpc-provider":"HVwB"}],"ynTt":[function(require,module,exports) {
"use strict";var t=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.parseNearAmount=exports.formatNearAmount=exports.NEAR_NOMINATION=exports.NEAR_NOMINATION_EXP=void 0;const e=t(require("bn.js"));exports.NEAR_NOMINATION_EXP=24,exports.NEAR_NOMINATION=new e.default("10",10).pow(new e.default(exports.NEAR_NOMINATION_EXP,10));const r=[],N=new e.default(10);for(let _=0,a=new e.default(5);_<exports.NEAR_NOMINATION_EXP;_++,a=a.mul(N))r[_]=a;function n(t,N=exports.NEAR_NOMINATION_EXP){const n=new e.default(t,10);if(N!==exports.NEAR_NOMINATION_EXP){const t=exports.NEAR_NOMINATION_EXP-N-1;t>0&&n.iadd(r[t])}const o=(t=n.toString()).substring(0,t.length-exports.NEAR_NOMINATION_EXP)||"0",s=t.substring(t.length-exports.NEAR_NOMINATION_EXP).padStart(exports.NEAR_NOMINATION_EXP,"0").substring(0,N);return u(`${p(o)}.${s}`)}function o(t){if(!t)return null;const e=(t=s(t)).split("."),r=e[0],N=e[1]||"";if(e.length>2||N.length>exports.NEAR_NOMINATION_EXP)throw new Error(`Cannot parse '${t}' as NEAR amount`);return A(r+N.padEnd(exports.NEAR_NOMINATION_EXP,"0"))}function s(t){return t.replace(/,/g,"").trim()}function u(t){return t.replace(/\.?0*$/,"")}function A(t){return""===(t=t.replace(/^0+/,""))?"0":t}function p(t){const e=/(-?\d+)(\d{3})/;for(;e.test(t);)t=t.replace(e,"$1,$2");return t}exports.formatNearAmount=n,exports.parseNearAmount=o;
},{"bn.js":"BOxy"}],"bEEV":[function(require,module,exports) {
"use strict";var e=this&&this.__createBinding||(Object.create?function(e,r,t,o){void 0===o&&(o=t),Object.defineProperty(e,o,{enumerable:!0,get:function(){return r[t]}})}:function(e,r,t,o){void 0===o&&(o=t),e[o]=r[t]}),r=this&&this.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),t=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var o={};if(null!=t)for(var i in t)"default"!==i&&Object.hasOwnProperty.call(t,i)&&e(o,t,i);return r(o,t),o};Object.defineProperty(exports,"__esModule",{value:!0}),exports.logWarning=exports.rpc_errors=exports.KeyPairEd25519=exports.KeyPair=exports.PublicKey=exports.format=exports.enums=exports.web=exports.serialize=exports.key_pair=void 0;const o=t(require("./key_pair"));exports.key_pair=o;const i=t(require("./serialize"));exports.serialize=i;const n=t(require("./web"));exports.web=n;const s=t(require("./enums"));exports.enums=s;const u=t(require("./format"));exports.format=u;const a=t(require("./rpc_errors"));exports.rpc_errors=a;const c=require("./key_pair");Object.defineProperty(exports,"PublicKey",{enumerable:!0,get:function(){return c.PublicKey}}),Object.defineProperty(exports,"KeyPair",{enumerable:!0,get:function(){return c.KeyPair}}),Object.defineProperty(exports,"KeyPairEd25519",{enumerable:!0,get:function(){return c.KeyPairEd25519}});const p=require("./errors");Object.defineProperty(exports,"logWarning",{enumerable:!0,get:function(){return p.logWarning}});
},{"./key_pair":"kvXx","./serialize":"vXEo","./web":"T1W2","./enums":"bD1J","./format":"ynTt","./rpc_errors":"K54z","./errors":"jwOG"}],"pBGv":[function(require,module,exports) {
var t,e,n=module.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}function u(t){if(e===clearTimeout)return clearTimeout(t);if((e===o||!e)&&clearTimeout)return e=clearTimeout,clearTimeout(t);try{return e(t)}catch(n){try{return e.call(null,t)}catch(n){return e.call(this,t)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(n){t=r}try{e="function"==typeof clearTimeout?clearTimeout:o}catch(n){e=o}}();var c,s=[],l=!1,a=-1;function f(){l&&c&&(l=!1,c.length?s=c.concat(s):a=-1,s.length&&h())}function h(){if(!l){var t=i(f);l=!0;for(var e=s.length;e;){for(c=s,s=[];++a<e;)c&&c[a].run();a=-1,e=s.length}c=null,l=!1,u(t)}}function m(t,e){this.fun=t,this.array=e}function p(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(new m(t,e)),1!==s.length||l||i(h)},m.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0};
},{}],"K2GL":[function(require,module,exports) {
var process = require("process");
var global = arguments[3];
var define;
var Buffer = require("buffer").Buffer;
var process=require("process"),global=arguments[3],define,Buffer=require("buffer").Buffer;!function(){"use strict";var ERROR="input is invalid type",WINDOW="object"==typeof window,root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"==typeof self,NODE_JS=!root.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&"object"==typeof module&&module.exports,AMD="function"==typeof define&&define.amd,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];!root.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!ARRAY_BUFFER||!root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});var createOutputMethod=function(t,r){return function(h){return new Sha256(r,!0).update(h)[t]()}},createMethod=function(t){var r=createOutputMethod("hex",t);NODE_JS&&(r=nodeWrap(r,t)),r.create=function(){return new Sha256(t)},r.update=function(t){return r.create().update(t)};for(var h=0;h<OUTPUT_TYPES.length;++h){var e=OUTPUT_TYPES[h];r[e]=createOutputMethod(e,t)}return r},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(t){if("string"==typeof t)return crypto.createHash(algorithm).update(t,"utf8").digest("hex");if(null==t)throw new Error(ERROR);return t.constructor===ArrayBuffer&&(t=new Uint8Array(t)),Array.isArray(t)||ArrayBuffer.isView(t)||t.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(t)).digest("hex"):method(t)};return nodeMethod},createHmacOutputMethod=function(t,r){return function(h,e){return new HmacSha256(h,r,!0).update(e)[t]()}},createHmacMethod=function(t){var r=createHmacOutputMethod("hex",t);r.create=function(r){return new HmacSha256(r,t)},r.update=function(t,h){return r.create(t).update(h)};for(var h=0;h<OUTPUT_TYPES.length;++h){var e=OUTPUT_TYPES[h];r[e]=createHmacOutputMethod(e,t)}return r};function Sha256(t,r){r?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=t}function HmacSha256(t,r,h){var e,s=typeof t;if("string"===s){var i,o=[],a=t.length,H=0;for(e=0;e<a;++e)(i=t.charCodeAt(e))<128?o[H++]=i:i<2048?(o[H++]=192|i>>6,o[H++]=128|63&i):i<55296||i>=57344?(o[H++]=224|i>>12,o[H++]=128|i>>6&63,o[H++]=128|63&i):(i=65536+((1023&i)<<10|1023&t.charCodeAt(++e)),o[H++]=240|i>>18,o[H++]=128|i>>12&63,o[H++]=128|i>>6&63,o[H++]=128|63&i);t=o}else{if("object"!==s)throw new Error(ERROR);if(null===t)throw new Error(ERROR);if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||ARRAY_BUFFER&&ArrayBuffer.isView(t)))throw new Error(ERROR)}t.length>64&&(t=new Sha256(r,!0).update(t).array());var n=[],f=[];for(e=0;e<64;++e){var S=t[e]||0;n[e]=92^S,f[e]=54^S}Sha256.call(this,r,h),this.update(f),this.oKeyPad=n,this.inner=!0,this.sharedMemory=h}Sha256.prototype.update=function(t){if(!this.finalized){var r,h=typeof t;if("string"!==h){if("object"!==h)throw new Error(ERROR);if(null===t)throw new Error(ERROR);if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||ARRAY_BUFFER&&ArrayBuffer.isView(t)))throw new Error(ERROR);r=!0}for(var e,s,i=0,o=t.length,a=this.blocks;i<o;){if(this.hashed&&(this.hashed=!1,a[0]=this.block,a[16]=a[1]=a[2]=a[3]=a[4]=a[5]=a[6]=a[7]=a[8]=a[9]=a[10]=a[11]=a[12]=a[13]=a[14]=a[15]=0),r)for(s=this.start;i<o&&s<64;++i)a[s>>2]|=t[i]<<SHIFT[3&s++];else for(s=this.start;i<o&&s<64;++i)(e=t.charCodeAt(i))<128?a[s>>2]|=e<<SHIFT[3&s++]:e<2048?(a[s>>2]|=(192|e>>6)<<SHIFT[3&s++],a[s>>2]|=(128|63&e)<<SHIFT[3&s++]):e<55296||e>=57344?(a[s>>2]|=(224|e>>12)<<SHIFT[3&s++],a[s>>2]|=(128|e>>6&63)<<SHIFT[3&s++],a[s>>2]|=(128|63&e)<<SHIFT[3&s++]):(e=65536+((1023&e)<<10|1023&t.charCodeAt(++i)),a[s>>2]|=(240|e>>18)<<SHIFT[3&s++],a[s>>2]|=(128|e>>12&63)<<SHIFT[3&s++],a[s>>2]|=(128|e>>6&63)<<SHIFT[3&s++],a[s>>2]|=(128|63&e)<<SHIFT[3&s++]);this.lastByteIndex=s,this.bytes+=s-this.start,s>=64?(this.block=a[16],this.start=s-64,this.hash(),this.hashed=!0):this.start=s}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,r=this.lastByteIndex;t[16]=this.block,t[r>>2]|=EXTRA[3&r],this.block=t[16],r>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var t,r,h,e,s,i,o,a,H,n=this.h0,f=this.h1,S=this.h2,c=this.h3,A=this.h4,R=this.h5,u=this.h6,_=this.h7,E=this.blocks;for(t=16;t<64;++t)r=((s=E[t-15])>>>7|s<<25)^(s>>>18|s<<14)^s>>>3,h=((s=E[t-2])>>>17|s<<15)^(s>>>19|s<<13)^s>>>10,E[t]=E[t-16]+r+E[t-7]+h<<0;for(H=f&S,t=0;t<64;t+=4)this.first?(this.is224?(i=300032,_=(s=E[0]-1413257819)-150054599<<0,c=s+24177077<<0):(i=704751109,_=(s=E[0]-210244248)-1521486534<<0,c=s+143694565<<0),this.first=!1):(r=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10),e=(i=n&f)^n&S^H,_=c+(s=_+(h=(A>>>6|A<<26)^(A>>>11|A<<21)^(A>>>25|A<<7))+(A&R^~A&u)+K[t]+E[t])<<0,c=s+(r+e)<<0),r=(c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),e=(o=c&n)^c&f^i,u=S+(s=u+(h=(_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7))+(_&A^~_&R)+K[t+1]+E[t+1])<<0,r=((S=s+(r+e)<<0)>>>2|S<<30)^(S>>>13|S<<19)^(S>>>22|S<<10),e=(a=S&c)^S&n^o,R=f+(s=R+(h=(u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+(u&_^~u&A)+K[t+2]+E[t+2])<<0,r=((f=s+(r+e)<<0)>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),e=(H=f&S)^f&c^a,A=n+(s=A+(h=(R>>>6|R<<26)^(R>>>11|R<<21)^(R>>>25|R<<7))+(R&u^~R&_)+K[t+3]+E[t+3])<<0,n=s+(r+e)<<0;this.h0=this.h0+n<<0,this.h1=this.h1+f<<0,this.h2=this.h2+S<<0,this.h3=this.h3+c<<0,this.h4=this.h4+A<<0,this.h5=this.h5+R<<0,this.h6=this.h6+u<<0,this.h7=this.h7+_<<0},Sha256.prototype.hex=function(){this.finalize();var t=this.h0,r=this.h1,h=this.h2,e=this.h3,s=this.h4,i=this.h5,o=this.h6,a=this.h7,H=HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[h>>28&15]+HEX_CHARS[h>>24&15]+HEX_CHARS[h>>20&15]+HEX_CHARS[h>>16&15]+HEX_CHARS[h>>12&15]+HEX_CHARS[h>>8&15]+HEX_CHARS[h>>4&15]+HEX_CHARS[15&h]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[15&s]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[15&o];return this.is224||(H+=HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[15&a]),H},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var t=this.h0,r=this.h1,h=this.h2,e=this.h3,s=this.h4,i=this.h5,o=this.h6,a=this.h7,H=[t>>24&255,t>>16&255,t>>8&255,255&t,r>>24&255,r>>16&255,r>>8&255,255&r,h>>24&255,h>>16&255,h>>8&255,255&h,e>>24&255,e>>16&255,e>>8&255,255&e,s>>24&255,s>>16&255,s>>8&255,255&s,i>>24&255,i>>16&255,i>>8&255,255&i,o>>24&255,o>>16&255,o>>8&255,255&o];return this.is224||H.push(a>>24&255,a>>16&255,a>>8&255,255&a),H},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(this.is224?28:32),r=new DataView(t);return r.setUint32(0,this.h0),r.setUint32(4,this.h1),r.setUint32(8,this.h2),r.setUint32(12,this.h3),r.setUint32(16,this.h4),r.setUint32(20,this.h5),r.setUint32(24,this.h6),this.is224||r.setUint32(28,this.h7),t},HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var t=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(t),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&define(function(){return exports}))}();
},{"process":"pBGv","buffer":"dskh"}],"JiGz":[function(require,module,exports) {
var Buffer = require("buffer").Buffer;
var e=require("buffer").Buffer,s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.signTransaction=exports.createTransaction=exports.SCHEMA=exports.Action=exports.SignedTransaction=exports.Transaction=exports.Signature=exports.deleteAccount=exports.deleteKey=exports.addKey=exports.stake=exports.transfer=exports.functionCall=exports.stringifyJsonOrBytes=exports.deployContract=exports.createAccount=exports.DeleteAccount=exports.DeleteKey=exports.AddKey=exports.Stake=exports.Transfer=exports.FunctionCall=exports.DeployContract=exports.CreateAccount=exports.IAction=exports.functionCallAccessKey=exports.fullAccessKey=exports.AccessKey=exports.AccessKeyPermission=exports.FullAccessPermission=exports.FunctionCallPermission=void 0;const t=s(require("js-sha256")),n=require("./utils/enums"),r=require("borsh"),i=require("./utils/key_pair");class c extends n.Assignable{}exports.FunctionCallPermission=c;class o extends n.Assignable{}exports.FullAccessPermission=o;class a extends n.Enum{}exports.AccessKeyPermission=a;class u extends n.Assignable{}function l(){return new u({nonce:0,permission:new a({fullAccess:new o({})})})}function d(e,s,t){return new u({nonce:0,permission:new a({functionCall:new c({receiverId:e,allowance:t,methodNames:s})})})}exports.AccessKey=u,exports.fullAccessKey=l,exports.functionCallAccessKey=d;class p extends n.Assignable{}exports.IAction=p;class x extends p{}exports.CreateAccount=x;class y extends p{}exports.DeployContract=y;class f extends p{}exports.FunctionCall=f;class A extends p{}exports.Transfer=A;class g extends p{}exports.Stake=g;class K extends p{}exports.AddKey=K;class k extends p{}exports.DeleteKey=k;class b extends p{}function w(){return new D({createAccount:new x({})})}function C(e){return new D({deployContract:new y({code:e})})}function m(s){return void 0!==s.byteLength&&s.byteLength===s.length?s:e.from(JSON.stringify(s))}function h(e,s,t,n,r=m){return new D({functionCall:new f({methodName:e,args:r(s),gas:t,deposit:n})})}function S(e){return new D({transfer:new A({deposit:e})})}function T(e,s){return new D({stake:new g({stake:e,publicKey:s})})}function P(e,s){return new D({addKey:new K({publicKey:e,accessKey:s})})}function M(e){return new D({deleteKey:new k({publicKey:e})})}function v(e){return new D({deleteAccount:new b({beneficiaryId:e})})}exports.DeleteAccount=b,exports.createAccount=w,exports.deployContract=C,exports.stringifyJsonOrBytes=m,exports.functionCall=h,exports.transfer=S,exports.stake=T,exports.addKey=P,exports.deleteKey=M,exports.deleteAccount=v;class I extends n.Assignable{}exports.Signature=I;class E extends n.Assignable{encode(){return r.serialize(exports.SCHEMA,this)}static decode(e){return r.deserialize(exports.SCHEMA,E,e)}}exports.Transaction=E;class H extends n.Assignable{encode(){return r.serialize(exports.SCHEMA,this)}static decode(e){return r.deserialize(exports.SCHEMA,H,e)}}exports.SignedTransaction=H;class D extends n.Enum{}function _(e,s,t,n,r,i){return new E({signerId:e,publicKey:s,nonce:n,receiverId:t,actions:r,blockHash:i})}async function F(e,s,n,i){const c=r.serialize(exports.SCHEMA,e),o=new Uint8Array(t.default.sha256.array(c)),a=await s.signMessage(c,n,i);return[o,new H({transaction:e,signature:new I({keyType:e.publicKey.keyType,data:a.signature})})]}async function q(...e){if(e[0].constructor===E){const[s,t,n,r]=e;return F(s,t,n,r)}{const[s,t,n,r,i,c,o]=e;return F(_(c,await i.getPublicKey(c,o),s,t,n,r),i,c,o)}}exports.Action=D,exports.SCHEMA=new Map([[I,{kind:"struct",fields:[["keyType","u8"],["data",[64]]]}],[H,{kind:"struct",fields:[["transaction",E],["signature",I]]}],[E,{kind:"struct",fields:[["signerId","string"],["publicKey",i.PublicKey],["nonce","u64"],["receiverId","string"],["blockHash",[32]],["actions",[D]]]}],[i.PublicKey,{kind:"struct",fields:[["keyType","u8"],["data",[32]]]}],[u,{kind:"struct",fields:[["nonce","u64"],["permission",a]]}],[a,{kind:"enum",field:"enum",values:[["functionCall",c],["fullAccess",o]]}],[c,{kind:"struct",fields:[["allowance",{kind:"option",type:"u128"}],["receiverId","string"],["methodNames",["string"]]]}],[o,{kind:"struct",fields:[]}],[D,{kind:"enum",field:"enum",values:[["createAccount",x],["deployContract",y],["functionCall",f],["transfer",A],["stake",g],["addKey",K],["deleteKey",k],["deleteAccount",b]]}],[x,{kind:"struct",fields:[]}],[y,{kind:"struct",fields:[["code",["u8"]]]}],[f,{kind:"struct",fields:[["methodName","string"],["args",["u8"]],["gas","u64"],["deposit","u128"]]}],[A,{kind:"struct",fields:[["deposit","u128"]]}],[g,{kind:"struct",fields:[["stake","u128"],["publicKey",i.PublicKey]]}],[K,{kind:"struct",fields:[["publicKey",i.PublicKey],["accessKey",u]]}],[k,{kind:"struct",fields:[["publicKey",i.PublicKey]]}],[b,{kind:"struct",fields:[["beneficiaryId","string"]]}]]),exports.createTransaction=_,exports.signTransaction=q;
},{"js-sha256":"K2GL","./utils/enums":"bD1J","borsh":"C6Jz","./utils/key_pair":"kvXx","buffer":"dskh"}],"dATY":[function(require,module,exports) {
"use strict";var e=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.diffEpochValidators=exports.findSeatPrice=void 0;const t=e(require("bn.js"));function a(e,a){const r=e.map(e=>new t.default(e.stake,10)).sort((e,t)=>e.cmp(t)),d=new t.default(a),n=r.reduce((e,t)=>e.add(t));if(n.lt(d))throw new Error("Stakes are below seats");let o=new t.default(1),i=n.add(new t.default(1));for(;!o.eq(i.sub(new t.default(1)));){const e=o.add(i).div(new t.default(2));let a=!1,n=new t.default(0);for(let t=0;t<r.length;++t)if((n=n.add(r[t].div(e))).gte(d)){o=e,a=!0;break}a||(i=e)}return o}function r(e,t){const a=new Map;e.forEach(e=>a.set(e.account_id,e));const r=new Set(t.map(e=>e.account_id));return{newValidators:t.filter(e=>!a.has(e.account_id)),removedValidators:e.filter(e=>!r.has(e.account_id)),changedValidators:t.filter(e=>a.has(e.account_id)&&a.get(e.account_id).stake!=e.stake).map(e=>({current:a.get(e.account_id),next:e}))}}exports.findSeatPrice=a,exports.diffEpochValidators=r;
},{"bn.js":"BOxy"}],"umBP":[function(require,module,exports) {
"use strict";var e=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.DEFAULT_FUNCTION_CALL_GAS=void 0;const t=e(require("bn.js"));exports.DEFAULT_FUNCTION_CALL_GAS=new t.default("30000000000000");
},{"bn.js":"BOxy"}],"IEkm":[function(require,module,exports) {
var Buffer = require("buffer").Buffer;
var e=require("buffer").Buffer,t=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Account=void 0;const n=t(require("bn.js")),i=t(require("depd")),s=require("./transaction"),r=require("./providers"),c=require("borsh"),a=require("./utils/key_pair"),o=require("./utils/errors"),u=require("./utils/rpc_errors"),l=require("./constants"),d=t(require("./utils/exponential-backoff")),y=12,h=500,f=1.5;function g(t){return JSON.parse(e.from(t).toString())}function p(t){return e.from(JSON.stringify(t))}class A{constructor(e,t){this.accessKeyByPublicKeyCache={},this.connection=e,this.accountId=t}get ready(){return i.default("Account.ready()")("not needed anymore, always ready"),Promise.resolve()}async fetchState(){i.default("Account.fetchState()")("use `Account.state()` instead")}async state(){return this.connection.provider.query({request_type:"view_account",account_id:this.accountId,finality:"optimistic"})}printLogsAndFailures(e,t){for(const n of t)console.log(`Receipt${n.receiptIds.length>1?"s":""}: ${n.receiptIds.join(", ")}`),this.printLogs(e,n.logs,"\t"),n.failure&&console.warn(`\tFailure [${e}]: ${n.failure}`)}printLogs(e,t,n=""){for(const i of t)console.log(`${n}Log [${e}]: ${i}`)}async signTransaction(e,t){const n=await this.findAccessKey(e,t);if(!n)throw new r.TypedError(`Can not sign transactions for account ${this.accountId} on network ${this.connection.networkId}, no matching key pair found in ${this.connection.signer}.`,"KeyNotFound");const{accessKey:i}=n,a=(await this.connection.provider.block({finality:"final"})).header.hash,o=++i.nonce;return await s.signTransaction(e,o,t,c.baseDecode(a),this.connection.signer,this.accountId,this.connection.networkId)}signAndSendTransaction(...e){return"string"==typeof e[0]?this.signAndSendTransactionV1(e[0],e[1]):this.signAndSendTransactionV2(e[0])}signAndSendTransactionV1(e,t){return i.default("Account.signAndSendTransaction(receiverId, actions")("use `Account.signAndSendTransaction(SignAndSendTransactionOptions)` instead"),this.signAndSendTransactionV2({receiverId:e,actions:t})}async signAndSendTransactionV2({receiverId:e,actions:t}){let n,i;const s=await d.default(h,y,f,async()=>{[n,i]=await this.signTransaction(e,t);const s=i.transaction.publicKey;try{return await this.connection.provider.sendTransaction(i)}catch(a){if("InvalidNonce"===a.type)return o.logWarning(`Retrying transaction ${e}:${c.baseEncode(n)} with new nonce.`),delete this.accessKeyByPublicKeyCache[s.toString()],null;if("Expired"===a.type)return o.logWarning(`Retrying transaction ${e}:${c.baseEncode(n)} due to expired block hash`),null;throw a.context=new r.ErrorContext(c.baseEncode(n)),a}});if(!s)throw new r.TypedError("nonce retries exceeded for transaction. This usually means there are too many parallel requests with the same access key.","RetriesExceeded");const a=[s.transaction_outcome,...s.receipts_outcome].reduce((e,t)=>t.outcome.logs.length||"object"==typeof t.outcome.status&&"object"==typeof t.outcome.status.Failure?e.concat({receiptIds:t.outcome.receipt_ids,logs:t.outcome.logs,failure:void 0!==t.outcome.status.Failure?u.parseRpcError(t.outcome.status.Failure):null}):e,[]);if(this.printLogsAndFailures(i.transaction.receiverId,a),"object"==typeof s.status&&"object"==typeof s.status.Failure)throw s.status.Failure.error_message&&s.status.Failure.error_type?new r.TypedError(`Transaction ${s.transaction_outcome.id} failed. ${s.status.Failure.error_message}`,s.status.Failure.error_type):u.parseResultError(s);return s}async findAccessKey(e,t){const n=await this.connection.signer.getPublicKey(this.accountId,this.connection.networkId);if(!n)return null;const i=this.accessKeyByPublicKeyCache[n.toString()];if(void 0!==i)return{publicKey:n,accessKey:i};try{const e=await this.connection.provider.query({request_type:"view_access_key",account_id:this.accountId,public_key:n.toString(),finality:"optimistic"});return this.accessKeyByPublicKeyCache[n.toString()]?{publicKey:n,accessKey:this.accessKeyByPublicKeyCache[n.toString()]}:(this.accessKeyByPublicKeyCache[n.toString()]=e,{publicKey:n,accessKey:e})}catch(s){if("AccessKeyDoesNotExist"==s.type)return null;throw s}}async createAndDeployContract(e,t,n,i){const r=s.fullAccessKey();return await this.signAndSendTransaction({receiverId:e,actions:[s.createAccount(),s.transfer(i),s.addKey(a.PublicKey.from(t),r),s.deployContract(n)]}),new A(this.connection,e)}async sendMoney(e,t){return this.signAndSendTransaction({receiverId:e,actions:[s.transfer(t)]})}async createAccount(e,t,n){const i=s.fullAccessKey();return this.signAndSendTransaction({receiverId:e,actions:[s.createAccount(),s.transfer(n),s.addKey(a.PublicKey.from(t),i)]})}async deleteAccount(e){return this.signAndSendTransaction({receiverId:this.accountId,actions:[s.deleteAccount(e)]})}async deployContract(e){return this.signAndSendTransaction({receiverId:this.accountId,actions:[s.deployContract(e)]})}async functionCall(...e){return"string"==typeof e[0]?this.functionCallV1(e[0],e[1],e[2],e[3],e[4]):this.functionCallV2(e[0])}functionCallV1(e,t,n,r,c){return i.default("Account.functionCall(contractId, methodName, args, gas, amount)")("use `Account.functionCall(FunctionCallOptions)` instead"),n=n||{},this.validateArgs(n),this.signAndSendTransaction({receiverId:e,actions:[s.functionCall(t,n,r||l.DEFAULT_FUNCTION_CALL_GAS,c)]})}functionCallV2({contractId:e,methodName:t,args:n={},gas:i=l.DEFAULT_FUNCTION_CALL_GAS,attachedDeposit:r,walletMeta:c,walletCallbackUrl:a,stringify:o}){this.validateArgs(n);const u=void 0===o?s.stringifyJsonOrBytes:o;return this.signAndSendTransaction({receiverId:e,actions:[s.functionCall(t,n,i,r,u)],walletMeta:c,walletCallbackUrl:a})}async addKey(e,t,n,i){let r;return n||(n=[]),Array.isArray(n)||(n=[n]),r=t?s.functionCallAccessKey(t,n,i):s.fullAccessKey(),this.signAndSendTransaction({receiverId:this.accountId,actions:[s.addKey(a.PublicKey.from(e),r)]})}async deleteKey(e){return this.signAndSendTransaction({receiverId:this.accountId,actions:[s.deleteKey(a.PublicKey.from(e))]})}async stake(e,t){return this.signAndSendTransaction({receiverId:this.accountId,actions:[s.stake(t,a.PublicKey.from(e))]})}validateArgs(e){if(!(void 0!==e.byteLength&&e.byteLength===e.length)&&(Array.isArray(e)||"object"!=typeof e))throw new o.PositionalArgsError}async viewFunction(t,n,i={},{parse:s=g,stringify:r=p}={}){this.validateArgs(i);const c=r(i).toString("base64"),a=await this.connection.provider.query({request_type:"call_function",account_id:t,method_name:n,args_base64:c,finality:"optimistic"});return a.logs&&this.printLogs(t,a.logs),a.result&&a.result.length>0&&s(e.from(a.result))}async viewState(t,n={finality:"optimistic"}){const{values:i}=await this.connection.provider.query({request_type:"view_state",...n,account_id:this.accountId,prefix_base64:e.from(t).toString("base64")});return i.map(({key:t,value:n})=>({key:e.from(t,"base64"),value:e.from(n,"base64")}))}async getAccessKeys(){const e=await this.connection.provider.query({request_type:"view_access_key_list",account_id:this.accountId,finality:"optimistic"});return Array.isArray(e)?e:e.keys}async getAccountDetails(){return{authorizedApps:(await this.getAccessKeys()).filter(e=>"FullAccess"!==e.access_key.permission).map(e=>{const t=e.access_key.permission;return{contractId:t.FunctionCall.receiver_id,amount:t.FunctionCall.allowance,publicKey:e.public_key}})}}async getAccountBalance(){const e=await this.connection.provider.experimental_protocolConfig({finality:"final"}),t=await this.state(),i=new n.default(e.runtime_config.storage_amount_per_byte),s=new n.default(t.storage_usage).mul(i),r=new n.default(t.locked),c=new n.default(t.amount).add(r),a=c.sub(n.default.max(r,s));return{total:c.toString(),stateStaked:s.toString(),staked:r.toString(),available:a.toString()}}}exports.Account=A;
},{"bn.js":"BOxy","depd":"BGME","./transaction":"JiGz","./providers":"a8i6","borsh":"C6Jz","./utils/key_pair":"kvXx","./utils/errors":"jwOG","./utils/rpc_errors":"K54z","./constants":"umBP","./utils/exponential-backoff":"sgp1","buffer":"dskh"}],"FFpR":[function(require,module,exports) {
var Buffer = require("buffer").Buffer;
var e=require("buffer").Buffer,t=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Account2FA=exports.AccountMultisig=exports.MULTISIG_CONFIRM_METHODS=exports.MULTISIG_CHANGE_METHODS=exports.MULTISIG_DEPOSIT=exports.MULTISIG_GAS=exports.MULTISIG_ALLOWANCE=exports.MULTISIG_STORAGE_KEY=void 0;const s=t(require("bn.js")),n=t(require("depd")),i=require("./account"),r=require("./utils/format"),o=require("./utils/key_pair"),a=require("./transaction"),c=require("./utils/web");exports.MULTISIG_STORAGE_KEY="__multisigRequest",exports.MULTISIG_ALLOWANCE=new s.default(r.parseNearAmount("1")),exports.MULTISIG_GAS=new s.default("100000000000000"),exports.MULTISIG_DEPOSIT=new s.default("0"),exports.MULTISIG_CHANGE_METHODS=["add_request","add_request_and_confirm","delete_request","confirm"],exports.MULTISIG_CONFIRM_METHODS=["confirm"];const d={[exports.MULTISIG_STORAGE_KEY]:null};class u extends i.Account{constructor(e,t,s){super(e,t),this.storage=s.storage,this.onAddRequestResult=s.onAddRequestResult}async signAndSendTransactionWithAccount(e,t){return super.signAndSendTransaction({receiverId:e,actions:t})}signAndSendTransaction(...e){return"string"==typeof e[0]?this._signAndSendTransaction({receiverId:e[0],actions:e[1]}):this._signAndSendTransaction(e[0])}async _signAndSendTransaction({receiverId:t,actions:s}){const{accountId:n}=this,i=e.from(JSON.stringify({request:{receiver_id:t,actions:f(s,n,t)}}));let r;try{r=await super.signAndSendTransaction({receiverId:n,actions:[a.functionCall("add_request_and_confirm",i,exports.MULTISIG_GAS,exports.MULTISIG_DEPOSIT)]})}catch(c){if(c.toString().includes("Account has too many active requests. Confirm or delete some"))return await this.deleteUnconfirmedRequests(),await this.signAndSendTransaction(t,s);throw c}if(!r.status)throw new Error("Request failed");const o={...r.status};if(!o.SuccessValue||"string"!=typeof o.SuccessValue)throw new Error("Request failed");return this.setRequest({accountId:n,actions:s,requestId:parseInt(e.from(o.SuccessValue,"base64").toString("ascii"),10)}),this.onAddRequestResult&&await this.onAddRequestResult(r),this.deleteUnconfirmedRequests(),r}async deleteUnconfirmedRequests(){const e=await this.getRequestIds(),{requestId:t}=this.getRequest();for(const n of e)if(n!=t)try{await super.signAndSendTransaction({receiverId:this.accountId,actions:[a.functionCall("delete_request",{request_id:n},exports.MULTISIG_GAS,exports.MULTISIG_DEPOSIT)]})}catch(s){console.warn("Attempt to delete an earlier request before 15 minutes failed. Will try again.")}}async getRequestIds(){return this.viewFunction(this.accountId,"list_request_ids")}getRequest(){return this.storage?JSON.parse(this.storage.getItem(exports.MULTISIG_STORAGE_KEY)||"{}"):d[exports.MULTISIG_STORAGE_KEY]}setRequest(e){if(this.storage)return this.storage.setItem(exports.MULTISIG_STORAGE_KEY,JSON.stringify(e));d[exports.MULTISIG_STORAGE_KEY]=e}}exports.AccountMultisig=u;class l extends u{constructor(e,t,s){super(e,t,s),this.helperUrl="https://helper.testnet.near.org",this.helperUrl=s.helperUrl||this.helperUrl,this.storage=s.storage,this.sendCode=s.sendCode||this.sendCodeDefault,this.getCode=s.getCode||this.getCodeDefault,this.verifyCode=s.verifyCode||this.verifyCodeDefault,this.onConfirmResult=s.onConfirmResult}async signAndSendTransaction(...e){if("string"==typeof e[0]){return n.default("Account.signAndSendTransaction(receiverId, actions")("use `Account2FA.signAndSendTransaction(SignAndSendTransactionOptions)` instead"),this.__signAndSendTransaction({receiverId:e[0],actions:e[1]})}return this.__signAndSendTransaction(e[0])}async __signAndSendTransaction({receiverId:e,actions:t}){await super.signAndSendTransaction({receiverId:e,actions:t}),await this.sendCode();const s=await this.promptAndVerify();return this.onConfirmResult&&await this.onConfirmResult(s),s}async deployMultisig(t){const{accountId:s}=this,n=(await this.getRecoveryMethods()).data.filter(({kind:e,publicKey:t})=>("phrase"===e||"ledger"===e)&&null!==t).map(e=>e.publicKey),i=(await this.getAccessKeys()).filter(({public_key:e,access_key:{permission:t}})=>"FullAccess"===t&&!n.includes(e)).map(e=>e.public_key).map(h),r=h((await this.postSignedJson("/2fa/getAccessKey",{accountId:s})).publicKey),o=e.from(JSON.stringify({num_confirmations:2})),c=[...i.map(e=>a.deleteKey(e)),...i.map(e=>a.addKey(e,a.functionCallAccessKey(s,exports.MULTISIG_CHANGE_METHODS,null))),a.addKey(r,a.functionCallAccessKey(s,exports.MULTISIG_CONFIRM_METHODS,null)),a.deployContract(t)];return"11111111111111111111111111111111"===(await this.state()).code_hash&&c.push(a.functionCall("new",o,exports.MULTISIG_GAS,exports.MULTISIG_DEPOSIT)),console.log("deploying multisig contract for",s),await super.signAndSendTransactionWithAccount(s,c)}async disable(e){const{accountId:t}=this,s=(await this.getAccessKeys()).filter(({access_key:e})=>"FullAccess"!==e.permission).filter(({access_key:e})=>{const s=e.permission.FunctionCall;return s.receiver_id===t&&4===s.method_names.length&&s.method_names.includes("add_request_and_confirm")}),n=o.PublicKey.from((await this.postSignedJson("/2fa/getAccessKey",{accountId:t})).publicKey),i=[a.deleteKey(n),...s.map(({public_key:e})=>a.deleteKey(o.PublicKey.from(e))),...s.map(({public_key:e})=>a.addKey(o.PublicKey.from(e),null)),a.deployContract(e)];return console.log("disabling 2fa for",t),await this.signAndSendTransaction({receiverId:t,actions:i})}async sendCodeDefault(){const{accountId:e}=this,{requestId:t}=this.getRequest(),s=await this.get2faMethod();return await this.postSignedJson("/2fa/send",{accountId:e,method:s,requestId:t}),t}async getCodeDefault(e){throw new Error('There is no getCode callback provided. Please provide your own in AccountMultisig constructor options. It has a parameter method where method.kind is "email" or "phone".')}async promptAndVerify(){const e=await this.get2faMethod(),t=await this.getCode(e);try{return await this.verifyCode(t)}catch(s){if(console.warn("Error validating security code:",s),s.toString().includes("invalid 2fa code provided")||s.toString().includes("2fa code not valid"))return await this.promptAndVerify();throw s}}async verifyCodeDefault(e){const{accountId:t}=this,s=this.getRequest();if(!s)throw new Error("no request pending");const{requestId:n}=s;return await this.postSignedJson("/2fa/verify",{accountId:t,securityCode:e,requestId:n})}async getRecoveryMethods(){const{accountId:e}=this;return{accountId:e,data:await this.postSignedJson("/account/recoveryMethods",{accountId:e})}}async get2faMethod(){let{data:e}=await this.getRecoveryMethods();if(e&&e.length&&(e=e.find(e=>0===e.kind.indexOf("2fa-"))),!e)return null;const{kind:t,detail:s}=e;return{kind:t,detail:s}}async signatureFor(){const{accountId:t}=this,s=(await this.connection.provider.block({finality:"final"})).header.height.toString(),n=await this.connection.signer.signMessage(e.from(s),t,this.connection.networkId);return{blockNumber:s,blockNumberSignature:e.from(n.signature).toString("base64")}}async postSignedJson(e,t){return await c.fetchJson(this.helperUrl+e,JSON.stringify({...t,...await this.signatureFor()}))}}exports.Account2FA=l;const h=e=>o.PublicKey.from(e),p=e=>e.toString().replace("ed25519:",""),f=(t,s,n)=>t.map(t=>{const i=t.enum,{gas:r,publicKey:o,methodName:a,args:c,deposit:d,accessKey:u,code:l}=t[i],h={type:i[0].toUpperCase()+i.substr(1),gas:r&&r.toString()||void 0,public_key:o&&p(o)||void 0,method_name:a,args:c&&e.from(c).toString("base64")||void 0,code:l&&e.from(l).toString("base64")||void 0,amount:d&&d.toString()||void 0,deposit:d&&d.toString()||"0",permission:void 0};if(u&&(n===s&&"fullAccess"!==u.permission.enum&&(h.permission={receiver_id:s,allowance:exports.MULTISIG_ALLOWANCE.toString(),method_names:exports.MULTISIG_CHANGE_METHODS}),"functionCall"===u.permission.enum)){const{receiverId:e,methodNames:t,allowance:s}=u.permission.functionCall;h.permission={receiver_id:e,allowance:s&&s.toString()||void 0,method_names:t}}return h});
},{"bn.js":"BOxy","depd":"BGME","./account":"IEkm","./utils/format":"ynTt","./utils/key_pair":"kvXx","./transaction":"JiGz","./utils/web":"T1W2","buffer":"dskh"}],"nIgH":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.UrlAccountCreator=exports.LocalAccountCreator=exports.AccountCreator=void 0;const t=require("./utils/web");class c{}exports.AccountCreator=c;class e extends c{constructor(t,c){super(),this.masterAccount=t,this.initialBalance=c}async createAccount(t,c){await this.masterAccount.createAccount(t,c,this.initialBalance)}}exports.LocalAccountCreator=e;class r extends c{constructor(t,c){super(),this.connection=t,this.helperUrl=c}async createAccount(c,e){await t.fetchJson(`${this.helperUrl}/account`,JSON.stringify({newAccountId:c,newAccountPublicKey:e.toString()}))}}exports.UrlAccountCreator=r;
},{"./utils/web":"T1W2"}],"V7o6":[function(require,module,exports) {
"use strict";var e=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.InMemorySigner=exports.Signer=void 0;const r=e(require("js-sha256")),t=require("./utils/key_pair"),n=require("./key_stores/in_memory_key_store");class s{}exports.Signer=s;class o extends s{constructor(e){super(),this.keyStore=e}static async fromKeyPair(e,r,t){const s=new n.InMemoryKeyStore;return await s.setKey(e,r,t),new o(s)}async createKey(e,r){const n=t.KeyPair.fromRandom("ed25519");return await this.keyStore.setKey(r,e,n),n.getPublicKey()}async getPublicKey(e,r){const t=await this.keyStore.getKey(r,e);return null===t?null:t.getPublicKey()}async signMessage(e,t,n){const s=new Uint8Array(r.default.sha256.array(e));if(!t)throw new Error("InMemorySigner requires provided account id");const o=await this.keyStore.getKey(n,t);if(null===o)throw new Error(`Key for ${t} not found in ${n}`);return o.sign(s)}toString(){return`InMemorySigner(${this.keyStore})`}}exports.InMemorySigner=o;
},{"js-sha256":"K2GL","./utils/key_pair":"kvXx","./key_stores/in_memory_key_store":"qQPA"}],"PyYj":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Connection=void 0;const e=require("./providers"),r=require("./signer");function n(r){switch(r.type){case void 0:return r;case"JsonRpcProvider":return new e.JsonRpcProvider(r.args.url);default:throw new Error(`Unknown provider type ${r.type}`)}}function t(e){switch(e.type){case void 0:return e;case"InMemorySigner":return new r.InMemorySigner(e.keyStore);default:throw new Error(`Unknown signer type ${e.type}`)}}class o{constructor(e,r,n){this.networkId=e,this.provider=r,this.signer=n}static fromConfig(e){const r=n(e.provider),i=t(e.signer);return new o(e.networkId,r,i)}}exports.Connection=o;
},{"./providers":"a8i6","./signer":"V7o6"}],"NYck":[function(require,module,exports) {
"use strict";var t=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Contract=void 0;const e=t(require("bn.js")),r=t(require("depd")),a=require("./providers"),o=require("./utils/errors");function n(t,e){return{[t]:(...t)=>e(...t)}[t]}const s=t=>t&&void 0!==t.byteLength&&t.byteLength===t.length,c=t=>"[object Object]"===Object.prototype.toString.call(t);class i{constructor(t,e,a){this.account=t,this.contractId=e;const{viewMethods:i=[],changeMethods:l=[]}=a;i.forEach(t=>{Object.defineProperty(this,t,{writable:!1,enumerable:!0,value:n(t,async(e={},r={},...a)=>{if(a.length||!c(e)&&!s(e)||!c(r))throw new o.PositionalArgsError;return this.account.viewFunction(this.contractId,t,e,r)})})}),l.forEach(t=>{Object.defineProperty(this,t,{writable:!1,enumerable:!0,value:n(t,async(...e)=>{if(e.length&&(e.length>3||!c(e[0])&&!s(e[0])))throw new o.PositionalArgsError;if(e.length>1||!e[0]||!e[0].args){return r.default("contract.methodName(args, gas, amount)")("use `contract.methodName({ args, gas?, amount?, callbackUrl?, meta? })` instead"),this._changeMethod({methodName:t,args:e[0],gas:e[1],amount:e[2]})}return this._changeMethod({methodName:t,...e[0]})})})})}async _changeMethod({args:t,methodName:e,gas:r,amount:o,meta:n,callbackUrl:s}){l({gas:r,amount:o});const c=await this.account.functionCall({contractId:this.contractId,methodName:e,args:t,gas:r,attachedDeposit:o,walletMeta:n,walletCallbackUrl:s});return a.getTransactionLastResult(c)}}function l(t){for(const r of Object.keys(t)){const a=t[r];if(a&&!e.default.isBN(a)&&isNaN(a))throw new o.ArgumentTypeError(r,"number, decimal string or BN",a)}}exports.Contract=i;
},{"bn.js":"BOxy","depd":"BGME","./providers":"a8i6","./utils/errors":"jwOG"}],"wBEm":[function(require,module,exports) {
"use strict";var e=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Near=void 0;const n=e(require("bn.js")),t=require("./account"),o=require("./connection"),r=require("./contract"),c=require("./account_creator");class i{constructor(e){if(this.config=e,this.connection=o.Connection.fromConfig({networkId:e.networkId,provider:{type:"JsonRpcProvider",args:{url:e.nodeUrl}},signer:e.signer||{type:"InMemorySigner",keyStore:e.keyStore||e.deps.keyStore}}),e.masterAccount){const o=e.initialBalance?new n.default(e.initialBalance):new n.default("500000000000000000000000000");this.accountCreator=new c.LocalAccountCreator(new t.Account(this.connection,e.masterAccount),o)}else e.helperUrl?this.accountCreator=new c.UrlAccountCreator(this.connection,e.helperUrl):this.accountCreator=null}async account(e){return new t.Account(this.connection,e)}async createAccount(e,n){if(!this.accountCreator)throw new Error("Must specify account creator, either via masterAccount or helperUrl configuration settings.");return await this.accountCreator.createAccount(e,n),new t.Account(this.connection,e)}async loadContract(e,n){const o=new t.Account(this.connection,n.sender);return new r.Contract(o,e,n)}async sendTokens(e,n,o){console.warn("near.sendTokens is deprecated. Use `yourAccount.sendMoney` instead.");const r=new t.Account(this.connection,n);return(await r.sendMoney(o,e)).transaction_outcome.id}}exports.Near=i;
},{"bn.js":"BOxy","./account":"IEkm","./connection":"PyYj","./contract":"NYck","./account_creator":"nIgH"}],"r7Zd":[function(require,module,exports) {
var Buffer = require("buffer").Buffer;
var t=require("buffer").Buffer,e=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.ConnectedWalletAccount=exports.WalletAccount=exports.WalletConnection=void 0;const a=e(require("depd")),n=require("./account"),s=require("./transaction"),i=require("./utils"),r=require("borsh"),c=require("borsh"),o="/login/",l="add_request_and_confirm",u="_wallet_auth_key",h="pending_key";class d{constructor(t,e){this._near=t;const a=e+u,n=JSON.parse(window.localStorage.getItem(a));this._networkId=t.config.networkId,this._walletBaseUrl=t.config.walletUrl,e=e||t.config.contractName||"default",this._keyStore=t.connection.signer.keyStore,this._authData=n||{allKeys:[]},this._authDataKey=a,this.isSignedIn()||this._completeSignInWithAccessKey()}isSignedIn(){return!!this._authData.accountId}getAccountId(){return this._authData.accountId||""}async requestSignIn(t={},e,n,s){let r;if("string"==typeof t){a.default("requestSignIn(contractId, title)")("`title` ignored; use `requestSignIn({ contractId, methodNames, successUrl, failureUrl })` instead"),r={contractId:t,successUrl:n,failureUrl:s}}else r=t;const c=new URL(window.location.href),l=new URL(this._walletBaseUrl+o);if(l.searchParams.set("success_url",r.successUrl||c.href),l.searchParams.set("failure_url",r.failureUrl||c.href),r.contractId){const t=await this._near.account(r.contractId);await t.state(),l.searchParams.set("contract_id",r.contractId);const e=i.KeyPair.fromRandom("ed25519");l.searchParams.set("public_key",e.getPublicKey().toString()),await this._keyStore.setKey(this._networkId,h+e.getPublicKey(),e)}r.methodNames&&r.methodNames.forEach(t=>{l.searchParams.append("methodNames",t)}),window.location.assign(l.toString())}async requestSignTransactions(...t){if(Array.isArray(t[0])){return a.default("WalletConnection.requestSignTransactions(transactions, callbackUrl, meta)")("use `WalletConnection.requestSignTransactions(RequestSignTransactionsOptions)` instead"),this._requestSignTransactions({transactions:t[0],callbackUrl:t[1],meta:t[2]})}return this._requestSignTransactions(t[0])}async _requestSignTransactions({transactions:e,meta:a,callbackUrl:n}){const i=new URL(window.location.href),r=new URL("sign",this._walletBaseUrl);r.searchParams.set("transactions",e.map(t=>c.serialize(s.SCHEMA,t)).map(e=>t.from(e).toString("base64")).join(",")),r.searchParams.set("callbackUrl",n||i.href),a&&r.searchParams.set("meta",a),window.location.assign(r.toString())}async _completeSignInWithAccessKey(){const t=new URL(window.location.href),e=t.searchParams.get("public_key")||"",a=(t.searchParams.get("all_keys")||"").split(","),n=t.searchParams.get("account_id")||"";n&&(this._authData={accountId:n,allKeys:a},window.localStorage.setItem(this._authDataKey,JSON.stringify(this._authData)),e&&await this._moveKeyFromTempToPermanent(n,e)),t.searchParams.delete("public_key"),t.searchParams.delete("all_keys"),t.searchParams.delete("account_id"),window.history.replaceState({},document.title,t.toString())}async _moveKeyFromTempToPermanent(t,e){const a=await this._keyStore.getKey(this._networkId,h+e);await this._keyStore.setKey(this._networkId,t,a),await this._keyStore.removeKey(this._networkId,h+e)}signOut(){this._authData={},window.localStorage.removeItem(this._authDataKey)}account(){return this._connectedAccount||(this._connectedAccount=new _(this,this._near.connection,this._authData.accountId)),this._connectedAccount}}exports.WalletConnection=d,exports.WalletAccount=d;class _ extends n.Account{constructor(t,e,a){super(e,a),this.walletConnection=t}signAndSendTransaction(...t){return"string"==typeof t[0]?this._signAndSendTransaction({receiverId:t[0],actions:t[1]}):this._signAndSendTransaction(t[0])}async _signAndSendTransaction({receiverId:t,actions:e,walletMeta:a,walletCallbackUrl:n=window.location.href}){const c=await this.connection.signer.getPublicKey(this.accountId,this.connection.networkId);let o=await this.accessKeyForTransaction(t,e,c);if(!o)throw new Error(`Cannot find matching key for transaction sent to ${t}`);if(c&&c.toString()===o.public_key)try{return await super.signAndSendTransaction({receiverId:t,actions:e})}catch(w){if("NotEnoughAllowance"!==w.type)throw w;o=await this.accessKeyForTransaction(t,e)}const l=await this.connection.provider.block({finality:"final"}),u=r.baseDecode(l.header.hash),h=i.PublicKey.from(o.public_key),d=o.access_key.nonce+1,_=s.createTransaction(this.accountId,h,t,d,e,u);return await this.walletConnection.requestSignTransactions({transactions:[_],meta:a,callbackUrl:n}),new Promise((t,e)=>{setTimeout(()=>{e(new Error("Failed to redirect to sign transaction"))},1e3)})}async accessKeyMatchesTransaction(t,e,a){const{access_key:{permission:n}}=t;if("FullAccess"===n)return!0;if(n.FunctionCall){const{receiver_id:t,method_names:s}=n.FunctionCall;if(t===this.accountId&&s.includes(l))return!0;if(t===e){if(1!==a.length)return!1;const[{functionCall:t}]=a;return t&&(!t.deposit||"0"===t.deposit.toString())&&(0===s.length||s.includes(t.methodName))}}return!1}async accessKeyForTransaction(t,e,a){const n=await this.getAccessKeys();if(a){const s=n.find(t=>t.public_key.toString()===a.toString());if(s&&await this.accessKeyMatchesTransaction(s,t,e))return s}const s=this.walletConnection._authData.allKeys;for(const i of n)if(-1!==s.indexOf(i.public_key)&&await this.accessKeyMatchesTransaction(i,t,e))return i;return null}}exports.ConnectedWalletAccount=_;
},{"depd":"BGME","./account":"IEkm","./transaction":"JiGz","./utils":"bEEV","borsh":"C6Jz","buffer":"dskh"}],"gdw7":[function(require,module,exports) {
"use strict";var e=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),t=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var n={};if(null!=r)for(var o in r)"default"!==o&&Object.hasOwnProperty.call(r,o)&&e(n,r,o);return t(n,r),n};Object.defineProperty(exports,"__esModule",{value:!0}),exports.WalletConnection=exports.WalletAccount=exports.ConnectedWalletAccount=exports.Near=exports.KeyPair=exports.Signer=exports.InMemorySigner=exports.Contract=exports.Connection=exports.Account=exports.multisig=exports.validators=exports.transactions=exports.utils=exports.providers=exports.accountCreator=void 0;const n=r(require("./providers"));exports.providers=n;const o=r(require("./utils"));exports.utils=o;const c=r(require("./transaction"));exports.transactions=c;const i=r(require("./validators"));exports.validators=i;const u=require("./account");Object.defineProperty(exports,"Account",{enumerable:!0,get:function(){return u.Account}});const s=r(require("./account_multisig"));exports.multisig=s;const a=r(require("./account_creator"));exports.accountCreator=a;const l=require("./connection");Object.defineProperty(exports,"Connection",{enumerable:!0,get:function(){return l.Connection}});const p=require("./signer");Object.defineProperty(exports,"Signer",{enumerable:!0,get:function(){return p.Signer}}),Object.defineProperty(exports,"InMemorySigner",{enumerable:!0,get:function(){return p.InMemorySigner}});const f=require("./contract");Object.defineProperty(exports,"Contract",{enumerable:!0,get:function(){return f.Contract}});const x=require("./utils/key_pair");Object.defineProperty(exports,"KeyPair",{enumerable:!0,get:function(){return x.KeyPair}});const d=require("./near");Object.defineProperty(exports,"Near",{enumerable:!0,get:function(){return d.Near}});const b=require("./wallet-account");Object.defineProperty(exports,"ConnectedWalletAccount",{enumerable:!0,get:function(){return b.ConnectedWalletAccount}}),Object.defineProperty(exports,"WalletAccount",{enumerable:!0,get:function(){return b.WalletAccount}}),Object.defineProperty(exports,"WalletConnection",{enumerable:!0,get:function(){return b.WalletConnection}});
},{"./providers":"a8i6","./utils":"bEEV","./transaction":"JiGz","./validators":"dATY","./account":"IEkm","./account_multisig":"FFpR","./account_creator":"nIgH","./connection":"PyYj","./signer":"V7o6","./contract":"NYck","./utils/key_pair":"kvXx","./near":"wBEm","./wallet-account":"r7Zd"}],"eFRj":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.connect=void 0;const e=require("./near");async function n(n){return new e.Near(n)}exports.connect=n;
},{"./near":"wBEm"}],"RGbY":[function(require,module,exports) {
var t=function(){this.tests={},this.cache={}};t.prototype={constructor:t,define:function(t,i){if("string"!=typeof t||!(i instanceof Function))throw new Error("Invalid capability definition.");if(this.tests[t])throw new Error('Duplicated capability definition by "'+t+'".');this.tests[t]=i},check:function(t){if(!this.test(t))throw new Error('The current environment does not support "'+t+'", therefore we cannot continue.')},test:function(t){if(void 0!==this.cache[t])return this.cache[t];if(!this.tests[t])throw new Error('Unknown capability with name "'+t+'".');var i=this.tests[t];return this.cache[t]=!!i(),this.cache[t]}},module.exports=t;
},{}],"sziu":[function(require,module,exports) {
var e=require("./CapabilityDetector"),t=new e,n=function(e){return t.test(e)};n.define=function(e,n){t.define(e,n)},n.check=function(e){t.check(e)},n.test=n,module.exports=n;
},{"./CapabilityDetector":"RGbY"}],"CUbn":[function(require,module,exports) {
var r=require("."),t=r.define,e=r.test;t("strict mode",function(){return void 0===this}),t("arguments.callee.caller",function(){try{return function(){return arguments.callee.caller}()===arguments.callee}catch(r){return!1}}),t("es5",function(){return e("Array.prototype.forEach")&&e("Array.prototype.map")&&e("Function.prototype.bind")&&e("Object.create")&&e("Object.defineProperties")&&e("Object.defineProperty")&&e("Object.prototype.hasOwnProperty")}),t("Array.prototype.forEach",function(){return Array.prototype.forEach}),t("Array.prototype.map",function(){return Array.prototype.map}),t("Function.prototype.bind",function(){return Function.prototype.bind}),t("Object.create",function(){return Object.create}),t("Object.defineProperties",function(){return Object.defineProperties}),t("Object.defineProperty",function(){return Object.defineProperty}),t("Object.prototype.hasOwnProperty",function(){return Object.prototype.hasOwnProperty}),t("Error.captureStackTrace",function(){return Error.captureStackTrace}),t("Error.prototype.stack",function(){try{throw new Error}catch(r){return r.stack||r.stacktrace}});
},{".":"sziu"}],"zG2T":[function(require,module,exports) {
require("./lib/definitions"),module.exports=require("./lib");
},{"./lib/definitions":"CUbn","./lib":"sziu"}],"CRcc":[function(require,module,exports) {
require(".").check("es5");
},{".":"zG2T"}],"jWFZ":[function(require,module,exports) {
var r=function(r,n,a){var o="";if(o+=r.name||"Error",o+=": "+(r.message||""),a instanceof Array)for(var e in a){o+="\n # "+a[e]}for(var t in n){o+="\n at "+n[t].toString()}return o};module.exports=r;
},{}],"bXqZ":[function(require,module,exports) {
var r=require("./prepareStackTrace");module.exports=function(){return Error.getStackTrace=function(r){return r.stack},{prepareStackTrace:r}};
},{"./prepareStackTrace":"jWFZ"}],"zkD4":[function(require,module,exports) {
var t=function(){var o=Object.create({Source:Object,config:{},buildArgs:[]});function r(t){var r="config";if(t instanceof Function)r="Source";else if(t instanceof Array)r="buildArgs";else{if(!(t instanceof Object))throw new Error("Invalid configuration option.");r="config"}if(o.hasOwnProperty(r))throw new Error("Duplicated configuration option: "+r+".");o[r]=t}for(var e=0,n=arguments.length;e<n;++e)r(arguments[e]);var i=o.Source,c=o.config,p=o.buildArgs;return(i.extend||t.extend).call(i,c,p)};t.factory=function(){return function(){this.build instanceof Function&&this.build.apply(this,arguments),this.init instanceof Function&&this.init.apply(this,arguments)}},t.extend=function(o,r){var e;return o||(o={}),o.prototype instanceof Object&&o.prototype.constructor!==Object?e=o.prototype.constructor:o.factory instanceof Function&&(e=o.factory.call(this)),((e=(this.clone||t.clone).call(this,e,r)).merge||t.merge).call(e,o),e},t.prototype.extend=function(o,r){var e=(this.clone||t.prototype.clone).apply(this,r);return(e.merge||t.prototype.merge).call(e,o),e},t.clone=function(o,r){for(var e in o instanceof Function||(o=(this.factory||t.factory).call(this)),o.prototype=(this.prototype.clone||t.prototype.clone).apply(this.prototype,r||[]),o.prototype.constructor=o,this)"prototype"!==e&&(o[e]=this[e]);return o},t.prototype.clone=function(){var t=Object.create(this);return t.build instanceof Function&&t.build.apply(t,arguments),t},t.merge=function(o){for(var r in o)"prototype"!==r&&(this[r]=o[r]);return o.prototype instanceof Object&&(this.prototype.merge||t.prototype.merge).call(this.prototype,o.prototype),this},t.prototype.merge=function(t){for(var o in t)"constructor"!==o&&(this[o]=t[o]);return this},t.absorb=function(o){for(var r in o)"prototype"===r||void 0!==this[r]&&this[r]!==Function.prototype[r]||(this[r]=o[r]);return o.prototype instanceof Object&&(this.prototype.absorb||t.prototype.absorb).call(this.prototype,o.prototype),this},t.prototype.absorb=function(t){for(var o in t)"constructor"===o||void 0!==this[o]&&this[o]!==Object.prototype[o]||(this[o]=t[o]);return this},t.getAncestor=function(){if(this!==this.prototype.constructor)return this.prototype.constructor},t.newInstance=function(){var t=Object.create(this.prototype);return this.apply(t,arguments),t},module.exports=t;
},{}],"xcMm":[function(require,module,exports) {
module.exports=function(){throw new Error("Not implemented.")};
},{}],"gz0j":[function(require,module,exports) {
module.exports={Class:require("./Class"),abstractMethod:require("./abstractMethod")};
},{"./Class":"zkD4","./abstractMethod":"xcMm"}],"t4ks":[function(require,module,exports) {
require("capability/es5"),module.exports=require("./lib");
},{"capability/es5":"CRcc","./lib":"gz0j"}],"WKnD":[function(require,module,exports) {
var n=function(n){var t,u=!1;return n instanceof Function||(u=!0,t=n,n=null),function(){return u||(u=!0,t=n.apply(this,arguments),n=null),t}};module.exports=n;
},{}],"ibY7":[function(require,module,exports) {
module.exports=function l(e,n,t){if(t||(t=[]),t.length<e.length){var g=e[t.length];for(var h in g)t[t.length]=g[h],l(e,n,t),--t.length}else n.apply(null,t)};
},{}],"xkDE":[function(require,module,exports) {
module.exports={cache:require("./cache"),eachCombination:require("./eachCombination")};
},{"./cache":"WKnD","./eachCombination":"ibY7"}],"XxDs":[function(require,module,exports) {
module.exports=require("./lib");
},{"./lib":"xkDE"}],"W16w":[function(require,module,exports) {
var r=require("o3").Class,t=require("o3").abstractMethod,e=require("u3").eachCombination,a=require("u3").cache,n=require("capability"),i=r(Object,{prototype:{captureFrameStrings:function(r){var t=this.createError();r.unshift(this.captureFrameStrings),r.unshift(this.createError);var e=this.getFrameStrings(t).slice(r.length),a=[];if(n("arguments.callee.caller")){var i=[this.createError,this.captureFrameStrings];try{for(var o=arguments.callee;o=o.caller;)i.push(o)}catch(c){}a=i.slice(r.length)}return{frameStrings:e,functionValues:a}},getFrameStrings:function(r){var t=r.message||"",e=r.name||"",a=this.getStackString(r);if(void 0!==a){var n=a.split("\n"),i=0,o=n.length;return this.hasHeader&&(i+=e.split("\n").length+t.split("\n").length-1),this.hasFooter&&(o-=1),n.slice(i,o)}},createError:t,getStackString:t,hasHeader:void 0,hasFooter:void 0}}),o=r(Object,{prototype:{calibrateClass:function(r){return this.calibrateMethods(r)&&this.calibrateEnvelope(r)},calibrateMethods:function(t){try{e([[function(r){return new Error(r)},function(r){try{throw new Error(r)}catch(t){return t}}],[function(r){return r.stack},function(r){return r.stacktrace}]],function(r,t){if(t(r()))throw{getStackString:t,createError:r}})}catch(a){return r.merge.call(t,{prototype:a}),!0}return!1},calibrateEnvelope:function(t){var e=(0,t.prototype.getStackString)((0,t.prototype.createError)("marker")).split("\n");return r.merge.call(t,{prototype:{hasHeader:/marker/.test(e[0]),hasFooter:""===e[e.length-1]}}),!0}}});module.exports={getClass:a(function(){var t;if(t)return t;if(t=r(i,{}),!(new o).calibrateClass(t))throw new Error("Cannot read Error.prototype.stack in this environment.");return t}),getInstance:a(function(){return new(this.getClass())})};
},{"o3":"t4ks","u3":"XxDs","capability":"zG2T"}],"YeDd":[function(require,module,exports) {
var e=require("o3").Class,t=require("o3").abstractMethod,i=e(Object,{prototype:{init:e.prototype.merge,frameString:void 0,toString:function(){return this.frameString},functionValue:void 0,getThis:t,getTypeName:t,getFunction:function(){return this.functionValue},getFunctionName:t,getMethodName:t,getFileName:t,getLineNumber:t,getColumnNumber:t,getEvalOrigin:t,isTopLevel:t,isEval:t,isNative:t,isConstructor:t}});module.exports=i;
},{"o3":"t4ks"}],"rp3G":[function(require,module,exports) {
var e=require("o3").Class,r=require("./Frame"),t=require("u3").cache,n=e(Object,{prototype:{stackParser:null,frameParser:null,locationParsers:null,constructor:function(r){e.prototype.merge.call(this,r)},getFrames:function(e,r){for(var t=[],n=0,a=e.length;n<a;++n)t[n]=this.getFrame(e[n],r[n]);return t},getFrame:function(e,t){return new r({frameString:e,functionValue:t})}}});module.exports={getClass:t(function(){return n}),getInstance:t(function(){return new(this.getClass())})};
},{"o3":"t4ks","./Frame":"YeDd","u3":"XxDs"}],"EiXi":[function(require,module,exports) {
var e=require("./FrameStringSource"),r=require("./FrameStringParser"),a=require("u3").cache,t=require("../prepareStackTrace");module.exports=function(){return Error.captureStackTrace=function c(n,i){var u=[c];i&&u.push(i);var o=e.getInstance().captureFrameStrings(u);Object.defineProperties(n,{stack:{configurable:!0,get:a(function(){var e=r.getInstance().getFrames(o.frameStrings,o.functionValues);return(Error.prepareStackTrace||t)(n,e,void 0)})},cachedStack:{configurable:!0,writable:!0,enumerable:!1,value:!0}})},Error.getStackTrace=function(a){if(a.cachedStack)return a.stack;var c,n=e.getInstance().getFrameStrings(a),i=[];n?i=r.getInstance().getFrames(n,[]):c=["The stack is not readable by unthrown errors in this environment."];var u=(Error.prepareStackTrace||t)(a,i,c);if(n)try{Object.defineProperties(a,{stack:{configurable:!0,writable:!0,enumerable:!1,value:u},cachedStack:{configurable:!0,writable:!0,enumerable:!1,value:!0}})}catch(o){}return u},{prepareStackTrace:t}};
},{"./FrameStringSource":"W16w","./FrameStringParser":"rp3G","u3":"XxDs","../prepareStackTrace":"jWFZ"}],"jI7H":[function(require,module,exports) {
var e=require("u3").cache,r=require("./prepareStackTrace");module.exports=function(){return Error.captureStackTrace=function(a,c){Object.defineProperties(a,{stack:{configurable:!0,get:e(function(){return(Error.prepareStackTrace||r)(a,[])})},cachedStack:{configurable:!0,writable:!0,enumerable:!1,value:!0}})},Error.getStackTrace=function(e){if(e.cachedStack)return e.stack;var a=(Error.prepareStackTrace||r)(e,[]);try{Object.defineProperties(e,{stack:{configurable:!0,writable:!0,enumerable:!1,value:a},cachedStack:{configurable:!0,writable:!0,enumerable:!1,value:!0}})}catch(c){}return a},{prepareStackTrace:r}};
},{"u3":"XxDs","./prepareStackTrace":"jWFZ"}],"C6f3":[function(require,module,exports) {
require("capability/es5");var r,e=require("capability");r=e("Error.captureStackTrace")?require("./v8"):e("Error.prototype.stack")?require("./non-v8/index"):require("./unsupported"),module.exports=r();
},{"capability/es5":"CRcc","capability":"zG2T","./v8":"bXqZ","./non-v8/index":"EiXi","./unsupported":"jI7H"}],"C0cm":[function(require,module,exports) {
module.exports=require("./lib");
},{"./lib":"C6f3"}],"mXyb":[function(require,module,exports) {
"use strict";var e=this&&this.__createBinding||(Object.create?function(e,r,t,i){void 0===i&&(i=t),Object.defineProperty(e,i,{enumerable:!0,get:function(){return r[t]}})}:function(e,r,t,i){void 0===i&&(i=t),e[i]=r[t]}),r=this&&this.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),t=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var i={};if(null!=t)for(var n in t)"default"!==n&&Object.hasOwnProperty.call(t,n)&&e(i,t,n);return r(i,t),i},i=this&&this.__exportStar||function(r,t){for(var i in r)"default"===i||t.hasOwnProperty(i)||e(t,r,i)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.keyStores=t(require("./key_stores/browser-index")),i(require("./common-index"),exports),i(require("./browser-connect"),exports),require("error-polyfill");
},{"./key_stores/browser-index":"TLlZ","./common-index":"gdw7","./browser-connect":"eFRj","error-polyfill":"C0cm"}],"itQ5":[function(require,module,exports) {
var e="nft1.daothang.testnet";function t(t){switch(t){case"production":case"mainnet":return{networkId:"mainnet",nodeUrl:"https://rpc.mainnet.near.org",contractName:e,walletUrl:"https://wallet.near.org",helperUrl:"https://helper.mainnet.near.org",explorerUrl:"https://explorer.mainnet.near.org"};case"development":case"testnet":return{networkId:"testnet",nodeUrl:"https://rpc.testnet.near.org",contractName:e,walletUrl:"https://wallet.testnet.near.org",helperUrl:"https://helper.testnet.near.org",explorerUrl:"https://explorer.testnet.near.org"};case"betanet":return{networkId:"betanet",nodeUrl:"https://rpc.betanet.near.org",contractName:e,walletUrl:"https://wallet.betanet.near.org",helperUrl:"https://helper.betanet.near.org",explorerUrl:"https://explorer.betanet.near.org"};case"local":return{networkId:"local",nodeUrl:"http://localhost:3030",keyPath:"".concat("C:\\Users\\DELL","/.near/validator_key.json"),walletUrl:"http://localhost:4000/wallet",contractName:e};case"test":case"ci":return{networkId:"shared-test",nodeUrl:"https://rpc.ci-testnet.near.org",contractName:e,masterAccount:"test.near"};case"ci-betanet":return{networkId:"shared-test-staging",nodeUrl:"https://rpc.ci-betanet.near.org",contractName:e,masterAccount:"test.near"};default:throw Error("Unconfigured environment '".concat(t,"'. Can be configured in src/config.js."))}}module.exports=t;
},{}],"FOZT":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.initContract=a,exports.isAccountExist=w,exports.login=l,exports.logout=s;var n=require("near-api-js"),e=t(require("./config"));function t(n){return n&&n.__esModule?n:{default:n}}function r(n,e,t,r,o,c,i){try{var a=n[c](i),u=a.value}catch(s){return void t(s)}a.done?e(u):Promise.resolve(u).then(r,o)}function o(n){return function(){var e=this,t=arguments;return new Promise(function(o,c){var i=n.apply(e,t);function a(n){r(i,o,c,a,u,"next",n)}function u(n){r(i,o,c,a,u,"throw",n)}a(void 0)})}}var c=(0,e.default)("development"),i=null;function a(){return u.apply(this,arguments)}function u(){return(u=o(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,n.connect)(Object.assign({deps:{keyStore:new n.keyStores.BrowserLocalStorageKeyStore}},c));case 2:return i=e.sent,window.walletConnection=new n.WalletConnection(i),window.accountId=window.walletConnection.getAccountId(),e.next=7,new n.Contract(window.walletConnection.account(),c.contractName,{viewMethods:["nft_tokens_for_owner"],changeMethods:["nft_transfer","nft_mint"]});case 7:window.contract=e.sent;case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}function s(){window.walletConnection.signOut(),window.location.replace(window.location.origin+window.location.pathname)}function l(){window.walletConnection.requestSignIn(c.contractName)}function w(n){return p.apply(this,arguments)}function p(){return(p=o(regeneratorRuntime.mark(function n(e){var t;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return t=!1,n.prev=1,n.next=4,i.connection.provider.query("account/".concat(e),"");case 4:t=!0,n.next=10;break;case 7:n.prev=7,n.t0=n.catch(1),console.error(n.t0);case 10:return n.abrupt("return",t);case 11:case"end":return n.stop()}},n,null,[[1,7]])}))).apply(this,arguments)}
},{"near-api-js":"mXyb","./config":"itQ5"}],"Focm":[function(require,module,exports) {
"use strict";require("regenerator-runtime/runtime");var e=require("./utils"),t=n(require("./config"));function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t,n,r,o,c,i){try{var a=e[c](i),s=a.value}catch(d){return void n(d)}a.done?t(s):Promise.resolve(s).then(r,o)}function o(e){return function(){var t=this,n=arguments;return new Promise(function(o,c){var i=e.apply(t,n);function a(e){r(i,o,c,a,s,"next",e)}function s(e){r(i,o,c,a,s,"throw",e)}a(void 0)})}}var c=(0,t.default)("production"),i=c.networkId,a=[];function s(e){var t=document.querySelector("#nft-body-".concat(e));"none"==t.style.display?t.style.display="block":t.style.display="none"}function d(e){var t=document.querySelector("#nft-transfer-".concat(e));"none"==t.style.display?t.style.display="block":t.style.display="none"}function u(e){return l.apply(this,arguments)}function l(){return(l=o(regeneratorRuntime.mark(function t(n){var r,o;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,r=document.querySelector("#transfer-memo-".concat(n)).value,o=document.querySelector("#transfer-reciever-".concat(n)).value,t.next=5,(0,e.isAccountExist)(o);case 5:if(t.sent){t.next=8;break}return alert("The reciever '".concat(o,"' is not existed. Please enter the other reciever!")),t.abrupt("return");case 8:return t.next=10,window.contract.nft_transfer({token_id:""+n,receiver_id:o,memo:r},(60*Math.pow(10,12)).toFixed(),1);case 10:t.sent,console.log("resp"),t.next=18;break;case 14:t.prev=14,t.t0=t.catch(0),console.error("Send NFT error",t.t0),alert("Unable to send NFT!!!");case 18:case"end":return t.stop()}},t,null,[[0,14]])}))).apply(this,arguments)}function f(){return p.apply(this,arguments)}function p(){return(p=o(regeneratorRuntime.mark(function t(){var n,r,o,c,i,a;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,n=document.querySelector("#mint-nft-token-id").value,r=document.querySelector("#mint-nft-receiver").value,o=document.querySelector("#mint-nft-title").value,c=document.querySelector("#mint-nft-media").value,i=document.querySelector("#mint-nft-copy").value,a=document.querySelector("#mint-nft-description").value,t.next=9,(0,e.isAccountExist)(r);case 9:if(t.sent){t.next=12;break}return alert("The reciever '".concat(r,"' is not existed. Please enter the other reciever!")),t.abrupt("return");case 12:return t.next=14,window.contract.nft_mint({token_id:n,receiver_id:r,token_metadata:{title:o,description:a,media:c,copies:Number(i)}},(60*Math.pow(10,12)).toFixed(),"10000000000000000000000");case 14:console.log("resp"),t.next=21;break;case 17:t.prev=17,t.t0=t.catch(0),console.error("Send NFT error",t.t0),alert("Unable to send NFT!!!");case 21:case"end":return t.stop()}},t,null,[[0,17]])}))).apply(this,arguments)}function m(e){var t=document.querySelector("#btn-transfer-".concat(e));document.querySelector("#transfer-reciever-".concat(e)).oninput=function(e){""!==e.target.value?t.disabled=!1:t.disabled=!0}}function v(){for(var e=0;e<a.length;e++){m(a[e].token_id)}}function y(){return h.apply(this,arguments)}function h(){return(h=o(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.contract.nft_tokens_for_owner({account_id:window.accountId});case 2:t=e.sent,console.log("NFT Balances",t),t&&(a=t);case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}function w(e){return b.apply(this,arguments)}function b(){return(b=o(regeneratorRuntime.mark(function e(t){var n,r,o,c;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=3;break}return e.next=3,y();case 3:for(document.querySelector("#nftAssetNum").innerHTML="(".concat(a.length,")"),n="",r=0;r<a.length;r++)o=a[r],c="<div class='nftContainer'>",c+='<div class="nftHeader" style="font-weight:bold; cursor:pointer">',c+="<span>#".concat(o.token_id," - ").concat(o.metadata.title," (").concat(o.metadata.copies,")</span>"),c+='<span><div id="btn-info-'.concat(o.token_id,'" class="infoButton" onclick="showHideNftBody(\'').concat(o.token_id,"')\"></div></span>"),c+='<span><div id="btn-transfer-show-hide-'.concat(o.token_id,'" class="transferButton" onclick="showHideTranferForm(\'').concat(o.token_id,"')\"></div></span>"),c+="</div>",c+='<div id="nft-body-'.concat(o.token_id,'" class="nftBody" style="display:none">'),c+='<div class="seperator"></div>',c+='<div style="text-align:center"><img style="width: 80%" src="'.concat(o.metadata.media,'" /></div>'),c+='<div style="font-size:smaller">'.concat(o.metadata.description,"</div>"),c+="</div>",c+='<div id="nft-transfer-'.concat(o.token_id,'" class="nftBody" style="display:none">'),c+='<div class="seperator"></div>',c+="<form>",c+='<fieldset id="fieldset">',c+="<label>Memo:</label>",c+='<div style="display: flex"><input style="flex: 1" autocomplete="off" id="transfer-memo-'.concat(o.token_id,'" data-behavior="memo" /><div>'),c+="</fieldset>",c+='<fieldset id="fieldset">',c+="<label>Receiver account:</label>",c+='<div style="display: flex"><input style="flex: 1" autocomplete="off" id="transfer-reciever-'.concat(o.token_id,'" data-behavior="reciever" /><button id="btn-transfer-').concat(o.token_id,'" type="button" disabled style="border-radius: 0 5px 5px 0" onclick="sendNFT(').concat(o.token_id,')">Send</button></div>'),c+="</fieldset>",c+="</form>",c+="</div>",n+=c+="</div>";document.querySelector("#nftAssetList").innerHTML=n,v();case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}function k(){"daothang.testnet"==window.accountId?document.querySelector("#mintForm").style.display="block":document.querySelector("#mintMessage").style.display="block"}function x(){document.querySelector("#signed-out-flow").style.display="block"}function g(){document.querySelector("#signed-in-flow").style.display="block",document.querySelectorAll("[data-behavior=account-id]").forEach(function(e){e.innerText=window.accountId});var e=document.querySelector("[data-behavior=notification] a:nth-of-type(1)");e.href=e.href+window.accountId,e.innerText="@"+window.accountId;var t=document.querySelector("[data-behavior=notification] a:nth-of-type(2)");t.href=t.href+window.contract.contractId,t.innerText="@"+window.contract.contractId,e.href=e.href.replace("testnet",i),t.href=t.href.replace("testnet",i),w(!0),k()}window.showHideNftBody=s,window.showHideTranferForm=d,window.sendNFT=u,document.querySelector("#mintForm").onsubmit=function(){var e=o(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),(n=document.querySelector("#btnMintNFT")).disabled=!0,e.next=5,f();case 5:n.disabled=!1;case 6:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),document.querySelector("#sign-in-button").onclick=e.login,document.querySelector("#sign-out-button").onclick=e.logout,window.nearInitPromise=(0,e.initContract)().then(function(){window.walletConnection.isSignedIn()?g():x()}).catch(console.error);
},{"regenerator-runtime/runtime":"QVnC","./utils":"FOZT","./config":"itQ5"}]},{},["Focm"], null)
//# sourceMappingURL=src.395090bd.js.map