-
Notifications
You must be signed in to change notification settings - Fork 0
/
bundle.js
18 lines (15 loc) · 440 KB
/
bundle.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
!function(){"use strict";function t(){}function e(t,e){for(const r in e)t[r]=e[r];return t}function r(t){return t()}function n(){return Object.create(null)}function i(t){t.forEach(r)}function o(t){return"function"==typeof t}function s(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function a(t,e,r){t.$$.on_destroy.push(function(t,e){const r=t.subscribe(e);return r.unsubscribe?()=>r.unsubscribe():r}(e,r))}function u(t,e,r=e){return t.set(r),e}function h(t,e){t.appendChild(e)}function l(t,e,r){t.insertBefore(e,r||null)}function c(t){t.parentNode.removeChild(t)}function f(t){return document.createElement(t)}function d(t){return document.createTextNode(t)}function p(){return d(" ")}function m(){return d("")}function g(t,e,r,n){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r,n)}function v(t,e,r){null==r?t.removeAttribute(e):t.setAttribute(e,r)}function y(t,e){e=""+e,t.data!==e&&(t.data=e)}function b(t,e){(null!=e||t.value)&&(t.value=e)}class w{constructor(t,e=null){this.e=f("div"),this.a=e,this.u(t)}m(t,e=null){for(let r=0;r<this.n.length;r+=1)l(t,this.n[r],e);this.t=t}u(t){this.e.innerHTML=t,this.n=Array.from(this.e.childNodes)}p(t){this.d(),this.u(t),this.m(this.t,this.a)}d(){this.n.forEach(c)}}let _;function M(t){_=t}function k(){if(!_)throw new Error("Function called outside component initialization");return _}const x=[],A=[],S=[],E=[],N=Promise.resolve();let P=!1;function T(t){S.push(t)}function I(){const t=new Set;do{for(;x.length;){const t=x.shift();M(t),R(t.$$)}for(;A.length;)A.pop()();for(let e=0;e<S.length;e+=1){const r=S[e];t.has(r)||(r(),t.add(r))}S.length=0}while(x.length);for(;E.length;)E.pop()();P=!1}function R(t){t.fragment&&(t.update(t.dirty),i(t.before_update),t.fragment.p(t.dirty,t.ctx),t.dirty=null,t.after_update.forEach(T))}const C=new Set;let O;function B(){O={r:0,c:[],p:O}}function D(){O.r||i(O.c),O=O.p}function L(t,e){t&&t.i&&(C.delete(t),t.i(e))}function U(t,e,r,n){if(t&&t.o){if(C.has(t))return;C.add(t),O.c.push(()=>{C.delete(t),n&&(r&&t.d(1),n())}),t.o(e)}}function F(t,e,n){const{fragment:s,on_mount:a,on_destroy:u,after_update:h}=t.$$;s.m(e,n),T(()=>{const e=a.map(r).filter(o);u?u.push(...e):i(e),t.$$.on_mount=[]}),h.forEach(T)}function z(t,e){t.$$.fragment&&(i(t.$$.on_destroy),t.$$.fragment.d(e),t.$$.on_destroy=t.$$.fragment=null,t.$$.ctx={})}function j(t,e){t.$$.dirty||(x.push(t),P||(P=!0,N.then(I)),t.$$.dirty=n()),t.$$.dirty[e]=!0}function H(e,r,o,s,a,u){const h=_;M(e);const l=r.props||{},c=e.$$={fragment:null,ctx:null,props:u,update:t,not_equal:a,bound:n(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(h?h.$$.context:[]),callbacks:n(),dirty:null};let f=!1;c.ctx=o?o(e,l,(t,r,n=r)=>(c.ctx&&a(c.ctx[t],c.ctx[t]=n)&&(c.bound[t]&&c.bound[t](n),f&&j(e,t)),r)):l,c.update(),f=!0,i(c.before_update),c.fragment=s(c.ctx),r.target&&(r.hydrate?c.fragment.l(function(t){return Array.from(t.childNodes)}(r.target)):c.fragment.c(),r.intro&&L(e.$$.fragment),F(e,r.target,r.anchor),I()),M(h)}class ${$destroy(){z(this,1),this.$destroy=t}$on(t,e){const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(e),()=>{const t=r.indexOf(e);-1!==t&&r.splice(t,1)}}$set(){}}const G=[];function q(t,e){return{subscribe:K(t,e).subscribe}}function K(e,r=t){let n;const i=[];function o(t){if(s(e,t)&&(e=t,n)){const t=!G.length;for(let t=0;t<i.length;t+=1){const r=i[t];r[1](),G.push(r,e)}if(t){for(let t=0;t<G.length;t+=2)G[t][0](G[t+1]);G.length=0}}}return{set:o,update:function(t){o(t(e))},subscribe:function(s,a=t){const u=[s,a];return i.push(u),1===i.length&&(n=r(o)||t),s(e),()=>{const t=i.indexOf(u);-1!==t&&i.splice(t,1),0===i.length&&(n(),n=null)}}}}function V(e,r,n){const s=!Array.isArray(e),a=s?[e]:e,u=r.length<2;return q(n,e=>{let n=!1;const h=[];let l=0,c=t;const f=()=>{if(l)return;c();const n=r(s?h[0]:h,e);u?e(n):c=o(n)?n:t},d=a.map((t,e)=>t.subscribe(t=>{h[e]=t,l&=~(1<<e),n&&f()},()=>{l|=1<<e}));return n=!0,f(),function(){i(d),c()}})}function W(t){var e,r,n=t.component;function i(t){return{props:{params:t.componentParams}}}if(n)var o=new n(i(t));return{c(){o&&o.$$.fragment.c(),e=m()},m(t,n){o&&F(o,t,n),l(t,e,n),r=!0},p(t,r){var s={};if(t.componentParams&&(s.params=r.componentParams),n!==(n=r.component)){if(o){B();const t=o;U(t.$$.fragment,1,0,()=>{z(t,1)}),D()}n?((o=new n(i(r))).$$.fragment.c(),L(o.$$.fragment,1),F(o,e.parentNode,e)):o=null}else n&&o.$set(s)},i(t){r||(o&&L(o.$$.fragment,t),r=!0)},o(t){o&&U(o.$$.fragment,t),r=!1},d(t){t&&c(e),o&&z(o,t)}}}function Z(){const t=window.location.href.indexOf("#/");let e=t>-1?window.location.href.substr(t+1):"/";const r=e.indexOf("?");let n="";return r>-1&&(n=e.substr(r+1),e=e.substr(0,r)),{location:e,querystring:n}}const J=q(Z(),(function(t){const e=()=>{t(Z())};return window.addEventListener("hashchange",e,!1),function(){window.removeEventListener("hashchange",e,!1)}}));V(J,t=>t.location),V(J,t=>t.querystring);function X(t,e,r){let n;a(t,J,t=>{n=t,r("$loc",n)});let{routes:i={}}=e;class o{constructor(t,e){if(!t||"string"==typeof t&&(t.length<1||"/"!=t.charAt(0)&&"*"!=t.charAt(0))||"object"==typeof t&&!(t instanceof RegExp))throw Error('Invalid value for "path" argument');const{pattern:r,keys:n}=function(t,e){if(t instanceof RegExp)return{keys:!1,pattern:t};var r,n,i,o,s=[],a="",u=t.split("/");for(u[0]||u.shift();i=u.shift();)"*"===(r=i[0])?(s.push("wild"),a+="/(.*)"):":"===r?(n=i.indexOf("?",1),o=i.indexOf(".",1),s.push(i.substring(1,~n?n:~o?o:i.length)),a+=~n&&!~o?"(?:/([^/]+?))?":"/([^/]+?)",~o&&(a+=(~n?"?":"")+"\\"+i.substring(o))):a+="/"+i;return{keys:s,pattern:new RegExp("^"+a+(e?"(?=$|/)":"/?$"),"i")}}(t);this.path=t,this.component=e,this._pattern=r,this._keys=n}match(t){const e=this._pattern.exec(t);if(null===e)return null;if(!1===this._keys)return e;const r={};let n=0;for(;n<this._keys.length;)r[this._keys[n]]=e[++n]||null;return r}}const s=i instanceof Map?i:Object.entries(i),u=[];for(const[t,e]of s)u.push(new o(t,e));let h=null,l={};return t.$set=t=>{"routes"in t&&r("routes",i=t.routes)},t.$$.update=(t={component:1,$loc:1})=>{if(t.component||t.$loc){r("component",h=null);let t=0;for(;!h&&t<u.length;){const e=u[t].match(n.location);e&&(r("component",h=u[t].component),r("componentParams",l=e)),t++}}},{routes:i,component:h,componentParams:l}}class Q extends ${constructor(t){super(),H(this,t,X,W,s,["routes"])}}var Y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function tt(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function et(t,e){return t(e={exports:{}},e.exports),e.exports}var rt,nt=et((function(t,e){t.exports=function t(e,r,n){function i(s,a){if(!r[s]){if(!e[s]){if(!a&&tt)return tt();if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var h=r[s]={exports:{}};e[s][0].call(h.exports,(function(t){return i(e[s][1][t]||t)}),h,h.exports,t,e,r,n)}return r[s].exports}for(var o=tt,s=0;s<n.length;s++)i(n[s]);return i}({1:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.version="4.0.38"},{}],2:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0});var n=t("./utils/properties"),i=(o.isSigner=function(t){return n.isType(t,"Signer")},o);function o(){n.setType(this,"Signer")}r.Signer=i},{"./utils/properties":73}],3:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0});var n=t("./utils/bignumber");r.AddressZero="0x0000000000000000000000000000000000000000",r.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",r.EtherSymbol="Ξ";var i=n.bigNumberify(-1);r.NegativeOne=i;var o=n.bigNumberify(0);r.Zero=o;var s=n.bigNumberify(1);r.One=s;var a=n.bigNumberify(2);r.Two=a;var u=n.bigNumberify("1000000000000000000");r.WeiPerEther=u;var h=n.bigNumberify("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");r.MaxUint256=h},{"./utils/bignumber":62}],4:[function(t,e,r){var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var s,a=t("./constants"),u=o(t("./errors")),h=t("./utils/abi-coder"),l=t("./utils/address"),c=t("./utils/bignumber"),f=t("./utils/bytes"),d=t("./utils/interface"),p=t("./utils/properties"),m=t("./providers/abstract-provider"),g=t("./abstract-signer"),v=(i(y,s=g.Signer),y.prototype.getAddress=function(){return Promise.resolve(this.address)},y.prototype._fail=function(t,e){return Promise.resolve().then((function(){u.throwError(t,u.UNSUPPORTED_OPERATION,{operation:e})}))},y.prototype.signMessage=function(t){return this._fail("VoidSigner cannot sign messages","signMessage")},y.prototype.sendTransaction=function(t){return this._fail("VoidSigner cannot sign transactions","sendTransaction")},y.prototype.connect=function(t){return new y(this.address,t)},y);function y(t,e){var r=s.call(this)||this;return p.defineReadOnly(r,"address",t),p.defineReadOnly(r,"provider",e),r}r.VoidSigner=v;var b={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0};function w(t,e,r){var n=t.interface.functions[e];return function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var o={},s=null;if(e.length===n.inputs.length+1&&"object"==typeof e[e.length-1])for(var l in null!=(o=p.shallowCopy(e.pop())).blockTag&&(s=o.blockTag),delete o.blockTag,o)if(!b[l])throw new Error("unknown transaction override "+l);if(e.length!=n.inputs.length)throw new Error("incorrect number of arguments");return["data","to"].forEach((function(t){null!=o[t]&&u.throwError("cannot override "+t,u.UNSUPPORTED_OPERATION,{operation:t})})),o.to=t._deployed(s).then((function(){return t.addressPromise})),function t(e,r,n){if(Array.isArray(n)){var i=[];return n.forEach((function(n,o){var s;s=Array.isArray(r)?r[o]:r[n.name],i.push(t(e,s,n))})),Promise.all(i)}if("address"===n.type)return e.resolveName(r);if("tuple"===n.type)return t(e,r,n.components);var o=n.type.match(/(.*)(\[[0-9]*\]$)/);if(o){if(!Array.isArray(r))throw new Error("invalid value for array");var s=[],a={components:n.components,type:o[1]};return r.forEach((function(r){s.push(t(e,r,a))})),Promise.all(s)}return Promise.resolve(r)}(t.provider,e,n.inputs).then((function(e){if(o.data=n.encode(e),"call"===n.type)return r?Promise.resolve(a.Zero):(t.provider||u.throwError("call (constant functions) require a provider or a signer with a provider",u.UNSUPPORTED_OPERATION,{operation:"call"}),["gasLimit","gasPrice","value"].forEach((function(t){if(null!=o[t])throw new Error("call cannot override "+t)})),null==o.from&&t.signer&&(o.from=t.signer.getAddress()),t.provider.call(o,s).then((function(r){if(f.hexDataLength(r)%32==4&&"0x08c379a0"===f.hexDataSlice(r,0,4)){var i=h.defaultAbiCoder.decode(["string"],f.hexDataSlice(r,4));u.throwError("call revert exception",u.CALL_EXCEPTION,{address:t.address,args:e,method:n.signature,errorSignature:"Error(string)",errorArgs:[i],reason:i,transaction:o})}try{var s=n.decode(r);return 1===n.outputs.length&&(s=s[0]),s}catch(i){throw"0x"===r&&0<n.outputs.length&&u.throwError("call exception",u.CALL_EXCEPTION,{address:t.address,method:n.signature,args:e}),i}})));if("transaction"===n.type)return r?(t.provider||u.throwError("estimate gas require a provider or a signer with a provider",u.UNSUPPORTED_OPERATION,{operation:"estimateGas"}),null==o.from&&t.signer&&(o.from=t.signer.getAddress()),t.provider.estimateGas(o)):(null==o.gasLimit&&null!=n.gas&&(o.gasLimit=c.bigNumberify(n.gas).add(21e3)),t.signer||u.throwError("sending a transaction requires a signer",u.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=o.from&&u.throwError("cannot override from in a transaction",u.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),t.signer.sendTransaction(o).then((function(e){var r=e.wait.bind(e);return e.wait=function(e){return r(e).then((function(e){return e.events=e.logs.map((function(r){var n=p.deepCopy(r),i=t.interface.parseLog(r);return i&&(n.args=i.values,n.decode=i.decode,n.event=i.name,n.eventSignature=i.signature),n.removeListener=function(){return t.provider},n.getBlock=function(){return t.provider.getBlock(e.blockHash)},n.getTransaction=function(){return t.provider.getTransaction(e.transactionHash)},n.getTransactionReceipt=function(){return Promise.resolve(e)},n})),e}))},e})));throw new Error("invalid type - "+n.type)}))}}function _(t){return!t.address||null!=t.topics&&0!==t.topics.length?(t.address||"*")+"@"+(t.topics?t.topics.join(":"):""):"*"}var M=(k.prototype.deployed=function(){return this._deployed()},k.prototype._deployed=function(t){var e=this;return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((function(){return e})):this._deployedPromise=this.provider.getCode(this.address,t).then((function(t){return"0x"===t&&u.throwError("contract not deployed",u.UNSUPPORTED_OPERATION,{contractAddress:e.address,operation:"getDeployed"}),e}))),this._deployedPromise},k.prototype.fallback=function(t){var e=this;this.signer||u.throwError("sending a transaction requires a signer",u.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});var r=p.shallowCopy(t||{});return["from","to"].forEach((function(t){null!=r[t]&&u.throwError("cannot override "+t,u.UNSUPPORTED_OPERATION,{operation:t})})),r.to=this.addressPromise,this.deployed().then((function(){return e.signer.sendTransaction(r)}))},k.prototype.connect=function(t){"string"==typeof t&&(t=new v(t,this.provider));var e=new k(this.address,this.interface,t);return this.deployTransaction&&p.defineReadOnly(e,"deployTransaction",this.deployTransaction),e},k.prototype.attach=function(t){return new k(t,this.interface,this.signer||this.provider)},k.isIndexed=function(t){return d.Interface.isIndexed(t)},k.prototype._getEventFilter=function(t){var e=this;if("string"==typeof t){if("*"===t)return{prepareEvent:function(t){var r=e.interface.parseLog(t);return r&&(t.args=r.values,t.decode=r.decode,t.event=r.name,t.eventSignature=r.signature),[t]},eventTag:"*",filter:{address:this.address}};-1!==t.indexOf("(")&&(t=h.formatSignature(h.parseSignature("event "+t)));var r=this.interface.events[t];r||u.throwError("unknown event - "+t,u.INVALID_ARGUMENT,{argumnet:"eventName",value:t});var n={address:this.address,topics:[r.topic]};return{prepareEvent:function(t){var e=r.decode(t.data,t.topics);t.args=e;var n=Array.prototype.slice.call(e);return n.push(t),n},event:r,eventTag:_(n),filter:n}}var i={address:this.address},o=null;if(t.topics&&t.topics[0])for(var s in i.topics=t.topics,this.interface.events)if(-1!==s.indexOf("(")){var a=this.interface.events[s];if(a.topic===t.topics[0].toLowerCase()){o=a;break}}return{prepareEvent:function(t){if(!o)return[t];var e=o.decode(t.data,t.topics);t.args=e;var r=Array.prototype.slice.call(e);return r.push(t),r},event:o,eventTag:_(i),filter:i}},k.prototype._addEventListener=function(t,e,r){var n=this;function i(r){var i=p.deepCopy(r),o=t.prepareEvent(i);t.event&&(i.decode=t.event.decode,i.event=t.event.name,i.eventSignature=t.event.signature),i.removeListener=function(){n.removeListener(t.filter,e)},i.getBlock=function(){return n.provider.getBlock(r.blockHash)},i.getTransaction=function(){return n.provider.getTransaction(r.transactionHash)},i.getTransactionReceipt=function(){return n.provider.getTransactionReceipt(r.transactionHash)},n.emit.apply(n,[t.filter].concat(o))}this.provider||u.throwError("events require a provider or a signer with a provider",u.UNSUPPORTED_OPERATION,{operation:"once"}),this.provider.on(t.filter,i),this._events.push({eventFilter:t,listener:e,wrappedListener:i,once:r})},k.prototype.on=function(t,e){return this._addEventListener(this._getEventFilter(t),e,!1),this},k.prototype.once=function(t,e){return this._addEventListener(this._getEventFilter(t),e,!0),this},k.prototype.addListener=function(t,e){return this.on(t,e)},k.prototype.emit=function(t){for(var e=this,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];if(!this.provider)return!1;var i=!1,o=this._getEventFilter(t);return this._events=this._events.filter((function(t){return t.eventFilter.eventTag!==o.eventTag||(setTimeout((function(){t.listener.apply(e,r)}),0),i=!0,!t.once)})),i},k.prototype.listenerCount=function(t){if(!this.provider)return 0;var e=this._getEventFilter(t);return this._events.filter((function(t){return t.eventFilter.eventTag===e.eventTag})).length},k.prototype.listeners=function(t){if(!this.provider)return[];var e=this._getEventFilter(t);return this._events.filter((function(t){return t.eventFilter.eventTag===e.eventTag})).map((function(t){return t.listener}))},k.prototype.removeAllListeners=function(t){var e=this;if(!this.provider)return this;var r=this._getEventFilter(t);return this._events=this._events.filter((function(t){return t.eventFilter.eventTag!==r.eventTag||(e.provider.removeListener(t.eventFilter.filter,t.wrappedListener),!1)})),this},k.prototype.removeListener=function(t,e){var r=this;if(!this.provider)return this;var n=!1,i=this._getEventFilter(t);return this._events=this._events.filter((function(t){return t.eventFilter.eventTag!==i.eventTag||t.listener!==e||(r.provider.removeListener(t.eventFilter.filter,t.wrappedListener),!!n||!(n=!0))})),this},k);function k(t,e,r){var n=this;if(u.checkNew(this,k),d.Interface.isInterface(e)?p.defineReadOnly(this,"interface",e):p.defineReadOnly(this,"interface",new d.Interface(e)),g.Signer.isSigner(r)?(p.defineReadOnly(this,"provider",r.provider),p.defineReadOnly(this,"signer",r)):m.Provider.isProvider(r)?(p.defineReadOnly(this,"provider",r),p.defineReadOnly(this,"signer",null)):u.throwError("invalid signer or provider",u.INVALID_ARGUMENT,{arg:"signerOrProvider",value:r}),p.defineReadOnly(this,"estimate",{}),p.defineReadOnly(this,"functions",{}),p.defineReadOnly(this,"filters",{}),Object.keys(this.interface.events).forEach((function(t){var e=n.interface.events[t];p.defineReadOnly(n.filters,t,(function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return{address:n.address,topics:e.encodeTopics(t)}}))})),this._events=[],p.defineReadOnly(this,"address",t),this.provider)p.defineReadOnly(this,"addressPromise",this.provider.resolveName(t).then((function(t){if(null==t)throw new Error("name not found");return t})).catch((function(t){throw t})));else try{p.defineReadOnly(this,"addressPromise",Promise.resolve(l.getAddress(t)))}catch(e){u.throwError("provider is required to use non-address contract address",u.INVALID_ARGUMENT,{argument:"addressOrName",value:t})}Object.keys(this.interface.functions).forEach((function(t){var e=w(n,t,!1);null==n[t]?p.defineReadOnly(n,t,e):u.warn("WARNING: Multiple definitions for "+t),null==n.functions[t]&&(p.defineReadOnly(n.functions,t,e),p.defineReadOnly(n.estimate,t,w(n,t,!0)))}))}r.Contract=M;var x=(A.prototype.getDeployTransaction=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r={};if(t.length===this.interface.deployFunction.inputs.length+1)for(var n in r=p.shallowCopy(t.pop()))if(!b[n])throw new Error("unknown transaction override "+n);return["data","from","to"].forEach((function(t){null!=r[t]&&u.throwError("cannot override "+t,u.UNSUPPORTED_OPERATION,{operation:t})})),u.checkArgumentCount(t.length,this.interface.deployFunction.inputs.length," in Contract constructor"),r.data=this.interface.deployFunction.encode(this.bytecode,t),r},A.prototype.deploy=function(){for(var t=this,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=this.getDeployTransaction.apply(this,e);return this.signer.sendTransaction(n).then((function(e){var r=new M(l.getContractAddress(e),t.interface,t.signer);return p.defineReadOnly(r,"deployTransaction",e),r}))},A.prototype.attach=function(t){return new M(t,this.interface,this.signer)},A.prototype.connect=function(t){return new A(this.interface,this.bytecode,t)},A.fromSolidity=function(t,e){null==t&&u.throwError("missing compiler output",u.MISSING_ARGUMENT,{argument:"compilerOutput"}),"string"==typeof t&&(t=JSON.parse(t));var r=t.abi,n=null;return t.bytecode?n=t.bytecode:t.evm&&t.evm.bytecode&&(n=t.evm.bytecode),new A(r,n,e)},A);function A(t,e,r){var n=null;"string"==typeof e?n=e:f.isArrayish(e)?n=f.hexlify(e):"string"==typeof e.object?n=e.object:u.throwError("bytecode must be a valid hex string",u.INVALID_ARGUMENT,{arg:"bytecode",value:e}),"0x"!==n.substring(0,2)&&(n="0x"+n),f.isHexString(n)||u.throwError("bytecode must be a valid hex string",u.INVALID_ARGUMENT,{arg:"bytecode",value:e}),n.length%2!=0&&u.throwError("bytecode must be valid data (even length)",u.INVALID_ARGUMENT,{arg:"bytecode",value:e}),p.defineReadOnly(this,"bytecode",n),d.Interface.isInterface(t)?p.defineReadOnly(this,"interface",t):p.defineReadOnly(this,"interface",new d.Interface(t)),r&&!g.Signer.isSigner(r)&&u.throwError("invalid signer",u.INVALID_ARGUMENT,{arg:"signer",value:null}),p.defineReadOnly(this,"signer",r||null)}r.ContractFactory=x},{"./abstract-signer":2,"./constants":3,"./errors":5,"./providers/abstract-provider":49,"./utils/abi-coder":58,"./utils/address":59,"./utils/bignumber":62,"./utils/bytes":63,"./utils/interface":68,"./utils/properties":73}],5:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0});var n=t("./_version");r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.MISSING_NEW="MISSING_NEW",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.NUMERIC_FAULT="NUMERIC_FAULT",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED";var i=!(r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION"),o=!1;function s(t,e,i){if(o)throw new Error("unknown error");e=e||r.UNKNOWN_ERROR,i=i||{};var s=[];Object.keys(i).forEach((function(t){try{s.push(t+"="+JSON.stringify(i[t]))}catch(e){s.push(t+"="+JSON.stringify(i[t].toString()))}})),s.push("version="+n.version);var a=t;s.length&&(t+=" ("+s.join(", ")+")");var u=new Error(t);throw u.reason=a,u.code=e,Object.keys(i).forEach((function(t){u[t]=i[t]})),u}r.throwError=s,r.checkNew=function(t,e){t instanceof e||s("missing new",r.MISSING_NEW,{name:e.name})},r.checkArgumentCount=function(t,e,n){n=n||"",t<e&&s("missing argument"+n,r.MISSING_ARGUMENT,{count:t,expectedCount:e}),e<t&&s("too many arguments"+n,r.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})},r.setCensorship=function(t,e){i&&s("error censorship permanent",r.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o=!!t,i=!!e},r.checkNormalize=function(){try{if(["NFD","NFC","NFKD","NFKC"].forEach((function(t){try{"test".normalize(t)}catch(e){throw new Error("missing "+t)}})),String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){s("platform missing String.prototype.normalize",r.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:t.message})}};var a={debug:1,default:2,info:2,warn:3,error:4,off:5},u=a.default;function h(t,e){u>a[t]||console.log.apply(console,e)}function l(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];h("warn",t)}r.setLogLevel=function(t){var e=a[t];null!=e?u=e:l("invliad log level - "+t)},r.warn=l,r.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];h("info",t)}},{"./_version":1}],6:[function(t,e,r){var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=t("./contract");r.Contract=i.Contract,r.ContractFactory=i.ContractFactory,r.VoidSigner=i.VoidSigner;var o=t("./abstract-signer");r.Signer=o.Signer;var s=t("./wallet");r.Wallet=s.Wallet;var a=n(t("./constants"));r.constants=a;var u=n(t("./errors"));r.errors=u;var h=n(t("./providers"));r.providers=h;var l=n(t("./utils"));r.utils=l;var c=n(t("./wordlists"));r.wordlists=c;var f=t("./utils/shims");r.platform=f.platform;var d=t("./_version");r.version=d.version,r.getDefaultProvider=function(t){null==t&&(t="homestead");var e=l.getNetwork(t);return e&&e._defaultProvider||u.throwError("unsupported getDefaultProvider network",u.UNSUPPORTED_OPERATION,{operation:"getDefaultProvider",network:t}),e._defaultProvider(h)}},{"./_version":1,"./abstract-signer":2,"./constants":3,"./contract":4,"./errors":5,"./providers":53,"./utils":67,"./utils/shims":79,"./wallet":87,"./wordlists":88}],7:[function(t,e,r){var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=n(t("./ethers"));r.ethers=i,function(t){for(var e in t)r.hasOwnProperty(e)||(r[e]=t[e])}(t("./ethers"))},{"./ethers":6}],8:[function(t,e,r){!function(t){function n(t){return parseInt(t)===t}function i(t){if(!n(t.length))return!1;for(var e=0;e<t.length;e++)if(!n(t[e])||t[e]<0||255<t[e])return!1;return!0}function o(t,e){if(t.buffer&&ArrayBuffer.isView(t)&&"Uint8Array"===t.name)return e&&(t=t.slice?t.slice():Array.prototype.slice.call(t)),t;if(Array.isArray(t)){if(!i(t))throw new Error("Array contains invalid value: "+t);return new Uint8Array(t)}if(n(t.length)&&i(t))return new Uint8Array(t);throw new Error("unsupported array-like object")}function s(t){return new Uint8Array(t)}function a(t,e,r,n,i){null==n&&null==i||(t=t.slice?t.slice(n,i):Array.prototype.slice.call(t,n,i)),e.set(t,r)}var u,h={toBytes:function(t){var e=[],r=0;for(t=encodeURI(t);r<t.length;){var n=t.charCodeAt(r++);37===n?(e.push(parseInt(t.substr(r,2),16)),r+=2):e.push(n)}return o(e)},fromBytes:function(t){for(var e=[],r=0;r<t.length;){var n=t[r];n<128?(e.push(String.fromCharCode(n)),r++):191<n&&n<224?(e.push(String.fromCharCode((31&n)<<6|63&t[r+1])),r+=2):(e.push(String.fromCharCode((15&n)<<12|(63&t[r+1])<<6|63&t[r+2])),r+=3)}return e.join("")}},l=(u="0123456789abcdef",{toBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},fromBytes:function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];e.push(u[(240&n)>>4]+u[15&n])}return e.join("")}}),c={16:10,24:12,32:14},f=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],d=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],p=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],m=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],g=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],v=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],y=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],b=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],w=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],_=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],M=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],k=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],x=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],A=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],S=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function E(t){for(var e=[],r=0;r<t.length;r+=4)e.push(t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3]);return e}var N=function(t){if(!(this instanceof N))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:o(t,!0)}),this._prepare()};N.prototype._prepare=function(){var t=c[this.key.length];if(null==t)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var e=0;e<=t;e++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);var r,n=4*(t+1),i=this.key.length/4,o=E(this.key);for(e=0;e<i;e++)r=e>>2,this._Ke[r][e%4]=o[e],this._Kd[t-r][e%4]=o[e];for(var s,a=0,u=i;u<n;){if(s=o[i-1],o[0]^=d[s>>16&255]<<24^d[s>>8&255]<<16^d[255&s]<<8^d[s>>24&255]^f[a]<<24,a+=1,8!=i)for(e=1;e<i;e++)o[e]^=o[e-1];else{for(e=1;e<i/2;e++)o[e]^=o[e-1];for(s=o[i/2-1],o[i/2]^=d[255&s]^d[s>>8&255]<<8^d[s>>16&255]<<16^d[s>>24&255]<<24,e=i/2+1;e<i;e++)o[e]^=o[e-1]}for(e=0;e<i&&u<n;)h=u>>2,l=u%4,this._Ke[h][l]=o[e],this._Kd[t-h][l]=o[e++],u++}for(var h=1;h<t;h++)for(var l=0;l<4;l++)s=this._Kd[h][l],this._Kd[h][l]=k[s>>24&255]^x[s>>16&255]^A[s>>8&255]^S[255&s]},N.prototype.encrypt=function(t){if(16!=t.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var e=this._Ke.length-1,r=[0,0,0,0],n=E(t),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var o=1;o<e;o++){for(i=0;i<4;i++)r[i]=m[n[i]>>24&255]^g[n[(i+1)%4]>>16&255]^v[n[(i+2)%4]>>8&255]^y[255&n[(i+3)%4]]^this._Ke[o][i];n=r.slice()}var a,u=s(16);for(i=0;i<4;i++)a=this._Ke[e][i],u[4*i]=255&(d[n[i]>>24&255]^a>>24),u[4*i+1]=255&(d[n[(i+1)%4]>>16&255]^a>>16),u[4*i+2]=255&(d[n[(i+2)%4]>>8&255]^a>>8),u[4*i+3]=255&(d[255&n[(i+3)%4]]^a);return u},N.prototype.decrypt=function(t){if(16!=t.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var e=this._Kd.length-1,r=[0,0,0,0],n=E(t),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var o=1;o<e;o++){for(i=0;i<4;i++)r[i]=b[n[i]>>24&255]^w[n[(i+3)%4]>>16&255]^_[n[(i+2)%4]>>8&255]^M[255&n[(i+1)%4]]^this._Kd[o][i];n=r.slice()}var a,u=s(16);for(i=0;i<4;i++)a=this._Kd[e][i],u[4*i]=255&(p[n[i]>>24&255]^a>>24),u[4*i+1]=255&(p[n[(i+3)%4]>>16&255]^a>>16),u[4*i+2]=255&(p[n[(i+2)%4]>>8&255]^a>>8),u[4*i+3]=255&(p[255&n[(i+1)%4]]^a);return u};var P=function(t){if(!(this instanceof P))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new N(t)};P.prototype.encrypt=function(t){if((t=o(t)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var e=s(t.length),r=s(16),n=0;n<t.length;n+=16)a(t,r,0,n,n+16),a(r=this._aes.encrypt(r),e,n);return e},P.prototype.decrypt=function(t){if((t=o(t)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var e=s(t.length),r=s(16),n=0;n<t.length;n+=16)a(t,r,0,n,n+16),a(r=this._aes.decrypt(r),e,n);return e};var T=function(t,e){if(!(this instanceof T))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",e){if(16!=e.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else e=s(16);this._lastCipherblock=o(e,!0),this._aes=new N(t)};T.prototype.encrypt=function(t){if((t=o(t)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var e=s(t.length),r=s(16),n=0;n<t.length;n+=16){a(t,r,0,n,n+16);for(var i=0;i<16;i++)r[i]^=this._lastCipherblock[i];this._lastCipherblock=this._aes.encrypt(r),a(this._lastCipherblock,e,n)}return e},T.prototype.decrypt=function(t){if((t=o(t)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var e=s(t.length),r=s(16),n=0;n<t.length;n+=16){a(t,r,0,n,n+16),r=this._aes.decrypt(r);for(var i=0;i<16;i++)e[n+i]=r[i]^this._lastCipherblock[i];a(t,this._lastCipherblock,0,n,n+16)}return e};var I=function(t,e,r){if(!(this instanceof I))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",e){if(16!=e.length)throw new Error("invalid initialation vector size (must be 16 size)")}else e=s(16);r=r||1,this.segmentSize=r,this._shiftRegister=o(e,!0),this._aes=new N(t)};I.prototype.encrypt=function(t){if(t.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var e,r=o(t,!0),n=0;n<r.length;n+=this.segmentSize){e=this._aes.encrypt(this._shiftRegister);for(var i=0;i<this.segmentSize;i++)r[n+i]^=e[i];a(this._shiftRegister,this._shiftRegister,0,this.segmentSize),a(r,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r},I.prototype.decrypt=function(t){if(t.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var e,r=o(t,!0),n=0;n<r.length;n+=this.segmentSize){e=this._aes.encrypt(this._shiftRegister);for(var i=0;i<this.segmentSize;i++)r[n+i]^=e[i];a(this._shiftRegister,this._shiftRegister,0,this.segmentSize),a(t,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r};var R=function(t,e){if(!(this instanceof R))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",e){if(16!=e.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else e=s(16);this._lastPrecipher=o(e,!0),this._lastPrecipherIndex=16,this._aes=new N(t)};R.prototype.encrypt=function(t){for(var e=o(t,!0),r=0;r<e.length;r++)16===this._lastPrecipherIndex&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),e[r]^=this._lastPrecipher[this._lastPrecipherIndex++];return e},R.prototype.decrypt=R.prototype.encrypt;var C=function(t){if(!(this instanceof C))throw Error("Counter must be instanitated with `new`");0===t||t||(t=1),"number"==typeof t?(this._counter=s(16),this.setValue(t)):this.setBytes(t)};C.prototype.setValue=function(t){if("number"!=typeof t||parseInt(t)!=t)throw new Error("invalid counter value (must be an integer)");for(var e=15;0<=e;--e)this._counter[e]=t%256,t>>=8},C.prototype.setBytes=function(t){if(16!=(t=o(t,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=t},C.prototype.increment=function(){for(var t=15;0<=t;t--){if(255!==this._counter[t]){this._counter[t]++;break}this._counter[t]=0}};var O=function(t,e){if(!(this instanceof O))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",e instanceof C||(e=new C(e)),this._counter=e,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new N(t)};O.prototype.encrypt=function(t){for(var e=o(t,!0),r=0;r<e.length;r++)16===this._remainingCounterIndex&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),e[r]^=this._remainingCounter[this._remainingCounterIndex++];return e},O.prototype.decrypt=O.prototype.encrypt;var B={AES:N,Counter:C,ModeOfOperation:{ecb:P,cbc:T,cfb:I,ofb:R,ctr:O},utils:{hex:l,utf8:h},padding:{pkcs7:{pad:function(t){var e=16-(t=o(t,!0)).length%16,r=s(t.length+e);a(t,r);for(var n=t.length;n<r.length;n++)r[n]=e;return r},strip:function(t){if((t=o(t,!0)).length<16)throw new Error("PKCS#7 invalid length");var e=t[t.length-1];if(16<e)throw new Error("PKCS#7 padding byte out of range");for(var r=t.length-e,n=0;n<e;n++)if(t[r+n]!==e)throw new Error("PKCS#7 invalid padding byte");var i=s(r);return a(t,i,0,0,r),i}}},_arrayTest:{coerceArray:o,createArray:s,copyArray:a}};void 0!==r?e.exports=B:(t.aesjs&&(B._aesjs=t.aesjs),t.aesjs=B)}(this)},{}],9:[function(t,e,r){!function(e,r){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){function r(){}t.super_=e,r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,(this.red=null)!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof e?e.exports=o:r.BN=o,(o.BN=o).wordSize=26;try{s=t("buffer").Buffer}catch(e){}function a(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o<i;o++){var s=t.charCodeAt(o)-48;n<<=4,n|=49<=s&&s<=54?s-49+10:17<=s&&s<=22?s-17+10:15&s}return n}function u(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=49<=a?a-49+10:17<=a?a-17+10:a}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return 0<t.cmp(e)?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&2<=e&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("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 i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;0<=i;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,26<=(a+=24)&&(a-=26,o++);else if("le"===r)for(o=i=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,26<=(a+=24)&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,o=0;for(r=t.length-6,n=0;e<=r;r-=6)i=a(t,r,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303,26<=(o+=24)&&(o-=26,n++);r+6!==e&&(i=a(t,e,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0];for(var n=0,i=this.length=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,h=0,l=r;l<a;l+=n)h=u(t,l,l+n,e),this.imuln(i),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!=s){var c=1;for(h=u(t,l,t.length,e),l=0;l<s;l++)c*=e;this.imuln(c),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;1<this.length&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","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"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;n=(r.length=n)-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<n;h++){for(var l=u>>>26,c=67108863&u,f=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=f;d++){var p=h-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[h]=0|c,u=0|l}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!=(o=a>>>24-i&16777215)||s!==this.length-1?h[6-u.length]+u+r:u+r,26<=(i+=2)&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&2<=t&&t<=36){var f=l[t],d=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:h[f-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:2<this.length&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(0<o,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),l=this.clone();if(u){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-i;a++)h[a]=0;for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),h[o-a-1]=s}return h},o.prototype._countBits=Math.clz32?function(t){return 32-Math.clz32(t)}:function(t){var e=t,r=0;return 4096<=e&&(r+=13,e>>>=13),64<=e&&(r+=7,e>>>=7),8<=e&&(r+=4,e>>>=4),2<=e&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;r=this.length>t.length?(e=this,t):(e=t,this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&0<=t);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),0<r&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return 0<r&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&0<=t);var r=t/26|0,i=t%26;return this._expand(1+r),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();n=this.length>t.length?(r=this,t):(r=t,this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;n=0<i?(r=this,t):(r=t,this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var d=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,h=0,l=0|s[0],c=8191&l,f=l>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],v=8191&g,y=g>>>13,b=0|s[3],w=8191&b,_=b>>>13,M=0|s[4],k=8191&M,x=M>>>13,A=0|s[5],S=8191&A,E=A>>>13,N=0|s[6],P=8191&N,T=N>>>13,I=0|s[7],R=8191&I,C=I>>>13,O=0|s[8],B=8191&O,D=O>>>13,L=0|s[9],U=8191&L,F=L>>>13,z=0|a[0],j=8191&z,H=z>>>13,$=0|a[1],G=8191&$,q=$>>>13,K=0|a[2],V=8191&K,W=K>>>13,Z=0|a[3],J=8191&Z,X=Z>>>13,Q=0|a[4],Y=8191&Q,tt=Q>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,lt=0|a[8],ct=8191<,ft=lt>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(h+(n=Math.imul(c,j))|0)+((8191&(i=(i=Math.imul(c,H))+Math.imul(f,j)|0))<<13)|0;h=((o=Math.imul(f,H))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,j),i=(i=Math.imul(p,H))+Math.imul(m,j)|0,o=Math.imul(m,H);var vt=(h+(n=n+Math.imul(c,G)|0)|0)+((8191&(i=(i=i+Math.imul(c,q)|0)+Math.imul(f,G)|0))<<13)|0;h=((o=o+Math.imul(f,q)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,j),i=(i=Math.imul(v,H))+Math.imul(y,j)|0,o=Math.imul(y,H),n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,q)|0;var yt=(h+(n=n+Math.imul(c,V)|0)|0)+((8191&(i=(i=i+Math.imul(c,W)|0)+Math.imul(f,V)|0))<<13)|0;h=((o=o+Math.imul(f,W)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,j),i=(i=Math.imul(w,H))+Math.imul(_,j)|0,o=Math.imul(_,H),n=n+Math.imul(v,G)|0,i=(i=i+Math.imul(v,q)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,q)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,W)|0;var bt=(h+(n=n+Math.imul(c,J)|0)|0)+((8191&(i=(i=i+Math.imul(c,X)|0)+Math.imul(f,J)|0))<<13)|0;h=((o=o+Math.imul(f,X)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(k,j),i=(i=Math.imul(k,H))+Math.imul(x,j)|0,o=Math.imul(x,H),n=n+Math.imul(w,G)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,q)|0,n=n+Math.imul(v,V)|0,i=(i=i+Math.imul(v,W)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,W)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(h+(n=n+Math.imul(c,Y)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(f,Y)|0))<<13)|0;h=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(S,j),i=(i=Math.imul(S,H))+Math.imul(E,j)|0,o=Math.imul(E,H),n=n+Math.imul(k,G)|0,i=(i=i+Math.imul(k,q)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,q)|0,n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(v,J)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,tt)|0;var _t=(h+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(f,rt)|0))<<13)|0;h=((o=o+Math.imul(f,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(P,j),i=(i=Math.imul(P,H))+Math.imul(T,j)|0,o=Math.imul(T,H),n=n+Math.imul(S,G)|0,i=(i=i+Math.imul(S,q)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,q)|0,n=n+Math.imul(k,V)|0,i=(i=i+Math.imul(k,W)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(v,Y)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var Mt=(h+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(f,ot)|0))<<13)|0;h=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(R,j),i=(i=Math.imul(R,H))+Math.imul(C,j)|0,o=Math.imul(C,H),n=n+Math.imul(P,G)|0,i=(i=i+Math.imul(P,q)|0)+Math.imul(T,G)|0,o=o+Math.imul(T,q)|0,n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,W)|0,n=n+Math.imul(k,J)|0,i=(i=i+Math.imul(k,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(v,rt)|0,i=(i=i+Math.imul(v,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var kt=(h+(n=n+Math.imul(c,ut)|0)|0)+((8191&(i=(i=i+Math.imul(c,ht)|0)+Math.imul(f,ut)|0))<<13)|0;h=((o=o+Math.imul(f,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(B,j),i=(i=Math.imul(B,H))+Math.imul(D,j)|0,o=Math.imul(D,H),n=n+Math.imul(R,G)|0,i=(i=i+Math.imul(R,q)|0)+Math.imul(C,G)|0,o=o+Math.imul(C,q)|0,n=n+Math.imul(P,V)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,W)|0,n=n+Math.imul(S,J)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,n=n+Math.imul(k,Y)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(v,ot)|0,i=(i=i+Math.imul(v,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var xt=(h+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,ft)|0)+Math.imul(f,ct)|0))<<13)|0;h=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(U,j),i=(i=Math.imul(U,H))+Math.imul(F,j)|0,o=Math.imul(F,H),n=n+Math.imul(B,G)|0,i=(i=i+Math.imul(B,q)|0)+Math.imul(D,G)|0,o=o+Math.imul(D,q)|0,n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(C,V)|0,o=o+Math.imul(C,W)|0,n=n+Math.imul(P,J)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,X)|0,n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(v,ut)|0,i=(i=i+Math.imul(v,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,ft)|0;var At=(h+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,mt)|0)+Math.imul(f,pt)|0))<<13)|0;h=((o=o+Math.imul(f,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(U,G),i=(i=Math.imul(U,q))+Math.imul(F,G)|0,o=Math.imul(F,q),n=n+Math.imul(B,V)|0,i=(i=i+Math.imul(B,W)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,W)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,X)|0)+Math.imul(C,J)|0,o=o+Math.imul(C,X)|0,n=n+Math.imul(P,Y)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(T,Y)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(v,ct)|0,i=(i=i+Math.imul(v,ft)|0)+Math.imul(y,ct)|0,o=o+Math.imul(y,ft)|0;var St=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(U,V),i=(i=Math.imul(U,W))+Math.imul(F,V)|0,o=Math.imul(F,W),n=n+Math.imul(B,J)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,X)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ht)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ht)|0,n=n+Math.imul(w,ct)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,ft)|0;var Et=(h+(n=n+Math.imul(v,pt)|0)|0)+((8191&(i=(i=i+Math.imul(v,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(U,J),i=(i=Math.imul(U,X))+Math.imul(F,J)|0,o=Math.imul(F,X),n=n+Math.imul(B,Y)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,n=n+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(E,ut)|0,o=o+Math.imul(E,ht)|0,n=n+Math.imul(k,ct)|0,i=(i=i+Math.imul(k,ft)|0)+Math.imul(x,ct)|0,o=o+Math.imul(x,ft)|0;var Nt=(h+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(U,Y),i=(i=Math.imul(U,tt))+Math.imul(F,Y)|0,o=Math.imul(F,tt),n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(D,rt)|0,o=o+Math.imul(D,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(P,ut)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ht)|0,n=n+Math.imul(S,ct)|0,i=(i=i+Math.imul(S,ft)|0)+Math.imul(E,ct)|0,o=o+Math.imul(E,ft)|0;var Pt=(h+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,mt)|0)+Math.imul(x,pt)|0))<<13)|0;h=((o=o+Math.imul(x,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(F,rt)|0,o=Math.imul(F,nt),n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,st)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ht)|0,n=n+Math.imul(P,ct)|0,i=(i=i+Math.imul(P,ft)|0)+Math.imul(T,ct)|0,o=o+Math.imul(T,ft)|0;var Tt=(h+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,mt)|0)+Math.imul(E,pt)|0))<<13)|0;h=((o=o+Math.imul(E,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,ot),i=(i=Math.imul(U,st))+Math.imul(F,ot)|0,o=Math.imul(F,st),n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ht)|0)+Math.imul(D,ut)|0,o=o+Math.imul(D,ht)|0,n=n+Math.imul(R,ct)|0,i=(i=i+Math.imul(R,ft)|0)+Math.imul(C,ct)|0,o=o+Math.imul(C,ft)|0;var It=(h+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(T,pt)|0))<<13)|0;h=((o=o+Math.imul(T,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(U,ut),i=(i=Math.imul(U,ht))+Math.imul(F,ut)|0,o=Math.imul(F,ht),n=n+Math.imul(B,ct)|0,i=(i=i+Math.imul(B,ft)|0)+Math.imul(D,ct)|0,o=o+Math.imul(D,ft)|0;var Rt=(h+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,mt)|0)+Math.imul(C,pt)|0))<<13)|0;h=((o=o+Math.imul(C,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,ct),i=(i=Math.imul(U,ft))+Math.imul(F,ct)|0,o=Math.imul(F,ft);var Ct=(h+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(D,pt)|0))<<13)|0;h=((o=o+Math.imul(D,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863;var Ot=(h+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,mt))+Math.imul(F,pt)|0))<<13)|0;return h=((o=Math.imul(F,mt))+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,u[0]=gt,u[1]=vt,u[2]=yt,u[3]=bt,u[4]=wt,u[5]=_t,u[6]=Mt,u[7]=kt,u[8]=xt,u[9]=At,u[10]=St,u[11]=Et,u[12]=Nt,u[13]=Pt,u[14]=Tt,u[15]=It,u[16]=Rt,u[17]=Ct,u[18]=Ot,0!==h&&(u[19]=h,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=f),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?f(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var l=o-h,c=(0|t.words[l])*(0|e.words[h]),f=67108863&c;a=67108863&(f=f+a|0),i+=(s=(s=s+(c/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},m.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},m.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},m.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),l=0;l<i;l+=a)for(var c=u,f=h,d=0;d<s;d++){var p=r[l+d],m=n[l+d],g=r[l+d+s],v=n[l+d+s],y=c*g-f*v;v=c*v+f*g,g=y,r[l+d]=p+g,n[l+d]=m+v,r[l+d+s]=p-g,n[l+d+s]=m-v,d!==a&&(y=u*c-h*f,f=u*f+h*c,c=y)}},m.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},m.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},m.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},m.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},m.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},m.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),h=new Array(n),l=new Array(n),c=new Array(n),f=r.words;f.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,h,n),this.transform(s,o,a,u,n,i),this.transform(h,o,l,c,n,i);for(var d=0;d<n;d++){var p=a[d]*l[d]-u[d]*c[d];u[d]=a[d]*c[d]+u[d]*l[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),p(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,o=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&0<=t);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!=r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!=i){for(e=this.length-1;0<=e;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&0<=t),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var l=0;for(h=this.length-1;0<=h&&(0!==l||i<=h);h--){var c=0|this.words[h];this.words[h]=l<<26-o|c>>>o,l=c&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&0<=t);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(t){n("number"==typeof t&&0<=t);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!=e&&r++,this.length=Math.min(r,this.length),0!=e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(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.negative=0,this.isubn(t),this.negative=1),this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&67108864<=this.words[e];e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),i=a=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=1+u,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var l=n.clone()._ishlnsubmul(i,1,u);0===l.negative&&(n=l,a&&(a.words[u]=1));for(var c=u-1;0<=c;c--){var f=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,c);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);a&&(a.words[c]=f)}return a&&a.strip(),n.strip(),"div"!==e&&0!=r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;0<=i;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;0<=r;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),c=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(0<f)for(e.iushrn(f);0<f--;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(0<p)for(r.iushrn(p);0<p--;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(c)),a.iushrn(1),u.iushrn(1);0<=e.cmp(r)?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();0<e.cmpn(1)&&0<r.cmpn(1);){for(var h=0,l=1;0==(e.words[0]&l)&&h<26;++h,l<<=1);if(0<h)for(e.iushrn(h);0<h--;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var c=0,f=1;0==(r.words[0]&f)&&c<26;++c,f<<=1);if(0<c)for(r.iushrn(c);0<c--;)a.isOdd()&&a.iadd(u),a.iushrn(1);0<=e.cmp(r)?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0;for(var n=r.negative=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(1+r),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),1<this.length)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;0<=r;r--){var n=0|this.words[r],i=0|t.words[r];if(n!=i){n<i?e=-1:i<n&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return 0<=this.cmpn(t)},o.prototype.gte=function(t){return 0<=this.cmp(t)},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new M(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){for(var e,r=t;this.split(r,this.tmp),(e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength())>this.n;);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):0<n?r.isub(this.p):r.strip(),r},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},i(y,v),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var i=t.words[9];for(e.words[e.length++]=4194303&i,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(4194303&o)<<4|i>>>22,i=o}i>>>=22,0===(t.words[n-10]=i)&&10<t.length?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(b,v),i(w,v),i(_,v),_.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return g[t]=e},M.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return 0<=r.cmp(this.m)&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,h).cmp(u);)l.redIAdd(u);for(var c=this.pow(l,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g<p);var v=this.pow(c,new o(1).iushln(p-g-1));f=f.redMul(v),c=v.redSqr(),d=d.redMul(c),p=g}return f},M.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},M.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;0<=n;n--){for(var h=e.words[n],l=u-1;0<=l;l--){var c=h>>l&1;i!==r[0]&&(i=this.sqr(i)),0!=c||0!==s?(s<<=1,s|=c,(4==++a||0===n&&0===l)&&(i=this.mul(i,r[s]),s=a=0)):a=0}u=26}return i},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new k(t)},i(k,M),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return 0<=i.cmp(this.m)?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return 0<=i.cmp(this.m)?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:11}],10:[function(t,e,r){(function(t){e.exports=function(e){var r=new Uint8Array(e);return(t.crypto||t.msCrypto).getRandomValues(r),r}}).call(this,void 0!==Y?Y:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],11:[function(t,e,r){},{}],12:[function(t,e,r){var n=r;n.version=t("../package.json").version,n.utils=t("./elliptic/utils"),n.rand=t("brorand"),n.hmacDRBG=t("./elliptic/hmac-drbg"),n.curve=t("./elliptic/curve"),n.curves=t("./elliptic/curves"),n.ec=t("./elliptic/ec"),n.eddsa=t("./elliptic/eddsa")},{"../package.json":26,"./elliptic/curve":15,"./elliptic/curves":18,"./elliptic/ec":19,"./elliptic/eddsa":22,"./elliptic/hmac-drbg":23,"./elliptic/utils":25,brorand:10}],13:[function(t,e,r){var n=t("bn.js"),i=t("../../elliptic").utils,o=i.getNAF,s=i.getJSF,a=i.assert;function u(t,e){this.type=t,this.p=new n(e.p,16),this.red=e.prime?n.red(e.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=e.n&&new n(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||0<r.cmpn(100)?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function h(t,e){this.curve=t,this.type=e,this.precomputed=null}(e.exports=u).prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(t,e){a(t.precomputed);var r=t._getDoubles(),n=o(e,1),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;for(var s=[],u=0;u<n.length;u+=r.step){var h=0;for(e=u+r.step-1;u<=e;e--)h=(h<<1)+n[e];s.push(h)}for(var l=this.jpoint(null,null,null),c=this.jpoint(null,null,null),f=i;0<f;f--){for(u=0;u<s.length;u++)(h=s[u])===f?c=c.mixedAdd(r.points[u]):h===-f&&(c=c.mixedAdd(r.points[u].neg()));l=l.add(c)}return l.toP()},u.prototype._wnafMul=function(t,e){var r=4,n=t._getNAFPoints(r);r=n.wnd;for(var i=n.points,s=o(e,r),u=this.jpoint(null,null,null),h=s.length-1;0<=h;h--){for(e=0;0<=h&&0===s[h];h--)e++;if(0<=h&&e++,u=u.dblp(e),h<0)break;var l=s[h];a(0!==l),u="affine"===t.type?0<l?u.mixedAdd(i[l-1>>1]):u.mixedAdd(i[-l-1>>1].neg()):0<l?u.add(i[l-1>>1]):u.add(i[-l-1>>1].neg())}return"affine"===t.type?u.toP():u},u.prototype._wnafMulAdd=function(t,e,r,n,i){for(var a=this._wnafT1,u=this._wnafT2,h=this._wnafT3,l=0,c=0;c<n;c++){var f=(A=e[c])._getNAFPoints(t);a[c]=f.wnd,u[c]=f.points}for(c=n-1;1<=c;c-=2){var d=c-1,p=c;if(1===a[d]&&1===a[p]){var m=[e[d],null,null,e[p]];0===e[d].y.cmp(e[p].y)?(m[1]=e[d].add(e[p]),m[2]=e[d].toJ().mixedAdd(e[p].neg())):0===e[d].y.cmp(e[p].y.redNeg())?(m[1]=e[d].toJ().mixedAdd(e[p]),m[2]=e[d].add(e[p].neg())):(m[1]=e[d].toJ().mixedAdd(e[p]),m[2]=e[d].toJ().mixedAdd(e[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],v=s(r[d],r[p]);l=Math.max(v[0].length,l),h[d]=new Array(l),h[p]=new Array(l);for(var y=0;y<l;y++){var b=0|v[0][y],w=0|v[1][y];h[d][y]=g[3*(1+b)+(1+w)],h[p][y]=0,u[d]=m}}else h[d]=o(r[d],a[d]),h[p]=o(r[p],a[p]),l=Math.max(h[d].length,l),l=Math.max(h[p].length,l)}var _=this.jpoint(null,null,null),M=this._wnafT4;for(c=l;0<=c;c--){for(var k=0;0<=c;){var x=!0;for(y=0;y<n;y++)M[y]=0|h[y][c],0!==M[y]&&(x=!1);if(!x)break;k++,c--}if(0<=c&&k++,_=_.dblp(k),c<0)break;for(y=0;y<n;y++){var A,S=M[y];0!==S&&(0<S?A=u[y][S-1>>1]:S<0&&(A=u[y][-S-1>>1].neg()),_="affine"===A.type?_.mixedAdd(A):_.add(A))}}for(c=0;c<n;c++)u[c]=null;return i?_:_.toP()},(u.BasePoint=h).prototype.eq=function(){throw new Error("Not implemented")},h.prototype.validate=function(){return this.curve.validate(this)},u.prototype.decodePoint=function(t,e){t=i.toArray(t,e);var r=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*r)return 6===t[0]?a(t[t.length-1]%2==0):7===t[0]&&a(t[t.length-1]%2==1),this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));if((2===t[0]||3===t[0])&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),3===t[0]);throw new Error("Unknown point format")},h.prototype.encodeCompressed=function(t){return this.encode(t,!0)},h.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},h.prototype.encode=function(t,e){return i.encode(this._encode(e),t)},h.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},h.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},h.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<e;i+=t){for(var o=0;o<t;o++)n=n.dbl();r.push(n)}return{step:t,points:r}},h.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,n=1==r?null:this.dbl(),i=1;i<r;i++)e[i]=e[i-1].add(n);return{wnd:t,points:e}},h.prototype._getBeta=function(){return null},h.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}},{"../../elliptic":12,"bn.js":9}],14:[function(t,e,r){e.exports={}},{}],15:[function(t,e,r){var n=r;n.base=t("./base"),n.short=t("./short"),n.mont=t("./mont"),n.edwards=t("./edwards")},{"./base":13,"./edwards":14,"./mont":16,"./short":17}],16:[function(t,e,r){arguments[4][14][0].apply(r,arguments)},{dup:14}],17:[function(t,e,r){var n=t("../curve"),i=t("../../elliptic"),o=t("bn.js"),s=t("inherits"),a=n.base,u=i.utils.assert;function h(t){a.call(this,"short",t),this.a=new o(t.a,16).toRed(this.red),this.b=new o(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function l(t,e,r,n){a.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new o(e,16),this.y=new o(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function c(t,e,r,n){a.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new o(0)):(this.x=new o(e,16),this.y=new o(r,16),this.z=new o(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}s(h,a),(e.exports=h).prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new o(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new o(t.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(e))?r=i[0]:(r=i[1],u(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new o(t.a,16),b:new o(t.b,16)}})):this._getEndoBasis(r)}}},h.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:o.mont(t),r=new o(2).toRed(e).redInvm(),n=r.redNeg(),i=new o(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},h.prototype._getEndoBasis=function(t){for(var e,r,n,i,s,a,u,h,l,c=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=t,d=this.n.clone(),p=new o(1),m=new o(0),g=new o(0),v=new o(1),y=0;0!==f.cmpn(0);){var b=d.div(f);h=d.sub(b.mul(f)),l=g.sub(b.mul(p));var w=v.sub(b.mul(m));if(!n&&h.cmp(c)<0)e=u.neg(),r=p,n=h.neg(),i=l;else if(n&&2==++y)break;d=f,f=u=h,g=p,p=l,v=m,m=w}s=h.neg(),a=l;var _=n.sqr().add(i.sqr());return 0<=s.sqr().add(a.sqr()).cmp(_)&&(s=e,a=r),n.negative&&(n=n.neg(),i=i.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:i},{a:s,b:a}]},h.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),u=i.mul(r.b),h=o.mul(n.b);return{k1:t.sub(s).sub(a),k2:u.add(h).neg()}},h.prototype.pointFromX=function(t,e){(t=new o(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(e&&!i||!e&&i)&&(n=n.redNeg()),this.point(t,n)},h.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},h.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<t.length;o++){var s=this._endoSplit(e[o]),a=t[o],u=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),u=u.neg(!0)),n[2*o]=a,n[2*o+1]=u,i[2*o]=s.k1,i[2*o+1]=s.k2}for(var h=this._wnafMulAdd(1,n,i,2*o,r),l=0;l<2*o;l++)n[l]=null,i[l]=null;return h},s(l,a.BasePoint),h.prototype.point=function(t,e,r){return new l(this,t,e,r)},h.prototype.pointFromJSON=function(t,e){return l.fromJSON(this,t,e)},l.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,n=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};(t.beta=e).precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}}return e}},l.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},l.fromJSON=function(t,e,r){"string"==typeof e&&(e=JSON.parse(e));var n=t.point(e[0],e[1],r);if(!e[2])return n;function i(e){return t.point(e[0],e[1],r)}var o=e[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},l.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},l.prototype.isInfinity=function(){return this.inf},l.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},l.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},l.prototype.getX=function(){return this.x.fromRed()},l.prototype.getY=function(){return this.y.fromRed()},l.prototype.mul=function(t){return t=new o(t,16),this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},l.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},l.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},l.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},l.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},l.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},s(c,a.BasePoint),h.prototype.jpoint=function(t,e,r){return new c(this,t,e,r)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),a=n.redSub(i),u=o.redSub(s);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=a.redSqr(),l=h.redMul(a),c=n.redMul(h),f=u.redSqr().redIAdd(l).redISub(c).redISub(c),d=u.redMul(c.redISub(f)).redISub(o.redMul(l)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(f,d,p)},c.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),h=u.redMul(s),l=r.redMul(u),c=a.redSqr().redIAdd(h).redISub(l).redISub(l),f=a.redMul(l.redISub(c)).redISub(i.redMul(h)),d=this.z.redMul(s);return this.curve.jpoint(c,f,d)},c.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}var n=this.curve.a,i=this.curve.tinv,o=this.x,s=this.y,a=this.z,u=a.redSqr().redSqr(),h=s.redAdd(s);for(r=0;r<t;r++){var l=o.redSqr(),c=h.redSqr(),f=c.redSqr(),d=l.redAdd(l).redIAdd(l).redIAdd(n.redMul(u)),p=o.redMul(c),m=d.redSqr().redISub(p.redAdd(p)),g=p.redISub(m),v=d.redMul(g);v=v.redIAdd(v).redISub(f);var y=h.redMul(a);r+1<t&&(u=u.redMul(f)),o=m,a=y,h=v}return this.curve.jpoint(o,h.redMul(i),a)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},c.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),u=a.redSqr().redISub(s).redISub(s),h=o.redIAdd(o);h=(h=h.redIAdd(h)).redIAdd(h),t=u,e=a.redMul(s.redISub(u)).redISub(h),r=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),c=this.y.redSqr(),f=c.redSqr(),d=this.x.redAdd(c).redSqr().redISub(l).redISub(f);d=d.redIAdd(d);var p=l.redAdd(l).redIAdd(l),m=p.redSqr(),g=f.redIAdd(f);g=(g=g.redIAdd(g)).redIAdd(g),t=m.redISub(d).redISub(d),e=p.redMul(d.redISub(t)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},c.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=a.redSqr().redISub(s).redISub(s);t=u;var h=o.redIAdd(o);h=(h=h.redIAdd(h)).redIAdd(h),e=a.redMul(s.redISub(u)).redISub(h),r=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),c=this.y.redSqr(),f=this.x.redMul(c),d=this.x.redSub(l).redMul(this.x.redAdd(l));d=d.redAdd(d).redIAdd(d);var p=f.redIAdd(f),m=(p=p.redIAdd(p)).redAdd(p);t=d.redSqr().redISub(m),r=this.y.redAdd(this.z).redSqr().redISub(c).redISub(l);var g=c.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),e=d.redMul(p.redISub(t)).redISub(g)}return this.curve.jpoint(t,e,r)},c.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=e.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(i)),u=e.redAdd(e),h=(u=u.redIAdd(u)).redMul(s),l=a.redSqr().redISub(h.redAdd(h)),c=h.redISub(l),f=s.redSqr();f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var d=a.redMul(c).redISub(f),p=r.redAdd(r).redMul(n);return this.curve.jpoint(l,d,p)},c.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),n=e.redSqr(),i=t.redAdd(t).redIAdd(t),o=i.redSqr(),s=this.x.redAdd(e).redSqr().redISub(t).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var h=i.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(u),l=e.redMul(h);l=(l=l.redIAdd(l)).redIAdd(l);var c=this.x.redMul(a).redISub(l);c=(c=c.redIAdd(c)).redIAdd(c);var f=this.y.redMul(h.redMul(u.redISub(h)).redISub(s.redMul(a)));f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var d=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(c,f,d)},c.prototype.mul=function(t,e){return t=new o(t,e),this.curve._wnafMul(this,t)},c.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var n=e.redMul(this.z),i=r.redMul(t.z);return 0===this.y.redMul(i).redISub(t.y.redMul(n)).cmpn(0)},c.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var n=t.clone(),i=this.curve.redN.redMul(e);;){if(n.iadd(this.curve.n),0<=n.cmp(this.curve.p))return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}return!1},c.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":12,"../curve":15,"bn.js":9,inherits:39}],18:[function(t,e,r){var n,i=r,o=t("hash.js"),s=t("../elliptic"),a=s.utils.assert;function u(t){"short"===t.type?this.curve=new s.curve.short(t):"edwards"===t.type?this.curve=new s.curve.edwards(t):this.curve=new s.curve.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function h(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var r=new u(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,h("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),h("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),h("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),h("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),h("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),h("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),h("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=t("./precomputed/secp256k1")}catch(t){n=void 0}h("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},{"../elliptic":12,"./precomputed/secp256k1":24,"hash.js":27}],19:[function(t,e,r){var n=t("bn.js"),i=t("../../elliptic"),o=i.utils.assert,s=t("./key"),a=t("./signature");function u(t){if(!(this instanceof u))return new u(t);"string"==typeof t&&(o(i.curves.hasOwnProperty(t),"Unknown curve "+t),t=i.curves[t]),t instanceof i.curves.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}(e.exports=u).prototype.keyPair=function(t){return new s(this,t)},u.prototype.keyFromPrivate=function(t,e){return s.fromPrivate(this,t,e)},u.prototype.keyFromPublic=function(t,e){return s.fromPublic(this,t,e)},u.prototype.genKeyPair=function(t){t=t||{};for(var e=new i.hmacDRBG({hash:this.hash,pers:t.pers,entropy:t.entropy||i.rand(this.hash.hmacStrength),nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var s=new n(e.generate(r));if(!(0<s.cmp(o)))return s.iaddn(1),this.keyFromPrivate(s)}},u.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return 0<r&&(t=t.ushrn(r)),!e&&0<=t.cmp(this.n)?t.sub(this.n):t},u.prototype.sign=function(t,e,r,o){"object"==typeof r&&(o=r,r=null),o=o||{},e=this.keyFromPrivate(e,r),t=this._truncateToN(new n(t,16));for(var s=this.n.byteLength(),u=e.getPrivate().toArray("be",s),h=t.toArray("be",s),l=new i.hmacDRBG({hash:this.hash,entropy:u,nonce:h,pers:o.pers,persEnc:o.persEnc}),c=this.n.sub(new n(1)),f=0;;f++){var d=o.k?o.k(f):new n(l.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||0<=d.cmp(c))){var p=this.g.mul(d);if(!p.isInfinity()){var m=p.getX(),g=m.umod(this.n);if(0!==g.cmpn(0)){var v=d.invm(this.n).mul(g.mul(e.getPrivate()).iadd(t));if(0!==(v=v.umod(this.n)).cmpn(0)){var y=(p.getY().isOdd()?1:0)|(0!==m.cmp(g)?2:0);return o.canonical&&0<v.cmp(this.nh)&&(v=this.n.sub(v),y^=1),new a({r:g,s:v,recoveryParam:y})}}}}}},u.prototype.verify=function(t,e,r,i){t=this._truncateToN(new n(t,16)),r=this.keyFromPublic(r,i);var o=(e=new a(e,"hex")).r,s=e.s;if(o.cmpn(1)<0||0<=o.cmp(this.n))return!1;if(s.cmpn(1)<0||0<=s.cmp(this.n))return!1;var u,h=s.invm(this.n),l=h.mul(t).umod(this.n),c=h.mul(o).umod(this.n);return this.curve._maxwellTrick?!(u=this.g.jmulAdd(l,r.getPublic(),c)).isInfinity()&&u.eqXToP(o):!(u=this.g.mulAdd(l,r.getPublic(),c)).isInfinity()&&0===u.getX().umod(this.n).cmp(o)},u.prototype.recoverPubKey=function(t,e,r,i){o((3&r)===r,"The recovery param is more than two bits"),e=new a(e,i);var s=this.n,u=new n(t),h=e.r,l=e.s,c=1&r,f=r>>1;if(0<=h.cmp(this.curve.p.umod(this.curve.n))&&f)throw new Error("Unable to find sencond key candinate");h=f?this.curve.pointFromX(h.add(this.curve.n),c):this.curve.pointFromX(h,c);var d=e.r.invm(s),p=s.sub(u).mul(d).umod(s),m=l.mul(d).umod(s);return this.g.mulAdd(p,h,m)},u.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new a(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":12,"./key":20,"./signature":21,"bn.js":9}],20:[function(t,e,r){var n=t("bn.js"),i=t("../../elliptic").utils.assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}(e.exports=o).fromPublic=function(t,e,r){return e instanceof o?e:new o(t,{pub:e,pubEnc:r})},o.fromPrivate=function(t,e,r){return e instanceof o?e:new o(t,{priv:e,privEnc:r})},o.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new n(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?i(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},o.prototype.derive=function(t){return t.mul(this.priv).getX()},o.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},{"../../elliptic":12,"bn.js":9}],21:[function(t,e,r){var n=t("bn.js"),i=t("../../elliptic").utils,o=i.assert;function s(t,e){if(t instanceof s)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new n(t.r,16),this.s=new n(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function a(){this.place=0}function u(t,e){var r=t[e.place++];if(!(128&r))return r;for(var n=15&r,i=0,o=0,s=e.place;o<n;o++,s++)i<<=8,i|=t[s];return e.place=s,i}function h(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function l(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}(e.exports=s).prototype._importDER=function(t,e){t=i.toArray(t,e);var r=new a;if(48!==t[r.place++])return!1;if(u(t,r)+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var o=u(t,r),s=t.slice(r.place,o+r.place);if(r.place+=o,2!==t[r.place++])return!1;var h=u(t,r);if(t.length!==h+r.place)return!1;var l=t.slice(r.place,h+r.place);return 0===s[0]&&128&s[1]&&(s=s.slice(1)),0===l[0]&&128&l[1]&&(l=l.slice(1)),this.r=new n(s),this.s=new n(l),!(this.recoveryParam=null)},s.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=h(e),r=h(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];l(n,e.length),(n=n.concat(e)).push(2),l(n,r.length);var o=n.concat(r),s=[48];return l(s,o.length),s=s.concat(o),i.encode(s,t)}},{"../../elliptic":12,"bn.js":9}],22:[function(t,e,r){arguments[4][14][0].apply(r,arguments)},{dup:14}],23:[function(t,e,r){var n=t("hash.js"),i=t("../elliptic").utils,o=i.assert;function s(t){if(!(this instanceof s))return new s(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this.reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=i.toArray(t.entropy,t.entropyEnc),r=i.toArray(t.nonce,t.nonceEnc),n=i.toArray(t.pers,t.persEnc);o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}(e.exports=s).prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this.reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},s.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},s.prototype.reseed=function(t,e,r,n){"string"!=typeof e&&(n=r,r=e,e=null),t=i.toBuffer(t,e),r=i.toBuffer(r,n),o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this.reseed=1},s.prototype.generate=function(t,e,r,n){if(this.reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=i.toArray(r,n),this._update(r));for(var o=[];o.length<t;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var s=o.slice(0,t);return this._update(r),this.reseed++,i.encode(s,e)}},{"../elliptic":12,"hash.js":27}],24:[function(t,e,r){e.exports=void 0},{}],25:[function(t,e,r){var n=r,i=t("bn.js");function o(t){return 1===t.length?"0"+t:t}function s(t){for(var e="",r=0;r<t.length;r++)e+=o(t[r].toString(16));return e}n.assert=function(t,e){if(!t)throw new Error(e||"Assertion failed")},n.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var n=0;n<t.length;n++)r[n]=0|t[n];return r}if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(n=0;n<t.length;n++){var i=t.charCodeAt(n),o=i>>8,s=255&i;o?r.push(o,s):r.push(s)}return r},n.zero2=o,n.toHex=s,n.encode=function(t,e){return"hex"===e?s(t):t},n.getNAF=function(t,e){for(var r=[],n=1<<e+1,i=t.clone();0<=i.cmpn(1);){var o;if(i.isOdd()){var s=i.andln(n-1);o=(n>>1)-1<s?(n>>1)-s:s,i.isubn(o)}else o=0;r.push(o);for(var a=0!==i.cmpn(0)&&0===i.andln(n-1)?e+1:1,u=1;u<a;u++)r.push(0);i.iushrn(a)}return r},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n=0,i=0;0<t.cmpn(-n)||0<e.cmpn(-i);){var o,s,a,u=t.andln(3)+n&3,h=e.andln(3)+i&3;3===u&&(u=-1),3===h&&(h=-1),o=0==(1&u)?0:3!=(a=t.andln(7)+n&7)&&5!==a||2!==h?u:-u,r[0].push(o),s=0==(1&h)?0:3!=(a=e.andln(7)+i&7)&&5!==a||2!==u?h:-h,r[1].push(s),2*n===o+1&&(n=1-n),2*i===s+1&&(i=1-i),t.iushrn(1),e.iushrn(1)}return r},n.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(t){return"string"==typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new i(t,"hex","le")}},{"bn.js":9}],26:[function(t,e,r){e.exports={version:"6.3.3"}},{}],27:[function(t,e,r){var n=r;n.utils=t("./hash/utils"),n.common=t("./hash/common"),n.sha=t("./hash/sha"),n.ripemd=t("./hash/ripemd"),n.hmac=t("./hash/hmac"),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},{"./hash/common":28,"./hash/hmac":29,"./hash/ripemd":30,"./hash/sha":31,"./hash/utils":38}],28:[function(t,e,r){var n=t("./utils"),i=t("minimalistic-assert");function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}(r.BlockHash=o).prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},o.prototype.digest=function(t){return this.update(this._pad()),i(null===this.pending),this._digest(t)},o.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=t>>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},{"./utils":38,"minimalistic-assert":41}],29:[function(t,e,r){var n=t("./utils"),i=t("minimalistic-assert");function o(t,e,r){if(!(this instanceof o))return new o(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(e,r))}(e.exports=o).prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},o.prototype.update=function(t,e){return this.inner.update(t,e),this},o.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},{"./utils":38,"minimalistic-assert":41}],30:[function(t,e,r){var n=t("./utils"),i=t("./common"),o=n.rotl32,s=n.sum32,a=n.sum32_3,u=n.sum32_4,h=i.BlockHash;function l(){if(!(this instanceof l))return new l;h.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function c(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function f(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function d(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}n.inherits(l,h),(r.ripemd160=l).blockSize=512,l.outSize=160,l.hmacStrength=192,l.padLength=64,l.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],i=this.h[2],h=this.h[3],l=this.h[4],y=r,b=n,w=i,_=h,M=l,k=0;k<80;k++){var x=s(o(u(r,c(k,n,i,h),t[p[k]+e],f(k)),g[k]),l);r=l,l=h,h=o(i,10),i=n,n=x,x=s(o(u(y,c(79-k,b,w,_),t[m[k]+e],d(k)),v[k]),M),y=M,M=_,_=o(w,10),w=b,b=x}x=a(this.h[1],i,_),this.h[1]=a(this.h[2],h,M),this.h[2]=a(this.h[3],l,y),this.h[3]=a(this.h[4],r,b),this.h[4]=a(this.h[0],n,w),this.h[0]=x},l.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],m=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],g=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],v=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},{"./common":28,"./utils":38}],31:[function(t,e,r){r.sha1=t("./sha/1"),r.sha224=t("./sha/224"),r.sha256=t("./sha/256"),r.sha384=t("./sha/384"),r.sha512=t("./sha/512")},{"./sha/1":32,"./sha/224":33,"./sha/256":34,"./sha/384":35,"./sha/512":36}],32:[function(t,e,r){arguments[4][14][0].apply(r,arguments)},{dup:14}],33:[function(t,e,r){arguments[4][14][0].apply(r,arguments)},{dup:14}],34:[function(t,e,r){var n=t("../utils"),i=t("../common"),o=t("./common"),s=t("minimalistic-assert"),a=n.sum32,u=n.sum32_4,h=n.sum32_5,l=o.ch32,c=o.maj32,f=o.s0_256,d=o.s1_256,p=o.g0_256,m=o.g1_256,g=i.BlockHash,v=[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];function y(){if(!(this instanceof y))return new y;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=v,this.W=new Array(64)}n.inherits(y,g),(e.exports=y).blockSize=512,y.outSize=256,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=u(m(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],g=this.h[2],v=this.h[3],y=this.h[4],b=this.h[5],w=this.h[6],_=this.h[7];for(s(this.k.length===r.length),n=0;n<r.length;n++){var M=h(_,d(y),l(y,b,w),this.k[n],r[n]),k=a(f(i),c(i,o,g));_=w,w=b,b=y,y=a(v,M),v=g,g=o,o=i,i=a(M,k)}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],g),this.h[3]=a(this.h[3],v),this.h[4]=a(this.h[4],y),this.h[5]=a(this.h[5],b),this.h[6]=a(this.h[6],w),this.h[7]=a(this.h[7],_)},y.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},{"../common":28,"../utils":38,"./common":37,"minimalistic-assert":41}],35:[function(t,e,r){arguments[4][14][0].apply(r,arguments)},{dup:14}],36:[function(t,e,r){var n=t("../utils"),i=t("../common"),o=t("minimalistic-assert"),s=n.rotr64_hi,a=n.rotr64_lo,u=n.shr64_hi,h=n.shr64_lo,l=n.sum64,c=n.sum64_hi,f=n.sum64_lo,d=n.sum64_4_hi,p=n.sum64_4_lo,m=n.sum64_5_hi,g=n.sum64_5_lo,v=i.BlockHash,y=[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 b(){if(!(this instanceof b))return new b;v.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=y,this.W=new Array(160)}function w(t,e,r,n,i){var o=t&r^~t&i;return o<0&&(o+=4294967296),o}function _(t,e,r,n,i,o){var s=e&n^~e&o;return s<0&&(s+=4294967296),s}function M(t,e,r,n,i){var o=t&r^t&i^r&i;return o<0&&(o+=4294967296),o}function k(t,e,r,n,i,o){var s=e&n^e&o^n&o;return s<0&&(s+=4294967296),s}function x(t,e){var r=s(t,e,28)^s(e,t,2)^s(e,t,7);return r<0&&(r+=4294967296),r}function A(t,e){var r=a(t,e,28)^a(e,t,2)^a(e,t,7);return r<0&&(r+=4294967296),r}function S(t,e){var r=s(t,e,14)^s(t,e,18)^s(e,t,9);return r<0&&(r+=4294967296),r}function E(t,e){var r=a(t,e,14)^a(t,e,18)^a(e,t,9);return r<0&&(r+=4294967296),r}function N(t,e){var r=s(t,e,1)^s(t,e,8)^u(t,e,7);return r<0&&(r+=4294967296),r}function P(t,e){var r=a(t,e,1)^a(t,e,8)^h(t,e,7);return r<0&&(r+=4294967296),r}function T(t,e){var r=s(t,e,19)^s(e,t,29)^u(t,e,6);return r<0&&(r+=4294967296),r}function I(t,e){var r=a(t,e,19)^a(e,t,29)^h(t,e,6);return r<0&&(r+=4294967296),r}n.inherits(b,v),(e.exports=b).blockSize=1024,b.outSize=512,b.hmacStrength=192,b.padLength=128,b.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;n<32;n++)r[n]=t[e+n];for(;n<r.length;n+=2){var i=T(r[n-4],r[n-3]),o=I(r[n-4],r[n-3]),s=r[n-14],a=r[n-13],u=N(r[n-30],r[n-29]),h=P(r[n-30],r[n-29]),l=r[n-32],c=r[n-31];r[n]=d(i,o,s,a,u,h,l,c),r[n+1]=p(i,o,s,a,u,h,l,c)}},b.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,n=this.h[0],i=this.h[1],s=this.h[2],a=this.h[3],u=this.h[4],h=this.h[5],d=this.h[6],p=this.h[7],v=this.h[8],y=this.h[9],b=this.h[10],N=this.h[11],P=this.h[12],T=this.h[13],I=this.h[14],R=this.h[15];o(this.k.length===r.length);for(var C=0;C<r.length;C+=2){var O=I,B=R,D=S(v,y),L=E(v,y),U=w(v,0,b,0,P),F=_(0,y,0,N,0,T),z=this.k[C],j=this.k[C+1],H=r[C],$=r[C+1],G=m(O,B,D,L,U,F,z,j,H,$),q=g(O,B,D,L,U,F,z,j,H,$);O=x(n,i),B=A(n,i),D=M(n,0,s,0,u),L=k(0,i,0,a,0,h);var K=c(O,B,D,L),V=f(O,B,D,L);I=P,R=T,P=b,T=N,b=v,N=y,v=c(d,p,G,q),y=f(p,p,G,q),d=u,p=h,u=s,h=a,s=n,a=i,n=c(G,q,K,V),i=f(G,q,K,V)}l(this.h,0,n,i),l(this.h,2,s,a),l(this.h,4,u,h),l(this.h,6,d,p),l(this.h,8,v,y),l(this.h,10,b,N),l(this.h,12,P,T),l(this.h,14,I,R)},b.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},{"../common":28,"../utils":38,"minimalistic-assert":41}],37:[function(t,e,r){var n=t("../utils").rotr32;function i(t,e,r){return t&e^~t&r}function o(t,e,r){return t&e^t&r^e&r}function s(t,e,r){return t^e^r}r.ft_1=function(t,e,r,n){return 0===t?i(e,r,n):1===t||3===t?s(e,r,n):2===t?o(e,r,n):void 0},r.ch32=i,r.maj32=o,r.p32=s,r.s0_256=function(t){return n(t,2)^n(t,13)^n(t,22)},r.s1_256=function(t){return n(t,6)^n(t,11)^n(t,25)},r.g0_256=function(t){return n(t,7)^n(t,18)^t>>>3},r.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},{"../utils":38}],38:[function(t,e,r){var n=t("minimalistic-assert"),i=t("inherits");function o(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function s(t){return 1===t.length?"0"+t:t}function a(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}r.inherits=i,r.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(var n=0;n<t.length;n++){var i=t.charCodeAt(n),o=i>>8,s=255&i;o?r.push(o,s):r.push(s)}else for(n=0;n<t.length;n++)r[n]=0|t[n];return r},r.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=s(t[r].toString(16));return e},r.htonl=o,r.toHex32=function(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];"little"===e&&(i=o(i)),r+=a(i.toString(16))}return r},r.zero2=s,r.zero8=a,r.join32=function(t,e,r,i){var o=r-e;n(o%4==0);for(var s=new Array(o/4),a=0,u=e;a<s.length;a++,u+=4){var h;h="big"===i?t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]:t[u+3]<<24|t[u+2]<<16|t[u+1]<<8|t[u],s[a]=h>>>0}return s},r.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n<t.length;n++,i+=4){var o=t[n];"big"===e?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},r.rotr32=function(t,e){return t>>>e|t<<32-e},r.rotl32=function(t,e){return t<<e|t>>>32-e},r.sum32=function(t,e){return t+e>>>0},r.sum32_3=function(t,e,r){return t+e+r>>>0},r.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},r.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},r.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,s=(o<n?1:0)+r+i;t[e]=s>>>0,t[e+1]=o},r.sum64_hi=function(t,e,r,n){return(e+n>>>0<e?1:0)+t+r>>>0},r.sum64_lo=function(t,e,r,n){return e+n>>>0},r.sum64_4_hi=function(t,e,r,n,i,o,s,a){var u=0,h=e;return u+=(h=h+n>>>0)<e?1:0,u+=(h=h+o>>>0)<o?1:0,t+r+i+s+(u+=(h=h+a>>>0)<a?1:0)>>>0},r.sum64_4_lo=function(t,e,r,n,i,o,s,a){return e+n+o+a>>>0},r.sum64_5_hi=function(t,e,r,n,i,o,s,a,u,h){var l=0,c=e;return l+=(c=c+n>>>0)<e?1:0,l+=(c=c+o>>>0)<o?1:0,l+=(c=c+a>>>0)<a?1:0,t+r+i+s+u+(l+=(c=c+h>>>0)<h?1:0)>>>0},r.sum64_5_lo=function(t,e,r,n,i,o,s,a,u,h){return e+n+o+a+h>>>0},r.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},r.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},r.shr64_hi=function(t,e,r){return t>>>r},r.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},{inherits:39,"minimalistic-assert":41}],39:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(t,e){if(e){function r(){}t.super_=e,r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},{}],40:[function(t,e,r){(function(t,r){!function(){var n="object"==typeof window?window:{};!n.JS_SHA3_NO_NODE_JS&&"object"==typeof t&&t.versions&&t.versions.node&&(n=r);for(var i=!n.JS_SHA3_NO_COMMON_JS&&"object"==typeof e&&e.exports,o="0123456789abcdef".split(""),s=[0,8,16,24],a=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],u=[224,256,384,512],h=["hex","buffer","arrayBuffer","array"],l=function(t,e,r){return function(n){return new _(t,e,t).update(n)[r]()}},c=function(t,e,r){return function(n,i){return new _(t,e,i).update(n)[r]()}},f=function(t,e){var r=l(t,e,"hex");r.create=function(){return new _(t,e,t)},r.update=function(t){return r.create().update(t)};for(var n=0;n<h.length;++n){var i=h[n];r[i]=l(t,e,i)}return r},d=[{name:"keccak",padding:[1,256,65536,16777216],bits:u,createMethod:f},{name:"sha3",padding:[6,1536,393216,100663296],bits:u,createMethod:f},{name:"shake",padding:[31,7936,2031616,520093696],bits:[128,256],createMethod:function(t,e){var r=c(t,e,"hex");r.create=function(r){return new _(t,e,r)},r.update=function(t,e){return r.create(e).update(t)};for(var n=0;n<h.length;++n){var i=h[n];r[i]=c(t,e,i)}return r}}],p={},m=[],g=0;g<d.length;++g)for(var v=d[g],y=v.bits,b=0;b<y.length;++b){var w=v.name+"_"+y[b];m.push(w),p[w]=v.createMethod(y[b],v.padding)}function _(t,e,r){this.blocks=[],this.s=[],this.padding=e,this.outputBits=r,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}_.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,n,i=t.length,o=this.blocks,a=this.byteCount,u=this.blockCount,h=0,l=this.s;h<i;){if(this.reset)for(this.reset=!1,o[0]=this.block,r=1;r<u+1;++r)o[r]=0;if(e)for(r=this.start;h<i&&r<a;++h)o[r>>2]|=t[h]<<s[3&r++];else for(r=this.start;h<i&&r<a;++h)(n=t.charCodeAt(h))<128?o[r>>2]|=n<<s[3&r++]:(n<2048?o[r>>2]|=(192|n>>6)<<s[3&r++]:(n<55296||57344<=n?o[r>>2]|=(224|n>>12)<<s[3&r++]:(n=65536+((1023&n)<<10|1023&t.charCodeAt(++h)),o[r>>2]|=(240|n>>18)<<s[3&r++],o[r>>2]|=(128|n>>12&63)<<s[3&r++]),o[r>>2]|=(128|n>>6&63)<<s[3&r++]),o[r>>2]|=(128|63&n)<<s[3&r++]);if(a<=(this.lastByteIndex=r)){for(this.start=r-a,this.block=o[u],r=0;r<u;++r)l[r]^=o[r];M(l),this.reset=!0}else this.start=r}return this},_.prototype.finalize=function(){var t=this.blocks,e=this.lastByteIndex,r=this.blockCount,n=this.s;if(t[e>>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e<r+1;++e)t[e]=0;for(t[r-1]|=2147483648,e=0;e<r;++e)n[e]^=t[e];M(n)},_.prototype.toString=_.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,s=0,a=0,u="";a<n;){for(s=0;s<e&&a<n;++s,++a)t=r[s],u+=o[t>>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];a%e==0&&(M(r),s=0)}return i&&(t=r[s],0<i&&(u+=o[t>>4&15]+o[15&t]),1<i&&(u+=o[t>>12&15]+o[t>>8&15]),2<i&&(u+=o[t>>20&15]+o[t>>16&15])),u},_.prototype.buffer=_.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s<n;){for(o=0;o<e&&s<n;++o,++s)u[s]=r[o];s%e==0&&M(r)}return i&&(u[o]=r[o],t=t.slice(0,a)),t},_.prototype.digest=_.prototype.array=function(){this.finalize();for(var t,e,r=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,s=0,a=0,u=[];a<i;){for(s=0;s<r&&a<i;++s,++a)t=a<<2,e=n[s],u[t]=255&e,u[t+1]=e>>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%r==0&&M(n)}return o&&(t=a<<2,e=n[s],0<o&&(u[t]=255&e),1<o&&(u[t+1]=e>>8&255),2<o&&(u[t+2]=e>>16&255)),u};var M=function(t){var e,r,n,i,o,s,u,h,l,c,f,d,p,m,g,v,y,b,w,_,M,k,x,A,S,E,N,P,T,I,R,C,O,B,D,L,U,F,z,j,H,$,G,q,K,V,W,Z,J,X,Q,Y,tt,et,rt,nt,it,ot,st,at,ut,ht,lt;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],l=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|s>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(h<<1|l>>>31),r=o^(l<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=s^(c<<1|f>>>31),r=u^(f<<1|c>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(d<<1|p>>>31),r=l^(p<<1|d>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=c^(i<<1|o>>>31),r=f^(o<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,m=t[0],g=t[1],V=t[11]<<4|t[10]>>>28,W=t[10]<<4|t[11]>>>28,P=t[20]<<3|t[21]>>>29,T=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,$=t[40]<<18|t[41]>>>14,G=t[41]<<18|t[40]>>>14,B=t[2]<<1|t[3]>>>31,D=t[3]<<1|t[2]>>>31,v=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,Z=t[22]<<10|t[23]>>>22,J=t[23]<<10|t[22]>>>22,I=t[33]<<13|t[32]>>>19,R=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,L=t[14]<<6|t[15]>>>26,U=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Q=t[35]<<15|t[34]>>>17,C=t[45]<<29|t[44]>>>3,O=t[44]<<29|t[45]>>>3,A=t[6]<<28|t[7]>>>4,S=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,F=t[26]<<25|t[27]>>>7,z=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,M=t[37]<<21|t[36]>>>11,Y=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,E=t[18]<<20|t[19]>>>12,N=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,j=t[38]<<8|t[39]>>>24,H=t[39]<<8|t[38]>>>24,k=t[48]<<14|t[49]>>>18,x=t[49]<<14|t[48]>>>18,t[0]=m^~v&b,t[1]=g^~y&w,t[10]=A^~E&P,t[11]=S^~N&T,t[20]=B^~L&F,t[21]=D^~U&z,t[30]=q^~V&Z,t[31]=K^~W&J,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=v^~b&_,t[3]=y^~w&M,t[12]=E^~P&I,t[13]=N^~T&R,t[22]=L^~F&j,t[23]=U^~z&H,t[32]=V^~Z&X,t[33]=W^~J&Q,t[42]=nt^~ot&at,t[43]=it^~st&ut,t[4]=b^~_&k,t[5]=w^~M&x,t[14]=P^~I&C,t[15]=T^~R&O,t[24]=F^~j&$,t[25]=z^~H&G,t[34]=Z^~X&Y,t[35]=J^~Q&tt,t[44]=ot^~at&ht,t[45]=st^~ut<,t[6]=_^~k&m,t[7]=M^~x&g,t[16]=I^~C&A,t[17]=R^~O&S,t[26]=j^~$&B,t[27]=H^~G&D,t[36]=X^~Y&q,t[37]=Q^~tt&K,t[46]=at^~ht&et,t[47]=ut^~lt&rt,t[8]=k^~m&v,t[9]=x^~g&y,t[18]=C^~A&E,t[19]=O^~S&N,t[28]=$^~B&L,t[29]=G^~D&U,t[38]=Y^~q&V,t[39]=tt^~K&W,t[48]=ht^~et&nt,t[49]=lt^~rt&it,t[0]^=a[n],t[1]^=a[n+1]};if(i)e.exports=p;else for(g=0;g<m.length;++g)n[m[g]]=p[m[g]]}()}).call(this,t("_process"),void 0!==Y?Y:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:42}],41:[function(t,e,r){(e.exports=function(t,e){if(!t)throw new Error(e||"Assertion failed")}).equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},{}],42:[function(t,e,r){e.exports={browser:!0}},{}],43:[function(t,e,r){(function(t){function n(t){var e=[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],r=1779033703,n=3144134277,i=1013904242,o=2773480762,s=1359893119,a=2600822924,u=528734635,h=1541459225,l=new Array(64);function c(t){for(var c=0,f=t.length;64<=f;){var d,p,m,g,v,y=r,b=n,w=i,_=o,M=s,k=a,x=u,A=h;for(p=0;p<16;p++)m=c+4*p,l[p]=(255&t[m])<<24|(255&t[m+1])<<16|(255&t[m+2])<<8|255&t[m+3];for(p=16;p<64;p++)g=((d=l[p-2])>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,v=((d=l[p-15])>>>7|d<<25)^(d>>>18|d<<14)^d>>>3,l[p]=(g+l[p-7]|0)+(v+l[p-16]|0)|0;for(p=0;p<64;p++)g=(((M>>>6|M<<26)^(M>>>11|M<<21)^(M>>>25|M<<7))+(M&k^~M&x)|0)+(A+(e[p]+l[p]|0)|0)|0,v=((y>>>2|y<<30)^(y>>>13|y<<19)^(y>>>22|y<<10))+(y&b^y&w^b&w)|0,A=x,x=k,k=M,M=_+g|0,_=w,w=b,b=y,y=g+v|0;r=r+y|0,n=n+b|0,i=i+w|0,o=o+_|0,s=s+M|0,a=a+k|0,u=u+x|0,h=h+A|0,c+=64,f-=64}}c(t);var f,d=t.length%64,p=t.length/536870912|0,m=t.length<<3,g=d<56?56:120,v=t.slice(t.length-d,t.length);for(v.push(128),f=1+d;f<g;f++)v.push(0);return v.push(p>>>24&255),v.push(p>>>16&255),v.push(p>>>8&255),v.push(p>>>0&255),v.push(m>>>24&255),v.push(m>>>16&255),v.push(m>>>8&255),v.push(m>>>0&255),c(v),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255,h>>>24&255,h>>>16&255,h>>>8&255,h>>>0&255]}function i(t,e,r){var i;t=t.length<=64?t:n(t);var o=64+e.length+4,s=new Array(o),a=new Array(64),u=[];for(i=0;i<64;i++)s[i]=54;for(i=0;i<t.length;i++)s[i]^=t[i];for(i=0;i<e.length;i++)s[64+i]=e[i];for(i=o-4;i<o;i++)s[i]=0;for(i=0;i<64;i++)a[i]=92;for(i=0;i<t.length;i++)a[i]^=t[i];function h(){for(var t=o-1;o-4<=t;t--){if(s[t]++,s[t]<=255)return;s[t]=0}}for(;32<=r;)h(),u=u.concat(n(a.concat(n(s)))),r-=32;return 0<r&&(h(),u=u.concat(n(a.concat(n(s))).slice(0,r))),u}function o(t,e,r,n,i){var o;for(h(t,16*(2*r-1),i,0,16),o=0;o<2*r;o++)u(t,16*o,i,16),a(i,n),h(i,0,t,e+16*o,16);for(o=0;o<r;o++)h(t,e+2*o*16,t,16*o,16);for(o=0;o<r;o++)h(t,e+16*(2*o+1),t,16*(o+r),16)}function s(t,e){return t<<e|t>>>32-e}function a(t,e){h(t,0,e,0,16);for(var r=8;0<r;r-=2)e[4]^=s(e[0]+e[12],7),e[8]^=s(e[4]+e[0],9),e[12]^=s(e[8]+e[4],13),e[0]^=s(e[12]+e[8],18),e[9]^=s(e[5]+e[1],7),e[13]^=s(e[9]+e[5],9),e[1]^=s(e[13]+e[9],13),e[5]^=s(e[1]+e[13],18),e[14]^=s(e[10]+e[6],7),e[2]^=s(e[14]+e[10],9),e[6]^=s(e[2]+e[14],13),e[10]^=s(e[6]+e[2],18),e[3]^=s(e[15]+e[11],7),e[7]^=s(e[3]+e[15],9),e[11]^=s(e[7]+e[3],13),e[15]^=s(e[11]+e[7],18),e[1]^=s(e[0]+e[3],7),e[2]^=s(e[1]+e[0],9),e[3]^=s(e[2]+e[1],13),e[0]^=s(e[3]+e[2],18),e[6]^=s(e[5]+e[4],7),e[7]^=s(e[6]+e[5],9),e[4]^=s(e[7]+e[6],13),e[5]^=s(e[4]+e[7],18),e[11]^=s(e[10]+e[9],7),e[8]^=s(e[11]+e[10],9),e[9]^=s(e[8]+e[11],13),e[10]^=s(e[9]+e[8],18),e[12]^=s(e[15]+e[14],7),e[13]^=s(e[12]+e[15],9),e[14]^=s(e[13]+e[12],13),e[15]^=s(e[14]+e[13],18);for(r=0;r<16;++r)t[r]+=e[r]}function u(t,e,r,n){for(var i=0;i<n;i++)r[i]^=t[e+i]}function h(t,e,r,n,i){for(;i--;)r[n++]=t[e++]}function l(t){if(!t||"number"!=typeof t.length)return!1;for(var e=0;e<t.length;e++){if("number"!=typeof t[e])return!1;var r=parseInt(t[e]);if(r!=t[e]||r<0||256<=r)return!1}return!0}function c(t,e){var r=parseInt(t);if(t!=r)throw new Error("invalid "+e);return r}function f(e,r,n,s,a,f,d){if(!d)throw new Error("missing callback");if(n=c(n,"N"),s=c(s,"r"),a=c(a,"p"),f=c(f,"dkLen"),0===n||0!=(n&n-1))throw new Error("N must be power of 2");if(p/128/s<n)throw new Error("N too large");if(p/128/a<s)throw new Error("r too large");if(!l(e))throw new Error("password must be an array or buffer");if(e=Array.prototype.slice.call(e),!l(r))throw new Error("salt must be an array or buffer");r=Array.prototype.slice.call(r);for(var m=i(e,r,128*a*s),g=new Uint32Array(32*a*s),v=0;v<g.length;v++){var y=4*v;g[v]=(255&m[3+y])<<24|(255&m[2+y])<<16|(255&m[1+y])<<8|(255&m[0+y])<<0}var b,w,_=new Uint32Array(64*s),M=new Uint32Array(32*s*n),k=32*s,x=new Uint32Array(16),A=new Uint32Array(16),S=a*n*2,E=0,N=null,P=!1,T=0,I=0,R=parseInt(1e3/s),C=void 0!==t?t:setTimeout,O=function(){if(P)return d(new Error("cancelled"),E/S);switch(T){case 0:h(g,w=32*I*s,_,0,k),T=1,b=0;case 1:R<(r=n-b)&&(r=R);for(var t=0;t<r;t++)h(_,0,M,(b+t)*k,k),o(_,k,s,x,A);if(b+=r,E+=r,(l=parseInt(1e3*E/S))!==N){if(P=d(null,E/S))break;N=l}if(b<n)break;b=0,T=2;case 2:var r,l;for(R<(r=n-b)&&(r=R),t=0;t<r;t++){var c=_[16*(2*s-1)]&n-1;u(M,c*k,_,k),o(_,k,s,x,A)}if(b+=r,E+=r,(l=parseInt(1e3*E/S))!==N){if(P=d(null,E/S))break;N=l}if(b<n)break;if(h(_,0,g,w,k),++I<a){T=0;break}for(m=[],t=0;t<g.length;t++)m.push(g[t]>>0&255),m.push(g[t]>>8&255),m.push(g[t]>>16&255),m.push(g[t]>>24&255);var p=i(e,m,f);return d(null,1,p)}C(O)};O()}var d,p;d=this,p=2147483647,void 0!==r?e.exports=f:d&&(d.scrypt&&(d._scrypt=d.scrypt),d.scrypt=f)}).call(this,t("timers").setImmediate)},{timers:45}],44:[function(t,e,r){(function(t,e,r){!function(e,r){if(!e.setImmediate){var n,i,o,s,a=1,u={},h=!1,l=e.document,c=Object.getPrototypeOf&&Object.getPrototypeOf(e);c=c&&c.setTimeout?c:e,n="[object process]"==={}.toString.call(e.process)?function(){var e=f(arguments);return t.nextTick(d(p,e)),e}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?(s="setImmediate$"+Math.random()+"$",e.addEventListener?e.addEventListener("message",g,!1):e.attachEvent("onmessage",g),function(){var t=f(arguments);return e.postMessage(s+t,"*"),t}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){p(t.data)},function(){var t=f(arguments);return o.port2.postMessage(t),t}):l&&"onreadystatechange"in l.createElement("script")?(i=l.documentElement,function(){var t=f(arguments),e=l.createElement("script");return e.onreadystatechange=function(){p(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e),t}):function(){var t=f(arguments);return setTimeout(d(p,t),0),t},c.setImmediate=n,c.clearImmediate=m}function f(t){return u[a]=d.apply(r,t),a++}function d(t){var e=[].slice.call(arguments,1);return function(){"function"==typeof t?t.apply(r,e):new Function(""+t)()}}function p(t){if(h)setTimeout(d(p,t),0);else{var e=u[t];if(e){h=!0;try{e()}finally{m(t),h=!1}}}}function m(t){delete u[t]}function g(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&p(+t.data.slice(s.length))}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,t("_process"),void 0!==Y?Y:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("timers").clearImmediate)},{_process:42,timers:45}],45:[function(t,e,r){(function(t){e.exports={setImmediate:t.setImmediate}}).call(this,void 0!==Y?Y:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],46:[function(t,e,r){(function(t){var r;if(t.crypto&&crypto.getRandomValues){var n=new Uint8Array(16);r=function(){return crypto.getRandomValues(n),n}}if(!r){var i=new Array(16);r=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),i[e]=t>>>((3&e)<<3)&255;return i}}e.exports=r}).call(this,void 0!==Y?Y:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],47:[function(t,e,r){for(var n=t("./rng"),i=[],o={},s=0;s<256;s++)i[s]=(s+256).toString(16).substr(1),o[i[s]]=s;function a(t,e){var r=e||0,n=i;return n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]}var u=n(),h=[1|u[0],u[1],u[2],u[3],u[4],u[5]],l=16383&(u[6]<<8|u[7]),c=0,f=0;function d(t,e,r){var i=e&&r||0;"string"==typeof t&&(e="binary"==t?new Array(16):null,t=null);var o=(t=t||{}).random||(t.rng||n)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e)for(var s=0;s<16;s++)e[i+s]=o[s];return e||a(o)}var p=d;p.v1=function(t,e,r){var n=e&&r||0,i=e||[],o=void 0!==(t=t||{}).clockseq?t.clockseq:l,s=void 0!==t.msecs?t.msecs:(new Date).getTime(),u=void 0!==t.nsecs?t.nsecs:f+1,d=s-c+(u-f)/1e4;if(d<0&&void 0===t.clockseq&&(o=o+1&16383),(d<0||c<s)&&void 0===t.nsecs&&(u=0),1e4<=u)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");c=s,l=o;var p=(1e4*(268435455&(s+=122192928e5))+(f=u))%4294967296;i[n++]=p>>>24&255,i[n++]=p>>>16&255,i[n++]=p>>>8&255,i[n++]=255&p;var m=s/4294967296*1e4&268435455;i[n++]=m>>>8&255,i[n++]=255&m,i[n++]=m>>>24&15|16,i[n++]=m>>>16&255,i[n++]=o>>>8|128,i[n++]=255&o;for(var g=t.node||h,v=0;v<6;v++)i[n+v]=g[v];return e||a(i)},p.v4=d,p.parse=function(t,e,r){var n=e&&r||0,i=0;for(e=e||[],t.toLowerCase().replace(/[0-9a-f]{2}/g,(function(t){i<16&&(e[n+i++]=o[t])}));i<16;)e[n+i++]=0;return e},p.unparse=a,e.exports=p},{"./rng":46}],48:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0});try{e.exports.XMLHttpRequest=XMLHttpRequest}catch(t){console.log("Warning: XMLHttpRequest is not defined"),e.exports.XMLHttpRequest=null}},{}],49:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0});var n=t("../utils/properties"),i=(o.isProvider=function(t){return n.isType(t,"Provider")},o);function o(){n.setType(this,"Provider")}r.Provider=i},{"../utils/properties":73}],50:[function(t,e,r){var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var s=t("../utils/address"),a=t("../utils/bignumber"),u=t("../utils/bytes"),h=t("../constants"),l=t("../utils/hash"),c=t("../utils/networks"),f=t("../utils/properties"),d=t("../utils/rlp"),p=t("../utils/transaction"),m=t("../utils/utf8"),g=t("../utils/web"),v=o(t("../errors")),y=t("./abstract-provider");function b(t,e){var r={};for(var n in t)try{var i=t[n](e[n]);void 0!==i&&(r[n]=i)}catch(t){throw t.checkKey=n,t.checkValue=e[n],t}return r}function w(t,e){return function(r){return null==r?e:t(r)}}function _(t){return function(e){if(!Array.isArray(e))throw new Error("not an array");var r=[];return e.forEach((function(e){r.push(t(e))})),r}}function M(t,e){return"string"==typeof t&&(e||"0x"===t.substring(0,2)||(t="0x"+t),32===u.hexDataLength(t))?t.toLowerCase():(v.throwError("invalid hash",v.INVALID_ARGUMENT,{arg:"hash",value:t}),null)}function k(t){return a.bigNumberify(t).toNumber()}function x(t){if(!u.isHexString(t))throw new Error("invalid uint256");for(;t.length<66;)t="0x0"+t.substring(2);return t}function A(t){if(null==t)return"latest";if("earliest"===t)return"0x0";if("latest"===t||"pending"===t)return t;if("number"==typeof t)return u.hexStripZeros(u.hexlify(t));if(u.isHexString(t))return u.hexStripZeros(t);throw new Error("invalid blockTag")}var S={hash:M,blockHash:w(M,null),blockNumber:w(k,null),transactionIndex:w(k,null),confirmations:w(k,null),from:s.getAddress,gasPrice:a.bigNumberify,gasLimit:a.bigNumberify,to:w(s.getAddress,null),value:a.bigNumberify,nonce:k,data:u.hexlify,r:w(x),s:w(x),v:w(k),creates:w(s.getAddress,null),raw:w(u.hexlify)};function E(t){if(null!=t.gas&&null==t.gasLimit&&(t.gasLimit=t.gas),t.to&&a.bigNumberify(t.to).isZero()&&(t.to="0x0000000000000000000000000000000000000000"),null!=t.input&&null==t.data&&(t.data=t.input),null==t.to&&null==t.creates&&(t.creates=s.getContractAddress(t)),!t.raw&&t.v&&t.r&&t.s){var e=[u.stripZeros(u.hexlify(t.nonce)),u.stripZeros(u.hexlify(t.gasPrice)),u.stripZeros(u.hexlify(t.gasLimit)),t.to||"0x",u.stripZeros(u.hexlify(t.value||"0x")),u.hexlify(t.data||"0x"),u.stripZeros(u.hexlify(t.v||"0x")),u.stripZeros(u.hexlify(t.r)),u.stripZeros(u.hexlify(t.s))];t.raw=d.encode(e)}var r=b(S,t),n=t.networkId;return null!=t.chainId&&null==n&&null==r.v&&(n=t.chainId),u.isHexString(n)&&(n=a.bigNumberify(n).toNumber()),"number"!=typeof n&&null!=r.v&&((n=(r.v-35)/2)<0&&(n=0),n=parseInt(n)),"number"!=typeof n&&(n=0),r.networkId=n,r.blockHash&&"x"===r.blockHash.replace(/0/g,"")&&(r.blockHash=null),r}var N={hash:M,parentHash:M,number:k,timestamp:k,nonce:w(u.hexlify),difficulty:function(t){var e=a.bigNumberify(t);try{return e.toNumber()}catch(t){}return null},gasLimit:a.bigNumberify,gasUsed:a.bigNumberify,miner:s.getAddress,extraData:u.hexlify,transactions:w(_(M))},P=f.shallowCopy(N);function T(t,e){return null!=t.author&&null==t.miner&&(t.miner=t.author),b(e?P:N,t)}P.transactions=w(_(E));var I={from:w(s.getAddress),nonce:w(k),gasLimit:w(a.bigNumberify),gasPrice:w(a.bigNumberify),to:w(s.getAddress),value:w(a.bigNumberify),data:w(u.hexlify)};function R(t){return b(I,t)}var C={transactionLogIndex:w(k),transactionIndex:k,blockNumber:k,transactionHash:M,address:s.getAddress,topics:_(M),data:u.hexlify,logIndex:k,blockHash:M},O={to:w(s.getAddress,null),from:w(s.getAddress,null),contractAddress:w(s.getAddress,null),transactionIndex:k,root:w(M),gasUsed:a.bigNumberify,logsBloom:w(u.hexlify),blockHash:M,transactionHash:M,logs:_((function(t){return b(C,t)})),blockNumber:k,confirmations:w(k,null),cumulativeGasUsed:a.bigNumberify,status:w(k)};function B(t){return Array.isArray(t)?t.forEach((function(t){B(t)})):null!=t&&M(t),t}var D,L={fromBlock:w(A,void 0),toBlock:w(A,void 0),address:w(s.getAddress,void 0),topics:w(B,void 0)},U={blockHash:w(M,void 0),address:w(s.getAddress,void 0),topics:w(B,void 0)},F={blockNumber:w(k),blockHash:w(M),transactionIndex:k,removed:w((function(t){if("boolean"==typeof t)return t;if("string"==typeof t){if("true"===t)return!0;if("false"===t)return!1}throw new Error("invaid boolean - "+t)})),address:s.getAddress,data:(D=u.hexlify,function(t){return t?D(t):"0x"}),topics:_(M),transactionHash:M,logIndex:k};function z(t){return b(F,t)}function j(t){return t.map((function(t){return"string"==typeof t?t:Array.isArray(t)?(t.forEach((function(t){null!==t&&32!==u.hexDataLength(t)&&v.throwError("invalid topic",v.INVALID_ARGUMENT,{argument:"topic",value:t})})),t.join(",")):null===t?"":v.throwError("invalid topic value",v.INVALID_ARGUMENT,{argument:"topic",value:t})})).join("&")}function H(t){if("string"==typeof t){if(20===u.hexDataLength(t))return"address:"+s.getAddress(t);if(t=t.toLowerCase(),32===u.hexDataLength(t))return"tx:"+t;if(-1===t.indexOf(":"))return t}else{if(Array.isArray(t))return"filter::"+j(t);if(t&&"object"==typeof t)return"filter:"+(t.address||"")+":"+j(t.topics||[])}throw new Error("invalid event - "+t)}function $(){return(new Date).getTime()}var G,q=(i(K,G=y.Provider),K.prototype._doPoll=function(){var t=this;this.getBlockNumber().then((function(e){if(t._setFastBlockNumber(e),e!==t._lastBlockNumber){-2===t._emitted.block&&(t._emitted.block=e-1);for(var r=t._emitted.block+1;r<=e;r++)t.emit("block",r);t._emitted.block!==e&&(t._emitted.block=e,Object.keys(t._emitted).forEach((function(r){if("block"!==r){var n=t._emitted[r];"pending"!==n&&12<e-n&&delete t._emitted[r]}}))),-2===t._lastBlockNumber&&(t._lastBlockNumber=e-1);var n={},i={};return t._events.forEach((function(t){i[t.tag]=!0})),Object.keys(i).forEach((function(r){var i=r.split(":");switch(i[0]){case"tx":var o=i[1];t.getTransactionReceipt(o).then((function(e){return e&&null!=e.blockNumber&&(t._emitted["t:"+o]=e.blockNumber,t.emit(o,e)),null})).catch((function(e){t.emit("error",e)}));break;case"address":var s=i[1];t._balances[s]&&(n[s]=t._balances[s]),t.getBalance(s,"latest").then((function(e){var r=t._balances[s];if(!r||!e.eq(r))return t._balances[s]=e,t.emit(s,e),null})).catch((function(e){t.emit("error",e)}));break;case"filter":var a=function(t){return t.split(/&/g).map((function(t){var e=t.split(",");return 1===e.length?""===e[0]?null:t:e.map((function(t){return""===t?null:t}))}))}(i[2]),u={address:i[1],fromBlock:t._lastBlockNumber+1,toBlock:e,topics:a};u.address||delete u.address,t.getLogs(u).then((function(e){if(0!==e.length)return e.forEach((function(e){t._emitted["b:"+e.blockHash]=e.blockNumber,t._emitted["t:"+e.transactionHash]=e.blockNumber,t.emit(u,e)})),null})).catch((function(e){t.emit("error",e)}))}})),t._lastBlockNumber=e,t._balances=n,null}})).catch((function(t){})),this.doPoll()},K.prototype.resetEventsBlock=function(t){this._lastBlockNumber=t-1,this.polling&&this._doPoll()},Object.defineProperty(K.prototype,"network",{get:function(){return this._network},enumerable:!0,configurable:!0}),K.prototype.getNetwork=function(){return this.ready},Object.defineProperty(K.prototype,"blockNumber",{get:function(){return this._fastBlockNumber},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"polling",{get:function(){return null!=this._poller},set:function(t){var e=this;setTimeout((function(){t&&!e._poller?e._poller=setInterval(e._doPoll.bind(e),e.pollingInterval):!t&&e._poller&&(clearInterval(e._poller),e._poller=null)}),0)},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"pollingInterval",{get:function(){return this._pollingInterval},set:function(t){var e=this;if("number"!=typeof t||t<=0||parseInt(String(t))!=t)throw new Error("invalid polling interval");this._pollingInterval=t,this._poller&&(clearInterval(this._poller),this._poller=setInterval((function(){e._doPoll()}),this._pollingInterval))},enumerable:!0,configurable:!0}),K.prototype._getFastBlockNumber=function(){var t=this,e=$();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((function(e){return(null==t._fastBlockNumber||e>t._fastBlockNumber)&&(t._fastBlockNumber=e),t._fastBlockNumber}))),this._fastBlockNumberPromise},K.prototype._setFastBlockNumber=function(t){null!=this._fastBlockNumber&&t<this._fastBlockNumber||(this._fastQueryDate=$(),(null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t,this._fastBlockNumberPromise=Promise.resolve(t)))},K.prototype.waitForTransaction=function(t,e){var r=this;return null==e&&(e=1),this.getTransactionReceipt(t).then((function(n){return 0===e||n&&n.confirmations>=e?n:new Promise((function(n){var i=function(o){o.confirmations<e||(r.removeListener(t,i),n(o))};r.on(t,i)}))}))},K.prototype.getBlockNumber=function(){var t=this;return this.ready.then((function(){return t.perform("getBlockNumber",{}).then((function(e){var r=parseInt(e);if(r!=e)throw new Error("invalid response - getBlockNumber");return t._setFastBlockNumber(r),r}))}))},K.prototype.getGasPrice=function(){var t=this;return this.ready.then((function(){return t.perform("getGasPrice",{}).then((function(t){return a.bigNumberify(t)}))}))},K.prototype.getBalance=function(t,e){var r=this;return this.ready.then((function(){return f.resolveProperties({addressOrName:t,blockTag:e}).then((function(t){var e=t.addressOrName,n=t.blockTag;return r._getAddress(e).then((function(t){var e={address:t,blockTag:A(n)};return r.perform("getBalance",e).then((function(t){return a.bigNumberify(t)}))}))}))}))},K.prototype.getTransactionCount=function(t,e){var r=this;return this.ready.then((function(){return f.resolveProperties({addressOrName:t,blockTag:e}).then((function(t){var e=t.addressOrName,n=t.blockTag;return r._getAddress(e).then((function(t){var e={address:t,blockTag:A(n)};return r.perform("getTransactionCount",e).then((function(t){return a.bigNumberify(t).toNumber()}))}))}))}))},K.prototype.getCode=function(t,e){var r=this;return this.ready.then((function(){return f.resolveProperties({addressOrName:t,blockTag:e}).then((function(t){var e=t.addressOrName,n=t.blockTag;return r._getAddress(e).then((function(t){var e={address:t,blockTag:A(n)};return r.perform("getCode",e).then((function(t){return u.hexlify(t)}))}))}))}))},K.prototype.getStorageAt=function(t,e,r){var n=this;return this.ready.then((function(){return f.resolveProperties({addressOrName:t,position:e,blockTag:r}).then((function(t){var e=t.addressOrName,r=t.position,i=t.blockTag;return n._getAddress(e).then((function(t){var e={address:t,blockTag:A(i),position:u.hexStripZeros(u.hexlify(r))};return n.perform("getStorageAt",e).then((function(t){return u.hexlify(t)}))}))}))}))},K.prototype.sendTransaction=function(t){var e=this;return this.ready.then((function(){return f.resolveProperties({signedTransaction:t}).then((function(t){var r=t.signedTransaction,n={signedTransaction:u.hexlify(r)};return e.perform("sendTransaction",n).then((function(t){return e._wrapTransaction(p.parse(r),t)}),(function(t){throw t.transaction=p.parse(r),t.transaction.hash&&(t.transactionHash=t.transaction.hash),t}))}))}))},K.prototype._wrapTransaction=function(t,e){var r=this;if(null!=e&&32!==u.hexDataLength(e))throw new Error("invalid response - sendTransaction");var n=t;return null!=e&&t.hash!==e&&v.throwError("Transaction hash mismatch from Provider.sendTransaction.",v.UNKNOWN_ERROR,{expectedHash:t.hash,returnedHash:e}),n.wait=function(e){return 0!==e&&(r._emitted["t:"+t.hash]="pending"),r.waitForTransaction(t.hash,e).then((function(n){return null==n&&0===e?null:(r._emitted["t:"+t.hash]=n.blockNumber,0===n.status&&v.throwError("transaction failed",v.CALL_EXCEPTION,{transactionHash:t.hash,transaction:t}),n)}))},n},K.prototype.call=function(t,e){var r=this,n=f.shallowCopy(t);return this.ready.then((function(){return f.resolveProperties({blockTag:e,tx:n}).then((function(t){var e=t.blockTag,n=t.tx;return r._resolveNames(n,["to","from"]).then((function(t){var n={blockTag:A(e),transaction:R(t)};return r.perform("call",n).then((function(t){return u.hexlify(t)}))}))}))}))},K.prototype.estimateGas=function(t){var e=this,r={to:t.to,from:t.from,data:t.data,gasPrice:t.gasPrice,value:t.value};return this.ready.then((function(){return f.resolveProperties(r).then((function(t){return e._resolveNames(t,["to","from"]).then((function(t){var r={transaction:R(t)};return e.perform("estimateGas",r).then((function(t){return a.bigNumberify(t)}))}))}))}))},K.prototype.getBlock=function(t,e){var r=this;return this.ready.then((function(){return f.resolveProperties({blockHashOrBlockTag:t}).then((function(t){var n=t.blockHashOrBlockTag;try{var i=u.hexlify(n);if(32===u.hexDataLength(i))return g.poll((function(){return r.perform("getBlock",{blockHash:i,includeTransactions:!!e}).then((function(t){return null==t?null==r._emitted["b:"+i]?null:void 0:T(t,e)}))}),{onceBlock:r})}catch(t){}try{var o=-128,s=A(n);return u.isHexString(s)&&(o=parseInt(s.substring(2),16)),g.poll((function(){return r.perform("getBlock",{blockTag:s,includeTransactions:!!e}).then((function(t){return null!=t?T(t,e):o<=r._emitted.block?void 0:null}))}),{onceBlock:r})}catch(t){}throw new Error("invalid block hash or block tag")}))}))},K.prototype.getTransaction=function(t){var e=this;return this.ready.then((function(){return f.resolveProperties({transactionHash:t}).then((function(t){var r=t.transactionHash,n={transactionHash:M(r,!0)};return g.poll((function(){return e.perform("getTransaction",n).then((function(t){if(null==t)return null==e._emitted["t:"+r]?null:void 0;var n=K.checkTransactionResponse(t);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations)return e._getFastBlockNumber().then((function(t){var r=t-n.blockNumber+1;return r<=0&&(r=1),n.confirmations=r,e._wrapTransaction(n)}));return e._wrapTransaction(n)}))}),{onceBlock:e})}))}))},K.prototype.getTransactionReceipt=function(t){var e=this;return this.ready.then((function(){return f.resolveProperties({transactionHash:t}).then((function(t){var r=t.transactionHash,n={transactionHash:M(r,!0)};return g.poll((function(){return e.perform("getTransactionReceipt",n).then((function(t){if(null==t)return null==e._emitted["t:"+r]?null:void 0;if(null!=t.blockHash){var n=function(t){var e=b(O,t);return e.logs.forEach((function(t,e){null==t.transactionLogIndex&&(t.transactionLogIndex=e)})),null!=t.status&&(e.byzantium=!0),e}(t);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations)return e._getFastBlockNumber().then((function(t){var e=t-n.blockNumber+1;return e<=0&&(e=1),n.confirmations=e,n}));return n}}))}),{onceBlock:e})}))}))},K.prototype.getLogs=function(t){var e=this;return this.ready.then((function(){return f.resolveProperties(t).then((function(t){return e._resolveNames(t,["address"]).then((function(t){var r={filter:function(t){return t&&t.blockHash?b(U,t):b(L,t)}(t)};return e.perform("getLogs",r).then((function(t){return _(z)(t)}))}))}))}))},K.prototype.getEtherPrice=function(){var t=this;return this.ready.then((function(){return t.perform("getEtherPrice",{}).then((function(t){return t}))}))},K.prototype._getAddress=function(t){return this.resolveName(t).then((function(e){return null==e&&v.throwError("ENS name not configured",v.UNSUPPORTED_OPERATION,{operation:"resolveName("+JSON.stringify(t)+")"}),e}))},K.prototype._resolveNames=function(t,e){var r=[],n=f.shallowCopy(t);return e.forEach((function(t){null!=n[t]&&r.push(this._getAddress(n[t]).then((function(e){n[t]=e})))}),this),Promise.all(r).then((function(){return n}))},K.prototype._getResolver=function(t){var e=this;return this.getNetwork().then((function(r){r.ensAddress||v.throwError("network does not support ENS",v.UNSUPPORTED_OPERATION,{operation:"ENS",network:r.name});var n="0x0178b8bf"+l.namehash(t).substring(2),i={to:r.ensAddress,data:n};return e.call(i).then((function(t){if(32!==u.hexDataLength(t))return null;var e=s.getAddress(u.hexDataSlice(t,12));return e===h.AddressZero?null:e}))}))},K.prototype.resolveName=function(t){var e=this;if(t instanceof Promise)return t.then((function(t){return e.resolveName(t)}));try{return Promise.resolve(s.getAddress(t))}catch(t){}var r=this,n=l.namehash(t);return this._getResolver(t).then((function(t){if(null==t)return null;var e={to:t,data:"0x3b3b57de"+n.substring(2)};return r.call(e)})).then((function(t){if(32!==u.hexDataLength(t))return null;var e=s.getAddress(u.hexDataSlice(t,12));return e===h.AddressZero?null:e}))},K.prototype.lookupAddress=function(t){var e=this;if(t instanceof Promise)return t.then((function(t){return e.lookupAddress(t)}));var r=(t=s.getAddress(t)).substring(2)+".addr.reverse",n=l.namehash(r),i=this;return this._getResolver(r).then((function(t){if(!t)return null;var e={to:t,data:"0x691f3431"+n.substring(2)};return i.call(e)})).then((function(e){if(null==e)return null;if((e=e.substring(2)).length<64)return null;if((e=e.substring(64)).length<64)return null;var r=a.bigNumberify("0x"+e.substring(0,64)).toNumber();if(2*r>(e=e.substring(64)).length)return null;var n=m.toUtf8String("0x"+e.substring(0,2*r));return i.resolveName(n).then((function(e){return e!=t?null:n}))}))},K.checkTransactionResponse=function(t){return E(t)},K.prototype.doPoll=function(){},K.prototype.perform=function(t,e){return v.throwError(t+" not implemented",v.NOT_IMPLEMENTED,{operation:t}),null},K.prototype._startPending=function(){v.warn("WARNING: this provider does not support pending events")},K.prototype._stopPending=function(){},K.prototype._addEventListener=function(t,e,r){this._events.push({tag:H(t),listener:e,once:r}),"pending"===t&&this._startPending(),this.polling=!0},K.prototype.on=function(t,e){return this._addEventListener(t,e,!1),this},K.prototype.once=function(t,e){return this._addEventListener(t,e,!0),this},K.prototype.addEventListener=function(t,e){return this.on(t,e)},K.prototype.emit=function(t){for(var e=this,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var i=!1,o=H(t);return this._events=this._events.filter((function(t){return t.tag!==o||(setTimeout((function(){t.listener.apply(e,r)}),0),i=!0,!t.once)})),0===this.listenerCount()&&(this.polling=!1),i},K.prototype.listenerCount=function(t){if(!t)return this._events.length;var e=H(t);return this._events.filter((function(t){return t.tag===e})).length},K.prototype.listeners=function(t){var e=H(t);return this._events.filter((function(t){return t.tag===e})).map((function(t){return t.listener}))},K.prototype.removeAllListeners=function(t){if(null==t)this._events=[],this._stopPending();else{var e=H(t);this._events=this._events.filter((function(t){return t.tag!==e})),"pending"===t&&this._stopPending()}return 0===this._events.length&&(this.polling=!1),this},K.prototype.removeListener=function(t,e){var r=!1,n=H(t);return this._events=this._events.filter((function(t){return t.tag!==n||t.listener!=e||!!r||!(r=!0)})),"pending"===t&&0===this.listenerCount("pending")&&this._stopPending(),0===this.listenerCount()&&(this.polling=!1),this},K);function K(t){var e=G.call(this)||this;if(v.checkNew(e,y.Provider),t instanceof Promise)f.defineReadOnly(e,"ready",t.then((function(t){return f.defineReadOnly(e,"_network",t),t}))),e.ready.catch((function(t){}));else{var r=c.getNetwork(null==t?"homestead":t);r?(f.defineReadOnly(e,"_network",r),f.defineReadOnly(e,"ready",Promise.resolve(e._network))):v.throwError("invalid network",v.INVALID_ARGUMENT,{arg:"network",value:t})}return e._lastBlockNumber=-2,e._balances={},e._events=[],e._pollingInterval=4e3,e._emitted={block:-2},e._fastQueryDate=0,e}r.BaseProvider=q,f.defineReadOnly(y.Provider,"inherits",f.inheritable(y.Provider))},{"../constants":3,"../errors":5,"../utils/address":59,"../utils/bignumber":62,"../utils/bytes":63,"../utils/hash":64,"../utils/networks":71,"../utils/properties":73,"../utils/rlp":75,"../utils/transaction":82,"../utils/utf8":84,"../utils/web":85,"./abstract-provider":49}],51:[function(t,e,r){var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var s=t("./base-provider"),a=t("../utils/bytes"),u=t("../utils/properties"),h=t("../utils/web"),l=o(t("../errors"));function c(t){var e=[];for(var r in t)if(null!=t[r]){var n=a.hexlify(t[r]);!{gasLimit:!0,gasPrice:!0,nonce:!0,value:!0}[r]||(n=a.hexStripZeros(n)),e.push(r+"="+n)}return e.join("&")}function f(t){if(0==t.status&&("No records found"===t.message||"No transactions found"===t.message))return t.result;if(1==t.status&&"OK"==t.message)return t.result;var e=new Error("invalid response");throw e.result=JSON.stringify(t),e}function d(t){if("2.0"!=t.jsonrpc)throw(e=new Error("invalid response")).result=JSON.stringify(t),e;if(t.error){var e=new Error(t.error.message||"unknown error");throw t.error.code&&(e.code=t.error.code),t.error.data&&(e.data=t.error.data),e}return t.result}function p(t){if("pending"===t)throw new Error("pending not supported");return"latest"===t?t:parseInt(t.substring(2),16)}var m,g=(i(v,m=s.BaseProvider),v.prototype.perform=function(t,e){var r=this,n=this.baseUrl,i="";function o(t,e){return h.fetchJson(t,null,e||d).then((function(e){return r.emit("debug",{action:"perform",request:t,response:e,provider:r}),e}))}switch(this.apiKey&&(i+="&apikey="+this.apiKey),t){case"getBlockNumber":return o(n+="/api?module=proxy&action=eth_blockNumber"+i);case"getGasPrice":return o(n+="/api?module=proxy&action=eth_gasPrice"+i);case"getBalance":return n+="/api?module=account&action=balance&address="+e.address,o(n+="&tag="+e.blockTag+i,f);case"getTransactionCount":return n+="/api?module=proxy&action=eth_getTransactionCount&address="+e.address,o(n+="&tag="+e.blockTag+i);case"getCode":return n+="/api?module=proxy&action=eth_getCode&address="+e.address,o(n+="&tag="+e.blockTag+i,d);case"getStorageAt":return n+="/api?module=proxy&action=eth_getStorageAt&address="+e.address,n+="&position="+e.position,o(n+="&tag="+e.blockTag+i,d);case"sendTransaction":return n+="/api?module=proxy&action=eth_sendRawTransaction&hex="+e.signedTransaction,o(n+=i).catch((function(t){throw t.responseText&&(0<=t.responseText.toLowerCase().indexOf("insufficient funds")&&l.throwError("insufficient funds",l.INSUFFICIENT_FUNDS,{}),0<=t.responseText.indexOf("same hash was already imported")&&l.throwError("nonce has already been used",l.NONCE_EXPIRED,{}),0<=t.responseText.indexOf("another transaction with same nonce")&&l.throwError("replacement fee too low",l.REPLACEMENT_UNDERPRICED,{})),t}));case"getBlock":if(e.blockTag)return n+="/api?module=proxy&action=eth_getBlockByNumber&tag="+e.blockTag,e.includeTransactions?n+="&boolean=true":n+="&boolean=false",o(n+=i);throw new Error("getBlock by blockHash not implmeneted");case"getTransaction":return n+="/api?module=proxy&action=eth_getTransactionByHash&txhash="+e.transactionHash,o(n+=i);case"getTransactionReceipt":return n+="/api?module=proxy&action=eth_getTransactionReceipt&txhash="+e.transactionHash,o(n+=i);case"call":if(n+="/api?module=proxy&action=eth_call"+(s=(s=c(e.transaction))&&"&"+s),"latest"!==e.blockTag)throw new Error("EtherscanProvider does not support blockTag for call");return o(n+=i);case"estimateGas":var s;return n+="/api?module=proxy&action=eth_estimateGas&"+(s=(s=c(e.transaction))&&"&"+s),o(n+=i);case"getLogs":n+="/api?module=logs&action=getLogs";try{if(e.filter.fromBlock&&(n+="&fromBlock="+p(e.filter.fromBlock)),e.filter.toBlock&&(n+="&toBlock="+p(e.filter.toBlock)),e.filter.blockHash)try{l.throwError("Etherscan does not support blockHash filters",l.UNSUPPORTED_OPERATION,{operation:"getLogs(blockHash)"})}catch(t){return Promise.reject(t)}if(e.filter.address&&(n+="&address="+e.filter.address),e.filter.topics&&0<e.filter.topics.length){if(1<e.filter.topics.length)throw new Error("unsupported topic format");var a=e.filter.topics[0];if("string"!=typeof a||66!==a.length)throw new Error("unsupported topic0 format");n+="&topic0="+a}}catch(t){return Promise.reject(t)}var u=this;return o(n+=i,f).then((function(t){var e={},r=Promise.resolve();return t.forEach((function(t){r=r.then((function(){return null!=t.blockHash?null:(t.blockHash=e[t.transactionHash],null==t.blockHash?u.getTransaction(t.transactionHash).then((function(r){return e[t.transactionHash]=r.blockHash,t.blockHash=r.blockHash,null})):null)}))})),r.then((function(){return t}))}));case"getEtherPrice":return"homestead"!==this.network.name?Promise.resolve(0):(n+="/api?module=stats&action=ethprice",o(n+=i,f).then((function(t){return parseFloat(t.ethusd)})))}return m.prototype.perform.call(this,t,e)},v.prototype.getHistory=function(t,e,r){var n=this,i=this.baseUrl,o="";return this.apiKey&&(o+="&apikey="+this.apiKey),null==e&&(e=0),null==r&&(r=99999999),this.resolveName(t).then((function(t){return i+="/api?module=account&action=txlist&address="+t,i+="&startblock="+e,i+="&endblock="+r,i+="&sort=asc"+o,h.fetchJson(i,null,f).then((function(t){n.emit("debug",{action:"getHistory",request:i,response:t,provider:n});var e=[];return t.forEach((function(t){["contractAddress","to"].forEach((function(e){""==t[e]&&delete t[e]})),null==t.creates&&null!=t.contractAddress&&(t.creates=t.contractAddress);var r=s.BaseProvider.checkTransactionResponse(t);t.timeStamp&&(r.timestamp=parseInt(t.timeStamp)),e.push(r)})),e}))}))},v);function v(t,e){var r=m.call(this,t)||this;l.checkNew(r,v);var n="invalid";r.network&&(n=r.network.name);var i=null;switch(n){case"homestead":i="https://api.etherscan.io";break;case"ropsten":i="https://api-ropsten.etherscan.io";break;case"rinkeby":i="https://api-rinkeby.etherscan.io";break;case"kovan":i="https://api-kovan.etherscan.io";break;case"goerli":i="https://api-goerli.etherscan.io";break;default:throw new Error("unsupported network")}return u.defineReadOnly(r,"baseUrl",i),u.defineReadOnly(r,"apiKey",e),r}r.EtherscanProvider=g},{"../errors":5,"../utils/bytes":63,"../utils/properties":73,"../utils/web":85,"./base-provider":50}],52:[function(t,e,r){var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var s=t("./base-provider"),a=o(t("../errors"));function u(t){var e=!0,r=null;return t.forEach((function(n){null!=n?null!=r?r.name===n.name&&r.chainId===n.chainId&&(r.ensAddress===n.ensAddress||null==r.ensAddress&&null==n.ensAddress)||a.throwError("provider mismatch",a.INVALID_ARGUMENT,{arg:"networks",value:t}):r=n:e=!1})),e}var h,l=(i(c,h=s.BaseProvider),Object.defineProperty(c.prototype,"providers",{get:function(){return this._providers.slice(0)},enumerable:!0,configurable:!0}),c.prototype.perform=function(t,e){var r=this.providers;return new Promise((function(n,i){var o=null;!function s(){r.length?r.shift().perform(t,e).then((function(t){return n(t)})).catch((function(t){o=o||t,setTimeout(s,0)})):i(o)}()}))},c);function c(t){var e=this;if(0===t.length)throw new Error("no providers");if(u(t.map((function(t){return t.network}))))e=h.call(this,t[0].network)||this;else{var r=Promise.all(t.map((function(t){return t.getNetwork()}))).then((function(t){return u(t)||a.throwError("getNetwork returned null",a.UNKNOWN_ERROR,{}),t[0]}));e=h.call(this,r)||this}return a.checkNew(e,c),e._providers=t.slice(0),e}r.FallbackProvider=l},{"../errors":5,"./base-provider":50}],53:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0});var n=t("./abstract-provider");r.Provider=n.Provider;var i=t("./base-provider");r.BaseProvider=i.BaseProvider;var o=t("./etherscan-provider");r.EtherscanProvider=o.EtherscanProvider;var s=t("./fallback-provider");r.FallbackProvider=s.FallbackProvider;var a=t("./ipc-provider");r.IpcProvider=a.IpcProvider;var u=t("./infura-provider");r.InfuraProvider=u.InfuraProvider;var h=t("./json-rpc-provider");r.JsonRpcProvider=h.JsonRpcProvider,r.JsonRpcSigner=h.JsonRpcSigner;var l=t("./web3-provider");r.Web3Provider=l.Web3Provider},{"./abstract-provider":49,"./base-provider":50,"./etherscan-provider":51,"./fallback-provider":52,"./infura-provider":54,"./ipc-provider":55,"./json-rpc-provider":56,"./web3-provider":57}],54:[function(t,e,r){var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var s,a=t("./json-rpc-provider"),u=t("../utils/bytes"),h=t("../utils/networks"),l=t("../utils/properties"),c=o(t("../errors")),f=(i(d,s=a.JsonRpcProvider),d.prototype._startPending=function(){c.warn("WARNING: INFURA does not support pending filters")},d.prototype.getSigner=function(t){return c.throwError("INFURA does not support signing",c.UNSUPPORTED_OPERATION,{operation:"getSigner"})},d.prototype.listAccounts=function(){return Promise.resolve([])},d);function d(t,e){var r=this,n=h.getNetwork(null==t?"homestead":t);null==e&&(e="7d0d81d0919f4f05b9ab6634be01ee73");var i=null;switch(n.name){case"homestead":i="mainnet.infura.io";break;case"ropsten":i="ropsten.infura.io";break;case"rinkeby":i="rinkeby.infura.io";break;case"goerli":i="goerli.infura.io";break;case"kovan":i="kovan.infura.io";break;default:c.throwError("unsupported network",c.INVALID_ARGUMENT,{argument:"network",value:t})}return u.isHexString("0x"+e,16)?(r=s.call(this,"https://"+i+"/v3/"+e,n)||this,l.defineReadOnly(r,"apiAccessToken",null),l.defineReadOnly(r,"projectId",e)):(c.warn("The legacy INFURA apiAccesToken API is deprecated; please upgrade to a Project ID instead (see INFURA dshboard; https://infura.io)"),r=s.call(this,"https://"+i+"/"+e,n)||this,l.defineReadOnly(r,"apiAccessToken",e),l.defineReadOnly(r,"projectId",null)),c.checkNew(r,d),r}r.InfuraProvider=f},{"../errors":5,"../utils/bytes":63,"../utils/networks":71,"../utils/properties":73,"./json-rpc-provider":56}],55:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0})},{}],56:[function(t,e,r){var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var s=t("./base-provider"),a=t("../abstract-signer"),u=o(t("../errors")),h=t("../utils/address"),l=t("../utils/bytes"),c=t("../utils/networks"),f=t("../utils/properties"),d=t("../utils/utf8"),p=t("../utils/web");function m(t){if(t.error){var e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function g(t){return t?t.toLowerCase():t}var v,y={},b=42,w=(i(_,v=a.Signer),_.prototype.getAddress=function(){var t=this;return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((function(e){return e.length<=t._index&&u.throwError("unknown account #"+t._index,u.UNSUPPORTED_OPERATION,{operation:"getAddress"}),t._address=h.getAddress(e[t._index]),t._address}))},_.prototype.getBalance=function(t){return this.provider.getBalance(this.getAddress(),t)},_.prototype.getTransactionCount=function(t){return this.provider.getTransactionCount(this.getAddress(),t)},_.prototype.sendUncheckedTransaction=function(t){var e=this;t=f.shallowCopy(t);var r=this.getAddress().then((function(t){return t&&t.toLowerCase()}));if(null==t.gasLimit){var n=f.shallowCopy(t);n.from=r,t.gasLimit=this.provider.estimateGas(n)}return Promise.all([f.resolveProperties(t),r]).then((function(t){var r=t[0],n=x.hexlifyTransaction(r);return n.from=t[1],e.provider.send("eth_sendTransaction",[n]).then((function(t){return t}),(function(t){throw t.responseText&&(0<=t.responseText.indexOf("insufficient funds")&&u.throwError("insufficient funds",u.INSUFFICIENT_FUNDS,{transaction:r}),0<=t.responseText.indexOf("nonce too low")&&u.throwError("nonce has already been used",u.NONCE_EXPIRED,{transaction:r}),0<=t.responseText.indexOf("replacement transaction underpriced")&&u.throwError("replacement fee too low",u.REPLACEMENT_UNDERPRICED,{transaction:r})),t}))}))},_.prototype.sendTransaction=function(t){var e=this;return this.sendUncheckedTransaction(t).then((function(t){return p.poll((function(){return e.provider.getTransaction(t).then((function(r){if(null!==r)return e.provider._wrapTransaction(r,t)}))}),{fastRetry:250,onceBlock:e.provider}).catch((function(e){throw e.transactionHash=t,e}))}))},_.prototype.signMessage=function(t){var e=this,r="string"==typeof t?d.toUtf8Bytes(t):t;return this.getAddress().then((function(t){return e.provider.send("eth_sign",[t.toLowerCase(),l.hexlify(r)])}))},_.prototype.unlock=function(t){var e=this.provider;return this.getAddress().then((function(r){return e.send("personal_unlockAccount",[r.toLowerCase(),t,null])}))},_);function _(t,e,r){var n=v.call(this)||this;if(u.checkNew(n,_),t!==y)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");return f.defineReadOnly(n,"provider",e),r?"string"==typeof r?f.defineReadOnly(n,"_address",h.getAddress(r)):"number"==typeof r?f.defineReadOnly(n,"_index",r):u.throwError("invalid address or index",u.INVALID_ARGUMENT,{argument:"addressOrIndex",value:r}):f.defineReadOnly(n,"_index",0),n}r.JsonRpcSigner=w;var M,k={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0},x=(i(A,M=s.BaseProvider),A.prototype.getSigner=function(t){return new w(y,this,t)},A.prototype.listAccounts=function(){return this.send("eth_accounts",[]).then((function(t){return t.map((function(t){return h.getAddress(t)}))}))},A.prototype.send=function(t,e){var r=this,n={method:t,params:e,id:b++,jsonrpc:"2.0"};return p.fetchJson(this.connection,JSON.stringify(n),m).then((function(t){return r.emit("debug",{action:"send",request:n,response:t,provider:r}),t}))},A.prototype.perform=function(t,e){switch(t){case"getBlockNumber":return this.send("eth_blockNumber",[]);case"getGasPrice":return this.send("eth_gasPrice",[]);case"getBalance":return this.send("eth_getBalance",[g(e.address),e.blockTag]);case"getTransactionCount":return this.send("eth_getTransactionCount",[g(e.address),e.blockTag]);case"getCode":return this.send("eth_getCode",[g(e.address),e.blockTag]);case"getStorageAt":return this.send("eth_getStorageAt",[g(e.address),e.position,e.blockTag]);case"sendTransaction":return this.send("eth_sendRawTransaction",[e.signedTransaction]).catch((function(t){throw t.responseText&&(0<t.responseText.indexOf("insufficient funds")&&u.throwError("insufficient funds",u.INSUFFICIENT_FUNDS,{}),0<t.responseText.indexOf("nonce too low")&&u.throwError("nonce has already been used",u.NONCE_EXPIRED,{}),0<t.responseText.indexOf("replacement transaction underpriced")&&u.throwError("replacement fee too low",u.REPLACEMENT_UNDERPRICED,{})),t}));case"getBlock":return e.blockTag?this.send("eth_getBlockByNumber",[e.blockTag,!!e.includeTransactions]):e.blockHash?this.send("eth_getBlockByHash",[e.blockHash,!!e.includeTransactions]):Promise.reject(new Error("invalid block tag or block hash"));case"getTransaction":return this.send("eth_getTransactionByHash",[e.transactionHash]);case"getTransactionReceipt":return this.send("eth_getTransactionReceipt",[e.transactionHash]);case"call":return this.send("eth_call",[A.hexlifyTransaction(e.transaction,{from:!0}),e.blockTag]);case"estimateGas":return this.send("eth_estimateGas",[A.hexlifyTransaction(e.transaction,{from:!0})]);case"getLogs":return e.filter&&null!=e.filter.address&&(e.filter.address=g(e.filter.address)),this.send("eth_getLogs",[e.filter])}return u.throwError(t+" not implemented",u.NOT_IMPLEMENTED,{operation:t}),null},A.prototype._startPending=function(){if(null==this._pendingFilter){var t=this,e=this.send("eth_newPendingTransactionFilter",[]);(this._pendingFilter=e).then((function(r){return function n(){t.send("eth_getFilterChanges",[r]).then((function(r){if(t._pendingFilter!=e)return null;var n=Promise.resolve();return r.forEach((function(e){t._emitted["t:"+e.toLowerCase()]="pending",n=n.then((function(){return t.getTransaction(e).then((function(e){return t.emit("pending",e),null}))}))})),n.then((function(){return new Promise((function(t){setTimeout((function(){t()}),1e3)}))}))})).then((function(){if(t._pendingFilter==e)return setTimeout((function(){n()}),0),null;t.send("eth_uninstallFilter",[r])})).catch((function(t){}))}(),r})).catch((function(t){}))}},A.prototype._stopPending=function(){this._pendingFilter=null},A.hexlifyTransaction=function(t,e){var r=f.shallowCopy(k);if(e)for(var n in e)e[n]&&(r[n]=!0);f.checkProperties(t,r);var i={};return["gasLimit","gasPrice","nonce","value"].forEach((function(e){if(null!=t[e]){var r=l.hexStripZeros(l.hexlify(t[e]));"gasLimit"===e&&(e="gas"),i[e]=r}})),["from","to","data"].forEach((function(e){null!=t[e]&&(i[e]=l.hexlify(t[e]))})),i},A);function A(t,e){var r=this;if("string"==typeof t&&null===e&&c.getNetwork(t)&&(e=t,t=null),e)r=M.call(this,e)||this;else{var n=new Promise((function(t,e){setTimeout((function(){r.send("net_version",[]).then((function(e){return t(c.getNetwork(parseInt(e)))})).catch((function(t){e(t)}))}))}));r=M.call(this,n)||this}return u.checkNew(r,A),t=t||"http://localhost:8545",r.connection="string"==typeof t?{url:t}:t,r}r.JsonRpcProvider=x},{"../abstract-signer":2,"../errors":5,"../utils/address":59,"../utils/bytes":63,"../utils/networks":71,"../utils/properties":73,"../utils/utf8":84,"../utils/web":85,"./base-provider":50}],57:[function(t,e,r){var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var s,a=t("./json-rpc-provider"),u=t("../utils/properties"),h=o(t("../errors")),l=42,c=(i(f,s=a.JsonRpcProvider),f.prototype.send=function(t,e){var r=this;return"eth_sign"==t&&this._web3Provider.isMetaMask&&(t="personal_sign",e=[e[1],e[0]]),new Promise((function(n,i){var o={method:t,params:e,id:l++,jsonrpc:"2.0"};r._sendAsync(o,(function(t,e){if(t)i(t);else{if(e.error){var r=new Error(e.error.message);return r.code=e.error.code,r.data=e.error.data,void i(r)}n(e.result)}}))}))},f);function f(t,e){var r=s.call(this,t.host||t.path||"",e)||this;return h.checkNew(r,f),t&&(t.sendAsync?r._sendAsync=t.sendAsync.bind(t):t.send&&(r._sendAsync=t.send.bind(t))),t&&r._sendAsync||h.throwError("invalid web3Provider",h.INVALID_ARGUMENT,{arg:"web3Provider",value:t}),u.defineReadOnly(r,"_web3Provider",t),r}r.Web3Provider=c},{"../errors":5,"../utils/properties":73,"./json-rpc-provider":56}],58:[function(t,e,r){var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var s=t("../constants"),a=o(t("../errors")),u=t("./address"),h=t("./bignumber"),l=t("./bytes"),c=t("./utf8"),f=t("./properties"),d=new RegExp(/^bytes([0-9]*)$/),p=new RegExp(/^(u?int)([0-9]*)$/),m=new RegExp(/^(.*)\[([0-9]*)\]$/);r.defaultCoerceFunc=function(t,e){var r=t.match(p);return r&&parseInt(r[2])<=48?e.toNumber():e};var g=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),v=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function y(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}function b(t,e){var r=t;function n(t){throw new Error('unexpected character "'+r[t]+'" at position '+t+' in "'+r+'"')}t=t.replace(/\s/g," ");for(var i={type:"",name:"",state:{allowType:!0}},o=i,s=0;s<t.length;s++){var a=t[s];switch(a){case"(":o.state.allowParams||n(s),o.state.allowType=!1,o.type=y(o.type),o.components=[{type:"",name:"",parent:o,state:{allowType:!0}}],o=o.components[0];break;case")":delete o.state,e&&"indexed"===o.name&&(o.indexed=!0,o.name=""),o.type=y(o.type);var u=o;(o=o.parent)||n(s),delete u.parent,o.state.allowParams=!1,o.state.allowName=!0,o.state.allowArray=!0;break;case",":delete o.state,e&&"indexed"===o.name&&(o.indexed=!0,o.name=""),o.type=y(o.type);var h={type:"",name:"",parent:o.parent,state:{allowType:!0}};o.parent.components.push(h),delete o.parent,o=h;break;case" ":o.state.allowType&&""!==o.type&&(o.type=y(o.type),delete o.state.allowType,o.state.allowName=!0,o.state.allowParams=!0),o.state.allowName&&""!==o.name&&(e&&"indexed"===o.name?(o.indexed=!0,o.name=""):o.state.allowName=!1);break;case"[":o.state.allowArray||n(s),o.type+=a,o.state.allowArray=!1,o.state.allowName=!1,o.state.readArray=!0;break;case"]":o.state.readArray||n(s),o.type+=a,o.state.readArray=!1,o.state.allowArray=!0,o.state.allowName=!0;break;default:o.state.allowType?(o.type+=a,o.state.allowParams=!0,o.state.allowArray=!0):o.state.allowName?(o.name+=a,delete o.state.allowArray):o.state.readArray?o.type+=a:n(s)}}if(o.parent)throw new Error("unexpected eof");return delete i.state,e&&"indexed"===o.name&&(o.indexed=!0,o.name=""),i.type=y(i.type),i}function w(t){return st(r.defaultCoerceFunc,t).type}function _(t,e,r,n,i){this.coerceFunc=t,this.name=e,this.type=r,this.localName=n,this.dynamic=i}r.parseParamType=function(t){return b(t,!0)},r.formatParamType=w,r.formatSignature=function(t){return t.name+"("+t.inputs.map((function(t){return w(t)})).join(",")+")"},r.parseSignature=function(t){if("string"==typeof t)return"event "===(t=(t=(t=t.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).substring(0,6)?function(t){var e={anonymous:!1,inputs:[],name:"",type:"event"},r=t.match(g);if(!r)throw new Error("invalid event: "+t);if(e.name=r[1].trim(),it(r[2]).forEach((function(t){(t=b(t,!0)).indexed=!!t.indexed,e.inputs.push(t)})),r[3].split(" ").forEach((function(t){switch(t){case"anonymous":e.anonymous=!0;break;case"":break;default:a.info("unknown modifier: "+t)}})),e.name&&!e.name.match(v))throw new Error('invalid identifier: "'+e.name+'"');return e}(t.substring(6).trim()):("function "===t.substring(0,9)&&(t=t.substring(9)),function(t){var e={constant:!1,gas:null,inputs:[],name:"",outputs:[],payable:!1,stateMutability:null,type:"function"},r=t.split("@");if(1!==r.length){if(2<r.length)throw new Error("invalid signature");if(!r[1].match(/^[0-9]+$/))throw new Error("invalid signature gas");e.gas=h.bigNumberify(r[1]),t=r[0]}var n=(r=t.split(" returns "))[0].match(g);if(!n)throw new Error("invalid signature");if(e.name=n[1].trim(),!e.name.match(v))throw new Error('invalid identifier: "'+n[1]+'"');if(it(n[2]).forEach((function(t){e.inputs.push(b(t))})),n[3].split(" ").forEach((function(t){switch(t){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:a.info("unknown modifier: "+t)}})),1<r.length){var i=r[1].match(g);if(""!=i[1].trim()||""!=i[3].trim())throw new Error("unexpected tokens");it(i[2]).forEach((function(t){e.outputs.push(b(t))}))}if("constructor"===e.name){if(e.type="constructor",e.outputs.length)throw new Error("constructor may not have outputs");delete e.name,delete e.outputs}return e}(t.trim()));throw new Error("unknown signature")};var M,k=(i(x,M=_),x.prototype.encode=function(t){return this.coder.encode(t)},x.prototype.decode=function(t,e){return this.coder.decode(t,e)},x);function x(t){var e=M.call(this,t.coerceFunc,t.name,t.type,void 0,t.dynamic)||this;return f.defineReadOnly(e,"coder",t),e}var A,S=(i(E,A=_),E.prototype.encode=function(t){return l.arrayify([])},E.prototype.decode=function(t,e){if(e>t.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},E);function E(t,e){return A.call(this,t,"null","",e,!1)||this}var N,P=(i(T,N=_),T.prototype.encode=function(t){try{var e=h.bigNumberify(t);if(this.signed){var r=s.MaxUint256.maskn(8*this.size-1);if(e.gt(r))throw new Error("out-of-bounds");if(r=r.add(s.One).mul(s.NegativeOne),e.lt(r))throw new Error("out-of-bounds")}else if(e.lt(s.Zero)||e.gt(s.MaxUint256.maskn(8*this.size)))throw new Error("out-of-bounds");return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),l.padZeros(l.arrayify(e),32)}catch(e){a.throwError("invalid number value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},T.prototype.decode=function(t,e){t.length<e+32&&a.throwError("insufficient data for "+this.name+" type",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:l.hexlify(t.slice(e,e+32))});var r=32-this.size,n=h.bigNumberify(t.slice(e+r,e+32));return n=this.signed?n.fromTwos(8*this.size):n.maskn(8*this.size),{consumed:32,value:this.coerceFunc(this.name,n)}},T);function T(t,e,r,n){var i=this,o=(r?"int":"uint")+8*e;return(i=N.call(this,t,o,o,n,!1)||this).size=e,i.signed=r,i}var I,R=new P((function(t,e){return e}),32,!1,"none"),C=(i(O,I=_),O.prototype.encode=function(t){return R.encode(t?1:0)},O.prototype.decode=function(t,e){try{var r=R.decode(t,e)}catch(t){throw"insufficient data for uint256 type"===t.reason&&a.throwError("insufficient data for boolean type",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"boolean",value:t.value}),t}return{consumed:r.consumed,value:this.coerceFunc("bool",!r.value.isZero())}},O);function O(t,e){return I.call(this,t,"bool","bool",e,!1)||this}var B,D=(i(L,B=_),L.prototype.encode=function(t){var e=new Uint8Array(32);try{var r=l.arrayify(t);if(r.length!==this.length)throw new Error("incorrect data length");e.set(r)}catch(e){a.throwError("invalid "+this.name+" value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e.value||t})}return e},L.prototype.decode=function(t,e){return t.length<e+32&&a.throwError("insufficient data for "+this.name+" type",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:l.hexlify(t.slice(e,e+32))}),{consumed:32,value:this.coerceFunc(this.name,l.hexlify(t.slice(e,e+this.length)))}},L);function L(t,e,r){var n=this,i="bytes"+e;return(n=B.call(this,t,i,i,r,!1)||this).length=e,n}var U,F=(i(z,U=_),z.prototype.encode=function(t){var e=new Uint8Array(32);try{e.set(l.arrayify(u.getAddress(t)),12)}catch(e){a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"address",value:t})}return e},z.prototype.decode=function(t,e){return t.length<e+32&&a.throwError("insufficuent data for address type",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"address",value:l.hexlify(t.slice(e,e+32))}),{consumed:32,value:this.coerceFunc("address",u.getAddress(l.hexlify(t.slice(e+12,e+32))))}},z);function z(t,e){return U.call(this,t,"address","address",e,!1)||this}function j(t){var e=32*Math.ceil(t.length/32),r=new Uint8Array(e-t.length);return l.concat([R.encode(t.length),t,r])}function H(t,e,r){t.length<e+32&&a.throwError("insufficient data for dynamicBytes length",a.INVALID_ARGUMENT,{arg:r,coderType:"dynamicBytes",value:l.hexlify(t.slice(e,e+32))});var n=R.decode(t,e).value;try{n=n.toNumber()}catch(t){a.throwError("dynamic bytes count too large",a.INVALID_ARGUMENT,{arg:r,coderType:"dynamicBytes",value:n.toString()})}return t.length<e+32+n&&a.throwError("insufficient data for dynamicBytes type",a.INVALID_ARGUMENT,{arg:r,coderType:"dynamicBytes",value:l.hexlify(t.slice(e,e+32+n))}),{consumed:32+32*Math.ceil(n/32),value:t.slice(e+32,e+32+n)}}var $,G=(i(q,$=_),q.prototype.encode=function(t){try{return j(l.arrayify(t))}catch(t){a.throwError("invalid bytes value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"bytes",value:t.value})}return null},q.prototype.decode=function(t,e){var r=H(t,e,this.localName);return r.value=this.coerceFunc("bytes",l.hexlify(r.value)),r},q);function q(t,e){return $.call(this,t,"bytes","bytes",e,!0)||this}var K,V=(i(W,K=_),W.prototype.encode=function(t){return"string"!=typeof t&&a.throwError("invalid string value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"string",value:t}),j(c.toUtf8Bytes(t))},W.prototype.decode=function(t,e){var r=H(t,e,this.localName);return r.value=this.coerceFunc("string",c.toUtf8String(r.value)),r},W);function W(t,e){return K.call(this,t,"string","string",e,!0)||this}function Z(t){return 32*Math.ceil(t/32)}function J(t,e){if(Array.isArray(e));else if(e&&"object"==typeof e){var r=[];t.forEach((function(t){r.push(e[t.localName])})),e=r}else a.throwError("invalid tuple value",a.INVALID_ARGUMENT,{coderType:"tuple",value:e});t.length!==e.length&&a.throwError("types/value length mismatch",a.INVALID_ARGUMENT,{coderType:"tuple",value:e});var n=[];t.forEach((function(t,r){n.push({dynamic:t.dynamic,value:t.encode(e[r])})}));var i=0,o=0;n.forEach((function(t){t.dynamic?(i+=32,o+=Z(t.value.length)):i+=Z(t.value.length)}));var s=0,u=i,h=new Uint8Array(i+o);return n.forEach((function(t){t.dynamic?(h.set(R.encode(u),s),s+=32,h.set(t.value,u),u+=Z(t.value.length)):(h.set(t.value,s),s+=Z(t.value.length))})),h}function X(t,e,r){var n=r,i=0,o=[];return t.forEach((function(t){if(t.dynamic){var s=R.decode(e,r);(a=t.decode(e,n+s.value.toNumber())).consumed=s.consumed}else var a=t.decode(e,r);null!=a.value&&o.push(a.value),r+=a.consumed,i+=a.consumed})),t.forEach((function(t,e){var r=t.localName;r&&("length"===r&&(r="_length"),null==o[r]&&(o[r]=o[e]))})),{value:o,consumed:i}}var Q,Y=(i(tt,Q=_),tt.prototype.encode=function(t){Array.isArray(t)||a.throwError("expected array value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=R.encode(e)),a.checkArgumentCount(e,t.length," in coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i<t.length;i++)n.push(this.coder);return l.concat([r,J(n,t)])},tt.prototype.decode=function(t,e){var r=0,n=this.length;if(-1===n){try{var i=R.decode(t,e)}catch(t){a.throwError("insufficient data for dynamic array length",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t.value})}try{n=i.value.toNumber()}catch(t){a.throwError("array count too large",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:i.value.toString()})}r+=i.consumed,e+=i.consumed}for(var o=[],s=0;s<n;s++)o.push(new k(this.coder));var u=X(o,t,e);return u.consumed+=r,u.value=this.coerceFunc(this.type,u.value),u},tt);function tt(t,e,r,n){var i=this,o=e.type+"["+(0<=r?r:"")+"]",s=-1===r||e.dynamic;return(i=Q.call(this,t,"array",o,n,s)||this).coder=e,i.length=r,i}var et,rt=(i(nt,et=_),nt.prototype.encode=function(t){return J(this.coders,t)},nt.prototype.decode=function(t,e){var r=X(this.coders,t,e);return r.value=this.coerceFunc(this.type,r.value),r},nt);function nt(t,e,r){var n=this,i=!1,o=[];e.forEach((function(t){t.dynamic&&(i=!0),o.push(t.type)}));var s="tuple("+o.join(",")+")";return(n=et.call(this,t,"tuple",s,r,i)||this).coders=e,n}function it(t){t=t.trim();for(var e=[],r="",n=0,i=0;i<t.length;i++){var o=t[i];if(","===o&&0===n)e.push(r),r="";else if(r+=o,"("===o)n++;else if(")"===o&&-1==--n)throw new Error("unbalanced parenthsis")}return r&&e.push(r),e}var ot={address:F,bool:C,string:V,bytes:G};function st(t,e){var r,n=ot[e.type];if(n)return new n(t,e.name);if(r=e.type.match(p))return(0===(i=parseInt(r[2]||"256"))||256<i||i%8!=0)&&a.throwError("invalid "+r[1]+" bit length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new P(t,i/8,"int"===r[1],e.name);if(r=e.type.match(d))return(0===(i=parseInt(r[1]))||32<i)&&a.throwError("invalid bytes length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new D(t,i,e.name);if(r=e.type.match(m)){var i=parseInt(r[2]||"-1");return(e=f.shallowCopy(e)).type=r[1],e=f.deepCopy(e),new Y(t,st(t,e),i,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){var n=[];return(e=e||[]).forEach((function(e){n.push(st(t,e))})),new rt(t,n,r)}(t,e.components,e.name):""===e.type?new S(t,e.name):(a.throwError("invalid type",a.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var at=(ut.prototype.encode=function(t,e){t.length!==e.length&&a.throwError("types/values length mismatch",a.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach((function(t){var e;e="string"==typeof t?b(t):t,r.push(st(this.coerceFunc,e))}),this),l.hexlify(new rt(this.coerceFunc,r,"_").encode(e))},ut.prototype.decode=function(t,e){var r=[];return t.forEach((function(t){var e;e="string"==typeof t?b(t):f.deepCopy(t),r.push(st(this.coerceFunc,e))}),this),new rt(this.coerceFunc,r,"_").decode(l.arrayify(e),0).value},ut);function ut(t){a.checkNew(this,ut),t=t||r.defaultCoerceFunc,f.defineReadOnly(this,"coerceFunc",t)}r.AbiCoder=at,r.defaultAbiCoder=new at},{"../constants":3,"../errors":5,"./address":59,"./bignumber":62,"./bytes":63,"./properties":73,"./utf8":84}],59:[function(t,e,r){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0});var i=n(t("bn.js")),o=t("./bytes"),s=t("./keccak256"),a=t("./rlp"),u=t("../errors");function h(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=e[n].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var i=0;i<40;i+=2)8<=r[i>>1]>>4&&(e[i]=e[i].toUpperCase()),8<=(15&r[i>>1])&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}for(var l={},c=0;c<10;c++)l[String(c)]=String(c);for(c=0;c<26;c++)l[String.fromCharCode(65+c)]=String(10+c);var f,d=Math.floor((f=9007199254740991,Math.log10?Math.log10(f):Math.log(f)/Math.LN10));function p(t){t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00";var e="";for(t.split("").forEach((function(t){e+=l[t]}));e.length>=d;){var r=e.substring(0,d);e=parseInt(r,10)%97+e.substring(r.length)}for(var n=String(98-parseInt(e,10)%97);n.length<2;)n="0"+n;return n}function m(t){var e=null;if("string"!=typeof t&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t}),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=h(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:t});else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==p(t)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:t}),e=new i.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=h("0x"+e)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});return e}r.getAddress=m,r.getIcapAddress=function(t){for(var e=new i.default.BN(m(t).substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+p("XE00"+e)+e},r.getContractAddress=function(t){if(!t.from)throw new Error("missing from address");var e=t.nonce;return m("0x"+s.keccak256(a.encode([m(t.from),o.stripZeros(o.hexlify(e))])).substring(26))}},{"../errors":5,"./bytes":63,"./keccak256":70,"./rlp":75,"bn.js":9}],60:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0});var n=t("../utils/bytes");e.exports={decode:function(t){t=atob(t);for(var e=[],r=0;r<t.length;r++)e.push(t.charCodeAt(r));return n.arrayify(e)},encode:function(t){t=n.arrayify(t);for(var e="",r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}}},{"../utils/bytes":63}],61:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0});var n=t("./bytes"),i=t("./properties"),o=(s.prototype.encode=function(t){var e=n.arrayify(t);if(0===e.length)return"";for(var r=[0],i=0;i<e.length;++i){for(var o=e[i],s=0;s<r.length;++s)o+=r[s]<<8,r[s]=o%this.base,o=o/this.base|0;for(;0<o;)r.push(o%this.base),o=o/this.base|0}for(var a="",u=0;0===e[u]&&u<e.length-1;++u)a+=this._leader;for(var h=r.length-1;0<=h;--h)a+=this.alphabet[r[h]];return a},s.prototype.decode=function(t){if("string"!=typeof t)throw new TypeError("Expected String");var e=[];if(0===t.length)return new Uint8Array(e);e.push(0);for(var r=0;r<t.length;r++){var i=this._alphabetMap[t[r]];if(void 0===i)throw new Error("Non-base"+this.base+" character");for(var o=i,s=0;s<e.length;++s)o+=e[s]*this.base,e[s]=255&o,o>>=8;for(;0<o;)e.push(255&o),o>>=8}for(var a=0;t[a]===this._leader&&a<t.length-1;++a)e.push(0);return n.arrayify(new Uint8Array(e.reverse()))},s);function s(t){i.defineReadOnly(this,"alphabet",t),i.defineReadOnly(this,"base",t.length),i.defineReadOnly(this,"_alphabetMap",{}),i.defineReadOnly(this,"_leader",t.charAt(0));for(var e=0;e<t.length;e++)this._alphabetMap[t.charAt(e)]=e}var a=new(r.BaseX=o)("abcdefghijklmnopqrstuvwxyz234567");r.Base32=a;var u=new o("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");r.Base58=u},{"./bytes":63,"./properties":73}],62:[function(t,e,r){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var o=n(t("bn.js")),s=t("./bytes"),a=t("./properties"),u=i(t("../errors")),h=new o.default.BN(-1);function l(t){var e=t.toString(16);return"-"===e[0]?e.length%2==0?"-0x0"+e.substring(1):"-0x"+e.substring(1):e.length%2==1?"0x0"+e:"0x"+e}function c(t){return d(g(t))}function f(t){return new p(l(t))}function d(t){var e=t._hex;return"-"===e[0]?new o.default.BN(e.substring(3),16).mul(h):new o.default.BN(e.substring(2),16)}var p=(m.prototype.fromTwos=function(t){return f(d(this).fromTwos(t))},m.prototype.toTwos=function(t){return f(d(this).toTwos(t))},m.prototype.abs=function(){return"-"===this._hex[0]?f(d(this).mul(h)):this},m.prototype.add=function(t){return f(d(this).add(c(t)))},m.prototype.sub=function(t){return f(d(this).sub(c(t)))},m.prototype.div=function(t){return g(t).isZero()&&u.throwError("division by zero",u.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),f(d(this).div(c(t)))},m.prototype.mul=function(t){return f(d(this).mul(c(t)))},m.prototype.mod=function(t){return f(d(this).mod(c(t)))},m.prototype.pow=function(t){return f(d(this).pow(c(t)))},m.prototype.maskn=function(t){return f(d(this).maskn(t))},m.prototype.eq=function(t){return d(this).eq(c(t))},m.prototype.lt=function(t){return d(this).lt(c(t))},m.prototype.lte=function(t){return d(this).lte(c(t))},m.prototype.gt=function(t){return d(this).gt(c(t))},m.prototype.gte=function(t){return d(this).gte(c(t))},m.prototype.isZero=function(){return d(this).isZero()},m.prototype.toNumber=function(){try{return d(this).toNumber()}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},m.prototype.toString=function(){return d(this).toString(10)},m.prototype.toHexString=function(){return this._hex},m.isBigNumber=function(t){return a.isType(t,"BigNumber")},m);function m(t){if(u.checkNew(this,m),a.setType(this,"BigNumber"),"string"==typeof t)s.isHexString(t)?("0x"==t&&(t="0x0"),a.defineReadOnly(this,"_hex",t)):"-"===t[0]&&s.isHexString(t.substring(1))?a.defineReadOnly(this,"_hex",t):t.match(/^-?[0-9]*$/)?(""==t&&(t="0"),a.defineReadOnly(this,"_hex",l(new o.default.BN(t)))):u.throwError("invalid BigNumber string value",u.INVALID_ARGUMENT,{arg:"value",value:t});else if("number"==typeof t){parseInt(String(t))!==t&&u.throwError("underflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:t,outputValue:parseInt(String(t))});try{a.defineReadOnly(this,"_hex",l(new o.default.BN(t)))}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else t instanceof m?a.defineReadOnly(this,"_hex",t._hex):t.toHexString?a.defineReadOnly(this,"_hex",l(c(t.toHexString()))):t._hex&&s.isHexString(t._hex)?a.defineReadOnly(this,"_hex",t._hex):s.isArrayish(t)?a.defineReadOnly(this,"_hex",l(new o.default.BN(s.hexlify(t).substring(2),16))):u.throwError("invalid BigNumber value",u.INVALID_ARGUMENT,{arg:"value",value:t})}function g(t){return p.isBigNumber(t)?t:new p(t)}r.BigNumber=p,r.bigNumberify=g},{"../errors":5,"./bytes":63,"./properties":73,"bn.js":9}],63:[function(t,e,r){var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=n(t("../errors"));function o(t){return!!t.toHexString}function s(t){return t.slice||(t.slice=function(){var e=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function a(t){if(!t||parseInt(String(t.length))!=t.length||"string"==typeof t)return!1;for(var e=0;e<t.length;e++){var r=t[e];if(r<0||256<=r||parseInt(String(r))!=r)return!1}return!0}function u(t){if(null==t&&i.throwError("cannot convert null value to array",i.INVALID_ARGUMENT,{arg:"value",value:t}),o(t)&&(t=t.toHexString()),"string"!=typeof t)return a(t)?s(new Uint8Array(t)):(i.throwError("invalid arrayify value",null,{arg:"value",value:t,type:typeof t}),null);var e=t.match(/^(0x)?[0-9a-fA-F]*$/);e||i.throwError("invalid hexidecimal string",i.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==e[1]&&i.throwError("hex string must have 0x prefix",i.INVALID_ARGUMENT,{arg:"value",value:t}),(t=t.substring(2)).length%2&&(t="0"+t);for(var r=[],n=0;n<t.length;n+=2)r.push(parseInt(t.substr(n,2),16));return s(new Uint8Array(r))}function h(t){for(var e=[],r=0,n=0;n<t.length;n++){var i=u(t[n]);e.push(i),r+=i.length}var o=new Uint8Array(r),a=0;for(n=0;n<e.length;n++)o.set(e[n],a),a+=e[n].length;return s(o)}function l(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}r.isHexable=o,r.isArrayish=a,r.arrayify=u,r.concat=h,r.stripZeros=function(t){var e=u(t);if(0===e.length)return e;for(var r=0;0===e[r];)r++;return r&&(e=e.slice(r)),e},r.padZeros=function(t,e){if(e<(t=u(t)).length)throw new Error("cannot pad");var r=new Uint8Array(e);return r.set(t,e-t.length),s(r)},r.isHexString=l;var c="0123456789abcdef";function f(t){if(o(t))return t.toHexString();if("number"==typeof t){t<0&&i.throwError("cannot hexlify negative value",i.INVALID_ARGUMENT,{arg:"value",value:t}),9007199254740991<=t&&i.throwError("out-of-range",i.NUMERIC_FAULT,{operartion:"hexlify",fault:"out-of-safe-range"});for(var e="";t;)e=c[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("string"==typeof t){var r=t.match(/^(0x)?[0-9a-fA-F]*$/);return r||i.throwError("invalid hexidecimal string",i.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==r[1]&&i.throwError("hex string must have 0x prefix",i.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2&&(t="0x0"+t.substring(2)),t}if(a(t)){for(var n=[],s=0;s<t.length;s++){var u=t[s];n.push(c[(240&u)>>4]+c[15&u])}return"0x"+n.join("")}return i.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function d(t,e){for(l(t)||i.throwError("invalid hex string",i.INVALID_ARGUMENT,{arg:"value",value:t});t.length<2*e+2;)t="0x0"+t.substring(2);return t}function p(t){var e=0,r="0x",n="0x";if(function(t){return t&&null!=t.r&&null!=t.s}(t)){null==t.v&&null==t.recoveryParam&&i.throwError("at least on of recoveryParam or v must be specified",i.INVALID_ARGUMENT,{argument:"signature",value:t}),r=d(t.r,32),n=d(t.s,32),"string"==typeof(e=t.v)&&(e=parseInt(e,16));var o=t.recoveryParam;null==o&&null!=t.v&&(o=1-e%2),e=27+o}else{var s=u(t);if(65!==s.length)throw new Error("invalid signature");r=f(s.slice(0,32)),n=f(s.slice(32,64)),27!==(e=s[64])&&28!==e&&(e=27+e%2)}return{r:r,s:n,recoveryParam:e-27,v:e}}r.hexlify=f,r.hexDataLength=function(t){return l(t)&&t.length%2==0?(t.length-2)/2:null},r.hexDataSlice=function(t,e,r){return l(t)||i.throwError("invalid hex data",i.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2!=0&&i.throwError("hex data length must be even",i.INVALID_ARGUMENT,{arg:"value",value:t}),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)},r.hexStripZeros=function(t){for(l(t)||i.throwError("invalid hex string",i.INVALID_ARGUMENT,{arg:"value",value:t});3<t.length&&"0x0"===t.substring(0,3);)t="0x"+t.substring(3);return t},r.hexZeroPad=d,r.splitSignature=p,r.joinSignature=function(t){return f(h([(t=p(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},{"../errors":5}],64:[function(t,e,r){var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=n(t("../errors")),o=t("./bytes"),s=t("./utf8"),a=t("./keccak256"),u=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),h=new RegExp("^((.*)\\.)?([^.]+)$"),l=new RegExp("^[a-z0-9.-]*$");r.namehash=function(t){"string"!=typeof t&&i.throwError("invalid address - "+String(t),i.INVALID_ARGUMENT,{argument:"name",value:t}),(t=t.toLowerCase()).match(l)||i.throwError("contains invalid UseSTD3ASCIIRules characters",i.INVALID_ARGUMENT,{argument:"name",value:t});for(var e=u;t.length;){var r=t.match(h),n=s.toUtf8Bytes(r[3]);e=a.keccak256(o.concat([e,a.keccak256(n)])),t=r[2]||""}return o.hexlify(e)},r.id=function(t){return a.keccak256(s.toUtf8Bytes(t))},r.hashMessage=function(t){return a.keccak256(o.concat([s.toUtf8Bytes("Ethereum Signed Message:\n"),s.toUtf8Bytes(String(t.length)),"string"==typeof t?s.toUtf8Bytes(t):t]))}},{"../errors":5,"./bytes":63,"./keccak256":70,"./utf8":84}],65:[function(t,e,r){var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=n(t("../errors")),o=t("../wordlists/lang-en"),s=t("./basex"),a=t("./bytes"),u=t("./bignumber"),h=t("./utf8"),l=t("./pbkdf2"),c=t("./hmac"),f=t("./properties"),d=t("./secp256k1"),p=t("./sha2"),m=u.bigNumberify("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),g=h.toUtf8Bytes("Bitcoin seed"),v=2147483648;function y(t){return(1<<t)-1<<8-t}function b(t){return a.hexZeroPad(a.hexlify(t),32)}function w(t){var e=a.hexDataSlice(p.sha256(p.sha256(t)),0,4);return s.Base58.encode(a.concat([t,e]))}var _={};r.defaultPath="m/44'/60'/0'/0/0";var M=(Object.defineProperty(k.prototype,"extendedKey",{get:function(){if(256<=this.depth)throw new Error("Depth too large!");return w(a.concat([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",a.hexlify(this.depth),this.parentFingerprint,a.hexZeroPad(a.hexlify(this.index),4),this.chainCode,null!=this.privateKey?a.concat(["0x00",this.privateKey]):this.publicKey]))},enumerable:!0,configurable:!0}),k.prototype.neuter=function(){return new k(_,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,null,this.path)},k.prototype._derive=function(t){if(4294967295<t)throw new Error("invalid index - "+String(t));var e=this.path;e&&(e+="/"+(t&~v));var r=new Uint8Array(37);if(t&v){if(!this.privateKey)throw new Error("cannot derive child of neutered node");r.set(a.arrayify(this.privateKey),1),e&&(e+="'")}else r.set(a.arrayify(this.publicKey));for(var n=24;0<=n;n-=8)r[33+(n>>3)]=t>>24-n&255;var i=c.computeHmac(c.SupportedAlgorithms.sha512,this.chainCode,r),o=i.slice(0,32),s=i.slice(32),h=null,l=null;return this.privateKey?h=b(u.bigNumberify(o).add(this.privateKey).mod(m)):l=new d.KeyPair(a.hexlify(o))._addPoint(this.publicKey),new k(_,h,l,this.fingerprint,b(s),t,this.depth+1,this.mnemonic,e)},k.prototype.derivePath=function(t){var e=t.split("/");if(0===e.length||"m"===e[0]&&0!==this.depth)throw new Error("invalid path - "+t);"m"===e[0]&&e.shift();for(var r=this,n=0;n<e.length;n++){var i=e[n];if(i.match(/^[0-9]+'$/)){var o=parseInt(i.substring(0,i.length-1));if(v<=o)throw new Error("invalid path index - "+i);r=r._derive(v+o)}else{if(!i.match(/^[0-9]+$/))throw new Error("invalid path component - "+i);if(o=parseInt(i),v<=o)throw new Error("invalid path index - "+i);r=r._derive(o)}}return r},k.isHDNode=function(t){return f.isType(t,"HDNode")},k);function k(t,e,r,n,o,s,u,h,l){if(i.checkNew(this,k),t!==_)throw new Error("HDNode constructor cannot be called directly");if(e){var c=new d.KeyPair(e);f.defineReadOnly(this,"privateKey",c.privateKey),f.defineReadOnly(this,"publicKey",c.compressedPublicKey)}else f.defineReadOnly(this,"privateKey",null),f.defineReadOnly(this,"publicKey",a.hexlify(r));f.defineReadOnly(this,"parentFingerprint",n),f.defineReadOnly(this,"fingerprint",a.hexDataSlice(p.ripemd160(p.sha256(this.publicKey)),0,4)),f.defineReadOnly(this,"address",d.computeAddress(this.publicKey)),f.defineReadOnly(this,"chainCode",o),f.defineReadOnly(this,"index",s),f.defineReadOnly(this,"depth",u),f.defineReadOnly(this,"mnemonic",h),f.defineReadOnly(this,"path",l),f.setType(this,"HDNode")}function x(t,e){var r=a.arrayify(t);if(r.length<16||64<r.length)throw new Error("invalid seed");var n=a.arrayify(c.computeHmac(c.SupportedAlgorithms.sha512,g,r));return new M(_,b(n.slice(0,32)),null,"0x00000000",b(n.slice(32)),0,0,e,"m")}function A(t,e){e=e||"";var r=h.toUtf8Bytes("mnemonic"+e,h.UnicodeNormalizationForm.NFKD);return a.hexlify(l.pbkdf2(h.toUtf8Bytes(t,h.UnicodeNormalizationForm.NFKD),r,2048,64,"sha512"))}function S(t,e){e=e||o.langEn,i.checkNormalize();var r=e.split(t);if(r.length%3!=0)throw new Error("invalid mnemonic");for(var n=a.arrayify(new Uint8Array(Math.ceil(11*r.length/8))),s=0,u=0;u<r.length;u++){var h=e.getWordIndex(r[u].normalize("NFKD"));if(-1===h)throw new Error("invalid mnemonic");for(var l=0;l<11;l++)h&1<<10-l&&(n[s>>3]|=1<<7-s%8),s++}var c=32*r.length/3,f=y(r.length/3),d=a.arrayify(p.sha256(n.slice(0,c/8)))[0];if((d&=f)!=(n[n.length-1]&f))throw new Error("invalid checksum");return a.hexlify(n.slice(0,c/8))}function E(t,e){if((t=a.arrayify(t)).length%4!=0||t.length<16||32<t.length)throw new Error("invalid entropy");for(var r=[0],n=11,i=0;i<t.length;i++)8<n?(r[r.length-1]<<=8,r[r.length-1]|=t[i],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=t[i]>>8-n,r.push(t[i]&(1<<8-n)-1),n+=3);var s=a.arrayify(p.sha256(t))[0],u=t.length/4;return s&=y(u),r[r.length-1]<<=u,r[r.length-1]|=s>>8-u,(e=e||o.langEn).join(r.map((function(t){return e.getWord(t)})))}r.HDNode=M,r.fromExtendedKey=function(t){var e=s.Base58.decode(t);82===e.length&&w(e.slice(0,78))===t||i.throwError("invalid extended key",i.INVALID_ARGUMENT,{argument:"extendedKey",value:"[REDACTED]"});var r=e[4],n=a.hexlify(e.slice(5,9)),o=parseInt(a.hexlify(e.slice(9,13)).substring(2),16),u=a.hexlify(e.slice(13,45)),h=e.slice(45,78);switch(a.hexlify(e.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new M(_,null,a.hexlify(h),n,u,o,r,null,null);case"0x0488ade4":case"0x04358394":if(0!==h[0])break;return new M(_,a.hexlify(h.slice(1)),null,n,u,o,r,null,null)}return i.throwError("invalid extended key",i.INVALID_ARGUMENT,{argument:"extendedKey",value:"[REDACTED]"})},r.fromMnemonic=function(t,e,r){return x(A(t=E(S(t,e),e),r),t)},r.fromSeed=function(t){return x(t,null)},r.mnemonicToSeed=A,r.mnemonicToEntropy=S,r.entropyToMnemonic=E,r.isValidMnemonic=function(t,e){try{return S(t,e),!0}catch(t){}return!1}},{"../errors":5,"../wordlists/lang-en":89,"./basex":61,"./bignumber":62,"./bytes":63,"./hmac":66,"./pbkdf2":72,"./properties":73,"./secp256k1":76,"./sha2":78,"./utf8":84}],66:[function(t,e,r){var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i,o,s=n(t("hash.js")),a=t("../utils/bytes"),u=n(t("../errors"));(o=i=r.SupportedAlgorithms||(r.SupportedAlgorithms={})).sha256="sha256",o.sha512="sha512",r.computeHmac=function(t,e,r){return i[t]||u.throwError("unsupported algorithm "+t,u.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:t}),a.arrayify(s.hmac(s[t],a.arrayify(e)).update(a.arrayify(r)).digest())}},{"../errors":5,"../utils/bytes":63,"hash.js":27}],67:[function(t,e,r){var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=t("./abi-coder");r.AbiCoder=i.AbiCoder,r.defaultAbiCoder=i.defaultAbiCoder,r.formatSignature=i.formatSignature,r.formatParamType=i.formatParamType,r.parseSignature=i.parseSignature,r.parseParamType=i.parseParamType;var o=t("./address");r.getAddress=o.getAddress,r.getContractAddress=o.getContractAddress,r.getIcapAddress=o.getIcapAddress;var s=n(t("./base64"));r.base64=s;var a=t("./bignumber");r.BigNumber=a.BigNumber,r.bigNumberify=a.bigNumberify;var u=t("./bytes");r.arrayify=u.arrayify,r.concat=u.concat,r.hexDataSlice=u.hexDataSlice,r.hexDataLength=u.hexDataLength,r.hexlify=u.hexlify,r.hexStripZeros=u.hexStripZeros,r.hexZeroPad=u.hexZeroPad,r.isHexString=u.isHexString,r.joinSignature=u.joinSignature,r.padZeros=u.padZeros,r.splitSignature=u.splitSignature,r.stripZeros=u.stripZeros;var h=t("./hash");r.hashMessage=h.hashMessage,r.id=h.id,r.namehash=h.namehash;var l=n(t("./hdnode"));r.HDNode=l;var c=t("./interface");r.Interface=c.Interface;var f=t("./json-wallet");r.getJsonWalletAddress=f.getJsonWalletAddress;var d=t("./keccak256");r.keccak256=d.keccak256;var p=t("./sha2");r.sha256=p.sha256;var m=t("./solidity");r.solidityKeccak256=m.keccak256,r.solidityPack=m.pack,r.soliditySha256=m.sha256;var g=t("./random-bytes");r.randomBytes=g.randomBytes;var v=t("./networks");r.getNetwork=v.getNetwork;var y=t("./properties");r.checkProperties=y.checkProperties,r.deepCopy=y.deepCopy,r.defineReadOnly=y.defineReadOnly,r.resolveProperties=y.resolveProperties,r.shallowCopy=y.shallowCopy;var b=n(t("./rlp"));r.RLP=b;var w=t("./secp256k1");r.computeAddress=w.computeAddress,r.computePublicKey=w.computePublicKey,r.recoverAddress=w.recoverAddress,r.recoverPublicKey=w.recoverPublicKey,r.verifyMessage=w.verifyMessage;var _=t("./signing-key");r.SigningKey=_.SigningKey;var M=t("./transaction");r.populateTransaction=M.populateTransaction;var k=t("./transaction");r.parseTransaction=k.parse,r.serializeTransaction=k.serialize;var x=t("./utf8");r.formatBytes32String=x.formatBytes32String,r.parseBytes32String=x.parseBytes32String,r.toUtf8Bytes=x.toUtf8Bytes,r.toUtf8String=x.toUtf8String;var A=t("./units");r.commify=A.commify,r.formatEther=A.formatEther,r.parseEther=A.parseEther,r.formatUnits=A.formatUnits,r.parseUnits=A.parseUnits;var S=t("./web");r.fetchJson=S.fetchJson,r.poll=S.poll;var E=t("./hmac");r.SupportedAlgorithms=E.SupportedAlgorithms;var N=t("./utf8");r.UnicodeNormalizationForm=N.UnicodeNormalizationForm;var P=t("./wordlist");r.Wordlist=P.Wordlist},{"./abi-coder":58,"./address":59,"./base64":60,"./bignumber":62,"./bytes":63,"./hash":64,"./hdnode":65,"./hmac":66,"./interface":68,"./json-wallet":69,"./keccak256":70,"./networks":71,"./properties":73,"./random-bytes":74,"./rlp":75,"./secp256k1":76,"./sha2":78,"./signing-key":80,"./solidity":81,"./transaction":82,"./units":83,"./utf8":84,"./web":85,"./wordlist":86}],68:[function(t,e,r){var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};function s(t){for(var e in p.setType(this,"Description"),t)p.defineReadOnly(this,e,p.deepCopy(t[e],!0));Object.freeze(this)}Object.defineProperty(r,"__esModule",{value:!0});var a,u=t("./address"),h=t("./abi-coder"),l=t("./bignumber"),c=t("./bytes"),f=t("./hash"),d=t("./keccak256"),p=t("./properties"),m=o(t("../errors")),g=function(t){p.setType(this,"Indexed"),p.defineReadOnly(this,"hash",t)},v=(i(y,a=s),y.prototype.encode=function(t,e){c.isHexString(t)||m.throwError("invalid contract bytecode",m.INVALID_ARGUMENT,{arg:"bytecode",value:t}),m.checkArgumentCount(e.length,this.inputs.length," in Interface constructor");try{return t+h.defaultAbiCoder.encode(this.inputs,e).substring(2)}catch(t){m.throwError("invalid constructor argument",m.INVALID_ARGUMENT,{arg:t.arg,reason:t.reason,value:t.value})}return null},y);function y(){return null!==a&&a.apply(this,arguments)||this}var b,w=(i(_,b=s),_.prototype.encode=function(t){m.checkArgumentCount(t.length,this.inputs.length," in interface function "+this.name);try{return this.sighash+h.defaultAbiCoder.encode(this.inputs,t).substring(2)}catch(t){m.throwError("invalid input argument",m.INVALID_ARGUMENT,{arg:t.arg,reason:t.reason,value:t.value})}return null},_.prototype.decode=function(t){try{return h.defaultAbiCoder.decode(this.outputs,c.arrayify(t))}catch(e){m.throwError("invalid data for function output",m.INVALID_ARGUMENT,{arg:"data",errorArg:e.arg,errorValue:e.value,value:t,reason:e.reason})}},_);function _(){return null!==b&&b.apply(this,arguments)||this}var M,k=(i(x,M=s),x);function x(){return null!==M&&M.apply(this,arguments)||this}var A,S=(i(E,A=s),E.prototype.encodeTopics=function(t){var e=this;t.length>this.inputs.length&&m.throwError("too many arguments for "+this.name,m.UNEXPECTED_ARGUMENT,{maxCount:t.length,expectedCount:this.inputs.length});var r=[];for(this.anonymous||r.push(this.topic),t.forEach((function(t,n){var i=e.inputs[n];i.indexed?null==t?r.push(null):"string"===i.type?r.push(f.id(t)):"bytes"===i.type?r.push(d.keccak256(t)):-1!==i.type.indexOf("[")||"tuple"===i.type.substring(0,5)?m.throwError("filtering with tuples or arrays not implemented yet; bug us on GitHub",m.NOT_IMPLEMENTED,{operation:"filter(array|tuple)"}):("address"===i.type&&u.getAddress(t),r.push(c.hexZeroPad(c.hexlify(t),32).toLowerCase())):null!=t&&m.throwError("cannot filter non-indexed parameters; must be null",m.INVALID_ARGUMENT,{argument:i.name||n,value:t})}));r.length&&null===r[r.length-1];)r.pop();return r},E.prototype.decode=function(t,e){null==e||this.anonymous||(e=e.slice(1));var r=[],n=[],i=[];if(this.inputs.forEach((function(t,e){t.indexed?"string"===t.type||"bytes"===t.type||0<=t.type.indexOf("[")||"tuple"===t.type.substring(0,5)?(r.push({type:"bytes32",name:t.name||""}),i.push(!0)):(r.push(t),i.push(!1)):(n.push(t),i.push(!1))})),null!=e)var o=h.defaultAbiCoder.decode(r,c.concat(e));var s=h.defaultAbiCoder.decode(n,c.arrayify(t)),a={},u=0,l=0;return this.inputs.forEach((function(t,r){t.indexed?null==e?a[r]=new g(null):i[r]?a[r]=new g(o[l++]):a[r]=o[l++]:a[r]=s[u++],t.name&&(a[t.name]=a[r])})),a.length=this.inputs.length,new k(a)},E);function E(){return null!==A&&A.apply(this,arguments)||this}var N,P=(i(T,N=s),T);function T(){return null!==N&&N.apply(this,arguments)||this}var I,R=(i(C,I=s),C);function C(){return null!==I&&I.apply(this,arguments)||this}function O(t){switch(t.type){case"constructor":var e=new v({inputs:t.inputs,payable:null==t.payable||!!t.payable});this.deployFunction||(this.deployFunction=e);break;case"function":var r=h.formatSignature(t).replace(/tuple/g,""),n=f.id(r).substring(0,10);e=new w({inputs:t.inputs,outputs:t.outputs,gas:t.gas,payable:null==t.payable||!!t.payable,type:t.constant?"call":"transaction",name:t.name,signature:r,sighash:n}),t.name&&(null==this.functions[t.name]?p.defineReadOnly(this.functions,t.name,e):m.warn("WARNING: Multiple definitions for "+t.name)),null==this.functions[e.signature]&&p.defineReadOnly(this.functions,e.signature,e);break;case"event":r=h.formatSignature(t).replace(/tuple/g,""),e=new S({name:t.name,signature:r,inputs:t.inputs,topic:f.id(r),anonymous:!!t.anonymous}),t.name&&null==this.events[t.name]&&p.defineReadOnly(this.events,t.name,e),null==this.events[e.signature]&&p.defineReadOnly(this.events,e.signature,e);break;case"fallback":break;default:m.warn("WARNING: unsupported ABI type - "+t.type)}}var B=(D.prototype.parseTransaction=function(t){var e=t.data.substring(0,10).toLowerCase();for(var r in this.functions)if(-1!==r.indexOf("(")){var n=this.functions[r];if(n.sighash===e){var i=h.defaultAbiCoder.decode(n.inputs,"0x"+t.data.substring(10));return new P({args:i,decode:n.decode,name:n.name,signature:n.signature,sighash:n.sighash,value:l.bigNumberify(t.value||"0")})}}return null},D.prototype.parseLog=function(t){for(var e in this.events)if(-1!==e.indexOf("(")){var r=this.events[e];if(!r.anonymous&&r.topic===t.topics[0])return new R({decode:r.decode,name:r.name,signature:r.signature,topic:r.topic,values:r.decode(t.data,t.topics)})}return null},D.isInterface=function(t){return p.isType(t,"Interface")},D.isIndexed=function(t){return p.isType(t,"Indexed")},D);function D(t){if(m.checkNew(this,D),"string"==typeof t){try{t=JSON.parse(t)}catch(e){m.throwError("could not parse ABI JSON",m.INVALID_ARGUMENT,{arg:"abi",errorMessage:e.message,value:t})}if(!Array.isArray(t))return m.throwError("invalid abi",m.INVALID_ARGUMENT,{arg:"abi",value:t}),null}p.defineReadOnly(this,"functions",{}),p.defineReadOnly(this,"events",{});var e=[];t.forEach((function(t){"string"==typeof t&&(t=h.parseSignature(t)),e.push(t)})),p.defineReadOnly(this,"abi",p.deepCopy(e,!0)),e.forEach(O,this),this.deployFunction||O.call(this,{type:"constructor",inputs:[]}),p.setType(this,"Interface")}r.Interface=B},{"../errors":5,"./abi-coder":58,"./address":59,"./bignumber":62,"./bytes":63,"./hash":64,"./keccak256":70,"./properties":73}],69:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0});var n=t("./address");function i(t){try{var e=JSON.parse(t)}catch(t){return!1}return e.encseed&&e.ethaddr}function o(t){try{var e=JSON.parse(t)}catch(t){return!1}return!(!e.version||parseInt(e.version)!==e.version||3!==parseInt(e.version))}r.isCrowdsaleWallet=i,r.isSecretStorageWallet=o,r.getJsonWalletAddress=function(t){if(i(t))try{return n.getAddress(JSON.parse(t).ethaddr)}catch(t){return null}if(o(t))try{return n.getAddress(JSON.parse(t).address)}catch(t){return null}return null}},{"./address":59}],70:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0});var n=t("js-sha3"),i=t("./bytes");r.keccak256=function(t){return"0x"+n.keccak_256(i.arrayify(t))}},{"./bytes":63,"js-sha3":40}],71:[function(t,e,r){var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=n(t("../errors"));function o(t){return function(e){var r=[];return e.InfuraProvider&&r.push(new e.InfuraProvider(t)),e.EtherscanProvider&&r.push(new e.EtherscanProvider(t)),0===r.length?null:e.FallbackProvider?new e.FallbackProvider(r):r[0]}}function s(t,e){return function(r){return r.JsonRpcProvider?new r.JsonRpcProvider(t,e):null}}var a={chainId:1,ensAddress:"0x314159265dd8dbb310642f98f50c066173c1259b",name:"homestead",_defaultProvider:o("homestead")},u={chainId:3,ensAddress:"0x112234455c3a32fd11230c42e7bccd4a84e02010",name:"ropsten",_defaultProvider:o("ropsten")},h={unspecified:{chainId:0,name:"unspecified"},homestead:a,mainnet:a,morden:{chainId:2,name:"morden"},ropsten:u,testnet:u,rinkeby:{chainId:4,ensAddress:"0xe7410170f87102DF0055eB195163A03B7F2Bff4A",name:"rinkeby",_defaultProvider:o("rinkeby")},goerli:{chainId:5,ensAddress:"0x112234455c3a32fd11230c42e7bccd4a84e02010",name:"goerli",_defaultProvider:o("goerli")},kovan:{chainId:42,name:"kovan",_defaultProvider:o("kovan")},classic:{chainId:61,name:"classic",_defaultProvider:s("https://web3.gastracker.io","classic")},classicTestnet:{chainId:62,name:"classicTestnet",_defaultProvider:s("https://web3.gastracker.io/morden","classicTestnet")}};r.getNetwork=function(t){if(null==t)return null;if("number"==typeof t){for(var e in h){var r=h[e];if(r.chainId===t)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:t,name:"unknown"}}if("string"==typeof t){var n=h[t];return null==n?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}var o=h[t.name];return o?(0!==t.chainId&&t.chainId!==o.chainId&&i.throwError("network chainId mismatch",i.INVALID_ARGUMENT,{arg:"network",value:t}),{name:t.name,chainId:o.chainId,ensAddress:t.ensAddress||o.ensAddress||null,_defaultProvider:t._defaultProvider||o._defaultProvider||null}):("number"!=typeof t.chainId&&i.throwError("invalid network chainId",i.INVALID_ARGUMENT,{arg:"network",value:t}),t)}},{"../errors":5}],72:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0});var n=t("../utils/bytes"),i=t("./hmac");r.pbkdf2=function(t,e,r,o,s){var a;t=n.arrayify(t),e=n.arrayify(e);var u,h,l=1,c=new Uint8Array(o),f=new Uint8Array(e.length+4);f.set(e);for(var d=1;d<=l;d++){f[e.length]=d>>24&255,f[e.length+1]=d>>16&255,f[e.length+2]=d>>8&255,f[e.length+3]=255&d;var p=i.computeHmac(s,t,f);a||(a=p.length,h=new Uint8Array(a),u=o-((l=Math.ceil(o/a))-1)*a),h.set(p);for(var m=1;m<r;m++){p=i.computeHmac(s,t,p);for(var g=0;g<a;g++)h[g]^=p[g]}var v=(d-1)*a,y=d===l?u:a;c.set(n.arrayify(h).slice(0,y),v)}return n.arrayify(c)}},{"../utils/bytes":63,"./hmac":66}],73:[function(t,e,r){var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=n(t("../errors"));function o(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function s(t,e){return t&&t._ethersType===e}r.defineReadOnly=o,r.setType=function(t,e){Object.defineProperty(t,"_ethersType",{configurable:!1,value:e,writable:!1})},r.isType=s,r.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach((function(n){var i=t[n];i instanceof Promise?r.push(i.then((function(t){return e[n]=t,null}))):e[n]=i})),Promise.all(r).then((function(){return e}))},r.checkProperties=function(t,e){t&&"object"==typeof t||i.throwError("invalid object",i.INVALID_ARGUMENT,{argument:"object",value:t}),Object.keys(t).forEach((function(r){e[r]||i.throwError("invalid object key - "+r,i.INVALID_ARGUMENT,{argument:"transaction",value:t,key:r})}))},r.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e};var a={boolean:!0,number:!0,string:!0};r.deepCopy=function t(e,r){if(null==e||a[typeof e])return e;if(Array.isArray(e)){var n=e.map((function(e){return t(e,r)}));return r&&Object.freeze(n),n}if("object"==typeof e){if(s(e,"BigNumber"))return e;if(s(e,"Description"))return e;if(s(e,"Indexed"))return e;for(var i in n={},e){var u=e[i];void 0!==u&&o(n,i,t(u,r))}return r&&Object.freeze(n),n}if("function"==typeof e)return e;throw new Error("Cannot deepCopy "+typeof e)},r.inheritable=function t(e){return function(r){!function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}(r,e),o(r,"inherits",t(r))}}},{"../errors":5}],74:[function(t,e,r){(function(e){Object.defineProperty(r,"__esModule",{value:!0});var n=t("../utils/bytes"),i=t("../utils/properties"),o=e.crypto||e.msCrypto;function s(t){if(t<=0||1024<t||parseInt(String(t))!=t)throw new Error("invalid length");var e=new Uint8Array(t);return o.getRandomValues(e),n.arrayify(e)}o&&o.getRandomValues||(console.log("WARNING: Missing strong random number source; using weak randomBytes"),o={getRandomValues:function(t){for(var e=0;e<20;e++)for(var r=0;r<t.length;r++)e?t[r]^=Math.trunc(256*Math.random()):t[r]=Math.trunc(256*Math.random());return t},_weakCrypto:!0}),r.randomBytes=s,!0===o._weakCrypto&&i.defineReadOnly(s,"_weakCrypto",!0)}).call(this,void 0!==Y?Y:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils/bytes":63,"../utils/properties":73}],75:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0});var n=t("./bytes");function i(t){for(var e=[];t;)e.unshift(255&t),t>>=8;return e}function o(t,e,r){for(var n=0,i=0;i<r;i++)n=256*n+t[e+i];return n}function s(t,e,r,n){for(var i=[];r<e+1+n;){var o=a(t,r);if(i.push(o.result),e+1+n<(r+=o.consumed))throw new Error("invalid rlp")}return{consumed:1+n,result:i}}function a(t,e){if(0===t.length)throw new Error("invalid rlp data");if(248<=t[e]){if(e+1+(r=t[e]-247)>t.length)throw new Error("too short");if(e+1+r+(i=o(t,e+1,r))>t.length)throw new Error("to short");return s(t,e,e+1+r,r+i)}if(192<=t[e]){if(e+1+(i=t[e]-192)>t.length)throw new Error("invalid rlp data");return s(t,e,e+1,i)}if(184<=t[e]){var r;if(e+1+(r=t[e]-183)>t.length)throw new Error("invalid rlp data");if(e+1+r+(i=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+i,result:n.hexlify(t.slice(e+1+r,e+1+r+i))}}if(128<=t[e]){var i;if(e+1+(i=t[e]-128)>t.length)throw new Error("invalid rlp data");return{consumed:1+i,result:n.hexlify(t.slice(e+1,e+1+i))}}return{consumed:1,result:n.hexlify(t[e])}}r.encode=function(t){return n.hexlify(function t(e){if(Array.isArray(e)){var r=[];return e.forEach((function(e){r=r.concat(t(e))})),r.length<=55?(r.unshift(192+r.length),r):((o=i(r.length)).unshift(247+o.length),o.concat(r))}var o,s=Array.prototype.slice.call(n.arrayify(e));return 1===s.length&&s[0]<=127?s:s.length<=55?(s.unshift(128+s.length),s):((o=i(s.length)).unshift(183+o.length),o.concat(s))}(t))},r.decode=function(t){var e=n.arrayify(t),r=a(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},{"./bytes":63}],76:[function(t,e,r){var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=t("elliptic"),o=t("./address"),s=t("./bytes"),a=t("./hash"),u=t("./keccak256"),h=t("./properties"),l=n(t("../errors")),c=null;function f(){return c=c||new i.ec("secp256k1")}var d=(p.prototype.sign=function(t){var e=f().keyFromPrivate(s.arrayify(this.privateKey)).sign(s.arrayify(t),{canonical:!0});return{recoveryParam:e.recoveryParam,r:s.hexZeroPad("0x"+e.r.toString(16),32),s:s.hexZeroPad("0x"+e.s.toString(16),32),v:27+e.recoveryParam}},p.prototype.computeSharedSecret=function(t){var e=f().keyFromPrivate(s.arrayify(this.privateKey)),r=f().keyFromPublic(s.arrayify(m(t)));return s.hexZeroPad("0x"+e.derive(r.getPublic()).toString(16),32)},p.prototype._addPoint=function(t){var e=f().keyFromPublic(s.arrayify(this.publicKey)),r=f().keyFromPublic(s.arrayify(t));return"0x"+e.pub.add(r.pub).encodeCompressed("hex")},p);function p(t){var e=f().keyFromPrivate(s.arrayify(t));h.defineReadOnly(this,"privateKey",s.hexlify(e.priv.toArray("be",32))),h.defineReadOnly(this,"publicKey","0x"+e.getPublic(!1,"hex")),h.defineReadOnly(this,"compressedPublicKey","0x"+e.getPublic(!0,"hex")),h.defineReadOnly(this,"publicKeyBytes",e.getPublic().encode(null,!0))}function m(t,e){var r=s.arrayify(t);if(32!==r.length)return 33===r.length?e?s.hexlify(r):"0x"+f().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?e?"0x"+f().keyFromPublic(r).getPublic(!0,"hex"):s.hexlify(r):(l.throwError("invalid public or private key",l.INVALID_ARGUMENT,{arg:"key",value:"[REDACTED]"}),null);var n=new d(r);return e?n.compressedPublicKey:n.publicKey}function g(t){var e="0x"+m(t).slice(4);return o.getAddress("0x"+u.keccak256(e).substring(26))}function v(t,e){var r=s.splitSignature(e),n={r:s.arrayify(r.r),s:s.arrayify(r.s)};return"0x"+f().recoverPubKey(s.arrayify(t),n,r.recoveryParam).encode("hex",!1)}function y(t,e){return g(v(s.arrayify(t),e))}r.KeyPair=d,r.computePublicKey=m,r.computeAddress=g,r.recoverPublicKey=v,r.recoverAddress=y,r.verifyMessage=function(t,e){return y(a.hashMessage(t),e)}},{"../errors":5,"./address":59,"./bytes":63,"./hash":64,"./keccak256":70,"./properties":73,elliptic:12}],77:[function(t,e,r){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var o=n(t("aes-js")),s=n(t("scrypt-js")),a=n(t("uuid")),u=t("./signing-key"),h=i(t("./hdnode")),l=t("./address"),c=t("./bytes"),f=t("./pbkdf2"),d=t("./keccak256"),p=t("./utf8"),m=t("./random-bytes");function g(t){return"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),c.arrayify(t)}function v(t,e){for(t=String(t);t.length<e;)t="0"+t;return t}function y(t){return"string"==typeof t?p.toUtf8Bytes(t,p.UnicodeNormalizationForm.NFKC):c.arrayify(t)}function b(t,e){for(var r=t,n=e.toLowerCase().split("/"),i=0;i<n.length;i++){var o=null;for(var s in r)if(s.toLowerCase()===n[i]){o=r[s];break}if(null===o)return null;r=o}return r}r.decryptCrowdsale=function(t,e){var r=JSON.parse(t);e=y(e);var n=l.getAddress(b(r,"ethaddr")),i=g(b(r,"encseed"));if(!i||i.length%16!=0)throw new Error("invalid encseed");var s=f.pbkdf2(e,e,2e3,32,"sha256").slice(0,16),a=i.slice(0,16),h=i.slice(16),m=new o.default.ModeOfOperation.cbc(s,a),v=c.arrayify(m.decrypt(h));v=o.default.padding.pkcs7.strip(v);for(var w="",_=0;_<v.length;_++)w+=String.fromCharCode(v[_]);var M=p.toUtf8Bytes(w),k=new u.SigningKey(d.keccak256(M));if(k.address!==n)throw new Error("corrupt crowdsale wallet");return k},r.decrypt=function(t,e,r){function n(t,e){var r=g(b(i,"crypto/ciphertext"));if(c.hexlify(function(t,e){return d.keccak256(c.concat([t,e]))}(t.slice(16,32),r)).substring(2)!==b(i,"crypto/mac").toLowerCase())return e(new Error("invalid password")),null;var n=function(t,e){if("aes-128-ctr"!==b(i,"crypto/cipher"))return null;var r=g(b(i,"crypto/cipherparams/iv")),n=new o.default.Counter(r),s=new o.default.ModeOfOperation.ctr(t,n);return c.arrayify(s.decrypt(e))}(t.slice(0,16),r),s=t.slice(32,64);if(!n)return e(new Error("unsupported cipher")),null;var a=new u.SigningKey(n);if(i.address&&a.address!==l.getAddress(i.address))return e(new Error("address mismatch")),null;if("0.1"===b(i,"x-ethers/version")){var f=g(b(i,"x-ethers/mnemonicCiphertext")),p=g(b(i,"x-ethers/mnemonicCounter")),m=new o.default.Counter(p),v=new o.default.ModeOfOperation.ctr(s,m),y=b(i,"x-ethers/path")||h.defaultPath,w=c.arrayify(v.decrypt(f)),_=h.entropyToMnemonic(w),M=h.fromMnemonic(_).derivePath(y);if(M.privateKey!=c.hexlify(n))return e(new Error("mnemonic mismatch")),null;a=new u.SigningKey(M)}return a}var i=JSON.parse(t),a=y(e);return new Promise((function(t,e){var o=b(i,"crypto/kdf");if(o&&"string"==typeof o)if("scrypt"===o.toLowerCase()){var u=g(b(i,"crypto/kdfparams/salt")),h=parseInt(b(i,"crypto/kdfparams/n")),l=parseInt(b(i,"crypto/kdfparams/r")),d=parseInt(b(i,"crypto/kdfparams/p"));if(!h||!l||!d)return void e(new Error("unsupported key-derivation function parameters"));if(0!=(h&h-1))return void e(new Error("unsupported key-derivation function parameter value for N"));if(32!==(v=parseInt(b(i,"crypto/kdfparams/dklen"))))return void e(new Error("unsupported key-derivation derived-key length"));r&&r(0),s.default(a,u,h,l,d,64,(function(i,o,s){if(i)i.progress=o,e(i);else if(s){var a=n(s=c.arrayify(s),e);if(!a)return;r&&r(1),t(a)}else if(r)return r(o)}))}else if("pbkdf2"===o.toLowerCase()){u=g(b(i,"crypto/kdfparams/salt"));var p=null,m=b(i,"crypto/kdfparams/prf");if("hmac-sha256"===m)p="sha256";else{if("hmac-sha512"!==m)return void e(new Error("unsupported prf"));p="sha512"}var v,y=parseInt(b(i,"crypto/kdfparams/c"));if(32!==(v=parseInt(b(i,"crypto/kdfparams/dklen"))))return void e(new Error("unsupported key-derivation derived-key length"));var w=n(f.pbkdf2(a,u,y,v,p),e);if(!w)return;t(w)}else e(new Error("unsupported key-derivation function"));else e(new Error("unsupported key-derivation function"))}))},r.encrypt=function(t,e,r,n){var i;if("function"!=typeof r||n||(n=r,r={}),r=r||{},32!==(i=u.SigningKey.isSigningKey(t)?c.arrayify(t.privateKey):c.arrayify(t)).length)throw new Error("invalid private key");var l=y(e),f=null;if(r.entropy&&(f=c.arrayify(r.entropy)),r.mnemonic)if(f){if(h.entropyToMnemonic(f)!==r.mnemonic)throw new Error("entropy and mnemonic mismatch")}else f=c.arrayify(h.mnemonicToEntropy(r.mnemonic));var p=r.path;f&&!p&&(p=h.defaultPath);var g,b=r.client;b=b||"ethers.js",g=r.salt?c.arrayify(r.salt):m.randomBytes(32);var w=null;if(r.iv){if(16!==(w=c.arrayify(r.iv)).length)throw new Error("invalid iv")}else w=m.randomBytes(16);var _=null;if(r.uuid){if(16!==(_=c.arrayify(r.uuid)).length)throw new Error("invalid uuid")}else _=m.randomBytes(16);var M=1<<17,k=8,x=1;return r.scrypt&&(r.scrypt.N&&(M=r.scrypt.N),r.scrypt.r&&(k=r.scrypt.r),r.scrypt.p&&(x=r.scrypt.p)),new Promise((function(t,e){n&&n(0),s.default(l,g,M,k,x,64,(function(r,s,h){if(r)r.progress=s,e(r);else if(h){var l=(h=c.arrayify(h)).slice(0,16),y=h.slice(16,32),A=h.slice(32,64),S=new u.SigningKey(i).address,E=new o.default.Counter(w),N=new o.default.ModeOfOperation.ctr(l,E),P=c.arrayify(N.encrypt(i)),T=d.keccak256(c.concat([y,P])),I={address:S.substring(2).toLowerCase(),id:a.default.v4({random:_}),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:c.hexlify(w).substring(2)},ciphertext:c.hexlify(P).substring(2),kdf:"scrypt",kdfparams:{salt:c.hexlify(g).substring(2),n:M,dklen:32,p:x,r:k},mac:T.substring(2)}};if(f){var R=m.randomBytes(16),C=new o.default.Counter(R),O=new o.default.ModeOfOperation.ctr(A,C),B=c.arrayify(O.encrypt(f)),D=new Date,L=D.getUTCFullYear()+"-"+v(D.getUTCMonth()+1,2)+"-"+v(D.getUTCDate(),2)+"T"+v(D.getUTCHours(),2)+"-"+v(D.getUTCMinutes(),2)+"-"+v(D.getUTCSeconds(),2)+".0Z";I["x-ethers"]={client:b,gethFilename:"UTC--"+L+"--"+I.address,mnemonicCounter:c.hexlify(R).substring(2),mnemonicCiphertext:c.hexlify(B).substring(2),path:p,version:"0.1"}}n&&n(1),t(JSON.stringify(I))}else if(n)return n(s)}))}))}},{"./address":59,"./bytes":63,"./hdnode":65,"./keccak256":70,"./pbkdf2":72,"./random-bytes":74,"./signing-key":80,"./utf8":84,"aes-js":8,"scrypt-js":43,uuid:47}],78:[function(t,e,r){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0});var i=n(t("hash.js")),o=t("./bytes");r.ripemd160=function(t){return"0x"+i.default.ripemd160().update(o.arrayify(t)).digest("hex")},r.sha256=function(t){return"0x"+i.default.sha256().update(o.arrayify(t)).digest("hex")},r.sha512=function(t){return"0x"+i.default.sha512().update(o.arrayify(t)).digest("hex")}},{"./bytes":63,"hash.js":27}],79:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0}),t("setimmediate"),r.platform="browser"},{setimmediate:44}],80:[function(t,e,r){var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=t("./hdnode"),o=t("./bytes"),s=t("./properties"),a=t("./secp256k1"),u=n(t("../errors")),h=(l.prototype.signDigest=function(t){return this.keyPair.sign(t)},l.prototype.computeSharedSecret=function(t){return this.keyPair.computeSharedSecret(o.arrayify(t))},l.isSigningKey=function(t){return s.isType(t,"SigningKey")},l);function l(t){var e;u.checkNew(this,l),e=i.HDNode.isHDNode(t)?(s.defineReadOnly(this,"mnemonic",t.mnemonic),s.defineReadOnly(this,"path",t.path),o.arrayify(t.privateKey)):("string"==typeof t&&t.match(/^[0-9a-f]*$/i)&&64===t.length&&(t="0x"+t),o.arrayify(t));try{32!==e.length&&u.throwError("exactly 32 bytes required",u.INVALID_ARGUMENT,{arg:"privateKey",value:"[REDACTED]"})}catch(t){var r={arg:"privateKey",reason:t.reason,value:"[REDACTED]"};t.value&&("number"==typeof t.value.length&&(r.length=t.value.length),r.type=typeof t.value),u.throwError("invalid private key",t.code,r)}s.defineReadOnly(this,"privateKey",o.hexlify(e)),s.defineReadOnly(this,"keyPair",new a.KeyPair(e)),s.defineReadOnly(this,"publicKey",this.keyPair.publicKey),s.defineReadOnly(this,"address",a.computeAddress(this.keyPair.publicKey)),s.setType(this,"SigningKey")}r.SigningKey=h},{"../errors":5,"./bytes":63,"./hdnode":65,"./properties":73,"./secp256k1":76}],81:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0});var n=t("./bignumber"),i=t("./bytes"),o=t("./utf8"),s=t("./keccak256"),a=t("./sha2"),u=new RegExp("^bytes([0-9]+)$"),h=new RegExp("^(u?int)([0-9]*)$"),l=new RegExp("^(.*)\\[([0-9]*)\\]$"),c="0000000000000000000000000000000000000000000000000000000000000000";function f(t,e){if(t.length!=e.length)throw new Error("type/value count mismatch");var r=[];return t.forEach((function(t,s){r.push(function t(e,r,s){switch(e){case"address":return s?i.padZeros(r,32):i.arrayify(r);case"string":return o.toUtf8Bytes(r);case"bytes":return i.arrayify(r);case"bool":return r=r?"0x01":"0x00",s?i.padZeros(r,32):i.arrayify(r)}var a=e.match(h);if(a){if((f=parseInt(a[2]||"256"))%8!=0||0===f||256<f)throw new Error("invalid number type - "+e);return s&&(f=256),r=n.bigNumberify(r).toTwos(f),i.padZeros(r,f/8)}if(a=e.match(u)){var f=parseInt(a[1]);if(String(f)!=a[1]||0===f||32<f)throw new Error("invalid number type - "+e);if(i.arrayify(r).byteLength!==f)throw new Error("invalid value for "+e);return s?i.arrayify((r+c).substring(0,66)):r}if((a=e.match(l))&&Array.isArray(r)){var d=a[1];if(parseInt(a[2]||String(r.length))!=r.length)throw new Error("invalid value for "+e);var p=[];return r.forEach((function(e){p.push(t(d,e,!0))})),i.concat(p)}throw new Error("unknown type - "+e)}(t,e[s]))})),i.hexlify(i.concat(r))}r.pack=f,r.keccak256=function(t,e){return s.keccak256(f(t,e))},r.sha256=function(t,e){return a.sha256(f(t,e))}},{"./bignumber":62,"./bytes":63,"./keccak256":70,"./sha2":78,"./utf8":84}],82:[function(t,e,r){var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=t("../constants"),o=n(t("../errors")),s=t("./secp256k1"),a=t("./address"),u=t("./bignumber"),h=t("./bytes"),l=t("./keccak256"),c=t("./properties"),f=n(t("./rlp")),d=t("../providers/abstract-provider");function p(t){return"0x"===t?i.Zero:u.bigNumberify(t)}var m=[{name:"nonce",maxLength:32},{name:"gasPrice",maxLength:32},{name:"gasLimit",maxLength:32},{name:"to",length:20},{name:"value",maxLength:32},{name:"data"}],g={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0};r.serialize=function(t,e){c.checkProperties(t,g);var r=[];m.forEach((function(e){var n=t[e.name]||[];n=h.arrayify(h.hexlify(n)),e.length&&n.length!==e.length&&0<n.length&&o.throwError("invalid length for "+e.name,o.INVALID_ARGUMENT,{arg:"transaction"+e.name,value:n}),e.maxLength&&(n=h.stripZeros(n)).length>e.maxLength&&o.throwError("invalid length for "+e.name,o.INVALID_ARGUMENT,{arg:"transaction"+e.name,value:n}),r.push(h.hexlify(n))})),null!=t.chainId&&0!==t.chainId&&(r.push(h.hexlify(t.chainId)),r.push("0x"),r.push("0x"));var n=f.encode(r);if(!e)return n;var i=h.splitSignature(e),s=27+i.recoveryParam;return 9===r.length&&(r.pop(),r.pop(),r.pop(),s+=2*t.chainId+8),r.push(h.hexlify(s)),r.push(h.stripZeros(h.arrayify(i.r))),r.push(h.stripZeros(h.arrayify(i.s))),f.encode(r)},r.parse=function(t){var e=f.decode(t);9!==e.length&&6!==e.length&&o.throwError("invalid raw transaction",o.INVALID_ARGUMENT,{arg:"rawTransactin",value:t});var r={nonce:p(e[0]).toNumber(),gasPrice:p(e[1]),gasLimit:p(e[2]),to:function(t){return"0x"===t?null:a.getAddress(t)}(e[3]),value:p(e[4]),data:e[5],chainId:0};if(6===e.length)return r;try{r.v=u.bigNumberify(e[6]).toNumber()}catch(t){return o.info(t),r}if(r.r=h.hexZeroPad(e[7],32),r.s=h.hexZeroPad(e[8],32),u.bigNumberify(r.r).isZero()&&u.bigNumberify(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);var n=r.v-27,i=e.slice(0,6);0!==r.chainId&&(i.push(h.hexlify(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);var c=l.keccak256(f.encode(i));try{r.from=s.recoverAddress(c,{r:h.hexlify(r.r),s:h.hexlify(r.s),recoveryParam:n})}catch(t){o.info(t)}r.hash=l.keccak256(t)}return r},r.populateTransaction=function(t,e,r){d.Provider.isProvider(e)||o.throwError("missing provider",o.INVALID_ARGUMENT,{argument:"provider",value:e}),c.checkProperties(t,g);var n=c.shallowCopy(t);if(null!=n.to&&(n.to=e.resolveName(n.to)),null==n.gasPrice&&(n.gasPrice=e.getGasPrice()),null==n.nonce&&(n.nonce=e.getTransactionCount(r)),null==n.gasLimit){var i=c.shallowCopy(n);i.from=r,n.gasLimit=e.estimateGas(i)}return null==n.chainId&&(n.chainId=e.getNetwork().then((function(t){return t.chainId}))),c.resolveProperties(n)}},{"../constants":3,"../errors":5,"../providers/abstract-provider":49,"./address":59,"./bignumber":62,"./bytes":63,"./keccak256":70,"./properties":73,"./rlp":75,"./secp256k1":76}],83:[function(t,e,r){var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i,o=t("../constants"),s=n(t("../errors")),a=t("./bignumber"),u={};function h(t){return{decimals:t.length-1,tenPower:a.bigNumberify(t)}}function l(t){var e=u[String(t).toLowerCase()];if(!e&&"number"==typeof t&&parseInt(String(t))==t&&0<=t&&t<=256){for(var r="1",n=0;n<t;n++)r+="0";e=h(r)}return e||s.throwError("invalid unitType",s.INVALID_ARGUMENT,{argument:"name",value:t}),e}function c(t,e){var r=l(e),n=(t=a.bigNumberify(t)).lt(o.Zero);n&&(t=t.mul(o.NegativeOne));for(var i=t.mod(r.tenPower).toString();i.length<r.decimals;)i="0"+i;return i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1],t=t.div(r.tenPower).toString()+"."+i,n&&(t="-"+t),t}function f(t,e){null==e&&(e=18);var r=l(e);if("string"==typeof t&&t.match(/^-?[0-9.,]+$/)||s.throwError("invalid decimal value",s.INVALID_ARGUMENT,{arg:"value",value:t}),0===r.decimals)return a.bigNumberify(t);var n="-"===t.substring(0,1);n&&(t=t.substring(1)),"."===t&&s.throwError("missing value",s.INVALID_ARGUMENT,{arg:"value",value:t});var i=t.split(".");2<i.length&&s.throwError("too many decimal points",s.INVALID_ARGUMENT,{arg:"value",value:t});var u=i[0],h=i[1];for(u=u||"0",(h=h||"0").length>r.decimals&&s.throwError("underflow occurred",s.NUMERIC_FAULT,{operation:"division",fault:"underflow"});h.length<r.decimals;)h+="0";var c=a.bigNumberify(u),f=a.bigNumberify(h),d=c.mul(r.tenPower).add(f);return n&&(d=d.mul(o.NegativeOne)),d}i="1",["wei","kwei","Mwei","Gwei","szabo","finney","ether"].forEach((function(t){var e=h(i);u[t.toLowerCase()]=e,u[String(e.decimals)]=e,i+="000"})),r.commify=function(t){var e=String(t).split(".");(2<e.length||!e[0].match(/^-?[0-9]*$/)||e[1]&&!e[1].match(/^[0-9]*$/)||"."===t||"-."===t)&&s.throwError("invalid value",s.INVALID_ARGUMENT,{argument:"value",value:t});var r=e[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");var i="";2===e.length&&(i="."+(e[1]||"0"));for(var o=[];r.length;){if(r.length<=3){o.unshift(r);break}var a=r.length-3;o.unshift(r.substring(a)),r=r.substring(0,a)}return n+o.join(",")+i},r.formatUnits=c,r.parseUnits=f,r.formatEther=function(t){return c(t,18)},r.parseEther=function(t){return f(t,18)}},{"../constants":3,"../errors":5,"./bignumber":62}],84:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0});var n,i,o=t("../constants"),s=t("../errors"),a=t("./bytes");function u(t,e){void 0===e&&(e=n.current),e!=n.current&&(s.checkNormalize(),t=t.normalize(e));for(var r=[],i=0;i<t.length;i++){var o=t.charCodeAt(i);if(o<128)r.push(o);else if(o<2048)r.push(o>>6|192),r.push(63&o|128);else if(55296==(64512&o)){i++;var u=t.charCodeAt(i);if(i>=t.length||56320!=(64512&u))throw new Error("invalid utf-8 string");o=65536+((1023&o)<<10)+(1023&u),r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(63&o|128)}else r.push(o>>12|224),r.push(o>>6&63|128),r.push(63&o|128)}return a.arrayify(r)}function h(t,e){t=a.arrayify(t);for(var r="",n=0;n<t.length;){var i=t[n++];if(i>>7!=0){var o=null,s=null;if(192==(224&i))o=1,s=127;else if(224==(240&i))o=2,s=2047;else{if(240!=(248&i)){if(e)continue;if(128==(192&i))throw new Error("invalid utf8 byte sequence; unexpected continuation byte");throw new Error("invalid utf8 byte sequence; invalid prefix")}o=3,s=65535}if(n+o>t.length){if(!e)throw new Error("invalid utf8 byte sequence; too short");for(;n<t.length&&t[n]>>6==2;n++);}else{for(var u=i&(1<<8-o-1)-1,h=0;h<o;h++){var l=t[n];if(128!=(192&l)){u=null;break}u=u<<6|63&l,n++}if(null!==u)if(u<=s){if(!e)throw new Error("invalid utf8 byte sequence; overlong")}else if(1114111<u){if(!e)throw new Error("invalid utf8 byte sequence; out-of-range")}else if(55296<=u&&u<=57343){if(!e)throw new Error("invalid utf8 byte sequence; utf-16 surrogate")}else u<=65535?r+=String.fromCharCode(u):(u-=65536,r+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u)));else if(!e)throw new Error("invalid utf8 byte sequence; invalid continuation byte")}}else r+=String.fromCharCode(i)}return r}(i=n=r.UnicodeNormalizationForm||(r.UnicodeNormalizationForm={})).current="",i.NFC="NFC",i.NFD="NFD",i.NFKC="NFKC",i.NFKD="NFKD",r.toUtf8Bytes=u,r.toUtf8String=h,r.formatBytes32String=function(t){var e=u(t);if(31<e.length)throw new Error("bytes32 string must be less than 32 bytes");return a.hexlify(a.concat([e,o.HashZero]).slice(0,32))},r.parseBytes32String=function(t){var e=a.arrayify(t);if(32!==e.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==e[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===e[r-1];)r--;return h(e.slice(0,r))}},{"../constants":3,"../errors":5,"./bytes":63}],85:[function(t,e,r){var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=t("xmlhttprequest"),o=t("./base64"),s=t("./properties"),a=t("./utf8"),u=n(t("../errors"));r.fetchJson=function(t,e,r){var n={},s=null,h=12e4;if("string"==typeof t)s=t;else if("object"==typeof t){if(null==t.url&&u.throwError("missing URL",u.MISSING_ARGUMENT,{arg:"url"}),s=t.url,"number"==typeof t.timeout&&0<t.timeout&&(h=t.timeout),t.headers)for(var l in t.headers)n[l.toLowerCase()]={key:l,value:String(t.headers[l])};if(null!=t.user&&null!=t.password){"https:"!==s.substring(0,6)&&!0!==t.allowInsecure&&u.throwError("basic authentication requires a secure https url",u.INVALID_ARGUMENT,{arg:"url",url:s,user:t.user,password:"[REDACTED]"});var c=t.user+":"+t.password;n.authorization={key:"Authorization",value:"Basic "+o.encode(a.toUtf8Bytes(c))}}}return new Promise((function(t,o){var a=new i.XMLHttpRequest,u=null;function l(){null!=u&&(clearTimeout(u),u=null)}u=setTimeout((function(){null!=u&&(u=null,o(new Error("timeout")),setTimeout((function(){a.abort()}),0))}),h),e?(a.open("POST",s,!0),n["content-type"]={key:"Content-Type",value:"application/json"}):a.open("GET",s,!0),Object.keys(n).forEach((function(t){var e=n[t];a.setRequestHeader(e.key,e.value)})),a.onreadystatechange=function(){if(4===a.readyState){if(200!=a.status){l();var n=new Error("invalid response - "+a.status);return n.statusCode=a.status,a.responseText&&(n.responseText=a.responseText),void o(n)}var i=null;try{i=JSON.parse(a.responseText)}catch(n){l();var u=new Error("invalid json response");return u.orginialError=n,u.responseText=a.responseText,null!=e&&(u.requestBody=e),u.url=s,void o(u)}if(r)try{i=r(i)}catch(n){return l(),n.url=s,n.body=e,n.responseText=a.responseText,void o(n)}l(),t(i)}},a.onerror=function(t){l(),o(t)};try{null!=e?a.send(e):a.send()}catch(u){l();var c=new Error("connection error");c.error=u,o(c)}}))},r.poll=function(t,e){return e=e||{},null==(e=s.shallowCopy(e)).floor&&(e.floor=0),null==e.ceiling&&(e.ceiling=1e4),null==e.interval&&(e.interval=250),new Promise((function(r,n){var i=null,o=!1,s=function(){return!o&&(o=!0,i&&clearTimeout(i),!0)};e.timeout&&(i=setTimeout((function(){s()&&n(new Error("timeout"))}),e.timeout));var a=e.fastRetry||null,u=0;!function i(){return t().then((function(t){if(void 0!==t)s()&&r(t);else if(e.onceBlock)e.onceBlock.once("block",i);else if(!o){u++;var n=e.interval*parseInt(String(Math.random()*Math.pow(2,u)));n<e.floor&&(n=e.floor),n>e.ceiling&&(n=e.ceiling),a&&(u--,n=a,a=null),setTimeout(i,n)}return null}),(function(t){s()&&n(t)}))}()}))}},{"../errors":5,"./base64":60,"./properties":73,"./utf8":84,xmlhttprequest:48}],86:[function(t,e,r){(function(e){Object.defineProperty(r,"__esModule",{value:!0});var n=t("../utils/hash"),i=t("../utils/properties");r.check=function(t){for(var e=[],r=0;r<2048;r++){var i=t.getWord(r);if(r!==t.getWordIndex(i))return"0x";e.push(i)}return n.id(e.join("\n")+"\n")};var o=(s.prototype.split=function(t){return t.toLowerCase().split(/ +/g)},s.prototype.join=function(t){return t.join(" ")},s);function s(t){i.defineReadOnly(this,"locale",t)}r.Wordlist=o,r.register=function(t,e){e=e||t.locale}}).call(this,void 0!==Y?Y:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils/hash":64,"../utils/properties":73}],87:[function(t,e,r){var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var s,a=t("./utils/bytes"),u=t("./utils/hash"),h=t("./utils/hdnode"),l=t("./utils/json-wallet"),c=t("./utils/keccak256"),f=t("./utils/properties"),d=t("./utils/random-bytes"),p=o(t("./utils/secret-storage")),m=t("./utils/signing-key"),g=t("./utils/transaction"),v=t("./abstract-signer"),y=t("./providers/abstract-provider"),b=o(t("./errors")),w=(i(_,s=v.Signer),Object.defineProperty(_.prototype,"address",{get:function(){return this.signingKey.address},enumerable:!0,configurable:!0}),Object.defineProperty(_.prototype,"mnemonic",{get:function(){return this.signingKey.mnemonic},enumerable:!0,configurable:!0}),Object.defineProperty(_.prototype,"path",{get:function(){return this.signingKey.path},enumerable:!0,configurable:!0}),Object.defineProperty(_.prototype,"privateKey",{get:function(){return this.signingKey.privateKey},enumerable:!0,configurable:!0}),_.prototype.connect=function(t){return y.Provider.isProvider(t)||b.throwError("invalid provider",b.INVALID_ARGUMENT,{argument:"provider",value:t}),new _(this.signingKey,t)},_.prototype.getAddress=function(){return Promise.resolve(this.address)},_.prototype.sign=function(t){var e=this;return f.resolveProperties(t).then((function(t){var r=g.serialize(t),n=e.signingKey.signDigest(c.keccak256(r));return g.serialize(t,n)}))},_.prototype.signMessage=function(t){return Promise.resolve(a.joinSignature(this.signingKey.signDigest(u.hashMessage(t))))},_.prototype.getBalance=function(t){if(!this.provider)throw new Error("missing provider");return this.provider.getBalance(this.address,t)},_.prototype.getTransactionCount=function(t){if(!this.provider)throw new Error("missing provider");return this.provider.getTransactionCount(this.address,t)},_.prototype.sendTransaction=function(t){var e=this;if(!this.provider)throw new Error("missing provider");return null==t.nonce&&((t=f.shallowCopy(t)).nonce=this.getTransactionCount("pending")),g.populateTransaction(t,this.provider,this.address).then((function(t){return e.sign(t).then((function(t){return e.provider.sendTransaction(t)}))}))},_.prototype.encrypt=function(t,e,r){if("function"!=typeof e||r||(r=e,e={}),r&&"function"!=typeof r)throw new Error("invalid callback");return e=e||{},this.mnemonic&&((e=f.shallowCopy(e)).mnemonic=this.mnemonic,e.path=this.path),p.encrypt(this.privateKey,t,e,r)},_.createRandom=function(t){var e=d.randomBytes(16);(t=t||{}).extraEntropy&&(e=a.arrayify(c.keccak256(a.concat([e,t.extraEntropy])).substring(0,34)));var r=h.entropyToMnemonic(e,t.locale);return _.fromMnemonic(r,t.path,t.locale)},_.fromEncryptedJson=function(t,e,r){if(l.isCrowdsaleWallet(t))try{r&&r(0);var n=p.decryptCrowdsale(t,e);return r&&r(1),Promise.resolve(new _(n))}catch(t){return Promise.reject(t)}else if(l.isSecretStorageWallet(t))return p.decrypt(t,e,r).then((function(t){return new _(t)}));return Promise.reject("invalid wallet JSON")},_.fromMnemonic=function(t,e,r){return e=e||h.defaultPath,new _(h.fromMnemonic(t,r).derivePath(e))},_);function _(t,e){var r=s.call(this)||this;return b.checkNew(r,_),m.SigningKey.isSigningKey(t)?f.defineReadOnly(r,"signingKey",t):f.defineReadOnly(r,"signingKey",new m.SigningKey(t)),f.defineReadOnly(r,"provider",e),r}r.Wallet=w},{"./abstract-signer":2,"./errors":5,"./providers/abstract-provider":49,"./utils/bytes":63,"./utils/hash":64,"./utils/hdnode":65,"./utils/json-wallet":69,"./utils/keccak256":70,"./utils/properties":73,"./utils/random-bytes":74,"./utils/secret-storage":77,"./utils/signing-key":80,"./utils/transaction":82}],88:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0});var n=t("../wordlists/lang-en").langEn;r.en=n},{"../wordlists/lang-en":89}],89:[function(t,e,r){var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0});var o,s=t("../utils/wordlist"),a="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo",u=null;function h(t){if(null==u&&(u=a.replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==s.check(t)))throw u=null,new Error("BIP39 Wordlist for en (English) FAILED")}function l(){return o.call(this,"en")||this}var c=new(i(l,o=s.Wordlist),l.prototype.getWord=function(t){return h(this),u[t]},l.prototype.getWordIndex=function(t){return h(this),u.indexOf(t)},l);r.langEn=c,s.register(c)},{"../utils/wordlist":86}]},{},[7])(7)})),it=(rt=nt)&&rt.__esModule&&Object.prototype.hasOwnProperty.call(rt,"default")?rt.default:rt;var ot=new class{constructor(t=localStorage){this.storage=t}get(t,e){const r=this.storage.getItem(t);return void 0===r?e:JSON.parse(r)}set(t,e,r){let n;if(e instanceof Function){n=e(this.get(t,r))}else n=e;return this.storage.setItem(t,JSON.stringify(n)),n}has(t){return void 0!==this.storage[t]}getsert(t,e){return this.has(t)||this.set(t,e),this.get(t)}writable(t,e){const r=K(this.getsert(t,e));return r.subscribe(e=>{this.set(t,e)}),r}},st={abi:[{inputs:[{internalType:"address[]",name:"solutions",type:"address[]"},{internalType:"bytes32[]",name:"quests",type:"bytes32[]"}],payable:!1,stateMutability:"nonpayable",type:"constructor",signature:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"completedChapter",type:"uint256"},{indexed:!0,internalType:"address",name:"player",type:"address"}],name:"ChapterCompleted",type:"event",signature:"0x2eba109031d1dc66e58c335884697c94f36785182e2b5dac5f706b8647a5c582"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event",signature:"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0"},{constant:!0,inputs:[{internalType:"uint96",name:"",type:"uint96"},{internalType:"uint256",name:"",type:"uint256"}],name:"_chapterToPlayers",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function",signature:"0xa6bd257a"},{constant:!0,inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"_gameMasters",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function",signature:"0x3b81720a"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"}],name:"_playerToCurrentChapter",outputs:[{internalType:"uint96",name:"",type:"uint96"}],payable:!1,stateMutability:"view",type:"function",signature:"0x3ba29810"},{constant:!0,inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"_players",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function",signature:"0x41587823"},{constant:!0,inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"_quests",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function",signature:"0x29d64921"},{constant:!0,inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"_solutions",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function",signature:"0x2d49241c"},{constant:!0,inputs:[],name:"isOwner",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function",signature:"0x8f32d59b"},{constant:!0,inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function",signature:"0x8da5cb5b"},{constant:!1,inputs:[],name:"renounceOwnership",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function",signature:"0x715018a6"},{constant:!1,inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function",signature:"0xf2fde38b"},{constant:!1,inputs:[{internalType:"address",name:"solution",type:"address"},{internalType:"bytes32",name:"nextQuest",type:"bytes32"}],name:"addChapter",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function",signature:"0x8a0a184b"},{constant:!1,inputs:[{internalType:"address",name:"gameMaster",type:"address"}],name:"addGameMaster",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function",signature:"0x8b1c7b10"},{constant:!0,inputs:[],name:"totalChapters",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function",signature:"0x0db4e5f1"},{constant:!0,inputs:[],name:"currentChapter",outputs:[{internalType:"uint96",name:"",type:"uint96"}],payable:!1,stateMutability:"view",type:"function",signature:"0x76f0a0e8"},{constant:!0,inputs:[],name:"currentQuest",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function",signature:"0x5582fffd"},{constant:!1,inputs:[{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"submit",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function",signature:"0x8006a174"},{constant:!0,inputs:[{internalType:"address",name:"a",type:"address"}],name:"getAddressHash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"pure",type:"function",signature:"0xbbfff461"},{constant:!0,inputs:[{internalType:"uint256",name:"page",type:"uint256"}],name:"getLeaderboard",outputs:[{internalType:"uint256[32]",name:"leaderboard",type:"uint256[32]"}],payable:!1,stateMutability:"view",type:"function",signature:"0xa34b46fe"}],networks:{4:{events:{"0x2eba109031d1dc66e58c335884697c94f36785182e2b5dac5f706b8647a5c582":{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"completedChapter",type:"uint256"},{indexed:!0,internalType:"address",name:"player",type:"address"}],name:"ChapterCompleted",type:"event",signature:"0x2eba109031d1dc66e58c335884697c94f36785182e2b5dac5f706b8647a5c582"},"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event",signature:"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0"}},links:{},address:"0x4D9529698d112939AD540BC33cAf11809fD1d684",transactionHash:"0x43120772c29339ee43971660b5374ee8778f8affd65c60295ba80ecdc82f2746"},5:{events:{"0x2eba109031d1dc66e58c335884697c94f36785182e2b5dac5f706b8647a5c582":{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"completedChapter",type:"uint256"},{indexed:!0,internalType:"address",name:"player",type:"address"}],name:"ChapterCompleted",type:"event",signature:"0x2eba109031d1dc66e58c335884697c94f36785182e2b5dac5f706b8647a5c582"},"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event",signature:"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0"}},links:{},address:"0x90170454a90801c5D3907e33E39716E4D9423205",transactionHash:"0xe36c0b782b7bc6f40f193ebfb7d2257da9e42f969c98fa54ea0a789d7e6dba9f"},666666:{events:{"0x2eba109031d1dc66e58c335884697c94f36785182e2b5dac5f706b8647a5c582":{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"completedChapter",type:"uint256"},{indexed:!0,internalType:"address",name:"player",type:"address"}],name:"ChapterCompleted",type:"event",signature:"0x2eba109031d1dc66e58c335884697c94f36785182e2b5dac5f706b8647a5c582"},"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event",signature:"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0"}},links:{},address:"0x6bEeAd2F926D3b48E5afbbE642158365541B7A58",transactionHash:"0x51f844ca05750a473882e0b6ef991bc149e6691ee062e8ec66e43781becba60f"}}},at=et((function(t){const e=(t,r=e.BTC)=>{const n=t.length;if(0===n)return"";const i=r.length,o="string"==typeof t,s=[0];for(let e=0;e<n;++e){let r=o?t.charCodeAt(e):t[e];for(let t=0;t<s.length;++t)r+=s[t]<<8,s[t]=r%i,r=r/i|0;for(;r>0;)s.push(r%i),r=r/i|0}let a="";const u=r[0];for(let e=0;0===(o?t.charCodeAt(e):t[e])&&e<n-1;++e)a+=u;for(let t=s.length-1;t>=0;--t)a+=r[s[t]];return a};e.BTC="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",e.XRP="rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz",t.exports=e,e.default=e})),ut=et((function(t,e){var r;t.exports=(r=r||function(t,e){var r=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),n={},i=n.lib={},o=i.Base={extend:function(t){var e=r(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},s=i.WordArray=o.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||u).stringify(this)},concat:function(t){var e=this.words,r=t.words,n=this.sigBytes,i=t.sigBytes;if(this.clamp(),n%4)for(var o=0;o<i;o++){var s=r[o>>>2]>>>24-o%4*8&255;e[n+o>>>2]|=s<<24-(n+o)%4*8}else for(o=0;o<i;o+=4)e[n+o>>>2]=r[o>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=o.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var r,n=[],i=function(e){e=e;var r=987654321,n=4294967295;return function(){var i=((r=36969*(65535&r)+(r>>16)&n)<<16)+(e=18e3*(65535&e)+(e>>16)&n)&n;return i/=4294967296,(i+=.5)*(t.random()>.5?1:-1)}},o=0;o<e;o+=4){var a=i(4294967296*(r||t.random()));r=987654071*a(),n.push(4294967296*a()|0)}return new s.init(n,e)}}),a=n.enc={},u=a.Hex={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i<r;i++){var o=e[i>>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n<e;n+=2)r[n>>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new s.init(r,e/2)}},h=a.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i<r;i++){var o=e[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n<e;n++)r[n>>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new s.init(r,e)}},l=a.Utf8={stringify:function(t){try{return decodeURIComponent(escape(h.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return h.parse(unescape(encodeURIComponent(t)))}},c=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=l.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r=this._data,n=r.words,i=r.sigBytes,o=this.blockSize,a=i/(4*o),u=(a=e?t.ceil(a):t.max((0|a)-this._minBufferSize,0))*o,h=t.min(4*u,i);if(u){for(var l=0;l<u;l+=o)this._doProcessBlock(n,l);var c=n.splice(0,u);r.sigBytes-=h}return new s.init(c,h)},clone:function(){var t=o.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),f=(i.Hasher=c.extend({cfg:o.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){c.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,r){return new t.init(r).finalize(e)}},_createHmacHelper:function(t){return function(e,r){return new f.HMAC.init(t,r).finalize(e)}}}),n.algo={});return n}(Math),r)})),ht=(et((function(t,e){var r,n,i,o,s,a;t.exports=(n=(r=a=ut).lib,i=n.Base,o=n.WordArray,(s=r.x64={}).Word=i.extend({init:function(t,e){this.high=t,this.low=e}}),s.WordArray=i.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:8*t.length},toX32:function(){for(var t=this.words,e=t.length,r=[],n=0;n<e;n++){var i=t[n];r.push(i.high),r.push(i.low)}return o.create(r,this.sigBytes)},clone:function(){for(var t=i.clone.call(this),e=t.words=this.words.slice(0),r=e.length,n=0;n<r;n++)e[n]=e[n].clone();return t}}),a)})),et((function(t,e){var r;t.exports=(r=ut,function(){if("function"==typeof ArrayBuffer){var t=r.lib.WordArray,e=t.init;(t.init=function(t){if(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),(t instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array)&&(t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)),t instanceof Uint8Array){for(var r=t.byteLength,n=[],i=0;i<r;i++)n[i>>>2]|=t[i]<<24-i%4*8;e.call(this,n,r)}else e.apply(this,arguments)}).prototype=t}}(),r.lib.WordArray)})),et((function(t,e){var r;t.exports=(r=ut,function(){var t=r,e=t.lib.WordArray,n=t.enc;function i(t){return t<<8&4278255360|t>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i<r;i+=2){var o=e[i>>>2]>>>16-i%4*8&65535;n.push(String.fromCharCode(o))}return n.join("")},parse:function(t){for(var r=t.length,n=[],i=0;i<r;i++)n[i>>>1]|=t.charCodeAt(i)<<16-i%2*16;return e.create(n,2*r)}},n.Utf16LE={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],o=0;o<r;o+=2){var s=i(e[o>>>2]>>>16-o%4*8&65535);n.push(String.fromCharCode(s))}return n.join("")},parse:function(t){for(var r=t.length,n=[],o=0;o<r;o++)n[o>>>1]|=i(t.charCodeAt(o)<<16-o%2*16);return e.create(n,2*r)}}}(),r.enc.Utf16)})),et((function(t,e){var r,n,i;t.exports=(n=(r=i=ut).lib.WordArray,r.enc.Base64={stringify:function(t){var e=t.words,r=t.sigBytes,n=this._map;t.clamp();for(var i=[],o=0;o<r;o+=3)for(var s=(e[o>>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a<r;a++)i.push(n.charAt(s>>>6*(3-a)&63));var u=n.charAt(64);if(u)for(;i.length%4;)i.push(u);return i.join("")},parse:function(t){var e=t.length,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o<r.length;o++)i[r.charCodeAt(o)]=o}var s=r.charAt(64);if(s){var a=t.indexOf(s);-1!==a&&(e=a)}return function(t,e,r){for(var i=[],o=0,s=0;s<e;s++)if(s%4){var a=r[t.charCodeAt(s-1)]<<s%4*2,u=r[t.charCodeAt(s)]>>>6-s%4*2;i[o>>>2]|=(a|u)<<24-o%4*8,o++}return n.create(i,o)}(t,e,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},i.enc.Base64)})),et((function(t,e){var r;t.exports=(r=ut,function(t){var e=r,n=e.lib,i=n.WordArray,o=n.Hasher,s=e.algo,a=[];!function(){for(var e=0;e<64;e++)a[e]=4294967296*t.abs(t.sin(e+1))|0}();var u=s.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var r=0;r<16;r++){var n=e+r,i=t[n];t[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,s=t[e+0],u=t[e+1],d=t[e+2],p=t[e+3],m=t[e+4],g=t[e+5],v=t[e+6],y=t[e+7],b=t[e+8],w=t[e+9],_=t[e+10],M=t[e+11],k=t[e+12],x=t[e+13],A=t[e+14],S=t[e+15],E=o[0],N=o[1],P=o[2],T=o[3];E=h(E,N,P,T,s,7,a[0]),T=h(T,E,N,P,u,12,a[1]),P=h(P,T,E,N,d,17,a[2]),N=h(N,P,T,E,p,22,a[3]),E=h(E,N,P,T,m,7,a[4]),T=h(T,E,N,P,g,12,a[5]),P=h(P,T,E,N,v,17,a[6]),N=h(N,P,T,E,y,22,a[7]),E=h(E,N,P,T,b,7,a[8]),T=h(T,E,N,P,w,12,a[9]),P=h(P,T,E,N,_,17,a[10]),N=h(N,P,T,E,M,22,a[11]),E=h(E,N,P,T,k,7,a[12]),T=h(T,E,N,P,x,12,a[13]),P=h(P,T,E,N,A,17,a[14]),E=l(E,N=h(N,P,T,E,S,22,a[15]),P,T,u,5,a[16]),T=l(T,E,N,P,v,9,a[17]),P=l(P,T,E,N,M,14,a[18]),N=l(N,P,T,E,s,20,a[19]),E=l(E,N,P,T,g,5,a[20]),T=l(T,E,N,P,_,9,a[21]),P=l(P,T,E,N,S,14,a[22]),N=l(N,P,T,E,m,20,a[23]),E=l(E,N,P,T,w,5,a[24]),T=l(T,E,N,P,A,9,a[25]),P=l(P,T,E,N,p,14,a[26]),N=l(N,P,T,E,b,20,a[27]),E=l(E,N,P,T,x,5,a[28]),T=l(T,E,N,P,d,9,a[29]),P=l(P,T,E,N,y,14,a[30]),E=c(E,N=l(N,P,T,E,k,20,a[31]),P,T,g,4,a[32]),T=c(T,E,N,P,b,11,a[33]),P=c(P,T,E,N,M,16,a[34]),N=c(N,P,T,E,A,23,a[35]),E=c(E,N,P,T,u,4,a[36]),T=c(T,E,N,P,m,11,a[37]),P=c(P,T,E,N,y,16,a[38]),N=c(N,P,T,E,_,23,a[39]),E=c(E,N,P,T,x,4,a[40]),T=c(T,E,N,P,s,11,a[41]),P=c(P,T,E,N,p,16,a[42]),N=c(N,P,T,E,v,23,a[43]),E=c(E,N,P,T,w,4,a[44]),T=c(T,E,N,P,k,11,a[45]),P=c(P,T,E,N,S,16,a[46]),E=f(E,N=c(N,P,T,E,d,23,a[47]),P,T,s,6,a[48]),T=f(T,E,N,P,y,10,a[49]),P=f(P,T,E,N,A,15,a[50]),N=f(N,P,T,E,g,21,a[51]),E=f(E,N,P,T,k,6,a[52]),T=f(T,E,N,P,p,10,a[53]),P=f(P,T,E,N,_,15,a[54]),N=f(N,P,T,E,u,21,a[55]),E=f(E,N,P,T,b,6,a[56]),T=f(T,E,N,P,S,10,a[57]),P=f(P,T,E,N,v,15,a[58]),N=f(N,P,T,E,x,21,a[59]),E=f(E,N,P,T,m,6,a[60]),T=f(T,E,N,P,M,10,a[61]),P=f(P,T,E,N,d,15,a[62]),N=f(N,P,T,E,w,21,a[63]),o[0]=o[0]+E|0,o[1]=o[1]+N|0,o[2]=o[2]+P|0,o[3]=o[3]+T|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;r[i>>>5]|=128<<24-i%32;var o=t.floor(n/4294967296),s=n;r[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),e.sigBytes=4*(r.length+1),this._process();for(var a=this._hash,u=a.words,h=0;h<4;h++){var l=u[h];u[h]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return a},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function h(t,e,r,n,i,o,s){var a=t+(e&r|~e&n)+i+s;return(a<<o|a>>>32-o)+e}function l(t,e,r,n,i,o,s){var a=t+(e&n|r&~n)+i+s;return(a<<o|a>>>32-o)+e}function c(t,e,r,n,i,o,s){var a=t+(e^r^n)+i+s;return(a<<o|a>>>32-o)+e}function f(t,e,r,n,i,o,s){var a=t+(r^(e|~n))+i+s;return(a<<o|a>>>32-o)+e}e.MD5=o._createHelper(u),e.HmacMD5=o._createHmacHelper(u)}(Math),r.MD5)})),et((function(t,e){var r,n,i,o,s,a,u,h;t.exports=(n=(r=h=ut).lib,i=n.WordArray,o=n.Hasher,s=r.algo,a=[],u=s.SHA1=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],s=r[3],u=r[4],h=0;h<80;h++){if(h<16)a[h]=0|t[e+h];else{var l=a[h-3]^a[h-8]^a[h-14]^a[h-16];a[h]=l<<1|l>>>31}var c=(n<<5|n>>>27)+u+a[h];c+=h<20?1518500249+(i&o|~i&s):h<40?1859775393+(i^o^s):h<60?(i&o|i&s|o&s)-1894007588:(i^o^s)-899497514,u=s,s=o,o=i<<30|i>>>2,i=n,n=c}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+u|0},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,n=8*t.sigBytes;return e[n>>>5]|=128<<24-n%32,e[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),e[15+(n+64>>>9<<4)]=r,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}}),r.SHA1=o._createHelper(u),r.HmacSHA1=o._createHmacHelper(u),h.SHA1)})),et((function(t,e){var r;t.exports=(r=ut,function(t){var e=r,n=e.lib,i=n.WordArray,o=n.Hasher,s=e.algo,a=[],u=[];!function(){function e(e){for(var r=t.sqrt(e),n=2;n<=r;n++)if(!(e%n))return!1;return!0}function r(t){return 4294967296*(t-(0|t))|0}for(var n=2,i=0;i<64;)e(n)&&(i<8&&(a[i]=r(t.pow(n,.5))),u[i]=r(t.pow(n,1/3)),i++),n++}();var h=[],l=s.SHA256=o.extend({_doReset:function(){this._hash=new i.init(a.slice(0))},_doProcessBlock:function(t,e){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],s=r[3],a=r[4],l=r[5],c=r[6],f=r[7],d=0;d<64;d++){if(d<16)h[d]=0|t[e+d];else{var p=h[d-15],m=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,g=h[d-2],v=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;h[d]=m+h[d-7]+v+h[d-16]}var y=n&i^n&o^i&o,b=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),w=f+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&l^~a&c)+u[d]+h[d];f=c,c=l,l=a,a=s+w|0,s=o,o=i,i=n,n=w+(b+y)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0,r[5]=r[5]+l|0,r[6]=r[6]+c|0,r[7]=r[7]+f|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=t.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=o._createHelper(l),e.HmacSHA256=o._createHmacHelper(l)}(Math),r.SHA256)})),et((function(t,e){var r,n,i,o,s,a;t.exports=(n=(r=a=ut).lib.WordArray,i=r.algo,o=i.SHA256,s=i.SHA224=o.extend({_doReset:function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=o._doFinalize.call(this);return t.sigBytes-=4,t}}),r.SHA224=o._createHelper(s),r.HmacSHA224=o._createHmacHelper(s),a.SHA224)})),et((function(t,e){var r;t.exports=(r=ut,function(){var t=r,e=t.lib.Hasher,n=t.x64,i=n.Word,o=n.WordArray,s=t.algo;function a(){return i.create.apply(i,arguments)}var u=[a(1116352408,3609767458),a(1899447441,602891725),a(3049323471,3964484399),a(3921009573,2173295548),a(961987163,4081628472),a(1508970993,3053834265),a(2453635748,2937671579),a(2870763221,3664609560),a(3624381080,2734883394),a(310598401,1164996542),a(607225278,1323610764),a(1426881987,3590304994),a(1925078388,4068182383),a(2162078206,991336113),a(2614888103,633803317),a(3248222580,3479774868),a(3835390401,2666613458),a(4022224774,944711139),a(264347078,2341262773),a(604807628,2007800933),a(770255983,1495990901),a(1249150122,1856431235),a(1555081692,3175218132),a(1996064986,2198950837),a(2554220882,3999719339),a(2821834349,766784016),a(2952996808,2566594879),a(3210313671,3203337956),a(3336571891,1034457026),a(3584528711,2466948901),a(113926993,3758326383),a(338241895,168717936),a(666307205,1188179964),a(773529912,1546045734),a(1294757372,1522805485),a(1396182291,2643833823),a(1695183700,2343527390),a(1986661051,1014477480),a(2177026350,1206759142),a(2456956037,344077627),a(2730485921,1290863460),a(2820302411,3158454273),a(3259730800,3505952657),a(3345764771,106217008),a(3516065817,3606008344),a(3600352804,1432725776),a(4094571909,1467031594),a(275423344,851169720),a(430227734,3100823752),a(506948616,1363258195),a(659060556,3750685593),a(883997877,3785050280),a(958139571,3318307427),a(1322822218,3812723403),a(1537002063,2003034995),a(1747873779,3602036899),a(1955562222,1575990012),a(2024104815,1125592928),a(2227730452,2716904306),a(2361852424,442776044),a(2428436474,593698344),a(2756734187,3733110249),a(3204031479,2999351573),a(3329325298,3815920427),a(3391569614,3928383900),a(3515267271,566280711),a(3940187606,3454069534),a(4118630271,4000239992),a(116418474,1914138554),a(174292421,2731055270),a(289380356,3203993006),a(460393269,320620315),a(685471733,587496836),a(852142971,1086792851),a(1017036298,365543100),a(1126000580,2618297676),a(1288033470,3409855158),a(1501505948,4234509866),a(1607167915,987167468),a(1816402316,1246189591)],h=[];!function(){for(var t=0;t<80;t++)h[t]=a()}();var l=s.SHA512=e.extend({_doReset:function(){this._hash=new o.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],s=r[3],a=r[4],l=r[5],c=r[6],f=r[7],d=n.high,p=n.low,m=i.high,g=i.low,v=o.high,y=o.low,b=s.high,w=s.low,_=a.high,M=a.low,k=l.high,x=l.low,A=c.high,S=c.low,E=f.high,N=f.low,P=d,T=p,I=m,R=g,C=v,O=y,B=b,D=w,L=_,U=M,F=k,z=x,j=A,H=S,$=E,G=N,q=0;q<80;q++){var K=h[q];if(q<16)var V=K.high=0|t[e+2*q],W=K.low=0|t[e+2*q+1];else{var Z=h[q-15],J=Z.high,X=Z.low,Q=(J>>>1|X<<31)^(J>>>8|X<<24)^J>>>7,Y=(X>>>1|J<<31)^(X>>>8|J<<24)^(X>>>7|J<<25),tt=h[q-2],et=tt.high,rt=tt.low,nt=(et>>>19|rt<<13)^(et<<3|rt>>>29)^et>>>6,it=(rt>>>19|et<<13)^(rt<<3|et>>>29)^(rt>>>6|et<<26),ot=h[q-7],st=ot.high,at=ot.low,ut=h[q-16],ht=ut.high,lt=ut.low;V=(V=(V=Q+st+((W=Y+at)>>>0<Y>>>0?1:0))+nt+((W+=it)>>>0<it>>>0?1:0))+ht+((W+=lt)>>>0<lt>>>0?1:0),K.high=V,K.low=W}var ct,ft=L&F^~L&j,dt=U&z^~U&H,pt=P&I^P&C^I&C,mt=T&R^T&O^R&O,gt=(P>>>28|T<<4)^(P<<30|T>>>2)^(P<<25|T>>>7),vt=(T>>>28|P<<4)^(T<<30|P>>>2)^(T<<25|P>>>7),yt=(L>>>14|U<<18)^(L>>>18|U<<14)^(L<<23|U>>>9),bt=(U>>>14|L<<18)^(U>>>18|L<<14)^(U<<23|L>>>9),wt=u[q],_t=wt.high,Mt=wt.low,kt=$+yt+((ct=G+bt)>>>0<G>>>0?1:0),xt=vt+mt;$=j,G=H,j=F,H=z,F=L,z=U,L=B+(kt=(kt=(kt=kt+ft+((ct+=dt)>>>0<dt>>>0?1:0))+_t+((ct+=Mt)>>>0<Mt>>>0?1:0))+V+((ct+=W)>>>0<W>>>0?1:0))+((U=D+ct|0)>>>0<D>>>0?1:0)|0,B=C,D=O,C=I,O=R,I=P,R=T,P=kt+(gt+pt+(xt>>>0<vt>>>0?1:0))+((T=ct+xt|0)>>>0<ct>>>0?1:0)|0}p=n.low=p+T,n.high=d+P+(p>>>0<T>>>0?1:0),g=i.low=g+R,i.high=m+I+(g>>>0<R>>>0?1:0),y=o.low=y+O,o.high=v+C+(y>>>0<O>>>0?1:0),w=s.low=w+D,s.high=b+B+(w>>>0<D>>>0?1:0),M=a.low=M+U,a.high=_+L+(M>>>0<U>>>0?1:0),x=l.low=x+z,l.high=k+F+(x>>>0<z>>>0?1:0),S=c.low=S+H,c.high=A+j+(S>>>0<H>>>0?1:0),N=f.low=N+G,f.high=E+$+(N>>>0<G>>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,n=8*t.sigBytes;return e[n>>>5]|=128<<24-n%32,e[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),e[31+(n+128>>>10<<5)]=r,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=e.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});t.SHA512=e._createHelper(l),t.HmacSHA512=e._createHmacHelper(l)}(),r.SHA512)})),et((function(t,e){var r,n,i,o,s,a,u,h;t.exports=(n=(r=h=ut).x64,i=n.Word,o=n.WordArray,s=r.algo,a=s.SHA512,u=s.SHA384=a.extend({_doReset:function(){this._hash=new o.init([new i.init(3418070365,3238371032),new i.init(1654270250,914150663),new i.init(2438529370,812702999),new i.init(355462360,4144912697),new i.init(1731405415,4290775857),new i.init(2394180231,1750603025),new i.init(3675008525,1694076839),new i.init(1203062813,3204075428)])},_doFinalize:function(){var t=a._doFinalize.call(this);return t.sigBytes-=16,t}}),r.SHA384=a._createHelper(u),r.HmacSHA384=a._createHmacHelper(u),h.SHA384)})),et((function(t,e){var r;t.exports=(r=ut,function(t){var e=r,n=e.lib,i=n.WordArray,o=n.Hasher,s=e.x64.Word,a=e.algo,u=[],h=[],l=[];!function(){for(var t=1,e=0,r=0;r<24;r++){u[t+5*e]=(r+1)*(r+2)/2%64;var n=(2*t+3*e)%5;t=e%5,e=n}for(t=0;t<5;t++)for(e=0;e<5;e++)h[t+5*e]=e+(2*t+3*e)%5*5;for(var i=1,o=0;o<24;o++){for(var a=0,c=0,f=0;f<7;f++){if(1&i){var d=(1<<f)-1;d<32?c^=1<<d:a^=1<<d-32}128&i?i=i<<1^113:i<<=1}l[o]=s.create(a,c)}}();var c=[];!function(){for(var t=0;t<25;t++)c[t]=s.create()}();var f=a.SHA3=o.extend({cfg:o.cfg.extend({outputLength:512}),_doReset:function(){for(var t=this._state=[],e=0;e<25;e++)t[e]=new s.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(t,e){for(var r=this._state,n=this.blockSize/2,i=0;i<n;i++){var o=t[e+2*i],s=t[e+2*i+1];o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),s=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),(N=r[i]).high^=s,N.low^=o}for(var a=0;a<24;a++){for(var f=0;f<5;f++){for(var d=0,p=0,m=0;m<5;m++)d^=(N=r[f+5*m]).high,p^=N.low;var g=c[f];g.high=d,g.low=p}for(f=0;f<5;f++){var v=c[(f+4)%5],y=c[(f+1)%5],b=y.high,w=y.low;for(d=v.high^(b<<1|w>>>31),p=v.low^(w<<1|b>>>31),m=0;m<5;m++)(N=r[f+5*m]).high^=d,N.low^=p}for(var _=1;_<25;_++){var M=(N=r[_]).high,k=N.low,x=u[_];x<32?(d=M<<x|k>>>32-x,p=k<<x|M>>>32-x):(d=k<<x-32|M>>>64-x,p=M<<x-32|k>>>64-x);var A=c[h[_]];A.high=d,A.low=p}var S=c[0],E=r[0];for(S.high=E.high,S.low=E.low,f=0;f<5;f++)for(m=0;m<5;m++){var N=r[_=f+5*m],P=c[_],T=c[(f+1)%5+5*m],I=c[(f+2)%5+5*m];N.high=P.high^~T.high&I.high,N.low=P.low^~T.low&I.low}N=r[0];var R=l[a];N.high^=R.high,N.low^=R.low}},_doFinalize:function(){var e=this._data,r=e.words,n=(this._nDataBytes,8*e.sigBytes),o=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(t.ceil((n+1)/o)*o>>>5)-1]|=128,e.sigBytes=4*r.length,this._process();for(var s=this._state,a=this.cfg.outputLength/8,u=a/8,h=[],l=0;l<u;l++){var c=s[l],f=c.high,d=c.low;f=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),h.push(d),h.push(f)}return new i.init(h,a)},clone:function(){for(var t=o.clone.call(this),e=t._state=this._state.slice(0),r=0;r<25;r++)e[r]=e[r].clone();return t}});e.SHA3=o._createHelper(f),e.HmacSHA3=o._createHmacHelper(f)}(Math),r.SHA3)})),et((function(t,e){var r;t.exports=(r=ut,
/** @preserve
(c) 2012 by Cédric Mesnil. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
function(t){var e=r,n=e.lib,i=n.WordArray,o=n.Hasher,s=e.algo,a=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),u=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),h=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),l=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),c=i.create([0,1518500249,1859775393,2400959708,2840853838]),f=i.create([1352829926,1548603684,1836072691,2053994217,0]),d=s.RIPEMD160=o.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=0;r<16;r++){var n=e+r,i=t[n];t[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o,s,d,w,_,M,k,x,A,S,E,N=this._hash.words,P=c.words,T=f.words,I=a.words,R=u.words,C=h.words,O=l.words;for(M=o=N[0],k=s=N[1],x=d=N[2],A=w=N[3],S=_=N[4],r=0;r<80;r+=1)E=o+t[e+I[r]]|0,E+=r<16?p(s,d,w)+P[0]:r<32?m(s,d,w)+P[1]:r<48?g(s,d,w)+P[2]:r<64?v(s,d,w)+P[3]:y(s,d,w)+P[4],E=(E=b(E|=0,C[r]))+_|0,o=_,_=w,w=b(d,10),d=s,s=E,E=M+t[e+R[r]]|0,E+=r<16?y(k,x,A)+T[0]:r<32?v(k,x,A)+T[1]:r<48?g(k,x,A)+T[2]:r<64?m(k,x,A)+T[3]:p(k,x,A)+T[4],E=(E=b(E|=0,O[r]))+S|0,M=S,S=A,A=b(x,10),x=k,k=E;E=N[1]+d+A|0,N[1]=N[2]+w+S|0,N[2]=N[3]+_+M|0,N[3]=N[4]+o+k|0,N[4]=N[0]+s+x|0,N[0]=E},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,n=8*t.sigBytes;e[n>>>5]|=128<<24-n%32,e[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(e.length+1),this._process();for(var i=this._hash,o=i.words,s=0;s<5;s++){var a=o[s];o[s]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return i},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function p(t,e,r){return t^e^r}function m(t,e,r){return t&e|~t&r}function g(t,e,r){return(t|~e)^r}function v(t,e,r){return t&r|e&~r}function y(t,e,r){return t^(e|~r)}function b(t,e){return t<<e|t>>>32-e}e.RIPEMD160=o._createHelper(d),e.HmacRIPEMD160=o._createHmacHelper(d)}(),r.RIPEMD160)})),et((function(t,e){var r,n,i;t.exports=(n=(r=ut).lib.Base,i=r.enc.Utf8,void(r.algo.HMAC=n.extend({init:function(t,e){t=this._hasher=new t.init,"string"==typeof e&&(e=i.parse(e));var r=t.blockSize,n=4*r;e.sigBytes>n&&(e=t.finalize(e)),e.clamp();for(var o=this._oKey=e.clone(),s=this._iKey=e.clone(),a=o.words,u=s.words,h=0;h<r;h++)a[h]^=1549556828,u[h]^=909522486;o.sigBytes=s.sigBytes=n,this.reset()},reset:function(){var t=this._hasher;t.reset(),t.update(this._iKey)},update:function(t){return this._hasher.update(t),this},finalize:function(t){var e=this._hasher,r=e.finalize(t);return e.reset(),e.finalize(this._oKey.clone().concat(r))}})))})),et((function(t,e){var r,n,i,o,s,a,u,h,l;t.exports=(n=(r=l=ut).lib,i=n.Base,o=n.WordArray,s=r.algo,a=s.SHA1,u=s.HMAC,h=s.PBKDF2=i.extend({cfg:i.extend({keySize:4,hasher:a,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r=this.cfg,n=u.create(r.hasher,t),i=o.create(),s=o.create([1]),a=i.words,h=s.words,l=r.keySize,c=r.iterations;a.length<l;){var f=n.update(e).finalize(s);n.reset();for(var d=f.words,p=d.length,m=f,g=1;g<c;g++){m=n.finalize(m),n.reset();for(var v=m.words,y=0;y<p;y++)d[y]^=v[y]}i.concat(f),h[0]++}return i.sigBytes=4*l,i}}),r.PBKDF2=function(t,e,r){return h.create(r).compute(t,e)},l.PBKDF2)})),et((function(t,e){var r,n,i,o,s,a,u,h;t.exports=(n=(r=h=ut).lib,i=n.Base,o=n.WordArray,s=r.algo,a=s.MD5,u=s.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:a,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r=this.cfg,n=r.hasher.create(),i=o.create(),s=i.words,a=r.keySize,u=r.iterations;s.length<a;){h&&n.update(h);var h=n.update(t).finalize(e);n.reset();for(var l=1;l<u;l++)h=n.finalize(h),n.reset();i.concat(h)}return i.sigBytes=4*a,i}}),r.EvpKDF=function(t,e,r){return u.create(r).compute(t,e)},h.EvpKDF)})),et((function(t,e){var r,n,i,o,s,a,u,h,l,c,f,d,p,m,g,v,y,b,w,_;t.exports=void((r=ut).lib.Cipher||(i=r,o=i.lib,s=o.Base,a=o.WordArray,u=o.BufferedBlockAlgorithm,h=i.enc,h.Utf8,l=h.Base64,c=i.algo.EvpKDF,f=o.Cipher=u.extend({cfg:s.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,r){this.cfg=this.cfg.extend(r),this._xformMode=t,this._key=e,this.reset()},reset:function(){u.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function t(t){return"string"==typeof t?_:b}return function(e){return{encrypt:function(r,n,i){return t(n).encrypt(e,r,n,i)},decrypt:function(r,n,i){return t(n).decrypt(e,r,n,i)}}}}()}),o.StreamCipher=f.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),d=i.mode={},p=o.BlockCipherMode=s.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}}),m=d.CBC=function(){var t=p.extend();function e(t,e,r){var i=this._iv;if(i){var o=i;this._iv=n}else o=this._prevBlock;for(var s=0;s<r;s++)t[e+s]^=o[s]}return t.Encryptor=t.extend({processBlock:function(t,r){var n=this._cipher,i=n.blockSize;e.call(this,t,r,i),n.encryptBlock(t,r),this._prevBlock=t.slice(r,r+i)}}),t.Decryptor=t.extend({processBlock:function(t,r){var n=this._cipher,i=n.blockSize,o=t.slice(r,r+i);n.decryptBlock(t,r),e.call(this,t,r,i),this._prevBlock=o}}),t}(),g=(i.pad={}).Pkcs7={pad:function(t,e){for(var r=4*e,n=r-t.sigBytes%r,i=n<<24|n<<16|n<<8|n,o=[],s=0;s<n;s+=4)o.push(i);var u=a.create(o,n);t.concat(u)},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},o.BlockCipher=f.extend({cfg:f.cfg.extend({mode:m,padding:g}),reset:function(){f.reset.call(this);var t=this.cfg,e=t.iv,r=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=r.createEncryptor;else n=r.createDecryptor,this._minBufferSize=1;this._mode&&this._mode.__creator==n?this._mode.init(this,e&&e.words):(this._mode=n.call(r,this,e&&e.words),this._mode.__creator=n)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){t.pad(this._data,this.blockSize);var e=this._process(!0)}else e=this._process(!0),t.unpad(e);return e},blockSize:4}),v=o.CipherParams=s.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),y=(i.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,r=t.salt;if(r)var n=a.create([1398893684,1701076831]).concat(r).concat(e);else n=e;return n.toString(l)},parse:function(t){var e=l.parse(t),r=e.words;if(1398893684==r[0]&&1701076831==r[1]){var n=a.create(r.slice(2,4));r.splice(0,4),e.sigBytes-=16}return v.create({ciphertext:e,salt:n})}},b=o.SerializableCipher=s.extend({cfg:s.extend({format:y}),encrypt:function(t,e,r,n){n=this.cfg.extend(n);var i=t.createEncryptor(r,n),o=i.finalize(e),s=i.cfg;return v.create({ciphertext:o,key:r,iv:s.iv,algorithm:t,mode:s.mode,padding:s.padding,blockSize:t.blockSize,formatter:n.format})},decrypt:function(t,e,r,n){return n=this.cfg.extend(n),e=this._parse(e,n.format),t.createDecryptor(r,n).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),w=(i.kdf={}).OpenSSL={execute:function(t,e,r,n){n||(n=a.random(8));var i=c.create({keySize:e+r}).compute(t,n),o=a.create(i.words.slice(e),4*r);return i.sigBytes=4*e,v.create({key:i,iv:o,salt:n})}},_=o.PasswordBasedCipher=b.extend({cfg:b.cfg.extend({kdf:w}),encrypt:function(t,e,r,n){var i=(n=this.cfg.extend(n)).kdf.execute(r,t.keySize,t.ivSize);n.iv=i.iv;var o=b.encrypt.call(this,t,e,i.key,n);return o.mixIn(i),o},decrypt:function(t,e,r,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var i=n.kdf.execute(r,t.keySize,t.ivSize,e.salt);return n.iv=i.iv,b.decrypt.call(this,t,e,i.key,n)}})))})),et((function(t,e){var r;t.exports=((r=ut).mode.CFB=function(){var t=r.lib.BlockCipherMode.extend();function e(t,e,r,n){var i=this._iv;if(i){var o=i.slice(0);this._iv=void 0}else o=this._prevBlock;n.encryptBlock(o,0);for(var s=0;s<r;s++)t[e+s]^=o[s]}return t.Encryptor=t.extend({processBlock:function(t,r){var n=this._cipher,i=n.blockSize;e.call(this,t,r,i,n),this._prevBlock=t.slice(r,r+i)}}),t.Decryptor=t.extend({processBlock:function(t,r){var n=this._cipher,i=n.blockSize,o=t.slice(r,r+i);e.call(this,t,r,i,n),this._prevBlock=o}}),t}(),r.mode.CFB)})),et((function(t,e){var r,n,i;t.exports=((i=ut).mode.CTR=(r=i.lib.BlockCipherMode.extend(),n=r.Encryptor=r.extend({processBlock:function(t,e){var r=this._cipher,n=r.blockSize,i=this._iv,o=this._counter;i&&(o=this._counter=i.slice(0),this._iv=void 0);var s=o.slice(0);r.encryptBlock(s,0),o[n-1]=o[n-1]+1|0;for(var a=0;a<n;a++)t[e+a]^=s[a]}}),r.Decryptor=n,r),i.mode.CTR)})),et((function(t,e){var r;t.exports=(
/** @preserve
* Counter block mode compatible with Dr Brian Gladman fileenc.c
* derived from CryptoJS.mode.CTR
* Jan Hruby [email protected]
*/
(r=ut).mode.CTRGladman=function(){var t=r.lib.BlockCipherMode.extend();function e(t){if(255==(t>>24&255)){var e=t>>16&255,r=t>>8&255,n=255&t;255===e?(e=0,255===r?(r=0,255===n?n=0:++n):++r):++e,t=0,t+=e<<16,t+=r<<8,t+=n}else t+=1<<24;return t}var n=t.Encryptor=t.extend({processBlock:function(t,r){var n=this._cipher,i=n.blockSize,o=this._iv,s=this._counter;o&&(s=this._counter=o.slice(0),this._iv=void 0),function(t){0===(t[0]=e(t[0]))&&(t[1]=e(t[1]))}(s);var a=s.slice(0);n.encryptBlock(a,0);for(var u=0;u<i;u++)t[r+u]^=a[u]}});return t.Decryptor=n,t}(),r.mode.CTRGladman)})),et((function(t,e){var r,n,i;t.exports=((i=ut).mode.OFB=(r=i.lib.BlockCipherMode.extend(),n=r.Encryptor=r.extend({processBlock:function(t,e){var r=this._cipher,n=r.blockSize,i=this._iv,o=this._keystream;i&&(o=this._keystream=i.slice(0),this._iv=void 0),r.encryptBlock(o,0);for(var s=0;s<n;s++)t[e+s]^=o[s]}}),r.Decryptor=n,r),i.mode.OFB)})),et((function(t,e){var r,n;t.exports=((n=ut).mode.ECB=((r=n.lib.BlockCipherMode.extend()).Encryptor=r.extend({processBlock:function(t,e){this._cipher.encryptBlock(t,e)}}),r.Decryptor=r.extend({processBlock:function(t,e){this._cipher.decryptBlock(t,e)}}),r),n.mode.ECB)})),et((function(t,e){var r;t.exports=((r=ut).pad.AnsiX923={pad:function(t,e){var r=t.sigBytes,n=4*e,i=n-r%n,o=r+i-1;t.clamp(),t.words[o>>>2]|=i<<24-o%4*8,t.sigBytes+=i},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},r.pad.Ansix923)})),et((function(t,e){var r;t.exports=((r=ut).pad.Iso10126={pad:function(t,e){var n=4*e,i=n-t.sigBytes%n;t.concat(r.lib.WordArray.random(i-1)).concat(r.lib.WordArray.create([i<<24],1))},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},r.pad.Iso10126)})),et((function(t,e){var r;t.exports=((r=ut).pad.Iso97971={pad:function(t,e){t.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(t,e)},unpad:function(t){r.pad.ZeroPadding.unpad(t),t.sigBytes--}},r.pad.Iso97971)})),et((function(t,e){var r;t.exports=((r=ut).pad.ZeroPadding={pad:function(t,e){var r=4*e;t.clamp(),t.sigBytes+=r-(t.sigBytes%r||r)},unpad:function(t){for(var e=t.words,r=t.sigBytes-1;!(e[r>>>2]>>>24-r%4*8&255);)r--;t.sigBytes=r+1}},r.pad.ZeroPadding)})),et((function(t,e){var r;t.exports=((r=ut).pad.NoPadding={pad:function(){},unpad:function(){}},r.pad.NoPadding)})),et((function(t,e){var r,n,i,o;t.exports=(n=(r=o=ut).lib.CipherParams,i=r.enc.Hex,r.format.Hex={stringify:function(t){return t.ciphertext.toString(i)},parse:function(t){var e=i.parse(t);return n.create({ciphertext:e})}},o.format.Hex)})),et((function(t,e){var r;t.exports=(r=ut,function(){var t=r,e=t.lib.BlockCipher,n=t.algo,i=[],o=[],s=[],a=[],u=[],h=[],l=[],c=[],f=[],d=[];!function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;var r=0,n=0;for(e=0;e<256;e++){var p=n^n<<1^n<<2^n<<3^n<<4;p=p>>>8^255&p^99,i[r]=p,o[p]=r;var m=t[r],g=t[m],v=t[g],y=257*t[p]^16843008*p;s[r]=y<<24|y>>>8,a[r]=y<<16|y>>>16,u[r]=y<<8|y>>>24,h[r]=y,y=16843009*v^65537*g^257*m^16843008*r,l[p]=y<<24|y>>>8,c[p]=y<<16|y>>>16,f[p]=y<<8|y>>>24,d[p]=y,r?(r=m^t[t[t[v^m]]],n^=t[t[n]]):r=n=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],m=n.AES=e.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,r=t.sigBytes/4,n=4*((this._nRounds=r+6)+1),o=this._keySchedule=[],s=0;s<n;s++)if(s<r)o[s]=e[s];else{var a=o[s-1];s%r?r>6&&s%r==4&&(a=i[a>>>24]<<24|i[a>>>16&255]<<16|i[a>>>8&255]<<8|i[255&a]):(a=i[(a=a<<8|a>>>24)>>>24]<<24|i[a>>>16&255]<<16|i[a>>>8&255]<<8|i[255&a],a^=p[s/r|0]<<24),o[s]=o[s-r]^a}for(var u=this._invKeySchedule=[],h=0;h<n;h++)s=n-h,a=h%4?o[s]:o[s-4],u[h]=h<4||s<=4?a:l[i[a>>>24]]^c[i[a>>>16&255]]^f[i[a>>>8&255]]^d[i[255&a]]}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,s,a,u,h,i)},decryptBlock:function(t,e){var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r,this._doCryptBlock(t,e,this._invKeySchedule,l,c,f,d,o),r=t[e+1],t[e+1]=t[e+3],t[e+3]=r},_doCryptBlock:function(t,e,r,n,i,o,s,a){for(var u=this._nRounds,h=t[e]^r[0],l=t[e+1]^r[1],c=t[e+2]^r[2],f=t[e+3]^r[3],d=4,p=1;p<u;p++){var m=n[h>>>24]^i[l>>>16&255]^o[c>>>8&255]^s[255&f]^r[d++],g=n[l>>>24]^i[c>>>16&255]^o[f>>>8&255]^s[255&h]^r[d++],v=n[c>>>24]^i[f>>>16&255]^o[h>>>8&255]^s[255&l]^r[d++],y=n[f>>>24]^i[h>>>16&255]^o[l>>>8&255]^s[255&c]^r[d++];h=m,l=g,c=v,f=y}m=(a[h>>>24]<<24|a[l>>>16&255]<<16|a[c>>>8&255]<<8|a[255&f])^r[d++],g=(a[l>>>24]<<24|a[c>>>16&255]<<16|a[f>>>8&255]<<8|a[255&h])^r[d++],v=(a[c>>>24]<<24|a[f>>>16&255]<<16|a[h>>>8&255]<<8|a[255&l])^r[d++],y=(a[f>>>24]<<24|a[h>>>16&255]<<16|a[l>>>8&255]<<8|a[255&c])^r[d++],t[e]=m,t[e+1]=g,t[e+2]=v,t[e+3]=y},keySize:8});t.AES=e._createHelper(m)}(),r.AES)})),et((function(t,e){var r;t.exports=(r=ut,function(){var t=r,e=t.lib,n=e.WordArray,i=e.BlockCipher,o=t.algo,s=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],a=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],u=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],h=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],c=o.DES=i.extend({_doReset:function(){for(var t=this._key.words,e=[],r=0;r<56;r++){var n=s[r]-1;e[r]=t[n>>>5]>>>31-n%32&1}for(var i=this._subKeys=[],o=0;o<16;o++){var h=i[o]=[],l=u[o];for(r=0;r<24;r++)h[r/6|0]|=e[(a[r]-1+l)%28]<<31-r%6,h[4+(r/6|0)]|=e[28+(a[r+24]-1+l)%28]<<31-r%6;for(h[0]=h[0]<<1|h[0]>>>31,r=1;r<7;r++)h[r]=h[r]>>>4*(r-1)+3;h[7]=h[7]<<5|h[7]>>>27}var c=this._invSubKeys=[];for(r=0;r<16;r++)c[r]=i[15-r]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(t,e,r){this._lBlock=t[e],this._rBlock=t[e+1],f.call(this,4,252645135),f.call(this,16,65535),d.call(this,2,858993459),d.call(this,8,16711935),f.call(this,1,1431655765);for(var n=0;n<16;n++){for(var i=r[n],o=this._lBlock,s=this._rBlock,a=0,u=0;u<8;u++)a|=h[u][((s^i[u])&l[u])>>>0];this._lBlock=s,this._rBlock=o^a}var c=this._lBlock;this._lBlock=this._rBlock,this._rBlock=c,f.call(this,1,1431655765),d.call(this,8,16711935),d.call(this,2,858993459),f.call(this,16,65535),f.call(this,4,252645135),t[e]=this._lBlock,t[e+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function f(t,e){var r=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=r,this._lBlock^=r<<t}function d(t,e){var r=(this._rBlock>>>t^this._lBlock)&e;this._lBlock^=r,this._rBlock^=r<<t}t.DES=i._createHelper(c);var p=o.TripleDES=i.extend({_doReset:function(){var t=this._key.words;this._des1=c.createEncryptor(n.create(t.slice(0,2))),this._des2=c.createEncryptor(n.create(t.slice(2,4))),this._des3=c.createEncryptor(n.create(t.slice(4,6)))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2});t.TripleDES=i._createHelper(p)}(),r.TripleDES)})),et((function(t,e){var r;t.exports=(r=ut,function(){var t=r,e=t.lib.StreamCipher,n=t.algo,i=n.RC4=e.extend({_doReset:function(){for(var t=this._key,e=t.words,r=t.sigBytes,n=this._S=[],i=0;i<256;i++)n[i]=i;i=0;for(var o=0;i<256;i++){var s=i%r,a=e[s>>>2]>>>24-s%4*8&255;o=(o+n[i]+a)%256;var u=n[i];n[i]=n[o],n[o]=u}this._i=this._j=0},_doProcessBlock:function(t,e){t[e]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var t=this._S,e=this._i,r=this._j,n=0,i=0;i<4;i++){r=(r+t[e=(e+1)%256])%256;var o=t[e];t[e]=t[r],t[r]=o,n|=t[(t[e]+t[r])%256]<<24-8*i}return this._i=e,this._j=r,n}t.RC4=e._createHelper(i);var s=n.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var t=this.cfg.drop;t>0;t--)o.call(this)}});t.RC4Drop=e._createHelper(s)}(),r.RC4)})),et((function(t,e){var r;t.exports=(r=ut,function(){var t=r,e=t.lib.StreamCipher,n=t.algo,i=[],o=[],s=[],a=n.Rabbit=e.extend({_doReset:function(){for(var t=this._key.words,e=this.cfg.iv,r=0;r<4;r++)t[r]=16711935&(t[r]<<8|t[r]>>>24)|4278255360&(t[r]<<24|t[r]>>>8);var n=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],i=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];for(this._b=0,r=0;r<4;r++)u.call(this);for(r=0;r<8;r++)i[r]^=n[r+4&7];if(e){var o=e.words,s=o[0],a=o[1],h=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),c=h>>>16|4294901760&l,f=l<<16|65535&h;for(i[0]^=h,i[1]^=c,i[2]^=l,i[3]^=f,i[4]^=h,i[5]^=c,i[6]^=l,i[7]^=f,r=0;r<4;r++)u.call(this)}},_doProcessBlock:function(t,e){var r=this._X;u.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),t[e+n]^=i[n]},blockSize:4,ivSize:2});function u(){for(var t=this._X,e=this._C,r=0;r<8;r++)o[r]=e[r];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0<o[0]>>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0<o[1]>>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0<o[2]>>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0<o[3]>>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0<o[4]>>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0<o[5]>>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0<o[6]>>>0?1:0)|0,this._b=e[7]>>>0<o[7]>>>0?1:0,r=0;r<8;r++){var n=t[r]+e[r],i=65535&n,a=n>>>16,u=((i*i>>>17)+i*a>>>15)+a*a,h=((4294901760&n)*n|0)+((65535&n)*n|0);s[r]=u^h}t[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,t[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,t[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,t[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,t[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,t[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,t[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,t[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}t.Rabbit=e._createHelper(a)}(),r.Rabbit)})),et((function(t,e){var r;t.exports=(r=ut,function(){var t=r,e=t.lib.StreamCipher,n=t.algo,i=[],o=[],s=[],a=n.RabbitLegacy=e.extend({_doReset:function(){var t=this._key.words,e=this.cfg.iv,r=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],n=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];this._b=0;for(var i=0;i<4;i++)u.call(this);for(i=0;i<8;i++)n[i]^=r[i+4&7];if(e){var o=e.words,s=o[0],a=o[1],h=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),c=h>>>16|4294901760&l,f=l<<16|65535&h;for(n[0]^=h,n[1]^=c,n[2]^=l,n[3]^=f,n[4]^=h,n[5]^=c,n[6]^=l,n[7]^=f,i=0;i<4;i++)u.call(this)}},_doProcessBlock:function(t,e){var r=this._X;u.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),t[e+n]^=i[n]},blockSize:4,ivSize:2});function u(){for(var t=this._X,e=this._C,r=0;r<8;r++)o[r]=e[r];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0<o[0]>>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0<o[1]>>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0<o[2]>>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0<o[3]>>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0<o[4]>>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0<o[5]>>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0<o[6]>>>0?1:0)|0,this._b=e[7]>>>0<o[7]>>>0?1:0,r=0;r<8;r++){var n=t[r]+e[r],i=65535&n,a=n>>>16,u=((i*i>>>17)+i*a>>>15)+a*a,h=((4294901760&n)*n|0)+((65535&n)*n|0);s[r]=u^h}t[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,t[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,t[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,t[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,t[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,t[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,t[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,t[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}t.RabbitLegacy=e._createHelper(a)}(),r.RabbitLegacy)})),et((function(t,e){t.exports=ut})));const lt={network:{IPFS_HOST:"ipfs.infura.io",IPFS_PORT:"5001",IPFS_PROTOCOL:"https",IPFS_LOCATION:"https://ipfs.infura.io/ipfs/",FUND_ENDPOINT:"https://gas-station.dist0rtion.com",ETH_ENDPOINT:"https://rinkeby.infura.io/v3/d8576e6686a94673890f22405bfc521b",ETH_NETWORK:"rinkeby"}};window.ethers=it;const ct=it.Wallet,ft={mnemonic:void 0,wallet:void 0},dt=ot.writable("lastTransactionMined",null),pt=ot.writable("network",lt.network.ETH_ENDPOINT),mt=ot.writable("mnemonic",()=>ct.createRandom().mnemonic),gt=ot.writable("current",{solution:void 0}),vt=V(mt,t=>(ft.mnemonic!==t&&(ft.mnemonic=t,ft.wallet=ct.fromMnemonic(t)),ft.wallet)),yt=V(pt,t=>new it.providers.JsonRpcProvider(t)),bt=V(yt,(t,e)=>{t.getNetwork().then(({chainId:t})=>e(t))}),wt=V([yt,vt],([t,e])=>e.connect(t)),_t=V([wt,bt],([t,e],r)=>{e&&r(new it.Contract(st.networks[e].address,st.abi,t))}),Mt=V(_t,async(t,e)=>{t&&e(await t.functions.totalChapters())}),kt=V([_t,gt,dt],async([t,e],r)=>{t&&r(await t.functions.currentChapter())}),xt=V([_t,gt,dt],async([t,e],r)=>{if(t){const n=(await t.functions.currentQuest()).replace("0x","0x1220"),i=it.utils.arrayify(n),o=at(i),s=lt.network.IPFS_LOCATION+o,a=await fetch(s);console.log("ipfs response:",a);const u=await a.text(),h=e.solution;if(void 0!==h){const t=it.utils.keccak256(it.utils.toUtf8Bytes(h));r(ht.AES.decrypt(u,t.toString()).toString(ht.enc.Utf8))}else r(u)}}),At=V([yt,vt],async([t,e],r)=>{const n=t=>r(t);t.on(e.address,n);const i=await t.getBalance(e.address);return n(i),()=>t.removeListener(e.address,n)}),St=V([At,vt],async([t,e],r)=>{if(void 0!==t)if("0"===t.toString())try{await fetch(`${lt.network.FUND_ENDPOINT}/tokens?address=${e.address}`,{mode:"no-cors"}),r({success:!0})}catch(t){r({success:!1,error:`Error: ${t.toString()}`})}else r({success:!0})});var Et=et((function(t,e){!function(e){var r={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}|~{3,})([^`~\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:g,table:g,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};function n(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||M.defaults,this.rules=r.normal,this.options.pedantic?this.rules=r.pedantic:this.options.gfm&&(this.rules=r.gfm)}r._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,r._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,r.def=f(r.def).replace("label",r._label).replace("title",r._title).getRegex(),r.bullet=/(?:[*+-]|\d{1,9}\.)/,r.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,r.item=f(r.item,"gm").replace(/bull/g,r.bullet).getRegex(),r.list=f(r.list).replace(/bull/g,r.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+r.def.source+")").getRegex(),r._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",r._comment=/<!--(?!-?>)[\s\S]*?-->/,r.html=f(r.html,"i").replace("comment",r._comment).replace("tag",r._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),r.paragraph=f(r._paragraph).replace("hr",r.hr).replace("heading"," {0,3}#{1,6} +").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}|~{3,})[^`\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",r._tag).getRegex(),r.blockquote=f(r.blockquote).replace("paragraph",r.paragraph).getRegex(),r.normal=v({},r),r.gfm=v({},r.normal,{nptable:/^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/,table:/^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/}),r.pedantic=v({},r.normal,{html:f("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",r._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:g,paragraph:f(r.normal._paragraph).replace("hr",r.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",r.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()}),n.rules=r,n.lex=function(t,e){return new n(e).lex(t)},n.prototype.lex=function(t){return t=t.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(t,!0)},n.prototype.token=function(t,e){var n,i,o,s,a,u,h,c,f,d,p,m,g,v,w,_;for(t=t.replace(/^ +$/gm,"");t;)if((o=this.rules.newline.exec(t))&&(t=t.substring(o[0].length),o[0].length>1&&this.tokens.push({type:"space"})),o=this.rules.code.exec(t)){var M=this.tokens[this.tokens.length-1];t=t.substring(o[0].length),M&&"paragraph"===M.type?M.text+="\n"+o[0].trimRight():(o=o[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",codeBlockStyle:"indented",text:this.options.pedantic?o:b(o,"\n")}))}else if(o=this.rules.fences.exec(t))t=t.substring(o[0].length),this.tokens.push({type:"code",lang:o[2]?o[2].trim():o[2],text:o[3]||""});else if(o=this.rules.heading.exec(t))t=t.substring(o[0].length),this.tokens.push({type:"heading",depth:o[1].length,text:o[2]});else if((o=this.rules.nptable.exec(t))&&(u={type:"table",header:y(o[1].replace(/^ *| *\| *$/g,"")),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:o[3]?o[3].replace(/\n$/,"").split("\n"):[]}).header.length===u.align.length){for(t=t.substring(o[0].length),p=0;p<u.align.length;p++)/^ *-+: *$/.test(u.align[p])?u.align[p]="right":/^ *:-+: *$/.test(u.align[p])?u.align[p]="center":/^ *:-+ *$/.test(u.align[p])?u.align[p]="left":u.align[p]=null;for(p=0;p<u.cells.length;p++)u.cells[p]=y(u.cells[p],u.header.length);this.tokens.push(u)}else if(o=this.rules.hr.exec(t))t=t.substring(o[0].length),this.tokens.push({type:"hr"});else if(o=this.rules.blockquote.exec(t))t=t.substring(o[0].length),this.tokens.push({type:"blockquote_start"}),o=o[0].replace(/^ *> ?/gm,""),this.token(o,e),this.tokens.push({type:"blockquote_end"});else if(o=this.rules.list.exec(t)){for(t=t.substring(o[0].length),h={type:"list_start",ordered:v=(s=o[2]).length>1,start:v?+s:"",loose:!1},this.tokens.push(h),c=[],n=!1,g=(o=o[0].match(this.rules.item)).length,p=0;p<g;p++)d=(u=o[p]).length,~(u=u.replace(/^ *([*+-]|\d+\.) */,"")).indexOf("\n ")&&(d-=u.length,u=this.options.pedantic?u.replace(/^ {1,4}/gm,""):u.replace(new RegExp("^ {1,"+d+"}","gm"),"")),p!==g-1&&(a=r.bullet.exec(o[p+1])[0],(s.length>1?1===a.length:a.length>1||this.options.smartLists&&a!==s)&&(t=o.slice(p+1).join("\n")+t,p=g-1)),i=n||/\n\n(?!\s*$)/.test(u),p!==g-1&&(n="\n"===u.charAt(u.length-1),i||(i=n)),i&&(h.loose=!0),_=void 0,(w=/^\[[ xX]\] /.test(u))&&(_=" "!==u[1],u=u.replace(/^\[[ xX]\] +/,"")),f={type:"list_item_start",task:w,checked:_,loose:i},c.push(f),this.tokens.push(f),this.token(u,!1),this.tokens.push({type:"list_item_end"});if(h.loose)for(g=c.length,p=0;p<g;p++)c[p].loose=!0;this.tokens.push({type:"list_end"})}else if(o=this.rules.html.exec(t))t=t.substring(o[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===o[1]||"script"===o[1]||"style"===o[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(o[0]):l(o[0]):o[0]});else if(e&&(o=this.rules.def.exec(t)))t=t.substring(o[0].length),o[3]&&(o[3]=o[3].substring(1,o[3].length-1)),m=o[1].toLowerCase().replace(/\s+/g," "),this.tokens.links[m]||(this.tokens.links[m]={href:o[2],title:o[3]});else if((o=this.rules.table.exec(t))&&(u={type:"table",header:y(o[1].replace(/^ *| *\| *$/g,"")),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:o[3]?o[3].replace(/\n$/,"").split("\n"):[]}).header.length===u.align.length){for(t=t.substring(o[0].length),p=0;p<u.align.length;p++)/^ *-+: *$/.test(u.align[p])?u.align[p]="right":/^ *:-+: *$/.test(u.align[p])?u.align[p]="center":/^ *:-+ *$/.test(u.align[p])?u.align[p]="left":u.align[p]=null;for(p=0;p<u.cells.length;p++)u.cells[p]=y(u.cells[p].replace(/^ *\| *| *\| *$/g,""),u.header.length);this.tokens.push(u)}else if(o=this.rules.lheading.exec(t))t=t.substring(o[0].length),this.tokens.push({type:"heading",depth:"="===o[2].charAt(0)?1:2,text:o[1]});else if(e&&(o=this.rules.paragraph.exec(t)))t=t.substring(o[0].length),this.tokens.push({type:"paragraph",text:"\n"===o[1].charAt(o[1].length-1)?o[1].slice(0,-1):o[1]});else if(o=this.rules.text.exec(t))t=t.substring(o[0].length),this.tokens.push({type:"text",text:o[0]});else if(t)throw new Error("Infinite loop on byte: "+t.charCodeAt(0));return this.tokens};var i={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:g,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s_])__(?!_)|^\*\*([^\s*])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/,em:/^_([^\s_])_(?!_)|^\*([^\s*<\[])\*(?!\*)|^_([^\s<][\s\S]*?[^\s_])_(?!_|[^\spunctuation])|^_([^\s_<][\s\S]*?[^\s])_(?!_|[^\spunctuation])|^\*([^\s<"][\s\S]*?[^\s\*])\*(?!\*|[^\spunctuation])|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:g,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/};function o(t,e){if(this.options=e||M.defaults,this.links=t,this.rules=i.normal,this.renderer=this.options.renderer||new s,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.pedantic?this.rules=i.pedantic:this.options.gfm&&(this.options.breaks?this.rules=i.breaks:this.rules=i.gfm)}function s(t){this.options=t||M.defaults}function a(){}function u(t){this.tokens=[],this.token=null,this.options=t||M.defaults,this.options.renderer=this.options.renderer||new s,this.renderer=this.options.renderer,this.renderer.options=this.options,this.slugger=new h}function h(){this.seen={}}function l(t,e){if(e){if(l.escapeTest.test(t))return t.replace(l.escapeReplace,(function(t){return l.replacements[t]}))}else if(l.escapeTestNoEncode.test(t))return t.replace(l.escapeReplaceNoEncode,(function(t){return l.replacements[t]}));return t}function c(t){return t.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,(function(t,e){return"colon"===(e=e.toLowerCase())?":":"#"===e.charAt(0)?"x"===e.charAt(1)?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):""}))}function f(t,e){return t=t.source||t,e=e||"",{replace:function(e,r){return r=(r=r.source||r).replace(/(^|[^\[])\^/g,"$1"),t=t.replace(e,r),this},getRegex:function(){return new RegExp(t,e)}}}function d(t,e,r){if(t){try{var n=decodeURIComponent(c(r)).replace(/[^\w:]/g,"").toLowerCase()}catch(t){return null}if(0===n.indexOf("javascript:")||0===n.indexOf("vbscript:")||0===n.indexOf("data:"))return null}e&&!m.test(r)&&(r=function(t,e){p[" "+t]||(/^[^:]+:\/*[^/]*$/.test(t)?p[" "+t]=t+"/":p[" "+t]=b(t,"/",!0));return t=p[" "+t],"//"===e.slice(0,2)?t.replace(/:[\s\S]*/,":")+e:"/"===e.charAt(0)?t.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+e:t+e}(e,r));try{r=encodeURI(r).replace(/%25/g,"%")}catch(t){return null}return r}i._punctuation="!\"#$%&'()*+,\\-./:;<=>?@\\[^_{|}~",i.em=f(i.em).replace(/punctuation/g,i._punctuation).getRegex(),i._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,i._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,i._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,i.autolink=f(i.autolink).replace("scheme",i._scheme).replace("email",i._email).getRegex(),i._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,i.tag=f(i.tag).replace("comment",r._comment).replace("attribute",i._attribute).getRegex(),i._label=/(?:\[[^\[\]]*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,i._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,i._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,i.link=f(i.link).replace("label",i._label).replace("href",i._href).replace("title",i._title).getRegex(),i.reflink=f(i.reflink).replace("label",i._label).getRegex(),i.normal=v({},i),i.pedantic=v({},i.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:f(/^!?\[(label)\]\((.*?)\)/).replace("label",i._label).getRegex(),reflink:f(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",i._label).getRegex()}),i.gfm=v({},i.normal,{escape:f(i.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),i.gfm.url=f(i.gfm.url,"i").replace("email",i.gfm._extended_email).getRegex(),i.breaks=v({},i.gfm,{br:f(i.br).replace("{2,}","*").getRegex(),text:f(i.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),o.rules=i,o.output=function(t,e,r){return new o(e,r).output(t)},o.prototype.output=function(t){for(var e,r,n,i,s,a,u="";t;)if(s=this.rules.escape.exec(t))t=t.substring(s[0].length),u+=l(s[1]);else if(s=this.rules.tag.exec(t))!this.inLink&&/^<a /i.test(s[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(s[0])&&(this.inLink=!1),!this.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(s[0])?this.inRawBlock=!0:this.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(s[0])&&(this.inRawBlock=!1),t=t.substring(s[0].length),u+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):l(s[0]):s[0];else if(s=this.rules.link.exec(t)){var h=w(s[2],"()");if(h>-1){var c=4+s[1].length+h;s[2]=s[2].substring(0,h),s[0]=s[0].substring(0,c).trim(),s[3]=""}t=t.substring(s[0].length),this.inLink=!0,n=s[2],this.options.pedantic?(e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n))?(n=e[1],i=e[3]):i="":i=s[3]?s[3].slice(1,-1):"",n=n.trim().replace(/^<([\s\S]*)>$/,"$1"),u+=this.outputLink(s,{href:o.escapes(n),title:o.escapes(i)}),this.inLink=!1}else if((s=this.rules.reflink.exec(t))||(s=this.rules.nolink.exec(t))){if(t=t.substring(s[0].length),e=(s[2]||s[1]).replace(/\s+/g," "),!(e=this.links[e.toLowerCase()])||!e.href){u+=s[0].charAt(0),t=s[0].substring(1)+t;continue}this.inLink=!0,u+=this.outputLink(s,e),this.inLink=!1}else if(s=this.rules.strong.exec(t))t=t.substring(s[0].length),u+=this.renderer.strong(this.output(s[4]||s[3]||s[2]||s[1]));else if(s=this.rules.em.exec(t))t=t.substring(s[0].length),u+=this.renderer.em(this.output(s[6]||s[5]||s[4]||s[3]||s[2]||s[1]));else if(s=this.rules.code.exec(t))t=t.substring(s[0].length),u+=this.renderer.codespan(l(s[2].trim(),!0));else if(s=this.rules.br.exec(t))t=t.substring(s[0].length),u+=this.renderer.br();else if(s=this.rules.del.exec(t))t=t.substring(s[0].length),u+=this.renderer.del(this.output(s[1]));else if(s=this.rules.autolink.exec(t))t=t.substring(s[0].length),n="@"===s[2]?"mailto:"+(r=l(this.mangle(s[1]))):r=l(s[1]),u+=this.renderer.link(n,null,r);else if(this.inLink||!(s=this.rules.url.exec(t))){if(s=this.rules.text.exec(t))t=t.substring(s[0].length),this.inRawBlock?u+=this.renderer.text(this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):l(s[0]):s[0]):u+=this.renderer.text(l(this.smartypants(s[0])));else if(t)throw new Error("Infinite loop on byte: "+t.charCodeAt(0))}else{if("@"===s[2])n="mailto:"+(r=l(s[0]));else{do{a=s[0],s[0]=this.rules._backpedal.exec(s[0])[0]}while(a!==s[0]);r=l(s[0]),n="www."===s[1]?"http://"+r:r}t=t.substring(s[0].length),u+=this.renderer.link(n,null,r)}return u},o.escapes=function(t){return t?t.replace(o.rules._escapes,"$1"):t},o.prototype.outputLink=function(t,e){var r=e.href,n=e.title?l(e.title):null;return"!"!==t[0].charAt(0)?this.renderer.link(r,n,this.output(t[1])):this.renderer.image(r,n,l(t[1]))},o.prototype.smartypants=function(t){return this.options.smartypants?t.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):t},o.prototype.mangle=function(t){if(!this.options.mangle)return t;for(var e,r="",n=t.length,i=0;i<n;i++)e=t.charCodeAt(i),Math.random()>.5&&(e="x"+e.toString(16)),r+="&#"+e+";";return r},s.prototype.code=function(t,e,r){var n=(e||"").match(/\S*/)[0];if(this.options.highlight){var i=this.options.highlight(t,n);null!=i&&i!==t&&(r=!0,t=i)}return n?'<pre><code class="'+this.options.langPrefix+l(n,!0)+'">'+(r?t:l(t,!0))+"</code></pre>\n":"<pre><code>"+(r?t:l(t,!0))+"</code></pre>"},s.prototype.blockquote=function(t){return"<blockquote>\n"+t+"</blockquote>\n"},s.prototype.html=function(t){return t},s.prototype.heading=function(t,e,r,n){return this.options.headerIds?"<h"+e+' id="'+this.options.headerPrefix+n.slug(r)+'">'+t+"</h"+e+">\n":"<h"+e+">"+t+"</h"+e+">\n"},s.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},s.prototype.list=function(t,e,r){var n=e?"ol":"ul";return"<"+n+(e&&1!==r?' start="'+r+'"':"")+">\n"+t+"</"+n+">\n"},s.prototype.listitem=function(t){return"<li>"+t+"</li>\n"},s.prototype.checkbox=function(t){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},s.prototype.paragraph=function(t){return"<p>"+t+"</p>\n"},s.prototype.table=function(t,e){return e&&(e="<tbody>"+e+"</tbody>"),"<table>\n<thead>\n"+t+"</thead>\n"+e+"</table>\n"},s.prototype.tablerow=function(t){return"<tr>\n"+t+"</tr>\n"},s.prototype.tablecell=function(t,e){var r=e.header?"th":"td";return(e.align?"<"+r+' align="'+e.align+'">':"<"+r+">")+t+"</"+r+">\n"},s.prototype.strong=function(t){return"<strong>"+t+"</strong>"},s.prototype.em=function(t){return"<em>"+t+"</em>"},s.prototype.codespan=function(t){return"<code>"+t+"</code>"},s.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},s.prototype.del=function(t){return"<del>"+t+"</del>"},s.prototype.link=function(t,e,r){if(null===(t=d(this.options.sanitize,this.options.baseUrl,t)))return r;var n='<a href="'+l(t)+'"';return e&&(n+=' title="'+e+'"'),n+=">"+r+"</a>"},s.prototype.image=function(t,e,r){if(null===(t=d(this.options.sanitize,this.options.baseUrl,t)))return r;var n='<img src="'+t+'" alt="'+r+'"';return e&&(n+=' title="'+e+'"'),n+=this.options.xhtml?"/>":">"},s.prototype.text=function(t){return t},a.prototype.strong=a.prototype.em=a.prototype.codespan=a.prototype.del=a.prototype.text=function(t){return t},a.prototype.link=a.prototype.image=function(t,e,r){return""+r},a.prototype.br=function(){return""},u.parse=function(t,e){return new u(e).parse(t)},u.prototype.parse=function(t){this.inline=new o(t.links,this.options),this.inlineText=new o(t.links,v({},this.options,{renderer:new a})),this.tokens=t.reverse();for(var e="";this.next();)e+=this.tok();return e},u.prototype.next=function(){return this.token=this.tokens.pop(),this.token},u.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},u.prototype.parseText=function(){for(var t=this.token.text;"text"===this.peek().type;)t+="\n"+this.next().text;return this.inline.output(t)},u.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,c(this.inlineText.output(this.token.text)),this.slugger);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var t,e,r,n,i="",o="";for(r="",t=0;t<this.token.header.length;t++)r+=this.renderer.tablecell(this.inline.output(this.token.header[t]),{header:!0,align:this.token.align[t]});for(i+=this.renderer.tablerow(r),t=0;t<this.token.cells.length;t++){for(e=this.token.cells[t],r="",n=0;n<e.length;n++)r+=this.renderer.tablecell(this.inline.output(e[n]),{header:!1,align:this.token.align[n]});o+=this.renderer.tablerow(r)}return this.renderer.table(i,o);case"blockquote_start":for(o="";"blockquote_end"!==this.next().type;)o+=this.tok();return this.renderer.blockquote(o);case"list_start":o="";for(var s=this.token.ordered,a=this.token.start;"list_end"!==this.next().type;)o+=this.tok();return this.renderer.list(o,s,a);case"list_item_start":o="";var u=this.token.loose,h=this.token.checked,l=this.token.task;for(this.token.task&&(o+=this.renderer.checkbox(h));"list_item_end"!==this.next().type;)o+=u||"text"!==this.token.type?this.tok():this.parseText();return this.renderer.listitem(o,l,h);case"html":return this.renderer.html(this.token.text);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText());default:var f='Token with "'+this.token.type+'" type was not found.';if(!this.options.silent)throw new Error(f);console.log(f)}},h.prototype.slug=function(t){var e=t.toLowerCase().trim().replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(e)){var r=e;do{this.seen[r]++,e=r+"-"+this.seen[r]}while(this.seen.hasOwnProperty(e))}return this.seen[e]=0,e},l.escapeTest=/[&<>"']/,l.escapeReplace=/[&<>"']/g,l.replacements={"&":"&","<":"<",">":">",'"':""","'":"'"},l.escapeTestNoEncode=/[<>"']|&(?!#?\w+;)/,l.escapeReplaceNoEncode=/[<>"']|&(?!#?\w+;)/g;var p={},m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function g(){}function v(t){for(var e,r,n=1;n<arguments.length;n++)for(r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}function y(t,e){var r=t.replace(/\|/g,(function(t,e,r){for(var n=!1,i=e;--i>=0&&"\\"===r[i];)n=!n;return n?"|":" |"})).split(/ \|/),n=0;if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;n<r.length;n++)r[n]=r[n].trim().replace(/\\\|/g,"|");return r}function b(t,e,r){if(0===t.length)return"";for(var n=0;n<t.length;){var i=t.charAt(t.length-n-1);if(i!==e||r){if(i===e||!r)break;n++}else n++}return t.substr(0,t.length-n)}function w(t,e){if(-1===t.indexOf(e[1]))return-1;for(var r=0,n=0;n<t.length;n++)if("\\"===t[n])n++;else if(t[n]===e[0])r++;else if(t[n]===e[1]&&--r<0)return n;return-1}function _(t){t&&t.sanitize&&!t.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function M(t,e,r){if(null==t)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof t)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected");if(r||"function"==typeof e){r||(r=e,e=null),_(e=v({},M.defaults,e||{}));var i,o,s=e.highlight,a=0;try{i=n.lex(t,e)}catch(t){return r(t)}o=i.length;var h=function(t){if(t)return e.highlight=s,r(t);var n;try{n=u.parse(i,e)}catch(e){t=e}return e.highlight=s,t?r(t):r(null,n)};if(!s||s.length<3)return h();if(delete e.highlight,!o)return h();for(;a<i.length;a++)!function(t){"code"!==t.type?--o||h():s(t.text,t.lang,(function(e,r){return e?h(e):null==r||r===t.text?--o||h():(t.text=r,t.escaped=!0,void(--o||h()))}))}(i[a])}else try{return e&&(e=v({},M.defaults,e)),_(e),u.parse(n.lex(t,e),e)}catch(t){if(t.message+="\nPlease report this to https://github.com/markedjs/marked.",(e||M.defaults).silent)return"<p>An error occurred:</p><pre>"+l(t.message+"",!0)+"</pre>";throw t}}g.exec=g,M.options=M.setOptions=function(t){return v(M.defaults,t),M},M.getDefaults=function(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:new s,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,xhtml:!1}},M.defaults=M.getDefaults(),M.Parser=u,M.parser=u.parse,M.Renderer=s,M.TextRenderer=a,M.Lexer=n,M.lexer=n.lex,M.InlineLexer=o,M.inlineLexer=o.output,M.Slugger=h,M.parse=M,t.exports=M}()}));function Nt(e){var r;return{c(){(r=f("p")).textContent="Loading... (Might take some time on old phones, like 30 seconds.)"},m(t,e){l(t,r,e)},p:t,d(t){t&&c(r)}}}function Pt(t){var e,r,n,i,o,s,a,u,g,v=void 0!==t.$currentChapter&&"0"===t.$currentChapter.toString(),b=Et(t.$currentQuest)+"",_=t.$totalChapters.toNumber()-1!==t.$currentChapter.toNumber(),M=v&&Ot(),k=_&&Bt(t);return{c(){M&&M.c(),e=p(),r=f("article"),n=f("h1"),i=d("Chapter "),o=d(t.$currentChapter),s=p(),u=p(),k&&k.c(),g=m(),a=new w(b,null)},m(t,c){M&&M.m(t,c),l(t,e,c),l(t,r,c),h(r,n),h(n,i),h(n,o),h(r,s),a.m(r),l(t,u,c),k&&k.m(t,c),l(t,g,c)},p(t,r){t.$currentChapter&&(v=void 0!==r.$currentChapter&&"0"===r.$currentChapter.toString()),v?M||((M=Ot()).c(),M.m(e.parentNode,e)):M&&(M.d(1),M=null),t.$currentChapter&&y(o,r.$currentChapter),t.$currentQuest&&b!==(b=Et(r.$currentQuest)+"")&&a.p(b),(t.$totalChapters||t.$currentChapter)&&(_=r.$totalChapters.toNumber()-1!==r.$currentChapter.toNumber()),_?k?k.p(t,r):((k=Bt(r)).c(),k.m(g.parentNode,g)):k&&(k.d(1),k=null)},d(t){M&&M.d(t),t&&(c(e),c(r),c(u)),k&&k.d(t),t&&c(g)}}}function Tt(e){var r,n,i,o,s,a;return{c(){(r=f("h1")).textContent="Congrats, you've solved the challenge!",n=p(),(i=f("h2")).textContent="But you are not done yet.",o=p(),(s=f("button")).textContent="Next Challenge",v(r,"class","hope"),v(s,"class","primary"),a=g(s,"click",e.click_handler_1)},m(t,e){l(t,r,e),l(t,n,e),l(t,i,e),l(t,o,e),l(t,s,e)},p:t,d(t){t&&(c(r),c(n),c(i),c(o),c(s)),a()}}}function It(e){var r,n,i,o,s;return{c(){(r=f("h1")).textContent="Please wait for a few seconds",n=p(),(i=f("p")).textContent="We are calculating the right trajectory to throw your answer into the\n blockchain. This might take up to 10 seconds.",o=p(),(s=f("p")).textContent="If it takes longer, there might be a network problem, try to reload the\n page."},m(t,e){l(t,r,e),l(t,n,e),l(t,i,e),l(t,o,e),l(t,s,e)},p:t,d(t){t&&(c(r),c(n),c(i),c(o),c(s))}}}function Rt(e){var r,n,i,o;return{c(){(r=f("h1")).textContent="Wrong solution :(",n=p(),(i=f("button")).textContent="Try again",v(i,"class","primary"),o=g(i,"click",e.click_handler)},m(t,e){l(t,r,e),l(t,n,e),l(t,i,e)},p:t,d(t){t&&(c(r),c(n),c(i)),o()}}}function Ct(e){var r;return{c(){(r=f("h1")).textContent="Checking the solution",v(r,"class","hope")},m(t,e){l(t,r,e)},p:t,d(t){t&&c(r)}}}function Ot(t){var e;return{c(){(e=f("p")).textContent="This game stores the session in your browser (no cookie, no login, no\n recover password). Be aware that if you use incognito you might lose your\n progress.",v(e,"class","warning")},m(t,r){l(t,e,r)},d(t){t&&c(e)}}}function Bt(t){var e,r,n,o,s,a,u,m,y,w,_=void 0===t.$fundRequest&&t.solution.length&&Dt();return{c(){e=f("div"),r=f("input"),n=p(),_&&_.c(),o=p(),s=f("button"),a=d("Submit"),m=p(),(y=f("p")).innerHTML='<em>\n\t\t\t Are you stuck? Contact us at #6919, or\n\t\t\t <a href="https://twitter.com/dist0rtionproto">send us a message</a>\n\t\t\t .\n\t\t\t </em>',v(r,"placeholder","solution to the puzzle"),v(s,"class","primary"),s.disabled=u=!t.solution.length,v(e,"class","solution svelte-a44rhp"),v(y,"class","info svelte-a44rhp"),w=[g(r,"input",t.input_input_handler),g(s,"click",t.submit)]},m(i,u){l(i,e,u),h(e,r),b(r,t.solution),h(e,n),_&&_.m(e,null),h(e,o),h(e,s),h(s,a),l(i,m,u),l(i,y,u)},p(t,n){t.solution&&r.value!==n.solution&&b(r,n.solution),void 0===n.$fundRequest&&n.solution.length?_||((_=Dt()).c(),_.m(e,o)):_&&(_.d(1),_=null),t.solution&&u!==(u=!n.solution.length)&&(s.disabled=u)},d(t){t&&c(e),_&&_.d(),t&&(c(m),c(y)),i(w)}}}function Dt(t){var e;return{c(){(e=f("p")).innerHTML='\n\t\t\t You have to wait a bit more before submitting your first solution, the\n\t\t\t game is not fully initialized yet. If you wonder why, check the\n\t\t\t <a href="#/about">about page</a>',v(e,"class","warning")},m(t,r){l(t,e,r)},d(t){t&&c(e)}}}function Lt(e){var r;function n(t,e){return"check"===e.state?Ct:"wrong"===e.state?Rt:"mine"===e.state?It:"success"===e.state?Tt:e.$totalChapters&&e.$currentQuest&&e.$currentChapter?Pt:Nt}var i=n(0,e),o=i(e);return{c(){o.c(),r=m()},m(t,e){o.m(t,e),l(t,r,e)},p(t,e){i===(i=n(0,e))&&o?o.p(t,e):(o.d(1),(o=i(e))&&(o.c(),o.m(r.parentNode,r)))},i:t,o:t,d(t){o.d(t),t&&c(r)}}}function Ut(t,e,r){let n,i,o,s,h,l,c,f,d;a(t,wt,t=>{n=t,r("$wallet",n)}),a(t,_t,t=>{i=t,r("$thc",i)}),a(t,gt,t=>{o=t,r("$current",o)}),a(t,yt,t=>{s=t,r("$provider",s)}),a(t,dt,t=>{h=t,r("$lastTransactionMined",h)}),a(t,Mt,t=>{l=t,r("$totalChapters",l)}),a(t,xt,t=>{c=t,r("$currentQuest",c)}),a(t,kt,t=>{f=t,r("$currentChapter",f)}),a(t,St,t=>{d=t,r("$fundRequest",d)});let p="",m="idle";return{solution:p,state:m,submit:async function(){r("solution",p=p.toLowerCase());const t=n.address,e=it.utils.keccak256(it.utils.toUtf8Bytes(p)),a=new it.Wallet(e),l=await a.signMessage(it.utils.arrayify(t)),{r:c,s:f,v:d}=it.utils.splitSignature(l);r("state",m="check");try{const t=await i.functions.submit(d,c,f);u(gt,o.solution=p,o),console.log(t),r("state",m="mine");const e=await s.waitForTransaction(t.hash);u(dt,h=e.transactionHash),console.log("Transaction Mined: "+e),console.log(e),r("solution",p=""),r("state",m="success")}catch(t){r("state",m="wrong")}},$totalChapters:l,$currentQuest:c,$currentChapter:f,$fundRequest:d,click_handler:()=>r("state",m="idle"),click_handler_1:()=>r("state",m="idle"),input_input_handler:function(){p=this.value,r("solution",p)}}}class Ft extends ${constructor(t){super(),H(this,t,Ut,Lt,s,[])}}var zt,jt=(zt=Object.freeze({default:{}}))&&zt.default||zt,Ht=et((function(t){!function(t,e){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function i(t,e,r){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;try{o=jt.Buffer}catch(t){}function s(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o<i;o++){var s=t.charCodeAt(o)-48;n<<=4,n|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function a(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}i.isBN=function(t){return t instanceof i||null!==t&&"object"==typeof t&&t.constructor.wordSize===i.wordSize&&Array.isArray(t.words)},i.max=function(t,e){return t.cmp(e)>0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,n){if("number"==typeof t)return this._initNumber(t,e,n);if("object"==typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initNumber=function(t,e,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(),e,n)},i.prototype._initArray=function(t,e,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 i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===n)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===n)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},i.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,o=0;for(r=t.length-6,n=0;r>=e;r-=6)i=s(t,r,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=s(t,e,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303),this.strip()},i.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,u=Math.min(o,o-s)+r,h=0,l=r;l<u;l+=n)h=a(t,l,l+n,e),this.imuln(i),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==s){var c=1;for(h=a(t,l,t.length,e),l=0;l<s;l++)c*=e;this.imuln(c),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}},i.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},i.prototype.clone=function(){var t=new i(null);return this.copy(t),t},i.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","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"],h=[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],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function c(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<n;h++){for(var l=u>>>26,c=67108863&u,f=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=f;d++){var p=h-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[h]=0|c,u=0|l}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}i.prototype.toString=function(t,e){var n;if(e=0|e||1,16===(t=t||10)||"hex"===t){n="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],c=(16777215&(a<<i|o)).toString(16);n=0!==(o=a>>>24-i&16777215)||s!==this.length-1?u[6-c.length]+c+n:c+n,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(n=o.toString(16)+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var f=h[t],d=l[t];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);n=(p=p.idivn(d)).isZero()?m+n:u[f-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.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},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(t,e){return r(void 0!==o),this.toArrayLike(o,t,e)},i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},i.prototype.toArrayLike=function(t,e,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),l=this.clone();if(u){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-i;a++)h[a]=0;for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),h[o-a-1]=s}return h},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},i.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},i.prototype.ior=function(t){return r(0==(this.negative|t.negative)),this.iuor(t)},i.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},i.prototype.iand=function(t){return r(0==(this.negative|t.negative)),this.iuand(t)},i.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},i.prototype.ixor=function(t){return r(0==(this.negative|t.negative)),this.iuxor(t)},i.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),n=t%26;this._expand(e),n>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return n>0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var n=t/26|0,i=t%26;return this._expand(n+1),this.words[n]=e?this.words[n]|1<<i:this.words[n]&~(1<<i),this.strip()},i.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},i.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(t){return this.clone().isub(t)};var f=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,h=0,l=0|s[0],c=8191&l,f=l>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],v=8191&g,y=g>>>13,b=0|s[3],w=8191&b,_=b>>>13,M=0|s[4],k=8191&M,x=M>>>13,A=0|s[5],S=8191&A,E=A>>>13,N=0|s[6],P=8191&N,T=N>>>13,I=0|s[7],R=8191&I,C=I>>>13,O=0|s[8],B=8191&O,D=O>>>13,L=0|s[9],U=8191&L,F=L>>>13,z=0|a[0],j=8191&z,H=z>>>13,$=0|a[1],G=8191&$,q=$>>>13,K=0|a[2],V=8191&K,W=K>>>13,Z=0|a[3],J=8191&Z,X=Z>>>13,Q=0|a[4],Y=8191&Q,tt=Q>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,lt=0|a[8],ct=8191<,ft=lt>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(h+(n=Math.imul(c,j))|0)+((8191&(i=(i=Math.imul(c,H))+Math.imul(f,j)|0))<<13)|0;h=((o=Math.imul(f,H))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,j),i=(i=Math.imul(p,H))+Math.imul(m,j)|0,o=Math.imul(m,H);var vt=(h+(n=n+Math.imul(c,G)|0)|0)+((8191&(i=(i=i+Math.imul(c,q)|0)+Math.imul(f,G)|0))<<13)|0;h=((o=o+Math.imul(f,q)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,j),i=(i=Math.imul(v,H))+Math.imul(y,j)|0,o=Math.imul(y,H),n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,q)|0;var yt=(h+(n=n+Math.imul(c,V)|0)|0)+((8191&(i=(i=i+Math.imul(c,W)|0)+Math.imul(f,V)|0))<<13)|0;h=((o=o+Math.imul(f,W)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,j),i=(i=Math.imul(w,H))+Math.imul(_,j)|0,o=Math.imul(_,H),n=n+Math.imul(v,G)|0,i=(i=i+Math.imul(v,q)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,q)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,W)|0;var bt=(h+(n=n+Math.imul(c,J)|0)|0)+((8191&(i=(i=i+Math.imul(c,X)|0)+Math.imul(f,J)|0))<<13)|0;h=((o=o+Math.imul(f,X)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(k,j),i=(i=Math.imul(k,H))+Math.imul(x,j)|0,o=Math.imul(x,H),n=n+Math.imul(w,G)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,q)|0,n=n+Math.imul(v,V)|0,i=(i=i+Math.imul(v,W)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,W)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(h+(n=n+Math.imul(c,Y)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(f,Y)|0))<<13)|0;h=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(S,j),i=(i=Math.imul(S,H))+Math.imul(E,j)|0,o=Math.imul(E,H),n=n+Math.imul(k,G)|0,i=(i=i+Math.imul(k,q)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,q)|0,n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(v,J)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,tt)|0;var _t=(h+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(f,rt)|0))<<13)|0;h=((o=o+Math.imul(f,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(P,j),i=(i=Math.imul(P,H))+Math.imul(T,j)|0,o=Math.imul(T,H),n=n+Math.imul(S,G)|0,i=(i=i+Math.imul(S,q)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,q)|0,n=n+Math.imul(k,V)|0,i=(i=i+Math.imul(k,W)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(v,Y)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var Mt=(h+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(f,ot)|0))<<13)|0;h=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(R,j),i=(i=Math.imul(R,H))+Math.imul(C,j)|0,o=Math.imul(C,H),n=n+Math.imul(P,G)|0,i=(i=i+Math.imul(P,q)|0)+Math.imul(T,G)|0,o=o+Math.imul(T,q)|0,n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,W)|0,n=n+Math.imul(k,J)|0,i=(i=i+Math.imul(k,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(v,rt)|0,i=(i=i+Math.imul(v,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var kt=(h+(n=n+Math.imul(c,ut)|0)|0)+((8191&(i=(i=i+Math.imul(c,ht)|0)+Math.imul(f,ut)|0))<<13)|0;h=((o=o+Math.imul(f,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(B,j),i=(i=Math.imul(B,H))+Math.imul(D,j)|0,o=Math.imul(D,H),n=n+Math.imul(R,G)|0,i=(i=i+Math.imul(R,q)|0)+Math.imul(C,G)|0,o=o+Math.imul(C,q)|0,n=n+Math.imul(P,V)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,W)|0,n=n+Math.imul(S,J)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,n=n+Math.imul(k,Y)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(v,ot)|0,i=(i=i+Math.imul(v,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var xt=(h+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,ft)|0)+Math.imul(f,ct)|0))<<13)|0;h=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(U,j),i=(i=Math.imul(U,H))+Math.imul(F,j)|0,o=Math.imul(F,H),n=n+Math.imul(B,G)|0,i=(i=i+Math.imul(B,q)|0)+Math.imul(D,G)|0,o=o+Math.imul(D,q)|0,n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(C,V)|0,o=o+Math.imul(C,W)|0,n=n+Math.imul(P,J)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,X)|0,n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(v,ut)|0,i=(i=i+Math.imul(v,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,ft)|0;var At=(h+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,mt)|0)+Math.imul(f,pt)|0))<<13)|0;h=((o=o+Math.imul(f,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(U,G),i=(i=Math.imul(U,q))+Math.imul(F,G)|0,o=Math.imul(F,q),n=n+Math.imul(B,V)|0,i=(i=i+Math.imul(B,W)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,W)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,X)|0)+Math.imul(C,J)|0,o=o+Math.imul(C,X)|0,n=n+Math.imul(P,Y)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(T,Y)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(v,ct)|0,i=(i=i+Math.imul(v,ft)|0)+Math.imul(y,ct)|0,o=o+Math.imul(y,ft)|0;var St=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(U,V),i=(i=Math.imul(U,W))+Math.imul(F,V)|0,o=Math.imul(F,W),n=n+Math.imul(B,J)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,X)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ht)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ht)|0,n=n+Math.imul(w,ct)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,ft)|0;var Et=(h+(n=n+Math.imul(v,pt)|0)|0)+((8191&(i=(i=i+Math.imul(v,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(U,J),i=(i=Math.imul(U,X))+Math.imul(F,J)|0,o=Math.imul(F,X),n=n+Math.imul(B,Y)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,n=n+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(E,ut)|0,o=o+Math.imul(E,ht)|0,n=n+Math.imul(k,ct)|0,i=(i=i+Math.imul(k,ft)|0)+Math.imul(x,ct)|0,o=o+Math.imul(x,ft)|0;var Nt=(h+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(U,Y),i=(i=Math.imul(U,tt))+Math.imul(F,Y)|0,o=Math.imul(F,tt),n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(D,rt)|0,o=o+Math.imul(D,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(P,ut)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ht)|0,n=n+Math.imul(S,ct)|0,i=(i=i+Math.imul(S,ft)|0)+Math.imul(E,ct)|0,o=o+Math.imul(E,ft)|0;var Pt=(h+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,mt)|0)+Math.imul(x,pt)|0))<<13)|0;h=((o=o+Math.imul(x,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(F,rt)|0,o=Math.imul(F,nt),n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,st)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ht)|0,n=n+Math.imul(P,ct)|0,i=(i=i+Math.imul(P,ft)|0)+Math.imul(T,ct)|0,o=o+Math.imul(T,ft)|0;var Tt=(h+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,mt)|0)+Math.imul(E,pt)|0))<<13)|0;h=((o=o+Math.imul(E,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,ot),i=(i=Math.imul(U,st))+Math.imul(F,ot)|0,o=Math.imul(F,st),n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ht)|0)+Math.imul(D,ut)|0,o=o+Math.imul(D,ht)|0,n=n+Math.imul(R,ct)|0,i=(i=i+Math.imul(R,ft)|0)+Math.imul(C,ct)|0,o=o+Math.imul(C,ft)|0;var It=(h+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(T,pt)|0))<<13)|0;h=((o=o+Math.imul(T,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(U,ut),i=(i=Math.imul(U,ht))+Math.imul(F,ut)|0,o=Math.imul(F,ht),n=n+Math.imul(B,ct)|0,i=(i=i+Math.imul(B,ft)|0)+Math.imul(D,ct)|0,o=o+Math.imul(D,ft)|0;var Rt=(h+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,mt)|0)+Math.imul(C,pt)|0))<<13)|0;h=((o=o+Math.imul(C,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,ct),i=(i=Math.imul(U,ft))+Math.imul(F,ct)|0,o=Math.imul(F,ft);var Ct=(h+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(D,pt)|0))<<13)|0;h=((o=o+Math.imul(D,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863;var Ot=(h+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,mt))+Math.imul(F,pt)|0))<<13)|0;return h=((o=Math.imul(F,mt))+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,u[0]=gt,u[1]=vt,u[2]=yt,u[3]=bt,u[4]=wt,u[5]=_t,u[6]=Mt,u[7]=kt,u[8]=xt,u[9]=At,u[10]=St,u[11]=Et,u[12]=Nt,u[13]=Pt,u[14]=Tt,u[15]=It,u[16]=Rt,u[17]=Ct,u[18]=Ot,0!==h&&(u[19]=h,r.length++),r};function d(t,e,r){return(new p).mulp(t,e,r)}function p(t,e){this.x=t,this.y=e}Math.imul||(f=c),i.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?f(this,t,e):r<63?c(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var l=o-h,c=(0|t.words[l])*(0|e.words[h]),f=67108863&c;a=67108863&(f=f+a|0),i+=(s=(s=s+(c/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):d(this,t,e)},p.prototype.makeRBT=function(t){for(var e=new Array(t),r=i.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},p.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},p.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},p.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),l=0;l<i;l+=a)for(var c=u,f=h,d=0;d<s;d++){var p=r[l+d],m=n[l+d],g=r[l+d+s],v=n[l+d+s],y=c*g-f*v;v=c*v+f*g,g=y,r[l+d]=p+g,n[l+d]=m+v,r[l+d+s]=p-g,n[l+d+s]=m-v,d!==a&&(y=u*c-h*f,f=u*f+h*c,c=y)}},p.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},p.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},p.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},p.prototype.convert13b=function(t,e,n,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],n[2*s]=8191&o,o>>>=13,n[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)n[s]=0;r(0===o),r(0==(-8192&o))},p.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},p.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),h=new Array(n),l=new Array(n),c=new Array(n),f=r.words;f.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,h,n),this.transform(s,o,a,u,n,i),this.transform(h,o,l,c,n,i);for(var d=0;d<n;d++){var p=a[d]*l[d]-u[d]*c[d];u[d]=a[d]*c[d]+u[d]*l[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.mulf=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),d(this,t,e)},i.prototype.imul=function(t){return this.clone().mulTo(t,this)},i.prototype.imuln=function(t){r("number"==typeof t),r(t<67108864);for(var e=0,n=0;n<this.length;n++){var i=(0|this.words[n])*t,o=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=o>>>26,this.words[n]=67108863&o}return 0!==e&&(this.words[n]=e,this.length++),this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new i(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var o=r.sqr();n<e.length;n++,o=o.sqr())0!==e[n]&&(r=r.mul(o));return r},i.prototype.iushln=function(t){r("number"==typeof t&&t>=0);var e,n=t%26,i=(t-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<n;this.words[e]=u|s,s=a>>>26-n}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},i.prototype.ishln=function(t){return r(0===this.negative),this.iushln(t)},i.prototype.iushrn=function(t,e,n){var i;r("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=n;if(i-=s,i=Math.max(0,i),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var l=0;for(h=this.length-1;h>=0&&(0!==l||h>=i);h--){var c=0|this.words[h];this.words[h]=l<<26-o|c>>>o,l=c&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(t,e,n){return r(0===this.negative),this.iushrn(t,e,n)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=1<<e;return!(this.length<=n)&&!!(this.words[n]&i)},i.prototype.imaskn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},i.prototype.maskn=function(t){return this.clone().imaskn(t)},i.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)},i.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.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 e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},i.prototype.addn=function(t){return this.clone().iaddn(t)},i.prototype.subn=function(t){return this.clone().isubn(t)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(t,e,n){var i,o,s=t.length+n;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+n])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+n]=67108863&o}for(;i<this.length-n;i++)a=(o=(0|this.words[i+n])+a)>>26,this.words[i+n]=67108863&o;if(0===a)return this.strip();for(r(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},i.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),o=t,s=0|o.words[o.length-1];0!==(r=26-this._countBits(s))&&(o=o.ushln(r),n.iushln(r),s=0|o.words[o.length-1]);var a,u=n.length-o.length;if("mod"!==e){(a=new i(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var l=n.clone()._ishlnsubmul(o,1,u);0===l.negative&&(n=l,a&&(a.words[u]=1));for(var c=u-1;c>=0;c--){var f=67108864*(0|n.words[o.length+c])+(0|n.words[o.length+c-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(o,f,c);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(o,1,c),n.isZero()||(n.negative^=1);a&&(a.words[c]=f)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},i.prototype.divmod=function(t,e,n){return r(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(o=a.div.neg()),"div"!==e&&(s=a.mod.neg(),n&&0!==s.negative&&s.iadd(t)),{div:o,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(o=a.div.neg()),{div:o,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),n&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modn(t.words[0]))}:this._wordDiv(t,e);var o,s,a},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,n=0,i=this.length-1;i>=0;i--)n=(e*n+(0|this.words[i]))%t;return n},i.prototype.idivn=function(t){r(t<=67108863);for(var e=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*e;this.words[n]=i/t|0,e=i%t}return this.strip()},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new i(1),s=new i(0),a=new i(0),u=new i(1),h=0;e.isEven()&&n.isEven();)e.iushrn(1),n.iushrn(1),++h;for(var l=n.clone(),c=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(l),s.isub(c)),o.iushrn(1),s.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;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(c)),a.iushrn(1),u.iushrn(1);e.cmp(n)>=0?(e.isub(n),o.isub(a),s.isub(u)):(n.isub(e),a.isub(o),u.isub(s))}return{a:a,b:u,gcd:n.iushln(h)}},i.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o,s=new i(1),a=new i(0),u=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(var h=0,l=1;0==(e.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var c=0,f=1;0==(n.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(n.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(n)>=0?(e.isub(n),s.isub(a)):(n.isub(e),a.isub(s))}return(o=0===e.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(t),o},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,n=(t-e)/26,i=1<<e;if(this.length<=n)return this._expand(n+1),this.words[n]|=i,this;for(var o=i,s=n;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,n=t<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)e=1;else{n&&(t=-t),r(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},i.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},i.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new _(t)},i.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)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}g.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(v,g),v.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var i=t.words[9];for(e.words[e.length++]=4194303&i,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(4194303&o)<<4|i>>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(y,g),n(b,g),n(w,g),w.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new y;else if("p192"===t)e=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new w}return m[t]=e,e},_.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){r(0==(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var n=this.m.add(new i(1)).iushrn(2);return this.pow(t,n)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new i(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,h).cmp(u);)l.redIAdd(u);for(var c=this.pow(l,o),f=this.pow(t,o.addn(1).iushrn(1)),d=this.pow(t,o),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g<p);var v=this.pow(c,new i(1).iushln(p-g-1));f=f.redMul(v),c=v.redSqr(),d=d.redMul(c),p=g}return f},_.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},_.prototype.pow=function(t,e){if(e.isZero())return new i(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new i(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var o=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var h=e.words[n],l=u-1;l>=0;l--){var c=h>>l&1;o!==r[0]&&(o=this.sqr(o)),0!==c||0!==s?(s<<=1,s|=c,(4===++a||0===n&&0===l)&&(o=this.mul(o,r[s]),a=0,s=0)):a=0}u=26}return o},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new M(t)},n(M,_),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,Y)}));function $t(t,e,r){const n=Object.create(t);return n.value=e[r],n}function Gt(e){var r,n,i,o,s=e.error.message+"";return{c(){r=f("p"),n=d('something went wrong. "'),i=d(s),o=d('"')},m(t,e){l(t,r,e),h(r,n),h(r,i),h(r,o)},p:t,d(t){t&&c(r)}}}function qt(t){var e,r,n,i;let o=t.values,s=[];for(let e=0;e<o.length;e+=1)s[e]=Vt($t(t,o,e));return{c(){e=f("table"),(r=f("thead")).innerHTML="<tr><td>Address</td> <td>Chapter</td></tr>",n=p(),i=f("tbody");for(let t=0;t<s.length;t+=1)s[t].c();v(e,"class","leaderboard")},m(t,o){l(t,e,o),h(e,r),h(e,n),h(e,i);for(let t=0;t<s.length;t+=1)s[t].m(i,null)},p(t,e){if(t.load||t.$wallet){let r;for(o=e.values,r=0;r<o.length;r+=1){const n=$t(e,o,r);s[r]?s[r].p(t,n):(s[r]=Vt(n),s[r].c(),s[r].m(i,null))}for(;r<s.length;r+=1)s[r].d(1);s.length=o.length}},d(t){t&&c(e),function(t,e){for(let r=0;r<t.length;r+=1)t[r]&&t[r].d(e)}(s,t)}}}function Kt(t){var e;return{c(){(e=f("span")).textContent="that's you",v(e,"class","label hope")},m(t,r){l(t,e,r)},d(t){t&&c(e)}}}function Vt(t){var e,r,n,i,o,s,a,u,m=t.value.shortAddress+"",g=t.value.address.toLowerCase()===t.$wallet.address.toLowerCase(),v=t.value.chapter+"",y=g&&Kt();return{c(){e=f("tr"),r=f("td"),n=d(m),i=p(),y&&y.c(),o=p(),s=f("td"),a=d(v),u=p()},m(t,c){l(t,e,c),h(e,r),h(r,n),h(r,i),y&&y.m(r,null),h(e,o),h(e,s),h(s,a),h(e,u)},p(t,e){t.$wallet&&(g=e.value.address.toLowerCase()===e.$wallet.address.toLowerCase()),g?y||((y=Kt()).c(),y.m(r,null)):y&&(y.d(1),y=null)},d(t){t&&c(e),y&&y.d()}}}function Wt(e){var r;return{c(){(r=f("p")).textContent="Loading..."},m(t,e){l(t,r,e)},p:t,d(t){t&&c(r)}}}function Zt(r){var n,i,o;let s={ctx:r,current:null,token:null,pending:Wt,then:qt,catch:Gt,value:"values",error:"error"};return function(t,r){const n=r.token={};function i(t,i,o,s){if(r.token!==n)return;r.resolved=o&&{[o]:s};const a=e(e({},r.ctx),r.resolved),u=t&&(r.current=t)(a);r.block&&(r.blocks?r.blocks.forEach((t,e)=>{e!==i&&t&&(B(),U(t,1,1,()=>{r.blocks[e]=null}),D())}):r.block.d(1),u.c(),L(u,1),u.m(r.mount(),r.anchor),I()),r.block=u,r.blocks&&(r.blocks[i]=u)}if((o=t)&&"object"==typeof o&&"function"==typeof o.then){const e=k();if(t.then(t=>{M(e),i(r.then,1,r.value,t),M(null)},t=>{M(e),i(r.catch,2,r.error,t),M(null)}),r.current!==r.pending)return i(r.pending,0),!0}else{if(r.current!==r.then)return i(r.then,1,r.value,t),!0;r.resolved={[r.value]:t}}var o}(r.load(),s),{c(){(n=f("h1")).textContent="Leaderboard",i=p(),o=m(),s.block.c()},m(t,e){l(t,n,e),l(t,i,e),l(t,o,e),s.block.m(t,s.anchor=e),s.mount=()=>o.parentNode,s.anchor=o},p(t,n){r=n,s.block.p(t,e(e({},r),s.resolved))},i:t,o:t,d(t){t&&(c(n),c(i),c(o)),s.block.d(t),s.token=null,s=null}}}function Jt(t,e,r){let n,i;async function o(){function t(t){const e=new Ht(t.toString(),10),r=e.shrn(96).toString(16),n=e.maskn(96).toNumber(),i="0x"+r.substr(0,4)+"…"+r.substr(16,4);return{address:"0x"+r,shortAddress:i,chapter:n}}const e=await async function(){const e=it.utils.bigNumberify(0),r=[];let i=0;for(;;){const o=await n.functions.getLeaderboard(i);for(let n of o){const i=it.utils.bigNumberify(n);if(i.eq(e))return r;r.push(t(i))}i++}}();return e.sort((t,e)=>e.chapter-t.chapter),e}return a(t,_t,t=>{n=t,r("$thc",n)}),a(t,wt,t=>{i=t,r("$wallet",i)}),o(),{load:o,$wallet:i}}class Xt extends ${constructor(t){super(),H(this,t,Jt,Zt,s,[])}}function Qt(e){var r,n,i,o,s;return{c(){(r=f("h1")).textContent="???",n=p(),(i=f("p")).innerHTML='\n\t\t\t Welcome to\n\t\t\t <span class="label hope">planetscape</span>\n\t\t\t , a decentralized treasure hunt built on IPFS and Ethereum.\n\t\t\t',o=p(),(s=f("ul")).innerHTML='<li>\n\t\t\t If you get stuck, send us a message\n\t\t\t <a href="https://twitter.com/dist0rtionproto">on Twitter</a>\n\t\t\t , call us at our DECT #6919, or visit us at\n\t\t\t <a href="https://36c3.c3nav.de/l/sdp/" target="_blank">\n\t\t\t the Social Dist0rtion Protocol assembly.\n\t\t\t </a></li> <li>\n\t\t\t This game has been generated using\n\t\t\t <strong>THC</strong>\n\t\t\t (short for Treasure Hunt Creator), a free and open source tool to generate\n\t\t\t decentralzied treasure hunts using Ethereum and IPFS. Code is\n\t\t\t <a href="https://github.com/social-dist0rtion-protocol/thc">\n\t\t\t available on GitHub\n\t\t\t </a></li>',v(r,"class","hope")},m(t,e){l(t,r,e),l(t,n,e),l(t,i,e),l(t,o,e),l(t,s,e)},p:t,i:t,o:t,d(t){t&&(c(r),c(n),c(i),c(o),c(s))}}}function Yt(t,e,r){let n;return a(t,_t,t=>{n=t,r("$thc",n)}),async function(){(async function(){const t=it.utils.bigNumberify(0),e=[];let r=0;for(;;){const i=await n.functions.getLeaderboard(r);for(let r of i){const n=it.utils.bigNumberify(r);if(console.log(n),n.eq(t))return e;e.push(n)}r++}})()}(),{}}class te extends ${constructor(t){super(),H(this,t,Yt,Qt,s,[])}}function ee(t){var e;return{c(){(e=f("textarea")).readOnly=!0,e.value=t.$mnemonic},m(t,r){l(t,e,r)},p(t,r){t.$mnemonic&&(e.value=r.$mnemonic)},d(t){t&&c(e)}}}function re(e){var r,n;return{c(){(r=f("button")).textContent="Reveal mnemonic",n=g(r,"click",e.onReveal)},m(t,e){l(t,r,e)},p:t,d(t){t&&c(r),n()}}}function ne(e){var r,n,o,s,a,u,m,b,w,_,M,k,x,A,S,E,N,P,T,I,R,C,O,B,D,L,U,F,z,j,H,$,G,q,K,V,W,Z,J,X,Q,Y,tt=e.$wallet.address+"",et=void 0===e.$balance?"loading":it.utils.formatEther(e.$balance)+"",rt=lt.network.ETH_NETWORK+"",nt=e.$thc.address+"";function ot(t,e){return e.reveal?ee:re}var st=ot(0,e),at=st(e);return{c(){(r=f("h1")).textContent="Settings",n=p(),(o=f("h2")).textContent="Wallet address",s=p(),a=f("p"),u=d(tt),m=p(),(b=f("h2")).textContent="Wallet balance",w=p(),_=f("p"),M=d(et),k=d("\n Ether"),x=p(),(A=f("h2")).textContent="Network",S=p(),E=f("p"),N=d(rt),P=p(),(T=f("h2")).textContent="Smart Contract",I=p(),R=f("p"),C=d(nt),O=p(),(B=f("h1")).textContent="/!\\ Danger zone /!\\",D=p(),(L=f("p")).textContent="Be careful, you can break things here.",U=p(),(F=f("h2")).textContent="Mnemonic",z=p(),(j=f("p")).textContent="The mnemonic passphrase is used to generate the wallet. You should save it\n somewhere.",H=p(),at.c(),$=p(),(G=f("p")).textContent="You can also restore another mnemonic if you want. Beware you'll lose the old\n one.",q=p(),(K=f("button")).textContent="Restore mnemonic",V=p(),(W=f("h2")).textContent="Reset",Z=p(),(J=f("p")).textContent="Reset the current session, you'll start from Chapter 0 again",X=p(),(Q=f("button")).textContent="Reset game",v(r,"class","hope"),v(o,"class","hope"),v(b,"class","hope"),v(A,"class","hope"),v(T,"class","hope"),Y=[g(K,"click",e.onRestore),g(Q,"click",ie)]},m(t,e){l(t,r,e),l(t,n,e),l(t,o,e),l(t,s,e),l(t,a,e),h(a,u),l(t,m,e),l(t,b,e),l(t,w,e),l(t,_,e),h(_,M),h(_,k),l(t,x,e),l(t,A,e),l(t,S,e),l(t,E,e),h(E,N),l(t,P,e),l(t,T,e),l(t,I,e),l(t,R,e),h(R,C),l(t,O,e),l(t,B,e),l(t,D,e),l(t,L,e),l(t,U,e),l(t,F,e),l(t,z,e),l(t,j,e),l(t,H,e),at.m(t,e),l(t,$,e),l(t,G,e),l(t,q,e),l(t,K,e),l(t,V,e),l(t,W,e),l(t,Z,e),l(t,J,e),l(t,X,e),l(t,Q,e)},p(t,e){t.$wallet&&tt!==(tt=e.$wallet.address+"")&&y(u,tt),t.$balance&&et!==(et=void 0===e.$balance?"loading":it.utils.formatEther(e.$balance)+"")&&y(M,et),t.$thc&&nt!==(nt=e.$thc.address+"")&&y(C,nt),st===(st=ot(0,e))&&at?at.p(t,e):(at.d(1),(at=st(e))&&(at.c(),at.m($.parentNode,$)))},i:t,o:t,d(t){t&&(c(r),c(n),c(o),c(s),c(a),c(m),c(b),c(w),c(_),c(x),c(A),c(S),c(E),c(P),c(T),c(I),c(R),c(O),c(B),c(D),c(L),c(U),c(F),c(z),c(j),c(H)),at.d(t),t&&(c($),c(G),c(q),c(K),c(V),c(W),c(Z),c(J),c(X),c(Q)),i(Y)}}}async function ie(){"yes"===prompt('Type "yes" reset the game')&&(localStorage.clear(),window.location.reload())}function oe(t,e,r){let n,i,o,s;a(t,mt,t=>{n=t,r("$mnemonic",n)}),a(t,wt,t=>{i=t,r("$wallet",i)}),a(t,At,t=>{o=t,r("$balance",o)}),a(t,_t,t=>{s=t,r("$thc",s)});let h=!1,l="";return{reveal:h,onReveal:function(){r("reveal",h=!0)},onRestore:async function(){l=prompt("WARNING: this action will replace the old mnemonic"),"yes"===prompt('Type "yes" to save the new mnemonic')&&u(mt,n=l)},$mnemonic:n,$wallet:i,$balance:o,$thc:s}}class se extends ${constructor(t){super(),H(this,t,oe,ne,s,[])}}function ae(t){var e;return{c(){(e=f("p")).innerHTML='\n\t\t\t There was an error setting up the application. Would be great if you can\n\t\t\t message us\n\t\t\t <a href="https://twitter.com/dist0rtionproto">on Twitter</a>\n\t\t\t .\n\t\t\t ',v(e,"class","error")},m(t,r){l(t,e,r)},d(t){t&&c(e)}}}function ue(e){var r;return{c(){(r=f("p")).textContent="Loading... (Might take some time on old phones, like 30 seconds.)"},m(t,e){l(t,r,e)},p:t,i:t,o:t,d(t){t&&c(r)}}}function he(e){var r,n=new Q({props:{routes:e.routes}});return{c(){n.$$.fragment.c()},m(t,e){F(n,t,e),r=!0},p:t,i(t){r||(L(n.$$.fragment,t),r=!0)},o(t){U(n.$$.fragment,t),r=!1},d(t){z(n,t)}}}function le(t){var e,r,n,i,o,s,a,u,d=void 0!==t.$fundRequest&&t.$fundRequest.error&&ae(),m=[he,ue],g=[];function y(t,e){return e.$wallet&&e.$provider&&e.$thc?0:1}return s=y(0,t),a=g[s]=m[s](t),{c(){e=f("div"),(r=f("nav")).innerHTML='<ul><li><a href="#/">Game</a></li> <li><a href="#/leaderboard">Leaderboard</a></li> <li><a href="#/settings">Settings</a></li> <li><a href="#/about">???</a></li></ul>',n=p(),i=f("main"),d&&d.c(),o=p(),a.c(),v(e,"class","container svelte-dry6z6")},m(t,a){l(t,e,a),h(e,r),h(e,n),h(e,i),d&&d.m(i,null),h(i,o),g[s].m(i,null),u=!0},p(t,e){void 0!==e.$fundRequest&&e.$fundRequest.error?d||((d=ae()).c(),d.m(i,o)):d&&(d.d(1),d=null);var r=s;(s=y(0,e))===r?g[s].p(t,e):(B(),U(g[r],1,1,()=>{g[r]=null}),D(),(a=g[s])||(a=g[s]=m[s](e)).c(),L(a,1),a.m(i,null))},i(t){u||(L(a),u=!0)},o(t){U(a),u=!1},d(t){t&&c(e),d&&d.d(),g[s].d()}}}function ce(t,e,r){let n,i,o,s;return a(t,St,t=>{n=t,r("$fundRequest",n)}),a(t,wt,t=>{i=t,r("$wallet",i)}),a(t,yt,t=>{o=t,r("$provider",o)}),a(t,_t,t=>{s=t,r("$thc",s)}),{routes:{"/":Ft,"/leaderboard":Xt,"/about":te,"/settings":se},$fundRequest:n,$wallet:i,$provider:o,$thc:s}}console.log(lt),new class extends ${constructor(t){super(),H(this,t,ce,le,s,[])}}({target:document.body})}();